aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/citra_qt/bootmanager.cpp
diff options
context:
space:
mode:
authorGravatar bunnei <bunneidev@gmail.com>2015-04-28 19:03:01 -0400
committerGravatar bunnei <bunneidev@gmail.com>2015-05-01 18:27:07 -0400
commite4ea133717a5292339c134160da984ba186d3de8 (patch)
treef6c3e289eaee3c79375d136279509523d4b3aca8 /src/citra_qt/bootmanager.cpp
parent3dd268878570c2c48e2be4018ff4d0ea851ece60 (diff)
Qt: Restructured to remove unnecessary shutdown event and various cleanups.
Diffstat (limited to 'src/citra_qt/bootmanager.cpp')
-rw-r--r--src/citra_qt/bootmanager.cpp43
1 files changed, 5 insertions, 38 deletions
diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp
index fa4e976f..1e902a8b 100644
--- a/src/citra_qt/bootmanager.cpp
+++ b/src/citra_qt/bootmanager.cpp
@@ -28,9 +28,8 @@
#define COPYRIGHT "Copyright (C) 2013-2014 Citra Team"
EmuThread::EmuThread(GRenderWindow* render_window) :
- exec_cpu_step(false), cpu_running(false), stop_run(false), render_window(render_window) {
+ exec_step(false), running(false), stop_run(false), render_window(render_window) {
- shutdown_event.Reset();
connect(this, SIGNAL(started()), render_window, SLOT(moveContext()));
}
@@ -42,20 +41,20 @@ void EmuThread::run() {
// next execution step
bool was_active = false;
while (!stop_run) {
- if (cpu_running) {
+ if (running) {
if (!was_active)
emit DebugModeLeft();
Core::RunLoop();
- was_active = cpu_running || exec_cpu_step;
+ was_active = running || exec_step;
if (!was_active)
emit DebugModeEntered();
- } else if (exec_cpu_step) {
+ } else if (exec_step) {
if (!was_active)
emit DebugModeLeft();
- exec_cpu_step = false;
+ exec_step = false;
Core::SingleStep();
emit DebugModeEntered();
yieldCurrentThread();
@@ -65,40 +64,8 @@ void EmuThread::run() {
}
render_window->moveContext();
-
- shutdown_event.Set();
}
-void EmuThread::Stop() {
- if (!isRunning()) {
- LOG_WARNING(Frontend, "EmuThread::Stop called while emu thread wasn't running, returning...");
- return;
- }
- stop_run = true;
-
- // Release emu threads from any breakpoints, so that this doesn't hang forever.
- Pica::g_debug_context->ClearBreakpoints();
-
- //core::g_state = core::SYS_DIE;
-
- // TODO: Waiting here is just a bad workaround for retarded shutdown logic.
- wait(1000);
- if (isRunning()) {
- LOG_WARNING(Frontend, "EmuThread still running, terminating...");
- quit();
-
- // TODO: Waiting 50 seconds can be necessary if the logging subsystem has a lot of spam
- // queued... This should be fixed.
- wait(50000);
- if (isRunning()) {
- LOG_CRITICAL(Frontend, "EmuThread STILL running, something is wrong here...");
- terminate();
- }
- }
- LOG_INFO(Frontend, "EmuThread stopped");
-}
-
-
// This class overrides paintEvent and resizeEvent to prevent the GUI thread from stealing GL context.
// The corresponding functionality is handled in EmuThread instead
class GGLWidgetInternal : public QGLWidget