diff options
Diffstat (limited to 'src/frontend/qt_sdl')
-rw-r--r-- | src/frontend/qt_sdl/main.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/frontend/qt_sdl/main.cpp b/src/frontend/qt_sdl/main.cpp index 23ab276..4d30dc8 100644 --- a/src/frontend/qt_sdl/main.cpp +++ b/src/frontend/qt_sdl/main.cpp @@ -415,6 +415,8 @@ void EmuThread::run() double frameLimitError = 0.0; double lastMeasureTime = lastTime; + u32 winUpdateCount = 0, winUpdateFreq = 1; + char melontitle[100]; while (EmuRunning != 0) @@ -571,11 +573,16 @@ void EmuThread::run() if (EmuRunning == 0) break; - emit windowUpdate(); + winUpdateCount++; + if (winUpdateCount >= winUpdateFreq) + { + emit windowUpdate(); + winUpdateCount = 0; + } bool fastforward = Input::HotkeyDown(HK_FastForward); - if (Config::AudioSync && (!fastforward) && audioDevice) + if (Config::AudioSync && !fastforward && audioDevice) { SDL_LockMutex(audioSyncLock); while (SPU::GetOutputSize() > 1024) @@ -624,6 +631,10 @@ void EmuThread::run() float fpstarget = 1.0/frametimeStep; + winUpdateFreq = fps / (u32)round(fpstarget); + if (winUpdateFreq < 1) + winUpdateFreq = 1; + sprintf(melontitle, "[%d/%.0f] melonDS " MELONDS_VERSION, fps, fpstarget); changeWindowTitle(melontitle); } |