summaryrefslogtreecommitdiff
path: root/src/citra_qt/debugger/disassembler.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2015-04-16 18:35:09 -0400
committerGravatar bunnei2015-05-01 18:26:58 -0400
commit762c1a9ff5406afc4c6b1a3eb74dae2dc2fb0daf (patch)
tree74ac7be2a6f1b3dfd09986b598844440af9e2f8f /src/citra_qt/debugger/disassembler.cpp
parentMerge pull request #717 from linkmauve/useless-auto (diff)
downloadyuzu-762c1a9ff5406afc4c6b1a3eb74dae2dc2fb0daf.tar.gz
yuzu-762c1a9ff5406afc4c6b1a3eb74dae2dc2fb0daf.tar.xz
yuzu-762c1a9ff5406afc4c6b1a3eb74dae2dc2fb0daf.zip
Qt: Move EmuThread ownership from render window to main window.
Diffstat (limited to 'src/citra_qt/debugger/disassembler.cpp')
-rw-r--r--src/citra_qt/debugger/disassembler.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/citra_qt/debugger/disassembler.cpp b/src/citra_qt/debugger/disassembler.cpp
index f620687ae..b58edafe7 100644
--- a/src/citra_qt/debugger/disassembler.cpp
+++ b/src/citra_qt/debugger/disassembler.cpp
@@ -4,6 +4,7 @@
4 4
5#include "disassembler.h" 5#include "disassembler.h"
6 6
7#include "../main.h"
7#include "../bootmanager.h" 8#include "../bootmanager.h"
8#include "../hotkeys.h" 9#include "../hotkeys.h"
9 10
@@ -158,8 +159,9 @@ void DisassemblerModel::SetNextInstruction(unsigned int address) {
158 emit dataChanged(prev_index, prev_index); 159 emit dataChanged(prev_index, prev_index);
159} 160}
160 161
161DisassemblerWidget::DisassemblerWidget(QWidget* parent, EmuThread& emu_thread) : QDockWidget(parent), base_addr(0), emu_thread(emu_thread) 162DisassemblerWidget::DisassemblerWidget(QWidget* parent, GMainWindow& main_window) :
162{ 163 QDockWidget(parent), main_window(main_window), base_addr(0) {
164
163 disasm_ui.setupUi(this); 165 disasm_ui.setupUi(this);
164 166
165 model = new DisassemblerModel(this); 167 model = new DisassemblerModel(this);
@@ -199,7 +201,7 @@ void DisassemblerWidget::Init()
199 201
200void DisassemblerWidget::OnContinue() 202void DisassemblerWidget::OnContinue()
201{ 203{
202 emu_thread.SetCpuRunning(true); 204 main_window.GetEmuThread()->SetCpuRunning(true);
203} 205}
204 206
205void DisassemblerWidget::OnStep() 207void DisassemblerWidget::OnStep()
@@ -209,13 +211,13 @@ void DisassemblerWidget::OnStep()
209 211
210void DisassemblerWidget::OnStepInto() 212void DisassemblerWidget::OnStepInto()
211{ 213{
212 emu_thread.SetCpuRunning(false); 214 main_window.GetEmuThread()->SetCpuRunning(false);
213 emu_thread.ExecStep(); 215 main_window.GetEmuThread()->ExecStep();
214} 216}
215 217
216void DisassemblerWidget::OnPause() 218void DisassemblerWidget::OnPause()
217{ 219{
218 emu_thread.SetCpuRunning(false); 220 main_window.GetEmuThread()->SetCpuRunning(false);
219 221
220 // TODO: By now, the CPU might not have actually stopped... 222 // TODO: By now, the CPU might not have actually stopped...
221 if (Core::g_app_core) { 223 if (Core::g_app_core) {
@@ -225,7 +227,7 @@ void DisassemblerWidget::OnPause()
225 227
226void DisassemblerWidget::OnToggleStartStop() 228void DisassemblerWidget::OnToggleStartStop()
227{ 229{
228 emu_thread.SetCpuRunning(!emu_thread.IsCpuRunning()); 230 main_window.GetEmuThread()->SetCpuRunning(!main_window.GetEmuThread()->IsCpuRunning());
229} 231}
230 232
231void DisassemblerWidget::OnDebugModeEntered() 233void DisassemblerWidget::OnDebugModeEntered()
@@ -233,7 +235,7 @@ void DisassemblerWidget::OnDebugModeEntered()
233 ARMword next_instr = Core::g_app_core->GetPC(); 235 ARMword next_instr = Core::g_app_core->GetPC();
234 236
235 if (model->GetBreakPoints().IsAddressBreakPoint(next_instr)) 237 if (model->GetBreakPoints().IsAddressBreakPoint(next_instr))
236 emu_thread.SetCpuRunning(false); 238 main_window.GetEmuThread()->SetCpuRunning(false);
237 239
238 model->SetNextInstruction(next_instr); 240 model->SetNextInstruction(next_instr);
239 241