all repos — mgba @ 2f5624e74ac94b7065b10568c1f6378d3d1bc4a4

mGBA Game Boy Advance Emulator

Qt: Allow pausing game at load (fixes mgba.io/i/1129)
Vicki Pfau vi@endrift.com
Sun, 22 Jul 2018 10:30:45 -0700
commit

2f5624e74ac94b7065b10568c1f6378d3d1bc4a4

parent

4f246827a63b1874bd940f43dd8fe22dfae02ed6

3 files changed, 12 insertions(+), 2 deletions(-)

jump to
M CHANGESCHANGES

@@ -71,6 +71,7 @@ - GB Video: Darken colors in GBA mode

- FFmpeg: Support libswresample (fixes mgba.io/i/1120, mgba.io/b/123) - FFmpeg: Support lossless h.264 encoding - Feature: Added loading savestates from command line + - Qt: Allow pausing game at load (fixes mgba.io/i/1129) 0.6.3: (2017-04-14) Bugfixes:
M src/platform/qt/Window.cppsrc/platform/qt/Window.cpp

@@ -1198,12 +1198,15 @@ pause->setChecked(false);

pause->setCheckable(true); pause->setShortcut(tr("Ctrl+P")); connect(pause, &QAction::triggered, [this](bool paused) { - m_controller->setPaused(paused); + if (m_controller) { + m_controller->setPaused(paused); + } else { + m_pendingPause = paused; + } }); connect(this, &Window::paused, [pause](bool paused) { pause->setChecked(paused); }); - m_gameActions.append(pause); addControlledAction(emulationMenu, pause, "pause"); QAction* frameAdvance = new QAction(tr("&Next frame"), emulationMenu);

@@ -1923,6 +1926,11 @@

if (!m_pendingState.isEmpty()) { m_controller->loadState(m_pendingState); m_pendingState = QString(); + } + + if (m_pendingPause) { + m_controller->setPaused(true); + m_pendingPause = false; } }
M src/platform/qt/Window.hsrc/platform/qt/Window.h

@@ -207,6 +207,7 @@ bool m_autoresume = false;

bool m_wasOpened = false; QString m_pendingPatch; QString m_pendingState; + bool m_pendingPause = false; bool m_hitUnimplementedBiosCall;