From 212f0a358f6c9638215e8e3d4bd76388eaf8495e Mon Sep 17 00:00:00 2001 From: SuuperW Date: Sat, 18 Aug 2018 10:57:32 -0500 Subject: [PATCH] Only wait for the display thread if the previous frame was not skipped. --- desmume/src/frontend/windows/main.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/desmume/src/frontend/windows/main.cpp b/desmume/src/frontend/windows/main.cpp index 5b5e68208..c5b99b420 100755 --- a/desmume/src/frontend/windows/main.cpp +++ b/desmume/src/frontend/windows/main.cpp @@ -1248,7 +1248,6 @@ static struct MainLoopData int toolframecount; } mainLoopData = {0}; - static void StepRunLoop_Core() { input_acquire(); @@ -1300,9 +1299,12 @@ static void StepRunLoop_User() Hud.fps = mainLoopData.fps; Hud.fps3d = GPU->GetFPSRender3D(); - // wait for the HUD to update from last frame - if(frameskiprate==0) WaitForSingleObject(display_done_event, display_done_timeout); - Display(); + if (mainLoopData.framesskipped == 0) + { + WaitForSingleObject(display_done_event, display_done_timeout); + Display(); + } + ResetEvent(display_done_event); mainLoopData.fps3d = Hud.fps3d;