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.
This commit is contained in:
Avi Halachmi (:avih) 2016-07-27 10:44:46 +03:00
parent d6383e6c21
commit 56adb85a87
1 changed files with 2 additions and 0 deletions

View File

@ -197,6 +197,8 @@ void SysCoreThread::_reset_stuff_as_needed()
m_resetVirtualMachine = false;
m_resetVsyncTimers = false;
ResetCheatsCount();
}
if( m_resetVsyncTimers )