diff --git a/include/constants/flags.h b/include/constants/flags.h index 6c1400410..a74dffccf 100644 --- a/include/constants/flags.h +++ b/include/constants/flags.h @@ -1570,6 +1570,7 @@ #define FLAG_0x95E (SYSTEM_FLAGS + 0xFE) #define FLAG_0x95F (SYSTEM_FLAGS + 0xFF) +#define SPECIAL_FLAGS_START 0x4000 // SPECIAL FLAGS (unknown purpose) #define FLAG_SPECIAL_FLAG_0x4000 0x4000 #define FLAG_SPECIAL_FLAG_0x4001 0x4001 diff --git a/include/constants/vars.h b/include/constants/vars.h index 7cf232efe..e2c59b4fb 100644 --- a/include/constants/vars.h +++ b/include/constants/vars.h @@ -273,6 +273,7 @@ #define VAR_0x40FE 0x40FE #define VAR_0x40FF 0x40FF +#define SPECIAL_VARS_START 0x8000 // special vars // They are commonly used as parameters to commands, or return values from commands. #define VAR_0x8000 0x8000 diff --git a/src/event_data.c b/src/event_data.c index e42f5d514..2cbe50f13 100644 --- a/src/event_data.c +++ b/src/event_data.c @@ -25,7 +25,7 @@ EWRAM_DATA u16 gSpecialVar_MonBoxPos = 0; EWRAM_DATA u16 gSpecialVar_0x8014 = 0; EWRAM_DATA static u8 gUnknown_020375FC[16] = {0}; -extern u16 * const gSpecialVars[]; +extern u16 *const gSpecialVars[]; extern void sub_80BB358(void); @@ -166,10 +166,10 @@ u16 *GetVarPointer(u16 id) { if (id < VARS_START) return NULL; - else if (id < VAR_0x8000) + else if (id < SPECIAL_VARS_START) return &gSaveBlock1Ptr->vars[id - VARS_START]; else - return gSpecialVars[id - VAR_0x8000]; + return gSpecialVars[id - SPECIAL_VARS_START]; } u16 VarGet(u16 id) @@ -198,10 +198,10 @@ u8 *GetFlagPointer(u16 id) { if (id == 0) return NULL; - else if (id < FLAG_SPECIAL_FLAG_0x4000) + else if (id < SPECIAL_FLAGS_START) return &gSaveBlock1Ptr->flags[id / 8]; else - return &gUnknown_020375FC[(id - FLAG_SPECIAL_FLAG_0x4000) / 8]; + return &gUnknown_020375FC[(id - SPECIAL_FLAGS_START) / 8]; } u8 FlagSet(u16 id)