all repos — mgba @ ab8321ac3471f8acfeba78ee434d5b73918bc34e

mGBA Game Boy Advance Emulator

mGUI: Fix frame limiter breaking in menus
Vicki Pfau vi@endrift.com
Fri, 14 Sep 2018 20:22:07 -0700
commit

ab8321ac3471f8acfeba78ee434d5b73918bc34e

parent

b03412aa38b39190f475cb89d5c8a2a5e97bc32d

1 files changed, 10 insertions(+), 4 deletions(-)

jump to
M src/feature/gui/gui-runner.csrc/feature/gui/gui-runner.c

@@ -441,10 +441,12 @@ }

if (guiKeys & (1 << mGUI_INPUT_SCREENSHOT)) { mCoreTakeScreenshot(runner->core); } - if (heldKeys & (1 << mGUI_INPUT_FAST_FORWARD)) { - runner->setFrameLimiter(runner, false); - } else { - runner->setFrameLimiter(runner, true); + if (runner->setFrameLimiter) { + if (heldKeys & (1 << mGUI_INPUT_FAST_FORWARD)) { + runner->setFrameLimiter(runner, false); + } else { + runner->setFrameLimiter(runner, true); + } } uint16_t keys = runner->pollGameInput(runner); if (runner->prepareForFrame) {

@@ -501,6 +503,10 @@

if (runner->paused) { runner->paused(runner); } + if (runner->setFrameLimiter) { + runner->setFrameLimiter(runner, true); + } + GUIInvalidateKeys(&runner->params); uint32_t keys = 0xFFFFFFFF; // Huge hack to avoid an extra variable! struct GUIMenuItem* item;