diff --git a/include/data/map_headers.h b/include/data/map_headers.h index c3bbca900c..c7cf2fae97 100644 --- a/include/data/map_headers.h +++ b/include/data/map_headers.h @@ -731,15 +731,15 @@ static const MapHeader sMapHeaders[] = { .isFlyAllowed = 0x0, }, [MAP_HEADER_CANALAVE_CITY] = { - .unk_00 = 0xF, - .unk_01 = 0x9, - .mapMatrixID = 0x0, + .unk_00 = 15, + .unk_01 = 9, + .mapMatrixID = 0, .scriptsArchiveID = scripts_canalave_city, .initScriptsArchiveID = scripts_init_canalave_city, .msgArchiveID = message_bank_canalave_city, .dayMusicID = 1011, .nightMusicID = 1040, - .wildEncountersArchiveID = 0x0, + .wildEncountersArchiveID = 0, .eventsArchiveID = 32, .mapLabelTextID = 0x7, .mapLabelWindowID = 0x1, @@ -1437,13 +1437,13 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_ETERNA_CITY] = { .unk_00 = 0x8, .unk_01 = 0x2, - .mapMatrixID = 0x0, + .mapMatrixID = 0, .scriptsArchiveID = scripts_eterna_city, .initScriptsArchiveID = scripts_init_eterna_city, .msgArchiveID = message_bank_eterna_city, .dayMusicID = 1013, .nightMusicID = 1042, - .wildEncountersArchiveID = 0x1, + .wildEncountersArchiveID = 1, .eventsArchiveID = 64, .mapLabelTextID = 0x9, .mapLabelWindowID = 0x1, @@ -2647,13 +2647,13 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_PASTORIA_CITY] = { .unk_00 = 0xC, .unk_01 = 0x6, - .mapMatrixID = 0x0, + .mapMatrixID = 0, .scriptsArchiveID = scripts_pastoria_city, .initScriptsArchiveID = scripts_init_pastoria_city, .msgArchiveID = message_bank_pastoria_city, .dayMusicID = 1015, .nightMusicID = 1044, - .wildEncountersArchiveID = 0x2, + .wildEncountersArchiveID = 2, .eventsArchiveID = 119, .mapLabelTextID = 0xB, .mapLabelWindowID = 0x1, @@ -3307,13 +3307,13 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_SUNYSHORE_CITY] = { .unk_00 = 0xD, .unk_01 = 0x7, - .mapMatrixID = 0x0, + .mapMatrixID = 0, .scriptsArchiveID = scripts_sunyshore_city, .initScriptsArchiveID = scripts_init_sunyshore_city, .msgArchiveID = message_bank_sunyshore_city, .dayMusicID = 1017, .nightMusicID = 1046, - .wildEncountersArchiveID = 0x3, + .wildEncountersArchiveID = 3, .eventsArchiveID = 149, .mapLabelTextID = 0xD, .mapLabelWindowID = 0x1, @@ -3791,13 +3791,13 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_POKEMON_LEAGUE] = { .unk_00 = 0xD, .unk_01 = 0xA, - .mapMatrixID = 0x0, + .mapMatrixID = 0, .scriptsArchiveID = scripts_pokemon_league, .initScriptsArchiveID = scripts_init_pokemon_league, .msgArchiveID = message_bank_pokemon_league, .dayMusicID = 1019, .nightMusicID = 1048, - .wildEncountersArchiveID = 0x4, + .wildEncountersArchiveID = 4, .eventsArchiveID = 171, .mapLabelTextID = (0xF), .mapLabelWindowID = 0x1, @@ -4363,13 +4363,13 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_OREBURGH_MINE_B1F] = { .unk_00 = 55, .unk_01 = 0xF, - .mapMatrixID = 0x5, + .mapMatrixID = 5, .scriptsArchiveID = scripts_oreburgh_mine_b1f, .initScriptsArchiveID = scripts_init_oreburgh_mine_b1f, .msgArchiveID = message_bank_oreburgh_mine_b1f, .dayMusicID = 0x433, .nightMusicID = 0x433, - .wildEncountersArchiveID = 0x5, + .wildEncountersArchiveID = 5, .eventsArchiveID = 196, .mapLabelTextID = 46, .mapLabelWindowID = 0x4, @@ -4385,13 +4385,13 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_OREBURGH_MINE_B2F] = { .unk_00 = 55, .unk_01 = 0xF, - .mapMatrixID = 0x6, + .mapMatrixID = 6, .scriptsArchiveID = scripts_oreburgh_mine_b2f, .initScriptsArchiveID = scripts_init_oreburgh_mine_b2f, .msgArchiveID = message_bank_oreburgh_mine_b2f, .dayMusicID = 0x433, .nightMusicID = 0x433, - .wildEncountersArchiveID = 0x6, + .wildEncountersArchiveID = 6, .eventsArchiveID = 197, .mapLabelTextID = 46, .mapLabelWindowID = 0x4, @@ -4407,13 +4407,13 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_VALLEY_WINDWORKS_OUTSIDE] = { .unk_00 = 0x8, .unk_01 = 0x2, - .mapMatrixID = 0x0, + .mapMatrixID = 0, .scriptsArchiveID = scripts_valley_windworks_outside, .initScriptsArchiveID = scripts_init_valley_windworks_outside, .msgArchiveID = message_bank_valley_windworks_outside, .dayMusicID = 1023, .nightMusicID = 1052, - .wildEncountersArchiveID = 0x7, + .wildEncountersArchiveID = 7, .eventsArchiveID = 198, .mapLabelTextID = 47, .mapLabelWindowID = 0x3, @@ -4473,13 +4473,13 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_ETERNA_FOREST] = { .unk_00 = 54, .unk_01 = 0xF, - .mapMatrixID = 0x7, + .mapMatrixID = 7, .scriptsArchiveID = scripts_eterna_forest, .initScriptsArchiveID = scripts_init_eterna_forest, .msgArchiveID = message_bank_eterna_forest, .dayMusicID = 0x427, .nightMusicID = 0x427, - .wildEncountersArchiveID = 0x8, + .wildEncountersArchiveID = 8, .eventsArchiveID = 201, .mapLabelTextID = 48, .mapLabelWindowID = 0x5, @@ -4495,13 +4495,13 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_FUEGO_IRONWORKS_OUTSIDE] = { .unk_00 = 0x8, .unk_01 = 0x2, - .mapMatrixID = 0x0, + .mapMatrixID = 0, .scriptsArchiveID = scripts_fuego_ironworks_outside, .initScriptsArchiveID = scripts_init_fuego_ironworks_outside, .msgArchiveID = message_bank_fuego_ironworks_outside, .dayMusicID = 1023, .nightMusicID = 1052, - .wildEncountersArchiveID = 0x9, + .wildEncountersArchiveID = 9, .eventsArchiveID = 202, .mapLabelTextID = 49, .mapLabelWindowID = 0x3, @@ -4561,13 +4561,13 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_MT_CORONET_1F_SOUTH] = { .unk_00 = 0x45, .unk_01 = 0xF, - .mapMatrixID = 0x9, + .mapMatrixID = 9, .scriptsArchiveID = scripts_mt_coronet_1f_south, .initScriptsArchiveID = scripts_init_mt_coronet_1f_south, .msgArchiveID = message_bank_mt_coronet_1f_south, .dayMusicID = 0x432, .nightMusicID = 0x432, - .wildEncountersArchiveID = 0xA, + .wildEncountersArchiveID = 10, .eventsArchiveID = 204, .mapLabelTextID = 0x32, .mapLabelWindowID = 0x4, @@ -4583,7 +4583,7 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_MT_CORONET_2F] = { .unk_00 = 0x45, .unk_01 = 0xF, - .mapMatrixID = 0xA, + .mapMatrixID = 10, .scriptsArchiveID = scripts_mt_coronet_2f, .initScriptsArchiveID = scripts_init_mt_coronet_2f, .msgArchiveID = message_bank_mt_coronet_2f, @@ -4611,7 +4611,7 @@ static const MapHeader sMapHeaders[] = { .msgArchiveID = message_bank_jubilife_city, .dayMusicID = 0x432, .nightMusicID = 0x432, - .wildEncountersArchiveID = 0xC, + .wildEncountersArchiveID = 12, .eventsArchiveID = 206, .mapLabelTextID = 0x32, .mapLabelWindowID = 0x4, @@ -4627,13 +4627,13 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_MT_CORONET_OUTSIDE_NORTH] = { .unk_00 = 0xE, .unk_01 = 0x8, - .mapMatrixID = 0xC, + .mapMatrixID = 12, .scriptsArchiveID = scripts_empty, .initScriptsArchiveID = scripts_init_empty, .msgArchiveID = message_bank_jubilife_city, .dayMusicID = 1071, .nightMusicID = 1071, - .wildEncountersArchiveID = 0xD, + .wildEncountersArchiveID = 13, .eventsArchiveID = 207, .mapLabelTextID = 0x32, .mapLabelWindowID = 0x4, @@ -4649,13 +4649,13 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_MT_CORONET_OUTSIDE_SOUTH] = { .unk_00 = 0xE, .unk_01 = 0x8, - .mapMatrixID = 0xD, + .mapMatrixID = 13, .scriptsArchiveID = scripts_empty, .initScriptsArchiveID = scripts_init_empty, .msgArchiveID = message_bank_jubilife_city, .dayMusicID = 1071, .nightMusicID = 1071, - .wildEncountersArchiveID = 0xE, + .wildEncountersArchiveID = 14, .eventsArchiveID = 208, .mapLabelTextID = 0x32, .mapLabelWindowID = 0x4, @@ -4671,13 +4671,13 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_MT_CORONET_4F_ROOMS_1_AND_2] = { .unk_00 = 70, .unk_01 = 0xF, - .mapMatrixID = 0xE, + .mapMatrixID = 14, .scriptsArchiveID = scripts_empty, .initScriptsArchiveID = scripts_init_empty, .msgArchiveID = message_bank_jubilife_city, .dayMusicID = 1071, .nightMusicID = 1071, - .wildEncountersArchiveID = 0xF, + .wildEncountersArchiveID = 15, .eventsArchiveID = 209, .mapLabelTextID = 0x32, .mapLabelWindowID = 0x4, @@ -4693,13 +4693,13 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_MT_CORONET_4F_ROOM_3] = { .unk_00 = 70, .unk_01 = 0xF, - .mapMatrixID = 0xF, + .mapMatrixID = 15, .scriptsArchiveID = scripts_empty, .initScriptsArchiveID = scripts_init_empty, .msgArchiveID = message_bank_jubilife_city, .dayMusicID = 1071, .nightMusicID = 1071, - .wildEncountersArchiveID = 0x10, + .wildEncountersArchiveID = 16, .eventsArchiveID = 210, .mapLabelTextID = 0x32, .mapLabelWindowID = 0x4, @@ -4714,14 +4714,14 @@ static const MapHeader sMapHeaders[] = { }, [MAP_HEADER_MT_CORONET_5F] = { .unk_00 = 70, - .unk_01 = 0xF, - .mapMatrixID = 0x10, + .unk_01 = 15, + .mapMatrixID = 16, .scriptsArchiveID = scripts_empty, .initScriptsArchiveID = scripts_init_empty, .msgArchiveID = message_bank_jubilife_city, .dayMusicID = 1071, .nightMusicID = 1071, - .wildEncountersArchiveID = 0x11, + .wildEncountersArchiveID = 17, .eventsArchiveID = 211, .mapLabelTextID = 0x32, .mapLabelWindowID = 0x4, @@ -4737,13 +4737,13 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_MT_CORONET_6F] = { .unk_00 = 70, .unk_01 = 0xF, - .mapMatrixID = 0x11, + .mapMatrixID = 17, .scriptsArchiveID = scripts_mt_coronet_6f, .initScriptsArchiveID = scripts_init_mt_coronet_6f, .msgArchiveID = message_bank_jubilife_city, .dayMusicID = 1071, .nightMusicID = 1071, - .wildEncountersArchiveID = 0x12, + .wildEncountersArchiveID = 18, .eventsArchiveID = 212, .mapLabelTextID = 0x32, .mapLabelWindowID = 0x4, @@ -4759,13 +4759,13 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_MT_CORONET_1F_TUNNEL_ROOM] = { .unk_00 = 0x45, .unk_01 = 0xF, - .mapMatrixID = 0x12, + .mapMatrixID = 18, .scriptsArchiveID = scripts_mt_coronet_1f_tunnel_room, .initScriptsArchiveID = scripts_init_mt_coronet_1f_tunnel_room, .msgArchiveID = message_bank_mt_coronet_1f_tunnel_room, .dayMusicID = 1071, .nightMusicID = 1071, - .wildEncountersArchiveID = 0x13, + .wildEncountersArchiveID = 19, .eventsArchiveID = 213, .mapLabelTextID = 0x32, .mapLabelWindowID = 0x4, @@ -4781,13 +4781,13 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_MT_CORONET_1F_NORTH_ROOM_2] = { .unk_00 = 0x45, .unk_01 = 0xF, - .mapMatrixID = 0x13, + .mapMatrixID = 19, .scriptsArchiveID = scripts_mt_coronet_1f_north_room_2, .initScriptsArchiveID = scripts_init_mt_coronet_1f_north_room_2, .msgArchiveID = message_bank_jubilife_city, .dayMusicID = 0x432, .nightMusicID = 0x432, - .wildEncountersArchiveID = 0x14, + .wildEncountersArchiveID = 20, .eventsArchiveID = 214, .mapLabelTextID = 0x32, .mapLabelWindowID = 0x4, @@ -4803,13 +4803,13 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_MT_CORONET_1F_NORTH_ROOM_1] = { .unk_00 = 0x45, .unk_01 = 0xF, - .mapMatrixID = 0x14, + .mapMatrixID = 20, .scriptsArchiveID = scripts_mt_coronet_1f_north_room_1, .initScriptsArchiveID = scripts_init_mt_coronet_1f_north_room_1, .msgArchiveID = message_bank_mt_coronet_1f_north_room_1, .dayMusicID = 0x432, .nightMusicID = 0x432, - .wildEncountersArchiveID = 0x15, + .wildEncountersArchiveID = 21, .eventsArchiveID = 215, .mapLabelTextID = 0x32, .mapLabelWindowID = 0x4, @@ -4825,13 +4825,13 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_MT_CORONET_B1F] = { .unk_00 = 0x45, .unk_01 = 0xF, - .mapMatrixID = 0x15, + .mapMatrixID = 21, .scriptsArchiveID = scripts_empty, .initScriptsArchiveID = scripts_init_empty, .msgArchiveID = message_bank_jubilife_city, .dayMusicID = 0x432, .nightMusicID = 0x432, - .wildEncountersArchiveID = 0x16, + .wildEncountersArchiveID = 22, .eventsArchiveID = 216, .mapLabelTextID = 0x32, .mapLabelWindowID = 0x4, @@ -4847,7 +4847,7 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_SPEAR_PILLAR] = { .unk_00 = 0x3C, .unk_01 = 0xF, - .mapMatrixID = 0x16, + .mapMatrixID = 22, .scriptsArchiveID = scripts_spear_pillar, .initScriptsArchiveID = scripts_init_spear_pillar, .msgArchiveID = message_bank_spear_pillar, @@ -5029,7 +5029,7 @@ static const MapHeader sMapHeaders[] = { .msgArchiveID = message_bank_jubilife_city, .dayMusicID = 0x427, .nightMusicID = 0x427, - .wildEncountersArchiveID = 0x1F, + .wildEncountersArchiveID = 31, .eventsArchiveID = 223, .mapLabelTextID = 53, .mapLabelWindowID = 0x4, @@ -5799,7 +5799,7 @@ static const MapHeader sMapHeaders[] = { .msgArchiveID = message_bank_stark_mountain_room_1, .dayMusicID = 1073, .nightMusicID = 1073, - .wildEncountersArchiveID = 0x39, + .wildEncountersArchiveID = 57, .eventsArchiveID = 256, .mapLabelTextID = 84, .mapLabelWindowID = 0x4, @@ -6327,7 +6327,7 @@ static const MapHeader sMapHeaders[] = { .msgArchiveID = message_bank_jubilife_city, .dayMusicID = 1025, .nightMusicID = 1054, - .wildEncountersArchiveID = 0x75, + .wildEncountersArchiveID = 117, .eventsArchiveID = 0x114, .mapLabelTextID = 68, .mapLabelWindowID = 0x7, @@ -6459,7 +6459,7 @@ static const MapHeader sMapHeaders[] = { .msgArchiveID = message_bank_iron_island_b2f_left_room, .dayMusicID = 0x433, .nightMusicID = 0x433, - .wildEncountersArchiveID = 0x7B, + .wildEncountersArchiveID = 123, .eventsArchiveID = 0x11A, .mapLabelTextID = 0x45, .mapLabelWindowID = 0x4, @@ -7559,7 +7559,7 @@ static const MapHeader sMapHeaders[] = { .msgArchiveID = message_bank_route_202, .dayMusicID = 1021, .nightMusicID = 1050, - .wildEncountersArchiveID = 0x8D, + .wildEncountersArchiveID = 141, .eventsArchiveID = 329, .mapLabelTextID = 0x11, .mapLabelWindowID = 0x3, @@ -7581,7 +7581,7 @@ static const MapHeader sMapHeaders[] = { .msgArchiveID = message_bank_route_203, .dayMusicID = 1022, .nightMusicID = 1051, - .wildEncountersArchiveID = 0x8E, + .wildEncountersArchiveID = 142, .eventsArchiveID = 330, .mapLabelTextID = 0x12, .mapLabelWindowID = 0x3, @@ -11095,13 +11095,13 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_GREAT_MARSH_1] = { .unk_00 = 63, .unk_01 = 0xF, - .mapMatrixID = 0xF0, + .mapMatrixID = 240, .scriptsArchiveID = scripts_great_marsh_1, .initScriptsArchiveID = scripts_init_great_marsh_1, .msgArchiveID = message_bank_great_marsh_1, .dayMusicID = 1069, .nightMusicID = 1069, - .wildEncountersArchiveID = 0x17, + .wildEncountersArchiveID = 23, .eventsArchiveID = 481, .mapLabelTextID = 52, .mapLabelWindowID = 0x5, @@ -11123,7 +11123,7 @@ static const MapHeader sMapHeaders[] = { .msgArchiveID = message_bank_great_marsh_2, .dayMusicID = 1069, .nightMusicID = 1069, - .wildEncountersArchiveID = 0x18, + .wildEncountersArchiveID = 24, .eventsArchiveID = 482, .mapLabelTextID = 52, .mapLabelWindowID = 0x5, @@ -11145,7 +11145,7 @@ static const MapHeader sMapHeaders[] = { .msgArchiveID = message_bank_great_marsh_3, .dayMusicID = 1069, .nightMusicID = 1069, - .wildEncountersArchiveID = 0x19, + .wildEncountersArchiveID = 25, .eventsArchiveID = 483, .mapLabelTextID = 52, .mapLabelWindowID = 0x5, @@ -11167,7 +11167,7 @@ static const MapHeader sMapHeaders[] = { .msgArchiveID = message_bank_great_marsh_4, .dayMusicID = 1069, .nightMusicID = 1069, - .wildEncountersArchiveID = 0x1A, + .wildEncountersArchiveID = 26, .eventsArchiveID = 484, .mapLabelTextID = 52, .mapLabelWindowID = 0x5, @@ -11189,7 +11189,7 @@ static const MapHeader sMapHeaders[] = { .msgArchiveID = message_bank_great_marsh_5, .dayMusicID = 1069, .nightMusicID = 1069, - .wildEncountersArchiveID = 0x1B, + .wildEncountersArchiveID = 27, .eventsArchiveID = 485, .mapLabelTextID = 52, .mapLabelWindowID = 0x5, @@ -11211,7 +11211,7 @@ static const MapHeader sMapHeaders[] = { .msgArchiveID = message_bank_great_marsh_6, .dayMusicID = 1069, .nightMusicID = 1069, - .wildEncountersArchiveID = 0x1C, + .wildEncountersArchiveID = 28, .eventsArchiveID = 486, .mapLabelTextID = 52, .mapLabelWindowID = 0x5, @@ -11299,7 +11299,7 @@ static const MapHeader sMapHeaders[] = { .msgArchiveID = message_bank_maniac_tunnel, .dayMusicID = 0x427, .nightMusicID = 0x427, - .wildEncountersArchiveID = 0x74, + .wildEncountersArchiveID = 116, .eventsArchiveID = 489, .mapLabelTextID = 67, .mapLabelWindowID = 0x4, @@ -11475,7 +11475,7 @@ static const MapHeader sMapHeaders[] = { .msgArchiveID = message_bank_jubilife_city, .dayMusicID = 1064, .nightMusicID = 1064, - .wildEncountersArchiveID = 0x45, + .wildEncountersArchiveID = 69, .eventsArchiveID = 497, .mapLabelTextID = 62, .mapLabelWindowID = 0x4, @@ -11541,7 +11541,7 @@ static const MapHeader sMapHeaders[] = { .msgArchiveID = message_bank_jubilife_city, .dayMusicID = 1064, .nightMusicID = 1064, - .wildEncountersArchiveID = 0x48, + .wildEncountersArchiveID = 72, .eventsArchiveID = 500, .mapLabelTextID = 62, .mapLabelWindowID = 0x4, @@ -11585,7 +11585,7 @@ static const MapHeader sMapHeaders[] = { .msgArchiveID = message_bank_jubilife_city, .dayMusicID = 1064, .nightMusicID = 1064, - .wildEncountersArchiveID = 0x4A, + .wildEncountersArchiveID = 74, .eventsArchiveID = 0x1F6, .mapLabelTextID = 62, .mapLabelWindowID = 0x4, diff --git a/include/overlay021/ov21_021D0D80.h b/include/overlay021/ov21_021D0D80.h index 2e0bf0c5bc..067ccaea33 100644 --- a/include/overlay021/ov21_021D0D80.h +++ b/include/overlay021/ov21_021D0D80.h @@ -44,7 +44,7 @@ int *ov21_021D13A0(UnkStruct_ov21_021D0F60 *param0); int *ov21_021D13B4(UnkStruct_ov21_021D0F60 *param0); int *ov21_021D13C8(UnkStruct_ov21_021D0F60 *param0); BOOL *ov21_021D13DC(UnkStruct_ov21_021D0F60 *param0); -UnkStruct_ov21_021D3320 *ov21_021D13EC(UnkStruct_ov21_021D0F60 *param0); +pokedexStruct *ov21_021D13EC(UnkStruct_ov21_021D0F60 *param0); UnkStruct_ov21_021D13FC *ov21_021D13FC(UnkStruct_ov21_021D0F60 *param0); UnkStruct_ov21_021E68F4 *ov21_021D1410(UnkStruct_ov21_021D0F60 *param0, int param1); UnkStruct_ov21_021E68F4 *ov21_021D1430(UnkStruct_ov21_021D0F60 *param0, int param1); @@ -55,23 +55,23 @@ void ov21_021D154C(TouchScreenHitTable *hitTable, int param1, int param2, int pa void ov21_021D1558(UnkStruct_ov21_021D157C *param0, BGL *param1, int param2, NNSG2dScreenData *param3, int param4, int param5, int param6, int param7, int param8); BOOL ov21_021D157C(UnkStruct_ov21_021D157C *param0); void ov21_021D1650(Window *param0, int param1, int param2, int param3); -Window *ov21_021D16D8(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3); +Window *ov21_021D16D8(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3); Window *ov21_021D170C(UnkStruct_ov21_021D4C0C *param0, int param1, int param2); Window *ov21_021D172C(UnkStruct_ov21_021D4C0C *param0, int param1, int param2); -void ov21_021D1778(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, fx32 param4, fx32 param5); +void ov21_021D1778(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, fx32 param4, fx32 param5); void ov21_021D1848(UnkStruct_ov21_021D13FC *param0, int param1, int param2); void ov21_021D1858(UnkStruct_ov21_021D22F8 *param0, int param1, int param2); -void ov21_021D1890(UnkStruct_ov21_021D13FC *param0, UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5); -u32 ov21_021D19D8(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6, int param7); -u32 ov21_021D1A34(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6); -u32 ov21_021D1A78(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6); -u32 ov21_021D1AC0(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6); -u32 ov21_021D1B08(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6); -u32 ov21_021D1B4C(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6); -u32 ov21_021D1B94(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6); -u32 ov21_021D1BD8(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6); -u32 ov21_021D1C30(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6); -u32 ov21_021D1C88(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6); +void ov21_021D1890(UnkStruct_ov21_021D13FC *param0, pokedexStruct *param1, int param2, int param3, int param4, int param5); +u32 ov21_021D19D8(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6, int param7); +u32 ov21_021D1A34(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6); +u32 ov21_021D1A78(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6); +u32 ov21_021D1AC0(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6); +u32 ov21_021D1B08(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6); +u32 ov21_021D1B4C(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6); +u32 ov21_021D1B94(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6); +u32 ov21_021D1BD8(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6); +u32 ov21_021D1C30(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6); +u32 ov21_021D1C88(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6); Strbuf *ov21_021D1CE0(int param0, int param1); #endif // POKEPLATINUM_OV21_021D0D80_H diff --git a/include/overlay021/ov21_021D3208.h b/include/overlay021/ov21_021D3208.h deleted file mode 100644 index 82f4458056..0000000000 --- a/include/overlay021/ov21_021D3208.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef POKEPLATINUM_OV21_021D3208_H -#define POKEPLATINUM_OV21_021D3208_H - -#include "overlay021/struct_ov21_021D3208.h" -#include "overlay021/struct_ov21_021D3320.h" -#include "overlay021/struct_ov21_021D37DC.h" - -#include "strbuf.h" - -void ov21_021D3208(UnkStruct_ov21_021D3320 *param0, UnkStruct_ov21_021D3208 *param1, int param2); -void ov21_021D3320(UnkStruct_ov21_021D3320 *param0); -u32 ov21_021D334C(const UnkStruct_ov21_021D3320 *param0, int param1, int param2); -u32 ov21_021D335C(const UnkStruct_ov21_021D3320 *param0, int param1); -u32 ov21_021D3374(const UnkStruct_ov21_021D3320 *param0, int param1); -u32 ov21_021D338C(const UnkStruct_ov21_021D3320 *param0, int param1); -u32 ov21_021D33A4(const UnkStruct_ov21_021D3320 *param0, int param1); -u32 ov21_021D33BC(const UnkStruct_ov21_021D3320 *param0, int param1); -u32 ov21_021D33D4(const UnkStruct_ov21_021D3320 *param0, u32 param1); -u32 ov21_021D33E0(const UnkStruct_ov21_021D3320 *param0, int param1); -u32 ov21_021D33F8(const UnkStruct_ov21_021D3320 *param0); -u32 ov21_021D3404(const UnkStruct_ov21_021D3320 *param0, int param1); -u32 ov21_021D3410(const UnkStruct_ov21_021D3320 *param0, u32 param1, int param2); -u32 ov21_021D341C(const UnkStruct_ov21_021D3320 *param0, u32 param1); -BOOL ov21_021D3428(const UnkStruct_ov21_021D3320 *param0); -void ov21_021D3434(UnkStruct_ov21_021D3320 *param0, u32 param1); -u32 ov21_021D3440(const UnkStruct_ov21_021D3320 *param0); -void ov21_021D344C(UnkStruct_ov21_021D3320 *param0, u32 param1); -u32 ov21_021D3458(const UnkStruct_ov21_021D3320 *param0); -BOOL ov21_021D3464(UnkStruct_ov21_021D3320 *param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7, BOOL param8); -BOOL ov21_021D3684(UnkStruct_ov21_021D3320 *param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7); -BOOL ov21_021D36A4(const UnkStruct_ov21_021D3320 *param0, int param1); -BOOL ov21_021D36C0(UnkStruct_ov21_021D3320 *param0, int param1); -int ov21_021D36D8(const UnkStruct_ov21_021D3320 *param0); -BOOL ov21_021D36E4(const UnkStruct_ov21_021D3320 *param0, int param1); -BOOL ov21_021D36FC(UnkStruct_ov21_021D3320 *param0, int param1); -BOOL ov21_021D371C(UnkStruct_ov21_021D3320 *param0, int param1); -int ov21_021D375C(const UnkStruct_ov21_021D3320 *param0); -int ov21_021D3768(const UnkStruct_ov21_021D3320 *param0); -int ov21_021D3770(const UnkStruct_ov21_021D3320 *param0, u32 param1); -BOOL ov21_021D3794(UnkStruct_ov21_021D3320 *param0, int param1); -int ov21_021D37BC(const UnkStruct_ov21_021D3320 *param0); -int ov21_021D37CC(const UnkStruct_ov21_021D3320 *param0); -const UnkStruct_ov21_021D37DC *ov21_021D37DC(const UnkStruct_ov21_021D3320 *param0, int param1); -BOOL ov21_021D37F8(const UnkStruct_ov21_021D3320 *param0, int param1); -BOOL ov21_021D3810(UnkStruct_ov21_021D3320 *param0, int param1); -BOOL ov21_021D3844(UnkStruct_ov21_021D3320 *param0, int param1); -BOOL ov21_021D387C(UnkStruct_ov21_021D3320 *param0, int param1); -int ov21_021D3898(const UnkStruct_ov21_021D3320 *param0); -int ov21_021D38A4(const UnkStruct_ov21_021D3320 *param0); -int ov21_021D38B0(const UnkStruct_ov21_021D3320 *param0, int param1); -void ov21_021D38C0(UnkStruct_ov21_021D3320 *param0); -int ov21_021D38FC(const UnkStruct_ov21_021D3320 *param0); -int ov21_021D3908(const UnkStruct_ov21_021D3320 *param0); -Strbuf *ov21_021D3914(const UnkStruct_ov21_021D3320 *param0); -u32 ov21_021D3920(const UnkStruct_ov21_021D3320 *param0); -BOOL ov21_021D392C(const UnkStruct_ov21_021D3320 *param0, int param1); -BOOL ov21_021D3954(const UnkStruct_ov21_021D3320 *param0); -void ov21_021D3960(UnkStruct_ov21_021D3320 *param0); -u32 ov21_021D3998(const UnkStruct_ov21_021D3320 *param0); - -#endif // POKEPLATINUM_OV21_021D3208_H diff --git a/include/overlay021/ov21_021D57B4.h b/include/overlay021/ov21_021D57B4.h index 63f575c29c..96b8cc26af 100644 --- a/include/overlay021/ov21_021D57B4.h +++ b/include/overlay021/ov21_021D57B4.h @@ -7,13 +7,13 @@ #include "cell_actor.h" -void ov21_021D57B4(UnkStruct_ov21_021D5844 *param0, int param1, int param2, int param3); -void ov21_021D5844(UnkStruct_ov21_021D5844 *param0); +void ov21_021D57B4(pokedexEncStruct *dexEncData, int param1, int param2, int param3); +void Free_pokedexEncData(pokedexEncStruct *dexEncData); UnkStruct_ov21_021D5868 *ov21_021D5868(int param0, int *param1); UnkStruct_ov21_021D5890 *ov21_021D5890(int param0, int *param1); void ov21_021D58C0(u8 *param0, u8 param1, u8 param2, const UnkStruct_ov21_021D5890 *param3); -u32 ov21_021D5948(u8 *param0, int param1, int param2, const UnkStruct_ov21_021D5890 *param3, const UnkStruct_ov21_021D5844 *param4, const u8 *param5, u32 param6); +u32 ov21_021D5948(u8 *param0, int param1, int param2, const UnkStruct_ov21_021D5890 *param3, const pokedexEncStruct *dexEncData, const u8 *param5, u32 param6); void ov21_021D59D8(CellActor *param0, int param1, int param2, int param3, int param4, const UnkStruct_ov21_021D5868 *param5, int param6, int param7); -int ov21_021D5A20(CellActor **param0, int param1, int param2, int param3, int param4, int param5, int param6, const UnkStruct_ov21_021D5868 *param7, const UnkStruct_ov21_021D5844 *param8, int param9, int param10, const u8 *param11, u32 param12, u32 *param13); +int ov21_021D5A20(CellActor **param0, int param1, int param2, int param3, int param4, int param5, int param6, const UnkStruct_ov21_021D5868 *param7, const pokedexEncStruct *dexEncData, int param9, int param10, const u8 *param11, u32 param12, u32 *param13); #endif // POKEPLATINUM_OV21_021D57B4_H diff --git a/include/overlay021/ov21_021DC9BC.h b/include/overlay021/ov21_021DC9BC.h index 378533dfef..8e35b79d3d 100644 --- a/include/overlay021/ov21_021DC9BC.h +++ b/include/overlay021/ov21_021DC9BC.h @@ -4,7 +4,7 @@ #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021E68F4.h" -void ov21_021DC9BC(UnkStruct_ov21_021E68F4 *param0, UnkStruct_ov21_021D0F60 *param1, int param2); +void ov21_021DC9BC(UnkStruct_ov21_021E68F4 *param0, UnkStruct_ov21_021D0F60 *param1, int heapID); void ov21_021DCA14(UnkStruct_ov21_021E68F4 *param0); int ov21_021DCA28(const UnkStruct_ov21_021E68F4 *param0); void ov21_021DCA30(UnkStruct_ov21_021E68F4 *param0, int param1); diff --git a/include/overlay021/pokedex_sort.h b/include/overlay021/pokedex_sort.h new file mode 100644 index 0000000000..e332e51098 --- /dev/null +++ b/include/overlay021/pokedex_sort.h @@ -0,0 +1,61 @@ +#ifndef POKEPLATINUM_OV21_021D3208_H +#define POKEPLATINUM_OV21_021D3208_H + +#include "overlay021/struct_ov21_021D3208.h" +#include "overlay021/struct_ov21_021D3320.h" +#include "overlay021/struct_ov21_021D37DC.h" + +#include "strbuf.h" + +void Pokedex_Sort_PopulatePokedexStruct(pokedexStruct *param0, UnkStruct_ov21_021D3208 *param1, int param2); +void ov21_021D3320(pokedexStruct *param0); +u32 ov21_021D334C(const pokedexStruct *param0, int param1, int param2); +u32 ov21_021D335C(const pokedexStruct *param0, int param1); +u32 ov21_021D3374(const pokedexStruct *param0, int param1); +u32 ov21_021D338C(const pokedexStruct *param0, int param1); +u32 ov21_021D33A4(const pokedexStruct *param0, int param1); +u32 ov21_021D33BC(const pokedexStruct *param0, int param1); +u32 ov21_021D33D4(const pokedexStruct *param0, u32 param1); +u32 ov21_021D33E0(const pokedexStruct *param0, int param1); +u32 ov21_021D33F8(const pokedexStruct *param0); +u32 ov21_021D3404(const pokedexStruct *param0, int param1); +u32 ov21_021D3410(const pokedexStruct *param0, u32 param1, int param2); +u32 ov21_021D341C(const pokedexStruct *param0, u32 param1); +BOOL Pokedex_Sort_PokedexUnlocked(const pokedexStruct *param0); +void ov21_021D3434(pokedexStruct *param0, u32 param1); +u32 ov21_021D3440(const pokedexStruct *param0); +void ov21_021D344C(pokedexStruct *param0, u32 param1); +u32 ov21_021D3458(const pokedexStruct *param0); +BOOL Pokedex_Sort(pokedexStruct *pokedexS, int sortCategory, int firstLetterFilter, int typeFilter1, int typeFilter2, int bodyShapeFilter, int isNationalDex, int heapID, BOOL isFiltered); +BOOL Pokedex_Sort_Unfiltered(pokedexStruct *param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7); +BOOL ov21_021D36A4(const pokedexStruct *param0, int param1); +BOOL ov21_021D36C0(pokedexStruct *param0, int param1); +int ov21_021D36D8(const pokedexStruct *param0); +BOOL Pokedex_Sort_IsValidDexIndex(const pokedexStruct *pokedexS, int dexIndex); +BOOL ov21_021D36FC(pokedexStruct *param0, int param1); +BOOL ov21_021D371C(pokedexStruct *param0, int param1); +int ov21_021D375C(const pokedexStruct *param0); +int Pokedex_Sort_CompletionNumEncountered(const pokedexStruct *param0); +int ov21_021D3770(const pokedexStruct *param0, u32 param1); +BOOL ov21_021D3794(pokedexStruct *param0, int param1); +int Pokedex_Sort_CurrentSpecies(const pokedexStruct *param0); +int Pokedex_Sort_CurrentCaughtStatus(const pokedexStruct *param0); +const speciesCaughtStatusStruct *Pokedex_Sort_SpeciesCaughtStatus(const pokedexStruct *param0, int dexIndex); +BOOL ov21_021D37F8(const pokedexStruct *param0, int param1); +BOOL ov21_021D3810(pokedexStruct *param0, int param1); +BOOL ov21_021D3844(pokedexStruct *param0, int param1); +BOOL ov21_021D387C(pokedexStruct *param0, int param1); +int ov21_021D3898(const pokedexStruct *param0); +int ov21_021D38A4(const pokedexStruct *param0); +int Pokedex_Sort_SeenIndexToSpecies(const pokedexStruct *param0, int param1); +void ov21_021D38C0(pokedexStruct *param0); +int Pokedex_Sort_NumEncountered(const pokedexStruct *param0); +int Pokedex_Sort_NumCaught(const pokedexStruct *param0); +Strbuf *Pokedex_Sort_TrainerName(const pokedexStruct *param0); +u32 Pokedex_Sort_TrainerGender(const pokedexStruct *param0); +BOOL ov21_021D392C(const pokedexStruct *param0, int param1); +BOOL Pokedex_Sort_CanDetectForms(const pokedexStruct *param0); +void ov21_021D3960(pokedexStruct *param0); +u32 ov21_021D3998(const pokedexStruct *param0); + +#endif // POKEPLATINUM_OV21_021D3208_H diff --git a/include/overlay021/struct_ov21_021D0D80.h b/include/overlay021/struct_ov21_021D0D80.h index 8000e02faf..b6e7f51b62 100644 --- a/include/overlay021/struct_ov21_021D0D80.h +++ b/include/overlay021/struct_ov21_021D0D80.h @@ -9,11 +9,11 @@ typedef struct { const PokedexData *unk_00; const TrainerInfo *unk_04; - int unk_08; - BOOL unk_0C; - BOOL unk_10; - BOOL unk_14; - BOOL unk_18; + int timeOfDay; + BOOL pokedexSFlag_1; + BOOL pokedexSFlag_2; + BOOL pokedexSFlag_3; + BOOL pokedexSFlag_4; UnkStruct_0209ACBC *unk_1C; } UnkStruct_ov21_021D0D80; diff --git a/include/overlay021/struct_ov21_021D0D80_1.h b/include/overlay021/struct_ov21_021D0D80_1.h index bbef0c564a..731ab5db7b 100644 --- a/include/overlay021/struct_ov21_021D0D80_1.h +++ b/include/overlay021/struct_ov21_021D0D80_1.h @@ -9,11 +9,11 @@ typedef struct { const PokedexData *unk_00; const TrainerInfo *unk_04; - int unk_08; - BOOL unk_0C; - BOOL unk_10; - BOOL unk_14; - BOOL unk_18; + int timeOfDay; + BOOL pokedexSFlag_1; + BOOL pokedexSFlag_2; + BOOL pokedexSFlag_3; + BOOL pokedexSFlag_4; UnkStruct_0209ACBC *unk_1C; } UnkStruct_ov21_021D0D80_1; diff --git a/include/overlay021/struct_ov21_021D3208.h b/include/overlay021/struct_ov21_021D3208.h index 13d0b724d2..199318a010 100644 --- a/include/overlay021/struct_ov21_021D3208.h +++ b/include/overlay021/struct_ov21_021D3208.h @@ -6,13 +6,13 @@ #include "trainer_info.h" typedef struct { - const PokedexData *unk_00; + const PokedexData *dexData; const TrainerInfo *unk_04; - int unk_08; - BOOL unk_0C; - BOOL unk_10; - BOOL unk_14; - BOOL unk_18; + int timeOfDay; + BOOL pokedexSFlag_1; + BOOL pokedexSFlag_2; + BOOL pokedexSFlag_3; + BOOL pokedexSFlag_4; u32 unk_1C; u32 unk_20; } UnkStruct_ov21_021D3208; diff --git a/include/overlay021/struct_ov21_021D3320.h b/include/overlay021/struct_ov21_021D3320.h index ed943afb42..083c1476b2 100644 --- a/include/overlay021/struct_ov21_021D3320.h +++ b/include/overlay021/struct_ov21_021D3320.h @@ -9,25 +9,25 @@ #include "strbuf.h" typedef struct { - const PokedexData *unk_00; - UnkStruct_ov21_021D3A60 unk_04; - int unk_1730; - BOOL unk_1734; - int unk_1738; - int unk_173C; + const PokedexData *dexData; + pokedexCompletionStruct pokedexCompletion; + int isNationalDex; + BOOL nationalDexUnlocked; + int numEncountered; + int numCaught; int unk_1740; - int unk_1744; - HeightWeightData *unk_1748; - u32 unk_174C; - u32 unk_1750; - Strbuf *unk_1754; + int timeOfDay; + HeightWeightData *HWData; + u32 TrainerGameCode; + u32 TrainerGender; + Strbuf *trainerName; int unk_1758; u16 unk_175C; u16 unk_175E; - BOOL unk_1760; - BOOL unk_1764; - BOOL unk_1768; - BOOL unk_176C; -} UnkStruct_ov21_021D3320; + BOOL pokedexSFlag_1; + BOOL pokedexSFlag_2; + BOOL pokedexSFlag_3; + BOOL pokedexSFlag_4; +} pokedexStruct; #endif // POKEPLATINUM_STRUCT_OV21_021D3320_H diff --git a/include/overlay021/struct_ov21_021D37DC.h b/include/overlay021/struct_ov21_021D37DC.h index 900d888f07..e92f89fb47 100644 --- a/include/overlay021/struct_ov21_021D37DC.h +++ b/include/overlay021/struct_ov21_021D37DC.h @@ -2,8 +2,8 @@ #define POKEPLATINUM_STRUCT_OV21_021D37DC_H typedef struct { - int unk_00; - int unk_04; -} UnkStruct_ov21_021D37DC; + int species; + int caughtStatus;// 2 for caught, 1 for seen, 0 otherwise +} speciesCaughtStatusStruct; #endif // POKEPLATINUM_STRUCT_OV21_021D37DC_H diff --git a/include/overlay021/struct_ov21_021D3A60.h b/include/overlay021/struct_ov21_021D3A60.h index 912161f845..c283024d2a 100644 --- a/include/overlay021/struct_ov21_021D3A60.h +++ b/include/overlay021/struct_ov21_021D3A60.h @@ -6,12 +6,12 @@ #include "overlay021/struct_ov21_021D37DC.h" typedef struct { - UnkStruct_ov21_021D37DC unk_00[NATIONAL_DEX_COUNT]; + speciesCaughtStatusStruct caughtStatusArray[NATIONAL_DEX_COUNT]; int unk_F68; - int unk_F6C; - int unk_F70[NATIONAL_DEX_COUNT]; + int numEncountered;// number of pokemon seen + int encounteredIndexArray[NATIONAL_DEX_COUNT];// dex number for appearing in dex, dexLength+1 otherwise int unk_1724; - int unk_1728; -} UnkStruct_ov21_021D3A60; + int numSpecies; +} pokedexCompletionStruct; #endif // POKEPLATINUM_STRUCT_OV21_021D3A60_H diff --git a/include/overlay021/struct_ov21_021D5844.h b/include/overlay021/struct_ov21_021D5844.h index 144c5ec7b1..2dcf08f7fb 100644 --- a/include/overlay021/struct_ov21_021D5844.h +++ b/include/overlay021/struct_ov21_021D5844.h @@ -2,8 +2,8 @@ #define POKEPLATINUM_STRUCT_OV21_021D5844_H typedef struct { - int *unk_00; - int unk_04; -} UnkStruct_ov21_021D5844; + int *pokedexEncArray; + int pokedexEncLength; +} pokedexEncStruct; #endif // POKEPLATINUM_STRUCT_OV21_021D5844_H diff --git a/include/overlay021/struct_ov21_021D5B68.h b/include/overlay021/struct_ov21_021D5B68.h index 92af2efde0..645bfbf7fb 100644 --- a/include/overlay021/struct_ov21_021D5B68.h +++ b/include/overlay021/struct_ov21_021D5B68.h @@ -5,7 +5,7 @@ typedef struct { int *unk_00; - UnkStruct_ov21_021D3320 *unk_04; + pokedexStruct *unk_04; int unk_08; int unk_0C; int unk_10; diff --git a/include/overlay021/struct_ov21_021DE6D4.h b/include/overlay021/struct_ov21_021DE6D4.h index dcee75bba1..91a260f984 100644 --- a/include/overlay021/struct_ov21_021DE6D4.h +++ b/include/overlay021/struct_ov21_021DE6D4.h @@ -6,7 +6,7 @@ typedef struct { int *unk_00; - UnkStruct_ov21_021D3320 *unk_04; + pokedexStruct *unk_04; int unk_08; int unk_0C; const UnkStruct_ov21_021E68F4 *unk_10; diff --git a/include/overlay021/struct_ov21_021E6A68.h b/include/overlay021/struct_ov21_021E6A68.h index fcceb7fc3d..fae833d051 100644 --- a/include/overlay021/struct_ov21_021E6A68.h +++ b/include/overlay021/struct_ov21_021E6A68.h @@ -3,7 +3,7 @@ typedef struct { int unk_00; - int unk_04; + int heapID; void *unk_08; BOOL unk_0C; BOOL unk_10; diff --git a/include/overlay021/struct_ov21_021E6B20.h b/include/overlay021/struct_ov21_021E6B20.h index c9044d180e..c247a40f40 100644 --- a/include/overlay021/struct_ov21_021E6B20.h +++ b/include/overlay021/struct_ov21_021E6B20.h @@ -3,7 +3,7 @@ typedef struct { int unk_00; - int unk_04; + int heapID; void *unk_08; } UnkStruct_ov21_021E6B20; diff --git a/include/pokedex_heightweight.h b/include/pokedex_heightweight.h index 6f1348eee7..cec66d3177 100644 --- a/include/pokedex_heightweight.h +++ b/include/pokedex_heightweight.h @@ -7,11 +7,11 @@ HeightWeightData *Pokedex_HeightWeightData(int heapID); void Pokedex_HeightWeightData_Free(HeightWeightData *HWData); void Pokedex_HeightWeightData_Load(HeightWeightData *HWData, int trainerIsGirl, int param2); void Pokedex_HeightWeightData_Release(HeightWeightData *HWData); -int Pokedex_HeightWeightData_Height(const HeightWeightData *HWData, int dexNumber); -int Pokedex_HeightWeightData_Weight(const HeightWeightData *HWData, int dexNumber); -short Pokedex_HeightWeightData_TrainerPos(const HeightWeightData *HWData, int dexNumber); -short Pokedex_HeightWeightData_PokemonPos(const HeightWeightData *HWData, int dexNumber); -short Pokedex_HeightWeightData_TrainerScale(const HeightWeightData *HWData, int dexNumber); -short Pokedex_HeightWeightData_PokemonScale(const HeightWeightData *HWData, int dexNumber); +int Pokedex_HeightWeightData_Height(const HeightWeightData *HWData, int species); +int Pokedex_HeightWeightData_Weight(const HeightWeightData *HWData, int species); +short Pokedex_HeightWeightData_TrainerPos(const HeightWeightData *HWData, int species); +short Pokedex_HeightWeightData_PokemonPos(const HeightWeightData *HWData, int species); +short Pokedex_HeightWeightData_TrainerScale(const HeightWeightData *HWData, int species); +short Pokedex_HeightWeightData_PokemonScale(const HeightWeightData *HWData, int species); #endif // POKEPLATINUM_Pokedex_HeightWeight_H diff --git a/include/unk_0202631C.h b/include/unk_0202631C.h index 3a047e89bf..9d6f2c5f50 100644 --- a/include/unk_0202631C.h +++ b/include/unk_0202631C.h @@ -9,45 +9,45 @@ int Pokedex_SaveSize(void); 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); +void Pokedex_Init(PokedexData *dexData); +u16 sub_02026DD0(const PokedexData *dexData); +u16 sub_02026E0C(const PokedexData *dexData); +u16 sub_02026E48(const PokedexData *dexData); +u16 sub_02026E64(const PokedexData *dexData); +u16 sub_02026EAC(const PokedexData *dexData); +BOOL sub_02026EF4(const PokedexData *dexData); +BOOL sub_02026F0C(const PokedexData *dexData); +u16 sub_02026F20(const PokedexData *dexData); +u16 sub_02026F58(const PokedexData *dexData); +BOOL Pokedex_CaughtSpecies(const PokedexData *dexData, u16 species); +BOOL Pokedex_EncounteredSpecies(const PokedexData *dexData, u16 species); +u32 sub_0202702C(const PokedexData *dexData, u8 param1); +u32 sub_02027058(const PokedexData *dexData, u16 param1, int param2); +u32 sub_020270AC(const PokedexData *dexData, int param1); +u32 sub_020270DC(const PokedexData *dexData); +u32 sub_020270F8(const PokedexData *dexData, int param1); +u32 sub_02027130(const PokedexData *dexData); +u32 sub_02027154(const PokedexData *dexData, int param1); +u32 sub_0202718C(const PokedexData *dexData); +u32 sub_020271B0(const PokedexData *dexData, int param1); +u32 sub_020271E8(const PokedexData *dexData); +u32 sub_02027208(const PokedexData *dexData, int param1); +u32 sub_02027240(const PokedexData *dexData); +u32 sub_02027264(const PokedexData *dexData, int param1); +u32 sub_02027288(const PokedexData *dexData); +void sub_020272A4(PokedexData *dexData, Pokemon *param1); +void sub_0202736C(PokedexData *dexData, Pokemon *param1); +void sub_02027454(PokedexData *dexData); +BOOL Pokedex_NationalUnlocked(const PokedexData *dexData); +BOOL Pokedex_CanDetectForms(const PokedexData *dexData); +void Pokedex_CanDetectForms_True(PokedexData *dexData); +BOOL sub_020274D0(const PokedexData *dexData, u16 param1, u32 param2); +void sub_02027508(PokedexData *dexData); +BOOL sub_02027514(const PokedexData *dexData); +BOOL sub_02027520(const PokedexData *dexData); +void sub_02027540(PokedexData *dexData); PokedexData *SaveData_Pokedex(SaveData *param0); -u32 sub_0202756C(const PokedexData *param0, int param1, int param2); -u32 sub_020276C8(const PokedexData *param0, int param1); +u32 sub_0202756C(const PokedexData *dexData, int param1, int param2); +u32 sub_020276C8(const PokedexData *dexData, int param1); #endif // POKEPLATINUM_UNK_0202631C_H diff --git a/platinum.us/main.lsf b/platinum.us/main.lsf index b2f8274d34..d39cc5c8dc 100644 --- a/platinum.us/main.lsf +++ b/platinum.us/main.lsf @@ -786,7 +786,7 @@ Overlay overlay21 Object main.nef.p/src_overlay021_ov21_021D0D80.c.o Object main.nef.p/src_overlay021_ov21_021D1F90.c.o Object main.nef.p/src_overlay021_ov21_021D1FA4.c.o - Object main.nef.p/src_overlay021_ov21_021D3208.c.o + Object main.nef.p/src_overlay021_pokedex_sort.c.o Object main.nef.p/src_overlay021_ov21_021D3FE0.c.o Object main.nef.p/src_overlay021_ov21_021D423C.c.o Object main.nef.p/src_overlay021_ov21_021D4340.c.o diff --git a/res/field/encounters/000.json b/res/field/encounters/000.json index 234331b6a9..e039852c93 100644 --- a/res/field/encounters/000.json +++ b/res/field/encounters/000.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_LUMINEON" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 1 + } +} \ No newline at end of file diff --git a/res/field/encounters/001.json b/res/field/encounters/001.json index 1cbd049016..7fa37a85e8 100644 --- a/res/field/encounters/001.json +++ b/res/field/encounters/001.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_WHISCASH" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 2 + } +} \ No newline at end of file diff --git a/res/field/encounters/002.json b/res/field/encounters/002.json index 7b9a38acb0..900b3dec64 100644 --- a/res/field/encounters/002.json +++ b/res/field/encounters/002.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_OCTILLERY" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 3 + } +} \ No newline at end of file diff --git a/res/field/encounters/003.json b/res/field/encounters/003.json index 8814346064..957bd7513c 100644 --- a/res/field/encounters/003.json +++ b/res/field/encounters/003.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_OCTILLERY" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 4 + } +} \ No newline at end of file diff --git a/res/field/encounters/004.json b/res/field/encounters/004.json index 62aa986ab7..3e0626e0c1 100644 --- a/res/field/encounters/004.json +++ b/res/field/encounters/004.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_OCTILLERY" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 5 + } +} \ No newline at end of file diff --git a/res/field/encounters/005.json b/res/field/encounters/005.json index 734fa90b27..c08ddf4b75 100644 --- a/res/field/encounters/005.json +++ b/res/field/encounters/005.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 1 + } +} \ No newline at end of file diff --git a/res/field/encounters/006.json b/res/field/encounters/006.json index 3f870c490a..3e63875d01 100644 --- a/res/field/encounters/006.json +++ b/res/field/encounters/006.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 1 + } +} \ No newline at end of file diff --git a/res/field/encounters/007.json b/res/field/encounters/007.json index db164bfedc..26b5fdfb9f 100644 --- a/res/field/encounters/007.json +++ b/res/field/encounters/007.json @@ -205,5 +205,25 @@ "level_min": 40, "species": "SPECIES_LUMINEON" } - ] -} + ], + "special_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "specialnatdex_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "map_category": { + "map_type": "field", + "map_number": 6 + } +} \ No newline at end of file diff --git a/res/field/encounters/008.json b/res/field/encounters/008.json index b416ebe526..3712b44484 100644 --- a/res/field/encounters/008.json +++ b/res/field/encounters/008.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 2 + } +} \ No newline at end of file diff --git a/res/field/encounters/009.json b/res/field/encounters/009.json index 294708365c..cd164080f6 100644 --- a/res/field/encounters/009.json +++ b/res/field/encounters/009.json @@ -205,5 +205,25 @@ "level_min": 40, "species": "SPECIES_LUMINEON" } - ] -} + ], + "special_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "specialnatdex_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "map_category": { + "map_type": "field", + "map_number": 7 + } +} \ No newline at end of file diff --git a/res/field/encounters/010.json b/res/field/encounters/010.json index 22b9007483..6d1fd57e15 100644 --- a/res/field/encounters/010.json +++ b/res/field/encounters/010.json @@ -205,5 +205,15 @@ "level_min": 40, "species": "SPECIES_WHISCASH" } - ] -} + ], + "special_encounters": [ + "SPECIES_FEEBAS" + ], + "specialnatdex_encounters": [ + "SPECIES_FEEBAS" + ], + "map_category": { + "map_type": "dungeon", + "map_number": 3 + } +} \ No newline at end of file diff --git a/res/field/encounters/011.json b/res/field/encounters/011.json index d5c75352ce..ec655b7eca 100644 --- a/res/field/encounters/011.json +++ b/res/field/encounters/011.json @@ -205,5 +205,15 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [ + "SPECIES_FEEBAS" + ], + "specialnatdex_encounters": [ + "SPECIES_FEEBAS" + ], + "map_category": { + "map_type": "dungeon", + "map_number": 3 + } +} \ No newline at end of file diff --git a/res/field/encounters/012.json b/res/field/encounters/012.json index 315b6fcb87..48408ee419 100644 --- a/res/field/encounters/012.json +++ b/res/field/encounters/012.json @@ -205,5 +205,15 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [ + "SPECIES_FEEBAS" + ], + "specialnatdex_encounters": [ + "SPECIES_FEEBAS" + ], + "map_category": { + "map_type": "dungeon", + "map_number": 3 + } +} \ No newline at end of file diff --git a/res/field/encounters/013.json b/res/field/encounters/013.json index 799f78b9af..8697bc959e 100644 --- a/res/field/encounters/013.json +++ b/res/field/encounters/013.json @@ -205,5 +205,15 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [ + "SPECIES_FEEBAS" + ], + "specialnatdex_encounters": [ + "SPECIES_FEEBAS" + ], + "map_category": { + "map_type": "dungeon", + "map_number": 3 + } +} \ No newline at end of file diff --git a/res/field/encounters/014.json b/res/field/encounters/014.json index 799f78b9af..8697bc959e 100644 --- a/res/field/encounters/014.json +++ b/res/field/encounters/014.json @@ -205,5 +205,15 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [ + "SPECIES_FEEBAS" + ], + "specialnatdex_encounters": [ + "SPECIES_FEEBAS" + ], + "map_category": { + "map_type": "dungeon", + "map_number": 3 + } +} \ No newline at end of file diff --git a/res/field/encounters/015.json b/res/field/encounters/015.json index 1158c1dc9c..39616bcdef 100644 --- a/res/field/encounters/015.json +++ b/res/field/encounters/015.json @@ -205,5 +205,15 @@ "level_min": 35, "species": "SPECIES_DRAGONAIR" } - ] -} + ], + "special_encounters": [ + "SPECIES_FEEBAS" + ], + "specialnatdex_encounters": [ + "SPECIES_FEEBAS" + ], + "map_category": { + "map_type": "dungeon", + "map_number": 3 + } +} \ No newline at end of file diff --git a/res/field/encounters/016.json b/res/field/encounters/016.json index 5b960748d4..9b4a03a1cc 100644 --- a/res/field/encounters/016.json +++ b/res/field/encounters/016.json @@ -205,5 +205,15 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [ + "SPECIES_FEEBAS" + ], + "specialnatdex_encounters": [ + "SPECIES_FEEBAS" + ], + "map_category": { + "map_type": "dungeon", + "map_number": 3 + } +} \ No newline at end of file diff --git a/res/field/encounters/017.json b/res/field/encounters/017.json index dfb6696348..840b8213f2 100644 --- a/res/field/encounters/017.json +++ b/res/field/encounters/017.json @@ -205,5 +205,15 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [ + "SPECIES_FEEBAS" + ], + "specialnatdex_encounters": [ + "SPECIES_FEEBAS" + ], + "map_category": { + "map_type": "dungeon", + "map_number": 3 + } +} \ No newline at end of file diff --git a/res/field/encounters/018.json b/res/field/encounters/018.json index 345652a433..a3218fd612 100644 --- a/res/field/encounters/018.json +++ b/res/field/encounters/018.json @@ -205,5 +205,15 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [ + "SPECIES_FEEBAS" + ], + "specialnatdex_encounters": [ + "SPECIES_FEEBAS" + ], + "map_category": { + "map_type": "dungeon", + "map_number": 3 + } +} \ No newline at end of file diff --git a/res/field/encounters/019.json b/res/field/encounters/019.json index 3f57ca0cc4..08d9fc606e 100644 --- a/res/field/encounters/019.json +++ b/res/field/encounters/019.json @@ -205,5 +205,15 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [ + "SPECIES_FEEBAS" + ], + "specialnatdex_encounters": [ + "SPECIES_FEEBAS" + ], + "map_category": { + "map_type": "dungeon", + "map_number": 3 + } +} \ No newline at end of file diff --git a/res/field/encounters/020.json b/res/field/encounters/020.json index 61355c7603..98ae256a74 100644 --- a/res/field/encounters/020.json +++ b/res/field/encounters/020.json @@ -205,5 +205,15 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [ + "SPECIES_FEEBAS" + ], + "specialnatdex_encounters": [ + "SPECIES_FEEBAS" + ], + "map_category": { + "map_type": "dungeon", + "map_number": 3 + } +} \ No newline at end of file diff --git a/res/field/encounters/021.json b/res/field/encounters/021.json index 7834a1d9ff..4e96a8e85b 100644 --- a/res/field/encounters/021.json +++ b/res/field/encounters/021.json @@ -205,5 +205,15 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [ + "SPECIES_FEEBAS" + ], + "specialnatdex_encounters": [ + "SPECIES_FEEBAS" + ], + "map_category": { + "map_type": "dungeon", + "map_number": 3 + } +} \ No newline at end of file diff --git a/res/field/encounters/022.json b/res/field/encounters/022.json index f113d129d4..d12ce21023 100644 --- a/res/field/encounters/022.json +++ b/res/field/encounters/022.json @@ -205,5 +205,15 @@ "level_min": 40, "species": "SPECIES_WHISCASH" } - ] -} + ], + "special_encounters": [ + "SPECIES_FEEBAS" + ], + "specialnatdex_encounters": [ + "SPECIES_FEEBAS" + ], + "map_category": { + "map_type": "dungeon", + "map_number": 3 + } +} \ No newline at end of file diff --git a/res/field/encounters/023.json b/res/field/encounters/023.json index 9cb2731daa..93e25dfa46 100644 --- a/res/field/encounters/023.json +++ b/res/field/encounters/023.json @@ -205,5 +205,33 @@ "level_min": 40, "species": "SPECIES_CARVANHA" } - ] -} + ], + "special_encounters": [ + "SPECIES_TANGELA", + "SPECIES_YANMA", + "SPECIES_WOOPER", + "SPECIES_QUAGSIRE", + "SPECIES_TROPIUS", + "SPECIES_SKORUPI", + "SPECIES_CROAGUNK", + "SPECIES_CARNIVINE" + ], + "specialnatdex_encounters": [ + "SPECIES_PARAS", + "SPECIES_EXEGGCUTE", + "SPECIES_KANGASKHAN", + "SPECIES_SHROOMISH", + "SPECIES_GULPIN", + "SPECIES_KECLEON", + "SPECIES_TROPIUS", + "SPECIES_SKORUPI", + "SPECIES_DRAPION", + "SPECIES_CROAGUNK", + "SPECIES_TOXICROAK", + "SPECIES_CARNIVINE" + ], + "map_category": { + "map_type": "dungeon", + "map_number": 4 + } +} \ No newline at end of file diff --git a/res/field/encounters/024.json b/res/field/encounters/024.json index 9cb2731daa..93e25dfa46 100644 --- a/res/field/encounters/024.json +++ b/res/field/encounters/024.json @@ -205,5 +205,33 @@ "level_min": 40, "species": "SPECIES_CARVANHA" } - ] -} + ], + "special_encounters": [ + "SPECIES_TANGELA", + "SPECIES_YANMA", + "SPECIES_WOOPER", + "SPECIES_QUAGSIRE", + "SPECIES_TROPIUS", + "SPECIES_SKORUPI", + "SPECIES_CROAGUNK", + "SPECIES_CARNIVINE" + ], + "specialnatdex_encounters": [ + "SPECIES_PARAS", + "SPECIES_EXEGGCUTE", + "SPECIES_KANGASKHAN", + "SPECIES_SHROOMISH", + "SPECIES_GULPIN", + "SPECIES_KECLEON", + "SPECIES_TROPIUS", + "SPECIES_SKORUPI", + "SPECIES_DRAPION", + "SPECIES_CROAGUNK", + "SPECIES_TOXICROAK", + "SPECIES_CARNIVINE" + ], + "map_category": { + "map_type": "dungeon", + "map_number": 4 + } +} \ No newline at end of file diff --git a/res/field/encounters/025.json b/res/field/encounters/025.json index dd518eccdb..22be9eb796 100644 --- a/res/field/encounters/025.json +++ b/res/field/encounters/025.json @@ -205,5 +205,33 @@ "level_min": 40, "species": "SPECIES_CARVANHA" } - ] -} + ], + "special_encounters": [ + "SPECIES_TANGELA", + "SPECIES_YANMA", + "SPECIES_WOOPER", + "SPECIES_QUAGSIRE", + "SPECIES_TROPIUS", + "SPECIES_SKORUPI", + "SPECIES_CROAGUNK", + "SPECIES_CARNIVINE" + ], + "specialnatdex_encounters": [ + "SPECIES_PARAS", + "SPECIES_EXEGGCUTE", + "SPECIES_KANGASKHAN", + "SPECIES_SHROOMISH", + "SPECIES_GULPIN", + "SPECIES_KECLEON", + "SPECIES_TROPIUS", + "SPECIES_SKORUPI", + "SPECIES_DRAPION", + "SPECIES_CROAGUNK", + "SPECIES_TOXICROAK", + "SPECIES_CARNIVINE" + ], + "map_category": { + "map_type": "dungeon", + "map_number": 4 + } +} \ No newline at end of file diff --git a/res/field/encounters/026.json b/res/field/encounters/026.json index dd518eccdb..22be9eb796 100644 --- a/res/field/encounters/026.json +++ b/res/field/encounters/026.json @@ -205,5 +205,33 @@ "level_min": 40, "species": "SPECIES_CARVANHA" } - ] -} + ], + "special_encounters": [ + "SPECIES_TANGELA", + "SPECIES_YANMA", + "SPECIES_WOOPER", + "SPECIES_QUAGSIRE", + "SPECIES_TROPIUS", + "SPECIES_SKORUPI", + "SPECIES_CROAGUNK", + "SPECIES_CARNIVINE" + ], + "specialnatdex_encounters": [ + "SPECIES_PARAS", + "SPECIES_EXEGGCUTE", + "SPECIES_KANGASKHAN", + "SPECIES_SHROOMISH", + "SPECIES_GULPIN", + "SPECIES_KECLEON", + "SPECIES_TROPIUS", + "SPECIES_SKORUPI", + "SPECIES_DRAPION", + "SPECIES_CROAGUNK", + "SPECIES_TOXICROAK", + "SPECIES_CARNIVINE" + ], + "map_category": { + "map_type": "dungeon", + "map_number": 4 + } +} \ No newline at end of file diff --git a/res/field/encounters/027.json b/res/field/encounters/027.json index 119b24b3dd..61b4e44ca5 100644 --- a/res/field/encounters/027.json +++ b/res/field/encounters/027.json @@ -205,5 +205,33 @@ "level_min": 40, "species": "SPECIES_CARVANHA" } - ] -} + ], + "special_encounters": [ + "SPECIES_TANGELA", + "SPECIES_YANMA", + "SPECIES_WOOPER", + "SPECIES_QUAGSIRE", + "SPECIES_TROPIUS", + "SPECIES_SKORUPI", + "SPECIES_CROAGUNK", + "SPECIES_CARNIVINE" + ], + "specialnatdex_encounters": [ + "SPECIES_PARAS", + "SPECIES_EXEGGCUTE", + "SPECIES_KANGASKHAN", + "SPECIES_SHROOMISH", + "SPECIES_GULPIN", + "SPECIES_KECLEON", + "SPECIES_TROPIUS", + "SPECIES_SKORUPI", + "SPECIES_DRAPION", + "SPECIES_CROAGUNK", + "SPECIES_TOXICROAK", + "SPECIES_CARNIVINE" + ], + "map_category": { + "map_type": "dungeon", + "map_number": 4 + } +} \ No newline at end of file diff --git a/res/field/encounters/028.json b/res/field/encounters/028.json index 119b24b3dd..61b4e44ca5 100644 --- a/res/field/encounters/028.json +++ b/res/field/encounters/028.json @@ -205,5 +205,33 @@ "level_min": 40, "species": "SPECIES_CARVANHA" } - ] -} + ], + "special_encounters": [ + "SPECIES_TANGELA", + "SPECIES_YANMA", + "SPECIES_WOOPER", + "SPECIES_QUAGSIRE", + "SPECIES_TROPIUS", + "SPECIES_SKORUPI", + "SPECIES_CROAGUNK", + "SPECIES_CARNIVINE" + ], + "specialnatdex_encounters": [ + "SPECIES_PARAS", + "SPECIES_EXEGGCUTE", + "SPECIES_KANGASKHAN", + "SPECIES_SHROOMISH", + "SPECIES_GULPIN", + "SPECIES_KECLEON", + "SPECIES_TROPIUS", + "SPECIES_SKORUPI", + "SPECIES_DRAPION", + "SPECIES_CROAGUNK", + "SPECIES_TOXICROAK", + "SPECIES_CARNIVINE" + ], + "map_category": { + "map_type": "dungeon", + "map_number": 4 + } +} \ No newline at end of file diff --git a/res/field/encounters/029.json b/res/field/encounters/029.json index bf156a99ee..d7a9701b2b 100644 --- a/res/field/encounters/029.json +++ b/res/field/encounters/029.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 5 + } +} \ No newline at end of file diff --git a/res/field/encounters/030.json b/res/field/encounters/030.json index 78ae7fa05c..39ac650c90 100644 --- a/res/field/encounters/030.json +++ b/res/field/encounters/030.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 5 + } +} \ No newline at end of file diff --git a/res/field/encounters/031.json b/res/field/encounters/031.json index 78ae7fa05c..39ac650c90 100644 --- a/res/field/encounters/031.json +++ b/res/field/encounters/031.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 5 + } +} \ No newline at end of file diff --git a/res/field/encounters/032.json b/res/field/encounters/032.json index 45a4d6d8ec..32c0ad4c91 100644 --- a/res/field/encounters/032.json +++ b/res/field/encounters/032.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 5 + } +} \ No newline at end of file diff --git a/res/field/encounters/033.json b/res/field/encounters/033.json index 78ae7fa05c..39ac650c90 100644 --- a/res/field/encounters/033.json +++ b/res/field/encounters/033.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 5 + } +} \ No newline at end of file diff --git a/res/field/encounters/034.json b/res/field/encounters/034.json index a2e3a596bf..bb97d3863b 100644 --- a/res/field/encounters/034.json +++ b/res/field/encounters/034.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 5 + } +} \ No newline at end of file diff --git a/res/field/encounters/035.json b/res/field/encounters/035.json index 78ae7fa05c..39ac650c90 100644 --- a/res/field/encounters/035.json +++ b/res/field/encounters/035.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 5 + } +} \ No newline at end of file diff --git a/res/field/encounters/036.json b/res/field/encounters/036.json index 78ae7fa05c..39ac650c90 100644 --- a/res/field/encounters/036.json +++ b/res/field/encounters/036.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 5 + } +} \ No newline at end of file diff --git a/res/field/encounters/037.json b/res/field/encounters/037.json index 78ae7fa05c..39ac650c90 100644 --- a/res/field/encounters/037.json +++ b/res/field/encounters/037.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 5 + } +} \ No newline at end of file diff --git a/res/field/encounters/038.json b/res/field/encounters/038.json index 78ae7fa05c..39ac650c90 100644 --- a/res/field/encounters/038.json +++ b/res/field/encounters/038.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 5 + } +} \ No newline at end of file diff --git a/res/field/encounters/039.json b/res/field/encounters/039.json index 78ae7fa05c..39ac650c90 100644 --- a/res/field/encounters/039.json +++ b/res/field/encounters/039.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 5 + } +} \ No newline at end of file diff --git a/res/field/encounters/040.json b/res/field/encounters/040.json index de2f31f263..3834c249c4 100644 --- a/res/field/encounters/040.json +++ b/res/field/encounters/040.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 5 + } +} \ No newline at end of file diff --git a/res/field/encounters/041.json b/res/field/encounters/041.json index 969fdede92..27772062ef 100644 --- a/res/field/encounters/041.json +++ b/res/field/encounters/041.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 5 + } +} \ No newline at end of file diff --git a/res/field/encounters/042.json b/res/field/encounters/042.json index 2d00cc2799..f85c397fc2 100644 --- a/res/field/encounters/042.json +++ b/res/field/encounters/042.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 5 + } +} \ No newline at end of file diff --git a/res/field/encounters/043.json b/res/field/encounters/043.json index 4277aad18b..d070590ae7 100644 --- a/res/field/encounters/043.json +++ b/res/field/encounters/043.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 5 + } +} \ No newline at end of file diff --git a/res/field/encounters/044.json b/res/field/encounters/044.json index 78ae7fa05c..39ac650c90 100644 --- a/res/field/encounters/044.json +++ b/res/field/encounters/044.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 5 + } +} \ No newline at end of file diff --git a/res/field/encounters/045.json b/res/field/encounters/045.json index 78ae7fa05c..39ac650c90 100644 --- a/res/field/encounters/045.json +++ b/res/field/encounters/045.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 5 + } +} \ No newline at end of file diff --git a/res/field/encounters/046.json b/res/field/encounters/046.json index 78ae7fa05c..39ac650c90 100644 --- a/res/field/encounters/046.json +++ b/res/field/encounters/046.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 5 + } +} \ No newline at end of file diff --git a/res/field/encounters/047.json b/res/field/encounters/047.json index 367e234878..849c045661 100644 --- a/res/field/encounters/047.json +++ b/res/field/encounters/047.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 6 + } +} \ No newline at end of file diff --git a/res/field/encounters/048.json b/res/field/encounters/048.json index 62af1eea84..fa384aa09b 100644 --- a/res/field/encounters/048.json +++ b/res/field/encounters/048.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 6 + } +} \ No newline at end of file diff --git a/res/field/encounters/049.json b/res/field/encounters/049.json index 1b70f9b108..903e3c6139 100644 --- a/res/field/encounters/049.json +++ b/res/field/encounters/049.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_GYARADOS" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 6 + } +} \ No newline at end of file diff --git a/res/field/encounters/050.json b/res/field/encounters/050.json index 012b63046e..bf42ed4395 100644 --- a/res/field/encounters/050.json +++ b/res/field/encounters/050.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_GYARADOS" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 6 + } +} \ No newline at end of file diff --git a/res/field/encounters/051.json b/res/field/encounters/051.json index d22dfcf01e..e1e6809993 100644 --- a/res/field/encounters/051.json +++ b/res/field/encounters/051.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 6 + } +} \ No newline at end of file diff --git a/res/field/encounters/052.json b/res/field/encounters/052.json index c9ba3aff64..852fa7f647 100644 --- a/res/field/encounters/052.json +++ b/res/field/encounters/052.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 6 + } +} \ No newline at end of file diff --git a/res/field/encounters/053.json b/res/field/encounters/053.json index cb301908ce..0a7b300827 100644 --- a/res/field/encounters/053.json +++ b/res/field/encounters/053.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_WHISCASH" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 7 + } +} \ No newline at end of file diff --git a/res/field/encounters/054.json b/res/field/encounters/054.json index f1f8634eda..36a7874cd6 100644 --- a/res/field/encounters/054.json +++ b/res/field/encounters/054.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 8 + } +} \ No newline at end of file diff --git a/res/field/encounters/055.json b/res/field/encounters/055.json index 6b9d2362f9..208e69dad1 100644 --- a/res/field/encounters/055.json +++ b/res/field/encounters/055.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_WHISCASH" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 8 + } +} \ No newline at end of file diff --git a/res/field/encounters/056.json b/res/field/encounters/056.json index 277eacb7d3..9aa69897e6 100644 --- a/res/field/encounters/056.json +++ b/res/field/encounters/056.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 8 + } +} \ No newline at end of file diff --git a/res/field/encounters/057.json b/res/field/encounters/057.json index ffc404d5a0..1bad981e87 100644 --- a/res/field/encounters/057.json +++ b/res/field/encounters/057.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 9 + } +} \ No newline at end of file diff --git a/res/field/encounters/058.json b/res/field/encounters/058.json index 0ae64b32bd..7befdc7e9b 100644 --- a/res/field/encounters/058.json +++ b/res/field/encounters/058.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 9 + } +} \ No newline at end of file diff --git a/res/field/encounters/059.json b/res/field/encounters/059.json index a7220971bb..4a2df6644d 100644 --- a/res/field/encounters/059.json +++ b/res/field/encounters/059.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_SEAKING" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/060.json b/res/field/encounters/060.json index df3b8592b1..0c5a58c0e1 100644 --- a/res/field/encounters/060.json +++ b/res/field/encounters/060.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/061.json b/res/field/encounters/061.json index f614ca02ae..183ab10e06 100644 --- a/res/field/encounters/061.json +++ b/res/field/encounters/061.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/062.json b/res/field/encounters/062.json index 903cbffe61..ac0b723eba 100644 --- a/res/field/encounters/062.json +++ b/res/field/encounters/062.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/063.json b/res/field/encounters/063.json index df3b8592b1..0c5a58c0e1 100644 --- a/res/field/encounters/063.json +++ b/res/field/encounters/063.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/064.json b/res/field/encounters/064.json index df3b8592b1..0c5a58c0e1 100644 --- a/res/field/encounters/064.json +++ b/res/field/encounters/064.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/065.json b/res/field/encounters/065.json index df3b8592b1..0c5a58c0e1 100644 --- a/res/field/encounters/065.json +++ b/res/field/encounters/065.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/066.json b/res/field/encounters/066.json index df3b8592b1..0c5a58c0e1 100644 --- a/res/field/encounters/066.json +++ b/res/field/encounters/066.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/067.json b/res/field/encounters/067.json index df3b8592b1..0c5a58c0e1 100644 --- a/res/field/encounters/067.json +++ b/res/field/encounters/067.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/068.json b/res/field/encounters/068.json index df3b8592b1..0c5a58c0e1 100644 --- a/res/field/encounters/068.json +++ b/res/field/encounters/068.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/069.json b/res/field/encounters/069.json index 429efbfbf4..c6598f7f0d 100644 --- a/res/field/encounters/069.json +++ b/res/field/encounters/069.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/070.json b/res/field/encounters/070.json index a26b3d8a82..f56680906b 100644 --- a/res/field/encounters/070.json +++ b/res/field/encounters/070.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/071.json b/res/field/encounters/071.json index a26b3d8a82..f56680906b 100644 --- a/res/field/encounters/071.json +++ b/res/field/encounters/071.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/072.json b/res/field/encounters/072.json index a26b3d8a82..f56680906b 100644 --- a/res/field/encounters/072.json +++ b/res/field/encounters/072.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/073.json b/res/field/encounters/073.json index a26b3d8a82..f56680906b 100644 --- a/res/field/encounters/073.json +++ b/res/field/encounters/073.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/074.json b/res/field/encounters/074.json index a26b3d8a82..f56680906b 100644 --- a/res/field/encounters/074.json +++ b/res/field/encounters/074.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/075.json b/res/field/encounters/075.json index f614ca02ae..183ab10e06 100644 --- a/res/field/encounters/075.json +++ b/res/field/encounters/075.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/076.json b/res/field/encounters/076.json index f614ca02ae..183ab10e06 100644 --- a/res/field/encounters/076.json +++ b/res/field/encounters/076.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/077.json b/res/field/encounters/077.json index f614ca02ae..183ab10e06 100644 --- a/res/field/encounters/077.json +++ b/res/field/encounters/077.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/078.json b/res/field/encounters/078.json index f614ca02ae..183ab10e06 100644 --- a/res/field/encounters/078.json +++ b/res/field/encounters/078.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/079.json b/res/field/encounters/079.json index f614ca02ae..183ab10e06 100644 --- a/res/field/encounters/079.json +++ b/res/field/encounters/079.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/080.json b/res/field/encounters/080.json index f614ca02ae..183ab10e06 100644 --- a/res/field/encounters/080.json +++ b/res/field/encounters/080.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/081.json b/res/field/encounters/081.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/081.json +++ b/res/field/encounters/081.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/082.json b/res/field/encounters/082.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/082.json +++ b/res/field/encounters/082.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/083.json b/res/field/encounters/083.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/083.json +++ b/res/field/encounters/083.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/084.json b/res/field/encounters/084.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/084.json +++ b/res/field/encounters/084.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/085.json b/res/field/encounters/085.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/085.json +++ b/res/field/encounters/085.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/086.json b/res/field/encounters/086.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/086.json +++ b/res/field/encounters/086.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/087.json b/res/field/encounters/087.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/087.json +++ b/res/field/encounters/087.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/088.json b/res/field/encounters/088.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/088.json +++ b/res/field/encounters/088.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/089.json b/res/field/encounters/089.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/089.json +++ b/res/field/encounters/089.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/090.json b/res/field/encounters/090.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/090.json +++ b/res/field/encounters/090.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/091.json b/res/field/encounters/091.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/091.json +++ b/res/field/encounters/091.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/092.json b/res/field/encounters/092.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/092.json +++ b/res/field/encounters/092.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/093.json b/res/field/encounters/093.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/093.json +++ b/res/field/encounters/093.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/094.json b/res/field/encounters/094.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/094.json +++ b/res/field/encounters/094.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/095.json b/res/field/encounters/095.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/095.json +++ b/res/field/encounters/095.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/096.json b/res/field/encounters/096.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/096.json +++ b/res/field/encounters/096.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/097.json b/res/field/encounters/097.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/097.json +++ b/res/field/encounters/097.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/098.json b/res/field/encounters/098.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/098.json +++ b/res/field/encounters/098.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/099.json b/res/field/encounters/099.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/099.json +++ b/res/field/encounters/099.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/100.json b/res/field/encounters/100.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/100.json +++ b/res/field/encounters/100.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/101.json b/res/field/encounters/101.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/101.json +++ b/res/field/encounters/101.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/102.json b/res/field/encounters/102.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/102.json +++ b/res/field/encounters/102.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/103.json b/res/field/encounters/103.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/103.json +++ b/res/field/encounters/103.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/104.json b/res/field/encounters/104.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/104.json +++ b/res/field/encounters/104.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/105.json b/res/field/encounters/105.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/105.json +++ b/res/field/encounters/105.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/106.json b/res/field/encounters/106.json index 916141d087..446586db96 100644 --- a/res/field/encounters/106.json +++ b/res/field/encounters/106.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 11 + } +} \ No newline at end of file diff --git a/res/field/encounters/107.json b/res/field/encounters/107.json index 2cd66038a0..ad4e104c15 100644 --- a/res/field/encounters/107.json +++ b/res/field/encounters/107.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 11 + } +} \ No newline at end of file diff --git a/res/field/encounters/108.json b/res/field/encounters/108.json index fd646d18f5..f956aac726 100644 --- a/res/field/encounters/108.json +++ b/res/field/encounters/108.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 11 + } +} \ No newline at end of file diff --git a/res/field/encounters/109.json b/res/field/encounters/109.json index fd646d18f5..f956aac726 100644 --- a/res/field/encounters/109.json +++ b/res/field/encounters/109.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 11 + } +} \ No newline at end of file diff --git a/res/field/encounters/110.json b/res/field/encounters/110.json index 92019f23f1..1e6bf0b96a 100644 --- a/res/field/encounters/110.json +++ b/res/field/encounters/110.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 11 + } +} \ No newline at end of file diff --git a/res/field/encounters/111.json b/res/field/encounters/111.json index 92019f23f1..1e6bf0b96a 100644 --- a/res/field/encounters/111.json +++ b/res/field/encounters/111.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 11 + } +} \ No newline at end of file diff --git a/res/field/encounters/112.json b/res/field/encounters/112.json index 2b24ad2437..add49226d9 100644 --- a/res/field/encounters/112.json +++ b/res/field/encounters/112.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 12 + } +} \ No newline at end of file diff --git a/res/field/encounters/113.json b/res/field/encounters/113.json index 460de49245..3996b81540 100644 --- a/res/field/encounters/113.json +++ b/res/field/encounters/113.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 12 + } +} \ No newline at end of file diff --git a/res/field/encounters/114.json b/res/field/encounters/114.json index 8f501394f2..05e5a9830d 100644 --- a/res/field/encounters/114.json +++ b/res/field/encounters/114.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 13 + } +} \ No newline at end of file diff --git a/res/field/encounters/115.json b/res/field/encounters/115.json index a132ecf078..737dba9fdc 100644 --- a/res/field/encounters/115.json +++ b/res/field/encounters/115.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 13 + } +} \ No newline at end of file diff --git a/res/field/encounters/116.json b/res/field/encounters/116.json index a7ba1d8f35..85e4e131d8 100644 --- a/res/field/encounters/116.json +++ b/res/field/encounters/116.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 13 + } +} \ No newline at end of file diff --git a/res/field/encounters/117.json b/res/field/encounters/117.json index 22c21f4915..54ffaac63c 100644 --- a/res/field/encounters/117.json +++ b/res/field/encounters/117.json @@ -205,5 +205,28 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [ + "SPECIES_CLEFAIRY", + "SPECIES_JIGGLYPUFF", + "SPECIES_MEOWTH", + "SPECIES_CHANSEY", + "SPECIES_DITTO", + "SPECIES_EEVEE", + "SPECIES_CLEFFA", + "SPECIES_IGGLYBUFF", + "SPECIES_MARILL", + "SPECIES_AZURILL", + "SPECIES_PLUSLE", + "SPECIES_MINUN", + "SPECIES_CASTFORM", + "SPECIES_BONSLY", + "SPECIES_MIME_JR", + "SPECIES_HAPPINY" + ], + "map_category": { + "map_type": "dungeon", + "map_number": 14 + } +} \ No newline at end of file diff --git a/res/field/encounters/118.json b/res/field/encounters/118.json index f65babd923..3bf5f095cb 100644 --- a/res/field/encounters/118.json +++ b/res/field/encounters/118.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_LUMINEON" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 9 + } +} \ No newline at end of file diff --git a/res/field/encounters/119.json b/res/field/encounters/119.json index d33a8e4ffd..1d75aae421 100644 --- a/res/field/encounters/119.json +++ b/res/field/encounters/119.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 15 + } +} \ No newline at end of file diff --git a/res/field/encounters/120.json b/res/field/encounters/120.json index a78604408b..c5b434b069 100644 --- a/res/field/encounters/120.json +++ b/res/field/encounters/120.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 15 + } +} \ No newline at end of file diff --git a/res/field/encounters/121.json b/res/field/encounters/121.json index a78604408b..c5b434b069 100644 --- a/res/field/encounters/121.json +++ b/res/field/encounters/121.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 15 + } +} \ No newline at end of file diff --git a/res/field/encounters/122.json b/res/field/encounters/122.json index ba30327266..66ae375543 100644 --- a/res/field/encounters/122.json +++ b/res/field/encounters/122.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 15 + } +} \ No newline at end of file diff --git a/res/field/encounters/123.json b/res/field/encounters/123.json index ba30327266..66ae375543 100644 --- a/res/field/encounters/123.json +++ b/res/field/encounters/123.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 15 + } +} \ No newline at end of file diff --git a/res/field/encounters/124.json b/res/field/encounters/124.json index 880f2daa38..eeeffa2872 100644 --- a/res/field/encounters/124.json +++ b/res/field/encounters/124.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 15 + } +} \ No newline at end of file diff --git a/res/field/encounters/125.json b/res/field/encounters/125.json index 577dee485a..3b6d84b7a0 100644 --- a/res/field/encounters/125.json +++ b/res/field/encounters/125.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 16 + } +} \ No newline at end of file diff --git a/res/field/encounters/126.json b/res/field/encounters/126.json index 577dee485a..3b6d84b7a0 100644 --- a/res/field/encounters/126.json +++ b/res/field/encounters/126.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 16 + } +} \ No newline at end of file diff --git a/res/field/encounters/127.json b/res/field/encounters/127.json index 577dee485a..3b6d84b7a0 100644 --- a/res/field/encounters/127.json +++ b/res/field/encounters/127.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 16 + } +} \ No newline at end of file diff --git a/res/field/encounters/128.json b/res/field/encounters/128.json index 577dee485a..3b6d84b7a0 100644 --- a/res/field/encounters/128.json +++ b/res/field/encounters/128.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 16 + } +} \ No newline at end of file diff --git a/res/field/encounters/129.json b/res/field/encounters/129.json index 577dee485a..3b6d84b7a0 100644 --- a/res/field/encounters/129.json +++ b/res/field/encounters/129.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 16 + } +} \ No newline at end of file diff --git a/res/field/encounters/130.json b/res/field/encounters/130.json index 577dee485a..3b6d84b7a0 100644 --- a/res/field/encounters/130.json +++ b/res/field/encounters/130.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 16 + } +} \ No newline at end of file diff --git a/res/field/encounters/131.json b/res/field/encounters/131.json index 577dee485a..3b6d84b7a0 100644 --- a/res/field/encounters/131.json +++ b/res/field/encounters/131.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 16 + } +} \ No newline at end of file diff --git a/res/field/encounters/132.json b/res/field/encounters/132.json index 6b1aa99519..90379c3226 100644 --- a/res/field/encounters/132.json +++ b/res/field/encounters/132.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 16 + } +} \ No newline at end of file diff --git a/res/field/encounters/133.json b/res/field/encounters/133.json index 577dee485a..3b6d84b7a0 100644 --- a/res/field/encounters/133.json +++ b/res/field/encounters/133.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 16 + } +} \ No newline at end of file diff --git a/res/field/encounters/134.json b/res/field/encounters/134.json index 24b83ffa48..86e58e4308 100644 --- a/res/field/encounters/134.json +++ b/res/field/encounters/134.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_SEAKING" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 17 + } +} \ No newline at end of file diff --git a/res/field/encounters/135.json b/res/field/encounters/135.json index 0ac3580467..4988dab355 100644 --- a/res/field/encounters/135.json +++ b/res/field/encounters/135.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_SEAKING" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 17 + } +} \ No newline at end of file diff --git a/res/field/encounters/136.json b/res/field/encounters/136.json index f75f834465..279f141b84 100644 --- a/res/field/encounters/136.json +++ b/res/field/encounters/136.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_SEAKING" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 18 + } +} \ No newline at end of file diff --git a/res/field/encounters/137.json b/res/field/encounters/137.json index da4f64468c..88437c091d 100644 --- a/res/field/encounters/137.json +++ b/res/field/encounters/137.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_SEAKING" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 19 + } +} \ No newline at end of file diff --git a/res/field/encounters/138.json b/res/field/encounters/138.json index 54a35b53a6..751862a5b8 100644 --- a/res/field/encounters/138.json +++ b/res/field/encounters/138.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/139.json b/res/field/encounters/139.json index b254b37343..08dd025a3a 100644 --- a/res/field/encounters/139.json +++ b/res/field/encounters/139.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 11 + } +} \ No newline at end of file diff --git a/res/field/encounters/140.json b/res/field/encounters/140.json index 521435e154..1aa938ab74 100644 --- a/res/field/encounters/140.json +++ b/res/field/encounters/140.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 12 + } +} \ No newline at end of file diff --git a/res/field/encounters/141.json b/res/field/encounters/141.json index 51b47b21a5..3d5ccdf651 100644 --- a/res/field/encounters/141.json +++ b/res/field/encounters/141.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 13 + } +} \ No newline at end of file diff --git a/res/field/encounters/142.json b/res/field/encounters/142.json index a42a49d2a9..e849d753c6 100644 --- a/res/field/encounters/142.json +++ b/res/field/encounters/142.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_SEAKING" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 14 + } +} \ No newline at end of file diff --git a/res/field/encounters/143.json b/res/field/encounters/143.json index b33078a8f8..b79a2e1107 100644 --- a/res/field/encounters/143.json +++ b/res/field/encounters/143.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_SEAKING" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 15 + } +} \ No newline at end of file diff --git a/res/field/encounters/144.json b/res/field/encounters/144.json index 020bc9cc09..6aec343811 100644 --- a/res/field/encounters/144.json +++ b/res/field/encounters/144.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_SEAKING" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 16 + } +} \ No newline at end of file diff --git a/res/field/encounters/145.json b/res/field/encounters/145.json index b6362ef787..d69f0773a3 100644 --- a/res/field/encounters/145.json +++ b/res/field/encounters/145.json @@ -205,5 +205,25 @@ "level_min": 40, "species": "SPECIES_LUMINEON" } - ] -} + ], + "special_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "specialnatdex_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "map_category": { + "map_type": "field", + "map_number": 17 + } +} \ No newline at end of file diff --git a/res/field/encounters/146.json b/res/field/encounters/146.json index 1ffbb54932..f222fc077e 100644 --- a/res/field/encounters/146.json +++ b/res/field/encounters/146.json @@ -205,5 +205,25 @@ "level_min": 40, "species": "SPECIES_WHISCASH" } - ] -} + ], + "special_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "specialnatdex_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "map_category": { + "map_type": "field", + "map_number": 18 + } +} \ No newline at end of file diff --git a/res/field/encounters/147.json b/res/field/encounters/147.json index b341d68654..c803247481 100644 --- a/res/field/encounters/147.json +++ b/res/field/encounters/147.json @@ -205,5 +205,25 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "specialnatdex_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "map_category": { + "map_type": "field", + "map_number": 19 + } +} \ No newline at end of file diff --git a/res/field/encounters/148.json b/res/field/encounters/148.json index 86cce7df50..b61a410e75 100644 --- a/res/field/encounters/148.json +++ b/res/field/encounters/148.json @@ -205,5 +205,25 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "specialnatdex_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "map_category": { + "map_type": "field", + "map_number": 20 + } +} \ No newline at end of file diff --git a/res/field/encounters/149.json b/res/field/encounters/149.json index cd10a66c99..77869b5740 100644 --- a/res/field/encounters/149.json +++ b/res/field/encounters/149.json @@ -205,5 +205,25 @@ "level_min": 40, "species": "SPECIES_SEAKING" } - ] -} + ], + "special_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "specialnatdex_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "map_category": { + "map_type": "field", + "map_number": 21 + } +} \ No newline at end of file diff --git a/res/field/encounters/150.json b/res/field/encounters/150.json index 9af647be9f..4b68e4c867 100644 --- a/res/field/encounters/150.json +++ b/res/field/encounters/150.json @@ -205,5 +205,25 @@ "level_min": 40, "species": "SPECIES_SEAKING" } - ] -} + ], + "special_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "specialnatdex_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "map_category": { + "map_type": "field", + "map_number": 22 + } +} \ No newline at end of file diff --git a/res/field/encounters/151.json b/res/field/encounters/151.json index 5ffae7f4b8..a4eee59f4d 100644 --- a/res/field/encounters/151.json +++ b/res/field/encounters/151.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 20 + } +} \ No newline at end of file diff --git a/res/field/encounters/152.json b/res/field/encounters/152.json index 5ffae7f4b8..a4eee59f4d 100644 --- a/res/field/encounters/152.json +++ b/res/field/encounters/152.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 20 + } +} \ No newline at end of file diff --git a/res/field/encounters/153.json b/res/field/encounters/153.json index 33ee5d4392..40ee24aa2e 100644 --- a/res/field/encounters/153.json +++ b/res/field/encounters/153.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 20 + } +} \ No newline at end of file diff --git a/res/field/encounters/154.json b/res/field/encounters/154.json index fb95fcd355..d8d7665d58 100644 --- a/res/field/encounters/154.json +++ b/res/field/encounters/154.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 20 + } +} \ No newline at end of file diff --git a/res/field/encounters/155.json b/res/field/encounters/155.json index 218ce6ff39..b9d2254ea7 100644 --- a/res/field/encounters/155.json +++ b/res/field/encounters/155.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 20 + } +} \ No newline at end of file diff --git a/res/field/encounters/156.json b/res/field/encounters/156.json index d46cba82bf..dccde52d81 100644 --- a/res/field/encounters/156.json +++ b/res/field/encounters/156.json @@ -205,5 +205,25 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "specialnatdex_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "map_category": { + "map_type": "field", + "map_number": 23 + } +} \ No newline at end of file diff --git a/res/field/encounters/157.json b/res/field/encounters/157.json index 6e0c42af6a..dd6ff61ac5 100644 --- a/res/field/encounters/157.json +++ b/res/field/encounters/157.json @@ -205,5 +205,25 @@ "level_min": 40, "species": "SPECIES_WHISCASH" } - ] -} + ], + "special_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "specialnatdex_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "map_category": { + "map_type": "field", + "map_number": 24 + } +} \ No newline at end of file diff --git a/res/field/encounters/158.json b/res/field/encounters/158.json index 1a04c32bb6..5776f0289b 100644 --- a/res/field/encounters/158.json +++ b/res/field/encounters/158.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 25 + } +} \ No newline at end of file diff --git a/res/field/encounters/159.json b/res/field/encounters/159.json index 57e320947f..dc5fe30aa2 100644 --- a/res/field/encounters/159.json +++ b/res/field/encounters/159.json @@ -205,5 +205,25 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "specialnatdex_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "map_category": { + "map_type": "field", + "map_number": 26 + } +} \ No newline at end of file diff --git a/res/field/encounters/160.json b/res/field/encounters/160.json index 2b737e5960..82f96b1a98 100644 --- a/res/field/encounters/160.json +++ b/res/field/encounters/160.json @@ -205,5 +205,25 @@ "level_min": 40, "species": "SPECIES_SEAKING" } - ] -} + ], + "special_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "specialnatdex_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "map_category": { + "map_type": "field", + "map_number": 27 + } +} \ No newline at end of file diff --git a/res/field/encounters/161.json b/res/field/encounters/161.json index 43beb99213..a290546313 100644 --- a/res/field/encounters/161.json +++ b/res/field/encounters/161.json @@ -205,5 +205,25 @@ "level_min": 40, "species": "SPECIES_OCTILLERY" } - ] -} + ], + "special_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "specialnatdex_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "map_category": { + "map_type": "field", + "map_number": 28 + } +} \ No newline at end of file diff --git a/res/field/encounters/162.json b/res/field/encounters/162.json index efd7fabffb..f8ea5d5201 100644 --- a/res/field/encounters/162.json +++ b/res/field/encounters/162.json @@ -205,5 +205,25 @@ "level_min": 40, "species": "SPECIES_OCTILLERY" } - ] -} + ], + "special_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "specialnatdex_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "map_category": { + "map_type": "field", + "map_number": 29 + } +} \ No newline at end of file diff --git a/res/field/encounters/163.json b/res/field/encounters/163.json index 97255b806d..e17fe0375c 100644 --- a/res/field/encounters/163.json +++ b/res/field/encounters/163.json @@ -205,5 +205,25 @@ "level_min": 40, "species": "SPECIES_SEAKING" } - ] -} + ], + "special_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "specialnatdex_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "map_category": { + "map_type": "field", + "map_number": 30 + } +} \ No newline at end of file diff --git a/res/field/encounters/164.json b/res/field/encounters/164.json index 133fc12979..e84c68cea2 100644 --- a/res/field/encounters/164.json +++ b/res/field/encounters/164.json @@ -205,5 +205,25 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "specialnatdex_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "map_category": { + "map_type": "field", + "map_number": 31 + } +} \ No newline at end of file diff --git a/res/field/encounters/165.json b/res/field/encounters/165.json index 3624cc60bc..4e495bd957 100644 --- a/res/field/encounters/165.json +++ b/res/field/encounters/165.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 32 + } +} \ No newline at end of file diff --git a/res/field/encounters/166.json b/res/field/encounters/166.json index 8b854b2010..78326c04f8 100644 --- a/res/field/encounters/166.json +++ b/res/field/encounters/166.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 33 + } +} \ No newline at end of file diff --git a/res/field/encounters/167.json b/res/field/encounters/167.json index 1393cfb40b..328f15dd92 100644 --- a/res/field/encounters/167.json +++ b/res/field/encounters/167.json @@ -205,5 +205,25 @@ "level_min": 40, "species": "SPECIES_LUMINEON" } - ] -} + ], + "special_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "specialnatdex_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "map_category": { + "map_type": "field", + "map_number": 34 + } +} \ No newline at end of file diff --git a/res/field/encounters/168.json b/res/field/encounters/168.json index f1193ca5c6..b5fa375dde 100644 --- a/res/field/encounters/168.json +++ b/res/field/encounters/168.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_LUMINEON" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 35 + } +} \ No newline at end of file diff --git a/res/field/encounters/169.json b/res/field/encounters/169.json index 3ed1cf4af8..ceeb25a912 100644 --- a/res/field/encounters/169.json +++ b/res/field/encounters/169.json @@ -205,5 +205,25 @@ "level_min": 40, "species": "SPECIES_LUMINEON" } - ] -} + ], + "special_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "specialnatdex_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "map_category": { + "map_type": "field", + "map_number": 36 + } +} \ No newline at end of file diff --git a/res/field/encounters/170.json b/res/field/encounters/170.json index 091eb14c58..6c018b2a1c 100644 --- a/res/field/encounters/170.json +++ b/res/field/encounters/170.json @@ -205,5 +205,25 @@ "level_min": 40, "species": "SPECIES_OCTILLERY" } - ] -} + ], + "special_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "specialnatdex_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "map_category": { + "map_type": "field", + "map_number": 37 + } +} \ No newline at end of file diff --git a/res/field/encounters/171.json b/res/field/encounters/171.json index b8952ea025..cdaffc9aec 100644 --- a/res/field/encounters/171.json +++ b/res/field/encounters/171.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_OCTILLERY" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 38 + } +} \ No newline at end of file diff --git a/res/field/encounters/172.json b/res/field/encounters/172.json index 5520e20a33..36f912b3db 100644 --- a/res/field/encounters/172.json +++ b/res/field/encounters/172.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_WHISCASH" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 39 + } +} \ No newline at end of file diff --git a/res/field/encounters/173.json b/res/field/encounters/173.json index ec22878414..4c4972a4d9 100644 --- a/res/field/encounters/173.json +++ b/res/field/encounters/173.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_WHISCASH" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 40 + } +} \ No newline at end of file diff --git a/res/field/encounters/174.json b/res/field/encounters/174.json index 1744b3bd0f..824c555891 100644 --- a/res/field/encounters/174.json +++ b/res/field/encounters/174.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_WHISCASH" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 41 + } +} \ No newline at end of file diff --git a/res/field/encounters/175.json b/res/field/encounters/175.json index ddc8969484..08e4042637 100644 --- a/res/field/encounters/175.json +++ b/res/field/encounters/175.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_SEAKING" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 42 + } +} \ No newline at end of file diff --git a/res/field/encounters/176.json b/res/field/encounters/176.json index e2530b7d84..8da1248f21 100644 --- a/res/field/encounters/176.json +++ b/res/field/encounters/176.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_SEAKING" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 43 + } +} \ No newline at end of file diff --git a/res/field/encounters/177.json b/res/field/encounters/177.json index 114d8cd8f3..0898bd536c 100644 --- a/res/field/encounters/177.json +++ b/res/field/encounters/177.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_SEAKING" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 44 + } +} \ No newline at end of file diff --git a/res/field/encounters/178.json b/res/field/encounters/178.json index d6df75c4bf..a6ca358b85 100644 --- a/res/field/encounters/178.json +++ b/res/field/encounters/178.json @@ -205,5 +205,11 @@ "level_min": 1, "species": "SPECIES_MAGIKARP" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 45 + } +} \ No newline at end of file diff --git a/res/field/encounters/179.json b/res/field/encounters/179.json index bf0947303a..dc9c98c9b6 100644 --- a/res/field/encounters/179.json +++ b/res/field/encounters/179.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_LUMINEON" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 46 + } +} \ No newline at end of file diff --git a/res/field/encounters/180.json b/res/field/encounters/180.json index ce0011dcd7..9f8c46c5d6 100644 --- a/res/field/encounters/180.json +++ b/res/field/encounters/180.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_WAILORD" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 47 + } +} \ No newline at end of file diff --git a/res/field/encounters/181.json b/res/field/encounters/181.json index e11e72847d..110ac1e25c 100644 --- a/res/field/encounters/181.json +++ b/res/field/encounters/181.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_SEADRA" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 48 + } +} \ No newline at end of file diff --git a/res/field/encounters/182.json b/res/field/encounters/182.json index da6071f057..a1c3b9f724 100644 --- a/res/field/encounters/182.json +++ b/res/field/encounters/182.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_WAILORD" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 49 + } +} \ No newline at end of file diff --git a/res/prebuilt/application/zukanlist/zkn_data/meson.build b/res/prebuilt/application/zukanlist/zkn_data/meson.build index 8b1fd89c98..ae91d0fc68 100644 --- a/res/prebuilt/application/zukanlist/zkn_data/meson.build +++ b/res/prebuilt/application/zukanlist/zkn_data/meson.build @@ -1,7 +1,6 @@ prebuilt_files = [ 'zukan_enc_diamond.narc', - 'zukan_enc_pearl.narc', - 'zukan_enc_platinum.narc' + 'zukan_enc_pearl.narc' ] foreach f : prebuilt_files @@ -44,5 +43,20 @@ pokedex_data_giratina_altered_narc = custom_target('zukan_data_gira.narc', ] ) +pokedex_enc_platinum_narc = custom_target('zukan_enc_platinum.narc', + output: 'zukan_enc_platinum.narc', + input: personal_files, + env: json2bin_env, + depends: [ py_consts_generators ], + command: [ + make_pokedex_enc_platinum_py, + '--knarc', knarc_exe, + '--source-dir', '@CURRENT_SOURCE_DIR@', + '--private-dir', '@PRIVATE_DIR@', + '--output-dir', '@OUTDIR@' + ] +) + nitrofs_files += pokedex_data_narc nitrofs_files += pokedex_data_giratina_altered_narc +nitrofs_files += pokedex_enc_platinum_narc diff --git a/res/prebuilt/application/zukanlist/zkn_data/zukan_enc_platinum.narc b/res/prebuilt/application/zukanlist/zkn_data/zukan_enc_platinum.narc deleted file mode 100644 index a3a8ea7d90..0000000000 Binary files a/res/prebuilt/application/zukanlist/zkn_data/zukan_enc_platinum.narc and /dev/null differ diff --git a/src/field_menu.c b/src/field_menu.c index c9001fcae5..10fcaa622b 100644 --- a/src/field_menu.c +++ b/src/field_menu.c @@ -956,11 +956,11 @@ static BOOL FieldMenu_Pokedex(TaskManager *taskMan) v2->unk_00 = v3; v2->unk_04 = v4; - v2->unk_08 = sub_02055BA8(fieldSystem); - v2->unk_0C = sub_0206B1F0(v5, 0); - v2->unk_10 = sub_0206B1F0(v5, 1); - v2->unk_14 = sub_0206B1F0(v5, 2); - v2->unk_18 = sub_0206B1F0(v5, 3); + v2->timeOfDay = sub_02055BA8(fieldSystem); + v2->pokedexSFlag_1 = sub_0206B1F0(v5, 0);// VarsFlags->vars[54] + v2->pokedexSFlag_2 = sub_0206B1F0(v5, 1);// VarsFlags->vars[55] + v2->pokedexSFlag_3 = sub_0206B1F0(v5, 2);// VarsFlags->vars[56] + v2->pokedexSFlag_4 = sub_0206B1F0(v5, 3);// VarsFlags->vars[57] v2->unk_1C = fieldSystem->unk_B4; sub_0203E0AC(fieldSystem, v2); diff --git a/src/meson.build b/src/meson.build index a472023fb6..46f72878c0 100644 --- a/src/meson.build +++ b/src/meson.build @@ -597,7 +597,7 @@ pokeplatinum_c = files( 'overlay021/ov21_021D0D80.c', 'overlay021/ov21_021D1F90.c', 'overlay021/ov21_021D1FA4.c', - 'overlay021/ov21_021D3208.c', + 'overlay021/pokedex_sort.c', 'overlay021/ov21_021D3FE0.c', 'overlay021/ov21_021D423C.c', 'overlay021/ov21_021D4340.c', diff --git a/src/overlay005/ov5_021F77A8.c b/src/overlay005/ov5_021F77A8.c index 142083f35d..1def40bc09 100644 --- a/src/overlay005/ov5_021F77A8.c +++ b/src/overlay005/ov5_021F77A8.c @@ -96,7 +96,7 @@ BOOL ScrCmd_337(ScriptContext *param0) u16 *v1 = FieldSystem_GetVarPointer(param0->fieldSystem, ScriptContext_ReadHalfWord(param0)); PokedexData *v2 = SaveData_Pokedex(param0->fieldSystem->saveData); - *v1 = sub_02026FE8(v2, v0); + *v1 = Pokedex_EncounteredSpecies(v2, v0); return 0; } diff --git a/src/overlay006/ov6_02240C9C.c b/src/overlay006/ov6_02240C9C.c index c53f151de3..d81dd3c070 100644 --- a/src/overlay006/ov6_02240C9C.c +++ b/src/overlay006/ov6_02240C9C.c @@ -326,7 +326,7 @@ BOOL ov6_02240D5C(FieldSystem *fieldSystem) v13[i].minLevel = encounterData->grassEncounters.encounters[i].level; } - BOOL nationalDexObtained = sub_02027474(SaveData_Pokedex(FieldSystem_SaveData(fieldSystem))); + BOOL nationalDexObtained = Pokedex_NationalUnlocked(SaveData_Pokedex(FieldSystem_SaveData(fieldSystem))); WildEncounters_ReplaceTimedEncounters(encounterData, &v13[2].species, &v13[3].species); WildEncounters_ReplaceRadarEncounters(fieldSystem, encounterData, &v13[0].species, &v13[1].species); @@ -514,7 +514,7 @@ BOOL ov6_022411C8(FieldSystem *fieldSystem, TaskManager *param1) v12[i].minLevel = encounterData->grassEncounters.encounters[i].level; } - BOOL nationalDexObtained = sub_02027474(SaveData_Pokedex(FieldSystem_SaveData(fieldSystem))); + BOOL nationalDexObtained = Pokedex_NationalUnlocked(SaveData_Pokedex(FieldSystem_SaveData(fieldSystem))); WildEncounters_ReplaceTimedEncounters(encounterData, &v12[2].species, &v12[3].species); WildEncounters_ReplaceRadarEncounters(fieldSystem, encounterData, &v12[0].species, &v12[1].species); @@ -643,7 +643,7 @@ BOOL ov6_022413E4(FieldSystem *fieldSystem, BattleParams **battleParams) v12[i].minLevel = encounterData->grassEncounters.encounters[i].level; } - BOOL nationalDexObtained = sub_02027474(SaveData_Pokedex(FieldSystem_SaveData(fieldSystem))); + BOOL nationalDexObtained = Pokedex_NationalUnlocked(SaveData_Pokedex(FieldSystem_SaveData(fieldSystem))); WildEncounters_ReplaceTimedEncounters(encounterData, &v12[2].species, &v12[3].species); WildEncounters_ReplaceRadarEncounters(fieldSystem, encounterData, &v12[0].species, &v12[1].species); diff --git a/src/overlay006/ov6_02242984.c b/src/overlay006/ov6_02242984.c index eb1c973d38..320c6d7cca 100644 --- a/src/overlay006/ov6_02242984.c +++ b/src/overlay006/ov6_02242984.c @@ -43,7 +43,7 @@ int ov6_02242984(FieldSystem *fieldSystem) v2[i] = encounterData->grassEncounters.encounters[i].species; } - BOOL v1 = sub_02027474(SaveData_Pokedex(FieldSystem_SaveData(fieldSystem))); + BOOL v1 = Pokedex_NationalUnlocked(SaveData_Pokedex(FieldSystem_SaveData(fieldSystem))); ov6_02242F74(sub_0202D814(sub_0202D834(fieldSystem->saveData), 1), v1, fieldSystem->location->mapId, &v2[6], &v2[7]); WildEncounters_ReplaceTimedEncounters(encounterData, &v2[2], &v2[3]); diff --git a/src/overlay021/ov21_021D0D80.c b/src/overlay021/ov21_021D0D80.c index aa8140d8d2..2d64825c9e 100644 --- a/src/overlay021/ov21_021D0D80.c +++ b/src/overlay021/ov21_021D0D80.c @@ -12,7 +12,7 @@ #include "overlay021/funcptr_ov21_021E9B74.h" #include "overlay021/funcptr_ov21_021E9B9C.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/ov21_021D3FE0.h" #include "overlay021/ov21_021D423C.h" #include "overlay021/ov21_021D4340.h" @@ -83,7 +83,7 @@ typedef struct UnkStruct_ov21_021D0F60_t { BOOL unk_00; int unk_04; UnkStruct_0209ACBC *unk_08; - UnkStruct_ov21_021D3320 unk_0C; + pokedexStruct unk_0C; UnkStruct_ov21_021D13FC unk_177C; int unk_1A60; int unk_1A64; @@ -154,11 +154,11 @@ int ov21_021D0D80(OverlayManager *param0, int *param1) v2.unk_00 = v1->unk_00; v2.unk_04 = v1->unk_04; - v2.unk_08 = v1->unk_08; - v2.unk_0C = v1->unk_0C; - v2.unk_18 = v1->unk_18; - v2.unk_10 = v1->unk_10; - v2.unk_14 = v1->unk_14; + v2.timeOfDay = v1->timeOfDay; + v2.pokedexSFlag_1 = v1->pokedexSFlag_1; + v2.pokedexSFlag_4 = v1->pokedexSFlag_4; + v2.pokedexSFlag_2 = v1->pokedexSFlag_2; + v2.pokedexSFlag_3 = v1->pokedexSFlag_3; v2.unk_1C = v1->unk_1C; v0->unk_00 = ov21_021D0F60(37, &v2); @@ -320,17 +320,17 @@ UnkStruct_ov21_021D0F60 *ov21_021D0F60(int param0, const UnkStruct_ov21_021D0D80 v0->unk_1D6C = ov21_021D3FE0(param0); v0->unk_1D70 = ov21_021D3FE0(param0); - v2.unk_00 = param1->unk_00; + v2.dexData = param1->unk_00; v2.unk_04 = param1->unk_04; - v2.unk_08 = param1->unk_08; - v2.unk_0C = param1->unk_0C; - v2.unk_10 = param1->unk_10; - v2.unk_14 = param1->unk_14; - v2.unk_18 = param1->unk_18; + v2.timeOfDay = param1->timeOfDay; + v2.pokedexSFlag_1 = param1->pokedexSFlag_1; + v2.pokedexSFlag_2 = param1->pokedexSFlag_2; + v2.pokedexSFlag_3 = param1->pokedexSFlag_3; + v2.pokedexSFlag_4 = param1->pokedexSFlag_4; v2.unk_1C = sub_0209ACE4(param1->unk_1C); v2.unk_20 = sub_0209ACEC(param1->unk_1C); - ov21_021D3208(&v0->unk_0C, &v2, param0); + Pokedex_Sort_PopulatePokedexStruct(&v0->unk_0C, &v2, param0); ov21_021D1FA4(&v0->unk_177C, param0); for (v1 = 0; v1 < 10; v1++) { @@ -514,7 +514,7 @@ BOOL *ov21_021D13DC(UnkStruct_ov21_021D0F60 *param0) return ¶m0->unk_00; } -UnkStruct_ov21_021D3320 *ov21_021D13EC(UnkStruct_ov21_021D0F60 *param0) +pokedexStruct *ov21_021D13EC(UnkStruct_ov21_021D0F60 *param0) { GF_ASSERT(param0); return ¶m0->unk_0C; @@ -676,7 +676,7 @@ void ov21_021D1650(Window *param0, int param1, int param2, int param3) ov21_021D5600(v1); } -Window *ov21_021D16D8(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3) +Window *ov21_021D16D8(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3) { Window *v0; @@ -716,7 +716,7 @@ Window *ov21_021D172C(UnkStruct_ov21_021D4C0C *param0, int param1, int param2) return v0; } -void ov21_021D1778(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, fx32 param4, fx32 param5) +void ov21_021D1778(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int dexIndex, fx32 param4, fx32 param5) { CellActor *v0; CellActor *v1; @@ -724,10 +724,10 @@ void ov21_021D1778(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D332 Window *v3; SpriteResource *v4; VecFx32 v5; - const UnkStruct_ov21_021D37DC *v6; + const speciesCaughtStatusStruct *speciesCaughtStatus; u32 v7 = ov21_021D36D8(param1); - v6 = ov21_021D37DC(param1, param3); + speciesCaughtStatus = Pokedex_Sort_SpeciesCaughtStatus(param1, dexIndex); v0 = ov21_021D22A8(param0); v1 = ov21_021D22C4(param0); @@ -737,7 +737,7 @@ void ov21_021D1778(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D332 CellActor_SetPosition(v0, &v5); CellActor_SetDrawFlag(v0, 1); - if (v6->unk_04 == 2) { + if (speciesCaughtStatus->caughtStatus == 2) { v5.x = param4 + (-54 * FX32_ONE); v5.y = param5; @@ -759,10 +759,10 @@ void ov21_021D1778(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D332 v2.unk_20 = NNS_G2D_VRAM_TYPE_2DMAIN; v2.unk_24 = param2; - v3 = ov21_021D16D8(param0, param1, param2, v6->unk_00); + v3 = ov21_021D16D8(param0, param1, param2, speciesCaughtStatus->species); v2.unk_04 = v3; - ov21_021D22E0(param0, &v2, 0, v6->unk_00, v7); + ov21_021D22E0(param0, &v2, 0, speciesCaughtStatus->species, v7); ov21_021D4DA0(v3); } @@ -787,9 +787,9 @@ void ov21_021D1858(UnkStruct_ov21_021D22F8 *param0, int param1, int param2) } } -void ov21_021D1890(UnkStruct_ov21_021D13FC *param0, UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5) +void ov21_021D1890(UnkStruct_ov21_021D13FC *param0, pokedexStruct *param1, int species, int param3, int param4, int param5) { - switch (param2) { + switch (species) { case 201: ov21_021D1A34(param0, param1, param3, param4, param5, 0, 0); break; @@ -818,12 +818,12 @@ void ov21_021D1890(UnkStruct_ov21_021D13FC *param0, UnkStruct_ov21_021D3320 *par ov21_021D1C88(param0, param1, param3, param4, param5, 0, 0); break; default: - ov21_021D19D8(param0, param1, param2, param3, param4, param5, 0, 0); + ov21_021D19D8(param0, param1, species, param3, param4, param5, 0, 0); break; } } -u32 ov21_021D19D8(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6, int param7) +u32 ov21_021D19D8(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6, int param7) { int v0; u32 v1 = 0; @@ -841,11 +841,11 @@ u32 ov21_021D19D8(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 return v0; } -u32 ov21_021D1A34(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1A34(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *pokedexS, int param2, int param3, int param4, int param5, int param6) { int v0; - v0 = ov21_021D335C(param1, param5); + v0 = ov21_021D335C(pokedexS, param5); if (v0 != -1) { ov21_021D2188(param0, 201, 2, param2, 0, v0, 0, param3, param4, param6); @@ -854,7 +854,7 @@ u32 ov21_021D1A34(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 return v0; } -u32 ov21_021D1A78(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1A78(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6) { int v0; @@ -867,7 +867,7 @@ u32 ov21_021D1A78(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 return v0; } -u32 ov21_021D1AC0(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1AC0(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6) { int v0; @@ -880,7 +880,7 @@ u32 ov21_021D1AC0(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 return v0; } -u32 ov21_021D1B08(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1B08(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6) { int v0; @@ -893,7 +893,7 @@ u32 ov21_021D1B08(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 return v0; } -u32 ov21_021D1B4C(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1B4C(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6) { int v0; @@ -906,7 +906,7 @@ u32 ov21_021D1B4C(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 return v0; } -u32 ov21_021D1B94(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1B94(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6) { int v0; @@ -919,7 +919,7 @@ u32 ov21_021D1B94(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 return v0; } -u32 ov21_021D1BD8(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1BD8(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6) { int v0; int v1; @@ -936,7 +936,7 @@ u32 ov21_021D1BD8(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 return v0; } -u32 ov21_021D1C30(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1C30(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6) { int v0; int v1; @@ -953,7 +953,7 @@ u32 ov21_021D1C30(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 return v0; } -u32 ov21_021D1C88(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1C88(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6) { int v0; int v1; diff --git a/src/overlay021/ov21_021D3208.c b/src/overlay021/ov21_021D3208.c deleted file mode 100644 index 95f82daddc..0000000000 --- a/src/overlay021/ov21_021D3208.c +++ /dev/null @@ -1,956 +0,0 @@ -#include "overlay021/ov21_021D3208.h" - -#include -#include - -#include "struct_decls/pokedexdata_decl.h" - -#include "overlay021/struct_ov21_021D3208.h" -#include "overlay021/struct_ov21_021D3320.h" -#include "overlay021/struct_ov21_021D37DC.h" -#include "overlay021/struct_ov21_021D3A60.h" - -#include "core_sys.h" -#include "heap.h" -#include "narc.h" -#include "pokedex_data_index.h" -#include "pokedex_heightweight.h" -#include "strbuf.h" -#include "trainer_info.h" -#include "unk_02006E3C.h" -#include "unk_0202631C.h" - -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 *Pokedex_Sorted_Array(int param0, int param1, int *param2); -static void Pokedex_Sort_HeightWeight(int param0, u16 *param1, int *param2, const u16 *param3, int param4, int heapID, const PokedexData *param6); -static void Pokedex_Sort_FirstLetter(int param0, u16 *param1, int *param2, const u16 *param3, int param4, int heapID, const PokedexData *param6); -static void Pokedex_Sort_Type(int param0, u16 *param1, int *param2, const u16 *param3, int param4, int heapID, const PokedexData *param6); -static void Pokedex_Sort_BodyShape(int param0, u16 *param1, int *param2, const u16 *param3, int param4, int heapID, const PokedexData *param6); - -void ov21_021D3208(UnkStruct_ov21_021D3320 *param0, UnkStruct_ov21_021D3208 *param1, int param2) -{ - int v0; - int v1; - int v2; - int v3; - int v4; - BOOL v5; - u32 v6; - - memset(param0, 0, sizeof(UnkStruct_ov21_021D3320)); - - param0->unk_00 = param1->unk_00; - param0->unk_1744 = param1->unk_08; - - if (sub_02027474(param0->unk_00)) { - param0->unk_1734 = 1; - } else { - param0->unk_1734 = 0; - } - - if (param1->unk_20 == 2) { - if (param0->unk_1734) { - v6 = 1; - } else { - v6 = 0; - } - } else { - v6 = param1->unk_20; - } - - if (v6 == 1) { - param0->unk_1730 = 1; - v0 = 0; - v1 = 0; - v2 = 0; - v3 = 0; - v4 = 0; - } else { - param0->unk_1730 = 0; - v0 = 0; - v1 = 0; - v2 = 0; - v3 = 0; - v4 = 0; - } - - v5 = ov21_021D3684(param0, v0, v1, v2, v3, v4, param0->unk_1730, param2); - - GF_ASSERT(v5); - - ov21_021D3794(param0, param1->unk_1C); - ov21_021D3434(param0, param1->unk_1C); - ov21_021D344C(param0, param1->unk_20); - - param0->unk_174C = TrainerInfo_GameCode(param1->unk_04); - param0->unk_1750 = TrainerInfo_Gender(param1->unk_04); - param0->unk_1754 = TrainerInfo_NameNewStrbuf(param1->unk_04, param2); - param0->unk_1748 = Pokedex_HeightWeightData(param2); - - if (param0->unk_1750 == 0) { - Pokedex_HeightWeightData_Load(param0->unk_1748, 0, param2); - } else { - Pokedex_HeightWeightData_Load(param0->unk_1748, 1, param2); - } - - param0->unk_1760 = param1->unk_0C; - param0->unk_1764 = param1->unk_10; - param0->unk_1768 = param1->unk_14; - param0->unk_176C = param1->unk_18; -} - -void ov21_021D3320(UnkStruct_ov21_021D3320 *param0) -{ - Strbuf_Free(param0->unk_1754); - Pokedex_HeightWeightData_Release(param0->unk_1748); - Pokedex_HeightWeightData_Free(param0->unk_1748); - - param0->unk_1748 = NULL; -} - -u32 ov21_021D334C(const UnkStruct_ov21_021D3320 *param0, int param1, int param2) -{ - u32 v0; - - v0 = sub_02027058(param0->unk_00, param1, param2); - return v0; -} - -u32 ov21_021D335C(const UnkStruct_ov21_021D3320 *param0, int param1) -{ - int v0; - - GF_ASSERT(param1 < 28); - v0 = sub_020270AC(param0->unk_00, param1); - - return v0; -} - -u32 ov21_021D3374(const UnkStruct_ov21_021D3320 *param0, int param1) -{ - u32 v0; - - GF_ASSERT(param1 < 2); - v0 = sub_020270F8(param0->unk_00, param1); - - return v0; -} - -u32 ov21_021D338C(const UnkStruct_ov21_021D3320 *param0, int param1) -{ - u32 v0; - - GF_ASSERT(param1 < 2); - - v0 = sub_02027154(param0->unk_00, param1); - return v0; -} - -u32 ov21_021D33A4(const UnkStruct_ov21_021D3320 *param0, int param1) -{ - u32 v0; - - GF_ASSERT(param1 < 3); - - v0 = sub_020271B0(param0->unk_00, param1); - return v0; -} - -u32 ov21_021D33BC(const UnkStruct_ov21_021D3320 *param0, int param1) -{ - u32 v0; - - GF_ASSERT(param1 < 3); - - v0 = sub_02027208(param0->unk_00, param1); - return v0; -} - -u32 ov21_021D33D4(const UnkStruct_ov21_021D3320 *param0, u32 param1) -{ - return sub_0202756C(param0->unk_00, param1, 0); -} - -u32 ov21_021D33E0(const UnkStruct_ov21_021D3320 *param0, int param1) -{ - int v0 = ov21_021D334C(param0, param1, 1); - - if (v0 == -1) { - return 1; - } - - return 2; -} - -u32 ov21_021D33F8(const UnkStruct_ov21_021D3320 *param0) -{ - return sub_0202702C(param0->unk_00, 0); -} - -u32 ov21_021D3404(const UnkStruct_ov21_021D3320 *param0, int param1) -{ - return sub_02027264(param0->unk_00, param1); -} - -u32 ov21_021D3410(const UnkStruct_ov21_021D3320 *param0, u32 param1, int param2) -{ - return sub_0202756C(param0->unk_00, param1, param2); -} - -u32 ov21_021D341C(const UnkStruct_ov21_021D3320 *param0, u32 param1) -{ - return sub_020276C8(param0->unk_00, param1); -} - -BOOL ov21_021D3428(const UnkStruct_ov21_021D3320 *param0) -{ - return sub_02027474(param0->unk_00); -} - -void ov21_021D3434(UnkStruct_ov21_021D3320 *param0, u32 param1) -{ - param0->unk_175C = param1; -} - -u32 ov21_021D3440(const UnkStruct_ov21_021D3320 *param0) -{ - return param0->unk_175C; -} - -void ov21_021D344C(UnkStruct_ov21_021D3320 *param0, u32 param1) -{ - param0->unk_175E = param1; -} - -u32 ov21_021D3458(const UnkStruct_ov21_021D3320 *param0) -{ - return param0->unk_175E; -} - -BOOL ov21_021D3464(UnkStruct_ov21_021D3320 *param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7, BOOL param8) -{ - u16 *v0; - int v1; - u16 *v2; - int v3; - u16 *v4; - int pokedexLength; - BOOL v6; - - v0 = Heap_AllocFromHeapAtEnd(param7, sizeof(u16) * NATIONAL_DEX_COUNT); - - GF_ASSERT(v0); - memset(v0, 0, sizeof(u16) * NATIONAL_DEX_COUNT); - - v1 = 0; - v2 = Heap_AllocFromHeapAtEnd(param7, sizeof(u16) * NATIONAL_DEX_COUNT); - - GF_ASSERT(v2); - memset(v2, 0, sizeof(u16) * NATIONAL_DEX_COUNT); - - v3 = 0; - - if (param6 == 0) { - v4 = Pokedex_Sorted_Array(param7, 1, &pokedexLength); - ov21_021D39A4(v0, &v1, param0->unk_00, v4, pokedexLength); - } else { - v4 = Pokedex_Sorted_Array(param7, 0, &pokedexLength); - ov21_021D39A4(v0, &v1, param0->unk_00, v4, pokedexLength); - } - - Pokedex_Sort_HeightWeight(param1, v2, &v3, v0, v1, param7, param0->unk_00); - - memcpy(v0, v2, sizeof(u16) * v3); - v1 = v3; - - memset(v2, 0, sizeof(u16) * v3); - v3 = 0; - - do { - Pokedex_Sort_FirstLetter(param2, v2, &v3, v0, v1, param7, param0->unk_00); - - if (v3 == 0) { - v6 = 0; - break; - } - - memcpy(v0, v2, sizeof(u16) * v3); - v1 = v3; - - memset(v2, 0, sizeof(u16) * v3); - v3 = 0; - - Pokedex_Sort_Type(param3, v2, &v3, v0, v1, param7, param0->unk_00); - - if (v3 == 0) { - v6 = 0; - break; - } - - memcpy(v0, v2, sizeof(u16) * v3); - v1 = v3; - - memset(v2, 0, sizeof(u16) * v3); - v3 = 0; - - Pokedex_Sort_Type(param4, v2, &v3, v0, v1, param7, param0->unk_00); - - if (v3 == 0) { - v6 = 0; - break; - } - - memcpy(v0, v2, sizeof(u16) * v3); - v1 = v3; - - memset(v2, 0, sizeof(u16) * v3); - v3 = 0; - - Pokedex_Sort_BodyShape(param5, v2, &v3, v0, v1, param7, param0->unk_00); - - if (v3 == 0) { - v6 = 0; - break; - } - - memcpy(v0, v2, sizeof(u16) * v3); - v1 = v3; - - memset(v2, 0, sizeof(u16) * v3); - v3 = 0; - - ov21_021D3A60(¶m0->unk_04, param0->unk_00, v0, v1); - - if ((param1 != 0) || (param2 != 0) || (param3 != 0) || (param4 != 0) || (param5 != 0)) { - param8 = 1; - } - - if (param8 == 0) { - ov21_021D3AB8(¶m0->unk_04, v4, pokedexLength); - } else { - ov21_021D3B28(¶m0->unk_04); - } - - v6 = 1; - } while (0); - - ov21_021D3FA8(¶m0->unk_04, ¶m0->unk_1738, ¶m0->unk_173C); - - Heap_FreeToHeap(v0); - Heap_FreeToHeap(v2); - Heap_FreeToHeap(v4); - - return v6; -} - -BOOL ov21_021D3684(UnkStruct_ov21_021D3320 *param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7) -{ - return ov21_021D3464(param0, param1, param2, param3, param4, param5, param6, param7, 0); -} - -BOOL ov21_021D36A4(const UnkStruct_ov21_021D3320 *param0, int param1) -{ - if (param1 == 0) { - return 1; - } - - if (param0->unk_1734) { - return 1; - } - - return 0; -} - -BOOL ov21_021D36C0(UnkStruct_ov21_021D3320 *param0, int param1) -{ - BOOL v0; - - v0 = ov21_021D36A4(param0, param1); - - if (v0) { - param0->unk_1730 = param1; - } - - return v0; -} - -int ov21_021D36D8(const UnkStruct_ov21_021D3320 *param0) -{ - return param0->unk_1730; -} - -BOOL ov21_021D36E4(const UnkStruct_ov21_021D3320 *param0, int param1) -{ - if (((param1) >= 0) && ((param1) < param0->unk_04.unk_F6C)) { - return 1; - } - - return 0; -} - -BOOL ov21_021D36FC(UnkStruct_ov21_021D3320 *param0, int param1) -{ - if (ov21_021D36E4(param0, param1)) { - param0->unk_04.unk_F68 = param1; - return 1; - } - - return 0; -} - -BOOL ov21_021D371C(UnkStruct_ov21_021D3320 *param0, int param1) -{ - if (ov21_021D36E4(param0, param0->unk_04.unk_F68 + param1)) { - param0->unk_04.unk_F68 += param1; - return 1; - } - - if (param1 >= 0) { - param0->unk_04.unk_F68 = param0->unk_04.unk_F6C - 1; - } else { - param0->unk_04.unk_F68 = 0; - } - - return 0; -} - -int ov21_021D375C(const UnkStruct_ov21_021D3320 *param0) -{ - return param0->unk_04.unk_F68; -} - -int ov21_021D3768(const UnkStruct_ov21_021D3320 *param0) -{ - return param0->unk_04.unk_F6C; -} - -int ov21_021D3770(const UnkStruct_ov21_021D3320 *param0, u32 param1) -{ - int v0; - int v1 = ov21_021D3768(param0); - int v2; - - for (v0 = 0; v0 < v1; v0++) { - v2 = param0->unk_04.unk_00[v0].unk_00; - - if (v2 == param1) { - break; - } - } - - return v0; -} - -BOOL ov21_021D3794(UnkStruct_ov21_021D3320 *param0, int param1) -{ - u32 v0 = ov21_021D3768(param0); - u32 v1 = ov21_021D3770(param0, param1); - - if (v0 > v1) { - return ov21_021D36FC(param0, v1); - } - - return 0; -} - -int ov21_021D37BC(const UnkStruct_ov21_021D3320 *param0) -{ - return param0->unk_04.unk_00[param0->unk_04.unk_F68].unk_00; -} - -int ov21_021D37CC(const UnkStruct_ov21_021D3320 *param0) -{ - return param0->unk_04.unk_00[param0->unk_04.unk_F68].unk_04; -} - -const UnkStruct_ov21_021D37DC *ov21_021D37DC(const UnkStruct_ov21_021D3320 *param0, int param1) -{ - if (ov21_021D36E4(param0, param1)) { - return ¶m0->unk_04.unk_00[param1]; - } - - return NULL; -} - -BOOL ov21_021D37F8(const UnkStruct_ov21_021D3320 *param0, int param1) -{ - if ((param0->unk_04.unk_1728 > param1) && (param1 >= 0)) { - return 1; - } - - return 0; -} - -BOOL ov21_021D3810(UnkStruct_ov21_021D3320 *param0, int param1) -{ - if (ov21_021D37F8(param0, param1)) { - param0->unk_04.unk_1724 = param1; - - ov21_021D36FC(param0, param0->unk_04.unk_F70[param0->unk_04.unk_1724]); - return 1; - } - - return 0; -} - -BOOL ov21_021D3844(UnkStruct_ov21_021D3320 *param0, int param1) -{ - if (ov21_021D387C(param0, param1)) { - param0->unk_04.unk_1724 += param1; - - ov21_021D36FC(param0, param0->unk_04.unk_F70[param0->unk_04.unk_1724]); - return 1; - } - - return 0; -} - -BOOL ov21_021D387C(UnkStruct_ov21_021D3320 *param0, int param1) -{ - if (ov21_021D37F8(param0, param0->unk_04.unk_1724 + param1)) { - return 1; - } - - return 0; -} - -int ov21_021D3898(const UnkStruct_ov21_021D3320 *param0) -{ - return param0->unk_04.unk_1724; -} - -int ov21_021D38A4(const UnkStruct_ov21_021D3320 *param0) -{ - return param0->unk_04.unk_1728; -} - -int ov21_021D38B0(const UnkStruct_ov21_021D3320 *param0, int param1) -{ - return param0->unk_04.unk_F70[param1]; -} - -void ov21_021D38C0(UnkStruct_ov21_021D3320 *param0) -{ - int v0; - - for (v0 = 0; v0 < param0->unk_04.unk_1728; v0++) { - if (ov21_021D38B0(param0, v0) == ov21_021D375C(param0)) { - ov21_021D3810(param0, v0); - break; - } - } -} - -int ov21_021D38FC(const UnkStruct_ov21_021D3320 *param0) -{ - return param0->unk_1738; -} - -int ov21_021D3908(const UnkStruct_ov21_021D3320 *param0) -{ - return param0->unk_173C; -} - -Strbuf *ov21_021D3914(const UnkStruct_ov21_021D3320 *param0) -{ - return param0->unk_1754; -} - -u32 ov21_021D3920(const UnkStruct_ov21_021D3320 *param0) -{ - return param0->unk_1750; -} - -BOOL ov21_021D392C(const UnkStruct_ov21_021D3320 *param0, int param1) -{ - int v0 = ov21_021D37BC(param0); - - if (sub_02027514(param0->unk_00) == 0) { - return 0; - } - - return sub_020274D0(param0->unk_00, v0, param1); -} - -BOOL ov21_021D3954(const UnkStruct_ov21_021D3320 *param0) -{ - return sub_02027494(param0->unk_00); -} - -void ov21_021D3960(UnkStruct_ov21_021D3320 *param0) -{ - if (gCoreSys.touchHeld) { - param0->unk_1758 = 0; - return; - } - - if (gCoreSys.pressedKeys) { - if (param0->unk_1758 == 0) { - param0->unk_1758 = 1; - } else { - param0->unk_1758 = 2; - } - } -} - -u32 ov21_021D3998(const UnkStruct_ov21_021D3320 *param0) -{ - return param0->unk_1758; -} - -static void ov21_021D39A4(u16 *param0, int *param1, const PokedexData *param2, const u16 *param3, int param4) -{ - int v0; - - *param1 = 0; - - for (v0 = 0; v0 < param4; v0++) { - if (sub_02026FE8(param2, param3[v0])) { - param0[*param1] = param3[v0]; - (*param1)++; - } - } -} - -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; - - *param1 = 0; - - for (v0 = 0; v0 < param3; v0++) { - for (v1 = 0; v1 < param5; v1++) { - if (param2[v0] == param4[v1]) { - if (param6 == 1) { - break; - } else { - if (Pokedex_CaughtSpecies(param7, param2[v0])) { - break; - } - } - } - } - - if (v1 < param5) { - param0[*param1] = param2[v0]; - (*param1)++; - } - } -} - -static void ov21_021D3A60(UnkStruct_ov21_021D3A60 *param0, const PokedexData *param1, const u16 *param2, int param3) -{ - int v0; - - param0->unk_F6C = 0; - - for (v0 = 0; v0 < param3; v0++) { - if (Pokedex_CaughtSpecies(param1, param2[v0])) { - param0->unk_00[param0->unk_F6C].unk_04 = 2; - } else { - param0->unk_00[param0->unk_F6C].unk_04 = 1; - } - - param0->unk_00[param0->unk_F6C].unk_00 = param2[v0]; - param0->unk_F6C++; - } -} - -static void ov21_021D3AB8(UnkStruct_ov21_021D3A60 *param0, const u16 *param1, int param2) -{ - int v0; - int v1; - - v1 = 0; - param0->unk_1728 = 0; - - for (v0 = 0; v0 < param2; v0++) { - if (v1 < param0->unk_F6C) { - if (param0->unk_00[v1].unk_00 == param1[v0]) { - param0->unk_F70[param0->unk_1728] = v1; - v1++; - param0->unk_1728++; - } else { - param0->unk_F70[param0->unk_1728] = (NATIONAL_DEX_COUNT + 1); - param0->unk_1728++; - } - } - } -} - -static void ov21_021D3B28(UnkStruct_ov21_021D3A60 *param0) -{ - int v0; - - param0->unk_1728 = 0; - - for (v0 = 0; v0 < param0->unk_F6C; v0++) { - param0->unk_F70[param0->unk_1728] = v0; - param0->unk_1728++; - } -} - -static u16 *Pokedex_Sorted_Array(int heapID, int pokedexSort, int *pokedexLength) -{ - u32 pokedexSize; - u16 *pokedexSortedArray; - u32 pokedexDataNarcIndex; - - GF_ASSERT(47 > pokedexSort); - - pokedexDataNarcIndex = Pokedex_Data_NARC_Index(); - pokedexSortedArray = sub_02007068(pokedexDataNarcIndex, 11 + pokedexSort, 0, heapID, 0, &pokedexSize); - *pokedexLength = pokedexSize / (sizeof(u16)); - - return pokedexSortedArray; -} - -static void Pokedex_Sort_HeightWeight(int param0, u16 *param1, int *param2, const u16 *param3, int param4, int heapID, const PokedexData *param6) -{ - u16 *pokedexSortedArray; - int pokedexLength; - BOOL v2 = 0; - - switch (param0) { - case 0: - pokedexSortedArray = NULL; - break; - case 1: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 2, &pokedexLength); // alphabetical - v2 = 1; - break; - case 2: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 3, &pokedexLength); // heaviest - break; - case 3: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 4, &pokedexLength); // lightest - break; - case 4: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 5, &pokedexLength); // tallest - break; - case 5: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 6, &pokedexLength); // shortest - break; - default: - GF_ASSERT(0); - break; - } - - if (pokedexSortedArray != NULL) { - ov21_021D39E4(param1, param2, pokedexSortedArray, pokedexLength, param3, param4, v2, param6); - Heap_FreeToHeap(pokedexSortedArray); - } else { - memcpy(param1, param3, (sizeof(u16)) * param4); - *param2 = param4; - } -} - -static void Pokedex_Sort_FirstLetter(int param0, u16 *param1, int *param2, const u16 *param3, int param4, int heapID, const PokedexData *param6) -{ - u16 *pokedexSortedArray; - int pokedexLength; - - switch (param0) { - case 0: - pokedexSortedArray = NULL; - break; - case 1: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 7, &pokedexLength); // ABC - break; - case 2: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 8, &pokedexLength); // DEF - break; - case 3: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 9, &pokedexLength); // GHI - break; - case 4: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 10, &pokedexLength); // JKL - break; - case 5: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 11, &pokedexLength); // MNO - break; - case 6: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 12, &pokedexLength); // PQR - break; - case 7: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 13, &pokedexLength); // STU - break; - case 8: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 14, &pokedexLength); // VWX - break; - case 9: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 15, &pokedexLength); // YZ - break; - default: - GF_ASSERT(0); - break; - } - - if (pokedexSortedArray != NULL) { - ov21_021D39E4(param1, param2, param3, param4, pokedexSortedArray, pokedexLength, 1, param6); - Heap_FreeToHeap(pokedexSortedArray); - } else { - memcpy(param1, param3, (sizeof(u16)) * param4); - *param2 = param4; - } -} - -static void Pokedex_Sort_Type(int param0, u16 *param1, int *param2, const u16 *param3, int param4, int heapID, const PokedexData *param6) -{ - u16 *pokedexSortedArray; - int pokedexLength; - - switch (param0) { - case 0: - pokedexSortedArray = NULL; - break; - case 1: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 16, &pokedexLength); // normal - break; - case 2: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 17, &pokedexLength); // fighting - break; - case 3: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 18, &pokedexLength); // flying - break; - case 4: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 19, &pokedexLength); // poison - break; - case 5: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 20, &pokedexLength); // ground - break; - case 6: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 21, &pokedexLength); // rock - break; - case 7: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 22, &pokedexLength); // bug - break; - case 8: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 23, &pokedexLength); // ghost - break; - case 9: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 24, &pokedexLength); // steel - break; - case 10: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 25, &pokedexLength); // fire - break; - case 11: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 26, &pokedexLength); // water - break; - case 12: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 27, &pokedexLength); // grass - break; - case 13: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 28, &pokedexLength); // electric - break; - case 14: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 29, &pokedexLength); // psychic - break; - case 15: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 30, &pokedexLength); // ice - break; - case 16: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 31, &pokedexLength); // dragon - break; - case 17: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 32, &pokedexLength); // dark - break; - default: - GF_ASSERT(0); - break; - } - - if (pokedexSortedArray != NULL) { - ov21_021D39E4(param1, param2, param3, param4, pokedexSortedArray, pokedexLength, 0, param6); - Heap_FreeToHeap(pokedexSortedArray); - } else { - memcpy(param1, param3, (sizeof(u16)) * param4); - *param2 = param4; - } -} - -static void Pokedex_Sort_BodyShape(int param0, u16 *param1, int *param2, const u16 *param3, int param4, int heapID, const PokedexData *param6) -{ - u16 *pokedexSortedArray; - int pokedexLength; - - switch (param0) { - case 0: - pokedexSortedArray = NULL; - break; - case 1: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 33, &pokedexLength); // quadruped - break; - case 2: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 34, &pokedexLength); // bidedal tailless - break; - case 3: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 35, &pokedexLength); // bipedal tailed - break; - case 4: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 36, &pokedexLength); // serpentine - break; - case 5: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 37, &pokedexLength); // multi winged - break; - case 6: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 38, &pokedexLength); // winged - break; - case 7: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 39, &pokedexLength); // insectoid - break; - case 8: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 40, &pokedexLength); // head base - break; - case 9: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 41, &pokedexLength); // head arms - break; - case 10: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 42, &pokedexLength); // head legs - break; - case 11: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 43, &pokedexLength); // tentacles - break; - case 12: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 44, &pokedexLength); // fins - break; - case 13: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 45, &pokedexLength); // head - break; - case 14: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 46, &pokedexLength); // multi-body - break; - default: - GF_ASSERT(0); - break; - } - - if (pokedexSortedArray != NULL) { - ov21_021D39E4(param1, param2, param3, param4, pokedexSortedArray, pokedexLength, 1, param6); - Heap_FreeToHeap(pokedexSortedArray); - } else { - memcpy(param1, param3, (sizeof(u16)) * param4); - *param2 = param4; - } -} - -static void ov21_021D3FA8(UnkStruct_ov21_021D3A60 *param0, int *param1, int *param2) -{ - int v0; - - *param1 = 0; - *param2 = 0; - - for (v0 = 0; v0 < param0->unk_F6C; v0++) { - if (param0->unk_00[v0].unk_04 == 2) { - (*param2)++; - } - - (*param1)++; - } -} diff --git a/src/overlay021/ov21_021D3FE0.c b/src/overlay021/ov21_021D3FE0.c index 85526d7ba1..7c810a7b2e 100644 --- a/src/overlay021/ov21_021D3FE0.c +++ b/src/overlay021/ov21_021D3FE0.c @@ -19,7 +19,7 @@ typedef struct UnkStruct_ov21_021D3FE0_t { UnkFuncPtr_ov21_021D41EC unk_20[3]; UnkStruct_ov21_021E6B20 unk_2C; UnkFuncPtr_ov21_021D420C unk_38[3]; - int unk_44; + int heapID; } UnkStruct_ov21_021D3FE0; static void ov21_021D41D8(UnkStruct_ov21_021E6A68 *param0); @@ -37,7 +37,7 @@ UnkStruct_ov21_021D3FE0 *ov21_021D3FE0(int param0) memset(v0, 0, sizeof(UnkStruct_ov21_021D3FE0)); v0->unk_08 = 5; - v0->unk_44 = param0; + v0->heapID = param0; return v0; } @@ -53,10 +53,10 @@ void ov21_021D4008(UnkStruct_ov21_021D3FE0 *param0, const UnkStruct_ov21_021D400 param0->unk_08 = 0; ov21_021D41D8(¶m0->unk_0C); - param0->unk_0C.unk_04 = param0->unk_44; + param0->unk_0C.heapID = param0->heapID; ov21_021D41E4(¶m0->unk_2C); - param0->unk_2C.unk_04 = param0->unk_44; + param0->unk_2C.heapID = param0->heapID; param0->unk_20[0] = param1->unk_08[0]; param0->unk_20[1] = param1->unk_08[1]; diff --git a/src/overlay021/ov21_021D57B4.c b/src/overlay021/ov21_021D57B4.c index 182ec51ad3..5757a914e7 100644 --- a/src/overlay021/ov21_021D57B4.c +++ b/src/overlay021/ov21_021D57B4.c @@ -12,82 +12,82 @@ #include "narc.h" #include "unk_02006E3C.h" -void ov21_021D57B4(UnkStruct_ov21_021D5844 *param0, int param1, int param2, int param3) +void ov21_021D57B4(pokedexEncStruct *dexEncData, int species, int param2, int heapID) { int v0; - u32 v1; + u32 fileSize; switch (param2) { - case 0: + case 0:// category 0, morning v0 = 4; break; - case 1: + case 1:// category 0, day v0 = 499; break; - case 2: + case 2:// category 0, night v0 = 994; break; - case 3: + case 3:// category 2, regional v0 = 1489; break; - case 4: + case 4:// category 2, national v0 = 1984; break; - case 5: + case 5:// category 1, morning v0 = 2479; break; - case 6: + case 6:// category 1, day v0 = 2974; break; - case 7: + case 7:// category 1, night v0 = 3469; break; - case 8: + case 8:// category 3, regional v0 = 3964; break; - case 9: + case 9:// category 3, national v0 = 4459; break; } - param0->unk_00 = (int *)sub_02007068(NARC_INDEX_APPLICATION__ZUKANLIST__ZKN_DATA__ZUKAN_ENC_PLATINUM, v0 + param1, 0, param3, 0, &v1); - param0->unk_04 = v1 / sizeof(int); + dexEncData->pokedexEncArray = (int *)sub_02007068(NARC_INDEX_APPLICATION__ZUKANLIST__ZKN_DATA__ZUKAN_ENC_PLATINUM, v0 + species, 0, heapID, 0, &fileSize); + dexEncData->pokedexEncLength = fileSize / sizeof(int); } -void ov21_021D5844(UnkStruct_ov21_021D5844 *param0) +void Free_pokedexEncData(pokedexEncStruct *dexEncData) { - GF_ASSERT(param0); - GF_ASSERT(param0->unk_00); + GF_ASSERT(dexEncData); + GF_ASSERT(dexEncData->pokedexEncArray); - Heap_FreeToHeap(param0->unk_00); + Heap_FreeToHeap(dexEncData->pokedexEncArray); - param0->unk_00 = NULL; - param0->unk_04 = 0; + dexEncData->pokedexEncArray = NULL; + dexEncData->pokedexEncLength = 0; } -UnkStruct_ov21_021D5868 *ov21_021D5868(int param0, int *param1) +UnkStruct_ov21_021D5868 *ov21_021D5868(int heapID, int *param1) { UnkStruct_ov21_021D5868 *v0; - u32 v1; + u32 fileSize; - v0 = (UnkStruct_ov21_021D5868 *)sub_02007068(NARC_INDEX_APPLICATION__ZUKANLIST__ZKN_DATA__ZUKAN_ENC_PLATINUM, 0, 0, param0, 0, &v1); + v0 = (UnkStruct_ov21_021D5868 *)sub_02007068(NARC_INDEX_APPLICATION__ZUKANLIST__ZKN_DATA__ZUKAN_ENC_PLATINUM, 0, 0, heapID, 0, &fileSize); if (param1) { - *param1 = v1 / sizeof(UnkStruct_ov21_021D5868); + *param1 = fileSize / sizeof(UnkStruct_ov21_021D5868); } return v0; } -UnkStruct_ov21_021D5890 *ov21_021D5890(int param0, int *param1) +UnkStruct_ov21_021D5890 *ov21_021D5890(int heapID, int *param1) { UnkStruct_ov21_021D5890 *v0; - u32 v1; + u32 fileSize; - v0 = (UnkStruct_ov21_021D5890 *)sub_02007068(NARC_INDEX_APPLICATION__ZUKANLIST__ZKN_DATA__ZUKAN_ENC_PLATINUM, 2, 0, param0, 0, &v1); + v0 = (UnkStruct_ov21_021D5890 *)sub_02007068(NARC_INDEX_APPLICATION__ZUKANLIST__ZKN_DATA__ZUKAN_ENC_PLATINUM, 2, 0, heapID, 0, &fileSize); if (param1) { - *param1 = v1 / sizeof(UnkStruct_ov21_021D5890); + *param1 = fileSize / sizeof(UnkStruct_ov21_021D5890); } return v0; @@ -95,35 +95,35 @@ UnkStruct_ov21_021D5890 *ov21_021D5890(int param0, int *param1) void ov21_021D58C0(u8 *param0, u8 param1, u8 param2, const UnkStruct_ov21_021D5890 *param3) { - int v0, v1; + int outerIndex, innerIndex; - GF_ASSERT((param3->unk_01 + param3->unk_03) < param2); + GF_ASSERT((param3->unk_01 + param3->unk_03) < param2);// param 1 and 2 are 30 GF_ASSERT((param3->unk_00 + param3->unk_02) < param1); - for (v0 = param3->unk_01; v0 < param3->unk_01 + param3->unk_03; v0++) { - for (v1 = param3->unk_00; v1 < param3->unk_00 + param3->unk_02; v1++) { - param0[(v0 * param1) + v1] |= param3->unk_04[((v0 - param3->unk_01) * param3->unk_02) + (v1 - param3->unk_00)]; + for (outerIndex = param3->unk_01; outerIndex < param3->unk_01 + param3->unk_03; outerIndex++) { + for (innerIndex = param3->unk_00; innerIndex < param3->unk_00 + param3->unk_02; innerIndex++) { + param0[(outerIndex * param1) + innerIndex] |= param3->unk_04[((outerIndex - param3->unk_01) * param3->unk_02) + (innerIndex - param3->unk_00)]; } } } -u32 ov21_021D5948(u8 *param0, int param1, int param2, const UnkStruct_ov21_021D5890 *param3, const UnkStruct_ov21_021D5844 *param4, const u8 *param5, u32 param6) +u32 ov21_021D5948(u8 *param0, int param1, int param2, const UnkStruct_ov21_021D5890 *param3, const pokedexEncStruct *dexEncData, const u8 *param5, u32 param6) { - int v0; + int pokedexEncIndex; int v1; u32 v2 = 0; - for (v0 = 0; v0 < param4->unk_04 - 1; v0++) { - GF_ASSERT(param4->unk_00[v0]); + for (pokedexEncIndex = 0; pokedexEncIndex < dexEncData->pokedexEncLength - 1; pokedexEncIndex++) { + GF_ASSERT(dexEncData->pokedexEncArray[pokedexEncIndex]); for (v1 = 0; v1 < param6; v1++) { - if (param4->unk_00[v0] == param5[v1]) { + if (dexEncData->pokedexEncArray[pokedexEncIndex] == param5[v1]) { break; } } if (v1 >= param6) { - ov21_021D58C0(param0, param1, param2, ¶m3[param4->unk_00[v0]]); + ov21_021D58C0(param0, param1, param2, ¶m3[dexEncData->pokedexEncArray[pokedexEncIndex]]); v2++; } } @@ -131,42 +131,42 @@ u32 ov21_021D5948(u8 *param0, int param1, int param2, const UnkStruct_ov21_021D5 return v2; } -void ov21_021D59D8(CellActor *param0, int param1, int param2, int param3, int param4, const UnkStruct_ov21_021D5868 *param5, int param6, int param7) +void ov21_021D59D8(CellActor *actor, int param1, int param2, int param3, int param4, const UnkStruct_ov21_021D5868 *param5, int animID_1, int animID_2) { - VecFx32 v0; + VecFx32 position; - v0.x = (param5->unk_00 * param3) + param1; - v0.y = (param5->unk_01 * param4) + param2; - v0.x <<= FX32_SHIFT; - v0.y <<= FX32_SHIFT; + position.x = (param5->unk_00 * param3) + param1; + position.y = (param5->unk_01 * param4) + param2; + position.x <<= FX32_SHIFT; + position.y <<= FX32_SHIFT; - CellActor_SetPosition(param0, &v0); + CellActor_SetPosition(actor, &position); if (param5->unk_02) { - CellActor_SetAnim(param0, param7); + CellActor_SetAnim(actor, animID_2); } else { - CellActor_SetAnim(param0, param6); + CellActor_SetAnim(actor, animID_1); } } -int ov21_021D5A20(CellActor **param0, int param1, int param2, int param3, int param4, int param5, int param6, const UnkStruct_ov21_021D5868 *param7, const UnkStruct_ov21_021D5844 *param8, int param9, int param10, const u8 *param11, u32 param12, u32 *param13) +int ov21_021D5A20(CellActor **param0, int param1, int param2, int param3, int param4, int param5, int param6, const UnkStruct_ov21_021D5868 *zukan_enc_plat_0, const pokedexEncStruct *dexEncData, int param9, int param10, const u8 *param11, u32 param12, u32 *param13) { - int v0, v1; + int index, v1; int v2 = param1; int v3 = 0; - for (v0 = 0; v0 < param8->unk_04 - 1; v0++) { - GF_ASSERT(param8->unk_00[v0]); + for (index = 0; index < dexEncData->pokedexEncLength - 1; index++) { + GF_ASSERT(dexEncData->pokedexEncArray[index]); GF_ASSERT(v2 < param2); for (v1 = 0; v1 < param12; v1++) { - if (param8->unk_00[v0] == param11[v1]) { + if (dexEncData->pokedexEncArray[index] == param11[v1]) { break; } } if (v1 >= param12) { - ov21_021D59D8(param0[v2], param3, param4, param5, param6, ¶m7[param8->unk_00[v0]], param9, param10); + ov21_021D59D8(param0[v2], param3, param4, param5, param6, &zukan_enc_plat_0[dexEncData->pokedexEncArray[index]], param9, param10); v2++; v3++; } diff --git a/src/overlay021/ov21_021D5AEC.c b/src/overlay021/ov21_021D5AEC.c index c35e73ebb2..358cf52ec6 100644 --- a/src/overlay021/ov21_021D5AEC.c +++ b/src/overlay021/ov21_021D5AEC.c @@ -9,7 +9,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/ov21_021D4340.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/struct_ov21_021D0F60_decl.h" @@ -145,7 +145,7 @@ static void ov21_021D6B94(UnkStruct_ov21_021D71A8 *param0, const UnkStruct_ov21_ static void ov21_021D6BB0(UnkStruct_ov21_021D71A8 *param0, const UnkStruct_ov21_021D5B68 *param1); static void ov21_021D6C44(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13FC *param1, const UnkStruct_ov21_021D5B68 *param2, int param3); static void ov21_021D6CC8(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13FC *param1, const UnkStruct_ov21_021D5B68 *param2, int param3); -static void ov21_021D6D78(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13FC *param1, const UnkStruct_ov21_021D5B68 *param2, int param3, int param4, int param5); +static void ov21_021D6D78(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13FC *param1, const UnkStruct_ov21_021D5B68 *param2, int param3, int param4, int dexIndex); static void ov21_021D6DF4(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13FC *param1, int param2, int param3, int param4); static void ov21_021D6CA4(CellActor *param0, int *param1, int *param2); static fx32 ov21_021D6BF8(fx32 param0, fx32 param1, int param2, int param3); @@ -300,7 +300,7 @@ static int ov21_021D5CB8(UnkStruct_ov21_021E6A68 *param0, void *param1) { UnkStruct_ov21_021D5B68 *v0 = param1; - param0->unk_08 = Heap_AllocFromHeap(param0->unk_04, sizeof(UnkStruct_ov21_021D7464)); + param0->unk_08 = Heap_AllocFromHeap(param0->heapID, sizeof(UnkStruct_ov21_021D7464)); GF_ASSERT(param0->unk_08); memset(param0->unk_08, 0, sizeof(UnkStruct_ov21_021D7464)); @@ -333,7 +333,7 @@ static int ov21_021D5D04(UnkStruct_ov21_021E6A68 *param0, void *param1) v0->unk_18 = 0; param0->unk_00 = 1; } else { - ov21_021D5F7C(v0, v1, param0->unk_04); + ov21_021D5F7C(v0, v1, param0->heapID); } return 0; @@ -357,7 +357,7 @@ static int ov21_021D5D48(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo switch (param1->unk_00) { case 0: - v3 = Heap_AllocFromHeap(param1->unk_04, sizeof(UnkStruct_ov21_021D71A8)); + v3 = Heap_AllocFromHeap(param1->heapID, sizeof(UnkStruct_ov21_021D71A8)); GF_ASSERT(v3); param1->unk_08 = v3; ov21_021D6C24(v3, v1); @@ -366,9 +366,9 @@ static int ov21_021D5D48(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo break; case 1: if (v1->unk_04->unk_1740 == 0) { - ov21_021D6114(v3, v0->unk_00, v1, param1->unk_04); + ov21_021D6114(v3, v0->unk_00, v1, param1->heapID); } else { - ov21_021D61F4(v3, v0->unk_00, v1, param1->unk_04); + ov21_021D61F4(v3, v0->unk_00, v1, param1->heapID); } if (v1->unk_14) { @@ -418,14 +418,14 @@ static int ov21_021D5E2C(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo if (v3->unk_144 != v4) { v3->unk_144 = v4; ov21_021D6A58(v3, v1); - ov21_021D6CC8(v3, v0->unk_00, v1, param1->unk_04); + ov21_021D6CC8(v3, v0->unk_00, v1, param1->heapID); ov21_021D68C8(v3, v0->unk_00, v1); } ov21_021D69A0(v3, v1); ov21_021D6AE4(v3, v1); ov21_021D6BB0(v3, v1); - ov21_021D6C44(v3, v0->unk_00, v1, param1->unk_04); + ov21_021D6C44(v3, v0->unk_00, v1, param1->heapID); ov21_021D6F20(v3, v0->unk_00, v1); ov21_021D6F74(v1); @@ -445,7 +445,7 @@ static int ov21_021D5EA8(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo G2_BlendNone(); if (v1->unk_14) { - ov21_021D7160(v3, v0->unk_00, v1, param1->unk_04); + ov21_021D7160(v3, v0->unk_00, v1, param1->heapID); ov21_021D6F64(v0->unk_00, v1); ov21_021D7248(v3, v0, v1, 0); } else { @@ -573,7 +573,7 @@ static BOOL ov21_021D601C(UnkStruct_ov21_021D5B68 *param0, UnkStruct_ov21_021D74 if (param0->unk_2C) { int v0 = ov21_021D3898(param0->unk_04); - if (ov21_021D38B0(param0->unk_04, v0) != (NATIONAL_DEX_COUNT + 1)) { + if (Pokedex_Sort_SeenIndexToSpecies(param0->unk_04, v0) != (NATIONAL_DEX_COUNT + 1)) { ov21_021D7464(param1, param0); Sound_PlayEffect(1501); return 1; @@ -632,7 +632,7 @@ static void ov21_021D6114(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13 ov21_021D276C(param1, 0, 0, 0, 0, param3); ov21_021D62E4(param1, param3); ov21_021D637C(param0, param1, param3, ov21_021D36D8(param2->unk_04)); - ov21_021D63DC(param1, param3, ov21_021D38FC(param2->unk_04), ov21_021D3908(param2->unk_04)); + ov21_021D63DC(param1, param3, Pokedex_Sort_NumEncountered(param2->unk_04), Pokedex_Sort_NumCaught(param2->unk_04)); ov21_021D6538(param0, param3); ov21_021D65DC(param0, param1, param3); ov21_021D6744(param0, param1, param3); @@ -682,7 +682,7 @@ static void ov21_021D61F4(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13 param0->unk_4C = ov21_021D70C0(param1, param3); ov21_021D67EC(param0, param1, param2, param3); - ov21_021D64B0(param1, param3, ov21_021D38FC(param2->unk_04)); + ov21_021D64B0(param1, param3, Pokedex_Sort_NumEncountered(param2->unk_04)); ov21_021D6994(param0, param2); ov21_021D69A0(param0, param2); ov21_021D6AE4(param0, param2); @@ -871,8 +871,8 @@ static void ov21_021D67EC(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13 int v3; UnkStruct_ov21_021D4CB8 v4; Window *v5; - const UnkStruct_ov21_021D37DC *v6; - int v7; + const speciesCaughtStatusStruct *speciesCaughtStatus; + int dexIndex; v4.unk_00 = param1->unk_14C; v4.unk_08 = param0->unk_90.paletteProxy; @@ -895,11 +895,11 @@ static void ov21_021D67EC(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13 } if ((v1 >= 0) && (v1 < v3)) { - v7 = ov21_021D38B0(param2->unk_04, v1); + dexIndex = Pokedex_Sort_SeenIndexToSpecies(param2->unk_04, v1); - if (v7 != (NATIONAL_DEX_COUNT + 1)) { - v6 = ov21_021D37DC(param2->unk_04, v7); - v5 = ov21_021D16D8(param1, param2->unk_04, param3, v6->unk_00); + if (dexIndex != (NATIONAL_DEX_COUNT + 1)) { + speciesCaughtStatus = Pokedex_Sort_SpeciesCaughtStatus(param2->unk_04, dexIndex); + v5 = ov21_021D16D8(param1, param2->unk_04, param3, speciesCaughtStatus->species); v4.unk_04 = v5; param0->unk_28[v2] = ov21_021D4CB8(&v4, param0->unk_4C); ov21_021D4DA0(v5); @@ -917,22 +917,22 @@ static void ov21_021D67EC(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13 static void ov21_021D68C8(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13FC *param1, const UnkStruct_ov21_021D5B68 *param2) { - int v0; + int dexIndex; int v1; - const UnkStruct_ov21_021D37DC *v2; + const speciesCaughtStatusStruct *speciesCaughtStatus; v1 = ov21_021D3898(param2->unk_04); - v0 = ov21_021D375C(param2->unk_04); - v2 = ov21_021D37DC(param2->unk_04, v0); + dexIndex = ov21_021D375C(param2->unk_04); + speciesCaughtStatus = Pokedex_Sort_SpeciesCaughtStatus(param2->unk_04, dexIndex); - if (ov21_021D38B0(param2->unk_04, v1) == (NATIONAL_DEX_COUNT + 1)) { + if (Pokedex_Sort_SeenIndexToSpecies(param2->unk_04, v1) == (NATIONAL_DEX_COUNT + 1)) { ov21_021D217C(param1, 0); if (param0->unk_7C) { CellActor_SetDrawFlag(param0->unk_7C, 1); } } else { - ov21_021D1890(param1, param2->unk_04, v2->unk_00, 2, 56, 80); + ov21_021D1890(param1, param2->unk_04, speciesCaughtStatus->species, 2, 56, 80); ov21_021D217C(param1, 1); if (param0->unk_7C) { @@ -1081,14 +1081,14 @@ static void ov21_021D6AE4(UnkStruct_ov21_021D71A8 *param0, const UnkStruct_ov21_ VecFx32 v1; int v2; int v3; - BOOL v4; + BOOL isCaught; int v5; int v6; int v7; - const UnkStruct_ov21_021D37DC *v8; + const speciesCaughtStatusStruct *speciesCaughtStatus; int v9; int v10; - int v11; + int dexIndex; v6 = ov21_021D3898(param1->unk_04); v7 = ov21_021D38A4(param1->unk_04); @@ -1096,24 +1096,24 @@ static void ov21_021D6AE4(UnkStruct_ov21_021D71A8 *param0, const UnkStruct_ov21_ for (v2 = 0; v2 < 9; v2++) { v3 = (param0->unk_24 + v2) % 9; - v4 = 0; + isCaught = 0; v5 = ((v6 - 4) + v2); if ((v5 >= 0) && (v5 < v7)) { - v11 = ov21_021D38B0(param1->unk_04, v5); + dexIndex = Pokedex_Sort_SeenIndexToSpecies(param1->unk_04, v5); - if (v11 != (NATIONAL_DEX_COUNT + 1)) { - v8 = ov21_021D37DC(param1->unk_04, v11); + if (dexIndex != (NATIONAL_DEX_COUNT + 1)) { + speciesCaughtStatus = Pokedex_Sort_SpeciesCaughtStatus(param1->unk_04, dexIndex); - if (v8->unk_04 == 2) { - v4 = 1; + if (speciesCaughtStatus->caughtStatus == 2) { + isCaught = 1; } } } - CellActor_SetDrawFlag(param0->unk_50[v3], v4); + CellActor_SetDrawFlag(param0->unk_50[v3], isCaught); - if (v4) { + if (isCaught) { v0 = CellActor_GetPosition(param0->unk_00[v3]); v1.x = v0->x + (-54 * FX32_ONE); @@ -1236,7 +1236,7 @@ static void ov21_021D6CC8(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13 v2 %= 9; if ((v3 < v1) && (v3 >= 0)) { - v4 = ov21_021D38B0(param2->unk_04, v3); + v4 = Pokedex_Sort_SeenIndexToSpecies(param2->unk_04, v3); if (v4 != (NATIONAL_DEX_COUNT + 1)) { ov21_021D6D78(param0, param1, param2, param3, v2, v4); @@ -1252,14 +1252,14 @@ static void ov21_021D6CC8(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13 } } -static void ov21_021D6D78(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13FC *param1, const UnkStruct_ov21_021D5B68 *param2, int param3, int param4, int param5) +static void ov21_021D6D78(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13FC *param1, const UnkStruct_ov21_021D5B68 *param2, int param3, int param4, int dexIndex) { UnkStruct_ov21_021D4CB8 v0; Window *v1; - const UnkStruct_ov21_021D37DC *v2; + const speciesCaughtStatusStruct *speciesCaughtStatus; - v2 = ov21_021D37DC(param2->unk_04, param5); - GF_ASSERT(v2); + speciesCaughtStatus = Pokedex_Sort_SpeciesCaughtStatus(param2->unk_04, dexIndex); + GF_ASSERT(speciesCaughtStatus); v0.unk_00 = param1->unk_14C; v0.unk_08 = param0->unk_90.paletteProxy; @@ -1271,7 +1271,7 @@ static void ov21_021D6D78(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13 v0.unk_20 = NNS_G2D_VRAM_TYPE_2DMAIN; v0.unk_24 = param3; - v1 = ov21_021D16D8(param1, param2->unk_04, param3, v2->unk_00); + v1 = ov21_021D16D8(param1, param2->unk_04, param3, speciesCaughtStatus->species); if (param0->unk_28[param4]) { ov21_021D4D1C(param0->unk_28[param4]); @@ -1703,7 +1703,7 @@ static BOOL ov21_021D74B0(UnkStruct_ov21_021D5B68 *param0, int param1) if (ov21_021D36A4(param0->unk_04, v0)) { ov21_021D36C0(param0->unk_04, v0); Sound_PlayEffect(1501); - ov21_021D3684(param0->unk_04, 0, 0, 0, 0, 0, v0, param1); + Pokedex_Sort_Unfiltered(param0->unk_04, 0, 0, 0, 0, 0, v0, param1); ov21_021D36FC(param0->unk_04, 0); param0->unk_0C = 0; @@ -1721,12 +1721,13 @@ static BOOL ov21_021D74B0(UnkStruct_ov21_021D5B68 *param0, int param1) static void ov21_021D7538(UnkStruct_ov21_021D5B68 *param0, int param1) { - u32 v0 = ov21_021D37BC(param0->unk_04); + u32 species = Pokedex_Sort_CurrentSpecies(param0->unk_04); - ov21_021D3684(param0->unk_04, 0, 0, 0, 0, 0, ov21_021D36D8(param0->unk_04), param1); + Pokedex_Sort_Unfiltered(param0->unk_04, 0, 0, 0, 0, 0, ov21_021D36D8(param0->unk_04), param1); (*param0->unk_00) |= (1 << 4); - ov21_021D3794(param0->unk_04, v0); + ov21_021D3794(param0->unk_04, species); + param0->unk_0C = 0; param0->unk_04->unk_1740 = 0; diff --git a/src/overlay021/ov21_021D76B0.c b/src/overlay021/ov21_021D76B0.c index c0b44bdc4d..b1cee11816 100644 --- a/src/overlay021/ov21_021D76B0.c +++ b/src/overlay021/ov21_021D76B0.c @@ -10,7 +10,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/ov21_021D4340.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021D5AEC.h" @@ -116,8 +116,8 @@ static void ov21_021D8324(UnkStruct_ov21_021D7A64 *param0); static void ov21_021D8354(UnkStruct_ov21_021D7C64 *param0, UnkStruct_ov21_021D77E8 *param1, int param2, fx32 param3); static void ov21_021D83C0(UnkStruct_ov21_021D7C64 *param0, UnkStruct_ov21_021D77E8 *param1, const UnkStruct_ov21_021D77D4 *param2); static void ov21_021D8434(UnkStruct_ov21_021D7A64 *param0, int param1, int param2); -static BOOL ov21_021D84E0(UnkStruct_ov21_021D7A64 *param0, UnkStruct_ov21_021D3320 *param1); -static BOOL ov21_021D8508(UnkStruct_ov21_021D7A64 *param0, UnkStruct_ov21_021D3320 *param1); +static BOOL ov21_021D84E0(UnkStruct_ov21_021D7A64 *param0, pokedexStruct *param1); +static BOOL ov21_021D8508(UnkStruct_ov21_021D7A64 *param0, pokedexStruct *param1); static void ov21_021D8530(UnkStruct_ov21_021D7A64 *param0, UnkStruct_ov21_021D77D4 *param1); static fx32 ov21_021D8580(fx32 param0, s32 param1); @@ -236,7 +236,7 @@ static int ov21_021D7818(UnkStruct_ov21_021E6A68 *param0, void *param1) UnkStruct_ov21_021D7A64 *v1; int v2; - param0->unk_08 = Heap_AllocFromHeap(param0->unk_04, sizeof(UnkStruct_ov21_021D7A64)); + param0->unk_08 = Heap_AllocFromHeap(param0->heapID, sizeof(UnkStruct_ov21_021D7A64)); GF_ASSERT(param0->unk_08); memset(param0->unk_08, 0, sizeof(UnkStruct_ov21_021D7A64)); @@ -248,7 +248,7 @@ static int ov21_021D7818(UnkStruct_ov21_021E6A68 *param0, void *param1) v0->unk_00[v2] = (3 + 1); } - ov21_021D7A64(param0->unk_08, v0, param0->unk_04); + ov21_021D7A64(param0->unk_08, v0, param0->heapID); return 1; } @@ -296,13 +296,13 @@ static int ov21_021D78C0(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo switch (param1->unk_00) { case 0: - param1->unk_08 = Heap_AllocFromHeap(param1->unk_04, sizeof(UnkStruct_ov21_021D7C64)); + param1->unk_08 = Heap_AllocFromHeap(param1->heapID, sizeof(UnkStruct_ov21_021D7C64)); GF_ASSERT(param1->unk_08); memset(param1->unk_08, 0, sizeof(UnkStruct_ov21_021D7C64)); param1->unk_00++; break; case 1: - ov21_021D7C64(v3, v2, v0, param1->unk_04); + ov21_021D7C64(v3, v2, v0, param1->heapID); param1->unk_00++; break; case 2: @@ -368,7 +368,7 @@ static int ov21_021D79E4(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo } break; case 2: - ov21_021D7CAC(v3, v2, param1->unk_04); + ov21_021D7CAC(v3, v2, param1->heapID); param1->unk_00++; break; case 3: @@ -446,7 +446,7 @@ static void ov21_021D7B8C(u32 param0, u32 param1, void *param2) UnkStruct_ov21_021D7B8C *v0 = param2; UnkStruct_ov21_021D77D4 *v1 = v0->unk_04; UnkStruct_ov21_021D7A64 *v2 = v0->unk_00; - UnkStruct_ov21_021D3320 *v3 = v1->unk_1C->unk_04; + pokedexStruct *v3 = v1->unk_1C->unk_04; int v4; int v5; @@ -475,7 +475,7 @@ static void ov21_021D7B8C(u32 param0, u32 param1, void *param2) break; case 4: if (v2->unk_20 == 0) { - v4 = ov21_021D3768(v3); + v4 = Pokedex_Sort_CompletionNumEncountered(v3); ov21_021D853C(v1, v4 - 1); } break; @@ -784,7 +784,7 @@ static void ov21_021D828C(UnkStruct_ov21_021D77E8 *param0, int param1) static void ov21_021D82A8(UnkStruct_ov21_021D7A64 *param0, UnkStruct_ov21_021D77D4 *param1) { int v0; - UnkStruct_ov21_021D3320 *v1 = param1->unk_1C->unk_04; + pokedexStruct *v1 = param1->unk_1C->unk_04; if (param1->unk_1C->unk_0C <= 0) { if (param0->unk_10 != 0) { @@ -941,7 +941,7 @@ static void ov21_021D84B8(UnkStruct_ov21_021D77D4 *param0) } } -static BOOL ov21_021D84E0(UnkStruct_ov21_021D7A64 *param0, UnkStruct_ov21_021D3320 *param1) +static BOOL ov21_021D84E0(UnkStruct_ov21_021D7A64 *param0, pokedexStruct *param1) { int v0; @@ -960,7 +960,7 @@ static BOOL ov21_021D84E0(UnkStruct_ov21_021D7A64 *param0, UnkStruct_ov21_021D33 return 1; } -static BOOL ov21_021D8508(UnkStruct_ov21_021D7A64 *param0, UnkStruct_ov21_021D3320 *param1) +static BOOL ov21_021D8508(UnkStruct_ov21_021D7A64 *param0, pokedexStruct *param1) { int v0; diff --git a/src/overlay021/ov21_021D85B0.c b/src/overlay021/ov21_021D85B0.c index 09097b60b2..e2873c8563 100644 --- a/src/overlay021/ov21_021D85B0.c +++ b/src/overlay021/ov21_021D85B0.c @@ -8,7 +8,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/ov21_021D4340.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" @@ -35,7 +35,7 @@ typedef struct { int *unk_00; - UnkStruct_ov21_021D3320 *unk_04; + pokedexStruct *unk_04; UnkStruct_ov21_021D5B68 *unk_08; int unk_0C; int unk_10; @@ -327,7 +327,7 @@ static int ov21_021D87CC(UnkStruct_ov21_021E6A68 *param0, void *param1) UnkStruct_ov21_021D8788 *v0 = param1; UnkStruct_ov21_021D87CC *v1; - v1 = Heap_AllocFromHeap(param0->unk_04, sizeof(UnkStruct_ov21_021D87CC)); + v1 = Heap_AllocFromHeap(param0->heapID, sizeof(UnkStruct_ov21_021D87CC)); GF_ASSERT(v1); memset(v1, 0, sizeof(UnkStruct_ov21_021D87CC)); @@ -400,7 +400,7 @@ static int ov21_021D8804(UnkStruct_ov21_021E6A68 *param0, void *param1) break; case 3: v2 = 1; - v2 = ov21_021D3464(v0->unk_04, v0->unk_10, v0->unk_14, v0->unk_18, v0->unk_1C, v0->unk_20, ov21_021D36D8(v0->unk_04), param0->unk_04, 1); + v2 = Pokedex_Sort(v0->unk_04, v0->unk_10, v0->unk_14, v0->unk_18, v0->unk_1C, v0->unk_20, ov21_021D36D8(v0->unk_04), param0->heapID, 1); if (v2 == 1) { *v0->unk_00 |= (0x1 << 1); @@ -455,12 +455,12 @@ static int ov21_021D893C(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo switch (param1->unk_00) { case 0: - param1->unk_08 = Heap_AllocFromHeap(param1->unk_04, sizeof(UnkStruct_ov21_021D9320)); + param1->unk_08 = Heap_AllocFromHeap(param1->heapID, sizeof(UnkStruct_ov21_021D9320)); memset(param1->unk_08, 0, sizeof(UnkStruct_ov21_021D9320)); param1->unk_00++; break; case 1: - ov21_021D8A7C(v3, v2, v0, v1, param1->unk_04); + ov21_021D8A7C(v3, v2, v0, v1, param1->heapID); sub_0200AAE0(1, 0, -16, (GX_BLEND_PLANEMASK_BG0 | GX_BLEND_PLANEMASK_BG1 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_OBJ | GX_BLEND_PLANEMASK_BD), 1); param1->unk_00++; break; @@ -484,11 +484,11 @@ static int ov21_021D89B8(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo UnkStruct_ov21_021D9320 *v3 = param1->unk_08; if (v0->unk_30 == 0) { - ov21_021D8ED4(v3, v2, v0, param1->unk_04); + ov21_021D8ED4(v3, v2, v0, param1->heapID); } else if ((v0->unk_30 == 1) || (v0->unk_30 == 3)) { - ov21_021D9320(v3, v2, v0, param1->unk_04); + ov21_021D9320(v3, v2, v0, param1->heapID); } else if (v0->unk_30 != 4) { - ov21_021D9390(v3, v2, v0, param1->unk_04); + ov21_021D9390(v3, v2, v0, param1->heapID); } return 0; diff --git a/src/overlay021/ov21_021D94BC.c b/src/overlay021/ov21_021D94BC.c index d78cb5136e..c92720b71c 100644 --- a/src/overlay021/ov21_021D94BC.c +++ b/src/overlay021/ov21_021D94BC.c @@ -9,7 +9,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021D4EE4.h" #include "overlay021/ov21_021D85B0.h" @@ -43,7 +43,7 @@ typedef struct { int *unk_00; - UnkStruct_ov21_021D3320 *unk_04; + pokedexStruct *unk_04; UnkStruct_ov21_021E68F4 *unk_08; UnkStruct_ov21_021E68F4 *unk_0C; } UnkStruct_ov21_021D95B8; @@ -310,7 +310,7 @@ static int ov21_021D95E8(UnkStruct_ov21_021E6A68 *param0, void *param1) UnkStruct_ov21_021D9B24 *v1; int v2; - v1 = Heap_AllocFromHeap(param0->unk_04, sizeof(UnkStruct_ov21_021D9B24)); + v1 = Heap_AllocFromHeap(param0->heapID, sizeof(UnkStruct_ov21_021D9B24)); GF_ASSERT(v1); memset(v1, 0, sizeof(UnkStruct_ov21_021D9B24)); @@ -319,8 +319,8 @@ static int ov21_021D95E8(UnkStruct_ov21_021E6A68 *param0, void *param1) v1->unk_80 = 0xffff; ov21_021DC35C(v1, v0); - ov21_021D9ADC(v1, v0, param0->unk_04); - ov21_021DB3E0(v1, param0->unk_04); + ov21_021D9ADC(v1, v0, param0->heapID); + ov21_021DB3E0(v1, param0->heapID); ov21_021DB428(v1, v0); for (v2 = 0; v2 < 6; v2++) { @@ -383,8 +383,8 @@ static int ov21_021D964C(UnkStruct_ov21_021E6A68 *param0, void *param1) v1->unk_24 = v3; v1->unk_28 = v1->unk_20; - ov21_021D9B34(v1, v0, param0->unk_04); - ov21_021DB468(v1, param0->unk_04); + ov21_021D9B34(v1, v0, param0->heapID); + ov21_021DB468(v1, param0->heapID); ov21_021DC35C(v1, v0); if (v4 != v1->unk_24) { @@ -434,12 +434,12 @@ static int ov21_021D97A0(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo switch (param1->unk_00) { case 0: - param1->unk_08 = Heap_AllocFromHeap(param1->unk_04, sizeof(UnkStruct_ov21_021DC96C)); + param1->unk_08 = Heap_AllocFromHeap(param1->heapID, sizeof(UnkStruct_ov21_021DC96C)); memset(param1->unk_08, 0, sizeof(UnkStruct_ov21_021DC96C)); param1->unk_00++; break; case 1: - ov21_021D9A08(v3, v2, v0, v1, param1->unk_04); + ov21_021D9A08(v3, v2, v0, v1, param1->heapID); sub_0200AAE0(1, 0, -16, (GX_BLEND_PLANEMASK_BG0 | GX_BLEND_PLANEMASK_BG1 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_OBJ | GX_BLEND_PLANEMASK_BD), 2); ov21_021DB480(v2, v1, v0); param1->unk_00++; @@ -483,12 +483,12 @@ static int ov21_021D9830(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo ov21_021DBDA0(v3); } - ov21_021DB79C(v3, v2, param1->unk_04); - ov21_021DBE3C(v3, v2, param1->unk_04); + ov21_021DB79C(v3, v2, param1->heapID); + ov21_021DBE3C(v3, v2, param1->heapID); if (v3->unk_104 == 3) { - ov21_021DB634(v3, v2, param1->unk_04); - ov21_021DBBE4(v3, v2, param1->unk_04); + ov21_021DB634(v3, v2, param1->heapID); + ov21_021DBBE4(v3, v2, param1->heapID); } ov21_021DC8B4(v3, GX_OAM_MODE_XLU, v3->unk_104, v3->unk_108); diff --git a/src/overlay021/ov21_021DC9BC.c b/src/overlay021/ov21_021DC9BC.c index b4dc7369c7..d626d6af26 100644 --- a/src/overlay021/ov21_021DC9BC.c +++ b/src/overlay021/ov21_021DC9BC.c @@ -9,7 +9,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021D517C.h" #include "overlay021/ov21_021D57B4.h" @@ -38,6 +38,8 @@ #include "unk_02018340.h" #include "unk_0201F834.h" +#include "rtc.h" + static const u16 Unk_ov21_021E9D78[] = { 0xffff }; @@ -71,9 +73,15 @@ static const u16 Unk_ov21_021E9D7A[] = { 0xffff }; +enum EncounterTime { + ENCTIME_MORNING = 0, + ENCTIME_DAY = 1, + ENCTIME_NIGHT = 2, +}; + typedef struct { - UnkStruct_ov21_021D3320 *unk_00; - int unk_04; + pokedexStruct *pokedexS; + int encounterTime; UnkStruct_ov21_021E68F4 *unk_08; } UnkStruct_ov21_021DCACC; @@ -86,19 +94,19 @@ typedef struct { } UnkStruct_ov21_021DCAE0; typedef struct { - int unk_00; + int encounterTime; u8 *unk_04; u8 *unk_08; - u32 unk_0C; + u32 heapSize; u32 unk_10; - UnkStruct_ov21_021D5844 unk_14; - UnkStruct_ov21_021D5844 unk_1C; - UnkStruct_ov21_021D5844 unk_24; - UnkStruct_ov21_021D5844 unk_2C; + pokedexEncStruct dexEnc0; + pokedexEncStruct dexEnc1; + pokedexEncStruct dexEnc2; + pokedexEncStruct dexEnc3; } UnkStruct_ov21_021DDABC; typedef struct { - int unk_00; + int encounterTime; CellActor *unk_04[44]; SpriteResource *unk_B4[4]; int unk_C4; @@ -112,8 +120,8 @@ typedef struct { NNSG2dCharacterData *unk_7F8; void *unk_7FC; NNSG2dCharacterData *unk_800; - UnkStruct_ov21_021D5868 *unk_804; - UnkStruct_ov21_021D5890 *unk_808; + UnkStruct_ov21_021D5868 *zukan_enc_plat_0; + UnkStruct_ov21_021D5890 *zukan_enc_plat_2; int unk_80C; int unk_810; UnkStruct_ov21_021D2648 unk_814; @@ -123,7 +131,7 @@ typedef struct { u32 unk_840; } UnkStruct_ov21_021DD420; -static UnkStruct_ov21_021DCACC *ov21_021DCA5C(int param0, UnkStruct_ov21_021D0F60 *param1); +static UnkStruct_ov21_021DCACC *ov21_021DCA5C(int heapID, UnkStruct_ov21_021D0F60 *param1); static UnkStruct_ov21_021DCAE0 *ov21_021DCAA0(int param0, UnkStruct_ov21_021D0F60 *param1); static void ov21_021DCACC(UnkStruct_ov21_021DCACC *param0); static void ov21_021DCAE0(UnkStruct_ov21_021DCAE0 *param0); @@ -157,22 +165,22 @@ static void ov21_021DDA48(UnkStruct_ov21_021DD420 *param0, int param1); static void ov21_021DDA80(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCAE0 *param1, const UnkStruct_ov21_021DCACC *param2, const UnkStruct_ov21_021DDABC *param3, int param4); static void ov21_021DD710(UnkStruct_ov21_021DD420 *param0, const UnkStruct_ov21_021DCACC *param1, const UnkStruct_ov21_021DDABC *param2, int param3); static void ov21_021DD8B4(UnkStruct_ov21_021DD420 *param0); -static u8 *ov21_021DD900(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 *param2); +static u8 *ov21_021DD900(u32 heapID, const UnkStruct_ov21_021DCACC *param1, u32 *param2); static u8 *ov21_021DD908(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 *param2); static void ov21_021DD964(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCAE0 *param1); static void ov21_021DDB8C(UnkStruct_ov21_021DD420 *param0); static void ov21_021DDBCC(UnkStruct_ov21_021DD420 *param0); static void ov21_021DDC14(UnkStruct_ov21_021DD420 *param0); -static void ov21_021DDABC(UnkStruct_ov21_021DDABC *param0, UnkStruct_ov21_021DCACC *param1, int param2); +static void ov21_021DDABC(UnkStruct_ov21_021DDABC *param0, UnkStruct_ov21_021DCACC *param1, int heapID); static void ov21_021DDB68(UnkStruct_ov21_021DDABC *param0); -void ov21_021DC9BC(UnkStruct_ov21_021E68F4 *param0, UnkStruct_ov21_021D0F60 *param1, int param2) +void ov21_021DC9BC(UnkStruct_ov21_021E68F4 *param0, UnkStruct_ov21_021D0F60 *param1, int heapID) { UnkStruct_ov21_021DCACC *v0; UnkStruct_ov21_021DCAE0 *v1; - v0 = ov21_021DCA5C(param2, param1); - v1 = ov21_021DCAA0(param2, param1); + v0 = ov21_021DCA5C(heapID, param1); + v1 = ov21_021DCAA0(heapID, param1); param0->unk_00 = v0; param0->unk_04 = v1; @@ -195,15 +203,15 @@ void ov21_021DCA14(UnkStruct_ov21_021E68F4 *param0) int ov21_021DCA28(const UnkStruct_ov21_021E68F4 *param0) { const UnkStruct_ov21_021DCACC *v0 = param0->unk_00; - return v0->unk_04; + return v0->encounterTime; } -void ov21_021DCA30(UnkStruct_ov21_021E68F4 *param0, int param1) +void ov21_021DCA30(UnkStruct_ov21_021E68F4 *param0, int encounterTime) { UnkStruct_ov21_021DCACC *v0 = param0->unk_00; - GF_ASSERT(param1 < 3); - v0->unk_04 = param1; + GF_ASSERT(encounterTime < 3); + v0->encounterTime = encounterTime; } void ov21_021DCA44(UnkStruct_ov21_021E68F4 *param0, int param1, int param2) @@ -226,16 +234,16 @@ void ov21_021DCA54(UnkStruct_ov21_021E68F4 *param0, int param1) v0->unk_10 = param1; } -static UnkStruct_ov21_021DCACC *ov21_021DCA5C(int param0, UnkStruct_ov21_021D0F60 *param1) +static UnkStruct_ov21_021DCACC *ov21_021DCA5C(int heapID, UnkStruct_ov21_021D0F60 *param1) { UnkStruct_ov21_021DCACC *v0; - v0 = Heap_AllocFromHeap(param0, sizeof(UnkStruct_ov21_021DCACC)); + v0 = Heap_AllocFromHeap(heapID, sizeof(UnkStruct_ov21_021DCACC)); GF_ASSERT(v0); memset(v0, 0, sizeof(UnkStruct_ov21_021DCACC)); - v0->unk_00 = ov21_021D13EC(param1); + v0->pokedexS = ov21_021D13EC(param1); v0->unk_08 = ov21_021D1410(param1, 5); return v0; @@ -273,34 +281,34 @@ static int ov21_021DCAF4(void) return 0; } -static int ov21_021DCAF8(UnkStruct_ov21_021E6A68 *param0, void *param1) +static int ov21_021DCAF8(UnkStruct_ov21_021E6A68 *param0, void *param1)// dansim { UnkStruct_ov21_021DCACC *v0 = param1; UnkStruct_ov21_021DDABC *v1; - v1 = Heap_AllocFromHeap(param0->unk_04, sizeof(UnkStruct_ov21_021DDABC)); + v1 = Heap_AllocFromHeap(param0->heapID, sizeof(UnkStruct_ov21_021DDABC)); GF_ASSERT(v1); memset(v1, 0, sizeof(UnkStruct_ov21_021DDABC)); param0->unk_08 = v1; - if (v0->unk_00->unk_1744 == 0) { - v0->unk_04 = 0; + if (v0->pokedexS->timeOfDay == TOD_MORNING) { + v0->encounterTime = ENCTIME_MORNING; } else { - if ((v0->unk_00->unk_1744 == 1) || (v0->unk_00->unk_1744 == 2)) { - v0->unk_04 = 1; + if ((v0->pokedexS->timeOfDay == TOD_DAY) || (v0->pokedexS->timeOfDay == TOD_TWILIGHT)) { + v0->encounterTime = ENCTIME_DAY; } else { - v0->unk_04 = 2; + v0->encounterTime = ENCTIME_NIGHT; } } - v1->unk_04 = ov21_021DD900(param0->unk_04, v0, &v1->unk_0C); - v1->unk_08 = ov21_021DD908(param0->unk_04, v0, &v1->unk_10); + v1->unk_04 = ov21_021DD900(param0->heapID, v0, &v1->heapSize); + v1->unk_08 = ov21_021DD908(param0->heapID, v0, &v1->unk_10); - ov21_021DDABC(v1, v0, param0->unk_04); + ov21_021DDABC(v1, v0, param0->heapID); - v1->unk_00 = v0->unk_04; + v1->encounterTime = v0->encounterTime; return 1; } @@ -318,10 +326,10 @@ static int ov21_021DCB6C(UnkStruct_ov21_021E6A68 *param0, void *param1) return 0; } - if (v1->unk_00 != v0->unk_04) { + if (v1->encounterTime != v0->encounterTime) { ov21_021DDB68(v1); - ov21_021DDABC(v1, v0, param0->unk_04); - v1->unk_00 = v0->unk_04; + ov21_021DDABC(v1, v0, param0->heapID); + v1->encounterTime = v0->encounterTime; } return 0; @@ -357,19 +365,19 @@ static int ov21_021DCBD8(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo switch (param1->unk_00) { case 0: - param1->unk_08 = Heap_AllocFromHeap(param1->unk_04, sizeof(UnkStruct_ov21_021DD420)); + param1->unk_08 = Heap_AllocFromHeap(param1->heapID, sizeof(UnkStruct_ov21_021DD420)); memset(param1->unk_08, 0, sizeof(UnkStruct_ov21_021DD420)); v3 = param1->unk_08; - v3->unk_00 = v0->unk_04; - v3->unk_804 = ov21_021D5868(param1->unk_04, NULL); - v3->unk_808 = ov21_021D5890(param1->unk_04, NULL); + v3->encounterTime = v0->encounterTime; + v3->zukan_enc_plat_0 = ov21_021D5868(param1->heapID, NULL); + v3->zukan_enc_plat_2 = ov21_021D5890(param1->heapID, NULL); param1->unk_00++; break; case 1: - ov21_021DCDD0(v3, v2, v0, v1, param1->unk_04); - ov21_021DD710(param1->unk_08, v0, v1, param1->unk_04); + ov21_021DCDD0(v3, v2, v0, v1, param1->heapID); + ov21_021DD710(param1->unk_08, v0, v1, param1->heapID); ov21_021DD9E8(param1->unk_08, v1); ov21_021DDB8C(v3); ov21_021DD964(v3, v2); @@ -409,7 +417,7 @@ static int ov21_021DCCD8(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo UnkStruct_ov21_021DD420 *v3 = param1->unk_08; ov21_021DDC14(v3); - ov21_021DDA80(v3, v2, v0, v1, param1->unk_04); + ov21_021DDA80(v3, v2, v0, v1, param1->heapID); return 0; } @@ -452,8 +460,8 @@ static int ov21_021DCD04(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo break; case 3: GXLayers_EngineAToggleLayers(GX_BLEND_PLANEMASK_BG1, 1); - Heap_FreeToHeap(v3->unk_804); - Heap_FreeToHeap(v3->unk_808); + Heap_FreeToHeap(v3->zukan_enc_plat_0); + Heap_FreeToHeap(v3->zukan_enc_plat_2); Heap_FreeToHeap(param1->unk_08); param1->unk_08 = NULL; param1->unk_00++; @@ -472,7 +480,7 @@ static void ov21_021DCDD0(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCA ov21_021DCFC8(param0, param1, param4); ov21_021DD1A8(param0, param1, param4); ov21_021DD2E0(param0, param1, param2, param4); - ov21_021DDA48(param0, param2->unk_04); + ov21_021DDA48(param0, param2->encounterTime); ov21_021DDCF4(param1, param2); } @@ -496,28 +504,28 @@ static void ov21_021DCE40(UnkStruct_ov21_021DCAE0 *param0, const UnkStruct_ov21_ sub_020198C0(param0->unk_00->unk_00, 3, v1->rawData, 0, 0, v1->screenWidth / 8, v1->screenHeight / 8); Heap_FreeToHeap(v0); - if (param1->unk_00->unk_1764) { + if (param1->pokedexS->pokedexSFlag_2) { v0 = ov21_021D27B8(param0->unk_00, 65, 1, &v1, param2); sub_020198C0(param0->unk_00->unk_00, 3, v1->rawData, 13, 8, v1->screenWidth / 8, v1->screenHeight / 8); Heap_FreeToHeap(v0); } - if (param1->unk_00->unk_176C) { + if (param1->pokedexS->pokedexSFlag_4) { v0 = ov21_021D27B8(param0->unk_00, 66, 1, &v1, param2); sub_020198C0(param0->unk_00->unk_00, 3, v1->rawData, 28, 7, v1->screenWidth / 8, v1->screenHeight / 8); Heap_FreeToHeap(v0); } - if (param1->unk_00->unk_1760) { + if (param1->pokedexS->pokedexSFlag_1) { v0 = ov21_021D27B8(param0->unk_00, 67, 1, &v1, param2); sub_020198C0(param0->unk_00->unk_00, 3, v1->rawData, 11, 8, v1->screenWidth / 8, v1->screenHeight / 8); Heap_FreeToHeap(v0); } - if (param1->unk_00->unk_1768) { + if (param1->pokedexS->pokedexSFlag_3) { v0 = ov21_021D27B8(param0->unk_00, 68, 1, &v1, param2); sub_020198C0(param0->unk_00->unk_00, 3, v1->rawData, 25, 16, v1->screenWidth / 8, v1->screenHeight / 8); @@ -822,38 +830,38 @@ static void ov21_021DD6C0(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCA sub_0201C2B4(¶m1->unk_00->unk_04, 0); } -static void ov21_021DD710(UnkStruct_ov21_021DD420 *param0, const UnkStruct_ov21_021DCACC *param1, const UnkStruct_ov21_021DDABC *param2, int param3) +static void ov21_021DD710(UnkStruct_ov21_021DD420 *param0, const UnkStruct_ov21_021DCACC *param1, const UnkStruct_ov21_021DDABC *param2, int heapID) { - int v0, v1; + int index, v1; int v2, v3; int v4, v5; - int v6; + int species; u8 *v7; - int v8; + int heapSize; ov21_021DD8B4(param0); - param0->unk_838 = ov21_021D5948(param0->unk_EC, 30, 30, param0->unk_808, ¶m2->unk_1C, param2->unk_04, param2->unk_0C); - v8 = (param2->unk_1C.unk_04 - 1) + param2->unk_0C; - v7 = Heap_AllocFromHeapAtEnd(param3, v8); + param0->unk_838 = ov21_021D5948(param0->unk_EC, 30, 30, param0->zukan_enc_plat_2, ¶m2->dexEnc1, param2->unk_04, param2->heapSize); + heapSize = (param2->dexEnc1.pokedexEncLength - 1) + param2->heapSize; + v7 = Heap_AllocFromHeapAtEnd(heapID, heapSize); - for (v0 = 0; v0 < v8; v0++) { - if (v0 < param2->unk_0C) { - v7[v0] = param2->unk_04[v0]; + for (index = 0; index < heapSize; index++) { + if (index < param2->heapSize) { + v7[index] = param2->unk_04[index]; } else { - v7[v0] = param2->unk_1C.unk_00[v0 - param2->unk_0C]; + v7[index] = param2->dexEnc1.pokedexEncArray[index - param2->heapSize]; } } - param0->unk_840 = ov21_021D5948(param0->unk_470, 30, 30, param0->unk_808, ¶m2->unk_2C, v7, v8); + param0->unk_840 = ov21_021D5948(param0->unk_470, 30, 30, param0->zukan_enc_plat_2, ¶m2->dexEnc3, v7, heapSize); Heap_FreeToHeap(v7); ov21_021D5214(param0->unk_EC, 30, 30); ov21_021D5214(param0->unk_470, 30, 30); - v6 = ov21_021D37BC(param1->unk_00); + species = Pokedex_Sort_CurrentSpecies(param1->pokedexS); - if (v6 == 349) { + if (species == SPECIES_FEEBAS) { v2 = 4; v3 = 5; v4 = 92 + 0; @@ -866,20 +874,20 @@ static void ov21_021DD710(UnkStruct_ov21_021DD420 *param0, const UnkStruct_ov21_ } param0->unk_C4 = 0; - param0->unk_C4 = ov21_021D5A20(param0->unk_04, param0->unk_C4, (22 * 2), v4, v5, 5, 5, param0->unk_804, ¶m2->unk_14, 2, v2, param2->unk_08, param2->unk_10, ¶m0->unk_834); + param0->unk_C4 = ov21_021D5A20(param0->unk_04, param0->unk_C4, (22 * 2), v4, v5, 5, 5, param0->zukan_enc_plat_0, ¶m2->dexEnc0, 2, v2, param2->unk_08, param2->unk_10, ¶m0->unk_834); - v8 = (param2->unk_14.unk_04 - 1) + param2->unk_10; - v7 = Heap_AllocFromHeapAtEnd(param3, v8); + heapSize = (param2->dexEnc0.pokedexEncLength - 1) + param2->unk_10; + v7 = Heap_AllocFromHeapAtEnd(heapID, heapSize); - for (v0 = 0; v0 < v8; v0++) { - if (v0 < param2->unk_10) { - v7[v0] = param2->unk_08[v0]; + for (index = 0; index < heapSize; index++) { + if (index < param2->unk_10) { + v7[index] = param2->unk_08[index]; } else { - v7[v0] = param2->unk_14.unk_00[v0 - param2->unk_10]; + v7[index] = param2->dexEnc0.pokedexEncArray[index - param2->unk_10]; } } - param0->unk_C4 = ov21_021D5A20(param0->unk_04, param0->unk_C4, (22 * 2), v4, v5, 5, 5, param0->unk_804, ¶m2->unk_24, 3, v3, v7, v8, ¶m0->unk_83C); + param0->unk_C4 = ov21_021D5A20(param0->unk_04, param0->unk_C4, (22 * 2), v4, v5, 5, 5, param0->zukan_enc_plat_0, ¶m2->dexEnc2, 3, v3, v7, heapSize, ¶m0->unk_83C); Heap_FreeToHeap(v7); } @@ -898,7 +906,7 @@ static void ov21_021DD8B4(UnkStruct_ov21_021DD420 *param0) param0->unk_C4 = 0; } -static u8 *ov21_021DD900(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 *param2) +static u8 *ov21_021DD900(u32 heapID, const UnkStruct_ov21_021DCACC *param1, u32 *heapSize) { u32 v0; int v1; @@ -906,7 +914,7 @@ static u8 *ov21_021DD900(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 v0 = 0; - if (param1->unk_00->unk_1760 == 0) { + if (param1->pokedexS->pokedexSFlag_1 == 0) { v1 = 0; while (Unk_ov21_021E9D78[v1] != 0xffff) { @@ -915,7 +923,7 @@ static u8 *ov21_021DD900(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 } } - if (param1->unk_00->unk_176C == 0) { + if (param1->pokedexS->pokedexSFlag_4 == 0) { v1 = 0; while (Unk_ov21_021E9D74[v1] != 0xffff) { @@ -924,7 +932,7 @@ static u8 *ov21_021DD900(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 } } - if (param1->unk_00->unk_1764 == 0) { + if (param1->pokedexS->pokedexSFlag_2 == 0) { v1 = 0; while (Unk_ov21_021E9D70[v1] != 0xffff) { @@ -933,7 +941,7 @@ static u8 *ov21_021DD900(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 } } - if (param1->unk_00->unk_1768 == 0) { + if (param1->pokedexS->pokedexSFlag_3 == 0) { v1 = 0; while (Unk_ov21_021E9D6C[v1] != 0xffff) { @@ -943,14 +951,14 @@ static u8 *ov21_021DD900(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 } if (v0 > 0) { - v2 = Heap_AllocFromHeap(param0, sizeof(u8) * v0); + v2 = Heap_AllocFromHeap(heapID, sizeof(u8) * v0); } else { v2 = NULL; } - *param2 = v0; + *heapSize = v0; - if (param1->unk_00->unk_1760 == 0) { + if (param1->pokedexS->pokedexSFlag_1 == 0) { v1 = 0; while (Unk_ov21_021E9D78[v1] != 0xffff) { @@ -960,7 +968,7 @@ static u8 *ov21_021DD900(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 } } - if (param1->unk_00->unk_176C == 0) { + if (param1->pokedexS->pokedexSFlag_4 == 0) { v1 = 0; while (Unk_ov21_021E9D74[v1] != 0xffff) { @@ -970,7 +978,7 @@ static u8 *ov21_021DD900(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 } } - if (param1->unk_00->unk_1764 == 0) { + if (param1->pokedexS->pokedexSFlag_2 == 0) { v1 = 0; while (Unk_ov21_021E9D70[v1] != 0xffff) { @@ -980,7 +988,7 @@ static u8 *ov21_021DD900(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 } } - if (param1->unk_00->unk_1768 == 0) { + if (param1->pokedexS->pokedexSFlag_3 == 0) { v1 = 0; while (Unk_ov21_021E9D6C[v1] != 0xffff) { @@ -1001,7 +1009,7 @@ static u8 *ov21_021DD908(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 v0 = 0; - if (param1->unk_00->unk_1760 == 0) { + if (param1->pokedexS->pokedexSFlag_1 == 0) { v1 = 0; while (Unk_ov21_021E9D76[v1] != 0xffff) { @@ -1010,7 +1018,7 @@ static u8 *ov21_021DD908(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 } } - if (param1->unk_00->unk_176C == 0) { + if (param1->pokedexS->pokedexSFlag_4 == 0) { v1 = 0; while (Unk_ov21_021E9D72[v1] != 0xffff) { @@ -1019,7 +1027,7 @@ static u8 *ov21_021DD908(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 } } - if (param1->unk_00->unk_1764 == 0) { + if (param1->pokedexS->pokedexSFlag_2 == 0) { v1 = 0; while (Unk_ov21_021E9D6E[v1] != 0xffff) { @@ -1028,7 +1036,7 @@ static u8 *ov21_021DD908(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 } } - if (param1->unk_00->unk_1768 == 0) { + if (param1->pokedexS->pokedexSFlag_3 == 0) { v1 = 0; while (Unk_ov21_021E9D7A[v1] != 0xffff) { @@ -1047,7 +1055,7 @@ static u8 *ov21_021DD908(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 v0 = 0; - if (param1->unk_00->unk_1760 == 0) { + if (param1->pokedexS->pokedexSFlag_1 == 0) { v1 = 0; while (Unk_ov21_021E9D76[v1] != 0xffff) { @@ -1057,7 +1065,7 @@ static u8 *ov21_021DD908(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 } } - if (param1->unk_00->unk_176C == 0) { + if (param1->pokedexS->pokedexSFlag_4 == 0) { v1 = 0; while (Unk_ov21_021E9D72[v1] != 0xffff) { @@ -1067,7 +1075,7 @@ static u8 *ov21_021DD908(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 } } - if (param1->unk_00->unk_1764 == 0) { + if (param1->pokedexS->pokedexSFlag_2 == 0) { v1 = 0; while (Unk_ov21_021E9D6E[v1] != 0xffff) { @@ -1077,7 +1085,7 @@ static u8 *ov21_021DD908(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 } } - if (param1->unk_00->unk_1768 == 0) { + if (param1->pokedexS->pokedexSFlag_3 == 0) { v1 = 0; while (Unk_ov21_021E9D7A[v1] != 0xffff) { @@ -1126,31 +1134,31 @@ static void ov21_021DDA48(UnkStruct_ov21_021DD420 *param0, int param1) static void ov21_021DDA80(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCAE0 *param1, const UnkStruct_ov21_021DCACC *param2, const UnkStruct_ov21_021DDABC *param3, int param4) { - if (param0->unk_00 != param3->unk_00) { + if (param0->encounterTime != param3->encounterTime) { ov21_021DD710(param0, param2, param3, param4); ov21_021DD964(param0, param1); - ov21_021DDA48(param0, param2->unk_04); + ov21_021DDA48(param0, param2->encounterTime); ov21_021DD9E8(param0, param3); - param0->unk_00 = param3->unk_00; + param0->encounterTime = param3->encounterTime; } } -static void ov21_021DDABC(UnkStruct_ov21_021DDABC *param0, UnkStruct_ov21_021DCACC *param1, int param2) +static void ov21_021DDABC(UnkStruct_ov21_021DDABC *param0, UnkStruct_ov21_021DCACC *param1, int heapID) { int v0; int v1; - int v2 = ov21_021D37BC(param1->unk_00); + int species = Pokedex_Sort_CurrentSpecies(param1->pokedexS); - switch (param1->unk_04) { - case 0: + switch (param1->encounterTime) { + case ENCTIME_MORNING: v0 = 0; v1 = 5; break; - case 1: + case ENCTIME_DAY: v0 = 1; v1 = 6; break; - case 2: + case ENCTIME_NIGHT: v0 = 2; v1 = 7; break; @@ -1159,24 +1167,24 @@ static void ov21_021DDABC(UnkStruct_ov21_021DDABC *param0, UnkStruct_ov21_021DCA break; } - ov21_021D57B4(¶m0->unk_14, v2, v0, param2); - ov21_021D57B4(¶m0->unk_1C, v2, v1, param2); + ov21_021D57B4(¶m0->dexEnc0, species, v0, heapID); + ov21_021D57B4(¶m0->dexEnc1, species, v1, heapID); - if (ov21_021D3428(param1->unk_00) == 0) { - ov21_021D57B4(¶m0->unk_24, v2, 3, param2); - ov21_021D57B4(¶m0->unk_2C, v2, 8, param2); + if (Pokedex_Sort_PokedexUnlocked(param1->pokedexS) == 0) { + ov21_021D57B4(¶m0->dexEnc2, species, 3, heapID); + ov21_021D57B4(¶m0->dexEnc3, species, 8, heapID); } else { - ov21_021D57B4(¶m0->unk_24, v2, 4, param2); - ov21_021D57B4(¶m0->unk_2C, v2, 9, param2); + ov21_021D57B4(¶m0->dexEnc2, species, 4, heapID); + ov21_021D57B4(¶m0->dexEnc3, species, 9, heapID); } } static void ov21_021DDB68(UnkStruct_ov21_021DDABC *param0) { - ov21_021D5844(¶m0->unk_14); - ov21_021D5844(¶m0->unk_1C); - ov21_021D5844(¶m0->unk_24); - ov21_021D5844(¶m0->unk_2C); + Free_pokedexEncData(¶m0->dexEnc0); + Free_pokedexEncData(¶m0->dexEnc1); + Free_pokedexEncData(¶m0->dexEnc2); + Free_pokedexEncData(¶m0->dexEnc3); } static void ov21_021DDB8C(UnkStruct_ov21_021DD420 *param0) @@ -1253,8 +1261,8 @@ static void ov21_021DDC14(UnkStruct_ov21_021DD420 *param0) static void ov21_021DDCF4(UnkStruct_ov21_021DCAE0 *param0, const UnkStruct_ov21_021DCACC *param1) { Sprite *v0 = ov21_021D2170(param0->unk_00); - int v1 = ov21_021D37BC(param1->unk_00); + int species = Pokedex_Sort_CurrentSpecies(param1->pokedexS); - ov21_021D1890(param0->unk_00, param1->unk_00, v1, 2, 40, 120); + ov21_021D1890(param0->unk_00, param1->pokedexS, species, 2, 40, 120); sub_02007DEC(v0, 6, 0); } diff --git a/src/overlay021/ov21_021DDD2C.c b/src/overlay021/ov21_021DDD2C.c index 69319ef5d3..ea7dea0464 100644 --- a/src/overlay021/ov21_021DDD2C.c +++ b/src/overlay021/ov21_021DDD2C.c @@ -8,7 +8,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/ov21_021DC9BC.h" #include "overlay021/ov21_021E29DC.h" #include "overlay021/struct_ov21_021D0F60_decl.h" @@ -34,7 +34,7 @@ typedef struct { UnkStruct_ov21_021E68F4 *unk_00; - UnkStruct_ov21_021D3320 *unk_04; + pokedexStruct *unk_04; UnkStruct_ov21_021E68F4 *unk_08; } UnkStruct_ov21_021DDDA4; @@ -198,7 +198,7 @@ static int ov21_021DDE4C(UnkStruct_ov21_021E6A68 *param0, void *param1) UnkStruct_ov21_021DDDA4 *v0 = param1; UnkStruct_ov21_021DDE4C *v1; - v1 = Heap_AllocFromHeap(param0->unk_04, sizeof(UnkStruct_ov21_021DDE4C)); + v1 = Heap_AllocFromHeap(param0->heapID, sizeof(UnkStruct_ov21_021DDE4C)); GF_ASSERT(v1); memset(v1, 0, sizeof(UnkStruct_ov21_021DDE4C)); @@ -206,7 +206,7 @@ static int ov21_021DDE4C(UnkStruct_ov21_021E6A68 *param0, void *param1) param0->unk_08 = v1; ov21_021DE5A4(v1, v0); - ov21_021DE2EC(v1, v0, param0->unk_04); + ov21_021DE2EC(v1, v0, param0->heapID); return 1; } @@ -251,26 +251,26 @@ static int ov21_021DDEC8(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo switch (param1->unk_00) { case 0: - param1->unk_08 = Heap_AllocFromHeap(param1->unk_04, sizeof(UnkStruct_ov21_021DDEC8)); + param1->unk_08 = Heap_AllocFromHeap(param1->heapID, sizeof(UnkStruct_ov21_021DDEC8)); memset(param1->unk_08, 0, sizeof(UnkStruct_ov21_021DDEC8)); param1->unk_00++; break; case 1: - ov21_021DE100(v3, v2, param1->unk_04); + ov21_021DE100(v3, v2, param1->heapID); ov21_021DE49C(v3, v0, v1); - ov21_021DE4D4(v3, v2, v0, param1->unk_04); + ov21_021DE4D4(v3, v2, v0, param1->heapID); ov21_021DE058(v3, v2, v0, 1); param1->unk_00++; break; case 2: - ov21_021DE4D4(v3, v2, v0, param1->unk_04); + ov21_021DE4D4(v3, v2, v0, param1->heapID); if (ov21_021DE0C4(v3, v2, v0, 1)) { param1->unk_00++; } break; case 3: - ov21_021DE4D4(v3, v2, v0, param1->unk_04); + ov21_021DE4D4(v3, v2, v0, param1->heapID); ov21_021D25AC(&v2->unk_00->unk_1E0, 0); return 1; default: @@ -289,7 +289,7 @@ static int ov21_021DDF80(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo ov21_021DE49C(v3, v0, v1); ov21_021DE630(v2, v1, v0); - ov21_021DE4D4(v3, v2, v0, param1->unk_04); + ov21_021DE4D4(v3, v2, v0, param1->heapID); return 0; } @@ -313,7 +313,7 @@ static int ov21_021DDFB4(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo } break; case 2: - ov21_021DE128(v3, v2, param1->unk_04); + ov21_021DE128(v3, v2, param1->heapID); param1->unk_00++; break; case 3: diff --git a/src/overlay021/ov21_021DE668.c b/src/overlay021/ov21_021DE668.c index b3560c358f..1241a653a7 100644 --- a/src/overlay021/ov21_021DE668.c +++ b/src/overlay021/ov21_021DE668.c @@ -10,7 +10,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1F90.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021D5600.h" #include "overlay021/ov21_021E29DC.h" @@ -201,7 +201,7 @@ static int ov21_021DE778(UnkStruct_ov21_021E6A68 *param0, void *param1) { UnkStruct_ov21_021DE6D4 *v0 = param1; - ov21_021D3434(v0->unk_04, ov21_021D37BC(v0->unk_04)); + ov21_021D3434(v0->unk_04, Pokedex_Sort_CurrentSpecies(v0->unk_04)); ov21_021D344C(v0->unk_04, ov21_021D36D8(v0->unk_04)); return 1; @@ -222,7 +222,7 @@ static int ov21_021DE79C(UnkStruct_ov21_021E6A68 *param0, void *param1) switch (param0->unk_00) { case 0: if (v0->unk_1C == 1) { - Sound_PlayPokemonCry(14, ov21_021D37BC(v0->unk_04), 0x1ff, 0x1ff, 0x1ff, 0); + Sound_PlayPokemonCry(14, Pokedex_Sort_CurrentSpecies(v0->unk_04), 0x1ff, 0x1ff, 0x1ff, 0); v0->unk_1C = 0; } @@ -250,12 +250,12 @@ static int ov21_021DE804(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo switch (param1->unk_00) { case 0: - param1->unk_08 = Heap_AllocFromHeap(param1->unk_04, sizeof(UnkStruct_ov21_021DF374)); + param1->unk_08 = Heap_AllocFromHeap(param1->heapID, sizeof(UnkStruct_ov21_021DF374)); memset(param1->unk_08, 0, sizeof(UnkStruct_ov21_021DF374)); param1->unk_00++; break; case 1: - ov21_021DE9A4(v2, v1, v0, param1->unk_04); + ov21_021DE9A4(v2, v1, v0, param1->heapID); switch (v0->unk_14) { case 0: @@ -369,7 +369,7 @@ static void ov21_021DE9A4(UnkStruct_ov21_021DF374 *param0, UnkStruct_ov21_021DE7 ov21_021DEA44(param1, param3); ov21_021DEB58(param1, param2, param3); - if (ov21_021D37CC(param2->unk_04) == 2) { + if (Pokedex_Sort_CurrentCaughtStatus(param2->unk_04) == 2) { ov21_021DED24(param0, param1, param2, param3); ov21_021DF098(param0, param1, param2, param3); } @@ -415,13 +415,13 @@ static void ov21_021DEA44(UnkStruct_ov21_021DE760 *param0, int param1) static void ov21_021DEB58(UnkStruct_ov21_021DE760 *param0, const UnkStruct_ov21_021DE6D4 *param1, int param2) { - int v0 = ov21_021D37BC(param1->unk_04); + int species = Pokedex_Sort_CurrentSpecies(param1->unk_04); - if (ov21_021D37CC(param1->unk_04) != 2) { - v0 = 0; + if (Pokedex_Sort_CurrentCaughtStatus(param1->unk_04) != 2) { + species = 0; } - ov21_021DEB8C(¶m0->unk_00->unk_04, v0, param2, param1->unk_18, ((u32)(((2 & 0xff) << 16) | ((1 & 0xff) << 8) | ((0 & 0xff) << 0)))); + ov21_021DEB8C(¶m0->unk_00->unk_04, species, param2, param1->unk_18, ((u32)(((2 & 0xff) << 16) | ((1 & 0xff) << 8) | ((0 & 0xff) << 0)))); } void ov21_021DEB8C(Window *param0, int param1, int param2, int param3, u32 param4) @@ -480,14 +480,14 @@ static void ov21_021DECD4(Window *param0, int param1, int param2, int param3, u3 static void ov21_021DED24(UnkStruct_ov21_021DF374 *param0, UnkStruct_ov21_021DE760 *param1, const UnkStruct_ov21_021DE6D4 *param2, int param3) { - int v0 = ov21_021D37BC(param2->unk_04); - int v1 = ov21_021D33D4(param2->unk_04, v0); + int species = Pokedex_Sort_CurrentSpecies(param2->unk_04); + int v1 = ov21_021D33D4(param2->unk_04, species); - if ((v0 == 487) && (v1 > 0)) { - v0 = 11; + if ((species == 487) && (v1 > 0)) { + species = 11; } - ov21_021DED7C(param0, param1, param3, v0); + ov21_021DED7C(param0, param1, param3, species); ov21_021DEE80(param0, param1, param3); } @@ -577,9 +577,9 @@ static void ov21_021DEF3C(UnkStruct_ov21_021DE760 *param0) static void ov21_021DEF54(UnkStruct_ov21_021DE760 *param0, const UnkStruct_ov21_021DE6D4 *param1) { Sprite *v0 = ov21_021D2170(param0->unk_00); - int v1 = ov21_021D37BC(param1->unk_04); + int species = Pokedex_Sort_CurrentSpecies(param1->unk_04); - ov21_021D1890(param0->unk_00, param1->unk_04, v1, 2, 48, 72); + ov21_021D1890(param0->unk_00, param1->unk_04, species, 2, 48, 72); sub_02007DEC(v0, 6, 0); } @@ -627,12 +627,12 @@ static void ov21_021DF098(UnkStruct_ov21_021DF374 *param0, UnkStruct_ov21_021DE7 CellActorResourceData v0; CellActorInitParams v1; UnkStruct_ov21_021D13FC *v2 = param1->unk_00; - int v3 = ov21_021D37BC(param2->unk_04); + int species = Pokedex_Sort_CurrentSpecies(param2->unk_04); int v4, v5; - int v6 = ov21_021D33D4(param2->unk_04, v3); + int v6 = ov21_021D33D4(param2->unk_04, species); - v4 = PokemonPersonalData_GetFormValue(v3, v6, 6); - v5 = PokemonPersonalData_GetFormValue(v3, v6, 7); + v4 = PokemonPersonalData_GetFormValue(species, v6, 6); + v5 = PokemonPersonalData_GetFormValue(species, v6, 7); v4 = ov21_021DF180(v4); v5 = ov21_021DF180(v5); @@ -738,7 +738,7 @@ static void ov21_021DF214(UnkStruct_ov21_021DF374 *param0, UnkStruct_ov21_021DE7 CellActorResourceData v0; CellActorInitParams v1; UnkStruct_ov21_021D13FC *v2 = param1->unk_00; - int v3 = ov21_021D37BC(param2->unk_04); + int species = Pokedex_Sort_CurrentSpecies(param2->unk_04); Window *v4; UnkStruct_ov21_021D4CB8 v5; SpriteResource *v6; @@ -757,11 +757,11 @@ static void ov21_021DF214(UnkStruct_ov21_021DF374 *param0, UnkStruct_ov21_021DE7 CellActor_SetAnim(param0->unk_0C, 0x11); - if (ov21_021D37CC(param2->unk_04) != 2) { - v3 = 0; + if (Pokedex_Sort_CurrentCaughtStatus(param2->unk_04) != 2) { + species = 0; } - v4 = ov21_021DF30C(param1->unk_00->unk_14C, v3, param3); + v4 = ov21_021DF30C(param1->unk_00->unk_14C, species, param3); v6 = ov21_021D2344(param1->unk_00, 1); v5.unk_00 = param1->unk_00->unk_14C; diff --git a/src/overlay021/ov21_021DF734.c b/src/overlay021/ov21_021DF734.c index c78731ca65..ed84eeef43 100644 --- a/src/overlay021/ov21_021DF734.c +++ b/src/overlay021/ov21_021DF734.c @@ -8,7 +8,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021E29DC.h" #include "overlay021/struct_ov21_021D0F60_decl.h" @@ -35,7 +35,7 @@ typedef struct { int *unk_00; - UnkStruct_ov21_021D3320 *unk_04; + pokedexStruct *unk_04; const UnkStruct_ov21_021E68F4 *unk_08; int unk_0C; int unk_10; @@ -260,12 +260,12 @@ static int ov21_021DF870(int param0, int param1, int param2, int param3) static int ov21_021DF888(UnkStruct_ov21_021E6A68 *param0, void *param1) { UnkStruct_ov21_021DF844 *v0 = param1; - int v1; + int species; - v1 = ov21_021D37BC(v0->unk_04); + species = Pokedex_Sort_CurrentSpecies(v0->unk_04); - v0->unk_0C = ov21_021E01CC(v1, v0); - v0->unk_10 = ov21_021E0268(v1, v0); + v0->unk_0C = ov21_021E01CC(species, v0); + v0->unk_10 = ov21_021E0268(species, v0); v0->unk_14 = 0; return 1; @@ -300,7 +300,7 @@ static int ov21_021DF8C4(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo switch (param1->unk_00) { case 0: - param1->unk_08 = Heap_AllocFromHeap(param1->unk_04, sizeof(UnkStruct_ov21_021DFFF8)); + param1->unk_08 = Heap_AllocFromHeap(param1->heapID, sizeof(UnkStruct_ov21_021DFFF8)); memset(param1->unk_08, 0, sizeof(UnkStruct_ov21_021DFFF8)); v2 = param1->unk_08; v2->unk_C8 = v0->unk_0C; @@ -309,7 +309,7 @@ static int ov21_021DF8C4(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo param1->unk_00++; break; case 1: - ov21_021DFA84(v2, v1, v0, param1->unk_04); + ov21_021DFA84(v2, v1, v0, param1->heapID); ov21_021DFF38(v2, v1, v0, 1); param1->unk_00++; break; @@ -356,7 +356,7 @@ static int ov21_021DF958(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo break; case 2: if (v1->unk_08 == 1) { - ov21_021E0944(v2, v1, v0, param1->unk_04, v0->unk_0C, v0->unk_14); + ov21_021E0944(v2, v1, v0, param1->heapID, v0->unk_0C, v0->unk_14); ov21_021DFBB4(v2, v1, v0); v1->unk_08 = 0; v1->unk_04 = 0; @@ -441,14 +441,14 @@ static void ov21_021DFAE8(UnkStruct_ov21_021DF858 *param0, int param1) static void ov21_021DFB50(UnkStruct_ov21_021DFFF8 *param0, UnkStruct_ov21_021DF858 *param1, const UnkStruct_ov21_021DF844 *param2) { - int v0 = ov21_021D37BC(param2->unk_04); + int species = Pokedex_Sort_CurrentSpecies(param2->unk_04); int v1; int v2; - ov21_021DFBEC(param0, param1, param2, v0, param2->unk_0C, param2->unk_14, 0); + ov21_021DFBEC(param0, param1, param2, species, param2->unk_0C, param2->unk_14, 0); v2 = ov21_021DF870(param2->unk_0C, param2->unk_14, 1, param2->unk_10); - ov21_021DFBEC(param0, param1, param2, v0, param2->unk_0C, v2, 2); + ov21_021DFBEC(param0, param1, param2, species, param2->unk_0C, v2, 2); for (v1 = 0; v1 < 4; v1++) { ov21_021D2280(param1->unk_00, 1, v1); @@ -457,12 +457,12 @@ static void ov21_021DFB50(UnkStruct_ov21_021DFFF8 *param0, UnkStruct_ov21_021DF8 static void ov21_021DFBB4(UnkStruct_ov21_021DFFF8 *param0, UnkStruct_ov21_021DF858 *param1, const UnkStruct_ov21_021DF844 *param2) { - int v0 = ov21_021D37BC(param2->unk_04); + int species = Pokedex_Sort_CurrentSpecies(param2->unk_04); int v1; int v2; v2 = ov21_021DF870(param2->unk_0C, param2->unk_14, 1, param2->unk_10); - ov21_021DFBEC(param0, param1, param2, v0, param2->unk_0C, v2, 2); + ov21_021DFBEC(param0, param1, param2, species, param2->unk_0C, v2, 2); } static void ov21_021DFBEC(UnkStruct_ov21_021DFFF8 *param0, UnkStruct_ov21_021DF858 *param1, const UnkStruct_ov21_021DF844 *param2, int param3, int param4, int param5, int param6) @@ -1090,9 +1090,9 @@ static int ov21_021E0A4C(UnkStruct_ov21_021DF858 *param0, const UnkStruct_ov21_0 { int v0; int v1; - int v2 = ov21_021D37BC(param1->unk_04); + int species = Pokedex_Sort_CurrentSpecies(param1->unk_04); - v1 = ov21_021D334C(param1->unk_04, v2, param2); + v1 = ov21_021D334C(param1->unk_04, species, param2); GF_ASSERT(v1 != -1); switch (v1) { diff --git a/src/overlay021/ov21_021E0C68.c b/src/overlay021/ov21_021E0C68.c index 7150066fe2..3908e5be26 100644 --- a/src/overlay021/ov21_021E0C68.c +++ b/src/overlay021/ov21_021E0C68.c @@ -9,7 +9,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021D5600.h" #include "overlay021/ov21_021E29DC.h" @@ -38,7 +38,7 @@ typedef struct { int *unk_00; - UnkStruct_ov21_021D3320 *unk_04; + pokedexStruct *unk_04; int unk_08; int unk_0C; const UnkStruct_ov21_021E68F4 *unk_10; @@ -256,12 +256,12 @@ static int ov21_021E0DAC(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo switch (param1->unk_00) { case 0: - param1->unk_08 = Heap_AllocFromHeap(param1->unk_04, sizeof(UnkStruct_ov21_021E14D4)); + param1->unk_08 = Heap_AllocFromHeap(param1->heapID, sizeof(UnkStruct_ov21_021E14D4)); memset(param1->unk_08, 0, sizeof(UnkStruct_ov21_021E14D4)); param1->unk_00++; break; case 1: - ov21_021E0F4C(v2, v1, v0, param1->unk_04); + ov21_021E0F4C(v2, v1, v0, param1->heapID); switch (v0->unk_14) { case 0: @@ -419,12 +419,12 @@ static void ov21_021E10D0(UnkStruct_ov21_021E0D7C *param0, const UnkStruct_ov21_ { Strbuf *v0 = Strbuf_Init(64, param2); MessageLoader *v1 = MessageLoader_Init(0, 26, 697, param2); - int v2 = ov21_021D37BC(param1->unk_04); + int species = Pokedex_Sort_CurrentSpecies(param1->unk_04); int v3; int v4; - if (ov21_021D37CC(param1->unk_04) != 2) { - v2 = 0; + if (Pokedex_Sort_CurrentCaughtStatus(param1->unk_04) != 2) { + species = 0; GF_ASSERT(0); } @@ -439,9 +439,9 @@ static void ov21_021E10D0(UnkStruct_ov21_021E0D7C *param0, const UnkStruct_ov21_ Strbuf_Free(v0); MessageLoader_Free(v1); - ov21_021E1188(param0, param2, v2, param1->unk_18, param1->unk_1C); - ov21_021E18A0(param0, param2, v2, param1->unk_18); - ov21_021E18DC(param0, param2, v2, param1->unk_18); + ov21_021E1188(param0, param2, species, param1->unk_18, param1->unk_1C); + ov21_021E18A0(param0, param2, species, param1->unk_18); + ov21_021E18DC(param0, param2, species, param1->unk_18); } static void ov21_021E1188(UnkStruct_ov21_021E0D7C *param0, int param1, int param2, int param3, int param4) @@ -469,9 +469,9 @@ static void ov21_021E1210(UnkStruct_ov21_021E0D7C *param0) static void ov21_021E1228(UnkStruct_ov21_021E0D7C *param0, const UnkStruct_ov21_021E0D68 *param1) { Sprite *v0 = ov21_021D2170(param0->unk_00); - int v1 = ov21_021D37BC(param1->unk_04); + int species = Pokedex_Sort_CurrentSpecies(param1->unk_04); - ov21_021D1890(param0->unk_00, param1->unk_04, v1, 2, 48, 72); + ov21_021D1890(param0->unk_00, param1->unk_04, species, 2, 48, 72); sub_02007DEC(v0, 6, 0); } @@ -520,7 +520,7 @@ static void ov21_021E136C(UnkStruct_ov21_021E14D4 *param0, UnkStruct_ov21_021E0D CellActorResourceData v0; CellActorInitParams v1; UnkStruct_ov21_021D13FC *v2 = param1->unk_00; - int v3 = ov21_021D37BC(param2->unk_04); + int species = Pokedex_Sort_CurrentSpecies(param2->unk_04); Window *v4; UnkStruct_ov21_021D4CB8 v5; SpriteResource *v6; @@ -539,11 +539,11 @@ static void ov21_021E136C(UnkStruct_ov21_021E14D4 *param0, UnkStruct_ov21_021E0D CellActor_SetAnim(param0->unk_00, 0x11); - if (ov21_021D37CC(param2->unk_04) != 2) { - v3 = 0; + if (Pokedex_Sort_CurrentCaughtStatus(param2->unk_04) != 2) { + species = 0; } - v4 = ov21_021E1460(param1, v3, param3); + v4 = ov21_021E1460(param1, species, param3); v6 = ov21_021D2344(param1->unk_00, 1); v5.unk_00 = param1->unk_00->unk_14C; diff --git a/src/overlay021/ov21_021E1924.c b/src/overlay021/ov21_021E1924.c index 95f7680131..dd9977b32a 100644 --- a/src/overlay021/ov21_021E1924.c +++ b/src/overlay021/ov21_021E1924.c @@ -9,7 +9,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/ov21_021D4340.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021D5600.h" @@ -44,7 +44,7 @@ typedef struct { int *unk_00; - UnkStruct_ov21_021D3320 *unk_04; + pokedexStruct *unk_04; UnkStruct_ov21_021DE6D4 *unk_08; UnkStruct_ov21_021E68F4 *unk_0C; UnkStruct_ov21_021E68F4 *unk_10; @@ -173,7 +173,7 @@ static UnkStruct_ov21_021E1A7C *ov21_021E199C(int param0, UnkStruct_ov21_021D0F6 { UnkStruct_ov21_021E1A7C *v0; UnkStruct_ov21_021E68F4 *v1; - UnkStruct_ov21_021D3320 *v2; + pokedexStruct *v2; int v3; v0 = Heap_AllocFromHeap(param0, sizeof(UnkStruct_ov21_021E1A7C)); @@ -264,7 +264,7 @@ static int ov21_021E1AD0(UnkStruct_ov21_021E6A68 *param0, void *param1) UnkStruct_ov21_021E1E74 *v1 = param0->unk_08; int v2; - v1 = Heap_AllocFromHeap(param0->unk_04, sizeof(UnkStruct_ov21_021E1E74)); + v1 = Heap_AllocFromHeap(param0->heapID, sizeof(UnkStruct_ov21_021E1E74)); memset(v1, 0, sizeof(UnkStruct_ov21_021E1E74)); for (v2 = 0; v2 < 8; v2++) { @@ -273,7 +273,7 @@ static int ov21_021E1AD0(UnkStruct_ov21_021E6A68 *param0, void *param1) v1->unk_10 = 0; - ov21_021E1D40(v1, v0, param0->unk_04); + ov21_021E1D40(v1, v0, param0->heapID); ov21_021E2968(v1, v0); param0->unk_08 = v1; @@ -323,12 +323,12 @@ static int ov21_021E1B68(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo switch (param1->unk_00) { case 0: - param1->unk_08 = Heap_AllocFromHeap(param1->unk_04, sizeof(UnkStruct_ov21_021E2588)); + param1->unk_08 = Heap_AllocFromHeap(param1->heapID, sizeof(UnkStruct_ov21_021E2588)); memset(param1->unk_08, 0, sizeof(UnkStruct_ov21_021E2588)); param1->unk_00++; break; case 1: - ov21_021E2014(v3, v2, param1->unk_04); + ov21_021E2014(v3, v2, param1->heapID); ov21_021E28D0(v3, v1); ov21_021E25F8(v3, v2, v0, 1); param1->unk_00++; @@ -379,7 +379,7 @@ static int ov21_021E1BFC(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo v5 = 5; } - ov21_021E26A0(v2, v3->unk_00[v4], v3->unk_20[v4], v1->unk_14[v4], -6, v5, &v3->unk_80[v4], param1->unk_04, 4, 1, &v3->unk_A0[v4]); + ov21_021E26A0(v2, v3->unk_00[v4], v3->unk_20[v4], v1->unk_14[v4], -6, v5, &v3->unk_80[v4], param1->heapID, 4, 1, &v3->unk_A0[v4]); ov21_021D144C(v3->unk_50[v4], v1->unk_14[v4]); } } @@ -410,7 +410,7 @@ static int ov21_021E1CB8(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo } break; case 2: - ov21_021E2044(v3, v2, param1->unk_04); + ov21_021E2044(v3, v2, param1->heapID); param1->unk_00++; break; case 3: diff --git a/src/overlay021/ov21_021E29DC.c b/src/overlay021/ov21_021E29DC.c index 0b1c55e213..68aa9af719 100644 --- a/src/overlay021/ov21_021E29DC.c +++ b/src/overlay021/ov21_021E29DC.c @@ -9,7 +9,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/ov21_021D4340.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021D4EE4.h" @@ -46,7 +46,7 @@ typedef struct { int *unk_00; - UnkStruct_ov21_021D3320 *unk_04; + pokedexStruct *unk_04; int unk_08; UnkStruct_ov21_021D5B68 *unk_0C; UnkStruct_ov21_021DE6D4 *unk_10; @@ -77,7 +77,7 @@ typedef struct { typedef struct { int *unk_00; UnkStruct_ov21_021E2BA8 *unk_04; - UnkStruct_ov21_021D3320 *unk_08; + pokedexStruct *unk_08; int unk_0C[6]; BOOL unk_24; int unk_28; @@ -378,14 +378,14 @@ static int ov21_021E2C64(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo switch (param1->unk_00) { case 0: - param1->unk_08 = Heap_AllocFromHeap(param1->unk_04, sizeof(UnkStruct_ov21_021E326C)); + param1->unk_08 = Heap_AllocFromHeap(param1->heapID, sizeof(UnkStruct_ov21_021E326C)); memset(param1->unk_08, 0, sizeof(UnkStruct_ov21_021E326C)); v3 = param1->unk_08; v3->unk_00 = v0->unk_08; param1->unk_00++; break; case 1: - ov21_021E3080(v2, v3, v0, param1->unk_04); + ov21_021E3080(v2, v3, v0, param1->heapID); ov21_021E3BE0(v3); ov21_021D23F8(&v2->unk_00->unk_168, 4, -16, 0, 0, 16, (GX_BLEND_PLANEMASK_BG0 | GX_BLEND_PLANEMASK_BG1 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_BD), (GX_BLEND_PLANEMASK_BG0 | GX_BLEND_PLANEMASK_BG1 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_BD), 0); param1->unk_00++; @@ -563,7 +563,7 @@ static BOOL ov21_021E2EC4(UnkStruct_ov21_021E2BA8 *param0, int param1, int param v1 = 64; break; case 3: - if (ov21_021D37CC(param0->unk_04) == 2) { + if (Pokedex_Sort_CurrentCaughtStatus(param0->unk_04) == 2) { *param0->unk_00 |= (0x1 << 5); param0->unk_08 = 3; } else { @@ -571,7 +571,7 @@ static BOOL ov21_021E2EC4(UnkStruct_ov21_021E2BA8 *param0, int param1, int param } break; case 4: - if (ov21_021D3954(param0->unk_04) == 1) { + if (Pokedex_Sort_CanDetectForms(param0->unk_04) == 1) { *param0->unk_00 |= (0x1 << 8); param0->unk_08 = 4; } else { @@ -884,11 +884,11 @@ static int ov21_021E345C(UnkStruct_ov21_021E6A68 *param0, void *param1) UnkStruct_ov21_021E37B4 *v1 = param0->unk_08; int v2; - v1 = Heap_AllocFromHeap(param0->unk_04, sizeof(UnkStruct_ov21_021E37B4)); + v1 = Heap_AllocFromHeap(param0->heapID, sizeof(UnkStruct_ov21_021E37B4)); memset(v1, 0, sizeof(UnkStruct_ov21_021E37B4)); - ov21_021E3688(v1, v0, param0->unk_04); - ov21_021E3C6C(v1, v0, param0->unk_04); + ov21_021E3688(v1, v0, param0->heapID); + ov21_021E3C6C(v1, v0, param0->heapID); ov21_021E3E8C(v1, v0); for (v2 = 0; v2 < 6; v2++) { @@ -959,12 +959,12 @@ static int ov21_021E3540(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo switch (param1->unk_00) { case 0: - param1->unk_08 = Heap_AllocFromHeap(param1->unk_04, sizeof(UnkStruct_ov21_021E3900)); + param1->unk_08 = Heap_AllocFromHeap(param1->heapID, sizeof(UnkStruct_ov21_021E3900)); memset(param1->unk_08, 0, sizeof(UnkStruct_ov21_021E3900)); param1->unk_00++; break; case 1: - ov21_021E3900(v3, v2, v0, param1->unk_04); + ov21_021E3900(v3, v2, v0, param1->heapID); param1->unk_00++; break; case 2: @@ -1180,7 +1180,7 @@ static void ov21_021E37CC(u32 param0, u32 param1, void *param2) Sound_PlayEffect(1675); } else { if (v2->unk_10 == 0) { - if (ov21_021D3954(v3->unk_04) == 1) { + if (Pokedex_Sort_CanDetectForms(v3->unk_04) == 1) { if (v3->unk_08 != 2) { Sound_PlayEffect(1501); } @@ -1403,7 +1403,7 @@ static void ov21_021E3C6C(UnkStruct_ov21_021E37B4 *param0, UnkStruct_ov21_021E34 ov21_021D4FE4(¶m0->unk_18[2], 108, 24, 24, 16, 0, 0, 2); ov21_021D4FE4(¶m0->unk_18[3], 148, 24, 24, 16, 0, 0, 3); - if (ov21_021D3954(param1->unk_08) == 1) { + if (Pokedex_Sort_CanDetectForms(param1->unk_08) == 1) { v0 = 0; } else { v0 = 2; @@ -1598,7 +1598,7 @@ static void ov21_021E3FC0(UnkStruct_ov21_021E326C *param0, int param1, int param static void ov21_021E3FE4(UnkStruct_ov21_021E3900 *param0, const UnkStruct_ov21_021E342C *param1) { - if (ov21_021D3954(param1->unk_08) == 0) { + if (Pokedex_Sort_CanDetectForms(param1->unk_08) == 0) { CellActor_SetDrawFlag(param0->unk_00[4], 0); } } diff --git a/src/overlay021/ov21_021E3FFC.c b/src/overlay021/ov21_021E3FFC.c index 02886bb425..82d86cccae 100644 --- a/src/overlay021/ov21_021E3FFC.c +++ b/src/overlay021/ov21_021E3FFC.c @@ -9,7 +9,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/ov21_021E29DC.h" #include "overlay021/ov21_021E4CA4.h" #include "overlay021/struct_ov21_021D0F60_decl.h" @@ -32,7 +32,7 @@ typedef struct { int *unk_00; - UnkStruct_ov21_021D3320 *unk_04; + pokedexStruct *unk_04; UnkStruct_ov21_021E68F4 *unk_08; UnkStruct_ov21_021E68F4 *unk_0C; } UnkStruct_ov21_021E40F4; @@ -218,16 +218,16 @@ static int ov21_021E4120(UnkStruct_ov21_021E6A68 *param0, void *param1) { UnkStruct_ov21_021E40F4 *v0 = param1; UnkStruct_ov21_021E4898 *v1; - int v2 = ov21_021D37BC(v0->unk_04); + int species = Pokedex_Sort_CurrentSpecies(v0->unk_04); - v1 = Heap_AllocFromHeap(param0->unk_04, sizeof(UnkStruct_ov21_021E4898)); + v1 = Heap_AllocFromHeap(param0->heapID, sizeof(UnkStruct_ov21_021E4898)); GF_ASSERT(v1); memset(v1, 0, sizeof(UnkStruct_ov21_021E4898)); param0->unk_08 = v1; - v1->unk_00 = sub_020050F8(v2); + v1->unk_00 = sub_020050F8(species); v1->unk_08 = sub_020050EC(v1->unk_00); ov21_021E4898(v1, v0); @@ -274,12 +274,12 @@ static int ov21_021E41A8(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo switch (param1->unk_00) { case 0: - param1->unk_08 = Heap_AllocFromHeap(param1->unk_04, sizeof(UnkStruct_ov21_021E4360)); + param1->unk_08 = Heap_AllocFromHeap(param1->heapID, sizeof(UnkStruct_ov21_021E4360)); memset(param1->unk_08, 0, sizeof(UnkStruct_ov21_021E4360)); param1->unk_00++; break; case 1: - ov21_021E4590(v3, v2, v0, v1, param1->unk_04); + ov21_021E4590(v3, v2, v0, v1, param1->heapID); if (v2->unk_0C == 0) { ov21_021E43C8(v3, v2, v0, 1); @@ -373,9 +373,9 @@ static int ov21_021E4288(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo static void ov21_021E4328(UnkStruct_ov21_021E4108 *param0, const UnkStruct_ov21_021E40F4 *param1) { Sprite *v0 = ov21_021D2170(param0->unk_00); - int v1 = ov21_021D37BC(param1->unk_04); + int species = Pokedex_Sort_CurrentSpecies(param1->unk_04); - ov21_021D1890(param0->unk_00, param1->unk_04, v1, 2, 48, 64); + ov21_021D1890(param0->unk_00, param1->unk_04, species, 2, 48, 64); sub_02007DEC(v0, 6, 0); } diff --git a/src/overlay021/ov21_021E4CA4.c b/src/overlay021/ov21_021E4CA4.c index d29353d056..9acfa1a1ff 100644 --- a/src/overlay021/ov21_021E4CA4.c +++ b/src/overlay021/ov21_021E4CA4.c @@ -9,7 +9,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021E29DC.h" #include "overlay021/struct_ov21_021D0F60_decl.h" @@ -41,7 +41,7 @@ typedef struct { int *unk_00; - UnkStruct_ov21_021D3320 *unk_04; + pokedexStruct *unk_04; UnkStruct_ov21_021E68F4 *unk_08; int unk_0C; } UnkStruct_ov21_021E4D90; @@ -280,15 +280,15 @@ static int ov21_021E4DC0(UnkStruct_ov21_021E6A68 *param0, void *param1) UnkStruct_ov21_021E4D90 *v0 = param1; UnkStruct_ov21_021E51DC *v1 = param0->unk_08; int v2; - int v3 = ov21_021D37BC(v0->unk_04); + int species = Pokedex_Sort_CurrentSpecies(v0->unk_04); - v1 = Heap_AllocFromHeap(param0->unk_04, sizeof(UnkStruct_ov21_021E51DC)); + v1 = Heap_AllocFromHeap(param0->heapID, sizeof(UnkStruct_ov21_021E51DC)); memset(v1, 0, sizeof(UnkStruct_ov21_021E51DC)); - ov21_021E5128(v1, v0, param0->unk_04); + ov21_021E5128(v1, v0, param0->heapID); ov21_021E51DC(v1, v0); - v1->unk_6C = sub_020050F8(v3); + v1->unk_6C = sub_020050F8(species); param0->unk_08 = v1; @@ -353,12 +353,12 @@ static int ov21_021E4E98(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo switch (param1->unk_00) { case 0: - param1->unk_08 = Heap_AllocFromHeap(param1->unk_04, sizeof(UnkStruct_ov21_021E5004)); + param1->unk_08 = Heap_AllocFromHeap(param1->heapID, sizeof(UnkStruct_ov21_021E5004)); memset(param1->unk_08, 0, sizeof(UnkStruct_ov21_021E5004)); param1->unk_00++; break; case 1: - ov21_021E54D4(v3, v2, param1->unk_04); + ov21_021E54D4(v3, v2, param1->heapID); ov21_021E507C(v3, v2, v0, 1); param1->unk_00++; break; @@ -418,7 +418,7 @@ static int ov21_021E4F78(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo } break; case 2: - ov21_021E5510(v3, v2, param1->unk_04); + ov21_021E5510(v3, v2, param1->heapID); param1->unk_00++; break; case 3: @@ -569,7 +569,7 @@ static void ov21_021E5268(u32 param0, u32 param1, void *param2) UnkStruct_ov21_021E5228 *v0 = param2; UnkStruct_ov21_021E4D90 *v1 = v0->unk_00; UnkStruct_ov21_021E51DC *v2 = v0->unk_04; - int v3 = ov21_021D37BC(v1->unk_04); + int species = Pokedex_Sort_CurrentSpecies(v1->unk_04); v2->unk_18[param0] = param1; @@ -586,7 +586,7 @@ static void ov21_021E5268(u32 param0, u32 param1, void *param2) case 0: if (v2->unk_64 == 1) { if (v2->unk_2C == 0) { - ov21_021E5DE8(v2, v1, v3); + ov21_021E5DE8(v2, v1, species); } else { ov21_021E5E18(v2); } @@ -595,7 +595,7 @@ static void ov21_021E5268(u32 param0, u32 param1, void *param2) sub_0200592C(0); } - ov21_021E5DE8(v2, v1, v3); + ov21_021E5DE8(v2, v1, species); } break; case 1: @@ -1285,13 +1285,13 @@ static void ov21_021E5E28(UnkStruct_ov21_021E51DC *param0) static void ov21_021E5E48(UnkStruct_ov21_021E51DC *param0, UnkStruct_ov21_021E4D90 *param1) { - int v0 = ov21_021D37BC(param1->unk_04); + int species = Pokedex_Sort_CurrentSpecies(param1->unk_04); if (sub_0200598C() == 0) { param0->unk_68--; if (param0->unk_68 == 0) { - ov21_021E5DE8(param0, param1, v0); + ov21_021E5DE8(param0, param1, species); param0->unk_68 = 10; } } @@ -1375,7 +1375,7 @@ static void ov21_021E5F38(UnkStruct_ov21_021E5004 *param0, const UnkStruct_ov21_ static void ov21_021E5F5C(UnkStruct_ov21_021E51DC *param0, UnkStruct_ov21_021E4D90 *param1) { - int v0 = ov21_021D37BC(param1->unk_04); + int species = Pokedex_Sort_CurrentSpecies(param1->unk_04); if (gCoreSys.pressedKeys & PAD_BUTTON_A) { param0->unk_28 = 1; @@ -1387,10 +1387,10 @@ static void ov21_021E5F5C(UnkStruct_ov21_021E51DC *param0, UnkStruct_ov21_021E4D sub_0200592C(0); } - ov21_021E5DE8(param0, param1, v0); + ov21_021E5DE8(param0, param1, species); } else { if (param0->unk_2C == 0) { - ov21_021E5DE8(param0, param1, v0); + ov21_021E5DE8(param0, param1, species); } else { ov21_021E5E18(param0); } diff --git a/src/overlay021/ov21_021E6014.c b/src/overlay021/ov21_021E6014.c index 3d121b4e01..37254ea03f 100644 --- a/src/overlay021/ov21_021E6014.c +++ b/src/overlay021/ov21_021E6014.c @@ -8,7 +8,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/ov21_021E29DC.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" @@ -35,7 +35,7 @@ typedef struct { int *unk_00; - UnkStruct_ov21_021D3320 *unk_04; + pokedexStruct *pokedexS; UnkStruct_ov21_021E68F4 *unk_08; } UnkStruct_ov21_021E6104; @@ -126,7 +126,7 @@ static UnkStruct_ov21_021E6104 *ov21_021E608C(int param0, UnkStruct_ov21_021D0F6 memset(v0, 0, sizeof(UnkStruct_ov21_021E6104)); v0->unk_00 = ov21_021D138C(param1); - v0->unk_04 = ov21_021D13EC(param1); + v0->pokedexS = ov21_021D13EC(param1); v0->unk_08 = ov21_021D1410(param1, 5); return v0; @@ -178,7 +178,7 @@ static int ov21_021E6134(UnkStruct_ov21_021E6A68 *param0, void *param1) UnkStruct_ov21_021E6104 *v0 = param1; UnkStruct_ov21_021E6134 *v1; - v1 = Heap_AllocFromHeap(param0->unk_04, sizeof(UnkStruct_ov21_021E6134)); + v1 = Heap_AllocFromHeap(param0->heapID, sizeof(UnkStruct_ov21_021E6134)); GF_ASSERT(v1); memset(v1, 0, sizeof(UnkStruct_ov21_021E6134)); @@ -224,12 +224,12 @@ static int ov21_021E617C(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo switch (param1->unk_00) { case 0: - param1->unk_08 = Heap_AllocFromHeap(param1->unk_04, sizeof(UnkStruct_ov21_021E6274)); + param1->unk_08 = Heap_AllocFromHeap(param1->heapID, sizeof(UnkStruct_ov21_021E6274)); memset(param1->unk_08, 0, sizeof(UnkStruct_ov21_021E6274)); param1->unk_00++; break; case 1: - ov21_021E6338(v3, v2, v0, v1, param1->unk_04); + ov21_021E6338(v3, v2, v0, v1, param1->heapID); ov21_021E628C(v3, v2, v0, 1); param1->unk_00++; break; @@ -408,7 +408,7 @@ static void ov21_021E6518(UnkStruct_ov21_021E6274 *param0, UnkStruct_ov21_021E61 VecFx32 v3; short v4; short v5; - int v6 = ov21_021D37BC(param2->unk_04); + int species = Pokedex_Sort_CurrentSpecies(param2->pokedexS); sub_020093B4(&v0, 93 + 7000, 14 + 7000, 91 + 7000, 92 + 7000, 0xffffffff, 0xffffffff, 0, 1, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); @@ -418,15 +418,15 @@ static void ov21_021E6518(UnkStruct_ov21_021E6274 *param0, UnkStruct_ov21_021E61 v1.vramType = NNS_G2D_VRAM_TYPE_2DMAIN; v1.heapID = param3; - v4 = Pokedex_HeightWeightData_TrainerPos(param2->unk_04->unk_1748, v6); - v5 = Pokedex_HeightWeightData_TrainerScale(param2->unk_04->unk_1748, v6); + v4 = Pokedex_HeightWeightData_TrainerPos(param2->pokedexS->HWData, species); + v5 = Pokedex_HeightWeightData_TrainerScale(param2->pokedexS->HWData, species); v1.position.x = 168 << FX32_SHIFT; v1.position.y = (88 + v4) << FX32_SHIFT; param0->unk_10 = CellActorCollection_Add(&v1); - if (ov21_021D3920(param2->unk_04) == 0) { + if (Pokedex_Sort_TrainerGender(param2->pokedexS) == 0) { CellActor_SetAnim(param0->unk_10, 5); } else { CellActor_SetAnim(param0->unk_10, 6); @@ -474,14 +474,14 @@ static void ov21_021E6600(UnkStruct_ov21_021E6118 *param0, int param1) static void ov21_021E66B0(UnkStruct_ov21_021E6118 *param0, const UnkStruct_ov21_021E6104 *param1, int param2) { Strbuf *v0 = Strbuf_Init(32, param2); - int v2 = ov21_021D37BC(param1->unk_04); - Strbuf *v3 = MessageUtil_SpeciesName(v2, param2); + int species = Pokedex_Sort_CurrentSpecies(param1->pokedexS); + Strbuf *v3 = MessageUtil_SpeciesName(species, param2); int heightMessageBankIndex = Height_Message_Bank_Index(); MessageLoader *v1 = MessageLoader_Init(0, 26, heightMessageBankIndex, param2); sub_0201D78C(¶m0->unk_00->unk_04, 0, v3, 26, 152, 0, ((u32)(((2 & 0xff) << 16) | ((1 & 0xff) << 8) | ((0 & 0xff) << 0))), NULL); - MessageLoader_GetStrbuf(v1, v2, v0); + MessageLoader_GetStrbuf(v1, species, v0); { u32 v5 = 32 + 78 - sub_02002D7C(0, v0, 0); @@ -493,9 +493,9 @@ static void ov21_021E66B0(UnkStruct_ov21_021E6118 *param0, const UnkStruct_ov21_ v1 = MessageLoader_Init(0, 26, 697, param2); - sub_0201D78C(¶m0->unk_00->unk_04, 0, ov21_021D3914(param1->unk_04), 146, 152, 0, ((u32)(((2 & 0xff) << 16) | ((1 & 0xff) << 8) | ((0 & 0xff) << 0))), NULL); + sub_0201D78C(¶m0->unk_00->unk_04, 0, Pokedex_Sort_TrainerName(param1->pokedexS), 146, 152, 0, ((u32)(((2 & 0xff) << 16) | ((1 & 0xff) << 8) | ((0 & 0xff) << 0))), NULL); - if (ov21_021D3920(param1->unk_04) == 0) { + if (Pokedex_Sort_TrainerGender(param1->pokedexS) == 0) { MessageLoader_GetStrbuf(v1, 95, v0); } else { MessageLoader_GetStrbuf(v1, 96, v0); @@ -515,12 +515,12 @@ static void ov21_021E67C8(UnkStruct_ov21_021E6118 *param0, const UnkStruct_ov21_ Sprite *v0 = ov21_021D2170(param0->unk_00); short v1; short v2; - int v3 = ov21_021D37BC(param1->unk_04); + int species = Pokedex_Sort_CurrentSpecies(param1->pokedexS); - v1 = Pokedex_HeightWeightData_PokemonPos(param1->unk_04->unk_1748, v3); - v2 = Pokedex_HeightWeightData_PokemonScale(param1->unk_04->unk_1748, v3); + v1 = Pokedex_HeightWeightData_PokemonPos(param1->pokedexS->HWData, species); + v2 = Pokedex_HeightWeightData_PokemonScale(param1->pokedexS->HWData, species); - ov21_021D1890(param0->unk_00, param1->unk_04, v3, 2, 88, 88 + v1); + ov21_021D1890(param0->unk_00, param1->pokedexS, species, 2, 88, 88 + v1); sub_02007DEC(v0, 6, 0); sub_020086FC(v0, 15, 15, 0, 0); diff --git a/src/overlay021/ov21_021E68F4.c b/src/overlay021/ov21_021E68F4.c index 6781a40974..b6e3a2f8c2 100644 --- a/src/overlay021/ov21_021E68F4.c +++ b/src/overlay021/ov21_021E68F4.c @@ -9,7 +9,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/ov21_021D4340.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021E29DC.h" @@ -41,7 +41,7 @@ typedef struct { int *unk_00; int unk_04; - UnkStruct_ov21_021D3320 *unk_08; + pokedexStruct *unk_08; UnkStruct_ov21_021E68F4 *unk_0C; } UnkStruct_ov21_021E6A20; @@ -219,7 +219,7 @@ static int ov21_021E6A6C(UnkStruct_ov21_021E6A68 *param0, void *param1) UnkStruct_ov21_021E6DAC *v1 = param0->unk_08; int v2; - v1 = Heap_AllocFromHeap(param0->unk_04, sizeof(UnkStruct_ov21_021E6DAC)); + v1 = Heap_AllocFromHeap(param0->heapID, sizeof(UnkStruct_ov21_021E6DAC)); memset(v1, 0, sizeof(UnkStruct_ov21_021E6DAC)); for (v2 = 0; v2 < 2; v2++) { @@ -228,7 +228,7 @@ static int ov21_021E6A6C(UnkStruct_ov21_021E6A68 *param0, void *param1) v0->unk_04 = 0; - ov21_021E6D58(v1, v0, param0->unk_04); + ov21_021E6D58(v1, v0, param0->heapID); ov21_021E6DBC(v1, v0); param0->unk_08 = v1; @@ -282,12 +282,12 @@ static int ov21_021E6B20(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo switch (param1->unk_00) { case 0: - param1->unk_08 = Heap_AllocFromHeap(param1->unk_04, sizeof(UnkStruct_ov21_021E6C60)); + param1->unk_08 = Heap_AllocFromHeap(param1->heapID, sizeof(UnkStruct_ov21_021E6C60)); memset(param1->unk_08, 0, sizeof(UnkStruct_ov21_021E6C60)); param1->unk_00++; break; case 1: - ov21_021E6E64(v3, v2, param1->unk_04); + ov21_021E6E64(v3, v2, param1->heapID); ov21_021E6CB0(v3, v2, v0, 1); param1->unk_00++; break; @@ -314,7 +314,7 @@ static int ov21_021E6BA8(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo UnkStruct_ov21_021E6C60 *v3 = param1->unk_08; if (ov21_021E33AC(v0->unk_0C)) { - ov21_021E728C(v3, v2, v1, param1->unk_04); + ov21_021E728C(v3, v2, v1, param1->heapID); ov21_021E732C(v2, v0); } @@ -340,7 +340,7 @@ static int ov21_021E6BD8(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo } break; case 2: - ov21_021E6E94(v3, v2, param1->unk_04); + ov21_021E6E94(v3, v2, param1->heapID); param1->unk_00++; break; case 3: diff --git a/src/overlay021/ov21_021E737C.c b/src/overlay021/ov21_021E737C.c index e2fea27435..62d9236b58 100644 --- a/src/overlay021/ov21_021E737C.c +++ b/src/overlay021/ov21_021E737C.c @@ -10,7 +10,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/ov21_021E29DC.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" @@ -53,7 +53,7 @@ typedef struct { } UnkStruct_ov21_021E9DB0; typedef struct { - UnkStruct_ov21_021D3320 *unk_00; + pokedexStruct *unk_00; UnkStruct_ov21_021E68F4 *unk_04; } UnkStruct_ov21_021E7468; @@ -276,18 +276,18 @@ static int ov21_021E74A0(UnkStruct_ov21_021E6A68 *param0, void *param1) UnkStruct_ov21_021E74A0 *v1; int v2; int v3; - int v4; + int species; - v1 = Heap_AllocFromHeap(param0->unk_04, sizeof(UnkStruct_ov21_021E74A0)); + v1 = Heap_AllocFromHeap(param0->heapID, sizeof(UnkStruct_ov21_021E74A0)); GF_ASSERT(v1); memset(v1, 0, sizeof(UnkStruct_ov21_021E74A0)); param0->unk_08 = v1; - v4 = ov21_021D37BC(v0->unk_00); - v2 = Pokedex_HeightWeightData_Weight(v0->unk_00->unk_1748, v4); + species = Pokedex_Sort_CurrentSpecies(v0->unk_00); + v2 = Pokedex_HeightWeightData_Weight(v0->unk_00->HWData, species); - if (ov21_021D3920(v0->unk_00) == 0) { + if (Pokedex_Sort_TrainerGender(v0->unk_00) == 0) { v3 = 380; } else { v3 = 340; @@ -340,14 +340,14 @@ static int ov21_021E7530(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo switch (param1->unk_00) { case 0: - param1->unk_08 = Heap_AllocFromHeap(param1->unk_04, sizeof(UnkStruct_ov21_021E7714)); + param1->unk_08 = Heap_AllocFromHeap(param1->heapID, sizeof(UnkStruct_ov21_021E7714)); memset(param1->unk_08, 0, sizeof(UnkStruct_ov21_021E7714)); v3 = param1->unk_08; v3->unk_B8 = 1; param1->unk_00++; break; case 1: - ov21_021E7800(v3, v2, v0, v1, param1->unk_04); + ov21_021E7800(v3, v2, v0, v1, param1->heapID); ov21_021E771C(v3, v2, v0, 1); param1->unk_00++; break; @@ -548,15 +548,15 @@ static void ov21_021E7904(UnkStruct_ov21_021E7714 *param0, UnkStruct_ov21_021E74 { UnkStruct_ov21_021D13FC *v0 = param1->unk_00; int v1, v2, v3, v4; - int v5 = ov21_021D37BC(param2->unk_00); + int species = Pokedex_Sort_CurrentSpecies(param2->unk_00); BOOL v6; NARC *v7 = ov21_021D26E0(param1->unk_00); int v8; NARC *v9; v9 = NARC_ctor(NARC_INDEX_POKETOOL__ICONGRA__PL_POKE_ICON, param3); - v8 = ov21_021D33D4(param2->unk_00, v5); - v1 = PokeIconSpriteIndex(v5, 0, v8); + v8 = ov21_021D33D4(param2->unk_00, species);// lasthere + v1 = PokeIconSpriteIndex(species, 0, v8); v2 = PokeIconPalettesFileIndex(); v3 = PokeIconCellsFileIndex(); v4 = PokeIconAnimationFileIndex(); @@ -628,8 +628,8 @@ static void ov21_021E7B34(UnkStruct_ov21_021E7714 *param0, UnkStruct_ov21_021E74 VecFx32 v3; short v4; short v5; - int v6 = ov21_021D37BC(param2->unk_00); - int v7 = ov21_021D33D4(param2->unk_00, v6); + int species = Pokedex_Sort_CurrentSpecies(param2->unk_00); + int v7 = ov21_021D33D4(param2->unk_00, species); sub_020093B4(&v0, 93 + 7000, 14 + 7000, 91 + 7000, 92 + 7000, 0xffffffff, 0xffffffff, 0, 3, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); @@ -643,7 +643,7 @@ static void ov21_021E7B34(UnkStruct_ov21_021E7714 *param0, UnkStruct_ov21_021E74 param0->unk_00 = CellActorCollection_Add(&v1); - if (ov21_021D3920(param2->unk_00) == 0) { + if (Pokedex_Sort_TrainerGender(param2->unk_00) == 0) { CellActor_SetAnim(param0->unk_00, 3); } else { CellActor_SetAnim(param0->unk_00, 4); @@ -680,7 +680,7 @@ static void ov21_021E7B34(UnkStruct_ov21_021E7714 *param0, UnkStruct_ov21_021E74 v1.position.y = 64 << FX32_SHIFT; param0->unk_04 = CellActorCollection_Add(&v1); - CellActor_SetExplicitPaletteWithOffset(param0->unk_04, PokeIconPaletteIndex(v6, v7, 0)); + CellActor_SetExplicitPaletteWithOffset(param0->unk_04, PokeIconPaletteIndex(species, v7, 0)); } static void ov21_021E7CCC(UnkStruct_ov21_021E7714 *param0) @@ -722,17 +722,17 @@ static void ov21_021E7CF8(UnkStruct_ov21_021E747C *param0, int param1) MessageLoader_Free(v1); } -static void ov21_021E7DA8(UnkStruct_ov21_021E747C *param0, const UnkStruct_ov21_021E7468 *param1, int param2) +static void ov21_021E7DA8(UnkStruct_ov21_021E747C *param0, const UnkStruct_ov21_021E7468 *param1, int heapID) { - Strbuf *v0 = Strbuf_Init(32, param2); - int v2 = ov21_021D37BC(param1->unk_00); - Strbuf *v3 = MessageUtil_SpeciesName(v2, param2); + Strbuf *v0 = Strbuf_Init(32, heapID); + int species = Pokedex_Sort_CurrentSpecies(param1->unk_00); + Strbuf *v3 = MessageUtil_SpeciesName(species, heapID); int weightMessageBankIndex = Weight_Message_Bank_Index(); - MessageLoader *v1 = MessageLoader_Init(0, 26, weightMessageBankIndex, param2); + MessageLoader *v1 = MessageLoader_Init(0, 26, weightMessageBankIndex, heapID); sub_0201D78C(¶m0->unk_00->unk_04, 0, v3, 26, 152, 0, ((u32)(((2 & 0xff) << 16) | ((1 & 0xff) << 8) | ((0 & 0xff) << 0))), NULL); - MessageLoader_GetStrbuf(v1, v2, v0); + MessageLoader_GetStrbuf(v1, species, v0); { u32 v5 = 32 + 78 - sub_02002D7C(0, v0, 0); @@ -742,11 +742,11 @@ static void ov21_021E7DA8(UnkStruct_ov21_021E747C *param0, const UnkStruct_ov21_ Strbuf_Free(v3); MessageLoader_Free(v1); - v1 = MessageLoader_Init(0, 26, 697, param2); + v1 = MessageLoader_Init(0, 26, 697, heapID); - sub_0201D78C(¶m0->unk_00->unk_04, 0, ov21_021D3914(param1->unk_00), 146, 152, 0, ((u32)(((2 & 0xff) << 16) | ((1 & 0xff) << 8) | ((0 & 0xff) << 0))), NULL); + sub_0201D78C(¶m0->unk_00->unk_04, 0, Pokedex_Sort_TrainerName(param1->unk_00), 146, 152, 0, ((u32)(((2 & 0xff) << 16) | ((1 & 0xff) << 8) | ((0 & 0xff) << 0))), NULL); - if (ov21_021D3920(param1->unk_00) == 0) { + if (Pokedex_Sort_TrainerGender(param1->unk_00) == 0) { MessageLoader_GetStrbuf(v1, 97, v0); } else { MessageLoader_GetStrbuf(v1, 98, v0); diff --git a/src/overlay021/ov21_021E8484.c b/src/overlay021/ov21_021E8484.c index 46e3d893ff..940b181e43 100644 --- a/src/overlay021/ov21_021E8484.c +++ b/src/overlay021/ov21_021E8484.c @@ -9,7 +9,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021DF734.h" #include "overlay021/ov21_021E29DC.h" @@ -39,7 +39,7 @@ typedef struct { int *unk_00; - UnkStruct_ov21_021D3320 *unk_04; + pokedexStruct *unk_04; UnkStruct_ov21_021E68F4 *unk_08; UnkStruct_ov21_021E68F4 *unk_0C; } UnkStruct_ov21_021E8570; @@ -204,14 +204,14 @@ static int ov21_021E85A0(UnkStruct_ov21_021E6A68 *param0, void *param1) UnkStruct_ov21_021E88B0 *v1 = param0->unk_08; int v2; - v1 = Heap_AllocFromHeap(param0->unk_04, sizeof(UnkStruct_ov21_021E88B0)); + v1 = Heap_AllocFromHeap(param0->heapID, sizeof(UnkStruct_ov21_021E88B0)); memset(v1, 0, sizeof(UnkStruct_ov21_021E88B0)); for (v2 = 0; v2 < 1; v2++) { v1->unk_10[v2] = (3 + 1); } - ov21_021E886C(v1, v0, param0->unk_04); + ov21_021E886C(v1, v0, param0->heapID); ov21_021E88B8(v1, v0); param0->unk_08 = v1; @@ -270,12 +270,12 @@ static int ov21_021E8654(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo switch (param1->unk_00) { case 0: - param1->unk_08 = Heap_AllocFromHeap(param1->unk_04, sizeof(UnkStruct_ov21_021E8794)); + param1->unk_08 = Heap_AllocFromHeap(param1->heapID, sizeof(UnkStruct_ov21_021E8794)); memset(param1->unk_08, 0, sizeof(UnkStruct_ov21_021E8794)); param1->unk_00++; break; case 1: - ov21_021E891C(v3, v2, param1->unk_04); + ov21_021E891C(v3, v2, param1->heapID); ov21_021E87C4(v3, v2, v0, 1); param1->unk_00++; break; @@ -302,7 +302,7 @@ static int ov21_021E86DC(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo UnkStruct_ov21_021E8794 *v3 = param1->unk_08; if (ov21_021E33AC(v0->unk_08)) { - ov21_021E8CBC(v2, v3, v1, param1->unk_04); + ov21_021E8CBC(v2, v3, v1, param1->heapID); ov21_021E8D04(v2, v0); } @@ -328,7 +328,7 @@ static int ov21_021E870C(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo } break; case 2: - ov21_021E894C(v3, v2, param1->unk_04); + ov21_021E894C(v3, v2, param1->heapID); param1->unk_00++; break; case 3: diff --git a/src/overlay021/pokedex_sort.c b/src/overlay021/pokedex_sort.c new file mode 100644 index 0000000000..f4a0608513 --- /dev/null +++ b/src/overlay021/pokedex_sort.c @@ -0,0 +1,956 @@ +#include "overlay021/pokedex_sort.h" + +#include +#include + +#include "struct_decls/pokedexdata_decl.h" + +#include "overlay021/struct_ov21_021D3208.h" +#include "overlay021/struct_ov21_021D3320.h" +#include "overlay021/struct_ov21_021D37DC.h" +#include "overlay021/struct_ov21_021D3A60.h" + +#include "core_sys.h" +#include "heap.h" +#include "narc.h" +#include "pokedex_data_index.h" +#include "pokedex_heightweight.h" +#include "strbuf.h" +#include "trainer_info.h" +#include "unk_02006E3C.h" +#include "unk_0202631C.h" + +static void Pokedex_Sort_Encountered(u16 *pokedexPreFilterArray, int *numEncountered, const PokedexData *dexData, const u16 *speciesArray, int pokedexLength); +static void Pokedex_Sort_Caught(u16 *param0, int *param1, const u16 *param2, int param3, const u16 *param4, int param5, BOOL param6, const PokedexData *dexData); +static void Pokedex_Sort_CaughtStatus(pokedexCompletionStruct *pokedexCompletion, const PokedexData *param1, const u16 *param2, int param3); +static void Pokedex_Sort_IndentifyEnountered_Full(pokedexCompletionStruct *pokedexCompletion, const u16 *param1, int param2); +static void Pokedex_Sort_IndentifyEnountered_Filtered(pokedexCompletionStruct *pokedexCompletion); +static void Pokedex_Sort_NumSeenNCaught(pokedexCompletionStruct *pokedexCompletion, int *numEncountered, int *numCaught); +static u16 *Pokedex_Sort_SortedArray(int heapID, int pokedexSort, int *pokedexLength); +static void Pokedex_Sort_Order(int sortCategory, u16 *pokedexPostFilterArray, int *dexLengthPostFilter, const u16 *param3, int dexLengthPreFilter, int heapID, const PokedexData *dexData); +static void Pokedex_Sort_FilterFirstLetter(int firstLetterFilter, u16 *pokedexPostFilterArray, int *dexLengthPostFilter, const u16 *pokedexPreFilterArray, int numEncountered, int heapID, const PokedexData *dexData); +static void Pokedex_Sort_FilterType(int typeFilter, u16 *param1, int *param2, const u16 *param3, int dexLengthPreFilter, int heapID, const PokedexData *dexData); +static void Pokedex_Sort_FilterBodyShape(int bodyShapeFilter, u16 *param1, int *param2, const u16 *param3, int dexLengthPreFilter, int heapID, const PokedexData *dexData); + +void Pokedex_Sort_PopulatePokedexStruct(pokedexStruct *pokedexS, UnkStruct_ov21_021D3208 *param1, int heapID) +{ + int sortCategory; + int firstLetterFilter; + int typeFilter1; + int typeFilter2; + int bodyShapeFilter; + BOOL dexExists; + u32 isNationalDex; + + memset(pokedexS, 0, sizeof(pokedexStruct)); + + pokedexS->dexData = param1->dexData; + pokedexS->timeOfDay = param1->timeOfDay; + + if (Pokedex_NationalUnlocked(pokedexS->dexData)) { + pokedexS->nationalDexUnlocked = 1; + } else { + pokedexS->nationalDexUnlocked = 0; + } + + if (param1->unk_20 == 2) { + if (pokedexS->nationalDexUnlocked) { + isNationalDex = 1; + } else { + isNationalDex = 0; + } + } else { + isNationalDex = param1->unk_20; + } + + if (isNationalDex == 1) { + pokedexS->isNationalDex = 1; + sortCategory = 0; + firstLetterFilter = 0; + typeFilter1 = 0; + typeFilter2 = 0; + bodyShapeFilter = 0; + } else { + pokedexS->isNationalDex = 0; + sortCategory = 0; + firstLetterFilter = 0; + typeFilter1 = 0; + typeFilter2 = 0; + bodyShapeFilter = 0; + } + + dexExists = Pokedex_Sort_Unfiltered(pokedexS, sortCategory, firstLetterFilter, typeFilter1, typeFilter2, bodyShapeFilter, pokedexS->isNationalDex, heapID); + + GF_ASSERT(dexExists); + + ov21_021D3794(pokedexS, param1->unk_1C); + ov21_021D3434(pokedexS, param1->unk_1C); + ov21_021D344C(pokedexS, param1->unk_20); + + pokedexS->TrainerGameCode = TrainerInfo_GameCode(param1->unk_04); + pokedexS->TrainerGender = TrainerInfo_Gender(param1->unk_04); + pokedexS->trainerName = TrainerInfo_NameNewStrbuf(param1->unk_04, heapID); + pokedexS->HWData = Pokedex_HeightWeightData(heapID); + + if (pokedexS->TrainerGender == 0) { + Pokedex_HeightWeightData_Load(pokedexS->HWData, 0, heapID); + } else { + Pokedex_HeightWeightData_Load(pokedexS->HWData, 1, heapID); + } + + pokedexS->pokedexSFlag_1 = param1->pokedexSFlag_1; + pokedexS->pokedexSFlag_2 = param1->pokedexSFlag_2; + pokedexS->pokedexSFlag_3 = param1->pokedexSFlag_3; + pokedexS->pokedexSFlag_4 = param1->pokedexSFlag_4; +} + +void ov21_021D3320(pokedexStruct *pokedexS) +{ + Strbuf_Free(pokedexS->trainerName); + Pokedex_HeightWeightData_Release(pokedexS->HWData); + Pokedex_HeightWeightData_Free(pokedexS->HWData); + + pokedexS->HWData = NULL; +} + +u32 ov21_021D334C(const pokedexStruct *pokedexS, int param1, int param2) +{ + u32 v0; + + v0 = sub_02027058(pokedexS->dexData, param1, param2); + return v0; +} + +u32 ov21_021D335C(const pokedexStruct *pokedexS, int param1) +{ + int v0; + + GF_ASSERT(param1 < 28); + v0 = sub_020270AC(pokedexS->dexData, param1); + + return v0; +} + +u32 ov21_021D3374(const pokedexStruct *pokedexS, int param1) +{ + u32 v0; + + GF_ASSERT(param1 < 2); + v0 = sub_020270F8(pokedexS->dexData, param1); + + return v0; +} + +u32 ov21_021D338C(const pokedexStruct *pokedexS, int param1) +{ + u32 v0; + + GF_ASSERT(param1 < 2); + + v0 = sub_02027154(pokedexS->dexData, param1); + return v0; +} + +u32 ov21_021D33A4(const pokedexStruct *pokedexS, int param1) +{ + u32 v0; + + GF_ASSERT(param1 < 3); + + v0 = sub_020271B0(pokedexS->dexData, param1); + return v0; +} + +u32 ov21_021D33BC(const pokedexStruct *pokedexS, int param1) +{ + u32 v0; + + GF_ASSERT(param1 < 3); + + v0 = sub_02027208(pokedexS->dexData, param1); + return v0; +} + +u32 ov21_021D33D4(const pokedexStruct *pokedexS, u32 species) +{ + return sub_0202756C(pokedexS->dexData, species, 0); +} + +u32 ov21_021D33E0(const pokedexStruct *pokedexS, int param1) +{ + int v0 = ov21_021D334C(pokedexS, param1, 1); + + if (v0 == -1) { + return 1; + } + + return 2; +} + +u32 ov21_021D33F8(const pokedexStruct *pokedexS) +{ + return sub_0202702C(pokedexS->dexData, 0); +} + +u32 ov21_021D3404(const pokedexStruct *pokedexS, int param1) +{ + return sub_02027264(pokedexS->dexData, param1); +} + +u32 ov21_021D3410(const pokedexStruct *pokedexS, u32 param1, int param2) +{ + return sub_0202756C(pokedexS->dexData, param1, param2); +} + +u32 ov21_021D341C(const pokedexStruct *pokedexS, u32 param1) +{ + return sub_020276C8(pokedexS->dexData, param1); +} + +BOOL Pokedex_Sort_PokedexUnlocked(const pokedexStruct *pokedexS) +{ + return Pokedex_NationalUnlocked(pokedexS->dexData); +} + +void ov21_021D3434(pokedexStruct *pokedexS, u32 param1) +{ + pokedexS->unk_175C = param1; +} + +u32 ov21_021D3440(const pokedexStruct *pokedexS) +{ + return pokedexS->unk_175C; +} + +void ov21_021D344C(pokedexStruct *pokedexS, u32 param1) +{ + pokedexS->unk_175E = param1; +} + +u32 ov21_021D3458(const pokedexStruct *pokedexS) +{ + return pokedexS->unk_175E; +} + +BOOL Pokedex_Sort(pokedexStruct *pokedexS, int sortCategory, int firstLetterFilter, int typeFilter1, int typeFilter2, int bodyShapeFilter, int isNationalDex, int heapID, BOOL isFiltered) +{ + u16 *pokedexPreFilterArray; + int dexLengthPreFilter; + u16 *pokedexPostFilterArray; + int dexLengthPostFilter; + u16 *pokedexArray; + int pokedexLength; + BOOL dexExists; + + pokedexPreFilterArray = Heap_AllocFromHeapAtEnd(heapID, sizeof(u16) * NATIONAL_DEX_COUNT); + + GF_ASSERT(pokedexPreFilterArray); + memset(pokedexPreFilterArray, 0, sizeof(u16) * NATIONAL_DEX_COUNT); + + dexLengthPreFilter = 0; + pokedexPostFilterArray = Heap_AllocFromHeapAtEnd(heapID, sizeof(u16) * NATIONAL_DEX_COUNT); + + GF_ASSERT(pokedexPostFilterArray); + memset(pokedexPostFilterArray, 0, sizeof(u16) * NATIONAL_DEX_COUNT); + + dexLengthPostFilter = 0; + + if (isNationalDex == 0) { + pokedexArray = Pokedex_Sort_SortedArray(heapID, 1, &pokedexLength); + Pokedex_Sort_Encountered(pokedexPreFilterArray, &dexLengthPreFilter, pokedexS->dexData, pokedexArray, pokedexLength); + } else { + pokedexArray = Pokedex_Sort_SortedArray(heapID, 0, &pokedexLength); + Pokedex_Sort_Encountered(pokedexPreFilterArray, &dexLengthPreFilter, pokedexS->dexData, pokedexArray, pokedexLength); + } + + Pokedex_Sort_Order(sortCategory, pokedexPostFilterArray, &dexLengthPostFilter, pokedexPreFilterArray, dexLengthPreFilter, heapID, pokedexS->dexData); + + memcpy(pokedexPreFilterArray, pokedexPostFilterArray, sizeof(u16) * dexLengthPostFilter); + dexLengthPreFilter = dexLengthPostFilter; + + memset(pokedexPostFilterArray, 0, sizeof(u16) * dexLengthPostFilter); + dexLengthPostFilter = 0; + + do { + Pokedex_Sort_FilterFirstLetter(firstLetterFilter, pokedexPostFilterArray, &dexLengthPostFilter, pokedexPreFilterArray, dexLengthPreFilter, heapID, pokedexS->dexData); + + if (dexLengthPostFilter == 0) { + dexExists = 0; + break; + } + + memcpy(pokedexPreFilterArray, pokedexPostFilterArray, sizeof(u16) * dexLengthPostFilter); + dexLengthPreFilter = dexLengthPostFilter; + + memset(pokedexPostFilterArray, 0, sizeof(u16) * dexLengthPostFilter); + dexLengthPostFilter = 0; + + Pokedex_Sort_FilterType(typeFilter1, pokedexPostFilterArray, &dexLengthPostFilter, pokedexPreFilterArray, dexLengthPreFilter, heapID, pokedexS->dexData); + + if (dexLengthPostFilter == 0) { + dexExists = 0; + break; + } + + memcpy(pokedexPreFilterArray, pokedexPostFilterArray, sizeof(u16) * dexLengthPostFilter); + dexLengthPreFilter = dexLengthPostFilter; + + memset(pokedexPostFilterArray, 0, sizeof(u16) * dexLengthPostFilter); + dexLengthPostFilter = 0; + + Pokedex_Sort_FilterType(typeFilter2, pokedexPostFilterArray, &dexLengthPostFilter, pokedexPreFilterArray, dexLengthPreFilter, heapID, pokedexS->dexData); + + if (dexLengthPostFilter == 0) { + dexExists = 0; + break; + } + + memcpy(pokedexPreFilterArray, pokedexPostFilterArray, sizeof(u16) * dexLengthPostFilter); + dexLengthPreFilter = dexLengthPostFilter; + + memset(pokedexPostFilterArray, 0, sizeof(u16) * dexLengthPostFilter); + dexLengthPostFilter = 0; + + Pokedex_Sort_FilterBodyShape(bodyShapeFilter, pokedexPostFilterArray, &dexLengthPostFilter, pokedexPreFilterArray, dexLengthPreFilter, heapID, pokedexS->dexData); + + if (dexLengthPostFilter == 0) { + dexExists = 0; + break; + } + + memcpy(pokedexPreFilterArray, pokedexPostFilterArray, sizeof(u16) * dexLengthPostFilter); + dexLengthPreFilter = dexLengthPostFilter; + + memset(pokedexPostFilterArray, 0, sizeof(u16) * dexLengthPostFilter); + dexLengthPostFilter = 0; + + Pokedex_Sort_CaughtStatus(&pokedexS->pokedexCompletion, pokedexS->dexData, pokedexPreFilterArray, dexLengthPreFilter); + + if ((sortCategory != 0) || (firstLetterFilter != 0) || (typeFilter1 != 0) || (typeFilter2 != 0) || (bodyShapeFilter != 0)) { + isFiltered = 1; + } + + if (isFiltered == 0) { + Pokedex_Sort_IndentifyEnountered_Full(&pokedexS->pokedexCompletion, pokedexArray, pokedexLength); + } else { + Pokedex_Sort_IndentifyEnountered_Filtered(&pokedexS->pokedexCompletion); + } + + dexExists = 1; + } while (0); + + Pokedex_Sort_NumSeenNCaught(&pokedexS->pokedexCompletion, &pokedexS->numEncountered, &pokedexS->numCaught); + + Heap_FreeToHeap(pokedexPreFilterArray); + Heap_FreeToHeap(pokedexPostFilterArray); + Heap_FreeToHeap(pokedexArray); + + return dexExists; +} + +BOOL Pokedex_Sort_Unfiltered(pokedexStruct *pokedexS, int sortCategory, int firstLetterFilter, int typeFilter1, int typeFilter2, int bodyShapeFilter, int isNationalDex, int heapID) +{ + return Pokedex_Sort(pokedexS, sortCategory, firstLetterFilter, typeFilter1, typeFilter2, bodyShapeFilter, isNationalDex, heapID, 0); +} + +BOOL ov21_021D36A4(const pokedexStruct *pokedexS, int param1) +{ + if (param1 == 0) { + return 1; + } + + if (pokedexS->nationalDexUnlocked) { + return 1; + } + + return 0; +} + +BOOL ov21_021D36C0(pokedexStruct *pokedexS, int param1) +{ + BOOL v0; + + v0 = ov21_021D36A4(pokedexS, param1); + + if (v0) { + pokedexS->isNationalDex = param1; + } + + return v0; +} + +int ov21_021D36D8(const pokedexStruct *pokedexS) +{ + return pokedexS->isNationalDex; +} + +BOOL Pokedex_Sort_IsValidDexIndex(const pokedexStruct *pokedexS, int dexIndex) +{ + if (((dexIndex) >= 0) && ((dexIndex) < pokedexS->pokedexCompletion.numEncountered)) { + return 1; + } + + return 0; +} + +BOOL ov21_021D36FC(pokedexStruct *pokedexS, int dexIndex) +{ + if (Pokedex_Sort_IsValidDexIndex(pokedexS, dexIndex)) { + pokedexS->pokedexCompletion.unk_F68 = dexIndex; + return 1; + } + + return 0; +} + +BOOL ov21_021D371C(pokedexStruct *pokedexS, int param1) +{ + if (Pokedex_Sort_IsValidDexIndex(pokedexS, pokedexS->pokedexCompletion.unk_F68 + param1)) { + pokedexS->pokedexCompletion.unk_F68 += param1; + return 1; + } + + if (param1 >= 0) { + pokedexS->pokedexCompletion.unk_F68 = pokedexS->pokedexCompletion.numEncountered - 1; + } else { + pokedexS->pokedexCompletion.unk_F68 = 0; + } + + return 0; +} + +int ov21_021D375C(const pokedexStruct *pokedexS) +{ + return pokedexS->pokedexCompletion.unk_F68; +} + +int Pokedex_Sort_CompletionNumEncountered(const pokedexStruct *pokedexS) +{ + return pokedexS->pokedexCompletion.numEncountered; +} + +int ov21_021D3770(const pokedexStruct *pokedexS, u32 param1) +{ + int index; + int numEncountered = Pokedex_Sort_CompletionNumEncountered(pokedexS); + int species; + + for (index = 0; index < numEncountered; index++) { + species = pokedexS->pokedexCompletion.caughtStatusArray[index].species; + + if (species == param1) { + break; + } + } + + return index; +} + +BOOL ov21_021D3794(pokedexStruct *pokedexS, int param1) +{ + u32 v0 = Pokedex_Sort_CompletionNumEncountered(pokedexS); + u32 v1 = ov21_021D3770(pokedexS, param1); + + if (v0 > v1) { + return ov21_021D36FC(pokedexS, v1); + } + + return 0; +} + +int Pokedex_Sort_CurrentSpecies(const pokedexStruct *pokedexS) +{ + return pokedexS->pokedexCompletion.caughtStatusArray[pokedexS->pokedexCompletion.unk_F68].species; +} + +int Pokedex_Sort_CurrentCaughtStatus(const pokedexStruct *pokedexS) +{ + return pokedexS->pokedexCompletion.caughtStatusArray[pokedexS->pokedexCompletion.unk_F68].caughtStatus; +} + +const speciesCaughtStatusStruct *Pokedex_Sort_SpeciesCaughtStatus(const pokedexStruct *pokedexS, int dexIndex) +{ + if (Pokedex_Sort_IsValidDexIndex(pokedexS, dexIndex)) { + return &pokedexS->pokedexCompletion.caughtStatusArray[dexIndex]; + } + + return NULL; +} + +BOOL ov21_021D37F8(const pokedexStruct *pokedexS, int param1) +{ + if ((pokedexS->pokedexCompletion.numSpecies > param1) && (param1 >= 0)) { + return 1; + } + + return 0; +} + +BOOL ov21_021D3810(pokedexStruct *pokedexS, int param1) +{ + if (ov21_021D37F8(pokedexS, param1)) { + pokedexS->pokedexCompletion.unk_1724 = param1; + + ov21_021D36FC(pokedexS, pokedexS->pokedexCompletion.encounteredIndexArray[pokedexS->pokedexCompletion.unk_1724]); + return 1; + } + + return 0; +} + +BOOL ov21_021D3844(pokedexStruct *pokedexS, int param1) +{ + if (ov21_021D387C(pokedexS, param1)) { + pokedexS->pokedexCompletion.unk_1724 += param1; + + ov21_021D36FC(pokedexS, pokedexS->pokedexCompletion.encounteredIndexArray[pokedexS->pokedexCompletion.unk_1724]); + return 1; + } + + return 0; +} + +BOOL ov21_021D387C(pokedexStruct *pokedexS, int param1) +{ + if (ov21_021D37F8(pokedexS, pokedexS->pokedexCompletion.unk_1724 + param1)) { + return 1; + } + + return 0; +} + +int ov21_021D3898(const pokedexStruct *pokedexS) +{ + return pokedexS->pokedexCompletion.unk_1724; +} + +int ov21_021D38A4(const pokedexStruct *pokedexS) +{ + return pokedexS->pokedexCompletion.numSpecies; +} + +int Pokedex_Sort_SeenIndexToSpecies(const pokedexStruct *pokedexS, int encounteredIndex) +{ + return pokedexS->pokedexCompletion.encounteredIndexArray[encounteredIndex]; +} + +void ov21_021D38C0(pokedexStruct *pokedexS) +{ + int v0; + + for (v0 = 0; v0 < pokedexS->pokedexCompletion.numSpecies; v0++) { + if (Pokedex_Sort_SeenIndexToSpecies(pokedexS, v0) == ov21_021D375C(pokedexS)) { + ov21_021D3810(pokedexS, v0); + break; + } + } +} + +int Pokedex_Sort_NumEncountered(const pokedexStruct *pokedexS) +{ + return pokedexS->numEncountered; +} + +int Pokedex_Sort_NumCaught(const pokedexStruct *pokedexS) +{ + return pokedexS->numCaught; +} + +Strbuf *Pokedex_Sort_TrainerName(const pokedexStruct *pokedexS) +{ + return pokedexS->trainerName; +} + +u32 Pokedex_Sort_TrainerGender(const pokedexStruct *pokedexS) +{ + return pokedexS->TrainerGender; +} + +BOOL ov21_021D392C(const pokedexStruct *pokedexS, int param1) +{ + int species = Pokedex_Sort_CurrentSpecies(pokedexS); + + if (sub_02027514(pokedexS->dexData) == 0) { + return 0; + } + + return sub_020274D0(pokedexS->dexData, species, param1); +} + +BOOL Pokedex_Sort_CanDetectForms(const pokedexStruct *pokedexS) +{ + return Pokedex_CanDetectForms(pokedexS->dexData); +} + +void ov21_021D3960(pokedexStruct *pokedexS) +{ + if (gCoreSys.touchHeld) { + pokedexS->unk_1758 = 0; + return; + } + + if (gCoreSys.pressedKeys) { + if (pokedexS->unk_1758 == 0) { + pokedexS->unk_1758 = 1; + } else { + pokedexS->unk_1758 = 2; + } + } +} + +u32 ov21_021D3998(const pokedexStruct *pokedexS) +{ + return pokedexS->unk_1758; +} + +static void Pokedex_Sort_Encountered(u16 *pokedexPreFilterArray, int *numEncountered, const PokedexData *dexData, const u16 *speciesArray, int pokedexLength) +{ + int index; + + *numEncountered = 0; + + for (index = 0; index < pokedexLength; index++) { + if (Pokedex_EncounteredSpecies(dexData, speciesArray[index])) { + pokedexPreFilterArray[*numEncountered] = speciesArray[index]; + (*numEncountered)++; + } + } +} + +static void Pokedex_Sort_Caught(u16 *param0, int *param1, const u16 *speciesArray, int param3, const u16 *param4, int param5, BOOL param6, const PokedexData *dexData) +{ + int v0, v1; + + *param1 = 0; + + for (v0 = 0; v0 < param3; v0++) { + for (v1 = 0; v1 < param5; v1++) { + if (speciesArray[v0] == param4[v1]) { + if (param6 == 1) { + break; + } else { + if (Pokedex_CaughtSpecies(dexData, speciesArray[v0])) { + break; + } + } + } + } + + if (v1 < param5) { + param0[*param1] = speciesArray[v0]; + (*param1)++; + } + } +} + +static void Pokedex_Sort_CaughtStatus(pokedexCompletionStruct *pokedexCompletion, const PokedexData *dexData, const u16 *speciesArray, int numEncountered) +{ + int index; + + pokedexCompletion->numEncountered = 0; + + for (index = 0; index < numEncountered; index++) { + if (Pokedex_CaughtSpecies(dexData, speciesArray[index])) { + pokedexCompletion->caughtStatusArray[pokedexCompletion->numEncountered].caughtStatus = 2; + } else { + pokedexCompletion->caughtStatusArray[pokedexCompletion->numEncountered].caughtStatus = 1; + } + + pokedexCompletion->caughtStatusArray[pokedexCompletion->numEncountered].species = speciesArray[index]; + pokedexCompletion->numEncountered++; + } +} + +static void Pokedex_Sort_IndentifyEnountered_Full(pokedexCompletionStruct *pokedexCompletion, const u16 *speciesArray, int pokedexLength) +{ + int dexIndex; + int encounteredIndex; + + encounteredIndex = 0; + pokedexCompletion->numSpecies = 0; + + for (dexIndex = 0; dexIndex < pokedexLength; dexIndex++) { + if (encounteredIndex < pokedexCompletion->numEncountered) { + if (pokedexCompletion->caughtStatusArray[encounteredIndex].species == speciesArray[dexIndex]) { + pokedexCompletion->encounteredIndexArray[pokedexCompletion->numSpecies] = encounteredIndex; + encounteredIndex++; + pokedexCompletion->numSpecies++; + } else { + pokedexCompletion->encounteredIndexArray[pokedexCompletion->numSpecies] = (NATIONAL_DEX_COUNT + 1); + pokedexCompletion->numSpecies++; + } + } + } +} + +static void Pokedex_Sort_IndentifyEnountered_Filtered(pokedexCompletionStruct *pokedexCompletion) +{ + int encounteredIndex; + + pokedexCompletion->numSpecies = 0; + + for (encounteredIndex = 0; encounteredIndex < pokedexCompletion->numEncountered; encounteredIndex++) { + pokedexCompletion->encounteredIndexArray[pokedexCompletion->numSpecies] = encounteredIndex; + pokedexCompletion->numSpecies++; + } +} + +static u16 *Pokedex_Sort_SortedArray(int heapID, int pokedexSort, int *pokedexLength) +{ + u32 pokedexSize; + u16 *pokedexSortedArray; + u32 pokedexDataNarcIndex; + + GF_ASSERT(47 > pokedexSort); + + pokedexDataNarcIndex = Pokedex_Data_NARC_Index(); + pokedexSortedArray = sub_02007068(pokedexDataNarcIndex, 11 + pokedexSort, 0, heapID, 0, &pokedexSize); + *pokedexLength = pokedexSize / (sizeof(u16)); + + return pokedexSortedArray; +} + +static void Pokedex_Sort_Order(int sortCategory, u16 *pokedexPostFilterArray, int *dexLengthPostFilter, const u16 *pokedexPreFilterArray, int dexLengthPreFilter, int heapID, const PokedexData *dexData) +{ + u16 *pokedexSortedArray; + int pokedexLength; + BOOL isAlphabetical = 0; + + switch (sortCategory) { + case 0: + pokedexSortedArray = NULL; + break; + case 1: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 2, &pokedexLength); // alphabetical + isAlphabetical = 1; + break; + case 2: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 3, &pokedexLength); // heaviest + break; + case 3: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 4, &pokedexLength); // lightest + break; + case 4: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 5, &pokedexLength); // tallest + break; + case 5: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 6, &pokedexLength); // shortest + break; + default: + GF_ASSERT(0); + break; + } + + if (pokedexSortedArray != NULL) { + Pokedex_Sort_Caught(pokedexPostFilterArray, dexLengthPostFilter, pokedexSortedArray, pokedexLength, pokedexPreFilterArray, dexLengthPreFilter, isAlphabetical, dexData); + Heap_FreeToHeap(pokedexSortedArray); + } else { + memcpy(pokedexPostFilterArray, pokedexPreFilterArray, (sizeof(u16)) * dexLengthPreFilter); + *dexLengthPostFilter = dexLengthPreFilter; + } +} + +static void Pokedex_Sort_FilterFirstLetter(int firstLetterFilter, u16 *pokedexPostFilterArray, int *dexLengthPostFilter, const u16 *pokedexPreFilterArray, int dexLengthPreFilter, int heapID, const PokedexData *dexData) +{ + u16 *pokedexSortedArray; + int pokedexLength; + + switch (firstLetterFilter) { + case 0: + pokedexSortedArray = NULL; + break; + case 1: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 7, &pokedexLength); // ABC + break; + case 2: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 8, &pokedexLength); // DEF + break; + case 3: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 9, &pokedexLength); // GHI + break; + case 4: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 10, &pokedexLength); // JKL + break; + case 5: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 11, &pokedexLength); // MNO + break; + case 6: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 12, &pokedexLength); // PQR + break; + case 7: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 13, &pokedexLength); // STU + break; + case 8: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 14, &pokedexLength); // VWX + break; + case 9: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 15, &pokedexLength); // YZ + break; + default: + GF_ASSERT(0); + break; + } + + if (pokedexSortedArray != NULL) { + Pokedex_Sort_Caught(pokedexPostFilterArray, dexLengthPostFilter, pokedexPreFilterArray, dexLengthPreFilter, pokedexSortedArray, pokedexLength, 1, dexData); + Heap_FreeToHeap(pokedexSortedArray); + } else { + memcpy(pokedexPostFilterArray, pokedexPreFilterArray, (sizeof(u16)) * dexLengthPreFilter); + *dexLengthPostFilter = dexLengthPreFilter; + } +} + +static void Pokedex_Sort_FilterType(int typeFilter, u16 *param1, int *param2, const u16 *param3, int dexLengthPreFilter, int heapID, const PokedexData *dexData) +{ + u16 *pokedexSortedArray; + int pokedexLength; + + switch (typeFilter) { + case 0: + pokedexSortedArray = NULL; + break; + case 1: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 16, &pokedexLength); // normal + break; + case 2: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 17, &pokedexLength); // fighting + break; + case 3: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 18, &pokedexLength); // flying + break; + case 4: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 19, &pokedexLength); // poison + break; + case 5: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 20, &pokedexLength); // ground + break; + case 6: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 21, &pokedexLength); // rock + break; + case 7: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 22, &pokedexLength); // bug + break; + case 8: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 23, &pokedexLength); // ghost + break; + case 9: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 24, &pokedexLength); // steel + break; + case 10: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 25, &pokedexLength); // fire + break; + case 11: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 26, &pokedexLength); // water + break; + case 12: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 27, &pokedexLength); // grass + break; + case 13: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 28, &pokedexLength); // electric + break; + case 14: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 29, &pokedexLength); // psychic + break; + case 15: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 30, &pokedexLength); // ice + break; + case 16: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 31, &pokedexLength); // dragon + break; + case 17: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 32, &pokedexLength); // dark + break; + default: + GF_ASSERT(0); + break; + } + + if (pokedexSortedArray != NULL) { + Pokedex_Sort_Caught(param1, param2, param3, dexLengthPreFilter, pokedexSortedArray, pokedexLength, 0, dexData); + Heap_FreeToHeap(pokedexSortedArray); + } else { + memcpy(param1, param3, (sizeof(u16)) * dexLengthPreFilter); + *param2 = dexLengthPreFilter; + } +} + +static void Pokedex_Sort_FilterBodyShape(int bodyShapeFilter, u16 *param1, int *param2, const u16 *param3, int dexLengthPreFilter, int heapID, const PokedexData *dexData) +{ + u16 *pokedexSortedArray; + int pokedexLength; + + switch (bodyShapeFilter) { + case 0: + pokedexSortedArray = NULL; + break; + case 1: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 33, &pokedexLength); // quadruped + break; + case 2: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 34, &pokedexLength); // bidedal tailless + break; + case 3: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 35, &pokedexLength); // bipedal tailed + break; + case 4: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 36, &pokedexLength); // serpentine + break; + case 5: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 37, &pokedexLength); // multi winged + break; + case 6: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 38, &pokedexLength); // winged + break; + case 7: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 39, &pokedexLength); // insectoid + break; + case 8: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 40, &pokedexLength); // head base + break; + case 9: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 41, &pokedexLength); // head arms + break; + case 10: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 42, &pokedexLength); // head legs + break; + case 11: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 43, &pokedexLength); // tentacles + break; + case 12: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 44, &pokedexLength); // fins + break; + case 13: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 45, &pokedexLength); // head + break; + case 14: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 46, &pokedexLength); // multi-body + break; + default: + GF_ASSERT(0); + break; + } + + if (pokedexSortedArray != NULL) { + Pokedex_Sort_Caught(param1, param2, param3, dexLengthPreFilter, pokedexSortedArray, pokedexLength, 1, dexData); + Heap_FreeToHeap(pokedexSortedArray); + } else { + memcpy(param1, param3, (sizeof(u16)) * dexLengthPreFilter); + *param2 = dexLengthPreFilter; + } +} + +static void Pokedex_Sort_NumSeenNCaught(pokedexCompletionStruct *pokedexCompletion, int *numEncountered, int *numCaught) +{ + int index; + + *numEncountered = 0; + *numCaught = 0; + + for (index = 0; index < pokedexCompletion->numEncountered; index++) { + if (pokedexCompletion->caughtStatusArray[index].caughtStatus == 2) { + (*numCaught)++; + } + + (*numEncountered)++; + } +} diff --git a/src/overlay023/ov23_0223E140.c b/src/overlay023/ov23_0223E140.c index 3188c44e23..343d140f4b 100644 --- a/src/overlay023/ov23_0223E140.c +++ b/src/overlay023/ov23_0223E140.c @@ -1786,7 +1786,7 @@ static int ov23_0223F970(UnkStruct_ov23_02256EB0 *param0) SaveData *v0 = FieldSystem_SaveData(Unk_ov23_02257740->fieldSystem); UndergroundData *v1 = sub_020298B0(v0); BOOL v2 = TrainerInfo_ID(SaveData_GetTrainerInfo(v0)) % 2; - BOOL v3 = sub_02027474(SaveData_Pokedex(v0)); + BOOL v3 = Pokedex_NationalUnlocked(SaveData_Pokedex(v0)); int v4 = 0; if (v3) { diff --git a/src/overlay023/ov23_022521F0.c b/src/overlay023/ov23_022521F0.c index ec4ac1d02b..c887b7daff 100644 --- a/src/overlay023/ov23_022521F0.c +++ b/src/overlay023/ov23_022521F0.c @@ -136,7 +136,7 @@ static void ov23_022522F0(UnkStruct_ov23_02250CD4 *param0, int param1) int v1, v2, v3, v4, v5; SaveData *v6 = FieldSystem_SaveData(param0->fieldSystem); UndergroundData *v7 = sub_020298B0(v6); - BOOL v8 = sub_02027474(SaveData_Pokedex(v6)); + BOOL v8 = Pokedex_NationalUnlocked(SaveData_Pokedex(v6)); MATH_InitRand16(&v0, sub_02028930(v7) + param1); diff --git a/src/overlay028/ov28_022561C0.c b/src/overlay028/ov28_022561C0.c index 2e9f32b169..63e46cf6ce 100644 --- a/src/overlay028/ov28_022561C0.c +++ b/src/overlay028/ov28_022561C0.c @@ -637,13 +637,13 @@ static void ov28_02256914(UnkStruct_ov28_02256210 *param0, const UnkStruct_ov28_ v1 = SaveData_Pokedex(PoketchSystem_GetSaveData(param0->poketchSys)); - if (sub_02027474(v1)) { + if (Pokedex_NationalUnlocked(v1)) { v2 = v0; } else { v2 = Pokemon_NationalDexNumber((u16)v0); } - if (((v2 > 0) && (v2 <= NATIONAL_DEX_COUNT)) && sub_02026FE8(v1, v2)) { + if (((v2 > 0) && (v2 <= NATIONAL_DEX_COUNT)) && Pokedex_EncounteredSpecies(v1, v2)) { ov25_02254444(v2, 0); } } diff --git a/src/overlay062/ov62_02237D24.c b/src/overlay062/ov62_02237D24.c index ebdeac638f..3a8ed0b385 100644 --- a/src/overlay062/ov62_02237D24.c +++ b/src/overlay062/ov62_02237D24.c @@ -1647,7 +1647,7 @@ static BOOL ov62_02239984 (UnkStruct_0208C06C * param0, int param1) PokedexData * v10 = SaveData_Pokedex(param0->unk_830); for (v7 = v3; v7 < v4; v7++) { - v9 = sub_02026FE8(v10, v1[v7]); + v9 = Pokedex_EncounteredSpecies(v10, v1[v7]); if (v9 == 0) { v1[v7] = 0xFFFF; @@ -1693,7 +1693,7 @@ static void ov62_02239A0C (UnkStruct_0208C06C * param0, int param1) v4->unk_1D4.unk_00 = 0; for (v5 = v2; v5 < v3; v5++) { - v7 = sub_02026FE8(v8, v0[v5]); + v7 = Pokedex_EncounteredSpecies(v8, v0[v5]); if (v7 == 0) { v0[v5] = 0xFFFF; diff --git a/src/overlay062/ov62_02241204.c b/src/overlay062/ov62_02241204.c index f4d7191e34..93266377b6 100644 --- a/src/overlay062/ov62_02241204.c +++ b/src/overlay062/ov62_02241204.c @@ -1522,7 +1522,7 @@ static BOOL ov62_02242748 (UnkStruct_0208C06C * param0, int param1) PokedexData * v10 = SaveData_Pokedex(param0->unk_830); for (v7 = v3; v7 < v4; v7++) { - v9 = sub_02026FE8(v10, v1[v7]); + v9 = Pokedex_EncounteredSpecies(v10, v1[v7]); if (v9 == 0) { v1[v7] = 0xFFFF; @@ -1568,7 +1568,7 @@ static void ov62_022427D0 (UnkStruct_0208C06C * param0, int param1) v4->unk_4C8.unk_00 = 0; for (v5 = v2; v5 < v3; v5++) { - v7 = sub_02026FE8(v8, v0[v5]); + v7 = Pokedex_EncounteredSpecies(v8, v0[v5]); if (v7 == 0) { v0[v5] = 0xFFFF; diff --git a/src/overlay065/ov65_0222DCE0.c b/src/overlay065/ov65_0222DCE0.c index 3298669303..5112a264c1 100644 --- a/src/overlay065/ov65_0222DCE0.c +++ b/src/overlay065/ov65_0222DCE0.c @@ -1823,7 +1823,7 @@ static void ov65_0222F4C4 (UnkStruct_ov65_0222EBE0 * param0, int param1) param0->unk_04->unk_00.unk_18 = TrainerInfo_GameCode(v0); param0->unk_04->unk_00.unk_19 = TrainerInfo_RegionCode(v0); - param0->unk_04->unk_00.unk_1A = sub_02027474(v1); + param0->unk_04->unk_00.unk_1A = Pokedex_NationalUnlocked(v1); param0->unk_04->unk_00.unk_1B = 29; ov65_02232E70(param0, param1); diff --git a/src/overlay066/ov66_0222DDF0.c b/src/overlay066/ov66_0222DDF0.c index c8125b96c0..c41d24a085 100644 --- a/src/overlay066/ov66_0222DDF0.c +++ b/src/overlay066/ov66_0222DDF0.c @@ -2360,7 +2360,7 @@ static void ov66_0222F7C8(UnkStruct_ov66_0222F6C4 *param0, SaveData *param1, u32 param0->unk_20.unk_3A = ov66_02230C0C(param0->unk_20.unk_3A); param0->unk_20.unk_3C = sub_0202C8C0(v2); param0->unk_20.unk_3E = sub_0202C8C4(v2); - param0->unk_20.unk_3F = sub_02027474(v3); + param0->unk_20.unk_3F = Pokedex_NationalUnlocked(v3); param0->unk_20.unk_40 = TrainerInfo_IsMainStoryCleared(v0); param0->unk_20.unk_41 = 0xff; param0->unk_20.unk_43 = 0; diff --git a/src/overlay094/ov94_022414B8.c b/src/overlay094/ov94_022414B8.c index d3bf16e626..fdbf782e8c 100644 --- a/src/overlay094/ov94_022414B8.c +++ b/src/overlay094/ov94_022414B8.c @@ -1141,12 +1141,12 @@ static int ov94_02242718(ResourceMetadata **param0, MessageLoader *param1, Messa for (v0 = 0; v0 < v3; v0++) { if (v4) { - if (sub_02026FE8(param7, param3[v1 + v0])) { + if (Pokedex_EncounteredSpecies(param7, param3[v1 + v0])) { v2++; } } else { if (param4[param3[v1 + v0]]) { - if (sub_02026FE8(param7, param3[v1 + v0])) { + if (Pokedex_EncounteredSpecies(param7, param3[v1 + v0])) { v2++; } } @@ -1157,12 +1157,12 @@ static int ov94_02242718(ResourceMetadata **param0, MessageLoader *param1, Messa for (v0 = 0; v0 < v3; v0++) { if (v4) { - if (sub_02026FE8(param7, param3[v1 + v0])) { + if (Pokedex_EncounteredSpecies(param7, param3[v1 + v0])) { sub_02013A4C(*param0, param1, param3[v1 + v0], param3[v1 + v0]); } } else { if (param4[param3[v1 + v0]]) { - if (sub_02026FE8(param7, param3[v1 + v0])) { + if (Pokedex_EncounteredSpecies(param7, param3[v1 + v0])) { sub_02013A4C(*param0, param1, param3[v1 + v0], param3[v1 + v0]); } } diff --git a/src/overlay097/ov97_0222AE60.c b/src/overlay097/ov97_0222AE60.c index e5154ef844..d216796b1b 100644 --- a/src/overlay097/ov97_0222AE60.c +++ b/src/overlay097/ov97_0222AE60.c @@ -244,7 +244,7 @@ static void ov97_0222AF1C(UnkStruct_0222AE60 *param0) sub_02017B70(v0); - if (sub_02027474(param0->unk_08) == 0) { + if (Pokedex_NationalUnlocked(param0->unk_08) == 0) { return; } diff --git a/src/pokedex_heightweight.c b/src/pokedex_heightweight.c index e72f0a8c64..9278659eb9 100644 --- a/src/pokedex_heightweight.c +++ b/src/pokedex_heightweight.c @@ -86,46 +86,46 @@ void Pokedex_HeightWeightData_Release(HeightWeightData *HWData) HWData->pokemonScale = NULL; } -int Pokedex_HeightWeightData_Height(const HeightWeightData *HWData, int dexNumber) +int Pokedex_HeightWeightData_Height(const HeightWeightData *HWData, int species) { GF_ASSERT(HWData); GF_ASSERT(HWData->height); - return HWData->height[dexNumber]; + return HWData->height[species]; } -int Pokedex_HeightWeightData_Weight(const HeightWeightData *HWData, int dexNumber) +int Pokedex_HeightWeightData_Weight(const HeightWeightData *HWData, int species) { GF_ASSERT(HWData); GF_ASSERT(HWData->weight); - return HWData->weight[dexNumber]; + return HWData->weight[species]; } -short Pokedex_HeightWeightData_TrainerPos(const HeightWeightData *HWData, int dexNumber) +short Pokedex_HeightWeightData_TrainerPos(const HeightWeightData *HWData, int species) { GF_ASSERT(HWData); GF_ASSERT(HWData->trainerPos); - return HWData->trainerPos[dexNumber]; + return HWData->trainerPos[species]; } -short Pokedex_HeightWeightData_PokemonPos(const HeightWeightData *HWData, int dexNumber) +short Pokedex_HeightWeightData_PokemonPos(const HeightWeightData *HWData, int species) { GF_ASSERT(HWData); GF_ASSERT(HWData->pokemonPos); - return HWData->pokemonPos[dexNumber]; + return HWData->pokemonPos[species]; } -short Pokedex_HeightWeightData_TrainerScale(const HeightWeightData *HWData, int dexNumber) +short Pokedex_HeightWeightData_TrainerScale(const HeightWeightData *HWData, int species) { GF_ASSERT(HWData); GF_ASSERT(HWData->trainerScale); - return HWData->trainerScale[dexNumber]; + return HWData->trainerScale[species]; } -short Pokedex_HeightWeightData_PokemonScale(const HeightWeightData *HWData, int dexNumber) +short Pokedex_HeightWeightData_PokemonScale(const HeightWeightData *HWData, int species) { GF_ASSERT(HWData); GF_ASSERT(HWData->pokemonScale); - return HWData->pokemonScale[dexNumber]; + return HWData->pokemonScale[species]; } static int *Pokedex_Height_Array(NARC *pokedexDataNARC, int param1) diff --git a/src/scrcmd.c b/src/scrcmd.c index 12bb22eecf..d51ee84e00 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -6489,7 +6489,7 @@ static BOOL ScrCmd_218(ScriptContext *ctx) *v1 = 25; for (v4 = 1, v5 = 0; v4 <= NATIONAL_DEX_COUNT; v4++) { - if ((sub_02026FE8(v0, v4) == 1) && (Pokemon_SinnohDexNumber(v4) != 0)) { + if ((Pokedex_EncounteredSpecies(v0, v4) == 1) && (Pokemon_SinnohDexNumber(v4) != 0)) { if (v5 == v3) { *v1 = v4; break; @@ -6585,7 +6585,7 @@ static BOOL ScrCmd_22B(ScriptContext *ctx) static BOOL ScrCmd_22C(ScriptContext *ctx) { - sub_020274B0(SaveData_Pokedex(ctx->fieldSystem->saveData)); + Pokedex_CanDetectForms_True(SaveData_Pokedex(ctx->fieldSystem->saveData)); return 0; } @@ -6600,7 +6600,7 @@ static BOOL ScrCmd_22D(ScriptContext *ctx) sub_02027454(SaveData_Pokedex(ctx->fieldSystem->saveData)); TrainerInfo_GiveNationalDex(SaveData_GetTrainerInfo(ctx->fieldSystem->saveData)); } else if (v0 == 2) { - *v1 = sub_02027474(SaveData_Pokedex(ctx->fieldSystem->saveData)); + *v1 = Pokedex_NationalUnlocked(SaveData_Pokedex(ctx->fieldSystem->saveData)); } else { GF_ASSERT(FALSE); } diff --git a/src/unk_0202631C.c b/src/unk_0202631C.c index 3ed47e0d67..348ad635fa 100644 --- a/src/unk_0202631C.c +++ b/src/unk_0202631C.c @@ -55,19 +55,19 @@ PokedexData *sub_02026324(u32 param0) return v0; } -void sub_02026338(const PokedexData *param0, PokedexData *param1) +void sub_02026338(const PokedexData *dexData, PokedexData *param1) { - MI_CpuCopy8(param0, param1, sizeof(PokedexData)); + MI_CpuCopy8(dexData, param1, sizeof(PokedexData)); } -static inline void CheckPokedexIntegrity(const PokedexData *param0) +static inline void CheckPokedexIntegrity(const PokedexData *dexData) { - GF_ASSERT(param0->magic == 3203386110); + GF_ASSERT(dexData->magic == 3203386110); } -static BOOL sub_02026344(u16 param0) +static BOOL Pokedex_InvalidSpecies(u16 species) { - if ((param0 == 0) || (param0 > NATIONAL_DEX_COUNT)) { + if ((species == 0) || (species > NATIONAL_DEX_COUNT)) { GF_ASSERT(0); return 1; } else { @@ -110,26 +110,26 @@ static inline void inline_020267B8(u8 *param0, u8 param1, u16 param2) param0[param2 >> 2] |= param1 << ((param2 & 3) * 2); } -static inline void inline_0202736C(PokedexData *param0, u16 param1) +static inline void Write_SeenSpecies(PokedexData *dexData, u16 species) { - WriteBit((u8 *)param0->seenPokemon, param1); + WriteBit((u8 *)dexData->seenPokemon, species); } -static inline void inline_sub_0202736C_1(PokedexData *param0, u16 param1) +static inline void Write_CaughtSpecies(PokedexData *dexData, u16 species) { - WriteBit((u8 *)param0->caughtPokemon, param1); + WriteBit((u8 *)dexData->caughtPokemon, species); } -static void sub_02026360(PokedexData *param0, u8 param1, u8 param2, u16 param3) +static void sub_02026360(PokedexData *dexData, u8 param1, u8 param2, u16 param3) { if (param2 == 0) { - inline_02026360((u8 *)param0->recordedGenders[1], param1, param3); + inline_02026360((u8 *)dexData->recordedGenders[1], param1, param3); } - inline_02026360((u8 *)param0->recordedGenders[param2], param1, param3); + inline_02026360((u8 *)dexData->recordedGenders[param2], param1, param3); } -static void sub_020263D8(PokedexData *param0, u8 param1, u8 param2, u16 param3) +static void sub_020263D8(PokedexData *dexData, u8 param1, u8 param2, u16 param3) { GF_ASSERT(param1 <= 2); @@ -137,37 +137,37 @@ static void sub_020263D8(PokedexData *param0, u8 param1, u8 param2, u16 param3) param1 = 0; } - sub_02026360(param0, param1, param2, param3); + sub_02026360(dexData, param1, param2, param3); } -static inline BOOL inline_02026FE8(const PokedexData *param0, u16 param1) +static inline BOOL Read_SeenSpecies(const PokedexData *dexData, u16 species) { - return ReadBit((const u8 *)param0->seenPokemon, param1); + return ReadBit((const u8 *)dexData->seenPokemon, species); } -static inline BOOL inline_02026F9C(const PokedexData *param0, u16 param1) +static inline BOOL Read_CaughtSpecies(const PokedexData *dexData, u16 species) { - return ReadBit((const u8 *)param0->caughtPokemon, param1); + return ReadBit((const u8 *)dexData->caughtPokemon, species); } -static inline u8 inline_02026BAC(const PokedexData *param0, u16 param1, u8 param2) +static inline u8 inline_02026BAC(const PokedexData *dexData, u16 param1, u8 param2) { - return ReadBit((const u8 *)param0->recordedGenders[param2], param1); + return ReadBit((const u8 *)dexData->recordedGenders[param2], param1); } -static inline void inline_0202736C_1(PokedexData *param0, u16 param1, u32 param2) +static inline void inline_0202736C_1(PokedexData *dexData, u16 param1, u32 param2) { if (param1 == 327) { - param0->unk_104 = param2; + dexData->unk_104 = param2; } } -static int sub_02026400(const PokedexData *param0) +static int sub_02026400(const PokedexData *dexData) { int v0; for (v0 = 0; v0 < UNOWN_COUNT; v0++) { - if (param0->unk_10C[v0] == 0xff) { + if (dexData->unk_10C[v0] == 0xff) { break; } } @@ -175,12 +175,12 @@ static int sub_02026400(const PokedexData *param0) return v0; } -static BOOL sub_02026418(const PokedexData *param0, u8 param1) +static BOOL sub_02026418(const PokedexData *dexData, u8 param1) { int v0; for (v0 = 0; v0 < UNOWN_COUNT; v0++) { - if (param0->unk_10C[v0] == param1) { + if (dexData->unk_10C[v0] == param1) { return 1; } } @@ -188,22 +188,22 @@ static BOOL sub_02026418(const PokedexData *param0, u8 param1) return 0; } -static void sub_0202643C(PokedexData *param0, int param1) +static void sub_0202643C(PokedexData *dexData, int param1) { int v0; - if (sub_02026418(param0, param1)) { + if (sub_02026418(dexData, param1)) { return; } - v0 = sub_02026400(param0); + v0 = sub_02026400(dexData); if (v0 < UNOWN_COUNT) { - param0->unk_10C[v0] = param1; + dexData->unk_10C[v0] = param1; } } -static int sub_02026464(const PokedexData *param0, u32 param1) +static int sub_02026464(const PokedexData *dexData, u32 param1) { u32 v0; u32 v1; @@ -211,22 +211,22 @@ static int sub_02026464(const PokedexData *param0, u32 param1) GF_ASSERT((param1 == 422) || (param1 == 423) || (param1 == 492) || (param1 == 487)); - if (sub_02026FE8(param0, param1) == 0) { + if (Pokedex_EncounteredSpecies(dexData, param1) == 0) { return 0; } switch (param1) { case 422: - v2 = ¶m0->unk_108; + v2 = &dexData->unk_108; break; case 423: - v2 = ¶m0->unk_109; + v2 = &dexData->unk_109; break; case 492: - v2 = ¶m0->unk_320; + v2 = &dexData->unk_320; break; case 487: - v2 = ¶m0->unk_321; + v2 = &dexData->unk_321; break; } @@ -240,7 +240,7 @@ static int sub_02026464(const PokedexData *param0, u32 param1) return 2; } -static BOOL sub_02026514(const PokedexData *param0, u32 param1, u8 param2) +static BOOL sub_02026514(const PokedexData *dexData, u32 param1, u8 param2) { u32 v0; u32 v1; @@ -249,26 +249,26 @@ static BOOL sub_02026514(const PokedexData *param0, u32 param1, u8 param2) GF_ASSERT((param1 == 422) || (param1 == 423) || (param1 == 492) || (param1 == 487)); - if (sub_02026FE8(param0, param1) == 0) { + if (Pokedex_EncounteredSpecies(dexData, param1) == 0) { return 0; } switch (param1) { case 422: - v3 = ¶m0->unk_108; + v3 = &dexData->unk_108; break; case 423: - v3 = ¶m0->unk_109; + v3 = &dexData->unk_109; break; case 492: - v3 = ¶m0->unk_320; + v3 = &dexData->unk_320; break; case 487: - v3 = ¶m0->unk_321; + v3 = &dexData->unk_321; break; } - v2 = sub_02026464(param0, param1); + v2 = sub_02026464(dexData, param1); for (v1 = 0; v1 < v2; v1++) { v0 = ReadBit(v3, v1 + 1); @@ -281,33 +281,33 @@ static BOOL sub_02026514(const PokedexData *param0, u32 param1, u8 param2) return 0; } -static void sub_020265E8(PokedexData *param0, u32 param1, int param2) +static void sub_020265E8(PokedexData *dexData, u32 param1, int param2) { int v0; u8 *v1; GF_ASSERT((param1 == 422) || (param1 == 423) || (param1 == 492) || (param1 == 487)); - if (sub_02026514(param0, param1, param2)) { + if (sub_02026514(dexData, param1, param2)) { return; } switch (param1) { case 422: - v1 = ¶m0->unk_108; + v1 = &dexData->unk_108; break; case 423: - v1 = ¶m0->unk_109; + v1 = &dexData->unk_109; break; case 492: - v1 = ¶m0->unk_320; + v1 = &dexData->unk_320; break; case 487: - v1 = ¶m0->unk_321; + v1 = &dexData->unk_321; break; } - v0 = sub_02026464(param0, param1); + v0 = sub_02026464(dexData, param1); if (v0 < 2) { inline_02026360(v1, param2, v0 + 1); @@ -318,7 +318,7 @@ static void sub_020265E8(PokedexData *param0, u32 param1, int param2) } } -static int sub_020266F8(const PokedexData *param0, u32 param1) +static int sub_020266F8(const PokedexData *dexData, u32 param1) { u32 v0; int v1; @@ -326,14 +326,14 @@ static int sub_020266F8(const PokedexData *param0, u32 param1) GF_ASSERT((param1 == 412) || (param1 == 413)); - if (sub_02026FE8(param0, param1) == 0) { + if (Pokedex_EncounteredSpecies(dexData, param1) == 0) { return 0; } if (param1 == 412) { - v2 = ¶m0->unk_10A; + v2 = &dexData->unk_10A; } else { - v2 = ¶m0->unk_10B; + v2 = &dexData->unk_10B; } for (v1 = 0; v1 < 3; v1++) { @@ -347,7 +347,7 @@ static int sub_020266F8(const PokedexData *param0, u32 param1) return v1; } -static BOOL sub_02026754(const PokedexData *param0, u32 param1, u8 param2) +static BOOL sub_02026754(const PokedexData *dexData, u32 param1, u8 param2) { u32 v0; int v1; @@ -355,14 +355,14 @@ static BOOL sub_02026754(const PokedexData *param0, u32 param1, u8 param2) GF_ASSERT((param1 == 412) || (param1 == 413)); - if (sub_02026FE8(param0, param1) == 0) { + if (Pokedex_EncounteredSpecies(dexData, param1) == 0) { return 0; } if (param1 == 412) { - v2 = ¶m0->unk_10A; + v2 = &dexData->unk_10A; } else { - v2 = ¶m0->unk_10B; + v2 = &dexData->unk_10B; } for (v1 = 0; v1 < 3; v1++) { @@ -376,24 +376,24 @@ static BOOL sub_02026754(const PokedexData *param0, u32 param1, u8 param2) return 0; } -static void sub_020267B8(PokedexData *param0, u32 param1, int param2) +static void sub_020267B8(PokedexData *dexData, u32 param1, int param2) { int v0; u8 *v1; GF_ASSERT((param1 == 412) || (param1 == 413)); - if (sub_02026754(param0, param1, param2)) { + if (sub_02026754(dexData, param1, param2)) { return; } if (param1 == 412) { - v1 = ¶m0->unk_10A; + v1 = &dexData->unk_10A; } else { - v1 = ¶m0->unk_10B; + v1 = &dexData->unk_10B; } - v0 = sub_020266F8(param0, param1); + v0 = sub_020266F8(dexData, param1); if (v0 < 3) { inline_020267B8(v1, param2, v0); @@ -409,15 +409,15 @@ static void sub_02026834(u32 *param0, u8 param1, u8 param2) param0[16 - 1] |= (param1 << v0); } -static void sub_02026850(PokedexData *param0, u8 param1, u8 param2) +static void sub_02026850(PokedexData *dexData, u8 param1, u8 param2) { GF_ASSERT(param2 < 4); GF_ASSERT(param1 <= 15); if (param2 < 2) { - sub_02026834(param0->caughtPokemon, param1, param2); + sub_02026834(dexData->caughtPokemon, param1, param2); } else { - sub_02026834(param0->seenPokemon, param1, param2 - 2); + sub_02026834(dexData->seenPokemon, param1, param2 - 2); } } @@ -429,25 +429,25 @@ static inline u32 inline_0202688C(const u32 *param0, u8 param1) return v1; } -static u32 sub_0202688C(const PokedexData *param0, u8 param1) +static u32 sub_0202688C(const PokedexData *dexData, u8 param1) { u32 v0; if (param1 < 2) { - v0 = inline_0202688C(param0->caughtPokemon, param1); + v0 = inline_0202688C(dexData->caughtPokemon, param1); } else { - v0 = inline_0202688C(param0->seenPokemon, param1 - 2); + v0 = inline_0202688C(dexData->seenPokemon, param1 - 2); } return v0; } -static u32 sub_020268B8(const PokedexData *param0) +static u32 sub_020268B8(const PokedexData *dexData) { int v0; for (v0 = 0; v0 < 4; v0++) { - if (sub_0202688C(param0, v0) == 15) { + if (sub_0202688C(dexData, v0) == 15) { break; } } @@ -455,12 +455,12 @@ static u32 sub_020268B8(const PokedexData *param0) return v0; } -static BOOL sub_020268D8(const PokedexData *param0, u32 param1) +static BOOL sub_020268D8(const PokedexData *dexData, u32 param1) { int v0; for (v0 = 0; v0 < 4; v0++) { - if (sub_0202688C(param0, v0) == param1) { + if (sub_0202688C(dexData, v0) == param1) { return 1; } } @@ -468,25 +468,25 @@ static BOOL sub_020268D8(const PokedexData *param0, u32 param1) return 0; } -static void sub_020268FC(PokedexData *param0, u16 param1, Pokemon *param2) +static void sub_020268FC(PokedexData *dexData, u16 param1, Pokemon *param2) { u8 v0 = Pokemon_GetValue(param2, MON_DATA_FORM, NULL); u32 v1; if (param1 == 386) { - if (sub_020268D8(param0, v0) == 0) { - v1 = sub_020268B8(param0); - sub_02026850(param0, v0, v1); + if (sub_020268D8(dexData, v0) == 0) { + v1 = sub_020268B8(dexData); + sub_02026850(dexData, v0, v1); } } } -static void sub_0202693C(PokedexData *param0) +static void sub_0202693C(PokedexData *dexData) { int v0; for (v0 = 0; v0 < 4; v0++) { - sub_02026850(param0, 0xf, v0); + sub_02026850(dexData, 0xf, v0); } } @@ -503,21 +503,21 @@ static inline void inline_02026A00(u32 *param0, u32 param1, u32 param2) (*param0) |= (param2 << (param1 * 3)); } -static int sub_02026958(const PokedexData *param0, u32 param1) +static int sub_02026958(const PokedexData *dexData, u32 param1) { u32 v0; int v1, v2; GF_ASSERT(param1 == 479); - if (sub_02026FE8(param0, param1) == 0) { + if (Pokedex_EncounteredSpecies(dexData, param1) == 0) { return 0; } v2 = 0; for (v1 = 0; v1 < 6; v1++) { - v0 = inline_02026958(param0->unk_31C, v1); + v0 = inline_02026958(dexData->unk_31C, v1); if (v0 != 0x7) { v2++; @@ -529,7 +529,7 @@ static int sub_02026958(const PokedexData *param0, u32 param1) return v2; } -static BOOL sub_020269A4(const PokedexData *param0, u32 param1, u8 param2) +static BOOL sub_020269A4(const PokedexData *dexData, u32 param1, u8 param2) { int v0; u32 v1; @@ -537,14 +537,14 @@ static BOOL sub_020269A4(const PokedexData *param0, u32 param1, u8 param2) GF_ASSERT(param1 == 479); - if (sub_02026FE8(param0, param1) == 0) { + if (Pokedex_EncounteredSpecies(dexData, param1) == 0) { return 0; } - v1 = sub_02026958(param0, param1); + v1 = sub_02026958(dexData, param1); for (v0 = 0; v0 < v1; v0++) { - v2 = inline_02026958(param0->unk_31C, v0); + v2 = inline_02026958(dexData->unk_31C, v0); if (v2 == param2) { return 1; @@ -554,69 +554,69 @@ static BOOL sub_020269A4(const PokedexData *param0, u32 param1, u8 param2) return 0; } -static void sub_02026A00(PokedexData *param0, u32 param1, int param2) +static void sub_02026A00(PokedexData *dexData, u32 param1, int param2) { int v0; GF_ASSERT(param1 == 479); - if (sub_020269A4(param0, param1, param2)) { + if (sub_020269A4(dexData, param1, param2)) { return; } - v0 = sub_02026958(param0, param1); + v0 = sub_02026958(dexData, param1); if (v0 < 6) { - inline_02026A00(¶m0->unk_31C, v0, param2); + inline_02026A00(&dexData->unk_31C, v0, param2); } } -static void sub_02026A60(PokedexData *param0, u16 param1, Pokemon *param2) +static void sub_02026A60(PokedexData *dexData, u16 param1, Pokemon *param2) { int v0; switch (param1) { case 201: v0 = Pokemon_GetForm(param2); - sub_0202643C(param0, v0); + sub_0202643C(dexData, v0); break; case 412: v0 = Pokemon_GetValue(param2, MON_DATA_FORM, NULL); - sub_020267B8(param0, param1, v0); + sub_020267B8(dexData, param1, v0); break; case 413: v0 = Pokemon_GetValue(param2, MON_DATA_FORM, NULL); - sub_020267B8(param0, param1, v0); + sub_020267B8(dexData, param1, v0); break; case 422: v0 = Pokemon_GetValue(param2, MON_DATA_FORM, NULL); - sub_020265E8(param0, param1, v0); + sub_020265E8(dexData, param1, v0); break; case 423: v0 = Pokemon_GetValue(param2, MON_DATA_FORM, NULL); - sub_020265E8(param0, param1, v0); + sub_020265E8(dexData, param1, v0); break; case 386: - sub_020268FC(param0, param1, param2); + sub_020268FC(dexData, param1, param2); break; case 492: v0 = Pokemon_GetValue(param2, MON_DATA_FORM, NULL); - sub_020265E8(param0, param1, v0); + sub_020265E8(dexData, param1, v0); break; case 487: v0 = Pokemon_GetValue(param2, MON_DATA_FORM, NULL); - sub_020265E8(param0, param1, v0); + sub_020265E8(dexData, param1, v0); break; case 479: v0 = Pokemon_GetValue(param2, MON_DATA_FORM, NULL); - sub_02026A00(param0, param1, v0); + sub_02026A00(dexData, param1, v0); break; default: break; } } -static void sub_02026B88(PokedexData *param0, u16 param1, u32 param2) +static void sub_02026B88(PokedexData *dexData, u16 param1, u32 param2) { int v0; int v1; @@ -628,10 +628,10 @@ static void sub_02026B88(PokedexData *param0, u16 param1, u32 param2) return; } - param0->recordedLanguages[v0] |= 1 << v1; + dexData->recordedLanguages[v0] |= 1 << v1; } -static u32 sub_02026BAC(const PokedexData *param0, u16 param1, int param2) +static u32 sub_02026BAC(const PokedexData *dexData, u16 param1, int param2) { u32 v0, v1; u32 v2; @@ -644,10 +644,10 @@ static u32 sub_02026BAC(const PokedexData *param0, u16 param1, int param2) } } - v0 = inline_02026BAC(param0, param1, 0); + v0 = inline_02026BAC(dexData, param1, 0); if (param2 == 1) { - v1 = inline_02026BAC(param0, param1, 1); + v1 = inline_02026BAC(dexData, param1, 1); if (v1 == v0) { v2 = -1; @@ -661,12 +661,12 @@ static u32 sub_02026BAC(const PokedexData *param0, u16 param1, int param2) return v2; } -static inline int inline_020270AC(const PokedexData *param0, int param1) +static inline int inline_020270AC(const PokedexData *dexData, int param1) { - return param0->unk_10C[param1]; + return dexData->unk_10C[param1]; } -static int sub_02026C24(const PokedexData *param0, u32 param1, int param2) +static int sub_02026C24(const PokedexData *dexData, u32 param1, int param2) { const u8 *v0; @@ -675,31 +675,31 @@ static int sub_02026C24(const PokedexData *param0, u32 param1, int param2) switch (param1) { case 422: - v0 = ¶m0->unk_108; + v0 = &dexData->unk_108; break; case 423: - v0 = ¶m0->unk_109; + v0 = &dexData->unk_109; break; case 492: - v0 = ¶m0->unk_320; + v0 = &dexData->unk_320; break; case 487: - v0 = ¶m0->unk_321; + v0 = &dexData->unk_321; break; } return ReadBit(v0, param2 + 1); } -static int sub_02026CCC(const PokedexData *param0, u32 param1, int param2) +static int sub_02026CCC(const PokedexData *dexData, u32 param1, int param2) { GF_ASSERT(param1 == 479); GF_ASSERT(param2 < 6); - return inline_02026958(param0->unk_31C, param2); + return inline_02026958(dexData->unk_31C, param2); } -static int sub_02026CFC(const PokedexData *param0, u32 param1, int param2) +static int sub_02026CFC(const PokedexData *dexData, u32 param1, int param2) { const u8 *v0; @@ -707,9 +707,9 @@ static int sub_02026CFC(const PokedexData *param0, u32 param1, int param2) GF_ASSERT(param2 < 3); if (param1 == 412) { - v0 = ¶m0->unk_10A; + v0 = &dexData->unk_10A; } else { - v0 = ¶m0->unk_10B; + v0 = &dexData->unk_10B; } return inline_020266F8(v0, param2); @@ -749,36 +749,36 @@ static BOOL sub_02026D68(u16 param0) return 1; } -void Pokedex_Init(PokedexData *param0) +void Pokedex_Init(PokedexData *dexData) { - memset(param0, 0, sizeof(PokedexData)); + memset(dexData, 0, sizeof(PokedexData)); - param0->magic = 3203386110; - param0->nationalDexObtained = FALSE; + dexData->magic = 3203386110; + dexData->nationalDexObtained = FALSE; - memset(param0->unk_10C, 0xff, sizeof(u8) * UNOWN_COUNT); + memset(dexData->unk_10C, 0xff, sizeof(u8) * UNOWN_COUNT); - param0->unk_108 = 0xff; - param0->unk_109 = 0xff; - param0->unk_10A = 0xff; - param0->unk_10B = 0xff; - param0->unk_31C = 0xffffffff; - param0->unk_320 = 0xff; - param0->unk_321 = 0xff; + dexData->unk_108 = 0xff; + dexData->unk_109 = 0xff; + dexData->unk_10A = 0xff; + dexData->unk_10B = 0xff; + dexData->unk_31C = 0xffffffff; + dexData->unk_320 = 0xff; + dexData->unk_321 = 0xff; - sub_0202693C(param0); + sub_0202693C(dexData); } -u16 sub_02026DD0(const PokedexData *param0) +u16 sub_02026DD0(const PokedexData *dexData) { int v0; int v1; - CheckPokedexIntegrity(param0); + CheckPokedexIntegrity(dexData); v1 = 0; for (v0 = 1; v0 <= NATIONAL_DEX_COUNT; v0++) { - if (Pokedex_CaughtSpecies(param0, v0) == 1) { + if (Pokedex_CaughtSpecies(dexData, v0) == 1) { v1++; } } @@ -786,16 +786,16 @@ u16 sub_02026DD0(const PokedexData *param0) return v1; } -u16 sub_02026E0C(const PokedexData *param0) +u16 sub_02026E0C(const PokedexData *dexData) { int v0; int v1; - CheckPokedexIntegrity(param0); + CheckPokedexIntegrity(dexData); v1 = 0; for (v0 = 1; v0 <= NATIONAL_DEX_COUNT; v0++) { - if (sub_02026FE8(param0, v0) == 1) { + if (Pokedex_EncounteredSpecies(dexData, v0) == 1) { v1++; } } @@ -803,25 +803,25 @@ u16 sub_02026E0C(const PokedexData *param0) return v1; } -u16 sub_02026E48(const PokedexData *param0) +u16 sub_02026E48(const PokedexData *dexData) { - if (sub_02027474(param0)) { - return sub_02026E0C(param0); + if (Pokedex_NationalUnlocked(dexData)) { + return sub_02026E0C(dexData); } - return sub_02026EAC(param0); + return sub_02026EAC(dexData); } -u16 sub_02026E64(const PokedexData *param0) +u16 sub_02026E64(const PokedexData *dexData) { int v0; int v1; - CheckPokedexIntegrity(param0); + CheckPokedexIntegrity(dexData); v1 = 0; for (v0 = 1; v0 <= NATIONAL_DEX_COUNT; v0++) { - if (Pokedex_CaughtSpecies(param0, v0) == 1) { + if (Pokedex_CaughtSpecies(dexData, v0) == 1) { if (Pokemon_SinnohDexNumber(v0) != 0) { v1++; } @@ -831,16 +831,16 @@ u16 sub_02026E64(const PokedexData *param0) return v1; } -u16 sub_02026EAC(const PokedexData *param0) +u16 sub_02026EAC(const PokedexData *dexData) { int v0; int v1; - CheckPokedexIntegrity(param0); + CheckPokedexIntegrity(dexData); v1 = 0; for (v0 = 1; v0 <= NATIONAL_DEX_COUNT; v0++) { - if (sub_02026FE8(param0, v0) == 1) { + if (Pokedex_EncounteredSpecies(dexData, v0) == 1) { if (Pokemon_SinnohDexNumber(v0) != 0) { v1++; } @@ -850,11 +850,11 @@ u16 sub_02026EAC(const PokedexData *param0) return v1; } -BOOL sub_02026EF4(const PokedexData *param0) +BOOL sub_02026EF4(const PokedexData *dexData) { u16 v0; - v0 = sub_02026F20(param0); + v0 = sub_02026F20(dexData); if (v0 >= 482) { return 1; @@ -863,11 +863,11 @@ BOOL sub_02026EF4(const PokedexData *param0) return 0; } -BOOL sub_02026F0C(const PokedexData *param0) +BOOL sub_02026F0C(const PokedexData *dexData) { u16 v0; - v0 = sub_02026F58(param0); + v0 = sub_02026F58(dexData); if (v0 >= LOCAL_DEX_COUNT) { return 1; @@ -876,7 +876,7 @@ BOOL sub_02026F0C(const PokedexData *param0) return 0; } -u16 sub_02026F20(const PokedexData *param0) +u16 sub_02026F20(const PokedexData *dexData) { int v0; u16 v1; @@ -884,7 +884,7 @@ u16 sub_02026F20(const PokedexData *param0) v1 = 0; for (v0 = 1; v0 <= NATIONAL_DEX_COUNT; v0++) { - if (Pokedex_CaughtSpecies(param0, v0) == 1) { + if (Pokedex_CaughtSpecies(dexData, v0) == 1) { if (sub_02026D44(v0) == 1) { v1++; } @@ -894,7 +894,7 @@ u16 sub_02026F20(const PokedexData *param0) return v1; } -u16 sub_02026F58(const PokedexData *param0) +u16 sub_02026F58(const PokedexData *dexData) { int v0; u16 v1; @@ -903,7 +903,7 @@ u16 sub_02026F58(const PokedexData *param0) v1 = 0; for (v0 = 1; v0 <= NATIONAL_DEX_COUNT; v0++) { - if (sub_02026FE8(param0, v0) == 1) { + if (Pokedex_EncounteredSpecies(dexData, v0) == 1) { v2 = Pokemon_SinnohDexNumber(v0); if (v2 != 0) { @@ -917,41 +917,41 @@ u16 sub_02026F58(const PokedexData *param0) return v1; } -BOOL Pokedex_CaughtSpecies(const PokedexData *param0, u16 param1) +BOOL Pokedex_CaughtSpecies(const PokedexData *dexData, u16 species) { - CheckPokedexIntegrity(param0); + CheckPokedexIntegrity(dexData); - if (sub_02026344(param1)) { + if (Pokedex_InvalidSpecies(species)) { return 0; } - if (inline_02026F9C(param0, param1) && inline_02026FE8(param0, param1)) { + if (Read_CaughtSpecies(dexData, species) && Read_SeenSpecies(dexData, species)) { return 1; } else { return 0; } } -BOOL sub_02026FE8(const PokedexData *param0, u16 param1) +BOOL Pokedex_EncounteredSpecies(const PokedexData *dexData, u16 species) { - CheckPokedexIntegrity(param0); + CheckPokedexIntegrity(dexData); - if (sub_02026344(param1)) { + if (Pokedex_InvalidSpecies(species)) { return 0; } - return inline_02026FE8(param0, param1); + return Read_SeenSpecies(dexData, species); } -u32 sub_0202702C(const PokedexData *param0, u8 param1) +u32 sub_0202702C(const PokedexData *dexData, u8 param1) { u32 v0; - CheckPokedexIntegrity(param0); + CheckPokedexIntegrity(dexData); switch (param1) { case 0: - v0 = param0->unk_104; + v0 = dexData->unk_104; break; default: GF_ASSERT(0); @@ -961,236 +961,236 @@ u32 sub_0202702C(const PokedexData *param0, u8 param1) return v0; } -u32 sub_02027058(const PokedexData *param0, u16 param1, int param2) +u32 sub_02027058(const PokedexData *dexData, u16 species, int param2) { - CheckPokedexIntegrity(param0); + CheckPokedexIntegrity(dexData); - if (sub_02026344(param1)) { + if (Pokedex_InvalidSpecies(species)) { return -1; } - if (!inline_02026FE8(param0, param1)) { + if (!Read_SeenSpecies(dexData, species)) { return -1; } - return sub_02026BAC(param0, param1, param2); + return sub_02026BAC(dexData, species, param2); } -u32 sub_020270AC(const PokedexData *param0, int param1) +u32 sub_020270AC(const PokedexData *dexData, int param1) { - CheckPokedexIntegrity(param0); + CheckPokedexIntegrity(dexData); - if (sub_02026400(param0) <= param1) { + if (sub_02026400(dexData) <= param1) { return -1; } - return inline_020270AC(param0, param1); + return inline_020270AC(dexData, param1); } -u32 sub_020270DC(const PokedexData *param0) +u32 sub_020270DC(const PokedexData *dexData) { - CheckPokedexIntegrity(param0); - return sub_02026400(param0); + CheckPokedexIntegrity(dexData); + return sub_02026400(dexData); } -u32 sub_020270F8(const PokedexData *param0, int param1) +u32 sub_020270F8(const PokedexData *dexData, int param1) { - CheckPokedexIntegrity(param0); + CheckPokedexIntegrity(dexData); - if (sub_02026464(param0, 422) <= param1) { + if (sub_02026464(dexData, 422) <= param1) { return -1; } - return sub_02026C24(param0, 422, param1); + return sub_02026C24(dexData, 422, param1); } -u32 sub_02027130(const PokedexData *param0) +u32 sub_02027130(const PokedexData *dexData) { - CheckPokedexIntegrity(param0); - return sub_02026464(param0, 422); + CheckPokedexIntegrity(dexData); + return sub_02026464(dexData, 422); } -u32 sub_02027154(const PokedexData *param0, int param1) +u32 sub_02027154(const PokedexData *dexData, int param1) { - CheckPokedexIntegrity(param0); + CheckPokedexIntegrity(dexData); - if (sub_02026464(param0, 423) <= param1) { + if (sub_02026464(dexData, 423) <= param1) { return -1; } - return sub_02026C24(param0, 423, param1); + return sub_02026C24(dexData, 423, param1); } -u32 sub_0202718C(const PokedexData *param0) +u32 sub_0202718C(const PokedexData *dexData) { - CheckPokedexIntegrity(param0); - return sub_02026464(param0, 423); + CheckPokedexIntegrity(dexData); + return sub_02026464(dexData, 423); } -u32 sub_020271B0(const PokedexData *param0, int param1) +u32 sub_020271B0(const PokedexData *dexData, int param1) { - CheckPokedexIntegrity(param0); + CheckPokedexIntegrity(dexData); - if (sub_020266F8(param0, 412) <= param1) { + if (sub_020266F8(dexData, 412) <= param1) { return -1; } - return sub_02026CFC(param0, 412, param1); + return sub_02026CFC(dexData, 412, param1); } -u32 sub_020271E8(const PokedexData *param0) +u32 sub_020271E8(const PokedexData *dexData) { - CheckPokedexIntegrity(param0); - return sub_020266F8(param0, 412); + CheckPokedexIntegrity(dexData); + return sub_020266F8(dexData, 412); } -u32 sub_02027208(const PokedexData *param0, int param1) +u32 sub_02027208(const PokedexData *dexData, int param1) { - CheckPokedexIntegrity(param0); + CheckPokedexIntegrity(dexData); - if (sub_020266F8(param0, 413) <= param1) { + if (sub_020266F8(dexData, 413) <= param1) { return -1; } - return sub_02026CFC(param0, 413, param1); + return sub_02026CFC(dexData, 413, param1); } -u32 sub_02027240(const PokedexData *param0) +u32 sub_02027240(const PokedexData *dexData) { - CheckPokedexIntegrity(param0); - return sub_020266F8(param0, 413); + CheckPokedexIntegrity(dexData); + return sub_020266F8(dexData, 413); } -u32 sub_02027264(const PokedexData *param0, int param1) +u32 sub_02027264(const PokedexData *dexData, int param1) { - CheckPokedexIntegrity(param0); - return sub_0202688C(param0, param1); + CheckPokedexIntegrity(dexData); + return sub_0202688C(dexData, param1); } -u32 sub_02027288(const PokedexData *param0) +u32 sub_02027288(const PokedexData *dexData) { - CheckPokedexIntegrity(param0); - return sub_020268B8(param0); + CheckPokedexIntegrity(dexData); + return sub_020268B8(dexData); } -void sub_020272A4(PokedexData *param0, Pokemon *pokemon) +void sub_020272A4(PokedexData *dexData, Pokemon *pokemon) { - u16 v0 = Pokemon_GetValue(pokemon, MON_DATA_SPECIES, NULL); + u16 species = Pokemon_GetValue(pokemon, MON_DATA_SPECIES, NULL); u32 v1 = Pokemon_GetValue(pokemon, MON_DATA_PERSONALITY, NULL); u32 v2 = Pokemon_GetGender(pokemon); u32 v3; - CheckPokedexIntegrity(param0); + CheckPokedexIntegrity(dexData); - if (sub_02026344(v0)) { + if (Pokedex_InvalidSpecies(species)) { return; } - if (!inline_02026FE8(param0, v0)) { - inline_0202736C_1(param0, v0, v1); - sub_020263D8(param0, v2, 0, v0); + if (!Read_SeenSpecies(dexData, species)) { + inline_0202736C_1(dexData, species, v1); + sub_020263D8(dexData, v2, 0, species); } else { - v3 = inline_02026BAC(param0, v0, 0); + v3 = inline_02026BAC(dexData, species, 0); if (v3 != v2) { - sub_020263D8(param0, v2, 1, v0); + sub_020263D8(dexData, v2, 1, species); } } - sub_02026A60(param0, v0, pokemon); - inline_0202736C(param0, v0); + sub_02026A60(dexData, species, pokemon); + Write_SeenSpecies(dexData, species); } -void sub_0202736C(PokedexData *param0, Pokemon *param1) +void sub_0202736C(PokedexData *dexData, Pokemon *param1) { - u16 v0 = Pokemon_GetValue(param1, MON_DATA_SPECIES, NULL); + u16 species = Pokemon_GetValue(param1, MON_DATA_SPECIES, NULL); u32 v1 = Pokemon_GetValue(param1, MON_DATA_LANGUAGE, NULL); u32 v2 = Pokemon_GetValue(param1, MON_DATA_PERSONALITY, NULL); u32 v3 = Pokemon_GetGender(param1); u32 v4; - CheckPokedexIntegrity(param0); + CheckPokedexIntegrity(dexData); - if (sub_02026344(v0)) { + if (Pokedex_InvalidSpecies(species)) { return; } - if (!inline_02026FE8(param0, v0)) { - inline_0202736C_1(param0, v0, v2); - sub_020263D8(param0, v3, 0, v0); + if (!Read_SeenSpecies(dexData, species)) { + inline_0202736C_1(dexData, species, v2); + sub_020263D8(dexData, v3, 0, species); } else { - v4 = inline_02026BAC(param0, v0, 0); + v4 = inline_02026BAC(dexData, species, 0); if (v4 != v3) { - sub_020263D8(param0, v3, 1, v0); + sub_020263D8(dexData, v3, 1, species); } } - sub_02026A60(param0, v0, param1); - sub_02026B88(param0, v0, v1); + sub_02026A60(dexData, species, param1); + sub_02026B88(dexData, species, v1); - inline_sub_0202736C_1(param0, v0); - inline_0202736C(param0, v0); + Write_CaughtSpecies(dexData, species); + Write_SeenSpecies(dexData, species); } -void sub_02027454(PokedexData *param0) +void sub_02027454(PokedexData *dexData) { - CheckPokedexIntegrity(param0); - param0->nationalDexObtained = 1; + CheckPokedexIntegrity(dexData); + dexData->nationalDexObtained = 1; } -BOOL sub_02027474(const PokedexData *param0) +BOOL Pokedex_NationalUnlocked(const PokedexData *dexData) { - CheckPokedexIntegrity(param0); - return param0->nationalDexObtained; + CheckPokedexIntegrity(dexData); + return dexData->nationalDexObtained; } -BOOL sub_02027494(const PokedexData *param0) +BOOL Pokedex_CanDetectForms(const PokedexData *dexData) { - CheckPokedexIntegrity(param0); - return param0->canDetectForms; + CheckPokedexIntegrity(dexData); + return dexData->canDetectForms; } -void sub_020274B0(PokedexData *param0) +void Pokedex_CanDetectForms_True(PokedexData *dexData) { - CheckPokedexIntegrity(param0); - param0->canDetectForms = 1; + CheckPokedexIntegrity(dexData); + dexData->canDetectForms = 1; } -BOOL sub_020274D0(const PokedexData *param0, u16 param1, u32 param2) +BOOL sub_020274D0(const PokedexData *dexData, u16 species, u32 param2) { - int v0; + int speciesInt; GF_ASSERT(param2 < 8); - CheckPokedexIntegrity(param0); + CheckPokedexIntegrity(dexData); - v0 = param1; + speciesInt = species; param2 = sub_020986CC(param2); - return param0->recordedLanguages[v0] & (1 << param2); + return dexData->recordedLanguages[speciesInt] & (1 << param2); } -void sub_02027508(PokedexData *param0) +void sub_02027508(PokedexData *dexData) { - param0->unk_319 = 1; + dexData->unk_319 = 1; } -BOOL sub_02027514(const PokedexData *param0) +BOOL sub_02027514(const PokedexData *dexData) { - return param0->unk_319; + return dexData->unk_319; } -BOOL sub_02027520(const PokedexData *param0) +BOOL sub_02027520(const PokedexData *dexData) { - CheckPokedexIntegrity(param0); - return param0->pokedexObtained; + CheckPokedexIntegrity(dexData); + return dexData->pokedexObtained; } -void sub_02027540(PokedexData *param0) +void sub_02027540(PokedexData *dexData) { - CheckPokedexIntegrity(param0); - param0->pokedexObtained = 1; + CheckPokedexIntegrity(dexData); + dexData->pokedexObtained = 1; } PokedexData *SaveData_Pokedex(SaveData *param0) @@ -1201,54 +1201,54 @@ PokedexData *SaveData_Pokedex(SaveData *param0) return v0; } -u32 sub_0202756C(const PokedexData *param0, int param1, int param2) +u32 sub_0202756C(const PokedexData *dexData, int species, int param2) { - CheckPokedexIntegrity(param0); + CheckPokedexIntegrity(dexData); - switch (param1) { - case 201: - if (param2 < sub_020270DC(param0)) { - return sub_020270AC(param0, param2); + switch (species) { + case SPECIES_UNOWN: + if (param2 < sub_020270DC(dexData)) { + return sub_020270AC(dexData, param2); } break; - case 422: - if (param2 < sub_02027130(param0)) { - return sub_020270F8(param0, param2); + case SPECIES_SHELLOS: + if (param2 < sub_02027130(dexData)) { + return sub_020270F8(dexData, param2); } break; - case 423: - if (param2 < sub_0202718C(param0)) { - return sub_02027154(param0, param2); + case SPECIES_GASTRODON: + if (param2 < sub_0202718C(dexData)) { + return sub_02027154(dexData, param2); } break; - case 412: - if (param2 < sub_020271E8(param0)) { - return sub_020271B0(param0, param2); + case SPECIES_BURMY: + if (param2 < sub_020271E8(dexData)) { + return sub_020271B0(dexData, param2); } break; - case 413: - if (param2 < sub_02027240(param0)) { - return sub_02027208(param0, param2); + case SPECIES_WORMADAM: + if (param2 < sub_02027240(dexData)) { + return sub_02027208(dexData, param2); } break; - case 386: - if (param2 < sub_02027288(param0)) { - return sub_02027264(param0, param2); + case SPECIES_DEOXYS: + if (param2 < sub_02027288(dexData)) { + return sub_02027264(dexData, param2); } break; - case 492: - if (param2 < sub_02026464(param0, 492)) { - return sub_02026C24(param0, 492, param2); + case SPECIES_SHAYMIN: + if (param2 < sub_02026464(dexData, SPECIES_SHAYMIN)) { + return sub_02026C24(dexData, SPECIES_SHAYMIN, param2); } break; - case 487: - if (param2 < sub_02026464(param0, 487)) { - return sub_02026C24(param0, 487, param2); + case SPECIES_GIRATINA: + if (param2 < sub_02026464(dexData, SPECIES_GIRATINA)) { + return sub_02026C24(dexData, SPECIES_GIRATINA, param2); } break; - case 479: - if (param2 < sub_02026958(param0, 479)) { - return sub_02026CCC(param0, 479, param2); + case SPECIES_ROTOM: + if (param2 < sub_02026958(dexData, SPECIES_ROTOM)) { + return sub_02026CCC(dexData, SPECIES_ROTOM, param2); } break; default: diff --git a/src/unk_02046C7C.c b/src/unk_02046C7C.c index bf984c6764..5fd09735bf 100644 --- a/src/unk_02046C7C.c +++ b/src/unk_02046C7C.c @@ -107,7 +107,7 @@ BOOL ScrCmd_0FA(ScriptContext *param0) v8.unk_01 = v4; v8.unk_02 = v6; v8.unk_03 = sub_0206A954(SaveData_GetVarsFlags(param0->fieldSystem->saveData)); - v8.unk_04 = sub_02027474(SaveData_Pokedex(param0->fieldSystem->saveData)); + v8.unk_04 = Pokedex_NationalUnlocked(SaveData_Pokedex(param0->fieldSystem->saveData)); v8.unk_05 = v7; v8.unk_08 = v1; v8.unk_0C = v0; diff --git a/src/unk_0204AEE8.c b/src/unk_0204AEE8.c index f49103a856..8b04be86b0 100644 --- a/src/unk_0204AEE8.c +++ b/src/unk_0204AEE8.c @@ -121,7 +121,7 @@ StringTemplate *sub_0204AEE8(SaveData *param0, u16 param1, u16 param2, u8 param3 for (v0 = 0; v0 < 18; v0++) { v1 = sub_02078824(v0); - if (sub_02026FE8(v4, v1)) { + if (Pokedex_EncounteredSpecies(v4, v1)) { MessageLoader_GetStrbuf(v6, v1, v2); StringTemplate_SetStrbuf(v5, (*param4) + 1, v2, param2, param3, GAME_LANGUAGE); (*param4)++; diff --git a/src/unk_020683F4.c b/src/unk_020683F4.c index 0cb18b6557..2bcf745ea1 100644 --- a/src/unk_020683F4.c +++ b/src/unk_020683F4.c @@ -1071,7 +1071,7 @@ static u32 sub_02069130(const UnkStruct_020684D0 *param0) return -1; } - if (sub_02027474(SaveData_Pokedex(param0->fieldSystem->saveData)) == 0) { + if (Pokedex_NationalUnlocked(SaveData_Pokedex(param0->fieldSystem->saveData)) == 0) { return -1; } diff --git a/src/unk_0206CCB0.c b/src/unk_0206CCB0.c index 311b123395..a7efa45f74 100644 --- a/src/unk_0206CCB0.c +++ b/src/unk_0206CCB0.c @@ -774,7 +774,7 @@ static BOOL sub_0206D320(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param PokedexData *v0 = SaveData_Pokedex(fieldSystem->saveData); UnkStruct_0206D140 *v1 = ov6_02246498(param1); - return sub_02026FE8(v0, v1->unk_06); + return Pokedex_EncounteredSpecies(v0, v1->unk_06); } void sub_0206D340(FieldSystem *fieldSystem, BOOL param1, u16 param2, Pokemon *param3) @@ -815,7 +815,7 @@ static BOOL sub_0206D3C0(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param return 1; } - return sub_02026FE8(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); + return Pokedex_EncounteredSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); } static void sub_0206D3E4(FieldSystem *fieldSystem, int param1) @@ -936,7 +936,7 @@ static int sub_0206D5B0(FieldSystem *fieldSystem, StringTemplate *param1, UnkStr static BOOL sub_0206D5F0(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param1) { UnkStruct_0206D5B0 *v0 = (UnkStruct_0206D5B0 *)ov6_02246498(param1); - return sub_02026FE8(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); + return Pokedex_EncounteredSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); } void sub_0206D60C(FieldSystem *fieldSystem, Pokemon *param1) @@ -965,7 +965,7 @@ static BOOL sub_0206D6A8(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param PokedexData *v0 = SaveData_Pokedex(fieldSystem->saveData); UnkStruct_0206D644 *v1 = (UnkStruct_0206D644 *)ov6_02246498(param1); - return sub_02026FE8(v0, v1->unk_00); + return Pokedex_EncounteredSpecies(v0, v1->unk_00); } void sub_0206D6C8(FieldSystem *fieldSystem, int param1, int param2) @@ -1026,7 +1026,7 @@ static BOOL sub_0206D7A4(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param PokedexData *v0 = SaveData_Pokedex(fieldSystem->saveData); UnkStruct_0206D75C *v1 = (UnkStruct_0206D75C *)ov6_02246498(param1); - return sub_02026FE8(v0, v1->unk_00); + return Pokedex_EncounteredSpecies(v0, v1->unk_00); } void sub_0206D7C4(FieldSystem *fieldSystem) @@ -1093,7 +1093,7 @@ static BOOL sub_0206D8F0(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param { UnkStruct_0206D8B0 *v0 = (UnkStruct_0206D8B0 *)ov6_02246498(param1); - return sub_02026FE8(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); + return Pokedex_EncounteredSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); } void sub_0206D90C(TVBroadcast *fieldSystem, Pokemon *param1, u16 param2) @@ -1172,7 +1172,7 @@ static BOOL sub_0206DA50(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param { UnkStruct_0206D9F4 *v0 = (UnkStruct_0206D9F4 *)ov6_02246498(param1); - return sub_02026FE8(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); + return Pokedex_EncounteredSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); } static void sub_0206DA6C(UnkStruct_0206DA6C *param0, const TrainerInfo *param1) @@ -1305,7 +1305,7 @@ static BOOL sub_0206DC3C(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param { UnkStruct_0206DBE8 *v0 = (UnkStruct_0206DBE8 *)ov6_02246498(param1); - if (sub_02026FE8(SaveData_Pokedex(fieldSystem->saveData), v0->unk_02) == 0) { + if (Pokedex_EncounteredSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_02) == 0) { return 0; } @@ -1342,7 +1342,7 @@ static int sub_0206DC9C(FieldSystem *fieldSystem, StringTemplate *param1, UnkStr static BOOL sub_0206DD1C(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param1) { UnkStruct_0206DC9C *v0 = (UnkStruct_0206DC9C *)ov6_02246498(param1); - return sub_02026FE8(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); + return Pokedex_EncounteredSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); } void sub_0206DD38(FieldSystem *fieldSystem, u32 param1, u32 param2, u32 param3) @@ -1683,7 +1683,7 @@ static BOOL sub_0206E248(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param { UnkStruct_0206E1C0 *v0 = ov6_02246498(param1); - return sub_02026FE8(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); + return Pokedex_EncounteredSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); } void sub_0206E264(FieldSystem *fieldSystem, u16 param1) @@ -1743,7 +1743,7 @@ static int sub_0206E300(FieldSystem *fieldSystem, StringTemplate *param1, UnkStr static BOOL sub_0206E37C(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param1) { UnkStruct_0206E300 *v0 = ov6_02246498(param1); - return sub_02026FE8(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00.unk_02); + return Pokedex_EncounteredSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00.unk_02); } void sub_0206E398(FieldSystem *fieldSystem, u16 param1) @@ -1777,7 +1777,7 @@ static int sub_0206E3C8(FieldSystem *fieldSystem, StringTemplate *param1, UnkStr static BOOL sub_0206E3F8(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param1) { UnkStruct_0206E3C8 *v0 = ov6_02246498(param1); - return sub_02026FE8(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); + return Pokedex_EncounteredSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); } void sub_0206E414(FieldSystem *fieldSystem, u16 param1) @@ -2760,7 +2760,7 @@ static int sub_0206F01C(FieldSystem *fieldSystem, StringTemplate *param1, UnkStr v1 = (LCRNG_Next() % (NATIONAL_DEX_COUNT - 1)) + 1; for (v2 = 1; v2 <= NATIONAL_DEX_COUNT; v2++) { - if (sub_02026FE8(v4, v1) == 1) { + if (Pokedex_EncounteredSpecies(v4, v1) == 1) { v3 = v1; break; } @@ -2861,7 +2861,7 @@ static int sub_0206F160(FieldSystem *fieldSystem, StringTemplate *param1, UnkStr v1 = (LCRNG_Next() % (NATIONAL_DEX_COUNT - 2) + 1); for (v2 = 1; v2 <= NATIONAL_DEX_COUNT; v2++) { - if (sub_02026FE8(v6, v1) == 1) { + if (Pokedex_EncounteredSpecies(v6, v1) == 1) { v0 = sub_0206F0D8(v1, 4); StringTemplate_SetStrbuf(param1, 2, v0, 0, 1, GAME_LANGUAGE); Strbuf_Free(v0); diff --git a/src/unk_0207A274.c b/src/unk_0207A274.c index 8be1277cae..cfd7a4eb6c 100644 --- a/src/unk_0207A274.c +++ b/src/unk_0207A274.c @@ -21,7 +21,7 @@ u32 sub_0207A280(const PokedexData *param0) { BOOL v0; - v0 = sub_02027474(param0); + v0 = Pokedex_NationalUnlocked(param0); if (v0 == 1) { return 1; diff --git a/src/unk_020998EC.c b/src/unk_020998EC.c index 4872a4d04a..53a74f73f1 100644 --- a/src/unk_020998EC.c +++ b/src/unk_020998EC.c @@ -3236,7 +3236,7 @@ static u32 sub_02099980(UnkStruct_020998EC *param0, const u16 *param1, u32 param v0 = sub_0209755C(param0->unk_00); for (v1 = 0; v1 < param2; v1++) { - if (sub_02026FE8(v0, param1[v1])) { + if (Pokedex_EncounteredSpecies(v0, param1[v1])) { inline_02099980(param0, param1[v1]); *param3++ = param1[v1]; v2++; diff --git a/tools/scripts/make_pokedex_data.py b/tools/scripts/make_pokedex_data.py index a20c0247d2..fe594cdc17 100644 --- a/tools/scripts/make_pokedex_data.py +++ b/tools/scripts/make_pokedex_data.py @@ -96,17 +96,17 @@ def DataSize(num): binData[11] = binData[11] + i.to_bytes(2, 'little') # body shape - body_idx = PokemonBodyShape[pkdexdata['body_shape']].value + PokemonType['NUMBER_OF_MON_TYPES'].value + 26 - binData[body_idx] = binData[body_idx] + i.to_bytes(2, 'little') + bodyIdx = PokemonBodyShape[pkdexdata['body_shape']].value + PokemonType['NUMBER_OF_MON_TYPES'].value + 26 + binData[bodyIdx] = binData[bodyIdx] + i.to_bytes(2, 'little') # pokemon types - type_idx = 27 + typeIdx = 27 for type in PokemonType: if type.name in ['TYPE_MYSTERY', 'NUMBER_OF_MON_TYPES']: continue if type.name in pkdata['types']: - binData[type_idx] = binData[type_idx] + i.to_bytes(2, 'little') - type_idx += 1 + binData[typeIdx] = binData[typeIdx] + i.to_bytes(2, 'little') + typeIdx += 1 # store for later heightData[i-1] = pkdexdata['height'] @@ -115,8 +115,8 @@ def DataSize(num): # sinnoh dex order with open(args.pokedex) as data_file: - dex_data = json.load(data_file) - for mon in dex_data: + dexData = json.load(data_file) + for mon in dexData: if mon not in ['SPECIES_EGG', 'SPECIES_BAD_EGG', 'SPECIES_NONE', 'SPECIES_ARCEUS']: binData[12] = binData[12] + PokemonSpecies[mon].value.to_bytes(2, 'little') diff --git a/tools/scripts/make_pokedex_enc_platinum.py b/tools/scripts/make_pokedex_enc_platinum.py new file mode 100644 index 0000000000..370dbe0c46 --- /dev/null +++ b/tools/scripts/make_pokedex_enc_platinum.py @@ -0,0 +1,369 @@ +#!/usr/bin/env python3 +import argparse +import json +import pathlib +import subprocess + +from consts.species import PokemonSpecies +from consts.pokemon import PokemonType +from consts.pokemon import PokemonBodyShape + + +argparser = argparse.ArgumentParser( + prog='make_pokedex_enc_platinum_py', + description='Packs the archive containing Pokedex encounter data' +) +argparser.add_argument('-k', '--knarc', + required=True, + help='Path to knarc executable') +argparser.add_argument('-s', '--source-dir', + required=True, + help='Path to the source directory (res/prebuilt/application/zukanlist/zkn_data)') +argparser.add_argument('-p', '--private-dir', + required=True, + help='Path to the private directory (where binaries will be made)') +argparser.add_argument('-o', '--output-dir', + required=True, + help='Path to the output directory (where the NARC will be made)') +args = argparser.parse_args() + +source_dir = pathlib.Path(args.source_dir) +private_dir = pathlib.Path(args.private_dir) +output_dir = pathlib.Path(args.output_dir) + +output_name = 'zukan_enc_platinum' + +private_dir.mkdir(parents=True, exist_ok=True) + +# dungeon position on map +file_0 = [ + [0, 0, 0, 0], + [9, 24, 0, 0], + [6, 17, 0, 0], + [12, 17, 1, 0], + [18, 24, 0, 0], + [18, 20, 0, 0], + [26, 18, 0, 0], + [5, 22, 0, 0], + [7, 23, 0, 0], + [23, 7, 0, 0], + [24, 21, 0, 0], + [11, 6, 0, 0], + [9, 19, 0, 0], + [22, 21, 0, 0], + [14, 24, 0, 0], + [3, 15, 0, 0], + [7, 16, 0, 0], + [2, 26, 0, 0], + [22, 23, 0, 0], + [10, 7, 0, 0], + [17, 21, 0, 0], + [5, 19, 0, 0] +] +file_1 = [ + [255, 255, 255, 255], + [198, 0, 0, 0], + [203, 0, 0, 0], + [207, 0, 0, 0], + [248, 1, 0, 0], + [225, 0, 0, 0], + [244, 0, 0, 0], + [254, 0, 0, 0], + [2, 1, 0, 0], + [7, 1, 0, 0], + [11, 1, 0, 0], + [22, 1, 0, 0], + [28, 1, 0, 0], + [30, 1, 0, 0], + [31, 1, 0, 0], + [33, 1, 0, 0], + [39, 1, 0, 0], + [55, 1, 0, 0], + [59, 1, 0, 0], + [62, 1, 0, 0], + [101, 1, 0, 0], + [0, 1, 0, 0] +] +# field position on map +file_2 = [ + [0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [1, 22, 1, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [9, 16, 1, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [18, 25, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [26, 23, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [26, 17, 1, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [7, 20, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [5, 18, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [23, 7, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [3, 15, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [21, 23, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [9, 6, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [3, 26, 2, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [5, 25, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [6, 23, 2, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [5, 22, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [5, 21, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [6, 18, 1, 3, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [8, 16, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [9, 18, 1, 4, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [9, 22, 2, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [12, 22, 2, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [17, 21, 1, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [17, 17, 1, 3, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [15, 16, 3, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [11, 16, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [13, 16, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [14, 23, 1, 3, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [14, 26, 4, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [20, 25, 3, 2, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [22, 20, 1, 3, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [18, 18, 3, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [9, 12, 3, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [9, 8, 1, 4, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [2, 23, 2, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [5, 27, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [7, 28, 3, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [23, 24, 3, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [27, 15, 2, 3, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [19, 10, 1, 3, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [23, 8, 1, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [24, 10, 1, 3, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [24, 13, 2, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [3, 27, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [14, 16, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [25, 14, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [5, 28, 2, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [26, 19, 1, 4, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [21, 10, 3, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [21, 13, 3, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [6, 16, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] +] +file_3 = [ + [255, 255, 255, 255], + [33, 0, 0, 0], + [65, 0, 0, 0], + [120, 0, 0, 0], + [150, 0, 0, 0], + [172, 0, 0, 0], + [200, 0, 0, 0], + [204, 0, 0, 0], + [6, 1, 0, 0], + [32, 1, 0, 0], + [80, 1, 0, 0], + [84, 1, 0, 0], + [86, 1, 0, 0], + [87, 1, 0, 0], + [88, 1, 0, 0], + [89, 1, 0, 0], + [90, 1, 0, 0], + [91, 1, 0, 0], + [93, 1, 0, 0], + [94, 1, 0, 0], + [97, 1, 0, 0], + [98, 1, 0, 0], + [100, 1, 0, 0], + [106, 1, 0, 0], + [107, 1, 0, 0], + [109, 1, 0, 0], + [110, 1, 0, 0], + [111, 1, 0, 0], + [115, 1, 0, 0], + [117, 1, 0, 0], + [124, 1, 0, 0], + [126, 1, 0, 0], + [127, 1, 0, 0], + [129, 1, 0, 0], + [132, 1, 0, 0], + [135, 1, 0, 0], + [136, 1, 0, 0], + [139, 1, 0, 0], + [143, 1, 0, 0], + [144, 1, 0, 0], + [147, 1, 0, 0], + [150, 1, 0, 0], + [151, 1, 0, 0], + [155, 1, 0, 0], + [186, 1, 0, 0], + [201, 1, 0, 0], + [211, 1, 0, 0], + [212, 1, 0, 0], + [213, 1, 0, 0], + [215, 1, 0, 0], + [202, 0, 0, 0] +] + +honeyTrees = [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" +] + +NUM_POKEMON = len(PokemonSpecies) - 1 +NUM_FILES = NUM_POKEMON * 10 + 4 + +binData = bytes() +for dungeon in file_0: + for pos in dungeon: + binData = binData + pos.to_bytes(1, 'little') + +target_fname = str(private_dir / output_name) + '_00000.bin' +with open(target_fname, 'wb+') as target_file: + target_file.write(binData) + +binData = bytes() +for dungeon in file_1: + for pos in dungeon: + binData = binData + pos.to_bytes(1, 'little') + +target_fname = str(private_dir / output_name) + '_00001.bin' +with open(target_fname, 'wb+') as target_file: + target_file.write(binData) + +binData = bytes() +for field in file_2: + for pos in field: + binData = binData + pos.to_bytes(1, 'little') + +target_fname = str(private_dir / output_name) + '_00002.bin' +with open(target_fname, 'wb+') as target_file: + target_file.write(binData) + +binData = bytes() +for field in file_3: + for pos in field: + binData = binData + pos.to_bytes(1, 'little') + +target_fname = str(private_dir / output_name) + '_00003.bin' +with open(target_fname, 'wb+') as target_file: + target_file.write(binData) + +def SearchLand(species, encounterData, absent, category): + encData = 0 + while ((encData < 12) and absent): + + if (((encData == 2) or (encData == 3)) and (category > 0)): + if (category == 1): + enc = encounterData["morning"][encData - 2] + if (category == 2): + enc = encounterData["night"][encData - 2] + else: + enc = encounterData["land_encounters"][encData]["species"] + if (enc == species): + absent = False + encData += 1 + return absent + +def SearchWater(species, encounterData, absent): + encData = 0 + while ((encData < 5) and absent): + enc = encounterData["surf_encounters"][encData]["species"] + if (enc == species): + absent = False + enc = encounterData["old_rod_encounters"][encData]["species"] + if (enc == species): + absent = False + enc = encounterData["good_rod_encounters"][encData]["species"] + if (enc == species): + absent = False + enc = encounterData["super_rod_encounters"][encData]["species"] + if (enc == species): + absent = False + encData += 1 + return absent + +def SearchRadar(species, encounterData, absent): + encData = 0 + while ((encData < 4) and absent): + enc = encounterData["radar"][encData] + if (enc == species): + absent = False + encData += 1 + return absent + +def SearchSpecial(species, encounterData, absent): + encData = 0 + if (species == "SPECIES_NONE"): + return False + while ((encData < len(encounterData["special_encounters"])) and absent): + enc = encounterData["special_encounters"][encData] + if (enc == species): + absent = False + encData += 1 + return absent + +def SearchSpecialNatDex(species, encounterData, absent): + encData = 0 + while ((encData < len(encounterData["specialnatdex_encounters"])) and absent): + enc = encounterData["specialnatdex_encounters"][encData] + if (enc == species): + absent = False + encData += 1 + if absent: + absent = SearchRadar(species, encounterData, absent) + return absent + +def CategorySearch(species, encounterData, category): + absent = True + + if (category < 3): + absent = SearchLand(species, encounterData, absent, category) + if absent: + absent = SearchWater(species, encounterData, absent) + if (category == 3): + absent = SearchSpecial(species, encounterData, absent) + if (category == 4): + absent = SearchSpecialNatDex(species, encounterData, absent) + + return absent + +for dexNum, species in enumerate(PokemonSpecies): + if species.name in ['SPECIES_BAD_EGG']: + continue + species = species.name + + for category in range(10): + fileNum = NUM_POKEMON * category + dexNum + 4 + encList = [] + + for archiveID in range(183): + with open(source_dir / '../../../../field/encounters' / f"{archiveID:03}.json", encoding='utf-8') as encounter_file: + encounterData = json.load(encounter_file) + + areaData = encounterData["map_category"] + areaType = areaData["map_type"] + areaNum = areaData["map_number"] + + if (category < 5): + if (areaType == 'field'): + continue + else: + if (areaType == 'dungeon'): + continue + if (areaNum in encList): + continue + + absent = CategorySearch(species, encounterData, category%5) + + if not absent: + encList.append(areaNum) + + if (((category == 3) or (category == 4)) and (species in honeyTrees)): + encList.append(21) + if (((category == 8) or (category == 9)) and (species in honeyTrees)): + encList.append(50) + encList.sort() + encList.append(0) + + binData = bytes() + for areaNum in encList: + binData = binData + areaNum.to_bytes(4, 'little') + + target_fname = str(private_dir / output_name) + f'_{fileNum:05}.bin' + with open(target_fname, 'wb+') as target_file: + target_file.write(binData) + + +subprocess.run([args.knarc, '-d', private_dir, '-p', str(output_dir / output_name) + '.narc']) diff --git a/tools/scripts/make_pokedex_message_banks.py b/tools/scripts/make_pokedex_message_banks.py index e028a472fc..5d9b4b9efc 100644 --- a/tools/scripts/make_pokedex_message_banks.py +++ b/tools/scripts/make_pokedex_message_banks.py @@ -21,15 +21,16 @@ source_dir = pathlib.Path(args.source_dir) output_dir = pathlib.Path(args.output_dir) -def Convert_weight(weight_metric): +def Convert_weight(hectograms): conv = 4.536 - lbs = round(weight_metric/conv,1) + lbs = round(hectograms/conv,1) if lbs == 1505.7: lbs = 1505.8 elif lbs == 740.7: lbs = 740.8 elif lbs == 1653.4: lbs = 1653.5 + if lbs >= 1000: return f'{lbs} lbs.' if lbs >= 100: @@ -38,13 +39,15 @@ def Convert_weight(weight_metric): return f'  {lbs} lbs.' return f'   {lbs} lbs.' -def Convert_Height(height_metric): - conv = 3.048 - feet = int(height_metric//conv) - inches = round((height_metric%conv)/conv*12) +def Convert_Height(decimeters): + conv = 3.937 + feet = 0 + inches = round(decimeters*conv) + while inches >= 12: feet += 1 inches -= 12 + if feet >= 100: return f'{feet}’{inches:02}”' if feet >= 10: @@ -54,15 +57,15 @@ def Convert_Height(height_metric): # variables NUM_POKEMON = len(PokemonSpecies) -name_data = ['' for i in range(NUM_POKEMON)] -name_articles = ['' for i in range(NUM_POKEMON)] -dex_entry = ['' for i in range(NUM_POKEMON-2)] +nameData = ['' for i in range(NUM_POKEMON)] +nameArticles = ['' for i in range(NUM_POKEMON)] +dexEntries = ['' for i in range(NUM_POKEMON-2)] heights = ['' for i in range(NUM_POKEMON-2)] heights_gira = ['' for i in range(NUM_POKEMON-2)] weights = ['' for i in range(NUM_POKEMON-2)] weights_gira = ['' for i in range(NUM_POKEMON-2)] -name_number = ['' for i in range(NUM_POKEMON-2)] -dex_category = ['' for i in range(NUM_POKEMON-2)] +nameNumber = ['' for i in range(NUM_POKEMON-2)] +dexCategories = ['' for i in range(NUM_POKEMON-2)] # collect data for i, species in enumerate(PokemonSpecies): @@ -75,22 +78,22 @@ def Convert_Height(height_metric): pkdata = json.load(data_file) if subdir not in ['egg', 'bad_egg']: - pokemon_name = pkdata['name'].upper() + pokemonName = pkdata['name'].upper() else: - pokemon_name = pkdata['name'] + pokemonName = pkdata['name'] - name_data[i] = pokemon_name + nameData[i] = pokemonName - if pokemon_name[0] in ['A','E','I','O','U']: - name_articles[i] = 'an {COLOR 255}' + pokemon_name + '{COLOR 0}' + if pokemonName[0] in ['A','E','I','O','U']: + nameArticles[i] = 'an {COLOR 255}' + pokemonName + '{COLOR 0}' else: - name_articles[i] = 'a {COLOR 255}' + pokemon_name + '{COLOR 0}' + nameArticles[i] = 'a {COLOR 255}' + pokemonName + '{COLOR 0}' # eggs do not have dex entries if subdir in ['egg', 'bad_egg']: continue - name_number[i] = f'{i:03} ' + pokemon_name + nameNumber[i] = f'{i:03} ' + pokemonName pkdexdata = pkdata['pokedex_data'] if subdir == 'giratina': heights_gira[i] = Convert_Height(pkdexdata[1]['height']) @@ -99,13 +102,13 @@ def Convert_Height(height_metric): else: heights_gira[i] = Convert_Height(pkdexdata['height']) weights_gira[i] = Convert_weight(pkdexdata['weight']) - dex_entry[i] = str(pkdexdata['entry_text']).replace('\n','\\n') - dex_category[i] = pkdexdata['category'] + dexEntries[i] = str(pkdexdata['entry_text']).replace('\n','\\n') + dexCategories[i] = pkdexdata['category'] heights[i] = Convert_Height(pkdexdata['height']) weights[i] = Convert_weight(pkdexdata['weight']) if subdir == '000': - name_number[i] = '----------' + nameNumber[i] = '----------' heights[i] = '???’??”' heights_gira[i] = '???’??”' weights[i] = '????.? lbs.' @@ -151,17 +154,17 @@ def Convert_Height(height_metric): 718 ] fileArrays = [ - name_data, - name_articles, - dex_entry, + nameData, + nameArticles, + dexEntries, weights, weights_gira, heights, heights_gira, - name_number, - name_number, - name_number, - dex_category + nameNumber, + nameNumber, + nameNumber, + dexCategories ] fileData = [bytes() for i in range(len(fileNames))] emptyString = 'empty_string' diff --git a/tools/scripts/meson.build b/tools/scripts/meson.build index 5c20a881d9..6cc19bc4ec 100644 --- a/tools/scripts/meson.build +++ b/tools/scripts/meson.build @@ -10,3 +10,4 @@ make_species_tables_py = find_program('make_species_tables.py', native: true) make_tutorable_moves_py = find_program('make_tutorable_moves.py', native: true) make_pokedex_data_py = find_program('make_pokedex_data.py', native: true) make_pokedex_message_banks_py = find_program('make_pokedex_message_banks.py', native: true) +make_pokedex_enc_platinum_py = find_program('make_pokedex_enc_platinum.py', native: true)