From 722de0c7651e0e32a2d1957c360584d5439186b7 Mon Sep 17 00:00:00 2001 From: Morilli <35152647+Morilli@users.noreply.github.com> Date: Wed, 26 Jun 2024 23:32:51 +0200 Subject: [PATCH] Render before throttling By putting the throttle step after the render step, the screen will be updated with the emulated frame's video output immediately instead of having to wait for the throttle sleep to complete. In scenarios where running the core is relatively cheap (<< 1 / fps), this should noticably improve visual latency while playing. For example, assuming a 60fps game (~16.7ms per frame), 5ms core update and 1ms render time, there will be a 10-11ms earlier render. --- src/BizHawk.Client.EmuHawk/MainForm.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/BizHawk.Client.EmuHawk/MainForm.cs b/src/BizHawk.Client.EmuHawk/MainForm.cs index 494e7f0f7b..f6a4efb381 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.cs @@ -880,9 +880,8 @@ namespace BizHawk.Client.EmuHawk } StepRunLoop_Core(); - StepRunLoop_Throttle(); - Render(); + StepRunLoop_Throttle(); // HACK: RAIntegration might peek at memory during messages // we need this to allow memory access here, otherwise it will deadlock