summaryrefslogtreecommitdiffstats
path: root/src/citra_qt/main.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2015-04-29 01:03:01 +0200
committerbunnei <bunneidev@gmail.com>2015-05-02 00:27:07 +0200
commite4ea133717a5292339c134160da984ba186d3de8 (patch)
treef6c3e289eaee3c79375d136279509523d4b3aca8 /src/citra_qt/main.cpp
parentQt: Fix loading a new game without stopping emulation. (diff)
downloadyuzu-e4ea133717a5292339c134160da984ba186d3de8.tar
yuzu-e4ea133717a5292339c134160da984ba186d3de8.tar.gz
yuzu-e4ea133717a5292339c134160da984ba186d3de8.tar.bz2
yuzu-e4ea133717a5292339c134160da984ba186d3de8.tar.lz
yuzu-e4ea133717a5292339c134160da984ba186d3de8.tar.xz
yuzu-e4ea133717a5292339c134160da984ba186d3de8.tar.zst
yuzu-e4ea133717a5292339c134160da984ba186d3de8.zip
Diffstat (limited to '')
-rw-r--r--src/citra_qt/main.cpp33
1 files changed, 18 insertions, 15 deletions
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp
index 5441c17f1..dd180baa4 100644
--- a/src/citra_qt/main.cpp
+++ b/src/citra_qt/main.cpp
@@ -199,10 +199,6 @@ void GMainWindow::OnDisplayTitleBars(bool show)
void GMainWindow::BootGame(std::string filename) {
LOG_INFO(Frontend, "Citra starting...\n");
- // Shutdown previous session if the emu thread is still active...
- if (emu_thread != nullptr)
- ShutdownGame();
-
System::Init(render_window);
// Load a game or die...
@@ -222,29 +218,36 @@ void GMainWindow::BootGame(std::string filename) {
}
void GMainWindow::ShutdownGame() {
- emu_thread->SetCpuRunning(false);
-
- emu_thread->ShutdownCpu();
- emu_thread->WaitForCpuShutdown();
- emu_thread->Stop();
-
+ // Shutdown the emulation thread and wait for it to complete
+ emu_thread->SetRunning(false);
+ emu_thread->Shutdown();
+ emu_thread->wait();
delete emu_thread;
emu_thread = nullptr;
+ // Release emu threads from any breakpoints
+ Pica::g_debug_context->ClearBreakpoints();
+
+ // Shutdown the core emulation
System::Shutdown();
+ // Update the GUI
ui.action_Start->setEnabled(true);
ui.action_Pause->setEnabled(false);
ui.action_Stop->setEnabled(false);
-
render_window->hide();
}
void GMainWindow::OnMenuLoadFile()
{
QString filename = QFileDialog::getOpenFileName(this, tr("Load File"), QString(), tr("3DS executable (*.3ds *.3dsx *.elf *.axf *.bin *.cci *.cxi)"));
- if (filename.size())
- BootGame(filename.toLatin1().data());
+ if (filename.size()) {
+ // Shutdown previous session if the emu thread is still active...
+ if (emu_thread != nullptr)
+ ShutdownGame();
+
+ BootGame(filename.toLatin1().data());
+ }
}
void GMainWindow::OnMenuLoadSymbolMap() {
@@ -255,7 +258,7 @@ void GMainWindow::OnMenuLoadSymbolMap() {
void GMainWindow::OnStartGame()
{
- emu_thread->SetCpuRunning(true);
+ emu_thread->SetRunning(true);
ui.action_Start->setEnabled(false);
ui.action_Pause->setEnabled(true);
@@ -264,7 +267,7 @@ void GMainWindow::OnStartGame()
void GMainWindow::OnPauseGame()
{
- emu_thread->SetCpuRunning(false);
+ emu_thread->SetRunning(false);
ui.action_Start->setEnabled(true);
ui.action_Pause->setEnabled(false);