2013-09-23 20:48:54 +00:00
|
|
|
void FCEU_CheatResetRAM(void);
|
|
|
|
void FCEU_CheatAddRAM(int s, uint32 A, uint8 *p);
|
|
|
|
|
2019-05-01 19:13:05 +00:00
|
|
|
void FCEU_LoadGameCheats(FILE *override, int override_existing = 1);
|
2013-09-23 20:48:54 +00:00
|
|
|
void FCEU_FlushGameCheats(FILE *override, int nosave);
|
2019-06-12 14:16:01 +00:00
|
|
|
void FCEU_SaveGameCheats(FILE *fp, int release = 0);
|
|
|
|
int FCEUI_GlobalToggleCheat(int global_enabled);
|
2013-09-23 20:48:54 +00:00
|
|
|
void FCEU_ApplyPeriodicCheats(void);
|
|
|
|
void FCEU_PowerCheats(void);
|
2019-04-05 16:41:35 +00:00
|
|
|
int FCEU_CalcCheatAffectedBytes(uint32 address, uint32 size);
|
|
|
|
|
2013-09-23 20:48:54 +00:00
|
|
|
|
|
|
|
int FCEU_CheatGetByte(uint32 A);
|
|
|
|
void FCEU_CheatSetByte(uint32 A, uint8 V);
|
|
|
|
|
2018-12-28 15:43:52 +00:00
|
|
|
extern int savecheats;
|
2019-06-12 14:16:01 +00:00
|
|
|
extern int globalCheatDisabled;
|
|
|
|
extern int disableAutoLSCheats;
|
2018-12-28 15:43:52 +00:00
|
|
|
|
2019-01-09 09:28:05 +00:00
|
|
|
int FCEU_DisableAllCheats();
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
uint16 addr;
|
|
|
|
uint8 val;
|
|
|
|
int compare;
|
|
|
|
readfunc PrevRead;
|
|
|
|
} CHEATF_SUBFAST;
|
|
|
|
|
|
|
|
struct CHEATF {
|
|
|
|
struct CHEATF *next;
|
2019-05-01 19:13:05 +00:00
|
|
|
char *name = "";
|
2019-01-09 09:28:05 +00:00
|
|
|
uint16 addr;
|
|
|
|
uint8 val;
|
|
|
|
int compare; /* -1 for no compare. */
|
|
|
|
int type; /* 0 for replace, 1 for substitute(GG). */
|
|
|
|
int status;
|
2019-04-05 16:41:35 +00:00
|
|
|
};
|
|
|
|
|
2019-05-08 05:55:53 +00:00
|
|
|
struct SEARCHPOSSIBLE {
|
|
|
|
uint16 addr;
|
|
|
|
uint8 previous;
|
|
|
|
uint8 current;
|
|
|
|
bool update;
|
|
|
|
};
|
|
|
|
|
2019-05-01 19:13:05 +00:00
|
|
|
#define FCEU_SEARCH_SPECIFIC_CHANGE 0
|
|
|
|
#define FCEU_SEARCH_RELATIVE_CHANGE 1
|
|
|
|
#define FCEU_SEARCH_PUERLY_RELATIVE_CHANGE 2
|
|
|
|
#define FCEU_SEARCH_ANY_CHANGE 3
|
|
|
|
#define FCEU_SEARCH_NEWVAL_KNOWN 4
|
|
|
|
#define FCEU_SEARCH_NEWVAL_GT 5
|
|
|
|
#define FCEU_SEARCH_NEWVAL_LT 6
|
|
|
|
#define FCEU_SEARCH_NEWVAL_GT_KNOWN 7
|
|
|
|
#define FCEU_SEARCH_NEWVAL_LT_KNOWN 8
|
|
|
|
|
2019-04-05 16:41:35 +00:00
|
|
|
|
|
|
|
#define CalcAddressRangeCheatCount(count, address, size) \
|
|
|
|
count = 0; \
|
|
|
|
for (int i = 0; i < numsubcheats && count < size; ++i) \
|
|
|
|
if (SubCheats[i].addr >= address && SubCheats[i].addr < address + size) \
|
2019-05-01 19:13:05 +00:00
|
|
|
++count
|