Rename Unthrottle to Fast-forward globally

This commit is contained in:
Henrik Rydgård 2021-08-17 16:48:47 +02:00
parent 3c62fbc973
commit 928bc88b01
21 changed files with 71 additions and 70 deletions

View File

@ -69,7 +69,7 @@ enum {
PAD_BUTTON_LEFT_TRIGGER = 1 << 21, // Click left thumb stick on X360 PAD_BUTTON_LEFT_TRIGGER = 1 << 21, // Click left thumb stick on X360
PAD_BUTTON_RIGHT_TRIGGER = 1 << 22, // Click left thumb stick on X360 PAD_BUTTON_RIGHT_TRIGGER = 1 << 22, // Click left thumb stick on X360
PAD_BUTTON_UNTHROTTLE = 1 << 20, // Click Tab to unthrottle PAD_BUTTON_FASTFORWARD = 1 << 20, // Click Tab to unthrottle
}; };
#ifndef MAX_KEYQUEUESIZE #ifndef MAX_KEYQUEUESIZE

View File

@ -621,11 +621,11 @@ static int DefaultInternalResolution() {
#endif #endif
} }
static int DefaultUnthrottleMode() { static int DefaultFastForwardMode() {
#if PPSSPP_PLATFORM(ANDROID) || defined(USING_QT_UI) || PPSSPP_PLATFORM(UWP) || PPSSPP_PLATFORM(IOS) #if PPSSPP_PLATFORM(ANDROID) || defined(USING_QT_UI) || PPSSPP_PLATFORM(UWP) || PPSSPP_PLATFORM(IOS)
return (int)UnthrottleMode::SKIP_FLIP; return (int)FastForwardMode::SKIP_FLIP;
#else #else
return (int)UnthrottleMode::CONTINUOUS; return (int)FastForwardMode::CONTINUOUS;
#endif #endif
} }
@ -792,23 +792,23 @@ struct ConfigTranslator {
typedef ConfigTranslator<GPUBackend, GPUBackendToString, GPUBackendFromString> GPUBackendTranslator; typedef ConfigTranslator<GPUBackend, GPUBackendToString, GPUBackendFromString> GPUBackendTranslator;
static int UnthrottleModeFromString(const std::string &s) { static int FastForwardModeFromString(const std::string &s) {
if (!strcasecmp(s.c_str(), "CONTINUOUS")) if (!strcasecmp(s.c_str(), "CONTINUOUS"))
return (int)UnthrottleMode::CONTINUOUS; return (int)FastForwardMode::CONTINUOUS;
if (!strcasecmp(s.c_str(), "SKIP_DRAW")) if (!strcasecmp(s.c_str(), "SKIP_DRAW"))
return (int)UnthrottleMode::SKIP_DRAW; return (int)FastForwardMode::SKIP_DRAW;
if (!strcasecmp(s.c_str(), "SKIP_FLIP")) if (!strcasecmp(s.c_str(), "SKIP_FLIP"))
return (int)UnthrottleMode::SKIP_FLIP; return (int)FastForwardMode::SKIP_FLIP;
return DefaultUnthrottleMode(); return DefaultFastForwardMode();
} }
std::string UnthrottleModeToString(int v) { std::string FastForwardModeToString(int v) {
switch (UnthrottleMode(v)) { switch (FastForwardMode(v)) {
case UnthrottleMode::CONTINUOUS: case FastForwardMode::CONTINUOUS:
return "CONTINUOUS"; return "CONTINUOUS";
case UnthrottleMode::SKIP_DRAW: case FastForwardMode::SKIP_DRAW:
return "SKIP_DRAW"; return "SKIP_DRAW";
case UnthrottleMode::SKIP_FLIP: case FastForwardMode::SKIP_FLIP:
return "SKIP_FLIP"; return "SKIP_FLIP";
} }
return "CONTINUOUS"; return "CONTINUOUS";
@ -843,7 +843,7 @@ static ConfigSetting graphicsSettings[] = {
ReportedConfigSetting("AutoFrameSkip", &g_Config.bAutoFrameSkip, false, true, true), ReportedConfigSetting("AutoFrameSkip", &g_Config.bAutoFrameSkip, false, true, true),
ConfigSetting("FrameRate", &g_Config.iFpsLimit1, 0, true, true), ConfigSetting("FrameRate", &g_Config.iFpsLimit1, 0, true, true),
ConfigSetting("FrameRate2", &g_Config.iFpsLimit2, -1, true, true), ConfigSetting("FrameRate2", &g_Config.iFpsLimit2, -1, true, true),
ConfigSetting("UnthrottlingMode", &g_Config.iUnthrottleMode, &DefaultUnthrottleMode, &UnthrottleModeToString, &UnthrottleModeFromString, true, true), ConfigSetting("UnthrottlingMode", &g_Config.iFastForwardMode, &DefaultFastForwardMode, &FastForwardModeToString, &FastForwardModeFromString, true, true),
#if defined(USING_WIN_UI) #if defined(USING_WIN_UI)
ConfigSetting("RestartRequired", &g_Config.bRestartRequired, false, false), ConfigSetting("RestartRequired", &g_Config.bRestartRequired, false, false),
#endif #endif
@ -999,7 +999,7 @@ static ConfigSetting controlSettings[] = {
ConfigSetting("DPadSpacing", &g_Config.fDpadSpacing, 1.0f, true, true), ConfigSetting("DPadSpacing", &g_Config.fDpadSpacing, 1.0f, true, true),
ConfigSetting("StartKeyX", "StartKeyY", "StartKeyScale", "ShowTouchStart", &g_Config.touchStartKey, defaultTouchPosShow, true, true), ConfigSetting("StartKeyX", "StartKeyY", "StartKeyScale", "ShowTouchStart", &g_Config.touchStartKey, defaultTouchPosShow, true, true),
ConfigSetting("SelectKeyX", "SelectKeyY", "SelectKeyScale", "ShowTouchSelect", &g_Config.touchSelectKey, defaultTouchPosShow, true, true), ConfigSetting("SelectKeyX", "SelectKeyY", "SelectKeyScale", "ShowTouchSelect", &g_Config.touchSelectKey, defaultTouchPosShow, true, true),
ConfigSetting("UnthrottleKeyX", "UnthrottleKeyY", "UnthrottleKeyScale", "ShowTouchUnthrottle", &g_Config.touchUnthrottleKey, defaultTouchPosShow, true, true), ConfigSetting("UnthrottleKeyX", "UnthrottleKeyY", "UnthrottleKeyScale", "ShowTouchUnthrottle", &g_Config.touchFastForwardKey, defaultTouchPosShow, true, true),
ConfigSetting("LKeyX", "LKeyY", "LKeyScale", "ShowTouchLTrigger", &g_Config.touchLKey, defaultTouchPosShow, true, true), ConfigSetting("LKeyX", "LKeyY", "LKeyScale", "ShowTouchLTrigger", &g_Config.touchLKey, defaultTouchPosShow, true, true),
ConfigSetting("RKeyX", "RKeyY", "RKeyScale", "ShowTouchRTrigger", &g_Config.touchRKey, defaultTouchPosShow, true, true), ConfigSetting("RKeyX", "RKeyY", "RKeyScale", "ShowTouchRTrigger", &g_Config.touchRKey, defaultTouchPosShow, true, true),
ConfigSetting("AnalogStickX", "AnalogStickY", "AnalogStickScale", "ShowAnalogStick", &g_Config.touchAnalogStick, defaultTouchPosShow, true, true), ConfigSetting("AnalogStickX", "AnalogStickY", "AnalogStickScale", "ShowAnalogStick", &g_Config.touchAnalogStick, defaultTouchPosShow, true, true),
@ -1834,7 +1834,7 @@ void Config::ResetControlLayout() {
g_Config.fDpadSpacing = 1.0f; g_Config.fDpadSpacing = 1.0f;
reset(g_Config.touchStartKey); reset(g_Config.touchStartKey);
reset(g_Config.touchSelectKey); reset(g_Config.touchSelectKey);
reset(g_Config.touchUnthrottleKey); reset(g_Config.touchFastForwardKey);
reset(g_Config.touchLKey); reset(g_Config.touchLKey);
reset(g_Config.touchRKey); reset(g_Config.touchRKey);
reset(g_Config.touchAnalogStick); reset(g_Config.touchAnalogStick);

View File

@ -173,7 +173,7 @@ public:
bool bVSync; bool bVSync;
int iFrameSkip; int iFrameSkip;
int iFrameSkipType; int iFrameSkipType;
int iUnthrottleMode; // See UnthrottleMode in ConfigValues.h. int iFastForwardMode; // See FastForwardMode in ConfigValues.h.
bool bAutoFrameSkip; bool bAutoFrameSkip;
bool bEnableCardboardVR; // Cardboard Master Switch bool bEnableCardboardVR; // Cardboard Master Switch
@ -348,7 +348,7 @@ public:
float fDpadSpacing; float fDpadSpacing;
ConfigTouchPos touchStartKey; ConfigTouchPos touchStartKey;
ConfigTouchPos touchSelectKey; ConfigTouchPos touchSelectKey;
ConfigTouchPos touchUnthrottleKey; ConfigTouchPos touchFastForwardKey;
ConfigTouchPos touchLKey; ConfigTouchPos touchLKey;
ConfigTouchPos touchRKey; ConfigTouchPos touchRKey;
ConfigTouchPos touchAnalogStick; ConfigTouchPos touchAnalogStick;

View File

@ -111,7 +111,7 @@ enum class AutoLoadSaveState {
NEWEST = 2, NEWEST = 2,
}; };
enum class UnthrottleMode { enum class FastForwardMode {
CONTINUOUS = 0, CONTINUOUS = 0,
SKIP_DRAW = 1, SKIP_DRAW = 1,
SKIP_FLIP = 2, SKIP_FLIP = 2,

View File

@ -75,7 +75,7 @@ struct CoreParameter {
int pixelHeight; int pixelHeight;
// Can be modified at runtime. // Can be modified at runtime.
bool unthrottle = false; bool fastForward = false;
FPSLimit fpsLimit = FPSLimit::NORMAL; FPSLimit fpsLimit = FPSLimit::NORMAL;
bool updateRecent = true; bool updateRecent = true;

View File

@ -518,7 +518,7 @@ static bool FrameTimingThrottled() {
if (PSP_CoreParameter().fpsLimit == FPSLimit::CUSTOM2 && g_Config.iFpsLimit2 == 0) { if (PSP_CoreParameter().fpsLimit == FPSLimit::CUSTOM2 && g_Config.iFpsLimit2 == 0) {
return false; return false;
} }
return !PSP_CoreParameter().unthrottle; return !PSP_CoreParameter().fastForward;
} }
static void DoFrameDropLogging(float scaledTimestep) { static void DoFrameDropLogging(float scaledTimestep) {
@ -557,16 +557,16 @@ static void DoFrameTiming(bool &throttle, bool &skipFrame, float timestep) {
// we have nothing to do here. // we have nothing to do here.
bool doFrameSkip = g_Config.iFrameSkip != 0; bool doFrameSkip = g_Config.iFrameSkip != 0;
bool unthrottleNeedsSkip = g_Config.iUnthrottleMode == (int)UnthrottleMode::SKIP_DRAW; bool fastForwardNeedsSkip = g_Config.iFastForwardMode == (int)FastForwardMode::SKIP_DRAW;
if (g_Config.bVSync && GetGPUBackend() == GPUBackend::VULKAN) { if (g_Config.bVSync && GetGPUBackend() == GPUBackend::VULKAN) {
// Vulkan doesn't support the interval setting, so we force frameskip. // Vulkan doesn't support the interval setting, so we force frameskip.
unthrottleNeedsSkip = true; fastForwardNeedsSkip = true;
// If it's not a clean multiple of 60, we may need frameskip to achieve it. // If it's not a clean multiple of 60, we may need frameskip to achieve it.
if (fpsLimit == 0 || (fpsLimit >= 0 && fpsLimit != 15 && fpsLimit != 30 && fpsLimit != 60)) { if (fpsLimit == 0 || (fpsLimit >= 0 && fpsLimit != 15 && fpsLimit != 30 && fpsLimit != 60)) {
doFrameSkip = true; doFrameSkip = true;
} }
} }
if (!throttle && unthrottleNeedsSkip) { if (!throttle && fastForwardNeedsSkip) {
doFrameSkip = true; doFrameSkip = true;
skipFrame = true; skipFrame = true;
if (numSkippedFrames >= 7) { if (numSkippedFrames >= 7) {
@ -599,7 +599,7 @@ static void DoFrameTiming(bool &throttle, bool &skipFrame, float timestep) {
} }
// Auto-frameskip automatically if speed limit is set differently than the default. // Auto-frameskip automatically if speed limit is set differently than the default.
bool forceFrameskip = fpsLimit > 60 && unthrottleNeedsSkip; bool forceFrameskip = fpsLimit > 60 && fastForwardNeedsSkip;
int frameSkipNum = CalculateFrameSkip(); int frameSkipNum = CalculateFrameSkip();
if (g_Config.bAutoFrameSkip || forceFrameskip) { if (g_Config.bAutoFrameSkip || forceFrameskip) {
// autoframeskip // autoframeskip
@ -622,7 +622,7 @@ static void DoFrameTiming(bool &throttle, bool &skipFrame, float timestep) {
// timestamp to push it to display, and sleep in the render thread to achieve that. // timestamp to push it to display, and sleep in the render thread to achieve that.
if (curFrameTime < nextFrameTime && throttle) { if (curFrameTime < nextFrameTime && throttle) {
// If time gap is huge just jump (somebody unthrottled) // If time gap is huge just jump (somebody fast-forwarded)
if (nextFrameTime - curFrameTime > 2*scaledTimestep) { if (nextFrameTime - curFrameTime > 2*scaledTimestep) {
nextFrameTime = curFrameTime; nextFrameTime = curFrameTime;
} else { } else {
@ -750,14 +750,14 @@ void __DisplayFlip(int cyclesLate) {
bool duplicateFrames = g_Config.bRenderDuplicateFrames && g_Config.iFrameSkip == 0; bool duplicateFrames = g_Config.bRenderDuplicateFrames && g_Config.iFrameSkip == 0;
bool unthrottleNeedsSkip = g_Config.iUnthrottleMode != (int)UnthrottleMode::CONTINUOUS; bool fastForwardNeedsSkip = g_Config.iFastForwardMode != (int)FastForwardMode::CONTINUOUS;
if (g_Config.bVSync && GetGPUBackend() == GPUBackend::VULKAN) { if (g_Config.bVSync && GetGPUBackend() == GPUBackend::VULKAN) {
// Vulkan doesn't support the interval setting, so we force frameskip. // Vulkan doesn't support the interval setting, so we force frameskip.
unthrottleNeedsSkip = true; fastForwardNeedsSkip = true;
} }
// postEffectRequiresFlip is not compatible with frameskip unthrottling, see #12325. // postEffectRequiresFlip is not compatible with frameskip unthrottling, see #12325.
if (g_Config.iRenderingMode != FB_NON_BUFFERED_MODE && !(unthrottleNeedsSkip && !FrameTimingThrottled())) { if (g_Config.iRenderingMode != FB_NON_BUFFERED_MODE && !(fastForwardNeedsSkip && !FrameTimingThrottled())) {
postEffectRequiresFlip = duplicateFrames || g_Config.bShaderChainRequires60FPS; postEffectRequiresFlip = duplicateFrames || g_Config.bShaderChainRequires60FPS;
} }
@ -786,9 +786,9 @@ void __DisplayFlip(int cyclesLate) {
} }
bool forceNoFlip = false; bool forceNoFlip = false;
// Alternative to frameskip unthrottle, where we draw everything. // Alternative to frameskip fast-forward, where we draw everything.
// Useful if skipping a frame breaks graphics or for checking drawing speed. // Useful if skipping a frame breaks graphics or for checking drawing speed.
if (g_Config.iUnthrottleMode == (int)UnthrottleMode::SKIP_FLIP && !FrameTimingThrottled()) { if (g_Config.iFastForwardMode == (int)FastForwardMode::SKIP_FLIP && !FrameTimingThrottled()) {
static double lastFlip = 0; static double lastFlip = 0;
double now = time_now_d(); double now = time_now_d();
if ((now - lastFlip) < 1.0f / System_GetPropertyFloat(SYSPROP_DISPLAY_REFRESH_RATE)) { if ((now - lastFlip) < 1.0f / System_GetPropertyFloat(SYSPROP_DISPLAY_REFRESH_RATE)) {

View File

@ -143,7 +143,7 @@ inline void ClampBufferToS16(s16 *out, const s32 *in, size_t size, s8 volShift)
inline void ClampBufferToS16WithVolume(s16 *out, const s32 *in, size_t size) { inline void ClampBufferToS16WithVolume(s16 *out, const s32 *in, size_t size) {
int volume = g_Config.iGlobalVolume; int volume = g_Config.iGlobalVolume;
if (PSP_CoreParameter().fpsLimit != FPSLimit::NORMAL || PSP_CoreParameter().unthrottle) { if (PSP_CoreParameter().fpsLimit != FPSLimit::NORMAL || PSP_CoreParameter().fastForward) {
if (g_Config.iAltSpeedVolume != -1) { if (g_Config.iAltSpeedVolume != -1) {
volume = g_Config.iAltSpeedVolume; volume = g_Config.iAltSpeedVolume;
} }
@ -266,15 +266,15 @@ void StereoResampler::PushSamples(const s32 *samples, unsigned int numSamples) {
u32 indexW = m_indexW.load(); u32 indexW = m_indexW.load();
u32 cap = m_maxBufsize * 2; u32 cap = m_maxBufsize * 2;
// If unthrottling, no need to fill up the entire buffer, just screws up timing after releasing unthrottle. // If unthrottling, no need to fill up the entire buffer, just screws up timing after releasing the fast-forward button.
if (PSP_CoreParameter().unthrottle) { if (PSP_CoreParameter().fastForward) {
cap = m_targetBufsize * 2; cap = m_targetBufsize * 2;
} }
// Check if we have enough free space // Check if we have enough free space
// indexW == m_indexR results in empty buffer, so indexR must always be smaller than indexW // indexW == m_indexR results in empty buffer, so indexR must always be smaller than indexW
if (numSamples * 2 + ((indexW - m_indexR.load()) & INDEX_MASK) >= cap) { if (numSamples * 2 + ((indexW - m_indexR.load()) & INDEX_MASK) >= cap) {
if (!PSP_CoreParameter().unthrottle) { if (!PSP_CoreParameter().fastForward) {
overrunCount_++; overrunCount_++;
} }
// TODO: "Timestretch" by doing a windowed overlap with existing buffer content? // TODO: "Timestretch" by doing a windowed overlap with existing buffer content?

View File

@ -77,7 +77,7 @@ static const DefMappingStruct defaultQwertyKeyboardKeyMap[] = {
{VIRTKEY_AXIS_X_MIN, NKCODE_J}, {VIRTKEY_AXIS_X_MIN, NKCODE_J},
{VIRTKEY_AXIS_X_MAX, NKCODE_L}, {VIRTKEY_AXIS_X_MAX, NKCODE_L},
{VIRTKEY_RAPID_FIRE, NKCODE_SHIFT_LEFT}, {VIRTKEY_RAPID_FIRE, NKCODE_SHIFT_LEFT},
{VIRTKEY_UNTHROTTLE, NKCODE_TAB}, {VIRTKEY_FASTFORWARD, NKCODE_TAB},
{VIRTKEY_SPEED_TOGGLE, NKCODE_GRAVE}, {VIRTKEY_SPEED_TOGGLE, NKCODE_GRAVE},
{VIRTKEY_PAUSE , NKCODE_ESCAPE}, {VIRTKEY_PAUSE , NKCODE_ESCAPE},
{VIRTKEY_REWIND , NKCODE_DEL}, {VIRTKEY_REWIND , NKCODE_DEL},
@ -107,7 +107,7 @@ static const DefMappingStruct defaultAzertyKeyboardKeyMap[] = {
{VIRTKEY_AXIS_X_MIN, NKCODE_J}, {VIRTKEY_AXIS_X_MIN, NKCODE_J},
{VIRTKEY_AXIS_X_MAX, NKCODE_L}, {VIRTKEY_AXIS_X_MAX, NKCODE_L},
{VIRTKEY_RAPID_FIRE, NKCODE_SHIFT_LEFT}, {VIRTKEY_RAPID_FIRE, NKCODE_SHIFT_LEFT},
{VIRTKEY_UNTHROTTLE, NKCODE_TAB}, {VIRTKEY_FASTFORWARD, NKCODE_TAB},
{VIRTKEY_SPEED_TOGGLE, NKCODE_GRAVE}, {VIRTKEY_SPEED_TOGGLE, NKCODE_GRAVE},
{VIRTKEY_PAUSE , NKCODE_ESCAPE}, {VIRTKEY_PAUSE , NKCODE_ESCAPE},
{VIRTKEY_REWIND , NKCODE_DEL}, {VIRTKEY_REWIND , NKCODE_DEL},
@ -137,7 +137,7 @@ static const DefMappingStruct defaultQwertzKeyboardKeyMap[] = {
{VIRTKEY_AXIS_X_MIN, NKCODE_J}, {VIRTKEY_AXIS_X_MIN, NKCODE_J},
{VIRTKEY_AXIS_X_MAX, NKCODE_L}, {VIRTKEY_AXIS_X_MAX, NKCODE_L},
{VIRTKEY_RAPID_FIRE, NKCODE_SHIFT_LEFT}, {VIRTKEY_RAPID_FIRE, NKCODE_SHIFT_LEFT},
{VIRTKEY_UNTHROTTLE, NKCODE_TAB}, {VIRTKEY_FASTFORWARD, NKCODE_TAB},
{VIRTKEY_SPEED_TOGGLE, NKCODE_GRAVE}, {VIRTKEY_SPEED_TOGGLE, NKCODE_GRAVE},
{VIRTKEY_PAUSE , NKCODE_ESCAPE}, {VIRTKEY_PAUSE , NKCODE_ESCAPE},
{VIRTKEY_REWIND , NKCODE_DEL}, {VIRTKEY_REWIND , NKCODE_DEL},
@ -161,7 +161,7 @@ static const DefMappingStruct default360KeyMap[] = {
{CTRL_SELECT , NKCODE_BUTTON_SELECT}, {CTRL_SELECT , NKCODE_BUTTON_SELECT},
{CTRL_LTRIGGER , NKCODE_BUTTON_L1}, {CTRL_LTRIGGER , NKCODE_BUTTON_L1},
{CTRL_RTRIGGER , NKCODE_BUTTON_R1}, {CTRL_RTRIGGER , NKCODE_BUTTON_R1},
{VIRTKEY_UNTHROTTLE , JOYSTICK_AXIS_RTRIGGER, +1}, {VIRTKEY_FASTFORWARD , JOYSTICK_AXIS_RTRIGGER, +1},
{VIRTKEY_SPEED_TOGGLE, NKCODE_BUTTON_THUMBR}, {VIRTKEY_SPEED_TOGGLE, NKCODE_BUTTON_THUMBR},
{VIRTKEY_PAUSE , JOYSTICK_AXIS_LTRIGGER, +1}, {VIRTKEY_PAUSE , JOYSTICK_AXIS_LTRIGGER, +1},
{VIRTKEY_PAUSE, NKCODE_HOME}, {VIRTKEY_PAUSE, NKCODE_HOME},
@ -185,7 +185,7 @@ static const DefMappingStruct defaultShieldKeyMap[] = {
{CTRL_UP, JOYSTICK_AXIS_HAT_Y, -1}, {CTRL_UP, JOYSTICK_AXIS_HAT_Y, -1},
{CTRL_DOWN, JOYSTICK_AXIS_HAT_Y, +1}, {CTRL_DOWN, JOYSTICK_AXIS_HAT_Y, +1},
{VIRTKEY_SPEED_TOGGLE, JOYSTICK_AXIS_LTRIGGER, +1 }, {VIRTKEY_SPEED_TOGGLE, JOYSTICK_AXIS_LTRIGGER, +1 },
{VIRTKEY_UNTHROTTLE, JOYSTICK_AXIS_RTRIGGER, +1 }, {VIRTKEY_FASTFORWARD, JOYSTICK_AXIS_RTRIGGER, +1 },
{VIRTKEY_PAUSE, NKCODE_BACK }, {VIRTKEY_PAUSE, NKCODE_BACK },
}; };
@ -206,7 +206,7 @@ static const DefMappingStruct defaultMOQI7SKeyMap[] = {
{CTRL_RIGHT, JOYSTICK_AXIS_HAT_X, +1}, {CTRL_RIGHT, JOYSTICK_AXIS_HAT_X, +1},
{CTRL_UP, JOYSTICK_AXIS_HAT_Y, -1}, {CTRL_UP, JOYSTICK_AXIS_HAT_Y, -1},
{CTRL_DOWN, JOYSTICK_AXIS_HAT_Y, +1}, {CTRL_DOWN, JOYSTICK_AXIS_HAT_Y, +1},
{VIRTKEY_UNTHROTTLE, JOYSTICK_AXIS_RZ, +1 }, {VIRTKEY_FASTFORWARD, JOYSTICK_AXIS_RZ, +1 },
{VIRTKEY_PAUSE, NKCODE_BACK }, {VIRTKEY_PAUSE, NKCODE_BACK },
}; };
@ -229,7 +229,7 @@ static const DefMappingStruct defaultPadMap[] = {
{CTRL_SELECT , NKCODE_BACK}, {CTRL_SELECT , NKCODE_BACK},
{CTRL_LTRIGGER , NKCODE_BUTTON_L1}, {CTRL_LTRIGGER , NKCODE_BUTTON_L1},
{CTRL_RTRIGGER , NKCODE_BUTTON_R1}, {CTRL_RTRIGGER , NKCODE_BUTTON_R1},
{VIRTKEY_UNTHROTTLE , NKCODE_BUTTON_R2}, {VIRTKEY_FASTFORWARD , NKCODE_BUTTON_R2},
{VIRTKEY_PAUSE , JOYSTICK_AXIS_LTRIGGER, +1}, {VIRTKEY_PAUSE , JOYSTICK_AXIS_LTRIGGER, +1},
{VIRTKEY_SPEED_TOGGLE, NKCODE_BUTTON_L2}, {VIRTKEY_SPEED_TOGGLE, NKCODE_BUTTON_L2},
{VIRTKEY_AXIS_X_MIN, JOYSTICK_AXIS_X, -1}, {VIRTKEY_AXIS_X_MIN, JOYSTICK_AXIS_X, -1},
@ -270,7 +270,7 @@ static const DefMappingStruct defaultOuyaMap[] = {
{CTRL_SELECT , NKCODE_BUTTON_L2}, {CTRL_SELECT , NKCODE_BUTTON_L2},
{CTRL_LTRIGGER , NKCODE_BUTTON_L1}, {CTRL_LTRIGGER , NKCODE_BUTTON_L1},
{CTRL_RTRIGGER , NKCODE_BUTTON_R1}, {CTRL_RTRIGGER , NKCODE_BUTTON_R1},
{VIRTKEY_UNTHROTTLE , NKCODE_BUTTON_THUMBL}, {VIRTKEY_FASTFORWARD , NKCODE_BUTTON_THUMBL},
{VIRTKEY_PAUSE , NKCODE_BUTTON_THUMBR}, {VIRTKEY_PAUSE , NKCODE_BUTTON_THUMBR},
{VIRTKEY_AXIS_X_MIN, JOYSTICK_AXIS_X, -1}, {VIRTKEY_AXIS_X_MIN, JOYSTICK_AXIS_X, -1},
{VIRTKEY_AXIS_X_MAX, JOYSTICK_AXIS_X, +1}, {VIRTKEY_AXIS_X_MAX, JOYSTICK_AXIS_X, +1},
@ -689,7 +689,7 @@ const KeyMap_IntStrPair psp_button_names[] = {
{VIRTKEY_ANALOG_LIGHTLY, "Analog limiter"}, {VIRTKEY_ANALOG_LIGHTLY, "Analog limiter"},
{VIRTKEY_RAPID_FIRE, "RapidFire"}, {VIRTKEY_RAPID_FIRE, "RapidFire"},
{VIRTKEY_UNTHROTTLE, "Unthrottle"}, {VIRTKEY_FASTFORWARD, "Fast-forward"},
{VIRTKEY_SPEED_TOGGLE, "SpeedToggle"}, {VIRTKEY_SPEED_TOGGLE, "SpeedToggle"},
{VIRTKEY_SPEED_CUSTOM1, "Alt speed 1"}, {VIRTKEY_SPEED_CUSTOM1, "Alt speed 1"},
{VIRTKEY_SPEED_CUSTOM2, "Alt speed 2"}, {VIRTKEY_SPEED_CUSTOM2, "Alt speed 2"},
@ -1065,7 +1065,7 @@ void AutoConfForPad(const std::string &name) {
#ifndef MOBILE_DEVICE #ifndef MOBILE_DEVICE
// Add a couple of convenient keyboard mappings by default, too. // Add a couple of convenient keyboard mappings by default, too.
g_controllerMap[VIRTKEY_PAUSE].push_back(KeyDef(DEVICE_ID_KEYBOARD, NKCODE_ESCAPE)); g_controllerMap[VIRTKEY_PAUSE].push_back(KeyDef(DEVICE_ID_KEYBOARD, NKCODE_ESCAPE));
g_controllerMap[VIRTKEY_UNTHROTTLE].push_back(KeyDef(DEVICE_ID_KEYBOARD, NKCODE_TAB)); g_controllerMap[VIRTKEY_FASTFORWARD].push_back(KeyDef(DEVICE_ID_KEYBOARD, NKCODE_TAB));
g_controllerMapGeneration++; g_controllerMapGeneration++;
#endif #endif
} }

View File

@ -35,7 +35,7 @@ enum {
VIRTKEY_AXIS_X_MAX = 0x40000003, VIRTKEY_AXIS_X_MAX = 0x40000003,
VIRTKEY_AXIS_Y_MAX = 0x40000004, VIRTKEY_AXIS_Y_MAX = 0x40000004,
VIRTKEY_RAPID_FIRE = 0x40000005, VIRTKEY_RAPID_FIRE = 0x40000005,
VIRTKEY_UNTHROTTLE = 0x40000006, VIRTKEY_FASTFORWARD = 0x40000006,
VIRTKEY_PAUSE = 0x40000007, VIRTKEY_PAUSE = 0x40000007,
VIRTKEY_SPEED_TOGGLE = 0x40000008, VIRTKEY_SPEED_TOGGLE = 0x40000008,
VIRTKEY_AXIS_RIGHT_X_MIN = 0x40000009, VIRTKEY_AXIS_RIGHT_X_MIN = 0x40000009,

View File

@ -486,7 +486,7 @@ void GPUCommon::DeviceRestore() {
void GPUCommon::UpdateVsyncInterval(bool force) { void GPUCommon::UpdateVsyncInterval(bool force) {
#if !(PPSSPP_PLATFORM(ANDROID) || defined(USING_QT_UI) || PPSSPP_PLATFORM(UWP) || PPSSPP_PLATFORM(IOS)) #if !(PPSSPP_PLATFORM(ANDROID) || defined(USING_QT_UI) || PPSSPP_PLATFORM(UWP) || PPSSPP_PLATFORM(IOS))
int desiredVSyncInterval = g_Config.bVSync ? 1 : 0; int desiredVSyncInterval = g_Config.bVSync ? 1 : 0;
if (PSP_CoreParameter().unthrottle) { if (PSP_CoreParameter().fastForward) {
desiredVSyncInterval = 0; desiredVSyncInterval = 0;
} }
if (PSP_CoreParameter().fpsLimit != FPSLimit::NORMAL) { if (PSP_CoreParameter().fpsLimit != FPSLimit::NORMAL) {

View File

@ -16,6 +16,7 @@
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include <algorithm> #include <algorithm>
#include <cstring>
#include "ppsspp_config.h" #include "ppsspp_config.h"

View File

@ -553,11 +553,11 @@ void EmuScreen::onVKeyDown(int virtualKeyCode) {
auto sc = GetI18NCategory("Screen"); auto sc = GetI18NCategory("Screen");
switch (virtualKeyCode) { switch (virtualKeyCode) {
case VIRTKEY_UNTHROTTLE: case VIRTKEY_FASTFORWARD:
if (coreState == CORE_STEPPING) { if (coreState == CORE_STEPPING) {
Core_EnableStepping(false); Core_EnableStepping(false);
} }
PSP_CoreParameter().unthrottle = true; PSP_CoreParameter().fastForward = true;
break; break;
case VIRTKEY_SPEED_TOGGLE: case VIRTKEY_SPEED_TOGGLE:
@ -699,8 +699,8 @@ void EmuScreen::onVKeyUp(int virtualKeyCode) {
auto sc = GetI18NCategory("Screen"); auto sc = GetI18NCategory("Screen");
switch (virtualKeyCode) { switch (virtualKeyCode) {
case VIRTKEY_UNTHROTTLE: case VIRTKEY_FASTFORWARD:
PSP_CoreParameter().unthrottle = false; PSP_CoreParameter().fastForward = false;
break; break;
case VIRTKEY_SPEED_CUSTOM1: case VIRTKEY_SPEED_CUSTOM1:

View File

@ -640,9 +640,9 @@ void InitPadLayout(float xres, float yres, float globalScale) {
int select_key_Y = yres - 60 * scale; int select_key_Y = yres - 60 * scale;
initTouchPos(g_Config.touchSelectKey, select_key_X, select_key_Y); initTouchPos(g_Config.touchSelectKey, select_key_X, select_key_Y);
int unthrottle_key_X = halfW - bottom_key_spacing * scale; int fast_forward_key_X = halfW - bottom_key_spacing * scale;
int unthrottle_key_Y = yres - 60 * scale; int fast_forward_key_Y = yres - 60 * scale;
initTouchPos(g_Config.touchUnthrottleKey, unthrottle_key_X, unthrottle_key_Y); initTouchPos(g_Config.touchFastForwardKey, fast_forward_key_X, fast_forward_key_Y);
// L and R------------------------------------------------------------ // L and R------------------------------------------------------------
// Put them above the analog stick / above the buttons to the right. // Put them above the analog stick / above the buttons to the right.
@ -773,10 +773,10 @@ UI::ViewGroup *CreatePadLayout(float xres, float yres, bool *pause, ControlMappe
addPSPButton(CTRL_START, "Start button", rectImage, ImageID("I_RECT"), ImageID("I_START"), g_Config.touchStartKey); addPSPButton(CTRL_START, "Start button", rectImage, ImageID("I_RECT"), ImageID("I_START"), g_Config.touchStartKey);
addPSPButton(CTRL_SELECT, "Select button", rectImage, ImageID("I_RECT"), ImageID("I_SELECT"), g_Config.touchSelectKey); addPSPButton(CTRL_SELECT, "Select button", rectImage, ImageID("I_RECT"), ImageID("I_SELECT"), g_Config.touchSelectKey);
BoolButton *unthrottle = addBoolButton(&PSP_CoreParameter().unthrottle, "Unthrottle button", rectImage, ImageID("I_RECT"), ImageID("I_ARROW"), g_Config.touchUnthrottleKey); BoolButton *fastForward = addBoolButton(&PSP_CoreParameter().fastForward, "Fast-forward button", rectImage, ImageID("I_RECT"), ImageID("I_ARROW"), g_Config.touchFastForwardKey);
if (unthrottle) { if (fastForward) {
unthrottle->SetAngle(180.0f); fastForward->SetAngle(180.0f);
unthrottle->OnChange.Add([](UI::EventParams &e) { fastForward->OnChange.Add([](UI::EventParams &e) {
if (e.a && coreState == CORE_STEPPING) { if (e.a && coreState == CORE_STEPPING) {
Core_EnableStepping(false); Core_EnableStepping(false);
} }

View File

@ -264,7 +264,7 @@ namespace CustomKey {
{ "L", ImageID("I_L"), CTRL_LTRIGGER }, { "L", ImageID("I_L"), CTRL_LTRIGGER },
{ "R", ImageID("I_R"), CTRL_RTRIGGER }, { "R", ImageID("I_R"), CTRL_RTRIGGER },
{ "RapidFire", ImageID::invalid(), VIRTKEY_RAPID_FIRE }, { "RapidFire", ImageID::invalid(), VIRTKEY_RAPID_FIRE },
{ "Unthrottle", ImageID::invalid(), VIRTKEY_UNTHROTTLE }, { "FastForward", ImageID::invalid(), VIRTKEY_FASTFORWARD },
{ "SpeedToggle", ImageID::invalid(), VIRTKEY_SPEED_TOGGLE }, { "SpeedToggle", ImageID::invalid(), VIRTKEY_SPEED_TOGGLE },
{ "Rewind", ImageID::invalid(), VIRTKEY_REWIND }, { "Rewind", ImageID::invalid(), VIRTKEY_REWIND },
{ "Save State", ImageID::invalid(), VIRTKEY_SAVE_STATE }, { "Save State", ImageID::invalid(), VIRTKEY_SAVE_STATE },

View File

@ -369,8 +369,8 @@ void ControlLayoutView::CreateViews() {
addDragDropButton(g_Config.touchSelectKey, "Select button", rectImage, ImageID("I_SELECT")); addDragDropButton(g_Config.touchSelectKey, "Select button", rectImage, ImageID("I_SELECT"));
addDragDropButton(g_Config.touchStartKey, "Start button", rectImage, ImageID("I_START")); addDragDropButton(g_Config.touchStartKey, "Start button", rectImage, ImageID("I_START"));
if (auto *unthrottle = addDragDropButton(g_Config.touchUnthrottleKey, "Unthrottle button", rectImage, ImageID("I_ARROW"))) { if (auto *fastForward = addDragDropButton(g_Config.touchFastForwardKey, "Fast-forward button", rectImage, ImageID("I_ARROW"))) {
unthrottle->SetAngle(180.0f); fastForward->SetAngle(180.0f);
} }
addDragDropButton(g_Config.touchLKey, "Left shoulder button", shoulderImage, ImageID("I_L")); addDragDropButton(g_Config.touchLKey, "Left shoulder button", shoulderImage, ImageID("I_L"));
if (auto *rbutton = addDragDropButton(g_Config.touchRKey, "Right shoulder button", shoulderImage, ImageID("I_R"))) { if (auto *rbutton = addDragDropButton(g_Config.touchRKey, "Right shoulder button", shoulderImage, ImageID("I_R"))) {

View File

@ -87,7 +87,7 @@ void TouchControlVisibilityScreen::CreateViews() {
screenManager()->push(new RightAnalogMappingScreen()); screenManager()->push(new RightAnalogMappingScreen());
return UI::EVENT_DONE; return UI::EVENT_DONE;
}}); }});
toggles_.push_back({ "Unthrottle", &g_Config.touchUnthrottleKey.show, ImageID::invalid(), nullptr }); toggles_.push_back({ "Fast-forward", &g_Config.touchFastForwardKey.show, ImageID::invalid(), nullptr });
toggles_.push_back({ "Custom 1", &g_Config.touchCombo0.show, ImageID::invalid(), [=](EventParams &e) { toggles_.push_back({ "Custom 1", &g_Config.touchCombo0.show, ImageID::invalid(), [=](EventParams &e) {
screenManager()->push(new ComboKeyScreen(0)); screenManager()->push(new ComboKeyScreen(0));
return UI::EVENT_DONE; return UI::EVENT_DONE;

View File

@ -250,7 +250,7 @@ void XinputDevice::ApplyVibration(int pad, XINPUT_VIBRATION &vibration) {
if (PSP_IsInited()) { if (PSP_IsInited()) {
newVibrationTime = time_now_d(); newVibrationTime = time_now_d();
// We have to run PPSSPP_XInputSetState at time intervals // We have to run PPSSPP_XInputSetState at time intervals
// since it bugs otherwise with very high unthrottle speeds // since it bugs otherwise with very high fast-forward speeds
// and freezes at constant vibration or no vibration at all. // and freezes at constant vibration or no vibration at all.
if (newVibrationTime - prevVibrationTime >= 1.0 / 64.0) { if (newVibrationTime - prevVibrationTime >= 1.0 / 64.0) {
if (GetUIState() == UISTATE_INGAME) { if (GetUIState() == UISTATE_INGAME) {

View File

@ -102,7 +102,7 @@ bool RunTests() {
coreParam.pixelWidth = 480; coreParam.pixelWidth = 480;
coreParam.pixelHeight = 272; coreParam.pixelHeight = 272;
coreParam.collectEmuLog = &output; coreParam.collectEmuLog = &output;
coreParam.unthrottle = true; coreParam.fastForward = true;
coreParam.updateRecent = false; coreParam.updateRecent = false;
// Never report from tests. // Never report from tests.

View File

@ -370,7 +370,7 @@ int main(int argc, const char* argv[])
coreParameter.renderHeight = 272; coreParameter.renderHeight = 272;
coreParameter.pixelWidth = 480; coreParameter.pixelWidth = 480;
coreParameter.pixelHeight = 272; coreParameter.pixelHeight = 272;
coreParameter.unthrottle = true; coreParameter.fastForward = true;
g_Config.bEnableSound = false; g_Config.bEnableSound = false;
g_Config.bFirstRun = false; g_Config.bFirstRun = false;
@ -391,7 +391,7 @@ int main(int argc, const char* argv[])
g_Config.iButtonPreference = PSP_SYSTEMPARAM_BUTTON_CROSS; g_Config.iButtonPreference = PSP_SYSTEMPARAM_BUTTON_CROSS;
g_Config.iLockParentalLevel = 9; g_Config.iLockParentalLevel = 9;
g_Config.iInternalResolution = 1; g_Config.iInternalResolution = 1;
g_Config.iUnthrottleMode = (int)UnthrottleMode::CONTINUOUS; g_Config.iFastForwardMode = (int)FastForwardMode::CONTINUOUS;
g_Config.bEnableLogging = fullLog; g_Config.bEnableLogging = fullLog;
g_Config.bSoftwareSkinning = true; g_Config.bSoftwareSkinning = true;
g_Config.bVertexDecoderJit = true; g_Config.bVertexDecoderJit = true;

View File

@ -418,7 +418,7 @@ void retro_init(void)
g_Config.bEnableLogging = true; g_Config.bEnableLogging = true;
// libretro does its own timing, so this should stay CONTINUOUS. // libretro does its own timing, so this should stay CONTINUOUS.
g_Config.iUnthrottleMode = (int)UnthrottleMode::CONTINUOUS; g_Config.iFastForwardMode = (int)FastForwardMode::CONTINUOUS;
g_Config.bMemStickInserted = true; g_Config.bMemStickInserted = true;
g_Config.iGlobalVolume = VOLUME_FULL - 1; g_Config.iGlobalVolume = VOLUME_FULL - 1;
g_Config.iReverbVolume = VOLUME_FULL; g_Config.iReverbVolume = VOLUME_FULL;
@ -683,7 +683,7 @@ bool retro_load_game(const struct retro_game_info *game)
coreParam.startBreak = false; coreParam.startBreak = false;
coreParam.printfEmuLog = true; coreParam.printfEmuLog = true;
coreParam.headLess = true; coreParam.headLess = true;
coreParam.unthrottle = true; coreParam.fastForward = true;
coreParam.graphicsContext = ctx; coreParam.graphicsContext = ctx;
coreParam.gpuCore = ctx->GetGPUCore(); coreParam.gpuCore = ctx->GetGPUCore();
coreParam.cpuCore = CPUCore::JIT; coreParam.cpuCore = CPUCore::JIT;

View File

@ -87,7 +87,7 @@ static void SetupJitHarness() {
g_symbolMap = new SymbolMap(); g_symbolMap = new SymbolMap();
Memory::g_MemorySize = Memory::RAM_NORMAL_SIZE; Memory::g_MemorySize = Memory::RAM_NORMAL_SIZE;
PSP_CoreParameter().cpuCore = CPUCore::INTERPRETER; PSP_CoreParameter().cpuCore = CPUCore::INTERPRETER;
PSP_CoreParameter().unthrottle = true; PSP_CoreParameter().fastForward = true;
Memory::Init(); Memory::Init();
mipsr4k.Reset(); mipsr4k.Reset();