diff options
| author | 2014-04-18 18:30:53 -0400 | |
|---|---|---|
| committer | 2014-04-18 18:34:23 -0400 | |
| commit | e5f09b8be65c06927164428b5d400024e2388dbc (patch) | |
| tree | 0f0fd4035bcc88c0de5a47a7d3c64b4f67453897 /src/citra_qt/debugger/disassembler.cpp | |
| parent | Merge branch 'hle-interface' (diff) | |
| download | yuzu-e5f09b8be65c06927164428b5d400024e2388dbc.tar.gz yuzu-e5f09b8be65c06927164428b5d400024e2388dbc.tar.xz yuzu-e5f09b8be65c06927164428b5d400024e2388dbc.zip | |
UI/debugger changes
Diffstat (limited to '')
| -rw-r--r-- | src/citra_qt/debugger/disassembler.cpp (renamed from src/citra_qt/disasm.cpp) | 52 |
1 files changed, 35 insertions, 17 deletions
diff --git a/src/citra_qt/disasm.cpp b/src/citra_qt/debugger/disassembler.cpp index 5f3a6058a..cc4cb13fa 100644 --- a/src/citra_qt/disasm.cpp +++ b/src/citra_qt/debugger/disassembler.cpp | |||
| @@ -1,9 +1,9 @@ | |||
| 1 | #include <QtGui> | 1 | #include <QtGui> |
| 2 | #include "ui_disasm.h" | ||
| 3 | #include "disasm.hxx" | ||
| 4 | 2 | ||
| 5 | #include "bootmanager.hxx" | 3 | #include "disassembler.hxx" |
| 6 | #include "hotkeys.hxx" | 4 | |
| 5 | #include "../bootmanager.hxx" | ||
| 6 | #include "../hotkeys.hxx" | ||
| 7 | 7 | ||
| 8 | #include "common/common.h" | 8 | #include "common/common.h" |
| 9 | #include "core/mem_map.h" | 9 | #include "core/mem_map.h" |
| @@ -14,7 +14,7 @@ | |||
| 14 | #include "core/arm/interpreter/armdefs.h" | 14 | #include "core/arm/interpreter/armdefs.h" |
| 15 | #include "core/arm/disassembler/arm_disasm.h" | 15 | #include "core/arm/disassembler/arm_disasm.h" |
| 16 | 16 | ||
| 17 | GDisAsmView::GDisAsmView(QWidget* parent, EmuThread& emu_thread) : QDockWidget(parent), base_addr(0), emu_thread(emu_thread) | 17 | DisassemblerWidget::DisassemblerWidget(QWidget* parent, EmuThread& emu_thread) : QDockWidget(parent), base_addr(0), emu_thread(emu_thread) |
| 18 | { | 18 | { |
| 19 | disasm_ui.setupUi(this); | 19 | disasm_ui.setupUi(this); |
| 20 | 20 | ||
| @@ -23,7 +23,7 @@ GDisAsmView::GDisAsmView(QWidget* parent, EmuThread& emu_thread) : QDockWidget(p | |||
| 23 | model = new QStandardItemModel(this); | 23 | model = new QStandardItemModel(this); |
| 24 | model->setColumnCount(3); | 24 | model->setColumnCount(3); |
| 25 | disasm_ui.treeView->setModel(model); | 25 | disasm_ui.treeView->setModel(model); |
| 26 | 26 | disasm_ui.tableView->setModel(model); | |
| 27 | RegisterHotkey("Disassembler", "Start/Stop", QKeySequence(Qt::Key_F5), Qt::ApplicationShortcut); | 27 | RegisterHotkey("Disassembler", "Start/Stop", QKeySequence(Qt::Key_F5), Qt::ApplicationShortcut); |
| 28 | RegisterHotkey("Disassembler", "Step", QKeySequence(Qt::Key_F10), Qt::ApplicationShortcut); | 28 | RegisterHotkey("Disassembler", "Step", QKeySequence(Qt::Key_F10), Qt::ApplicationShortcut); |
| 29 | RegisterHotkey("Disassembler", "Step into", QKeySequence(Qt::Key_F11), Qt::ApplicationShortcut); | 29 | RegisterHotkey("Disassembler", "Step into", QKeySequence(Qt::Key_F11), Qt::ApplicationShortcut); |
| @@ -40,7 +40,7 @@ GDisAsmView::GDisAsmView(QWidget* parent, EmuThread& emu_thread) : QDockWidget(p | |||
| 40 | connect(GetHotkey("Disassembler", "Set Breakpoint", this), SIGNAL(activated()), this, SLOT(OnSetBreakpoint())); | 40 | connect(GetHotkey("Disassembler", "Set Breakpoint", this), SIGNAL(activated()), this, SLOT(OnSetBreakpoint())); |
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | void GDisAsmView::Init() | 43 | void DisassemblerWidget::Init() |
| 44 | { | 44 | { |
| 45 | ARM_Disasm* disasm = new ARM_Disasm(); | 45 | ARM_Disasm* disasm = new ARM_Disasm(); |
| 46 | 46 | ||
| @@ -64,13 +64,20 @@ void GDisAsmView::Init() | |||
| 64 | } | 64 | } |
| 65 | disasm_ui.treeView->resizeColumnToContents(0); | 65 | disasm_ui.treeView->resizeColumnToContents(0); |
| 66 | disasm_ui.treeView->resizeColumnToContents(1); | 66 | disasm_ui.treeView->resizeColumnToContents(1); |
| 67 | 67 | disasm_ui.treeView->resizeColumnToContents(2); | |
| 68 | disasm_ui.tableView->resizeColumnToContents(0); | ||
| 69 | disasm_ui.tableView->resizeColumnToContents(1); | ||
| 70 | disasm_ui.tableView->resizeColumnToContents(2); | ||
| 71 | |||
| 68 | QModelIndex model_index = model->index(0, 0); | 72 | QModelIndex model_index = model->index(0, 0); |
| 69 | disasm_ui.treeView->scrollTo(model_index); | 73 | disasm_ui.treeView->scrollTo(model_index); |
| 70 | disasm_ui.treeView->selectionModel()->setCurrentIndex(model_index, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); | 74 | disasm_ui.treeView->selectionModel()->setCurrentIndex(model_index, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); |
| 75 | |||
| 76 | disasm_ui.tableView->scrollTo(model_index); | ||
| 77 | disasm_ui.tableView->selectionModel()->setCurrentIndex(model_index, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); | ||
| 71 | } | 78 | } |
| 72 | 79 | ||
| 73 | void GDisAsmView::OnSetBreakpoint() | 80 | void DisassemblerWidget::OnSetBreakpoint() |
| 74 | { | 81 | { |
| 75 | int selected_row = SelectedRow(); | 82 | int selected_row = SelectedRow(); |
| 76 | 83 | ||
| @@ -92,33 +99,33 @@ void GDisAsmView::OnSetBreakpoint() | |||
| 92 | } | 99 | } |
| 93 | } | 100 | } |
| 94 | 101 | ||
| 95 | void GDisAsmView::OnContinue() | 102 | void DisassemblerWidget::OnContinue() |
| 96 | { | 103 | { |
| 97 | emu_thread.SetCpuRunning(true); | 104 | emu_thread.SetCpuRunning(true); |
| 98 | } | 105 | } |
| 99 | 106 | ||
| 100 | void GDisAsmView::OnStep() | 107 | void DisassemblerWidget::OnStep() |
| 101 | { | 108 | { |
| 102 | OnStepInto(); // change later | 109 | OnStepInto(); // change later |
| 103 | } | 110 | } |
| 104 | 111 | ||
| 105 | void GDisAsmView::OnStepInto() | 112 | void DisassemblerWidget::OnStepInto() |
| 106 | { | 113 | { |
| 107 | emu_thread.SetCpuRunning(false); | 114 | emu_thread.SetCpuRunning(false); |
| 108 | emu_thread.ExecStep(); | 115 | emu_thread.ExecStep(); |
| 109 | } | 116 | } |
| 110 | 117 | ||
| 111 | void GDisAsmView::OnPause() | 118 | void DisassemblerWidget::OnPause() |
| 112 | { | 119 | { |
| 113 | emu_thread.SetCpuRunning(false); | 120 | emu_thread.SetCpuRunning(false); |
| 114 | } | 121 | } |
| 115 | 122 | ||
| 116 | void GDisAsmView::OnToggleStartStop() | 123 | void DisassemblerWidget::OnToggleStartStop() |
| 117 | { | 124 | { |
| 118 | emu_thread.SetCpuRunning(!emu_thread.IsCpuRunning()); | 125 | emu_thread.SetCpuRunning(!emu_thread.IsCpuRunning()); |
| 119 | } | 126 | } |
| 120 | 127 | ||
| 121 | void GDisAsmView::OnCPUStepped() | 128 | void DisassemblerWidget::OnCPUStepped() |
| 122 | { | 129 | { |
| 123 | ARMword next_instr = Core::g_app_core->GetPC(); | 130 | ARMword next_instr = Core::g_app_core->GetPC(); |
| 124 | 131 | ||
| @@ -131,13 +138,24 @@ void GDisAsmView::OnCPUStepped() | |||
| 131 | QModelIndex model_index = model->index(index, 0); | 138 | QModelIndex model_index = model->index(index, 0); |
| 132 | disasm_ui.treeView->scrollTo(model_index); | 139 | disasm_ui.treeView->scrollTo(model_index); |
| 133 | disasm_ui.treeView->selectionModel()->setCurrentIndex(model_index, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); | 140 | disasm_ui.treeView->selectionModel()->setCurrentIndex(model_index, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); |
| 141 | |||
| 142 | disasm_ui.tableView->scrollTo(model_index); | ||
| 143 | disasm_ui.tableView->selectionModel()->setCurrentIndex(model_index, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); | ||
| 144 | disasm_ui.tableView->selectionModel()->select(model_index, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); | ||
| 134 | } | 145 | } |
| 135 | 146 | ||
| 136 | int GDisAsmView::SelectedRow() | 147 | int DisassemblerWidget::SelectedRow() |
| 137 | { | 148 | { |
| 138 | QModelIndex index = disasm_ui.treeView->selectionModel()->currentIndex(); | 149 | QModelIndex index = disasm_ui.treeView->selectionModel()->currentIndex(); |
| 139 | if (!index.isValid()) | 150 | if (!index.isValid()) |
| 140 | return -1; | 151 | return -1; |
| 141 | 152 | ||
| 142 | return model->itemFromIndex(disasm_ui.treeView->selectionModel()->currentIndex())->row(); | 153 | return model->itemFromIndex(disasm_ui.treeView->selectionModel()->currentIndex())->row(); |
| 143 | } \ No newline at end of file | 154 | } |
| 155 | /* | ||
| 156 | void DisassemblerWidget::paintEvent() | ||
| 157 | { | ||
| 158 | QPainter painter(this); | ||
| 159 | painter.drawRect(10, 10, 50, 50); | ||
| 160 | } | ||
| 161 | */ \ No newline at end of file | ||