diff --git a/Core/HLE/sceDisplay.cpp b/Core/HLE/sceDisplay.cpp index c554bc1cdc..36f0e0f1fc 100644 --- a/Core/HLE/sceDisplay.cpp +++ b/Core/HLE/sceDisplay.cpp @@ -303,13 +303,12 @@ void __DisplayGetDebugStats(char stats[2048]) { enum { FPS_LIMIT_NORMAL = 0, FPS_LIMIT_CUSTOM = 1, - FPS_LIMIT_TURBO = 2, }; // Let's collect all the throttling and frameskipping logic here. void DoFrameTiming(bool &throttle, bool &skipFrame, float timestep) { int fpsLimiter = PSP_CoreParameter().fpsLimit; - throttle = !PSP_CoreParameter().unthrottle && fpsLimiter != FPS_LIMIT_TURBO; + throttle = !PSP_CoreParameter().unthrottle; skipFrame = false; // Check if the frameskipping code should be enabled. If neither throttling or frameskipping is on, @@ -338,9 +337,10 @@ void DoFrameTiming(bool &throttle, bool &skipFrame, float timestep) { if (nextFrameTime == 0.0) nextFrameTime = time_now_d() + timestep; - // Argh, we are falling behind! Let's skip a frame and see if we catch up. + // Argh, we are falling behind! Let's skip a frame and see if we catch up. - if (g_Config.iFrameSkip == 1) { + // Auto-frameskip automatically if speed limit is set differently than the default. + if (g_Config.iFrameSkip == 1 || (g_Config.iFrameSkip == 0 && fpsLimiter == FPS_LIMIT_CUSTOM)) { // 1 == autoframeskip if (curFrameTime > nextFrameTime && doFrameSkip) { skipFrame = true; @@ -375,10 +375,8 @@ void DoFrameTiming(bool &throttle, bool &skipFrame, float timestep) { if (fpsLimiter == FPS_LIMIT_NORMAL) { nextFrameTime = std::max(nextFrameTime + timestep, time_now_d() - maxFallBehindFrames * timestep); } else if (fpsLimiter == FPS_LIMIT_CUSTOM) { - double customLimiter = g_Config.iFpsLimit; + double customLimiter = (g_Config.iFpsLimit / 60.0f) / timestep; nextFrameTime = std::max(nextFrameTime + 1.0 / customLimiter, time_now_d() - maxFallBehindFrames / customLimiter); - } else { - nextFrameTime = nextFrameTime + timestep; } } diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index 77f3238bb7..3f54bebf06 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -212,7 +212,7 @@ void EmuScreen::onVKeyDown(int virtualKeyCode) { case VIRTKEY_SPEED_TOGGLE: if (PSP_CoreParameter().fpsLimit == 0) { PSP_CoreParameter().fpsLimit = 1; - osm.Show(s->T("fixed", "Speed: fixed"), 1.0); + osm.Show(s->T("fixed", "Speed: alternate"), 1.0); } else if (PSP_CoreParameter().fpsLimit == 1) { PSP_CoreParameter().fpsLimit = 0; diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index b0610a6ccd..eb954abe44 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -178,11 +178,23 @@ void PopupSliderChoiceFloat::Draw(UIContext &dc) { } +static const int alternateSpeedTable[8] = { + 15, 30, 45, 60, 75, 90, 120, 180 +}; + void GameSettingsScreen::CreateViews() { GameInfo *info = g_gameInfoCache.GetInfo(gamePath_, true); cap60FPS_ = g_Config.iForceMaxEmulatedFPS == 60; + + iAlternateSpeedPercent_ = 3; + for (int i = 0; i < 8; i++) { + if (g_Config.iFpsLimit <= alternateSpeedTable[i]) { + iAlternateSpeedPercent_ = i; + break; + } + } // Information in the top left. // Back button to the bottom left. @@ -238,6 +250,10 @@ void GameSettingsScreen::CreateViews() { static const char *frameSkip[] = {"Off", "Auto", "1", "2", "3", "4", "5", "6", "7", "8"}; graphicsSettings->Add(new PopupMultiChoice(&g_Config.iFrameSkip, gs->T("Frame Skipping"), frameSkip, 0, 9, gs, screenManager())); static const char *fpsChoices[] = {"None", "Speed", "FPS", "Both"}; + + static const char *customSpeed[] = {"25%", "50%", "75%", "100%", "125%", "150%", "200%", "300%"}; + graphicsSettings->Add(new PopupMultiChoice(&iAlternateSpeedPercent_, gs->T("Alternative Speed"), customSpeed, 0, 8, 0, screenManager())); + graphicsSettings->Add(new PopupMultiChoice(&g_Config.iShowFPSCounter, gs->T("Show FPS Counter"), fpsChoices, 0, 4, gs, screenManager())); graphicsSettings->Add(new CheckBox(&g_Config.bShowDebugStats, gs->T("Show Debug Statistics"))); graphicsSettings->Add(new CheckBox(&cap60FPS_, gs->T("Force 60 FPS or less (helps GoW)"))); @@ -347,6 +363,7 @@ void GameSettingsScreen::DrawBackground(UIContext &dc) { void GameSettingsScreen::update(InputState &input) { UIScreen::update(input); g_Config.iForceMaxEmulatedFPS = cap60FPS_ ? 60 : 0; + g_Config.iFpsLimit = alternateSpeedTable[iAlternateSpeedPercent_]; } UI::EventReturn GameSettingsScreen::OnBack(UI::EventParams &e) { diff --git a/UI/GameSettingsScreen.h b/UI/GameSettingsScreen.h index cd0e531164..9a1a06119e 100644 --- a/UI/GameSettingsScreen.h +++ b/UI/GameSettingsScreen.h @@ -24,7 +24,7 @@ // per game. class GameSettingsScreen : public UIDialogScreenWithBackground { public: - GameSettingsScreen(std::string gamePath, std::string gameID = "") : gamePath_(gamePath), gameID_(gameID) {} + GameSettingsScreen(std::string gamePath, std::string gameID = "") : gamePath_(gamePath), gameID_(gameID), iAlternateSpeedPercent_(3) {} virtual void update(InputState &input); @@ -46,6 +46,7 @@ private: // Temporaries to convert bools to int settings bool cap60FPS_; + int iAlternateSpeedPercent_; }; // TODO: Move to its own file. diff --git a/UI/MenuScreens.cpp b/UI/MenuScreens.cpp index fc6b134245..5cf38d0f20 100644 --- a/UI/MenuScreens.cpp +++ b/UI/MenuScreens.cpp @@ -711,7 +711,6 @@ void ControlsScreen::render() { g_Config.iTouchButtonOpacity = bTransparent ? 15 : 65; } y += 10; - // Button to KeyMapping screen HLinear hlinear(x, y += stride, 20); if (UIButton(GEN_ID, hlinear, 250, 0, c->T("Key Mapping"), ALIGN_LEFT)) { diff --git a/Windows/ppsspp.rc b/Windows/ppsspp.rc index a0b85ee0aa..e7d4eb4949 100644 Binary files a/Windows/ppsspp.rc and b/Windows/ppsspp.rc differ diff --git a/native b/native index 2f7f6adfd2..0819b42171 160000 --- a/native +++ b/native @@ -1 +1 @@ -Subproject commit 2f7f6adfd2cfdc36ff6d9a1e6d537ed053e4c5e9 +Subproject commit 0819b421716f01cb46b4c36dcb99468b8bb5ad9a