From 762c1a9ff5406afc4c6b1a3eb74dae2dc2fb0daf Mon Sep 17 00:00:00 2001 From: bunnei Date: Thu, 16 Apr 2015 18:35:09 -0400 Subject: Qt: Move EmuThread ownership from render window to main window. --- src/citra_qt/main.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/citra_qt/main.h') diff --git a/src/citra_qt/main.h b/src/citra_qt/main.h index 9b57c5772..5b33ea962 100644 --- a/src/citra_qt/main.h +++ b/src/citra_qt/main.h @@ -11,6 +11,7 @@ class GImageInfo; class GRenderWindow; +class EmuThread; class ProfilerWidget; class DisassemblerWidget; class RegistersWidget; @@ -34,6 +35,10 @@ public: GMainWindow(); ~GMainWindow(); + EmuThread* GetEmuThread() { + return emu_thread; + } + private: void BootGame(std::string filename); @@ -54,6 +59,7 @@ private: Ui::MainWindow ui; GRenderWindow* render_window; + EmuThread* emu_thread; ProfilerWidget* profilerWidget; DisassemblerWidget* disasmWidget; -- cgit v1.2.3 From 3dd268878570c2c48e2be4018ff4d0ea851ece60 Mon Sep 17 00:00:00 2001 From: bunnei Date: Mon, 27 Apr 2015 23:13:57 -0400 Subject: Qt: Fix loading a new game without stopping emulation. --- src/citra_qt/main.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/citra_qt/main.h') diff --git a/src/citra_qt/main.h b/src/citra_qt/main.h index 5b33ea962..1821ae35f 100644 --- a/src/citra_qt/main.h +++ b/src/citra_qt/main.h @@ -41,6 +41,7 @@ public: private: void BootGame(std::string filename); + void ShutdownGame(); void closeEvent(QCloseEvent* event) override; -- cgit v1.2.3 From 43cf42490730d8a1b980aa1fe9ebbbe1249232ef Mon Sep 17 00:00:00 2001 From: bunnei Date: Wed, 29 Apr 2015 00:01:41 -0400 Subject: Qt: Use signals for emu_thread start/stop and fix disasm widget. --- src/citra_qt/main.h | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'src/citra_qt/main.h') diff --git a/src/citra_qt/main.h b/src/citra_qt/main.h index 1821ae35f..3e29534fb 100644 --- a/src/citra_qt/main.h +++ b/src/citra_qt/main.h @@ -5,6 +5,7 @@ #ifndef _CITRA_QT_MAIN_HXX_ #define _CITRA_QT_MAIN_HXX_ +#include #include #include "ui_main.h" @@ -35,9 +36,23 @@ public: GMainWindow(); ~GMainWindow(); - EmuThread* GetEmuThread() { - return emu_thread; - } +signals: + + /** + * Signal that is emitted when a new EmuThread has been created and an emulation session is + * about to start. At this time, the core system emulation has been initialized, and all + * emulation handles and memory should be valid. + * + * @param emu_thread Pointer to the newly created EmuThread (to be used by widgets that need to + * access/change emulation state). + */ + void EmulationStarting(EmuThread* emu_thread); + + /** + * Signal that is emitted when emulation is about to stop. At this time, the EmuThread and core + * system emulation handles and memory are still valid, but are about become invalid. + */ + void EmulationStopping(); private: void BootGame(std::string filename); @@ -60,7 +75,8 @@ private: Ui::MainWindow ui; GRenderWindow* render_window; - EmuThread* emu_thread; + + std::unique_ptr emu_thread; ProfilerWidget* profilerWidget; DisassemblerWidget* disasmWidget; -- cgit v1.2.3