mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-27 18:30:56 +00:00
Merge pull request #4067 from unknownbrackets/savestates
Always register the cheat event, for savestates
This commit is contained in:
commit
061efd35db
@ -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);
|
||||
|
||||
|
@ -9,8 +9,12 @@
|
||||
#include "base/basictypes.h"
|
||||
#include "Core/MemMap.h"
|
||||
|
||||
class PointerWrap;
|
||||
|
||||
void __CheatInit();
|
||||
void __CheatShutdown();
|
||||
void __CheatDoState(PointerWrap &p);
|
||||
|
||||
std::vector<std::string> makeCodeParts(std::vector<std::string> CodesList);
|
||||
|
||||
class CWCheatEngine {
|
||||
|
@ -247,6 +247,7 @@ void __KernelDoState(PointerWrap &p)
|
||||
__HeapDoState(p);
|
||||
|
||||
__PPGeDoState(p);
|
||||
__CheatDoState(p);
|
||||
}
|
||||
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user