diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp index d63aee55e7..37d274fcc8 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp @@ -122,15 +122,17 @@ void Jit64::lXXx(UGeckoInstruction inst) gpr.BindToRegister(d, false, true); SafeLoadToReg(gpr.RX(d), gpr.R(a), accessSize, offset, RegistersInUse(), signExtend); - gpr.Flush(FLUSH_ALL); - fpr.Flush(FLUSH_ALL); - // if it's still 0, we can wait until the next event - TEST(32, R(EAX), R(EAX)); + TEST(32, gpr.R(d), gpr.R(d)); FixupBranch noIdle = J_CC(CC_NZ); + u32 registersInUse = RegistersInUse(); + ABI_PushRegistersAndAdjustStack(registersInUse, false); + ABI_CallFunctionC((void *)&PowerPC::OnIdle, PowerPC::ppcState.gpr[a] + (s32)(s16)inst.SIMM_16); + ABI_PopRegistersAndAdjustStack(registersInUse, false); + // ! we must continue executing of the loop after exception handling, maybe there is still 0 in r0 //MOV(32, M(&PowerPC::ppcState.pc), Imm32(js.compilerPC)); WriteExceptionExit();