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 928bcc693e..42b8a2b106 100644 --- a/include/overlay021/ov21_021D0D80.h +++ b/include/overlay021/ov21_021D0D80.h @@ -3,7 +3,7 @@ #include -#include "overlay021/struct_ov21_021D0D80_1.h" +#include "overlay021/struct_ov21_021D0D80.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D157C.h" @@ -24,7 +24,7 @@ int ov21_021D0D80(OverlayManager *param0, int *param1); int ov21_021D0E3C(OverlayManager *param0, int *param1); int ov21_021D0EC8(OverlayManager *param0, int *param1); -UnkStruct_ov21_021D0F60 *ov21_021D0F60(int param0, const UnkStruct_ov21_021D0D80_1 *param1); +UnkStruct_ov21_021D0F60 *ov21_021D0F60(int param0, const UnkStruct_ov21_021D0D80 *param1); BOOL ov21_021D10B8(UnkStruct_ov21_021D0F60 *param0); void ov21_021D12B0(int param0); void ov21_021D12C4(void); 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_021D517C.h b/include/overlay021/ov21_021D517C.h deleted file mode 100644 index 9914396165..0000000000 --- a/include/overlay021/ov21_021D517C.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef POKEPLATINUM_OV21_021D517C_H -#define POKEPLATINUM_OV21_021D517C_H - -#include "bg_window.h" - -void ov21_021D517C(Window *param0, u8 *param1, u16 param2, u16 param3, u8 param4, u8 *param5, u8 param6, u8 param7, u16 param8, u16 param9); -void ov21_021D5214(u8 *param0, u8 param1, u8 param2); - -#endif // POKEPLATINUM_OV21_021D517C_H diff --git a/include/overlay021/ov21_021D57B4.h b/include/overlay021/ov21_021D57B4.h deleted file mode 100644 index 63f575c29c..0000000000 --- a/include/overlay021/ov21_021D57B4.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef POKEPLATINUM_OV21_021D57B4_H -#define POKEPLATINUM_OV21_021D57B4_H - -#include "overlay021/struct_ov21_021D5844.h" -#include "overlay021/struct_ov21_021D5868.h" -#include "overlay021/struct_ov21_021D5890.h" - -#include "cell_actor.h" - -void ov21_021D57B4(UnkStruct_ov21_021D5844 *param0, int param1, int param2, int param3); -void ov21_021D5844(UnkStruct_ov21_021D5844 *param0); -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); -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); - -#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_enc_data.h b/include/overlay021/pokedex_enc_data.h new file mode 100644 index 0000000000..d077b38c0a --- /dev/null +++ b/include/overlay021/pokedex_enc_data.h @@ -0,0 +1,155 @@ +#ifndef POKEPLATINUM_POKEDEXENCDATA_H +#define POKEPLATINUM_POKEDEXENCDATA_H + +#include "constants/species.h" + +#include "cell_actor.h" + +typedef struct EncounterLocations { + int *locations; + int numLocations; +} EncounterLocations; + +typedef struct { + u8 x; + u8 y; + u8 isMtCoronet; + u8 unused; +} DungeonCoordinates; + +typedef struct { + u8 y; + u8 x; + u8 height; + u8 width; + u8 cellMatrix[32]; +} FieldCoordinates; + +enum PokedexEncFileCatgegory { + PEFC_DUNGEONMORNING, + PEFC_DUNGEONDAY, + PEFC_DUNGEONNIGHT, + PEFC_DUNGEONSPECIAL, + PEFC_DUNGEONSPECIALNATDEX, + PEFC_FIELDMORNING, + PEFC_FIELDDAY, + PEFC_FIELDNIGHT, + PEFC_FIELDSPECIAL, + PEFC_FIELDSPECIALNATDEX, +}; + +/** + * @brief Reads species encounter data from zukan_enc_platinum.narc + * + * encounterLocations is populated with the value and length of the file + * corresponding to the provided species and encounter. + * + * @param encounterLocations + * @param species + * @param encounterCategory + * @param heapID + */ +void PokedexEncData_PopulateEncounterLocations(EncounterLocations *encounterLocations, int species, int encounterCategory, int heapID); + +/** + * @brief Frees encounter data from the heap + * + * @param encounterLocations + */ +void PokedexEncData_FreeEncounterLocations(EncounterLocations *encounterLocations); + +/** + * @brief Reads dungeon coordinates data from zukan_enc_platinum.narc + * + * The first file in zukan_enc_platinum contains the location of each dungeon. + * numDungeons is only set if not passed as null. + * + * @param heapID + * @param numDungeons + * @return Array of coordinates for each dungeon + */ +DungeonCoordinates *PokedexEncData_GetDungeonCoordinates(int heapID, int *numDungeons); + +/** + * @brief Reads field coordinates data from zukan_enc_platinum.narc + * + * The third file in zukan_enc_platinum contains the location and shape of each field. + * numFields is only set if not passed as null. + * + * @param heapID + * @param numFields + * @return Array of coordinates for each field + */ +FieldCoordinates *PokedexEncData_GetFieldCoordinates(int heapID, int *numFields); + +/** + * @brief Updates fieldMap with the coordinates occupied by the field + * + * pokedexFieldMap is a 1D array treated like a 2D array for map purposes. + * Each coordinate occupied by the passed field will become 1 on the map. + * + * @param pokedexFieldMap + * @param mapHeight + * @param mapWidth + * @param fieldCoordinates + */ +void PokedexEncData_LocateFieldOnMap(u8 *pokedexFieldMap, u8 mapHeight, u8 mapWidth, const FieldCoordinates *fieldCoordinates); + +/** + * @brief Updates fieldMap with the coordinates occupied by visible fields + * + * Calls PokedexEncData_LocateFieldOnMap() for each field in encounterLocations not in invisibleFields. + * + * @param pokedexFieldMap + * @param mapHeight + * @param mapWidth + * @param fieldCoordinatesArray + * @param encounterLocations + * @param invisibleFields + * @param numInvisibleFields + * @return Number of visible fields + */ +u32 PokedexEncData_LocateVisibleFields(u8 *pokedexFieldMap, int mapHeight, int mapWidth, const FieldCoordinates *fieldCoordinatesArray, const EncounterLocations *encounterLocations, const u8 *invisibleFields, u32 numInvisibleFields); + +/** + * @brief Creates a CellActor with the coordinates occupied by the dungeon + * + * coronetAnimID is used for Mt Coronet, animID otherwise. + * + * @param cellActor + * @param xOffset + * @param yOffset + * @param xScale + * @param yScale + * @param dungeonCoordinates + * @param animID + * @param coronetAnimID + */ +void PokedexEncData_LocateDungeonOnMap(CellActor *cellActor, int xOffset, int yOffset, int xScale, int yScale, const DungeonCoordinates *dungeonCoordinates, int animID, int coronetAnimID); + +/** + * @brief Creates CellActors with the coordinates occupied by visible fields + * + * Calls PokedexEncData_LocateDungeonOnMap() for each dungeon in encounterLocations not in invisibleDungeons. + * cellActorsModified is set to the number of PokedexEncData_LocateDungeonOnMap() calls. + * The returned value = (cellActorsModified + initialNumVisibleDungeons) + * + * @param cellActorArray + * @param initialNumVisibleDungeons + * @param maxNumDungeons + * @param xOffset + * @param yOffset + * @param xScale + * @param yScale + * @param dungeonCoordinatesArray + * @param encounterLocations + * @param animID + * @param coronetAnimID + * @param invisibleDungeons + * @param numInvisibleDungeons + * @param cellActorsModified + * @return Number of visible dungeons + */ +int PokedexEncData_LocateVisibleDungeons(CellActor **cellActorArray, int initialNumVisibleDungeons, int maxNumDungeons, int xOffset, int yOffset, int xScale, int yScale, const DungeonCoordinates *dungeonCoordinatesArray, const EncounterLocations *encounterLocations, int animID, int coronetAnimID, const u8 *invisibleDungeons, u32 numInvisibleDungeons, u32 *cellActorsModified); + +#endif // POKEPLATINUM_POKEDEXENCDATA_H diff --git a/include/overlay021/pokedex_field_map.h b/include/overlay021/pokedex_field_map.h new file mode 100644 index 0000000000..7f682ba086 --- /dev/null +++ b/include/overlay021/pokedex_field_map.h @@ -0,0 +1,37 @@ +#ifndef POKEPLATINUM_POKEDEXFIELDMAP_H +#define POKEPLATINUM_POKEDEXFIELDMAP_H + +#include "bg_window.h" + +/** + * @brief Highlights fields on the map + * + * Generates a rectangle corresponding to the field type. + * Differs based upon neighboring fields. + * + * @param window + * @param src + * @param fieldWidth + * @param fieldHeight + * @param mapSize + * @param pokedexFieldMap + * @param mapHeight + * @param mapWidth + * @param yOffset + * @param xOffset + */ +void PokedexFieldMap_DisplayFields(Window *window, u8 *src, u16 fieldWidth, u16 fieldHeight, u8 mapSize, u8 *pokedexFieldMap, u8 mapHeight, u8 mapWidth, u16 yOffset, u16 xOffset); + +/** + * @brief Identifies how many neighboring fields each empty map location has + * + * Each combination of neighbors has a corresponding value stored in the map. + * For example, an empty location with fields to the north and east is distinct from one with neighbors to the north and northeast. + * + * @param pokedexFieldMap + * @param mapHeight + * @param mapWidth + */ +void PokedexFieldMap_SmoothFields(u8 *pokedexFieldMap, u8 mapHeight, u8 mapWidth); + +#endif // POKEPLATINUM_POKEDEXFIELDMAP_H diff --git a/include/overlay021/pokedex_sort.h b/include/overlay021/pokedex_sort.h new file mode 100644 index 0000000000..3f823361e0 --- /dev/null +++ b/include/overlay021/pokedex_sort.h @@ -0,0 +1,122 @@ +#ifndef POKEPLATINUM_POKEDEXSORT_H +#define POKEPLATINUM_POKEDEXSORT_H + +#include "overlay021/STRUCT_OV21_021D3208.h" +#include "overlay021/species_caught_status.h" +#include "overlay021/struct_ov21_021D3320.h" + +#include "strbuf.h" + +enum SortOrder { + SO_NUMERICAL, + SO_ALPHABETICAL, + SO_HEAVIEST, + SO_LIGHTEST, + SO_TALLEST, + SO_SMALLEST +}; + +enum FilterName { + FN_NONE, + FN_ABC, + FN_DEF, + FN_GHI, + FN_JKL, + FN_MNO, + FN_PQR, + FN_STU, + FN_VWX, + FN_YZ +}; + +enum FilterType { + FT_NONE, + FT_NORMAL, + FT_FIGHTING, + FT_FLYING, + FT_POISON, + FT_GROUND, + FT_ROCK, + FT_BUG, + FT_GHOST, + FT_STEEL, + FT_FIRE, + FT_WATER, + FT_GRASS, + FT_ELECTRIC, + FT_PSYCHIC, + FT_ICE, + FT_DRAGON, + FT_DARK +}; + +enum FilterForm { // called form in game, but refers to body shape + FF_NONE, + FF_QUADRUPED, + FF_BIPEDALTAILLESS, + FF_BIPEDALTAILED, + FF_SERPENTINE, + FF_MULTIWINGED, + FF_WINGED, + FF_INSECTOID, + FF_HEADBASE, + FF_HEADARMS, + FF_HEADLEGS, + FF_TENTACLES, + FF_FINS, + FF_HEAD, + FF_MULTIBODY +}; + +void PokedexSort_PopulatePokedexStatus(UnkStruct_ov21_021D3320 *param0, UnkStruct_ov21_021D3208 *param1, int heapID); +void PokedexSort_PokedexStatusFreeHWData(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 PokedexSort_IsNationalUnlocked(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 PokedexSort_Sort(UnkStruct_ov21_021D3320 *param0, int sortCategory, int firstLetterFilter, int typeFilter1, int typeFilter2, int bodyShapeFilter, int isNationalDex, int heapID, BOOL isFiltered); +BOOL PokedexSort_SortUnfiltered(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 PokedexStatus_IsNationalDex(const UnkStruct_ov21_021D3320 *param0); +BOOL PokedexSort_IsValidStatusIndex(const UnkStruct_ov21_021D3320 *param0, int dexIndex); +BOOL PokedexSort_SetCurrentStatusIndex(UnkStruct_ov21_021D3320 *param0, int param1); +BOOL PokedexSort_TakeStep_Loop(UnkStruct_ov21_021D3320 *param0, int param1); +int PokedexSort_CurrentStatusIndex(const UnkStruct_ov21_021D3320 *param0); +int PokedexSort_CaughtStatusLength(const UnkStruct_ov21_021D3320 *param0); +int PokedexSort_SpeciesToStatusIndex(const UnkStruct_ov21_021D3320 *param0, u32 param1); +BOOL PokedexSort_SetCurrentStatusIndexWithSpecies(UnkStruct_ov21_021D3320 *param0, int param1); +int PokedexSort_CurrentSpecies(const UnkStruct_ov21_021D3320 *param0); +int PokedexSort_CurrentCaughtStatus(const UnkStruct_ov21_021D3320 *param0); +const SpeciesCaughtStatus *PokedexSort_StatusIndexToCaughtStatus(const UnkStruct_ov21_021D3320 *param0, int dexIndex); +BOOL PokedexSort_IsValidDisplayIndex(const UnkStruct_ov21_021D3320 *param0, int param1); +BOOL PokedexSort_SetCurrentValues(UnkStruct_ov21_021D3320 *param0, int param1); +BOOL PokedexSort_TakeStep(UnkStruct_ov21_021D3320 *param0, int param1); +BOOL PokedexSort_IsValidStep(UnkStruct_ov21_021D3320 *param0, int param1); +int PokedexSort_CurrentDisplayIndex(const UnkStruct_ov21_021D3320 *param0); +int PokedexSort_NumSpeciesDisplayed(const UnkStruct_ov21_021D3320 *param0); +int PokedexSort_DisplayIndexToStatusIndex(const UnkStruct_ov21_021D3320 *param0, int param1); +void PokedexSort_UpdateCurrentValues(UnkStruct_ov21_021D3320 *param0); +int PokedexSort_NumEncountered(const UnkStruct_ov21_021D3320 *param0); +int PokedexSort_NumCaught(const UnkStruct_ov21_021D3320 *param0); +Strbuf *PokedexSort_TrainerName(const UnkStruct_ov21_021D3320 *param0); +u32 PokedexSort_TrainerGender(const UnkStruct_ov21_021D3320 *param0); +BOOL ov21_021D392C(const UnkStruct_ov21_021D3320 *param0, int param1); +BOOL PokedexSort_CanDetectForms(const UnkStruct_ov21_021D3320 *param0); +void ov21_021D3960(UnkStruct_ov21_021D3320 *param0); +u32 ov21_021D3998(const UnkStruct_ov21_021D3320 *param0); + +#endif // POKEPLATINUM_POKEDEXSORT_H diff --git a/include/overlay021/sorted_pokedex.h b/include/overlay021/sorted_pokedex.h new file mode 100644 index 0000000000..a2a976c5d1 --- /dev/null +++ b/include/overlay021/sorted_pokedex.h @@ -0,0 +1,17 @@ +#ifndef POKEPLATINUM_SORTEDPOKEDEX_H +#define POKEPLATINUM_SORTEDPOKEDEX_H + +#include "constants/species.h" + +#include "overlay021/species_caught_status.h" + +typedef struct { + SpeciesCaughtStatus caughtStatusArray[NATIONAL_DEX_COUNT]; + int currentStatusIndex; + int caughtStatusLength; + int displayPokedex[NATIONAL_DEX_COUNT]; // contains index for caughtStatusArray, not species + int currentDisplayIndex; + int numDisplayed; +} SortedPokedex; + +#endif // POKEPLATINUM_SORTEDPOKEDEX_H diff --git a/include/overlay021/species_caught_status.h b/include/overlay021/species_caught_status.h new file mode 100644 index 0000000000..dedcbc5507 --- /dev/null +++ b/include/overlay021/species_caught_status.h @@ -0,0 +1,15 @@ +#ifndef POKEPLATINUM_SPECIESCAUGHTSTATUS_H +#define POKEPLATINUM_SPECIESCAUGHTSTATUS_H + +enum CaughtStatus { + CS_UNENCOUNTERED = 0, + CS_ENCOUNTERED = 1, + CS_CAUGHT = 2, +}; + +typedef struct { + int species; + enum CaughtStatus caughtStatus; +} SpeciesCaughtStatus; + +#endif // POKEPLATINUM_SPECIESCAUGHTSTATUS_H diff --git a/include/overlay021/struct_ov21_021D0D80.h b/include/overlay021/struct_ov21_021D0D80.h index 8000e02faf..d030460fa2 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 fullmoonIslandVisible; + BOOL newmoonIslandVisible; + BOOL springPathVisible; + BOOL seabreakPathVisible; 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 deleted file mode 100644 index bbef0c564a..0000000000 --- a/include/overlay021/struct_ov21_021D0D80_1.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef POKEPLATINUM_STRUCT_OV21_021D0D80_1_H -#define POKEPLATINUM_STRUCT_OV21_021D0D80_1_H - -#include "struct_decls/pokedexdata_decl.h" -#include "struct_decls/struct_0209ACBC_decl.h" - -#include "trainer_info.h" - -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; - UnkStruct_0209ACBC *unk_1C; -} UnkStruct_ov21_021D0D80_1; - -#endif // POKEPLATINUM_STRUCT_OV21_021D0D80_1_H diff --git a/include/overlay021/struct_ov21_021D3208.h b/include/overlay021/struct_ov21_021D3208.h index 13d0b724d2..af1a3624c8 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 fullmoonIslandVisible; + BOOL newmoonIslandVisible; + BOOL springPathVisible; + BOOL seabreakPathVisible; 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..73e93ba8be 100644 --- a/include/overlay021/struct_ov21_021D3320.h +++ b/include/overlay021/struct_ov21_021D3320.h @@ -4,30 +4,30 @@ #include "struct_decls/pokedexdata_decl.h" #include "struct_decls/struct_02098700_decl.h" -#include "overlay021/struct_ov21_021D3A60.h" +#include "overlay021/sorted_pokedex.h" #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; + SortedPokedex sortedPokedex; + int isNationalDex; + BOOL isNationalDexUnlocked; + 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; + BOOL fullmoonIslandVisible; + BOOL newmoonIslandVisible; + BOOL springPathVisible; + BOOL seabreakPathVisible; } UnkStruct_ov21_021D3320; #endif // POKEPLATINUM_STRUCT_OV21_021D3320_H diff --git a/include/overlay021/struct_ov21_021D37DC.h b/include/overlay021/struct_ov21_021D37DC.h deleted file mode 100644 index 900d888f07..0000000000 --- a/include/overlay021/struct_ov21_021D37DC.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef POKEPLATINUM_STRUCT_OV21_021D37DC_H -#define POKEPLATINUM_STRUCT_OV21_021D37DC_H - -typedef struct { - int unk_00; - int unk_04; -} UnkStruct_ov21_021D37DC; - -#endif // POKEPLATINUM_STRUCT_OV21_021D37DC_H diff --git a/include/overlay021/struct_ov21_021D3A60.h b/include/overlay021/struct_ov21_021D3A60.h deleted file mode 100644 index 912161f845..0000000000 --- a/include/overlay021/struct_ov21_021D3A60.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef POKEPLATINUM_STRUCT_OV21_021D3A60_H -#define POKEPLATINUM_STRUCT_OV21_021D3A60_H - -#include "constants/species.h" - -#include "overlay021/struct_ov21_021D37DC.h" - -typedef struct { - UnkStruct_ov21_021D37DC unk_00[NATIONAL_DEX_COUNT]; - int unk_F68; - int unk_F6C; - int unk_F70[NATIONAL_DEX_COUNT]; - int unk_1724; - int unk_1728; -} UnkStruct_ov21_021D3A60; - -#endif // POKEPLATINUM_STRUCT_OV21_021D3A60_H diff --git a/include/overlay021/struct_ov21_021D4CB8.h b/include/overlay021/struct_ov21_021D4CB8.h index 49f1eabbdd..2a6e76b1ad 100644 --- a/include/overlay021/struct_ov21_021D4CB8.h +++ b/include/overlay021/struct_ov21_021D4CB8.h @@ -7,6 +7,7 @@ #include "bg_window.h" #include "cell_actor.h" +#include "heap.h" typedef struct { UnkStruct_ov21_021D4C0C *unk_00; @@ -18,7 +19,7 @@ typedef struct { int unk_18; int unk_1C; int unk_20; - int unk_24; + enum HeapId heapID; } UnkStruct_ov21_021D4CB8; #endif // POKEPLATINUM_STRUCT_OV21_021D4CB8_H diff --git a/include/overlay021/struct_ov21_021D5844.h b/include/overlay021/struct_ov21_021D5844.h deleted file mode 100644 index 144c5ec7b1..0000000000 --- a/include/overlay021/struct_ov21_021D5844.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef POKEPLATINUM_STRUCT_OV21_021D5844_H -#define POKEPLATINUM_STRUCT_OV21_021D5844_H - -typedef struct { - int *unk_00; - int unk_04; -} UnkStruct_ov21_021D5844; - -#endif // POKEPLATINUM_STRUCT_OV21_021D5844_H diff --git a/include/overlay021/struct_ov21_021D5868.h b/include/overlay021/struct_ov21_021D5868.h deleted file mode 100644 index 1fb797dcfc..0000000000 --- a/include/overlay021/struct_ov21_021D5868.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef POKEPLATINUM_STRUCT_OV21_021D5868_H -#define POKEPLATINUM_STRUCT_OV21_021D5868_H - -typedef struct { - u8 unk_00; - u8 unk_01; - u8 unk_02; - u8 unk_03; -} UnkStruct_ov21_021D5868; - -#endif // POKEPLATINUM_STRUCT_OV21_021D5868_H diff --git a/include/overlay021/struct_ov21_021D5890.h b/include/overlay021/struct_ov21_021D5890.h deleted file mode 100644 index 4280e97b43..0000000000 --- a/include/overlay021/struct_ov21_021D5890.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef POKEPLATINUM_STRUCT_OV21_021D5890_H -#define POKEPLATINUM_STRUCT_OV21_021D5890_H - -typedef struct { - u8 unk_00; - u8 unk_01; - u8 unk_02; - u8 unk_03; - u8 unk_04[32]; -} UnkStruct_ov21_021D5890; - -#endif // POKEPLATINUM_STRUCT_OV21_021D5890_H diff --git a/include/overlay021/struct_ov21_021E6A68.h b/include/overlay021/struct_ov21_021E6A68.h index fcceb7fc3d..20852a1991 100644 --- a/include/overlay021/struct_ov21_021E6A68.h +++ b/include/overlay021/struct_ov21_021E6A68.h @@ -1,9 +1,11 @@ #ifndef POKEPLATINUM_STRUCT_OV21_021E6A68_H #define POKEPLATINUM_STRUCT_OV21_021E6A68_H +#include "constants/heap.h" + typedef struct { int unk_00; - int unk_04; + enum HeapId 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..bd792f2669 100644 --- a/include/overlay021/struct_ov21_021E6B20.h +++ b/include/overlay021/struct_ov21_021E6B20.h @@ -1,9 +1,11 @@ #ifndef POKEPLATINUM_STRUCT_OV21_021E6B20_H #define POKEPLATINUM_STRUCT_OV21_021E6B20_H +#include "heap.h" + typedef struct { int unk_00; - int unk_04; + enum HeapId 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_0206AFE0.h b/include/unk_0206AFE0.h index 42add11853..cfd3015fed 100644 --- a/include/unk_0206AFE0.h +++ b/include/unk_0206AFE0.h @@ -4,6 +4,13 @@ #include "savedata.h" #include "vars_flags.h" +enum HiddenLocations { + HL_FULLMOONISLAND = 0, + HL_NEWMOONISLAND = 1, + HL_SPRINGPATH = 2, + HL_SEABREAKPATH = 3, +}; + BOOL sub_0206B024(VarsFlags *param0, u16 param1); u16 sub_0206B034(VarsFlags *param0); BOOL sub_0206B044(VarsFlags *param0, u16 param1); @@ -21,7 +28,7 @@ void sub_0206B144(VarsFlags *param0, int param1); BOOL sub_0206B16C(VarsFlags *param0, int param1); void sub_0206B1B0(VarsFlags *param0, int param1); void sub_0206B1D8(VarsFlags *param0, int param1); -BOOL sub_0206B1F0(VarsFlags *param0, int param1); +BOOL VarFlags_HiddenLocationsUnlocked(VarsFlags *varsFlags, int hiddenLocation); BOOL sub_0206B218(VarsFlags *param0); u16 sub_0206B228(VarsFlags *param0); BOOL sub_0206B238(VarsFlags *param0); diff --git a/platinum.us/main.lsf b/platinum.us/main.lsf index 9152c63fcc..38617c47b9 100644 --- a/platinum.us/main.lsf +++ b/platinum.us/main.lsf @@ -786,15 +786,15 @@ 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 Object main.nef.p/src_overlay021_ov21_021D4C0C.c.o Object main.nef.p/src_overlay021_ov21_021D4EE4.c.o - Object main.nef.p/src_overlay021_ov21_021D517C.c.o + Object main.nef.p/src_overlay021_pokedex_field_map.c.o Object main.nef.p/src_overlay021_ov21_021D5600.c.o - Object main.nef.p/src_overlay021_ov21_021D57B4.c.o + Object main.nef.p/src_overlay021_pokedex_enc_data.c.o Object main.nef.p/src_overlay021_ov21_021D5AEC.c.o Object main.nef.p/src_overlay021_ov21_021D76B0.c.o Object main.nef.p/src_overlay021_ov21_021D85B0.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..d6c47529ec 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 @@ -9,7 +8,8 @@ foreach f : prebuilt_files endforeach personal_files = [] -sinnoh_pokedex = files('../../../../pokemon/sinnoh_pokedex.json') +pokemon_folder = meson.project_source_root() / 'res' / 'pokemon' +encounter_folder = meson.project_source_root() / 'res' / 'field' / 'encounters' # Generate NARCs pokedex_data_narc = custom_target('zukan_data.narc', @@ -20,10 +20,9 @@ pokedex_data_narc = custom_target('zukan_data.narc', command: [ make_pokedex_data_py, '--knarc', knarc_exe, - '--source-dir', '@CURRENT_SOURCE_DIR@', + '--source-dir', pokemon_folder, '--private-dir', '@PRIVATE_DIR@', '--output-dir', '@OUTDIR@', - sinnoh_pokedex, 'giratina_origin' ] ) @@ -36,13 +35,27 @@ pokedex_data_giratina_altered_narc = custom_target('zukan_data_gira.narc', command: [ make_pokedex_data_py, '--knarc', knarc_exe, - '--source-dir', '@CURRENT_SOURCE_DIR@', + '--source-dir', pokemon_folder, '--private-dir', '@PRIVATE_DIR@', '--output-dir', '@OUTDIR@', - sinnoh_pokedex, 'giratina_altered' ] ) +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', encounter_folder, + '--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_map_change.c b/src/field_map_change.c index 3afc4cd8e1..064e919d2e 100644 --- a/src/field_map_change.c +++ b/src/field_map_change.c @@ -372,11 +372,11 @@ static void FieldMapChange_InitTerrainCollisionManager(FieldSystem *fieldSystem) GF_ASSERT(fieldSystem->terrainCollisionMan == NULL); sub_02039DC0(fieldSystem->location->mapId, fieldSystem->unk_2C); - if (sub_0206B1F0(SaveData_GetVarsFlags(fieldSystem->saveData), 3)) { + if (VarFlags_HiddenLocationsUnlocked(SaveData_GetVarsFlags(fieldSystem->saveData), HL_SEABREAKPATH)) { sub_02039FE0(fieldSystem->unk_2C); // reveal Seabreak Path if Oak's Letter has been used } - if (!sub_0206B1F0(SaveData_GetVarsFlags(fieldSystem->saveData), 2)) { + if (!VarFlags_HiddenLocationsUnlocked(SaveData_GetVarsFlags(fieldSystem->saveData), HL_SPRINGPATH)) { sub_02039F8C(fieldSystem->unk_2C); } diff --git a/src/field_menu.c b/src/field_menu.c index 27cd47aadd..eac31e26b3 100644 --- a/src/field_menu.c +++ b/src/field_menu.c @@ -954,11 +954,11 @@ static BOOL FieldMenu_Pokedex(FieldTask *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->fullmoonIslandVisible = VarFlags_HiddenLocationsUnlocked(v5, HL_FULLMOONISLAND); + v2->newmoonIslandVisible = VarFlags_HiddenLocationsUnlocked(v5, HL_NEWMOONISLAND); + v2->springPathVisible = VarFlags_HiddenLocationsUnlocked(v5, HL_SPRINGPATH); + v2->seabreakPathVisible = VarFlags_HiddenLocationsUnlocked(v5, HL_SEABREAKPATH); v2->unk_1C = fieldSystem->unk_B4; sub_0203E0AC(fieldSystem, v2); diff --git a/src/meson.build b/src/meson.build index e89329c1f4..e3dba7bb92 100644 --- a/src/meson.build +++ b/src/meson.build @@ -597,15 +597,15 @@ 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', 'overlay021/ov21_021D4C0C.c', 'overlay021/ov21_021D4EE4.c', - 'overlay021/ov21_021D517C.c', + 'overlay021/pokedex_field_map.c', 'overlay021/ov21_021D5600.c', - 'overlay021/ov21_021D57B4.c', + 'overlay021/pokedex_enc_data.c', 'overlay021/ov21_021D5AEC.c', 'overlay021/ov21_021D76B0.c', 'overlay021/ov21_021D85B0.c', diff --git a/src/overlay021/ov21_021D0D80.c b/src/overlay021/ov21_021D0D80.c index 0f2889b63e..41cab61def 100644 --- a/src/overlay021/ov21_021D0D80.c +++ b/src/overlay021/ov21_021D0D80.c @@ -7,10 +7,10 @@ #include "struct_decls/struct_0209ACBC_decl.h" #include "struct_defs/struct_02099F80.h" +#include "overlay021/STRUCT_OV21_021D3208.h" #include "overlay021/funcptr_ov21_021E9B74.h" #include "overlay021/funcptr_ov21_021E9B9C.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" #include "overlay021/ov21_021D3FE0.h" #include "overlay021/ov21_021D423C.h" #include "overlay021/ov21_021D4340.h" @@ -33,14 +33,13 @@ #include "overlay021/ov21_021E68F4.h" #include "overlay021/ov21_021E737C.h" #include "overlay021/ov21_021E8484.h" +#include "overlay021/pokedex_sort.h" +#include "overlay021/species_caught_status.h" #include "overlay021/struct_ov21_021D0D80.h" -#include "overlay021/struct_ov21_021D0D80_1.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D157C.h" #include "overlay021/struct_ov21_021D22F8.h" -#include "overlay021/struct_ov21_021D3208.h" #include "overlay021/struct_ov21_021D3320.h" -#include "overlay021/struct_ov21_021D37DC.h" #include "overlay021/struct_ov21_021D3FE0_decl.h" #include "overlay021/struct_ov21_021D423C_decl.h" #include "overlay021/struct_ov21_021D4660.h" @@ -119,7 +118,7 @@ int ov21_021D0D80(OverlayManager *param0, int *param1) { UnkStruct_ov21_021D0F18 *v0; UnkStruct_ov21_021D0D80 *v1; - UnkStruct_ov21_021D0D80_1 v2; + UnkStruct_ov21_021D0D80 v2; BOOL v3; sub_02004550(54, 0, 0); @@ -152,11 +151,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.fullmoonIslandVisible = v1->fullmoonIslandVisible; + v2.seabreakPathVisible = v1->seabreakPathVisible; + v2.newmoonIslandVisible = v1->newmoonIslandVisible; + v2.springPathVisible = v1->springPathVisible; v2.unk_1C = v1->unk_1C; v0->unk_00 = ov21_021D0F60(37, &v2); @@ -296,7 +295,7 @@ const static UnkFuncPtr_ov21_021E9B9C Unk_ov21_021E9B54[8] = { ov21_021E84E4 }; -UnkStruct_ov21_021D0F60 *ov21_021D0F60(int param0, const UnkStruct_ov21_021D0D80_1 *param1) +UnkStruct_ov21_021D0F60 *ov21_021D0F60(int param0, const UnkStruct_ov21_021D0D80 *param1) { UnkStruct_ov21_021D0F60 *v0; int v1; @@ -318,17 +317,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.fullmoonIslandVisible = param1->fullmoonIslandVisible; + v2.newmoonIslandVisible = param1->newmoonIslandVisible; + v2.springPathVisible = param1->springPathVisible; + v2.seabreakPathVisible = param1->seabreakPathVisible; v2.unk_1C = sub_0209ACE4(param1->unk_1C); v2.unk_20 = sub_0209ACEC(param1->unk_1C); - ov21_021D3208(&v0->unk_0C, &v2, param0); + PokedexSort_PopulatePokedexStatus(&v0->unk_0C, &v2, param0); ov21_021D1FA4(&v0->unk_177C, param0); for (v1 = 0; v1 < 10; v1++) { @@ -678,7 +677,7 @@ Window *ov21_021D16D8(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D { Window *v0; - if (ov21_021D36D8(param1) == 0) { + if (PokedexStatus_IsNationalDex(param1) == 0) { v0 = ov21_021D172C(param0->unk_14C, param2, param3); } else { v0 = ov21_021D170C(param0->unk_14C, param2, param3); @@ -714,7 +713,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 UnkStruct_ov21_021D3320 *param1, int param2, int statusIndex, fx32 param4, fx32 param5) { CellActor *v0; CellActor *v1; @@ -722,10 +721,10 @@ void ov21_021D1778(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D332 Window *v3; SpriteResource *v4; VecFx32 v5; - const UnkStruct_ov21_021D37DC *v6; - u32 v7 = ov21_021D36D8(param1); + const SpeciesCaughtStatus *speciesCaughtStatus; + u32 v7 = PokedexStatus_IsNationalDex(param1); - v6 = ov21_021D37DC(param1, param3); + speciesCaughtStatus = PokedexSort_StatusIndexToCaughtStatus(param1, statusIndex); v0 = ov21_021D22A8(param0); v1 = ov21_021D22C4(param0); @@ -735,7 +734,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 == CS_CAUGHT) { v5.x = param4 + (-54 * FX32_ONE); v5.y = param5; @@ -755,12 +754,12 @@ void ov21_021D1778(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D332 v2.unk_18 = 0; v2.unk_1C = 0; v2.unk_20 = NNS_G2D_VRAM_TYPE_2DMAIN; - v2.unk_24 = param2; + v2.heapID = 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); } @@ -785,9 +784,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, UnkStruct_ov21_021D3320 *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; @@ -816,7 +815,7 @@ 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; } } @@ -1030,7 +1029,7 @@ static void ov21_021D1D08(UnkStruct_ov21_021D0F60 *param0) sub_0209ACF0(param0->unk_08, 2); } - ov21_021D3320(¶m0->unk_0C); + PokedexSort_PokedexStatusFreeHWData(¶m0->unk_0C); ov21_021D2098(¶m0->unk_177C); Heap_FreeToHeap(param0); } diff --git a/src/overlay021/ov21_021D3208.c b/src/overlay021/ov21_021D3208.c deleted file mode 100644 index fae6df5e40..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 "graphics.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_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 (Pokedex_IsNationalDexObtained(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 Pokedex_IsNationalDexObtained(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 (Pokedex_HasSeenSpecies(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_HasCaughtSpecies(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_HasCaughtSpecies(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 = LoadMemberFromNARC_OutFileSize(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_021D4C0C.c b/src/overlay021/ov21_021D4C0C.c index 9e2508cf71..478fd2bbed 100644 --- a/src/overlay021/ov21_021D4C0C.c +++ b/src/overlay021/ov21_021D4C0C.c @@ -72,7 +72,7 @@ UnkStruct_ov21_021D4CA0 *ov21_021D4CA0(const UnkStruct_ov21_021D4CB8 *param0) { int v0; - v0 = sub_02012898(param0->unk_04, param0->unk_20, param0->unk_24); + v0 = sub_02012898(param0->unk_04, param0->unk_20, param0->heapID); return ov21_021D4CB8(param0, v0); } @@ -97,7 +97,7 @@ UnkStruct_ov21_021D4CA0 *ov21_021D4CB8(const UnkStruct_ov21_021D4CB8 *param0, in v0.unk_20 = param0->unk_18; v0.unk_24 = param0->unk_1C; v0.unk_28 = param0->unk_20; - v0.unk_2C = param0->unk_24; + v0.unk_2C = param0->heapID; v1->unk_00 = sub_020127E8(&v0); diff --git a/src/overlay021/ov21_021D517C.c b/src/overlay021/ov21_021D517C.c deleted file mode 100644 index e7a1c0b215..0000000000 --- a/src/overlay021/ov21_021D517C.c +++ /dev/null @@ -1,275 +0,0 @@ -#include "overlay021/ov21_021D517C.h" - -#include -#include - -#include "bg_window.h" - -static void ov21_021D5248(Window *param0, u8 *param1, u16 param2, u16 param3, int param4, int param5, u8 param6, u8 param7); -static void ov21_021D52A0(u8 *param0, int param1, int param2, int param3, int param4); -static int ov21_021D52D4(u8 *param0, int param1, int param2, int param3, int param4); -static void ov21_021D5304(u8 *param0, int *param1, int param2, int param3, int param4, int param5); -static int ov21_021D5424(int param0); - -void ov21_021D517C(Window *param0, u8 *param1, u16 param2, u16 param3, u8 param4, u8 *param5, u8 param6, u8 param7, u16 param8, u16 param9) -{ - int v0, v1; - - for (v0 = 0; v0 < param7; v0++) { - for (v1 = 0; v1 < param6; v1++) { - ov21_021D5248(param0, param1, param2, param3, param4, param5[(v0 * param7) + v1], param8 + (v1 * param4), param9 + (v0 * param4)); - } - } -} - -void ov21_021D5214(u8 *param0, u8 param1, u8 param2) -{ - int v0, v1; - - for (v0 = 0; v0 < param2; v0++) { - for (v1 = 0; v1 < param1; v1++) { - ov21_021D52A0(param0, v1, v0, param1, param2); - } - } -} - -static void ov21_021D5248(Window *param0, u8 *param1, u16 param2, u16 param3, int param4, int param5, u8 param6, u8 param7) -{ - int v0; - int v1; - - if (param5 != 0) { - v0 = param5 * param4; - v1 = v0 / param2; - v0 = v0 % param2; - - Window_BlitBitmapRect(param0, param1, v0, v1, param2, param3, param6, param7, param4, param4); - } -} - -static void ov21_021D52A0(u8 *param0, int param1, int param2, int param3, int param4) -{ - int v0; - int v1; - - if (param0[(param2 * param3) + param1] == 0) { - ov21_021D5304(param0, &v0, param1, param2, param3, param4); - - v1 = ov21_021D5424(v0); - param0[(param2 * param3) + param1] = v1; - } -} - -static int ov21_021D52D4(u8 *param0, int param1, int param2, int param3, int param4) -{ - if ((param1 < 0) || (param1 >= param3)) { - return -1; - } - - if ((param2 < 0) || (param2 >= param4)) { - return -1; - } - - return param0[(param2 * param3) + param1]; -} - -static void ov21_021D5304(u8 *param0, int *param1, int param2, int param3, int param4, int param5) -{ - int v0; - - *param1 = 0; - - if (ov21_021D52D4(param0, param2, param3 - 1, param4, param5) == 1) { - *param1 |= (1 << 0); - } - - if (ov21_021D52D4(param0, param2, param3 + 1, param4, param5) == 1) { - *param1 |= (1 << 1); - } - - if (ov21_021D52D4(param0, param2 - 1, param3, param4, param5) == 1) { - *param1 |= (1 << 2); - } - - if (ov21_021D52D4(param0, param2 + 1, param3, param4, param5) == 1) { - *param1 |= (1 << 3); - } - - if ((((*param1) & (1 << 0)) == 0) && (((*param1) & (1 << 2)) == 0)) { - if (ov21_021D52D4(param0, param2 - 1, param3 - 1, param4, param5) == 1) { - *param1 |= (1 << 4); - } - } - - if ((((*param1) & (1 << 0)) == 0) && (((*param1) & (1 << 3)) == 0)) { - if (ov21_021D52D4(param0, param2 + 1, param3 - 1, param4, param5) == 1) { - *param1 |= (1 << 5); - } - } - - if ((((*param1) & (1 << 1)) == 0) && (((*param1) & (1 << 2)) == 0)) { - if (ov21_021D52D4(param0, param2 - 1, param3 + 1, param4, param5) == 1) { - *param1 |= (1 << 6); - } - } - - if ((((*param1) & (1 << 1)) == 0) && (((*param1) & (1 << 3)) == 0)) { - if (ov21_021D52D4(param0, param2 + 1, param3 + 1, param4, param5) == 1) { - *param1 |= (1 << 7); - } - } -} - -static int ov21_021D5424(int param0) -{ - int v0; - - switch (param0) { - case 0: - v0 = 0; - break; - case ((1 << 0)): - v0 = 2; - break; - case ((1 << 1)): - v0 = 3; - break; - case ((1 << 2)): - v0 = 4; - break; - case ((1 << 3)): - v0 = 5; - break; - case ((1 << 0) | (1 << 1)): - v0 = 6; - break; - case ((1 << 0) | (1 << 2)): - v0 = 7; - break; - case ((1 << 0) | (1 << 3)): - v0 = 8; - break; - case ((1 << 1) | (1 << 2)): - v0 = 9; - break; - case ((1 << 1) | (1 << 3)): - v0 = 10; - break; - case ((1 << 2) | (1 << 3)): - v0 = 11; - break; - case ((1 << 0) | (1 << 1) | (1 << 2)): - v0 = 12; - break; - case ((1 << 0) | (1 << 1) | (1 << 3)): - v0 = 13; - break; - case ((1 << 0) | (1 << 2) | (1 << 3)): - v0 = 14; - break; - case ((1 << 1) | (1 << 2) | (1 << 3)): - v0 = 15; - break; - case ((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3)): - v0 = 16; - break; - case ((1 << 4)): - v0 = 17; - break; - case ((1 << 5)): - v0 = 18; - break; - case ((1 << 6)): - v0 = 19; - break; - case ((1 << 7)): - v0 = 20; - break; - case ((1 << 4) | (1 << 5)): - v0 = 21; - break; - case ((1 << 4) | (1 << 6)): - v0 = 22; - break; - case ((1 << 4) | (1 << 7)): - v0 = 23; - break; - case ((1 << 5) | (1 << 6)): - v0 = 24; - break; - case ((1 << 5) | (1 << 7)): - v0 = 25; - break; - case ((1 << 6) | (1 << 7)): - v0 = 26; - break; - case ((1 << 4) | (1 << 5) | (1 << 6)): - v0 = 27; - break; - case ((1 << 4) | (1 << 5) | (1 << 7)): - v0 = 28; - break; - case ((1 << 4) | (1 << 6) | (1 << 7)): - v0 = 29; - break; - case ((1 << 5) | (1 << 6) | (1 << 7)): - v0 = 30; - break; - case ((1 << 4) | (1 << 5) | (1 << 6) | (1 << 7)): - v0 = 31; - break; - case ((1 << 0) | (1 << 6) | (1 << 7)): - v0 = 32; - break; - case ((1 << 1) | (1 << 4) | (1 << 5)): - v0 = 33; - break; - case ((1 << 2) | (1 << 5) | (1 << 7)): - v0 = 34; - break; - case ((1 << 3) | (1 << 4) | (1 << 6)): - v0 = 35; - break; - case ((1 << 0) | (1 << 2) | (1 << 7)): - v0 = 36; - break; - case ((1 << 0) | (1 << 3) | (1 << 6)): - v0 = 37; - break; - case ((1 << 1) | (1 << 2) | (1 << 5)): - v0 = 38; - break; - case ((1 << 1) | (1 << 3) | (1 << 4)): - v0 = 39; - break; - case ((1 << 0) | (1 << 6)): - v0 = 40; - break; - case ((1 << 0) | (1 << 7)): - v0 = 41; - break; - case ((1 << 1) | (1 << 4)): - v0 = 42; - break; - case ((1 << 1) | (1 << 5)): - v0 = 43; - break; - case ((1 << 2) | (1 << 5)): - v0 = 44; - break; - case ((1 << 2) | (1 << 7)): - v0 = 45; - break; - case ((1 << 3) | (1 << 4)): - v0 = 46; - break; - case ((1 << 3) | (1 << 6)): - v0 = 47; - break; - default: - GF_ASSERT(0); - break; - } - - return v0; -} diff --git a/src/overlay021/ov21_021D57B4.c b/src/overlay021/ov21_021D57B4.c deleted file mode 100644 index 15145cc8d2..0000000000 --- a/src/overlay021/ov21_021D57B4.c +++ /dev/null @@ -1,178 +0,0 @@ -#include "overlay021/ov21_021D57B4.h" - -#include -#include - -#include "overlay021/struct_ov21_021D5844.h" -#include "overlay021/struct_ov21_021D5868.h" -#include "overlay021/struct_ov21_021D5890.h" - -#include "cell_actor.h" -#include "graphics.h" -#include "heap.h" -#include "narc.h" - -void ov21_021D57B4(UnkStruct_ov21_021D5844 *param0, int param1, int param2, int param3) -{ - int v0; - u32 v1; - - switch (param2) { - case 0: - v0 = 4; - break; - case 1: - v0 = 499; - break; - case 2: - v0 = 994; - break; - case 3: - v0 = 1489; - break; - case 4: - v0 = 1984; - break; - case 5: - v0 = 2479; - break; - case 6: - v0 = 2974; - break; - case 7: - v0 = 3469; - break; - case 8: - v0 = 3964; - break; - case 9: - v0 = 4459; - break; - } - - param0->unk_00 = (int *)LoadMemberFromNARC_OutFileSize(NARC_INDEX_APPLICATION__ZUKANLIST__ZKN_DATA__ZUKAN_ENC_PLATINUM, v0 + param1, 0, param3, 0, &v1); - param0->unk_04 = v1 / sizeof(int); -} - -void ov21_021D5844(UnkStruct_ov21_021D5844 *param0) -{ - GF_ASSERT(param0); - GF_ASSERT(param0->unk_00); - - Heap_FreeToHeap(param0->unk_00); - - param0->unk_00 = NULL; - param0->unk_04 = 0; -} - -UnkStruct_ov21_021D5868 *ov21_021D5868(int param0, int *param1) -{ - UnkStruct_ov21_021D5868 *v0; - u32 v1; - - v0 = (UnkStruct_ov21_021D5868 *)LoadMemberFromNARC_OutFileSize(NARC_INDEX_APPLICATION__ZUKANLIST__ZKN_DATA__ZUKAN_ENC_PLATINUM, 0, 0, param0, 0, &v1); - - if (param1) { - *param1 = v1 / sizeof(UnkStruct_ov21_021D5868); - } - - return v0; -} - -UnkStruct_ov21_021D5890 *ov21_021D5890(int param0, int *param1) -{ - UnkStruct_ov21_021D5890 *v0; - u32 v1; - - v0 = (UnkStruct_ov21_021D5890 *)LoadMemberFromNARC_OutFileSize(NARC_INDEX_APPLICATION__ZUKANLIST__ZKN_DATA__ZUKAN_ENC_PLATINUM, 2, 0, param0, 0, &v1); - - if (param1) { - *param1 = v1 / sizeof(UnkStruct_ov21_021D5890); - } - - return v0; -} - -void ov21_021D58C0(u8 *param0, u8 param1, u8 param2, const UnkStruct_ov21_021D5890 *param3) -{ - int v0, v1; - - GF_ASSERT((param3->unk_01 + param3->unk_03) < param2); - 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)]; - } - } -} - -u32 ov21_021D5948(u8 *param0, int param1, int param2, const UnkStruct_ov21_021D5890 *param3, const UnkStruct_ov21_021D5844 *param4, const u8 *param5, u32 param6) -{ - int v0; - int v1; - u32 v2 = 0; - - for (v0 = 0; v0 < param4->unk_04 - 1; v0++) { - GF_ASSERT(param4->unk_00[v0]); - - for (v1 = 0; v1 < param6; v1++) { - if (param4->unk_00[v0] == param5[v1]) { - break; - } - } - - if (v1 >= param6) { - ov21_021D58C0(param0, param1, param2, ¶m3[param4->unk_00[v0]]); - v2++; - } - } - - return v2; -} - -void ov21_021D59D8(CellActor *param0, int param1, int param2, int param3, int param4, const UnkStruct_ov21_021D5868 *param5, int param6, int param7) -{ - VecFx32 v0; - - v0.x = (param5->unk_00 * param3) + param1; - v0.y = (param5->unk_01 * param4) + param2; - v0.x <<= FX32_SHIFT; - v0.y <<= FX32_SHIFT; - - CellActor_SetPosition(param0, &v0); - - if (param5->unk_02) { - CellActor_SetAnim(param0, param7); - } else { - CellActor_SetAnim(param0, param6); - } -} - -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 v0, v1; - int v2 = param1; - int v3 = 0; - - for (v0 = 0; v0 < param8->unk_04 - 1; v0++) { - GF_ASSERT(param8->unk_00[v0]); - GF_ASSERT(v2 < param2); - - for (v1 = 0; v1 < param12; v1++) { - if (param8->unk_00[v0] == param11[v1]) { - break; - } - } - - if (v1 >= param12) { - ov21_021D59D8(param0[v2], param3, param4, param5, param6, ¶m7[param8->unk_00[v0]], param9, param10); - v2++; - v3++; - } - } - - *param13 = v3; - - return v2; -} diff --git a/src/overlay021/ov21_021D5AEC.c b/src/overlay021/ov21_021D5AEC.c index ff34115289..bf2fe8e30f 100644 --- a/src/overlay021/ov21_021D5AEC.c +++ b/src/overlay021/ov21_021D5AEC.c @@ -7,14 +7,14 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" #include "overlay021/ov21_021D4340.h" #include "overlay021/ov21_021D4C0C.h" +#include "overlay021/pokedex_sort.h" +#include "overlay021/species_caught_status.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D157C.h" #include "overlay021/struct_ov21_021D2648.h" -#include "overlay021/struct_ov21_021D37DC.h" #include "overlay021/struct_ov21_021D4660.h" #include "overlay021/struct_ov21_021D4CA0.h" #include "overlay021/struct_ov21_021D4CB8.h" @@ -144,7 +144,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); @@ -299,13 +299,13 @@ 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)); ov21_021D5F58(v0, param0->unk_08); - ov21_021D38C0(v0->unk_04); + PokedexSort_UpdateCurrentValues(v0->unk_04); v0->unk_1C = 1; v0->unk_20 = 0; @@ -332,7 +332,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; @@ -356,7 +356,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); @@ -365,9 +365,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) { @@ -412,19 +412,19 @@ static int ov21_021D5E2C(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo return 0; } - v4 = ov21_021D3898(v1->unk_04); + v4 = PokedexSort_CurrentDisplayIndex(v1->unk_04); 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); @@ -444,7 +444,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 { @@ -570,9 +570,9 @@ static BOOL ov21_021D601C(UnkStruct_ov21_021D5B68 *param0, UnkStruct_ov21_021D74 } if (param0->unk_2C) { - int v0 = ov21_021D3898(param0->unk_04); + int v0 = PokedexSort_CurrentDisplayIndex(param0->unk_04); - if (ov21_021D38B0(param0->unk_04, v0) != (NATIONAL_DEX_COUNT + 1)) { + if (PokedexSort_DisplayIndexToStatusIndex(param0->unk_04, v0) != (NATIONAL_DEX_COUNT + 1)) { ov21_021D7464(param1, param0); Sound_PlayEffect(1501); return 1; @@ -623,15 +623,15 @@ static void ov21_021D60FC(UnkStruct_ov21_021D5B68 *param0, UnkStruct_ov21_021D74 static BOOL ov21_021D6108(UnkStruct_ov21_021D5B68 *param0, int param1) { - return ov21_021D3844(param0->unk_04, param1); + return PokedexSort_TakeStep(param0->unk_04, param1); } static void ov21_021D6114(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13FC *param1, const UnkStruct_ov21_021D5B68 *param2, int param3) { 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_021D637C(param0, param1, param3, PokedexStatus_IsNationalDex(param2->unk_04)); + ov21_021D63DC(param1, param3, PokedexSort_NumEncountered(param2->unk_04), PokedexSort_NumCaught(param2->unk_04)); ov21_021D6538(param0, param3); ov21_021D65DC(param0, param1, param3); ov21_021D6744(param0, param1, param3); @@ -673,7 +673,7 @@ static void ov21_021D61F4(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13 Heap_FreeToHeap(v0); ov21_021D62E4(param1, param3); - ov21_021D637C(param0, param1, param3, ov21_021D36D8(param2->unk_04)); + ov21_021D637C(param0, param1, param3, PokedexStatus_IsNationalDex(param2->unk_04)); ov21_021D6538(param0, param3); ov21_021D65DC(param0, param1, param3); ov21_021D6744(param0, param1, param3); @@ -681,7 +681,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, PokedexSort_NumEncountered(param2->unk_04)); ov21_021D6994(param0, param2); ov21_021D69A0(param0, param2); ov21_021D6AE4(param0, param2); @@ -870,8 +870,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 SpeciesCaughtStatus *pokeCaughtStatus; + int dexIndex; v4.unk_00 = param1->unk_14C; v4.unk_08 = param0->unk_90.paletteProxy; @@ -881,11 +881,11 @@ static void ov21_021D67EC(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13 v4.unk_18 = 2; v4.unk_1C = 0; v4.unk_20 = NNS_G2D_VRAM_TYPE_2DMAIN; - v4.unk_24 = param3; + v4.heapID = param3; - v1 = ov21_021D3898(param2->unk_04) - 4; + v1 = PokedexSort_CurrentDisplayIndex(param2->unk_04) - 4; v2 = param0->unk_24; - v3 = ov21_021D38A4(param2->unk_04); + v3 = PokedexSort_NumDisplayed(param2->unk_04); for (v0 = 0; v0 < 9; v0++) { if (param0->unk_28[v2]) { @@ -894,11 +894,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 = PokedexSort_DisplayIndexToStatusIndex(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)) { + pokeCaughtStatus = PokedexSort_StatusIndexToCaughtStatus(param2->unk_04, dexIndex); + v5 = ov21_021D16D8(param1, param2->unk_04, param3, pokeCaughtStatus->species); v4.unk_04 = v5; param0->unk_28[v2] = ov21_021D4CB8(&v4, param0->unk_4C); ov21_021D4DA0(v5); @@ -916,22 +916,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 SpeciesCaughtStatus *pokeCaughtStatus; - v1 = ov21_021D3898(param2->unk_04); - v0 = ov21_021D375C(param2->unk_04); - v2 = ov21_021D37DC(param2->unk_04, v0); + v1 = PokedexSort_CurrentDisplayIndex(param2->unk_04); + dexIndex = PokedexSort_CurrentStatusIndex(param2->unk_04); + pokeCaughtStatus = PokedexSort_StatusIndexToCaughtStatus(param2->unk_04, dexIndex); - if (ov21_021D38B0(param2->unk_04, v1) == (NATIONAL_DEX_COUNT + 1)) { + if (PokedexSort_DisplayIndexToStatusIndex(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, pokeCaughtStatus->species, 2, 56, 80); ov21_021D217C(param1, 1); if (param0->unk_7C) { @@ -1035,8 +1035,8 @@ static void ov21_021D6A58(UnkStruct_ov21_021D71A8 *param0, const UnkStruct_ov21_ int v1; int v2; - v1 = ov21_021D3898(param1->unk_04); - v2 = ov21_021D38A4(param1->unk_04); + v1 = PokedexSort_CurrentDisplayIndex(param1->unk_04); + v2 = PokedexSort_NumDisplayed(param1->unk_04); if (param1->unk_08 == 1) { if ((param0->unk_24 + 1) < 9) { @@ -1080,39 +1080,39 @@ 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 SpeciesCaughtStatus *pokeCaughtStatus; int v9; int v10; - int v11; + int dexIndex; - v6 = ov21_021D3898(param1->unk_04); - v7 = ov21_021D38A4(param1->unk_04); + v6 = PokedexSort_CurrentDisplayIndex(param1->unk_04); + v7 = PokedexSort_NumDisplayed(param1->unk_04); 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 = PokedexSort_DisplayIndexToStatusIndex(param1->unk_04, v5); - if (v11 != (NATIONAL_DEX_COUNT + 1)) { - v8 = ov21_021D37DC(param1->unk_04, v11); + if (dexIndex != (NATIONAL_DEX_COUNT + 1)) { + pokeCaughtStatus = PokedexSort_StatusIndexToCaughtStatus(param1->unk_04, dexIndex); - if (v8->unk_04 == 2) { - v4 = 1; + if (pokeCaughtStatus->caughtStatus == CS_CAUGHT) { + 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); @@ -1132,14 +1132,14 @@ static void ov21_021D6AE4(UnkStruct_ov21_021D71A8 *param0, const UnkStruct_ov21_ static void ov21_021D6B94(UnkStruct_ov21_021D71A8 *param0, const UnkStruct_ov21_021D5B68 *param1) { - int v0 = ov21_021D38A4(param1->unk_04); + int v0 = PokedexSort_NumDisplayed(param1->unk_04); param0->unk_78 = FX_Div((54 * FX32_ONE), v0 << FX32_SHIFT); } static void ov21_021D6BB0(UnkStruct_ov21_021D71A8 *param0, const UnkStruct_ov21_021D5B68 *param1) { VecFx32 v0; - int v1 = ov21_021D3898(param1->unk_04); + int v1 = PokedexSort_CurrentDisplayIndex(param1->unk_04); v0.y = FX_Mul(param0->unk_78, v1 << FX32_SHIFT); v0.y += (58 * FX32_ONE); @@ -1162,7 +1162,7 @@ static fx32 ov21_021D6BF8(fx32 param0, fx32 param1, int param2, int param3) static void ov21_021D6C24(UnkStruct_ov21_021D71A8 *param0, const UnkStruct_ov21_021D5B68 *param1) { memset(param0, 0, sizeof(UnkStruct_ov21_021D71A8)); - param0->unk_144 = ov21_021D3898(param1->unk_04); + param0->unk_144 = PokedexSort_CurrentDisplayIndex(param1->unk_04); } static void ov21_021D6C44(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13FC *param1, const UnkStruct_ov21_021D5B68 *param2, int param3) @@ -1213,8 +1213,8 @@ static void ov21_021D6CC8(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13 int v3; int v4; - v0 = ov21_021D3898(param2->unk_04); - v1 = ov21_021D38A4(param2->unk_04); + v0 = PokedexSort_CurrentDisplayIndex(param2->unk_04); + v1 = PokedexSort_NumDisplayed(param2->unk_04); switch (param2->unk_08) { case 1: @@ -1235,7 +1235,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 = PokedexSort_DisplayIndexToStatusIndex(param2->unk_04, v3); if (v4 != (NATIONAL_DEX_COUNT + 1)) { ov21_021D6D78(param0, param1, param2, param3, v2, v4); @@ -1251,14 +1251,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 SpeciesCaughtStatus *pokeCaughtStatus; - v2 = ov21_021D37DC(param2->unk_04, param5); - GF_ASSERT(v2); + pokeCaughtStatus = PokedexSort_StatusIndexToCaughtStatus(param2->unk_04, dexIndex); + GF_ASSERT(pokeCaughtStatus); v0.unk_00 = param1->unk_14C; v0.unk_08 = param0->unk_90.paletteProxy; @@ -1268,9 +1268,9 @@ static void ov21_021D6D78(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13 v0.unk_18 = 2; v0.unk_1C = 0; v0.unk_20 = NNS_G2D_VRAM_TYPE_2DMAIN; - v0.unk_24 = param3; + v0.heapID = param3; - v1 = ov21_021D16D8(param1, param2->unk_04, param3, v2->unk_00); + v1 = ov21_021D16D8(param1, param2->unk_04, param3, pokeCaughtStatus->species); if (param0->unk_28[param4]) { ov21_021D4D1C(param0->unk_28[param4]); @@ -1297,7 +1297,7 @@ static void ov21_021D6DF4(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13 v0.unk_18 = 2; v0.unk_1C = 0; v0.unk_20 = NNS_G2D_VRAM_TYPE_2DMAIN; - v0.unk_24 = param2; + v0.heapID = param2; v1 = ov21_021D4D6C(param1->unk_14C, 15, 2); @@ -1327,8 +1327,8 @@ static void ov21_021D6ED0(UnkStruct_ov21_021D71A8 *param0, const UnkStruct_ov21_ int v3; int v4; - v3 = ov21_021D3898(param1->unk_04); - v4 = ov21_021D38A4(param1->unk_04); + v3 = PokedexSort_CurrentDisplayIndex(param1->unk_04); + v4 = PokedexSort_NumDisplayed(param1->unk_04); v0 = v3 - 4; v1 = param0->unk_24; @@ -1509,7 +1509,7 @@ static void ov21_021D7160(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13 v1 = (param0->unk_24 + 4) % 9; v0 = CellActor_GetPosition(param0->unk_00[v1]); - ov21_021D1778(param1, param2->unk_04, param3, ov21_021D375C(param2->unk_04), v0->x, v0->y); + ov21_021D1778(param1, param2->unk_04, param3, PokedexSort_CurrentStatusIndex(param2->unk_04), v0->x, v0->y); ov21_021D238C(param1, 0); } @@ -1691,7 +1691,7 @@ static BOOL ov21_021D74B0(UnkStruct_ov21_021D5B68 *param0, int param1) return 0; } - v0 = ov21_021D36D8(param0->unk_04); + v0 = PokedexStatus_IsNationalDex(param0->unk_04); if (v0 == 0) { v0 = 1; @@ -1702,8 +1702,8 @@ 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); - ov21_021D36FC(param0->unk_04, 0); + PokedexSort_SortUnfiltered(param0->unk_04, 0, 0, 0, 0, 0, v0, param1); + PokedexSort_SetCurrentStatusIndex(param0->unk_04, 0); param0->unk_0C = 0; *param0->unk_00 |= (1 << 4); @@ -1720,12 +1720,12 @@ 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 = PokedexSort_CurrentSpecies(param0->unk_04); - ov21_021D3684(param0->unk_04, 0, 0, 0, 0, 0, ov21_021D36D8(param0->unk_04), param1); + PokedexSort_SortUnfiltered(param0->unk_04, 0, 0, 0, 0, 0, PokedexStatus_IsNationalDex(param0->unk_04), param1); (*param0->unk_00) |= (1 << 4); - ov21_021D3794(param0->unk_04, v0); + PokedexSort_SetCurrentStatusIndexWithSpecies(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 5802b6b2b0..b2536ae793 100644 --- a/src/overlay021/ov21_021D76B0.c +++ b/src/overlay021/ov21_021D76B0.c @@ -7,10 +7,10 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" #include "overlay021/ov21_021D4340.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021D5AEC.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D3320.h" @@ -234,7 +234,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)); @@ -246,7 +246,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; } @@ -294,13 +294,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: @@ -366,7 +366,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: @@ -473,7 +473,7 @@ static void ov21_021D7B8C(u32 param0, u32 param1, void *param2) break; case 4: if (v2->unk_20 == 0) { - v4 = ov21_021D3768(v3); + v4 = PokedexSort_CaughtStatusLength(v3); ov21_021D853C(v1, v4 - 1); } break; @@ -541,7 +541,7 @@ static void ov21_021D7CD8(UnkStruct_ov21_021D77E8 *param0, const UnkStruct_ov21_ if (param1->unk_1C->unk_04->unk_1740 == 1) { ov21_021D276C(param0->unk_00, 1, 4, 3 * 32, 32, param2); } else { - if (ov21_021D36D8(param1->unk_1C->unk_04) == 1) { + if (PokedexStatus_IsNationalDex(param1->unk_1C->unk_04) == 1) { ov21_021D276C(param0->unk_00, 25, 4, 3 * 32, 32, param2); } } @@ -686,7 +686,7 @@ static void ov21_021D8018(UnkStruct_ov21_021D7C64 *param0, UnkStruct_ov21_021D77 v1.unk_18 = 0; v1.unk_1C = 0; v1.unk_20 = NNS_G2D_VRAM_TYPE_2DSUB; - v1.unk_24 = param3; + v1.heapID = param3; v4 = sub_0201FAB4(v1.unk_08, NNS_G2D_VRAM_TYPE_2DSUB); v0 = ov21_021D4D6C(v3->unk_14C, 10, 4); @@ -950,7 +950,7 @@ static BOOL ov21_021D84E0(UnkStruct_ov21_021D7A64 *param0, UnkStruct_ov21_021D33 v0 = -1; } - if (ov21_021D387C(param1, v0) == 0) { + if (PokedexSort_IsValidStep(param1, v0) == 0) { return 0; } } @@ -969,7 +969,7 @@ static BOOL ov21_021D8508(UnkStruct_ov21_021D7A64 *param0, UnkStruct_ov21_021D33 v0 = -1; } - if (ov21_021D3844(param1, v0) == 0) { + if (PokedexSort_TakeStep(param1, v0) == 0) { return 0; } } @@ -990,7 +990,7 @@ static void ov21_021D853C(UnkStruct_ov21_021D77D4 *param0, int param1) return; } - ov21_021D36FC(param0->unk_1C->unk_04, param1); + PokedexSort_SetCurrentStatusIndex(param0->unk_1C->unk_04, param1); (*param0->unk_20) |= (0x1 << 0); diff --git a/src/overlay021/ov21_021D85B0.c b/src/overlay021/ov21_021D85B0.c index 0c35798ae2..568359823c 100644 --- a/src/overlay021/ov21_021D85B0.c +++ b/src/overlay021/ov21_021D85B0.c @@ -7,8 +7,8 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" #include "overlay021/ov21_021D4340.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D157C.h" @@ -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,11 +400,11 @@ 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 = PokedexSort_Sort(v0->unk_04, v0->unk_10, v0->unk_14, v0->unk_18, v0->unk_1C, v0->unk_20, PokedexStatus_IsNationalDex(v0->unk_04), param0->heapID, 1); if (v2 == 1) { *v0->unk_00 |= (0x1 << 1); - ov21_021D3810(v0->unk_04, 0); + PokedexSort_SetCurrentValues(v0->unk_04, 0); v0->unk_04->unk_1740 = 1; v0->unk_08->unk_18 = 1; } else { @@ -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; @@ -541,7 +541,7 @@ static void ov21_021D8A7C(UnkStruct_ov21_021D9320 *param0, UnkStruct_ov21_021D87 ov21_021D8C00(param1); ov21_021D8B8C(param1, param2, param4); - ov21_021D8BC4(param0, param1, param2, param4, ov21_021D36D8(param2->unk_04)); + ov21_021D8BC4(param0, param1, param2, param4, PokedexStatus_IsNationalDex(param2->unk_04)); ov21_021D8C1C(param0, param1, param4); ov21_021D8D0C(param0, param1, param2, param4); diff --git a/src/overlay021/ov21_021D94BC.c b/src/overlay021/ov21_021D94BC.c index 5556eadd9b..a524cdd3a9 100644 --- a/src/overlay021/ov21_021D94BC.c +++ b/src/overlay021/ov21_021D94BC.c @@ -7,10 +7,10 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021D4EE4.h" #include "overlay021/ov21_021D85B0.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D2648.h" @@ -309,7 +309,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)); @@ -318,8 +318,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++) { @@ -382,8 +382,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) { @@ -433,12 +433,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++; @@ -482,12 +482,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); @@ -2691,7 +2691,7 @@ static void ov21_021DBDC8(UnkStruct_ov21_021DC96C *param0, UnkStruct_ov21_021D95 v0.unk_18 = 0; v0.unk_1C = 0; v0.unk_20 = NNS_G2D_VRAM_TYPE_2DSUB; - v0.unk_24 = param2; + v0.heapID = param2; ov21_021DBEC8(param0, &v0, v2->unk_14C); ov21_021DBE98(param0, &v0, v2->unk_14C, param0->unk_104, param0->unk_108); @@ -2716,7 +2716,7 @@ static void ov21_021DBE3C(UnkStruct_ov21_021DC96C *param0, UnkStruct_ov21_021D95 v0.unk_18 = 0; v0.unk_1C = 0; v0.unk_20 = NNS_G2D_VRAM_TYPE_2DSUB; - v0.unk_24 = param2; + v0.heapID = param2; ov21_021DC068(param0); ov21_021DBE98(param0, &v0, v2->unk_14C, param0->unk_104, param0->unk_108); diff --git a/src/overlay021/ov21_021DC9BC.c b/src/overlay021/ov21_021DC9BC.c index c93744b9bb..ce71debb09 100644 --- a/src/overlay021/ov21_021DC9BC.c +++ b/src/overlay021/ov21_021DC9BC.c @@ -7,20 +7,17 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" #include "overlay021/ov21_021D4C0C.h" -#include "overlay021/ov21_021D517C.h" -#include "overlay021/ov21_021D57B4.h" #include "overlay021/ov21_021E29DC.h" +#include "overlay021/pokedex_enc_data.h" +#include "overlay021/pokedex_field_map.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D2648.h" #include "overlay021/struct_ov21_021D3320.h" #include "overlay021/struct_ov21_021D4CA0.h" #include "overlay021/struct_ov21_021D4CB8.h" -#include "overlay021/struct_ov21_021D5844.h" -#include "overlay021/struct_ov21_021D5868.h" -#include "overlay021/struct_ov21_021D5890.h" #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" @@ -30,6 +27,7 @@ #include "gx_layers.h" #include "heap.h" #include "narc.h" +#include "rtc.h" #include "sprite_resource.h" #include "unk_0200762C.h" #include "unk_020093B4.h" @@ -37,42 +35,56 @@ #include "unk_02012744.h" #include "unk_0201F834.h" -static const u16 Unk_ov21_021E9D78[] = { - 0xffff +#define TERMINALVALUE 0xffff +#define POKEDEXMAPXSCALE 5 +#define POKEDEXMAPYSCALE 5 +#define POKEDEXMAPHEIGHT 30 +#define POKEDEXMAPWIDTH 30 +#define POKEDEXMAPNUMCELLS (POKEDEXMAPHEIGHT * POKEDEXMAPWIDTH) +#define NUMDUNGEONS 22 + +static const u16 fullmoonIslandFields[] = { + TERMINALVALUE }; -static const u16 Unk_ov21_021E9D76[] = { - 0xffff +static const u16 fullmoonIslandDungeons[] = { + TERMINALVALUE }; -static const u16 Unk_ov21_021E9D74[] = { - 0xffff +static const u16 seabreakPathFields[] = { + TERMINALVALUE }; -static const u16 Unk_ov21_021E9D72[] = { - 0xffff +static const u16 seabreakPathDungeons[] = { + TERMINALVALUE }; -static const u16 Unk_ov21_021E9D70[] = { - 0xffff +static const u16 newmoonIslandFields[] = { + TERMINALVALUE }; -static const u16 Unk_ov21_021E9D6E[] = { - 0xffff +static const u16 newmoonIslandDungeons[] = { + TERMINALVALUE }; -static const u16 Unk_ov21_021E9D6C[] = { - 0xffff +static const u16 springPathFields[] = { + TERMINALVALUE }; -static const u16 Unk_ov21_021E9D7A[] = { - 0xA, - 0xffff +static const u16 springPathDungeons[] = { + 10, + TERMINALVALUE +}; + +enum EncounterTime { + ENCTIME_MORNING = 0, + ENCTIME_DAY = 1, + ENCTIME_NIGHT = 2, }; typedef struct { UnkStruct_ov21_021D3320 *unk_00; - int unk_04; + enum EncounterTime encounterTime; UnkStruct_ov21_021E68F4 *unk_08; } UnkStruct_ov21_021DCACC; @@ -85,99 +97,99 @@ typedef struct { } UnkStruct_ov21_021DCAE0; typedef struct { - int unk_00; - u8 *unk_04; - u8 *unk_08; - u32 unk_0C; - u32 unk_10; - UnkStruct_ov21_021D5844 unk_14; - UnkStruct_ov21_021D5844 unk_1C; - UnkStruct_ov21_021D5844 unk_24; - UnkStruct_ov21_021D5844 unk_2C; -} UnkStruct_ov21_021DDABC; + int encounterTime; + u8 *invisibleFields; + u8 *invisibleDungeons; + u32 numInvisibleFields; + u32 numInvisibleDungeons; + EncounterLocations dungeonsEncounteredOn; + EncounterLocations fieldsEncounteredOn; + EncounterLocations dungeonSpecialEncounters; + EncounterLocations fieldSpecialEncounters; +} EncounterCollection; typedef struct { - int unk_00; - CellActor *unk_04[44]; + int encounterTime; + CellActor *cellActorArray[NUMDUNGEONS * 2]; SpriteResource *unk_B4[4]; - int unk_C4; - CellActor *unk_C8; - UnkStruct_ov21_021D4CA0 *unk_CC; + int numDungeons; + CellActor *AreaUnknownCellActor; + UnkStruct_ov21_021D4CA0 *AreaUnknownSpriteManager; SpriteResource *unk_D0[4]; UnkStruct_ov21_021D4CA0 *unk_E0[3]; - u8 unk_EC[900]; - u8 unk_470[900]; + u8 pokedexFieldMap_1[POKEDEXMAPNUMCELLS]; + u8 pokedexFieldMap_2[POKEDEXMAPNUMCELLS]; void *unk_7F4; NNSG2dCharacterData *unk_7F8; void *unk_7FC; NNSG2dCharacterData *unk_800; - UnkStruct_ov21_021D5868 *unk_804; - UnkStruct_ov21_021D5890 *unk_808; + DungeonCoordinates *dungeonCoordinatesArray; + FieldCoordinates *fieldCoordinatesArray; int unk_80C; int unk_810; UnkStruct_ov21_021D2648 unk_814; - u32 unk_834; - u32 unk_838; - u32 unk_83C; - u32 unk_840; -} UnkStruct_ov21_021DD420; + u32 numVisibleDungeons; + u32 numVisibleFields; + u32 dungeonsZero; // as far as I can tell these will always be zero + u32 fieldsZero; +} PokedexMapDisplay; -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); static int ov21_021DCAF4(void); -static int ov21_021DCAF8(UnkStruct_ov21_021E6A68 *param0, void *param1); +static int PokedexEncounters_PopulateEncounterCollection(UnkStruct_ov21_021E6A68 *param0, void *param1); static int ov21_021DCB6C(UnkStruct_ov21_021E6A68 *param0, void *param1); static int ov21_021DCBA8(UnkStruct_ov21_021E6A68 *param0, void *param1); static int ov21_021DCBD8(void *param0, UnkStruct_ov21_021E6B20 *param1, const void *param2, const UnkStruct_ov21_021E6A68 *param3); static int ov21_021DCCD8(void *param0, UnkStruct_ov21_021E6B20 *param1, const void *param2, const UnkStruct_ov21_021E6A68 *param3); static int ov21_021DCD04(void *param0, UnkStruct_ov21_021E6B20 *param1, const void *param2, const UnkStruct_ov21_021E6A68 *param3); static void ov21_021DDCF4(UnkStruct_ov21_021DCAE0 *param0, const UnkStruct_ov21_021DCACC *param1); -static void ov21_021DD420(UnkStruct_ov21_021DD420 *param0); -static void ov21_021DD458(UnkStruct_ov21_021DD420 *param0); -static void ov21_021DD490(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCAE0 *param1, const UnkStruct_ov21_021DCACC *param2, BOOL param3); -static BOOL ov21_021DD508(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCAE0 *param1, const UnkStruct_ov21_021DCACC *param2, BOOL param3); -static void ov21_021DD554(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCAE0 *param1, const UnkStruct_ov21_021DCACC *param2, BOOL param3); -static BOOL ov21_021DD5E4(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCAE0 *param1, const UnkStruct_ov21_021DCACC *param2, BOOL param3); -static void ov21_021DCDD0(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCAE0 *param1, const UnkStruct_ov21_021DCACC *param2, const UnkStruct_ov21_021DDABC *param3, int param4); -static void ov21_021DCE20(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCAE0 *param1); +static void PokedexMapDisplay_OAMMode_XLU(PokedexMapDisplay *mapDisplay); +static void PokedexMapDisplay_OAMMode_Normal(PokedexMapDisplay *mapDisplay); +static void ov21_021DD490(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1, const UnkStruct_ov21_021DCACC *param2, BOOL param3); +static BOOL ov21_021DD508(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1, const UnkStruct_ov21_021DCACC *param2, BOOL param3); +static void ov21_021DD554(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1, const UnkStruct_ov21_021DCACC *param2, BOOL param3); +static BOOL ov21_021DD5E4(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1, const UnkStruct_ov21_021DCACC *param2, BOOL param3); +static void ov21_021DCDD0(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1, const UnkStruct_ov21_021DCACC *param2, const EncounterCollection *encounterCollection, int param4); +static void ov21_021DCE20(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1); static void ov21_021DCE40(UnkStruct_ov21_021DCAE0 *param0, const UnkStruct_ov21_021DCACC *param1, int param2); -static void ov21_021DD668(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCAE0 *param1, int param2); -static void ov21_021DD6C0(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCAE0 *param1); -static void ov21_021DCFC8(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCAE0 *param1, int param2); -static void ov21_021DD114(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCAE0 *param1); -static void ov21_021DD1A8(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCAE0 *param1, int param2); -static void ov21_021DD2B8(UnkStruct_ov21_021DD420 *param0); -static void ov21_021DD2E0(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCAE0 *param1, const UnkStruct_ov21_021DCACC *param2, int param3); -static void ov21_021DD3FC(UnkStruct_ov21_021DD420 *param0); -static void ov21_021DD9E8(UnkStruct_ov21_021DD420 *param0, const UnkStruct_ov21_021DDABC *param1); -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_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_021DDB68(UnkStruct_ov21_021DDABC *param0); +static void ov21_021DD668(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1, int param2); +static void ov21_021DD6C0(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1); +static void ov21_021DCFC8(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1, int param2); +static void ov21_021DD114(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1); +static void ov21_021DD1A8(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1, int heapID); +static void PokedexMapDisplay_DeleteCellActors(PokedexMapDisplay *mapDisplay); +static void ov21_021DD2E0(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1, const UnkStruct_ov21_021DCACC *param2, int param3); +static void ov21_021DD3FC(PokedexMapDisplay *mapDisplay); +static void ov21_021DD9E8(PokedexMapDisplay *mapDisplay, const EncounterCollection *encounterCollection); +static void ov21_021DDA48(PokedexMapDisplay *mapDisplay, int param1); +static void ov21_021DDA80(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1, const UnkStruct_ov21_021DCACC *param2, const EncounterCollection *encounterCollection, int param4); +static void ov21_021DD710(PokedexMapDisplay *mapDisplay, const UnkStruct_ov21_021DCACC *param1, const EncounterCollection *encounterCollection, int param3); +static void ov21_021DD8B4(PokedexMapDisplay *mapDisplay); +static u8 *PokedexEncounters_InvisibleFields(u32 heapID, const UnkStruct_ov21_021DCACC *param1, u32 *param2); +static u8 *PokedexEncounters_InvisibleDungeons(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 *param2); +static void ov21_021DD964(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1); +static void ov21_021DDB8C(PokedexMapDisplay *mapDisplay); +static void ov21_021DDBCC(PokedexMapDisplay *mapDisplay); +static void ov21_021DDC14(PokedexMapDisplay *mapDisplay); +static void PokedexSort_PopulateDexStatus(EncounterCollection *encounterCollection, UnkStruct_ov21_021DCACC *param1, int heapID); +static void ov21_021DDB68(EncounterCollection *encounterCollection); -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; param0->unk_20 = NULL; param0->unk_24 = ov21_021DCAF4(); - param0->unk_08[0] = ov21_021DCAF8; + param0->unk_08[0] = PokedexEncounters_PopulateEncounterCollection; param0->unk_08[1] = ov21_021DCB6C; param0->unk_08[2] = ov21_021DCBA8; param0->unk_14[0] = ov21_021DCBD8; @@ -194,15 +206,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) @@ -225,11 +237,11 @@ 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)); @@ -272,34 +284,34 @@ static int ov21_021DCAF4(void) return 0; } -static int ov21_021DCAF8(UnkStruct_ov21_021E6A68 *param0, void *param1) +static int PokedexEncounters_PopulateEncounterCollection(UnkStruct_ov21_021E6A68 *param0, void *param1) { UnkStruct_ov21_021DCACC *v0 = param1; - UnkStruct_ov21_021DDABC *v1; + EncounterCollection *encounterCollection; - v1 = Heap_AllocFromHeap(param0->unk_04, sizeof(UnkStruct_ov21_021DDABC)); + encounterCollection = Heap_AllocFromHeap(param0->heapID, sizeof(EncounterCollection)); - GF_ASSERT(v1); - memset(v1, 0, sizeof(UnkStruct_ov21_021DDABC)); + GF_ASSERT(encounterCollection); + memset(encounterCollection, 0, sizeof(EncounterCollection)); - param0->unk_08 = v1; + param0->unk_08 = encounterCollection; - if (v0->unk_00->unk_1744 == 0) { - v0->unk_04 = 0; + if (v0->unk_00->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->unk_00->timeOfDay == TOD_DAY) || (v0->unk_00->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); + encounterCollection->invisibleFields = PokedexEncounters_InvisibleFields(param0->heapID, v0, &encounterCollection->numInvisibleFields); + encounterCollection->invisibleDungeons = PokedexEncounters_InvisibleDungeons(param0->heapID, v0, &encounterCollection->numInvisibleDungeons); - ov21_021DDABC(v1, v0, param0->unk_04); + PokedexSort_PopulateDexStatus(encounterCollection, v0, param0->heapID); - v1->unk_00 = v0->unk_04; + encounterCollection->encounterTime = v0->encounterTime; return 1; } @@ -307,7 +319,7 @@ static int ov21_021DCAF8(UnkStruct_ov21_021E6A68 *param0, void *param1) static int ov21_021DCB6C(UnkStruct_ov21_021E6A68 *param0, void *param1) { UnkStruct_ov21_021DCACC *v0 = param1; - UnkStruct_ov21_021DDABC *v1 = param0->unk_08; + EncounterCollection *encounterCollection = param0->unk_08; if (param0->unk_0C == 1) { return 1; @@ -317,10 +329,10 @@ static int ov21_021DCB6C(UnkStruct_ov21_021E6A68 *param0, void *param1) return 0; } - if (v1->unk_00 != v0->unk_04) { - ov21_021DDB68(v1); - ov21_021DDABC(v1, v0, param0->unk_04); - v1->unk_00 = v0->unk_04; + if (encounterCollection->encounterTime != v0->encounterTime) { + ov21_021DDB68(encounterCollection); + PokedexSort_PopulateDexStatus(encounterCollection, v0, param0->heapID); + encounterCollection->encounterTime = v0->encounterTime; } return 0; @@ -328,18 +340,18 @@ static int ov21_021DCB6C(UnkStruct_ov21_021E6A68 *param0, void *param1) static int ov21_021DCBA8(UnkStruct_ov21_021E6A68 *param0, void *param1) { - UnkStruct_ov21_021DDABC *v0 = param0->unk_08; + EncounterCollection *encounterCollection = param0->unk_08; - if (v0->unk_04) { - Heap_FreeToHeap(v0->unk_04); + if (encounterCollection->invisibleFields) { + Heap_FreeToHeap(encounterCollection->invisibleFields); } - if (v0->unk_08) { - Heap_FreeToHeap(v0->unk_08); + if (encounterCollection->invisibleDungeons) { + Heap_FreeToHeap(encounterCollection->invisibleDungeons); } - ov21_021DDB68(v0); - Heap_FreeToHeap(v0); + ov21_021DDB68(encounterCollection); + Heap_FreeToHeap(encounterCollection); param0->unk_08 = NULL; @@ -349,43 +361,43 @@ static int ov21_021DCBA8(UnkStruct_ov21_021E6A68 *param0, void *param1) static int ov21_021DCBD8(void *param0, UnkStruct_ov21_021E6B20 *param1, const void *param2, const UnkStruct_ov21_021E6A68 *param3) { const UnkStruct_ov21_021DCACC *v0 = param2; - const UnkStruct_ov21_021DDABC *v1 = param3->unk_08; + const EncounterCollection *encounterCollection = param3->unk_08; UnkStruct_ov21_021DCAE0 *v2 = param0; - UnkStruct_ov21_021DD420 *v3 = param1->unk_08; + PokedexMapDisplay *mapDisplay = param1->unk_08; BOOL v4; switch (param1->unk_00) { case 0: - param1->unk_08 = Heap_AllocFromHeap(param1->unk_04, sizeof(UnkStruct_ov21_021DD420)); - memset(param1->unk_08, 0, sizeof(UnkStruct_ov21_021DD420)); + param1->unk_08 = Heap_AllocFromHeap(param1->heapID, sizeof(PokedexMapDisplay)); + memset(param1->unk_08, 0, sizeof(PokedexMapDisplay)); - 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); + mapDisplay = param1->unk_08; + mapDisplay->encounterTime = v0->encounterTime; + mapDisplay->dungeonCoordinatesArray = PokedexEncData_GetDungeonCoordinates(param1->heapID, NULL); + mapDisplay->fieldCoordinatesArray = PokedexEncData_GetFieldCoordinates(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_021DD9E8(param1->unk_08, v1); - ov21_021DDB8C(v3); - ov21_021DD964(v3, v2); + ov21_021DCDD0(mapDisplay, v2, v0, encounterCollection, param1->heapID); + ov21_021DD710(param1->unk_08, v0, encounterCollection, param1->heapID); + ov21_021DD9E8(param1->unk_08, encounterCollection); + ov21_021DDB8C(mapDisplay); + ov21_021DD964(mapDisplay, v2); if (v2->unk_0C == 0) { - ov21_021DD490(v3, v2, v0, 1); + ov21_021DD490(mapDisplay, v2, v0, 1); } else { - ov21_021DD554(v3, v2, v0, 1); + ov21_021DD554(mapDisplay, v2, v0, 1); } param1->unk_00++; break; case 2: if (v2->unk_0C == 0) { - v4 = ov21_021DD508(v3, v2, v0, 1); + v4 = ov21_021DD508(mapDisplay, v2, v0, 1); } else { - v4 = ov21_021DD5E4(v3, v2, v0, 1); + v4 = ov21_021DD5E4(mapDisplay, v2, v0, 1); } if (v4) { @@ -393,7 +405,7 @@ static int ov21_021DCBD8(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo } break; case 3: - ov21_021DDBCC(v3); + ov21_021DDBCC(mapDisplay); return 1; } @@ -403,12 +415,12 @@ static int ov21_021DCBD8(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo static int ov21_021DCCD8(void *param0, UnkStruct_ov21_021E6B20 *param1, const void *param2, const UnkStruct_ov21_021E6A68 *param3) { const UnkStruct_ov21_021DCACC *v0 = param2; - const UnkStruct_ov21_021DDABC *v1 = param3->unk_08; + const EncounterCollection *encounterCollection = param3->unk_08; UnkStruct_ov21_021DCAE0 *v2 = param0; - UnkStruct_ov21_021DD420 *v3 = param1->unk_08; + PokedexMapDisplay *mapDisplay = param1->unk_08; - ov21_021DDC14(v3); - ov21_021DDA80(v3, v2, v0, v1, param1->unk_04); + ov21_021DDC14(mapDisplay); + ov21_021DDA80(mapDisplay, v2, v0, encounterCollection, param1->heapID); return 0; } @@ -416,28 +428,28 @@ static int ov21_021DCCD8(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo static int ov21_021DCD04(void *param0, UnkStruct_ov21_021E6B20 *param1, const void *param2, const UnkStruct_ov21_021E6A68 *param3) { const UnkStruct_ov21_021DCACC *v0 = param2; - const UnkStruct_ov21_021DDABC *v1 = param3->unk_08; + const EncounterCollection *encounterCollection = param3->unk_08; UnkStruct_ov21_021DCAE0 *v2 = param0; - UnkStruct_ov21_021DD420 *v3 = param1->unk_08; + PokedexMapDisplay *mapDisplay = param1->unk_08; BOOL v4; switch (param1->unk_00) { case 0: - ov21_021DDB8C(v3); + ov21_021DDB8C(mapDisplay); if (v2->unk_0C == 0) { - ov21_021DD490(v3, v2, v0, 0); + ov21_021DD490(mapDisplay, v2, v0, 0); } else { - ov21_021DD554(v3, v2, v0, 0); + ov21_021DD554(mapDisplay, v2, v0, 0); } param1->unk_00++; break; case 1: if (v2->unk_0C == 0) { - v4 = ov21_021DD508(v3, v2, v0, 0); + v4 = ov21_021DD508(mapDisplay, v2, v0, 0); } else { - v4 = ov21_021DD5E4(v3, v2, v0, 0); + v4 = ov21_021DD5E4(mapDisplay, v2, v0, 0); } if (v4) { @@ -445,14 +457,14 @@ static int ov21_021DCD04(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo } break; case 2: - ov21_021DD8B4(v3); - ov21_021DCE20(v3, v2); + ov21_021DD8B4(mapDisplay); + ov21_021DCE20(mapDisplay, v2); param1->unk_00++; break; case 3: GXLayers_EngineAToggleLayers(GX_BLEND_PLANEMASK_BG1, 1); - Heap_FreeToHeap(v3->unk_804); - Heap_FreeToHeap(v3->unk_808); + Heap_FreeToHeap(mapDisplay->dungeonCoordinatesArray); + Heap_FreeToHeap(mapDisplay->fieldCoordinatesArray); Heap_FreeToHeap(param1->unk_08); param1->unk_08 = NULL; param1->unk_00++; @@ -464,60 +476,60 @@ static int ov21_021DCD04(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo return 0; } -static void ov21_021DCDD0(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCAE0 *param1, const UnkStruct_ov21_021DCACC *param2, const UnkStruct_ov21_021DDABC *param3, int param4) +static void ov21_021DCDD0(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1, const UnkStruct_ov21_021DCACC *param2, const EncounterCollection *encounterCollection, int heapID) { - ov21_021DCE40(param1, param2, param4); - ov21_021DD668(param0, param1, param4); - ov21_021DCFC8(param0, param1, param4); - ov21_021DD1A8(param0, param1, param4); - ov21_021DD2E0(param0, param1, param2, param4); - ov21_021DDA48(param0, param2->unk_04); + ov21_021DCE40(param1, param2, heapID); + ov21_021DD668(mapDisplay, param1, heapID); + ov21_021DCFC8(mapDisplay, param1, heapID); + ov21_021DD1A8(mapDisplay, param1, heapID); + ov21_021DD2E0(mapDisplay, param1, param2, heapID); + ov21_021DDA48(mapDisplay, param2->encounterTime); ov21_021DDCF4(param1, param2); } -static void ov21_021DCE20(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCAE0 *param1) +static void ov21_021DCE20(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1) { - ov21_021DD6C0(param0, param1); - ov21_021DD3FC(param0); - ov21_021DD2B8(param0); - ov21_021DD114(param0, param1); + ov21_021DD6C0(mapDisplay, param1); + ov21_021DD3FC(mapDisplay); + PokedexMapDisplay_DeleteCellActors(mapDisplay); + ov21_021DD114(mapDisplay, param1); } -static void ov21_021DCE40(UnkStruct_ov21_021DCAE0 *param0, const UnkStruct_ov21_021DCACC *param1, int param2) +static void ov21_021DCE40(UnkStruct_ov21_021DCAE0 *param0, const UnkStruct_ov21_021DCACC *param1, int heapID) { void *v0; NNSG2dScreenData *v1; - ov21_021D2724(param0->unk_00, 33, param0->unk_00->unk_00, 3, 0, 0, 1, param2); + ov21_021D2724(param0->unk_00, 33, param0->unk_00->unk_00, 3, 0, 0, 1, heapID); - v0 = ov21_021D27B8(param0->unk_00, 64, 1, &v1, param2); + v0 = ov21_021D27B8(param0->unk_00, 64, 1, &v1, heapID); Bg_LoadToTilemapRect(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) { - v0 = ov21_021D27B8(param0->unk_00, 65, 1, &v1, param2); + if (param1->unk_00->newmoonIslandVisible) { + v0 = ov21_021D27B8(param0->unk_00, 65, 1, &v1, heapID); Bg_LoadToTilemapRect(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) { - v0 = ov21_021D27B8(param0->unk_00, 66, 1, &v1, param2); + if (param1->unk_00->seabreakPathVisible) { + v0 = ov21_021D27B8(param0->unk_00, 66, 1, &v1, heapID); Bg_LoadToTilemapRect(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) { - v0 = ov21_021D27B8(param0->unk_00, 67, 1, &v1, param2); + if (param1->unk_00->fullmoonIslandVisible) { + v0 = ov21_021D27B8(param0->unk_00, 67, 1, &v1, heapID); Bg_LoadToTilemapRect(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) { - v0 = ov21_021D27B8(param0->unk_00, 68, 1, &v1, param2); + if (param1->unk_00->springPathVisible) { + v0 = ov21_021D27B8(param0->unk_00, 68, 1, &v1, heapID); Bg_LoadToTilemapRect(param0->unk_00->unk_00, 3, v1->rawData, 25, 16, v1->screenWidth / 8, v1->screenHeight / 8); Heap_FreeToHeap(v0); @@ -526,49 +538,49 @@ static void ov21_021DCE40(UnkStruct_ov21_021DCAE0 *param0, const UnkStruct_ov21_ Bg_ScheduleTilemapTransfer(param0->unk_00->unk_00, 3); } -static void ov21_021DCFC8(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCAE0 *param1, int param2) +static void ov21_021DCFC8(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1, int heapID) { UnkStruct_ov21_021D13FC *v0 = param1->unk_00; NARC *v1 = ov21_021D26E0(param1->unk_00); - param0->unk_B4[0] = SpriteResourceCollection_AddTilesFrom(v0->unk_13C[0], v1, 108, 1, 108 + 6000, NNS_G2D_VRAM_TYPE_2DMAIN, param2); + mapDisplay->unk_B4[0] = SpriteResourceCollection_AddTilesFrom(v0->unk_13C[0], v1, 108, 1, 108 + 6000, NNS_G2D_VRAM_TYPE_2DMAIN, heapID); - sub_0200A3DC(param0->unk_B4[0]); - SpriteResource_ReleaseData(param0->unk_B4[0]); + sub_0200A3DC(mapDisplay->unk_B4[0]); + SpriteResource_ReleaseData(mapDisplay->unk_B4[0]); - param0->unk_B4[2] = SpriteResourceCollection_AddFrom(v0->unk_13C[2], v1, 106, 1, 106 + 6000, 2, param2); - param0->unk_B4[3] = SpriteResourceCollection_AddFrom(v0->unk_13C[3], v1, 107, 1, 107 + 6000, 3, param2); - param0->unk_D0[0] = SpriteResourceCollection_AddTilesFrom(v0->unk_13C[0], v1, 93, 1, 93 + 6000, NNS_G2D_VRAM_TYPE_2DMAIN, param2); + mapDisplay->unk_B4[2] = SpriteResourceCollection_AddFrom(v0->unk_13C[2], v1, 106, 1, 106 + 6000, 2, heapID); + mapDisplay->unk_B4[3] = SpriteResourceCollection_AddFrom(v0->unk_13C[3], v1, 107, 1, 107 + 6000, 3, heapID); + mapDisplay->unk_D0[0] = SpriteResourceCollection_AddTilesFrom(v0->unk_13C[0], v1, 93, 1, 93 + 6000, NNS_G2D_VRAM_TYPE_2DMAIN, heapID); - sub_0200A3DC(param0->unk_D0[0]); - SpriteResource_ReleaseData(param0->unk_D0[0]); + sub_0200A3DC(mapDisplay->unk_D0[0]); + SpriteResource_ReleaseData(mapDisplay->unk_D0[0]); - param0->unk_D0[1] = SpriteResourceCollection_AddPaletteFrom(v0->unk_13C[1], v1, 14, 0, 14 + 6000, NNS_G2D_VRAM_TYPE_2DMAIN, 5, param2); + mapDisplay->unk_D0[1] = SpriteResourceCollection_AddPaletteFrom(v0->unk_13C[1], v1, 14, 0, 14 + 6000, NNS_G2D_VRAM_TYPE_2DMAIN, 5, heapID); - sub_0200A640(param0->unk_D0[1]); - SpriteResource_ReleaseData(param0->unk_D0[1]); + sub_0200A640(mapDisplay->unk_D0[1]); + SpriteResource_ReleaseData(mapDisplay->unk_D0[1]); - param0->unk_D0[2] = SpriteResourceCollection_AddFrom(v0->unk_13C[2], v1, 91, 1, 91 + 6000, 2, param2); - param0->unk_D0[3] = SpriteResourceCollection_AddFrom(v0->unk_13C[3], v1, 92, 1, 92 + 6000, 3, param2); + mapDisplay->unk_D0[2] = SpriteResourceCollection_AddFrom(v0->unk_13C[2], v1, 91, 1, 91 + 6000, 2, heapID); + mapDisplay->unk_D0[3] = SpriteResourceCollection_AddFrom(v0->unk_13C[3], v1, 92, 1, 92 + 6000, 3, heapID); } -static void ov21_021DD114(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCAE0 *param1) +static void ov21_021DD114(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1) { UnkStruct_ov21_021D13FC *v0 = param1->unk_00; - sub_0200A4E4(param0->unk_B4[0]); - SpriteResourceCollection_Remove(v0->unk_13C[0], param0->unk_B4[0]); - SpriteResourceCollection_Remove(v0->unk_13C[2], param0->unk_B4[2]); - SpriteResourceCollection_Remove(v0->unk_13C[3], param0->unk_B4[3]); - sub_0200A4E4(param0->unk_D0[0]); - sub_0200A6DC(param0->unk_D0[1]); - SpriteResourceCollection_Remove(v0->unk_13C[0], param0->unk_D0[0]); - SpriteResourceCollection_Remove(v0->unk_13C[1], param0->unk_D0[1]); - SpriteResourceCollection_Remove(v0->unk_13C[2], param0->unk_D0[2]); - SpriteResourceCollection_Remove(v0->unk_13C[3], param0->unk_D0[3]); + sub_0200A4E4(mapDisplay->unk_B4[0]); + SpriteResourceCollection_Remove(v0->unk_13C[0], mapDisplay->unk_B4[0]); + SpriteResourceCollection_Remove(v0->unk_13C[2], mapDisplay->unk_B4[2]); + SpriteResourceCollection_Remove(v0->unk_13C[3], mapDisplay->unk_B4[3]); + sub_0200A4E4(mapDisplay->unk_D0[0]); + sub_0200A6DC(mapDisplay->unk_D0[1]); + SpriteResourceCollection_Remove(v0->unk_13C[0], mapDisplay->unk_D0[0]); + SpriteResourceCollection_Remove(v0->unk_13C[1], mapDisplay->unk_D0[1]); + SpriteResourceCollection_Remove(v0->unk_13C[2], mapDisplay->unk_D0[2]); + SpriteResourceCollection_Remove(v0->unk_13C[3], mapDisplay->unk_D0[3]); } -static void ov21_021DD1A8(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCAE0 *param1, int param2) +static void ov21_021DD1A8(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1, int heapID) { CellActorResourceData v0; CellActorInitParams v1; @@ -581,44 +593,44 @@ static void ov21_021DD1A8(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCA v1.resourceData = &v0; v1.priority = 31; v1.vramType = NNS_G2D_VRAM_TYPE_2DMAIN; - v1.heapID = param2; + v1.heapID = heapID; v1.position.x = 160 * FX32_ONE; v1.position.y = 96 * FX32_ONE; - param0->unk_C8 = CellActorCollection_Add(&v1); + mapDisplay->AreaUnknownCellActor = CellActorCollection_Add(&v1); - CellActor_SetAnim(param0->unk_C8, 2); + CellActor_SetAnim(mapDisplay->AreaUnknownCellActor, 2); sub_020093B4(&v0, 108 + 6000, 14 + 6000, 106 + 6000, 107 + 6000, 0xffffffff, 0xffffffff, 0, 0, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); v1.collection = v2->unk_138; v1.resourceData = &v0; v1.priority = 31; v1.vramType = NNS_G2D_VRAM_TYPE_2DMAIN; - v1.heapID = param2; + v1.heapID = heapID; v1.position.x = 0; v1.position.y = 0; - for (v3 = 0; v3 < (22 * 2); v3++) { - param0->unk_04[v3] = CellActorCollection_Add(&v1); - CellActor_SetDrawFlag(param0->unk_04[v3], 0); - CellActor_SetExplicitOAMMode(param0->unk_04[v3], GX_OAM_MODE_XLU); + for (v3 = 0; v3 < (NUMDUNGEONS * 2); v3++) { + mapDisplay->cellActorArray[v3] = CellActorCollection_Add(&v1); + CellActor_SetDrawFlag(mapDisplay->cellActorArray[v3], 0); + CellActor_SetExplicitOAMMode(mapDisplay->cellActorArray[v3], GX_OAM_MODE_XLU); } } -static void ov21_021DD2B8(UnkStruct_ov21_021DD420 *param0) +static void PokedexMapDisplay_DeleteCellActors(PokedexMapDisplay *mapDisplay) { - int v0; + int cellActorIndex; - CellActor_Delete(param0->unk_C8); - param0->unk_C8 = NULL; + CellActor_Delete(mapDisplay->AreaUnknownCellActor); + mapDisplay->AreaUnknownCellActor = NULL; - for (v0 = 0; v0 < (22 * 2); v0++) { - CellActor_Delete(param0->unk_04[v0]); - param0->unk_04[v0] = NULL; + for (cellActorIndex = 0; cellActorIndex < (NUMDUNGEONS * 2); cellActorIndex++) { + CellActor_Delete(mapDisplay->cellActorArray[cellActorIndex]); + mapDisplay->cellActorArray[cellActorIndex] = NULL; } } -static void ov21_021DD2E0(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCAE0 *param1, const UnkStruct_ov21_021DCACC *param2, int param3) +static void ov21_021DD2E0(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1, const UnkStruct_ov21_021DCACC *param2, int heapID) { Window *v0; UnkStruct_ov21_021D4CB8 v1; @@ -628,7 +640,7 @@ static void ov21_021DD2E0(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCA int v5; u32 v6; - GF_ASSERT(param0->unk_C8); + GF_ASSERT(mapDisplay->AreaUnknownCellActor); v2 = SpriteResourceCollection_Find(param1->unk_00->unk_13C[1], 14 + 6000); @@ -637,20 +649,20 @@ static void ov21_021DD2E0(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCA v1.unk_18 = 1; v1.unk_1C = 31 - 1; v1.unk_20 = NNS_G2D_VRAM_TYPE_2DMAIN; - v1.unk_24 = param3; + v1.heapID = heapID; v4 = sub_0201FAB4(v1.unk_08, NNS_G2D_VRAM_TYPE_2DMAIN); v0 = ov21_021D4D6C(v3->unk_14C, 16, 2); v6 = ov21_021D4DAC(v3->unk_14C, v0, 697, 35, 0, 0); v1.unk_04 = v0; - v1.unk_0C = param0->unk_C8; + v1.unk_0C = mapDisplay->AreaUnknownCellActor; v1.unk_10 = -(v6 / 2); v1.unk_14 = -8; - param0->unk_CC = ov21_021D4CA0(&v1); + mapDisplay->AreaUnknownSpriteManager = ov21_021D4CA0(&v1); - sub_02012A60(param0->unk_CC->unk_00, v4 + 2); + sub_02012A60(mapDisplay->AreaUnknownSpriteManager->unk_00, v4 + 2); ov21_021D4DA0(v0); for (v5 = 0; v5 < 3; v5++) { @@ -662,51 +674,51 @@ static void ov21_021DD2E0(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCA v1.unk_10 = 8 + ((9 * 8) - v6) / 2; v1.unk_14 = 32; - param0->unk_E0[v5] = ov21_021D4CA0(&v1); + mapDisplay->unk_E0[v5] = ov21_021D4CA0(&v1); - sub_02012A60(param0->unk_E0[v5]->unk_00, v4 + 2); + sub_02012A60(mapDisplay->unk_E0[v5]->unk_00, v4 + 2); ov21_021D4DA0(v0); } } -static void ov21_021DD3FC(UnkStruct_ov21_021DD420 *param0) +static void ov21_021DD3FC(PokedexMapDisplay *mapDisplay) { int v0; - ov21_021D4D1C(param0->unk_CC); + ov21_021D4D1C(mapDisplay->AreaUnknownSpriteManager); for (v0 = 0; v0 < 3; v0++) { - ov21_021D4D1C(param0->unk_E0[v0]); + ov21_021D4D1C(mapDisplay->unk_E0[v0]); } } -static void ov21_021DD420(UnkStruct_ov21_021DD420 *param0) +static void PokedexMapDisplay_OAMMode_XLU(PokedexMapDisplay *mapDisplay) { int v0; - CellActor_SetExplicitOAMMode(param0->unk_C8, GX_OAM_MODE_XLU); - sub_02012AF0(param0->unk_CC->unk_00, GX_OAM_MODE_XLU); + CellActor_SetExplicitOAMMode(mapDisplay->AreaUnknownCellActor, GX_OAM_MODE_XLU); + sub_02012AF0(mapDisplay->AreaUnknownSpriteManager->unk_00, GX_OAM_MODE_XLU); for (v0 = 0; v0 < 3; v0++) { - sub_02012AF0(param0->unk_E0[v0]->unk_00, GX_OAM_MODE_XLU); + sub_02012AF0(mapDisplay->unk_E0[v0]->unk_00, GX_OAM_MODE_XLU); } } -static void ov21_021DD458(UnkStruct_ov21_021DD420 *param0) +static void PokedexMapDisplay_OAMMode_Normal(PokedexMapDisplay *mapDisplay) { int v0; - CellActor_SetExplicitOAMMode(param0->unk_C8, GX_OAM_MODE_NORMAL); - sub_02012AF0(param0->unk_CC->unk_00, GX_OAM_MODE_NORMAL); + CellActor_SetExplicitOAMMode(mapDisplay->AreaUnknownCellActor, GX_OAM_MODE_NORMAL); + sub_02012AF0(mapDisplay->AreaUnknownSpriteManager->unk_00, GX_OAM_MODE_NORMAL); for (v0 = 0; v0 < 3; v0++) { - sub_02012AF0(param0->unk_E0[v0]->unk_00, GX_OAM_MODE_NORMAL); + sub_02012AF0(mapDisplay->unk_E0[v0]->unk_00, GX_OAM_MODE_NORMAL); } } -static void ov21_021DD490(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCAE0 *param1, const UnkStruct_ov21_021DCACC *param2, BOOL param3) +static void ov21_021DD490(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1, const UnkStruct_ov21_021DCACC *param2, BOOL param3) { - ov21_021DD420(param0); + PokedexMapDisplay_OAMMode_XLU(mapDisplay); if (ov21_021E2A54(param2->unk_08)) { if (param3) { @@ -719,7 +731,7 @@ static void ov21_021DD490(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCA ov21_021D24FC(param1->unk_00, ¶m1->unk_00->unk_168); } -static BOOL ov21_021DD508(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCAE0 *param1, const UnkStruct_ov21_021DCACC *param2, BOOL param3) +static BOOL ov21_021DD508(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1, const UnkStruct_ov21_021DCACC *param2, BOOL param3) { BOOL v0; @@ -731,7 +743,7 @@ static BOOL ov21_021DD508(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCA if (v0) { if (param3) { - ov21_021DD458(param0); + PokedexMapDisplay_OAMMode_Normal(mapDisplay); } return 1; @@ -742,12 +754,12 @@ static BOOL ov21_021DD508(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCA return 0; } -static void ov21_021DD554(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCAE0 *param1, const UnkStruct_ov21_021DCACC *param2, BOOL param3) +static void ov21_021DD554(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1, const UnkStruct_ov21_021DCACC *param2, BOOL param3) { - ov21_021DD420(param0); + PokedexMapDisplay_OAMMode_XLU(mapDisplay); if (param3 == 0) { - ov21_021D2648(¶m0->unk_814, 40, param1->unk_04, 120, param1->unk_08, param1->unk_10); + ov21_021D2648(&mapDisplay->unk_814, 40, param1->unk_04, 120, param1->unk_08, param1->unk_10); } if (ov21_021E2A54(param2->unk_08)) { @@ -759,14 +771,14 @@ static void ov21_021DD554(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCA } } -static BOOL ov21_021DD5E4(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCAE0 *param1, const UnkStruct_ov21_021DCACC *param2, BOOL param3) +static BOOL ov21_021DD5E4(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1, const UnkStruct_ov21_021DCACC *param2, BOOL param3) { BOOL v0[2]; int v1; if (param3 == 0) { - v0[0] = ov21_021D2664(¶m0->unk_814); - ov21_021D2164(param1->unk_00, param0->unk_814.unk_00, param0->unk_814.unk_04); + v0[0] = ov21_021D2664(&mapDisplay->unk_814); + ov21_021D2164(param1->unk_00, mapDisplay->unk_814.unk_00, mapDisplay->unk_814.unk_04); } else { v0[0] = 1; } @@ -785,7 +797,7 @@ static BOOL ov21_021DD5E4(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCA if (v1 == 2) { if (param3 == 1) { - ov21_021DD458(param0); + PokedexMapDisplay_OAMMode_Normal(mapDisplay); } return 1; @@ -794,441 +806,443 @@ static BOOL ov21_021DD5E4(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCA return 0; } -static void ov21_021DD668(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCAE0 *param1, int param2) +static void ov21_021DD668(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1, int heapID) { Window_FillTilemap(¶m1->unk_00->unk_04, 0); - param0->unk_7F4 = ov21_021D2808(param1->unk_00, 30, 1, ¶m0->unk_7F8, param2); - param0->unk_7FC = ov21_021D2808(param1->unk_00, 31, 1, ¶m0->unk_800, param2); + mapDisplay->unk_7F4 = ov21_021D2808(param1->unk_00, 30, 1, &mapDisplay->unk_7F8, heapID); + mapDisplay->unk_7FC = ov21_021D2808(param1->unk_00, 31, 1, &mapDisplay->unk_800, heapID); Window_SetPalette(¶m1->unk_00->unk_04, 8); } -static void ov21_021DD6C0(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCAE0 *param1) +static void ov21_021DD6C0(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1) { Window_FillTilemap(¶m1->unk_00->unk_04, 0); Bg_ClearTilemap(param1->unk_00->unk_00, 1); - Heap_FreeToHeap(param0->unk_7F4); + Heap_FreeToHeap(mapDisplay->unk_7F4); - param0->unk_7F4 = NULL; - param0->unk_7F8 = NULL; + mapDisplay->unk_7F4 = NULL; + mapDisplay->unk_7F8 = NULL; - Heap_FreeToHeap(param0->unk_7FC); + Heap_FreeToHeap(mapDisplay->unk_7FC); - param0->unk_7FC = NULL; - param0->unk_800 = NULL; + mapDisplay->unk_7FC = NULL; + mapDisplay->unk_800 = NULL; Window_SetPalette(¶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(PokedexMapDisplay *mapDisplay, const UnkStruct_ov21_021DCACC *param1, const EncounterCollection *encounterCollection, int heapID) { - int v0, v1; + int index, v1; int v2, v3; - int v4, v5; - int v6; - u8 *v7; - int v8; + int xOffset, yOffset; + int species; + u8 *combinedMapArray; + int numCombinedMaps; - ov21_021DD8B4(param0); + ov21_021DD8B4(mapDisplay); - 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); + mapDisplay->numVisibleFields = PokedexEncData_LocateVisibleFields(mapDisplay->pokedexFieldMap_1, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH, mapDisplay->fieldCoordinatesArray, &encounterCollection->fieldsEncounteredOn, encounterCollection->invisibleFields, encounterCollection->numInvisibleFields); + numCombinedMaps = (encounterCollection->fieldsEncounteredOn.numLocations - 1) + encounterCollection->numInvisibleFields; + combinedMapArray = Heap_AllocFromHeapAtEnd(heapID, numCombinedMaps); - for (v0 = 0; v0 < v8; v0++) { - if (v0 < param2->unk_0C) { - v7[v0] = param2->unk_04[v0]; + for (index = 0; index < numCombinedMaps; index++) { + if (index < encounterCollection->numInvisibleFields) { + combinedMapArray[index] = encounterCollection->invisibleFields[index]; } else { - v7[v0] = param2->unk_1C.unk_00[v0 - param2->unk_0C]; + combinedMapArray[index] = encounterCollection->fieldsEncounteredOn.locations[index - encounterCollection->numInvisibleFields]; } } - param0->unk_840 = ov21_021D5948(param0->unk_470, 30, 30, param0->unk_808, ¶m2->unk_2C, v7, v8); + mapDisplay->fieldsZero = PokedexEncData_LocateVisibleFields(mapDisplay->pokedexFieldMap_2, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH, mapDisplay->fieldCoordinatesArray, &encounterCollection->fieldSpecialEncounters, combinedMapArray, numCombinedMaps); - Heap_FreeToHeap(v7); - ov21_021D5214(param0->unk_EC, 30, 30); - ov21_021D5214(param0->unk_470, 30, 30); + Heap_FreeToHeap(combinedMapArray); + PokedexFieldMap_SmoothFields(mapDisplay->pokedexFieldMap_1, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH); + PokedexFieldMap_SmoothFields(mapDisplay->pokedexFieldMap_2, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH); - v6 = ov21_021D37BC(param1->unk_00); + species = PokedexSort_CurrentSpecies(param1->unk_00); - if (v6 == 349) { + if (species == SPECIES_FEEBAS) { v2 = 4; v3 = 5; - v4 = 92 + 0; - v5 = 32 + -18; + xOffset = 92 + 0; + yOffset = 32 + -18; } else { v2 = 0; v3 = 1; - v4 = 92; - v5 = 32; + xOffset = 92; + yOffset = 32; } - 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); + mapDisplay->numDungeons = 0; + mapDisplay->numDungeons = PokedexEncData_LocateVisibleDungeons(mapDisplay->cellActorArray, mapDisplay->numDungeons, (NUMDUNGEONS * 2), xOffset, yOffset, POKEDEXMAPXSCALE, POKEDEXMAPYSCALE, mapDisplay->dungeonCoordinatesArray, &encounterCollection->dungeonsEncounteredOn, 2, v2, encounterCollection->invisibleDungeons, encounterCollection->numInvisibleDungeons, &mapDisplay->numVisibleDungeons); - v8 = (param2->unk_14.unk_04 - 1) + param2->unk_10; - v7 = Heap_AllocFromHeapAtEnd(param3, v8); + numCombinedMaps = (encounterCollection->dungeonsEncounteredOn.numLocations - 1) + encounterCollection->numInvisibleDungeons; + combinedMapArray = Heap_AllocFromHeapAtEnd(heapID, numCombinedMaps); - for (v0 = 0; v0 < v8; v0++) { - if (v0 < param2->unk_10) { - v7[v0] = param2->unk_08[v0]; + for (index = 0; index < numCombinedMaps; index++) { + if (index < encounterCollection->numInvisibleDungeons) { + combinedMapArray[index] = encounterCollection->invisibleDungeons[index]; } else { - v7[v0] = param2->unk_14.unk_00[v0 - param2->unk_10]; + combinedMapArray[index] = encounterCollection->dungeonsEncounteredOn.locations[index - encounterCollection->numInvisibleDungeons]; } } - 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); + mapDisplay->numDungeons = PokedexEncData_LocateVisibleDungeons(mapDisplay->cellActorArray, mapDisplay->numDungeons, (NUMDUNGEONS * 2), xOffset, yOffset, POKEDEXMAPXSCALE, POKEDEXMAPYSCALE, mapDisplay->dungeonCoordinatesArray, &encounterCollection->dungeonSpecialEncounters, 3, v3, combinedMapArray, numCombinedMaps, &mapDisplay->dungeonsZero); - Heap_FreeToHeap(v7); + Heap_FreeToHeap(combinedMapArray); } -static void ov21_021DD8B4(UnkStruct_ov21_021DD420 *param0) +static void ov21_021DD8B4(PokedexMapDisplay *mapDisplay) { int v0; - memset(param0->unk_EC, 0, sizeof(u8) * (30 * 30)); - memset(param0->unk_470, 0, sizeof(u8) * (30 * 30)); + memset(mapDisplay->pokedexFieldMap_1, 0, sizeof(u8) * (POKEDEXMAPHEIGHT * POKEDEXMAPWIDTH)); + memset(mapDisplay->pokedexFieldMap_2, 0, sizeof(u8) * (POKEDEXMAPHEIGHT * POKEDEXMAPWIDTH)); - for (v0 = 0; v0 < param0->unk_C4; v0++) { - CellActor_SetDrawFlag(param0->unk_04[v0], 0); + for (v0 = 0; v0 < mapDisplay->numDungeons; v0++) { + CellActor_SetDrawFlag(mapDisplay->cellActorArray[v0], 0); } - param0->unk_C4 = 0; + mapDisplay->numDungeons = 0; } -static u8 *ov21_021DD900(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 *param2) +static u8 *PokedexEncounters_InvisibleFields(u32 heapID, const UnkStruct_ov21_021DCACC *param1, u32 *numInvisibleFields) { - u32 v0; - int v1; - u8 *v2; + u32 fieldCount; + int index; + u8 *invisibleFields; - v0 = 0; + fieldCount = 0; - if (param1->unk_00->unk_1760 == 0) { - v1 = 0; + if (param1->unk_00->fullmoonIslandVisible == 0) { + index = 0; - while (Unk_ov21_021E9D78[v1] != 0xffff) { - v0++; - v1++; + while (fullmoonIslandFields[index] != TERMINALVALUE) { + fieldCount++; + index++; } } - if (param1->unk_00->unk_176C == 0) { - v1 = 0; + if (param1->unk_00->seabreakPathVisible == 0) { + index = 0; - while (Unk_ov21_021E9D74[v1] != 0xffff) { - v0++; - v1++; + while (seabreakPathFields[index] != TERMINALVALUE) { + fieldCount++; + index++; } } - if (param1->unk_00->unk_1764 == 0) { - v1 = 0; + if (param1->unk_00->newmoonIslandVisible == 0) { + index = 0; - while (Unk_ov21_021E9D70[v1] != 0xffff) { - v0++; - v1++; + while (newmoonIslandFields[index] != TERMINALVALUE) { + fieldCount++; + index++; } } - if (param1->unk_00->unk_1768 == 0) { - v1 = 0; + if (param1->unk_00->springPathVisible == 0) { + index = 0; - while (Unk_ov21_021E9D6C[v1] != 0xffff) { - v0++; - v1++; + while (springPathFields[index] != TERMINALVALUE) { + fieldCount++; + index++; } } - if (v0 > 0) { - v2 = Heap_AllocFromHeap(param0, sizeof(u8) * v0); + if (fieldCount > 0) { + invisibleFields = Heap_AllocFromHeap(heapID, sizeof(u8) * fieldCount); } else { - v2 = NULL; + invisibleFields = NULL; } - *param2 = v0; + *numInvisibleFields = fieldCount; - if (param1->unk_00->unk_1760 == 0) { - v1 = 0; + fieldCount = 0; - while (Unk_ov21_021E9D78[v1] != 0xffff) { - v2[v1] = Unk_ov21_021E9D78[v1]; - v0++; - v1++; + if (param1->unk_00->fullmoonIslandVisible == 0) { + index = 0; + + while (fullmoonIslandFields[index] != TERMINALVALUE) { + invisibleFields[fieldCount] = fullmoonIslandFields[index]; + fieldCount++; + index++; } } - if (param1->unk_00->unk_176C == 0) { - v1 = 0; + if (param1->unk_00->seabreakPathVisible == 0) { + index = 0; - while (Unk_ov21_021E9D74[v1] != 0xffff) { - v2[v1] = Unk_ov21_021E9D74[v1]; - v0++; - v1++; + while (seabreakPathFields[index] != TERMINALVALUE) { + invisibleFields[fieldCount] = seabreakPathFields[index]; + fieldCount++; + index++; } } - if (param1->unk_00->unk_1764 == 0) { - v1 = 0; + if (param1->unk_00->newmoonIslandVisible == 0) { + index = 0; - while (Unk_ov21_021E9D70[v1] != 0xffff) { - v2[v1] = Unk_ov21_021E9D70[v1]; - v0++; - v1++; + while (newmoonIslandFields[index] != TERMINALVALUE) { + invisibleFields[fieldCount] = newmoonIslandFields[index]; + fieldCount++; + index++; } } - if (param1->unk_00->unk_1768 == 0) { - v1 = 0; + if (param1->unk_00->springPathVisible == 0) { + index = 0; - while (Unk_ov21_021E9D6C[v1] != 0xffff) { - v2[v1] = Unk_ov21_021E9D6C[v1]; - v0++; - v1++; + while (springPathFields[index] != TERMINALVALUE) { + invisibleFields[fieldCount] = springPathFields[index]; + fieldCount++; + index++; } } - return v2; + return invisibleFields; } -static u8 *ov21_021DD908(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 *param2) +static u8 *PokedexEncounters_InvisibleDungeons(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 *numInvisibleDungeons) { - u32 v0; - int v1; - u8 *v2; + u32 dungeonCount; + int index; + u8 *invisibleDungeons; - v0 = 0; + dungeonCount = 0; - if (param1->unk_00->unk_1760 == 0) { - v1 = 0; + if (param1->unk_00->fullmoonIslandVisible == 0) { + index = 0; - while (Unk_ov21_021E9D76[v1] != 0xffff) { - v0++; - v1++; + while (fullmoonIslandDungeons[index] != TERMINALVALUE) { + dungeonCount++; + index++; } } - if (param1->unk_00->unk_176C == 0) { - v1 = 0; + if (param1->unk_00->seabreakPathVisible == 0) { + index = 0; - while (Unk_ov21_021E9D72[v1] != 0xffff) { - v0++; - v1++; + while (seabreakPathDungeons[index] != TERMINALVALUE) { + dungeonCount++; + index++; } } - if (param1->unk_00->unk_1764 == 0) { - v1 = 0; + if (param1->unk_00->newmoonIslandVisible == 0) { + index = 0; - while (Unk_ov21_021E9D6E[v1] != 0xffff) { - v0++; - v1++; + while (newmoonIslandDungeons[index] != TERMINALVALUE) { + dungeonCount++; + index++; } } - if (param1->unk_00->unk_1768 == 0) { - v1 = 0; + if (param1->unk_00->springPathVisible == 0) { + index = 0; - while (Unk_ov21_021E9D7A[v1] != 0xffff) { - v0++; - v1++; + while (springPathDungeons[index] != TERMINALVALUE) { + dungeonCount++; + index++; } } - if (v0 > 0) { - v2 = Heap_AllocFromHeap(param0, sizeof(u8) * v0); + if (dungeonCount > 0) { + invisibleDungeons = Heap_AllocFromHeap(param0, sizeof(u8) * dungeonCount); } else { - v2 = NULL; + invisibleDungeons = NULL; } - *param2 = v0; + *numInvisibleDungeons = dungeonCount; - v0 = 0; + dungeonCount = 0; - if (param1->unk_00->unk_1760 == 0) { - v1 = 0; + if (param1->unk_00->fullmoonIslandVisible == 0) { + index = 0; - while (Unk_ov21_021E9D76[v1] != 0xffff) { - v2[v0] = Unk_ov21_021E9D76[v1]; - v0++; - v1++; + while (fullmoonIslandDungeons[index] != TERMINALVALUE) { + invisibleDungeons[dungeonCount] = fullmoonIslandDungeons[index]; + dungeonCount++; + index++; } } - if (param1->unk_00->unk_176C == 0) { - v1 = 0; + if (param1->unk_00->seabreakPathVisible == 0) { + index = 0; - while (Unk_ov21_021E9D72[v1] != 0xffff) { - v2[v0] = Unk_ov21_021E9D72[v1]; - v0++; - v1++; + while (seabreakPathDungeons[index] != TERMINALVALUE) { + invisibleDungeons[dungeonCount] = seabreakPathDungeons[index]; + dungeonCount++; + index++; } } - if (param1->unk_00->unk_1764 == 0) { - v1 = 0; + if (param1->unk_00->newmoonIslandVisible == 0) { + index = 0; - while (Unk_ov21_021E9D6E[v1] != 0xffff) { - v2[v0] = Unk_ov21_021E9D6E[v1]; - v0++; - v1++; + while (newmoonIslandDungeons[index] != TERMINALVALUE) { + invisibleDungeons[dungeonCount] = newmoonIslandDungeons[index]; + dungeonCount++; + index++; } } - if (param1->unk_00->unk_1768 == 0) { - v1 = 0; + if (param1->unk_00->springPathVisible == 0) { + index = 0; - while (Unk_ov21_021E9D7A[v1] != 0xffff) { - v2[v0] = Unk_ov21_021E9D7A[v1]; - v0++; - v1++; + while (springPathDungeons[index] != TERMINALVALUE) { + invisibleDungeons[dungeonCount] = springPathDungeons[index]; + dungeonCount++; + index++; } } - return v2; + return invisibleDungeons; } -static void ov21_021DD964(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCAE0 *param1) +static void ov21_021DD964(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1) { Window_FillTilemap(¶m1->unk_00->unk_04, 0); - ov21_021D517C(¶m1->unk_00->unk_04, param0->unk_800->pRawData, param0->unk_800->W * 8, param0->unk_800->H * 8, 5, param0->unk_470, 30, 30, 89, 30); - ov21_021D517C(¶m1->unk_00->unk_04, param0->unk_7F8->pRawData, param0->unk_7F8->W * 8, param0->unk_7F8->H * 8, 5, param0->unk_EC, 30, 30, 89, 30); + PokedexFieldMap_DisplayFields(¶m1->unk_00->unk_04, mapDisplay->unk_800->pRawData, mapDisplay->unk_800->W * 8, mapDisplay->unk_800->H * 8, POKEDEXMAPXSCALE, mapDisplay->pokedexFieldMap_2, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH, 89, 30); + PokedexFieldMap_DisplayFields(¶m1->unk_00->unk_04, mapDisplay->unk_7F8->pRawData, mapDisplay->unk_7F8->W * 8, mapDisplay->unk_7F8->H * 8, POKEDEXMAPXSCALE, mapDisplay->pokedexFieldMap_1, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH, 89, 30); Window_CopyToVRAM(¶m1->unk_00->unk_04); } -static void ov21_021DD9E8(UnkStruct_ov21_021DD420 *param0, const UnkStruct_ov21_021DDABC *param1) +static void ov21_021DD9E8(PokedexMapDisplay *mapDisplay, const EncounterCollection *encounterCollection) { - if ((param0->unk_834 <= 0) && (param0->unk_838 <= 0) && (param0->unk_83C <= 0) && (param0->unk_840 <= 0)) { - CellActor_SetDrawFlag(param0->unk_C8, 1); - sub_020129D0(param0->unk_CC->unk_00, 1); + if ((mapDisplay->numVisibleDungeons <= 0) && (mapDisplay->numVisibleFields <= 0) && (mapDisplay->dungeonsZero <= 0) && (mapDisplay->fieldsZero <= 0)) { + CellActor_SetDrawFlag(mapDisplay->AreaUnknownCellActor, 1); + sub_020129D0(mapDisplay->AreaUnknownSpriteManager->unk_00, 1); } else { - CellActor_SetDrawFlag(param0->unk_C8, 0); - sub_020129D0(param0->unk_CC->unk_00, 0); + CellActor_SetDrawFlag(mapDisplay->AreaUnknownCellActor, 0); + sub_020129D0(mapDisplay->AreaUnknownSpriteManager->unk_00, 0); } } -static void ov21_021DDA48(UnkStruct_ov21_021DD420 *param0, int param1) +static void ov21_021DDA48(PokedexMapDisplay *mapDisplay, int param1) { int v0; for (v0 = 0; v0 < 3; v0++) { if (v0 == param1) { - sub_020129D0(param0->unk_E0[v0]->unk_00, 1); + sub_020129D0(mapDisplay->unk_E0[v0]->unk_00, 1); } else { - sub_020129D0(param0->unk_E0[v0]->unk_00, 0); + sub_020129D0(mapDisplay->unk_E0[v0]->unk_00, 0); } } } -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_021DDA80(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1, const UnkStruct_ov21_021DCACC *param2, const EncounterCollection *encounterCollection, int param4) { - if (param0->unk_00 != param3->unk_00) { - ov21_021DD710(param0, param2, param3, param4); - ov21_021DD964(param0, param1); - ov21_021DDA48(param0, param2->unk_04); - ov21_021DD9E8(param0, param3); - param0->unk_00 = param3->unk_00; + if (mapDisplay->encounterTime != encounterCollection->encounterTime) { + ov21_021DD710(mapDisplay, param2, encounterCollection, param4); + ov21_021DD964(mapDisplay, param1); + ov21_021DDA48(mapDisplay, param2->encounterTime); + ov21_021DD9E8(mapDisplay, encounterCollection); + mapDisplay->encounterTime = encounterCollection->encounterTime; } } -static void ov21_021DDABC(UnkStruct_ov21_021DDABC *param0, UnkStruct_ov21_021DCACC *param1, int param2) +static void PokedexSort_PopulateDexStatus(EncounterCollection *encounterCollection, UnkStruct_ov21_021DCACC *param1, int heapID) { - int v0; - int v1; - int v2 = ov21_021D37BC(param1->unk_00); + int dungeonCategory; + int fieldCategory; + int species = PokedexSort_CurrentSpecies(param1->unk_00); - switch (param1->unk_04) { - case 0: - v0 = 0; - v1 = 5; + switch (param1->encounterTime) { + case ENCTIME_MORNING: + dungeonCategory = PEFC_DUNGEONMORNING; + fieldCategory = PEFC_FIELDMORNING; break; - case 1: - v0 = 1; - v1 = 6; + case ENCTIME_DAY: + dungeonCategory = PEFC_DUNGEONDAY; + fieldCategory = PEFC_FIELDDAY; break; - case 2: - v0 = 2; - v1 = 7; + case ENCTIME_NIGHT: + dungeonCategory = PEFC_DUNGEONNIGHT; + fieldCategory = PEFC_FIELDNIGHT; break; default: GF_ASSERT(0); break; } - ov21_021D57B4(¶m0->unk_14, v2, v0, param2); - ov21_021D57B4(¶m0->unk_1C, v2, v1, param2); + PokedexEncData_PopulateEncounterLocations(&encounterCollection->dungeonsEncounteredOn, species, dungeonCategory, heapID); + PokedexEncData_PopulateEncounterLocations(&encounterCollection->fieldsEncounteredOn, species, fieldCategory, 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 (PokedexSort_IsNationalUnlocked(param1->unk_00) == 0) { + PokedexEncData_PopulateEncounterLocations(&encounterCollection->dungeonSpecialEncounters, species, PEFC_DUNGEONSPECIAL, heapID); + PokedexEncData_PopulateEncounterLocations(&encounterCollection->fieldSpecialEncounters, species, PEFC_FIELDSPECIAL, heapID); } else { - ov21_021D57B4(¶m0->unk_24, v2, 4, param2); - ov21_021D57B4(¶m0->unk_2C, v2, 9, param2); + PokedexEncData_PopulateEncounterLocations(&encounterCollection->dungeonSpecialEncounters, species, PEFC_DUNGEONSPECIALNATDEX, heapID); + PokedexEncData_PopulateEncounterLocations(&encounterCollection->fieldSpecialEncounters, species, PEFC_FIELDSPECIALNATDEX, heapID); } } -static void ov21_021DDB68(UnkStruct_ov21_021DDABC *param0) +static void ov21_021DDB68(EncounterCollection *encounterCollection) { - ov21_021D5844(¶m0->unk_14); - ov21_021D5844(¶m0->unk_1C); - ov21_021D5844(¶m0->unk_24); - ov21_021D5844(¶m0->unk_2C); + PokedexEncData_FreeEncounterLocations(&encounterCollection->dungeonsEncounteredOn); + PokedexEncData_FreeEncounterLocations(&encounterCollection->fieldsEncounteredOn); + PokedexEncData_FreeEncounterLocations(&encounterCollection->dungeonSpecialEncounters); + PokedexEncData_FreeEncounterLocations(&encounterCollection->fieldSpecialEncounters); } -static void ov21_021DDB8C(UnkStruct_ov21_021DD420 *param0) +static void ov21_021DDB8C(PokedexMapDisplay *mapDisplay) { - int v0; + int dungeonIndex; - param0->unk_80C = 0; - param0->unk_810 = 0; + mapDisplay->unk_80C = 0; + mapDisplay->unk_810 = 0; GXLayers_EngineAToggleLayers(GX_BLEND_PLANEMASK_BG1, 0); - for (v0 = 0; v0 < param0->unk_C4; v0++) { - CellActor_SetDrawFlag(param0->unk_04[v0], 0); + for (dungeonIndex = 0; dungeonIndex < mapDisplay->numDungeons; dungeonIndex++) { + CellActor_SetDrawFlag(mapDisplay->cellActorArray[dungeonIndex], 0); } } -static void ov21_021DDBCC(UnkStruct_ov21_021DD420 *param0) +static void ov21_021DDBCC(PokedexMapDisplay *mapDisplay) { - int v0; + int dungeonIndex; G2_SetBlendAlpha(GX_BLEND_PLANEMASK_BG1 | GX_BLEND_PLANEMASK_BG3, GX_BLEND_PLANEMASK_BG3, 0, 16); GXLayers_EngineAToggleLayers(GX_BLEND_PLANEMASK_BG1, 1); - for (v0 = 0; v0 < param0->unk_C4; v0++) { - CellActor_SetDrawFlag(param0->unk_04[v0], 0); + for (dungeonIndex = 0; dungeonIndex < mapDisplay->numDungeons; dungeonIndex++) { + CellActor_SetDrawFlag(mapDisplay->cellActorArray[dungeonIndex], 0); } } -static void ov21_021DDC14(UnkStruct_ov21_021DD420 *param0) +static void ov21_021DDC14(PokedexMapDisplay *mapDisplay) { fx32 v0; int v1; - int v2; + int dungeonIndex; - if (param0->unk_80C >= 32) { - param0->unk_80C = 0; + if (mapDisplay->unk_80C >= 32) { + mapDisplay->unk_80C = 0; - if (param0->unk_810 == 0) { - for (v2 = 0; v2 < param0->unk_C4; v2++) { - CellActor_SetDrawFlag(param0->unk_04[v2], 1); + if (mapDisplay->unk_810 == 0) { + for (dungeonIndex = 0; dungeonIndex < mapDisplay->numDungeons; dungeonIndex++) { + CellActor_SetDrawFlag(mapDisplay->cellActorArray[dungeonIndex], 1); } - param0->unk_810 = 1; + mapDisplay->unk_810 = 1; } else { GXLayers_EngineAToggleLayers(GX_BLEND_PLANEMASK_BG1, 1); - param0->unk_810 = 0; + mapDisplay->unk_810 = 0; } } - if (param0->unk_80C < 16) { - v1 = param0->unk_80C; + if (mapDisplay->unk_80C < 16) { + v1 = mapDisplay->unk_80C; } else { - v1 = 32 - param0->unk_80C; + v1 = 32 - mapDisplay->unk_80C; } v0 = FX_Mul((16 << FX32_SHIFT), (v1 << FX32_SHIFT)); @@ -1236,14 +1250,14 @@ static void ov21_021DDC14(UnkStruct_ov21_021DD420 *param0) G2_ChangeBlendAlpha(v0 >> FX32_SHIFT, 16); - param0->unk_80C++; + mapDisplay->unk_80C++; - if (param0->unk_80C >= 32) { - if (param0->unk_810 == 0) { + if (mapDisplay->unk_80C >= 32) { + if (mapDisplay->unk_810 == 0) { GXLayers_EngineAToggleLayers(GX_BLEND_PLANEMASK_BG1, 0); } else { - for (v2 = 0; v2 < param0->unk_C4; v2++) { - CellActor_SetDrawFlag(param0->unk_04[v2], 0); + for (dungeonIndex = 0; dungeonIndex < mapDisplay->numDungeons; dungeonIndex++) { + CellActor_SetDrawFlag(mapDisplay->cellActorArray[dungeonIndex], 0); } } } @@ -1252,8 +1266,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 = PokedexSort_CurrentSpecies(param1->unk_00); - ov21_021D1890(param0->unk_00, param1->unk_00, v1, 2, 40, 120); + ov21_021D1890(param0->unk_00, param1->unk_00, species, 2, 40, 120); sub_02007DEC(v0, 6, 0); } diff --git a/src/overlay021/ov21_021DDD2C.c b/src/overlay021/ov21_021DDD2C.c index c56859f08d..ad413772a6 100644 --- a/src/overlay021/ov21_021DDD2C.c +++ b/src/overlay021/ov21_021DDD2C.c @@ -7,9 +7,9 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" #include "overlay021/ov21_021DC9BC.h" #include "overlay021/ov21_021E29DC.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D3320.h" @@ -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 9a61250f3a..cde9243932 100644 --- a/src/overlay021/ov21_021DE668.c +++ b/src/overlay021/ov21_021DE668.c @@ -8,10 +8,10 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1F90.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021D5600.h" #include "overlay021/ov21_021E29DC.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D2648.h" @@ -200,8 +200,8 @@ 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_021D344C(v0->unk_04, ov21_021D36D8(v0->unk_04)); + ov21_021D3434(v0->unk_04, PokedexSort_CurrentSpecies(v0->unk_04)); + ov21_021D344C(v0->unk_04, PokedexStatus_IsNationalDex(v0->unk_04)); return 1; } @@ -221,7 +221,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, PokedexSort_CurrentSpecies(v0->unk_04), 0x1ff, 0x1ff, 0x1ff, 0); v0->unk_1C = 0; } @@ -249,12 +249,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: @@ -368,7 +368,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 (PokedexSort_CurrentCaughtStatus(param2->unk_04) == 2) { ov21_021DED24(param0, param1, param2, param3); ov21_021DF098(param0, param1, param2, param3); } @@ -414,13 +414,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 = PokedexSort_CurrentSpecies(param1->unk_04); - if (ov21_021D37CC(param1->unk_04) != 2) { - v0 = 0; + if (PokedexSort_CurrentCaughtStatus(param1->unk_04) != 2) { + species = 0; } - ov21_021DEB8C(¶m0->unk_00->unk_04, v0, param2, param1->unk_18, TEXT_COLOR(2, 1, 0)); + ov21_021DEB8C(¶m0->unk_00->unk_04, species, param2, param1->unk_18, TEXT_COLOR(2, 1, 0)); } void ov21_021DEB8C(Window *param0, int param1, int param2, int param3, u32 param4) @@ -479,14 +479,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 = PokedexSort_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); } @@ -563,7 +563,7 @@ static void ov21_021DEEF8(UnkStruct_ov21_021DF374 *param0) static void ov21_021DEF08(UnkStruct_ov21_021DE760 *param0, const UnkStruct_ov21_021DE6D4 *param1, int param2) { - ov21_021D1778(param0->unk_00, param1->unk_04, param2, ov21_021D375C(param1->unk_04), (172 * FX32_ONE), (32 * FX32_ONE)); + ov21_021D1778(param0->unk_00, param1->unk_04, param2, PokedexSort_CurrentStatusIndex(param1->unk_04), (172 * FX32_ONE), (32 * FX32_ONE)); ov21_021D238C(param0->unk_00, 0); } @@ -576,9 +576,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 = PokedexSort_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); } @@ -626,12 +626,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 = PokedexSort_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); @@ -737,7 +737,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 = PokedexSort_CurrentSpecies(param2->unk_04); Window *v4; UnkStruct_ov21_021D4CB8 v5; SpriteResource *v6; @@ -756,11 +756,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 (PokedexSort_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; @@ -771,7 +771,7 @@ static void ov21_021DF214(UnkStruct_ov21_021DF374 *param0, UnkStruct_ov21_021DE7 v5.unk_18 = 0; v5.unk_1C = 32 - 1; v5.unk_20 = NNS_G2D_VRAM_TYPE_2DMAIN; - v5.unk_24 = param3; + v5.heapID = param3; v5.unk_04 = v4; param0->unk_10 = ov21_021D4CA0(&v5); diff --git a/src/overlay021/ov21_021DF734.c b/src/overlay021/ov21_021DF734.c index d28211d26b..2d8a83fcf1 100644 --- a/src/overlay021/ov21_021DF734.c +++ b/src/overlay021/ov21_021DF734.c @@ -5,9 +5,9 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021E29DC.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D2648.h" @@ -258,12 +258,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 = PokedexSort_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; @@ -298,7 +298,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; @@ -307,7 +307,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; @@ -354,7 +354,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; @@ -439,14 +439,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 = PokedexSort_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); @@ -455,12 +455,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 = PokedexSort_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) @@ -1068,7 +1068,7 @@ static void ov21_021E09A4(UnkStruct_ov21_021DFFF8 *param0, UnkStruct_ov21_021DF8 v1.unk_18 = 3; v1.unk_1C = 0; v1.unk_20 = NNS_G2D_VRAM_TYPE_2DMAIN; - v1.unk_24 = param3; + v1.heapID = param3; v3 = sub_0201FAB4(v1.unk_08, NNS_G2D_VRAM_TYPE_2DMAIN); v0 = ov21_021D4D6C(v2->unk_14C, 16, 2); @@ -1088,9 +1088,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 = PokedexSort_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 3473d0635a..e07788233e 100644 --- a/src/overlay021/ov21_021E0C68.c +++ b/src/overlay021/ov21_021E0C68.c @@ -7,10 +7,10 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021D5600.h" #include "overlay021/ov21_021E29DC.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D2648.h" @@ -255,12 +255,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: @@ -418,12 +418,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 = PokedexSort_CurrentSpecies(param1->unk_04); int v3; int v4; - if (ov21_021D37CC(param1->unk_04) != 2) { - v2 = 0; + if (PokedexSort_CurrentCaughtStatus(param1->unk_04) != 2) { + species = 0; GF_ASSERT(0); } @@ -438,9 +438,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) @@ -455,7 +455,7 @@ static void ov21_021E1188(UnkStruct_ov21_021E0D7C *param0, int param1, int param static void ov21_021E11DC(UnkStruct_ov21_021E0D7C *param0, const UnkStruct_ov21_021E0D68 *param1, int param2) { - ov21_021D1778(param0->unk_00, param1->unk_04, param2, ov21_021D375C(param1->unk_04), (172 * FX32_ONE), (32 * FX32_ONE)); + ov21_021D1778(param0->unk_00, param1->unk_04, param2, PokedexSort_CurrentStatusIndex(param1->unk_04), (172 * FX32_ONE), (32 * FX32_ONE)); ov21_021D238C(param0->unk_00, 0); } @@ -468,9 +468,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 = PokedexSort_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); } @@ -519,7 +519,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 = PokedexSort_CurrentSpecies(param2->unk_04); Window *v4; UnkStruct_ov21_021D4CB8 v5; SpriteResource *v6; @@ -538,11 +538,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 (PokedexSort_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; @@ -553,7 +553,7 @@ static void ov21_021E136C(UnkStruct_ov21_021E14D4 *param0, UnkStruct_ov21_021E0D v5.unk_18 = 0; v5.unk_1C = 32 - 1; v5.unk_20 = NNS_G2D_VRAM_TYPE_2DMAIN; - v5.unk_24 = param3; + v5.heapID = param3; v5.unk_04 = v4; param0->unk_04 = ov21_021D4CA0(&v5); diff --git a/src/overlay021/ov21_021E1924.c b/src/overlay021/ov21_021E1924.c index 72b6579539..5b2cea0af7 100644 --- a/src/overlay021/ov21_021E1924.c +++ b/src/overlay021/ov21_021E1924.c @@ -7,13 +7,13 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" #include "overlay021/ov21_021D4340.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021D5600.h" #include "overlay021/ov21_021DE668.h" #include "overlay021/ov21_021E0C68.h" #include "overlay021/ov21_021E29DC.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D3320.h" @@ -263,7 +263,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++) { @@ -272,7 +272,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; @@ -322,12 +322,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++; @@ -378,7 +378,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]); } } @@ -409,7 +409,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: @@ -793,7 +793,7 @@ static void ov21_021E2478(UnkStruct_ov21_021E2588 *param0, UnkStruct_ov21_021E1A v1.unk_18 = 2; v1.unk_1C = 0; v1.unk_20 = NNS_G2D_VRAM_TYPE_2DSUB; - v1.unk_24 = param2; + v1.heapID = param2; v4 = sub_0201FAB4(v1.unk_08, NNS_G2D_VRAM_TYPE_2DSUB); v0 = ov21_021D4D6C(v3->unk_14C, 8, 4); @@ -1051,9 +1051,9 @@ static void ov21_021E2864(UnkStruct_ov21_021E1E74 *param0, UnkStruct_ov21_021E1A if (param0->unk_34 != 8) { if (param0->unk_34 == 1) { - v0 = ov21_021D371C(param1->unk_04, -1); + v0 = PokedexSort_TakeStep_Loop(param1->unk_04, -1); } else { - v0 = ov21_021D371C(param1->unk_04, 1); + v0 = PokedexSort_TakeStep_Loop(param1->unk_04, 1); } if (v0 == 1) { diff --git a/src/overlay021/ov21_021E29DC.c b/src/overlay021/ov21_021E29DC.c index 9e0b691590..98698290cc 100644 --- a/src/overlay021/ov21_021E29DC.c +++ b/src/overlay021/ov21_021E29DC.c @@ -7,13 +7,13 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" #include "overlay021/ov21_021D4340.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021D4EE4.h" #include "overlay021/ov21_021DC9BC.h" #include "overlay021/ov21_021E0C68.h" #include "overlay021/ov21_021E3FFC.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D3320.h" @@ -377,14 +377,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++; @@ -562,7 +562,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 (PokedexSort_CurrentCaughtStatus(param0->unk_04) == 2) { *param0->unk_00 |= (0x1 << 5); param0->unk_08 = 3; } else { @@ -570,7 +570,7 @@ static BOOL ov21_021E2EC4(UnkStruct_ov21_021E2BA8 *param0, int param1, int param } break; case 4: - if (ov21_021D3954(param0->unk_04) == 1) { + if (PokedexSort_CanDetectForms(param0->unk_04) == 1) { *param0->unk_00 |= (0x1 << 8); param0->unk_08 = 4; } else { @@ -653,7 +653,7 @@ static void ov21_021E30E4(UnkStruct_ov21_021E2BBC *param0, const UnkStruct_ov21_ ov21_021D276C(param0->unk_00, 6, 0, 0, 0, param2); - if (ov21_021D36D8(param1->unk_04) == 1) { + if (PokedexStatus_IsNationalDex(param1->unk_04) == 1) { ov21_021D276C(param0->unk_00, 24, 0, 0, 32, param2); } @@ -724,7 +724,7 @@ static void ov21_021E3270(UnkStruct_ov21_021E2BBC *param0, UnkStruct_ov21_021E32 v1.unk_1C = 0; v1.unk_0C = NULL; v1.unk_20 = NNS_G2D_VRAM_TYPE_2DMAIN; - v1.unk_24 = param2; + v1.heapID = param2; v3 = sub_0201FAB4(v1.unk_08, NNS_G2D_VRAM_TYPE_2DMAIN); @@ -883,11 +883,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++) { @@ -958,12 +958,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: @@ -1179,7 +1179,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 (PokedexSort_CanDetectForms(v3->unk_04) == 1) { if (v3->unk_08 != 2) { Sound_PlayEffect(1501); } @@ -1224,7 +1224,7 @@ static void ov21_021E3960(UnkStruct_ov21_021E3440 *param0, const UnkStruct_ov21_ if (param1->unk_04->unk_30) { ov21_021D276C(param0->unk_00, 6, 4, 0, 0, param2); - if (ov21_021D36D8(param1->unk_08) == 1) { + if (PokedexStatus_IsNationalDex(param1->unk_08) == 1) { ov21_021D276C(param0->unk_00, 24, 4, 0, 32, param2); } } @@ -1402,7 +1402,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 (PokedexSort_CanDetectForms(param1->unk_08) == 1) { v0 = 0; } else { v0 = 2; @@ -1597,7 +1597,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 (PokedexSort_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 0fc6d443e2..e32168a5bc 100644 --- a/src/overlay021/ov21_021E3FFC.c +++ b/src/overlay021/ov21_021E3FFC.c @@ -7,9 +7,9 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" #include "overlay021/ov21_021E29DC.h" #include "overlay021/ov21_021E4CA4.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D2648.h" @@ -217,16 +217,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 = PokedexSort_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); @@ -273,12 +273,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); @@ -372,9 +372,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 = PokedexSort_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 8862b3e4c9..14d72ea314 100644 --- a/src/overlay021/ov21_021E4CA4.c +++ b/src/overlay021/ov21_021E4CA4.c @@ -7,9 +7,9 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021E29DC.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D3320.h" @@ -279,15 +279,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 = PokedexSort_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; @@ -352,12 +352,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; @@ -417,7 +417,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: @@ -568,7 +568,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 = PokedexSort_CurrentSpecies(v1->unk_04); v2->unk_18[param0] = param1; @@ -585,7 +585,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); } @@ -594,7 +594,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: @@ -932,7 +932,7 @@ static void ov21_021E58B8(UnkStruct_ov21_021E5004 *param0, UnkStruct_ov21_021E4D v1.unk_18 = 2; v1.unk_1C = 0; v1.unk_20 = NNS_G2D_VRAM_TYPE_2DSUB; - v1.unk_24 = param2; + v1.heapID = param2; v4 = sub_0201FAB4(v1.unk_08, NNS_G2D_VRAM_TYPE_2DSUB); v0 = ov21_021D4D6C(v3->unk_14C, 8, 2); @@ -1284,13 +1284,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 = PokedexSort_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; } } @@ -1374,7 +1374,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 = PokedexSort_CurrentSpecies(param1->unk_04); if (gCoreSys.pressedKeys & PAD_BUTTON_A) { param0->unk_28 = 1; @@ -1386,10 +1386,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 6637ab30ef..2cd0219b99 100644 --- a/src/overlay021/ov21_021E6014.c +++ b/src/overlay021/ov21_021E6014.c @@ -7,8 +7,8 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" #include "overlay021/ov21_021E29DC.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D3320.h" @@ -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 = PokedexSort_CurrentSpecies(param2->unk_04); 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->unk_04->HWData, species); + v5 = Pokedex_HeightWeightData_TrainerScale(param2->unk_04->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 (PokedexSort_TrainerGender(param2->unk_04) == 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 = PokedexSort_CurrentSpecies(param1->unk_04); + Strbuf *v3 = MessageUtil_SpeciesName(species, param2); int heightMessageBankIndex = Height_Message_Bank_Index(); MessageLoader *v1 = MessageLoader_Init(0, 26, heightMessageBankIndex, param2); Text_AddPrinterWithParamsAndColor(¶m0->unk_00->unk_04, FONT_SYSTEM, v3, 26, 152, TEXT_SPEED_INSTANT, TEXT_COLOR(2, 1, 0), NULL); - MessageLoader_GetStrbuf(v1, v2, v0); + MessageLoader_GetStrbuf(v1, species, v0); { u32 v5 = 32 + 78 - Font_CalcStrbufWidth(FONT_SYSTEM, v0, 0); @@ -493,9 +493,9 @@ static void ov21_021E66B0(UnkStruct_ov21_021E6118 *param0, const UnkStruct_ov21_ v1 = MessageLoader_Init(0, 26, 697, param2); - Text_AddPrinterWithParamsAndColor(¶m0->unk_00->unk_04, FONT_SYSTEM, ov21_021D3914(param1->unk_04), 146, 152, TEXT_SPEED_INSTANT, TEXT_COLOR(2, 1, 0), NULL); + Text_AddPrinterWithParamsAndColor(¶m0->unk_00->unk_04, FONT_SYSTEM, PokedexSort_TrainerName(param1->unk_04), 146, 152, TEXT_SPEED_INSTANT, TEXT_COLOR(2, 1, 0), NULL); - if (ov21_021D3920(param1->unk_04) == 0) { + if (PokedexSort_TrainerGender(param1->unk_04) == 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 = PokedexSort_CurrentSpecies(param1->unk_04); - 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->unk_04->HWData, species); + v2 = Pokedex_HeightWeightData_PokemonScale(param1->unk_04->HWData, species); - ov21_021D1890(param0->unk_00, param1->unk_04, v3, 2, 88, 88 + v1); + ov21_021D1890(param0->unk_00, param1->unk_04, 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 739a74be61..0f0befad88 100644 --- a/src/overlay021/ov21_021E68F4.c +++ b/src/overlay021/ov21_021E68F4.c @@ -7,10 +7,10 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" #include "overlay021/ov21_021D4340.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021E29DC.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D3320.h" @@ -218,7 +218,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++) { @@ -227,7 +227,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; @@ -281,12 +281,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; @@ -313,7 +313,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); } @@ -339,7 +339,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: @@ -617,7 +617,7 @@ static void ov21_021E70D4(UnkStruct_ov21_021E6C60 *param0, UnkStruct_ov21_021E6A v1.unk_18 = 2; v1.unk_1C = 0; v1.unk_20 = NNS_G2D_VRAM_TYPE_2DSUB; - v1.unk_24 = param2; + v1.heapID = param2; v4 = sub_0201FAB4(v1.unk_08, NNS_G2D_VRAM_TYPE_2DSUB); v0 = ov21_021D4D6C(v3->unk_14C, 12, 2); diff --git a/src/overlay021/ov21_021E737C.c b/src/overlay021/ov21_021E737C.c index 4cb51a0fe4..53c96b4f70 100644 --- a/src/overlay021/ov21_021E737C.c +++ b/src/overlay021/ov21_021E737C.c @@ -9,8 +9,8 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" #include "overlay021/ov21_021E29DC.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D3320.h" @@ -275,18 +275,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 = PokedexSort_CurrentSpecies(v0->unk_00); + v2 = Pokedex_HeightWeightData_Weight(v0->unk_00->HWData, species); - if (ov21_021D3920(v0->unk_00) == 0) { + if (PokedexSort_TrainerGender(v0->unk_00) == 0) { v3 = 380; } else { v3 = 340; @@ -339,14 +339,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; @@ -547,15 +547,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 = PokedexSort_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); + v1 = PokeIconSpriteIndex(species, 0, v8); v2 = PokeIconPalettesFileIndex(); v3 = PokeIconCellsFileIndex(); v4 = PokeIconAnimationFileIndex(); @@ -627,8 +627,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 = PokedexSort_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); @@ -642,7 +642,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 (PokedexSort_TrainerGender(param2->unk_00) == 0) { CellActor_SetAnim(param0->unk_00, 3); } else { CellActor_SetAnim(param0->unk_00, 4); @@ -679,7 +679,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) @@ -721,17 +721,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 = PokedexSort_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); Text_AddPrinterWithParamsAndColor(¶m0->unk_00->unk_04, FONT_SYSTEM, v3, 26, 152, TEXT_SPEED_INSTANT, TEXT_COLOR(2, 1, 0), NULL); - MessageLoader_GetStrbuf(v1, v2, v0); + MessageLoader_GetStrbuf(v1, species, v0); { u32 v5 = 32 + 78 - Font_CalcStrbufWidth(FONT_SYSTEM, v0, 0); @@ -741,11 +741,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); - Text_AddPrinterWithParamsAndColor(¶m0->unk_00->unk_04, FONT_SYSTEM, ov21_021D3914(param1->unk_00), 146, 152, TEXT_SPEED_INSTANT, TEXT_COLOR(2, 1, 0), NULL); + Text_AddPrinterWithParamsAndColor(¶m0->unk_00->unk_04, FONT_SYSTEM, PokedexSort_TrainerName(param1->unk_00), 146, 152, TEXT_SPEED_INSTANT, TEXT_COLOR(2, 1, 0), NULL); - if (ov21_021D3920(param1->unk_00) == 0) { + if (PokedexSort_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 da0ed3d7d6..29e2ce74a7 100644 --- a/src/overlay021/ov21_021E8484.c +++ b/src/overlay021/ov21_021E8484.c @@ -7,10 +7,10 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021DF734.h" #include "overlay021/ov21_021E29DC.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D3320.h" @@ -203,14 +203,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; @@ -269,12 +269,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; @@ -301,7 +301,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); } @@ -327,7 +327,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: @@ -581,7 +581,7 @@ static void ov21_021E8B40(UnkStruct_ov21_021E8794 *param0, UnkStruct_ov21_021E85 v1.unk_18 = 2; v1.unk_1C = 0; v1.unk_20 = NNS_G2D_VRAM_TYPE_2DSUB; - v1.unk_24 = param2; + v1.heapID = param2; v4 = sub_0201FAB4(v1.unk_08, NNS_G2D_VRAM_TYPE_2DSUB); v0 = ov21_021D4D6C(v3->unk_14C, 16, 2); diff --git a/src/overlay021/ov21_021E8D48.c b/src/overlay021/ov21_021E8D48.c index 9bb26d6103..98910a1ee9 100644 --- a/src/overlay021/ov21_021E8D48.c +++ b/src/overlay021/ov21_021E8D48.c @@ -410,7 +410,7 @@ static void ov21_021E9240(UnkStruct_ov21_021D22F8 *param0, UnkStruct_ov21_021D4C v0.unk_18 = 2; v0.unk_1C = 0; v0.unk_20 = NNS_G2D_VRAM_TYPE_2DMAIN; - v0.unk_24 = param2; + v0.heapID = param2; if (param4 == 0) { v1 = ov21_021D172C(param1, param2, param3); @@ -561,7 +561,7 @@ static void ov21_021E9560(UnkStruct_ov21_021E95B0 *param0, UnkStruct_ov21_021D4C v1.unk_18 = 2; v1.unk_1C = 32 - 1; v1.unk_20 = NNS_G2D_VRAM_TYPE_2DMAIN; - v1.unk_24 = param2; + v1.heapID = param2; v1.unk_04 = v0; param0->unk_04 = ov21_021D4CA0(&v1); diff --git a/src/overlay021/pokedex_enc_data.c b/src/overlay021/pokedex_enc_data.c new file mode 100644 index 0000000000..c9237b2eec --- /dev/null +++ b/src/overlay021/pokedex_enc_data.c @@ -0,0 +1,183 @@ +#include "overlay021/pokedex_enc_data.h" + +#include +#include + +#include "cell_actor.h" +#include "graphics.h" +#include "heap.h" +#include "narc.h" + +enum PokedexEncFileIndex { + PEFI_DUNGEONMORNING = 4, + PEFI_DUNGEONDAY = (4 + MAX_SPECIES), + PEFI_DUNGEONNIGHT = (4 + MAX_SPECIES * 2), + PEFI_DUNGEONSPECIAL = (4 + MAX_SPECIES * 3), + PEFI_DUNGEONSPECIALNATDEX = (4 + MAX_SPECIES * 4), + PEFI_FIELDMORNING = (4 + MAX_SPECIES * 5), + PEFI_FIELDDAY = (4 + MAX_SPECIES * 6), + PEFI_FIELDNIGHT = (4 + MAX_SPECIES * 7), + PEFI_FIELDSPECIAL = (4 + MAX_SPECIES * 8), + PEFI_FIELDSPECIALNATDEX = (4 + MAX_SPECIES * 9), +}; + +void PokedexEncData_PopulateEncounterLocations(EncounterLocations *encounterLocations, int species, int encounterCategory, int heapID) +{ + int fileIndex; + u32 fileSize; + + switch (encounterCategory) { + case PEFC_DUNGEONMORNING: + fileIndex = PEFI_DUNGEONMORNING; + break; + case PEFC_DUNGEONDAY: + fileIndex = PEFI_DUNGEONDAY; + break; + case PEFC_DUNGEONNIGHT: + fileIndex = PEFI_DUNGEONNIGHT; + break; + case PEFC_DUNGEONSPECIAL: + fileIndex = PEFI_DUNGEONSPECIAL; + break; + case PEFC_DUNGEONSPECIALNATDEX: + fileIndex = PEFI_DUNGEONSPECIALNATDEX; + break; + case PEFC_FIELDMORNING: + fileIndex = PEFI_FIELDMORNING; + break; + case PEFC_FIELDDAY: + fileIndex = PEFI_FIELDDAY; + break; + case PEFC_FIELDNIGHT: + fileIndex = PEFI_FIELDNIGHT; + break; + case PEFC_FIELDSPECIAL: + fileIndex = PEFI_FIELDSPECIAL; + break; + case PEFC_FIELDSPECIALNATDEX: + fileIndex = PEFI_FIELDSPECIALNATDEX; + break; + } + + encounterLocations->locations = LoadMemberFromNARC_OutFileSize(NARC_INDEX_APPLICATION__ZUKANLIST__ZKN_DATA__ZUKAN_ENC_PLATINUM, fileIndex + species, 0, heapID, 0, &fileSize); + encounterLocations->numLocations = fileSize / sizeof(int); +} + +void PokedexEncData_FreeEncounterLocations(EncounterLocations *encounterLocations) +{ + GF_ASSERT(encounterLocations); + GF_ASSERT(encounterLocations->locations); + + Heap_FreeToHeap(encounterLocations->locations); + + encounterLocations->locations = NULL; + encounterLocations->numLocations = 0; +} + +DungeonCoordinates *PokedexEncData_GetDungeonCoordinates(int heapID, int *numDungeons) +{ + u32 fileSize; + + DungeonCoordinates *dungeonCoordinatesArray = LoadMemberFromNARC_OutFileSize(NARC_INDEX_APPLICATION__ZUKANLIST__ZKN_DATA__ZUKAN_ENC_PLATINUM, 0, 0, heapID, 0, &fileSize); + + if (numDungeons) { + *numDungeons = fileSize / sizeof(DungeonCoordinates); + } + + return dungeonCoordinatesArray; +} + +FieldCoordinates *PokedexEncData_GetFieldCoordinates(int heapID, int *numFields) +{ + u32 fileSize; + + FieldCoordinates *fieldCoordinatesArray = LoadMemberFromNARC_OutFileSize(NARC_INDEX_APPLICATION__ZUKANLIST__ZKN_DATA__ZUKAN_ENC_PLATINUM, 2, 0, heapID, 0, &fileSize); + + if (numFields) { + *numFields = fileSize / sizeof(FieldCoordinates); + } + + return fieldCoordinatesArray; +} + +void PokedexEncData_LocateFieldOnMap(u8 *pokedexFieldMap, u8 mapHeight, u8 mapWidth, const FieldCoordinates *fieldCoordinates) +{ + GF_ASSERT((fieldCoordinates->x + fieldCoordinates->width) < mapWidth); + GF_ASSERT((fieldCoordinates->y + fieldCoordinates->height) < mapHeight); + + for (int x = fieldCoordinates->x; x < fieldCoordinates->x + fieldCoordinates->width; x++) { + for (int y = fieldCoordinates->y; y < fieldCoordinates->y + fieldCoordinates->height; y++) { + pokedexFieldMap[(x * mapHeight) + y] |= fieldCoordinates->cellMatrix[((x - fieldCoordinates->x) * fieldCoordinates->height) + (y - fieldCoordinates->y)]; + } + } +} + +u32 PokedexEncData_LocateVisibleFields(u8 *pokedexFieldMap, int mapHeight, int mapWidth, const FieldCoordinates *fieldCoordinatesArray, const EncounterLocations *encounterLocations, const u8 *invisibleFields, u32 numInvisibleFields) +{ + int locationIndex; + int skipIndex; + u32 numVisibleFields = 0; + + for (locationIndex = 0; locationIndex < encounterLocations->numLocations - 1; locationIndex++) { + GF_ASSERT(encounterLocations->locations[locationIndex]); + + for (skipIndex = 0; skipIndex < numInvisibleFields; skipIndex++) { + if (encounterLocations->locations[locationIndex] == invisibleFields[skipIndex]) { + break; + } + } + + if (skipIndex >= numInvisibleFields) { + PokedexEncData_LocateFieldOnMap(pokedexFieldMap, mapHeight, mapWidth, &fieldCoordinatesArray[encounterLocations->locations[locationIndex]]); + numVisibleFields++; + } + } + + return numVisibleFields; +} + +void PokedexEncData_LocateDungeonOnMap(CellActor *cellActor, int xOffset, int yOffset, int xScale, int yScale, const DungeonCoordinates *dungeonCoordinates, int animID, int coronetAnimID) +{ + VecFx32 position; + + position.x = (dungeonCoordinates->x * xScale) + xOffset; + position.y = (dungeonCoordinates->y * yScale) + yOffset; + position.x <<= FX32_SHIFT; + position.y <<= FX32_SHIFT; + + CellActor_SetPosition(cellActor, &position); + + if (dungeonCoordinates->isMtCoronet) { + CellActor_SetAnim(cellActor, coronetAnimID); + } else { + CellActor_SetAnim(cellActor, animID); + } +} + +int PokedexEncData_LocateVisibleDungeons(CellActor **cellActorArray, int initialNumVisibleDungeons, int maxNumDungeons, int xOffset, int yOffset, int xScale, int yScale, const DungeonCoordinates *dungeonCoordinatesArray, const EncounterLocations *encounterLocations, int animID, int coronetAnimID, const u8 *invisibleDungeons, u32 numInvisibleDungeons, u32 *cellActorsModified) +{ + int locationIndex, skipIndex; + int numVisibleDungeons = initialNumVisibleDungeons; + int DungeonCount = 0; + + for (locationIndex = 0; locationIndex < encounterLocations->numLocations - 1; locationIndex++) { + GF_ASSERT(encounterLocations->locations[locationIndex]); + GF_ASSERT(numVisibleDungeons < maxNumDungeons); + + for (skipIndex = 0; skipIndex < numInvisibleDungeons; skipIndex++) { + if (encounterLocations->locations[locationIndex] == invisibleDungeons[skipIndex]) { + break; + } + } + + if (skipIndex >= numInvisibleDungeons) { + PokedexEncData_LocateDungeonOnMap(cellActorArray[numVisibleDungeons], xOffset, yOffset, xScale, yScale, &dungeonCoordinatesArray[encounterLocations->locations[locationIndex]], animID, coronetAnimID); + numVisibleDungeons++; + DungeonCount++; + } + } + + *cellActorsModified = DungeonCount; + + return numVisibleDungeons; +} diff --git a/src/overlay021/pokedex_field_map.c b/src/overlay021/pokedex_field_map.c new file mode 100644 index 0000000000..8ef6fe7389 --- /dev/null +++ b/src/overlay021/pokedex_field_map.c @@ -0,0 +1,279 @@ +#include "overlay021/pokedex_field_map.h" + +#include +#include + +#include "bg_window.h" + +enum FieldNeighbors { + FN_ALONE = 0, + FN_WEST = (1 << 0), + FN_EAST = (1 << 1), + FN_SOUTH = (1 << 2), + FN_NORTH = (1 << 3), + FN_SOUTHWEST = (1 << 4), + FN_NORTHWEST = (1 << 5), + FN_SOUTHEAST = (1 << 6), + FN_NORTHEAST = (1 << 7), +}; + +static void DisplayOnWindow(Window *window, u8 *src, u16 fieldWidth, u16 fieldHeight, int mapSize, int fieldType, u8 y, u8 x); +static void PopulateMapAtXY(u8 *pokedexFieldMap, int y, int x, int mapHeight, int mapWidth); +static int XYToValue(u8 *pokedexFieldMap, int y, int x, int mapHeight, int mapWidth); +static void FindNeighboringFields(u8 *pokedexFieldMap, int *neighbors, int y, int x, int mapHeight, int mapWidth); +static int GetNeighborType(int neighbors); + +void PokedexFieldMap_DisplayFields(Window *window, u8 *src, u16 fieldWidth, u16 fieldHeight, u8 mapSize, u8 *pokedexFieldMap, u8 mapHeight, u8 mapWidth, u16 yOffset, u16 xOffset) +{ + for (int x = 0; x < mapWidth; x++) { + for (int y = 0; y < mapHeight; y++) { + DisplayOnWindow(window, src, fieldWidth, fieldHeight, mapSize, pokedexFieldMap[(x * mapWidth) + y], yOffset + (y * mapSize), xOffset + (x * mapSize)); + } + } +} + +void PokedexFieldMap_SmoothFields(u8 *pokedexFieldMap, u8 mapHeight, u8 mapWidth) +{ + for (int x = 0; x < mapWidth; x++) { + for (int y = 0; y < mapHeight; y++) { + PopulateMapAtXY(pokedexFieldMap, y, x, mapHeight, mapWidth); + } + } +} + +static void DisplayOnWindow(Window *window, u8 *src, u16 fieldWidth, u16 fieldHeight, int mapSize, int fieldType, u8 y, u8 x) +{ + if (fieldType != 0) { + int srcX = fieldType * mapSize; + int srcY = srcX / fieldWidth; + srcX = srcX % fieldWidth; + + Window_BlitBitmapRect(window, src, srcX, srcY, fieldWidth, fieldHeight, y, x, mapSize, mapSize); + } +} + +static void PopulateMapAtXY(u8 *pokedexFieldMap, int y, int x, int mapHeight, int mapWidth) +{ + int neighbors; + int fieldType; + + if (pokedexFieldMap[(x * mapHeight) + y] == 0) { + FindNeighboringFields(pokedexFieldMap, &neighbors, y, x, mapHeight, mapWidth); + + fieldType = GetNeighborType(neighbors); + pokedexFieldMap[(x * mapHeight) + y] = fieldType; + } +} + +static int XYToValue(u8 *pokedexFieldMap, int y, int x, int mapHeight, int mapWidth) +{ + if ((y < 0) || (y >= mapHeight)) { + return -1; + } + + if ((x < 0) || (x >= mapWidth)) { + return -1; + } + + return pokedexFieldMap[(x * mapHeight) + y]; +} + +static void FindNeighboringFields(u8 *pokedexFieldMap, int *neighbors, int y, int x, int mapHeight, int mapWidth) +{ + *neighbors = FN_ALONE; // binary storage of fields (NE)(SE)(NW)(SW)(N)(S)(E)(W) + // only records intercardinal directions if adjacent cardinals are both empty + + if (XYToValue(pokedexFieldMap, y, x - 1, mapHeight, mapWidth) == 1) { + *neighbors |= FN_WEST; + } + + if (XYToValue(pokedexFieldMap, y, x + 1, mapHeight, mapWidth) == 1) { + *neighbors |= FN_EAST; + } + + if (XYToValue(pokedexFieldMap, y - 1, x, mapHeight, mapWidth) == 1) { + *neighbors |= FN_SOUTH; + } + + if (XYToValue(pokedexFieldMap, y + 1, x, mapHeight, mapWidth) == 1) { + *neighbors |= FN_NORTH; + } + + if ((*neighbors & FN_WEST) == 0 && (*neighbors & FN_SOUTH) == 0) { + if (XYToValue(pokedexFieldMap, y - 1, x - 1, mapHeight, mapWidth) == 1) { + *neighbors |= FN_SOUTHWEST; + } + } + + if ((*neighbors & FN_WEST) == 0 && (*neighbors & FN_NORTH) == 0) { + if (XYToValue(pokedexFieldMap, y + 1, x - 1, mapHeight, mapWidth) == 1) { + *neighbors |= FN_NORTHWEST; + } + } + + if ((*neighbors & FN_EAST) == 0 && (*neighbors & FN_SOUTH) == 0) { + if (XYToValue(pokedexFieldMap, y - 1, x + 1, mapHeight, mapWidth) == 1) { + *neighbors |= FN_SOUTHEAST; + } + } + + if ((*neighbors & FN_EAST) == 0 && (*neighbors & FN_NORTH) == 0) { + if (XYToValue(pokedexFieldMap, y + 1, x + 1, mapHeight, mapWidth) == 1) { + *neighbors |= FN_NORTHEAST; + } + } +} + +static int GetNeighborType(int neighbors) +{ + int fieldType; + + switch (neighbors) { + case FN_ALONE: + fieldType = 0; + break; + case FN_WEST: + fieldType = 2; + break; + case FN_EAST: + fieldType = 3; + break; + case FN_SOUTH: + fieldType = 4; + break; + case FN_NORTH: + fieldType = 5; + break; + case (FN_WEST | FN_EAST): + fieldType = 6; + break; + case (FN_WEST | FN_SOUTH): + fieldType = 7; + break; + case (FN_WEST | FN_NORTH): + fieldType = 8; + break; + case (FN_EAST | FN_SOUTH): + fieldType = 9; + break; + case (FN_EAST | FN_NORTH): + fieldType = 10; + break; + case (FN_SOUTH | FN_NORTH): + fieldType = 11; + break; + case (FN_WEST | FN_EAST | FN_SOUTH): + fieldType = 12; + break; + case (FN_WEST | FN_EAST | FN_NORTH): + fieldType = 13; + break; + case (FN_WEST | FN_SOUTH | FN_NORTH): + fieldType = 14; + break; + case (FN_EAST | FN_SOUTH | FN_NORTH): + fieldType = 15; + break; + case (FN_WEST | FN_EAST | FN_SOUTH | FN_NORTH): + fieldType = 16; + break; + case (FN_SOUTHWEST): + fieldType = 17; + break; + case (FN_NORTHWEST): + fieldType = 18; + break; + case (FN_SOUTHEAST): + fieldType = 19; + break; + case (FN_NORTHEAST): + fieldType = 20; + break; + case (FN_SOUTHWEST | FN_NORTHWEST): + fieldType = 21; + break; + case (FN_SOUTHWEST | FN_SOUTHEAST): + fieldType = 22; + break; + case (FN_SOUTHWEST | FN_NORTHEAST): + fieldType = 23; + break; + case (FN_NORTHWEST | FN_SOUTHEAST): + fieldType = 24; + break; + case (FN_NORTHWEST | FN_NORTHEAST): + fieldType = 25; + break; + case (FN_SOUTHEAST | FN_NORTHEAST): + fieldType = 26; + break; + case (FN_SOUTHWEST | FN_NORTHWEST | FN_SOUTHEAST): + fieldType = 27; + break; + case (FN_SOUTHWEST | FN_NORTHWEST | FN_NORTHEAST): + fieldType = 28; + break; + case (FN_SOUTHWEST | FN_SOUTHEAST | FN_NORTHEAST): + fieldType = 29; + break; + case (FN_NORTHWEST | FN_SOUTHEAST | FN_NORTHEAST): + fieldType = 30; + break; + case (FN_SOUTHWEST | FN_NORTHWEST | FN_SOUTHEAST | FN_NORTHEAST): + fieldType = 31; + break; + case (FN_WEST | FN_SOUTHEAST | FN_NORTHEAST): + fieldType = 32; + break; + case (FN_EAST | FN_SOUTHWEST | FN_NORTHWEST): + fieldType = 33; + break; + case (FN_SOUTH | FN_NORTHWEST | FN_NORTHEAST): + fieldType = 34; + break; + case (FN_NORTH | FN_SOUTHWEST | FN_SOUTHEAST): + fieldType = 35; + break; + case (FN_WEST | FN_SOUTH | FN_NORTHEAST): + fieldType = 36; + break; + case (FN_WEST | FN_NORTH | FN_SOUTHEAST): + fieldType = 37; + break; + case (FN_EAST | FN_SOUTH | FN_NORTHWEST): + fieldType = 38; + break; + case (FN_EAST | FN_NORTH | FN_SOUTHWEST): + fieldType = 39; + break; + case (FN_WEST | FN_SOUTHEAST): + fieldType = 40; + break; + case (FN_WEST | FN_NORTHEAST): + fieldType = 41; + break; + case (FN_EAST | FN_SOUTHWEST): + fieldType = 42; + break; + case (FN_EAST | FN_NORTHWEST): + fieldType = 43; + break; + case (FN_SOUTH | FN_NORTHWEST): + fieldType = 44; + break; + case (FN_SOUTH | FN_NORTHEAST): + fieldType = 45; + break; + case (FN_NORTH | FN_SOUTHWEST): + fieldType = 46; + break; + case (FN_NORTH | FN_SOUTHEAST): + fieldType = 47; + break; + default: + GF_ASSERT(0); + break; + } + + return fieldType; +} diff --git a/src/overlay021/pokedex_sort.c b/src/overlay021/pokedex_sort.c new file mode 100644 index 0000000000..d58848573c --- /dev/null +++ b/src/overlay021/pokedex_sort.c @@ -0,0 +1,993 @@ +#include "overlay021/pokedex_sort.h" + +#include +#include + +#include "struct_decls/pokedexdata_decl.h" + +#include "overlay021/STRUCT_OV21_021D3208.h" +#include "overlay021/sorted_pokedex.h" +#include "overlay021/species_caught_status.h" +#include "overlay021/struct_ov21_021D3320.h" + +#include "core_sys.h" +#include "graphics.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_0202631C.h" + +#define NUMSTATFILES 11 +#define BLANKSPACE (NATIONAL_DEX_COUNT + 1) + +enum PokedexDataSortIndex { + PDSI_NATIONAL, + PDSI_SINNOH, + PDSI_ALPHABETICAL, + PDSI_HEAVIEST, + PDSI_LIGHTEST, + PDSI_TALLEST, + PDSI_SMALLEST, + PDSI_ABC, + PDSI_DEF, + PDSI_GHI, + PDSI_JKL, + PDSI_MNO, + PDSI_PQR, + PDSI_STU, + PDSI_VWX, + PDSI_YZ, + PDSI_NORMAL, + PDSI_FIGHTING, + PDSI_FLYING, + PDSI_POISON, + PDSI_GROUND, + PDSI_ROCK, + PDSI_BUG, + PDSI_GHOST, + PDSI_STEEL, + PDSI_FIRE, + PDSI_WATER, + PDSI_GRASS, + PDSI_ELECTRIC, + PDSI_PSYCHIC, + PDSI_ICE, + PDSI_DRAGON, + PDSI_DARK, + PDSI_QUADRUPED, + PDSI_BIPEDALTAILLESS, + PDSI_BIPEDALTAILED, + PDSI_SERPENTINE, + PDSI_MULTIWINGED, + PDSI_WINGED, + PDSI_INSECTOID, + PDSI_HEADBASE, + PDSI_HEADARMS, + PDSI_HEADLEGS, + PDSI_TENTACLES, + PDSI_FINS, + PDSI_HEAD, + PDSI_MULTIBODY, + PDSI_NUMSORTS +}; + +static void FilterUnencountered(u16 *encounteredDex, int *caughtStatusLength, const PokedexData *dexData, const u16 *fullDex, int pokedexLength); +static void IntersectPokedexes(u16 *resultingPokedex, int *numResulting, const u16 *pokedex1, int dexLen1, const u16 *pokedex2, int dexLen2, BOOL keepUncaught, const PokedexData *dexData); +static void UpdateCaughtStatus(SortedPokedex *sortedPokedex, const PokedexData *dexData, const u16 *encounteredPokedex, int caughtStatusLength); +static void PopulateDisplayPokedex_Blanks(SortedPokedex *sortedPokedex, const u16 *fullDex, int pokedexLength); +static void PopulateDisplayPokedex(SortedPokedex *sortedPokedex); +static void NumEncounteredAndCaught(SortedPokedex *sortedPokedex, int *caughtStatusLength, int *numCaught); +static u16 *PokedexFromNARC(int heapID, int pokedexSort, int *pokedexLength); +static void DexSortOrder(int sortOrder, u16 *resultingPokedex, int *numResulting, const u16 *encounteredPokedex, int caughtStatusLength, int heapID, const PokedexData *dexData); +static void FilterByName(int filterName, u16 *resultingPokedex, int *numResulting, const u16 *encounteredPokedex, int caughtStatusLength, int heapID, const PokedexData *dexData); +static void FilterByType(int typeFilter, u16 *resultingPokedex, int *numResulting, const u16 *encounteredPokedex, int caughtStatusLength, int heapID, const PokedexData *dexData); +static void FilterByForm(int filterForm, u16 *resultingPokedex, int *numResulting, const u16 *encounteredPokedex, int caughtStatusLength, int heapID, const PokedexData *dexData); + +void PokedexSort_PopulatePokedexStatus(UnkStruct_ov21_021D3320 *param0, UnkStruct_ov21_021D3208 *param1, int heapID) +{ + int sortOrder; + int filterName; + int filterType1; + int filterType2; + int filterForm; + BOOL dexExists; + u32 isNationalDex; + + memset(param0, 0, sizeof(UnkStruct_ov21_021D3320)); + + param0->dexData = param1->dexData; + param0->timeOfDay = param1->timeOfDay; + + if (Pokedex_IsNationalDexObtained(param0->dexData)) { + param0->isNationalDexUnlocked = TRUE; + } else { + param0->isNationalDexUnlocked = FALSE; + } + + if (param1->unk_20 == 2) { + if (param0->isNationalDexUnlocked) { + isNationalDex = TRUE; + } else { + isNationalDex = FALSE; + } + } else { + isNationalDex = param1->unk_20; + } + + if (isNationalDex == TRUE) { + param0->isNationalDex = TRUE; + sortOrder = SO_NUMERICAL; + filterName = FN_NONE; + filterType1 = FT_NONE; + filterType2 = FT_NONE; + filterForm = FF_NONE; + } else { + param0->isNationalDex = FALSE; + sortOrder = SO_NUMERICAL; + filterName = FN_NONE; + filterType1 = FT_NONE; + filterType2 = FT_NONE; + filterForm = FF_NONE; + } + + dexExists = PokedexSort_SortUnfiltered(param0, sortOrder, filterName, filterType1, filterType2, filterForm, param0->isNationalDex, heapID); + + GF_ASSERT(dexExists); + + PokedexSort_SetCurrentStatusIndexWithSpecies(param0, param1->unk_1C); + ov21_021D3434(param0, param1->unk_1C); + ov21_021D344C(param0, param1->unk_20); + + param0->trainerGameCode = TrainerInfo_GameCode(param1->unk_04); + param0->trainerGender = TrainerInfo_Gender(param1->unk_04); + param0->trainerName = TrainerInfo_NameNewStrbuf(param1->unk_04, heapID); + param0->HWData = Pokedex_HeightWeightData(heapID); + + if (param0->trainerGender == 0) { + Pokedex_HeightWeightData_Load(param0->HWData, 0, heapID); + } else { + Pokedex_HeightWeightData_Load(param0->HWData, 1, heapID); + } + + param0->fullmoonIslandVisible = param1->fullmoonIslandVisible; + param0->newmoonIslandVisible = param1->newmoonIslandVisible; + param0->springPathVisible = param1->springPathVisible; + param0->seabreakPathVisible = param1->seabreakPathVisible; +} + +void PokedexSort_PokedexStatusFreeHWData(UnkStruct_ov21_021D3320 *param0) +{ + Strbuf_Free(param0->trainerName); + Pokedex_HeightWeightData_Release(param0->HWData); + Pokedex_HeightWeightData_Free(param0->HWData); + + param0->HWData = NULL; +} + +u32 ov21_021D334C(const UnkStruct_ov21_021D3320 *param0, int param1, int param2) +{ + u32 v0; + + v0 = sub_02027058(param0->dexData, param1, param2); + return v0; +} + +u32 ov21_021D335C(const UnkStruct_ov21_021D3320 *param0, int param1) +{ + int v0; + + GF_ASSERT(param1 < 28); + v0 = sub_020270AC(param0->dexData, param1); + + return v0; +} + +u32 ov21_021D3374(const UnkStruct_ov21_021D3320 *param0, int param1) +{ + u32 v0; + + GF_ASSERT(param1 < 2); + v0 = sub_020270F8(param0->dexData, param1); + + return v0; +} + +u32 ov21_021D338C(const UnkStruct_ov21_021D3320 *param0, int param1) +{ + u32 v0; + + GF_ASSERT(param1 < 2); + + v0 = sub_02027154(param0->dexData, param1); + return v0; +} + +u32 ov21_021D33A4(const UnkStruct_ov21_021D3320 *param0, int param1) +{ + u32 v0; + + GF_ASSERT(param1 < 3); + + v0 = sub_020271B0(param0->dexData, param1); + return v0; +} + +u32 ov21_021D33BC(const UnkStruct_ov21_021D3320 *param0, int param1) +{ + u32 v0; + + GF_ASSERT(param1 < 3); + + v0 = sub_02027208(param0->dexData, param1); + return v0; +} + +u32 ov21_021D33D4(const UnkStruct_ov21_021D3320 *param0, u32 species) +{ + return sub_0202756C(param0->dexData, species, 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->dexData, 0); +} + +u32 ov21_021D3404(const UnkStruct_ov21_021D3320 *param0, int param1) +{ + return sub_02027264(param0->dexData, param1); +} + +u32 ov21_021D3410(const UnkStruct_ov21_021D3320 *param0, u32 param1, int param2) +{ + return sub_0202756C(param0->dexData, param1, param2); +} + +u32 ov21_021D341C(const UnkStruct_ov21_021D3320 *param0, u32 param1) +{ + return sub_020276C8(param0->dexData, param1); +} + +BOOL PokedexSort_IsNationalUnlocked(const UnkStruct_ov21_021D3320 *param0) +{ + return Pokedex_IsNationalDexObtained(param0->dexData); +} + +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 PokedexSort_Sort(UnkStruct_ov21_021D3320 *param0, int sortOrder, int filterName, int filterType1, int filterType2, int filterForm, int isNationalDex, int heapID, BOOL isFiltered) +{ + u16 *encounteredPokedex; + int caughtStatusLength; + u16 *resultingPokedex; + int numResulting; + u16 *fullDex; + int fullDexLength; + BOOL dexExists; + + encounteredPokedex = Heap_AllocFromHeapAtEnd(heapID, sizeof(u16) * NATIONAL_DEX_COUNT); + + GF_ASSERT(encounteredPokedex); + memset(encounteredPokedex, 0, sizeof(u16) * NATIONAL_DEX_COUNT); + + caughtStatusLength = 0; + resultingPokedex = Heap_AllocFromHeapAtEnd(heapID, sizeof(u16) * NATIONAL_DEX_COUNT); + + GF_ASSERT(resultingPokedex); + memset(resultingPokedex, 0, sizeof(u16) * NATIONAL_DEX_COUNT); + + numResulting = 0; + + if (isNationalDex == FALSE) { + fullDex = PokedexFromNARC(heapID, PDSI_SINNOH, &fullDexLength); + FilterUnencountered(encounteredPokedex, &caughtStatusLength, param0->dexData, fullDex, fullDexLength); + } else { + fullDex = PokedexFromNARC(heapID, PDSI_NATIONAL, &fullDexLength); + FilterUnencountered(encounteredPokedex, &caughtStatusLength, param0->dexData, fullDex, fullDexLength); + } + + DexSortOrder(sortOrder, resultingPokedex, &numResulting, encounteredPokedex, caughtStatusLength, heapID, param0->dexData); + + memcpy(encounteredPokedex, resultingPokedex, sizeof(u16) * numResulting); + caughtStatusLength = numResulting; + + memset(resultingPokedex, 0, sizeof(u16) * numResulting); + numResulting = 0; + + do { + FilterByName(filterName, resultingPokedex, &numResulting, encounteredPokedex, caughtStatusLength, heapID, param0->dexData); + + if (numResulting == 0) { + dexExists = FALSE; + break; + } + + memcpy(encounteredPokedex, resultingPokedex, sizeof(u16) * numResulting); + caughtStatusLength = numResulting; + + memset(resultingPokedex, 0, sizeof(u16) * numResulting); + numResulting = 0; + + FilterByType(filterType1, resultingPokedex, &numResulting, encounteredPokedex, caughtStatusLength, heapID, param0->dexData); + + if (numResulting == 0) { + dexExists = FALSE; + break; + } + + memcpy(encounteredPokedex, resultingPokedex, sizeof(u16) * numResulting); + caughtStatusLength = numResulting; + + memset(resultingPokedex, 0, sizeof(u16) * numResulting); + numResulting = 0; + + FilterByType(filterType2, resultingPokedex, &numResulting, encounteredPokedex, caughtStatusLength, heapID, param0->dexData); + + if (numResulting == 0) { + dexExists = FALSE; + break; + } + + memcpy(encounteredPokedex, resultingPokedex, sizeof(u16) * numResulting); + caughtStatusLength = numResulting; + + memset(resultingPokedex, 0, sizeof(u16) * numResulting); + numResulting = 0; + + FilterByForm(filterForm, resultingPokedex, &numResulting, encounteredPokedex, caughtStatusLength, heapID, param0->dexData); + + if (numResulting == 0) { + dexExists = FALSE; + break; + } + + memcpy(encounteredPokedex, resultingPokedex, sizeof(u16) * numResulting); + caughtStatusLength = numResulting; + + memset(resultingPokedex, 0, sizeof(u16) * numResulting); + numResulting = 0; + + UpdateCaughtStatus(¶m0->sortedPokedex, param0->dexData, encounteredPokedex, caughtStatusLength); + + if ((sortOrder != SO_NUMERICAL) || (filterName != FN_NONE) || (filterType1 != FT_NONE) || (filterType2 != FT_NONE) || (filterForm != FF_NONE)) { + isFiltered = TRUE; + } + + if (isFiltered == FALSE) { + PopulateDisplayPokedex_Blanks(¶m0->sortedPokedex, fullDex, fullDexLength); + } else { + PopulateDisplayPokedex(¶m0->sortedPokedex); + } + + dexExists = TRUE; + } while (FALSE); + + NumEncounteredAndCaught(¶m0->sortedPokedex, ¶m0->numEncountered, ¶m0->numCaught); + + Heap_FreeToHeap(encounteredPokedex); + Heap_FreeToHeap(resultingPokedex); + Heap_FreeToHeap(fullDex); + + return dexExists; +} + +BOOL PokedexSort_SortUnfiltered(UnkStruct_ov21_021D3320 *param0, int sortOrder, int filterName, int filterType1, int filterType2, int filterForm, int isNationalDex, int heapID) +{ + return PokedexSort_Sort(param0, sortOrder, filterName, filterType1, filterType2, filterForm, isNationalDex, heapID, FALSE); +} + +BOOL ov21_021D36A4(const UnkStruct_ov21_021D3320 *param0, int param1) +{ + if (param1 == 0) { + return TRUE; + } + + if (param0->isNationalDexUnlocked) { + return TRUE; + } + + return FALSE; +} + +BOOL ov21_021D36C0(UnkStruct_ov21_021D3320 *param0, int param1) +{ + BOOL v0 = ov21_021D36A4(param0, param1); + + if (v0) { + param0->isNationalDex = param1; + } + + return v0; +} + +int PokedexStatus_IsNationalDex(const UnkStruct_ov21_021D3320 *param0) +{ + return param0->isNationalDex; +} + +BOOL PokedexSort_IsValidStatusIndex(const UnkStruct_ov21_021D3320 *param0, int dexIndex) +{ + if (((dexIndex) >= 0) && ((dexIndex) < param0->sortedPokedex.caughtStatusLength)) { + return TRUE; + } + + return FALSE; +} + +BOOL PokedexSort_SetCurrentStatusIndex(UnkStruct_ov21_021D3320 *param0, int statusIndex) +{ + if (PokedexSort_IsValidStatusIndex(param0, statusIndex)) { + param0->sortedPokedex.currentStatusIndex = statusIndex; + return TRUE; + } + + return FALSE; +} + +BOOL PokedexSort_TakeStep_Loop(UnkStruct_ov21_021D3320 *param0, int step) +{ + if (PokedexSort_IsValidStatusIndex(param0, param0->sortedPokedex.currentStatusIndex + step)) { + param0->sortedPokedex.currentStatusIndex += step; + return TRUE; + } + + if (step >= 0) { + param0->sortedPokedex.currentStatusIndex = param0->sortedPokedex.caughtStatusLength - 1; + } else { + param0->sortedPokedex.currentStatusIndex = 0; + } + + return FALSE; +} + +int PokedexSort_CurrentStatusIndex(const UnkStruct_ov21_021D3320 *param0) +{ + return param0->sortedPokedex.currentStatusIndex; +} + +int PokedexSort_CaughtStatusLength(const UnkStruct_ov21_021D3320 *param0) +{ + return param0->sortedPokedex.caughtStatusLength; +} + +int PokedexSort_SpeciesToStatusIndex(const UnkStruct_ov21_021D3320 *param0, u32 species) +{ + int statusIndex; + int caughtStatusLength = PokedexSort_CaughtStatusLength(param0); + int compareSpecies; + + for (statusIndex = 0; statusIndex < caughtStatusLength; statusIndex++) { + compareSpecies = param0->sortedPokedex.caughtStatusArray[statusIndex].species; + + if (compareSpecies == species) { + break; + } + } + + return statusIndex; +} + +BOOL PokedexSort_SetCurrentStatusIndexWithSpecies(UnkStruct_ov21_021D3320 *param0, int species) +{ + u32 caughtStatusLength = PokedexSort_CaughtStatusLength(param0); + u32 statusIndex = PokedexSort_SpeciesToStatusIndex(param0, species); + + if (caughtStatusLength > statusIndex) { + return PokedexSort_SetCurrentStatusIndex(param0, statusIndex); + } + + return FALSE; +} + +int PokedexSort_CurrentSpecies(const UnkStruct_ov21_021D3320 *param0) +{ + return param0->sortedPokedex.caughtStatusArray[param0->sortedPokedex.currentStatusIndex].species; +} + +int PokedexSort_CurrentCaughtStatus(const UnkStruct_ov21_021D3320 *param0) +{ + return param0->sortedPokedex.caughtStatusArray[param0->sortedPokedex.currentStatusIndex].caughtStatus; +} + +const SpeciesCaughtStatus *PokedexSort_StatusIndexToCaughtStatus(const UnkStruct_ov21_021D3320 *param0, int statusIndex) +{ + if (PokedexSort_IsValidStatusIndex(param0, statusIndex)) { + return ¶m0->sortedPokedex.caughtStatusArray[statusIndex]; + } + + return NULL; +} + +BOOL PokedexSort_IsValidDisplayIndex(const UnkStruct_ov21_021D3320 *param0, int displayIndex) +{ + if ((param0->sortedPokedex.numDisplayed > displayIndex) && (displayIndex >= 0)) { + return TRUE; + } + + return FALSE; +} + +BOOL PokedexSort_SetCurrentValues(UnkStruct_ov21_021D3320 *param0, int displayIndex) +{ + if (PokedexSort_IsValidDisplayIndex(param0, displayIndex)) { + param0->sortedPokedex.currentDisplayIndex = displayIndex; + + PokedexSort_SetCurrentStatusIndex(param0, param0->sortedPokedex.displayPokedex[param0->sortedPokedex.currentDisplayIndex]); + return TRUE; + } + + return FALSE; +} + +BOOL PokedexSort_TakeStep(UnkStruct_ov21_021D3320 *param0, int step) +{ + if (PokedexSort_IsValidStep(param0, step)) { + param0->sortedPokedex.currentDisplayIndex += step; + + PokedexSort_SetCurrentStatusIndex(param0, param0->sortedPokedex.displayPokedex[param0->sortedPokedex.currentDisplayIndex]); + return TRUE; + } + + return FALSE; +} + +BOOL PokedexSort_IsValidStep(UnkStruct_ov21_021D3320 *param0, int step) +{ + if (PokedexSort_IsValidDisplayIndex(param0, param0->sortedPokedex.currentDisplayIndex + step)) { + return TRUE; + } + + return FALSE; +} + +int PokedexSort_CurrentDisplayIndex(const UnkStruct_ov21_021D3320 *param0) +{ + return param0->sortedPokedex.currentDisplayIndex; +} + +int PokedexSort_NumDisplayed(const UnkStruct_ov21_021D3320 *param0) +{ + return param0->sortedPokedex.numDisplayed; +} + +int PokedexSort_DisplayIndexToStatusIndex(const UnkStruct_ov21_021D3320 *param0, int displayIndex) +{ + return param0->sortedPokedex.displayPokedex[displayIndex]; +} + +void PokedexSort_UpdateCurrentValues(UnkStruct_ov21_021D3320 *param0) +{ + for (int displayIndex = 0; displayIndex < param0->sortedPokedex.numDisplayed; displayIndex++) { + if (PokedexSort_DisplayIndexToStatusIndex(param0, displayIndex) == PokedexSort_CurrentStatusIndex(param0)) { + PokedexSort_SetCurrentValues(param0, displayIndex); + break; + } + } +} + +int PokedexSort_NumEncountered(const UnkStruct_ov21_021D3320 *param0) +{ + return param0->numEncountered; +} + +int PokedexSort_NumCaught(const UnkStruct_ov21_021D3320 *param0) +{ + return param0->numCaught; +} + +Strbuf *PokedexSort_TrainerName(const UnkStruct_ov21_021D3320 *param0) +{ + return param0->trainerName; +} + +u32 PokedexSort_TrainerGender(const UnkStruct_ov21_021D3320 *param0) +{ + return param0->trainerGender; +} + +BOOL ov21_021D392C(const UnkStruct_ov21_021D3320 *param0, int param1) +{ + int species = PokedexSort_CurrentSpecies(param0); + + if (sub_02027514(param0->dexData) == 0) { + return FALSE; + } + + return sub_020274D0(param0->dexData, species, param1); +} + +BOOL PokedexSort_CanDetectForms(const UnkStruct_ov21_021D3320 *param0) +{ + return Pokedex_CanDetectForms(param0->dexData); +} + +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 FilterUnencountered(u16 *encounteredDex, int *caughtStatusLength, const PokedexData *dexData, const u16 *fullDex, int pokedexLength) +{ + *caughtStatusLength = 0; + + for (int species = 0; species < pokedexLength; species++) { + if (Pokedex_HasSeenSpecies(dexData, fullDex[species])) { + encounteredDex[*caughtStatusLength] = fullDex[species]; + (*caughtStatusLength)++; + } + } +} + +static void IntersectPokedexes(u16 *resultingPokedex, int *numResulting, const u16 *pokedex1, int dexLen1, const u16 *pokedex2, int dexLen2, BOOL keepUncaught, const PokedexData *dexData) +{ + int dexIndex2; + + *numResulting = 0; + + for (int dexIndex1 = 0; dexIndex1 < dexLen1; dexIndex1++) { + for (dexIndex2 = 0; dexIndex2 < dexLen2; dexIndex2++) { + if (pokedex1[dexIndex1] == pokedex2[dexIndex2]) { + if (keepUncaught == TRUE) { + break; + } else { + if (Pokedex_HasCaughtSpecies(dexData, pokedex1[dexIndex1])) { + break; + } + } + } + } + + if (dexIndex2 < dexLen2) { + resultingPokedex[*numResulting] = pokedex1[dexIndex1]; + (*numResulting)++; + } + } +} + +static void UpdateCaughtStatus(SortedPokedex *sortedPokedex, const PokedexData *dexData, const u16 *encounteredPokedex, int caughtStatusLength) +{ + sortedPokedex->caughtStatusLength = 0; + + for (int dexIndex = 0; dexIndex < caughtStatusLength; dexIndex++) { + if (Pokedex_HasCaughtSpecies(dexData, encounteredPokedex[dexIndex])) { + sortedPokedex->caughtStatusArray[sortedPokedex->caughtStatusLength].caughtStatus = CS_CAUGHT; + } else { + sortedPokedex->caughtStatusArray[sortedPokedex->caughtStatusLength].caughtStatus = CS_ENCOUNTERED; + } + + sortedPokedex->caughtStatusArray[sortedPokedex->caughtStatusLength].species = encounteredPokedex[dexIndex]; + sortedPokedex->caughtStatusLength++; + } +} + +static void PopulateDisplayPokedex_Blanks(SortedPokedex *sortedPokedex, const u16 *fullDex, int pokedexLength) +{ + int encounteredIndex = 0; + sortedPokedex->numDisplayed = 0; + + for (int dexIndex = 0; dexIndex < pokedexLength; dexIndex++) { + if (encounteredIndex < sortedPokedex->caughtStatusLength) { + if (sortedPokedex->caughtStatusArray[encounteredIndex].species == fullDex[dexIndex]) { + sortedPokedex->displayPokedex[sortedPokedex->numDisplayed] = encounteredIndex; + encounteredIndex++; + sortedPokedex->numDisplayed++; + } else { + sortedPokedex->displayPokedex[sortedPokedex->numDisplayed] = BLANKSPACE; + sortedPokedex->numDisplayed++; + } + } + } +} + +static void PopulateDisplayPokedex(SortedPokedex *sortedPokedex) +{ + sortedPokedex->numDisplayed = 0; + + for (int encounteredIndex = 0; encounteredIndex < sortedPokedex->caughtStatusLength; encounteredIndex++) { + sortedPokedex->displayPokedex[sortedPokedex->numDisplayed] = encounteredIndex; + sortedPokedex->numDisplayed++; + } +} + +static u16 *PokedexFromNARC(int heapID, int pokedexSort, int *pokedexLength) +{ + u32 pokedexSize; + + GF_ASSERT(PDSI_NUMSORTS > pokedexSort); + + u32 pokedexDataNarcIndex = Pokedex_Data_NARC_Index(); + u16 *pokedexFromFile = LoadMemberFromNARC_OutFileSize(pokedexDataNarcIndex, NUMSTATFILES + pokedexSort, 0, heapID, 0, &pokedexSize); + *pokedexLength = pokedexSize / (sizeof(u16)); + + return pokedexFromFile; +} + +static void DexSortOrder(int sortOrder, u16 *resultingPokedex, int *numResulting, const u16 *encounteredPokedex, int caughtStatusLength, int heapID, const PokedexData *dexData) +{ + u16 *pokedexFromFile; + int pokedexLength; + BOOL keepUncaught = FALSE; + + switch (sortOrder) { + case SO_NUMERICAL: + pokedexFromFile = NULL; + break; + case SO_ALPHABETICAL: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_ALPHABETICAL, &pokedexLength); + keepUncaught = TRUE; + break; + case SO_HEAVIEST: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_HEAVIEST, &pokedexLength); + break; + case SO_LIGHTEST: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_LIGHTEST, &pokedexLength); + break; + case SO_TALLEST: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_TALLEST, &pokedexLength); + break; + case SO_SMALLEST: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_SMALLEST, &pokedexLength); + break; + default: + GF_ASSERT(0); + break; + } + + if (pokedexFromFile != NULL) { + IntersectPokedexes(resultingPokedex, numResulting, pokedexFromFile, pokedexLength, encounteredPokedex, caughtStatusLength, keepUncaught, dexData); + Heap_FreeToHeap(pokedexFromFile); + } else { + memcpy(resultingPokedex, encounteredPokedex, (sizeof(u16)) * caughtStatusLength); + *numResulting = caughtStatusLength; + } +} + +static void FilterByName(int filterName, u16 *resultingPokedex, int *numResulting, const u16 *encounteredPokedex, int caughtStatusLength, int heapID, const PokedexData *dexData) +{ + u16 *pokedexFromFile; + int pokedexLength; + + switch (filterName) { + case FN_NONE: + pokedexFromFile = NULL; + break; + case FN_ABC: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_ABC, &pokedexLength); + break; + case FN_DEF: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_DEF, &pokedexLength); + break; + case FN_GHI: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_GHI, &pokedexLength); + break; + case FN_JKL: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_JKL, &pokedexLength); + break; + case FN_MNO: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_MNO, &pokedexLength); + break; + case FN_PQR: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_PQR, &pokedexLength); + break; + case FN_STU: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_STU, &pokedexLength); + break; + case FN_VWX: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_VWX, &pokedexLength); + break; + case FN_YZ: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_YZ, &pokedexLength); + break; + default: + GF_ASSERT(0); + break; + } + + if (pokedexFromFile != NULL) { + IntersectPokedexes(resultingPokedex, numResulting, encounteredPokedex, caughtStatusLength, pokedexFromFile, pokedexLength, TRUE, dexData); + Heap_FreeToHeap(pokedexFromFile); + } else { + memcpy(resultingPokedex, encounteredPokedex, (sizeof(u16)) * caughtStatusLength); + *numResulting = caughtStatusLength; + } +} + +static void FilterByType(int typeFilter, u16 *resultingPokedex, int *numResulting, const u16 *encounteredPokedex, int caughtStatusLength, int heapID, const PokedexData *dexData) +{ + u16 *pokedexFromFile; + int pokedexLength; + + switch (typeFilter) { + case FT_NONE: + pokedexFromFile = NULL; + break; + case FT_NORMAL: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_NORMAL, &pokedexLength); + break; + case FT_FIGHTING: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_FIGHTING, &pokedexLength); + break; + case FT_FLYING: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_FLYING, &pokedexLength); + break; + case FT_POISON: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_POISON, &pokedexLength); + break; + case FT_GROUND: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_GROUND, &pokedexLength); + break; + case FT_ROCK: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_ROCK, &pokedexLength); + break; + case FT_BUG: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_BUG, &pokedexLength); + break; + case FT_GHOST: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_GHOST, &pokedexLength); + break; + case FT_STEEL: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_STEEL, &pokedexLength); + break; + case FT_FIRE: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_FIRE, &pokedexLength); + break; + case FT_WATER: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_WATER, &pokedexLength); + break; + case FT_GRASS: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_GRASS, &pokedexLength); + break; + case FT_ELECTRIC: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_ELECTRIC, &pokedexLength); + break; + case FT_PSYCHIC: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_PSYCHIC, &pokedexLength); + break; + case FT_ICE: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_ICE, &pokedexLength); + break; + case FT_DRAGON: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_DRAGON, &pokedexLength); + break; + case FT_DARK: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_DARK, &pokedexLength); + break; + default: + GF_ASSERT(0); + break; + } + + if (pokedexFromFile != NULL) { + IntersectPokedexes(resultingPokedex, numResulting, encounteredPokedex, caughtStatusLength, pokedexFromFile, pokedexLength, FALSE, dexData); + Heap_FreeToHeap(pokedexFromFile); + } else { + memcpy(resultingPokedex, encounteredPokedex, (sizeof(u16)) * caughtStatusLength); + *numResulting = caughtStatusLength; + } +} + +static void FilterByForm(int filterForm, u16 *resultingPokedex, int *numResulting, const u16 *encounteredPokedex, int caughtStatusLength, int heapID, const PokedexData *dexData) +{ + u16 *pokedexFromFile; + int pokedexLength; + + switch (filterForm) { + case FF_NONE: + pokedexFromFile = NULL; + break; + case FF_QUADRUPED: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_QUADRUPED, &pokedexLength); + break; + case FF_BIPEDALTAILLESS: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_BIPEDALTAILLESS, &pokedexLength); + break; + case FF_BIPEDALTAILED: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_BIPEDALTAILED, &pokedexLength); + break; + case FF_SERPENTINE: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_SERPENTINE, &pokedexLength); + break; + case FF_MULTIWINGED: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_MULTIWINGED, &pokedexLength); + break; + case FF_WINGED: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_WINGED, &pokedexLength); + break; + case FF_INSECTOID: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_INSECTOID, &pokedexLength); + break; + case FF_HEADBASE: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_HEADBASE, &pokedexLength); + break; + case FF_HEADARMS: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_HEADARMS, &pokedexLength); + break; + case FF_HEADLEGS: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_HEADLEGS, &pokedexLength); + break; + case FF_TENTACLES: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_TENTACLES, &pokedexLength); + break; + case FF_FINS: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_FINS, &pokedexLength); + break; + case FF_HEAD: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_HEAD, &pokedexLength); + break; + case FF_MULTIBODY: + pokedexFromFile = PokedexFromNARC(heapID, PDSI_MULTIBODY, &pokedexLength); + break; + default: + GF_ASSERT(0); + break; + } + + if (pokedexFromFile != NULL) { + IntersectPokedexes(resultingPokedex, numResulting, encounteredPokedex, caughtStatusLength, pokedexFromFile, pokedexLength, TRUE, dexData); + Heap_FreeToHeap(pokedexFromFile); + } else { + memcpy(resultingPokedex, encounteredPokedex, (sizeof(u16)) * caughtStatusLength); + *numResulting = caughtStatusLength; + } +} + +static void NumEncounteredAndCaught(SortedPokedex *sortedPokedex, int *caughtStatusLength, int *numCaught) +{ + *caughtStatusLength = 0; + *numCaught = 0; + + for (int statusIndex = 0; statusIndex < sortedPokedex->caughtStatusLength; statusIndex++) { + if (sortedPokedex->caughtStatusArray[statusIndex].caughtStatus == CS_CAUGHT) { + (*numCaught)++; + } + + (*caughtStatusLength)++; + } +} diff --git a/src/overlay047/ov47_022561C0.c b/src/overlay047/ov47_022561C0.c index 6ec7029867..9ebade8bc5 100644 --- a/src/overlay047/ov47_022561C0.c +++ b/src/overlay047/ov47_022561C0.c @@ -97,7 +97,7 @@ static BOOL ov47_0225621C(UnkStruct_ov47_0225621C *param0, PoketchSystem *poketc VarsFlags *v1 = SaveData_GetVarsFlags(PoketchSystem_GetSaveData(poketchSys)); for (v0 = 0; v0 < 4; v0++) { - param0->unk_04.unk_2C[v0] = sub_0206B1F0(v1, v0); + param0->unk_04.unk_2C[v0] = VarFlags_HiddenLocationsUnlocked(v1, v0); } } diff --git a/src/overlay048/ov48_022561C0.c b/src/overlay048/ov48_022561C0.c index 193dfe27e2..fe94f5edfd 100644 --- a/src/overlay048/ov48_022561C0.c +++ b/src/overlay048/ov48_022561C0.c @@ -355,6 +355,6 @@ static void ov48_022564E0(UnkStruct_ov48_0225621C *param0, PoketchSystem *poketc int v1; for (v1 = 0; v1 < 4; v1++) { - param0->unk_04.unk_94[v1] = sub_0206B1F0(v0, v1); + param0->unk_04.unk_94[v1] = VarFlags_HiddenLocationsUnlocked(v0, v1); } } diff --git a/src/pokedex_heightweight.c b/src/pokedex_heightweight.c index 29ced26ff7..8a27977aa2 100644 --- a/src/pokedex_heightweight.c +++ b/src/pokedex_heightweight.c @@ -84,46 +84,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 f4b243c834..04161869e1 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -6576,7 +6576,7 @@ static BOOL ScrCmd_22B(ScriptContext *ctx) static BOOL ScrCmd_22C(ScriptContext *ctx) { - sub_020274B0(SaveData_Pokedex(ctx->fieldSystem->saveData)); + Pokedex_TurnOnFormDetection(SaveData_Pokedex(ctx->fieldSystem->saveData)); return 0; } diff --git a/src/unk_0202631C.c b/src/unk_0202631C.c index 0cc60f1ced..5468a4f25c 100644 --- a/src/unk_0202631C.c +++ b/src/unk_0202631C.c @@ -110,14 +110,14 @@ 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 *param0, u16 species) { - WriteBit((u8 *)param0->seenPokemon, param1); + WriteBit((u8 *)param0->seenPokemon, species); } -static inline void inline_sub_0202736C_1(PokedexData *param0, u16 param1) +static inline void Write_CaughtSpecies(PokedexData *param0, u16 species) { - WriteBit((u8 *)param0->caughtPokemon, param1); + WriteBit((u8 *)param0->caughtPokemon, species); } static void sub_02026360(PokedexData *param0, u8 param1, u8 param2, u16 param3) @@ -957,19 +957,19 @@ 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 *param0, u16 species, int param2) { CheckPokedexIntegrity(param0); - if (IsSpeciesOutOfBounds(param1)) { + if (IsSpeciesOutOfBounds(species)) { return -1; } - if (!CheckSeenMask(param0, param1)) { + if (!CheckSeenMask(param0, species)) { return -1; } - return sub_02026BAC(param0, param1, param2); + return sub_02026BAC(param0, species, param2); } u32 sub_020270AC(const PokedexData *param0, int param1) @@ -1071,35 +1071,35 @@ u32 sub_02027288(const PokedexData *param0) void sub_020272A4(PokedexData *param0, 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); - if (IsSpeciesOutOfBounds(v0)) { + if (IsSpeciesOutOfBounds(species)) { return; } - if (!CheckSeenMask(param0, v0)) { - inline_0202736C_1(param0, v0, v1); - sub_020263D8(param0, v2, 0, v0); + if (!CheckSeenMask(param0, species)) { + inline_0202736C_1(param0, species, v1); + sub_020263D8(param0, v2, 0, species); } else { - v3 = inline_02026BAC(param0, v0, 0); + v3 = inline_02026BAC(param0, species, 0); if (v3 != v2) { - sub_020263D8(param0, v2, 1, v0); + sub_020263D8(param0, v2, 1, species); } } - sub_02026A60(param0, v0, pokemon); - inline_0202736C(param0, v0); + sub_02026A60(param0, species, pokemon); + Write_SeenSpecies(param0, species); } void sub_0202736C(PokedexData *param0, 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); @@ -1107,26 +1107,26 @@ void sub_0202736C(PokedexData *param0, Pokemon *param1) CheckPokedexIntegrity(param0); - if (IsSpeciesOutOfBounds(v0)) { + if (IsSpeciesOutOfBounds(species)) { return; } - if (!CheckSeenMask(param0, v0)) { - inline_0202736C_1(param0, v0, v2); - sub_020263D8(param0, v3, 0, v0); + if (!CheckSeenMask(param0, species)) { + inline_0202736C_1(param0, species, v2); + sub_020263D8(param0, v3, 0, species); } else { - v4 = inline_02026BAC(param0, v0, 0); + v4 = inline_02026BAC(param0, species, 0); if (v4 != v3) { - sub_020263D8(param0, v3, 1, v0); + sub_020263D8(param0, v3, 1, species); } } - sub_02026A60(param0, v0, param1); - sub_02026B88(param0, v0, v1); + sub_02026A60(param0, species, param1); + sub_02026B88(param0, species, v1); - inline_sub_0202736C_1(param0, v0); - inline_0202736C(param0, v0); + Write_CaughtSpecies(param0, species); + Write_SeenSpecies(param0, species); } void sub_02027454(PokedexData *param0) @@ -1141,30 +1141,30 @@ BOOL Pokedex_IsNationalDexObtained(const PokedexData *pokedex) return pokedex->nationalDexObtained; } -BOOL sub_02027494(const PokedexData *param0) +BOOL Pokedex_CanDetectForms(const PokedexData *param0) { CheckPokedexIntegrity(param0); return param0->canDetectForms; } -void sub_020274B0(PokedexData *param0) +void Pokedex_TurnOnFormDetection(PokedexData *param0) { CheckPokedexIntegrity(param0); param0->canDetectForms = 1; } -BOOL sub_020274D0(const PokedexData *param0, u16 param1, u32 param2) +BOOL sub_020274D0(const PokedexData *param0, u16 species, u32 param2) { - int v0; + int speciesInt; GF_ASSERT(param2 < 8); CheckPokedexIntegrity(param0); - v0 = param1; + speciesInt = species; param2 = sub_020986CC(param2); - return param0->recordedLanguages[v0] & (1 << param2); + return param0->recordedLanguages[speciesInt] & (1 << param2); } void sub_02027508(PokedexData *param0) @@ -1195,54 +1195,54 @@ PokedexData *SaveData_Pokedex(SaveData *saveData) return pokedex; } -u32 sub_0202756C(const PokedexData *param0, int param1, int param2) +u32 sub_0202756C(const PokedexData *param0, int species, int param2) { CheckPokedexIntegrity(param0); - switch (param1) { - case 201: + switch (species) { + case SPECIES_UNOWN: if (param2 < sub_020270DC(param0)) { return sub_020270AC(param0, param2); } break; - case 422: + case SPECIES_SHELLOS: if (param2 < sub_02027130(param0)) { return sub_020270F8(param0, param2); } break; - case 423: + case SPECIES_GASTRODON: if (param2 < sub_0202718C(param0)) { return sub_02027154(param0, param2); } break; - case 412: + case SPECIES_BURMY: if (param2 < sub_020271E8(param0)) { return sub_020271B0(param0, param2); } break; - case 413: + case SPECIES_WORMADAM: if (param2 < sub_02027240(param0)) { return sub_02027208(param0, param2); } break; - case 386: + case SPECIES_DEOXYS: if (param2 < sub_02027288(param0)) { return sub_02027264(param0, param2); } break; - case 492: - if (param2 < sub_02026464(param0, 492)) { - return sub_02026C24(param0, 492, param2); + case SPECIES_SHAYMIN: + if (param2 < sub_02026464(param0, SPECIES_SHAYMIN)) { + return sub_02026C24(param0, 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(param0, SPECIES_GIRATINA)) { + return sub_02026C24(param0, 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(param0, SPECIES_ROTOM)) { + return sub_02026CCC(param0, SPECIES_ROTOM, param2); } break; default: diff --git a/src/unk_0206AFE0.c b/src/unk_0206AFE0.c index 73f2f0cc4e..f44a6041b5 100644 --- a/src/unk_0206AFE0.c +++ b/src/unk_0206AFE0.c @@ -30,7 +30,7 @@ static BOOL sub_0206AFE0(VarsFlags *param0, u16 param1, u16 param2) { u16 *v0 = VarsFlags_GetVarAddress(param0, param1); - if ((param1 < 0x4000) || (param1 > 0x8000)) { + if ((param1 < VARS_START) || (param1 > SPECIAL_VARS_START)) { GF_ASSERT(FALSE); return 0; } @@ -56,28 +56,28 @@ static u16 sub_0206B010(VarsFlags *param0, u16 param1) BOOL sub_0206B024(VarsFlags *param0, u16 param1) { - return sub_0206AFE0(param0, (15 + (((0 + 0x4000) + 32) + 16)), param1); + return sub_0206AFE0(param0, (15 + (((0 + VARS_START) + 32) + 16)), param1); } u16 sub_0206B034(VarsFlags *param0) { - return sub_0206B010(param0, (15 + (((0 + 0x4000) + 32) + 16))); + return sub_0206B010(param0, (15 + (((0 + VARS_START) + 32) + 16))); } BOOL sub_0206B044(VarsFlags *param0, u16 param1) { - return sub_0206AFE0(param0, (0 + (((0 + 0x4000) + 32) + 16)), param1); + return sub_0206AFE0(param0, (0 + (((0 + VARS_START) + 32) + 16)), param1); } u16 sub_0206B054(VarsFlags *param0) { - return sub_0206B010(param0, (0 + (((0 + 0x4000) + 32) + 16))); + return sub_0206B010(param0, (0 + (((0 + VARS_START) + 32) + 16))); } u16 sub_0206B064(VarsFlags *param0) { u16 v0; - u16 v1 = sub_0206B010(param0, (0 + (((0 + 0x4000) + 32) + 16))); + u16 v1 = sub_0206B010(param0, (0 + (((0 + VARS_START) + 32) + 16))); if (v1 == 387) { v0 = 390; @@ -93,7 +93,7 @@ u16 sub_0206B064(VarsFlags *param0) u16 sub_0206B08C(VarsFlags *param0) { u16 v0; - u16 v1 = sub_0206B010(param0, (0 + (((0 + 0x4000) + 32) + 16))); + u16 v1 = sub_0206B010(param0, (0 + (((0 + VARS_START) + 32) + 16))); if (v1 == 387) { v0 = 393; @@ -108,12 +108,12 @@ u16 sub_0206B08C(VarsFlags *param0) u16 sub_0206B0B4(VarsFlags *param0) { - return sub_0206B010(param0, (5 + (((0 + 0x4000) + 32) + 16))); + return sub_0206B010(param0, (5 + (((0 + VARS_START) + 32) + 16))); } BOOL sub_0206B0C4(VarsFlags *param0, u16 param1) { - return sub_0206AFE0(param0, (5 + (((0 + 0x4000) + 32) + 16)), param1); + return sub_0206AFE0(param0, (5 + (((0 + VARS_START) + 32) + 16)), param1); } void VsSeeker_Reset(VarsFlags *param0) @@ -124,22 +124,22 @@ void VsSeeker_Reset(VarsFlags *param0) u16 VsSeeker_GetBattery(VarsFlags *param0) { - return sub_0206B010(param0, (3 + (((0 + 0x4000) + 32) + 16))); + return sub_0206B010(param0, (3 + (((0 + VARS_START) + 32) + 16))); } BOOL VsSeeker_SetBattery(VarsFlags *param0, u16 param1) { - return sub_0206AFE0(param0, (3 + (((0 + 0x4000) + 32) + 16)), param1); + return sub_0206AFE0(param0, (3 + (((0 + VARS_START) + 32) + 16)), param1); } u16 VsSeeker_GetActiveStepCount(VarsFlags *param0) { - return sub_0206B010(param0, (4 + (((0 + 0x4000) + 32) + 16))); + return sub_0206B010(param0, (4 + (((0 + VARS_START) + 32) + 16))); } BOOL VsSeeker_SetActiveStepCount(VarsFlags *param0, u16 param1) { - return sub_0206AFE0(param0, (4 + (((0 + 0x4000) + 32) + 16)), param1); + return sub_0206AFE0(param0, (4 + (((0 + VARS_START) + 32) + 16)), param1); } static int sub_0206B128(int param0) @@ -157,12 +157,12 @@ static int sub_0206B128(int param0) void sub_0206B144(VarsFlags *param0, int param1) { - sub_0206AFE0(param0, (19 + (((0 + 0x4000) + 32) + 16)) + param1, sub_0206B128(param1)); + sub_0206AFE0(param0, (19 + (((0 + VARS_START) + 32) + 16)) + param1, sub_0206B128(param1)); } BOOL sub_0206B16C(VarsFlags *param0, int param1) { - if (sub_0206B010(param0, (19 + (((0 + 0x4000) + 32) + 16)) + param1) == sub_0206B128(param1)) { + if (sub_0206B010(param0, (19 + (((0 + VARS_START) + 32) + 16)) + param1) == sub_0206B128(param1)) { return 1; } else { return 0; @@ -184,17 +184,17 @@ static int sub_0206B194(int param0) void sub_0206B1B0(VarsFlags *param0, int param1) { - sub_0206AFE0(param0, (6 + (((0 + 0x4000) + 32) + 16)) + param1, sub_0206B194(param1)); + sub_0206AFE0(param0, (6 + (((0 + VARS_START) + 32) + 16)) + param1, sub_0206B194(param1)); } void sub_0206B1D8(VarsFlags *param0, int param1) { - sub_0206AFE0(param0, (6 + (((0 + 0x4000) + 32) + 16)) + param1, 0); + sub_0206AFE0(param0, (6 + (((0 + VARS_START) + 32) + 16)) + param1, 0); } -BOOL sub_0206B1F0(VarsFlags *param0, int param1) +BOOL VarFlags_HiddenLocationsUnlocked(VarsFlags *varFlags, int hiddenLocation) { - if (sub_0206B010(param0, (6 + (((0 + 0x4000) + 32) + 16)) + param1) == sub_0206B194(param1)) { + if (sub_0206B010(varFlags, (6 + (((0 + VARS_START) + 32) + 16)) + hiddenLocation) == sub_0206B194(hiddenLocation)) { return 1; } else { return 0; @@ -203,19 +203,19 @@ BOOL sub_0206B1F0(VarsFlags *param0, int param1) BOOL sub_0206B218(VarsFlags *param0) { - return sub_0206AFE0(param0, (10 + (((0 + 0x4000) + 32) + 16)), 0); + return sub_0206AFE0(param0, (10 + (((0 + VARS_START) + 32) + 16)), 0); } u16 sub_0206B228(VarsFlags *param0) { - return sub_0206B010(param0, (10 + (((0 + 0x4000) + 32) + 16))); + return sub_0206B010(param0, (10 + (((0 + VARS_START) + 32) + 16))); } BOOL sub_0206B238(VarsFlags *param0) { u16 v0; - v0 = sub_0206B010(param0, (10 + (((0 + 0x4000) + 32) + 16))); + v0 = sub_0206B010(param0, (10 + (((0 + VARS_START) + 32) + 16))); if (v0 < 10000) { v0++; @@ -223,17 +223,17 @@ BOOL sub_0206B238(VarsFlags *param0) v0 = 10000; } - return sub_0206AFE0(param0, (10 + (((0 + 0x4000) + 32) + 16)), v0); + return sub_0206AFE0(param0, (10 + (((0 + VARS_START) + 32) + 16)), v0); } u16 sub_0206B260(VarsFlags *param0) { - return sub_0206B010(param0, (11 + (((0 + 0x4000) + 32) + 16))); + return sub_0206B010(param0, (11 + (((0 + VARS_START) + 32) + 16))); } BOOL sub_0206B270(VarsFlags *param0, u16 param1) { - return sub_0206AFE0(param0, (11 + (((0 + 0x4000) + 32) + 16)), param1); + return sub_0206AFE0(param0, (11 + (((0 + VARS_START) + 32) + 16)), param1); } void sub_0206B280(VarsFlags *param0, u32 param1) @@ -242,16 +242,16 @@ void sub_0206B280(VarsFlags *param0, u32 param1) v1 = (param1 >> 16) & 0xffff; v0 = param1 & 0xffff; - sub_0206AFE0(param0, (12 + (((0 + 0x4000) + 32) + 16)), v0); - sub_0206AFE0(param0, (12 + (((0 + 0x4000) + 32) + 16)), v1); + sub_0206AFE0(param0, (12 + (((0 + VARS_START) + 32) + 16)), v0); + sub_0206AFE0(param0, (12 + (((0 + VARS_START) + 32) + 16)), v1); } u32 sub_0206B2A4(VarsFlags *param0) { u16 v0, v1; - v0 = sub_0206B010(param0, (12 + (((0 + 0x4000) + 32) + 16))); - v1 = sub_0206B010(param0, (13 + (((0 + 0x4000) + 32) + 16))); + v0 = sub_0206B010(param0, (12 + (((0 + VARS_START) + 32) + 16))); + v1 = sub_0206B010(param0, (13 + (((0 + VARS_START) + 32) + 16))); return (v1 << 16) | v0; } @@ -279,12 +279,12 @@ void sub_0206B2E4(SaveData *param0, u16 param1) u16 sub_0206B314(VarsFlags *param0) { - return sub_0206B010(param0, (17 + (((0 + 0x4000) + 32) + 16))); + return sub_0206B010(param0, (17 + (((0 + VARS_START) + 32) + 16))); } BOOL sub_0206B324(VarsFlags *param0, u16 param1) { - return sub_0206AFE0(param0, (17 + (((0 + 0x4000) + 32) + 16)), param1); + return sub_0206AFE0(param0, (17 + (((0 + VARS_START) + 32) + 16)), param1); } void sub_0206B334(SaveData *param0) @@ -300,46 +300,46 @@ u16 sub_0206B354(VarsFlags *param0) { u16 v0; - v0 = sub_0206B010(param0, (14 + (((0 + 0x4000) + 32) + 16))); + v0 = sub_0206B010(param0, (14 + (((0 + VARS_START) + 32) + 16))); return v0; } BOOL sub_0206B364(VarsFlags *param0, u16 param1) { - return sub_0206AFE0(param0, (14 + (((0 + 0x4000) + 32) + 16)), param1); + return sub_0206AFE0(param0, (14 + (((0 + VARS_START) + 32) + 16)), param1); } u16 sub_0206B374(VarsFlags *param0) { u16 v0; - v0 = sub_0206B010(param0, (25 + (((0 + 0x4000) + 32) + 16))); + v0 = sub_0206B010(param0, (25 + (((0 + VARS_START) + 32) + 16))); return v0; } BOOL sub_0206B384(VarsFlags *param0, u16 param1) { - return sub_0206AFE0(param0, (25 + (((0 + 0x4000) + 32) + 16)), param1); + return sub_0206AFE0(param0, (25 + (((0 + VARS_START) + 32) + 16)), param1); } u16 sub_0206B394(VarsFlags *param0) { u16 v0; - v0 = sub_0206B010(param0, (16 + (((0 + 0x4000) + 32) + 16))); + v0 = sub_0206B010(param0, (16 + (((0 + VARS_START) + 32) + 16))); return v0; } BOOL sub_0206B3A4(VarsFlags *param0, u16 param1) { - return sub_0206AFE0(param0, (16 + (((0 + 0x4000) + 32) + 16)), param1); + return sub_0206AFE0(param0, (16 + (((0 + VARS_START) + 32) + 16)), param1); } BOOL sub_0206B3B4(VarsFlags *param0) { u16 v0; - v0 = sub_0206B010(param0, (18 + (((0 + 0x4000) + 32) + 16))); + v0 = sub_0206B010(param0, (18 + (((0 + VARS_START) + 32) + 16))); if (v0 < 10000) { v0++; @@ -347,67 +347,67 @@ BOOL sub_0206B3B4(VarsFlags *param0) v0 = 10000; } - return sub_0206AFE0(param0, (18 + (((0 + 0x4000) + 32) + 16)), v0); + return sub_0206AFE0(param0, (18 + (((0 + VARS_START) + 32) + 16)), v0); } u16 sub_0206B3DC(VarsFlags *param0) { - return sub_0206B010(param0, (18 + (((0 + 0x4000) + 32) + 16))); + return sub_0206B010(param0, (18 + (((0 + VARS_START) + 32) + 16))); } u16 sub_0206B3EC(VarsFlags *param0) { - return sub_0206B010(param0, (36 + (((0 + 0x4000) + 32) + 16))); + return sub_0206B010(param0, (36 + (((0 + VARS_START) + 32) + 16))); } BOOL sub_0206B3FC(VarsFlags *param0, u16 param1) { - return sub_0206AFE0(param0, (36 + (((0 + 0x4000) + 32) + 16)), param1); + return sub_0206AFE0(param0, (36 + (((0 + VARS_START) + 32) + 16)), param1); } u16 sub_0206B40C(VarsFlags *param0) { - return sub_0206B010(param0, (23 + (((0 + 0x4000) + 32) + 16))); + return sub_0206B010(param0, (23 + (((0 + VARS_START) + 32) + 16))); } BOOL sub_0206B41C(VarsFlags *param0, u16 param1) { - return sub_0206AFE0(param0, (23 + (((0 + 0x4000) + 32) + 16)), param1); + return sub_0206AFE0(param0, (23 + (((0 + VARS_START) + 32) + 16)), param1); } u16 sub_0206B42C(VarsFlags *param0) { - return sub_0206B010(param0, (24 + (((0 + 0x4000) + 32) + 16))); + return sub_0206B010(param0, (24 + (((0 + VARS_START) + 32) + 16))); } BOOL sub_0206B43C(VarsFlags *param0, u16 param1) { - return sub_0206AFE0(param0, (24 + (((0 + 0x4000) + 32) + 16)), param1); + return sub_0206AFE0(param0, (24 + (((0 + VARS_START) + 32) + 16)), param1); } u16 sub_0206B44C(VarsFlags *param0) { - return sub_0206B010(param0, (26 + (((0 + 0x4000) + 32) + 16))); + return sub_0206B010(param0, (26 + (((0 + VARS_START) + 32) + 16))); } void sub_0206B45C(VarsFlags *param0, u16 param1) { - sub_0206AFE0(param0, (26 + (((0 + 0x4000) + 32) + 16)), param1); + sub_0206AFE0(param0, (26 + (((0 + VARS_START) + 32) + 16)), param1); } void sub_0206B46C(VarsFlags *param0, u16 param1) { - sub_0206AFE0(param0, (27 + (((0 + 0x4000) + 32) + 16)), param1); + sub_0206AFE0(param0, (27 + (((0 + VARS_START) + 32) + 16)), param1); } u16 sub_0206B47C(VarsFlags *param0) { - return sub_0206B010(param0, (27 + (((0 + 0x4000) + 32) + 16))); + return sub_0206B010(param0, (27 + (((0 + VARS_START) + 32) + 16))); } void sub_0206B48C(VarsFlags *param0, u16 param1) { - sub_0206AFE0(param0, (29 + (((0 + 0x4000) + 32) + 16)), (param1 + 1)); + sub_0206AFE0(param0, (29 + (((0 + VARS_START) + 32) + 16)), (param1 + 1)); } static const u8 Unk_020EFA70[] = { @@ -471,88 +471,88 @@ void sub_0206B514(SaveData *param0) void sub_0206B558(VarsFlags *param0, u16 param1) { - sub_0206AFE0(param0, (30 + (((0 + 0x4000) + 32) + 16)), param1); - sub_0206AFE0(param0, (42 + (((0 + 0x4000) + 32) + 16)), (LCRNG_Next() % 5)); + sub_0206AFE0(param0, (30 + (((0 + VARS_START) + 32) + 16)), param1); + sub_0206AFE0(param0, (42 + (((0 + VARS_START) + 32) + 16)), (LCRNG_Next() % 5)); } u16 sub_0206B588(VarsFlags *param0) { - return sub_0206B010(param0, (32 + (((0 + 0x4000) + 32) + 16))); + return sub_0206B010(param0, (32 + (((0 + VARS_START) + 32) + 16))); } u16 sub_0206B598(VarsFlags *param0) { - return sub_0206B010(param0, (33 + (((0 + 0x4000) + 32) + 16))); + return sub_0206B010(param0, (33 + (((0 + VARS_START) + 32) + 16))); } u16 sub_0206B5A8(VarsFlags *param0) { - return sub_0206B010(param0, (34 + (((0 + 0x4000) + 32) + 16))); + return sub_0206B010(param0, (34 + (((0 + VARS_START) + 32) + 16))); } u16 sub_0206B5B8(VarsFlags *param0) { - return sub_0206B010(param0, (35 + (((0 + 0x4000) + 32) + 16))); + return sub_0206B010(param0, (35 + (((0 + VARS_START) + 32) + 16))); } u16 sub_0206B5C8(VarsFlags *param0) { - return sub_0206B010(param0, (31 + (((0 + 0x4000) + 32) + 16))); + return sub_0206B010(param0, (31 + (((0 + VARS_START) + 32) + 16))); } u16 sub_0206B5D8(VarsFlags *param0) { - return sub_0206B010(param0, (37 + (((0 + 0x4000) + 32) + 16))); + return sub_0206B010(param0, (37 + (((0 + VARS_START) + 32) + 16))); } void sub_0206B5E8(VarsFlags *param0, u16 param1) { - sub_0206AFE0(param0, (37 + (((0 + 0x4000) + 32) + 16)), param1); + sub_0206AFE0(param0, (37 + (((0 + VARS_START) + 32) + 16)), param1); } u16 sub_0206B5F8(VarsFlags *param0) { - return sub_0206B010(param0, (38 + (((0 + 0x4000) + 32) + 16))); + return sub_0206B010(param0, (38 + (((0 + VARS_START) + 32) + 16))); } void sub_0206B608(VarsFlags *param0, u16 param1) { - sub_0206AFE0(param0, (38 + (((0 + 0x4000) + 32) + 16)), param1); + sub_0206AFE0(param0, (38 + (((0 + VARS_START) + 32) + 16)), param1); } u16 sub_0206B618(VarsFlags *param0) { - return sub_0206B010(param0, (39 + (((0 + 0x4000) + 32) + 16))); + return sub_0206B010(param0, (39 + (((0 + VARS_START) + 32) + 16))); } void sub_0206B628(VarsFlags *param0, u16 param1) { - sub_0206AFE0(param0, (39 + (((0 + 0x4000) + 32) + 16)), param1); + sub_0206AFE0(param0, (39 + (((0 + VARS_START) + 32) + 16)), param1); } void sub_0206B638(VarsFlags *param0, u16 param1) { - sub_0206AFE0(param0, (40 + (((0 + 0x4000) + 32) + 16)), param1); + sub_0206AFE0(param0, (40 + (((0 + VARS_START) + 32) + 16)), param1); } void sub_0206B648(VarsFlags *param0, u16 param1) { - sub_0206AFE0(param0, (41 + (((0 + 0x4000) + 32) + 16)), param1); + sub_0206AFE0(param0, (41 + (((0 + VARS_START) + 32) + 16)), param1); } void sub_0206B658(VarsFlags *param0, u16 param1) { - sub_0206AFE0(param0, (46 + (((0 + 0x4000) + 32) + 16)), param1); + sub_0206AFE0(param0, (46 + (((0 + VARS_START) + 32) + 16)), param1); } void sub_0206B668(VarsFlags *param0, u16 param1) { - sub_0206AFE0(param0, (47 + (((0 + 0x4000) + 32) + 16)), param1); + sub_0206AFE0(param0, (47 + (((0 + VARS_START) + 32) + 16)), param1); } void sub_0206B678(VarsFlags *param0, u16 param1) { - sub_0206AFE0(param0, (48 + (((0 + 0x4000) + 32) + 16)), param1); + sub_0206AFE0(param0, (48 + (((0 + VARS_START) + 32) + 16)), param1); } void sub_0206B688(VarsFlags *param0, u16 param1, u16 param2) @@ -580,15 +580,15 @@ void sub_0206B688(VarsFlags *param0, u16 param1, u16 param2) u16 sub_0206B6DC(VarsFlags *param0) { - return sub_0206B010(param0, (43 + (((0 + 0x4000) + 32) + 16))); + return sub_0206B010(param0, (43 + (((0 + VARS_START) + 32) + 16))); } void sub_0206B6EC(VarsFlags *param0, u16 param1) { - sub_0206AFE0(param0, (43 + (((0 + 0x4000) + 32) + 16)), param1); + sub_0206AFE0(param0, (43 + (((0 + VARS_START) + 32) + 16)), param1); } u16 sub_0206B6FC(VarsFlags *param0) { - return sub_0206B010(param0, (52 + (((0 + 0x4000) + 32) + 16))); + return sub_0206B010(param0, (52 + (((0 + VARS_START) + 32) + 16))); } diff --git a/src/unk_0206B70C.c b/src/unk_0206B70C.c index 7fbaacea3a..7cf3569566 100644 --- a/src/unk_0206B70C.c +++ b/src/unk_0206B70C.c @@ -136,7 +136,7 @@ void sub_0206B70C(FieldSystem *fieldSystem, UnkStruct_0203D8AC *param1, int para } for (v1 = 0; v1 < 4; v1++) { - if (sub_0206B1F0(v8, v1)) { + if (VarFlags_HiddenLocationsUnlocked(v8, v1)) { param1->unk_13C |= (0x1 << v1); } } diff --git a/tools/scripts/make_pokedex_data.py b/tools/scripts/make_pokedex_data.py index a20c0247d2..8fb75fe5a5 100644 --- a/tools/scripts/make_pokedex_data.py +++ b/tools/scripts/make_pokedex_data.py @@ -25,8 +25,6 @@ argparser.add_argument('-p', '--private-dir', argparser.add_argument('-o', '--output-dir', required=True, help='Path to the output directory (where the NARC will be made)') -argparser.add_argument('pokedex', - help='List of pokemon in the Sinnoh Pokedex') argparser.add_argument('giratina_form', help='String of either giratina_origin or giratina_altered') args = argparser.parse_args() @@ -75,7 +73,7 @@ for i, species in enumerate(PokemonSpecies): if subdir in ['egg', 'bad_egg']: continue - with open(source_dir / '../../../../pokemon' / subdir / 'data.json', 'r', encoding='utf-8') as data_file: + with open(source_dir / subdir / 'data.json', 'r', encoding='utf-8') as data_file: pkdata = json.load(data_file) pkdexdata = pkdata['pokedex_data'] if subdir == 'giratina': @@ -96,17 +94,17 @@ for i, species in enumerate(PokemonSpecies): 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'] @@ -114,9 +112,9 @@ for i, species in enumerate(PokemonSpecies): nameData[i-1] = subdir.replace('porygon2','porygon_z2') # sinnoh dex order -with open(args.pokedex) as data_file: - dex_data = json.load(data_file) - for mon in dex_data: +with open(source_dir / 'sinnoh_pokedex.json') as data_file: + 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') @@ -158,8 +156,10 @@ if args.giratina_form == 'giratina_origin': if args.giratina_form == 'giratina_altered': output_name = 'zukan_data_gira' +numDigits = len(str(NUM_FILES)) + for i in range(NUM_FILES): - target_fname = str(private_dir / output_name) + f'_{i:02}.bin' + target_fname = str(private_dir / output_name) + f'_{i:0{numDigits}}.bin' with open(target_fname, 'wb+') as target_file: target_file.write(binData[i]) diff --git a/tools/scripts/make_pokedex_enc_platinum.py b/tools/scripts/make_pokedex_enc_platinum.py new file mode 100644 index 0000000000..f6c3e28bc7 --- /dev/null +++ b/tools/scripts/make_pokedex_enc_platinum.py @@ -0,0 +1,392 @@ +#!/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 +NUM_MAPS = 183 + +numDigits = len(str(NUM_FILES)) + +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) + f'_{0:0{numDigits}}.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) + f'_{1:0{numDigits}}.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) + f'_{2:0{numDigits}}.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) + f'_{3:0{numDigits}}.bin' +with open(target_fname, 'wb+') as target_file: + target_file.write(binData) + +dungeonMorning = [set() for species in range(NUM_POKEMON)] +dungeonDay = [set() for species in range(NUM_POKEMON)] +dungeonNight = [set() for species in range(NUM_POKEMON)] +dungeonSpecial = [set() for species in range(NUM_POKEMON)] +dungeonSpecialNatDex = [set() for species in range(NUM_POKEMON)] +fieldMorning = [set() for species in range(NUM_POKEMON)] +fieldDay = [set() for species in range(NUM_POKEMON)] +fieldNight = [set() for species in range(NUM_POKEMON)] +fieldSpecial = [set() for species in range(NUM_POKEMON)] +fieldSpecialNatDex = [set() for species in range(NUM_POKEMON)] + +for archiveID in range(NUM_MAPS): + with open(source_dir / f"{archiveID:03}.json", encoding='utf-8') as encounter_file: + encounterData = json.load(encounter_file) + + mapData = encounterData["map_category"] + mapType = mapData["map_type"] + mapNum = mapData["map_number"] + + if (mapType == 'dungeon'): + for i, slot in enumerate(encounterData["land_encounters"]): + species = slot["species"] + dungeonMorning[PokemonSpecies[species].value].add(mapNum) + + if ((i == 2) or (i == 3)): + species = encounterData["morning"][i - 2] + dungeonDay[PokemonSpecies[species].value].add(mapNum) + + species = encounterData["night"][i - 2] + dungeonNight[PokemonSpecies[species].value].add(mapNum) + else: + dungeonDay[PokemonSpecies[species].value].add(mapNum) + dungeonNight[PokemonSpecies[species].value].add(mapNum) + + for slot in encounterData["surf_encounters"]: + species = slot["species"] + dungeonMorning[PokemonSpecies[species].value].add(mapNum) + dungeonDay[PokemonSpecies[species].value].add(mapNum) + dungeonNight[PokemonSpecies[species].value].add(mapNum) + + for slot in encounterData["old_rod_encounters"]: + species = slot["species"] + dungeonMorning[PokemonSpecies[species].value].add(mapNum) + dungeonDay[PokemonSpecies[species].value].add(mapNum) + dungeonNight[PokemonSpecies[species].value].add(mapNum) + + for slot in encounterData["good_rod_encounters"]: + species = slot["species"] + dungeonMorning[PokemonSpecies[species].value].add(mapNum) + dungeonDay[PokemonSpecies[species].value].add(mapNum) + dungeonNight[PokemonSpecies[species].value].add(mapNum) + + for slot in encounterData["super_rod_encounters"]: + species = slot["species"] + dungeonMorning[PokemonSpecies[species].value].add(mapNum) + dungeonDay[PokemonSpecies[species].value].add(mapNum) + dungeonNight[PokemonSpecies[species].value].add(mapNum) + + for species in encounterData["special_encounters"]: + dungeonSpecial[PokemonSpecies[species].value].add(mapNum) + dungeonSpecial[0].add(mapNum) + + for species in encounterData["radar"]: + dungeonSpecialNatDex[PokemonSpecies[species].value].add(mapNum) + for species in encounterData["specialnatdex_encounters"]: + dungeonSpecialNatDex[PokemonSpecies[species].value].add(mapNum) + + if (mapType == 'field'): + for i, slot in enumerate(encounterData["land_encounters"]): + species = slot["species"] + fieldMorning[PokemonSpecies[species].value].add(mapNum) + + if ((i == 2) or (i == 3)): + species = encounterData["morning"][i - 2] + fieldDay[PokemonSpecies[species].value].add(mapNum) + + species = encounterData["night"][i - 2] + fieldNight[PokemonSpecies[species].value].add(mapNum) + else: + fieldDay[PokemonSpecies[species].value].add(mapNum) + fieldNight[PokemonSpecies[species].value].add(mapNum) + + for slot in encounterData["surf_encounters"]: + species = slot["species"] + fieldMorning[PokemonSpecies[species].value].add(mapNum) + fieldDay[PokemonSpecies[species].value].add(mapNum) + fieldNight[PokemonSpecies[species].value].add(mapNum) + + for slot in encounterData["old_rod_encounters"]: + species = slot["species"] + fieldMorning[PokemonSpecies[species].value].add(mapNum) + fieldDay[PokemonSpecies[species].value].add(mapNum) + fieldNight[PokemonSpecies[species].value].add(mapNum) + + for slot in encounterData["good_rod_encounters"]: + species = slot["species"] + fieldMorning[PokemonSpecies[species].value].add(mapNum) + fieldDay[PokemonSpecies[species].value].add(mapNum) + fieldNight[PokemonSpecies[species].value].add(mapNum) + + for slot in encounterData["super_rod_encounters"]: + species = slot["species"] + fieldMorning[PokemonSpecies[species].value].add(mapNum) + fieldDay[PokemonSpecies[species].value].add(mapNum) + fieldNight[PokemonSpecies[species].value].add(mapNum) + + for species in encounterData["special_encounters"]: + fieldSpecial[PokemonSpecies[species].value].add(mapNum) + fieldSpecial[0].add(mapNum) + + for species in encounterData["radar"]: + fieldSpecialNatDex[PokemonSpecies[species].value].add(mapNum) + for species in encounterData["specialnatdex_encounters"]: + fieldSpecialNatDex[PokemonSpecies[species].value].add(mapNum) + +for species in honeyTrees: + dungeonSpecial[PokemonSpecies[species].value].add(21) + dungeonSpecialNatDex[PokemonSpecies[species].value].add(21) + fieldSpecial[PokemonSpecies[species].value].add(50) + fieldSpecialNatDex[PokemonSpecies[species].value].add(50) + +for species in range(NUM_POKEMON): + speciesSets = [dungeonMorning[species], + dungeonDay[species], + dungeonNight[species], + dungeonSpecial[species], + dungeonSpecialNatDex[species], + fieldMorning[species], + fieldDay[species], + fieldNight[species], + fieldSpecial[species], + fieldSpecialNatDex[species]] + + for i, mapSet in enumerate(speciesSets): + binData = bytes() + mapList = list(mapSet) + mapList.sort() + mapList.append(0) + for map in mapList: + binData = binData + map.to_bytes(4, 'little') + + fileNum = 4 + species + NUM_POKEMON * i + target_fname = str(private_dir / output_name) + f'_{fileNum:0{numDigits}}.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 4c29a4c703..2078cc516c 100644 --- a/tools/scripts/make_pokedex_message_banks.py +++ b/tools/scripts/make_pokedex_message_banks.py @@ -21,15 +21,16 @@ args = argparser.parse_args() 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 @@ for i, species in enumerate(PokemonSpecies): 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 @@ for i, species in enumerate(PokemonSpecies): 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.' @@ -150,17 +153,17 @@ fileNumber = [ 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 cd93ead08f..6cc19bc4ec 100644 --- a/tools/scripts/meson.build +++ b/tools/scripts/meson.build @@ -9,4 +9,5 @@ make_pl_growtbl_py = find_program('make_pl_growtbl.py', native: true) 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) \ No newline at end of file +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)