diff --git a/src/cheat.cpp b/src/cheat.cpp index 8ae0e985..3752f068 100644 --- a/src/cheat.cpp +++ b/src/cheat.cpp @@ -59,7 +59,7 @@ void FCEU_CheatAddRAM(int s, uint32 A, uint8 *p) } -CHEATF_SUBFAST SubCheats[256] = { 0 }; +CHEATF_SUBFAST SubCheats[256]; uint32 numsubcheats = 0; int globalCheatDisabled = 0; int disableAutoLSCheats = 0; diff --git a/src/cheat.h b/src/cheat.h index 3e11e9d3..200a0055 100644 --- a/src/cheat.h +++ b/src/cheat.h @@ -33,12 +33,18 @@ extern int disableAutoLSCheats; int FCEU_DisableAllCheats(void); int FCEU_DeleteAllCheats(void); -typedef struct { +struct CHEATF_SUBFAST +{ uint16 addr; uint8 val; int compare; readfunc PrevRead; -} CHEATF_SUBFAST; + + CHEATF_SUBFAST(void) + { + addr = 0; val = 0; compare = 0; PrevRead = nullptr; + } +}; struct CHEATF { struct CHEATF *next;