From b3e17d2772b6ea2d1c6afef73f3d857cc2faf795 Mon Sep 17 00:00:00 2001 From: "Admiral H. Curtiss" Date: Thu, 28 Oct 2021 01:59:52 +0200 Subject: [PATCH] Qt/CheatSearchFactoryWidget: Refuse to start standard memory region searches when no game is running because the memory size and console type may not be accurate. --- Source/Core/DolphinQt/CheatSearchFactoryWidget.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Source/Core/DolphinQt/CheatSearchFactoryWidget.cpp b/Source/Core/DolphinQt/CheatSearchFactoryWidget.cpp index 4e0f8f2f1b..6e566600f8 100644 --- a/Source/Core/DolphinQt/CheatSearchFactoryWidget.cpp +++ b/Source/Core/DolphinQt/CheatSearchFactoryWidget.cpp @@ -20,8 +20,10 @@ #include "Core/CheatSearch.h" #include "Core/Config/MainSettings.h" #include "Core/ConfigManager.h" +#include "Core/Core.h" #include "Core/HW/Memmap.h" #include "Core/PowerPC/MMU.h" +#include "DolphinQt/QtUtils/ModalMessageBox.h" CheatSearchFactoryWidget::CheatSearchFactoryWidget() { @@ -152,6 +154,15 @@ void CheatSearchFactoryWidget::OnNewSearchClicked() PowerPC::RequestedAddressSpace address_space; if (m_standard_address_space->isChecked()) { + const Core::State core_state = Core::GetState(); + if (core_state != Core::State::Running && core_state != Core::State::Paused) + { + ModalMessageBox::warning( + this, tr("No game running."), + tr("Please start a game before starting a search with standard memory regions.")); + return; + } + memory_ranges.emplace_back(0x80000000, Memory::GetRamSizeReal()); if (SConfig::GetInstance().bWii) memory_ranges.emplace_back(0x90000000, Memory::GetExRamSizeReal());