diff --git a/pcsx2/HwRead.cpp b/pcsx2/HwRead.cpp index edff191200..461ee4421e 100644 --- a/pcsx2/HwRead.cpp +++ b/pcsx2/HwRead.cpp @@ -30,7 +30,7 @@ static __fi void IntCHackCheck() // Sanity check: To protect from accidentally "rewinding" the cyclecount // on the few times nextBranchCycle can be behind our current cycle. s32 diff = g_nextEventCycle - cpuRegs.cycle; - if( diff > 0 ) cpuRegs.cycle = g_nextEventCycle; + if (diff > 0 && (cpuRegs.cycle - g_lastEventCycle) > 8) cpuRegs.cycle = g_nextEventCycle; } template< uint page > RETURNS_R128 _hwRead128(u32 mem); diff --git a/pcsx2/R5900.cpp b/pcsx2/R5900.cpp index 120506bd1e..57d2e3133c 100644 --- a/pcsx2/R5900.cpp +++ b/pcsx2/R5900.cpp @@ -365,14 +365,14 @@ static bool cpuIntsEnabled(int Interrupt) // if cpuRegs.cycle is greater than this cycle, should check cpuEventTest for updates u32 g_nextEventCycle = 0; - +u32 g_lastEventCycle = 0; // Shared portion of the branch test, called from both the Interpreter // and the recompiler. (moved here to help alleviate redundant code) __fi void _cpuEventTest_Shared() { eeEventTestIsActive = true; g_nextEventCycle = cpuRegs.cycle + eeWaitCycles; - + g_lastEventCycle = cpuRegs.cycle; // ---- INTC / DMAC (CPU-level Exceptions) ----------------- // Done first because exceptions raised during event tests need to be postponed a few // cycles (fixes Grandia II [PAL], which does a spin loop on a vsync and expects to @@ -387,7 +387,7 @@ __fi void _cpuEventTest_Shared() // escape/suspend hooks, and it's really a good idea to suspend/resume emulation before // doing any actual meaningful branchtest logic. - if( cpuTestCycle( nextsCounter, nextCounter ) ) + if ( cpuTestCycle( nextsCounter, nextCounter ) ) { rcntUpdate(); _cpuTestPERF(); diff --git a/pcsx2/R5900.h b/pcsx2/R5900.h index 5fa6bce73c..e5d480bca0 100644 --- a/pcsx2/R5900.h +++ b/pcsx2/R5900.h @@ -260,6 +260,7 @@ alignas(16) extern fpuRegisters fpuRegs; alignas(16) extern tlbs tlb[48]; extern u32 g_nextEventCycle; +extern u32 g_lastEventCycle; extern bool eeEventTestIsActive; extern u32 s_iLastCOP0Cycle; extern u32 s_iLastPERFCycle[2];