mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-07-08 16:18:41 +12:00
Make address input wider
Co-Authored-By: liuk707 <62625900+liuk7071@users.noreply.github.com>
This commit is contained in:
parent
37f38509db
commit
2909e671aa
2 changed files with 5 additions and 6 deletions
|
@ -5,6 +5,7 @@
|
||||||
#include <QScrollBar>
|
#include <QScrollBar>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
|
#include "capstone.hpp"
|
||||||
#include "emulator.hpp"
|
#include "emulator.hpp"
|
||||||
#include "panda_qt/disabled_widget_overlay.hpp"
|
#include "panda_qt/disabled_widget_overlay.hpp"
|
||||||
|
|
||||||
|
@ -22,6 +23,7 @@ class CPUDebugger : public QWidget {
|
||||||
|
|
||||||
bool enabled = false;
|
bool enabled = false;
|
||||||
bool followPC = false;
|
bool followPC = false;
|
||||||
|
Common::CapstoneDisassembler disassembler;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CPUDebugger(Emulator* emulator, QWidget* parent = nullptr);
|
CPUDebugger(Emulator* emulator, QWidget* parent = nullptr);
|
||||||
|
|
|
@ -12,8 +12,6 @@
|
||||||
#include <span>
|
#include <span>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include "capstone.hpp"
|
|
||||||
|
|
||||||
// TODO: Make this actually thread-safe by having it only work when paused
|
// TODO: Make this actually thread-safe by having it only work when paused
|
||||||
static int getLinesInViewport(QListWidget* listWidget) {
|
static int getLinesInViewport(QListWidget* listWidget) {
|
||||||
auto viewportHeight = listWidget->viewport()->height();
|
auto viewportHeight = listWidget->viewport()->height();
|
||||||
|
@ -30,7 +28,7 @@ static std::pair<int, int> getVisibleLineRange(QListWidget* listWidget, QScrollB
|
||||||
return {firstLine, lineCount};
|
return {firstLine, lineCount};
|
||||||
}
|
}
|
||||||
|
|
||||||
CPUDebugger::CPUDebugger(Emulator* emulator, QWidget* parent) : emu(emulator), QWidget(parent, Qt::Window) {
|
CPUDebugger::CPUDebugger(Emulator* emulator, QWidget* parent) : emu(emulator), disassembler(CS_ARCH_ARM, CS_MODE_ARM), QWidget(parent, Qt::Window) {
|
||||||
setWindowTitle(tr("CPU debugger"));
|
setWindowTitle(tr("CPU debugger"));
|
||||||
resize(1000, 600);
|
resize(1000, 600);
|
||||||
|
|
||||||
|
@ -52,7 +50,7 @@ CPUDebugger::CPUDebugger(Emulator* emulator, QWidget* parent) : emu(emulator), Q
|
||||||
connect(followPCCheckBox, &QCheckBox::toggled, this, [&](bool checked) { followPC = checked; });
|
connect(followPCCheckBox, &QCheckBox::toggled, this, [&](bool checked) { followPC = checked; });
|
||||||
|
|
||||||
addressInput->setPlaceholderText(tr("Address to jump to"));
|
addressInput->setPlaceholderText(tr("Address to jump to"));
|
||||||
addressInput->setMaximumWidth(100);
|
addressInput->setMaximumWidth(150);
|
||||||
|
|
||||||
gridLayout->addLayout(horizontalLayout, 0, 0);
|
gridLayout->addLayout(horizontalLayout, 0, 0);
|
||||||
|
|
||||||
|
@ -84,7 +82,7 @@ CPUDebugger::CPUDebugger(Emulator* emulator, QWidget* parent) : emu(emulator), Q
|
||||||
// Forward scrolling from the list widget to our scrollbar
|
// Forward scrolling from the list widget to our scrollbar
|
||||||
disasmListWidget->installEventFilter(this);
|
disasmListWidget->installEventFilter(this);
|
||||||
|
|
||||||
// Annoyingly, due to a Qt limitation we can't set it to U32_MAX
|
// Annoyingly, due to a Qt limitation we can't set it to U32_MAX
|
||||||
verticalScrollBar->setRange(0, std::numeric_limits<s32>::max());
|
verticalScrollBar->setRange(0, std::numeric_limits<s32>::max());
|
||||||
verticalScrollBar->setSingleStep(8);
|
verticalScrollBar->setSingleStep(8);
|
||||||
verticalScrollBar->setPageStep(getLinesInViewport(disasmListWidget));
|
verticalScrollBar->setPageStep(getLinesInViewport(disasmListWidget));
|
||||||
|
@ -157,7 +155,6 @@ void CPUDebugger::updateDisasm() {
|
||||||
auto& mem = emu->getMemory();
|
auto& mem = emu->getMemory();
|
||||||
u32 pc = cpu.getReg(15);
|
u32 pc = cpu.getReg(15);
|
||||||
|
|
||||||
Common::CapstoneDisassembler disassembler(CS_ARCH_ARM, CS_MODE_ARM);
|
|
||||||
std::string disassembly;
|
std::string disassembly;
|
||||||
|
|
||||||
for (u32 addr = startPC; addr < endPC; addr += sizeof(u32)) {
|
for (u32 addr = startPC; addr < endPC; addr += sizeof(u32)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue