mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-09 14:08:58 +01:00
PowerPC/PPCCache: Access PowerPCState through System.
This commit is contained in:
parent
aec3a882d7
commit
6018daa3fa
@ -392,19 +392,21 @@ void Cache::DoState(PointerWrap& p)
|
|||||||
u32 InstructionCache::ReadInstruction(u32 addr)
|
u32 InstructionCache::ReadInstruction(u32 addr)
|
||||||
{
|
{
|
||||||
auto& system = Core::System::GetInstance();
|
auto& system = Core::System::GetInstance();
|
||||||
auto& memory = system.GetMemory();
|
auto& ppc_state = system.GetPPCState();
|
||||||
|
|
||||||
if (!HID0(PowerPC::ppcState).ICE || m_disable_icache) // instruction cache is disabled
|
if (!HID0(ppc_state).ICE || m_disable_icache) // instruction cache is disabled
|
||||||
return memory.Read_U32(addr);
|
return system.GetMemory().Read_U32(addr);
|
||||||
|
|
||||||
u32 value;
|
u32 value;
|
||||||
Read(addr, &value, sizeof(value), HID0(PowerPC::ppcState).ILOCK);
|
Read(addr, &value, sizeof(value), HID0(ppc_state).ILOCK);
|
||||||
return Common::swap32(value);
|
return Common::swap32(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InstructionCache::Invalidate(u32 addr)
|
void InstructionCache::Invalidate(u32 addr)
|
||||||
{
|
{
|
||||||
if (!HID0(PowerPC::ppcState).ICE || m_disable_icache)
|
auto& system = Core::System::GetInstance();
|
||||||
|
auto& ppc_state = system.GetPPCState();
|
||||||
|
if (!HID0(ppc_state).ICE || m_disable_icache)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Invalidates the whole set
|
// Invalidates the whole set
|
||||||
@ -424,7 +426,7 @@ void InstructionCache::Invalidate(u32 addr)
|
|||||||
valid[set] = 0;
|
valid[set] = 0;
|
||||||
modified[set] = 0;
|
modified[set] = 0;
|
||||||
|
|
||||||
Core::System::GetInstance().GetJitInterface().InvalidateICacheLine(addr);
|
system.GetJitInterface().InvalidateICacheLine(addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InstructionCache::RefreshConfig()
|
void InstructionCache::RefreshConfig()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user