From dc06321054d6f1fca891d26a2cb736241ac9caaf Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Wed, 14 Aug 2024 19:24:55 -0700 Subject: [PATCH] Moved pokedex flags to constants files andadded constants to header of event_scripts --- asm/macros/event.inc | 8 ++++---- data/event_scripts.s | 1 + include/constants/pokedex.h | 14 ++++++++++++++ include/pokedex.h | 14 -------------- src/field_specials.c | 2 +- 5 files changed, 20 insertions(+), 19 deletions(-) diff --git a/asm/macros/event.inc b/asm/macros/event.inc index 1c5b004bbb..ac008119ef 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -2349,7 +2349,7 @@ @ The result is stored in VAR_RESULT .macro getseenmon species:req setvar VAR_0x8005, \species - setvar VAR_0x8006, 0 + setvar VAR_0x8006, FLAG_GET_SEEN specialvar VAR_RESULT, Script_GetSetPokedexFlag .endm @@ -2357,21 +2357,21 @@ @ The result is stored in VAR_RESULT .macro getcaughtmon species:req setvar VAR_0x8005, \species - setvar VAR_0x8006, 1 + setvar VAR_0x8006, FLAG_GET_CAUGHT specialvar VAR_RESULT, Script_GetSetPokedexFlag .endm @ Sets the Pokédex Seen flag of the specified Pokemon .macro setseenmon species:req setvar VAR_0x8005, \species - setvar VAR_0x8006, 2 + setvar VAR_0x8006, FLAG_SET_SEEN specialvar VAR_RESULT, Script_GetSetPokedexFlag .endm @ Sets the Pokédex Caught flag of the specified Pokemon .macro setcaughtmon species:req setvar VAR_0x8005, \species - setvar VAR_0x8006, 3 + setvar VAR_0x8006, FLAG_SET_CAUGHT specialvar VAR_RESULT, Script_GetSetPokedexFlag .endm diff --git a/data/event_scripts.s b/data/event_scripts.s index d4393ac9d4..8ff14199f6 100644 --- a/data/event_scripts.s +++ b/data/event_scripts.s @@ -42,6 +42,7 @@ #include "constants/metatile_labels.h" #include "constants/moves.h" #include "constants/party_menu.h" +#include "constants/pokedex.h" #include "constants/pokemon.h" #include "constants/roulette.h" #include "constants/script_menu.h" diff --git a/include/constants/pokedex.h b/include/constants/pokedex.h index 8058f01e5c..241198e178 100644 --- a/include/constants/pokedex.h +++ b/include/constants/pokedex.h @@ -1327,4 +1327,18 @@ enum { #define DEX_HGSS_Y_BOTTOM_PADDING 4 #define DEX_HGSS_MEASUREMENT_X_PADDING 51 +enum +{ + DEX_MODE_HOENN, + DEX_MODE_NATIONAL +}; + +enum +{ + FLAG_GET_SEEN, + FLAG_GET_CAUGHT, + FLAG_SET_SEEN, + FLAG_SET_CAUGHT +}; + #endif // GUARD_CONSTANTS_POKEDEX_H diff --git a/include/pokedex.h b/include/pokedex.h index be861fe682..0bd91449c3 100644 --- a/include/pokedex.h +++ b/include/pokedex.h @@ -4,20 +4,6 @@ extern u8 gUnusedPokedexU8; extern void (*gPokedexVBlankCB)(void); -enum -{ - DEX_MODE_HOENN, - DEX_MODE_NATIONAL -}; - -enum -{ - FLAG_GET_SEEN, - FLAG_GET_CAUGHT, - FLAG_SET_SEEN, - FLAG_SET_CAUGHT -}; - void ResetPokedex(void); u16 GetNationalPokedexCount(u8); u16 GetHoennPokedexCount(u8); diff --git a/src/field_specials.c b/src/field_specials.c index e58d861f54..a99a21f6b7 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -30,6 +30,7 @@ #include "overworld.h" #include "party_menu.h" #include "pokeblock.h" +#include "pokedex.h" #include "pokemon.h" #include "pokemon_storage_system.h" #include "random.h" @@ -68,7 +69,6 @@ #include "constants/metatile_labels.h" #include "palette.h" #include "battle_util.h" -#include "pokedex.h" #define TAG_ITEM_ICON 5500