HW/SystemTimers: Avoid ppcState global.

This commit is contained in:
Admiral H. Curtiss 2023-01-10 06:59:09 +01:00
parent a784fe1f2f
commit 0a0b4d325f
No known key found for this signature in database
GPG Key ID: F051B4C4044F33FB
1 changed files with 5 additions and 3 deletions

View File

@ -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)