diff options
author | Twinaphex | 2017-06-18 18:41:06 +0200 |
---|---|---|
committer | GitHub | 2017-06-18 18:41:06 +0200 |
commit | 1aecedc999445e9a27e04f665fd562b576775d08 (patch) | |
tree | c526c7d332be548a42364eea9113b6d33345b840 /source/cheats2.c | |
parent | dc596c886e0ec2728dc353dd7862cdf1e5a5ff44 (diff) | |
parent | bcaf44c511efaad9d803dde9b0fdbb046498c66f (diff) | |
download | snesemu-1aecedc999445e9a27e04f665fd562b576775d08.tar.gz snesemu-1aecedc999445e9a27e04f665fd562b576775d08.tar.bz2 snesemu-1aecedc999445e9a27e04f665fd562b576775d08.zip |
Merge pull request #36 from jamsilva/master
Compatibility fixes.
Diffstat (limited to 'source/cheats2.c')
-rw-r--r-- | source/cheats2.c | 12 |
1 files changed, 3 insertions, 9 deletions
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 <stdio.h> #include <ctype.h> #include <string.h> @@ -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 |