mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Always register the cheat event, for savestates.
This way, if you savestate with cheats on or off, it'll load fine.
This commit is contained in:
1 parent
07cf92b3a9
commit
0c8cc25eb4
3 files changed
+17
-1
No files matched your search
+12
-1
@@ -23,6 +23,8 @@ void __CheatInit() {
|
||||
activeCheatFile = CHEATS_DIR + "/" + gameTitle + ".ini";
|
||||
#endif
|
||||
|
||||
CheatEvent = CoreTiming::RegisterEvent("CheatEvent", &hleCheat);
|
||||
|
||||
File::CreateFullPath(CHEATS_DIR);
|
||||
if (g_Config.bEnableCheats) {
|
||||
if (!File::Exists(activeCheatFile)) {
|
||||
@@ -33,7 +35,6 @@ void __CheatInit() {
|
||||
|
||||
cheatEngine->CreateCodeList();
|
||||
g_Config.bReloadCheats = false;
|
||||
CheatEvent = CoreTiming::RegisterEvent("CheatEvent", &hleCheat);
|
||||
CoreTiming::ScheduleEvent(msToCycles(77), CheatEvent, 0);
|
||||
}
|
||||
}
|
||||
@@ -46,6 +47,16 @@ void __CheatShutdown() {
|
||||
}
|
||||
}
|
||||
|
||||
void __CheatDoState(PointerWrap &p) {
|
||||
auto s = p.Section("CwCheat", 0, 1);
|
||||
if (!s) {
|
||||
return;
|
||||
}
|
||||
|
||||
p.Do(CheatEvent);
|
||||
CoreTiming::RestoreRegisterEvent(CheatEvent, "CheatEvent", &hleCheat);
|
||||
}
|
||||
|
||||
void hleCheat(u64 userdata, int cyclesLate) {
|
||||
CoreTiming::ScheduleEvent(msToCycles(77), CheatEvent, 0);
|
||||
|
||||
|
||||
Reference in new issue
Block a user