all repos — mgba @ 7cc903a217ebad9f1fff885a28cd973639a8d66e

mGBA Game Boy Advance Emulator

Qt: Pause game while open file dialogs are open (fixes #6 on GitHub)
Jeffrey Pfau jeffrey@endrift.com
Thu, 02 Apr 2015 22:32:38 -0700
commit

7cc903a217ebad9f1fff885a28cd973639a8d66e

parent

120020b0e39de4086495187f06c503fab2ed19e1

2 files changed, 22 insertions(+), 0 deletions(-)

jump to
M CHANGESCHANGES

@@ -60,6 +60,7 @@ - GBA: Fix timer initialization

- GBA Memory: Fix I cycles that had been moved to ARM7 core - GBA Memory: Fix cycle counting for 32-bit load/stores - ARM7: Fix cycle counting for loads + - Qt: Pause game while open file dialogs are open (fixes #6 on GitHub) Misc: - GBA Audio: Change internal audio sample buffer from 32-bit to 16-bit samples - GBA Memory: Simplify memory API and use fixed bus width
M src/platform/qt/Window.cppsrc/platform/qt/Window.cpp

@@ -198,7 +198,14 @@ m_config->write();

} void Window::selectROM() { + bool doPause = m_controller->isLoaded() && !m_controller->isPaused(); + if (doPause) { + m_controller->setPaused(true); + } QString filename = QFileDialog::getOpenFileName(this, tr("Select ROM"), m_config->getQtOption("lastDirectory").toString(), tr("Game Boy Advance ROMs (*.gba *.zip *.rom *.bin)")); + if (doPause) { + m_controller->setPaused(false); + } if (!filename.isEmpty()) { m_config->setQtOption("lastDirectory", QFileInfo(filename).dir().path()); m_controller->loadGame(filename);

@@ -206,7 +213,14 @@ }

} void Window::selectBIOS() { + bool doPause = m_controller->isLoaded() && !m_controller->isPaused(); + if (doPause) { + m_controller->setPaused(true); + } QString filename = QFileDialog::getOpenFileName(this, tr("Select BIOS"), m_config->getQtOption("lastDirectory").toString()); + if (doPause) { + m_controller->setPaused(false); + } if (!filename.isEmpty()) { m_config->setQtOption("lastDirectory", QFileInfo(filename).dir().path()); m_config->setOption("bios", filename);

@@ -218,7 +232,14 @@ }

} void Window::selectPatch() { + bool doPause = m_controller->isLoaded() && !m_controller->isPaused(); + if (doPause) { + m_controller->setPaused(true); + } QString filename = QFileDialog::getOpenFileName(this, tr("Select patch"), m_config->getQtOption("lastDirectory").toString(), tr("Patches (*.ips *.ups *.bps)")); + if (doPause) { + m_controller->setPaused(false); + } if (!filename.isEmpty()) { m_config->setQtOption("lastDirectory", QFileInfo(filename).dir().path()); m_controller->loadPatch(filename);