From a96c5e10e6d0863304b64adbfa8b27974639a4c4 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Wed, 22 May 2019 11:15:21 -0700 Subject: [PATCH] Qt: Preserve native FPS target when saving settings --- src/platform/qt/SettingsView.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/platform/qt/SettingsView.cpp b/src/platform/qt/SettingsView.cpp index 025f56a9f..0c54f70bf 100644 --- a/src/platform/qt/SettingsView.cpp +++ b/src/platform/qt/SettingsView.cpp @@ -355,7 +355,6 @@ void SettingsView::updateConfig() { saveSetting("videoSync", m_ui.videoSync); saveSetting("audioSync", m_ui.audioSync); saveSetting("frameskip", m_ui.frameskip); - saveSetting("fpsTarget", m_ui.fpsTarget); saveSetting("autofireThreshold", m_ui.autofireThreshold); saveSetting("lockAspectRatio", m_ui.lockAspectRatio); saveSetting("lockIntegerScaling", m_ui.lockIntegerScaling); @@ -389,6 +388,13 @@ void SettingsView::updateConfig() { saveSetting("fastForwardRatio", m_ui.fastForwardRatio); } + double nativeFps = double(GBA_ARM7TDMI_FREQUENCY) / double(VIDEO_TOTAL_LENGTH); + if (nativeFps - m_ui.fpsTarget->value() < 0.0001) { + m_controller->setOption("fpsTarget", QVariant(nativeFps)); + } else { + saveSetting("fpsTarget", m_ui.fpsTarget); + } + switch (m_ui.idleOptimization->currentIndex() + IDLE_LOOP_IGNORE) { case IDLE_LOOP_IGNORE: saveSetting("idleOptimization", "ignore");