diff options
Diffstat (limited to 'src/pokedex_screen.c')
-rw-r--r-- | src/pokedex_screen.c | 779 |
1 files changed, 691 insertions, 88 deletions
diff --git a/src/pokedex_screen.c b/src/pokedex_screen.c index a36108425..0d140cfe3 100644 --- a/src/pokedex_screen.c +++ b/src/pokedex_screen.c @@ -69,8 +69,14 @@ struct PokedexScreenData struct PokedexScreenWindowGfx { - const u16 *map; - const u16 *pal; + const u16 * map; + const u16 * pal; +}; + +struct PokedexCategoryPage +{ + const u16 * species; + u8 count; }; EWRAM_DATA struct PokedexScreenData * gUnknown_203ACF0 = NULL; @@ -114,6 +120,9 @@ void sub_81068DC(u8 category, u8 a1); u8 sub_8106AF8(u16 a0); void sub_8106B34(void); void sub_8106E78(const u8 *a0, s32 a1); +static void sub_8102EC0(s32 itemIndex, bool8 onInit, struct ListMenu *list); +static void sub_8102F48(u8 windowId, s32 itemId, u8 y); +static void sub_8103A40(u8 windowId, s32 itemId, u8 y); #include "data/pokemon_graphics/footprint_table.h" @@ -132,21 +141,21 @@ const u16 gUnknown_84406C8[] = { }; const u16 gUnknown_84406E0[] = INCBIN_U16("graphics/pokedex/unk_84406E0.gbapal"); -const u32 gUnknown_84408E0[] = INCBIN_U32("graphics/pokedex/unk_84408E0.bin.lz"); -const u32 gUnknown_8440BD8[] = INCBIN_U32("graphics/pokedex/unk_8440BD8.bin.lz"); +const u16 gUnknown_84408E0[] = INCBIN_U16("graphics/pokedex/unk_84408E0.bin.lz"); +const u16 gUnknown_8440BD8[] = INCBIN_U16("graphics/pokedex/unk_8440BD8.bin.lz"); const u32 gUnknown_8440EF0[] = INCBIN_U32("graphics/pokedex/unk_8440EF0.bin.lz"); -const u32 gUnknown_844112C[] = INCBIN_U32("graphics/pokedex/unk_844112C.bin.lz"); -const u32 gUnknown_84414BC[] = INCBIN_U32("graphics/pokedex/unk_84414BC.bin.lz"); +const u16 gUnknown_844112C[] = INCBIN_U16("graphics/pokedex/unk_844112C.bin.lz"); +const u16 gUnknown_84414BC[] = INCBIN_U16("graphics/pokedex/unk_84414BC.bin.lz"); const u32 gUnknown_8441808[] = INCBIN_U32("graphics/pokedex/unk_8441808.bin.lz"); -const u32 gUnknown_8441A40[] = INCBIN_U32("graphics/pokedex/unk_8441A40.bin.lz"); -const u32 gUnknown_8441D54[] = INCBIN_U32("graphics/pokedex/unk_8441D54.bin.lz"); -const u32 gUnknown_8442004[] = INCBIN_U32("graphics/pokedex/unk_8442004.bin.lz"); -const u32 gUnknown_844223C[] = INCBIN_U32("graphics/pokedex/unk_844223C.bin.lz"); -const u32 gUnknown_84424E4[] = INCBIN_U32("graphics/pokedex/unk_84424E4.bin.lz"); -const u32 gUnknown_8442838[] = INCBIN_U32("graphics/pokedex/unk_8442838.bin.lz"); -const u32 gUnknown_8442BC0[] = INCBIN_U32("graphics/pokedex/unk_8442BC0.bin.lz"); -const u32 gUnknown_8442EF8[] = INCBIN_U32("graphics/pokedex/unk_8442EF8.bin.lz"); -const u32 gUnknown_844318C[] = INCBIN_U32("graphics/pokedex/unk_844318C.bin.lz"); +const u16 gUnknown_8441A40[] = INCBIN_U16("graphics/pokedex/unk_8441A40.bin.lz"); +const u16 gUnknown_8441D54[] = INCBIN_U16("graphics/pokedex/unk_8441D54.bin.lz"); +const u16 gUnknown_8442004[] = INCBIN_U16("graphics/pokedex/unk_8442004.bin.lz"); +const u16 gUnknown_844223C[] = INCBIN_U16("graphics/pokedex/unk_844223C.bin.lz"); +const u16 gUnknown_84424E4[] = INCBIN_U16("graphics/pokedex/unk_84424E4.bin.lz"); +const u16 gUnknown_8442838[] = INCBIN_U16("graphics/pokedex/unk_8442838.bin.lz"); +const u16 gUnknown_8442BC0[] = INCBIN_U16("graphics/pokedex/unk_8442BC0.bin.lz"); +const u16 gUnknown_8442EF8[] = INCBIN_U16("graphics/pokedex/unk_8442EF8.bin.lz"); +const u16 gUnknown_844318C[] = INCBIN_U16("graphics/pokedex/unk_844318C.bin.lz"); const u16 gUnknown_8443420[] = INCBIN_U16("graphics/pokedex/unk_8443420.gbapal"); const u16 gUnknown_8443440[] = INCBIN_U16("graphics/pokedex/unk_8443440.gbapal"); const u16 gUnknown_8443460[] = INCBIN_U16("graphics/pokedex/unk_8443460.gbapal"); @@ -180,29 +189,622 @@ static const u8 gExpandedPlaceholder_PokedexDescription[] = _(""); #include "data/pokemon/pokedex_text.h" #include "data/pokemon/pokedex_entries.h" -extern const struct BgTemplate gUnknown_8451EBC[4]; -extern const struct WindowTemplate gUnknown_8451ECC[]; -extern const struct PokedexScreenData gUnknown_8451EE4; -extern const struct WindowTemplate gUnknown_8451F54; -extern const struct WindowTemplate gUnknown_8451F5C; -extern const struct WindowTemplate gUnknown_8451F64; -extern const struct ListMenuTemplate gUnknown_8452004; -extern const struct ListMenuTemplate gUnknown_84520BC; -extern const struct ScrollArrowsTemplate gUnknown_84520D4; -extern const struct ScrollArrowsTemplate gUnknown_84520E4; -extern const struct PokedexScreenWindowGfx gUnknown_84520F4[]; -extern const struct WindowTemplate gUnknown_845216C; -extern const struct ListMenuTemplate gUnknown_8452174; -extern const struct ListMenuWindowRect gUnknown_845218C; -extern const struct ScrollArrowsTemplate gUnknown_84521B4; -extern const struct WindowTemplate gUnknown_84521C4; -extern const struct WindowTemplate gUnknown_84521CC; -extern const u16 gUnknown_845228C[]; -extern const u8 (*const gUnknown_8452334[])[4]; -extern const u8 *const gDexCategoryNamePtrs[]; -extern const u8 gUnknown_8452388[][30]; -extern const struct ScrollArrowsTemplate gUnknown_84524B4; -extern const struct CursorStruct gUnknown_84524C4; +static const struct BgTemplate sUnknown_8451EBC[] = { + { + .bg = 0, + .charBaseIndex = 0, + .mapBaseIndex = 5, + .screenSize = 0, + .paletteMode = 0, + .priority = 0, + .baseTile = 0x0000 + }, + { + .bg = 1, + .charBaseIndex = 2, + .mapBaseIndex = 4, + .screenSize = 0, + .paletteMode = 0, + .priority = 1, + .baseTile = 0x0000 + }, + { + .bg = 2, + .charBaseIndex = 2, + .mapBaseIndex = 6, + .screenSize = 0, + .paletteMode = 0, + .priority = 2, + .baseTile = 0x0000 + }, + { + .bg = 3, + .charBaseIndex = 0, + .mapBaseIndex = 7, + .screenSize = 0, + .paletteMode = 0, + .priority = 3, + .baseTile = 0x0000 + }, +}; + +static const struct WindowTemplate sUnknown_8451ECC[] = { + { + .bg = 0, + .tilemapLeft = 0, + .tilemapTop = 0, + .width = 30, + .height = 2, + .paletteNum = 15, + .baseBlock = 0x03c4 + }, + { + .bg = 0, + .tilemapLeft = 0, + .tilemapTop = 18, + .width = 30, + .height = 2, + .paletteNum = 15, + .baseBlock = 0x0388 + }, + { + .bg = 255, + .tilemapLeft = 0, + .tilemapTop = 0, + .width = 0, + .height = 0, + .paletteNum = 0, + .baseBlock = 0x0000 + }, +}; + +static const struct PokedexScreenData sUnknown_8451EE4 = { + .field_10 = 1, + .field_14 = -1, + .field_15 = -1, + .field_16 = -1, + .field_18 = {-1, -1, -1, -1}, + .field_20 = {-1, -1, -1, -1}, + .field_24 = {-1, -1, -1, -1}, + .field_40 = -1, + .field_4A = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + .field_60 = -1, + .field_61 = -1, +}; + + +static const struct WindowTemplate sUnknown_8451F54 = { + .bg = 1, + .tilemapLeft = 1, + .tilemapTop = 2, + .width = 20, + .height = 16, + .paletteNum = 0, + .baseBlock = 0x0008 + }; + +static const struct WindowTemplate sUnknown_8451F5C = { + .bg = 1, + .tilemapLeft = 21, + .tilemapTop = 11, + .width = 8, + .height = 6, + .paletteNum = 1, + .baseBlock = 0x0148 + }; + +static const struct WindowTemplate sUnknown_8451F64 = { + .bg = 1, + .tilemapLeft = 21, + .tilemapTop = 2, + .width = 9, + .height = 9, + .paletteNum = 0, + .baseBlock = 0x0178 + }; + +static const struct ListMenuItem sUnknown_8451F6C[] = { + {gText_PokemonList, -3}, + {gText_NumericalMode, 9}, + {gText_PokemonHabitats, -3}, + {gText_DexCategory_GrasslandPkmn, 0}, + {gText_DexCategory_ForestPkmn, 1}, + {gText_DexCategory_WatersEdgePkmn, 2}, + {gText_DexCategory_SeaPkmn, 3}, + {gText_DexCategory_CavePkmn, 4}, + {gText_DexCategory_MountainPkmn, 5}, + {gText_DexCategory_RoughTerrainPkmn, 6}, + {gText_DexCategory_UrbanPkmn, 7}, + {gText_DexCategory_RarePkmn, 8}, + {gText_Search, -3}, + {gText_AToZMode, 10}, + {gText_TypeMode, 11}, + {gText_LightestMode, 12}, + {gText_SmallestMode, 13}, + {gText_PokedexOther, -3}, + {gText_ClosePokedex, -2}, +}; + +static const struct ListMenuTemplate sUnknown_8452004 = { + .items = sUnknown_8451F6C, + .moveCursorFunc = sub_8102EC0, + .itemPrintFunc = sub_8102F48, + .totalItems = NELEMS(sUnknown_8451F6C), + .maxShowed = 9, + .windowId = 0, + .header_X = 0, + .item_X = 12, + .cursor_X = 4, + .upText_Y = 2, + .cursorPal = 1, + .fillValue = 0, + .cursorShadowPal = 3, + .lettersSpacing = 1, + .itemVerticalPadding = 0, + .scrollMultiple = 0, + .fontId = 2, + .cursorKind = 0, +}; + +static const struct ListMenuItem sUnknown_845201C[] = { + {gText_PokemonList, -3}, + {gText_NumericalModeKanto, 9}, + {gText_NumericalModeNational, 14}, + {gText_PokemonHabitats, -3}, + {gText_DexCategory_GrasslandPkmn, 0}, + {gText_DexCategory_ForestPkmn, 1}, + {gText_DexCategory_WatersEdgePkmn, 2}, + {gText_DexCategory_SeaPkmn, 3}, + {gText_DexCategory_CavePkmn, 4}, + {gText_DexCategory_MountainPkmn, 5}, + {gText_DexCategory_RoughTerrainPkmn, 6}, + {gText_DexCategory_UrbanPkmn, 7}, + {gText_DexCategory_RarePkmn, 8}, + {gText_Search, -3}, + {gText_AToZMode, 10}, + {gText_TypeMode, 11}, + {gText_LightestMode, 12}, + {gText_SmallestMode, 13}, + {gText_PokedexOther, -3}, + {gText_ClosePokedex, -2}, +}; + +static const struct ListMenuTemplate sUnknown_84520BC = { + .items = sUnknown_845201C, + .moveCursorFunc = sub_8102EC0, + .itemPrintFunc = sub_8102F48, + .totalItems = NELEMS(sUnknown_845201C), + .maxShowed = 9, + .windowId = 0, + .header_X = 0, + .item_X = 12, + .cursor_X = 4, + .upText_Y = 2, + .cursorPal = 1, + .fillValue = 0, + .cursorShadowPal = 3, + .lettersSpacing = 1, + .itemVerticalPadding = 0, + .scrollMultiple = 0, + .fontId = 2, + .cursorKind = 0, +}; + +static const struct ScrollArrowsTemplate sUnknown_84520D4 = { + .firstArrowType = 2, + .firstX = 200, + .firstY = 19, + .secondArrowType = 3, + .secondX = 200, + .secondY = 141, + .fullyUpThreshold = 0, + .fullyDownThreshold = 10, + .tileTag = 2000, + .palTag = 0xFFFF, + .palNum = 1 +}; + +static const struct ScrollArrowsTemplate sUnknown_84520E4 = { + .firstArrowType = 2, + .firstX = 200, + .firstY = 19, + .secondArrowType = 3, + .secondX = 200, + .secondY = 141, + .fullyUpThreshold = 0, + .fullyDownThreshold = 11, + .tileTag = 2000, + .palTag = 0xFFFF, + .palNum = 1 +}; + + +static const struct PokedexScreenWindowGfx sUnknown_84520F4[] = { + {.map = gUnknown_84414BC, .pal = gUnknown_84434A0}, + {.map = gUnknown_844112C, .pal = gUnknown_8443480}, + {.map = gUnknown_8442838, .pal = gUnknown_8443580}, + {.map = gUnknown_8442004, .pal = gUnknown_8443520}, + {.map = gUnknown_84408E0, .pal = gUnknown_8443420}, + {.map = gUnknown_8441A40, .pal = gUnknown_84434E0}, + {.map = gUnknown_84424E4, .pal = gUnknown_8443560}, + {.map = gUnknown_8440BD8, .pal = gUnknown_8443440}, + {.map = gUnknown_8441D54, .pal = gUnknown_8443500}, + {.map = gUnknown_844223C, .pal = gUnknown_8443540}, + {.map = gUnknown_8E9C16C, .pal = gUnknown_8E9C14C}, + {.map = gUnknown_8442BC0, .pal = gUnknown_84435A0}, + {.map = gUnknown_8442EF8, .pal = gUnknown_84435C0}, + {.map = gUnknown_844318C, .pal = gUnknown_84435E0}, + {.map = gUnknown_844223C, .pal = gUnknown_8443540}, +}; + +static const struct WindowTemplate sUnknown_845216C = { + .bg = 1, + .tilemapLeft = 2, + .tilemapTop = 2, + .width = 23, + .height = 16, + .paletteNum = 0, + .baseBlock = 0x0008 +}; + +static const struct ListMenuTemplate sUnknown_8452174 = { + .items = sUnknown_8451F6C, + .moveCursorFunc = ListMenuDefaultCursorMoveFunc, + .itemPrintFunc = sub_8103A40, + .totalItems = 0, + .maxShowed = 9, + .windowId = 0, + .header_X = 0, + .item_X = 56, + .cursor_X = 4, + .upText_Y = 2, + .cursorPal = 1, + .fillValue = 0, + .cursorShadowPal = 3, + .lettersSpacing = 1, + .itemVerticalPadding = 0, + .scrollMultiple = 1, + .fontId = 2, + .cursorKind = 0, +}; + +static const struct ListMenuWindowRect sUnknown_845218C = { + .x = 0, + .y = 0, + .width = 5, + .height = 16, + .palNum = 0, +}; + +// Unused +static const u8 gUnknown_8452194[] = { + 0x05, 0x00, 0x02, 0x10, 0x01, 0x00, 0x00, 0x00, + 0x07, 0x00, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, + 0x0f, 0x00, 0x08, 0x10, 0x02, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00 +}; + +static const struct ScrollArrowsTemplate sUnknown_84521B4 = { + .firstArrowType = 2, + .firstX = 200, + .firstY = 19, + .secondArrowType = 3, + .secondX = 200, + .secondY = 141, + .fullyUpThreshold = 0, + .fullyDownThreshold = 0, + .tileTag = 2000, + .palTag = 0xFFFF, + .palNum = 1, +}; + +static const struct WindowTemplate sUnknown_84521C4 = { + .bg = 2, + .tilemapLeft = 0, + .tilemapTop = 0, + .width = 8, + .height = 8, + .paletteNum = 0, + .baseBlock = 0x0000 +}; + +static const struct WindowTemplate sUnknown_84521CC = { + .bg = 1, + .tilemapLeft = 0, + .tilemapTop = 0, + .width = 8, + .height = 5, + .paletteNum = 0, + .baseBlock = 0x0000 +}; + +const struct WindowTemplate gUnknown_84521D4 = { + .bg = 1, + .tilemapLeft = 19, + .tilemapTop = 3, + .width = 8, + .height = 8, + .paletteNum = 9, + .baseBlock = 0x01a8 +}; + +const struct WindowTemplate gUnknown_84521DC = { + .bg = 1, + .tilemapLeft = 2, + .tilemapTop = 3, + .width = 13, + .height = 8, + .paletteNum = 0, + .baseBlock = 0x01e8 +}; + +const struct WindowTemplate gUnknown_84521E4 = { + .bg = 1, + .tilemapLeft = 0, + .tilemapTop = 11, + .width = 30, + .height = 7, + .paletteNum = 0, + .baseBlock = 0x0250 +}; + +const struct WindowTemplate gUnknown_84521EC = { + .bg = 2, + .tilemapLeft = 1, + .tilemapTop = 2, + .width = 4, + .height = 4, + .paletteNum = 10, + .baseBlock = 0x01a8 +}; + +const struct WindowTemplate gUnknown_84521F4 = { + .bg = 2, + .tilemapLeft = 5, + .tilemapTop = 2, + .width = 8, + .height = 3, + .paletteNum = 0, + .baseBlock = 0x01b8 +}; + +const struct WindowTemplate gUnknown_84521FC = { + .bg = 2, + .tilemapLeft = 2, + .tilemapTop = 7, + .width = 10, + .height = 2, + .paletteNum = 0, + .baseBlock = 0x01d0 +}; + +const struct WindowTemplate gUnknown_8452204 = { + .bg = 2, + .tilemapLeft = 18, + .tilemapTop = 2, + .width = 10, + .height = 2, + .paletteNum = 0, + .baseBlock = 0x01e4 +}; + +const struct WindowTemplate gUnknown_845220C = { + .bg = 2, + .tilemapLeft = 5, + .tilemapTop = 5, + .width = 8, + .height = 2, + .paletteNum = 11, + .baseBlock = 0x01f8 +}; + +const struct WindowTemplate gUnknown_8452214 = { + .bg = 2, + .tilemapLeft = 17, + .tilemapTop = 4, + .width = 12, + .height = 9, + .paletteNum = 0, + .baseBlock = 0x0208 +}; + +static const struct WindowTemplate sUnknown_845221C = { + .bg = 2, + .tilemapLeft = 13, + .tilemapTop = 4, + .width = 4, + .height = 3, + .paletteNum = 0, + .baseBlock = 0x0274 +}; + +static const struct WindowTemplate sUnknown_8452224 = { + .bg = 2, + .tilemapLeft = 13, + .tilemapTop = 7, + .width = 4, + .height = 3, + .paletteNum = 0, + .baseBlock = 0x0280 +}; + +static const struct WindowTemplate sUnknown_845222C = { + .bg = 2, + .tilemapLeft = 13, + .tilemapTop = 10, + .width = 4, + .height = 3, + .paletteNum = 0, + .baseBlock = 0x028c +}; + +static const struct WindowTemplate sUnknown_8452234 = { + .bg = 2, + .tilemapLeft = 13, + .tilemapTop = 13, + .width = 4, + .height = 4, + .paletteNum = 0, + .baseBlock = 0x0298 +}; + +static const struct WindowTemplate sUnknown_845223C = { + .bg = 2, + .tilemapLeft = 17, + .tilemapTop = 13, + .width = 4, + .height = 4, + .paletteNum = 0, + .baseBlock = 0x02a8 +}; + +static const struct WindowTemplate sUnknown_8452244 = { + .bg = 2, + .tilemapLeft = 21, + .tilemapTop = 13, + .width = 4, + .height = 4, + .paletteNum = 0, + .baseBlock = 0x02b8 +}; + +static const struct WindowTemplate sUnknown_845224C = { + .bg = 2, + .tilemapLeft = 25, + .tilemapTop = 13, + .width = 4, + .height = 4, + .paletteNum = 0, + .baseBlock = 0x02c8 +}; + +struct { + const struct WindowTemplate * window; + const u32 * tilemap; +} const gUnknown_8452254[] = { + {&sUnknown_845221C, gUnknown_8443910}, + {&sUnknown_8452224, gUnknown_8443988}, + {&sUnknown_845222C, gUnknown_84439FC}, + {&sUnknown_8452234, gUnknown_8443A78}, + {&sUnknown_845223C, gUnknown_8443AF8}, + {&sUnknown_8452244, gUnknown_8443BB0}, + {&sUnknown_845224C, gUnknown_8443C54}, +}; + +static const u16 sUnknown_845228C[] = INCBIN_U16("graphics/pokedex/unk_845228C.bin"); + +static const u8 sUnknown_845230C[][4] = { + {0x0b, 0x03, 0x0b, 0x0b}, +}; + +static const u8 sUnknown_8452310[][4] = { + {0x03, 0x03, 0x0b, 0x03}, + {0x12, 0x09, 0x0a, 0x0b}, +}; + +static const u8 sUnknown_8452318[][4] = { + {0x01, 0x02, 0x09, 0x02}, + {0x0b, 0x09, 0x03, 0x0b}, + {0x15, 0x03, 0x15, 0x0b} +}; + +static const u8 sUnknown_8452324[][4] = { + {0x00, 0x02, 0x06, 0x03}, + {0x07, 0x0a, 0x00, 0x0c}, + {0x0f, 0x0a, 0x16, 0x0b}, + {0x16, 0x02, 0x0f, 0x04} +}; + +const u8 (*const gUnknown_8452334[])[4] = { + sUnknown_845230C, + sUnknown_8452310, + sUnknown_8452318, + sUnknown_8452324, +}; + +static const u8 * const sDexCategoryNamePtrs[] = { + gText_DexCategory_GrasslandPkmn, + gText_DexCategory_ForestPkmn, + gText_DexCategory_WatersEdgePkmn, + gText_DexCategory_SeaPkmn, + gText_DexCategory_CavePkmn, + gText_DexCategory_MountainPkmn, + gText_DexCategory_RoughTerrainPkmn, + gText_DexCategory_UrbanPkmn, + gText_DexCategory_RarePkmn, +}; + +const u16 gUnknown_8452368[] = INCBIN_U16("graphics/pokedex/unk_8452368.gbapal"); + +static const u8 sUnknown_8452388[][30] = { + { + 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, + 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, + 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e + }, { + 0x05, 0x0b, 0x11, 0x17, 0x1d, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, + 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, + 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e + }, { + 0x02, 0x05, 0x08, 0x0b, 0x0e, 0x11, 0x14, 0x17, 0x1a, 0x1d, + 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, + 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e + }, { + 0x02, 0x03, 0x05, 0x07, 0x09, 0x0b, 0x0d, 0x0f, 0x11, 0x13, + 0x15, 0x17, 0x19, 0x1b, 0x1d, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, + 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e + }, { + 0x02, 0x04, 0x05, 0x07, 0x08, 0x0a, 0x0b, 0x0d, 0x0e, 0x10, + 0x11, 0x13, 0x14, 0x16, 0x17, 0x19, 0x1a, 0x1c, 0x1d, 0x1e, + 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e + }, { + 0x01, 0x02, 0x03, 0x04, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, + 0x0d, 0x0f, 0x10, 0x11, 0x13, 0x14, 0x15, 0x17, 0x18, 0x19, + 0x1b, 0x1c, 0x1d, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e + }, { + 0x01, 0x02, 0x03, 0x04, 0x05, 0x07, 0x08, 0x09, 0x0a, 0x0b, + 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x14, 0x15, 0x16, + 0x17, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1e, 0x1e, 0x1e + }, { + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0b, + 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x15, 0x16, + 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1e, 0x1e + }, { + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, + 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, + 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e + }, { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, + 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, + 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d + }, +}; + +static const struct ScrollArrowsTemplate sUnknown_84524B4 = { + .firstArrowType = 0, + .firstX = 16, + .firstY = 80, + .secondArrowType = 1, + .secondX = 224, + .secondY = 80, + .fullyUpThreshold = 0, + .fullyDownThreshold = 0, + .tileTag = 2000, + .palTag = 0xFFFF, + .palNum = 1, +}; + +const struct CursorStruct gUnknown_84524C4 = { + .left = 0, + .top = 160, + .rowWidth = 64, + .rowHeight = 40, + .tileTag = 2002, + .palTag = 0xFFFF, + .palNum = 4, +}; + +#include "data/pokemon/pokedex_categories.h" void sub_81024C0(void) { @@ -239,7 +841,7 @@ void sub_810250C(void) ResetTasks(); ScanlineEffect_Stop(); ResetBgsAndClearDma3BusyFlags(TRUE); - InitBgsFromTemplates(0, gUnknown_8451EBC, NELEMS(gUnknown_8451EBC)); + InitBgsFromTemplates(0, sUnknown_8451EBC, NELEMS(sUnknown_8451EBC)); SetBgTilemapBuffer(3, (u16*)Alloc(BG_SCREEN_SIZE)); SetBgTilemapBuffer(2, (u16*)Alloc(BG_SCREEN_SIZE)); SetBgTilemapBuffer(1, (u16*)Alloc(BG_SCREEN_SIZE)); @@ -248,14 +850,14 @@ void sub_810250C(void) DecompressAndLoadBgGfxUsingHeap(3, (void*)gUnknown_84403AC, BG_SCREEN_SIZE, 0, 0); else DecompressAndLoadBgGfxUsingHeap(3, (void*)gUnknown_8440274, BG_SCREEN_SIZE, 0, 0); - InitWindows(gUnknown_8451ECC); + InitWindows(sUnknown_8451ECC); DeactivateAllTextPrinters(); m4aSoundVSyncOn(); SetVBlankCallback(sub_81024C0); EnableInterrupts(INTR_FLAG_VBLANK); taskId = CreateTask(sub_810287C, 0); gUnknown_203ACF0 = Alloc(sizeof(struct PokedexScreenData)); - *gUnknown_203ACF0 = gUnknown_8451EE4; + *gUnknown_203ACF0 = sUnknown_8451EE4; gUnknown_203ACF0->field_00 = taskId; gUnknown_203ACF0->field_44 = Alloc(NATIONAL_DEX_COUNT * sizeof(struct ListMenuItem)); gUnknown_203ACF0->field_6A = sub_8104BBC(0, 1); @@ -381,9 +983,9 @@ static void sub_810287C(u8 taskId) case 5: ListMenuGetScrollAndRow(gUnknown_203ACF0->field_17, &gUnknown_203ACF0->field_62, NULL); if (IsNationalPokedexEnabled()) - gUnknown_203ACF0->field_60 = AddScrollIndicatorArrowPair(&gUnknown_84520E4, &gUnknown_203ACF0->field_62); + gUnknown_203ACF0->field_60 = AddScrollIndicatorArrowPair(&sUnknown_84520E4, &gUnknown_203ACF0->field_62); else - gUnknown_203ACF0->field_60 = AddScrollIndicatorArrowPair(&gUnknown_84520D4, &gUnknown_203ACF0->field_62); + gUnknown_203ACF0->field_60 = AddScrollIndicatorArrowPair(&sUnknown_84520D4, &gUnknown_203ACF0->field_62); gUnknown_203ACF0->field_01 = 6; break; case 6: @@ -478,41 +1080,41 @@ static void sub_8102C28(void) FillBgTilemapBufferRect(3, 0x00E, 0, 0, 30, 20, 0x00); FillBgTilemapBufferRect(2, 0x000, 0, 0, 30, 20, 0x11); FillBgTilemapBufferRect(1, 0x000, 0, 0, 30, 20, 0x11); - gUnknown_203ACF0->field_14 = AddWindow(&gUnknown_8451F54); - gUnknown_203ACF0->field_15 = AddWindow(&gUnknown_8451F5C); - gUnknown_203ACF0->field_16 = AddWindow(&gUnknown_8451F64); + gUnknown_203ACF0->field_14 = AddWindow(&sUnknown_8451F54); + gUnknown_203ACF0->field_15 = AddWindow(&sUnknown_8451F5C); + gUnknown_203ACF0->field_16 = AddWindow(&sUnknown_8451F64); if (IsNationalPokedexEnabled()) { - listMenuTemplate = gUnknown_84520BC; + listMenuTemplate = sUnknown_84520BC; listMenuTemplate.windowId = gUnknown_203ACF0->field_14; gUnknown_203ACF0->field_17 = ListMenuInit(&listMenuTemplate, gUnknown_203ACF0->field_12, gUnknown_203ACF0->field_10); FillWindowPixelBuffer(gUnknown_203ACF0->field_16, PIXEL_FILL(0)); - sub_81047C8(gUnknown_203ACF0->field_16, 0, gUnknown_8415DC4, 0, 2, 0); - sub_81047C8(gUnknown_203ACF0->field_16, 0, gUnknown_8415DD1, 8, 13, 0); + sub_81047C8(gUnknown_203ACF0->field_16, 0, gText_Seen, 0, 2, 0); + sub_81047C8(gUnknown_203ACF0->field_16, 0, gText_Kanto, 8, 13, 0); sub_810491C(gUnknown_203ACF0->field_16, 0, gUnknown_203ACF0->field_66, 52, 13, 2); - sub_81047C8(gUnknown_203ACF0->field_16, 0, gUnknown_8415DD7, 8, 24, 0); + sub_81047C8(gUnknown_203ACF0->field_16, 0, gText_National, 8, 24, 0); sub_810491C(gUnknown_203ACF0->field_16, 0, gUnknown_203ACF0->field_6A, 52, 24, 2); - sub_81047C8(gUnknown_203ACF0->field_16, 0, gUnknown_8415DCA, 0, 37, 0); - sub_81047C8(gUnknown_203ACF0->field_16, 0, gUnknown_8415DD1, 8, 48, 0); + sub_81047C8(gUnknown_203ACF0->field_16, 0, gText_Owned, 0, 37, 0); + sub_81047C8(gUnknown_203ACF0->field_16, 0, gText_Kanto, 8, 48, 0); sub_810491C(gUnknown_203ACF0->field_16, 0, gUnknown_203ACF0->field_68, 52, 48, 2); - sub_81047C8(gUnknown_203ACF0->field_16, 0, gUnknown_8415DD7, 8, 59, 0); + sub_81047C8(gUnknown_203ACF0->field_16, 0, gText_National, 8, 59, 0); sub_810491C(gUnknown_203ACF0->field_16, 0, gUnknown_203ACF0->field_6C, 52, 59, 2); } else { - listMenuTemplate = gUnknown_8452004; + listMenuTemplate = sUnknown_8452004; listMenuTemplate.windowId = gUnknown_203ACF0->field_14; gUnknown_203ACF0->field_17 = ListMenuInit(&listMenuTemplate, gUnknown_203ACF0->field_12, gUnknown_203ACF0->field_10); FillWindowPixelBuffer(gUnknown_203ACF0->field_16, PIXEL_FILL(0)); - sub_81047C8(gUnknown_203ACF0->field_16, 1, gUnknown_8415DC4, 0, 9, 0); + sub_81047C8(gUnknown_203ACF0->field_16, 1, gText_Seen, 0, 9, 0); sub_810491C(gUnknown_203ACF0->field_16, 1, gUnknown_203ACF0->field_66, 32, 21, 2); - sub_81047C8(gUnknown_203ACF0->field_16, 1, gUnknown_8415DCA, 0, 37, 0); + sub_81047C8(gUnknown_203ACF0->field_16, 1, gText_Owned, 0, 37, 0); sub_810491C(gUnknown_203ACF0->field_16, 1, gUnknown_203ACF0->field_68, 32, 49, 2); } FillWindowPixelBuffer(0, PIXEL_FILL(15)); - sub_8106E78(gUnknown_8415D9C, 1); + sub_8106E78(gText_PokedexTableOfContents, 1); FillWindowPixelBuffer(1, PIXEL_FILL(15)); - sub_8104C2C(gUnknown_8415DB8); + sub_8104C2C(gText_PickOK); PutWindowTilemap(0); CopyWindowToVram(0, COPYWIN_GFX); PutWindowTilemap(1); @@ -521,7 +1123,7 @@ static void sub_8102C28(void) CopyWindowToVram(gUnknown_203ACF0->field_16, COPYWIN_GFX); } -void sub_8102EC0(s32 itemIndex, bool8 onInit, struct ListMenu *list) +static void sub_8102EC0(s32 itemIndex, bool8 onInit, struct ListMenu *list) { if (!onInit) PlaySE(SE_SELECT); @@ -532,16 +1134,17 @@ void sub_8102EC0(s32 itemIndex, bool8 onInit, struct ListMenu *list) } else { - CopyToWindowPixelBuffer(gUnknown_203ACF0->field_15, gUnknown_84520F4[itemIndex].map, 0x000, 0x000); - LoadPalette(gUnknown_84520F4[itemIndex].pal, 0x10, 0x20); + CopyToWindowPixelBuffer(gUnknown_203ACF0->field_15, sUnknown_84520F4[itemIndex].map, 0x000, 0x000); + LoadPalette(sUnknown_84520F4[itemIndex].pal, 0x10, 0x20); } PutWindowTilemap(gUnknown_203ACF0->field_15); CopyWindowToVram(gUnknown_203ACF0->field_15, COPYWIN_GFX); } -void sub_8102F48(u8 windowId, u32 itemId, u8 y) +static void sub_8102F48(u8 windowId, s32 itemId, u8 y) { - if (itemId > 8 || gUnknown_203ACF0->field_08 & (1 << itemId)) + u32 itemId_ = itemId; + if (itemId_ > 8 || gUnknown_203ACF0->field_08 & (1 << itemId_)) ListMenuOverrideSetColors(1, 0, 3); else ListMenuOverrideSetColors(10, 0, 11); @@ -619,14 +1222,14 @@ static void sub_810317C(void) struct ListMenuTemplate template; FillBgTilemapBufferRect(3, 0x00E, 0, 0, 30, 20, 0x00); FillBgTilemapBufferRect(1, 0x000, 0, 0, 32, 32, 0x11); - gUnknown_203ACF0->field_40 = AddWindow(&gUnknown_845216C); - template = gUnknown_8452174; + gUnknown_203ACF0->field_40 = AddWindow(&sUnknown_845216C); + template = sUnknown_8452174; template.items = gUnknown_203ACF0->field_44; template.windowId = gUnknown_203ACF0->field_40; template.totalItems = gUnknown_203ACF0->field_48; sub_8103924(&template, gUnknown_203ACF0->field_42); FillWindowPixelBuffer(0, PIXEL_FILL(15)); - sub_8106E78(gUnknown_8415F3D, 1); + sub_8106E78(gText_PokemonListNoColor, 1); FillWindowPixelBuffer(1, PIXEL_FILL(15)); sub_8104C2C(gText_PickOKExit); CopyWindowToVram(0, COPYWIN_GFX); @@ -705,14 +1308,14 @@ static void sub_810345C(void) struct ListMenuTemplate template; FillBgTilemapBufferRect(3, 0x00E, 0, 0, 30, 20, 0x00); FillBgTilemapBufferRect(1, 0x000, 0, 0, 32, 32, 0x11); - gUnknown_203ACF0->field_40 = AddWindow(&gUnknown_845216C); - template = gUnknown_8452174; + gUnknown_203ACF0->field_40 = AddWindow(&sUnknown_845216C); + template = sUnknown_8452174; template.items = gUnknown_203ACF0->field_44; template.windowId = gUnknown_203ACF0->field_40; template.totalItems = gUnknown_203ACF0->field_48; sub_8103924(&template, gUnknown_203ACF0->field_42); FillWindowPixelBuffer(0, PIXEL_FILL(15)); - sub_8106E78(gUnknown_8415F4A, 1); + sub_8106E78(gText_SearchNoColor, 1); FillWindowPixelBuffer(1, PIXEL_FILL(15)); sub_8104C2C(gText_PickOKExit); CopyWindowToVram(0, COPYWIN_GFX); @@ -744,7 +1347,7 @@ static u16 sub_8103518(u8 a0) } else { - gUnknown_203ACF0->field_44[i].label = gUnknown_8415F66; + gUnknown_203ACF0->field_44[i].label = gText_5Dashes; } gUnknown_203ACF0->field_44[i].index = (caught << 17) + (seen << 16) + NationalPokedexNumToSpecies(ndex_num); } @@ -830,7 +1433,7 @@ static u16 sub_8103518(u8 a0) } else { - gUnknown_203ACF0->field_44[i].label = gUnknown_8415F66; + gUnknown_203ACF0->field_44[i].label = gText_5Dashes; } gUnknown_203ACF0->field_44[i].index = (caught << 17) + (seen << 16) + NationalPokedexNumToSpecies(ndex_num); } @@ -845,16 +1448,16 @@ static void sub_8103924(const struct ListMenuTemplate * template, u8 a1) { default: case 0: - gUnknown_203ACF0->field_41 = ListMenuInitInRect(template, &gUnknown_845218C, gUnknown_203ACF0->field_36, gUnknown_203ACF0->field_34); + gUnknown_203ACF0->field_41 = ListMenuInitInRect(template, &sUnknown_845218C, gUnknown_203ACF0->field_36, gUnknown_203ACF0->field_34); break; case 1: case 2: case 3: case 4: - gUnknown_203ACF0->field_41 = ListMenuInitInRect(template, &gUnknown_845218C, gUnknown_203ACF0->field_3A, gUnknown_203ACF0->field_38); + gUnknown_203ACF0->field_41 = ListMenuInitInRect(template, &sUnknown_845218C, gUnknown_203ACF0->field_3A, gUnknown_203ACF0->field_38); break; case 5: - gUnknown_203ACF0->field_41 = ListMenuInitInRect(template, &gUnknown_845218C, gUnknown_203ACF0->field_3E, gUnknown_203ACF0->field_3C); + gUnknown_203ACF0->field_41 = ListMenuInitInRect(template, &sUnknown_845218C, gUnknown_203ACF0->field_3E, gUnknown_203ACF0->field_3C); break; } } @@ -881,9 +1484,9 @@ static void sub_8103988(u8 a0) static u8 sub_81039F0(void) { - struct ScrollArrowsTemplate template = gUnknown_84521B4; - if (gUnknown_203ACF0->field_48 > gUnknown_8452174.maxShowed) - template.fullyDownThreshold = gUnknown_203ACF0->field_48 - gUnknown_8452174.maxShowed; + struct ScrollArrowsTemplate template = sUnknown_84521B4; + if (gUnknown_203ACF0->field_48 > sUnknown_8452174.maxShowed) + template.fullyDownThreshold = gUnknown_203ACF0->field_48 - sUnknown_8452174.maxShowed; else template.fullyDownThreshold = 0; return AddScrollIndicatorArrowPair(&template, &gUnknown_203ACF0->field_62); @@ -896,7 +1499,7 @@ struct PokedexListItem bool8 caught:1; }; -void sub_8103A40(u8 windowId, s32 itemId, u8 y) +static void sub_8103A40(u8 windowId, s32 itemId, u8 y) { u32 itemId_ = itemId; u16 species = itemId_; @@ -1222,7 +1825,7 @@ static void sub_8103AC8(u8 taskId) static u8 sub_8104234(void) { - struct ScrollArrowsTemplate template = gUnknown_84524B4; + struct ScrollArrowsTemplate template = sUnknown_84524B4; template.fullyUpThreshold = gUnknown_203ACF0->field_29; template.fullyDownThreshold = gUnknown_203ACF0->field_2A - 1; gUnknown_203ACF0->field_62 = gUnknown_203ACF0->field_2B; @@ -1564,7 +2167,7 @@ void sub_81049FC(u8 windowId, u16 species, u16 paletteOffset) void sub_8104A34(u8 windowId, u8 fontId, u16 species, u8 x, u8 y) { u16 dexNum = SpeciesToNationalPokedexNum(species); - sub_81047C8(windowId, fontId, gUnknown_8415FFF, x, y, 0); + sub_81047C8(windowId, fontId, gText_PokedexNo, x, y, 0); sub_8104880(windowId, fontId, dexNum, x + 9, y, 0); } @@ -1649,10 +2252,10 @@ bool8 sub_8104C64(u16 a0, u8 a1, u8 a2) { struct WindowTemplate template; a2--; - CopyToBgTilemapBufferRect_ChangePalette(3, gUnknown_845228C, gUnknown_8452334[a2][a1][0], gUnknown_8452334[a2][a1][1], 8, 8, a1 + 5); + CopyToBgTilemapBufferRect_ChangePalette(3, sUnknown_845228C, gUnknown_8452334[a2][a1][0], gUnknown_8452334[a2][a1][1], 8, 8, a1 + 5); if (gUnknown_203ACF0->field_20[a1] == 0xFF) { - template = gUnknown_84521C4; + template = sUnknown_84521C4; template.tilemapLeft = gUnknown_8452334[a2][a1][0]; template.tilemapTop = gUnknown_8452334[a2][a1][1]; template.paletteNum = a1 + 1; @@ -1670,7 +2273,7 @@ bool8 sub_8104C64(u16 a0, u8 a1, u8 a2) { if (a0 != SPECIES_NONE) { - template = gUnknown_84521CC; + template = sUnknown_84521CC; template.tilemapLeft = gUnknown_8452334[a2][a1][2]; template.tilemapTop = gUnknown_8452334[a2][a1][3]; template.baseBlock = a1 * 40 + 0x108; @@ -1703,7 +2306,7 @@ void sub_8104E90(void) void sub_8104EC0(u8 unused, u16 a1, u16 a2, u8 unused2, u8 unused3) { u8 buffer[30]; - u8 *ptr = StringCopy(buffer, gUnknown_8416002); + u8 *ptr = StringCopy(buffer, gText_Page); ptr = ConvertIntToDecimalStringN(ptr, a1, STR_CONV_MODE_RIGHT_ALIGN, 2); *ptr++ = CHAR_SLASH; ptr = ConvertIntToDecimalStringN(ptr, a2, STR_CONV_MODE_RIGHT_ALIGN, 2); @@ -1719,17 +2322,17 @@ bool8 sub_8104F0C(bool8 a0) FillWindowPixelBuffer(0, PIXEL_FILL(15)); if (a0) { - sub_8106E78(gDexCategoryNamePtrs[gUnknown_203ACF0->field_28], 1); + sub_8106E78(sDexCategoryNamePtrs[gUnknown_203ACF0->field_28], 1); } else { - sub_8106E78(gDexCategoryNamePtrs[gUnknown_203ACF0->field_28], 0); + sub_8106E78(sDexCategoryNamePtrs[gUnknown_203ACF0->field_28], 0); sub_8104EC0(0, sub_8106AF8(gUnknown_203ACF0->field_2B), sub_8106AF8(gUnknown_203ACF0->field_2A - 1), 160, 2); } CopyWindowToVram(0, COPYWIN_GFX); FillWindowPixelBuffer(1, PIXEL_FILL(15)); if (!a0) - sub_8104C2C(gUnknown_8415F6C); + sub_8104C2C(gText_PickFlipPageCheckCancel); CopyWindowToVram(1, COPYWIN_GFX); if (gUnknown_203ACF0->field_18[0] != 0xFFFF) sub_8104C64(gUnknown_203ACF0->field_18[0], 0, gUnknown_203ACF0->field_2C); @@ -1824,7 +2427,7 @@ bool8 sub_81051F0(u8 a0) u16 *sp0C = gUnknown_203ACF0->field_5C + 0x000; for (i = 0; i < 30; i++) { - r4 = gUnknown_8452388[a0][i]; + r4 = sUnknown_8452388[a0][i]; if (r4 == 30) { sub_81051D0(0x000, bg1buff, i); |