diff options
-rw-r--r-- | source/cheats.c | 4 | ||||
-rw-r--r-- | source/cheats.h | 4 | ||||
-rw-r--r-- | source/cheats2.c | 5 | ||||
-rw-r--r-- | source/cpu.c | 10 | ||||
-rw-r--r-- | source/gfx.c | 2 | ||||
-rw-r--r-- | source/globals.c | 2 | ||||
-rw-r--r-- | source/memmap.c | 2 |
7 files changed, 26 insertions, 3 deletions
diff --git a/source/cheats.c b/source/cheats.c index f9f1ac8..403738d 100644 --- a/source/cheats.c +++ b/source/cheats.c @@ -86,6 +86,9 @@ Super NES and Super Nintendo Entertainment System are trademarks of Nintendo Co., Limited and its subsidiary companies. *******************************************************************************/ + +#ifdef WANT_CHEATS + #include <stdio.h> #include <ctype.h> #include <string.h> @@ -459,3 +462,4 @@ void S9xOutputCheatSearchResults(SCheatData* d) } } +#endif diff --git a/source/cheats.h b/source/cheats.h index c3b38d5..c3a7a54 100644 --- a/source/cheats.h +++ b/source/cheats.h @@ -89,6 +89,8 @@ #ifndef _CHEATS_H_ #define _CHEATS_H_ +#ifdef WANT_CHEATS + #define MAX_SFCCHEAT_NAME 48 #define MAX_CHEATS_T 800 @@ -159,3 +161,5 @@ void S9xOutputCheatSearchResults (SCheatData *cheats); #endif +#endif + diff --git a/source/cheats2.c b/source/cheats2.c index 8118552..aaee684 100644 --- a/source/cheats2.c +++ b/source/cheats2.c @@ -86,6 +86,9 @@ Super NES and Super Nintendo Entertainment System are trademarks of Nintendo Co., Limited and its subsidiary companies. *******************************************************************************/ + +#ifdef WANT_CHEATS + #include <stdio.h> #include <ctype.h> #include <string.h> @@ -288,3 +291,5 @@ bool8 S9xSaveCheatFile(const char* filename) fclose(fs); return (TRUE); } + +#endif diff --git a/source/cpu.c b/source/cpu.c index 1109a4e..be74003 100644 --- a/source/cpu.c +++ b/source/cpu.c @@ -185,11 +185,13 @@ void S9xReset(void) S9xSA1Init(); if (Settings.C4) S9xInitC4(); + +#ifdef WANT_CHEATS S9xInitCheatData(); +#endif + if (Settings.OBC1) ResetOBC1(); - - // Settings.Paused = FALSE; } void S9xSoftReset(void) { @@ -216,8 +218,10 @@ void S9xSoftReset(void) S9xSA1Init(); if (Settings.C4) S9xInitC4(); + +#ifdef WANT_CHEATS S9xInitCheatData(); +#endif - // Settings.Paused = FALSE; } diff --git a/source/gfx.c b/source/gfx.c index db89ec2..5e8d350 100644 --- a/source/gfx.c +++ b/source/gfx.c @@ -712,7 +712,9 @@ void S9xEndScreenRefresh() GFX.PPL = GFX.PPLx2 >> 1; } +#ifdef WANT_CHEATS S9xApplyCheats(); +#endif if (CPU.SRAMModified) { diff --git a/source/globals.c b/source/globals.c index 87307df..e2c9d7c 100644 --- a/source/globals.c +++ b/source/globals.c @@ -165,7 +165,9 @@ uint32 odd_low[4][16]; uint32 even_high[4][16]; uint32 even_low[4][16]; +#ifdef WANT_CHEATS SCheatData Cheat; +#endif SoundStatus so; diff --git a/source/memmap.c b/source/memmap.c index 13fcd9c..587a2c2 100644 --- a/source/memmap.c +++ b/source/memmap.c @@ -910,9 +910,11 @@ again: FreeSDD1Data(); InitROM(Tales); +#ifdef WANT_CHEATS S9xLoadCheatFile(S9xGetFilename("cht")); S9xInitCheatData(); S9xApplyCheats(); +#endif S9xReset(); |