From bf674d301c4f64ef03523b49f88b6def7d0a53e0 Mon Sep 17 00:00:00 2001 From: allkern Date: Thu, 12 Dec 2024 23:27:49 -0300 Subject: [PATCH] Debugger: Add Reset button Add a handy 'Reset' button next to the 'Run' button --- pcsx2-qt/Debugger/DebuggerWindow.cpp | 6 ++++++ pcsx2-qt/Debugger/DebuggerWindow.h | 2 ++ pcsx2-qt/Debugger/DebuggerWindow.ui | 9 +++++++++ 3 files changed, 17 insertions(+) diff --git a/pcsx2-qt/Debugger/DebuggerWindow.cpp b/pcsx2-qt/Debugger/DebuggerWindow.cpp index 4fba8fe861..2fa192fa38 100644 --- a/pcsx2-qt/Debugger/DebuggerWindow.cpp +++ b/pcsx2-qt/Debugger/DebuggerWindow.cpp @@ -27,6 +27,7 @@ DebuggerWindow::DebuggerWindow(QWidget* parent) #endif connect(m_ui.actionRun, &QAction::triggered, this, &DebuggerWindow::onRunPause); + connect(m_ui.actionReset, &QAction::triggered, this, &DebuggerWindow::onReset); connect(m_ui.actionStepInto, &QAction::triggered, this, &DebuggerWindow::onStepInto); connect(m_ui.actionStepOver, &QAction::triggered, this, &DebuggerWindow::onStepOver); connect(m_ui.actionStepOut, &QAction::triggered, this, &DebuggerWindow::onStepOut); @@ -113,6 +114,11 @@ void DebuggerWindow::onRunPause() g_emu_thread->setVMPaused(!QtHost::IsVMPaused()); } +void DebuggerWindow::onReset() +{ + g_emu_thread->resetVM(); +} + void DebuggerWindow::onStepInto() { CpuWidget* currentCpu = static_cast(m_ui.cpuTabs->currentWidget()); diff --git a/pcsx2-qt/Debugger/DebuggerWindow.h b/pcsx2-qt/Debugger/DebuggerWindow.h index 07e46e2ee1..f9d791e2ee 100644 --- a/pcsx2-qt/Debugger/DebuggerWindow.h +++ b/pcsx2-qt/Debugger/DebuggerWindow.h @@ -18,6 +18,7 @@ public: public slots: void onVMStateChanged(); void onRunPause(); + void onReset(); void onStepInto(); void onStepOver(); void onStepOut(); @@ -30,6 +31,7 @@ protected: private: Ui::DebuggerWindow m_ui; QAction* m_actionRunPause; + QAction* m_actionReset; QAction* m_actionStepInto; QAction* m_actionStepOver; QAction* m_actionStepOut; diff --git a/pcsx2-qt/Debugger/DebuggerWindow.ui b/pcsx2-qt/Debugger/DebuggerWindow.ui index c668a6316b..99cfe0af01 100644 --- a/pcsx2-qt/Debugger/DebuggerWindow.ui +++ b/pcsx2-qt/Debugger/DebuggerWindow.ui @@ -51,6 +51,7 @@ false + @@ -65,6 +66,14 @@ Run + + + + + + Reset + +