Initial DSP debugger work

This commit is contained in:
wheremyfoodat 2025-07-08 01:35:53 +03:00
parent f4e6a082bb
commit 415bf7b0a4
9 changed files with 309 additions and 5 deletions

View file

@ -0,0 +1,45 @@
#pragma once
#include <QLineEdit>
#include <QListWidget>
#include <QPlainTextEdit>
#include <QScrollBar>
#include <QWidget>
#include "capstone.hpp"
#include "emulator.hpp"
#include "panda_qt/disabled_widget_overlay.hpp"
class DSPDebugger : public QWidget {
Q_OBJECT
Emulator* emu;
QListWidget* disasmListWidget;
QScrollBar* verticalScrollBar;
QPlainTextEdit* registerTextEdit;
QTimer* updateTimer;
QLineEdit* addressInput;
DisabledWidgetOverlay* disabledOverlay;
bool enabled = false;
bool followPC = false;
Common::CapstoneDisassembler disassembler;
public:
DSPDebugger(Emulator* emulator, QWidget* parent = nullptr);
void enable();
void disable();
private:
// Update the state of the disassembler. Qt events should always call update, not updateDisasm/updateRegister
// As update properly handles thread safety
void update();
void updateDisasm();
void updateRegisters();
void scrollToPC();
bool eventFilter(QObject* obj, QEvent* event) override;
void showEvent(QShowEvent* event) override;
void resizeEvent(QResizeEvent* event) override;
void keyPressEvent(QKeyEvent* event) override;
};

View file

@ -18,6 +18,7 @@
#include "panda_qt/cheats_window.hpp"
#include "panda_qt/config_window.hpp"
#include "panda_qt/cpu_debugger.hpp"
#include "panda_qt/dsp_debugger.hpp"
#include "panda_qt/patch_window.hpp"
#include "panda_qt/screen.hpp"
#include "panda_qt/shader_editor.hpp"
@ -112,6 +113,7 @@ class MainWindow : public QMainWindow {
PatchWindow* patchWindow;
ShaderEditorWindow* shaderEditor;
CPUDebugger* cpuDebugger;
DSPDebugger* dspDebugger;
ThreadDebugger* threadDebugger;
// We use SDL's game controller API since it's the sanest API that supports as many controllers as possible