PowerPC: Parametrize THRM1/2/3 macros.

This commit is contained in:
Admiral H. Curtiss 2023-01-09 21:03:19 +01:00
parent 8bab3ac755
commit 82f3170876
No known key found for this signature in database
GPG Key ID: F051B4C4044F33FB
2 changed files with 6 additions and 6 deletions

View File

@ -486,7 +486,7 @@ void Interpreter::mtspr(UGeckoInstruction inst)
constexpr u32 SIMULATED_TEMP = 42; // °C
auto UpdateThermalReg = [](UReg_THRM12* reg) {
if (!THRM3.E || !reg->V)
if (!THRM3(PowerPC::ppcState).E || !reg->V)
{
reg->TIV = 0;
}
@ -500,8 +500,8 @@ void Interpreter::mtspr(UGeckoInstruction inst)
}
};
UpdateThermalReg(&THRM1);
UpdateThermalReg(&THRM2);
UpdateThermalReg(&THRM1(PowerPC::ppcState));
UpdateThermalReg(&THRM2(PowerPC::ppcState));
break;
}
}

View File

@ -242,9 +242,9 @@ void UpdatePerformanceMonitor(u32 cycles, u32 num_load_stores, u32 num_fp_inst);
#define DMAL(ppc_state) (*(UReg_DMAL*)&(ppc_state).spr[SPR_DMAL])
#define MMCR0(ppc_state) ((UReg_MMCR0&)(ppc_state).spr[SPR_MMCR0])
#define MMCR1(ppc_state) ((UReg_MMCR1&)(ppc_state).spr[SPR_MMCR1])
#define THRM1 ((UReg_THRM12&)PowerPC::ppcState.spr[SPR_THRM1])
#define THRM2 ((UReg_THRM12&)PowerPC::ppcState.spr[SPR_THRM2])
#define THRM3 ((UReg_THRM3&)PowerPC::ppcState.spr[SPR_THRM3])
#define THRM1(ppc_state) ((UReg_THRM12&)(ppc_state).spr[SPR_THRM1])
#define THRM2(ppc_state) ((UReg_THRM12&)(ppc_state).spr[SPR_THRM2])
#define THRM3(ppc_state) ((UReg_THRM3&)(ppc_state).spr[SPR_THRM3])
#define PC PowerPC::ppcState.pc
#define NPC PowerPC::ppcState.npc
#define FPSCR PowerPC::ppcState.fpscr