summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorAdmiral H. Curtiss <pikachu025@gmail.com>2023-03-28 21:48:22 +0200
committerAdmiral H. Curtiss <pikachu025@gmail.com>2023-04-05 20:09:32 +0200
commit6018daa3fa05542b0f97da43fb4b97722c03e224 (patch)
treecef77bf671e41110643185a98e847b8bb38994f3 /Source/Core
parentaec3a882d7a875e45f97279d4ced3d3140a7cc87 (diff)
PowerPC/PPCCache: Access PowerPCState through System.
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/PowerPC/PPCCache.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/Source/Core/Core/PowerPC/PPCCache.cpp b/Source/Core/Core/PowerPC/PPCCache.cpp
index 7818dcb616..d159eba1f2 100644
--- a/Source/Core/Core/PowerPC/PPCCache.cpp
+++ b/Source/Core/Core/PowerPC/PPCCache.cpp
@@ -392,19 +392,21 @@ void Cache::DoState(PointerWrap& p)
u32 InstructionCache::ReadInstruction(u32 addr)
{
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
- return memory.Read_U32(addr);
+ if (!HID0(ppc_state).ICE || m_disable_icache) // instruction cache is disabled
+ return system.GetMemory().Read_U32(addr);
u32 value;
- Read(addr, &value, sizeof(value), HID0(PowerPC::ppcState).ILOCK);
+ Read(addr, &value, sizeof(value), HID0(ppc_state).ILOCK);
return Common::swap32(value);
}
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;
// Invalidates the whole set
@@ -424,7 +426,7 @@ void InstructionCache::Invalidate(u32 addr)
valid[set] = 0;
modified[set] = 0;
- Core::System::GetInstance().GetJitInterface().InvalidateICacheLine(addr);
+ system.GetJitInterface().InvalidateICacheLine(addr);
}
void InstructionCache::RefreshConfig()