From 9e53e0920255790872b454e30f6b383800fc1687 Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Wed, 6 Feb 2019 10:54:03 +0100 Subject: [PATCH] Remove iForceMaxEmulatedFPS and replace with a compat setting for the two games that really need it. Takes care of one setting listed in #8171 "Options to remove" --- Core/Compatibility.cpp | 1 + Core/Compatibility.h | 1 + Core/Config.cpp | 1 - Core/Config.h | 1 - Core/HLE/sceDisplay.cpp | 4 ++-- assets/compat.ini | 32 ++++++++++++++++++++++++++++++++ 6 files changed, 36 insertions(+), 4 deletions(-) diff --git a/Core/Compatibility.cpp b/Core/Compatibility.cpp index 855218db6bd0..0f3552e3b362 100644 --- a/Core/Compatibility.cpp +++ b/Core/Compatibility.cpp @@ -61,6 +61,7 @@ void Compatibility::CheckSettings(IniFile &iniFile, const std::string &gameID) { CheckSetting(iniFile, gameID, "SonicRivalsHack", &flags_.SonicRivalsHack); CheckSetting(iniFile, gameID, "BlockTransferAllowCreateFB", &flags_.BlockTransferAllowCreateFB); CheckSetting(iniFile, gameID, "YugiohSaveFix", &flags_.YugiohSaveFix); + CheckSetting(iniFile, gameID, "ForceMax60FPS", &flags_.ForceMax60FPS); } void Compatibility::CheckSetting(IniFile &iniFile, const std::string &gameID, const char *option, bool *flag) { diff --git a/Core/Compatibility.h b/Core/Compatibility.h index 0d74f828f66f..293a6a0d30b8 100644 --- a/Core/Compatibility.h +++ b/Core/Compatibility.h @@ -61,6 +61,7 @@ struct CompatFlags { bool SonicRivalsHack; bool BlockTransferAllowCreateFB; bool YugiohSaveFix; + bool ForceMax60FPS; }; class IniFile; diff --git a/Core/Config.cpp b/Core/Config.cpp index 8326658d1dd2..4c366e5a07a9 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -625,7 +625,6 @@ static ConfigSetting graphicsSettings[] = { #if defined(USING_WIN_UI) ConfigSetting("RestartRequired", &g_Config.bRestartRequired, false, false), #endif - ReportedConfigSetting("ForceMaxEmulatedFPS", &g_Config.iForceMaxEmulatedFPS, 60, true, true), // Most low-performance (and many high performance) mobile GPUs do not support aniso anyway so defaulting to 4 is fine. ConfigSetting("AnisotropyLevel", &g_Config.iAnisotropyLevel, 4, true, true), diff --git a/Core/Config.h b/Core/Config.h index c5cf22f54583..ce8ad1458890 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -176,7 +176,6 @@ struct Config { bool bTexDeposterize; int iFpsLimit1; int iFpsLimit2; - int iForceMaxEmulatedFPS; int iMaxRecent; int iCurrentStateSlot; int iRewindFlipFrequency; diff --git a/Core/HLE/sceDisplay.cpp b/Core/HLE/sceDisplay.cpp index b570aa4aebb9..fadcd298e198 100644 --- a/Core/HLE/sceDisplay.cpp +++ b/Core/HLE/sceDisplay.cpp @@ -928,7 +928,7 @@ u32 sceDisplaySetFramebuf(u32 topaddr, int linesize, int pixelformat, int sync) s64 delayCycles = 0; // Don't count transitions between display off and display on. - if (topaddr != 0 && topaddr != framebuf.topaddr && framebuf.topaddr != 0 && g_Config.iForceMaxEmulatedFPS > 0) { + if (topaddr != 0 && topaddr != framebuf.topaddr && framebuf.topaddr != 0 && PSP_CoreParameter().compat.flags().ForceMax60FPS) { // sceDisplaySetFramebuf() isn't supposed to delay threads at all. This is a hack. // So let's only delay when it's more than 1ms. const s64 FLIP_DELAY_CYCLES_MIN = usToCycles(1000); @@ -952,7 +952,7 @@ u32 sceDisplaySetFramebuf(u32 topaddr, int linesize, int pixelformat, int sync) } // 1001 to account for NTSC timing (59.94 fps.) - u64 expected = msToCycles(1001) / g_Config.iForceMaxEmulatedFPS - LEEWAY_CYCLES_PER_FLIP; + u64 expected = msToCycles(1001) / 60 - LEEWAY_CYCLES_PER_FLIP; lastFlipCycles = now; nextFlipCycles = std::max(lastFlipCycles, nextFlipCycles) + expected; } diff --git a/assets/compat.ini b/assets/compat.ini index d64361c8eb3a..1eb29bc9514d 100644 --- a/assets/compat.ini +++ b/assets/compat.ini @@ -384,3 +384,35 @@ ULJM05940 = true # Yu-Gi-Oh! ARC-V Tag Force Special NPJH00142 = true + +[ForceMax60FPS] +# These games are very heavy and render as fast as they can. They benefit greatly from +# capping the framerate at 60fps. + +# GOW : Ghost of Sparta +UCUS98737 = true +UCAS40323 = true +NPHG00092 = true +NPEG00044 = true +NPJG00120 = true +UCJS10114 = true +UCES01401 = true +# GOW : Chains Of Olympus +UCUS98653 = true +UCUS98705 = true +UCES00842 = true +ULJM05438 = true +ULJM05348 = true +UCKS45084 = true +NPUG80325 = true +NPEG00023 = true +NPHG00028 = true +NPJG00120 = true +# Final Fantasy IV +ULJM05855 = true +NPJH50414 = true +UCAS40334 = true +ULUS10560 = true +UCAS40342 = true +ULES01521 = true +ULJM06122 = true