From a9cce557d2408ecc7a55bcf93b0a11b670d5872e Mon Sep 17 00:00:00 2001 From: Jakly <102590697+Jaklyy@users.noreply.github.com> Date: Tue, 14 Jan 2025 12:21:03 -0500 Subject: [PATCH] fix framelimiter bugs (#2256) --- src/frontend/qt_sdl/EmuThread.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/frontend/qt_sdl/EmuThread.cpp b/src/frontend/qt_sdl/EmuThread.cpp index 5a55dfb1..3aabe7e5 100644 --- a/src/frontend/qt_sdl/EmuThread.cpp +++ b/src/frontend/qt_sdl/EmuThread.cpp @@ -366,7 +366,7 @@ void EmuThread::run() if (slowmo) emuInstance->curFPS = emuInstance->slowmoFPS; else if (fastforward) emuInstance->curFPS = emuInstance->fastForwardFPS; - else if (!emuInstance->doLimitFPS) emuInstance->curFPS = 1000.0; + else if (!emuInstance->doLimitFPS && !emuInstance->doAudioSync) emuInstance->curFPS = 1000.0; else emuInstance->curFPS = emuInstance->targetFPS; if (emuInstance->audioDSiVolumeSync && emuInstance->nds->ConsoleType == 1) @@ -389,6 +389,7 @@ void EmuThread::run() if (frametimeStep < 0.001) frametimeStep = 0.001; + if (emuInstance->doLimitFPS) { double curtime = SDL_GetPerformanceCounter() * perfCountsSec; @@ -430,7 +431,7 @@ void EmuThread::run() if (inst == 0) snprintf(melontitle, sizeof(melontitle), "[%d/%.0f] melonDS " MELONDS_VERSION, fps, actualfps); else - snprintf(melontitle, sizeof(melontitle), "[%d/%.0f] melonDS (%d)", fps, fpstarget, inst+1); + snprintf(melontitle, sizeof(melontitle), "[%d/%.0f] melonDS (%d)", fps, actualfps, inst+1); changeWindowTitle(melontitle); } }