Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/frontend/qt_sdl/EmuInstance.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ enum
HK_GuitarGripRed,
HK_GuitarGripYellow,
HK_GuitarGripBlue,
HK_SpeedStep,
HK_MAX
};

Expand Down Expand Up @@ -303,6 +304,7 @@ class EmuInstance
double slowmoFPS;
bool fastForwardToggled;
bool slowmoToggled;
bool speedStepToggled;
bool doAudioSync;
private:

Expand Down
3 changes: 2 additions & 1 deletion src/frontend/qt_sdl/EmuInstanceInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ const char* EmuInstance::hotkeyNames[HK_MAX] =
"HK_GuitarGripGreen",
"HK_GuitarGripRed",
"HK_GuitarGripYellow",
"HK_GuitarGripBlue"
"HK_GuitarGripBlue",
"HK_SpeedStep"
};

std::shared_ptr<SDL_mutex> EmuInstance::joyMutexGlobal = nullptr;
Expand Down
3 changes: 3 additions & 0 deletions src/frontend/qt_sdl/EmuThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ void EmuThread::run()
bool slowmo = false;
emuInstance->fastForwardToggled = false;
emuInstance->slowmoToggled = false;
emuInstance->speedStepToggled = false;

while (emuStatus != emuStatus_Exit)
{
Expand Down Expand Up @@ -332,6 +333,7 @@ void EmuThread::run()

if (emuInstance->hotkeyPressed(HK_FastForwardToggle)) emuInstance->fastForwardToggled = !emuInstance->fastForwardToggled;
if (emuInstance->hotkeyPressed(HK_SlowMoToggle)) emuInstance->slowmoToggled = !emuInstance->slowmoToggled;
if (emuInstance->hotkeyPressed(HK_SpeedStep)) emuInstance->speedStepToggled = !emuInstance->speedStepToggled;

if (emuInstance->hotkeyPressed(HK_AudioMuteToggle)) emuInstance->toggleAudioMute();

Expand All @@ -357,6 +359,7 @@ void EmuThread::run()

if (slowmo) emuInstance->curFPS = emuInstance->slowmoFPS;
else if (fastforward) emuInstance->curFPS = emuInstance->fastForwardFPS;
else if (emuInstance->speedStepToggled) emuInstance->curFPS = emuInstance->targetFPS * 2.0;
else if (!emuInstance->doLimitFPS && !emuInstance->doAudioSync) emuInstance->curFPS = 1000.0;
else emuInstance->curFPS = emuInstance->targetFPS;

Expand Down
6 changes: 4 additions & 2 deletions src/frontend/qt_sdl/InputConfig/InputConfigDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ static constexpr std::initializer_list<int> hk_general =
HK_PowerButton,
HK_VolumeUp,
HK_VolumeDown,
HK_AudioMuteToggle
HK_AudioMuteToggle,
HK_SpeedStep
};

static constexpr std::initializer_list<const char*> hk_general_labels =
Expand All @@ -89,7 +90,8 @@ static constexpr std::initializer_list<const char*> hk_general_labels =
"DSi Power button",
"DSi Volume up",
"DSi Volume down",
"Toggle audio mute"
"Toggle audio mute",
"Toggle 2x speed"
};

static_assert(hk_general.size() == hk_general_labels.size());
Expand Down