summaryrefslogtreecommitdiffstats
path: root/src/citra_qt/debugger/disassembler.cpp
diff options
context:
space:
mode:
authorMathieu Vaillancourt <vaillancourtm@gmail.com>2014-04-19 00:30:53 +0200
committerMathieu Vaillancourt <vaillancourtm@gmail.com>2014-04-19 00:34:23 +0200
commite5f09b8be65c06927164428b5d400024e2388dbc (patch)
tree0f0fd4035bcc88c0de5a47a7d3c64b4f67453897 /src/citra_qt/debugger/disassembler.cpp
parentMerge branch 'hle-interface' (diff)
downloadyuzu-e5f09b8be65c06927164428b5d400024e2388dbc.tar
yuzu-e5f09b8be65c06927164428b5d400024e2388dbc.tar.gz
yuzu-e5f09b8be65c06927164428b5d400024e2388dbc.tar.bz2
yuzu-e5f09b8be65c06927164428b5d400024e2388dbc.tar.lz
yuzu-e5f09b8be65c06927164428b5d400024e2388dbc.tar.xz
yuzu-e5f09b8be65c06927164428b5d400024e2388dbc.tar.zst
yuzu-e5f09b8be65c06927164428b5d400024e2388dbc.zip
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 @@
#include <QtGui>
-#include "ui_disasm.h"
-#include "disasm.hxx"
-#include "bootmanager.hxx"
-#include "hotkeys.hxx"
+#include "disassembler.hxx"
+
+#include "../bootmanager.hxx"
+#include "../hotkeys.hxx"
#include "common/common.h"
#include "core/mem_map.h"
@@ -14,7 +14,7 @@
#include "core/arm/interpreter/armdefs.h"
#include "core/arm/disassembler/arm_disasm.h"
-GDisAsmView::GDisAsmView(QWidget* parent, EmuThread& emu_thread) : QDockWidget(parent), base_addr(0), emu_thread(emu_thread)
+DisassemblerWidget::DisassemblerWidget(QWidget* parent, EmuThread& emu_thread) : QDockWidget(parent), base_addr(0), emu_thread(emu_thread)
{
disasm_ui.setupUi(this);
@@ -23,7 +23,7 @@ GDisAsmView::GDisAsmView(QWidget* parent, EmuThread& emu_thread) : QDockWidget(p
model = new QStandardItemModel(this);
model->setColumnCount(3);
disasm_ui.treeView->setModel(model);
-
+ disasm_ui.tableView->setModel(model);
RegisterHotkey("Disassembler", "Start/Stop", QKeySequence(Qt::Key_F5), Qt::ApplicationShortcut);
RegisterHotkey("Disassembler", "Step", QKeySequence(Qt::Key_F10), Qt::ApplicationShortcut);
RegisterHotkey("Disassembler", "Step into", QKeySequence(Qt::Key_F11), Qt::ApplicationShortcut);
@@ -40,7 +40,7 @@ GDisAsmView::GDisAsmView(QWidget* parent, EmuThread& emu_thread) : QDockWidget(p
connect(GetHotkey("Disassembler", "Set Breakpoint", this), SIGNAL(activated()), this, SLOT(OnSetBreakpoint()));
}
-void GDisAsmView::Init()
+void DisassemblerWidget::Init()
{
ARM_Disasm* disasm = new ARM_Disasm();
@@ -64,13 +64,20 @@ void GDisAsmView::Init()
}
disasm_ui.treeView->resizeColumnToContents(0);
disasm_ui.treeView->resizeColumnToContents(1);
-
+ disasm_ui.treeView->resizeColumnToContents(2);
+ disasm_ui.tableView->resizeColumnToContents(0);
+ disasm_ui.tableView->resizeColumnToContents(1);
+ disasm_ui.tableView->resizeColumnToContents(2);
+
QModelIndex model_index = model->index(0, 0);
disasm_ui.treeView->scrollTo(model_index);
disasm_ui.treeView->selectionModel()->setCurrentIndex(model_index, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows);
+
+ disasm_ui.tableView->scrollTo(model_index);
+ disasm_ui.tableView->selectionModel()->setCurrentIndex(model_index, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows);
}
-void GDisAsmView::OnSetBreakpoint()
+void DisassemblerWidget::OnSetBreakpoint()
{
int selected_row = SelectedRow();
@@ -92,33 +99,33 @@ void GDisAsmView::OnSetBreakpoint()
}
}
-void GDisAsmView::OnContinue()
+void DisassemblerWidget::OnContinue()
{
emu_thread.SetCpuRunning(true);
}
-void GDisAsmView::OnStep()
+void DisassemblerWidget::OnStep()
{
OnStepInto(); // change later
}
-void GDisAsmView::OnStepInto()
+void DisassemblerWidget::OnStepInto()
{
emu_thread.SetCpuRunning(false);
emu_thread.ExecStep();
}
-void GDisAsmView::OnPause()
+void DisassemblerWidget::OnPause()
{
emu_thread.SetCpuRunning(false);
}
-void GDisAsmView::OnToggleStartStop()
+void DisassemblerWidget::OnToggleStartStop()
{
emu_thread.SetCpuRunning(!emu_thread.IsCpuRunning());
}
-void GDisAsmView::OnCPUStepped()
+void DisassemblerWidget::OnCPUStepped()
{
ARMword next_instr = Core::g_app_core->GetPC();
@@ -131,13 +138,24 @@ void GDisAsmView::OnCPUStepped()
QModelIndex model_index = model->index(index, 0);
disasm_ui.treeView->scrollTo(model_index);
disasm_ui.treeView->selectionModel()->setCurrentIndex(model_index, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows);
+
+ disasm_ui.tableView->scrollTo(model_index);
+ disasm_ui.tableView->selectionModel()->setCurrentIndex(model_index, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows);
+ disasm_ui.tableView->selectionModel()->select(model_index, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows);
}
-int GDisAsmView::SelectedRow()
+int DisassemblerWidget::SelectedRow()
{
QModelIndex index = disasm_ui.treeView->selectionModel()->currentIndex();
if (!index.isValid())
return -1;
return model->itemFromIndex(disasm_ui.treeView->selectionModel()->currentIndex())->row();
-} \ No newline at end of file
+}
+/*
+void DisassemblerWidget::paintEvent()
+{
+ QPainter painter(this);
+ painter.drawRect(10, 10, 50, 50);
+}
+*/ \ No newline at end of file