diff --git a/Core/Config.cpp b/Core/Config.cpp index 94bce54019..393d27ab30 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -1224,10 +1224,6 @@ bool Config::LoadAppendedConfig() { } void Config::UpdateAfterSettingAutoFrameSkip() { - if (bAutoFrameSkip && iFrameSkip == 0) { - iFrameSkip = 1; - } - if (bAutoFrameSkip && bSkipBufferEffects) { bSkipBufferEffects = false; } diff --git a/Core/HLE/sceDisplay.cpp b/Core/HLE/sceDisplay.cpp index 6aecc36bb5..b68bb5797c 100644 --- a/Core/HLE/sceDisplay.cpp +++ b/Core/HLE/sceDisplay.cpp @@ -156,8 +156,12 @@ void __DisplayVblankEndCallback(SceUID threadID, SceUID prevCallbackId); void __DisplayFlip(int cyclesLate); static void __DisplaySetFramerate(void); +static bool UseAutoFrameSkip() { + return g_Config.bAutoFrameSkip && !g_Config.bSkipBufferEffects; +} + static bool UseLagSync() { - return g_Config.bForceLagSync && !g_Config.bAutoFrameSkip; + return g_Config.bForceLagSync && !UseAutoFrameSkip(); } static void ScheduleLagSync(int over = 0) { @@ -402,6 +406,8 @@ static void DoFrameTiming(bool throttle, bool *skipFrame, float scaledTimestep, PROFILE_THIS_SCOPE("timing"); *skipFrame = false; + const bool autoFrameSkip = UseAutoFrameSkip(); + // Check if the frameskipping code should be enabled. If neither throttling or frameskipping is on, // we have nothing to do here. bool doFrameSkip = g_Config.iFrameSkip != 0; @@ -424,8 +430,8 @@ static void DoFrameTiming(bool throttle, bool *skipFrame, float scaledTimestep, } // Auto-frameskip automatically if speed limit is set differently than the default. - int frameSkipNum = g_Config.iFrameSkip; - if (g_Config.bAutoFrameSkip && !g_Config.bSkipBufferEffects) { + const int frameSkipNum = g_Config.iFrameSkip; + if (autoFrameSkip) { // autoframeskip // Argh, we are falling behind! Let's skip a frame and see if we catch up. if (curFrameTime > nextFrameTime && doFrameSkip) { diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 31e2e2c70e..f0a103f30e 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -466,7 +466,11 @@ void GameSettingsScreen::CreateGraphicsSettings(UI::ViewGroup *graphicsSettings) graphicsSettings->Add(new ItemHeader(gr->T("Frame Rate Control"))); static const char *frameSkip[] = {"Off", "1", "2", "3", "4", "5", "6", "7", "8"}; - graphicsSettings->Add(new PopupMultiChoice(&g_Config.iFrameSkip, gr->T("Frame Skipping"), frameSkip, 0, ARRAY_SIZE(frameSkip), I18NCat::GRAPHICS, screenManager())); + PopupMultiChoice *frameSkipping = graphicsSettings->Add(new PopupMultiChoice(&g_Config.iFrameSkip, gr->T("Frame Skipping"), frameSkip, 0, ARRAY_SIZE(frameSkip), I18NCat::GRAPHICS, screenManager())); + frameSkipping->SetEnabledFunc([] { + return !g_Config.bAutoFrameSkip; + }); + CheckBox *frameSkipAuto = graphicsSettings->Add(new CheckBox(&g_Config.bAutoFrameSkip, gr->T("Auto FrameSkip"))); frameSkipAuto->OnClick.Add([](UI::EventParams &e) { g_Config.UpdateAfterSettingAutoFrameSkip(); @@ -1073,7 +1077,7 @@ void GameSettingsScreen::CreateNetworkingSettings(UI::ViewGroup *networkingSetti PopupTextInputChoice *qc4 = networkingSettings->Add(new PopupTextInputChoice(GetRequesterToken(), &g_Config.sQuickChat[3], n->T("Quick Chat 4"), "", 32, screenManager())); PopupTextInputChoice *qc5 = networkingSettings->Add(new PopupTextInputChoice(GetRequesterToken(), &g_Config.sQuickChat[4], n->T("Quick Chat 5"), "", 32, screenManager())); #elif defined(USING_QT_UI) -] Choice *qc1 = networkingSettings->Add(new Choice(n->T("Quick Chat 1"))); + Choice *qc1 = networkingSettings->Add(new Choice(n->T("Quick Chat 1"))); Choice *qc2 = networkingSettings->Add(new Choice(n->T("Quick Chat 2"))); Choice *qc3 = networkingSettings->Add(new Choice(n->T("Quick Chat 3"))); Choice *qc4 = networkingSettings->Add(new Choice(n->T("Quick Chat 4")));