all repos — mgba @ 7f86ebc4e6f8f1d24f2a6276a65b0f2635aad81c

mGBA Game Boy Advance Emulator

Qt: Preserve native FPS target when saving settings
Vicki Pfau vi@endrift.com
Wed, 22 May 2019 11:15:21 -0700
commit

7f86ebc4e6f8f1d24f2a6276a65b0f2635aad81c

parent

a4ceefa3218e7dda4aea2c33f72e257598b7bb4d

1 files changed, 7 insertions(+), 1 deletions(-)

jump to
M src/platform/qt/SettingsView.cppsrc/platform/qt/SettingsView.cpp

@@ -370,7 +370,6 @@ saveSetting("sampleRate", m_ui.sampleRate);

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);

@@ -407,6 +406,13 @@ if (m_ui.fastForwardUnbounded->isChecked()) {

saveSetting("fastForwardRatio", "-1"); } else { 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) {