diff options
author | bunnei <bunneidev@gmail.com> | 2015-04-16 23:31:14 -0400 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2015-05-01 18:27:00 -0400 |
commit | 28df8dbfeb17cf5a002a5504a6bd2ba5091bf07c (patch) | |
tree | 57733ea06f6594a5fd4ed7b191130b963895deb2 /src/citra_qt/bootmanager.h | |
parent | d5665fea89dc2684e145e82a1b07086f11a13a65 (diff) |
Qt: Create emu thread on bootup, kill it on shutdown.
Diffstat (limited to 'src/citra_qt/bootmanager.h')
-rw-r--r-- | src/citra_qt/bootmanager.h | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/citra_qt/bootmanager.h b/src/citra_qt/bootmanager.h index 8083d275..f6f09773 100644 --- a/src/citra_qt/bootmanager.h +++ b/src/citra_qt/bootmanager.h @@ -9,6 +9,7 @@ #include "common/common.h" #include "common/emu_window.h" +#include "common/thread.h" class QScreen; class QKeyEvent; @@ -37,20 +38,31 @@ public: void ExecStep() { exec_cpu_step = true; } /** - * Allow the CPU to continue processing instructions without interruption + * Sets whether the CPU is running * * @note This function is thread-safe */ void SetCpuRunning(bool running) { cpu_running = running; } /** - * Allow the CPU to continue processing instructions without interruption - * - * @note This function is thread-safe - */ + * Allow the CPU to continue processing instructions without interruption + * + * @note This function is thread-safe + */ bool IsCpuRunning() { return cpu_running; } + /** + * Shutdown (permantently stops) the CPU + */ + void ShutdownCpu() { stop_run = true; }; + + /** + * Waits for the CPU shutdown to complete + */ + void WaitForCpuShutdown() { shutdown_event.Wait(); } + + public slots: /** * Stop emulation and wait for the thread to finish. @@ -71,6 +83,8 @@ private: GRenderWindow* render_window; + Common::Event shutdown_event; + signals: /** * Emitted when the CPU has halted execution |