mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-26 22:38:34 +00:00
Qt/Debugger: Implement patch instruction preview
This commit is contained in:
parent
2abe333ce9
commit
f6e73a0aec
5 changed files with 110 additions and 8 deletions
|
@ -26,6 +26,7 @@
|
|||
#include "Core/PowerPC/PPCAnalyst.h"
|
||||
#include "Core/PowerPC/PPCSymbolDB.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
#include "DolphinQt/Debugger/PatchInstructionDialog.h"
|
||||
#include "DolphinQt/Resources.h"
|
||||
#include "DolphinQt/Settings.h"
|
||||
|
||||
|
@ -463,17 +464,12 @@ void CodeViewWidget::OnReplaceInstruction()
|
|||
if (!read_result.valid)
|
||||
return;
|
||||
|
||||
bool good;
|
||||
QString name = QInputDialog::getText(
|
||||
this, tr("Change instruction"), tr("New instruction:"), QLineEdit::Normal,
|
||||
QStringLiteral("%1").arg(read_result.hex, 8, 16, QLatin1Char('0')), &good);
|
||||
PatchInstructionDialog dialog(this, addr, PowerPC::debug_interface.ReadInstruction(addr));
|
||||
|
||||
u32 code = name.toUInt(&good, 16);
|
||||
|
||||
if (good)
|
||||
if (dialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
PowerPC::debug_interface.UnsetPatch(addr);
|
||||
PowerPC::debug_interface.SetPatch(addr, code);
|
||||
PowerPC::debug_interface.SetPatch(addr, dialog.GetCode());
|
||||
Update();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue