all repos — mgba @ 767c6a039c13bf266c988239223fa5df97795c11

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

767c6a039c13bf266c988239223fa5df97795c11

parent

2eb765eacc646b67440c021a2925951700dda460

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

@@ -196,7 +196,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);

@@ -204,7 +211,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);

@@ -216,7 +230,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);