diff --git a/pcsx2/VMManager.cpp b/pcsx2/VMManager.cpp index 8ddda7b3b4..5266d4331c 100644 --- a/pcsx2/VMManager.cpp +++ b/pcsx2/VMManager.cpp @@ -209,6 +209,11 @@ void VMManager::SetState(VMState state) else Host::OnVMResumed(); } + else if (state == VMState::Stopping) + { + // If stopping, break execution as soon as possible. + Cpu->ExitExecution(); + } } bool VMManager::HasValidVM() diff --git a/pcsx2/x86/ix86-32/iR5900-32.cpp b/pcsx2/x86/ix86-32/iR5900-32.cpp index 577f43fade..d9de5de4b0 100644 --- a/pcsx2/x86/ix86-32/iR5900-32.cpp +++ b/pcsx2/x86/ix86-32/iR5900-32.cpp @@ -686,7 +686,19 @@ static void recSafeExitExecution() // Force an event test at the end of this block. if (!eeEventTestIsActive) + { + // EE is running. cpuRegs.nextEventCycle = 0; + } + else + { + // IOP might be running, so break out if so. + if (psxRegs.iopCycleEE > 0) + { + psxRegs.iopBreak += psxRegs.iopCycleEE; // record the number of cycles the IOP didn't run. + psxRegs.iopCycleEE = 0; + } + } } static void recResetEE()