From bcaf44c511efaad9d803dde9b0fdbb046498c66f Mon Sep 17 00:00:00 2001 From: João Silva Date: Sun, 18 Jun 2017 16:16:19 +0100 Subject: Support for savestate versioning. Plenty of cleanups. --- source/cheats2.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'source/cheats2.c') diff --git a/source/cheats2.c b/source/cheats2.c index dd4033f..977daf6 100644 --- a/source/cheats2.c +++ b/source/cheats2.c @@ -1,7 +1,5 @@ #include "../copyright" -#ifdef WANT_CHEATS - #include #include #include @@ -18,8 +16,7 @@ void S9xInitCheatData() Cheat.FillRAM = Memory.FillRAM; } -void S9xAddCheat(bool enable, bool save_current_value, - uint32_t address, uint8_t byte) +void S9xAddCheat(bool enable, bool save_current_value, uint32_t address, uint8_t byte) { if (Cheat.num_cheats < sizeof(Cheat.c) / sizeof(Cheat.c [0])) { @@ -45,9 +42,8 @@ void S9xDeleteCheat(uint32_t which1) S9xRemoveCheat(which1); // memmove required: Overlapping addresses [Neb] - memmove(&Cheat.c [which1], &Cheat.c [which1 + 1], - sizeof(Cheat.c [0]) * (Cheat.num_cheats - which1 - 1)); - Cheat.num_cheats--; //MK: This used to set it to 0?? + memmove(&Cheat.c [which1], &Cheat.c [which1 + 1], sizeof(Cheat.c [0]) * (Cheat.num_cheats - which1 - 1)); + Cheat.num_cheats--; } } @@ -204,5 +200,3 @@ bool S9xSaveCheatFile(const char* filename) fclose(fs); return (true); } - -#endif -- cgit v1.2.3