diff --git a/source/ngc/cheatmgr.cpp b/source/ngc/cheatmgr.cpp index e283887..9871df4 100644 --- a/source/ngc/cheatmgr.cpp +++ b/source/ngc/cheatmgr.cpp @@ -62,9 +62,7 @@ SetupCheats() { char filepath[1024]; int offset = 0; - - S9xInitCheatData (); - S9xDeleteCheats (); + uint16 i; int method = GCSettings.SaveMethod; @@ -87,7 +85,7 @@ SetupCheats() if(NGCLoadCheatFile (offset)) { // disable all cheats loaded from the file - for (uint16 i = 0; i < Cheat.num_cheats; i++) + for (i = 0; i < Cheat.num_cheats; i++) S9xDisableCheat(i); } } diff --git a/source/ngc/filebrowser.cpp b/source/ngc/filebrowser.cpp index 60ea335..f09fdeb 100644 --- a/source/ngc/filebrowser.cpp +++ b/source/ngc/filebrowser.cpp @@ -474,6 +474,7 @@ int BrowserLoadFile(int method) StripExt(Memory.ROMFilename, browserList[browser.selIndex].filename); SNESROMSize = 0; + S9xDeleteCheats(); if(!inSz) { diff --git a/source/snes9x/cpu.cpp b/source/snes9x/cpu.cpp index 30bc9ba..da2c234 100644 --- a/source/snes9x/cpu.cpp +++ b/source/snes9x/cpu.cpp @@ -170,11 +170,7 @@ #include "apu.h" #include "dma.h" #include "sa1.h" - -#ifndef NGC #include "cheats.h" -#endif - #include "srtc.h" #include "sdd1.h" #include "spc7110.h" @@ -313,9 +309,9 @@ void S9xReset (void) S9xSA1Init (); if (Settings.C4) S9xInitC4 (); -#ifndef NGC + S9xInitCheatData (); -#endif + if (Settings.OBC1) ResetOBC1(); if (Settings.SuperFX) @@ -359,9 +355,7 @@ void S9xSoftReset (void) if (Settings.C4) S9xInitC4 (); -#ifndef NGC S9xInitCheatData (); -#endif // Settings.Paused = FALSE; } diff --git a/source/snes9x/memmap.cpp b/source/snes9x/memmap.cpp index ee6acb4..972136a 100644 --- a/source/snes9x/memmap.cpp +++ b/source/snes9x/memmap.cpp @@ -190,11 +190,10 @@ #include "seta.h" #include "srtc.h" #include "bsx.h" - +#include "cheats.h" #ifndef NGC #include "reader.h" -#include "cheats.h" #else #include @@ -1006,8 +1005,8 @@ again: InitROM(); -#ifndef NGC S9xInitCheatData(); +#ifndef NGC S9xApplyCheats(); #endif @@ -1231,8 +1230,8 @@ bool8 CMemory::LoadMultiCart (const char *cartA, const char *cartB) InitROM(); -#ifndef NGC S9xInitCheatData(); +#ifndef NGC S9xApplyCheats(); #endif