From 56adb85a87c763f078b57f395cdf8fc60917ca32 Mon Sep 17 00:00:00 2001 From: "Avi Halachmi (:avih)" Date: Wed, 27 Jul 2016 10:44:46 +0300 Subject: [PATCH] cheats: reset cheats when restarting the VM If cheats are enabled and loaded (pnatch files from the cheats folder, or from the cheats_ws folder, or from cheats_ws.zip), then they were still applied for some time while rebooting the emulation after a game is already loaded (e.g. start pcsx2, boot fast, play, boot full). This could cause the reboot to fail if some patches were applied (e.g. widescreen patches). It seems that the offending application of the cheats happens at SysCoreThread::VsyncInThread(), which possibly runs before the config change event is handled (and re-load the cheats for the current crc). So reset/invalidate the cheats when the VM is reset. This should improve issue #851, but ultimately not fully fix it, since the patches (from games db) are not reset yet with this commit, and we don't have a function to do so. For now the non-cheats patches are only reset/reloaded when a configuration change is being handled. It would probably be a good thing if we can unify patches/cheats. --- pcsx2/System/SysCoreThread.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pcsx2/System/SysCoreThread.cpp b/pcsx2/System/SysCoreThread.cpp index a9b9c9a840..aab8c9161f 100644 --- a/pcsx2/System/SysCoreThread.cpp +++ b/pcsx2/System/SysCoreThread.cpp @@ -197,6 +197,8 @@ void SysCoreThread::_reset_stuff_as_needed() m_resetVirtualMachine = false; m_resetVsyncTimers = false; + + ResetCheatsCount(); } if( m_resetVsyncTimers )