diff --git a/pcsx2-qt/Debugger/DisassemblyWidget.cpp b/pcsx2-qt/Debugger/DisassemblyWidget.cpp index 57afb9612e..e467bcbb58 100644 --- a/pcsx2-qt/Debugger/DisassemblyWidget.cpp +++ b/pcsx2-qt/Debugger/DisassemblyWidget.cpp @@ -60,6 +60,8 @@ void DisassemblyWidget::CreateCustomContextMenu() m_contextMenu->addSeparator(); m_contextMenu->addAction(action = new QAction(tr("Assemble new Instruction(s)"), this)); connect(action, &QAction::triggered, this, &DisassemblyWidget::contextAssembleInstruction); + m_contextMenu->addAction(action = new QAction(tr("NOP Instruction(s)"), this)); + connect(action, &QAction::triggered, this, &DisassemblyWidget::contextNoopInstruction); m_contextMenu->addSeparator(); m_contextMenu->addAction(action = new QAction(tr("Run to Cursor"), this)); connect(action, &QAction::triggered, this, &DisassemblyWidget::contextRunToCursor); @@ -136,6 +138,17 @@ void DisassemblyWidget::contextAssembleInstruction() } } +void DisassemblyWidget::contextNoopInstruction() +{ + Host::RunOnCPUThread([this, start = m_selectedAddressStart, end = m_selectedAddressEnd, cpu = m_cpu] { + for (u32 i = start; i <= end; i += 4) + { + cpu->write32(i, 0x00); + } + QtHost::RunOnUIThread([this] { VMUpdate(); }); + }); +} + void DisassemblyWidget::contextRunToCursor() { Host::RunOnCPUThread([&] { CBreakPoints::AddBreakPoint(m_cpu->getCpuType(), m_selectedAddressStart); }); diff --git a/pcsx2-qt/Debugger/DisassemblyWidget.h b/pcsx2-qt/Debugger/DisassemblyWidget.h index 21baccb925..6ab73715be 100644 --- a/pcsx2-qt/Debugger/DisassemblyWidget.h +++ b/pcsx2-qt/Debugger/DisassemblyWidget.h @@ -55,6 +55,7 @@ public slots: void contextCopyInstructionHex(); void contextCopyInstructionText(); void contextAssembleInstruction(); + void contextNoopInstruction(); void contextRunToCursor(); void contextJumpToCursor(); void contextToggleBreakpoint();