Fuzz: Cheats must be initialized after reset

This commit is contained in:
Jeffrey Pfau 2016-09-19 07:31:34 -07:00
parent 891a607507
commit 986dc18340
1 changed files with 10 additions and 10 deletions

View File

@ -91,16 +91,6 @@ int main(int argc, char** argv) {
#endif #endif
mCoreLoadFile(core, args.fname); mCoreLoadFile(core, args.fname);
struct mCheatDevice* device;
if (args.cheatsFile && (device = core->cheatDevice(core))) {
struct VFile* vf = VFileOpen(args.cheatsFile, O_RDONLY);
if (vf) {
mCheatDeviceClear(device);
mCheatParseFile(device, vf);
vf->close(vf);
}
}
struct VFile* savestate = 0; struct VFile* savestate = 0;
struct VFile* savestateOverlay = 0; struct VFile* savestateOverlay = 0;
size_t overlayOffset; size_t overlayOffset;
@ -119,6 +109,16 @@ int main(int argc, char** argv) {
core->reset(core); core->reset(core);
struct mCheatDevice* device;
if (args.cheatsFile && (device = core->cheatDevice(core))) {
struct VFile* vf = VFileOpen(args.cheatsFile, O_RDONLY);
if (vf) {
mCheatDeviceClear(device);
mCheatParseFile(device, vf);
vf->close(vf);
}
}
if (savestate) { if (savestate) {
if (!savestateOverlay) { if (!savestateOverlay) {
mCoreLoadStateNamed(core, savestate, 0); mCoreLoadStateNamed(core, savestate, 0);