mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-24 16:49:50 +00:00
Also allow restartless cheats after loading state.
At least, an older state.
This commit is contained in:
parent
bbaacab315
commit
a466b5ba32
@ -59,13 +59,20 @@ void __CheatShutdown() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void __CheatDoState(PointerWrap &p) {
|
void __CheatDoState(PointerWrap &p) {
|
||||||
auto s = p.Section("CwCheat", 0, 1);
|
auto s = p.Section("CwCheat", 0, 2);
|
||||||
if (!s) {
|
if (!s) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
p.Do(CheatEvent);
|
p.Do(CheatEvent);
|
||||||
CoreTiming::RestoreRegisterEvent(CheatEvent, "CheatEvent", &hleCheat);
|
CoreTiming::RestoreRegisterEvent(CheatEvent, "CheatEvent", &hleCheat);
|
||||||
|
|
||||||
|
if (s < 2) {
|
||||||
|
// Before this we didn't have a checkpoint, so reset didn't work.
|
||||||
|
// Let's just force one in.
|
||||||
|
CoreTiming::RemoveEvent(CheatEvent);
|
||||||
|
CoreTiming::ScheduleEvent(msToCycles(cheatsEnabled ? 77 : 1000), CheatEvent, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void hleCheat(u64 userdata, int cyclesLate) {
|
void hleCheat(u64 userdata, int cyclesLate) {
|
||||||
|
Loading…
Reference in New Issue
Block a user