diff --git a/src/duckstation-qt/cheatmanagerdialog.cpp b/src/duckstation-qt/cheatmanagerdialog.cpp index cefa7f981..e558fc773 100644 --- a/src/duckstation-qt/cheatmanagerdialog.cpp +++ b/src/duckstation-qt/cheatmanagerdialog.cpp @@ -2,6 +2,8 @@ #include "cheatcodeeditordialog.h" #include "common/assert.h" #include "common/string_util.h" +#include "core/bus.h" +#include "core/cpu_core.h" #include "core/system.h" #include "qthostinterface.h" #include "qtutils.h" @@ -12,6 +14,7 @@ #include #include #include +#include static QString formatHexValue(u32 value) { @@ -92,6 +95,23 @@ void CheatManagerDialog::connectUi() address = value.toUInt(nullptr, 16); m_scanner.SetEndAddress(static_cast(address)); }); + connect(m_ui.scanPresetRange, QOverload::of(&QComboBox::currentIndexChanged), [this](int index) { + if (index == 0) + { + m_ui.scanStartAddress->setText(formatHexValue(0)); + m_ui.scanEndAddress->setText(formatHexValue(Bus::RAM_SIZE)); + } + else if (index == 1) + { + m_ui.scanStartAddress->setText(formatHexValue(CPU::DCACHE_LOCATION)); + m_ui.scanEndAddress->setText(formatHexValue(CPU::DCACHE_LOCATION + CPU::DCACHE_SIZE)); + } + else + { + m_ui.scanStartAddress->setText(formatHexValue(Bus::BIOS_BASE)); + m_ui.scanEndAddress->setText(formatHexValue(Bus::BIOS_BASE + Bus::BIOS_SIZE)); + } + }); connect(m_ui.scanNewSearch, &QPushButton::clicked, [this]() { m_scanner.Search(); updateResults(); diff --git a/src/duckstation-qt/cheatmanagerdialog.ui b/src/duckstation-qt/cheatmanagerdialog.ui index 5bbc57044..45790b4f3 100644 --- a/src/duckstation-qt/cheatmanagerdialog.ui +++ b/src/duckstation-qt/cheatmanagerdialog.ui @@ -370,6 +370,32 @@ + + + + Preset Range: + + + + + + + + RAM + + + + + Scratchpad + + + + + BIOS + + + +