diff --git a/src/core/system.cpp b/src/core/system.cpp index 3e9dc1404..099bc420b 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -2067,12 +2067,6 @@ void System::FrameDone() s_state.socket_multiplexer->PollEventsWithTimeout(0); #endif - if (s_state.frame_step_request) - { - s_state.frame_step_request = false; - PauseSystem(true); - } - // Save states for rewind and runahead. if (s_state.rewind_save_counter >= 0) { @@ -2111,6 +2105,13 @@ void System::FrameDone() SaveMemoryState(AllocateMemoryState()); } + // Frame step after runahead, otherwise the pause takes precedence and the replay never happens. + if (s_state.frame_step_request) + { + s_state.frame_step_request = false; + PauseSystem(true); + } + Timer::Value current_time = Timer::GetCurrentValue(); // pre-frame sleep accounting (input lag reduction)