From e4c73dd99925d0d960b37e423db28f1ee4dd8273 Mon Sep 17 00:00:00 2001 From: h2o-DS Date: Sun, 13 Oct 2024 12:19:46 -0400 Subject: [PATCH 01/16] Generate zukan_enc_platinum.narc Named a bunch of variables Created make_pokedex_enc_platinum tool Added pokedex categories to encounter json files Changed wildEncountersArchiveID to decimal --- include/data/map_headers.h | 130 +-- include/overlay021/ov21_021D0D80.h | 28 +- include/overlay021/ov21_021D3208.h | 61 -- include/overlay021/ov21_021D57B4.h | 8 +- include/overlay021/ov21_021DC9BC.h | 2 +- include/overlay021/pokedex_sort.h | 61 ++ include/overlay021/struct_ov21_021D0D80.h | 10 +- include/overlay021/struct_ov21_021D0D80_1.h | 10 +- include/overlay021/struct_ov21_021D3208.h | 12 +- include/overlay021/struct_ov21_021D3320.h | 32 +- include/overlay021/struct_ov21_021D37DC.h | 6 +- include/overlay021/struct_ov21_021D3A60.h | 10 +- include/overlay021/struct_ov21_021D5844.h | 6 +- include/overlay021/struct_ov21_021D5B68.h | 2 +- include/overlay021/struct_ov21_021DE6D4.h | 2 +- include/overlay021/struct_ov21_021E6A68.h | 2 +- include/overlay021/struct_ov21_021E6B20.h | 2 +- include/pokedex_heightweight.h | 12 +- include/unk_0202631C.h | 78 +- platinum.us/main.lsf | 2 +- res/field/encounters/000.json | 10 +- res/field/encounters/001.json | 10 +- res/field/encounters/002.json | 10 +- res/field/encounters/003.json | 10 +- res/field/encounters/004.json | 10 +- res/field/encounters/005.json | 10 +- res/field/encounters/006.json | 10 +- res/field/encounters/007.json | 24 +- res/field/encounters/008.json | 10 +- res/field/encounters/009.json | 24 +- res/field/encounters/010.json | 14 +- res/field/encounters/011.json | 14 +- res/field/encounters/012.json | 14 +- res/field/encounters/013.json | 14 +- res/field/encounters/014.json | 14 +- res/field/encounters/015.json | 14 +- res/field/encounters/016.json | 14 +- res/field/encounters/017.json | 14 +- res/field/encounters/018.json | 14 +- res/field/encounters/019.json | 14 +- res/field/encounters/020.json | 14 +- res/field/encounters/021.json | 14 +- res/field/encounters/022.json | 14 +- res/field/encounters/023.json | 32 +- res/field/encounters/024.json | 32 +- res/field/encounters/025.json | 32 +- res/field/encounters/026.json | 32 +- res/field/encounters/027.json | 32 +- res/field/encounters/028.json | 32 +- res/field/encounters/029.json | 10 +- res/field/encounters/030.json | 10 +- res/field/encounters/031.json | 10 +- res/field/encounters/032.json | 10 +- res/field/encounters/033.json | 10 +- res/field/encounters/034.json | 10 +- res/field/encounters/035.json | 10 +- res/field/encounters/036.json | 10 +- res/field/encounters/037.json | 10 +- res/field/encounters/038.json | 10 +- res/field/encounters/039.json | 10 +- res/field/encounters/040.json | 10 +- res/field/encounters/041.json | 10 +- res/field/encounters/042.json | 10 +- res/field/encounters/043.json | 10 +- res/field/encounters/044.json | 10 +- res/field/encounters/045.json | 10 +- res/field/encounters/046.json | 10 +- res/field/encounters/047.json | 10 +- res/field/encounters/048.json | 10 +- res/field/encounters/049.json | 10 +- res/field/encounters/050.json | 10 +- res/field/encounters/051.json | 10 +- res/field/encounters/052.json | 10 +- res/field/encounters/053.json | 10 +- res/field/encounters/054.json | 10 +- res/field/encounters/055.json | 10 +- res/field/encounters/056.json | 10 +- res/field/encounters/057.json | 10 +- res/field/encounters/058.json | 10 +- res/field/encounters/059.json | 10 +- res/field/encounters/060.json | 10 +- res/field/encounters/061.json | 10 +- res/field/encounters/062.json | 10 +- res/field/encounters/063.json | 10 +- res/field/encounters/064.json | 10 +- res/field/encounters/065.json | 10 +- res/field/encounters/066.json | 10 +- res/field/encounters/067.json | 10 +- res/field/encounters/068.json | 10 +- res/field/encounters/069.json | 10 +- res/field/encounters/070.json | 10 +- res/field/encounters/071.json | 10 +- res/field/encounters/072.json | 10 +- res/field/encounters/073.json | 10 +- res/field/encounters/074.json | 10 +- res/field/encounters/075.json | 10 +- res/field/encounters/076.json | 10 +- res/field/encounters/077.json | 10 +- res/field/encounters/078.json | 10 +- res/field/encounters/079.json | 10 +- res/field/encounters/080.json | 10 +- res/field/encounters/081.json | 10 +- res/field/encounters/082.json | 10 +- res/field/encounters/083.json | 10 +- res/field/encounters/084.json | 10 +- res/field/encounters/085.json | 10 +- res/field/encounters/086.json | 10 +- res/field/encounters/087.json | 10 +- res/field/encounters/088.json | 10 +- res/field/encounters/089.json | 10 +- res/field/encounters/090.json | 10 +- res/field/encounters/091.json | 10 +- res/field/encounters/092.json | 10 +- res/field/encounters/093.json | 10 +- res/field/encounters/094.json | 10 +- res/field/encounters/095.json | 10 +- res/field/encounters/096.json | 10 +- res/field/encounters/097.json | 10 +- res/field/encounters/098.json | 10 +- res/field/encounters/099.json | 10 +- res/field/encounters/100.json | 10 +- res/field/encounters/101.json | 10 +- res/field/encounters/102.json | 10 +- res/field/encounters/103.json | 10 +- res/field/encounters/104.json | 10 +- res/field/encounters/105.json | 10 +- res/field/encounters/106.json | 10 +- res/field/encounters/107.json | 10 +- res/field/encounters/108.json | 10 +- res/field/encounters/109.json | 10 +- res/field/encounters/110.json | 10 +- res/field/encounters/111.json | 10 +- res/field/encounters/112.json | 10 +- res/field/encounters/113.json | 10 +- res/field/encounters/114.json | 10 +- res/field/encounters/115.json | 10 +- res/field/encounters/116.json | 10 +- res/field/encounters/117.json | 27 +- res/field/encounters/118.json | 10 +- res/field/encounters/119.json | 10 +- res/field/encounters/120.json | 10 +- res/field/encounters/121.json | 10 +- res/field/encounters/122.json | 10 +- res/field/encounters/123.json | 10 +- res/field/encounters/124.json | 10 +- res/field/encounters/125.json | 10 +- res/field/encounters/126.json | 10 +- res/field/encounters/127.json | 10 +- res/field/encounters/128.json | 10 +- res/field/encounters/129.json | 10 +- res/field/encounters/130.json | 10 +- res/field/encounters/131.json | 10 +- res/field/encounters/132.json | 10 +- res/field/encounters/133.json | 10 +- res/field/encounters/134.json | 10 +- res/field/encounters/135.json | 10 +- res/field/encounters/136.json | 10 +- res/field/encounters/137.json | 10 +- res/field/encounters/138.json | 10 +- res/field/encounters/139.json | 10 +- res/field/encounters/140.json | 10 +- res/field/encounters/141.json | 10 +- res/field/encounters/142.json | 10 +- res/field/encounters/143.json | 10 +- res/field/encounters/144.json | 10 +- res/field/encounters/145.json | 24 +- res/field/encounters/146.json | 24 +- res/field/encounters/147.json | 24 +- res/field/encounters/148.json | 24 +- res/field/encounters/149.json | 24 +- res/field/encounters/150.json | 24 +- res/field/encounters/151.json | 10 +- res/field/encounters/152.json | 10 +- res/field/encounters/153.json | 10 +- res/field/encounters/154.json | 10 +- res/field/encounters/155.json | 10 +- res/field/encounters/156.json | 24 +- res/field/encounters/157.json | 24 +- res/field/encounters/158.json | 10 +- res/field/encounters/159.json | 24 +- res/field/encounters/160.json | 24 +- res/field/encounters/161.json | 24 +- res/field/encounters/162.json | 24 +- res/field/encounters/163.json | 24 +- res/field/encounters/164.json | 24 +- res/field/encounters/165.json | 10 +- res/field/encounters/166.json | 10 +- res/field/encounters/167.json | 24 +- res/field/encounters/168.json | 10 +- res/field/encounters/169.json | 24 +- res/field/encounters/170.json | 24 +- res/field/encounters/171.json | 10 +- res/field/encounters/172.json | 10 +- res/field/encounters/173.json | 10 +- res/field/encounters/174.json | 10 +- res/field/encounters/175.json | 10 +- res/field/encounters/176.json | 10 +- res/field/encounters/177.json | 10 +- res/field/encounters/178.json | 10 +- res/field/encounters/179.json | 10 +- res/field/encounters/180.json | 10 +- res/field/encounters/181.json | 10 +- res/field/encounters/182.json | 10 +- .../zukanlist/zkn_data/meson.build | 18 +- .../zkn_data/zukan_enc_platinum.narc | Bin 71460 -> 0 bytes src/field_menu.c | 10 +- src/meson.build | 2 +- src/overlay005/ov5_021F77A8.c | 2 +- src/overlay006/ov6_02240C9C.c | 6 +- src/overlay006/ov6_02242984.c | 2 +- src/overlay021/ov21_021D0D80.c | 72 +- src/overlay021/ov21_021D3208.c | 956 ------------------ src/overlay021/ov21_021D3FE0.c | 8 +- src/overlay021/ov21_021D57B4.c | 108 +- src/overlay021/ov21_021D5AEC.c | 93 +- src/overlay021/ov21_021D76B0.c | 26 +- src/overlay021/ov21_021D85B0.c | 18 +- src/overlay021/ov21_021D94BC.c | 26 +- src/overlay021/ov21_021DC9BC.c | 240 ++--- src/overlay021/ov21_021DDD2C.c | 22 +- src/overlay021/ov21_021DE668.c | 50 +- src/overlay021/ov21_021DF734.c | 32 +- src/overlay021/ov21_021E0C68.c | 32 +- src/overlay021/ov21_021E1924.c | 18 +- src/overlay021/ov21_021E29DC.c | 30 +- src/overlay021/ov21_021E3FFC.c | 18 +- src/overlay021/ov21_021E4CA4.c | 34 +- src/overlay021/ov21_021E6014.c | 38 +- src/overlay021/ov21_021E68F4.c | 16 +- src/overlay021/ov21_021E737C.c | 50 +- src/overlay021/ov21_021E8484.c | 16 +- src/overlay021/pokedex_sort.c | 956 ++++++++++++++++++ src/overlay023/ov23_0223E140.c | 2 +- src/overlay023/ov23_022521F0.c | 2 +- src/overlay028/ov28_022561C0.c | 4 +- src/overlay062/ov62_02237D24.c | 4 +- src/overlay062/ov62_02241204.c | 4 +- src/overlay065/ov65_0222DCE0.c | 2 +- src/overlay066/ov66_0222DDF0.c | 2 +- src/overlay094/ov94_022414B8.c | 8 +- src/overlay097/ov97_0222AE60.c | 2 +- src/pokedex_heightweight.c | 24 +- src/scrcmd.c | 6 +- src/unk_0202631C.c | 586 +++++------ src/unk_02046C7C.c | 2 +- src/unk_0204AEE8.c | 2 +- src/unk_020683F4.c | 2 +- src/unk_0206CCB0.c | 28 +- src/unk_0207A274.c | 2 +- src/unk_020998EC.c | 2 +- tools/scripts/make_pokedex_data.py | 14 +- tools/scripts/make_pokedex_enc_platinum.py | 369 +++++++ tools/scripts/make_pokedex_message_banks.py | 59 +- tools/scripts/meson.build | 1 + 254 files changed, 4380 insertions(+), 2419 deletions(-) delete mode 100644 include/overlay021/ov21_021D3208.h create mode 100644 include/overlay021/pokedex_sort.h delete mode 100644 res/prebuilt/application/zukanlist/zkn_data/zukan_enc_platinum.narc delete mode 100644 src/overlay021/ov21_021D3208.c create mode 100644 src/overlay021/pokedex_sort.c create mode 100644 tools/scripts/make_pokedex_enc_platinum.py diff --git a/include/data/map_headers.h b/include/data/map_headers.h index c3bbca900c..c7cf2fae97 100644 --- a/include/data/map_headers.h +++ b/include/data/map_headers.h @@ -731,15 +731,15 @@ static const MapHeader sMapHeaders[] = { .isFlyAllowed = 0x0, }, [MAP_HEADER_CANALAVE_CITY] = { - .unk_00 = 0xF, - .unk_01 = 0x9, - .mapMatrixID = 0x0, + .unk_00 = 15, + .unk_01 = 9, + .mapMatrixID = 0, .scriptsArchiveID = scripts_canalave_city, .initScriptsArchiveID = scripts_init_canalave_city, .msgArchiveID = message_bank_canalave_city, .dayMusicID = 1011, .nightMusicID = 1040, - .wildEncountersArchiveID = 0x0, + .wildEncountersArchiveID = 0, .eventsArchiveID = 32, .mapLabelTextID = 0x7, .mapLabelWindowID = 0x1, @@ -1437,13 +1437,13 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_ETERNA_CITY] = { .unk_00 = 0x8, .unk_01 = 0x2, - .mapMatrixID = 0x0, + .mapMatrixID = 0, .scriptsArchiveID = scripts_eterna_city, .initScriptsArchiveID = scripts_init_eterna_city, .msgArchiveID = message_bank_eterna_city, .dayMusicID = 1013, .nightMusicID = 1042, - .wildEncountersArchiveID = 0x1, + .wildEncountersArchiveID = 1, .eventsArchiveID = 64, .mapLabelTextID = 0x9, .mapLabelWindowID = 0x1, @@ -2647,13 +2647,13 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_PASTORIA_CITY] = { .unk_00 = 0xC, .unk_01 = 0x6, - .mapMatrixID = 0x0, + .mapMatrixID = 0, .scriptsArchiveID = scripts_pastoria_city, .initScriptsArchiveID = scripts_init_pastoria_city, .msgArchiveID = message_bank_pastoria_city, .dayMusicID = 1015, .nightMusicID = 1044, - .wildEncountersArchiveID = 0x2, + .wildEncountersArchiveID = 2, .eventsArchiveID = 119, .mapLabelTextID = 0xB, .mapLabelWindowID = 0x1, @@ -3307,13 +3307,13 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_SUNYSHORE_CITY] = { .unk_00 = 0xD, .unk_01 = 0x7, - .mapMatrixID = 0x0, + .mapMatrixID = 0, .scriptsArchiveID = scripts_sunyshore_city, .initScriptsArchiveID = scripts_init_sunyshore_city, .msgArchiveID = message_bank_sunyshore_city, .dayMusicID = 1017, .nightMusicID = 1046, - .wildEncountersArchiveID = 0x3, + .wildEncountersArchiveID = 3, .eventsArchiveID = 149, .mapLabelTextID = 0xD, .mapLabelWindowID = 0x1, @@ -3791,13 +3791,13 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_POKEMON_LEAGUE] = { .unk_00 = 0xD, .unk_01 = 0xA, - .mapMatrixID = 0x0, + .mapMatrixID = 0, .scriptsArchiveID = scripts_pokemon_league, .initScriptsArchiveID = scripts_init_pokemon_league, .msgArchiveID = message_bank_pokemon_league, .dayMusicID = 1019, .nightMusicID = 1048, - .wildEncountersArchiveID = 0x4, + .wildEncountersArchiveID = 4, .eventsArchiveID = 171, .mapLabelTextID = (0xF), .mapLabelWindowID = 0x1, @@ -4363,13 +4363,13 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_OREBURGH_MINE_B1F] = { .unk_00 = 55, .unk_01 = 0xF, - .mapMatrixID = 0x5, + .mapMatrixID = 5, .scriptsArchiveID = scripts_oreburgh_mine_b1f, .initScriptsArchiveID = scripts_init_oreburgh_mine_b1f, .msgArchiveID = message_bank_oreburgh_mine_b1f, .dayMusicID = 0x433, .nightMusicID = 0x433, - .wildEncountersArchiveID = 0x5, + .wildEncountersArchiveID = 5, .eventsArchiveID = 196, .mapLabelTextID = 46, .mapLabelWindowID = 0x4, @@ -4385,13 +4385,13 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_OREBURGH_MINE_B2F] = { .unk_00 = 55, .unk_01 = 0xF, - .mapMatrixID = 0x6, + .mapMatrixID = 6, .scriptsArchiveID = scripts_oreburgh_mine_b2f, .initScriptsArchiveID = scripts_init_oreburgh_mine_b2f, .msgArchiveID = message_bank_oreburgh_mine_b2f, .dayMusicID = 0x433, .nightMusicID = 0x433, - .wildEncountersArchiveID = 0x6, + .wildEncountersArchiveID = 6, .eventsArchiveID = 197, .mapLabelTextID = 46, .mapLabelWindowID = 0x4, @@ -4407,13 +4407,13 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_VALLEY_WINDWORKS_OUTSIDE] = { .unk_00 = 0x8, .unk_01 = 0x2, - .mapMatrixID = 0x0, + .mapMatrixID = 0, .scriptsArchiveID = scripts_valley_windworks_outside, .initScriptsArchiveID = scripts_init_valley_windworks_outside, .msgArchiveID = message_bank_valley_windworks_outside, .dayMusicID = 1023, .nightMusicID = 1052, - .wildEncountersArchiveID = 0x7, + .wildEncountersArchiveID = 7, .eventsArchiveID = 198, .mapLabelTextID = 47, .mapLabelWindowID = 0x3, @@ -4473,13 +4473,13 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_ETERNA_FOREST] = { .unk_00 = 54, .unk_01 = 0xF, - .mapMatrixID = 0x7, + .mapMatrixID = 7, .scriptsArchiveID = scripts_eterna_forest, .initScriptsArchiveID = scripts_init_eterna_forest, .msgArchiveID = message_bank_eterna_forest, .dayMusicID = 0x427, .nightMusicID = 0x427, - .wildEncountersArchiveID = 0x8, + .wildEncountersArchiveID = 8, .eventsArchiveID = 201, .mapLabelTextID = 48, .mapLabelWindowID = 0x5, @@ -4495,13 +4495,13 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_FUEGO_IRONWORKS_OUTSIDE] = { .unk_00 = 0x8, .unk_01 = 0x2, - .mapMatrixID = 0x0, + .mapMatrixID = 0, .scriptsArchiveID = scripts_fuego_ironworks_outside, .initScriptsArchiveID = scripts_init_fuego_ironworks_outside, .msgArchiveID = message_bank_fuego_ironworks_outside, .dayMusicID = 1023, .nightMusicID = 1052, - .wildEncountersArchiveID = 0x9, + .wildEncountersArchiveID = 9, .eventsArchiveID = 202, .mapLabelTextID = 49, .mapLabelWindowID = 0x3, @@ -4561,13 +4561,13 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_MT_CORONET_1F_SOUTH] = { .unk_00 = 0x45, .unk_01 = 0xF, - .mapMatrixID = 0x9, + .mapMatrixID = 9, .scriptsArchiveID = scripts_mt_coronet_1f_south, .initScriptsArchiveID = scripts_init_mt_coronet_1f_south, .msgArchiveID = message_bank_mt_coronet_1f_south, .dayMusicID = 0x432, .nightMusicID = 0x432, - .wildEncountersArchiveID = 0xA, + .wildEncountersArchiveID = 10, .eventsArchiveID = 204, .mapLabelTextID = 0x32, .mapLabelWindowID = 0x4, @@ -4583,7 +4583,7 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_MT_CORONET_2F] = { .unk_00 = 0x45, .unk_01 = 0xF, - .mapMatrixID = 0xA, + .mapMatrixID = 10, .scriptsArchiveID = scripts_mt_coronet_2f, .initScriptsArchiveID = scripts_init_mt_coronet_2f, .msgArchiveID = message_bank_mt_coronet_2f, @@ -4611,7 +4611,7 @@ static const MapHeader sMapHeaders[] = { .msgArchiveID = message_bank_jubilife_city, .dayMusicID = 0x432, .nightMusicID = 0x432, - .wildEncountersArchiveID = 0xC, + .wildEncountersArchiveID = 12, .eventsArchiveID = 206, .mapLabelTextID = 0x32, .mapLabelWindowID = 0x4, @@ -4627,13 +4627,13 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_MT_CORONET_OUTSIDE_NORTH] = { .unk_00 = 0xE, .unk_01 = 0x8, - .mapMatrixID = 0xC, + .mapMatrixID = 12, .scriptsArchiveID = scripts_empty, .initScriptsArchiveID = scripts_init_empty, .msgArchiveID = message_bank_jubilife_city, .dayMusicID = 1071, .nightMusicID = 1071, - .wildEncountersArchiveID = 0xD, + .wildEncountersArchiveID = 13, .eventsArchiveID = 207, .mapLabelTextID = 0x32, .mapLabelWindowID = 0x4, @@ -4649,13 +4649,13 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_MT_CORONET_OUTSIDE_SOUTH] = { .unk_00 = 0xE, .unk_01 = 0x8, - .mapMatrixID = 0xD, + .mapMatrixID = 13, .scriptsArchiveID = scripts_empty, .initScriptsArchiveID = scripts_init_empty, .msgArchiveID = message_bank_jubilife_city, .dayMusicID = 1071, .nightMusicID = 1071, - .wildEncountersArchiveID = 0xE, + .wildEncountersArchiveID = 14, .eventsArchiveID = 208, .mapLabelTextID = 0x32, .mapLabelWindowID = 0x4, @@ -4671,13 +4671,13 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_MT_CORONET_4F_ROOMS_1_AND_2] = { .unk_00 = 70, .unk_01 = 0xF, - .mapMatrixID = 0xE, + .mapMatrixID = 14, .scriptsArchiveID = scripts_empty, .initScriptsArchiveID = scripts_init_empty, .msgArchiveID = message_bank_jubilife_city, .dayMusicID = 1071, .nightMusicID = 1071, - .wildEncountersArchiveID = 0xF, + .wildEncountersArchiveID = 15, .eventsArchiveID = 209, .mapLabelTextID = 0x32, .mapLabelWindowID = 0x4, @@ -4693,13 +4693,13 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_MT_CORONET_4F_ROOM_3] = { .unk_00 = 70, .unk_01 = 0xF, - .mapMatrixID = 0xF, + .mapMatrixID = 15, .scriptsArchiveID = scripts_empty, .initScriptsArchiveID = scripts_init_empty, .msgArchiveID = message_bank_jubilife_city, .dayMusicID = 1071, .nightMusicID = 1071, - .wildEncountersArchiveID = 0x10, + .wildEncountersArchiveID = 16, .eventsArchiveID = 210, .mapLabelTextID = 0x32, .mapLabelWindowID = 0x4, @@ -4714,14 +4714,14 @@ static const MapHeader sMapHeaders[] = { }, [MAP_HEADER_MT_CORONET_5F] = { .unk_00 = 70, - .unk_01 = 0xF, - .mapMatrixID = 0x10, + .unk_01 = 15, + .mapMatrixID = 16, .scriptsArchiveID = scripts_empty, .initScriptsArchiveID = scripts_init_empty, .msgArchiveID = message_bank_jubilife_city, .dayMusicID = 1071, .nightMusicID = 1071, - .wildEncountersArchiveID = 0x11, + .wildEncountersArchiveID = 17, .eventsArchiveID = 211, .mapLabelTextID = 0x32, .mapLabelWindowID = 0x4, @@ -4737,13 +4737,13 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_MT_CORONET_6F] = { .unk_00 = 70, .unk_01 = 0xF, - .mapMatrixID = 0x11, + .mapMatrixID = 17, .scriptsArchiveID = scripts_mt_coronet_6f, .initScriptsArchiveID = scripts_init_mt_coronet_6f, .msgArchiveID = message_bank_jubilife_city, .dayMusicID = 1071, .nightMusicID = 1071, - .wildEncountersArchiveID = 0x12, + .wildEncountersArchiveID = 18, .eventsArchiveID = 212, .mapLabelTextID = 0x32, .mapLabelWindowID = 0x4, @@ -4759,13 +4759,13 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_MT_CORONET_1F_TUNNEL_ROOM] = { .unk_00 = 0x45, .unk_01 = 0xF, - .mapMatrixID = 0x12, + .mapMatrixID = 18, .scriptsArchiveID = scripts_mt_coronet_1f_tunnel_room, .initScriptsArchiveID = scripts_init_mt_coronet_1f_tunnel_room, .msgArchiveID = message_bank_mt_coronet_1f_tunnel_room, .dayMusicID = 1071, .nightMusicID = 1071, - .wildEncountersArchiveID = 0x13, + .wildEncountersArchiveID = 19, .eventsArchiveID = 213, .mapLabelTextID = 0x32, .mapLabelWindowID = 0x4, @@ -4781,13 +4781,13 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_MT_CORONET_1F_NORTH_ROOM_2] = { .unk_00 = 0x45, .unk_01 = 0xF, - .mapMatrixID = 0x13, + .mapMatrixID = 19, .scriptsArchiveID = scripts_mt_coronet_1f_north_room_2, .initScriptsArchiveID = scripts_init_mt_coronet_1f_north_room_2, .msgArchiveID = message_bank_jubilife_city, .dayMusicID = 0x432, .nightMusicID = 0x432, - .wildEncountersArchiveID = 0x14, + .wildEncountersArchiveID = 20, .eventsArchiveID = 214, .mapLabelTextID = 0x32, .mapLabelWindowID = 0x4, @@ -4803,13 +4803,13 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_MT_CORONET_1F_NORTH_ROOM_1] = { .unk_00 = 0x45, .unk_01 = 0xF, - .mapMatrixID = 0x14, + .mapMatrixID = 20, .scriptsArchiveID = scripts_mt_coronet_1f_north_room_1, .initScriptsArchiveID = scripts_init_mt_coronet_1f_north_room_1, .msgArchiveID = message_bank_mt_coronet_1f_north_room_1, .dayMusicID = 0x432, .nightMusicID = 0x432, - .wildEncountersArchiveID = 0x15, + .wildEncountersArchiveID = 21, .eventsArchiveID = 215, .mapLabelTextID = 0x32, .mapLabelWindowID = 0x4, @@ -4825,13 +4825,13 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_MT_CORONET_B1F] = { .unk_00 = 0x45, .unk_01 = 0xF, - .mapMatrixID = 0x15, + .mapMatrixID = 21, .scriptsArchiveID = scripts_empty, .initScriptsArchiveID = scripts_init_empty, .msgArchiveID = message_bank_jubilife_city, .dayMusicID = 0x432, .nightMusicID = 0x432, - .wildEncountersArchiveID = 0x16, + .wildEncountersArchiveID = 22, .eventsArchiveID = 216, .mapLabelTextID = 0x32, .mapLabelWindowID = 0x4, @@ -4847,7 +4847,7 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_SPEAR_PILLAR] = { .unk_00 = 0x3C, .unk_01 = 0xF, - .mapMatrixID = 0x16, + .mapMatrixID = 22, .scriptsArchiveID = scripts_spear_pillar, .initScriptsArchiveID = scripts_init_spear_pillar, .msgArchiveID = message_bank_spear_pillar, @@ -5029,7 +5029,7 @@ static const MapHeader sMapHeaders[] = { .msgArchiveID = message_bank_jubilife_city, .dayMusicID = 0x427, .nightMusicID = 0x427, - .wildEncountersArchiveID = 0x1F, + .wildEncountersArchiveID = 31, .eventsArchiveID = 223, .mapLabelTextID = 53, .mapLabelWindowID = 0x4, @@ -5799,7 +5799,7 @@ static const MapHeader sMapHeaders[] = { .msgArchiveID = message_bank_stark_mountain_room_1, .dayMusicID = 1073, .nightMusicID = 1073, - .wildEncountersArchiveID = 0x39, + .wildEncountersArchiveID = 57, .eventsArchiveID = 256, .mapLabelTextID = 84, .mapLabelWindowID = 0x4, @@ -6327,7 +6327,7 @@ static const MapHeader sMapHeaders[] = { .msgArchiveID = message_bank_jubilife_city, .dayMusicID = 1025, .nightMusicID = 1054, - .wildEncountersArchiveID = 0x75, + .wildEncountersArchiveID = 117, .eventsArchiveID = 0x114, .mapLabelTextID = 68, .mapLabelWindowID = 0x7, @@ -6459,7 +6459,7 @@ static const MapHeader sMapHeaders[] = { .msgArchiveID = message_bank_iron_island_b2f_left_room, .dayMusicID = 0x433, .nightMusicID = 0x433, - .wildEncountersArchiveID = 0x7B, + .wildEncountersArchiveID = 123, .eventsArchiveID = 0x11A, .mapLabelTextID = 0x45, .mapLabelWindowID = 0x4, @@ -7559,7 +7559,7 @@ static const MapHeader sMapHeaders[] = { .msgArchiveID = message_bank_route_202, .dayMusicID = 1021, .nightMusicID = 1050, - .wildEncountersArchiveID = 0x8D, + .wildEncountersArchiveID = 141, .eventsArchiveID = 329, .mapLabelTextID = 0x11, .mapLabelWindowID = 0x3, @@ -7581,7 +7581,7 @@ static const MapHeader sMapHeaders[] = { .msgArchiveID = message_bank_route_203, .dayMusicID = 1022, .nightMusicID = 1051, - .wildEncountersArchiveID = 0x8E, + .wildEncountersArchiveID = 142, .eventsArchiveID = 330, .mapLabelTextID = 0x12, .mapLabelWindowID = 0x3, @@ -11095,13 +11095,13 @@ static const MapHeader sMapHeaders[] = { [MAP_HEADER_GREAT_MARSH_1] = { .unk_00 = 63, .unk_01 = 0xF, - .mapMatrixID = 0xF0, + .mapMatrixID = 240, .scriptsArchiveID = scripts_great_marsh_1, .initScriptsArchiveID = scripts_init_great_marsh_1, .msgArchiveID = message_bank_great_marsh_1, .dayMusicID = 1069, .nightMusicID = 1069, - .wildEncountersArchiveID = 0x17, + .wildEncountersArchiveID = 23, .eventsArchiveID = 481, .mapLabelTextID = 52, .mapLabelWindowID = 0x5, @@ -11123,7 +11123,7 @@ static const MapHeader sMapHeaders[] = { .msgArchiveID = message_bank_great_marsh_2, .dayMusicID = 1069, .nightMusicID = 1069, - .wildEncountersArchiveID = 0x18, + .wildEncountersArchiveID = 24, .eventsArchiveID = 482, .mapLabelTextID = 52, .mapLabelWindowID = 0x5, @@ -11145,7 +11145,7 @@ static const MapHeader sMapHeaders[] = { .msgArchiveID = message_bank_great_marsh_3, .dayMusicID = 1069, .nightMusicID = 1069, - .wildEncountersArchiveID = 0x19, + .wildEncountersArchiveID = 25, .eventsArchiveID = 483, .mapLabelTextID = 52, .mapLabelWindowID = 0x5, @@ -11167,7 +11167,7 @@ static const MapHeader sMapHeaders[] = { .msgArchiveID = message_bank_great_marsh_4, .dayMusicID = 1069, .nightMusicID = 1069, - .wildEncountersArchiveID = 0x1A, + .wildEncountersArchiveID = 26, .eventsArchiveID = 484, .mapLabelTextID = 52, .mapLabelWindowID = 0x5, @@ -11189,7 +11189,7 @@ static const MapHeader sMapHeaders[] = { .msgArchiveID = message_bank_great_marsh_5, .dayMusicID = 1069, .nightMusicID = 1069, - .wildEncountersArchiveID = 0x1B, + .wildEncountersArchiveID = 27, .eventsArchiveID = 485, .mapLabelTextID = 52, .mapLabelWindowID = 0x5, @@ -11211,7 +11211,7 @@ static const MapHeader sMapHeaders[] = { .msgArchiveID = message_bank_great_marsh_6, .dayMusicID = 1069, .nightMusicID = 1069, - .wildEncountersArchiveID = 0x1C, + .wildEncountersArchiveID = 28, .eventsArchiveID = 486, .mapLabelTextID = 52, .mapLabelWindowID = 0x5, @@ -11299,7 +11299,7 @@ static const MapHeader sMapHeaders[] = { .msgArchiveID = message_bank_maniac_tunnel, .dayMusicID = 0x427, .nightMusicID = 0x427, - .wildEncountersArchiveID = 0x74, + .wildEncountersArchiveID = 116, .eventsArchiveID = 489, .mapLabelTextID = 67, .mapLabelWindowID = 0x4, @@ -11475,7 +11475,7 @@ static const MapHeader sMapHeaders[] = { .msgArchiveID = message_bank_jubilife_city, .dayMusicID = 1064, .nightMusicID = 1064, - .wildEncountersArchiveID = 0x45, + .wildEncountersArchiveID = 69, .eventsArchiveID = 497, .mapLabelTextID = 62, .mapLabelWindowID = 0x4, @@ -11541,7 +11541,7 @@ static const MapHeader sMapHeaders[] = { .msgArchiveID = message_bank_jubilife_city, .dayMusicID = 1064, .nightMusicID = 1064, - .wildEncountersArchiveID = 0x48, + .wildEncountersArchiveID = 72, .eventsArchiveID = 500, .mapLabelTextID = 62, .mapLabelWindowID = 0x4, @@ -11585,7 +11585,7 @@ static const MapHeader sMapHeaders[] = { .msgArchiveID = message_bank_jubilife_city, .dayMusicID = 1064, .nightMusicID = 1064, - .wildEncountersArchiveID = 0x4A, + .wildEncountersArchiveID = 74, .eventsArchiveID = 0x1F6, .mapLabelTextID = 62, .mapLabelWindowID = 0x4, diff --git a/include/overlay021/ov21_021D0D80.h b/include/overlay021/ov21_021D0D80.h index 2e0bf0c5bc..067ccaea33 100644 --- a/include/overlay021/ov21_021D0D80.h +++ b/include/overlay021/ov21_021D0D80.h @@ -44,7 +44,7 @@ int *ov21_021D13A0(UnkStruct_ov21_021D0F60 *param0); int *ov21_021D13B4(UnkStruct_ov21_021D0F60 *param0); int *ov21_021D13C8(UnkStruct_ov21_021D0F60 *param0); BOOL *ov21_021D13DC(UnkStruct_ov21_021D0F60 *param0); -UnkStruct_ov21_021D3320 *ov21_021D13EC(UnkStruct_ov21_021D0F60 *param0); +pokedexStruct *ov21_021D13EC(UnkStruct_ov21_021D0F60 *param0); UnkStruct_ov21_021D13FC *ov21_021D13FC(UnkStruct_ov21_021D0F60 *param0); UnkStruct_ov21_021E68F4 *ov21_021D1410(UnkStruct_ov21_021D0F60 *param0, int param1); UnkStruct_ov21_021E68F4 *ov21_021D1430(UnkStruct_ov21_021D0F60 *param0, int param1); @@ -55,23 +55,23 @@ void ov21_021D154C(TouchScreenHitTable *hitTable, int param1, int param2, int pa void ov21_021D1558(UnkStruct_ov21_021D157C *param0, BGL *param1, int param2, NNSG2dScreenData *param3, int param4, int param5, int param6, int param7, int param8); BOOL ov21_021D157C(UnkStruct_ov21_021D157C *param0); void ov21_021D1650(Window *param0, int param1, int param2, int param3); -Window *ov21_021D16D8(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3); +Window *ov21_021D16D8(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3); Window *ov21_021D170C(UnkStruct_ov21_021D4C0C *param0, int param1, int param2); Window *ov21_021D172C(UnkStruct_ov21_021D4C0C *param0, int param1, int param2); -void ov21_021D1778(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, fx32 param4, fx32 param5); +void ov21_021D1778(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, fx32 param4, fx32 param5); void ov21_021D1848(UnkStruct_ov21_021D13FC *param0, int param1, int param2); void ov21_021D1858(UnkStruct_ov21_021D22F8 *param0, int param1, int param2); -void ov21_021D1890(UnkStruct_ov21_021D13FC *param0, UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5); -u32 ov21_021D19D8(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6, int param7); -u32 ov21_021D1A34(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6); -u32 ov21_021D1A78(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6); -u32 ov21_021D1AC0(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6); -u32 ov21_021D1B08(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6); -u32 ov21_021D1B4C(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6); -u32 ov21_021D1B94(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6); -u32 ov21_021D1BD8(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6); -u32 ov21_021D1C30(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6); -u32 ov21_021D1C88(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6); +void ov21_021D1890(UnkStruct_ov21_021D13FC *param0, pokedexStruct *param1, int param2, int param3, int param4, int param5); +u32 ov21_021D19D8(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6, int param7); +u32 ov21_021D1A34(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6); +u32 ov21_021D1A78(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6); +u32 ov21_021D1AC0(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6); +u32 ov21_021D1B08(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6); +u32 ov21_021D1B4C(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6); +u32 ov21_021D1B94(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6); +u32 ov21_021D1BD8(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6); +u32 ov21_021D1C30(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6); +u32 ov21_021D1C88(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6); Strbuf *ov21_021D1CE0(int param0, int param1); #endif // POKEPLATINUM_OV21_021D0D80_H diff --git a/include/overlay021/ov21_021D3208.h b/include/overlay021/ov21_021D3208.h deleted file mode 100644 index 82f4458056..0000000000 --- a/include/overlay021/ov21_021D3208.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef POKEPLATINUM_OV21_021D3208_H -#define POKEPLATINUM_OV21_021D3208_H - -#include "overlay021/struct_ov21_021D3208.h" -#include "overlay021/struct_ov21_021D3320.h" -#include "overlay021/struct_ov21_021D37DC.h" - -#include "strbuf.h" - -void ov21_021D3208(UnkStruct_ov21_021D3320 *param0, UnkStruct_ov21_021D3208 *param1, int param2); -void ov21_021D3320(UnkStruct_ov21_021D3320 *param0); -u32 ov21_021D334C(const UnkStruct_ov21_021D3320 *param0, int param1, int param2); -u32 ov21_021D335C(const UnkStruct_ov21_021D3320 *param0, int param1); -u32 ov21_021D3374(const UnkStruct_ov21_021D3320 *param0, int param1); -u32 ov21_021D338C(const UnkStruct_ov21_021D3320 *param0, int param1); -u32 ov21_021D33A4(const UnkStruct_ov21_021D3320 *param0, int param1); -u32 ov21_021D33BC(const UnkStruct_ov21_021D3320 *param0, int param1); -u32 ov21_021D33D4(const UnkStruct_ov21_021D3320 *param0, u32 param1); -u32 ov21_021D33E0(const UnkStruct_ov21_021D3320 *param0, int param1); -u32 ov21_021D33F8(const UnkStruct_ov21_021D3320 *param0); -u32 ov21_021D3404(const UnkStruct_ov21_021D3320 *param0, int param1); -u32 ov21_021D3410(const UnkStruct_ov21_021D3320 *param0, u32 param1, int param2); -u32 ov21_021D341C(const UnkStruct_ov21_021D3320 *param0, u32 param1); -BOOL ov21_021D3428(const UnkStruct_ov21_021D3320 *param0); -void ov21_021D3434(UnkStruct_ov21_021D3320 *param0, u32 param1); -u32 ov21_021D3440(const UnkStruct_ov21_021D3320 *param0); -void ov21_021D344C(UnkStruct_ov21_021D3320 *param0, u32 param1); -u32 ov21_021D3458(const UnkStruct_ov21_021D3320 *param0); -BOOL ov21_021D3464(UnkStruct_ov21_021D3320 *param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7, BOOL param8); -BOOL ov21_021D3684(UnkStruct_ov21_021D3320 *param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7); -BOOL ov21_021D36A4(const UnkStruct_ov21_021D3320 *param0, int param1); -BOOL ov21_021D36C0(UnkStruct_ov21_021D3320 *param0, int param1); -int ov21_021D36D8(const UnkStruct_ov21_021D3320 *param0); -BOOL ov21_021D36E4(const UnkStruct_ov21_021D3320 *param0, int param1); -BOOL ov21_021D36FC(UnkStruct_ov21_021D3320 *param0, int param1); -BOOL ov21_021D371C(UnkStruct_ov21_021D3320 *param0, int param1); -int ov21_021D375C(const UnkStruct_ov21_021D3320 *param0); -int ov21_021D3768(const UnkStruct_ov21_021D3320 *param0); -int ov21_021D3770(const UnkStruct_ov21_021D3320 *param0, u32 param1); -BOOL ov21_021D3794(UnkStruct_ov21_021D3320 *param0, int param1); -int ov21_021D37BC(const UnkStruct_ov21_021D3320 *param0); -int ov21_021D37CC(const UnkStruct_ov21_021D3320 *param0); -const UnkStruct_ov21_021D37DC *ov21_021D37DC(const UnkStruct_ov21_021D3320 *param0, int param1); -BOOL ov21_021D37F8(const UnkStruct_ov21_021D3320 *param0, int param1); -BOOL ov21_021D3810(UnkStruct_ov21_021D3320 *param0, int param1); -BOOL ov21_021D3844(UnkStruct_ov21_021D3320 *param0, int param1); -BOOL ov21_021D387C(UnkStruct_ov21_021D3320 *param0, int param1); -int ov21_021D3898(const UnkStruct_ov21_021D3320 *param0); -int ov21_021D38A4(const UnkStruct_ov21_021D3320 *param0); -int ov21_021D38B0(const UnkStruct_ov21_021D3320 *param0, int param1); -void ov21_021D38C0(UnkStruct_ov21_021D3320 *param0); -int ov21_021D38FC(const UnkStruct_ov21_021D3320 *param0); -int ov21_021D3908(const UnkStruct_ov21_021D3320 *param0); -Strbuf *ov21_021D3914(const UnkStruct_ov21_021D3320 *param0); -u32 ov21_021D3920(const UnkStruct_ov21_021D3320 *param0); -BOOL ov21_021D392C(const UnkStruct_ov21_021D3320 *param0, int param1); -BOOL ov21_021D3954(const UnkStruct_ov21_021D3320 *param0); -void ov21_021D3960(UnkStruct_ov21_021D3320 *param0); -u32 ov21_021D3998(const UnkStruct_ov21_021D3320 *param0); - -#endif // POKEPLATINUM_OV21_021D3208_H diff --git a/include/overlay021/ov21_021D57B4.h b/include/overlay021/ov21_021D57B4.h index 63f575c29c..96b8cc26af 100644 --- a/include/overlay021/ov21_021D57B4.h +++ b/include/overlay021/ov21_021D57B4.h @@ -7,13 +7,13 @@ #include "cell_actor.h" -void ov21_021D57B4(UnkStruct_ov21_021D5844 *param0, int param1, int param2, int param3); -void ov21_021D5844(UnkStruct_ov21_021D5844 *param0); +void ov21_021D57B4(pokedexEncStruct *dexEncData, int param1, int param2, int param3); +void Free_pokedexEncData(pokedexEncStruct *dexEncData); UnkStruct_ov21_021D5868 *ov21_021D5868(int param0, int *param1); UnkStruct_ov21_021D5890 *ov21_021D5890(int param0, int *param1); void ov21_021D58C0(u8 *param0, u8 param1, u8 param2, const UnkStruct_ov21_021D5890 *param3); -u32 ov21_021D5948(u8 *param0, int param1, int param2, const UnkStruct_ov21_021D5890 *param3, const UnkStruct_ov21_021D5844 *param4, const u8 *param5, u32 param6); +u32 ov21_021D5948(u8 *param0, int param1, int param2, const UnkStruct_ov21_021D5890 *param3, const pokedexEncStruct *dexEncData, const u8 *param5, u32 param6); void ov21_021D59D8(CellActor *param0, int param1, int param2, int param3, int param4, const UnkStruct_ov21_021D5868 *param5, int param6, int param7); -int ov21_021D5A20(CellActor **param0, int param1, int param2, int param3, int param4, int param5, int param6, const UnkStruct_ov21_021D5868 *param7, const UnkStruct_ov21_021D5844 *param8, int param9, int param10, const u8 *param11, u32 param12, u32 *param13); +int ov21_021D5A20(CellActor **param0, int param1, int param2, int param3, int param4, int param5, int param6, const UnkStruct_ov21_021D5868 *param7, const pokedexEncStruct *dexEncData, int param9, int param10, const u8 *param11, u32 param12, u32 *param13); #endif // POKEPLATINUM_OV21_021D57B4_H diff --git a/include/overlay021/ov21_021DC9BC.h b/include/overlay021/ov21_021DC9BC.h index 378533dfef..8e35b79d3d 100644 --- a/include/overlay021/ov21_021DC9BC.h +++ b/include/overlay021/ov21_021DC9BC.h @@ -4,7 +4,7 @@ #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021E68F4.h" -void ov21_021DC9BC(UnkStruct_ov21_021E68F4 *param0, UnkStruct_ov21_021D0F60 *param1, int param2); +void ov21_021DC9BC(UnkStruct_ov21_021E68F4 *param0, UnkStruct_ov21_021D0F60 *param1, int heapID); void ov21_021DCA14(UnkStruct_ov21_021E68F4 *param0); int ov21_021DCA28(const UnkStruct_ov21_021E68F4 *param0); void ov21_021DCA30(UnkStruct_ov21_021E68F4 *param0, int param1); diff --git a/include/overlay021/pokedex_sort.h b/include/overlay021/pokedex_sort.h new file mode 100644 index 0000000000..e332e51098 --- /dev/null +++ b/include/overlay021/pokedex_sort.h @@ -0,0 +1,61 @@ +#ifndef POKEPLATINUM_OV21_021D3208_H +#define POKEPLATINUM_OV21_021D3208_H + +#include "overlay021/struct_ov21_021D3208.h" +#include "overlay021/struct_ov21_021D3320.h" +#include "overlay021/struct_ov21_021D37DC.h" + +#include "strbuf.h" + +void Pokedex_Sort_PopulatePokedexStruct(pokedexStruct *param0, UnkStruct_ov21_021D3208 *param1, int param2); +void ov21_021D3320(pokedexStruct *param0); +u32 ov21_021D334C(const pokedexStruct *param0, int param1, int param2); +u32 ov21_021D335C(const pokedexStruct *param0, int param1); +u32 ov21_021D3374(const pokedexStruct *param0, int param1); +u32 ov21_021D338C(const pokedexStruct *param0, int param1); +u32 ov21_021D33A4(const pokedexStruct *param0, int param1); +u32 ov21_021D33BC(const pokedexStruct *param0, int param1); +u32 ov21_021D33D4(const pokedexStruct *param0, u32 param1); +u32 ov21_021D33E0(const pokedexStruct *param0, int param1); +u32 ov21_021D33F8(const pokedexStruct *param0); +u32 ov21_021D3404(const pokedexStruct *param0, int param1); +u32 ov21_021D3410(const pokedexStruct *param0, u32 param1, int param2); +u32 ov21_021D341C(const pokedexStruct *param0, u32 param1); +BOOL Pokedex_Sort_PokedexUnlocked(const pokedexStruct *param0); +void ov21_021D3434(pokedexStruct *param0, u32 param1); +u32 ov21_021D3440(const pokedexStruct *param0); +void ov21_021D344C(pokedexStruct *param0, u32 param1); +u32 ov21_021D3458(const pokedexStruct *param0); +BOOL Pokedex_Sort(pokedexStruct *pokedexS, int sortCategory, int firstLetterFilter, int typeFilter1, int typeFilter2, int bodyShapeFilter, int isNationalDex, int heapID, BOOL isFiltered); +BOOL Pokedex_Sort_Unfiltered(pokedexStruct *param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7); +BOOL ov21_021D36A4(const pokedexStruct *param0, int param1); +BOOL ov21_021D36C0(pokedexStruct *param0, int param1); +int ov21_021D36D8(const pokedexStruct *param0); +BOOL Pokedex_Sort_IsValidDexIndex(const pokedexStruct *pokedexS, int dexIndex); +BOOL ov21_021D36FC(pokedexStruct *param0, int param1); +BOOL ov21_021D371C(pokedexStruct *param0, int param1); +int ov21_021D375C(const pokedexStruct *param0); +int Pokedex_Sort_CompletionNumEncountered(const pokedexStruct *param0); +int ov21_021D3770(const pokedexStruct *param0, u32 param1); +BOOL ov21_021D3794(pokedexStruct *param0, int param1); +int Pokedex_Sort_CurrentSpecies(const pokedexStruct *param0); +int Pokedex_Sort_CurrentCaughtStatus(const pokedexStruct *param0); +const speciesCaughtStatusStruct *Pokedex_Sort_SpeciesCaughtStatus(const pokedexStruct *param0, int dexIndex); +BOOL ov21_021D37F8(const pokedexStruct *param0, int param1); +BOOL ov21_021D3810(pokedexStruct *param0, int param1); +BOOL ov21_021D3844(pokedexStruct *param0, int param1); +BOOL ov21_021D387C(pokedexStruct *param0, int param1); +int ov21_021D3898(const pokedexStruct *param0); +int ov21_021D38A4(const pokedexStruct *param0); +int Pokedex_Sort_SeenIndexToSpecies(const pokedexStruct *param0, int param1); +void ov21_021D38C0(pokedexStruct *param0); +int Pokedex_Sort_NumEncountered(const pokedexStruct *param0); +int Pokedex_Sort_NumCaught(const pokedexStruct *param0); +Strbuf *Pokedex_Sort_TrainerName(const pokedexStruct *param0); +u32 Pokedex_Sort_TrainerGender(const pokedexStruct *param0); +BOOL ov21_021D392C(const pokedexStruct *param0, int param1); +BOOL Pokedex_Sort_CanDetectForms(const pokedexStruct *param0); +void ov21_021D3960(pokedexStruct *param0); +u32 ov21_021D3998(const pokedexStruct *param0); + +#endif // POKEPLATINUM_OV21_021D3208_H diff --git a/include/overlay021/struct_ov21_021D0D80.h b/include/overlay021/struct_ov21_021D0D80.h index 8000e02faf..b6e7f51b62 100644 --- a/include/overlay021/struct_ov21_021D0D80.h +++ b/include/overlay021/struct_ov21_021D0D80.h @@ -9,11 +9,11 @@ typedef struct { const PokedexData *unk_00; const TrainerInfo *unk_04; - int unk_08; - BOOL unk_0C; - BOOL unk_10; - BOOL unk_14; - BOOL unk_18; + int timeOfDay; + BOOL pokedexSFlag_1; + BOOL pokedexSFlag_2; + BOOL pokedexSFlag_3; + BOOL pokedexSFlag_4; UnkStruct_0209ACBC *unk_1C; } UnkStruct_ov21_021D0D80; diff --git a/include/overlay021/struct_ov21_021D0D80_1.h b/include/overlay021/struct_ov21_021D0D80_1.h index bbef0c564a..731ab5db7b 100644 --- a/include/overlay021/struct_ov21_021D0D80_1.h +++ b/include/overlay021/struct_ov21_021D0D80_1.h @@ -9,11 +9,11 @@ typedef struct { const PokedexData *unk_00; const TrainerInfo *unk_04; - int unk_08; - BOOL unk_0C; - BOOL unk_10; - BOOL unk_14; - BOOL unk_18; + int timeOfDay; + BOOL pokedexSFlag_1; + BOOL pokedexSFlag_2; + BOOL pokedexSFlag_3; + BOOL pokedexSFlag_4; UnkStruct_0209ACBC *unk_1C; } UnkStruct_ov21_021D0D80_1; diff --git a/include/overlay021/struct_ov21_021D3208.h b/include/overlay021/struct_ov21_021D3208.h index 13d0b724d2..199318a010 100644 --- a/include/overlay021/struct_ov21_021D3208.h +++ b/include/overlay021/struct_ov21_021D3208.h @@ -6,13 +6,13 @@ #include "trainer_info.h" typedef struct { - const PokedexData *unk_00; + const PokedexData *dexData; const TrainerInfo *unk_04; - int unk_08; - BOOL unk_0C; - BOOL unk_10; - BOOL unk_14; - BOOL unk_18; + int timeOfDay; + BOOL pokedexSFlag_1; + BOOL pokedexSFlag_2; + BOOL pokedexSFlag_3; + BOOL pokedexSFlag_4; u32 unk_1C; u32 unk_20; } UnkStruct_ov21_021D3208; diff --git a/include/overlay021/struct_ov21_021D3320.h b/include/overlay021/struct_ov21_021D3320.h index ed943afb42..083c1476b2 100644 --- a/include/overlay021/struct_ov21_021D3320.h +++ b/include/overlay021/struct_ov21_021D3320.h @@ -9,25 +9,25 @@ #include "strbuf.h" typedef struct { - const PokedexData *unk_00; - UnkStruct_ov21_021D3A60 unk_04; - int unk_1730; - BOOL unk_1734; - int unk_1738; - int unk_173C; + const PokedexData *dexData; + pokedexCompletionStruct pokedexCompletion; + int isNationalDex; + BOOL nationalDexUnlocked; + int numEncountered; + int numCaught; int unk_1740; - int unk_1744; - HeightWeightData *unk_1748; - u32 unk_174C; - u32 unk_1750; - Strbuf *unk_1754; + int timeOfDay; + HeightWeightData *HWData; + u32 TrainerGameCode; + u32 TrainerGender; + Strbuf *trainerName; int unk_1758; u16 unk_175C; u16 unk_175E; - BOOL unk_1760; - BOOL unk_1764; - BOOL unk_1768; - BOOL unk_176C; -} UnkStruct_ov21_021D3320; + BOOL pokedexSFlag_1; + BOOL pokedexSFlag_2; + BOOL pokedexSFlag_3; + BOOL pokedexSFlag_4; +} pokedexStruct; #endif // POKEPLATINUM_STRUCT_OV21_021D3320_H diff --git a/include/overlay021/struct_ov21_021D37DC.h b/include/overlay021/struct_ov21_021D37DC.h index 900d888f07..e92f89fb47 100644 --- a/include/overlay021/struct_ov21_021D37DC.h +++ b/include/overlay021/struct_ov21_021D37DC.h @@ -2,8 +2,8 @@ #define POKEPLATINUM_STRUCT_OV21_021D37DC_H typedef struct { - int unk_00; - int unk_04; -} UnkStruct_ov21_021D37DC; + int species; + int caughtStatus;// 2 for caught, 1 for seen, 0 otherwise +} speciesCaughtStatusStruct; #endif // POKEPLATINUM_STRUCT_OV21_021D37DC_H diff --git a/include/overlay021/struct_ov21_021D3A60.h b/include/overlay021/struct_ov21_021D3A60.h index 912161f845..c283024d2a 100644 --- a/include/overlay021/struct_ov21_021D3A60.h +++ b/include/overlay021/struct_ov21_021D3A60.h @@ -6,12 +6,12 @@ #include "overlay021/struct_ov21_021D37DC.h" typedef struct { - UnkStruct_ov21_021D37DC unk_00[NATIONAL_DEX_COUNT]; + speciesCaughtStatusStruct caughtStatusArray[NATIONAL_DEX_COUNT]; int unk_F68; - int unk_F6C; - int unk_F70[NATIONAL_DEX_COUNT]; + int numEncountered;// number of pokemon seen + int encounteredIndexArray[NATIONAL_DEX_COUNT];// dex number for appearing in dex, dexLength+1 otherwise int unk_1724; - int unk_1728; -} UnkStruct_ov21_021D3A60; + int numSpecies; +} pokedexCompletionStruct; #endif // POKEPLATINUM_STRUCT_OV21_021D3A60_H diff --git a/include/overlay021/struct_ov21_021D5844.h b/include/overlay021/struct_ov21_021D5844.h index 144c5ec7b1..2dcf08f7fb 100644 --- a/include/overlay021/struct_ov21_021D5844.h +++ b/include/overlay021/struct_ov21_021D5844.h @@ -2,8 +2,8 @@ #define POKEPLATINUM_STRUCT_OV21_021D5844_H typedef struct { - int *unk_00; - int unk_04; -} UnkStruct_ov21_021D5844; + int *pokedexEncArray; + int pokedexEncLength; +} pokedexEncStruct; #endif // POKEPLATINUM_STRUCT_OV21_021D5844_H diff --git a/include/overlay021/struct_ov21_021D5B68.h b/include/overlay021/struct_ov21_021D5B68.h index 92af2efde0..645bfbf7fb 100644 --- a/include/overlay021/struct_ov21_021D5B68.h +++ b/include/overlay021/struct_ov21_021D5B68.h @@ -5,7 +5,7 @@ typedef struct { int *unk_00; - UnkStruct_ov21_021D3320 *unk_04; + pokedexStruct *unk_04; int unk_08; int unk_0C; int unk_10; diff --git a/include/overlay021/struct_ov21_021DE6D4.h b/include/overlay021/struct_ov21_021DE6D4.h index dcee75bba1..91a260f984 100644 --- a/include/overlay021/struct_ov21_021DE6D4.h +++ b/include/overlay021/struct_ov21_021DE6D4.h @@ -6,7 +6,7 @@ typedef struct { int *unk_00; - UnkStruct_ov21_021D3320 *unk_04; + pokedexStruct *unk_04; int unk_08; int unk_0C; const UnkStruct_ov21_021E68F4 *unk_10; diff --git a/include/overlay021/struct_ov21_021E6A68.h b/include/overlay021/struct_ov21_021E6A68.h index fcceb7fc3d..fae833d051 100644 --- a/include/overlay021/struct_ov21_021E6A68.h +++ b/include/overlay021/struct_ov21_021E6A68.h @@ -3,7 +3,7 @@ typedef struct { int unk_00; - int unk_04; + int heapID; void *unk_08; BOOL unk_0C; BOOL unk_10; diff --git a/include/overlay021/struct_ov21_021E6B20.h b/include/overlay021/struct_ov21_021E6B20.h index c9044d180e..c247a40f40 100644 --- a/include/overlay021/struct_ov21_021E6B20.h +++ b/include/overlay021/struct_ov21_021E6B20.h @@ -3,7 +3,7 @@ typedef struct { int unk_00; - int unk_04; + int heapID; void *unk_08; } UnkStruct_ov21_021E6B20; diff --git a/include/pokedex_heightweight.h b/include/pokedex_heightweight.h index 6f1348eee7..cec66d3177 100644 --- a/include/pokedex_heightweight.h +++ b/include/pokedex_heightweight.h @@ -7,11 +7,11 @@ HeightWeightData *Pokedex_HeightWeightData(int heapID); void Pokedex_HeightWeightData_Free(HeightWeightData *HWData); void Pokedex_HeightWeightData_Load(HeightWeightData *HWData, int trainerIsGirl, int param2); void Pokedex_HeightWeightData_Release(HeightWeightData *HWData); -int Pokedex_HeightWeightData_Height(const HeightWeightData *HWData, int dexNumber); -int Pokedex_HeightWeightData_Weight(const HeightWeightData *HWData, int dexNumber); -short Pokedex_HeightWeightData_TrainerPos(const HeightWeightData *HWData, int dexNumber); -short Pokedex_HeightWeightData_PokemonPos(const HeightWeightData *HWData, int dexNumber); -short Pokedex_HeightWeightData_TrainerScale(const HeightWeightData *HWData, int dexNumber); -short Pokedex_HeightWeightData_PokemonScale(const HeightWeightData *HWData, int dexNumber); +int Pokedex_HeightWeightData_Height(const HeightWeightData *HWData, int species); +int Pokedex_HeightWeightData_Weight(const HeightWeightData *HWData, int species); +short Pokedex_HeightWeightData_TrainerPos(const HeightWeightData *HWData, int species); +short Pokedex_HeightWeightData_PokemonPos(const HeightWeightData *HWData, int species); +short Pokedex_HeightWeightData_TrainerScale(const HeightWeightData *HWData, int species); +short Pokedex_HeightWeightData_PokemonScale(const HeightWeightData *HWData, int species); #endif // POKEPLATINUM_Pokedex_HeightWeight_H diff --git a/include/unk_0202631C.h b/include/unk_0202631C.h index 3a047e89bf..9d6f2c5f50 100644 --- a/include/unk_0202631C.h +++ b/include/unk_0202631C.h @@ -9,45 +9,45 @@ int Pokedex_SaveSize(void); PokedexData *sub_02026324(u32 param0); void sub_02026338(const PokedexData *param0, PokedexData *param1); -void Pokedex_Init(PokedexData *param0); -u16 sub_02026DD0(const PokedexData *param0); -u16 sub_02026E0C(const PokedexData *param0); -u16 sub_02026E48(const PokedexData *param0); -u16 sub_02026E64(const PokedexData *param0); -u16 sub_02026EAC(const PokedexData *param0); -BOOL sub_02026EF4(const PokedexData *param0); -BOOL sub_02026F0C(const PokedexData *param0); -u16 sub_02026F20(const PokedexData *param0); -u16 sub_02026F58(const PokedexData *param0); -BOOL Pokedex_CaughtSpecies(const PokedexData *param0, u16 param1); -BOOL sub_02026FE8(const PokedexData *param0, u16 param1); -u32 sub_0202702C(const PokedexData *param0, u8 param1); -u32 sub_02027058(const PokedexData *param0, u16 param1, int param2); -u32 sub_020270AC(const PokedexData *param0, int param1); -u32 sub_020270DC(const PokedexData *param0); -u32 sub_020270F8(const PokedexData *param0, int param1); -u32 sub_02027130(const PokedexData *param0); -u32 sub_02027154(const PokedexData *param0, int param1); -u32 sub_0202718C(const PokedexData *param0); -u32 sub_020271B0(const PokedexData *param0, int param1); -u32 sub_020271E8(const PokedexData *param0); -u32 sub_02027208(const PokedexData *param0, int param1); -u32 sub_02027240(const PokedexData *param0); -u32 sub_02027264(const PokedexData *param0, int param1); -u32 sub_02027288(const PokedexData *param0); -void sub_020272A4(PokedexData *param0, Pokemon *param1); -void sub_0202736C(PokedexData *param0, Pokemon *param1); -void sub_02027454(PokedexData *param0); -BOOL sub_02027474(const PokedexData *param0); -BOOL sub_02027494(const PokedexData *param0); -void sub_020274B0(PokedexData *param0); -BOOL sub_020274D0(const PokedexData *param0, u16 param1, u32 param2); -void sub_02027508(PokedexData *param0); -BOOL sub_02027514(const PokedexData *param0); -BOOL sub_02027520(const PokedexData *param0); -void sub_02027540(PokedexData *param0); +void Pokedex_Init(PokedexData *dexData); +u16 sub_02026DD0(const PokedexData *dexData); +u16 sub_02026E0C(const PokedexData *dexData); +u16 sub_02026E48(const PokedexData *dexData); +u16 sub_02026E64(const PokedexData *dexData); +u16 sub_02026EAC(const PokedexData *dexData); +BOOL sub_02026EF4(const PokedexData *dexData); +BOOL sub_02026F0C(const PokedexData *dexData); +u16 sub_02026F20(const PokedexData *dexData); +u16 sub_02026F58(const PokedexData *dexData); +BOOL Pokedex_CaughtSpecies(const PokedexData *dexData, u16 species); +BOOL Pokedex_EncounteredSpecies(const PokedexData *dexData, u16 species); +u32 sub_0202702C(const PokedexData *dexData, u8 param1); +u32 sub_02027058(const PokedexData *dexData, u16 param1, int param2); +u32 sub_020270AC(const PokedexData *dexData, int param1); +u32 sub_020270DC(const PokedexData *dexData); +u32 sub_020270F8(const PokedexData *dexData, int param1); +u32 sub_02027130(const PokedexData *dexData); +u32 sub_02027154(const PokedexData *dexData, int param1); +u32 sub_0202718C(const PokedexData *dexData); +u32 sub_020271B0(const PokedexData *dexData, int param1); +u32 sub_020271E8(const PokedexData *dexData); +u32 sub_02027208(const PokedexData *dexData, int param1); +u32 sub_02027240(const PokedexData *dexData); +u32 sub_02027264(const PokedexData *dexData, int param1); +u32 sub_02027288(const PokedexData *dexData); +void sub_020272A4(PokedexData *dexData, Pokemon *param1); +void sub_0202736C(PokedexData *dexData, Pokemon *param1); +void sub_02027454(PokedexData *dexData); +BOOL Pokedex_NationalUnlocked(const PokedexData *dexData); +BOOL Pokedex_CanDetectForms(const PokedexData *dexData); +void Pokedex_CanDetectForms_True(PokedexData *dexData); +BOOL sub_020274D0(const PokedexData *dexData, u16 param1, u32 param2); +void sub_02027508(PokedexData *dexData); +BOOL sub_02027514(const PokedexData *dexData); +BOOL sub_02027520(const PokedexData *dexData); +void sub_02027540(PokedexData *dexData); PokedexData *SaveData_Pokedex(SaveData *param0); -u32 sub_0202756C(const PokedexData *param0, int param1, int param2); -u32 sub_020276C8(const PokedexData *param0, int param1); +u32 sub_0202756C(const PokedexData *dexData, int param1, int param2); +u32 sub_020276C8(const PokedexData *dexData, int param1); #endif // POKEPLATINUM_UNK_0202631C_H diff --git a/platinum.us/main.lsf b/platinum.us/main.lsf index b2f8274d34..d39cc5c8dc 100644 --- a/platinum.us/main.lsf +++ b/platinum.us/main.lsf @@ -786,7 +786,7 @@ Overlay overlay21 Object main.nef.p/src_overlay021_ov21_021D0D80.c.o Object main.nef.p/src_overlay021_ov21_021D1F90.c.o Object main.nef.p/src_overlay021_ov21_021D1FA4.c.o - Object main.nef.p/src_overlay021_ov21_021D3208.c.o + Object main.nef.p/src_overlay021_pokedex_sort.c.o Object main.nef.p/src_overlay021_ov21_021D3FE0.c.o Object main.nef.p/src_overlay021_ov21_021D423C.c.o Object main.nef.p/src_overlay021_ov21_021D4340.c.o diff --git a/res/field/encounters/000.json b/res/field/encounters/000.json index 234331b6a9..e039852c93 100644 --- a/res/field/encounters/000.json +++ b/res/field/encounters/000.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_LUMINEON" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 1 + } +} \ No newline at end of file diff --git a/res/field/encounters/001.json b/res/field/encounters/001.json index 1cbd049016..7fa37a85e8 100644 --- a/res/field/encounters/001.json +++ b/res/field/encounters/001.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_WHISCASH" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 2 + } +} \ No newline at end of file diff --git a/res/field/encounters/002.json b/res/field/encounters/002.json index 7b9a38acb0..900b3dec64 100644 --- a/res/field/encounters/002.json +++ b/res/field/encounters/002.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_OCTILLERY" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 3 + } +} \ No newline at end of file diff --git a/res/field/encounters/003.json b/res/field/encounters/003.json index 8814346064..957bd7513c 100644 --- a/res/field/encounters/003.json +++ b/res/field/encounters/003.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_OCTILLERY" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 4 + } +} \ No newline at end of file diff --git a/res/field/encounters/004.json b/res/field/encounters/004.json index 62aa986ab7..3e0626e0c1 100644 --- a/res/field/encounters/004.json +++ b/res/field/encounters/004.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_OCTILLERY" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 5 + } +} \ No newline at end of file diff --git a/res/field/encounters/005.json b/res/field/encounters/005.json index 734fa90b27..c08ddf4b75 100644 --- a/res/field/encounters/005.json +++ b/res/field/encounters/005.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 1 + } +} \ No newline at end of file diff --git a/res/field/encounters/006.json b/res/field/encounters/006.json index 3f870c490a..3e63875d01 100644 --- a/res/field/encounters/006.json +++ b/res/field/encounters/006.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 1 + } +} \ No newline at end of file diff --git a/res/field/encounters/007.json b/res/field/encounters/007.json index db164bfedc..26b5fdfb9f 100644 --- a/res/field/encounters/007.json +++ b/res/field/encounters/007.json @@ -205,5 +205,25 @@ "level_min": 40, "species": "SPECIES_LUMINEON" } - ] -} + ], + "special_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "specialnatdex_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "map_category": { + "map_type": "field", + "map_number": 6 + } +} \ No newline at end of file diff --git a/res/field/encounters/008.json b/res/field/encounters/008.json index b416ebe526..3712b44484 100644 --- a/res/field/encounters/008.json +++ b/res/field/encounters/008.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 2 + } +} \ No newline at end of file diff --git a/res/field/encounters/009.json b/res/field/encounters/009.json index 294708365c..cd164080f6 100644 --- a/res/field/encounters/009.json +++ b/res/field/encounters/009.json @@ -205,5 +205,25 @@ "level_min": 40, "species": "SPECIES_LUMINEON" } - ] -} + ], + "special_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "specialnatdex_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "map_category": { + "map_type": "field", + "map_number": 7 + } +} \ No newline at end of file diff --git a/res/field/encounters/010.json b/res/field/encounters/010.json index 22b9007483..6d1fd57e15 100644 --- a/res/field/encounters/010.json +++ b/res/field/encounters/010.json @@ -205,5 +205,15 @@ "level_min": 40, "species": "SPECIES_WHISCASH" } - ] -} + ], + "special_encounters": [ + "SPECIES_FEEBAS" + ], + "specialnatdex_encounters": [ + "SPECIES_FEEBAS" + ], + "map_category": { + "map_type": "dungeon", + "map_number": 3 + } +} \ No newline at end of file diff --git a/res/field/encounters/011.json b/res/field/encounters/011.json index d5c75352ce..ec655b7eca 100644 --- a/res/field/encounters/011.json +++ b/res/field/encounters/011.json @@ -205,5 +205,15 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [ + "SPECIES_FEEBAS" + ], + "specialnatdex_encounters": [ + "SPECIES_FEEBAS" + ], + "map_category": { + "map_type": "dungeon", + "map_number": 3 + } +} \ No newline at end of file diff --git a/res/field/encounters/012.json b/res/field/encounters/012.json index 315b6fcb87..48408ee419 100644 --- a/res/field/encounters/012.json +++ b/res/field/encounters/012.json @@ -205,5 +205,15 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [ + "SPECIES_FEEBAS" + ], + "specialnatdex_encounters": [ + "SPECIES_FEEBAS" + ], + "map_category": { + "map_type": "dungeon", + "map_number": 3 + } +} \ No newline at end of file diff --git a/res/field/encounters/013.json b/res/field/encounters/013.json index 799f78b9af..8697bc959e 100644 --- a/res/field/encounters/013.json +++ b/res/field/encounters/013.json @@ -205,5 +205,15 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [ + "SPECIES_FEEBAS" + ], + "specialnatdex_encounters": [ + "SPECIES_FEEBAS" + ], + "map_category": { + "map_type": "dungeon", + "map_number": 3 + } +} \ No newline at end of file diff --git a/res/field/encounters/014.json b/res/field/encounters/014.json index 799f78b9af..8697bc959e 100644 --- a/res/field/encounters/014.json +++ b/res/field/encounters/014.json @@ -205,5 +205,15 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [ + "SPECIES_FEEBAS" + ], + "specialnatdex_encounters": [ + "SPECIES_FEEBAS" + ], + "map_category": { + "map_type": "dungeon", + "map_number": 3 + } +} \ No newline at end of file diff --git a/res/field/encounters/015.json b/res/field/encounters/015.json index 1158c1dc9c..39616bcdef 100644 --- a/res/field/encounters/015.json +++ b/res/field/encounters/015.json @@ -205,5 +205,15 @@ "level_min": 35, "species": "SPECIES_DRAGONAIR" } - ] -} + ], + "special_encounters": [ + "SPECIES_FEEBAS" + ], + "specialnatdex_encounters": [ + "SPECIES_FEEBAS" + ], + "map_category": { + "map_type": "dungeon", + "map_number": 3 + } +} \ No newline at end of file diff --git a/res/field/encounters/016.json b/res/field/encounters/016.json index 5b960748d4..9b4a03a1cc 100644 --- a/res/field/encounters/016.json +++ b/res/field/encounters/016.json @@ -205,5 +205,15 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [ + "SPECIES_FEEBAS" + ], + "specialnatdex_encounters": [ + "SPECIES_FEEBAS" + ], + "map_category": { + "map_type": "dungeon", + "map_number": 3 + } +} \ No newline at end of file diff --git a/res/field/encounters/017.json b/res/field/encounters/017.json index dfb6696348..840b8213f2 100644 --- a/res/field/encounters/017.json +++ b/res/field/encounters/017.json @@ -205,5 +205,15 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [ + "SPECIES_FEEBAS" + ], + "specialnatdex_encounters": [ + "SPECIES_FEEBAS" + ], + "map_category": { + "map_type": "dungeon", + "map_number": 3 + } +} \ No newline at end of file diff --git a/res/field/encounters/018.json b/res/field/encounters/018.json index 345652a433..a3218fd612 100644 --- a/res/field/encounters/018.json +++ b/res/field/encounters/018.json @@ -205,5 +205,15 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [ + "SPECIES_FEEBAS" + ], + "specialnatdex_encounters": [ + "SPECIES_FEEBAS" + ], + "map_category": { + "map_type": "dungeon", + "map_number": 3 + } +} \ No newline at end of file diff --git a/res/field/encounters/019.json b/res/field/encounters/019.json index 3f57ca0cc4..08d9fc606e 100644 --- a/res/field/encounters/019.json +++ b/res/field/encounters/019.json @@ -205,5 +205,15 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [ + "SPECIES_FEEBAS" + ], + "specialnatdex_encounters": [ + "SPECIES_FEEBAS" + ], + "map_category": { + "map_type": "dungeon", + "map_number": 3 + } +} \ No newline at end of file diff --git a/res/field/encounters/020.json b/res/field/encounters/020.json index 61355c7603..98ae256a74 100644 --- a/res/field/encounters/020.json +++ b/res/field/encounters/020.json @@ -205,5 +205,15 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [ + "SPECIES_FEEBAS" + ], + "specialnatdex_encounters": [ + "SPECIES_FEEBAS" + ], + "map_category": { + "map_type": "dungeon", + "map_number": 3 + } +} \ No newline at end of file diff --git a/res/field/encounters/021.json b/res/field/encounters/021.json index 7834a1d9ff..4e96a8e85b 100644 --- a/res/field/encounters/021.json +++ b/res/field/encounters/021.json @@ -205,5 +205,15 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [ + "SPECIES_FEEBAS" + ], + "specialnatdex_encounters": [ + "SPECIES_FEEBAS" + ], + "map_category": { + "map_type": "dungeon", + "map_number": 3 + } +} \ No newline at end of file diff --git a/res/field/encounters/022.json b/res/field/encounters/022.json index f113d129d4..d12ce21023 100644 --- a/res/field/encounters/022.json +++ b/res/field/encounters/022.json @@ -205,5 +205,15 @@ "level_min": 40, "species": "SPECIES_WHISCASH" } - ] -} + ], + "special_encounters": [ + "SPECIES_FEEBAS" + ], + "specialnatdex_encounters": [ + "SPECIES_FEEBAS" + ], + "map_category": { + "map_type": "dungeon", + "map_number": 3 + } +} \ No newline at end of file diff --git a/res/field/encounters/023.json b/res/field/encounters/023.json index 9cb2731daa..93e25dfa46 100644 --- a/res/field/encounters/023.json +++ b/res/field/encounters/023.json @@ -205,5 +205,33 @@ "level_min": 40, "species": "SPECIES_CARVANHA" } - ] -} + ], + "special_encounters": [ + "SPECIES_TANGELA", + "SPECIES_YANMA", + "SPECIES_WOOPER", + "SPECIES_QUAGSIRE", + "SPECIES_TROPIUS", + "SPECIES_SKORUPI", + "SPECIES_CROAGUNK", + "SPECIES_CARNIVINE" + ], + "specialnatdex_encounters": [ + "SPECIES_PARAS", + "SPECIES_EXEGGCUTE", + "SPECIES_KANGASKHAN", + "SPECIES_SHROOMISH", + "SPECIES_GULPIN", + "SPECIES_KECLEON", + "SPECIES_TROPIUS", + "SPECIES_SKORUPI", + "SPECIES_DRAPION", + "SPECIES_CROAGUNK", + "SPECIES_TOXICROAK", + "SPECIES_CARNIVINE" + ], + "map_category": { + "map_type": "dungeon", + "map_number": 4 + } +} \ No newline at end of file diff --git a/res/field/encounters/024.json b/res/field/encounters/024.json index 9cb2731daa..93e25dfa46 100644 --- a/res/field/encounters/024.json +++ b/res/field/encounters/024.json @@ -205,5 +205,33 @@ "level_min": 40, "species": "SPECIES_CARVANHA" } - ] -} + ], + "special_encounters": [ + "SPECIES_TANGELA", + "SPECIES_YANMA", + "SPECIES_WOOPER", + "SPECIES_QUAGSIRE", + "SPECIES_TROPIUS", + "SPECIES_SKORUPI", + "SPECIES_CROAGUNK", + "SPECIES_CARNIVINE" + ], + "specialnatdex_encounters": [ + "SPECIES_PARAS", + "SPECIES_EXEGGCUTE", + "SPECIES_KANGASKHAN", + "SPECIES_SHROOMISH", + "SPECIES_GULPIN", + "SPECIES_KECLEON", + "SPECIES_TROPIUS", + "SPECIES_SKORUPI", + "SPECIES_DRAPION", + "SPECIES_CROAGUNK", + "SPECIES_TOXICROAK", + "SPECIES_CARNIVINE" + ], + "map_category": { + "map_type": "dungeon", + "map_number": 4 + } +} \ No newline at end of file diff --git a/res/field/encounters/025.json b/res/field/encounters/025.json index dd518eccdb..22be9eb796 100644 --- a/res/field/encounters/025.json +++ b/res/field/encounters/025.json @@ -205,5 +205,33 @@ "level_min": 40, "species": "SPECIES_CARVANHA" } - ] -} + ], + "special_encounters": [ + "SPECIES_TANGELA", + "SPECIES_YANMA", + "SPECIES_WOOPER", + "SPECIES_QUAGSIRE", + "SPECIES_TROPIUS", + "SPECIES_SKORUPI", + "SPECIES_CROAGUNK", + "SPECIES_CARNIVINE" + ], + "specialnatdex_encounters": [ + "SPECIES_PARAS", + "SPECIES_EXEGGCUTE", + "SPECIES_KANGASKHAN", + "SPECIES_SHROOMISH", + "SPECIES_GULPIN", + "SPECIES_KECLEON", + "SPECIES_TROPIUS", + "SPECIES_SKORUPI", + "SPECIES_DRAPION", + "SPECIES_CROAGUNK", + "SPECIES_TOXICROAK", + "SPECIES_CARNIVINE" + ], + "map_category": { + "map_type": "dungeon", + "map_number": 4 + } +} \ No newline at end of file diff --git a/res/field/encounters/026.json b/res/field/encounters/026.json index dd518eccdb..22be9eb796 100644 --- a/res/field/encounters/026.json +++ b/res/field/encounters/026.json @@ -205,5 +205,33 @@ "level_min": 40, "species": "SPECIES_CARVANHA" } - ] -} + ], + "special_encounters": [ + "SPECIES_TANGELA", + "SPECIES_YANMA", + "SPECIES_WOOPER", + "SPECIES_QUAGSIRE", + "SPECIES_TROPIUS", + "SPECIES_SKORUPI", + "SPECIES_CROAGUNK", + "SPECIES_CARNIVINE" + ], + "specialnatdex_encounters": [ + "SPECIES_PARAS", + "SPECIES_EXEGGCUTE", + "SPECIES_KANGASKHAN", + "SPECIES_SHROOMISH", + "SPECIES_GULPIN", + "SPECIES_KECLEON", + "SPECIES_TROPIUS", + "SPECIES_SKORUPI", + "SPECIES_DRAPION", + "SPECIES_CROAGUNK", + "SPECIES_TOXICROAK", + "SPECIES_CARNIVINE" + ], + "map_category": { + "map_type": "dungeon", + "map_number": 4 + } +} \ No newline at end of file diff --git a/res/field/encounters/027.json b/res/field/encounters/027.json index 119b24b3dd..61b4e44ca5 100644 --- a/res/field/encounters/027.json +++ b/res/field/encounters/027.json @@ -205,5 +205,33 @@ "level_min": 40, "species": "SPECIES_CARVANHA" } - ] -} + ], + "special_encounters": [ + "SPECIES_TANGELA", + "SPECIES_YANMA", + "SPECIES_WOOPER", + "SPECIES_QUAGSIRE", + "SPECIES_TROPIUS", + "SPECIES_SKORUPI", + "SPECIES_CROAGUNK", + "SPECIES_CARNIVINE" + ], + "specialnatdex_encounters": [ + "SPECIES_PARAS", + "SPECIES_EXEGGCUTE", + "SPECIES_KANGASKHAN", + "SPECIES_SHROOMISH", + "SPECIES_GULPIN", + "SPECIES_KECLEON", + "SPECIES_TROPIUS", + "SPECIES_SKORUPI", + "SPECIES_DRAPION", + "SPECIES_CROAGUNK", + "SPECIES_TOXICROAK", + "SPECIES_CARNIVINE" + ], + "map_category": { + "map_type": "dungeon", + "map_number": 4 + } +} \ No newline at end of file diff --git a/res/field/encounters/028.json b/res/field/encounters/028.json index 119b24b3dd..61b4e44ca5 100644 --- a/res/field/encounters/028.json +++ b/res/field/encounters/028.json @@ -205,5 +205,33 @@ "level_min": 40, "species": "SPECIES_CARVANHA" } - ] -} + ], + "special_encounters": [ + "SPECIES_TANGELA", + "SPECIES_YANMA", + "SPECIES_WOOPER", + "SPECIES_QUAGSIRE", + "SPECIES_TROPIUS", + "SPECIES_SKORUPI", + "SPECIES_CROAGUNK", + "SPECIES_CARNIVINE" + ], + "specialnatdex_encounters": [ + "SPECIES_PARAS", + "SPECIES_EXEGGCUTE", + "SPECIES_KANGASKHAN", + "SPECIES_SHROOMISH", + "SPECIES_GULPIN", + "SPECIES_KECLEON", + "SPECIES_TROPIUS", + "SPECIES_SKORUPI", + "SPECIES_DRAPION", + "SPECIES_CROAGUNK", + "SPECIES_TOXICROAK", + "SPECIES_CARNIVINE" + ], + "map_category": { + "map_type": "dungeon", + "map_number": 4 + } +} \ No newline at end of file diff --git a/res/field/encounters/029.json b/res/field/encounters/029.json index bf156a99ee..d7a9701b2b 100644 --- a/res/field/encounters/029.json +++ b/res/field/encounters/029.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 5 + } +} \ No newline at end of file diff --git a/res/field/encounters/030.json b/res/field/encounters/030.json index 78ae7fa05c..39ac650c90 100644 --- a/res/field/encounters/030.json +++ b/res/field/encounters/030.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 5 + } +} \ No newline at end of file diff --git a/res/field/encounters/031.json b/res/field/encounters/031.json index 78ae7fa05c..39ac650c90 100644 --- a/res/field/encounters/031.json +++ b/res/field/encounters/031.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 5 + } +} \ No newline at end of file diff --git a/res/field/encounters/032.json b/res/field/encounters/032.json index 45a4d6d8ec..32c0ad4c91 100644 --- a/res/field/encounters/032.json +++ b/res/field/encounters/032.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 5 + } +} \ No newline at end of file diff --git a/res/field/encounters/033.json b/res/field/encounters/033.json index 78ae7fa05c..39ac650c90 100644 --- a/res/field/encounters/033.json +++ b/res/field/encounters/033.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 5 + } +} \ No newline at end of file diff --git a/res/field/encounters/034.json b/res/field/encounters/034.json index a2e3a596bf..bb97d3863b 100644 --- a/res/field/encounters/034.json +++ b/res/field/encounters/034.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 5 + } +} \ No newline at end of file diff --git a/res/field/encounters/035.json b/res/field/encounters/035.json index 78ae7fa05c..39ac650c90 100644 --- a/res/field/encounters/035.json +++ b/res/field/encounters/035.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 5 + } +} \ No newline at end of file diff --git a/res/field/encounters/036.json b/res/field/encounters/036.json index 78ae7fa05c..39ac650c90 100644 --- a/res/field/encounters/036.json +++ b/res/field/encounters/036.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 5 + } +} \ No newline at end of file diff --git a/res/field/encounters/037.json b/res/field/encounters/037.json index 78ae7fa05c..39ac650c90 100644 --- a/res/field/encounters/037.json +++ b/res/field/encounters/037.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 5 + } +} \ No newline at end of file diff --git a/res/field/encounters/038.json b/res/field/encounters/038.json index 78ae7fa05c..39ac650c90 100644 --- a/res/field/encounters/038.json +++ b/res/field/encounters/038.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 5 + } +} \ No newline at end of file diff --git a/res/field/encounters/039.json b/res/field/encounters/039.json index 78ae7fa05c..39ac650c90 100644 --- a/res/field/encounters/039.json +++ b/res/field/encounters/039.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 5 + } +} \ No newline at end of file diff --git a/res/field/encounters/040.json b/res/field/encounters/040.json index de2f31f263..3834c249c4 100644 --- a/res/field/encounters/040.json +++ b/res/field/encounters/040.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 5 + } +} \ No newline at end of file diff --git a/res/field/encounters/041.json b/res/field/encounters/041.json index 969fdede92..27772062ef 100644 --- a/res/field/encounters/041.json +++ b/res/field/encounters/041.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 5 + } +} \ No newline at end of file diff --git a/res/field/encounters/042.json b/res/field/encounters/042.json index 2d00cc2799..f85c397fc2 100644 --- a/res/field/encounters/042.json +++ b/res/field/encounters/042.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 5 + } +} \ No newline at end of file diff --git a/res/field/encounters/043.json b/res/field/encounters/043.json index 4277aad18b..d070590ae7 100644 --- a/res/field/encounters/043.json +++ b/res/field/encounters/043.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 5 + } +} \ No newline at end of file diff --git a/res/field/encounters/044.json b/res/field/encounters/044.json index 78ae7fa05c..39ac650c90 100644 --- a/res/field/encounters/044.json +++ b/res/field/encounters/044.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 5 + } +} \ No newline at end of file diff --git a/res/field/encounters/045.json b/res/field/encounters/045.json index 78ae7fa05c..39ac650c90 100644 --- a/res/field/encounters/045.json +++ b/res/field/encounters/045.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 5 + } +} \ No newline at end of file diff --git a/res/field/encounters/046.json b/res/field/encounters/046.json index 78ae7fa05c..39ac650c90 100644 --- a/res/field/encounters/046.json +++ b/res/field/encounters/046.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 5 + } +} \ No newline at end of file diff --git a/res/field/encounters/047.json b/res/field/encounters/047.json index 367e234878..849c045661 100644 --- a/res/field/encounters/047.json +++ b/res/field/encounters/047.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 6 + } +} \ No newline at end of file diff --git a/res/field/encounters/048.json b/res/field/encounters/048.json index 62af1eea84..fa384aa09b 100644 --- a/res/field/encounters/048.json +++ b/res/field/encounters/048.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 6 + } +} \ No newline at end of file diff --git a/res/field/encounters/049.json b/res/field/encounters/049.json index 1b70f9b108..903e3c6139 100644 --- a/res/field/encounters/049.json +++ b/res/field/encounters/049.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_GYARADOS" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 6 + } +} \ No newline at end of file diff --git a/res/field/encounters/050.json b/res/field/encounters/050.json index 012b63046e..bf42ed4395 100644 --- a/res/field/encounters/050.json +++ b/res/field/encounters/050.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_GYARADOS" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 6 + } +} \ No newline at end of file diff --git a/res/field/encounters/051.json b/res/field/encounters/051.json index d22dfcf01e..e1e6809993 100644 --- a/res/field/encounters/051.json +++ b/res/field/encounters/051.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 6 + } +} \ No newline at end of file diff --git a/res/field/encounters/052.json b/res/field/encounters/052.json index c9ba3aff64..852fa7f647 100644 --- a/res/field/encounters/052.json +++ b/res/field/encounters/052.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 6 + } +} \ No newline at end of file diff --git a/res/field/encounters/053.json b/res/field/encounters/053.json index cb301908ce..0a7b300827 100644 --- a/res/field/encounters/053.json +++ b/res/field/encounters/053.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_WHISCASH" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 7 + } +} \ No newline at end of file diff --git a/res/field/encounters/054.json b/res/field/encounters/054.json index f1f8634eda..36a7874cd6 100644 --- a/res/field/encounters/054.json +++ b/res/field/encounters/054.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 8 + } +} \ No newline at end of file diff --git a/res/field/encounters/055.json b/res/field/encounters/055.json index 6b9d2362f9..208e69dad1 100644 --- a/res/field/encounters/055.json +++ b/res/field/encounters/055.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_WHISCASH" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 8 + } +} \ No newline at end of file diff --git a/res/field/encounters/056.json b/res/field/encounters/056.json index 277eacb7d3..9aa69897e6 100644 --- a/res/field/encounters/056.json +++ b/res/field/encounters/056.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 8 + } +} \ No newline at end of file diff --git a/res/field/encounters/057.json b/res/field/encounters/057.json index ffc404d5a0..1bad981e87 100644 --- a/res/field/encounters/057.json +++ b/res/field/encounters/057.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 9 + } +} \ No newline at end of file diff --git a/res/field/encounters/058.json b/res/field/encounters/058.json index 0ae64b32bd..7befdc7e9b 100644 --- a/res/field/encounters/058.json +++ b/res/field/encounters/058.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 9 + } +} \ No newline at end of file diff --git a/res/field/encounters/059.json b/res/field/encounters/059.json index a7220971bb..4a2df6644d 100644 --- a/res/field/encounters/059.json +++ b/res/field/encounters/059.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_SEAKING" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/060.json b/res/field/encounters/060.json index df3b8592b1..0c5a58c0e1 100644 --- a/res/field/encounters/060.json +++ b/res/field/encounters/060.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/061.json b/res/field/encounters/061.json index f614ca02ae..183ab10e06 100644 --- a/res/field/encounters/061.json +++ b/res/field/encounters/061.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/062.json b/res/field/encounters/062.json index 903cbffe61..ac0b723eba 100644 --- a/res/field/encounters/062.json +++ b/res/field/encounters/062.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/063.json b/res/field/encounters/063.json index df3b8592b1..0c5a58c0e1 100644 --- a/res/field/encounters/063.json +++ b/res/field/encounters/063.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/064.json b/res/field/encounters/064.json index df3b8592b1..0c5a58c0e1 100644 --- a/res/field/encounters/064.json +++ b/res/field/encounters/064.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/065.json b/res/field/encounters/065.json index df3b8592b1..0c5a58c0e1 100644 --- a/res/field/encounters/065.json +++ b/res/field/encounters/065.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/066.json b/res/field/encounters/066.json index df3b8592b1..0c5a58c0e1 100644 --- a/res/field/encounters/066.json +++ b/res/field/encounters/066.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/067.json b/res/field/encounters/067.json index df3b8592b1..0c5a58c0e1 100644 --- a/res/field/encounters/067.json +++ b/res/field/encounters/067.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/068.json b/res/field/encounters/068.json index df3b8592b1..0c5a58c0e1 100644 --- a/res/field/encounters/068.json +++ b/res/field/encounters/068.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/069.json b/res/field/encounters/069.json index 429efbfbf4..c6598f7f0d 100644 --- a/res/field/encounters/069.json +++ b/res/field/encounters/069.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/070.json b/res/field/encounters/070.json index a26b3d8a82..f56680906b 100644 --- a/res/field/encounters/070.json +++ b/res/field/encounters/070.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/071.json b/res/field/encounters/071.json index a26b3d8a82..f56680906b 100644 --- a/res/field/encounters/071.json +++ b/res/field/encounters/071.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/072.json b/res/field/encounters/072.json index a26b3d8a82..f56680906b 100644 --- a/res/field/encounters/072.json +++ b/res/field/encounters/072.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/073.json b/res/field/encounters/073.json index a26b3d8a82..f56680906b 100644 --- a/res/field/encounters/073.json +++ b/res/field/encounters/073.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/074.json b/res/field/encounters/074.json index a26b3d8a82..f56680906b 100644 --- a/res/field/encounters/074.json +++ b/res/field/encounters/074.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/075.json b/res/field/encounters/075.json index f614ca02ae..183ab10e06 100644 --- a/res/field/encounters/075.json +++ b/res/field/encounters/075.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/076.json b/res/field/encounters/076.json index f614ca02ae..183ab10e06 100644 --- a/res/field/encounters/076.json +++ b/res/field/encounters/076.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/077.json b/res/field/encounters/077.json index f614ca02ae..183ab10e06 100644 --- a/res/field/encounters/077.json +++ b/res/field/encounters/077.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/078.json b/res/field/encounters/078.json index f614ca02ae..183ab10e06 100644 --- a/res/field/encounters/078.json +++ b/res/field/encounters/078.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/079.json b/res/field/encounters/079.json index f614ca02ae..183ab10e06 100644 --- a/res/field/encounters/079.json +++ b/res/field/encounters/079.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/080.json b/res/field/encounters/080.json index f614ca02ae..183ab10e06 100644 --- a/res/field/encounters/080.json +++ b/res/field/encounters/080.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/081.json b/res/field/encounters/081.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/081.json +++ b/res/field/encounters/081.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/082.json b/res/field/encounters/082.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/082.json +++ b/res/field/encounters/082.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/083.json b/res/field/encounters/083.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/083.json +++ b/res/field/encounters/083.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/084.json b/res/field/encounters/084.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/084.json +++ b/res/field/encounters/084.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/085.json b/res/field/encounters/085.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/085.json +++ b/res/field/encounters/085.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/086.json b/res/field/encounters/086.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/086.json +++ b/res/field/encounters/086.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/087.json b/res/field/encounters/087.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/087.json +++ b/res/field/encounters/087.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/088.json b/res/field/encounters/088.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/088.json +++ b/res/field/encounters/088.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/089.json b/res/field/encounters/089.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/089.json +++ b/res/field/encounters/089.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/090.json b/res/field/encounters/090.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/090.json +++ b/res/field/encounters/090.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/091.json b/res/field/encounters/091.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/091.json +++ b/res/field/encounters/091.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/092.json b/res/field/encounters/092.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/092.json +++ b/res/field/encounters/092.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/093.json b/res/field/encounters/093.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/093.json +++ b/res/field/encounters/093.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/094.json b/res/field/encounters/094.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/094.json +++ b/res/field/encounters/094.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/095.json b/res/field/encounters/095.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/095.json +++ b/res/field/encounters/095.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/096.json b/res/field/encounters/096.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/096.json +++ b/res/field/encounters/096.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/097.json b/res/field/encounters/097.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/097.json +++ b/res/field/encounters/097.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/098.json b/res/field/encounters/098.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/098.json +++ b/res/field/encounters/098.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/099.json b/res/field/encounters/099.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/099.json +++ b/res/field/encounters/099.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/100.json b/res/field/encounters/100.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/100.json +++ b/res/field/encounters/100.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/101.json b/res/field/encounters/101.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/101.json +++ b/res/field/encounters/101.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/102.json b/res/field/encounters/102.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/102.json +++ b/res/field/encounters/102.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/103.json b/res/field/encounters/103.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/103.json +++ b/res/field/encounters/103.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/104.json b/res/field/encounters/104.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/104.json +++ b/res/field/encounters/104.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/105.json b/res/field/encounters/105.json index e68d32ead3..4933c48c1e 100644 --- a/res/field/encounters/105.json +++ b/res/field/encounters/105.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/106.json b/res/field/encounters/106.json index 916141d087..446586db96 100644 --- a/res/field/encounters/106.json +++ b/res/field/encounters/106.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 11 + } +} \ No newline at end of file diff --git a/res/field/encounters/107.json b/res/field/encounters/107.json index 2cd66038a0..ad4e104c15 100644 --- a/res/field/encounters/107.json +++ b/res/field/encounters/107.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 11 + } +} \ No newline at end of file diff --git a/res/field/encounters/108.json b/res/field/encounters/108.json index fd646d18f5..f956aac726 100644 --- a/res/field/encounters/108.json +++ b/res/field/encounters/108.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 11 + } +} \ No newline at end of file diff --git a/res/field/encounters/109.json b/res/field/encounters/109.json index fd646d18f5..f956aac726 100644 --- a/res/field/encounters/109.json +++ b/res/field/encounters/109.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 11 + } +} \ No newline at end of file diff --git a/res/field/encounters/110.json b/res/field/encounters/110.json index 92019f23f1..1e6bf0b96a 100644 --- a/res/field/encounters/110.json +++ b/res/field/encounters/110.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 11 + } +} \ No newline at end of file diff --git a/res/field/encounters/111.json b/res/field/encounters/111.json index 92019f23f1..1e6bf0b96a 100644 --- a/res/field/encounters/111.json +++ b/res/field/encounters/111.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 11 + } +} \ No newline at end of file diff --git a/res/field/encounters/112.json b/res/field/encounters/112.json index 2b24ad2437..add49226d9 100644 --- a/res/field/encounters/112.json +++ b/res/field/encounters/112.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 12 + } +} \ No newline at end of file diff --git a/res/field/encounters/113.json b/res/field/encounters/113.json index 460de49245..3996b81540 100644 --- a/res/field/encounters/113.json +++ b/res/field/encounters/113.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 12 + } +} \ No newline at end of file diff --git a/res/field/encounters/114.json b/res/field/encounters/114.json index 8f501394f2..05e5a9830d 100644 --- a/res/field/encounters/114.json +++ b/res/field/encounters/114.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 13 + } +} \ No newline at end of file diff --git a/res/field/encounters/115.json b/res/field/encounters/115.json index a132ecf078..737dba9fdc 100644 --- a/res/field/encounters/115.json +++ b/res/field/encounters/115.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 13 + } +} \ No newline at end of file diff --git a/res/field/encounters/116.json b/res/field/encounters/116.json index a7ba1d8f35..85e4e131d8 100644 --- a/res/field/encounters/116.json +++ b/res/field/encounters/116.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 13 + } +} \ No newline at end of file diff --git a/res/field/encounters/117.json b/res/field/encounters/117.json index 22c21f4915..54ffaac63c 100644 --- a/res/field/encounters/117.json +++ b/res/field/encounters/117.json @@ -205,5 +205,28 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [ + "SPECIES_CLEFAIRY", + "SPECIES_JIGGLYPUFF", + "SPECIES_MEOWTH", + "SPECIES_CHANSEY", + "SPECIES_DITTO", + "SPECIES_EEVEE", + "SPECIES_CLEFFA", + "SPECIES_IGGLYBUFF", + "SPECIES_MARILL", + "SPECIES_AZURILL", + "SPECIES_PLUSLE", + "SPECIES_MINUN", + "SPECIES_CASTFORM", + "SPECIES_BONSLY", + "SPECIES_MIME_JR", + "SPECIES_HAPPINY" + ], + "map_category": { + "map_type": "dungeon", + "map_number": 14 + } +} \ No newline at end of file diff --git a/res/field/encounters/118.json b/res/field/encounters/118.json index f65babd923..3bf5f095cb 100644 --- a/res/field/encounters/118.json +++ b/res/field/encounters/118.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_LUMINEON" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 9 + } +} \ No newline at end of file diff --git a/res/field/encounters/119.json b/res/field/encounters/119.json index d33a8e4ffd..1d75aae421 100644 --- a/res/field/encounters/119.json +++ b/res/field/encounters/119.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 15 + } +} \ No newline at end of file diff --git a/res/field/encounters/120.json b/res/field/encounters/120.json index a78604408b..c5b434b069 100644 --- a/res/field/encounters/120.json +++ b/res/field/encounters/120.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 15 + } +} \ No newline at end of file diff --git a/res/field/encounters/121.json b/res/field/encounters/121.json index a78604408b..c5b434b069 100644 --- a/res/field/encounters/121.json +++ b/res/field/encounters/121.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 15 + } +} \ No newline at end of file diff --git a/res/field/encounters/122.json b/res/field/encounters/122.json index ba30327266..66ae375543 100644 --- a/res/field/encounters/122.json +++ b/res/field/encounters/122.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 15 + } +} \ No newline at end of file diff --git a/res/field/encounters/123.json b/res/field/encounters/123.json index ba30327266..66ae375543 100644 --- a/res/field/encounters/123.json +++ b/res/field/encounters/123.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 15 + } +} \ No newline at end of file diff --git a/res/field/encounters/124.json b/res/field/encounters/124.json index 880f2daa38..eeeffa2872 100644 --- a/res/field/encounters/124.json +++ b/res/field/encounters/124.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 15 + } +} \ No newline at end of file diff --git a/res/field/encounters/125.json b/res/field/encounters/125.json index 577dee485a..3b6d84b7a0 100644 --- a/res/field/encounters/125.json +++ b/res/field/encounters/125.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 16 + } +} \ No newline at end of file diff --git a/res/field/encounters/126.json b/res/field/encounters/126.json index 577dee485a..3b6d84b7a0 100644 --- a/res/field/encounters/126.json +++ b/res/field/encounters/126.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 16 + } +} \ No newline at end of file diff --git a/res/field/encounters/127.json b/res/field/encounters/127.json index 577dee485a..3b6d84b7a0 100644 --- a/res/field/encounters/127.json +++ b/res/field/encounters/127.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 16 + } +} \ No newline at end of file diff --git a/res/field/encounters/128.json b/res/field/encounters/128.json index 577dee485a..3b6d84b7a0 100644 --- a/res/field/encounters/128.json +++ b/res/field/encounters/128.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 16 + } +} \ No newline at end of file diff --git a/res/field/encounters/129.json b/res/field/encounters/129.json index 577dee485a..3b6d84b7a0 100644 --- a/res/field/encounters/129.json +++ b/res/field/encounters/129.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 16 + } +} \ No newline at end of file diff --git a/res/field/encounters/130.json b/res/field/encounters/130.json index 577dee485a..3b6d84b7a0 100644 --- a/res/field/encounters/130.json +++ b/res/field/encounters/130.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 16 + } +} \ No newline at end of file diff --git a/res/field/encounters/131.json b/res/field/encounters/131.json index 577dee485a..3b6d84b7a0 100644 --- a/res/field/encounters/131.json +++ b/res/field/encounters/131.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 16 + } +} \ No newline at end of file diff --git a/res/field/encounters/132.json b/res/field/encounters/132.json index 6b1aa99519..90379c3226 100644 --- a/res/field/encounters/132.json +++ b/res/field/encounters/132.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 16 + } +} \ No newline at end of file diff --git a/res/field/encounters/133.json b/res/field/encounters/133.json index 577dee485a..3b6d84b7a0 100644 --- a/res/field/encounters/133.json +++ b/res/field/encounters/133.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 16 + } +} \ No newline at end of file diff --git a/res/field/encounters/134.json b/res/field/encounters/134.json index 24b83ffa48..86e58e4308 100644 --- a/res/field/encounters/134.json +++ b/res/field/encounters/134.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_SEAKING" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 17 + } +} \ No newline at end of file diff --git a/res/field/encounters/135.json b/res/field/encounters/135.json index 0ac3580467..4988dab355 100644 --- a/res/field/encounters/135.json +++ b/res/field/encounters/135.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_SEAKING" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 17 + } +} \ No newline at end of file diff --git a/res/field/encounters/136.json b/res/field/encounters/136.json index f75f834465..279f141b84 100644 --- a/res/field/encounters/136.json +++ b/res/field/encounters/136.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_SEAKING" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 18 + } +} \ No newline at end of file diff --git a/res/field/encounters/137.json b/res/field/encounters/137.json index da4f64468c..88437c091d 100644 --- a/res/field/encounters/137.json +++ b/res/field/encounters/137.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_SEAKING" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 19 + } +} \ No newline at end of file diff --git a/res/field/encounters/138.json b/res/field/encounters/138.json index 54a35b53a6..751862a5b8 100644 --- a/res/field/encounters/138.json +++ b/res/field/encounters/138.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 10 + } +} \ No newline at end of file diff --git a/res/field/encounters/139.json b/res/field/encounters/139.json index b254b37343..08dd025a3a 100644 --- a/res/field/encounters/139.json +++ b/res/field/encounters/139.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 11 + } +} \ No newline at end of file diff --git a/res/field/encounters/140.json b/res/field/encounters/140.json index 521435e154..1aa938ab74 100644 --- a/res/field/encounters/140.json +++ b/res/field/encounters/140.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 12 + } +} \ No newline at end of file diff --git a/res/field/encounters/141.json b/res/field/encounters/141.json index 51b47b21a5..3d5ccdf651 100644 --- a/res/field/encounters/141.json +++ b/res/field/encounters/141.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 13 + } +} \ No newline at end of file diff --git a/res/field/encounters/142.json b/res/field/encounters/142.json index a42a49d2a9..e849d753c6 100644 --- a/res/field/encounters/142.json +++ b/res/field/encounters/142.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_SEAKING" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 14 + } +} \ No newline at end of file diff --git a/res/field/encounters/143.json b/res/field/encounters/143.json index b33078a8f8..b79a2e1107 100644 --- a/res/field/encounters/143.json +++ b/res/field/encounters/143.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_SEAKING" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 15 + } +} \ No newline at end of file diff --git a/res/field/encounters/144.json b/res/field/encounters/144.json index 020bc9cc09..6aec343811 100644 --- a/res/field/encounters/144.json +++ b/res/field/encounters/144.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_SEAKING" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 16 + } +} \ No newline at end of file diff --git a/res/field/encounters/145.json b/res/field/encounters/145.json index b6362ef787..d69f0773a3 100644 --- a/res/field/encounters/145.json +++ b/res/field/encounters/145.json @@ -205,5 +205,25 @@ "level_min": 40, "species": "SPECIES_LUMINEON" } - ] -} + ], + "special_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "specialnatdex_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "map_category": { + "map_type": "field", + "map_number": 17 + } +} \ No newline at end of file diff --git a/res/field/encounters/146.json b/res/field/encounters/146.json index 1ffbb54932..f222fc077e 100644 --- a/res/field/encounters/146.json +++ b/res/field/encounters/146.json @@ -205,5 +205,25 @@ "level_min": 40, "species": "SPECIES_WHISCASH" } - ] -} + ], + "special_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "specialnatdex_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "map_category": { + "map_type": "field", + "map_number": 18 + } +} \ No newline at end of file diff --git a/res/field/encounters/147.json b/res/field/encounters/147.json index b341d68654..c803247481 100644 --- a/res/field/encounters/147.json +++ b/res/field/encounters/147.json @@ -205,5 +205,25 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "specialnatdex_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "map_category": { + "map_type": "field", + "map_number": 19 + } +} \ No newline at end of file diff --git a/res/field/encounters/148.json b/res/field/encounters/148.json index 86cce7df50..b61a410e75 100644 --- a/res/field/encounters/148.json +++ b/res/field/encounters/148.json @@ -205,5 +205,25 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "specialnatdex_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "map_category": { + "map_type": "field", + "map_number": 20 + } +} \ No newline at end of file diff --git a/res/field/encounters/149.json b/res/field/encounters/149.json index cd10a66c99..77869b5740 100644 --- a/res/field/encounters/149.json +++ b/res/field/encounters/149.json @@ -205,5 +205,25 @@ "level_min": 40, "species": "SPECIES_SEAKING" } - ] -} + ], + "special_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "specialnatdex_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "map_category": { + "map_type": "field", + "map_number": 21 + } +} \ No newline at end of file diff --git a/res/field/encounters/150.json b/res/field/encounters/150.json index 9af647be9f..4b68e4c867 100644 --- a/res/field/encounters/150.json +++ b/res/field/encounters/150.json @@ -205,5 +205,25 @@ "level_min": 40, "species": "SPECIES_SEAKING" } - ] -} + ], + "special_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "specialnatdex_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "map_category": { + "map_type": "field", + "map_number": 22 + } +} \ No newline at end of file diff --git a/res/field/encounters/151.json b/res/field/encounters/151.json index 5ffae7f4b8..a4eee59f4d 100644 --- a/res/field/encounters/151.json +++ b/res/field/encounters/151.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 20 + } +} \ No newline at end of file diff --git a/res/field/encounters/152.json b/res/field/encounters/152.json index 5ffae7f4b8..a4eee59f4d 100644 --- a/res/field/encounters/152.json +++ b/res/field/encounters/152.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 20 + } +} \ No newline at end of file diff --git a/res/field/encounters/153.json b/res/field/encounters/153.json index 33ee5d4392..40ee24aa2e 100644 --- a/res/field/encounters/153.json +++ b/res/field/encounters/153.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 20 + } +} \ No newline at end of file diff --git a/res/field/encounters/154.json b/res/field/encounters/154.json index fb95fcd355..d8d7665d58 100644 --- a/res/field/encounters/154.json +++ b/res/field/encounters/154.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 20 + } +} \ No newline at end of file diff --git a/res/field/encounters/155.json b/res/field/encounters/155.json index 218ce6ff39..b9d2254ea7 100644 --- a/res/field/encounters/155.json +++ b/res/field/encounters/155.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "dungeon", + "map_number": 20 + } +} \ No newline at end of file diff --git a/res/field/encounters/156.json b/res/field/encounters/156.json index d46cba82bf..dccde52d81 100644 --- a/res/field/encounters/156.json +++ b/res/field/encounters/156.json @@ -205,5 +205,25 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "specialnatdex_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "map_category": { + "map_type": "field", + "map_number": 23 + } +} \ No newline at end of file diff --git a/res/field/encounters/157.json b/res/field/encounters/157.json index 6e0c42af6a..dd6ff61ac5 100644 --- a/res/field/encounters/157.json +++ b/res/field/encounters/157.json @@ -205,5 +205,25 @@ "level_min": 40, "species": "SPECIES_WHISCASH" } - ] -} + ], + "special_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "specialnatdex_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "map_category": { + "map_type": "field", + "map_number": 24 + } +} \ No newline at end of file diff --git a/res/field/encounters/158.json b/res/field/encounters/158.json index 1a04c32bb6..5776f0289b 100644 --- a/res/field/encounters/158.json +++ b/res/field/encounters/158.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 25 + } +} \ No newline at end of file diff --git a/res/field/encounters/159.json b/res/field/encounters/159.json index 57e320947f..dc5fe30aa2 100644 --- a/res/field/encounters/159.json +++ b/res/field/encounters/159.json @@ -205,5 +205,25 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "specialnatdex_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "map_category": { + "map_type": "field", + "map_number": 26 + } +} \ No newline at end of file diff --git a/res/field/encounters/160.json b/res/field/encounters/160.json index 2b737e5960..82f96b1a98 100644 --- a/res/field/encounters/160.json +++ b/res/field/encounters/160.json @@ -205,5 +205,25 @@ "level_min": 40, "species": "SPECIES_SEAKING" } - ] -} + ], + "special_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "specialnatdex_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "map_category": { + "map_type": "field", + "map_number": 27 + } +} \ No newline at end of file diff --git a/res/field/encounters/161.json b/res/field/encounters/161.json index 43beb99213..a290546313 100644 --- a/res/field/encounters/161.json +++ b/res/field/encounters/161.json @@ -205,5 +205,25 @@ "level_min": 40, "species": "SPECIES_OCTILLERY" } - ] -} + ], + "special_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "specialnatdex_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "map_category": { + "map_type": "field", + "map_number": 28 + } +} \ No newline at end of file diff --git a/res/field/encounters/162.json b/res/field/encounters/162.json index efd7fabffb..f8ea5d5201 100644 --- a/res/field/encounters/162.json +++ b/res/field/encounters/162.json @@ -205,5 +205,25 @@ "level_min": 40, "species": "SPECIES_OCTILLERY" } - ] -} + ], + "special_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "specialnatdex_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "map_category": { + "map_type": "field", + "map_number": 29 + } +} \ No newline at end of file diff --git a/res/field/encounters/163.json b/res/field/encounters/163.json index 97255b806d..e17fe0375c 100644 --- a/res/field/encounters/163.json +++ b/res/field/encounters/163.json @@ -205,5 +205,25 @@ "level_min": 40, "species": "SPECIES_SEAKING" } - ] -} + ], + "special_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "specialnatdex_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "map_category": { + "map_type": "field", + "map_number": 30 + } +} \ No newline at end of file diff --git a/res/field/encounters/164.json b/res/field/encounters/164.json index 133fc12979..e84c68cea2 100644 --- a/res/field/encounters/164.json +++ b/res/field/encounters/164.json @@ -205,5 +205,25 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "specialnatdex_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "map_category": { + "map_type": "field", + "map_number": 31 + } +} \ No newline at end of file diff --git a/res/field/encounters/165.json b/res/field/encounters/165.json index 3624cc60bc..4e495bd957 100644 --- a/res/field/encounters/165.json +++ b/res/field/encounters/165.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 32 + } +} \ No newline at end of file diff --git a/res/field/encounters/166.json b/res/field/encounters/166.json index 8b854b2010..78326c04f8 100644 --- a/res/field/encounters/166.json +++ b/res/field/encounters/166.json @@ -205,5 +205,11 @@ "level_min": 0, "species": "SPECIES_NONE" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 33 + } +} \ No newline at end of file diff --git a/res/field/encounters/167.json b/res/field/encounters/167.json index 1393cfb40b..328f15dd92 100644 --- a/res/field/encounters/167.json +++ b/res/field/encounters/167.json @@ -205,5 +205,25 @@ "level_min": 40, "species": "SPECIES_LUMINEON" } - ] -} + ], + "special_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "specialnatdex_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "map_category": { + "map_type": "field", + "map_number": 34 + } +} \ No newline at end of file diff --git a/res/field/encounters/168.json b/res/field/encounters/168.json index f1193ca5c6..b5fa375dde 100644 --- a/res/field/encounters/168.json +++ b/res/field/encounters/168.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_LUMINEON" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 35 + } +} \ No newline at end of file diff --git a/res/field/encounters/169.json b/res/field/encounters/169.json index 3ed1cf4af8..ceeb25a912 100644 --- a/res/field/encounters/169.json +++ b/res/field/encounters/169.json @@ -205,5 +205,25 @@ "level_min": 40, "species": "SPECIES_LUMINEON" } - ] -} + ], + "special_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "specialnatdex_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "map_category": { + "map_type": "field", + "map_number": 36 + } +} \ No newline at end of file diff --git a/res/field/encounters/170.json b/res/field/encounters/170.json index 091eb14c58..6c018b2a1c 100644 --- a/res/field/encounters/170.json +++ b/res/field/encounters/170.json @@ -205,5 +205,25 @@ "level_min": 40, "species": "SPECIES_OCTILLERY" } - ] -} + ], + "special_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "specialnatdex_encounters": [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" + ], + "map_category": { + "map_type": "field", + "map_number": 37 + } +} \ No newline at end of file diff --git a/res/field/encounters/171.json b/res/field/encounters/171.json index b8952ea025..cdaffc9aec 100644 --- a/res/field/encounters/171.json +++ b/res/field/encounters/171.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_OCTILLERY" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 38 + } +} \ No newline at end of file diff --git a/res/field/encounters/172.json b/res/field/encounters/172.json index 5520e20a33..36f912b3db 100644 --- a/res/field/encounters/172.json +++ b/res/field/encounters/172.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_WHISCASH" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 39 + } +} \ No newline at end of file diff --git a/res/field/encounters/173.json b/res/field/encounters/173.json index ec22878414..4c4972a4d9 100644 --- a/res/field/encounters/173.json +++ b/res/field/encounters/173.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_WHISCASH" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 40 + } +} \ No newline at end of file diff --git a/res/field/encounters/174.json b/res/field/encounters/174.json index 1744b3bd0f..824c555891 100644 --- a/res/field/encounters/174.json +++ b/res/field/encounters/174.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_WHISCASH" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 41 + } +} \ No newline at end of file diff --git a/res/field/encounters/175.json b/res/field/encounters/175.json index ddc8969484..08e4042637 100644 --- a/res/field/encounters/175.json +++ b/res/field/encounters/175.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_SEAKING" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 42 + } +} \ No newline at end of file diff --git a/res/field/encounters/176.json b/res/field/encounters/176.json index e2530b7d84..8da1248f21 100644 --- a/res/field/encounters/176.json +++ b/res/field/encounters/176.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_SEAKING" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 43 + } +} \ No newline at end of file diff --git a/res/field/encounters/177.json b/res/field/encounters/177.json index 114d8cd8f3..0898bd536c 100644 --- a/res/field/encounters/177.json +++ b/res/field/encounters/177.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_SEAKING" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 44 + } +} \ No newline at end of file diff --git a/res/field/encounters/178.json b/res/field/encounters/178.json index d6df75c4bf..a6ca358b85 100644 --- a/res/field/encounters/178.json +++ b/res/field/encounters/178.json @@ -205,5 +205,11 @@ "level_min": 1, "species": "SPECIES_MAGIKARP" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 45 + } +} \ No newline at end of file diff --git a/res/field/encounters/179.json b/res/field/encounters/179.json index bf0947303a..dc9c98c9b6 100644 --- a/res/field/encounters/179.json +++ b/res/field/encounters/179.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_LUMINEON" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 46 + } +} \ No newline at end of file diff --git a/res/field/encounters/180.json b/res/field/encounters/180.json index ce0011dcd7..9f8c46c5d6 100644 --- a/res/field/encounters/180.json +++ b/res/field/encounters/180.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_WAILORD" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 47 + } +} \ No newline at end of file diff --git a/res/field/encounters/181.json b/res/field/encounters/181.json index e11e72847d..110ac1e25c 100644 --- a/res/field/encounters/181.json +++ b/res/field/encounters/181.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_SEADRA" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 48 + } +} \ No newline at end of file diff --git a/res/field/encounters/182.json b/res/field/encounters/182.json index da6071f057..a1c3b9f724 100644 --- a/res/field/encounters/182.json +++ b/res/field/encounters/182.json @@ -205,5 +205,11 @@ "level_min": 40, "species": "SPECIES_WAILORD" } - ] -} + ], + "special_encounters": [], + "specialnatdex_encounters": [], + "map_category": { + "map_type": "field", + "map_number": 49 + } +} \ No newline at end of file diff --git a/res/prebuilt/application/zukanlist/zkn_data/meson.build b/res/prebuilt/application/zukanlist/zkn_data/meson.build index 8b1fd89c98..ae91d0fc68 100644 --- a/res/prebuilt/application/zukanlist/zkn_data/meson.build +++ b/res/prebuilt/application/zukanlist/zkn_data/meson.build @@ -1,7 +1,6 @@ prebuilt_files = [ 'zukan_enc_diamond.narc', - 'zukan_enc_pearl.narc', - 'zukan_enc_platinum.narc' + 'zukan_enc_pearl.narc' ] foreach f : prebuilt_files @@ -44,5 +43,20 @@ pokedex_data_giratina_altered_narc = custom_target('zukan_data_gira.narc', ] ) +pokedex_enc_platinum_narc = custom_target('zukan_enc_platinum.narc', + output: 'zukan_enc_platinum.narc', + input: personal_files, + env: json2bin_env, + depends: [ py_consts_generators ], + command: [ + make_pokedex_enc_platinum_py, + '--knarc', knarc_exe, + '--source-dir', '@CURRENT_SOURCE_DIR@', + '--private-dir', '@PRIVATE_DIR@', + '--output-dir', '@OUTDIR@' + ] +) + nitrofs_files += pokedex_data_narc nitrofs_files += pokedex_data_giratina_altered_narc +nitrofs_files += pokedex_enc_platinum_narc diff --git a/res/prebuilt/application/zukanlist/zkn_data/zukan_enc_platinum.narc b/res/prebuilt/application/zukanlist/zkn_data/zukan_enc_platinum.narc deleted file mode 100644 index a3a8ea7d906911f67d41e7cd661bf65d0ebc8044..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 71460 zcmeI*PfWazf#3J}+1MU?$2Rtk?Xj2aj(5o}*_|Y8N*mhHl-*1=q$S&FI!z`Ul9H6P zG$9FXNK0GP5(%kDMJiHJic$_7IB?*=fdi^Ia6lDpk&0BRa^OHE4jede;J^VTeZPNv zo_LJm3%|eiTHi-{ecvUZSG#fXl~PIDTQTi$~LQj;bD$z?-jT%*7)T#Po zfT|ILR6{XLH4>v#%^0I6BAUEF--v5qq>g=s{YEOajJH7 zs3u~PYAU9wW@46VF6OBgVv%YomZ?@^m1;dUskUO9YA1H7_F|vvAP%XH;+X0rPN~k~ zoa!PjsjlLh>LzZf?&6;6A$q>fv4~3aQdOfy)faWD{urQY#30pBj8Kh6lWHu+sanyd z>cj-qRLoG##XQwQEK)7SGSzCVQLV=Y)n;r_ZO0zfejHF8#u3$VoKT&|1=VF-Q{BcL z)qOlrmA>()hpHSEs@|wl)uNB89{p4U(V!ZPA*$gRrE10))p)e1+R>q!h)Jrcn5LSE zS*p31r&@?bs-;+_T8UMvwOFUxh)t@k*rwWzeX7GaraFx?s`I#@x{NET>$su1jXSFQ zc%UkM^HC2~IVx1WQKhOyA5}g2sRp7!H5fxw!!bfN8cnM4Xi>GJLp2eTR8uicH5>C( z3$aMG6w6dAu}ZZb8&sRIO|=udRC}>cbr6SCM{!Jb5~oyWaZYs+msD4AO?4BuRCjSt zRq1_Hr|ORZszwY_4aG3kNQ_c7V~lD%T2$@mP))`()od(KEyXg`N~}_?#X8kSY*KB- zHq}n-Qtib))j=Fm9mO%#Nt{xh#W~eQTvA=dHPubrQr*Qp)kBoN#rq6BQKqUyFI6@A zs2VXyH4-hVPE1lw#WdAS%u&t90@Y$HQ7y*`)oQF!t;Yt{W^7UI#4god>{A`YA=ObF zQ=P^c)p=Y{UB(sFZQN1aNBP@qUsR(;)faWD{urPdjA5#g7^P~)7*#9URGpZhnv5x` z>6oFKjXA2tSf*NuRjRdEr`m{3s;$_j+KFANz1XKZh(oHQIHo#@Q>wE#r@Dwss;juB zx`|t=ySS%%h?3vC(Gz8=O7v2-qD|F_398AMqMD8ws@a&MnvVsl#aNS9I*3E6qd2BIiBqbxIH$UZORB55rn-q+s=KIGd2e7OMyZ-HMl~KS zs&;g!CSsCmDyFFxV}oilwy3sahiW(WsP^N4>M)L|PU4K}JT9m%S5+K&UO!#JWk zjuWcWIH$Ud8>;(wpz8VVqcT+`da3$jm}(?OshTlH)rvM%Cnl&SW0`6<_Nflykm@Lo zsZQdQ>MYKwF5;5vDz2$+;+EE2`_brMioIs)s1m_&h>Sl&Pvwqw0$~ReuanHDZ`*Bu1&mqD9q?4%I|V zQccA))lAG%&BZ*`LM&1(#WK}OtWvGTI@M-uQEkT#)o$!j?Z*MtVH{B%#|hPGoKc;} z1=VF-QC-Ik)ot8S-Nyq}>HCj*sLIhxRf{^+Knzk1#W2-Kj8ZjYjA}euRPE?cO~fSC zR7_LN#4OcZ%u_AIBGpnXQ?0}*)mp4mZNw(kR_svi#vavv98ev`5!G>=Qk};I)n!~! zUB?a8ZQN5mMCk|YHr&JelMRgrFRJUn{DYAnX7TG6KJ#01r3Oi@k84ApGRQ7yy@)oN@| z?ZzI}ejHF8#u3#?oKl^|In_m6QeDM0)lJ+|-NilCL-h2qe^8DJRc})uW$kAR1JIF+?>SBUGc&q#BEH zs#dhAIx#^t8BY*w}g{n8IRJG`%sz*Q7Ks2a^ zVuWfe+EksGq?(Fps+m}%T8nk6jo75xiXE!m*rVEy1FEa2{E+oUHEL9SQK#yU0jfp} zQVqp0)kus|HDiowJX%zpn53GDX{wo+rJ9R*s)bmjT8d?=l~|=(i*>54*rnQweX4^v zq&kXYs*^aQx`<1vtGK4RiCe0>xTkuE(yx|E>WK{A`a5!G>=P@TpZ)p=Y{ zUB(sFb=*+h#vRptJW!Q>?NJX^IeMw8QKRaMI#quRP&HzZYAA-OMq-qz8DmuA(V}Wc zhiW1wsitC@Y9?l>=3<^|A(p6CVvTAeHmSB^n`$R^srF)@>L3oOj^dc=Bu=T$;+*Ot zE~&2Kn(8KQsqW&Q>LE(~>{s+enW_@KRJG`%sz*Q7Ks2ZZV~A=bnp9&kPSuJwRVOB> zred0ECg!N-V}WWhmZ+9vg=#g{sMceHYBRQ|wqu8CH})uW$kFovl{VvMR4ZK{cwq?(Fps+pLjnu~d=g;=Coie;*m zSfyHvb*hcnq}qyYs-4)S+KYXvgE*u*iesviIHfv^bE=EDq`Hb5s)s23I{OKgs8bEZ zAk|O|Q;kHEYAnX7TG6KJ#01r3Oi@k84ApGRQ7yzG)lw`|t;8zTTC7uT#un9f>`?8- z9@SwSQ60xQ)m2U`qn~OZ8dQTZL^T{ERHMLgC7 z&f=WvA}* zR7=P@TpZ)p=Y{UB(sF zb=*+h#vRptJW!Q>>roF?IVx1WQKhOyA5}g2sRp7!H59{CBhjQ9k2X~&Ca5N3ifTG$ zsAgl1YCaaI7GsHOIaa7vV~uJ(HmJ5@n`$R^srF)@>L3oOj^dc=Bu=T$;+*OtE~&2K zn(8KQsqW&Q>LE%E_A7d#OjU_qs%q4z`l3$N9|Kg47^E7CVXBcBrE10))p)e1+R>q! zh)Jrcn5LSEIjZ?spjwP2s^wUrT8%ZT_1K`=j4i6|*rD2uJ*xdUpgN2rs^d7JI*l`` z^SGe8j4P_^xS_g@JF5G5pep_GM?F;Ks8IDrm8uqfRQ2em8i)qfU<^?W#|YJEG^xg7 zoT?RVs!mK$O~w?}bj(oA#vIjrEKn`R64i37P_4!q)p~4DZN?VWcI;5?#vavv98ev` zG1W<&Qk}&))kR!VUBwO6ZQN1a#{*UAPdw_ODo2H?H>y;%=%cDfKh;1qs0L$*YB)xy zMx#kJ7UNW{Xj64!f@(6RsHS6vYBuJm=3{|sF_x&7V})up)~MEFgK9IjsJ3H=YB%<% z_Tzx+Fpj8B;*{zvE~qZ!it0LUsP5vP>LE&hlKqUHC{tCUm#P{ys=laG^~V5JBL=C4 zVwh?qMyZ-HMl~KSs&;g!CSsCmDyFGsVvcG)7O9qEg=#g{sMceHYBRQ|wqu8CH}N2jVuH%O4HtwkIzt5nvNN&*_fl6j|Hm5SfW~v6{@vZr`m{3s;$_j z+KFANz1XKZj3cV!IH5X=bE=!@`EB+O%2A=}jT%*7)T#PofT|HgRKqbs)r>K!@n})C zqeC?jlT=eNO*Ip9R12|4wG_)#E3rzo7CTgXu}^gnhg3&#Omz}xROfL)bs1MwH*rgK z7xz>TQTbDBe^jGJ)gJ>?jTodFieajeXi|;EI8`g!RGpZhnu-~!xmcuHj#aAl*r3{s zEvoI0f=+LsgCnRc}JOjFIoEY)1hQ!T_I)lw`|t;8zTdTdZ_#un9f>{9K;KGi`S zQ60w#)oGklUBo5TRa{fu#4Xib+*6hQwMS*DO7v3IqE6Kx15|@COf?dtRLvNp8jluL zJ33SoF-bKQ(^NAtOEnksR12|4wG_)#E3rzo7VA_Su}QTR+f+NTOSKpKREKdybrNS( z=W#)G8P`;|@jzAj(~o+n%2A=}jVe_w`l#yBPc;w?s=*kd8jcaF(P&bQ#W+ zYpR>LrMiy?s?zYI9;!-IscO+jRgZqEfoM<-#t_wTj8Kh6ld2VMs!mK&O~nk=Tr5y6 z#uC*^tWmAU2GwS4QSHPo)qWgO9mgrvd0bFk#ue2~+)~}eJ=H^${&luHdZJ8KiC(H| z)TsKRPSqa+RE-#<8j4}6kr<_F#u(Ljw5ZzAp_+(Es;QW!nu%GextOQAj4P_^xS_g@ zJF5G5pep?vk9w%eQK9OMDpf7|sQP1osu9Cf%^0Vej47(=n4y}DIjZ?spjwP2s^wUr zT8%ZT_1K`=j4i6|*rD2uJ*vYvqB@Qfs?#{5x`->P>$ssB_%n~DsHS6vYBuJm7Gs5K zH8!ZWVw>t9PN~k~lIkXIsTw1X7N}NZmufGLsE*@=>NGB>uHu^NCT^+j;-2auO8+Lu zA$p@qRf|5Vdh}BbM1yKDhNy;PglaUJRAVtt)rvONL`+i6!~)eytW#~oCe?QAQe8y( z&+=YFHELA#7^E7C5vpd4QH{qX)$G6ZXpU+=7N{0uiE24ks8(Z*YCSfnHe-uwJ9emc zV~=V-4yX>}i0U{_s7~XI>O3x}F5`;oI&P?LCe zYA}YVhGT?kG@4Xn(WdIeB-K<*Q_aLI)m+R|EyN<#Qmjy|#v0XnY*1~+7S(p_QSHY8 z)nOb{ox~~CSzJ(E#ue3d+*3V7>32#c^+cJf8a1lEXj09@EY(~rQmw=))mp4mZNw(k zR%}!4#4god>{A`YA=ObFQ=P;q)mfZVUBo5TRa{fu#4Xib+*3V7>37+F=!r5_C3>l< zQKRaM2GvkBsm5c1YBHv%relU`Hs+}2V}WWXE~u{Kmg+7ZsCxd~qcT+`da0^Wqw0$~ zReuanHDZuzD2AyGV^rhOqH0HnY9eN-=3<^|Ar`5YVuflg_Nflykm@Losm|h( z>L%`~9-`Fb_&`sTsVdP+RgFHX{%BAQ#t_wTj8Kin1l4>jQZ2^{)oQF!t;Yt{W^7Sy z#}3tQ>{0E<0o7p~Q60w#)oGkjoyP^$Ra{fu#4XibJW!SY{G$q0Z&ayj(MMH}eyV|J zPz}Zq)o_eZjYgAdEXJu?(WdIe1l43rQBB7T)lzIwZN@RxMLbZIfA3M9Y9Ja^qtT=q zi*c$}w5d8VK{XjuRMRm>wH#Yi+p$A+8uwHWQThwKKhP6ps!H@yRij4L7Xws{7^E7B zQL1K)QH{q0)nrUjO~(w?Y|K&3#{$(-EK{w-8r6DiP#wh$)m`+Au`N)J3RQ1ZscO+j zRgZqEfoM<-#t_wTj8Kh6lWHu+sanyd>cj-qWK2;_#|+hM%u&t90@Y$HQ7y*`)oR>R zJw)j*a{Qnt%2bu;rK(1asxRtP{V_n*h(W5M7@-=CCRHmYsHS3`Y9SV>mSUM|C041{ zVx4LuHmSB^n`$R^srF)@>L3oOj^dc=B+jWW;*#nruBmR~j_M&w|2F#rJuynP5Q|hx zu}rlR>r`8@O|=&XREKd!bsaZU_tEq3uq-G?lWHxtsgC1>>LMK!@n})CqeC?jlT=eNO*Ip9RP(V!wH8}cyRk>L zABR-OaYt4EOOF~r|VuMYSC}RJ*Z9 zwI2sm$8kb+8fR1&aY=O**HpK0M|B?$RF&4FUaD%;sQO}nsu6=!omiw=ie;*`*reKu zZK|EvrP_;qs)IPBI*MbelQ^Y1i*u@rxTLy@YpR>LrMioIs)s23dmP{Bi856sda0^W zqw0$~ReuanHDZuzG{&epF-bKWb5!%OK(!c4RLikKwHk+1w^91btRKozp{hn7RXzHt z2BJYV7(-OUF+w#OO{%dNr)ou;suL4blQBg#9Wzw3F-Nr=D^#noMztOrR9mq_bsA?> z=W#)G88=k-(ev+fte`ilRJG`%sz*Q7Ks2a^VuY$0V^rhOqH0HnYA#l()?<@uE4Hb2 zVwY+!_Nflykm@LosZQdQ>MYKwF5;5vDz2$+;+Eg=s_K96 zsE?{1LsY{tLNyvqs<9ZSYDJr>6BAU^u|TyR8&sQdM0FFlRCjSt^$?}M!hT0jl&LDw zOVt;3s{Rzt5nvNN&*_fl6 zj|Hm5SfaX#TdKRbr+SDF|If%eY_lj+Ric-w8a1lEs8jXF0M%d&Q4L3vsudlo>6oFK zjXA3MSfE;rC936Ep<0bKs`c2Q+Ker#?bxB(jZ3PVxTos*YmdrQmFT6aMvbZ-15}L| zq?(Css-4)S+KYXvqd28Hi%Y8OxS=Zj!J{fwE&8YiqCqts`&1`!Lvcbr6SCM{!Jb z5~oyWaZYs+msD4AO?4BuRCjSt^$?}M$?=4qC{tCUm#P{ys=laG^~V5JBSxuO(WdIe z1l3ebQ_aR4)qE^aEyfbna;#9T#v0XnY*1~+4%Ke#Qys)1)lnQ%ox~~CS)5Z{#1++b z+)&-d9o2n2P?i3}M-{5xs8ZFUPSqa+RE-#-8jcaF(P&Y%qeC?jlT6oFKjXA3MSfE;rC936Ep<0bKs`c2Q+Ker#?Kq%1j3cV!IH5X? zbE?be`P&?OC`W~=H>ycj-qWK2`d#yr(REK)7SGSy0KQys+# z)mfZVUBo5TRa{fu#4Xib+*3V7=|3u!REa88E&8bH(N8rH!&Dsjj0m#r8!{ zG^j>nl4>TFs8(W?YAd#>c4C)mFZQVp;*jbnj;T)Koa!dZe~0%DD$z?d6cbdFF-0{U zGgPxNM>QV{REx1fwHj+wo3TZ;9XnLJu}8HZ2ULe~M0Fe|RHt!9brF|TS8+pi8+TNF z|M8=P@TpZ)p=Y{UB(sFb?p8pyf*e?pXwkEsgB~9>LgC7&f=WvA}*<};+pCvZmI6# zp6Ve=)4X5N6J@GO^iox$M%5Q}s{RSrpKYF4}Rf%4zYSgIuqE6Kx15}L|q#BB0s*xC_YQ`AVc(kb6 z(V?1%Nvf%srkaUas=1h_T8KrerC6p~iB+n#Sf|>EO{%TfrrL>Js=e5!I*3E6qd2BI ziBqbxIH$UZORB55rn-q+s=K(SdWh2BW&fim%2bu;rK(1asxRtP{V_n*h(W5M7^WJD zQL1K)QH@87svRAwiI}9CifO8un5CMFd8&n2q*{t)s+Cx!T8nk6jo75xihHVuDE&RQ zFM6U(Rf%4zYSgIuqE6Kx15}L|q#BB0s*xC_YQ`AVc(kb6u}!rTyHtCzPjwK7R7Y`4 zbrPpkXK_w-5tmd~aZPm-w^Vm=PxTO`8MZHaqD)nZUaD%;sQRK#)gJ>?jTodFieaje z7^P~)7}a>RsM^t?nutlNshFmkiCLwE#r@Dwss;juBx`|t=ySS%%h|=F@ z`=TexRF&wZsz!~fFX~kNF+kObL8_q`rW%P+s%DH)jYo^B9UZEPn53GDX{wo+rJ9R* zs)bmjT8d?=l~|=(i*>4v*reKuZK|EvrP_;qs)IPBI*MbelQ^Y1i*u@rxTLy@YpR>L zrMioIs)s231NJ|9qD)nZUaD%;sQRK#)gJ>?jTodFieaje7^P~)7}a>RsM^t?nutlN zshFmkiCL<-n5SBZMXIG(rdo+rsxTkuE(m!PXqbJH#m6)WOifO8YIHWp?W2%#=&vJaAKL)58F-SEO z!&DR7sm|h@>LM7gU#VMRgswRCjSt z^$z(Ks(SQOHDZuzD2AyGV^rhOqH0HnY9c17red0ECT6MT zVxDR-mZ+9vg=#Ic4C)mFZQVpLzZf?&6;6 zAxd++uh0`^s!H@yRij4L7j>%s7@%szAk|O|Q;ozZRWrt@#-l~mjt6BAUEF-0{UGgPxNM>QV{REx1hwHzx{tFcD49vf7*@jzAjFCO(!m7_vcjXtV+ z^ivH)gK98_sD@*NYBZWuV=+$Ej!CNNn4y}DIjZ?sq*{t)s+Cx!T8nk6jo75xifyW$ z*rnQweX4^vq&kXYs*^aQI*$vg%NY7E*N8M zT8CeYA}YVhGT?kG@4XnF;3NrHdQAks3v2IYC2}9=3{|s zF;=KnV~uJ(HmSB^n`$@qsP^N4>M)L|YX9}4KB{`mQO(B!)nY7DUBo5TRoqhD#XZ$S zl>Qs`CwihxRf%4zYV=Xnqo1k~gH%H?Of?dtRLvNp8jluLJ33SoF-bKYGgPxNM>QV{ zREx1hwH#|y>#;$#8Cz7_u|u^RdsO>zKy?^LRL5~bbsA?>=W#)G8CO)-aYJ<*cU1TB zKvi0J)I(K{3RQ1ZscO+jRmbnPfB*M-nN1H$r4LGf;V=Eg-y2}O!&hsi(wD!*yuS58 z>D%1?cC}Rc!M97LFMYRE`pWl8rSE-(d48u<`h_nu?Jt%}-{tlAuEv-{P?^G0neV_}`fK|B3$#_aBr>{~x`>KgSoi{}ucKzKcHmGJXX=#BbnF!Z-wc{ zzdp_PzViAsU;O6l(|qR*>-E(yzrOBY{DGVBg&mdAU;6&5la#*vy*JF~yRXmZOW%2Y znlFF*gD<`|Rk`=IDR{4Z`-2{)dgt1I^}DaHSLF@UeCs=}A7kJ8*6Zu_&0bgior_%h zg*UAG*WWPBH@^4!@_ge5A8x{TE>QLRU;OZW`mV+PZuRxo`u4Y9U-z$8-Y`x1_5J>Z zw;a#E^xB@_9NPE#@_euM`ZT}v%`be>Q|r4n^e=wx^=&x?lUwnPPf9Gqj?~Ctz{q0_DX)fDSm^ra^h>+L=*_M_|LP^@#YuEqGrM}P8Px6gCK zOXEGRT*vO?#rwtJviaO%Ulij%YF&PZqR#WV+fMU%o$jq44bSa|=f?f$8IQMoZ#*}+ zU40#w<6Zmut<$}nm&O&xNzs?4`!vQE@7a&~T5ny?Vjn*3bIa~I?OlVf`Py;s zelFg-#k`8+t7tL)llG-!>XXj*rRVz|b$G3hQ+>YwzUBBSrYZW;5*Ei~@py6U6!$-^ zx*X2Cc;7qU=f*ky;|#_5vuLp%zD6Q*eB2ICzfX7`@OAZGvOp?Gf;ee)BaOz3&H*oMXOKbhnw?iTOikNVngUGHLfp7tjegc0wr zH=o-oKR&MbY<;OeKK18w?=8npF-_5zmaI4)i^q%OrnvuU)#Y&B#W}$FJ~z(sA7}8K zQv5dJ?PBmXiu>K$qWEpAnC_?DPjbCk9Gg$~rR!8Y_EFdGE$5qe&AWTM7q4B6E3PMt z`^Do=TTJ)Tviv+=clsVF{&rrxSNyw>$FQHVZj+~fKkxp$F5Ux7_I~(7z6Cz3bMYVY z&GOF0=Ra-zv7y+8Py1sNeS$krU+)vl>SyAqKX2>vv#?RSuRC5^p5pj?>G418`_a`4KUf+H7^u1E-f2aGjhPNCOpVn(RpJM$!&3P94=IK12`#${KdE~WY zqL^>-+@i(!;`v3Nj(=(Sis?SDb}x6atj{f5@%v2in9nQ5eO}A@QD4X9E7qxauH&A* zhl=gg z!*4#B!EbPXFyo%ycC^dy_yH8tar09jew{h~_B-bK$MRUwVp7kc9)n&-dEMiGx9Ks@ z|ID?-|D3h-OZa8D4&B?6yC446`Ej4?^ScMPPqA#>x1Gk%R#xSSpX4&L@y z=-wBO@7_M$w|&gx&iAXwobR`5c>c=02$CE?%bGv^>eC_!zgY)p1 z^tdSYU9nCc*KT(Qk0IB|`*l2bJas>hNq%f_eOzXTqL25U|F_r%uK%YsbniFU$9?SJ zZP%;&zPF2G!Q;?v(LEIJqoUo%U~%jg$F1+z;<$AlA7xtiZE;TZxgG-!E|14q_c|5Z z)otB9I1k@r#qss@80lUfxA$}Jzv38lJ3T!PJ&uaw!EM&PzTM}&?qlqyxlGR;^DOqy z%<%O5?t;0@A7}6w>^??3cf56QpT9PIjR~Hcr{{vFgXg2CgWnD6_~FwBa^J_FKGuC4 z7ssW?zQ>{Gvf@1U*6Dc4hlA&V;vC?573aRkM}Kzy?f#r}sfzy{gmoJf$InaSea^dv z?(OD2^RwsI(EYj7{a*I`0`A+Zrih1~4hu5ZYzHc3h?^@l{KR2#;ytsDuGvX~n@%}2Nefl}*x)kf` zInVWVJ&SW+@mc-W={zquy!Ki6IMq+*U)RO+hWoiV-+SJ2{XJe?_Tsqi{vJ^57q3C; z_#xa*zl8?6uMfHViH6^N@@&t0#X05aZ6|g49Y26#I&OaI!*lPM?iVSJx1z;kZtw1M zlIMu-b4l_2!gc80o<9GRJlE%U4{o1g*}88#jmuYDUlw(IaSRlnwT|=l`|rhWi60GL z;bw7OD*B^GfAUsw-YL%6KRLxmAJe_xd{4NK9lZVid-3CMQf}|(-hajC-23mv9xHgmF*6E6Qcb^YjulL`HAFp{ntM9}fn+`?2U0l}`b=+q$6ra`azZd`Ly0EzJ@mkfP z=;OUl_ut=sVRpr}>6dui_w(m96xZ|J*Py<(=Yh}SdvUQ|UgNy~&RcAa#}?nCy2m~@ zu6X?Yciv)4eEj~rf9L)9TjnR9*?o>EzWWv5Rg2@)YlnKC+I?N&IjuPNb>GgUKbGQr zT(o%blYHO(B+o5gzo_4xie>A*?c<-ucV*}EbQ^h`7T0y2JN-`iRrsByxEB0XZu`4S z@jG5|?cDubKVRPZe3!v_cx~zDQ?dVwegFP%$7~da;&bxx-s8W;=XufY_fGMiDSq4W zny>h6$7g?(Y2CN}R#yxj0}k*1cKoCF#Yg?#{@gMDxK)38|N6T`u}?kMIu!T4mVY{Q ze~)l|KF;v|JM`nUU_D*JH`SdX6uSm6ygl?YoBJbIH#Z zKa)PI@69g5`|r$;zu9`-@!C*aqZBRvHu>E1ygqXOJ5BNTlHz&qdaU@aT=cnlzckL* zDLx9?}tdgSTzih2ILf0uslySw}F{ok0M9ud#qFTS&MKl7M?U?Dg8y>+kOC_Tsbpt<(Ks{kw9p4gB2vD*Vj!eg51r?ROlH>*9Myas6Ce{}lVo z&xYc&+Rxwazejg(Xd7x)Zre-_JJ{Eqe9;`*4w4s>3rd`~+`HX>Yj|lMALV>j%;UNLcCmQuv+BEklm0Yc)6cMPKAGWjunk_00 = v3; v2->unk_04 = v4; - v2->unk_08 = sub_02055BA8(fieldSystem); - v2->unk_0C = sub_0206B1F0(v5, 0); - v2->unk_10 = sub_0206B1F0(v5, 1); - v2->unk_14 = sub_0206B1F0(v5, 2); - v2->unk_18 = sub_0206B1F0(v5, 3); + v2->timeOfDay = sub_02055BA8(fieldSystem); + v2->pokedexSFlag_1 = sub_0206B1F0(v5, 0);// VarsFlags->vars[54] + v2->pokedexSFlag_2 = sub_0206B1F0(v5, 1);// VarsFlags->vars[55] + v2->pokedexSFlag_3 = sub_0206B1F0(v5, 2);// VarsFlags->vars[56] + v2->pokedexSFlag_4 = sub_0206B1F0(v5, 3);// VarsFlags->vars[57] v2->unk_1C = fieldSystem->unk_B4; sub_0203E0AC(fieldSystem, v2); diff --git a/src/meson.build b/src/meson.build index a472023fb6..46f72878c0 100644 --- a/src/meson.build +++ b/src/meson.build @@ -597,7 +597,7 @@ pokeplatinum_c = files( 'overlay021/ov21_021D0D80.c', 'overlay021/ov21_021D1F90.c', 'overlay021/ov21_021D1FA4.c', - 'overlay021/ov21_021D3208.c', + 'overlay021/pokedex_sort.c', 'overlay021/ov21_021D3FE0.c', 'overlay021/ov21_021D423C.c', 'overlay021/ov21_021D4340.c', diff --git a/src/overlay005/ov5_021F77A8.c b/src/overlay005/ov5_021F77A8.c index 142083f35d..1def40bc09 100644 --- a/src/overlay005/ov5_021F77A8.c +++ b/src/overlay005/ov5_021F77A8.c @@ -96,7 +96,7 @@ BOOL ScrCmd_337(ScriptContext *param0) u16 *v1 = FieldSystem_GetVarPointer(param0->fieldSystem, ScriptContext_ReadHalfWord(param0)); PokedexData *v2 = SaveData_Pokedex(param0->fieldSystem->saveData); - *v1 = sub_02026FE8(v2, v0); + *v1 = Pokedex_EncounteredSpecies(v2, v0); return 0; } diff --git a/src/overlay006/ov6_02240C9C.c b/src/overlay006/ov6_02240C9C.c index c53f151de3..d81dd3c070 100644 --- a/src/overlay006/ov6_02240C9C.c +++ b/src/overlay006/ov6_02240C9C.c @@ -326,7 +326,7 @@ BOOL ov6_02240D5C(FieldSystem *fieldSystem) v13[i].minLevel = encounterData->grassEncounters.encounters[i].level; } - BOOL nationalDexObtained = sub_02027474(SaveData_Pokedex(FieldSystem_SaveData(fieldSystem))); + BOOL nationalDexObtained = Pokedex_NationalUnlocked(SaveData_Pokedex(FieldSystem_SaveData(fieldSystem))); WildEncounters_ReplaceTimedEncounters(encounterData, &v13[2].species, &v13[3].species); WildEncounters_ReplaceRadarEncounters(fieldSystem, encounterData, &v13[0].species, &v13[1].species); @@ -514,7 +514,7 @@ BOOL ov6_022411C8(FieldSystem *fieldSystem, TaskManager *param1) v12[i].minLevel = encounterData->grassEncounters.encounters[i].level; } - BOOL nationalDexObtained = sub_02027474(SaveData_Pokedex(FieldSystem_SaveData(fieldSystem))); + BOOL nationalDexObtained = Pokedex_NationalUnlocked(SaveData_Pokedex(FieldSystem_SaveData(fieldSystem))); WildEncounters_ReplaceTimedEncounters(encounterData, &v12[2].species, &v12[3].species); WildEncounters_ReplaceRadarEncounters(fieldSystem, encounterData, &v12[0].species, &v12[1].species); @@ -643,7 +643,7 @@ BOOL ov6_022413E4(FieldSystem *fieldSystem, BattleParams **battleParams) v12[i].minLevel = encounterData->grassEncounters.encounters[i].level; } - BOOL nationalDexObtained = sub_02027474(SaveData_Pokedex(FieldSystem_SaveData(fieldSystem))); + BOOL nationalDexObtained = Pokedex_NationalUnlocked(SaveData_Pokedex(FieldSystem_SaveData(fieldSystem))); WildEncounters_ReplaceTimedEncounters(encounterData, &v12[2].species, &v12[3].species); WildEncounters_ReplaceRadarEncounters(fieldSystem, encounterData, &v12[0].species, &v12[1].species); diff --git a/src/overlay006/ov6_02242984.c b/src/overlay006/ov6_02242984.c index eb1c973d38..320c6d7cca 100644 --- a/src/overlay006/ov6_02242984.c +++ b/src/overlay006/ov6_02242984.c @@ -43,7 +43,7 @@ int ov6_02242984(FieldSystem *fieldSystem) v2[i] = encounterData->grassEncounters.encounters[i].species; } - BOOL v1 = sub_02027474(SaveData_Pokedex(FieldSystem_SaveData(fieldSystem))); + BOOL v1 = Pokedex_NationalUnlocked(SaveData_Pokedex(FieldSystem_SaveData(fieldSystem))); ov6_02242F74(sub_0202D814(sub_0202D834(fieldSystem->saveData), 1), v1, fieldSystem->location->mapId, &v2[6], &v2[7]); WildEncounters_ReplaceTimedEncounters(encounterData, &v2[2], &v2[3]); diff --git a/src/overlay021/ov21_021D0D80.c b/src/overlay021/ov21_021D0D80.c index aa8140d8d2..2d64825c9e 100644 --- a/src/overlay021/ov21_021D0D80.c +++ b/src/overlay021/ov21_021D0D80.c @@ -12,7 +12,7 @@ #include "overlay021/funcptr_ov21_021E9B74.h" #include "overlay021/funcptr_ov21_021E9B9C.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/ov21_021D3FE0.h" #include "overlay021/ov21_021D423C.h" #include "overlay021/ov21_021D4340.h" @@ -83,7 +83,7 @@ typedef struct UnkStruct_ov21_021D0F60_t { BOOL unk_00; int unk_04; UnkStruct_0209ACBC *unk_08; - UnkStruct_ov21_021D3320 unk_0C; + pokedexStruct unk_0C; UnkStruct_ov21_021D13FC unk_177C; int unk_1A60; int unk_1A64; @@ -154,11 +154,11 @@ int ov21_021D0D80(OverlayManager *param0, int *param1) v2.unk_00 = v1->unk_00; v2.unk_04 = v1->unk_04; - v2.unk_08 = v1->unk_08; - v2.unk_0C = v1->unk_0C; - v2.unk_18 = v1->unk_18; - v2.unk_10 = v1->unk_10; - v2.unk_14 = v1->unk_14; + v2.timeOfDay = v1->timeOfDay; + v2.pokedexSFlag_1 = v1->pokedexSFlag_1; + v2.pokedexSFlag_4 = v1->pokedexSFlag_4; + v2.pokedexSFlag_2 = v1->pokedexSFlag_2; + v2.pokedexSFlag_3 = v1->pokedexSFlag_3; v2.unk_1C = v1->unk_1C; v0->unk_00 = ov21_021D0F60(37, &v2); @@ -320,17 +320,17 @@ UnkStruct_ov21_021D0F60 *ov21_021D0F60(int param0, const UnkStruct_ov21_021D0D80 v0->unk_1D6C = ov21_021D3FE0(param0); v0->unk_1D70 = ov21_021D3FE0(param0); - v2.unk_00 = param1->unk_00; + v2.dexData = param1->unk_00; v2.unk_04 = param1->unk_04; - v2.unk_08 = param1->unk_08; - v2.unk_0C = param1->unk_0C; - v2.unk_10 = param1->unk_10; - v2.unk_14 = param1->unk_14; - v2.unk_18 = param1->unk_18; + v2.timeOfDay = param1->timeOfDay; + v2.pokedexSFlag_1 = param1->pokedexSFlag_1; + v2.pokedexSFlag_2 = param1->pokedexSFlag_2; + v2.pokedexSFlag_3 = param1->pokedexSFlag_3; + v2.pokedexSFlag_4 = param1->pokedexSFlag_4; v2.unk_1C = sub_0209ACE4(param1->unk_1C); v2.unk_20 = sub_0209ACEC(param1->unk_1C); - ov21_021D3208(&v0->unk_0C, &v2, param0); + Pokedex_Sort_PopulatePokedexStruct(&v0->unk_0C, &v2, param0); ov21_021D1FA4(&v0->unk_177C, param0); for (v1 = 0; v1 < 10; v1++) { @@ -514,7 +514,7 @@ BOOL *ov21_021D13DC(UnkStruct_ov21_021D0F60 *param0) return ¶m0->unk_00; } -UnkStruct_ov21_021D3320 *ov21_021D13EC(UnkStruct_ov21_021D0F60 *param0) +pokedexStruct *ov21_021D13EC(UnkStruct_ov21_021D0F60 *param0) { GF_ASSERT(param0); return ¶m0->unk_0C; @@ -676,7 +676,7 @@ void ov21_021D1650(Window *param0, int param1, int param2, int param3) ov21_021D5600(v1); } -Window *ov21_021D16D8(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3) +Window *ov21_021D16D8(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3) { Window *v0; @@ -716,7 +716,7 @@ Window *ov21_021D172C(UnkStruct_ov21_021D4C0C *param0, int param1, int param2) return v0; } -void ov21_021D1778(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, fx32 param4, fx32 param5) +void ov21_021D1778(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int dexIndex, fx32 param4, fx32 param5) { CellActor *v0; CellActor *v1; @@ -724,10 +724,10 @@ void ov21_021D1778(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D332 Window *v3; SpriteResource *v4; VecFx32 v5; - const UnkStruct_ov21_021D37DC *v6; + const speciesCaughtStatusStruct *speciesCaughtStatus; u32 v7 = ov21_021D36D8(param1); - v6 = ov21_021D37DC(param1, param3); + speciesCaughtStatus = Pokedex_Sort_SpeciesCaughtStatus(param1, dexIndex); v0 = ov21_021D22A8(param0); v1 = ov21_021D22C4(param0); @@ -737,7 +737,7 @@ void ov21_021D1778(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D332 CellActor_SetPosition(v0, &v5); CellActor_SetDrawFlag(v0, 1); - if (v6->unk_04 == 2) { + if (speciesCaughtStatus->caughtStatus == 2) { v5.x = param4 + (-54 * FX32_ONE); v5.y = param5; @@ -759,10 +759,10 @@ void ov21_021D1778(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D332 v2.unk_20 = NNS_G2D_VRAM_TYPE_2DMAIN; v2.unk_24 = param2; - v3 = ov21_021D16D8(param0, param1, param2, v6->unk_00); + v3 = ov21_021D16D8(param0, param1, param2, speciesCaughtStatus->species); v2.unk_04 = v3; - ov21_021D22E0(param0, &v2, 0, v6->unk_00, v7); + ov21_021D22E0(param0, &v2, 0, speciesCaughtStatus->species, v7); ov21_021D4DA0(v3); } @@ -787,9 +787,9 @@ void ov21_021D1858(UnkStruct_ov21_021D22F8 *param0, int param1, int param2) } } -void ov21_021D1890(UnkStruct_ov21_021D13FC *param0, UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5) +void ov21_021D1890(UnkStruct_ov21_021D13FC *param0, pokedexStruct *param1, int species, int param3, int param4, int param5) { - switch (param2) { + switch (species) { case 201: ov21_021D1A34(param0, param1, param3, param4, param5, 0, 0); break; @@ -818,12 +818,12 @@ void ov21_021D1890(UnkStruct_ov21_021D13FC *param0, UnkStruct_ov21_021D3320 *par ov21_021D1C88(param0, param1, param3, param4, param5, 0, 0); break; default: - ov21_021D19D8(param0, param1, param2, param3, param4, param5, 0, 0); + ov21_021D19D8(param0, param1, species, param3, param4, param5, 0, 0); break; } } -u32 ov21_021D19D8(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6, int param7) +u32 ov21_021D19D8(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6, int param7) { int v0; u32 v1 = 0; @@ -841,11 +841,11 @@ u32 ov21_021D19D8(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 return v0; } -u32 ov21_021D1A34(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1A34(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *pokedexS, int param2, int param3, int param4, int param5, int param6) { int v0; - v0 = ov21_021D335C(param1, param5); + v0 = ov21_021D335C(pokedexS, param5); if (v0 != -1) { ov21_021D2188(param0, 201, 2, param2, 0, v0, 0, param3, param4, param6); @@ -854,7 +854,7 @@ u32 ov21_021D1A34(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 return v0; } -u32 ov21_021D1A78(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1A78(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6) { int v0; @@ -867,7 +867,7 @@ u32 ov21_021D1A78(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 return v0; } -u32 ov21_021D1AC0(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1AC0(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6) { int v0; @@ -880,7 +880,7 @@ u32 ov21_021D1AC0(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 return v0; } -u32 ov21_021D1B08(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1B08(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6) { int v0; @@ -893,7 +893,7 @@ u32 ov21_021D1B08(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 return v0; } -u32 ov21_021D1B4C(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1B4C(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6) { int v0; @@ -906,7 +906,7 @@ u32 ov21_021D1B4C(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 return v0; } -u32 ov21_021D1B94(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1B94(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6) { int v0; @@ -919,7 +919,7 @@ u32 ov21_021D1B94(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 return v0; } -u32 ov21_021D1BD8(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1BD8(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6) { int v0; int v1; @@ -936,7 +936,7 @@ u32 ov21_021D1BD8(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 return v0; } -u32 ov21_021D1C30(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1C30(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6) { int v0; int v1; @@ -953,7 +953,7 @@ u32 ov21_021D1C30(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 return v0; } -u32 ov21_021D1C88(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1C88(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6) { int v0; int v1; diff --git a/src/overlay021/ov21_021D3208.c b/src/overlay021/ov21_021D3208.c deleted file mode 100644 index 95f82daddc..0000000000 --- a/src/overlay021/ov21_021D3208.c +++ /dev/null @@ -1,956 +0,0 @@ -#include "overlay021/ov21_021D3208.h" - -#include -#include - -#include "struct_decls/pokedexdata_decl.h" - -#include "overlay021/struct_ov21_021D3208.h" -#include "overlay021/struct_ov21_021D3320.h" -#include "overlay021/struct_ov21_021D37DC.h" -#include "overlay021/struct_ov21_021D3A60.h" - -#include "core_sys.h" -#include "heap.h" -#include "narc.h" -#include "pokedex_data_index.h" -#include "pokedex_heightweight.h" -#include "strbuf.h" -#include "trainer_info.h" -#include "unk_02006E3C.h" -#include "unk_0202631C.h" - -static void ov21_021D39A4(u16 *param0, int *param1, const PokedexData *param2, const u16 *param3, int param4); -static void ov21_021D39E4(u16 *param0, int *param1, const u16 *param2, int param3, const u16 *param4, int param5, BOOL param6, const PokedexData *param7); -static void ov21_021D3A60(UnkStruct_ov21_021D3A60 *param0, const PokedexData *param1, const u16 *param2, int param3); -static void ov21_021D3AB8(UnkStruct_ov21_021D3A60 *param0, const u16 *param1, int param2); -static void ov21_021D3B28(UnkStruct_ov21_021D3A60 *param0); -static void ov21_021D3FA8(UnkStruct_ov21_021D3A60 *param0, int *param1, int *param2); -static u16 *Pokedex_Sorted_Array(int param0, int param1, int *param2); -static void Pokedex_Sort_HeightWeight(int param0, u16 *param1, int *param2, const u16 *param3, int param4, int heapID, const PokedexData *param6); -static void Pokedex_Sort_FirstLetter(int param0, u16 *param1, int *param2, const u16 *param3, int param4, int heapID, const PokedexData *param6); -static void Pokedex_Sort_Type(int param0, u16 *param1, int *param2, const u16 *param3, int param4, int heapID, const PokedexData *param6); -static void Pokedex_Sort_BodyShape(int param0, u16 *param1, int *param2, const u16 *param3, int param4, int heapID, const PokedexData *param6); - -void ov21_021D3208(UnkStruct_ov21_021D3320 *param0, UnkStruct_ov21_021D3208 *param1, int param2) -{ - int v0; - int v1; - int v2; - int v3; - int v4; - BOOL v5; - u32 v6; - - memset(param0, 0, sizeof(UnkStruct_ov21_021D3320)); - - param0->unk_00 = param1->unk_00; - param0->unk_1744 = param1->unk_08; - - if (sub_02027474(param0->unk_00)) { - param0->unk_1734 = 1; - } else { - param0->unk_1734 = 0; - } - - if (param1->unk_20 == 2) { - if (param0->unk_1734) { - v6 = 1; - } else { - v6 = 0; - } - } else { - v6 = param1->unk_20; - } - - if (v6 == 1) { - param0->unk_1730 = 1; - v0 = 0; - v1 = 0; - v2 = 0; - v3 = 0; - v4 = 0; - } else { - param0->unk_1730 = 0; - v0 = 0; - v1 = 0; - v2 = 0; - v3 = 0; - v4 = 0; - } - - v5 = ov21_021D3684(param0, v0, v1, v2, v3, v4, param0->unk_1730, param2); - - GF_ASSERT(v5); - - ov21_021D3794(param0, param1->unk_1C); - ov21_021D3434(param0, param1->unk_1C); - ov21_021D344C(param0, param1->unk_20); - - param0->unk_174C = TrainerInfo_GameCode(param1->unk_04); - param0->unk_1750 = TrainerInfo_Gender(param1->unk_04); - param0->unk_1754 = TrainerInfo_NameNewStrbuf(param1->unk_04, param2); - param0->unk_1748 = Pokedex_HeightWeightData(param2); - - if (param0->unk_1750 == 0) { - Pokedex_HeightWeightData_Load(param0->unk_1748, 0, param2); - } else { - Pokedex_HeightWeightData_Load(param0->unk_1748, 1, param2); - } - - param0->unk_1760 = param1->unk_0C; - param0->unk_1764 = param1->unk_10; - param0->unk_1768 = param1->unk_14; - param0->unk_176C = param1->unk_18; -} - -void ov21_021D3320(UnkStruct_ov21_021D3320 *param0) -{ - Strbuf_Free(param0->unk_1754); - Pokedex_HeightWeightData_Release(param0->unk_1748); - Pokedex_HeightWeightData_Free(param0->unk_1748); - - param0->unk_1748 = NULL; -} - -u32 ov21_021D334C(const UnkStruct_ov21_021D3320 *param0, int param1, int param2) -{ - u32 v0; - - v0 = sub_02027058(param0->unk_00, param1, param2); - return v0; -} - -u32 ov21_021D335C(const UnkStruct_ov21_021D3320 *param0, int param1) -{ - int v0; - - GF_ASSERT(param1 < 28); - v0 = sub_020270AC(param0->unk_00, param1); - - return v0; -} - -u32 ov21_021D3374(const UnkStruct_ov21_021D3320 *param0, int param1) -{ - u32 v0; - - GF_ASSERT(param1 < 2); - v0 = sub_020270F8(param0->unk_00, param1); - - return v0; -} - -u32 ov21_021D338C(const UnkStruct_ov21_021D3320 *param0, int param1) -{ - u32 v0; - - GF_ASSERT(param1 < 2); - - v0 = sub_02027154(param0->unk_00, param1); - return v0; -} - -u32 ov21_021D33A4(const UnkStruct_ov21_021D3320 *param0, int param1) -{ - u32 v0; - - GF_ASSERT(param1 < 3); - - v0 = sub_020271B0(param0->unk_00, param1); - return v0; -} - -u32 ov21_021D33BC(const UnkStruct_ov21_021D3320 *param0, int param1) -{ - u32 v0; - - GF_ASSERT(param1 < 3); - - v0 = sub_02027208(param0->unk_00, param1); - return v0; -} - -u32 ov21_021D33D4(const UnkStruct_ov21_021D3320 *param0, u32 param1) -{ - return sub_0202756C(param0->unk_00, param1, 0); -} - -u32 ov21_021D33E0(const UnkStruct_ov21_021D3320 *param0, int param1) -{ - int v0 = ov21_021D334C(param0, param1, 1); - - if (v0 == -1) { - return 1; - } - - return 2; -} - -u32 ov21_021D33F8(const UnkStruct_ov21_021D3320 *param0) -{ - return sub_0202702C(param0->unk_00, 0); -} - -u32 ov21_021D3404(const UnkStruct_ov21_021D3320 *param0, int param1) -{ - return sub_02027264(param0->unk_00, param1); -} - -u32 ov21_021D3410(const UnkStruct_ov21_021D3320 *param0, u32 param1, int param2) -{ - return sub_0202756C(param0->unk_00, param1, param2); -} - -u32 ov21_021D341C(const UnkStruct_ov21_021D3320 *param0, u32 param1) -{ - return sub_020276C8(param0->unk_00, param1); -} - -BOOL ov21_021D3428(const UnkStruct_ov21_021D3320 *param0) -{ - return sub_02027474(param0->unk_00); -} - -void ov21_021D3434(UnkStruct_ov21_021D3320 *param0, u32 param1) -{ - param0->unk_175C = param1; -} - -u32 ov21_021D3440(const UnkStruct_ov21_021D3320 *param0) -{ - return param0->unk_175C; -} - -void ov21_021D344C(UnkStruct_ov21_021D3320 *param0, u32 param1) -{ - param0->unk_175E = param1; -} - -u32 ov21_021D3458(const UnkStruct_ov21_021D3320 *param0) -{ - return param0->unk_175E; -} - -BOOL ov21_021D3464(UnkStruct_ov21_021D3320 *param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7, BOOL param8) -{ - u16 *v0; - int v1; - u16 *v2; - int v3; - u16 *v4; - int pokedexLength; - BOOL v6; - - v0 = Heap_AllocFromHeapAtEnd(param7, sizeof(u16) * NATIONAL_DEX_COUNT); - - GF_ASSERT(v0); - memset(v0, 0, sizeof(u16) * NATIONAL_DEX_COUNT); - - v1 = 0; - v2 = Heap_AllocFromHeapAtEnd(param7, sizeof(u16) * NATIONAL_DEX_COUNT); - - GF_ASSERT(v2); - memset(v2, 0, sizeof(u16) * NATIONAL_DEX_COUNT); - - v3 = 0; - - if (param6 == 0) { - v4 = Pokedex_Sorted_Array(param7, 1, &pokedexLength); - ov21_021D39A4(v0, &v1, param0->unk_00, v4, pokedexLength); - } else { - v4 = Pokedex_Sorted_Array(param7, 0, &pokedexLength); - ov21_021D39A4(v0, &v1, param0->unk_00, v4, pokedexLength); - } - - Pokedex_Sort_HeightWeight(param1, v2, &v3, v0, v1, param7, param0->unk_00); - - memcpy(v0, v2, sizeof(u16) * v3); - v1 = v3; - - memset(v2, 0, sizeof(u16) * v3); - v3 = 0; - - do { - Pokedex_Sort_FirstLetter(param2, v2, &v3, v0, v1, param7, param0->unk_00); - - if (v3 == 0) { - v6 = 0; - break; - } - - memcpy(v0, v2, sizeof(u16) * v3); - v1 = v3; - - memset(v2, 0, sizeof(u16) * v3); - v3 = 0; - - Pokedex_Sort_Type(param3, v2, &v3, v0, v1, param7, param0->unk_00); - - if (v3 == 0) { - v6 = 0; - break; - } - - memcpy(v0, v2, sizeof(u16) * v3); - v1 = v3; - - memset(v2, 0, sizeof(u16) * v3); - v3 = 0; - - Pokedex_Sort_Type(param4, v2, &v3, v0, v1, param7, param0->unk_00); - - if (v3 == 0) { - v6 = 0; - break; - } - - memcpy(v0, v2, sizeof(u16) * v3); - v1 = v3; - - memset(v2, 0, sizeof(u16) * v3); - v3 = 0; - - Pokedex_Sort_BodyShape(param5, v2, &v3, v0, v1, param7, param0->unk_00); - - if (v3 == 0) { - v6 = 0; - break; - } - - memcpy(v0, v2, sizeof(u16) * v3); - v1 = v3; - - memset(v2, 0, sizeof(u16) * v3); - v3 = 0; - - ov21_021D3A60(¶m0->unk_04, param0->unk_00, v0, v1); - - if ((param1 != 0) || (param2 != 0) || (param3 != 0) || (param4 != 0) || (param5 != 0)) { - param8 = 1; - } - - if (param8 == 0) { - ov21_021D3AB8(¶m0->unk_04, v4, pokedexLength); - } else { - ov21_021D3B28(¶m0->unk_04); - } - - v6 = 1; - } while (0); - - ov21_021D3FA8(¶m0->unk_04, ¶m0->unk_1738, ¶m0->unk_173C); - - Heap_FreeToHeap(v0); - Heap_FreeToHeap(v2); - Heap_FreeToHeap(v4); - - return v6; -} - -BOOL ov21_021D3684(UnkStruct_ov21_021D3320 *param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7) -{ - return ov21_021D3464(param0, param1, param2, param3, param4, param5, param6, param7, 0); -} - -BOOL ov21_021D36A4(const UnkStruct_ov21_021D3320 *param0, int param1) -{ - if (param1 == 0) { - return 1; - } - - if (param0->unk_1734) { - return 1; - } - - return 0; -} - -BOOL ov21_021D36C0(UnkStruct_ov21_021D3320 *param0, int param1) -{ - BOOL v0; - - v0 = ov21_021D36A4(param0, param1); - - if (v0) { - param0->unk_1730 = param1; - } - - return v0; -} - -int ov21_021D36D8(const UnkStruct_ov21_021D3320 *param0) -{ - return param0->unk_1730; -} - -BOOL ov21_021D36E4(const UnkStruct_ov21_021D3320 *param0, int param1) -{ - if (((param1) >= 0) && ((param1) < param0->unk_04.unk_F6C)) { - return 1; - } - - return 0; -} - -BOOL ov21_021D36FC(UnkStruct_ov21_021D3320 *param0, int param1) -{ - if (ov21_021D36E4(param0, param1)) { - param0->unk_04.unk_F68 = param1; - return 1; - } - - return 0; -} - -BOOL ov21_021D371C(UnkStruct_ov21_021D3320 *param0, int param1) -{ - if (ov21_021D36E4(param0, param0->unk_04.unk_F68 + param1)) { - param0->unk_04.unk_F68 += param1; - return 1; - } - - if (param1 >= 0) { - param0->unk_04.unk_F68 = param0->unk_04.unk_F6C - 1; - } else { - param0->unk_04.unk_F68 = 0; - } - - return 0; -} - -int ov21_021D375C(const UnkStruct_ov21_021D3320 *param0) -{ - return param0->unk_04.unk_F68; -} - -int ov21_021D3768(const UnkStruct_ov21_021D3320 *param0) -{ - return param0->unk_04.unk_F6C; -} - -int ov21_021D3770(const UnkStruct_ov21_021D3320 *param0, u32 param1) -{ - int v0; - int v1 = ov21_021D3768(param0); - int v2; - - for (v0 = 0; v0 < v1; v0++) { - v2 = param0->unk_04.unk_00[v0].unk_00; - - if (v2 == param1) { - break; - } - } - - return v0; -} - -BOOL ov21_021D3794(UnkStruct_ov21_021D3320 *param0, int param1) -{ - u32 v0 = ov21_021D3768(param0); - u32 v1 = ov21_021D3770(param0, param1); - - if (v0 > v1) { - return ov21_021D36FC(param0, v1); - } - - return 0; -} - -int ov21_021D37BC(const UnkStruct_ov21_021D3320 *param0) -{ - return param0->unk_04.unk_00[param0->unk_04.unk_F68].unk_00; -} - -int ov21_021D37CC(const UnkStruct_ov21_021D3320 *param0) -{ - return param0->unk_04.unk_00[param0->unk_04.unk_F68].unk_04; -} - -const UnkStruct_ov21_021D37DC *ov21_021D37DC(const UnkStruct_ov21_021D3320 *param0, int param1) -{ - if (ov21_021D36E4(param0, param1)) { - return ¶m0->unk_04.unk_00[param1]; - } - - return NULL; -} - -BOOL ov21_021D37F8(const UnkStruct_ov21_021D3320 *param0, int param1) -{ - if ((param0->unk_04.unk_1728 > param1) && (param1 >= 0)) { - return 1; - } - - return 0; -} - -BOOL ov21_021D3810(UnkStruct_ov21_021D3320 *param0, int param1) -{ - if (ov21_021D37F8(param0, param1)) { - param0->unk_04.unk_1724 = param1; - - ov21_021D36FC(param0, param0->unk_04.unk_F70[param0->unk_04.unk_1724]); - return 1; - } - - return 0; -} - -BOOL ov21_021D3844(UnkStruct_ov21_021D3320 *param0, int param1) -{ - if (ov21_021D387C(param0, param1)) { - param0->unk_04.unk_1724 += param1; - - ov21_021D36FC(param0, param0->unk_04.unk_F70[param0->unk_04.unk_1724]); - return 1; - } - - return 0; -} - -BOOL ov21_021D387C(UnkStruct_ov21_021D3320 *param0, int param1) -{ - if (ov21_021D37F8(param0, param0->unk_04.unk_1724 + param1)) { - return 1; - } - - return 0; -} - -int ov21_021D3898(const UnkStruct_ov21_021D3320 *param0) -{ - return param0->unk_04.unk_1724; -} - -int ov21_021D38A4(const UnkStruct_ov21_021D3320 *param0) -{ - return param0->unk_04.unk_1728; -} - -int ov21_021D38B0(const UnkStruct_ov21_021D3320 *param0, int param1) -{ - return param0->unk_04.unk_F70[param1]; -} - -void ov21_021D38C0(UnkStruct_ov21_021D3320 *param0) -{ - int v0; - - for (v0 = 0; v0 < param0->unk_04.unk_1728; v0++) { - if (ov21_021D38B0(param0, v0) == ov21_021D375C(param0)) { - ov21_021D3810(param0, v0); - break; - } - } -} - -int ov21_021D38FC(const UnkStruct_ov21_021D3320 *param0) -{ - return param0->unk_1738; -} - -int ov21_021D3908(const UnkStruct_ov21_021D3320 *param0) -{ - return param0->unk_173C; -} - -Strbuf *ov21_021D3914(const UnkStruct_ov21_021D3320 *param0) -{ - return param0->unk_1754; -} - -u32 ov21_021D3920(const UnkStruct_ov21_021D3320 *param0) -{ - return param0->unk_1750; -} - -BOOL ov21_021D392C(const UnkStruct_ov21_021D3320 *param0, int param1) -{ - int v0 = ov21_021D37BC(param0); - - if (sub_02027514(param0->unk_00) == 0) { - return 0; - } - - return sub_020274D0(param0->unk_00, v0, param1); -} - -BOOL ov21_021D3954(const UnkStruct_ov21_021D3320 *param0) -{ - return sub_02027494(param0->unk_00); -} - -void ov21_021D3960(UnkStruct_ov21_021D3320 *param0) -{ - if (gCoreSys.touchHeld) { - param0->unk_1758 = 0; - return; - } - - if (gCoreSys.pressedKeys) { - if (param0->unk_1758 == 0) { - param0->unk_1758 = 1; - } else { - param0->unk_1758 = 2; - } - } -} - -u32 ov21_021D3998(const UnkStruct_ov21_021D3320 *param0) -{ - return param0->unk_1758; -} - -static void ov21_021D39A4(u16 *param0, int *param1, const PokedexData *param2, const u16 *param3, int param4) -{ - int v0; - - *param1 = 0; - - for (v0 = 0; v0 < param4; v0++) { - if (sub_02026FE8(param2, param3[v0])) { - param0[*param1] = param3[v0]; - (*param1)++; - } - } -} - -static void ov21_021D39E4(u16 *param0, int *param1, const u16 *param2, int param3, const u16 *param4, int param5, BOOL param6, const PokedexData *param7) -{ - int v0, v1; - - *param1 = 0; - - for (v0 = 0; v0 < param3; v0++) { - for (v1 = 0; v1 < param5; v1++) { - if (param2[v0] == param4[v1]) { - if (param6 == 1) { - break; - } else { - if (Pokedex_CaughtSpecies(param7, param2[v0])) { - break; - } - } - } - } - - if (v1 < param5) { - param0[*param1] = param2[v0]; - (*param1)++; - } - } -} - -static void ov21_021D3A60(UnkStruct_ov21_021D3A60 *param0, const PokedexData *param1, const u16 *param2, int param3) -{ - int v0; - - param0->unk_F6C = 0; - - for (v0 = 0; v0 < param3; v0++) { - if (Pokedex_CaughtSpecies(param1, param2[v0])) { - param0->unk_00[param0->unk_F6C].unk_04 = 2; - } else { - param0->unk_00[param0->unk_F6C].unk_04 = 1; - } - - param0->unk_00[param0->unk_F6C].unk_00 = param2[v0]; - param0->unk_F6C++; - } -} - -static void ov21_021D3AB8(UnkStruct_ov21_021D3A60 *param0, const u16 *param1, int param2) -{ - int v0; - int v1; - - v1 = 0; - param0->unk_1728 = 0; - - for (v0 = 0; v0 < param2; v0++) { - if (v1 < param0->unk_F6C) { - if (param0->unk_00[v1].unk_00 == param1[v0]) { - param0->unk_F70[param0->unk_1728] = v1; - v1++; - param0->unk_1728++; - } else { - param0->unk_F70[param0->unk_1728] = (NATIONAL_DEX_COUNT + 1); - param0->unk_1728++; - } - } - } -} - -static void ov21_021D3B28(UnkStruct_ov21_021D3A60 *param0) -{ - int v0; - - param0->unk_1728 = 0; - - for (v0 = 0; v0 < param0->unk_F6C; v0++) { - param0->unk_F70[param0->unk_1728] = v0; - param0->unk_1728++; - } -} - -static u16 *Pokedex_Sorted_Array(int heapID, int pokedexSort, int *pokedexLength) -{ - u32 pokedexSize; - u16 *pokedexSortedArray; - u32 pokedexDataNarcIndex; - - GF_ASSERT(47 > pokedexSort); - - pokedexDataNarcIndex = Pokedex_Data_NARC_Index(); - pokedexSortedArray = sub_02007068(pokedexDataNarcIndex, 11 + pokedexSort, 0, heapID, 0, &pokedexSize); - *pokedexLength = pokedexSize / (sizeof(u16)); - - return pokedexSortedArray; -} - -static void Pokedex_Sort_HeightWeight(int param0, u16 *param1, int *param2, const u16 *param3, int param4, int heapID, const PokedexData *param6) -{ - u16 *pokedexSortedArray; - int pokedexLength; - BOOL v2 = 0; - - switch (param0) { - case 0: - pokedexSortedArray = NULL; - break; - case 1: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 2, &pokedexLength); // alphabetical - v2 = 1; - break; - case 2: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 3, &pokedexLength); // heaviest - break; - case 3: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 4, &pokedexLength); // lightest - break; - case 4: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 5, &pokedexLength); // tallest - break; - case 5: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 6, &pokedexLength); // shortest - break; - default: - GF_ASSERT(0); - break; - } - - if (pokedexSortedArray != NULL) { - ov21_021D39E4(param1, param2, pokedexSortedArray, pokedexLength, param3, param4, v2, param6); - Heap_FreeToHeap(pokedexSortedArray); - } else { - memcpy(param1, param3, (sizeof(u16)) * param4); - *param2 = param4; - } -} - -static void Pokedex_Sort_FirstLetter(int param0, u16 *param1, int *param2, const u16 *param3, int param4, int heapID, const PokedexData *param6) -{ - u16 *pokedexSortedArray; - int pokedexLength; - - switch (param0) { - case 0: - pokedexSortedArray = NULL; - break; - case 1: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 7, &pokedexLength); // ABC - break; - case 2: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 8, &pokedexLength); // DEF - break; - case 3: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 9, &pokedexLength); // GHI - break; - case 4: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 10, &pokedexLength); // JKL - break; - case 5: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 11, &pokedexLength); // MNO - break; - case 6: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 12, &pokedexLength); // PQR - break; - case 7: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 13, &pokedexLength); // STU - break; - case 8: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 14, &pokedexLength); // VWX - break; - case 9: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 15, &pokedexLength); // YZ - break; - default: - GF_ASSERT(0); - break; - } - - if (pokedexSortedArray != NULL) { - ov21_021D39E4(param1, param2, param3, param4, pokedexSortedArray, pokedexLength, 1, param6); - Heap_FreeToHeap(pokedexSortedArray); - } else { - memcpy(param1, param3, (sizeof(u16)) * param4); - *param2 = param4; - } -} - -static void Pokedex_Sort_Type(int param0, u16 *param1, int *param2, const u16 *param3, int param4, int heapID, const PokedexData *param6) -{ - u16 *pokedexSortedArray; - int pokedexLength; - - switch (param0) { - case 0: - pokedexSortedArray = NULL; - break; - case 1: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 16, &pokedexLength); // normal - break; - case 2: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 17, &pokedexLength); // fighting - break; - case 3: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 18, &pokedexLength); // flying - break; - case 4: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 19, &pokedexLength); // poison - break; - case 5: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 20, &pokedexLength); // ground - break; - case 6: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 21, &pokedexLength); // rock - break; - case 7: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 22, &pokedexLength); // bug - break; - case 8: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 23, &pokedexLength); // ghost - break; - case 9: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 24, &pokedexLength); // steel - break; - case 10: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 25, &pokedexLength); // fire - break; - case 11: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 26, &pokedexLength); // water - break; - case 12: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 27, &pokedexLength); // grass - break; - case 13: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 28, &pokedexLength); // electric - break; - case 14: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 29, &pokedexLength); // psychic - break; - case 15: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 30, &pokedexLength); // ice - break; - case 16: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 31, &pokedexLength); // dragon - break; - case 17: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 32, &pokedexLength); // dark - break; - default: - GF_ASSERT(0); - break; - } - - if (pokedexSortedArray != NULL) { - ov21_021D39E4(param1, param2, param3, param4, pokedexSortedArray, pokedexLength, 0, param6); - Heap_FreeToHeap(pokedexSortedArray); - } else { - memcpy(param1, param3, (sizeof(u16)) * param4); - *param2 = param4; - } -} - -static void Pokedex_Sort_BodyShape(int param0, u16 *param1, int *param2, const u16 *param3, int param4, int heapID, const PokedexData *param6) -{ - u16 *pokedexSortedArray; - int pokedexLength; - - switch (param0) { - case 0: - pokedexSortedArray = NULL; - break; - case 1: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 33, &pokedexLength); // quadruped - break; - case 2: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 34, &pokedexLength); // bidedal tailless - break; - case 3: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 35, &pokedexLength); // bipedal tailed - break; - case 4: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 36, &pokedexLength); // serpentine - break; - case 5: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 37, &pokedexLength); // multi winged - break; - case 6: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 38, &pokedexLength); // winged - break; - case 7: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 39, &pokedexLength); // insectoid - break; - case 8: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 40, &pokedexLength); // head base - break; - case 9: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 41, &pokedexLength); // head arms - break; - case 10: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 42, &pokedexLength); // head legs - break; - case 11: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 43, &pokedexLength); // tentacles - break; - case 12: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 44, &pokedexLength); // fins - break; - case 13: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 45, &pokedexLength); // head - break; - case 14: - pokedexSortedArray = Pokedex_Sorted_Array(heapID, 46, &pokedexLength); // multi-body - break; - default: - GF_ASSERT(0); - break; - } - - if (pokedexSortedArray != NULL) { - ov21_021D39E4(param1, param2, param3, param4, pokedexSortedArray, pokedexLength, 1, param6); - Heap_FreeToHeap(pokedexSortedArray); - } else { - memcpy(param1, param3, (sizeof(u16)) * param4); - *param2 = param4; - } -} - -static void ov21_021D3FA8(UnkStruct_ov21_021D3A60 *param0, int *param1, int *param2) -{ - int v0; - - *param1 = 0; - *param2 = 0; - - for (v0 = 0; v0 < param0->unk_F6C; v0++) { - if (param0->unk_00[v0].unk_04 == 2) { - (*param2)++; - } - - (*param1)++; - } -} diff --git a/src/overlay021/ov21_021D3FE0.c b/src/overlay021/ov21_021D3FE0.c index 85526d7ba1..7c810a7b2e 100644 --- a/src/overlay021/ov21_021D3FE0.c +++ b/src/overlay021/ov21_021D3FE0.c @@ -19,7 +19,7 @@ typedef struct UnkStruct_ov21_021D3FE0_t { UnkFuncPtr_ov21_021D41EC unk_20[3]; UnkStruct_ov21_021E6B20 unk_2C; UnkFuncPtr_ov21_021D420C unk_38[3]; - int unk_44; + int heapID; } UnkStruct_ov21_021D3FE0; static void ov21_021D41D8(UnkStruct_ov21_021E6A68 *param0); @@ -37,7 +37,7 @@ UnkStruct_ov21_021D3FE0 *ov21_021D3FE0(int param0) memset(v0, 0, sizeof(UnkStruct_ov21_021D3FE0)); v0->unk_08 = 5; - v0->unk_44 = param0; + v0->heapID = param0; return v0; } @@ -53,10 +53,10 @@ void ov21_021D4008(UnkStruct_ov21_021D3FE0 *param0, const UnkStruct_ov21_021D400 param0->unk_08 = 0; ov21_021D41D8(¶m0->unk_0C); - param0->unk_0C.unk_04 = param0->unk_44; + param0->unk_0C.heapID = param0->heapID; ov21_021D41E4(¶m0->unk_2C); - param0->unk_2C.unk_04 = param0->unk_44; + param0->unk_2C.heapID = param0->heapID; param0->unk_20[0] = param1->unk_08[0]; param0->unk_20[1] = param1->unk_08[1]; diff --git a/src/overlay021/ov21_021D57B4.c b/src/overlay021/ov21_021D57B4.c index 182ec51ad3..5757a914e7 100644 --- a/src/overlay021/ov21_021D57B4.c +++ b/src/overlay021/ov21_021D57B4.c @@ -12,82 +12,82 @@ #include "narc.h" #include "unk_02006E3C.h" -void ov21_021D57B4(UnkStruct_ov21_021D5844 *param0, int param1, int param2, int param3) +void ov21_021D57B4(pokedexEncStruct *dexEncData, int species, int param2, int heapID) { int v0; - u32 v1; + u32 fileSize; switch (param2) { - case 0: + case 0:// category 0, morning v0 = 4; break; - case 1: + case 1:// category 0, day v0 = 499; break; - case 2: + case 2:// category 0, night v0 = 994; break; - case 3: + case 3:// category 2, regional v0 = 1489; break; - case 4: + case 4:// category 2, national v0 = 1984; break; - case 5: + case 5:// category 1, morning v0 = 2479; break; - case 6: + case 6:// category 1, day v0 = 2974; break; - case 7: + case 7:// category 1, night v0 = 3469; break; - case 8: + case 8:// category 3, regional v0 = 3964; break; - case 9: + case 9:// category 3, national v0 = 4459; break; } - param0->unk_00 = (int *)sub_02007068(NARC_INDEX_APPLICATION__ZUKANLIST__ZKN_DATA__ZUKAN_ENC_PLATINUM, v0 + param1, 0, param3, 0, &v1); - param0->unk_04 = v1 / sizeof(int); + dexEncData->pokedexEncArray = (int *)sub_02007068(NARC_INDEX_APPLICATION__ZUKANLIST__ZKN_DATA__ZUKAN_ENC_PLATINUM, v0 + species, 0, heapID, 0, &fileSize); + dexEncData->pokedexEncLength = fileSize / sizeof(int); } -void ov21_021D5844(UnkStruct_ov21_021D5844 *param0) +void Free_pokedexEncData(pokedexEncStruct *dexEncData) { - GF_ASSERT(param0); - GF_ASSERT(param0->unk_00); + GF_ASSERT(dexEncData); + GF_ASSERT(dexEncData->pokedexEncArray); - Heap_FreeToHeap(param0->unk_00); + Heap_FreeToHeap(dexEncData->pokedexEncArray); - param0->unk_00 = NULL; - param0->unk_04 = 0; + dexEncData->pokedexEncArray = NULL; + dexEncData->pokedexEncLength = 0; } -UnkStruct_ov21_021D5868 *ov21_021D5868(int param0, int *param1) +UnkStruct_ov21_021D5868 *ov21_021D5868(int heapID, int *param1) { UnkStruct_ov21_021D5868 *v0; - u32 v1; + u32 fileSize; - v0 = (UnkStruct_ov21_021D5868 *)sub_02007068(NARC_INDEX_APPLICATION__ZUKANLIST__ZKN_DATA__ZUKAN_ENC_PLATINUM, 0, 0, param0, 0, &v1); + v0 = (UnkStruct_ov21_021D5868 *)sub_02007068(NARC_INDEX_APPLICATION__ZUKANLIST__ZKN_DATA__ZUKAN_ENC_PLATINUM, 0, 0, heapID, 0, &fileSize); if (param1) { - *param1 = v1 / sizeof(UnkStruct_ov21_021D5868); + *param1 = fileSize / sizeof(UnkStruct_ov21_021D5868); } return v0; } -UnkStruct_ov21_021D5890 *ov21_021D5890(int param0, int *param1) +UnkStruct_ov21_021D5890 *ov21_021D5890(int heapID, int *param1) { UnkStruct_ov21_021D5890 *v0; - u32 v1; + u32 fileSize; - v0 = (UnkStruct_ov21_021D5890 *)sub_02007068(NARC_INDEX_APPLICATION__ZUKANLIST__ZKN_DATA__ZUKAN_ENC_PLATINUM, 2, 0, param0, 0, &v1); + v0 = (UnkStruct_ov21_021D5890 *)sub_02007068(NARC_INDEX_APPLICATION__ZUKANLIST__ZKN_DATA__ZUKAN_ENC_PLATINUM, 2, 0, heapID, 0, &fileSize); if (param1) { - *param1 = v1 / sizeof(UnkStruct_ov21_021D5890); + *param1 = fileSize / sizeof(UnkStruct_ov21_021D5890); } return v0; @@ -95,35 +95,35 @@ UnkStruct_ov21_021D5890 *ov21_021D5890(int param0, int *param1) void ov21_021D58C0(u8 *param0, u8 param1, u8 param2, const UnkStruct_ov21_021D5890 *param3) { - int v0, v1; + int outerIndex, innerIndex; - GF_ASSERT((param3->unk_01 + param3->unk_03) < param2); + GF_ASSERT((param3->unk_01 + param3->unk_03) < param2);// param 1 and 2 are 30 GF_ASSERT((param3->unk_00 + param3->unk_02) < param1); - for (v0 = param3->unk_01; v0 < param3->unk_01 + param3->unk_03; v0++) { - for (v1 = param3->unk_00; v1 < param3->unk_00 + param3->unk_02; v1++) { - param0[(v0 * param1) + v1] |= param3->unk_04[((v0 - param3->unk_01) * param3->unk_02) + (v1 - param3->unk_00)]; + for (outerIndex = param3->unk_01; outerIndex < param3->unk_01 + param3->unk_03; outerIndex++) { + for (innerIndex = param3->unk_00; innerIndex < param3->unk_00 + param3->unk_02; innerIndex++) { + param0[(outerIndex * param1) + innerIndex] |= param3->unk_04[((outerIndex - param3->unk_01) * param3->unk_02) + (innerIndex - param3->unk_00)]; } } } -u32 ov21_021D5948(u8 *param0, int param1, int param2, const UnkStruct_ov21_021D5890 *param3, const UnkStruct_ov21_021D5844 *param4, const u8 *param5, u32 param6) +u32 ov21_021D5948(u8 *param0, int param1, int param2, const UnkStruct_ov21_021D5890 *param3, const pokedexEncStruct *dexEncData, const u8 *param5, u32 param6) { - int v0; + int pokedexEncIndex; int v1; u32 v2 = 0; - for (v0 = 0; v0 < param4->unk_04 - 1; v0++) { - GF_ASSERT(param4->unk_00[v0]); + for (pokedexEncIndex = 0; pokedexEncIndex < dexEncData->pokedexEncLength - 1; pokedexEncIndex++) { + GF_ASSERT(dexEncData->pokedexEncArray[pokedexEncIndex]); for (v1 = 0; v1 < param6; v1++) { - if (param4->unk_00[v0] == param5[v1]) { + if (dexEncData->pokedexEncArray[pokedexEncIndex] == param5[v1]) { break; } } if (v1 >= param6) { - ov21_021D58C0(param0, param1, param2, ¶m3[param4->unk_00[v0]]); + ov21_021D58C0(param0, param1, param2, ¶m3[dexEncData->pokedexEncArray[pokedexEncIndex]]); v2++; } } @@ -131,42 +131,42 @@ u32 ov21_021D5948(u8 *param0, int param1, int param2, const UnkStruct_ov21_021D5 return v2; } -void ov21_021D59D8(CellActor *param0, int param1, int param2, int param3, int param4, const UnkStruct_ov21_021D5868 *param5, int param6, int param7) +void ov21_021D59D8(CellActor *actor, int param1, int param2, int param3, int param4, const UnkStruct_ov21_021D5868 *param5, int animID_1, int animID_2) { - VecFx32 v0; + VecFx32 position; - v0.x = (param5->unk_00 * param3) + param1; - v0.y = (param5->unk_01 * param4) + param2; - v0.x <<= FX32_SHIFT; - v0.y <<= FX32_SHIFT; + position.x = (param5->unk_00 * param3) + param1; + position.y = (param5->unk_01 * param4) + param2; + position.x <<= FX32_SHIFT; + position.y <<= FX32_SHIFT; - CellActor_SetPosition(param0, &v0); + CellActor_SetPosition(actor, &position); if (param5->unk_02) { - CellActor_SetAnim(param0, param7); + CellActor_SetAnim(actor, animID_2); } else { - CellActor_SetAnim(param0, param6); + CellActor_SetAnim(actor, animID_1); } } -int ov21_021D5A20(CellActor **param0, int param1, int param2, int param3, int param4, int param5, int param6, const UnkStruct_ov21_021D5868 *param7, const UnkStruct_ov21_021D5844 *param8, int param9, int param10, const u8 *param11, u32 param12, u32 *param13) +int ov21_021D5A20(CellActor **param0, int param1, int param2, int param3, int param4, int param5, int param6, const UnkStruct_ov21_021D5868 *zukan_enc_plat_0, const pokedexEncStruct *dexEncData, int param9, int param10, const u8 *param11, u32 param12, u32 *param13) { - int v0, v1; + int index, v1; int v2 = param1; int v3 = 0; - for (v0 = 0; v0 < param8->unk_04 - 1; v0++) { - GF_ASSERT(param8->unk_00[v0]); + for (index = 0; index < dexEncData->pokedexEncLength - 1; index++) { + GF_ASSERT(dexEncData->pokedexEncArray[index]); GF_ASSERT(v2 < param2); for (v1 = 0; v1 < param12; v1++) { - if (param8->unk_00[v0] == param11[v1]) { + if (dexEncData->pokedexEncArray[index] == param11[v1]) { break; } } if (v1 >= param12) { - ov21_021D59D8(param0[v2], param3, param4, param5, param6, ¶m7[param8->unk_00[v0]], param9, param10); + ov21_021D59D8(param0[v2], param3, param4, param5, param6, &zukan_enc_plat_0[dexEncData->pokedexEncArray[index]], param9, param10); v2++; v3++; } diff --git a/src/overlay021/ov21_021D5AEC.c b/src/overlay021/ov21_021D5AEC.c index c35e73ebb2..358cf52ec6 100644 --- a/src/overlay021/ov21_021D5AEC.c +++ b/src/overlay021/ov21_021D5AEC.c @@ -9,7 +9,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/ov21_021D4340.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/struct_ov21_021D0F60_decl.h" @@ -145,7 +145,7 @@ static void ov21_021D6B94(UnkStruct_ov21_021D71A8 *param0, const UnkStruct_ov21_ static void ov21_021D6BB0(UnkStruct_ov21_021D71A8 *param0, const UnkStruct_ov21_021D5B68 *param1); static void ov21_021D6C44(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13FC *param1, const UnkStruct_ov21_021D5B68 *param2, int param3); static void ov21_021D6CC8(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13FC *param1, const UnkStruct_ov21_021D5B68 *param2, int param3); -static void ov21_021D6D78(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13FC *param1, const UnkStruct_ov21_021D5B68 *param2, int param3, int param4, int param5); +static void ov21_021D6D78(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13FC *param1, const UnkStruct_ov21_021D5B68 *param2, int param3, int param4, int dexIndex); static void ov21_021D6DF4(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13FC *param1, int param2, int param3, int param4); static void ov21_021D6CA4(CellActor *param0, int *param1, int *param2); static fx32 ov21_021D6BF8(fx32 param0, fx32 param1, int param2, int param3); @@ -300,7 +300,7 @@ static int ov21_021D5CB8(UnkStruct_ov21_021E6A68 *param0, void *param1) { UnkStruct_ov21_021D5B68 *v0 = param1; - param0->unk_08 = Heap_AllocFromHeap(param0->unk_04, sizeof(UnkStruct_ov21_021D7464)); + param0->unk_08 = Heap_AllocFromHeap(param0->heapID, sizeof(UnkStruct_ov21_021D7464)); GF_ASSERT(param0->unk_08); memset(param0->unk_08, 0, sizeof(UnkStruct_ov21_021D7464)); @@ -333,7 +333,7 @@ static int ov21_021D5D04(UnkStruct_ov21_021E6A68 *param0, void *param1) v0->unk_18 = 0; param0->unk_00 = 1; } else { - ov21_021D5F7C(v0, v1, param0->unk_04); + ov21_021D5F7C(v0, v1, param0->heapID); } return 0; @@ -357,7 +357,7 @@ static int ov21_021D5D48(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo switch (param1->unk_00) { case 0: - v3 = Heap_AllocFromHeap(param1->unk_04, sizeof(UnkStruct_ov21_021D71A8)); + v3 = Heap_AllocFromHeap(param1->heapID, sizeof(UnkStruct_ov21_021D71A8)); GF_ASSERT(v3); param1->unk_08 = v3; ov21_021D6C24(v3, v1); @@ -366,9 +366,9 @@ static int ov21_021D5D48(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo break; case 1: if (v1->unk_04->unk_1740 == 0) { - ov21_021D6114(v3, v0->unk_00, v1, param1->unk_04); + ov21_021D6114(v3, v0->unk_00, v1, param1->heapID); } else { - ov21_021D61F4(v3, v0->unk_00, v1, param1->unk_04); + ov21_021D61F4(v3, v0->unk_00, v1, param1->heapID); } if (v1->unk_14) { @@ -418,14 +418,14 @@ static int ov21_021D5E2C(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo if (v3->unk_144 != v4) { v3->unk_144 = v4; ov21_021D6A58(v3, v1); - ov21_021D6CC8(v3, v0->unk_00, v1, param1->unk_04); + ov21_021D6CC8(v3, v0->unk_00, v1, param1->heapID); ov21_021D68C8(v3, v0->unk_00, v1); } ov21_021D69A0(v3, v1); ov21_021D6AE4(v3, v1); ov21_021D6BB0(v3, v1); - ov21_021D6C44(v3, v0->unk_00, v1, param1->unk_04); + ov21_021D6C44(v3, v0->unk_00, v1, param1->heapID); ov21_021D6F20(v3, v0->unk_00, v1); ov21_021D6F74(v1); @@ -445,7 +445,7 @@ static int ov21_021D5EA8(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo G2_BlendNone(); if (v1->unk_14) { - ov21_021D7160(v3, v0->unk_00, v1, param1->unk_04); + ov21_021D7160(v3, v0->unk_00, v1, param1->heapID); ov21_021D6F64(v0->unk_00, v1); ov21_021D7248(v3, v0, v1, 0); } else { @@ -573,7 +573,7 @@ static BOOL ov21_021D601C(UnkStruct_ov21_021D5B68 *param0, UnkStruct_ov21_021D74 if (param0->unk_2C) { int v0 = ov21_021D3898(param0->unk_04); - if (ov21_021D38B0(param0->unk_04, v0) != (NATIONAL_DEX_COUNT + 1)) { + if (Pokedex_Sort_SeenIndexToSpecies(param0->unk_04, v0) != (NATIONAL_DEX_COUNT + 1)) { ov21_021D7464(param1, param0); Sound_PlayEffect(1501); return 1; @@ -632,7 +632,7 @@ static void ov21_021D6114(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13 ov21_021D276C(param1, 0, 0, 0, 0, param3); ov21_021D62E4(param1, param3); ov21_021D637C(param0, param1, param3, ov21_021D36D8(param2->unk_04)); - ov21_021D63DC(param1, param3, ov21_021D38FC(param2->unk_04), ov21_021D3908(param2->unk_04)); + ov21_021D63DC(param1, param3, Pokedex_Sort_NumEncountered(param2->unk_04), Pokedex_Sort_NumCaught(param2->unk_04)); ov21_021D6538(param0, param3); ov21_021D65DC(param0, param1, param3); ov21_021D6744(param0, param1, param3); @@ -682,7 +682,7 @@ static void ov21_021D61F4(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13 param0->unk_4C = ov21_021D70C0(param1, param3); ov21_021D67EC(param0, param1, param2, param3); - ov21_021D64B0(param1, param3, ov21_021D38FC(param2->unk_04)); + ov21_021D64B0(param1, param3, Pokedex_Sort_NumEncountered(param2->unk_04)); ov21_021D6994(param0, param2); ov21_021D69A0(param0, param2); ov21_021D6AE4(param0, param2); @@ -871,8 +871,8 @@ static void ov21_021D67EC(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13 int v3; UnkStruct_ov21_021D4CB8 v4; Window *v5; - const UnkStruct_ov21_021D37DC *v6; - int v7; + const speciesCaughtStatusStruct *speciesCaughtStatus; + int dexIndex; v4.unk_00 = param1->unk_14C; v4.unk_08 = param0->unk_90.paletteProxy; @@ -895,11 +895,11 @@ static void ov21_021D67EC(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13 } if ((v1 >= 0) && (v1 < v3)) { - v7 = ov21_021D38B0(param2->unk_04, v1); + dexIndex = Pokedex_Sort_SeenIndexToSpecies(param2->unk_04, v1); - if (v7 != (NATIONAL_DEX_COUNT + 1)) { - v6 = ov21_021D37DC(param2->unk_04, v7); - v5 = ov21_021D16D8(param1, param2->unk_04, param3, v6->unk_00); + if (dexIndex != (NATIONAL_DEX_COUNT + 1)) { + speciesCaughtStatus = Pokedex_Sort_SpeciesCaughtStatus(param2->unk_04, dexIndex); + v5 = ov21_021D16D8(param1, param2->unk_04, param3, speciesCaughtStatus->species); v4.unk_04 = v5; param0->unk_28[v2] = ov21_021D4CB8(&v4, param0->unk_4C); ov21_021D4DA0(v5); @@ -917,22 +917,22 @@ static void ov21_021D67EC(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13 static void ov21_021D68C8(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13FC *param1, const UnkStruct_ov21_021D5B68 *param2) { - int v0; + int dexIndex; int v1; - const UnkStruct_ov21_021D37DC *v2; + const speciesCaughtStatusStruct *speciesCaughtStatus; v1 = ov21_021D3898(param2->unk_04); - v0 = ov21_021D375C(param2->unk_04); - v2 = ov21_021D37DC(param2->unk_04, v0); + dexIndex = ov21_021D375C(param2->unk_04); + speciesCaughtStatus = Pokedex_Sort_SpeciesCaughtStatus(param2->unk_04, dexIndex); - if (ov21_021D38B0(param2->unk_04, v1) == (NATIONAL_DEX_COUNT + 1)) { + if (Pokedex_Sort_SeenIndexToSpecies(param2->unk_04, v1) == (NATIONAL_DEX_COUNT + 1)) { ov21_021D217C(param1, 0); if (param0->unk_7C) { CellActor_SetDrawFlag(param0->unk_7C, 1); } } else { - ov21_021D1890(param1, param2->unk_04, v2->unk_00, 2, 56, 80); + ov21_021D1890(param1, param2->unk_04, speciesCaughtStatus->species, 2, 56, 80); ov21_021D217C(param1, 1); if (param0->unk_7C) { @@ -1081,14 +1081,14 @@ static void ov21_021D6AE4(UnkStruct_ov21_021D71A8 *param0, const UnkStruct_ov21_ VecFx32 v1; int v2; int v3; - BOOL v4; + BOOL isCaught; int v5; int v6; int v7; - const UnkStruct_ov21_021D37DC *v8; + const speciesCaughtStatusStruct *speciesCaughtStatus; int v9; int v10; - int v11; + int dexIndex; v6 = ov21_021D3898(param1->unk_04); v7 = ov21_021D38A4(param1->unk_04); @@ -1096,24 +1096,24 @@ static void ov21_021D6AE4(UnkStruct_ov21_021D71A8 *param0, const UnkStruct_ov21_ for (v2 = 0; v2 < 9; v2++) { v3 = (param0->unk_24 + v2) % 9; - v4 = 0; + isCaught = 0; v5 = ((v6 - 4) + v2); if ((v5 >= 0) && (v5 < v7)) { - v11 = ov21_021D38B0(param1->unk_04, v5); + dexIndex = Pokedex_Sort_SeenIndexToSpecies(param1->unk_04, v5); - if (v11 != (NATIONAL_DEX_COUNT + 1)) { - v8 = ov21_021D37DC(param1->unk_04, v11); + if (dexIndex != (NATIONAL_DEX_COUNT + 1)) { + speciesCaughtStatus = Pokedex_Sort_SpeciesCaughtStatus(param1->unk_04, dexIndex); - if (v8->unk_04 == 2) { - v4 = 1; + if (speciesCaughtStatus->caughtStatus == 2) { + isCaught = 1; } } } - CellActor_SetDrawFlag(param0->unk_50[v3], v4); + CellActor_SetDrawFlag(param0->unk_50[v3], isCaught); - if (v4) { + if (isCaught) { v0 = CellActor_GetPosition(param0->unk_00[v3]); v1.x = v0->x + (-54 * FX32_ONE); @@ -1236,7 +1236,7 @@ static void ov21_021D6CC8(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13 v2 %= 9; if ((v3 < v1) && (v3 >= 0)) { - v4 = ov21_021D38B0(param2->unk_04, v3); + v4 = Pokedex_Sort_SeenIndexToSpecies(param2->unk_04, v3); if (v4 != (NATIONAL_DEX_COUNT + 1)) { ov21_021D6D78(param0, param1, param2, param3, v2, v4); @@ -1252,14 +1252,14 @@ static void ov21_021D6CC8(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13 } } -static void ov21_021D6D78(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13FC *param1, const UnkStruct_ov21_021D5B68 *param2, int param3, int param4, int param5) +static void ov21_021D6D78(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13FC *param1, const UnkStruct_ov21_021D5B68 *param2, int param3, int param4, int dexIndex) { UnkStruct_ov21_021D4CB8 v0; Window *v1; - const UnkStruct_ov21_021D37DC *v2; + const speciesCaughtStatusStruct *speciesCaughtStatus; - v2 = ov21_021D37DC(param2->unk_04, param5); - GF_ASSERT(v2); + speciesCaughtStatus = Pokedex_Sort_SpeciesCaughtStatus(param2->unk_04, dexIndex); + GF_ASSERT(speciesCaughtStatus); v0.unk_00 = param1->unk_14C; v0.unk_08 = param0->unk_90.paletteProxy; @@ -1271,7 +1271,7 @@ static void ov21_021D6D78(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13 v0.unk_20 = NNS_G2D_VRAM_TYPE_2DMAIN; v0.unk_24 = param3; - v1 = ov21_021D16D8(param1, param2->unk_04, param3, v2->unk_00); + v1 = ov21_021D16D8(param1, param2->unk_04, param3, speciesCaughtStatus->species); if (param0->unk_28[param4]) { ov21_021D4D1C(param0->unk_28[param4]); @@ -1703,7 +1703,7 @@ static BOOL ov21_021D74B0(UnkStruct_ov21_021D5B68 *param0, int param1) if (ov21_021D36A4(param0->unk_04, v0)) { ov21_021D36C0(param0->unk_04, v0); Sound_PlayEffect(1501); - ov21_021D3684(param0->unk_04, 0, 0, 0, 0, 0, v0, param1); + Pokedex_Sort_Unfiltered(param0->unk_04, 0, 0, 0, 0, 0, v0, param1); ov21_021D36FC(param0->unk_04, 0); param0->unk_0C = 0; @@ -1721,12 +1721,13 @@ static BOOL ov21_021D74B0(UnkStruct_ov21_021D5B68 *param0, int param1) static void ov21_021D7538(UnkStruct_ov21_021D5B68 *param0, int param1) { - u32 v0 = ov21_021D37BC(param0->unk_04); + u32 species = Pokedex_Sort_CurrentSpecies(param0->unk_04); - ov21_021D3684(param0->unk_04, 0, 0, 0, 0, 0, ov21_021D36D8(param0->unk_04), param1); + Pokedex_Sort_Unfiltered(param0->unk_04, 0, 0, 0, 0, 0, ov21_021D36D8(param0->unk_04), param1); (*param0->unk_00) |= (1 << 4); - ov21_021D3794(param0->unk_04, v0); + ov21_021D3794(param0->unk_04, species); + param0->unk_0C = 0; param0->unk_04->unk_1740 = 0; diff --git a/src/overlay021/ov21_021D76B0.c b/src/overlay021/ov21_021D76B0.c index c0b44bdc4d..b1cee11816 100644 --- a/src/overlay021/ov21_021D76B0.c +++ b/src/overlay021/ov21_021D76B0.c @@ -10,7 +10,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/ov21_021D4340.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021D5AEC.h" @@ -116,8 +116,8 @@ static void ov21_021D8324(UnkStruct_ov21_021D7A64 *param0); static void ov21_021D8354(UnkStruct_ov21_021D7C64 *param0, UnkStruct_ov21_021D77E8 *param1, int param2, fx32 param3); static void ov21_021D83C0(UnkStruct_ov21_021D7C64 *param0, UnkStruct_ov21_021D77E8 *param1, const UnkStruct_ov21_021D77D4 *param2); static void ov21_021D8434(UnkStruct_ov21_021D7A64 *param0, int param1, int param2); -static BOOL ov21_021D84E0(UnkStruct_ov21_021D7A64 *param0, UnkStruct_ov21_021D3320 *param1); -static BOOL ov21_021D8508(UnkStruct_ov21_021D7A64 *param0, UnkStruct_ov21_021D3320 *param1); +static BOOL ov21_021D84E0(UnkStruct_ov21_021D7A64 *param0, pokedexStruct *param1); +static BOOL ov21_021D8508(UnkStruct_ov21_021D7A64 *param0, pokedexStruct *param1); static void ov21_021D8530(UnkStruct_ov21_021D7A64 *param0, UnkStruct_ov21_021D77D4 *param1); static fx32 ov21_021D8580(fx32 param0, s32 param1); @@ -236,7 +236,7 @@ static int ov21_021D7818(UnkStruct_ov21_021E6A68 *param0, void *param1) UnkStruct_ov21_021D7A64 *v1; int v2; - param0->unk_08 = Heap_AllocFromHeap(param0->unk_04, sizeof(UnkStruct_ov21_021D7A64)); + param0->unk_08 = Heap_AllocFromHeap(param0->heapID, sizeof(UnkStruct_ov21_021D7A64)); GF_ASSERT(param0->unk_08); memset(param0->unk_08, 0, sizeof(UnkStruct_ov21_021D7A64)); @@ -248,7 +248,7 @@ static int ov21_021D7818(UnkStruct_ov21_021E6A68 *param0, void *param1) v0->unk_00[v2] = (3 + 1); } - ov21_021D7A64(param0->unk_08, v0, param0->unk_04); + ov21_021D7A64(param0->unk_08, v0, param0->heapID); return 1; } @@ -296,13 +296,13 @@ static int ov21_021D78C0(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo switch (param1->unk_00) { case 0: - param1->unk_08 = Heap_AllocFromHeap(param1->unk_04, sizeof(UnkStruct_ov21_021D7C64)); + param1->unk_08 = Heap_AllocFromHeap(param1->heapID, sizeof(UnkStruct_ov21_021D7C64)); GF_ASSERT(param1->unk_08); memset(param1->unk_08, 0, sizeof(UnkStruct_ov21_021D7C64)); param1->unk_00++; break; case 1: - ov21_021D7C64(v3, v2, v0, param1->unk_04); + ov21_021D7C64(v3, v2, v0, param1->heapID); param1->unk_00++; break; case 2: @@ -368,7 +368,7 @@ static int ov21_021D79E4(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo } break; case 2: - ov21_021D7CAC(v3, v2, param1->unk_04); + ov21_021D7CAC(v3, v2, param1->heapID); param1->unk_00++; break; case 3: @@ -446,7 +446,7 @@ static void ov21_021D7B8C(u32 param0, u32 param1, void *param2) UnkStruct_ov21_021D7B8C *v0 = param2; UnkStruct_ov21_021D77D4 *v1 = v0->unk_04; UnkStruct_ov21_021D7A64 *v2 = v0->unk_00; - UnkStruct_ov21_021D3320 *v3 = v1->unk_1C->unk_04; + pokedexStruct *v3 = v1->unk_1C->unk_04; int v4; int v5; @@ -475,7 +475,7 @@ static void ov21_021D7B8C(u32 param0, u32 param1, void *param2) break; case 4: if (v2->unk_20 == 0) { - v4 = ov21_021D3768(v3); + v4 = Pokedex_Sort_CompletionNumEncountered(v3); ov21_021D853C(v1, v4 - 1); } break; @@ -784,7 +784,7 @@ static void ov21_021D828C(UnkStruct_ov21_021D77E8 *param0, int param1) static void ov21_021D82A8(UnkStruct_ov21_021D7A64 *param0, UnkStruct_ov21_021D77D4 *param1) { int v0; - UnkStruct_ov21_021D3320 *v1 = param1->unk_1C->unk_04; + pokedexStruct *v1 = param1->unk_1C->unk_04; if (param1->unk_1C->unk_0C <= 0) { if (param0->unk_10 != 0) { @@ -941,7 +941,7 @@ static void ov21_021D84B8(UnkStruct_ov21_021D77D4 *param0) } } -static BOOL ov21_021D84E0(UnkStruct_ov21_021D7A64 *param0, UnkStruct_ov21_021D3320 *param1) +static BOOL ov21_021D84E0(UnkStruct_ov21_021D7A64 *param0, pokedexStruct *param1) { int v0; @@ -960,7 +960,7 @@ static BOOL ov21_021D84E0(UnkStruct_ov21_021D7A64 *param0, UnkStruct_ov21_021D33 return 1; } -static BOOL ov21_021D8508(UnkStruct_ov21_021D7A64 *param0, UnkStruct_ov21_021D3320 *param1) +static BOOL ov21_021D8508(UnkStruct_ov21_021D7A64 *param0, pokedexStruct *param1) { int v0; diff --git a/src/overlay021/ov21_021D85B0.c b/src/overlay021/ov21_021D85B0.c index 09097b60b2..e2873c8563 100644 --- a/src/overlay021/ov21_021D85B0.c +++ b/src/overlay021/ov21_021D85B0.c @@ -8,7 +8,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/ov21_021D4340.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" @@ -35,7 +35,7 @@ typedef struct { int *unk_00; - UnkStruct_ov21_021D3320 *unk_04; + pokedexStruct *unk_04; UnkStruct_ov21_021D5B68 *unk_08; int unk_0C; int unk_10; @@ -327,7 +327,7 @@ static int ov21_021D87CC(UnkStruct_ov21_021E6A68 *param0, void *param1) UnkStruct_ov21_021D8788 *v0 = param1; UnkStruct_ov21_021D87CC *v1; - v1 = Heap_AllocFromHeap(param0->unk_04, sizeof(UnkStruct_ov21_021D87CC)); + v1 = Heap_AllocFromHeap(param0->heapID, sizeof(UnkStruct_ov21_021D87CC)); GF_ASSERT(v1); memset(v1, 0, sizeof(UnkStruct_ov21_021D87CC)); @@ -400,7 +400,7 @@ static int ov21_021D8804(UnkStruct_ov21_021E6A68 *param0, void *param1) break; case 3: v2 = 1; - v2 = ov21_021D3464(v0->unk_04, v0->unk_10, v0->unk_14, v0->unk_18, v0->unk_1C, v0->unk_20, ov21_021D36D8(v0->unk_04), param0->unk_04, 1); + v2 = Pokedex_Sort(v0->unk_04, v0->unk_10, v0->unk_14, v0->unk_18, v0->unk_1C, v0->unk_20, ov21_021D36D8(v0->unk_04), param0->heapID, 1); if (v2 == 1) { *v0->unk_00 |= (0x1 << 1); @@ -455,12 +455,12 @@ static int ov21_021D893C(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo switch (param1->unk_00) { case 0: - param1->unk_08 = Heap_AllocFromHeap(param1->unk_04, sizeof(UnkStruct_ov21_021D9320)); + param1->unk_08 = Heap_AllocFromHeap(param1->heapID, sizeof(UnkStruct_ov21_021D9320)); memset(param1->unk_08, 0, sizeof(UnkStruct_ov21_021D9320)); param1->unk_00++; break; case 1: - ov21_021D8A7C(v3, v2, v0, v1, param1->unk_04); + ov21_021D8A7C(v3, v2, v0, v1, param1->heapID); sub_0200AAE0(1, 0, -16, (GX_BLEND_PLANEMASK_BG0 | GX_BLEND_PLANEMASK_BG1 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_OBJ | GX_BLEND_PLANEMASK_BD), 1); param1->unk_00++; break; @@ -484,11 +484,11 @@ static int ov21_021D89B8(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo UnkStruct_ov21_021D9320 *v3 = param1->unk_08; if (v0->unk_30 == 0) { - ov21_021D8ED4(v3, v2, v0, param1->unk_04); + ov21_021D8ED4(v3, v2, v0, param1->heapID); } else if ((v0->unk_30 == 1) || (v0->unk_30 == 3)) { - ov21_021D9320(v3, v2, v0, param1->unk_04); + ov21_021D9320(v3, v2, v0, param1->heapID); } else if (v0->unk_30 != 4) { - ov21_021D9390(v3, v2, v0, param1->unk_04); + ov21_021D9390(v3, v2, v0, param1->heapID); } return 0; diff --git a/src/overlay021/ov21_021D94BC.c b/src/overlay021/ov21_021D94BC.c index d78cb5136e..c92720b71c 100644 --- a/src/overlay021/ov21_021D94BC.c +++ b/src/overlay021/ov21_021D94BC.c @@ -9,7 +9,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021D4EE4.h" #include "overlay021/ov21_021D85B0.h" @@ -43,7 +43,7 @@ typedef struct { int *unk_00; - UnkStruct_ov21_021D3320 *unk_04; + pokedexStruct *unk_04; UnkStruct_ov21_021E68F4 *unk_08; UnkStruct_ov21_021E68F4 *unk_0C; } UnkStruct_ov21_021D95B8; @@ -310,7 +310,7 @@ static int ov21_021D95E8(UnkStruct_ov21_021E6A68 *param0, void *param1) UnkStruct_ov21_021D9B24 *v1; int v2; - v1 = Heap_AllocFromHeap(param0->unk_04, sizeof(UnkStruct_ov21_021D9B24)); + v1 = Heap_AllocFromHeap(param0->heapID, sizeof(UnkStruct_ov21_021D9B24)); GF_ASSERT(v1); memset(v1, 0, sizeof(UnkStruct_ov21_021D9B24)); @@ -319,8 +319,8 @@ static int ov21_021D95E8(UnkStruct_ov21_021E6A68 *param0, void *param1) v1->unk_80 = 0xffff; ov21_021DC35C(v1, v0); - ov21_021D9ADC(v1, v0, param0->unk_04); - ov21_021DB3E0(v1, param0->unk_04); + ov21_021D9ADC(v1, v0, param0->heapID); + ov21_021DB3E0(v1, param0->heapID); ov21_021DB428(v1, v0); for (v2 = 0; v2 < 6; v2++) { @@ -383,8 +383,8 @@ static int ov21_021D964C(UnkStruct_ov21_021E6A68 *param0, void *param1) v1->unk_24 = v3; v1->unk_28 = v1->unk_20; - ov21_021D9B34(v1, v0, param0->unk_04); - ov21_021DB468(v1, param0->unk_04); + ov21_021D9B34(v1, v0, param0->heapID); + ov21_021DB468(v1, param0->heapID); ov21_021DC35C(v1, v0); if (v4 != v1->unk_24) { @@ -434,12 +434,12 @@ static int ov21_021D97A0(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo switch (param1->unk_00) { case 0: - param1->unk_08 = Heap_AllocFromHeap(param1->unk_04, sizeof(UnkStruct_ov21_021DC96C)); + param1->unk_08 = Heap_AllocFromHeap(param1->heapID, sizeof(UnkStruct_ov21_021DC96C)); memset(param1->unk_08, 0, sizeof(UnkStruct_ov21_021DC96C)); param1->unk_00++; break; case 1: - ov21_021D9A08(v3, v2, v0, v1, param1->unk_04); + ov21_021D9A08(v3, v2, v0, v1, param1->heapID); sub_0200AAE0(1, 0, -16, (GX_BLEND_PLANEMASK_BG0 | GX_BLEND_PLANEMASK_BG1 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_OBJ | GX_BLEND_PLANEMASK_BD), 2); ov21_021DB480(v2, v1, v0); param1->unk_00++; @@ -483,12 +483,12 @@ static int ov21_021D9830(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo ov21_021DBDA0(v3); } - ov21_021DB79C(v3, v2, param1->unk_04); - ov21_021DBE3C(v3, v2, param1->unk_04); + ov21_021DB79C(v3, v2, param1->heapID); + ov21_021DBE3C(v3, v2, param1->heapID); if (v3->unk_104 == 3) { - ov21_021DB634(v3, v2, param1->unk_04); - ov21_021DBBE4(v3, v2, param1->unk_04); + ov21_021DB634(v3, v2, param1->heapID); + ov21_021DBBE4(v3, v2, param1->heapID); } ov21_021DC8B4(v3, GX_OAM_MODE_XLU, v3->unk_104, v3->unk_108); diff --git a/src/overlay021/ov21_021DC9BC.c b/src/overlay021/ov21_021DC9BC.c index b4dc7369c7..d626d6af26 100644 --- a/src/overlay021/ov21_021DC9BC.c +++ b/src/overlay021/ov21_021DC9BC.c @@ -9,7 +9,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021D517C.h" #include "overlay021/ov21_021D57B4.h" @@ -38,6 +38,8 @@ #include "unk_02018340.h" #include "unk_0201F834.h" +#include "rtc.h" + static const u16 Unk_ov21_021E9D78[] = { 0xffff }; @@ -71,9 +73,15 @@ static const u16 Unk_ov21_021E9D7A[] = { 0xffff }; +enum EncounterTime { + ENCTIME_MORNING = 0, + ENCTIME_DAY = 1, + ENCTIME_NIGHT = 2, +}; + typedef struct { - UnkStruct_ov21_021D3320 *unk_00; - int unk_04; + pokedexStruct *pokedexS; + int encounterTime; UnkStruct_ov21_021E68F4 *unk_08; } UnkStruct_ov21_021DCACC; @@ -86,19 +94,19 @@ typedef struct { } UnkStruct_ov21_021DCAE0; typedef struct { - int unk_00; + int encounterTime; u8 *unk_04; u8 *unk_08; - u32 unk_0C; + u32 heapSize; u32 unk_10; - UnkStruct_ov21_021D5844 unk_14; - UnkStruct_ov21_021D5844 unk_1C; - UnkStruct_ov21_021D5844 unk_24; - UnkStruct_ov21_021D5844 unk_2C; + pokedexEncStruct dexEnc0; + pokedexEncStruct dexEnc1; + pokedexEncStruct dexEnc2; + pokedexEncStruct dexEnc3; } UnkStruct_ov21_021DDABC; typedef struct { - int unk_00; + int encounterTime; CellActor *unk_04[44]; SpriteResource *unk_B4[4]; int unk_C4; @@ -112,8 +120,8 @@ typedef struct { NNSG2dCharacterData *unk_7F8; void *unk_7FC; NNSG2dCharacterData *unk_800; - UnkStruct_ov21_021D5868 *unk_804; - UnkStruct_ov21_021D5890 *unk_808; + UnkStruct_ov21_021D5868 *zukan_enc_plat_0; + UnkStruct_ov21_021D5890 *zukan_enc_plat_2; int unk_80C; int unk_810; UnkStruct_ov21_021D2648 unk_814; @@ -123,7 +131,7 @@ typedef struct { u32 unk_840; } UnkStruct_ov21_021DD420; -static UnkStruct_ov21_021DCACC *ov21_021DCA5C(int param0, UnkStruct_ov21_021D0F60 *param1); +static UnkStruct_ov21_021DCACC *ov21_021DCA5C(int heapID, UnkStruct_ov21_021D0F60 *param1); static UnkStruct_ov21_021DCAE0 *ov21_021DCAA0(int param0, UnkStruct_ov21_021D0F60 *param1); static void ov21_021DCACC(UnkStruct_ov21_021DCACC *param0); static void ov21_021DCAE0(UnkStruct_ov21_021DCAE0 *param0); @@ -157,22 +165,22 @@ static void ov21_021DDA48(UnkStruct_ov21_021DD420 *param0, int param1); static void ov21_021DDA80(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCAE0 *param1, const UnkStruct_ov21_021DCACC *param2, const UnkStruct_ov21_021DDABC *param3, int param4); static void ov21_021DD710(UnkStruct_ov21_021DD420 *param0, const UnkStruct_ov21_021DCACC *param1, const UnkStruct_ov21_021DDABC *param2, int param3); static void ov21_021DD8B4(UnkStruct_ov21_021DD420 *param0); -static u8 *ov21_021DD900(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 *param2); +static u8 *ov21_021DD900(u32 heapID, const UnkStruct_ov21_021DCACC *param1, u32 *param2); static u8 *ov21_021DD908(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 *param2); static void ov21_021DD964(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCAE0 *param1); static void ov21_021DDB8C(UnkStruct_ov21_021DD420 *param0); static void ov21_021DDBCC(UnkStruct_ov21_021DD420 *param0); static void ov21_021DDC14(UnkStruct_ov21_021DD420 *param0); -static void ov21_021DDABC(UnkStruct_ov21_021DDABC *param0, UnkStruct_ov21_021DCACC *param1, int param2); +static void ov21_021DDABC(UnkStruct_ov21_021DDABC *param0, UnkStruct_ov21_021DCACC *param1, int heapID); static void ov21_021DDB68(UnkStruct_ov21_021DDABC *param0); -void ov21_021DC9BC(UnkStruct_ov21_021E68F4 *param0, UnkStruct_ov21_021D0F60 *param1, int param2) +void ov21_021DC9BC(UnkStruct_ov21_021E68F4 *param0, UnkStruct_ov21_021D0F60 *param1, int heapID) { UnkStruct_ov21_021DCACC *v0; UnkStruct_ov21_021DCAE0 *v1; - v0 = ov21_021DCA5C(param2, param1); - v1 = ov21_021DCAA0(param2, param1); + v0 = ov21_021DCA5C(heapID, param1); + v1 = ov21_021DCAA0(heapID, param1); param0->unk_00 = v0; param0->unk_04 = v1; @@ -195,15 +203,15 @@ void ov21_021DCA14(UnkStruct_ov21_021E68F4 *param0) int ov21_021DCA28(const UnkStruct_ov21_021E68F4 *param0) { const UnkStruct_ov21_021DCACC *v0 = param0->unk_00; - return v0->unk_04; + return v0->encounterTime; } -void ov21_021DCA30(UnkStruct_ov21_021E68F4 *param0, int param1) +void ov21_021DCA30(UnkStruct_ov21_021E68F4 *param0, int encounterTime) { UnkStruct_ov21_021DCACC *v0 = param0->unk_00; - GF_ASSERT(param1 < 3); - v0->unk_04 = param1; + GF_ASSERT(encounterTime < 3); + v0->encounterTime = encounterTime; } void ov21_021DCA44(UnkStruct_ov21_021E68F4 *param0, int param1, int param2) @@ -226,16 +234,16 @@ void ov21_021DCA54(UnkStruct_ov21_021E68F4 *param0, int param1) v0->unk_10 = param1; } -static UnkStruct_ov21_021DCACC *ov21_021DCA5C(int param0, UnkStruct_ov21_021D0F60 *param1) +static UnkStruct_ov21_021DCACC *ov21_021DCA5C(int heapID, UnkStruct_ov21_021D0F60 *param1) { UnkStruct_ov21_021DCACC *v0; - v0 = Heap_AllocFromHeap(param0, sizeof(UnkStruct_ov21_021DCACC)); + v0 = Heap_AllocFromHeap(heapID, sizeof(UnkStruct_ov21_021DCACC)); GF_ASSERT(v0); memset(v0, 0, sizeof(UnkStruct_ov21_021DCACC)); - v0->unk_00 = ov21_021D13EC(param1); + v0->pokedexS = ov21_021D13EC(param1); v0->unk_08 = ov21_021D1410(param1, 5); return v0; @@ -273,34 +281,34 @@ static int ov21_021DCAF4(void) return 0; } -static int ov21_021DCAF8(UnkStruct_ov21_021E6A68 *param0, void *param1) +static int ov21_021DCAF8(UnkStruct_ov21_021E6A68 *param0, void *param1)// dansim { UnkStruct_ov21_021DCACC *v0 = param1; UnkStruct_ov21_021DDABC *v1; - v1 = Heap_AllocFromHeap(param0->unk_04, sizeof(UnkStruct_ov21_021DDABC)); + v1 = Heap_AllocFromHeap(param0->heapID, sizeof(UnkStruct_ov21_021DDABC)); GF_ASSERT(v1); memset(v1, 0, sizeof(UnkStruct_ov21_021DDABC)); param0->unk_08 = v1; - if (v0->unk_00->unk_1744 == 0) { - v0->unk_04 = 0; + if (v0->pokedexS->timeOfDay == TOD_MORNING) { + v0->encounterTime = ENCTIME_MORNING; } else { - if ((v0->unk_00->unk_1744 == 1) || (v0->unk_00->unk_1744 == 2)) { - v0->unk_04 = 1; + if ((v0->pokedexS->timeOfDay == TOD_DAY) || (v0->pokedexS->timeOfDay == TOD_TWILIGHT)) { + v0->encounterTime = ENCTIME_DAY; } else { - v0->unk_04 = 2; + v0->encounterTime = ENCTIME_NIGHT; } } - v1->unk_04 = ov21_021DD900(param0->unk_04, v0, &v1->unk_0C); - v1->unk_08 = ov21_021DD908(param0->unk_04, v0, &v1->unk_10); + v1->unk_04 = ov21_021DD900(param0->heapID, v0, &v1->heapSize); + v1->unk_08 = ov21_021DD908(param0->heapID, v0, &v1->unk_10); - ov21_021DDABC(v1, v0, param0->unk_04); + ov21_021DDABC(v1, v0, param0->heapID); - v1->unk_00 = v0->unk_04; + v1->encounterTime = v0->encounterTime; return 1; } @@ -318,10 +326,10 @@ static int ov21_021DCB6C(UnkStruct_ov21_021E6A68 *param0, void *param1) return 0; } - if (v1->unk_00 != v0->unk_04) { + if (v1->encounterTime != v0->encounterTime) { ov21_021DDB68(v1); - ov21_021DDABC(v1, v0, param0->unk_04); - v1->unk_00 = v0->unk_04; + ov21_021DDABC(v1, v0, param0->heapID); + v1->encounterTime = v0->encounterTime; } return 0; @@ -357,19 +365,19 @@ static int ov21_021DCBD8(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo switch (param1->unk_00) { case 0: - param1->unk_08 = Heap_AllocFromHeap(param1->unk_04, sizeof(UnkStruct_ov21_021DD420)); + param1->unk_08 = Heap_AllocFromHeap(param1->heapID, sizeof(UnkStruct_ov21_021DD420)); memset(param1->unk_08, 0, sizeof(UnkStruct_ov21_021DD420)); v3 = param1->unk_08; - v3->unk_00 = v0->unk_04; - v3->unk_804 = ov21_021D5868(param1->unk_04, NULL); - v3->unk_808 = ov21_021D5890(param1->unk_04, NULL); + v3->encounterTime = v0->encounterTime; + v3->zukan_enc_plat_0 = ov21_021D5868(param1->heapID, NULL); + v3->zukan_enc_plat_2 = ov21_021D5890(param1->heapID, NULL); param1->unk_00++; break; case 1: - ov21_021DCDD0(v3, v2, v0, v1, param1->unk_04); - ov21_021DD710(param1->unk_08, v0, v1, param1->unk_04); + ov21_021DCDD0(v3, v2, v0, v1, param1->heapID); + ov21_021DD710(param1->unk_08, v0, v1, param1->heapID); ov21_021DD9E8(param1->unk_08, v1); ov21_021DDB8C(v3); ov21_021DD964(v3, v2); @@ -409,7 +417,7 @@ static int ov21_021DCCD8(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo UnkStruct_ov21_021DD420 *v3 = param1->unk_08; ov21_021DDC14(v3); - ov21_021DDA80(v3, v2, v0, v1, param1->unk_04); + ov21_021DDA80(v3, v2, v0, v1, param1->heapID); return 0; } @@ -452,8 +460,8 @@ static int ov21_021DCD04(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo break; case 3: GXLayers_EngineAToggleLayers(GX_BLEND_PLANEMASK_BG1, 1); - Heap_FreeToHeap(v3->unk_804); - Heap_FreeToHeap(v3->unk_808); + Heap_FreeToHeap(v3->zukan_enc_plat_0); + Heap_FreeToHeap(v3->zukan_enc_plat_2); Heap_FreeToHeap(param1->unk_08); param1->unk_08 = NULL; param1->unk_00++; @@ -472,7 +480,7 @@ static void ov21_021DCDD0(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCA ov21_021DCFC8(param0, param1, param4); ov21_021DD1A8(param0, param1, param4); ov21_021DD2E0(param0, param1, param2, param4); - ov21_021DDA48(param0, param2->unk_04); + ov21_021DDA48(param0, param2->encounterTime); ov21_021DDCF4(param1, param2); } @@ -496,28 +504,28 @@ static void ov21_021DCE40(UnkStruct_ov21_021DCAE0 *param0, const UnkStruct_ov21_ sub_020198C0(param0->unk_00->unk_00, 3, v1->rawData, 0, 0, v1->screenWidth / 8, v1->screenHeight / 8); Heap_FreeToHeap(v0); - if (param1->unk_00->unk_1764) { + if (param1->pokedexS->pokedexSFlag_2) { v0 = ov21_021D27B8(param0->unk_00, 65, 1, &v1, param2); sub_020198C0(param0->unk_00->unk_00, 3, v1->rawData, 13, 8, v1->screenWidth / 8, v1->screenHeight / 8); Heap_FreeToHeap(v0); } - if (param1->unk_00->unk_176C) { + if (param1->pokedexS->pokedexSFlag_4) { v0 = ov21_021D27B8(param0->unk_00, 66, 1, &v1, param2); sub_020198C0(param0->unk_00->unk_00, 3, v1->rawData, 28, 7, v1->screenWidth / 8, v1->screenHeight / 8); Heap_FreeToHeap(v0); } - if (param1->unk_00->unk_1760) { + if (param1->pokedexS->pokedexSFlag_1) { v0 = ov21_021D27B8(param0->unk_00, 67, 1, &v1, param2); sub_020198C0(param0->unk_00->unk_00, 3, v1->rawData, 11, 8, v1->screenWidth / 8, v1->screenHeight / 8); Heap_FreeToHeap(v0); } - if (param1->unk_00->unk_1768) { + if (param1->pokedexS->pokedexSFlag_3) { v0 = ov21_021D27B8(param0->unk_00, 68, 1, &v1, param2); sub_020198C0(param0->unk_00->unk_00, 3, v1->rawData, 25, 16, v1->screenWidth / 8, v1->screenHeight / 8); @@ -822,38 +830,38 @@ static void ov21_021DD6C0(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCA sub_0201C2B4(¶m1->unk_00->unk_04, 0); } -static void ov21_021DD710(UnkStruct_ov21_021DD420 *param0, const UnkStruct_ov21_021DCACC *param1, const UnkStruct_ov21_021DDABC *param2, int param3) +static void ov21_021DD710(UnkStruct_ov21_021DD420 *param0, const UnkStruct_ov21_021DCACC *param1, const UnkStruct_ov21_021DDABC *param2, int heapID) { - int v0, v1; + int index, v1; int v2, v3; int v4, v5; - int v6; + int species; u8 *v7; - int v8; + int heapSize; ov21_021DD8B4(param0); - param0->unk_838 = ov21_021D5948(param0->unk_EC, 30, 30, param0->unk_808, ¶m2->unk_1C, param2->unk_04, param2->unk_0C); - v8 = (param2->unk_1C.unk_04 - 1) + param2->unk_0C; - v7 = Heap_AllocFromHeapAtEnd(param3, v8); + param0->unk_838 = ov21_021D5948(param0->unk_EC, 30, 30, param0->zukan_enc_plat_2, ¶m2->dexEnc1, param2->unk_04, param2->heapSize); + heapSize = (param2->dexEnc1.pokedexEncLength - 1) + param2->heapSize; + v7 = Heap_AllocFromHeapAtEnd(heapID, heapSize); - for (v0 = 0; v0 < v8; v0++) { - if (v0 < param2->unk_0C) { - v7[v0] = param2->unk_04[v0]; + for (index = 0; index < heapSize; index++) { + if (index < param2->heapSize) { + v7[index] = param2->unk_04[index]; } else { - v7[v0] = param2->unk_1C.unk_00[v0 - param2->unk_0C]; + v7[index] = param2->dexEnc1.pokedexEncArray[index - param2->heapSize]; } } - param0->unk_840 = ov21_021D5948(param0->unk_470, 30, 30, param0->unk_808, ¶m2->unk_2C, v7, v8); + param0->unk_840 = ov21_021D5948(param0->unk_470, 30, 30, param0->zukan_enc_plat_2, ¶m2->dexEnc3, v7, heapSize); Heap_FreeToHeap(v7); ov21_021D5214(param0->unk_EC, 30, 30); ov21_021D5214(param0->unk_470, 30, 30); - v6 = ov21_021D37BC(param1->unk_00); + species = Pokedex_Sort_CurrentSpecies(param1->pokedexS); - if (v6 == 349) { + if (species == SPECIES_FEEBAS) { v2 = 4; v3 = 5; v4 = 92 + 0; @@ -866,20 +874,20 @@ static void ov21_021DD710(UnkStruct_ov21_021DD420 *param0, const UnkStruct_ov21_ } param0->unk_C4 = 0; - param0->unk_C4 = ov21_021D5A20(param0->unk_04, param0->unk_C4, (22 * 2), v4, v5, 5, 5, param0->unk_804, ¶m2->unk_14, 2, v2, param2->unk_08, param2->unk_10, ¶m0->unk_834); + param0->unk_C4 = ov21_021D5A20(param0->unk_04, param0->unk_C4, (22 * 2), v4, v5, 5, 5, param0->zukan_enc_plat_0, ¶m2->dexEnc0, 2, v2, param2->unk_08, param2->unk_10, ¶m0->unk_834); - v8 = (param2->unk_14.unk_04 - 1) + param2->unk_10; - v7 = Heap_AllocFromHeapAtEnd(param3, v8); + heapSize = (param2->dexEnc0.pokedexEncLength - 1) + param2->unk_10; + v7 = Heap_AllocFromHeapAtEnd(heapID, heapSize); - for (v0 = 0; v0 < v8; v0++) { - if (v0 < param2->unk_10) { - v7[v0] = param2->unk_08[v0]; + for (index = 0; index < heapSize; index++) { + if (index < param2->unk_10) { + v7[index] = param2->unk_08[index]; } else { - v7[v0] = param2->unk_14.unk_00[v0 - param2->unk_10]; + v7[index] = param2->dexEnc0.pokedexEncArray[index - param2->unk_10]; } } - param0->unk_C4 = ov21_021D5A20(param0->unk_04, param0->unk_C4, (22 * 2), v4, v5, 5, 5, param0->unk_804, ¶m2->unk_24, 3, v3, v7, v8, ¶m0->unk_83C); + param0->unk_C4 = ov21_021D5A20(param0->unk_04, param0->unk_C4, (22 * 2), v4, v5, 5, 5, param0->zukan_enc_plat_0, ¶m2->dexEnc2, 3, v3, v7, heapSize, ¶m0->unk_83C); Heap_FreeToHeap(v7); } @@ -898,7 +906,7 @@ static void ov21_021DD8B4(UnkStruct_ov21_021DD420 *param0) param0->unk_C4 = 0; } -static u8 *ov21_021DD900(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 *param2) +static u8 *ov21_021DD900(u32 heapID, const UnkStruct_ov21_021DCACC *param1, u32 *heapSize) { u32 v0; int v1; @@ -906,7 +914,7 @@ static u8 *ov21_021DD900(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 v0 = 0; - if (param1->unk_00->unk_1760 == 0) { + if (param1->pokedexS->pokedexSFlag_1 == 0) { v1 = 0; while (Unk_ov21_021E9D78[v1] != 0xffff) { @@ -915,7 +923,7 @@ static u8 *ov21_021DD900(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 } } - if (param1->unk_00->unk_176C == 0) { + if (param1->pokedexS->pokedexSFlag_4 == 0) { v1 = 0; while (Unk_ov21_021E9D74[v1] != 0xffff) { @@ -924,7 +932,7 @@ static u8 *ov21_021DD900(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 } } - if (param1->unk_00->unk_1764 == 0) { + if (param1->pokedexS->pokedexSFlag_2 == 0) { v1 = 0; while (Unk_ov21_021E9D70[v1] != 0xffff) { @@ -933,7 +941,7 @@ static u8 *ov21_021DD900(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 } } - if (param1->unk_00->unk_1768 == 0) { + if (param1->pokedexS->pokedexSFlag_3 == 0) { v1 = 0; while (Unk_ov21_021E9D6C[v1] != 0xffff) { @@ -943,14 +951,14 @@ static u8 *ov21_021DD900(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 } if (v0 > 0) { - v2 = Heap_AllocFromHeap(param0, sizeof(u8) * v0); + v2 = Heap_AllocFromHeap(heapID, sizeof(u8) * v0); } else { v2 = NULL; } - *param2 = v0; + *heapSize = v0; - if (param1->unk_00->unk_1760 == 0) { + if (param1->pokedexS->pokedexSFlag_1 == 0) { v1 = 0; while (Unk_ov21_021E9D78[v1] != 0xffff) { @@ -960,7 +968,7 @@ static u8 *ov21_021DD900(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 } } - if (param1->unk_00->unk_176C == 0) { + if (param1->pokedexS->pokedexSFlag_4 == 0) { v1 = 0; while (Unk_ov21_021E9D74[v1] != 0xffff) { @@ -970,7 +978,7 @@ static u8 *ov21_021DD900(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 } } - if (param1->unk_00->unk_1764 == 0) { + if (param1->pokedexS->pokedexSFlag_2 == 0) { v1 = 0; while (Unk_ov21_021E9D70[v1] != 0xffff) { @@ -980,7 +988,7 @@ static u8 *ov21_021DD900(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 } } - if (param1->unk_00->unk_1768 == 0) { + if (param1->pokedexS->pokedexSFlag_3 == 0) { v1 = 0; while (Unk_ov21_021E9D6C[v1] != 0xffff) { @@ -1001,7 +1009,7 @@ static u8 *ov21_021DD908(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 v0 = 0; - if (param1->unk_00->unk_1760 == 0) { + if (param1->pokedexS->pokedexSFlag_1 == 0) { v1 = 0; while (Unk_ov21_021E9D76[v1] != 0xffff) { @@ -1010,7 +1018,7 @@ static u8 *ov21_021DD908(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 } } - if (param1->unk_00->unk_176C == 0) { + if (param1->pokedexS->pokedexSFlag_4 == 0) { v1 = 0; while (Unk_ov21_021E9D72[v1] != 0xffff) { @@ -1019,7 +1027,7 @@ static u8 *ov21_021DD908(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 } } - if (param1->unk_00->unk_1764 == 0) { + if (param1->pokedexS->pokedexSFlag_2 == 0) { v1 = 0; while (Unk_ov21_021E9D6E[v1] != 0xffff) { @@ -1028,7 +1036,7 @@ static u8 *ov21_021DD908(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 } } - if (param1->unk_00->unk_1768 == 0) { + if (param1->pokedexS->pokedexSFlag_3 == 0) { v1 = 0; while (Unk_ov21_021E9D7A[v1] != 0xffff) { @@ -1047,7 +1055,7 @@ static u8 *ov21_021DD908(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 v0 = 0; - if (param1->unk_00->unk_1760 == 0) { + if (param1->pokedexS->pokedexSFlag_1 == 0) { v1 = 0; while (Unk_ov21_021E9D76[v1] != 0xffff) { @@ -1057,7 +1065,7 @@ static u8 *ov21_021DD908(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 } } - if (param1->unk_00->unk_176C == 0) { + if (param1->pokedexS->pokedexSFlag_4 == 0) { v1 = 0; while (Unk_ov21_021E9D72[v1] != 0xffff) { @@ -1067,7 +1075,7 @@ static u8 *ov21_021DD908(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 } } - if (param1->unk_00->unk_1764 == 0) { + if (param1->pokedexS->pokedexSFlag_2 == 0) { v1 = 0; while (Unk_ov21_021E9D6E[v1] != 0xffff) { @@ -1077,7 +1085,7 @@ static u8 *ov21_021DD908(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 } } - if (param1->unk_00->unk_1768 == 0) { + if (param1->pokedexS->pokedexSFlag_3 == 0) { v1 = 0; while (Unk_ov21_021E9D7A[v1] != 0xffff) { @@ -1126,31 +1134,31 @@ static void ov21_021DDA48(UnkStruct_ov21_021DD420 *param0, int param1) static void ov21_021DDA80(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCAE0 *param1, const UnkStruct_ov21_021DCACC *param2, const UnkStruct_ov21_021DDABC *param3, int param4) { - if (param0->unk_00 != param3->unk_00) { + if (param0->encounterTime != param3->encounterTime) { ov21_021DD710(param0, param2, param3, param4); ov21_021DD964(param0, param1); - ov21_021DDA48(param0, param2->unk_04); + ov21_021DDA48(param0, param2->encounterTime); ov21_021DD9E8(param0, param3); - param0->unk_00 = param3->unk_00; + param0->encounterTime = param3->encounterTime; } } -static void ov21_021DDABC(UnkStruct_ov21_021DDABC *param0, UnkStruct_ov21_021DCACC *param1, int param2) +static void ov21_021DDABC(UnkStruct_ov21_021DDABC *param0, UnkStruct_ov21_021DCACC *param1, int heapID) { int v0; int v1; - int v2 = ov21_021D37BC(param1->unk_00); + int species = Pokedex_Sort_CurrentSpecies(param1->pokedexS); - switch (param1->unk_04) { - case 0: + switch (param1->encounterTime) { + case ENCTIME_MORNING: v0 = 0; v1 = 5; break; - case 1: + case ENCTIME_DAY: v0 = 1; v1 = 6; break; - case 2: + case ENCTIME_NIGHT: v0 = 2; v1 = 7; break; @@ -1159,24 +1167,24 @@ static void ov21_021DDABC(UnkStruct_ov21_021DDABC *param0, UnkStruct_ov21_021DCA break; } - ov21_021D57B4(¶m0->unk_14, v2, v0, param2); - ov21_021D57B4(¶m0->unk_1C, v2, v1, param2); + ov21_021D57B4(¶m0->dexEnc0, species, v0, heapID); + ov21_021D57B4(¶m0->dexEnc1, species, v1, heapID); - if (ov21_021D3428(param1->unk_00) == 0) { - ov21_021D57B4(¶m0->unk_24, v2, 3, param2); - ov21_021D57B4(¶m0->unk_2C, v2, 8, param2); + if (Pokedex_Sort_PokedexUnlocked(param1->pokedexS) == 0) { + ov21_021D57B4(¶m0->dexEnc2, species, 3, heapID); + ov21_021D57B4(¶m0->dexEnc3, species, 8, heapID); } else { - ov21_021D57B4(¶m0->unk_24, v2, 4, param2); - ov21_021D57B4(¶m0->unk_2C, v2, 9, param2); + ov21_021D57B4(¶m0->dexEnc2, species, 4, heapID); + ov21_021D57B4(¶m0->dexEnc3, species, 9, heapID); } } static void ov21_021DDB68(UnkStruct_ov21_021DDABC *param0) { - ov21_021D5844(¶m0->unk_14); - ov21_021D5844(¶m0->unk_1C); - ov21_021D5844(¶m0->unk_24); - ov21_021D5844(¶m0->unk_2C); + Free_pokedexEncData(¶m0->dexEnc0); + Free_pokedexEncData(¶m0->dexEnc1); + Free_pokedexEncData(¶m0->dexEnc2); + Free_pokedexEncData(¶m0->dexEnc3); } static void ov21_021DDB8C(UnkStruct_ov21_021DD420 *param0) @@ -1253,8 +1261,8 @@ static void ov21_021DDC14(UnkStruct_ov21_021DD420 *param0) static void ov21_021DDCF4(UnkStruct_ov21_021DCAE0 *param0, const UnkStruct_ov21_021DCACC *param1) { Sprite *v0 = ov21_021D2170(param0->unk_00); - int v1 = ov21_021D37BC(param1->unk_00); + int species = Pokedex_Sort_CurrentSpecies(param1->pokedexS); - ov21_021D1890(param0->unk_00, param1->unk_00, v1, 2, 40, 120); + ov21_021D1890(param0->unk_00, param1->pokedexS, species, 2, 40, 120); sub_02007DEC(v0, 6, 0); } diff --git a/src/overlay021/ov21_021DDD2C.c b/src/overlay021/ov21_021DDD2C.c index 69319ef5d3..ea7dea0464 100644 --- a/src/overlay021/ov21_021DDD2C.c +++ b/src/overlay021/ov21_021DDD2C.c @@ -8,7 +8,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/ov21_021DC9BC.h" #include "overlay021/ov21_021E29DC.h" #include "overlay021/struct_ov21_021D0F60_decl.h" @@ -34,7 +34,7 @@ typedef struct { UnkStruct_ov21_021E68F4 *unk_00; - UnkStruct_ov21_021D3320 *unk_04; + pokedexStruct *unk_04; UnkStruct_ov21_021E68F4 *unk_08; } UnkStruct_ov21_021DDDA4; @@ -198,7 +198,7 @@ static int ov21_021DDE4C(UnkStruct_ov21_021E6A68 *param0, void *param1) UnkStruct_ov21_021DDDA4 *v0 = param1; UnkStruct_ov21_021DDE4C *v1; - v1 = Heap_AllocFromHeap(param0->unk_04, sizeof(UnkStruct_ov21_021DDE4C)); + v1 = Heap_AllocFromHeap(param0->heapID, sizeof(UnkStruct_ov21_021DDE4C)); GF_ASSERT(v1); memset(v1, 0, sizeof(UnkStruct_ov21_021DDE4C)); @@ -206,7 +206,7 @@ static int ov21_021DDE4C(UnkStruct_ov21_021E6A68 *param0, void *param1) param0->unk_08 = v1; ov21_021DE5A4(v1, v0); - ov21_021DE2EC(v1, v0, param0->unk_04); + ov21_021DE2EC(v1, v0, param0->heapID); return 1; } @@ -251,26 +251,26 @@ static int ov21_021DDEC8(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo switch (param1->unk_00) { case 0: - param1->unk_08 = Heap_AllocFromHeap(param1->unk_04, sizeof(UnkStruct_ov21_021DDEC8)); + param1->unk_08 = Heap_AllocFromHeap(param1->heapID, sizeof(UnkStruct_ov21_021DDEC8)); memset(param1->unk_08, 0, sizeof(UnkStruct_ov21_021DDEC8)); param1->unk_00++; break; case 1: - ov21_021DE100(v3, v2, param1->unk_04); + ov21_021DE100(v3, v2, param1->heapID); ov21_021DE49C(v3, v0, v1); - ov21_021DE4D4(v3, v2, v0, param1->unk_04); + ov21_021DE4D4(v3, v2, v0, param1->heapID); ov21_021DE058(v3, v2, v0, 1); param1->unk_00++; break; case 2: - ov21_021DE4D4(v3, v2, v0, param1->unk_04); + ov21_021DE4D4(v3, v2, v0, param1->heapID); if (ov21_021DE0C4(v3, v2, v0, 1)) { param1->unk_00++; } break; case 3: - ov21_021DE4D4(v3, v2, v0, param1->unk_04); + ov21_021DE4D4(v3, v2, v0, param1->heapID); ov21_021D25AC(&v2->unk_00->unk_1E0, 0); return 1; default: @@ -289,7 +289,7 @@ static int ov21_021DDF80(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo ov21_021DE49C(v3, v0, v1); ov21_021DE630(v2, v1, v0); - ov21_021DE4D4(v3, v2, v0, param1->unk_04); + ov21_021DE4D4(v3, v2, v0, param1->heapID); return 0; } @@ -313,7 +313,7 @@ static int ov21_021DDFB4(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo } break; case 2: - ov21_021DE128(v3, v2, param1->unk_04); + ov21_021DE128(v3, v2, param1->heapID); param1->unk_00++; break; case 3: diff --git a/src/overlay021/ov21_021DE668.c b/src/overlay021/ov21_021DE668.c index b3560c358f..1241a653a7 100644 --- a/src/overlay021/ov21_021DE668.c +++ b/src/overlay021/ov21_021DE668.c @@ -10,7 +10,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1F90.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021D5600.h" #include "overlay021/ov21_021E29DC.h" @@ -201,7 +201,7 @@ static int ov21_021DE778(UnkStruct_ov21_021E6A68 *param0, void *param1) { UnkStruct_ov21_021DE6D4 *v0 = param1; - ov21_021D3434(v0->unk_04, ov21_021D37BC(v0->unk_04)); + ov21_021D3434(v0->unk_04, Pokedex_Sort_CurrentSpecies(v0->unk_04)); ov21_021D344C(v0->unk_04, ov21_021D36D8(v0->unk_04)); return 1; @@ -222,7 +222,7 @@ static int ov21_021DE79C(UnkStruct_ov21_021E6A68 *param0, void *param1) switch (param0->unk_00) { case 0: if (v0->unk_1C == 1) { - Sound_PlayPokemonCry(14, ov21_021D37BC(v0->unk_04), 0x1ff, 0x1ff, 0x1ff, 0); + Sound_PlayPokemonCry(14, Pokedex_Sort_CurrentSpecies(v0->unk_04), 0x1ff, 0x1ff, 0x1ff, 0); v0->unk_1C = 0; } @@ -250,12 +250,12 @@ static int ov21_021DE804(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo switch (param1->unk_00) { case 0: - param1->unk_08 = Heap_AllocFromHeap(param1->unk_04, sizeof(UnkStruct_ov21_021DF374)); + param1->unk_08 = Heap_AllocFromHeap(param1->heapID, sizeof(UnkStruct_ov21_021DF374)); memset(param1->unk_08, 0, sizeof(UnkStruct_ov21_021DF374)); param1->unk_00++; break; case 1: - ov21_021DE9A4(v2, v1, v0, param1->unk_04); + ov21_021DE9A4(v2, v1, v0, param1->heapID); switch (v0->unk_14) { case 0: @@ -369,7 +369,7 @@ static void ov21_021DE9A4(UnkStruct_ov21_021DF374 *param0, UnkStruct_ov21_021DE7 ov21_021DEA44(param1, param3); ov21_021DEB58(param1, param2, param3); - if (ov21_021D37CC(param2->unk_04) == 2) { + if (Pokedex_Sort_CurrentCaughtStatus(param2->unk_04) == 2) { ov21_021DED24(param0, param1, param2, param3); ov21_021DF098(param0, param1, param2, param3); } @@ -415,13 +415,13 @@ static void ov21_021DEA44(UnkStruct_ov21_021DE760 *param0, int param1) static void ov21_021DEB58(UnkStruct_ov21_021DE760 *param0, const UnkStruct_ov21_021DE6D4 *param1, int param2) { - int v0 = ov21_021D37BC(param1->unk_04); + int species = Pokedex_Sort_CurrentSpecies(param1->unk_04); - if (ov21_021D37CC(param1->unk_04) != 2) { - v0 = 0; + if (Pokedex_Sort_CurrentCaughtStatus(param1->unk_04) != 2) { + species = 0; } - ov21_021DEB8C(¶m0->unk_00->unk_04, v0, param2, param1->unk_18, ((u32)(((2 & 0xff) << 16) | ((1 & 0xff) << 8) | ((0 & 0xff) << 0)))); + ov21_021DEB8C(¶m0->unk_00->unk_04, species, param2, param1->unk_18, ((u32)(((2 & 0xff) << 16) | ((1 & 0xff) << 8) | ((0 & 0xff) << 0)))); } void ov21_021DEB8C(Window *param0, int param1, int param2, int param3, u32 param4) @@ -480,14 +480,14 @@ static void ov21_021DECD4(Window *param0, int param1, int param2, int param3, u3 static void ov21_021DED24(UnkStruct_ov21_021DF374 *param0, UnkStruct_ov21_021DE760 *param1, const UnkStruct_ov21_021DE6D4 *param2, int param3) { - int v0 = ov21_021D37BC(param2->unk_04); - int v1 = ov21_021D33D4(param2->unk_04, v0); + int species = Pokedex_Sort_CurrentSpecies(param2->unk_04); + int v1 = ov21_021D33D4(param2->unk_04, species); - if ((v0 == 487) && (v1 > 0)) { - v0 = 11; + if ((species == 487) && (v1 > 0)) { + species = 11; } - ov21_021DED7C(param0, param1, param3, v0); + ov21_021DED7C(param0, param1, param3, species); ov21_021DEE80(param0, param1, param3); } @@ -577,9 +577,9 @@ static void ov21_021DEF3C(UnkStruct_ov21_021DE760 *param0) static void ov21_021DEF54(UnkStruct_ov21_021DE760 *param0, const UnkStruct_ov21_021DE6D4 *param1) { Sprite *v0 = ov21_021D2170(param0->unk_00); - int v1 = ov21_021D37BC(param1->unk_04); + int species = Pokedex_Sort_CurrentSpecies(param1->unk_04); - ov21_021D1890(param0->unk_00, param1->unk_04, v1, 2, 48, 72); + ov21_021D1890(param0->unk_00, param1->unk_04, species, 2, 48, 72); sub_02007DEC(v0, 6, 0); } @@ -627,12 +627,12 @@ static void ov21_021DF098(UnkStruct_ov21_021DF374 *param0, UnkStruct_ov21_021DE7 CellActorResourceData v0; CellActorInitParams v1; UnkStruct_ov21_021D13FC *v2 = param1->unk_00; - int v3 = ov21_021D37BC(param2->unk_04); + int species = Pokedex_Sort_CurrentSpecies(param2->unk_04); int v4, v5; - int v6 = ov21_021D33D4(param2->unk_04, v3); + int v6 = ov21_021D33D4(param2->unk_04, species); - v4 = PokemonPersonalData_GetFormValue(v3, v6, 6); - v5 = PokemonPersonalData_GetFormValue(v3, v6, 7); + v4 = PokemonPersonalData_GetFormValue(species, v6, 6); + v5 = PokemonPersonalData_GetFormValue(species, v6, 7); v4 = ov21_021DF180(v4); v5 = ov21_021DF180(v5); @@ -738,7 +738,7 @@ static void ov21_021DF214(UnkStruct_ov21_021DF374 *param0, UnkStruct_ov21_021DE7 CellActorResourceData v0; CellActorInitParams v1; UnkStruct_ov21_021D13FC *v2 = param1->unk_00; - int v3 = ov21_021D37BC(param2->unk_04); + int species = Pokedex_Sort_CurrentSpecies(param2->unk_04); Window *v4; UnkStruct_ov21_021D4CB8 v5; SpriteResource *v6; @@ -757,11 +757,11 @@ static void ov21_021DF214(UnkStruct_ov21_021DF374 *param0, UnkStruct_ov21_021DE7 CellActor_SetAnim(param0->unk_0C, 0x11); - if (ov21_021D37CC(param2->unk_04) != 2) { - v3 = 0; + if (Pokedex_Sort_CurrentCaughtStatus(param2->unk_04) != 2) { + species = 0; } - v4 = ov21_021DF30C(param1->unk_00->unk_14C, v3, param3); + v4 = ov21_021DF30C(param1->unk_00->unk_14C, species, param3); v6 = ov21_021D2344(param1->unk_00, 1); v5.unk_00 = param1->unk_00->unk_14C; diff --git a/src/overlay021/ov21_021DF734.c b/src/overlay021/ov21_021DF734.c index c78731ca65..ed84eeef43 100644 --- a/src/overlay021/ov21_021DF734.c +++ b/src/overlay021/ov21_021DF734.c @@ -8,7 +8,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021E29DC.h" #include "overlay021/struct_ov21_021D0F60_decl.h" @@ -35,7 +35,7 @@ typedef struct { int *unk_00; - UnkStruct_ov21_021D3320 *unk_04; + pokedexStruct *unk_04; const UnkStruct_ov21_021E68F4 *unk_08; int unk_0C; int unk_10; @@ -260,12 +260,12 @@ static int ov21_021DF870(int param0, int param1, int param2, int param3) static int ov21_021DF888(UnkStruct_ov21_021E6A68 *param0, void *param1) { UnkStruct_ov21_021DF844 *v0 = param1; - int v1; + int species; - v1 = ov21_021D37BC(v0->unk_04); + species = Pokedex_Sort_CurrentSpecies(v0->unk_04); - v0->unk_0C = ov21_021E01CC(v1, v0); - v0->unk_10 = ov21_021E0268(v1, v0); + v0->unk_0C = ov21_021E01CC(species, v0); + v0->unk_10 = ov21_021E0268(species, v0); v0->unk_14 = 0; return 1; @@ -300,7 +300,7 @@ static int ov21_021DF8C4(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo switch (param1->unk_00) { case 0: - param1->unk_08 = Heap_AllocFromHeap(param1->unk_04, sizeof(UnkStruct_ov21_021DFFF8)); + param1->unk_08 = Heap_AllocFromHeap(param1->heapID, sizeof(UnkStruct_ov21_021DFFF8)); memset(param1->unk_08, 0, sizeof(UnkStruct_ov21_021DFFF8)); v2 = param1->unk_08; v2->unk_C8 = v0->unk_0C; @@ -309,7 +309,7 @@ static int ov21_021DF8C4(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo param1->unk_00++; break; case 1: - ov21_021DFA84(v2, v1, v0, param1->unk_04); + ov21_021DFA84(v2, v1, v0, param1->heapID); ov21_021DFF38(v2, v1, v0, 1); param1->unk_00++; break; @@ -356,7 +356,7 @@ static int ov21_021DF958(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo break; case 2: if (v1->unk_08 == 1) { - ov21_021E0944(v2, v1, v0, param1->unk_04, v0->unk_0C, v0->unk_14); + ov21_021E0944(v2, v1, v0, param1->heapID, v0->unk_0C, v0->unk_14); ov21_021DFBB4(v2, v1, v0); v1->unk_08 = 0; v1->unk_04 = 0; @@ -441,14 +441,14 @@ static void ov21_021DFAE8(UnkStruct_ov21_021DF858 *param0, int param1) static void ov21_021DFB50(UnkStruct_ov21_021DFFF8 *param0, UnkStruct_ov21_021DF858 *param1, const UnkStruct_ov21_021DF844 *param2) { - int v0 = ov21_021D37BC(param2->unk_04); + int species = Pokedex_Sort_CurrentSpecies(param2->unk_04); int v1; int v2; - ov21_021DFBEC(param0, param1, param2, v0, param2->unk_0C, param2->unk_14, 0); + ov21_021DFBEC(param0, param1, param2, species, param2->unk_0C, param2->unk_14, 0); v2 = ov21_021DF870(param2->unk_0C, param2->unk_14, 1, param2->unk_10); - ov21_021DFBEC(param0, param1, param2, v0, param2->unk_0C, v2, 2); + ov21_021DFBEC(param0, param1, param2, species, param2->unk_0C, v2, 2); for (v1 = 0; v1 < 4; v1++) { ov21_021D2280(param1->unk_00, 1, v1); @@ -457,12 +457,12 @@ static void ov21_021DFB50(UnkStruct_ov21_021DFFF8 *param0, UnkStruct_ov21_021DF8 static void ov21_021DFBB4(UnkStruct_ov21_021DFFF8 *param0, UnkStruct_ov21_021DF858 *param1, const UnkStruct_ov21_021DF844 *param2) { - int v0 = ov21_021D37BC(param2->unk_04); + int species = Pokedex_Sort_CurrentSpecies(param2->unk_04); int v1; int v2; v2 = ov21_021DF870(param2->unk_0C, param2->unk_14, 1, param2->unk_10); - ov21_021DFBEC(param0, param1, param2, v0, param2->unk_0C, v2, 2); + ov21_021DFBEC(param0, param1, param2, species, param2->unk_0C, v2, 2); } static void ov21_021DFBEC(UnkStruct_ov21_021DFFF8 *param0, UnkStruct_ov21_021DF858 *param1, const UnkStruct_ov21_021DF844 *param2, int param3, int param4, int param5, int param6) @@ -1090,9 +1090,9 @@ static int ov21_021E0A4C(UnkStruct_ov21_021DF858 *param0, const UnkStruct_ov21_0 { int v0; int v1; - int v2 = ov21_021D37BC(param1->unk_04); + int species = Pokedex_Sort_CurrentSpecies(param1->unk_04); - v1 = ov21_021D334C(param1->unk_04, v2, param2); + v1 = ov21_021D334C(param1->unk_04, species, param2); GF_ASSERT(v1 != -1); switch (v1) { diff --git a/src/overlay021/ov21_021E0C68.c b/src/overlay021/ov21_021E0C68.c index 7150066fe2..3908e5be26 100644 --- a/src/overlay021/ov21_021E0C68.c +++ b/src/overlay021/ov21_021E0C68.c @@ -9,7 +9,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021D5600.h" #include "overlay021/ov21_021E29DC.h" @@ -38,7 +38,7 @@ typedef struct { int *unk_00; - UnkStruct_ov21_021D3320 *unk_04; + pokedexStruct *unk_04; int unk_08; int unk_0C; const UnkStruct_ov21_021E68F4 *unk_10; @@ -256,12 +256,12 @@ static int ov21_021E0DAC(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo switch (param1->unk_00) { case 0: - param1->unk_08 = Heap_AllocFromHeap(param1->unk_04, sizeof(UnkStruct_ov21_021E14D4)); + param1->unk_08 = Heap_AllocFromHeap(param1->heapID, sizeof(UnkStruct_ov21_021E14D4)); memset(param1->unk_08, 0, sizeof(UnkStruct_ov21_021E14D4)); param1->unk_00++; break; case 1: - ov21_021E0F4C(v2, v1, v0, param1->unk_04); + ov21_021E0F4C(v2, v1, v0, param1->heapID); switch (v0->unk_14) { case 0: @@ -419,12 +419,12 @@ static void ov21_021E10D0(UnkStruct_ov21_021E0D7C *param0, const UnkStruct_ov21_ { Strbuf *v0 = Strbuf_Init(64, param2); MessageLoader *v1 = MessageLoader_Init(0, 26, 697, param2); - int v2 = ov21_021D37BC(param1->unk_04); + int species = Pokedex_Sort_CurrentSpecies(param1->unk_04); int v3; int v4; - if (ov21_021D37CC(param1->unk_04) != 2) { - v2 = 0; + if (Pokedex_Sort_CurrentCaughtStatus(param1->unk_04) != 2) { + species = 0; GF_ASSERT(0); } @@ -439,9 +439,9 @@ static void ov21_021E10D0(UnkStruct_ov21_021E0D7C *param0, const UnkStruct_ov21_ Strbuf_Free(v0); MessageLoader_Free(v1); - ov21_021E1188(param0, param2, v2, param1->unk_18, param1->unk_1C); - ov21_021E18A0(param0, param2, v2, param1->unk_18); - ov21_021E18DC(param0, param2, v2, param1->unk_18); + ov21_021E1188(param0, param2, species, param1->unk_18, param1->unk_1C); + ov21_021E18A0(param0, param2, species, param1->unk_18); + ov21_021E18DC(param0, param2, species, param1->unk_18); } static void ov21_021E1188(UnkStruct_ov21_021E0D7C *param0, int param1, int param2, int param3, int param4) @@ -469,9 +469,9 @@ static void ov21_021E1210(UnkStruct_ov21_021E0D7C *param0) static void ov21_021E1228(UnkStruct_ov21_021E0D7C *param0, const UnkStruct_ov21_021E0D68 *param1) { Sprite *v0 = ov21_021D2170(param0->unk_00); - int v1 = ov21_021D37BC(param1->unk_04); + int species = Pokedex_Sort_CurrentSpecies(param1->unk_04); - ov21_021D1890(param0->unk_00, param1->unk_04, v1, 2, 48, 72); + ov21_021D1890(param0->unk_00, param1->unk_04, species, 2, 48, 72); sub_02007DEC(v0, 6, 0); } @@ -520,7 +520,7 @@ static void ov21_021E136C(UnkStruct_ov21_021E14D4 *param0, UnkStruct_ov21_021E0D CellActorResourceData v0; CellActorInitParams v1; UnkStruct_ov21_021D13FC *v2 = param1->unk_00; - int v3 = ov21_021D37BC(param2->unk_04); + int species = Pokedex_Sort_CurrentSpecies(param2->unk_04); Window *v4; UnkStruct_ov21_021D4CB8 v5; SpriteResource *v6; @@ -539,11 +539,11 @@ static void ov21_021E136C(UnkStruct_ov21_021E14D4 *param0, UnkStruct_ov21_021E0D CellActor_SetAnim(param0->unk_00, 0x11); - if (ov21_021D37CC(param2->unk_04) != 2) { - v3 = 0; + if (Pokedex_Sort_CurrentCaughtStatus(param2->unk_04) != 2) { + species = 0; } - v4 = ov21_021E1460(param1, v3, param3); + v4 = ov21_021E1460(param1, species, param3); v6 = ov21_021D2344(param1->unk_00, 1); v5.unk_00 = param1->unk_00->unk_14C; diff --git a/src/overlay021/ov21_021E1924.c b/src/overlay021/ov21_021E1924.c index 95f7680131..dd9977b32a 100644 --- a/src/overlay021/ov21_021E1924.c +++ b/src/overlay021/ov21_021E1924.c @@ -9,7 +9,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/ov21_021D4340.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021D5600.h" @@ -44,7 +44,7 @@ typedef struct { int *unk_00; - UnkStruct_ov21_021D3320 *unk_04; + pokedexStruct *unk_04; UnkStruct_ov21_021DE6D4 *unk_08; UnkStruct_ov21_021E68F4 *unk_0C; UnkStruct_ov21_021E68F4 *unk_10; @@ -173,7 +173,7 @@ static UnkStruct_ov21_021E1A7C *ov21_021E199C(int param0, UnkStruct_ov21_021D0F6 { UnkStruct_ov21_021E1A7C *v0; UnkStruct_ov21_021E68F4 *v1; - UnkStruct_ov21_021D3320 *v2; + pokedexStruct *v2; int v3; v0 = Heap_AllocFromHeap(param0, sizeof(UnkStruct_ov21_021E1A7C)); @@ -264,7 +264,7 @@ static int ov21_021E1AD0(UnkStruct_ov21_021E6A68 *param0, void *param1) UnkStruct_ov21_021E1E74 *v1 = param0->unk_08; int v2; - v1 = Heap_AllocFromHeap(param0->unk_04, sizeof(UnkStruct_ov21_021E1E74)); + v1 = Heap_AllocFromHeap(param0->heapID, sizeof(UnkStruct_ov21_021E1E74)); memset(v1, 0, sizeof(UnkStruct_ov21_021E1E74)); for (v2 = 0; v2 < 8; v2++) { @@ -273,7 +273,7 @@ static int ov21_021E1AD0(UnkStruct_ov21_021E6A68 *param0, void *param1) v1->unk_10 = 0; - ov21_021E1D40(v1, v0, param0->unk_04); + ov21_021E1D40(v1, v0, param0->heapID); ov21_021E2968(v1, v0); param0->unk_08 = v1; @@ -323,12 +323,12 @@ static int ov21_021E1B68(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo switch (param1->unk_00) { case 0: - param1->unk_08 = Heap_AllocFromHeap(param1->unk_04, sizeof(UnkStruct_ov21_021E2588)); + param1->unk_08 = Heap_AllocFromHeap(param1->heapID, sizeof(UnkStruct_ov21_021E2588)); memset(param1->unk_08, 0, sizeof(UnkStruct_ov21_021E2588)); param1->unk_00++; break; case 1: - ov21_021E2014(v3, v2, param1->unk_04); + ov21_021E2014(v3, v2, param1->heapID); ov21_021E28D0(v3, v1); ov21_021E25F8(v3, v2, v0, 1); param1->unk_00++; @@ -379,7 +379,7 @@ static int ov21_021E1BFC(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo v5 = 5; } - ov21_021E26A0(v2, v3->unk_00[v4], v3->unk_20[v4], v1->unk_14[v4], -6, v5, &v3->unk_80[v4], param1->unk_04, 4, 1, &v3->unk_A0[v4]); + ov21_021E26A0(v2, v3->unk_00[v4], v3->unk_20[v4], v1->unk_14[v4], -6, v5, &v3->unk_80[v4], param1->heapID, 4, 1, &v3->unk_A0[v4]); ov21_021D144C(v3->unk_50[v4], v1->unk_14[v4]); } } @@ -410,7 +410,7 @@ static int ov21_021E1CB8(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo } break; case 2: - ov21_021E2044(v3, v2, param1->unk_04); + ov21_021E2044(v3, v2, param1->heapID); param1->unk_00++; break; case 3: diff --git a/src/overlay021/ov21_021E29DC.c b/src/overlay021/ov21_021E29DC.c index 0b1c55e213..68aa9af719 100644 --- a/src/overlay021/ov21_021E29DC.c +++ b/src/overlay021/ov21_021E29DC.c @@ -9,7 +9,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/ov21_021D4340.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021D4EE4.h" @@ -46,7 +46,7 @@ typedef struct { int *unk_00; - UnkStruct_ov21_021D3320 *unk_04; + pokedexStruct *unk_04; int unk_08; UnkStruct_ov21_021D5B68 *unk_0C; UnkStruct_ov21_021DE6D4 *unk_10; @@ -77,7 +77,7 @@ typedef struct { typedef struct { int *unk_00; UnkStruct_ov21_021E2BA8 *unk_04; - UnkStruct_ov21_021D3320 *unk_08; + pokedexStruct *unk_08; int unk_0C[6]; BOOL unk_24; int unk_28; @@ -378,14 +378,14 @@ static int ov21_021E2C64(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo switch (param1->unk_00) { case 0: - param1->unk_08 = Heap_AllocFromHeap(param1->unk_04, sizeof(UnkStruct_ov21_021E326C)); + param1->unk_08 = Heap_AllocFromHeap(param1->heapID, sizeof(UnkStruct_ov21_021E326C)); memset(param1->unk_08, 0, sizeof(UnkStruct_ov21_021E326C)); v3 = param1->unk_08; v3->unk_00 = v0->unk_08; param1->unk_00++; break; case 1: - ov21_021E3080(v2, v3, v0, param1->unk_04); + ov21_021E3080(v2, v3, v0, param1->heapID); ov21_021E3BE0(v3); ov21_021D23F8(&v2->unk_00->unk_168, 4, -16, 0, 0, 16, (GX_BLEND_PLANEMASK_BG0 | GX_BLEND_PLANEMASK_BG1 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_BD), (GX_BLEND_PLANEMASK_BG0 | GX_BLEND_PLANEMASK_BG1 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_BD), 0); param1->unk_00++; @@ -563,7 +563,7 @@ static BOOL ov21_021E2EC4(UnkStruct_ov21_021E2BA8 *param0, int param1, int param v1 = 64; break; case 3: - if (ov21_021D37CC(param0->unk_04) == 2) { + if (Pokedex_Sort_CurrentCaughtStatus(param0->unk_04) == 2) { *param0->unk_00 |= (0x1 << 5); param0->unk_08 = 3; } else { @@ -571,7 +571,7 @@ static BOOL ov21_021E2EC4(UnkStruct_ov21_021E2BA8 *param0, int param1, int param } break; case 4: - if (ov21_021D3954(param0->unk_04) == 1) { + if (Pokedex_Sort_CanDetectForms(param0->unk_04) == 1) { *param0->unk_00 |= (0x1 << 8); param0->unk_08 = 4; } else { @@ -884,11 +884,11 @@ static int ov21_021E345C(UnkStruct_ov21_021E6A68 *param0, void *param1) UnkStruct_ov21_021E37B4 *v1 = param0->unk_08; int v2; - v1 = Heap_AllocFromHeap(param0->unk_04, sizeof(UnkStruct_ov21_021E37B4)); + v1 = Heap_AllocFromHeap(param0->heapID, sizeof(UnkStruct_ov21_021E37B4)); memset(v1, 0, sizeof(UnkStruct_ov21_021E37B4)); - ov21_021E3688(v1, v0, param0->unk_04); - ov21_021E3C6C(v1, v0, param0->unk_04); + ov21_021E3688(v1, v0, param0->heapID); + ov21_021E3C6C(v1, v0, param0->heapID); ov21_021E3E8C(v1, v0); for (v2 = 0; v2 < 6; v2++) { @@ -959,12 +959,12 @@ static int ov21_021E3540(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo switch (param1->unk_00) { case 0: - param1->unk_08 = Heap_AllocFromHeap(param1->unk_04, sizeof(UnkStruct_ov21_021E3900)); + param1->unk_08 = Heap_AllocFromHeap(param1->heapID, sizeof(UnkStruct_ov21_021E3900)); memset(param1->unk_08, 0, sizeof(UnkStruct_ov21_021E3900)); param1->unk_00++; break; case 1: - ov21_021E3900(v3, v2, v0, param1->unk_04); + ov21_021E3900(v3, v2, v0, param1->heapID); param1->unk_00++; break; case 2: @@ -1180,7 +1180,7 @@ static void ov21_021E37CC(u32 param0, u32 param1, void *param2) Sound_PlayEffect(1675); } else { if (v2->unk_10 == 0) { - if (ov21_021D3954(v3->unk_04) == 1) { + if (Pokedex_Sort_CanDetectForms(v3->unk_04) == 1) { if (v3->unk_08 != 2) { Sound_PlayEffect(1501); } @@ -1403,7 +1403,7 @@ static void ov21_021E3C6C(UnkStruct_ov21_021E37B4 *param0, UnkStruct_ov21_021E34 ov21_021D4FE4(¶m0->unk_18[2], 108, 24, 24, 16, 0, 0, 2); ov21_021D4FE4(¶m0->unk_18[3], 148, 24, 24, 16, 0, 0, 3); - if (ov21_021D3954(param1->unk_08) == 1) { + if (Pokedex_Sort_CanDetectForms(param1->unk_08) == 1) { v0 = 0; } else { v0 = 2; @@ -1598,7 +1598,7 @@ static void ov21_021E3FC0(UnkStruct_ov21_021E326C *param0, int param1, int param static void ov21_021E3FE4(UnkStruct_ov21_021E3900 *param0, const UnkStruct_ov21_021E342C *param1) { - if (ov21_021D3954(param1->unk_08) == 0) { + if (Pokedex_Sort_CanDetectForms(param1->unk_08) == 0) { CellActor_SetDrawFlag(param0->unk_00[4], 0); } } diff --git a/src/overlay021/ov21_021E3FFC.c b/src/overlay021/ov21_021E3FFC.c index 02886bb425..82d86cccae 100644 --- a/src/overlay021/ov21_021E3FFC.c +++ b/src/overlay021/ov21_021E3FFC.c @@ -9,7 +9,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/ov21_021E29DC.h" #include "overlay021/ov21_021E4CA4.h" #include "overlay021/struct_ov21_021D0F60_decl.h" @@ -32,7 +32,7 @@ typedef struct { int *unk_00; - UnkStruct_ov21_021D3320 *unk_04; + pokedexStruct *unk_04; UnkStruct_ov21_021E68F4 *unk_08; UnkStruct_ov21_021E68F4 *unk_0C; } UnkStruct_ov21_021E40F4; @@ -218,16 +218,16 @@ static int ov21_021E4120(UnkStruct_ov21_021E6A68 *param0, void *param1) { UnkStruct_ov21_021E40F4 *v0 = param1; UnkStruct_ov21_021E4898 *v1; - int v2 = ov21_021D37BC(v0->unk_04); + int species = Pokedex_Sort_CurrentSpecies(v0->unk_04); - v1 = Heap_AllocFromHeap(param0->unk_04, sizeof(UnkStruct_ov21_021E4898)); + v1 = Heap_AllocFromHeap(param0->heapID, sizeof(UnkStruct_ov21_021E4898)); GF_ASSERT(v1); memset(v1, 0, sizeof(UnkStruct_ov21_021E4898)); param0->unk_08 = v1; - v1->unk_00 = sub_020050F8(v2); + v1->unk_00 = sub_020050F8(species); v1->unk_08 = sub_020050EC(v1->unk_00); ov21_021E4898(v1, v0); @@ -274,12 +274,12 @@ static int ov21_021E41A8(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo switch (param1->unk_00) { case 0: - param1->unk_08 = Heap_AllocFromHeap(param1->unk_04, sizeof(UnkStruct_ov21_021E4360)); + param1->unk_08 = Heap_AllocFromHeap(param1->heapID, sizeof(UnkStruct_ov21_021E4360)); memset(param1->unk_08, 0, sizeof(UnkStruct_ov21_021E4360)); param1->unk_00++; break; case 1: - ov21_021E4590(v3, v2, v0, v1, param1->unk_04); + ov21_021E4590(v3, v2, v0, v1, param1->heapID); if (v2->unk_0C == 0) { ov21_021E43C8(v3, v2, v0, 1); @@ -373,9 +373,9 @@ static int ov21_021E4288(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo static void ov21_021E4328(UnkStruct_ov21_021E4108 *param0, const UnkStruct_ov21_021E40F4 *param1) { Sprite *v0 = ov21_021D2170(param0->unk_00); - int v1 = ov21_021D37BC(param1->unk_04); + int species = Pokedex_Sort_CurrentSpecies(param1->unk_04); - ov21_021D1890(param0->unk_00, param1->unk_04, v1, 2, 48, 64); + ov21_021D1890(param0->unk_00, param1->unk_04, species, 2, 48, 64); sub_02007DEC(v0, 6, 0); } diff --git a/src/overlay021/ov21_021E4CA4.c b/src/overlay021/ov21_021E4CA4.c index d29353d056..9acfa1a1ff 100644 --- a/src/overlay021/ov21_021E4CA4.c +++ b/src/overlay021/ov21_021E4CA4.c @@ -9,7 +9,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021E29DC.h" #include "overlay021/struct_ov21_021D0F60_decl.h" @@ -41,7 +41,7 @@ typedef struct { int *unk_00; - UnkStruct_ov21_021D3320 *unk_04; + pokedexStruct *unk_04; UnkStruct_ov21_021E68F4 *unk_08; int unk_0C; } UnkStruct_ov21_021E4D90; @@ -280,15 +280,15 @@ static int ov21_021E4DC0(UnkStruct_ov21_021E6A68 *param0, void *param1) UnkStruct_ov21_021E4D90 *v0 = param1; UnkStruct_ov21_021E51DC *v1 = param0->unk_08; int v2; - int v3 = ov21_021D37BC(v0->unk_04); + int species = Pokedex_Sort_CurrentSpecies(v0->unk_04); - v1 = Heap_AllocFromHeap(param0->unk_04, sizeof(UnkStruct_ov21_021E51DC)); + v1 = Heap_AllocFromHeap(param0->heapID, sizeof(UnkStruct_ov21_021E51DC)); memset(v1, 0, sizeof(UnkStruct_ov21_021E51DC)); - ov21_021E5128(v1, v0, param0->unk_04); + ov21_021E5128(v1, v0, param0->heapID); ov21_021E51DC(v1, v0); - v1->unk_6C = sub_020050F8(v3); + v1->unk_6C = sub_020050F8(species); param0->unk_08 = v1; @@ -353,12 +353,12 @@ static int ov21_021E4E98(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo switch (param1->unk_00) { case 0: - param1->unk_08 = Heap_AllocFromHeap(param1->unk_04, sizeof(UnkStruct_ov21_021E5004)); + param1->unk_08 = Heap_AllocFromHeap(param1->heapID, sizeof(UnkStruct_ov21_021E5004)); memset(param1->unk_08, 0, sizeof(UnkStruct_ov21_021E5004)); param1->unk_00++; break; case 1: - ov21_021E54D4(v3, v2, param1->unk_04); + ov21_021E54D4(v3, v2, param1->heapID); ov21_021E507C(v3, v2, v0, 1); param1->unk_00++; break; @@ -418,7 +418,7 @@ static int ov21_021E4F78(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo } break; case 2: - ov21_021E5510(v3, v2, param1->unk_04); + ov21_021E5510(v3, v2, param1->heapID); param1->unk_00++; break; case 3: @@ -569,7 +569,7 @@ static void ov21_021E5268(u32 param0, u32 param1, void *param2) UnkStruct_ov21_021E5228 *v0 = param2; UnkStruct_ov21_021E4D90 *v1 = v0->unk_00; UnkStruct_ov21_021E51DC *v2 = v0->unk_04; - int v3 = ov21_021D37BC(v1->unk_04); + int species = Pokedex_Sort_CurrentSpecies(v1->unk_04); v2->unk_18[param0] = param1; @@ -586,7 +586,7 @@ static void ov21_021E5268(u32 param0, u32 param1, void *param2) case 0: if (v2->unk_64 == 1) { if (v2->unk_2C == 0) { - ov21_021E5DE8(v2, v1, v3); + ov21_021E5DE8(v2, v1, species); } else { ov21_021E5E18(v2); } @@ -595,7 +595,7 @@ static void ov21_021E5268(u32 param0, u32 param1, void *param2) sub_0200592C(0); } - ov21_021E5DE8(v2, v1, v3); + ov21_021E5DE8(v2, v1, species); } break; case 1: @@ -1285,13 +1285,13 @@ static void ov21_021E5E28(UnkStruct_ov21_021E51DC *param0) static void ov21_021E5E48(UnkStruct_ov21_021E51DC *param0, UnkStruct_ov21_021E4D90 *param1) { - int v0 = ov21_021D37BC(param1->unk_04); + int species = Pokedex_Sort_CurrentSpecies(param1->unk_04); if (sub_0200598C() == 0) { param0->unk_68--; if (param0->unk_68 == 0) { - ov21_021E5DE8(param0, param1, v0); + ov21_021E5DE8(param0, param1, species); param0->unk_68 = 10; } } @@ -1375,7 +1375,7 @@ static void ov21_021E5F38(UnkStruct_ov21_021E5004 *param0, const UnkStruct_ov21_ static void ov21_021E5F5C(UnkStruct_ov21_021E51DC *param0, UnkStruct_ov21_021E4D90 *param1) { - int v0 = ov21_021D37BC(param1->unk_04); + int species = Pokedex_Sort_CurrentSpecies(param1->unk_04); if (gCoreSys.pressedKeys & PAD_BUTTON_A) { param0->unk_28 = 1; @@ -1387,10 +1387,10 @@ static void ov21_021E5F5C(UnkStruct_ov21_021E51DC *param0, UnkStruct_ov21_021E4D sub_0200592C(0); } - ov21_021E5DE8(param0, param1, v0); + ov21_021E5DE8(param0, param1, species); } else { if (param0->unk_2C == 0) { - ov21_021E5DE8(param0, param1, v0); + ov21_021E5DE8(param0, param1, species); } else { ov21_021E5E18(param0); } diff --git a/src/overlay021/ov21_021E6014.c b/src/overlay021/ov21_021E6014.c index 3d121b4e01..37254ea03f 100644 --- a/src/overlay021/ov21_021E6014.c +++ b/src/overlay021/ov21_021E6014.c @@ -8,7 +8,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/ov21_021E29DC.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" @@ -35,7 +35,7 @@ typedef struct { int *unk_00; - UnkStruct_ov21_021D3320 *unk_04; + pokedexStruct *pokedexS; UnkStruct_ov21_021E68F4 *unk_08; } UnkStruct_ov21_021E6104; @@ -126,7 +126,7 @@ static UnkStruct_ov21_021E6104 *ov21_021E608C(int param0, UnkStruct_ov21_021D0F6 memset(v0, 0, sizeof(UnkStruct_ov21_021E6104)); v0->unk_00 = ov21_021D138C(param1); - v0->unk_04 = ov21_021D13EC(param1); + v0->pokedexS = ov21_021D13EC(param1); v0->unk_08 = ov21_021D1410(param1, 5); return v0; @@ -178,7 +178,7 @@ static int ov21_021E6134(UnkStruct_ov21_021E6A68 *param0, void *param1) UnkStruct_ov21_021E6104 *v0 = param1; UnkStruct_ov21_021E6134 *v1; - v1 = Heap_AllocFromHeap(param0->unk_04, sizeof(UnkStruct_ov21_021E6134)); + v1 = Heap_AllocFromHeap(param0->heapID, sizeof(UnkStruct_ov21_021E6134)); GF_ASSERT(v1); memset(v1, 0, sizeof(UnkStruct_ov21_021E6134)); @@ -224,12 +224,12 @@ static int ov21_021E617C(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo switch (param1->unk_00) { case 0: - param1->unk_08 = Heap_AllocFromHeap(param1->unk_04, sizeof(UnkStruct_ov21_021E6274)); + param1->unk_08 = Heap_AllocFromHeap(param1->heapID, sizeof(UnkStruct_ov21_021E6274)); memset(param1->unk_08, 0, sizeof(UnkStruct_ov21_021E6274)); param1->unk_00++; break; case 1: - ov21_021E6338(v3, v2, v0, v1, param1->unk_04); + ov21_021E6338(v3, v2, v0, v1, param1->heapID); ov21_021E628C(v3, v2, v0, 1); param1->unk_00++; break; @@ -408,7 +408,7 @@ static void ov21_021E6518(UnkStruct_ov21_021E6274 *param0, UnkStruct_ov21_021E61 VecFx32 v3; short v4; short v5; - int v6 = ov21_021D37BC(param2->unk_04); + int species = Pokedex_Sort_CurrentSpecies(param2->pokedexS); sub_020093B4(&v0, 93 + 7000, 14 + 7000, 91 + 7000, 92 + 7000, 0xffffffff, 0xffffffff, 0, 1, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); @@ -418,15 +418,15 @@ static void ov21_021E6518(UnkStruct_ov21_021E6274 *param0, UnkStruct_ov21_021E61 v1.vramType = NNS_G2D_VRAM_TYPE_2DMAIN; v1.heapID = param3; - v4 = Pokedex_HeightWeightData_TrainerPos(param2->unk_04->unk_1748, v6); - v5 = Pokedex_HeightWeightData_TrainerScale(param2->unk_04->unk_1748, v6); + v4 = Pokedex_HeightWeightData_TrainerPos(param2->pokedexS->HWData, species); + v5 = Pokedex_HeightWeightData_TrainerScale(param2->pokedexS->HWData, species); v1.position.x = 168 << FX32_SHIFT; v1.position.y = (88 + v4) << FX32_SHIFT; param0->unk_10 = CellActorCollection_Add(&v1); - if (ov21_021D3920(param2->unk_04) == 0) { + if (Pokedex_Sort_TrainerGender(param2->pokedexS) == 0) { CellActor_SetAnim(param0->unk_10, 5); } else { CellActor_SetAnim(param0->unk_10, 6); @@ -474,14 +474,14 @@ static void ov21_021E6600(UnkStruct_ov21_021E6118 *param0, int param1) static void ov21_021E66B0(UnkStruct_ov21_021E6118 *param0, const UnkStruct_ov21_021E6104 *param1, int param2) { Strbuf *v0 = Strbuf_Init(32, param2); - int v2 = ov21_021D37BC(param1->unk_04); - Strbuf *v3 = MessageUtil_SpeciesName(v2, param2); + int species = Pokedex_Sort_CurrentSpecies(param1->pokedexS); + Strbuf *v3 = MessageUtil_SpeciesName(species, param2); int heightMessageBankIndex = Height_Message_Bank_Index(); MessageLoader *v1 = MessageLoader_Init(0, 26, heightMessageBankIndex, param2); sub_0201D78C(¶m0->unk_00->unk_04, 0, v3, 26, 152, 0, ((u32)(((2 & 0xff) << 16) | ((1 & 0xff) << 8) | ((0 & 0xff) << 0))), NULL); - MessageLoader_GetStrbuf(v1, v2, v0); + MessageLoader_GetStrbuf(v1, species, v0); { u32 v5 = 32 + 78 - sub_02002D7C(0, v0, 0); @@ -493,9 +493,9 @@ static void ov21_021E66B0(UnkStruct_ov21_021E6118 *param0, const UnkStruct_ov21_ v1 = MessageLoader_Init(0, 26, 697, param2); - sub_0201D78C(¶m0->unk_00->unk_04, 0, ov21_021D3914(param1->unk_04), 146, 152, 0, ((u32)(((2 & 0xff) << 16) | ((1 & 0xff) << 8) | ((0 & 0xff) << 0))), NULL); + sub_0201D78C(¶m0->unk_00->unk_04, 0, Pokedex_Sort_TrainerName(param1->pokedexS), 146, 152, 0, ((u32)(((2 & 0xff) << 16) | ((1 & 0xff) << 8) | ((0 & 0xff) << 0))), NULL); - if (ov21_021D3920(param1->unk_04) == 0) { + if (Pokedex_Sort_TrainerGender(param1->pokedexS) == 0) { MessageLoader_GetStrbuf(v1, 95, v0); } else { MessageLoader_GetStrbuf(v1, 96, v0); @@ -515,12 +515,12 @@ static void ov21_021E67C8(UnkStruct_ov21_021E6118 *param0, const UnkStruct_ov21_ Sprite *v0 = ov21_021D2170(param0->unk_00); short v1; short v2; - int v3 = ov21_021D37BC(param1->unk_04); + int species = Pokedex_Sort_CurrentSpecies(param1->pokedexS); - v1 = Pokedex_HeightWeightData_PokemonPos(param1->unk_04->unk_1748, v3); - v2 = Pokedex_HeightWeightData_PokemonScale(param1->unk_04->unk_1748, v3); + v1 = Pokedex_HeightWeightData_PokemonPos(param1->pokedexS->HWData, species); + v2 = Pokedex_HeightWeightData_PokemonScale(param1->pokedexS->HWData, species); - ov21_021D1890(param0->unk_00, param1->unk_04, v3, 2, 88, 88 + v1); + ov21_021D1890(param0->unk_00, param1->pokedexS, species, 2, 88, 88 + v1); sub_02007DEC(v0, 6, 0); sub_020086FC(v0, 15, 15, 0, 0); diff --git a/src/overlay021/ov21_021E68F4.c b/src/overlay021/ov21_021E68F4.c index 6781a40974..b6e3a2f8c2 100644 --- a/src/overlay021/ov21_021E68F4.c +++ b/src/overlay021/ov21_021E68F4.c @@ -9,7 +9,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/ov21_021D4340.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021E29DC.h" @@ -41,7 +41,7 @@ typedef struct { int *unk_00; int unk_04; - UnkStruct_ov21_021D3320 *unk_08; + pokedexStruct *unk_08; UnkStruct_ov21_021E68F4 *unk_0C; } UnkStruct_ov21_021E6A20; @@ -219,7 +219,7 @@ static int ov21_021E6A6C(UnkStruct_ov21_021E6A68 *param0, void *param1) UnkStruct_ov21_021E6DAC *v1 = param0->unk_08; int v2; - v1 = Heap_AllocFromHeap(param0->unk_04, sizeof(UnkStruct_ov21_021E6DAC)); + v1 = Heap_AllocFromHeap(param0->heapID, sizeof(UnkStruct_ov21_021E6DAC)); memset(v1, 0, sizeof(UnkStruct_ov21_021E6DAC)); for (v2 = 0; v2 < 2; v2++) { @@ -228,7 +228,7 @@ static int ov21_021E6A6C(UnkStruct_ov21_021E6A68 *param0, void *param1) v0->unk_04 = 0; - ov21_021E6D58(v1, v0, param0->unk_04); + ov21_021E6D58(v1, v0, param0->heapID); ov21_021E6DBC(v1, v0); param0->unk_08 = v1; @@ -282,12 +282,12 @@ static int ov21_021E6B20(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo switch (param1->unk_00) { case 0: - param1->unk_08 = Heap_AllocFromHeap(param1->unk_04, sizeof(UnkStruct_ov21_021E6C60)); + param1->unk_08 = Heap_AllocFromHeap(param1->heapID, sizeof(UnkStruct_ov21_021E6C60)); memset(param1->unk_08, 0, sizeof(UnkStruct_ov21_021E6C60)); param1->unk_00++; break; case 1: - ov21_021E6E64(v3, v2, param1->unk_04); + ov21_021E6E64(v3, v2, param1->heapID); ov21_021E6CB0(v3, v2, v0, 1); param1->unk_00++; break; @@ -314,7 +314,7 @@ static int ov21_021E6BA8(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo UnkStruct_ov21_021E6C60 *v3 = param1->unk_08; if (ov21_021E33AC(v0->unk_0C)) { - ov21_021E728C(v3, v2, v1, param1->unk_04); + ov21_021E728C(v3, v2, v1, param1->heapID); ov21_021E732C(v2, v0); } @@ -340,7 +340,7 @@ static int ov21_021E6BD8(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo } break; case 2: - ov21_021E6E94(v3, v2, param1->unk_04); + ov21_021E6E94(v3, v2, param1->heapID); param1->unk_00++; break; case 3: diff --git a/src/overlay021/ov21_021E737C.c b/src/overlay021/ov21_021E737C.c index e2fea27435..62d9236b58 100644 --- a/src/overlay021/ov21_021E737C.c +++ b/src/overlay021/ov21_021E737C.c @@ -10,7 +10,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/ov21_021E29DC.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" @@ -53,7 +53,7 @@ typedef struct { } UnkStruct_ov21_021E9DB0; typedef struct { - UnkStruct_ov21_021D3320 *unk_00; + pokedexStruct *unk_00; UnkStruct_ov21_021E68F4 *unk_04; } UnkStruct_ov21_021E7468; @@ -276,18 +276,18 @@ static int ov21_021E74A0(UnkStruct_ov21_021E6A68 *param0, void *param1) UnkStruct_ov21_021E74A0 *v1; int v2; int v3; - int v4; + int species; - v1 = Heap_AllocFromHeap(param0->unk_04, sizeof(UnkStruct_ov21_021E74A0)); + v1 = Heap_AllocFromHeap(param0->heapID, sizeof(UnkStruct_ov21_021E74A0)); GF_ASSERT(v1); memset(v1, 0, sizeof(UnkStruct_ov21_021E74A0)); param0->unk_08 = v1; - v4 = ov21_021D37BC(v0->unk_00); - v2 = Pokedex_HeightWeightData_Weight(v0->unk_00->unk_1748, v4); + species = Pokedex_Sort_CurrentSpecies(v0->unk_00); + v2 = Pokedex_HeightWeightData_Weight(v0->unk_00->HWData, species); - if (ov21_021D3920(v0->unk_00) == 0) { + if (Pokedex_Sort_TrainerGender(v0->unk_00) == 0) { v3 = 380; } else { v3 = 340; @@ -340,14 +340,14 @@ static int ov21_021E7530(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo switch (param1->unk_00) { case 0: - param1->unk_08 = Heap_AllocFromHeap(param1->unk_04, sizeof(UnkStruct_ov21_021E7714)); + param1->unk_08 = Heap_AllocFromHeap(param1->heapID, sizeof(UnkStruct_ov21_021E7714)); memset(param1->unk_08, 0, sizeof(UnkStruct_ov21_021E7714)); v3 = param1->unk_08; v3->unk_B8 = 1; param1->unk_00++; break; case 1: - ov21_021E7800(v3, v2, v0, v1, param1->unk_04); + ov21_021E7800(v3, v2, v0, v1, param1->heapID); ov21_021E771C(v3, v2, v0, 1); param1->unk_00++; break; @@ -548,15 +548,15 @@ static void ov21_021E7904(UnkStruct_ov21_021E7714 *param0, UnkStruct_ov21_021E74 { UnkStruct_ov21_021D13FC *v0 = param1->unk_00; int v1, v2, v3, v4; - int v5 = ov21_021D37BC(param2->unk_00); + int species = Pokedex_Sort_CurrentSpecies(param2->unk_00); BOOL v6; NARC *v7 = ov21_021D26E0(param1->unk_00); int v8; NARC *v9; v9 = NARC_ctor(NARC_INDEX_POKETOOL__ICONGRA__PL_POKE_ICON, param3); - v8 = ov21_021D33D4(param2->unk_00, v5); - v1 = PokeIconSpriteIndex(v5, 0, v8); + v8 = ov21_021D33D4(param2->unk_00, species);// lasthere + v1 = PokeIconSpriteIndex(species, 0, v8); v2 = PokeIconPalettesFileIndex(); v3 = PokeIconCellsFileIndex(); v4 = PokeIconAnimationFileIndex(); @@ -628,8 +628,8 @@ static void ov21_021E7B34(UnkStruct_ov21_021E7714 *param0, UnkStruct_ov21_021E74 VecFx32 v3; short v4; short v5; - int v6 = ov21_021D37BC(param2->unk_00); - int v7 = ov21_021D33D4(param2->unk_00, v6); + int species = Pokedex_Sort_CurrentSpecies(param2->unk_00); + int v7 = ov21_021D33D4(param2->unk_00, species); sub_020093B4(&v0, 93 + 7000, 14 + 7000, 91 + 7000, 92 + 7000, 0xffffffff, 0xffffffff, 0, 3, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); @@ -643,7 +643,7 @@ static void ov21_021E7B34(UnkStruct_ov21_021E7714 *param0, UnkStruct_ov21_021E74 param0->unk_00 = CellActorCollection_Add(&v1); - if (ov21_021D3920(param2->unk_00) == 0) { + if (Pokedex_Sort_TrainerGender(param2->unk_00) == 0) { CellActor_SetAnim(param0->unk_00, 3); } else { CellActor_SetAnim(param0->unk_00, 4); @@ -680,7 +680,7 @@ static void ov21_021E7B34(UnkStruct_ov21_021E7714 *param0, UnkStruct_ov21_021E74 v1.position.y = 64 << FX32_SHIFT; param0->unk_04 = CellActorCollection_Add(&v1); - CellActor_SetExplicitPaletteWithOffset(param0->unk_04, PokeIconPaletteIndex(v6, v7, 0)); + CellActor_SetExplicitPaletteWithOffset(param0->unk_04, PokeIconPaletteIndex(species, v7, 0)); } static void ov21_021E7CCC(UnkStruct_ov21_021E7714 *param0) @@ -722,17 +722,17 @@ static void ov21_021E7CF8(UnkStruct_ov21_021E747C *param0, int param1) MessageLoader_Free(v1); } -static void ov21_021E7DA8(UnkStruct_ov21_021E747C *param0, const UnkStruct_ov21_021E7468 *param1, int param2) +static void ov21_021E7DA8(UnkStruct_ov21_021E747C *param0, const UnkStruct_ov21_021E7468 *param1, int heapID) { - Strbuf *v0 = Strbuf_Init(32, param2); - int v2 = ov21_021D37BC(param1->unk_00); - Strbuf *v3 = MessageUtil_SpeciesName(v2, param2); + Strbuf *v0 = Strbuf_Init(32, heapID); + int species = Pokedex_Sort_CurrentSpecies(param1->unk_00); + Strbuf *v3 = MessageUtil_SpeciesName(species, heapID); int weightMessageBankIndex = Weight_Message_Bank_Index(); - MessageLoader *v1 = MessageLoader_Init(0, 26, weightMessageBankIndex, param2); + MessageLoader *v1 = MessageLoader_Init(0, 26, weightMessageBankIndex, heapID); sub_0201D78C(¶m0->unk_00->unk_04, 0, v3, 26, 152, 0, ((u32)(((2 & 0xff) << 16) | ((1 & 0xff) << 8) | ((0 & 0xff) << 0))), NULL); - MessageLoader_GetStrbuf(v1, v2, v0); + MessageLoader_GetStrbuf(v1, species, v0); { u32 v5 = 32 + 78 - sub_02002D7C(0, v0, 0); @@ -742,11 +742,11 @@ static void ov21_021E7DA8(UnkStruct_ov21_021E747C *param0, const UnkStruct_ov21_ Strbuf_Free(v3); MessageLoader_Free(v1); - v1 = MessageLoader_Init(0, 26, 697, param2); + v1 = MessageLoader_Init(0, 26, 697, heapID); - sub_0201D78C(¶m0->unk_00->unk_04, 0, ov21_021D3914(param1->unk_00), 146, 152, 0, ((u32)(((2 & 0xff) << 16) | ((1 & 0xff) << 8) | ((0 & 0xff) << 0))), NULL); + sub_0201D78C(¶m0->unk_00->unk_04, 0, Pokedex_Sort_TrainerName(param1->unk_00), 146, 152, 0, ((u32)(((2 & 0xff) << 16) | ((1 & 0xff) << 8) | ((0 & 0xff) << 0))), NULL); - if (ov21_021D3920(param1->unk_00) == 0) { + if (Pokedex_Sort_TrainerGender(param1->unk_00) == 0) { MessageLoader_GetStrbuf(v1, 97, v0); } else { MessageLoader_GetStrbuf(v1, 98, v0); diff --git a/src/overlay021/ov21_021E8484.c b/src/overlay021/ov21_021E8484.c index 46e3d893ff..940b181e43 100644 --- a/src/overlay021/ov21_021E8484.c +++ b/src/overlay021/ov21_021E8484.c @@ -9,7 +9,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021DF734.h" #include "overlay021/ov21_021E29DC.h" @@ -39,7 +39,7 @@ typedef struct { int *unk_00; - UnkStruct_ov21_021D3320 *unk_04; + pokedexStruct *unk_04; UnkStruct_ov21_021E68F4 *unk_08; UnkStruct_ov21_021E68F4 *unk_0C; } UnkStruct_ov21_021E8570; @@ -204,14 +204,14 @@ static int ov21_021E85A0(UnkStruct_ov21_021E6A68 *param0, void *param1) UnkStruct_ov21_021E88B0 *v1 = param0->unk_08; int v2; - v1 = Heap_AllocFromHeap(param0->unk_04, sizeof(UnkStruct_ov21_021E88B0)); + v1 = Heap_AllocFromHeap(param0->heapID, sizeof(UnkStruct_ov21_021E88B0)); memset(v1, 0, sizeof(UnkStruct_ov21_021E88B0)); for (v2 = 0; v2 < 1; v2++) { v1->unk_10[v2] = (3 + 1); } - ov21_021E886C(v1, v0, param0->unk_04); + ov21_021E886C(v1, v0, param0->heapID); ov21_021E88B8(v1, v0); param0->unk_08 = v1; @@ -270,12 +270,12 @@ static int ov21_021E8654(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo switch (param1->unk_00) { case 0: - param1->unk_08 = Heap_AllocFromHeap(param1->unk_04, sizeof(UnkStruct_ov21_021E8794)); + param1->unk_08 = Heap_AllocFromHeap(param1->heapID, sizeof(UnkStruct_ov21_021E8794)); memset(param1->unk_08, 0, sizeof(UnkStruct_ov21_021E8794)); param1->unk_00++; break; case 1: - ov21_021E891C(v3, v2, param1->unk_04); + ov21_021E891C(v3, v2, param1->heapID); ov21_021E87C4(v3, v2, v0, 1); param1->unk_00++; break; @@ -302,7 +302,7 @@ static int ov21_021E86DC(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo UnkStruct_ov21_021E8794 *v3 = param1->unk_08; if (ov21_021E33AC(v0->unk_08)) { - ov21_021E8CBC(v2, v3, v1, param1->unk_04); + ov21_021E8CBC(v2, v3, v1, param1->heapID); ov21_021E8D04(v2, v0); } @@ -328,7 +328,7 @@ static int ov21_021E870C(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo } break; case 2: - ov21_021E894C(v3, v2, param1->unk_04); + ov21_021E894C(v3, v2, param1->heapID); param1->unk_00++; break; case 3: diff --git a/src/overlay021/pokedex_sort.c b/src/overlay021/pokedex_sort.c new file mode 100644 index 0000000000..f4a0608513 --- /dev/null +++ b/src/overlay021/pokedex_sort.c @@ -0,0 +1,956 @@ +#include "overlay021/pokedex_sort.h" + +#include +#include + +#include "struct_decls/pokedexdata_decl.h" + +#include "overlay021/struct_ov21_021D3208.h" +#include "overlay021/struct_ov21_021D3320.h" +#include "overlay021/struct_ov21_021D37DC.h" +#include "overlay021/struct_ov21_021D3A60.h" + +#include "core_sys.h" +#include "heap.h" +#include "narc.h" +#include "pokedex_data_index.h" +#include "pokedex_heightweight.h" +#include "strbuf.h" +#include "trainer_info.h" +#include "unk_02006E3C.h" +#include "unk_0202631C.h" + +static void Pokedex_Sort_Encountered(u16 *pokedexPreFilterArray, int *numEncountered, const PokedexData *dexData, const u16 *speciesArray, int pokedexLength); +static void Pokedex_Sort_Caught(u16 *param0, int *param1, const u16 *param2, int param3, const u16 *param4, int param5, BOOL param6, const PokedexData *dexData); +static void Pokedex_Sort_CaughtStatus(pokedexCompletionStruct *pokedexCompletion, const PokedexData *param1, const u16 *param2, int param3); +static void Pokedex_Sort_IndentifyEnountered_Full(pokedexCompletionStruct *pokedexCompletion, const u16 *param1, int param2); +static void Pokedex_Sort_IndentifyEnountered_Filtered(pokedexCompletionStruct *pokedexCompletion); +static void Pokedex_Sort_NumSeenNCaught(pokedexCompletionStruct *pokedexCompletion, int *numEncountered, int *numCaught); +static u16 *Pokedex_Sort_SortedArray(int heapID, int pokedexSort, int *pokedexLength); +static void Pokedex_Sort_Order(int sortCategory, u16 *pokedexPostFilterArray, int *dexLengthPostFilter, const u16 *param3, int dexLengthPreFilter, int heapID, const PokedexData *dexData); +static void Pokedex_Sort_FilterFirstLetter(int firstLetterFilter, u16 *pokedexPostFilterArray, int *dexLengthPostFilter, const u16 *pokedexPreFilterArray, int numEncountered, int heapID, const PokedexData *dexData); +static void Pokedex_Sort_FilterType(int typeFilter, u16 *param1, int *param2, const u16 *param3, int dexLengthPreFilter, int heapID, const PokedexData *dexData); +static void Pokedex_Sort_FilterBodyShape(int bodyShapeFilter, u16 *param1, int *param2, const u16 *param3, int dexLengthPreFilter, int heapID, const PokedexData *dexData); + +void Pokedex_Sort_PopulatePokedexStruct(pokedexStruct *pokedexS, UnkStruct_ov21_021D3208 *param1, int heapID) +{ + int sortCategory; + int firstLetterFilter; + int typeFilter1; + int typeFilter2; + int bodyShapeFilter; + BOOL dexExists; + u32 isNationalDex; + + memset(pokedexS, 0, sizeof(pokedexStruct)); + + pokedexS->dexData = param1->dexData; + pokedexS->timeOfDay = param1->timeOfDay; + + if (Pokedex_NationalUnlocked(pokedexS->dexData)) { + pokedexS->nationalDexUnlocked = 1; + } else { + pokedexS->nationalDexUnlocked = 0; + } + + if (param1->unk_20 == 2) { + if (pokedexS->nationalDexUnlocked) { + isNationalDex = 1; + } else { + isNationalDex = 0; + } + } else { + isNationalDex = param1->unk_20; + } + + if (isNationalDex == 1) { + pokedexS->isNationalDex = 1; + sortCategory = 0; + firstLetterFilter = 0; + typeFilter1 = 0; + typeFilter2 = 0; + bodyShapeFilter = 0; + } else { + pokedexS->isNationalDex = 0; + sortCategory = 0; + firstLetterFilter = 0; + typeFilter1 = 0; + typeFilter2 = 0; + bodyShapeFilter = 0; + } + + dexExists = Pokedex_Sort_Unfiltered(pokedexS, sortCategory, firstLetterFilter, typeFilter1, typeFilter2, bodyShapeFilter, pokedexS->isNationalDex, heapID); + + GF_ASSERT(dexExists); + + ov21_021D3794(pokedexS, param1->unk_1C); + ov21_021D3434(pokedexS, param1->unk_1C); + ov21_021D344C(pokedexS, param1->unk_20); + + pokedexS->TrainerGameCode = TrainerInfo_GameCode(param1->unk_04); + pokedexS->TrainerGender = TrainerInfo_Gender(param1->unk_04); + pokedexS->trainerName = TrainerInfo_NameNewStrbuf(param1->unk_04, heapID); + pokedexS->HWData = Pokedex_HeightWeightData(heapID); + + if (pokedexS->TrainerGender == 0) { + Pokedex_HeightWeightData_Load(pokedexS->HWData, 0, heapID); + } else { + Pokedex_HeightWeightData_Load(pokedexS->HWData, 1, heapID); + } + + pokedexS->pokedexSFlag_1 = param1->pokedexSFlag_1; + pokedexS->pokedexSFlag_2 = param1->pokedexSFlag_2; + pokedexS->pokedexSFlag_3 = param1->pokedexSFlag_3; + pokedexS->pokedexSFlag_4 = param1->pokedexSFlag_4; +} + +void ov21_021D3320(pokedexStruct *pokedexS) +{ + Strbuf_Free(pokedexS->trainerName); + Pokedex_HeightWeightData_Release(pokedexS->HWData); + Pokedex_HeightWeightData_Free(pokedexS->HWData); + + pokedexS->HWData = NULL; +} + +u32 ov21_021D334C(const pokedexStruct *pokedexS, int param1, int param2) +{ + u32 v0; + + v0 = sub_02027058(pokedexS->dexData, param1, param2); + return v0; +} + +u32 ov21_021D335C(const pokedexStruct *pokedexS, int param1) +{ + int v0; + + GF_ASSERT(param1 < 28); + v0 = sub_020270AC(pokedexS->dexData, param1); + + return v0; +} + +u32 ov21_021D3374(const pokedexStruct *pokedexS, int param1) +{ + u32 v0; + + GF_ASSERT(param1 < 2); + v0 = sub_020270F8(pokedexS->dexData, param1); + + return v0; +} + +u32 ov21_021D338C(const pokedexStruct *pokedexS, int param1) +{ + u32 v0; + + GF_ASSERT(param1 < 2); + + v0 = sub_02027154(pokedexS->dexData, param1); + return v0; +} + +u32 ov21_021D33A4(const pokedexStruct *pokedexS, int param1) +{ + u32 v0; + + GF_ASSERT(param1 < 3); + + v0 = sub_020271B0(pokedexS->dexData, param1); + return v0; +} + +u32 ov21_021D33BC(const pokedexStruct *pokedexS, int param1) +{ + u32 v0; + + GF_ASSERT(param1 < 3); + + v0 = sub_02027208(pokedexS->dexData, param1); + return v0; +} + +u32 ov21_021D33D4(const pokedexStruct *pokedexS, u32 species) +{ + return sub_0202756C(pokedexS->dexData, species, 0); +} + +u32 ov21_021D33E0(const pokedexStruct *pokedexS, int param1) +{ + int v0 = ov21_021D334C(pokedexS, param1, 1); + + if (v0 == -1) { + return 1; + } + + return 2; +} + +u32 ov21_021D33F8(const pokedexStruct *pokedexS) +{ + return sub_0202702C(pokedexS->dexData, 0); +} + +u32 ov21_021D3404(const pokedexStruct *pokedexS, int param1) +{ + return sub_02027264(pokedexS->dexData, param1); +} + +u32 ov21_021D3410(const pokedexStruct *pokedexS, u32 param1, int param2) +{ + return sub_0202756C(pokedexS->dexData, param1, param2); +} + +u32 ov21_021D341C(const pokedexStruct *pokedexS, u32 param1) +{ + return sub_020276C8(pokedexS->dexData, param1); +} + +BOOL Pokedex_Sort_PokedexUnlocked(const pokedexStruct *pokedexS) +{ + return Pokedex_NationalUnlocked(pokedexS->dexData); +} + +void ov21_021D3434(pokedexStruct *pokedexS, u32 param1) +{ + pokedexS->unk_175C = param1; +} + +u32 ov21_021D3440(const pokedexStruct *pokedexS) +{ + return pokedexS->unk_175C; +} + +void ov21_021D344C(pokedexStruct *pokedexS, u32 param1) +{ + pokedexS->unk_175E = param1; +} + +u32 ov21_021D3458(const pokedexStruct *pokedexS) +{ + return pokedexS->unk_175E; +} + +BOOL Pokedex_Sort(pokedexStruct *pokedexS, int sortCategory, int firstLetterFilter, int typeFilter1, int typeFilter2, int bodyShapeFilter, int isNationalDex, int heapID, BOOL isFiltered) +{ + u16 *pokedexPreFilterArray; + int dexLengthPreFilter; + u16 *pokedexPostFilterArray; + int dexLengthPostFilter; + u16 *pokedexArray; + int pokedexLength; + BOOL dexExists; + + pokedexPreFilterArray = Heap_AllocFromHeapAtEnd(heapID, sizeof(u16) * NATIONAL_DEX_COUNT); + + GF_ASSERT(pokedexPreFilterArray); + memset(pokedexPreFilterArray, 0, sizeof(u16) * NATIONAL_DEX_COUNT); + + dexLengthPreFilter = 0; + pokedexPostFilterArray = Heap_AllocFromHeapAtEnd(heapID, sizeof(u16) * NATIONAL_DEX_COUNT); + + GF_ASSERT(pokedexPostFilterArray); + memset(pokedexPostFilterArray, 0, sizeof(u16) * NATIONAL_DEX_COUNT); + + dexLengthPostFilter = 0; + + if (isNationalDex == 0) { + pokedexArray = Pokedex_Sort_SortedArray(heapID, 1, &pokedexLength); + Pokedex_Sort_Encountered(pokedexPreFilterArray, &dexLengthPreFilter, pokedexS->dexData, pokedexArray, pokedexLength); + } else { + pokedexArray = Pokedex_Sort_SortedArray(heapID, 0, &pokedexLength); + Pokedex_Sort_Encountered(pokedexPreFilterArray, &dexLengthPreFilter, pokedexS->dexData, pokedexArray, pokedexLength); + } + + Pokedex_Sort_Order(sortCategory, pokedexPostFilterArray, &dexLengthPostFilter, pokedexPreFilterArray, dexLengthPreFilter, heapID, pokedexS->dexData); + + memcpy(pokedexPreFilterArray, pokedexPostFilterArray, sizeof(u16) * dexLengthPostFilter); + dexLengthPreFilter = dexLengthPostFilter; + + memset(pokedexPostFilterArray, 0, sizeof(u16) * dexLengthPostFilter); + dexLengthPostFilter = 0; + + do { + Pokedex_Sort_FilterFirstLetter(firstLetterFilter, pokedexPostFilterArray, &dexLengthPostFilter, pokedexPreFilterArray, dexLengthPreFilter, heapID, pokedexS->dexData); + + if (dexLengthPostFilter == 0) { + dexExists = 0; + break; + } + + memcpy(pokedexPreFilterArray, pokedexPostFilterArray, sizeof(u16) * dexLengthPostFilter); + dexLengthPreFilter = dexLengthPostFilter; + + memset(pokedexPostFilterArray, 0, sizeof(u16) * dexLengthPostFilter); + dexLengthPostFilter = 0; + + Pokedex_Sort_FilterType(typeFilter1, pokedexPostFilterArray, &dexLengthPostFilter, pokedexPreFilterArray, dexLengthPreFilter, heapID, pokedexS->dexData); + + if (dexLengthPostFilter == 0) { + dexExists = 0; + break; + } + + memcpy(pokedexPreFilterArray, pokedexPostFilterArray, sizeof(u16) * dexLengthPostFilter); + dexLengthPreFilter = dexLengthPostFilter; + + memset(pokedexPostFilterArray, 0, sizeof(u16) * dexLengthPostFilter); + dexLengthPostFilter = 0; + + Pokedex_Sort_FilterType(typeFilter2, pokedexPostFilterArray, &dexLengthPostFilter, pokedexPreFilterArray, dexLengthPreFilter, heapID, pokedexS->dexData); + + if (dexLengthPostFilter == 0) { + dexExists = 0; + break; + } + + memcpy(pokedexPreFilterArray, pokedexPostFilterArray, sizeof(u16) * dexLengthPostFilter); + dexLengthPreFilter = dexLengthPostFilter; + + memset(pokedexPostFilterArray, 0, sizeof(u16) * dexLengthPostFilter); + dexLengthPostFilter = 0; + + Pokedex_Sort_FilterBodyShape(bodyShapeFilter, pokedexPostFilterArray, &dexLengthPostFilter, pokedexPreFilterArray, dexLengthPreFilter, heapID, pokedexS->dexData); + + if (dexLengthPostFilter == 0) { + dexExists = 0; + break; + } + + memcpy(pokedexPreFilterArray, pokedexPostFilterArray, sizeof(u16) * dexLengthPostFilter); + dexLengthPreFilter = dexLengthPostFilter; + + memset(pokedexPostFilterArray, 0, sizeof(u16) * dexLengthPostFilter); + dexLengthPostFilter = 0; + + Pokedex_Sort_CaughtStatus(&pokedexS->pokedexCompletion, pokedexS->dexData, pokedexPreFilterArray, dexLengthPreFilter); + + if ((sortCategory != 0) || (firstLetterFilter != 0) || (typeFilter1 != 0) || (typeFilter2 != 0) || (bodyShapeFilter != 0)) { + isFiltered = 1; + } + + if (isFiltered == 0) { + Pokedex_Sort_IndentifyEnountered_Full(&pokedexS->pokedexCompletion, pokedexArray, pokedexLength); + } else { + Pokedex_Sort_IndentifyEnountered_Filtered(&pokedexS->pokedexCompletion); + } + + dexExists = 1; + } while (0); + + Pokedex_Sort_NumSeenNCaught(&pokedexS->pokedexCompletion, &pokedexS->numEncountered, &pokedexS->numCaught); + + Heap_FreeToHeap(pokedexPreFilterArray); + Heap_FreeToHeap(pokedexPostFilterArray); + Heap_FreeToHeap(pokedexArray); + + return dexExists; +} + +BOOL Pokedex_Sort_Unfiltered(pokedexStruct *pokedexS, int sortCategory, int firstLetterFilter, int typeFilter1, int typeFilter2, int bodyShapeFilter, int isNationalDex, int heapID) +{ + return Pokedex_Sort(pokedexS, sortCategory, firstLetterFilter, typeFilter1, typeFilter2, bodyShapeFilter, isNationalDex, heapID, 0); +} + +BOOL ov21_021D36A4(const pokedexStruct *pokedexS, int param1) +{ + if (param1 == 0) { + return 1; + } + + if (pokedexS->nationalDexUnlocked) { + return 1; + } + + return 0; +} + +BOOL ov21_021D36C0(pokedexStruct *pokedexS, int param1) +{ + BOOL v0; + + v0 = ov21_021D36A4(pokedexS, param1); + + if (v0) { + pokedexS->isNationalDex = param1; + } + + return v0; +} + +int ov21_021D36D8(const pokedexStruct *pokedexS) +{ + return pokedexS->isNationalDex; +} + +BOOL Pokedex_Sort_IsValidDexIndex(const pokedexStruct *pokedexS, int dexIndex) +{ + if (((dexIndex) >= 0) && ((dexIndex) < pokedexS->pokedexCompletion.numEncountered)) { + return 1; + } + + return 0; +} + +BOOL ov21_021D36FC(pokedexStruct *pokedexS, int dexIndex) +{ + if (Pokedex_Sort_IsValidDexIndex(pokedexS, dexIndex)) { + pokedexS->pokedexCompletion.unk_F68 = dexIndex; + return 1; + } + + return 0; +} + +BOOL ov21_021D371C(pokedexStruct *pokedexS, int param1) +{ + if (Pokedex_Sort_IsValidDexIndex(pokedexS, pokedexS->pokedexCompletion.unk_F68 + param1)) { + pokedexS->pokedexCompletion.unk_F68 += param1; + return 1; + } + + if (param1 >= 0) { + pokedexS->pokedexCompletion.unk_F68 = pokedexS->pokedexCompletion.numEncountered - 1; + } else { + pokedexS->pokedexCompletion.unk_F68 = 0; + } + + return 0; +} + +int ov21_021D375C(const pokedexStruct *pokedexS) +{ + return pokedexS->pokedexCompletion.unk_F68; +} + +int Pokedex_Sort_CompletionNumEncountered(const pokedexStruct *pokedexS) +{ + return pokedexS->pokedexCompletion.numEncountered; +} + +int ov21_021D3770(const pokedexStruct *pokedexS, u32 param1) +{ + int index; + int numEncountered = Pokedex_Sort_CompletionNumEncountered(pokedexS); + int species; + + for (index = 0; index < numEncountered; index++) { + species = pokedexS->pokedexCompletion.caughtStatusArray[index].species; + + if (species == param1) { + break; + } + } + + return index; +} + +BOOL ov21_021D3794(pokedexStruct *pokedexS, int param1) +{ + u32 v0 = Pokedex_Sort_CompletionNumEncountered(pokedexS); + u32 v1 = ov21_021D3770(pokedexS, param1); + + if (v0 > v1) { + return ov21_021D36FC(pokedexS, v1); + } + + return 0; +} + +int Pokedex_Sort_CurrentSpecies(const pokedexStruct *pokedexS) +{ + return pokedexS->pokedexCompletion.caughtStatusArray[pokedexS->pokedexCompletion.unk_F68].species; +} + +int Pokedex_Sort_CurrentCaughtStatus(const pokedexStruct *pokedexS) +{ + return pokedexS->pokedexCompletion.caughtStatusArray[pokedexS->pokedexCompletion.unk_F68].caughtStatus; +} + +const speciesCaughtStatusStruct *Pokedex_Sort_SpeciesCaughtStatus(const pokedexStruct *pokedexS, int dexIndex) +{ + if (Pokedex_Sort_IsValidDexIndex(pokedexS, dexIndex)) { + return &pokedexS->pokedexCompletion.caughtStatusArray[dexIndex]; + } + + return NULL; +} + +BOOL ov21_021D37F8(const pokedexStruct *pokedexS, int param1) +{ + if ((pokedexS->pokedexCompletion.numSpecies > param1) && (param1 >= 0)) { + return 1; + } + + return 0; +} + +BOOL ov21_021D3810(pokedexStruct *pokedexS, int param1) +{ + if (ov21_021D37F8(pokedexS, param1)) { + pokedexS->pokedexCompletion.unk_1724 = param1; + + ov21_021D36FC(pokedexS, pokedexS->pokedexCompletion.encounteredIndexArray[pokedexS->pokedexCompletion.unk_1724]); + return 1; + } + + return 0; +} + +BOOL ov21_021D3844(pokedexStruct *pokedexS, int param1) +{ + if (ov21_021D387C(pokedexS, param1)) { + pokedexS->pokedexCompletion.unk_1724 += param1; + + ov21_021D36FC(pokedexS, pokedexS->pokedexCompletion.encounteredIndexArray[pokedexS->pokedexCompletion.unk_1724]); + return 1; + } + + return 0; +} + +BOOL ov21_021D387C(pokedexStruct *pokedexS, int param1) +{ + if (ov21_021D37F8(pokedexS, pokedexS->pokedexCompletion.unk_1724 + param1)) { + return 1; + } + + return 0; +} + +int ov21_021D3898(const pokedexStruct *pokedexS) +{ + return pokedexS->pokedexCompletion.unk_1724; +} + +int ov21_021D38A4(const pokedexStruct *pokedexS) +{ + return pokedexS->pokedexCompletion.numSpecies; +} + +int Pokedex_Sort_SeenIndexToSpecies(const pokedexStruct *pokedexS, int encounteredIndex) +{ + return pokedexS->pokedexCompletion.encounteredIndexArray[encounteredIndex]; +} + +void ov21_021D38C0(pokedexStruct *pokedexS) +{ + int v0; + + for (v0 = 0; v0 < pokedexS->pokedexCompletion.numSpecies; v0++) { + if (Pokedex_Sort_SeenIndexToSpecies(pokedexS, v0) == ov21_021D375C(pokedexS)) { + ov21_021D3810(pokedexS, v0); + break; + } + } +} + +int Pokedex_Sort_NumEncountered(const pokedexStruct *pokedexS) +{ + return pokedexS->numEncountered; +} + +int Pokedex_Sort_NumCaught(const pokedexStruct *pokedexS) +{ + return pokedexS->numCaught; +} + +Strbuf *Pokedex_Sort_TrainerName(const pokedexStruct *pokedexS) +{ + return pokedexS->trainerName; +} + +u32 Pokedex_Sort_TrainerGender(const pokedexStruct *pokedexS) +{ + return pokedexS->TrainerGender; +} + +BOOL ov21_021D392C(const pokedexStruct *pokedexS, int param1) +{ + int species = Pokedex_Sort_CurrentSpecies(pokedexS); + + if (sub_02027514(pokedexS->dexData) == 0) { + return 0; + } + + return sub_020274D0(pokedexS->dexData, species, param1); +} + +BOOL Pokedex_Sort_CanDetectForms(const pokedexStruct *pokedexS) +{ + return Pokedex_CanDetectForms(pokedexS->dexData); +} + +void ov21_021D3960(pokedexStruct *pokedexS) +{ + if (gCoreSys.touchHeld) { + pokedexS->unk_1758 = 0; + return; + } + + if (gCoreSys.pressedKeys) { + if (pokedexS->unk_1758 == 0) { + pokedexS->unk_1758 = 1; + } else { + pokedexS->unk_1758 = 2; + } + } +} + +u32 ov21_021D3998(const pokedexStruct *pokedexS) +{ + return pokedexS->unk_1758; +} + +static void Pokedex_Sort_Encountered(u16 *pokedexPreFilterArray, int *numEncountered, const PokedexData *dexData, const u16 *speciesArray, int pokedexLength) +{ + int index; + + *numEncountered = 0; + + for (index = 0; index < pokedexLength; index++) { + if (Pokedex_EncounteredSpecies(dexData, speciesArray[index])) { + pokedexPreFilterArray[*numEncountered] = speciesArray[index]; + (*numEncountered)++; + } + } +} + +static void Pokedex_Sort_Caught(u16 *param0, int *param1, const u16 *speciesArray, int param3, const u16 *param4, int param5, BOOL param6, const PokedexData *dexData) +{ + int v0, v1; + + *param1 = 0; + + for (v0 = 0; v0 < param3; v0++) { + for (v1 = 0; v1 < param5; v1++) { + if (speciesArray[v0] == param4[v1]) { + if (param6 == 1) { + break; + } else { + if (Pokedex_CaughtSpecies(dexData, speciesArray[v0])) { + break; + } + } + } + } + + if (v1 < param5) { + param0[*param1] = speciesArray[v0]; + (*param1)++; + } + } +} + +static void Pokedex_Sort_CaughtStatus(pokedexCompletionStruct *pokedexCompletion, const PokedexData *dexData, const u16 *speciesArray, int numEncountered) +{ + int index; + + pokedexCompletion->numEncountered = 0; + + for (index = 0; index < numEncountered; index++) { + if (Pokedex_CaughtSpecies(dexData, speciesArray[index])) { + pokedexCompletion->caughtStatusArray[pokedexCompletion->numEncountered].caughtStatus = 2; + } else { + pokedexCompletion->caughtStatusArray[pokedexCompletion->numEncountered].caughtStatus = 1; + } + + pokedexCompletion->caughtStatusArray[pokedexCompletion->numEncountered].species = speciesArray[index]; + pokedexCompletion->numEncountered++; + } +} + +static void Pokedex_Sort_IndentifyEnountered_Full(pokedexCompletionStruct *pokedexCompletion, const u16 *speciesArray, int pokedexLength) +{ + int dexIndex; + int encounteredIndex; + + encounteredIndex = 0; + pokedexCompletion->numSpecies = 0; + + for (dexIndex = 0; dexIndex < pokedexLength; dexIndex++) { + if (encounteredIndex < pokedexCompletion->numEncountered) { + if (pokedexCompletion->caughtStatusArray[encounteredIndex].species == speciesArray[dexIndex]) { + pokedexCompletion->encounteredIndexArray[pokedexCompletion->numSpecies] = encounteredIndex; + encounteredIndex++; + pokedexCompletion->numSpecies++; + } else { + pokedexCompletion->encounteredIndexArray[pokedexCompletion->numSpecies] = (NATIONAL_DEX_COUNT + 1); + pokedexCompletion->numSpecies++; + } + } + } +} + +static void Pokedex_Sort_IndentifyEnountered_Filtered(pokedexCompletionStruct *pokedexCompletion) +{ + int encounteredIndex; + + pokedexCompletion->numSpecies = 0; + + for (encounteredIndex = 0; encounteredIndex < pokedexCompletion->numEncountered; encounteredIndex++) { + pokedexCompletion->encounteredIndexArray[pokedexCompletion->numSpecies] = encounteredIndex; + pokedexCompletion->numSpecies++; + } +} + +static u16 *Pokedex_Sort_SortedArray(int heapID, int pokedexSort, int *pokedexLength) +{ + u32 pokedexSize; + u16 *pokedexSortedArray; + u32 pokedexDataNarcIndex; + + GF_ASSERT(47 > pokedexSort); + + pokedexDataNarcIndex = Pokedex_Data_NARC_Index(); + pokedexSortedArray = sub_02007068(pokedexDataNarcIndex, 11 + pokedexSort, 0, heapID, 0, &pokedexSize); + *pokedexLength = pokedexSize / (sizeof(u16)); + + return pokedexSortedArray; +} + +static void Pokedex_Sort_Order(int sortCategory, u16 *pokedexPostFilterArray, int *dexLengthPostFilter, const u16 *pokedexPreFilterArray, int dexLengthPreFilter, int heapID, const PokedexData *dexData) +{ + u16 *pokedexSortedArray; + int pokedexLength; + BOOL isAlphabetical = 0; + + switch (sortCategory) { + case 0: + pokedexSortedArray = NULL; + break; + case 1: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 2, &pokedexLength); // alphabetical + isAlphabetical = 1; + break; + case 2: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 3, &pokedexLength); // heaviest + break; + case 3: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 4, &pokedexLength); // lightest + break; + case 4: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 5, &pokedexLength); // tallest + break; + case 5: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 6, &pokedexLength); // shortest + break; + default: + GF_ASSERT(0); + break; + } + + if (pokedexSortedArray != NULL) { + Pokedex_Sort_Caught(pokedexPostFilterArray, dexLengthPostFilter, pokedexSortedArray, pokedexLength, pokedexPreFilterArray, dexLengthPreFilter, isAlphabetical, dexData); + Heap_FreeToHeap(pokedexSortedArray); + } else { + memcpy(pokedexPostFilterArray, pokedexPreFilterArray, (sizeof(u16)) * dexLengthPreFilter); + *dexLengthPostFilter = dexLengthPreFilter; + } +} + +static void Pokedex_Sort_FilterFirstLetter(int firstLetterFilter, u16 *pokedexPostFilterArray, int *dexLengthPostFilter, const u16 *pokedexPreFilterArray, int dexLengthPreFilter, int heapID, const PokedexData *dexData) +{ + u16 *pokedexSortedArray; + int pokedexLength; + + switch (firstLetterFilter) { + case 0: + pokedexSortedArray = NULL; + break; + case 1: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 7, &pokedexLength); // ABC + break; + case 2: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 8, &pokedexLength); // DEF + break; + case 3: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 9, &pokedexLength); // GHI + break; + case 4: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 10, &pokedexLength); // JKL + break; + case 5: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 11, &pokedexLength); // MNO + break; + case 6: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 12, &pokedexLength); // PQR + break; + case 7: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 13, &pokedexLength); // STU + break; + case 8: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 14, &pokedexLength); // VWX + break; + case 9: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 15, &pokedexLength); // YZ + break; + default: + GF_ASSERT(0); + break; + } + + if (pokedexSortedArray != NULL) { + Pokedex_Sort_Caught(pokedexPostFilterArray, dexLengthPostFilter, pokedexPreFilterArray, dexLengthPreFilter, pokedexSortedArray, pokedexLength, 1, dexData); + Heap_FreeToHeap(pokedexSortedArray); + } else { + memcpy(pokedexPostFilterArray, pokedexPreFilterArray, (sizeof(u16)) * dexLengthPreFilter); + *dexLengthPostFilter = dexLengthPreFilter; + } +} + +static void Pokedex_Sort_FilterType(int typeFilter, u16 *param1, int *param2, const u16 *param3, int dexLengthPreFilter, int heapID, const PokedexData *dexData) +{ + u16 *pokedexSortedArray; + int pokedexLength; + + switch (typeFilter) { + case 0: + pokedexSortedArray = NULL; + break; + case 1: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 16, &pokedexLength); // normal + break; + case 2: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 17, &pokedexLength); // fighting + break; + case 3: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 18, &pokedexLength); // flying + break; + case 4: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 19, &pokedexLength); // poison + break; + case 5: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 20, &pokedexLength); // ground + break; + case 6: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 21, &pokedexLength); // rock + break; + case 7: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 22, &pokedexLength); // bug + break; + case 8: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 23, &pokedexLength); // ghost + break; + case 9: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 24, &pokedexLength); // steel + break; + case 10: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 25, &pokedexLength); // fire + break; + case 11: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 26, &pokedexLength); // water + break; + case 12: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 27, &pokedexLength); // grass + break; + case 13: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 28, &pokedexLength); // electric + break; + case 14: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 29, &pokedexLength); // psychic + break; + case 15: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 30, &pokedexLength); // ice + break; + case 16: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 31, &pokedexLength); // dragon + break; + case 17: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 32, &pokedexLength); // dark + break; + default: + GF_ASSERT(0); + break; + } + + if (pokedexSortedArray != NULL) { + Pokedex_Sort_Caught(param1, param2, param3, dexLengthPreFilter, pokedexSortedArray, pokedexLength, 0, dexData); + Heap_FreeToHeap(pokedexSortedArray); + } else { + memcpy(param1, param3, (sizeof(u16)) * dexLengthPreFilter); + *param2 = dexLengthPreFilter; + } +} + +static void Pokedex_Sort_FilterBodyShape(int bodyShapeFilter, u16 *param1, int *param2, const u16 *param3, int dexLengthPreFilter, int heapID, const PokedexData *dexData) +{ + u16 *pokedexSortedArray; + int pokedexLength; + + switch (bodyShapeFilter) { + case 0: + pokedexSortedArray = NULL; + break; + case 1: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 33, &pokedexLength); // quadruped + break; + case 2: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 34, &pokedexLength); // bidedal tailless + break; + case 3: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 35, &pokedexLength); // bipedal tailed + break; + case 4: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 36, &pokedexLength); // serpentine + break; + case 5: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 37, &pokedexLength); // multi winged + break; + case 6: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 38, &pokedexLength); // winged + break; + case 7: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 39, &pokedexLength); // insectoid + break; + case 8: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 40, &pokedexLength); // head base + break; + case 9: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 41, &pokedexLength); // head arms + break; + case 10: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 42, &pokedexLength); // head legs + break; + case 11: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 43, &pokedexLength); // tentacles + break; + case 12: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 44, &pokedexLength); // fins + break; + case 13: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 45, &pokedexLength); // head + break; + case 14: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 46, &pokedexLength); // multi-body + break; + default: + GF_ASSERT(0); + break; + } + + if (pokedexSortedArray != NULL) { + Pokedex_Sort_Caught(param1, param2, param3, dexLengthPreFilter, pokedexSortedArray, pokedexLength, 1, dexData); + Heap_FreeToHeap(pokedexSortedArray); + } else { + memcpy(param1, param3, (sizeof(u16)) * dexLengthPreFilter); + *param2 = dexLengthPreFilter; + } +} + +static void Pokedex_Sort_NumSeenNCaught(pokedexCompletionStruct *pokedexCompletion, int *numEncountered, int *numCaught) +{ + int index; + + *numEncountered = 0; + *numCaught = 0; + + for (index = 0; index < pokedexCompletion->numEncountered; index++) { + if (pokedexCompletion->caughtStatusArray[index].caughtStatus == 2) { + (*numCaught)++; + } + + (*numEncountered)++; + } +} diff --git a/src/overlay023/ov23_0223E140.c b/src/overlay023/ov23_0223E140.c index 3188c44e23..343d140f4b 100644 --- a/src/overlay023/ov23_0223E140.c +++ b/src/overlay023/ov23_0223E140.c @@ -1786,7 +1786,7 @@ static int ov23_0223F970(UnkStruct_ov23_02256EB0 *param0) SaveData *v0 = FieldSystem_SaveData(Unk_ov23_02257740->fieldSystem); UndergroundData *v1 = sub_020298B0(v0); BOOL v2 = TrainerInfo_ID(SaveData_GetTrainerInfo(v0)) % 2; - BOOL v3 = sub_02027474(SaveData_Pokedex(v0)); + BOOL v3 = Pokedex_NationalUnlocked(SaveData_Pokedex(v0)); int v4 = 0; if (v3) { diff --git a/src/overlay023/ov23_022521F0.c b/src/overlay023/ov23_022521F0.c index ec4ac1d02b..c887b7daff 100644 --- a/src/overlay023/ov23_022521F0.c +++ b/src/overlay023/ov23_022521F0.c @@ -136,7 +136,7 @@ static void ov23_022522F0(UnkStruct_ov23_02250CD4 *param0, int param1) int v1, v2, v3, v4, v5; SaveData *v6 = FieldSystem_SaveData(param0->fieldSystem); UndergroundData *v7 = sub_020298B0(v6); - BOOL v8 = sub_02027474(SaveData_Pokedex(v6)); + BOOL v8 = Pokedex_NationalUnlocked(SaveData_Pokedex(v6)); MATH_InitRand16(&v0, sub_02028930(v7) + param1); diff --git a/src/overlay028/ov28_022561C0.c b/src/overlay028/ov28_022561C0.c index 2e9f32b169..63e46cf6ce 100644 --- a/src/overlay028/ov28_022561C0.c +++ b/src/overlay028/ov28_022561C0.c @@ -637,13 +637,13 @@ static void ov28_02256914(UnkStruct_ov28_02256210 *param0, const UnkStruct_ov28_ v1 = SaveData_Pokedex(PoketchSystem_GetSaveData(param0->poketchSys)); - if (sub_02027474(v1)) { + if (Pokedex_NationalUnlocked(v1)) { v2 = v0; } else { v2 = Pokemon_NationalDexNumber((u16)v0); } - if (((v2 > 0) && (v2 <= NATIONAL_DEX_COUNT)) && sub_02026FE8(v1, v2)) { + if (((v2 > 0) && (v2 <= NATIONAL_DEX_COUNT)) && Pokedex_EncounteredSpecies(v1, v2)) { ov25_02254444(v2, 0); } } diff --git a/src/overlay062/ov62_02237D24.c b/src/overlay062/ov62_02237D24.c index ebdeac638f..3a8ed0b385 100644 --- a/src/overlay062/ov62_02237D24.c +++ b/src/overlay062/ov62_02237D24.c @@ -1647,7 +1647,7 @@ static BOOL ov62_02239984 (UnkStruct_0208C06C * param0, int param1) PokedexData * v10 = SaveData_Pokedex(param0->unk_830); for (v7 = v3; v7 < v4; v7++) { - v9 = sub_02026FE8(v10, v1[v7]); + v9 = Pokedex_EncounteredSpecies(v10, v1[v7]); if (v9 == 0) { v1[v7] = 0xFFFF; @@ -1693,7 +1693,7 @@ static void ov62_02239A0C (UnkStruct_0208C06C * param0, int param1) v4->unk_1D4.unk_00 = 0; for (v5 = v2; v5 < v3; v5++) { - v7 = sub_02026FE8(v8, v0[v5]); + v7 = Pokedex_EncounteredSpecies(v8, v0[v5]); if (v7 == 0) { v0[v5] = 0xFFFF; diff --git a/src/overlay062/ov62_02241204.c b/src/overlay062/ov62_02241204.c index f4d7191e34..93266377b6 100644 --- a/src/overlay062/ov62_02241204.c +++ b/src/overlay062/ov62_02241204.c @@ -1522,7 +1522,7 @@ static BOOL ov62_02242748 (UnkStruct_0208C06C * param0, int param1) PokedexData * v10 = SaveData_Pokedex(param0->unk_830); for (v7 = v3; v7 < v4; v7++) { - v9 = sub_02026FE8(v10, v1[v7]); + v9 = Pokedex_EncounteredSpecies(v10, v1[v7]); if (v9 == 0) { v1[v7] = 0xFFFF; @@ -1568,7 +1568,7 @@ static void ov62_022427D0 (UnkStruct_0208C06C * param0, int param1) v4->unk_4C8.unk_00 = 0; for (v5 = v2; v5 < v3; v5++) { - v7 = sub_02026FE8(v8, v0[v5]); + v7 = Pokedex_EncounteredSpecies(v8, v0[v5]); if (v7 == 0) { v0[v5] = 0xFFFF; diff --git a/src/overlay065/ov65_0222DCE0.c b/src/overlay065/ov65_0222DCE0.c index 3298669303..5112a264c1 100644 --- a/src/overlay065/ov65_0222DCE0.c +++ b/src/overlay065/ov65_0222DCE0.c @@ -1823,7 +1823,7 @@ static void ov65_0222F4C4 (UnkStruct_ov65_0222EBE0 * param0, int param1) param0->unk_04->unk_00.unk_18 = TrainerInfo_GameCode(v0); param0->unk_04->unk_00.unk_19 = TrainerInfo_RegionCode(v0); - param0->unk_04->unk_00.unk_1A = sub_02027474(v1); + param0->unk_04->unk_00.unk_1A = Pokedex_NationalUnlocked(v1); param0->unk_04->unk_00.unk_1B = 29; ov65_02232E70(param0, param1); diff --git a/src/overlay066/ov66_0222DDF0.c b/src/overlay066/ov66_0222DDF0.c index c8125b96c0..c41d24a085 100644 --- a/src/overlay066/ov66_0222DDF0.c +++ b/src/overlay066/ov66_0222DDF0.c @@ -2360,7 +2360,7 @@ static void ov66_0222F7C8(UnkStruct_ov66_0222F6C4 *param0, SaveData *param1, u32 param0->unk_20.unk_3A = ov66_02230C0C(param0->unk_20.unk_3A); param0->unk_20.unk_3C = sub_0202C8C0(v2); param0->unk_20.unk_3E = sub_0202C8C4(v2); - param0->unk_20.unk_3F = sub_02027474(v3); + param0->unk_20.unk_3F = Pokedex_NationalUnlocked(v3); param0->unk_20.unk_40 = TrainerInfo_IsMainStoryCleared(v0); param0->unk_20.unk_41 = 0xff; param0->unk_20.unk_43 = 0; diff --git a/src/overlay094/ov94_022414B8.c b/src/overlay094/ov94_022414B8.c index d3bf16e626..fdbf782e8c 100644 --- a/src/overlay094/ov94_022414B8.c +++ b/src/overlay094/ov94_022414B8.c @@ -1141,12 +1141,12 @@ static int ov94_02242718(ResourceMetadata **param0, MessageLoader *param1, Messa for (v0 = 0; v0 < v3; v0++) { if (v4) { - if (sub_02026FE8(param7, param3[v1 + v0])) { + if (Pokedex_EncounteredSpecies(param7, param3[v1 + v0])) { v2++; } } else { if (param4[param3[v1 + v0]]) { - if (sub_02026FE8(param7, param3[v1 + v0])) { + if (Pokedex_EncounteredSpecies(param7, param3[v1 + v0])) { v2++; } } @@ -1157,12 +1157,12 @@ static int ov94_02242718(ResourceMetadata **param0, MessageLoader *param1, Messa for (v0 = 0; v0 < v3; v0++) { if (v4) { - if (sub_02026FE8(param7, param3[v1 + v0])) { + if (Pokedex_EncounteredSpecies(param7, param3[v1 + v0])) { sub_02013A4C(*param0, param1, param3[v1 + v0], param3[v1 + v0]); } } else { if (param4[param3[v1 + v0]]) { - if (sub_02026FE8(param7, param3[v1 + v0])) { + if (Pokedex_EncounteredSpecies(param7, param3[v1 + v0])) { sub_02013A4C(*param0, param1, param3[v1 + v0], param3[v1 + v0]); } } diff --git a/src/overlay097/ov97_0222AE60.c b/src/overlay097/ov97_0222AE60.c index e5154ef844..d216796b1b 100644 --- a/src/overlay097/ov97_0222AE60.c +++ b/src/overlay097/ov97_0222AE60.c @@ -244,7 +244,7 @@ static void ov97_0222AF1C(UnkStruct_0222AE60 *param0) sub_02017B70(v0); - if (sub_02027474(param0->unk_08) == 0) { + if (Pokedex_NationalUnlocked(param0->unk_08) == 0) { return; } diff --git a/src/pokedex_heightweight.c b/src/pokedex_heightweight.c index e72f0a8c64..9278659eb9 100644 --- a/src/pokedex_heightweight.c +++ b/src/pokedex_heightweight.c @@ -86,46 +86,46 @@ void Pokedex_HeightWeightData_Release(HeightWeightData *HWData) HWData->pokemonScale = NULL; } -int Pokedex_HeightWeightData_Height(const HeightWeightData *HWData, int dexNumber) +int Pokedex_HeightWeightData_Height(const HeightWeightData *HWData, int species) { GF_ASSERT(HWData); GF_ASSERT(HWData->height); - return HWData->height[dexNumber]; + return HWData->height[species]; } -int Pokedex_HeightWeightData_Weight(const HeightWeightData *HWData, int dexNumber) +int Pokedex_HeightWeightData_Weight(const HeightWeightData *HWData, int species) { GF_ASSERT(HWData); GF_ASSERT(HWData->weight); - return HWData->weight[dexNumber]; + return HWData->weight[species]; } -short Pokedex_HeightWeightData_TrainerPos(const HeightWeightData *HWData, int dexNumber) +short Pokedex_HeightWeightData_TrainerPos(const HeightWeightData *HWData, int species) { GF_ASSERT(HWData); GF_ASSERT(HWData->trainerPos); - return HWData->trainerPos[dexNumber]; + return HWData->trainerPos[species]; } -short Pokedex_HeightWeightData_PokemonPos(const HeightWeightData *HWData, int dexNumber) +short Pokedex_HeightWeightData_PokemonPos(const HeightWeightData *HWData, int species) { GF_ASSERT(HWData); GF_ASSERT(HWData->pokemonPos); - return HWData->pokemonPos[dexNumber]; + return HWData->pokemonPos[species]; } -short Pokedex_HeightWeightData_TrainerScale(const HeightWeightData *HWData, int dexNumber) +short Pokedex_HeightWeightData_TrainerScale(const HeightWeightData *HWData, int species) { GF_ASSERT(HWData); GF_ASSERT(HWData->trainerScale); - return HWData->trainerScale[dexNumber]; + return HWData->trainerScale[species]; } -short Pokedex_HeightWeightData_PokemonScale(const HeightWeightData *HWData, int dexNumber) +short Pokedex_HeightWeightData_PokemonScale(const HeightWeightData *HWData, int species) { GF_ASSERT(HWData); GF_ASSERT(HWData->pokemonScale); - return HWData->pokemonScale[dexNumber]; + return HWData->pokemonScale[species]; } static int *Pokedex_Height_Array(NARC *pokedexDataNARC, int param1) diff --git a/src/scrcmd.c b/src/scrcmd.c index 12bb22eecf..d51ee84e00 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -6489,7 +6489,7 @@ static BOOL ScrCmd_218(ScriptContext *ctx) *v1 = 25; for (v4 = 1, v5 = 0; v4 <= NATIONAL_DEX_COUNT; v4++) { - if ((sub_02026FE8(v0, v4) == 1) && (Pokemon_SinnohDexNumber(v4) != 0)) { + if ((Pokedex_EncounteredSpecies(v0, v4) == 1) && (Pokemon_SinnohDexNumber(v4) != 0)) { if (v5 == v3) { *v1 = v4; break; @@ -6585,7 +6585,7 @@ static BOOL ScrCmd_22B(ScriptContext *ctx) static BOOL ScrCmd_22C(ScriptContext *ctx) { - sub_020274B0(SaveData_Pokedex(ctx->fieldSystem->saveData)); + Pokedex_CanDetectForms_True(SaveData_Pokedex(ctx->fieldSystem->saveData)); return 0; } @@ -6600,7 +6600,7 @@ static BOOL ScrCmd_22D(ScriptContext *ctx) sub_02027454(SaveData_Pokedex(ctx->fieldSystem->saveData)); TrainerInfo_GiveNationalDex(SaveData_GetTrainerInfo(ctx->fieldSystem->saveData)); } else if (v0 == 2) { - *v1 = sub_02027474(SaveData_Pokedex(ctx->fieldSystem->saveData)); + *v1 = Pokedex_NationalUnlocked(SaveData_Pokedex(ctx->fieldSystem->saveData)); } else { GF_ASSERT(FALSE); } diff --git a/src/unk_0202631C.c b/src/unk_0202631C.c index 3ed47e0d67..348ad635fa 100644 --- a/src/unk_0202631C.c +++ b/src/unk_0202631C.c @@ -55,19 +55,19 @@ PokedexData *sub_02026324(u32 param0) return v0; } -void sub_02026338(const PokedexData *param0, PokedexData *param1) +void sub_02026338(const PokedexData *dexData, PokedexData *param1) { - MI_CpuCopy8(param0, param1, sizeof(PokedexData)); + MI_CpuCopy8(dexData, param1, sizeof(PokedexData)); } -static inline void CheckPokedexIntegrity(const PokedexData *param0) +static inline void CheckPokedexIntegrity(const PokedexData *dexData) { - GF_ASSERT(param0->magic == 3203386110); + GF_ASSERT(dexData->magic == 3203386110); } -static BOOL sub_02026344(u16 param0) +static BOOL Pokedex_InvalidSpecies(u16 species) { - if ((param0 == 0) || (param0 > NATIONAL_DEX_COUNT)) { + if ((species == 0) || (species > NATIONAL_DEX_COUNT)) { GF_ASSERT(0); return 1; } else { @@ -110,26 +110,26 @@ static inline void inline_020267B8(u8 *param0, u8 param1, u16 param2) param0[param2 >> 2] |= param1 << ((param2 & 3) * 2); } -static inline void inline_0202736C(PokedexData *param0, u16 param1) +static inline void Write_SeenSpecies(PokedexData *dexData, u16 species) { - WriteBit((u8 *)param0->seenPokemon, param1); + WriteBit((u8 *)dexData->seenPokemon, species); } -static inline void inline_sub_0202736C_1(PokedexData *param0, u16 param1) +static inline void Write_CaughtSpecies(PokedexData *dexData, u16 species) { - WriteBit((u8 *)param0->caughtPokemon, param1); + WriteBit((u8 *)dexData->caughtPokemon, species); } -static void sub_02026360(PokedexData *param0, u8 param1, u8 param2, u16 param3) +static void sub_02026360(PokedexData *dexData, u8 param1, u8 param2, u16 param3) { if (param2 == 0) { - inline_02026360((u8 *)param0->recordedGenders[1], param1, param3); + inline_02026360((u8 *)dexData->recordedGenders[1], param1, param3); } - inline_02026360((u8 *)param0->recordedGenders[param2], param1, param3); + inline_02026360((u8 *)dexData->recordedGenders[param2], param1, param3); } -static void sub_020263D8(PokedexData *param0, u8 param1, u8 param2, u16 param3) +static void sub_020263D8(PokedexData *dexData, u8 param1, u8 param2, u16 param3) { GF_ASSERT(param1 <= 2); @@ -137,37 +137,37 @@ static void sub_020263D8(PokedexData *param0, u8 param1, u8 param2, u16 param3) param1 = 0; } - sub_02026360(param0, param1, param2, param3); + sub_02026360(dexData, param1, param2, param3); } -static inline BOOL inline_02026FE8(const PokedexData *param0, u16 param1) +static inline BOOL Read_SeenSpecies(const PokedexData *dexData, u16 species) { - return ReadBit((const u8 *)param0->seenPokemon, param1); + return ReadBit((const u8 *)dexData->seenPokemon, species); } -static inline BOOL inline_02026F9C(const PokedexData *param0, u16 param1) +static inline BOOL Read_CaughtSpecies(const PokedexData *dexData, u16 species) { - return ReadBit((const u8 *)param0->caughtPokemon, param1); + return ReadBit((const u8 *)dexData->caughtPokemon, species); } -static inline u8 inline_02026BAC(const PokedexData *param0, u16 param1, u8 param2) +static inline u8 inline_02026BAC(const PokedexData *dexData, u16 param1, u8 param2) { - return ReadBit((const u8 *)param0->recordedGenders[param2], param1); + return ReadBit((const u8 *)dexData->recordedGenders[param2], param1); } -static inline void inline_0202736C_1(PokedexData *param0, u16 param1, u32 param2) +static inline void inline_0202736C_1(PokedexData *dexData, u16 param1, u32 param2) { if (param1 == 327) { - param0->unk_104 = param2; + dexData->unk_104 = param2; } } -static int sub_02026400(const PokedexData *param0) +static int sub_02026400(const PokedexData *dexData) { int v0; for (v0 = 0; v0 < UNOWN_COUNT; v0++) { - if (param0->unk_10C[v0] == 0xff) { + if (dexData->unk_10C[v0] == 0xff) { break; } } @@ -175,12 +175,12 @@ static int sub_02026400(const PokedexData *param0) return v0; } -static BOOL sub_02026418(const PokedexData *param0, u8 param1) +static BOOL sub_02026418(const PokedexData *dexData, u8 param1) { int v0; for (v0 = 0; v0 < UNOWN_COUNT; v0++) { - if (param0->unk_10C[v0] == param1) { + if (dexData->unk_10C[v0] == param1) { return 1; } } @@ -188,22 +188,22 @@ static BOOL sub_02026418(const PokedexData *param0, u8 param1) return 0; } -static void sub_0202643C(PokedexData *param0, int param1) +static void sub_0202643C(PokedexData *dexData, int param1) { int v0; - if (sub_02026418(param0, param1)) { + if (sub_02026418(dexData, param1)) { return; } - v0 = sub_02026400(param0); + v0 = sub_02026400(dexData); if (v0 < UNOWN_COUNT) { - param0->unk_10C[v0] = param1; + dexData->unk_10C[v0] = param1; } } -static int sub_02026464(const PokedexData *param0, u32 param1) +static int sub_02026464(const PokedexData *dexData, u32 param1) { u32 v0; u32 v1; @@ -211,22 +211,22 @@ static int sub_02026464(const PokedexData *param0, u32 param1) GF_ASSERT((param1 == 422) || (param1 == 423) || (param1 == 492) || (param1 == 487)); - if (sub_02026FE8(param0, param1) == 0) { + if (Pokedex_EncounteredSpecies(dexData, param1) == 0) { return 0; } switch (param1) { case 422: - v2 = ¶m0->unk_108; + v2 = &dexData->unk_108; break; case 423: - v2 = ¶m0->unk_109; + v2 = &dexData->unk_109; break; case 492: - v2 = ¶m0->unk_320; + v2 = &dexData->unk_320; break; case 487: - v2 = ¶m0->unk_321; + v2 = &dexData->unk_321; break; } @@ -240,7 +240,7 @@ static int sub_02026464(const PokedexData *param0, u32 param1) return 2; } -static BOOL sub_02026514(const PokedexData *param0, u32 param1, u8 param2) +static BOOL sub_02026514(const PokedexData *dexData, u32 param1, u8 param2) { u32 v0; u32 v1; @@ -249,26 +249,26 @@ static BOOL sub_02026514(const PokedexData *param0, u32 param1, u8 param2) GF_ASSERT((param1 == 422) || (param1 == 423) || (param1 == 492) || (param1 == 487)); - if (sub_02026FE8(param0, param1) == 0) { + if (Pokedex_EncounteredSpecies(dexData, param1) == 0) { return 0; } switch (param1) { case 422: - v3 = ¶m0->unk_108; + v3 = &dexData->unk_108; break; case 423: - v3 = ¶m0->unk_109; + v3 = &dexData->unk_109; break; case 492: - v3 = ¶m0->unk_320; + v3 = &dexData->unk_320; break; case 487: - v3 = ¶m0->unk_321; + v3 = &dexData->unk_321; break; } - v2 = sub_02026464(param0, param1); + v2 = sub_02026464(dexData, param1); for (v1 = 0; v1 < v2; v1++) { v0 = ReadBit(v3, v1 + 1); @@ -281,33 +281,33 @@ static BOOL sub_02026514(const PokedexData *param0, u32 param1, u8 param2) return 0; } -static void sub_020265E8(PokedexData *param0, u32 param1, int param2) +static void sub_020265E8(PokedexData *dexData, u32 param1, int param2) { int v0; u8 *v1; GF_ASSERT((param1 == 422) || (param1 == 423) || (param1 == 492) || (param1 == 487)); - if (sub_02026514(param0, param1, param2)) { + if (sub_02026514(dexData, param1, param2)) { return; } switch (param1) { case 422: - v1 = ¶m0->unk_108; + v1 = &dexData->unk_108; break; case 423: - v1 = ¶m0->unk_109; + v1 = &dexData->unk_109; break; case 492: - v1 = ¶m0->unk_320; + v1 = &dexData->unk_320; break; case 487: - v1 = ¶m0->unk_321; + v1 = &dexData->unk_321; break; } - v0 = sub_02026464(param0, param1); + v0 = sub_02026464(dexData, param1); if (v0 < 2) { inline_02026360(v1, param2, v0 + 1); @@ -318,7 +318,7 @@ static void sub_020265E8(PokedexData *param0, u32 param1, int param2) } } -static int sub_020266F8(const PokedexData *param0, u32 param1) +static int sub_020266F8(const PokedexData *dexData, u32 param1) { u32 v0; int v1; @@ -326,14 +326,14 @@ static int sub_020266F8(const PokedexData *param0, u32 param1) GF_ASSERT((param1 == 412) || (param1 == 413)); - if (sub_02026FE8(param0, param1) == 0) { + if (Pokedex_EncounteredSpecies(dexData, param1) == 0) { return 0; } if (param1 == 412) { - v2 = ¶m0->unk_10A; + v2 = &dexData->unk_10A; } else { - v2 = ¶m0->unk_10B; + v2 = &dexData->unk_10B; } for (v1 = 0; v1 < 3; v1++) { @@ -347,7 +347,7 @@ static int sub_020266F8(const PokedexData *param0, u32 param1) return v1; } -static BOOL sub_02026754(const PokedexData *param0, u32 param1, u8 param2) +static BOOL sub_02026754(const PokedexData *dexData, u32 param1, u8 param2) { u32 v0; int v1; @@ -355,14 +355,14 @@ static BOOL sub_02026754(const PokedexData *param0, u32 param1, u8 param2) GF_ASSERT((param1 == 412) || (param1 == 413)); - if (sub_02026FE8(param0, param1) == 0) { + if (Pokedex_EncounteredSpecies(dexData, param1) == 0) { return 0; } if (param1 == 412) { - v2 = ¶m0->unk_10A; + v2 = &dexData->unk_10A; } else { - v2 = ¶m0->unk_10B; + v2 = &dexData->unk_10B; } for (v1 = 0; v1 < 3; v1++) { @@ -376,24 +376,24 @@ static BOOL sub_02026754(const PokedexData *param0, u32 param1, u8 param2) return 0; } -static void sub_020267B8(PokedexData *param0, u32 param1, int param2) +static void sub_020267B8(PokedexData *dexData, u32 param1, int param2) { int v0; u8 *v1; GF_ASSERT((param1 == 412) || (param1 == 413)); - if (sub_02026754(param0, param1, param2)) { + if (sub_02026754(dexData, param1, param2)) { return; } if (param1 == 412) { - v1 = ¶m0->unk_10A; + v1 = &dexData->unk_10A; } else { - v1 = ¶m0->unk_10B; + v1 = &dexData->unk_10B; } - v0 = sub_020266F8(param0, param1); + v0 = sub_020266F8(dexData, param1); if (v0 < 3) { inline_020267B8(v1, param2, v0); @@ -409,15 +409,15 @@ static void sub_02026834(u32 *param0, u8 param1, u8 param2) param0[16 - 1] |= (param1 << v0); } -static void sub_02026850(PokedexData *param0, u8 param1, u8 param2) +static void sub_02026850(PokedexData *dexData, u8 param1, u8 param2) { GF_ASSERT(param2 < 4); GF_ASSERT(param1 <= 15); if (param2 < 2) { - sub_02026834(param0->caughtPokemon, param1, param2); + sub_02026834(dexData->caughtPokemon, param1, param2); } else { - sub_02026834(param0->seenPokemon, param1, param2 - 2); + sub_02026834(dexData->seenPokemon, param1, param2 - 2); } } @@ -429,25 +429,25 @@ static inline u32 inline_0202688C(const u32 *param0, u8 param1) return v1; } -static u32 sub_0202688C(const PokedexData *param0, u8 param1) +static u32 sub_0202688C(const PokedexData *dexData, u8 param1) { u32 v0; if (param1 < 2) { - v0 = inline_0202688C(param0->caughtPokemon, param1); + v0 = inline_0202688C(dexData->caughtPokemon, param1); } else { - v0 = inline_0202688C(param0->seenPokemon, param1 - 2); + v0 = inline_0202688C(dexData->seenPokemon, param1 - 2); } return v0; } -static u32 sub_020268B8(const PokedexData *param0) +static u32 sub_020268B8(const PokedexData *dexData) { int v0; for (v0 = 0; v0 < 4; v0++) { - if (sub_0202688C(param0, v0) == 15) { + if (sub_0202688C(dexData, v0) == 15) { break; } } @@ -455,12 +455,12 @@ static u32 sub_020268B8(const PokedexData *param0) return v0; } -static BOOL sub_020268D8(const PokedexData *param0, u32 param1) +static BOOL sub_020268D8(const PokedexData *dexData, u32 param1) { int v0; for (v0 = 0; v0 < 4; v0++) { - if (sub_0202688C(param0, v0) == param1) { + if (sub_0202688C(dexData, v0) == param1) { return 1; } } @@ -468,25 +468,25 @@ static BOOL sub_020268D8(const PokedexData *param0, u32 param1) return 0; } -static void sub_020268FC(PokedexData *param0, u16 param1, Pokemon *param2) +static void sub_020268FC(PokedexData *dexData, u16 param1, Pokemon *param2) { u8 v0 = Pokemon_GetValue(param2, MON_DATA_FORM, NULL); u32 v1; if (param1 == 386) { - if (sub_020268D8(param0, v0) == 0) { - v1 = sub_020268B8(param0); - sub_02026850(param0, v0, v1); + if (sub_020268D8(dexData, v0) == 0) { + v1 = sub_020268B8(dexData); + sub_02026850(dexData, v0, v1); } } } -static void sub_0202693C(PokedexData *param0) +static void sub_0202693C(PokedexData *dexData) { int v0; for (v0 = 0; v0 < 4; v0++) { - sub_02026850(param0, 0xf, v0); + sub_02026850(dexData, 0xf, v0); } } @@ -503,21 +503,21 @@ static inline void inline_02026A00(u32 *param0, u32 param1, u32 param2) (*param0) |= (param2 << (param1 * 3)); } -static int sub_02026958(const PokedexData *param0, u32 param1) +static int sub_02026958(const PokedexData *dexData, u32 param1) { u32 v0; int v1, v2; GF_ASSERT(param1 == 479); - if (sub_02026FE8(param0, param1) == 0) { + if (Pokedex_EncounteredSpecies(dexData, param1) == 0) { return 0; } v2 = 0; for (v1 = 0; v1 < 6; v1++) { - v0 = inline_02026958(param0->unk_31C, v1); + v0 = inline_02026958(dexData->unk_31C, v1); if (v0 != 0x7) { v2++; @@ -529,7 +529,7 @@ static int sub_02026958(const PokedexData *param0, u32 param1) return v2; } -static BOOL sub_020269A4(const PokedexData *param0, u32 param1, u8 param2) +static BOOL sub_020269A4(const PokedexData *dexData, u32 param1, u8 param2) { int v0; u32 v1; @@ -537,14 +537,14 @@ static BOOL sub_020269A4(const PokedexData *param0, u32 param1, u8 param2) GF_ASSERT(param1 == 479); - if (sub_02026FE8(param0, param1) == 0) { + if (Pokedex_EncounteredSpecies(dexData, param1) == 0) { return 0; } - v1 = sub_02026958(param0, param1); + v1 = sub_02026958(dexData, param1); for (v0 = 0; v0 < v1; v0++) { - v2 = inline_02026958(param0->unk_31C, v0); + v2 = inline_02026958(dexData->unk_31C, v0); if (v2 == param2) { return 1; @@ -554,69 +554,69 @@ static BOOL sub_020269A4(const PokedexData *param0, u32 param1, u8 param2) return 0; } -static void sub_02026A00(PokedexData *param0, u32 param1, int param2) +static void sub_02026A00(PokedexData *dexData, u32 param1, int param2) { int v0; GF_ASSERT(param1 == 479); - if (sub_020269A4(param0, param1, param2)) { + if (sub_020269A4(dexData, param1, param2)) { return; } - v0 = sub_02026958(param0, param1); + v0 = sub_02026958(dexData, param1); if (v0 < 6) { - inline_02026A00(¶m0->unk_31C, v0, param2); + inline_02026A00(&dexData->unk_31C, v0, param2); } } -static void sub_02026A60(PokedexData *param0, u16 param1, Pokemon *param2) +static void sub_02026A60(PokedexData *dexData, u16 param1, Pokemon *param2) { int v0; switch (param1) { case 201: v0 = Pokemon_GetForm(param2); - sub_0202643C(param0, v0); + sub_0202643C(dexData, v0); break; case 412: v0 = Pokemon_GetValue(param2, MON_DATA_FORM, NULL); - sub_020267B8(param0, param1, v0); + sub_020267B8(dexData, param1, v0); break; case 413: v0 = Pokemon_GetValue(param2, MON_DATA_FORM, NULL); - sub_020267B8(param0, param1, v0); + sub_020267B8(dexData, param1, v0); break; case 422: v0 = Pokemon_GetValue(param2, MON_DATA_FORM, NULL); - sub_020265E8(param0, param1, v0); + sub_020265E8(dexData, param1, v0); break; case 423: v0 = Pokemon_GetValue(param2, MON_DATA_FORM, NULL); - sub_020265E8(param0, param1, v0); + sub_020265E8(dexData, param1, v0); break; case 386: - sub_020268FC(param0, param1, param2); + sub_020268FC(dexData, param1, param2); break; case 492: v0 = Pokemon_GetValue(param2, MON_DATA_FORM, NULL); - sub_020265E8(param0, param1, v0); + sub_020265E8(dexData, param1, v0); break; case 487: v0 = Pokemon_GetValue(param2, MON_DATA_FORM, NULL); - sub_020265E8(param0, param1, v0); + sub_020265E8(dexData, param1, v0); break; case 479: v0 = Pokemon_GetValue(param2, MON_DATA_FORM, NULL); - sub_02026A00(param0, param1, v0); + sub_02026A00(dexData, param1, v0); break; default: break; } } -static void sub_02026B88(PokedexData *param0, u16 param1, u32 param2) +static void sub_02026B88(PokedexData *dexData, u16 param1, u32 param2) { int v0; int v1; @@ -628,10 +628,10 @@ static void sub_02026B88(PokedexData *param0, u16 param1, u32 param2) return; } - param0->recordedLanguages[v0] |= 1 << v1; + dexData->recordedLanguages[v0] |= 1 << v1; } -static u32 sub_02026BAC(const PokedexData *param0, u16 param1, int param2) +static u32 sub_02026BAC(const PokedexData *dexData, u16 param1, int param2) { u32 v0, v1; u32 v2; @@ -644,10 +644,10 @@ static u32 sub_02026BAC(const PokedexData *param0, u16 param1, int param2) } } - v0 = inline_02026BAC(param0, param1, 0); + v0 = inline_02026BAC(dexData, param1, 0); if (param2 == 1) { - v1 = inline_02026BAC(param0, param1, 1); + v1 = inline_02026BAC(dexData, param1, 1); if (v1 == v0) { v2 = -1; @@ -661,12 +661,12 @@ static u32 sub_02026BAC(const PokedexData *param0, u16 param1, int param2) return v2; } -static inline int inline_020270AC(const PokedexData *param0, int param1) +static inline int inline_020270AC(const PokedexData *dexData, int param1) { - return param0->unk_10C[param1]; + return dexData->unk_10C[param1]; } -static int sub_02026C24(const PokedexData *param0, u32 param1, int param2) +static int sub_02026C24(const PokedexData *dexData, u32 param1, int param2) { const u8 *v0; @@ -675,31 +675,31 @@ static int sub_02026C24(const PokedexData *param0, u32 param1, int param2) switch (param1) { case 422: - v0 = ¶m0->unk_108; + v0 = &dexData->unk_108; break; case 423: - v0 = ¶m0->unk_109; + v0 = &dexData->unk_109; break; case 492: - v0 = ¶m0->unk_320; + v0 = &dexData->unk_320; break; case 487: - v0 = ¶m0->unk_321; + v0 = &dexData->unk_321; break; } return ReadBit(v0, param2 + 1); } -static int sub_02026CCC(const PokedexData *param0, u32 param1, int param2) +static int sub_02026CCC(const PokedexData *dexData, u32 param1, int param2) { GF_ASSERT(param1 == 479); GF_ASSERT(param2 < 6); - return inline_02026958(param0->unk_31C, param2); + return inline_02026958(dexData->unk_31C, param2); } -static int sub_02026CFC(const PokedexData *param0, u32 param1, int param2) +static int sub_02026CFC(const PokedexData *dexData, u32 param1, int param2) { const u8 *v0; @@ -707,9 +707,9 @@ static int sub_02026CFC(const PokedexData *param0, u32 param1, int param2) GF_ASSERT(param2 < 3); if (param1 == 412) { - v0 = ¶m0->unk_10A; + v0 = &dexData->unk_10A; } else { - v0 = ¶m0->unk_10B; + v0 = &dexData->unk_10B; } return inline_020266F8(v0, param2); @@ -749,36 +749,36 @@ static BOOL sub_02026D68(u16 param0) return 1; } -void Pokedex_Init(PokedexData *param0) +void Pokedex_Init(PokedexData *dexData) { - memset(param0, 0, sizeof(PokedexData)); + memset(dexData, 0, sizeof(PokedexData)); - param0->magic = 3203386110; - param0->nationalDexObtained = FALSE; + dexData->magic = 3203386110; + dexData->nationalDexObtained = FALSE; - memset(param0->unk_10C, 0xff, sizeof(u8) * UNOWN_COUNT); + memset(dexData->unk_10C, 0xff, sizeof(u8) * UNOWN_COUNT); - param0->unk_108 = 0xff; - param0->unk_109 = 0xff; - param0->unk_10A = 0xff; - param0->unk_10B = 0xff; - param0->unk_31C = 0xffffffff; - param0->unk_320 = 0xff; - param0->unk_321 = 0xff; + dexData->unk_108 = 0xff; + dexData->unk_109 = 0xff; + dexData->unk_10A = 0xff; + dexData->unk_10B = 0xff; + dexData->unk_31C = 0xffffffff; + dexData->unk_320 = 0xff; + dexData->unk_321 = 0xff; - sub_0202693C(param0); + sub_0202693C(dexData); } -u16 sub_02026DD0(const PokedexData *param0) +u16 sub_02026DD0(const PokedexData *dexData) { int v0; int v1; - CheckPokedexIntegrity(param0); + CheckPokedexIntegrity(dexData); v1 = 0; for (v0 = 1; v0 <= NATIONAL_DEX_COUNT; v0++) { - if (Pokedex_CaughtSpecies(param0, v0) == 1) { + if (Pokedex_CaughtSpecies(dexData, v0) == 1) { v1++; } } @@ -786,16 +786,16 @@ u16 sub_02026DD0(const PokedexData *param0) return v1; } -u16 sub_02026E0C(const PokedexData *param0) +u16 sub_02026E0C(const PokedexData *dexData) { int v0; int v1; - CheckPokedexIntegrity(param0); + CheckPokedexIntegrity(dexData); v1 = 0; for (v0 = 1; v0 <= NATIONAL_DEX_COUNT; v0++) { - if (sub_02026FE8(param0, v0) == 1) { + if (Pokedex_EncounteredSpecies(dexData, v0) == 1) { v1++; } } @@ -803,25 +803,25 @@ u16 sub_02026E0C(const PokedexData *param0) return v1; } -u16 sub_02026E48(const PokedexData *param0) +u16 sub_02026E48(const PokedexData *dexData) { - if (sub_02027474(param0)) { - return sub_02026E0C(param0); + if (Pokedex_NationalUnlocked(dexData)) { + return sub_02026E0C(dexData); } - return sub_02026EAC(param0); + return sub_02026EAC(dexData); } -u16 sub_02026E64(const PokedexData *param0) +u16 sub_02026E64(const PokedexData *dexData) { int v0; int v1; - CheckPokedexIntegrity(param0); + CheckPokedexIntegrity(dexData); v1 = 0; for (v0 = 1; v0 <= NATIONAL_DEX_COUNT; v0++) { - if (Pokedex_CaughtSpecies(param0, v0) == 1) { + if (Pokedex_CaughtSpecies(dexData, v0) == 1) { if (Pokemon_SinnohDexNumber(v0) != 0) { v1++; } @@ -831,16 +831,16 @@ u16 sub_02026E64(const PokedexData *param0) return v1; } -u16 sub_02026EAC(const PokedexData *param0) +u16 sub_02026EAC(const PokedexData *dexData) { int v0; int v1; - CheckPokedexIntegrity(param0); + CheckPokedexIntegrity(dexData); v1 = 0; for (v0 = 1; v0 <= NATIONAL_DEX_COUNT; v0++) { - if (sub_02026FE8(param0, v0) == 1) { + if (Pokedex_EncounteredSpecies(dexData, v0) == 1) { if (Pokemon_SinnohDexNumber(v0) != 0) { v1++; } @@ -850,11 +850,11 @@ u16 sub_02026EAC(const PokedexData *param0) return v1; } -BOOL sub_02026EF4(const PokedexData *param0) +BOOL sub_02026EF4(const PokedexData *dexData) { u16 v0; - v0 = sub_02026F20(param0); + v0 = sub_02026F20(dexData); if (v0 >= 482) { return 1; @@ -863,11 +863,11 @@ BOOL sub_02026EF4(const PokedexData *param0) return 0; } -BOOL sub_02026F0C(const PokedexData *param0) +BOOL sub_02026F0C(const PokedexData *dexData) { u16 v0; - v0 = sub_02026F58(param0); + v0 = sub_02026F58(dexData); if (v0 >= LOCAL_DEX_COUNT) { return 1; @@ -876,7 +876,7 @@ BOOL sub_02026F0C(const PokedexData *param0) return 0; } -u16 sub_02026F20(const PokedexData *param0) +u16 sub_02026F20(const PokedexData *dexData) { int v0; u16 v1; @@ -884,7 +884,7 @@ u16 sub_02026F20(const PokedexData *param0) v1 = 0; for (v0 = 1; v0 <= NATIONAL_DEX_COUNT; v0++) { - if (Pokedex_CaughtSpecies(param0, v0) == 1) { + if (Pokedex_CaughtSpecies(dexData, v0) == 1) { if (sub_02026D44(v0) == 1) { v1++; } @@ -894,7 +894,7 @@ u16 sub_02026F20(const PokedexData *param0) return v1; } -u16 sub_02026F58(const PokedexData *param0) +u16 sub_02026F58(const PokedexData *dexData) { int v0; u16 v1; @@ -903,7 +903,7 @@ u16 sub_02026F58(const PokedexData *param0) v1 = 0; for (v0 = 1; v0 <= NATIONAL_DEX_COUNT; v0++) { - if (sub_02026FE8(param0, v0) == 1) { + if (Pokedex_EncounteredSpecies(dexData, v0) == 1) { v2 = Pokemon_SinnohDexNumber(v0); if (v2 != 0) { @@ -917,41 +917,41 @@ u16 sub_02026F58(const PokedexData *param0) return v1; } -BOOL Pokedex_CaughtSpecies(const PokedexData *param0, u16 param1) +BOOL Pokedex_CaughtSpecies(const PokedexData *dexData, u16 species) { - CheckPokedexIntegrity(param0); + CheckPokedexIntegrity(dexData); - if (sub_02026344(param1)) { + if (Pokedex_InvalidSpecies(species)) { return 0; } - if (inline_02026F9C(param0, param1) && inline_02026FE8(param0, param1)) { + if (Read_CaughtSpecies(dexData, species) && Read_SeenSpecies(dexData, species)) { return 1; } else { return 0; } } -BOOL sub_02026FE8(const PokedexData *param0, u16 param1) +BOOL Pokedex_EncounteredSpecies(const PokedexData *dexData, u16 species) { - CheckPokedexIntegrity(param0); + CheckPokedexIntegrity(dexData); - if (sub_02026344(param1)) { + if (Pokedex_InvalidSpecies(species)) { return 0; } - return inline_02026FE8(param0, param1); + return Read_SeenSpecies(dexData, species); } -u32 sub_0202702C(const PokedexData *param0, u8 param1) +u32 sub_0202702C(const PokedexData *dexData, u8 param1) { u32 v0; - CheckPokedexIntegrity(param0); + CheckPokedexIntegrity(dexData); switch (param1) { case 0: - v0 = param0->unk_104; + v0 = dexData->unk_104; break; default: GF_ASSERT(0); @@ -961,236 +961,236 @@ u32 sub_0202702C(const PokedexData *param0, u8 param1) return v0; } -u32 sub_02027058(const PokedexData *param0, u16 param1, int param2) +u32 sub_02027058(const PokedexData *dexData, u16 species, int param2) { - CheckPokedexIntegrity(param0); + CheckPokedexIntegrity(dexData); - if (sub_02026344(param1)) { + if (Pokedex_InvalidSpecies(species)) { return -1; } - if (!inline_02026FE8(param0, param1)) { + if (!Read_SeenSpecies(dexData, species)) { return -1; } - return sub_02026BAC(param0, param1, param2); + return sub_02026BAC(dexData, species, param2); } -u32 sub_020270AC(const PokedexData *param0, int param1) +u32 sub_020270AC(const PokedexData *dexData, int param1) { - CheckPokedexIntegrity(param0); + CheckPokedexIntegrity(dexData); - if (sub_02026400(param0) <= param1) { + if (sub_02026400(dexData) <= param1) { return -1; } - return inline_020270AC(param0, param1); + return inline_020270AC(dexData, param1); } -u32 sub_020270DC(const PokedexData *param0) +u32 sub_020270DC(const PokedexData *dexData) { - CheckPokedexIntegrity(param0); - return sub_02026400(param0); + CheckPokedexIntegrity(dexData); + return sub_02026400(dexData); } -u32 sub_020270F8(const PokedexData *param0, int param1) +u32 sub_020270F8(const PokedexData *dexData, int param1) { - CheckPokedexIntegrity(param0); + CheckPokedexIntegrity(dexData); - if (sub_02026464(param0, 422) <= param1) { + if (sub_02026464(dexData, 422) <= param1) { return -1; } - return sub_02026C24(param0, 422, param1); + return sub_02026C24(dexData, 422, param1); } -u32 sub_02027130(const PokedexData *param0) +u32 sub_02027130(const PokedexData *dexData) { - CheckPokedexIntegrity(param0); - return sub_02026464(param0, 422); + CheckPokedexIntegrity(dexData); + return sub_02026464(dexData, 422); } -u32 sub_02027154(const PokedexData *param0, int param1) +u32 sub_02027154(const PokedexData *dexData, int param1) { - CheckPokedexIntegrity(param0); + CheckPokedexIntegrity(dexData); - if (sub_02026464(param0, 423) <= param1) { + if (sub_02026464(dexData, 423) <= param1) { return -1; } - return sub_02026C24(param0, 423, param1); + return sub_02026C24(dexData, 423, param1); } -u32 sub_0202718C(const PokedexData *param0) +u32 sub_0202718C(const PokedexData *dexData) { - CheckPokedexIntegrity(param0); - return sub_02026464(param0, 423); + CheckPokedexIntegrity(dexData); + return sub_02026464(dexData, 423); } -u32 sub_020271B0(const PokedexData *param0, int param1) +u32 sub_020271B0(const PokedexData *dexData, int param1) { - CheckPokedexIntegrity(param0); + CheckPokedexIntegrity(dexData); - if (sub_020266F8(param0, 412) <= param1) { + if (sub_020266F8(dexData, 412) <= param1) { return -1; } - return sub_02026CFC(param0, 412, param1); + return sub_02026CFC(dexData, 412, param1); } -u32 sub_020271E8(const PokedexData *param0) +u32 sub_020271E8(const PokedexData *dexData) { - CheckPokedexIntegrity(param0); - return sub_020266F8(param0, 412); + CheckPokedexIntegrity(dexData); + return sub_020266F8(dexData, 412); } -u32 sub_02027208(const PokedexData *param0, int param1) +u32 sub_02027208(const PokedexData *dexData, int param1) { - CheckPokedexIntegrity(param0); + CheckPokedexIntegrity(dexData); - if (sub_020266F8(param0, 413) <= param1) { + if (sub_020266F8(dexData, 413) <= param1) { return -1; } - return sub_02026CFC(param0, 413, param1); + return sub_02026CFC(dexData, 413, param1); } -u32 sub_02027240(const PokedexData *param0) +u32 sub_02027240(const PokedexData *dexData) { - CheckPokedexIntegrity(param0); - return sub_020266F8(param0, 413); + CheckPokedexIntegrity(dexData); + return sub_020266F8(dexData, 413); } -u32 sub_02027264(const PokedexData *param0, int param1) +u32 sub_02027264(const PokedexData *dexData, int param1) { - CheckPokedexIntegrity(param0); - return sub_0202688C(param0, param1); + CheckPokedexIntegrity(dexData); + return sub_0202688C(dexData, param1); } -u32 sub_02027288(const PokedexData *param0) +u32 sub_02027288(const PokedexData *dexData) { - CheckPokedexIntegrity(param0); - return sub_020268B8(param0); + CheckPokedexIntegrity(dexData); + return sub_020268B8(dexData); } -void sub_020272A4(PokedexData *param0, Pokemon *pokemon) +void sub_020272A4(PokedexData *dexData, Pokemon *pokemon) { - u16 v0 = Pokemon_GetValue(pokemon, MON_DATA_SPECIES, NULL); + u16 species = Pokemon_GetValue(pokemon, MON_DATA_SPECIES, NULL); u32 v1 = Pokemon_GetValue(pokemon, MON_DATA_PERSONALITY, NULL); u32 v2 = Pokemon_GetGender(pokemon); u32 v3; - CheckPokedexIntegrity(param0); + CheckPokedexIntegrity(dexData); - if (sub_02026344(v0)) { + if (Pokedex_InvalidSpecies(species)) { return; } - if (!inline_02026FE8(param0, v0)) { - inline_0202736C_1(param0, v0, v1); - sub_020263D8(param0, v2, 0, v0); + if (!Read_SeenSpecies(dexData, species)) { + inline_0202736C_1(dexData, species, v1); + sub_020263D8(dexData, v2, 0, species); } else { - v3 = inline_02026BAC(param0, v0, 0); + v3 = inline_02026BAC(dexData, species, 0); if (v3 != v2) { - sub_020263D8(param0, v2, 1, v0); + sub_020263D8(dexData, v2, 1, species); } } - sub_02026A60(param0, v0, pokemon); - inline_0202736C(param0, v0); + sub_02026A60(dexData, species, pokemon); + Write_SeenSpecies(dexData, species); } -void sub_0202736C(PokedexData *param0, Pokemon *param1) +void sub_0202736C(PokedexData *dexData, Pokemon *param1) { - u16 v0 = Pokemon_GetValue(param1, MON_DATA_SPECIES, NULL); + u16 species = Pokemon_GetValue(param1, MON_DATA_SPECIES, NULL); u32 v1 = Pokemon_GetValue(param1, MON_DATA_LANGUAGE, NULL); u32 v2 = Pokemon_GetValue(param1, MON_DATA_PERSONALITY, NULL); u32 v3 = Pokemon_GetGender(param1); u32 v4; - CheckPokedexIntegrity(param0); + CheckPokedexIntegrity(dexData); - if (sub_02026344(v0)) { + if (Pokedex_InvalidSpecies(species)) { return; } - if (!inline_02026FE8(param0, v0)) { - inline_0202736C_1(param0, v0, v2); - sub_020263D8(param0, v3, 0, v0); + if (!Read_SeenSpecies(dexData, species)) { + inline_0202736C_1(dexData, species, v2); + sub_020263D8(dexData, v3, 0, species); } else { - v4 = inline_02026BAC(param0, v0, 0); + v4 = inline_02026BAC(dexData, species, 0); if (v4 != v3) { - sub_020263D8(param0, v3, 1, v0); + sub_020263D8(dexData, v3, 1, species); } } - sub_02026A60(param0, v0, param1); - sub_02026B88(param0, v0, v1); + sub_02026A60(dexData, species, param1); + sub_02026B88(dexData, species, v1); - inline_sub_0202736C_1(param0, v0); - inline_0202736C(param0, v0); + Write_CaughtSpecies(dexData, species); + Write_SeenSpecies(dexData, species); } -void sub_02027454(PokedexData *param0) +void sub_02027454(PokedexData *dexData) { - CheckPokedexIntegrity(param0); - param0->nationalDexObtained = 1; + CheckPokedexIntegrity(dexData); + dexData->nationalDexObtained = 1; } -BOOL sub_02027474(const PokedexData *param0) +BOOL Pokedex_NationalUnlocked(const PokedexData *dexData) { - CheckPokedexIntegrity(param0); - return param0->nationalDexObtained; + CheckPokedexIntegrity(dexData); + return dexData->nationalDexObtained; } -BOOL sub_02027494(const PokedexData *param0) +BOOL Pokedex_CanDetectForms(const PokedexData *dexData) { - CheckPokedexIntegrity(param0); - return param0->canDetectForms; + CheckPokedexIntegrity(dexData); + return dexData->canDetectForms; } -void sub_020274B0(PokedexData *param0) +void Pokedex_CanDetectForms_True(PokedexData *dexData) { - CheckPokedexIntegrity(param0); - param0->canDetectForms = 1; + CheckPokedexIntegrity(dexData); + dexData->canDetectForms = 1; } -BOOL sub_020274D0(const PokedexData *param0, u16 param1, u32 param2) +BOOL sub_020274D0(const PokedexData *dexData, u16 species, u32 param2) { - int v0; + int speciesInt; GF_ASSERT(param2 < 8); - CheckPokedexIntegrity(param0); + CheckPokedexIntegrity(dexData); - v0 = param1; + speciesInt = species; param2 = sub_020986CC(param2); - return param0->recordedLanguages[v0] & (1 << param2); + return dexData->recordedLanguages[speciesInt] & (1 << param2); } -void sub_02027508(PokedexData *param0) +void sub_02027508(PokedexData *dexData) { - param0->unk_319 = 1; + dexData->unk_319 = 1; } -BOOL sub_02027514(const PokedexData *param0) +BOOL sub_02027514(const PokedexData *dexData) { - return param0->unk_319; + return dexData->unk_319; } -BOOL sub_02027520(const PokedexData *param0) +BOOL sub_02027520(const PokedexData *dexData) { - CheckPokedexIntegrity(param0); - return param0->pokedexObtained; + CheckPokedexIntegrity(dexData); + return dexData->pokedexObtained; } -void sub_02027540(PokedexData *param0) +void sub_02027540(PokedexData *dexData) { - CheckPokedexIntegrity(param0); - param0->pokedexObtained = 1; + CheckPokedexIntegrity(dexData); + dexData->pokedexObtained = 1; } PokedexData *SaveData_Pokedex(SaveData *param0) @@ -1201,54 +1201,54 @@ PokedexData *SaveData_Pokedex(SaveData *param0) return v0; } -u32 sub_0202756C(const PokedexData *param0, int param1, int param2) +u32 sub_0202756C(const PokedexData *dexData, int species, int param2) { - CheckPokedexIntegrity(param0); + CheckPokedexIntegrity(dexData); - switch (param1) { - case 201: - if (param2 < sub_020270DC(param0)) { - return sub_020270AC(param0, param2); + switch (species) { + case SPECIES_UNOWN: + if (param2 < sub_020270DC(dexData)) { + return sub_020270AC(dexData, param2); } break; - case 422: - if (param2 < sub_02027130(param0)) { - return sub_020270F8(param0, param2); + case SPECIES_SHELLOS: + if (param2 < sub_02027130(dexData)) { + return sub_020270F8(dexData, param2); } break; - case 423: - if (param2 < sub_0202718C(param0)) { - return sub_02027154(param0, param2); + case SPECIES_GASTRODON: + if (param2 < sub_0202718C(dexData)) { + return sub_02027154(dexData, param2); } break; - case 412: - if (param2 < sub_020271E8(param0)) { - return sub_020271B0(param0, param2); + case SPECIES_BURMY: + if (param2 < sub_020271E8(dexData)) { + return sub_020271B0(dexData, param2); } break; - case 413: - if (param2 < sub_02027240(param0)) { - return sub_02027208(param0, param2); + case SPECIES_WORMADAM: + if (param2 < sub_02027240(dexData)) { + return sub_02027208(dexData, param2); } break; - case 386: - if (param2 < sub_02027288(param0)) { - return sub_02027264(param0, param2); + case SPECIES_DEOXYS: + if (param2 < sub_02027288(dexData)) { + return sub_02027264(dexData, param2); } break; - case 492: - if (param2 < sub_02026464(param0, 492)) { - return sub_02026C24(param0, 492, param2); + case SPECIES_SHAYMIN: + if (param2 < sub_02026464(dexData, SPECIES_SHAYMIN)) { + return sub_02026C24(dexData, SPECIES_SHAYMIN, param2); } break; - case 487: - if (param2 < sub_02026464(param0, 487)) { - return sub_02026C24(param0, 487, param2); + case SPECIES_GIRATINA: + if (param2 < sub_02026464(dexData, SPECIES_GIRATINA)) { + return sub_02026C24(dexData, SPECIES_GIRATINA, param2); } break; - case 479: - if (param2 < sub_02026958(param0, 479)) { - return sub_02026CCC(param0, 479, param2); + case SPECIES_ROTOM: + if (param2 < sub_02026958(dexData, SPECIES_ROTOM)) { + return sub_02026CCC(dexData, SPECIES_ROTOM, param2); } break; default: diff --git a/src/unk_02046C7C.c b/src/unk_02046C7C.c index bf984c6764..5fd09735bf 100644 --- a/src/unk_02046C7C.c +++ b/src/unk_02046C7C.c @@ -107,7 +107,7 @@ BOOL ScrCmd_0FA(ScriptContext *param0) v8.unk_01 = v4; v8.unk_02 = v6; v8.unk_03 = sub_0206A954(SaveData_GetVarsFlags(param0->fieldSystem->saveData)); - v8.unk_04 = sub_02027474(SaveData_Pokedex(param0->fieldSystem->saveData)); + v8.unk_04 = Pokedex_NationalUnlocked(SaveData_Pokedex(param0->fieldSystem->saveData)); v8.unk_05 = v7; v8.unk_08 = v1; v8.unk_0C = v0; diff --git a/src/unk_0204AEE8.c b/src/unk_0204AEE8.c index f49103a856..8b04be86b0 100644 --- a/src/unk_0204AEE8.c +++ b/src/unk_0204AEE8.c @@ -121,7 +121,7 @@ StringTemplate *sub_0204AEE8(SaveData *param0, u16 param1, u16 param2, u8 param3 for (v0 = 0; v0 < 18; v0++) { v1 = sub_02078824(v0); - if (sub_02026FE8(v4, v1)) { + if (Pokedex_EncounteredSpecies(v4, v1)) { MessageLoader_GetStrbuf(v6, v1, v2); StringTemplate_SetStrbuf(v5, (*param4) + 1, v2, param2, param3, GAME_LANGUAGE); (*param4)++; diff --git a/src/unk_020683F4.c b/src/unk_020683F4.c index 0cb18b6557..2bcf745ea1 100644 --- a/src/unk_020683F4.c +++ b/src/unk_020683F4.c @@ -1071,7 +1071,7 @@ static u32 sub_02069130(const UnkStruct_020684D0 *param0) return -1; } - if (sub_02027474(SaveData_Pokedex(param0->fieldSystem->saveData)) == 0) { + if (Pokedex_NationalUnlocked(SaveData_Pokedex(param0->fieldSystem->saveData)) == 0) { return -1; } diff --git a/src/unk_0206CCB0.c b/src/unk_0206CCB0.c index 311b123395..a7efa45f74 100644 --- a/src/unk_0206CCB0.c +++ b/src/unk_0206CCB0.c @@ -774,7 +774,7 @@ static BOOL sub_0206D320(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param PokedexData *v0 = SaveData_Pokedex(fieldSystem->saveData); UnkStruct_0206D140 *v1 = ov6_02246498(param1); - return sub_02026FE8(v0, v1->unk_06); + return Pokedex_EncounteredSpecies(v0, v1->unk_06); } void sub_0206D340(FieldSystem *fieldSystem, BOOL param1, u16 param2, Pokemon *param3) @@ -815,7 +815,7 @@ static BOOL sub_0206D3C0(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param return 1; } - return sub_02026FE8(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); + return Pokedex_EncounteredSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); } static void sub_0206D3E4(FieldSystem *fieldSystem, int param1) @@ -936,7 +936,7 @@ static int sub_0206D5B0(FieldSystem *fieldSystem, StringTemplate *param1, UnkStr static BOOL sub_0206D5F0(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param1) { UnkStruct_0206D5B0 *v0 = (UnkStruct_0206D5B0 *)ov6_02246498(param1); - return sub_02026FE8(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); + return Pokedex_EncounteredSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); } void sub_0206D60C(FieldSystem *fieldSystem, Pokemon *param1) @@ -965,7 +965,7 @@ static BOOL sub_0206D6A8(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param PokedexData *v0 = SaveData_Pokedex(fieldSystem->saveData); UnkStruct_0206D644 *v1 = (UnkStruct_0206D644 *)ov6_02246498(param1); - return sub_02026FE8(v0, v1->unk_00); + return Pokedex_EncounteredSpecies(v0, v1->unk_00); } void sub_0206D6C8(FieldSystem *fieldSystem, int param1, int param2) @@ -1026,7 +1026,7 @@ static BOOL sub_0206D7A4(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param PokedexData *v0 = SaveData_Pokedex(fieldSystem->saveData); UnkStruct_0206D75C *v1 = (UnkStruct_0206D75C *)ov6_02246498(param1); - return sub_02026FE8(v0, v1->unk_00); + return Pokedex_EncounteredSpecies(v0, v1->unk_00); } void sub_0206D7C4(FieldSystem *fieldSystem) @@ -1093,7 +1093,7 @@ static BOOL sub_0206D8F0(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param { UnkStruct_0206D8B0 *v0 = (UnkStruct_0206D8B0 *)ov6_02246498(param1); - return sub_02026FE8(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); + return Pokedex_EncounteredSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); } void sub_0206D90C(TVBroadcast *fieldSystem, Pokemon *param1, u16 param2) @@ -1172,7 +1172,7 @@ static BOOL sub_0206DA50(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param { UnkStruct_0206D9F4 *v0 = (UnkStruct_0206D9F4 *)ov6_02246498(param1); - return sub_02026FE8(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); + return Pokedex_EncounteredSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); } static void sub_0206DA6C(UnkStruct_0206DA6C *param0, const TrainerInfo *param1) @@ -1305,7 +1305,7 @@ static BOOL sub_0206DC3C(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param { UnkStruct_0206DBE8 *v0 = (UnkStruct_0206DBE8 *)ov6_02246498(param1); - if (sub_02026FE8(SaveData_Pokedex(fieldSystem->saveData), v0->unk_02) == 0) { + if (Pokedex_EncounteredSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_02) == 0) { return 0; } @@ -1342,7 +1342,7 @@ static int sub_0206DC9C(FieldSystem *fieldSystem, StringTemplate *param1, UnkStr static BOOL sub_0206DD1C(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param1) { UnkStruct_0206DC9C *v0 = (UnkStruct_0206DC9C *)ov6_02246498(param1); - return sub_02026FE8(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); + return Pokedex_EncounteredSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); } void sub_0206DD38(FieldSystem *fieldSystem, u32 param1, u32 param2, u32 param3) @@ -1683,7 +1683,7 @@ static BOOL sub_0206E248(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param { UnkStruct_0206E1C0 *v0 = ov6_02246498(param1); - return sub_02026FE8(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); + return Pokedex_EncounteredSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); } void sub_0206E264(FieldSystem *fieldSystem, u16 param1) @@ -1743,7 +1743,7 @@ static int sub_0206E300(FieldSystem *fieldSystem, StringTemplate *param1, UnkStr static BOOL sub_0206E37C(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param1) { UnkStruct_0206E300 *v0 = ov6_02246498(param1); - return sub_02026FE8(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00.unk_02); + return Pokedex_EncounteredSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00.unk_02); } void sub_0206E398(FieldSystem *fieldSystem, u16 param1) @@ -1777,7 +1777,7 @@ static int sub_0206E3C8(FieldSystem *fieldSystem, StringTemplate *param1, UnkStr static BOOL sub_0206E3F8(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param1) { UnkStruct_0206E3C8 *v0 = ov6_02246498(param1); - return sub_02026FE8(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); + return Pokedex_EncounteredSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); } void sub_0206E414(FieldSystem *fieldSystem, u16 param1) @@ -2760,7 +2760,7 @@ static int sub_0206F01C(FieldSystem *fieldSystem, StringTemplate *param1, UnkStr v1 = (LCRNG_Next() % (NATIONAL_DEX_COUNT - 1)) + 1; for (v2 = 1; v2 <= NATIONAL_DEX_COUNT; v2++) { - if (sub_02026FE8(v4, v1) == 1) { + if (Pokedex_EncounteredSpecies(v4, v1) == 1) { v3 = v1; break; } @@ -2861,7 +2861,7 @@ static int sub_0206F160(FieldSystem *fieldSystem, StringTemplate *param1, UnkStr v1 = (LCRNG_Next() % (NATIONAL_DEX_COUNT - 2) + 1); for (v2 = 1; v2 <= NATIONAL_DEX_COUNT; v2++) { - if (sub_02026FE8(v6, v1) == 1) { + if (Pokedex_EncounteredSpecies(v6, v1) == 1) { v0 = sub_0206F0D8(v1, 4); StringTemplate_SetStrbuf(param1, 2, v0, 0, 1, GAME_LANGUAGE); Strbuf_Free(v0); diff --git a/src/unk_0207A274.c b/src/unk_0207A274.c index 8be1277cae..cfd7a4eb6c 100644 --- a/src/unk_0207A274.c +++ b/src/unk_0207A274.c @@ -21,7 +21,7 @@ u32 sub_0207A280(const PokedexData *param0) { BOOL v0; - v0 = sub_02027474(param0); + v0 = Pokedex_NationalUnlocked(param0); if (v0 == 1) { return 1; diff --git a/src/unk_020998EC.c b/src/unk_020998EC.c index 4872a4d04a..53a74f73f1 100644 --- a/src/unk_020998EC.c +++ b/src/unk_020998EC.c @@ -3236,7 +3236,7 @@ static u32 sub_02099980(UnkStruct_020998EC *param0, const u16 *param1, u32 param v0 = sub_0209755C(param0->unk_00); for (v1 = 0; v1 < param2; v1++) { - if (sub_02026FE8(v0, param1[v1])) { + if (Pokedex_EncounteredSpecies(v0, param1[v1])) { inline_02099980(param0, param1[v1]); *param3++ = param1[v1]; v2++; diff --git a/tools/scripts/make_pokedex_data.py b/tools/scripts/make_pokedex_data.py index a20c0247d2..fe594cdc17 100644 --- a/tools/scripts/make_pokedex_data.py +++ b/tools/scripts/make_pokedex_data.py @@ -96,17 +96,17 @@ 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'] @@ -115,8 +115,8 @@ for i, species in enumerate(PokemonSpecies): # sinnoh dex order with open(args.pokedex) as data_file: - dex_data = json.load(data_file) - for mon in dex_data: + dexData = json.load(data_file) + for mon in dexData: if mon not in ['SPECIES_EGG', 'SPECIES_BAD_EGG', 'SPECIES_NONE', 'SPECIES_ARCEUS']: binData[12] = binData[12] + PokemonSpecies[mon].value.to_bytes(2, 'little') diff --git a/tools/scripts/make_pokedex_enc_platinum.py b/tools/scripts/make_pokedex_enc_platinum.py new file mode 100644 index 0000000000..370dbe0c46 --- /dev/null +++ b/tools/scripts/make_pokedex_enc_platinum.py @@ -0,0 +1,369 @@ +#!/usr/bin/env python3 +import argparse +import json +import pathlib +import subprocess + +from consts.species import PokemonSpecies +from consts.pokemon import PokemonType +from consts.pokemon import PokemonBodyShape + + +argparser = argparse.ArgumentParser( + prog='make_pokedex_enc_platinum_py', + description='Packs the archive containing Pokedex encounter data' +) +argparser.add_argument('-k', '--knarc', + required=True, + help='Path to knarc executable') +argparser.add_argument('-s', '--source-dir', + required=True, + help='Path to the source directory (res/prebuilt/application/zukanlist/zkn_data)') +argparser.add_argument('-p', '--private-dir', + required=True, + help='Path to the private directory (where binaries will be made)') +argparser.add_argument('-o', '--output-dir', + required=True, + help='Path to the output directory (where the NARC will be made)') +args = argparser.parse_args() + +source_dir = pathlib.Path(args.source_dir) +private_dir = pathlib.Path(args.private_dir) +output_dir = pathlib.Path(args.output_dir) + +output_name = 'zukan_enc_platinum' + +private_dir.mkdir(parents=True, exist_ok=True) + +# dungeon position on map +file_0 = [ + [0, 0, 0, 0], + [9, 24, 0, 0], + [6, 17, 0, 0], + [12, 17, 1, 0], + [18, 24, 0, 0], + [18, 20, 0, 0], + [26, 18, 0, 0], + [5, 22, 0, 0], + [7, 23, 0, 0], + [23, 7, 0, 0], + [24, 21, 0, 0], + [11, 6, 0, 0], + [9, 19, 0, 0], + [22, 21, 0, 0], + [14, 24, 0, 0], + [3, 15, 0, 0], + [7, 16, 0, 0], + [2, 26, 0, 0], + [22, 23, 0, 0], + [10, 7, 0, 0], + [17, 21, 0, 0], + [5, 19, 0, 0] +] +file_1 = [ + [255, 255, 255, 255], + [198, 0, 0, 0], + [203, 0, 0, 0], + [207, 0, 0, 0], + [248, 1, 0, 0], + [225, 0, 0, 0], + [244, 0, 0, 0], + [254, 0, 0, 0], + [2, 1, 0, 0], + [7, 1, 0, 0], + [11, 1, 0, 0], + [22, 1, 0, 0], + [28, 1, 0, 0], + [30, 1, 0, 0], + [31, 1, 0, 0], + [33, 1, 0, 0], + [39, 1, 0, 0], + [55, 1, 0, 0], + [59, 1, 0, 0], + [62, 1, 0, 0], + [101, 1, 0, 0], + [0, 1, 0, 0] +] +# field position on map +file_2 = [ + [0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [1, 22, 1, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [9, 16, 1, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [18, 25, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [26, 23, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [26, 17, 1, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [7, 20, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [5, 18, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [23, 7, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [3, 15, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [21, 23, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [9, 6, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [3, 26, 2, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [5, 25, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [6, 23, 2, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [5, 22, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [5, 21, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [6, 18, 1, 3, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [8, 16, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [9, 18, 1, 4, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [9, 22, 2, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [12, 22, 2, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [17, 21, 1, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [17, 17, 1, 3, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [15, 16, 3, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [11, 16, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [13, 16, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [14, 23, 1, 3, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [14, 26, 4, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [20, 25, 3, 2, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [22, 20, 1, 3, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [18, 18, 3, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [9, 12, 3, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [9, 8, 1, 4, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [2, 23, 2, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [5, 27, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [7, 28, 3, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [23, 24, 3, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [27, 15, 2, 3, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [19, 10, 1, 3, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [23, 8, 1, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [24, 10, 1, 3, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [24, 13, 2, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [3, 27, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [14, 16, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [25, 14, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [5, 28, 2, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [26, 19, 1, 4, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [21, 10, 3, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [21, 13, 3, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [6, 16, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] +] +file_3 = [ + [255, 255, 255, 255], + [33, 0, 0, 0], + [65, 0, 0, 0], + [120, 0, 0, 0], + [150, 0, 0, 0], + [172, 0, 0, 0], + [200, 0, 0, 0], + [204, 0, 0, 0], + [6, 1, 0, 0], + [32, 1, 0, 0], + [80, 1, 0, 0], + [84, 1, 0, 0], + [86, 1, 0, 0], + [87, 1, 0, 0], + [88, 1, 0, 0], + [89, 1, 0, 0], + [90, 1, 0, 0], + [91, 1, 0, 0], + [93, 1, 0, 0], + [94, 1, 0, 0], + [97, 1, 0, 0], + [98, 1, 0, 0], + [100, 1, 0, 0], + [106, 1, 0, 0], + [107, 1, 0, 0], + [109, 1, 0, 0], + [110, 1, 0, 0], + [111, 1, 0, 0], + [115, 1, 0, 0], + [117, 1, 0, 0], + [124, 1, 0, 0], + [126, 1, 0, 0], + [127, 1, 0, 0], + [129, 1, 0, 0], + [132, 1, 0, 0], + [135, 1, 0, 0], + [136, 1, 0, 0], + [139, 1, 0, 0], + [143, 1, 0, 0], + [144, 1, 0, 0], + [147, 1, 0, 0], + [150, 1, 0, 0], + [151, 1, 0, 0], + [155, 1, 0, 0], + [186, 1, 0, 0], + [201, 1, 0, 0], + [211, 1, 0, 0], + [212, 1, 0, 0], + [213, 1, 0, 0], + [215, 1, 0, 0], + [202, 0, 0, 0] +] + +honeyTrees = [ + "SPECIES_AIPOM", + "SPECIES_HERACROSS", + "SPECIES_WURMPLE", + "SPECIES_BURMY", + "SPECIES_COMBEE", + "SPECIES_CHERUBI" +] + +NUM_POKEMON = len(PokemonSpecies) - 1 +NUM_FILES = NUM_POKEMON * 10 + 4 + +binData = bytes() +for dungeon in file_0: + for pos in dungeon: + binData = binData + pos.to_bytes(1, 'little') + +target_fname = str(private_dir / output_name) + '_00000.bin' +with open(target_fname, 'wb+') as target_file: + target_file.write(binData) + +binData = bytes() +for dungeon in file_1: + for pos in dungeon: + binData = binData + pos.to_bytes(1, 'little') + +target_fname = str(private_dir / output_name) + '_00001.bin' +with open(target_fname, 'wb+') as target_file: + target_file.write(binData) + +binData = bytes() +for field in file_2: + for pos in field: + binData = binData + pos.to_bytes(1, 'little') + +target_fname = str(private_dir / output_name) + '_00002.bin' +with open(target_fname, 'wb+') as target_file: + target_file.write(binData) + +binData = bytes() +for field in file_3: + for pos in field: + binData = binData + pos.to_bytes(1, 'little') + +target_fname = str(private_dir / output_name) + '_00003.bin' +with open(target_fname, 'wb+') as target_file: + target_file.write(binData) + +def SearchLand(species, encounterData, absent, category): + encData = 0 + while ((encData < 12) and absent): + + if (((encData == 2) or (encData == 3)) and (category > 0)): + if (category == 1): + enc = encounterData["morning"][encData - 2] + if (category == 2): + enc = encounterData["night"][encData - 2] + else: + enc = encounterData["land_encounters"][encData]["species"] + if (enc == species): + absent = False + encData += 1 + return absent + +def SearchWater(species, encounterData, absent): + encData = 0 + while ((encData < 5) and absent): + enc = encounterData["surf_encounters"][encData]["species"] + if (enc == species): + absent = False + enc = encounterData["old_rod_encounters"][encData]["species"] + if (enc == species): + absent = False + enc = encounterData["good_rod_encounters"][encData]["species"] + if (enc == species): + absent = False + enc = encounterData["super_rod_encounters"][encData]["species"] + if (enc == species): + absent = False + encData += 1 + return absent + +def SearchRadar(species, encounterData, absent): + encData = 0 + while ((encData < 4) and absent): + enc = encounterData["radar"][encData] + if (enc == species): + absent = False + encData += 1 + return absent + +def SearchSpecial(species, encounterData, absent): + encData = 0 + if (species == "SPECIES_NONE"): + return False + while ((encData < len(encounterData["special_encounters"])) and absent): + enc = encounterData["special_encounters"][encData] + if (enc == species): + absent = False + encData += 1 + return absent + +def SearchSpecialNatDex(species, encounterData, absent): + encData = 0 + while ((encData < len(encounterData["specialnatdex_encounters"])) and absent): + enc = encounterData["specialnatdex_encounters"][encData] + if (enc == species): + absent = False + encData += 1 + if absent: + absent = SearchRadar(species, encounterData, absent) + return absent + +def CategorySearch(species, encounterData, category): + absent = True + + if (category < 3): + absent = SearchLand(species, encounterData, absent, category) + if absent: + absent = SearchWater(species, encounterData, absent) + if (category == 3): + absent = SearchSpecial(species, encounterData, absent) + if (category == 4): + absent = SearchSpecialNatDex(species, encounterData, absent) + + return absent + +for dexNum, species in enumerate(PokemonSpecies): + if species.name in ['SPECIES_BAD_EGG']: + continue + species = species.name + + for category in range(10): + fileNum = NUM_POKEMON * category + dexNum + 4 + encList = [] + + for archiveID in range(183): + with open(source_dir / '../../../../field/encounters' / f"{archiveID:03}.json", encoding='utf-8') as encounter_file: + encounterData = json.load(encounter_file) + + areaData = encounterData["map_category"] + areaType = areaData["map_type"] + areaNum = areaData["map_number"] + + if (category < 5): + if (areaType == 'field'): + continue + else: + if (areaType == 'dungeon'): + continue + if (areaNum in encList): + continue + + absent = CategorySearch(species, encounterData, category%5) + + if not absent: + encList.append(areaNum) + + if (((category == 3) or (category == 4)) and (species in honeyTrees)): + encList.append(21) + if (((category == 8) or (category == 9)) and (species in honeyTrees)): + encList.append(50) + encList.sort() + encList.append(0) + + binData = bytes() + for areaNum in encList: + binData = binData + areaNum.to_bytes(4, 'little') + + target_fname = str(private_dir / output_name) + f'_{fileNum:05}.bin' + with open(target_fname, 'wb+') as target_file: + target_file.write(binData) + + +subprocess.run([args.knarc, '-d', private_dir, '-p', str(output_dir / output_name) + '.narc']) diff --git a/tools/scripts/make_pokedex_message_banks.py b/tools/scripts/make_pokedex_message_banks.py index e028a472fc..5d9b4b9efc 100644 --- a/tools/scripts/make_pokedex_message_banks.py +++ b/tools/scripts/make_pokedex_message_banks.py @@ -21,15 +21,16 @@ 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.' @@ -151,17 +154,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 5c20a881d9..6cc19bc4ec 100644 --- a/tools/scripts/meson.build +++ b/tools/scripts/meson.build @@ -10,3 +10,4 @@ make_species_tables_py = find_program('make_species_tables.py', native: true) make_tutorable_moves_py = find_program('make_tutorable_moves.py', native: true) make_pokedex_data_py = find_program('make_pokedex_data.py', native: true) make_pokedex_message_banks_py = find_program('make_pokedex_message_banks.py', native: true) +make_pokedex_enc_platinum_py = find_program('make_pokedex_enc_platinum.py', native: true) From 304a6714dd9753604d1b1e3623b142ba3ac08506 Mon Sep 17 00:00:00 2001 From: h2o-DS Date: Sun, 13 Oct 2024 12:34:42 -0400 Subject: [PATCH 02/16] Formatted --- include/overlay021/struct_ov21_021D37DC.h | 2 +- include/overlay021/struct_ov21_021D3A60.h | 4 ++-- src/field_menu.c | 8 ++++---- src/overlay021/ov21_021D0D80.c | 2 +- src/overlay021/ov21_021D57B4.c | 22 +++++++++++----------- src/overlay021/ov21_021D5AEC.c | 3 +-- src/overlay021/ov21_021D76B0.c | 2 +- src/overlay021/ov21_021D85B0.c | 2 +- src/overlay021/ov21_021D94BC.c | 2 +- src/overlay021/ov21_021DC9BC.c | 7 +++---- src/overlay021/ov21_021DDD2C.c | 2 +- src/overlay021/ov21_021DE668.c | 2 +- src/overlay021/ov21_021DF734.c | 2 +- src/overlay021/ov21_021E0C68.c | 2 +- src/overlay021/ov21_021E1924.c | 2 +- src/overlay021/ov21_021E29DC.c | 2 +- src/overlay021/ov21_021E3FFC.c | 2 +- src/overlay021/ov21_021E4CA4.c | 2 +- src/overlay021/ov21_021E6014.c | 2 +- src/overlay021/ov21_021E68F4.c | 2 +- src/overlay021/ov21_021E737C.c | 4 ++-- src/overlay021/ov21_021E8484.c | 2 +- 22 files changed, 39 insertions(+), 41 deletions(-) diff --git a/include/overlay021/struct_ov21_021D37DC.h b/include/overlay021/struct_ov21_021D37DC.h index e92f89fb47..80b92500ea 100644 --- a/include/overlay021/struct_ov21_021D37DC.h +++ b/include/overlay021/struct_ov21_021D37DC.h @@ -3,7 +3,7 @@ typedef struct { int species; - int caughtStatus;// 2 for caught, 1 for seen, 0 otherwise + int caughtStatus; // 2 for caught, 1 for seen, 0 otherwise } speciesCaughtStatusStruct; #endif // POKEPLATINUM_STRUCT_OV21_021D37DC_H diff --git a/include/overlay021/struct_ov21_021D3A60.h b/include/overlay021/struct_ov21_021D3A60.h index c283024d2a..01d387cfe6 100644 --- a/include/overlay021/struct_ov21_021D3A60.h +++ b/include/overlay021/struct_ov21_021D3A60.h @@ -8,8 +8,8 @@ typedef struct { speciesCaughtStatusStruct caughtStatusArray[NATIONAL_DEX_COUNT]; int unk_F68; - int numEncountered;// number of pokemon seen - int encounteredIndexArray[NATIONAL_DEX_COUNT];// dex number for appearing in dex, dexLength+1 otherwise + int numEncountered; // number of pokemon seen + int encounteredIndexArray[NATIONAL_DEX_COUNT]; // dex number for appearing in dex, dexLength+1 otherwise int unk_1724; int numSpecies; } pokedexCompletionStruct; diff --git a/src/field_menu.c b/src/field_menu.c index 10fcaa622b..eedb209deb 100644 --- a/src/field_menu.c +++ b/src/field_menu.c @@ -957,10 +957,10 @@ static BOOL FieldMenu_Pokedex(TaskManager *taskMan) v2->unk_00 = v3; v2->unk_04 = v4; v2->timeOfDay = sub_02055BA8(fieldSystem); - v2->pokedexSFlag_1 = sub_0206B1F0(v5, 0);// VarsFlags->vars[54] - v2->pokedexSFlag_2 = sub_0206B1F0(v5, 1);// VarsFlags->vars[55] - v2->pokedexSFlag_3 = sub_0206B1F0(v5, 2);// VarsFlags->vars[56] - v2->pokedexSFlag_4 = sub_0206B1F0(v5, 3);// VarsFlags->vars[57] + v2->pokedexSFlag_1 = sub_0206B1F0(v5, 0); // VarsFlags->vars[54] + v2->pokedexSFlag_2 = sub_0206B1F0(v5, 1); // VarsFlags->vars[55] + v2->pokedexSFlag_3 = sub_0206B1F0(v5, 2); // VarsFlags->vars[56] + v2->pokedexSFlag_4 = sub_0206B1F0(v5, 3); // VarsFlags->vars[57] v2->unk_1C = fieldSystem->unk_B4; sub_0203E0AC(fieldSystem, v2); diff --git a/src/overlay021/ov21_021D0D80.c b/src/overlay021/ov21_021D0D80.c index 2d64825c9e..7a093577ab 100644 --- a/src/overlay021/ov21_021D0D80.c +++ b/src/overlay021/ov21_021D0D80.c @@ -12,7 +12,6 @@ #include "overlay021/funcptr_ov21_021E9B74.h" #include "overlay021/funcptr_ov21_021E9B9C.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/pokedex_sort.h" #include "overlay021/ov21_021D3FE0.h" #include "overlay021/ov21_021D423C.h" #include "overlay021/ov21_021D4340.h" @@ -35,6 +34,7 @@ #include "overlay021/ov21_021E68F4.h" #include "overlay021/ov21_021E737C.h" #include "overlay021/ov21_021E8484.h" +#include "overlay021/pokedex_sort.h" #include "overlay021/struct_ov21_021D0D80.h" #include "overlay021/struct_ov21_021D0D80_1.h" #include "overlay021/struct_ov21_021D13FC.h" diff --git a/src/overlay021/ov21_021D57B4.c b/src/overlay021/ov21_021D57B4.c index 5757a914e7..9871dd806d 100644 --- a/src/overlay021/ov21_021D57B4.c +++ b/src/overlay021/ov21_021D57B4.c @@ -18,34 +18,34 @@ void ov21_021D57B4(pokedexEncStruct *dexEncData, int species, int param2, int he u32 fileSize; switch (param2) { - case 0:// category 0, morning + case 0: // category 0, morning v0 = 4; break; - case 1:// category 0, day + case 1: // category 0, day v0 = 499; break; - case 2:// category 0, night + case 2: // category 0, night v0 = 994; break; - case 3:// category 2, regional + case 3: // category 2, regional v0 = 1489; break; - case 4:// category 2, national + case 4: // category 2, national v0 = 1984; break; - case 5:// category 1, morning + case 5: // category 1, morning v0 = 2479; break; - case 6:// category 1, day + case 6: // category 1, day v0 = 2974; break; - case 7:// category 1, night + case 7: // category 1, night v0 = 3469; break; - case 8:// category 3, regional + case 8: // category 3, regional v0 = 3964; break; - case 9:// category 3, national + case 9: // category 3, national v0 = 4459; break; } @@ -97,7 +97,7 @@ void ov21_021D58C0(u8 *param0, u8 param1, u8 param2, const UnkStruct_ov21_021D58 { int outerIndex, innerIndex; - GF_ASSERT((param3->unk_01 + param3->unk_03) < param2);// param 1 and 2 are 30 + GF_ASSERT((param3->unk_01 + param3->unk_03) < param2); // param 1 and 2 are 30 GF_ASSERT((param3->unk_00 + param3->unk_02) < param1); for (outerIndex = param3->unk_01; outerIndex < param3->unk_01 + param3->unk_03; outerIndex++) { diff --git a/src/overlay021/ov21_021D5AEC.c b/src/overlay021/ov21_021D5AEC.c index 358cf52ec6..e80a7ca8e0 100644 --- a/src/overlay021/ov21_021D5AEC.c +++ b/src/overlay021/ov21_021D5AEC.c @@ -9,9 +9,9 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/pokedex_sort.h" #include "overlay021/ov21_021D4340.h" #include "overlay021/ov21_021D4C0C.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" @@ -1727,7 +1727,6 @@ static void ov21_021D7538(UnkStruct_ov21_021D5B68 *param0, int param1) (*param0->unk_00) |= (1 << 4); ov21_021D3794(param0->unk_04, species); - param0->unk_0C = 0; param0->unk_04->unk_1740 = 0; diff --git a/src/overlay021/ov21_021D76B0.c b/src/overlay021/ov21_021D76B0.c index b1cee11816..070489c6d8 100644 --- a/src/overlay021/ov21_021D76B0.c +++ b/src/overlay021/ov21_021D76B0.c @@ -10,10 +10,10 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/pokedex_sort.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" diff --git a/src/overlay021/ov21_021D85B0.c b/src/overlay021/ov21_021D85B0.c index e2873c8563..0c49445863 100644 --- a/src/overlay021/ov21_021D85B0.c +++ b/src/overlay021/ov21_021D85B0.c @@ -8,8 +8,8 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/pokedex_sort.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" diff --git a/src/overlay021/ov21_021D94BC.c b/src/overlay021/ov21_021D94BC.c index c92720b71c..6b3c466789 100644 --- a/src/overlay021/ov21_021D94BC.c +++ b/src/overlay021/ov21_021D94BC.c @@ -9,10 +9,10 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/pokedex_sort.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" diff --git a/src/overlay021/ov21_021DC9BC.c b/src/overlay021/ov21_021DC9BC.c index d626d6af26..29331e8dee 100644 --- a/src/overlay021/ov21_021DC9BC.c +++ b/src/overlay021/ov21_021DC9BC.c @@ -9,11 +9,11 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/pokedex_sort.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021D517C.h" #include "overlay021/ov21_021D57B4.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" @@ -30,6 +30,7 @@ #include "cell_actor.h" #include "gx_layers.h" #include "heap.h" +#include "rtc.h" #include "sprite_resource.h" #include "unk_0200762C.h" #include "unk_020093B4.h" @@ -38,8 +39,6 @@ #include "unk_02018340.h" #include "unk_0201F834.h" -#include "rtc.h" - static const u16 Unk_ov21_021E9D78[] = { 0xffff }; @@ -281,7 +280,7 @@ static int ov21_021DCAF4(void) return 0; } -static int ov21_021DCAF8(UnkStruct_ov21_021E6A68 *param0, void *param1)// dansim +static int ov21_021DCAF8(UnkStruct_ov21_021E6A68 *param0, void *param1) // dansim { UnkStruct_ov21_021DCACC *v0 = param1; UnkStruct_ov21_021DDABC *v1; diff --git a/src/overlay021/ov21_021DDD2C.c b/src/overlay021/ov21_021DDD2C.c index ea7dea0464..764b48f741 100644 --- a/src/overlay021/ov21_021DDD2C.c +++ b/src/overlay021/ov21_021DDD2C.c @@ -8,9 +8,9 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/pokedex_sort.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" diff --git a/src/overlay021/ov21_021DE668.c b/src/overlay021/ov21_021DE668.c index 1241a653a7..8cf45f6931 100644 --- a/src/overlay021/ov21_021DE668.c +++ b/src/overlay021/ov21_021DE668.c @@ -10,10 +10,10 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1F90.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/pokedex_sort.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" diff --git a/src/overlay021/ov21_021DF734.c b/src/overlay021/ov21_021DF734.c index ed84eeef43..b6bad69b4e 100644 --- a/src/overlay021/ov21_021DF734.c +++ b/src/overlay021/ov21_021DF734.c @@ -8,9 +8,9 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/pokedex_sort.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" diff --git a/src/overlay021/ov21_021E0C68.c b/src/overlay021/ov21_021E0C68.c index 3908e5be26..61b1d7712a 100644 --- a/src/overlay021/ov21_021E0C68.c +++ b/src/overlay021/ov21_021E0C68.c @@ -9,10 +9,10 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/pokedex_sort.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" diff --git a/src/overlay021/ov21_021E1924.c b/src/overlay021/ov21_021E1924.c index dd9977b32a..3d1e6fedb3 100644 --- a/src/overlay021/ov21_021E1924.c +++ b/src/overlay021/ov21_021E1924.c @@ -9,13 +9,13 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/pokedex_sort.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" diff --git a/src/overlay021/ov21_021E29DC.c b/src/overlay021/ov21_021E29DC.c index 68aa9af719..6ae4dd6f88 100644 --- a/src/overlay021/ov21_021E29DC.c +++ b/src/overlay021/ov21_021E29DC.c @@ -9,13 +9,13 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/pokedex_sort.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" diff --git a/src/overlay021/ov21_021E3FFC.c b/src/overlay021/ov21_021E3FFC.c index 82d86cccae..79142580ca 100644 --- a/src/overlay021/ov21_021E3FFC.c +++ b/src/overlay021/ov21_021E3FFC.c @@ -9,9 +9,9 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/pokedex_sort.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" diff --git a/src/overlay021/ov21_021E4CA4.c b/src/overlay021/ov21_021E4CA4.c index 9acfa1a1ff..76b921e29f 100644 --- a/src/overlay021/ov21_021E4CA4.c +++ b/src/overlay021/ov21_021E4CA4.c @@ -9,9 +9,9 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/pokedex_sort.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" diff --git a/src/overlay021/ov21_021E6014.c b/src/overlay021/ov21_021E6014.c index 37254ea03f..e847d802bd 100644 --- a/src/overlay021/ov21_021E6014.c +++ b/src/overlay021/ov21_021E6014.c @@ -8,8 +8,8 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/pokedex_sort.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" diff --git a/src/overlay021/ov21_021E68F4.c b/src/overlay021/ov21_021E68F4.c index b6e3a2f8c2..7db3a24fea 100644 --- a/src/overlay021/ov21_021E68F4.c +++ b/src/overlay021/ov21_021E68F4.c @@ -9,10 +9,10 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/pokedex_sort.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" diff --git a/src/overlay021/ov21_021E737C.c b/src/overlay021/ov21_021E737C.c index 62d9236b58..2724f08c9c 100644 --- a/src/overlay021/ov21_021E737C.c +++ b/src/overlay021/ov21_021E737C.c @@ -10,8 +10,8 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/pokedex_sort.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" @@ -555,7 +555,7 @@ static void ov21_021E7904(UnkStruct_ov21_021E7714 *param0, UnkStruct_ov21_021E74 NARC *v9; v9 = NARC_ctor(NARC_INDEX_POKETOOL__ICONGRA__PL_POKE_ICON, param3); - v8 = ov21_021D33D4(param2->unk_00, species);// lasthere + v8 = ov21_021D33D4(param2->unk_00, species); // lasthere v1 = PokeIconSpriteIndex(species, 0, v8); v2 = PokeIconPalettesFileIndex(); v3 = PokeIconCellsFileIndex(); diff --git a/src/overlay021/ov21_021E8484.c b/src/overlay021/ov21_021E8484.c index 940b181e43..874f799701 100644 --- a/src/overlay021/ov21_021E8484.c +++ b/src/overlay021/ov21_021E8484.c @@ -9,10 +9,10 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" -#include "overlay021/pokedex_sort.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" From bffc52cf4822e2a83532cceff186175b8c2ea7db Mon Sep 17 00:00:00 2001 From: h2o-DS Date: Sat, 19 Oct 2024 23:15:03 -0400 Subject: [PATCH 03/16] Improved make tool Improved efficiency of make_enc_platinum.py Improved access of files in other folders Renamed UnkStruct_ov21_021D5890 to fieldCoordinates Renamed UnkStruct_ov21_021D5868 to dungeonCoordinates Added enums for caughtStatus and encounter gategory Removed redundant struct UnkStruct_ov21_021D0D80_1 --- include/overlay021/ov21_021D0D80.h | 4 +- include/overlay021/ov21_021D517C.h | 14 +- include/overlay021/ov21_021D57B4.h | 44 +- include/overlay021/ov21_021DC9BC.h | 6 + include/overlay021/pokedex_sort.h | 10 +- .../overlay021/struct_dungeoncoordinates.h | 11 + include/overlay021/struct_fieldcoordinates.h | 12 + include/overlay021/struct_ov21_021D0D80_1.h | 20 - include/overlay021/struct_ov21_021D3320.h | 6 +- include/overlay021/struct_ov21_021D37DC.h | 9 - include/overlay021/struct_ov21_021D3A60.h | 4 +- include/overlay021/struct_ov21_021D5844.h | 6 +- include/overlay021/struct_ov21_021D5868.h | 11 - include/overlay021/struct_ov21_021D5890.h | 12 - include/overlay021/struct_ov21_021E6A68.h | 4 +- .../overlay021/struct_speciescaughtstatus.h | 15 + include/unk_0202631C.h | 2 +- .../zukanlist/zkn_data/meson.build | 11 +- src/overlay021/ov21_021D0D80.c | 17 +- src/overlay021/ov21_021D517C.c | 207 ++--- src/overlay021/ov21_021D57B4.c | 156 ++-- src/overlay021/ov21_021D5AEC.c | 28 +- src/overlay021/ov21_021DC9BC.c | 774 +++++++++--------- src/overlay021/pokedex_sort.c | 26 +- src/scrcmd.c | 2 +- src/unk_0202631C.c | 2 +- tools/scripts/make_pokedex_data.py | 10 +- tools/scripts/make_pokedex_enc_platinum.py | 257 +++--- 28 files changed, 868 insertions(+), 812 deletions(-) create mode 100644 include/overlay021/struct_dungeoncoordinates.h create mode 100644 include/overlay021/struct_fieldcoordinates.h delete mode 100644 include/overlay021/struct_ov21_021D0D80_1.h delete mode 100644 include/overlay021/struct_ov21_021D37DC.h delete mode 100644 include/overlay021/struct_ov21_021D5868.h delete mode 100644 include/overlay021/struct_ov21_021D5890.h create mode 100644 include/overlay021/struct_speciescaughtstatus.h diff --git a/include/overlay021/ov21_021D0D80.h b/include/overlay021/ov21_021D0D80.h index 067ccaea33..e6d2c53526 100644 --- a/include/overlay021/ov21_021D0D80.h +++ b/include/overlay021/ov21_021D0D80.h @@ -6,7 +6,7 @@ #include "struct_decls/struct_02018340_decl.h" #include "struct_defs/struct_0205AA50.h" -#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" @@ -26,7 +26,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_021D517C.h b/include/overlay021/ov21_021D517C.h index 56b0ae29b0..26316d6f3d 100644 --- a/include/overlay021/ov21_021D517C.h +++ b/include/overlay021/ov21_021D517C.h @@ -3,7 +3,19 @@ #include "struct_defs/struct_0205AA50.h" +enum CellNeighbors { + CN_ALONE = 0, + CN_WEST = (1 << 0), + CN_EAST = (1 << 1), + CN_SOUTH = (1 << 2), + CN_NORTH = (1 << 3), + CN_SOUTHWEST = (1 << 4), + CN_NORTHWEST = (1 << 5), + CN_SOUTHEAST = (1 << 6), + CN_NORTHEAST = (1 << 7), +}; + 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); +void MapFieldCellMatrix_SmoothCells(u8 *mapFieldCellMatrix, u8 mapHeight, u8 mapWidth); #endif // POKEPLATINUM_OV21_021D517C_H diff --git a/include/overlay021/ov21_021D57B4.h b/include/overlay021/ov21_021D57B4.h index 96b8cc26af..d957302ff1 100644 --- a/include/overlay021/ov21_021D57B4.h +++ b/include/overlay021/ov21_021D57B4.h @@ -1,19 +1,43 @@ #ifndef POKEPLATINUM_OV21_021D57B4_H #define POKEPLATINUM_OV21_021D57B4_H +#include "overlay021/struct_dungeoncoordinates.h" +#include "overlay021/struct_fieldCoordinates.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(pokedexEncStruct *dexEncData, int param1, int param2, int param3); -void Free_pokedexEncData(pokedexEncStruct *dexEncData); -UnkStruct_ov21_021D5868 *ov21_021D5868(int param0, int *param1); -UnkStruct_ov21_021D5890 *ov21_021D5890(int param0, int *param1); -void ov21_021D58C0(u8 *param0, u8 param1, u8 param2, const UnkStruct_ov21_021D5890 *param3); -u32 ov21_021D5948(u8 *param0, int param1, int param2, const UnkStruct_ov21_021D5890 *param3, const pokedexEncStruct *dexEncData, const u8 *param5, u32 param6); -void ov21_021D59D8(CellActor *param0, int param1, int param2, int param3, int param4, const UnkStruct_ov21_021D5868 *param5, int param6, int param7); -int ov21_021D5A20(CellActor **param0, int param1, int param2, int param3, int param4, int param5, int param6, const UnkStruct_ov21_021D5868 *param7, const pokedexEncStruct *dexEncData, int param9, int param10, const u8 *param11, u32 param12, u32 *param13); +#define PEFI_DUNGEONMORNING 4 +#define PEFI_DUNGEONDAY (4 + MAX_SPECIES) +#define PEFI_DUNGEONNIGHT (4 + MAX_SPECIES * 2) +#define PEFI_DUNGEONSPECIAL (4 + MAX_SPECIES * 3) +#define PEFI_DUNGEONSPECIALNATDEX (4 + MAX_SPECIES * 4) +#define PEFI_FIELDMORNING (4 + MAX_SPECIES * 5) +#define PEFI_FIELDDAY (4 + MAX_SPECIES * 6) +#define PEFI_FIELDNIGHT (4 + MAX_SPECIES * 7) +#define PEFI_FIELDSPECIAL (4 + MAX_SPECIES * 8) +#define PEFI_FIELDSPECIALNATDEX (4 + MAX_SPECIES * 9) + +enum PokedexEncFileCatgegory { + PEFC_DUNGEONMORNING = 0, + PEFC_DUNGEONDAY = 1, + PEFC_DUNGEONNIGHT = 2, + PEFC_DUNGEONSPECIAL = 3, + PEFC_DUNGEONSPECIALNATDEX = 4, + PEFC_FIELDMORNING = 5, + PEFC_FIELDDAY = 6, + PEFC_FIELDNIGHT = 7, + PEFC_FIELDSPECIAL = 8, + PEFC_FIELDSPECIALNATDEX = 9, +}; + +void PokedexEncData_PopulateMapsEncounteredOn(mapsEncounteredOn *mapsEncOn, int species, int encounterCategory, int heapID); +void PokedexEncData_FreeMapsEncounteredOn(mapsEncounteredOn *mapsEncOn); +dungeonCoordinates *PokedexEncData_GetDungeonLocations(int heapID, int *numDungeons); +fieldCoordinates *PokedexEncData_GetFieldLocations(int heapID, int *numFields); +void ov21_021D58C0(u8 *param0, u8 param1, u8 param2, const fieldCoordinates *param3); +u32 ov21_021D5948(u8 *param0, int param1, int param2, const fieldCoordinates *param3, const mapsEncounteredOn *mapsEncOn, const u8 *param5, u32 param6); +void ov21_021D59D8(CellActor *param0, int param1, int param2, int param3, int param4, const dungeonCoordinates *param5, int param6, int param7); +int ov21_021D5A20(CellActor **param0, int param1, int param2, int param3, int param4, int param5, int param6, const dungeonCoordinates *param7, const mapsEncounteredOn *mapsEncOn, 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 8e35b79d3d..9c8bffc362 100644 --- a/include/overlay021/ov21_021DC9BC.h +++ b/include/overlay021/ov21_021DC9BC.h @@ -4,6 +4,12 @@ #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021E68F4.h" +#define POKEDEXMAPXSCALE 5 +#define POKEDEXMAPYSCALE 5 +#define POKEDEXMAPHEIGHT 30 +#define POKEDEXMAPWIDTH 30 +#define POKEDEXMAPNUMCELLS (POKEDEXMAPHEIGHT * POKEDEXMAPWIDTH) + 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); diff --git a/include/overlay021/pokedex_sort.h b/include/overlay021/pokedex_sort.h index e332e51098..dc2ec2bef3 100644 --- a/include/overlay021/pokedex_sort.h +++ b/include/overlay021/pokedex_sort.h @@ -1,9 +1,9 @@ -#ifndef POKEPLATINUM_OV21_021D3208_H -#define POKEPLATINUM_OV21_021D3208_H +#ifndef POKEPLATINUM_POKEDEX_SORT_H +#define POKEPLATINUM_POKEDEX_SORT_H #include "overlay021/struct_ov21_021D3208.h" #include "overlay021/struct_ov21_021D3320.h" -#include "overlay021/struct_ov21_021D37DC.h" +#include "overlay021/struct_speciesCaughtStatus.h" #include "strbuf.h" @@ -40,7 +40,7 @@ int ov21_021D3770(const pokedexStruct *param0, u32 param1); BOOL ov21_021D3794(pokedexStruct *param0, int param1); int Pokedex_Sort_CurrentSpecies(const pokedexStruct *param0); int Pokedex_Sort_CurrentCaughtStatus(const pokedexStruct *param0); -const speciesCaughtStatusStruct *Pokedex_Sort_SpeciesCaughtStatus(const pokedexStruct *param0, int dexIndex); +const speciesCaughtStatus *Pokedex_Sort_SpeciesCaughtStatus(const pokedexStruct *param0, int dexIndex); BOOL ov21_021D37F8(const pokedexStruct *param0, int param1); BOOL ov21_021D3810(pokedexStruct *param0, int param1); BOOL ov21_021D3844(pokedexStruct *param0, int param1); @@ -58,4 +58,4 @@ BOOL Pokedex_Sort_CanDetectForms(const pokedexStruct *param0); void ov21_021D3960(pokedexStruct *param0); u32 ov21_021D3998(const pokedexStruct *param0); -#endif // POKEPLATINUM_OV21_021D3208_H +#endif // POKEPLATINUM_POKEDEX_SORT_H diff --git a/include/overlay021/struct_dungeoncoordinates.h b/include/overlay021/struct_dungeoncoordinates.h new file mode 100644 index 0000000000..118192470d --- /dev/null +++ b/include/overlay021/struct_dungeoncoordinates.h @@ -0,0 +1,11 @@ +#ifndef POKEPLATINUM_STRUCT_DUNGEONCOORDINATES_H +#define POKEPLATINUM_STRUCT_DUNGEONCOORDINATES_H + +typedef struct { + u8 xCoordinate; + u8 yCoordinate; + u8 unk_02; + u8 unused; +} dungeonCoordinates; + +#endif // POKEPLATINUM_STRUCT_DUNGEONCOORDINATES_H diff --git a/include/overlay021/struct_fieldcoordinates.h b/include/overlay021/struct_fieldcoordinates.h new file mode 100644 index 0000000000..215945648e --- /dev/null +++ b/include/overlay021/struct_fieldcoordinates.h @@ -0,0 +1,12 @@ +#ifndef POKEPLATINUM_STRUCT_FIELDCOORDINATES_H +#define POKEPLATINUM_STRUCT_FIELDCOORDINATES_H + +typedef struct { + u8 yCoordinate; + u8 xCoordinate; + u8 height; + u8 width; + u8 cellMatrix[32]; +} fieldCoordinates; + +#endif // POKEPLATINUM_STRUCT_FIELDCOORDINATES_H diff --git a/include/overlay021/struct_ov21_021D0D80_1.h b/include/overlay021/struct_ov21_021D0D80_1.h deleted file mode 100644 index 731ab5db7b..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 timeOfDay; - BOOL pokedexSFlag_1; - BOOL pokedexSFlag_2; - BOOL pokedexSFlag_3; - BOOL pokedexSFlag_4; - UnkStruct_0209ACBC *unk_1C; -} UnkStruct_ov21_021D0D80_1; - -#endif // POKEPLATINUM_STRUCT_OV21_021D0D80_1_H diff --git a/include/overlay021/struct_ov21_021D3320.h b/include/overlay021/struct_ov21_021D3320.h index 083c1476b2..877114353e 100644 --- a/include/overlay021/struct_ov21_021D3320.h +++ b/include/overlay021/struct_ov21_021D3320.h @@ -12,14 +12,14 @@ typedef struct { const PokedexData *dexData; pokedexCompletionStruct pokedexCompletion; int isNationalDex; - BOOL nationalDexUnlocked; + BOOL isNationalDexUnlocked; int numEncountered; int numCaught; int unk_1740; int timeOfDay; HeightWeightData *HWData; - u32 TrainerGameCode; - u32 TrainerGender; + u32 trainerGameCode; + u32 trainerGender; Strbuf *trainerName; int unk_1758; u16 unk_175C; diff --git a/include/overlay021/struct_ov21_021D37DC.h b/include/overlay021/struct_ov21_021D37DC.h deleted file mode 100644 index 80b92500ea..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 species; - int caughtStatus; // 2 for caught, 1 for seen, 0 otherwise -} speciesCaughtStatusStruct; - -#endif // POKEPLATINUM_STRUCT_OV21_021D37DC_H diff --git a/include/overlay021/struct_ov21_021D3A60.h b/include/overlay021/struct_ov21_021D3A60.h index 01d387cfe6..a69ad10740 100644 --- a/include/overlay021/struct_ov21_021D3A60.h +++ b/include/overlay021/struct_ov21_021D3A60.h @@ -3,10 +3,10 @@ #include "constants/species.h" -#include "overlay021/struct_ov21_021D37DC.h" +#include "overlay021/struct_speciesCaughtStatus.h" typedef struct { - speciesCaughtStatusStruct caughtStatusArray[NATIONAL_DEX_COUNT]; + speciesCaughtStatus caughtStatusArray[NATIONAL_DEX_COUNT]; int unk_F68; int numEncountered; // number of pokemon seen int encounteredIndexArray[NATIONAL_DEX_COUNT]; // dex number for appearing in dex, dexLength+1 otherwise diff --git a/include/overlay021/struct_ov21_021D5844.h b/include/overlay021/struct_ov21_021D5844.h index 2dcf08f7fb..d70e3458e0 100644 --- a/include/overlay021/struct_ov21_021D5844.h +++ b/include/overlay021/struct_ov21_021D5844.h @@ -2,8 +2,8 @@ #define POKEPLATINUM_STRUCT_OV21_021D5844_H typedef struct { - int *pokedexEncArray; - int pokedexEncLength; -} pokedexEncStruct; + int *mapsEncounteredOnArray; + int numMapsEncounteredOn; +} mapsEncounteredOn; #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 fae833d051..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 heapID; + enum HeapId heapID; void *unk_08; BOOL unk_0C; BOOL unk_10; diff --git a/include/overlay021/struct_speciescaughtstatus.h b/include/overlay021/struct_speciescaughtstatus.h new file mode 100644 index 0000000000..98f690a002 --- /dev/null +++ b/include/overlay021/struct_speciescaughtstatus.h @@ -0,0 +1,15 @@ +#ifndef POKEPLATINUM_STRUCT_SPECIESCAUGHTSTATUS_H +#define POKEPLATINUM_STRUCT_SPECIESCAUGHTSTATUS_H + +enum CaughtStatus { + CS_UNENCOUNTERED = 0, + CS_ENCOUNTERED = 1, + CS_CAUGHT = 2, +}; + +typedef struct { + int species; + enum CaughtStatus caughtStatus; +} speciesCaughtStatus; + +#endif // POKEPLATINUM_STRUCT_SPECIESCAUGHTSTATUS_H diff --git a/include/unk_0202631C.h b/include/unk_0202631C.h index 9d6f2c5f50..8bd9e4aafd 100644 --- a/include/unk_0202631C.h +++ b/include/unk_0202631C.h @@ -40,7 +40,7 @@ void sub_0202736C(PokedexData *dexData, Pokemon *param1); void sub_02027454(PokedexData *dexData); BOOL Pokedex_NationalUnlocked(const PokedexData *dexData); BOOL Pokedex_CanDetectForms(const PokedexData *dexData); -void Pokedex_CanDetectForms_True(PokedexData *dexData); +void Pokedex_TurnOnFormDetection(PokedexData *dexData); BOOL sub_020274D0(const PokedexData *dexData, u16 param1, u32 param2); void sub_02027508(PokedexData *dexData); BOOL sub_02027514(const PokedexData *dexData); diff --git a/res/prebuilt/application/zukanlist/zkn_data/meson.build b/res/prebuilt/application/zukanlist/zkn_data/meson.build index ae91d0fc68..d6c47529ec 100644 --- a/res/prebuilt/application/zukanlist/zkn_data/meson.build +++ b/res/prebuilt/application/zukanlist/zkn_data/meson.build @@ -8,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', @@ -19,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' ] ) @@ -35,10 +35,9 @@ 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' ] ) @@ -51,7 +50,7 @@ pokedex_enc_platinum_narc = custom_target('zukan_enc_platinum.narc', command: [ make_pokedex_enc_platinum_py, '--knarc', knarc_exe, - '--source-dir', '@CURRENT_SOURCE_DIR@', + '--source-dir', encounter_folder, '--private-dir', '@PRIVATE_DIR@', '--output-dir', '@OUTDIR@' ] diff --git a/src/overlay021/ov21_021D0D80.c b/src/overlay021/ov21_021D0D80.c index 7a093577ab..92dfab1f60 100644 --- a/src/overlay021/ov21_021D0D80.c +++ b/src/overlay021/ov21_021D0D80.c @@ -36,13 +36,11 @@ #include "overlay021/ov21_021E8484.h" #include "overlay021/pokedex_sort.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" @@ -50,6 +48,7 @@ #include "overlay021/struct_ov21_021D4CA0.h" #include "overlay021/struct_ov21_021D4CB8.h" #include "overlay021/struct_ov21_021E68F4.h" +#include "overlay021/struct_speciesCaughtStatus.h" #include "overlay022/struct_ov22_022559F8.h" #include "cell_actor.h" @@ -121,7 +120,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); @@ -298,7 +297,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; @@ -724,10 +723,10 @@ void ov21_021D1778(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, Window *v3; SpriteResource *v4; VecFx32 v5; - const speciesCaughtStatusStruct *speciesCaughtStatus; + const speciesCaughtStatus *pokeCaughtStatus; u32 v7 = ov21_021D36D8(param1); - speciesCaughtStatus = Pokedex_Sort_SpeciesCaughtStatus(param1, dexIndex); + pokeCaughtStatus = Pokedex_Sort_SpeciesCaughtStatus(param1, dexIndex); v0 = ov21_021D22A8(param0); v1 = ov21_021D22C4(param0); @@ -737,7 +736,7 @@ void ov21_021D1778(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, CellActor_SetPosition(v0, &v5); CellActor_SetDrawFlag(v0, 1); - if (speciesCaughtStatus->caughtStatus == 2) { + if (pokeCaughtStatus->caughtStatus == CS_CAUGHT) { v5.x = param4 + (-54 * FX32_ONE); v5.y = param5; @@ -759,10 +758,10 @@ void ov21_021D1778(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, v2.unk_20 = NNS_G2D_VRAM_TYPE_2DMAIN; v2.unk_24 = param2; - v3 = ov21_021D16D8(param0, param1, param2, speciesCaughtStatus->species); + v3 = ov21_021D16D8(param0, param1, param2, pokeCaughtStatus->species); v2.unk_04 = v3; - ov21_021D22E0(param0, &v2, 0, speciesCaughtStatus->species, v7); + ov21_021D22E0(param0, &v2, 0, pokeCaughtStatus->species, v7); ov21_021D4DA0(v3); } diff --git a/src/overlay021/ov21_021D517C.c b/src/overlay021/ov21_021D517C.c index 5c41f0d5e0..cd1ddb650f 100644 --- a/src/overlay021/ov21_021D517C.c +++ b/src/overlay021/ov21_021D517C.c @@ -7,265 +7,266 @@ #include "unk_02018340.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); +static void ov21_021D5248(Window *param0, u8 *param1, u16 cellWidth, u16 cellHeight, int mapScale, int cellType, u8 yCoord, u8 xCoord); +static void MapFieldCellMatrix_CellType(u8 *mapFieldCellMatrix, int y, int x, int mapHeight, int mapWidth); +static int MapFieldCellMatrix_Value(u8 *mapFieldCellMatrix, int y, int x, int mapHeight, int mapWidth); +static void MapFieldCellMatrix_NeighboringCells(u8 *mapFieldCellMatrix, int *neighbors, int y, int x, int mapHeight, int mapWidth); +static int MapFieldCellMatrix_EmptyCellType(int neighbors); -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_021D517C(Window *param0, u8 *param1, u16 cellWidth, u16 cellHeight, u8 mapScale, u8 *mapFieldCellMatrix, u8 mapHeight, u8 mapWidth, u16 yOffset, u16 xOffset) { - int v0, v1; + int x, y; - 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)); + for (x = 0; x < mapWidth; x++) { + for (y = 0; y < mapHeight; y++) { + ov21_021D5248(param0, param1, cellWidth, cellHeight, mapScale, mapFieldCellMatrix[(x * mapWidth) + y], yOffset + (y * mapScale), xOffset + (x * mapScale)); } } } -void ov21_021D5214(u8 *param0, u8 param1, u8 param2) +void MapFieldCellMatrix_SmoothCells(u8 *mapFieldCellMatrix, u8 mapHeight, u8 mapWidth) { - int v0, v1; + int x, y; - for (v0 = 0; v0 < param2; v0++) { - for (v1 = 0; v1 < param1; v1++) { - ov21_021D52A0(param0, v1, v0, param1, param2); + for (x = 0; x < mapWidth; x++) { + for (y = 0; y < mapHeight; y++) { + MapFieldCellMatrix_CellType(mapFieldCellMatrix, y, x, mapHeight, mapWidth); } } } -static void ov21_021D5248(Window *param0, u8 *param1, u16 param2, u16 param3, int param4, int param5, u8 param6, u8 param7) +static void ov21_021D5248(Window *param0, u8 *param1, u16 cellWidth, u16 cellHeight, int mapScale, int cellType, u8 yCoord, u8 xCoord) { int v0; int v1; - if (param5 != 0) { - v0 = param5 * param4; - v1 = v0 / param2; - v0 = v0 % param2; + if (cellType != 0) { + v0 = cellType * mapScale; + v1 = v0 / cellWidth; + v0 = v0 % cellWidth; - sub_0201ADDC(param0, param1, v0, v1, param2, param3, param6, param7, param4, param4); + sub_0201ADDC(param0, param1, v0, v1, cellWidth, cellHeight, yCoord, xCoord, mapScale, mapScale); } } -static void ov21_021D52A0(u8 *param0, int param1, int param2, int param3, int param4) +static void MapFieldCellMatrix_CellType(u8 *mapFieldCellMatrix, int y, int x, int mapHeight, int mapWidth) { - int v0; - int v1; + int neighbors; + int cellType; - if (param0[(param2 * param3) + param1] == 0) { - ov21_021D5304(param0, &v0, param1, param2, param3, param4); + if (mapFieldCellMatrix[(x * mapHeight) + y] == 0) { + MapFieldCellMatrix_NeighboringCells(mapFieldCellMatrix, &neighbors, y, x, mapHeight, mapWidth); - v1 = ov21_021D5424(v0); - param0[(param2 * param3) + param1] = v1; + cellType = MapFieldCellMatrix_EmptyCellType(neighbors); + mapFieldCellMatrix[(x * mapHeight) + y] = cellType; } } -static int ov21_021D52D4(u8 *param0, int param1, int param2, int param3, int param4) +static int MapFieldCellMatrix_Value(u8 *mapFieldCellMatrix, int y, int x, int mapHeight, int mapWidth) { - if ((param1 < 0) || (param1 >= param3)) { + if ((y < 0) || (y >= mapHeight)) { return -1; } - if ((param2 < 0) || (param2 >= param4)) { + if ((x < 0) || (x >= mapWidth)) { return -1; } - return param0[(param2 * param3) + param1]; + return mapFieldCellMatrix[(x * mapHeight) + y]; } -static void ov21_021D5304(u8 *param0, int *param1, int param2, int param3, int param4, int param5) +static void MapFieldCellMatrix_NeighboringCells(u8 *mapFieldCellMatrix, int *neighbors, int y, int x, int mapHeight, int mapWidth) { int v0; - *param1 = 0; + *neighbors = 0; // binary storage of cells (NE)(SE)(NW)(SW)(N)(S)(E)(W) + // only records intercardinal directions if adjacent cardinals are both empty - if (ov21_021D52D4(param0, param2, param3 - 1, param4, param5) == 1) { - *param1 |= (1 << 0); + if (MapFieldCellMatrix_Value(mapFieldCellMatrix, y, x - 1, mapHeight, mapWidth) == 1) { + *neighbors |= CN_WEST; } - if (ov21_021D52D4(param0, param2, param3 + 1, param4, param5) == 1) { - *param1 |= (1 << 1); + if (MapFieldCellMatrix_Value(mapFieldCellMatrix, y, x + 1, mapHeight, mapWidth) == 1) { + *neighbors |= CN_EAST; } - if (ov21_021D52D4(param0, param2 - 1, param3, param4, param5) == 1) { - *param1 |= (1 << 2); + if (MapFieldCellMatrix_Value(mapFieldCellMatrix, y - 1, x, mapHeight, mapWidth) == 1) { + *neighbors |= CN_SOUTH; } - if (ov21_021D52D4(param0, param2 + 1, param3, param4, param5) == 1) { - *param1 |= (1 << 3); + if (MapFieldCellMatrix_Value(mapFieldCellMatrix, y + 1, x, mapHeight, mapWidth) == 1) { + *neighbors |= CN_NORTH; } - if ((((*param1) & (1 << 0)) == 0) && (((*param1) & (1 << 2)) == 0)) { - if (ov21_021D52D4(param0, param2 - 1, param3 - 1, param4, param5) == 1) { - *param1 |= (1 << 4); + if ((((*neighbors) & CN_WEST) == 0) && (((*neighbors) & CN_SOUTH) == 0)) { + if (MapFieldCellMatrix_Value(mapFieldCellMatrix, y - 1, x - 1, mapHeight, mapWidth) == 1) { + *neighbors |= CN_SOUTHWEST; } } - if ((((*param1) & (1 << 0)) == 0) && (((*param1) & (1 << 3)) == 0)) { - if (ov21_021D52D4(param0, param2 + 1, param3 - 1, param4, param5) == 1) { - *param1 |= (1 << 5); + if ((((*neighbors) & CN_WEST) == 0) && (((*neighbors) & CN_NORTH) == 0)) { + if (MapFieldCellMatrix_Value(mapFieldCellMatrix, y + 1, x - 1, mapHeight, mapWidth) == 1) { + *neighbors |= CN_NORTHWEST; } } - if ((((*param1) & (1 << 1)) == 0) && (((*param1) & (1 << 2)) == 0)) { - if (ov21_021D52D4(param0, param2 - 1, param3 + 1, param4, param5) == 1) { - *param1 |= (1 << 6); + if ((((*neighbors) & CN_EAST) == 0) && (((*neighbors) & CN_SOUTH) == 0)) { + if (MapFieldCellMatrix_Value(mapFieldCellMatrix, y - 1, x + 1, mapHeight, mapWidth) == 1) { + *neighbors |= CN_SOUTHEAST; } } - if ((((*param1) & (1 << 1)) == 0) && (((*param1) & (1 << 3)) == 0)) { - if (ov21_021D52D4(param0, param2 + 1, param3 + 1, param4, param5) == 1) { - *param1 |= (1 << 7); + if ((((*neighbors) & CN_EAST) == 0) && (((*neighbors) & CN_NORTH) == 0)) { + if (MapFieldCellMatrix_Value(mapFieldCellMatrix, y + 1, x + 1, mapHeight, mapWidth) == 1) { + *neighbors |= CN_NORTHEAST; } } } -static int ov21_021D5424(int param0) +static int MapFieldCellMatrix_EmptyCellType(int neighbors) { int v0; - switch (param0) { - case 0: + switch (neighbors) { + case CN_ALONE: v0 = 0; break; - case ((1 << 0)): + case (CN_WEST): v0 = 2; break; - case ((1 << 1)): + case (CN_EAST): v0 = 3; break; - case ((1 << 2)): + case (CN_SOUTH): v0 = 4; break; - case ((1 << 3)): + case (CN_NORTH): v0 = 5; break; - case ((1 << 0) | (1 << 1)): + case (CN_WEST | CN_EAST): v0 = 6; break; - case ((1 << 0) | (1 << 2)): + case (CN_WEST | CN_SOUTH): v0 = 7; break; - case ((1 << 0) | (1 << 3)): + case (CN_WEST | CN_NORTH): v0 = 8; break; - case ((1 << 1) | (1 << 2)): + case (CN_EAST | CN_SOUTH): v0 = 9; break; - case ((1 << 1) | (1 << 3)): + case (CN_EAST | CN_NORTH): v0 = 10; break; - case ((1 << 2) | (1 << 3)): + case (CN_SOUTH | CN_NORTH): v0 = 11; break; - case ((1 << 0) | (1 << 1) | (1 << 2)): + case (CN_WEST | CN_EAST | CN_SOUTH): v0 = 12; break; - case ((1 << 0) | (1 << 1) | (1 << 3)): + case (CN_WEST | CN_EAST | CN_NORTH): v0 = 13; break; - case ((1 << 0) | (1 << 2) | (1 << 3)): + case (CN_WEST | CN_SOUTH | CN_NORTH): v0 = 14; break; - case ((1 << 1) | (1 << 2) | (1 << 3)): + case (CN_EAST | CN_SOUTH | CN_NORTH): v0 = 15; break; - case ((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3)): + case (CN_WEST | CN_EAST | CN_SOUTH | CN_NORTH): v0 = 16; break; - case ((1 << 4)): + case (CN_SOUTHWEST): v0 = 17; break; - case ((1 << 5)): + case (CN_NORTHWEST): v0 = 18; break; - case ((1 << 6)): + case (CN_SOUTHEAST): v0 = 19; break; - case ((1 << 7)): + case (CN_NORTHEAST): v0 = 20; break; - case ((1 << 4) | (1 << 5)): + case (CN_SOUTHWEST | CN_NORTHWEST): v0 = 21; break; - case ((1 << 4) | (1 << 6)): + case (CN_SOUTHWEST | CN_SOUTHEAST): v0 = 22; break; - case ((1 << 4) | (1 << 7)): + case (CN_SOUTHWEST | CN_NORTHEAST): v0 = 23; break; - case ((1 << 5) | (1 << 6)): + case (CN_NORTHWEST | CN_SOUTHEAST): v0 = 24; break; - case ((1 << 5) | (1 << 7)): + case (CN_NORTHWEST | CN_NORTHEAST): v0 = 25; break; - case ((1 << 6) | (1 << 7)): + case (CN_SOUTHEAST | CN_NORTHEAST): v0 = 26; break; - case ((1 << 4) | (1 << 5) | (1 << 6)): + case (CN_SOUTHWEST | CN_NORTHWEST | CN_SOUTHEAST): v0 = 27; break; - case ((1 << 4) | (1 << 5) | (1 << 7)): + case (CN_SOUTHWEST | CN_NORTHWEST | CN_NORTHEAST): v0 = 28; break; - case ((1 << 4) | (1 << 6) | (1 << 7)): + case (CN_SOUTHWEST | CN_SOUTHEAST | CN_NORTHEAST): v0 = 29; break; - case ((1 << 5) | (1 << 6) | (1 << 7)): + case (CN_NORTHWEST | CN_SOUTHEAST | CN_NORTHEAST): v0 = 30; break; - case ((1 << 4) | (1 << 5) | (1 << 6) | (1 << 7)): + case (CN_SOUTHWEST | CN_NORTHWEST | CN_SOUTHEAST | CN_NORTHEAST): v0 = 31; break; - case ((1 << 0) | (1 << 6) | (1 << 7)): + case (CN_WEST | CN_SOUTHEAST | CN_NORTHEAST): v0 = 32; break; - case ((1 << 1) | (1 << 4) | (1 << 5)): + case (CN_EAST | CN_SOUTHWEST | CN_NORTHWEST): v0 = 33; break; - case ((1 << 2) | (1 << 5) | (1 << 7)): + case (CN_SOUTH | CN_NORTHWEST | CN_NORTHEAST): v0 = 34; break; - case ((1 << 3) | (1 << 4) | (1 << 6)): + case (CN_NORTH | CN_SOUTHWEST | CN_SOUTHEAST): v0 = 35; break; - case ((1 << 0) | (1 << 2) | (1 << 7)): + case (CN_WEST | CN_SOUTH | CN_NORTHEAST): v0 = 36; break; - case ((1 << 0) | (1 << 3) | (1 << 6)): + case (CN_WEST | CN_NORTH | CN_SOUTHEAST): v0 = 37; break; - case ((1 << 1) | (1 << 2) | (1 << 5)): + case (CN_EAST | CN_SOUTH | CN_NORTHWEST): v0 = 38; break; - case ((1 << 1) | (1 << 3) | (1 << 4)): + case (CN_EAST | CN_NORTH | CN_SOUTHWEST): v0 = 39; break; - case ((1 << 0) | (1 << 6)): + case (CN_WEST | CN_SOUTHEAST): v0 = 40; break; - case ((1 << 0) | (1 << 7)): + case (CN_WEST | CN_NORTHEAST): v0 = 41; break; - case ((1 << 1) | (1 << 4)): + case (CN_EAST | CN_SOUTHWEST): v0 = 42; break; - case ((1 << 1) | (1 << 5)): + case (CN_EAST | CN_NORTHWEST): v0 = 43; break; - case ((1 << 2) | (1 << 5)): + case (CN_SOUTH | CN_NORTHWEST): v0 = 44; break; - case ((1 << 2) | (1 << 7)): + case (CN_SOUTH | CN_NORTHEAST): v0 = 45; break; - case ((1 << 3) | (1 << 4)): + case (CN_NORTH | CN_SOUTHWEST): v0 = 46; break; - case ((1 << 3) | (1 << 6)): + case (CN_NORTH | CN_SOUTHEAST): v0 = 47; break; default: diff --git a/src/overlay021/ov21_021D57B4.c b/src/overlay021/ov21_021D57B4.c index 9871dd806d..f4b94e9387 100644 --- a/src/overlay021/ov21_021D57B4.c +++ b/src/overlay021/ov21_021D57B4.c @@ -3,127 +3,129 @@ #include #include +#include "constants/species.h" + +#include "overlay021/struct_dungeoncoordinates.h" +#include "overlay021/struct_fieldCoordinates.h" #include "overlay021/struct_ov21_021D5844.h" -#include "overlay021/struct_ov21_021D5868.h" -#include "overlay021/struct_ov21_021D5890.h" #include "cell_actor.h" #include "heap.h" #include "narc.h" #include "unk_02006E3C.h" -void ov21_021D57B4(pokedexEncStruct *dexEncData, int species, int param2, int heapID) +void PokedexEncData_PopulateMapsEncounteredOn(mapsEncounteredOn *mapsEncOn, int species, int encounterCategory, int heapID) { - int v0; + int fileIndex; u32 fileSize; - switch (param2) { - case 0: // category 0, morning - v0 = 4; + switch (encounterCategory) { + case PEFC_DUNGEONMORNING: + fileIndex = PEFI_DUNGEONMORNING; break; - case 1: // category 0, day - v0 = 499; + case PEFC_DUNGEONDAY: + fileIndex = PEFI_DUNGEONDAY; break; - case 2: // category 0, night - v0 = 994; + case PEFC_DUNGEONNIGHT: + fileIndex = PEFI_DUNGEONNIGHT; break; - case 3: // category 2, regional - v0 = 1489; + case PEFC_DUNGEONSPECIAL: + fileIndex = PEFI_DUNGEONSPECIAL; break; - case 4: // category 2, national - v0 = 1984; + case PEFC_DUNGEONSPECIALNATDEX: + fileIndex = PEFI_DUNGEONSPECIALNATDEX; break; - case 5: // category 1, morning - v0 = 2479; + case PEFC_FIELDMORNING: + fileIndex = PEFI_FIELDMORNING; break; - case 6: // category 1, day - v0 = 2974; + case PEFC_FIELDDAY: + fileIndex = PEFI_FIELDDAY; break; - case 7: // category 1, night - v0 = 3469; + case PEFC_FIELDNIGHT: + fileIndex = PEFI_FIELDNIGHT; break; - case 8: // category 3, regional - v0 = 3964; + case PEFC_FIELDSPECIAL: + fileIndex = PEFI_FIELDSPECIAL; break; - case 9: // category 3, national - v0 = 4459; + case PEFC_FIELDSPECIALNATDEX: + fileIndex = PEFI_FIELDSPECIALNATDEX; break; } - dexEncData->pokedexEncArray = (int *)sub_02007068(NARC_INDEX_APPLICATION__ZUKANLIST__ZKN_DATA__ZUKAN_ENC_PLATINUM, v0 + species, 0, heapID, 0, &fileSize); - dexEncData->pokedexEncLength = fileSize / sizeof(int); + mapsEncOn->mapsEncounteredOnArray = (int *)sub_02007068(NARC_INDEX_APPLICATION__ZUKANLIST__ZKN_DATA__ZUKAN_ENC_PLATINUM, fileIndex + species, 0, heapID, 0, &fileSize); + mapsEncOn->numMapsEncounteredOn = fileSize / sizeof(int); } -void Free_pokedexEncData(pokedexEncStruct *dexEncData) +void PokedexEncData_FreeMapsEncounteredOn(mapsEncounteredOn *mapsEncOn) { - GF_ASSERT(dexEncData); - GF_ASSERT(dexEncData->pokedexEncArray); + GF_ASSERT(mapsEncOn); + GF_ASSERT(mapsEncOn->mapsEncounteredOnArray); - Heap_FreeToHeap(dexEncData->pokedexEncArray); + Heap_FreeToHeap(mapsEncOn->mapsEncounteredOnArray); - dexEncData->pokedexEncArray = NULL; - dexEncData->pokedexEncLength = 0; + mapsEncOn->mapsEncounteredOnArray = NULL; + mapsEncOn->numMapsEncounteredOn = 0; } -UnkStruct_ov21_021D5868 *ov21_021D5868(int heapID, int *param1) +dungeonCoordinates *PokedexEncData_GetDungeonLocations(int heapID, int *numDungeons) { - UnkStruct_ov21_021D5868 *v0; + dungeonCoordinates *dungeonCoordinatesArray; u32 fileSize; - v0 = (UnkStruct_ov21_021D5868 *)sub_02007068(NARC_INDEX_APPLICATION__ZUKANLIST__ZKN_DATA__ZUKAN_ENC_PLATINUM, 0, 0, heapID, 0, &fileSize); + dungeonCoordinatesArray = (dungeonCoordinates *)sub_02007068(NARC_INDEX_APPLICATION__ZUKANLIST__ZKN_DATA__ZUKAN_ENC_PLATINUM, 0, 0, heapID, 0, &fileSize); - if (param1) { - *param1 = fileSize / sizeof(UnkStruct_ov21_021D5868); + if (numDungeons) { + *numDungeons = fileSize / sizeof(dungeonCoordinates); } - return v0; + return dungeonCoordinatesArray; } -UnkStruct_ov21_021D5890 *ov21_021D5890(int heapID, int *param1) +fieldCoordinates *PokedexEncData_GetFieldLocations(int heapID, int *numFields) { - UnkStruct_ov21_021D5890 *v0; + fieldCoordinates *fieldCoordinatesArray; u32 fileSize; - v0 = (UnkStruct_ov21_021D5890 *)sub_02007068(NARC_INDEX_APPLICATION__ZUKANLIST__ZKN_DATA__ZUKAN_ENC_PLATINUM, 2, 0, heapID, 0, &fileSize); + fieldCoordinatesArray = (fieldCoordinates *)sub_02007068(NARC_INDEX_APPLICATION__ZUKANLIST__ZKN_DATA__ZUKAN_ENC_PLATINUM, 2, 0, heapID, 0, &fileSize); - if (param1) { - *param1 = fileSize / sizeof(UnkStruct_ov21_021D5890); + if (numFields) { + *numFields = fileSize / sizeof(fieldCoordinates); } - return v0; + return fieldCoordinatesArray; } -void ov21_021D58C0(u8 *param0, u8 param1, u8 param2, const UnkStruct_ov21_021D5890 *param3) +void ov21_021D58C0(u8 *mapFieldCellMatrix, u8 mapHeight, u8 mapWidth, const fieldCoordinates *fieldCoords) { - int outerIndex, innerIndex; + int xCoord, yCoord; - GF_ASSERT((param3->unk_01 + param3->unk_03) < param2); // param 1 and 2 are 30 - GF_ASSERT((param3->unk_00 + param3->unk_02) < param1); + GF_ASSERT((fieldCoords->xCoordinate + fieldCoords->width) < mapWidth); // param 1 and 2 are 30 + GF_ASSERT((fieldCoords->yCoordinate + fieldCoords->height) < mapHeight); - for (outerIndex = param3->unk_01; outerIndex < param3->unk_01 + param3->unk_03; outerIndex++) { - for (innerIndex = param3->unk_00; innerIndex < param3->unk_00 + param3->unk_02; innerIndex++) { - param0[(outerIndex * param1) + innerIndex] |= param3->unk_04[((outerIndex - param3->unk_01) * param3->unk_02) + (innerIndex - param3->unk_00)]; + for (xCoord = fieldCoords->xCoordinate; xCoord < fieldCoords->xCoordinate + fieldCoords->width; xCoord++) { + for (yCoord = fieldCoords->yCoordinate; yCoord < fieldCoords->yCoordinate + fieldCoords->height; yCoord++) { + mapFieldCellMatrix[(xCoord * mapHeight) + yCoord] |= fieldCoords->cellMatrix[((xCoord - fieldCoords->xCoordinate) * fieldCoords->height) + (yCoord - fieldCoords->yCoordinate)]; } } } -u32 ov21_021D5948(u8 *param0, int param1, int param2, const UnkStruct_ov21_021D5890 *param3, const pokedexEncStruct *dexEncData, const u8 *param5, u32 param6) +u32 ov21_021D5948(u8 *mapFieldCellMatrix, int mapHeight, int mapWidth, const fieldCoordinates *fieldCoordArray, const mapsEncounteredOn *mapsEncOn, const u8 *mapArray, u32 mapArrayLength) { - int pokedexEncIndex; - int v1; + int index; + int mapArrayIndex; u32 v2 = 0; - for (pokedexEncIndex = 0; pokedexEncIndex < dexEncData->pokedexEncLength - 1; pokedexEncIndex++) { - GF_ASSERT(dexEncData->pokedexEncArray[pokedexEncIndex]); + for (index = 0; index < mapsEncOn->numMapsEncounteredOn - 1; index++) { + GF_ASSERT(mapsEncOn->mapsEncounteredOnArray[index]); - for (v1 = 0; v1 < param6; v1++) { - if (dexEncData->pokedexEncArray[pokedexEncIndex] == param5[v1]) { + for (mapArrayIndex = 0; mapArrayIndex < mapArrayLength; mapArrayIndex++) { + if (mapsEncOn->mapsEncounteredOnArray[index] == mapArray[mapArrayIndex]) { break; } } - if (v1 >= param6) { - ov21_021D58C0(param0, param1, param2, ¶m3[dexEncData->pokedexEncArray[pokedexEncIndex]]); + if (mapArrayIndex >= mapArrayLength) { + ov21_021D58C0(mapFieldCellMatrix, mapHeight, mapWidth, &fieldCoordArray[mapsEncOn->mapsEncounteredOnArray[index]]); v2++; } } @@ -131,48 +133,48 @@ u32 ov21_021D5948(u8 *param0, int param1, int param2, const UnkStruct_ov21_021D5 return v2; } -void ov21_021D59D8(CellActor *actor, int param1, int param2, int param3, int param4, const UnkStruct_ov21_021D5868 *param5, int animID_1, int animID_2) +void ov21_021D59D8(CellActor *actor, int xOffset, int yOffset, int xScale, int yScale, const dungeonCoordinates *dungeonCoords, int animID_1, int animID_2) { VecFx32 position; - position.x = (param5->unk_00 * param3) + param1; - position.y = (param5->unk_01 * param4) + param2; + position.x = (dungeonCoords->xCoordinate * xScale) + xOffset; + position.y = (dungeonCoords->yCoordinate * yScale) + yOffset; position.x <<= FX32_SHIFT; position.y <<= FX32_SHIFT; CellActor_SetPosition(actor, &position); - if (param5->unk_02) { + if (dungeonCoords->unk_02) { CellActor_SetAnim(actor, animID_2); } else { CellActor_SetAnim(actor, animID_1); } } -int ov21_021D5A20(CellActor **param0, int param1, int param2, int param3, int param4, int param5, int param6, const UnkStruct_ov21_021D5868 *zukan_enc_plat_0, const pokedexEncStruct *dexEncData, int param9, int param10, const u8 *param11, u32 param12, u32 *param13) +int ov21_021D5A20(CellActor **cellActorArray, int initialNumDungeons, int param2, int xOffset, int yOffset, int xScale, int yScale, const dungeonCoordinates *dungeonCoordinatesArray, const mapsEncounteredOn *mapsEncOn, int animID_1, int animID_2, const u8 *mapArray, u32 mapArrayLength, u32 *param13) { - int index, v1; - int v2 = param1; + int index, mapArrayIndex; + int numDungeons = initialNumDungeons; int v3 = 0; - for (index = 0; index < dexEncData->pokedexEncLength - 1; index++) { - GF_ASSERT(dexEncData->pokedexEncArray[index]); - GF_ASSERT(v2 < param2); + for (index = 0; index < mapsEncOn->numMapsEncounteredOn - 1; index++) { + GF_ASSERT(mapsEncOn->mapsEncounteredOnArray[index]); + GF_ASSERT(numDungeons < param2); - for (v1 = 0; v1 < param12; v1++) { - if (dexEncData->pokedexEncArray[index] == param11[v1]) { + for (mapArrayIndex = 0; mapArrayIndex < mapArrayLength; mapArrayIndex++) { + if (mapsEncOn->mapsEncounteredOnArray[index] == mapArray[mapArrayIndex]) { break; } } - if (v1 >= param12) { - ov21_021D59D8(param0[v2], param3, param4, param5, param6, &zukan_enc_plat_0[dexEncData->pokedexEncArray[index]], param9, param10); - v2++; + if (mapArrayIndex >= mapArrayLength) { + ov21_021D59D8(cellActorArray[numDungeons], xOffset, yOffset, xScale, yScale, &dungeonCoordinatesArray[mapsEncOn->mapsEncounteredOnArray[index]], animID_1, animID_2); + numDungeons++; v3++; } } *param13 = v3; - return v2; + return numDungeons; } diff --git a/src/overlay021/ov21_021D5AEC.c b/src/overlay021/ov21_021D5AEC.c index e80a7ca8e0..792d409249 100644 --- a/src/overlay021/ov21_021D5AEC.c +++ b/src/overlay021/ov21_021D5AEC.c @@ -16,7 +16,6 @@ #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" @@ -24,6 +23,7 @@ #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" +#include "overlay021/struct_speciesCaughtStatus.h" #include "cell_actor.h" #include "core_sys.h" @@ -871,7 +871,7 @@ static void ov21_021D67EC(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13 int v3; UnkStruct_ov21_021D4CB8 v4; Window *v5; - const speciesCaughtStatusStruct *speciesCaughtStatus; + const speciesCaughtStatus *pokeCaughtStatus; int dexIndex; v4.unk_00 = param1->unk_14C; @@ -898,8 +898,8 @@ static void ov21_021D67EC(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13 dexIndex = Pokedex_Sort_SeenIndexToSpecies(param2->unk_04, v1); if (dexIndex != (NATIONAL_DEX_COUNT + 1)) { - speciesCaughtStatus = Pokedex_Sort_SpeciesCaughtStatus(param2->unk_04, dexIndex); - v5 = ov21_021D16D8(param1, param2->unk_04, param3, speciesCaughtStatus->species); + pokeCaughtStatus = Pokedex_Sort_SpeciesCaughtStatus(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); @@ -919,11 +919,11 @@ static void ov21_021D68C8(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13 { int dexIndex; int v1; - const speciesCaughtStatusStruct *speciesCaughtStatus; + const speciesCaughtStatus *pokeCaughtStatus; v1 = ov21_021D3898(param2->unk_04); dexIndex = ov21_021D375C(param2->unk_04); - speciesCaughtStatus = Pokedex_Sort_SpeciesCaughtStatus(param2->unk_04, dexIndex); + pokeCaughtStatus = Pokedex_Sort_SpeciesCaughtStatus(param2->unk_04, dexIndex); if (Pokedex_Sort_SeenIndexToSpecies(param2->unk_04, v1) == (NATIONAL_DEX_COUNT + 1)) { ov21_021D217C(param1, 0); @@ -932,7 +932,7 @@ static void ov21_021D68C8(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13 CellActor_SetDrawFlag(param0->unk_7C, 1); } } else { - ov21_021D1890(param1, param2->unk_04, speciesCaughtStatus->species, 2, 56, 80); + ov21_021D1890(param1, param2->unk_04, pokeCaughtStatus->species, 2, 56, 80); ov21_021D217C(param1, 1); if (param0->unk_7C) { @@ -1085,7 +1085,7 @@ static void ov21_021D6AE4(UnkStruct_ov21_021D71A8 *param0, const UnkStruct_ov21_ int v5; int v6; int v7; - const speciesCaughtStatusStruct *speciesCaughtStatus; + const speciesCaughtStatus *pokeCaughtStatus; int v9; int v10; int dexIndex; @@ -1103,9 +1103,9 @@ static void ov21_021D6AE4(UnkStruct_ov21_021D71A8 *param0, const UnkStruct_ov21_ dexIndex = Pokedex_Sort_SeenIndexToSpecies(param1->unk_04, v5); if (dexIndex != (NATIONAL_DEX_COUNT + 1)) { - speciesCaughtStatus = Pokedex_Sort_SpeciesCaughtStatus(param1->unk_04, dexIndex); + pokeCaughtStatus = Pokedex_Sort_SpeciesCaughtStatus(param1->unk_04, dexIndex); - if (speciesCaughtStatus->caughtStatus == 2) { + if (pokeCaughtStatus->caughtStatus == CS_CAUGHT) { isCaught = 1; } } @@ -1256,10 +1256,10 @@ static void ov21_021D6D78(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13 { UnkStruct_ov21_021D4CB8 v0; Window *v1; - const speciesCaughtStatusStruct *speciesCaughtStatus; + const speciesCaughtStatus *pokeCaughtStatus; - speciesCaughtStatus = Pokedex_Sort_SpeciesCaughtStatus(param2->unk_04, dexIndex); - GF_ASSERT(speciesCaughtStatus); + pokeCaughtStatus = Pokedex_Sort_SpeciesCaughtStatus(param2->unk_04, dexIndex); + GF_ASSERT(pokeCaughtStatus); v0.unk_00 = param1->unk_14C; v0.unk_08 = param0->unk_90.paletteProxy; @@ -1271,7 +1271,7 @@ static void ov21_021D6D78(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13 v0.unk_20 = NNS_G2D_VRAM_TYPE_2DMAIN; v0.unk_24 = param3; - v1 = ov21_021D16D8(param1, param2->unk_04, param3, speciesCaughtStatus->species); + v1 = ov21_021D16D8(param1, param2->unk_04, param3, pokeCaughtStatus->species); if (param0->unk_28[param4]) { ov21_021D4D1C(param0->unk_28[param4]); diff --git a/src/overlay021/ov21_021DC9BC.c b/src/overlay021/ov21_021DC9BC.c index 29331e8dee..1242fd3262 100644 --- a/src/overlay021/ov21_021DC9BC.c +++ b/src/overlay021/ov21_021DC9BC.c @@ -14,6 +14,8 @@ #include "overlay021/ov21_021D57B4.h" #include "overlay021/ov21_021E29DC.h" #include "overlay021/pokedex_sort.h" +#include "overlay021/struct_dungeoncoordinates.h" +#include "overlay021/struct_fieldCoordinates.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D2648.h" @@ -21,8 +23,6 @@ #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" @@ -39,7 +39,7 @@ #include "unk_02018340.h" #include "unk_0201F834.h" -static const u16 Unk_ov21_021E9D78[] = { +static const u16 extraFieldsStructFlag_1[] = { 0xffff }; @@ -47,7 +47,7 @@ static const u16 Unk_ov21_021E9D76[] = { 0xffff }; -static const u16 Unk_ov21_021E9D74[] = { +static const u16 extraFieldsStructFlag_4[] = { 0xffff }; @@ -55,7 +55,7 @@ static const u16 Unk_ov21_021E9D72[] = { 0xffff }; -static const u16 Unk_ov21_021E9D70[] = { +static const u16 extraFieldsStructFlag_2[] = { 0xffff }; @@ -63,7 +63,7 @@ static const u16 Unk_ov21_021E9D6E[] = { 0xffff }; -static const u16 Unk_ov21_021E9D6C[] = { +static const u16 extraFieldsStructFlag_3[] = { 0xffff }; @@ -94,33 +94,33 @@ typedef struct { typedef struct { int encounterTime; - u8 *unk_04; - u8 *unk_08; - u32 heapSize; - u32 unk_10; - pokedexEncStruct dexEnc0; - pokedexEncStruct dexEnc1; - pokedexEncStruct dexEnc2; - pokedexEncStruct dexEnc3; -} UnkStruct_ov21_021DDABC; + u8 *extraFields; + u8 *extraDungeons; + u32 numExtraFields; + u32 numExtraDungeons; + mapsEncounteredOn dungeonsEncounteredOn; + mapsEncounteredOn fieldsEncounteredOn; + mapsEncounteredOn dungeonSpecialEncounters; + mapsEncounteredOn fieldSpecialEncounters; +} encounterCollection; typedef struct { int encounterTime; - CellActor *unk_04[44]; + CellActor *cellActorArray[44]; SpriteResource *unk_B4[4]; - int unk_C4; + int numDungeons; CellActor *unk_C8; UnkStruct_ov21_021D4CA0 *unk_CC; SpriteResource *unk_D0[4]; UnkStruct_ov21_021D4CA0 *unk_E0[3]; - u8 unk_EC[900]; - u8 unk_470[900]; + u8 mapFieldCellMatrix_1[POKEDEXMAPNUMCELLS]; + u8 mapFieldCellMatrix_2[POKEDEXMAPNUMCELLS]; void *unk_7F4; NNSG2dCharacterData *unk_7F8; void *unk_7FC; NNSG2dCharacterData *unk_800; - UnkStruct_ov21_021D5868 *zukan_enc_plat_0; - UnkStruct_ov21_021D5890 *zukan_enc_plat_2; + dungeonCoordinates *dungeonCoordinatesArray; + fieldCoordinates *fieldCoordinatesArray; int unk_80C; int unk_810; UnkStruct_ov21_021D2648 unk_814; @@ -128,7 +128,7 @@ typedef struct { u32 unk_838; u32 unk_83C; u32 unk_840; -} UnkStruct_ov21_021DD420; +} PokedexMapDisplay; static UnkStruct_ov21_021DCACC *ov21_021DCA5C(int heapID, UnkStruct_ov21_021D0F60 *param1); static UnkStruct_ov21_021DCAE0 *ov21_021DCAA0(int param0, UnkStruct_ov21_021D0F60 *param1); @@ -142,36 +142,36 @@ 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); 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 ov21_021DD420(PokedexMapDisplay *mapDisplay); +static void ov21_021DD458(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 *enCollection, 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 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 param2); +static void ov21_021DD2B8(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 *enCollection); +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 *enCollection, int param4); +static void ov21_021DD710(PokedexMapDisplay *mapDisplay, const UnkStruct_ov21_021DCACC *param1, const encounterCollection *enCollection, int param3); +static void ov21_021DD8B4(PokedexMapDisplay *mapDisplay); static u8 *ov21_021DD900(u32 heapID, const UnkStruct_ov21_021DCACC *param1, u32 *param2); static u8 *ov21_021DD908(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 *param2); -static void ov21_021DD964(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCAE0 *param1); -static void ov21_021DDB8C(UnkStruct_ov21_021DD420 *param0); -static void ov21_021DDBCC(UnkStruct_ov21_021DD420 *param0); -static void ov21_021DDC14(UnkStruct_ov21_021DD420 *param0); -static void ov21_021DDABC(UnkStruct_ov21_021DDABC *param0, UnkStruct_ov21_021DCACC *param1, int heapID); -static void ov21_021DDB68(UnkStruct_ov21_021DDABC *param0); +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 ov21_021DDABC(encounterCollection *enCollection, UnkStruct_ov21_021DCACC *param1, int heapID); +static void ov21_021DDB68(encounterCollection *enCollection); void ov21_021DC9BC(UnkStruct_ov21_021E68F4 *param0, UnkStruct_ov21_021D0F60 *param1, int heapID) { @@ -280,17 +280,17 @@ static int ov21_021DCAF4(void) return 0; } -static int ov21_021DCAF8(UnkStruct_ov21_021E6A68 *param0, void *param1) // dansim +static int ov21_021DCAF8(UnkStruct_ov21_021E6A68 *param0, void *param1) { UnkStruct_ov21_021DCACC *v0 = param1; - UnkStruct_ov21_021DDABC *v1; + encounterCollection *encCollection; - v1 = Heap_AllocFromHeap(param0->heapID, sizeof(UnkStruct_ov21_021DDABC)); + encCollection = Heap_AllocFromHeap(param0->heapID, sizeof(encounterCollection)); - GF_ASSERT(v1); - memset(v1, 0, sizeof(UnkStruct_ov21_021DDABC)); + GF_ASSERT(encCollection); + memset(encCollection, 0, sizeof(encounterCollection)); - param0->unk_08 = v1; + param0->unk_08 = encCollection; if (v0->pokedexS->timeOfDay == TOD_MORNING) { v0->encounterTime = ENCTIME_MORNING; @@ -302,12 +302,12 @@ static int ov21_021DCAF8(UnkStruct_ov21_021E6A68 *param0, void *param1) // dansi } } - v1->unk_04 = ov21_021DD900(param0->heapID, v0, &v1->heapSize); - v1->unk_08 = ov21_021DD908(param0->heapID, v0, &v1->unk_10); + encCollection->extraFields = ov21_021DD900(param0->heapID, v0, &encCollection->numExtraFields); + encCollection->extraDungeons = ov21_021DD908(param0->heapID, v0, &encCollection->numExtraDungeons); - ov21_021DDABC(v1, v0, param0->heapID); + ov21_021DDABC(encCollection, v0, param0->heapID); - v1->encounterTime = v0->encounterTime; + encCollection->encounterTime = v0->encounterTime; return 1; } @@ -315,7 +315,7 @@ static int ov21_021DCAF8(UnkStruct_ov21_021E6A68 *param0, void *param1) // dansi static int ov21_021DCB6C(UnkStruct_ov21_021E6A68 *param0, void *param1) { UnkStruct_ov21_021DCACC *v0 = param1; - UnkStruct_ov21_021DDABC *v1 = param0->unk_08; + encounterCollection *encCollection = param0->unk_08; if (param0->unk_0C == 1) { return 1; @@ -325,10 +325,10 @@ static int ov21_021DCB6C(UnkStruct_ov21_021E6A68 *param0, void *param1) return 0; } - if (v1->encounterTime != v0->encounterTime) { - ov21_021DDB68(v1); - ov21_021DDABC(v1, v0, param0->heapID); - v1->encounterTime = v0->encounterTime; + if (encCollection->encounterTime != v0->encounterTime) { + ov21_021DDB68(encCollection); + ov21_021DDABC(encCollection, v0, param0->heapID); + encCollection->encounterTime = v0->encounterTime; } return 0; @@ -336,18 +336,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 *enCollection = param0->unk_08; - if (v0->unk_04) { - Heap_FreeToHeap(v0->unk_04); + if (enCollection->extraFields) { + Heap_FreeToHeap(enCollection->extraFields); } - if (v0->unk_08) { - Heap_FreeToHeap(v0->unk_08); + if (enCollection->extraDungeons) { + Heap_FreeToHeap(enCollection->extraDungeons); } - ov21_021DDB68(v0); - Heap_FreeToHeap(v0); + ov21_021DDB68(enCollection); + Heap_FreeToHeap(enCollection); param0->unk_08 = NULL; @@ -357,43 +357,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 *encCollection = 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->heapID, 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->encounterTime = v0->encounterTime; - v3->zukan_enc_plat_0 = ov21_021D5868(param1->heapID, NULL); - v3->zukan_enc_plat_2 = ov21_021D5890(param1->heapID, NULL); + mapDisplay = param1->unk_08; + mapDisplay->encounterTime = v0->encounterTime; + mapDisplay->dungeonCoordinatesArray = PokedexEncData_GetDungeonLocations(param1->heapID, NULL); + mapDisplay->fieldCoordinatesArray = PokedexEncData_GetFieldLocations(param1->heapID, NULL); param1->unk_00++; break; case 1: - ov21_021DCDD0(v3, v2, v0, v1, param1->heapID); - ov21_021DD710(param1->unk_08, v0, v1, param1->heapID); - ov21_021DD9E8(param1->unk_08, v1); - ov21_021DDB8C(v3); - ov21_021DD964(v3, v2); + ov21_021DCDD0(mapDisplay, v2, v0, encCollection, param1->heapID); + ov21_021DD710(param1->unk_08, v0, encCollection, param1->heapID); + ov21_021DD9E8(param1->unk_08, encCollection); + 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) { @@ -401,7 +401,7 @@ static int ov21_021DCBD8(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo } break; case 3: - ov21_021DDBCC(v3); + ov21_021DDBCC(mapDisplay); return 1; } @@ -411,12 +411,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 *encCollection = 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->heapID); + ov21_021DDC14(mapDisplay); + ov21_021DDA80(mapDisplay, v2, v0, encCollection, param1->heapID); return 0; } @@ -424,28 +424,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 *encCollection = 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) { @@ -453,14 +453,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->zukan_enc_plat_0); - Heap_FreeToHeap(v3->zukan_enc_plat_2); + Heap_FreeToHeap(mapDisplay->dungeonCoordinatesArray); + Heap_FreeToHeap(mapDisplay->fieldCoordinatesArray); Heap_FreeToHeap(param1->unk_08); param1->unk_08 = NULL; param1->unk_00++; @@ -472,23 +472,23 @@ 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 *enCollection, int param4) { 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->encounterTime); + ov21_021DD668(mapDisplay, param1, param4); + ov21_021DCFC8(mapDisplay, param1, param4); + ov21_021DD1A8(mapDisplay, param1, param4); + ov21_021DD2E0(mapDisplay, param1, param2, param4); + 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); + ov21_021DD2B8(mapDisplay); + ov21_021DD114(mapDisplay, param1); } static void ov21_021DCE40(UnkStruct_ov21_021DCAE0 *param0, const UnkStruct_ov21_021DCACC *param1, int param2) @@ -534,49 +534,49 @@ static void ov21_021DCE40(UnkStruct_ov21_021DCAE0 *param0, const UnkStruct_ov21_ sub_0201C3C0(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 param2) { 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, param2); - 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, param2); + mapDisplay->unk_B4[3] = SpriteResourceCollection_AddFrom(v0->unk_13C[3], v1, 107, 1, 107 + 6000, 3, param2); + mapDisplay->unk_D0[0] = SpriteResourceCollection_AddTilesFrom(v0->unk_13C[0], v1, 93, 1, 93 + 6000, NNS_G2D_VRAM_TYPE_2DMAIN, param2); - 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, param2); - 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, param2); + mapDisplay->unk_D0[3] = SpriteResourceCollection_AddFrom(v0->unk_13C[3], v1, 92, 1, 92 + 6000, 3, param2); } -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 param2) { CellActorResourceData v0; CellActorInitParams v1; @@ -593,9 +593,9 @@ static void ov21_021DD1A8(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCA v1.position.x = 160 * FX32_ONE; v1.position.y = 96 * FX32_ONE; - param0->unk_C8 = CellActorCollection_Add(&v1); + mapDisplay->unk_C8 = CellActorCollection_Add(&v1); - CellActor_SetAnim(param0->unk_C8, 2); + CellActor_SetAnim(mapDisplay->unk_C8, 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; @@ -607,26 +607,26 @@ static void ov21_021DD1A8(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCA 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); + 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 ov21_021DD2B8(PokedexMapDisplay *mapDisplay) { int v0; - CellActor_Delete(param0->unk_C8); - param0->unk_C8 = NULL; + CellActor_Delete(mapDisplay->unk_C8); + mapDisplay->unk_C8 = NULL; for (v0 = 0; v0 < (22 * 2); v0++) { - CellActor_Delete(param0->unk_04[v0]); - param0->unk_04[v0] = NULL; + CellActor_Delete(mapDisplay->cellActorArray[v0]); + mapDisplay->cellActorArray[v0] = 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 enCollection) { Window *v0; UnkStruct_ov21_021D4CB8 v1; @@ -636,7 +636,7 @@ static void ov21_021DD2E0(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCA int v5; u32 v6; - GF_ASSERT(param0->unk_C8); + GF_ASSERT(mapDisplay->unk_C8); v2 = SpriteResourceCollection_Find(param1->unk_00->unk_13C[1], 14 + 6000); @@ -645,20 +645,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.unk_24 = enCollection; 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->unk_C8; v1.unk_10 = -(v6 / 2); v1.unk_14 = -8; - param0->unk_CC = ov21_021D4CA0(&v1); + mapDisplay->unk_CC = ov21_021D4CA0(&v1); - sub_02012A60(param0->unk_CC->unk_00, v4 + 2); + sub_02012A60(mapDisplay->unk_CC->unk_00, v4 + 2); ov21_021D4DA0(v0); for (v5 = 0; v5 < 3; v5++) { @@ -670,51 +670,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->unk_CC); 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 ov21_021DD420(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->unk_C8, GX_OAM_MODE_XLU); + sub_02012AF0(mapDisplay->unk_CC->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 ov21_021DD458(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->unk_C8, GX_OAM_MODE_NORMAL); + sub_02012AF0(mapDisplay->unk_CC->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); + ov21_021DD420(mapDisplay); if (ov21_021E2A54(param2->unk_08)) { if (param3) { @@ -727,7 +727,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; @@ -739,7 +739,7 @@ static BOOL ov21_021DD508(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCA if (v0) { if (param3) { - ov21_021DD458(param0); + ov21_021DD458(mapDisplay); } return 1; @@ -750,12 +750,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); + ov21_021DD420(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)) { @@ -767,14 +767,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; } @@ -793,7 +793,7 @@ static BOOL ov21_021DD5E4(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCA if (v1 == 2) { if (param3 == 1) { - ov21_021DD458(param0); + ov21_021DD458(mapDisplay); } return 1; @@ -802,441 +802,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 param2) { BGL_FillWindow(¶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, param2); + mapDisplay->unk_7FC = ov21_021D2808(param1->unk_00, 31, 1, &mapDisplay->unk_800, param2); sub_0201C2B4(¶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) { BGL_FillWindow(¶m1->unk_00->unk_04, 0); sub_02019EBC(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; sub_0201C2B4(¶m1->unk_00->unk_04, 0); } -static void ov21_021DD710(UnkStruct_ov21_021DD420 *param0, const UnkStruct_ov21_021DCACC *param1, const UnkStruct_ov21_021DDABC *param2, int heapID) +static void ov21_021DD710(PokedexMapDisplay *mapDisplay, const UnkStruct_ov21_021DCACC *param1, const encounterCollection *enCollection, int heapID) { int index, v1; int v2, v3; - int v4, v5; + int xOffset, yOffset; int species; - u8 *v7; - int heapSize; + u8 *combinedMapArray; + int numMaps; - ov21_021DD8B4(param0); + ov21_021DD8B4(mapDisplay); - param0->unk_838 = ov21_021D5948(param0->unk_EC, 30, 30, param0->zukan_enc_plat_2, ¶m2->dexEnc1, param2->unk_04, param2->heapSize); - heapSize = (param2->dexEnc1.pokedexEncLength - 1) + param2->heapSize; - v7 = Heap_AllocFromHeapAtEnd(heapID, heapSize); + mapDisplay->unk_838 = ov21_021D5948(mapDisplay->mapFieldCellMatrix_1, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH, mapDisplay->fieldCoordinatesArray, &enCollection->fieldsEncounteredOn, enCollection->extraFields, enCollection->numExtraFields); + numMaps = (enCollection->fieldsEncounteredOn.numMapsEncounteredOn - 1) + enCollection->numExtraFields; + combinedMapArray = Heap_AllocFromHeapAtEnd(heapID, numMaps); - for (index = 0; index < heapSize; index++) { - if (index < param2->heapSize) { - v7[index] = param2->unk_04[index]; + for (index = 0; index < numMaps; index++) { + if (index < enCollection->numExtraFields) { + combinedMapArray[index] = enCollection->extraFields[index]; } else { - v7[index] = param2->dexEnc1.pokedexEncArray[index - param2->heapSize]; + combinedMapArray[index] = enCollection->fieldsEncounteredOn.mapsEncounteredOnArray[index - enCollection->numExtraFields]; } } - param0->unk_840 = ov21_021D5948(param0->unk_470, 30, 30, param0->zukan_enc_plat_2, ¶m2->dexEnc3, v7, heapSize); + mapDisplay->unk_840 = ov21_021D5948(mapDisplay->mapFieldCellMatrix_2, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH, mapDisplay->fieldCoordinatesArray, &enCollection->fieldSpecialEncounters, combinedMapArray, numMaps); - Heap_FreeToHeap(v7); - ov21_021D5214(param0->unk_EC, 30, 30); - ov21_021D5214(param0->unk_470, 30, 30); + Heap_FreeToHeap(combinedMapArray); + MapFieldCellMatrix_SmoothCells(mapDisplay->mapFieldCellMatrix_1, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH); + MapFieldCellMatrix_SmoothCells(mapDisplay->mapFieldCellMatrix_2, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH); species = Pokedex_Sort_CurrentSpecies(param1->pokedexS); 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->zukan_enc_plat_0, ¶m2->dexEnc0, 2, v2, param2->unk_08, param2->unk_10, ¶m0->unk_834); + mapDisplay->numDungeons = 0; + mapDisplay->numDungeons = ov21_021D5A20(mapDisplay->cellActorArray, mapDisplay->numDungeons, (22 * 2), xOffset, yOffset, POKEDEXMAPXSCALE, POKEDEXMAPYSCALE, mapDisplay->dungeonCoordinatesArray, &enCollection->dungeonsEncounteredOn, 2, v2, enCollection->extraDungeons, enCollection->numExtraDungeons, &mapDisplay->unk_834); - heapSize = (param2->dexEnc0.pokedexEncLength - 1) + param2->unk_10; - v7 = Heap_AllocFromHeapAtEnd(heapID, heapSize); + numMaps = (enCollection->dungeonsEncounteredOn.numMapsEncounteredOn - 1) + enCollection->numExtraDungeons; + combinedMapArray = Heap_AllocFromHeapAtEnd(heapID, numMaps); - for (index = 0; index < heapSize; index++) { - if (index < param2->unk_10) { - v7[index] = param2->unk_08[index]; + for (index = 0; index < numMaps; index++) { + if (index < enCollection->numExtraDungeons) { + combinedMapArray[index] = enCollection->extraDungeons[index]; } else { - v7[index] = param2->dexEnc0.pokedexEncArray[index - param2->unk_10]; + combinedMapArray[index] = enCollection->dungeonsEncounteredOn.mapsEncounteredOnArray[index - enCollection->numExtraDungeons]; } } - param0->unk_C4 = ov21_021D5A20(param0->unk_04, param0->unk_C4, (22 * 2), v4, v5, 5, 5, param0->zukan_enc_plat_0, ¶m2->dexEnc2, 3, v3, v7, heapSize, ¶m0->unk_83C); + mapDisplay->numDungeons = ov21_021D5A20(mapDisplay->cellActorArray, mapDisplay->numDungeons, (22 * 2), xOffset, yOffset, POKEDEXMAPXSCALE, POKEDEXMAPYSCALE, mapDisplay->dungeonCoordinatesArray, &enCollection->dungeonSpecialEncounters, 3, v3, combinedMapArray, numMaps, &mapDisplay->unk_83C); - 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->mapFieldCellMatrix_1, 0, sizeof(u8) * (POKEDEXMAPHEIGHT * POKEDEXMAPWIDTH)); + memset(mapDisplay->mapFieldCellMatrix_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 heapID, const UnkStruct_ov21_021DCACC *param1, u32 *heapSize) +static u8 *ov21_021DD900(u32 heapID, const UnkStruct_ov21_021DCACC *param1, u32 *numExtraFields) { - u32 v0; - int v1; - u8 *v2; + u32 extraFieldCount; + int index; + u8 *extraFields; - v0 = 0; + extraFieldCount = 0; if (param1->pokedexS->pokedexSFlag_1 == 0) { - v1 = 0; + index = 0; - while (Unk_ov21_021E9D78[v1] != 0xffff) { - v0++; - v1++; + while (extraFieldsStructFlag_1[index] != 0xffff) { + extraFieldCount++; + index++; } } if (param1->pokedexS->pokedexSFlag_4 == 0) { - v1 = 0; + index = 0; - while (Unk_ov21_021E9D74[v1] != 0xffff) { - v0++; - v1++; + while (extraFieldsStructFlag_4[index] != 0xffff) { + extraFieldCount++; + index++; } } if (param1->pokedexS->pokedexSFlag_2 == 0) { - v1 = 0; + index = 0; - while (Unk_ov21_021E9D70[v1] != 0xffff) { - v0++; - v1++; + while (extraFieldsStructFlag_2[index] != 0xffff) { + extraFieldCount++; + index++; } } if (param1->pokedexS->pokedexSFlag_3 == 0) { - v1 = 0; + index = 0; - while (Unk_ov21_021E9D6C[v1] != 0xffff) { - v0++; - v1++; + while (extraFieldsStructFlag_3[index] != 0xffff) { + extraFieldCount++; + index++; } } - if (v0 > 0) { - v2 = Heap_AllocFromHeap(heapID, sizeof(u8) * v0); + if (extraFieldCount > 0) { + extraFields = Heap_AllocFromHeap(heapID, sizeof(u8) * extraFieldCount); } else { - v2 = NULL; + extraFields = NULL; } - *heapSize = v0; + *numExtraFields = extraFieldCount; + + extraFieldCount = 0; if (param1->pokedexS->pokedexSFlag_1 == 0) { - v1 = 0; + index = 0; - while (Unk_ov21_021E9D78[v1] != 0xffff) { - v2[v1] = Unk_ov21_021E9D78[v1]; - v0++; - v1++; + while (extraFieldsStructFlag_1[index] != 0xffff) { + extraFields[extraFieldCount] = extraFieldsStructFlag_1[index]; + extraFieldCount++; + index++; } } if (param1->pokedexS->pokedexSFlag_4 == 0) { - v1 = 0; + index = 0; - while (Unk_ov21_021E9D74[v1] != 0xffff) { - v2[v1] = Unk_ov21_021E9D74[v1]; - v0++; - v1++; + while (extraFieldsStructFlag_4[index] != 0xffff) { + extraFields[extraFieldCount] = extraFieldsStructFlag_4[index]; + extraFieldCount++; + index++; } } if (param1->pokedexS->pokedexSFlag_2 == 0) { - v1 = 0; + index = 0; - while (Unk_ov21_021E9D70[v1] != 0xffff) { - v2[v1] = Unk_ov21_021E9D70[v1]; - v0++; - v1++; + while (extraFieldsStructFlag_2[index] != 0xffff) { + extraFields[extraFieldCount] = extraFieldsStructFlag_2[index]; + extraFieldCount++; + index++; } } if (param1->pokedexS->pokedexSFlag_3 == 0) { - v1 = 0; + index = 0; - while (Unk_ov21_021E9D6C[v1] != 0xffff) { - v2[v1] = Unk_ov21_021E9D6C[v1]; - v0++; - v1++; + while (extraFieldsStructFlag_3[index] != 0xffff) { + extraFields[extraFieldCount] = extraFieldsStructFlag_3[index]; + extraFieldCount++; + index++; } } - return v2; + return extraFields; } -static u8 *ov21_021DD908(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 *param2) +static u8 *ov21_021DD908(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 *numExtraDungeons) { - u32 v0; - int v1; - u8 *v2; + u32 extraDungeonCount; + int index; + u8 *extraDungeons; - v0 = 0; + extraDungeonCount = 0; if (param1->pokedexS->pokedexSFlag_1 == 0) { - v1 = 0; + index = 0; - while (Unk_ov21_021E9D76[v1] != 0xffff) { - v0++; - v1++; + while (Unk_ov21_021E9D76[index] != 0xffff) { + extraDungeonCount++; + index++; } } if (param1->pokedexS->pokedexSFlag_4 == 0) { - v1 = 0; + index = 0; - while (Unk_ov21_021E9D72[v1] != 0xffff) { - v0++; - v1++; + while (Unk_ov21_021E9D72[index] != 0xffff) { + extraDungeonCount++; + index++; } } if (param1->pokedexS->pokedexSFlag_2 == 0) { - v1 = 0; + index = 0; - while (Unk_ov21_021E9D6E[v1] != 0xffff) { - v0++; - v1++; + while (Unk_ov21_021E9D6E[index] != 0xffff) { + extraDungeonCount++; + index++; } } if (param1->pokedexS->pokedexSFlag_3 == 0) { - v1 = 0; + index = 0; - while (Unk_ov21_021E9D7A[v1] != 0xffff) { - v0++; - v1++; + while (Unk_ov21_021E9D7A[index] != 0xffff) { + extraDungeonCount++; + index++; } } - if (v0 > 0) { - v2 = Heap_AllocFromHeap(param0, sizeof(u8) * v0); + if (extraDungeonCount > 0) { + extraDungeons = Heap_AllocFromHeap(param0, sizeof(u8) * extraDungeonCount); } else { - v2 = NULL; + extraDungeons = NULL; } - *param2 = v0; + *numExtraDungeons = extraDungeonCount; - v0 = 0; + extraDungeonCount = 0; if (param1->pokedexS->pokedexSFlag_1 == 0) { - v1 = 0; + index = 0; - while (Unk_ov21_021E9D76[v1] != 0xffff) { - v2[v0] = Unk_ov21_021E9D76[v1]; - v0++; - v1++; + while (Unk_ov21_021E9D76[index] != 0xffff) { + extraDungeons[extraDungeonCount] = Unk_ov21_021E9D76[index]; + extraDungeonCount++; + index++; } } if (param1->pokedexS->pokedexSFlag_4 == 0) { - v1 = 0; + index = 0; - while (Unk_ov21_021E9D72[v1] != 0xffff) { - v2[v0] = Unk_ov21_021E9D72[v1]; - v0++; - v1++; + while (Unk_ov21_021E9D72[index] != 0xffff) { + extraDungeons[extraDungeonCount] = Unk_ov21_021E9D72[index]; + extraDungeonCount++; + index++; } } if (param1->pokedexS->pokedexSFlag_2 == 0) { - v1 = 0; + index = 0; - while (Unk_ov21_021E9D6E[v1] != 0xffff) { - v2[v0] = Unk_ov21_021E9D6E[v1]; - v0++; - v1++; + while (Unk_ov21_021E9D6E[index] != 0xffff) { + extraDungeons[extraDungeonCount] = Unk_ov21_021E9D6E[index]; + extraDungeonCount++; + index++; } } if (param1->pokedexS->pokedexSFlag_3 == 0) { - v1 = 0; + index = 0; - while (Unk_ov21_021E9D7A[v1] != 0xffff) { - v2[v0] = Unk_ov21_021E9D7A[v1]; - v0++; - v1++; + while (Unk_ov21_021E9D7A[index] != 0xffff) { + extraDungeons[extraDungeonCount] = Unk_ov21_021E9D7A[index]; + extraDungeonCount++; + index++; } } - return v2; + return extraDungeons; } -static void ov21_021DD964(UnkStruct_ov21_021DD420 *param0, UnkStruct_ov21_021DCAE0 *param1) +static void ov21_021DD964(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1) { BGL_FillWindow(¶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); + ov21_021D517C(¶m1->unk_00->unk_04, mapDisplay->unk_800->pRawData, mapDisplay->unk_800->W * 8, mapDisplay->unk_800->H * 8, POKEDEXMAPXSCALE, mapDisplay->mapFieldCellMatrix_2, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH, 89, 30); + ov21_021D517C(¶m1->unk_00->unk_04, mapDisplay->unk_7F8->pRawData, mapDisplay->unk_7F8->W * 8, mapDisplay->unk_7F8->H * 8, POKEDEXMAPXSCALE, mapDisplay->mapFieldCellMatrix_1, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH, 89, 30); sub_0201A954(¶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 *enCollection) { - 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->unk_834 <= 0) && (mapDisplay->unk_838 <= 0) && (mapDisplay->unk_83C <= 0) && (mapDisplay->unk_840 <= 0)) { + CellActor_SetDrawFlag(mapDisplay->unk_C8, 1); + sub_020129D0(mapDisplay->unk_CC->unk_00, 1); } else { - CellActor_SetDrawFlag(param0->unk_C8, 0); - sub_020129D0(param0->unk_CC->unk_00, 0); + CellActor_SetDrawFlag(mapDisplay->unk_C8, 0); + sub_020129D0(mapDisplay->unk_CC->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 *enCollection, int param4) { - if (param0->encounterTime != param3->encounterTime) { - ov21_021DD710(param0, param2, param3, param4); - ov21_021DD964(param0, param1); - ov21_021DDA48(param0, param2->encounterTime); - ov21_021DD9E8(param0, param3); - param0->encounterTime = param3->encounterTime; + if (mapDisplay->encounterTime != enCollection->encounterTime) { + ov21_021DD710(mapDisplay, param2, enCollection, param4); + ov21_021DD964(mapDisplay, param1); + ov21_021DDA48(mapDisplay, param2->encounterTime); + ov21_021DD9E8(mapDisplay, enCollection); + mapDisplay->encounterTime = enCollection->encounterTime; } } -static void ov21_021DDABC(UnkStruct_ov21_021DDABC *param0, UnkStruct_ov21_021DCACC *param1, int heapID) +static void ov21_021DDABC(encounterCollection *enCollection, UnkStruct_ov21_021DCACC *param1, int heapID) { - int v0; - int v1; + int dungeonCategory; + int fieldCategory; int species = Pokedex_Sort_CurrentSpecies(param1->pokedexS); switch (param1->encounterTime) { case ENCTIME_MORNING: - v0 = 0; - v1 = 5; + dungeonCategory = PEFC_DUNGEONMORNING; + fieldCategory = PEFC_FIELDMORNING; break; case ENCTIME_DAY: - v0 = 1; - v1 = 6; + dungeonCategory = PEFC_DUNGEONDAY; + fieldCategory = PEFC_FIELDDAY; break; case ENCTIME_NIGHT: - v0 = 2; - v1 = 7; + dungeonCategory = PEFC_DUNGEONNIGHT; + fieldCategory = PEFC_FIELDNIGHT; break; default: GF_ASSERT(0); break; } - ov21_021D57B4(¶m0->dexEnc0, species, v0, heapID); - ov21_021D57B4(¶m0->dexEnc1, species, v1, heapID); + PokedexEncData_PopulateMapsEncounteredOn(&enCollection->dungeonsEncounteredOn, species, dungeonCategory, heapID); + PokedexEncData_PopulateMapsEncounteredOn(&enCollection->fieldsEncounteredOn, species, fieldCategory, heapID); if (Pokedex_Sort_PokedexUnlocked(param1->pokedexS) == 0) { - ov21_021D57B4(¶m0->dexEnc2, species, 3, heapID); - ov21_021D57B4(¶m0->dexEnc3, species, 8, heapID); + PokedexEncData_PopulateMapsEncounteredOn(&enCollection->dungeonSpecialEncounters, species, PEFC_DUNGEONSPECIAL, heapID); + PokedexEncData_PopulateMapsEncounteredOn(&enCollection->fieldSpecialEncounters, species, PEFC_FIELDSPECIAL, heapID); } else { - ov21_021D57B4(¶m0->dexEnc2, species, 4, heapID); - ov21_021D57B4(¶m0->dexEnc3, species, 9, heapID); + PokedexEncData_PopulateMapsEncounteredOn(&enCollection->dungeonSpecialEncounters, species, PEFC_DUNGEONSPECIALNATDEX, heapID); + PokedexEncData_PopulateMapsEncounteredOn(&enCollection->fieldSpecialEncounters, species, PEFC_FIELDSPECIALNATDEX, heapID); } } -static void ov21_021DDB68(UnkStruct_ov21_021DDABC *param0) +static void ov21_021DDB68(encounterCollection *enCollection) { - Free_pokedexEncData(¶m0->dexEnc0); - Free_pokedexEncData(¶m0->dexEnc1); - Free_pokedexEncData(¶m0->dexEnc2); - Free_pokedexEncData(¶m0->dexEnc3); + PokedexEncData_FreeMapsEncounteredOn(&enCollection->dungeonsEncounteredOn); + PokedexEncData_FreeMapsEncounteredOn(&enCollection->fieldsEncounteredOn); + PokedexEncData_FreeMapsEncounteredOn(&enCollection->dungeonSpecialEncounters); + PokedexEncData_FreeMapsEncounteredOn(&enCollection->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)); @@ -1244,14 +1246,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); } } } diff --git a/src/overlay021/pokedex_sort.c b/src/overlay021/pokedex_sort.c index f4a0608513..f370ca65d9 100644 --- a/src/overlay021/pokedex_sort.c +++ b/src/overlay021/pokedex_sort.c @@ -7,8 +7,8 @@ #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 "overlay021/struct_speciesCaughtStatus.h" #include "core_sys.h" #include "heap.h" @@ -48,13 +48,13 @@ void Pokedex_Sort_PopulatePokedexStruct(pokedexStruct *pokedexS, UnkStruct_ov21_ pokedexS->timeOfDay = param1->timeOfDay; if (Pokedex_NationalUnlocked(pokedexS->dexData)) { - pokedexS->nationalDexUnlocked = 1; + pokedexS->isNationalDexUnlocked = 1; } else { - pokedexS->nationalDexUnlocked = 0; + pokedexS->isNationalDexUnlocked = 0; } if (param1->unk_20 == 2) { - if (pokedexS->nationalDexUnlocked) { + if (pokedexS->isNationalDexUnlocked) { isNationalDex = 1; } else { isNationalDex = 0; @@ -87,12 +87,12 @@ void Pokedex_Sort_PopulatePokedexStruct(pokedexStruct *pokedexS, UnkStruct_ov21_ ov21_021D3434(pokedexS, param1->unk_1C); ov21_021D344C(pokedexS, param1->unk_20); - pokedexS->TrainerGameCode = TrainerInfo_GameCode(param1->unk_04); - pokedexS->TrainerGender = TrainerInfo_Gender(param1->unk_04); + pokedexS->trainerGameCode = TrainerInfo_GameCode(param1->unk_04); + pokedexS->trainerGender = TrainerInfo_Gender(param1->unk_04); pokedexS->trainerName = TrainerInfo_NameNewStrbuf(param1->unk_04, heapID); pokedexS->HWData = Pokedex_HeightWeightData(heapID); - if (pokedexS->TrainerGender == 0) { + if (pokedexS->trainerGender == 0) { Pokedex_HeightWeightData_Load(pokedexS->HWData, 0, heapID); } else { Pokedex_HeightWeightData_Load(pokedexS->HWData, 1, heapID); @@ -359,7 +359,7 @@ BOOL ov21_021D36A4(const pokedexStruct *pokedexS, int param1) return 1; } - if (pokedexS->nationalDexUnlocked) { + if (pokedexS->isNationalDexUnlocked) { return 1; } @@ -468,7 +468,7 @@ int Pokedex_Sort_CurrentCaughtStatus(const pokedexStruct *pokedexS) return pokedexS->pokedexCompletion.caughtStatusArray[pokedexS->pokedexCompletion.unk_F68].caughtStatus; } -const speciesCaughtStatusStruct *Pokedex_Sort_SpeciesCaughtStatus(const pokedexStruct *pokedexS, int dexIndex) +const speciesCaughtStatus *Pokedex_Sort_SpeciesCaughtStatus(const pokedexStruct *pokedexS, int dexIndex) { if (Pokedex_Sort_IsValidDexIndex(pokedexS, dexIndex)) { return &pokedexS->pokedexCompletion.caughtStatusArray[dexIndex]; @@ -563,7 +563,7 @@ Strbuf *Pokedex_Sort_TrainerName(const pokedexStruct *pokedexS) u32 Pokedex_Sort_TrainerGender(const pokedexStruct *pokedexS) { - return pokedexS->TrainerGender; + return pokedexS->trainerGender; } BOOL ov21_021D392C(const pokedexStruct *pokedexS, int param1) @@ -651,9 +651,9 @@ static void Pokedex_Sort_CaughtStatus(pokedexCompletionStruct *pokedexCompletion for (index = 0; index < numEncountered; index++) { if (Pokedex_CaughtSpecies(dexData, speciesArray[index])) { - pokedexCompletion->caughtStatusArray[pokedexCompletion->numEncountered].caughtStatus = 2; + pokedexCompletion->caughtStatusArray[pokedexCompletion->numEncountered].caughtStatus = CS_CAUGHT; } else { - pokedexCompletion->caughtStatusArray[pokedexCompletion->numEncountered].caughtStatus = 1; + pokedexCompletion->caughtStatusArray[pokedexCompletion->numEncountered].caughtStatus = CS_ENCOUNTERED; } pokedexCompletion->caughtStatusArray[pokedexCompletion->numEncountered].species = speciesArray[index]; @@ -947,7 +947,7 @@ static void Pokedex_Sort_NumSeenNCaught(pokedexCompletionStruct *pokedexCompleti *numCaught = 0; for (index = 0; index < pokedexCompletion->numEncountered; index++) { - if (pokedexCompletion->caughtStatusArray[index].caughtStatus == 2) { + if (pokedexCompletion->caughtStatusArray[index].caughtStatus == CS_CAUGHT) { (*numCaught)++; } diff --git a/src/scrcmd.c b/src/scrcmd.c index d51ee84e00..28e419cab5 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -6585,7 +6585,7 @@ static BOOL ScrCmd_22B(ScriptContext *ctx) static BOOL ScrCmd_22C(ScriptContext *ctx) { - Pokedex_CanDetectForms_True(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 348ad635fa..734e72166d 100644 --- a/src/unk_0202631C.c +++ b/src/unk_0202631C.c @@ -1151,7 +1151,7 @@ BOOL Pokedex_CanDetectForms(const PokedexData *dexData) return dexData->canDetectForms; } -void Pokedex_CanDetectForms_True(PokedexData *dexData) +void Pokedex_TurnOnFormDetection(PokedexData *dexData) { CheckPokedexIntegrity(dexData); dexData->canDetectForms = 1; diff --git a/tools/scripts/make_pokedex_data.py b/tools/scripts/make_pokedex_data.py index fe594cdc17..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': @@ -114,7 +112,7 @@ for i, species in enumerate(PokemonSpecies): nameData[i-1] = subdir.replace('porygon2','porygon_z2') # sinnoh dex order -with open(args.pokedex) as data_file: +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']: @@ -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 index 370dbe0c46..f6c3e28bc7 100644 --- a/tools/scripts/make_pokedex_enc_platinum.py +++ b/tools/scripts/make_pokedex_enc_platinum.py @@ -203,13 +203,16 @@ honeyTrees = [ 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) + '_00000.bin' +target_fname = str(private_dir / output_name) + f'_{0:0{numDigits}}.bin' with open(target_fname, 'wb+') as target_file: target_file.write(binData) @@ -218,7 +221,7 @@ for dungeon in file_1: for pos in dungeon: binData = binData + pos.to_bytes(1, 'little') -target_fname = str(private_dir / output_name) + '_00001.bin' +target_fname = str(private_dir / output_name) + f'_{1:0{numDigits}}.bin' with open(target_fname, 'wb+') as target_file: target_file.write(binData) @@ -227,7 +230,7 @@ for field in file_2: for pos in field: binData = binData + pos.to_bytes(1, 'little') -target_fname = str(private_dir / output_name) + '_00002.bin' +target_fname = str(private_dir / output_name) + f'_{2:0{numDigits}}.bin' with open(target_fname, 'wb+') as target_file: target_file.write(binData) @@ -236,134 +239,154 @@ for field in file_3: for pos in field: binData = binData + pos.to_bytes(1, 'little') -target_fname = str(private_dir / output_name) + '_00003.bin' +target_fname = str(private_dir / output_name) + f'_{3:0{numDigits}}.bin' with open(target_fname, 'wb+') as target_file: target_file.write(binData) -def SearchLand(species, encounterData, absent, category): - encData = 0 - while ((encData < 12) and absent): +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)] - if (((encData == 2) or (encData == 3)) and (category > 0)): - if (category == 1): - enc = encounterData["morning"][encData - 2] - if (category == 2): - enc = encounterData["night"][encData - 2] - else: - enc = encounterData["land_encounters"][encData]["species"] - if (enc == species): - absent = False - encData += 1 - return absent - -def SearchWater(species, encounterData, absent): - encData = 0 - while ((encData < 5) and absent): - enc = encounterData["surf_encounters"][encData]["species"] - if (enc == species): - absent = False - enc = encounterData["old_rod_encounters"][encData]["species"] - if (enc == species): - absent = False - enc = encounterData["good_rod_encounters"][encData]["species"] - if (enc == species): - absent = False - enc = encounterData["super_rod_encounters"][encData]["species"] - if (enc == species): - absent = False - encData += 1 - return absent - -def SearchRadar(species, encounterData, absent): - encData = 0 - while ((encData < 4) and absent): - enc = encounterData["radar"][encData] - if (enc == species): - absent = False - encData += 1 - return absent - -def SearchSpecial(species, encounterData, absent): - encData = 0 - if (species == "SPECIES_NONE"): - return False - while ((encData < len(encounterData["special_encounters"])) and absent): - enc = encounterData["special_encounters"][encData] - if (enc == species): - absent = False - encData += 1 - return absent - -def SearchSpecialNatDex(species, encounterData, absent): - encData = 0 - while ((encData < len(encounterData["specialnatdex_encounters"])) and absent): - enc = encounterData["specialnatdex_encounters"][encData] - if (enc == species): - absent = False - encData += 1 - if absent: - absent = SearchRadar(species, encounterData, absent) - return absent - -def CategorySearch(species, encounterData, category): - absent = True - - if (category < 3): - absent = SearchLand(species, encounterData, absent, category) - if absent: - absent = SearchWater(species, encounterData, absent) - if (category == 3): - absent = SearchSpecial(species, encounterData, absent) - if (category == 4): - absent = SearchSpecialNatDex(species, encounterData, absent) - - return absent - -for dexNum, species in enumerate(PokemonSpecies): - if species.name in ['SPECIES_BAD_EGG']: - continue - species = species.name - - for category in range(10): - fileNum = NUM_POKEMON * category + dexNum + 4 - encList = [] - - for archiveID in range(183): - with open(source_dir / '../../../../field/encounters' / f"{archiveID:03}.json", encoding='utf-8') as encounter_file: +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) - areaData = encounterData["map_category"] - areaType = areaData["map_type"] - areaNum = areaData["map_number"] + mapData = encounterData["map_category"] + mapType = mapData["map_type"] + mapNum = mapData["map_number"] - if (category < 5): - if (areaType == 'field'): - continue - else: - if (areaType == 'dungeon'): - continue - if (areaNum in encList): - continue + if (mapType == 'dungeon'): + for i, slot in enumerate(encounterData["land_encounters"]): + species = slot["species"] + dungeonMorning[PokemonSpecies[species].value].add(mapNum) - absent = CategorySearch(species, encounterData, category%5) + if ((i == 2) or (i == 3)): + species = encounterData["morning"][i - 2] + dungeonDay[PokemonSpecies[species].value].add(mapNum) - if not absent: - encList.append(areaNum) + species = encounterData["night"][i - 2] + dungeonNight[PokemonSpecies[species].value].add(mapNum) + else: + dungeonDay[PokemonSpecies[species].value].add(mapNum) + dungeonNight[PokemonSpecies[species].value].add(mapNum) - if (((category == 3) or (category == 4)) and (species in honeyTrees)): - encList.append(21) - if (((category == 8) or (category == 9)) and (species in honeyTrees)): - encList.append(50) - encList.sort() - encList.append(0) + 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() - for areaNum in encList: - binData = binData + areaNum.to_bytes(4, 'little') + mapList = list(mapSet) + mapList.sort() + mapList.append(0) + for map in mapList: + binData = binData + map.to_bytes(4, 'little') - target_fname = str(private_dir / output_name) + f'_{fileNum:05}.bin' + 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']) From bdf564f4160e7ef931b4dd9662529bb99df8133a Mon Sep 17 00:00:00 2001 From: h2o-DS Date: Sat, 19 Oct 2024 23:33:17 -0400 Subject: [PATCH 04/16] Renamed UnkStruct_ov21_021D3320 Renamed UnkStruct_ov21_021D3320 to pokedexStatus --- include/overlay021/ov21_021D0D80.h | 30 +- include/overlay021/pokedex_sort.h | 102 +++--- include/overlay021/struct_ov21_021D5B68.h | 4 +- include/overlay021/struct_ov21_021DE6D4.h | 4 +- ...ov21_021D3320.h => struct_pokedexstatus.h} | 16 +- src/overlay021/ov21_021D0D80.c | 38 +-- src/overlay021/ov21_021D76B0.c | 14 +- src/overlay021/ov21_021D85B0.c | 4 +- src/overlay021/ov21_021D94BC.c | 4 +- src/overlay021/ov21_021DC9BC.c | 60 ++-- src/overlay021/ov21_021DDD2C.c | 4 +- src/overlay021/ov21_021DF734.c | 4 +- src/overlay021/ov21_021E0C68.c | 4 +- src/overlay021/ov21_021E1924.c | 6 +- src/overlay021/ov21_021E29DC.c | 6 +- src/overlay021/ov21_021E3FFC.c | 4 +- src/overlay021/ov21_021E4CA4.c | 4 +- src/overlay021/ov21_021E6014.c | 28 +- src/overlay021/ov21_021E68F4.c | 4 +- src/overlay021/ov21_021E737C.c | 4 +- src/overlay021/ov21_021E8484.c | 4 +- src/overlay021/pokedex_sort.c | 314 +++++++++--------- 22 files changed, 331 insertions(+), 331 deletions(-) rename include/overlay021/{struct_ov21_021D3320.h => struct_pokedexstatus.h} (61%) diff --git a/include/overlay021/ov21_021D0D80.h b/include/overlay021/ov21_021D0D80.h index e6d2c53526..4e109e1e30 100644 --- a/include/overlay021/ov21_021D0D80.h +++ b/include/overlay021/ov21_021D0D80.h @@ -11,12 +11,12 @@ #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D157C.h" #include "overlay021/struct_ov21_021D22F8.h" -#include "overlay021/struct_ov21_021D3320.h" #include "overlay021/struct_ov21_021D3FE0_decl.h" #include "overlay021/struct_ov21_021D423C_decl.h" #include "overlay021/struct_ov21_021D4C0C_decl.h" #include "overlay021/struct_ov21_021D4CA0.h" #include "overlay021/struct_ov21_021E68F4.h" +#include "overlay021/struct_pokedexstatus.h" #include "cell_actor.h" #include "overlay_manager.h" @@ -44,7 +44,7 @@ int *ov21_021D13A0(UnkStruct_ov21_021D0F60 *param0); int *ov21_021D13B4(UnkStruct_ov21_021D0F60 *param0); int *ov21_021D13C8(UnkStruct_ov21_021D0F60 *param0); BOOL *ov21_021D13DC(UnkStruct_ov21_021D0F60 *param0); -pokedexStruct *ov21_021D13EC(UnkStruct_ov21_021D0F60 *param0); +pokedexStatus *ov21_021D13EC(UnkStruct_ov21_021D0F60 *param0); UnkStruct_ov21_021D13FC *ov21_021D13FC(UnkStruct_ov21_021D0F60 *param0); UnkStruct_ov21_021E68F4 *ov21_021D1410(UnkStruct_ov21_021D0F60 *param0, int param1); UnkStruct_ov21_021E68F4 *ov21_021D1430(UnkStruct_ov21_021D0F60 *param0, int param1); @@ -55,23 +55,23 @@ void ov21_021D154C(TouchScreenHitTable *hitTable, int param1, int param2, int pa void ov21_021D1558(UnkStruct_ov21_021D157C *param0, BGL *param1, int param2, NNSG2dScreenData *param3, int param4, int param5, int param6, int param7, int param8); BOOL ov21_021D157C(UnkStruct_ov21_021D157C *param0); void ov21_021D1650(Window *param0, int param1, int param2, int param3); -Window *ov21_021D16D8(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3); +Window *ov21_021D16D8(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3); Window *ov21_021D170C(UnkStruct_ov21_021D4C0C *param0, int param1, int param2); Window *ov21_021D172C(UnkStruct_ov21_021D4C0C *param0, int param1, int param2); -void ov21_021D1778(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, fx32 param4, fx32 param5); +void ov21_021D1778(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3, fx32 param4, fx32 param5); void ov21_021D1848(UnkStruct_ov21_021D13FC *param0, int param1, int param2); void ov21_021D1858(UnkStruct_ov21_021D22F8 *param0, int param1, int param2); -void ov21_021D1890(UnkStruct_ov21_021D13FC *param0, pokedexStruct *param1, int param2, int param3, int param4, int param5); -u32 ov21_021D19D8(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6, int param7); -u32 ov21_021D1A34(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6); -u32 ov21_021D1A78(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6); -u32 ov21_021D1AC0(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6); -u32 ov21_021D1B08(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6); -u32 ov21_021D1B4C(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6); -u32 ov21_021D1B94(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6); -u32 ov21_021D1BD8(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6); -u32 ov21_021D1C30(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6); -u32 ov21_021D1C88(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6); +void ov21_021D1890(UnkStruct_ov21_021D13FC *param0, pokedexStatus *param1, int param2, int param3, int param4, int param5); +u32 ov21_021D19D8(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3, int param4, int param5, int param6, int param7); +u32 ov21_021D1A34(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3, int param4, int param5, int param6); +u32 ov21_021D1A78(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3, int param4, int param5, int param6); +u32 ov21_021D1AC0(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3, int param4, int param5, int param6); +u32 ov21_021D1B08(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3, int param4, int param5, int param6); +u32 ov21_021D1B4C(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3, int param4, int param5, int param6); +u32 ov21_021D1B94(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3, int param4, int param5, int param6); +u32 ov21_021D1BD8(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3, int param4, int param5, int param6); +u32 ov21_021D1C30(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3, int param4, int param5, int param6); +u32 ov21_021D1C88(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3, int param4, int param5, int param6); Strbuf *ov21_021D1CE0(int param0, int param1); #endif // POKEPLATINUM_OV21_021D0D80_H diff --git a/include/overlay021/pokedex_sort.h b/include/overlay021/pokedex_sort.h index dc2ec2bef3..bae050c38e 100644 --- a/include/overlay021/pokedex_sort.h +++ b/include/overlay021/pokedex_sort.h @@ -2,60 +2,60 @@ #define POKEPLATINUM_POKEDEX_SORT_H #include "overlay021/struct_ov21_021D3208.h" -#include "overlay021/struct_ov21_021D3320.h" +#include "overlay021/struct_pokedexstatus.h" #include "overlay021/struct_speciesCaughtStatus.h" #include "strbuf.h" -void Pokedex_Sort_PopulatePokedexStruct(pokedexStruct *param0, UnkStruct_ov21_021D3208 *param1, int param2); -void ov21_021D3320(pokedexStruct *param0); -u32 ov21_021D334C(const pokedexStruct *param0, int param1, int param2); -u32 ov21_021D335C(const pokedexStruct *param0, int param1); -u32 ov21_021D3374(const pokedexStruct *param0, int param1); -u32 ov21_021D338C(const pokedexStruct *param0, int param1); -u32 ov21_021D33A4(const pokedexStruct *param0, int param1); -u32 ov21_021D33BC(const pokedexStruct *param0, int param1); -u32 ov21_021D33D4(const pokedexStruct *param0, u32 param1); -u32 ov21_021D33E0(const pokedexStruct *param0, int param1); -u32 ov21_021D33F8(const pokedexStruct *param0); -u32 ov21_021D3404(const pokedexStruct *param0, int param1); -u32 ov21_021D3410(const pokedexStruct *param0, u32 param1, int param2); -u32 ov21_021D341C(const pokedexStruct *param0, u32 param1); -BOOL Pokedex_Sort_PokedexUnlocked(const pokedexStruct *param0); -void ov21_021D3434(pokedexStruct *param0, u32 param1); -u32 ov21_021D3440(const pokedexStruct *param0); -void ov21_021D344C(pokedexStruct *param0, u32 param1); -u32 ov21_021D3458(const pokedexStruct *param0); -BOOL Pokedex_Sort(pokedexStruct *pokedexS, int sortCategory, int firstLetterFilter, int typeFilter1, int typeFilter2, int bodyShapeFilter, int isNationalDex, int heapID, BOOL isFiltered); -BOOL Pokedex_Sort_Unfiltered(pokedexStruct *param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7); -BOOL ov21_021D36A4(const pokedexStruct *param0, int param1); -BOOL ov21_021D36C0(pokedexStruct *param0, int param1); -int ov21_021D36D8(const pokedexStruct *param0); -BOOL Pokedex_Sort_IsValidDexIndex(const pokedexStruct *pokedexS, int dexIndex); -BOOL ov21_021D36FC(pokedexStruct *param0, int param1); -BOOL ov21_021D371C(pokedexStruct *param0, int param1); -int ov21_021D375C(const pokedexStruct *param0); -int Pokedex_Sort_CompletionNumEncountered(const pokedexStruct *param0); -int ov21_021D3770(const pokedexStruct *param0, u32 param1); -BOOL ov21_021D3794(pokedexStruct *param0, int param1); -int Pokedex_Sort_CurrentSpecies(const pokedexStruct *param0); -int Pokedex_Sort_CurrentCaughtStatus(const pokedexStruct *param0); -const speciesCaughtStatus *Pokedex_Sort_SpeciesCaughtStatus(const pokedexStruct *param0, int dexIndex); -BOOL ov21_021D37F8(const pokedexStruct *param0, int param1); -BOOL ov21_021D3810(pokedexStruct *param0, int param1); -BOOL ov21_021D3844(pokedexStruct *param0, int param1); -BOOL ov21_021D387C(pokedexStruct *param0, int param1); -int ov21_021D3898(const pokedexStruct *param0); -int ov21_021D38A4(const pokedexStruct *param0); -int Pokedex_Sort_SeenIndexToSpecies(const pokedexStruct *param0, int param1); -void ov21_021D38C0(pokedexStruct *param0); -int Pokedex_Sort_NumEncountered(const pokedexStruct *param0); -int Pokedex_Sort_NumCaught(const pokedexStruct *param0); -Strbuf *Pokedex_Sort_TrainerName(const pokedexStruct *param0); -u32 Pokedex_Sort_TrainerGender(const pokedexStruct *param0); -BOOL ov21_021D392C(const pokedexStruct *param0, int param1); -BOOL Pokedex_Sort_CanDetectForms(const pokedexStruct *param0); -void ov21_021D3960(pokedexStruct *param0); -u32 ov21_021D3998(const pokedexStruct *param0); +void Pokedex_Sort_PopulatepokedexStatus(pokedexStatus *param0, UnkStruct_ov21_021D3208 *param1, int param2); +void pokedexstatus(pokedexStatus *param0); +u32 ov21_021D334C(const pokedexStatus *param0, int param1, int param2); +u32 ov21_021D335C(const pokedexStatus *param0, int param1); +u32 ov21_021D3374(const pokedexStatus *param0, int param1); +u32 ov21_021D338C(const pokedexStatus *param0, int param1); +u32 ov21_021D33A4(const pokedexStatus *param0, int param1); +u32 ov21_021D33BC(const pokedexStatus *param0, int param1); +u32 ov21_021D33D4(const pokedexStatus *param0, u32 param1); +u32 ov21_021D33E0(const pokedexStatus *param0, int param1); +u32 ov21_021D33F8(const pokedexStatus *param0); +u32 ov21_021D3404(const pokedexStatus *param0, int param1); +u32 ov21_021D3410(const pokedexStatus *param0, u32 param1, int param2); +u32 ov21_021D341C(const pokedexStatus *param0, u32 param1); +BOOL Pokedex_Sort_PokedexUnlocked(const pokedexStatus *param0); +void ov21_021D3434(pokedexStatus *param0, u32 param1); +u32 ov21_021D3440(const pokedexStatus *param0); +void ov21_021D344C(pokedexStatus *param0, u32 param1); +u32 ov21_021D3458(const pokedexStatus *param0); +BOOL Pokedex_Sort(pokedexStatus *dexStatus, int sortCategory, int firstLetterFilter, int typeFilter1, int typeFilter2, int bodyShapeFilter, int isNationalDex, int heapID, BOOL isFiltered); +BOOL Pokedex_Sort_Unfiltered(pokedexStatus *param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7); +BOOL ov21_021D36A4(const pokedexStatus *param0, int param1); +BOOL ov21_021D36C0(pokedexStatus *param0, int param1); +int ov21_021D36D8(const pokedexStatus *param0); +BOOL Pokedex_Sort_IsValidDexIndex(const pokedexStatus *dexStatus, int dexIndex); +BOOL ov21_021D36FC(pokedexStatus *param0, int param1); +BOOL ov21_021D371C(pokedexStatus *param0, int param1); +int ov21_021D375C(const pokedexStatus *param0); +int Pokedex_Sort_CompletionNumEncountered(const pokedexStatus *param0); +int ov21_021D3770(const pokedexStatus *param0, u32 param1); +BOOL ov21_021D3794(pokedexStatus *param0, int param1); +int Pokedex_Sort_CurrentSpecies(const pokedexStatus *param0); +int Pokedex_Sort_CurrentCaughtStatus(const pokedexStatus *param0); +const speciesCaughtStatus *Pokedex_Sort_SpeciesCaughtStatus(const pokedexStatus *param0, int dexIndex); +BOOL ov21_021D37F8(const pokedexStatus *param0, int param1); +BOOL ov21_021D3810(pokedexStatus *param0, int param1); +BOOL ov21_021D3844(pokedexStatus *param0, int param1); +BOOL ov21_021D387C(pokedexStatus *param0, int param1); +int ov21_021D3898(const pokedexStatus *param0); +int ov21_021D38A4(const pokedexStatus *param0); +int Pokedex_Sort_SeenIndexToSpecies(const pokedexStatus *param0, int param1); +void ov21_021D38C0(pokedexStatus *param0); +int Pokedex_Sort_NumEncountered(const pokedexStatus *param0); +int Pokedex_Sort_NumCaught(const pokedexStatus *param0); +Strbuf *Pokedex_Sort_TrainerName(const pokedexStatus *param0); +u32 Pokedex_Sort_TrainerGender(const pokedexStatus *param0); +BOOL ov21_021D392C(const pokedexStatus *param0, int param1); +BOOL Pokedex_Sort_CanDetectForms(const pokedexStatus *param0); +void ov21_021D3960(pokedexStatus *param0); +u32 ov21_021D3998(const pokedexStatus *param0); #endif // POKEPLATINUM_POKEDEX_SORT_H diff --git a/include/overlay021/struct_ov21_021D5B68.h b/include/overlay021/struct_ov21_021D5B68.h index 645bfbf7fb..f511d300c0 100644 --- a/include/overlay021/struct_ov21_021D5B68.h +++ b/include/overlay021/struct_ov21_021D5B68.h @@ -1,11 +1,11 @@ #ifndef POKEPLATINUM_STRUCT_OV21_021D5B68_H #define POKEPLATINUM_STRUCT_OV21_021D5B68_H -#include "overlay021/struct_ov21_021D3320.h" +#include "overlay021/struct_pokedexstatus.h" typedef struct { int *unk_00; - pokedexStruct *unk_04; + pokedexStatus *unk_04; int unk_08; int unk_0C; int unk_10; diff --git a/include/overlay021/struct_ov21_021DE6D4.h b/include/overlay021/struct_ov21_021DE6D4.h index 91a260f984..c869cc6be5 100644 --- a/include/overlay021/struct_ov21_021DE6D4.h +++ b/include/overlay021/struct_ov21_021DE6D4.h @@ -1,12 +1,12 @@ #ifndef POKEPLATINUM_STRUCT_OV21_021DE6D4_H #define POKEPLATINUM_STRUCT_OV21_021DE6D4_H -#include "overlay021/struct_ov21_021D3320.h" #include "overlay021/struct_ov21_021E68F4.h" +#include "overlay021/struct_pokedexstatus.h" typedef struct { int *unk_00; - pokedexStruct *unk_04; + pokedexStatus *unk_04; int unk_08; int unk_0C; const UnkStruct_ov21_021E68F4 *unk_10; diff --git a/include/overlay021/struct_ov21_021D3320.h b/include/overlay021/struct_pokedexstatus.h similarity index 61% rename from include/overlay021/struct_ov21_021D3320.h rename to include/overlay021/struct_pokedexstatus.h index 877114353e..6f99072134 100644 --- a/include/overlay021/struct_ov21_021D3320.h +++ b/include/overlay021/struct_pokedexstatus.h @@ -1,5 +1,5 @@ -#ifndef POKEPLATINUM_STRUCT_OV21_021D3320_H -#define POKEPLATINUM_STRUCT_OV21_021D3320_H +#ifndef POKEPLATINUM_STRUCT_POKEDEXSTATUS_H +#define POKEPLATINUM_STRUCT_POKEDEXSTATUS_H #include "struct_decls/pokedexdata_decl.h" #include "struct_decls/struct_02098700_decl.h" @@ -24,10 +24,10 @@ typedef struct { int unk_1758; u16 unk_175C; u16 unk_175E; - BOOL pokedexSFlag_1; - BOOL pokedexSFlag_2; - BOOL pokedexSFlag_3; - BOOL pokedexSFlag_4; -} pokedexStruct; + BOOL pokedexSFlag_1; // VarsFlags->vars[54] + BOOL pokedexSFlag_2; // VarsFlags->vars[55] + BOOL pokedexSFlag_3; // VarsFlags->vars[56] + BOOL pokedexSFlag_4; // VarsFlags->vars[57] +} pokedexStatus; -#endif // POKEPLATINUM_STRUCT_OV21_021D3320_H +#endif // POKEPLATINUM_STRUCT_POKEDEXSTATUS_H diff --git a/src/overlay021/ov21_021D0D80.c b/src/overlay021/ov21_021D0D80.c index 92dfab1f60..f029e4c823 100644 --- a/src/overlay021/ov21_021D0D80.c +++ b/src/overlay021/ov21_021D0D80.c @@ -40,7 +40,6 @@ #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_021D3FE0_decl.h" #include "overlay021/struct_ov21_021D423C_decl.h" #include "overlay021/struct_ov21_021D4660.h" @@ -48,6 +47,7 @@ #include "overlay021/struct_ov21_021D4CA0.h" #include "overlay021/struct_ov21_021D4CB8.h" #include "overlay021/struct_ov21_021E68F4.h" +#include "overlay021/struct_pokedexstatus.h" #include "overlay021/struct_speciesCaughtStatus.h" #include "overlay022/struct_ov22_022559F8.h" @@ -82,7 +82,7 @@ typedef struct UnkStruct_ov21_021D0F60_t { BOOL unk_00; int unk_04; UnkStruct_0209ACBC *unk_08; - pokedexStruct unk_0C; + pokedexStatus unk_0C; UnkStruct_ov21_021D13FC unk_177C; int unk_1A60; int unk_1A64; @@ -329,7 +329,7 @@ UnkStruct_ov21_021D0F60 *ov21_021D0F60(int param0, const UnkStruct_ov21_021D0D80 v2.unk_1C = sub_0209ACE4(param1->unk_1C); v2.unk_20 = sub_0209ACEC(param1->unk_1C); - Pokedex_Sort_PopulatePokedexStruct(&v0->unk_0C, &v2, param0); + Pokedex_Sort_PopulatepokedexStatus(&v0->unk_0C, &v2, param0); ov21_021D1FA4(&v0->unk_177C, param0); for (v1 = 0; v1 < 10; v1++) { @@ -513,7 +513,7 @@ BOOL *ov21_021D13DC(UnkStruct_ov21_021D0F60 *param0) return ¶m0->unk_00; } -pokedexStruct *ov21_021D13EC(UnkStruct_ov21_021D0F60 *param0) +pokedexStatus *ov21_021D13EC(UnkStruct_ov21_021D0F60 *param0) { GF_ASSERT(param0); return ¶m0->unk_0C; @@ -675,7 +675,7 @@ void ov21_021D1650(Window *param0, int param1, int param2, int param3) ov21_021D5600(v1); } -Window *ov21_021D16D8(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3) +Window *ov21_021D16D8(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3) { Window *v0; @@ -715,7 +715,7 @@ Window *ov21_021D172C(UnkStruct_ov21_021D4C0C *param0, int param1, int param2) return v0; } -void ov21_021D1778(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int dexIndex, fx32 param4, fx32 param5) +void ov21_021D1778(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int dexIndex, fx32 param4, fx32 param5) { CellActor *v0; CellActor *v1; @@ -786,7 +786,7 @@ void ov21_021D1858(UnkStruct_ov21_021D22F8 *param0, int param1, int param2) } } -void ov21_021D1890(UnkStruct_ov21_021D13FC *param0, pokedexStruct *param1, int species, int param3, int param4, int param5) +void ov21_021D1890(UnkStruct_ov21_021D13FC *param0, pokedexStatus *param1, int species, int param3, int param4, int param5) { switch (species) { case 201: @@ -822,7 +822,7 @@ void ov21_021D1890(UnkStruct_ov21_021D13FC *param0, pokedexStruct *param1, int s } } -u32 ov21_021D19D8(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6, int param7) +u32 ov21_021D19D8(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3, int param4, int param5, int param6, int param7) { int v0; u32 v1 = 0; @@ -840,11 +840,11 @@ u32 ov21_021D19D8(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, return v0; } -u32 ov21_021D1A34(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *pokedexS, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1A34(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *dexStatus, int param2, int param3, int param4, int param5, int param6) { int v0; - v0 = ov21_021D335C(pokedexS, param5); + v0 = ov21_021D335C(dexStatus, param5); if (v0 != -1) { ov21_021D2188(param0, 201, 2, param2, 0, v0, 0, param3, param4, param6); @@ -853,7 +853,7 @@ u32 ov21_021D1A34(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *pokedexS return v0; } -u32 ov21_021D1A78(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1A78(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3, int param4, int param5, int param6) { int v0; @@ -866,7 +866,7 @@ u32 ov21_021D1A78(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, return v0; } -u32 ov21_021D1AC0(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1AC0(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3, int param4, int param5, int param6) { int v0; @@ -879,7 +879,7 @@ u32 ov21_021D1AC0(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, return v0; } -u32 ov21_021D1B08(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1B08(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3, int param4, int param5, int param6) { int v0; @@ -892,7 +892,7 @@ u32 ov21_021D1B08(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, return v0; } -u32 ov21_021D1B4C(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1B4C(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3, int param4, int param5, int param6) { int v0; @@ -905,7 +905,7 @@ u32 ov21_021D1B4C(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, return v0; } -u32 ov21_021D1B94(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1B94(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3, int param4, int param5, int param6) { int v0; @@ -918,7 +918,7 @@ u32 ov21_021D1B94(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, return v0; } -u32 ov21_021D1BD8(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1BD8(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3, int param4, int param5, int param6) { int v0; int v1; @@ -935,7 +935,7 @@ u32 ov21_021D1BD8(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, return v0; } -u32 ov21_021D1C30(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1C30(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3, int param4, int param5, int param6) { int v0; int v1; @@ -952,7 +952,7 @@ u32 ov21_021D1C30(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, return v0; } -u32 ov21_021D1C88(UnkStruct_ov21_021D13FC *param0, const pokedexStruct *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1C88(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3, int param4, int param5, int param6) { int v0; int v1; @@ -1031,7 +1031,7 @@ static void ov21_021D1D08(UnkStruct_ov21_021D0F60 *param0) sub_0209ACF0(param0->unk_08, 2); } - ov21_021D3320(¶m0->unk_0C); + pokedexstatus(¶m0->unk_0C); ov21_021D2098(¶m0->unk_177C); Heap_FreeToHeap(param0); } diff --git a/src/overlay021/ov21_021D76B0.c b/src/overlay021/ov21_021D76B0.c index 070489c6d8..19e0c78edb 100644 --- a/src/overlay021/ov21_021D76B0.c +++ b/src/overlay021/ov21_021D76B0.c @@ -16,7 +16,6 @@ #include "overlay021/pokedex_sort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" -#include "overlay021/struct_ov21_021D3320.h" #include "overlay021/struct_ov21_021D4660.h" #include "overlay021/struct_ov21_021D4CA0.h" #include "overlay021/struct_ov21_021D4CB8.h" @@ -24,6 +23,7 @@ #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" +#include "overlay021/struct_pokedexstatus.h" #include "cell_actor.h" #include "core_sys.h" @@ -116,8 +116,8 @@ static void ov21_021D8324(UnkStruct_ov21_021D7A64 *param0); static void ov21_021D8354(UnkStruct_ov21_021D7C64 *param0, UnkStruct_ov21_021D77E8 *param1, int param2, fx32 param3); static void ov21_021D83C0(UnkStruct_ov21_021D7C64 *param0, UnkStruct_ov21_021D77E8 *param1, const UnkStruct_ov21_021D77D4 *param2); static void ov21_021D8434(UnkStruct_ov21_021D7A64 *param0, int param1, int param2); -static BOOL ov21_021D84E0(UnkStruct_ov21_021D7A64 *param0, pokedexStruct *param1); -static BOOL ov21_021D8508(UnkStruct_ov21_021D7A64 *param0, pokedexStruct *param1); +static BOOL ov21_021D84E0(UnkStruct_ov21_021D7A64 *param0, pokedexStatus *param1); +static BOOL ov21_021D8508(UnkStruct_ov21_021D7A64 *param0, pokedexStatus *param1); static void ov21_021D8530(UnkStruct_ov21_021D7A64 *param0, UnkStruct_ov21_021D77D4 *param1); static fx32 ov21_021D8580(fx32 param0, s32 param1); @@ -446,7 +446,7 @@ static void ov21_021D7B8C(u32 param0, u32 param1, void *param2) UnkStruct_ov21_021D7B8C *v0 = param2; UnkStruct_ov21_021D77D4 *v1 = v0->unk_04; UnkStruct_ov21_021D7A64 *v2 = v0->unk_00; - pokedexStruct *v3 = v1->unk_1C->unk_04; + pokedexStatus *v3 = v1->unk_1C->unk_04; int v4; int v5; @@ -784,7 +784,7 @@ static void ov21_021D828C(UnkStruct_ov21_021D77E8 *param0, int param1) static void ov21_021D82A8(UnkStruct_ov21_021D7A64 *param0, UnkStruct_ov21_021D77D4 *param1) { int v0; - pokedexStruct *v1 = param1->unk_1C->unk_04; + pokedexStatus *v1 = param1->unk_1C->unk_04; if (param1->unk_1C->unk_0C <= 0) { if (param0->unk_10 != 0) { @@ -941,7 +941,7 @@ static void ov21_021D84B8(UnkStruct_ov21_021D77D4 *param0) } } -static BOOL ov21_021D84E0(UnkStruct_ov21_021D7A64 *param0, pokedexStruct *param1) +static BOOL ov21_021D84E0(UnkStruct_ov21_021D7A64 *param0, pokedexStatus *param1) { int v0; @@ -960,7 +960,7 @@ static BOOL ov21_021D84E0(UnkStruct_ov21_021D7A64 *param0, pokedexStruct *param1 return 1; } -static BOOL ov21_021D8508(UnkStruct_ov21_021D7A64 *param0, pokedexStruct *param1) +static BOOL ov21_021D8508(UnkStruct_ov21_021D7A64 *param0, pokedexStatus *param1) { int v0; diff --git a/src/overlay021/ov21_021D85B0.c b/src/overlay021/ov21_021D85B0.c index 0c49445863..660ecc10e9 100644 --- a/src/overlay021/ov21_021D85B0.c +++ b/src/overlay021/ov21_021D85B0.c @@ -13,12 +13,12 @@ #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D157C.h" -#include "overlay021/struct_ov21_021D3320.h" #include "overlay021/struct_ov21_021D4660.h" #include "overlay021/struct_ov21_021D5B68.h" #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" +#include "overlay021/struct_pokedexstatus.h" #include "cell_actor.h" #include "heap.h" @@ -35,7 +35,7 @@ typedef struct { int *unk_00; - pokedexStruct *unk_04; + pokedexStatus *unk_04; UnkStruct_ov21_021D5B68 *unk_08; int unk_0C; int unk_10; diff --git a/src/overlay021/ov21_021D94BC.c b/src/overlay021/ov21_021D94BC.c index 6b3c466789..ea1b123926 100644 --- a/src/overlay021/ov21_021D94BC.c +++ b/src/overlay021/ov21_021D94BC.c @@ -16,7 +16,6 @@ #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_021D4660.h" #include "overlay021/struct_ov21_021D4C0C_decl.h" #include "overlay021/struct_ov21_021D4CA0.h" @@ -26,6 +25,7 @@ #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" +#include "overlay021/struct_pokedexstatus.h" #include "cell_actor.h" #include "core_sys.h" @@ -43,7 +43,7 @@ typedef struct { int *unk_00; - pokedexStruct *unk_04; + pokedexStatus *unk_04; UnkStruct_ov21_021E68F4 *unk_08; UnkStruct_ov21_021E68F4 *unk_0C; } UnkStruct_ov21_021D95B8; diff --git a/src/overlay021/ov21_021DC9BC.c b/src/overlay021/ov21_021DC9BC.c index 1242fd3262..58b14d5c14 100644 --- a/src/overlay021/ov21_021DC9BC.c +++ b/src/overlay021/ov21_021DC9BC.c @@ -19,13 +19,13 @@ #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_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" +#include "overlay021/struct_pokedexstatus.h" #include "cell_actor.h" #include "gx_layers.h" @@ -79,7 +79,7 @@ enum EncounterTime { }; typedef struct { - pokedexStruct *pokedexS; + pokedexStatus *dexStatus; int encounterTime; UnkStruct_ov21_021E68F4 *unk_08; } UnkStruct_ov21_021DCACC; @@ -242,7 +242,7 @@ static UnkStruct_ov21_021DCACC *ov21_021DCA5C(int heapID, UnkStruct_ov21_021D0F6 GF_ASSERT(v0); memset(v0, 0, sizeof(UnkStruct_ov21_021DCACC)); - v0->pokedexS = ov21_021D13EC(param1); + v0->dexStatus = ov21_021D13EC(param1); v0->unk_08 = ov21_021D1410(param1, 5); return v0; @@ -292,10 +292,10 @@ static int ov21_021DCAF8(UnkStruct_ov21_021E6A68 *param0, void *param1) param0->unk_08 = encCollection; - if (v0->pokedexS->timeOfDay == TOD_MORNING) { + if (v0->dexStatus->timeOfDay == TOD_MORNING) { v0->encounterTime = ENCTIME_MORNING; } else { - if ((v0->pokedexS->timeOfDay == TOD_DAY) || (v0->pokedexS->timeOfDay == TOD_TWILIGHT)) { + if ((v0->dexStatus->timeOfDay == TOD_DAY) || (v0->dexStatus->timeOfDay == TOD_TWILIGHT)) { v0->encounterTime = ENCTIME_DAY; } else { v0->encounterTime = ENCTIME_NIGHT; @@ -503,28 +503,28 @@ static void ov21_021DCE40(UnkStruct_ov21_021DCAE0 *param0, const UnkStruct_ov21_ sub_020198C0(param0->unk_00->unk_00, 3, v1->rawData, 0, 0, v1->screenWidth / 8, v1->screenHeight / 8); Heap_FreeToHeap(v0); - if (param1->pokedexS->pokedexSFlag_2) { + if (param1->dexStatus->pokedexSFlag_2) { v0 = ov21_021D27B8(param0->unk_00, 65, 1, &v1, param2); sub_020198C0(param0->unk_00->unk_00, 3, v1->rawData, 13, 8, v1->screenWidth / 8, v1->screenHeight / 8); Heap_FreeToHeap(v0); } - if (param1->pokedexS->pokedexSFlag_4) { + if (param1->dexStatus->pokedexSFlag_4) { v0 = ov21_021D27B8(param0->unk_00, 66, 1, &v1, param2); sub_020198C0(param0->unk_00->unk_00, 3, v1->rawData, 28, 7, v1->screenWidth / 8, v1->screenHeight / 8); Heap_FreeToHeap(v0); } - if (param1->pokedexS->pokedexSFlag_1) { + if (param1->dexStatus->pokedexSFlag_1) { v0 = ov21_021D27B8(param0->unk_00, 67, 1, &v1, param2); sub_020198C0(param0->unk_00->unk_00, 3, v1->rawData, 11, 8, v1->screenWidth / 8, v1->screenHeight / 8); Heap_FreeToHeap(v0); } - if (param1->pokedexS->pokedexSFlag_3) { + if (param1->dexStatus->pokedexSFlag_3) { v0 = ov21_021D27B8(param0->unk_00, 68, 1, &v1, param2); sub_020198C0(param0->unk_00->unk_00, 3, v1->rawData, 25, 16, v1->screenWidth / 8, v1->screenHeight / 8); @@ -858,7 +858,7 @@ static void ov21_021DD710(PokedexMapDisplay *mapDisplay, const UnkStruct_ov21_02 MapFieldCellMatrix_SmoothCells(mapDisplay->mapFieldCellMatrix_1, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH); MapFieldCellMatrix_SmoothCells(mapDisplay->mapFieldCellMatrix_2, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH); - species = Pokedex_Sort_CurrentSpecies(param1->pokedexS); + species = Pokedex_Sort_CurrentSpecies(param1->dexStatus); if (species == SPECIES_FEEBAS) { v2 = 4; @@ -913,7 +913,7 @@ static u8 *ov21_021DD900(u32 heapID, const UnkStruct_ov21_021DCACC *param1, u32 extraFieldCount = 0; - if (param1->pokedexS->pokedexSFlag_1 == 0) { + if (param1->dexStatus->pokedexSFlag_1 == 0) { index = 0; while (extraFieldsStructFlag_1[index] != 0xffff) { @@ -922,7 +922,7 @@ static u8 *ov21_021DD900(u32 heapID, const UnkStruct_ov21_021DCACC *param1, u32 } } - if (param1->pokedexS->pokedexSFlag_4 == 0) { + if (param1->dexStatus->pokedexSFlag_4 == 0) { index = 0; while (extraFieldsStructFlag_4[index] != 0xffff) { @@ -931,7 +931,7 @@ static u8 *ov21_021DD900(u32 heapID, const UnkStruct_ov21_021DCACC *param1, u32 } } - if (param1->pokedexS->pokedexSFlag_2 == 0) { + if (param1->dexStatus->pokedexSFlag_2 == 0) { index = 0; while (extraFieldsStructFlag_2[index] != 0xffff) { @@ -940,7 +940,7 @@ static u8 *ov21_021DD900(u32 heapID, const UnkStruct_ov21_021DCACC *param1, u32 } } - if (param1->pokedexS->pokedexSFlag_3 == 0) { + if (param1->dexStatus->pokedexSFlag_3 == 0) { index = 0; while (extraFieldsStructFlag_3[index] != 0xffff) { @@ -959,7 +959,7 @@ static u8 *ov21_021DD900(u32 heapID, const UnkStruct_ov21_021DCACC *param1, u32 extraFieldCount = 0; - if (param1->pokedexS->pokedexSFlag_1 == 0) { + if (param1->dexStatus->pokedexSFlag_1 == 0) { index = 0; while (extraFieldsStructFlag_1[index] != 0xffff) { @@ -969,7 +969,7 @@ static u8 *ov21_021DD900(u32 heapID, const UnkStruct_ov21_021DCACC *param1, u32 } } - if (param1->pokedexS->pokedexSFlag_4 == 0) { + if (param1->dexStatus->pokedexSFlag_4 == 0) { index = 0; while (extraFieldsStructFlag_4[index] != 0xffff) { @@ -979,7 +979,7 @@ static u8 *ov21_021DD900(u32 heapID, const UnkStruct_ov21_021DCACC *param1, u32 } } - if (param1->pokedexS->pokedexSFlag_2 == 0) { + if (param1->dexStatus->pokedexSFlag_2 == 0) { index = 0; while (extraFieldsStructFlag_2[index] != 0xffff) { @@ -989,7 +989,7 @@ static u8 *ov21_021DD900(u32 heapID, const UnkStruct_ov21_021DCACC *param1, u32 } } - if (param1->pokedexS->pokedexSFlag_3 == 0) { + if (param1->dexStatus->pokedexSFlag_3 == 0) { index = 0; while (extraFieldsStructFlag_3[index] != 0xffff) { @@ -1010,7 +1010,7 @@ static u8 *ov21_021DD908(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 extraDungeonCount = 0; - if (param1->pokedexS->pokedexSFlag_1 == 0) { + if (param1->dexStatus->pokedexSFlag_1 == 0) { index = 0; while (Unk_ov21_021E9D76[index] != 0xffff) { @@ -1019,7 +1019,7 @@ static u8 *ov21_021DD908(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 } } - if (param1->pokedexS->pokedexSFlag_4 == 0) { + if (param1->dexStatus->pokedexSFlag_4 == 0) { index = 0; while (Unk_ov21_021E9D72[index] != 0xffff) { @@ -1028,7 +1028,7 @@ static u8 *ov21_021DD908(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 } } - if (param1->pokedexS->pokedexSFlag_2 == 0) { + if (param1->dexStatus->pokedexSFlag_2 == 0) { index = 0; while (Unk_ov21_021E9D6E[index] != 0xffff) { @@ -1037,7 +1037,7 @@ static u8 *ov21_021DD908(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 } } - if (param1->pokedexS->pokedexSFlag_3 == 0) { + if (param1->dexStatus->pokedexSFlag_3 == 0) { index = 0; while (Unk_ov21_021E9D7A[index] != 0xffff) { @@ -1056,7 +1056,7 @@ static u8 *ov21_021DD908(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 extraDungeonCount = 0; - if (param1->pokedexS->pokedexSFlag_1 == 0) { + if (param1->dexStatus->pokedexSFlag_1 == 0) { index = 0; while (Unk_ov21_021E9D76[index] != 0xffff) { @@ -1066,7 +1066,7 @@ static u8 *ov21_021DD908(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 } } - if (param1->pokedexS->pokedexSFlag_4 == 0) { + if (param1->dexStatus->pokedexSFlag_4 == 0) { index = 0; while (Unk_ov21_021E9D72[index] != 0xffff) { @@ -1076,7 +1076,7 @@ static u8 *ov21_021DD908(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 } } - if (param1->pokedexS->pokedexSFlag_2 == 0) { + if (param1->dexStatus->pokedexSFlag_2 == 0) { index = 0; while (Unk_ov21_021E9D6E[index] != 0xffff) { @@ -1086,7 +1086,7 @@ static u8 *ov21_021DD908(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 } } - if (param1->pokedexS->pokedexSFlag_3 == 0) { + if (param1->dexStatus->pokedexSFlag_3 == 0) { index = 0; while (Unk_ov21_021E9D7A[index] != 0xffff) { @@ -1148,7 +1148,7 @@ static void ov21_021DDABC(encounterCollection *enCollection, UnkStruct_ov21_021D { int dungeonCategory; int fieldCategory; - int species = Pokedex_Sort_CurrentSpecies(param1->pokedexS); + int species = Pokedex_Sort_CurrentSpecies(param1->dexStatus); switch (param1->encounterTime) { case ENCTIME_MORNING: @@ -1171,7 +1171,7 @@ static void ov21_021DDABC(encounterCollection *enCollection, UnkStruct_ov21_021D PokedexEncData_PopulateMapsEncounteredOn(&enCollection->dungeonsEncounteredOn, species, dungeonCategory, heapID); PokedexEncData_PopulateMapsEncounteredOn(&enCollection->fieldsEncounteredOn, species, fieldCategory, heapID); - if (Pokedex_Sort_PokedexUnlocked(param1->pokedexS) == 0) { + if (Pokedex_Sort_PokedexUnlocked(param1->dexStatus) == 0) { PokedexEncData_PopulateMapsEncounteredOn(&enCollection->dungeonSpecialEncounters, species, PEFC_DUNGEONSPECIAL, heapID); PokedexEncData_PopulateMapsEncounteredOn(&enCollection->fieldSpecialEncounters, species, PEFC_FIELDSPECIAL, heapID); } else { @@ -1262,8 +1262,8 @@ static void ov21_021DDC14(PokedexMapDisplay *mapDisplay) static void ov21_021DDCF4(UnkStruct_ov21_021DCAE0 *param0, const UnkStruct_ov21_021DCACC *param1) { Sprite *v0 = ov21_021D2170(param0->unk_00); - int species = Pokedex_Sort_CurrentSpecies(param1->pokedexS); + int species = Pokedex_Sort_CurrentSpecies(param1->dexStatus); - ov21_021D1890(param0->unk_00, param1->pokedexS, species, 2, 40, 120); + ov21_021D1890(param0->unk_00, param1->dexStatus, species, 2, 40, 120); sub_02007DEC(v0, 6, 0); } diff --git a/src/overlay021/ov21_021DDD2C.c b/src/overlay021/ov21_021DDD2C.c index 764b48f741..4c38c1395e 100644 --- a/src/overlay021/ov21_021DDD2C.c +++ b/src/overlay021/ov21_021DDD2C.c @@ -13,11 +13,11 @@ #include "overlay021/pokedex_sort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" -#include "overlay021/struct_ov21_021D3320.h" #include "overlay021/struct_ov21_021D4660.h" #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" +#include "overlay021/struct_pokedexstatus.h" #include "cell_actor.h" #include "core_sys.h" @@ -34,7 +34,7 @@ typedef struct { UnkStruct_ov21_021E68F4 *unk_00; - pokedexStruct *unk_04; + pokedexStatus *unk_04; UnkStruct_ov21_021E68F4 *unk_08; } UnkStruct_ov21_021DDDA4; diff --git a/src/overlay021/ov21_021DF734.c b/src/overlay021/ov21_021DF734.c index b6bad69b4e..009bbda2a5 100644 --- a/src/overlay021/ov21_021DF734.c +++ b/src/overlay021/ov21_021DF734.c @@ -14,12 +14,12 @@ #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_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" +#include "overlay021/struct_pokedexstatus.h" #include "cell_actor.h" #include "heap.h" @@ -35,7 +35,7 @@ typedef struct { int *unk_00; - pokedexStruct *unk_04; + pokedexStatus *unk_04; const UnkStruct_ov21_021E68F4 *unk_08; int unk_0C; int unk_10; diff --git a/src/overlay021/ov21_021E0C68.c b/src/overlay021/ov21_021E0C68.c index 61b1d7712a..46c4aa522e 100644 --- a/src/overlay021/ov21_021E0C68.c +++ b/src/overlay021/ov21_021E0C68.c @@ -16,12 +16,12 @@ #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_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" +#include "overlay021/struct_pokedexstatus.h" #include "cell_actor.h" #include "heap.h" @@ -38,7 +38,7 @@ typedef struct { int *unk_00; - pokedexStruct *unk_04; + pokedexStatus *unk_04; int unk_08; int unk_0C; const UnkStruct_ov21_021E68F4 *unk_10; diff --git a/src/overlay021/ov21_021E1924.c b/src/overlay021/ov21_021E1924.c index 3d1e6fedb3..dca9cfac39 100644 --- a/src/overlay021/ov21_021E1924.c +++ b/src/overlay021/ov21_021E1924.c @@ -18,7 +18,6 @@ #include "overlay021/pokedex_sort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" -#include "overlay021/struct_ov21_021D3320.h" #include "overlay021/struct_ov21_021D4660.h" #include "overlay021/struct_ov21_021D4CA0.h" #include "overlay021/struct_ov21_021D4CB8.h" @@ -26,6 +25,7 @@ #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" +#include "overlay021/struct_pokedexstatus.h" #include "cell_actor.h" #include "core_sys.h" @@ -44,7 +44,7 @@ typedef struct { int *unk_00; - pokedexStruct *unk_04; + pokedexStatus *unk_04; UnkStruct_ov21_021DE6D4 *unk_08; UnkStruct_ov21_021E68F4 *unk_0C; UnkStruct_ov21_021E68F4 *unk_10; @@ -173,7 +173,7 @@ static UnkStruct_ov21_021E1A7C *ov21_021E199C(int param0, UnkStruct_ov21_021D0F6 { UnkStruct_ov21_021E1A7C *v0; UnkStruct_ov21_021E68F4 *v1; - pokedexStruct *v2; + pokedexStatus *v2; int v3; v0 = Heap_AllocFromHeap(param0, sizeof(UnkStruct_ov21_021E1A7C)); diff --git a/src/overlay021/ov21_021E29DC.c b/src/overlay021/ov21_021E29DC.c index 6ae4dd6f88..79629a0165 100644 --- a/src/overlay021/ov21_021E29DC.c +++ b/src/overlay021/ov21_021E29DC.c @@ -18,7 +18,6 @@ #include "overlay021/pokedex_sort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" -#include "overlay021/struct_ov21_021D3320.h" #include "overlay021/struct_ov21_021D4660.h" #include "overlay021/struct_ov21_021D4CA0.h" #include "overlay021/struct_ov21_021D4CB8.h" @@ -29,6 +28,7 @@ #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" +#include "overlay021/struct_pokedexstatus.h" #include "cell_actor.h" #include "core_sys.h" @@ -46,7 +46,7 @@ typedef struct { int *unk_00; - pokedexStruct *unk_04; + pokedexStatus *unk_04; int unk_08; UnkStruct_ov21_021D5B68 *unk_0C; UnkStruct_ov21_021DE6D4 *unk_10; @@ -77,7 +77,7 @@ typedef struct { typedef struct { int *unk_00; UnkStruct_ov21_021E2BA8 *unk_04; - pokedexStruct *unk_08; + pokedexStatus *unk_08; int unk_0C[6]; BOOL unk_24; int unk_28; diff --git a/src/overlay021/ov21_021E3FFC.c b/src/overlay021/ov21_021E3FFC.c index 79142580ca..acfd1d0b44 100644 --- a/src/overlay021/ov21_021E3FFC.c +++ b/src/overlay021/ov21_021E3FFC.c @@ -15,10 +15,10 @@ #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_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" +#include "overlay021/struct_pokedexstatus.h" #include "cell_actor.h" #include "heap.h" @@ -32,7 +32,7 @@ typedef struct { int *unk_00; - pokedexStruct *unk_04; + pokedexStatus *unk_04; UnkStruct_ov21_021E68F4 *unk_08; UnkStruct_ov21_021E68F4 *unk_0C; } UnkStruct_ov21_021E40F4; diff --git a/src/overlay021/ov21_021E4CA4.c b/src/overlay021/ov21_021E4CA4.c index 76b921e29f..5e80590b3d 100644 --- a/src/overlay021/ov21_021E4CA4.c +++ b/src/overlay021/ov21_021E4CA4.c @@ -14,13 +14,13 @@ #include "overlay021/pokedex_sort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" -#include "overlay021/struct_ov21_021D3320.h" #include "overlay021/struct_ov21_021D4660.h" #include "overlay021/struct_ov21_021D4CA0.h" #include "overlay021/struct_ov21_021D4CB8.h" #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" +#include "overlay021/struct_pokedexstatus.h" #include "cell_actor.h" #include "core_sys.h" @@ -41,7 +41,7 @@ typedef struct { int *unk_00; - pokedexStruct *unk_04; + pokedexStatus *unk_04; UnkStruct_ov21_021E68F4 *unk_08; int unk_0C; } UnkStruct_ov21_021E4D90; diff --git a/src/overlay021/ov21_021E6014.c b/src/overlay021/ov21_021E6014.c index e847d802bd..053959c838 100644 --- a/src/overlay021/ov21_021E6014.c +++ b/src/overlay021/ov21_021E6014.c @@ -12,11 +12,11 @@ #include "overlay021/pokedex_sort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" -#include "overlay021/struct_ov21_021D3320.h" #include "overlay021/struct_ov21_021D4660.h" #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" +#include "overlay021/struct_pokedexstatus.h" #include "cell_actor.h" #include "heap.h" @@ -35,7 +35,7 @@ typedef struct { int *unk_00; - pokedexStruct *pokedexS; + pokedexStatus *dexStatus; UnkStruct_ov21_021E68F4 *unk_08; } UnkStruct_ov21_021E6104; @@ -126,7 +126,7 @@ static UnkStruct_ov21_021E6104 *ov21_021E608C(int param0, UnkStruct_ov21_021D0F6 memset(v0, 0, sizeof(UnkStruct_ov21_021E6104)); v0->unk_00 = ov21_021D138C(param1); - v0->pokedexS = ov21_021D13EC(param1); + v0->dexStatus = ov21_021D13EC(param1); v0->unk_08 = ov21_021D1410(param1, 5); return v0; @@ -408,7 +408,7 @@ static void ov21_021E6518(UnkStruct_ov21_021E6274 *param0, UnkStruct_ov21_021E61 VecFx32 v3; short v4; short v5; - int species = Pokedex_Sort_CurrentSpecies(param2->pokedexS); + int species = Pokedex_Sort_CurrentSpecies(param2->dexStatus); 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->pokedexS->HWData, species); - v5 = Pokedex_HeightWeightData_TrainerScale(param2->pokedexS->HWData, species); + v4 = Pokedex_HeightWeightData_TrainerPos(param2->dexStatus->HWData, species); + v5 = Pokedex_HeightWeightData_TrainerScale(param2->dexStatus->HWData, species); v1.position.x = 168 << FX32_SHIFT; v1.position.y = (88 + v4) << FX32_SHIFT; param0->unk_10 = CellActorCollection_Add(&v1); - if (Pokedex_Sort_TrainerGender(param2->pokedexS) == 0) { + if (Pokedex_Sort_TrainerGender(param2->dexStatus) == 0) { CellActor_SetAnim(param0->unk_10, 5); } else { CellActor_SetAnim(param0->unk_10, 6); @@ -474,7 +474,7 @@ 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 species = Pokedex_Sort_CurrentSpecies(param1->pokedexS); + int species = Pokedex_Sort_CurrentSpecies(param1->dexStatus); Strbuf *v3 = MessageUtil_SpeciesName(species, param2); int heightMessageBankIndex = Height_Message_Bank_Index(); @@ -493,9 +493,9 @@ static void ov21_021E66B0(UnkStruct_ov21_021E6118 *param0, const UnkStruct_ov21_ v1 = MessageLoader_Init(0, 26, 697, param2); - sub_0201D78C(¶m0->unk_00->unk_04, 0, Pokedex_Sort_TrainerName(param1->pokedexS), 146, 152, 0, ((u32)(((2 & 0xff) << 16) | ((1 & 0xff) << 8) | ((0 & 0xff) << 0))), NULL); + sub_0201D78C(¶m0->unk_00->unk_04, 0, Pokedex_Sort_TrainerName(param1->dexStatus), 146, 152, 0, ((u32)(((2 & 0xff) << 16) | ((1 & 0xff) << 8) | ((0 & 0xff) << 0))), NULL); - if (Pokedex_Sort_TrainerGender(param1->pokedexS) == 0) { + if (Pokedex_Sort_TrainerGender(param1->dexStatus) == 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 species = Pokedex_Sort_CurrentSpecies(param1->pokedexS); + int species = Pokedex_Sort_CurrentSpecies(param1->dexStatus); - v1 = Pokedex_HeightWeightData_PokemonPos(param1->pokedexS->HWData, species); - v2 = Pokedex_HeightWeightData_PokemonScale(param1->pokedexS->HWData, species); + v1 = Pokedex_HeightWeightData_PokemonPos(param1->dexStatus->HWData, species); + v2 = Pokedex_HeightWeightData_PokemonScale(param1->dexStatus->HWData, species); - ov21_021D1890(param0->unk_00, param1->pokedexS, species, 2, 88, 88 + v1); + ov21_021D1890(param0->unk_00, param1->dexStatus, 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 7db3a24fea..b6b8f6a8e6 100644 --- a/src/overlay021/ov21_021E68F4.c +++ b/src/overlay021/ov21_021E68F4.c @@ -15,13 +15,13 @@ #include "overlay021/pokedex_sort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" -#include "overlay021/struct_ov21_021D3320.h" #include "overlay021/struct_ov21_021D4660.h" #include "overlay021/struct_ov21_021D4CA0.h" #include "overlay021/struct_ov21_021D4CB8.h" #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" +#include "overlay021/struct_pokedexstatus.h" #include "cell_actor.h" #include "core_sys.h" @@ -41,7 +41,7 @@ typedef struct { int *unk_00; int unk_04; - pokedexStruct *unk_08; + pokedexStatus *unk_08; UnkStruct_ov21_021E68F4 *unk_0C; } UnkStruct_ov21_021E6A20; diff --git a/src/overlay021/ov21_021E737C.c b/src/overlay021/ov21_021E737C.c index 2724f08c9c..5c73d437f3 100644 --- a/src/overlay021/ov21_021E737C.c +++ b/src/overlay021/ov21_021E737C.c @@ -14,11 +14,11 @@ #include "overlay021/pokedex_sort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" -#include "overlay021/struct_ov21_021D3320.h" #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" #include "overlay021/struct_ov21_021E7F40.h" +#include "overlay021/struct_pokedexstatus.h" #include "overlay022/struct_ov22_022557A0.h" #include "overlay022/struct_ov22_02255800.h" @@ -53,7 +53,7 @@ typedef struct { } UnkStruct_ov21_021E9DB0; typedef struct { - pokedexStruct *unk_00; + pokedexStatus *unk_00; UnkStruct_ov21_021E68F4 *unk_04; } UnkStruct_ov21_021E7468; diff --git a/src/overlay021/ov21_021E8484.c b/src/overlay021/ov21_021E8484.c index 874f799701..06e3d0e320 100644 --- a/src/overlay021/ov21_021E8484.c +++ b/src/overlay021/ov21_021E8484.c @@ -15,13 +15,13 @@ #include "overlay021/pokedex_sort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" -#include "overlay021/struct_ov21_021D3320.h" #include "overlay021/struct_ov21_021D4660.h" #include "overlay021/struct_ov21_021D4CA0.h" #include "overlay021/struct_ov21_021D4CB8.h" #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" +#include "overlay021/struct_pokedexstatus.h" #include "cell_actor.h" #include "core_sys.h" @@ -39,7 +39,7 @@ typedef struct { int *unk_00; - pokedexStruct *unk_04; + pokedexStatus *unk_04; UnkStruct_ov21_021E68F4 *unk_08; UnkStruct_ov21_021E68F4 *unk_0C; } UnkStruct_ov21_021E8570; diff --git a/src/overlay021/pokedex_sort.c b/src/overlay021/pokedex_sort.c index f370ca65d9..2780433359 100644 --- a/src/overlay021/pokedex_sort.c +++ b/src/overlay021/pokedex_sort.c @@ -6,8 +6,8 @@ #include "struct_decls/pokedexdata_decl.h" #include "overlay021/struct_ov21_021D3208.h" -#include "overlay021/struct_ov21_021D3320.h" #include "overlay021/struct_ov21_021D3A60.h" +#include "overlay021/struct_pokedexstatus.h" #include "overlay021/struct_speciesCaughtStatus.h" #include "core_sys.h" @@ -32,7 +32,7 @@ static void Pokedex_Sort_FilterFirstLetter(int firstLetterFilter, u16 *pokedexPo static void Pokedex_Sort_FilterType(int typeFilter, u16 *param1, int *param2, const u16 *param3, int dexLengthPreFilter, int heapID, const PokedexData *dexData); static void Pokedex_Sort_FilterBodyShape(int bodyShapeFilter, u16 *param1, int *param2, const u16 *param3, int dexLengthPreFilter, int heapID, const PokedexData *dexData); -void Pokedex_Sort_PopulatePokedexStruct(pokedexStruct *pokedexS, UnkStruct_ov21_021D3208 *param1, int heapID) +void Pokedex_Sort_PopulatepokedexStatus(pokedexStatus *dexStatus, UnkStruct_ov21_021D3208 *param1, int heapID) { int sortCategory; int firstLetterFilter; @@ -42,19 +42,19 @@ void Pokedex_Sort_PopulatePokedexStruct(pokedexStruct *pokedexS, UnkStruct_ov21_ BOOL dexExists; u32 isNationalDex; - memset(pokedexS, 0, sizeof(pokedexStruct)); + memset(dexStatus, 0, sizeof(pokedexStatus)); - pokedexS->dexData = param1->dexData; - pokedexS->timeOfDay = param1->timeOfDay; + dexStatus->dexData = param1->dexData; + dexStatus->timeOfDay = param1->timeOfDay; - if (Pokedex_NationalUnlocked(pokedexS->dexData)) { - pokedexS->isNationalDexUnlocked = 1; + if (Pokedex_NationalUnlocked(dexStatus->dexData)) { + dexStatus->isNationalDexUnlocked = 1; } else { - pokedexS->isNationalDexUnlocked = 0; + dexStatus->isNationalDexUnlocked = 0; } if (param1->unk_20 == 2) { - if (pokedexS->isNationalDexUnlocked) { + if (dexStatus->isNationalDexUnlocked) { isNationalDex = 1; } else { isNationalDex = 0; @@ -64,14 +64,14 @@ void Pokedex_Sort_PopulatePokedexStruct(pokedexStruct *pokedexS, UnkStruct_ov21_ } if (isNationalDex == 1) { - pokedexS->isNationalDex = 1; + dexStatus->isNationalDex = 1; sortCategory = 0; firstLetterFilter = 0; typeFilter1 = 0; typeFilter2 = 0; bodyShapeFilter = 0; } else { - pokedexS->isNationalDex = 0; + dexStatus->isNationalDex = 0; sortCategory = 0; firstLetterFilter = 0; typeFilter1 = 0; @@ -79,106 +79,106 @@ void Pokedex_Sort_PopulatePokedexStruct(pokedexStruct *pokedexS, UnkStruct_ov21_ bodyShapeFilter = 0; } - dexExists = Pokedex_Sort_Unfiltered(pokedexS, sortCategory, firstLetterFilter, typeFilter1, typeFilter2, bodyShapeFilter, pokedexS->isNationalDex, heapID); + dexExists = Pokedex_Sort_Unfiltered(dexStatus, sortCategory, firstLetterFilter, typeFilter1, typeFilter2, bodyShapeFilter, dexStatus->isNationalDex, heapID); GF_ASSERT(dexExists); - ov21_021D3794(pokedexS, param1->unk_1C); - ov21_021D3434(pokedexS, param1->unk_1C); - ov21_021D344C(pokedexS, param1->unk_20); + ov21_021D3794(dexStatus, param1->unk_1C); + ov21_021D3434(dexStatus, param1->unk_1C); + ov21_021D344C(dexStatus, param1->unk_20); - pokedexS->trainerGameCode = TrainerInfo_GameCode(param1->unk_04); - pokedexS->trainerGender = TrainerInfo_Gender(param1->unk_04); - pokedexS->trainerName = TrainerInfo_NameNewStrbuf(param1->unk_04, heapID); - pokedexS->HWData = Pokedex_HeightWeightData(heapID); + dexStatus->trainerGameCode = TrainerInfo_GameCode(param1->unk_04); + dexStatus->trainerGender = TrainerInfo_Gender(param1->unk_04); + dexStatus->trainerName = TrainerInfo_NameNewStrbuf(param1->unk_04, heapID); + dexStatus->HWData = Pokedex_HeightWeightData(heapID); - if (pokedexS->trainerGender == 0) { - Pokedex_HeightWeightData_Load(pokedexS->HWData, 0, heapID); + if (dexStatus->trainerGender == 0) { + Pokedex_HeightWeightData_Load(dexStatus->HWData, 0, heapID); } else { - Pokedex_HeightWeightData_Load(pokedexS->HWData, 1, heapID); + Pokedex_HeightWeightData_Load(dexStatus->HWData, 1, heapID); } - pokedexS->pokedexSFlag_1 = param1->pokedexSFlag_1; - pokedexS->pokedexSFlag_2 = param1->pokedexSFlag_2; - pokedexS->pokedexSFlag_3 = param1->pokedexSFlag_3; - pokedexS->pokedexSFlag_4 = param1->pokedexSFlag_4; + dexStatus->pokedexSFlag_1 = param1->pokedexSFlag_1; + dexStatus->pokedexSFlag_2 = param1->pokedexSFlag_2; + dexStatus->pokedexSFlag_3 = param1->pokedexSFlag_3; + dexStatus->pokedexSFlag_4 = param1->pokedexSFlag_4; } -void ov21_021D3320(pokedexStruct *pokedexS) +void pokedexstatus(pokedexStatus *dexStatus) { - Strbuf_Free(pokedexS->trainerName); - Pokedex_HeightWeightData_Release(pokedexS->HWData); - Pokedex_HeightWeightData_Free(pokedexS->HWData); + Strbuf_Free(dexStatus->trainerName); + Pokedex_HeightWeightData_Release(dexStatus->HWData); + Pokedex_HeightWeightData_Free(dexStatus->HWData); - pokedexS->HWData = NULL; + dexStatus->HWData = NULL; } -u32 ov21_021D334C(const pokedexStruct *pokedexS, int param1, int param2) +u32 ov21_021D334C(const pokedexStatus *dexStatus, int param1, int param2) { u32 v0; - v0 = sub_02027058(pokedexS->dexData, param1, param2); + v0 = sub_02027058(dexStatus->dexData, param1, param2); return v0; } -u32 ov21_021D335C(const pokedexStruct *pokedexS, int param1) +u32 ov21_021D335C(const pokedexStatus *dexStatus, int param1) { int v0; GF_ASSERT(param1 < 28); - v0 = sub_020270AC(pokedexS->dexData, param1); + v0 = sub_020270AC(dexStatus->dexData, param1); return v0; } -u32 ov21_021D3374(const pokedexStruct *pokedexS, int param1) +u32 ov21_021D3374(const pokedexStatus *dexStatus, int param1) { u32 v0; GF_ASSERT(param1 < 2); - v0 = sub_020270F8(pokedexS->dexData, param1); + v0 = sub_020270F8(dexStatus->dexData, param1); return v0; } -u32 ov21_021D338C(const pokedexStruct *pokedexS, int param1) +u32 ov21_021D338C(const pokedexStatus *dexStatus, int param1) { u32 v0; GF_ASSERT(param1 < 2); - v0 = sub_02027154(pokedexS->dexData, param1); + v0 = sub_02027154(dexStatus->dexData, param1); return v0; } -u32 ov21_021D33A4(const pokedexStruct *pokedexS, int param1) +u32 ov21_021D33A4(const pokedexStatus *dexStatus, int param1) { u32 v0; GF_ASSERT(param1 < 3); - v0 = sub_020271B0(pokedexS->dexData, param1); + v0 = sub_020271B0(dexStatus->dexData, param1); return v0; } -u32 ov21_021D33BC(const pokedexStruct *pokedexS, int param1) +u32 ov21_021D33BC(const pokedexStatus *dexStatus, int param1) { u32 v0; GF_ASSERT(param1 < 3); - v0 = sub_02027208(pokedexS->dexData, param1); + v0 = sub_02027208(dexStatus->dexData, param1); return v0; } -u32 ov21_021D33D4(const pokedexStruct *pokedexS, u32 species) +u32 ov21_021D33D4(const pokedexStatus *dexStatus, u32 species) { - return sub_0202756C(pokedexS->dexData, species, 0); + return sub_0202756C(dexStatus->dexData, species, 0); } -u32 ov21_021D33E0(const pokedexStruct *pokedexS, int param1) +u32 ov21_021D33E0(const pokedexStatus *dexStatus, int param1) { - int v0 = ov21_021D334C(pokedexS, param1, 1); + int v0 = ov21_021D334C(dexStatus, param1, 1); if (v0 == -1) { return 1; @@ -187,52 +187,52 @@ u32 ov21_021D33E0(const pokedexStruct *pokedexS, int param1) return 2; } -u32 ov21_021D33F8(const pokedexStruct *pokedexS) +u32 ov21_021D33F8(const pokedexStatus *dexStatus) { - return sub_0202702C(pokedexS->dexData, 0); + return sub_0202702C(dexStatus->dexData, 0); } -u32 ov21_021D3404(const pokedexStruct *pokedexS, int param1) +u32 ov21_021D3404(const pokedexStatus *dexStatus, int param1) { - return sub_02027264(pokedexS->dexData, param1); + return sub_02027264(dexStatus->dexData, param1); } -u32 ov21_021D3410(const pokedexStruct *pokedexS, u32 param1, int param2) +u32 ov21_021D3410(const pokedexStatus *dexStatus, u32 param1, int param2) { - return sub_0202756C(pokedexS->dexData, param1, param2); + return sub_0202756C(dexStatus->dexData, param1, param2); } -u32 ov21_021D341C(const pokedexStruct *pokedexS, u32 param1) +u32 ov21_021D341C(const pokedexStatus *dexStatus, u32 param1) { - return sub_020276C8(pokedexS->dexData, param1); + return sub_020276C8(dexStatus->dexData, param1); } -BOOL Pokedex_Sort_PokedexUnlocked(const pokedexStruct *pokedexS) +BOOL Pokedex_Sort_PokedexUnlocked(const pokedexStatus *dexStatus) { - return Pokedex_NationalUnlocked(pokedexS->dexData); + return Pokedex_NationalUnlocked(dexStatus->dexData); } -void ov21_021D3434(pokedexStruct *pokedexS, u32 param1) +void ov21_021D3434(pokedexStatus *dexStatus, u32 param1) { - pokedexS->unk_175C = param1; + dexStatus->unk_175C = param1; } -u32 ov21_021D3440(const pokedexStruct *pokedexS) +u32 ov21_021D3440(const pokedexStatus *dexStatus) { - return pokedexS->unk_175C; + return dexStatus->unk_175C; } -void ov21_021D344C(pokedexStruct *pokedexS, u32 param1) +void ov21_021D344C(pokedexStatus *dexStatus, u32 param1) { - pokedexS->unk_175E = param1; + dexStatus->unk_175E = param1; } -u32 ov21_021D3458(const pokedexStruct *pokedexS) +u32 ov21_021D3458(const pokedexStatus *dexStatus) { - return pokedexS->unk_175E; + return dexStatus->unk_175E; } -BOOL Pokedex_Sort(pokedexStruct *pokedexS, int sortCategory, int firstLetterFilter, int typeFilter1, int typeFilter2, int bodyShapeFilter, int isNationalDex, int heapID, BOOL isFiltered) +BOOL Pokedex_Sort(pokedexStatus *dexStatus, int sortCategory, int firstLetterFilter, int typeFilter1, int typeFilter2, int bodyShapeFilter, int isNationalDex, int heapID, BOOL isFiltered) { u16 *pokedexPreFilterArray; int dexLengthPreFilter; @@ -257,13 +257,13 @@ BOOL Pokedex_Sort(pokedexStruct *pokedexS, int sortCategory, int firstLetterFilt if (isNationalDex == 0) { pokedexArray = Pokedex_Sort_SortedArray(heapID, 1, &pokedexLength); - Pokedex_Sort_Encountered(pokedexPreFilterArray, &dexLengthPreFilter, pokedexS->dexData, pokedexArray, pokedexLength); + Pokedex_Sort_Encountered(pokedexPreFilterArray, &dexLengthPreFilter, dexStatus->dexData, pokedexArray, pokedexLength); } else { pokedexArray = Pokedex_Sort_SortedArray(heapID, 0, &pokedexLength); - Pokedex_Sort_Encountered(pokedexPreFilterArray, &dexLengthPreFilter, pokedexS->dexData, pokedexArray, pokedexLength); + Pokedex_Sort_Encountered(pokedexPreFilterArray, &dexLengthPreFilter, dexStatus->dexData, pokedexArray, pokedexLength); } - Pokedex_Sort_Order(sortCategory, pokedexPostFilterArray, &dexLengthPostFilter, pokedexPreFilterArray, dexLengthPreFilter, heapID, pokedexS->dexData); + Pokedex_Sort_Order(sortCategory, pokedexPostFilterArray, &dexLengthPostFilter, pokedexPreFilterArray, dexLengthPreFilter, heapID, dexStatus->dexData); memcpy(pokedexPreFilterArray, pokedexPostFilterArray, sizeof(u16) * dexLengthPostFilter); dexLengthPreFilter = dexLengthPostFilter; @@ -272,7 +272,7 @@ BOOL Pokedex_Sort(pokedexStruct *pokedexS, int sortCategory, int firstLetterFilt dexLengthPostFilter = 0; do { - Pokedex_Sort_FilterFirstLetter(firstLetterFilter, pokedexPostFilterArray, &dexLengthPostFilter, pokedexPreFilterArray, dexLengthPreFilter, heapID, pokedexS->dexData); + Pokedex_Sort_FilterFirstLetter(firstLetterFilter, pokedexPostFilterArray, &dexLengthPostFilter, pokedexPreFilterArray, dexLengthPreFilter, heapID, dexStatus->dexData); if (dexLengthPostFilter == 0) { dexExists = 0; @@ -285,7 +285,7 @@ BOOL Pokedex_Sort(pokedexStruct *pokedexS, int sortCategory, int firstLetterFilt memset(pokedexPostFilterArray, 0, sizeof(u16) * dexLengthPostFilter); dexLengthPostFilter = 0; - Pokedex_Sort_FilterType(typeFilter1, pokedexPostFilterArray, &dexLengthPostFilter, pokedexPreFilterArray, dexLengthPreFilter, heapID, pokedexS->dexData); + Pokedex_Sort_FilterType(typeFilter1, pokedexPostFilterArray, &dexLengthPostFilter, pokedexPreFilterArray, dexLengthPreFilter, heapID, dexStatus->dexData); if (dexLengthPostFilter == 0) { dexExists = 0; @@ -298,7 +298,7 @@ BOOL Pokedex_Sort(pokedexStruct *pokedexS, int sortCategory, int firstLetterFilt memset(pokedexPostFilterArray, 0, sizeof(u16) * dexLengthPostFilter); dexLengthPostFilter = 0; - Pokedex_Sort_FilterType(typeFilter2, pokedexPostFilterArray, &dexLengthPostFilter, pokedexPreFilterArray, dexLengthPreFilter, heapID, pokedexS->dexData); + Pokedex_Sort_FilterType(typeFilter2, pokedexPostFilterArray, &dexLengthPostFilter, pokedexPreFilterArray, dexLengthPreFilter, heapID, dexStatus->dexData); if (dexLengthPostFilter == 0) { dexExists = 0; @@ -311,7 +311,7 @@ BOOL Pokedex_Sort(pokedexStruct *pokedexS, int sortCategory, int firstLetterFilt memset(pokedexPostFilterArray, 0, sizeof(u16) * dexLengthPostFilter); dexLengthPostFilter = 0; - Pokedex_Sort_FilterBodyShape(bodyShapeFilter, pokedexPostFilterArray, &dexLengthPostFilter, pokedexPreFilterArray, dexLengthPreFilter, heapID, pokedexS->dexData); + Pokedex_Sort_FilterBodyShape(bodyShapeFilter, pokedexPostFilterArray, &dexLengthPostFilter, pokedexPreFilterArray, dexLengthPreFilter, heapID, dexStatus->dexData); if (dexLengthPostFilter == 0) { dexExists = 0; @@ -324,22 +324,22 @@ BOOL Pokedex_Sort(pokedexStruct *pokedexS, int sortCategory, int firstLetterFilt memset(pokedexPostFilterArray, 0, sizeof(u16) * dexLengthPostFilter); dexLengthPostFilter = 0; - Pokedex_Sort_CaughtStatus(&pokedexS->pokedexCompletion, pokedexS->dexData, pokedexPreFilterArray, dexLengthPreFilter); + Pokedex_Sort_CaughtStatus(&dexStatus->pokedexCompletion, dexStatus->dexData, pokedexPreFilterArray, dexLengthPreFilter); if ((sortCategory != 0) || (firstLetterFilter != 0) || (typeFilter1 != 0) || (typeFilter2 != 0) || (bodyShapeFilter != 0)) { isFiltered = 1; } if (isFiltered == 0) { - Pokedex_Sort_IndentifyEnountered_Full(&pokedexS->pokedexCompletion, pokedexArray, pokedexLength); + Pokedex_Sort_IndentifyEnountered_Full(&dexStatus->pokedexCompletion, pokedexArray, pokedexLength); } else { - Pokedex_Sort_IndentifyEnountered_Filtered(&pokedexS->pokedexCompletion); + Pokedex_Sort_IndentifyEnountered_Filtered(&dexStatus->pokedexCompletion); } dexExists = 1; } while (0); - Pokedex_Sort_NumSeenNCaught(&pokedexS->pokedexCompletion, &pokedexS->numEncountered, &pokedexS->numCaught); + Pokedex_Sort_NumSeenNCaught(&dexStatus->pokedexCompletion, &dexStatus->numEncountered, &dexStatus->numCaught); Heap_FreeToHeap(pokedexPreFilterArray); Heap_FreeToHeap(pokedexPostFilterArray); @@ -348,95 +348,95 @@ BOOL Pokedex_Sort(pokedexStruct *pokedexS, int sortCategory, int firstLetterFilt return dexExists; } -BOOL Pokedex_Sort_Unfiltered(pokedexStruct *pokedexS, int sortCategory, int firstLetterFilter, int typeFilter1, int typeFilter2, int bodyShapeFilter, int isNationalDex, int heapID) +BOOL Pokedex_Sort_Unfiltered(pokedexStatus *dexStatus, int sortCategory, int firstLetterFilter, int typeFilter1, int typeFilter2, int bodyShapeFilter, int isNationalDex, int heapID) { - return Pokedex_Sort(pokedexS, sortCategory, firstLetterFilter, typeFilter1, typeFilter2, bodyShapeFilter, isNationalDex, heapID, 0); + return Pokedex_Sort(dexStatus, sortCategory, firstLetterFilter, typeFilter1, typeFilter2, bodyShapeFilter, isNationalDex, heapID, 0); } -BOOL ov21_021D36A4(const pokedexStruct *pokedexS, int param1) +BOOL ov21_021D36A4(const pokedexStatus *dexStatus, int param1) { if (param1 == 0) { return 1; } - if (pokedexS->isNationalDexUnlocked) { + if (dexStatus->isNationalDexUnlocked) { return 1; } return 0; } -BOOL ov21_021D36C0(pokedexStruct *pokedexS, int param1) +BOOL ov21_021D36C0(pokedexStatus *dexStatus, int param1) { BOOL v0; - v0 = ov21_021D36A4(pokedexS, param1); + v0 = ov21_021D36A4(dexStatus, param1); if (v0) { - pokedexS->isNationalDex = param1; + dexStatus->isNationalDex = param1; } return v0; } -int ov21_021D36D8(const pokedexStruct *pokedexS) +int ov21_021D36D8(const pokedexStatus *dexStatus) { - return pokedexS->isNationalDex; + return dexStatus->isNationalDex; } -BOOL Pokedex_Sort_IsValidDexIndex(const pokedexStruct *pokedexS, int dexIndex) +BOOL Pokedex_Sort_IsValidDexIndex(const pokedexStatus *dexStatus, int dexIndex) { - if (((dexIndex) >= 0) && ((dexIndex) < pokedexS->pokedexCompletion.numEncountered)) { + if (((dexIndex) >= 0) && ((dexIndex) < dexStatus->pokedexCompletion.numEncountered)) { return 1; } return 0; } -BOOL ov21_021D36FC(pokedexStruct *pokedexS, int dexIndex) +BOOL ov21_021D36FC(pokedexStatus *dexStatus, int dexIndex) { - if (Pokedex_Sort_IsValidDexIndex(pokedexS, dexIndex)) { - pokedexS->pokedexCompletion.unk_F68 = dexIndex; + if (Pokedex_Sort_IsValidDexIndex(dexStatus, dexIndex)) { + dexStatus->pokedexCompletion.unk_F68 = dexIndex; return 1; } return 0; } -BOOL ov21_021D371C(pokedexStruct *pokedexS, int param1) +BOOL ov21_021D371C(pokedexStatus *dexStatus, int param1) { - if (Pokedex_Sort_IsValidDexIndex(pokedexS, pokedexS->pokedexCompletion.unk_F68 + param1)) { - pokedexS->pokedexCompletion.unk_F68 += param1; + if (Pokedex_Sort_IsValidDexIndex(dexStatus, dexStatus->pokedexCompletion.unk_F68 + param1)) { + dexStatus->pokedexCompletion.unk_F68 += param1; return 1; } if (param1 >= 0) { - pokedexS->pokedexCompletion.unk_F68 = pokedexS->pokedexCompletion.numEncountered - 1; + dexStatus->pokedexCompletion.unk_F68 = dexStatus->pokedexCompletion.numEncountered - 1; } else { - pokedexS->pokedexCompletion.unk_F68 = 0; + dexStatus->pokedexCompletion.unk_F68 = 0; } return 0; } -int ov21_021D375C(const pokedexStruct *pokedexS) +int ov21_021D375C(const pokedexStatus *dexStatus) { - return pokedexS->pokedexCompletion.unk_F68; + return dexStatus->pokedexCompletion.unk_F68; } -int Pokedex_Sort_CompletionNumEncountered(const pokedexStruct *pokedexS) +int Pokedex_Sort_CompletionNumEncountered(const pokedexStatus *dexStatus) { - return pokedexS->pokedexCompletion.numEncountered; + return dexStatus->pokedexCompletion.numEncountered; } -int ov21_021D3770(const pokedexStruct *pokedexS, u32 param1) +int ov21_021D3770(const pokedexStatus *dexStatus, u32 param1) { int index; - int numEncountered = Pokedex_Sort_CompletionNumEncountered(pokedexS); + int numEncountered = Pokedex_Sort_CompletionNumEncountered(dexStatus); int species; for (index = 0; index < numEncountered; index++) { - species = pokedexS->pokedexCompletion.caughtStatusArray[index].species; + species = dexStatus->pokedexCompletion.caughtStatusArray[index].species; if (species == param1) { break; @@ -446,161 +446,161 @@ int ov21_021D3770(const pokedexStruct *pokedexS, u32 param1) return index; } -BOOL ov21_021D3794(pokedexStruct *pokedexS, int param1) +BOOL ov21_021D3794(pokedexStatus *dexStatus, int param1) { - u32 v0 = Pokedex_Sort_CompletionNumEncountered(pokedexS); - u32 v1 = ov21_021D3770(pokedexS, param1); + u32 v0 = Pokedex_Sort_CompletionNumEncountered(dexStatus); + u32 v1 = ov21_021D3770(dexStatus, param1); if (v0 > v1) { - return ov21_021D36FC(pokedexS, v1); + return ov21_021D36FC(dexStatus, v1); } return 0; } -int Pokedex_Sort_CurrentSpecies(const pokedexStruct *pokedexS) +int Pokedex_Sort_CurrentSpecies(const pokedexStatus *dexStatus) { - return pokedexS->pokedexCompletion.caughtStatusArray[pokedexS->pokedexCompletion.unk_F68].species; + return dexStatus->pokedexCompletion.caughtStatusArray[dexStatus->pokedexCompletion.unk_F68].species; } -int Pokedex_Sort_CurrentCaughtStatus(const pokedexStruct *pokedexS) +int Pokedex_Sort_CurrentCaughtStatus(const pokedexStatus *dexStatus) { - return pokedexS->pokedexCompletion.caughtStatusArray[pokedexS->pokedexCompletion.unk_F68].caughtStatus; + return dexStatus->pokedexCompletion.caughtStatusArray[dexStatus->pokedexCompletion.unk_F68].caughtStatus; } -const speciesCaughtStatus *Pokedex_Sort_SpeciesCaughtStatus(const pokedexStruct *pokedexS, int dexIndex) +const speciesCaughtStatus *Pokedex_Sort_SpeciesCaughtStatus(const pokedexStatus *dexStatus, int dexIndex) { - if (Pokedex_Sort_IsValidDexIndex(pokedexS, dexIndex)) { - return &pokedexS->pokedexCompletion.caughtStatusArray[dexIndex]; + if (Pokedex_Sort_IsValidDexIndex(dexStatus, dexIndex)) { + return &dexStatus->pokedexCompletion.caughtStatusArray[dexIndex]; } return NULL; } -BOOL ov21_021D37F8(const pokedexStruct *pokedexS, int param1) +BOOL ov21_021D37F8(const pokedexStatus *dexStatus, int param1) { - if ((pokedexS->pokedexCompletion.numSpecies > param1) && (param1 >= 0)) { + if ((dexStatus->pokedexCompletion.numSpecies > param1) && (param1 >= 0)) { return 1; } return 0; } -BOOL ov21_021D3810(pokedexStruct *pokedexS, int param1) +BOOL ov21_021D3810(pokedexStatus *dexStatus, int param1) { - if (ov21_021D37F8(pokedexS, param1)) { - pokedexS->pokedexCompletion.unk_1724 = param1; + if (ov21_021D37F8(dexStatus, param1)) { + dexStatus->pokedexCompletion.unk_1724 = param1; - ov21_021D36FC(pokedexS, pokedexS->pokedexCompletion.encounteredIndexArray[pokedexS->pokedexCompletion.unk_1724]); + ov21_021D36FC(dexStatus, dexStatus->pokedexCompletion.encounteredIndexArray[dexStatus->pokedexCompletion.unk_1724]); return 1; } return 0; } -BOOL ov21_021D3844(pokedexStruct *pokedexS, int param1) +BOOL ov21_021D3844(pokedexStatus *dexStatus, int param1) { - if (ov21_021D387C(pokedexS, param1)) { - pokedexS->pokedexCompletion.unk_1724 += param1; + if (ov21_021D387C(dexStatus, param1)) { + dexStatus->pokedexCompletion.unk_1724 += param1; - ov21_021D36FC(pokedexS, pokedexS->pokedexCompletion.encounteredIndexArray[pokedexS->pokedexCompletion.unk_1724]); + ov21_021D36FC(dexStatus, dexStatus->pokedexCompletion.encounteredIndexArray[dexStatus->pokedexCompletion.unk_1724]); return 1; } return 0; } -BOOL ov21_021D387C(pokedexStruct *pokedexS, int param1) +BOOL ov21_021D387C(pokedexStatus *dexStatus, int param1) { - if (ov21_021D37F8(pokedexS, pokedexS->pokedexCompletion.unk_1724 + param1)) { + if (ov21_021D37F8(dexStatus, dexStatus->pokedexCompletion.unk_1724 + param1)) { return 1; } return 0; } -int ov21_021D3898(const pokedexStruct *pokedexS) +int ov21_021D3898(const pokedexStatus *dexStatus) { - return pokedexS->pokedexCompletion.unk_1724; + return dexStatus->pokedexCompletion.unk_1724; } -int ov21_021D38A4(const pokedexStruct *pokedexS) +int ov21_021D38A4(const pokedexStatus *dexStatus) { - return pokedexS->pokedexCompletion.numSpecies; + return dexStatus->pokedexCompletion.numSpecies; } -int Pokedex_Sort_SeenIndexToSpecies(const pokedexStruct *pokedexS, int encounteredIndex) +int Pokedex_Sort_SeenIndexToSpecies(const pokedexStatus *dexStatus, int encounteredIndex) { - return pokedexS->pokedexCompletion.encounteredIndexArray[encounteredIndex]; + return dexStatus->pokedexCompletion.encounteredIndexArray[encounteredIndex]; } -void ov21_021D38C0(pokedexStruct *pokedexS) +void ov21_021D38C0(pokedexStatus *dexStatus) { int v0; - for (v0 = 0; v0 < pokedexS->pokedexCompletion.numSpecies; v0++) { - if (Pokedex_Sort_SeenIndexToSpecies(pokedexS, v0) == ov21_021D375C(pokedexS)) { - ov21_021D3810(pokedexS, v0); + for (v0 = 0; v0 < dexStatus->pokedexCompletion.numSpecies; v0++) { + if (Pokedex_Sort_SeenIndexToSpecies(dexStatus, v0) == ov21_021D375C(dexStatus)) { + ov21_021D3810(dexStatus, v0); break; } } } -int Pokedex_Sort_NumEncountered(const pokedexStruct *pokedexS) +int Pokedex_Sort_NumEncountered(const pokedexStatus *dexStatus) { - return pokedexS->numEncountered; + return dexStatus->numEncountered; } -int Pokedex_Sort_NumCaught(const pokedexStruct *pokedexS) +int Pokedex_Sort_NumCaught(const pokedexStatus *dexStatus) { - return pokedexS->numCaught; + return dexStatus->numCaught; } -Strbuf *Pokedex_Sort_TrainerName(const pokedexStruct *pokedexS) +Strbuf *Pokedex_Sort_TrainerName(const pokedexStatus *dexStatus) { - return pokedexS->trainerName; + return dexStatus->trainerName; } -u32 Pokedex_Sort_TrainerGender(const pokedexStruct *pokedexS) +u32 Pokedex_Sort_TrainerGender(const pokedexStatus *dexStatus) { - return pokedexS->trainerGender; + return dexStatus->trainerGender; } -BOOL ov21_021D392C(const pokedexStruct *pokedexS, int param1) +BOOL ov21_021D392C(const pokedexStatus *dexStatus, int param1) { - int species = Pokedex_Sort_CurrentSpecies(pokedexS); + int species = Pokedex_Sort_CurrentSpecies(dexStatus); - if (sub_02027514(pokedexS->dexData) == 0) { + if (sub_02027514(dexStatus->dexData) == 0) { return 0; } - return sub_020274D0(pokedexS->dexData, species, param1); + return sub_020274D0(dexStatus->dexData, species, param1); } -BOOL Pokedex_Sort_CanDetectForms(const pokedexStruct *pokedexS) +BOOL Pokedex_Sort_CanDetectForms(const pokedexStatus *dexStatus) { - return Pokedex_CanDetectForms(pokedexS->dexData); + return Pokedex_CanDetectForms(dexStatus->dexData); } -void ov21_021D3960(pokedexStruct *pokedexS) +void ov21_021D3960(pokedexStatus *dexStatus) { if (gCoreSys.touchHeld) { - pokedexS->unk_1758 = 0; + dexStatus->unk_1758 = 0; return; } if (gCoreSys.pressedKeys) { - if (pokedexS->unk_1758 == 0) { - pokedexS->unk_1758 = 1; + if (dexStatus->unk_1758 == 0) { + dexStatus->unk_1758 = 1; } else { - pokedexS->unk_1758 = 2; + dexStatus->unk_1758 = 2; } } } -u32 ov21_021D3998(const pokedexStruct *pokedexS) +u32 ov21_021D3998(const pokedexStatus *dexStatus) { - return pokedexS->unk_1758; + return dexStatus->unk_1758; } static void Pokedex_Sort_Encountered(u16 *pokedexPreFilterArray, int *numEncountered, const PokedexData *dexData, const u16 *speciesArray, int pokedexLength) From 9d444917dc844168eddb71515903adafb2cd9211 Mon Sep 17 00:00:00 2001 From: h2o-DS Date: Tue, 22 Oct 2024 22:27:40 -0400 Subject: [PATCH 05/16] Identified Map Event Flags --- include/overlay021/ov21_021DC9BC.h | 2 + .../overlay021/struct_dungeoncoordinates.h | 2 +- include/overlay021/struct_ov21_021D0D80.h | 8 +- include/overlay021/struct_ov21_021D3208.h | 8 +- include/overlay021/struct_pokedexstatus.h | 8 +- src/field_menu.c | 8 +- src/overlay021/ov21_021D0D80.c | 16 +- src/overlay021/ov21_021D57B4.c | 44 +-- src/overlay021/ov21_021DC9BC.c | 292 +++++++++--------- src/overlay021/pokedex_sort.c | 8 +- src/unk_0206AFE0.c | 150 ++++----- 11 files changed, 274 insertions(+), 272 deletions(-) diff --git a/include/overlay021/ov21_021DC9BC.h b/include/overlay021/ov21_021DC9BC.h index 9c8bffc362..a8214c7d7c 100644 --- a/include/overlay021/ov21_021DC9BC.h +++ b/include/overlay021/ov21_021DC9BC.h @@ -4,11 +4,13 @@ #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021E68F4.h" +#define TERMINALVALUE 0xffff #define POKEDEXMAPXSCALE 5 #define POKEDEXMAPYSCALE 5 #define POKEDEXMAPHEIGHT 30 #define POKEDEXMAPWIDTH 30 #define POKEDEXMAPNUMCELLS (POKEDEXMAPHEIGHT * POKEDEXMAPWIDTH) +#define NUMDUNGEONS 22 void ov21_021DC9BC(UnkStruct_ov21_021E68F4 *param0, UnkStruct_ov21_021D0F60 *param1, int heapID); void ov21_021DCA14(UnkStruct_ov21_021E68F4 *param0); diff --git a/include/overlay021/struct_dungeoncoordinates.h b/include/overlay021/struct_dungeoncoordinates.h index 118192470d..02b9851d21 100644 --- a/include/overlay021/struct_dungeoncoordinates.h +++ b/include/overlay021/struct_dungeoncoordinates.h @@ -4,7 +4,7 @@ typedef struct { u8 xCoordinate; u8 yCoordinate; - u8 unk_02; + u8 isMtCoronet; u8 unused; } dungeonCoordinates; diff --git a/include/overlay021/struct_ov21_021D0D80.h b/include/overlay021/struct_ov21_021D0D80.h index b6e7f51b62..d030460fa2 100644 --- a/include/overlay021/struct_ov21_021D0D80.h +++ b/include/overlay021/struct_ov21_021D0D80.h @@ -10,10 +10,10 @@ typedef struct { const PokedexData *unk_00; const TrainerInfo *unk_04; int timeOfDay; - BOOL pokedexSFlag_1; - BOOL pokedexSFlag_2; - BOOL pokedexSFlag_3; - BOOL pokedexSFlag_4; + BOOL fullmoonIslandVisible; + BOOL newmoonIslandVisible; + BOOL springPathVisible; + BOOL seabreakPathVisible; UnkStruct_0209ACBC *unk_1C; } UnkStruct_ov21_021D0D80; diff --git a/include/overlay021/struct_ov21_021D3208.h b/include/overlay021/struct_ov21_021D3208.h index 199318a010..af1a3624c8 100644 --- a/include/overlay021/struct_ov21_021D3208.h +++ b/include/overlay021/struct_ov21_021D3208.h @@ -9,10 +9,10 @@ typedef struct { const PokedexData *dexData; const TrainerInfo *unk_04; int timeOfDay; - BOOL pokedexSFlag_1; - BOOL pokedexSFlag_2; - BOOL pokedexSFlag_3; - BOOL pokedexSFlag_4; + BOOL fullmoonIslandVisible; + BOOL newmoonIslandVisible; + BOOL springPathVisible; + BOOL seabreakPathVisible; u32 unk_1C; u32 unk_20; } UnkStruct_ov21_021D3208; diff --git a/include/overlay021/struct_pokedexstatus.h b/include/overlay021/struct_pokedexstatus.h index 6f99072134..10318770de 100644 --- a/include/overlay021/struct_pokedexstatus.h +++ b/include/overlay021/struct_pokedexstatus.h @@ -24,10 +24,10 @@ typedef struct { int unk_1758; u16 unk_175C; u16 unk_175E; - BOOL pokedexSFlag_1; // VarsFlags->vars[54] - BOOL pokedexSFlag_2; // VarsFlags->vars[55] - BOOL pokedexSFlag_3; // VarsFlags->vars[56] - BOOL pokedexSFlag_4; // VarsFlags->vars[57] + BOOL fullmoonIslandVisible; + BOOL newmoonIslandVisible; + BOOL springPathVisible; + BOOL seabreakPathVisible; } pokedexStatus; #endif // POKEPLATINUM_STRUCT_POKEDEXSTATUS_H diff --git a/src/field_menu.c b/src/field_menu.c index 5c341d76f6..1f866d6d4d 100644 --- a/src/field_menu.c +++ b/src/field_menu.c @@ -959,10 +959,10 @@ static BOOL FieldMenu_Pokedex(TaskManager *taskMan) v2->unk_00 = v3; v2->unk_04 = v4; v2->timeOfDay = sub_02055BA8(fieldSystem); - v2->pokedexSFlag_1 = sub_0206B1F0(v5, 0); // VarsFlags->vars[54] - v2->pokedexSFlag_2 = sub_0206B1F0(v5, 1); // VarsFlags->vars[55] - v2->pokedexSFlag_3 = sub_0206B1F0(v5, 2); // VarsFlags->vars[56] - v2->pokedexSFlag_4 = sub_0206B1F0(v5, 3); // VarsFlags->vars[57] + v2->fullmoonIslandVisible = sub_0206B1F0(v5, 0); // VarsFlags->vars[54] Fullmoon Island + v2->newmoonIslandVisible = sub_0206B1F0(v5, 1); // VarsFlags->vars[55] Newmoon Island + v2->springPathVisible = sub_0206B1F0(v5, 2); // VarsFlags->vars[56] Spring Path + v2->seabreakPathVisible = sub_0206B1F0(v5, 3); // VarsFlags->vars[57] Seabreak Path v2->unk_1C = fieldSystem->unk_B4; sub_0203E0AC(fieldSystem, v2); diff --git a/src/overlay021/ov21_021D0D80.c b/src/overlay021/ov21_021D0D80.c index 14d40e8ec5..488613c222 100644 --- a/src/overlay021/ov21_021D0D80.c +++ b/src/overlay021/ov21_021D0D80.c @@ -154,10 +154,10 @@ int ov21_021D0D80(OverlayManager *param0, int *param1) v2.unk_00 = v1->unk_00; v2.unk_04 = v1->unk_04; v2.timeOfDay = v1->timeOfDay; - v2.pokedexSFlag_1 = v1->pokedexSFlag_1; - v2.pokedexSFlag_4 = v1->pokedexSFlag_4; - v2.pokedexSFlag_2 = v1->pokedexSFlag_2; - v2.pokedexSFlag_3 = v1->pokedexSFlag_3; + v2.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); @@ -322,10 +322,10 @@ UnkStruct_ov21_021D0F60 *ov21_021D0F60(int param0, const UnkStruct_ov21_021D0D80 v2.dexData = param1->unk_00; v2.unk_04 = param1->unk_04; v2.timeOfDay = param1->timeOfDay; - v2.pokedexSFlag_1 = param1->pokedexSFlag_1; - v2.pokedexSFlag_2 = param1->pokedexSFlag_2; - v2.pokedexSFlag_3 = param1->pokedexSFlag_3; - v2.pokedexSFlag_4 = param1->pokedexSFlag_4; + v2.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); diff --git a/src/overlay021/ov21_021D57B4.c b/src/overlay021/ov21_021D57B4.c index f4b94e9387..6d3cece0bf 100644 --- a/src/overlay021/ov21_021D57B4.c +++ b/src/overlay021/ov21_021D57B4.c @@ -109,23 +109,23 @@ void ov21_021D58C0(u8 *mapFieldCellMatrix, u8 mapHeight, u8 mapWidth, const fiel } } -u32 ov21_021D5948(u8 *mapFieldCellMatrix, int mapHeight, int mapWidth, const fieldCoordinates *fieldCoordArray, const mapsEncounteredOn *mapsEncOn, const u8 *mapArray, u32 mapArrayLength) +u32 ov21_021D5948(u8 *mapFieldCellMatrix, int mapHeight, int mapWidth, const fieldCoordinates *fieldCoordArray, const mapsEncounteredOn *mapsEncOn, const u8 *fieldIDArray, u32 fieldIDArrayLength) { - int index; - int mapArrayIndex; + int fieldIndex; + int fieldIDArrayIndex; u32 v2 = 0; - for (index = 0; index < mapsEncOn->numMapsEncounteredOn - 1; index++) { - GF_ASSERT(mapsEncOn->mapsEncounteredOnArray[index]); + for (fieldIndex = 0; fieldIndex < mapsEncOn->numMapsEncounteredOn - 1; fieldIndex++) { + GF_ASSERT(mapsEncOn->mapsEncounteredOnArray[fieldIndex]); - for (mapArrayIndex = 0; mapArrayIndex < mapArrayLength; mapArrayIndex++) { - if (mapsEncOn->mapsEncounteredOnArray[index] == mapArray[mapArrayIndex]) { + for (fieldIDArrayIndex = 0; fieldIDArrayIndex < fieldIDArrayLength; fieldIDArrayIndex++) { + if (mapsEncOn->mapsEncounteredOnArray[fieldIndex] == fieldIDArray[fieldIDArrayIndex]) { break; } } - if (mapArrayIndex >= mapArrayLength) { - ov21_021D58C0(mapFieldCellMatrix, mapHeight, mapWidth, &fieldCoordArray[mapsEncOn->mapsEncounteredOnArray[index]]); + if (fieldIDArrayIndex >= fieldIDArrayLength) { + ov21_021D58C0(mapFieldCellMatrix, mapHeight, mapWidth, &fieldCoordArray[mapsEncOn->mapsEncounteredOnArray[fieldIndex]]); v2++; } } @@ -144,37 +144,37 @@ void ov21_021D59D8(CellActor *actor, int xOffset, int yOffset, int xScale, int y CellActor_SetPosition(actor, &position); - if (dungeonCoords->unk_02) { + if (dungeonCoords->isMtCoronet) { CellActor_SetAnim(actor, animID_2); } else { CellActor_SetAnim(actor, animID_1); } } -int ov21_021D5A20(CellActor **cellActorArray, int initialNumDungeons, int param2, int xOffset, int yOffset, int xScale, int yScale, const dungeonCoordinates *dungeonCoordinatesArray, const mapsEncounteredOn *mapsEncOn, int animID_1, int animID_2, const u8 *mapArray, u32 mapArrayLength, u32 *param13) +int ov21_021D5A20(CellActor **cellActorArray, int initialNumDungeons, int maxNumDungeons, int xOffset, int yOffset, int xScale, int yScale, const dungeonCoordinates *dungeonCoordinatesArray, const mapsEncounteredOn *dungeonsEncounteredOn, int animID_1, int animID_2, const u8 *dungeonsToSkip, u32 numDungeonsToSkip, u32 *param13) { - int index, mapArrayIndex; + int dungeonIndex, dungeonsToSkipIndex; int numDungeons = initialNumDungeons; - int v3 = 0; + int DungeonCount = 0; - for (index = 0; index < mapsEncOn->numMapsEncounteredOn - 1; index++) { - GF_ASSERT(mapsEncOn->mapsEncounteredOnArray[index]); - GF_ASSERT(numDungeons < param2); + for (dungeonIndex = 0; dungeonIndex < dungeonsEncounteredOn->numMapsEncounteredOn - 1; dungeonIndex++) { + GF_ASSERT(dungeonsEncounteredOn->mapsEncounteredOnArray[dungeonIndex]); + GF_ASSERT(numDungeons < maxNumDungeons); - for (mapArrayIndex = 0; mapArrayIndex < mapArrayLength; mapArrayIndex++) { - if (mapsEncOn->mapsEncounteredOnArray[index] == mapArray[mapArrayIndex]) { + for (dungeonsToSkipIndex = 0; dungeonsToSkipIndex < numDungeonsToSkip; dungeonsToSkipIndex++) { + if (dungeonsEncounteredOn->mapsEncounteredOnArray[dungeonIndex] == dungeonsToSkip[dungeonsToSkipIndex]) { break; } } - if (mapArrayIndex >= mapArrayLength) { - ov21_021D59D8(cellActorArray[numDungeons], xOffset, yOffset, xScale, yScale, &dungeonCoordinatesArray[mapsEncOn->mapsEncounteredOnArray[index]], animID_1, animID_2); + if (dungeonsToSkipIndex >= numDungeonsToSkip) { + ov21_021D59D8(cellActorArray[numDungeons], xOffset, yOffset, xScale, yScale, &dungeonCoordinatesArray[dungeonsEncounteredOn->mapsEncounteredOnArray[dungeonIndex]], animID_1, animID_2); numDungeons++; - v3++; + DungeonCount++; } } - *param13 = v3; + *param13 = DungeonCount; return numDungeons; } diff --git a/src/overlay021/ov21_021DC9BC.c b/src/overlay021/ov21_021DC9BC.c index 58b14d5c14..bcbe3126fa 100644 --- a/src/overlay021/ov21_021DC9BC.c +++ b/src/overlay021/ov21_021DC9BC.c @@ -39,37 +39,37 @@ #include "unk_02018340.h" #include "unk_0201F834.h" -static const u16 extraFieldsStructFlag_1[] = { - 0xffff +static const u16 fullmoonIslandFields[] = { + TERMINALVALUE }; -static const u16 Unk_ov21_021E9D76[] = { - 0xffff +static const u16 fullmoonIslandDungeons[] = { + TERMINALVALUE }; -static const u16 extraFieldsStructFlag_4[] = { - 0xffff +static const u16 seabreakPathFields[] = { + TERMINALVALUE }; -static const u16 Unk_ov21_021E9D72[] = { - 0xffff +static const u16 seabreakPathDungeons[] = { + TERMINALVALUE }; -static const u16 extraFieldsStructFlag_2[] = { - 0xffff +static const u16 newmoonIslandFields[] = { + TERMINALVALUE }; -static const u16 Unk_ov21_021E9D6E[] = { - 0xffff +static const u16 newmoonIslandDungeons[] = { + TERMINALVALUE }; -static const u16 extraFieldsStructFlag_3[] = { - 0xffff +static const u16 springPathFields[] = { + TERMINALVALUE }; -static const u16 Unk_ov21_021E9D7A[] = { - 0xA, - 0xffff +static const u16 springPathDungeons[] = { + 10, + TERMINALVALUE }; enum EncounterTime { @@ -94,10 +94,10 @@ typedef struct { typedef struct { int encounterTime; - u8 *extraFields; - u8 *extraDungeons; - u32 numExtraFields; - u32 numExtraDungeons; + u8 *invisibleFields; + u8 *invisibleDungeons; + u32 numInvisibleFields; + u32 numInvisibleDungeons; mapsEncounteredOn dungeonsEncounteredOn; mapsEncounteredOn fieldsEncounteredOn; mapsEncounteredOn dungeonSpecialEncounters; @@ -106,7 +106,7 @@ typedef struct { typedef struct { int encounterTime; - CellActor *cellActorArray[44]; + CellActor *cellActorArray[NUMDUNGEONS * 2]; SpriteResource *unk_B4[4]; int numDungeons; CellActor *unk_C8; @@ -135,7 +135,7 @@ static UnkStruct_ov21_021DCAE0 *ov21_021DCAA0(int param0, UnkStruct_ov21_021D0F6 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); @@ -155,7 +155,7 @@ static void ov21_021DD668(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 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 param2); +static void ov21_021DD1A8(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1, int heapID); static void ov21_021DD2B8(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); @@ -164,13 +164,13 @@ 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 *enCollection, int param4); static void ov21_021DD710(PokedexMapDisplay *mapDisplay, const UnkStruct_ov21_021DCACC *param1, const encounterCollection *enCollection, int param3); static void ov21_021DD8B4(PokedexMapDisplay *mapDisplay); -static u8 *ov21_021DD900(u32 heapID, const UnkStruct_ov21_021DCACC *param1, u32 *param2); -static u8 *ov21_021DD908(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 *param2); +static 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 ov21_021DDABC(encounterCollection *enCollection, UnkStruct_ov21_021DCACC *param1, int heapID); +static void PokedexEncounters_PopulateCategories(encounterCollection *enCollection, UnkStruct_ov21_021DCACC *param1, int heapID); static void ov21_021DDB68(encounterCollection *enCollection); void ov21_021DC9BC(UnkStruct_ov21_021E68F4 *param0, UnkStruct_ov21_021D0F60 *param1, int heapID) @@ -185,7 +185,7 @@ void ov21_021DC9BC(UnkStruct_ov21_021E68F4 *param0, UnkStruct_ov21_021D0F60 *par 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; @@ -280,7 +280,7 @@ 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; encounterCollection *encCollection; @@ -302,10 +302,10 @@ static int ov21_021DCAF8(UnkStruct_ov21_021E6A68 *param0, void *param1) } } - encCollection->extraFields = ov21_021DD900(param0->heapID, v0, &encCollection->numExtraFields); - encCollection->extraDungeons = ov21_021DD908(param0->heapID, v0, &encCollection->numExtraDungeons); + encCollection->invisibleFields = PokedexEncounters_InvisibleFields(param0->heapID, v0, &encCollection->numInvisibleFields); + encCollection->invisibleDungeons = PokedexEncounters_InvisibleDungeons(param0->heapID, v0, &encCollection->numInvisibleDungeons); - ov21_021DDABC(encCollection, v0, param0->heapID); + PokedexEncounters_PopulateCategories(encCollection, v0, param0->heapID); encCollection->encounterTime = v0->encounterTime; @@ -327,7 +327,7 @@ static int ov21_021DCB6C(UnkStruct_ov21_021E6A68 *param0, void *param1) if (encCollection->encounterTime != v0->encounterTime) { ov21_021DDB68(encCollection); - ov21_021DDABC(encCollection, v0, param0->heapID); + PokedexEncounters_PopulateCategories(encCollection, v0, param0->heapID); encCollection->encounterTime = v0->encounterTime; } @@ -338,12 +338,12 @@ static int ov21_021DCBA8(UnkStruct_ov21_021E6A68 *param0, void *param1) { encounterCollection *enCollection = param0->unk_08; - if (enCollection->extraFields) { - Heap_FreeToHeap(enCollection->extraFields); + if (enCollection->invisibleFields) { + Heap_FreeToHeap(enCollection->invisibleFields); } - if (enCollection->extraDungeons) { - Heap_FreeToHeap(enCollection->extraDungeons); + if (enCollection->invisibleDungeons) { + Heap_FreeToHeap(enCollection->invisibleDungeons); } ov21_021DDB68(enCollection); @@ -472,13 +472,13 @@ static int ov21_021DCD04(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo return 0; } -static void ov21_021DCDD0(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1, const UnkStruct_ov21_021DCACC *param2, const encounterCollection *enCollection, int param4) +static void ov21_021DCDD0(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1, const UnkStruct_ov21_021DCACC *param2, const encounterCollection *enCollection, int heapID) { - ov21_021DCE40(param1, param2, param4); - ov21_021DD668(mapDisplay, param1, param4); - ov21_021DCFC8(mapDisplay, param1, param4); - ov21_021DD1A8(mapDisplay, param1, param4); - ov21_021DD2E0(mapDisplay, param1, param2, param4); + 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); } @@ -503,28 +503,28 @@ static void ov21_021DCE40(UnkStruct_ov21_021DCAE0 *param0, const UnkStruct_ov21_ sub_020198C0(param0->unk_00->unk_00, 3, v1->rawData, 0, 0, v1->screenWidth / 8, v1->screenHeight / 8); Heap_FreeToHeap(v0); - if (param1->dexStatus->pokedexSFlag_2) { + if (param1->dexStatus->newmoonIslandVisible) { v0 = ov21_021D27B8(param0->unk_00, 65, 1, &v1, param2); sub_020198C0(param0->unk_00->unk_00, 3, v1->rawData, 13, 8, v1->screenWidth / 8, v1->screenHeight / 8); Heap_FreeToHeap(v0); } - if (param1->dexStatus->pokedexSFlag_4) { + if (param1->dexStatus->seabreakPathVisible) { v0 = ov21_021D27B8(param0->unk_00, 66, 1, &v1, param2); sub_020198C0(param0->unk_00->unk_00, 3, v1->rawData, 28, 7, v1->screenWidth / 8, v1->screenHeight / 8); Heap_FreeToHeap(v0); } - if (param1->dexStatus->pokedexSFlag_1) { + if (param1->dexStatus->fullmoonIslandVisible) { v0 = ov21_021D27B8(param0->unk_00, 67, 1, &v1, param2); sub_020198C0(param0->unk_00->unk_00, 3, v1->rawData, 11, 8, v1->screenWidth / 8, v1->screenHeight / 8); Heap_FreeToHeap(v0); } - if (param1->dexStatus->pokedexSFlag_3) { + if (param1->dexStatus->springPathVisible) { v0 = ov21_021D27B8(param0->unk_00, 68, 1, &v1, param2); sub_020198C0(param0->unk_00->unk_00, 3, v1->rawData, 25, 16, v1->screenWidth / 8, v1->screenHeight / 8); @@ -576,7 +576,7 @@ static void ov21_021DD114(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 SpriteResourceCollection_Remove(v0->unk_13C[3], mapDisplay->unk_D0[3]); } -static void ov21_021DD1A8(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1, int param2) +static void ov21_021DD1A8(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1, int heapID) { CellActorResourceData v0; CellActorInitParams v1; @@ -589,7 +589,7 @@ static void ov21_021DD1A8(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 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; @@ -602,11 +602,11 @@ static void ov21_021DD1A8(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 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++) { + 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); @@ -620,7 +620,7 @@ static void ov21_021DD2B8(PokedexMapDisplay *mapDisplay) CellActor_Delete(mapDisplay->unk_C8); mapDisplay->unk_C8 = NULL; - for (v0 = 0; v0 < (22 * 2); v0++) { + for (v0 = 0; v0 < (NUMDUNGEONS * 2); v0++) { CellActor_Delete(mapDisplay->cellActorArray[v0]); mapDisplay->cellActorArray[v0] = NULL; } @@ -836,23 +836,23 @@ static void ov21_021DD710(PokedexMapDisplay *mapDisplay, const UnkStruct_ov21_02 int xOffset, yOffset; int species; u8 *combinedMapArray; - int numMaps; + int numCombinedMaps; ov21_021DD8B4(mapDisplay); - mapDisplay->unk_838 = ov21_021D5948(mapDisplay->mapFieldCellMatrix_1, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH, mapDisplay->fieldCoordinatesArray, &enCollection->fieldsEncounteredOn, enCollection->extraFields, enCollection->numExtraFields); - numMaps = (enCollection->fieldsEncounteredOn.numMapsEncounteredOn - 1) + enCollection->numExtraFields; - combinedMapArray = Heap_AllocFromHeapAtEnd(heapID, numMaps); + mapDisplay->unk_838 = ov21_021D5948(mapDisplay->mapFieldCellMatrix_1, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH, mapDisplay->fieldCoordinatesArray, &enCollection->fieldsEncounteredOn, enCollection->invisibleFields, enCollection->numInvisibleFields); + numCombinedMaps = (enCollection->fieldsEncounteredOn.numMapsEncounteredOn - 1) + enCollection->numInvisibleFields; + combinedMapArray = Heap_AllocFromHeapAtEnd(heapID, numCombinedMaps); - for (index = 0; index < numMaps; index++) { - if (index < enCollection->numExtraFields) { - combinedMapArray[index] = enCollection->extraFields[index]; + for (index = 0; index < numCombinedMaps; index++) { + if (index < enCollection->numInvisibleFields) { + combinedMapArray[index] = enCollection->invisibleFields[index]; } else { - combinedMapArray[index] = enCollection->fieldsEncounteredOn.mapsEncounteredOnArray[index - enCollection->numExtraFields]; + combinedMapArray[index] = enCollection->fieldsEncounteredOn.mapsEncounteredOnArray[index - enCollection->numInvisibleFields]; } } - mapDisplay->unk_840 = ov21_021D5948(mapDisplay->mapFieldCellMatrix_2, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH, mapDisplay->fieldCoordinatesArray, &enCollection->fieldSpecialEncounters, combinedMapArray, numMaps); + mapDisplay->unk_840 = ov21_021D5948(mapDisplay->mapFieldCellMatrix_2, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH, mapDisplay->fieldCoordinatesArray, &enCollection->fieldSpecialEncounters, combinedMapArray, numCombinedMaps); Heap_FreeToHeap(combinedMapArray); MapFieldCellMatrix_SmoothCells(mapDisplay->mapFieldCellMatrix_1, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH); @@ -873,20 +873,20 @@ static void ov21_021DD710(PokedexMapDisplay *mapDisplay, const UnkStruct_ov21_02 } mapDisplay->numDungeons = 0; - mapDisplay->numDungeons = ov21_021D5A20(mapDisplay->cellActorArray, mapDisplay->numDungeons, (22 * 2), xOffset, yOffset, POKEDEXMAPXSCALE, POKEDEXMAPYSCALE, mapDisplay->dungeonCoordinatesArray, &enCollection->dungeonsEncounteredOn, 2, v2, enCollection->extraDungeons, enCollection->numExtraDungeons, &mapDisplay->unk_834); + mapDisplay->numDungeons = ov21_021D5A20(mapDisplay->cellActorArray, mapDisplay->numDungeons, (NUMDUNGEONS * 2), xOffset, yOffset, POKEDEXMAPXSCALE, POKEDEXMAPYSCALE, mapDisplay->dungeonCoordinatesArray, &enCollection->dungeonsEncounteredOn, 2, v2, enCollection->invisibleDungeons, enCollection->numInvisibleDungeons, &mapDisplay->unk_834); - numMaps = (enCollection->dungeonsEncounteredOn.numMapsEncounteredOn - 1) + enCollection->numExtraDungeons; - combinedMapArray = Heap_AllocFromHeapAtEnd(heapID, numMaps); + numCombinedMaps = (enCollection->dungeonsEncounteredOn.numMapsEncounteredOn - 1) + enCollection->numInvisibleDungeons; + combinedMapArray = Heap_AllocFromHeapAtEnd(heapID, numCombinedMaps); - for (index = 0; index < numMaps; index++) { - if (index < enCollection->numExtraDungeons) { - combinedMapArray[index] = enCollection->extraDungeons[index]; + for (index = 0; index < numCombinedMaps; index++) { + if (index < enCollection->numInvisibleDungeons) { + combinedMapArray[index] = enCollection->invisibleDungeons[index]; } else { - combinedMapArray[index] = enCollection->dungeonsEncounteredOn.mapsEncounteredOnArray[index - enCollection->numExtraDungeons]; + combinedMapArray[index] = enCollection->dungeonsEncounteredOn.mapsEncounteredOnArray[index - enCollection->numInvisibleDungeons]; } } - mapDisplay->numDungeons = ov21_021D5A20(mapDisplay->cellActorArray, mapDisplay->numDungeons, (22 * 2), xOffset, yOffset, POKEDEXMAPXSCALE, POKEDEXMAPYSCALE, mapDisplay->dungeonCoordinatesArray, &enCollection->dungeonSpecialEncounters, 3, v3, combinedMapArray, numMaps, &mapDisplay->unk_83C); + mapDisplay->numDungeons = ov21_021D5A20(mapDisplay->cellActorArray, mapDisplay->numDungeons, (NUMDUNGEONS * 2), xOffset, yOffset, POKEDEXMAPXSCALE, POKEDEXMAPYSCALE, mapDisplay->dungeonCoordinatesArray, &enCollection->dungeonSpecialEncounters, 3, v3, combinedMapArray, numCombinedMaps, &mapDisplay->unk_83C); Heap_FreeToHeap(combinedMapArray); } @@ -905,198 +905,198 @@ static void ov21_021DD8B4(PokedexMapDisplay *mapDisplay) mapDisplay->numDungeons = 0; } -static u8 *ov21_021DD900(u32 heapID, const UnkStruct_ov21_021DCACC *param1, u32 *numExtraFields) +static u8 *PokedexEncounters_InvisibleFields(u32 heapID, const UnkStruct_ov21_021DCACC *param1, u32 *numInvisibleFields) { - u32 extraFieldCount; + u32 fieldCount; int index; - u8 *extraFields; + u8 *invisibleFields; - extraFieldCount = 0; + fieldCount = 0; - if (param1->dexStatus->pokedexSFlag_1 == 0) { + if (param1->dexStatus->fullmoonIslandVisible == 0) { index = 0; - while (extraFieldsStructFlag_1[index] != 0xffff) { - extraFieldCount++; + while (fullmoonIslandFields[index] != TERMINALVALUE) { + fieldCount++; index++; } } - if (param1->dexStatus->pokedexSFlag_4 == 0) { + if (param1->dexStatus->seabreakPathVisible == 0) { index = 0; - while (extraFieldsStructFlag_4[index] != 0xffff) { - extraFieldCount++; + while (seabreakPathFields[index] != TERMINALVALUE) { + fieldCount++; index++; } } - if (param1->dexStatus->pokedexSFlag_2 == 0) { + if (param1->dexStatus->newmoonIslandVisible == 0) { index = 0; - while (extraFieldsStructFlag_2[index] != 0xffff) { - extraFieldCount++; + while (newmoonIslandFields[index] != TERMINALVALUE) { + fieldCount++; index++; } } - if (param1->dexStatus->pokedexSFlag_3 == 0) { + if (param1->dexStatus->springPathVisible == 0) { index = 0; - while (extraFieldsStructFlag_3[index] != 0xffff) { - extraFieldCount++; + while (springPathFields[index] != TERMINALVALUE) { + fieldCount++; index++; } } - if (extraFieldCount > 0) { - extraFields = Heap_AllocFromHeap(heapID, sizeof(u8) * extraFieldCount); + if (fieldCount > 0) { + invisibleFields = Heap_AllocFromHeap(heapID, sizeof(u8) * fieldCount); } else { - extraFields = NULL; + invisibleFields = NULL; } - *numExtraFields = extraFieldCount; + *numInvisibleFields = fieldCount; - extraFieldCount = 0; + fieldCount = 0; - if (param1->dexStatus->pokedexSFlag_1 == 0) { + if (param1->dexStatus->fullmoonIslandVisible == 0) { index = 0; - while (extraFieldsStructFlag_1[index] != 0xffff) { - extraFields[extraFieldCount] = extraFieldsStructFlag_1[index]; - extraFieldCount++; + while (fullmoonIslandFields[index] != TERMINALVALUE) { + invisibleFields[fieldCount] = fullmoonIslandFields[index]; + fieldCount++; index++; } } - if (param1->dexStatus->pokedexSFlag_4 == 0) { + if (param1->dexStatus->seabreakPathVisible == 0) { index = 0; - while (extraFieldsStructFlag_4[index] != 0xffff) { - extraFields[extraFieldCount] = extraFieldsStructFlag_4[index]; - extraFieldCount++; + while (seabreakPathFields[index] != TERMINALVALUE) { + invisibleFields[fieldCount] = seabreakPathFields[index]; + fieldCount++; index++; } } - if (param1->dexStatus->pokedexSFlag_2 == 0) { + if (param1->dexStatus->newmoonIslandVisible == 0) { index = 0; - while (extraFieldsStructFlag_2[index] != 0xffff) { - extraFields[extraFieldCount] = extraFieldsStructFlag_2[index]; - extraFieldCount++; + while (newmoonIslandFields[index] != TERMINALVALUE) { + invisibleFields[fieldCount] = newmoonIslandFields[index]; + fieldCount++; index++; } } - if (param1->dexStatus->pokedexSFlag_3 == 0) { + if (param1->dexStatus->springPathVisible == 0) { index = 0; - while (extraFieldsStructFlag_3[index] != 0xffff) { - extraFields[extraFieldCount] = extraFieldsStructFlag_3[index]; - extraFieldCount++; + while (springPathFields[index] != TERMINALVALUE) { + invisibleFields[fieldCount] = springPathFields[index]; + fieldCount++; index++; } } - return extraFields; + return invisibleFields; } -static u8 *ov21_021DD908(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 *numExtraDungeons) +static u8 *PokedexEncounters_InvisibleDungeons(u32 param0, const UnkStruct_ov21_021DCACC *param1, u32 *numInvisibleDungeons) { - u32 extraDungeonCount; + u32 dungeonCount; int index; - u8 *extraDungeons; + u8 *invisibleDungeons; - extraDungeonCount = 0; + dungeonCount = 0; - if (param1->dexStatus->pokedexSFlag_1 == 0) { + if (param1->dexStatus->fullmoonIslandVisible == 0) { index = 0; - while (Unk_ov21_021E9D76[index] != 0xffff) { - extraDungeonCount++; + while (fullmoonIslandDungeons[index] != TERMINALVALUE) { + dungeonCount++; index++; } } - if (param1->dexStatus->pokedexSFlag_4 == 0) { + if (param1->dexStatus->seabreakPathVisible == 0) { index = 0; - while (Unk_ov21_021E9D72[index] != 0xffff) { - extraDungeonCount++; + while (seabreakPathDungeons[index] != TERMINALVALUE) { + dungeonCount++; index++; } } - if (param1->dexStatus->pokedexSFlag_2 == 0) { + if (param1->dexStatus->newmoonIslandVisible == 0) { index = 0; - while (Unk_ov21_021E9D6E[index] != 0xffff) { - extraDungeonCount++; + while (newmoonIslandDungeons[index] != TERMINALVALUE) { + dungeonCount++; index++; } } - if (param1->dexStatus->pokedexSFlag_3 == 0) { + if (param1->dexStatus->springPathVisible == 0) { index = 0; - while (Unk_ov21_021E9D7A[index] != 0xffff) { - extraDungeonCount++; + while (springPathDungeons[index] != TERMINALVALUE) { + dungeonCount++; index++; } } - if (extraDungeonCount > 0) { - extraDungeons = Heap_AllocFromHeap(param0, sizeof(u8) * extraDungeonCount); + if (dungeonCount > 0) { + invisibleDungeons = Heap_AllocFromHeap(param0, sizeof(u8) * dungeonCount); } else { - extraDungeons = NULL; + invisibleDungeons = NULL; } - *numExtraDungeons = extraDungeonCount; + *numInvisibleDungeons = dungeonCount; - extraDungeonCount = 0; + dungeonCount = 0; - if (param1->dexStatus->pokedexSFlag_1 == 0) { + if (param1->dexStatus->fullmoonIslandVisible == 0) { index = 0; - while (Unk_ov21_021E9D76[index] != 0xffff) { - extraDungeons[extraDungeonCount] = Unk_ov21_021E9D76[index]; - extraDungeonCount++; + while (fullmoonIslandDungeons[index] != TERMINALVALUE) { + invisibleDungeons[dungeonCount] = fullmoonIslandDungeons[index]; + dungeonCount++; index++; } } - if (param1->dexStatus->pokedexSFlag_4 == 0) { + if (param1->dexStatus->seabreakPathVisible == 0) { index = 0; - while (Unk_ov21_021E9D72[index] != 0xffff) { - extraDungeons[extraDungeonCount] = Unk_ov21_021E9D72[index]; - extraDungeonCount++; + while (seabreakPathDungeons[index] != TERMINALVALUE) { + invisibleDungeons[dungeonCount] = seabreakPathDungeons[index]; + dungeonCount++; index++; } } - if (param1->dexStatus->pokedexSFlag_2 == 0) { + if (param1->dexStatus->newmoonIslandVisible == 0) { index = 0; - while (Unk_ov21_021E9D6E[index] != 0xffff) { - extraDungeons[extraDungeonCount] = Unk_ov21_021E9D6E[index]; - extraDungeonCount++; + while (newmoonIslandDungeons[index] != TERMINALVALUE) { + invisibleDungeons[dungeonCount] = newmoonIslandDungeons[index]; + dungeonCount++; index++; } } - if (param1->dexStatus->pokedexSFlag_3 == 0) { + if (param1->dexStatus->springPathVisible == 0) { index = 0; - while (Unk_ov21_021E9D7A[index] != 0xffff) { - extraDungeons[extraDungeonCount] = Unk_ov21_021E9D7A[index]; - extraDungeonCount++; + while (springPathDungeons[index] != TERMINALVALUE) { + invisibleDungeons[dungeonCount] = springPathDungeons[index]; + dungeonCount++; index++; } } - return extraDungeons; + return invisibleDungeons; } static void ov21_021DD964(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1) @@ -1144,7 +1144,7 @@ static void ov21_021DDA80(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 } } -static void ov21_021DDABC(encounterCollection *enCollection, UnkStruct_ov21_021DCACC *param1, int heapID) +static void PokedexEncounters_PopulateCategories(encounterCollection *enCollection, UnkStruct_ov21_021DCACC *param1, int heapID) { int dungeonCategory; int fieldCategory; diff --git a/src/overlay021/pokedex_sort.c b/src/overlay021/pokedex_sort.c index 2780433359..ff16804ec8 100644 --- a/src/overlay021/pokedex_sort.c +++ b/src/overlay021/pokedex_sort.c @@ -98,10 +98,10 @@ void Pokedex_Sort_PopulatepokedexStatus(pokedexStatus *dexStatus, UnkStruct_ov21 Pokedex_HeightWeightData_Load(dexStatus->HWData, 1, heapID); } - dexStatus->pokedexSFlag_1 = param1->pokedexSFlag_1; - dexStatus->pokedexSFlag_2 = param1->pokedexSFlag_2; - dexStatus->pokedexSFlag_3 = param1->pokedexSFlag_3; - dexStatus->pokedexSFlag_4 = param1->pokedexSFlag_4; + dexStatus->fullmoonIslandVisible = param1->fullmoonIslandVisible; + dexStatus->newmoonIslandVisible = param1->newmoonIslandVisible; + dexStatus->springPathVisible = param1->springPathVisible; + dexStatus->seabreakPathVisible = param1->seabreakPathVisible; } void pokedexstatus(pokedexStatus *dexStatus) diff --git a/src/unk_0206AFE0.c b/src/unk_0206AFE0.c index e5ca7462c2..4ad6e58ed9 100644 --- a/src/unk_0206AFE0.c +++ b/src/unk_0206AFE0.c @@ -27,7 +27,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; } @@ -53,28 +53,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; @@ -90,7 +90,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; @@ -105,12 +105,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) @@ -121,22 +121,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) @@ -154,12 +154,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; @@ -169,10 +169,10 @@ BOOL sub_0206B16C(VarsFlags *param0, int param1) static int sub_0206B194(int param0) { static const u16 v0[] = { - 0x208, - 0x229, - 0x312, - 0x1028, + 520, + 553, + 786, + 4136, }; GF_ASSERT(0 <= param0 && param0 < 4); @@ -181,17 +181,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) { - if (sub_0206B010(param0, (6 + (((0 + 0x4000) + 32) + 16)) + param1) == sub_0206B194(param1)) { + if (sub_0206B010(param0, (6 + (((0 + VARS_START) + 32) + 16)) + param1) == sub_0206B194(param1)) { return 1; } else { return 0; @@ -200,19 +200,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++; @@ -220,17 +220,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) @@ -239,16 +239,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; } @@ -276,12 +276,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) @@ -297,46 +297,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++; @@ -344,67 +344,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[] = { @@ -468,88 +468,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) @@ -577,15 +577,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))); } From b6c7ee725a01b1d79d3c7dbfa41b6474771dd57d Mon Sep 17 00:00:00 2001 From: h2o-DS Date: Fri, 25 Oct 2024 23:50:32 -0400 Subject: [PATCH 06/16] PokedexMapDisplay Named a few more variables --- include/overlay021/ov21_021DC9BC.h | 4 +- include/overlay021/struct_ov21_021D4CB8.h | 3 +- src/field_menu.c | 6 +- src/overlay021/ov21_021D0D80.c | 2 +- src/overlay021/ov21_021D4C0C.c | 4 +- src/overlay021/ov21_021D57B4.c | 4 +- src/overlay021/ov21_021D5AEC.c | 6 +- src/overlay021/ov21_021D76B0.c | 2 +- src/overlay021/ov21_021D94BC.c | 4 +- src/overlay021/ov21_021DC9BC.c | 126 +++++++++++----------- src/overlay021/ov21_021DE668.c | 2 +- src/overlay021/ov21_021DF734.c | 2 +- src/overlay021/ov21_021E0C68.c | 2 +- src/overlay021/ov21_021E1924.c | 2 +- src/overlay021/ov21_021E29DC.c | 2 +- src/overlay021/ov21_021E4CA4.c | 2 +- src/overlay021/ov21_021E68F4.c | 2 +- src/overlay021/ov21_021E8484.c | 2 +- src/overlay021/ov21_021E8D48.c | 4 +- 19 files changed, 91 insertions(+), 90 deletions(-) diff --git a/include/overlay021/ov21_021DC9BC.h b/include/overlay021/ov21_021DC9BC.h index a8214c7d7c..ee83a5564c 100644 --- a/include/overlay021/ov21_021DC9BC.h +++ b/include/overlay021/ov21_021DC9BC.h @@ -4,13 +4,13 @@ #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021E68F4.h" -#define TERMINALVALUE 0xffff +#define TERMINALVALUE 0xffff #define POKEDEXMAPXSCALE 5 #define POKEDEXMAPYSCALE 5 #define POKEDEXMAPHEIGHT 30 #define POKEDEXMAPWIDTH 30 #define POKEDEXMAPNUMCELLS (POKEDEXMAPHEIGHT * POKEDEXMAPWIDTH) -#define NUMDUNGEONS 22 +#define NUMDUNGEONS 22 void ov21_021DC9BC(UnkStruct_ov21_021E68F4 *param0, UnkStruct_ov21_021D0F60 *param1, int heapID); void ov21_021DCA14(UnkStruct_ov21_021E68F4 *param0); diff --git a/include/overlay021/struct_ov21_021D4CB8.h b/include/overlay021/struct_ov21_021D4CB8.h index 234268a0d0..48a3936b71 100644 --- a/include/overlay021/struct_ov21_021D4CB8.h +++ b/include/overlay021/struct_ov21_021D4CB8.h @@ -8,6 +8,7 @@ #include "overlay021/struct_ov21_021D4C0C_decl.h" #include "cell_actor.h" +#include "heap.h" typedef struct { UnkStruct_ov21_021D4C0C *unk_00; @@ -19,7 +20,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/src/field_menu.c b/src/field_menu.c index 2dff1936e6..35eebfc92b 100644 --- a/src/field_menu.c +++ b/src/field_menu.c @@ -960,9 +960,9 @@ static BOOL FieldMenu_Pokedex(TaskManager *taskMan) v2->unk_04 = v4; v2->timeOfDay = sub_02055BA8(fieldSystem); v2->fullmoonIslandVisible = sub_0206B1F0(v5, 0); // VarsFlags->vars[54] Fullmoon Island - v2->newmoonIslandVisible = sub_0206B1F0(v5, 1); // VarsFlags->vars[55] Newmoon Island - v2->springPathVisible = sub_0206B1F0(v5, 2); // VarsFlags->vars[56] Spring Path - v2->seabreakPathVisible = sub_0206B1F0(v5, 3); // VarsFlags->vars[57] Seabreak Path + v2->newmoonIslandVisible = sub_0206B1F0(v5, 1); // VarsFlags->vars[55] Newmoon Island + v2->springPathVisible = sub_0206B1F0(v5, 2); // VarsFlags->vars[56] Spring Path + v2->seabreakPathVisible = sub_0206B1F0(v5, 3); // VarsFlags->vars[57] Seabreak Path v2->unk_1C = fieldSystem->unk_B4; sub_0203E0AC(fieldSystem, v2); diff --git a/src/overlay021/ov21_021D0D80.c b/src/overlay021/ov21_021D0D80.c index dd7652a8d8..8d6baf381f 100644 --- a/src/overlay021/ov21_021D0D80.c +++ b/src/overlay021/ov21_021D0D80.c @@ -756,7 +756,7 @@ void ov21_021D1778(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, 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, pokeCaughtStatus->species); v2.unk_04 = v3; diff --git a/src/overlay021/ov21_021D4C0C.c b/src/overlay021/ov21_021D4C0C.c index 821899bc4b..ea9f383f62 100644 --- a/src/overlay021/ov21_021D4C0C.c +++ b/src/overlay021/ov21_021D4C0C.c @@ -74,7 +74,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); } @@ -99,7 +99,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_021D57B4.c b/src/overlay021/ov21_021D57B4.c index 6d3cece0bf..478d397bf0 100644 --- a/src/overlay021/ov21_021D57B4.c +++ b/src/overlay021/ov21_021D57B4.c @@ -151,7 +151,7 @@ void ov21_021D59D8(CellActor *actor, int xOffset, int yOffset, int xScale, int y } } -int ov21_021D5A20(CellActor **cellActorArray, int initialNumDungeons, int maxNumDungeons, int xOffset, int yOffset, int xScale, int yScale, const dungeonCoordinates *dungeonCoordinatesArray, const mapsEncounteredOn *dungeonsEncounteredOn, int animID_1, int animID_2, const u8 *dungeonsToSkip, u32 numDungeonsToSkip, u32 *param13) +int ov21_021D5A20(CellActor **cellActorArray, int initialNumDungeons, int maxNumDungeons, int xOffset, int yOffset, int xScale, int yScale, const dungeonCoordinates *dungeonCoordinatesArray, const mapsEncounteredOn *dungeonsEncounteredOn, int animID_1, int animID_2, const u8 *dungeonsToSkip, u32 numDungeonsToSkip, u32 *dungeonsModified) { int dungeonIndex, dungeonsToSkipIndex; int numDungeons = initialNumDungeons; @@ -174,7 +174,7 @@ int ov21_021D5A20(CellActor **cellActorArray, int initialNumDungeons, int maxNum } } - *param13 = DungeonCount; + *dungeonsModified = DungeonCount; return numDungeons; } diff --git a/src/overlay021/ov21_021D5AEC.c b/src/overlay021/ov21_021D5AEC.c index f354e87322..4939baa924 100644 --- a/src/overlay021/ov21_021D5AEC.c +++ b/src/overlay021/ov21_021D5AEC.c @@ -882,7 +882,7 @@ 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; v2 = param0->unk_24; @@ -1269,7 +1269,7 @@ 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, pokeCaughtStatus->species); @@ -1298,7 +1298,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); diff --git a/src/overlay021/ov21_021D76B0.c b/src/overlay021/ov21_021D76B0.c index 19e0c78edb..0788741cc9 100644 --- a/src/overlay021/ov21_021D76B0.c +++ b/src/overlay021/ov21_021D76B0.c @@ -688,7 +688,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); diff --git a/src/overlay021/ov21_021D94BC.c b/src/overlay021/ov21_021D94BC.c index ea1b123926..2fced1f1fb 100644 --- a/src/overlay021/ov21_021D94BC.c +++ b/src/overlay021/ov21_021D94BC.c @@ -2692,7 +2692,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); @@ -2717,7 +2717,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 bcbe3126fa..385ce582d7 100644 --- a/src/overlay021/ov21_021DC9BC.c +++ b/src/overlay021/ov21_021DC9BC.c @@ -109,8 +109,8 @@ typedef struct { CellActor *cellActorArray[NUMDUNGEONS * 2]; SpriteResource *unk_B4[4]; int numDungeons; - CellActor *unk_C8; - UnkStruct_ov21_021D4CA0 *unk_CC; + CellActor *AreaUnknownCellActor; + UnkStruct_ov21_021D4CA0 *AreaUnknownSpriteManager; SpriteResource *unk_D0[4]; UnkStruct_ov21_021D4CA0 *unk_E0[3]; u8 mapFieldCellMatrix_1[POKEDEXMAPNUMCELLS]; @@ -124,10 +124,10 @@ typedef struct { int unk_80C; int unk_810; UnkStruct_ov21_021D2648 unk_814; - u32 unk_834; - u32 unk_838; - u32 unk_83C; - u32 unk_840; + 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 heapID, UnkStruct_ov21_021D0F60 *param1); @@ -142,8 +142,8 @@ 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); 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(PokedexMapDisplay *mapDisplay); -static void ov21_021DD458(PokedexMapDisplay *mapDisplay); +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); @@ -156,7 +156,7 @@ static void ov21_021DD6C0(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 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 ov21_021DD2B8(PokedexMapDisplay *mapDisplay); +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 *enCollection); @@ -487,45 +487,45 @@ static void ov21_021DCE20(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 { ov21_021DD6C0(mapDisplay, param1); ov21_021DD3FC(mapDisplay); - ov21_021DD2B8(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); sub_020198C0(param0->unk_00->unk_00, 3, v1->rawData, 0, 0, v1->screenWidth / 8, v1->screenHeight / 8); Heap_FreeToHeap(v0); if (param1->dexStatus->newmoonIslandVisible) { - v0 = ov21_021D27B8(param0->unk_00, 65, 1, &v1, param2); + v0 = ov21_021D27B8(param0->unk_00, 65, 1, &v1, heapID); sub_020198C0(param0->unk_00->unk_00, 3, v1->rawData, 13, 8, v1->screenWidth / 8, v1->screenHeight / 8); Heap_FreeToHeap(v0); } if (param1->dexStatus->seabreakPathVisible) { - v0 = ov21_021D27B8(param0->unk_00, 66, 1, &v1, param2); + v0 = ov21_021D27B8(param0->unk_00, 66, 1, &v1, heapID); sub_020198C0(param0->unk_00->unk_00, 3, v1->rawData, 28, 7, v1->screenWidth / 8, v1->screenHeight / 8); Heap_FreeToHeap(v0); } if (param1->dexStatus->fullmoonIslandVisible) { - v0 = ov21_021D27B8(param0->unk_00, 67, 1, &v1, param2); + v0 = ov21_021D27B8(param0->unk_00, 67, 1, &v1, heapID); sub_020198C0(param0->unk_00->unk_00, 3, v1->rawData, 11, 8, v1->screenWidth / 8, v1->screenHeight / 8); Heap_FreeToHeap(v0); } if (param1->dexStatus->springPathVisible) { - v0 = ov21_021D27B8(param0->unk_00, 68, 1, &v1, param2); + v0 = ov21_021D27B8(param0->unk_00, 68, 1, &v1, heapID); sub_020198C0(param0->unk_00->unk_00, 3, v1->rawData, 25, 16, v1->screenWidth / 8, v1->screenHeight / 8); Heap_FreeToHeap(v0); @@ -534,30 +534,30 @@ static void ov21_021DCE40(UnkStruct_ov21_021DCAE0 *param0, const UnkStruct_ov21_ sub_0201C3C0(param0->unk_00->unk_00, 3); } -static void ov21_021DCFC8(PokedexMapDisplay *mapDisplay, 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); - mapDisplay->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(mapDisplay->unk_B4[0]); SpriteResource_ReleaseData(mapDisplay->unk_B4[0]); - mapDisplay->unk_B4[2] = SpriteResourceCollection_AddFrom(v0->unk_13C[2], v1, 106, 1, 106 + 6000, 2, param2); - mapDisplay->unk_B4[3] = SpriteResourceCollection_AddFrom(v0->unk_13C[3], v1, 107, 1, 107 + 6000, 3, param2); - mapDisplay->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(mapDisplay->unk_D0[0]); SpriteResource_ReleaseData(mapDisplay->unk_D0[0]); - mapDisplay->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(mapDisplay->unk_D0[1]); SpriteResource_ReleaseData(mapDisplay->unk_D0[1]); - mapDisplay->unk_D0[2] = SpriteResourceCollection_AddFrom(v0->unk_13C[2], v1, 91, 1, 91 + 6000, 2, param2); - mapDisplay->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(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1) @@ -593,9 +593,9 @@ static void ov21_021DD1A8(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 v1.position.x = 160 * FX32_ONE; v1.position.y = 96 * FX32_ONE; - mapDisplay->unk_C8 = CellActorCollection_Add(&v1); + mapDisplay->AreaUnknownCellActor = CellActorCollection_Add(&v1); - CellActor_SetAnim(mapDisplay->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; @@ -613,20 +613,20 @@ static void ov21_021DD1A8(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 } } -static void ov21_021DD2B8(PokedexMapDisplay *mapDisplay) +static void PokedexMapDisplay_DeleteCellActors(PokedexMapDisplay *mapDisplay) { - int v0; + int cellActorIndex; - CellActor_Delete(mapDisplay->unk_C8); - mapDisplay->unk_C8 = NULL; + CellActor_Delete(mapDisplay->AreaUnknownCellActor); + mapDisplay->AreaUnknownCellActor = NULL; - for (v0 = 0; v0 < (NUMDUNGEONS * 2); v0++) { - CellActor_Delete(mapDisplay->cellActorArray[v0]); - mapDisplay->cellActorArray[v0] = NULL; + for (cellActorIndex = 0; cellActorIndex < (NUMDUNGEONS * 2); cellActorIndex++) { + CellActor_Delete(mapDisplay->cellActorArray[cellActorIndex]); + mapDisplay->cellActorArray[cellActorIndex] = NULL; } } -static void ov21_021DD2E0(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1, const UnkStruct_ov21_021DCACC *param2, int enCollection) +static void ov21_021DD2E0(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1, const UnkStruct_ov21_021DCACC *param2, int heapID) { Window *v0; UnkStruct_ov21_021D4CB8 v1; @@ -636,7 +636,7 @@ static void ov21_021DD2E0(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 int v5; u32 v6; - GF_ASSERT(mapDisplay->unk_C8); + GF_ASSERT(mapDisplay->AreaUnknownCellActor); v2 = SpriteResourceCollection_Find(param1->unk_00->unk_13C[1], 14 + 6000); @@ -645,20 +645,20 @@ static void ov21_021DD2E0(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 v1.unk_18 = 1; v1.unk_1C = 31 - 1; v1.unk_20 = NNS_G2D_VRAM_TYPE_2DMAIN; - v1.unk_24 = enCollection; + 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 = mapDisplay->unk_C8; + v1.unk_0C = mapDisplay->AreaUnknownCellActor; v1.unk_10 = -(v6 / 2); v1.unk_14 = -8; - mapDisplay->unk_CC = ov21_021D4CA0(&v1); + mapDisplay->AreaUnknownSpriteManager = ov21_021D4CA0(&v1); - sub_02012A60(mapDisplay->unk_CC->unk_00, v4 + 2); + sub_02012A60(mapDisplay->AreaUnknownSpriteManager->unk_00, v4 + 2); ov21_021D4DA0(v0); for (v5 = 0; v5 < 3; v5++) { @@ -681,31 +681,31 @@ static void ov21_021DD3FC(PokedexMapDisplay *mapDisplay) { int v0; - ov21_021D4D1C(mapDisplay->unk_CC); + ov21_021D4D1C(mapDisplay->AreaUnknownSpriteManager); for (v0 = 0; v0 < 3; v0++) { ov21_021D4D1C(mapDisplay->unk_E0[v0]); } } -static void ov21_021DD420(PokedexMapDisplay *mapDisplay) +static void PokedexMapDisplay_OAMMode_XLU(PokedexMapDisplay *mapDisplay) { int v0; - CellActor_SetExplicitOAMMode(mapDisplay->unk_C8, GX_OAM_MODE_XLU); - sub_02012AF0(mapDisplay->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(mapDisplay->unk_E0[v0]->unk_00, GX_OAM_MODE_XLU); } } -static void ov21_021DD458(PokedexMapDisplay *mapDisplay) +static void PokedexMapDisplay_OAMMode_Normal(PokedexMapDisplay *mapDisplay) { int v0; - CellActor_SetExplicitOAMMode(mapDisplay->unk_C8, GX_OAM_MODE_NORMAL); - sub_02012AF0(mapDisplay->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(mapDisplay->unk_E0[v0]->unk_00, GX_OAM_MODE_NORMAL); @@ -714,7 +714,7 @@ static void ov21_021DD458(PokedexMapDisplay *mapDisplay) static void ov21_021DD490(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1, const UnkStruct_ov21_021DCACC *param2, BOOL param3) { - ov21_021DD420(mapDisplay); + PokedexMapDisplay_OAMMode_XLU(mapDisplay); if (ov21_021E2A54(param2->unk_08)) { if (param3) { @@ -739,7 +739,7 @@ static BOOL ov21_021DD508(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 if (v0) { if (param3) { - ov21_021DD458(mapDisplay); + PokedexMapDisplay_OAMMode_Normal(mapDisplay); } return 1; @@ -752,7 +752,7 @@ static BOOL ov21_021DD508(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 static void ov21_021DD554(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1, const UnkStruct_ov21_021DCACC *param2, BOOL param3) { - ov21_021DD420(mapDisplay); + PokedexMapDisplay_OAMMode_XLU(mapDisplay); if (param3 == 0) { ov21_021D2648(&mapDisplay->unk_814, 40, param1->unk_04, 120, param1->unk_08, param1->unk_10); @@ -793,7 +793,7 @@ static BOOL ov21_021DD5E4(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 if (v1 == 2) { if (param3 == 1) { - ov21_021DD458(mapDisplay); + PokedexMapDisplay_OAMMode_Normal(mapDisplay); } return 1; @@ -802,12 +802,12 @@ static BOOL ov21_021DD5E4(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 return 0; } -static void ov21_021DD668(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1, int param2) +static void ov21_021DD668(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1, int heapID) { BGL_FillWindow(¶m1->unk_00->unk_04, 0); - mapDisplay->unk_7F4 = ov21_021D2808(param1->unk_00, 30, 1, &mapDisplay->unk_7F8, param2); - mapDisplay->unk_7FC = ov21_021D2808(param1->unk_00, 31, 1, &mapDisplay->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); sub_0201C2B4(¶m1->unk_00->unk_04, 8); } @@ -840,7 +840,7 @@ static void ov21_021DD710(PokedexMapDisplay *mapDisplay, const UnkStruct_ov21_02 ov21_021DD8B4(mapDisplay); - mapDisplay->unk_838 = ov21_021D5948(mapDisplay->mapFieldCellMatrix_1, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH, mapDisplay->fieldCoordinatesArray, &enCollection->fieldsEncounteredOn, enCollection->invisibleFields, enCollection->numInvisibleFields); + mapDisplay->numVisibleFields = ov21_021D5948(mapDisplay->mapFieldCellMatrix_1, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH, mapDisplay->fieldCoordinatesArray, &enCollection->fieldsEncounteredOn, enCollection->invisibleFields, enCollection->numInvisibleFields); numCombinedMaps = (enCollection->fieldsEncounteredOn.numMapsEncounteredOn - 1) + enCollection->numInvisibleFields; combinedMapArray = Heap_AllocFromHeapAtEnd(heapID, numCombinedMaps); @@ -852,7 +852,7 @@ static void ov21_021DD710(PokedexMapDisplay *mapDisplay, const UnkStruct_ov21_02 } } - mapDisplay->unk_840 = ov21_021D5948(mapDisplay->mapFieldCellMatrix_2, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH, mapDisplay->fieldCoordinatesArray, &enCollection->fieldSpecialEncounters, combinedMapArray, numCombinedMaps); + mapDisplay->fieldsZero = ov21_021D5948(mapDisplay->mapFieldCellMatrix_2, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH, mapDisplay->fieldCoordinatesArray, &enCollection->fieldSpecialEncounters, combinedMapArray, numCombinedMaps); Heap_FreeToHeap(combinedMapArray); MapFieldCellMatrix_SmoothCells(mapDisplay->mapFieldCellMatrix_1, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH); @@ -873,7 +873,7 @@ static void ov21_021DD710(PokedexMapDisplay *mapDisplay, const UnkStruct_ov21_02 } mapDisplay->numDungeons = 0; - mapDisplay->numDungeons = ov21_021D5A20(mapDisplay->cellActorArray, mapDisplay->numDungeons, (NUMDUNGEONS * 2), xOffset, yOffset, POKEDEXMAPXSCALE, POKEDEXMAPYSCALE, mapDisplay->dungeonCoordinatesArray, &enCollection->dungeonsEncounteredOn, 2, v2, enCollection->invisibleDungeons, enCollection->numInvisibleDungeons, &mapDisplay->unk_834); + mapDisplay->numDungeons = ov21_021D5A20(mapDisplay->cellActorArray, mapDisplay->numDungeons, (NUMDUNGEONS * 2), xOffset, yOffset, POKEDEXMAPXSCALE, POKEDEXMAPYSCALE, mapDisplay->dungeonCoordinatesArray, &enCollection->dungeonsEncounteredOn, 2, v2, enCollection->invisibleDungeons, enCollection->numInvisibleDungeons, &mapDisplay->numVisibleDungeons); numCombinedMaps = (enCollection->dungeonsEncounteredOn.numMapsEncounteredOn - 1) + enCollection->numInvisibleDungeons; combinedMapArray = Heap_AllocFromHeapAtEnd(heapID, numCombinedMaps); @@ -886,7 +886,7 @@ static void ov21_021DD710(PokedexMapDisplay *mapDisplay, const UnkStruct_ov21_02 } } - mapDisplay->numDungeons = ov21_021D5A20(mapDisplay->cellActorArray, mapDisplay->numDungeons, (NUMDUNGEONS * 2), xOffset, yOffset, POKEDEXMAPXSCALE, POKEDEXMAPYSCALE, mapDisplay->dungeonCoordinatesArray, &enCollection->dungeonSpecialEncounters, 3, v3, combinedMapArray, numCombinedMaps, &mapDisplay->unk_83C); + mapDisplay->numDungeons = ov21_021D5A20(mapDisplay->cellActorArray, mapDisplay->numDungeons, (NUMDUNGEONS * 2), xOffset, yOffset, POKEDEXMAPXSCALE, POKEDEXMAPYSCALE, mapDisplay->dungeonCoordinatesArray, &enCollection->dungeonSpecialEncounters, 3, v3, combinedMapArray, numCombinedMaps, &mapDisplay->dungeonsZero); Heap_FreeToHeap(combinedMapArray); } @@ -1111,12 +1111,12 @@ static void ov21_021DD964(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 static void ov21_021DD9E8(PokedexMapDisplay *mapDisplay, const encounterCollection *enCollection) { - if ((mapDisplay->unk_834 <= 0) && (mapDisplay->unk_838 <= 0) && (mapDisplay->unk_83C <= 0) && (mapDisplay->unk_840 <= 0)) { - CellActor_SetDrawFlag(mapDisplay->unk_C8, 1); - sub_020129D0(mapDisplay->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(mapDisplay->unk_C8, 0); - sub_020129D0(mapDisplay->unk_CC->unk_00, 0); + CellActor_SetDrawFlag(mapDisplay->AreaUnknownCellActor, 0); + sub_020129D0(mapDisplay->AreaUnknownSpriteManager->unk_00, 0); } } diff --git a/src/overlay021/ov21_021DE668.c b/src/overlay021/ov21_021DE668.c index f442d08491..f666102289 100644 --- a/src/overlay021/ov21_021DE668.c +++ b/src/overlay021/ov21_021DE668.c @@ -772,7 +772,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 009bbda2a5..fcebb1d500 100644 --- a/src/overlay021/ov21_021DF734.c +++ b/src/overlay021/ov21_021DF734.c @@ -1070,7 +1070,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); diff --git a/src/overlay021/ov21_021E0C68.c b/src/overlay021/ov21_021E0C68.c index 25b0666377..ad29f5ae9b 100644 --- a/src/overlay021/ov21_021E0C68.c +++ b/src/overlay021/ov21_021E0C68.c @@ -554,7 +554,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 dca9cfac39..10a89ce6ff 100644 --- a/src/overlay021/ov21_021E1924.c +++ b/src/overlay021/ov21_021E1924.c @@ -794,7 +794,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); diff --git a/src/overlay021/ov21_021E29DC.c b/src/overlay021/ov21_021E29DC.c index 79629a0165..b4ea8cf43b 100644 --- a/src/overlay021/ov21_021E29DC.c +++ b/src/overlay021/ov21_021E29DC.c @@ -725,7 +725,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); diff --git a/src/overlay021/ov21_021E4CA4.c b/src/overlay021/ov21_021E4CA4.c index 5e80590b3d..10e3aa02ca 100644 --- a/src/overlay021/ov21_021E4CA4.c +++ b/src/overlay021/ov21_021E4CA4.c @@ -933,7 +933,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); diff --git a/src/overlay021/ov21_021E68F4.c b/src/overlay021/ov21_021E68F4.c index b6b8f6a8e6..69e6dffbe3 100644 --- a/src/overlay021/ov21_021E68F4.c +++ b/src/overlay021/ov21_021E68F4.c @@ -618,7 +618,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_021E8484.c b/src/overlay021/ov21_021E8484.c index 06e3d0e320..dc793d4bb5 100644 --- a/src/overlay021/ov21_021E8484.c +++ b/src/overlay021/ov21_021E8484.c @@ -582,7 +582,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 8f720cb037..7febb2b9d6 100644 --- a/src/overlay021/ov21_021E8D48.c +++ b/src/overlay021/ov21_021E8D48.c @@ -415,7 +415,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); @@ -566,7 +566,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); From eb720cf940dbfc4ca6d0237bfbc44fb0dfab59f0 Mon Sep 17 00:00:00 2001 From: h2o-DS Date: Sat, 26 Oct 2024 00:28:33 -0400 Subject: [PATCH 07/16] Merge Resolved --- src/overlay021/pokedex_sort.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/overlay021/pokedex_sort.c b/src/overlay021/pokedex_sort.c index ff16804ec8..7cd5d03a00 100644 --- a/src/overlay021/pokedex_sort.c +++ b/src/overlay021/pokedex_sort.c @@ -11,13 +11,13 @@ #include "overlay021/struct_speciesCaughtStatus.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_02006E3C.h" #include "unk_0202631C.h" static void Pokedex_Sort_Encountered(u16 *pokedexPreFilterArray, int *numEncountered, const PokedexData *dexData, const u16 *speciesArray, int pokedexLength); @@ -704,7 +704,7 @@ static u16 *Pokedex_Sort_SortedArray(int heapID, int pokedexSort, int *pokedexLe GF_ASSERT(47 > pokedexSort); pokedexDataNarcIndex = Pokedex_Data_NARC_Index(); - pokedexSortedArray = sub_02007068(pokedexDataNarcIndex, 11 + pokedexSort, 0, heapID, 0, &pokedexSize); + pokedexSortedArray = LoadMemberFromNARC_OutFileSize(pokedexDataNarcIndex, 11 + pokedexSort, 0, heapID, 0, &pokedexSize); *pokedexLength = pokedexSize / (sizeof(u16)); return pokedexSortedArray; From f0bbbe29938600df2e8f2cc28eb181121f94c268 Mon Sep 17 00:00:00 2001 From: h2o-DS Date: Sat, 26 Oct 2024 19:39:34 -0400 Subject: [PATCH 08/16] Cleaned up PokedexEncData Renamed ov21_021D57B4 to PokedexEncData Moved structs DungeonCoordinates, FieldCoordinates, and EncounterLocations to PokedexEncData.h Moved enum PokedexEncFileIndex to the c file. Created comment descriptions for PokedexEncData --- include/overlay021/ov21_021D57B4.h | 43 ---- include/overlay021/pokedexencdata.h | 155 +++++++++++++++ .../overlay021/struct_dungeoncoordinates.h | 11 -- include/overlay021/struct_fieldcoordinates.h | 12 -- include/overlay021/struct_ov21_021D5844.h | 9 - include/overlay021/struct_ov21_021E6B20.h | 4 +- platinum.us/main.lsf | 2 +- src/meson.build | 2 +- src/overlay021/ov21_021D57B4.c | 180 ----------------- src/overlay021/ov21_021DC9BC.c | 57 +++--- src/overlay021/pokedexencdata.c | 183 ++++++++++++++++++ 11 files changed, 370 insertions(+), 288 deletions(-) delete mode 100644 include/overlay021/ov21_021D57B4.h create mode 100644 include/overlay021/pokedexencdata.h delete mode 100644 include/overlay021/struct_dungeoncoordinates.h delete mode 100644 include/overlay021/struct_fieldcoordinates.h delete mode 100644 include/overlay021/struct_ov21_021D5844.h delete mode 100644 src/overlay021/ov21_021D57B4.c create mode 100644 src/overlay021/pokedexencdata.c diff --git a/include/overlay021/ov21_021D57B4.h b/include/overlay021/ov21_021D57B4.h deleted file mode 100644 index d957302ff1..0000000000 --- a/include/overlay021/ov21_021D57B4.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef POKEPLATINUM_OV21_021D57B4_H -#define POKEPLATINUM_OV21_021D57B4_H - -#include "overlay021/struct_dungeoncoordinates.h" -#include "overlay021/struct_fieldCoordinates.h" -#include "overlay021/struct_ov21_021D5844.h" - -#include "cell_actor.h" - -#define PEFI_DUNGEONMORNING 4 -#define PEFI_DUNGEONDAY (4 + MAX_SPECIES) -#define PEFI_DUNGEONNIGHT (4 + MAX_SPECIES * 2) -#define PEFI_DUNGEONSPECIAL (4 + MAX_SPECIES * 3) -#define PEFI_DUNGEONSPECIALNATDEX (4 + MAX_SPECIES * 4) -#define PEFI_FIELDMORNING (4 + MAX_SPECIES * 5) -#define PEFI_FIELDDAY (4 + MAX_SPECIES * 6) -#define PEFI_FIELDNIGHT (4 + MAX_SPECIES * 7) -#define PEFI_FIELDSPECIAL (4 + MAX_SPECIES * 8) -#define PEFI_FIELDSPECIALNATDEX (4 + MAX_SPECIES * 9) - -enum PokedexEncFileCatgegory { - PEFC_DUNGEONMORNING = 0, - PEFC_DUNGEONDAY = 1, - PEFC_DUNGEONNIGHT = 2, - PEFC_DUNGEONSPECIAL = 3, - PEFC_DUNGEONSPECIALNATDEX = 4, - PEFC_FIELDMORNING = 5, - PEFC_FIELDDAY = 6, - PEFC_FIELDNIGHT = 7, - PEFC_FIELDSPECIAL = 8, - PEFC_FIELDSPECIALNATDEX = 9, -}; - -void PokedexEncData_PopulateMapsEncounteredOn(mapsEncounteredOn *mapsEncOn, int species, int encounterCategory, int heapID); -void PokedexEncData_FreeMapsEncounteredOn(mapsEncounteredOn *mapsEncOn); -dungeonCoordinates *PokedexEncData_GetDungeonLocations(int heapID, int *numDungeons); -fieldCoordinates *PokedexEncData_GetFieldLocations(int heapID, int *numFields); -void ov21_021D58C0(u8 *param0, u8 param1, u8 param2, const fieldCoordinates *param3); -u32 ov21_021D5948(u8 *param0, int param1, int param2, const fieldCoordinates *param3, const mapsEncounteredOn *mapsEncOn, const u8 *param5, u32 param6); -void ov21_021D59D8(CellActor *param0, int param1, int param2, int param3, int param4, const dungeonCoordinates *param5, int param6, int param7); -int ov21_021D5A20(CellActor **param0, int param1, int param2, int param3, int param4, int param5, int param6, const dungeonCoordinates *param7, const mapsEncounteredOn *mapsEncOn, int param9, int param10, const u8 *param11, u32 param12, u32 *param13); - -#endif // POKEPLATINUM_OV21_021D57B4_H diff --git a/include/overlay021/pokedexencdata.h b/include/overlay021/pokedexencdata.h new file mode 100644 index 0000000000..692929c617 --- /dev/null +++ b/include/overlay021/pokedexencdata.h @@ -0,0 +1,155 @@ +#ifndef POKEPLATINUM_POKEDEXENCDATA_H +#define POKEPLATINUM_POKEDEXENCDATA_H + +#include "constants/species.h" + +#include "cell_actor.h" + +typedef struct { + 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 = 0, + PEFC_DUNGEONDAY = 1, + PEFC_DUNGEONNIGHT = 2, + PEFC_DUNGEONSPECIAL = 3, + PEFC_DUNGEONSPECIALNATDEX = 4, + PEFC_FIELDMORNING = 5, + PEFC_FIELDDAY = 6, + PEFC_FIELDNIGHT = 7, + PEFC_FIELDSPECIAL = 8, + PEFC_FIELDSPECIALNATDEX = 9, +}; + +/** + * @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/struct_dungeoncoordinates.h b/include/overlay021/struct_dungeoncoordinates.h deleted file mode 100644 index 02b9851d21..0000000000 --- a/include/overlay021/struct_dungeoncoordinates.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef POKEPLATINUM_STRUCT_DUNGEONCOORDINATES_H -#define POKEPLATINUM_STRUCT_DUNGEONCOORDINATES_H - -typedef struct { - u8 xCoordinate; - u8 yCoordinate; - u8 isMtCoronet; - u8 unused; -} dungeonCoordinates; - -#endif // POKEPLATINUM_STRUCT_DUNGEONCOORDINATES_H diff --git a/include/overlay021/struct_fieldcoordinates.h b/include/overlay021/struct_fieldcoordinates.h deleted file mode 100644 index 215945648e..0000000000 --- a/include/overlay021/struct_fieldcoordinates.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef POKEPLATINUM_STRUCT_FIELDCOORDINATES_H -#define POKEPLATINUM_STRUCT_FIELDCOORDINATES_H - -typedef struct { - u8 yCoordinate; - u8 xCoordinate; - u8 height; - u8 width; - u8 cellMatrix[32]; -} fieldCoordinates; - -#endif // POKEPLATINUM_STRUCT_FIELDCOORDINATES_H diff --git a/include/overlay021/struct_ov21_021D5844.h b/include/overlay021/struct_ov21_021D5844.h deleted file mode 100644 index d70e3458e0..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 *mapsEncounteredOnArray; - int numMapsEncounteredOn; -} mapsEncounteredOn; - -#endif // POKEPLATINUM_STRUCT_OV21_021D5844_H diff --git a/include/overlay021/struct_ov21_021E6B20.h b/include/overlay021/struct_ov21_021E6B20.h index c247a40f40..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 heapID; + enum HeapId heapID; void *unk_08; } UnkStruct_ov21_021E6B20; diff --git a/platinum.us/main.lsf b/platinum.us/main.lsf index e297dc0e23..967feeccac 100644 --- a/platinum.us/main.lsf +++ b/platinum.us/main.lsf @@ -794,7 +794,7 @@ Overlay overlay21 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_ov21_021D5600.c.o - Object main.nef.p/src_overlay021_ov21_021D57B4.c.o + Object main.nef.p/src_overlay021_pokedexencdata.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/src/meson.build b/src/meson.build index 5fdcddea9f..638207dedb 100644 --- a/src/meson.build +++ b/src/meson.build @@ -605,7 +605,7 @@ pokeplatinum_c = files( 'overlay021/ov21_021D4EE4.c', 'overlay021/ov21_021D517C.c', 'overlay021/ov21_021D5600.c', - 'overlay021/ov21_021D57B4.c', + 'overlay021/pokedexencdata.c', 'overlay021/ov21_021D5AEC.c', 'overlay021/ov21_021D76B0.c', 'overlay021/ov21_021D85B0.c', diff --git a/src/overlay021/ov21_021D57B4.c b/src/overlay021/ov21_021D57B4.c deleted file mode 100644 index adb2bc30a0..0000000000 --- a/src/overlay021/ov21_021D57B4.c +++ /dev/null @@ -1,180 +0,0 @@ -#include "overlay021/ov21_021D57B4.h" - -#include -#include - -#include "constants/species.h" - -#include "overlay021/struct_dungeoncoordinates.h" -#include "overlay021/struct_fieldCoordinates.h" -#include "overlay021/struct_ov21_021D5844.h" - -#include "cell_actor.h" -#include "graphics.h" -#include "heap.h" -#include "narc.h" - -void PokedexEncData_PopulateMapsEncounteredOn(mapsEncounteredOn *mapsEncOn, 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; - } - - mapsEncOn->mapsEncounteredOnArray = (int *)LoadMemberFromNARC_OutFileSize(NARC_INDEX_APPLICATION__ZUKANLIST__ZKN_DATA__ZUKAN_ENC_PLATINUM, fileIndex + species, 0, heapID, 0, &fileSize); - mapsEncOn->numMapsEncounteredOn = fileSize / sizeof(int); -} - -void PokedexEncData_FreeMapsEncounteredOn(mapsEncounteredOn *mapsEncOn) -{ - GF_ASSERT(mapsEncOn); - GF_ASSERT(mapsEncOn->mapsEncounteredOnArray); - - Heap_FreeToHeap(mapsEncOn->mapsEncounteredOnArray); - - mapsEncOn->mapsEncounteredOnArray = NULL; - mapsEncOn->numMapsEncounteredOn = 0; -} - -dungeonCoordinates *PokedexEncData_GetDungeonLocations(int heapID, int *numDungeons) -{ - dungeonCoordinates *dungeonCoordinatesArray; - u32 fileSize; - - dungeonCoordinatesArray = (dungeonCoordinates *)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_GetFieldLocations(int heapID, int *numFields) -{ - fieldCoordinates *fieldCoordinatesArray; - u32 fileSize; - - fieldCoordinatesArray = (fieldCoordinates *)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 ov21_021D58C0(u8 *mapFieldCellMatrix, u8 mapHeight, u8 mapWidth, const fieldCoordinates *fieldCoords) -{ - int xCoord, yCoord; - - GF_ASSERT((fieldCoords->xCoordinate + fieldCoords->width) < mapWidth); // param 1 and 2 are 30 - GF_ASSERT((fieldCoords->yCoordinate + fieldCoords->height) < mapHeight); - - for (xCoord = fieldCoords->xCoordinate; xCoord < fieldCoords->xCoordinate + fieldCoords->width; xCoord++) { - for (yCoord = fieldCoords->yCoordinate; yCoord < fieldCoords->yCoordinate + fieldCoords->height; yCoord++) { - mapFieldCellMatrix[(xCoord * mapHeight) + yCoord] |= fieldCoords->cellMatrix[((xCoord - fieldCoords->xCoordinate) * fieldCoords->height) + (yCoord - fieldCoords->yCoordinate)]; - } - } -} - -u32 ov21_021D5948(u8 *mapFieldCellMatrix, int mapHeight, int mapWidth, const fieldCoordinates *fieldCoordArray, const mapsEncounteredOn *mapsEncOn, const u8 *fieldIDArray, u32 fieldIDArrayLength) -{ - int fieldIndex; - int fieldIDArrayIndex; - u32 v2 = 0; - - for (fieldIndex = 0; fieldIndex < mapsEncOn->numMapsEncounteredOn - 1; fieldIndex++) { - GF_ASSERT(mapsEncOn->mapsEncounteredOnArray[fieldIndex]); - - for (fieldIDArrayIndex = 0; fieldIDArrayIndex < fieldIDArrayLength; fieldIDArrayIndex++) { - if (mapsEncOn->mapsEncounteredOnArray[fieldIndex] == fieldIDArray[fieldIDArrayIndex]) { - break; - } - } - - if (fieldIDArrayIndex >= fieldIDArrayLength) { - ov21_021D58C0(mapFieldCellMatrix, mapHeight, mapWidth, &fieldCoordArray[mapsEncOn->mapsEncounteredOnArray[fieldIndex]]); - v2++; - } - } - - return v2; -} - -void ov21_021D59D8(CellActor *actor, int xOffset, int yOffset, int xScale, int yScale, const dungeonCoordinates *dungeonCoords, int animID_1, int animID_2) -{ - VecFx32 position; - - position.x = (dungeonCoords->xCoordinate * xScale) + xOffset; - position.y = (dungeonCoords->yCoordinate * yScale) + yOffset; - position.x <<= FX32_SHIFT; - position.y <<= FX32_SHIFT; - - CellActor_SetPosition(actor, &position); - - if (dungeonCoords->isMtCoronet) { - CellActor_SetAnim(actor, animID_2); - } else { - CellActor_SetAnim(actor, animID_1); - } -} - -int ov21_021D5A20(CellActor **cellActorArray, int initialNumDungeons, int maxNumDungeons, int xOffset, int yOffset, int xScale, int yScale, const dungeonCoordinates *dungeonCoordinatesArray, const mapsEncounteredOn *dungeonsEncounteredOn, int animID_1, int animID_2, const u8 *dungeonsToSkip, u32 numDungeonsToSkip, u32 *dungeonsModified) -{ - int dungeonIndex, dungeonsToSkipIndex; - int numDungeons = initialNumDungeons; - int DungeonCount = 0; - - for (dungeonIndex = 0; dungeonIndex < dungeonsEncounteredOn->numMapsEncounteredOn - 1; dungeonIndex++) { - GF_ASSERT(dungeonsEncounteredOn->mapsEncounteredOnArray[dungeonIndex]); - GF_ASSERT(numDungeons < maxNumDungeons); - - for (dungeonsToSkipIndex = 0; dungeonsToSkipIndex < numDungeonsToSkip; dungeonsToSkipIndex++) { - if (dungeonsEncounteredOn->mapsEncounteredOnArray[dungeonIndex] == dungeonsToSkip[dungeonsToSkipIndex]) { - break; - } - } - - if (dungeonsToSkipIndex >= numDungeonsToSkip) { - ov21_021D59D8(cellActorArray[numDungeons], xOffset, yOffset, xScale, yScale, &dungeonCoordinatesArray[dungeonsEncounteredOn->mapsEncounteredOnArray[dungeonIndex]], animID_1, animID_2); - numDungeons++; - DungeonCount++; - } - } - - *dungeonsModified = DungeonCount; - - return numDungeons; -} diff --git a/src/overlay021/ov21_021DC9BC.c b/src/overlay021/ov21_021DC9BC.c index 67634e7e9b..774639d608 100644 --- a/src/overlay021/ov21_021DC9BC.c +++ b/src/overlay021/ov21_021DC9BC.c @@ -9,17 +9,14 @@ #include "overlay021/ov21_021D1FA4.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021D517C.h" -#include "overlay021/ov21_021D57B4.h" #include "overlay021/ov21_021E29DC.h" #include "overlay021/pokedex_sort.h" -#include "overlay021/struct_dungeoncoordinates.h" -#include "overlay021/struct_fieldCoordinates.h" +#include "overlay021/pokedexencdata.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D2648.h" #include "overlay021/struct_ov21_021D4CA0.h" #include "overlay021/struct_ov21_021D4CB8.h" -#include "overlay021/struct_ov21_021D5844.h" #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" @@ -97,10 +94,10 @@ typedef struct { u8 *invisibleDungeons; u32 numInvisibleFields; u32 numInvisibleDungeons; - mapsEncounteredOn dungeonsEncounteredOn; - mapsEncounteredOn fieldsEncounteredOn; - mapsEncounteredOn dungeonSpecialEncounters; - mapsEncounteredOn fieldSpecialEncounters; + EncounterLocations dungeonsEncounteredOn; + EncounterLocations fieldsEncounteredOn; + EncounterLocations dungeonSpecialEncounters; + EncounterLocations fieldSpecialEncounters; } encounterCollection; typedef struct { @@ -118,8 +115,8 @@ typedef struct { NNSG2dCharacterData *unk_7F8; void *unk_7FC; NNSG2dCharacterData *unk_800; - dungeonCoordinates *dungeonCoordinatesArray; - fieldCoordinates *fieldCoordinatesArray; + DungeonCoordinates *dungeonCoordinatesArray; + FieldCoordinates *fieldCoordinatesArray; int unk_80C; int unk_810; UnkStruct_ov21_021D2648 unk_814; @@ -368,8 +365,8 @@ static int ov21_021DCBD8(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo mapDisplay = param1->unk_08; mapDisplay->encounterTime = v0->encounterTime; - mapDisplay->dungeonCoordinatesArray = PokedexEncData_GetDungeonLocations(param1->heapID, NULL); - mapDisplay->fieldCoordinatesArray = PokedexEncData_GetFieldLocations(param1->heapID, NULL); + mapDisplay->dungeonCoordinatesArray = PokedexEncData_GetDungeonCoordinates(param1->heapID, NULL); + mapDisplay->fieldCoordinatesArray = PokedexEncData_GetFieldCoordinates(param1->heapID, NULL); param1->unk_00++; break; @@ -839,19 +836,19 @@ static void ov21_021DD710(PokedexMapDisplay *mapDisplay, const UnkStruct_ov21_02 ov21_021DD8B4(mapDisplay); - mapDisplay->numVisibleFields = ov21_021D5948(mapDisplay->mapFieldCellMatrix_1, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH, mapDisplay->fieldCoordinatesArray, &enCollection->fieldsEncounteredOn, enCollection->invisibleFields, enCollection->numInvisibleFields); - numCombinedMaps = (enCollection->fieldsEncounteredOn.numMapsEncounteredOn - 1) + enCollection->numInvisibleFields; + mapDisplay->numVisibleFields = PokedexEncData_LocateVisibleFields(mapDisplay->mapFieldCellMatrix_1, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH, mapDisplay->fieldCoordinatesArray, &enCollection->fieldsEncounteredOn, enCollection->invisibleFields, enCollection->numInvisibleFields); + numCombinedMaps = (enCollection->fieldsEncounteredOn.numLocations - 1) + enCollection->numInvisibleFields; combinedMapArray = Heap_AllocFromHeapAtEnd(heapID, numCombinedMaps); for (index = 0; index < numCombinedMaps; index++) { if (index < enCollection->numInvisibleFields) { combinedMapArray[index] = enCollection->invisibleFields[index]; } else { - combinedMapArray[index] = enCollection->fieldsEncounteredOn.mapsEncounteredOnArray[index - enCollection->numInvisibleFields]; + combinedMapArray[index] = enCollection->fieldsEncounteredOn.locations[index - enCollection->numInvisibleFields]; } } - mapDisplay->fieldsZero = ov21_021D5948(mapDisplay->mapFieldCellMatrix_2, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH, mapDisplay->fieldCoordinatesArray, &enCollection->fieldSpecialEncounters, combinedMapArray, numCombinedMaps); + mapDisplay->fieldsZero = PokedexEncData_LocateVisibleFields(mapDisplay->mapFieldCellMatrix_2, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH, mapDisplay->fieldCoordinatesArray, &enCollection->fieldSpecialEncounters, combinedMapArray, numCombinedMaps); Heap_FreeToHeap(combinedMapArray); MapFieldCellMatrix_SmoothCells(mapDisplay->mapFieldCellMatrix_1, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH); @@ -872,20 +869,20 @@ static void ov21_021DD710(PokedexMapDisplay *mapDisplay, const UnkStruct_ov21_02 } mapDisplay->numDungeons = 0; - mapDisplay->numDungeons = ov21_021D5A20(mapDisplay->cellActorArray, mapDisplay->numDungeons, (NUMDUNGEONS * 2), xOffset, yOffset, POKEDEXMAPXSCALE, POKEDEXMAPYSCALE, mapDisplay->dungeonCoordinatesArray, &enCollection->dungeonsEncounteredOn, 2, v2, enCollection->invisibleDungeons, enCollection->numInvisibleDungeons, &mapDisplay->numVisibleDungeons); + mapDisplay->numDungeons = PokedexEncData_LocateVisibleDungeons(mapDisplay->cellActorArray, mapDisplay->numDungeons, (NUMDUNGEONS * 2), xOffset, yOffset, POKEDEXMAPXSCALE, POKEDEXMAPYSCALE, mapDisplay->dungeonCoordinatesArray, &enCollection->dungeonsEncounteredOn, 2, v2, enCollection->invisibleDungeons, enCollection->numInvisibleDungeons, &mapDisplay->numVisibleDungeons); - numCombinedMaps = (enCollection->dungeonsEncounteredOn.numMapsEncounteredOn - 1) + enCollection->numInvisibleDungeons; + numCombinedMaps = (enCollection->dungeonsEncounteredOn.numLocations - 1) + enCollection->numInvisibleDungeons; combinedMapArray = Heap_AllocFromHeapAtEnd(heapID, numCombinedMaps); for (index = 0; index < numCombinedMaps; index++) { if (index < enCollection->numInvisibleDungeons) { combinedMapArray[index] = enCollection->invisibleDungeons[index]; } else { - combinedMapArray[index] = enCollection->dungeonsEncounteredOn.mapsEncounteredOnArray[index - enCollection->numInvisibleDungeons]; + combinedMapArray[index] = enCollection->dungeonsEncounteredOn.locations[index - enCollection->numInvisibleDungeons]; } } - mapDisplay->numDungeons = ov21_021D5A20(mapDisplay->cellActorArray, mapDisplay->numDungeons, (NUMDUNGEONS * 2), xOffset, yOffset, POKEDEXMAPXSCALE, POKEDEXMAPYSCALE, mapDisplay->dungeonCoordinatesArray, &enCollection->dungeonSpecialEncounters, 3, v3, combinedMapArray, numCombinedMaps, &mapDisplay->dungeonsZero); + mapDisplay->numDungeons = PokedexEncData_LocateVisibleDungeons(mapDisplay->cellActorArray, mapDisplay->numDungeons, (NUMDUNGEONS * 2), xOffset, yOffset, POKEDEXMAPXSCALE, POKEDEXMAPYSCALE, mapDisplay->dungeonCoordinatesArray, &enCollection->dungeonSpecialEncounters, 3, v3, combinedMapArray, numCombinedMaps, &mapDisplay->dungeonsZero); Heap_FreeToHeap(combinedMapArray); } @@ -1167,24 +1164,24 @@ static void PokedexEncounters_PopulateCategories(encounterCollection *enCollecti break; } - PokedexEncData_PopulateMapsEncounteredOn(&enCollection->dungeonsEncounteredOn, species, dungeonCategory, heapID); - PokedexEncData_PopulateMapsEncounteredOn(&enCollection->fieldsEncounteredOn, species, fieldCategory, heapID); + PokedexEncData_PopulateEncounterLocations(&enCollection->dungeonsEncounteredOn, species, dungeonCategory, heapID); + PokedexEncData_PopulateEncounterLocations(&enCollection->fieldsEncounteredOn, species, fieldCategory, heapID); if (Pokedex_Sort_PokedexUnlocked(param1->dexStatus) == 0) { - PokedexEncData_PopulateMapsEncounteredOn(&enCollection->dungeonSpecialEncounters, species, PEFC_DUNGEONSPECIAL, heapID); - PokedexEncData_PopulateMapsEncounteredOn(&enCollection->fieldSpecialEncounters, species, PEFC_FIELDSPECIAL, heapID); + PokedexEncData_PopulateEncounterLocations(&enCollection->dungeonSpecialEncounters, species, PEFC_DUNGEONSPECIAL, heapID); + PokedexEncData_PopulateEncounterLocations(&enCollection->fieldSpecialEncounters, species, PEFC_FIELDSPECIAL, heapID); } else { - PokedexEncData_PopulateMapsEncounteredOn(&enCollection->dungeonSpecialEncounters, species, PEFC_DUNGEONSPECIALNATDEX, heapID); - PokedexEncData_PopulateMapsEncounteredOn(&enCollection->fieldSpecialEncounters, species, PEFC_FIELDSPECIALNATDEX, heapID); + PokedexEncData_PopulateEncounterLocations(&enCollection->dungeonSpecialEncounters, species, PEFC_DUNGEONSPECIALNATDEX, heapID); + PokedexEncData_PopulateEncounterLocations(&enCollection->fieldSpecialEncounters, species, PEFC_FIELDSPECIALNATDEX, heapID); } } static void ov21_021DDB68(encounterCollection *enCollection) { - PokedexEncData_FreeMapsEncounteredOn(&enCollection->dungeonsEncounteredOn); - PokedexEncData_FreeMapsEncounteredOn(&enCollection->fieldsEncounteredOn); - PokedexEncData_FreeMapsEncounteredOn(&enCollection->dungeonSpecialEncounters); - PokedexEncData_FreeMapsEncounteredOn(&enCollection->fieldSpecialEncounters); + PokedexEncData_FreeEncounterLocations(&enCollection->dungeonsEncounteredOn); + PokedexEncData_FreeEncounterLocations(&enCollection->fieldsEncounteredOn); + PokedexEncData_FreeEncounterLocations(&enCollection->dungeonSpecialEncounters); + PokedexEncData_FreeEncounterLocations(&enCollection->fieldSpecialEncounters); } static void ov21_021DDB8C(PokedexMapDisplay *mapDisplay) diff --git a/src/overlay021/pokedexencdata.c b/src/overlay021/pokedexencdata.c new file mode 100644 index 0000000000..aed5b26c2d --- /dev/null +++ b/src/overlay021/pokedexencdata.c @@ -0,0 +1,183 @@ +#include "overlay021/pokedexencdata.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; +} From 33891b5fe110e68eba4211af9332263f87bdd6f5 Mon Sep 17 00:00:00 2001 From: h2o-DS Date: Sat, 26 Oct 2024 21:24:39 -0400 Subject: [PATCH 09/16] Cleaned up PokedexFieldMap Renamed ov21_021D517C to PokedexFieldMap Renamed sub_0206B1F0 to VarFlags_HiddenLocationsUnlocked and created corresponding enum --- include/overlay021/ov21_021D517C.h | 21 -- include/overlay021/ov21_021DC9BC.h | 8 - include/overlay021/pokedex_sort.h | 2 +- include/overlay021/pokedexfieldmap.h | 37 +++ include/overlay021/struct_ov21_021D3A60.h | 2 +- .../overlay021/struct_speciescaughtstatus.h | 2 +- include/unk_0206AFE0.h | 9 +- platinum.us/main.lsf | 2 +- src/field_map_change.c | 4 +- src/field_menu.c | 8 +- src/meson.build | 2 +- src/overlay021/ov21_021D0D80.c | 2 +- src/overlay021/ov21_021D517C.c | 276 ----------------- src/overlay021/ov21_021D5AEC.c | 8 +- src/overlay021/ov21_021DC9BC.c | 30 +- src/overlay021/pokedex_sort.c | 2 +- src/overlay021/pokedexfieldmap.c | 279 ++++++++++++++++++ src/overlay047/ov47_022561C0.c | 2 +- src/overlay048/ov48_022561C0.c | 2 +- src/unk_0206AFE0.c | 4 +- src/unk_0206B70C.c | 2 +- 21 files changed, 365 insertions(+), 339 deletions(-) delete mode 100644 include/overlay021/ov21_021D517C.h create mode 100644 include/overlay021/pokedexfieldmap.h delete mode 100644 src/overlay021/ov21_021D517C.c create mode 100644 src/overlay021/pokedexfieldmap.c diff --git a/include/overlay021/ov21_021D517C.h b/include/overlay021/ov21_021D517C.h deleted file mode 100644 index 9156db874f..0000000000 --- a/include/overlay021/ov21_021D517C.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef POKEPLATINUM_OV21_021D517C_H -#define POKEPLATINUM_OV21_021D517C_H - -#include "bg_window.h" - -enum CellNeighbors { - CN_ALONE = 0, - CN_WEST = (1 << 0), - CN_EAST = (1 << 1), - CN_SOUTH = (1 << 2), - CN_NORTH = (1 << 3), - CN_SOUTHWEST = (1 << 4), - CN_NORTHWEST = (1 << 5), - CN_SOUTHEAST = (1 << 6), - CN_NORTHEAST = (1 << 7), -}; - -void ov21_021D517C(Window *param0, u8 *param1, u16 param2, u16 param3, u8 param4, u8 *param5, u8 param6, u8 param7, u16 param8, u16 param9); -void MapFieldCellMatrix_SmoothCells(u8 *mapFieldCellMatrix, u8 mapHeight, u8 mapWidth); - -#endif // POKEPLATINUM_OV21_021D517C_H diff --git a/include/overlay021/ov21_021DC9BC.h b/include/overlay021/ov21_021DC9BC.h index ee83a5564c..8e35b79d3d 100644 --- a/include/overlay021/ov21_021DC9BC.h +++ b/include/overlay021/ov21_021DC9BC.h @@ -4,14 +4,6 @@ #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021E68F4.h" -#define TERMINALVALUE 0xffff -#define POKEDEXMAPXSCALE 5 -#define POKEDEXMAPYSCALE 5 -#define POKEDEXMAPHEIGHT 30 -#define POKEDEXMAPWIDTH 30 -#define POKEDEXMAPNUMCELLS (POKEDEXMAPHEIGHT * POKEDEXMAPWIDTH) -#define NUMDUNGEONS 22 - 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); diff --git a/include/overlay021/pokedex_sort.h b/include/overlay021/pokedex_sort.h index bae050c38e..fda2f66f8c 100644 --- a/include/overlay021/pokedex_sort.h +++ b/include/overlay021/pokedex_sort.h @@ -40,7 +40,7 @@ int ov21_021D3770(const pokedexStatus *param0, u32 param1); BOOL ov21_021D3794(pokedexStatus *param0, int param1); int Pokedex_Sort_CurrentSpecies(const pokedexStatus *param0); int Pokedex_Sort_CurrentCaughtStatus(const pokedexStatus *param0); -const speciesCaughtStatus *Pokedex_Sort_SpeciesCaughtStatus(const pokedexStatus *param0, int dexIndex); +const SpeciesCaughtStatus *Pokedex_Sort_SpeciesCaughtStatus(const pokedexStatus *param0, int dexIndex); BOOL ov21_021D37F8(const pokedexStatus *param0, int param1); BOOL ov21_021D3810(pokedexStatus *param0, int param1); BOOL ov21_021D3844(pokedexStatus *param0, int param1); diff --git a/include/overlay021/pokedexfieldmap.h b/include/overlay021/pokedexfieldmap.h new file mode 100644 index 0000000000..ea6577765e --- /dev/null +++ b/include/overlay021/pokedexfieldmap.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 different 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/struct_ov21_021D3A60.h b/include/overlay021/struct_ov21_021D3A60.h index a69ad10740..6cf6486a51 100644 --- a/include/overlay021/struct_ov21_021D3A60.h +++ b/include/overlay021/struct_ov21_021D3A60.h @@ -6,7 +6,7 @@ #include "overlay021/struct_speciesCaughtStatus.h" typedef struct { - speciesCaughtStatus caughtStatusArray[NATIONAL_DEX_COUNT]; + SpeciesCaughtStatus caughtStatusArray[NATIONAL_DEX_COUNT]; int unk_F68; int numEncountered; // number of pokemon seen int encounteredIndexArray[NATIONAL_DEX_COUNT]; // dex number for appearing in dex, dexLength+1 otherwise diff --git a/include/overlay021/struct_speciescaughtstatus.h b/include/overlay021/struct_speciescaughtstatus.h index 98f690a002..ed3a7bb16f 100644 --- a/include/overlay021/struct_speciescaughtstatus.h +++ b/include/overlay021/struct_speciescaughtstatus.h @@ -10,6 +10,6 @@ enum CaughtStatus { typedef struct { int species; enum CaughtStatus caughtStatus; -} speciesCaughtStatus; +} SpeciesCaughtStatus; #endif // POKEPLATINUM_STRUCT_SPECIESCAUGHTSTATUS_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 967feeccac..eab7f98464 100644 --- a/platinum.us/main.lsf +++ b/platinum.us/main.lsf @@ -792,7 +792,7 @@ Overlay overlay21 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_pokedexfieldmap.c.o Object main.nef.p/src_overlay021_ov21_021D5600.c.o Object main.nef.p/src_overlay021_pokedexencdata.c.o Object main.nef.p/src_overlay021_ov21_021D5AEC.c.o diff --git a/src/field_map_change.c b/src/field_map_change.c index 7f4db48cc1..65277cce5e 100644 --- a/src/field_map_change.c +++ b/src/field_map_change.c @@ -374,11 +374,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 03f15731ee..af832711ea 100644 --- a/src/field_menu.c +++ b/src/field_menu.c @@ -958,10 +958,10 @@ static BOOL FieldMenu_Pokedex(TaskManager *taskMan) v2->unk_00 = v3; v2->unk_04 = v4; v2->timeOfDay = sub_02055BA8(fieldSystem); - v2->fullmoonIslandVisible = sub_0206B1F0(v5, 0); // VarsFlags->vars[54] Fullmoon Island - v2->newmoonIslandVisible = sub_0206B1F0(v5, 1); // VarsFlags->vars[55] Newmoon Island - v2->springPathVisible = sub_0206B1F0(v5, 2); // VarsFlags->vars[56] Spring Path - v2->seabreakPathVisible = sub_0206B1F0(v5, 3); // VarsFlags->vars[57] Seabreak Path + 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 638207dedb..b72865d781 100644 --- a/src/meson.build +++ b/src/meson.build @@ -603,7 +603,7 @@ pokeplatinum_c = files( 'overlay021/ov21_021D4340.c', 'overlay021/ov21_021D4C0C.c', 'overlay021/ov21_021D4EE4.c', - 'overlay021/ov21_021D517C.c', + 'overlay021/pokedexfieldmap.c', 'overlay021/ov21_021D5600.c', 'overlay021/pokedexencdata.c', 'overlay021/ov21_021D5AEC.c', diff --git a/src/overlay021/ov21_021D0D80.c b/src/overlay021/ov21_021D0D80.c index ac621f7d94..5d7fdd1d9c 100644 --- a/src/overlay021/ov21_021D0D80.c +++ b/src/overlay021/ov21_021D0D80.c @@ -721,7 +721,7 @@ void ov21_021D1778(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, Window *v3; SpriteResource *v4; VecFx32 v5; - const speciesCaughtStatus *pokeCaughtStatus; + const SpeciesCaughtStatus *pokeCaughtStatus; u32 v7 = ov21_021D36D8(param1); pokeCaughtStatus = Pokedex_Sort_SpeciesCaughtStatus(param1, dexIndex); diff --git a/src/overlay021/ov21_021D517C.c b/src/overlay021/ov21_021D517C.c deleted file mode 100644 index e94c9a5e38..0000000000 --- a/src/overlay021/ov21_021D517C.c +++ /dev/null @@ -1,276 +0,0 @@ -#include "overlay021/ov21_021D517C.h" - -#include -#include - -#include "bg_window.h" - -static void ov21_021D5248(Window *param0, u8 *param1, u16 cellWidth, u16 cellHeight, int mapScale, int cellType, u8 yCoord, u8 xCoord); -static void MapFieldCellMatrix_CellType(u8 *mapFieldCellMatrix, int y, int x, int mapHeight, int mapWidth); -static int MapFieldCellMatrix_Value(u8 *mapFieldCellMatrix, int y, int x, int mapHeight, int mapWidth); -static void MapFieldCellMatrix_NeighboringCells(u8 *mapFieldCellMatrix, int *neighbors, int y, int x, int mapHeight, int mapWidth); -static int MapFieldCellMatrix_EmptyCellType(int neighbors); - -void ov21_021D517C(Window *param0, u8 *param1, u16 cellWidth, u16 cellHeight, u8 mapScale, u8 *mapFieldCellMatrix, u8 mapHeight, u8 mapWidth, u16 yOffset, u16 xOffset) -{ - int x, y; - - for (x = 0; x < mapWidth; x++) { - for (y = 0; y < mapHeight; y++) { - ov21_021D5248(param0, param1, cellWidth, cellHeight, mapScale, mapFieldCellMatrix[(x * mapWidth) + y], yOffset + (y * mapScale), xOffset + (x * mapScale)); - } - } -} - -void MapFieldCellMatrix_SmoothCells(u8 *mapFieldCellMatrix, u8 mapHeight, u8 mapWidth) -{ - int x, y; - - for (x = 0; x < mapWidth; x++) { - for (y = 0; y < mapHeight; y++) { - MapFieldCellMatrix_CellType(mapFieldCellMatrix, y, x, mapHeight, mapWidth); - } - } -} - -static void ov21_021D5248(Window *param0, u8 *param1, u16 cellWidth, u16 cellHeight, int mapScale, int cellType, u8 yCoord, u8 xCoord) -{ - int v0; - int v1; - - if (cellType != 0) { - v0 = cellType * mapScale; - v1 = v0 / cellWidth; - v0 = v0 % cellWidth; - - Window_BlitBitmapRect(param0, param1, v0, v1, cellWidth, cellHeight, yCoord, xCoord, mapScale, mapScale); - } -} - -static void MapFieldCellMatrix_CellType(u8 *mapFieldCellMatrix, int y, int x, int mapHeight, int mapWidth) -{ - int neighbors; - int cellType; - - if (mapFieldCellMatrix[(x * mapHeight) + y] == 0) { - MapFieldCellMatrix_NeighboringCells(mapFieldCellMatrix, &neighbors, y, x, mapHeight, mapWidth); - - cellType = MapFieldCellMatrix_EmptyCellType(neighbors); - mapFieldCellMatrix[(x * mapHeight) + y] = cellType; - } -} - -static int MapFieldCellMatrix_Value(u8 *mapFieldCellMatrix, int y, int x, int mapHeight, int mapWidth) -{ - if ((y < 0) || (y >= mapHeight)) { - return -1; - } - - if ((x < 0) || (x >= mapWidth)) { - return -1; - } - - return mapFieldCellMatrix[(x * mapHeight) + y]; -} - -static void MapFieldCellMatrix_NeighboringCells(u8 *mapFieldCellMatrix, int *neighbors, int y, int x, int mapHeight, int mapWidth) -{ - int v0; - - *neighbors = 0; // binary storage of cells (NE)(SE)(NW)(SW)(N)(S)(E)(W) - // only records intercardinal directions if adjacent cardinals are both empty - - if (MapFieldCellMatrix_Value(mapFieldCellMatrix, y, x - 1, mapHeight, mapWidth) == 1) { - *neighbors |= CN_WEST; - } - - if (MapFieldCellMatrix_Value(mapFieldCellMatrix, y, x + 1, mapHeight, mapWidth) == 1) { - *neighbors |= CN_EAST; - } - - if (MapFieldCellMatrix_Value(mapFieldCellMatrix, y - 1, x, mapHeight, mapWidth) == 1) { - *neighbors |= CN_SOUTH; - } - - if (MapFieldCellMatrix_Value(mapFieldCellMatrix, y + 1, x, mapHeight, mapWidth) == 1) { - *neighbors |= CN_NORTH; - } - - if ((((*neighbors) & CN_WEST) == 0) && (((*neighbors) & CN_SOUTH) == 0)) { - if (MapFieldCellMatrix_Value(mapFieldCellMatrix, y - 1, x - 1, mapHeight, mapWidth) == 1) { - *neighbors |= CN_SOUTHWEST; - } - } - - if ((((*neighbors) & CN_WEST) == 0) && (((*neighbors) & CN_NORTH) == 0)) { - if (MapFieldCellMatrix_Value(mapFieldCellMatrix, y + 1, x - 1, mapHeight, mapWidth) == 1) { - *neighbors |= CN_NORTHWEST; - } - } - - if ((((*neighbors) & CN_EAST) == 0) && (((*neighbors) & CN_SOUTH) == 0)) { - if (MapFieldCellMatrix_Value(mapFieldCellMatrix, y - 1, x + 1, mapHeight, mapWidth) == 1) { - *neighbors |= CN_SOUTHEAST; - } - } - - if ((((*neighbors) & CN_EAST) == 0) && (((*neighbors) & CN_NORTH) == 0)) { - if (MapFieldCellMatrix_Value(mapFieldCellMatrix, y + 1, x + 1, mapHeight, mapWidth) == 1) { - *neighbors |= CN_NORTHEAST; - } - } -} - -static int MapFieldCellMatrix_EmptyCellType(int neighbors) -{ - int v0; - - switch (neighbors) { - case CN_ALONE: - v0 = 0; - break; - case (CN_WEST): - v0 = 2; - break; - case (CN_EAST): - v0 = 3; - break; - case (CN_SOUTH): - v0 = 4; - break; - case (CN_NORTH): - v0 = 5; - break; - case (CN_WEST | CN_EAST): - v0 = 6; - break; - case (CN_WEST | CN_SOUTH): - v0 = 7; - break; - case (CN_WEST | CN_NORTH): - v0 = 8; - break; - case (CN_EAST | CN_SOUTH): - v0 = 9; - break; - case (CN_EAST | CN_NORTH): - v0 = 10; - break; - case (CN_SOUTH | CN_NORTH): - v0 = 11; - break; - case (CN_WEST | CN_EAST | CN_SOUTH): - v0 = 12; - break; - case (CN_WEST | CN_EAST | CN_NORTH): - v0 = 13; - break; - case (CN_WEST | CN_SOUTH | CN_NORTH): - v0 = 14; - break; - case (CN_EAST | CN_SOUTH | CN_NORTH): - v0 = 15; - break; - case (CN_WEST | CN_EAST | CN_SOUTH | CN_NORTH): - v0 = 16; - break; - case (CN_SOUTHWEST): - v0 = 17; - break; - case (CN_NORTHWEST): - v0 = 18; - break; - case (CN_SOUTHEAST): - v0 = 19; - break; - case (CN_NORTHEAST): - v0 = 20; - break; - case (CN_SOUTHWEST | CN_NORTHWEST): - v0 = 21; - break; - case (CN_SOUTHWEST | CN_SOUTHEAST): - v0 = 22; - break; - case (CN_SOUTHWEST | CN_NORTHEAST): - v0 = 23; - break; - case (CN_NORTHWEST | CN_SOUTHEAST): - v0 = 24; - break; - case (CN_NORTHWEST | CN_NORTHEAST): - v0 = 25; - break; - case (CN_SOUTHEAST | CN_NORTHEAST): - v0 = 26; - break; - case (CN_SOUTHWEST | CN_NORTHWEST | CN_SOUTHEAST): - v0 = 27; - break; - case (CN_SOUTHWEST | CN_NORTHWEST | CN_NORTHEAST): - v0 = 28; - break; - case (CN_SOUTHWEST | CN_SOUTHEAST | CN_NORTHEAST): - v0 = 29; - break; - case (CN_NORTHWEST | CN_SOUTHEAST | CN_NORTHEAST): - v0 = 30; - break; - case (CN_SOUTHWEST | CN_NORTHWEST | CN_SOUTHEAST | CN_NORTHEAST): - v0 = 31; - break; - case (CN_WEST | CN_SOUTHEAST | CN_NORTHEAST): - v0 = 32; - break; - case (CN_EAST | CN_SOUTHWEST | CN_NORTHWEST): - v0 = 33; - break; - case (CN_SOUTH | CN_NORTHWEST | CN_NORTHEAST): - v0 = 34; - break; - case (CN_NORTH | CN_SOUTHWEST | CN_SOUTHEAST): - v0 = 35; - break; - case (CN_WEST | CN_SOUTH | CN_NORTHEAST): - v0 = 36; - break; - case (CN_WEST | CN_NORTH | CN_SOUTHEAST): - v0 = 37; - break; - case (CN_EAST | CN_SOUTH | CN_NORTHWEST): - v0 = 38; - break; - case (CN_EAST | CN_NORTH | CN_SOUTHWEST): - v0 = 39; - break; - case (CN_WEST | CN_SOUTHEAST): - v0 = 40; - break; - case (CN_WEST | CN_NORTHEAST): - v0 = 41; - break; - case (CN_EAST | CN_SOUTHWEST): - v0 = 42; - break; - case (CN_EAST | CN_NORTHWEST): - v0 = 43; - break; - case (CN_SOUTH | CN_NORTHWEST): - v0 = 44; - break; - case (CN_SOUTH | CN_NORTHEAST): - v0 = 45; - break; - case (CN_NORTH | CN_SOUTHWEST): - v0 = 46; - break; - case (CN_NORTH | CN_SOUTHEAST): - v0 = 47; - break; - default: - GF_ASSERT(0); - break; - } - - return v0; -} diff --git a/src/overlay021/ov21_021D5AEC.c b/src/overlay021/ov21_021D5AEC.c index d97a2ac2c7..90585fd792 100644 --- a/src/overlay021/ov21_021D5AEC.c +++ b/src/overlay021/ov21_021D5AEC.c @@ -870,7 +870,7 @@ static void ov21_021D67EC(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13 int v3; UnkStruct_ov21_021D4CB8 v4; Window *v5; - const speciesCaughtStatus *pokeCaughtStatus; + const SpeciesCaughtStatus *pokeCaughtStatus; int dexIndex; v4.unk_00 = param1->unk_14C; @@ -918,7 +918,7 @@ static void ov21_021D68C8(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13 { int dexIndex; int v1; - const speciesCaughtStatus *pokeCaughtStatus; + const SpeciesCaughtStatus *pokeCaughtStatus; v1 = ov21_021D3898(param2->unk_04); dexIndex = ov21_021D375C(param2->unk_04); @@ -1084,7 +1084,7 @@ static void ov21_021D6AE4(UnkStruct_ov21_021D71A8 *param0, const UnkStruct_ov21_ int v5; int v6; int v7; - const speciesCaughtStatus *pokeCaughtStatus; + const SpeciesCaughtStatus *pokeCaughtStatus; int v9; int v10; int dexIndex; @@ -1255,7 +1255,7 @@ static void ov21_021D6D78(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13 { UnkStruct_ov21_021D4CB8 v0; Window *v1; - const speciesCaughtStatus *pokeCaughtStatus; + const SpeciesCaughtStatus *pokeCaughtStatus; pokeCaughtStatus = Pokedex_Sort_SpeciesCaughtStatus(param2->unk_04, dexIndex); GF_ASSERT(pokeCaughtStatus); diff --git a/src/overlay021/ov21_021DC9BC.c b/src/overlay021/ov21_021DC9BC.c index 774639d608..c51043a66a 100644 --- a/src/overlay021/ov21_021DC9BC.c +++ b/src/overlay021/ov21_021DC9BC.c @@ -8,10 +8,10 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" #include "overlay021/ov21_021D4C0C.h" -#include "overlay021/ov21_021D517C.h" #include "overlay021/ov21_021E29DC.h" #include "overlay021/pokedex_sort.h" #include "overlay021/pokedexencdata.h" +#include "overlay021/pokedexfieldmap.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D2648.h" @@ -35,6 +35,14 @@ #include "unk_02012744.h" #include "unk_0201F834.h" +#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 }; @@ -109,8 +117,8 @@ typedef struct { UnkStruct_ov21_021D4CA0 *AreaUnknownSpriteManager; SpriteResource *unk_D0[4]; UnkStruct_ov21_021D4CA0 *unk_E0[3]; - u8 mapFieldCellMatrix_1[POKEDEXMAPNUMCELLS]; - u8 mapFieldCellMatrix_2[POKEDEXMAPNUMCELLS]; + u8 pokedexFieldMap_1[POKEDEXMAPNUMCELLS]; + u8 pokedexFieldMap_2[POKEDEXMAPNUMCELLS]; void *unk_7F4; NNSG2dCharacterData *unk_7F8; void *unk_7FC; @@ -836,7 +844,7 @@ static void ov21_021DD710(PokedexMapDisplay *mapDisplay, const UnkStruct_ov21_02 ov21_021DD8B4(mapDisplay); - mapDisplay->numVisibleFields = PokedexEncData_LocateVisibleFields(mapDisplay->mapFieldCellMatrix_1, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH, mapDisplay->fieldCoordinatesArray, &enCollection->fieldsEncounteredOn, enCollection->invisibleFields, enCollection->numInvisibleFields); + mapDisplay->numVisibleFields = PokedexEncData_LocateVisibleFields(mapDisplay->pokedexFieldMap_1, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH, mapDisplay->fieldCoordinatesArray, &enCollection->fieldsEncounteredOn, enCollection->invisibleFields, enCollection->numInvisibleFields); numCombinedMaps = (enCollection->fieldsEncounteredOn.numLocations - 1) + enCollection->numInvisibleFields; combinedMapArray = Heap_AllocFromHeapAtEnd(heapID, numCombinedMaps); @@ -848,11 +856,11 @@ static void ov21_021DD710(PokedexMapDisplay *mapDisplay, const UnkStruct_ov21_02 } } - mapDisplay->fieldsZero = PokedexEncData_LocateVisibleFields(mapDisplay->mapFieldCellMatrix_2, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH, mapDisplay->fieldCoordinatesArray, &enCollection->fieldSpecialEncounters, combinedMapArray, numCombinedMaps); + mapDisplay->fieldsZero = PokedexEncData_LocateVisibleFields(mapDisplay->pokedexFieldMap_2, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH, mapDisplay->fieldCoordinatesArray, &enCollection->fieldSpecialEncounters, combinedMapArray, numCombinedMaps); Heap_FreeToHeap(combinedMapArray); - MapFieldCellMatrix_SmoothCells(mapDisplay->mapFieldCellMatrix_1, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH); - MapFieldCellMatrix_SmoothCells(mapDisplay->mapFieldCellMatrix_2, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH); + PokedexFieldMap_SmoothFields(mapDisplay->pokedexFieldMap_1, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH); + PokedexFieldMap_SmoothFields(mapDisplay->pokedexFieldMap_2, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH); species = Pokedex_Sort_CurrentSpecies(param1->dexStatus); @@ -891,8 +899,8 @@ static void ov21_021DD8B4(PokedexMapDisplay *mapDisplay) { int v0; - memset(mapDisplay->mapFieldCellMatrix_1, 0, sizeof(u8) * (POKEDEXMAPHEIGHT * POKEDEXMAPWIDTH)); - memset(mapDisplay->mapFieldCellMatrix_2, 0, sizeof(u8) * (POKEDEXMAPHEIGHT * POKEDEXMAPWIDTH)); + memset(mapDisplay->pokedexFieldMap_1, 0, sizeof(u8) * (POKEDEXMAPHEIGHT * POKEDEXMAPWIDTH)); + memset(mapDisplay->pokedexFieldMap_2, 0, sizeof(u8) * (POKEDEXMAPHEIGHT * POKEDEXMAPWIDTH)); for (v0 = 0; v0 < mapDisplay->numDungeons; v0++) { CellActor_SetDrawFlag(mapDisplay->cellActorArray[v0], 0); @@ -1099,8 +1107,8 @@ static void ov21_021DD964(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 { Window_FillTilemap(¶m1->unk_00->unk_04, 0); - ov21_021D517C(¶m1->unk_00->unk_04, mapDisplay->unk_800->pRawData, mapDisplay->unk_800->W * 8, mapDisplay->unk_800->H * 8, POKEDEXMAPXSCALE, mapDisplay->mapFieldCellMatrix_2, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH, 89, 30); - ov21_021D517C(¶m1->unk_00->unk_04, mapDisplay->unk_7F8->pRawData, mapDisplay->unk_7F8->W * 8, mapDisplay->unk_7F8->H * 8, POKEDEXMAPXSCALE, mapDisplay->mapFieldCellMatrix_1, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH, 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); } diff --git a/src/overlay021/pokedex_sort.c b/src/overlay021/pokedex_sort.c index 7cd5d03a00..7317649241 100644 --- a/src/overlay021/pokedex_sort.c +++ b/src/overlay021/pokedex_sort.c @@ -468,7 +468,7 @@ int Pokedex_Sort_CurrentCaughtStatus(const pokedexStatus *dexStatus) return dexStatus->pokedexCompletion.caughtStatusArray[dexStatus->pokedexCompletion.unk_F68].caughtStatus; } -const speciesCaughtStatus *Pokedex_Sort_SpeciesCaughtStatus(const pokedexStatus *dexStatus, int dexIndex) +const SpeciesCaughtStatus *Pokedex_Sort_SpeciesCaughtStatus(const pokedexStatus *dexStatus, int dexIndex) { if (Pokedex_Sort_IsValidDexIndex(dexStatus, dexIndex)) { return &dexStatus->pokedexCompletion.caughtStatusArray[dexIndex]; diff --git a/src/overlay021/pokedexfieldmap.c b/src/overlay021/pokedexfieldmap.c new file mode 100644 index 0000000000..39eb9500ac --- /dev/null +++ b/src/overlay021/pokedexfieldmap.c @@ -0,0 +1,279 @@ +#include "overlay021/pokedexfieldmap.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/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 b3c08dca98..81a3cc7318 100644 --- a/src/overlay048/ov48_022561C0.c +++ b/src/overlay048/ov48_022561C0.c @@ -357,6 +357,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/unk_0206AFE0.c b/src/unk_0206AFE0.c index 4ad6e58ed9..dfd3291b3c 100644 --- a/src/unk_0206AFE0.c +++ b/src/unk_0206AFE0.c @@ -189,9 +189,9 @@ void sub_0206B1D8(VarsFlags *param0, int param1) 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 + VARS_START) + 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; diff --git a/src/unk_0206B70C.c b/src/unk_0206B70C.c index da6ce11bb8..f6f00abd11 100644 --- a/src/unk_0206B70C.c +++ b/src/unk_0206B70C.c @@ -133,7 +133,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); } } From 37f9a480b40d2e91db26c1d3c067da95d13f0a8e Mon Sep 17 00:00:00 2001 From: h2o-DS Date: Tue, 29 Oct 2024 23:15:54 -0400 Subject: [PATCH 10/16] Pokedex Sort Enums Rolled back Pokedex_Sort name change Added pokedex sorting enums Renamed STRUCT_OV21_021D3A60 to PokedexProgress --- include/overlay021/ov21_021D0D80.h | 28 +- include/overlay021/ov21_021D3208.h | 122 ++++++ include/overlay021/pokedex_sort.h | 61 --- include/overlay021/pokedexfieldmap.h | 2 +- ...ruct_ov21_021D3A60.h => pokedexprogress.h} | 10 +- ...escaughtstatus.h => speciescaughtstatus.h} | 6 +- include/overlay021/struct_ov21_021D5B68.h | 2 +- include/overlay021/struct_ov21_021DE6D4.h | 2 +- include/overlay021/struct_pokedexstatus.h | 6 +- include/unk_0202631C.h | 6 +- platinum.us/main.lsf | 2 +- src/battle/ov16_0223DF00.c | 2 +- src/game_records.c | 2 +- src/meson.build | 2 +- src/overlay005/ov5_021F77A8.c | 2 +- src/overlay006/ov6_02240C9C.c | 6 +- src/overlay006/ov6_02242984.c | 2 +- src/overlay021/ov21_021D0D80.c | 36 +- .../{pokedex_sort.c => ov21_021D3208.c} | 372 ++++++++++-------- src/overlay021/ov21_021D5AEC.c | 4 +- src/overlay021/ov21_021D76B0.c | 14 +- src/overlay021/ov21_021D85B0.c | 4 +- src/overlay021/ov21_021D94BC.c | 4 +- src/overlay021/ov21_021DC9BC.c | 4 +- src/overlay021/ov21_021DDD2C.c | 4 +- src/overlay021/ov21_021DE668.c | 2 +- src/overlay021/ov21_021DF734.c | 4 +- src/overlay021/ov21_021E0C68.c | 4 +- src/overlay021/ov21_021E1924.c | 6 +- src/overlay021/ov21_021E29DC.c | 6 +- src/overlay021/ov21_021E3FFC.c | 4 +- src/overlay021/ov21_021E4CA4.c | 4 +- src/overlay021/ov21_021E6014.c | 4 +- src/overlay021/ov21_021E68F4.c | 4 +- src/overlay021/ov21_021E737C.c | 4 +- src/overlay021/ov21_021E8484.c | 4 +- src/overlay023/ov23_0223E140.c | 2 +- src/overlay023/ov23_022521F0.c | 2 +- src/overlay028/ov28_022561C0.c | 4 +- src/overlay062/ov62_02237D24.c | 4 +- src/overlay062/ov62_02241204.c | 4 +- src/overlay065/ov65_0222DCE0.c | 2 +- src/overlay066/ov66_0222DDF0.c | 2 +- src/overlay094/ov94_022414B8.c | 8 +- src/overlay097/ov97_0222AE60.c | 2 +- src/scrcmd.c | 4 +- src/unk_0202631C.c | 32 +- src/unk_02046C7C.c | 2 +- src/unk_0204AEE8.c | 2 +- src/unk_020683F4.c | 2 +- src/unk_0206CCB0.c | 28 +- src/unk_0207A274.c | 2 +- src/unk_020998EC.c | 2 +- 53 files changed, 483 insertions(+), 372 deletions(-) create mode 100644 include/overlay021/ov21_021D3208.h delete mode 100644 include/overlay021/pokedex_sort.h rename include/overlay021/{struct_ov21_021D3A60.h => pokedexprogress.h} (60%) rename include/overlay021/{struct_speciescaughtstatus.h => speciescaughtstatus.h} (55%) rename src/overlay021/{pokedex_sort.c => ov21_021D3208.c} (67%) diff --git a/include/overlay021/ov21_021D0D80.h b/include/overlay021/ov21_021D0D80.h index fc73266dad..45ecb80db4 100644 --- a/include/overlay021/ov21_021D0D80.h +++ b/include/overlay021/ov21_021D0D80.h @@ -42,7 +42,7 @@ int *ov21_021D13A0(UnkStruct_ov21_021D0F60 *param0); int *ov21_021D13B4(UnkStruct_ov21_021D0F60 *param0); int *ov21_021D13C8(UnkStruct_ov21_021D0F60 *param0); BOOL *ov21_021D13DC(UnkStruct_ov21_021D0F60 *param0); -pokedexStatus *ov21_021D13EC(UnkStruct_ov21_021D0F60 *param0); +PokedexStatus *ov21_021D13EC(UnkStruct_ov21_021D0F60 *param0); UnkStruct_ov21_021D13FC *ov21_021D13FC(UnkStruct_ov21_021D0F60 *param0); UnkStruct_ov21_021E68F4 *ov21_021D1410(UnkStruct_ov21_021D0F60 *param0, int param1); UnkStruct_ov21_021E68F4 *ov21_021D1430(UnkStruct_ov21_021D0F60 *param0, int param1); @@ -53,23 +53,23 @@ void ov21_021D154C(TouchScreenHitTable *hitTable, int param1, int param2, int pa void ov21_021D1558(UnkStruct_ov21_021D157C *param0, BgConfig *param1, int param2, NNSG2dScreenData *param3, int param4, int param5, int param6, int param7, int param8); BOOL ov21_021D157C(UnkStruct_ov21_021D157C *param0); void ov21_021D1650(Window *param0, int param1, int param2, int param3); -Window *ov21_021D16D8(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3); +Window *ov21_021D16D8(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3); Window *ov21_021D170C(UnkStruct_ov21_021D4C0C *param0, int param1, int param2); Window *ov21_021D172C(UnkStruct_ov21_021D4C0C *param0, int param1, int param2); -void ov21_021D1778(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3, fx32 param4, fx32 param5); +void ov21_021D1778(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3, fx32 param4, fx32 param5); void ov21_021D1848(UnkStruct_ov21_021D13FC *param0, int param1, int param2); void ov21_021D1858(UnkStruct_ov21_021D22F8 *param0, int param1, int param2); -void ov21_021D1890(UnkStruct_ov21_021D13FC *param0, pokedexStatus *param1, int param2, int param3, int param4, int param5); -u32 ov21_021D19D8(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3, int param4, int param5, int param6, int param7); -u32 ov21_021D1A34(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3, int param4, int param5, int param6); -u32 ov21_021D1A78(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3, int param4, int param5, int param6); -u32 ov21_021D1AC0(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3, int param4, int param5, int param6); -u32 ov21_021D1B08(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3, int param4, int param5, int param6); -u32 ov21_021D1B4C(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3, int param4, int param5, int param6); -u32 ov21_021D1B94(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3, int param4, int param5, int param6); -u32 ov21_021D1BD8(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3, int param4, int param5, int param6); -u32 ov21_021D1C30(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3, int param4, int param5, int param6); -u32 ov21_021D1C88(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3, int param4, int param5, int param6); +void ov21_021D1890(UnkStruct_ov21_021D13FC *param0, PokedexStatus *param1, int param2, int param3, int param4, int param5); +u32 ov21_021D19D8(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3, int param4, int param5, int param6, int param7); +u32 ov21_021D1A34(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3, int param4, int param5, int param6); +u32 ov21_021D1A78(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3, int param4, int param5, int param6); +u32 ov21_021D1AC0(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3, int param4, int param5, int param6); +u32 ov21_021D1B08(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3, int param4, int param5, int param6); +u32 ov21_021D1B4C(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3, int param4, int param5, int param6); +u32 ov21_021D1B94(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3, int param4, int param5, int param6); +u32 ov21_021D1BD8(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3, int param4, int param5, int param6); +u32 ov21_021D1C30(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3, int param4, int param5, int param6); +u32 ov21_021D1C88(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3, int param4, int param5, int param6); Strbuf *ov21_021D1CE0(int param0, int param1); #endif // POKEPLATINUM_OV21_021D0D80_H diff --git a/include/overlay021/ov21_021D3208.h b/include/overlay021/ov21_021D3208.h new file mode 100644 index 0000000000..bef6b43365 --- /dev/null +++ b/include/overlay021/ov21_021D3208.h @@ -0,0 +1,122 @@ +#ifndef POKEPLATINUM_OV21_021D3208_H +#define POKEPLATINUM_OV21_021D3208_H + +#include "overlay021/struct_ov21_021D3208.h" +#include "overlay021/struct_pokedexstatus.h" +#include "overlay021/speciesCaughtStatus.h" + +#include "strbuf.h" + +enum SortCategory { + SC_NUMERIC, + SC_ALPHABETICAL, + SC_HEAVIEST, + SC_LIGHTEST, + SC_TALLEST, + SC_SHORTEST +}; + +enum FilterFirstLetter { + FFL_NONE, + FFL_ABC, + FFL_DEF, + FFL_GHI, + FFL_JKL, + FFL_MNO, + FFL_PQR, + FFL_STU, + FFL_VWX, + FFL_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 FilterBodyShape { + FBS_NONE, + FBS_QUADRUPED, + FBS_BIPEDALTAILLESS, + FBS_BIPEDALTAILED, + FBS_SERPENTINE, + FBS_MULTIWINGED, + FBS_WINGED, + FBS_INSECTOID, + FBS_HEADBASE, + FBS_HEADARMS, + FBS_HEADLEGS, + FBS_TENTACLES, + FBS_FINS, + FBS_HEAD, + FBS_MULTIBODY +}; + +void Pokedex_Sort_PopulatepokedexStatus(PokedexStatus *param0, UnkStruct_ov21_021D3208 *param1, int param2); +void Pokedex_Sort_PokedexStatusFreeHWData(PokedexStatus *param0); +u32 ov21_021D334C(const PokedexStatus *param0, int param1, int param2); +u32 ov21_021D335C(const PokedexStatus *param0, int param1); +u32 ov21_021D3374(const PokedexStatus *param0, int param1); +u32 ov21_021D338C(const PokedexStatus *param0, int param1); +u32 ov21_021D33A4(const PokedexStatus *param0, int param1); +u32 ov21_021D33BC(const PokedexStatus *param0, int param1); +u32 ov21_021D33D4(const PokedexStatus *param0, u32 param1); +u32 ov21_021D33E0(const PokedexStatus *param0, int param1); +u32 ov21_021D33F8(const PokedexStatus *param0); +u32 ov21_021D3404(const PokedexStatus *param0, int param1); +u32 ov21_021D3410(const PokedexStatus *param0, u32 param1, int param2); +u32 ov21_021D341C(const PokedexStatus *param0, u32 param1); +BOOL Pokedex_Sort_PokedexUnlocked(const PokedexStatus *param0); +void ov21_021D3434(PokedexStatus *param0, u32 param1); +u32 ov21_021D3440(const PokedexStatus *param0); +void ov21_021D344C(PokedexStatus *param0, u32 param1); +u32 ov21_021D3458(const PokedexStatus *param0); +BOOL Pokedex_Sort(PokedexStatus *dexStatus, int sortCategory, int firstLetterFilter, int typeFilter1, int typeFilter2, int bodyShapeFilter, int isNationalDex, int heapID, BOOL isFiltered); +BOOL Pokedex_Sort_Unfiltered(PokedexStatus *param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7); +BOOL ov21_021D36A4(const PokedexStatus *param0, int param1); +BOOL ov21_021D36C0(PokedexStatus *param0, int param1); +int ov21_021D36D8(const PokedexStatus *param0); +BOOL Pokedex_Sort_IsValidDexIndex(const PokedexStatus *dexStatus, int dexIndex); +BOOL ov21_021D36FC(PokedexStatus *param0, int param1); +BOOL ov21_021D371C(PokedexStatus *param0, int param1); +int ov21_021D375C(const PokedexStatus *param0); +int Pokedex_Sort_CompletionNumEncountered(const PokedexStatus *param0); +int ov21_021D3770(const PokedexStatus *param0, u32 param1); +BOOL ov21_021D3794(PokedexStatus *param0, int param1); +int Pokedex_Sort_CurrentSpecies(const PokedexStatus *param0); +int Pokedex_Sort_CurrentCaughtStatus(const PokedexStatus *param0); +const SpeciesCaughtStatus *Pokedex_Sort_SpeciesCaughtStatus(const PokedexStatus *param0, int dexIndex); +BOOL ov21_021D37F8(const PokedexStatus *param0, int param1); +BOOL ov21_021D3810(PokedexStatus *param0, int param1); +BOOL ov21_021D3844(PokedexStatus *param0, int param1); +BOOL ov21_021D387C(PokedexStatus *param0, int param1); +int ov21_021D3898(const PokedexStatus *param0); +int ov21_021D38A4(const PokedexStatus *param0); +int Pokedex_Sort_SeenIndexToSpecies(const PokedexStatus *param0, int param1); +void ov21_021D38C0(PokedexStatus *param0); +int Pokedex_Sort_NumEncountered(const PokedexStatus *param0); +int Pokedex_Sort_NumCaught(const PokedexStatus *param0); +Strbuf *Pokedex_Sort_TrainerName(const PokedexStatus *param0); +u32 Pokedex_Sort_TrainerGender(const PokedexStatus *param0); +BOOL ov21_021D392C(const PokedexStatus *param0, int param1); +BOOL Pokedex_Sort_CanDetectForms(const PokedexStatus *param0); +void ov21_021D3960(PokedexStatus *param0); +u32 ov21_021D3998(const PokedexStatus *param0); + +#endif // POKEPLATINUM_OV21_021D3208_H diff --git a/include/overlay021/pokedex_sort.h b/include/overlay021/pokedex_sort.h deleted file mode 100644 index fda2f66f8c..0000000000 --- a/include/overlay021/pokedex_sort.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef POKEPLATINUM_POKEDEX_SORT_H -#define POKEPLATINUM_POKEDEX_SORT_H - -#include "overlay021/struct_ov21_021D3208.h" -#include "overlay021/struct_pokedexstatus.h" -#include "overlay021/struct_speciesCaughtStatus.h" - -#include "strbuf.h" - -void Pokedex_Sort_PopulatepokedexStatus(pokedexStatus *param0, UnkStruct_ov21_021D3208 *param1, int param2); -void pokedexstatus(pokedexStatus *param0); -u32 ov21_021D334C(const pokedexStatus *param0, int param1, int param2); -u32 ov21_021D335C(const pokedexStatus *param0, int param1); -u32 ov21_021D3374(const pokedexStatus *param0, int param1); -u32 ov21_021D338C(const pokedexStatus *param0, int param1); -u32 ov21_021D33A4(const pokedexStatus *param0, int param1); -u32 ov21_021D33BC(const pokedexStatus *param0, int param1); -u32 ov21_021D33D4(const pokedexStatus *param0, u32 param1); -u32 ov21_021D33E0(const pokedexStatus *param0, int param1); -u32 ov21_021D33F8(const pokedexStatus *param0); -u32 ov21_021D3404(const pokedexStatus *param0, int param1); -u32 ov21_021D3410(const pokedexStatus *param0, u32 param1, int param2); -u32 ov21_021D341C(const pokedexStatus *param0, u32 param1); -BOOL Pokedex_Sort_PokedexUnlocked(const pokedexStatus *param0); -void ov21_021D3434(pokedexStatus *param0, u32 param1); -u32 ov21_021D3440(const pokedexStatus *param0); -void ov21_021D344C(pokedexStatus *param0, u32 param1); -u32 ov21_021D3458(const pokedexStatus *param0); -BOOL Pokedex_Sort(pokedexStatus *dexStatus, int sortCategory, int firstLetterFilter, int typeFilter1, int typeFilter2, int bodyShapeFilter, int isNationalDex, int heapID, BOOL isFiltered); -BOOL Pokedex_Sort_Unfiltered(pokedexStatus *param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7); -BOOL ov21_021D36A4(const pokedexStatus *param0, int param1); -BOOL ov21_021D36C0(pokedexStatus *param0, int param1); -int ov21_021D36D8(const pokedexStatus *param0); -BOOL Pokedex_Sort_IsValidDexIndex(const pokedexStatus *dexStatus, int dexIndex); -BOOL ov21_021D36FC(pokedexStatus *param0, int param1); -BOOL ov21_021D371C(pokedexStatus *param0, int param1); -int ov21_021D375C(const pokedexStatus *param0); -int Pokedex_Sort_CompletionNumEncountered(const pokedexStatus *param0); -int ov21_021D3770(const pokedexStatus *param0, u32 param1); -BOOL ov21_021D3794(pokedexStatus *param0, int param1); -int Pokedex_Sort_CurrentSpecies(const pokedexStatus *param0); -int Pokedex_Sort_CurrentCaughtStatus(const pokedexStatus *param0); -const SpeciesCaughtStatus *Pokedex_Sort_SpeciesCaughtStatus(const pokedexStatus *param0, int dexIndex); -BOOL ov21_021D37F8(const pokedexStatus *param0, int param1); -BOOL ov21_021D3810(pokedexStatus *param0, int param1); -BOOL ov21_021D3844(pokedexStatus *param0, int param1); -BOOL ov21_021D387C(pokedexStatus *param0, int param1); -int ov21_021D3898(const pokedexStatus *param0); -int ov21_021D38A4(const pokedexStatus *param0); -int Pokedex_Sort_SeenIndexToSpecies(const pokedexStatus *param0, int param1); -void ov21_021D38C0(pokedexStatus *param0); -int Pokedex_Sort_NumEncountered(const pokedexStatus *param0); -int Pokedex_Sort_NumCaught(const pokedexStatus *param0); -Strbuf *Pokedex_Sort_TrainerName(const pokedexStatus *param0); -u32 Pokedex_Sort_TrainerGender(const pokedexStatus *param0); -BOOL ov21_021D392C(const pokedexStatus *param0, int param1); -BOOL Pokedex_Sort_CanDetectForms(const pokedexStatus *param0); -void ov21_021D3960(pokedexStatus *param0); -u32 ov21_021D3998(const pokedexStatus *param0); - -#endif // POKEPLATINUM_POKEDEX_SORT_H diff --git a/include/overlay021/pokedexfieldmap.h b/include/overlay021/pokedexfieldmap.h index ea6577765e..7f682ba086 100644 --- a/include/overlay021/pokedexfieldmap.h +++ b/include/overlay021/pokedexfieldmap.h @@ -26,7 +26,7 @@ void PokedexFieldMap_DisplayFields(Window *window, u8 *src, u16 fieldWidth, u16 * @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 different from one with neighbors to the north and northeast. + * 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 diff --git a/include/overlay021/struct_ov21_021D3A60.h b/include/overlay021/pokedexprogress.h similarity index 60% rename from include/overlay021/struct_ov21_021D3A60.h rename to include/overlay021/pokedexprogress.h index 6cf6486a51..42fbb95a37 100644 --- a/include/overlay021/struct_ov21_021D3A60.h +++ b/include/overlay021/pokedexprogress.h @@ -1,9 +1,9 @@ -#ifndef POKEPLATINUM_STRUCT_OV21_021D3A60_H -#define POKEPLATINUM_STRUCT_OV21_021D3A60_H +#ifndef POKEPLATINUM_POKEDEXPROGRESS_H +#define POKEPLATINUM_POKEDEXPROGRESS_H #include "constants/species.h" -#include "overlay021/struct_speciesCaughtStatus.h" +#include "overlay021/speciesCaughtStatus.h" typedef struct { SpeciesCaughtStatus caughtStatusArray[NATIONAL_DEX_COUNT]; @@ -12,6 +12,6 @@ typedef struct { int encounteredIndexArray[NATIONAL_DEX_COUNT]; // dex number for appearing in dex, dexLength+1 otherwise int unk_1724; int numSpecies; -} pokedexCompletionStruct; +} PokedexProgress; -#endif // POKEPLATINUM_STRUCT_OV21_021D3A60_H +#endif // POKEPLATINUM_POKEDEXPROGRESS_H diff --git a/include/overlay021/struct_speciescaughtstatus.h b/include/overlay021/speciescaughtstatus.h similarity index 55% rename from include/overlay021/struct_speciescaughtstatus.h rename to include/overlay021/speciescaughtstatus.h index ed3a7bb16f..dedcbc5507 100644 --- a/include/overlay021/struct_speciescaughtstatus.h +++ b/include/overlay021/speciescaughtstatus.h @@ -1,5 +1,5 @@ -#ifndef POKEPLATINUM_STRUCT_SPECIESCAUGHTSTATUS_H -#define POKEPLATINUM_STRUCT_SPECIESCAUGHTSTATUS_H +#ifndef POKEPLATINUM_SPECIESCAUGHTSTATUS_H +#define POKEPLATINUM_SPECIESCAUGHTSTATUS_H enum CaughtStatus { CS_UNENCOUNTERED = 0, @@ -12,4 +12,4 @@ typedef struct { enum CaughtStatus caughtStatus; } SpeciesCaughtStatus; -#endif // POKEPLATINUM_STRUCT_SPECIESCAUGHTSTATUS_H +#endif // POKEPLATINUM_SPECIESCAUGHTSTATUS_H diff --git a/include/overlay021/struct_ov21_021D5B68.h b/include/overlay021/struct_ov21_021D5B68.h index f511d300c0..364a988e30 100644 --- a/include/overlay021/struct_ov21_021D5B68.h +++ b/include/overlay021/struct_ov21_021D5B68.h @@ -5,7 +5,7 @@ typedef struct { int *unk_00; - pokedexStatus *unk_04; + PokedexStatus *unk_04; int unk_08; int unk_0C; int unk_10; diff --git a/include/overlay021/struct_ov21_021DE6D4.h b/include/overlay021/struct_ov21_021DE6D4.h index c869cc6be5..ed20b16c6c 100644 --- a/include/overlay021/struct_ov21_021DE6D4.h +++ b/include/overlay021/struct_ov21_021DE6D4.h @@ -6,7 +6,7 @@ typedef struct { int *unk_00; - pokedexStatus *unk_04; + PokedexStatus *unk_04; int unk_08; int unk_0C; const UnkStruct_ov21_021E68F4 *unk_10; diff --git a/include/overlay021/struct_pokedexstatus.h b/include/overlay021/struct_pokedexstatus.h index 10318770de..c5b725a384 100644 --- a/include/overlay021/struct_pokedexstatus.h +++ b/include/overlay021/struct_pokedexstatus.h @@ -4,13 +4,13 @@ #include "struct_decls/pokedexdata_decl.h" #include "struct_decls/struct_02098700_decl.h" -#include "overlay021/struct_ov21_021D3A60.h" +#include "overlay021/pokedexProgress.h" #include "strbuf.h" typedef struct { const PokedexData *dexData; - pokedexCompletionStruct pokedexCompletion; + PokedexProgress pokedexCompletion; int isNationalDex; BOOL isNationalDexUnlocked; int numEncountered; @@ -28,6 +28,6 @@ typedef struct { BOOL newmoonIslandVisible; BOOL springPathVisible; BOOL seabreakPathVisible; -} pokedexStatus; +} PokedexStatus; #endif // POKEPLATINUM_STRUCT_POKEDEXSTATUS_H diff --git a/include/unk_0202631C.h b/include/unk_0202631C.h index 8bd9e4aafd..8560c1c911 100644 --- a/include/unk_0202631C.h +++ b/include/unk_0202631C.h @@ -19,8 +19,8 @@ BOOL sub_02026EF4(const PokedexData *dexData); BOOL sub_02026F0C(const PokedexData *dexData); u16 sub_02026F20(const PokedexData *dexData); u16 sub_02026F58(const PokedexData *dexData); -BOOL Pokedex_CaughtSpecies(const PokedexData *dexData, u16 species); -BOOL Pokedex_EncounteredSpecies(const PokedexData *dexData, u16 species); +BOOL Pokedex_HasCaught(const PokedexData *dexData, u16 species); +BOOL Pokedex_HasEncountered(const PokedexData *dexData, u16 species); u32 sub_0202702C(const PokedexData *dexData, u8 param1); u32 sub_02027058(const PokedexData *dexData, u16 param1, int param2); u32 sub_020270AC(const PokedexData *dexData, int param1); @@ -38,7 +38,7 @@ u32 sub_02027288(const PokedexData *dexData); void sub_020272A4(PokedexData *dexData, Pokemon *param1); void sub_0202736C(PokedexData *dexData, Pokemon *param1); void sub_02027454(PokedexData *dexData); -BOOL Pokedex_NationalUnlocked(const PokedexData *dexData); +BOOL Pokedex_IsNationalUnlocked(const PokedexData *dexData); BOOL Pokedex_CanDetectForms(const PokedexData *dexData); void Pokedex_TurnOnFormDetection(PokedexData *dexData); BOOL sub_020274D0(const PokedexData *dexData, u16 param1, u32 param2); diff --git a/platinum.us/main.lsf b/platinum.us/main.lsf index eab7f98464..bf0e018dbd 100644 --- a/platinum.us/main.lsf +++ b/platinum.us/main.lsf @@ -786,7 +786,7 @@ Overlay overlay21 Object main.nef.p/src_overlay021_ov21_021D0D80.c.o Object main.nef.p/src_overlay021_ov21_021D1F90.c.o Object main.nef.p/src_overlay021_ov21_021D1FA4.c.o - Object main.nef.p/src_overlay021_pokedex_sort.c.o + Object main.nef.p/src_overlay021_ov21_021D3208.c.o Object main.nef.p/src_overlay021_ov21_021D3FE0.c.o Object main.nef.p/src_overlay021_ov21_021D423C.c.o Object main.nef.p/src_overlay021_ov21_021D4340.c.o diff --git a/src/battle/ov16_0223DF00.c b/src/battle/ov16_0223DF00.c index 9c82d42f1b..14e61997f2 100644 --- a/src/battle/ov16_0223DF00.c +++ b/src/battle/ov16_0223DF00.c @@ -1721,7 +1721,7 @@ void ov16_0223F9A0(BattleSystem *param0, int param1) BOOL BattleSystem_CaughtSpecies(BattleSystem *battleSys, int species) { - return Pokedex_CaughtSpecies(battleSys->pokedex, species); + return Pokedex_HasCaught(battleSys->pokedex, species); } void Battle_SetDefaultBlend(void) diff --git a/src/game_records.c b/src/game_records.c index 01aa1fae91..7b20d42b20 100644 --- a/src/game_records.c +++ b/src/game_records.c @@ -409,7 +409,7 @@ u32 GameRecords_GetTrainerScore(GameRecords *records) void GameRecords_IncrementTrainerScoreOnCatch(GameRecords *records, const PokedexData *pokedex, const u16 species) { - if (!Pokedex_CaughtSpecies(pokedex, species)) { + if (!Pokedex_HasCaught(pokedex, species)) { GameRecords_IncrementTrainerScore(records, TRAINER_SCORE_EVENT_CAUGHT_SPECIES); } } diff --git a/src/meson.build b/src/meson.build index b72865d781..733f1b86ff 100644 --- a/src/meson.build +++ b/src/meson.build @@ -597,7 +597,7 @@ pokeplatinum_c = files( 'overlay021/ov21_021D0D80.c', 'overlay021/ov21_021D1F90.c', 'overlay021/ov21_021D1FA4.c', - 'overlay021/pokedex_sort.c', + 'overlay021/ov21_021D3208.c', 'overlay021/ov21_021D3FE0.c', 'overlay021/ov21_021D423C.c', 'overlay021/ov21_021D4340.c', diff --git a/src/overlay005/ov5_021F77A8.c b/src/overlay005/ov5_021F77A8.c index 6bb2ac1fe5..52aa9368bf 100644 --- a/src/overlay005/ov5_021F77A8.c +++ b/src/overlay005/ov5_021F77A8.c @@ -95,7 +95,7 @@ BOOL ScrCmd_337(ScriptContext *param0) u16 *v1 = FieldSystem_GetVarPointer(param0->fieldSystem, ScriptContext_ReadHalfWord(param0)); PokedexData *v2 = SaveData_Pokedex(param0->fieldSystem->saveData); - *v1 = Pokedex_EncounteredSpecies(v2, v0); + *v1 = Pokedex_HasEncountered(v2, v0); return 0; } diff --git a/src/overlay006/ov6_02240C9C.c b/src/overlay006/ov6_02240C9C.c index d81dd3c070..a2f54b57cc 100644 --- a/src/overlay006/ov6_02240C9C.c +++ b/src/overlay006/ov6_02240C9C.c @@ -326,7 +326,7 @@ BOOL ov6_02240D5C(FieldSystem *fieldSystem) v13[i].minLevel = encounterData->grassEncounters.encounters[i].level; } - BOOL nationalDexObtained = Pokedex_NationalUnlocked(SaveData_Pokedex(FieldSystem_SaveData(fieldSystem))); + BOOL nationalDexObtained = Pokedex_IsNationalUnlocked(SaveData_Pokedex(FieldSystem_SaveData(fieldSystem))); WildEncounters_ReplaceTimedEncounters(encounterData, &v13[2].species, &v13[3].species); WildEncounters_ReplaceRadarEncounters(fieldSystem, encounterData, &v13[0].species, &v13[1].species); @@ -514,7 +514,7 @@ BOOL ov6_022411C8(FieldSystem *fieldSystem, TaskManager *param1) v12[i].minLevel = encounterData->grassEncounters.encounters[i].level; } - BOOL nationalDexObtained = Pokedex_NationalUnlocked(SaveData_Pokedex(FieldSystem_SaveData(fieldSystem))); + BOOL nationalDexObtained = Pokedex_IsNationalUnlocked(SaveData_Pokedex(FieldSystem_SaveData(fieldSystem))); WildEncounters_ReplaceTimedEncounters(encounterData, &v12[2].species, &v12[3].species); WildEncounters_ReplaceRadarEncounters(fieldSystem, encounterData, &v12[0].species, &v12[1].species); @@ -643,7 +643,7 @@ BOOL ov6_022413E4(FieldSystem *fieldSystem, BattleParams **battleParams) v12[i].minLevel = encounterData->grassEncounters.encounters[i].level; } - BOOL nationalDexObtained = Pokedex_NationalUnlocked(SaveData_Pokedex(FieldSystem_SaveData(fieldSystem))); + BOOL nationalDexObtained = Pokedex_IsNationalUnlocked(SaveData_Pokedex(FieldSystem_SaveData(fieldSystem))); WildEncounters_ReplaceTimedEncounters(encounterData, &v12[2].species, &v12[3].species); WildEncounters_ReplaceRadarEncounters(fieldSystem, encounterData, &v12[0].species, &v12[1].species); diff --git a/src/overlay006/ov6_02242984.c b/src/overlay006/ov6_02242984.c index 320c6d7cca..7e06cdc799 100644 --- a/src/overlay006/ov6_02242984.c +++ b/src/overlay006/ov6_02242984.c @@ -43,7 +43,7 @@ int ov6_02242984(FieldSystem *fieldSystem) v2[i] = encounterData->grassEncounters.encounters[i].species; } - BOOL v1 = Pokedex_NationalUnlocked(SaveData_Pokedex(FieldSystem_SaveData(fieldSystem))); + BOOL v1 = Pokedex_IsNationalUnlocked(SaveData_Pokedex(FieldSystem_SaveData(fieldSystem))); ov6_02242F74(sub_0202D814(sub_0202D834(fieldSystem->saveData), 1), v1, fieldSystem->location->mapId, &v2[6], &v2[7]); WildEncounters_ReplaceTimedEncounters(encounterData, &v2[2], &v2[3]); diff --git a/src/overlay021/ov21_021D0D80.c b/src/overlay021/ov21_021D0D80.c index 5d7fdd1d9c..d99e91bcf2 100644 --- a/src/overlay021/ov21_021D0D80.c +++ b/src/overlay021/ov21_021D0D80.c @@ -32,7 +32,7 @@ #include "overlay021/ov21_021E68F4.h" #include "overlay021/ov21_021E737C.h" #include "overlay021/ov21_021E8484.h" -#include "overlay021/pokedex_sort.h" +#include "overlay021/ov21_021D3208.h" #include "overlay021/struct_ov21_021D0D80.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D157C.h" @@ -46,7 +46,7 @@ #include "overlay021/struct_ov21_021D4CB8.h" #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_pokedexstatus.h" -#include "overlay021/struct_speciesCaughtStatus.h" +#include "overlay021/speciesCaughtStatus.h" #include "overlay022/struct_ov22_022559F8.h" #include "bg_window.h" @@ -80,7 +80,7 @@ typedef struct UnkStruct_ov21_021D0F60_t { BOOL unk_00; int unk_04; UnkStruct_0209ACBC *unk_08; - pokedexStatus unk_0C; + PokedexStatus unk_0C; UnkStruct_ov21_021D13FC unk_177C; int unk_1A60; int unk_1A64; @@ -511,7 +511,7 @@ BOOL *ov21_021D13DC(UnkStruct_ov21_021D0F60 *param0) return ¶m0->unk_00; } -pokedexStatus *ov21_021D13EC(UnkStruct_ov21_021D0F60 *param0) +PokedexStatus *ov21_021D13EC(UnkStruct_ov21_021D0F60 *param0) { GF_ASSERT(param0); return ¶m0->unk_0C; @@ -673,7 +673,7 @@ void ov21_021D1650(Window *param0, int param1, int param2, int param3) ov21_021D5600(v1); } -Window *ov21_021D16D8(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3) +Window *ov21_021D16D8(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3) { Window *v0; @@ -713,7 +713,7 @@ Window *ov21_021D172C(UnkStruct_ov21_021D4C0C *param0, int param1, int param2) return v0; } -void ov21_021D1778(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int dexIndex, fx32 param4, fx32 param5) +void ov21_021D1778(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int dexIndex, fx32 param4, fx32 param5) { CellActor *v0; CellActor *v1; @@ -784,7 +784,7 @@ void ov21_021D1858(UnkStruct_ov21_021D22F8 *param0, int param1, int param2) } } -void ov21_021D1890(UnkStruct_ov21_021D13FC *param0, pokedexStatus *param1, int species, int param3, int param4, int param5) +void ov21_021D1890(UnkStruct_ov21_021D13FC *param0, PokedexStatus *param1, int species, int param3, int param4, int param5) { switch (species) { case 201: @@ -820,7 +820,7 @@ void ov21_021D1890(UnkStruct_ov21_021D13FC *param0, pokedexStatus *param1, int s } } -u32 ov21_021D19D8(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3, int param4, int param5, int param6, int param7) +u32 ov21_021D19D8(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3, int param4, int param5, int param6, int param7) { int v0; u32 v1 = 0; @@ -838,7 +838,7 @@ u32 ov21_021D19D8(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, return v0; } -u32 ov21_021D1A34(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *dexStatus, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1A34(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *dexStatus, int param2, int param3, int param4, int param5, int param6) { int v0; @@ -851,7 +851,7 @@ u32 ov21_021D1A34(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *dexStatu return v0; } -u32 ov21_021D1A78(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1A78(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3, int param4, int param5, int param6) { int v0; @@ -864,7 +864,7 @@ u32 ov21_021D1A78(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, return v0; } -u32 ov21_021D1AC0(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1AC0(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3, int param4, int param5, int param6) { int v0; @@ -877,7 +877,7 @@ u32 ov21_021D1AC0(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, return v0; } -u32 ov21_021D1B08(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1B08(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3, int param4, int param5, int param6) { int v0; @@ -890,7 +890,7 @@ u32 ov21_021D1B08(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, return v0; } -u32 ov21_021D1B4C(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1B4C(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3, int param4, int param5, int param6) { int v0; @@ -903,7 +903,7 @@ u32 ov21_021D1B4C(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, return v0; } -u32 ov21_021D1B94(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1B94(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3, int param4, int param5, int param6) { int v0; @@ -916,7 +916,7 @@ u32 ov21_021D1B94(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, return v0; } -u32 ov21_021D1BD8(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1BD8(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3, int param4, int param5, int param6) { int v0; int v1; @@ -933,7 +933,7 @@ u32 ov21_021D1BD8(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, return v0; } -u32 ov21_021D1C30(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1C30(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3, int param4, int param5, int param6) { int v0; int v1; @@ -950,7 +950,7 @@ u32 ov21_021D1C30(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, return v0; } -u32 ov21_021D1C88(UnkStruct_ov21_021D13FC *param0, const pokedexStatus *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1C88(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3, int param4, int param5, int param6) { int v0; int v1; @@ -1029,7 +1029,7 @@ static void ov21_021D1D08(UnkStruct_ov21_021D0F60 *param0) sub_0209ACF0(param0->unk_08, 2); } - pokedexstatus(¶m0->unk_0C); + Pokedex_Sort_PokedexStatusFreeHWData(¶m0->unk_0C); ov21_021D2098(¶m0->unk_177C); Heap_FreeToHeap(param0); } diff --git a/src/overlay021/pokedex_sort.c b/src/overlay021/ov21_021D3208.c similarity index 67% rename from src/overlay021/pokedex_sort.c rename to src/overlay021/ov21_021D3208.c index 7317649241..a3ce4cab16 100644 --- a/src/overlay021/pokedex_sort.c +++ b/src/overlay021/ov21_021D3208.c @@ -1,4 +1,4 @@ -#include "overlay021/pokedex_sort.h" +#include "overlay021/ov21_021D3208.h" #include #include @@ -6,9 +6,9 @@ #include "struct_decls/pokedexdata_decl.h" #include "overlay021/struct_ov21_021D3208.h" -#include "overlay021/struct_ov21_021D3A60.h" +#include "overlay021/pokedexProgress.h" #include "overlay021/struct_pokedexstatus.h" -#include "overlay021/struct_speciesCaughtStatus.h" +#include "overlay021/speciesCaughtStatus.h" #include "core_sys.h" #include "graphics.h" @@ -20,19 +20,69 @@ #include "trainer_info.h" #include "unk_0202631C.h" +enum PokedexDataFileIndex { + PDFI_NATIONAL, + PDFI_SINNOH, + PDFI_ALPHABETICAL, + PDFI_HEAVIEST, + PDFI_LIGHTEST, + PDFI_TALLEST, + PDFI_SHORTEST, + PDFI_ABC, + PDFI_DEF, + PDFI_GHI, + PDFI_JKL, + PDFI_MNO, + PDFI_PQR, + PDFI_STU, + PDFI_VWX, + PDFI_YZ, + PDFI_NORMAL, + PDFI_FIGHTING, + PDFI_FLYING, + PDFI_POISON, + PDFI_GROUND, + PDFI_ROCK, + PDFI_BUG, + PDFI_GHOST, + PDFI_STEEL, + PDFI_FIRE, + PDFI_WATER, + PDFI_GRASS, + PDFI_ELECTRIC, + PDFI_PSYCHIC, + PDFI_ICE, + PDFI_DRAGON, + PDFI_DARK, + PDFI_QUADRUPED, + PDFI_BIPEDALTAILLESS, + PDFI_BIPEDALTAILED, + PDFI_SERPENTINE, + PDFI_MULTIWINGED, + PDFI_WINGED, + PDFI_INSECTOID, + PDFI_HEADBASE, + PDFI_HEADARMS, + PDFI_HEADLEGS, + PDFI_TENTACLES, + PDFI_FINS, + PDFI_HEAD, + PDFI_MULTIBODY +}; + static void Pokedex_Sort_Encountered(u16 *pokedexPreFilterArray, int *numEncountered, const PokedexData *dexData, const u16 *speciesArray, int pokedexLength); static void Pokedex_Sort_Caught(u16 *param0, int *param1, const u16 *param2, int param3, const u16 *param4, int param5, BOOL param6, const PokedexData *dexData); -static void Pokedex_Sort_CaughtStatus(pokedexCompletionStruct *pokedexCompletion, const PokedexData *param1, const u16 *param2, int param3); -static void Pokedex_Sort_IndentifyEnountered_Full(pokedexCompletionStruct *pokedexCompletion, const u16 *param1, int param2); -static void Pokedex_Sort_IndentifyEnountered_Filtered(pokedexCompletionStruct *pokedexCompletion); -static void Pokedex_Sort_NumSeenNCaught(pokedexCompletionStruct *pokedexCompletion, int *numEncountered, int *numCaught); +static void Pokedex_Sort_CaughtStatus(PokedexProgress *pokedexCompletion, const PokedexData *param1, const u16 *param2, int param3); +static void Pokedex_Sort_IndentifyEnountered_Full(PokedexProgress *pokedexCompletion, const u16 *param1, int param2); +static void Pokedex_Sort_IndentifyEnountered_Filtered(PokedexProgress *pokedexCompletion); +static void Pokedex_Sort_NumSeenNCaught(PokedexProgress *pokedexCompletion, int *numEncountered, int *numCaught); static u16 *Pokedex_Sort_SortedArray(int heapID, int pokedexSort, int *pokedexLength); static void Pokedex_Sort_Order(int sortCategory, u16 *pokedexPostFilterArray, int *dexLengthPostFilter, const u16 *param3, int dexLengthPreFilter, int heapID, const PokedexData *dexData); static void Pokedex_Sort_FilterFirstLetter(int firstLetterFilter, u16 *pokedexPostFilterArray, int *dexLengthPostFilter, const u16 *pokedexPreFilterArray, int numEncountered, int heapID, const PokedexData *dexData); static void Pokedex_Sort_FilterType(int typeFilter, u16 *param1, int *param2, const u16 *param3, int dexLengthPreFilter, int heapID, const PokedexData *dexData); static void Pokedex_Sort_FilterBodyShape(int bodyShapeFilter, u16 *param1, int *param2, const u16 *param3, int dexLengthPreFilter, int heapID, const PokedexData *dexData); -void Pokedex_Sort_PopulatepokedexStatus(pokedexStatus *dexStatus, UnkStruct_ov21_021D3208 *param1, int heapID) +void Pokedex_Sort_PopulatepokedexStatus(PokedexStatus *dexStatus, UnkStruct_ov21_021D3208 *param1, int heapID) { int sortCategory; int firstLetterFilter; @@ -42,12 +92,12 @@ void Pokedex_Sort_PopulatepokedexStatus(pokedexStatus *dexStatus, UnkStruct_ov21 BOOL dexExists; u32 isNationalDex; - memset(dexStatus, 0, sizeof(pokedexStatus)); + memset(dexStatus, 0, sizeof(PokedexStatus)); dexStatus->dexData = param1->dexData; dexStatus->timeOfDay = param1->timeOfDay; - if (Pokedex_NationalUnlocked(dexStatus->dexData)) { + if (Pokedex_IsNationalUnlocked(dexStatus->dexData)) { dexStatus->isNationalDexUnlocked = 1; } else { dexStatus->isNationalDexUnlocked = 0; @@ -104,7 +154,7 @@ void Pokedex_Sort_PopulatepokedexStatus(pokedexStatus *dexStatus, UnkStruct_ov21 dexStatus->seabreakPathVisible = param1->seabreakPathVisible; } -void pokedexstatus(pokedexStatus *dexStatus) +void Pokedex_Sort_PokedexStatusFreeHWData(PokedexStatus *dexStatus) { Strbuf_Free(dexStatus->trainerName); Pokedex_HeightWeightData_Release(dexStatus->HWData); @@ -113,7 +163,7 @@ void pokedexstatus(pokedexStatus *dexStatus) dexStatus->HWData = NULL; } -u32 ov21_021D334C(const pokedexStatus *dexStatus, int param1, int param2) +u32 ov21_021D334C(const PokedexStatus *dexStatus, int param1, int param2) { u32 v0; @@ -121,7 +171,7 @@ u32 ov21_021D334C(const pokedexStatus *dexStatus, int param1, int param2) return v0; } -u32 ov21_021D335C(const pokedexStatus *dexStatus, int param1) +u32 ov21_021D335C(const PokedexStatus *dexStatus, int param1) { int v0; @@ -131,7 +181,7 @@ u32 ov21_021D335C(const pokedexStatus *dexStatus, int param1) return v0; } -u32 ov21_021D3374(const pokedexStatus *dexStatus, int param1) +u32 ov21_021D3374(const PokedexStatus *dexStatus, int param1) { u32 v0; @@ -141,7 +191,7 @@ u32 ov21_021D3374(const pokedexStatus *dexStatus, int param1) return v0; } -u32 ov21_021D338C(const pokedexStatus *dexStatus, int param1) +u32 ov21_021D338C(const PokedexStatus *dexStatus, int param1) { u32 v0; @@ -151,7 +201,7 @@ u32 ov21_021D338C(const pokedexStatus *dexStatus, int param1) return v0; } -u32 ov21_021D33A4(const pokedexStatus *dexStatus, int param1) +u32 ov21_021D33A4(const PokedexStatus *dexStatus, int param1) { u32 v0; @@ -161,7 +211,7 @@ u32 ov21_021D33A4(const pokedexStatus *dexStatus, int param1) return v0; } -u32 ov21_021D33BC(const pokedexStatus *dexStatus, int param1) +u32 ov21_021D33BC(const PokedexStatus *dexStatus, int param1) { u32 v0; @@ -171,12 +221,12 @@ u32 ov21_021D33BC(const pokedexStatus *dexStatus, int param1) return v0; } -u32 ov21_021D33D4(const pokedexStatus *dexStatus, u32 species) +u32 ov21_021D33D4(const PokedexStatus *dexStatus, u32 species) { return sub_0202756C(dexStatus->dexData, species, 0); } -u32 ov21_021D33E0(const pokedexStatus *dexStatus, int param1) +u32 ov21_021D33E0(const PokedexStatus *dexStatus, int param1) { int v0 = ov21_021D334C(dexStatus, param1, 1); @@ -187,52 +237,52 @@ u32 ov21_021D33E0(const pokedexStatus *dexStatus, int param1) return 2; } -u32 ov21_021D33F8(const pokedexStatus *dexStatus) +u32 ov21_021D33F8(const PokedexStatus *dexStatus) { return sub_0202702C(dexStatus->dexData, 0); } -u32 ov21_021D3404(const pokedexStatus *dexStatus, int param1) +u32 ov21_021D3404(const PokedexStatus *dexStatus, int param1) { return sub_02027264(dexStatus->dexData, param1); } -u32 ov21_021D3410(const pokedexStatus *dexStatus, u32 param1, int param2) +u32 ov21_021D3410(const PokedexStatus *dexStatus, u32 param1, int param2) { return sub_0202756C(dexStatus->dexData, param1, param2); } -u32 ov21_021D341C(const pokedexStatus *dexStatus, u32 param1) +u32 ov21_021D341C(const PokedexStatus *dexStatus, u32 param1) { return sub_020276C8(dexStatus->dexData, param1); } -BOOL Pokedex_Sort_PokedexUnlocked(const pokedexStatus *dexStatus) +BOOL Pokedex_Sort_PokedexUnlocked(const PokedexStatus *dexStatus) { - return Pokedex_NationalUnlocked(dexStatus->dexData); + return Pokedex_IsNationalUnlocked(dexStatus->dexData); } -void ov21_021D3434(pokedexStatus *dexStatus, u32 param1) +void ov21_021D3434(PokedexStatus *dexStatus, u32 param1) { dexStatus->unk_175C = param1; } -u32 ov21_021D3440(const pokedexStatus *dexStatus) +u32 ov21_021D3440(const PokedexStatus *dexStatus) { return dexStatus->unk_175C; } -void ov21_021D344C(pokedexStatus *dexStatus, u32 param1) +void ov21_021D344C(PokedexStatus *dexStatus, u32 param1) { dexStatus->unk_175E = param1; } -u32 ov21_021D3458(const pokedexStatus *dexStatus) +u32 ov21_021D3458(const PokedexStatus *dexStatus) { return dexStatus->unk_175E; } -BOOL Pokedex_Sort(pokedexStatus *dexStatus, int sortCategory, int firstLetterFilter, int typeFilter1, int typeFilter2, int bodyShapeFilter, int isNationalDex, int heapID, BOOL isFiltered) +BOOL Pokedex_Sort(PokedexStatus *dexStatus, int sortCategory, int firstLetterFilter, int typeFilter1, int typeFilter2, int bodyShapeFilter, int isNationalDex, int heapID, BOOL isFiltered) { u16 *pokedexPreFilterArray; int dexLengthPreFilter; @@ -348,12 +398,12 @@ BOOL Pokedex_Sort(pokedexStatus *dexStatus, int sortCategory, int firstLetterFil return dexExists; } -BOOL Pokedex_Sort_Unfiltered(pokedexStatus *dexStatus, int sortCategory, int firstLetterFilter, int typeFilter1, int typeFilter2, int bodyShapeFilter, int isNationalDex, int heapID) +BOOL Pokedex_Sort_Unfiltered(PokedexStatus *dexStatus, int sortCategory, int firstLetterFilter, int typeFilter1, int typeFilter2, int bodyShapeFilter, int isNationalDex, int heapID) { return Pokedex_Sort(dexStatus, sortCategory, firstLetterFilter, typeFilter1, typeFilter2, bodyShapeFilter, isNationalDex, heapID, 0); } -BOOL ov21_021D36A4(const pokedexStatus *dexStatus, int param1) +BOOL ov21_021D36A4(const PokedexStatus *dexStatus, int param1) { if (param1 == 0) { return 1; @@ -366,7 +416,7 @@ BOOL ov21_021D36A4(const pokedexStatus *dexStatus, int param1) return 0; } -BOOL ov21_021D36C0(pokedexStatus *dexStatus, int param1) +BOOL ov21_021D36C0(PokedexStatus *dexStatus, int param1) { BOOL v0; @@ -379,12 +429,12 @@ BOOL ov21_021D36C0(pokedexStatus *dexStatus, int param1) return v0; } -int ov21_021D36D8(const pokedexStatus *dexStatus) +int ov21_021D36D8(const PokedexStatus *dexStatus) { return dexStatus->isNationalDex; } -BOOL Pokedex_Sort_IsValidDexIndex(const pokedexStatus *dexStatus, int dexIndex) +BOOL Pokedex_Sort_IsValidDexIndex(const PokedexStatus *dexStatus, int dexIndex) { if (((dexIndex) >= 0) && ((dexIndex) < dexStatus->pokedexCompletion.numEncountered)) { return 1; @@ -393,7 +443,7 @@ BOOL Pokedex_Sort_IsValidDexIndex(const pokedexStatus *dexStatus, int dexIndex) return 0; } -BOOL ov21_021D36FC(pokedexStatus *dexStatus, int dexIndex) +BOOL ov21_021D36FC(PokedexStatus *dexStatus, int dexIndex) { if (Pokedex_Sort_IsValidDexIndex(dexStatus, dexIndex)) { dexStatus->pokedexCompletion.unk_F68 = dexIndex; @@ -403,7 +453,7 @@ BOOL ov21_021D36FC(pokedexStatus *dexStatus, int dexIndex) return 0; } -BOOL ov21_021D371C(pokedexStatus *dexStatus, int param1) +BOOL ov21_021D371C(PokedexStatus *dexStatus, int param1) { if (Pokedex_Sort_IsValidDexIndex(dexStatus, dexStatus->pokedexCompletion.unk_F68 + param1)) { dexStatus->pokedexCompletion.unk_F68 += param1; @@ -419,17 +469,17 @@ BOOL ov21_021D371C(pokedexStatus *dexStatus, int param1) return 0; } -int ov21_021D375C(const pokedexStatus *dexStatus) +int ov21_021D375C(const PokedexStatus *dexStatus) { return dexStatus->pokedexCompletion.unk_F68; } -int Pokedex_Sort_CompletionNumEncountered(const pokedexStatus *dexStatus) +int Pokedex_Sort_CompletionNumEncountered(const PokedexStatus *dexStatus) { return dexStatus->pokedexCompletion.numEncountered; } -int ov21_021D3770(const pokedexStatus *dexStatus, u32 param1) +int ov21_021D3770(const PokedexStatus *dexStatus, u32 param1) { int index; int numEncountered = Pokedex_Sort_CompletionNumEncountered(dexStatus); @@ -446,7 +496,7 @@ int ov21_021D3770(const pokedexStatus *dexStatus, u32 param1) return index; } -BOOL ov21_021D3794(pokedexStatus *dexStatus, int param1) +BOOL ov21_021D3794(PokedexStatus *dexStatus, int param1) { u32 v0 = Pokedex_Sort_CompletionNumEncountered(dexStatus); u32 v1 = ov21_021D3770(dexStatus, param1); @@ -458,17 +508,17 @@ BOOL ov21_021D3794(pokedexStatus *dexStatus, int param1) return 0; } -int Pokedex_Sort_CurrentSpecies(const pokedexStatus *dexStatus) +int Pokedex_Sort_CurrentSpecies(const PokedexStatus *dexStatus) { return dexStatus->pokedexCompletion.caughtStatusArray[dexStatus->pokedexCompletion.unk_F68].species; } -int Pokedex_Sort_CurrentCaughtStatus(const pokedexStatus *dexStatus) +int Pokedex_Sort_CurrentCaughtStatus(const PokedexStatus *dexStatus) { return dexStatus->pokedexCompletion.caughtStatusArray[dexStatus->pokedexCompletion.unk_F68].caughtStatus; } -const SpeciesCaughtStatus *Pokedex_Sort_SpeciesCaughtStatus(const pokedexStatus *dexStatus, int dexIndex) +const SpeciesCaughtStatus *Pokedex_Sort_SpeciesCaughtStatus(const PokedexStatus *dexStatus, int dexIndex) { if (Pokedex_Sort_IsValidDexIndex(dexStatus, dexIndex)) { return &dexStatus->pokedexCompletion.caughtStatusArray[dexIndex]; @@ -477,7 +527,7 @@ const SpeciesCaughtStatus *Pokedex_Sort_SpeciesCaughtStatus(const pokedexStatus return NULL; } -BOOL ov21_021D37F8(const pokedexStatus *dexStatus, int param1) +BOOL ov21_021D37F8(const PokedexStatus *dexStatus, int param1) { if ((dexStatus->pokedexCompletion.numSpecies > param1) && (param1 >= 0)) { return 1; @@ -486,7 +536,7 @@ BOOL ov21_021D37F8(const pokedexStatus *dexStatus, int param1) return 0; } -BOOL ov21_021D3810(pokedexStatus *dexStatus, int param1) +BOOL ov21_021D3810(PokedexStatus *dexStatus, int param1) { if (ov21_021D37F8(dexStatus, param1)) { dexStatus->pokedexCompletion.unk_1724 = param1; @@ -498,7 +548,7 @@ BOOL ov21_021D3810(pokedexStatus *dexStatus, int param1) return 0; } -BOOL ov21_021D3844(pokedexStatus *dexStatus, int param1) +BOOL ov21_021D3844(PokedexStatus *dexStatus, int param1) { if (ov21_021D387C(dexStatus, param1)) { dexStatus->pokedexCompletion.unk_1724 += param1; @@ -510,7 +560,7 @@ BOOL ov21_021D3844(pokedexStatus *dexStatus, int param1) return 0; } -BOOL ov21_021D387C(pokedexStatus *dexStatus, int param1) +BOOL ov21_021D387C(PokedexStatus *dexStatus, int param1) { if (ov21_021D37F8(dexStatus, dexStatus->pokedexCompletion.unk_1724 + param1)) { return 1; @@ -519,22 +569,22 @@ BOOL ov21_021D387C(pokedexStatus *dexStatus, int param1) return 0; } -int ov21_021D3898(const pokedexStatus *dexStatus) +int ov21_021D3898(const PokedexStatus *dexStatus) { return dexStatus->pokedexCompletion.unk_1724; } -int ov21_021D38A4(const pokedexStatus *dexStatus) +int ov21_021D38A4(const PokedexStatus *dexStatus) { return dexStatus->pokedexCompletion.numSpecies; } -int Pokedex_Sort_SeenIndexToSpecies(const pokedexStatus *dexStatus, int encounteredIndex) +int Pokedex_Sort_SeenIndexToSpecies(const PokedexStatus *dexStatus, int encounteredIndex) { return dexStatus->pokedexCompletion.encounteredIndexArray[encounteredIndex]; } -void ov21_021D38C0(pokedexStatus *dexStatus) +void ov21_021D38C0(PokedexStatus *dexStatus) { int v0; @@ -546,27 +596,27 @@ void ov21_021D38C0(pokedexStatus *dexStatus) } } -int Pokedex_Sort_NumEncountered(const pokedexStatus *dexStatus) +int Pokedex_Sort_NumEncountered(const PokedexStatus *dexStatus) { return dexStatus->numEncountered; } -int Pokedex_Sort_NumCaught(const pokedexStatus *dexStatus) +int Pokedex_Sort_NumCaught(const PokedexStatus *dexStatus) { return dexStatus->numCaught; } -Strbuf *Pokedex_Sort_TrainerName(const pokedexStatus *dexStatus) +Strbuf *Pokedex_Sort_TrainerName(const PokedexStatus *dexStatus) { return dexStatus->trainerName; } -u32 Pokedex_Sort_TrainerGender(const pokedexStatus *dexStatus) +u32 Pokedex_Sort_TrainerGender(const PokedexStatus *dexStatus) { return dexStatus->trainerGender; } -BOOL ov21_021D392C(const pokedexStatus *dexStatus, int param1) +BOOL ov21_021D392C(const PokedexStatus *dexStatus, int param1) { int species = Pokedex_Sort_CurrentSpecies(dexStatus); @@ -577,12 +627,12 @@ BOOL ov21_021D392C(const pokedexStatus *dexStatus, int param1) return sub_020274D0(dexStatus->dexData, species, param1); } -BOOL Pokedex_Sort_CanDetectForms(const pokedexStatus *dexStatus) +BOOL Pokedex_Sort_CanDetectForms(const PokedexStatus *dexStatus) { return Pokedex_CanDetectForms(dexStatus->dexData); } -void ov21_021D3960(pokedexStatus *dexStatus) +void ov21_021D3960(PokedexStatus *dexStatus) { if (gCoreSys.touchHeld) { dexStatus->unk_1758 = 0; @@ -598,7 +648,7 @@ void ov21_021D3960(pokedexStatus *dexStatus) } } -u32 ov21_021D3998(const pokedexStatus *dexStatus) +u32 ov21_021D3998(const PokedexStatus *dexStatus) { return dexStatus->unk_1758; } @@ -610,7 +660,7 @@ static void Pokedex_Sort_Encountered(u16 *pokedexPreFilterArray, int *numEncount *numEncountered = 0; for (index = 0; index < pokedexLength; index++) { - if (Pokedex_EncounteredSpecies(dexData, speciesArray[index])) { + if (Pokedex_HasEncountered(dexData, speciesArray[index])) { pokedexPreFilterArray[*numEncountered] = speciesArray[index]; (*numEncountered)++; } @@ -629,7 +679,7 @@ static void Pokedex_Sort_Caught(u16 *param0, int *param1, const u16 *speciesArra if (param6 == 1) { break; } else { - if (Pokedex_CaughtSpecies(dexData, speciesArray[v0])) { + if (Pokedex_HasCaught(dexData, speciesArray[v0])) { break; } } @@ -643,14 +693,14 @@ static void Pokedex_Sort_Caught(u16 *param0, int *param1, const u16 *speciesArra } } -static void Pokedex_Sort_CaughtStatus(pokedexCompletionStruct *pokedexCompletion, const PokedexData *dexData, const u16 *speciesArray, int numEncountered) +static void Pokedex_Sort_CaughtStatus(PokedexProgress *pokedexCompletion, const PokedexData *dexData, const u16 *speciesArray, int numEncountered) { int index; pokedexCompletion->numEncountered = 0; for (index = 0; index < numEncountered; index++) { - if (Pokedex_CaughtSpecies(dexData, speciesArray[index])) { + if (Pokedex_HasCaught(dexData, speciesArray[index])) { pokedexCompletion->caughtStatusArray[pokedexCompletion->numEncountered].caughtStatus = CS_CAUGHT; } else { pokedexCompletion->caughtStatusArray[pokedexCompletion->numEncountered].caughtStatus = CS_ENCOUNTERED; @@ -661,7 +711,7 @@ static void Pokedex_Sort_CaughtStatus(pokedexCompletionStruct *pokedexCompletion } } -static void Pokedex_Sort_IndentifyEnountered_Full(pokedexCompletionStruct *pokedexCompletion, const u16 *speciesArray, int pokedexLength) +static void Pokedex_Sort_IndentifyEnountered_Full(PokedexProgress *pokedexCompletion, const u16 *speciesArray, int pokedexLength) { int dexIndex; int encounteredIndex; @@ -683,7 +733,7 @@ static void Pokedex_Sort_IndentifyEnountered_Full(pokedexCompletionStruct *poked } } -static void Pokedex_Sort_IndentifyEnountered_Filtered(pokedexCompletionStruct *pokedexCompletion) +static void Pokedex_Sort_IndentifyEnountered_Filtered(PokedexProgress *pokedexCompletion) { int encounteredIndex; @@ -717,24 +767,24 @@ static void Pokedex_Sort_Order(int sortCategory, u16 *pokedexPostFilterArray, in BOOL isAlphabetical = 0; switch (sortCategory) { - case 0: + case SC_NUMERIC: pokedexSortedArray = NULL; break; - case 1: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 2, &pokedexLength); // alphabetical + case SC_ALPHABETICAL: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_ALPHABETICAL, &pokedexLength); isAlphabetical = 1; break; - case 2: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 3, &pokedexLength); // heaviest + case SC_HEAVIEST: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_HEAVIEST, &pokedexLength); break; - case 3: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 4, &pokedexLength); // lightest + case SC_LIGHTEST: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_LIGHTEST, &pokedexLength); break; - case 4: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 5, &pokedexLength); // tallest + case SC_TALLEST: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_TALLEST, &pokedexLength); break; - case 5: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 6, &pokedexLength); // shortest + case SC_SHORTEST: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_SHORTEST, &pokedexLength); break; default: GF_ASSERT(0); @@ -756,35 +806,35 @@ static void Pokedex_Sort_FilterFirstLetter(int firstLetterFilter, u16 *pokedexPo int pokedexLength; switch (firstLetterFilter) { - case 0: + case FFL_NONE: pokedexSortedArray = NULL; break; - case 1: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 7, &pokedexLength); // ABC + case FFL_ABC: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_ABC, &pokedexLength); break; - case 2: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 8, &pokedexLength); // DEF + case FFL_DEF: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_DEF, &pokedexLength); break; - case 3: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 9, &pokedexLength); // GHI + case FFL_GHI: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_GHI, &pokedexLength); break; - case 4: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 10, &pokedexLength); // JKL + case FFL_JKL: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_JKL, &pokedexLength); break; - case 5: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 11, &pokedexLength); // MNO + case FFL_MNO: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_MNO, &pokedexLength); break; - case 6: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 12, &pokedexLength); // PQR + case FFL_PQR: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_PQR, &pokedexLength); break; - case 7: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 13, &pokedexLength); // STU + case FFL_STU: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_STU, &pokedexLength); break; - case 8: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 14, &pokedexLength); // VWX + case FFL_VWX: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_VWX, &pokedexLength); break; - case 9: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 15, &pokedexLength); // YZ + case FFL_YZ: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_YZ, &pokedexLength); break; default: GF_ASSERT(0); @@ -806,59 +856,59 @@ static void Pokedex_Sort_FilterType(int typeFilter, u16 *param1, int *param2, co int pokedexLength; switch (typeFilter) { - case 0: + case FT_NONE: pokedexSortedArray = NULL; break; - case 1: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 16, &pokedexLength); // normal + case FT_NORMAL: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_NORMAL, &pokedexLength); break; - case 2: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 17, &pokedexLength); // fighting + case FT_FIGHTING: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_FIGHTING, &pokedexLength); break; - case 3: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 18, &pokedexLength); // flying + case FT_FLYING: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_FLYING, &pokedexLength); break; - case 4: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 19, &pokedexLength); // poison + case FT_POISON: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_POISON, &pokedexLength); break; - case 5: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 20, &pokedexLength); // ground + case FT_GROUND: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_GROUND, &pokedexLength); break; - case 6: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 21, &pokedexLength); // rock + case FT_ROCK: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_ROCK, &pokedexLength); break; - case 7: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 22, &pokedexLength); // bug + case FT_BUG: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_BUG, &pokedexLength); break; - case 8: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 23, &pokedexLength); // ghost + case FT_GHOST: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_GHOST, &pokedexLength); break; - case 9: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 24, &pokedexLength); // steel + case FT_STEEL: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_STEEL, &pokedexLength); break; - case 10: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 25, &pokedexLength); // fire + case FT_FIRE: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_FIRE, &pokedexLength); break; - case 11: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 26, &pokedexLength); // water + case FT_WATER: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_WATER, &pokedexLength); break; - case 12: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 27, &pokedexLength); // grass + case FT_GRASS: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_GRASS, &pokedexLength); break; - case 13: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 28, &pokedexLength); // electric + case FT_ELECTRIC: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_ELECTRIC, &pokedexLength); break; - case 14: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 29, &pokedexLength); // psychic + case FT_PSYCHIC: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_PSYCHIC, &pokedexLength); break; - case 15: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 30, &pokedexLength); // ice + case FT_ICE: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_ICE, &pokedexLength); break; - case 16: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 31, &pokedexLength); // dragon + case FT_DRAGON: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_DRAGON, &pokedexLength); break; - case 17: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 32, &pokedexLength); // dark + case FT_DARK: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_DARK, &pokedexLength); break; default: GF_ASSERT(0); @@ -880,50 +930,50 @@ static void Pokedex_Sort_FilterBodyShape(int bodyShapeFilter, u16 *param1, int * int pokedexLength; switch (bodyShapeFilter) { - case 0: + case FBS_NONE: pokedexSortedArray = NULL; break; - case 1: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 33, &pokedexLength); // quadruped + case FBS_QUADRUPED: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_QUADRUPED, &pokedexLength); break; - case 2: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 34, &pokedexLength); // bidedal tailless + case FBS_BIPEDALTAILLESS: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_BIPEDALTAILLESS, &pokedexLength); break; - case 3: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 35, &pokedexLength); // bipedal tailed + case FBS_BIPEDALTAILED: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_BIPEDALTAILED, &pokedexLength); break; - case 4: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 36, &pokedexLength); // serpentine + case FBS_SERPENTINE: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_SERPENTINE, &pokedexLength); break; - case 5: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 37, &pokedexLength); // multi winged + case FBS_MULTIWINGED: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_MULTIWINGED, &pokedexLength); break; - case 6: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 38, &pokedexLength); // winged + case FBS_WINGED: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_WINGED, &pokedexLength); break; - case 7: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 39, &pokedexLength); // insectoid + case FBS_INSECTOID: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_INSECTOID, &pokedexLength); break; - case 8: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 40, &pokedexLength); // head base + case FBS_HEADBASE: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_HEADBASE, &pokedexLength); break; - case 9: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 41, &pokedexLength); // head arms + case FBS_HEADARMS: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_HEADARMS, &pokedexLength); break; - case 10: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 42, &pokedexLength); // head legs + case FBS_HEADLEGS: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_HEADLEGS, &pokedexLength); break; - case 11: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 43, &pokedexLength); // tentacles + case FBS_TENTACLES: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_TENTACLES, &pokedexLength); break; - case 12: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 44, &pokedexLength); // fins + case FBS_FINS: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_FINS, &pokedexLength); break; - case 13: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 45, &pokedexLength); // head + case FBS_HEAD: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_HEAD, &pokedexLength); break; - case 14: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, 46, &pokedexLength); // multi-body + case FBS_MULTIBODY: + pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_MULTIBODY, &pokedexLength); break; default: GF_ASSERT(0); @@ -939,7 +989,7 @@ static void Pokedex_Sort_FilterBodyShape(int bodyShapeFilter, u16 *param1, int * } } -static void Pokedex_Sort_NumSeenNCaught(pokedexCompletionStruct *pokedexCompletion, int *numEncountered, int *numCaught) +static void Pokedex_Sort_NumSeenNCaught(PokedexProgress *pokedexCompletion, int *numEncountered, int *numCaught) { int index; diff --git a/src/overlay021/ov21_021D5AEC.c b/src/overlay021/ov21_021D5AEC.c index 90585fd792..b75d5e12ff 100644 --- a/src/overlay021/ov21_021D5AEC.c +++ b/src/overlay021/ov21_021D5AEC.c @@ -9,7 +9,7 @@ #include "overlay021/ov21_021D1FA4.h" #include "overlay021/ov21_021D4340.h" #include "overlay021/ov21_021D4C0C.h" -#include "overlay021/pokedex_sort.h" +#include "overlay021/ov21_021D3208.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D157C.h" @@ -21,7 +21,7 @@ #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" -#include "overlay021/struct_speciesCaughtStatus.h" +#include "overlay021/speciesCaughtStatus.h" #include "bg_window.h" #include "cell_actor.h" diff --git a/src/overlay021/ov21_021D76B0.c b/src/overlay021/ov21_021D76B0.c index b09e5ea08c..89852a254c 100644 --- a/src/overlay021/ov21_021D76B0.c +++ b/src/overlay021/ov21_021D76B0.c @@ -10,7 +10,7 @@ #include "overlay021/ov21_021D4340.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021D5AEC.h" -#include "overlay021/pokedex_sort.h" +#include "overlay021/ov21_021D3208.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D4660.h" @@ -114,8 +114,8 @@ static void ov21_021D8324(UnkStruct_ov21_021D7A64 *param0); static void ov21_021D8354(UnkStruct_ov21_021D7C64 *param0, UnkStruct_ov21_021D77E8 *param1, int param2, fx32 param3); static void ov21_021D83C0(UnkStruct_ov21_021D7C64 *param0, UnkStruct_ov21_021D77E8 *param1, const UnkStruct_ov21_021D77D4 *param2); static void ov21_021D8434(UnkStruct_ov21_021D7A64 *param0, int param1, int param2); -static BOOL ov21_021D84E0(UnkStruct_ov21_021D7A64 *param0, pokedexStatus *param1); -static BOOL ov21_021D8508(UnkStruct_ov21_021D7A64 *param0, pokedexStatus *param1); +static BOOL ov21_021D84E0(UnkStruct_ov21_021D7A64 *param0, PokedexStatus *param1); +static BOOL ov21_021D8508(UnkStruct_ov21_021D7A64 *param0, PokedexStatus *param1); static void ov21_021D8530(UnkStruct_ov21_021D7A64 *param0, UnkStruct_ov21_021D77D4 *param1); static fx32 ov21_021D8580(fx32 param0, s32 param1); @@ -444,7 +444,7 @@ static void ov21_021D7B8C(u32 param0, u32 param1, void *param2) UnkStruct_ov21_021D7B8C *v0 = param2; UnkStruct_ov21_021D77D4 *v1 = v0->unk_04; UnkStruct_ov21_021D7A64 *v2 = v0->unk_00; - pokedexStatus *v3 = v1->unk_1C->unk_04; + PokedexStatus *v3 = v1->unk_1C->unk_04; int v4; int v5; @@ -782,7 +782,7 @@ static void ov21_021D828C(UnkStruct_ov21_021D77E8 *param0, int param1) static void ov21_021D82A8(UnkStruct_ov21_021D7A64 *param0, UnkStruct_ov21_021D77D4 *param1) { int v0; - pokedexStatus *v1 = param1->unk_1C->unk_04; + PokedexStatus *v1 = param1->unk_1C->unk_04; if (param1->unk_1C->unk_0C <= 0) { if (param0->unk_10 != 0) { @@ -939,7 +939,7 @@ static void ov21_021D84B8(UnkStruct_ov21_021D77D4 *param0) } } -static BOOL ov21_021D84E0(UnkStruct_ov21_021D7A64 *param0, pokedexStatus *param1) +static BOOL ov21_021D84E0(UnkStruct_ov21_021D7A64 *param0, PokedexStatus *param1) { int v0; @@ -958,7 +958,7 @@ static BOOL ov21_021D84E0(UnkStruct_ov21_021D7A64 *param0, pokedexStatus *param1 return 1; } -static BOOL ov21_021D8508(UnkStruct_ov21_021D7A64 *param0, pokedexStatus *param1) +static BOOL ov21_021D8508(UnkStruct_ov21_021D7A64 *param0, PokedexStatus *param1) { int v0; diff --git a/src/overlay021/ov21_021D85B0.c b/src/overlay021/ov21_021D85B0.c index 7968b7cec0..a3fc22bcfc 100644 --- a/src/overlay021/ov21_021D85B0.c +++ b/src/overlay021/ov21_021D85B0.c @@ -8,7 +8,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" #include "overlay021/ov21_021D4340.h" -#include "overlay021/pokedex_sort.h" +#include "overlay021/ov21_021D3208.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D157C.h" @@ -35,7 +35,7 @@ typedef struct { int *unk_00; - pokedexStatus *unk_04; + PokedexStatus *unk_04; UnkStruct_ov21_021D5B68 *unk_08; int unk_0C; int unk_10; diff --git a/src/overlay021/ov21_021D94BC.c b/src/overlay021/ov21_021D94BC.c index a23b9af315..640863f386 100644 --- a/src/overlay021/ov21_021D94BC.c +++ b/src/overlay021/ov21_021D94BC.c @@ -10,7 +10,7 @@ #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021D4EE4.h" #include "overlay021/ov21_021D85B0.h" -#include "overlay021/pokedex_sort.h" +#include "overlay021/ov21_021D3208.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D2648.h" @@ -42,7 +42,7 @@ typedef struct { int *unk_00; - pokedexStatus *unk_04; + PokedexStatus *unk_04; UnkStruct_ov21_021E68F4 *unk_08; UnkStruct_ov21_021E68F4 *unk_0C; } UnkStruct_ov21_021D95B8; diff --git a/src/overlay021/ov21_021DC9BC.c b/src/overlay021/ov21_021DC9BC.c index c51043a66a..afe51887a0 100644 --- a/src/overlay021/ov21_021DC9BC.c +++ b/src/overlay021/ov21_021DC9BC.c @@ -9,7 +9,7 @@ #include "overlay021/ov21_021D1FA4.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021E29DC.h" -#include "overlay021/pokedex_sort.h" +#include "overlay021/ov21_021D3208.h" #include "overlay021/pokedexencdata.h" #include "overlay021/pokedexfieldmap.h" #include "overlay021/struct_ov21_021D0F60_decl.h" @@ -83,7 +83,7 @@ enum EncounterTime { }; typedef struct { - pokedexStatus *dexStatus; + PokedexStatus *dexStatus; int encounterTime; UnkStruct_ov21_021E68F4 *unk_08; } UnkStruct_ov21_021DCACC; diff --git a/src/overlay021/ov21_021DDD2C.c b/src/overlay021/ov21_021DDD2C.c index 458e9d2f6f..26a36a56ae 100644 --- a/src/overlay021/ov21_021DDD2C.c +++ b/src/overlay021/ov21_021DDD2C.c @@ -9,7 +9,7 @@ #include "overlay021/ov21_021D1FA4.h" #include "overlay021/ov21_021DC9BC.h" #include "overlay021/ov21_021E29DC.h" -#include "overlay021/pokedex_sort.h" +#include "overlay021/ov21_021D3208.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D4660.h" @@ -34,7 +34,7 @@ typedef struct { UnkStruct_ov21_021E68F4 *unk_00; - pokedexStatus *unk_04; + PokedexStatus *unk_04; UnkStruct_ov21_021E68F4 *unk_08; } UnkStruct_ov21_021DDDA4; diff --git a/src/overlay021/ov21_021DE668.c b/src/overlay021/ov21_021DE668.c index bd2596dd2e..e4480962a8 100644 --- a/src/overlay021/ov21_021DE668.c +++ b/src/overlay021/ov21_021DE668.c @@ -11,7 +11,7 @@ #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021D5600.h" #include "overlay021/ov21_021E29DC.h" -#include "overlay021/pokedex_sort.h" +#include "overlay021/ov21_021D3208.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D2648.h" diff --git a/src/overlay021/ov21_021DF734.c b/src/overlay021/ov21_021DF734.c index 7cbf9d7866..2109236412 100644 --- a/src/overlay021/ov21_021DF734.c +++ b/src/overlay021/ov21_021DF734.c @@ -7,7 +7,7 @@ #include "overlay021/ov21_021D1FA4.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021E29DC.h" -#include "overlay021/pokedex_sort.h" +#include "overlay021/ov21_021D3208.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D2648.h" @@ -33,7 +33,7 @@ typedef struct { int *unk_00; - pokedexStatus *unk_04; + PokedexStatus *unk_04; const UnkStruct_ov21_021E68F4 *unk_08; int unk_0C; int unk_10; diff --git a/src/overlay021/ov21_021E0C68.c b/src/overlay021/ov21_021E0C68.c index 04591b5c02..dd8f05d114 100644 --- a/src/overlay021/ov21_021E0C68.c +++ b/src/overlay021/ov21_021E0C68.c @@ -10,7 +10,7 @@ #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021D5600.h" #include "overlay021/ov21_021E29DC.h" -#include "overlay021/pokedex_sort.h" +#include "overlay021/ov21_021D3208.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D2648.h" @@ -37,7 +37,7 @@ typedef struct { int *unk_00; - pokedexStatus *unk_04; + PokedexStatus *unk_04; int unk_08; int unk_0C; const UnkStruct_ov21_021E68F4 *unk_10; diff --git a/src/overlay021/ov21_021E1924.c b/src/overlay021/ov21_021E1924.c index bba49c8954..f0da152d93 100644 --- a/src/overlay021/ov21_021E1924.c +++ b/src/overlay021/ov21_021E1924.c @@ -13,7 +13,7 @@ #include "overlay021/ov21_021DE668.h" #include "overlay021/ov21_021E0C68.h" #include "overlay021/ov21_021E29DC.h" -#include "overlay021/pokedex_sort.h" +#include "overlay021/ov21_021D3208.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D4660.h" @@ -43,7 +43,7 @@ typedef struct { int *unk_00; - pokedexStatus *unk_04; + PokedexStatus *unk_04; UnkStruct_ov21_021DE6D4 *unk_08; UnkStruct_ov21_021E68F4 *unk_0C; UnkStruct_ov21_021E68F4 *unk_10; @@ -172,7 +172,7 @@ static UnkStruct_ov21_021E1A7C *ov21_021E199C(int param0, UnkStruct_ov21_021D0F6 { UnkStruct_ov21_021E1A7C *v0; UnkStruct_ov21_021E68F4 *v1; - pokedexStatus *v2; + PokedexStatus *v2; int v3; v0 = Heap_AllocFromHeap(param0, sizeof(UnkStruct_ov21_021E1A7C)); diff --git a/src/overlay021/ov21_021E29DC.c b/src/overlay021/ov21_021E29DC.c index 0181c2be8b..f7690ec403 100644 --- a/src/overlay021/ov21_021E29DC.c +++ b/src/overlay021/ov21_021E29DC.c @@ -13,7 +13,7 @@ #include "overlay021/ov21_021DC9BC.h" #include "overlay021/ov21_021E0C68.h" #include "overlay021/ov21_021E3FFC.h" -#include "overlay021/pokedex_sort.h" +#include "overlay021/ov21_021D3208.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D4660.h" @@ -45,7 +45,7 @@ typedef struct { int *unk_00; - pokedexStatus *unk_04; + PokedexStatus *unk_04; int unk_08; UnkStruct_ov21_021D5B68 *unk_0C; UnkStruct_ov21_021DE6D4 *unk_10; @@ -76,7 +76,7 @@ typedef struct { typedef struct { int *unk_00; UnkStruct_ov21_021E2BA8 *unk_04; - pokedexStatus *unk_08; + PokedexStatus *unk_08; int unk_0C[6]; BOOL unk_24; int unk_28; diff --git a/src/overlay021/ov21_021E3FFC.c b/src/overlay021/ov21_021E3FFC.c index 03add5d4b6..06ea71703a 100644 --- a/src/overlay021/ov21_021E3FFC.c +++ b/src/overlay021/ov21_021E3FFC.c @@ -9,7 +9,7 @@ #include "overlay021/ov21_021D1FA4.h" #include "overlay021/ov21_021E29DC.h" #include "overlay021/ov21_021E4CA4.h" -#include "overlay021/pokedex_sort.h" +#include "overlay021/ov21_021D3208.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D2648.h" @@ -31,7 +31,7 @@ typedef struct { int *unk_00; - pokedexStatus *unk_04; + PokedexStatus *unk_04; UnkStruct_ov21_021E68F4 *unk_08; UnkStruct_ov21_021E68F4 *unk_0C; } UnkStruct_ov21_021E40F4; diff --git a/src/overlay021/ov21_021E4CA4.c b/src/overlay021/ov21_021E4CA4.c index ba24b18194..d4636d8947 100644 --- a/src/overlay021/ov21_021E4CA4.c +++ b/src/overlay021/ov21_021E4CA4.c @@ -9,7 +9,7 @@ #include "overlay021/ov21_021D1FA4.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021E29DC.h" -#include "overlay021/pokedex_sort.h" +#include "overlay021/ov21_021D3208.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D4660.h" @@ -40,7 +40,7 @@ typedef struct { int *unk_00; - pokedexStatus *unk_04; + PokedexStatus *unk_04; UnkStruct_ov21_021E68F4 *unk_08; int unk_0C; } UnkStruct_ov21_021E4D90; diff --git a/src/overlay021/ov21_021E6014.c b/src/overlay021/ov21_021E6014.c index b3cb48d5a1..0f6e53cd20 100644 --- a/src/overlay021/ov21_021E6014.c +++ b/src/overlay021/ov21_021E6014.c @@ -8,7 +8,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" #include "overlay021/ov21_021E29DC.h" -#include "overlay021/pokedex_sort.h" +#include "overlay021/ov21_021D3208.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D4660.h" @@ -35,7 +35,7 @@ typedef struct { int *unk_00; - pokedexStatus *dexStatus; + PokedexStatus *dexStatus; UnkStruct_ov21_021E68F4 *unk_08; } UnkStruct_ov21_021E6104; diff --git a/src/overlay021/ov21_021E68F4.c b/src/overlay021/ov21_021E68F4.c index 43cca50c28..95fb65fc7e 100644 --- a/src/overlay021/ov21_021E68F4.c +++ b/src/overlay021/ov21_021E68F4.c @@ -10,7 +10,7 @@ #include "overlay021/ov21_021D4340.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021E29DC.h" -#include "overlay021/pokedex_sort.h" +#include "overlay021/ov21_021D3208.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D4660.h" @@ -40,7 +40,7 @@ typedef struct { int *unk_00; int unk_04; - pokedexStatus *unk_08; + PokedexStatus *unk_08; UnkStruct_ov21_021E68F4 *unk_0C; } UnkStruct_ov21_021E6A20; diff --git a/src/overlay021/ov21_021E737C.c b/src/overlay021/ov21_021E737C.c index f00c3d6f5d..8d13720406 100644 --- a/src/overlay021/ov21_021E737C.c +++ b/src/overlay021/ov21_021E737C.c @@ -10,7 +10,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" #include "overlay021/ov21_021E29DC.h" -#include "overlay021/pokedex_sort.h" +#include "overlay021/ov21_021D3208.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021E68F4.h" @@ -52,7 +52,7 @@ typedef struct { } UnkStruct_ov21_021E9DB0; typedef struct { - pokedexStatus *unk_00; + PokedexStatus *unk_00; UnkStruct_ov21_021E68F4 *unk_04; } UnkStruct_ov21_021E7468; diff --git a/src/overlay021/ov21_021E8484.c b/src/overlay021/ov21_021E8484.c index 3d2c752bb2..a3c89b8c34 100644 --- a/src/overlay021/ov21_021E8484.c +++ b/src/overlay021/ov21_021E8484.c @@ -10,7 +10,7 @@ #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021DF734.h" #include "overlay021/ov21_021E29DC.h" -#include "overlay021/pokedex_sort.h" +#include "overlay021/ov21_021D3208.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D4660.h" @@ -38,7 +38,7 @@ typedef struct { int *unk_00; - pokedexStatus *unk_04; + PokedexStatus *unk_04; UnkStruct_ov21_021E68F4 *unk_08; UnkStruct_ov21_021E68F4 *unk_0C; } UnkStruct_ov21_021E8570; diff --git a/src/overlay023/ov23_0223E140.c b/src/overlay023/ov23_0223E140.c index e109ab65b1..3620cd62ad 100644 --- a/src/overlay023/ov23_0223E140.c +++ b/src/overlay023/ov23_0223E140.c @@ -1781,7 +1781,7 @@ static int ov23_0223F970(UnkStruct_ov23_02256EB0 *param0) SaveData *v0 = FieldSystem_SaveData(Unk_ov23_02257740->fieldSystem); UndergroundData *v1 = sub_020298B0(v0); BOOL v2 = TrainerInfo_ID(SaveData_GetTrainerInfo(v0)) % 2; - BOOL v3 = Pokedex_NationalUnlocked(SaveData_Pokedex(v0)); + BOOL v3 = Pokedex_IsNationalUnlocked(SaveData_Pokedex(v0)); int v4 = 0; if (v3) { diff --git a/src/overlay023/ov23_022521F0.c b/src/overlay023/ov23_022521F0.c index 241b228629..8637e16754 100644 --- a/src/overlay023/ov23_022521F0.c +++ b/src/overlay023/ov23_022521F0.c @@ -135,7 +135,7 @@ static void ov23_022522F0(UnkStruct_ov23_02250CD4 *param0, int param1) int v1, v2, v3, v4, v5; SaveData *v6 = FieldSystem_SaveData(param0->fieldSystem); UndergroundData *v7 = sub_020298B0(v6); - BOOL v8 = Pokedex_NationalUnlocked(SaveData_Pokedex(v6)); + BOOL v8 = Pokedex_IsNationalUnlocked(SaveData_Pokedex(v6)); MATH_InitRand16(&v0, sub_02028930(v7) + param1); diff --git a/src/overlay028/ov28_022561C0.c b/src/overlay028/ov28_022561C0.c index 566f10b654..c401e0d16f 100644 --- a/src/overlay028/ov28_022561C0.c +++ b/src/overlay028/ov28_022561C0.c @@ -637,13 +637,13 @@ static void ov28_02256914(UnkStruct_ov28_02256210 *param0, const UnkStruct_ov28_ v1 = SaveData_Pokedex(PoketchSystem_GetSaveData(param0->poketchSys)); - if (Pokedex_NationalUnlocked(v1)) { + if (Pokedex_IsNationalUnlocked(v1)) { v2 = v0; } else { v2 = Pokemon_NationalDexNumber((u16)v0); } - if (((v2 > 0) && (v2 <= NATIONAL_DEX_COUNT)) && Pokedex_EncounteredSpecies(v1, v2)) { + if (((v2 > 0) && (v2 <= NATIONAL_DEX_COUNT)) && Pokedex_HasEncountered(v1, v2)) { ov25_02254444(v2, 0); } } diff --git a/src/overlay062/ov62_02237D24.c b/src/overlay062/ov62_02237D24.c index bb8a222a18..c71c1c4f73 100644 --- a/src/overlay062/ov62_02237D24.c +++ b/src/overlay062/ov62_02237D24.c @@ -1475,7 +1475,7 @@ static BOOL ov62_02239984(UnkStruct_0208C06C *param0, int param1) PokedexData *v10 = SaveData_Pokedex(param0->unk_830); for (v7 = v3; v7 < v4; v7++) { - v9 = Pokedex_EncounteredSpecies(v10, v1[v7]); + v9 = Pokedex_HasEncountered(v10, v1[v7]); if (v9 == 0) { v1[v7] = 0xFFFF; @@ -1521,7 +1521,7 @@ static void ov62_02239A0C(UnkStruct_0208C06C *param0, int param1) v4->unk_1D4.unk_00 = 0; for (v5 = v2; v5 < v3; v5++) { - v7 = Pokedex_EncounteredSpecies(v8, v0[v5]); + v7 = Pokedex_HasEncountered(v8, v0[v5]); if (v7 == 0) { v0[v5] = 0xFFFF; diff --git a/src/overlay062/ov62_02241204.c b/src/overlay062/ov62_02241204.c index a6e8269d88..5b85cc4154 100644 --- a/src/overlay062/ov62_02241204.c +++ b/src/overlay062/ov62_02241204.c @@ -1519,7 +1519,7 @@ static BOOL ov62_02242748 (UnkStruct_0208C06C * param0, int param1) PokedexData * v10 = SaveData_Pokedex(param0->unk_830); for (v7 = v3; v7 < v4; v7++) { - v9 = Pokedex_EncounteredSpecies(v10, v1[v7]); + v9 = Pokedex_HasEncountered(v10, v1[v7]); if (v9 == 0) { v1[v7] = 0xFFFF; @@ -1565,7 +1565,7 @@ static void ov62_022427D0 (UnkStruct_0208C06C * param0, int param1) v4->unk_4C8.unk_00 = 0; for (v5 = v2; v5 < v3; v5++) { - v7 = Pokedex_EncounteredSpecies(v8, v0[v5]); + v7 = Pokedex_HasEncountered(v8, v0[v5]); if (v7 == 0) { v0[v5] = 0xFFFF; diff --git a/src/overlay065/ov65_0222DCE0.c b/src/overlay065/ov65_0222DCE0.c index b223442a76..81c5319920 100644 --- a/src/overlay065/ov65_0222DCE0.c +++ b/src/overlay065/ov65_0222DCE0.c @@ -1812,7 +1812,7 @@ static void ov65_0222F4C4 (UnkStruct_ov65_0222EBE0 * param0, int param1) param0->unk_04->unk_00.unk_18 = TrainerInfo_GameCode(v0); param0->unk_04->unk_00.unk_19 = TrainerInfo_RegionCode(v0); - param0->unk_04->unk_00.unk_1A = Pokedex_NationalUnlocked(v1); + param0->unk_04->unk_00.unk_1A = Pokedex_IsNationalUnlocked(v1); param0->unk_04->unk_00.unk_1B = 29; ov65_02232E70(param0, param1); diff --git a/src/overlay066/ov66_0222DDF0.c b/src/overlay066/ov66_0222DDF0.c index f41b4c438f..bd5053bcc5 100644 --- a/src/overlay066/ov66_0222DDF0.c +++ b/src/overlay066/ov66_0222DDF0.c @@ -2360,7 +2360,7 @@ static void ov66_0222F7C8(UnkStruct_ov66_0222F6C4 *param0, SaveData *param1, u32 param0->unk_20.unk_3A = ov66_02230C0C(param0->unk_20.unk_3A); param0->unk_20.unk_3C = sub_0202C8C0(v2); param0->unk_20.unk_3E = sub_0202C8C4(v2); - param0->unk_20.unk_3F = Pokedex_NationalUnlocked(v3); + param0->unk_20.unk_3F = Pokedex_IsNationalUnlocked(v3); param0->unk_20.unk_40 = TrainerInfo_IsMainStoryCleared(v0); param0->unk_20.unk_41 = 0xff; param0->unk_20.unk_43 = 0; diff --git a/src/overlay094/ov94_022414B8.c b/src/overlay094/ov94_022414B8.c index a4762a2435..8d1822869d 100644 --- a/src/overlay094/ov94_022414B8.c +++ b/src/overlay094/ov94_022414B8.c @@ -1138,12 +1138,12 @@ static int ov94_02242718(ResourceMetadata **param0, MessageLoader *param1, Messa for (v0 = 0; v0 < v3; v0++) { if (v4) { - if (Pokedex_EncounteredSpecies(param7, param3[v1 + v0])) { + if (Pokedex_HasEncountered(param7, param3[v1 + v0])) { v2++; } } else { if (param4[param3[v1 + v0]]) { - if (Pokedex_EncounteredSpecies(param7, param3[v1 + v0])) { + if (Pokedex_HasEncountered(param7, param3[v1 + v0])) { v2++; } } @@ -1154,12 +1154,12 @@ static int ov94_02242718(ResourceMetadata **param0, MessageLoader *param1, Messa for (v0 = 0; v0 < v3; v0++) { if (v4) { - if (Pokedex_EncounteredSpecies(param7, param3[v1 + v0])) { + if (Pokedex_HasEncountered(param7, param3[v1 + v0])) { sub_02013A4C(*param0, param1, param3[v1 + v0], param3[v1 + v0]); } } else { if (param4[param3[v1 + v0]]) { - if (Pokedex_EncounteredSpecies(param7, param3[v1 + v0])) { + if (Pokedex_HasEncountered(param7, param3[v1 + v0])) { sub_02013A4C(*param0, param1, param3[v1 + v0], param3[v1 + v0]); } } diff --git a/src/overlay097/ov97_0222AE60.c b/src/overlay097/ov97_0222AE60.c index 7c87d697de..65498f947c 100644 --- a/src/overlay097/ov97_0222AE60.c +++ b/src/overlay097/ov97_0222AE60.c @@ -239,7 +239,7 @@ static void ov97_0222AF1C(UnkStruct_0222AE60 *param0) sub_02017B70(v0); - if (Pokedex_NationalUnlocked(param0->unk_08) == 0) { + if (Pokedex_IsNationalUnlocked(param0->unk_08) == 0) { return; } diff --git a/src/scrcmd.c b/src/scrcmd.c index 454ede19d0..879bd92791 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -6487,7 +6487,7 @@ static BOOL ScrCmd_218(ScriptContext *ctx) *v1 = 25; for (v4 = 1, v5 = 0; v4 <= NATIONAL_DEX_COUNT; v4++) { - if ((Pokedex_EncounteredSpecies(v0, v4) == 1) && (Pokemon_SinnohDexNumber(v4) != 0)) { + if ((Pokedex_HasEncountered(v0, v4) == 1) && (Pokemon_SinnohDexNumber(v4) != 0)) { if (v5 == v3) { *v1 = v4; break; @@ -6598,7 +6598,7 @@ static BOOL ScrCmd_22D(ScriptContext *ctx) sub_02027454(SaveData_Pokedex(ctx->fieldSystem->saveData)); TrainerInfo_GiveNationalDex(SaveData_GetTrainerInfo(ctx->fieldSystem->saveData)); } else if (v0 == 2) { - *v1 = Pokedex_NationalUnlocked(SaveData_Pokedex(ctx->fieldSystem->saveData)); + *v1 = Pokedex_IsNationalUnlocked(SaveData_Pokedex(ctx->fieldSystem->saveData)); } else { GF_ASSERT(FALSE); } diff --git a/src/unk_0202631C.c b/src/unk_0202631C.c index 734e72166d..498a063a4c 100644 --- a/src/unk_0202631C.c +++ b/src/unk_0202631C.c @@ -211,7 +211,7 @@ static int sub_02026464(const PokedexData *dexData, u32 param1) GF_ASSERT((param1 == 422) || (param1 == 423) || (param1 == 492) || (param1 == 487)); - if (Pokedex_EncounteredSpecies(dexData, param1) == 0) { + if (Pokedex_HasEncountered(dexData, param1) == 0) { return 0; } @@ -249,7 +249,7 @@ static BOOL sub_02026514(const PokedexData *dexData, u32 param1, u8 param2) GF_ASSERT((param1 == 422) || (param1 == 423) || (param1 == 492) || (param1 == 487)); - if (Pokedex_EncounteredSpecies(dexData, param1) == 0) { + if (Pokedex_HasEncountered(dexData, param1) == 0) { return 0; } @@ -326,7 +326,7 @@ static int sub_020266F8(const PokedexData *dexData, u32 param1) GF_ASSERT((param1 == 412) || (param1 == 413)); - if (Pokedex_EncounteredSpecies(dexData, param1) == 0) { + if (Pokedex_HasEncountered(dexData, param1) == 0) { return 0; } @@ -355,7 +355,7 @@ static BOOL sub_02026754(const PokedexData *dexData, u32 param1, u8 param2) GF_ASSERT((param1 == 412) || (param1 == 413)); - if (Pokedex_EncounteredSpecies(dexData, param1) == 0) { + if (Pokedex_HasEncountered(dexData, param1) == 0) { return 0; } @@ -510,7 +510,7 @@ static int sub_02026958(const PokedexData *dexData, u32 param1) GF_ASSERT(param1 == 479); - if (Pokedex_EncounteredSpecies(dexData, param1) == 0) { + if (Pokedex_HasEncountered(dexData, param1) == 0) { return 0; } @@ -537,7 +537,7 @@ static BOOL sub_020269A4(const PokedexData *dexData, u32 param1, u8 param2) GF_ASSERT(param1 == 479); - if (Pokedex_EncounteredSpecies(dexData, param1) == 0) { + if (Pokedex_HasEncountered(dexData, param1) == 0) { return 0; } @@ -778,7 +778,7 @@ u16 sub_02026DD0(const PokedexData *dexData) v1 = 0; for (v0 = 1; v0 <= NATIONAL_DEX_COUNT; v0++) { - if (Pokedex_CaughtSpecies(dexData, v0) == 1) { + if (Pokedex_HasCaught(dexData, v0) == 1) { v1++; } } @@ -795,7 +795,7 @@ u16 sub_02026E0C(const PokedexData *dexData) v1 = 0; for (v0 = 1; v0 <= NATIONAL_DEX_COUNT; v0++) { - if (Pokedex_EncounteredSpecies(dexData, v0) == 1) { + if (Pokedex_HasEncountered(dexData, v0) == 1) { v1++; } } @@ -805,7 +805,7 @@ u16 sub_02026E0C(const PokedexData *dexData) u16 sub_02026E48(const PokedexData *dexData) { - if (Pokedex_NationalUnlocked(dexData)) { + if (Pokedex_IsNationalUnlocked(dexData)) { return sub_02026E0C(dexData); } @@ -821,7 +821,7 @@ u16 sub_02026E64(const PokedexData *dexData) v1 = 0; for (v0 = 1; v0 <= NATIONAL_DEX_COUNT; v0++) { - if (Pokedex_CaughtSpecies(dexData, v0) == 1) { + if (Pokedex_HasCaught(dexData, v0) == 1) { if (Pokemon_SinnohDexNumber(v0) != 0) { v1++; } @@ -840,7 +840,7 @@ u16 sub_02026EAC(const PokedexData *dexData) v1 = 0; for (v0 = 1; v0 <= NATIONAL_DEX_COUNT; v0++) { - if (Pokedex_EncounteredSpecies(dexData, v0) == 1) { + if (Pokedex_HasEncountered(dexData, v0) == 1) { if (Pokemon_SinnohDexNumber(v0) != 0) { v1++; } @@ -884,7 +884,7 @@ u16 sub_02026F20(const PokedexData *dexData) v1 = 0; for (v0 = 1; v0 <= NATIONAL_DEX_COUNT; v0++) { - if (Pokedex_CaughtSpecies(dexData, v0) == 1) { + if (Pokedex_HasCaught(dexData, v0) == 1) { if (sub_02026D44(v0) == 1) { v1++; } @@ -903,7 +903,7 @@ u16 sub_02026F58(const PokedexData *dexData) v1 = 0; for (v0 = 1; v0 <= NATIONAL_DEX_COUNT; v0++) { - if (Pokedex_EncounteredSpecies(dexData, v0) == 1) { + if (Pokedex_HasEncountered(dexData, v0) == 1) { v2 = Pokemon_SinnohDexNumber(v0); if (v2 != 0) { @@ -917,7 +917,7 @@ u16 sub_02026F58(const PokedexData *dexData) return v1; } -BOOL Pokedex_CaughtSpecies(const PokedexData *dexData, u16 species) +BOOL Pokedex_HasCaught(const PokedexData *dexData, u16 species) { CheckPokedexIntegrity(dexData); @@ -932,7 +932,7 @@ BOOL Pokedex_CaughtSpecies(const PokedexData *dexData, u16 species) } } -BOOL Pokedex_EncounteredSpecies(const PokedexData *dexData, u16 species) +BOOL Pokedex_HasEncountered(const PokedexData *dexData, u16 species) { CheckPokedexIntegrity(dexData); @@ -1139,7 +1139,7 @@ void sub_02027454(PokedexData *dexData) dexData->nationalDexObtained = 1; } -BOOL Pokedex_NationalUnlocked(const PokedexData *dexData) +BOOL Pokedex_IsNationalUnlocked(const PokedexData *dexData) { CheckPokedexIntegrity(dexData); return dexData->nationalDexObtained; diff --git a/src/unk_02046C7C.c b/src/unk_02046C7C.c index 0c63980ab7..036801ab17 100644 --- a/src/unk_02046C7C.c +++ b/src/unk_02046C7C.c @@ -107,7 +107,7 @@ BOOL ScrCmd_0FA(ScriptContext *param0) v8.unk_01 = v4; v8.unk_02 = v6; v8.unk_03 = sub_0206A954(SaveData_GetVarsFlags(param0->fieldSystem->saveData)); - v8.unk_04 = Pokedex_NationalUnlocked(SaveData_Pokedex(param0->fieldSystem->saveData)); + v8.unk_04 = Pokedex_IsNationalUnlocked(SaveData_Pokedex(param0->fieldSystem->saveData)); v8.unk_05 = v7; v8.unk_08 = v1; v8.unk_0C = v0; diff --git a/src/unk_0204AEE8.c b/src/unk_0204AEE8.c index 8fdaded66e..c88482eece 100644 --- a/src/unk_0204AEE8.c +++ b/src/unk_0204AEE8.c @@ -121,7 +121,7 @@ StringTemplate *sub_0204AEE8(SaveData *param0, u16 param1, u16 param2, u8 param3 for (v0 = 0; v0 < 18; v0++) { v1 = sub_02078824(v0); - if (Pokedex_EncounteredSpecies(v4, v1)) { + if (Pokedex_HasEncountered(v4, v1)) { MessageLoader_GetStrbuf(v6, v1, v2); StringTemplate_SetStrbuf(v5, (*param4) + 1, v2, param2, param3, GAME_LANGUAGE); (*param4)++; diff --git a/src/unk_020683F4.c b/src/unk_020683F4.c index a42e5d91d9..24c449db18 100644 --- a/src/unk_020683F4.c +++ b/src/unk_020683F4.c @@ -1070,7 +1070,7 @@ static u32 sub_02069130(const UnkStruct_020684D0 *param0) return -1; } - if (Pokedex_NationalUnlocked(SaveData_Pokedex(param0->fieldSystem->saveData)) == 0) { + if (Pokedex_IsNationalUnlocked(SaveData_Pokedex(param0->fieldSystem->saveData)) == 0) { return -1; } diff --git a/src/unk_0206CCB0.c b/src/unk_0206CCB0.c index 6f55310a9c..c45c04fcab 100644 --- a/src/unk_0206CCB0.c +++ b/src/unk_0206CCB0.c @@ -774,7 +774,7 @@ static BOOL sub_0206D320(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param PokedexData *v0 = SaveData_Pokedex(fieldSystem->saveData); UnkStruct_0206D140 *v1 = ov6_02246498(param1); - return Pokedex_EncounteredSpecies(v0, v1->unk_06); + return Pokedex_HasEncountered(v0, v1->unk_06); } void sub_0206D340(FieldSystem *fieldSystem, BOOL param1, u16 param2, Pokemon *param3) @@ -815,7 +815,7 @@ static BOOL sub_0206D3C0(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param return 1; } - return Pokedex_EncounteredSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); + return Pokedex_HasEncountered(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); } static void sub_0206D3E4(FieldSystem *fieldSystem, int param1) @@ -936,7 +936,7 @@ static int sub_0206D5B0(FieldSystem *fieldSystem, StringTemplate *param1, UnkStr static BOOL sub_0206D5F0(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param1) { UnkStruct_0206D5B0 *v0 = (UnkStruct_0206D5B0 *)ov6_02246498(param1); - return Pokedex_EncounteredSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); + return Pokedex_HasEncountered(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); } void sub_0206D60C(FieldSystem *fieldSystem, Pokemon *param1) @@ -965,7 +965,7 @@ static BOOL sub_0206D6A8(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param PokedexData *v0 = SaveData_Pokedex(fieldSystem->saveData); UnkStruct_0206D644 *v1 = (UnkStruct_0206D644 *)ov6_02246498(param1); - return Pokedex_EncounteredSpecies(v0, v1->unk_00); + return Pokedex_HasEncountered(v0, v1->unk_00); } void sub_0206D6C8(FieldSystem *fieldSystem, int param1, int param2) @@ -1026,7 +1026,7 @@ static BOOL sub_0206D7A4(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param PokedexData *v0 = SaveData_Pokedex(fieldSystem->saveData); UnkStruct_0206D75C *v1 = (UnkStruct_0206D75C *)ov6_02246498(param1); - return Pokedex_EncounteredSpecies(v0, v1->unk_00); + return Pokedex_HasEncountered(v0, v1->unk_00); } void sub_0206D7C4(FieldSystem *fieldSystem) @@ -1093,7 +1093,7 @@ static BOOL sub_0206D8F0(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param { UnkStruct_0206D8B0 *v0 = (UnkStruct_0206D8B0 *)ov6_02246498(param1); - return Pokedex_EncounteredSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); + return Pokedex_HasEncountered(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); } void sub_0206D90C(TVBroadcast *fieldSystem, Pokemon *param1, u16 param2) @@ -1172,7 +1172,7 @@ static BOOL sub_0206DA50(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param { UnkStruct_0206D9F4 *v0 = (UnkStruct_0206D9F4 *)ov6_02246498(param1); - return Pokedex_EncounteredSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); + return Pokedex_HasEncountered(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); } static void sub_0206DA6C(UnkStruct_0206DA6C *param0, const TrainerInfo *param1) @@ -1305,7 +1305,7 @@ static BOOL sub_0206DC3C(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param { UnkStruct_0206DBE8 *v0 = (UnkStruct_0206DBE8 *)ov6_02246498(param1); - if (Pokedex_EncounteredSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_02) == 0) { + if (Pokedex_HasEncountered(SaveData_Pokedex(fieldSystem->saveData), v0->unk_02) == 0) { return 0; } @@ -1342,7 +1342,7 @@ static int sub_0206DC9C(FieldSystem *fieldSystem, StringTemplate *param1, UnkStr static BOOL sub_0206DD1C(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param1) { UnkStruct_0206DC9C *v0 = (UnkStruct_0206DC9C *)ov6_02246498(param1); - return Pokedex_EncounteredSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); + return Pokedex_HasEncountered(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); } void sub_0206DD38(FieldSystem *fieldSystem, u32 param1, u32 param2, u32 param3) @@ -1683,7 +1683,7 @@ static BOOL sub_0206E248(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param { UnkStruct_0206E1C0 *v0 = ov6_02246498(param1); - return Pokedex_EncounteredSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); + return Pokedex_HasEncountered(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); } void sub_0206E264(FieldSystem *fieldSystem, u16 param1) @@ -1743,7 +1743,7 @@ static int sub_0206E300(FieldSystem *fieldSystem, StringTemplate *param1, UnkStr static BOOL sub_0206E37C(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param1) { UnkStruct_0206E300 *v0 = ov6_02246498(param1); - return Pokedex_EncounteredSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00.unk_02); + return Pokedex_HasEncountered(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00.unk_02); } void sub_0206E398(FieldSystem *fieldSystem, u16 param1) @@ -1777,7 +1777,7 @@ static int sub_0206E3C8(FieldSystem *fieldSystem, StringTemplate *param1, UnkStr static BOOL sub_0206E3F8(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param1) { UnkStruct_0206E3C8 *v0 = ov6_02246498(param1); - return Pokedex_EncounteredSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); + return Pokedex_HasEncountered(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); } void sub_0206E414(FieldSystem *fieldSystem, u16 param1) @@ -2760,7 +2760,7 @@ static int sub_0206F01C(FieldSystem *fieldSystem, StringTemplate *param1, UnkStr v1 = (LCRNG_Next() % (NATIONAL_DEX_COUNT - 1)) + 1; for (v2 = 1; v2 <= NATIONAL_DEX_COUNT; v2++) { - if (Pokedex_EncounteredSpecies(v4, v1) == 1) { + if (Pokedex_HasEncountered(v4, v1) == 1) { v3 = v1; break; } @@ -2861,7 +2861,7 @@ static int sub_0206F160(FieldSystem *fieldSystem, StringTemplate *param1, UnkStr v1 = (LCRNG_Next() % (NATIONAL_DEX_COUNT - 2) + 1); for (v2 = 1; v2 <= NATIONAL_DEX_COUNT; v2++) { - if (Pokedex_EncounteredSpecies(v6, v1) == 1) { + if (Pokedex_HasEncountered(v6, v1) == 1) { v0 = sub_0206F0D8(v1, 4); StringTemplate_SetStrbuf(param1, 2, v0, 0, 1, GAME_LANGUAGE); Strbuf_Free(v0); diff --git a/src/unk_0207A274.c b/src/unk_0207A274.c index cfd7a4eb6c..a0d9b77d03 100644 --- a/src/unk_0207A274.c +++ b/src/unk_0207A274.c @@ -21,7 +21,7 @@ u32 sub_0207A280(const PokedexData *param0) { BOOL v0; - v0 = Pokedex_NationalUnlocked(param0); + v0 = Pokedex_IsNationalUnlocked(param0); if (v0 == 1) { return 1; diff --git a/src/unk_020998EC.c b/src/unk_020998EC.c index 53a74f73f1..497a6c47a1 100644 --- a/src/unk_020998EC.c +++ b/src/unk_020998EC.c @@ -3236,7 +3236,7 @@ static u32 sub_02099980(UnkStruct_020998EC *param0, const u16 *param1, u32 param v0 = sub_0209755C(param0->unk_00); for (v1 = 0; v1 < param2; v1++) { - if (Pokedex_EncounteredSpecies(v0, param1[v1])) { + if (Pokedex_HasEncountered(v0, param1[v1])) { inline_02099980(param0, param1[v1]); *param3++ = param1[v1]; v2++; From f25be82d5b43d6aef429d4edfe5d7a72402b007d Mon Sep 17 00:00:00 2001 From: h2o-DS Date: Sun, 3 Nov 2024 18:37:50 -0500 Subject: [PATCH 11/16] Cleaned up PokedexSort --- include/overlay021/ov21_021D0D80.h | 30 +- include/overlay021/ov21_021D3208.h | 122 -- include/overlay021/pokedexprogress.h | 17 - include/overlay021/pokedexsort.h | 122 ++ include/overlay021/sortedpokedex.h | 17 + ...pokedexstatus.h => struct_ov21_021D3320.h} | 12 +- include/overlay021/struct_ov21_021D5B68.h | 4 +- include/overlay021/struct_ov21_021DE6D4.h | 4 +- platinum.us/main.lsf | 2 +- src/meson.build | 2 +- src/overlay021/ov21_021D0D80.c | 50 +- src/overlay021/ov21_021D3208.c | 1006 ----------------- src/overlay021/ov21_021D5AEC.c | 82 +- src/overlay021/ov21_021D76B0.c | 26 +- src/overlay021/ov21_021D85B0.c | 12 +- src/overlay021/ov21_021D94BC.c | 6 +- src/overlay021/ov21_021DC9BC.c | 72 +- src/overlay021/ov21_021DDD2C.c | 6 +- src/overlay021/ov21_021DE668.c | 26 +- src/overlay021/ov21_021DF734.c | 14 +- src/overlay021/ov21_021E0C68.c | 18 +- src/overlay021/ov21_021E1924.c | 12 +- src/overlay021/ov21_021E29DC.c | 22 +- src/overlay021/ov21_021E3FFC.c | 10 +- src/overlay021/ov21_021E4CA4.c | 14 +- src/overlay021/ov21_021E6014.c | 30 +- src/overlay021/ov21_021E68F4.c | 6 +- src/overlay021/ov21_021E737C.c | 22 +- src/overlay021/ov21_021E8484.c | 6 +- src/overlay021/pokedexsort.c | 993 ++++++++++++++++ 30 files changed, 1376 insertions(+), 1389 deletions(-) delete mode 100644 include/overlay021/ov21_021D3208.h delete mode 100644 include/overlay021/pokedexprogress.h create mode 100644 include/overlay021/pokedexsort.h create mode 100644 include/overlay021/sortedpokedex.h rename include/overlay021/{struct_pokedexstatus.h => struct_ov21_021D3320.h} (71%) delete mode 100644 src/overlay021/ov21_021D3208.c create mode 100644 src/overlay021/pokedexsort.c diff --git a/include/overlay021/ov21_021D0D80.h b/include/overlay021/ov21_021D0D80.h index 45ecb80db4..6ebc173419 100644 --- a/include/overlay021/ov21_021D0D80.h +++ b/include/overlay021/ov21_021D0D80.h @@ -13,7 +13,7 @@ #include "overlay021/struct_ov21_021D4C0C_decl.h" #include "overlay021/struct_ov21_021D4CA0.h" #include "overlay021/struct_ov21_021E68F4.h" -#include "overlay021/struct_pokedexstatus.h" +#include "overlay021/struct_ov21_021d3320.h" #include "bg_window.h" #include "cell_actor.h" @@ -42,7 +42,7 @@ int *ov21_021D13A0(UnkStruct_ov21_021D0F60 *param0); int *ov21_021D13B4(UnkStruct_ov21_021D0F60 *param0); int *ov21_021D13C8(UnkStruct_ov21_021D0F60 *param0); BOOL *ov21_021D13DC(UnkStruct_ov21_021D0F60 *param0); -PokedexStatus *ov21_021D13EC(UnkStruct_ov21_021D0F60 *param0); +UnkStruct_ov21_021D3320 *ov21_021D13EC(UnkStruct_ov21_021D0F60 *param0); UnkStruct_ov21_021D13FC *ov21_021D13FC(UnkStruct_ov21_021D0F60 *param0); UnkStruct_ov21_021E68F4 *ov21_021D1410(UnkStruct_ov21_021D0F60 *param0, int param1); UnkStruct_ov21_021E68F4 *ov21_021D1430(UnkStruct_ov21_021D0F60 *param0, int param1); @@ -53,23 +53,23 @@ void ov21_021D154C(TouchScreenHitTable *hitTable, int param1, int param2, int pa void ov21_021D1558(UnkStruct_ov21_021D157C *param0, BgConfig *param1, int param2, NNSG2dScreenData *param3, int param4, int param5, int param6, int param7, int param8); BOOL ov21_021D157C(UnkStruct_ov21_021D157C *param0); void ov21_021D1650(Window *param0, int param1, int param2, int param3); -Window *ov21_021D16D8(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3); +Window *ov21_021D16D8(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3); Window *ov21_021D170C(UnkStruct_ov21_021D4C0C *param0, int param1, int param2); Window *ov21_021D172C(UnkStruct_ov21_021D4C0C *param0, int param1, int param2); -void ov21_021D1778(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3, fx32 param4, fx32 param5); +void ov21_021D1778(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, fx32 param4, fx32 param5); void ov21_021D1848(UnkStruct_ov21_021D13FC *param0, int param1, int param2); void ov21_021D1858(UnkStruct_ov21_021D22F8 *param0, int param1, int param2); -void ov21_021D1890(UnkStruct_ov21_021D13FC *param0, PokedexStatus *param1, int param2, int param3, int param4, int param5); -u32 ov21_021D19D8(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3, int param4, int param5, int param6, int param7); -u32 ov21_021D1A34(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3, int param4, int param5, int param6); -u32 ov21_021D1A78(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3, int param4, int param5, int param6); -u32 ov21_021D1AC0(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3, int param4, int param5, int param6); -u32 ov21_021D1B08(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3, int param4, int param5, int param6); -u32 ov21_021D1B4C(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3, int param4, int param5, int param6); -u32 ov21_021D1B94(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3, int param4, int param5, int param6); -u32 ov21_021D1BD8(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3, int param4, int param5, int param6); -u32 ov21_021D1C30(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3, int param4, int param5, int param6); -u32 ov21_021D1C88(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3, int param4, int param5, int param6); +void ov21_021D1890(UnkStruct_ov21_021D13FC *param0, UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5); +u32 ov21_021D19D8(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6, int param7); +u32 ov21_021D1A34(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6); +u32 ov21_021D1A78(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6); +u32 ov21_021D1AC0(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6); +u32 ov21_021D1B08(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6); +u32 ov21_021D1B4C(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6); +u32 ov21_021D1B94(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6); +u32 ov21_021D1BD8(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6); +u32 ov21_021D1C30(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6); +u32 ov21_021D1C88(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6); Strbuf *ov21_021D1CE0(int param0, int param1); #endif // POKEPLATINUM_OV21_021D0D80_H diff --git a/include/overlay021/ov21_021D3208.h b/include/overlay021/ov21_021D3208.h deleted file mode 100644 index bef6b43365..0000000000 --- a/include/overlay021/ov21_021D3208.h +++ /dev/null @@ -1,122 +0,0 @@ -#ifndef POKEPLATINUM_OV21_021D3208_H -#define POKEPLATINUM_OV21_021D3208_H - -#include "overlay021/struct_ov21_021D3208.h" -#include "overlay021/struct_pokedexstatus.h" -#include "overlay021/speciesCaughtStatus.h" - -#include "strbuf.h" - -enum SortCategory { - SC_NUMERIC, - SC_ALPHABETICAL, - SC_HEAVIEST, - SC_LIGHTEST, - SC_TALLEST, - SC_SHORTEST -}; - -enum FilterFirstLetter { - FFL_NONE, - FFL_ABC, - FFL_DEF, - FFL_GHI, - FFL_JKL, - FFL_MNO, - FFL_PQR, - FFL_STU, - FFL_VWX, - FFL_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 FilterBodyShape { - FBS_NONE, - FBS_QUADRUPED, - FBS_BIPEDALTAILLESS, - FBS_BIPEDALTAILED, - FBS_SERPENTINE, - FBS_MULTIWINGED, - FBS_WINGED, - FBS_INSECTOID, - FBS_HEADBASE, - FBS_HEADARMS, - FBS_HEADLEGS, - FBS_TENTACLES, - FBS_FINS, - FBS_HEAD, - FBS_MULTIBODY -}; - -void Pokedex_Sort_PopulatepokedexStatus(PokedexStatus *param0, UnkStruct_ov21_021D3208 *param1, int param2); -void Pokedex_Sort_PokedexStatusFreeHWData(PokedexStatus *param0); -u32 ov21_021D334C(const PokedexStatus *param0, int param1, int param2); -u32 ov21_021D335C(const PokedexStatus *param0, int param1); -u32 ov21_021D3374(const PokedexStatus *param0, int param1); -u32 ov21_021D338C(const PokedexStatus *param0, int param1); -u32 ov21_021D33A4(const PokedexStatus *param0, int param1); -u32 ov21_021D33BC(const PokedexStatus *param0, int param1); -u32 ov21_021D33D4(const PokedexStatus *param0, u32 param1); -u32 ov21_021D33E0(const PokedexStatus *param0, int param1); -u32 ov21_021D33F8(const PokedexStatus *param0); -u32 ov21_021D3404(const PokedexStatus *param0, int param1); -u32 ov21_021D3410(const PokedexStatus *param0, u32 param1, int param2); -u32 ov21_021D341C(const PokedexStatus *param0, u32 param1); -BOOL Pokedex_Sort_PokedexUnlocked(const PokedexStatus *param0); -void ov21_021D3434(PokedexStatus *param0, u32 param1); -u32 ov21_021D3440(const PokedexStatus *param0); -void ov21_021D344C(PokedexStatus *param0, u32 param1); -u32 ov21_021D3458(const PokedexStatus *param0); -BOOL Pokedex_Sort(PokedexStatus *dexStatus, int sortCategory, int firstLetterFilter, int typeFilter1, int typeFilter2, int bodyShapeFilter, int isNationalDex, int heapID, BOOL isFiltered); -BOOL Pokedex_Sort_Unfiltered(PokedexStatus *param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7); -BOOL ov21_021D36A4(const PokedexStatus *param0, int param1); -BOOL ov21_021D36C0(PokedexStatus *param0, int param1); -int ov21_021D36D8(const PokedexStatus *param0); -BOOL Pokedex_Sort_IsValidDexIndex(const PokedexStatus *dexStatus, int dexIndex); -BOOL ov21_021D36FC(PokedexStatus *param0, int param1); -BOOL ov21_021D371C(PokedexStatus *param0, int param1); -int ov21_021D375C(const PokedexStatus *param0); -int Pokedex_Sort_CompletionNumEncountered(const PokedexStatus *param0); -int ov21_021D3770(const PokedexStatus *param0, u32 param1); -BOOL ov21_021D3794(PokedexStatus *param0, int param1); -int Pokedex_Sort_CurrentSpecies(const PokedexStatus *param0); -int Pokedex_Sort_CurrentCaughtStatus(const PokedexStatus *param0); -const SpeciesCaughtStatus *Pokedex_Sort_SpeciesCaughtStatus(const PokedexStatus *param0, int dexIndex); -BOOL ov21_021D37F8(const PokedexStatus *param0, int param1); -BOOL ov21_021D3810(PokedexStatus *param0, int param1); -BOOL ov21_021D3844(PokedexStatus *param0, int param1); -BOOL ov21_021D387C(PokedexStatus *param0, int param1); -int ov21_021D3898(const PokedexStatus *param0); -int ov21_021D38A4(const PokedexStatus *param0); -int Pokedex_Sort_SeenIndexToSpecies(const PokedexStatus *param0, int param1); -void ov21_021D38C0(PokedexStatus *param0); -int Pokedex_Sort_NumEncountered(const PokedexStatus *param0); -int Pokedex_Sort_NumCaught(const PokedexStatus *param0); -Strbuf *Pokedex_Sort_TrainerName(const PokedexStatus *param0); -u32 Pokedex_Sort_TrainerGender(const PokedexStatus *param0); -BOOL ov21_021D392C(const PokedexStatus *param0, int param1); -BOOL Pokedex_Sort_CanDetectForms(const PokedexStatus *param0); -void ov21_021D3960(PokedexStatus *param0); -u32 ov21_021D3998(const PokedexStatus *param0); - -#endif // POKEPLATINUM_OV21_021D3208_H diff --git a/include/overlay021/pokedexprogress.h b/include/overlay021/pokedexprogress.h deleted file mode 100644 index 42fbb95a37..0000000000 --- a/include/overlay021/pokedexprogress.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef POKEPLATINUM_POKEDEXPROGRESS_H -#define POKEPLATINUM_POKEDEXPROGRESS_H - -#include "constants/species.h" - -#include "overlay021/speciesCaughtStatus.h" - -typedef struct { - SpeciesCaughtStatus caughtStatusArray[NATIONAL_DEX_COUNT]; - int unk_F68; - int numEncountered; // number of pokemon seen - int encounteredIndexArray[NATIONAL_DEX_COUNT]; // dex number for appearing in dex, dexLength+1 otherwise - int unk_1724; - int numSpecies; -} PokedexProgress; - -#endif // POKEPLATINUM_POKEDEXPROGRESS_H diff --git a/include/overlay021/pokedexsort.h b/include/overlay021/pokedexsort.h new file mode 100644 index 0000000000..dae90465dc --- /dev/null +++ b/include/overlay021/pokedexsort.h @@ -0,0 +1,122 @@ +#ifndef POKEPLATINUM_POKEDEXSORT_H +#define POKEPLATINUM_POKEDEXSORT_H + +#include "overlay021/STRUCT_OV21_021D3208.h" +#include "overlay021/speciesCaughtStatus.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/sortedpokedex.h b/include/overlay021/sortedpokedex.h new file mode 100644 index 0000000000..ded78a782b --- /dev/null +++ b/include/overlay021/sortedpokedex.h @@ -0,0 +1,17 @@ +#ifndef POKEPLATINUM_SORTEDPOKEDEX_H +#define POKEPLATINUM_SORTEDPOKEDEX_H + +#include "constants/species.h" + +#include "overlay021/speciesCaughtStatus.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/struct_pokedexstatus.h b/include/overlay021/struct_ov21_021D3320.h similarity index 71% rename from include/overlay021/struct_pokedexstatus.h rename to include/overlay021/struct_ov21_021D3320.h index c5b725a384..8a464a7827 100644 --- a/include/overlay021/struct_pokedexstatus.h +++ b/include/overlay021/struct_ov21_021D3320.h @@ -1,16 +1,16 @@ -#ifndef POKEPLATINUM_STRUCT_POKEDEXSTATUS_H -#define POKEPLATINUM_STRUCT_POKEDEXSTATUS_H +#ifndef POKEPLATINUM_STRUCT_OV21_021D3320_H +#define POKEPLATINUM_STRUCT_OV21_021D3320_H #include "struct_decls/pokedexdata_decl.h" #include "struct_decls/struct_02098700_decl.h" -#include "overlay021/pokedexProgress.h" +#include "overlay021/sortedpokedex.h" #include "strbuf.h" typedef struct { const PokedexData *dexData; - PokedexProgress pokedexCompletion; + SortedPokedex sortedPokedex; int isNationalDex; BOOL isNationalDexUnlocked; int numEncountered; @@ -28,6 +28,6 @@ typedef struct { BOOL newmoonIslandVisible; BOOL springPathVisible; BOOL seabreakPathVisible; -} PokedexStatus; +} UnkStruct_ov21_021D3320; -#endif // POKEPLATINUM_STRUCT_POKEDEXSTATUS_H +#endif // POKEPLATINUM_STRUCT_OV21_021D3320_H diff --git a/include/overlay021/struct_ov21_021D5B68.h b/include/overlay021/struct_ov21_021D5B68.h index 364a988e30..f440385542 100644 --- a/include/overlay021/struct_ov21_021D5B68.h +++ b/include/overlay021/struct_ov21_021D5B68.h @@ -1,11 +1,11 @@ #ifndef POKEPLATINUM_STRUCT_OV21_021D5B68_H #define POKEPLATINUM_STRUCT_OV21_021D5B68_H -#include "overlay021/struct_pokedexstatus.h" +#include "overlay021/struct_ov21_021d3320.h" typedef struct { int *unk_00; - PokedexStatus *unk_04; + UnkStruct_ov21_021D3320 *unk_04; int unk_08; int unk_0C; int unk_10; diff --git a/include/overlay021/struct_ov21_021DE6D4.h b/include/overlay021/struct_ov21_021DE6D4.h index ed20b16c6c..19c47b4901 100644 --- a/include/overlay021/struct_ov21_021DE6D4.h +++ b/include/overlay021/struct_ov21_021DE6D4.h @@ -2,11 +2,11 @@ #define POKEPLATINUM_STRUCT_OV21_021DE6D4_H #include "overlay021/struct_ov21_021E68F4.h" -#include "overlay021/struct_pokedexstatus.h" +#include "overlay021/struct_ov21_021d3320.h" typedef struct { int *unk_00; - PokedexStatus *unk_04; + UnkStruct_ov21_021D3320 *unk_04; int unk_08; int unk_0C; const UnkStruct_ov21_021E68F4 *unk_10; diff --git a/platinum.us/main.lsf b/platinum.us/main.lsf index bf0e018dbd..0ec423dc31 100644 --- a/platinum.us/main.lsf +++ b/platinum.us/main.lsf @@ -786,7 +786,7 @@ Overlay overlay21 Object main.nef.p/src_overlay021_ov21_021D0D80.c.o Object main.nef.p/src_overlay021_ov21_021D1F90.c.o Object main.nef.p/src_overlay021_ov21_021D1FA4.c.o - Object main.nef.p/src_overlay021_ov21_021D3208.c.o + Object main.nef.p/src_overlay021_pokedexsort.c.o Object main.nef.p/src_overlay021_ov21_021D3FE0.c.o Object main.nef.p/src_overlay021_ov21_021D423C.c.o Object main.nef.p/src_overlay021_ov21_021D4340.c.o diff --git a/src/meson.build b/src/meson.build index 733f1b86ff..314e8c9e44 100644 --- a/src/meson.build +++ b/src/meson.build @@ -597,7 +597,7 @@ pokeplatinum_c = files( 'overlay021/ov21_021D0D80.c', 'overlay021/ov21_021D1F90.c', 'overlay021/ov21_021D1FA4.c', - 'overlay021/ov21_021D3208.c', + 'overlay021/pokedexsort.c', 'overlay021/ov21_021D3FE0.c', 'overlay021/ov21_021D423C.c', 'overlay021/ov21_021D4340.c', diff --git a/src/overlay021/ov21_021D0D80.c b/src/overlay021/ov21_021D0D80.c index d99e91bcf2..0f404c5831 100644 --- a/src/overlay021/ov21_021D0D80.c +++ b/src/overlay021/ov21_021D0D80.c @@ -7,6 +7,7 @@ #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" @@ -32,12 +33,12 @@ #include "overlay021/ov21_021E68F4.h" #include "overlay021/ov21_021E737C.h" #include "overlay021/ov21_021E8484.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedexsort.h" +#include "overlay021/speciesCaughtStatus.h" #include "overlay021/struct_ov21_021D0D80.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_021D3FE0_decl.h" #include "overlay021/struct_ov21_021D423C_decl.h" #include "overlay021/struct_ov21_021D4660.h" @@ -45,8 +46,7 @@ #include "overlay021/struct_ov21_021D4CA0.h" #include "overlay021/struct_ov21_021D4CB8.h" #include "overlay021/struct_ov21_021E68F4.h" -#include "overlay021/struct_pokedexstatus.h" -#include "overlay021/speciesCaughtStatus.h" +#include "overlay021/struct_ov21_021d3320.h" #include "overlay022/struct_ov22_022559F8.h" #include "bg_window.h" @@ -80,7 +80,7 @@ typedef struct UnkStruct_ov21_021D0F60_t { BOOL unk_00; int unk_04; UnkStruct_0209ACBC *unk_08; - PokedexStatus unk_0C; + UnkStruct_ov21_021D3320 unk_0C; UnkStruct_ov21_021D13FC unk_177C; int unk_1A60; int unk_1A64; @@ -327,7 +327,7 @@ UnkStruct_ov21_021D0F60 *ov21_021D0F60(int param0, const UnkStruct_ov21_021D0D80 v2.unk_1C = sub_0209ACE4(param1->unk_1C); v2.unk_20 = sub_0209ACEC(param1->unk_1C); - Pokedex_Sort_PopulatepokedexStatus(&v0->unk_0C, &v2, param0); + PokedexSort_PopulatepokedexStatus(&v0->unk_0C, &v2, param0); ov21_021D1FA4(&v0->unk_177C, param0); for (v1 = 0; v1 < 10; v1++) { @@ -511,7 +511,7 @@ BOOL *ov21_021D13DC(UnkStruct_ov21_021D0F60 *param0) return ¶m0->unk_00; } -PokedexStatus *ov21_021D13EC(UnkStruct_ov21_021D0F60 *param0) +UnkStruct_ov21_021D3320 *ov21_021D13EC(UnkStruct_ov21_021D0F60 *param0) { GF_ASSERT(param0); return ¶m0->unk_0C; @@ -673,11 +673,11 @@ void ov21_021D1650(Window *param0, int param1, int param2, int param3) ov21_021D5600(v1); } -Window *ov21_021D16D8(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3) +Window *ov21_021D16D8(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3) { 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); @@ -713,7 +713,7 @@ Window *ov21_021D172C(UnkStruct_ov21_021D4C0C *param0, int param1, int param2) return v0; } -void ov21_021D1778(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int dexIndex, fx32 param4, fx32 param5) +void ov21_021D1778(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int dexIndex, fx32 param4, fx32 param5) { CellActor *v0; CellActor *v1; @@ -722,9 +722,9 @@ void ov21_021D1778(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, SpriteResource *v4; VecFx32 v5; const SpeciesCaughtStatus *pokeCaughtStatus; - u32 v7 = ov21_021D36D8(param1); + u32 v7 = PokedexStatus_IsNationalDex(param1); - pokeCaughtStatus = Pokedex_Sort_SpeciesCaughtStatus(param1, dexIndex); + pokeCaughtStatus = PokedexSort_StatusIndexToCaughtStatus(param1, dexIndex); v0 = ov21_021D22A8(param0); v1 = ov21_021D22C4(param0); @@ -784,7 +784,7 @@ void ov21_021D1858(UnkStruct_ov21_021D22F8 *param0, int param1, int param2) } } -void ov21_021D1890(UnkStruct_ov21_021D13FC *param0, PokedexStatus *param1, int species, 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 (species) { case 201: @@ -820,7 +820,7 @@ void ov21_021D1890(UnkStruct_ov21_021D13FC *param0, PokedexStatus *param1, int s } } -u32 ov21_021D19D8(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3, int param4, int param5, int param6, int param7) +u32 ov21_021D19D8(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6, int param7) { int v0; u32 v1 = 0; @@ -838,11 +838,11 @@ u32 ov21_021D19D8(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, return v0; } -u32 ov21_021D1A34(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *dexStatus, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1A34(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6) { int v0; - v0 = ov21_021D335C(dexStatus, param5); + v0 = ov21_021D335C(param1, param5); if (v0 != -1) { ov21_021D2188(param0, 201, 2, param2, 0, v0, 0, param3, param4, param6); @@ -851,7 +851,7 @@ u32 ov21_021D1A34(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *dexStatu return v0; } -u32 ov21_021D1A78(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1A78(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6) { int v0; @@ -864,7 +864,7 @@ u32 ov21_021D1A78(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, return v0; } -u32 ov21_021D1AC0(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1AC0(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6) { int v0; @@ -877,7 +877,7 @@ u32 ov21_021D1AC0(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, return v0; } -u32 ov21_021D1B08(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1B08(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6) { int v0; @@ -890,7 +890,7 @@ u32 ov21_021D1B08(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, return v0; } -u32 ov21_021D1B4C(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1B4C(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6) { int v0; @@ -903,7 +903,7 @@ u32 ov21_021D1B4C(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, return v0; } -u32 ov21_021D1B94(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1B94(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6) { int v0; @@ -916,7 +916,7 @@ u32 ov21_021D1B94(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, return v0; } -u32 ov21_021D1BD8(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1BD8(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6) { int v0; int v1; @@ -933,7 +933,7 @@ u32 ov21_021D1BD8(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, return v0; } -u32 ov21_021D1C30(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1C30(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6) { int v0; int v1; @@ -950,7 +950,7 @@ u32 ov21_021D1C30(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, return v0; } -u32 ov21_021D1C88(UnkStruct_ov21_021D13FC *param0, const PokedexStatus *param1, int param2, int param3, int param4, int param5, int param6) +u32 ov21_021D1C88(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3, int param4, int param5, int param6) { int v0; int v1; @@ -1029,7 +1029,7 @@ static void ov21_021D1D08(UnkStruct_ov21_021D0F60 *param0) sub_0209ACF0(param0->unk_08, 2); } - Pokedex_Sort_PokedexStatusFreeHWData(¶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 a3ce4cab16..0000000000 --- a/src/overlay021/ov21_021D3208.c +++ /dev/null @@ -1,1006 +0,0 @@ -#include "overlay021/ov21_021D3208.h" - -#include -#include - -#include "struct_decls/pokedexdata_decl.h" - -#include "overlay021/struct_ov21_021D3208.h" -#include "overlay021/pokedexProgress.h" -#include "overlay021/struct_pokedexstatus.h" -#include "overlay021/speciesCaughtStatus.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" - -enum PokedexDataFileIndex { - PDFI_NATIONAL, - PDFI_SINNOH, - PDFI_ALPHABETICAL, - PDFI_HEAVIEST, - PDFI_LIGHTEST, - PDFI_TALLEST, - PDFI_SHORTEST, - PDFI_ABC, - PDFI_DEF, - PDFI_GHI, - PDFI_JKL, - PDFI_MNO, - PDFI_PQR, - PDFI_STU, - PDFI_VWX, - PDFI_YZ, - PDFI_NORMAL, - PDFI_FIGHTING, - PDFI_FLYING, - PDFI_POISON, - PDFI_GROUND, - PDFI_ROCK, - PDFI_BUG, - PDFI_GHOST, - PDFI_STEEL, - PDFI_FIRE, - PDFI_WATER, - PDFI_GRASS, - PDFI_ELECTRIC, - PDFI_PSYCHIC, - PDFI_ICE, - PDFI_DRAGON, - PDFI_DARK, - PDFI_QUADRUPED, - PDFI_BIPEDALTAILLESS, - PDFI_BIPEDALTAILED, - PDFI_SERPENTINE, - PDFI_MULTIWINGED, - PDFI_WINGED, - PDFI_INSECTOID, - PDFI_HEADBASE, - PDFI_HEADARMS, - PDFI_HEADLEGS, - PDFI_TENTACLES, - PDFI_FINS, - PDFI_HEAD, - PDFI_MULTIBODY -}; - -static void Pokedex_Sort_Encountered(u16 *pokedexPreFilterArray, int *numEncountered, const PokedexData *dexData, const u16 *speciesArray, int pokedexLength); -static void Pokedex_Sort_Caught(u16 *param0, int *param1, const u16 *param2, int param3, const u16 *param4, int param5, BOOL param6, const PokedexData *dexData); -static void Pokedex_Sort_CaughtStatus(PokedexProgress *pokedexCompletion, const PokedexData *param1, const u16 *param2, int param3); -static void Pokedex_Sort_IndentifyEnountered_Full(PokedexProgress *pokedexCompletion, const u16 *param1, int param2); -static void Pokedex_Sort_IndentifyEnountered_Filtered(PokedexProgress *pokedexCompletion); -static void Pokedex_Sort_NumSeenNCaught(PokedexProgress *pokedexCompletion, int *numEncountered, int *numCaught); -static u16 *Pokedex_Sort_SortedArray(int heapID, int pokedexSort, int *pokedexLength); -static void Pokedex_Sort_Order(int sortCategory, u16 *pokedexPostFilterArray, int *dexLengthPostFilter, const u16 *param3, int dexLengthPreFilter, int heapID, const PokedexData *dexData); -static void Pokedex_Sort_FilterFirstLetter(int firstLetterFilter, u16 *pokedexPostFilterArray, int *dexLengthPostFilter, const u16 *pokedexPreFilterArray, int numEncountered, int heapID, const PokedexData *dexData); -static void Pokedex_Sort_FilterType(int typeFilter, u16 *param1, int *param2, const u16 *param3, int dexLengthPreFilter, int heapID, const PokedexData *dexData); -static void Pokedex_Sort_FilterBodyShape(int bodyShapeFilter, u16 *param1, int *param2, const u16 *param3, int dexLengthPreFilter, int heapID, const PokedexData *dexData); - -void Pokedex_Sort_PopulatepokedexStatus(PokedexStatus *dexStatus, UnkStruct_ov21_021D3208 *param1, int heapID) -{ - int sortCategory; - int firstLetterFilter; - int typeFilter1; - int typeFilter2; - int bodyShapeFilter; - BOOL dexExists; - u32 isNationalDex; - - memset(dexStatus, 0, sizeof(PokedexStatus)); - - dexStatus->dexData = param1->dexData; - dexStatus->timeOfDay = param1->timeOfDay; - - if (Pokedex_IsNationalUnlocked(dexStatus->dexData)) { - dexStatus->isNationalDexUnlocked = 1; - } else { - dexStatus->isNationalDexUnlocked = 0; - } - - if (param1->unk_20 == 2) { - if (dexStatus->isNationalDexUnlocked) { - isNationalDex = 1; - } else { - isNationalDex = 0; - } - } else { - isNationalDex = param1->unk_20; - } - - if (isNationalDex == 1) { - dexStatus->isNationalDex = 1; - sortCategory = 0; - firstLetterFilter = 0; - typeFilter1 = 0; - typeFilter2 = 0; - bodyShapeFilter = 0; - } else { - dexStatus->isNationalDex = 0; - sortCategory = 0; - firstLetterFilter = 0; - typeFilter1 = 0; - typeFilter2 = 0; - bodyShapeFilter = 0; - } - - dexExists = Pokedex_Sort_Unfiltered(dexStatus, sortCategory, firstLetterFilter, typeFilter1, typeFilter2, bodyShapeFilter, dexStatus->isNationalDex, heapID); - - GF_ASSERT(dexExists); - - ov21_021D3794(dexStatus, param1->unk_1C); - ov21_021D3434(dexStatus, param1->unk_1C); - ov21_021D344C(dexStatus, param1->unk_20); - - dexStatus->trainerGameCode = TrainerInfo_GameCode(param1->unk_04); - dexStatus->trainerGender = TrainerInfo_Gender(param1->unk_04); - dexStatus->trainerName = TrainerInfo_NameNewStrbuf(param1->unk_04, heapID); - dexStatus->HWData = Pokedex_HeightWeightData(heapID); - - if (dexStatus->trainerGender == 0) { - Pokedex_HeightWeightData_Load(dexStatus->HWData, 0, heapID); - } else { - Pokedex_HeightWeightData_Load(dexStatus->HWData, 1, heapID); - } - - dexStatus->fullmoonIslandVisible = param1->fullmoonIslandVisible; - dexStatus->newmoonIslandVisible = param1->newmoonIslandVisible; - dexStatus->springPathVisible = param1->springPathVisible; - dexStatus->seabreakPathVisible = param1->seabreakPathVisible; -} - -void Pokedex_Sort_PokedexStatusFreeHWData(PokedexStatus *dexStatus) -{ - Strbuf_Free(dexStatus->trainerName); - Pokedex_HeightWeightData_Release(dexStatus->HWData); - Pokedex_HeightWeightData_Free(dexStatus->HWData); - - dexStatus->HWData = NULL; -} - -u32 ov21_021D334C(const PokedexStatus *dexStatus, int param1, int param2) -{ - u32 v0; - - v0 = sub_02027058(dexStatus->dexData, param1, param2); - return v0; -} - -u32 ov21_021D335C(const PokedexStatus *dexStatus, int param1) -{ - int v0; - - GF_ASSERT(param1 < 28); - v0 = sub_020270AC(dexStatus->dexData, param1); - - return v0; -} - -u32 ov21_021D3374(const PokedexStatus *dexStatus, int param1) -{ - u32 v0; - - GF_ASSERT(param1 < 2); - v0 = sub_020270F8(dexStatus->dexData, param1); - - return v0; -} - -u32 ov21_021D338C(const PokedexStatus *dexStatus, int param1) -{ - u32 v0; - - GF_ASSERT(param1 < 2); - - v0 = sub_02027154(dexStatus->dexData, param1); - return v0; -} - -u32 ov21_021D33A4(const PokedexStatus *dexStatus, int param1) -{ - u32 v0; - - GF_ASSERT(param1 < 3); - - v0 = sub_020271B0(dexStatus->dexData, param1); - return v0; -} - -u32 ov21_021D33BC(const PokedexStatus *dexStatus, int param1) -{ - u32 v0; - - GF_ASSERT(param1 < 3); - - v0 = sub_02027208(dexStatus->dexData, param1); - return v0; -} - -u32 ov21_021D33D4(const PokedexStatus *dexStatus, u32 species) -{ - return sub_0202756C(dexStatus->dexData, species, 0); -} - -u32 ov21_021D33E0(const PokedexStatus *dexStatus, int param1) -{ - int v0 = ov21_021D334C(dexStatus, param1, 1); - - if (v0 == -1) { - return 1; - } - - return 2; -} - -u32 ov21_021D33F8(const PokedexStatus *dexStatus) -{ - return sub_0202702C(dexStatus->dexData, 0); -} - -u32 ov21_021D3404(const PokedexStatus *dexStatus, int param1) -{ - return sub_02027264(dexStatus->dexData, param1); -} - -u32 ov21_021D3410(const PokedexStatus *dexStatus, u32 param1, int param2) -{ - return sub_0202756C(dexStatus->dexData, param1, param2); -} - -u32 ov21_021D341C(const PokedexStatus *dexStatus, u32 param1) -{ - return sub_020276C8(dexStatus->dexData, param1); -} - -BOOL Pokedex_Sort_PokedexUnlocked(const PokedexStatus *dexStatus) -{ - return Pokedex_IsNationalUnlocked(dexStatus->dexData); -} - -void ov21_021D3434(PokedexStatus *dexStatus, u32 param1) -{ - dexStatus->unk_175C = param1; -} - -u32 ov21_021D3440(const PokedexStatus *dexStatus) -{ - return dexStatus->unk_175C; -} - -void ov21_021D344C(PokedexStatus *dexStatus, u32 param1) -{ - dexStatus->unk_175E = param1; -} - -u32 ov21_021D3458(const PokedexStatus *dexStatus) -{ - return dexStatus->unk_175E; -} - -BOOL Pokedex_Sort(PokedexStatus *dexStatus, int sortCategory, int firstLetterFilter, int typeFilter1, int typeFilter2, int bodyShapeFilter, int isNationalDex, int heapID, BOOL isFiltered) -{ - u16 *pokedexPreFilterArray; - int dexLengthPreFilter; - u16 *pokedexPostFilterArray; - int dexLengthPostFilter; - u16 *pokedexArray; - int pokedexLength; - BOOL dexExists; - - pokedexPreFilterArray = Heap_AllocFromHeapAtEnd(heapID, sizeof(u16) * NATIONAL_DEX_COUNT); - - GF_ASSERT(pokedexPreFilterArray); - memset(pokedexPreFilterArray, 0, sizeof(u16) * NATIONAL_DEX_COUNT); - - dexLengthPreFilter = 0; - pokedexPostFilterArray = Heap_AllocFromHeapAtEnd(heapID, sizeof(u16) * NATIONAL_DEX_COUNT); - - GF_ASSERT(pokedexPostFilterArray); - memset(pokedexPostFilterArray, 0, sizeof(u16) * NATIONAL_DEX_COUNT); - - dexLengthPostFilter = 0; - - if (isNationalDex == 0) { - pokedexArray = Pokedex_Sort_SortedArray(heapID, 1, &pokedexLength); - Pokedex_Sort_Encountered(pokedexPreFilterArray, &dexLengthPreFilter, dexStatus->dexData, pokedexArray, pokedexLength); - } else { - pokedexArray = Pokedex_Sort_SortedArray(heapID, 0, &pokedexLength); - Pokedex_Sort_Encountered(pokedexPreFilterArray, &dexLengthPreFilter, dexStatus->dexData, pokedexArray, pokedexLength); - } - - Pokedex_Sort_Order(sortCategory, pokedexPostFilterArray, &dexLengthPostFilter, pokedexPreFilterArray, dexLengthPreFilter, heapID, dexStatus->dexData); - - memcpy(pokedexPreFilterArray, pokedexPostFilterArray, sizeof(u16) * dexLengthPostFilter); - dexLengthPreFilter = dexLengthPostFilter; - - memset(pokedexPostFilterArray, 0, sizeof(u16) * dexLengthPostFilter); - dexLengthPostFilter = 0; - - do { - Pokedex_Sort_FilterFirstLetter(firstLetterFilter, pokedexPostFilterArray, &dexLengthPostFilter, pokedexPreFilterArray, dexLengthPreFilter, heapID, dexStatus->dexData); - - if (dexLengthPostFilter == 0) { - dexExists = 0; - break; - } - - memcpy(pokedexPreFilterArray, pokedexPostFilterArray, sizeof(u16) * dexLengthPostFilter); - dexLengthPreFilter = dexLengthPostFilter; - - memset(pokedexPostFilterArray, 0, sizeof(u16) * dexLengthPostFilter); - dexLengthPostFilter = 0; - - Pokedex_Sort_FilterType(typeFilter1, pokedexPostFilterArray, &dexLengthPostFilter, pokedexPreFilterArray, dexLengthPreFilter, heapID, dexStatus->dexData); - - if (dexLengthPostFilter == 0) { - dexExists = 0; - break; - } - - memcpy(pokedexPreFilterArray, pokedexPostFilterArray, sizeof(u16) * dexLengthPostFilter); - dexLengthPreFilter = dexLengthPostFilter; - - memset(pokedexPostFilterArray, 0, sizeof(u16) * dexLengthPostFilter); - dexLengthPostFilter = 0; - - Pokedex_Sort_FilterType(typeFilter2, pokedexPostFilterArray, &dexLengthPostFilter, pokedexPreFilterArray, dexLengthPreFilter, heapID, dexStatus->dexData); - - if (dexLengthPostFilter == 0) { - dexExists = 0; - break; - } - - memcpy(pokedexPreFilterArray, pokedexPostFilterArray, sizeof(u16) * dexLengthPostFilter); - dexLengthPreFilter = dexLengthPostFilter; - - memset(pokedexPostFilterArray, 0, sizeof(u16) * dexLengthPostFilter); - dexLengthPostFilter = 0; - - Pokedex_Sort_FilterBodyShape(bodyShapeFilter, pokedexPostFilterArray, &dexLengthPostFilter, pokedexPreFilterArray, dexLengthPreFilter, heapID, dexStatus->dexData); - - if (dexLengthPostFilter == 0) { - dexExists = 0; - break; - } - - memcpy(pokedexPreFilterArray, pokedexPostFilterArray, sizeof(u16) * dexLengthPostFilter); - dexLengthPreFilter = dexLengthPostFilter; - - memset(pokedexPostFilterArray, 0, sizeof(u16) * dexLengthPostFilter); - dexLengthPostFilter = 0; - - Pokedex_Sort_CaughtStatus(&dexStatus->pokedexCompletion, dexStatus->dexData, pokedexPreFilterArray, dexLengthPreFilter); - - if ((sortCategory != 0) || (firstLetterFilter != 0) || (typeFilter1 != 0) || (typeFilter2 != 0) || (bodyShapeFilter != 0)) { - isFiltered = 1; - } - - if (isFiltered == 0) { - Pokedex_Sort_IndentifyEnountered_Full(&dexStatus->pokedexCompletion, pokedexArray, pokedexLength); - } else { - Pokedex_Sort_IndentifyEnountered_Filtered(&dexStatus->pokedexCompletion); - } - - dexExists = 1; - } while (0); - - Pokedex_Sort_NumSeenNCaught(&dexStatus->pokedexCompletion, &dexStatus->numEncountered, &dexStatus->numCaught); - - Heap_FreeToHeap(pokedexPreFilterArray); - Heap_FreeToHeap(pokedexPostFilterArray); - Heap_FreeToHeap(pokedexArray); - - return dexExists; -} - -BOOL Pokedex_Sort_Unfiltered(PokedexStatus *dexStatus, int sortCategory, int firstLetterFilter, int typeFilter1, int typeFilter2, int bodyShapeFilter, int isNationalDex, int heapID) -{ - return Pokedex_Sort(dexStatus, sortCategory, firstLetterFilter, typeFilter1, typeFilter2, bodyShapeFilter, isNationalDex, heapID, 0); -} - -BOOL ov21_021D36A4(const PokedexStatus *dexStatus, int param1) -{ - if (param1 == 0) { - return 1; - } - - if (dexStatus->isNationalDexUnlocked) { - return 1; - } - - return 0; -} - -BOOL ov21_021D36C0(PokedexStatus *dexStatus, int param1) -{ - BOOL v0; - - v0 = ov21_021D36A4(dexStatus, param1); - - if (v0) { - dexStatus->isNationalDex = param1; - } - - return v0; -} - -int ov21_021D36D8(const PokedexStatus *dexStatus) -{ - return dexStatus->isNationalDex; -} - -BOOL Pokedex_Sort_IsValidDexIndex(const PokedexStatus *dexStatus, int dexIndex) -{ - if (((dexIndex) >= 0) && ((dexIndex) < dexStatus->pokedexCompletion.numEncountered)) { - return 1; - } - - return 0; -} - -BOOL ov21_021D36FC(PokedexStatus *dexStatus, int dexIndex) -{ - if (Pokedex_Sort_IsValidDexIndex(dexStatus, dexIndex)) { - dexStatus->pokedexCompletion.unk_F68 = dexIndex; - return 1; - } - - return 0; -} - -BOOL ov21_021D371C(PokedexStatus *dexStatus, int param1) -{ - if (Pokedex_Sort_IsValidDexIndex(dexStatus, dexStatus->pokedexCompletion.unk_F68 + param1)) { - dexStatus->pokedexCompletion.unk_F68 += param1; - return 1; - } - - if (param1 >= 0) { - dexStatus->pokedexCompletion.unk_F68 = dexStatus->pokedexCompletion.numEncountered - 1; - } else { - dexStatus->pokedexCompletion.unk_F68 = 0; - } - - return 0; -} - -int ov21_021D375C(const PokedexStatus *dexStatus) -{ - return dexStatus->pokedexCompletion.unk_F68; -} - -int Pokedex_Sort_CompletionNumEncountered(const PokedexStatus *dexStatus) -{ - return dexStatus->pokedexCompletion.numEncountered; -} - -int ov21_021D3770(const PokedexStatus *dexStatus, u32 param1) -{ - int index; - int numEncountered = Pokedex_Sort_CompletionNumEncountered(dexStatus); - int species; - - for (index = 0; index < numEncountered; index++) { - species = dexStatus->pokedexCompletion.caughtStatusArray[index].species; - - if (species == param1) { - break; - } - } - - return index; -} - -BOOL ov21_021D3794(PokedexStatus *dexStatus, int param1) -{ - u32 v0 = Pokedex_Sort_CompletionNumEncountered(dexStatus); - u32 v1 = ov21_021D3770(dexStatus, param1); - - if (v0 > v1) { - return ov21_021D36FC(dexStatus, v1); - } - - return 0; -} - -int Pokedex_Sort_CurrentSpecies(const PokedexStatus *dexStatus) -{ - return dexStatus->pokedexCompletion.caughtStatusArray[dexStatus->pokedexCompletion.unk_F68].species; -} - -int Pokedex_Sort_CurrentCaughtStatus(const PokedexStatus *dexStatus) -{ - return dexStatus->pokedexCompletion.caughtStatusArray[dexStatus->pokedexCompletion.unk_F68].caughtStatus; -} - -const SpeciesCaughtStatus *Pokedex_Sort_SpeciesCaughtStatus(const PokedexStatus *dexStatus, int dexIndex) -{ - if (Pokedex_Sort_IsValidDexIndex(dexStatus, dexIndex)) { - return &dexStatus->pokedexCompletion.caughtStatusArray[dexIndex]; - } - - return NULL; -} - -BOOL ov21_021D37F8(const PokedexStatus *dexStatus, int param1) -{ - if ((dexStatus->pokedexCompletion.numSpecies > param1) && (param1 >= 0)) { - return 1; - } - - return 0; -} - -BOOL ov21_021D3810(PokedexStatus *dexStatus, int param1) -{ - if (ov21_021D37F8(dexStatus, param1)) { - dexStatus->pokedexCompletion.unk_1724 = param1; - - ov21_021D36FC(dexStatus, dexStatus->pokedexCompletion.encounteredIndexArray[dexStatus->pokedexCompletion.unk_1724]); - return 1; - } - - return 0; -} - -BOOL ov21_021D3844(PokedexStatus *dexStatus, int param1) -{ - if (ov21_021D387C(dexStatus, param1)) { - dexStatus->pokedexCompletion.unk_1724 += param1; - - ov21_021D36FC(dexStatus, dexStatus->pokedexCompletion.encounteredIndexArray[dexStatus->pokedexCompletion.unk_1724]); - return 1; - } - - return 0; -} - -BOOL ov21_021D387C(PokedexStatus *dexStatus, int param1) -{ - if (ov21_021D37F8(dexStatus, dexStatus->pokedexCompletion.unk_1724 + param1)) { - return 1; - } - - return 0; -} - -int ov21_021D3898(const PokedexStatus *dexStatus) -{ - return dexStatus->pokedexCompletion.unk_1724; -} - -int ov21_021D38A4(const PokedexStatus *dexStatus) -{ - return dexStatus->pokedexCompletion.numSpecies; -} - -int Pokedex_Sort_SeenIndexToSpecies(const PokedexStatus *dexStatus, int encounteredIndex) -{ - return dexStatus->pokedexCompletion.encounteredIndexArray[encounteredIndex]; -} - -void ov21_021D38C0(PokedexStatus *dexStatus) -{ - int v0; - - for (v0 = 0; v0 < dexStatus->pokedexCompletion.numSpecies; v0++) { - if (Pokedex_Sort_SeenIndexToSpecies(dexStatus, v0) == ov21_021D375C(dexStatus)) { - ov21_021D3810(dexStatus, v0); - break; - } - } -} - -int Pokedex_Sort_NumEncountered(const PokedexStatus *dexStatus) -{ - return dexStatus->numEncountered; -} - -int Pokedex_Sort_NumCaught(const PokedexStatus *dexStatus) -{ - return dexStatus->numCaught; -} - -Strbuf *Pokedex_Sort_TrainerName(const PokedexStatus *dexStatus) -{ - return dexStatus->trainerName; -} - -u32 Pokedex_Sort_TrainerGender(const PokedexStatus *dexStatus) -{ - return dexStatus->trainerGender; -} - -BOOL ov21_021D392C(const PokedexStatus *dexStatus, int param1) -{ - int species = Pokedex_Sort_CurrentSpecies(dexStatus); - - if (sub_02027514(dexStatus->dexData) == 0) { - return 0; - } - - return sub_020274D0(dexStatus->dexData, species, param1); -} - -BOOL Pokedex_Sort_CanDetectForms(const PokedexStatus *dexStatus) -{ - return Pokedex_CanDetectForms(dexStatus->dexData); -} - -void ov21_021D3960(PokedexStatus *dexStatus) -{ - if (gCoreSys.touchHeld) { - dexStatus->unk_1758 = 0; - return; - } - - if (gCoreSys.pressedKeys) { - if (dexStatus->unk_1758 == 0) { - dexStatus->unk_1758 = 1; - } else { - dexStatus->unk_1758 = 2; - } - } -} - -u32 ov21_021D3998(const PokedexStatus *dexStatus) -{ - return dexStatus->unk_1758; -} - -static void Pokedex_Sort_Encountered(u16 *pokedexPreFilterArray, int *numEncountered, const PokedexData *dexData, const u16 *speciesArray, int pokedexLength) -{ - int index; - - *numEncountered = 0; - - for (index = 0; index < pokedexLength; index++) { - if (Pokedex_HasEncountered(dexData, speciesArray[index])) { - pokedexPreFilterArray[*numEncountered] = speciesArray[index]; - (*numEncountered)++; - } - } -} - -static void Pokedex_Sort_Caught(u16 *param0, int *param1, const u16 *speciesArray, int param3, const u16 *param4, int param5, BOOL param6, const PokedexData *dexData) -{ - int v0, v1; - - *param1 = 0; - - for (v0 = 0; v0 < param3; v0++) { - for (v1 = 0; v1 < param5; v1++) { - if (speciesArray[v0] == param4[v1]) { - if (param6 == 1) { - break; - } else { - if (Pokedex_HasCaught(dexData, speciesArray[v0])) { - break; - } - } - } - } - - if (v1 < param5) { - param0[*param1] = speciesArray[v0]; - (*param1)++; - } - } -} - -static void Pokedex_Sort_CaughtStatus(PokedexProgress *pokedexCompletion, const PokedexData *dexData, const u16 *speciesArray, int numEncountered) -{ - int index; - - pokedexCompletion->numEncountered = 0; - - for (index = 0; index < numEncountered; index++) { - if (Pokedex_HasCaught(dexData, speciesArray[index])) { - pokedexCompletion->caughtStatusArray[pokedexCompletion->numEncountered].caughtStatus = CS_CAUGHT; - } else { - pokedexCompletion->caughtStatusArray[pokedexCompletion->numEncountered].caughtStatus = CS_ENCOUNTERED; - } - - pokedexCompletion->caughtStatusArray[pokedexCompletion->numEncountered].species = speciesArray[index]; - pokedexCompletion->numEncountered++; - } -} - -static void Pokedex_Sort_IndentifyEnountered_Full(PokedexProgress *pokedexCompletion, const u16 *speciesArray, int pokedexLength) -{ - int dexIndex; - int encounteredIndex; - - encounteredIndex = 0; - pokedexCompletion->numSpecies = 0; - - for (dexIndex = 0; dexIndex < pokedexLength; dexIndex++) { - if (encounteredIndex < pokedexCompletion->numEncountered) { - if (pokedexCompletion->caughtStatusArray[encounteredIndex].species == speciesArray[dexIndex]) { - pokedexCompletion->encounteredIndexArray[pokedexCompletion->numSpecies] = encounteredIndex; - encounteredIndex++; - pokedexCompletion->numSpecies++; - } else { - pokedexCompletion->encounteredIndexArray[pokedexCompletion->numSpecies] = (NATIONAL_DEX_COUNT + 1); - pokedexCompletion->numSpecies++; - } - } - } -} - -static void Pokedex_Sort_IndentifyEnountered_Filtered(PokedexProgress *pokedexCompletion) -{ - int encounteredIndex; - - pokedexCompletion->numSpecies = 0; - - for (encounteredIndex = 0; encounteredIndex < pokedexCompletion->numEncountered; encounteredIndex++) { - pokedexCompletion->encounteredIndexArray[pokedexCompletion->numSpecies] = encounteredIndex; - pokedexCompletion->numSpecies++; - } -} - -static u16 *Pokedex_Sort_SortedArray(int heapID, int pokedexSort, int *pokedexLength) -{ - u32 pokedexSize; - u16 *pokedexSortedArray; - u32 pokedexDataNarcIndex; - - GF_ASSERT(47 > pokedexSort); - - pokedexDataNarcIndex = Pokedex_Data_NARC_Index(); - pokedexSortedArray = LoadMemberFromNARC_OutFileSize(pokedexDataNarcIndex, 11 + pokedexSort, 0, heapID, 0, &pokedexSize); - *pokedexLength = pokedexSize / (sizeof(u16)); - - return pokedexSortedArray; -} - -static void Pokedex_Sort_Order(int sortCategory, u16 *pokedexPostFilterArray, int *dexLengthPostFilter, const u16 *pokedexPreFilterArray, int dexLengthPreFilter, int heapID, const PokedexData *dexData) -{ - u16 *pokedexSortedArray; - int pokedexLength; - BOOL isAlphabetical = 0; - - switch (sortCategory) { - case SC_NUMERIC: - pokedexSortedArray = NULL; - break; - case SC_ALPHABETICAL: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_ALPHABETICAL, &pokedexLength); - isAlphabetical = 1; - break; - case SC_HEAVIEST: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_HEAVIEST, &pokedexLength); - break; - case SC_LIGHTEST: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_LIGHTEST, &pokedexLength); - break; - case SC_TALLEST: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_TALLEST, &pokedexLength); - break; - case SC_SHORTEST: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_SHORTEST, &pokedexLength); - break; - default: - GF_ASSERT(0); - break; - } - - if (pokedexSortedArray != NULL) { - Pokedex_Sort_Caught(pokedexPostFilterArray, dexLengthPostFilter, pokedexSortedArray, pokedexLength, pokedexPreFilterArray, dexLengthPreFilter, isAlphabetical, dexData); - Heap_FreeToHeap(pokedexSortedArray); - } else { - memcpy(pokedexPostFilterArray, pokedexPreFilterArray, (sizeof(u16)) * dexLengthPreFilter); - *dexLengthPostFilter = dexLengthPreFilter; - } -} - -static void Pokedex_Sort_FilterFirstLetter(int firstLetterFilter, u16 *pokedexPostFilterArray, int *dexLengthPostFilter, const u16 *pokedexPreFilterArray, int dexLengthPreFilter, int heapID, const PokedexData *dexData) -{ - u16 *pokedexSortedArray; - int pokedexLength; - - switch (firstLetterFilter) { - case FFL_NONE: - pokedexSortedArray = NULL; - break; - case FFL_ABC: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_ABC, &pokedexLength); - break; - case FFL_DEF: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_DEF, &pokedexLength); - break; - case FFL_GHI: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_GHI, &pokedexLength); - break; - case FFL_JKL: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_JKL, &pokedexLength); - break; - case FFL_MNO: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_MNO, &pokedexLength); - break; - case FFL_PQR: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_PQR, &pokedexLength); - break; - case FFL_STU: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_STU, &pokedexLength); - break; - case FFL_VWX: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_VWX, &pokedexLength); - break; - case FFL_YZ: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_YZ, &pokedexLength); - break; - default: - GF_ASSERT(0); - break; - } - - if (pokedexSortedArray != NULL) { - Pokedex_Sort_Caught(pokedexPostFilterArray, dexLengthPostFilter, pokedexPreFilterArray, dexLengthPreFilter, pokedexSortedArray, pokedexLength, 1, dexData); - Heap_FreeToHeap(pokedexSortedArray); - } else { - memcpy(pokedexPostFilterArray, pokedexPreFilterArray, (sizeof(u16)) * dexLengthPreFilter); - *dexLengthPostFilter = dexLengthPreFilter; - } -} - -static void Pokedex_Sort_FilterType(int typeFilter, u16 *param1, int *param2, const u16 *param3, int dexLengthPreFilter, int heapID, const PokedexData *dexData) -{ - u16 *pokedexSortedArray; - int pokedexLength; - - switch (typeFilter) { - case FT_NONE: - pokedexSortedArray = NULL; - break; - case FT_NORMAL: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_NORMAL, &pokedexLength); - break; - case FT_FIGHTING: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_FIGHTING, &pokedexLength); - break; - case FT_FLYING: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_FLYING, &pokedexLength); - break; - case FT_POISON: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_POISON, &pokedexLength); - break; - case FT_GROUND: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_GROUND, &pokedexLength); - break; - case FT_ROCK: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_ROCK, &pokedexLength); - break; - case FT_BUG: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_BUG, &pokedexLength); - break; - case FT_GHOST: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_GHOST, &pokedexLength); - break; - case FT_STEEL: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_STEEL, &pokedexLength); - break; - case FT_FIRE: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_FIRE, &pokedexLength); - break; - case FT_WATER: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_WATER, &pokedexLength); - break; - case FT_GRASS: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_GRASS, &pokedexLength); - break; - case FT_ELECTRIC: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_ELECTRIC, &pokedexLength); - break; - case FT_PSYCHIC: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_PSYCHIC, &pokedexLength); - break; - case FT_ICE: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_ICE, &pokedexLength); - break; - case FT_DRAGON: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_DRAGON, &pokedexLength); - break; - case FT_DARK: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_DARK, &pokedexLength); - break; - default: - GF_ASSERT(0); - break; - } - - if (pokedexSortedArray != NULL) { - Pokedex_Sort_Caught(param1, param2, param3, dexLengthPreFilter, pokedexSortedArray, pokedexLength, 0, dexData); - Heap_FreeToHeap(pokedexSortedArray); - } else { - memcpy(param1, param3, (sizeof(u16)) * dexLengthPreFilter); - *param2 = dexLengthPreFilter; - } -} - -static void Pokedex_Sort_FilterBodyShape(int bodyShapeFilter, u16 *param1, int *param2, const u16 *param3, int dexLengthPreFilter, int heapID, const PokedexData *dexData) -{ - u16 *pokedexSortedArray; - int pokedexLength; - - switch (bodyShapeFilter) { - case FBS_NONE: - pokedexSortedArray = NULL; - break; - case FBS_QUADRUPED: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_QUADRUPED, &pokedexLength); - break; - case FBS_BIPEDALTAILLESS: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_BIPEDALTAILLESS, &pokedexLength); - break; - case FBS_BIPEDALTAILED: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_BIPEDALTAILED, &pokedexLength); - break; - case FBS_SERPENTINE: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_SERPENTINE, &pokedexLength); - break; - case FBS_MULTIWINGED: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_MULTIWINGED, &pokedexLength); - break; - case FBS_WINGED: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_WINGED, &pokedexLength); - break; - case FBS_INSECTOID: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_INSECTOID, &pokedexLength); - break; - case FBS_HEADBASE: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_HEADBASE, &pokedexLength); - break; - case FBS_HEADARMS: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_HEADARMS, &pokedexLength); - break; - case FBS_HEADLEGS: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_HEADLEGS, &pokedexLength); - break; - case FBS_TENTACLES: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_TENTACLES, &pokedexLength); - break; - case FBS_FINS: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_FINS, &pokedexLength); - break; - case FBS_HEAD: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_HEAD, &pokedexLength); - break; - case FBS_MULTIBODY: - pokedexSortedArray = Pokedex_Sort_SortedArray(heapID, PDFI_MULTIBODY, &pokedexLength); - break; - default: - GF_ASSERT(0); - break; - } - - if (pokedexSortedArray != NULL) { - Pokedex_Sort_Caught(param1, param2, param3, dexLengthPreFilter, pokedexSortedArray, pokedexLength, 1, dexData); - Heap_FreeToHeap(pokedexSortedArray); - } else { - memcpy(param1, param3, (sizeof(u16)) * dexLengthPreFilter); - *param2 = dexLengthPreFilter; - } -} - -static void Pokedex_Sort_NumSeenNCaught(PokedexProgress *pokedexCompletion, int *numEncountered, int *numCaught) -{ - int index; - - *numEncountered = 0; - *numCaught = 0; - - for (index = 0; index < pokedexCompletion->numEncountered; index++) { - if (pokedexCompletion->caughtStatusArray[index].caughtStatus == CS_CAUGHT) { - (*numCaught)++; - } - - (*numEncountered)++; - } -} diff --git a/src/overlay021/ov21_021D5AEC.c b/src/overlay021/ov21_021D5AEC.c index b75d5e12ff..875a4c373a 100644 --- a/src/overlay021/ov21_021D5AEC.c +++ b/src/overlay021/ov21_021D5AEC.c @@ -9,7 +9,8 @@ #include "overlay021/ov21_021D1FA4.h" #include "overlay021/ov21_021D4340.h" #include "overlay021/ov21_021D4C0C.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedexsort.h" +#include "overlay021/speciesCaughtStatus.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D157C.h" @@ -21,7 +22,6 @@ #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" -#include "overlay021/speciesCaughtStatus.h" #include "bg_window.h" #include "cell_actor.h" @@ -305,7 +305,7 @@ static int ov21_021D5CB8(UnkStruct_ov21_021E6A68 *param0, void *param1) 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; @@ -412,7 +412,7 @@ 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; @@ -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 (Pokedex_Sort_SeenIndexToSpecies(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, Pokedex_Sort_NumEncountered(param2->unk_04), Pokedex_Sort_NumCaught(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, Pokedex_Sort_NumEncountered(param2->unk_04)); + ov21_021D64B0(param1, param3, PokedexSort_NumEncountered(param2->unk_04)); ov21_021D6994(param0, param2); ov21_021D69A0(param0, param2); ov21_021D6AE4(param0, param2); @@ -883,9 +883,9 @@ static void ov21_021D67EC(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13 v4.unk_20 = NNS_G2D_VRAM_TYPE_2DMAIN; 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,10 +894,10 @@ static void ov21_021D67EC(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13 } if ((v1 >= 0) && (v1 < v3)) { - dexIndex = Pokedex_Sort_SeenIndexToSpecies(param2->unk_04, v1); + dexIndex = PokedexSort_DisplayIndexToStatusIndex(param2->unk_04, v1); if (dexIndex != (NATIONAL_DEX_COUNT + 1)) { - pokeCaughtStatus = Pokedex_Sort_SpeciesCaughtStatus(param2->unk_04, dexIndex); + 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); @@ -920,11 +920,11 @@ static void ov21_021D68C8(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13 int v1; const SpeciesCaughtStatus *pokeCaughtStatus; - v1 = ov21_021D3898(param2->unk_04); - dexIndex = ov21_021D375C(param2->unk_04); - pokeCaughtStatus = Pokedex_Sort_SpeciesCaughtStatus(param2->unk_04, dexIndex); + v1 = PokedexSort_CurrentDisplayIndex(param2->unk_04); + dexIndex = PokedexSort_CurrentStatusIndex(param2->unk_04); + pokeCaughtStatus = PokedexSort_StatusIndexToCaughtStatus(param2->unk_04, dexIndex); - if (Pokedex_Sort_SeenIndexToSpecies(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) { @@ -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) { @@ -1089,8 +1089,8 @@ static void ov21_021D6AE4(UnkStruct_ov21_021D71A8 *param0, const UnkStruct_ov21_ int v10; 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; @@ -1099,10 +1099,10 @@ static void ov21_021D6AE4(UnkStruct_ov21_021D71A8 *param0, const UnkStruct_ov21_ v5 = ((v6 - 4) + v2); if ((v5 >= 0) && (v5 < v7)) { - dexIndex = Pokedex_Sort_SeenIndexToSpecies(param1->unk_04, v5); + dexIndex = PokedexSort_DisplayIndexToStatusIndex(param1->unk_04, v5); if (dexIndex != (NATIONAL_DEX_COUNT + 1)) { - pokeCaughtStatus = Pokedex_Sort_SpeciesCaughtStatus(param1->unk_04, dexIndex); + pokeCaughtStatus = PokedexSort_StatusIndexToCaughtStatus(param1->unk_04, dexIndex); if (pokeCaughtStatus->caughtStatus == CS_CAUGHT) { isCaught = 1; @@ -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 = Pokedex_Sort_SeenIndexToSpecies(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); @@ -1257,7 +1257,7 @@ static void ov21_021D6D78(UnkStruct_ov21_021D71A8 *param0, UnkStruct_ov21_021D13 Window *v1; const SpeciesCaughtStatus *pokeCaughtStatus; - pokeCaughtStatus = Pokedex_Sort_SpeciesCaughtStatus(param2->unk_04, dexIndex); + pokeCaughtStatus = PokedexSort_StatusIndexToCaughtStatus(param2->unk_04, dexIndex); GF_ASSERT(pokeCaughtStatus); v0.unk_00 = param1->unk_14C; @@ -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); - Pokedex_Sort_Unfiltered(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 species = Pokedex_Sort_CurrentSpecies(param0->unk_04); + u32 species = PokedexSort_CurrentSpecies(param0->unk_04); - Pokedex_Sort_Unfiltered(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, species); + 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 89852a254c..9fb2219a43 100644 --- a/src/overlay021/ov21_021D76B0.c +++ b/src/overlay021/ov21_021D76B0.c @@ -10,7 +10,7 @@ #include "overlay021/ov21_021D4340.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021D5AEC.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedexsort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D4660.h" @@ -20,7 +20,7 @@ #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" -#include "overlay021/struct_pokedexstatus.h" +#include "overlay021/struct_ov21_021d3320.h" #include "bg_window.h" #include "cell_actor.h" @@ -114,8 +114,8 @@ static void ov21_021D8324(UnkStruct_ov21_021D7A64 *param0); static void ov21_021D8354(UnkStruct_ov21_021D7C64 *param0, UnkStruct_ov21_021D77E8 *param1, int param2, fx32 param3); static void ov21_021D83C0(UnkStruct_ov21_021D7C64 *param0, UnkStruct_ov21_021D77E8 *param1, const UnkStruct_ov21_021D77D4 *param2); static void ov21_021D8434(UnkStruct_ov21_021D7A64 *param0, int param1, int param2); -static BOOL ov21_021D84E0(UnkStruct_ov21_021D7A64 *param0, PokedexStatus *param1); -static BOOL ov21_021D8508(UnkStruct_ov21_021D7A64 *param0, PokedexStatus *param1); +static BOOL ov21_021D84E0(UnkStruct_ov21_021D7A64 *param0, UnkStruct_ov21_021D3320 *param1); +static BOOL ov21_021D8508(UnkStruct_ov21_021D7A64 *param0, UnkStruct_ov21_021D3320 *param1); static void ov21_021D8530(UnkStruct_ov21_021D7A64 *param0, UnkStruct_ov21_021D77D4 *param1); static fx32 ov21_021D8580(fx32 param0, s32 param1); @@ -444,7 +444,7 @@ static void ov21_021D7B8C(u32 param0, u32 param1, void *param2) UnkStruct_ov21_021D7B8C *v0 = param2; UnkStruct_ov21_021D77D4 *v1 = v0->unk_04; UnkStruct_ov21_021D7A64 *v2 = v0->unk_00; - PokedexStatus *v3 = v1->unk_1C->unk_04; + UnkStruct_ov21_021D3320 *v3 = v1->unk_1C->unk_04; int v4; int v5; @@ -473,7 +473,7 @@ static void ov21_021D7B8C(u32 param0, u32 param1, void *param2) break; case 4: if (v2->unk_20 == 0) { - v4 = Pokedex_Sort_CompletionNumEncountered(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); } } @@ -782,7 +782,7 @@ static void ov21_021D828C(UnkStruct_ov21_021D77E8 *param0, int param1) static void ov21_021D82A8(UnkStruct_ov21_021D7A64 *param0, UnkStruct_ov21_021D77D4 *param1) { int v0; - PokedexStatus *v1 = param1->unk_1C->unk_04; + UnkStruct_ov21_021D3320 *v1 = param1->unk_1C->unk_04; if (param1->unk_1C->unk_0C <= 0) { if (param0->unk_10 != 0) { @@ -939,7 +939,7 @@ static void ov21_021D84B8(UnkStruct_ov21_021D77D4 *param0) } } -static BOOL ov21_021D84E0(UnkStruct_ov21_021D7A64 *param0, PokedexStatus *param1) +static BOOL ov21_021D84E0(UnkStruct_ov21_021D7A64 *param0, UnkStruct_ov21_021D3320 *param1) { int v0; @@ -950,7 +950,7 @@ static BOOL ov21_021D84E0(UnkStruct_ov21_021D7A64 *param0, PokedexStatus *param1 v0 = -1; } - if (ov21_021D387C(param1, v0) == 0) { + if (PokedexSort_IsValidStep(param1, v0) == 0) { return 0; } } @@ -958,7 +958,7 @@ static BOOL ov21_021D84E0(UnkStruct_ov21_021D7A64 *param0, PokedexStatus *param1 return 1; } -static BOOL ov21_021D8508(UnkStruct_ov21_021D7A64 *param0, PokedexStatus *param1) +static BOOL ov21_021D8508(UnkStruct_ov21_021D7A64 *param0, UnkStruct_ov21_021D3320 *param1) { int v0; @@ -969,7 +969,7 @@ static BOOL ov21_021D8508(UnkStruct_ov21_021D7A64 *param0, PokedexStatus *param1 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 a3fc22bcfc..8eec5d4d9d 100644 --- a/src/overlay021/ov21_021D85B0.c +++ b/src/overlay021/ov21_021D85B0.c @@ -8,7 +8,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" #include "overlay021/ov21_021D4340.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedexsort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D157C.h" @@ -17,7 +17,7 @@ #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" -#include "overlay021/struct_pokedexstatus.h" +#include "overlay021/struct_ov21_021d3320.h" #include "bg_window.h" #include "cell_actor.h" @@ -35,7 +35,7 @@ typedef struct { int *unk_00; - PokedexStatus *unk_04; + UnkStruct_ov21_021D3320 *unk_04; UnkStruct_ov21_021D5B68 *unk_08; int unk_0C; int unk_10; @@ -400,11 +400,11 @@ static int ov21_021D8804(UnkStruct_ov21_021E6A68 *param0, void *param1) break; case 3: v2 = 1; - v2 = Pokedex_Sort(v0->unk_04, v0->unk_10, v0->unk_14, v0->unk_18, v0->unk_1C, v0->unk_20, ov21_021D36D8(v0->unk_04), param0->heapID, 1); + 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 { @@ -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 640863f386..74784931f4 100644 --- a/src/overlay021/ov21_021D94BC.c +++ b/src/overlay021/ov21_021D94BC.c @@ -10,7 +10,7 @@ #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021D4EE4.h" #include "overlay021/ov21_021D85B0.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedexsort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D2648.h" @@ -23,7 +23,7 @@ #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" -#include "overlay021/struct_pokedexstatus.h" +#include "overlay021/struct_ov21_021d3320.h" #include "bg_window.h" #include "cell_actor.h" @@ -42,7 +42,7 @@ typedef struct { int *unk_00; - PokedexStatus *unk_04; + UnkStruct_ov21_021D3320 *unk_04; UnkStruct_ov21_021E68F4 *unk_08; UnkStruct_ov21_021E68F4 *unk_0C; } UnkStruct_ov21_021D95B8; diff --git a/src/overlay021/ov21_021DC9BC.c b/src/overlay021/ov21_021DC9BC.c index afe51887a0..3f99e1b346 100644 --- a/src/overlay021/ov21_021DC9BC.c +++ b/src/overlay021/ov21_021DC9BC.c @@ -9,9 +9,9 @@ #include "overlay021/ov21_021D1FA4.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021E29DC.h" -#include "overlay021/ov21_021D3208.h" #include "overlay021/pokedexencdata.h" #include "overlay021/pokedexfieldmap.h" +#include "overlay021/pokedexsort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D2648.h" @@ -20,7 +20,7 @@ #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" -#include "overlay021/struct_pokedexstatus.h" +#include "overlay021/struct_ov21_021d3320.h" #include "bg_window.h" #include "cell_actor.h" @@ -83,8 +83,8 @@ enum EncounterTime { }; typedef struct { - PokedexStatus *dexStatus; - int encounterTime; + UnkStruct_ov21_021D3320 *unk_00; + enum EncounterTime encounterTime; UnkStruct_ov21_021E68F4 *unk_08; } UnkStruct_ov21_021DCACC; @@ -174,7 +174,7 @@ static void ov21_021DD964(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 static void ov21_021DDB8C(PokedexMapDisplay *mapDisplay); static void ov21_021DDBCC(PokedexMapDisplay *mapDisplay); static void ov21_021DDC14(PokedexMapDisplay *mapDisplay); -static void PokedexEncounters_PopulateCategories(encounterCollection *enCollection, UnkStruct_ov21_021DCACC *param1, int heapID); +static void PokedexSort_PopulateDexStatus(encounterCollection *enCollection, UnkStruct_ov21_021DCACC *param1, int heapID); static void ov21_021DDB68(encounterCollection *enCollection); void ov21_021DC9BC(UnkStruct_ov21_021E68F4 *param0, UnkStruct_ov21_021D0F60 *param1, int heapID) @@ -246,7 +246,7 @@ static UnkStruct_ov21_021DCACC *ov21_021DCA5C(int heapID, UnkStruct_ov21_021D0F6 GF_ASSERT(v0); memset(v0, 0, sizeof(UnkStruct_ov21_021DCACC)); - v0->dexStatus = ov21_021D13EC(param1); + v0->unk_00 = ov21_021D13EC(param1); v0->unk_08 = ov21_021D1410(param1, 5); return v0; @@ -296,10 +296,10 @@ static int PokedexEncounters_PopulateEncounterCollection(UnkStruct_ov21_021E6A68 param0->unk_08 = encCollection; - if (v0->dexStatus->timeOfDay == TOD_MORNING) { + if (v0->unk_00->timeOfDay == TOD_MORNING) { v0->encounterTime = ENCTIME_MORNING; } else { - if ((v0->dexStatus->timeOfDay == TOD_DAY) || (v0->dexStatus->timeOfDay == TOD_TWILIGHT)) { + if ((v0->unk_00->timeOfDay == TOD_DAY) || (v0->unk_00->timeOfDay == TOD_TWILIGHT)) { v0->encounterTime = ENCTIME_DAY; } else { v0->encounterTime = ENCTIME_NIGHT; @@ -309,7 +309,7 @@ static int PokedexEncounters_PopulateEncounterCollection(UnkStruct_ov21_021E6A68 encCollection->invisibleFields = PokedexEncounters_InvisibleFields(param0->heapID, v0, &encCollection->numInvisibleFields); encCollection->invisibleDungeons = PokedexEncounters_InvisibleDungeons(param0->heapID, v0, &encCollection->numInvisibleDungeons); - PokedexEncounters_PopulateCategories(encCollection, v0, param0->heapID); + PokedexSort_PopulateDexStatus(encCollection, v0, param0->heapID); encCollection->encounterTime = v0->encounterTime; @@ -331,7 +331,7 @@ static int ov21_021DCB6C(UnkStruct_ov21_021E6A68 *param0, void *param1) if (encCollection->encounterTime != v0->encounterTime) { ov21_021DDB68(encCollection); - PokedexEncounters_PopulateCategories(encCollection, v0, param0->heapID); + PokedexSort_PopulateDexStatus(encCollection, v0, param0->heapID); encCollection->encounterTime = v0->encounterTime; } @@ -507,28 +507,28 @@ static void ov21_021DCE40(UnkStruct_ov21_021DCAE0 *param0, const UnkStruct_ov21_ Bg_LoadToTilemapRect(param0->unk_00->unk_00, 3, v1->rawData, 0, 0, v1->screenWidth / 8, v1->screenHeight / 8); Heap_FreeToHeap(v0); - if (param1->dexStatus->newmoonIslandVisible) { + 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->dexStatus->seabreakPathVisible) { + 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->dexStatus->fullmoonIslandVisible) { + 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->dexStatus->springPathVisible) { + 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); @@ -862,7 +862,7 @@ static void ov21_021DD710(PokedexMapDisplay *mapDisplay, const UnkStruct_ov21_02 PokedexFieldMap_SmoothFields(mapDisplay->pokedexFieldMap_1, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH); PokedexFieldMap_SmoothFields(mapDisplay->pokedexFieldMap_2, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH); - species = Pokedex_Sort_CurrentSpecies(param1->dexStatus); + species = PokedexSort_CurrentSpecies(param1->unk_00); if (species == SPECIES_FEEBAS) { v2 = 4; @@ -917,7 +917,7 @@ static u8 *PokedexEncounters_InvisibleFields(u32 heapID, const UnkStruct_ov21_02 fieldCount = 0; - if (param1->dexStatus->fullmoonIslandVisible == 0) { + if (param1->unk_00->fullmoonIslandVisible == 0) { index = 0; while (fullmoonIslandFields[index] != TERMINALVALUE) { @@ -926,7 +926,7 @@ static u8 *PokedexEncounters_InvisibleFields(u32 heapID, const UnkStruct_ov21_02 } } - if (param1->dexStatus->seabreakPathVisible == 0) { + if (param1->unk_00->seabreakPathVisible == 0) { index = 0; while (seabreakPathFields[index] != TERMINALVALUE) { @@ -935,7 +935,7 @@ static u8 *PokedexEncounters_InvisibleFields(u32 heapID, const UnkStruct_ov21_02 } } - if (param1->dexStatus->newmoonIslandVisible == 0) { + if (param1->unk_00->newmoonIslandVisible == 0) { index = 0; while (newmoonIslandFields[index] != TERMINALVALUE) { @@ -944,7 +944,7 @@ static u8 *PokedexEncounters_InvisibleFields(u32 heapID, const UnkStruct_ov21_02 } } - if (param1->dexStatus->springPathVisible == 0) { + if (param1->unk_00->springPathVisible == 0) { index = 0; while (springPathFields[index] != TERMINALVALUE) { @@ -963,7 +963,7 @@ static u8 *PokedexEncounters_InvisibleFields(u32 heapID, const UnkStruct_ov21_02 fieldCount = 0; - if (param1->dexStatus->fullmoonIslandVisible == 0) { + if (param1->unk_00->fullmoonIslandVisible == 0) { index = 0; while (fullmoonIslandFields[index] != TERMINALVALUE) { @@ -973,7 +973,7 @@ static u8 *PokedexEncounters_InvisibleFields(u32 heapID, const UnkStruct_ov21_02 } } - if (param1->dexStatus->seabreakPathVisible == 0) { + if (param1->unk_00->seabreakPathVisible == 0) { index = 0; while (seabreakPathFields[index] != TERMINALVALUE) { @@ -983,7 +983,7 @@ static u8 *PokedexEncounters_InvisibleFields(u32 heapID, const UnkStruct_ov21_02 } } - if (param1->dexStatus->newmoonIslandVisible == 0) { + if (param1->unk_00->newmoonIslandVisible == 0) { index = 0; while (newmoonIslandFields[index] != TERMINALVALUE) { @@ -993,7 +993,7 @@ static u8 *PokedexEncounters_InvisibleFields(u32 heapID, const UnkStruct_ov21_02 } } - if (param1->dexStatus->springPathVisible == 0) { + if (param1->unk_00->springPathVisible == 0) { index = 0; while (springPathFields[index] != TERMINALVALUE) { @@ -1014,7 +1014,7 @@ static u8 *PokedexEncounters_InvisibleDungeons(u32 param0, const UnkStruct_ov21_ dungeonCount = 0; - if (param1->dexStatus->fullmoonIslandVisible == 0) { + if (param1->unk_00->fullmoonIslandVisible == 0) { index = 0; while (fullmoonIslandDungeons[index] != TERMINALVALUE) { @@ -1023,7 +1023,7 @@ static u8 *PokedexEncounters_InvisibleDungeons(u32 param0, const UnkStruct_ov21_ } } - if (param1->dexStatus->seabreakPathVisible == 0) { + if (param1->unk_00->seabreakPathVisible == 0) { index = 0; while (seabreakPathDungeons[index] != TERMINALVALUE) { @@ -1032,7 +1032,7 @@ static u8 *PokedexEncounters_InvisibleDungeons(u32 param0, const UnkStruct_ov21_ } } - if (param1->dexStatus->newmoonIslandVisible == 0) { + if (param1->unk_00->newmoonIslandVisible == 0) { index = 0; while (newmoonIslandDungeons[index] != TERMINALVALUE) { @@ -1041,7 +1041,7 @@ static u8 *PokedexEncounters_InvisibleDungeons(u32 param0, const UnkStruct_ov21_ } } - if (param1->dexStatus->springPathVisible == 0) { + if (param1->unk_00->springPathVisible == 0) { index = 0; while (springPathDungeons[index] != TERMINALVALUE) { @@ -1060,7 +1060,7 @@ static u8 *PokedexEncounters_InvisibleDungeons(u32 param0, const UnkStruct_ov21_ dungeonCount = 0; - if (param1->dexStatus->fullmoonIslandVisible == 0) { + if (param1->unk_00->fullmoonIslandVisible == 0) { index = 0; while (fullmoonIslandDungeons[index] != TERMINALVALUE) { @@ -1070,7 +1070,7 @@ static u8 *PokedexEncounters_InvisibleDungeons(u32 param0, const UnkStruct_ov21_ } } - if (param1->dexStatus->seabreakPathVisible == 0) { + if (param1->unk_00->seabreakPathVisible == 0) { index = 0; while (seabreakPathDungeons[index] != TERMINALVALUE) { @@ -1080,7 +1080,7 @@ static u8 *PokedexEncounters_InvisibleDungeons(u32 param0, const UnkStruct_ov21_ } } - if (param1->dexStatus->newmoonIslandVisible == 0) { + if (param1->unk_00->newmoonIslandVisible == 0) { index = 0; while (newmoonIslandDungeons[index] != TERMINALVALUE) { @@ -1090,7 +1090,7 @@ static u8 *PokedexEncounters_InvisibleDungeons(u32 param0, const UnkStruct_ov21_ } } - if (param1->dexStatus->springPathVisible == 0) { + if (param1->unk_00->springPathVisible == 0) { index = 0; while (springPathDungeons[index] != TERMINALVALUE) { @@ -1148,11 +1148,11 @@ static void ov21_021DDA80(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 } } -static void PokedexEncounters_PopulateCategories(encounterCollection *enCollection, UnkStruct_ov21_021DCACC *param1, int heapID) +static void PokedexSort_PopulateDexStatus(encounterCollection *enCollection, UnkStruct_ov21_021DCACC *param1, int heapID) { int dungeonCategory; int fieldCategory; - int species = Pokedex_Sort_CurrentSpecies(param1->dexStatus); + int species = PokedexSort_CurrentSpecies(param1->unk_00); switch (param1->encounterTime) { case ENCTIME_MORNING: @@ -1175,7 +1175,7 @@ static void PokedexEncounters_PopulateCategories(encounterCollection *enCollecti PokedexEncData_PopulateEncounterLocations(&enCollection->dungeonsEncounteredOn, species, dungeonCategory, heapID); PokedexEncData_PopulateEncounterLocations(&enCollection->fieldsEncounteredOn, species, fieldCategory, heapID); - if (Pokedex_Sort_PokedexUnlocked(param1->dexStatus) == 0) { + if (PokedexSort_IsNationalUnlocked(param1->unk_00) == 0) { PokedexEncData_PopulateEncounterLocations(&enCollection->dungeonSpecialEncounters, species, PEFC_DUNGEONSPECIAL, heapID); PokedexEncData_PopulateEncounterLocations(&enCollection->fieldSpecialEncounters, species, PEFC_FIELDSPECIAL, heapID); } else { @@ -1266,8 +1266,8 @@ static void ov21_021DDC14(PokedexMapDisplay *mapDisplay) static void ov21_021DDCF4(UnkStruct_ov21_021DCAE0 *param0, const UnkStruct_ov21_021DCACC *param1) { Sprite *v0 = ov21_021D2170(param0->unk_00); - int species = Pokedex_Sort_CurrentSpecies(param1->dexStatus); + int species = PokedexSort_CurrentSpecies(param1->unk_00); - ov21_021D1890(param0->unk_00, param1->dexStatus, species, 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 26a36a56ae..5404c38ede 100644 --- a/src/overlay021/ov21_021DDD2C.c +++ b/src/overlay021/ov21_021DDD2C.c @@ -9,14 +9,14 @@ #include "overlay021/ov21_021D1FA4.h" #include "overlay021/ov21_021DC9BC.h" #include "overlay021/ov21_021E29DC.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedexsort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D4660.h" #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" -#include "overlay021/struct_pokedexstatus.h" +#include "overlay021/struct_ov21_021d3320.h" #include "bg_window.h" #include "cell_actor.h" @@ -34,7 +34,7 @@ typedef struct { UnkStruct_ov21_021E68F4 *unk_00; - PokedexStatus *unk_04; + UnkStruct_ov21_021D3320 *unk_04; UnkStruct_ov21_021E68F4 *unk_08; } UnkStruct_ov21_021DDDA4; diff --git a/src/overlay021/ov21_021DE668.c b/src/overlay021/ov21_021DE668.c index e4480962a8..523429f327 100644 --- a/src/overlay021/ov21_021DE668.c +++ b/src/overlay021/ov21_021DE668.c @@ -11,7 +11,7 @@ #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021D5600.h" #include "overlay021/ov21_021E29DC.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedexsort.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, Pokedex_Sort_CurrentSpecies(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, Pokedex_Sort_CurrentSpecies(v0->unk_04), 0x1ff, 0x1ff, 0x1ff, 0); + Sound_PlayPokemonCry(14, PokedexSort_CurrentSpecies(v0->unk_04), 0x1ff, 0x1ff, 0x1ff, 0); v0->unk_1C = 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 (Pokedex_Sort_CurrentCaughtStatus(param2->unk_04) == 2) { + if (PokedexSort_CurrentCaughtStatus(param2->unk_04) == 2) { ov21_021DED24(param0, param1, param2, param3); ov21_021DF098(param0, param1, param2, param3); } @@ -414,9 +414,9 @@ 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 species = Pokedex_Sort_CurrentSpecies(param1->unk_04); + int species = PokedexSort_CurrentSpecies(param1->unk_04); - if (Pokedex_Sort_CurrentCaughtStatus(param1->unk_04) != 2) { + if (PokedexSort_CurrentCaughtStatus(param1->unk_04) != 2) { species = 0; } @@ -479,7 +479,7 @@ 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 species = Pokedex_Sort_CurrentSpecies(param2->unk_04); + int species = PokedexSort_CurrentSpecies(param2->unk_04); int v1 = ov21_021D33D4(param2->unk_04, species); if ((species == 487) && (v1 > 0)) { @@ -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,7 +576,7 @@ 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 species = Pokedex_Sort_CurrentSpecies(param1->unk_04); + int species = PokedexSort_CurrentSpecies(param1->unk_04); ov21_021D1890(param0->unk_00, param1->unk_04, species, 2, 48, 72); sub_02007DEC(v0, 6, 0); @@ -626,7 +626,7 @@ static void ov21_021DF098(UnkStruct_ov21_021DF374 *param0, UnkStruct_ov21_021DE7 CellActorResourceData v0; CellActorInitParams v1; UnkStruct_ov21_021D13FC *v2 = param1->unk_00; - int species = Pokedex_Sort_CurrentSpecies(param2->unk_04); + int species = PokedexSort_CurrentSpecies(param2->unk_04); int v4, v5; int v6 = ov21_021D33D4(param2->unk_04, species); @@ -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 species = Pokedex_Sort_CurrentSpecies(param2->unk_04); + int species = PokedexSort_CurrentSpecies(param2->unk_04); Window *v4; UnkStruct_ov21_021D4CB8 v5; SpriteResource *v6; @@ -756,7 +756,7 @@ static void ov21_021DF214(UnkStruct_ov21_021DF374 *param0, UnkStruct_ov21_021DE7 CellActor_SetAnim(param0->unk_0C, 0x11); - if (Pokedex_Sort_CurrentCaughtStatus(param2->unk_04) != 2) { + if (PokedexSort_CurrentCaughtStatus(param2->unk_04) != 2) { species = 0; } diff --git a/src/overlay021/ov21_021DF734.c b/src/overlay021/ov21_021DF734.c index 2109236412..c915183c26 100644 --- a/src/overlay021/ov21_021DF734.c +++ b/src/overlay021/ov21_021DF734.c @@ -7,7 +7,7 @@ #include "overlay021/ov21_021D1FA4.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021E29DC.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedexsort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D2648.h" @@ -16,7 +16,7 @@ #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" -#include "overlay021/struct_pokedexstatus.h" +#include "overlay021/struct_ov21_021d3320.h" #include "bg_window.h" #include "cell_actor.h" @@ -33,7 +33,7 @@ typedef struct { int *unk_00; - PokedexStatus *unk_04; + UnkStruct_ov21_021D3320 *unk_04; const UnkStruct_ov21_021E68F4 *unk_08; int unk_0C; int unk_10; @@ -260,7 +260,7 @@ static int ov21_021DF888(UnkStruct_ov21_021E6A68 *param0, void *param1) UnkStruct_ov21_021DF844 *v0 = param1; int species; - species = Pokedex_Sort_CurrentSpecies(v0->unk_04); + species = PokedexSort_CurrentSpecies(v0->unk_04); v0->unk_0C = ov21_021E01CC(species, v0); v0->unk_10 = ov21_021E0268(species, v0); @@ -439,7 +439,7 @@ 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 species = Pokedex_Sort_CurrentSpecies(param2->unk_04); + int species = PokedexSort_CurrentSpecies(param2->unk_04); int v1; int v2; @@ -455,7 +455,7 @@ 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 species = Pokedex_Sort_CurrentSpecies(param2->unk_04); + int species = PokedexSort_CurrentSpecies(param2->unk_04); int v1; int v2; @@ -1088,7 +1088,7 @@ static int ov21_021E0A4C(UnkStruct_ov21_021DF858 *param0, const UnkStruct_ov21_0 { int v0; int v1; - int species = Pokedex_Sort_CurrentSpecies(param1->unk_04); + int species = PokedexSort_CurrentSpecies(param1->unk_04); v1 = ov21_021D334C(param1->unk_04, species, param2); GF_ASSERT(v1 != -1); diff --git a/src/overlay021/ov21_021E0C68.c b/src/overlay021/ov21_021E0C68.c index dd8f05d114..d8e19647c9 100644 --- a/src/overlay021/ov21_021E0C68.c +++ b/src/overlay021/ov21_021E0C68.c @@ -10,7 +10,7 @@ #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021D5600.h" #include "overlay021/ov21_021E29DC.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedexsort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D2648.h" @@ -19,7 +19,7 @@ #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" -#include "overlay021/struct_pokedexstatus.h" +#include "overlay021/struct_ov21_021d3320.h" #include "bg_window.h" #include "cell_actor.h" @@ -37,7 +37,7 @@ typedef struct { int *unk_00; - PokedexStatus *unk_04; + UnkStruct_ov21_021D3320 *unk_04; int unk_08; int unk_0C; const UnkStruct_ov21_021E68F4 *unk_10; @@ -418,11 +418,11 @@ 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 species = Pokedex_Sort_CurrentSpecies(param1->unk_04); + int species = PokedexSort_CurrentSpecies(param1->unk_04); int v3; int v4; - if (Pokedex_Sort_CurrentCaughtStatus(param1->unk_04) != 2) { + if (PokedexSort_CurrentCaughtStatus(param1->unk_04) != 2) { species = 0; GF_ASSERT(0); } @@ -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,7 +468,7 @@ 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 species = Pokedex_Sort_CurrentSpecies(param1->unk_04); + int species = PokedexSort_CurrentSpecies(param1->unk_04); 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 species = Pokedex_Sort_CurrentSpecies(param2->unk_04); + int species = PokedexSort_CurrentSpecies(param2->unk_04); Window *v4; UnkStruct_ov21_021D4CB8 v5; SpriteResource *v6; @@ -538,7 +538,7 @@ static void ov21_021E136C(UnkStruct_ov21_021E14D4 *param0, UnkStruct_ov21_021E0D CellActor_SetAnim(param0->unk_00, 0x11); - if (Pokedex_Sort_CurrentCaughtStatus(param2->unk_04) != 2) { + if (PokedexSort_CurrentCaughtStatus(param2->unk_04) != 2) { species = 0; } diff --git a/src/overlay021/ov21_021E1924.c b/src/overlay021/ov21_021E1924.c index f0da152d93..5f24d6d3ec 100644 --- a/src/overlay021/ov21_021E1924.c +++ b/src/overlay021/ov21_021E1924.c @@ -13,7 +13,7 @@ #include "overlay021/ov21_021DE668.h" #include "overlay021/ov21_021E0C68.h" #include "overlay021/ov21_021E29DC.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedexsort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D4660.h" @@ -23,7 +23,7 @@ #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" -#include "overlay021/struct_pokedexstatus.h" +#include "overlay021/struct_ov21_021d3320.h" #include "bg_window.h" #include "cell_actor.h" @@ -43,7 +43,7 @@ typedef struct { int *unk_00; - PokedexStatus *unk_04; + UnkStruct_ov21_021D3320 *unk_04; UnkStruct_ov21_021DE6D4 *unk_08; UnkStruct_ov21_021E68F4 *unk_0C; UnkStruct_ov21_021E68F4 *unk_10; @@ -172,7 +172,7 @@ static UnkStruct_ov21_021E1A7C *ov21_021E199C(int param0, UnkStruct_ov21_021D0F6 { UnkStruct_ov21_021E1A7C *v0; UnkStruct_ov21_021E68F4 *v1; - PokedexStatus *v2; + UnkStruct_ov21_021D3320 *v2; int v3; v0 = Heap_AllocFromHeap(param0, sizeof(UnkStruct_ov21_021E1A7C)); @@ -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 f7690ec403..9d7af16ff0 100644 --- a/src/overlay021/ov21_021E29DC.c +++ b/src/overlay021/ov21_021E29DC.c @@ -13,7 +13,7 @@ #include "overlay021/ov21_021DC9BC.h" #include "overlay021/ov21_021E0C68.h" #include "overlay021/ov21_021E3FFC.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedexsort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D4660.h" @@ -26,7 +26,7 @@ #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" -#include "overlay021/struct_pokedexstatus.h" +#include "overlay021/struct_ov21_021d3320.h" #include "bg_window.h" #include "cell_actor.h" @@ -45,7 +45,7 @@ typedef struct { int *unk_00; - PokedexStatus *unk_04; + UnkStruct_ov21_021D3320 *unk_04; int unk_08; UnkStruct_ov21_021D5B68 *unk_0C; UnkStruct_ov21_021DE6D4 *unk_10; @@ -76,7 +76,7 @@ typedef struct { typedef struct { int *unk_00; UnkStruct_ov21_021E2BA8 *unk_04; - PokedexStatus *unk_08; + UnkStruct_ov21_021D3320 *unk_08; int unk_0C[6]; BOOL unk_24; int unk_28; @@ -562,7 +562,7 @@ static BOOL ov21_021E2EC4(UnkStruct_ov21_021E2BA8 *param0, int param1, int param v1 = 64; break; case 3: - if (Pokedex_Sort_CurrentCaughtStatus(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 (Pokedex_Sort_CanDetectForms(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); } @@ -1179,7 +1179,7 @@ static void ov21_021E37CC(u32 param0, u32 param1, void *param2) Sound_PlayEffect(1675); } else { if (v2->unk_10 == 0) { - if (Pokedex_Sort_CanDetectForms(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 (Pokedex_Sort_CanDetectForms(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 (Pokedex_Sort_CanDetectForms(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 06ea71703a..63885a1f21 100644 --- a/src/overlay021/ov21_021E3FFC.c +++ b/src/overlay021/ov21_021E3FFC.c @@ -9,14 +9,14 @@ #include "overlay021/ov21_021D1FA4.h" #include "overlay021/ov21_021E29DC.h" #include "overlay021/ov21_021E4CA4.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedexsort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D2648.h" #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" -#include "overlay021/struct_pokedexstatus.h" +#include "overlay021/struct_ov21_021d3320.h" #include "bg_window.h" #include "cell_actor.h" @@ -31,7 +31,7 @@ typedef struct { int *unk_00; - PokedexStatus *unk_04; + UnkStruct_ov21_021D3320 *unk_04; UnkStruct_ov21_021E68F4 *unk_08; UnkStruct_ov21_021E68F4 *unk_0C; } UnkStruct_ov21_021E40F4; @@ -217,7 +217,7 @@ static int ov21_021E4120(UnkStruct_ov21_021E6A68 *param0, void *param1) { UnkStruct_ov21_021E40F4 *v0 = param1; UnkStruct_ov21_021E4898 *v1; - int species = Pokedex_Sort_CurrentSpecies(v0->unk_04); + int species = PokedexSort_CurrentSpecies(v0->unk_04); v1 = Heap_AllocFromHeap(param0->heapID, sizeof(UnkStruct_ov21_021E4898)); @@ -372,7 +372,7 @@ 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 species = Pokedex_Sort_CurrentSpecies(param1->unk_04); + int species = PokedexSort_CurrentSpecies(param1->unk_04); 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 d4636d8947..1435517590 100644 --- a/src/overlay021/ov21_021E4CA4.c +++ b/src/overlay021/ov21_021E4CA4.c @@ -9,7 +9,7 @@ #include "overlay021/ov21_021D1FA4.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021E29DC.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedexsort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D4660.h" @@ -18,7 +18,7 @@ #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" -#include "overlay021/struct_pokedexstatus.h" +#include "overlay021/struct_ov21_021d3320.h" #include "bg_window.h" #include "cell_actor.h" @@ -40,7 +40,7 @@ typedef struct { int *unk_00; - PokedexStatus *unk_04; + UnkStruct_ov21_021D3320 *unk_04; UnkStruct_ov21_021E68F4 *unk_08; int unk_0C; } UnkStruct_ov21_021E4D90; @@ -279,7 +279,7 @@ 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 species = Pokedex_Sort_CurrentSpecies(v0->unk_04); + int species = PokedexSort_CurrentSpecies(v0->unk_04); v1 = Heap_AllocFromHeap(param0->heapID, sizeof(UnkStruct_ov21_021E51DC)); memset(v1, 0, sizeof(UnkStruct_ov21_021E51DC)); @@ -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 species = Pokedex_Sort_CurrentSpecies(v1->unk_04); + int species = PokedexSort_CurrentSpecies(v1->unk_04); v2->unk_18[param0] = param1; @@ -1284,7 +1284,7 @@ static void ov21_021E5E28(UnkStruct_ov21_021E51DC *param0) static void ov21_021E5E48(UnkStruct_ov21_021E51DC *param0, UnkStruct_ov21_021E4D90 *param1) { - int species = Pokedex_Sort_CurrentSpecies(param1->unk_04); + int species = PokedexSort_CurrentSpecies(param1->unk_04); if (sub_0200598C() == 0) { param0->unk_68--; @@ -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 species = Pokedex_Sort_CurrentSpecies(param1->unk_04); + int species = PokedexSort_CurrentSpecies(param1->unk_04); if (gCoreSys.pressedKeys & PAD_BUTTON_A) { param0->unk_28 = 1; diff --git a/src/overlay021/ov21_021E6014.c b/src/overlay021/ov21_021E6014.c index 0f6e53cd20..c4e08d19b8 100644 --- a/src/overlay021/ov21_021E6014.c +++ b/src/overlay021/ov21_021E6014.c @@ -8,14 +8,14 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" #include "overlay021/ov21_021E29DC.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedexsort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D4660.h" #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" -#include "overlay021/struct_pokedexstatus.h" +#include "overlay021/struct_ov21_021d3320.h" #include "bg_window.h" #include "cell_actor.h" @@ -35,7 +35,7 @@ typedef struct { int *unk_00; - PokedexStatus *dexStatus; + UnkStruct_ov21_021D3320 *unk_04; UnkStruct_ov21_021E68F4 *unk_08; } UnkStruct_ov21_021E6104; @@ -126,7 +126,7 @@ static UnkStruct_ov21_021E6104 *ov21_021E608C(int param0, UnkStruct_ov21_021D0F6 memset(v0, 0, sizeof(UnkStruct_ov21_021E6104)); v0->unk_00 = ov21_021D138C(param1); - v0->dexStatus = ov21_021D13EC(param1); + v0->unk_04 = ov21_021D13EC(param1); v0->unk_08 = ov21_021D1410(param1, 5); return v0; @@ -408,7 +408,7 @@ static void ov21_021E6518(UnkStruct_ov21_021E6274 *param0, UnkStruct_ov21_021E61 VecFx32 v3; short v4; short v5; - int species = Pokedex_Sort_CurrentSpecies(param2->dexStatus); + 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->dexStatus->HWData, species); - v5 = Pokedex_HeightWeightData_TrainerScale(param2->dexStatus->HWData, species); + 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 (Pokedex_Sort_TrainerGender(param2->dexStatus) == 0) { + if (PokedexSort_TrainerGender(param2->unk_04) == 0) { CellActor_SetAnim(param0->unk_10, 5); } else { CellActor_SetAnim(param0->unk_10, 6); @@ -474,7 +474,7 @@ 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 species = Pokedex_Sort_CurrentSpecies(param1->dexStatus); + int species = PokedexSort_CurrentSpecies(param1->unk_04); Strbuf *v3 = MessageUtil_SpeciesName(species, param2); int heightMessageBankIndex = Height_Message_Bank_Index(); @@ -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, Pokedex_Sort_TrainerName(param1->dexStatus), 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 (Pokedex_Sort_TrainerGender(param1->dexStatus) == 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 species = Pokedex_Sort_CurrentSpecies(param1->dexStatus); + int species = PokedexSort_CurrentSpecies(param1->unk_04); - v1 = Pokedex_HeightWeightData_PokemonPos(param1->dexStatus->HWData, species); - v2 = Pokedex_HeightWeightData_PokemonScale(param1->dexStatus->HWData, species); + v1 = Pokedex_HeightWeightData_PokemonPos(param1->unk_04->HWData, species); + v2 = Pokedex_HeightWeightData_PokemonScale(param1->unk_04->HWData, species); - ov21_021D1890(param0->unk_00, param1->dexStatus, species, 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 95fb65fc7e..4ea46de887 100644 --- a/src/overlay021/ov21_021E68F4.c +++ b/src/overlay021/ov21_021E68F4.c @@ -10,7 +10,7 @@ #include "overlay021/ov21_021D4340.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021E29DC.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedexsort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D4660.h" @@ -19,7 +19,7 @@ #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" -#include "overlay021/struct_pokedexstatus.h" +#include "overlay021/struct_ov21_021d3320.h" #include "bg_window.h" #include "cell_actor.h" @@ -40,7 +40,7 @@ typedef struct { int *unk_00; int unk_04; - PokedexStatus *unk_08; + UnkStruct_ov21_021D3320 *unk_08; UnkStruct_ov21_021E68F4 *unk_0C; } UnkStruct_ov21_021E6A20; diff --git a/src/overlay021/ov21_021E737C.c b/src/overlay021/ov21_021E737C.c index 8d13720406..79068c2207 100644 --- a/src/overlay021/ov21_021E737C.c +++ b/src/overlay021/ov21_021E737C.c @@ -10,14 +10,14 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" #include "overlay021/ov21_021E29DC.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedexsort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" #include "overlay021/struct_ov21_021E7F40.h" -#include "overlay021/struct_pokedexstatus.h" +#include "overlay021/struct_ov21_021d3320.h" #include "overlay022/struct_ov22_022557A0.h" #include "overlay022/struct_ov22_02255800.h" @@ -52,7 +52,7 @@ typedef struct { } UnkStruct_ov21_021E9DB0; typedef struct { - PokedexStatus *unk_00; + UnkStruct_ov21_021D3320 *unk_00; UnkStruct_ov21_021E68F4 *unk_04; } UnkStruct_ov21_021E7468; @@ -283,10 +283,10 @@ static int ov21_021E74A0(UnkStruct_ov21_021E6A68 *param0, void *param1) memset(v1, 0, sizeof(UnkStruct_ov21_021E74A0)); param0->unk_08 = v1; - species = Pokedex_Sort_CurrentSpecies(v0->unk_00); + species = PokedexSort_CurrentSpecies(v0->unk_00); v2 = Pokedex_HeightWeightData_Weight(v0->unk_00->HWData, species); - if (Pokedex_Sort_TrainerGender(v0->unk_00) == 0) { + if (PokedexSort_TrainerGender(v0->unk_00) == 0) { v3 = 380; } else { v3 = 340; @@ -547,7 +547,7 @@ static void ov21_021E7904(UnkStruct_ov21_021E7714 *param0, UnkStruct_ov21_021E74 { UnkStruct_ov21_021D13FC *v0 = param1->unk_00; int v1, v2, v3, v4; - int species = Pokedex_Sort_CurrentSpecies(param2->unk_00); + int species = PokedexSort_CurrentSpecies(param2->unk_00); BOOL v6; NARC *v7 = ov21_021D26E0(param1->unk_00); int v8; @@ -627,7 +627,7 @@ static void ov21_021E7B34(UnkStruct_ov21_021E7714 *param0, UnkStruct_ov21_021E74 VecFx32 v3; short v4; short v5; - int species = Pokedex_Sort_CurrentSpecies(param2->unk_00); + 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 (Pokedex_Sort_TrainerGender(param2->unk_00) == 0) { + if (PokedexSort_TrainerGender(param2->unk_00) == 0) { CellActor_SetAnim(param0->unk_00, 3); } else { CellActor_SetAnim(param0->unk_00, 4); @@ -724,7 +724,7 @@ static void ov21_021E7CF8(UnkStruct_ov21_021E747C *param0, int param1) static void ov21_021E7DA8(UnkStruct_ov21_021E747C *param0, const UnkStruct_ov21_021E7468 *param1, int heapID) { Strbuf *v0 = Strbuf_Init(32, heapID); - int species = Pokedex_Sort_CurrentSpecies(param1->unk_00); + int species = PokedexSort_CurrentSpecies(param1->unk_00); Strbuf *v3 = MessageUtil_SpeciesName(species, heapID); int weightMessageBankIndex = Weight_Message_Bank_Index(); @@ -743,9 +743,9 @@ static void ov21_021E7DA8(UnkStruct_ov21_021E747C *param0, const UnkStruct_ov21_ v1 = MessageLoader_Init(0, 26, 697, heapID); - Text_AddPrinterWithParamsAndColor(¶m0->unk_00->unk_04, FONT_SYSTEM, Pokedex_Sort_TrainerName(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 (Pokedex_Sort_TrainerGender(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 a3c89b8c34..f9e4a971e7 100644 --- a/src/overlay021/ov21_021E8484.c +++ b/src/overlay021/ov21_021E8484.c @@ -10,7 +10,7 @@ #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021DF734.h" #include "overlay021/ov21_021E29DC.h" -#include "overlay021/ov21_021D3208.h" +#include "overlay021/pokedexsort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D4660.h" @@ -19,7 +19,7 @@ #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" -#include "overlay021/struct_pokedexstatus.h" +#include "overlay021/struct_ov21_021d3320.h" #include "bg_window.h" #include "cell_actor.h" @@ -38,7 +38,7 @@ typedef struct { int *unk_00; - PokedexStatus *unk_04; + UnkStruct_ov21_021D3320 *unk_04; UnkStruct_ov21_021E68F4 *unk_08; UnkStruct_ov21_021E68F4 *unk_0C; } UnkStruct_ov21_021E8570; diff --git a/src/overlay021/pokedexsort.c b/src/overlay021/pokedexsort.c new file mode 100644 index 0000000000..2e92ff0fa6 --- /dev/null +++ b/src/overlay021/pokedexsort.c @@ -0,0 +1,993 @@ +#include "overlay021/pokedexsort.h" + +#include +#include + +#include "struct_decls/pokedexdata_decl.h" + +#include "overlay021/STRUCT_OV21_021D3208.h" +#include "overlay021/sortedpokedex.h" +#include "overlay021/speciesCaughtStatus.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 IntersectingPokedex(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 FilternByName(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_IsNationalUnlocked(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_IsNationalUnlocked(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 { + FilternByName(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_HasEncountered(dexData, fullDex[species])) { + encounteredDex[*caughtStatusLength] = fullDex[species]; + (*caughtStatusLength)++; + } + } +} + +static void IntersectingPokedex(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_HasCaught(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_HasCaught(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) { + IntersectingPokedex(resultingPokedex, numResulting, pokedexFromFile, pokedexLength, encounteredPokedex, caughtStatusLength, keepUncaught, dexData); + Heap_FreeToHeap(pokedexFromFile); + } else { + memcpy(resultingPokedex, encounteredPokedex, (sizeof(u16)) * caughtStatusLength); + *numResulting = caughtStatusLength; + } +} + +static void FilternByName(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) { + IntersectingPokedex(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) { + IntersectingPokedex(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) { + IntersectingPokedex(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)++; + } +} From 8107bf38b50c32526349676a92dacdf36a2b592e Mon Sep 17 00:00:00 2001 From: h2o-DS Date: Sun, 3 Nov 2024 19:46:17 -0500 Subject: [PATCH 12/16] Resolved Merge Conflicts --- src/overlay021/pokedexsort.c | 10 +- src/unk_0202631C.c | 464 +++++++++++++++++------------------ 2 files changed, 237 insertions(+), 237 deletions(-) diff --git a/src/overlay021/pokedexsort.c b/src/overlay021/pokedexsort.c index 2e92ff0fa6..7c4336a73a 100644 --- a/src/overlay021/pokedexsort.c +++ b/src/overlay021/pokedexsort.c @@ -101,7 +101,7 @@ void PokedexSort_PopulatepokedexStatus(UnkStruct_ov21_021D3320 *param0, UnkStruc param0->dexData = param1->dexData; param0->timeOfDay = param1->timeOfDay; - if (Pokedex_IsNationalUnlocked(param0->dexData)) { + if (Pokedex_IsNationalDexObtained(param0->dexData)) { param0->isNationalDexUnlocked = TRUE; } else { param0->isNationalDexUnlocked = FALSE; @@ -263,7 +263,7 @@ u32 ov21_021D341C(const UnkStruct_ov21_021D3320 *param0, u32 param1) BOOL PokedexSort_IsNationalUnlocked(const UnkStruct_ov21_021D3320 *param0) { - return Pokedex_IsNationalUnlocked(param0->dexData); + return Pokedex_IsNationalDexObtained(param0->dexData); } void ov21_021D3434(UnkStruct_ov21_021D3320 *param0, u32 param1) @@ -658,7 +658,7 @@ static void FilterUnencountered(u16 *encounteredDex, int *caughtStatusLength, co *caughtStatusLength = 0; for (int species = 0; species < pokedexLength; species++) { - if (Pokedex_HasEncountered(dexData, fullDex[species])) { + if (Pokedex_HasSeenSpecies(dexData, fullDex[species])) { encounteredDex[*caughtStatusLength] = fullDex[species]; (*caughtStatusLength)++; } @@ -677,7 +677,7 @@ static void IntersectingPokedex(u16 *resultingPokedex, int *numResulting, const if (keepUncaught == TRUE) { break; } else { - if (Pokedex_HasCaught(dexData, pokedex1[dexIndex1])) { + if (Pokedex_HasCaughtSpecies(dexData, pokedex1[dexIndex1])) { break; } } @@ -696,7 +696,7 @@ static void UpdateCaughtStatus(SortedPokedex *sortedPokedex, const PokedexData * sortedPokedex->caughtStatusLength = 0; for (int dexIndex = 0; dexIndex < caughtStatusLength; dexIndex++) { - if (Pokedex_HasCaught(dexData, encounteredPokedex[dexIndex])) { + if (Pokedex_HasCaughtSpecies(dexData, encounteredPokedex[dexIndex])) { sortedPokedex->caughtStatusArray[sortedPokedex->caughtStatusLength].caughtStatus = CS_CAUGHT; } else { sortedPokedex->caughtStatusArray[sortedPokedex->caughtStatusLength].caughtStatus = CS_ENCOUNTERED; diff --git a/src/unk_0202631C.c b/src/unk_0202631C.c index 98de432093..cd7a9830d3 100644 --- a/src/unk_0202631C.c +++ b/src/unk_0202631C.c @@ -55,14 +55,14 @@ PokedexData *sub_02026324(u32 param0) return v0; } -void sub_02026338(const PokedexData *dexData, PokedexData *param1) +void sub_02026338(const PokedexData *param0, PokedexData *param1) { - MI_CpuCopy8(dexData, param1, sizeof(PokedexData)); + MI_CpuCopy8(param0, param1, sizeof(PokedexData)); } -static inline void CheckPokedexIntegrity(const PokedexData *dexData) +static inline void CheckPokedexIntegrity(const PokedexData *param0) { - GF_ASSERT(dexData->magic == 3203386110); + GF_ASSERT(param0->magic == 3203386110); } static BOOL IsSpeciesOutOfBounds(u16 species) @@ -110,26 +110,26 @@ static inline void inline_020267B8(u8 *param0, u8 param1, u16 param2) param0[param2 >> 2] |= param1 << ((param2 & 3) * 2); } -static inline void Write_SeenSpecies(PokedexData *dexData, u16 species) +static inline void Write_SeenSpecies(PokedexData *param0, u16 species) { - WriteBit((u8 *)dexData->seenPokemon, species); + WriteBit((u8 *)param0->seenPokemon, species); } -static inline void Write_CaughtSpecies(PokedexData *dexData, u16 species) +static inline void Write_CaughtSpecies(PokedexData *param0, u16 species) { - WriteBit((u8 *)dexData->caughtPokemon, species); + WriteBit((u8 *)param0->caughtPokemon, species); } -static void sub_02026360(PokedexData *dexData, u8 param1, u8 param2, u16 param3) +static void sub_02026360(PokedexData *param0, u8 param1, u8 param2, u16 param3) { if (param2 == 0) { - inline_02026360((u8 *)dexData->recordedGenders[1], param1, param3); + inline_02026360((u8 *)param0->recordedGenders[1], param1, param3); } - inline_02026360((u8 *)dexData->recordedGenders[param2], param1, param3); + inline_02026360((u8 *)param0->recordedGenders[param2], param1, param3); } -static void sub_020263D8(PokedexData *dexData, u8 param1, u8 param2, u16 param3) +static void sub_020263D8(PokedexData *param0, u8 param1, u8 param2, u16 param3) { GF_ASSERT(param1 <= 2); @@ -137,7 +137,7 @@ static void sub_020263D8(PokedexData *dexData, u8 param1, u8 param2, u16 param3) param1 = 0; } - sub_02026360(dexData, param1, param2, param3); + sub_02026360(param0, param1, param2, param3); } static inline BOOL CheckSeenMask(const PokedexData *pokedex, u16 species) @@ -150,24 +150,24 @@ static inline BOOL CheckCaughtMask(const PokedexData *pokedex, u16 species) return ReadBit((const u8 *)pokedex->caughtPokemon, species); } -static inline u8 inline_02026BAC(const PokedexData *dexData, u16 param1, u8 param2) +static inline u8 inline_02026BAC(const PokedexData *param0, u16 param1, u8 param2) { - return ReadBit((const u8 *)dexData->recordedGenders[param2], param1); + return ReadBit((const u8 *)param0->recordedGenders[param2], param1); } -static inline void inline_0202736C_1(PokedexData *dexData, u16 param1, u32 param2) +static inline void inline_0202736C_1(PokedexData *param0, u16 param1, u32 param2) { if (param1 == SPECIES_SPINDA) { param0->unk_104 = param2; } } -static int sub_02026400(const PokedexData *dexData) +static int sub_02026400(const PokedexData *param0) { int v0; for (v0 = 0; v0 < UNOWN_COUNT; v0++) { - if (dexData->unk_10C[v0] == 0xff) { + if (param0->unk_10C[v0] == 0xff) { break; } } @@ -175,12 +175,12 @@ static int sub_02026400(const PokedexData *dexData) return v0; } -static BOOL sub_02026418(const PokedexData *dexData, u8 param1) +static BOOL sub_02026418(const PokedexData *param0, u8 param1) { int v0; for (v0 = 0; v0 < UNOWN_COUNT; v0++) { - if (dexData->unk_10C[v0] == param1) { + if (param0->unk_10C[v0] == param1) { return 1; } } @@ -188,22 +188,22 @@ static BOOL sub_02026418(const PokedexData *dexData, u8 param1) return 0; } -static void sub_0202643C(PokedexData *dexData, int param1) +static void sub_0202643C(PokedexData *param0, int param1) { int v0; - if (sub_02026418(dexData, param1)) { + if (sub_02026418(param0, param1)) { return; } - v0 = sub_02026400(dexData); + v0 = sub_02026400(param0); if (v0 < UNOWN_COUNT) { - dexData->unk_10C[v0] = param1; + param0->unk_10C[v0] = param1; } } -static int sub_02026464(const PokedexData *dexData, u32 param1) +static int sub_02026464(const PokedexData *param0, u32 param1) { u32 v0; u32 v1; @@ -217,16 +217,16 @@ static int sub_02026464(const PokedexData *dexData, u32 param1) switch (param1) { case 422: - v2 = &dexData->unk_108; + v2 = ¶m0->unk_108; break; case 423: - v2 = &dexData->unk_109; + v2 = ¶m0->unk_109; break; case 492: - v2 = &dexData->unk_320; + v2 = ¶m0->unk_320; break; case 487: - v2 = &dexData->unk_321; + v2 = ¶m0->unk_321; break; } @@ -240,7 +240,7 @@ static int sub_02026464(const PokedexData *dexData, u32 param1) return 2; } -static BOOL sub_02026514(const PokedexData *dexData, u32 param1, u8 param2) +static BOOL sub_02026514(const PokedexData *param0, u32 param1, u8 param2) { u32 v0; u32 v1; @@ -255,20 +255,20 @@ static BOOL sub_02026514(const PokedexData *dexData, u32 param1, u8 param2) switch (param1) { case 422: - v3 = &dexData->unk_108; + v3 = ¶m0->unk_108; break; case 423: - v3 = &dexData->unk_109; + v3 = ¶m0->unk_109; break; case 492: - v3 = &dexData->unk_320; + v3 = ¶m0->unk_320; break; case 487: - v3 = &dexData->unk_321; + v3 = ¶m0->unk_321; break; } - v2 = sub_02026464(dexData, param1); + v2 = sub_02026464(param0, param1); for (v1 = 0; v1 < v2; v1++) { v0 = ReadBit(v3, v1 + 1); @@ -281,33 +281,33 @@ static BOOL sub_02026514(const PokedexData *dexData, u32 param1, u8 param2) return 0; } -static void sub_020265E8(PokedexData *dexData, u32 param1, int param2) +static void sub_020265E8(PokedexData *param0, u32 param1, int param2) { int v0; u8 *v1; GF_ASSERT((param1 == 422) || (param1 == 423) || (param1 == 492) || (param1 == 487)); - if (sub_02026514(dexData, param1, param2)) { + if (sub_02026514(param0, param1, param2)) { return; } switch (param1) { case 422: - v1 = &dexData->unk_108; + v1 = ¶m0->unk_108; break; case 423: - v1 = &dexData->unk_109; + v1 = ¶m0->unk_109; break; case 492: - v1 = &dexData->unk_320; + v1 = ¶m0->unk_320; break; case 487: - v1 = &dexData->unk_321; + v1 = ¶m0->unk_321; break; } - v0 = sub_02026464(dexData, param1); + v0 = sub_02026464(param0, param1); if (v0 < 2) { inline_02026360(v1, param2, v0 + 1); @@ -318,7 +318,7 @@ static void sub_020265E8(PokedexData *dexData, u32 param1, int param2) } } -static int sub_020266F8(const PokedexData *dexData, u32 param1) +static int sub_020266F8(const PokedexData *param0, u32 param1) { u32 v0; int v1; @@ -333,7 +333,7 @@ static int sub_020266F8(const PokedexData *dexData, u32 param1) if (param1 == SPECIES_BURMY) { v2 = ¶m0->unk_10A; } else { - v2 = &dexData->unk_10B; + v2 = ¶m0->unk_10B; } for (v1 = 0; v1 < 3; v1++) { @@ -347,7 +347,7 @@ static int sub_020266F8(const PokedexData *dexData, u32 param1) return v1; } -static BOOL sub_02026754(const PokedexData *dexData, u32 param1, u8 param2) +static BOOL sub_02026754(const PokedexData *param0, u32 param1, u8 param2) { u32 v0; int v1; @@ -360,9 +360,9 @@ static BOOL sub_02026754(const PokedexData *dexData, u32 param1, u8 param2) } if (param1 == 412) { - v2 = &dexData->unk_10A; + v2 = ¶m0->unk_10A; } else { - v2 = &dexData->unk_10B; + v2 = ¶m0->unk_10B; } for (v1 = 0; v1 < 3; v1++) { @@ -376,24 +376,24 @@ static BOOL sub_02026754(const PokedexData *dexData, u32 param1, u8 param2) return 0; } -static void sub_020267B8(PokedexData *dexData, u32 param1, int param2) +static void sub_020267B8(PokedexData *param0, u32 param1, int param2) { int v0; u8 *v1; GF_ASSERT((param1 == SPECIES_BURMY) || (param1 == SPECIES_WORMADAM)); - if (sub_02026754(dexData, param1, param2)) { + if (sub_02026754(param0, param1, param2)) { return; } if (param1 == SPECIES_BURMY) { v1 = ¶m0->unk_10A; } else { - v1 = &dexData->unk_10B; + v1 = ¶m0->unk_10B; } - v0 = sub_020266F8(dexData, param1); + v0 = sub_020266F8(param0, param1); if (v0 < 3) { inline_020267B8(v1, param2, v0); @@ -409,15 +409,15 @@ static void sub_02026834(u32 *param0, u8 param1, u8 param2) param0[16 - 1] |= (param1 << v0); } -static void sub_02026850(PokedexData *dexData, u8 param1, u8 param2) +static void sub_02026850(PokedexData *param0, u8 param1, u8 param2) { GF_ASSERT(param2 < 4); GF_ASSERT(param1 <= 15); if (param2 < 2) { - sub_02026834(dexData->caughtPokemon, param1, param2); + sub_02026834(param0->caughtPokemon, param1, param2); } else { - sub_02026834(dexData->seenPokemon, param1, param2 - 2); + sub_02026834(param0->seenPokemon, param1, param2 - 2); } } @@ -429,25 +429,25 @@ static inline u32 inline_0202688C(const u32 *param0, u8 param1) return v1; } -static u32 sub_0202688C(const PokedexData *dexData, u8 param1) +static u32 sub_0202688C(const PokedexData *param0, u8 param1) { u32 v0; if (param1 < 2) { - v0 = inline_0202688C(dexData->caughtPokemon, param1); + v0 = inline_0202688C(param0->caughtPokemon, param1); } else { - v0 = inline_0202688C(dexData->seenPokemon, param1 - 2); + v0 = inline_0202688C(param0->seenPokemon, param1 - 2); } return v0; } -static u32 sub_020268B8(const PokedexData *dexData) +static u32 sub_020268B8(const PokedexData *param0) { int v0; for (v0 = 0; v0 < 4; v0++) { - if (sub_0202688C(dexData, v0) == 15) { + if (sub_0202688C(param0, v0) == 15) { break; } } @@ -455,12 +455,12 @@ static u32 sub_020268B8(const PokedexData *dexData) return v0; } -static BOOL sub_020268D8(const PokedexData *dexData, u32 param1) +static BOOL sub_020268D8(const PokedexData *param0, u32 param1) { int v0; for (v0 = 0; v0 < 4; v0++) { - if (sub_0202688C(dexData, v0) == param1) { + if (sub_0202688C(param0, v0) == param1) { return 1; } } @@ -468,7 +468,7 @@ static BOOL sub_020268D8(const PokedexData *dexData, u32 param1) return 0; } -static void sub_020268FC(PokedexData *dexData, u16 param1, Pokemon *param2) +static void sub_020268FC(PokedexData *param0, u16 param1, Pokemon *param2) { u8 v0 = Pokemon_GetValue(param2, MON_DATA_FORM, NULL); u32 v1; @@ -481,12 +481,12 @@ static void sub_020268FC(PokedexData *dexData, u16 param1, Pokemon *param2) } } -static void sub_0202693C(PokedexData *dexData) +static void sub_0202693C(PokedexData *param0) { int v0; for (v0 = 0; v0 < 4; v0++) { - sub_02026850(dexData, 0xf, v0); + sub_02026850(param0, 0xf, v0); } } @@ -503,7 +503,7 @@ static inline void inline_02026A00(u32 *param0, u32 param1, u32 param2) (*param0) |= (param2 << (param1 * 3)); } -static int sub_02026958(const PokedexData *dexData, u32 param1) +static int sub_02026958(const PokedexData *param0, u32 param1) { u32 v0; int v1, v2; @@ -517,7 +517,7 @@ static int sub_02026958(const PokedexData *dexData, u32 param1) v2 = 0; for (v1 = 0; v1 < 6; v1++) { - v0 = inline_02026958(dexData->unk_31C, v1); + v0 = inline_02026958(param0->unk_31C, v1); if (v0 != 0x7) { v2++; @@ -529,7 +529,7 @@ static int sub_02026958(const PokedexData *dexData, u32 param1) return v2; } -static BOOL sub_020269A4(const PokedexData *dexData, u32 param1, u8 param2) +static BOOL sub_020269A4(const PokedexData *param0, u32 param1, u8 param2) { int v0; u32 v1; @@ -541,10 +541,10 @@ static BOOL sub_020269A4(const PokedexData *dexData, u32 param1, u8 param2) return 0; } - v1 = sub_02026958(dexData, param1); + v1 = sub_02026958(param0, param1); for (v0 = 0; v0 < v1; v0++) { - v2 = inline_02026958(dexData->unk_31C, v0); + v2 = inline_02026958(param0->unk_31C, v0); if (v2 == param2) { return 1; @@ -554,69 +554,69 @@ static BOOL sub_020269A4(const PokedexData *dexData, u32 param1, u8 param2) return 0; } -static void sub_02026A00(PokedexData *dexData, u32 param1, int param2) +static void sub_02026A00(PokedexData *param0, u32 param1, int param2) { int v0; GF_ASSERT(param1 == 479); - if (sub_020269A4(dexData, param1, param2)) { + if (sub_020269A4(param0, param1, param2)) { return; } - v0 = sub_02026958(dexData, param1); + v0 = sub_02026958(param0, param1); if (v0 < 6) { - inline_02026A00(&dexData->unk_31C, v0, param2); + inline_02026A00(¶m0->unk_31C, v0, param2); } } -static void sub_02026A60(PokedexData *dexData, u16 param1, Pokemon *param2) +static void sub_02026A60(PokedexData *param0, u16 param1, Pokemon *param2) { int v0; switch (param1) { case SPECIES_UNOWN: v0 = Pokemon_GetForm(param2); - sub_0202643C(dexData, v0); + sub_0202643C(param0, v0); break; case SPECIES_BURMY: v0 = Pokemon_GetValue(param2, MON_DATA_FORM, NULL); - sub_020267B8(dexData, param1, v0); + sub_020267B8(param0, param1, v0); break; case SPECIES_WORMADAM: v0 = Pokemon_GetValue(param2, MON_DATA_FORM, NULL); - sub_020267B8(dexData, param1, v0); + sub_020267B8(param0, param1, v0); break; case SPECIES_SHELLOS: v0 = Pokemon_GetValue(param2, MON_DATA_FORM, NULL); - sub_020265E8(dexData, param1, v0); + sub_020265E8(param0, param1, v0); break; case SPECIES_GASTRODON: v0 = Pokemon_GetValue(param2, MON_DATA_FORM, NULL); - sub_020265E8(dexData, param1, v0); + sub_020265E8(param0, param1, v0); break; case SPECIES_DEOXYS: sub_020268FC(param0, param1, param2); break; case SPECIES_SHAYMIN: v0 = Pokemon_GetValue(param2, MON_DATA_FORM, NULL); - sub_020265E8(dexData, param1, v0); + sub_020265E8(param0, param1, v0); break; case SPECIES_GIRATINA: v0 = Pokemon_GetValue(param2, MON_DATA_FORM, NULL); - sub_020265E8(dexData, param1, v0); + sub_020265E8(param0, param1, v0); break; case SPECIES_ROTOM: v0 = Pokemon_GetValue(param2, MON_DATA_FORM, NULL); - sub_02026A00(dexData, param1, v0); + sub_02026A00(param0, param1, v0); break; default: break; } } -static void sub_02026B88(PokedexData *dexData, u16 param1, u32 param2) +static void sub_02026B88(PokedexData *param0, u16 param1, u32 param2) { int v0; int v1; @@ -628,10 +628,10 @@ static void sub_02026B88(PokedexData *dexData, u16 param1, u32 param2) return; } - dexData->recordedLanguages[v0] |= 1 << v1; + param0->recordedLanguages[v0] |= 1 << v1; } -static u32 sub_02026BAC(const PokedexData *dexData, u16 param1, int param2) +static u32 sub_02026BAC(const PokedexData *param0, u16 param1, int param2) { u32 v0, v1; u32 v2; @@ -644,10 +644,10 @@ static u32 sub_02026BAC(const PokedexData *dexData, u16 param1, int param2) } } - v0 = inline_02026BAC(dexData, param1, 0); + v0 = inline_02026BAC(param0, param1, 0); if (param2 == 1) { - v1 = inline_02026BAC(dexData, param1, 1); + v1 = inline_02026BAC(param0, param1, 1); if (v1 == v0) { v2 = -1; @@ -661,12 +661,12 @@ static u32 sub_02026BAC(const PokedexData *dexData, u16 param1, int param2) return v2; } -static inline int inline_020270AC(const PokedexData *dexData, int param1) +static inline int inline_020270AC(const PokedexData *param0, int param1) { - return dexData->unk_10C[param1]; + return param0->unk_10C[param1]; } -static int sub_02026C24(const PokedexData *dexData, u32 param1, int param2) +static int sub_02026C24(const PokedexData *param0, u32 param1, int param2) { const u8 *v0; @@ -675,31 +675,31 @@ static int sub_02026C24(const PokedexData *dexData, u32 param1, int param2) switch (param1) { case 422: - v0 = &dexData->unk_108; + v0 = ¶m0->unk_108; break; case 423: - v0 = &dexData->unk_109; + v0 = ¶m0->unk_109; break; case 492: - v0 = &dexData->unk_320; + v0 = ¶m0->unk_320; break; case 487: - v0 = &dexData->unk_321; + v0 = ¶m0->unk_321; break; } return ReadBit(v0, param2 + 1); } -static int sub_02026CCC(const PokedexData *dexData, u32 param1, int param2) +static int sub_02026CCC(const PokedexData *param0, u32 param1, int param2) { GF_ASSERT(param1 == 479); GF_ASSERT(param2 < 6); - return inline_02026958(dexData->unk_31C, param2); + return inline_02026958(param0->unk_31C, param2); } -static int sub_02026CFC(const PokedexData *dexData, u32 param1, int param2) +static int sub_02026CFC(const PokedexData *param0, u32 param1, int param2) { const u8 *v0; @@ -707,9 +707,9 @@ static int sub_02026CFC(const PokedexData *dexData, u32 param1, int param2) GF_ASSERT(param2 < 3); if (param1 == 412) { - v0 = &dexData->unk_10A; + v0 = ¶m0->unk_10A; } else { - v0 = &dexData->unk_10B; + v0 = ¶m0->unk_10B; } return inline_020266F8(v0, param2); @@ -749,32 +749,32 @@ static BOOL sub_02026D68(u16 param0) return 1; } -void Pokedex_Init(PokedexData *dexData) +void Pokedex_Init(PokedexData *param0) { - memset(dexData, 0, sizeof(PokedexData)); + memset(param0, 0, sizeof(PokedexData)); - dexData->magic = 3203386110; - dexData->nationalDexObtained = FALSE; + param0->magic = 3203386110; + param0->nationalDexObtained = FALSE; - memset(dexData->unk_10C, 0xff, sizeof(u8) * UNOWN_COUNT); + memset(param0->unk_10C, 0xff, sizeof(u8) * UNOWN_COUNT); - dexData->unk_108 = 0xff; - dexData->unk_109 = 0xff; - dexData->unk_10A = 0xff; - dexData->unk_10B = 0xff; - dexData->unk_31C = 0xffffffff; - dexData->unk_320 = 0xff; - dexData->unk_321 = 0xff; + param0->unk_108 = 0xff; + param0->unk_109 = 0xff; + param0->unk_10A = 0xff; + param0->unk_10B = 0xff; + param0->unk_31C = 0xffffffff; + param0->unk_320 = 0xff; + param0->unk_321 = 0xff; - sub_0202693C(dexData); + sub_0202693C(param0); } -u16 sub_02026DD0(const PokedexData *dexData) +u16 sub_02026DD0(const PokedexData *param0) { int v0; int v1; - CheckPokedexIntegrity(dexData); + CheckPokedexIntegrity(param0); v1 = 0; for (v0 = 1; v0 <= NATIONAL_DEX_COUNT; v0++) { @@ -811,12 +811,12 @@ u16 Pokedex_CountSeen(const PokedexData *pokedex) return Pokedex_CountSeenSinnoh(pokedex); } -u16 sub_02026E64(const PokedexData *dexData) +u16 sub_02026E64(const PokedexData *param0) { int v0; int v1; - CheckPokedexIntegrity(dexData); + CheckPokedexIntegrity(param0); v1 = 0; for (v0 = 1; v0 <= NATIONAL_DEX_COUNT; v0++) { @@ -846,11 +846,11 @@ u16 Pokedex_CountSeenSinnoh(const PokedexData *pokedex) return seenCount; } -BOOL sub_02026EF4(const PokedexData *dexData) +BOOL sub_02026EF4(const PokedexData *param0) { u16 v0; - v0 = sub_02026F20(dexData); + v0 = sub_02026F20(param0); if (v0 >= 482) { return 1; @@ -859,11 +859,11 @@ BOOL sub_02026EF4(const PokedexData *dexData) return 0; } -BOOL sub_02026F0C(const PokedexData *dexData) +BOOL sub_02026F0C(const PokedexData *param0) { u16 v0; - v0 = sub_02026F58(dexData); + v0 = sub_02026F58(param0); if (v0 >= LOCAL_DEX_COUNT) { return 1; @@ -872,7 +872,7 @@ BOOL sub_02026F0C(const PokedexData *dexData) return 0; } -u16 sub_02026F20(const PokedexData *dexData) +u16 sub_02026F20(const PokedexData *param0) { int v0; u16 v1; @@ -890,7 +890,7 @@ u16 sub_02026F20(const PokedexData *dexData) return v1; } -u16 sub_02026F58(const PokedexData *dexData) +u16 sub_02026F58(const PokedexData *param0) { int v0; u16 v1; @@ -939,15 +939,15 @@ BOOL Pokedex_HasSeenSpecies(const PokedexData *pokedex, u16 species) return CheckSeenMask(pokedex, species); } -u32 sub_0202702C(const PokedexData *dexData, u8 param1) +u32 sub_0202702C(const PokedexData *param0, u8 param1) { u32 v0; - CheckPokedexIntegrity(dexData); + CheckPokedexIntegrity(param0); switch (param1) { case 0: - v0 = dexData->unk_104; + v0 = param0->unk_104; break; default: GF_ASSERT(0); @@ -957,147 +957,147 @@ u32 sub_0202702C(const PokedexData *dexData, u8 param1) return v0; } -u32 sub_02027058(const PokedexData *dexData, u16 species, int param2) +u32 sub_02027058(const PokedexData *param0, u16 species, int param2) { - CheckPokedexIntegrity(dexData); + CheckPokedexIntegrity(param0); - if (IsSpeciesOutOfBounds(param1)) { + if (IsSpeciesOutOfBounds(species)) { return -1; } - if (!CheckSeenMask(param0, param1)) { + if (!CheckSeenMask(param0, species)) { return -1; } - return sub_02026BAC(dexData, species, param2); + return sub_02026BAC(param0, species, param2); } -u32 sub_020270AC(const PokedexData *dexData, int param1) +u32 sub_020270AC(const PokedexData *param0, int param1) { - CheckPokedexIntegrity(dexData); + CheckPokedexIntegrity(param0); - if (sub_02026400(dexData) <= param1) { + if (sub_02026400(param0) <= param1) { return -1; } - return inline_020270AC(dexData, param1); + return inline_020270AC(param0, param1); } -u32 sub_020270DC(const PokedexData *dexData) +u32 sub_020270DC(const PokedexData *param0) { - CheckPokedexIntegrity(dexData); - return sub_02026400(dexData); + CheckPokedexIntegrity(param0); + return sub_02026400(param0); } -u32 sub_020270F8(const PokedexData *dexData, int param1) +u32 sub_020270F8(const PokedexData *param0, int param1) { - CheckPokedexIntegrity(dexData); + CheckPokedexIntegrity(param0); - if (sub_02026464(dexData, 422) <= param1) { + if (sub_02026464(param0, 422) <= param1) { return -1; } - return sub_02026C24(dexData, 422, param1); + return sub_02026C24(param0, 422, param1); } -u32 sub_02027130(const PokedexData *dexData) +u32 sub_02027130(const PokedexData *param0) { - CheckPokedexIntegrity(dexData); - return sub_02026464(dexData, 422); + CheckPokedexIntegrity(param0); + return sub_02026464(param0, 422); } -u32 sub_02027154(const PokedexData *dexData, int param1) +u32 sub_02027154(const PokedexData *param0, int param1) { - CheckPokedexIntegrity(dexData); + CheckPokedexIntegrity(param0); - if (sub_02026464(dexData, 423) <= param1) { + if (sub_02026464(param0, 423) <= param1) { return -1; } - return sub_02026C24(dexData, 423, param1); + return sub_02026C24(param0, 423, param1); } -u32 sub_0202718C(const PokedexData *dexData) +u32 sub_0202718C(const PokedexData *param0) { - CheckPokedexIntegrity(dexData); - return sub_02026464(dexData, 423); + CheckPokedexIntegrity(param0); + return sub_02026464(param0, 423); } -u32 sub_020271B0(const PokedexData *dexData, int param1) +u32 sub_020271B0(const PokedexData *param0, int param1) { - CheckPokedexIntegrity(dexData); + CheckPokedexIntegrity(param0); - if (sub_020266F8(dexData, 412) <= param1) { + if (sub_020266F8(param0, 412) <= param1) { return -1; } - return sub_02026CFC(dexData, 412, param1); + return sub_02026CFC(param0, 412, param1); } -u32 sub_020271E8(const PokedexData *dexData) +u32 sub_020271E8(const PokedexData *param0) { - CheckPokedexIntegrity(dexData); - return sub_020266F8(dexData, 412); + CheckPokedexIntegrity(param0); + return sub_020266F8(param0, 412); } -u32 sub_02027208(const PokedexData *dexData, int param1) +u32 sub_02027208(const PokedexData *param0, int param1) { - CheckPokedexIntegrity(dexData); + CheckPokedexIntegrity(param0); - if (sub_020266F8(dexData, 413) <= param1) { + if (sub_020266F8(param0, 413) <= param1) { return -1; } - return sub_02026CFC(dexData, 413, param1); + return sub_02026CFC(param0, 413, param1); } -u32 sub_02027240(const PokedexData *dexData) +u32 sub_02027240(const PokedexData *param0) { - CheckPokedexIntegrity(dexData); - return sub_020266F8(dexData, 413); + CheckPokedexIntegrity(param0); + return sub_020266F8(param0, 413); } -u32 sub_02027264(const PokedexData *dexData, int param1) +u32 sub_02027264(const PokedexData *param0, int param1) { - CheckPokedexIntegrity(dexData); - return sub_0202688C(dexData, param1); + CheckPokedexIntegrity(param0); + return sub_0202688C(param0, param1); } -u32 sub_02027288(const PokedexData *dexData) +u32 sub_02027288(const PokedexData *param0) { - CheckPokedexIntegrity(dexData); - return sub_020268B8(dexData); + CheckPokedexIntegrity(param0); + return sub_020268B8(param0); } -void sub_020272A4(PokedexData *dexData, Pokemon *pokemon) +void sub_020272A4(PokedexData *param0, Pokemon *pokemon) { 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(dexData); + 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(dexData, species, 0); + v3 = inline_02026BAC(param0, species, 0); if (v3 != v2) { - sub_020263D8(dexData, v2, 1, species); + sub_020263D8(param0, v2, 1, species); } } - sub_02026A60(dexData, species, pokemon); - Write_SeenSpecies(dexData, species); + sub_02026A60(param0, species, pokemon); + Write_SeenSpecies(param0, species); } -void sub_0202736C(PokedexData *dexData, Pokemon *param1) +void sub_0202736C(PokedexData *param0, Pokemon *param1) { u16 species = Pokemon_GetValue(param1, MON_DATA_SPECIES, NULL); u32 v1 = Pokemon_GetValue(param1, MON_DATA_LANGUAGE, NULL); @@ -1105,34 +1105,34 @@ void sub_0202736C(PokedexData *dexData, Pokemon *param1) u32 v3 = Pokemon_GetGender(param1); u32 v4; - CheckPokedexIntegrity(dexData); + 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(dexData, species, 0); + v4 = inline_02026BAC(param0, species, 0); if (v4 != v3) { - sub_020263D8(dexData, v3, 1, species); + sub_020263D8(param0, v3, 1, species); } } - sub_02026A60(dexData, species, param1); - sub_02026B88(dexData, species, v1); + sub_02026A60(param0, species, param1); + sub_02026B88(param0, species, v1); - Write_CaughtSpecies(dexData, species); - Write_SeenSpecies(dexData, species); + Write_CaughtSpecies(param0, species); + Write_SeenSpecies(param0, species); } -void sub_02027454(PokedexData *dexData) +void sub_02027454(PokedexData *param0) { - CheckPokedexIntegrity(dexData); - dexData->nationalDexObtained = 1; + CheckPokedexIntegrity(param0); + param0->nationalDexObtained = 1; } BOOL Pokedex_IsNationalDexObtained(const PokedexData *pokedex) @@ -1141,40 +1141,40 @@ BOOL Pokedex_IsNationalDexObtained(const PokedexData *pokedex) return pokedex->nationalDexObtained; } -BOOL Pokedex_CanDetectForms(const PokedexData *dexData) +BOOL Pokedex_CanDetectForms(const PokedexData *param0) { - CheckPokedexIntegrity(dexData); - return dexData->canDetectForms; + CheckPokedexIntegrity(param0); + return param0->canDetectForms; } -void Pokedex_TurnOnFormDetection(PokedexData *dexData) +void Pokedex_TurnOnFormDetection(PokedexData *param0) { - CheckPokedexIntegrity(dexData); - dexData->canDetectForms = 1; + CheckPokedexIntegrity(param0); + param0->canDetectForms = 1; } -BOOL sub_020274D0(const PokedexData *dexData, u16 species, u32 param2) +BOOL sub_020274D0(const PokedexData *param0, u16 species, u32 param2) { int speciesInt; GF_ASSERT(param2 < 8); - CheckPokedexIntegrity(dexData); + CheckPokedexIntegrity(param0); speciesInt = species; param2 = sub_020986CC(param2); - return dexData->recordedLanguages[speciesInt] & (1 << param2); + return param0->recordedLanguages[speciesInt] & (1 << param2); } -void sub_02027508(PokedexData *dexData) +void sub_02027508(PokedexData *param0) { - dexData->unk_319 = 1; + param0->unk_319 = 1; } -BOOL sub_02027514(const PokedexData *dexData) +BOOL sub_02027514(const PokedexData *param0) { - return dexData->unk_319; + return param0->unk_319; } BOOL Pokedex_IsObtained(const PokedexData *pokedex) @@ -1183,10 +1183,10 @@ BOOL Pokedex_IsObtained(const PokedexData *pokedex) return pokedex->pokedexObtained; } -void sub_02027540(PokedexData *dexData) +void sub_02027540(PokedexData *param0) { - CheckPokedexIntegrity(dexData); - dexData->pokedexObtained = 1; + CheckPokedexIntegrity(param0); + param0->pokedexObtained = 1; } PokedexData *SaveData_Pokedex(SaveData *saveData) @@ -1195,54 +1195,54 @@ PokedexData *SaveData_Pokedex(SaveData *saveData) return pokedex; } -u32 sub_0202756C(const PokedexData *dexData, int species, int param2) +u32 sub_0202756C(const PokedexData *param0, int species, int param2) { - CheckPokedexIntegrity(dexData); + CheckPokedexIntegrity(param0); switch (species) { case SPECIES_UNOWN: - if (param2 < sub_020270DC(dexData)) { - return sub_020270AC(dexData, param2); + if (param2 < sub_020270DC(param0)) { + return sub_020270AC(param0, param2); } break; case SPECIES_SHELLOS: - if (param2 < sub_02027130(dexData)) { - return sub_020270F8(dexData, param2); + if (param2 < sub_02027130(param0)) { + return sub_020270F8(param0, param2); } break; case SPECIES_GASTRODON: - if (param2 < sub_0202718C(dexData)) { - return sub_02027154(dexData, param2); + if (param2 < sub_0202718C(param0)) { + return sub_02027154(param0, param2); } break; case SPECIES_BURMY: - if (param2 < sub_020271E8(dexData)) { - return sub_020271B0(dexData, param2); + if (param2 < sub_020271E8(param0)) { + return sub_020271B0(param0, param2); } break; case SPECIES_WORMADAM: - if (param2 < sub_02027240(dexData)) { - return sub_02027208(dexData, param2); + if (param2 < sub_02027240(param0)) { + return sub_02027208(param0, param2); } break; case SPECIES_DEOXYS: - if (param2 < sub_02027288(dexData)) { - return sub_02027264(dexData, param2); + if (param2 < sub_02027288(param0)) { + return sub_02027264(param0, param2); } break; case SPECIES_SHAYMIN: - if (param2 < sub_02026464(dexData, SPECIES_SHAYMIN)) { - return sub_02026C24(dexData, SPECIES_SHAYMIN, param2); + if (param2 < sub_02026464(param0, SPECIES_SHAYMIN)) { + return sub_02026C24(param0, SPECIES_SHAYMIN, param2); } break; case SPECIES_GIRATINA: - if (param2 < sub_02026464(dexData, SPECIES_GIRATINA)) { - return sub_02026C24(dexData, SPECIES_GIRATINA, param2); + if (param2 < sub_02026464(param0, SPECIES_GIRATINA)) { + return sub_02026C24(param0, SPECIES_GIRATINA, param2); } break; case SPECIES_ROTOM: - if (param2 < sub_02026958(dexData, SPECIES_ROTOM)) { - return sub_02026CCC(dexData, SPECIES_ROTOM, param2); + if (param2 < sub_02026958(param0, SPECIES_ROTOM)) { + return sub_02026CCC(param0, SPECIES_ROTOM, param2); } break; default: From 6b8e02d312428d27925902d3196ec58dc4ced50d Mon Sep 17 00:00:00 2001 From: h2o-DS Date: Sun, 3 Nov 2024 20:38:02 -0500 Subject: [PATCH 13/16] Fixed Filename Typo --- include/overlay021/ov21_021D0D80.h | 2 +- include/overlay021/pokedexsort.h | 2 +- include/overlay021/struct_ov21_021D5B68.h | 2 +- include/overlay021/struct_ov21_021DE6D4.h | 2 +- src/overlay021/ov21_021D0D80.c | 14 +++++++------- src/overlay021/ov21_021D76B0.c | 2 +- src/overlay021/ov21_021D85B0.c | 2 +- src/overlay021/ov21_021D94BC.c | 2 +- src/overlay021/ov21_021DC9BC.c | 2 +- src/overlay021/ov21_021DDD2C.c | 2 +- src/overlay021/ov21_021DF734.c | 2 +- src/overlay021/ov21_021E0C68.c | 2 +- src/overlay021/ov21_021E1924.c | 2 +- src/overlay021/ov21_021E29DC.c | 2 +- src/overlay021/ov21_021E3FFC.c | 2 +- src/overlay021/ov21_021E4CA4.c | 2 +- src/overlay021/ov21_021E6014.c | 2 +- src/overlay021/ov21_021E68F4.c | 2 +- src/overlay021/ov21_021E737C.c | 4 ++-- src/overlay021/ov21_021E8484.c | 2 +- src/overlay021/pokedexsort.c | 2 +- src/unk_0206AFE0.c | 8 ++++---- 22 files changed, 32 insertions(+), 32 deletions(-) diff --git a/include/overlay021/ov21_021D0D80.h b/include/overlay021/ov21_021D0D80.h index 6ebc173419..42b8a2b106 100644 --- a/include/overlay021/ov21_021D0D80.h +++ b/include/overlay021/ov21_021D0D80.h @@ -8,12 +8,12 @@ #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D157C.h" #include "overlay021/struct_ov21_021D22F8.h" +#include "overlay021/struct_ov21_021D3320.h" #include "overlay021/struct_ov21_021D3FE0_decl.h" #include "overlay021/struct_ov21_021D423C_decl.h" #include "overlay021/struct_ov21_021D4C0C_decl.h" #include "overlay021/struct_ov21_021D4CA0.h" #include "overlay021/struct_ov21_021E68F4.h" -#include "overlay021/struct_ov21_021d3320.h" #include "bg_window.h" #include "cell_actor.h" diff --git a/include/overlay021/pokedexsort.h b/include/overlay021/pokedexsort.h index dae90465dc..c72d81a552 100644 --- a/include/overlay021/pokedexsort.h +++ b/include/overlay021/pokedexsort.h @@ -3,7 +3,7 @@ #include "overlay021/STRUCT_OV21_021D3208.h" #include "overlay021/speciesCaughtStatus.h" -#include "overlay021/struct_ov21_021d3320.h" +#include "overlay021/struct_ov21_021D3320.h" #include "strbuf.h" diff --git a/include/overlay021/struct_ov21_021D5B68.h b/include/overlay021/struct_ov21_021D5B68.h index f440385542..92af2efde0 100644 --- a/include/overlay021/struct_ov21_021D5B68.h +++ b/include/overlay021/struct_ov21_021D5B68.h @@ -1,7 +1,7 @@ #ifndef POKEPLATINUM_STRUCT_OV21_021D5B68_H #define POKEPLATINUM_STRUCT_OV21_021D5B68_H -#include "overlay021/struct_ov21_021d3320.h" +#include "overlay021/struct_ov21_021D3320.h" typedef struct { int *unk_00; diff --git a/include/overlay021/struct_ov21_021DE6D4.h b/include/overlay021/struct_ov21_021DE6D4.h index 19c47b4901..dcee75bba1 100644 --- a/include/overlay021/struct_ov21_021DE6D4.h +++ b/include/overlay021/struct_ov21_021DE6D4.h @@ -1,8 +1,8 @@ #ifndef POKEPLATINUM_STRUCT_OV21_021DE6D4_H #define POKEPLATINUM_STRUCT_OV21_021DE6D4_H +#include "overlay021/struct_ov21_021D3320.h" #include "overlay021/struct_ov21_021E68F4.h" -#include "overlay021/struct_ov21_021d3320.h" typedef struct { int *unk_00; diff --git a/src/overlay021/ov21_021D0D80.c b/src/overlay021/ov21_021D0D80.c index e6904ca3cc..93e092d8f7 100644 --- a/src/overlay021/ov21_021D0D80.c +++ b/src/overlay021/ov21_021D0D80.c @@ -39,6 +39,7 @@ #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D157C.h" #include "overlay021/struct_ov21_021D22F8.h" +#include "overlay021/struct_ov21_021D3320.h" #include "overlay021/struct_ov21_021D3FE0_decl.h" #include "overlay021/struct_ov21_021D423C_decl.h" #include "overlay021/struct_ov21_021D4660.h" @@ -46,7 +47,6 @@ #include "overlay021/struct_ov21_021D4CA0.h" #include "overlay021/struct_ov21_021D4CB8.h" #include "overlay021/struct_ov21_021E68F4.h" -#include "overlay021/struct_ov21_021d3320.h" #include "overlay022/struct_ov22_022559F8.h" #include "bg_window.h" @@ -713,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 dexIndex, 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; @@ -721,10 +721,10 @@ void ov21_021D1778(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D332 Window *v3; SpriteResource *v4; VecFx32 v5; - const SpeciesCaughtStatus *pokeCaughtStatus; + const SpeciesCaughtStatus *speciesCaughtStatus; u32 v7 = PokedexStatus_IsNationalDex(param1); - pokeCaughtStatus = PokedexSort_StatusIndexToCaughtStatus(param1, dexIndex); + speciesCaughtStatus = PokedexSort_StatusIndexToCaughtStatus(param1, statusIndex); v0 = ov21_021D22A8(param0); v1 = ov21_021D22C4(param0); @@ -734,7 +734,7 @@ void ov21_021D1778(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D332 CellActor_SetPosition(v0, &v5); CellActor_SetDrawFlag(v0, 1); - if (pokeCaughtStatus->caughtStatus == CS_CAUGHT) { + if (speciesCaughtStatus->caughtStatus == CS_CAUGHT) { v5.x = param4 + (-54 * FX32_ONE); v5.y = param5; @@ -756,10 +756,10 @@ void ov21_021D1778(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D332 v2.unk_20 = NNS_G2D_VRAM_TYPE_2DMAIN; v2.heapID = param2; - v3 = ov21_021D16D8(param0, param1, param2, pokeCaughtStatus->species); + v3 = ov21_021D16D8(param0, param1, param2, speciesCaughtStatus->species); v2.unk_04 = v3; - ov21_021D22E0(param0, &v2, 0, pokeCaughtStatus->species, v7); + ov21_021D22E0(param0, &v2, 0, speciesCaughtStatus->species, v7); ov21_021D4DA0(v3); } diff --git a/src/overlay021/ov21_021D76B0.c b/src/overlay021/ov21_021D76B0.c index 9fb2219a43..bc5076d82d 100644 --- a/src/overlay021/ov21_021D76B0.c +++ b/src/overlay021/ov21_021D76B0.c @@ -13,6 +13,7 @@ #include "overlay021/pokedexsort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" +#include "overlay021/struct_ov21_021D3320.h" #include "overlay021/struct_ov21_021D4660.h" #include "overlay021/struct_ov21_021D4CA0.h" #include "overlay021/struct_ov21_021D4CB8.h" @@ -20,7 +21,6 @@ #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" -#include "overlay021/struct_ov21_021d3320.h" #include "bg_window.h" #include "cell_actor.h" diff --git a/src/overlay021/ov21_021D85B0.c b/src/overlay021/ov21_021D85B0.c index 8eec5d4d9d..47e30fb330 100644 --- a/src/overlay021/ov21_021D85B0.c +++ b/src/overlay021/ov21_021D85B0.c @@ -12,12 +12,12 @@ #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D157C.h" +#include "overlay021/struct_ov21_021D3320.h" #include "overlay021/struct_ov21_021D4660.h" #include "overlay021/struct_ov21_021D5B68.h" #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" -#include "overlay021/struct_ov21_021d3320.h" #include "bg_window.h" #include "cell_actor.h" diff --git a/src/overlay021/ov21_021D94BC.c b/src/overlay021/ov21_021D94BC.c index 74784931f4..c7ad1af5fa 100644 --- a/src/overlay021/ov21_021D94BC.c +++ b/src/overlay021/ov21_021D94BC.c @@ -14,6 +14,7 @@ #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_021D4660.h" #include "overlay021/struct_ov21_021D4C0C_decl.h" #include "overlay021/struct_ov21_021D4CA0.h" @@ -23,7 +24,6 @@ #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" -#include "overlay021/struct_ov21_021d3320.h" #include "bg_window.h" #include "cell_actor.h" diff --git a/src/overlay021/ov21_021DC9BC.c b/src/overlay021/ov21_021DC9BC.c index 3f99e1b346..a4c2101310 100644 --- a/src/overlay021/ov21_021DC9BC.c +++ b/src/overlay021/ov21_021DC9BC.c @@ -15,12 +15,12 @@ #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_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" -#include "overlay021/struct_ov21_021d3320.h" #include "bg_window.h" #include "cell_actor.h" diff --git a/src/overlay021/ov21_021DDD2C.c b/src/overlay021/ov21_021DDD2C.c index 5404c38ede..14b522cd24 100644 --- a/src/overlay021/ov21_021DDD2C.c +++ b/src/overlay021/ov21_021DDD2C.c @@ -12,11 +12,11 @@ #include "overlay021/pokedexsort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" +#include "overlay021/struct_ov21_021D3320.h" #include "overlay021/struct_ov21_021D4660.h" #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" -#include "overlay021/struct_ov21_021d3320.h" #include "bg_window.h" #include "cell_actor.h" diff --git a/src/overlay021/ov21_021DF734.c b/src/overlay021/ov21_021DF734.c index c915183c26..22a91d4003 100644 --- a/src/overlay021/ov21_021DF734.c +++ b/src/overlay021/ov21_021DF734.c @@ -11,12 +11,12 @@ #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_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" -#include "overlay021/struct_ov21_021d3320.h" #include "bg_window.h" #include "cell_actor.h" diff --git a/src/overlay021/ov21_021E0C68.c b/src/overlay021/ov21_021E0C68.c index d8e19647c9..1c0bd38dc3 100644 --- a/src/overlay021/ov21_021E0C68.c +++ b/src/overlay021/ov21_021E0C68.c @@ -14,12 +14,12 @@ #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_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" -#include "overlay021/struct_ov21_021d3320.h" #include "bg_window.h" #include "cell_actor.h" diff --git a/src/overlay021/ov21_021E1924.c b/src/overlay021/ov21_021E1924.c index 5f24d6d3ec..531c8acc7d 100644 --- a/src/overlay021/ov21_021E1924.c +++ b/src/overlay021/ov21_021E1924.c @@ -16,6 +16,7 @@ #include "overlay021/pokedexsort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" +#include "overlay021/struct_ov21_021D3320.h" #include "overlay021/struct_ov21_021D4660.h" #include "overlay021/struct_ov21_021D4CA0.h" #include "overlay021/struct_ov21_021D4CB8.h" @@ -23,7 +24,6 @@ #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" -#include "overlay021/struct_ov21_021d3320.h" #include "bg_window.h" #include "cell_actor.h" diff --git a/src/overlay021/ov21_021E29DC.c b/src/overlay021/ov21_021E29DC.c index 9d7af16ff0..b2be32056b 100644 --- a/src/overlay021/ov21_021E29DC.c +++ b/src/overlay021/ov21_021E29DC.c @@ -16,6 +16,7 @@ #include "overlay021/pokedexsort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" +#include "overlay021/struct_ov21_021D3320.h" #include "overlay021/struct_ov21_021D4660.h" #include "overlay021/struct_ov21_021D4CA0.h" #include "overlay021/struct_ov21_021D4CB8.h" @@ -26,7 +27,6 @@ #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" -#include "overlay021/struct_ov21_021d3320.h" #include "bg_window.h" #include "cell_actor.h" diff --git a/src/overlay021/ov21_021E3FFC.c b/src/overlay021/ov21_021E3FFC.c index 63885a1f21..f255f48906 100644 --- a/src/overlay021/ov21_021E3FFC.c +++ b/src/overlay021/ov21_021E3FFC.c @@ -13,10 +13,10 @@ #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_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" -#include "overlay021/struct_ov21_021d3320.h" #include "bg_window.h" #include "cell_actor.h" diff --git a/src/overlay021/ov21_021E4CA4.c b/src/overlay021/ov21_021E4CA4.c index 1435517590..3413ea533f 100644 --- a/src/overlay021/ov21_021E4CA4.c +++ b/src/overlay021/ov21_021E4CA4.c @@ -12,13 +12,13 @@ #include "overlay021/pokedexsort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" +#include "overlay021/struct_ov21_021D3320.h" #include "overlay021/struct_ov21_021D4660.h" #include "overlay021/struct_ov21_021D4CA0.h" #include "overlay021/struct_ov21_021D4CB8.h" #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" -#include "overlay021/struct_ov21_021d3320.h" #include "bg_window.h" #include "cell_actor.h" diff --git a/src/overlay021/ov21_021E6014.c b/src/overlay021/ov21_021E6014.c index c4e08d19b8..2fbf943f94 100644 --- a/src/overlay021/ov21_021E6014.c +++ b/src/overlay021/ov21_021E6014.c @@ -11,11 +11,11 @@ #include "overlay021/pokedexsort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" +#include "overlay021/struct_ov21_021D3320.h" #include "overlay021/struct_ov21_021D4660.h" #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" -#include "overlay021/struct_ov21_021d3320.h" #include "bg_window.h" #include "cell_actor.h" diff --git a/src/overlay021/ov21_021E68F4.c b/src/overlay021/ov21_021E68F4.c index 4ea46de887..a237d7d2de 100644 --- a/src/overlay021/ov21_021E68F4.c +++ b/src/overlay021/ov21_021E68F4.c @@ -13,13 +13,13 @@ #include "overlay021/pokedexsort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" +#include "overlay021/struct_ov21_021D3320.h" #include "overlay021/struct_ov21_021D4660.h" #include "overlay021/struct_ov21_021D4CA0.h" #include "overlay021/struct_ov21_021D4CB8.h" #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" -#include "overlay021/struct_ov21_021d3320.h" #include "bg_window.h" #include "cell_actor.h" diff --git a/src/overlay021/ov21_021E737C.c b/src/overlay021/ov21_021E737C.c index 79068c2207..c220c433aa 100644 --- a/src/overlay021/ov21_021E737C.c +++ b/src/overlay021/ov21_021E737C.c @@ -13,11 +13,11 @@ #include "overlay021/pokedexsort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" +#include "overlay021/struct_ov21_021D3320.h" #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" #include "overlay021/struct_ov21_021E7F40.h" -#include "overlay021/struct_ov21_021d3320.h" #include "overlay022/struct_ov22_022557A0.h" #include "overlay022/struct_ov22_02255800.h" @@ -554,7 +554,7 @@ static void ov21_021E7904(UnkStruct_ov21_021E7714 *param0, UnkStruct_ov21_021E74 NARC *v9; v9 = NARC_ctor(NARC_INDEX_POKETOOL__ICONGRA__PL_POKE_ICON, param3); - v8 = ov21_021D33D4(param2->unk_00, species); // lasthere + v8 = ov21_021D33D4(param2->unk_00, species); v1 = PokeIconSpriteIndex(species, 0, v8); v2 = PokeIconPalettesFileIndex(); v3 = PokeIconCellsFileIndex(); diff --git a/src/overlay021/ov21_021E8484.c b/src/overlay021/ov21_021E8484.c index f9e4a971e7..31b17b983b 100644 --- a/src/overlay021/ov21_021E8484.c +++ b/src/overlay021/ov21_021E8484.c @@ -13,13 +13,13 @@ #include "overlay021/pokedexsort.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" +#include "overlay021/struct_ov21_021D3320.h" #include "overlay021/struct_ov21_021D4660.h" #include "overlay021/struct_ov21_021D4CA0.h" #include "overlay021/struct_ov21_021D4CB8.h" #include "overlay021/struct_ov21_021E68F4.h" #include "overlay021/struct_ov21_021E6A68.h" #include "overlay021/struct_ov21_021E6B20.h" -#include "overlay021/struct_ov21_021d3320.h" #include "bg_window.h" #include "cell_actor.h" diff --git a/src/overlay021/pokedexsort.c b/src/overlay021/pokedexsort.c index 7c4336a73a..3aaf6d9634 100644 --- a/src/overlay021/pokedexsort.c +++ b/src/overlay021/pokedexsort.c @@ -8,7 +8,7 @@ #include "overlay021/STRUCT_OV21_021D3208.h" #include "overlay021/sortedpokedex.h" #include "overlay021/speciesCaughtStatus.h" -#include "overlay021/struct_ov21_021d3320.h" +#include "overlay021/struct_ov21_021D3320.h" #include "core_sys.h" #include "graphics.h" diff --git a/src/unk_0206AFE0.c b/src/unk_0206AFE0.c index dfd3291b3c..0d42d8cc63 100644 --- a/src/unk_0206AFE0.c +++ b/src/unk_0206AFE0.c @@ -169,10 +169,10 @@ BOOL sub_0206B16C(VarsFlags *param0, int param1) static int sub_0206B194(int param0) { static const u16 v0[] = { - 520, - 553, - 786, - 4136, + 0x208, + 0x229, + 0x312, + 0x1028, }; GF_ASSERT(0 <= param0 && param0 < 4); From b1b170fdc2c8f39caf088936b1d4d3a918eb0771 Mon Sep 17 00:00:00 2001 From: h2o-DS Date: Tue, 5 Nov 2024 20:32:44 -0500 Subject: [PATCH 14/16] Additional Polish Fixed typos --- include/overlay021/pokedexencdata.h | 22 ++--- include/overlay021/pokedexsort.h | 4 +- include/overlay021/sortedpokedex.h | 2 +- src/overlay021/ov21_021D0D80.c | 4 +- src/overlay021/ov21_021D5AEC.c | 2 +- src/overlay021/ov21_021DC9BC.c | 134 ++++++++++++++-------------- src/overlay021/pokedexfieldmap.c | 16 ++-- src/overlay021/pokedexsort.c | 22 ++--- 8 files changed, 103 insertions(+), 103 deletions(-) diff --git a/include/overlay021/pokedexencdata.h b/include/overlay021/pokedexencdata.h index 692929c617..d077b38c0a 100644 --- a/include/overlay021/pokedexencdata.h +++ b/include/overlay021/pokedexencdata.h @@ -5,7 +5,7 @@ #include "cell_actor.h" -typedef struct { +typedef struct EncounterLocations { int *locations; int numLocations; } EncounterLocations; @@ -26,16 +26,16 @@ typedef struct { } FieldCoordinates; enum PokedexEncFileCatgegory { - PEFC_DUNGEONMORNING = 0, - PEFC_DUNGEONDAY = 1, - PEFC_DUNGEONNIGHT = 2, - PEFC_DUNGEONSPECIAL = 3, - PEFC_DUNGEONSPECIALNATDEX = 4, - PEFC_FIELDMORNING = 5, - PEFC_FIELDDAY = 6, - PEFC_FIELDNIGHT = 7, - PEFC_FIELDSPECIAL = 8, - PEFC_FIELDSPECIALNATDEX = 9, + PEFC_DUNGEONMORNING, + PEFC_DUNGEONDAY, + PEFC_DUNGEONNIGHT, + PEFC_DUNGEONSPECIAL, + PEFC_DUNGEONSPECIALNATDEX, + PEFC_FIELDMORNING, + PEFC_FIELDDAY, + PEFC_FIELDNIGHT, + PEFC_FIELDSPECIAL, + PEFC_FIELDSPECIALNATDEX, }; /** diff --git a/include/overlay021/pokedexsort.h b/include/overlay021/pokedexsort.h index c72d81a552..1c5dc233de 100644 --- a/include/overlay021/pokedexsort.h +++ b/include/overlay021/pokedexsort.h @@ -2,7 +2,7 @@ #define POKEPLATINUM_POKEDEXSORT_H #include "overlay021/STRUCT_OV21_021D3208.h" -#include "overlay021/speciesCaughtStatus.h" +#include "overlay021/speciescaughtstatus.h" #include "overlay021/struct_ov21_021D3320.h" #include "strbuf.h" @@ -68,7 +68,7 @@ enum FilterForm { // called form in game, but refers to body shape FF_MULTIBODY }; -void PokedexSort_PopulatepokedexStatus(UnkStruct_ov21_021D3320 *param0, UnkStruct_ov21_021D3208 *param1, int heapID); +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); diff --git a/include/overlay021/sortedpokedex.h b/include/overlay021/sortedpokedex.h index ded78a782b..67664c7afb 100644 --- a/include/overlay021/sortedpokedex.h +++ b/include/overlay021/sortedpokedex.h @@ -3,7 +3,7 @@ #include "constants/species.h" -#include "overlay021/speciesCaughtStatus.h" +#include "overlay021/speciescaughtstatus.h" typedef struct { SpeciesCaughtStatus caughtStatusArray[NATIONAL_DEX_COUNT]; diff --git a/src/overlay021/ov21_021D0D80.c b/src/overlay021/ov21_021D0D80.c index 93e092d8f7..aed6c4d361 100644 --- a/src/overlay021/ov21_021D0D80.c +++ b/src/overlay021/ov21_021D0D80.c @@ -34,7 +34,7 @@ #include "overlay021/ov21_021E737C.h" #include "overlay021/ov21_021E8484.h" #include "overlay021/pokedexsort.h" -#include "overlay021/speciesCaughtStatus.h" +#include "overlay021/speciescaughtstatus.h" #include "overlay021/struct_ov21_021D0D80.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D157C.h" @@ -327,7 +327,7 @@ UnkStruct_ov21_021D0F60 *ov21_021D0F60(int param0, const UnkStruct_ov21_021D0D80 v2.unk_1C = sub_0209ACE4(param1->unk_1C); v2.unk_20 = sub_0209ACEC(param1->unk_1C); - PokedexSort_PopulatepokedexStatus(&v0->unk_0C, &v2, param0); + PokedexSort_PopulatePokedexStatus(&v0->unk_0C, &v2, param0); ov21_021D1FA4(&v0->unk_177C, param0); for (v1 = 0; v1 < 10; v1++) { diff --git a/src/overlay021/ov21_021D5AEC.c b/src/overlay021/ov21_021D5AEC.c index 875a4c373a..2b421ef3b7 100644 --- a/src/overlay021/ov21_021D5AEC.c +++ b/src/overlay021/ov21_021D5AEC.c @@ -10,7 +10,7 @@ #include "overlay021/ov21_021D4340.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/pokedexsort.h" -#include "overlay021/speciesCaughtStatus.h" +#include "overlay021/speciescaughtstatus.h" #include "overlay021/struct_ov21_021D0F60_decl.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D157C.h" diff --git a/src/overlay021/ov21_021DC9BC.c b/src/overlay021/ov21_021DC9BC.c index a4c2101310..8591cfa3eb 100644 --- a/src/overlay021/ov21_021DC9BC.c +++ b/src/overlay021/ov21_021DC9BC.c @@ -106,7 +106,7 @@ typedef struct { EncounterLocations fieldsEncounteredOn; EncounterLocations dungeonSpecialEncounters; EncounterLocations fieldSpecialEncounters; -} encounterCollection; +} EncounterCollection; typedef struct { int encounterTime; @@ -152,7 +152,7 @@ static void ov21_021DD490(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 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 *enCollection, int param4); +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(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1, int param2); @@ -163,10 +163,10 @@ static void ov21_021DD1A8(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 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 *enCollection); +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 *enCollection, int param4); -static void ov21_021DD710(PokedexMapDisplay *mapDisplay, const UnkStruct_ov21_021DCACC *param1, const encounterCollection *enCollection, int param3); +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); @@ -174,8 +174,8 @@ static void ov21_021DD964(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 static void ov21_021DDB8C(PokedexMapDisplay *mapDisplay); static void ov21_021DDBCC(PokedexMapDisplay *mapDisplay); static void ov21_021DDC14(PokedexMapDisplay *mapDisplay); -static void PokedexSort_PopulateDexStatus(encounterCollection *enCollection, UnkStruct_ov21_021DCACC *param1, int heapID); -static void ov21_021DDB68(encounterCollection *enCollection); +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 heapID) { @@ -287,14 +287,14 @@ static int ov21_021DCAF4(void) static int PokedexEncounters_PopulateEncounterCollection(UnkStruct_ov21_021E6A68 *param0, void *param1) { UnkStruct_ov21_021DCACC *v0 = param1; - encounterCollection *encCollection; + EncounterCollection *encounterCollection; - encCollection = Heap_AllocFromHeap(param0->heapID, sizeof(encounterCollection)); + encounterCollection = Heap_AllocFromHeap(param0->heapID, sizeof(EncounterCollection)); - GF_ASSERT(encCollection); - memset(encCollection, 0, sizeof(encounterCollection)); + GF_ASSERT(encounterCollection); + memset(encounterCollection, 0, sizeof(EncounterCollection)); - param0->unk_08 = encCollection; + param0->unk_08 = encounterCollection; if (v0->unk_00->timeOfDay == TOD_MORNING) { v0->encounterTime = ENCTIME_MORNING; @@ -306,12 +306,12 @@ static int PokedexEncounters_PopulateEncounterCollection(UnkStruct_ov21_021E6A68 } } - encCollection->invisibleFields = PokedexEncounters_InvisibleFields(param0->heapID, v0, &encCollection->numInvisibleFields); - encCollection->invisibleDungeons = PokedexEncounters_InvisibleDungeons(param0->heapID, v0, &encCollection->numInvisibleDungeons); + encounterCollection->invisibleFields = PokedexEncounters_InvisibleFields(param0->heapID, v0, &encounterCollection->numInvisibleFields); + encounterCollection->invisibleDungeons = PokedexEncounters_InvisibleDungeons(param0->heapID, v0, &encounterCollection->numInvisibleDungeons); - PokedexSort_PopulateDexStatus(encCollection, v0, param0->heapID); + PokedexSort_PopulateDexStatus(encounterCollection, v0, param0->heapID); - encCollection->encounterTime = v0->encounterTime; + encounterCollection->encounterTime = v0->encounterTime; return 1; } @@ -319,7 +319,7 @@ static int PokedexEncounters_PopulateEncounterCollection(UnkStruct_ov21_021E6A68 static int ov21_021DCB6C(UnkStruct_ov21_021E6A68 *param0, void *param1) { UnkStruct_ov21_021DCACC *v0 = param1; - encounterCollection *encCollection = param0->unk_08; + EncounterCollection *encounterCollection = param0->unk_08; if (param0->unk_0C == 1) { return 1; @@ -329,10 +329,10 @@ static int ov21_021DCB6C(UnkStruct_ov21_021E6A68 *param0, void *param1) return 0; } - if (encCollection->encounterTime != v0->encounterTime) { - ov21_021DDB68(encCollection); - PokedexSort_PopulateDexStatus(encCollection, v0, param0->heapID); - encCollection->encounterTime = v0->encounterTime; + if (encounterCollection->encounterTime != v0->encounterTime) { + ov21_021DDB68(encounterCollection); + PokedexSort_PopulateDexStatus(encounterCollection, v0, param0->heapID); + encounterCollection->encounterTime = v0->encounterTime; } return 0; @@ -340,18 +340,18 @@ static int ov21_021DCB6C(UnkStruct_ov21_021E6A68 *param0, void *param1) static int ov21_021DCBA8(UnkStruct_ov21_021E6A68 *param0, void *param1) { - encounterCollection *enCollection = param0->unk_08; + EncounterCollection *encounterCollection = param0->unk_08; - if (enCollection->invisibleFields) { - Heap_FreeToHeap(enCollection->invisibleFields); + if (encounterCollection->invisibleFields) { + Heap_FreeToHeap(encounterCollection->invisibleFields); } - if (enCollection->invisibleDungeons) { - Heap_FreeToHeap(enCollection->invisibleDungeons); + if (encounterCollection->invisibleDungeons) { + Heap_FreeToHeap(encounterCollection->invisibleDungeons); } - ov21_021DDB68(enCollection); - Heap_FreeToHeap(enCollection); + ov21_021DDB68(encounterCollection); + Heap_FreeToHeap(encounterCollection); param0->unk_08 = NULL; @@ -361,7 +361,7 @@ 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 encounterCollection *encCollection = param3->unk_08; + const EncounterCollection *encounterCollection = param3->unk_08; UnkStruct_ov21_021DCAE0 *v2 = param0; PokedexMapDisplay *mapDisplay = param1->unk_08; BOOL v4; @@ -379,9 +379,9 @@ static int ov21_021DCBD8(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo param1->unk_00++; break; case 1: - ov21_021DCDD0(mapDisplay, v2, v0, encCollection, param1->heapID); - ov21_021DD710(param1->unk_08, v0, encCollection, param1->heapID); - ov21_021DD9E8(param1->unk_08, encCollection); + 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); @@ -415,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 encounterCollection *encCollection = param3->unk_08; + const EncounterCollection *encounterCollection = param3->unk_08; UnkStruct_ov21_021DCAE0 *v2 = param0; PokedexMapDisplay *mapDisplay = param1->unk_08; ov21_021DDC14(mapDisplay); - ov21_021DDA80(mapDisplay, v2, v0, encCollection, param1->heapID); + ov21_021DDA80(mapDisplay, v2, v0, encounterCollection, param1->heapID); return 0; } @@ -428,7 +428,7 @@ 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 encounterCollection *encCollection = param3->unk_08; + const EncounterCollection *encounterCollection = param3->unk_08; UnkStruct_ov21_021DCAE0 *v2 = param0; PokedexMapDisplay *mapDisplay = param1->unk_08; BOOL v4; @@ -476,7 +476,7 @@ static int ov21_021DCD04(void *param0, UnkStruct_ov21_021E6B20 *param1, const vo return 0; } -static void ov21_021DCDD0(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1, const UnkStruct_ov21_021DCACC *param2, const encounterCollection *enCollection, int heapID) +static void ov21_021DCDD0(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1, const UnkStruct_ov21_021DCACC *param2, const EncounterCollection *encounterCollection, int heapID) { ov21_021DCE40(param1, param2, heapID); ov21_021DD668(mapDisplay, param1, heapID); @@ -833,7 +833,7 @@ static void ov21_021DD6C0(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 Window_SetPalette(¶m1->unk_00->unk_04, 0); } -static void ov21_021DD710(PokedexMapDisplay *mapDisplay, const UnkStruct_ov21_021DCACC *param1, const encounterCollection *enCollection, int heapID) +static void ov21_021DD710(PokedexMapDisplay *mapDisplay, const UnkStruct_ov21_021DCACC *param1, const EncounterCollection *encounterCollection, int heapID) { int index, v1; int v2, v3; @@ -844,19 +844,19 @@ static void ov21_021DD710(PokedexMapDisplay *mapDisplay, const UnkStruct_ov21_02 ov21_021DD8B4(mapDisplay); - mapDisplay->numVisibleFields = PokedexEncData_LocateVisibleFields(mapDisplay->pokedexFieldMap_1, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH, mapDisplay->fieldCoordinatesArray, &enCollection->fieldsEncounteredOn, enCollection->invisibleFields, enCollection->numInvisibleFields); - numCombinedMaps = (enCollection->fieldsEncounteredOn.numLocations - 1) + enCollection->numInvisibleFields; + 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 (index = 0; index < numCombinedMaps; index++) { - if (index < enCollection->numInvisibleFields) { - combinedMapArray[index] = enCollection->invisibleFields[index]; + if (index < encounterCollection->numInvisibleFields) { + combinedMapArray[index] = encounterCollection->invisibleFields[index]; } else { - combinedMapArray[index] = enCollection->fieldsEncounteredOn.locations[index - enCollection->numInvisibleFields]; + combinedMapArray[index] = encounterCollection->fieldsEncounteredOn.locations[index - encounterCollection->numInvisibleFields]; } } - mapDisplay->fieldsZero = PokedexEncData_LocateVisibleFields(mapDisplay->pokedexFieldMap_2, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH, mapDisplay->fieldCoordinatesArray, &enCollection->fieldSpecialEncounters, combinedMapArray, numCombinedMaps); + mapDisplay->fieldsZero = PokedexEncData_LocateVisibleFields(mapDisplay->pokedexFieldMap_2, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH, mapDisplay->fieldCoordinatesArray, &encounterCollection->fieldSpecialEncounters, combinedMapArray, numCombinedMaps); Heap_FreeToHeap(combinedMapArray); PokedexFieldMap_SmoothFields(mapDisplay->pokedexFieldMap_1, POKEDEXMAPHEIGHT, POKEDEXMAPWIDTH); @@ -877,20 +877,20 @@ static void ov21_021DD710(PokedexMapDisplay *mapDisplay, const UnkStruct_ov21_02 } mapDisplay->numDungeons = 0; - mapDisplay->numDungeons = PokedexEncData_LocateVisibleDungeons(mapDisplay->cellActorArray, mapDisplay->numDungeons, (NUMDUNGEONS * 2), xOffset, yOffset, POKEDEXMAPXSCALE, POKEDEXMAPYSCALE, mapDisplay->dungeonCoordinatesArray, &enCollection->dungeonsEncounteredOn, 2, v2, enCollection->invisibleDungeons, enCollection->numInvisibleDungeons, &mapDisplay->numVisibleDungeons); + 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); - numCombinedMaps = (enCollection->dungeonsEncounteredOn.numLocations - 1) + enCollection->numInvisibleDungeons; + numCombinedMaps = (encounterCollection->dungeonsEncounteredOn.numLocations - 1) + encounterCollection->numInvisibleDungeons; combinedMapArray = Heap_AllocFromHeapAtEnd(heapID, numCombinedMaps); for (index = 0; index < numCombinedMaps; index++) { - if (index < enCollection->numInvisibleDungeons) { - combinedMapArray[index] = enCollection->invisibleDungeons[index]; + if (index < encounterCollection->numInvisibleDungeons) { + combinedMapArray[index] = encounterCollection->invisibleDungeons[index]; } else { - combinedMapArray[index] = enCollection->dungeonsEncounteredOn.locations[index - enCollection->numInvisibleDungeons]; + combinedMapArray[index] = encounterCollection->dungeonsEncounteredOn.locations[index - encounterCollection->numInvisibleDungeons]; } } - mapDisplay->numDungeons = PokedexEncData_LocateVisibleDungeons(mapDisplay->cellActorArray, mapDisplay->numDungeons, (NUMDUNGEONS * 2), xOffset, yOffset, POKEDEXMAPXSCALE, POKEDEXMAPYSCALE, mapDisplay->dungeonCoordinatesArray, &enCollection->dungeonSpecialEncounters, 3, v3, combinedMapArray, numCombinedMaps, &mapDisplay->dungeonsZero); + 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(combinedMapArray); } @@ -1113,7 +1113,7 @@ static void ov21_021DD964(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 Window_CopyToVRAM(¶m1->unk_00->unk_04); } -static void ov21_021DD9E8(PokedexMapDisplay *mapDisplay, const encounterCollection *enCollection) +static void ov21_021DD9E8(PokedexMapDisplay *mapDisplay, const EncounterCollection *encounterCollection) { if ((mapDisplay->numVisibleDungeons <= 0) && (mapDisplay->numVisibleFields <= 0) && (mapDisplay->dungeonsZero <= 0) && (mapDisplay->fieldsZero <= 0)) { CellActor_SetDrawFlag(mapDisplay->AreaUnknownCellActor, 1); @@ -1137,18 +1137,18 @@ 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 *enCollection, int param4) +static void ov21_021DDA80(PokedexMapDisplay *mapDisplay, UnkStruct_ov21_021DCAE0 *param1, const UnkStruct_ov21_021DCACC *param2, const EncounterCollection *encounterCollection, int param4) { - if (mapDisplay->encounterTime != enCollection->encounterTime) { - ov21_021DD710(mapDisplay, param2, enCollection, param4); + if (mapDisplay->encounterTime != encounterCollection->encounterTime) { + ov21_021DD710(mapDisplay, param2, encounterCollection, param4); ov21_021DD964(mapDisplay, param1); ov21_021DDA48(mapDisplay, param2->encounterTime); - ov21_021DD9E8(mapDisplay, enCollection); - mapDisplay->encounterTime = enCollection->encounterTime; + ov21_021DD9E8(mapDisplay, encounterCollection); + mapDisplay->encounterTime = encounterCollection->encounterTime; } } -static void PokedexSort_PopulateDexStatus(encounterCollection *enCollection, UnkStruct_ov21_021DCACC *param1, int heapID) +static void PokedexSort_PopulateDexStatus(EncounterCollection *encounterCollection, UnkStruct_ov21_021DCACC *param1, int heapID) { int dungeonCategory; int fieldCategory; @@ -1172,24 +1172,24 @@ static void PokedexSort_PopulateDexStatus(encounterCollection *enCollection, Unk break; } - PokedexEncData_PopulateEncounterLocations(&enCollection->dungeonsEncounteredOn, species, dungeonCategory, heapID); - PokedexEncData_PopulateEncounterLocations(&enCollection->fieldsEncounteredOn, species, fieldCategory, heapID); + PokedexEncData_PopulateEncounterLocations(&encounterCollection->dungeonsEncounteredOn, species, dungeonCategory, heapID); + PokedexEncData_PopulateEncounterLocations(&encounterCollection->fieldsEncounteredOn, species, fieldCategory, heapID); if (PokedexSort_IsNationalUnlocked(param1->unk_00) == 0) { - PokedexEncData_PopulateEncounterLocations(&enCollection->dungeonSpecialEncounters, species, PEFC_DUNGEONSPECIAL, heapID); - PokedexEncData_PopulateEncounterLocations(&enCollection->fieldSpecialEncounters, species, PEFC_FIELDSPECIAL, heapID); + PokedexEncData_PopulateEncounterLocations(&encounterCollection->dungeonSpecialEncounters, species, PEFC_DUNGEONSPECIAL, heapID); + PokedexEncData_PopulateEncounterLocations(&encounterCollection->fieldSpecialEncounters, species, PEFC_FIELDSPECIAL, heapID); } else { - PokedexEncData_PopulateEncounterLocations(&enCollection->dungeonSpecialEncounters, species, PEFC_DUNGEONSPECIALNATDEX, heapID); - PokedexEncData_PopulateEncounterLocations(&enCollection->fieldSpecialEncounters, species, PEFC_FIELDSPECIALNATDEX, heapID); + PokedexEncData_PopulateEncounterLocations(&encounterCollection->dungeonSpecialEncounters, species, PEFC_DUNGEONSPECIALNATDEX, heapID); + PokedexEncData_PopulateEncounterLocations(&encounterCollection->fieldSpecialEncounters, species, PEFC_FIELDSPECIALNATDEX, heapID); } } -static void ov21_021DDB68(encounterCollection *enCollection) +static void ov21_021DDB68(EncounterCollection *encounterCollection) { - PokedexEncData_FreeEncounterLocations(&enCollection->dungeonsEncounteredOn); - PokedexEncData_FreeEncounterLocations(&enCollection->fieldsEncounteredOn); - PokedexEncData_FreeEncounterLocations(&enCollection->dungeonSpecialEncounters); - PokedexEncData_FreeEncounterLocations(&enCollection->fieldSpecialEncounters); + PokedexEncData_FreeEncounterLocations(&encounterCollection->dungeonsEncounteredOn); + PokedexEncData_FreeEncounterLocations(&encounterCollection->fieldsEncounteredOn); + PokedexEncData_FreeEncounterLocations(&encounterCollection->dungeonSpecialEncounters); + PokedexEncData_FreeEncounterLocations(&encounterCollection->fieldSpecialEncounters); } static void ov21_021DDB8C(PokedexMapDisplay *mapDisplay) diff --git a/src/overlay021/pokedexfieldmap.c b/src/overlay021/pokedexfieldmap.c index 39eb9500ac..8638c10f91 100644 --- a/src/overlay021/pokedexfieldmap.c +++ b/src/overlay021/pokedexfieldmap.c @@ -99,25 +99,25 @@ static void FindNeighboringFields(u8 *pokedexFieldMap, int *neighbors, int y, in *neighbors |= FN_NORTH; } - if ((((*neighbors) & FN_WEST) == 0) && (((*neighbors) & FN_SOUTH) == 0)) { + 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 ((*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 ((*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 ((*neighbors & FN_EAST) == 0 && (*neighbors & FN_NORTH) == 0) { if (XYToValue(pokedexFieldMap, y + 1, x + 1, mapHeight, mapWidth) == 1) { *neighbors |= FN_NORTHEAST; } @@ -132,16 +132,16 @@ static int GetNeighborType(int neighbors) case FN_ALONE: fieldType = 0; break; - case (FN_WEST): + case FN_WEST: fieldType = 2; break; - case (FN_EAST): + case FN_EAST: fieldType = 3; break; - case (FN_SOUTH): + case FN_SOUTH: fieldType = 4; break; - case (FN_NORTH): + case FN_NORTH: fieldType = 5; break; case (FN_WEST | FN_EAST): diff --git a/src/overlay021/pokedexsort.c b/src/overlay021/pokedexsort.c index 3aaf6d9634..3731dd65e6 100644 --- a/src/overlay021/pokedexsort.c +++ b/src/overlay021/pokedexsort.c @@ -7,7 +7,7 @@ #include "overlay021/STRUCT_OV21_021D3208.h" #include "overlay021/sortedpokedex.h" -#include "overlay021/speciesCaughtStatus.h" +#include "overlay021/speciescaughtstatus.h" #include "overlay021/struct_ov21_021D3320.h" #include "core_sys.h" @@ -75,18 +75,18 @@ enum PokedexDataSortIndex { }; static void FilterUnencountered(u16 *encounteredDex, int *caughtStatusLength, const PokedexData *dexData, const u16 *fullDex, int pokedexLength); -static void IntersectingPokedex(u16 *resultingPokedex, int *numResulting, const u16 *pokedex1, int dexLen1, const u16 *pokedex2, int dexLen2, BOOL keepUncaught, const PokedexData *dexData); +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 FilternByName(int filterName, 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) +void PokedexSort_PopulatePokedexStatus(UnkStruct_ov21_021D3320 *param0, UnkStruct_ov21_021D3208 *param1, int heapID) { int sortOrder; int filterName; @@ -326,7 +326,7 @@ BOOL PokedexSort_Sort(UnkStruct_ov21_021D3320 *param0, int sortOrder, int filter numResulting = 0; do { - FilternByName(filterName, resultingPokedex, &numResulting, encounteredPokedex, caughtStatusLength, heapID, param0->dexData); + FilterByName(filterName, resultingPokedex, &numResulting, encounteredPokedex, caughtStatusLength, heapID, param0->dexData); if (numResulting == 0) { dexExists = FALSE; @@ -665,7 +665,7 @@ static void FilterUnencountered(u16 *encounteredDex, int *caughtStatusLength, co } } -static void IntersectingPokedex(u16 *resultingPokedex, int *numResulting, const u16 *pokedex1, int dexLen1, const u16 *pokedex2, int dexLen2, BOOL keepUncaught, const PokedexData *dexData) +static void IntersectPokedexes(u16 *resultingPokedex, int *numResulting, const u16 *pokedex1, int dexLen1, const u16 *pokedex2, int dexLen2, BOOL keepUncaught, const PokedexData *dexData) { int dexIndex2; @@ -781,7 +781,7 @@ static void DexSortOrder(int sortOrder, u16 *resultingPokedex, int *numResulting } if (pokedexFromFile != NULL) { - IntersectingPokedex(resultingPokedex, numResulting, pokedexFromFile, pokedexLength, encounteredPokedex, caughtStatusLength, keepUncaught, dexData); + IntersectPokedexes(resultingPokedex, numResulting, pokedexFromFile, pokedexLength, encounteredPokedex, caughtStatusLength, keepUncaught, dexData); Heap_FreeToHeap(pokedexFromFile); } else { memcpy(resultingPokedex, encounteredPokedex, (sizeof(u16)) * caughtStatusLength); @@ -789,7 +789,7 @@ static void DexSortOrder(int sortOrder, u16 *resultingPokedex, int *numResulting } } -static void FilternByName(int filterName, 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) { u16 *pokedexFromFile; int pokedexLength; @@ -831,7 +831,7 @@ static void FilternByName(int filterName, u16 *resultingPokedex, int *numResulti } if (pokedexFromFile != NULL) { - IntersectingPokedex(resultingPokedex, numResulting, encounteredPokedex, caughtStatusLength, pokedexFromFile, pokedexLength, TRUE, dexData); + IntersectPokedexes(resultingPokedex, numResulting, encounteredPokedex, caughtStatusLength, pokedexFromFile, pokedexLength, TRUE, dexData); Heap_FreeToHeap(pokedexFromFile); } else { memcpy(resultingPokedex, encounteredPokedex, (sizeof(u16)) * caughtStatusLength); @@ -905,7 +905,7 @@ static void FilterByType(int typeFilter, u16 *resultingPokedex, int *numResultin } if (pokedexFromFile != NULL) { - IntersectingPokedex(resultingPokedex, numResulting, encounteredPokedex, caughtStatusLength, pokedexFromFile, pokedexLength, FALSE, dexData); + IntersectPokedexes(resultingPokedex, numResulting, encounteredPokedex, caughtStatusLength, pokedexFromFile, pokedexLength, FALSE, dexData); Heap_FreeToHeap(pokedexFromFile); } else { memcpy(resultingPokedex, encounteredPokedex, (sizeof(u16)) * caughtStatusLength); @@ -970,7 +970,7 @@ static void FilterByForm(int filterForm, u16 *resultingPokedex, int *numResultin } if (pokedexFromFile != NULL) { - IntersectingPokedex(resultingPokedex, numResulting, encounteredPokedex, caughtStatusLength, pokedexFromFile, pokedexLength, TRUE, dexData); + IntersectPokedexes(resultingPokedex, numResulting, encounteredPokedex, caughtStatusLength, pokedexFromFile, pokedexLength, TRUE, dexData); Heap_FreeToHeap(pokedexFromFile); } else { memcpy(resultingPokedex, encounteredPokedex, (sizeof(u16)) * caughtStatusLength); From d6b8792b87a07a1619fa188212b3ac4f67d860a2 Mon Sep 17 00:00:00 2001 From: h2o-DS Date: Thu, 7 Nov 2024 22:01:20 -0500 Subject: [PATCH 15/16] Snake Case Filenames --- include/overlay021/{pokedexencdata.h => pokedex_encdata.h} | 0 .../overlay021/{pokedexfieldmap.h => pokedex_fieldmap.h} | 0 include/overlay021/{pokedexsort.h => pokedex_sort.h} | 2 +- include/overlay021/{sortedpokedex.h => sorted_pokedex.h} | 2 +- .../{speciescaughtstatus.h => species_caught_status.h} | 0 include/overlay021/struct_ov21_021D3320.h | 2 +- platinum.us/main.lsf | 6 +++--- src/meson.build | 6 +++--- src/overlay021/ov21_021D0D80.c | 4 ++-- src/overlay021/ov21_021D5AEC.c | 4 ++-- src/overlay021/ov21_021D76B0.c | 2 +- src/overlay021/ov21_021D85B0.c | 2 +- src/overlay021/ov21_021D94BC.c | 2 +- src/overlay021/ov21_021DC9BC.c | 6 +++--- src/overlay021/ov21_021DDD2C.c | 2 +- src/overlay021/ov21_021DE668.c | 2 +- src/overlay021/ov21_021DF734.c | 2 +- src/overlay021/ov21_021E0C68.c | 2 +- src/overlay021/ov21_021E1924.c | 2 +- src/overlay021/ov21_021E29DC.c | 2 +- src/overlay021/ov21_021E3FFC.c | 2 +- src/overlay021/ov21_021E4CA4.c | 2 +- src/overlay021/ov21_021E6014.c | 2 +- src/overlay021/ov21_021E68F4.c | 2 +- src/overlay021/ov21_021E737C.c | 2 +- src/overlay021/ov21_021E8484.c | 2 +- src/overlay021/{pokedexencdata.c => pokedex_encdata.c} | 2 +- src/overlay021/{pokedexfieldmap.c => pokedex_fieldmap.c} | 2 +- src/overlay021/{pokedexsort.c => pokedex_sort.c} | 6 +++--- 29 files changed, 36 insertions(+), 36 deletions(-) rename include/overlay021/{pokedexencdata.h => pokedex_encdata.h} (100%) rename include/overlay021/{pokedexfieldmap.h => pokedex_fieldmap.h} (100%) rename include/overlay021/{pokedexsort.h => pokedex_sort.h} (99%) rename include/overlay021/{sortedpokedex.h => sorted_pokedex.h} (90%) rename include/overlay021/{speciescaughtstatus.h => species_caught_status.h} (100%) rename src/overlay021/{pokedexencdata.c => pokedex_encdata.c} (99%) rename src/overlay021/{pokedexfieldmap.c => pokedex_fieldmap.c} (99%) rename src/overlay021/{pokedexsort.c => pokedex_sort.c} (99%) diff --git a/include/overlay021/pokedexencdata.h b/include/overlay021/pokedex_encdata.h similarity index 100% rename from include/overlay021/pokedexencdata.h rename to include/overlay021/pokedex_encdata.h diff --git a/include/overlay021/pokedexfieldmap.h b/include/overlay021/pokedex_fieldmap.h similarity index 100% rename from include/overlay021/pokedexfieldmap.h rename to include/overlay021/pokedex_fieldmap.h diff --git a/include/overlay021/pokedexsort.h b/include/overlay021/pokedex_sort.h similarity index 99% rename from include/overlay021/pokedexsort.h rename to include/overlay021/pokedex_sort.h index 1c5dc233de..3f823361e0 100644 --- a/include/overlay021/pokedexsort.h +++ b/include/overlay021/pokedex_sort.h @@ -2,7 +2,7 @@ #define POKEPLATINUM_POKEDEXSORT_H #include "overlay021/STRUCT_OV21_021D3208.h" -#include "overlay021/speciescaughtstatus.h" +#include "overlay021/species_caught_status.h" #include "overlay021/struct_ov21_021D3320.h" #include "strbuf.h" diff --git a/include/overlay021/sortedpokedex.h b/include/overlay021/sorted_pokedex.h similarity index 90% rename from include/overlay021/sortedpokedex.h rename to include/overlay021/sorted_pokedex.h index 67664c7afb..a2a976c5d1 100644 --- a/include/overlay021/sortedpokedex.h +++ b/include/overlay021/sorted_pokedex.h @@ -3,7 +3,7 @@ #include "constants/species.h" -#include "overlay021/speciescaughtstatus.h" +#include "overlay021/species_caught_status.h" typedef struct { SpeciesCaughtStatus caughtStatusArray[NATIONAL_DEX_COUNT]; diff --git a/include/overlay021/speciescaughtstatus.h b/include/overlay021/species_caught_status.h similarity index 100% rename from include/overlay021/speciescaughtstatus.h rename to include/overlay021/species_caught_status.h diff --git a/include/overlay021/struct_ov21_021D3320.h b/include/overlay021/struct_ov21_021D3320.h index 8a464a7827..73e93ba8be 100644 --- a/include/overlay021/struct_ov21_021D3320.h +++ b/include/overlay021/struct_ov21_021D3320.h @@ -4,7 +4,7 @@ #include "struct_decls/pokedexdata_decl.h" #include "struct_decls/struct_02098700_decl.h" -#include "overlay021/sortedpokedex.h" +#include "overlay021/sorted_pokedex.h" #include "strbuf.h" diff --git a/platinum.us/main.lsf b/platinum.us/main.lsf index d70650eda5..5d71404418 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_pokedexsort.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_pokedexfieldmap.c.o + Object main.nef.p/src_overlay021_pokedex_fieldmap.c.o Object main.nef.p/src_overlay021_ov21_021D5600.c.o - Object main.nef.p/src_overlay021_pokedexencdata.c.o + Object main.nef.p/src_overlay021_pokedex_encdata.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/src/meson.build b/src/meson.build index c9096e7188..00b9631423 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/pokedexsort.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/pokedexfieldmap.c', + 'overlay021/pokedex_fieldmap.c', 'overlay021/ov21_021D5600.c', - 'overlay021/pokedexencdata.c', + 'overlay021/pokedex_encdata.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 aed6c4d361..41cab61def 100644 --- a/src/overlay021/ov21_021D0D80.c +++ b/src/overlay021/ov21_021D0D80.c @@ -33,8 +33,8 @@ #include "overlay021/ov21_021E68F4.h" #include "overlay021/ov21_021E737C.h" #include "overlay021/ov21_021E8484.h" -#include "overlay021/pokedexsort.h" -#include "overlay021/speciescaughtstatus.h" +#include "overlay021/pokedex_sort.h" +#include "overlay021/species_caught_status.h" #include "overlay021/struct_ov21_021D0D80.h" #include "overlay021/struct_ov21_021D13FC.h" #include "overlay021/struct_ov21_021D157C.h" diff --git a/src/overlay021/ov21_021D5AEC.c b/src/overlay021/ov21_021D5AEC.c index 2b421ef3b7..bf2fe8e30f 100644 --- a/src/overlay021/ov21_021D5AEC.c +++ b/src/overlay021/ov21_021D5AEC.c @@ -9,8 +9,8 @@ #include "overlay021/ov21_021D1FA4.h" #include "overlay021/ov21_021D4340.h" #include "overlay021/ov21_021D4C0C.h" -#include "overlay021/pokedexsort.h" -#include "overlay021/speciescaughtstatus.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" diff --git a/src/overlay021/ov21_021D76B0.c b/src/overlay021/ov21_021D76B0.c index bc5076d82d..b2536ae793 100644 --- a/src/overlay021/ov21_021D76B0.c +++ b/src/overlay021/ov21_021D76B0.c @@ -10,7 +10,7 @@ #include "overlay021/ov21_021D4340.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021D5AEC.h" -#include "overlay021/pokedexsort.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" diff --git a/src/overlay021/ov21_021D85B0.c b/src/overlay021/ov21_021D85B0.c index 47e30fb330..568359823c 100644 --- a/src/overlay021/ov21_021D85B0.c +++ b/src/overlay021/ov21_021D85B0.c @@ -8,7 +8,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" #include "overlay021/ov21_021D4340.h" -#include "overlay021/pokedexsort.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" diff --git a/src/overlay021/ov21_021D94BC.c b/src/overlay021/ov21_021D94BC.c index c7ad1af5fa..a524cdd3a9 100644 --- a/src/overlay021/ov21_021D94BC.c +++ b/src/overlay021/ov21_021D94BC.c @@ -10,7 +10,7 @@ #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021D4EE4.h" #include "overlay021/ov21_021D85B0.h" -#include "overlay021/pokedexsort.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" diff --git a/src/overlay021/ov21_021DC9BC.c b/src/overlay021/ov21_021DC9BC.c index 8591cfa3eb..5195f5ccce 100644 --- a/src/overlay021/ov21_021DC9BC.c +++ b/src/overlay021/ov21_021DC9BC.c @@ -9,9 +9,9 @@ #include "overlay021/ov21_021D1FA4.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021E29DC.h" -#include "overlay021/pokedexencdata.h" -#include "overlay021/pokedexfieldmap.h" -#include "overlay021/pokedexsort.h" +#include "overlay021/pokedex_encdata.h" +#include "overlay021/pokedex_fieldmap.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" diff --git a/src/overlay021/ov21_021DDD2C.c b/src/overlay021/ov21_021DDD2C.c index 14b522cd24..ad413772a6 100644 --- a/src/overlay021/ov21_021DDD2C.c +++ b/src/overlay021/ov21_021DDD2C.c @@ -9,7 +9,7 @@ #include "overlay021/ov21_021D1FA4.h" #include "overlay021/ov21_021DC9BC.h" #include "overlay021/ov21_021E29DC.h" -#include "overlay021/pokedexsort.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" diff --git a/src/overlay021/ov21_021DE668.c b/src/overlay021/ov21_021DE668.c index 523429f327..cde9243932 100644 --- a/src/overlay021/ov21_021DE668.c +++ b/src/overlay021/ov21_021DE668.c @@ -11,7 +11,7 @@ #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021D5600.h" #include "overlay021/ov21_021E29DC.h" -#include "overlay021/pokedexsort.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" diff --git a/src/overlay021/ov21_021DF734.c b/src/overlay021/ov21_021DF734.c index 22a91d4003..2d8a83fcf1 100644 --- a/src/overlay021/ov21_021DF734.c +++ b/src/overlay021/ov21_021DF734.c @@ -7,7 +7,7 @@ #include "overlay021/ov21_021D1FA4.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021E29DC.h" -#include "overlay021/pokedexsort.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" diff --git a/src/overlay021/ov21_021E0C68.c b/src/overlay021/ov21_021E0C68.c index 1c0bd38dc3..e07788233e 100644 --- a/src/overlay021/ov21_021E0C68.c +++ b/src/overlay021/ov21_021E0C68.c @@ -10,7 +10,7 @@ #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021D5600.h" #include "overlay021/ov21_021E29DC.h" -#include "overlay021/pokedexsort.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" diff --git a/src/overlay021/ov21_021E1924.c b/src/overlay021/ov21_021E1924.c index 531c8acc7d..5b2cea0af7 100644 --- a/src/overlay021/ov21_021E1924.c +++ b/src/overlay021/ov21_021E1924.c @@ -13,7 +13,7 @@ #include "overlay021/ov21_021DE668.h" #include "overlay021/ov21_021E0C68.h" #include "overlay021/ov21_021E29DC.h" -#include "overlay021/pokedexsort.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" diff --git a/src/overlay021/ov21_021E29DC.c b/src/overlay021/ov21_021E29DC.c index b2be32056b..98698290cc 100644 --- a/src/overlay021/ov21_021E29DC.c +++ b/src/overlay021/ov21_021E29DC.c @@ -13,7 +13,7 @@ #include "overlay021/ov21_021DC9BC.h" #include "overlay021/ov21_021E0C68.h" #include "overlay021/ov21_021E3FFC.h" -#include "overlay021/pokedexsort.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" diff --git a/src/overlay021/ov21_021E3FFC.c b/src/overlay021/ov21_021E3FFC.c index f255f48906..e32168a5bc 100644 --- a/src/overlay021/ov21_021E3FFC.c +++ b/src/overlay021/ov21_021E3FFC.c @@ -9,7 +9,7 @@ #include "overlay021/ov21_021D1FA4.h" #include "overlay021/ov21_021E29DC.h" #include "overlay021/ov21_021E4CA4.h" -#include "overlay021/pokedexsort.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" diff --git a/src/overlay021/ov21_021E4CA4.c b/src/overlay021/ov21_021E4CA4.c index 3413ea533f..14d72ea314 100644 --- a/src/overlay021/ov21_021E4CA4.c +++ b/src/overlay021/ov21_021E4CA4.c @@ -9,7 +9,7 @@ #include "overlay021/ov21_021D1FA4.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021E29DC.h" -#include "overlay021/pokedexsort.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" diff --git a/src/overlay021/ov21_021E6014.c b/src/overlay021/ov21_021E6014.c index 2fbf943f94..2cd0219b99 100644 --- a/src/overlay021/ov21_021E6014.c +++ b/src/overlay021/ov21_021E6014.c @@ -8,7 +8,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" #include "overlay021/ov21_021E29DC.h" -#include "overlay021/pokedexsort.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" diff --git a/src/overlay021/ov21_021E68F4.c b/src/overlay021/ov21_021E68F4.c index a237d7d2de..0f0befad88 100644 --- a/src/overlay021/ov21_021E68F4.c +++ b/src/overlay021/ov21_021E68F4.c @@ -10,7 +10,7 @@ #include "overlay021/ov21_021D4340.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021E29DC.h" -#include "overlay021/pokedexsort.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" diff --git a/src/overlay021/ov21_021E737C.c b/src/overlay021/ov21_021E737C.c index c220c433aa..53c96b4f70 100644 --- a/src/overlay021/ov21_021E737C.c +++ b/src/overlay021/ov21_021E737C.c @@ -10,7 +10,7 @@ #include "overlay021/ov21_021D0D80.h" #include "overlay021/ov21_021D1FA4.h" #include "overlay021/ov21_021E29DC.h" -#include "overlay021/pokedexsort.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" diff --git a/src/overlay021/ov21_021E8484.c b/src/overlay021/ov21_021E8484.c index 31b17b983b..29e2ce74a7 100644 --- a/src/overlay021/ov21_021E8484.c +++ b/src/overlay021/ov21_021E8484.c @@ -10,7 +10,7 @@ #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021DF734.h" #include "overlay021/ov21_021E29DC.h" -#include "overlay021/pokedexsort.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" diff --git a/src/overlay021/pokedexencdata.c b/src/overlay021/pokedex_encdata.c similarity index 99% rename from src/overlay021/pokedexencdata.c rename to src/overlay021/pokedex_encdata.c index aed5b26c2d..8d87d69559 100644 --- a/src/overlay021/pokedexencdata.c +++ b/src/overlay021/pokedex_encdata.c @@ -1,4 +1,4 @@ -#include "overlay021/pokedexencdata.h" +#include "overlay021/pokedex_encdata.h" #include #include diff --git a/src/overlay021/pokedexfieldmap.c b/src/overlay021/pokedex_fieldmap.c similarity index 99% rename from src/overlay021/pokedexfieldmap.c rename to src/overlay021/pokedex_fieldmap.c index 8638c10f91..d335c88d4e 100644 --- a/src/overlay021/pokedexfieldmap.c +++ b/src/overlay021/pokedex_fieldmap.c @@ -1,4 +1,4 @@ -#include "overlay021/pokedexfieldmap.h" +#include "overlay021/pokedex_fieldmap.h" #include #include diff --git a/src/overlay021/pokedexsort.c b/src/overlay021/pokedex_sort.c similarity index 99% rename from src/overlay021/pokedexsort.c rename to src/overlay021/pokedex_sort.c index 3731dd65e6..d58848573c 100644 --- a/src/overlay021/pokedexsort.c +++ b/src/overlay021/pokedex_sort.c @@ -1,4 +1,4 @@ -#include "overlay021/pokedexsort.h" +#include "overlay021/pokedex_sort.h" #include #include @@ -6,8 +6,8 @@ #include "struct_decls/pokedexdata_decl.h" #include "overlay021/STRUCT_OV21_021D3208.h" -#include "overlay021/sortedpokedex.h" -#include "overlay021/speciescaughtstatus.h" +#include "overlay021/sorted_pokedex.h" +#include "overlay021/species_caught_status.h" #include "overlay021/struct_ov21_021D3320.h" #include "core_sys.h" From f11907bbf4b9ffe65cabaadbc25290ccd6b10bbe Mon Sep 17 00:00:00 2001 From: h2o-DS Date: Thu, 7 Nov 2024 22:22:18 -0500 Subject: [PATCH 16/16] Additional Snake Case --- include/overlay021/{pokedex_encdata.h => pokedex_enc_data.h} | 0 .../overlay021/{pokedex_fieldmap.h => pokedex_field_map.h} | 0 platinum.us/main.lsf | 4 ++-- src/meson.build | 4 ++-- src/overlay021/ov21_021DC9BC.c | 4 ++-- src/overlay021/{pokedex_encdata.c => pokedex_enc_data.c} | 2 +- src/overlay021/{pokedex_fieldmap.c => pokedex_field_map.c} | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) rename include/overlay021/{pokedex_encdata.h => pokedex_enc_data.h} (100%) rename include/overlay021/{pokedex_fieldmap.h => pokedex_field_map.h} (100%) rename src/overlay021/{pokedex_encdata.c => pokedex_enc_data.c} (99%) rename src/overlay021/{pokedex_fieldmap.c => pokedex_field_map.c} (99%) diff --git a/include/overlay021/pokedex_encdata.h b/include/overlay021/pokedex_enc_data.h similarity index 100% rename from include/overlay021/pokedex_encdata.h rename to include/overlay021/pokedex_enc_data.h diff --git a/include/overlay021/pokedex_fieldmap.h b/include/overlay021/pokedex_field_map.h similarity index 100% rename from include/overlay021/pokedex_fieldmap.h rename to include/overlay021/pokedex_field_map.h diff --git a/platinum.us/main.lsf b/platinum.us/main.lsf index 5d71404418..e1987e1fca 100644 --- a/platinum.us/main.lsf +++ b/platinum.us/main.lsf @@ -792,9 +792,9 @@ Overlay overlay21 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_pokedex_fieldmap.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_pokedex_encdata.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/src/meson.build b/src/meson.build index 00b9631423..d6011e709e 100644 --- a/src/meson.build +++ b/src/meson.build @@ -603,9 +603,9 @@ pokeplatinum_c = files( 'overlay021/ov21_021D4340.c', 'overlay021/ov21_021D4C0C.c', 'overlay021/ov21_021D4EE4.c', - 'overlay021/pokedex_fieldmap.c', + 'overlay021/pokedex_field_map.c', 'overlay021/ov21_021D5600.c', - 'overlay021/pokedex_encdata.c', + 'overlay021/pokedex_enc_data.c', 'overlay021/ov21_021D5AEC.c', 'overlay021/ov21_021D76B0.c', 'overlay021/ov21_021D85B0.c', diff --git a/src/overlay021/ov21_021DC9BC.c b/src/overlay021/ov21_021DC9BC.c index 5195f5ccce..ce71debb09 100644 --- a/src/overlay021/ov21_021DC9BC.c +++ b/src/overlay021/ov21_021DC9BC.c @@ -9,8 +9,8 @@ #include "overlay021/ov21_021D1FA4.h" #include "overlay021/ov21_021D4C0C.h" #include "overlay021/ov21_021E29DC.h" -#include "overlay021/pokedex_encdata.h" -#include "overlay021/pokedex_fieldmap.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" diff --git a/src/overlay021/pokedex_encdata.c b/src/overlay021/pokedex_enc_data.c similarity index 99% rename from src/overlay021/pokedex_encdata.c rename to src/overlay021/pokedex_enc_data.c index 8d87d69559..c9237b2eec 100644 --- a/src/overlay021/pokedex_encdata.c +++ b/src/overlay021/pokedex_enc_data.c @@ -1,4 +1,4 @@ -#include "overlay021/pokedex_encdata.h" +#include "overlay021/pokedex_enc_data.h" #include #include diff --git a/src/overlay021/pokedex_fieldmap.c b/src/overlay021/pokedex_field_map.c similarity index 99% rename from src/overlay021/pokedex_fieldmap.c rename to src/overlay021/pokedex_field_map.c index d335c88d4e..8ef6fe7389 100644 --- a/src/overlay021/pokedex_fieldmap.c +++ b/src/overlay021/pokedex_field_map.c @@ -1,4 +1,4 @@ -#include "overlay021/pokedex_fieldmap.h" +#include "overlay021/pokedex_field_map.h" #include #include