Permalink
Browse files

UI: Add a virtkey for holding alt speed.

Can be used for slow motion or fast motion (esp. if unthrottle is too
fast.)
  • Loading branch information...
unknownbrackets committed Jun 17, 2018
1 parent 9f307fd commit dc840c077d7fe846c15acc8c2a7a5297d372be44
Showing with 19 additions and 2 deletions.
  1. +1 −0 Common/KeyMap.cpp
  2. +1 −0 Common/KeyMap.h
  3. +17 −2 UI/EmuScreen.cpp
@@ -645,6 +645,7 @@ const KeyMap_IntStrPair psp_button_names[] = {
{VIRTKEY_RAPID_FIRE, "RapidFire"},
{VIRTKEY_UNTHROTTLE, "Unthrottle"},
{VIRTKEY_SPEED_TOGGLE, "SpeedToggle"},
{VIRTKEY_SPEED_PRESS, "Speed toggle hold"},
{VIRTKEY_PAUSE, "Pause"},
#ifndef MOBILE_DEVICE
{VIRTKEY_FRAME_ADVANCE, "Frame Advance"},
@@ -52,6 +52,7 @@ enum {
VIRTKEY_DEVMENU = 0x40000014,
VIRTKEY_FRAME_ADVANCE = 0x40000015,
VIRTKEY_RECORD = 0x40000016,
VIRTKEY_SPEED_PRESS = 0x40000017,
VIRTKEY_LAST,
VIRTKEY_COUNT = VIRTKEY_LAST - VIRTKEY_FIRST
};
@@ -474,13 +474,19 @@ void EmuScreen::onVKeyDown(int virtualKeyCode) {
if (PSP_CoreParameter().fpsLimit == 0) {
PSP_CoreParameter().fpsLimit = 1;
osm.Show(sc->T("fixed", "Speed: alternate"), 1.0);
}
else if (PSP_CoreParameter().fpsLimit == 1) {
} else if (PSP_CoreParameter().fpsLimit == 1) {
PSP_CoreParameter().fpsLimit = 0;
osm.Show(sc->T("standard", "Speed: standard"), 1.0);
}
break;
case VIRTKEY_SPEED_PRESS:
if (PSP_CoreParameter().fpsLimit == 0) {
PSP_CoreParameter().fpsLimit = 1;
osm.Show(sc->T("fixed", "Speed: alternate"), 1.0);
}
break;
case VIRTKEY_PAUSE:
pauseTrigger_ = true;
break;
@@ -580,11 +586,20 @@ void EmuScreen::onVKeyDown(int virtualKeyCode) {
}
void EmuScreen::onVKeyUp(int virtualKeyCode) {
I18NCategory *sc = GetI18NCategory("Screen");
switch (virtualKeyCode) {
case VIRTKEY_UNTHROTTLE:
PSP_CoreParameter().unthrottle = false;
break;
case VIRTKEY_SPEED_PRESS:
if (PSP_CoreParameter().fpsLimit == 1) {
PSP_CoreParameter().fpsLimit = 0;
osm.Show(sc->T("standard", "Speed: standard"), 1.0);
}
break;
case VIRTKEY_AXIS_X_MIN:
case VIRTKEY_AXIS_X_MAX:
setVKeyAnalogX(CTRL_STICK_LEFT, VIRTKEY_AXIS_X_MIN, VIRTKEY_AXIS_X_MAX);

0 comments on commit dc840c0

Please sign in to comment.