VMManager: Fix no ws/ni patches message showing up on reset

This commit is contained in:
Connor McLaughlin 2022-05-26 00:10:11 +10:00 committed by refractionpcsx2
parent 796519f6a7
commit 3b5538a09c
3 changed files with 13 additions and 13 deletions

View File

@ -487,7 +487,7 @@ void EmuThread::reloadPatches()
if (!VMManager::HasValidVM()) if (!VMManager::HasValidVM())
return; return;
VMManager::ReloadPatches(true); VMManager::ReloadPatches(true, true);
} }
void EmuThread::reloadInputSources() void EmuThread::reloadInputSources()

View File

@ -85,7 +85,7 @@ namespace VMManager
static bool CheckBIOSAvailability(); static bool CheckBIOSAvailability();
static void LoadPatches(const std::string& serial, u32 crc, static void LoadPatches(const std::string& serial, u32 crc,
bool show_messages, bool show_messages_when_disabled); bool show_messages, bool show_messages_when_disabled);
static void UpdateRunningGame(bool force, bool game_starting); static void UpdateRunningGame(bool resetting, bool game_starting);
static std::string GetCurrentSaveStateFileName(s32 slot); static std::string GetCurrentSaveStateFileName(s32 slot);
static bool DoLoadState(const char* filename); static bool DoLoadState(const char* filename);
@ -508,7 +508,7 @@ void VMManager::LoadPatches(const std::string& serial, u32 crc, bool show_messag
} }
} }
void VMManager::UpdateRunningGame(bool force, bool game_starting) void VMManager::UpdateRunningGame(bool resetting, bool game_starting)
{ {
// The CRC can be known before the game actually starts (at the bios), so when // The CRC can be known before the game actually starts (at the bios), so when
// we have the CRC but we're still at the bios and the settings are changed // we have the CRC but we're still at the bios and the settings are changed
@ -528,7 +528,7 @@ void VMManager::UpdateRunningGame(bool force, bool game_starting)
new_serial = GSDumpReplayer::GetDumpSerial(); new_serial = GSDumpReplayer::GetDumpSerial();
} }
if (!force && s_game_crc == new_crc && s_game_serial == new_serial) if (!resetting && s_game_crc == new_crc && s_game_serial == new_serial)
return; return;
{ {
@ -554,7 +554,7 @@ void VMManager::UpdateRunningGame(bool force, bool game_starting)
// If we don't reset the timer here, when using folder memcards the reindex will cause an eject, // If we don't reset the timer here, when using folder memcards the reindex will cause an eject,
// which a bunch of games don't like since they access the memory card on boot. // which a bunch of games don't like since they access the memory card on boot.
if (game_starting) if (game_starting || resetting)
ClearMcdEjectTimeoutNow(); ClearMcdEjectTimeoutNow();
} }
@ -563,7 +563,7 @@ void VMManager::UpdateRunningGame(bool force, bool game_starting)
// check this here, for two cases: dynarec on, and when enable cheats is set per-game. // check this here, for two cases: dynarec on, and when enable cheats is set per-game.
if (s_patches_crc != s_game_crc) if (s_patches_crc != s_game_crc)
ReloadPatches(true); ReloadPatches(game_starting, false);
GetMTGS().SendGameCRC(new_crc); GetMTGS().SendGameCRC(new_crc);
@ -574,9 +574,9 @@ void VMManager::UpdateRunningGame(bool force, bool game_starting)
R3000SymbolMap.UpdateActiveSymbols(); R3000SymbolMap.UpdateActiveSymbols();
} }
void VMManager::ReloadPatches(bool verbose) void VMManager::ReloadPatches(bool verbose, bool show_messages_when_disabled)
{ {
LoadPatches(s_game_serial, s_game_crc, verbose, verbose); LoadPatches(s_game_serial, s_game_crc, verbose, show_messages_when_disabled);
} }
static LimiterModeType GetInitialLimiterMode() static LimiterModeType GetInitialLimiterMode()
@ -844,7 +844,7 @@ bool VMManager::Initialize(const VMBootParameters& boot_params)
s_state.store(VMState::Paused); s_state.store(VMState::Paused);
Host::OnVMStarted(); Host::OnVMStarted();
UpdateRunningGame(true, true); UpdateRunningGame(true, false);
SetEmuThreadAffinities(true); SetEmuThreadAffinities(true);
@ -941,7 +941,7 @@ void VMManager::Reset()
// gameid change, so apply settings // gameid change, so apply settings
if (game_was_started) if (game_was_started)
UpdateRunningGame(true, true); UpdateRunningGame(true, false);
} }
std::string VMManager::GetSaveStateFileName(const char* game_serial, u32 game_crc, s32 slot) std::string VMManager::GetSaveStateFileName(const char* game_serial, u32 game_crc, s32 slot)
@ -1351,7 +1351,7 @@ void VMManager::CheckForPatchConfigChanges(const Pcsx2Config& old_config)
return; return;
} }
ReloadPatches(true); ReloadPatches(true, true);
} }
void VMManager::CheckForSPU2ConfigChanges(const Pcsx2Config& old_config) void VMManager::CheckForSPU2ConfigChanges(const Pcsx2Config& old_config)
@ -1453,7 +1453,7 @@ void VMManager::CheckForConfigChanges(const Pcsx2Config& old_config)
EmuConfig.EnableWideScreenPatches != old_config.EnableWideScreenPatches || EmuConfig.EnableWideScreenPatches != old_config.EnableWideScreenPatches ||
EmuConfig.EnableNoInterlacingPatches != old_config.EnableNoInterlacingPatches) EmuConfig.EnableNoInterlacingPatches != old_config.EnableNoInterlacingPatches)
{ {
VMManager::ReloadPatches(true); VMManager::ReloadPatches(true, true);
} }
} }

View File

@ -95,7 +95,7 @@ namespace VMManager
bool ReloadGameSettings(); bool ReloadGameSettings();
/// Reloads cheats/patches. If verbose is set, the number of patches loaded will be shown in the OSD. /// Reloads cheats/patches. If verbose is set, the number of patches loaded will be shown in the OSD.
void ReloadPatches(bool verbose); void ReloadPatches(bool verbose, bool show_messages_when_disabled);
/// Returns the save state filename for the given game serial/crc. /// Returns the save state filename for the given game serial/crc.
std::string GetSaveStateFileName(const char* game_serial, u32 game_crc, s32 slot); std::string GetSaveStateFileName(const char* game_serial, u32 game_crc, s32 slot);