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.

This commit is contained in:
Admiral H. Curtiss 2021-10-28 01:59:52 +02:00
parent d6ad3fbcb5
commit b3e17d2772
No known key found for this signature in database
GPG Key ID: F051B4C4044F33FB
1 changed files with 11 additions and 0 deletions

View File

@ -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());