Skip to content

Commit

Permalink
Merge pull request #14739 from hrydgard/unthrottle-to-fastforward
Browse files Browse the repository at this point in the history
Rename "Unthrottle" to "Fast-forward"
  • Loading branch information
hrydgard authored Aug 18, 2021
2 parents 3c62fbc + a7859cf commit cbf2d3a
Show file tree
Hide file tree
Showing 64 changed files with 115 additions and 114 deletions.
2 changes: 1 addition & 1 deletion Common/Input/InputState.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ enum {
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_UNTHROTTLE = 1 << 20, // Click Tab to unthrottle
PAD_BUTTON_FASTFORWARD = 1 << 20, // Click Tab to unthrottle
};

#ifndef MAX_KEYQUEUESIZE
Expand Down
32 changes: 16 additions & 16 deletions Core/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -621,11 +621,11 @@ static int DefaultInternalResolution() {
#endif
}

static int DefaultUnthrottleMode() {
static int DefaultFastForwardMode() {
#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
return (int)UnthrottleMode::CONTINUOUS;
return (int)FastForwardMode::CONTINUOUS;
#endif
}

Expand Down Expand Up @@ -792,23 +792,23 @@ struct ConfigTranslator {

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"))
return (int)UnthrottleMode::CONTINUOUS;
return (int)FastForwardMode::CONTINUOUS;
if (!strcasecmp(s.c_str(), "SKIP_DRAW"))
return (int)UnthrottleMode::SKIP_DRAW;
return (int)FastForwardMode::SKIP_DRAW;
if (!strcasecmp(s.c_str(), "SKIP_FLIP"))
return (int)UnthrottleMode::SKIP_FLIP;
return DefaultUnthrottleMode();
return (int)FastForwardMode::SKIP_FLIP;
return DefaultFastForwardMode();
}

std::string UnthrottleModeToString(int v) {
switch (UnthrottleMode(v)) {
case UnthrottleMode::CONTINUOUS:
std::string FastForwardModeToString(int v) {
switch (FastForwardMode(v)) {
case FastForwardMode::CONTINUOUS:
return "CONTINUOUS";
case UnthrottleMode::SKIP_DRAW:
case FastForwardMode::SKIP_DRAW:
return "SKIP_DRAW";
case UnthrottleMode::SKIP_FLIP:
case FastForwardMode::SKIP_FLIP:
return "SKIP_FLIP";
}
return "CONTINUOUS";
Expand Down Expand Up @@ -843,7 +843,7 @@ static ConfigSetting graphicsSettings[] = {
ReportedConfigSetting("AutoFrameSkip", &g_Config.bAutoFrameSkip, false, true, true),
ConfigSetting("FrameRate", &g_Config.iFpsLimit1, 0, 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)
ConfigSetting("RestartRequired", &g_Config.bRestartRequired, false, false),
#endif
Expand Down Expand Up @@ -999,7 +999,7 @@ static ConfigSetting controlSettings[] = {
ConfigSetting("DPadSpacing", &g_Config.fDpadSpacing, 1.0f, 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("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("RKeyX", "RKeyY", "RKeyScale", "ShowTouchRTrigger", &g_Config.touchRKey, defaultTouchPosShow, true, true),
ConfigSetting("AnalogStickX", "AnalogStickY", "AnalogStickScale", "ShowAnalogStick", &g_Config.touchAnalogStick, defaultTouchPosShow, true, true),
Expand Down Expand Up @@ -1834,7 +1834,7 @@ void Config::ResetControlLayout() {
g_Config.fDpadSpacing = 1.0f;
reset(g_Config.touchStartKey);
reset(g_Config.touchSelectKey);
reset(g_Config.touchUnthrottleKey);
reset(g_Config.touchFastForwardKey);
reset(g_Config.touchLKey);
reset(g_Config.touchRKey);
reset(g_Config.touchAnalogStick);
Expand Down
4 changes: 2 additions & 2 deletions Core/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ struct Config {
bool bVSync;
int iFrameSkip;
int iFrameSkipType;
int iUnthrottleMode; // See UnthrottleMode in ConfigValues.h.
int iFastForwardMode; // See FastForwardMode in ConfigValues.h.
bool bAutoFrameSkip;

bool bEnableCardboardVR; // Cardboard Master Switch
Expand Down Expand Up @@ -348,7 +348,7 @@ struct Config {
float fDpadSpacing;
ConfigTouchPos touchStartKey;
ConfigTouchPos touchSelectKey;
ConfigTouchPos touchUnthrottleKey;
ConfigTouchPos touchFastForwardKey;
ConfigTouchPos touchLKey;
ConfigTouchPos touchRKey;
ConfigTouchPos touchAnalogStick;
Expand Down
2 changes: 1 addition & 1 deletion Core/ConfigValues.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ enum class AutoLoadSaveState {
NEWEST = 2,
};

enum class UnthrottleMode {
enum class FastForwardMode {
CONTINUOUS = 0,
SKIP_DRAW = 1,
SKIP_FLIP = 2,
Expand Down
2 changes: 1 addition & 1 deletion Core/CoreParameter.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ struct CoreParameter {
int pixelHeight;

// Can be modified at runtime.
bool unthrottle = false;
bool fastForward = false;
FPSLimit fpsLimit = FPSLimit::NORMAL;

bool updateRecent = true;
Expand Down
24 changes: 12 additions & 12 deletions Core/HLE/sceDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ static bool FrameTimingThrottled() {
if (PSP_CoreParameter().fpsLimit == FPSLimit::CUSTOM2 && g_Config.iFpsLimit2 == 0) {
return false;
}
return !PSP_CoreParameter().unthrottle;
return !PSP_CoreParameter().fastForward;
}

static void DoFrameDropLogging(float scaledTimestep) {
Expand Down Expand Up @@ -557,16 +557,16 @@ static void DoFrameTiming(bool &throttle, bool &skipFrame, float timestep) {
// we have nothing to do here.
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) {
// 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 (fpsLimit == 0 || (fpsLimit >= 0 && fpsLimit != 15 && fpsLimit != 30 && fpsLimit != 60)) {
doFrameSkip = true;
}
}
if (!throttle && unthrottleNeedsSkip) {
if (!throttle && fastForwardNeedsSkip) {
doFrameSkip = true;
skipFrame = true;
if (numSkippedFrames >= 7) {
Expand Down Expand Up @@ -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.
bool forceFrameskip = fpsLimit > 60 && unthrottleNeedsSkip;
bool forceFrameskip = fpsLimit > 60 && fastForwardNeedsSkip;
int frameSkipNum = CalculateFrameSkip();
if (g_Config.bAutoFrameSkip || forceFrameskip) {
// autoframeskip
Expand All @@ -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.

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) {
nextFrameTime = curFrameTime;
} else {
Expand Down Expand Up @@ -750,14 +750,14 @@ void __DisplayFlip(int cyclesLate) {

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) {
// Vulkan doesn't support the interval setting, so we force frameskip.
unthrottleNeedsSkip = true;
fastForwardNeedsSkip = true;
}

// postEffectRequiresFlip is not compatible with frameskip unthrottling, see #12325.
if (g_Config.iRenderingMode != FB_NON_BUFFERED_MODE && !(unthrottleNeedsSkip && !FrameTimingThrottled())) {
// postEffectRequiresFlip is not compatible with frameskip fast-forward, see #12325.
if (g_Config.iRenderingMode != FB_NON_BUFFERED_MODE && !(fastForwardNeedsSkip && !FrameTimingThrottled())) {
postEffectRequiresFlip = duplicateFrames || g_Config.bShaderChainRequires60FPS;
}

Expand Down Expand Up @@ -786,9 +786,9 @@ void __DisplayFlip(int cyclesLate) {
}

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.
if (g_Config.iUnthrottleMode == (int)UnthrottleMode::SKIP_FLIP && !FrameTimingThrottled()) {
if (g_Config.iFastForwardMode == (int)FastForwardMode::SKIP_FLIP && !FrameTimingThrottled()) {
static double lastFlip = 0;
double now = time_now_d();
if ((now - lastFlip) < 1.0f / System_GetPropertyFloat(SYSPROP_DISPLAY_REFRESH_RATE)) {
Expand Down
8 changes: 4 additions & 4 deletions Core/HW/StereoResampler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
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) {
volume = g_Config.iAltSpeedVolume;
}
Expand Down Expand Up @@ -266,15 +266,15 @@ void StereoResampler::PushSamples(const s32 *samples, unsigned int numSamples) {
u32 indexW = m_indexW.load();

u32 cap = m_maxBufsize * 2;
// If unthrottling, no need to fill up the entire buffer, just screws up timing after releasing unthrottle.
if (PSP_CoreParameter().unthrottle) {
// If fast-forwarding, no need to fill up the entire buffer, just screws up timing after releasing the fast-forward button.
if (PSP_CoreParameter().fastForward) {
cap = m_targetBufsize * 2;
}

// Check if we have enough free space
// 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 (!PSP_CoreParameter().unthrottle) {
if (!PSP_CoreParameter().fastForward) {
overrunCount_++;
}
// TODO: "Timestretch" by doing a windowed overlap with existing buffer content?
Expand Down
20 changes: 10 additions & 10 deletions Core/KeyMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static const DefMappingStruct defaultQwertyKeyboardKeyMap[] = {
{VIRTKEY_AXIS_X_MIN, NKCODE_J},
{VIRTKEY_AXIS_X_MAX, NKCODE_L},
{VIRTKEY_RAPID_FIRE, NKCODE_SHIFT_LEFT},
{VIRTKEY_UNTHROTTLE, NKCODE_TAB},
{VIRTKEY_FASTFORWARD, NKCODE_TAB},
{VIRTKEY_SPEED_TOGGLE, NKCODE_GRAVE},
{VIRTKEY_PAUSE , NKCODE_ESCAPE},
{VIRTKEY_REWIND , NKCODE_DEL},
Expand Down Expand Up @@ -107,7 +107,7 @@ static const DefMappingStruct defaultAzertyKeyboardKeyMap[] = {
{VIRTKEY_AXIS_X_MIN, NKCODE_J},
{VIRTKEY_AXIS_X_MAX, NKCODE_L},
{VIRTKEY_RAPID_FIRE, NKCODE_SHIFT_LEFT},
{VIRTKEY_UNTHROTTLE, NKCODE_TAB},
{VIRTKEY_FASTFORWARD, NKCODE_TAB},
{VIRTKEY_SPEED_TOGGLE, NKCODE_GRAVE},
{VIRTKEY_PAUSE , NKCODE_ESCAPE},
{VIRTKEY_REWIND , NKCODE_DEL},
Expand Down Expand Up @@ -137,7 +137,7 @@ static const DefMappingStruct defaultQwertzKeyboardKeyMap[] = {
{VIRTKEY_AXIS_X_MIN, NKCODE_J},
{VIRTKEY_AXIS_X_MAX, NKCODE_L},
{VIRTKEY_RAPID_FIRE, NKCODE_SHIFT_LEFT},
{VIRTKEY_UNTHROTTLE, NKCODE_TAB},
{VIRTKEY_FASTFORWARD, NKCODE_TAB},
{VIRTKEY_SPEED_TOGGLE, NKCODE_GRAVE},
{VIRTKEY_PAUSE , NKCODE_ESCAPE},
{VIRTKEY_REWIND , NKCODE_DEL},
Expand All @@ -161,7 +161,7 @@ static const DefMappingStruct default360KeyMap[] = {
{CTRL_SELECT , NKCODE_BUTTON_SELECT},
{CTRL_LTRIGGER , NKCODE_BUTTON_L1},
{CTRL_RTRIGGER , NKCODE_BUTTON_R1},
{VIRTKEY_UNTHROTTLE , JOYSTICK_AXIS_RTRIGGER, +1},
{VIRTKEY_FASTFORWARD , JOYSTICK_AXIS_RTRIGGER, +1},
{VIRTKEY_SPEED_TOGGLE, NKCODE_BUTTON_THUMBR},
{VIRTKEY_PAUSE , JOYSTICK_AXIS_LTRIGGER, +1},
{VIRTKEY_PAUSE, NKCODE_HOME},
Expand All @@ -185,7 +185,7 @@ static const DefMappingStruct defaultShieldKeyMap[] = {
{CTRL_UP, JOYSTICK_AXIS_HAT_Y, -1},
{CTRL_DOWN, JOYSTICK_AXIS_HAT_Y, +1},
{VIRTKEY_SPEED_TOGGLE, JOYSTICK_AXIS_LTRIGGER, +1 },
{VIRTKEY_UNTHROTTLE, JOYSTICK_AXIS_RTRIGGER, +1 },
{VIRTKEY_FASTFORWARD, JOYSTICK_AXIS_RTRIGGER, +1 },
{VIRTKEY_PAUSE, NKCODE_BACK },
};

Expand All @@ -206,7 +206,7 @@ static const DefMappingStruct defaultMOQI7SKeyMap[] = {
{CTRL_RIGHT, JOYSTICK_AXIS_HAT_X, +1},
{CTRL_UP, 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 },
};

Expand All @@ -229,7 +229,7 @@ static const DefMappingStruct defaultPadMap[] = {
{CTRL_SELECT , NKCODE_BACK},
{CTRL_LTRIGGER , NKCODE_BUTTON_L1},
{CTRL_RTRIGGER , NKCODE_BUTTON_R1},
{VIRTKEY_UNTHROTTLE , NKCODE_BUTTON_R2},
{VIRTKEY_FASTFORWARD , NKCODE_BUTTON_R2},
{VIRTKEY_PAUSE , JOYSTICK_AXIS_LTRIGGER, +1},
{VIRTKEY_SPEED_TOGGLE, NKCODE_BUTTON_L2},
{VIRTKEY_AXIS_X_MIN, JOYSTICK_AXIS_X, -1},
Expand Down Expand Up @@ -270,7 +270,7 @@ static const DefMappingStruct defaultOuyaMap[] = {
{CTRL_SELECT , NKCODE_BUTTON_L2},
{CTRL_LTRIGGER , NKCODE_BUTTON_L1},
{CTRL_RTRIGGER , NKCODE_BUTTON_R1},
{VIRTKEY_UNTHROTTLE , NKCODE_BUTTON_THUMBL},
{VIRTKEY_FASTFORWARD , NKCODE_BUTTON_THUMBL},
{VIRTKEY_PAUSE , NKCODE_BUTTON_THUMBR},
{VIRTKEY_AXIS_X_MIN, JOYSTICK_AXIS_X, -1},
{VIRTKEY_AXIS_X_MAX, JOYSTICK_AXIS_X, +1},
Expand Down Expand Up @@ -689,7 +689,7 @@ const KeyMap_IntStrPair psp_button_names[] = {
{VIRTKEY_ANALOG_LIGHTLY, "Analog limiter"},

{VIRTKEY_RAPID_FIRE, "RapidFire"},
{VIRTKEY_UNTHROTTLE, "Unthrottle"},
{VIRTKEY_FASTFORWARD, "Fast-forward"},
{VIRTKEY_SPEED_TOGGLE, "SpeedToggle"},
{VIRTKEY_SPEED_CUSTOM1, "Alt speed 1"},
{VIRTKEY_SPEED_CUSTOM2, "Alt speed 2"},
Expand Down Expand Up @@ -1065,7 +1065,7 @@ void AutoConfForPad(const std::string &name) {
#ifndef MOBILE_DEVICE
// 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_UNTHROTTLE].push_back(KeyDef(DEVICE_ID_KEYBOARD, NKCODE_TAB));
g_controllerMap[VIRTKEY_FASTFORWARD].push_back(KeyDef(DEVICE_ID_KEYBOARD, NKCODE_TAB));
g_controllerMapGeneration++;
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion Core/KeyMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ enum {
VIRTKEY_AXIS_X_MAX = 0x40000003,
VIRTKEY_AXIS_Y_MAX = 0x40000004,
VIRTKEY_RAPID_FIRE = 0x40000005,
VIRTKEY_UNTHROTTLE = 0x40000006,
VIRTKEY_FASTFORWARD = 0x40000006,
VIRTKEY_PAUSE = 0x40000007,
VIRTKEY_SPEED_TOGGLE = 0x40000008,
VIRTKEY_AXIS_RIGHT_X_MIN = 0x40000009,
Expand Down
2 changes: 1 addition & 1 deletion GPU/GPUCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ void GPUCommon::DeviceRestore() {
void GPUCommon::UpdateVsyncInterval(bool force) {
#if !(PPSSPP_PLATFORM(ANDROID) || defined(USING_QT_UI) || PPSSPP_PLATFORM(UWP) || PPSSPP_PLATFORM(IOS))
int desiredVSyncInterval = g_Config.bVSync ? 1 : 0;
if (PSP_CoreParameter().unthrottle) {
if (PSP_CoreParameter().fastForward) {
desiredVSyncInterval = 0;
}
if (PSP_CoreParameter().fpsLimit != FPSLimit::NORMAL) {
Expand Down
1 change: 1 addition & 0 deletions UI/DevScreens.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.

#include <algorithm>
#include <cstring>

#include "ppsspp_config.h"

Expand Down
8 changes: 4 additions & 4 deletions UI/EmuScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -553,11 +553,11 @@ void EmuScreen::onVKeyDown(int virtualKeyCode) {
auto sc = GetI18NCategory("Screen");

switch (virtualKeyCode) {
case VIRTKEY_UNTHROTTLE:
case VIRTKEY_FASTFORWARD:
if (coreState == CORE_STEPPING) {
Core_EnableStepping(false);
}
PSP_CoreParameter().unthrottle = true;
PSP_CoreParameter().fastForward = true;
break;

case VIRTKEY_SPEED_TOGGLE:
Expand Down Expand Up @@ -699,8 +699,8 @@ void EmuScreen::onVKeyUp(int virtualKeyCode) {
auto sc = GetI18NCategory("Screen");

switch (virtualKeyCode) {
case VIRTKEY_UNTHROTTLE:
PSP_CoreParameter().unthrottle = false;
case VIRTKEY_FASTFORWARD:
PSP_CoreParameter().fastForward = false;
break;

case VIRTKEY_SPEED_CUSTOM1:
Expand Down
14 changes: 7 additions & 7 deletions UI/GamepadEmu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -640,9 +640,9 @@ void InitPadLayout(float xres, float yres, float globalScale) {
int select_key_Y = yres - 60 * scale;
initTouchPos(g_Config.touchSelectKey, select_key_X, select_key_Y);

int unthrottle_key_X = halfW - bottom_key_spacing * scale;
int unthrottle_key_Y = yres - 60 * scale;
initTouchPos(g_Config.touchUnthrottleKey, unthrottle_key_X, unthrottle_key_Y);
int fast_forward_key_X = halfW - bottom_key_spacing * scale;
int fast_forward_key_Y = yres - 60 * scale;
initTouchPos(g_Config.touchFastForwardKey, fast_forward_key_X, fast_forward_key_Y);

// L and R------------------------------------------------------------
// Put them above the analog stick / above the buttons to the right.
Expand Down Expand Up @@ -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_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);
if (unthrottle) {
unthrottle->SetAngle(180.0f);
unthrottle->OnChange.Add([](UI::EventParams &e) {
BoolButton *fastForward = addBoolButton(&PSP_CoreParameter().fastForward, "Fast-forward button", rectImage, ImageID("I_RECT"), ImageID("I_ARROW"), g_Config.touchFastForwardKey);
if (fastForward) {
fastForward->SetAngle(180.0f);
fastForward->OnChange.Add([](UI::EventParams &e) {
if (e.a && coreState == CORE_STEPPING) {
Core_EnableStepping(false);
}
Expand Down
Loading

0 comments on commit cbf2d3a

Please sign in to comment.