diff --git a/include/constants/forms.h b/include/constants/forms.h new file mode 100644 index 0000000000..3f823b6c2c --- /dev/null +++ b/include/constants/forms.h @@ -0,0 +1,21 @@ +#ifndef POKEPLATINUM_CONSTANTS_FORMS_H +#define POKEPLATINUM_CONSTANTS_FORMS_H + +#include "species.h" + +#define MOVESET_FORM_DEOXYS_ATTACK NATIONAL_DEX_COUNT + 1 +#define MOVESET_FORM_DEOXYS_DEFENSE NATIONAL_DEX_COUNT + 2 +#define MOVESET_FORM_DEOXYS_SPEED NATIONAL_DEX_COUNT + 3 +#define MOVESET_FORM_WORMADAM_SANDY NATIONAL_DEX_COUNT + 4 +#define MOVESET_FORM_WORMADAM_TRASH NATIONAL_DEX_COUNT + 5 +#define MOVESET_FORM_GIRATINA_ORIGIN NATIONAL_DEX_COUNT + 6 +#define MOVESET_FORM_SHAYMIN_SKY NATIONAL_DEX_COUNT + 7 +#define MOVESET_FORM_ROTOM_HEAT NATIONAL_DEX_COUNT + 8 +#define MOVESET_FORM_ROTOM_WASH NATIONAL_DEX_COUNT + 9 +#define MOVESET_FORM_ROTOM_FROST NATIONAL_DEX_COUNT + 10 +#define MOVESET_FORM_ROTOM_FAN NATIONAL_DEX_COUNT + 11 +#define MOVESET_FORM_ROTOM_MOW NATIONAL_DEX_COUNT + 12 + +#define MOVESET_MAX MOVESET_FORM_ROTOM_MOW + +#endif \ No newline at end of file diff --git a/include/constants/species.h b/include/constants/species.h index f7771a1d4e..d7c1102870 100644 --- a/include/constants/species.h +++ b/include/constants/species.h @@ -14,4 +14,6 @@ #define MAX_SPECIES SPECIES_BAD_EGG +#define LOCAL_DEX_COUNT 210 + #endif // POKEPLATINUM_CONSTANTS_SPECIES_H diff --git a/include/overlay006/battle_params.h b/include/overlay006/battle_params.h index bd104f67d2..53824f71f0 100644 --- a/include/overlay006/battle_params.h +++ b/include/overlay006/battle_params.h @@ -2,7 +2,7 @@ #define POKEPLATINUM_BATTLE_PARAMS_H #include "trainer_info.h" -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "struct_defs/struct_020279FC.h" #include "struct_decls/struct_02027F8C_decl.h" #include "struct_decls/struct_0202B628_decl.h" @@ -29,7 +29,7 @@ typedef struct { TrainerInfo * unk_D0[4]; UnkStruct_0207D3C0 * unk_E0; UnkStruct_0207D99C * unk_E4; - UnkStruct_02026324 * unk_E8; + PokedexData * unk_E8; PCBoxes * unk_EC; ChatotCry * unk_F0[4]; UnkStruct_02056B24 * unk_100; diff --git a/include/overlay016/ov16_0223DF00.h b/include/overlay016/ov16_0223DF00.h index 621e383226..d92c53e861 100644 --- a/include/overlay016/ov16_0223DF00.h +++ b/include/overlay016/ov16_0223DF00.h @@ -16,7 +16,7 @@ #include "struct_decls/struct_02018340_decl.h" #include "strbuf.h" #include "trainer_info.h" -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "struct_defs/struct_020279FC.h" #include "struct_defs/chatot_cry.h" #include "struct_defs/struct_0205AA50.h" @@ -101,7 +101,7 @@ UnkStruct_0200C440 * ov16_0223E054(BattleSystem * param0); MessageLoader * BattleSystem_MessageLoader(BattleSystem * param0); MessageLoader * ov16_0223E060(BattleSystem * param0); PaletteData * BattleSystem_PaletteSys(BattleSystem * param0); -UnkStruct_02026324 * ov16_0223E068(BattleSystem * param0); +PokedexData * ov16_0223E068(BattleSystem * param0); u8 * ov16_0223E06C(BattleSystem * param0); u8 * ov16_0223E074(BattleSystem * param0); u16 * ov16_0223E080(BattleSystem * param0); diff --git a/include/overlay021/struct_ov21_021D0D80.h b/include/overlay021/struct_ov21_021D0D80.h index 5c98263a4d..71b5560538 100644 --- a/include/overlay021/struct_ov21_021D0D80.h +++ b/include/overlay021/struct_ov21_021D0D80.h @@ -2,11 +2,11 @@ #define POKEPLATINUM_STRUCT_OV21_021D0D80_H #include "trainer_info.h" -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "struct_decls/struct_0209ACBC_decl.h" typedef struct { - const UnkStruct_02026324 * unk_00; + const PokedexData * unk_00; const TrainerInfo * unk_04; int unk_08; BOOL unk_0C; diff --git a/include/overlay021/struct_ov21_021D0D80_1.h b/include/overlay021/struct_ov21_021D0D80_1.h index d64662335f..ee8d99c35f 100644 --- a/include/overlay021/struct_ov21_021D0D80_1.h +++ b/include/overlay021/struct_ov21_021D0D80_1.h @@ -2,11 +2,11 @@ #define POKEPLATINUM_STRUCT_OV21_021D0D80_1_H #include "trainer_info.h" -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "struct_decls/struct_0209ACBC_decl.h" typedef struct { - const UnkStruct_02026324 * unk_00; + const PokedexData * unk_00; const TrainerInfo * unk_04; int unk_08; BOOL unk_0C; diff --git a/include/overlay021/struct_ov21_021D3208.h b/include/overlay021/struct_ov21_021D3208.h index 96de13e1d6..aae9cc2698 100644 --- a/include/overlay021/struct_ov21_021D3208.h +++ b/include/overlay021/struct_ov21_021D3208.h @@ -2,10 +2,10 @@ #define POKEPLATINUM_STRUCT_OV21_021D3208_H #include "trainer_info.h" -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" typedef struct { - const UnkStruct_02026324 * unk_00; + const PokedexData * unk_00; const TrainerInfo * unk_04; int unk_08; BOOL unk_0C; diff --git a/include/overlay021/struct_ov21_021D3320.h b/include/overlay021/struct_ov21_021D3320.h index 76732d8f9b..9111897da9 100644 --- a/include/overlay021/struct_ov21_021D3320.h +++ b/include/overlay021/struct_ov21_021D3320.h @@ -2,12 +2,12 @@ #define POKEPLATINUM_STRUCT_OV21_021D3320_H #include "strbuf.h" -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "struct_decls/struct_02098700_decl.h" #include "overlay021/struct_ov21_021D3A60.h" typedef struct { - const UnkStruct_02026324 * unk_00; + const PokedexData * unk_00; UnkStruct_ov21_021D3A60 unk_04; int unk_1730; BOOL unk_1734; diff --git a/include/overlay021/struct_ov21_021D3A60.h b/include/overlay021/struct_ov21_021D3A60.h index fb8f19ef53..7baa9d24de 100644 --- a/include/overlay021/struct_ov21_021D3A60.h +++ b/include/overlay021/struct_ov21_021D3A60.h @@ -2,12 +2,13 @@ #define POKEPLATINUM_STRUCT_OV21_021D3A60_H #include "overlay021/struct_ov21_021D37DC.h" +#include "constants/species.h" typedef struct { - UnkStruct_ov21_021D37DC unk_00[493]; + UnkStruct_ov21_021D37DC unk_00[NATIONAL_DEX_COUNT]; int unk_F68; int unk_F6C; - int unk_F70[493]; + int unk_F70[NATIONAL_DEX_COUNT]; int unk_1724; int unk_1728; } UnkStruct_ov21_021D3A60; diff --git a/include/overlay088/struct_ov88_0223C370.h b/include/overlay088/struct_ov88_0223C370.h index 647a58dc31..56d8dfa5c6 100644 --- a/include/overlay088/struct_ov88_0223C370.h +++ b/include/overlay088/struct_ov88_0223C370.h @@ -2,7 +2,7 @@ #define POKEPLATINUM_STRUCT_OV88_0223C370_H #include "trainer_info.h" -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "struct_defs/struct_020279FC.h" #include "struct_decls/struct_02027F8C_decl.h" #include "struct_decls/struct_0202B628_decl.h" @@ -23,7 +23,7 @@ typedef struct { AnimationControlFlags * unk_18; UnkStruct_0202B628 * unk_1C; UnkStruct_0202CD88 * unk_20; - UnkStruct_02026324 * unk_24; + PokedexData * unk_24; int unk_28; int unk_2C; int unk_30; diff --git a/include/overlay094/ov94_022414B8.h b/include/overlay094/ov94_022414B8.h index 113bb97b24..d9b2decdd7 100644 --- a/include/overlay094/ov94_022414B8.h +++ b/include/overlay094/ov94_022414B8.h @@ -5,7 +5,7 @@ #include "message.h" #include "struct_decls/struct_0200B358_decl.h" #include "struct_decls/struct_02013A04_decl.h" -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "struct_defs/struct_0205AA50.h" #include "overlay094/struct_ov94_0223BA88.h" #include "overlay094/struct_ov94_0223BA88_sub3.h" @@ -28,7 +28,7 @@ u16 * ov94_02242524(int param0, int param1, int * param2); u8 * ov94_02242548(int param0); void ov94_022425A8(UnkStruct_ov94_0223BA88 * param0, UnkStruct_ov94_0223FD4C * param1); UnkStruct_0200112C * ov94_022426A8(UnkStruct_ov94_0223FD4C * param0, ResourceMetadata ** param1, Window * param2, MessageLoader * param3); -UnkStruct_0200112C * ov94_022427C0(UnkStruct_ov94_0223FD4C * param0, ResourceMetadata ** param1, Window * param2, MessageLoader * param3, MessageLoader * param4, UnkStruct_ov94_0223FD4C_sub3 * param5, UnkStruct_02026324 * param6); +UnkStruct_0200112C * ov94_022427C0(UnkStruct_ov94_0223FD4C * param0, ResourceMetadata ** param1, Window * param2, MessageLoader * param3, MessageLoader * param4, UnkStruct_ov94_0223FD4C_sub3 * param5, PokedexData * param6); UnkStruct_0200112C * ov94_02242840(ResourceMetadata ** param0, Window * param1, MessageLoader * param2); UnkStruct_0200112C * ov94_022428B0(ResourceMetadata ** param0, Window * param1, MessageLoader * param2, int param3); void ov94_02242934(UnkStruct_ov94_0223BA88_sub3 * param0, int param1, int param2); diff --git a/include/struct_decls/pokedexdata_decl.h b/include/struct_decls/pokedexdata_decl.h new file mode 100644 index 0000000000..22106827ae --- /dev/null +++ b/include/struct_decls/pokedexdata_decl.h @@ -0,0 +1,6 @@ +#ifndef POKEPLATINUM_POKEDEXDATA_DECL_H +#define POKEPLATINUM_POKEDEXDATA_DECL_H + +typedef struct PokedexData PokedexData; + +#endif // POKEPLATINUM_POKEDEXDATA_DECL_H diff --git a/include/struct_decls/struct_02026324_decl.h b/include/struct_decls/struct_02026324_decl.h deleted file mode 100644 index 01df9e08c5..0000000000 --- a/include/struct_decls/struct_02026324_decl.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef POKEPLATINUM_STRUCT_02026324_DECL_H -#define POKEPLATINUM_STRUCT_02026324_DECL_H - -typedef struct UnkStruct_02026324_t UnkStruct_02026324; - -#endif // POKEPLATINUM_STRUCT_02026324_DECL_H diff --git a/include/struct_defs/battle_system.h b/include/struct_defs/battle_system.h index f07a41afba..2be3f4cf95 100644 --- a/include/struct_defs/battle_system.h +++ b/include/struct_defs/battle_system.h @@ -16,7 +16,7 @@ #include "struct_decls/sys_task.h" #include "strbuf.h" #include "trainer_info.h" -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "struct_defs/struct_020279FC.h" #include "struct_decls/struct_02027F8C_decl.h" #include "struct_defs/chatot_cry.h" @@ -62,7 +62,7 @@ struct BattleSystem { TrainerInfo *trainerInfo[4]; UnkStruct_0207D3C0 * unk_58; UnkStruct_0207D99C * unk_5C; - UnkStruct_02026324 *pokedex; + PokedexData *pokedex; PCBoxes *pcBoxes; Party *parties[4]; ChatotCry * unk_78[4]; diff --git a/include/struct_defs/struct_0203E0FC.h b/include/struct_defs/struct_0203E0FC.h index c72076bec0..077b521197 100644 --- a/include/struct_defs/struct_0203E0FC.h +++ b/include/struct_defs/struct_0203E0FC.h @@ -3,7 +3,7 @@ #include "struct_decls/struct_02025CCC_decl.h" #include "trainer_info.h" -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "struct_defs/struct_020279FC.h" #include "struct_decls/struct_0202B370_decl.h" #include "struct_decls/struct_0202B628_decl.h" @@ -20,7 +20,7 @@ typedef struct { UnkStruct_02025CCC * unk_04; Party * unk_08; PCBoxes * unk_0C; - UnkStruct_02026324 * unk_10; + PokedexData * unk_10; UnkStruct_0202B370 * unk_14; UnkStruct_0202C878 * unk_18; TrainerInfo * unk_1C; diff --git a/include/struct_defs/struct_0203E274.h b/include/struct_defs/struct_0203E274.h index f3af2d92e9..ce9d8ae8fb 100644 --- a/include/struct_defs/struct_0203E274.h +++ b/include/struct_defs/struct_0203E274.h @@ -1,12 +1,12 @@ #ifndef POKEPLATINUM_STRUCT_0203E274_H #define POKEPLATINUM_STRUCT_0203E274_H -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" typedef struct { int unk_00; BOOL unk_04; - const UnkStruct_02026324 * unk_08; + const PokedexData * unk_08; } UnkStruct_0203E274; #endif // POKEPLATINUM_STRUCT_0203E274_H diff --git a/include/struct_defs/struct_0207AE68_t.h b/include/struct_defs/struct_0207AE68_t.h index d8830268ab..8bc38e4949 100644 --- a/include/struct_defs/struct_0207AE68_t.h +++ b/include/struct_defs/struct_0207AE68_t.h @@ -11,7 +11,7 @@ #include "struct_decls/pokemon_animation_sys_decl.h" #include "struct_decls/struct_02018340_decl.h" #include "strbuf.h" -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "struct_defs/struct_020279FC.h" #include "struct_decls/struct_0202CD88_decl.h" #include "struct_decls/struct_02056B24_decl.h" @@ -41,7 +41,7 @@ struct UnkStruct_0207AE68_t { UnkStruct_02098D38 * unk_3C; void * unk_40; PokemonAnimationSys * unk_44; - UnkStruct_02026324 * unk_48; + PokedexData * unk_48; UnkStruct_0207D3C0 * unk_4C; UnkStruct_0202CD88 * unk_50; UnkStruct_02056B24 * unk_54; diff --git a/include/unk_02002F38.h b/include/unk_02002F38.h index 8ee9840720..3615c27eb4 100644 --- a/include/unk_02002F38.h +++ b/include/unk_02002F38.h @@ -9,8 +9,8 @@ void sub_02002F5C(PaletteData * param0, int param1, void * param2, void * param3 void sub_02002F70(PaletteData * param0, int param1, u32 param2, u32 param3); void sub_02002FA0(PaletteData * param0, int param1); void sub_02002FBC(PaletteData * param0, const void * param1, int param2, u16 param3, u16 param4); -void sub_02002FEC(PaletteData * param0, u32 param1, u32 param2, u32 param3, int param4, u32 param5, u16 param6, u16 param7); -void PaletteSys_LoadPalette(PaletteData * param0, u32 param1, u32 param2, u32 param3, int param4, u32 param5, u16 param6); +void sub_02002FEC(PaletteData * param0, u32 bankID, u32 memberIndex, u32 param3, int param4, u32 param5, u16 param6, u16 param7); +void PaletteSys_LoadPalette(PaletteData * param0, u32 bankID, u32 memberIndex, u32 param3, int param4, u32 param5, u16 param6); void sub_02003070(PaletteData * param0, int param1, u16 param2, u32 param3); void sub_020030E4(u32 param0, u32 param1, u32 param2, u32 param3, u16 param4, void * param5); void sub_02003120(PaletteData * param0, int param1, u16 param2, int param3, u16 param4, u16 param5); diff --git a/include/unk_02006E3C.h b/include/unk_02006E3C.h index f149f01da0..85a1749a68 100644 --- a/include/unk_02006E3C.h +++ b/include/unk_02006E3C.h @@ -16,7 +16,7 @@ u32 sub_02006F00(u32 param0, u32 param1, BOOL param2, int param3, u32 param4, NN void sub_02006F28(u32 param0, u32 param1, BOOL param2, int param3, u32 param4, NNS_G2D_VRAM_TYPE param5, u32 param6, u32 param7, NNSG2dImageProxy * param8); void * sub_02006F50(u32 param0, u32 param1, BOOL param2, NNSG2dCharacterData ** param3, u32 param4); void * sub_02006F6C(u32 param0, u32 param1, BOOL param2, NNSG2dScreenData ** param3, u32 param4); -void * sub_02006F88(u32 param0, u32 param1, NNSG2dPaletteData ** param2, u32 param3); +void * sub_02006F88(u32 bankID, u32 memberIndex, NNSG2dPaletteData ** param2, u32 param3); void * sub_02006FA0(u32 param0, u32 param1, BOOL param2, NNSG2dCellDataBank ** param3, u32 param4); void * sub_02006FBC(u32 param0, u32 param1, BOOL param2, NNSG2dAnimBankData ** param3, u32 param4); void * sub_02006FD8(u32 param0, u32 param1, u32 param2); diff --git a/include/unk_0202631C.h b/include/unk_0202631C.h index cd8fe99043..cd80c4e07c 100644 --- a/include/unk_0202631C.h +++ b/include/unk_0202631C.h @@ -1,52 +1,52 @@ #ifndef POKEPLATINUM_UNK_0202631C_H #define POKEPLATINUM_UNK_0202631C_H -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "pokemon.h" #include "struct_decls/struct_021C0794_decl.h" int Pokedex_SaveSize(void); -UnkStruct_02026324 * sub_02026324(u32 param0); -void sub_02026338(const UnkStruct_02026324 * param0, UnkStruct_02026324 * param1); -void Pokedex_Init(UnkStruct_02026324 * param0); -u16 sub_02026DD0(const UnkStruct_02026324 * param0); -u16 sub_02026E0C(const UnkStruct_02026324 * param0); -u16 sub_02026E48(const UnkStruct_02026324 * param0); -u16 sub_02026E64(const UnkStruct_02026324 * param0); -u16 sub_02026EAC(const UnkStruct_02026324 * param0); -BOOL sub_02026EF4(const UnkStruct_02026324 * param0); -BOOL sub_02026F0C(const UnkStruct_02026324 * param0); -u16 sub_02026F20(const UnkStruct_02026324 * param0); -u16 sub_02026F58(const UnkStruct_02026324 * param0); -BOOL Pokedex_CaughtSpecies(const UnkStruct_02026324 * param0, u16 param1); -BOOL sub_02026FE8(const UnkStruct_02026324 * param0, u16 param1); -u32 sub_0202702C(const UnkStruct_02026324 * param0, u8 param1); -u32 sub_02027058(const UnkStruct_02026324 * param0, u16 param1, int param2); -u32 sub_020270AC(const UnkStruct_02026324 * param0, int param1); -u32 sub_020270DC(const UnkStruct_02026324 * param0); -u32 sub_020270F8(const UnkStruct_02026324 * param0, int param1); -u32 sub_02027130(const UnkStruct_02026324 * param0); -u32 sub_02027154(const UnkStruct_02026324 * param0, int param1); -u32 sub_0202718C(const UnkStruct_02026324 * param0); -u32 sub_020271B0(const UnkStruct_02026324 * param0, int param1); -u32 sub_020271E8(const UnkStruct_02026324 * param0); -u32 sub_02027208(const UnkStruct_02026324 * param0, int param1); -u32 sub_02027240(const UnkStruct_02026324 * param0); -u32 sub_02027264(const UnkStruct_02026324 * param0, int param1); -u32 sub_02027288(const UnkStruct_02026324 * param0); -void sub_020272A4(UnkStruct_02026324 * param0, Pokemon * param1); -void sub_0202736C(UnkStruct_02026324 * param0, Pokemon * param1); -void sub_02027454(UnkStruct_02026324 * param0); -BOOL sub_02027474(const UnkStruct_02026324 * param0); -BOOL sub_02027494(const UnkStruct_02026324 * param0); -void sub_020274B0(UnkStruct_02026324 * param0); -BOOL sub_020274D0(const UnkStruct_02026324 * param0, u16 param1, u32 param2); -void sub_02027508(UnkStruct_02026324 * param0); -BOOL sub_02027514(const UnkStruct_02026324 * param0); -BOOL sub_02027520(const UnkStruct_02026324 * param0); -void sub_02027540(UnkStruct_02026324 * param0); -UnkStruct_02026324 * sub_02027560(SaveData * param0); -u32 sub_0202756C(const UnkStruct_02026324 * param0, int param1, int param2); -u32 sub_020276C8(const UnkStruct_02026324 * param0, int param1); +PokedexData * sub_02026324(u32 param0); +void sub_02026338(const PokedexData * param0, PokedexData * param1); +void Pokedex_Init(PokedexData * param0); +u16 sub_02026DD0(const PokedexData * param0); +u16 sub_02026E0C(const PokedexData * param0); +u16 sub_02026E48(const PokedexData * param0); +u16 sub_02026E64(const PokedexData * param0); +u16 sub_02026EAC(const PokedexData * param0); +BOOL sub_02026EF4(const PokedexData * param0); +BOOL sub_02026F0C(const PokedexData * param0); +u16 sub_02026F20(const PokedexData * param0); +u16 sub_02026F58(const PokedexData * param0); +BOOL Pokedex_CaughtSpecies(const PokedexData * param0, u16 param1); +BOOL sub_02026FE8(const PokedexData * param0, u16 param1); +u32 sub_0202702C(const PokedexData * param0, u8 param1); +u32 sub_02027058(const PokedexData * param0, u16 param1, int param2); +u32 sub_020270AC(const PokedexData * param0, int param1); +u32 sub_020270DC(const PokedexData * param0); +u32 sub_020270F8(const PokedexData * param0, int param1); +u32 sub_02027130(const PokedexData * param0); +u32 sub_02027154(const PokedexData * param0, int param1); +u32 sub_0202718C(const PokedexData * param0); +u32 sub_020271B0(const PokedexData * param0, int param1); +u32 sub_020271E8(const PokedexData * param0); +u32 sub_02027208(const PokedexData * param0, int param1); +u32 sub_02027240(const PokedexData * param0); +u32 sub_02027264(const PokedexData * param0, int param1); +u32 sub_02027288(const PokedexData * param0); +void sub_020272A4(PokedexData * param0, Pokemon * param1); +void sub_0202736C(PokedexData * param0, Pokemon * param1); +void sub_02027454(PokedexData * param0); +BOOL sub_02027474(const PokedexData * param0); +BOOL sub_02027494(const PokedexData * param0); +void sub_020274B0(PokedexData * param0); +BOOL sub_020274D0(const PokedexData * param0, u16 param1, u32 param2); +void sub_02027508(PokedexData * param0); +BOOL sub_02027514(const PokedexData * param0); +BOOL sub_02027520(const PokedexData * param0); +void sub_02027540(PokedexData * param0); +PokedexData * sub_02027560(SaveData * param0); +u32 sub_0202756C(const PokedexData * param0, int param1, int param2); +u32 sub_020276C8(const PokedexData * param0, int param1); #endif // POKEPLATINUM_UNK_0202631C_H diff --git a/include/unk_0202CD50.h b/include/unk_0202CD50.h index e8a09087ea..db4c3fd5cb 100644 --- a/include/unk_0202CD50.h +++ b/include/unk_0202CD50.h @@ -1,7 +1,7 @@ #ifndef POKEPLATINUM_UNK_0202CD50_H #define POKEPLATINUM_UNK_0202CD50_H -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "struct_decls/struct_0202CD88_decl.h" #include "struct_decls/struct_021C0794_decl.h" @@ -15,6 +15,6 @@ u32 sub_0202CF70(UnkStruct_0202CD88 * param0, int param1, u32 param2); u32 sub_0202CFB8(UnkStruct_0202CD88 * param0, int param1); void sub_0202CFEC(UnkStruct_0202CD88 * param0, int param1); u32 sub_0202D034(UnkStruct_0202CD88 * param0); -void sub_0202D040(UnkStruct_0202CD88 * param0, const UnkStruct_02026324 * param1, u16 const param2); +void sub_0202D040(UnkStruct_0202CD88 * param0, const PokedexData * param1, u16 const param2); #endif // POKEPLATINUM_UNK_0202CD50_H diff --git a/include/unk_0207A274.h b/include/unk_0207A274.h index 8df3807893..47cadae610 100644 --- a/include/unk_0207A274.h +++ b/include/unk_0207A274.h @@ -1,11 +1,11 @@ #ifndef POKEPLATINUM_UNK_0207A274_H #define POKEPLATINUM_UNK_0207A274_H -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "struct_decls/struct_021C0794_decl.h" u32 sub_0207A274(SaveData * param0); -u32 sub_0207A280(const UnkStruct_02026324 * param0); +u32 sub_0207A280(const PokedexData * param0); u32 sub_0207A294(u32 param0, u32 param1); #endif // POKEPLATINUM_UNK_0207A274_H diff --git a/include/unk_0207AE68.h b/include/unk_0207AE68.h index efa3ef7e42..9c086e1c94 100644 --- a/include/unk_0207AE68.h +++ b/include/unk_0207AE68.h @@ -1,7 +1,7 @@ #ifndef POKEPLATINUM_UNK_0207AE68_H #define POKEPLATINUM_UNK_0207AE68_H -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "struct_defs/struct_020279FC.h" #include "struct_decls/struct_0202CD88_decl.h" #include "struct_decls/struct_02056B24_decl.h" @@ -10,7 +10,7 @@ #include "struct_decls/struct_0207AE68_decl.h" #include "struct_decls/struct_0207D3C0_decl.h" -UnkStruct_0207AE68 * sub_0207AE68(Party * param0, Pokemon * param1, int param2, AnimationControlFlags * param3, int param4, UnkStruct_02026324 * param5, UnkStruct_0207D3C0 * param6, UnkStruct_0202CD88 * param7, UnkStruct_02056B24 * param8, int param9, int param10, int param11); +UnkStruct_0207AE68 * sub_0207AE68(Party * param0, Pokemon * param1, int param2, AnimationControlFlags * param3, int param4, PokedexData * param5, UnkStruct_0207D3C0 * param6, UnkStruct_0202CD88 * param7, UnkStruct_02056B24 * param8, int param9, int param10, int param11); BOOL sub_0207B0D0(UnkStruct_0207AE68 * param0); void sub_0207B0E0(UnkStruct_0207AE68 * param0); diff --git a/include/unk_0209747C.h b/include/unk_0209747C.h index a2dfa7cb7d..8df119d1e6 100644 --- a/include/unk_0209747C.h +++ b/include/unk_0209747C.h @@ -3,7 +3,7 @@ #include "struct_defs/sentence.h" #include "struct_decls/struct_02014EC4_decl.h" -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "struct_decls/struct_0209747C_decl.h" #include "struct_decls/struct_021C0794_decl.h" @@ -22,7 +22,7 @@ void sub_02097540(const UnkStruct_0209747C * param0, Sentence * param1); u32 sub_02097550(const UnkStruct_0209747C * param0); u32 sub_02097554(const UnkStruct_0209747C * param0); int sub_02097558(const UnkStruct_0209747C * param0); -const UnkStruct_02026324 * sub_0209755C(const UnkStruct_0209747C * param0); +const PokedexData * sub_0209755C(const UnkStruct_0209747C * param0); const UnkStruct_02014EC4 * sub_02097560(const UnkStruct_0209747C * param0); BOOL sub_02097564(const UnkStruct_0209747C * param0); BOOL sub_02097568(const UnkStruct_0209747C * param0); diff --git a/src/overlay005/ov5_021E1D20.c b/src/overlay005/ov5_021E1D20.c index 56691fe65c..697072c600 100644 --- a/src/overlay005/ov5_021E1D20.c +++ b/src/overlay005/ov5_021E1D20.c @@ -7,7 +7,7 @@ #include "strbuf.h" #include "struct_decls/struct_02025E5C_decl.h" #include "trainer_info.h" -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "struct_decls/struct_021C0794_decl.h" #include "overlay005/struct_ov5_021E1FF4_decl.h" @@ -77,7 +77,7 @@ static void ov5_021E1D20 (UnkStruct_ov5_021E1D20 * param0, const UnkStruct_0203C { SaveData * v0 = param1->unk_0C; UnkStruct_02049FA8 * v1 = sub_0203A720(sub_0203A790(v0)); - UnkStruct_02026324 * v2 = sub_02027560(v0); + PokedexData * v2 = sub_02027560(v0); param0->unk_04 = sub_0203A138(v1->unk_00); diff --git a/src/overlay005/ov5_021E622C.c b/src/overlay005/ov5_021E622C.c index 7e31e64383..901c1a4e6c 100644 --- a/src/overlay005/ov5_021E622C.c +++ b/src/overlay005/ov5_021E622C.c @@ -28,6 +28,7 @@ #include "unk_0202CC64.h" #include "unk_0202CD50.h" #include "unk_020559DC.h" +#include "constants/species.h" #include "pokemon.h" #include "party.h" #include "item.h" @@ -2620,7 +2621,7 @@ void ov5_021E6CF0 (Pokemon * param0, u16 param1, u8 param2, TrainerInfo * param3 v2 = 1; Pokemon_SetValue(param0, 76, &v2); - v5 = sub_0200B32C(494, 4); + v5 = sub_0200B32C(SPECIES_EGG, 4); Pokemon_SetValue(param0, 119, v5); Strbuf_Free(v5); @@ -2674,7 +2675,7 @@ void ov5_021E6DE8 (Pokemon * param0, u16 param1, UnkStruct_02026310 * param2, u3 Pokemon_SetValue(param0, 156, &v0); Pokemon_SetValue(param0, 112, ¶m4); - v3 = sub_0200B32C(494, 4); + v3 = sub_0200B32C(SPECIES_EGG, 4); Pokemon_SetValue(param0, 119, v3); Strbuf_Free(v3); diff --git a/src/overlay005/ov5_021F0E84.c b/src/overlay005/ov5_021F0E84.c index 9f2b598bb0..67ed231abf 100644 --- a/src/overlay005/ov5_021F0E84.c +++ b/src/overlay005/ov5_021F0E84.c @@ -3,13 +3,14 @@ #include #include "overlay005/ov5_021F0E84.h" +#include "constants/species.h" typedef struct { u16 unk_00; u16 unk_02; } UnkStruct_ov5_021FFA54; -static const UnkStruct_ov5_021FFA54 Unk_ov5_021FFA54[494] = { +static const UnkStruct_ov5_021FFA54 Unk_ov5_021FFA54[NATIONAL_DEX_COUNT + 1] = { {0x0, 0x0}, {0x1, 0x1}, {0x1, 0x1}, diff --git a/src/overlay005/ov5_021F77A8.c b/src/overlay005/ov5_021F77A8.c index 240f053389..905f44c9bb 100644 --- a/src/overlay005/ov5_021F77A8.c +++ b/src/overlay005/ov5_021F77A8.c @@ -35,6 +35,8 @@ #include "unk_0203E724.h" #include "unk_0203E880.h" #include "unk_02054884.h" +#include "constants/species.h" +#include "constants/forms.h" #include "pokemon.h" #include "party.h" #include "unk_0207D3B8.h" @@ -42,525 +44,571 @@ #include "overlay005/ov5_021F77A8.h" typedef struct { - u8 unk_00[5]; -} UnkStruct_ov5_02200EAC; - -const UnkStruct_ov5_02200EAC Unk_ov5_02200EAC[] = { - { 0x6, 0x20, 0x10, 0x8, 0x4 }, - { 0x6, 0x20, 0x10, 0x8, 0x4 }, - { 0x6, 0x20, 0x14, 0x8, 0x4 }, - { 0x66, 0x20, 0x0, 0x0, 0x12 }, - { 0x66, 0x20, 0x0, 0x0, 0x12 }, - { 0x66, 0xA8, 0x4, 0x4, 0x12 }, - { 0x1B, 0x25, 0x40, 0x10, 0x0 }, - { 0x1B, 0x25, 0x40, 0x10, 0x0 }, - { 0x1B, 0x25, 0x64, 0x10, 0x0 }, - { 0x0, 0x20, 0x0, 0x0, 0x0 }, - { 0x0, 0x0, 0x0, 0x10, 0x0 }, - { 0x0, 0xA8, 0x20, 0x4, 0x10 }, - { 0x0, 0x0, 0x0, 0x0, 0x0 }, - { 0x0, 0x0, 0x0, 0x10, 0x0 }, - { 0x4, 0xA8, 0x2, 0x0, 0x14 }, - { 0x2, 0xA8, 0x0, 0x4, 0x32 }, - { 0x2, 0xA8, 0x0, 0x4, 0x32 }, - { 0x2, 0xA8, 0x0, 0x4, 0x32 }, - { 0xA, 0x20, 0x42, 0x40, 0x18 }, - { 0xA, 0x20, 0x42, 0x40, 0x18 }, - { 0x2, 0xA8, 0x0, 0x4, 0x12 }, - { 0x2, 0xA8, 0x0, 0x4, 0x12 }, - { 0x0, 0x74, 0x0, 0xA, 0x0 }, - { 0x0, 0x74, 0x0, 0xA, 0x0 }, - { 0x32, 0x20, 0x21, 0x20, 0x14 }, - { 0x32, 0x20, 0x21, 0x20, 0x14 }, - { 0x16, 0x20, 0x0, 0x1, 0x14 }, - { 0x16, 0x20, 0x0, 0x1, 0x14 }, - { 0x2, 0x20, 0x1, 0x0, 0x0 }, - { 0x2, 0x20, 0x1, 0x0, 0x0 }, - { 0xEE, 0x25, 0x5, 0x1, 0x20 }, - { 0x2, 0x20, 0x1, 0x0, 0x8 }, - { 0x2, 0x20, 0x1, 0x0, 0x8 }, - { 0xEE, 0x25, 0x5, 0x1, 0x28 }, - { 0x7A, 0x21, 0x63, 0xC0, 0x5 }, - { 0x7A, 0x21, 0x63, 0xC0, 0x5 }, - { 0x0, 0x68, 0x40, 0x0, 0x12 }, - { 0x0, 0x68, 0x40, 0x0, 0x12 }, - { 0x7A, 0x21, 0x3, 0xC0, 0x4 }, - { 0x7A, 0x21, 0x3, 0xC0, 0x4 }, - { 0x0, 0xA8, 0x40, 0x4, 0x32 }, - { 0x0, 0xA8, 0x40, 0x4, 0x32 }, - { 0x0, 0x30, 0x10, 0x8, 0x0 }, - { 0x0, 0x30, 0x10, 0x8, 0x0 }, - { 0x0, 0x30, 0x10, 0x8, 0x0 }, - { 0x4, 0x20, 0x10, 0x8, 0x4 }, - { 0x4, 0x20, 0x10, 0x8, 0x4 }, - { 0x0, 0x20, 0x60, 0x0, 0x10 }, - { 0x0, 0xA8, 0x60, 0x4, 0x10 }, - { 0x2, 0x20, 0x0, 0x1, 0x8 }, - { 0x2, 0x20, 0x0, 0x1, 0x8 }, - { 0xA, 0x60, 0x0, 0x4A, 0x34 }, - { 0xA, 0x60, 0x0, 0x4A, 0x34 }, - { 0xB, 0x25, 0x60, 0x0, 0x10 }, - { 0xF, 0x25, 0x60, 0x0, 0x10 }, - { 0x62, 0x41, 0x87, 0xA, 0x30 }, - { 0x62, 0x41, 0x87, 0xA, 0x30 }, - { 0x2, 0x20, 0x1, 0x0, 0x12 }, - { 0x2, 0x22, 0x1, 0x0, 0x12 }, - { 0x9, 0x20, 0x1, 0x0, 0x0 }, - { 0xB, 0x21, 0x1, 0x0, 0x0 }, - { 0xB, 0x21, 0x81, 0x0, 0x0 }, - { 0x60, 0x21, 0x60, 0x0, 0x5 }, - { 0x60, 0x21, 0x60, 0x0, 0x5 }, - { 0x60, 0x21, 0x60, 0x0, 0x5 }, - { 0xE2, 0x21, 0x81, 0x0, 0x0 }, - { 0xE2, 0x21, 0x81, 0x0, 0x0 }, - { 0xE2, 0x21, 0x81, 0x0, 0x0 }, - { 0x0, 0x30, 0x10, 0x8, 0xC }, - { 0x0, 0x30, 0x10, 0x8, 0xC }, - { 0x0, 0x30, 0x10, 0x8, 0xC }, - { 0x9, 0x20, 0x0, 0x0, 0x4 }, - { 0x9, 0x20, 0x0, 0x0, 0x4 }, - { 0xF2, 0x20, 0x8, 0x1, 0x8 }, - { 0xF2, 0x20, 0x8, 0x1, 0x8 }, - { 0xF6, 0x22, 0x8, 0x1, 0x8 }, - { 0x0, 0x20, 0x0, 0x80, 0x12 }, - { 0x0, 0x20, 0x0, 0x80, 0x12 }, - { 0xB, 0x24, 0x60, 0x0, 0x11 }, - { 0xF, 0x25, 0x60, 0x10, 0x11 }, - { 0x10, 0x20, 0x20, 0x30, 0x10 }, - { 0x10, 0x20, 0x20, 0x30, 0x10 }, - { 0x6, 0xA8, 0x0, 0x44, 0x36 }, - { 0x2, 0xA0, 0x2, 0x0, 0x34 }, - { 0x2, 0xA0, 0x2, 0x0, 0x34 }, - { 0x9, 0x24, 0x20, 0x0, 0x0 }, - { 0x9, 0x24, 0x20, 0x0, 0x0 }, - { 0x62, 0x21, 0x0, 0x2, 0x0 }, - { 0x62, 0x21, 0x0, 0x2, 0x0 }, - { 0x9, 0x20, 0x0, 0x10, 0x10 }, - { 0x9, 0x20, 0x20, 0x10, 0x10 }, - { 0x68, 0x69, 0x0, 0x0, 0x2D }, - { 0x68, 0x69, 0x0, 0x0, 0x2D }, - { 0x68, 0x69, 0x0, 0x0, 0x2D }, - { 0x12, 0x22, 0x8, 0x5, 0x0 }, - { 0x60, 0x1, 0x60, 0x0, 0x1 }, - { 0x60, 0x1, 0x60, 0x0, 0x1 }, - { 0x8F, 0x20, 0x8, 0x10, 0x4 }, - { 0x8F, 0x20, 0x8, 0x10, 0x4 }, - { 0x10, 0x20, 0x20, 0x20, 0x18 }, - { 0x10, 0x20, 0x20, 0x20, 0x18 }, - { 0x10, 0x20, 0x18, 0x8, 0x20 }, - { 0x10, 0x20, 0x58, 0x8, 0x0 }, - { 0x6E, 0x20, 0x2, 0x11, 0x24 }, - { 0x6E, 0x20, 0x6, 0x11, 0x24 }, - { 0x82, 0x20, 0x81, 0x80, 0x1C }, - { 0x62, 0x21, 0x81, 0x0, 0x10 }, - { 0x7A, 0x25, 0x40, 0x0, 0x4 }, - { 0x10, 0x60, 0x0, 0x0, 0x20 }, - { 0x10, 0x60, 0x0, 0x0, 0x20 }, - { 0x9A, 0x64, 0xA, 0x1, 0x20 }, - { 0xFE, 0x65, 0xE, 0x1, 0x20 }, - { 0x7A, 0x21, 0x43, 0x40, 0x0 }, - { 0x0, 0x20, 0x18, 0x8, 0x4 }, - { 0x6E, 0x65, 0x7, 0x0, 0x28 }, - { 0x9, 0x20, 0x24, 0x84, 0x10 }, - { 0x9, 0x20, 0x24, 0x84, 0x10 }, - { 0xF, 0x24, 0x0, 0x80, 0x14 }, - { 0xF, 0x24, 0x0, 0x80, 0x14 }, - { 0x19, 0x20, 0x20, 0x4, 0x10 }, - { 0x19, 0x20, 0x20, 0x4, 0x11 }, - { 0x62, 0x21, 0x61, 0x10, 0x1 }, - { 0x4, 0x28, 0x0, 0x0, 0x14 }, - { 0xA, 0x21, 0x61, 0x0, 0x1 }, - { 0x62, 0x21, 0x21, 0x20, 0x10 }, - { 0x62, 0x20, 0x1, 0x0, 0x2 }, - { 0x84, 0x20, 0x0, 0x10, 0x4 }, - { 0x8, 0x62, 0x47, 0x0, 0x20 }, - { 0x0, 0x0, 0x0, 0x80, 0x0 }, - { 0x9, 0x66, 0x4, 0x84, 0x20 }, - { 0x9, 0x26, 0x6C, 0x0, 0x0 }, - { 0x0, 0x0, 0x0, 0x0, 0x0 }, - { 0x2, 0x20, 0x1, 0x40, 0x10 }, - { 0xB, 0x24, 0x21, 0x40, 0x10 }, - { 0x2, 0x20, 0x21, 0x60, 0x10 }, - { 0x82, 0x20, 0x1, 0x40, 0x12 }, - { 0x8, 0x20, 0x60, 0x40, 0x11 }, - { 0x19, 0x20, 0x8, 0x11, 0x4 }, - { 0x19, 0x20, 0x8, 0x11, 0x4 }, - { 0x1A, 0x20, 0x8, 0x11, 0x4 }, - { 0x9F, 0x24, 0x8, 0x11, 0x4 }, - { 0x0, 0xAE, 0x8, 0x5, 0x12 }, - { 0xFA, 0x23, 0x44, 0x4A, 0x0 }, - { 0xA, 0xA8, 0x28, 0x4, 0x10 }, - { 0x2, 0xA8, 0x28, 0x4, 0x12 }, - { 0x2, 0xA8, 0x8, 0x4, 0x12 }, - { 0x8, 0x24, 0x4, 0x4, 0x10 }, - { 0x8, 0x24, 0x4, 0x4, 0x10 }, - { 0xEF, 0xAF, 0x4, 0x4, 0x12 }, - { 0x6A, 0x25, 0x60, 0x0, 0x11 }, - { 0xFF, 0xFF, 0xFF, 0xFF, 0x3F }, - { 0x6, 0x20, 0x18, 0x8, 0x0 }, - { 0x6, 0x20, 0x18, 0x8, 0x0 }, - { 0x6, 0x20, 0x1C, 0x8, 0x0 }, - { 0x12, 0x20, 0x0, 0x0, 0x12 }, - { 0x16, 0x20, 0x0, 0x0, 0x12 }, - { 0x76, 0x20, 0x0, 0x0, 0x12 }, - { 0x8B, 0x65, 0x8, 0x0, 0x20 }, - { 0x8F, 0x61, 0x8, 0x0, 0x20 }, - { 0x8F, 0x65, 0xC, 0x0, 0x20 }, - { 0x76, 0x25, 0x1, 0x40, 0x3C }, - { 0x76, 0x25, 0x1, 0x40, 0x3C }, - { 0x2, 0x88, 0x40, 0x4, 0x32 }, - { 0x2, 0x88, 0x40, 0x4, 0x32 }, - { 0x30, 0xA9, 0x0, 0x0, 0x34 }, - { 0x30, 0xA9, 0x0, 0x0, 0x34 }, - { 0x0, 0x0, 0x20, 0x80, 0x8 }, - { 0x0, 0x0, 0x20, 0x80, 0x8 }, - { 0x0, 0xA8, 0x40, 0x4, 0x32 }, - { 0x9, 0x20, 0x20, 0x80, 0x8 }, - { 0x9, 0x24, 0x20, 0x80, 0x8 }, - { 0x12, 0x20, 0x21, 0x20, 0x30 }, - { 0x1A, 0x20, 0x63, 0x40, 0x21 }, - { 0x1A, 0x20, 0x3, 0xC0, 0x20 }, - { 0x12, 0x20, 0x6A, 0x40, 0x31 }, - { 0x12, 0xA8, 0x6A, 0x44, 0x13 }, - { 0x0, 0xA8, 0x60, 0x4, 0x1B }, - { 0x0, 0xA8, 0x60, 0x4, 0x1B }, - { 0x0, 0x20, 0x20, 0x20, 0x10 }, - { 0x60, 0x20, 0x20, 0x20, 0x10 }, - { 0x60, 0x20, 0x24, 0x20, 0x10 }, - { 0x0, 0x30, 0x10, 0x8, 0x20 }, - { 0x9B, 0x25, 0x1, 0x0, 0x14 }, - { 0x9B, 0x25, 0x1, 0x0, 0x14 }, - { 0x72, 0x21, 0x1, 0x1, 0x8 }, - { 0xB, 0x20, 0x1, 0x80, 0x0 }, - { 0x0, 0x20, 0x11, 0x88, 0x0 }, - { 0x0, 0x20, 0x11, 0x88, 0x0 }, - { 0x0, 0x20, 0x11, 0x88, 0x0 }, - { 0x66, 0x61, 0x0, 0xCA, 0x34 }, - { 0x0, 0x20, 0x13, 0x8, 0x20 }, - { 0x0, 0x20, 0x13, 0x8, 0x20 }, - { 0x0, 0xA8, 0x28, 0x0, 0x30 }, - { 0x1B, 0x25, 0x8, 0x1, 0x0 }, - { 0x1B, 0x25, 0x8, 0x1, 0x0 }, - { 0x2, 0x20, 0x61, 0x40, 0x11 }, - { 0x2, 0x60, 0x1, 0x40, 0x18 }, - { 0xA, 0xC8, 0x0, 0x4, 0x3A }, - { 0xF, 0x25, 0x60, 0x10, 0x11 }, - { 0x8, 0x68, 0x0, 0x0, 0x39 }, - { 0x0, 0x0, 0x0, 0x0, 0x0 }, - { 0x0, 0x0, 0x0, 0x0, 0x0 }, - { 0x2, 0x20, 0x60, 0x0, 0x39 }, - { 0x10, 0x20, 0x0, 0x10, 0x0 }, - { 0x10, 0x20, 0x20, 0x30, 0x0 }, - { 0x12, 0x64, 0x4A, 0x40, 0x0 }, - { 0x4, 0x24, 0x0, 0x1, 0x14 }, - { 0x12, 0x26, 0x8, 0x25, 0x0 }, - { 0xE2, 0x21, 0x0, 0x40, 0x0 }, - { 0xE2, 0x21, 0x0, 0x40, 0x0 }, - { 0x19, 0x24, 0x20, 0x80, 0x10 }, - { 0x84, 0x2A, 0x0, 0x10, 0x14 }, - { 0x12, 0x30, 0x9, 0x1, 0x0 }, - { 0x4, 0x20, 0x81, 0x10, 0x4 }, - { 0xE, 0x61, 0x0, 0x0, 0x14 }, - { 0xF6, 0x21, 0x0, 0x4A, 0x10 }, - { 0xF6, 0x21, 0x0, 0x4A, 0x30 }, - { 0x12, 0x20, 0x8, 0x11, 0x2 }, - { 0x12, 0x20, 0x8, 0x11, 0x2 }, - { 0x8A, 0x20, 0xA, 0x1, 0x0 }, - { 0x8A, 0x20, 0xA, 0x1, 0x0 }, - { 0x1A, 0x20, 0xA, 0x1, 0x8 }, - { 0xB, 0x20, 0x20, 0x8A, 0x10 }, - { 0xB, 0x20, 0x20, 0x8A, 0x10 }, - { 0x1A, 0x0, 0x20, 0x8A, 0x10 }, - { 0xB, 0xA6, 0x21, 0x8A, 0x10 }, - { 0xE, 0xA8, 0x0, 0x14, 0x10 }, - { 0x2, 0x60, 0x0, 0x0, 0x3A }, - { 0x2, 0x60, 0x0, 0x0, 0x3A }, - { 0x9, 0x22, 0x24, 0x84, 0x10 }, - { 0x92, 0x20, 0xA, 0xB, 0x4 }, - { 0x92, 0x20, 0xA, 0x9B, 0x4 }, - { 0x8, 0x20, 0x60, 0x40, 0x11 }, - { 0x2, 0x60, 0x60, 0xC0, 0x38 }, - { 0x0, 0x0, 0x0, 0x0, 0x0 }, - { 0x2, 0x20, 0x81, 0x0, 0x30 }, - { 0x12, 0x20, 0x83, 0x4, 0x18 }, - { 0xA, 0x21, 0x61, 0x0, 0x21 }, - { 0x62, 0x21, 0x21, 0x20, 0x30 }, - { 0x62, 0x20, 0x1, 0x0, 0x22 }, - { 0x7A, 0x23, 0x41, 0x0, 0x0 }, - { 0x7A, 0x21, 0x43, 0x40, 0x0 }, - { 0x2, 0x22, 0x20, 0x20, 0x10 }, - { 0x2, 0x22, 0x0, 0x0, 0x12 }, - { 0xB, 0x2A, 0x20, 0x0, 0x10 }, - { 0x82, 0x62, 0x8, 0x1, 0x20 }, - { 0x82, 0x62, 0x8, 0x11, 0x20 }, - { 0xE6, 0x67, 0xC, 0x1, 0x20 }, - { 0xB, 0xAE, 0x68, 0x5, 0x11 }, - { 0x2, 0xAA, 0x68, 0x5, 0x12 }, - { 0x2, 0x20, 0x79, 0x49, 0x39 }, - { 0x26, 0x20, 0x12, 0x8, 0x10 }, - { 0x26, 0x20, 0x12, 0x8, 0x10 }, - { 0x26, 0x20, 0x16, 0x8, 0x10 }, - { 0x2, 0x20, 0x1, 0xC0, 0x12 }, - { 0x66, 0x20, 0x81, 0xC0, 0x12 }, - { 0xE6, 0x20, 0x81, 0xC0, 0x16 }, - { 0x9B, 0x24, 0xA, 0x1, 0x0 }, - { 0x9B, 0x25, 0xA, 0x1, 0x0 }, - { 0x9B, 0x25, 0xE, 0x1, 0x0 }, - { 0x2, 0x60, 0x0, 0x0, 0x28 }, - { 0x2, 0x60, 0x0, 0x0, 0x28 }, - { 0x1E, 0x20, 0x1, 0x4A, 0x11 }, - { 0x1E, 0x20, 0x1, 0x4A, 0x11 }, - { 0x0, 0x20, 0x0, 0x0, 0x0 }, - { 0x0, 0x0, 0x0, 0x10, 0x0 }, - { 0x0, 0xA8, 0x20, 0x4, 0x10 }, - { 0x0, 0x0, 0x0, 0x10, 0x0 }, - { 0x0, 0xA8, 0x20, 0x4, 0x10 }, - { 0x8, 0x20, 0x50, 0x8, 0x20 }, - { 0x6B, 0x21, 0x50, 0x8, 0x20 }, - { 0x6B, 0x21, 0x50, 0x8, 0x20 }, - { 0x10, 0x60, 0x10, 0x8, 0x0 }, - { 0x16, 0x60, 0x10, 0x8, 0x10 }, - { 0x1E, 0xE8, 0x10, 0x8C, 0x1C }, - { 0x2, 0xA8, 0x2, 0x4, 0x12 }, - { 0x2, 0xA8, 0x2, 0x4, 0x12 }, - { 0xA, 0xA8, 0x0, 0x4, 0x34 }, - { 0xA, 0xA8, 0x0, 0xE, 0x34 }, - { 0x6A, 0x21, 0x61, 0x0, 0x11 }, - { 0x6A, 0x21, 0x61, 0x0, 0x11 }, - { 0x6A, 0x21, 0x61, 0x0, 0x11 }, - { 0xA, 0x20, 0x20, 0x0, 0x10 }, - { 0xA, 0xA8, 0x20, 0x4, 0x10 }, - { 0x0, 0x20, 0x11, 0x8, 0x0 }, - { 0xA6, 0x20, 0x91, 0x8, 0x0 }, - { 0x6E, 0x21, 0x0, 0x2, 0x8 }, - { 0x6E, 0x1, 0x0, 0x2, 0x28 }, - { 0x6E, 0x21, 0x0, 0x2, 0x8 }, - { 0x6, 0x60, 0x0, 0x0, 0x0 }, - { 0x6, 0xE8, 0x0, 0x0, 0x30 }, - { 0x6, 0x60, 0x0, 0x0, 0x9 }, - { 0x7A, 0x21, 0x40, 0x0, 0x20 }, - { 0x7A, 0x21, 0x40, 0x0, 0x20 }, - { 0x7A, 0x21, 0x44, 0x0, 0x20 }, - { 0xE2, 0x21, 0x81, 0x0, 0x4 }, - { 0xE2, 0x23, 0x81, 0x0, 0x4 }, - { 0x1A, 0x20, 0x1, 0x0, 0x34 }, - { 0x72, 0x21, 0x8, 0x31, 0x0 }, - { 0x1A, 0x20, 0x41, 0x40, 0x18 }, - { 0x1A, 0x20, 0x41, 0x40, 0x18 }, - { 0x6E, 0x69, 0x60, 0x0, 0xD }, - { 0x2A, 0x23, 0x8, 0x30, 0xC }, - { 0x96, 0x62, 0xA, 0x31, 0x20 }, - { 0x96, 0x62, 0xA, 0x31, 0x20 }, - { 0xFE, 0x67, 0xE, 0x31, 0x20 }, - { 0x62, 0x21, 0xE1, 0x0, 0x11 }, - { 0x62, 0x21, 0xE1, 0x0, 0x11 }, - { 0x2, 0x20, 0x20, 0x20, 0x10 }, - { 0x2, 0x20, 0x20, 0x20, 0x10 }, - { 0x32, 0x20, 0x21, 0x60, 0x30 }, - { 0x32, 0x20, 0x21, 0x60, 0x30 }, - { 0x22, 0xA9, 0x61, 0x0, 0x10 }, - { 0x22, 0xA9, 0x41, 0x0, 0x10 }, - { 0x6, 0x20, 0x10, 0x8, 0x10 }, - { 0x72, 0x31, 0x0, 0xA, 0x0 }, - { 0x72, 0x31, 0x0, 0xA, 0x0 }, - { 0xF, 0x60, 0x48, 0x80, 0x30 }, - { 0xF, 0x60, 0x48, 0x80, 0x30 }, - { 0x19, 0x20, 0x0, 0x80, 0x0 }, - { 0x19, 0x22, 0x0, 0x80, 0x0 }, - { 0x12, 0x20, 0x0, 0x1, 0x2 }, - { 0x12, 0x22, 0x0, 0x1, 0x2 }, - { 0x12, 0x20, 0x0, 0x11, 0x2 }, - { 0x8, 0x20, 0x60, 0x80, 0x11 }, - { 0x6A, 0x21, 0x60, 0x80, 0x11 }, - { 0x7A, 0x21, 0x41, 0x40, 0x38 }, - { 0x6, 0x20, 0x0, 0x1, 0x0 }, - { 0x6, 0xA8, 0x4, 0x5, 0x12 }, - { 0x66, 0xA8, 0x4, 0x5, 0x12 }, - { 0x26, 0x60, 0x10, 0x8, 0x8 }, - { 0xA6, 0x60, 0x10, 0x8, 0x8 }, - { 0x2, 0xA8, 0x4, 0x4, 0x32 }, - { 0x2, 0xA8, 0x4, 0x4, 0x32 }, - { 0x7E, 0x21, 0x2, 0x40, 0x14 }, - { 0x6, 0x24, 0x0, 0x0, 0x1C }, - { 0x10, 0x22, 0x69, 0x1, 0x10 }, - { 0x10, 0x22, 0x69, 0x11, 0x10 }, - { 0xB, 0x24, 0x0, 0x81, 0x0 }, - { 0xB, 0x24, 0x40, 0x81, 0x0 }, - { 0x8E, 0x60, 0xA, 0x10, 0x4 }, - { 0x8F, 0x60, 0xA, 0x10, 0x14 }, - { 0x2, 0x20, 0x68, 0x1, 0x1 }, - { 0x2, 0x20, 0x68, 0x1, 0x1 }, - { 0x2, 0x30, 0x18, 0x9, 0x0 }, - { 0x2, 0x30, 0x18, 0x9, 0x0 }, - { 0x6, 0x20, 0x8, 0x11, 0x4 }, - { 0x86, 0x24, 0x8, 0x11, 0x4 }, - { 0x9, 0x20, 0x0, 0x0, 0x10 }, - { 0xB, 0x26, 0x0, 0x4, 0x10 }, - { 0x8, 0x28, 0x0, 0x40, 0x10 }, - { 0x7E, 0x25, 0x8, 0x40, 0x1D }, - { 0x8, 0x48, 0x0, 0x0, 0xD }, - { 0xA, 0x48, 0x0, 0x0, 0xD }, - { 0x8, 0x68, 0x0, 0x0, 0x9 }, - { 0x6A, 0x69, 0x0, 0x0, 0x9 }, - { 0x6, 0xA8, 0x14, 0x4, 0x0 }, - { 0x18, 0x20, 0x61, 0x40, 0x25 }, - { 0x8E, 0x60, 0x40, 0x80, 0x1C }, - { 0x0, 0x0, 0x0, 0x0, 0x0 }, - { 0x18, 0x60, 0x0, 0x0, 0x0 }, - { 0x18, 0x62, 0x20, 0x0, 0x0 }, - { 0x1B, 0x24, 0x20, 0x0, 0x0 }, - { 0x1B, 0x24, 0x20, 0x0, 0x0 }, - { 0x1F, 0x26, 0x20, 0x0, 0x0 }, - { 0x9, 0x20, 0x0, 0x10, 0x0 }, - { 0xB, 0x24, 0x0, 0x80, 0x18 }, - { 0xB, 0x24, 0x20, 0x80, 0x10 }, - { 0xB, 0x24, 0x8, 0x81, 0x0 }, - { 0x9, 0x20, 0x0, 0x80, 0x10 }, - { 0x6, 0x20, 0x44, 0x4, 0x0 }, - { 0x16, 0x20, 0x44, 0x14, 0x0 }, - { 0x16, 0xAC, 0x44, 0x4, 0x12 }, - { 0x0, 0x2, 0x40, 0x10, 0x0 }, - { 0x3E, 0x23, 0x60, 0x30, 0x11 }, - { 0x3E, 0x23, 0x60, 0x30, 0x11 }, - { 0xF2, 0x23, 0x8, 0x1, 0x0 }, - { 0xBA, 0x23, 0x28, 0x0, 0x0 }, - { 0xB2, 0x23, 0x8, 0x30, 0x0 }, - { 0xF, 0x20, 0x45, 0x44, 0x19 }, - { 0xF, 0x20, 0x45, 0x44, 0x11 }, - { 0xB, 0x26, 0x28, 0x0, 0x30 }, - { 0x76, 0x22, 0x8, 0x1, 0x30 }, - { 0xF, 0x26, 0xC, 0x5, 0x30 }, - { 0x6A, 0x23, 0x69, 0x50, 0x31 }, - { 0x6A, 0x21, 0x60, 0x0, 0x15 }, - { 0x82, 0x20, 0x10, 0x9, 0x0 }, - { 0x82, 0x20, 0x10, 0x9, 0x0 }, - { 0x82, 0x22, 0x14, 0x9, 0x0 }, - { 0x72, 0x20, 0x83, 0x2, 0x32 }, - { 0x72, 0x20, 0x83, 0x2, 0x12 }, - { 0x72, 0x20, 0x83, 0x2, 0x12 }, - { 0xB, 0x20, 0x20, 0x0, 0x0 }, - { 0xB, 0x20, 0x20, 0x0, 0x0 }, - { 0xF, 0x20, 0x20, 0x10, 0x4 }, - { 0x2, 0xA8, 0x2, 0x4, 0x12 }, - { 0x2, 0xA8, 0x2, 0x4, 0x12 }, - { 0x2, 0xA8, 0x2, 0x4, 0x12 }, - { 0x9E, 0x24, 0x0, 0x40, 0x10 }, - { 0x9F, 0x24, 0x0, 0x40, 0x10 }, - { 0x2, 0x20, 0x2, 0x0, 0x20 }, - { 0x6, 0x20, 0x2, 0x0, 0x24 }, - { 0x6, 0x20, 0x20, 0x20, 0x10 }, - { 0x6, 0x20, 0x20, 0x20, 0x10 }, - { 0x86, 0x20, 0x20, 0x20, 0x10 }, - { 0x2, 0x20, 0x10, 0x8, 0x30 }, - { 0x6, 0x20, 0x10, 0x8, 0x10 }, - { 0xE2, 0x62, 0x4A, 0x1, 0x20 }, - { 0xE2, 0x62, 0x4E, 0x1, 0x20 }, - { 0x2, 0x22, 0x8, 0x31, 0x0 }, - { 0x2, 0x22, 0xC, 0x31, 0x0 }, - { 0x0, 0x20, 0x0, 0x0, 0x0 }, - { 0x0, 0x20, 0x32, 0x8, 0x28 }, - { 0x2, 0xA8, 0x20, 0x4, 0x10 }, - { 0x2, 0xA8, 0x2, 0x0, 0x10 }, - { 0x6, 0xA8, 0x22, 0x0, 0x10 }, - { 0x32, 0x20, 0x1, 0x6A, 0x30 }, - { 0xB, 0x21, 0x0, 0x0, 0x10 }, - { 0xB, 0x25, 0x0, 0x0, 0x10 }, - { 0x10, 0x20, 0x11, 0x8, 0x0 }, - { 0x10, 0x20, 0x11, 0x8, 0x0 }, - { 0xB, 0x20, 0x8, 0x1, 0x0 }, - { 0xB, 0x20, 0x8, 0x1, 0x0 }, - { 0x66, 0x61, 0x0, 0xCA, 0x34 }, - { 0x1A, 0xE8, 0x0, 0x0, 0x1D }, - { 0x1A, 0xE8, 0x0, 0x0, 0x1D }, - { 0x2, 0x20, 0x3, 0xC0, 0x30 }, - { 0x66, 0x21, 0x3, 0xC0, 0x30 }, - { 0x8, 0x68, 0x0, 0x0, 0x39 }, - { 0x82, 0xC8, 0x0, 0x4, 0x3A }, - { 0x6, 0x20, 0x0, 0x40, 0x1C }, - { 0x16, 0x20, 0x0, 0x40, 0x1C }, - { 0x18, 0x20, 0x61, 0x40, 0x35 }, - { 0x6, 0x20, 0x0, 0x0, 0x18 }, - { 0x6, 0x20, 0x0, 0x0, 0x18 }, - { 0x10, 0x20, 0x28, 0x0, 0x1 }, - { 0x10, 0x22, 0x68, 0x0, 0x1 }, - { 0x10, 0x20, 0x1, 0x1, 0x28 }, - { 0x2, 0x20, 0x21, 0x0, 0x21 }, - { 0x1A, 0x20, 0x43, 0x40, 0x20 }, - { 0x2, 0xA8, 0x0, 0x4, 0x32 }, - { 0x8, 0x68, 0x0, 0x0, 0x29 }, - { 0x6, 0x22, 0x4, 0x5, 0x10 }, - { 0x6, 0x22, 0x4, 0x5, 0x10 }, - { 0x6, 0x26, 0x4, 0x5, 0x10 }, - { 0xFA, 0x21, 0x40, 0x4A, 0x20 }, - { 0x26, 0x21, 0xC1, 0x30, 0x10 }, - { 0x26, 0x21, 0xC1, 0x30, 0x10 }, - { 0x82, 0x20, 0x0, 0x1, 0x0 }, - { 0x82, 0x22, 0x0, 0x1, 0x0 }, - { 0x6, 0x24, 0x0, 0x0, 0x4 }, - { 0x6, 0x24, 0x0, 0x0, 0x4 }, - { 0x2E, 0x61, 0x81, 0x82, 0xC }, - { 0x2E, 0x61, 0x81, 0x82, 0xC }, - { 0x6, 0x30, 0x10, 0x8, 0x4 }, - { 0x9, 0xAC, 0x0, 0x84, 0x10 }, - { 0x9, 0xAC, 0x0, 0x84, 0x10 }, - { 0xB, 0xA0, 0x1, 0x80, 0x10 }, - { 0xA, 0x21, 0x10, 0x8, 0x0 }, - { 0xA, 0x21, 0x14, 0x8, 0x0 }, - { 0xE, 0x61, 0x0, 0x0, 0x14 }, - { 0x10, 0x22, 0x20, 0x30, 0x10 }, - { 0x7A, 0x25, 0x40, 0x0, 0x4 }, - { 0xFE, 0x67, 0xE, 0x1, 0x20 }, - { 0x2, 0x20, 0x18, 0x8, 0x4 }, - { 0x62, 0x21, 0x21, 0x20, 0x10 }, - { 0x62, 0x20, 0x1, 0x0, 0x2 }, - { 0x12, 0xA8, 0x6A, 0x44, 0x13 }, - { 0x2, 0xA8, 0x28, 0x0, 0x30 }, - { 0x6, 0x20, 0x11, 0x48, 0x14 }, - { 0xA, 0x24, 0x21, 0x40, 0x10 }, - { 0x6, 0x24, 0x0, 0x1, 0x14 }, - { 0x8E, 0x22, 0xA, 0x1, 0x4 }, - { 0x8, 0x20, 0x60, 0x40, 0x31 }, - { 0x66, 0x21, 0xE1, 0x0, 0x15 }, - { 0x72, 0x23, 0x8, 0x31, 0x0 }, - { 0x6A, 0x69, 0x0, 0x0, 0x9 }, - { 0x1A, 0x69, 0x20, 0x0, 0x9 }, - { 0x2, 0x68, 0x20, 0x0, 0x39 }, - { 0x62, 0x21, 0x61, 0x0, 0x15 }, - { 0x62, 0x21, 0x61, 0x0, 0x15 }, - { 0x62, 0x21, 0x61, 0x40, 0x35 }, - { 0x6, 0x22, 0xC, 0x35, 0x10 }, - { 0x7, 0x24, 0xC, 0x5, 0x10 }, - { 0x2, 0x22, 0x8, 0x11, 0x22 }, - { 0xEA, 0x23, 0x48, 0x1, 0x0 }, - { 0xE, 0xEE, 0xC, 0x5, 0x10 }, - { 0xE, 0x20, 0x61, 0x0, 0x11 }, - { 0xB, 0x20, 0x29, 0xC0, 0x34 }, - { 0xB, 0x20, 0x29, 0xC0, 0x34 }, - { 0xA, 0x68, 0x0, 0x40, 0x1D }, - { 0x2, 0x20, 0x52, 0x49, 0x10 }, - { 0xF, 0x2E, 0x6C, 0x55, 0x13 }, - { 0x82, 0x20, 0x60, 0x0, 0x1 }, - { 0x2, 0x20, 0x60, 0x10, 0x5 }, - { 0x2, 0x20, 0x60, 0x0, 0x15 }, - { 0x12, 0x20, 0x22, 0x1, 0x28 }, - { 0x0, 0x22, 0x22, 0x32, 0x28 }, - { 0xE, 0xEE, 0xC, 0x5, 0x10 }, - { 0x2, 0xA8, 0x50, 0x48, 0x10 }, - { 0x2, 0x68, 0x20, 0x0, 0x39 }, - { 0x2, 0x68, 0x20, 0x0, 0x39 }, - { 0x2, 0x68, 0x20, 0x0, 0x39 }, - { 0x2, 0x68, 0x20, 0x0, 0x39 }, - { 0x2, 0x68, 0x20, 0x0, 0x39 } -}; - -typedef struct { - u16 unk_00; + u16 moveID; u8 unk_02; u8 unk_03; u8 unk_04; u8 unk_05; - u32 unk_08; -} UnkStruct_ov5_02200CE4; + u32 shardColor; // the type of underground shard you use to trade to the move tutors +} TeachableMove; + +static const TeachableMove sTeachableMoves[] = { + { MOVE_DIVE, 0x2, 0x4, 0x2, 0x0, 0x0 }, + { MOVE_MUD_SLAP, 0x4, 0x4, 0x0, 0x0, 0x1 }, + { MOVE_FURY_CUTTER, 0x0, 0x8, 0x0, 0x0, 0x0 }, + { MOVE_ICY_WIND, 0x0, 0x6, 0x0, 0x2, 0x0 }, + { MOVE_ROLLOUT, 0x4, 0x2, 0x0, 0x2, 0x1 }, + { MOVE_THUNDER_PUNCH, 0x2, 0x6, 0x0, 0x0, 0x0 }, + { MOVE_FIRE_PUNCH, 0x2, 0x6, 0x0, 0x0, 0x0 }, + { MOVE_SUPERPOWER, 0x8, 0x0, 0x0, 0x0, 0x1 }, + { MOVE_ICE_PUNCH, 0x2, 0x6, 0x0, 0x0, 0x0 }, + { MOVE_IRON_HEAD, 0x6, 0x0, 0x2, 0x0, 0x1 }, + { MOVE_AQUA_TAIL, 0x6, 0x0, 0x0, 0x2, 0x1 }, + { MOVE_OMINOUS_WIND, 0x0, 0x6, 0x0, 0x2, 0x0 }, + { MOVE_GASTRO_ACID, 0x4, 0x0, 0x2, 0x2, 0x1 }, + { MOVE_SNORE, 0x2, 0x0, 0x4, 0x2, 0x2 }, + { MOVE_SPITE, 0x0, 0x0, 0x8, 0x0, 0x2 }, + { MOVE_AIR_CUTTER, 0x2, 0x4, 0x0, 0x2, 0x0 }, + { MOVE_HELPING_HAND, 0x2, 0x0, 0x4, 0x2, 0x2 }, + { MOVE_ENDEAVOR, 0x4, 0x0, 0x4, 0x0, 0x1 }, + { MOVE_OUTRAGE, 0x6, 0x0, 0x2, 0x0, 0x1 }, + { MOVE_ANCIENT_POWER, 0x6, 0x0, 0x0, 0x2, 0x1 }, + { MOVE_SYNTHESIS, 0x0, 0x0, 0x2, 0x6, 0x2 }, + { MOVE_SIGNAL_BEAM, 0x2, 0x2, 0x2, 0x2, 0x1 }, + { MOVE_ZEN_HEADBUTT, 0x0, 0x4, 0x4, 0x0, 0x0 }, + { MOVE_VACUUM_WAVE, 0x2, 0x4, 0x0, 0x2, 0x0 }, + { MOVE_EARTH_POWER, 0x6, 0x0, 0x0, 0x2, 0x1 }, + { MOVE_GUNK_SHOT, 0x4, 0x2, 0x0, 0x2, 0x1 }, + { MOVE_TWISTER, 0x6, 0x0, 0x0, 0x2, 0x1 }, + { MOVE_SEED_BOMB, 0x4, 0x0, 0x0, 0x4, 0x1 }, + { MOVE_IRON_DEFENSE, 0x4, 0x2, 0x2, 0x0, 0x1 }, + { MOVE_MAGNET_RISE, 0x0, 0x2, 0x4, 0x2, 0x2 }, + { MOVE_LAST_RESORT, 0x0, 0x0, 0x0, 0x8, 0x2 }, + { MOVE_BOUNCE, 0x4, 0x0, 0x2, 0x2, 0x1 }, + { MOVE_TRICK, 0x0, 0x4, 0x4, 0x0, 0x0 }, + { MOVE_HEAT_WAVE, 0x4, 0x2, 0x0, 0x2, 0x1 }, + { MOVE_KNOCK_OFF, 0x4, 0x4, 0x0, 0x0, 0x0 }, + { MOVE_SUCKER_PUNCH, 0x0, 0x6, 0x2, 0x0, 0x0 }, + { MOVE_SWIFT, 0x0, 0x2, 0x2, 0x4, 0x2 }, + { MOVE_UPROAR, 0x0, 0x0, 0x6, 0x2, 0x2 } +}; + +#define MOVESET_MASK_SIZE (s32)((NELEMS(sTeachableMoves) + 7) / 8) + +// Each of the bits in this array correspond to a move in sTeachableMoves +// Therefore the size is dependent on how many teachable moves exist + +typedef struct { + u8 maskData[MOVESET_MASK_SIZE]; +} MovesetMask; + +const MovesetMask sTeachableMovesets[MOVESET_MAX] = { + { 0x6, 0x20, 0x10, 0x8, 0x4 }, + { 0x6, 0x20, 0x10, 0x8, 0x4 }, + { 0x6, 0x20, 0x14, 0x8, 0x4 }, + { 0x66, 0x20, 0x0, 0x0, 0x12 }, + { 0x66, 0x20, 0x0, 0x0, 0x12 }, + { 0x66, 0xA8, 0x4, 0x4, 0x12 }, + { 0x1B, 0x25, 0x40, 0x10, 0x0 }, + { 0x1B, 0x25, 0x40, 0x10, 0x0 }, + { 0x1B, 0x25, 0x64, 0x10, 0x0 }, + { 0x0, 0x20, 0x0, 0x0, 0x0 }, + { 0x0, 0x0, 0x0, 0x10, 0x0 }, + { 0x0, 0xA8, 0x20, 0x4, 0x10 }, + { 0x0, 0x0, 0x0, 0x0, 0x0 }, + { 0x0, 0x0, 0x0, 0x10, 0x0 }, + { 0x4, 0xA8, 0x2, 0x0, 0x14 }, + { 0x2, 0xA8, 0x0, 0x4, 0x32 }, + { 0x2, 0xA8, 0x0, 0x4, 0x32 }, + { 0x2, 0xA8, 0x0, 0x4, 0x32 }, + { 0xA, 0x20, 0x42, 0x40, 0x18 }, + { 0xA, 0x20, 0x42, 0x40, 0x18 }, + { 0x2, 0xA8, 0x0, 0x4, 0x12 }, + { 0x2, 0xA8, 0x0, 0x4, 0x12 }, + { 0x0, 0x74, 0x0, 0xA, 0x0 }, + { 0x0, 0x74, 0x0, 0xA, 0x0 }, + { 0x32, 0x20, 0x21, 0x20, 0x14 }, + { 0x32, 0x20, 0x21, 0x20, 0x14 }, + { 0x16, 0x20, 0x0, 0x1, 0x14 }, + { 0x16, 0x20, 0x0, 0x1, 0x14 }, + { 0x2, 0x20, 0x1, 0x0, 0x0 }, + { 0x2, 0x20, 0x1, 0x0, 0x0 }, + { 0xEE, 0x25, 0x5, 0x1, 0x20 }, + { 0x2, 0x20, 0x1, 0x0, 0x8 }, + { 0x2, 0x20, 0x1, 0x0, 0x8 }, + { 0xEE, 0x25, 0x5, 0x1, 0x28 }, + { 0x7A, 0x21, 0x63, 0xC0, 0x5 }, + { 0x7A, 0x21, 0x63, 0xC0, 0x5 }, + { 0x0, 0x68, 0x40, 0x0, 0x12 }, + { 0x0, 0x68, 0x40, 0x0, 0x12 }, + { 0x7A, 0x21, 0x3, 0xC0, 0x4 }, + { 0x7A, 0x21, 0x3, 0xC0, 0x4 }, + { 0x0, 0xA8, 0x40, 0x4, 0x32 }, + { 0x0, 0xA8, 0x40, 0x4, 0x32 }, + { 0x0, 0x30, 0x10, 0x8, 0x0 }, + { 0x0, 0x30, 0x10, 0x8, 0x0 }, + { 0x0, 0x30, 0x10, 0x8, 0x0 }, + { 0x4, 0x20, 0x10, 0x8, 0x4 }, + { 0x4, 0x20, 0x10, 0x8, 0x4 }, + { 0x0, 0x20, 0x60, 0x0, 0x10 }, + { 0x0, 0xA8, 0x60, 0x4, 0x10 }, + { 0x2, 0x20, 0x0, 0x1, 0x8 }, + { 0x2, 0x20, 0x0, 0x1, 0x8 }, + { 0xA, 0x60, 0x0, 0x4A, 0x34 }, + { 0xA, 0x60, 0x0, 0x4A, 0x34 }, + { 0xB, 0x25, 0x60, 0x0, 0x10 }, + { 0xF, 0x25, 0x60, 0x0, 0x10 }, + { 0x62, 0x41, 0x87, 0xA, 0x30 }, + { 0x62, 0x41, 0x87, 0xA, 0x30 }, + { 0x2, 0x20, 0x1, 0x0, 0x12 }, + { 0x2, 0x22, 0x1, 0x0, 0x12 }, + { 0x9, 0x20, 0x1, 0x0, 0x0 }, + { 0xB, 0x21, 0x1, 0x0, 0x0 }, + { 0xB, 0x21, 0x81, 0x0, 0x0 }, + { 0x60, 0x21, 0x60, 0x0, 0x5 }, + { 0x60, 0x21, 0x60, 0x0, 0x5 }, + { 0x60, 0x21, 0x60, 0x0, 0x5 }, + { 0xE2, 0x21, 0x81, 0x0, 0x0 }, + { 0xE2, 0x21, 0x81, 0x0, 0x0 }, + { 0xE2, 0x21, 0x81, 0x0, 0x0 }, + { 0x0, 0x30, 0x10, 0x8, 0xC }, + { 0x0, 0x30, 0x10, 0x8, 0xC }, + { 0x0, 0x30, 0x10, 0x8, 0xC }, + { 0x9, 0x20, 0x0, 0x0, 0x4 }, + { 0x9, 0x20, 0x0, 0x0, 0x4 }, + { 0xF2, 0x20, 0x8, 0x1, 0x8 }, + { 0xF2, 0x20, 0x8, 0x1, 0x8 }, + { 0xF6, 0x22, 0x8, 0x1, 0x8 }, + { 0x0, 0x20, 0x0, 0x80, 0x12 }, + { 0x0, 0x20, 0x0, 0x80, 0x12 }, + { 0xB, 0x24, 0x60, 0x0, 0x11 }, + { 0xF, 0x25, 0x60, 0x10, 0x11 }, + { 0x10, 0x20, 0x20, 0x30, 0x10 }, + { 0x10, 0x20, 0x20, 0x30, 0x10 }, + { 0x6, 0xA8, 0x0, 0x44, 0x36 }, + { 0x2, 0xA0, 0x2, 0x0, 0x34 }, + { 0x2, 0xA0, 0x2, 0x0, 0x34 }, + { 0x9, 0x24, 0x20, 0x0, 0x0 }, + { 0x9, 0x24, 0x20, 0x0, 0x0 }, + { 0x62, 0x21, 0x0, 0x2, 0x0 }, + { 0x62, 0x21, 0x0, 0x2, 0x0 }, + { 0x9, 0x20, 0x0, 0x10, 0x10 }, + { 0x9, 0x20, 0x20, 0x10, 0x10 }, + { 0x68, 0x69, 0x0, 0x0, 0x2D }, + { 0x68, 0x69, 0x0, 0x0, 0x2D }, + { 0x68, 0x69, 0x0, 0x0, 0x2D }, + { 0x12, 0x22, 0x8, 0x5, 0x0 }, + { 0x60, 0x1, 0x60, 0x0, 0x1 }, + { 0x60, 0x1, 0x60, 0x0, 0x1 }, + { 0x8F, 0x20, 0x8, 0x10, 0x4 }, + { 0x8F, 0x20, 0x8, 0x10, 0x4 }, + { 0x10, 0x20, 0x20, 0x20, 0x18 }, + { 0x10, 0x20, 0x20, 0x20, 0x18 }, + { 0x10, 0x20, 0x18, 0x8, 0x20 }, + { 0x10, 0x20, 0x58, 0x8, 0x0 }, + { 0x6E, 0x20, 0x2, 0x11, 0x24 }, + { 0x6E, 0x20, 0x6, 0x11, 0x24 }, + { 0x82, 0x20, 0x81, 0x80, 0x1C }, + { 0x62, 0x21, 0x81, 0x0, 0x10 }, + { 0x7A, 0x25, 0x40, 0x0, 0x4 }, + { 0x10, 0x60, 0x0, 0x0, 0x20 }, + { 0x10, 0x60, 0x0, 0x0, 0x20 }, + { 0x9A, 0x64, 0xA, 0x1, 0x20 }, + { 0xFE, 0x65, 0xE, 0x1, 0x20 }, + { 0x7A, 0x21, 0x43, 0x40, 0x0 }, + { 0x0, 0x20, 0x18, 0x8, 0x4 }, + { 0x6E, 0x65, 0x7, 0x0, 0x28 }, + { 0x9, 0x20, 0x24, 0x84, 0x10 }, + { 0x9, 0x20, 0x24, 0x84, 0x10 }, + { 0xF, 0x24, 0x0, 0x80, 0x14 }, + { 0xF, 0x24, 0x0, 0x80, 0x14 }, + { 0x19, 0x20, 0x20, 0x4, 0x10 }, + { 0x19, 0x20, 0x20, 0x4, 0x11 }, + { 0x62, 0x21, 0x61, 0x10, 0x1 }, + { 0x4, 0x28, 0x0, 0x0, 0x14 }, + { 0xA, 0x21, 0x61, 0x0, 0x1 }, + { 0x62, 0x21, 0x21, 0x20, 0x10 }, + { 0x62, 0x20, 0x1, 0x0, 0x2 }, + { 0x84, 0x20, 0x0, 0x10, 0x4 }, + { 0x8, 0x62, 0x47, 0x0, 0x20 }, + { 0x0, 0x0, 0x0, 0x80, 0x0 }, + { 0x9, 0x66, 0x4, 0x84, 0x20 }, + { 0x9, 0x26, 0x6C, 0x0, 0x0 }, + { 0x0, 0x0, 0x0, 0x0, 0x0 }, + { 0x2, 0x20, 0x1, 0x40, 0x10 }, + { 0xB, 0x24, 0x21, 0x40, 0x10 }, + { 0x2, 0x20, 0x21, 0x60, 0x10 }, + { 0x82, 0x20, 0x1, 0x40, 0x12 }, + { 0x8, 0x20, 0x60, 0x40, 0x11 }, + { 0x19, 0x20, 0x8, 0x11, 0x4 }, + { 0x19, 0x20, 0x8, 0x11, 0x4 }, + { 0x1A, 0x20, 0x8, 0x11, 0x4 }, + { 0x9F, 0x24, 0x8, 0x11, 0x4 }, + { 0x0, 0xAE, 0x8, 0x5, 0x12 }, + { 0xFA, 0x23, 0x44, 0x4A, 0x0 }, + { 0xA, 0xA8, 0x28, 0x4, 0x10 }, + { 0x2, 0xA8, 0x28, 0x4, 0x12 }, + { 0x2, 0xA8, 0x8, 0x4, 0x12 }, + { 0x8, 0x24, 0x4, 0x4, 0x10 }, + { 0x8, 0x24, 0x4, 0x4, 0x10 }, + { 0xEF, 0xAF, 0x4, 0x4, 0x12 }, + { 0x6A, 0x25, 0x60, 0x0, 0x11 }, + { 0xFF, 0xFF, 0xFF, 0xFF, 0x3F }, + { 0x6, 0x20, 0x18, 0x8, 0x0 }, + { 0x6, 0x20, 0x18, 0x8, 0x0 }, + { 0x6, 0x20, 0x1C, 0x8, 0x0 }, + { 0x12, 0x20, 0x0, 0x0, 0x12 }, + { 0x16, 0x20, 0x0, 0x0, 0x12 }, + { 0x76, 0x20, 0x0, 0x0, 0x12 }, + { 0x8B, 0x65, 0x8, 0x0, 0x20 }, + { 0x8F, 0x61, 0x8, 0x0, 0x20 }, + { 0x8F, 0x65, 0xC, 0x0, 0x20 }, + { 0x76, 0x25, 0x1, 0x40, 0x3C }, + { 0x76, 0x25, 0x1, 0x40, 0x3C }, + { 0x2, 0x88, 0x40, 0x4, 0x32 }, + { 0x2, 0x88, 0x40, 0x4, 0x32 }, + { 0x30, 0xA9, 0x0, 0x0, 0x34 }, + { 0x30, 0xA9, 0x0, 0x0, 0x34 }, + { 0x0, 0x0, 0x20, 0x80, 0x8 }, + { 0x0, 0x0, 0x20, 0x80, 0x8 }, + { 0x0, 0xA8, 0x40, 0x4, 0x32 }, + { 0x9, 0x20, 0x20, 0x80, 0x8 }, + { 0x9, 0x24, 0x20, 0x80, 0x8 }, + { 0x12, 0x20, 0x21, 0x20, 0x30 }, + { 0x1A, 0x20, 0x63, 0x40, 0x21 }, + { 0x1A, 0x20, 0x3, 0xC0, 0x20 }, + { 0x12, 0x20, 0x6A, 0x40, 0x31 }, + { 0x12, 0xA8, 0x6A, 0x44, 0x13 }, + { 0x0, 0xA8, 0x60, 0x4, 0x1B }, + { 0x0, 0xA8, 0x60, 0x4, 0x1B }, + { 0x0, 0x20, 0x20, 0x20, 0x10 }, + { 0x60, 0x20, 0x20, 0x20, 0x10 }, + { 0x60, 0x20, 0x24, 0x20, 0x10 }, + { 0x0, 0x30, 0x10, 0x8, 0x20 }, + { 0x9B, 0x25, 0x1, 0x0, 0x14 }, + { 0x9B, 0x25, 0x1, 0x0, 0x14 }, + { 0x72, 0x21, 0x1, 0x1, 0x8 }, + { 0xB, 0x20, 0x1, 0x80, 0x0 }, + { 0x0, 0x20, 0x11, 0x88, 0x0 }, + { 0x0, 0x20, 0x11, 0x88, 0x0 }, + { 0x0, 0x20, 0x11, 0x88, 0x0 }, + { 0x66, 0x61, 0x0, 0xCA, 0x34 }, + { 0x0, 0x20, 0x13, 0x8, 0x20 }, + { 0x0, 0x20, 0x13, 0x8, 0x20 }, + { 0x0, 0xA8, 0x28, 0x0, 0x30 }, + { 0x1B, 0x25, 0x8, 0x1, 0x0 }, + { 0x1B, 0x25, 0x8, 0x1, 0x0 }, + { 0x2, 0x20, 0x61, 0x40, 0x11 }, + { 0x2, 0x60, 0x1, 0x40, 0x18 }, + { 0xA, 0xC8, 0x0, 0x4, 0x3A }, + { 0xF, 0x25, 0x60, 0x10, 0x11 }, + { 0x8, 0x68, 0x0, 0x0, 0x39 }, + { 0x0, 0x0, 0x0, 0x0, 0x0 }, + { 0x0, 0x0, 0x0, 0x0, 0x0 }, + { 0x2, 0x20, 0x60, 0x0, 0x39 }, + { 0x10, 0x20, 0x0, 0x10, 0x0 }, + { 0x10, 0x20, 0x20, 0x30, 0x0 }, + { 0x12, 0x64, 0x4A, 0x40, 0x0 }, + { 0x4, 0x24, 0x0, 0x1, 0x14 }, + { 0x12, 0x26, 0x8, 0x25, 0x0 }, + { 0xE2, 0x21, 0x0, 0x40, 0x0 }, + { 0xE2, 0x21, 0x0, 0x40, 0x0 }, + { 0x19, 0x24, 0x20, 0x80, 0x10 }, + { 0x84, 0x2A, 0x0, 0x10, 0x14 }, + { 0x12, 0x30, 0x9, 0x1, 0x0 }, + { 0x4, 0x20, 0x81, 0x10, 0x4 }, + { 0xE, 0x61, 0x0, 0x0, 0x14 }, + { 0xF6, 0x21, 0x0, 0x4A, 0x10 }, + { 0xF6, 0x21, 0x0, 0x4A, 0x30 }, + { 0x12, 0x20, 0x8, 0x11, 0x2 }, + { 0x12, 0x20, 0x8, 0x11, 0x2 }, + { 0x8A, 0x20, 0xA, 0x1, 0x0 }, + { 0x8A, 0x20, 0xA, 0x1, 0x0 }, + { 0x1A, 0x20, 0xA, 0x1, 0x8 }, + { 0xB, 0x20, 0x20, 0x8A, 0x10 }, + { 0xB, 0x20, 0x20, 0x8A, 0x10 }, + { 0x1A, 0x0, 0x20, 0x8A, 0x10 }, + { 0xB, 0xA6, 0x21, 0x8A, 0x10 }, + { 0xE, 0xA8, 0x0, 0x14, 0x10 }, + { 0x2, 0x60, 0x0, 0x0, 0x3A }, + { 0x2, 0x60, 0x0, 0x0, 0x3A }, + { 0x9, 0x22, 0x24, 0x84, 0x10 }, + { 0x92, 0x20, 0xA, 0xB, 0x4 }, + { 0x92, 0x20, 0xA, 0x9B, 0x4 }, + { 0x8, 0x20, 0x60, 0x40, 0x11 }, + { 0x2, 0x60, 0x60, 0xC0, 0x38 }, + { 0x0, 0x0, 0x0, 0x0, 0x0 }, + { 0x2, 0x20, 0x81, 0x0, 0x30 }, + { 0x12, 0x20, 0x83, 0x4, 0x18 }, + { 0xA, 0x21, 0x61, 0x0, 0x21 }, + { 0x62, 0x21, 0x21, 0x20, 0x30 }, + { 0x62, 0x20, 0x1, 0x0, 0x22 }, + { 0x7A, 0x23, 0x41, 0x0, 0x0 }, + { 0x7A, 0x21, 0x43, 0x40, 0x0 }, + { 0x2, 0x22, 0x20, 0x20, 0x10 }, + { 0x2, 0x22, 0x0, 0x0, 0x12 }, + { 0xB, 0x2A, 0x20, 0x0, 0x10 }, + { 0x82, 0x62, 0x8, 0x1, 0x20 }, + { 0x82, 0x62, 0x8, 0x11, 0x20 }, + { 0xE6, 0x67, 0xC, 0x1, 0x20 }, + { 0xB, 0xAE, 0x68, 0x5, 0x11 }, + { 0x2, 0xAA, 0x68, 0x5, 0x12 }, + { 0x2, 0x20, 0x79, 0x49, 0x39 }, + { 0x26, 0x20, 0x12, 0x8, 0x10 }, + { 0x26, 0x20, 0x12, 0x8, 0x10 }, + { 0x26, 0x20, 0x16, 0x8, 0x10 }, + { 0x2, 0x20, 0x1, 0xC0, 0x12 }, + { 0x66, 0x20, 0x81, 0xC0, 0x12 }, + { 0xE6, 0x20, 0x81, 0xC0, 0x16 }, + { 0x9B, 0x24, 0xA, 0x1, 0x0 }, + { 0x9B, 0x25, 0xA, 0x1, 0x0 }, + { 0x9B, 0x25, 0xE, 0x1, 0x0 }, + { 0x2, 0x60, 0x0, 0x0, 0x28 }, + { 0x2, 0x60, 0x0, 0x0, 0x28 }, + { 0x1E, 0x20, 0x1, 0x4A, 0x11 }, + { 0x1E, 0x20, 0x1, 0x4A, 0x11 }, + { 0x0, 0x20, 0x0, 0x0, 0x0 }, + { 0x0, 0x0, 0x0, 0x10, 0x0 }, + { 0x0, 0xA8, 0x20, 0x4, 0x10 }, + { 0x0, 0x0, 0x0, 0x10, 0x0 }, + { 0x0, 0xA8, 0x20, 0x4, 0x10 }, + { 0x8, 0x20, 0x50, 0x8, 0x20 }, + { 0x6B, 0x21, 0x50, 0x8, 0x20 }, + { 0x6B, 0x21, 0x50, 0x8, 0x20 }, + { 0x10, 0x60, 0x10, 0x8, 0x0 }, + { 0x16, 0x60, 0x10, 0x8, 0x10 }, + { 0x1E, 0xE8, 0x10, 0x8C, 0x1C }, + { 0x2, 0xA8, 0x2, 0x4, 0x12 }, + { 0x2, 0xA8, 0x2, 0x4, 0x12 }, + { 0xA, 0xA8, 0x0, 0x4, 0x34 }, + { 0xA, 0xA8, 0x0, 0xE, 0x34 }, + { 0x6A, 0x21, 0x61, 0x0, 0x11 }, + { 0x6A, 0x21, 0x61, 0x0, 0x11 }, + { 0x6A, 0x21, 0x61, 0x0, 0x11 }, + { 0xA, 0x20, 0x20, 0x0, 0x10 }, + { 0xA, 0xA8, 0x20, 0x4, 0x10 }, + { 0x0, 0x20, 0x11, 0x8, 0x0 }, + { 0xA6, 0x20, 0x91, 0x8, 0x0 }, + { 0x6E, 0x21, 0x0, 0x2, 0x8 }, + { 0x6E, 0x1, 0x0, 0x2, 0x28 }, + { 0x6E, 0x21, 0x0, 0x2, 0x8 }, + { 0x6, 0x60, 0x0, 0x0, 0x0 }, + { 0x6, 0xE8, 0x0, 0x0, 0x30 }, + { 0x6, 0x60, 0x0, 0x0, 0x9 }, + { 0x7A, 0x21, 0x40, 0x0, 0x20 }, + { 0x7A, 0x21, 0x40, 0x0, 0x20 }, + { 0x7A, 0x21, 0x44, 0x0, 0x20 }, + { 0xE2, 0x21, 0x81, 0x0, 0x4 }, + { 0xE2, 0x23, 0x81, 0x0, 0x4 }, + { 0x1A, 0x20, 0x1, 0x0, 0x34 }, + { 0x72, 0x21, 0x8, 0x31, 0x0 }, + { 0x1A, 0x20, 0x41, 0x40, 0x18 }, + { 0x1A, 0x20, 0x41, 0x40, 0x18 }, + { 0x6E, 0x69, 0x60, 0x0, 0xD }, + { 0x2A, 0x23, 0x8, 0x30, 0xC }, + { 0x96, 0x62, 0xA, 0x31, 0x20 }, + { 0x96, 0x62, 0xA, 0x31, 0x20 }, + { 0xFE, 0x67, 0xE, 0x31, 0x20 }, + { 0x62, 0x21, 0xE1, 0x0, 0x11 }, + { 0x62, 0x21, 0xE1, 0x0, 0x11 }, + { 0x2, 0x20, 0x20, 0x20, 0x10 }, + { 0x2, 0x20, 0x20, 0x20, 0x10 }, + { 0x32, 0x20, 0x21, 0x60, 0x30 }, + { 0x32, 0x20, 0x21, 0x60, 0x30 }, + { 0x22, 0xA9, 0x61, 0x0, 0x10 }, + { 0x22, 0xA9, 0x41, 0x0, 0x10 }, + { 0x6, 0x20, 0x10, 0x8, 0x10 }, + { 0x72, 0x31, 0x0, 0xA, 0x0 }, + { 0x72, 0x31, 0x0, 0xA, 0x0 }, + { 0xF, 0x60, 0x48, 0x80, 0x30 }, + { 0xF, 0x60, 0x48, 0x80, 0x30 }, + { 0x19, 0x20, 0x0, 0x80, 0x0 }, + { 0x19, 0x22, 0x0, 0x80, 0x0 }, + { 0x12, 0x20, 0x0, 0x1, 0x2 }, + { 0x12, 0x22, 0x0, 0x1, 0x2 }, + { 0x12, 0x20, 0x0, 0x11, 0x2 }, + { 0x8, 0x20, 0x60, 0x80, 0x11 }, + { 0x6A, 0x21, 0x60, 0x80, 0x11 }, + { 0x7A, 0x21, 0x41, 0x40, 0x38 }, + { 0x6, 0x20, 0x0, 0x1, 0x0 }, + { 0x6, 0xA8, 0x4, 0x5, 0x12 }, + { 0x66, 0xA8, 0x4, 0x5, 0x12 }, + { 0x26, 0x60, 0x10, 0x8, 0x8 }, + { 0xA6, 0x60, 0x10, 0x8, 0x8 }, + { 0x2, 0xA8, 0x4, 0x4, 0x32 }, + { 0x2, 0xA8, 0x4, 0x4, 0x32 }, + { 0x7E, 0x21, 0x2, 0x40, 0x14 }, + { 0x6, 0x24, 0x0, 0x0, 0x1C }, + { 0x10, 0x22, 0x69, 0x1, 0x10 }, + { 0x10, 0x22, 0x69, 0x11, 0x10 }, + { 0xB, 0x24, 0x0, 0x81, 0x0 }, + { 0xB, 0x24, 0x40, 0x81, 0x0 }, + { 0x8E, 0x60, 0xA, 0x10, 0x4 }, + { 0x8F, 0x60, 0xA, 0x10, 0x14 }, + { 0x2, 0x20, 0x68, 0x1, 0x1 }, + { 0x2, 0x20, 0x68, 0x1, 0x1 }, + { 0x2, 0x30, 0x18, 0x9, 0x0 }, + { 0x2, 0x30, 0x18, 0x9, 0x0 }, + { 0x6, 0x20, 0x8, 0x11, 0x4 }, + { 0x86, 0x24, 0x8, 0x11, 0x4 }, + { 0x9, 0x20, 0x0, 0x0, 0x10 }, + { 0xB, 0x26, 0x0, 0x4, 0x10 }, + { 0x8, 0x28, 0x0, 0x40, 0x10 }, + { 0x7E, 0x25, 0x8, 0x40, 0x1D }, + { 0x8, 0x48, 0x0, 0x0, 0xD }, + { 0xA, 0x48, 0x0, 0x0, 0xD }, + { 0x8, 0x68, 0x0, 0x0, 0x9 }, + { 0x6A, 0x69, 0x0, 0x0, 0x9 }, + { 0x6, 0xA8, 0x14, 0x4, 0x0 }, + { 0x18, 0x20, 0x61, 0x40, 0x25 }, + { 0x8E, 0x60, 0x40, 0x80, 0x1C }, + { 0x0, 0x0, 0x0, 0x0, 0x0 }, + { 0x18, 0x60, 0x0, 0x0, 0x0 }, + { 0x18, 0x62, 0x20, 0x0, 0x0 }, + { 0x1B, 0x24, 0x20, 0x0, 0x0 }, + { 0x1B, 0x24, 0x20, 0x0, 0x0 }, + { 0x1F, 0x26, 0x20, 0x0, 0x0 }, + { 0x9, 0x20, 0x0, 0x10, 0x0 }, + { 0xB, 0x24, 0x0, 0x80, 0x18 }, + { 0xB, 0x24, 0x20, 0x80, 0x10 }, + { 0xB, 0x24, 0x8, 0x81, 0x0 }, + { 0x9, 0x20, 0x0, 0x80, 0x10 }, + { 0x6, 0x20, 0x44, 0x4, 0x0 }, + { 0x16, 0x20, 0x44, 0x14, 0x0 }, + { 0x16, 0xAC, 0x44, 0x4, 0x12 }, + { 0x0, 0x2, 0x40, 0x10, 0x0 }, + { 0x3E, 0x23, 0x60, 0x30, 0x11 }, + { 0x3E, 0x23, 0x60, 0x30, 0x11 }, + { 0xF2, 0x23, 0x8, 0x1, 0x0 }, + { 0xBA, 0x23, 0x28, 0x0, 0x0 }, + { 0xB2, 0x23, 0x8, 0x30, 0x0 }, + { 0xF, 0x20, 0x45, 0x44, 0x19 }, + { 0xF, 0x20, 0x45, 0x44, 0x11 }, + { 0xB, 0x26, 0x28, 0x0, 0x30 }, + { 0x76, 0x22, 0x8, 0x1, 0x30 }, + { 0xF, 0x26, 0xC, 0x5, 0x30 }, + { 0x6A, 0x23, 0x69, 0x50, 0x31 }, + { 0x6A, 0x21, 0x60, 0x0, 0x15 }, + { 0x82, 0x20, 0x10, 0x9, 0x0 }, + { 0x82, 0x20, 0x10, 0x9, 0x0 }, + { 0x82, 0x22, 0x14, 0x9, 0x0 }, + { 0x72, 0x20, 0x83, 0x2, 0x32 }, + { 0x72, 0x20, 0x83, 0x2, 0x12 }, + { 0x72, 0x20, 0x83, 0x2, 0x12 }, + { 0xB, 0x20, 0x20, 0x0, 0x0 }, + { 0xB, 0x20, 0x20, 0x0, 0x0 }, + { 0xF, 0x20, 0x20, 0x10, 0x4 }, + { 0x2, 0xA8, 0x2, 0x4, 0x12 }, + { 0x2, 0xA8, 0x2, 0x4, 0x12 }, + { 0x2, 0xA8, 0x2, 0x4, 0x12 }, + { 0x9E, 0x24, 0x0, 0x40, 0x10 }, + { 0x9F, 0x24, 0x0, 0x40, 0x10 }, + { 0x2, 0x20, 0x2, 0x0, 0x20 }, + { 0x6, 0x20, 0x2, 0x0, 0x24 }, + { 0x6, 0x20, 0x20, 0x20, 0x10 }, + { 0x6, 0x20, 0x20, 0x20, 0x10 }, + { 0x86, 0x20, 0x20, 0x20, 0x10 }, + { 0x2, 0x20, 0x10, 0x8, 0x30 }, + { 0x6, 0x20, 0x10, 0x8, 0x10 }, + { 0xE2, 0x62, 0x4A, 0x1, 0x20 }, + { 0xE2, 0x62, 0x4E, 0x1, 0x20 }, + { 0x2, 0x22, 0x8, 0x31, 0x0 }, + { 0x2, 0x22, 0xC, 0x31, 0x0 }, + { 0x0, 0x20, 0x0, 0x0, 0x0 }, + { 0x0, 0x20, 0x32, 0x8, 0x28 }, + { 0x2, 0xA8, 0x20, 0x4, 0x10 }, + { 0x2, 0xA8, 0x2, 0x0, 0x10 }, + { 0x6, 0xA8, 0x22, 0x0, 0x10 }, + { 0x32, 0x20, 0x1, 0x6A, 0x30 }, + { 0xB, 0x21, 0x0, 0x0, 0x10 }, + { 0xB, 0x25, 0x0, 0x0, 0x10 }, + { 0x10, 0x20, 0x11, 0x8, 0x0 }, + { 0x10, 0x20, 0x11, 0x8, 0x0 }, + { 0xB, 0x20, 0x8, 0x1, 0x0 }, + { 0xB, 0x20, 0x8, 0x1, 0x0 }, + { 0x66, 0x61, 0x0, 0xCA, 0x34 }, + { 0x1A, 0xE8, 0x0, 0x0, 0x1D }, + { 0x1A, 0xE8, 0x0, 0x0, 0x1D }, + { 0x2, 0x20, 0x3, 0xC0, 0x30 }, + { 0x66, 0x21, 0x3, 0xC0, 0x30 }, + { 0x8, 0x68, 0x0, 0x0, 0x39 }, + { 0x82, 0xC8, 0x0, 0x4, 0x3A }, + { 0x6, 0x20, 0x0, 0x40, 0x1C }, + { 0x16, 0x20, 0x0, 0x40, 0x1C }, + { 0x18, 0x20, 0x61, 0x40, 0x35 }, + { 0x6, 0x20, 0x0, 0x0, 0x18 }, + { 0x6, 0x20, 0x0, 0x0, 0x18 }, + { 0x10, 0x20, 0x28, 0x0, 0x1 }, + { 0x10, 0x22, 0x68, 0x0, 0x1 }, + { 0x10, 0x20, 0x1, 0x1, 0x28 }, + { 0x2, 0x20, 0x21, 0x0, 0x21 }, + { 0x1A, 0x20, 0x43, 0x40, 0x20 }, + { 0x2, 0xA8, 0x0, 0x4, 0x32 }, + { 0x8, 0x68, 0x0, 0x0, 0x29 }, + { 0x6, 0x22, 0x4, 0x5, 0x10 }, + { 0x6, 0x22, 0x4, 0x5, 0x10 }, + { 0x6, 0x26, 0x4, 0x5, 0x10 }, + { 0xFA, 0x21, 0x40, 0x4A, 0x20 }, + { 0x26, 0x21, 0xC1, 0x30, 0x10 }, + { 0x26, 0x21, 0xC1, 0x30, 0x10 }, + { 0x82, 0x20, 0x0, 0x1, 0x0 }, + { 0x82, 0x22, 0x0, 0x1, 0x0 }, + { 0x6, 0x24, 0x0, 0x0, 0x4 }, + { 0x6, 0x24, 0x0, 0x0, 0x4 }, + { 0x2E, 0x61, 0x81, 0x82, 0xC }, + { 0x2E, 0x61, 0x81, 0x82, 0xC }, + { 0x6, 0x30, 0x10, 0x8, 0x4 }, + { 0x9, 0xAC, 0x0, 0x84, 0x10 }, + { 0x9, 0xAC, 0x0, 0x84, 0x10 }, + { 0xB, 0xA0, 0x1, 0x80, 0x10 }, + { 0xA, 0x21, 0x10, 0x8, 0x0 }, + { 0xA, 0x21, 0x14, 0x8, 0x0 }, + { 0xE, 0x61, 0x0, 0x0, 0x14 }, + { 0x10, 0x22, 0x20, 0x30, 0x10 }, + { 0x7A, 0x25, 0x40, 0x0, 0x4 }, + { 0xFE, 0x67, 0xE, 0x1, 0x20 }, + { 0x2, 0x20, 0x18, 0x8, 0x4 }, + { 0x62, 0x21, 0x21, 0x20, 0x10 }, + { 0x62, 0x20, 0x1, 0x0, 0x2 }, + { 0x12, 0xA8, 0x6A, 0x44, 0x13 }, + { 0x2, 0xA8, 0x28, 0x0, 0x30 }, + { 0x6, 0x20, 0x11, 0x48, 0x14 }, + { 0xA, 0x24, 0x21, 0x40, 0x10 }, + { 0x6, 0x24, 0x0, 0x1, 0x14 }, + { 0x8E, 0x22, 0xA, 0x1, 0x4 }, + { 0x8, 0x20, 0x60, 0x40, 0x31 }, + { 0x66, 0x21, 0xE1, 0x0, 0x15 }, + { 0x72, 0x23, 0x8, 0x31, 0x0 }, + { 0x6A, 0x69, 0x0, 0x0, 0x9 }, + { 0x1A, 0x69, 0x20, 0x0, 0x9 }, + { 0x2, 0x68, 0x20, 0x0, 0x39 }, + { 0x62, 0x21, 0x61, 0x0, 0x15 }, + { 0x62, 0x21, 0x61, 0x0, 0x15 }, + { 0x62, 0x21, 0x61, 0x40, 0x35 }, + { 0x6, 0x22, 0xC, 0x35, 0x10 }, + { 0x7, 0x24, 0xC, 0x5, 0x10 }, + { 0x2, 0x22, 0x8, 0x11, 0x22 }, + { 0xEA, 0x23, 0x48, 0x1, 0x0 }, + { 0xE, 0xEE, 0xC, 0x5, 0x10 }, + { 0xE, 0x20, 0x61, 0x0, 0x11 }, + { 0xB, 0x20, 0x29, 0xC0, 0x34 }, + { 0xB, 0x20, 0x29, 0xC0, 0x34 }, + { 0xA, 0x68, 0x0, 0x40, 0x1D }, + { 0x2, 0x20, 0x52, 0x49, 0x10 }, + { 0xF, 0x2E, 0x6C, 0x55, 0x13 }, + { 0x82, 0x20, 0x60, 0x0, 0x1 }, + { 0x2, 0x20, 0x60, 0x10, 0x5 }, + { 0x2, 0x20, 0x60, 0x0, 0x15 }, + { 0x12, 0x20, 0x22, 0x1, 0x28 }, + { 0x0, 0x22, 0x22, 0x32, 0x28 }, + { 0xE, 0xEE, 0xC, 0x5, 0x10 }, + { 0x2, 0xA8, 0x50, 0x48, 0x10 }, + { 0x2, 0x68, 0x20, 0x0, 0x39 }, + { 0x2, 0x68, 0x20, 0x0, 0x39 }, + { 0x2, 0x68, 0x20, 0x0, 0x39 }, + { 0x2, 0x68, 0x20, 0x0, 0x39 }, + { 0x2, 0x68, 0x20, 0x0, 0x39 } +}; struct UnkStruct_ov5_021F7ED8_t { UnkStruct_0203CDB0 * unk_00; @@ -599,7 +647,7 @@ BOOL ov5_021F7C04(UnkStruct_0203E724 * param0); static BOOL ov5_021F7DE8(UnkStruct_0203E724 * param0); static u16 ov5_021F7A3C(u16 param0); static u16 ov5_021F7A4C(u16 param0); -static u8 ov5_021F7A74(Pokemon * param0, u8 param1); +static u8 ReadMovesetMaskByte(Pokemon * param0, u8 param1); static u16 ov5_021F7B60(Pokemon * param0, u16 param1); static void ov5_021F7E10(UnkStruct_ov5_021F7ED8 * param0, MessageLoader * param1); static void ov5_021F7E18(UnkStruct_0203CDB0 * param0, UnkStruct_ov5_021F7ED8 * param1, u8 param2, u8 param3, u8 param4, u8 param5, u16 * param6, UnkStruct_0200B358 * param7, Window * param8, MessageLoader * param9); @@ -612,53 +660,12 @@ static void ov5_021F819C(UnkStruct_0200112C * param0, u32 param1, u8 param2); static void ov5_021F81A8(SysTask * param0, void * param1); static void ov5_021F8250(UnkStruct_ov5_021F7ED8 * param0); -static const UnkStruct_ov5_02200CE4 Unk_ov5_02200CE4[] = { - {0x123, 0x2, 0x4, 0x2, 0x0, 0x0}, - {0xBD, 0x4, 0x4, 0x0, 0x0, 0x1}, - {0xD2, 0x0, 0x8, 0x0, 0x0, 0x0}, - {0xC4, 0x0, 0x6, 0x0, 0x2, 0x0}, - {0xCD, 0x4, 0x2, 0x0, 0x2, 0x1}, - {0x9, 0x2, 0x6, 0x0, 0x0, 0x0}, - {0x7, 0x2, 0x6, 0x0, 0x0, 0x0}, - {0x114, 0x8, 0x0, 0x0, 0x0, 0x1}, - {0x8, 0x2, 0x6, 0x0, 0x0, 0x0}, - {0x1BA, 0x6, 0x0, 0x2, 0x0, 0x1}, - {0x191, 0x6, 0x0, 0x0, 0x2, 0x1}, - {0x1D2, 0x0, 0x6, 0x0, 0x2, 0x0}, - {0x17C, 0x4, 0x0, 0x2, 0x2, 0x1}, - {0xAD, 0x2, 0x0, 0x4, 0x2, 0x2}, - {0xB4, 0x0, 0x0, 0x8, 0x0, 0x2}, - {0x13A, 0x2, 0x4, 0x0, 0x2, 0x0}, - {0x10E, 0x2, 0x0, 0x4, 0x2, 0x2}, - {0x11B, 0x4, 0x0, 0x4, 0x0, 0x1}, - {0xC8, 0x6, 0x0, 0x2, 0x0, 0x1}, - {0xF6, 0x6, 0x0, 0x0, 0x2, 0x1}, - {0xEB, 0x0, 0x0, 0x2, 0x6, 0x2}, - {0x144, 0x2, 0x2, 0x2, 0x2, 0x1}, - {0x1AC, 0x0, 0x4, 0x4, 0x0, 0x0}, - {0x19A, 0x2, 0x4, 0x0, 0x2, 0x0}, - {0x19E, 0x6, 0x0, 0x0, 0x2, 0x1}, - {0x1B9, 0x4, 0x2, 0x0, 0x2, 0x1}, - {0xEF, 0x6, 0x0, 0x0, 0x2, 0x1}, - {0x192, 0x4, 0x0, 0x0, 0x4, 0x1}, - {0x14E, 0x4, 0x2, 0x2, 0x0, 0x1}, - {0x189, 0x0, 0x2, 0x4, 0x2, 0x2}, - {0x183, 0x0, 0x0, 0x0, 0x8, 0x2}, - {0x154, 0x4, 0x0, 0x2, 0x2, 0x1}, - {0x10F, 0x0, 0x4, 0x4, 0x0, 0x0}, - {0x101, 0x4, 0x2, 0x0, 0x2, 0x1}, - {0x11A, 0x4, 0x4, 0x0, 0x0, 0x0}, - {0x185, 0x0, 0x6, 0x2, 0x0, 0x0}, - {0x81, 0x0, 0x2, 0x2, 0x4, 0x2}, - {0xFD, 0x0, 0x0, 0x6, 0x2, 0x2} -}; - BOOL ov5_021F77A8 (UnkStruct_0203E724 * param0) { u16 v0 = sub_0203F150(param0->unk_34, sub_0203E838(param0)); u16 * v1 = sub_0203F118(param0->unk_34, sub_0203E838(param0)); - UnkStruct_02026324 * v2 = sub_02027560(param0->unk_34->unk_0C); - + PokedexData * v2 = sub_02027560(param0->unk_34->unk_0C); + *v1 = sub_02026FE8(v2, v0); return 0; } @@ -696,17 +703,17 @@ BOOL ov5_021F789C (UnkStruct_0203E724 * param0) v5 = sub_0207D990(param0->unk_34->unk_0C); - for (v0 = 0; v0 < (NELEMS(Unk_ov5_02200CE4)); v0++) { - if (v6 == Unk_ov5_02200CE4[v0].unk_00) { - v1 = Unk_ov5_02200CE4[v0].unk_02; - v2 = Unk_ov5_02200CE4[v0].unk_03; - v3 = Unk_ov5_02200CE4[v0].unk_04; - v4 = Unk_ov5_02200CE4[v0].unk_05; + for (v0 = 0; v0 < (NELEMS(sTeachableMoves)); v0++) { + if (v6 == sTeachableMoves[v0].moveID) { + v1 = sTeachableMoves[v0].unk_02; + v2 = sTeachableMoves[v0].unk_03; + v3 = sTeachableMoves[v0].unk_04; + v4 = sTeachableMoves[v0].unk_05; break; } } - if (v0 == (NELEMS(Unk_ov5_02200CE4))) { + if (v0 == (NELEMS(sTeachableMoves))) { GF_ASSERT(0); *v7 = 0; return 0; @@ -750,17 +757,17 @@ BOOL ov5_021F7998 (UnkStruct_0203E724 * param0) v5 = sub_0207D990(param0->unk_34->unk_0C); - for (v0 = 0; v0 < (NELEMS(Unk_ov5_02200CE4)); v0++) { - if (v6 == Unk_ov5_02200CE4[v0].unk_00) { - v1 = Unk_ov5_02200CE4[v0].unk_02; - v2 = Unk_ov5_02200CE4[v0].unk_03; - v3 = Unk_ov5_02200CE4[v0].unk_04; - v4 = Unk_ov5_02200CE4[v0].unk_05; + for (v0 = 0; v0 < (NELEMS(sTeachableMoves)); v0++) { + if (v6 == sTeachableMoves[v0].moveID) { + v1 = sTeachableMoves[v0].unk_02; + v2 = sTeachableMoves[v0].unk_03; + v3 = sTeachableMoves[v0].unk_04; + v4 = sTeachableMoves[v0].unk_05; break; } } - if (v0 == (NELEMS(Unk_ov5_02200CE4))) { + if (v0 == (NELEMS(sTeachableMoves))) { GF_ASSERT(0); } @@ -774,15 +781,15 @@ BOOL ov5_021F7998 (UnkStruct_0203E724 * param0) static u16 ov5_021F7A3C (u16 param0) { - return Unk_ov5_02200CE4[param0].unk_00; + return sTeachableMoves[param0].moveID; } static u16 ov5_021F7A4C (u16 param0) { int v0; - for (v0 = 0; v0 < (NELEMS(Unk_ov5_02200CE4)); v0++) { - if (Unk_ov5_02200CE4[v0].unk_00 == param0) { + for (v0 = 0; v0 < (NELEMS(sTeachableMoves)); v0++) { + if (sTeachableMoves[v0].moveID == param0) { return v0; } } @@ -791,58 +798,55 @@ static u16 ov5_021F7A4C (u16 param0) return 0; } -static u8 ov5_021F7A74 (Pokemon * param0, u8 param1) +static u8 ReadMovesetMaskByte (Pokemon * pokemon, u8 offset) { - u16 v0; - u32 v1, v2; - - v2 = Pokemon_GetValue(param0, MON_DATA_SPECIES, NULL); - v1 = Pokemon_GetValue(param0, MON_DATA_FORM, NULL); - v0 = v2; - - switch (v2) { - case 386: - if (v1 == 1) { - v0 = 494; - } else if (v1 == 2) { - v0 = 495; - } else if (v1 == 3) { - v0 = 496; + u32 species = Pokemon_GetValue(pokemon, MON_DATA_SPECIES, NULL); + u32 form = Pokemon_GetValue(pokemon, MON_DATA_FORM, NULL); + u16 moveset = species; + + switch (species) { + case SPECIES_DEOXYS: + if (form == 1) { + moveset = MOVESET_FORM_DEOXYS_ATTACK; + } else if (form == 2) { + moveset = MOVESET_FORM_DEOXYS_DEFENSE; + } else if (form == 3) { + moveset = MOVESET_FORM_DEOXYS_SPEED; } break; - case 413: - if (v1 == 1) { - v0 = 497; - } else if (v1 == 2) { - v0 = 498; + case SPECIES_WORMADAM: + if (form == 1) { + moveset = MOVESET_FORM_WORMADAM_SANDY; + } else if (form == 2) { + moveset = MOVESET_FORM_WORMADAM_TRASH; } break; - case 487: - if (v1 == 1) { - v0 = 499; + case SPECIES_GIRATINA: + if (form == 1) { + moveset = MOVESET_FORM_GIRATINA_ORIGIN; } break; - case 492: - if (v1 == 1) { - v0 = 500; + case SPECIES_SHAYMIN: + if (form == 1) { + moveset = MOVESET_FORM_SHAYMIN_SKY; } break; - case 479: - if (v1 == 1) { - v0 = 501; - } else if (v1 == 2) { - v0 = 502; - } else if (v1 == 3) { - v0 = 503; - } else if (v1 == 4) { - v0 = 504; - } else if (v1 == 5) { - v0 = 505; + case SPECIES_ROTOM: + if (form == 1) { + moveset = MOVESET_FORM_ROTOM_HEAT; + } else if (form == 2) { + moveset = MOVESET_FORM_ROTOM_WASH; + } else if (form == 3) { + moveset = MOVESET_FORM_ROTOM_FROST; + } else if (form == 4) { + moveset = MOVESET_FORM_ROTOM_FAN; + } else if (form == 5) { + moveset = MOVESET_FORM_ROTOM_MOW; } break; } - return Unk_ov5_02200EAC[v0 - 1].unk_00[param1]; + return sTeachableMovesets[moveset - 1].maskData[offset]; } static u16 ov5_021F7B60 (Pokemon * param0, u16 param1) @@ -858,15 +862,15 @@ static u16 ov5_021F7B60 (Pokemon * param0, u16 param1) v6[v2] = Pokemon_GetValue(param0, MON_DATA_MOVE1 + v2, NULL); } - for (v0 = 0; v0 < 5; v0++) { - v3 = ov5_021F7A74(param0, v0); + for (v0 = 0; v0 < MOVESET_MASK_SIZE; v0++) { + v3 = ReadMovesetMaskByte(param0, v0); for (v1 = 0; v1 < 8; v1++) { v4 = ((v3 >> v1) & 0x1); - if ((v4 == 1) && (param1 == Unk_ov5_02200CE4[v0 * 8 + v1].unk_08)) { + if ((v4 == 1) && (param1 == sTeachableMoves[v0 * 8 + v1].shardColor)) { for (v2 = 0; v2 < 4; v2++) { - if (v6[v2] == Unk_ov5_02200CE4[v0 * 8 + v1].unk_00) { + if (v6[v2] == sTeachableMoves[v0 * 8 + v1].moveID) { break; } } @@ -891,7 +895,7 @@ BOOL ov5_021F7C04 (UnkStruct_0203E724 * param0) UnkStruct_0203CDB0 * v9 = param0->unk_34; UnkStruct_ov5_021F7ED8 * v10; u16 v11[4]; - u16 v12[(NELEMS(Unk_ov5_02200CE4))]; + u16 v12[(NELEMS(sTeachableMoves))]; UnkStruct_0200B358 ** v13 = sub_0203F098(v9, 15); u16 v14 = inline_02049538(param0); u16 v15 = inline_02049538(param0); @@ -906,7 +910,7 @@ BOOL ov5_021F7C04 (UnkStruct_0203E724 * param0) v7 = MessageLoader_Init(0, 26, 647, 32); v10 = ov5_021F7ED8(v9, 20, 1, 0, 1, sub_0203F118(v9, v16), *v13, sub_0203F098(param0->unk_34, 1), v7); - for (v2 = 0; v2 < (NELEMS(Unk_ov5_02200CE4)); v2++) { + for (v2 = 0; v2 < (NELEMS(sTeachableMoves)); v2++) { v12[v2] = 0; } @@ -917,29 +921,29 @@ BOOL ov5_021F7C04 (UnkStruct_0203E724 * param0) v11[v5] = Pokemon_GetValue(v6, (54 + v5), NULL); } - for (v2 = 0; v2 < 5; v2++) { - v0 = ov5_021F7A74(v6, v2); + for (v2 = 0; v2 < MOVESET_MASK_SIZE; v2++) { + v0 = ReadMovesetMaskByte(v6, v2); for (v4 = 0; v4 < 8; v4++) { v1 = ((v0 >> v4) & 0x1); - if ((v1 == 1) && (v15 == Unk_ov5_02200CE4[v2 * 8 + v4].unk_08)) { + if ((v1 == 1) && (v15 == sTeachableMoves[v2 * 8 + v4].shardColor)) { for (v5 = 0; v5 < 4; v5++) { - if (v11[v5] == Unk_ov5_02200CE4[v2 * 8 + v4].unk_00) { + if (v11[v5] == sTeachableMoves[v2 * 8 + v4].moveID) { break; } } if (v5 == 4) { - v12[v3] = Unk_ov5_02200CE4[v2 * 8 + v4].unk_00; + v12[v3] = sTeachableMoves[v2 * 8 + v4].moveID; v3++; } } } } } else { - for (v2 = 0; v2 < (NELEMS(Unk_ov5_02200CE4)); v2++) { - if (v15 == Unk_ov5_02200CE4[v2].unk_08) { + for (v2 = 0; v2 < (NELEMS(sTeachableMoves)); v2++) { + if (v15 == sTeachableMoves[v2].shardColor) { v12[v3] = ov5_021F7A3C(v2); v3++; } @@ -1000,13 +1004,13 @@ static void ov5_021F7E18 (UnkStruct_0203CDB0 * param0, UnkStruct_ov5_021F7ED8 * param1->unk_C0 = 3; param1->unk_27E = param4; - for (v0 = 0; v0 < ((NELEMS(Unk_ov5_02200CE4)) + 1); v0++) { + for (v0 = 0; v0 < ((NELEMS(sTeachableMoves)) + 1); v0++) { param1->unk_F8[v0].unk_00 = NULL; param1->unk_F8[v0].unk_04 = 0; param1->unk_230[v0] = 0xff; } - for (v0 = 0; v0 < ((NELEMS(Unk_ov5_02200CE4)) + 1); v0++) { + for (v0 = 0; v0 < ((NELEMS(sTeachableMoves)) + 1); v0++) { param1->unk_1C[v0] = Strbuf_Init((40 * 2), 4); } @@ -1173,7 +1177,7 @@ static void ov5_021F8250 (UnkStruct_ov5_021F7ED8 * param0) Window_Clear(param0->unk_D0.unk_0C, 0); BGL_DeleteWindow(¶m0->unk_08); - for (v0 = 0; v0 < ((NELEMS(Unk_ov5_02200CE4)) + 1); v0++) { + for (v0 = 0; v0 < ((NELEMS(sTeachableMoves)) + 1); v0++) { Strbuf_Free(param0->unk_1C[v0]); } @@ -1198,7 +1202,7 @@ BOOL ov5_021F82B8 (UnkStruct_0203E724 * param0) u16 * v6 = inline_0204FCAC(param0); v5 = ov5_021F7A4C(v5); - *v2 = ov5_021DD250(v0, v3, v4, v6, *v1, Unk_ov5_02200CE4[v5].unk_02, Unk_ov5_02200CE4[v5].unk_03, Unk_ov5_02200CE4[v5].unk_04, Unk_ov5_02200CE4[v5].unk_05); + *v2 = ov5_021DD250(v0, v3, v4, v6, *v1, sTeachableMoves[v5].unk_02, sTeachableMoves[v5].unk_03, sTeachableMoves[v5].unk_04, sTeachableMoves[v5].unk_05); return 0; } diff --git a/src/overlay006/ov6_02246A30.c b/src/overlay006/ov6_02246A30.c index 60508d616b..63bb65db6e 100644 --- a/src/overlay006/ov6_02246A30.c +++ b/src/overlay006/ov6_02246A30.c @@ -4,7 +4,7 @@ #include "inlines.h" #include "trainer_info.h" -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "struct_decls/struct_020507E4_decl.h" #include "struct_defs/struct_0203CDB0.h" @@ -144,13 +144,13 @@ static BOOL ov6_02246AB0 (UnkStruct_0203CDB0 * param0) static BOOL ov6_02246AC8 (UnkStruct_0203CDB0 * param0) { - UnkStruct_02026324 * v0 = sub_02027560(param0->unk_0C); + PokedexData * v0 = sub_02027560(param0->unk_0C); return sub_02026F0C(v0); } static BOOL ov6_02246AD8 (UnkStruct_0203CDB0 * param0) { - UnkStruct_02026324 * v0 = sub_02027560(param0->unk_0C); + PokedexData * v0 = sub_02027560(param0->unk_0C); return sub_02027520(v0); } diff --git a/src/overlay016/battle_display.c b/src/overlay016/battle_display.c index 61235a18e4..7b75daca60 100644 --- a/src/overlay016/battle_display.c +++ b/src/overlay016/battle_display.c @@ -132,6 +132,7 @@ #include "unk_02018340.h" #include "unk_0201D670.h" #include "trainer_info.h" +#include "constants/species.h" #include "pokemon.h" #include "move_table.h" #include "party.h" @@ -4421,7 +4422,7 @@ static void ov16_0226232C (SysTask * param0, void * param1) ov16_02264730(v0->unk_00); } - if (Pokemon_GetValue(v3, MON_DATA_SPECIES_EGG, NULL) == 494) { + if (Pokemon_GetValue(v3, MON_DATA_SPECIES_EGG, NULL) == SPECIES_EGG) { ov16_02264730(v0->unk_00); } } diff --git a/src/overlay016/battle_io.c b/src/overlay016/battle_io.c index 6636784baa..ceaa37077a 100644 --- a/src/overlay016/battle_io.c +++ b/src/overlay016/battle_io.c @@ -10,6 +10,7 @@ #include "battle/battle_context.h" #include "pokemon.h" +#include "constants/species.h" #include "struct_defs/struct_0207A81C.h" #include "struct_defs/battle_system.h" #include "battle/battle_context.h" @@ -539,7 +540,7 @@ void BattleIO_SetCommandSelection (BattleSystem *battleSys, BattleContext *battl v8 = Party_GetPokemonBySlotIndex(v7, battleCtx->partyOrder[v2][v1]); v5 = Pokemon_GetValue(v8, MON_DATA_SPECIES_EGG, NULL); - if ((v5) && (v5 != 494)) { + if ((v5) && (v5 != SPECIES_EGG)) { if (Pokemon_GetValue(v8, MON_DATA_CURRENT_HP, NULL)) { if (Pokemon_GetValue(v8, MON_DATA_STATUS_CONDITION, NULL)) { v0.unk_08[0][v6] = 3; @@ -574,7 +575,7 @@ void BattleIO_SetCommandSelection (BattleSystem *battleSys, BattleContext *battl v8 = Party_GetPokemonBySlotIndex(v7, battleCtx->partyOrder[v2][v1]); v5 = Pokemon_GetValue(v8, MON_DATA_SPECIES_EGG, NULL); - if ((v5) && (v5 != 494)) { + if ((v5) && (v5 != SPECIES_EGG)) { if (Pokemon_GetValue(v8, MON_DATA_CURRENT_HP, NULL)) { if (Pokemon_GetValue(v8, MON_DATA_STATUS_CONDITION, NULL)) { v0.unk_08[1][v6] = 3; @@ -602,7 +603,7 @@ void BattleIO_SetCommandSelection (BattleSystem *battleSys, BattleContext *battl v8 = Party_GetPokemonBySlotIndex(v7, battleCtx->partyOrder[v2][v1]); v5 = Pokemon_GetValue(v8, MON_DATA_SPECIES_EGG, NULL); - if ((v5) && (v5 != 494)) { + if ((v5) && (v5 != SPECIES_EGG)) { if (Pokemon_GetValue(v8, MON_DATA_CURRENT_HP, NULL)) { if (Pokemon_GetValue(v8, MON_DATA_STATUS_CONDITION, NULL)) { v0.unk_08[1][v6] = 3; @@ -625,7 +626,7 @@ void BattleIO_SetCommandSelection (BattleSystem *battleSys, BattleContext *battl v8 = Party_GetPokemonBySlotIndex(v7, battleCtx->partyOrder[v2][v1]); v5 = Pokemon_GetValue(v8, MON_DATA_SPECIES_EGG, NULL); - if ((v5) && (v5 != 494)) { + if ((v5) && (v5 != SPECIES_EGG)) { if (Pokemon_GetValue(v8, MON_DATA_CURRENT_HP, NULL)) { if (Pokemon_GetValue(v8, MON_DATA_STATUS_CONDITION, NULL)) { v0.unk_08[1][v6] = 3; diff --git a/src/overlay016/ov16_0223DF00.c b/src/overlay016/ov16_0223DF00.c index f34f705f4d..e7fc3afb24 100644 --- a/src/overlay016/ov16_0223DF00.c +++ b/src/overlay016/ov16_0223DF00.c @@ -22,7 +22,7 @@ #include "struct_decls/struct_02018340_decl.h" #include "strbuf.h" #include "trainer_info.h" -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "struct_defs/chatot_cry.h" #include "struct_decls/struct_020797DC_decl.h" #include "struct_decls/struct_party_decl.h" @@ -100,7 +100,7 @@ UnkStruct_0200C440 * ov16_0223E054(BattleSystem * param0); MessageLoader * BattleSystem_MessageLoader(BattleSystem * param0); MessageLoader * ov16_0223E060(BattleSystem * param0); PaletteData * BattleSystem_PaletteSys(BattleSystem * param0); -UnkStruct_02026324 * ov16_0223E068(BattleSystem * param0); +PokedexData * ov16_0223E068(BattleSystem * param0); u8 * ov16_0223E06C(BattleSystem * param0); u8 * ov16_0223E074(BattleSystem * param0); u16 * ov16_0223E080(BattleSystem * param0); @@ -366,7 +366,7 @@ PaletteData * BattleSystem_PaletteSys (BattleSystem * param0) return param0->unk_28; } -UnkStruct_02026324 * ov16_0223E068 (BattleSystem * param0) +PokedexData * ov16_0223E068 (BattleSystem * param0) { return param0->pokedex; } diff --git a/src/overlay019/ov19_021D0D80.c b/src/overlay019/ov19_021D0D80.c index 8833e6bd5d..bc429d423e 100644 --- a/src/overlay019/ov19_021D0D80.c +++ b/src/overlay019/ov19_021D0D80.c @@ -6,6 +6,8 @@ #include "inlines.h" #include "core_sys.h" +#include "constants/species.h" + #include "struct_decls/struct_020067E8_decl.h" #include "message.h" #include "struct_decls/struct_0200B358_decl.h" @@ -4294,7 +4296,7 @@ static void ov19_021D5BE8 (UnkStruct_ov19_021D4DF0 * param0, u16 param1, UnkStru { int v2 = BoxPokemon_GetValue(v0->unk_00, MON_DATA_SPECIES, NULL); - if (v2 == 493) { + if (v2 == SPECIES_ARCEUS) { BoxPokemon_SetArceusForm(v0->unk_00); v0->unk_0C = BoxPokemon_GetValue(v0->unk_00, MON_DATA_TYPE_1, NULL); v0->unk_0D = BoxPokemon_GetValue(v0->unk_00, MON_DATA_TYPE_2, NULL); diff --git a/src/overlay021/ov21_021D3208.c b/src/overlay021/ov21_021D3208.c index fe2f378c87..71298591f9 100644 --- a/src/overlay021/ov21_021D3208.c +++ b/src/overlay021/ov21_021D3208.c @@ -4,7 +4,7 @@ #include "core_sys.h" #include "strbuf.h" -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "overlay021/struct_ov21_021D3208.h" #include "overlay021/struct_ov21_021D3320.h" @@ -20,17 +20,17 @@ #include "unk_02098988.h" #include "overlay021/ov21_021D3208.h" -static void ov21_021D39A4(u16 * param0, int * param1, const UnkStruct_02026324 * param2, const u16 * param3, int param4); -static void ov21_021D39E4(u16 * param0, int * param1, const u16 * param2, int param3, const u16 * param4, int param5, BOOL param6, const UnkStruct_02026324 * param7); -static void ov21_021D3A60(UnkStruct_ov21_021D3A60 * param0, const UnkStruct_02026324 * param1, const u16 * param2, int param3); +static void ov21_021D39A4(u16 * param0, int * param1, const PokedexData * param2, const u16 * param3, int param4); +static void ov21_021D39E4(u16 * param0, int * param1, const u16 * param2, int param3, const u16 * param4, int param5, BOOL param6, const PokedexData * param7); +static void ov21_021D3A60(UnkStruct_ov21_021D3A60 * param0, const PokedexData * param1, const u16 * param2, int param3); static void ov21_021D3AB8(UnkStruct_ov21_021D3A60 * param0, const u16 * param1, int param2); static void ov21_021D3B28(UnkStruct_ov21_021D3A60 * param0); static void ov21_021D3FA8(UnkStruct_ov21_021D3A60 * param0, int * param1, int * param2); static u16 * ov21_021D3B64(int param0, int param1, int * param2); -static void ov21_021D3B98(int param0, u16 * param1, int * param2, const u16 * param3, int param4, int param5, const UnkStruct_02026324 * param6); -static void ov21_021D3C48(int param0, u16 * param1, int * param2, const u16 * param3, int param4, int param5, const UnkStruct_02026324 * param6); -static void ov21_021D3D2C(int param0, u16 * param1, int * param2, const u16 * param3, int param4, int param5, const UnkStruct_02026324 * param6); -static void ov21_021D3E80(int param0, u16 * param1, int * param2, const u16 * param3, int param4, int param5, const UnkStruct_02026324 * param6); +static void ov21_021D3B98(int param0, u16 * param1, int * param2, const u16 * param3, int param4, int param5, const PokedexData * param6); +static void ov21_021D3C48(int param0, u16 * param1, int * param2, const u16 * param3, int param4, int param5, const PokedexData * param6); +static void ov21_021D3D2C(int param0, u16 * param1, int * param2, const u16 * param3, int param4, int param5, const PokedexData * param6); +static void ov21_021D3E80(int param0, u16 * param1, int * param2, const u16 * param3, int param4, int param5, const PokedexData * param6); void ov21_021D3208 (UnkStruct_ov21_021D3320 * param0, UnkStruct_ov21_021D3208 * param1, int param2) { @@ -242,16 +242,16 @@ BOOL ov21_021D3464 (UnkStruct_ov21_021D3320 * param0, int param1, int param2, in int v5; BOOL v6; - v0 = Heap_AllocFromHeapAtEnd(param7, sizeof(u16) * 493); + v0 = Heap_AllocFromHeapAtEnd(param7, sizeof(u16) * NATIONAL_DEX_COUNT); GF_ASSERT(v0); - memset(v0, 0, sizeof(u16) * 493); + memset(v0, 0, sizeof(u16) * NATIONAL_DEX_COUNT); v1 = 0; - v2 = Heap_AllocFromHeapAtEnd(param7, sizeof(u16) * 493); + v2 = Heap_AllocFromHeapAtEnd(param7, sizeof(u16) * NATIONAL_DEX_COUNT); GF_ASSERT(v2); - memset(v2, 0, sizeof(u16) * 493); + memset(v2, 0, sizeof(u16) * NATIONAL_DEX_COUNT); v3 = 0; @@ -603,7 +603,7 @@ u32 ov21_021D3998 (const UnkStruct_ov21_021D3320 * param0) return param0->unk_1758; } -static void ov21_021D39A4 (u16 * param0, int * param1, const UnkStruct_02026324 * param2, const u16 * param3, int param4) +static void ov21_021D39A4 (u16 * param0, int * param1, const PokedexData * param2, const u16 * param3, int param4) { int v0; @@ -617,7 +617,7 @@ static void ov21_021D39A4 (u16 * param0, int * param1, const UnkStruct_02026324 } } -static void ov21_021D39E4 (u16 * param0, int * param1, const u16 * param2, int param3, const u16 * param4, int param5, BOOL param6, const UnkStruct_02026324 * param7) +static void ov21_021D39E4 (u16 * param0, int * param1, const u16 * param2, int param3, const u16 * param4, int param5, BOOL param6, const PokedexData * param7) { int v0, v1; @@ -643,7 +643,7 @@ static void ov21_021D39E4 (u16 * param0, int * param1, const u16 * param2, int p } } -static void ov21_021D3A60 (UnkStruct_ov21_021D3A60 * param0, const UnkStruct_02026324 * param1, const u16 * param2, int param3) +static void ov21_021D3A60 (UnkStruct_ov21_021D3A60 * param0, const PokedexData * param1, const u16 * param2, int param3) { int v0; @@ -676,7 +676,7 @@ static void ov21_021D3AB8 (UnkStruct_ov21_021D3A60 * param0, const u16 * param1, v1++; param0->unk_1728++; } else { - param0->unk_F70[param0->unk_1728] = (493 + 1); + param0->unk_F70[param0->unk_1728] = (NATIONAL_DEX_COUNT + 1); param0->unk_1728++; } } @@ -710,7 +710,7 @@ static u16 * ov21_021D3B64 (int param0, int param1, int * param2) return v1; } -static void ov21_021D3B98 (int param0, u16 * param1, int * param2, const u16 * param3, int param4, int param5, const UnkStruct_02026324 * param6) +static void ov21_021D3B98 (int param0, u16 * param1, int * param2, const u16 * param3, int param4, int param5, const PokedexData * param6) { u16 * v0; int v1; @@ -750,7 +750,7 @@ static void ov21_021D3B98 (int param0, u16 * param1, int * param2, const u16 * p } } -static void ov21_021D3C48 (int param0, u16 * param1, int * param2, const u16 * param3, int param4, int param5, const UnkStruct_02026324 * param6) +static void ov21_021D3C48 (int param0, u16 * param1, int * param2, const u16 * param3, int param4, int param5, const PokedexData * param6) { u16 * v0; int v1; @@ -800,7 +800,7 @@ static void ov21_021D3C48 (int param0, u16 * param1, int * param2, const u16 * p } } -static void ov21_021D3D2C (int param0, u16 * param1, int * param2, const u16 * param3, int param4, int param5, const UnkStruct_02026324 * param6) +static void ov21_021D3D2C (int param0, u16 * param1, int * param2, const u16 * param3, int param4, int param5, const PokedexData * param6) { u16 * v0; int v1; @@ -874,7 +874,7 @@ static void ov21_021D3D2C (int param0, u16 * param1, int * param2, const u16 * p } } -static void ov21_021D3E80 (int param0, u16 * param1, int * param2, const u16 * param3, int param4, int param5, const UnkStruct_02026324 * param6) +static void ov21_021D3E80 (int param0, u16 * param1, int * param2, const u16 * param3, int param4, int param5, const PokedexData * param6) { u16 * v0; int v1; diff --git a/src/overlay021/ov21_021D5600.c b/src/overlay021/ov21_021D5600.c index a45c3981f5..b321f6a3f2 100644 --- a/src/overlay021/ov21_021D5600.c +++ b/src/overlay021/ov21_021D5600.c @@ -9,6 +9,8 @@ #include "strbuf.h" #include "unk_020986CC.h" #include "overlay021/ov21_021D5600.h" +#include "constants/species.h" +#include "constants/narc.h" static const u8 Unk_ov21_021E9CC4[6] = { 0x1, @@ -21,7 +23,7 @@ static const u8 Unk_ov21_021E9CC4[6] = { static inline int inline_ov21_021D5764(int param0); static inline BOOL inline_ov21_021D5764_1(int param0, int param1); -static Strbuf* ov21_021D5724(int param0, int param1, int param2); +static Strbuf* LoadMessage(int param0, int param1, int param2); static void ov21_021D5764(int param0, int param1, int * param2, int * param3, int * param4); void ov21_021D5600 (Strbuf *param0) @@ -59,7 +61,7 @@ Strbuf* ov21_021D561C (int param0, int param1, int param2) v2 = v0; } - return ov21_021D5724(v3, v2, param2); + return LoadMessage(v3, v2, param2); } Strbuf* ov21_021D566C (int param0, int param1, int param2) @@ -87,7 +89,7 @@ Strbuf* ov21_021D566C (int param0, int param1, int param2) v2 = v0; } - return ov21_021D5724(v3, v2, param2); + return LoadMessage(v3, v2, param2); } Strbuf* ov21_021D56BC (int param0, int param1, int param2, int param3) @@ -117,31 +119,31 @@ Strbuf* ov21_021D56BC (int param0, int param1, int param2, int param3) v2 = v0 * 1 + param2; } - return ov21_021D5724(v3, v2, param3); + return LoadMessage(v3, v2, param3); } static inline BOOL inline_ov21_021D5764_1 (int param0, int param1) { - if ((param0 > 493) && (param1 != 6)) { + if ((param0 > NATIONAL_DEX_COUNT) && (param1 != 6)) { return 0; } return 1; } -static Strbuf* ov21_021D5724 (int param0, int param1, int param2) +static Strbuf* LoadMessage (int bankID, int entryID, int heapID) { - MessageLoader * v0 = MessageLoader_Init(1, 26, param0, param2); + MessageLoader *messageLoader = MessageLoader_Init(1, NARC_INDEX_MSGDATA__PL_MSG, bankID, heapID); - if (v0) { - Strbuf* v1 = Strbuf_Init(256, param2); + if (messageLoader) { + Strbuf* strbuf = Strbuf_Init(256, heapID); - if (v1) { - MessageLoader_GetStrbuf(v0, param1, v1); + if (strbuf) { + MessageLoader_GetStrbuf(messageLoader, entryID, strbuf); } - MessageLoader_Free(v0); - return v1; + MessageLoader_Free(messageLoader); + return strbuf; } return NULL; diff --git a/src/overlay021/ov21_021D5AEC.c b/src/overlay021/ov21_021D5AEC.c index ea774653f4..294eb5a3a6 100644 --- a/src/overlay021/ov21_021D5AEC.c +++ b/src/overlay021/ov21_021D5AEC.c @@ -581,7 +581,7 @@ static BOOL ov21_021D601C (UnkStruct_ov21_021D5B68 * param0, UnkStruct_ov21_021D if (param0->unk_2C) { int v0 = ov21_021D3898(param0->unk_04); - if (ov21_021D38B0(param0->unk_04, v0) != (493 + 1)) { + if (ov21_021D38B0(param0->unk_04, v0) != (NATIONAL_DEX_COUNT + 1)) { ov21_021D7464(param1, param0); Sound_PlayEffect(1501); return 1; @@ -905,7 +905,7 @@ static void ov21_021D67EC (UnkStruct_ov21_021D71A8 * param0, UnkStruct_ov21_021D if ((v1 >= 0) && (v1 < v3)) { v7 = ov21_021D38B0(param2->unk_04, v1); - if (v7 != (493 + 1)) { + if (v7 != (NATIONAL_DEX_COUNT + 1)) { v6 = ov21_021D37DC(param2->unk_04, v7); v5 = ov21_021D16D8(param1, param2->unk_04, param3, v6->unk_00); v4.unk_04 = v5; @@ -933,7 +933,7 @@ static void ov21_021D68C8 (UnkStruct_ov21_021D71A8 * param0, UnkStruct_ov21_021D v0 = ov21_021D375C(param2->unk_04); v2 = ov21_021D37DC(param2->unk_04, v0); - if (ov21_021D38B0(param2->unk_04, v1) == (493 + 1)) { + if (ov21_021D38B0(param2->unk_04, v1) == (NATIONAL_DEX_COUNT + 1)) { ov21_021D217C(param1, 0); if (param0->unk_7C) { @@ -1110,7 +1110,7 @@ static void ov21_021D6AE4 (UnkStruct_ov21_021D71A8 * param0, const UnkStruct_ov2 if ((v5 >= 0) && (v5 < v7)) { v11 = ov21_021D38B0(param1->unk_04, v5); - if (v11 != (493 + 1)) { + if (v11 != (NATIONAL_DEX_COUNT + 1)) { v8 = ov21_021D37DC(param1->unk_04, v11); if (v8->unk_04 == 2) { @@ -1246,7 +1246,7 @@ static void ov21_021D6CC8 (UnkStruct_ov21_021D71A8 * param0, UnkStruct_ov21_021D if ((v3 < v1) && (v3 >= 0)) { v4 = ov21_021D38B0(param2->unk_04, v3); - if (v4 != (493 + 1)) { + if (v4 != (NATIONAL_DEX_COUNT + 1)) { ov21_021D6D78(param0, param1, param2, param3, v2, v4); } else { ov21_021D6DF4(param0, param1, param3, v2, v3 + 1); diff --git a/src/overlay028/ov28_022561C0.c b/src/overlay028/ov28_022561C0.c index b697cb4b87..6e4061bca0 100644 --- a/src/overlay028/ov28_022561C0.c +++ b/src/overlay028/ov28_022561C0.c @@ -4,7 +4,7 @@ #include "struct_decls/struct_02018340_decl.h" #include "struct_decls/sys_task.h" -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "overlay025/struct_ov25_0225424C_decl.h" #include "overlay025/struct_ov25_02255B34_decl.h" #include "overlay028/struct_ov28_0225697C_decl.h" @@ -13,6 +13,7 @@ #include "struct_defs/union_02022594_020225E0.h" #include "overlay028/struct_ov28_0225697C_1.h" +#include "constants/species.h" #include "unk_0200D9E8.h" #include "heap.h" #include "unk_0202631C.h" @@ -631,8 +632,8 @@ static void ov28_02256914 (UnkStruct_ov28_02256210 * param0, const UnkStruct_ov2 { s64 v0 = ov28_02257468(param1); - if ((v0 > 0) && (v0 <= 493)) { - UnkStruct_02026324 * v1; + if ((v0 > 0) && (v0 <= NATIONAL_DEX_COUNT)) { + PokedexData * v1; u16 v2; v1 = sub_02027560(ov25_02254544(param0->unk_10)); @@ -643,7 +644,7 @@ static void ov28_02256914 (UnkStruct_ov28_02256210 * param0, const UnkStruct_ov2 v2 = Pokemon_NationalDexNumber((u16)v0); } - if (((v2 > 0) && (v2 <= 493)) && sub_02026FE8(v1, v2)) { + if (((v2 > 0) && (v2 <= NATIONAL_DEX_COUNT)) && sub_02026FE8(v1, v2)) { ov25_02254444(v2, 0); } } diff --git a/src/overlay061/ov61_0222AE60.c b/src/overlay061/ov61_0222AE60.c index ddadbd9430..f563cce44f 100644 --- a/src/overlay061/ov61_0222AE60.c +++ b/src/overlay061/ov61_0222AE60.c @@ -18,6 +18,7 @@ #include "unk_020298BC.h" #include "unk_020797C8.h" #include "overlay061/ov61_0222AE60.h" +#include "constants/species.h" void ov61_0222AE60 (SaveData * param0, const UnkStruct_02029C68 * param1, UnkStruct_ov61_0222AE80 * param2) { @@ -47,7 +48,7 @@ void ov61_0222AE88 (SaveData * param0, const PCBoxes * param1, int param2, UnkSt param3->unk_64[v1] = sub_02079C08(param1, param2, v1, 0, NULL); param3->unk_DC[v1] = sub_02079C08(param1, param2, v1, 7, NULL); - if (sub_02079C08(param1, param2, v1, 174, NULL) == 494) { + if (sub_02079C08(param1, param2, v1, 174, NULL) == SPECIES_EGG) { param3->unk_154 |= 1 << v1; } diff --git a/src/overlay062/ov62_02237D24.c b/src/overlay062/ov62_02237D24.c index 92fcc89941..7b861c7307 100644 --- a/src/overlay062/ov62_02237D24.c +++ b/src/overlay062/ov62_02237D24.c @@ -6,7 +6,7 @@ #include "struct_decls/struct_0200B358_decl.h" #include "strbuf.h" #include "struct_decls/struct_02023FCC_decl.h" -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "struct_decls/struct_02029C68_decl.h" #include "overlay022/struct_ov22_0225B1BC_decl.h" @@ -1646,7 +1646,7 @@ static BOOL ov62_02239984 (UnkStruct_0208C06C * param0, int param1) int v7; int v8 = 0; BOOL v9; - UnkStruct_02026324 * v10 = sub_02027560(param0->unk_830); + PokedexData * v10 = sub_02027560(param0->unk_830); for (v7 = v3; v7 < v4; v7++) { v9 = sub_02026FE8(v10, v1[v7]); @@ -1690,7 +1690,7 @@ static void ov62_02239A0C (UnkStruct_0208C06C * param0, int param1) int v5; int v6 = 0; BOOL v7; - UnkStruct_02026324 * v8 = sub_02027560(param0->unk_830); + PokedexData * v8 = sub_02027560(param0->unk_830); v4->unk_1D4.unk_00 = 0; diff --git a/src/overlay062/ov62_02239D60.c b/src/overlay062/ov62_02239D60.c index 2f07a5ef7f..d62a914f08 100644 --- a/src/overlay062/ov62_02239D60.c +++ b/src/overlay062/ov62_02239D60.c @@ -57,6 +57,7 @@ #include "overlay062/ov62_02231690.h" #include "overlay062/ov62_02239D60.h" #include "overlay062/ov62_0224112C.h" +#include "constants/species.h" typedef struct { int unk_00; @@ -1057,7 +1058,7 @@ static void ov62_0223ADC0 (UnkStruct_0208C06C * param0, int param1) v2 = Strbuf_Init(255, 102); if (ov62_0223ADB0(v0->unk_04.unk_154, (1 << v0->unk_1B0)) == 1) { - v4 = 494; + v4 = SPECIES_EGG; } MessageLoader_GetSpeciesName(v4, 102, v5); @@ -1200,7 +1201,7 @@ static void ov62_0223B050 (UnkStruct_0208C06C * param0) v6 = 0; } - v7 = 494; + v7 = SPECIES_EGG; } v1 = PokemonPersonalData_FromMonSpecies(v7, 102); diff --git a/src/overlay062/ov62_02241204.c b/src/overlay062/ov62_02241204.c index 95e65a50a2..817b0484f4 100644 --- a/src/overlay062/ov62_02241204.c +++ b/src/overlay062/ov62_02241204.c @@ -9,7 +9,7 @@ #include "struct_decls/struct_0200B358_decl.h" #include "strbuf.h" #include "struct_decls/struct_02023FCC_decl.h" -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "struct_decls/struct_0202F41C_decl.h" #include "overlay062/const_ov62_022491F0.h" @@ -1521,7 +1521,7 @@ static BOOL ov62_02242748 (UnkStruct_0208C06C * param0, int param1) int v7; int v8 = 0; BOOL v9; - UnkStruct_02026324 * v10 = sub_02027560(param0->unk_830); + PokedexData * v10 = sub_02027560(param0->unk_830); for (v7 = v3; v7 < v4; v7++) { v9 = sub_02026FE8(v10, v1[v7]); @@ -1565,7 +1565,7 @@ static void ov62_022427D0 (UnkStruct_0208C06C * param0, int param1) int v5; int v6 = 0; BOOL v7; - UnkStruct_02026324 * v8 = sub_02027560(param0->unk_830); + PokedexData * v8 = sub_02027560(param0->unk_830); v4->unk_4C8.unk_00 = 0; diff --git a/src/overlay065/ov65_0222DCE0.c b/src/overlay065/ov65_0222DCE0.c index 9963495e85..f4128f110a 100644 --- a/src/overlay065/ov65_0222DCE0.c +++ b/src/overlay065/ov65_0222DCE0.c @@ -15,7 +15,7 @@ #include "struct_decls/struct_02018340_decl.h" #include "strbuf.h" #include "trainer_info.h" -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "struct_decls/struct_0202B370_decl.h" #include "struct_decls/struct_0202B628_decl.h" #include "struct_decls/struct_0202C878_decl.h" @@ -1808,7 +1808,7 @@ static int ov65_0222F490 (UnkStruct_ov65_0222EBE0 * param0, int param1) static void ov65_0222F4C4 (UnkStruct_ov65_0222EBE0 * param0, int param1) { TrainerInfo * v0 = sub_02025E38(param0->unk_160); - UnkStruct_02026324 * v1 = sub_02027560(param0->unk_160); + PokedexData * v1 = sub_02027560(param0->unk_160); Party * v2 = Party_GetFromSavedata(param0->unk_160); UnkStruct_0202C878 * v3 = sub_0202C878(param0->unk_160); int v4, v5; diff --git a/src/overlay066/ov66_0222DDF0.c b/src/overlay066/ov66_0222DDF0.c index f96724b6cd..920c656100 100644 --- a/src/overlay066/ov66_0222DDF0.c +++ b/src/overlay066/ov66_0222DDF0.c @@ -11,7 +11,7 @@ #include "struct_decls/struct_02014FB0_decl.h" #include "strbuf.h" #include "trainer_info.h" -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "struct_decls/struct_0202B628_decl.h" #include "struct_decls/struct_0202C878_decl.h" #include "struct_decls/struct_0202CD88_decl.h" @@ -62,6 +62,7 @@ #include "unk_0202CD50.h" #include "unk_02030EA4.h" #include "pokemon.h" +#include "constants/species.h" #include "party.h" #include "unk_0207E060.h" #include "overlay066/ov66_0222DDF0.h" @@ -2316,7 +2317,7 @@ static void ov66_0222F7C8 (UnkStruct_ov66_0222F6C4 * param0, SaveData * param1, TrainerInfo * v0; Party * v1; UnkStruct_0202C878 * v2; - UnkStruct_02026324 * v3; + PokedexData * v3; UnkStruct_02055BA8 * v4; { @@ -2354,7 +2355,7 @@ static void ov66_0222F7C8 (UnkStruct_ov66_0222F6C4 * param0, SaveData * param1, param0->unk_20.unk_2C[v8] = Pokemon_GetValue(v6, MON_DATA_FORM, NULL); param0->unk_20.unk_32[v8] = Pokemon_GetValue(v6, MON_DATA_IS_EGG, NULL); } else { - param0->unk_20.unk_20[v8] = 495; + param0->unk_20.unk_20[v8] = SPECIES_BAD_EGG; } } } diff --git a/src/overlay088/ov88_0223B140.c b/src/overlay088/ov88_0223B140.c index dc92c78a86..730b1b80e7 100644 --- a/src/overlay088/ov88_0223B140.c +++ b/src/overlay088/ov88_0223B140.c @@ -4,6 +4,8 @@ #include "inlines.h" #include "core_sys.h" +#include "constants/species.h" + #include "struct_decls/struct_020067E8_decl.h" #include "struct_decls/struct_02006C24_decl.h" #include "message.h" @@ -2502,7 +2504,7 @@ static void ov88_0223E694 (Party * param0, Party * param1, int param2, int param Pokemon_Copy(Party_GetPokemonBySlotIndex(param0, param2), v0); Pokemon_Copy(Party_GetPokemonBySlotIndex(param1, param3), v1); - if (Pokemon_GetValue(v1, MON_DATA_SPECIES, NULL) == 493) { + if (Pokemon_GetValue(v1, MON_DATA_SPECIES, NULL) == SPECIES_ARCEUS) { if (Pokemon_GetValue(v1, MON_DATA_FATEFUL_ENCOUNTER, NULL) || ((Pokemon_GetValue(v1, MON_DATA_HATCH_LOCATION, NULL) == 86) && (Pokemon_GetValue(v1, MON_DATA_FATEFUL_ENCOUNTER, NULL) == 0))) { UnkStruct_020507E4 * v2 = sub_020507E4(param4->unk_10); diff --git a/src/overlay094/ov94_022414B8.c b/src/overlay094/ov94_022414B8.c index eac801025c..cd331c1d5a 100644 --- a/src/overlay094/ov94_022414B8.c +++ b/src/overlay094/ov94_022414B8.c @@ -4,13 +4,15 @@ #include "core_sys.h" +#include "constants/species.h" + #include "struct_decls/struct_0200112C_decl.h" #include "message.h" #include "struct_decls/struct_0200B358_decl.h" #include "struct_decls/struct_02013A04_decl.h" #include "struct_decls/struct_02018340_decl.h" #include "strbuf.h" -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "pokemon.h" #include "overlay094/const_ov94_02245FD8.h" @@ -87,7 +89,7 @@ static int ov94_02242040(UnkStruct_ov94_0223FD4C * param0); static int ov94_02242068(UnkStruct_ov94_0223FD4C * param0); static int ov94_0224208C(UnkStruct_ov94_0223FD4C * param0); static void ov94_02242668(UnkStruct_ov94_0223BA88 * param0, UnkStruct_ov94_0223FD4C * param1); -static int ov94_02242718(ResourceMetadata ** param0, MessageLoader * param1, MessageLoader * param2, u16 * param3, u8 * param4, int param5, int param6, UnkStruct_02026324 * param7); +static int ov94_02242718(ResourceMetadata ** param0, MessageLoader * param1, MessageLoader * param2, u16 * param3, u8 * param4, int param5, int param6, PokedexData * param7); static u32 ov94_022421E8(int param0, u32 param1); static int (* Unk_ov94_0224695C[])(UnkStruct_ov94_0223FD4C *) = { @@ -1028,15 +1030,15 @@ u8 * ov94_02242548 (int param0) { u32 v0, v1, v2; u16 * v3; - u8 * v4 = Heap_AllocFromHeap(62, 493 + 1); + u8 *v4 = Heap_AllocFromHeap(62, NATIONAL_DEX_COUNT + 1); - MI_CpuClearFast(v4, 493 + 1); + MI_CpuClearFast(v4, NATIONAL_DEX_COUNT + 1); v3 = sub_02007068(75, 12, 0, param0, 0, &v0); v1 = v0 / (sizeof(u16)); for (v2 = 0; v2 < v1; v2++) { - if (v3[v2] < 493 + 1) { + if (v3[v2] < NATIONAL_DEX_COUNT + 1) { v4[v3[v2]] = 1; } } @@ -1133,7 +1135,7 @@ static u16 Unk_ov94_02246928[] = { 0x1ED }; -static int ov94_02242718 (ResourceMetadata ** param0, MessageLoader * param1, MessageLoader * param2, u16 * param3, u8 * param4, int param5, int param6, UnkStruct_02026324 * param7) +static int ov94_02242718 (ResourceMetadata ** param0, MessageLoader * param1, MessageLoader * param2, u16 * param3, u8 * param4, int param5, int param6, PokedexData * param7) { int v0, v1, v2 = 0; int v3 = Unk_ov94_02246928[param6 + 1] - Unk_ov94_02246928[param6]; @@ -1176,7 +1178,7 @@ static int ov94_02242718 (ResourceMetadata ** param0, MessageLoader * param1, Me return v2 + 1; } -UnkStruct_0200112C * ov94_022427C0 (UnkStruct_ov94_0223FD4C * param0, ResourceMetadata ** param1, Window * param2, MessageLoader * param3, MessageLoader * param4, UnkStruct_ov94_0223FD4C_sub3 * param5, UnkStruct_02026324 * param6) +UnkStruct_0200112C * ov94_022427C0 (UnkStruct_ov94_0223FD4C * param0, ResourceMetadata ** param1, Window * param2, MessageLoader * param3, MessageLoader * param4, UnkStruct_ov94_0223FD4C_sub3 * param5, PokedexData * param6) { UnkStruct_ov84_02240FA8 v0; int v1, v2, v3; diff --git a/src/overlay094/ov94_02242AD0.c b/src/overlay094/ov94_02242AD0.c index 8a73303d5a..d300a0806a 100644 --- a/src/overlay094/ov94_02242AD0.c +++ b/src/overlay094/ov94_02242AD0.c @@ -3,6 +3,7 @@ #include #include "inlines.h" +#include "constants/species.h" #include "struct_decls/struct_02018340_decl.h" #include "struct_decls/struct_0202440C_decl.h" @@ -1288,7 +1289,7 @@ static void ov94_02243BC4 (UnkStruct_ov94_0223FD4C * param0, Pokemon * param1, i if (param3) { u8 v1 = 70; - if (Pokemon_GetValue(param1, MON_DATA_SPECIES, NULL) == 493) { + if (Pokemon_GetValue(param1, MON_DATA_SPECIES, NULL) == SPECIES_ARCEUS) { if (Pokemon_GetValue(param1, MON_DATA_FATEFUL_ENCOUNTER, NULL) || ((Pokemon_GetValue(param1, MON_DATA_HATCH_LOCATION, NULL) == 86) && (Pokemon_GetValue(param1, MON_DATA_FATEFUL_ENCOUNTER, NULL) == 0))) { UnkStruct_020507E4 * v2 = sub_020507E4(param0->unk_00->unk_20); @@ -1335,7 +1336,7 @@ static void ov94_02243CE4 (UnkStruct_ov94_0223FD4C * param0, Pokemon * param1, i param2 = 0; } - if (Pokemon_GetValue(param1, MON_DATA_SPECIES, NULL) == 493) { + if (Pokemon_GetValue(param1, MON_DATA_SPECIES, NULL) == SPECIES_ARCEUS) { if (Pokemon_GetValue(param1, MON_DATA_FATEFUL_ENCOUNTER, NULL) || ((Pokemon_GetValue(param1, MON_DATA_HATCH_LOCATION, NULL) == 86) && (Pokemon_GetValue(param1, MON_DATA_FATEFUL_ENCOUNTER, NULL) == 0))) { UnkStruct_020507E4 * v0 = sub_020507E4(param0->unk_00->unk_20); diff --git a/src/overlay097/ov97_0222AE60.c b/src/overlay097/ov97_0222AE60.c index 800f9fcc09..54cc1e5041 100644 --- a/src/overlay097/ov97_0222AE60.c +++ b/src/overlay097/ov97_0222AE60.c @@ -12,7 +12,7 @@ #include "struct_decls/struct_0202442C_decl.h" #include "struct_decls/struct_02025E5C_decl.h" #include "trainer_info.h" -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "struct_decls/struct_021C0794_decl.h" #include "overlay097/const_ov97_0223D674.h" @@ -96,7 +96,7 @@ typedef struct { typedef struct { BGL * unk_00; SaveData * unk_04; - UnkStruct_02026324 * unk_08; + PokedexData * unk_08; TrainerInfo * unk_0C; UnkStruct_02025E5C * unk_10; MysteryGift * unk_14; diff --git a/src/overlay097/ov97_0222C174.c b/src/overlay097/ov97_0222C174.c index 7641bbbf29..b406386ccc 100644 --- a/src/overlay097/ov97_0222C174.c +++ b/src/overlay097/ov97_0222C174.c @@ -13,7 +13,7 @@ #include "strbuf.h" #include "struct_decls/struct_0202442C_decl.h" #include "trainer_info.h" -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "struct_decls/struct_021C0794_decl.h" #include "overlay077/const_ov77_021D742C.h" @@ -364,7 +364,7 @@ typedef struct { int unk_00; BGL * unk_04; SaveData * unk_08; - UnkStruct_02026324 * unk_0C; + PokedexData * unk_0C; TrainerInfo * unk_10; AnimationControlFlags * unk_14; Window unk_18; diff --git a/src/overlay097/ov97_02237694.c b/src/overlay097/ov97_02237694.c index 718e738d94..043b3489b9 100644 --- a/src/overlay097/ov97_02237694.c +++ b/src/overlay097/ov97_02237694.c @@ -52,6 +52,7 @@ #include "strbuf.h" #include "unk_020244AC.h" #include "unk_02033200.h" +#include "constants/species.h" #include "pokemon.h" #include "item.h" #include "overlay097/ov97_02237694.h" @@ -628,10 +629,10 @@ static void ov97_02237FF4 (UnkStruct_ov97_0223F550 * param0, int param1, UnkStru ov97_02237EF8(param0->unk_26C, v0, Pokemon_GetValue(v0, MON_DATA_SPECIES, 0), Pokemon_GetValue(v0, MON_DATA_FORM, 0), param0->unk_278, ¶m0->unk_EF8); break; case 2: - ov97_02237EF8(param0->unk_26C, v0, 494, 0, param0->unk_278, ¶m0->unk_EF8); + ov97_02237EF8(param0->unk_26C, v0, SPECIES_EGG, 0, param0->unk_278, ¶m0->unk_EF8); break; case 7: - ov97_02237EF8(param0->unk_26C, v0, 494, 1, param0->unk_278, ¶m0->unk_EF8); + ov97_02237EF8(param0->unk_26C, v0, SPECIES_EGG, 1, param0->unk_278, ¶m0->unk_EF8); break; } } diff --git a/src/overlay113/ov113_0225C700.c b/src/overlay113/ov113_0225C700.c index 318f7ac63c..37488c0f07 100644 --- a/src/overlay113/ov113_0225C700.c +++ b/src/overlay113/ov113_0225C700.c @@ -4,6 +4,8 @@ #include "core_sys.h" +#include "constants/species.h" + #include "struct_decls/struct_02002F38_decl.h" #include "struct_decls/struct_020067E8_decl.h" #include "struct_decls/struct_02006C24_decl.h" @@ -1099,7 +1101,7 @@ static void ov113_0225D7CC (UnkStruct_ov113_0225DBCC * param0) v3 = sub_0200316C(param0->unk_0C, 2); for (v0 = 0; v0 < 6; v0++) { - if ((param0->unk_8D8[v0].unk_02 == 0) || (param0->unk_8D8[v0].unk_02 > 493)) { + if ((param0->unk_8D8[v0].unk_02 == 0) || (param0->unk_8D8[v0].unk_02 > NATIONAL_DEX_COUNT)) { sub_0200D3F4(param0->unk_924[v0], 0); sub_0200D3F4(param0->unk_93C[v0], 0); sub_0200D3F4(param0->unk_954[v0], 0); @@ -1135,7 +1137,7 @@ static BOOL ov113_0225D938 (int param0, int param1, CellActorData * param2, NARC NNSG2dCharacterData * v3; u8 * v4, * v5; - if ((param0 == 0) || (param0 > 493)) { + if ((param0 == 0) || (param0 > NATIONAL_DEX_COUNT)) { return 0; } diff --git a/src/overlay113/ov113_0225E368.c b/src/overlay113/ov113_0225E368.c index 05c09893d2..cb2c9579d5 100644 --- a/src/overlay113/ov113_0225E368.c +++ b/src/overlay113/ov113_0225E368.c @@ -1,6 +1,8 @@ #include #include +#include "constants/species.h" + #include "struct_decls/struct_02006C24_decl.h" #include "struct_decls/struct_020203AC_decl.h" #include "overlay113/struct_ov113_0225DBCC_decl.h" @@ -553,7 +555,7 @@ static UnkStruct_ov113_0225E6B8 * ov113_0225E6B8 (UnkStruct_ov113_0225DBCC * par v0->unk_240_24 = 0xff; v0->unk_00 = *param2; - if (v0->unk_00.unk_02 > 493) { + if (v0->unk_00.unk_02 > NATIONAL_DEX_COUNT) { GF_ASSERT(0); v0->unk_00.unk_02 = 132; } diff --git a/src/overlay113/ov113_02260620.c b/src/overlay113/ov113_02260620.c index 8d38b90820..552912cec7 100644 --- a/src/overlay113/ov113_02260620.c +++ b/src/overlay113/ov113_02260620.c @@ -14,6 +14,7 @@ #include "overlay113/struct_ov113_02260D90.h" #include "message.h" +#include "constants/species.h" #include "unk_0200B358.h" #include "heap.h" #include "unk_02018340.h" @@ -36,7 +37,9 @@ __attribute__((aligned(4))) static const u16 Unk_ov113_02260D6C[][2] = { { 0x3A80, 0x5400 }, { 0x2D4A, 0x5651 } }; -static const UnkStruct_ov113_02260D90 Unk_ov113_02260D90[] = { + +// footprint data, but apparently only affects overworld +static const UnkStruct_ov113_02260D90 Unk_ov113_02260D90[NATIONAL_DEX_COUNT + 1] = { { 0x0, 0x0 }, { 0x1, 0x1 }, { 0x1, 0x1 }, @@ -630,7 +633,7 @@ int ov113_02260748 (UnkStruct_ov113_02260818 * param0, int param1) v0 = sub_02022664(Unk_ov113_02260D4C); if (v0 < 6) { - if ((param1 != v0) && (param0[v0].unk_02 != 0) && (param0[v0].unk_02 <= 493)) { + if ((param1 != v0) && (param0[v0].unk_02 != 0) && (param0[v0].unk_02 <= NATIONAL_DEX_COUNT)) { v1 = v0; } } else if (v0 == 6) { @@ -648,7 +651,7 @@ BOOL ov113_02260788 (int param0, int param1, BOOL param2) return 0; } - if ((param0 == 493) && (param2 == 0)) { + if ((param0 == SPECIES_ARCEUS) && (param2 == 0)) { return 0; } diff --git a/src/pokemon.c b/src/pokemon.c index 68b2f8993c..47518368d9 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -3817,7 +3817,7 @@ u16 Pokemon_NationalDexNumber(u16 sinnohDexNumber) { u16 result = 0; - if (sinnohDexNumber <= 210) { + if (sinnohDexNumber <= LOCAL_DEX_COUNT) { NARC_ReadFromMemberByIndexPair(&result, NARC_INDEX_POKETOOL__SHINZUKAN, 0, sinnohDexNumber * 2, 2); } diff --git a/src/unk_02002F38.c b/src/unk_02002F38.c index edf970ac8b..08be3ea4bc 100644 --- a/src/unk_02002F38.c +++ b/src/unk_02002F38.c @@ -87,12 +87,12 @@ void sub_02002FBC (PaletteData * param0, const void * param1, int param2, u16 pa MI_CpuCopy16(param1, (void *)¶m0->unk_00[param2].unk_04[param3], (u32)param4); } -void sub_02002FEC (PaletteData * param0, u32 param1, u32 param2, u32 param3, int param4, u32 param5, u16 param6, u16 param7) +void sub_02002FEC (PaletteData * param0, u32 bankID, u32 memberIndex, u32 param3, int param4, u32 param5, u16 param6, u16 param7) { NNSG2dPaletteData * v0; void * v1; - v1 = sub_02006F88(param1, param2, &v0, param3); + v1 = sub_02006F88(bankID, memberIndex, &v0, param3); GF_ASSERT(v1 != NULL); if (param5 == 0) { @@ -105,9 +105,9 @@ void sub_02002FEC (PaletteData * param0, u32 param1, u32 param2, u32 param3, int Heap_FreeToHeap(v1); } -void PaletteSys_LoadPalette (PaletteData * param0, u32 param1, u32 param2, u32 param3, int param4, u32 param5, u16 param6) +void PaletteSys_LoadPalette (PaletteData * param0, u32 bankID, u32 memberIndex, u32 param3, int param4, u32 param5, u16 param6) { - sub_02002FEC(param0, param1, param2, param3, param4, param5, param6, 0); + sub_02002FEC(param0, bankID, memberIndex, param3, param4, param5, param6, 0); } void sub_02003070 (PaletteData * param0, int param1, u16 param2, u32 param3) diff --git a/src/unk_02005474.c b/src/unk_02005474.c index bbfe614b9e..8ee6cd12ef 100644 --- a/src/unk_02005474.c +++ b/src/unk_02005474.c @@ -48,7 +48,7 @@ BOOL sub_02005844(u16 param0, u8 param1); BOOL sub_0200590C(u16 param0, u8 param1, u8 param2); void sub_0200592C(int param0); int sub_0200598C(void); -BOOL Sound_PlayPokemonCry(int param0, u16 param1, int param2, int param3, int param4, u8 param5); +BOOL Sound_PlayPokemonCry(int param0, u16 species, int param2, int param3, int param4, u8 param5); void sub_02005E64(int param0, int param1); static void sub_02005EB0(SysTask * param0, void * param1); void sub_02005F24(void); @@ -415,11 +415,11 @@ BOOL sub_02005844 (u16 param0, u8 param1) v0 = param0; if (sub_02006038(v0, param1) == 1) { - v0 = 494; + v0 = SPECIES_EGG; } - if (v0 != 494) { - if ((v0 > 495) || (v0 == 0)) { + if (v0 != SPECIES_EGG) { + if ((v0 > MAX_SPECIES) || (v0 == 0)) { v0 = 1; } } @@ -501,7 +501,7 @@ int sub_0200598C (void) return sub_02004B04(0); } -BOOL Sound_PlayPokemonCry (int param0, u16 param1, int param2, int param3, int param4, u8 param5) +BOOL Sound_PlayPokemonCry (int param0, u16 species, int param2, int param3, int param4, u8 param5) { int v0, v1; u16 v2; @@ -517,13 +517,13 @@ BOOL Sound_PlayPokemonCry (int param0, u16 param1, int param2, int param3, int p v5 = 0; v6 = 0; v7 = 0; - v2 = param1; + v2 = species; if (sub_02006038(v2, param5) == 1) { - v2 = 494; + v2 = SPECIES_EGG; } - if (v2 != 494) { + if (v2 != SPECIES_EGG) { if ((v2 > MAX_SPECIES) || (v2 == 0)) { v2 = SPECIES_BULBASAUR; } @@ -816,7 +816,7 @@ void Sound_PlayDelayedPokemonCry (int param0, u16 param1, int param2, int param3 v0 = param1; if (sub_02006038(v0, param6) == 1) { - v0 = 494; + v0 = SPECIES_EGG; } if (v0 == 0) { @@ -846,7 +846,7 @@ static BOOL sub_02006038 (u16 param0, u8 param1) } } - if (param0 == 494) { + if (param0 == SPECIES_EGG) { return 1; } diff --git a/src/unk_02014D38.c b/src/unk_02014D38.c index b8f97112ac..46de5924c3 100644 --- a/src/unk_02014D38.c +++ b/src/unk_02014D38.c @@ -4,6 +4,7 @@ #include "struct_decls/struct_021C0794_decl.h" #include "unk_02006E3C.h" +#include "narc.h" #include "message.h" #include "unk_02014D38.h" #include "heap.h" @@ -181,7 +182,7 @@ void sub_02014DB8 (u16 param0, Strbuf *param1) sub_02014E4C(param0, &v0, &v1); v0 = Unk_020E550C[v0]; - MessageBank_GetStrbufFromNARC(26, v0, v1, 0, param1); + MessageBank_GetStrbufFromNARC(NARC_INDEX_MSGDATA__PL_MSG, v0, v1, 0, param1); } else { Strbuf_Clear(param1); } diff --git a/src/unk_0202631C.c b/src/unk_0202631C.c index 6a4b1c1169..51b40443c9 100644 --- a/src/unk_0202631C.c +++ b/src/unk_0202631C.c @@ -10,58 +10,66 @@ #include "unk_020244AC.h" #include "unk_0202631C.h" #include "pokemon.h" +#include "constants/species.h" #include "unk_020986CC.h" -typedef struct UnkStruct_02026324_t { - u32 unk_00; - u32 unk_04[16]; - u32 unk_44[16]; - u32 unk_84[2][16]; +// These u32[16] arrays store pokedex seen/caught info as bit flags +// Therefore 32 * 16 = 512 pokedex slots. These need to be bumped up if it's pushed past this number +// ReadBit and WriteBit may need to be changed as well, to handle a larger range of bits + +#define UNOWN_COUNT 28 +#define BYTE_SLOTS 16 + +typedef struct PokedexData { + u32 magic; + u32 caughtPokemon[BYTE_SLOTS]; + u32 seenPokemon[BYTE_SLOTS]; + u32 recordedGenders[2][BYTE_SLOTS]; u32 unk_104; u8 unk_108; u8 unk_109; u8 unk_10A; u8 unk_10B; - u8 unk_10C[28]; - u8 unk_128[496]; - u8 unk_318; + u8 unk_10C[UNOWN_COUNT]; + u8 recordedLanguages[MAX_SPECIES + 1]; + u8 canDetectForms; u8 unk_319; - u8 unk_31A; - u8 unk_31B; + u8 pokedexObtained; + u8 nationalDexObtained; u32 unk_31C; u8 unk_320; u8 unk_321; u16 unk_322; -} UnkStruct_02026324; +} PokedexData; int Pokedex_SaveSize (void) { - return sizeof(UnkStruct_02026324); + return sizeof(PokedexData); } -UnkStruct_02026324 * sub_02026324 (u32 param0) +PokedexData * sub_02026324 (u32 param0) { - UnkStruct_02026324 * v0; + PokedexData * v0; - v0 = Heap_AllocFromHeap(param0, sizeof(UnkStruct_02026324)); + v0 = Heap_AllocFromHeap(param0, sizeof(PokedexData)); Pokedex_Init(v0); return v0; } -void sub_02026338 (const UnkStruct_02026324 * param0, UnkStruct_02026324 * param1) +void sub_02026338 (const PokedexData * param0, PokedexData * param1) { - MI_CpuCopy8(param0, param1, sizeof(UnkStruct_02026324)); + MI_CpuCopy8(param0, param1, sizeof(PokedexData)); } -static inline void inline_02026DD0 (const UnkStruct_02026324 * param0) +static inline void CheckPokedexIntegrity (const PokedexData * param0) { - GF_ASSERT(param0->unk_00 == 3203386110); + GF_ASSERT(param0->magic == 3203386110); } static BOOL sub_02026344 (u16 param0) { - if ((param0 == 0) || (param0 > 493)) { + if ((param0 == 0) || (param0 > NATIONAL_DEX_COUNT)) { GF_ASSERT(0); return 1; } else { @@ -69,16 +77,16 @@ static BOOL sub_02026344 (u16 param0) } } -static inline BOOL inline_02026464 (const u8 * param0, u16 param1) +static inline BOOL ReadBit (const u8 * array, u16 bitNumber) { - param1--; - return 0 != (param0[param1 >> 3] & (1 << (param1 & 7))); + bitNumber--; + return 0 != (array[bitNumber >> 3] & (1 << (bitNumber & 7))); } -static inline void inline_0202736C_sub (u8 * param0, u16 param1) +static inline void WriteBit (u8 * array, u16 bitNumber) { - param1--; - param0[param1 >> 3] |= 1 << (param1 & 7); + bitNumber--; + array[bitNumber >> 3] |= 1 << (bitNumber & 7); } static inline void inline_02026360 (u8 * param0, u8 param1, u16 param2) @@ -104,26 +112,26 @@ static inline void inline_020267B8 (u8 * param0, u8 param1, u16 param2) param0[param2 >> 2] |= param1 << ((param2 & 3) * 2); } -static inline void inline_0202736C (UnkStruct_02026324 * param0, u16 param1) +static inline void inline_0202736C (PokedexData * param0, u16 param1) { - inline_0202736C_sub((u8 *)param0->unk_44, param1); + WriteBit((u8 *)param0->seenPokemon, param1); } -static inline void inline_sub_0202736C_1 (UnkStruct_02026324 * param0, u16 param1) +static inline void inline_sub_0202736C_1 (PokedexData * param0, u16 param1) { - inline_0202736C_sub((u8 *)param0->unk_04, param1); + WriteBit((u8 *)param0->caughtPokemon, param1); } -static void sub_02026360 (UnkStruct_02026324 * param0, u8 param1, u8 param2, u16 param3) +static void sub_02026360 (PokedexData * param0, u8 param1, u8 param2, u16 param3) { if (param2 == 0) { - inline_02026360((u8 *)param0->unk_84[1], param1, param3); + inline_02026360((u8 *)param0->recordedGenders[1], param1, param3); } - inline_02026360((u8 *)param0->unk_84[param2], param1, param3); + inline_02026360((u8 *)param0->recordedGenders[param2], param1, param3); } -static void sub_020263D8 (UnkStruct_02026324 * param0, u8 param1, u8 param2, u16 param3) +static void sub_020263D8 (PokedexData * param0, u8 param1, u8 param2, u16 param3) { GF_ASSERT(param1 <= 2); @@ -134,33 +142,33 @@ static void sub_020263D8 (UnkStruct_02026324 * param0, u8 param1, u8 param2, u16 sub_02026360(param0, param1, param2, param3); } -static inline BOOL inline_02026FE8 (const UnkStruct_02026324 * param0, u16 param1) +static inline BOOL inline_02026FE8 (const PokedexData * param0, u16 param1) { - return inline_02026464((const u8 *)param0->unk_44, param1); + return ReadBit((const u8 *)param0->seenPokemon, param1); } -static inline BOOL inline_02026F9C (const UnkStruct_02026324 * param0, u16 param1) +static inline BOOL inline_02026F9C (const PokedexData * param0, u16 param1) { - return inline_02026464((const u8 *)param0->unk_04, param1); + return ReadBit((const u8 *)param0->caughtPokemon, param1); } -static inline u8 inline_02026BAC (const UnkStruct_02026324 * param0, u16 param1, u8 param2) +static inline u8 inline_02026BAC (const PokedexData * param0, u16 param1, u8 param2) { - return inline_02026464((const u8 *)param0->unk_84[param2], param1); + return ReadBit((const u8 *)param0->recordedGenders[param2], param1); } -static inline void inline_0202736C_1 (UnkStruct_02026324 * param0, u16 param1, u32 param2) +static inline void inline_0202736C_1 (PokedexData * param0, u16 param1, u32 param2) { if (param1 == 327) { param0->unk_104 = param2; } } -static int sub_02026400 (const UnkStruct_02026324 * param0) +static int sub_02026400 (const PokedexData * param0) { int v0; - for (v0 = 0; v0 < 28; v0++) { + for (v0 = 0; v0 < UNOWN_COUNT; v0++) { if (param0->unk_10C[v0] == 0xff) { break; } @@ -169,11 +177,11 @@ static int sub_02026400 (const UnkStruct_02026324 * param0) return v0; } -static BOOL sub_02026418 (const UnkStruct_02026324 * param0, u8 param1) +static BOOL sub_02026418 (const PokedexData * param0, u8 param1) { int v0; - for (v0 = 0; v0 < 28; v0++) { + for (v0 = 0; v0 < UNOWN_COUNT; v0++) { if (param0->unk_10C[v0] == param1) { return 1; } @@ -182,7 +190,7 @@ static BOOL sub_02026418 (const UnkStruct_02026324 * param0, u8 param1) return 0; } -static void sub_0202643C (UnkStruct_02026324 * param0, int param1) +static void sub_0202643C (PokedexData * param0, int param1) { int v0; @@ -192,12 +200,12 @@ static void sub_0202643C (UnkStruct_02026324 * param0, int param1) v0 = sub_02026400(param0); - if (v0 < 28) { + if (v0 < UNOWN_COUNT) { param0->unk_10C[v0] = param1; } } -static int sub_02026464 (const UnkStruct_02026324 * param0, u32 param1) +static int sub_02026464 (const PokedexData * param0, u32 param1) { u32 v0; u32 v1; @@ -224,8 +232,8 @@ static int sub_02026464 (const UnkStruct_02026324 * param0, u32 param1) break; } - v0 = inline_02026464(v2, 1); - v1 = inline_02026464(v2, 2); + v0 = ReadBit(v2, 1); + v1 = ReadBit(v2, 2); if (v0 == v1) { return 1; @@ -234,7 +242,7 @@ static int sub_02026464 (const UnkStruct_02026324 * param0, u32 param1) return 2; } -static BOOL sub_02026514 (const UnkStruct_02026324 * param0, u32 param1, u8 param2) +static BOOL sub_02026514 (const PokedexData * param0, u32 param1, u8 param2) { u32 v0; u32 v1; @@ -265,7 +273,7 @@ static BOOL sub_02026514 (const UnkStruct_02026324 * param0, u32 param1, u8 para v2 = sub_02026464(param0, param1); for (v1 = 0; v1 < v2; v1++) { - v0 = inline_02026464(v3, v1 + 1); + v0 = ReadBit(v3, v1 + 1); if (v0 == param2) { return 1; @@ -275,7 +283,7 @@ static BOOL sub_02026514 (const UnkStruct_02026324 * param0, u32 param1, u8 para return 0; } -static void sub_020265E8 (UnkStruct_02026324 * param0, u32 param1, int param2) +static void sub_020265E8 (PokedexData * param0, u32 param1, int param2) { int v0; u8 * v1; @@ -312,7 +320,7 @@ static void sub_020265E8 (UnkStruct_02026324 * param0, u32 param1, int param2) } } -static int sub_020266F8 (const UnkStruct_02026324 * param0, u32 param1) +static int sub_020266F8 (const PokedexData * param0, u32 param1) { u32 v0; int v1; @@ -341,7 +349,7 @@ static int sub_020266F8 (const UnkStruct_02026324 * param0, u32 param1) return v1; } -static BOOL sub_02026754 (const UnkStruct_02026324 * param0, u32 param1, u8 param2) +static BOOL sub_02026754 (const PokedexData * param0, u32 param1, u8 param2) { u32 v0; int v1; @@ -370,7 +378,7 @@ static BOOL sub_02026754 (const UnkStruct_02026324 * param0, u32 param1, u8 para return 0; } -static void sub_020267B8 (UnkStruct_02026324 * param0, u32 param1, int param2) +static void sub_020267B8 (PokedexData * param0, u32 param1, int param2) { int v0; u8 * v1; @@ -403,15 +411,15 @@ static void sub_02026834 (u32 * param0, u8 param1, u8 param2) param0[16 - 1] |= (param1 << v0); } -static void sub_02026850 (UnkStruct_02026324 * param0, u8 param1, u8 param2) +static void sub_02026850 (PokedexData * param0, u8 param1, u8 param2) { GF_ASSERT(param2 < 4); GF_ASSERT(param1 <= 15); if (param2 < 2) { - sub_02026834(param0->unk_04, param1, param2); + sub_02026834(param0->caughtPokemon, param1, param2); } else { - sub_02026834(param0->unk_44, param1, param2 - 2); + sub_02026834(param0->seenPokemon, param1, param2 - 2); } } @@ -423,20 +431,20 @@ static inline u32 inline_0202688C (const u32 * param0, u8 param1) return v1; } -static u32 sub_0202688C (const UnkStruct_02026324 * param0, u8 param1) +static u32 sub_0202688C (const PokedexData * param0, u8 param1) { u32 v0; if (param1 < 2) { - v0 = inline_0202688C(param0->unk_04, param1); + v0 = inline_0202688C(param0->caughtPokemon, param1); } else { - v0 = inline_0202688C(param0->unk_44, param1 - 2); + v0 = inline_0202688C(param0->seenPokemon, param1 - 2); } return v0; } -static u32 sub_020268B8 (const UnkStruct_02026324 * param0) +static u32 sub_020268B8 (const PokedexData * param0) { int v0; @@ -449,7 +457,7 @@ static u32 sub_020268B8 (const UnkStruct_02026324 * param0) return v0; } -static BOOL sub_020268D8 (const UnkStruct_02026324 * param0, u32 param1) +static BOOL sub_020268D8 (const PokedexData * param0, u32 param1) { int v0; @@ -462,7 +470,7 @@ static BOOL sub_020268D8 (const UnkStruct_02026324 * param0, u32 param1) return 0; } -static void sub_020268FC (UnkStruct_02026324 * param0, u16 param1, Pokemon * param2) +static void sub_020268FC (PokedexData * param0, u16 param1, Pokemon * param2) { u8 v0 = Pokemon_GetValue(param2, MON_DATA_FORM, NULL); u32 v1; @@ -475,7 +483,7 @@ static void sub_020268FC (UnkStruct_02026324 * param0, u16 param1, Pokemon * par } } -static void sub_0202693C (UnkStruct_02026324 * param0) +static void sub_0202693C (PokedexData * param0) { int v0; @@ -497,7 +505,7 @@ static inline void inline_02026A00 (u32 * param0, u32 param1, u32 param2) (*param0) |= (param2 << (param1 * 3)); } -static int sub_02026958 (const UnkStruct_02026324 * param0, u32 param1) +static int sub_02026958 (const PokedexData * param0, u32 param1) { u32 v0; int v1, v2; @@ -523,7 +531,7 @@ static int sub_02026958 (const UnkStruct_02026324 * param0, u32 param1) return v2; } -static BOOL sub_020269A4 (const UnkStruct_02026324 * param0, u32 param1, u8 param2) +static BOOL sub_020269A4 (const PokedexData * param0, u32 param1, u8 param2) { int v0; u32 v1; @@ -548,7 +556,7 @@ static BOOL sub_020269A4 (const UnkStruct_02026324 * param0, u32 param1, u8 para return 0; } -static void sub_02026A00 (UnkStruct_02026324 * param0, u32 param1, int param2) +static void sub_02026A00 (PokedexData * param0, u32 param1, int param2) { int v0; @@ -565,7 +573,7 @@ static void sub_02026A00 (UnkStruct_02026324 * param0, u32 param1, int param2) } } -static void sub_02026A60 (UnkStruct_02026324 * param0, u16 param1, Pokemon * param2) +static void sub_02026A60 (PokedexData * param0, u16 param1, Pokemon * param2) { int v0; @@ -610,7 +618,7 @@ static void sub_02026A60 (UnkStruct_02026324 * param0, u16 param1, Pokemon * par } } -static void sub_02026B88 (UnkStruct_02026324 * param0, u16 param1, u32 param2) +static void sub_02026B88 (PokedexData * param0, u16 param1, u32 param2) { int v0; int v1; @@ -622,10 +630,10 @@ static void sub_02026B88 (UnkStruct_02026324 * param0, u16 param1, u32 param2) return; } - param0->unk_128[v0] |= 1 << v1; + param0->recordedLanguages[v0] |= 1 << v1; } -static u32 sub_02026BAC (const UnkStruct_02026324 * param0, u16 param1, int param2) +static u32 sub_02026BAC (const PokedexData * param0, u16 param1, int param2) { u32 v0, v1; u32 v2; @@ -655,12 +663,12 @@ static u32 sub_02026BAC (const UnkStruct_02026324 * param0, u16 param1, int para return v2; } -static inline int inline_020270AC (const UnkStruct_02026324 * param0, int param1) +static inline int inline_020270AC (const PokedexData * param0, int param1) { return param0->unk_10C[param1]; } -static int sub_02026C24 (const UnkStruct_02026324 * param0, u32 param1, int param2) +static int sub_02026C24 (const PokedexData * param0, u32 param1, int param2) { const u8 * v0; @@ -682,10 +690,10 @@ static int sub_02026C24 (const UnkStruct_02026324 * param0, u32 param1, int para break; } - return inline_02026464(v0, param2 + 1); + return ReadBit(v0, param2 + 1); } -static int sub_02026CCC (const UnkStruct_02026324 * param0, u32 param1, int param2) +static int sub_02026CCC (const PokedexData * param0, u32 param1, int param2) { GF_ASSERT((param1 == 479)); GF_ASSERT(param2 < 6); @@ -693,7 +701,7 @@ static int sub_02026CCC (const UnkStruct_02026324 * param0, u32 param1, int para return inline_02026958(param0->unk_31C, param2); } -static int sub_02026CFC (const UnkStruct_02026324 * param0, u32 param1, int param2) +static int sub_02026CFC (const PokedexData * param0, u32 param1, int param2) { const u8 * v0; @@ -743,14 +751,14 @@ static BOOL sub_02026D68 (u16 param0) return 1; } -void Pokedex_Init (UnkStruct_02026324 * param0) +void Pokedex_Init (PokedexData * param0) { - memset(param0, 0, sizeof(UnkStruct_02026324)); + memset(param0, 0, sizeof(PokedexData)); - param0->unk_00 = 3203386110; - param0->unk_31B = 0; + param0->magic = 3203386110; + param0->nationalDexObtained = FALSE; - memset(param0->unk_10C, 0xff, sizeof(u8) * 28); + memset(param0->unk_10C, 0xff, sizeof(u8) * UNOWN_COUNT); param0->unk_108 = 0xff; param0->unk_109 = 0xff; @@ -763,15 +771,15 @@ void Pokedex_Init (UnkStruct_02026324 * param0) sub_0202693C(param0); } -u16 sub_02026DD0 (const UnkStruct_02026324 * param0) +u16 sub_02026DD0 (const PokedexData * param0) { int v0; int v1; - inline_02026DD0(param0); + CheckPokedexIntegrity(param0); v1 = 0; - for (v0 = 1; v0 <= 493; v0++) { + for (v0 = 1; v0 <= NATIONAL_DEX_COUNT; v0++) { if (Pokedex_CaughtSpecies(param0, v0) == 1) { v1++; } @@ -780,15 +788,15 @@ u16 sub_02026DD0 (const UnkStruct_02026324 * param0) return v1; } -u16 sub_02026E0C (const UnkStruct_02026324 * param0) +u16 sub_02026E0C (const PokedexData * param0) { int v0; int v1; - inline_02026DD0(param0); + CheckPokedexIntegrity(param0); v1 = 0; - for (v0 = 1; v0 <= 493; v0++) { + for (v0 = 1; v0 <= NATIONAL_DEX_COUNT; v0++) { if (sub_02026FE8(param0, v0) == 1) { v1++; } @@ -797,7 +805,7 @@ u16 sub_02026E0C (const UnkStruct_02026324 * param0) return v1; } -u16 sub_02026E48 (const UnkStruct_02026324 * param0) +u16 sub_02026E48 (const PokedexData * param0) { if (sub_02027474(param0)) { return sub_02026E0C(param0); @@ -806,15 +814,15 @@ u16 sub_02026E48 (const UnkStruct_02026324 * param0) return sub_02026EAC(param0); } -u16 sub_02026E64 (const UnkStruct_02026324 * param0) +u16 sub_02026E64 (const PokedexData * param0) { int v0; int v1; - inline_02026DD0(param0); + CheckPokedexIntegrity(param0); v1 = 0; - for (v0 = 1; v0 <= 493; v0++) { + for (v0 = 1; v0 <= NATIONAL_DEX_COUNT; v0++) { if (Pokedex_CaughtSpecies(param0, v0) == 1) { if (Pokemon_SinnohDexNumber(v0) != 0) { v1++; @@ -825,15 +833,15 @@ u16 sub_02026E64 (const UnkStruct_02026324 * param0) return v1; } -u16 sub_02026EAC (const UnkStruct_02026324 * param0) +u16 sub_02026EAC (const PokedexData * param0) { int v0; int v1; - inline_02026DD0(param0); + CheckPokedexIntegrity(param0); v1 = 0; - for (v0 = 1; v0 <= 493; v0++) { + for (v0 = 1; v0 <= NATIONAL_DEX_COUNT; v0++) { if (sub_02026FE8(param0, v0) == 1) { if (Pokemon_SinnohDexNumber(v0) != 0) { v1++; @@ -844,7 +852,7 @@ u16 sub_02026EAC (const UnkStruct_02026324 * param0) return v1; } -BOOL sub_02026EF4 (const UnkStruct_02026324 * param0) +BOOL sub_02026EF4 (const PokedexData * param0) { u16 v0; @@ -857,27 +865,27 @@ BOOL sub_02026EF4 (const UnkStruct_02026324 * param0) return 0; } -BOOL sub_02026F0C (const UnkStruct_02026324 * param0) +BOOL sub_02026F0C (const PokedexData * param0) { u16 v0; v0 = sub_02026F58(param0); - if (v0 >= 210) { + if (v0 >= LOCAL_DEX_COUNT) { return 1; } return 0; } -u16 sub_02026F20 (const UnkStruct_02026324 * param0) +u16 sub_02026F20 (const PokedexData * param0) { int v0; u16 v1; v1 = 0; - for (v0 = 1; v0 <= 493; v0++) { + for (v0 = 1; v0 <= NATIONAL_DEX_COUNT; v0++) { if (Pokedex_CaughtSpecies(param0, v0) == 1) { if (sub_02026D44(v0) == 1) { v1++; @@ -888,7 +896,7 @@ u16 sub_02026F20 (const UnkStruct_02026324 * param0) return v1; } -u16 sub_02026F58 (const UnkStruct_02026324 * param0) +u16 sub_02026F58 (const PokedexData * param0) { int v0; u16 v1; @@ -896,7 +904,7 @@ u16 sub_02026F58 (const UnkStruct_02026324 * param0) v1 = 0; - for (v0 = 1; v0 <= 493; v0++) { + for (v0 = 1; v0 <= NATIONAL_DEX_COUNT; v0++) { if (sub_02026FE8(param0, v0) == 1) { v2 = Pokemon_SinnohDexNumber(v0); @@ -911,9 +919,9 @@ u16 sub_02026F58 (const UnkStruct_02026324 * param0) return v1; } -BOOL Pokedex_CaughtSpecies (const UnkStruct_02026324 * param0, u16 param1) +BOOL Pokedex_CaughtSpecies (const PokedexData * param0, u16 param1) { - inline_02026DD0(param0); + CheckPokedexIntegrity(param0); if (sub_02026344(param1)) { return 0; @@ -926,9 +934,9 @@ BOOL Pokedex_CaughtSpecies (const UnkStruct_02026324 * param0, u16 param1) } } -BOOL sub_02026FE8 (const UnkStruct_02026324 * param0, u16 param1) +BOOL sub_02026FE8 (const PokedexData * param0, u16 param1) { - inline_02026DD0(param0); + CheckPokedexIntegrity(param0); if (sub_02026344(param1)) { return 0; @@ -937,11 +945,11 @@ BOOL sub_02026FE8 (const UnkStruct_02026324 * param0, u16 param1) return inline_02026FE8(param0, param1); } -u32 sub_0202702C (const UnkStruct_02026324 * param0, u8 param1) +u32 sub_0202702C (const PokedexData * param0, u8 param1) { u32 v0; - inline_02026DD0(param0); + CheckPokedexIntegrity(param0); switch (param1) { case 0: @@ -955,9 +963,9 @@ u32 sub_0202702C (const UnkStruct_02026324 * param0, u8 param1) return v0; } -u32 sub_02027058 (const UnkStruct_02026324 * param0, u16 param1, int param2) +u32 sub_02027058 (const PokedexData * param0, u16 param1, int param2) { - inline_02026DD0(param0); + CheckPokedexIntegrity(param0); if (sub_02026344(param1)) { return -1; @@ -970,9 +978,9 @@ u32 sub_02027058 (const UnkStruct_02026324 * param0, u16 param1, int param2) return sub_02026BAC(param0, param1, param2); } -u32 sub_020270AC (const UnkStruct_02026324 * param0, int param1) +u32 sub_020270AC (const PokedexData * param0, int param1) { - inline_02026DD0(param0); + CheckPokedexIntegrity(param0); if (sub_02026400(param0) <= param1) { return -1; @@ -981,15 +989,15 @@ u32 sub_020270AC (const UnkStruct_02026324 * param0, int param1) return inline_020270AC(param0, param1); } -u32 sub_020270DC (const UnkStruct_02026324 * param0) +u32 sub_020270DC (const PokedexData * param0) { - inline_02026DD0(param0); + CheckPokedexIntegrity(param0); return sub_02026400(param0); } -u32 sub_020270F8 (const UnkStruct_02026324 * param0, int param1) +u32 sub_020270F8 (const PokedexData * param0, int param1) { - inline_02026DD0(param0); + CheckPokedexIntegrity(param0); if (sub_02026464(param0, 422) <= param1) { return -1; @@ -998,15 +1006,15 @@ u32 sub_020270F8 (const UnkStruct_02026324 * param0, int param1) return sub_02026C24(param0, 422, param1); } -u32 sub_02027130 (const UnkStruct_02026324 * param0) +u32 sub_02027130 (const PokedexData * param0) { - inline_02026DD0(param0); + CheckPokedexIntegrity(param0); return sub_02026464(param0, 422); } -u32 sub_02027154 (const UnkStruct_02026324 * param0, int param1) +u32 sub_02027154 (const PokedexData * param0, int param1) { - inline_02026DD0(param0); + CheckPokedexIntegrity(param0); if (sub_02026464(param0, 423) <= param1) { return -1; @@ -1015,15 +1023,15 @@ u32 sub_02027154 (const UnkStruct_02026324 * param0, int param1) return sub_02026C24(param0, 423, param1); } -u32 sub_0202718C (const UnkStruct_02026324 * param0) +u32 sub_0202718C (const PokedexData * param0) { - inline_02026DD0(param0); + CheckPokedexIntegrity(param0); return sub_02026464(param0, 423); } -u32 sub_020271B0 (const UnkStruct_02026324 * param0, int param1) +u32 sub_020271B0 (const PokedexData * param0, int param1) { - inline_02026DD0(param0); + CheckPokedexIntegrity(param0); if (sub_020266F8(param0, 412) <= param1) { return -1; @@ -1032,15 +1040,15 @@ u32 sub_020271B0 (const UnkStruct_02026324 * param0, int param1) return sub_02026CFC(param0, 412, param1); } -u32 sub_020271E8 (const UnkStruct_02026324 * param0) +u32 sub_020271E8 (const PokedexData * param0) { - inline_02026DD0(param0); + CheckPokedexIntegrity(param0); return sub_020266F8(param0, 412); } -u32 sub_02027208 (const UnkStruct_02026324 * param0, int param1) +u32 sub_02027208 (const PokedexData * param0, int param1) { - inline_02026DD0(param0); + CheckPokedexIntegrity(param0); if (sub_020266F8(param0, 413) <= param1) { return -1; @@ -1049,32 +1057,32 @@ u32 sub_02027208 (const UnkStruct_02026324 * param0, int param1) return sub_02026CFC(param0, 413, param1); } -u32 sub_02027240 (const UnkStruct_02026324 * param0) +u32 sub_02027240 (const PokedexData * param0) { - inline_02026DD0(param0); + CheckPokedexIntegrity(param0); return sub_020266F8(param0, 413); } -u32 sub_02027264 (const UnkStruct_02026324 * param0, int param1) +u32 sub_02027264 (const PokedexData * param0, int param1) { - inline_02026DD0(param0); + CheckPokedexIntegrity(param0); return sub_0202688C(param0, param1); } -u32 sub_02027288 (const UnkStruct_02026324 * param0) +u32 sub_02027288 (const PokedexData * param0) { - inline_02026DD0(param0); + CheckPokedexIntegrity(param0); return sub_020268B8(param0); } -void sub_020272A4 (UnkStruct_02026324 * param0, Pokemon * param1) +void sub_020272A4 (PokedexData * param0, Pokemon * pokemon) { - u16 v0 = Pokemon_GetValue(param1, MON_DATA_SPECIES, NULL); - u32 v1 = Pokemon_GetValue(param1, MON_DATA_PERSONALITY, NULL); - u32 v2 = Pokemon_GetGender(param1); + u16 v0 = Pokemon_GetValue(pokemon, MON_DATA_SPECIES, NULL); + u32 v1 = Pokemon_GetValue(pokemon, MON_DATA_PERSONALITY, NULL); + u32 v2 = Pokemon_GetGender(pokemon); u32 v3; - inline_02026DD0(param0); + CheckPokedexIntegrity(param0); if (sub_02026344(v0)) { return; @@ -1091,11 +1099,11 @@ void sub_020272A4 (UnkStruct_02026324 * param0, Pokemon * param1) } } - sub_02026A60(param0, v0, param1); + sub_02026A60(param0, v0, pokemon); inline_0202736C(param0, v0); } -void sub_0202736C (UnkStruct_02026324 * param0, Pokemon * param1) +void sub_0202736C (PokedexData * param0, Pokemon * param1) { u16 v0 = Pokemon_GetValue(param1, MON_DATA_SPECIES, NULL); u32 v1 = Pokemon_GetValue(param1, MON_DATA_LANGUAGE, NULL); @@ -1103,7 +1111,7 @@ void sub_0202736C (UnkStruct_02026324 * param0, Pokemon * param1) u32 v3 = Pokemon_GetGender(param1); u32 v4; - inline_02026DD0(param0); + CheckPokedexIntegrity(param0); if (sub_02026344(v0)) { return; @@ -1127,77 +1135,77 @@ void sub_0202736C (UnkStruct_02026324 * param0, Pokemon * param1) inline_0202736C(param0, v0); } -void sub_02027454 (UnkStruct_02026324 * param0) +void sub_02027454 (PokedexData * param0) { - inline_02026DD0(param0); - param0->unk_31B = 1; + CheckPokedexIntegrity(param0); + param0->nationalDexObtained = 1; } -BOOL sub_02027474 (const UnkStruct_02026324 * param0) +BOOL sub_02027474 (const PokedexData * param0) { - inline_02026DD0(param0); - return param0->unk_31B; + CheckPokedexIntegrity(param0); + return param0->nationalDexObtained; } -BOOL sub_02027494 (const UnkStruct_02026324 * param0) +BOOL sub_02027494 (const PokedexData * param0) { - inline_02026DD0(param0); - return param0->unk_318; + CheckPokedexIntegrity(param0); + return param0->canDetectForms; } -void sub_020274B0 (UnkStruct_02026324 * param0) +void sub_020274B0 (PokedexData * param0) { - inline_02026DD0(param0); - param0->unk_318 = 1; + CheckPokedexIntegrity(param0); + param0->canDetectForms = 1; } -BOOL sub_020274D0 (const UnkStruct_02026324 * param0, u16 param1, u32 param2) +BOOL sub_020274D0 (const PokedexData * param0, u16 param1, u32 param2) { int v0; GF_ASSERT(param2 < 8); - inline_02026DD0(param0); + CheckPokedexIntegrity(param0); v0 = param1; param2 = sub_020986CC(param2); - return param0->unk_128[v0] & (1 << param2); + return param0->recordedLanguages[v0] & (1 << param2); } -void sub_02027508 (UnkStruct_02026324 * param0) +void sub_02027508 (PokedexData * param0) { param0->unk_319 = 1; } -BOOL sub_02027514 (const UnkStruct_02026324 * param0) +BOOL sub_02027514 (const PokedexData * param0) { return param0->unk_319; } -BOOL sub_02027520 (const UnkStruct_02026324 * param0) +BOOL sub_02027520 (const PokedexData * param0) { - inline_02026DD0(param0); - return param0->unk_31A; + CheckPokedexIntegrity(param0); + return param0->pokedexObtained; } -void sub_02027540 (UnkStruct_02026324 * param0) +void sub_02027540 (PokedexData * param0) { - inline_02026DD0(param0); - param0->unk_31A = 1; + CheckPokedexIntegrity(param0); + param0->pokedexObtained = 1; } -UnkStruct_02026324 * sub_02027560 (SaveData * param0) +PokedexData * sub_02027560 (SaveData * param0) { - UnkStruct_02026324 * v0; + PokedexData * v0; v0 = SaveData_Get(param0, 7); return v0; } -u32 sub_0202756C (const UnkStruct_02026324 * param0, int param1, int param2) +u32 sub_0202756C (const PokedexData * param0, int param1, int param2) { - inline_02026DD0(param0); + CheckPokedexIntegrity(param0); switch (param1) { case 201: @@ -1252,29 +1260,29 @@ u32 sub_0202756C (const UnkStruct_02026324 * param0, int param1, int param2) return 0; } -u32 sub_020276C8 (const UnkStruct_02026324 * param0, int param1) -{ - inline_02026DD0(param0); - - switch (param1) { - case 201: - return sub_020270DC(param0); - case 422: - return sub_02027130(param0); - case 423: - return sub_0202718C(param0); - case 412: - return sub_020271E8(param0); - case 413: - return sub_02027240(param0); - case 386: - return sub_02027288(param0); - case 492: - return sub_02026464(param0, 492); - case 487: - return sub_02026464(param0, 487); - case 479: - return sub_02026958(param0, 479); +u32 sub_020276C8 (const PokedexData *pokedex, int species) +{ + CheckPokedexIntegrity(pokedex); + + switch (species) { + case SPECIES_UNOWN: + return sub_020270DC(pokedex); + case SPECIES_SHELLOS: + return sub_02027130(pokedex); + case SPECIES_GASTRODON: + return sub_0202718C(pokedex); + case SPECIES_BURMY: + return sub_020271E8(pokedex); + case SPECIES_WORMADAM: + return sub_02027240(pokedex); + case SPECIES_DEOXYS: + return sub_02027288(pokedex); + case SPECIES_SHAYMIN: + return sub_02026464(pokedex, 492); + case SPECIES_GIRATINA: + return sub_02026464(pokedex, 487); + case SPECIES_ROTOM: + return sub_02026958(pokedex, 479); default: break; } diff --git a/src/unk_0202CD50.c b/src/unk_0202CD50.c index d10f01c1f2..89d7244e91 100644 --- a/src/unk_0202CD50.c +++ b/src/unk_0202CD50.c @@ -1,7 +1,7 @@ #include #include -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "struct_decls/struct_021C0794_decl.h" #include "unk_0201D15C.h" @@ -411,7 +411,7 @@ u32 sub_0202D034 (UnkStruct_0202CD88 * param0) return sub_0202CFB8(param0, (0 + 1)); } -void sub_0202D040 (UnkStruct_0202CD88 * param0, const UnkStruct_02026324 * param1, u16 const param2) +void sub_0202D040 (UnkStruct_0202CD88 * param0, const PokedexData * param1, u16 const param2) { if (!Pokedex_CaughtSpecies(param1, param2)) { sub_0202CFEC(param0, 22); diff --git a/src/unk_0202F180.c b/src/unk_0202F180.c index dc724b7bd9..f525afd479 100644 --- a/src/unk_0202F180.c +++ b/src/unk_0202F180.c @@ -1,7 +1,7 @@ #include #include -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "pokemon.h" #include "struct_decls/struct_021C0794_decl.h" @@ -14,7 +14,7 @@ void sub_0202F180 (SaveData * param0, const Pokemon * param1) { if (Pokemon_GetValue((Pokemon *)param1, MON_DATA_IS_EGG, NULL) == 0) { - UnkStruct_02026324 * v0 = sub_02027560(param0); + PokedexData * v0 = sub_02027560(param0); sub_0202D040(sub_0202CD88(param0), v0, Pokemon_GetValue((Pokemon *)param1, MON_DATA_SPECIES, NULL)); sub_0202736C(v0, (Pokemon *)param1); diff --git a/src/unk_0202F1D4.c b/src/unk_0202F1D4.c index 4792fd2ba8..070344d3f2 100644 --- a/src/unk_0202F1D4.c +++ b/src/unk_0202F1D4.c @@ -12,6 +12,7 @@ #include "struct_defs/struct_0202FAA8.h" #include "struct_defs/struct_0202FD30.h" #include "struct_defs/struct_02030A80.h" +#include "constants/species.h" #include "pokemon.h" #include "struct_defs/struct_02078B40.h" #include "struct_defs/struct_party.h" @@ -393,7 +394,7 @@ static BOOL sub_0202F794 (SaveData * param0, const BattleRecording * param1) for (v4 = 0; v4 < 6; v4++) { v6 = &(v0->unk_1150[v3].unk_04[v4]); - if (v6->species > 495) { + if (v6->species > MAX_SPECIES) { return 0; } @@ -673,7 +674,7 @@ u64 sub_0202FE98 (UnkStruct_0202F41C * param0, int param1, int param2) case 0: GF_ASSERT(param2 < 12); - if (param0->unk_00[param2] > 493) { + if (param0->unk_00[param2] > NATIONAL_DEX_COUNT) { return 0; } diff --git a/src/unk_02030880.c b/src/unk_02030880.c index 235d4ff547..67f6046878 100644 --- a/src/unk_02030880.c +++ b/src/unk_02030880.c @@ -6,14 +6,15 @@ #include "heap.h" #include "savedata/save_table.h" +#include "constants/species.h" #include "unk_020244AC.h" #include "unk_0203061C.h" #include "unk_02030880.h" typedef struct { - u16 unk_00[495]; - u16 unk_3DE[495]; - u16 unk_7BC[495]; + u16 unk_00[MAX_SPECIES]; + u16 unk_3DE[MAX_SPECIES]; + u16 unk_7BC[MAX_SPECIES]; u16 unk_B9A; } UnkStruct_020308A0_sub1; diff --git a/src/unk_0203A9C8.c b/src/unk_0203A9C8.c index 4ec133e160..78f31443ba 100644 --- a/src/unk_0203A9C8.c +++ b/src/unk_0203A9C8.c @@ -7,7 +7,7 @@ #include "struct_decls/struct_02022550_decl.h" #include "strbuf.h" #include "trainer_info.h" -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "struct_decls/struct_020507E4_decl.h" #include "struct_decls/struct_020508D4_decl.h" #include "pokemon.h" @@ -935,7 +935,7 @@ static BOOL sub_0203B6A4 (UnkStruct_020508D4 * param0) UnkStruct_0203CDB0 * v0; UnkStruct_020708E0 * v1; UnkStruct_ov21_021D0D80 * v2; - UnkStruct_02026324 * v3; + PokedexData * v3; TrainerInfo * v4; UnkStruct_020507E4 * v5; diff --git a/src/unk_0203F6C4.c b/src/unk_0203F6C4.c index e61c9b1d5b..e4cb24528c 100644 --- a/src/unk_0203F6C4.c +++ b/src/unk_0203F6C4.c @@ -15,7 +15,7 @@ #include "trainer_info.h" #include "struct_decls/struct_02026218_decl.h" #include "struct_decls/struct_02026310_decl.h" -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "struct_decls/struct_02028430_decl.h" #include "struct_decls/struct_0202855C_decl.h" #include "struct_decls/struct_020298B0_decl.h" @@ -184,6 +184,7 @@ #include "unk_02071CD0.h" #include "unk_02071D40.h" #include "unk_020722AC.h" +#include "constants/species.h" #include "pokemon.h" #include "trainer_data.h" #include "unk_020797C8.h" @@ -5097,7 +5098,7 @@ static BOOL sub_02043130 (UnkStruct_0203E724 * param0) static BOOL sub_02043190 (UnkStruct_0203E724 * param0) { - const UnkStruct_02026324 * v0 = sub_02027560(param0->unk_34->unk_0C); + const PokedexData * v0 = sub_02027560(param0->unk_34->unk_0C); u16 * v1 = inline_0204FCAC(param0); *v1 = sub_02026EAC(v0); @@ -5106,7 +5107,7 @@ static BOOL sub_02043190 (UnkStruct_0203E724 * param0) static BOOL sub_020431C0 (UnkStruct_0203E724 * param0) { - const UnkStruct_02026324 * v0 = sub_02027560(param0->unk_34->unk_0C); + const PokedexData * v0 = sub_02027560(param0->unk_34->unk_0C); u16 * v1 = inline_0204FCAC(param0); *v1 = sub_02026E64(v0); @@ -5115,7 +5116,7 @@ static BOOL sub_020431C0 (UnkStruct_0203E724 * param0) static BOOL sub_020431F0 (UnkStruct_0203E724 * param0) { - const UnkStruct_02026324 * v0 = sub_02027560(param0->unk_34->unk_0C); + const PokedexData * v0 = sub_02027560(param0->unk_34->unk_0C); u16 * v1 = inline_0204FCAC(param0); *v1 = sub_02026E0C(v0); @@ -5124,7 +5125,7 @@ static BOOL sub_020431F0 (UnkStruct_0203E724 * param0) static BOOL sub_02043220 (UnkStruct_0203E724 * param0) { - const UnkStruct_02026324 * v0 = sub_02027560(param0->unk_34->unk_0C); + const PokedexData * v0 = sub_02027560(param0->unk_34->unk_0C); u16 * v1 = inline_0204FCAC(param0); *v1 = sub_02026DD0(v0); @@ -5140,7 +5141,7 @@ static BOOL sub_02043250 (UnkStruct_0203E724 * param0) static BOOL sub_02043254 (UnkStruct_0203E724 * param0) { - const UnkStruct_02026324 * v0 = sub_02027560(param0->unk_34->unk_0C); + const PokedexData * v0 = sub_02027560(param0->unk_34->unk_0C); const TrainerInfo * v1 = sub_02025E38(param0->unk_34->unk_0C); u8 v2 = (*((param0)->unk_08++)); u16 * v3 = inline_0204FCAC(param0); @@ -6367,7 +6368,7 @@ static BOOL sub_020447A4 (UnkStruct_0203E724 * param0) static BOOL sub_020447E8 (UnkStruct_0203E724 * param0) { - const UnkStruct_02026324 * v0 = sub_02027560(param0->unk_34->unk_0C); + const PokedexData * v0 = sub_02027560(param0->unk_34->unk_0C); u16 * v1 = inline_0204FCAC(param0); *v1 = 0; @@ -6381,7 +6382,7 @@ static BOOL sub_020447E8 (UnkStruct_0203E724 * param0) static BOOL sub_02044820 (UnkStruct_0203E724 * param0) { - const UnkStruct_02026324 * v0 = sub_02027560(param0->unk_34->unk_0C); + const PokedexData * v0 = sub_02027560(param0->unk_34->unk_0C); u16 * v1 = inline_0204FCAC(param0); *v1 = 0; @@ -6597,7 +6598,7 @@ static BOOL sub_02044BB8 (UnkStruct_0203E724 * param0) static BOOL sub_02044BE8 (UnkStruct_0203E724 * param0) { - const UnkStruct_02026324 * v0 = sub_02027560(param0->unk_34->unk_0C); + const PokedexData * v0 = sub_02027560(param0->unk_34->unk_0C); u16 * v1 = inline_0204FCAC(param0); u16 v2, v3, v4, v5; @@ -6605,7 +6606,7 @@ static BOOL sub_02044BE8 (UnkStruct_0203E724 * param0) v3 = LCRNG_Next() % v2; *v1 = 25; - for (v4 = 1, v5 = 0; v4 <= 493; v4++) { + for (v4 = 1, v5 = 0; v4 <= NATIONAL_DEX_COUNT; v4++) { if ((sub_02026FE8(v0, v4) == 1) && (Pokemon_SinnohDexNumber(v4) != 0)) { if (v5 == v3) { *v1 = v4; @@ -6899,7 +6900,7 @@ static BOOL sub_02045198 (UnkStruct_0203E724 * param0) static void sub_020451B4 (UnkStruct_0203CDB0 * param0, u16 param1) { - UnkStruct_02026324 * v0 = sub_02027560(param0->unk_0C); + PokedexData * v0 = sub_02027560(param0->unk_0C); Pokemon * v1 = Pokemon_New(32); Pokemon_Init(v1); @@ -7018,7 +7019,7 @@ static BOOL sub_02045384 (UnkStruct_0203E724 * param0) int v3; int v4 = Party_GetCurrentCount(v1); Pokemon * v5; - UnkStruct_02026324 * v6 = sub_02027560(param0->unk_34->unk_0C); + PokedexData * v6 = sub_02027560(param0->unk_34->unk_0C); for (v2 = 0; v2 < v4; v2++) { v5 = Party_GetPokemonBySlotIndex(v1, v2); @@ -7373,7 +7374,7 @@ static BOOL sub_02045938 (UnkStruct_0203E724 * param0) static BOOL sub_0204598C (UnkStruct_0203E724 * param0) { - const UnkStruct_02026324 * v0 = sub_02027560(param0->unk_34->unk_0C); + const PokedexData * v0 = sub_02027560(param0->unk_34->unk_0C); u16 * v1 = inline_0204FCAC(param0); *v1 = sub_020270DC(v0); diff --git a/src/unk_0204AEE8.c b/src/unk_0204AEE8.c index ad12cb9a8c..31c81af3d7 100644 --- a/src/unk_0204AEE8.c +++ b/src/unk_0204AEE8.c @@ -7,7 +7,7 @@ #include "struct_decls/struct_0200B358_decl.h" #include "strbuf.h" #include "trainer_info.h" -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "pokemon.h" #include "struct_decls/struct_party_decl.h" #include "struct_decls/struct_021C0794_decl.h" @@ -111,7 +111,7 @@ UnkStruct_0200B358 * sub_0204AEE8 (SaveData * param0, u16 param1, u16 param2, u8 u8 v0; u16 v1; Strbuf* v2, * v3; - UnkStruct_02026324 * v4; + PokedexData * v4; UnkStruct_0200B358 * v5; MessageLoader * v6; diff --git a/src/unk_0204B830.c b/src/unk_0204B830.c index 9f269a60e3..14412e9ab5 100644 --- a/src/unk_0204B830.c +++ b/src/unk_0204B830.c @@ -2,6 +2,7 @@ #include #include "inlines.h" +#include "constants/species.h" #include "struct_decls/struct_0200B358_decl.h" #include "strbuf.h" @@ -306,7 +307,7 @@ static void sub_0204BAAC (UnkStruct_0203CDB0 * param0, void * param1) sub_0209304C(v4, v1, 4, sub_02017070(2, v12), 32); - if (Pokemon_GetValue(v4, MON_DATA_SPECIES, NULL) == 493) { + if (Pokemon_GetValue(v4, MON_DATA_SPECIES, NULL) == SPECIES_ARCEUS) { if (Pokemon_GetValue(v4, MON_DATA_FATEFUL_ENCOUNTER, NULL) == 1) { if (sub_0206B5F8(v2) == 0) { sub_0206B608(v2, 1); diff --git a/src/unk_0204C500.c b/src/unk_0204C500.c index 639d9f758d..f1cca6540c 100644 --- a/src/unk_0204C500.c +++ b/src/unk_0204C500.c @@ -4,7 +4,7 @@ #include "inlines.h" #include "struct_decls/struct_02024440_decl.h" -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "struct_decls/struct_0203E724_decl.h" #include "struct_decls/struct_020507E4_decl.h" #include "struct_decls/struct_020797DC_decl.h" @@ -66,7 +66,7 @@ BOOL sub_0204C59C (UnkStruct_0203E724 * param0) PCBoxes * v1 = SaveData_PCBoxes(param0->unk_34->unk_0C); Pokemon * v2 = Pokemon_New(32); TrainerInfo * v3 = sub_02025E38(param0->unk_34->unk_0C); - UnkStruct_02026324 * v4 = sub_02027560(param0->unk_34->unk_0C); + PokedexData * v4 = sub_02027560(param0->unk_34->unk_0C); BOOL v5; int v6; diff --git a/src/unk_0204E3CC.c b/src/unk_0204E3CC.c index 0d15afb483..00e45faf9a 100644 --- a/src/unk_0204E3CC.c +++ b/src/unk_0204E3CC.c @@ -3,7 +3,7 @@ #include "inlines.h" -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "struct_decls/struct_0203A790_decl.h" #include "struct_decls/struct_0203E724_decl.h" #include "struct_decls/struct_020507E4_decl.h" @@ -24,7 +24,7 @@ BOOL sub_0204E3CC (UnkStruct_0203E724 * param0) { - const UnkStruct_02026324 * v0 = sub_02027560(param0->unk_34->unk_0C); + const PokedexData * v0 = sub_02027560(param0->unk_34->unk_0C); u16 * v1 = inline_0204FCAC(param0); *v1 = sub_02027520(v0); @@ -33,7 +33,7 @@ BOOL sub_0204E3CC (UnkStruct_0203E724 * param0) BOOL sub_0204E3FC (UnkStruct_0203E724 * param0) { - UnkStruct_02026324 * v0 = sub_02027560(param0->unk_34->unk_0C); + PokedexData * v0 = sub_02027560(param0->unk_34->unk_0C); sub_02027540(v0); return 0; diff --git a/src/unk_0204F13C.c b/src/unk_0204F13C.c index 0e967b6582..7782c29ad5 100644 --- a/src/unk_0204F13C.c +++ b/src/unk_0204F13C.c @@ -43,6 +43,7 @@ #include "unk_0204FA34.h" #include "unk_020508D4.h" #include "unk_0205DFC4.h" +#include "constants/species.h" #include "pokemon.h" #include "party.h" #include "unk_0207A274.h" @@ -553,7 +554,7 @@ BOOL sub_0204F6D8 (UnkStruct_0203E724 * param0) if (v0 != 1) { v4 = 0; } else { - for (v5 = 0; v5 < 493; v5++) { + for (v5 = 0; v5 < NATIONAL_DEX_COUNT; v5++) { v4 += sub_020308BC(v9->unk_0C, v2, 0, v5); ; @@ -639,7 +640,7 @@ BOOL sub_0204F8A8 (UnkStruct_0203E724 * param0) if (v0 != 1) { v4 = 0; } else { - for (v3 = 0; v3 < 493; v3++) { + for (v3 = 0; v3 < NATIONAL_DEX_COUNT; v3++) { v2 = 0; v2 += sub_020308BC(v5->unk_0C, v1, @@ -691,7 +692,7 @@ BOOL sub_0204F950 (UnkStruct_0203E724 * param0) if (v0 != 1) { v4 = 0; } else { - for (v5 = 0; v5 < 493; v5++) { + for (v5 = 0; v5 < NATIONAL_DEX_COUNT; v5++) { v4 += sub_020308BC(v6->unk_0C, v2, 0, v5); ; diff --git a/src/unk_02051D8C.c b/src/unk_02051D8C.c index 7db11ce554..f0a7f695af 100644 --- a/src/unk_02051D8C.c +++ b/src/unk_02051D8C.c @@ -6,7 +6,7 @@ #include "core_sys.h" #include "trainer_info.h" -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "struct_decls/struct_0202B628_decl.h" #include "struct_defs/chatot_cry.h" #include "struct_decls/struct_0203A790_decl.h" @@ -255,7 +255,7 @@ void sub_020521B8 (BattleParams * param0, const UnkStruct_0203CDB0 * param1, Sav TrainerInfo * v0 = sub_02025E38(param2); Party * v1 = Party_GetFromSavedata(param2); UnkStruct_0207D3C0 * v2 = sub_0207D990(param2); - UnkStruct_02026324 * v3 = sub_02027560(param2); + PokedexData * v3 = sub_02027560(param2); ChatotCry * v4 = GetChatotCryDataFromSave(param2); AnimationControlFlags * v5 = sub_02025E44(param2); UnkStruct_0203A790 * v6 = sub_0203A790(param2); @@ -310,7 +310,7 @@ void sub_02052348 (BattleParams * param0, const UnkStruct_0203CDB0 * param1, int TrainerInfo * v2 = sub_02025E38(param1->unk_0C); Party * v3 = Party_GetFromSavedata(param1->unk_0C); UnkStruct_0207D3C0 * v4 = sub_0207D990(param1->unk_0C); - UnkStruct_02026324 * v5 = sub_02027560(param1->unk_0C); + PokedexData * v5 = sub_02027560(param1->unk_0C); ChatotCry * v6 = GetChatotCryDataFromSave(param1->unk_0C); AnimationControlFlags * v7 = sub_02025E44(param1->unk_0C); Pokemon * v8; @@ -360,7 +360,7 @@ void sub_020524E4 (BattleParams * param0, const UnkStruct_0203CDB0 * param1, con { TrainerInfo * v0 = sub_02025E38(param1->unk_0C); UnkStruct_0207D3C0 * v1 = sub_0207D990(param1->unk_0C); - UnkStruct_02026324 * v2 = sub_02027560(param1->unk_0C); + PokedexData * v2 = sub_02027560(param1->unk_0C); ChatotCry * v3 = GetChatotCryDataFromSave(param1->unk_0C); AnimationControlFlags * v4 = sub_02025E44(param1->unk_0C); const UnkStruct_0202610C * v5 = param1->unk_B0; @@ -444,7 +444,7 @@ void sub_020526E8 (const BattleParams * param0, UnkStruct_0203CDB0 * param1) TrainerInfo * v0 = sub_02025E38(param1->unk_0C); Party * v1 = Party_GetFromSavedata(param1->unk_0C); UnkStruct_0207D3C0 * v2 = sub_0207D990(param1->unk_0C); - UnkStruct_02026324 * v3 = sub_02027560(param1->unk_0C); + PokedexData * v3 = sub_02027560(param1->unk_0C); u16 * v4 = sub_0203A784(sub_0203A790(param1->unk_0C)); TrainerInfo_Copy(param0->unk_D0[0], v0); @@ -460,7 +460,7 @@ void sub_02052754 (const BattleParams * param0, UnkStruct_0203CDB0 * param1) TrainerInfo * v0 = sub_02025E38(param1->unk_0C); Party * v1 = Party_GetFromSavedata(param1->unk_0C); UnkStruct_0207D3C0 * v2 = sub_0207D990(param1->unk_0C); - UnkStruct_02026324 * v3 = sub_02027560(param1->unk_0C); + PokedexData * v3 = sub_02027560(param1->unk_0C); sub_02026338(param0->unk_E8, v3); } diff --git a/src/unk_020562F8.c b/src/unk_020562F8.c index 7518dd18fe..0dff688664 100644 --- a/src/unk_020562F8.c +++ b/src/unk_020562F8.c @@ -22,6 +22,7 @@ #include "unk_020562F8.h" #include "unk_0205DAC8.h" #include "pokemon.h" +#include "constants/species.h" typedef struct { u16 unk_00; @@ -126,7 +127,7 @@ static void sub_02056400 (u32 param0, u8 * param1) { int v0; - GF_ASSERT(0 < param0 && param0 <= 493); + GF_ASSERT(0 < param0 && param0 <= NATIONAL_DEX_COUNT); v0 = (param0 - 1) * 6; NARC_ReadFromMemberByIndexPair(param1, NARC_INDEX_ARC__PPARK, 0, v0, sizeof(u8) * 6); diff --git a/src/unk_0206B9D8.c b/src/unk_0206B9D8.c index d0cbed2cda..9caa75ce60 100644 --- a/src/unk_0206B9D8.c +++ b/src/unk_0206B9D8.c @@ -1,6 +1,8 @@ #include #include +#include "constants/species.h" + #include "struct_decls/struct_020298B0_decl.h" #include "struct_decls/struct_0202D060_decl.h" #include "struct_decls/struct_0202D750_decl.h" @@ -519,7 +521,7 @@ u32 sub_0206C068 (SaveData * param0) BOOL sub_0206C0D0 (UnkStruct_0203CDB0 * param0) { - if (param0->unk_1C->unk_00 == 493) { + if (param0->unk_1C->unk_00 == SPECIES_ARCEUS) { return 1; } diff --git a/src/unk_0206CCB0.c b/src/unk_0206CCB0.c index 7463f02c4e..ef1508f197 100644 --- a/src/unk_0206CCB0.c +++ b/src/unk_0206CCB0.c @@ -8,7 +8,7 @@ #include "strbuf.h" #include "struct_decls/struct_0202440C_decl.h" #include "trainer_info.h" -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "struct_decls/struct_02027854_decl.h" #include "struct_decls/struct_02029C68_decl.h" #include "struct_decls/struct_0202A750_decl.h" @@ -60,6 +60,7 @@ #include "roaming_pokemon.h" #include "unk_0206CCB0.h" #include "unk_02071CFC.h" +#include "constants/species.h" #include "pokemon.h" #include "party.h" #include "unk_0207D3B8.h" @@ -775,7 +776,7 @@ static int sub_0206D2E0 (UnkStruct_0203CDB0 * param0, UnkStruct_0200B358 * param static BOOL sub_0206D320 (UnkStruct_0203CDB0 * param0, UnkStruct_ov6_022465F4 * param1) { - UnkStruct_02026324 * v0 = sub_02027560(param0->unk_0C); + PokedexData * v0 = sub_02027560(param0->unk_0C); UnkStruct_0206D140 * v1 = ov6_02246498(param1); return sub_02026FE8(v0, v1->unk_06); @@ -966,7 +967,7 @@ static int sub_0206D644 (UnkStruct_0203CDB0 * param0, UnkStruct_0200B358 * param static BOOL sub_0206D6A8 (UnkStruct_0203CDB0 * param0, UnkStruct_ov6_022465F4 * param1) { - UnkStruct_02026324 * v0 = sub_02027560(param0->unk_0C); + PokedexData * v0 = sub_02027560(param0->unk_0C); UnkStruct_0206D644 * v1 = (UnkStruct_0206D644 *)ov6_02246498(param1); return sub_02026FE8(v0, v1->unk_00); @@ -1027,7 +1028,7 @@ static int sub_0206D75C (UnkStruct_0203CDB0 * param0, UnkStruct_0200B358 * param static BOOL sub_0206D7A4 (UnkStruct_0203CDB0 * param0, UnkStruct_ov6_022465F4 * param1) { - UnkStruct_02026324 * v0 = sub_02027560(param0->unk_0C); + PokedexData * v0 = sub_02027560(param0->unk_0C); UnkStruct_0206D75C * v1 = (UnkStruct_0206D75C *)ov6_02246498(param1); return sub_02026FE8(v0, v1->unk_00); @@ -2759,11 +2760,11 @@ static int sub_0206F01C (UnkStruct_0203CDB0 * param0, UnkStruct_0200B358 * param { Strbuf* v0; u16 v1, v2, v3; - const UnkStruct_02026324 * v4 = sub_02027560(param0->unk_0C); + const PokedexData * v4 = sub_02027560(param0->unk_0C); - v1 = (LCRNG_Next() % (493 - 1)) + 1; + v1 = (LCRNG_Next() % (NATIONAL_DEX_COUNT - 1)) + 1; - for (v2 = 1; v2 <= 493; v2++) { + for (v2 = 1; v2 <= NATIONAL_DEX_COUNT; v2++) { if (sub_02026FE8(v4, v1) == 1) { v3 = v1; break; @@ -2771,7 +2772,7 @@ static int sub_0206F01C (UnkStruct_0203CDB0 * param0, UnkStruct_0200B358 * param v1++; - if (v1 == 493) { + if (v1 == NATIONAL_DEX_COUNT) { v1 = 1; } } @@ -2808,7 +2809,7 @@ static Strbuf* sub_0206F0D8 (u16 param0, u32 param1) static BOOL sub_0206F100 (UnkStruct_0203CDB0 * param0, UnkStruct_ov6_022465F4 * param1) { - const UnkStruct_02026324 * v0 = sub_02027560(param0->unk_0C); + const PokedexData * v0 = sub_02027560(param0->unk_0C); if (sub_02027520(v0) == 1) { return 1; @@ -2854,7 +2855,7 @@ static int sub_0206F160 (UnkStruct_0203CDB0 * param0, UnkStruct_0200B358 * param Pokemon * v3; Party * v4; TrainerInfo * v5 = sub_02025E38(param0->unk_0C); - UnkStruct_02026324 * v6 = sub_02027560(param0->unk_0C); + PokedexData * v6 = sub_02027560(param0->unk_0C); v4 = Party_GetFromSavedata(param0->unk_0C); v3 = Party_GetPokemonBySlotIndex(v4, sub_0205E1B4(param0->unk_0C)); @@ -2862,9 +2863,9 @@ static int sub_0206F160 (UnkStruct_0203CDB0 * param0, UnkStruct_0200B358 * param sub_0206CE74(param1, 0, Pokemon_GetValue(v3, MON_DATA_SPECIES, NULL), Pokemon_GetValue(v3, MON_DATA_GENDER, NULL), TrainerInfo_RegionCode(v5), TrainerInfo_GameCode(v5)); sub_0200BFAC(param1, 1, (LCRNG_Next() % 100)); - v1 = (LCRNG_Next() % (493 - 2) + 1); + v1 = (LCRNG_Next() % (NATIONAL_DEX_COUNT - 2) + 1); - for (v2 = 1; v2 <= 493; v2++) { + for (v2 = 1; v2 <= NATIONAL_DEX_COUNT; v2++) { if (sub_02026FE8(v6, v1) == 1) { v0 = sub_0206F0D8(v1, 4); sub_0200B48C(param1, 2, v0, 0, 1, GAME_LANGUAGE); @@ -2874,7 +2875,7 @@ static int sub_0206F160 (UnkStruct_0203CDB0 * param0, UnkStruct_0200B358 * param v1++; - if (v1 >= 493) { + if (v1 >= NATIONAL_DEX_COUNT) { v1 = 1; } } @@ -2886,7 +2887,7 @@ static int sub_0206F160 (UnkStruct_0203CDB0 * param0, UnkStruct_0200B358 * param static BOOL sub_0206F260 (UnkStruct_0203CDB0 * param0, UnkStruct_ov6_022465F4 * param1) { - const UnkStruct_02026324 * v0 = sub_02027560(param0->unk_0C); + const PokedexData * v0 = sub_02027560(param0->unk_0C); if (sub_02027520(v0) == 1) { return 1; diff --git a/src/unk_0207A274.c b/src/unk_0207A274.c index 60809f603c..76eed0334a 100644 --- a/src/unk_0207A274.c +++ b/src/unk_0207A274.c @@ -1,7 +1,7 @@ #include #include -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "struct_decls/struct_021C0794_decl.h" #include "unk_0202631C.h" @@ -10,13 +10,13 @@ u32 sub_0207A274 (SaveData * param0) { - UnkStruct_02026324 * v0; + PokedexData * v0; v0 = sub_02027560(param0); return sub_0207A280(v0); } -u32 sub_0207A280 (const UnkStruct_02026324 * param0) +u32 sub_0207A280 (const PokedexData * param0) { BOOL v0; diff --git a/src/unk_0207AE68.c b/src/unk_0207AE68.c index 0e4745e6fd..d60c54d63f 100644 --- a/src/unk_0207AE68.c +++ b/src/unk_0207AE68.c @@ -6,7 +6,7 @@ #include "struct_decls/struct_02018340_decl.h" #include "struct_decls/sys_task.h" #include "strbuf.h" -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "struct_decls/struct_0202CD88_decl.h" #include "struct_decls/struct_02056B24_decl.h" #include "pokemon.h" @@ -68,7 +68,7 @@ #include "unk_0207D3B8.h" #include "unk_0208C324.h" -UnkStruct_0207AE68 * sub_0207AE68(Party * param0, Pokemon * param1, int param2, AnimationControlFlags * param3, int param4, UnkStruct_02026324 * param5, UnkStruct_0207D3C0 * param6, UnkStruct_0202CD88 * param7, UnkStruct_02056B24 * param8, int param9, int param10, int param11); +UnkStruct_0207AE68 * sub_0207AE68(Party * param0, Pokemon * param1, int param2, AnimationControlFlags * param3, int param4, PokedexData * param5, UnkStruct_0207D3C0 * param6, UnkStruct_0202CD88 * param7, UnkStruct_02056B24 * param8, int param9, int param10, int param11); static void sub_0207B0A0(SysTask * param0, void * param1); BOOL sub_0207B0D0(UnkStruct_0207AE68 * param0); void sub_0207B0E0(UnkStruct_0207AE68 * param0); @@ -98,7 +98,7 @@ static const u8 Unk_020F0A2C[] = { 0x8 }; -UnkStruct_0207AE68 * sub_0207AE68 (Party * param0, Pokemon * param1, int param2, AnimationControlFlags * param3, int param4, UnkStruct_02026324 * param5, UnkStruct_0207D3C0 * param6, UnkStruct_0202CD88 * param7, UnkStruct_02056B24 * param8, int param9, int param10, int param11) +UnkStruct_0207AE68 * sub_0207AE68 (Party * param0, Pokemon * param1, int param2, AnimationControlFlags * param3, int param4, PokedexData * param5, UnkStruct_0207D3C0 * param6, UnkStruct_0202CD88 * param7, UnkStruct_02056B24 * param8, int param9, int param10, int param11) { UnkStruct_0207AE68 * v0; ArchivedSprite v1; diff --git a/src/unk_020933F8.c b/src/unk_020933F8.c index ab4379c224..a423f15710 100644 --- a/src/unk_020933F8.c +++ b/src/unk_020933F8.c @@ -7,7 +7,7 @@ #include "struct_decls/sys_task.h" #include "struct_decls/struct_0202440C_decl.h" #include "trainer_info.h" -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "struct_decls/struct_02029C88_decl.h" #include "struct_decls/struct_02029D04_decl.h" #include "struct_decls/struct_0202A750_decl.h" @@ -1650,7 +1650,7 @@ void sub_02094C44 (UnkStruct_02095C48 * param0, SaveData * param1, u32 param2, U { int v6; - UnkStruct_02026324 * v7; + PokedexData * v7; v7 = sub_02027560(param0->unk_1970); diff --git a/src/unk_0209747C.c b/src/unk_0209747C.c index eff37fe762..e513aeb10e 100644 --- a/src/unk_0209747C.c +++ b/src/unk_0209747C.c @@ -2,7 +2,7 @@ #include #include "struct_decls/struct_02014EC4_decl.h" -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "struct_decls/struct_0209747C_decl.h" #include "struct_decls/struct_021C0794_decl.h" @@ -26,7 +26,7 @@ struct UnkStruct_0209747C_t { u8 unk_04; u8 unk_05; int unk_08; - const UnkStruct_02026324 * unk_0C; + const PokedexData * unk_0C; const UnkStruct_02014EC4 * unk_10; Sentence unk_14; u16 unk_1C[2]; @@ -133,7 +133,7 @@ int sub_02097558 (const UnkStruct_0209747C * param0) return param0->unk_08; } -const UnkStruct_02026324 * sub_0209755C (const UnkStruct_0209747C * param0) +const PokedexData * sub_0209755C (const UnkStruct_0209747C * param0) { return param0->unk_0C; } diff --git a/src/unk_020998EC.c b/src/unk_020998EC.c index 265e30cb73..ed91494ec8 100644 --- a/src/unk_020998EC.c +++ b/src/unk_020998EC.c @@ -7,7 +7,7 @@ #include "struct_decls/struct_02014D38_decl.h" #include "struct_decls/struct_02014EC4_decl.h" #include "strbuf.h" -#include "struct_decls/struct_02026324_decl.h" +#include "struct_decls/pokedexdata_decl.h" #include "struct_decls/struct_0209747C_decl.h" #include "struct_decls/struct_020998EC_decl.h" @@ -3231,7 +3231,7 @@ static inline BOOL inline_02099BF4 (const UnkStruct_020998EC * param0, u32 param static u32 sub_02099980 (UnkStruct_020998EC * param0, const u16 * param1, u32 param2, u16 * param3) { - const UnkStruct_02026324 * v0; + const PokedexData * v0; u32 v1, v2; v2 = 0; diff --git a/tools/json2bin/evo.py b/tools/json2bin/evo.py index 88857e0d4f..26a0a277b7 100644 --- a/tools/json2bin/evo.py +++ b/tools/json2bin/evo.py @@ -82,36 +82,38 @@ def parse_evolutions(table: Sequence, _size: int, _enum: None) -> bytes: .register('evolutions', 44, parse_evolutions, optional=j2b.OptionalBehavior.PAD) +NATIONAL_DEX_COUNT = 493 + FORM_INDICES = { 'DEOXYS' : { - 'ATTACK': 496, - 'DEFENSE': 497, - 'SPEED': 498, + 'ATTACK': NATIONAL_DEX_COUNT + 3, + 'DEFENSE': NATIONAL_DEX_COUNT + 4, + 'SPEED': NATIONAL_DEX_COUNT + 5, }, 'WORMADAM': { - 'SANDY': 499, - 'TRASH': 500, + 'SANDY': NATIONAL_DEX_COUNT + 6, + 'TRASH': NATIONAL_DEX_COUNT + 7, }, 'GIRATINA': { - 'ORIGIN': 501, + 'ORIGIN': NATIONAL_DEX_COUNT + 8, }, 'SHAYMIN': { - 'SKY': 502, + 'SKY': NATIONAL_DEX_COUNT + 9, }, 'ROTOM': { - 'HEAT': 503, - 'WASH': 504, - 'FROST': 505, - 'FAN': 506, - 'MOW': 507, + 'HEAT': NATIONAL_DEX_COUNT + 10, + 'WASH': NATIONAL_DEX_COUNT + 11, + 'FROST': NATIONAL_DEX_COUNT + 12, + 'FAN': NATIONAL_DEX_COUNT + 13, + 'MOW': NATIONAL_DEX_COUNT + 14, }, } def indexer(file_path: pathlib.Path) -> int: name = file_path.parent.stem.upper() if name == '000': return 0 - if name == 'egg': return 494 - if name == 'bad_egg': return 495 + if name == 'egg': return NATIONAL_DEX_COUNT + 1 + if name == 'bad_egg': return NATIONAL_DEX_COUNT + 2 if file_path.parent.parent.stem == 'forms': species_idx = file_path.parent.parent.parent.stem.upper() form = file_path.parent.stem.upper() diff --git a/tools/json2bin/pokemon_personal_data.py b/tools/json2bin/pokemon_personal_data.py index f53872b4d9..8ec7c4657a 100644 --- a/tools/json2bin/pokemon_personal_data.py +++ b/tools/json2bin/pokemon_personal_data.py @@ -55,35 +55,38 @@ def parse_color(sprite: dict, size: int, _: None) -> bytes: .register('learnset.tms', 16, j2b.pack_flags, tm_learnset.TMLearnsetFlags) +NATIONAL_DEX_COUNT = 493 + FORM_INDICES = { 'DEOXYS' : { - 'ATTACK': 496, - 'DEFENSE': 497, - 'SPEED': 498, + 'ATTACK': NATIONAL_DEX_COUNT + 3, + 'DEFENSE': NATIONAL_DEX_COUNT + 4, + 'SPEED': NATIONAL_DEX_COUNT + 5, }, 'WORMADAM': { - 'SANDY': 499, - 'TRASH': 500, + 'SANDY': NATIONAL_DEX_COUNT + 6, + 'TRASH': NATIONAL_DEX_COUNT + 7, }, 'GIRATINA': { - 'ORIGIN': 501, + 'ORIGIN': NATIONAL_DEX_COUNT + 8, }, 'SHAYMIN': { - 'SKY': 502, + 'SKY': NATIONAL_DEX_COUNT + 9, }, 'ROTOM': { - 'HEAT': 503, - 'WASH': 504, - 'FROST': 505, - 'FAN': 506, - 'MOW': 507, + 'HEAT': NATIONAL_DEX_COUNT + 10, + 'WASH': NATIONAL_DEX_COUNT + 11, + 'FROST': NATIONAL_DEX_COUNT + 12, + 'FAN': NATIONAL_DEX_COUNT + 13, + 'MOW': NATIONAL_DEX_COUNT + 14, }, } + def indexer(file_path: pathlib.Path) -> int: name = file_path.parent.stem.upper() if name == '000': return 0 - if name == 'egg': return 494 - if name == 'bad_egg': return 495 + if name == 'egg': return NATIONAL_DEX_COUNT + 1 + if name == 'bad_egg': return NATIONAL_DEX_COUNT + 2 if file_path.parent.parent.stem == 'forms': species_idx = file_path.parent.parent.parent.stem.upper() form = file_path.parent.stem.upper() diff --git a/tools/json2bin/pokemon_wotbl_data.py b/tools/json2bin/pokemon_wotbl_data.py index 317791c402..52f492ef5b 100644 --- a/tools/json2bin/pokemon_wotbl_data.py +++ b/tools/json2bin/pokemon_wotbl_data.py @@ -34,37 +34,38 @@ def parse_level_up_moves(table: dict, _size: int, _enum: None): .align(4) +NATIONAL_DEX_COUNT = 493 + FORM_INDICES = { 'DEOXYS' : { - 'ATTACK': 496, - 'DEFENSE': 497, - 'SPEED': 498, + 'ATTACK': NATIONAL_DEX_COUNT + 3, + 'DEFENSE': NATIONAL_DEX_COUNT + 4, + 'SPEED': NATIONAL_DEX_COUNT + 5, }, 'WORMADAM': { - 'SANDY': 499, - 'TRASH': 500, + 'SANDY': NATIONAL_DEX_COUNT + 6, + 'TRASH': NATIONAL_DEX_COUNT + 7, }, 'GIRATINA': { - 'ORIGIN': 501, + 'ORIGIN': NATIONAL_DEX_COUNT + 8, }, 'SHAYMIN': { - 'SKY': 502, + 'SKY': NATIONAL_DEX_COUNT + 9, }, 'ROTOM': { - 'HEAT': 503, - 'WASH': 504, - 'FROST': 505, - 'FAN': 506, - 'MOW': 507, + 'HEAT': NATIONAL_DEX_COUNT + 10, + 'WASH': NATIONAL_DEX_COUNT + 11, + 'FROST': NATIONAL_DEX_COUNT + 12, + 'FAN': NATIONAL_DEX_COUNT + 13, + 'MOW': NATIONAL_DEX_COUNT + 14, }, } - def indexer(file_path: pathlib.Path) -> int: name = file_path.parent.stem.upper() if name == '000': return 0 - if name == 'egg': return 494 - if name == 'bad_egg': return 495 + if name == 'egg': return NATIONAL_DEX_COUNT + 1 + if name == 'bad_egg': return NATIONAL_DEX_COUNT + 2 if file_path.parent.parent.stem == 'forms': species_idx = file_path.parent.parent.parent.stem.upper() form = file_path.parent.stem.upper()