From 5d3e438258c42713b20c6031fea8ed16596b3cb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Wed, 12 Jul 2023 20:55:45 +0200 Subject: [PATCH] Unlimited alternate speed got broken in recent changes. Fix it. --- Core/HLE/sceDisplay.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Core/HLE/sceDisplay.cpp b/Core/HLE/sceDisplay.cpp index 98ace03ef7..92f95779c6 100644 --- a/Core/HLE/sceDisplay.cpp +++ b/Core/HLE/sceDisplay.cpp @@ -351,14 +351,22 @@ void __DisplaySetWasPaused() { static int FrameTimingLimit() { bool challenge = Achievements::ChallengeModeActive(); + auto fixRate = [=](int limit) { + int minRate = challenge ? 60 : 1; + if (limit != 0) { + return std::max(limit, minRate); + } else { + return limit; + } + }; + // Can't slow down in challenge mode. - int minRate = challenge ? 60 : 1; if (PSP_CoreParameter().fpsLimit == FPSLimit::CUSTOM1) - return std::max(g_Config.iFpsLimit1, minRate); + return fixRate(g_Config.iFpsLimit1); if (PSP_CoreParameter().fpsLimit == FPSLimit::CUSTOM2) - return std::max(g_Config.iFpsLimit2, minRate); + return fixRate(g_Config.iFpsLimit2); if (PSP_CoreParameter().fpsLimit == FPSLimit::ANALOG) - return std::max(PSP_CoreParameter().analogFpsLimit, minRate); + return fixRate(PSP_CoreParameter().analogFpsLimit); // Note: Fast-forward is OK in challenge mode. if (PSP_CoreParameter().fastForward) return 0;