aboutsummaryrefslogtreecommitdiff
path: root/source/cheats.h
diff options
context:
space:
mode:
authorTwinaphex2017-06-18 18:41:06 +0200
committerGitHub2017-06-18 18:41:06 +0200
commit1aecedc999445e9a27e04f665fd562b576775d08 (patch)
treec526c7d332be548a42364eea9113b6d33345b840 /source/cheats.h
parentdc596c886e0ec2728dc353dd7862cdf1e5a5ff44 (diff)
parentbcaf44c511efaad9d803dde9b0fdbb046498c66f (diff)
downloadsnes9x2005-1aecedc999445e9a27e04f665fd562b576775d08.tar.gz
snes9x2005-1aecedc999445e9a27e04f665fd562b576775d08.tar.bz2
snes9x2005-1aecedc999445e9a27e04f665fd562b576775d08.zip
Merge pull request #36 from jamsilva/master
Compatibility fixes.
Diffstat (limited to 'source/cheats.h')
-rw-r--r--source/cheats.h64
1 files changed, 30 insertions, 34 deletions
diff --git a/source/cheats.h b/source/cheats.h
index 6c3c093..42e2b47 100644
--- a/source/cheats.h
+++ b/source/cheats.h
@@ -3,52 +3,50 @@
#ifndef _CHEATS_H_
#define _CHEATS_H_
-#ifdef WANT_CHEATS
-
#define MAX_SFCCHEAT_NAME 48
-#define MAX_CHEATS_T 800
+#define MAX_CHEATS 800
typedef struct
{
- uint32_t address;
- uint8_t byte;
- uint8_t saved_byte;
- bool enabled;
- bool saved;
- char name[MAX_SFCCHEAT_NAME];
+ uint32_t address;
+ uint8_t byte;
+ uint8_t saved_byte;
+ bool enabled;
+ bool saved;
+ char name[MAX_SFCCHEAT_NAME];
} SCheat;
typedef struct
{
- SCheat c [MAX_CHEATS_T];
- uint32_t num_cheats;
- uint8_t CWRAM [0x20000];
- uint8_t CSRAM [0x10000];
- uint8_t CIRAM [0x2000];
- uint8_t* RAM;
- uint8_t* FillRAM;
- uint8_t* SRAM;
- uint32_t WRAM_BITS [0x20000 >> 3];
- uint32_t SRAM_BITS [0x10000 >> 3];
- uint32_t IRAM_BITS [0x2000 >> 3];
+ SCheat c [MAX_CHEATS];
+ uint32_t num_cheats;
+ uint8_t CWRAM [0x20000];
+ uint8_t CSRAM [0x10000];
+ uint8_t CIRAM [0x2000];
+ uint8_t* RAM;
+ uint8_t* FillRAM;
+ uint8_t* SRAM;
+ uint32_t WRAM_BITS [0x20000 >> 3];
+ uint32_t SRAM_BITS [0x10000 >> 3];
+ uint32_t IRAM_BITS [0x2000 >> 3];
} SCheatData;
typedef enum
{
- S9X_LESS_THAN, S9X_GREATER_THAN, S9X_LESS_THAN_OR_EQUAL,
- S9X_GREATER_THAN_OR_EQUAL, S9X_EQUAL, S9X_NOT_EQUAL
+ S9X_LESS_THAN, S9X_GREATER_THAN, S9X_LESS_THAN_OR_EQUAL,
+ S9X_GREATER_THAN_OR_EQUAL, S9X_EQUAL, S9X_NOT_EQUAL
} S9xCheatComparisonType;
typedef enum
{
- S9X_8_BITS, S9X_16_BITS, S9X_24_BITS, S9X_32_BITS
+ S9X_8_BITS, S9X_16_BITS, S9X_24_BITS, S9X_32_BITS
} S9xCheatDataSize;
void S9xInitCheatData();
-const char *S9xGameGenieToRaw(const char *code, uint32_t *address, uint8_t *byte);
-const char *S9xProActionReplayToRaw(const char *code, uint32_t *address, uint8_t *byte);
-const char *S9xGoldFingerToRaw(const char *code, uint32_t *address, bool *sram, uint8_t *num_bytes, uint8_t bytes[3]);
+const char* S9xGameGenieToRaw(const char* code, uint32_t* address, uint8_t* byte);
+const char* S9xProActionReplayToRaw(const char* code, uint32_t* address, uint8_t* byte);
+const char* S9xGoldFingerToRaw(const char* code, uint32_t* address, bool* sram, uint8_t* num_bytes, uint8_t bytes[3]);
void S9xApplyCheats();
void S9xApplyCheat(uint32_t which1);
void S9xRemoveCheats();
@@ -59,14 +57,12 @@ void S9xDisableAllCheat();
void S9xAddCheat(bool enable, bool save_current_value, uint32_t address, uint8_t byte);
void S9xDeleteCheats();
void S9xDeleteCheat(uint32_t which1);
-bool S9xLoadCheatFile(const char *filename);
-bool S9xSaveCheatFile(const char *filename);
-
-void S9xStartCheatSearch(SCheatData *cheats);
-void S9xSearchForChange(SCheatData *cheats, S9xCheatComparisonType cmp, S9xCheatDataSize size, bool is_signed, bool update);
-void S9xSearchForValue(SCheatData *cheats, S9xCheatComparisonType cmp, S9xCheatDataSize size, uint32_t value, bool is_signed, bool update);
-void S9xOutputCheatSearchResults(SCheatData *cheats);
+bool S9xLoadCheatFile(const char* filename);
+bool S9xSaveCheatFile(const char* filename);
-#endif
+void S9xStartCheatSearch(SCheatData* cheats);
+void S9xSearchForChange(SCheatData* cheats, S9xCheatComparisonType cmp, S9xCheatDataSize size, bool is_signed, bool update);
+void S9xSearchForValue(SCheatData* cheats, S9xCheatComparisonType cmp, S9xCheatDataSize size, uint32_t value, bool is_signed, bool update);
+void S9xOutputCheatSearchResults(SCheatData* cheats);
#endif