From 0a0b4d325f1878b8d7851486841f82a8fb891f9f Mon Sep 17 00:00:00 2001 From: "Admiral H. Curtiss" Date: Tue, 10 Jan 2023 06:59:09 +0100 Subject: [PATCH] HW/SystemTimers: Avoid ppcState global. --- Source/Core/Core/HW/SystemTimers.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Source/Core/Core/HW/SystemTimers.cpp b/Source/Core/Core/HW/SystemTimers.cpp index de9dc729ae..18bcca7818 100644 --- a/Source/Core/Core/HW/SystemTimers.cpp +++ b/Source/Core/Core/HW/SystemTimers.cpp @@ -153,8 +153,9 @@ void VICallback(Core::System& system, u64 userdata, s64 cyclesLate) void DecrementerCallback(Core::System& system, u64 userdata, s64 cyclesLate) { - PowerPC::ppcState.spr[SPR_DEC] = 0xFFFFFFFF; - PowerPC::ppcState.Exceptions |= EXCEPTION_DECREMENTER; + auto& ppc_state = system.GetPPCState(); + ppc_state.spr[SPR_DEC] = 0xFFFFFFFF; + ppc_state.Exceptions |= EXCEPTION_DECREMENTER; } void PatchEngineCallback(Core::System& system, u64 userdata, s64 cycles_late) @@ -192,8 +193,9 @@ void DecrementerSet() { auto& system = Core::System::GetInstance(); auto& core_timing = system.GetCoreTiming(); + auto& ppc_state = system.GetPPCState(); - u32 decValue = PowerPC::ppcState.spr[SPR_DEC]; + u32 decValue = ppc_state.spr[SPR_DEC]; core_timing.RemoveEvent(et_Dec); if ((decValue & 0x80000000) == 0)