mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-01-19 04:13:24 +00:00
Merge pull request #17695 from hrydgard/allow-faster-alternate-speeds
In challenge mode, allow faster alternate speeds (but not slower).
This commit is contained in:
commit
e38138a39d
@ -349,14 +349,16 @@ void __DisplaySetWasPaused() {
|
||||
}
|
||||
|
||||
static int FrameTimingLimit() {
|
||||
if (!Achievements::ChallengeModeActive()) {
|
||||
if (PSP_CoreParameter().fpsLimit == FPSLimit::CUSTOM1)
|
||||
return g_Config.iFpsLimit1;
|
||||
if (PSP_CoreParameter().fpsLimit == FPSLimit::CUSTOM2)
|
||||
return g_Config.iFpsLimit2;
|
||||
if (PSP_CoreParameter().fpsLimit == FPSLimit::ANALOG)
|
||||
return PSP_CoreParameter().analogFpsLimit;
|
||||
}
|
||||
bool challenge = Achievements::ChallengeModeActive();
|
||||
|
||||
// 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);
|
||||
if (PSP_CoreParameter().fpsLimit == FPSLimit::CUSTOM2)
|
||||
return std::max(g_Config.iFpsLimit2, minRate);
|
||||
if (PSP_CoreParameter().fpsLimit == FPSLimit::ANALOG)
|
||||
return std::max(PSP_CoreParameter().analogFpsLimit, minRate);
|
||||
// Note: Fast-forward is OK in challenge mode.
|
||||
if (PSP_CoreParameter().fastForward)
|
||||
return 0;
|
||||
|
@ -584,7 +584,7 @@ void EmuScreen::onVKey(int virtualKeyCode, bool down) {
|
||||
break;
|
||||
|
||||
case VIRTKEY_SPEED_TOGGLE:
|
||||
if (down && !Achievements::WarnUserIfChallengeModeActive()) {
|
||||
if (down) {
|
||||
// Cycle through enabled speeds.
|
||||
if (PSP_CoreParameter().fpsLimit == FPSLimit::NORMAL && g_Config.iFpsLimit1 >= 0) {
|
||||
PSP_CoreParameter().fpsLimit = FPSLimit::CUSTOM1;
|
||||
@ -600,32 +600,28 @@ void EmuScreen::onVKey(int virtualKeyCode, bool down) {
|
||||
break;
|
||||
|
||||
case VIRTKEY_SPEED_CUSTOM1:
|
||||
if (!Achievements::WarnUserIfChallengeModeActive()) {
|
||||
if (down) {
|
||||
if (PSP_CoreParameter().fpsLimit == FPSLimit::NORMAL) {
|
||||
PSP_CoreParameter().fpsLimit = FPSLimit::CUSTOM1;
|
||||
g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("fixed", "Speed: alternate"), 1.0);
|
||||
}
|
||||
} else {
|
||||
if (PSP_CoreParameter().fpsLimit == FPSLimit::CUSTOM1) {
|
||||
PSP_CoreParameter().fpsLimit = FPSLimit::NORMAL;
|
||||
g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("standard", "Speed: standard"), 1.0);
|
||||
}
|
||||
if (down) {
|
||||
if (PSP_CoreParameter().fpsLimit == FPSLimit::NORMAL) {
|
||||
PSP_CoreParameter().fpsLimit = FPSLimit::CUSTOM1;
|
||||
g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("fixed", "Speed: alternate"), 1.0);
|
||||
}
|
||||
} else {
|
||||
if (PSP_CoreParameter().fpsLimit == FPSLimit::CUSTOM1) {
|
||||
PSP_CoreParameter().fpsLimit = FPSLimit::NORMAL;
|
||||
g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("standard", "Speed: standard"), 1.0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case VIRTKEY_SPEED_CUSTOM2:
|
||||
if (!Achievements::WarnUserIfChallengeModeActive()) {
|
||||
if (down) {
|
||||
if (PSP_CoreParameter().fpsLimit == FPSLimit::NORMAL) {
|
||||
PSP_CoreParameter().fpsLimit = FPSLimit::CUSTOM2;
|
||||
g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("SpeedCustom2", "Speed: alternate 2"), 1.0);
|
||||
}
|
||||
} else {
|
||||
if (PSP_CoreParameter().fpsLimit == FPSLimit::CUSTOM2) {
|
||||
PSP_CoreParameter().fpsLimit = FPSLimit::NORMAL;
|
||||
g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("standard", "Speed: standard"), 1.0);
|
||||
}
|
||||
if (down) {
|
||||
if (PSP_CoreParameter().fpsLimit == FPSLimit::NORMAL) {
|
||||
PSP_CoreParameter().fpsLimit = FPSLimit::CUSTOM2;
|
||||
g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("SpeedCustom2", "Speed: alternate 2"), 1.0);
|
||||
}
|
||||
} else {
|
||||
if (PSP_CoreParameter().fpsLimit == FPSLimit::CUSTOM2) {
|
||||
PSP_CoreParameter().fpsLimit = FPSLimit::NORMAL;
|
||||
g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("standard", "Speed: standard"), 1.0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user