aboutsummaryrefslogtreecommitdiff
path: root/source/cheats2.c
diff options
context:
space:
mode:
authorJoão Silva2017-06-18 16:16:19 +0100
committerJoão Silva2017-06-18 16:16:19 +0100
commitbcaf44c511efaad9d803dde9b0fdbb046498c66f (patch)
treec526c7d332be548a42364eea9113b6d33345b840 /source/cheats2.c
parent10a58e72aa3f74a821fa9be07ffd3992ffa93600 (diff)
downloadsnes9x2005-bcaf44c511efaad9d803dde9b0fdbb046498c66f.tar.gz
snes9x2005-bcaf44c511efaad9d803dde9b0fdbb046498c66f.tar.bz2
snes9x2005-bcaf44c511efaad9d803dde9b0fdbb046498c66f.zip
Support for savestate versioning. Plenty of cleanups.
Diffstat (limited to 'source/cheats2.c')
-rw-r--r--source/cheats2.c12
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