all repos — mgba @ eb7f12b574e140f809dc9570f948f298fb5571bb

mGBA Game Boy Advance Emulator

mGUI: Add fast forward toggle
Vicki Pfau vi@endrift.com
Wed, 19 Sep 2018 19:20:15 -0700
commit

eb7f12b574e140f809dc9570f948f298fb5571bb

parent

d3a018c35b159d498a76df7f5dbfdc72ca811acc

3 files changed, 10 insertions(+), 3 deletions(-)

jump to
M CHANGESCHANGES

@@ -91,6 +91,7 @@ - Wii: Move audio handling to callbacks (fixes mgba.io/i/803)

- Qt: Clean up FPS target UI (fixes mgba.io/i/436) - Core: Remove broken option for whether rewinding restores save games - FFmpeg: Support lossless VP9 encoding + - mGUI: Add fast forward toggle 0.6.3: (2017-04-14) Bugfixes:
M src/feature/gui/gui-runner.csrc/feature/gui/gui-runner.c

@@ -54,7 +54,8 @@ [mGUI_INPUT_INCREASE_BRIGHTNESS] = "Increase solar brightness",

[mGUI_INPUT_DECREASE_BRIGHTNESS] = "Decrease solar brightness", [mGUI_INPUT_SCREEN_MODE] = "Screen mode", [mGUI_INPUT_SCREENSHOT] = "Take screenshot", - [mGUI_INPUT_FAST_FORWARD] = "Fast forward", + [mGUI_INPUT_FAST_FORWARD_HELD] = "Fast forward (held)", + [mGUI_INPUT_FAST_FORWARD_TOGGLE] = "Fast forward (toggle)", }, .nKeys = GUI_INPUT_MAX };

@@ -412,6 +413,7 @@ gettimeofday(&tv, 0);

runner->lastFpsCheck = 1000000LL * tv.tv_sec + tv.tv_usec; int frame = 0; + bool fastForward = false; while (running) { if (runner->running) { running = runner->running(runner);

@@ -442,7 +444,10 @@ if (guiKeys & (1 << mGUI_INPUT_SCREENSHOT)) {

mCoreTakeScreenshot(runner->core); } if (runner->setFrameLimiter) { - if (heldKeys & (1 << mGUI_INPUT_FAST_FORWARD)) { + if (guiKeys & (1 << mGUI_INPUT_FAST_FORWARD_TOGGLE)) { + fastForward = !fastForward; + } + if (fastForward || (heldKeys & (1 << mGUI_INPUT_FAST_FORWARD_HELD))) { runner->setFrameLimiter(runner, false); } else { runner->setFrameLimiter(runner, true);
M src/feature/gui/gui-runner.hsrc/feature/gui/gui-runner.h

@@ -22,7 +22,8 @@ mGUI_INPUT_INCREASE_BRIGHTNESS = GUI_INPUT_USER_START,

mGUI_INPUT_DECREASE_BRIGHTNESS, mGUI_INPUT_SCREEN_MODE, mGUI_INPUT_SCREENSHOT, - mGUI_INPUT_FAST_FORWARD, + mGUI_INPUT_FAST_FORWARD_HELD, + mGUI_INPUT_FAST_FORWARD_TOGGLE }; struct mGUIBackground {