summaryrefslogtreecommitdiffstats
path: root/src/citra_qt/bootmanager.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/bootmanager.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 '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 fa4e976f4..1e902a8b6 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