diff --git a/include/config/test.h b/include/config/test.h index 90cf5a4b88..a8e2f4ab11 100644 --- a/include/config/test.h +++ b/include/config/test.h @@ -1131,10 +1131,10 @@ // Vars #undef B_VAR_DIFFICULTY -#define B_VAR_DIFFICULTY VAR_UNUSED_0x404E +#define B_VAR_DIFFICULTY TESTING_VAR_DIFFICULTY // Flags #undef B_FLAG_SLEEP_CLAUSE -#define B_FLAG_SLEEP_CLAUSE FLAG_SPECIAL_FLAG_UNUSED_0x4003 +#define B_FLAG_SLEEP_CLAUSE TESTING_FLAG_SLEEP_CLAUSE #endif // GUARD_CONFIG_TEST_H diff --git a/include/constants/flags.h b/include/constants/flags.h index 8685faca6f..aec9ebbd92 100644 --- a/include/constants/flags.h +++ b/include/constants/flags.h @@ -1660,4 +1660,16 @@ #define FLAG_TEMP_HIDE_FOLLOWER FLAG_TEMP_E #define FLAG_TEMP_HIDE_MIRAGE_ISLAND_BERRY_TREE FLAG_TEMP_11 +#if TESTING +#define TESTING_FLAGS_START 0x5000 +#define TESTING_FLAG_SLEEP_CLAUSE (TESTING_FLAGS_START + 0x0) +#define TESTING_FLAG_UNUSED_1 (TESTING_FLAGS_START + 0x1) +#define TESTING_FLAG_UNUSED_2 (TESTING_FLAGS_START + 0x2) +#define TESTING_FLAG_UNUSED_3 (TESTING_FLAGS_START + 0x3) +#define TESTING_FLAG_UNUSED_4 (TESTING_FLAGS_START + 0x4) +#define TESTING_FLAG_UNUSED_5 (TESTING_FLAGS_START + 0x5) +#define TESTING_FLAG_UNUSED_6 (TESTING_FLAGS_START + 0x6) +#define TESTING_FLAG_UNUSED_7 (TESTING_FLAGS_START + 0x7) +#endif // TESTING + #endif // GUARD_CONSTANTS_FLAGS_H diff --git a/include/constants/vars.h b/include/constants/vars.h index 5ce02c1467..aac52dec0e 100644 --- a/include/constants/vars.h +++ b/include/constants/vars.h @@ -324,4 +324,16 @@ #define VAR_TEMP_TRANSFERRED_SPECIES VAR_TEMP_1 +#if TESTING +#define TESTING_VARS_START 0x9000 +#define TESTING_VAR_DIFFICULTY (TESTING_VARS_START + 0x0) +#define TESTING_VAR_UNUSED_1 (TESTING_VARS_START + 0x1) +#define TESTING_VAR_UNUSED_2 (TESTING_VARS_START + 0x2) +#define TESTING_VAR_UNUSED_3 (TESTING_VARS_START + 0x3) +#define TESTING_VAR_UNUSED_4 (TESTING_VARS_START + 0x4) +#define TESTING_VAR_UNUSED_5 (TESTING_VARS_START + 0x5) +#define TESTING_VAR_UNUSED_6 (TESTING_VARS_START + 0x6) +#define TESTING_VAR_UNUSED_7 (TESTING_VARS_START + 0x7) +#endif // TESTING + #endif // GUARD_CONSTANTS_VARS_H diff --git a/src/event_data.c b/src/event_data.c index ccd0519c51..a8a05598a5 100644 --- a/src/event_data.c +++ b/src/event_data.c @@ -27,6 +27,13 @@ EWRAM_DATA u16 gSpecialVar_MonBoxPos = 0; EWRAM_DATA u16 gSpecialVar_Unused_0x8014 = 0; EWRAM_DATA static u8 sSpecialFlags[SPECIAL_FLAGS_SIZE] = {0}; +#if TESTING +#define TEST_FLAGS_SIZE 1 +#define TEST_VARS_SIZE 8 +EWRAM_DATA static u8 sTestFlags[TEST_FLAGS_SIZE] = {0}; +EWRAM_DATA static u16 sTestVars[TEST_VARS_SIZE] = {0}; +#endif // TESTING + extern u16 *const gSpecialVars[]; const u16 gBadgeFlags[NUM_BADGES] = @@ -179,6 +186,10 @@ u16 *GetVarPointer(u16 id) return NULL; else if (id < SPECIAL_VARS_START) return &gSaveBlock1Ptr->vars[id - VARS_START]; +#if TESTING + else if (id >= TESTING_VARS_START) + return &sTestVars[id - TESTING_VARS_START]; +#endif // TESTING else return gSpecialVars[id - SPECIAL_VARS_START]; } @@ -219,6 +230,10 @@ u8 *GetFlagPointer(u16 id) return NULL; else if (id < SPECIAL_FLAGS_START) return &gSaveBlock1Ptr->flags[id / 8]; +#if TESTING + else if (id >= TESTING_FLAGS_START) + return &sTestFlags[(id - TESTING_FLAGS_START) / 8]; +#endif // TESTING else return &sSpecialFlags[(id - SPECIAL_FLAGS_START) / 8]; }