From 7826c258b0ce3f4655374ffecb88cb19d1d7b437 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Thu, 19 Dec 2024 20:56:02 +1000 Subject: [PATCH] System: Frame step after runahead Makes it behave as expected. --- src/core/system.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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)