diff options
Diffstat (limited to 'src/citra_qt/bootmanager.cpp')
| -rw-r--r-- | src/citra_qt/bootmanager.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp index 3e24da596..196380105 100644 --- a/src/citra_qt/bootmanager.cpp +++ b/src/citra_qt/bootmanager.cpp | |||
| @@ -40,18 +40,35 @@ void EmuThread::SetFilename(std::string filename) | |||
| 40 | void EmuThread::run() | 40 | void EmuThread::run() |
| 41 | { | 41 | { |
| 42 | stop_run = false; | 42 | stop_run = false; |
| 43 | |||
| 44 | // holds whether the cpu was running during the last iteration, | ||
| 45 | // so that the DebugModeLeft signal can be emitted before the | ||
| 46 | // next execution step | ||
| 47 | bool was_active = false; | ||
| 43 | while (!stop_run) | 48 | while (!stop_run) |
| 44 | { | 49 | { |
| 45 | if (cpu_running) | 50 | if (cpu_running) |
| 46 | { | 51 | { |
| 52 | if (!was_active) | ||
| 53 | emit DebugModeLeft(); | ||
| 54 | |||
| 47 | Core::RunLoop(); | 55 | Core::RunLoop(); |
| 56 | |||
| 57 | was_active = cpu_running || exec_cpu_step; | ||
| 58 | if (!was_active) | ||
| 59 | emit DebugModeEntered(); | ||
| 48 | } | 60 | } |
| 49 | else if (exec_cpu_step) | 61 | else if (exec_cpu_step) |
| 50 | { | 62 | { |
| 63 | if (!was_active) | ||
| 64 | emit DebugModeLeft(); | ||
| 65 | |||
| 51 | exec_cpu_step = false; | 66 | exec_cpu_step = false; |
| 52 | Core::SingleStep(); | 67 | Core::SingleStep(); |
| 53 | emit CPUStepped(); | 68 | emit DebugModeEntered(); |
| 54 | yieldCurrentThread(); | 69 | yieldCurrentThread(); |
| 70 | |||
| 71 | was_active = false; | ||
| 55 | } | 72 | } |
| 56 | } | 73 | } |
| 57 | render_window->moveContext(); | 74 | render_window->moveContext(); |