diff --git a/Source/Core/Core/PowerPC/Jit64/Jit.cpp b/Source/Core/Core/PowerPC/Jit64/Jit.cpp index 8014b8d4e0..e1f8abdd4b 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit.cpp @@ -534,7 +534,7 @@ bool Jit64::Cleanup() } // SPEED HACK: MMCR0/MMCR1 should be checked at run-time, not at compile time. - if (MMCR0.Hex || MMCR1.Hex) + if (MMCR0(PowerPC::ppcState).Hex || MMCR1.Hex) { ABI_PushRegistersAndAdjustStack({}, 0); ABI_CallFunctionCCC(PowerPC::UpdatePerformanceMonitor, js.downcountAmount, js.numLoadStoreInst, diff --git a/Source/Core/Core/PowerPC/JitArm64/Jit.cpp b/Source/Core/Core/PowerPC/JitArm64/Jit.cpp index e52bbe2931..ae7045053c 100644 --- a/Source/Core/Core/PowerPC/JitArm64/Jit.cpp +++ b/Source/Core/Core/PowerPC/JitArm64/Jit.cpp @@ -288,7 +288,7 @@ void JitArm64::Cleanup() } // SPEED HACK: MMCR0/MMCR1 should be checked at run-time, not at compile time. - if (MMCR0.Hex || MMCR1.Hex) + if (MMCR0(PowerPC::ppcState).Hex || MMCR1.Hex) { MOVP2R(ARM64Reg::X8, &PowerPC::UpdatePerformanceMonitor); MOVI2R(ARM64Reg::X0, js.downcountAmount); diff --git a/Source/Core/Core/PowerPC/PowerPC.cpp b/Source/Core/Core/PowerPC/PowerPC.cpp index 5110788645..5ef46abdcd 100644 --- a/Source/Core/Core/PowerPC/PowerPC.cpp +++ b/Source/Core/Core/PowerPC/PowerPC.cpp @@ -405,7 +405,7 @@ void WriteFullTimeBaseValue(u64 value) void UpdatePerformanceMonitor(u32 cycles, u32 num_load_stores, u32 num_fp_inst) { - switch (MMCR0.PMC1SELECT) + switch (MMCR0(PowerPC::ppcState).PMC1SELECT) { case 0: // No change break; @@ -416,7 +416,7 @@ void UpdatePerformanceMonitor(u32 cycles, u32 num_load_stores, u32 num_fp_inst) break; } - switch (MMCR0.PMC2SELECT) + switch (MMCR0(PowerPC::ppcState).PMC2SELECT) { case 0: // No change break; @@ -455,10 +455,10 @@ void UpdatePerformanceMonitor(u32 cycles, u32 num_load_stores, u32 num_fp_inst) break; } - if ((MMCR0.PMC1INTCONTROL && (PowerPC::ppcState.spr[SPR_PMC1] & 0x80000000) != 0) || - (MMCR0.PMCINTCONTROL && (PowerPC::ppcState.spr[SPR_PMC2] & 0x80000000) != 0) || - (MMCR0.PMCINTCONTROL && (PowerPC::ppcState.spr[SPR_PMC3] & 0x80000000) != 0) || - (MMCR0.PMCINTCONTROL && (PowerPC::ppcState.spr[SPR_PMC4] & 0x80000000) != 0)) + if ((MMCR0(PowerPC::ppcState).PMC1INTCONTROL && (PowerPC::ppcState.spr[SPR_PMC1] & 0x80000000) != 0) || + (MMCR0(PowerPC::ppcState).PMCINTCONTROL && (PowerPC::ppcState.spr[SPR_PMC2] & 0x80000000) != 0) || + (MMCR0(PowerPC::ppcState).PMCINTCONTROL && (PowerPC::ppcState.spr[SPR_PMC3] & 0x80000000) != 0) || + (MMCR0(PowerPC::ppcState).PMCINTCONTROL && (PowerPC::ppcState.spr[SPR_PMC4] & 0x80000000) != 0)) PowerPC::ppcState.Exceptions |= EXCEPTION_PERFORMANCE_MONITOR; } diff --git a/Source/Core/Core/PowerPC/PowerPC.h b/Source/Core/Core/PowerPC/PowerPC.h index 3e8849a2cf..d42e7409d6 100644 --- a/Source/Core/Core/PowerPC/PowerPC.h +++ b/Source/Core/Core/PowerPC/PowerPC.h @@ -240,7 +240,7 @@ void UpdatePerformanceMonitor(u32 cycles, u32 num_load_stores, u32 num_fp_inst); #define HID4(ppc_state) ((UReg_HID4&)(ppc_state).spr[SPR_HID4]) #define DMAU(ppc_state) (*(UReg_DMAU*)&(ppc_state).spr[SPR_DMAU]) #define DMAL(ppc_state) (*(UReg_DMAL*)&(ppc_state).spr[SPR_DMAL]) -#define MMCR0 ((UReg_MMCR0&)PowerPC::ppcState.spr[SPR_MMCR0]) +#define MMCR0(ppc_state) ((UReg_MMCR0&)(ppc_state).spr[SPR_MMCR0]) #define MMCR1 ((UReg_MMCR1&)PowerPC::ppcState.spr[SPR_MMCR1]) #define THRM1 ((UReg_THRM12&)PowerPC::ppcState.spr[SPR_THRM1]) #define THRM2 ((UReg_THRM12&)PowerPC::ppcState.spr[SPR_THRM2])