diff --git a/Source/Core/Core/HW/CPU.cpp b/Source/Core/Core/HW/CPU.cpp index 32b41ee06457..f2c805588666 100644 --- a/Source/Core/Core/HW/CPU.cpp +++ b/Source/Core/Core/HW/CPU.cpp @@ -81,11 +81,17 @@ void CPUManager::StartTimePlayedTimer() auto curr_time = timer.now(); // Check that emulation is not paused + // If the emulation is paused, wait for SetStepping() to reactivate if (m_state == State::Running) { auto diff_time = std::chrono::duration_cast(curr_time - prev_time); time_played.AddTime(diff_time); } + else if (m_state == State::Stepping) + { + m_time_played_finish_sync.Wait(); + curr_time = timer.now(); + } prev_time = curr_time; @@ -313,6 +319,7 @@ void CPUManager::SetStepping(bool stepping) else if (SetStateLocked(State::Running)) { m_state_cpu_cvar.notify_one(); + m_time_played_finish_sync.Set(); RunAdjacentSystems(true); } }