all repos — mgba @ 95f6a8f8d63001a99b0c6227bfc5f166589857db

mGBA Game Boy Advance Emulator

GBA Context: Callbacks when pausing and unpausing, for audio
Jeffrey Pfau jeffrey@endrift.com
Wed, 02 Sep 2015 23:15:36 -0700
commit

95f6a8f8d63001a99b0c6227bfc5f166589857db

parent

1df666e91d30b82aa5d4273b523264585057a6a3

4 files changed, 12 insertions(+), 0 deletions(-)

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

@@ -184,6 +184,9 @@ runner->params.drawEnd();

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

@@ -218,6 +221,9 @@ GUIPollInput(&runner->params, 0, &keys);

} if (runner->params.guiFinish) { runner->params.guiFinish(); + } + if (runner->unpaused) { + runner->unpaused(runner); } } GBAContextStop(&runner->context);
M src/gba/gui/gui-runner.hsrc/gba/gui/gui-runner.h

@@ -37,6 +37,8 @@ void (*gameLoaded)(struct GBAGUIRunner*);

void (*gameUnloaded)(struct GBAGUIRunner*); void (*prepareForFrame)(struct GBAGUIRunner*); void (*drawFrame)(struct GBAGUIRunner*, bool faded); + void (*paused)(struct GBAGUIRunner*); + void (*unpaused)(struct GBAGUIRunner*); uint16_t (*pollGameInput)(struct GBAGUIRunner*); };
M src/platform/3ds/main.csrc/platform/3ds/main.c

@@ -264,6 +264,8 @@ .gameLoaded = _gameLoaded,

.gameUnloaded = _gameUnloaded, .prepareForFrame = 0, .drawFrame = _drawFrame, + .paused = _gameUnloaded, + .unpaused = _gameLoaded, .pollGameInput = _pollGameInput }; GBAGUIInit(&runner, 0);
M src/platform/wii/main.csrc/platform/wii/main.c

@@ -170,6 +170,8 @@ .gameLoaded = _gameLoaded,

.gameUnloaded = _gameUnloaded, .prepareForFrame = 0, .drawFrame = _drawFrame, + .paused = _gameUnloaded, + .unpaused = 0, .pollGameInput = _pollGameInput }; GBAGUIInit(&runner, 0);