Qt: Preserve native FPS target when saving settings

This commit is contained in:
Vicki Pfau 2019-05-22 11:15:21 -07:00
parent a4ceefa321
commit 7f86ebc4e6
1 changed files with 7 additions and 1 deletions

View File

@ -370,7 +370,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);
@ -409,6 +408,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");