Skip to content

Commit

Permalink
Remove iForceMaxEmulatedFPS and replace with a compat setting for the…
Browse files Browse the repository at this point in the history
… two games that really need it.

Takes care of one setting listed in #8171 "Options to remove"
  • Loading branch information
hrydgard committed Feb 6, 2019
1 parent 210e848 commit 77032a5
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 8 deletions.
1 change: 1 addition & 0 deletions Core/Compatibility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions Core/Compatibility.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ struct CompatFlags {
bool SonicRivalsHack;
bool BlockTransferAllowCreateFB;
bool YugiohSaveFix;
bool ForceMax60FPS;
};

class IniFile;
Expand Down
1 change: 0 additions & 1 deletion Core/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
1 change: 0 additions & 1 deletion Core/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ struct Config {
bool bTexDeposterize;
int iFpsLimit1;
int iFpsLimit2;
int iForceMaxEmulatedFPS;
int iMaxRecent;
int iCurrentStateSlot;
int iRewindFlipFrequency;
Expand Down
4 changes: 2 additions & 2 deletions Core/HLE/sceDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
}
Expand Down
4 changes: 0 additions & 4 deletions UI/GameSettingsScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@ void GameSettingsScreen::CreateViews() {
g_Config.loadGameConfig(gameID_);
}

cap60FPS_ = g_Config.iForceMaxEmulatedFPS == 60;

iAlternateSpeedPercent1_ = g_Config.iFpsLimit1 < 0 ? -1 : (g_Config.iFpsLimit1 * 100) / 60;
iAlternateSpeedPercent2_ = g_Config.iFpsLimit2 < 0 ? -1 : (g_Config.iFpsLimit2 * 100) / 60;

Expand Down Expand Up @@ -276,7 +274,6 @@ void GameSettingsScreen::CreateViews() {
graphicsSettings->Add(new PopupMultiChoice(&g_Config.iFrameSkipType, gr->T("Frame Skipping Type"), frameSkipType, 0, ARRAY_SIZE(frameSkipType), gr->GetName(), screenManager()));
frameSkipAuto_ = graphicsSettings->Add(new CheckBox(&g_Config.bAutoFrameSkip, gr->T("Auto FrameSkip")));
frameSkipAuto_->OnClick.Handle(this, &GameSettingsScreen::OnAutoFrameskip);
graphicsSettings->Add(new CheckBox(&cap60FPS_, gr->T("Force max 60 FPS (helps GoW)")));

PopupSliderChoice *altSpeed1 = graphicsSettings->Add(new PopupSliderChoice(&iAlternateSpeedPercent1_, 0, 1000, gr->T("Alternative Speed", "Alternative speed"), 5, screenManager(), gr->T("%, 0:unlimited")));
altSpeed1->SetFormat("%i%%");
Expand Down Expand Up @@ -1037,7 +1034,6 @@ UI::EventReturn GameSettingsScreen::OnDumpNextFrameToLog(UI::EventParams &e) {

void GameSettingsScreen::update() {
UIScreen::update();
g_Config.iForceMaxEmulatedFPS = cap60FPS_ ? 60 : 0;

g_Config.iFpsLimit1 = iAlternateSpeedPercent1_ < 0 ? -1 : (iAlternateSpeedPercent1_ * 60) / 100;
g_Config.iFpsLimit2 = iAlternateSpeedPercent2_ < 0 ? -1 : (iAlternateSpeedPercent2_ * 60) / 100;
Expand Down
32 changes: 32 additions & 0 deletions assets/compat.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 77032a5

Please sign in to comment.