summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/apprentice.c1
-rw-r--r--src/battle_ai_script_commands.c1
-rw-r--r--src/battle_ai_switch_items.c1
-rwxr-xr-xsrc/battle_anim_effects_3.c1
-rw-r--r--src/battle_anim_mons.c1
-rw-r--r--src/battle_anim_sound_tasks.c1
-rw-r--r--src/battle_controllers.c1
-rw-r--r--src/battle_dome.c1
-rw-r--r--src/battle_factory.c13
-rw-r--r--src/battle_gfx_sfx_util.c1
-rw-r--r--src/battle_interface.c1
-rw-r--r--src/battle_main.c1
-rw-r--r--src/battle_pike.c1
-rw-r--r--src/battle_pyramid.c1
-rw-r--r--src/battle_script_commands.c1
-rw-r--r--src/battle_setup.c1
-rw-r--r--src/battle_tent.c3
-rw-r--r--src/battle_tower.c35
-rw-r--r--src/battle_tv.c1
-rw-r--r--src/battle_util.c2
-rw-r--r--src/birch_pc.c1
-rw-r--r--src/braille_puzzles.c1
-rw-r--r--src/contest.c50
-rw-r--r--src/credits.c1
-rw-r--r--src/data.c1
-rw-r--r--src/data/bard_music/pokemon.h1
-rw-r--r--src/data/battle_frontier/trainer_hill.h496
-rw-r--r--src/data/contest_opponents.h1
-rwxr-xr-xsrc/data/easy_chat/easy_chat_group_pokemon.h2
-rwxr-xr-xsrc/data/easy_chat/easy_chat_group_pokemon2.h2
-rw-r--r--src/data/lilycove_lady.h1
-rw-r--r--src/data/pokemon/item_effects.h14
-rw-r--r--src/data/pokemon/tmhm_learnsets.h2
-rw-r--r--src/daycare.c1
-rw-r--r--src/decompress.c1
-rw-r--r--src/digit_obj_util.c2
-rw-r--r--src/dodrio_berry_picking.c1
-rw-r--r--src/easy_chat.c1
-rwxr-xr-xsrc/ereader_helpers.c1
-rw-r--r--src/evolution_scene.c1
-rw-r--r--src/field_player_avatar.c1
-rw-r--r--src/field_poison.c1
-rw-r--r--src/field_specials.c1
-rw-r--r--src/frontier_util.c1
-rw-r--r--src/hall_of_fame.c1
-rw-r--r--src/intro.c1
-rwxr-xr-xsrc/item_menu.c14
-rw-r--r--src/link_rfu_2.c1
-rw-r--r--src/lottery_corner.c1
-rw-r--r--src/m4a.c19
-rw-r--r--src/mail.c1
-rw-r--r--src/mail_data.c1
-rw-r--r--src/main_menu.c1
-rw-r--r--src/match_call.c1
-rw-r--r--src/menu_specialized.c51
-rw-r--r--src/metatile_behavior.c4
-rwxr-xr-xsrc/mevent2.c1
-rw-r--r--src/mevent_801BAAC.c1
-rw-r--r--src/mon_markings.c4
-rw-r--r--src/multiboot.c33
-rw-r--r--src/mystery_event_script.c1
-rw-r--r--src/overworld.c1
-rwxr-xr-xsrc/party_menu.c1
-rw-r--r--src/pokeball.c1
-rw-r--r--src/pokedex.c1
-rwxr-xr-xsrc/pokedex_area_screen.c1
-rw-r--r--src/pokemon.c19
-rw-r--r--src/pokemon_animation.c1
-rw-r--r--src/pokemon_icon.c1
-rwxr-xr-xsrc/pokemon_jump.c1
-rw-r--r--src/pokemon_size_record.c1
-rw-r--r--src/pokemon_storage_system.c3
-rw-r--r--src/pokemon_summary_screen.c3
-rw-r--r--src/pokenav.c154
-rw-r--r--src/pokenav_conditions_1.c447
-rw-r--r--src/pokenav_conditions_2.c589
-rw-r--r--src/pokenav_conditions_3.c457
-rw-r--r--src/pokenav_main_menu.c146
-rwxr-xr-xsrc/pokenav_match_call_1.c48
-rwxr-xr-xsrc/pokenav_match_call_2.c145
-rw-r--r--src/pokenav_match_call_ui.c432
-rw-r--r--src/pokenav_menu_handler_1.c130
-rw-r--r--src/pokenav_menu_handler_2.c536
-rwxr-xr-xsrc/pokenav_region_map.c58
-rw-r--r--src/pokenav_ribbons_1.c426
-rw-r--r--src/pokenav_ribbons_2.c364
-rw-r--r--src/rayquaza_scene.c1
-rw-r--r--src/record_mixing.c1
-rw-r--r--src/reshow_battle_screen.c1
-rw-r--r--src/roamer.c1
-rw-r--r--src/roulette.c1
-rw-r--r--src/scanline_effect.c8
-rwxr-xr-xsrc/script_pokemon_util.c1
-rw-r--r--src/secret_base.c1
-rwxr-xr-xsrc/shop.c6
-rw-r--r--src/starter_choose.c1
-rw-r--r--src/trade.c1
-rw-r--r--src/trainer_hill.c19
-rw-r--r--src/trainer_pokemon_sprites.c1
-rw-r--r--src/tv.c1
-rw-r--r--src/union_room.c1
-rw-r--r--src/use_pokeblock.c10
-rw-r--r--src/wild_encounter.c1
103 files changed, 2540 insertions, 2272 deletions
diff --git a/src/apprentice.c b/src/apprentice.c
index 7f493a136..7ef094988 100644
--- a/src/apprentice.c
+++ b/src/apprentice.c
@@ -27,7 +27,6 @@
#include "constants/items.h"
#include "constants/pokemon.h"
#include "constants/songs.h"
-#include "constants/species.h"
#include "constants/trainers.h"
#include "constants/moves.h"
diff --git a/src/battle_ai_script_commands.c b/src/battle_ai_script_commands.c
index 748e4729a..4185f8017 100644
--- a/src/battle_ai_script_commands.c
+++ b/src/battle_ai_script_commands.c
@@ -14,7 +14,6 @@
#include "constants/battle_ai.h"
#include "constants/battle_move_effects.h"
#include "constants/moves.h"
-#include "constants/species.h"
#define AI_ACTION_DONE 0x0001
#define AI_ACTION_FLEE 0x0002
diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c
index 2a5a83e0d..1663c2561 100644
--- a/src/battle_ai_switch_items.c
+++ b/src/battle_ai_switch_items.c
@@ -9,7 +9,6 @@
#include "constants/item_effects.h"
#include "constants/items.h"
#include "constants/moves.h"
-#include "constants/species.h"
// this file's functions
static bool8 HasSuperEffectiveMoveAgainstOpponents(bool8 noRng);
diff --git a/src/battle_anim_effects_3.c b/src/battle_anim_effects_3.c
index 8f7ab8541..f57e2a4fc 100755
--- a/src/battle_anim_effects_3.c
+++ b/src/battle_anim_effects_3.c
@@ -21,7 +21,6 @@
#include "constants/battle_anim.h"
#include "constants/rgb.h"
#include "constants/songs.h"
-#include "constants/species.h"
#include "constants/weather.h"
extern const struct SpriteTemplate gThoughtBubbleSpriteTemplate;
diff --git a/src/battle_anim_mons.c b/src/battle_anim_mons.c
index d9993ab95..d626e1604 100644
--- a/src/battle_anim_mons.c
+++ b/src/battle_anim_mons.c
@@ -15,7 +15,6 @@
#include "trig.h"
#include "util.h"
#include "constants/battle_anim.h"
-#include "constants/species.h"
#define GET_UNOWN_LETTER(personality) (( \
(((personality & 0x03000000) >> 24) << 6) \
diff --git a/src/battle_anim_sound_tasks.c b/src/battle_anim_sound_tasks.c
index 71c81235a..eed163816 100644
--- a/src/battle_anim_sound_tasks.c
+++ b/src/battle_anim_sound_tasks.c
@@ -5,7 +5,6 @@
#include "sound.h"
#include "task.h"
#include "constants/battle_anim.h"
-#include "constants/species.h"
// this file's functions
static void sub_8158B98(u8 taskId);
diff --git a/src/battle_controllers.c b/src/battle_controllers.c
index 7f78c1ac9..3ebc5d3bd 100644
--- a/src/battle_controllers.c
+++ b/src/battle_controllers.c
@@ -13,7 +13,6 @@
#include "task.h"
#include "util.h"
#include "constants/abilities.h"
-#include "constants/species.h"
static EWRAM_DATA u8 sLinkSendTaskId = 0;
static EWRAM_DATA u8 sLinkReceiveTaskId = 0;
diff --git a/src/battle_dome.c b/src/battle_dome.c
index 8d6e7f825..c305081c0 100644
--- a/src/battle_dome.c
+++ b/src/battle_dome.c
@@ -33,7 +33,6 @@
#include "graphics.h"
#include "constants/battle_dome.h"
#include "constants/frontier_util.h"
-#include "constants/species.h"
#include "constants/moves.h"
#include "constants/pokemon.h"
#include "constants/trainers.h"
diff --git a/src/battle_factory.c b/src/battle_factory.c
index 940e71f7d..a2b1d337a 100644
--- a/src/battle_factory.c
+++ b/src/battle_factory.c
@@ -8,7 +8,6 @@
#include "frontier_util.h"
#include "battle_tower.h"
#include "random.h"
-#include "constants/species.h"
#include "constants/battle_ai.h"
#include "constants/battle_factory.h"
#include "constants/battle_frontier.h"
@@ -208,7 +207,7 @@ static void InitFactoryChallenge(void)
for (i = 0; i < 6; i++)
gSaveBlock2Ptr->frontier.rentalMons[i].monId = 0xFFFF;
for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
- gUnknown_03006298[i] = 0xFFFF;
+ gFrontierTempParty[i] = 0xFFFF;
SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1);
gTrainerBattleOpponent_A = 0;
@@ -356,7 +355,7 @@ static void GenerateOpponentMons(void)
species[i] = gFacilityTrainerMons[monId].species;
heldItems[i] = gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId];
- gUnknown_03006298[i] = monId;
+ gFrontierTempParty[i] = monId;
i++;
}
}
@@ -377,11 +376,11 @@ static void SetRentalsToOpponentParty(void)
for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
{
- gSaveBlock2Ptr->frontier.rentalMons[i + 3].monId = gUnknown_03006298[i];
+ gSaveBlock2Ptr->frontier.rentalMons[i + 3].monId = gFrontierTempParty[i];
gSaveBlock2Ptr->frontier.rentalMons[i + 3].ivs = GetBoxMonData(&gEnemyParty[i].box, MON_DATA_ATK_IV, NULL);
gSaveBlock2Ptr->frontier.rentalMons[i + 3].personality = GetMonData(&gEnemyParty[i], MON_DATA_PERSONALITY, NULL);
gSaveBlock2Ptr->frontier.rentalMons[i + 3].abilityNum = GetBoxMonData(&gEnemyParty[i].box, MON_DATA_ABILITY_NUM, NULL);
- SetMonData(&gEnemyParty[i], MON_DATA_HELD_ITEM, &gBattleFrontierHeldItems[gFacilityTrainerMons[gUnknown_03006298[i]].itemTableId]);
+ SetMonData(&gEnemyParty[i], MON_DATA_HELD_ITEM, &gBattleFrontierHeldItems[gFacilityTrainerMons[gFrontierTempParty[i]].itemTableId]);
}
}
@@ -596,7 +595,7 @@ static void GetOpponentMostCommonMonType(void)
typesCount[i] = 0;
for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
{
- u32 species = gFacilityTrainerMons[gUnknown_03006298[i]].species;
+ u32 species = gFacilityTrainerMons[gFrontierTempParty[i]].species;
typesCount[gBaseStats[species].type1]++;
if (gBaseStats[species].type1 != gBaseStats[species].type2)
@@ -632,7 +631,7 @@ static void GetOpponentBattleStyle(void)
for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
{
- u16 monId = gUnknown_03006298[i];
+ u16 monId = gFrontierTempParty[i];
for (j = 0; j < MAX_MON_MOVES; j++)
{
u8 battleStyle = GetMoveBattleStyle(gFacilityTrainerMons[monId].moves[j]);
diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c
index 83818798a..41cffec3d 100644
--- a/src/battle_gfx_sfx_util.c
+++ b/src/battle_gfx_sfx_util.c
@@ -17,7 +17,6 @@
#include "sound.h"
#include "party_menu.h"
#include "m4a.h"
-#include "constants/species.h"
#include "decompress.h"
#include "data.h"
#include "palette.h"
diff --git a/src/battle_interface.c b/src/battle_interface.c
index 719af6a06..adbef019d 100644
--- a/src/battle_interface.c
+++ b/src/battle_interface.c
@@ -15,7 +15,6 @@
#include "util.h"
#include "gpu_regs.h"
#include "battle_message.h"
-#include "constants/species.h"
#include "pokedex.h"
#include "palette.h"
#include "international_string_util.h"
diff --git a/src/battle_main.c b/src/battle_main.c
index 11ed29ac8..ec4c651f0 100644
--- a/src/battle_main.c
+++ b/src/battle_main.c
@@ -58,7 +58,6 @@
#include "constants/party_menu.h"
#include "constants/rgb.h"
#include "constants/songs.h"
-#include "constants/species.h"
#include "constants/trainers.h"
#include "cable_club.h"
diff --git a/src/battle_pike.c b/src/battle_pike.c
index 6b31419a5..a161b88b8 100644
--- a/src/battle_pike.c
+++ b/src/battle_pike.c
@@ -21,7 +21,6 @@
#include "constants/layouts.h"
#include "constants/rgb.h"
#include "constants/trainers.h"
-#include "constants/species.h"
#include "constants/moves.h"
#include "constants/party_menu.h"
#include "constants/battle_pike.h"
diff --git a/src/battle_pyramid.c b/src/battle_pyramid.c
index b015f3e0e..1b220f145 100644
--- a/src/battle_pyramid.c
+++ b/src/battle_pyramid.c
@@ -35,7 +35,6 @@
#include "constants/layouts.h"
#include "constants/maps.h"
#include "constants/moves.h"
-#include "constants/species.h"
#include "constants/trainers.h"
extern const struct MapLayout *const gMapLayouts[];
diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c
index a16cfff3b..690b26d49 100644
--- a/src/battle_script_commands.c
+++ b/src/battle_script_commands.c
@@ -16,7 +16,6 @@
#include "random.h"
#include "battle_controllers.h"
#include "battle_interface.h"
-#include "constants/species.h"
#include "constants/songs.h"
#include "constants/trainers.h"
#include "constants/battle_anim.h"
diff --git a/src/battle_setup.c b/src/battle_setup.c
index 3c20d9ffe..7b9d13980 100644
--- a/src/battle_setup.c
+++ b/src/battle_setup.c
@@ -44,7 +44,6 @@
#include "constants/songs.h"
#include "constants/map_types.h"
#include "constants/maps.h"
-#include "constants/species.h"
#include "constants/trainers.h"
#include "constants/trainer_hill.h"
diff --git a/src/battle_tent.c b/src/battle_tent.c
index 0a03fc167..de0ecea98 100644
--- a/src/battle_tent.c
+++ b/src/battle_tent.c
@@ -17,7 +17,6 @@
#include "constants/items.h"
#include "constants/layouts.h"
#include "constants/region_map_sections.h"
-#include "constants/species.h"
#include "constants/trainers.h"
// This file's functions.
@@ -421,7 +420,7 @@ static void GenerateOpponentMons(void)
species[i] = gFacilityTrainerMons[sRandMonSetId].species;
heldItems[i] = gBattleFrontierHeldItems[gFacilityTrainerMons[sRandMonSetId].itemTableId];
- gUnknown_03006298[i] = sRandMonSetId;
+ gFrontierTempParty[i] = sRandMonSetId;
i++;
}
}
diff --git a/src/battle_tower.c b/src/battle_tower.c
index 9d632b444..b7d03a5bc 100644
--- a/src/battle_tower.c
+++ b/src/battle_tower.c
@@ -35,7 +35,6 @@
#include "constants/trainers.h"
#include "constants/event_objects.h"
#include "constants/moves.h"
-#include "constants/species.h"
#include "constants/easy_chat.h"
#include "constants/tv.h"
@@ -47,7 +46,7 @@ EWRAM_DATA const struct BattleFrontierTrainer *gFacilityTrainers = NULL;
EWRAM_DATA const struct FacilityMon *gFacilityTrainerMons = NULL;
// IWRAM common
-u16 gUnknown_03006298[MAX_FRONTIER_PARTY_SIZE];
+u16 gFrontierTempParty[MAX_FRONTIER_PARTY_SIZE];
// This file's functions.
static void InitTowerChallenge(void);
@@ -1857,7 +1856,7 @@ static void FillFactoryFrontierTrainerParty(u16 trainerId, u8 firstMonId)
otID = T1_READ_32(gSaveBlock2Ptr->playerTrainerId);
for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
{
- u16 monId = gUnknown_03006298[i];
+ u16 monId = gFrontierTempParty[i];
CreateMonWithEVSpreadNatureOTID(&gEnemyParty[firstMonId + i],
gFacilityTrainerMons[monId].species,
level,
@@ -1885,7 +1884,7 @@ static void FillFactoryTentTrainerParty(u16 trainerId, u8 firstMonId)
for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
{
- u16 monId = gUnknown_03006298[i];
+ u16 monId = gFrontierTempParty[i];
CreateMonWithEVSpreadNatureOTID(&gEnemyParty[firstMonId + i],
gFacilityTrainerMons[monId].species,
level,
@@ -2225,11 +2224,11 @@ static void GetApprenticeMultiPartnerParty(u16 trainerId)
}
}
- gUnknown_03006298[0] = validSpecies[Random() % count];
+ gFrontierTempParty[0] = validSpecies[Random() % count];
do
{
- gUnknown_03006298[1] = validSpecies[Random() % count];
- } while (gUnknown_03006298[0] == gUnknown_03006298[1]);
+ gFrontierTempParty[1] = validSpecies[Random() % count];
+ } while (gFrontierTempParty[0] == gFrontierTempParty[1]);
}
static void GetRecordMixFriendMultiPartnerParty(u16 trainerId)
@@ -2253,11 +2252,11 @@ static void GetRecordMixFriendMultiPartnerParty(u16 trainerId)
}
}
- gUnknown_03006298[2] = validSpecies[Random() % count];
+ gFrontierTempParty[2] = validSpecies[Random() % count];
do
{
- gUnknown_03006298[3] = validSpecies[Random() % count];
- } while (gUnknown_03006298[2] == gUnknown_03006298[3]);
+ gFrontierTempParty[3] = validSpecies[Random() % count];
+ } while (gFrontierTempParty[2] == gFrontierTempParty[3]);
}
static void LoadMultiPartnerCandidatesData(void)
@@ -2421,15 +2420,15 @@ static void sub_81646BC(u16 trainerId, u16 monId)
}
else if (trainerId < TRAINER_RECORD_MIXING_APPRENTICE)
{
- move = gSaveBlock2Ptr->frontier.towerRecords[trainerId - TRAINER_RECORD_MIXING_FRIEND].party[gUnknown_03006298[gSpecialVar_0x8005 + 1]].moves[0];
- species = gSaveBlock2Ptr->frontier.towerRecords[trainerId - TRAINER_RECORD_MIXING_FRIEND].party[gUnknown_03006298[gSpecialVar_0x8005 + 1]].species;
+ move = gSaveBlock2Ptr->frontier.towerRecords[trainerId - TRAINER_RECORD_MIXING_FRIEND].party[gFrontierTempParty[gSpecialVar_0x8005 + 1]].moves[0];
+ species = gSaveBlock2Ptr->frontier.towerRecords[trainerId - TRAINER_RECORD_MIXING_FRIEND].party[gFrontierTempParty[gSpecialVar_0x8005 + 1]].species;
}
else
{
s32 i;
- move = gSaveBlock2Ptr->apprentices[trainerId - TRAINER_RECORD_MIXING_APPRENTICE].party[gUnknown_03006298[gSpecialVar_0x8005 - 1]].moves[0];
- species = gSaveBlock2Ptr->apprentices[trainerId - TRAINER_RECORD_MIXING_APPRENTICE].party[gUnknown_03006298[gSpecialVar_0x8005 - 1]].species;
+ move = gSaveBlock2Ptr->apprentices[trainerId - TRAINER_RECORD_MIXING_APPRENTICE].party[gFrontierTempParty[gSpecialVar_0x8005 - 1]].moves[0];
+ species = gSaveBlock2Ptr->apprentices[trainerId - TRAINER_RECORD_MIXING_APPRENTICE].party[gFrontierTempParty[gSpecialVar_0x8005 - 1]].species;
for (i = 0; i < PLAYER_NAME_LENGTH; i++)
gStringVar3[i] = gSaveBlock2Ptr->apprentices[trainerId - TRAINER_RECORD_MIXING_APPRENTICE].playerName[i];
gStringVar3[i] = EOS;
@@ -2498,13 +2497,13 @@ static void ShowPartnerCandidateMessage(void)
}
else if (trainerId < TRAINER_RECORD_MIXING_APPRENTICE)
{
- gSaveBlock2Ptr->frontier.trainerIds[18] = gUnknown_03006298[2];
- gSaveBlock2Ptr->frontier.trainerIds[19] = gUnknown_03006298[3];
+ gSaveBlock2Ptr->frontier.trainerIds[18] = gFrontierTempParty[2];
+ gSaveBlock2Ptr->frontier.trainerIds[19] = gFrontierTempParty[3];
}
else
{
- gSaveBlock2Ptr->frontier.trainerIds[18] = gUnknown_03006298[0];
- gSaveBlock2Ptr->frontier.trainerIds[19] = gUnknown_03006298[1];
+ gSaveBlock2Ptr->frontier.trainerIds[18] = gFrontierTempParty[0];
+ gSaveBlock2Ptr->frontier.trainerIds[19] = gFrontierTempParty[1];
}
for (k = 0; k < 14; k++)
{
diff --git a/src/battle_tv.c b/src/battle_tv.c
index b83999c14..7e311fdab 100644
--- a/src/battle_tv.c
+++ b/src/battle_tv.c
@@ -6,7 +6,6 @@
#include "constants/battle_string_ids.h"
#include "constants/battle_anim.h"
#include "constants/moves.h"
-#include "constants/species.h"
#include "battle_message.h"
#include "tv.h"
diff --git a/src/battle_util.c b/src/battle_util.c
index db9903d33..7025f0e3f 100644
--- a/src/battle_util.c
+++ b/src/battle_util.c
@@ -536,6 +536,8 @@ void HandleAction_ThrowPokeblock(void)
gBattleStruct->safariPkblThrowCounter++;
if (gBattleStruct->safariEscapeFactor > 1)
{
+ // BUG: The safariEscapeFactor is unintetionally able to become 0 (but it can not become negative!). This causes the pokeblock throw glitch.
+ // To fix that change the < in the if statement below to <=.
if (gBattleStruct->safariEscapeFactor < sPkblToEscapeFactor[gBattleStruct->safariPkblThrowCounter][gBattleCommunication[MULTISTRING_CHOOSER]])
gBattleStruct->safariEscapeFactor = 1;
else
diff --git a/src/birch_pc.c b/src/birch_pc.c
index 5b574b05d..1f0ab2349 100644
--- a/src/birch_pc.c
+++ b/src/birch_pc.c
@@ -2,7 +2,6 @@
#include "event_data.h"
#include "field_message_box.h"
#include "pokedex.h"
-#include "constants/species.h"
#include "strings.h"
bool16 ScriptGetPokedexInfo(void)
diff --git a/src/braille_puzzles.c b/src/braille_puzzles.c
index a1ea44e26..aa6664f35 100644
--- a/src/braille_puzzles.c
+++ b/src/braille_puzzles.c
@@ -8,7 +8,6 @@
#include "constants/field_effects.h"
#include "constants/maps.h"
#include "constants/songs.h"
-#include "constants/species.h"
#include "constants/metatile_labels.h"
#include "fieldmap.h"
#include "party_menu.h"
diff --git a/src/contest.c b/src/contest.c
index 198e68dd3..b961e6e1b 100644
--- a/src/contest.c
+++ b/src/contest.c
@@ -42,7 +42,6 @@
#include "constants/moves.h"
#include "constants/rgb.h"
#include "constants/songs.h"
-#include "constants/species.h"
#include "constants/tv.h"
// This file's functions.
@@ -951,39 +950,39 @@ const struct SpriteTemplate sSpriteTemplates_ContestantsTurnBlinkEffect[CONTESTA
static const s8 gContestExcitementTable[CONTEST_CATEGORIES_COUNT][CONTEST_CATEGORIES_COUNT] =
{
- [CONTEST_CATEGORY_COOL] = {
- [CONTEST_CATEGORY_COOL] = +1,
- [CONTEST_CATEGORY_BEAUTY] = 0,
- [CONTEST_CATEGORY_CUTE] = -1,
- [CONTEST_CATEGORY_SMART] = -1,
+ [CONTEST_CATEGORY_COOL] = {
+ [CONTEST_CATEGORY_COOL] = +1,
+ [CONTEST_CATEGORY_BEAUTY] = 0,
+ [CONTEST_CATEGORY_CUTE] = -1,
+ [CONTEST_CATEGORY_SMART] = -1,
[CONTEST_CATEGORY_TOUGH] = 0
},
- [CONTEST_CATEGORY_BEAUTY] = {
- [CONTEST_CATEGORY_COOL] = 0,
- [CONTEST_CATEGORY_BEAUTY] = +1,
- [CONTEST_CATEGORY_CUTE] = 0,
- [CONTEST_CATEGORY_SMART] = -1,
+ [CONTEST_CATEGORY_BEAUTY] = {
+ [CONTEST_CATEGORY_COOL] = 0,
+ [CONTEST_CATEGORY_BEAUTY] = +1,
+ [CONTEST_CATEGORY_CUTE] = 0,
+ [CONTEST_CATEGORY_SMART] = -1,
[CONTEST_CATEGORY_TOUGH] = -1
},
[CONTEST_CATEGORY_CUTE] = {
- [CONTEST_CATEGORY_COOL] = -1,
- [CONTEST_CATEGORY_BEAUTY] = 0,
- [CONTEST_CATEGORY_CUTE] = +1,
- [CONTEST_CATEGORY_SMART] = 0,
+ [CONTEST_CATEGORY_COOL] = -1,
+ [CONTEST_CATEGORY_BEAUTY] = 0,
+ [CONTEST_CATEGORY_CUTE] = +1,
+ [CONTEST_CATEGORY_SMART] = 0,
[CONTEST_CATEGORY_TOUGH] = -1
},
[CONTEST_CATEGORY_SMART] = {
- [CONTEST_CATEGORY_COOL] = -1,
- [CONTEST_CATEGORY_BEAUTY] = -1,
- [CONTEST_CATEGORY_CUTE] = 0,
- [CONTEST_CATEGORY_SMART] = +1,
+ [CONTEST_CATEGORY_COOL] = -1,
+ [CONTEST_CATEGORY_BEAUTY] = -1,
+ [CONTEST_CATEGORY_CUTE] = 0,
+ [CONTEST_CATEGORY_SMART] = +1,
[CONTEST_CATEGORY_TOUGH] = 0
},
- [CONTEST_CATEGORY_TOUGH] = {
- [CONTEST_CATEGORY_COOL] = 0,
- [CONTEST_CATEGORY_BEAUTY] = -1,
- [CONTEST_CATEGORY_CUTE] = -1,
- [CONTEST_CATEGORY_SMART] = 0,
+ [CONTEST_CATEGORY_TOUGH] = {
+ [CONTEST_CATEGORY_COOL] = 0,
+ [CONTEST_CATEGORY_BEAUTY] = -1,
+ [CONTEST_CATEGORY_CUTE] = -1,
+ [CONTEST_CATEGORY_SMART] = 0,
[CONTEST_CATEGORY_TOUGH] = +1
}
};
@@ -999,8 +998,6 @@ void ResetLinkContestBoolean(void)
static void SetupContestGpuRegs(void)
{
- u16 savedIme;
-
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_1D_MAP);
SetGpuReg(REG_OFFSET_BLDCNT, 0);
SetGpuReg(REG_OFFSET_BLDALPHA, 0);
@@ -6101,4 +6098,3 @@ void StripPlayerAndMonNamesForLinkContest(struct ContestPokemon *mon, s32 langua
}
}
-
diff --git a/src/credits.c b/src/credits.c
index 5f331097b..97d1e2b2f 100644
--- a/src/credits.c
+++ b/src/credits.c
@@ -22,7 +22,6 @@
#include "pokedex.h"
#include "event_data.h"
#include "random.h"
-#include "constants/species.h"
enum
{
diff --git a/src/data.c b/src/data.c
index 8d6640223..29d1835ac 100644
--- a/src/data.c
+++ b/src/data.c
@@ -5,7 +5,6 @@
#include "graphics.h"
#include "constants/items.h"
#include "constants/moves.h"
-#include "constants/species.h"
#include "constants/trainers.h"
#include "constants/battle_ai.h"
diff --git a/src/data/bard_music/pokemon.h b/src/data/bard_music/pokemon.h
index 112a5870b..5ccf2f830 100644
--- a/src/data/bard_music/pokemon.h
+++ b/src/data/bard_music/pokemon.h
@@ -1,6 +1,5 @@
#ifndef GUARD_DATA_BARD_MUSIC_POKEMON_H
#define GUARD_DATA_BARD_MUSIC_POKEMON_H
-#include "constants/species.h"
const u16 gNumSpeciesNames = NUM_SPECIES;
diff --git a/src/data/battle_frontier/trainer_hill.h b/src/data/battle_frontier/trainer_hill.h
index cfd5dd994..1b41024d0 100644
--- a/src/data/battle_frontier/trainer_hill.h
+++ b/src/data/battle_frontier/trainer_hill.h
@@ -1,5 +1,11 @@
#define TRAINER_HILL_OTID 0x10000000
+// NOTE: Each of these macros turn data into one byte. Therefore ranges for all arguments is 0-15
+// See struct TrHillDisplay for more info about each
+#define COORDS_XY(x,y) ((y<<4)|(x))
+#define TRAINER_DIRS(a, b) (((a-1)<<4)|(b-1))
+#define TRAINER_RANGE(a, b) ((a<<4)|(b))
+
static const struct TrHillTag sDataTagJPDefault = {
.numTrainers = NUM_TRAINER_HILL_TRAINERS_JP,
.unused1 = 1,
@@ -187,11 +193,28 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = {
},
},
.display = {
- .data = { 0x31, 0x35, 0x35, 0x3b, 0x26, 0x26, 0x1b, 0x1c, 0x1d, 0x25, 0x39, 0x3a, 0x3b, 0x3b, 0x3b, 0x8, 0x31, 0x2b, 0x2b, 0x3b, 0x34, 0x34, 0x2b, 0x2b, 0x34, 0x33, 0x3f, 0x3f, 0x3f, 0x3f, 0x3b, 0x8, 0x31, 0x2b, 0x2b, 0x3b, 0x3b, 0x3b, 0x34, 0x34, 0x3b, 0x33, 0x3f, 0x3f, 0x3f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8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8 },
- .unk3A0 = { 0x381, 0x6fc1, 0x6341, 0x6041, 0x7f41, 0x4401, 0x5541, 0x5541, 0x11c1, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff },
- .coords = { 0x28, 0x78 },
- .direction = 0x1,
- .range = 0x23
+ .metatileData = {
+ 0x31, 0x35, 0x35, 0x3b, 0x26, 0x26, 0x1b, 0x1c, 0x1d, 0x25, 0x39, 0x3a, 0x3b, 0x3b, 0x3b, 0x08,
+ 0x31, 0x2b, 0x2b, 0x3b, 0x34, 0x34, 0x2b, 0x2b, 0x34, 0x33, 0x3f, 0x3f, 0x3f, 0x3f, 0x3b, 0x08,
+ 0x31, 0x2b, 0x2b, 0x3b, 0x3b, 0x3b, 0x34, 0x34, 0x3b, 0x33, 0x3f, 0x3f, 0x3f, 0x3b, 0x3b, 0x08,
+ 0x31, 0x2b, 0x2b, 0x35, 0x35, 0x35, 0x35, 0x35, 0x3b, 0x33, 0x3f, 0x3f, 0x3f, 0x3b, 0x3f, 0x08,
+ 0x31, 0x2b, 0x34, 0x34, 0x34, 0x2b, 0x34, 0x34, 0x3b, 0x2c, 0x3f, 0x3f, 0x3f, 0x3b, 0x3b, 0x08,
+ 0x31, 0x2b, 0x3b, 0x35, 0x3b, 0x2b, 0x3b, 0x35, 0x3b, 0x35, 0x3b, 0x3f, 0x3f, 0x3f, 0x3b, 0x08,
+ 0x31, 0x2b, 0x3b, 0x2b, 0x3b, 0x2b, 0x3b, 0x2b, 0x3b, 0x2b, 0x3b, 0x3f, 0x3f, 0x3f, 0x3b, 0x08,
+ 0x31, 0x34, 0x3b, 0x2b, 0x3b, 0x34, 0x3b, 0x2b, 0x35, 0x2b, 0x3b, 0x3b, 0x3f, 0x3b, 0x3b, 0x08,
+ 0x31, 0x3b, 0x3b, 0x34, 0x3b, 0x3b, 0x3b, 0x34, 0x34, 0x34, 0x3f, 0x3b, 0x3b, 0x3b, 0x3f, 0x08,
+ 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
+ 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
+ 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
+ 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
+ 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
+ 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
+ 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
+ },
+ .collisionData = { 0x0381, 0x6fc1, 0x6341, 0x6041, 0x7f41, 0x4401, 0x5541, 0x5541, 0x11c1, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff },
+ .coords = { COORDS_XY(8,2), COORDS_XY(8,7) },
+ .direction = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH),
+ .range = TRAINER_RANGE(2, 3)
}
},
[1] = {
@@ -372,11 +395,28 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = {
},
},
.display = {
- .data = { 0x31, 0x3b, 0x35, 0x3b, 0x39, 0x26, 0x1b, 0x1c, 0x1d, 0x25, 0x39, 0x3a, 0x3b, 0x35, 0x3b, 0x8, 0x31, 0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0x1, 0x6ff, 0x7ff, 0x7ff, 0xffff, 0xffff, 0xffff },
+ .coords = { COORDS_XY(7,6), COORDS_XY(7,10) },
+ .direction = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH),
+ .range = TRAINER_RANGE(3, 3)
}
},
};
@@ -686,11 +726,28 @@ static const struct TrHillFloor sDataTagNormal_Floors[] =
},
},
.display = {
- .data = {0x31, 0x3B, 0x35, 0x35, 0x26, 0x26, 0x1B, 0x1C, 0x1D, 0x25, 0x26, 0x3A, 0x3B, 0x35, 0x3B, 0x8, 0x31, 0x3B, 0x2C, 0x2C, 0x2C, 0x2B, 0x24, 0x24, 0x24, 0x24, 0x2C, 0x3B, 0x3B, 0x2C, 0x3B, 0x8, 0x2D, 0x3B, 0x3B, 0x3B, 0x3B, 0x2B, 0x3B, 0x3B, 0x3B, 0x3B, 0x35, 0x3B, 0x35, 0x35, 0x3B, 0x8, 0x33, 0x3B, 0x32, 0x21, 0x30, 0x2B, 0x3B, 0x32, 0x21, 0x30, 0x2B, 0x3B, 0x2C, 0x2B, 0x3B, 0x8, 0x33, 0x35, 0x3B, 0x3B, 0x3B, 0x2C, 0x35, 0x3B, 0x3B, 0x3B, 0x2B, 0x3B, 0x3B, 0x2B, 0x3B, 0x8, 0x34, 0x2C, 0x3B, 0x32, 0x21, 0x30, 0x2B, 0x32, 0x30, 0x3B, 0x2B, 0x32, 0x30, 0x2C, 0x3B, 0x8, 0x31, 0x35, 0x3B, 0x3B, 0x35, 0x3B, 0x2C, 0x3B, 0x3B, 0x35, 0x2C, 0x3B, 0x3B, 0x35, 0x35, 0x8, 0x31, 0x2C, 0x32, 0x30, 0x2B, 0x32, 0x30, 0x35, 0x3B, 0x2B, 0x32, 0x21, 0x30, 0x2C, 0x2C, 0x8, 0x31, 0x35, 0x3B, 0x3B, 0x2B, 0x3B, 0x3B, 0x2B, 0x3B, 0x2C, 0x3B, 0x35, 0x3B, 0x3B, 0x3B, 0x8, 0x31, 0x2C, 0x32, 0x30, 0x2B, 0x32, 0x30, 0x2B, 0x3B, 0x32, 0x30, 0x2B, 0x32, 0x30, 0x3B, 0x8, 0x31, 0x35, 0x35, 0x35, 0x2B, 0x3B, 0x3B, 0x2B, 0x3B, 0x3B, 0x35, 0x2B, 0x3B, 0x35, 0x35, 0x8, 0x31, 0x2B, 0x2C, 0x2C, 0x2C, 0x32, 0x30, 0x2B, 0x32, 0x30, 0x2C, 0x2C, 0x3B, 0x2C, 0x2C, 0x8, 0x31, 0x2B, 0x3B, 0x3B, 0x35, 0x3B, 0x3B, 0x2B, 0x3B, 0x3B, 0x35, 0x3B, 0x3B, 0x3B, 0x3B, 0x8, 0x31, 0x2C, 0x32, 0x30, 0x2B, 0x3B, 0x3B, 0x2C, 0x32, 0x30, 0x2C, 0x32, 0x30, 0x3B, 0x35, 0x8, 0x31, 0x3B, 0x3B, 0x3B, 0x2C, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x2C, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8},
- .unk3A0 = {0x381, 0x3FE5, 0x401, 0xBDED, 0x8425, 0xDFBD, 0x221, 0x7E7F, 0x941, 0x7F7D, 0x911, 0x7FF7, 0x4101, 0x79F9, 0x803, 0xFFFF},
- .coords = {27, 45},
- .direction = 0x21,
- .range = 0x21,
+ .metatileData = {
+ 0x31, 0x3B, 0x35, 0x35, 0x26, 0x26, 0x1B, 0x1C, 0x1D, 0x25, 0x26, 0x3A, 0x3B, 0x35, 0x3B, 0x08,
+ 0x31, 0x3B, 0x2C, 0x2C, 0x2C, 0x2B, 0x24, 0x24, 0x24, 0x24, 0x2C, 0x3B, 0x3B, 0x2C, 0x3B, 0x08,
+ 0x2D, 0x3B, 0x3B, 0x3B, 0x3B, 0x2B, 0x3B, 0x3B, 0x3B, 0x3B, 0x35, 0x3B, 0x35, 0x35, 0x3B,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0x3B, 0x3B, 0x3B, 0x2C, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x2C, 0x08,
+ 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
+ },
+ .collisionData = {0x0381, 0x3FE5, 0x0401, 0xBDED, 0x8425, 0xDFBD, 0x0221, 0x7E7F, 0x0941, 0x7F7D, 0x0911, 0x7FF7, 0x4101, 0x79F9, 0x0803, 0xFFFF},
+ .coords = {COORDS_XY(11,1), COORDS_XY(13,2)},
+ .direction = TRAINER_DIRS(DIR_WEST, DIR_NORTH),
+ .range = TRAINER_RANGE(2, 1),
}
},
[1] =
@@ -991,11 +1048,28 @@ static const struct TrHillFloor sDataTagNormal_Floors[] =
},
},
.display = {
- .data = {0xD1, 0xD5, 0xD5, 0xD5, 0xD9, 0xD9, 0x1B, 0x1C, 0x1D, 0xC5, 0xC6, 0xCE, 0xD5, 0xDB, 0xD5, 0x8, 0xD1, 0xCB, 0xC4, 0xC4, 0xDB, 0xDB, 0xC4, 0xC4, 0xC4, 0xCC, 0xCC, 0xCC, 0xCB, 0xDB, 0xCB, 0x8, 0xD1, 0xCB, 0xDB, 0xDB, 0x17, 0x17, 0x17, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xCB, 0xDB, 0xCB, 0x8, 0xD1, 0xCB, 0xDB, 0xD5, 0x17, 0x17, 0x17, 0xD5, 0xD5, 0xD5, 0xD5, 0xDF, 0xCB, 0xDB, 0xCB, 0x8, 0xD1, 0xCB, 0xDB, 0xCB, 0x17, 0x17, 0x1F, 0xCB, 0xCB, 0xC4, 0xC4, 0xDB, 0xCB, 0xDB, 0xCB, 0x8, 0xD1, 0xCB, 0xDB, 0xCB, 0xDB, 0xDB, 0xC4, 0xCB, 0xCB, 0xDF, 0xD5, 0xD5, 0xCB, 0xDB, 0xCB, 0x8, 0xD1, 0xCB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x08,
+ 0xD1, 0xCB, 0xDB, 0xCB, 0xDB, 0xDB, 0xDB, 0xC4, 0xC4, 0xDB, 0xC4, 0xC4, 0xC4, 0xDB, 0xCB, 0x08,
+ 0xD1, 0xCB, 0xDB, 0xCB, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0xDB, 0xD5, 0xD5, 0xD5, 0xCB, 0x08,
+ 0xD1, 0xC4, 0xDB, 0xCB, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0x9B, 0xDB, 0xCB, 0xCB, 0xCB, 0xCB, 0x08,
+ 0xD1, 0xDB, 0xDB, 0xCB, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0x9B, 0xDB, 0xCB, 0xCB, 0xCB, 0xCB, 0x08,
+ 0xD1, 0xDB, 0xDB, 0xC4, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0x9B, 0xDB, 0xC4, 0xC4, 0xC4, 0xC4, 0x08,
+ 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
+ },
+ .collisionData = {0x0381, 0x73FB, 0x400B, 0x400B, 0x51EB, 0x538B, 0x51BB, 0x518B, 0x51EB, 0x518B, 0x51BB, 0x5003, 0x501F, 0x101F, 0x101F, 0xFFFF},
+ .coords = {COORDS_XY(4,11), COORDS_XY(9,14)},
+ .direction = TRAINER_DIRS(DIR_SOUTH, DIR_EAST),
+ .range = TRAINER_RANGE(3, 5),
}
},
[2] =
@@ -1295,11 +1369,28 @@ static const struct TrHillFloor sDataTagNormal_Floors[] =
},
},
.display = {
- .data = {0x31, 0x35, 0x35, 0x35, 0x26, 0x26, 0x13, 0x14, 0x15, 0x38, 0x26, 0x2E, 0x35, 0x35, 0x3B, 0x8, 0x69, 0x63, 0x64, 0x64, 0x64, 0x64, 0x71, 0x71, 0x71, 0x72, 0x64, 0x64, 0x64, 0x63, 0x73, 0x8, 0x69, 0x63, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x63, 0x73, 0x8, 0x69, 0x63, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x63, 0x73, 0x8, 0x69, 0x63, 0x43, 0x41, 0x40, 0x41, 0x42, 0x41, 0x41, 0x4A, 0x42, 0x41, 0x41, 0x63, 0x73, 0x8, 0x69, 0x63, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x64, 0x73, 0x73, 0x73, 0x63, 0x73, 0x8, 0x69, 0x63, 0x41, 0x43, 0x4B, 0x43, 0x43, 0x41, 0x42, 0x42, 0x40, 0x41, 0x40, 0x63, 0x73, 0x8, 0x69, 0x63, 0x73, 0x73, 0x64, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x63, 0x73, 0x8, 0x69, 0x63, 0x41, 0x40, 0x42, 0x42, 0x41, 0x41, 0x42, 0x4A, 0x42, 0x41, 0x42, 0x63, 0x73, 0x8, 0x69, 0x63, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x64, 0x73, 0x73, 0x73, 0x63, 0x73, 0x8, 0x69, 0x63, 0x41, 0x42, 0x41, 0x43, 0x4B, 0x41, 0x41, 0x41, 0x40, 0x43, 0x41, 0x63, 0x73, 0x8, 0x69, 0x63, 0x73, 0x73, 0x73, 0x73, 0x64, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x63, 0x73, 0x8, 0x69, 0x63, 0x41, 0x40, 0x43, 0x41, 0x42, 0x42, 0x41, 0x4A, 0x42, 0x41, 0x42, 0x63, 0x73, 0x8, 0x69, 0x64, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x64, 0x73, 0x73, 0x73, 0x64, 0x73, 0x8, 0x69, 0x43, 0x43, 0x41, 0x42, 0x42, 0x41, 0x43, 0x41, 0x41, 0x40, 0x42, 0x41, 0x42, 0x73, 0x8, 0x69, 0x42, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x42, 0x73, 0x8},
- .unk3A0 = {0x381, 0x7C3D, 0x4005, 0x4005, 0x4005, 0x4045, 0x4005, 0x4805, 0x4005, 0x4045, 0x4005, 0x4205, 0x4005, 0x4045, 0x1, 0x1},
- .coords = {37, 41},
- .direction = 0x23,
- .range = 0x33,
+ .metatileData = {
+ 0x31, 0x35, 0x35, 0x35, 0x26, 0x26, 0x13, 0x14, 0x15, 0x38, 0x26, 0x2E, 0x35, 0x35, 0x3B, 0x08,
+ 0x69, 0x63, 0x64, 0x64, 0x64, 0x64, 0x71, 0x71, 0x71, 0x72, 0x64, 0x64, 0x64, 0x63, 0x73, 0x08,
+ 0x69, 0x63, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x63, 0x73, 0x08,
+ 0x69, 0x63, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x63, 0x73, 0x08,
+ 0x69, 0x63, 0x43, 0x41, 0x40, 0x41, 0x42, 0x41, 0x41, 0x4A, 0x42, 0x41, 0x41, 0x63, 0x73, 0x08,
+ 0x69, 0x63, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x64, 0x73, 0x73, 0x73, 0x63, 0x73, 0x08,
+ 0x69, 0x63, 0x41, 0x43, 0x4B, 0x43, 0x43, 0x41, 0x42, 0x42, 0x40, 0x41, 0x40, 0x63, 0x73, 0x08,
+ 0x69, 0x63, 0x73, 0x73, 0x64, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x63, 0x73, 0x08,
+ 0x69, 0x63, 0x41, 0x40, 0x42, 0x42, 0x41, 0x41, 0x42, 0x4A, 0x42, 0x41, 0x42, 0x63, 0x73, 0x08,
+ 0x69, 0x63, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x64, 0x73, 0x73, 0x73, 0x63, 0x73, 0x08,
+ 0x69, 0x63, 0x41, 0x42, 0x41, 0x43, 0x4B, 0x41, 0x41, 0x41, 0x40, 0x43, 0x41, 0x63, 0x73, 0x08,
+ 0x69, 0x63, 0x73, 0x73, 0x73, 0x73, 0x64, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x63, 0x73, 0x08,
+ 0x69, 0x63, 0x41, 0x40, 0x43, 0x41, 0x42, 0x42, 0x41, 0x4A, 0x42, 0x41, 0x42, 0x63, 0x73, 0x08,
+ 0x69, 0x64, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x64, 0x73, 0x73, 0x73, 0x64, 0x73, 0x08,
+ 0x69, 0x43, 0x43, 0x41, 0x42, 0x42, 0x41, 0x43, 0x41, 0x41, 0x40, 0x42, 0x41, 0x42, 0x73, 0x08,
+ 0x69, 0x42, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x42, 0x73, 0x08,
+ },
+ .collisionData = {0x0381, 0x7C3D, 0x4005, 0x4005, 0x4005, 0x4045, 0x4005, 0x4805, 0x4005, 0x4045, 0x4005, 0x4205, 0x4005, 0x4045, 0x1, 0x1},
+ .coords = {COORDS_XY(5,2), COORDS_XY(9,2)},
+ .direction = TRAINER_DIRS(DIR_WEST, DIR_EAST),
+ .range = TRAINER_RANGE(3, 3),
}
},
[3] =
@@ -1592,11 +1683,28 @@ static const struct TrHillFloor sDataTagNormal_Floors[] =
},
},
.display = {
- .data = {0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x26, 0x1B, 0x1C, 0x1D, 0x25, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x8, 0x1F, 0x17, 0x17, 0x17, 0x17, 0x2B, 0x24, 0x24, 0x24, 0x2B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x8, 0x33, 0x17, 0x17, 0x17, 0x17, 0x2B,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x17, 0x17, 0x17, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x17, 0x17, 0x17, 0x17, 0x17, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8},
- .unk3A0 = {0x381, 0x7C1, 0x8441, 0x8477, 0x8441, 0xA441, 0x401, 0x1, 0x8401, 0x8465, 0x445, 0x1441, 0x8449, 0x8449, 0x87C1, 0xFFFF},
- .coords = {71, 167},
- .direction = 0x1,
- .range = 0x33,
+ .metatileData = {
+ 0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x26, 0x1B, 0x1C, 0x1D, 0x25, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x08,
+ 0x1F, 0x17, 0x17, 0x17, 0x17, 0x2B, 0x24, 0x24, 0x24, 0x2B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x08,
+ 0x33, 0x17, 0x17, 0x17, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x2B, 0x35, 0x35, 0x3B, 0x35, 0x35, 0x08,
+ 0x33, 0x17, 0x17, 0x17, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x2B, 0x2C, 0x2C, 0x3B, 0x2C, 0x2C, 0x08,
+ 0x33, 0x17, 0x1F, 0x17, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x2B, 0x17, 0x17, 0x17, 0x17, 0x17, 0x08,
+ 0x34, 0x17, 0x2C, 0x17, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x2C, 0x17, 0x17, 0x17, 0x17, 0x17, 0x08,
+ 0x17, 0x17, 0x17, 0x17, 0x17, 0x2C, 0x3B, 0x3B, 0x3B, 0x3B, 0x17, 0x17, 0x17, 0x17, 0x17, 0x08,
+ 0x1F, 0x17, 0x17, 0x17, 0x17, 0x1F, 0x17, 0x3B, 0x3B, 0x3B, 0x17, 0x17, 0x17, 0x17, 0x17, 0x08,
+ 0x33, 0x17, 0x17, 0x17, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x35, 0x1F, 0x17, 0x17, 0x1F, 0x17, 0x08,
+ 0x34, 0x17, 0x17, 0x17, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x2B, 0x2C, 0x3B, 0x3B, 0x2B, 0x17, 0x08,
+ 0x17, 0x17, 0x17, 0x1F, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x2B, 0x17, 0x17, 0x17, 0x2C, 0x17, 0x08,
+ 0x1F, 0x17, 0x17, 0x2C, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x2B, 0x17, 0x3B, 0x1F, 0x3B, 0x17, 0x08,
+ 0x33, 0x17, 0x17, 0x17, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x2B, 0x17, 0x3B, 0x2B, 0x3B, 0x17, 0x08,
+ 0x33, 0x17, 0x17, 0x17, 0x17, 0x2B, 0x35, 0x35, 0x35, 0x2B, 0x17, 0x3B, 0x2C, 0x3B, 0x17, 0x08,
+ 0x34, 0x17, 0x17, 0x17, 0x17, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x17, 0x17, 0x17, 0x17, 0x17, 0x08,
+ 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
+ },
+ .collisionData = {0x0381, 0x7C1, 0x8441, 0x8477, 0x8441, 0xA441, 0x0401, 0x1, 0x8401, 0x8465, 0x0445, 0x1441, 0x8449, 0x8449, 0x87C1, 0xFFFF},
+ .coords = {COORDS_XY(7,4), COORDS_XY(7,10)},
+ .direction = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH),
+ .range = TRAINER_RANGE(3, 3),
}
},
};
@@ -1896,11 +2004,28 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = {
},
},
.display = {
- .data = {0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x8, 0x40, 0x41, 0x41, 0x41, 0x41, 0x41, 0x42, 0x43, 0x43, 0x43, 0x43, 0x43, 0x40, 0x41, 0x41, 0x8, 0x40, 0xFB, 0x43, 0x41, 0x41, 0x41, 0x42, 0x40, 0x43, 0x41, 0x42, 0x42, 0x42, 0xFB, 0x41, 0x8, 0x40, 0x41, 0xFB, 0x41, 0x41, 0x41, 0x42, 0x40, 0x43, 0x41, 0x43, 0x43, 0xFB, 0x40, 0x41, 0x8, 0x40, 0x41, 0x41, 0xFB, 0x43, 0x41, 0x42, 0x40, 0x43, 0x43, 0x43, 0xFB, 0x41, 0x40, 0x41, 0x8, 0x40, 0x41, 0x41, 0x41, 0x42, 0x42, 0x42, 0x40, 0x43, 0x43, 0x43, 0x41, 0x41, 0x40, 0x41, 0x8, 0x40, 0x41, 0x41, 0x41, 0xFE, 0xFE, 0xFE, 0xFB, 0xFE, 0xFE, 0xFE, 0x41, 0x41, 0x40, 0x41, 0x8, 0x40, 0x41, 0x41, 0x41, 0xFE, 0xFE, 0xFE, 0xFB, 0xFE, 0xFE, 0xFE, 0x41, 0x41, 0x40, 0x41, 0x8, 0x40, 0x41, 0x42, 0x41, 0xFE, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFE, 0x41, 0x41, 0x40, 0x41, 0x8, 0x40, 0x41, 0x41, 0x41, 0xFE, 0xFE, 0xFE, 0xFB, 0xFE, 0xFE, 0xFE, 0x41, 0x41, 0x40, 0x41, 0x8, 0x40, 0x41, 0x41, 0x41, 0xFE, 0xFE, 0xFE, 0xFB, 0xFE, 0xFE, 0xFE, 0x41, 0x41, 0x40, 0x41, 0x8, 0x40, 0x42, 0x41, 0x43, 0x43, 0x43, 0x41, 0x40, 0x42, 0x42, 0x42, 0x42, 0x41, 0x40, 0x41, 0x8, 0x40, 0x40, 0x41, 0xFB, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0xFB, 0x41, 0x40, 0x41, 0x8, 0x40, 0x40, 0xFB, 0x43, 0x43, 0x41, 0x41, 0x41, 0x42, 0x42, 0x42, 0x42, 0xFB, 0x40, 0x41, 0x8, 0x40, 0xFB, 0x43, 0x43, 0x41, 0x41, 0x43, 0x43, 0x43, 0x43, 0x43, 0x43, 0x43, 0xFB, 0x41, 0x8, 0x40, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x8},
- .unk3A0 = {0x381, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1},
- .coords = {133, 137},
- .direction = 0x23,
- .range = 0x33,
+ .metatileData = {
+ 0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x08,
+ 0x40, 0x41, 0x41, 0x41, 0x41, 0x41, 0x42, 0x43, 0x43, 0x43, 0x43, 0x43, 0x40, 0x41, 0x41, 0x08,
+ 0x40, 0xFB, 0x43, 0x41, 0x41, 0x41, 0x42, 0x40, 0x43, 0x41, 0x42, 0x42, 0x42, 0xFB, 0x41, 0x08,
+ 0x40, 0x41, 0xFB, 0x41, 0x41, 0x41, 0x42, 0x40, 0x43, 0x41, 0x43, 0x43, 0xFB, 0x40, 0x41, 0x08,
+ 0x40, 0x41, 0x41, 0xFB, 0x43, 0x41, 0x42, 0x40, 0x43, 0x43, 0x43, 0xFB, 0x41, 0x40, 0x41, 0x08,
+ 0x40, 0x41, 0x41, 0x41, 0x42, 0x42, 0x42, 0x40, 0x43, 0x43, 0x43, 0x41, 0x41, 0x40, 0x41, 0x08,
+ 0x40, 0x41, 0x41, 0x41, 0xFE, 0xFE, 0xFE, 0xFB, 0xFE, 0xFE, 0xFE, 0x41, 0x41, 0x40, 0x41, 0x08,
+ 0x40, 0x41, 0x41, 0x41, 0xFE, 0xFE, 0xFE, 0xFB, 0xFE, 0xFE, 0xFE, 0x41, 0x41, 0x40, 0x41, 0x08,
+ 0x40, 0x41, 0x42, 0x41, 0xFE, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFE, 0x41, 0x41, 0x40, 0x41, 0x08,
+ 0x40, 0x41, 0x41, 0x41, 0xFE, 0xFE, 0xFE, 0xFB, 0xFE, 0xFE, 0xFE, 0x41, 0x41, 0x40, 0x41, 0x08,
+ 0x40, 0x41, 0x41, 0x41, 0xFE, 0xFE, 0xFE, 0xFB, 0xFE, 0xFE, 0xFE, 0x41, 0x41, 0x40, 0x41, 0x08,
+ 0x40, 0x42, 0x41, 0x43, 0x43, 0x43, 0x41, 0x40, 0x42, 0x42, 0x42, 0x42, 0x41, 0x40, 0x41, 0x08,
+ 0x40, 0x40, 0x41, 0xFB, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0xFB, 0x41, 0x40, 0x41, 0x08,
+ 0x40, 0x40, 0xFB, 0x43, 0x43, 0x41, 0x41, 0x41, 0x42, 0x42, 0x42, 0x42, 0xFB, 0x40, 0x41, 0x08,
+ 0x40, 0xFB, 0x43, 0x43, 0x41, 0x41, 0x43, 0x43, 0x43, 0x43, 0x43, 0x43, 0x43, 0xFB, 0x41, 0x08,
+ 0x40, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x08,
+ },
+ .collisionData = {0x0381, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1},
+ .coords = {COORDS_XY(5,8), COORDS_XY(9,8)},
+ .direction = TRAINER_DIRS(DIR_WEST, DIR_EAST),
+ .range = TRAINER_RANGE(3, 3),
}
},
[1] =
@@ -2219,11 +2344,28 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = {
},
},
.display = {
- .data = {0x31, 0x3B, 0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 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0xFFFF},
+ .coords = {COORDS_XY(3,8), COORDS_XY(11,8)},
+ .direction = TRAINER_DIRS(DIR_WEST, DIR_EAST),
+ .range = TRAINER_RANGE(7, 7),
}
},
[2] =
@@ -2523,11 +2665,28 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = {
},
},
.display = {
- .data = {0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x1B, 0x1C, 0x1D, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x8, 0x91, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x84, 0x84, 0x84, 0x9A, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x8, 0x17, 0xB2, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xB0, 0x17, 0xB2, 0xA1, 0x8, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x8, 0x17, 0xB2, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xB0, 0x17, 0xB2, 0xA1, 0x8, 0x17, 0x17, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x17, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x17, 0x17, 0x8, 0x17, 0xB2, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xB0, 0x17, 0xB2, 0xA1, 0x8, 0x17, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x8, 0x17, 0xB2, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xB0, 0x17, 0xB2, 0xA1, 0x8, 0x17, 0x17, 0x17, 0x17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1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xB0, 0x17, 0xB2, 0xA1, 0x08,
+ 0x17, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0x17, 0xBB, 0xBB, 0x08,
+ },
+ .collisionData = {0x0381, 0x0381, 0x7FF7, 0x1, 0x7FF7, 0x1, 0x7FF7, 0x1, 0x7FF7, 0x1, 0x7FF7, 0x1, 0x7FF7, 0x1, 0x7FF7, 0x1},
+ .coords = {COORDS_XY(9,1), COORDS_XY(14,1)},
+ .direction = TRAINER_DIRS(DIR_WEST, DIR_EAST),
+ .range = TRAINER_RANGE(4, 4),
}
},
[3] =
@@ -2818,11 +2977,28 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = {
},
},
.display = {
- .data = {0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x8, 0x69, 0x40, 0x6D, 0x41, 0x73, 0x41, 0x5E, 0x41, 0x71, 0x42, 0x45, 0x45, 0x45, 0x45, 0x45, 0x8, 0x43, 0x73, 0x64, 0x73, 0x43, 0x73, 0x64, 0x73, 0x41, 0x73, 0x45, 0x45, 0x45, 0x45, 0x45, 0x8, 0x65, 0x40, 0x73, 0x42, 0x6D, 0x42, 0x73, 0x42, 0x6D, 0x42, 0x45, 0x45, 0x45, 0x45, 0x45, 0x8, 0x6C, 0x73, 0x41, 0x73, 0x64, 0x73, 0x40, 0x73, 0x64, 0x73, 0x40, 0x73, 0x42, 0x73, 0x41, 0x8, 0x69, 0x40, 0x6D, 0x41, 0x73, 0x40, 0x6D, 0x43, 0x73, 0x43, 0x6D, 0x42, 0x73, 0x42, 0x6D, 0x8, 0x40, 0x73, 0x64, 0x73, 0x43, 0x73, 0x64, 0x73, 0x41, 0x73, 0x64, 0x73, 0x41, 0x73, 0x64, 0x8, 0x65, 0x42, 0x73, 0x42, 0x6D, 0x41, 0x73, 0x40, 0x6D, 0x42, 0x73, 0x41, 0x6D, 0x42, 0x73, 0x8, 0x6C, 0x73, 0x41, 0x73, 0x64, 0x73, 0x42, 0x73, 0x64, 0x73, 0x42, 0x73, 0x64, 0x73, 0x42, 0x8, 0x69, 0x40, 0x6D, 0x41, 0x73, 0x41, 0x6D, 0x42, 0x73, 0x43, 0x6D, 0x41, 0x73, 0x43, 0x6D, 0x8, 0x40, 0x73, 0x64, 0x73, 0x43, 0x73, 0x64, 0x73, 0x43, 0x73, 0x64, 0x73, 0x42, 0x73, 0x64, 0x8, 0x65, 0x42, 0x73, 0x42, 0x6D, 0x43, 0x73, 0x42, 0x6D, 0x42, 0x73, 0x41, 0x6D, 0x40, 0x73, 0x8, 0x6C, 0x73, 0x40, 0x73, 0x64, 0x73, 0x41, 0x73, 0x64, 0x73, 0x42, 0x73, 0x64, 0x73, 0x42, 0x8, 0x69, 0x40, 0x6D, 0x42, 0x73, 0x42, 0x6D, 0x43, 0x73, 0x40, 0x6D, 0x41, 0x73, 0x40, 0x6D, 0x8, 0x40, 0x73, 0x64, 0x73, 0x40, 0x73, 0x64, 0x73, 0x40, 0x73, 0x64, 0x73, 0x43, 0x73, 0x64, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8},
- .unk3A0 = {0x381, 0x1, 0x2201, 0x1, 0x8881, 0x1, 0x2223, 0x1, 0x8889, 0x1, 0x2223, 0x1, 0x8889, 0x1, 0x2223, 0xFFFF},
- .coords = {42, 46},
- .direction = 0x23,
- .range = 0x33,
+ .metatileData = {
+ 0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x08,
+ 0x69, 0x40, 0x6D, 0x41, 0x73, 0x41, 0x5E, 0x41, 0x71, 0x42, 0x45, 0x45, 0x45, 0x45, 0x45, 0x08,
+ 0x43, 0x73, 0x64, 0x73, 0x43, 0x73, 0x64, 0x73, 0x41, 0x73, 0x45, 0x45, 0x45, 0x45, 0x45, 0x08,
+ 0x65, 0x40, 0x73, 0x42, 0x6D, 0x42, 0x73, 0x42, 0x6D, 0x42, 0x45, 0x45, 0x45, 0x45, 0x45, 0x08,
+ 0x6C, 0x73, 0x41, 0x73, 0x64, 0x73, 0x40, 0x73, 0x64, 0x73, 0x40, 0x73, 0x42, 0x73, 0x41, 0x08,
+ 0x69, 0x40, 0x6D, 0x41, 0x73, 0x40, 0x6D, 0x43, 0x73, 0x43, 0x6D, 0x42, 0x73, 0x42, 0x6D, 0x08,
+ 0x40, 0x73, 0x64, 0x73, 0x43, 0x73, 0x64, 0x73, 0x41, 0x73, 0x64, 0x73, 0x41, 0x73, 0x64, 0x08,
+ 0x65, 0x42, 0x73, 0x42, 0x6D, 0x41, 0x73, 0x40, 0x6D, 0x42, 0x73, 0x41, 0x6D, 0x42, 0x73, 0x08,
+ 0x6C, 0x73, 0x41, 0x73, 0x64, 0x73, 0x42, 0x73, 0x64, 0x73, 0x42, 0x73, 0x64, 0x73, 0x42, 0x08,
+ 0x69, 0x40, 0x6D, 0x41, 0x73, 0x41, 0x6D, 0x42, 0x73, 0x43, 0x6D, 0x41, 0x73, 0x43, 0x6D, 0x08,
+ 0x40, 0x73, 0x64, 0x73, 0x43, 0x73, 0x64, 0x73, 0x43, 0x73, 0x64, 0x73, 0x42, 0x73, 0x64, 0x08,
+ 0x65, 0x42, 0x73, 0x42, 0x6D, 0x43, 0x73, 0x42, 0x6D, 0x42, 0x73, 0x41, 0x6D, 0x40, 0x73, 0x08,
+ 0x6C, 0x73, 0x40, 0x73, 0x64, 0x73, 0x41, 0x73, 0x64, 0x73, 0x42, 0x73, 0x64, 0x73, 0x42, 0x08,
+ 0x69, 0x40, 0x6D, 0x42, 0x73, 0x42, 0x6D, 0x43, 0x73, 0x40, 0x6D, 0x41, 0x73, 0x40, 0x6D, 0x08,
+ 0x40, 0x73, 0x64, 0x73, 0x40, 0x73, 0x64, 0x73, 0x40, 0x73, 0x64, 0x73, 0x43, 0x73, 0x64, 0x08,
+ 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
+ },
+ .collisionData = {0x0381, 0x1, 0x2201, 0x1, 0x8881, 0x1, 0x2223, 0x1, 0x8889, 0x1, 0x2223, 0x1, 0x8889, 0x1, 0x2223, 0xFFFF},
+ .coords = {COORDS_XY(10,2), COORDS_XY(14,2)},
+ .direction = TRAINER_DIRS(DIR_WEST, DIR_EAST),
+ .range = TRAINER_RANGE(3, 3),
}
},
};
@@ -3127,11 +3303,28 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = {
},
},
.display = {
- .data = {0xF1, 0xF5, 0xFB, 0xF5, 0xE6, 0xE6, 0x1B, 0x14, 0x15, 0xF8, 0xF9, 0xFA, 0xFB, 0xFB, 0xFB, 0x8, 0xF1, 0xEB, 0xFB, 0xEB, 0xEC, 0xEC, 0xEC, 0xF9, 0xE6, 0xEE, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0x8, 0xF1, 0xEB, 0xFB, 0xEB, 0xFB, 0x9B, 0x9B, 0xFB, 0xEB, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEB, 0x8, 0xF1, 0xEB, 0xFB, 0xEB, 0x9B, 0xDB, 0xDB, 0x9B, 0xEC, 0xFB, 0xF5, 0xF5, 0xF5, 0xFB, 0xEB, 0x8, 0xF1, 0xEB, 0xFB, 0xEB, 0xF5, 0x95, 0x95, 0xF5, 0xF5, 0xF5, 0xEB, 0xEC, 0xEB, 0xFB, 0xEB, 0x8, 0xED, 0xEB, 0xFB, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0x8, 0xF4, 0xEB, 0x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B, 0x08,
+ 0xF1, 0xF5, 0xF5, 0xEB, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xFB, 0xEB, 0xFB, 0x08,
+ 0xF1, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEB, 0xFB, 0xEB, 0xFB, 0x08,
+ 0xF1, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xEB, 0xFB, 0xEB, 0xFB, 0x08,
+ 0xF1, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xFB, 0xEC, 0xFB, 0x08,
+ 0xF1, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0x08,
+ 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
+ },
+ .collisionData = {0x0381, 0x5E01, 0x50FF, 0x5083, 0x503B, 0x5FEB, 0xC02B, 0x5FEB, 0x5009, 0x57FD, 0x1005, 0x7FF5, 0x15, 0x7FF5, 0x1, 0xFFFF},
+ .coords = {COORDS_XY(4,3), COORDS_XY(7,3)},
+ .direction = TRAINER_DIRS(DIR_WEST, DIR_EAST),
+ .range = TRAINER_RANGE(2, 2),
}
},
[1] =
@@ -3431,11 +3624,28 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = {
},
},
.display = {
- .data = {0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x26, 0x1B, 0x1C, 0x1D, 0x25, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x8, 0x2D, 0x3B, 0x3B, 0x3B, 0x35, 0x2C, 0x23, 0x24, 0x23, 0x2C, 0x35, 0x3B, 0x3B, 0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97, 0x9B, 0x97, 0x9B, 0x97, 0x8B, 0x97, 0x9B, 0x8, 0x91, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x8C, 0x9B, 0x9B, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8},
- .unk3A0 = {0x381, 0x7C1, 0x8AA1, 0x209, 0x5557, 0xA281, 0x81, 0x5D6D, 0x2283, 0x89, 0xDD55, 0x20A1, 0xA81, 0x7D5D, 0x9, 0xFFFF},
- .coords = {105, 109},
- .direction = 0x23,
- .range = 0x33,
+ .metatileData = {
+ 0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x26, 0x1B, 0x1C, 0x1D, 0x25, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x08,
+ 0x2D, 0x3B, 0x3B, 0x3B, 0x35, 0x2C, 0x23, 0x24, 0x23, 0x2C, 0x35, 0x3B, 0x3B, 0x3B, 0x3B, 0x08,
+ 0x94, 0x87, 0x9B, 0x87, 0x8C, 0x87, 0x8B, 0x87, 0x8C, 0x87, 0x8C, 0x87, 0x95, 0x87, 0x9B, 0x08,
+ 0x91, 0x8F, 0x9B, 0x8F, 0x9B, 0x8F, 0x8C, 0x8F, 0x9B, 0x8F, 0x9B, 0x8F, 0x8C, 0x8F, 0x95, 0x08,
+ 0x8D, 0x97, 0x95, 0x97, 0x9B, 0x97, 0x95, 0x97, 0x95, 0x97, 0x9B, 0x97, 0x9B, 0x97, 0x8C, 0x08,
+ 0x94, 0x87, 0x8C, 0x87, 0x9B, 0x87, 0x8C, 0x87, 0x8B, 0x87, 0x9B, 0x9B, 0x9B, 0x87, 0x9B, 0x08,
+ 0x91, 0x8F, 0x9B, 0x8F, 0x95, 0x8F, 0x9B, 0x8F, 0x8C, 0x8F, 0x95, 0x9B, 0x95, 0x8F, 0x9B, 0x08,
+ 0x91, 0x97, 0x95, 0x97, 0x8C, 0x97, 0x95, 0x97, 0x95, 0x97, 0x8C, 0x9B, 0x8C, 0x97, 0x95, 0x08,
+ 0x91, 0x87, 0x8C, 0x87, 0x9B, 0x87, 0x8C, 0x87, 0x8B, 0x87, 0x9B, 0x87, 0x95, 0x87, 0x8C, 0x08,
+ 0x8D, 0x8F, 0x9B, 0x8F, 0x95, 0x8F, 0x9B, 0x8F, 0x8C, 0x8F, 0x9B, 0x8F, 0x8C, 0x8F, 0x9B, 0x08,
+ 0x94, 0x97, 0x95, 0x97, 0x8C, 0x97, 0x9B, 0x97, 0x95, 0x97, 0x95, 0x97, 0x9B, 0x97, 0x9B, 0x08,
+ 0x91, 0x87, 0x8C, 0x87, 0x95, 0x87, 0x95, 0x87, 0x8B, 0x87, 0x8C, 0x87, 0x9B, 0x87, 0x9B, 0x08,
+ 0x91, 0x8F, 0x95, 0x8F, 0x8B, 0x8F, 0x8C, 0x8F, 0x8C, 0x8F, 0x9B, 0x8F, 0x95, 0x8F, 0x9B, 0x08,
+ 0x91, 0x97, 0x8C, 0x97, 0x8C, 0x97, 0x9B, 0x97, 0x9B, 0x97, 0x9B, 0x97, 0x8B, 0x97, 0x9B, 0x08,
+ 0x91, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x8C, 0x9B, 0x9B, 0x08,
+ 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
+ },
+ .collisionData = {0x0381, 0x7C1, 0x8AA1, 0x0209, 0x5557, 0xA281, 0x81, 0x5D6D, 0x2283, 0x89, 0xDD55, 0x20A1, 0xA81, 0x7D5D, 0x9, 0xFFFF},
+ .coords = {COORDS_XY(9,6), COORDS_XY(13,6)},
+ .direction = TRAINER_DIRS(DIR_WEST, DIR_EAST),
+ .range = TRAINER_RANGE(3, 3),
}
},
[2] =
@@ -3735,11 +3945,28 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = {
},
},
.display = {
- .data = {0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x8, 0x69, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x7C, 0x46, 0x8, 0x69, 0x46, 0x7A, 0x73, 0x73, 0x73, 0x79, 0x73, 0x73, 0x73, 0x7D, 0x73, 0x73, 0x73, 0x46, 0x8, 0x69, 0x46, 0x73, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x8, 0x69, 0x46, 0x73, 0x73, 0x7B, 0x73, 0x7C, 0x73, 0x7B, 0x73, 0x7A, 0x73, 0x73, 0x73, 0x46, 0x8, 0x69, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x7A, 0x46, 0x8, 0x69, 0x46, 0x73, 0x73, 0x73, 0x73, 0x73, 0x7D, 0x7C, 0x73, 0x7C, 0x73, 0x7B, 0x73, 0x46, 0x8, 0x69, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x7C, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x8, 0x91, 0x46, 0x9B, 0x9B, 0x9B, 0x46, 0x3B, 0x3B, 0x3B, 0x46, 0x9B, 0x9B, 0x9B, 0x9B, 0x46, 0x8, 0x91, 0x46, 0x9B, 0x9B, 0x9B, 0x46, 0x3B, 0x3B, 0x3B, 0x46, 0x9B, 0x9B, 0x9B, 0x9B, 0x46, 0x8, 0x91, 0x46, 0x9B, 0x9B, 0x9B, 0x46, 0x3B, 0x3B, 0x3B, 0x46, 0x9B, 0x9B, 0x9B, 0x9B, 0x46, 0x8, 0xF1, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x8, 0xF1, 0x46, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0x7A, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0x7C, 0x8, 0xF1, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0xFB, 0x8, 0x7C, 0xFB, 0x7B, 0xFB, 0x7A, 0xFB, 0x79, 0xFB, 0xB3, 0xFB, 0x7D, 0xFB, 0x7E, 0xFB, 0x7D, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8},
- .unk3A0 = {0x381, 0x7FFB, 0x4003, 0x5FFF, 0x4003, 0x7FFB, 0x4003, 0x7EFF, 0x4443, 0x4443, 0x4443, 0x7EFF, 0x4001, 0x7FFD, 0x1, 0xFFFF},
- .coords = {150, 152},
- .direction = 0x23,
- .range = 0x11,
+ .metatileData = {
+ 0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x08,
+ 0x69, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x7C, 0x46, 0x08,
+ 0x69, 0x46, 0x7A, 0x73, 0x73, 0x73, 0x79, 0x73, 0x73, 0x73, 0x7D, 0x73, 0x73, 0x73, 0x46, 0x08,
+ 0x69, 0x46, 0x73, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x08,
+ 0x69, 0x46, 0x73, 0x73, 0x7B, 0x73, 0x7C, 0x73, 0x7B, 0x73, 0x7A, 0x73, 0x73, 0x73, 0x46, 0x08,
+ 0x69, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x7A, 0x46, 0x08,
+ 0x69, 0x46, 0x73, 0x73, 0x73, 0x73, 0x73, 0x7D, 0x7C, 0x73, 0x7C, 0x73, 0x7B, 0x73, 0x46, 0x08,
+ 0x69, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x7C, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x08,
+ 0x91, 0x46, 0x9B, 0x9B, 0x9B, 0x46, 0x3B, 0x3B, 0x3B, 0x46, 0x9B, 0x9B, 0x9B, 0x9B, 0x46, 0x08,
+ 0x91, 0x46, 0x9B, 0x9B, 0x9B, 0x46, 0x3B, 0x3B, 0x3B, 0x46, 0x9B, 0x9B, 0x9B, 0x9B, 0x46, 0x08,
+ 0x91, 0x46, 0x9B, 0x9B, 0x9B, 0x46, 0x3B, 0x3B, 0x3B, 0x46, 0x9B, 0x9B, 0x9B, 0x9B, 0x46, 0x08,
+ 0xF1, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x08,
+ 0xF1, 0x46, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0x7A, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0x7C, 0x08,
+ 0xF1, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0xFB, 0x08,
+ 0x7C, 0xFB, 0x7B, 0xFB, 0x7A, 0xFB, 0x79, 0xFB, 0xB3, 0xFB, 0x7D, 0xFB, 0x7E, 0xFB, 0x7D, 0x08,
+ 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
+ },
+ .collisionData = {0x0381, 0x7FFB, 0x4003, 0x5FFF, 0x4003, 0x7FFB, 0x4003, 0x7EFF, 0x4443, 0x4443, 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B, 0xEB, 0xFB, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xFB, 0x08,
+ 0xF1, 0xFB, 0xFB, 0xEB, 0xFB, 0xFB, 0xFB, 0xEB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0x08,
+ 0xF1, 0xFB, 0xFB, 0xEC, 0xFB, 0xFB, 0xFB, 0xEC, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0x08,
+ 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
+ },
+ .collisionData = {0x0381, 0x3F9, 0xF041, 0x41, 0x7F5F, 0x4401, 0x4541, 0x5579, 0x5541, 0x555F, 0x5541, 0x5541, 0x557D, 0x1101, 0x1101, 0xFFFF},
+ .coords = {COORDS_XY(8,2), COORDS_XY(11,5)},
+ .direction = TRAINER_DIRS(DIR_WEST, DIR_NORTH),
+ .range = TRAINER_RANGE(3, 3),
}
},
};
@@ -4345,11 +4589,28 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = {
},
},
.display = {
- .data = {0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x1B, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x8, 0x31, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x2C, 0x39, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x8, 0x31, 0x3B, 0x8, 0x8, 0x8, 0x8, 0x8, 0x3B, 0x8, 0x8, 0x8, 0x8, 0x8, 0x3B, 0x3B, 0x8, 0x69, 0x73, 0x8, 0x4D, 0x4D, 0x4D, 0x4D, 0xD1, 0x4D, 0x4D, 0x4D, 0x4D, 0x8, 0x69, 0x73, 0x8, 0x40, 0x3B, 0x8, 0x55, 0x55, 0x55, 0x55, 0xD1, 0x55, 0x55, 0x55, 0x55, 0x8, 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x3019, 0x2009, 0x3019, 0x3019, 0x3C79, 0x1, 0x1, 0xFFFF},
- .coords = {116, 122},
- .direction = 0x23,
- .range = 0x55,
+ .metatileData = {
+ 0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x1B, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x08,
+ 0x31, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x2C, 0x39, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x08,
+ 0x31, 0x3B, 0x08, 0x08, 0x08, 0x08, 0x08, 0x3B, 0x08, 0x08, 0x08, 0x08, 0x08, 0x3B, 0x3B, 0x08,
+ 0x69, 0x73, 0x08, 0x4D, 0x4D, 0x4D, 0x4D, 0xD1, 0x4D, 0x4D, 0x4D, 0x4D, 0x08, 0x69, 0x73, 0x08,
+ 0x40, 0x3B, 0x08, 0x55, 0x55, 0x55, 0x55, 0xD1, 0x55, 0x55, 0x55, 0x55, 0x08, 0x31, 0x41, 0x08,
+ 0x69, 0x41, 0x08, 0xC5, 0xD9, 0xD9, 0xD9, 0x9A, 0xD9, 0xD9, 0xD9, 0xC6, 0x08, 0x41, 0x73, 0x08,
+ 0x69, 0x3B, 0x08, 0xD4, 0xDB, 0x9B, 0x73, 0x73, 0x73, 0x9B, 0xDB, 0xCC, 0x08, 0x31, 0x73, 0x08,
+ 0x69, 0x3B, 0x08, 0xCD, 0x9B, 0x73, 0x73, 0x44, 0x73, 0x73, 0x9B, 0xD5, 0x08, 0x31, 0x73, 0x08,
+ 0x69, 0x3B, 0x08, 0xD4, 0xDB, 0x9B, 0x73, 0x73, 0x73, 0x9B, 0xDB, 0xCC, 0x08, 0x31, 0x73, 0x08,
+ 0x69, 0x41, 0x08, 0xD1, 0xDB, 0xDB, 0xDB, 0x9B, 0xDB, 0xDB, 0xDB, 0xDB, 0x08, 0x41, 0x73, 0x08,
+ 0x40, 0x3B, 0x08, 0x08, 0xC7, 0xC7, 0xDB, 0xDB, 0xDB, 0xC7, 0xC7, 0x08, 0x08, 0x31, 0x41, 0x08,
+ 0x69, 0x3B, 0x4D, 0x4D, 0x67, 0x67, 0xDB, 0xDB, 0xDB, 0x67, 0x67, 0x4D, 0x4D, 0x31, 0x73, 0x08,
+ 0x69, 0x3B, 0x55, 0x55, 0xD7, 0xD7, 0xD1, 0xDB, 0xDB, 0xD7, 0xD7, 0x55, 0x55, 0x31, 0x73, 0x08,
+ 0x69, 0x3B, 0x39, 0x39, 0x39, 0x39, 0x3A, 0x3B, 0x3B, 0x39, 0x39, 0x39, 0x39, 0x3A, 0x73, 0x08,
+ 0x69, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x08,
+ 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
+ },
+ .collisionData = {0x0381, 0x0201, 0x3EF9, 0x3EF9, 0x3EF9, 0x2009, 0x3019, 0x2009, 0x3019, 0x2009, 0x3019, 0x3019, 0x3C79, 0x1, 0x1, 0xFFFF},
+ .coords = {COORDS_XY(4,7), COORDS_XY(10,7)},
+ .direction = TRAINER_DIRS(DIR_WEST, DIR_EAST),
+ .range = TRAINER_RANGE(5, 5),
}
},
[1] =
@@ -4650,11 +4911,28 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = {
},
},
.display = {
- .data = {0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x8, 0x91, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x78, 0x8, 0x91, 0x46, 0x9B, 0x7C, 0x9B, 0x9B, 0x9B, 0x7D, 0x9B, 0x7C, 0x9B, 0x7B, 0x9B, 0x7A, 0x9B,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x96, 0x9B, 0x9B, 0x96, 0xD6, 0x9B, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8},
- .unk3A0 = {0x381, 0x7FFD, 0x4001, 0x5FFF, 0x4001, 0x7FFD, 0x4001, 0x5FFF, 0x4001, 0x7FFD, 0x1, 0x1, 0x1, 0x1, 0x1, 0xFFFF},
- .coords = {167, 231},
- .direction = 0x1,
- .range = 0x33,
+ .metatileData = {
+ 0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x08,
+ 0x91, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x78, 0x08,
+ 0x91, 0x46, 0x9B, 0x7C, 0x9B, 0x9B, 0x9B, 0x7D, 0x9B, 0x7C, 0x9B, 0x7B, 0x9B, 0x7A, 0x9B, 0x08,
+ 0x91, 0x46, 0x7D, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x08,
+ 0x91, 0x46, 0x9B, 0x7E, 0x9B, 0x9B, 0x9B, 0x7D, 0x9B, 0x7E, 0x9B, 0xB3, 0x9B, 0x9B, 0x9B, 0x08,
+ 0x91, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x9B, 0x08,
+ 0x91, 0x46, 0x9B, 0x7D, 0x9B, 0x7C, 0x9B, 0x7B, 0x9B, 0x7A, 0x9B, 0x7C, 0x9B, 0x9B, 0x9B, 0x08,
+ 0x91, 0x46, 0x9B, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x08,
+ 0x91, 0x46, 0x9B, 0x7C, 0x9B, 0x7D, 0x9B, 0x7E, 0x9B, 0x9B, 0x9B, 0x7D, 0x9B, 0x7E, 0x9B, 0x08,
+ 0x91, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0xB3, 0x08,
+ 0x91, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0xDB, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0x9B, 0x08,
+ 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0xDB, 0xDB, 0xDB, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0x08,
+ 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0x08,
+ 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0xDB, 0xDB, 0xDB, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0x08,
+ 0x91, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0xDB, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0x9B, 0x08,
+ 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
+ },
+ .collisionData = {0x0381, 0x7FFD, 0x4001, 0x5FFF, 0x4001, 0x7FFD, 0x4001, 0x5FFF, 0x4001, 0x7FFD, 0x1, 0x1, 0x1, 0x1, 0x1, 0xFFFF},
+ .coords = {COORDS_XY(7,10), COORDS_XY(7,14)},
+ .direction = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH),
+ .range = TRAINER_RANGE(3, 3),
}
},
[2] =
@@ -4955,11 +5233,28 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = {
},
},
.display = {
- .data = {0xD1, 0xDB, 0xDB, 0xDB, 0xD9, 0xD9, 0x1B, 0x14, 0x15, 0x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x9B, 0x08,
+ 0xD1, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xCC, 0xFB, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x08,
+ },
+ .collisionData = {0x0381, 0x0201, 0xEE1, 0x1EF1, 0x3EF9, 0x3EF9, 0x7E7D, 0x783D, 0x2BD, 0x783D, 0x7E7D, 0x3E79, 0x3EF9, 0x1EF1, 0xEE1, 0x201},
+ .coords = {COORDS_XY(7,6), COORDS_XY(7,10)},
+ .direction = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH),
+ .range = TRAINER_RANGE(3, 3),
}
},
[3] =
@@ -5252,11 +5547,32 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = {
},
},
.display = {
- .data = {0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x39, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x8, 0x96, 0xFB, 0xF6, 0xFD, 0xF6, 0xF6, 0xFB, 0x46, 0xFB, 0xF6, 0xF6, 0xFD, 0xF6, 0xFB, 0x9B, 0x8, 0xFB, 0x9B, 0xFB, 0xF6, 0xFB, 0xFB, 0xFB, 0x46, 0xFB, 0xFB, 0xFB, 0xF6, 0xFB, 0x9B, 0xFB, 0x8, 0xF6, 0xFB, 0x9B, 0xFB, 0xFB, 0x46, 0x46, 0x9B, 0x46, 0x46, 0xFB, 0xFB, 0x9B, 0xFB, 0xF6, 0x8, 0xFD, 0xF6, 0xFB, 0x9B, 0x46, 0x36, 0x36, 0x9B, 0x36, 0x36, 0x46, 0x9B, 0xFB, 0xF6, 0xFD, 0x8, 0xF6, 0xFB, 0xFB, 0x46, 0x9B, 0x46, 0x46, 0xDB, 0x46, 0x46, 0x9B, 0x46, 0xFB, 0xFB, 0xF6, 0x8, 0xF6, 0xFB, 0x46, 0x36, 0x46, 0x9B, 0xDB, 0xD6, 0xDB, 0x9B, 0x46, 0x36, 0x46, 0xFB, 0xF6, 0x8, 0xFB, 0xFB, 0x46, 0x36, 0x9B, 0xDB, 0xD6, 0xD6, 0xD6, 0xDB, 0x9B, 0x36, 0x46, 0xFB, 0xFB, 0x8, 0x96, 0x9B, 0x9B, 0x9B, 0x9B, 0xD6, 0xD6, 0x96, 0xD6, 0xD6, 0xDB, 0x9B, 0x9B, 0x9B, 0x96, 0x8, 0xFB, 0xFB, 0x46, 0x36, 0x9B, 0xDB, 0xD6, 0xD6, 0xD6, 0xDB, 0x9B, 0x36, 0x46, 0xFB, 0xFB, 0x8, 0xF6, 0xFB, 0x46, 0x36, 0x46, 0x9B, 0xDB, 0xD6, 0xDB, 0x9B, 0x46, 0x36, 0x46, 0xFB, 0xF6, 0x8, 0xF6, 0xFB, 0xFB, 0x46, 0x9B, 0x46, 0x46, 0xDB, 0x46, 0x46, 0x9B, 0x46, 0xFB, 0xFB, 0xF6, 0x8, 0xFD, 0xF6, 0xFB, 0x9B, 0x46, 0x36, 0x36, 0x9B, 0x36, 0x36, 0x46, 0x9B, 0xFB, 0xF6, 0xFD, 0x8, 0xF6, 0xFB, 0x9B, 0xFB, 0xFB, 0x46, 0x46, 0x9B, 0x46, 0x46, 0xFB, 0xFB, 0x9B, 0xFB, 0xF6, 0x8, 0xFB, 0x9B, 0xFB, 0xF6, 0xFB, 0xFB, 0xFB, 0x46, 0xFB, 0xFB, 0xFB, 0xF6, 0xFB, 0x9B, 0xFB, 0x8, 0x96, 0xFB, 0xF6, 0xFD, 0xF6, 0xF6, 0xFB, 0x46, 0xFB, 0xF6, 0xF6, 0xFD, 0xF6, 0xFB, 0x9B, 0x8},
- .unk3A0 = {0x381, 0x101, 0x101, 0x6C1, 0x821, 0x16D1, 0x2829, 0x2009, 0x1, 0x2009, 0x2829, 0x16D1, 0x821, 0x6C1, 0x101, 0x101},
- .coords = {103, 167},
- .direction = 0x1,
- .range = 0x33,
+ .metatileData = {
+ 0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x39, 0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0x46, 0x9B, 0x46, 0xFB, 0xFB, 0xF6, 0x08,
+ 0xFD, 0xF6, 0xFB, 0x9B, 0x46, 0x36, 0x36, 0x9B, 0x36, 0x36, 0x46, 0x9B, 0xFB, 0xF6, 0xFD, 0x08,
+ 0xF6, 0xFB, 0x9B, 0xFB, 0xFB, 0x46, 0x46, 0x9B, 0x46, 0x46, 0xFB, 0xFB, 0x9B, 0xFB, 0xF6, 0x08,
+ 0xFB, 0x9B, 0xFB, 0xF6, 0xFB, 0xFB, 0xFB, 0x46, 0xFB, 0xFB, 0xFB, 0xF6, 0xFB, 0x9B, 0xFB, 0x08,
+ 0x96, 0xFB, 0xF6, 0xFD, 0xF6, 0xF6, 0xFB, 0x46, 0xFB, 0xF6, 0xF6, 0xFD, 0xF6, 0xFB, 0x9B, 0x08,
+ },
+ .collisionData = {0x0381, 0x0101, 0x0101, 0x6C1, 0x0821, 0x16D1, 0x2829, 0x2009, 0x1, 0x2009, 0x2829, 0x16D1, 0x0821, 0x6C1, 0x0101, 0x101},
+ .coords = {COORDS_XY(7,6), COORDS_XY(7,10)},
+ .direction = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH),
+ .range = TRAINER_RANGE(3, 3),
}
},
};
+
+#undef COORDS_XY
+#undef TRAINER_DIRS
+#undef TRAINER_RANGE
diff --git a/src/data/contest_opponents.h b/src/data/contest_opponents.h
index 6de931ef2..127457bbe 100644
--- a/src/data/contest_opponents.h
+++ b/src/data/contest_opponents.h
@@ -1,7 +1,6 @@
#include "global.h"
#include "contest.h"
-#include "constants/species.h"
#define CONTEST_OPPONENT_JIMMY 0
#define CONTEST_OPPONENT_EDITH 1
diff --git a/src/data/easy_chat/easy_chat_group_pokemon.h b/src/data/easy_chat/easy_chat_group_pokemon.h
index 9993a5144..a6e1c48ea 100755
--- a/src/data/easy_chat/easy_chat_group_pokemon.h
+++ b/src/data/easy_chat/easy_chat_group_pokemon.h
@@ -1,5 +1,3 @@
-#include "constants/species.h"
-
const u16 gEasyChatGroup_Pokemon[] = {
SPECIES_ABRA,
SPECIES_ABSOL,
diff --git a/src/data/easy_chat/easy_chat_group_pokemon2.h b/src/data/easy_chat/easy_chat_group_pokemon2.h
index 35b0a03cb..44dce0cc8 100755
--- a/src/data/easy_chat/easy_chat_group_pokemon2.h
+++ b/src/data/easy_chat/easy_chat_group_pokemon2.h
@@ -1,5 +1,3 @@
-#include "constants/species.h"
-
const u16 gEasyChatGroup_Pokemon2[] = {
SPECIES_ABRA,
SPECIES_AERODACTYL,
diff --git a/src/data/lilycove_lady.h b/src/data/lilycove_lady.h
index 738a6dc12..cf6c0c648 100644
--- a/src/data/lilycove_lady.h
+++ b/src/data/lilycove_lady.h
@@ -1,7 +1,6 @@
#include "constants/easy_chat.h"
#include "constants/event_objects.h"
#include "constants/items.h"
-#include "constants/species.h"
#include "constants/moves.h"
static const u16 sContestLadyMonGfxId[] =
diff --git a/src/data/pokemon/item_effects.h b/src/data/pokemon/item_effects.h
index 698d97a43..1ed721e44 100644
--- a/src/data/pokemon/item_effects.h
+++ b/src/data/pokemon/item_effects.h
@@ -26,12 +26,12 @@ const u8 gItemEffect_ParalyzeHeal[6] = {
const u8 gItemEffect_FullRestore[7] = {
[3] = ITEM3_STATUS_ALL,
[4] = ITEM4_HEAL_HP,
- [6] = -1,
+ [6] = ITEM6_HEAL_FULL,
};
const u8 gItemEffect_MaxPotion[7] = {
[4] = ITEM4_HEAL_HP,
- [6] = -1,
+ [6] = ITEM6_HEAL_FULL,
};
const u8 gItemEffect_HyperPotion[7] = {
@@ -50,12 +50,12 @@ const u8 gItemEffect_FullHeal[6] = {
const u8 gItemEffect_Revive[7] = {
[4] = ITEM4_REVIVE | ITEM4_HEAL_HP,
- [6] = -2,
+ [6] = ITEM6_HEAL_HALF,
};
const u8 gItemEffect_MaxRevive[7] = {
[4] = ITEM4_REVIVE | ITEM4_HEAL_HP,
- [6] = -1,
+ [6] = ITEM6_HEAL_FULL,
};
const u8 gItemEffect_FreshWater[7] = {
@@ -107,7 +107,7 @@ const u8 gItemEffect_HealPowder[9] = {
const u8 gItemEffect_RevivalHerb[10] = {
[4] = ITEM4_REVIVE | ITEM4_HEAL_HP,
[5] = ITEM5_FRIENDSHIP_ALL,
- [6] = -1,
+ [6] = ITEM6_HEAL_FULL,
[7] = -15,
[8] = -15,
[9] = -20,
@@ -157,7 +157,7 @@ const u8 gItemEffect_BerryJuice[7] = {
const u8 gItemEffect_SacredAsh[7] = {
[0] = ITEM0_SACRED_ASH,
[4] = ITEM4_REVIVE | ITEM4_HEAL_HP,
- [6] = -1,
+ [6] = ITEM6_HEAL_FULL,
};
const u8 gItemEffect_HPUp[10] = {
@@ -206,7 +206,7 @@ const u8 gItemEffect_RareCandy[10] = {
[3] = ITEM3_LEVEL_UP,
[4] = ITEM4_REVIVE | ITEM4_HEAL_HP,
[5] = ITEM5_FRIENDSHIP_ALL,
- [6] = 0xFD,
+ [6] = ITEM6_HEAL_LVL_UP,
[7] = 5,
[8] = 3,
[9] = 2,
diff --git a/src/data/pokemon/tmhm_learnsets.h b/src/data/pokemon/tmhm_learnsets.h
index 3ad9a97c6..deeeda16f 100644
--- a/src/data/pokemon/tmhm_learnsets.h
+++ b/src/data/pokemon/tmhm_learnsets.h
@@ -3,7 +3,7 @@
// This table determines which TMs and HMs a species is capable of learning.
// Each entry is a 64-bit bit array spread across two 32-bit values, with
-// each bit corresponding to a .
+// each bit corresponding to a TM or HM.
const u32 gTMHMLearnsets[][2] =
{
[SPECIES_NONE] = TMHM_LEARNSET(0),
diff --git a/src/daycare.c b/src/daycare.c
index 5d4480403..d6b2e207f 100644
--- a/src/daycare.c
+++ b/src/daycare.c
@@ -22,7 +22,6 @@
#include "constants/items.h"
#include "constants/moves.h"
#include "constants/region_map_sections.h"
-#include "constants/species.h"
// this file's functions
static void ClearDaycareMonMail(struct DayCareMail *mail);
diff --git a/src/decompress.c b/src/decompress.c
index c303f214f..007753303 100644
--- a/src/decompress.c
+++ b/src/decompress.c
@@ -4,7 +4,6 @@
#include "decompress.h"
#include "pokemon.h"
#include "text.h"
-#include "constants/species.h"
EWRAM_DATA ALIGNED(4) u8 gDecompressionBuffer[0x4000] = {0};
diff --git a/src/digit_obj_util.c b/src/digit_obj_util.c
index fe5d49e69..f887dafb9 100644
--- a/src/digit_obj_util.c
+++ b/src/digit_obj_util.c
@@ -33,7 +33,7 @@ struct DigitPrinterAlloc
};
// this file's functions
-static u8 GetFirstOamId(u8 oamCount);;
+static u8 GetFirstOamId(u8 oamCount);
static void CopyWorkToOam(struct DigitPrinter *objWork);
static void DrawNumObjsLeadingZeros(struct DigitPrinter *objWork, s32 num, bool32 sign);
static void DrawNumObjsMinusInFront(struct DigitPrinter *objWork, s32 num, bool32 sign);
diff --git a/src/dodrio_berry_picking.c b/src/dodrio_berry_picking.c
index 34f73126b..1e274a4a1 100644
--- a/src/dodrio_berry_picking.c
+++ b/src/dodrio_berry_picking.c
@@ -24,7 +24,6 @@
#include "window.h"
#include "constants/items.h"
#include "constants/songs.h"
-#include "constants/species.h"
struct DodrioSubstruct_0160
{
diff --git a/src/easy_chat.c b/src/easy_chat.c
index 534215ecd..6dca3f56a 100644
--- a/src/easy_chat.c
+++ b/src/easy_chat.c
@@ -32,7 +32,6 @@
#include "constants/lilycove_lady.h"
#include "constants/mauville_old_man.h"
#include "constants/songs.h"
-#include "constants/species.h"
#include "constants/rgb.h"
#define EZCHAT_TASK_STATE 0
diff --git a/src/ereader_helpers.c b/src/ereader_helpers.c
index bdfbebf6b..944d1d728 100755
--- a/src/ereader_helpers.c
+++ b/src/ereader_helpers.c
@@ -12,7 +12,6 @@
#include "trainer_hill.h"
#include "constants/easy_chat.h"
#include "constants/trainers.h"
-#include "constants/species.h"
#include "constants/moves.h"
#include "constants/items.h"
diff --git a/src/evolution_scene.c b/src/evolution_scene.c
index 41d4900f7..47074cf26 100644
--- a/src/evolution_scene.c
+++ b/src/evolution_scene.c
@@ -30,7 +30,6 @@
#include "trade.h"
#include "util.h"
#include "constants/battle_string_ids.h"
-#include "constants/species.h"
#include "constants/songs.h"
#include "constants/rgb.h"
diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c
index 5fab2489b..194f110d8 100644
--- a/src/field_player_avatar.c
+++ b/src/field_player_avatar.c
@@ -29,7 +29,6 @@
#include "constants/maps.h"
#include "constants/moves.h"
#include "constants/songs.h"
-#include "constants/species.h"
#include "constants/trainer_types.h"
static EWRAM_DATA u8 gUnknown_0203734C = 0;
diff --git a/src/field_poison.c b/src/field_poison.c
index 9d3ca047c..132ce571e 100644
--- a/src/field_poison.c
+++ b/src/field_poison.c
@@ -16,7 +16,6 @@
#include "trainer_hill.h"
#include "constants/field_poison.h"
#include "constants/party_menu.h"
-#include "constants/species.h"
static bool32 IsMonValidSpecies(struct Pokemon *pokemon)
{
diff --git a/src/field_specials.c b/src/field_specials.c
index 57b750145..b287a071a 100644
--- a/src/field_specials.c
+++ b/src/field_specials.c
@@ -60,7 +60,6 @@
#include "constants/script_menu.h"
#include "constants/slot_machine.h"
#include "constants/songs.h"
-#include "constants/species.h"
#include "constants/moves.h"
#include "constants/party_menu.h"
#include "constants/battle_frontier.h"
diff --git a/src/frontier_util.c b/src/frontier_util.c
index 3f0826ef1..83c9341d5 100644
--- a/src/frontier_util.c
+++ b/src/frontier_util.c
@@ -31,7 +31,6 @@
#include "constants/battle_frontier.h"
#include "constants/frontier_util.h"
#include "constants/trainers.h"
-#include "constants/species.h"
#include "constants/game_stat.h"
#include "constants/moves.h"
#include "constants/items.h"
diff --git a/src/hall_of_fame.c b/src/hall_of_fame.c
index 2b548dea2..1cfa794ae 100644
--- a/src/hall_of_fame.c
+++ b/src/hall_of_fame.c
@@ -18,7 +18,6 @@
#include "window.h"
#include "credits.h"
#include "bg.h"
-#include "constants/species.h"
#include "constants/game_stat.h"
#include "util.h"
#include "string_util.h"
diff --git a/src/intro.c b/src/intro.c
index eca8b84b1..7dab2ad46 100644
--- a/src/intro.c
+++ b/src/intro.c
@@ -21,7 +21,6 @@
#include "intro.h"
#include "graphics.h"
#include "sound.h"
-#include "constants/species.h"
#include "util.h"
#include "title_screen.h"
#include "constants/rgb.h"
diff --git a/src/item_menu.c b/src/item_menu.c
index ace2fd11e..394bd1058 100755
--- a/src/item_menu.c
+++ b/src/item_menu.c
@@ -920,14 +920,14 @@ void BagMenu_ItemPrintCallback(u8 windowId, s32 itemIndex, u8 y)
if (gBagPositionStruct.pocket == BERRIES_POCKET)
{
- ConvertIntToDecimalStringN(gStringVar1, itemQuantity, STR_CONV_MODE_RIGHT_ALIGN, 3);
+ ConvertIntToDecimalStringN(gStringVar1, itemQuantity, STR_CONV_MODE_RIGHT_ALIGN, BERRY_CAPACITY_DIGITS);
StringExpandPlaceholders(gStringVar4, gText_xVar1);
offset = GetStringRightAlignXOffset(7, gStringVar4, 119);
BagMenu_Print(windowId, 7, gStringVar4, offset, y, 0, 0, -1, 0);
}
else if (gBagPositionStruct.pocket != KEYITEMS_POCKET && ItemId_GetImportance(itemId) == FALSE)
{
- ConvertIntToDecimalStringN(gStringVar1, itemQuantity, STR_CONV_MODE_RIGHT_ALIGN, 2);
+ ConvertIntToDecimalStringN(gStringVar1, itemQuantity, STR_CONV_MODE_RIGHT_ALIGN, BAG_ITEM_CAPACITY_DIGITS);
StringExpandPlaceholders(gStringVar4, gText_xVar1);
offset = GetStringRightAlignXOffset(7, gStringVar4, 119);
BagMenu_Print(windowId, 7, gStringVar4, offset, y, 0, 0, -1, 0);
@@ -1134,7 +1134,7 @@ void sub_81ABC3C(u8 a)
void PrintItemDepositAmount(u8 windowId, s16 numDeposited)
{
- u8 numDigits = (gBagPositionStruct.pocket == BERRIES_POCKET) ? 3 : 2;
+ u8 numDigits = (gBagPositionStruct.pocket == BERRIES_POCKET) ? BERRY_CAPACITY_DIGITS : BAG_ITEM_CAPACITY_DIGITS;
ConvertIntToDecimalStringN(gStringVar1, numDeposited, STR_CONV_MODE_LEADING_ZEROS, numDigits);
StringExpandPlaceholders(gStringVar4, gText_xVar1);
AddTextPrinterParameterized(windowId, 1, gStringVar4, GetStringCenterAlignXOffset(1, gStringVar4, 0x28), 2, 0, 0);
@@ -1142,7 +1142,7 @@ void PrintItemDepositAmount(u8 windowId, s16 numDeposited)
void PrintItemSoldAmount(int windowId, int numSold, int moneyEarned)
{
- u8 numDigits = (gBagPositionStruct.pocket == BERRIES_POCKET) ? 3 : 2;
+ u8 numDigits = (gBagPositionStruct.pocket == BERRIES_POCKET) ? BERRY_CAPACITY_DIGITS : BAG_ITEM_CAPACITY_DIGITS;
ConvertIntToDecimalStringN(gStringVar1, numSold, STR_CONV_MODE_LEADING_ZEROS, numDigits);
StringExpandPlaceholders(gStringVar4, gText_xVar1);
AddTextPrinterParameterized(windowId, 1, gStringVar4, 0, 1, -1, 0);
@@ -1762,7 +1762,7 @@ void BagMenu_TossItems(u8 taskId)
s16* data = gTasks[taskId].data;
CopyItemName(gSpecialVar_ItemId, gStringVar1);
- ConvertIntToDecimalStringN(gStringVar2, tItemCount, STR_CONV_MODE_LEFT_ALIGN, 3);
+ ConvertIntToDecimalStringN(gStringVar2, tItemCount, STR_CONV_MODE_LEFT_ALIGN, MAX_ITEM_DIGITS);
StringExpandPlaceholders(gStringVar4, gText_ConfirmTossItems);
FillWindowPixelBuffer(1, PIXEL_FILL(0));
BagMenu_Print(1, 1, gStringVar4, 3, 1, 0, 0, 0, 0);
@@ -1805,7 +1805,7 @@ void BagMenu_ConfirmToss(u8 taskId)
s16* data = gTasks[taskId].data;
CopyItemName(gSpecialVar_ItemId, gStringVar1);
- ConvertIntToDecimalStringN(gStringVar2, tItemCount, STR_CONV_MODE_LEFT_ALIGN, 3);
+ ConvertIntToDecimalStringN(gStringVar2, tItemCount, STR_CONV_MODE_LEFT_ALIGN, MAX_ITEM_DIGITS);
StringExpandPlaceholders(gStringVar4, gText_ThrewAwayVar2Var1s);
FillWindowPixelBuffer(1, PIXEL_FILL(0));
BagMenu_Print(1, 1, gStringVar4, 3, 1, 0, 0, 0, 0);
@@ -2173,7 +2173,7 @@ static void BagMenu_TryDepositItem(u8 taskId)
else if (AddPCItem(gSpecialVar_ItemId, tItemCount) == TRUE)
{
CopyItemName(gSpecialVar_ItemId, gStringVar1);
- ConvertIntToDecimalStringN(gStringVar2, tItemCount, STR_CONV_MODE_LEFT_ALIGN, 3);
+ ConvertIntToDecimalStringN(gStringVar2, tItemCount, STR_CONV_MODE_LEFT_ALIGN, MAX_ITEM_DIGITS);
StringExpandPlaceholders(gStringVar4, gText_DepositedVar2Var1s);
BagMenu_Print(1, 1, gStringVar4, 3, 1, 0, 0, 0, 0);
gTasks[taskId].func = Task_ActuallyToss;
diff --git a/src/link_rfu_2.c b/src/link_rfu_2.c
index 7f3bfa20d..5e0ef0aa4 100644
--- a/src/link_rfu_2.c
+++ b/src/link_rfu_2.c
@@ -15,7 +15,6 @@
#include "string_util.h"
#include "task.h"
#include "text.h"
-#include "constants/species.h"
#include "save.h"
#include "mystery_gift.h"
diff --git a/src/lottery_corner.c b/src/lottery_corner.c
index 5f68ad516..2cbf0a808 100644
--- a/src/lottery_corner.c
+++ b/src/lottery_corner.c
@@ -4,7 +4,6 @@
#include "pokemon.h"
#include "constants/items.h"
#include "random.h"
-#include "constants/species.h"
#include "string_util.h"
#include "text.h"
#include "pokemon_storage_system.h"
diff --git a/src/m4a.c b/src/m4a.c
index 50a9a54be..f061ba9b9 100644
--- a/src/m4a.c
+++ b/src/m4a.c
@@ -671,28 +671,17 @@ void FadeOutBody(struct MusicPlayerInfo *mplayInfo)
s32 i;
struct MusicPlayerTrack *track;
u16 fadeOV;
-#ifdef NONMATCHING
- u16 mask;
-#else
- register u16 mask asm("r2");
-#endif // NONMATCHING
if (mplayInfo->fadeOI == 0)
return;
-
- mplayInfo->fadeOC--;
- mask = 0xFFFF;
-
- if (mplayInfo->fadeOC != 0)
+ if (--mplayInfo->fadeOC != 0)
return;
mplayInfo->fadeOC = mplayInfo->fadeOI;
if (mplayInfo->fadeOV & FADE_IN)
{
- mplayInfo->fadeOV += (4 << FADE_VOL_SHIFT);
-
- if ((u16)(mplayInfo->fadeOV & mask) >= (64 << FADE_VOL_SHIFT))
+ if ((u16)(mplayInfo->fadeOV += (4 << FADE_VOL_SHIFT)) >= (64 << FADE_VOL_SHIFT))
{
mplayInfo->fadeOV = (64 << FADE_VOL_SHIFT);
mplayInfo->fadeOI = 0;
@@ -700,9 +689,7 @@ void FadeOutBody(struct MusicPlayerInfo *mplayInfo)
}
else
{
- mplayInfo->fadeOV -= (4 << FADE_VOL_SHIFT);
-
- if ((s16)(mplayInfo->fadeOV & mask) <= 0)
+ if ((s16)(mplayInfo->fadeOV -= (4 << FADE_VOL_SHIFT)) <= 0)
{
i = mplayInfo->trackCount;
track = mplayInfo->tracks;
diff --git a/src/mail.c b/src/mail.c
index 0fc62678a..ad784f61d 100644
--- a/src/mail.c
+++ b/src/mail.c
@@ -16,7 +16,6 @@
#include "gpu_regs.h"
#include "bg.h"
#include "pokemon_icon.h"
-#include "constants/species.h"
#include "malloc.h"
#include "easy_chat.h"
#include "constants/rgb.h"
diff --git a/src/mail_data.c b/src/mail_data.c
index b0b05e8fe..e0553af99 100644
--- a/src/mail_data.c
+++ b/src/mail_data.c
@@ -3,7 +3,6 @@
#include "constants/items.h"
#include "pokemon.h"
#include "pokemon_icon.h"
-#include "constants/species.h"
#include "text.h"
#include "international_string_util.h"
diff --git a/src/main_menu.c b/src/main_menu.c
index f4bf37ce1..203461e6a 100644
--- a/src/main_menu.c
+++ b/src/main_menu.c
@@ -3,7 +3,6 @@
#include "bg.h"
#include "constants/rgb.h"
#include "constants/songs.h"
-#include "constants/species.h"
#include "constants/trainers.h"
#include "decompress.h"
#include "event_data.h"
diff --git a/src/match_call.c b/src/match_call.c
index 2b3f6df8d..c9752495a 100644
--- a/src/match_call.c
+++ b/src/match_call.c
@@ -32,7 +32,6 @@
#include "constants/maps.h"
#include "constants/region_map_sections.h"
#include "constants/songs.h"
-#include "constants/species.h"
#include "constants/trainers.h"
struct MatchCallState
diff --git a/src/menu_specialized.c b/src/menu_specialized.c
index a99c5c9d0..1d317a1aa 100644
--- a/src/menu_specialized.c
+++ b/src/menu_specialized.c
@@ -25,7 +25,6 @@
#include "window.h"
#include "constants/berry.h"
#include "constants/songs.h"
-#include "constants/species.h"
#include "gba/io_reg.h"
extern const struct CompressedSpriteSheet gMonFrontPicTable[];
@@ -320,7 +319,7 @@ void sub_81D1EC0(void)
Free(sUnknown_0203CF4C);
}
-void sub_81D1ED4(struct ConditionGraph *a0)
+void InitConditionGraphData(struct ConditionGraph *graph)
{
u8 i, j;
@@ -328,22 +327,22 @@ void sub_81D1ED4(struct ConditionGraph *a0)
{
for (i = 0; i < 10; i++)
{
- a0->unk64[i][j].unk0 = 0;
- a0->unk64[i][j].unk2 = 0;
+ graph->unk64[i][j].unk0 = 0;
+ graph->unk64[i][j].unk2 = 0;
}
for (i = 0; i < 4; i++)
{
- a0->unk0[i][j] = 0;
- a0->unk14[i][j].unk0 = 0x9B;
- a0->unk14[i][j].unk2 = 0x5B;
+ graph->stat[i][j] = 0;
+ graph->unk14[i][j].unk0 = 155;
+ graph->unk14[i][j].unk2 = 91;
}
- a0->unk12C[j].unk0 = 0;
- a0->unk12C[j].unk2 = 0;
+ graph->unk12C[j].unk0 = 0;
+ graph->unk12C[j].unk2 = 0;
}
- a0->unk354 = 0;
- a0->unk352 = 0;
+ graph->unk354 = 0;
+ graph->unk352 = 0;
}
void sub_81D1F84(struct ConditionGraph *graph, struct UnknownSubStruct_81D1ED4 *arg1, struct UnknownSubStruct_81D1ED4 *arg2)
@@ -351,7 +350,7 @@ void sub_81D1F84(struct ConditionGraph *graph, struct UnknownSubStruct_81D1ED4 *
u16 i, j;
s32 r5, r6;
- for (i = 0; i < 5; i++)
+ for (i = 0; i < FLAVOR_COUNT; i++)
{
r5 = arg1[i].unk0 << 8;
r6 = ((arg2[i].unk0 - arg1[i].unk0) << 8) / 10;
@@ -388,25 +387,25 @@ bool32 TransitionConditionGraph(struct ConditionGraph *graph)
}
}
-void sub_81D20AC(struct ConditionGraph *a0)
+void InitConditionGraphState(struct ConditionGraph *graph)
{
- a0->unk355 = 0;
+ graph->state = 0;
}
-bool8 sub_81D20BC(struct ConditionGraph *graph)
+bool8 SetupConditionGraphScanlineParams(struct ConditionGraph *graph)
{
struct ScanlineEffectParams params;
- switch (graph->unk355)
+ switch (graph->state)
{
case 0:
ScanlineEffect_Clear();
- graph->unk355++;
+ graph->state++;
return TRUE;
case 1:
params = sConditionGraphScanline;
ScanlineEffect_SetParams(params);
- graph->unk355++;
+ graph->state++;
return FALSE;
default:
return FALSE;
@@ -432,7 +431,7 @@ void sub_81D2108(struct ConditionGraph *graph)
graph->unk354 = 0;
}
-void sub_81D21DC(u8 bg)
+void SetConditionGraphIOWindows(u8 bg)
{
u32 flags;
@@ -1029,23 +1028,23 @@ void GetConditionMenuMonConditions(struct ConditionGraph *graph, u8 *sheen, u16
if (partyId != numMons)
{
- graph->unk0[id][0] = GetBoxOrPartyMonData(boxId, monId, MON_DATA_COOL, NULL);
- graph->unk0[id][1] = GetBoxOrPartyMonData(boxId, monId, MON_DATA_TOUGH, NULL);
- graph->unk0[id][2] = GetBoxOrPartyMonData(boxId, monId, MON_DATA_SMART, NULL);
- graph->unk0[id][3] = GetBoxOrPartyMonData(boxId, monId, MON_DATA_CUTE, NULL);
- graph->unk0[id][4] = GetBoxOrPartyMonData(boxId, monId, MON_DATA_BEAUTY, NULL);
+ graph->stat[id][0] = GetBoxOrPartyMonData(boxId, monId, MON_DATA_COOL, NULL);
+ graph->stat[id][1] = GetBoxOrPartyMonData(boxId, monId, MON_DATA_TOUGH, NULL);
+ graph->stat[id][2] = GetBoxOrPartyMonData(boxId, monId, MON_DATA_SMART, NULL);
+ graph->stat[id][3] = GetBoxOrPartyMonData(boxId, monId, MON_DATA_CUTE, NULL);
+ graph->stat[id][4] = GetBoxOrPartyMonData(boxId, monId, MON_DATA_BEAUTY, NULL);
sheen[id] = (GetBoxOrPartyMonData(boxId, monId, MON_DATA_SHEEN, NULL) != 0xFF)
? GetBoxOrPartyMonData(boxId, monId, MON_DATA_SHEEN, NULL) / 29u
: 9;
- sub_81D2754(graph->unk0[id], graph->unk14[id]);
+ sub_81D2754(graph->stat[id], graph->unk14[id]);
}
else
{
for (i = 0; i < FLAVOR_COUNT; i++)
{
- graph->unk0[id][i] = 0;
+ graph->stat[id][i] = 0;
graph->unk14[id][i].unk0 = 155;
graph->unk14[id][i].unk2 = 91;
}
diff --git a/src/metatile_behavior.c b/src/metatile_behavior.c
index dde4de329..51cc65c22 100644
--- a/src/metatile_behavior.c
+++ b/src/metatile_behavior.c
@@ -968,6 +968,10 @@ bool8 MetatileBehavior_IsDiveable(u8 metatileBehavior)
bool8 MetatileBehavior_IsUnableToEmerge(u8 metatileBehavior)
{
+ // BUG: The player is unintentionally able to emerge on water doors.
+ // Also the narrower underwater door in the underwater tileset has the wrong metatile behavior. This causes the dive glitch.
+ // To fix that add || metatileBehavior == MB_WATER_DOOR to the if statement below and
+ // change the metatile behavior of the narrower water door with porymaps tileset editor.
if (metatileBehavior == MB_NO_SURFACING
|| metatileBehavior == MB_SEAWEED_NO_SURFACING)
return TRUE;
diff --git a/src/mevent2.c b/src/mevent2.c
index 7a2edc7f5..3209c585a 100755
--- a/src/mevent2.c
+++ b/src/mevent2.c
@@ -10,7 +10,6 @@
#include "new_game.h"
#include "mevent.h"
#include "constants/mevent.h"
-#include "constants/species.h"
static EWRAM_DATA bool32 gUnknown_02022C70 = FALSE;
diff --git a/src/mevent_801BAAC.c b/src/mevent_801BAAC.c
index 847449c45..d732e3045 100644
--- a/src/mevent_801BAAC.c
+++ b/src/mevent_801BAAC.c
@@ -1,5 +1,4 @@
#include "global.h"
-#include "constants/species.h"
#include "bg.h"
#include "gpu_regs.h"
#include "palette.h"
diff --git a/src/mon_markings.c b/src/mon_markings.c
index db5df07e8..e1897af76 100644
--- a/src/mon_markings.c
+++ b/src/mon_markings.c
@@ -390,7 +390,7 @@ void sub_811FAF8(void)
}
}
-bool8 sub_811FBA4(void)
+bool8 MonMarkingsMenuHandleInput(void)
{
u16 i;
@@ -564,7 +564,7 @@ static void sub_811FF7C(struct Sprite *sprite)
sprite->pos1.y = (16 * sMenu->cursorPos) + sprite->data[0];
}
-struct Sprite *sub_811FF94(u16 tileTag, u16 paletteTag, const u16 *palette)
+struct Sprite *CreateMonMarkingsSpriteWithPal(u16 tileTag, u16 paletteTag, const u16 *palette)
{
if (!palette)
palette = gUnknown_0859E65C;
diff --git a/src/multiboot.c b/src/multiboot.c
index c7e14392e..19245b5b3 100644
--- a/src/multiboot.c
+++ b/src/multiboot.c
@@ -1,3 +1,4 @@
+#include "global.h"
#include "gba/gba.h"
#include "multiboot.h"
@@ -435,23 +436,23 @@ static int MultiBootHandShake(struct MultiBootParam *mp)
#undef must_data
}
-static NOINLINE void MultiBootWaitCycles(u32 cycles)
+NAKED
+static void MultiBootWaitCycles(u32 cycles)
{
- asm("mov r2, pc");
- asm("lsr r2, #24");
- asm("mov r1, #12");
- asm("cmp r2, #0x02");
- asm("beq MultiBootWaitCyclesLoop");
-
- asm("mov r1, #13");
- asm("cmp r2, #0x08");
- asm("beq MultiBootWaitCyclesLoop");
-
- asm("mov r1, #4");
-
- asm("MultiBootWaitCyclesLoop:");
- asm("sub r0, r1");
- asm("bgt MultiBootWaitCyclesLoop");
+ asm_unified("\
+ mov r2, pc\n\
+ lsrs r2, 24\n\
+ movs r1, 12\n\
+ cmp r2, 2\n\
+ beq MultiBootWaitCyclesLoop\n\
+ movs r1, 13\n\
+ cmp r2, 8\n\
+ beq MultiBootWaitCyclesLoop\n\
+ movs r1, 4\n\
+MultiBootWaitCyclesLoop:\n\
+ subs r0, r1\n\
+ bgt MultiBootWaitCyclesLoop\n\
+ bx lr\n");
}
static void MultiBootWaitSendDone(void)
diff --git a/src/mystery_event_script.c b/src/mystery_event_script.c
index 76f340c60..beb1bf45d 100644
--- a/src/mystery_event_script.c
+++ b/src/mystery_event_script.c
@@ -9,7 +9,6 @@
#include "pokemon.h"
#include "pokemon_size_record.h"
#include "script.h"
-#include "constants/species.h"
#include "strings.h"
#include "string_util.h"
#include "text.h"
diff --git a/src/overworld.c b/src/overworld.c
index d18e3d3bc..7ca67cfbc 100644
--- a/src/overworld.c
+++ b/src/overworld.c
@@ -65,7 +65,6 @@
#include "constants/maps.h"
#include "constants/region_map_sections.h"
#include "constants/songs.h"
-#include "constants/species.h"
#include "constants/trainer_hill.h"
#include "constants/weather.h"
diff --git a/src/party_menu.c b/src/party_menu.c
index 7f4697d7d..6e22fa542 100755
--- a/src/party_menu.c
+++ b/src/party_menu.c
@@ -74,7 +74,6 @@
#include "constants/party_menu.h"
#include "constants/rgb.h"
#include "constants/songs.h"
-#include "constants/species.h"
#define PARTY_PAL_SELECTED (1 << 0)
#define PARTY_PAL_FAINTED (1 << 1)
diff --git a/src/pokeball.c b/src/pokeball.c
index b176677bd..92081a296 100644
--- a/src/pokeball.c
+++ b/src/pokeball.c
@@ -13,7 +13,6 @@
#include "trig.h"
#include "util.h"
#include "constants/songs.h"
-#include "constants/species.h"
extern struct MusicPlayerInfo gMPlayInfo_BGM;
diff --git a/src/pokedex.c b/src/pokedex.c
index 40b45e53e..4390f47cb 100644
--- a/src/pokedex.c
+++ b/src/pokedex.c
@@ -28,7 +28,6 @@
#include "window.h"
#include "constants/rgb.h"
#include "constants/songs.h"
-#include "constants/species.h"
enum
{
diff --git a/src/pokedex_area_screen.c b/src/pokedex_area_screen.c
index 8450f8530..cfd5e67e4 100755
--- a/src/pokedex_area_screen.c
+++ b/src/pokedex_area_screen.c
@@ -20,7 +20,6 @@
#include "constants/region_map_sections.h"
#include "constants/rgb.h"
#include "constants/songs.h"
-#include "constants/species.h"
#define AREA_SCREEN_WIDTH 32
#define AREA_SCREEN_HEIGHT 20
diff --git a/src/pokemon.c b/src/pokemon.c
index a38ad12de..3621284d6 100644
--- a/src/pokemon.c
+++ b/src/pokemon.c
@@ -44,7 +44,6 @@
#include "constants/layouts.h"
#include "constants/moves.h"
#include "constants/songs.h"
-#include "constants/species.h"
#include "constants/trainers.h"
struct SpeciesItem
@@ -2837,9 +2836,9 @@ void CalculateMonStats(struct Pokemon *mon)
newMaxHP = (((n + hpEV / 4) * level) / 100) + level + 10;
}
- gBattleScripting.field_23 = newMaxHP - oldMaxHP;
- if (gBattleScripting.field_23 == 0)
- gBattleScripting.field_23 = 1;
+ gBattleScripting.levelUpHP = newMaxHP - oldMaxHP;
+ if (gBattleScripting.levelUpHP == 0)
+ gBattleScripting.levelUpHP = 1;
SetMonData(mon, MON_DATA_MAX_HP, &newMaxHP);
@@ -2861,6 +2860,8 @@ void CalculateMonStats(struct Pokemon *mon)
if (currentHP == 0 && oldMaxHP == 0)
currentHP = newMaxHP;
else if (currentHP != 0)
+ // BUG: currentHP is unintentionally able to become <= 0 after the instruction below. This causes the pomeg berry glitch.
+ // To fix that set currentHP = 1 if currentHP <= 0.
currentHP += newMaxHP - oldMaxHP;
else
return;
@@ -4911,19 +4912,21 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
break;
}
}
+
+ // Get amount of HP to restore
dataUnsigned = itemEffect[var_3C++];
switch (dataUnsigned)
{
- case 0xFF:
+ case ITEM6_HEAL_FULL:
dataUnsigned = GetMonData(mon, MON_DATA_MAX_HP, NULL) - GetMonData(mon, MON_DATA_HP, NULL);
break;
- case 0xFE:
+ case ITEM6_HEAL_HALF:
dataUnsigned = GetMonData(mon, MON_DATA_MAX_HP, NULL) / 2;
if (dataUnsigned == 0)
dataUnsigned = 1;
break;
- case 0xFD:
- dataUnsigned = gBattleScripting.field_23;
+ case ITEM6_HEAL_LVL_UP:
+ dataUnsigned = gBattleScripting.levelUpHP;
break;
}
if (GetMonData(mon, MON_DATA_MAX_HP, NULL) != GetMonData(mon, MON_DATA_HP, NULL))
diff --git a/src/pokemon_animation.c b/src/pokemon_animation.c
index 916a57907..bfcf77b5c 100644
--- a/src/pokemon_animation.c
+++ b/src/pokemon_animation.c
@@ -8,7 +8,6 @@
#include "util.h"
#include "constants/battle_anim.h"
#include "constants/rgb.h"
-#include "constants/species.h"
struct UnkAnimStruct
{
diff --git a/src/pokemon_icon.c b/src/pokemon_icon.c
index 7d8c65d7c..b85a29151 100644
--- a/src/pokemon_icon.c
+++ b/src/pokemon_icon.c
@@ -4,7 +4,6 @@
#include "palette.h"
#include "pokemon_icon.h"
#include "sprite.h"
-#include "constants/species.h"
#define POKE_ICON_BASE_PAL_TAG 56000
diff --git a/src/pokemon_jump.c b/src/pokemon_jump.c
index 81f3a784f..d54275940 100755
--- a/src/pokemon_jump.c
+++ b/src/pokemon_jump.c
@@ -29,7 +29,6 @@
#include "pokemon_jump.h"
#include "constants/rgb.h"
#include "constants/songs.h"
-#include "constants/species.h"
struct PokemonJump1_MonInfo
{
diff --git a/src/pokemon_size_record.c b/src/pokemon_size_record.c
index 914d68925..f8b361912 100644
--- a/src/pokemon_size_record.c
+++ b/src/pokemon_size_record.c
@@ -6,7 +6,6 @@
#include "pokemon_size_record.h"
#include "string_util.h"
#include "text.h"
-#include "constants/species.h"
#define DEFAULT_MAX_SIZE 0x8000 // was 0x8100 in Ruby/Sapphire
diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c
index 546f50dce..11c56706a 100644
--- a/src/pokemon_storage_system.c
+++ b/src/pokemon_storage_system.c
@@ -41,7 +41,6 @@
#include "constants/moves.h"
#include "constants/rgb.h"
#include "constants/songs.h"
-#include "constants/species.h"
struct WallpaperTable
{
@@ -3184,7 +3183,7 @@ static void Cb_ShowMarkMenu(u8 taskId)
sPSSData->state++;
break;
case 1:
- if (!sub_811FBA4())
+ if (!MonMarkingsMenuHandleInput())
{
sub_811FAF8();
ClearBottomWindow();
diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c
index d016c455c..8ea25295c 100644
--- a/src/pokemon_summary_screen.c
+++ b/src/pokemon_summary_screen.c
@@ -46,7 +46,6 @@
#include "constants/region_map_sections.h"
#include "constants/rgb.h"
#include "constants/songs.h"
-#include "constants/species.h"
// Screen titles (upper left)
#define PSS_LABEL_WINDOW_POKEMON_INFO_TITLE 0
@@ -3977,7 +3976,7 @@ static void StopPokemonAnimations(void) // A subtle effect, this function stops
static void CreateMonMarkingsSprite(struct Pokemon *mon)
{
- struct Sprite *sprite = sub_811FF94(TAG_MON_MARKINGS, TAG_MON_MARKINGS, sSummaryMarkingsPalette);
+ struct Sprite *sprite = CreateMonMarkingsSpriteWithPal(TAG_MON_MARKINGS, TAG_MON_MARKINGS, sSummaryMarkingsPalette);
sMonSummaryScreen->markingsSprite = sprite;
if (sprite != NULL)
diff --git a/src/pokenav.c b/src/pokenav.c
index 8ea33575a..eac0c85b4 100644
--- a/src/pokenav.c
+++ b/src/pokenav.c
@@ -14,8 +14,6 @@
#define LOOPED_TASK_PRIMARY_ID(taskId) (taskId & 0xFFFF)
#define LOOPED_TASK_SECONDARY_ID(taskId) (taskId >> 16)
-#define SUBSTRUCT_COUNT 19
-
struct PokenavResources
{
u32 (*currentMenuCb1)(void);
@@ -23,7 +21,7 @@ struct PokenavResources
u16 mode;
u16 conditionSearchId;
bool32 hasAnyRibbons;
- void *field10[SUBSTRUCT_COUNT];
+ void *substructPtrs[POKENAV_SUBSTRUCT_COUNT];
};
struct PokenavCallbacks
@@ -38,7 +36,7 @@ struct PokenavCallbacks
};
static u32 GetCurrentMenuCB(void);
-static u32 sub_81C75D4(void);
+static u32 IsActiveMenuLoopTaskActive_(void);
static bool32 SetActivePokenavMenu(u32 menuId);
static bool32 AnyMonHasRibbon(void);
static void InitPokenavResources(struct PokenavResources *a0);
@@ -126,43 +124,43 @@ const struct PokenavCallbacks PokenavMenuCallbacks[15] =
},
[POKENAV_CONDITION_PARTY - POKENAV_MENU_IDS_START] =
{
- .init = PokenavCallback_Init_7,
- .callback = sub_81CD070,
- .open = sub_81CDDD4,
- .createLoopTask = sub_81CDE2C,
- .isLoopTaskActive = sub_81CDE64,
- .free1 = sub_81CD1C0,
- .free2 = sub_81CECA0,
+ .init = PokenavCallback_Init_PartyCondition,
+ .callback = GetPartyConditionCallback,
+ .open = OpenPartyConditionMenu,
+ .createLoopTask = CreatePartyConditionLoopedTask,
+ .isLoopTaskActive = IsPartyConditionLoopedTaskActive,
+ .free1 = FreePartyConditionSubstruct1,
+ .free2 = FreePartyConditionSubstruct2,
},
[POKENAV_CONDITION_SEARCH_RESULTS - POKENAV_MENU_IDS_START] =
{
- .init = PokenavCallback_Init_8,
- .callback = sub_81CEFDC,
- .open = sub_81CF330,
- .createLoopTask = sub_81CF3A0,
- .isLoopTaskActive = sub_81CF3D0,
- .free1 = sub_81CEFF0,
- .free2 = sub_81CF3F8,
+ .init = PokenavCallback_Init_ConditionSearch,
+ .callback = GetConditionSearchResultsCallback,
+ .open = OpenConditionSearchResults,
+ .createLoopTask = CreateSearchResultsLoopedTask,
+ .isLoopTaskActive = IsSearchResultLoopedTaskActive,
+ .free1 = FreeSearchResultSubstruct1,
+ .free2 = FreeSearchResultSubstruct2,
},
- [POKENAV_MENU_9 - POKENAV_MENU_IDS_START] =
+ [POKENAV_CONDITION_GRAPH_FROM_SEARCH - POKENAV_MENU_IDS_START] =
{
- .init = PokenavCallback_Init_9,
- .callback = sub_81CD070,
- .open = sub_81CDDD4,
- .createLoopTask = sub_81CDE2C,
- .isLoopTaskActive = sub_81CDE64,
- .free1 = sub_81CD1C0,
- .free2 = sub_81CECA0,
+ .init = PokenavCallback_Init_ConditionGraphFromSearch,
+ .callback = GetPartyConditionCallback,
+ .open = OpenPartyConditionMenu,
+ .createLoopTask = CreatePartyConditionLoopedTask,
+ .isLoopTaskActive = IsPartyConditionLoopedTaskActive,
+ .free1 = FreePartyConditionSubstruct1,
+ .free2 = FreePartyConditionSubstruct2,
},
- [POKENAV_MENU_A - POKENAV_MENU_IDS_START] =
+ [POKENAV_RETURN_CONDITION_SEARCH - POKENAV_MENU_IDS_START] =
{
- .init = PokenavCallback_Init_10,
- .callback = sub_81CEFDC,
- .open = sub_81CF368,
- .createLoopTask = sub_81CF3A0,
- .isLoopTaskActive = sub_81CF3D0,
- .free1 = sub_81CEFF0,
- .free2 = sub_81CF3F8,
+ .init = PokenavCallback_Init_ReturnToMonSearchList,
+ .callback = GetConditionSearchResultsCallback,
+ .open = OpenConditionSearchListFromGraph,
+ .createLoopTask = CreateSearchResultsLoopedTask,
+ .isLoopTaskActive = IsSearchResultLoopedTaskActive,
+ .free1 = FreeSearchResultSubstruct1,
+ .free2 = FreeSearchResultSubstruct2,
},
[POKENAV_MATCH_CALL - POKENAV_MENU_IDS_START] =
{
@@ -176,33 +174,33 @@ const struct PokenavCallbacks PokenavMenuCallbacks[15] =
},
[POKENAV_RIBBONS_MON_LIST - POKENAV_MENU_IDS_START] =
{
- .init = PokenavCallback_Init_12,
- .callback = sub_81CFA34,
- .open = sub_81CFDD0,
- .createLoopTask = sub_81CFE40,
- .isLoopTaskActive = sub_81CFE70,
- .free1 = sub_81CFA48,
- .free2 = sub_81CFE98,
+ .init = PokenavCallback_Init_MonRibbonList,
+ .callback = GetRibbonsMonListCallback,
+ .open = OpenRibbonsMonList,
+ .createLoopTask = CreateRibbonsMonListLoopedTask,
+ .isLoopTaskActive = IsRibbonsMonListLoopedTaskActive,
+ .free1 = FreeRibbonsMonList1,
+ .free2 = FreeRibbonsMonList2,
},
- [POKENAV_MENU_D - POKENAV_MENU_IDS_START] =
+ [POKENAV_RIBBONS_SUMMARY_SCREEN - POKENAV_MENU_IDS_START] =
{
- .init = PokenavCallback_Init_13,
- .callback = sub_81D04A0,
- .open = sub_81D0978,
- .createLoopTask = sub_81D09B0,
- .isLoopTaskActive = sub_81D09E0,
- .free1 = sub_81D04B8,
- .free2 = sub_81D09F4,
+ .init = PokenavCallback_Init_RibbonsSummaryMenu,
+ .callback = GetRibbonsSummaryMenuCallback,
+ .open = OpenRibbonsSummaryMenu,
+ .createLoopTask = CreateRibbonsSummaryLoopedTask,
+ .isLoopTaskActive = IsRibbonsSummaryLoopedTaskActive,
+ .free1 = FreeRibbonsSummaryScreen1,
+ .free2 = FreeRibbonsSummaryScreen2,
},
- [POKENAV_MENU_E - POKENAV_MENU_IDS_START] =
+ [POKENAV_RIBBONS_RETURN_TO_MON_LIST - POKENAV_MENU_IDS_START] =
{
- .init = PokenavCallback_Init_14,
- .callback = sub_81CFA34,
- .open = sub_81CFE08,
- .createLoopTask = sub_81CFE40,
- .isLoopTaskActive = sub_81CFE70,
- .free1 = sub_81CFA48,
- .free2 = sub_81CFE98,
+ .init = PokenavCallback_Init_RibbonsMonListFromSummary,
+ .callback = GetRibbonsMonListCallback,
+ .open = OpenRibbonsMonListFromRibbonsSummary,
+ .createLoopTask = CreateRibbonsMonListLoopedTask,
+ .isLoopTaskActive = IsRibbonsMonListLoopedTaskActive,
+ .free1 = FreeRibbonsMonList1,
+ .free2 = FreeRibbonsMonList2,
},
};
@@ -368,24 +366,24 @@ static void FreePokenavResources(void)
{
int i;
- for (i = 0; i < SUBSTRUCT_COUNT; i++)
+ for (i = 0; i < POKENAV_SUBSTRUCT_COUNT; i++)
FreePokenavSubstruct(i);
FREE_AND_SET_NULL(gPokenavResources);
InitKeys();
}
-static void InitPokenavResources(struct PokenavResources *a0)
+static void InitPokenavResources(struct PokenavResources *resources)
{
int i;
- for (i = 0; i < SUBSTRUCT_COUNT; i++)
- a0->field10[i] = NULL;
+ for (i = 0; i < POKENAV_SUBSTRUCT_COUNT; i++)
+ resources->substructPtrs[i] = NULL;
- a0->mode = POKENAV_MODE_NORMAL;
- a0->currentMenuIndex = 0;
- a0->hasAnyRibbons = AnyMonHasRibbon();
- a0->currentMenuCb1 = NULL;
+ resources->mode = POKENAV_MODE_NORMAL;
+ resources->currentMenuIndex = 0;
+ resources->hasAnyRibbons = AnyMonHasRibbon();
+ resources->currentMenuCb1 = NULL;
}
static bool32 AnyMonHasRibbon(void)
@@ -453,12 +451,12 @@ static void Task_Pokenav(u8 taskId)
tState = 4;
break;
case 2:
- if (sub_81C786C())
+ if (IsActiveMenuLoopTaskActive())
break;
tState = 3;
case 3:
menuId = GetCurrentMenuCB();
- if (menuId == -1)
+ if (menuId == POKENAV_MENU_FUNC_EXIT)
{
ShutdownPokenav();
tState = 5;
@@ -479,13 +477,13 @@ static void Task_Pokenav(u8 taskId)
}
else if (menuId != 0)
{
- sub_81C7850(menuId);
- if (sub_81C786C())
+ RunMainMenuLoopedTask(menuId);
+ if (IsActiveMenuLoopTaskActive())
tState = 2;
}
break;
case 4:
- if (!sub_81C75D4())
+ if (!IsActiveMenuLoopTaskActive_())
tState = 3;
break;
case 5:
@@ -516,15 +514,15 @@ static bool32 SetActivePokenavMenu(u32 menuId)
if (!PokenavMenuCallbacks[index].open())
return FALSE;
- sub_81C7834(PokenavMenuCallbacks[index].createLoopTask, PokenavMenuCallbacks[index].isLoopTaskActive);
+ SetActiveMenuLoopTasks(PokenavMenuCallbacks[index].createLoopTask, PokenavMenuCallbacks[index].isLoopTaskActive);
gPokenavResources->currentMenuCb1 = PokenavMenuCallbacks[index].callback;
gPokenavResources->currentMenuIndex = index;
return TRUE;
}
-static u32 sub_81C75D4(void)
+static u32 IsActiveMenuLoopTaskActive_(void)
{
- return sub_81C786C();
+ return IsActiveMenuLoopTaskActive();
}
static u32 GetCurrentMenuCB(void)
@@ -549,19 +547,19 @@ void SetPokenavVBlankCallback(void)
void *AllocSubstruct(u32 index, u32 size)
{
- gPokenavResources->field10[index] = Alloc(size);
- return gPokenavResources->field10[index];
+ gPokenavResources->substructPtrs[index] = Alloc(size);
+ return gPokenavResources->substructPtrs[index];
}
void *GetSubstructPtr(u32 index)
{
- return gPokenavResources->field10[index];
+ return gPokenavResources->substructPtrs[index];
}
void FreePokenavSubstruct(u32 index)
{
- if (gPokenavResources->field10[index] != NULL)
- FREE_AND_SET_NULL(gPokenavResources->field10[index]);
+ if (gPokenavResources->substructPtrs[index] != NULL)
+ FREE_AND_SET_NULL(gPokenavResources->substructPtrs[index]);
}
u32 GetPokenavMode(void)
diff --git a/src/pokenav_conditions_1.c b/src/pokenav_conditions_1.c
index 1c7573a44..77d982d85 100644
--- a/src/pokenav_conditions_1.c
+++ b/src/pokenav_conditions_1.c
@@ -12,105 +12,104 @@
#include "strings.h"
#include "text.h"
#include "constants/songs.h"
-#include "constants/species.h"
struct PokenavSub11
{
u32 monPal[3][0x20];
u8 fill[0x180];
u32 monPicGfx[3][0x800];
- u8 unk6300;
- s16 unk6302;
- u32 (*unk6304)(struct PokenavSub11 *);
+ u8 searchMode;
+ s16 monIndex;
+ u32 (*callback)(struct PokenavSub11 *);
u8 fill2[0x6320 - 0x6308];
- u8 unk6320[3][24];
- u8 unk6368[3][64];
- struct ConditionGraph unk6428;
- u8 unk6780[3];
- u8 unk6783[3];
- s8 unk6786;
+ u8 searchLocBuffer[3][24];
+ u8 nameBuffer[3][64];
+ struct ConditionGraph conditionData;
+ u8 sheen[3];
+ u8 monMarks[3];
+ s8 mark;
s8 unk6787;
s8 unk6788;
s8 unk6789;
- u8 unk678A;
+ u8 state;
};
-void sub_81CD970(void);
+void InitPartyConditionListParameters(void);
void sub_81CD9F8(void);
-u32 sub_81CD08C(struct PokenavSub11 *structPtr);
-u32 sub_81CD19C(struct PokenavSub11 *structPtr);
-u32 sub_81CD110(struct PokenavSub11 *structPtr);
-u8 sub_81CD1E4(struct PokenavSub11 *structPtr);
-u8 sub_81CD258(u8 arg0);
-void sub_81CD824(s16 arg0, u8 arg1);
-void sub_81CDA1C(s16 arg0, u8 arg1);
-void sub_81CDB98(s16 arg0, u8 arg1);
+u32 HandlePartyConditionInput(struct PokenavSub11 *structPtr);
+u32 GetConditionReturnCallback(struct PokenavSub11 *structPtr);
+u32 ConditionMenu_OpenMarkingsMenu(struct PokenavSub11 *structPtr);
+u8 ConditionGraphHandleDpadInput(struct PokenavSub11 *structPtr);
+u8 SwitchConditionSummaryIndex(u8 moveUp);
+void CopyMonNameGenderLocation(s16 id, u8 arg1);
+void GetMonConditionGraphData(s16 id, u8 arg1);
+void ConditionGraphDrawMonPic(s16 id, u8 arg1);
// code
-bool32 PokenavCallback_Init_7(void)
+bool32 PokenavCallback_Init_PartyCondition(void)
{
- struct PokenavSub11 *structPtr = AllocSubstruct(11, sizeof(struct PokenavSub11));
+ struct PokenavSub11 *structPtr = AllocSubstruct(POKENAV_SUBSTRUCT_CONDITION_GRAPH, sizeof(struct PokenavSub11));
if (structPtr == NULL)
return FALSE;
- sub_81D1ED4(&structPtr->unk6428);
- sub_81CD970();
+ InitConditionGraphData(&structPtr->conditionData);
+ InitPartyConditionListParameters();
gKeyRepeatStartDelay = 20;
- structPtr->unk6304 = sub_81CD08C;
+ structPtr->callback = HandlePartyConditionInput;
return TRUE;
}
-bool32 PokenavCallback_Init_9(void)
+bool32 PokenavCallback_Init_ConditionGraphFromSearch(void)
{
- struct PokenavSub11 *structPtr = AllocSubstruct(11, sizeof(struct PokenavSub11));
+ struct PokenavSub11 *structPtr = AllocSubstruct(POKENAV_SUBSTRUCT_CONDITION_GRAPH, sizeof(struct PokenavSub11));
if (structPtr == NULL)
return FALSE;
- sub_81D1ED4(&structPtr->unk6428);
+ InitConditionGraphData(&structPtr->conditionData);
sub_81CD9F8();
gKeyRepeatStartDelay = 20;
- structPtr->unk6304 = sub_81CD08C;
+ structPtr->callback = HandlePartyConditionInput;
return TRUE;
}
-u32 sub_81CD070(void)
+u32 GetPartyConditionCallback(void)
{
- struct PokenavSub11 *structPtr = GetSubstructPtr(11);
+ struct PokenavSub11 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_GRAPH);
- return structPtr->unk6304(structPtr);
+ return structPtr->callback(structPtr);
}
-u32 sub_81CD08C(struct PokenavSub11 *structPtr)
+u32 HandlePartyConditionInput(struct PokenavSub11 *structPtr)
{
- struct PokenavSub18 *unkPtr = GetSubstructPtr(18);
- u32 ret = sub_81CD1E4(structPtr);
+ struct PokenavSub18 *monListPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MON_LIST);
+ u32 ret = ConditionGraphHandleDpadInput(structPtr);
- if (ret == 0)
+ if (ret == PARTY_CONDITION_FUNC_NONE)
{
if (gMain.newKeys & B_BUTTON)
{
PlaySE(SE_SELECT);
- structPtr->unk6304 = sub_81CD19C;
- ret = 2;
+ structPtr->callback = GetConditionReturnCallback;
+ ret = PARTY_CONDITION_FUNC_RETURN;
}
else if (gMain.newKeys & A_BUTTON)
{
- if (structPtr->unk6300 == 0)
+ if (structPtr->searchMode == 0)
{
- if (unkPtr->unk2 == unkPtr->unk0 - 1)
+ if (monListPtr->currIndex == monListPtr->listCount - 1)
{
PlaySE(SE_SELECT);
- structPtr->unk6304 = sub_81CD19C;
- ret = 2;
+ structPtr->callback = GetConditionReturnCallback;
+ ret = PARTY_CONDITION_FUNC_RETURN;
}
}
else
{
PlaySE(SE_SELECT);
- ret = 5;
- structPtr->unk6304 = sub_81CD110;
+ ret = PARTY_CONDITION_FUNC_ADD_MARKINGS;
+ structPtr->callback = ConditionMenu_OpenMarkingsMenu;
}
}
}
@@ -118,204 +117,204 @@ u32 sub_81CD08C(struct PokenavSub11 *structPtr)
return ret;
}
-u32 sub_81CD110(struct PokenavSub11 *structPtr)
+u32 ConditionMenu_OpenMarkingsMenu(struct PokenavSub11 *structPtr)
{
- struct PokenavSub18 *unkPtr;
+ struct PokenavSub18 *monListPtr;
u8 markings;
- u32 ret = 0, boxId, monId;
+ u32 ret = PARTY_CONDITION_FUNC_NONE, boxId, monId;
- if (!sub_811FBA4())
+ if (!MonMarkingsMenuHandleInput())
{
- structPtr->unk6783[structPtr->unk6786] = sub_81CEF14();
- unkPtr = GetSubstructPtr(18);
- boxId = unkPtr->unk4[unkPtr->unk2].boxId;
- monId = unkPtr->unk4[unkPtr->unk2].monId;
- markings = structPtr->unk6783[structPtr->unk6786];
+ structPtr->monMarks[structPtr->mark] = GetMonMarkingsData();
+ monListPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MON_LIST);
+ boxId = monListPtr->monData[monListPtr->currIndex].boxId;
+ monId = monListPtr->monData[monListPtr->currIndex].monId;
+ markings = structPtr->monMarks[structPtr->mark];
if (boxId == TOTAL_BOXES_COUNT)
SetMonData(&gPlayerParty[monId], MON_DATA_MARKINGS, &markings);
else
SetBoxMonDataAt(boxId, monId, MON_DATA_MARKINGS, &markings);
- structPtr->unk6304 = sub_81CD08C;
- ret = 6;
+ structPtr->callback = HandlePartyConditionInput;
+ ret = PARTY_CONDITION_FUNC_CLOSE_MARKINGS;
}
return ret;
}
-u32 sub_81CD19C(struct PokenavSub11 *structPtr)
+u32 GetConditionReturnCallback(struct PokenavSub11 *structPtr)
{
- if (structPtr->unk6300 == 0)
+ if (structPtr->searchMode == 0)
return POKENAV_CONDITION_MENU;
else
- return POKENAV_MENU_A;
+ return POKENAV_RETURN_CONDITION_SEARCH;
}
-void sub_81CD1C0(void)
+void FreePartyConditionSubstruct1(void)
{
- struct PokenavSub11 *structPtr = GetSubstructPtr(11);
- if (structPtr->unk6300 == 0)
- FreePokenavSubstruct(18);
+ struct PokenavSub11 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_GRAPH);
+ if (structPtr->searchMode == 0)
+ FreePokenavSubstruct(POKENAV_SUBSTRUCT_MON_LIST);
- FreePokenavSubstruct(11);
+ FreePokenavSubstruct(POKENAV_SUBSTRUCT_CONDITION_GRAPH);
}
-u8 sub_81CD1E4(struct PokenavSub11 *structPtr)
+u8 ConditionGraphHandleDpadInput(struct PokenavSub11 *structPtr)
{
- struct PokenavSub18 *unkPtr = GetSubstructPtr(18);
+ struct PokenavSub18 *monListPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MON_LIST);
u8 ret = 0;
if (gMain.heldKeys & DPAD_UP)
{
- if (structPtr->unk6300 == 0 || unkPtr->unk2 != 0)
+ if (structPtr->searchMode == 0 || monListPtr->currIndex != 0)
{
PlaySE(SE_SELECT);
- ret = sub_81CD258(1);
+ ret = SwitchConditionSummaryIndex(1);
}
}
else if (gMain.heldKeys & DPAD_DOWN)
{
- if (structPtr->unk6300 == 0 || unkPtr->unk2 < unkPtr->unk0 - 1)
+ if (structPtr->searchMode == 0 || monListPtr->currIndex < monListPtr->listCount - 1)
{
PlaySE(SE_SELECT);
- ret = sub_81CD258(0);
+ ret = SwitchConditionSummaryIndex(0);
}
}
return ret;
}
-u8 sub_81CD258(u8 arg0)
+u8 SwitchConditionSummaryIndex(u8 moveUp)
{
u16 r7;
- bool8 r6, r0;
- struct PokenavSub11 *structPtr = GetSubstructPtr(11);
- struct PokenavSub18 *unkPtr = GetSubstructPtr(18);
-
- r7 = (arg0) ? structPtr->unk6788 : structPtr->unk6787;
- sub_81D1F84(&structPtr->unk6428, structPtr->unk6428.unk14[structPtr->unk6786], structPtr->unk6428.unk14[r7]);
- r6 = (unkPtr->unk2 != ((sub_81CDD5C() != 0) ? unkPtr->unk0 : unkPtr->unk0 - 1));
- if (arg0)
+ bool8 wasNotLastMon, isNotLastMon;
+ struct PokenavSub11 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_GRAPH);
+ struct PokenavSub18 *monListPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MON_LIST);
+
+ r7 = (moveUp) ? structPtr->unk6788 : structPtr->unk6787;
+ sub_81D1F84(&structPtr->conditionData, structPtr->conditionData.unk14[structPtr->mark], structPtr->conditionData.unk14[r7]);
+ wasNotLastMon = (monListPtr->currIndex != ((IsConditionMenuSearchMode() != 0) ? monListPtr->listCount : monListPtr->listCount - 1));
+ if (moveUp)
{
structPtr->unk6788 = structPtr->unk6787;
- structPtr->unk6787 = structPtr->unk6786;
- structPtr->unk6786 = r7;
+ structPtr->unk6787 = structPtr->mark;
+ structPtr->mark = r7;
structPtr->unk6789 = structPtr->unk6788;
- unkPtr->unk2 = (unkPtr->unk2 == 0) ? unkPtr->unk0 - 1 : unkPtr->unk2 - 1;
- structPtr->unk6302 = (unkPtr->unk2 != 0) ? unkPtr->unk2 - 1 : unkPtr->unk0 - 1;
+ monListPtr->currIndex = (monListPtr->currIndex == 0) ? monListPtr->listCount - 1 : monListPtr->currIndex - 1;
+ structPtr->monIndex = (monListPtr->currIndex != 0) ? monListPtr->currIndex - 1 : monListPtr->listCount - 1;
}
else
{
structPtr->unk6787 = structPtr->unk6788;
- structPtr->unk6788 = structPtr->unk6786;
- structPtr->unk6786 = r7;
+ structPtr->unk6788 = structPtr->mark;
+ structPtr->mark = r7;
structPtr->unk6789 = structPtr->unk6787;
- unkPtr->unk2 = (unkPtr->unk2 < unkPtr->unk0 - 1) ? unkPtr->unk2 + 1 : 0;
- structPtr->unk6302 = (unkPtr->unk2 < unkPtr->unk0 - 1) ? unkPtr->unk2 + 1 : 0;
+ monListPtr->currIndex = (monListPtr->currIndex < monListPtr->listCount - 1) ? monListPtr->currIndex + 1 : 0;
+ structPtr->monIndex = (monListPtr->currIndex < monListPtr->listCount - 1) ? monListPtr->currIndex + 1 : 0;
}
- r0 = (unkPtr->unk2 != ((sub_81CDD5C() != 0) ? unkPtr->unk0 : unkPtr->unk0 - 1));
-
- if (!r6)
- return 3;
- else if (!r0)
- return 4;
+ isNotLastMon = (monListPtr->currIndex != ((IsConditionMenuSearchMode() != 0) ? monListPtr->listCount : monListPtr->listCount - 1));
+
+ if (!wasNotLastMon)
+ return PARTY_CONDITION_FUNC_NO_TRANSITION;
+ else if (!isNotLastMon)
+ return PARTY_CONDITION_FUNC_SLIDE_MON_OUT;
else
- return 1;
+ return PARTY_CONDITION_FUNC_SLIDE_MON_IN;
}
-bool32 sub_81CD3C4(void)
+bool32 LoadPartyConditionMenuGfx(void)
{
s32 var;
- struct PokenavSub11 *structPtr = GetSubstructPtr(11);
- struct PokenavSub18 *unkPtr = GetSubstructPtr(18);
+ struct PokenavSub11 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_GRAPH);
+ struct PokenavSub18 *monListPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MON_LIST);
- switch (structPtr->unk678A)
+ switch (structPtr->state)
{
case 0:
- sub_81CD824(unkPtr->unk2, 0);
+ CopyMonNameGenderLocation(monListPtr->currIndex, 0);
break;
case 1:
- sub_81CDA1C(unkPtr->unk2, 0);
+ GetMonConditionGraphData(monListPtr->currIndex, 0);
break;
case 2:
- sub_81CDB98(unkPtr->unk2, 0);
+ ConditionGraphDrawMonPic(monListPtr->currIndex, 0);
break;
case 3:
- if (unkPtr->unk0 == 1)
+ if (monListPtr->listCount == 1)
{
- structPtr->unk6786 = 0;
+ structPtr->mark = 0;
structPtr->unk6787 = 0;
structPtr->unk6788 = 0;
- structPtr->unk678A = 0;
+ structPtr->state = 0;
return TRUE;
}
else
{
- structPtr->unk6786 = 0;
+ structPtr->mark = 0;
structPtr->unk6787 = 1;
structPtr->unk6788 = 2;
}
break;
// These were probably ternaries just like cases 7-9, but couldn't match it any other way.
case 4:
- var = unkPtr->unk2 + 1;
- if (var >= unkPtr->unk0)
+ var = monListPtr->currIndex + 1;
+ if (var >= monListPtr->listCount)
var = 0;
- sub_81CD824(var, 1);
+ CopyMonNameGenderLocation(var, 1);
break;
case 5:
- var = unkPtr->unk2 + 1;
- if (var >= unkPtr->unk0)
+ var = monListPtr->currIndex + 1;
+ if (var >= monListPtr->listCount)
var = 0;
- sub_81CDA1C(var, 1);
+ GetMonConditionGraphData(var, 1);
break;
case 6:
- var = unkPtr->unk2 + 1;
- if (var >= unkPtr->unk0)
+ var = monListPtr->currIndex + 1;
+ if (var >= monListPtr->listCount)
var = 0;
- sub_81CDB98(var, 1);
+ ConditionGraphDrawMonPic(var, 1);
break;
case 7:
- sub_81CD824((unkPtr->unk2 - 1 >= 0) ? unkPtr->unk2 - 1 : unkPtr->unk0 - 1, 2);
+ CopyMonNameGenderLocation((monListPtr->currIndex - 1 >= 0) ? monListPtr->currIndex - 1 : monListPtr->listCount - 1, 2);
break;
case 8:
- sub_81CDA1C((unkPtr->unk2 - 1 >= 0) ? unkPtr->unk2 - 1 : unkPtr->unk0 - 1, 2);
+ GetMonConditionGraphData((monListPtr->currIndex - 1 >= 0) ? monListPtr->currIndex - 1 : monListPtr->listCount - 1, 2);
break;
case 9:
- sub_81CDB98((unkPtr->unk2 - 1 >= 0) ? unkPtr->unk2 - 1 : unkPtr->unk0 - 1, 2);
- structPtr->unk678A = 0;
+ ConditionGraphDrawMonPic((monListPtr->currIndex - 1 >= 0) ? monListPtr->currIndex - 1 : monListPtr->listCount - 1, 2);
+ structPtr->state = 0;
return TRUE;
}
- structPtr->unk678A++;
+ structPtr->state++;
return FALSE;
}
-bool32 sub_81CD548(u8 arg0)
+bool32 SetConditionGraphData(u8 mode)
{
- struct PokenavSub11 *structPtr = GetSubstructPtr(11);
+ struct PokenavSub11 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_GRAPH);
- switch (arg0)
+ switch (mode)
{
case 0:
- sub_81CD824(structPtr->unk6302, structPtr->unk6789);
+ CopyMonNameGenderLocation(structPtr->monIndex, structPtr->unk6789);
break;
case 1:
- sub_81CDA1C(structPtr->unk6302, structPtr->unk6789);
+ GetMonConditionGraphData(structPtr->monIndex, structPtr->unk6789);
break;
case 2:
- sub_81CDB98(structPtr->unk6302, structPtr->unk6789);
+ ConditionGraphDrawMonPic(structPtr->monIndex, structPtr->unk6789);
return TRUE;
}
return FALSE;
}
-u8 *sub_81CD5CC(u8 *dst, const u8 *src, s16 n)
+u8 *CopyStringLeftAlignedToConditionData(u8 *dst, const u8 *src, s16 n)
{
while (*src != EOS)
*dst++ = *src++, n--;
@@ -327,15 +326,15 @@ u8 *sub_81CD5CC(u8 *dst, const u8 *src, s16 n)
return dst;
}
-u8 *sub_81CD624(u8 *str, u16 id, bool8 arg3)
+u8 *CopyMonConditionNameGender(u8 *str, u16 id, bool8 arg3)
{
u16 boxId, monId, gender, species, level, lvlDigits;
struct BoxPokemon *boxMon;
u8 *txtPtr, *str_;
- struct PokenavSub18 *unkPtr = GetSubstructPtr(18);
+ struct PokenavSub18 *monListPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MON_LIST);
- boxId = unkPtr->unk4[id].boxId;
- monId = unkPtr->unk4[id].monId;
+ boxId = monListPtr->monData[id].boxId;
+ monId = monListPtr->monData[id].monId;
*(str++) = EXT_CTRL_CODE_BEGIN;
*(str++) = EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW;
*(str++) = TEXT_COLOR_BLUE;
@@ -418,115 +417,115 @@ u8 *sub_81CD624(u8 *str, u16 id, bool8 arg3)
return str_;
}
-void sub_81CD824(s16 arg0, u8 arg1)
+void CopyMonNameGenderLocation(s16 id, u8 arg1)
{
u16 boxId, i;
- struct PokenavSub11 *structPtr = GetSubstructPtr(11);
- struct PokenavSub18 *unkPtr = GetSubstructPtr(18);
+ struct PokenavSub11 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_GRAPH);
+ struct PokenavSub18 *monListPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MON_LIST);
- if (arg0 != (sub_81CDD5C() != 0 ? unkPtr->unk0 : unkPtr->unk0 - 1))
+ if (id != (IsConditionMenuSearchMode() != 0 ? monListPtr->listCount : monListPtr->listCount - 1))
{
- sub_81CD624(structPtr->unk6368[arg1], arg0, FALSE);
- boxId = unkPtr->unk4[arg0].boxId;
- structPtr->unk6320[arg1][0] = EXT_CTRL_CODE_BEGIN;
- structPtr->unk6320[arg1][1] = EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW;
- structPtr->unk6320[arg1][2] = TEXT_COLOR_BLUE;
- structPtr->unk6320[arg1][3] = TEXT_COLOR_TRANSPARENT;
- structPtr->unk6320[arg1][4] = TEXT_COLOR_LIGHT_BLUE;
+ CopyMonConditionNameGender(structPtr->nameBuffer[arg1], id, FALSE);
+ boxId = monListPtr->monData[id].boxId;
+ structPtr->searchLocBuffer[arg1][0] = EXT_CTRL_CODE_BEGIN;
+ structPtr->searchLocBuffer[arg1][1] = EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW;
+ structPtr->searchLocBuffer[arg1][2] = TEXT_COLOR_BLUE;
+ structPtr->searchLocBuffer[arg1][3] = TEXT_COLOR_TRANSPARENT;
+ structPtr->searchLocBuffer[arg1][4] = TEXT_COLOR_LIGHT_BLUE;
if (boxId == TOTAL_BOXES_COUNT)
- sub_81CD5CC(&structPtr->unk6320[arg1][5], gText_InParty, 8);
+ CopyStringLeftAlignedToConditionData(&structPtr->searchLocBuffer[arg1][5], gText_InParty, 8);
else
- sub_81CD5CC(&structPtr->unk6320[arg1][5], GetBoxNamePtr(boxId), 8);
+ CopyStringLeftAlignedToConditionData(&structPtr->searchLocBuffer[arg1][5], GetBoxNamePtr(boxId), 8);
}
else
{
for (i = 0; i < 12; i++)
- structPtr->unk6368[arg1][i] = CHAR_SPACE;
- structPtr->unk6368[arg1][i] = EOS;
+ structPtr->nameBuffer[arg1][i] = CHAR_SPACE;
+ structPtr->nameBuffer[arg1][i] = EOS;
for (i = 0; i < 8; i++)
- structPtr->unk6320[arg1][i] = CHAR_SPACE;
- structPtr->unk6320[arg1][i] = EOS;
+ structPtr->searchLocBuffer[arg1][i] = CHAR_SPACE;
+ structPtr->searchLocBuffer[arg1][i] = EOS;
}
}
-void sub_81CD970(void)
+void InitPartyConditionListParameters(void)
{
u16 i, count;
- struct PokenavSub11 *structPtr = GetSubstructPtr(11);
- struct PokenavSub18 *unkPtr = AllocSubstruct(18, sizeof(struct PokenavSub18));
+ struct PokenavSub11 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_GRAPH);
+ struct PokenavSub18 *monListPtr = AllocSubstruct(POKENAV_SUBSTRUCT_MON_LIST, sizeof(struct PokenavSub18));
- structPtr->unk6300 = 0;
+ structPtr->searchMode = 0;
for (i = 0, count = 0; i < CalculatePlayerPartyCount(); i++)
{
if (!GetMonData(&gPlayerParty[i], MON_DATA_IS_EGG))
{
- unkPtr->unk4[count].boxId = TOTAL_BOXES_COUNT;
- unkPtr->unk4[count].monId = i;
- unkPtr->unk4[count].data = 0;
+ monListPtr->monData[count].boxId = TOTAL_BOXES_COUNT;
+ monListPtr->monData[count].monId = i;
+ monListPtr->monData[count].data = 0;
count++;
}
}
- unkPtr->unk4[count].boxId = 0;
- unkPtr->unk4[count].monId = 0;
- unkPtr->unk4[count].data = 0;
- unkPtr->unk2 = 0;
- unkPtr->unk0 = count + 1;
- structPtr->unk678A = 0;
+ monListPtr->monData[count].boxId = 0;
+ monListPtr->monData[count].monId = 0;
+ monListPtr->monData[count].data = 0;
+ monListPtr->currIndex = 0;
+ monListPtr->listCount = count + 1;
+ structPtr->state = 0;
}
void sub_81CD9F8(void)
{
- struct PokenavSub11 *structPtr = GetSubstructPtr(11);
- structPtr->unk6300 = 1;
- structPtr->unk678A = 0;
+ struct PokenavSub11 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_GRAPH);
+ structPtr->searchMode = 1;
+ structPtr->state = 0;
}
-void sub_81CDA1C(s16 arg0, u8 arg1)
+void GetMonConditionGraphData(s16 id, u8 arg1)
{
u16 boxId, monId, i;
- struct PokenavSub11 *structPtr = GetSubstructPtr(11);
- struct PokenavSub18 *unkPtr = GetSubstructPtr(18);
+ struct PokenavSub11 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_GRAPH);
+ struct PokenavSub18 *monListPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MON_LIST);
- if (arg0 != (sub_81CDD5C() != 0 ? unkPtr->unk0 : unkPtr->unk0 - 1))
+ if (id != (IsConditionMenuSearchMode() != 0 ? monListPtr->listCount : monListPtr->listCount - 1))
{
- boxId = unkPtr->unk4[arg0].boxId;
- monId = unkPtr->unk4[arg0].monId;
- structPtr->unk6428.unk0[arg1][0] = GetBoxOrPartyMonData(boxId, monId, MON_DATA_COOL, NULL);
- structPtr->unk6428.unk0[arg1][1] = GetBoxOrPartyMonData(boxId, monId, MON_DATA_TOUGH, NULL);
- structPtr->unk6428.unk0[arg1][2] = GetBoxOrPartyMonData(boxId, monId, MON_DATA_SMART, NULL);
- structPtr->unk6428.unk0[arg1][3] = GetBoxOrPartyMonData(boxId, monId, MON_DATA_CUTE, NULL);
- structPtr->unk6428.unk0[arg1][4] = GetBoxOrPartyMonData(boxId, monId, MON_DATA_BEAUTY, NULL);
- structPtr->unk6780[arg1] = (GetBoxOrPartyMonData(boxId, monId, MON_DATA_SHEEN, NULL) != 255)
+ boxId = monListPtr->monData[id].boxId;
+ monId = monListPtr->monData[id].monId;
+ structPtr->conditionData.stat[arg1][0] = GetBoxOrPartyMonData(boxId, monId, MON_DATA_COOL, NULL);
+ structPtr->conditionData.stat[arg1][1] = GetBoxOrPartyMonData(boxId, monId, MON_DATA_TOUGH, NULL);
+ structPtr->conditionData.stat[arg1][2] = GetBoxOrPartyMonData(boxId, monId, MON_DATA_SMART, NULL);
+ structPtr->conditionData.stat[arg1][3] = GetBoxOrPartyMonData(boxId, monId, MON_DATA_CUTE, NULL);
+ structPtr->conditionData.stat[arg1][4] = GetBoxOrPartyMonData(boxId, monId, MON_DATA_BEAUTY, NULL);
+ structPtr->sheen[arg1] = (GetBoxOrPartyMonData(boxId, monId, MON_DATA_SHEEN, NULL) != 255)
? GetBoxOrPartyMonData(boxId, monId, MON_DATA_SHEEN, NULL) / 29u
: 9;
- structPtr->unk6783[arg1] = GetBoxOrPartyMonData(boxId, monId, MON_DATA_MARKINGS, NULL);
- sub_81D2754(structPtr->unk6428.unk0[arg1], structPtr->unk6428.unk14[arg1]);
+ structPtr->monMarks[arg1] = GetBoxOrPartyMonData(boxId, monId, MON_DATA_MARKINGS, NULL);
+ sub_81D2754(structPtr->conditionData.stat[arg1], structPtr->conditionData.unk14[arg1]);
}
else
{
- for (i = 0; i < 5; i++)
+ for (i = 0; i < FLAVOR_COUNT; i++)
{
- structPtr->unk6428.unk0[arg1][i] = 0;
- structPtr->unk6428.unk14[arg1][i].unk0 = 155;
- structPtr->unk6428.unk14[arg1][i].unk2 = 91;
+ structPtr->conditionData.stat[arg1][i] = 0;
+ structPtr->conditionData.unk14[arg1][i].unk0 = 155;
+ structPtr->conditionData.unk14[arg1][i].unk2 = 91;
}
}
}
-void sub_81CDB98(s16 arg0, u8 arg1)
+void ConditionGraphDrawMonPic(s16 index, u8 arg1)
{
u16 boxId, monId, species;
u32 personality, tid;
- struct PokenavSub11 *structPtr = GetSubstructPtr(11);
- struct PokenavSub18 *unkPtr = GetSubstructPtr(18);
+ struct PokenavSub11 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_GRAPH);
+ struct PokenavSub18 *monListPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MON_LIST);
- if (arg0 == (sub_81CDD5C() != 0 ? unkPtr->unk0 : unkPtr->unk0 - 1))
+ if (index == (IsConditionMenuSearchMode() != 0 ? monListPtr->listCount : monListPtr->listCount - 1))
return;
- boxId = unkPtr->unk4[arg0].boxId;
- monId = unkPtr->unk4[arg0].monId;
+ boxId = monListPtr->monData[index].boxId;
+ monId = monListPtr->monData[index].monId;
species = GetBoxOrPartyMonData(boxId, monId, MON_DATA_SPECIES2, NULL);
tid = GetBoxOrPartyMonData(boxId, monId, MON_DATA_OT_ID, NULL);
personality = GetBoxOrPartyMonData(boxId, monId, MON_DATA_PERSONALITY, NULL);
@@ -534,92 +533,92 @@ void sub_81CDB98(s16 arg0, u8 arg1)
LZ77UnCompWram(GetMonSpritePalFromSpeciesAndPersonality(species, tid, personality), structPtr->monPal[arg1]);
}
-u16 sub_81CDC50(void)
+u16 GetMonListCount(void)
{
- struct PokenavSub18 *unkPtr = GetSubstructPtr(18);
- return unkPtr->unk0;
+ struct PokenavSub18 *monListPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MON_LIST);
+ return monListPtr->listCount;
}
-u16 sub_81CDC60(void)
+u16 GetConditionGraphCurrentMonIndex(void)
{
- struct PokenavSub18 *unkPtr = GetSubstructPtr(18);
- return unkPtr->unk2;
+ struct PokenavSub18 *monListPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MON_LIST);
+ return monListPtr->currIndex;
}
-struct ConditionGraph *sub_81CDC70(void)
+struct ConditionGraph *GetConditionGraphDataPtr(void)
{
- struct PokenavSub11 *structPtr = GetSubstructPtr(11);
- return &structPtr->unk6428;
+ struct PokenavSub11 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_GRAPH);
+ return &structPtr->conditionData;
}
-u8 sub_81CDC84(void)
+u8 GetMonMarkIndex(void)
{
- struct PokenavSub11 *structPtr = GetSubstructPtr(11);
- return structPtr->unk6786;
+ struct PokenavSub11 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_GRAPH);
+ return structPtr->mark;
}
u8 sub_81CDC9C(void)
{
- struct PokenavSub11 *structPtr = GetSubstructPtr(11);
- return structPtr->unk6302;
+ struct PokenavSub11 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_GRAPH);
+ return structPtr->monIndex;
}
-void *sub_81CDCB4(u8 id)
+void *GetConditionMonPicGfx(u8 id)
{
- struct PokenavSub11 *structPtr = GetSubstructPtr(11);
+ struct PokenavSub11 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_GRAPH);
return structPtr->monPicGfx[id];
}
-void *sub_81CDCD4(u8 id)
+void *GetConditionMonPal(u8 id)
{
- struct PokenavSub11 *structPtr = GetSubstructPtr(11);
+ struct PokenavSub11 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_GRAPH);
return structPtr->monPal[id];
}
u8 sub_81CDCEC(void)
{
- struct PokenavSub11 *structPtr = GetSubstructPtr(11);
+ struct PokenavSub11 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_GRAPH);
return structPtr->unk6789;
}
-u8 *sub_81CDD04(u8 id)
+u8 *GetConditionMonNameBuffer(u8 id)
{
- struct PokenavSub11 *structPtr = GetSubstructPtr(11);
- return structPtr->unk6368[id];
+ struct PokenavSub11 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_GRAPH);
+ return structPtr->nameBuffer[id];
}
-u8 *sub_81CDD24(u8 id)
+u8 *GetConditionMonLocationBuffer(u8 id)
{
- struct PokenavSub11 *structPtr = GetSubstructPtr(11);
- return structPtr->unk6320[id];
+ struct PokenavSub11 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_GRAPH);
+ return structPtr->searchLocBuffer[id];
}
-u16 sub_81CDD48(void)
+u16 GetConditionMonDataBuffer(void)
{
- struct PokenavSub18 *unkPtr = GetSubstructPtr(18);
- return unkPtr->unk4[unkPtr->unk2].data;
+ struct PokenavSub18 *monListPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MON_LIST);
+ return monListPtr->monData[monListPtr->currIndex].data;
}
-bool32 sub_81CDD5C(void)
+bool32 IsConditionMenuSearchMode(void)
{
- struct PokenavSub11 *structPtr = GetSubstructPtr(11);
- if (structPtr->unk6300 == 1)
+ struct PokenavSub11 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_GRAPH);
+ if (structPtr->searchMode == 1)
return TRUE;
else
return FALSE;
}
-u8 sub_81CDD7C(void)
+u8 TryGetMonMarkId(void)
{
- struct PokenavSub11 *structPtr = GetSubstructPtr(11);
- if (structPtr->unk6300 == 1)
- return structPtr->unk6783[structPtr->unk6786];
+ struct PokenavSub11 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_GRAPH);
+ if (structPtr->searchMode == 1)
+ return structPtr->monMarks[structPtr->mark];
else
return 0;
}
-u8 sub_81CDDB0(void)
+u8 GetMonSheen(void)
{
- struct PokenavSub11 *structPtr = GetSubstructPtr(11);
- return structPtr->unk6780[structPtr->unk6786];
+ struct PokenavSub11 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_GRAPH);
+ return structPtr->sheen[structPtr->mark];
}
diff --git a/src/pokenav_conditions_2.c b/src/pokenav_conditions_2.c
index 7c536cd6a..c0e8c7d6d 100644
--- a/src/pokenav_conditions_2.c
+++ b/src/pokenav_conditions_2.c
@@ -15,22 +15,22 @@
#include "strings.h"
#include "text.h"
-u32 sub_81CE37C(s32);
-u32 sub_81CE2D0(s32);
-u32 sub_81CE4D8(s32);
-u32 sub_81CE5E4(s32);
-u32 sub_81CE6BC(s32);
-u32 sub_81CE700(s32);
+u32 LoopedTask_TransitionMons(s32);
+u32 LoopedTask_ExitPartyConditionMenu(s32);
+u32 LoopedTask_MoveCursorNoTransition(s32);
+u32 LoopedTask_SlideMonOut(s32);
+u32 LoopedTask_OpenMonMarkingsWindow(s32);
+u32 LoopedTask_CloseMonMarkingsWindow(s32);
BSS_DATA u8 gUnknown_030012BC;
const u16 gConditionGraphData_Pal[] = INCBIN_U16("graphics/pokenav/condition/graph_data.gbapal");
const u16 gConditionText_Pal[] = INCBIN_U16("graphics/pokenav/condition/text.gbapal");
const u32 gUnknown_08623228[] = INCBIN_U32("graphics/pokenav/8623228.4bpp.lz");
-const u32 gUnknown_0862323C[] = INCBIN_U32("graphics/pokenav/862323C.bin.lz");
-const u16 gUnknown_08623338[] = INCBIN_U16("graphics/pokenav/8623338.gbapal");
+const u32 sConditionGraph_Tilemap[] = INCBIN_U32("graphics/pokenav/862323C.bin.lz");
+const u16 sConditionGraphMonMarkingsPal[] = INCBIN_U16("graphics/pokenav/8623338.gbapal");
-const struct BgTemplate gUnknown_08623358[3] =
+const struct BgTemplate sPartyConditionBgTemplates[3] =
{
{
.bg = 1,
@@ -61,7 +61,7 @@ const struct BgTemplate gUnknown_08623358[3] =
}
};
-const struct WindowTemplate gUnknown_08623364 =
+const struct WindowTemplate sMonNameGenderWindowTemplate =
{
.bg = 1,
.tilemapLeft = 13,
@@ -72,7 +72,7 @@ const struct WindowTemplate gUnknown_08623364 =
.baseBlock = 2
};
-const struct WindowTemplate gUnknown_0862336C =
+const struct WindowTemplate sConditionGraphListIdWindowTemplate =
{
.bg = 1,
.tilemapLeft = 1,
@@ -83,7 +83,7 @@ const struct WindowTemplate gUnknown_0862336C =
.baseBlock = 0x36
};
-const struct WindowTemplate gUnknown_08623374 =
+const struct WindowTemplate sUnusedWindowTemplate1 =
{
.bg = 1,
.tilemapLeft = 1,
@@ -94,7 +94,7 @@ const struct WindowTemplate gUnknown_08623374 =
.baseBlock = 0x44
};
-const struct WindowTemplate gUnknown_0862337C =
+const struct WindowTemplate sUnusedWindowTemplate2 =
{
.bg = 1,
.tilemapLeft = 13,
@@ -105,15 +105,15 @@ const struct WindowTemplate gUnknown_0862337C =
.baseBlock = 0x44
};
-const LoopedTask gUnknown_08623384[] =
+const LoopedTask sPartyConditionLoopedTaskFuncs[] =
{
- NULL,
- sub_81CE37C,
- sub_81CE2D0,
- sub_81CE4D8,
- sub_81CE5E4,
- sub_81CE6BC,
- sub_81CE700
+ [PARTY_CONDITION_FUNC_NONE] = NULL,
+ [PARTY_CONDITION_FUNC_SLIDE_MON_IN] = LoopedTask_TransitionMons,
+ [PARTY_CONDITION_FUNC_RETURN] = LoopedTask_ExitPartyConditionMenu,
+ [PARTY_CONDITION_FUNC_NO_TRANSITION] = LoopedTask_MoveCursorNoTransition,
+ [PARTY_CONDITION_FUNC_SLIDE_MON_OUT] = LoopedTask_SlideMonOut,
+ [PARTY_CONDITION_FUNC_ADD_MARKINGS] = LoopedTask_OpenMonMarkingsWindow,
+ [PARTY_CONDITION_FUNC_CLOSE_MARKINGS] = LoopedTask_CloseMonMarkingsWindow
};
struct Pokenav7Struct
@@ -121,84 +121,84 @@ struct Pokenav7Struct
u32 loopedTaskId;
u8 tilemapBuffers[3][BG_SCREEN_SIZE];
u8 filler[2];
- u8 unk1806[10];
- u32 (*unk1810)(void);
- s16 unk1814;
- u8 unk1816;
- u16 unk1818;
- u16 unk181A;
+ u8 partyPokeballSpriteIds[10];
+ u32 (*callback)(void);
+ s16 monTransitionX;
+ u8 monPicSpriteId;
+ u16 monPalIndex;
+ u16 monGfxTileStart;
void *unk181C;
- u8 unk1820;
- u8 unk1821;
- u8 unk1822;
- u8 unk1823;
+ u8 nameGenderWindowId;
+ u8 listIndexWindowId;
+ u8 unusedWindowId1;
+ u8 unusedWindowId2;
struct PokemonMarkMenu monMarks;
- struct Sprite *unk28dc;
- struct Sprite *unk28e0[MAX_CONDITION_SPARKLES];
- u8 unk2908;
+ struct Sprite *monMarksSprite;
+ struct Sprite *conditionSparkleSprites[MAX_CONDITION_SPARKLES];
+ u8 windowModeState;
u8 filler2[0x38ac - 0x2909];
};
-extern s8 sub_81CDC84(void); // This function's declaration here is different than its definition in pokenav_unk_6. u8/s8
+extern s8 GetMonMarkIndex(void); // This function's declaration here is s8 vs. u8 in pokenav_conditions_1.c
-u32 sub_81CDE94(s32 state);
-u32 sub_81CDE80(void);
-void sub_81CED30(u8 var);
-void sub_81CE9E4(void);
-void sub_81CE934(void);
-bool32 sub_81CE754(u8 a0, u16 a1, bool8 a2);
+u32 LoopedTask_OpenPartyConditionGraph(s32 state);
+u32 GetPartyConditionLoopedTaskActive(void);
+void CreateConditionMonPic(u8 var);
+void CreateMonMarkingsOrPokeballIndicators(void);
+void CopyUnusedConditionWindowsToVram(void);
+bool32 UpdateConditionGraphWindows(u8 a0, u16 a1, bool8 a2);
void sub_81CEE44(void);
-void sub_81CEE90(void);
+void DoConditionGraphTransition(void);
void sub_81CEEC8(void);
void sub_81CEE68(void);
-void sub_81CEE74(bool8 showBg);
+void ToggleBg2(bool8 showBg);
// code
-bool32 sub_81CDDD4(void)
+bool32 OpenPartyConditionMenu(void)
{
- struct Pokenav7Struct *structPtr = AllocSubstruct(0xC, sizeof(struct Pokenav7Struct));
+ struct Pokenav7Struct *structPtr = AllocSubstruct(POKENAV_SUBSTRUCT_MON_MARK_MENU, sizeof(struct Pokenav7Struct));
if (structPtr == NULL)
return FALSE;
- structPtr->unk1816 = 0xFF;
- structPtr->loopedTaskId = CreateLoopedTask(sub_81CDE94, 1);
- structPtr->unk1810 = sub_81CDE80;
- structPtr->unk2908 = 0;
+ structPtr->monPicSpriteId = 0xFF;
+ structPtr->loopedTaskId = CreateLoopedTask(LoopedTask_OpenPartyConditionGraph, 1);
+ structPtr->callback = GetPartyConditionLoopedTaskActive;
+ structPtr->windowModeState = 0;
return TRUE;
}
-void sub_81CDE2C(s32 id)
+void CreatePartyConditionLoopedTask(s32 id)
{
- struct Pokenav7Struct *structPtr = GetSubstructPtr(0xC);
- structPtr->loopedTaskId = CreateLoopedTask(gUnknown_08623384[id], 1);
- structPtr->unk1810 = sub_81CDE80;
+ struct Pokenav7Struct *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MON_MARK_MENU);
+ structPtr->loopedTaskId = CreateLoopedTask(sPartyConditionLoopedTaskFuncs[id], 1);
+ structPtr->callback = GetPartyConditionLoopedTaskActive;
}
-u32 sub_81CDE64(void)
+u32 IsPartyConditionLoopedTaskActive(void)
{
- struct Pokenav7Struct *structPtr = GetSubstructPtr(0xC);
- return structPtr->unk1810();
+ struct Pokenav7Struct *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MON_MARK_MENU);
+ return structPtr->callback();
}
-u32 sub_81CDE80(void)
+u32 GetPartyConditionLoopedTaskActive(void)
{
- struct Pokenav7Struct *structPtr = GetSubstructPtr(0xC);
+ struct Pokenav7Struct *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MON_MARK_MENU);
return IsLoopedTaskActive(structPtr->loopedTaskId);
}
-u32 sub_81CDE94(s32 state)
+u32 LoopedTask_OpenPartyConditionGraph(s32 state)
{
- struct Pokenav7Struct *structPtr = GetSubstructPtr(0xC);
+ struct Pokenav7Struct *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MON_MARK_MENU);
switch (state)
{
case 0:
- if (sub_81CD3C4() != TRUE)
+ if (LoadPartyConditionMenuGfx() != TRUE)
return LT_PAUSE;
return LT_INC_AND_PAUSE;
case 1:
- InitBgTemplates(gUnknown_08623358, ARRAY_COUNT(gUnknown_08623358));
+ InitBgTemplates(sPartyConditionBgTemplates, ARRAY_COUNT(sPartyConditionBgTemplates));
ChangeBgX(1, 0, 0);
ChangeBgY(1, 0, 0);
ChangeBgX(2, 0, 0);
@@ -221,23 +221,23 @@ u32 sub_81CDE94(s32 state)
LZ77UnCompVram(gPokenavCondition_Tilemap, structPtr->tilemapBuffers[0]);
SetBgTilemapBuffer(3, structPtr->tilemapBuffers[0]);
- if (sub_81CDD5C() == TRUE)
+ if (IsConditionMenuSearchMode() == TRUE)
CopyToBgTilemapBufferRect(3, gPokenavOptions_Tilemap, 0, 5, 9, 4);
CopyBgTilemapBufferToVram(3);
CopyPaletteIntoBufferUnfaded(gPokenavCondition_Pal, 0x10, 0x20);
CopyPaletteIntoBufferUnfaded(gConditionText_Pal, 0xF0, 0x20);
- structPtr->unk1814 = -80;
+ structPtr->monTransitionX = -80;
return LT_INC_AND_PAUSE;
case 4:
if (FreeTempTileDataBuffersIfPossible())
return LT_PAUSE;
- LZ77UnCompVram(gUnknown_0862323C, structPtr->tilemapBuffers[2]);
+ LZ77UnCompVram(sConditionGraph_Tilemap, structPtr->tilemapBuffers[2]);
SetBgTilemapBuffer(2, structPtr->tilemapBuffers[2]);
CopyBgTilemapBufferToVram(2);
CopyPaletteIntoBufferUnfaded(gConditionGraphData_Pal, 0x30, 0x20);
- sub_81D21DC(2);
+ SetConditionGraphIOWindows(2);
return LT_INC_AND_PAUSE;
case 5:
sub_8199DF0(1, 0, 0, 1);
@@ -249,85 +249,85 @@ u32 sub_81CDE94(s32 state)
if (FreeTempTileDataBuffersIfPossible())
return LT_PAUSE;
- structPtr->unk1820 = AddWindow(&gUnknown_08623364);
- if (sub_81CDD5C() == TRUE)
+ structPtr->nameGenderWindowId = AddWindow(&sMonNameGenderWindowTemplate);
+ if (IsConditionMenuSearchMode() == TRUE)
{
- structPtr->unk1821 = AddWindow(&gUnknown_0862336C);
- structPtr->unk1822 = AddWindow(&gUnknown_08623374);
- structPtr->unk1823 = AddWindow(&gUnknown_0862337C);
+ structPtr->listIndexWindowId = AddWindow(&sConditionGraphListIdWindowTemplate);
+ structPtr->unusedWindowId1 = AddWindow(&sUnusedWindowTemplate1);
+ structPtr->unusedWindowId2 = AddWindow(&sUnusedWindowTemplate2);
}
DeactivateAllTextPrinters();
return LT_INC_AND_PAUSE;
case 7:
- sub_81CED30(0);
+ CreateConditionMonPic(0);
return LT_INC_AND_PAUSE;
case 8:
- sub_81CE9E4();
+ CreateMonMarkingsOrPokeballIndicators();
return LT_INC_AND_PAUSE;
case 9:
- if (sub_81CDD5C() == TRUE)
- sub_81CE934();
+ if (IsConditionMenuSearchMode() == TRUE)
+ CopyUnusedConditionWindowsToVram();
return LT_INC_AND_PAUSE;
case 10:
- sub_81CE754(0, sub_81CDC84(), TRUE);
+ UpdateConditionGraphWindows(0, GetMonMarkIndex(), TRUE);
return LT_INC_AND_PAUSE;
case 11:
- sub_81CE754(1, sub_81CDC84(), TRUE);
+ UpdateConditionGraphWindows(1, GetMonMarkIndex(), TRUE);
return LT_INC_AND_PAUSE;
case 12:
- sub_81CE754(2, sub_81CDC84(), TRUE);
+ UpdateConditionGraphWindows(2, GetMonMarkIndex(), TRUE);
return LT_INC_AND_PAUSE;
case 13:
- if (sub_81CE754(3, sub_81CDC84(), TRUE) != TRUE)
+ if (UpdateConditionGraphWindows(3, GetMonMarkIndex(), TRUE) != TRUE)
return LT_PAUSE;
- PutWindowTilemap(structPtr->unk1820);
- if (sub_81CDD5C() == TRUE)
+ PutWindowTilemap(structPtr->nameGenderWindowId);
+ if (IsConditionMenuSearchMode() == TRUE)
{
- PutWindowTilemap(structPtr->unk1821);
- PutWindowTilemap(structPtr->unk1822);
- PutWindowTilemap(structPtr->unk1823);
+ PutWindowTilemap(structPtr->listIndexWindowId);
+ PutWindowTilemap(structPtr->unusedWindowId1);
+ PutWindowTilemap(structPtr->unusedWindowId2);
}
return LT_INC_AND_PAUSE;
case 14:
ShowBg(1);
HideBg(2);
ShowBg(3);
- if (sub_81CDD5C() == TRUE)
+ if (IsConditionMenuSearchMode() == TRUE)
PrintHelpBarText(HELPBAR_CONDITION_MON_STATUS);
return LT_INC_AND_PAUSE;
case 15:
PokenavFadeScreen(1);
- if (!sub_81CDD5C())
+ if (!IsConditionMenuSearchMode())
{
- LoadLeftHeaderGfxForIndex(6);
- sub_81C7FA0(1, TRUE, 0);
- sub_81C7FA0(6, TRUE, 0);
+ LoadLeftHeaderGfxForIndex(POKENAV_GFX_PARTY_MENU);
+ ShowLeftHeaderGfx(POKENAV_GFX_CONDITION_MENU, TRUE, 0);
+ ShowLeftHeaderGfx(POKENAV_GFX_PARTY_MENU, TRUE, 0);
}
return LT_INC_AND_PAUSE;
case 16:
if (IsPaletteFadeActive())
return LT_PAUSE;
- if (!sub_81CDD5C() && sub_81C8010())
+ if (!IsConditionMenuSearchMode() && AreLeftHeaderSpritesMoving())
return LT_PAUSE;
SetVBlankCallback_(sub_81CEE44);
return LT_INC_AND_PAUSE;
case 17:
- sub_81CEE90();
- sub_81D20AC(sub_81CDC70());
+ DoConditionGraphTransition();
+ InitConditionGraphState(GetConditionGraphDataPtr());
return LT_INC_AND_PAUSE;
case 18:
- if (sub_81D20BC(sub_81CDC70()))
+ if (SetupConditionGraphScanlineParams(GetConditionGraphDataPtr()))
return LT_PAUSE;
return LT_INC_AND_PAUSE;
case 19:
- sub_81CEE74(TRUE);
+ ToggleBg2(TRUE);
return LT_INC_AND_PAUSE;
case 20:
- if (!TryUpdateConditionMonTransitionOn(sub_81CDC70(), &structPtr->unk1814))
+ if (!TryUpdateConditionMonTransitionOn(GetConditionGraphDataPtr(), &structPtr->monTransitionX))
{
- ResetConditionSparkleSprites(structPtr->unk28e0);
- if (sub_81CDD5C() == TRUE || sub_81CDC60() != sub_81CDC50())
- CreateConditionSparkleSprites(structPtr->unk28e0, structPtr->unk1816, sub_81CDDB0());
+ ResetConditionSparkleSprites(structPtr->conditionSparkleSprites);
+ if (IsConditionMenuSearchMode() == TRUE || GetConditionGraphCurrentMonIndex() != GetMonListCount())
+ CreateConditionSparkleSprites(structPtr->conditionSparkleSprites, structPtr->monPicSpriteId, GetMonSheen());
return LT_FINISH;
}
@@ -337,211 +337,211 @@ u32 sub_81CDE94(s32 state)
return LT_FINISH;
}
-u32 sub_81CE2D0(s32 state)
+u32 LoopedTask_ExitPartyConditionMenu(s32 state)
{
- struct Pokenav7Struct *structPtr = GetSubstructPtr(0xC);
+ struct Pokenav7Struct *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MON_MARK_MENU);
switch (state)
{
case 0:
sub_81CEEC8();
- DestroyConditionSparkleSprites(structPtr->unk28e0);
- return 1;
+ DestroyConditionSparkleSprites(structPtr->conditionSparkleSprites);
+ return LT_INC_AND_CONTINUE;
case 1:
- if (TryUpdateConditionMonTransitionOff(sub_81CDC70(), &structPtr->unk1814))
+ if (TryUpdateConditionMonTransitionOff(GetConditionGraphDataPtr(), &structPtr->monTransitionX))
return 2;
- sub_81CEE74(FALSE);
- return 1;
+ ToggleBg2(FALSE);
+ return LT_INC_AND_CONTINUE;
case 2:
PokenavFadeScreen(0);
- if (!sub_81CDD5C())
- sub_81C78A0();
- return 0;
+ if (!IsConditionMenuSearchMode())
+ SlideMenuHeaderDown();
+ return LT_INC_AND_PAUSE;
case 3:
if (IsPaletteFadeActive() || MainMenuLoopedTaskIsBusy())
- return 2;
- FreeConditionSparkles(structPtr->unk28e0);
+ return LT_PAUSE;
+ FreeConditionSparkles(structPtr->conditionSparkleSprites);
HideBg(1);
HideBg(2);
HideBg(3);
- return 1;
+ return LT_INC_AND_CONTINUE;
}
return LT_FINISH;
}
-u32 sub_81CE37C(s32 state)
+u32 LoopedTask_TransitionMons(s32 state)
{
- struct Pokenav7Struct *structPtr = GetSubstructPtr(0xC);
- struct ConditionGraph *unkPtr = sub_81CDC70();
+ struct Pokenav7Struct *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MON_MARK_MENU);
+ struct ConditionGraph *unkPtr = GetConditionGraphDataPtr();
switch (state)
{
case 0:
- sub_81CD548(0);
- return 1;
+ SetConditionGraphData(0);
+ return LT_INC_AND_CONTINUE;
case 1:
- sub_81CD548(1);
- return 1;
+ SetConditionGraphData(1);
+ return LT_INC_AND_CONTINUE;
case 2:
- sub_81CD548(2);
- DestroyConditionSparkleSprites(structPtr->unk28e0);
- return 1;
+ SetConditionGraphData(2);
+ DestroyConditionSparkleSprites(structPtr->conditionSparkleSprites);
+ return LT_INC_AND_CONTINUE;
case 3:
TransitionConditionGraph(unkPtr);
- return 1;
+ return LT_INC_AND_CONTINUE;
case 4:
- if (!MoveConditionMonOffscreen(&structPtr->unk1814))
+ if (!MoveConditionMonOffscreen(&structPtr->monTransitionX))
{
- sub_81CED30(sub_81CDC84());
- return 1;
+ CreateConditionMonPic(GetMonMarkIndex());
+ return LT_INC_AND_CONTINUE;
}
- return 2;
+ return LT_PAUSE;
case 5:
- sub_81CE754(0, sub_81CDC84(), FALSE);
- return 1;
+ UpdateConditionGraphWindows(0, GetMonMarkIndex(), FALSE);
+ return LT_INC_AND_CONTINUE;
case 6:
- sub_81CE754(1, sub_81CDC84(), FALSE);
- return 1;
+ UpdateConditionGraphWindows(1, GetMonMarkIndex(), FALSE);
+ return LT_INC_AND_CONTINUE;
case 7:
- sub_81CE754(2, sub_81CDC84(), FALSE);
- return 1;
+ UpdateConditionGraphWindows(2, GetMonMarkIndex(), FALSE);
+ return LT_INC_AND_CONTINUE;
case 8:
- if (sub_81CE754(3, sub_81CDC84(), FALSE) == TRUE)
- return 1;
- return 2;
+ if (UpdateConditionGraphWindows(3, GetMonMarkIndex(), FALSE) == TRUE)
+ return LT_INC_AND_CONTINUE;
+ return LT_PAUSE;
case 9:
- unkPtr = sub_81CDC70();
- if (!TryUpdateConditionMonTransitionOn(unkPtr, &structPtr->unk1814))
+ unkPtr = GetConditionGraphDataPtr();
+ if (!TryUpdateConditionMonTransitionOn(unkPtr, &structPtr->monTransitionX))
{
- ResetConditionSparkleSprites(structPtr->unk28e0);
- if (sub_81CDD5C() != TRUE && sub_81CDC60() == sub_81CDC50())
- return 1;
+ ResetConditionSparkleSprites(structPtr->conditionSparkleSprites);
+ if (IsConditionMenuSearchMode() != TRUE && GetConditionGraphCurrentMonIndex() == GetMonListCount())
+ return LT_INC_AND_CONTINUE;
- CreateConditionSparkleSprites(structPtr->unk28e0, structPtr->unk1816, sub_81CDDB0());
- return 1;
+ CreateConditionSparkleSprites(structPtr->conditionSparkleSprites, structPtr->monPicSpriteId, GetMonSheen());
+ return LT_INC_AND_CONTINUE;
}
- return 2;
+ return LT_PAUSE;
}
return LT_FINISH;
}
-u32 sub_81CE4D8(s32 state)
+u32 LoopedTask_MoveCursorNoTransition(s32 state)
{
- struct Pokenav7Struct *structPtr = GetSubstructPtr(0xC);
+ struct Pokenav7Struct *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MON_MARK_MENU);
switch (state)
{
case 0:
- sub_81CD548(0);
- return 1;
+ SetConditionGraphData(0);
+ return LT_INC_AND_CONTINUE;
case 1:
- sub_81CD548(1);
- return 1;
+ SetConditionGraphData(1);
+ return LT_INC_AND_CONTINUE;
case 2:
- sub_81CD548(2);
- return 1;
+ SetConditionGraphData(2);
+ return LT_INC_AND_CONTINUE;
case 3:
- sub_81CED30(sub_81CDC84());
- return 1;
+ CreateConditionMonPic(GetMonMarkIndex());
+ return LT_INC_AND_CONTINUE;
case 4:
- sub_81CE754(0, sub_81CDC84(), FALSE);
- return 1;
+ UpdateConditionGraphWindows(0, GetMonMarkIndex(), FALSE);
+ return LT_INC_AND_CONTINUE;
case 5:
- sub_81CE754(1, sub_81CDC84(), FALSE);
- return 1;
+ UpdateConditionGraphWindows(1, GetMonMarkIndex(), FALSE);
+ return LT_INC_AND_CONTINUE;
case 6:
- sub_81CE754(2, sub_81CDC84(), FALSE);
- return 1;
+ UpdateConditionGraphWindows(2, GetMonMarkIndex(), FALSE);
+ return LT_INC_AND_CONTINUE;
case 7:
- if (sub_81CE754(3, sub_81CDC84(), FALSE) == TRUE)
- return 1;
- return 2;
+ if (UpdateConditionGraphWindows(3, GetMonMarkIndex(), FALSE) == TRUE)
+ return LT_INC_AND_CONTINUE;
+ return LT_PAUSE;
case 8:
- if (!TryUpdateConditionMonTransitionOn(sub_81CDC70(), &structPtr->unk1814))
+ if (!TryUpdateConditionMonTransitionOn(GetConditionGraphDataPtr(), &structPtr->monTransitionX))
{
- ResetConditionSparkleSprites(structPtr->unk28e0);
- CreateConditionSparkleSprites(structPtr->unk28e0, structPtr->unk1816, sub_81CDDB0());
- return 1;
+ ResetConditionSparkleSprites(structPtr->conditionSparkleSprites);
+ CreateConditionSparkleSprites(structPtr->conditionSparkleSprites, structPtr->monPicSpriteId, GetMonSheen());
+ return LT_INC_AND_CONTINUE;
}
- return 2;
+ return LT_PAUSE;
}
return LT_FINISH;
}
-u32 sub_81CE5E4(s32 state)
+u32 LoopedTask_SlideMonOut(s32 state)
{
- struct Pokenav7Struct *structPtr = GetSubstructPtr(0xC);
+ struct Pokenav7Struct *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MON_MARK_MENU);
switch (state)
{
case 0:
- sub_81CD548(0);
- return 1;
+ SetConditionGraphData(0);
+ return LT_INC_AND_CONTINUE;
case 1:
- sub_81CD548(1);
- return 1;
+ SetConditionGraphData(1);
+ return LT_INC_AND_CONTINUE;
case 2:
- sub_81CD548(2);
- DestroyConditionSparkleSprites(structPtr->unk28e0);
- return 1;
+ SetConditionGraphData(2);
+ DestroyConditionSparkleSprites(structPtr->conditionSparkleSprites);
+ return LT_INC_AND_CONTINUE;
case 3:
- if (!TryUpdateConditionMonTransitionOff(sub_81CDC70(), &structPtr->unk1814))
- return 1;
- return 2;
+ if (!TryUpdateConditionMonTransitionOff(GetConditionGraphDataPtr(), &structPtr->monTransitionX))
+ return LT_INC_AND_CONTINUE;
+ return LT_PAUSE;
case 4:
- sub_81CE754(0, sub_81CDC84(), FALSE);
- return 1;
+ UpdateConditionGraphWindows(0, GetMonMarkIndex(), FALSE);
+ return LT_INC_AND_CONTINUE;
case 5:
- sub_81CE754(1, sub_81CDC84(), FALSE);
- return 1;
+ UpdateConditionGraphWindows(1, GetMonMarkIndex(), FALSE);
+ return LT_INC_AND_CONTINUE;
case 6:
- sub_81CE754(2, sub_81CDC84(), FALSE);
- return 1;
+ UpdateConditionGraphWindows(2, GetMonMarkIndex(), FALSE);
+ return LT_INC_AND_CONTINUE;
case 7:
- if (sub_81CE754(3, sub_81CDC84(), FALSE) == TRUE)
- return 1;
- return 2;
+ if (UpdateConditionGraphWindows(3, GetMonMarkIndex(), FALSE) == TRUE)
+ return LT_INC_AND_CONTINUE;
+ return LT_PAUSE;
}
return LT_FINISH;
}
-u32 sub_81CE6BC(s32 state)
+u32 LoopedTask_OpenMonMarkingsWindow(s32 state)
{
switch (state)
{
case 0:
- sub_811FAA4(sub_81CDD7C(), 176, 32);
- return 1;
+ sub_811FAA4(TryGetMonMarkId(), 176, 32);
+ return LT_INC_AND_CONTINUE;
case 1:
PrintHelpBarText(HELPBAR_CONDITION_MARKINGS);
- return 1;
+ return LT_INC_AND_CONTINUE;
case 2:
if (WaitForHelpBar() == TRUE)
- return 2;
- return 1;
+ return LT_PAUSE;
+ return LT_INC_AND_CONTINUE;
}
return LT_FINISH;
}
-u32 sub_81CE700(s32 state)
+u32 LoopedTask_CloseMonMarkingsWindow(s32 state)
{
switch (state)
{
case 0:
sub_811FAF8();
- return 1;
+ return LT_INC_AND_CONTINUE;
case 1:
PrintHelpBarText(HELPBAR_CONDITION_MON_STATUS);
- return 1;
+ return LT_INC_AND_CONTINUE;
case 2:
if (WaitForHelpBar() == TRUE)
- return 2;
- return 1;
+ return LT_PAUSE;
+ return LT_INC_AND_CONTINUE;
}
return LT_FINISH;
@@ -555,68 +555,68 @@ static u8 *UnusedPrintNumberString(u8 *dst, u16 num)
return txtPtr;
}
-bool32 sub_81CE754(u8 a0, u16 a1, bool8 a2)
+bool32 UpdateConditionGraphWindows(u8 mode, u16 bufferIndex, bool8 winMode)
{
u8 text[32];
const u8 *str;
- struct Pokenav7Struct *structPtr = GetSubstructPtr(0xC);
+ struct Pokenav7Struct *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MON_MARK_MENU);
- switch (a0)
+ switch (mode)
{
case 0:
- FillWindowPixelBuffer(structPtr->unk1820, 0);
- if (sub_81CDD5C() == TRUE)
- FillWindowPixelBuffer(structPtr->unk1821, 0);
+ FillWindowPixelBuffer(structPtr->nameGenderWindowId, 0);
+ if (IsConditionMenuSearchMode() == TRUE)
+ FillWindowPixelBuffer(structPtr->listIndexWindowId, 0);
break;
case 1:
- if (sub_81CDC60() != sub_81CDC50() - 1 || sub_81CDD5C() == TRUE)
+ if (GetConditionGraphCurrentMonIndex() != GetMonListCount() - 1 || IsConditionMenuSearchMode() == TRUE)
{
- str = sub_81CDD04(a1);
- AddTextPrinterParameterized(structPtr->unk1820, 1, str, 0, 1, 0, NULL);
+ str = GetConditionMonNameBuffer(bufferIndex);
+ AddTextPrinterParameterized(structPtr->nameGenderWindowId, 1, str, 0, 1, 0, NULL);
}
break;
case 2:
- if (sub_81CDD5C() == TRUE)
+ if (IsConditionMenuSearchMode() == TRUE)
{
- str = sub_81CDD24(a1);
- AddTextPrinterParameterized(structPtr->unk1820, 1, str, 0, 17, 0, NULL);
+ str = GetConditionMonLocationBuffer(bufferIndex);
+ AddTextPrinterParameterized(structPtr->nameGenderWindowId, 1, str, 0, 17, 0, NULL);
text[0] = EXT_CTRL_CODE_BEGIN;
text[1] = EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW;
text[2] = TEXT_COLOR_BLUE;
text[3] = TEXT_COLOR_TRANSPARENT;
text[4] = TEXT_COLOR_LIGHT_BLUE;
StringCopy(text + 5, gText_Number2);
- AddTextPrinterParameterized(structPtr->unk1821, 1, text, 4, 1, 0, NULL);
- ConvertIntToDecimalStringN(text + 5, sub_81CDD48(), STR_CONV_MODE_RIGHT_ALIGN, 4);
- AddTextPrinterParameterized(structPtr->unk1821, 1, text, 28, 1, 0, NULL);
+ AddTextPrinterParameterized(structPtr->listIndexWindowId, 1, text, 4, 1, 0, NULL);
+ ConvertIntToDecimalStringN(text + 5, GetConditionMonDataBuffer(), STR_CONV_MODE_RIGHT_ALIGN, 4);
+ AddTextPrinterParameterized(structPtr->listIndexWindowId, 1, text, 28, 1, 0, NULL);
}
break;
case 3:
- switch (structPtr->unk2908)
+ switch (structPtr->windowModeState)
{
case 0:
- if (a2)
- CopyWindowToVram(structPtr->unk1820, 3);
+ if (winMode)
+ CopyWindowToVram(structPtr->nameGenderWindowId, 3);
else
- CopyWindowToVram(structPtr->unk1820, 2);
+ CopyWindowToVram(structPtr->nameGenderWindowId, 2);
- if (sub_81CDD5C() == TRUE)
+ if (IsConditionMenuSearchMode() == TRUE)
{
- structPtr->unk2908++;
+ structPtr->windowModeState++;
return FALSE;
}
else
{
- structPtr->unk2908 = 0;
+ structPtr->windowModeState = 0;
return TRUE;
}
case 1:
- if (a2)
- CopyWindowToVram(structPtr->unk1821, 3);
+ if (winMode)
+ CopyWindowToVram(structPtr->listIndexWindowId, 3);
else
- CopyWindowToVram(structPtr->unk1821, 2);
+ CopyWindowToVram(structPtr->listIndexWindowId, 2);
- structPtr->unk2908 = 0;
+ structPtr->windowModeState = 0;
return TRUE;
}
}
@@ -624,36 +624,36 @@ bool32 sub_81CE754(u8 a0, u16 a1, bool8 a2)
return FALSE;
}
-void sub_81CE934(void)
+void CopyUnusedConditionWindowsToVram(void)
{
- struct Pokenav7Struct *structPtr = GetSubstructPtr(0xC);
+ struct Pokenav7Struct *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MON_MARK_MENU);
- CopyWindowToVram(structPtr->unk1822, 3);
- CopyWindowToVram(structPtr->unk1823, 3);
+ CopyWindowToVram(structPtr->unusedWindowId1, 3);
+ CopyWindowToVram(structPtr->unusedWindowId2, 3);
}
void sub_81CE964(struct Sprite *sprite)
{
- if (sprite->data[0] == sub_81CDC60())
+ if (sprite->data[0] == GetConditionGraphCurrentMonIndex())
StartSpriteAnim(sprite, 0);
else
StartSpriteAnim(sprite, 1);
}
-void sub_81CE990(struct Sprite *sprite)
+void HighlightCurrentPartyIndexPokeball(struct Sprite *sprite)
{
- if (sub_81CDC60() == sub_81CDC50() - 1)
+ if (GetConditionGraphCurrentMonIndex() == GetMonListCount() - 1)
sprite->oam.paletteNum = IndexOfSpritePaletteTag(0x65);
else
sprite->oam.paletteNum = IndexOfSpritePaletteTag(0x66);
}
-void sub_81CE9C8(struct Sprite *sprite)
+void MonMarkingsCallback(struct Sprite *sprite)
{
- StartSpriteAnim(sprite, sub_81CDD7C());
+ StartSpriteAnim(sprite, TryGetMonMarkId());
}
-void sub_81CE9E4(void)
+void CreateMonMarkingsOrPokeballIndicators(void)
{
struct SpriteSheet sprSheets[4];
struct SpriteTemplate sprTemplate;
@@ -661,39 +661,40 @@ void sub_81CE9E4(void)
struct SpriteSheet sprSheet;
struct Sprite *sprite;
u16 i, spriteId;
- struct Pokenav7Struct *structPtr = GetSubstructPtr(0xC);
+ struct Pokenav7Struct *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MON_MARK_MENU);
LoadConditionSelectionIcons(sprSheets, &sprTemplate, sprPals);
- if (sub_81CDD5C() == TRUE)
+ if (IsConditionMenuSearchMode() == TRUE)
{
structPtr->monMarks.baseTileTag = 0x6A;
structPtr->monMarks.basePaletteTag = 0x6A;
sub_811F90C(&structPtr->monMarks);
sub_811FA90();
- sprite = sub_811FF94(0x69, 0x69, gUnknown_08623338);
+ sprite = CreateMonMarkingsSpriteWithPal(0x69, 0x69, sConditionGraphMonMarkingsPal);
sprite->oam.priority = 3;
sprite->pos1.x = 192;
sprite->pos1.y = 32;
- sprite->callback = sub_81CE9C8;
- structPtr->unk28dc = sprite;
- sub_81C7990(IndexOfSpritePaletteTag(0x69), 0);
+ sprite->callback = MonMarkingsCallback;
+ structPtr->monMarksSprite = sprite;
+ PokenavFillPalette(IndexOfSpritePaletteTag(0x69), 0);
}
else
{
+ // party mode -> add pokeballs on right hand side
LoadSpriteSheets(sprSheets);
Pokenav_AllocAndLoadPalettes(sprPals);
- for (i = 0; i < sub_81CDC50() - 1; i++)
+ for (i = 0; i < GetMonListCount() - 1; i++)
{
spriteId = CreateSprite(&sprTemplate, 226, (i * 20) + 8, 0);
if (spriteId != MAX_SPRITES)
{
- structPtr->unk1806[i] = spriteId;
+ structPtr->partyPokeballSpriteIds[i] = spriteId;
gSprites[spriteId].data[0] = i;
gSprites[spriteId].callback = sub_81CE964;
}
else
{
- structPtr->unk1806[i] = 0xFF;
+ structPtr->partyPokeballSpriteIds[i] = 0xFF;
}
}
@@ -704,27 +705,27 @@ void sub_81CE9E4(void)
spriteId = CreateSprite(&sprTemplate, 230, (i * 20) + 8, 0);
if (spriteId != MAX_SPRITES)
{
- structPtr->unk1806[i] = spriteId;
+ structPtr->partyPokeballSpriteIds[i] = spriteId;
gSprites[spriteId].oam.size = 0;
}
else
{
- structPtr->unk1806[i] = 0xFF;
+ structPtr->partyPokeballSpriteIds[i] = 0xFF;
}
}
sprTemplate.tileTag = 0x66;
- sprTemplate.callback = sub_81CE990;
+ sprTemplate.callback = HighlightCurrentPartyIndexPokeball;
spriteId = CreateSprite(&sprTemplate, 222, (i * 20) + 8, 0);
if (spriteId != MAX_SPRITES)
{
- structPtr->unk1806[i] = spriteId;
+ structPtr->partyPokeballSpriteIds[i] = spriteId;
gSprites[spriteId].oam.shape = SPRITE_SHAPE(32x16);
gSprites[spriteId].oam.size = SPRITE_SIZE(32x16);
}
else
{
- structPtr->unk1806[i] = 0xFF;
+ structPtr->partyPokeballSpriteIds[i] = 0xFF;
}
}
@@ -738,9 +739,9 @@ void sub_81CEBF4(struct Pokenav7Struct *structPtr)
{
u8 i;
- if (sub_81CDD5C() == TRUE)
+ if (IsConditionMenuSearchMode() == TRUE)
{
- DestroySprite(structPtr->unk28dc);
+ DestroySprite(structPtr->monMarksSprite);
FreeSpriteTilesByTag(0x6A);
FreeSpriteTilesByTag(0x69);
FreeSpritePaletteByTag(0x6A);
@@ -749,7 +750,7 @@ void sub_81CEBF4(struct Pokenav7Struct *structPtr)
else
{
for (i = 0; i < 7; i++)
- DestroySprite(&gSprites[structPtr->unk1806[i]]);
+ DestroySprite(&gSprites[structPtr->partyPokeballSpriteIds[i]]);
FreeSpriteTilesByTag(0x65);
FreeSpriteTilesByTag(0x66);
@@ -758,83 +759,83 @@ void sub_81CEBF4(struct Pokenav7Struct *structPtr)
FreeSpritePaletteByTag(0x66);
}
- if (structPtr->unk1816 != 0xFF)
+ if (structPtr->monPicSpriteId != 0xFF)
{
- DestroySprite(&gSprites[structPtr->unk1816]);
+ DestroySprite(&gSprites[structPtr->monPicSpriteId]);
FreeSpriteTilesByTag(0x64);
FreeSpritePaletteByTag(0x64);
}
}
-void sub_81CECA0(void)
+void FreePartyConditionSubstruct2(void)
{
- struct Pokenav7Struct *structPtr = GetSubstructPtr(0xC);
+ struct Pokenav7Struct *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MON_MARK_MENU);
- RemoveWindow(structPtr->unk1820);
- if (sub_81CDD5C() == TRUE)
+ RemoveWindow(structPtr->nameGenderWindowId);
+ if (IsConditionMenuSearchMode() == TRUE)
{
- RemoveWindow(structPtr->unk1821);
- RemoveWindow(structPtr->unk1822);
- RemoveWindow(structPtr->unk1823);
+ RemoveWindow(structPtr->listIndexWindowId);
+ RemoveWindow(structPtr->unusedWindowId1);
+ RemoveWindow(structPtr->unusedWindowId2);
}
else
{
- sub_81C7FDC();
+ SetLeftHeaderSpritesInvisibility();
}
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_BG0_ON | DISPCNT_OBJ_1D_MAP);
sub_81CEBF4(structPtr);
sub_81CEE68();
- FreePokenavSubstruct(0xC);
+ FreePokenavSubstruct(POKENAV_SUBSTRUCT_MON_MARK_MENU);
}
-void sub_81CED10(struct Sprite *sprite)
+void MonPicGfxSpriteCallback(struct Sprite *sprite)
{
- struct Pokenav7Struct *structPtr = GetSubstructPtr(0xC);
- sprite->pos1.x = structPtr->unk1814 + 38;
+ struct Pokenav7Struct *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MON_MARK_MENU);
+ sprite->pos1.x = structPtr->monTransitionX + 38;
}
-void sub_81CED30(u8 var)
+void CreateConditionMonPic(u8 id)
{
struct SpriteTemplate sprTemplate;
struct SpriteSheet sprSheet;
struct SpritePalette sprPal;
u8 spriteId;
- struct Pokenav7Struct *structPtr = GetSubstructPtr(0xC);
+ struct Pokenav7Struct *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MON_MARK_MENU);
- if (structPtr->unk1816 == 0xFF)
+ if (structPtr->monPicSpriteId == 0xFF)
{
LoadConditionMonPicTemplate(&sprSheet, &sprTemplate, &sprPal);
- sprSheet.data = sub_81CDCB4(var);
- sprPal.data = sub_81CDCD4(var);
- structPtr->unk1818 = LoadSpritePalette(&sprPal);
- structPtr->unk181A = LoadSpriteSheet(&sprSheet);
+ sprSheet.data = GetConditionMonPicGfx(id);
+ sprPal.data = GetConditionMonPal(id);
+ structPtr->monPalIndex = LoadSpritePalette(&sprPal);
+ structPtr->monGfxTileStart = LoadSpriteSheet(&sprSheet);
spriteId = CreateSprite(&sprTemplate, 38, 104, 0);
- structPtr->unk1816 = spriteId;
+ structPtr->monPicSpriteId = spriteId;
if (spriteId == MAX_SPRITES)
{
FreeSpriteTilesByTag(0x64);
FreeSpritePaletteByTag(0x64);
- structPtr->unk1816 = 0xFF;
+ structPtr->monPicSpriteId = 0xFF;
}
else
{
- structPtr->unk1816 = spriteId;
- gSprites[structPtr->unk1816].callback = sub_81CED10;
- structPtr->unk181C = (void*)(VRAM) + 0x10000 + (structPtr->unk181A * 32);
- structPtr->unk1818 = (structPtr->unk1818 * 16) + 0x100;
+ structPtr->monPicSpriteId = spriteId;
+ gSprites[structPtr->monPicSpriteId].callback = MonPicGfxSpriteCallback;
+ structPtr->unk181C = (void*)(VRAM) + 0x10000 + (structPtr->monGfxTileStart * 32);
+ structPtr->monPalIndex = (structPtr->monPalIndex * 16) + 0x100;
}
}
else
{
- DmaCopy16Defvars(3, sub_81CDCB4(var), structPtr->unk181C, 0x800);
- LoadPalette(sub_81CDCD4(var), structPtr->unk1818, 0x20);
+ DmaCopy16Defvars(3, GetConditionMonPicGfx(id), structPtr->unk181C, 0x800);
+ LoadPalette(GetConditionMonPal(id), structPtr->monPalIndex, 0x20);
}
}
void sub_81CEE44(void)
{
- struct ConditionGraph *unk = sub_81CDC70();
+ struct ConditionGraph *unk = GetConditionGraphDataPtr();
LoadOam();
ProcessSpriteCopyRequests();
TransferPlttBuffer();
@@ -847,7 +848,7 @@ void sub_81CEE68(void)
SetPokenavVBlankCallback();
}
-void sub_81CEE74(bool8 showBg)
+void ToggleBg2(bool8 showBg)
{
if (showBg)
ShowBg(2);
@@ -855,29 +856,29 @@ void sub_81CEE74(bool8 showBg)
HideBg(2);
}
-void sub_81CEE90(void)
+void DoConditionGraphTransition(void)
{
- struct ConditionGraph *unk = sub_81CDC70();
- u8 id = sub_81CDC84();
+ struct ConditionGraph *conditionPtr = GetConditionGraphDataPtr();
+ u8 id = GetMonMarkIndex();
gUnknown_030012BC = id;
- sub_81D1F84(unk, unk->unk14[3], unk->unk14[id]);
- TransitionConditionGraph(unk);
+ sub_81D1F84(conditionPtr, conditionPtr->unk14[3], conditionPtr->unk14[id]);
+ TransitionConditionGraph(conditionPtr);
}
void sub_81CEEC8(void)
{
- struct ConditionGraph *unk = sub_81CDC70();
+ struct ConditionGraph *conditionPtr = GetConditionGraphDataPtr();
- if (sub_81CDD5C() || sub_81CDC60() != sub_81CDC50() - 1)
- sub_81D1F84(unk, unk->unk14[sub_81CDC84()], unk->unk14[3]);
+ if (IsConditionMenuSearchMode() || GetConditionGraphCurrentMonIndex() != GetMonListCount() - 1)
+ sub_81D1F84(conditionPtr, conditionPtr->unk14[GetMonMarkIndex()], conditionPtr->unk14[3]);
}
-u8 sub_81CEF14(void)
+u8 GetMonMarkingsData(void)
{
- struct Pokenav7Struct *structPtr = GetSubstructPtr(0xC);
+ struct Pokenav7Struct *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MON_MARK_MENU);
- if (sub_81CDD5C() == 1)
+ if (IsConditionMenuSearchMode() == 1)
return structPtr->monMarks.markings;
else
return 0;
diff --git a/src/pokenav_conditions_3.c b/src/pokenav_conditions_3.c
index eea4aa397..c4beb924c 100644
--- a/src/pokenav_conditions_3.c
+++ b/src/pokenav_conditions_3.c
@@ -10,67 +10,78 @@
#include "international_string_util.h"
#include "constants/songs.h"
+enum
+{
+ CONDITION_SEARCH_FUNC_NONE,
+ CONDITION_SEARCH_FUNC_MOVE_UP,
+ CONDITION_SEARCH_FUNC_MOVE_DOWN,
+ CONDITION_SEARCH_FUNC_PAGE_UP,
+ CONDITION_SEARCH_FUNC_PAGE_DOWN,
+ CONDITION_SEARCH_FUNC_EXIT,
+ CONDITION_SEARCH_FUNC_SELECT_MON,
+};
+
struct PokenavSub7
{
- u32 (*unk0)(struct PokenavSub7 *);
+ u32 (*callback)(struct PokenavSub7 *);
u32 loopedTaskId;
u8 fill1[4];
- s32 unkC;
- s32 unk10;
- u32 unk14;
- u32 unk18;
- u32 unk1C;
- struct PokenavSub18 *unkPtr;
+ s32 boxId;
+ s32 monId;
+ u32 conditionDataId;
+ u32 returnFromGraph;
+ u32 isPartyCondition;
+ struct PokenavSub18 *monList;
};
struct PokenavSub8
{
bool32 (*callback)(void);
- u32 ltid;
+ u32 ltid; //looped task Id
u16 winid;
- bool32 unkC;
+ bool32 fromGraph;
u8 buff[BG_SCREEN_SIZE];
}; // size: 0x810
-static u32 sub_81CF010(struct PokenavSub7 *structPtr);
-static u32 sub_81CF030(struct PokenavSub7 *structPtr);
-static u32 sub_81CF0B8(struct PokenavSub7 *structPtr);
-static u32 sub_81CF0B0(struct PokenavSub7 *structPtr);
-static u32 sub_81CF11C(s32 state);
-static u32 sub_81CF134(s32 state);
-static u32 sub_81CF1C4(s32 state);
-static u32 sub_81CF1D8(s32 state);
+static u32 HandleConditionSearchInput_WaitSetup(struct PokenavSub7 *structPtr);
+static u32 HandleConditionSearchInput(struct PokenavSub7 *structPtr);
+static u32 OpenConditionGraphFromSearchList(struct PokenavSub7 *structPtr);
+static u32 ReturnToConditionSearchList(struct PokenavSub7 *structPtr);
+static u32 GetConditionSearchLoopedTask(s32 state);
+static u32 BuildPartyMonSearchResults(s32 state);
+static u32 InitBoxMonSearchResults(s32 state);
+static u32 BuildBoxMonSearchResults(s32 state);
static u32 sub_81CF278(s32 state);
-static u32 sub_81CF578(s32 state);
-static u32 sub_81CF5F0(s32 state);
-static u32 sub_81CF668(s32 state);
-static u32 sub_81CF6E0(s32 state);
-static u32 sub_81CF758(s32 state);
-static u32 sub_81CF798(s32 state);
+static u32 LoopedTask_MoveSearchListCursorUp(s32 state);
+static u32 LoopedTask_MoveSearchListCursorDown(s32 state);
+static u32 LoopedTask_MoveSearchListPageUp(s32 state);
+static u32 LoopedTask_MoveSearchListPageDown(s32 state);
+static u32 LoopedTask_ExitConditionSearchMenu(s32 state);
+static u32 LoopedTask_SelectSearchResult(s32 state);
static void sub_81CF2C4(struct PokenavSub7 *structPtr, struct PokenavMonList *item);
-static bool32 sub_81CF3E4(void);
-static u32 sub_81CF418(s32 state);
-static void sub_81CF7C8(struct PokenavSub8 *);
-static void sub_81CF7F4(struct PokenavSub8 *);
-static void sub_81CF88C(void);
-static void sub_81CF8E4(struct PokenavMonList *, u8 *);
+static bool32 GetSearchResultCurrentLoopedTaskActive(void);
+static u32 LoopedTask_OpenConditionSearchResults(s32 state);
+static void AddSearchResultListMenuWindow(struct PokenavSub8 *);
+static void PrintSearchResultListMenuItems(struct PokenavSub8 *);
+static void InitConditionSearchListMenuTemplate(void);
+static void PrintSearchMonListItem(struct PokenavMonList *, u8 *);
-static const u32 gUnknown_086233A0[] = {0x16, 0x17, 0x18, 0x21, 0x2F};
+static const u32 sSearchMonDataIds[] = {MON_DATA_COOL, MON_DATA_BEAUTY, MON_DATA_CUTE, MON_DATA_SMART, MON_DATA_TOUGH};
-static const LoopedTask gUnknown_086233B4[] =
+static const LoopedTask sConditionSearchLoopedTaskFuncs[] =
{
- sub_81CF134,
- sub_81CF1C4,
- sub_81CF1D8,
+ BuildPartyMonSearchResults,
+ InitBoxMonSearchResults,
+ BuildBoxMonSearchResults,
sub_81CF278
};
-static const u16 gUnknown_086233C4[] = INCBIN_U16("graphics/pokenav/condition_search2.gbapal");
-static const u32 gUnknown_086233E4[] = INCBIN_U32("graphics/pokenav/condition_search2.4bpp.lz");
-static const u32 gUnknown_086234AC[] = INCBIN_U32("graphics/pokenav/condition_search2.bin.lz");
+static const u16 sConditionSearchResultFramePal[] = INCBIN_U16("graphics/pokenav/condition_search2.gbapal");
+static const u32 sConditionSearchResultTiles[] = INCBIN_U32("graphics/pokenav/condition_search2.4bpp.lz");
+static const u32 sConditionSearchResultTilemap[] = INCBIN_U32("graphics/pokenav/condition_search2.bin.lz");
static const u16 gUnknown_08623570[] = INCBIN_U16("graphics/pokenav/8623570.gbapal");
-static const struct BgTemplate gUnknown_08623590[] =
+static const struct BgTemplate sConditionSearchResultBgTemplates[] =
{
{
.bg = 1,
@@ -91,18 +102,18 @@ static const struct BgTemplate gUnknown_08623590[] =
}
};
-static const LoopedTask gUnknown_08623598[] =
+static const LoopedTask sSearchResultLoopTaskFuncs[] =
{
- NULL,
- sub_81CF578,
- sub_81CF5F0,
- sub_81CF668,
- sub_81CF6E0,
- sub_81CF758,
- sub_81CF798
+ [CONDITION_SEARCH_FUNC_NONE] = NULL,
+ [CONDITION_SEARCH_FUNC_MOVE_UP] = LoopedTask_MoveSearchListCursorUp,
+ [CONDITION_SEARCH_FUNC_MOVE_DOWN] = LoopedTask_MoveSearchListCursorDown,
+ [CONDITION_SEARCH_FUNC_PAGE_UP] = LoopedTask_MoveSearchListPageUp,
+ [CONDITION_SEARCH_FUNC_PAGE_DOWN] = LoopedTask_MoveSearchListPageDown,
+ [CONDITION_SEARCH_FUNC_EXIT] = LoopedTask_ExitConditionSearchMenu,
+ [CONDITION_SEARCH_FUNC_SELECT_MON] = LoopedTask_SelectSearchResult
};
-static const struct WindowTemplate gUnknown_086235B4 =
+static const struct WindowTemplate sSearchResultListMenuWindowTemplate =
{
.bg = 1,
.tilemapLeft = 1,
@@ -117,138 +128,139 @@ static const u8 sText_MaleSymbol[] = _("{COLOR_HIGHLIGHT_SHADOW}{LIGHT_RED}{WHIT
static const u8 sText_FemaleSymbol[] = _("{COLOR_HIGHLIGHT_SHADOW}{LIGHT_GREEN}{WHITE}{BLUE}♀{COLOR_HIGHLIGHT_SHADOW}{DARK_GREY}{WHITE}{LIGHT_GREY}");
static const u8 sText_NoGenderSymbol[] = _("{UNK_SPACER}");
-bool32 PokenavCallback_Init_8(void)
+bool32 PokenavCallback_Init_ConditionSearch(void)
{
struct PokenavSub7 *structPtr = AllocSubstruct(7, sizeof(struct PokenavSub7));
if (structPtr == NULL)
return FALSE;
- structPtr->unkPtr = AllocSubstruct(18, sizeof(struct PokenavSub18));
- if (structPtr->unkPtr == NULL)
+ structPtr->monList = AllocSubstruct(POKENAV_SUBSTRUCT_MON_LIST, sizeof(struct PokenavSub18));
+ if (structPtr->monList == NULL)
return FALSE;
- structPtr->unk0 = sub_81CF010;
- structPtr->loopedTaskId = CreateLoopedTask(sub_81CF11C, 1);
- structPtr->unk18 = 0;
- structPtr->unk14 = gUnknown_086233A0[GetSelectedConditionSearch()];
+ structPtr->callback = HandleConditionSearchInput_WaitSetup;
+ structPtr->loopedTaskId = CreateLoopedTask(GetConditionSearchLoopedTask, 1);
+ structPtr->returnFromGraph = 0;
+ structPtr->conditionDataId = sSearchMonDataIds[GetSelectedConditionSearch()];
return TRUE;
}
-bool32 PokenavCallback_Init_10(void)
+// return to search results from condition graph
+bool32 PokenavCallback_Init_ReturnToMonSearchList(void)
{
- struct PokenavSub7 *structPtr = AllocSubstruct(7, sizeof(struct PokenavSub7));
+ struct PokenavSub7 *structPtr = AllocSubstruct(POKENAV_SUBSTRUCT_CONDITION_SEARCH_RESULTS, sizeof(struct PokenavSub7));
if (structPtr == NULL)
return FALSE;
- structPtr->unkPtr = GetSubstructPtr(18);
- structPtr->unk0 = sub_81CF030;
- structPtr->unk18 = 1;
- structPtr->unk14 = gUnknown_086233A0[GetSelectedConditionSearch()];
+ structPtr->monList = GetSubstructPtr(POKENAV_SUBSTRUCT_MON_LIST);
+ structPtr->callback = HandleConditionSearchInput;
+ structPtr->returnFromGraph = 1;
+ structPtr->conditionDataId = sSearchMonDataIds[GetSelectedConditionSearch()];
return TRUE;
}
-u32 sub_81CEFDC(void)
+u32 GetConditionSearchResultsCallback(void)
{
- struct PokenavSub7 *structPtr = GetSubstructPtr(7);
- return structPtr->unk0(structPtr);
+ struct PokenavSub7 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_SEARCH_RESULTS);
+ return structPtr->callback(structPtr);
}
-void sub_81CEFF0(void)
+void FreeSearchResultSubstruct1(void)
{
- struct PokenavSub7 *structPtr = GetSubstructPtr(7);
- if (structPtr->unk1C == 0)
- FreePokenavSubstruct(18);
- FreePokenavSubstruct(7);
+ struct PokenavSub7 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_SEARCH_RESULTS);
+ if (structPtr->isPartyCondition == 0)
+ FreePokenavSubstruct(POKENAV_SUBSTRUCT_MON_LIST);
+ FreePokenavSubstruct(POKENAV_SUBSTRUCT_CONDITION_SEARCH_RESULTS);
}
-static bool32 sub_81CF010(struct PokenavSub7 *structPtr)
+static bool32 HandleConditionSearchInput_WaitSetup(struct PokenavSub7 *structPtr)
{
if (!IsLoopedTaskActive(structPtr->loopedTaskId))
- structPtr->unk0 = sub_81CF030;
+ structPtr->callback = HandleConditionSearchInput;
return FALSE;
}
-static u32 sub_81CF030(struct PokenavSub7 *structPtr)
+static u32 HandleConditionSearchInput(struct PokenavSub7 *structPtr)
{
- if (gMain.newAndRepeatedKeys & DPAD_UP)
- return 1;
- else if (gMain.newAndRepeatedKeys & DPAD_DOWN)
- return 2;
- else if (gMain.newKeys & DPAD_LEFT)
- return 3;
- else if (gMain.newKeys & DPAD_RIGHT)
- return 4;
- else if (gMain.newKeys & B_BUTTON)
+ if (JOY_REPEAT(DPAD_UP))
+ return CONDITION_SEARCH_FUNC_MOVE_UP;
+ else if (JOY_REPEAT(DPAD_DOWN))
+ return CONDITION_SEARCH_FUNC_MOVE_DOWN;
+ else if (JOY_NEW(DPAD_LEFT))
+ return CONDITION_SEARCH_FUNC_PAGE_UP;
+ else if (JOY_NEW(DPAD_RIGHT))
+ return CONDITION_SEARCH_FUNC_PAGE_DOWN;
+ else if (JOY_NEW(B_BUTTON))
{
- structPtr->unk1C = 0;
- structPtr->unk0 = sub_81CF0B0;
- return 5;
+ structPtr->isPartyCondition = 0;
+ structPtr->callback = ReturnToConditionSearchList;
+ return CONDITION_SEARCH_FUNC_EXIT;
}
else if (gMain.newKeys & A_BUTTON)
{
- structPtr->unkPtr->unk2 = GetSelectedMatchCall();
- structPtr->unk1C = 1;
- structPtr->unk0 = sub_81CF0B8;
- return 6;
+ structPtr->monList->currIndex = GetSelectedPokenavListIndex();
+ structPtr->isPartyCondition = 1;
+ structPtr->callback = OpenConditionGraphFromSearchList;
+ return CONDITION_SEARCH_FUNC_SELECT_MON;
}
else
- return 0;
+ return CONDITION_SEARCH_FUNC_NONE;
}
-static u32 sub_81CF0B0(struct PokenavSub7 *structPtr)
+static u32 ReturnToConditionSearchList(struct PokenavSub7 *structPtr)
{
return POKENAV_CONDITION_SEARCH_MENU;
}
-static u32 sub_81CF0B8(struct PokenavSub7 *structPtr)
+static u32 OpenConditionGraphFromSearchList(struct PokenavSub7 *structPtr)
{
- return POKENAV_MENU_9;
+ return POKENAV_CONDITION_GRAPH_FROM_SEARCH;
}
static u32 sub_81CF0C0(void)
{
- struct PokenavSub7 *structPtr = GetSubstructPtr(7);
- return structPtr->unk18;
+ struct PokenavSub7 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_SEARCH_RESULTS);
+ return structPtr->returnFromGraph;
}
-static struct PokenavMonList * sub_81CF0D0(void)
+static struct PokenavMonList * GetSearchResultsMonDataList(void)
{
- struct PokenavSub7 * ptr = GetSubstructPtr(7);
- return ptr->unkPtr->unk4;
+ struct PokenavSub7 * ptr = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_SEARCH_RESULTS);
+ return ptr->monList->monData;
}
-static u16 sub_81CF0E0(void)
+static u16 GetSearchResultsMonListCount(void)
{
- struct PokenavSub7 * ptr = GetSubstructPtr(7);
- return ptr->unkPtr->unk0;
+ struct PokenavSub7 * ptr = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_SEARCH_RESULTS);
+ return ptr->monList->listCount;
}
-static s32 sub_81CF0F0(void)
+static s32 GetSearchResultsSelectedMonData(void)
{
- struct PokenavSub7 * ptr = GetSubstructPtr(7);
- s32 i = GetSelectedMatchCall();
- return ptr->unkPtr->unk4[i].data;
+ struct PokenavSub7 * ptr = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_SEARCH_RESULTS);
+ s32 i = GetSelectedPokenavListIndex();
+ return ptr->monList->monData[i].data;
}
static u16 sub_81CF10C(void)
{
- struct PokenavSub7 * ptr = GetSubstructPtr(7);
- return ptr->unkPtr->unk2;
+ struct PokenavSub7 * ptr = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_SEARCH_RESULTS);
+ return ptr->monList->currIndex;
}
-static u32 sub_81CF11C(s32 state)
+static u32 GetConditionSearchLoopedTask(s32 state)
{
- return gUnknown_086233B4[state](state);
+ return sConditionSearchLoopedTaskFuncs[state](state);
}
-static u32 sub_81CF134(s32 state)
+static u32 BuildPartyMonSearchResults(s32 state)
{
s32 i;
struct PokenavMonList item;
- struct PokenavSub7 * ptr = GetSubstructPtr(7);
+ struct PokenavSub7 * ptr = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_SEARCH_RESULTS);
- ptr->unkPtr->unk0 = 0;
- ptr->unkPtr->unk2 = 0;
+ ptr->monList->listCount = 0;
+ ptr->monList->currIndex = 0;
item.boxId = 14;
for (i = 0; i < PARTY_SIZE; i++)
{
@@ -258,7 +270,7 @@ static u32 sub_81CF134(s32 state)
if (!GetMonData(pokemon, MON_DATA_SANITY_IS_EGG))
{
item.monId = i;
- item.data = GetMonData(pokemon, ptr->unk14);
+ item.data = GetMonData(pokemon, ptr->conditionDataId);
sub_81CF2C4(ptr, &item);
}
}
@@ -266,19 +278,19 @@ static u32 sub_81CF134(s32 state)
return LT_INC_AND_CONTINUE;
}
-static u32 sub_81CF1C4(s32 state)
+static u32 InitBoxMonSearchResults(s32 state)
{
- struct PokenavSub7 * ptr = GetSubstructPtr(7);
- ptr->unk10 = 0;
- ptr->unkC = 0;
+ struct PokenavSub7 * ptr = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_SEARCH_RESULTS);
+ ptr->monId = 0;
+ ptr->boxId = 0;
return LT_INC_AND_CONTINUE;
}
-static u32 sub_81CF1D8(s32 state)
+static u32 BuildBoxMonSearchResults(s32 state)
{
- struct PokenavSub7 * ptr = GetSubstructPtr(7);
- s32 boxId = ptr->unkC;
- s32 monId = ptr->unk10;
+ struct PokenavSub7 * ptr = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_SEARCH_RESULTS);
+ s32 boxId = ptr->boxId;
+ s32 monId = ptr->monId;
s32 boxCount = 0;
struct PokenavMonList item;
@@ -290,15 +302,15 @@ static u32 sub_81CF1D8(s32 state)
{
item.boxId = boxId;
item.monId = monId;
- item.data = GetBoxMonDataAt(boxId, monId, ptr->unk14);
+ item.data = GetBoxMonDataAt(boxId, monId, ptr->conditionDataId);
sub_81CF2C4(ptr, &item);
}
boxCount++;
monId++;
if (boxCount > 14)
{
- ptr->unkC = boxId;
- ptr->unk10 = monId;
+ ptr->boxId = boxId;
+ ptr->monId = monId;
return LT_CONTINUE;
}
}
@@ -311,108 +323,108 @@ static u32 sub_81CF1D8(s32 state)
static u32 sub_81CF278(s32 state)
{
- struct PokenavSub7 * ptr = GetSubstructPtr(7);
- s32 r6 = ptr->unkPtr->unk0;
- s32 r4 = ptr->unkPtr->unk4[0].data;
+ struct PokenavSub7 * ptr = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_SEARCH_RESULTS);
+ s32 r6 = ptr->monList->listCount;
+ s32 r4 = ptr->monList->monData[0].data;
s32 i;
- ptr->unkPtr->unk4[0].data = 1;
+ ptr->monList->monData[0].data = 1;
for (i = 1; i < r6; i++)
{
- if (ptr->unkPtr->unk4[i].data == r4)
+ if (ptr->monList->monData[i].data == r4)
{
- ptr->unkPtr->unk4[i].data = ptr->unkPtr->unk4[i - 1].data;
+ ptr->monList->monData[i].data = ptr->monList->monData[i - 1].data;
}
else
{
- r4 = ptr->unkPtr->unk4[i].data;
- ptr->unkPtr->unk4[i].data = i + 1;
+ r4 = ptr->monList->monData[i].data;
+ ptr->monList->monData[i].data = i + 1;
}
}
- ptr->unk18 = 1;
+ ptr->returnFromGraph = 1;
return LT_FINISH;
}
static void sub_81CF2C4(struct PokenavSub7 *structPtr, struct PokenavMonList *item)
{
u32 left = 0;
- u32 right = structPtr->unkPtr->unk0;
+ u32 right = structPtr->monList->listCount;
u32 insertionIdx = left + (right - left) / 2;
while (right != insertionIdx)
{
- if (item->data > structPtr->unkPtr->unk4[insertionIdx].data)
+ if (item->data > structPtr->monList->monData[insertionIdx].data)
right = insertionIdx;
else
left = insertionIdx + 1;
insertionIdx = left + (right - left) / 2;
}
- for (right = structPtr->unkPtr->unk0; right > insertionIdx; right--)
- structPtr->unkPtr->unk4[right] = structPtr->unkPtr->unk4[right - 1];
- structPtr->unkPtr->unk4[insertionIdx] = *item;
- structPtr->unkPtr->unk0++;
+ for (right = structPtr->monList->listCount; right > insertionIdx; right--)
+ structPtr->monList->monData[right] = structPtr->monList->monData[right - 1];
+ structPtr->monList->monData[insertionIdx] = *item;
+ structPtr->monList->listCount++;
}
-bool32 sub_81CF330(void)
+bool32 OpenConditionSearchResults(void)
{
- struct PokenavSub8 * unk = AllocSubstruct(8, sizeof(struct PokenavSub8));
- if (unk == NULL)
+ struct PokenavSub8 *searchList = AllocSubstruct(POKENAV_SUBSTRUCT_CONDITION_SEARCH_RESULT_LIST, sizeof(struct PokenavSub8));
+ if (searchList == NULL)
return FALSE;
- unk->ltid = CreateLoopedTask(sub_81CF418, 1);
- unk->callback = sub_81CF3E4;
- unk->unkC = FALSE;
+ searchList->ltid = CreateLoopedTask(LoopedTask_OpenConditionSearchResults, 1);
+ searchList->callback = GetSearchResultCurrentLoopedTaskActive;
+ searchList->fromGraph = FALSE;
return TRUE;
}
-bool32 sub_81CF368(void)
+bool32 OpenConditionSearchListFromGraph(void)
{
- struct PokenavSub8 * unk = AllocSubstruct(8, sizeof(struct PokenavSub8));
- if (unk == NULL)
+ struct PokenavSub8 *searchList = AllocSubstruct(POKENAV_SUBSTRUCT_CONDITION_SEARCH_RESULT_LIST, sizeof(struct PokenavSub8));
+ if (searchList == NULL)
return FALSE;
- unk->ltid = CreateLoopedTask(sub_81CF418, 1);
- unk->callback = sub_81CF3E4;
- unk->unkC = TRUE;
+ searchList->ltid = CreateLoopedTask(LoopedTask_OpenConditionSearchResults, 1);
+ searchList->callback = GetSearchResultCurrentLoopedTaskActive;
+ searchList->fromGraph = TRUE;
return TRUE;
}
-void sub_81CF3A0(s32 idx)
+void CreateSearchResultsLoopedTask(s32 idx)
{
- struct PokenavSub8 * unk = GetSubstructPtr(8);
- unk->ltid = CreateLoopedTask(gUnknown_08623598[idx], 1);
- unk->callback = sub_81CF3E4;
+ struct PokenavSub8 *searchList = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_SEARCH_RESULT_LIST);
+ searchList->ltid = CreateLoopedTask(sSearchResultLoopTaskFuncs[idx], 1);
+ searchList->callback = GetSearchResultCurrentLoopedTaskActive;
}
-bool32 sub_81CF3D0(void)
+bool32 IsSearchResultLoopedTaskActive(void)
{
- struct PokenavSub8 * unk = GetSubstructPtr(8);
- return unk->callback();
+ struct PokenavSub8 *searchList = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_SEARCH_RESULT_LIST);
+ return searchList->callback();
}
-bool32 sub_81CF3E4(void)
+bool32 GetSearchResultCurrentLoopedTaskActive(void)
{
- struct PokenavSub8 * unk = GetSubstructPtr(8);
- return IsLoopedTaskActive(unk->ltid);
+ struct PokenavSub8 *searchList = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_SEARCH_RESULT_LIST);
+ return IsLoopedTaskActive(searchList->ltid);
}
-void sub_81CF3F8(void)
+void FreeSearchResultSubstruct2(void)
{
- struct PokenavSub8 * unk = GetSubstructPtr(8);
+ struct PokenavSub8 *searchList = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_SEARCH_RESULT_LIST);
sub_81C8234();
- RemoveWindow(unk->winid);
- FreePokenavSubstruct(8);
+ RemoveWindow(searchList->winid);
+ FreePokenavSubstruct(POKENAV_SUBSTRUCT_CONDITION_SEARCH_RESULT_LIST);
}
-static u32 sub_81CF418(s32 state)
+static u32 LoopedTask_OpenConditionSearchResults(s32 state)
{
- struct PokenavSub8 * unk = GetSubstructPtr(8);
+ struct PokenavSub8 *searchList = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_SEARCH_RESULT_LIST);
switch (state)
{
case 0:
- InitBgTemplates(gUnknown_08623590, NELEMS(gUnknown_08623590));
- DecompressAndCopyTileDataToVram(1, gUnknown_086233E4, 0, 0, 0);
- SetBgTilemapBuffer(1, unk->buff);
- CopyToBgTilemapBuffer(1, gUnknown_086234AC, 0, 0);
+ InitBgTemplates(sConditionSearchResultBgTemplates, NELEMS(sConditionSearchResultBgTemplates));
+ DecompressAndCopyTileDataToVram(1, sConditionSearchResultTiles, 0, 0, 0);
+ SetBgTilemapBuffer(1, searchList->buff);
+ CopyToBgTilemapBuffer(1, sConditionSearchResultTilemap, 0, 0);
CopyBgTilemapBufferToVram(1);
- CopyPaletteIntoBufferUnfaded(gUnknown_086233C4, 0x10, 0x20);
+ CopyPaletteIntoBufferUnfaded(sConditionSearchResultFramePal, 0x10, 0x20);
CopyBgTilemapBufferToVram(1);
return LT_INC_AND_PAUSE;
case 1:
@@ -424,13 +436,13 @@ static u32 sub_81CF418(s32 state)
case 2:
if (FreeTempTileDataBuffersIfPossible())
return LT_PAUSE;
- CopyPaletteIntoBufferUnfaded(gUnknown_08623570, 0x20, 0x20);
- sub_81CF88C();
+ CopyPaletteIntoBufferUnfaded(gUnknown_08623570, 0x20, 32);
+ InitConditionSearchListMenuTemplate();
return LT_INC_AND_PAUSE;
case 3:
if (sub_81C8224())
return LT_PAUSE;
- sub_81CF7C8(unk);
+ AddSearchResultListMenuWindow(searchList);
PrintHelpBarText(HELPBAR_CONDITION_MON_LIST);
return LT_INC_AND_PAUSE;
case 4:
@@ -441,28 +453,28 @@ static u32 sub_81CF418(s32 state)
ShowBg(1);
ShowBg(2);
HideBg(3);
- if (!unk->unkC)
+ if (!searchList->fromGraph)
{
- u8 r4 = GetSelectedConditionSearch() + POKENAV_MENUITEM_CONDITION_SEARCH_COOL;
- LoadLeftHeaderGfxForIndex(r4);
- sub_81C7FA0(r4, 1, 0);
- sub_81C7FA0(1, 1, 0);
+ u8 searchGfxId = GetSelectedConditionSearch() + POKENAV_MENUITEM_CONDITION_SEARCH_COOL;
+ LoadLeftHeaderGfxForIndex(searchGfxId);
+ ShowLeftHeaderGfx(searchGfxId, 1, 0);
+ ShowLeftHeaderGfx(POKENAV_GFX_CONDITION_MENU, 1, 0);
}
PokenavFadeScreen(1);
return LT_INC_AND_PAUSE;
case 5:
if (IsPaletteFadeActive())
return LT_PAUSE;
- if (sub_81C8010())
+ if (AreLeftHeaderSpritesMoving())
return LT_PAUSE;
break;
}
return LT_FINISH;
}
-static u32 sub_81CF578(s32 state)
+static u32 LoopedTask_MoveSearchListCursorUp(s32 state)
{
- struct PokenavSub8 * unk = GetSubstructPtr(8);
+ struct PokenavSub8 *searchList = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_SEARCH_RESULT_LIST);
switch (state)
{
case 0:
@@ -479,11 +491,11 @@ static u32 sub_81CF578(s32 state)
}
return LT_INC_AND_PAUSE;
case 1:
- if (sub_81C8630())
+ if (IsMonListLoopedTaskActive())
return LT_PAUSE;
// fallthrough
case 2:
- sub_81CF7F4(unk);
+ PrintSearchResultListMenuItems(searchList);
return LT_INC_AND_PAUSE;
case 3:
if (IsDma3ManagerBusyWithBgCopy())
@@ -493,9 +505,9 @@ static u32 sub_81CF578(s32 state)
return LT_FINISH;
}
-static u32 sub_81CF5F0(s32 state)
+static u32 LoopedTask_MoveSearchListCursorDown(s32 state)
{
- struct PokenavSub8 * unk = GetSubstructPtr(8);
+ struct PokenavSub8 *searchList = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_SEARCH_RESULT_LIST);
switch (state)
{
case 0:
@@ -512,11 +524,11 @@ static u32 sub_81CF5F0(s32 state)
}
return LT_INC_AND_PAUSE;
case 1:
- if (sub_81C8630())
+ if (IsMonListLoopedTaskActive())
return LT_PAUSE;
// fallthrough
case 2:
- sub_81CF7F4(unk);
+ PrintSearchResultListMenuItems(searchList);
return LT_INC_AND_PAUSE;
case 3:
if (IsDma3ManagerBusyWithBgCopy())
@@ -526,9 +538,9 @@ static u32 sub_81CF5F0(s32 state)
return LT_FINISH;
}
-static u32 sub_81CF668(s32 state)
+static u32 LoopedTask_MoveSearchListPageUp(s32 state)
{
- struct PokenavSub8 * unk = GetSubstructPtr(8);
+ struct PokenavSub8 *searchList = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_SEARCH_RESULT_LIST);
switch (state)
{
case 0:
@@ -545,11 +557,11 @@ static u32 sub_81CF668(s32 state)
}
return LT_INC_AND_PAUSE;
case 1:
- if (sub_81C8630())
+ if (IsMonListLoopedTaskActive())
return LT_PAUSE;
// fallthrough
case 2:
- sub_81CF7F4(unk);
+ PrintSearchResultListMenuItems(searchList);
return LT_INC_AND_PAUSE;
case 3:
if (IsDma3ManagerBusyWithBgCopy())
@@ -559,9 +571,9 @@ static u32 sub_81CF668(s32 state)
return LT_FINISH;
}
-static u32 sub_81CF6E0(s32 state)
+static u32 LoopedTask_MoveSearchListPageDown(s32 state)
{
- struct PokenavSub8 * unk = GetSubstructPtr(8);
+ struct PokenavSub8 *searchList = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_SEARCH_RESULT_LIST);
switch (state)
{
case 0:
@@ -578,11 +590,11 @@ static u32 sub_81CF6E0(s32 state)
}
return LT_INC_AND_PAUSE;
case 1:
- if (sub_81C8630())
+ if (IsMonListLoopedTaskActive())
return LT_PAUSE;
// fallthrough
case 2:
- sub_81CF7F4(unk);
+ PrintSearchResultListMenuItems(searchList);
return LT_INC_AND_PAUSE;
case 3:
if (IsDma3ManagerBusyWithBgCopy())
@@ -592,27 +604,27 @@ static u32 sub_81CF6E0(s32 state)
return LT_FINISH;
}
-static u32 sub_81CF758(s32 state)
+static u32 LoopedTask_ExitConditionSearchMenu(s32 state)
{
switch (state)
{
case 0:
PlaySE(SE_SELECT);
PokenavFadeScreen(0);
- sub_81C78A0();
+ SlideMenuHeaderDown();
return LT_INC_AND_PAUSE;
case 1:
if (IsPaletteFadeActive())
return LT_PAUSE;
if (MainMenuLoopedTaskIsBusy())
return LT_PAUSE;
- sub_81C7FDC();
+ SetLeftHeaderSpritesInvisibility();
break;
}
return LT_FINISH;
}
-static u32 sub_81CF798(s32 state)
+static u32 LoopedTask_SelectSearchResult(s32 state)
{
switch (state)
{
@@ -628,46 +640,47 @@ static u32 sub_81CF798(s32 state)
return LT_FINISH;
}
-static void sub_81CF7C8(struct PokenavSub8 * ptr)
+static void AddSearchResultListMenuWindow(struct PokenavSub8 *searchList)
{
- ptr->winid = AddWindow(&gUnknown_086235B4);
- PutWindowTilemap(ptr->winid);
- CopyWindowToVram(ptr->winid, 1);
- sub_81CF7F4(ptr);
+ searchList->winid = AddWindow(&sSearchResultListMenuWindowTemplate);
+ PutWindowTilemap(searchList->winid);
+ CopyWindowToVram(searchList->winid, 1);
+ PrintSearchResultListMenuItems(searchList);
}
-static void sub_81CF7F4(struct PokenavSub8 * ptr)
+static void PrintSearchResultListMenuItems(struct PokenavSub8 *searchList)
{
- s32 r7 = sub_81CF0F0();
+ s32 r7 = GetSearchResultsSelectedMonData();
DynamicPlaceholderTextUtil_Reset();
DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, gStringVar1);
*gStringVar1 = EOS;
DynamicPlaceholderTextUtil_ExpandPlaceholders(gStringVar2, gText_NumberF700);
- AddTextPrinterParameterized(ptr->winid, 1, gStringVar2, 4, 1, 0xFF, NULL);
+ AddTextPrinterParameterized(searchList->winid, 1, gStringVar2, 4, 1, 0xFF, NULL);
ConvertIntToDecimalStringN(gStringVar1, r7, STR_CONV_MODE_RIGHT_ALIGN, 3);
- AddTextPrinterParameterized(ptr->winid, 1, gStringVar1, 34, 1, 0xFF, NULL);
- CopyWindowToVram(ptr->winid, 2);
+ AddTextPrinterParameterized(searchList->winid, 1, gStringVar1, 34, 1, 0xFF, NULL);
+ CopyWindowToVram(searchList->winid, 2);
}
-static void sub_81CF88C(void)
+static void InitConditionSearchListMenuTemplate(void)
{
struct PokenavListTemplate template;
- template.list.monList = sub_81CF0D0();
- template.unk4 = sub_81CF0E0();
+
+ template.list.monList = GetSearchResultsMonDataList();
+ template.count = GetSearchResultsMonListCount();
template.unk8 = 4;
template.unk6 = sub_81CF10C();
- template.unk9 = 13;
- template.unkA = 17;
- template.unkB = 1;
- template.unkC = 8;
- template.unkD = 2;
- template.unkE = 1;
- template.listFunc.unk10_1 = sub_81CF8E4;
+ template.item_X = 13;
+ template.windowWidth = 17;
+ template.listTop = 1;
+ template.maxShowed = 8;
+ template.fillValue = 2;
+ template.fontId = 1;
+ template.listFunc.printMonFunc = PrintSearchMonListItem;
template.unk14 = NULL;
- sub_81C81D4(&gUnknown_08623590[1], &template, 0);
+ sub_81C81D4(&sConditionSearchResultBgTemplates[1], &template, 0);
}
-static void sub_81CF8E4(struct PokenavMonList * item, u8 * dest)
+static void PrintSearchMonListItem(struct PokenavMonList * item, u8 * dest)
{
u8 gender;
u8 level;
diff --git a/src/pokenav_main_menu.c b/src/pokenav_main_menu.c
index fc7004a88..009cf783f 100644
--- a/src/pokenav_main_menu.c
+++ b/src/pokenav_main_menu.c
@@ -15,9 +15,9 @@
struct PokenavMainMenuResources
{
- void (*unk0)(u32);
- u32 (*unk4)(void);
- u32 unk8;
+ void (*loopTask)(u32);
+ u32 (*isLoopTaskActiveFunc)(void);
+ u32 unused;
u32 currentTaskId;
u32 helpBarWindowId;
u32 palettes;
@@ -47,8 +47,8 @@ static void SpriteCB_MoveLeftHeader(struct Sprite *sprite);
static void InitPokenavMainMenuResources(void);
static void InitHoennMapHeaderSprites(void);
static void InitHelpBar(void);
-static u32 LoopedTask_ScrollMenuHeaderDown(s32 a0);
-static u32 LoopedTask_ScrollMenuHeaderUp(s32 a0);
+static u32 LoopedTask_SlideMenuHeaderUp(s32 a0);
+static u32 LoopedTask_SlideMenuHeaderDown(s32 a0);
static void DrawHelpBar(u32 windowId);
static void SpriteCB_SpinningPokenav(struct Sprite* sprite);
static u32 LoopedTask_InitPokenavMenu(s32 a0);
@@ -294,7 +294,7 @@ bool32 InitPokenavMainMenu(void)
{
struct PokenavMainMenuResources *structPtr;
- structPtr = AllocSubstruct(0, sizeof(struct PokenavMainMenuResources));
+ structPtr = AllocSubstruct(POKENAV_SUBSTRUCT_MAIN_MENU, sizeof(struct PokenavMainMenuResources));
if (structPtr == NULL)
return FALSE;
@@ -306,14 +306,14 @@ bool32 InitPokenavMainMenu(void)
u32 PokenavMainMenuLoopedTaskIsActive(void)
{
- struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
+ struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
return IsLoopedTaskActive(structPtr->currentTaskId);
}
void ShutdownPokenav(void)
{
PlaySE(SE_POKENAV_OFF);
- sub_81CAADC();
+ ResetBldCnt_();
BeginNormalPaletteFade(0xFFFFFFFF, -1, 0, 16, RGB_BLACK);
}
@@ -345,7 +345,7 @@ static u32 LoopedTask_InitPokenavMenu(s32 a0)
ResetTempTileDataBuffers();
return LT_INC_AND_CONTINUE;
case 1:
- structPtr = GetSubstructPtr(0);
+ structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
DecompressAndCopyTileDataToVram(0, &gPokenavHeader_Gfx, 0, 0, 0);
SetBgTilemapBuffer(0, structPtr->tilemapBuffer);
CopyToBgTilemapBuffer(0, &gPokenavHeader_Tilemap, 0, 0);
@@ -371,46 +371,46 @@ static u32 LoopedTask_InitPokenavMenu(s32 a0)
}
}
-void sub_81C7834(void *func1, void *func2) // Fix types later.
+void SetActiveMenuLoopTasks(void *createLoopTask, void *isLoopTaskActive) // Fix types later.
{
- struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
- structPtr->unk0 = func1;
- structPtr->unk4 = func2;
- structPtr->unk8 = 0;
+ struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
+ structPtr->loopTask = createLoopTask;
+ structPtr->isLoopTaskActiveFunc = isLoopTaskActive;
+ structPtr->unused = 0;
}
-void sub_81C7850(u32 a0)
+void RunMainMenuLoopedTask(u32 a0)
{
- struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
- structPtr->unk8 = 0;
- structPtr->unk0(a0);
+ struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
+ structPtr->unused = 0;
+ structPtr->loopTask(a0);
}
-u32 sub_81C786C(void)
+u32 IsActiveMenuLoopTaskActive(void)
{
- struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
- return structPtr->unk4();
+ struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
+ return structPtr->isLoopTaskActiveFunc();
}
-void sub_81C7880(void)
+void SlideMenuHeaderUp(void)
{
- struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
- structPtr->currentTaskId = CreateLoopedTask(LoopedTask_ScrollMenuHeaderDown, 4);
+ struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
+ structPtr->currentTaskId = CreateLoopedTask(LoopedTask_SlideMenuHeaderUp, 4);
}
-void sub_81C78A0(void)
+void SlideMenuHeaderDown(void)
{
- struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
- structPtr->currentTaskId = CreateLoopedTask(LoopedTask_ScrollMenuHeaderUp, 4);
+ struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
+ structPtr->currentTaskId = CreateLoopedTask(LoopedTask_SlideMenuHeaderDown, 4);
}
bool32 MainMenuLoopedTaskIsBusy(void)
{
- struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
+ struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
return IsLoopedTaskActive(structPtr->currentTaskId);
}
-static u32 LoopedTask_ScrollMenuHeaderDown(s32 a0)
+static u32 LoopedTask_SlideMenuHeaderUp(s32 a0)
{
switch (a0)
{
@@ -431,7 +431,7 @@ static u32 LoopedTask_ScrollMenuHeaderDown(s32 a0)
}
}
-static u32 LoopedTask_ScrollMenuHeaderUp(s32 a0)
+static u32 LoopedTask_SlideMenuHeaderDown(s32 a0)
{
if (ChangeBgY(0, 384, 2) <= 0)
{
@@ -466,35 +466,35 @@ void Pokenav_AllocAndLoadPalettes(const struct SpritePalette *palettes)
}
}
-void sub_81C7990(u32 a0, u16 a1)
+void PokenavFillPalette(u32 palIndex, u16 fillValue)
{
- CpuFill16(a1, gPlttBufferFaded + 0x100 + (a0 * 16), 16 * sizeof(u16));
+ CpuFill16(fillValue, gPlttBufferFaded + 0x100 + (palIndex * 16), 16 * sizeof(u16));
}
-void sub_81C79BC(const u16 *a0, const u16 *a1, int a2, int a3, int a4, u16 *palette)
+void PokenavCopyPalette(const u16 *src, const u16 *dest, int size, int a3, int a4, u16 *palette)
{
if (a4 == 0)
{
- CpuCopy16(a0, palette, a2 * 2);
+ CpuCopy16(src, palette, size * 2);
}
else if (a4 >= a3)
{
- CpuCopy16(a1, palette, a2 * 2);
+ CpuCopy16(dest, palette, size * 2);
}
else
{
int r, g, b;
int r1, g1, b1;
- while (a2--)
+ while (size--)
{
- r = GET_R(*a0);
- g = GET_G(*a0);
- b = GET_B(*a0);
+ r = GET_R(*src);
+ g = GET_G(*src);
+ b = GET_B(*src);
- r1 = ((((GET_R(*a1) << 8) - (r << 8)) / a3) * a4) >> 8;
- g1 = ((((GET_G(*a1) << 8) - (g << 8)) / a3) * a4) >> 8;
- b1 = ((((GET_B(*a1) << 8) - (b << 8)) / a3) * a4) >> 8;
+ r1 = ((((GET_R(*dest) << 8) - (r << 8)) / a3) * a4) >> 8;
+ g1 = ((((GET_G(*dest) << 8) - (g << 8)) / a3) * a4) >> 8;
+ b1 = ((((GET_B(*dest) << 8) - (b << 8)) / a3) * a4) >> 8;
r = (r + r1) & 0x1F; //_RGB(r + r1, g + g1, b + b1); doesn't match; I have to assign the value of ((r + r1) & 0x1F) to r1
g = (g + g1) & 0x1F; //See above
@@ -502,7 +502,7 @@ void sub_81C79BC(const u16 *a0, const u16 *a1, int a2, int a3, int a4, u16 *pale
*palette = RGB2(r, g, b); //See above comment
- a0++, a1++;
+ src++, dest++;
palette++;
}
}
@@ -510,7 +510,7 @@ void sub_81C79BC(const u16 *a0, const u16 *a1, int a2, int a3, int a4, u16 *pale
void PokenavFadeScreen(s32 fadeType)
{
- struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
+ struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
switch (fadeType)
{
@@ -549,7 +549,7 @@ void InitBgTemplates(const struct BgTemplate *templates, int count)
static void InitHelpBar(void)
{
- struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
+ struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
InitWindows(&sHelpBarWindowTemplate[0]);
structPtr->helpBarWindowId = 0;
@@ -560,7 +560,7 @@ static void InitHelpBar(void)
void PrintHelpBarText(u32 textId)
{
- struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
+ struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
DrawHelpBar(structPtr->helpBarWindowId);
AddTextPrinterParameterized3(structPtr->helpBarWindowId, 1, 0, 1, sHelpBarTextColors, 0, sHelpBarTexts[textId]);
@@ -581,7 +581,7 @@ static void InitPokenavMainMenuResources(void)
{
s32 i;
u8 spriteId;
- struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
+ struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
for (i = 0; i < ARRAY_COUNT(gSpinningPokenavSpriteSheet); i++)
LoadCompressedSpriteSheet(&gSpinningPokenavSpriteSheet[i]);
@@ -594,7 +594,7 @@ static void InitPokenavMainMenuResources(void)
static void CleanupPokenavMainMenuResources(void)
{
- struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
+ struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
DestroySprite(structPtr->spinningPokenav);
FreeSpriteTilesByTag(0);
@@ -609,7 +609,7 @@ static void SpriteCB_SpinningPokenav(struct Sprite *sprite)
struct Sprite *PauseSpinningPokenavSprite(void)
{
- struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
+ struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
structPtr->spinningPokenav->callback = SpriteCallbackDummy;
return structPtr->spinningPokenav;
@@ -617,7 +617,7 @@ struct Sprite *PauseSpinningPokenavSprite(void)
void ResumeSpinningPokenavSprite(void)
{
- struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
+ struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
structPtr->spinningPokenav->pos1.x = 220;
structPtr->spinningPokenav->pos1.y = 12;
@@ -630,7 +630,7 @@ void ResumeSpinningPokenavSprite(void)
static void InitHoennMapHeaderSprites(void)
{
s32 i, spriteId;
- struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
+ struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
LoadCompressedSpriteSheet(&sPokenavHoennMapLeftHeaderSpriteSheet);
AllocSpritePalette(1);
@@ -659,9 +659,9 @@ void LoadLeftHeaderGfxForIndex(u32 menuGfxId)
LoadLeftHeaderGfxForSubMenu(menuGfxId - POKENAV_GFX_SUBMENUS_START);
}
-void sub_81C7E14(u32 menuGfxId)
+void UpdateRegionMapRightHeaderTiles(u32 menuGfxId)
{
- struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
+ struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
if (menuGfxId == POKENAV_GFX_MAP_MENU_ZOOMED_OUT)
structPtr->leftHeaderSprites[1]->oam.tileNum = GetSpriteTileStartByTag(2) + 32;
@@ -677,7 +677,7 @@ static void LoadLeftHeaderGfxForMenu(u32 menuGfxId)
if (menuGfxId >= POKENAV_GFX_SUBMENUS_START)
return;
- structPtr = GetSubstructPtr(0);
+ structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
tag = sPokenavMenuLeftHeaderSpriteSheets[menuGfxId].tag;
size = GetDecompressedDataSize(sPokenavMenuLeftHeaderSpriteSheets[menuGfxId].data);
LoadPalette(&gPokenavLeftHeader_Pal[tag * 16], (IndexOfSpritePaletteTag(1) * 16) + 0x100, 0x20);
@@ -705,33 +705,33 @@ static void LoadLeftHeaderGfxForSubMenu(u32 menuGfxId)
RequestDma3Copy(&gDecompressionBuffer[0x1000], (void *)VRAM + 0x10800 + (GetSpriteTileStartByTag(2) * 32), size, 1);
}
-void sub_81C7FA0(u32 menuGfxId, bool32 arg1, bool32 arg2)
+void ShowLeftHeaderGfx(u32 menuGfxId, bool32 isMain, bool32 isOnRightSide)
{
- u32 var;
+ u32 tileTop;
- if (!arg1)
- var = 0x30;
+ if (!isMain)
+ tileTop = 0x30;
else
- var = 0x10;
+ tileTop = 0x10;
if (menuGfxId < POKENAV_GFX_SUBMENUS_START)
- ShowLeftHeaderSprites(var, arg2);
+ ShowLeftHeaderSprites(tileTop, isOnRightSide);
else
- ShowLeftHeaderSubmenuSprites(var, arg2);
+ ShowLeftHeaderSubmenuSprites(tileTop, isOnRightSide);
}
-void sub_81C7FC4(u32 arg0, bool32 arg1)
+void HideMainOrSubMenuLeftHeader(u32 id, bool32 onRightSide)
{
- if (arg0 < 6)
- HideLeftHeaderSprites(arg1);
+ if (id < POKENAV_GFX_PARTY_MENU)
+ HideLeftHeaderSprites(onRightSide);
else
- HideLeftHeaderSubmenuSprites(arg1);
+ HideLeftHeaderSubmenuSprites(onRightSide);
}
-void sub_81C7FDC(void)
+void SetLeftHeaderSpritesInvisibility(void)
{
s32 i;
- struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
+ struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
for (i = 0; i < (s32)ARRAY_COUNT(structPtr->leftHeaderSprites); i++)
{
@@ -740,9 +740,9 @@ void sub_81C7FDC(void)
}
}
-bool32 sub_81C8010(void)
+bool32 AreLeftHeaderSpritesMoving(void)
{
- struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
+ struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
if (structPtr->leftHeaderSprites[0]->callback == SpriteCallbackDummy && structPtr->submenuLeftHeaderSprites[0]->callback == SpriteCallbackDummy)
return FALSE;
@@ -753,7 +753,7 @@ bool32 sub_81C8010(void)
static void ShowLeftHeaderSprites(u32 startY, bool32 isOnRightSide)
{
s32 start, end, i;
- struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
+ struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
if (!isOnRightSide)
start = -96, end = 32;
@@ -770,7 +770,7 @@ static void ShowLeftHeaderSprites(u32 startY, bool32 isOnRightSide)
static void ShowLeftHeaderSubmenuSprites(u32 startY, bool32 isOnRightSide)
{
s32 start, end, i;
- struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
+ struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
if (!isOnRightSide)
start = -96, end = 16;
@@ -787,7 +787,7 @@ static void ShowLeftHeaderSubmenuSprites(u32 startY, bool32 isOnRightSide)
static void HideLeftHeaderSprites(bool32 isOnRightSide)
{
s32 start, end, i;
- struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
+ struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
if (!isOnRightSide)
start = 32, end = -96;
@@ -803,7 +803,7 @@ static void HideLeftHeaderSprites(bool32 isOnRightSide)
static void HideLeftHeaderSubmenuSprites(bool32 isOnRightSide)
{
s32 start, end, i;
- struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
+ struct PokenavMainMenuResources *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU);
if (!isOnRightSide)
start = 16, end = -96;
diff --git a/src/pokenav_match_call_1.c b/src/pokenav_match_call_1.c
index 265259394..f9ca66f37 100755
--- a/src/pokenav_match_call_1.c
+++ b/src/pokenav_match_call_1.c
@@ -53,7 +53,7 @@ static const u8 sMatchCallOptionsHasCheckPage[] =
bool32 PokenavCallback_Init_MatchCall(void)
{
- struct Pokenav3Struct *state = AllocSubstruct(5, sizeof(struct Pokenav3Struct));
+ struct Pokenav3Struct *state = AllocSubstruct(POKENAV_SUBSTRUCT_MATCH_CALL_MAIN, sizeof(struct Pokenav3Struct));
if (!state)
return FALSE;
@@ -66,13 +66,13 @@ bool32 PokenavCallback_Init_MatchCall(void)
u32 GetMatchCallCallback(void)
{
- struct Pokenav3Struct *state = GetSubstructPtr(5);
+ struct Pokenav3Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_MAIN);
return state->callback(state);
}
void FreeMatchCallSubstruct1(void)
{
- FreePokenavSubstruct(5);
+ FreePokenavSubstruct(POKENAV_SUBSTRUCT_MATCH_CALL_MAIN);
}
static u32 CB2_HandleMatchCallInput(struct Pokenav3Struct *state)
@@ -92,7 +92,7 @@ static u32 CB2_HandleMatchCallInput(struct Pokenav3Struct *state)
{
state->callback = CB2_HandleMatchCallOptionsInput;
state->optionCursorPos = 0;
- selection = GetSelectedMatchCall();
+ selection = GetSelectedPokenavListIndex();
if (!state->matchCallEntries[selection].isSpecialTrainer || MatchCall_HasCheckPage(state->matchCallEntries[selection].headerId))
{
@@ -205,7 +205,7 @@ static u32 CB2_HandleCallInput(struct Pokenav3Struct *state)
static u32 sub_81CAD20(s32 taskState)
{
int i, j;
- struct Pokenav3Struct *state = GetSubstructPtr(5);
+ struct Pokenav3Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_MAIN);
switch (taskState)
{
case 0:
@@ -239,7 +239,7 @@ static u32 sub_81CAD20(s32 taskState)
{
state->matchCallEntries[state->numRegistered].headerId = state->headerId;
state->matchCallEntries[state->numRegistered].isSpecialTrainer = FALSE;
- state->matchCallEntries[state->numRegistered].mapSec = sub_81CB0C8(j);
+ state->matchCallEntries[state->numRegistered].mapSec = GetMatchTableMapSectionId(j);
state->numRegistered++;
}
@@ -266,31 +266,31 @@ bool32 IsRematchEntryRegistered(int rematchIndex)
int sub_81CAE28(void)
{
- struct Pokenav3Struct *state = GetSubstructPtr(5);
+ struct Pokenav3Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_MAIN);
return state->unk10;
}
int GetNumberRegistered(void)
{
- struct Pokenav3Struct *state = GetSubstructPtr(5);
+ struct Pokenav3Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_MAIN);
return state->numRegistered;
}
int sub_81CAE48(void)
{
- struct Pokenav3Struct *state = GetSubstructPtr(5);
+ struct Pokenav3Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_MAIN);
return state->unkC;
}
int unref_sub_81CAE58(void)
{
- struct Pokenav3Struct *state = GetSubstructPtr(5);
+ struct Pokenav3Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_MAIN);
return state->numRegistered - state->unkC;
}
int unref_sub_81CAE6C(int arg0)
{
- struct Pokenav3Struct *state = GetSubstructPtr(5);
+ struct Pokenav3Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_MAIN);
arg0 += state->unkC;
if (arg0 >= state->numRegistered)
return REMATCH_TABLE_ENTRIES;
@@ -300,19 +300,19 @@ int unref_sub_81CAE6C(int arg0)
struct PokenavMatchCallEntries *sub_81CAE94(void)
{
- struct Pokenav3Struct *state = GetSubstructPtr(5);
+ struct Pokenav3Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_MAIN);
return state->matchCallEntries;
}
u16 GetMatchCallMapSec(int index)
{
- struct Pokenav3Struct *state = GetSubstructPtr(5);
+ struct Pokenav3Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_MAIN);
return state->matchCallEntries[index].mapSec;
}
bool32 ShouldDrawRematchPokeballIcon(int index)
{
- struct Pokenav3Struct *state = GetSubstructPtr(5);
+ struct Pokenav3Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_MAIN);
if (!state->matchCallEntries[index].isSpecialTrainer)
index = state->matchCallEntries[index].headerId;
else
@@ -327,7 +327,7 @@ bool32 ShouldDrawRematchPokeballIcon(int index)
int GetMatchCallTrainerPic(int index)
{
int headerId;
- struct Pokenav3Struct *state = GetSubstructPtr(5);
+ struct Pokenav3Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_MAIN);
if (!state->matchCallEntries[index].isSpecialTrainer)
{
index = GetTrainerIdxByRematchIdx(state->matchCallEntries[index].headerId);
@@ -348,7 +348,7 @@ int GetMatchCallTrainerPic(int index)
const u8 *GetMatchCallMessageText(int index, u8 *arg1)
{
- struct Pokenav3Struct *state = GetSubstructPtr(5);
+ struct Pokenav3Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_MAIN);
*arg1 = 0;
if (!Overworld_MapTypeAllowsTeleportAndFly(gMapHeader.mapType))
return gText_CallCantBeMadeHere;
@@ -364,7 +364,7 @@ const u8 *GetMatchCallMessageText(int index, u8 *arg1)
const u8 *GetMatchCallFlavorText(int index, int checkPageEntry)
{
int rematchId;
- struct Pokenav3Struct *state = GetSubstructPtr(5);
+ struct Pokenav3Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_MAIN);
if (state->matchCallEntries[index].isSpecialTrainer)
{
rematchId = MatchCall_GetRematchTableIdx(state->matchCallEntries[index].headerId);
@@ -381,13 +381,13 @@ const u8 *GetMatchCallFlavorText(int index, int checkPageEntry)
u16 GetMatchCallOptionCursorPos(void)
{
- struct Pokenav3Struct *state = GetSubstructPtr(5);
+ struct Pokenav3Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_MAIN);
return state->optionCursorPos;
}
u16 GetMatchCallOptionId(int optionId)
{
- struct Pokenav3Struct *state = GetSubstructPtr(5);
+ struct Pokenav3Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_MAIN);
if (state->maxOptionId < optionId)
return MATCH_CALL_OPTION_COUNT;
@@ -422,7 +422,7 @@ void BufferMatchCallNameAndDesc(struct PokenavMatchCallEntries *matchCallEntry,
}
}
-u8 sub_81CB0C8(int rematchIndex)
+u8 GetMatchTableMapSectionId(int rematchIndex)
{
int mapGroup = gRematchTable[rematchIndex].mapGroup;
int mapNum = gRematchTable[rematchIndex].mapNum;
@@ -431,7 +431,7 @@ u8 sub_81CB0C8(int rematchIndex)
int GetIndexDeltaOfNextCheckPageDown(int index)
{
- struct Pokenav3Struct *state = GetSubstructPtr(5);
+ struct Pokenav3Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_MAIN);
int count = 1;
while (++index < state->numRegistered)
{
@@ -448,7 +448,7 @@ int GetIndexDeltaOfNextCheckPageDown(int index)
int GetIndexDeltaOfNextCheckPageUp(int index)
{
- struct Pokenav3Struct *state = GetSubstructPtr(5);
+ struct Pokenav3Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_MAIN);
int count = -1;
while (--index >= 0)
{
@@ -488,8 +488,8 @@ bool32 unref_sub_81CB16C(void)
static bool32 sub_81CB1D0(void)
{
- struct Pokenav3Struct *state = GetSubstructPtr(5);
- int selection = GetSelectedMatchCall();
+ struct Pokenav3Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_MAIN);
+ int selection = GetSelectedPokenavListIndex();
if (!state->matchCallEntries[selection].isSpecialTrainer)
{
if (GetMatchCallMapSec(selection) == gMapHeader.regionMapSectionId)
diff --git a/src/pokenav_match_call_2.c b/src/pokenav_match_call_2.c
index 60091577e..381fa24d8 100755
--- a/src/pokenav_match_call_2.c
+++ b/src/pokenav_match_call_2.c
@@ -23,7 +23,6 @@
#include "constants/game_stat.h"
#include "constants/region_map_sections.h"
#include "constants/songs.h"
-#include "constants/species.h"
struct Pokenav4Struct
{
@@ -37,7 +36,7 @@ struct Pokenav4Struct
u16 msgBoxWindowId;
s16 unk16;
u8 unused18;
- u8 unk19;
+ u8 unused19;
u16 unk1A;
struct Sprite *optionsCursorSprite;
struct Sprite *trainerPicSprite;
@@ -51,9 +50,9 @@ struct Pokenav4Struct
static bool32 GetCurrentLoopedTaskActive(void);
static u32 LoopedTask_OpenMatchCall(s32);
-static void sub_81CBBB8(void);
+static void InitMatchCallPokenavListMenuTemplate(void);
static void sub_81CBC1C(void);
-static void sub_81CC2B4(void);
+static void RemoveMatchCallSprites(void);
static void sub_81CC034(struct Pokenav4Struct *);
static void DrawMatchCallLeftColumnWindows(struct Pokenav4Struct *);
static void UpdateMatchCallInfoBox(struct Pokenav4Struct *);
@@ -120,7 +119,7 @@ static const u16 gUnknown_08622700[] = INCBIN_U16("graphics/pokenav/8622700.gbap
static const u16 gUnknown_08622720[] = INCBIN_U16("graphics/pokenav/pokeball_matchcall.gbapal");
static const u32 gUnknown_08622760[] = INCBIN_U32("graphics/pokenav/pokeball_matchcall.4bpp.lz");
-const struct BgTemplate gUnknown_0862278C[3] =
+const struct BgTemplate sMatchCallBgTemplates[3] =
{
{
.bg = 1,
@@ -153,22 +152,22 @@ const struct BgTemplate gUnknown_0862278C[3] =
static const LoopedTask sMatchCallLoopTaskFuncs[] =
{
- [POKENAV_MC_FUNC_NONE] = NULL,
- [POKENAV_MC_FUNC_DOWN] = MatchCallListCursorDown,
- [POKENAV_MC_FUNC_UP] = MatchCallListCursorUp,
- [POKENAV_MC_FUNC_PG_DOWN] = MatchCallListPageDown,
- [POKENAV_MC_FUNC_PG_UP] = MatchCallListPageUp,
- [POKENAV_MC_FUNC_SELECT] = SelectMatchCallEntry,
+ [POKENAV_MC_FUNC_NONE] = NULL,
+ [POKENAV_MC_FUNC_DOWN] = MatchCallListCursorDown,
+ [POKENAV_MC_FUNC_UP] = MatchCallListCursorUp,
+ [POKENAV_MC_FUNC_PG_DOWN] = MatchCallListPageDown,
+ [POKENAV_MC_FUNC_PG_UP] = MatchCallListPageUp,
+ [POKENAV_MC_FUNC_SELECT] = SelectMatchCallEntry,
[POKENAV_MC_FUNC_MOVE_OPTIONS_CURSOR] = MoveMatchCallOptionsCursor,
- [POKENAV_MC_FUNC_CANCEL] = CancelMatchCallSelection,
- [POKENAV_MC_FUNC_CALL_MSG] = DoMatchCallMessage,
- [POKENAV_MC_FUNC_NEARBY_MSG] = DoTrainerCloseByMessage,
- [POKENAV_MC_FUNC_10] = sub_81CB888,
- [POKENAV_MC_FUNC_SHOW_CHECK_PAGE] = ShowCheckPage,
- [POKENAV_MC_FUNC_CHECK_PAGE_UP] = ShowCheckPageUp,
- [POKENAV_MC_FUNC_CHECK_PAGE_DOWN] = ShowCheckPageDown,
- [POKENAV_MC_FUNC_EXIT_CHECK_PAGE] = ExitCheckPage,
- [POKENAV_MC_FUNC_EXIT] = ExitMatchCall
+ [POKENAV_MC_FUNC_CANCEL] = CancelMatchCallSelection,
+ [POKENAV_MC_FUNC_CALL_MSG] = DoMatchCallMessage,
+ [POKENAV_MC_FUNC_NEARBY_MSG] = DoTrainerCloseByMessage,
+ [POKENAV_MC_FUNC_10] = sub_81CB888,
+ [POKENAV_MC_FUNC_SHOW_CHECK_PAGE] = ShowCheckPage,
+ [POKENAV_MC_FUNC_CHECK_PAGE_UP] = ShowCheckPageUp,
+ [POKENAV_MC_FUNC_CHECK_PAGE_DOWN] = ShowCheckPageDown,
+ [POKENAV_MC_FUNC_EXIT_CHECK_PAGE] = ExitCheckPage,
+ [POKENAV_MC_FUNC_EXIT] = ExitMatchCall
};
static const struct WindowTemplate sMatchCallLocationWindowTemplate =
@@ -276,11 +275,11 @@ static const struct SpriteTemplate sTrainerPicSpriteTemplate =
bool32 OpenMatchCall(void)
{
- struct Pokenav4Struct *state = AllocSubstruct(6, sizeof(struct Pokenav4Struct));
+ struct Pokenav4Struct *state = AllocSubstruct(POKENAV_SUBSTRUCT_MATCH_CALL_OPEN, sizeof(struct Pokenav4Struct));
if (!state)
return FALSE;
- state->unk19 = 0;
+ state->unused19 = 0;
state->loopTaskId = CreateLoopedTask(LoopedTask_OpenMatchCall, 1);
state->isTaskActiveCB = GetCurrentLoopedTaskActive;
return TRUE;
@@ -288,21 +287,21 @@ bool32 OpenMatchCall(void)
void CreateMatchCallLoopedTask(s32 index)
{
- struct Pokenav4Struct *state = GetSubstructPtr(6);
+ struct Pokenav4Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_OPEN);
state->loopTaskId = CreateLoopedTask(sMatchCallLoopTaskFuncs[index], 1);
state->isTaskActiveCB = GetCurrentLoopedTaskActive;
}
bool32 IsMatchCallLoopedTaskActive(void)
{
- struct Pokenav4Struct *state = GetSubstructPtr(6);
+ struct Pokenav4Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_OPEN);
return state->isTaskActiveCB();
}
void FreeMatchCallSubstruct2(void)
{
- struct Pokenav4Struct *state = GetSubstructPtr(6);
- sub_81CC2B4();
+ struct Pokenav4Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_OPEN);
+ RemoveMatchCallSprites();
sub_81CBC1C();
RemoveWindow(state->infoBoxWindowId);
RemoveWindow(state->locWindowId);
@@ -312,17 +311,17 @@ void FreeMatchCallSubstruct2(void)
static bool32 GetCurrentLoopedTaskActive(void)
{
- struct Pokenav4Struct *state = GetSubstructPtr(6);
+ struct Pokenav4Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_OPEN);
return IsLoopedTaskActive(state->loopTaskId);
}
static u32 LoopedTask_OpenMatchCall(s32 taskState)
{
- struct Pokenav4Struct *state = GetSubstructPtr(6);
+ struct Pokenav4Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_OPEN);
switch (taskState)
{
case 0:
- InitBgTemplates(gUnknown_0862278C, ARRAY_COUNT(gUnknown_0862278C));
+ InitBgTemplates(sMatchCallBgTemplates, ARRAY_COUNT(sMatchCallBgTemplates));
ChangeBgX(2, 0, 0);
ChangeBgY(2, 0, 0);
DecompressAndCopyTileDataToVram(2, sMatchCallUI_Gfx, 0, 0, 0);
@@ -355,7 +354,7 @@ static u32 LoopedTask_OpenMatchCall(s32 taskState)
if (FreeTempTileDataBuffersIfPossible() || !sub_81CAE28())
return LT_PAUSE;
- sub_81CBBB8();
+ InitMatchCallPokenavListMenuTemplate();
return LT_INC_AND_PAUSE;
case 4:
if (sub_81C8224())
@@ -375,11 +374,11 @@ static u32 LoopedTask_OpenMatchCall(s32 taskState)
ShowBg(1);
sub_81CC214();
LoadLeftHeaderGfxForIndex(3);
- sub_81C7FA0(3, 1, 0);
+ ShowLeftHeaderGfx(POKENAV_GFX_MATCH_CALL_MENU, 1, 0);
PokenavFadeScreen(1);
return LT_INC_AND_PAUSE;
case 7:
- if (IsPaletteFadeActive() || sub_81C8010())
+ if (IsPaletteFadeActive() || AreLeftHeaderSpritesMoving())
return LT_PAUSE;
sub_81CBC38(1);
@@ -391,7 +390,7 @@ static u32 LoopedTask_OpenMatchCall(s32 taskState)
u32 MatchCallListCursorDown(s32 taskState)
{
- struct Pokenav4Struct *state = GetSubstructPtr(6);
+ struct Pokenav4Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_OPEN);
switch (taskState)
{
case 0:
@@ -410,7 +409,7 @@ u32 MatchCallListCursorDown(s32 taskState)
}
break;
case 1:
- if (sub_81C8630())
+ if (IsMonListLoopedTaskActive())
return LT_PAUSE;
PrintMatchCallLocation(state, 0);
@@ -428,7 +427,7 @@ u32 MatchCallListCursorDown(s32 taskState)
u32 MatchCallListCursorUp(s32 taskState)
{
- struct Pokenav4Struct *state = GetSubstructPtr(6);
+ struct Pokenav4Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_OPEN);
switch (taskState)
{
case 0:
@@ -447,7 +446,7 @@ u32 MatchCallListCursorUp(s32 taskState)
}
break;
case 1:
- if (sub_81C8630())
+ if (IsMonListLoopedTaskActive())
return LT_PAUSE;
PrintMatchCallLocation(state, 0);
@@ -465,7 +464,7 @@ u32 MatchCallListCursorUp(s32 taskState)
u32 MatchCallListPageDown(s32 taskState)
{
- struct Pokenav4Struct *state = GetSubstructPtr(6);
+ struct Pokenav4Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_OPEN);
switch (taskState)
{
case 0:
@@ -484,7 +483,7 @@ u32 MatchCallListPageDown(s32 taskState)
}
break;
case 1:
- if (sub_81C8630())
+ if (IsMonListLoopedTaskActive())
return LT_PAUSE;
PrintMatchCallLocation(state, 0);
@@ -502,7 +501,7 @@ u32 MatchCallListPageDown(s32 taskState)
u32 MatchCallListPageUp(s32 taskState)
{
- struct Pokenav4Struct *state = GetSubstructPtr(6);
+ struct Pokenav4Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_OPEN);
switch (taskState)
{
case 0:
@@ -521,7 +520,7 @@ u32 MatchCallListPageUp(s32 taskState)
}
break;
case 1:
- if (sub_81C8630())
+ if (IsMonListLoopedTaskActive())
return LT_PAUSE;
PrintMatchCallLocation(state, 0);
@@ -539,7 +538,7 @@ u32 MatchCallListPageUp(s32 taskState)
u32 SelectMatchCallEntry(s32 taskState)
{
- struct Pokenav4Struct *state = GetSubstructPtr(6);
+ struct Pokenav4Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_OPEN);
switch (taskState)
{
case 0:
@@ -562,7 +561,7 @@ u32 MoveMatchCallOptionsCursor(s32 taskState)
u16 cursorPos;
PlaySE(SE_SELECT);
- state = GetSubstructPtr(6);
+ state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_OPEN);
cursorPos = GetMatchCallOptionCursorPos();
UpdateCursorGfxPos(state, cursorPos);
return LT_FINISH;
@@ -570,7 +569,7 @@ u32 MoveMatchCallOptionsCursor(s32 taskState)
u32 CancelMatchCallSelection(s32 taskState)
{
- struct Pokenav4Struct *state = GetSubstructPtr(6);
+ struct Pokenav4Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_OPEN);
switch (taskState)
{
case 0:
@@ -589,7 +588,7 @@ u32 CancelMatchCallSelection(s32 taskState)
u32 DoMatchCallMessage(s32 taskState)
{
- struct Pokenav4Struct *state = GetSubstructPtr(6);
+ struct Pokenav4Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_OPEN);
switch (taskState)
{
case 0:
@@ -621,7 +620,7 @@ u32 DoMatchCallMessage(s32 taskState)
u32 DoTrainerCloseByMessage(s32 taskState)
{
- struct Pokenav4Struct *state = GetSubstructPtr(6);
+ struct Pokenav4Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_OPEN);
switch (taskState)
{
case 0:
@@ -647,7 +646,7 @@ u32 DoTrainerCloseByMessage(s32 taskState)
u32 sub_81CB888(s32 taskState)
{
- struct Pokenav4Struct *state = GetSubstructPtr(6);
+ struct Pokenav4Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_OPEN);
u32 result = LT_INC_AND_PAUSE;
switch (taskState)
@@ -711,7 +710,7 @@ u32 sub_81CB888(s32 taskState)
u32 ShowCheckPage(s32 taskState)
{
- struct Pokenav4Struct *state = GetSubstructPtr(6);
+ struct Pokenav4Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_OPEN);
switch (taskState)
{
case 0:
@@ -720,7 +719,7 @@ u32 ShowCheckPage(s32 taskState)
UpdateWindowsToShowCheckPage(state);
return LT_INC_AND_PAUSE;
case 1:
- if (sub_81C8820() || IsDma3ManagerBusyWithBgCopy1(state))
+ if (IsMatchCallListTaskActive() || IsDma3ManagerBusyWithBgCopy1(state))
return LT_PAUSE;
PrintHelpBarText(HELPBAR_MC_CHECK_PAGE);
@@ -730,7 +729,7 @@ u32 ShowCheckPage(s32 taskState)
LoadCheckPageTrainerPic(state);
return LT_INC_AND_PAUSE;
case 3:
- if (sub_81C8820() || WaitForTrainerPic(state) || WaitForHelpBar())
+ if (IsMatchCallListTaskActive() || WaitForTrainerPic(state) || WaitForHelpBar())
return LT_PAUSE;
break;
}
@@ -742,7 +741,7 @@ u32 ShowCheckPageDown(s32 taskState)
{
int topId;
int delta;
- struct Pokenav4Struct *state = GetSubstructPtr(6);
+ struct Pokenav4Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_OPEN);
switch (taskState)
{
case 0:
@@ -769,7 +768,7 @@ u32 ShowCheckPageDown(s32 taskState)
LoadCheckPageTrainerPic(state);
return LT_INC_AND_PAUSE;
case 4:
- if (sub_81C8820() || WaitForTrainerPic(state))
+ if (IsMatchCallListTaskActive() || WaitForTrainerPic(state))
return LT_PAUSE;
break;
}
@@ -779,7 +778,7 @@ u32 ShowCheckPageDown(s32 taskState)
u32 ExitCheckPage(s32 taskState)
{
- struct Pokenav4Struct *state = GetSubstructPtr(6);
+ struct Pokenav4Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_OPEN);
switch (taskState)
{
case 0:
@@ -788,7 +787,7 @@ u32 ExitCheckPage(s32 taskState)
sub_81C87F0();
return LT_INC_AND_PAUSE;
case 1:
- if (sub_81C8820() || WaitForTrainerPic(state))
+ if (IsMatchCallListTaskActive() || WaitForTrainerPic(state))
return LT_PAUSE;
PrintHelpBarText(HELPBAR_MC_TRAINER_LIST);
@@ -807,7 +806,7 @@ u32 ShowCheckPageUp(s32 taskState)
{
int topId;
int delta;
- struct Pokenav4Struct *state = GetSubstructPtr(6);
+ struct Pokenav4Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_OPEN);
switch (taskState)
{
case 0:
@@ -834,7 +833,7 @@ u32 ShowCheckPageUp(s32 taskState)
LoadCheckPageTrainerPic(state);
return LT_INC_AND_PAUSE;
case 4:
- if (sub_81C8820() || WaitForTrainerPic(state))
+ if (IsMatchCallListTaskActive() || WaitForTrainerPic(state))
return LT_PAUSE;
break;
}
@@ -850,35 +849,35 @@ u32 ExitMatchCall(s32 taskState)
PlaySE(SE_SELECT);
sub_81CBC38(0);
PokenavFadeScreen(0);
- sub_81C78A0();
+ SlideMenuHeaderDown();
return LT_INC_AND_PAUSE;
case 1:
if (IsPaletteFadeActive() || MainMenuLoopedTaskIsBusy())
return LT_PAUSE;
- sub_81C7FDC();
+ SetLeftHeaderSpritesInvisibility();
break;
}
return LT_FINISH;
}
-static void sub_81CBBB8(void)
+static void InitMatchCallPokenavListMenuTemplate(void)
{
struct PokenavListTemplate template;
template.list.matchCallEntries = sub_81CAE94();
- template.unk4 = GetNumberRegistered();
+ template.count = GetNumberRegistered();
template.unk8 = 4;
template.unk6 = 0;
- template.unk9 = 13;
- template.unkA = 16;
- template.unkB = 1;
- template.unkC = 8;
- template.unkD = 3;
- template.unkE = 7;
+ template.item_X = 13;
+ template.windowWidth = 16;
+ template.listTop = 1;
+ template.maxShowed = 8;
+ template.fillValue = 3;
+ template.fontId = 7;
template.listFunc.unk10_2 = BufferMatchCallNameAndDesc;
template.unk14 = TryDrawRematchPokeballIcon;
- sub_81C81D4(&gUnknown_0862278C[2], &template, 2);
+ sub_81C81D4(&sMatchCallBgTemplates[2], &template, 2);
CreateTask(sub_81CBC64, 7);
}
@@ -903,7 +902,7 @@ static void sub_81CBC64(u8 taskId)
taskData[0] += 4;
taskData[0] &= 0x7F;
taskData[1] = gSineTable[taskData[0]] >> 4;
- sub_81C79BC(gUnknown_08622720, gUnknown_08622720 + 0x10, 0x10, 0x10, taskData[1], gPlttBufferUnfaded + 0x50);
+ PokenavCopyPalette(gUnknown_08622720, gUnknown_08622720 + 0x10, 0x10, 0x10, taskData[1], gPlttBufferUnfaded + 0x50);
if (!gPaletteFade.active)
CpuCopy32(gPlttBufferUnfaded + 0x50, gPlttBufferFaded + 0x50, 0x20);
}
@@ -1001,7 +1000,7 @@ static void PrintMatchCallLocation(struct Pokenav4Struct *state, int arg1)
{
u8 mapName[32];
int x;
- int index = GetSelectedMatchCall() + arg1;
+ int index = GetSelectedPokenavListIndex() + arg1;
int mapSec = GetMatchCallMapSec(index);
if (mapSec != MAPSEC_NONE)
GetMapName(mapName, mapSec, 0);
@@ -1118,7 +1117,7 @@ static bool32 WaitForTrainerIsCloseByText(struct Pokenav4Struct *state)
static void PrintMatchCallMessage(struct Pokenav4Struct *state)
{
- int index = GetSelectedMatchCall();
+ int index = GetSelectedPokenavListIndex();
const u8 *str = GetMatchCallMessageText(index, &state->unkF);
u8 speed = GetPlayerTextSpeedDelay();
AddTextPrinterParameterized(state->msgBoxWindowId, 1, str, 32, 1, speed, NULL);
@@ -1152,7 +1151,7 @@ static void sub_81CC214(void)
int i;
u8 paletteNum;
struct SpriteSheet spriteSheet;
- struct Pokenav4Struct *state = GetSubstructPtr(6);
+ struct Pokenav4Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_OPEN);
for (i = 0; i < ARRAY_COUNT(gUnknown_08622810); i++)
LoadCompressedSpriteSheet(&gUnknown_08622810[i]);
@@ -1169,9 +1168,9 @@ static void sub_81CC214(void)
state->trainerPicSprite->invisible = TRUE;
}
-static void sub_81CC2B4(void)
+static void RemoveMatchCallSprites(void)
{
- struct Pokenav4Struct *state = GetSubstructPtr(6);
+ struct Pokenav4Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_OPEN);
if (state->optionsCursorSprite)
DestroySprite(state->optionsCursorSprite);
if (state->trainerPicSprite)
@@ -1222,7 +1221,7 @@ static struct Sprite *CreateTrainerPicSprite(void)
static void LoadCheckPageTrainerPic(struct Pokenav4Struct *state)
{
u16 cursor;
- int trainerPic = GetMatchCallTrainerPic(GetSelectedMatchCall());
+ int trainerPic = GetMatchCallTrainerPic(GetSelectedPokenavListIndex());
if (trainerPic >= 0)
{
DecompressPicFromTable(&gTrainerFrontPicTable[trainerPic], state->unk1828, SPECIES_NONE);
diff --git a/src/pokenav_match_call_ui.c b/src/pokenav_match_call_ui.c
index 01740fcce..2d89f9c39 100644
--- a/src/pokenav_match_call_ui.c
+++ b/src/pokenav_match_call_ui.c
@@ -9,7 +9,7 @@
// TODO: This UI isnt just for match call, seems to be the general pokenav list UI
-struct UnknownSubSubStruct_0203CF40 {
+struct PokenavListMenuWindow {
u8 bg;
u8 unk1;
u8 unk2;
@@ -38,14 +38,14 @@ struct MatchCallWindowState {
struct PokenavSub17Substruct
{
- struct UnknownSubSubStruct_0203CF40 unk0;
+ struct PokenavListMenuWindow listWindow;
u32 unk10;
u32 unk14;
u32 unk18;
void * unk1C;
s32 unk20;
s32 unk24;
- u32 unk28;
+ u32 loopedTaskId;
s32 unk2C;
u32 unk30;
void (*unk34)(struct PokenavMatchCallEntries *, u8*);
@@ -59,34 +59,34 @@ struct PokenavSub17Substruct
// Generally at index 0x11 (17)
struct PokenavSub17
{
- struct PokenavSub17Substruct unk0;
+ struct PokenavSub17Substruct list;
u8 tilemapBuffer[0x800];
struct MatchCallWindowState unk888;
s32 unk89C;
- u32 unk8A0;
+ u32 loopedTaskId;
};
extern void sub_81DB620(u32 windowId, u32 a1, u32 a2, u32 a3, u32 a4);
-void sub_81C82E4(struct PokenavSub17 *a0);
-bool32 sub_81C91AC(struct PokenavSub17Substruct *a0, const struct BgTemplate *a1, struct PokenavListTemplate *a2, s32 a3);
-void sub_81C9160(struct MatchCallWindowState *a0, struct PokenavListTemplate *a1);
+void sub_81C82E4(struct PokenavSub17 *matchCall);
+bool32 CopyPokenavListMenuTemplate(struct PokenavSub17Substruct *a0, const struct BgTemplate *a1, struct PokenavListTemplate *a2, s32 a3);
+void InitMatchCallWindowState(struct MatchCallWindowState *a0, struct PokenavListTemplate *a1);
void SpriteCB_MatchCallUpArrow(struct Sprite *sprite);
void SpriteCB_MatchCallDownArrow(struct Sprite *sprite);
void SpriteCB_MatchCallRightArrow(struct Sprite *sprite);
void ToggleMatchCallArrows(struct PokenavSub17Substruct *a0, u32 a1);
-void sub_81C8FE0(struct PokenavSub17Substruct *a0);
-void sub_81C8EF8(struct MatchCallWindowState *a0, struct PokenavSub17Substruct *a1);
+void DestroyMatchCallListArrows(struct PokenavSub17Substruct *a0);
+void CreateMatchCallArrowSprites(struct MatchCallWindowState *a0, struct PokenavSub17Substruct *a1);
void sub_81C8ED0(void);
static void PrintMatchCallFlavorText(struct MatchCallWindowState *a0, struct PokenavSub17Substruct *a1, u32 a2);
void PrintMatchCallFieldNames(struct PokenavSub17Substruct *a0, u32 a1);
void sub_81C8D4C(struct MatchCallWindowState *a0, struct PokenavSub17Substruct *a1);
void sub_81C8CB4(struct MatchCallWindowState *a0, struct PokenavSub17Substruct *a1);
-void sub_81C8B70(struct UnknownSubSubStruct_0203CF40 *a0, s32 a1, s32 a2);
+void sub_81C8B70(struct PokenavListMenuWindow *a0, s32 a1, s32 a2);
void sub_81C8568(s32 a0, struct PokenavSub17Substruct *a1);
void sub_81C83AC(void * a0, u32 a1, u32 a2, u32 a3, u32 a4, struct PokenavSub17Substruct *a5);
void sub_81C837C(struct MatchCallWindowState *a0, struct PokenavSub17Substruct *a1);
-void sub_81C835C(struct UnknownSubSubStruct_0203CF40 *a0);
+void sub_81C835C(struct PokenavListMenuWindow *a0);
u32 LoopedTask_sub_81C8254(s32 state);
bool32 sub_81C83E0(void);
u32 LoopedTask_sub_81C83F0(s32 state);
@@ -102,12 +102,12 @@ EWRAM_DATA u32 gUnknown_0203CF44 = 0;
bool32 sub_81C81D4(const struct BgTemplate *arg0, struct PokenavListTemplate *arg1, s32 arg2)
{
- struct PokenavSub17 *structPtr = AllocSubstruct(17, sizeof(struct PokenavSub17));
+ struct PokenavSub17 *structPtr = AllocSubstruct(POKENAV_SUBSTRUCT_MATCH_CALL_LIST, sizeof(struct PokenavSub17));
if (structPtr == NULL)
return FALSE;
- sub_81C9160(&structPtr->unk888, arg1);
- if (!sub_81C91AC(&structPtr->unk0, arg0, arg1, arg2))
+ InitMatchCallWindowState(&structPtr->unk888, arg1);
+ if (!CopyPokenavListMenuTemplate(&structPtr->list, arg0, arg1, arg2))
return FALSE;
CreateLoopedTask(LoopedTask_sub_81C8254, 6);
@@ -123,10 +123,10 @@ void sub_81C8234(void)
{
struct PokenavSub17 *structPtr;
- structPtr = GetSubstructPtr(17);
- sub_81C8FE0(&structPtr->unk0);
- RemoveWindow(structPtr->unk0.unk0.windowId);
- FreePokenavSubstruct(17);
+ structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_LIST);
+ DestroyMatchCallListArrows(&structPtr->list);
+ RemoveWindow(structPtr->list.listWindow.windowId);
+ FreePokenavSubstruct(POKENAV_SUBSTRUCT_MATCH_CALL_LIST);
}
u32 LoopedTask_sub_81C8254(s32 state)
@@ -134,9 +134,9 @@ u32 LoopedTask_sub_81C8254(s32 state)
struct PokenavSub17 *structPtr;
if (IsDma3ManagerBusyWithBgCopy())
- return 2;
+ return LT_PAUSE;
- structPtr = GetSubstructPtr(17);
+ structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_LIST);
switch (state)
{
@@ -144,10 +144,10 @@ u32 LoopedTask_sub_81C8254(s32 state)
sub_81C82E4(structPtr);
return LT_INC_AND_PAUSE;
case 1:
- sub_81C835C(&structPtr->unk0.unk0);
+ sub_81C835C(&structPtr->list.listWindow);
return LT_INC_AND_PAUSE;
case 2:
- sub_81C837C(&structPtr->unk888, &structPtr->unk0);
+ sub_81C837C(&structPtr->unk888, &structPtr->list);
return LT_INC_AND_PAUSE;
case 3:
if (sub_81C83E0())
@@ -160,53 +160,53 @@ u32 LoopedTask_sub_81C8254(s32 state)
return LT_INC_AND_CONTINUE;
}
case 4:
- sub_81C8EF8(&structPtr->unk888, &structPtr->unk0);
+ CreateMatchCallArrowSprites(&structPtr->unk888, &structPtr->list);
return LT_FINISH;
default:
return LT_FINISH;
}
}
-void sub_81C82E4(struct PokenavSub17 *a0)
+void sub_81C82E4(struct PokenavSub17 *matchCall)
{
- u16 tileNum = (a0->unk0.unk0.unk1 << 12) | a0->unk0.unk0.unk6;
- sub_8199DF0(a0->unk0.unk0.bg, PIXEL_FILL(1), a0->unk0.unk0.unk6, 1);
- sub_8199DF0(a0->unk0.unk0.bg, PIXEL_FILL(4), a0->unk0.unk0.unk6 + 1, 1);
- SetBgTilemapBuffer(a0->unk0.unk0.bg, a0->tilemapBuffer);
- FillBgTilemapBufferRect_Palette0(a0->unk0.unk0.bg, tileNum, 0, 0, 32, 32);
- ChangeBgY(a0->unk0.unk0.bg, 0, 0);
- ChangeBgX(a0->unk0.unk0.bg, 0, 0);
- ChangeBgY(a0->unk0.unk0.bg, a0->unk0.unk0.unk3 << 11, 2);
- CopyBgTilemapBufferToVram(a0->unk0.unk0.bg);
+ u16 tileNum = (matchCall->list.listWindow.unk1 << 12) | matchCall->list.listWindow.unk6;
+ sub_8199DF0(matchCall->list.listWindow.bg, PIXEL_FILL(1), matchCall->list.listWindow.unk6, 1);
+ sub_8199DF0(matchCall->list.listWindow.bg, PIXEL_FILL(4), matchCall->list.listWindow.unk6 + 1, 1);
+ SetBgTilemapBuffer(matchCall->list.listWindow.bg, matchCall->tilemapBuffer);
+ FillBgTilemapBufferRect_Palette0(matchCall->list.listWindow.bg, tileNum, 0, 0, 32, 32);
+ ChangeBgY(matchCall->list.listWindow.bg, 0, 0);
+ ChangeBgX(matchCall->list.listWindow.bg, 0, 0);
+ ChangeBgY(matchCall->list.listWindow.bg, matchCall->list.listWindow.unk3 << 11, 2);
+ CopyBgTilemapBufferToVram(matchCall->list.listWindow.bg);
}
-void sub_81C835C(struct UnknownSubSubStruct_0203CF40 *a0)
+void sub_81C835C(struct PokenavListMenuWindow *listWindow)
{
- FillWindowPixelBuffer(a0->windowId, PIXEL_FILL(1));
- PutWindowTilemap(a0->windowId);
- CopyWindowToVram(a0->windowId, 1);
+ FillWindowPixelBuffer(listWindow->windowId, PIXEL_FILL(1));
+ PutWindowTilemap(listWindow->windowId);
+ CopyWindowToVram(listWindow->windowId, 1);
}
-void sub_81C837C(struct MatchCallWindowState *a0, struct PokenavSub17Substruct *a1)
+void sub_81C837C(struct MatchCallWindowState *state, struct PokenavSub17Substruct *a1)
{
- s32 arg2 = a0->listLength - a0->windowTopIndex;
- if (arg2 > a0->visibleEntries)
- arg2 = a0->visibleEntries;
+ s32 arg2 = state->listLength - state->windowTopIndex;
+ if (arg2 > state->visibleEntries)
+ arg2 = state->visibleEntries;
- sub_81C83AC(a0->unk10, a0->windowTopIndex, arg2, a0->unkC, 0, a1);
+ sub_81C83AC(state->unk10, state->windowTopIndex, arg2, state->unkC, 0, a1);
}
-void sub_81C83AC(void * a0, u32 a1, u32 a2, u32 a3, u32 a4, struct PokenavSub17Substruct *a5)
+void sub_81C83AC(void * a0, u32 a1, u32 a2, u32 a3, u32 a4, struct PokenavSub17Substruct *list)
{
if (a2 == 0)
return;
- a5->unk1C = a0 + a1 * a3;
- a5->unk18 = a3;
- a5->unk0.unkC = 0;
- a5->unk0.unkE = a2;
- a5->unk14 = a1;
- a5->unk10 = a4;
+ list->unk1C = a0 + a1 * a3;
+ list->unk18 = a3;
+ list->listWindow.unkC = 0;
+ list->listWindow.unkE = a2;
+ list->unk14 = a1;
+ list->unk10 = a4;
CreateLoopedTask(LoopedTask_sub_81C83F0, 5);
}
@@ -218,23 +218,23 @@ bool32 sub_81C83E0(void)
u32 LoopedTask_sub_81C83F0(s32 state)
{
u32 v1;
- struct PokenavSub17Substruct *structPtr = GetSubstructPtr(17);
+ struct PokenavSub17Substruct *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_LIST);
switch (state)
{
case 0:
- v1 = (structPtr->unk0.unkA + structPtr->unk0.unkC + structPtr->unk10) & 0xF;
+ v1 = (structPtr->listWindow.unkA + structPtr->listWindow.unkC + structPtr->unk10) & 0xF;
structPtr->unk34(structPtr->unk1C, structPtr->unkTextBuffer);
if (structPtr->unk38 != NULL)
- structPtr->unk38(structPtr->unk0.windowId, structPtr->unk14, v1);
+ structPtr->unk38(structPtr->listWindow.windowId, structPtr->unk14, v1);
- AddTextPrinterParameterized(structPtr->unk0.windowId, structPtr->unk0.fontId, structPtr->unkTextBuffer, 8, (v1 << 4) + 1, 255, NULL);
- if (++structPtr->unk0.unkC >= structPtr->unk0.unkE)
+ AddTextPrinterParameterized(structPtr->listWindow.windowId, structPtr->listWindow.fontId, structPtr->unkTextBuffer, 8, (v1 << 4) + 1, 255, NULL);
+ if (++structPtr->listWindow.unkC >= structPtr->listWindow.unkE)
{
if (structPtr->unk38 != NULL)
- CopyWindowToVram(structPtr->unk0.windowId, 3);
+ CopyWindowToVram(structPtr->listWindow.windowId, 3);
else
- CopyWindowToVram(structPtr->unk0.windowId, 2);
+ CopyWindowToVram(structPtr->listWindow.windowId, 2);
return LT_INC_AND_PAUSE;
}
else
@@ -253,14 +253,14 @@ u32 LoopedTask_sub_81C83F0(s32 state)
bool32 ShouldShowUpArrow(void)
{
- struct PokenavSub17 *structPtr = GetSubstructPtr(17);
+ struct PokenavSub17 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_LIST);
return (structPtr->unk888.windowTopIndex != 0);
}
bool32 ShouldShowDownArrow(void)
{
- struct PokenavSub17 *structPtr = GetSubstructPtr(17);
+ struct PokenavSub17 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_LIST);
struct MatchCallWindowState *subPtr = &structPtr->unk888;
return (subPtr->windowTopIndex + subPtr->visibleEntries < subPtr->listLength);
@@ -268,7 +268,7 @@ bool32 ShouldShowDownArrow(void)
void MatchCall_MoveWindow(s32 a0, bool32 a1)
{
- struct PokenavSub17 *structPtr = GetSubstructPtr(17);
+ struct PokenavSub17 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_LIST);
struct MatchCallWindowState *subPtr = &structPtr->unk888;
if (a0 < 0)
@@ -276,7 +276,7 @@ void MatchCall_MoveWindow(s32 a0, bool32 a1)
if (subPtr->windowTopIndex + a0 < 0)
a0 = -1 * subPtr->windowTopIndex;
if (a1)
- sub_81C83AC(subPtr->unk10, subPtr->windowTopIndex + a0, a0 * -1, subPtr->unkC, a0, &structPtr->unk0);
+ sub_81C83AC(subPtr->unk10, subPtr->windowTopIndex + a0, a0 * -1, subPtr->unkC, a0, &structPtr->list);
}
else if (a1)
{
@@ -284,31 +284,31 @@ void MatchCall_MoveWindow(s32 a0, bool32 a1)
if (temp + a0 >= subPtr->listLength)
a0 = subPtr->listLength - temp;
- sub_81C83AC(subPtr->unk10, gUnknown_0203CF44, a0, subPtr->unkC, subPtr->visibleEntries, &structPtr->unk0);
+ sub_81C83AC(subPtr->unk10, gUnknown_0203CF44, a0, subPtr->unkC, subPtr->visibleEntries, &structPtr->list);
}
- sub_81C8568(a0, &structPtr->unk0);
+ sub_81C8568(a0, &structPtr->list);
subPtr->windowTopIndex += a0;
}
-void sub_81C8568(s32 a0, struct PokenavSub17Substruct *a1)
+void sub_81C8568(s32 a0, struct PokenavSub17Substruct *list)
{
- a1->unk20 = GetBgY(a1->unk0.bg);
- a1->unk24 = a1->unk20 + (a0 << 12);
+ list->unk20 = GetBgY(list->listWindow.bg);
+ list->unk24 = list->unk20 + (a0 << 12);
if (a0 > 0)
- a1->unk30 = 1;
+ list->unk30 = 1;
else
- a1->unk30 = 2;
- a1->unk2C = a0;
- a1->unk28 = CreateLoopedTask(LoopedTask_sub_81C85A0, 6);
+ list->unk30 = 2;
+ list->unk2C = a0;
+ list->loopedTaskId = CreateLoopedTask(LoopedTask_sub_81C85A0, 6);
}
u32 LoopedTask_sub_81C85A0(s32 state)
{
s32 y, v1;
bool32 flag;
- struct PokenavSub17 *structPtr = GetSubstructPtr(17);
- struct PokenavSub17Substruct *subPtr = &structPtr->unk0;
+ struct PokenavSub17 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_LIST);
+ struct PokenavSub17Substruct *subPtr = &structPtr->list;
switch (state)
{
@@ -318,8 +318,8 @@ u32 LoopedTask_sub_81C85A0(s32 state)
return LT_PAUSE;
case 1:
flag = FALSE;
- y = GetBgY(subPtr->unk0.bg);
- v1 = ChangeBgY(subPtr->unk0.bg, 0x1000, subPtr->unk30);
+ y = GetBgY(subPtr->listWindow.bg);
+ v1 = ChangeBgY(subPtr->listWindow.bg, 0x1000, subPtr->unk30);
if (subPtr->unk30 == 2)
{
if ((y > subPtr->unk24 || y <= subPtr->unk20) && v1 <= subPtr->unk24)
@@ -333,8 +333,8 @@ u32 LoopedTask_sub_81C85A0(s32 state)
if (flag)
{
- subPtr->unk0.unkA = (subPtr->unk0.unkA + subPtr->unk2C) & 0xF;
- ChangeBgY(subPtr->unk0.bg, subPtr->unk24, 0);
+ subPtr->listWindow.unkA = (subPtr->listWindow.unkA + subPtr->unk2C) & 0xF;
+ ChangeBgY(subPtr->listWindow.bg, subPtr->unk24, 0);
return LT_FINISH;
}
return LT_PAUSE;
@@ -342,15 +342,15 @@ u32 LoopedTask_sub_81C85A0(s32 state)
return LT_FINISH;
}
-bool32 sub_81C8630(void)
+bool32 IsMonListLoopedTaskActive(void)
{
- struct PokenavSub17 *structPtr = GetSubstructPtr(17);
- return IsLoopedTaskActive(structPtr->unk0.unk28);
+ struct PokenavSub17 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_LIST);
+ return IsLoopedTaskActive(structPtr->list.loopedTaskId);
}
struct MatchCallWindowState *GetMatchCallWindowStruct(void)
{
- struct PokenavSub17 *structPtr = GetSubstructPtr(17);
+ struct PokenavSub17 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_LIST);
return &structPtr->unk888;
}
@@ -448,7 +448,7 @@ int MatchCall_PageDown(void)
}
}
-u32 GetSelectedMatchCall(void)
+u32 GetSelectedPokenavListIndex(void)
{
struct MatchCallWindowState *structPtr = GetMatchCallWindowStruct();
@@ -464,53 +464,53 @@ u32 GetMatchCallListTopIndex(void)
void sub_81C877C(void)
{
- struct PokenavSub17 *structPtr = GetSubstructPtr(17);
+ struct PokenavSub17 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_LIST);
structPtr->unk89C = 0;
- structPtr->unk8A0 = CreateLoopedTask(LoopedTask_sub_81C8870, 6);
+ structPtr->loopedTaskId = CreateLoopedTask(LoopedTask_sub_81C8870, 6);
}
void PrintCheckPageInfo(s16 a0)
{
- struct PokenavSub17 *structPtr = GetSubstructPtr(17);
+ struct PokenavSub17 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_LIST);
structPtr->unk888.windowTopIndex += a0;
structPtr->unk89C = 0;
- structPtr->unk8A0 = CreateLoopedTask(LoopedTask_PrintCheckPageInfo, 6);
+ structPtr->loopedTaskId = CreateLoopedTask(LoopedTask_PrintCheckPageInfo, 6);
}
void sub_81C87F0(void)
{
- struct PokenavSub17 *structPtr = GetSubstructPtr(17);
+ struct PokenavSub17 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_LIST);
structPtr->unk89C = 0;
- structPtr->unk8A0 = CreateLoopedTask(LoopedTask_sub_81C8A28, 6);
+ structPtr->loopedTaskId = CreateLoopedTask(LoopedTask_sub_81C8A28, 6);
}
-bool32 sub_81C8820(void)
+bool32 IsMatchCallListTaskActive(void)
{
- struct PokenavSub17 *structPtr = GetSubstructPtr(17);
- return IsLoopedTaskActive(structPtr->unk8A0);
+ struct PokenavSub17 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_LIST);
+ return IsLoopedTaskActive(structPtr->loopedTaskId);
}
void sub_81C8838(void)
{
- struct PokenavSub17 *structPtr = GetSubstructPtr(17);
+ struct PokenavSub17 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_LIST);
struct MatchCallWindowState *subPtr = &structPtr->unk888;
- structPtr->unk0.unk38(structPtr->unk0.unk0.windowId, subPtr->windowTopIndex + subPtr->selectedIndexOffset, (structPtr->unk0.unk0.unkA + subPtr->selectedIndexOffset) & 0xF);
- CopyWindowToVram(structPtr->unk0.unk0.windowId, 1);
+ structPtr->list.unk38(structPtr->list.listWindow.windowId, subPtr->windowTopIndex + subPtr->selectedIndexOffset, (structPtr->list.listWindow.unkA + subPtr->selectedIndexOffset) & 0xF);
+ CopyWindowToVram(structPtr->list.listWindow.windowId, 1);
}
// TODO:
u32 LoopedTask_sub_81C8870(s32 state)
{
- struct PokenavSub17 *structPtr = GetSubstructPtr(17);
+ struct PokenavSub17 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_LIST);
switch (state)
{
case 0:
- ToggleMatchCallArrows(&structPtr->unk0, 1);
+ ToggleMatchCallArrows(&structPtr->list, 1);
// fall-through
case 1:
if (structPtr->unk89C != structPtr->unk888.selectedIndexOffset)
- sub_81C8B70(&structPtr->unk0.unk0, structPtr->unk89C, 1);
+ sub_81C8B70(&structPtr->list.listWindow, structPtr->unk89C, 1);
structPtr->unk89C++;
return LT_INC_AND_PAUSE;
@@ -520,7 +520,7 @@ u32 LoopedTask_sub_81C8870(s32 state)
if (structPtr->unk89C != structPtr->unk888.visibleEntries)
return 6;
if (structPtr->unk888.selectedIndexOffset != 0)
- sub_81C8B70(&structPtr->unk0.unk0, structPtr->unk89C, structPtr->unk888.selectedIndexOffset);
+ sub_81C8B70(&structPtr->list.listWindow, structPtr->unk89C, structPtr->unk888.selectedIndexOffset);
return LT_INC_AND_PAUSE;
}
@@ -537,7 +537,7 @@ u32 LoopedTask_sub_81C8870(s32 state)
}
return LT_PAUSE;
case 4:
- if (sub_81C8630())
+ if (IsMonListLoopedTaskActive())
return LT_PAUSE;
structPtr->unk888.selectedIndexOffset = 0;
@@ -548,35 +548,35 @@ u32 LoopedTask_sub_81C8870(s32 state)
u32 LoopedTask_PrintCheckPageInfo(s32 state)
{
- struct PokenavSub17 *structPtr = GetSubstructPtr(17);
+ struct PokenavSub17 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_LIST);
if (IsDma3ManagerBusyWithBgCopy())
return LT_PAUSE;
switch (state)
{
case 0:
- sub_81C8CB4(&structPtr->unk888, &structPtr->unk0);
+ sub_81C8CB4(&structPtr->unk888, &structPtr->list);
break;
case 1:
- PrintMatchCallFieldNames(&structPtr->unk0, 0);
+ PrintMatchCallFieldNames(&structPtr->list, 0);
break;
case 2:
- PrintMatchCallFlavorText(&structPtr->unk888, &structPtr->unk0, CHECK_PAGE_STRATEGY);
+ PrintMatchCallFlavorText(&structPtr->unk888, &structPtr->list, CHECK_PAGE_STRATEGY);
break;
case 3:
- PrintMatchCallFieldNames(&structPtr->unk0, 1);
+ PrintMatchCallFieldNames(&structPtr->list, 1);
break;
case 4:
- PrintMatchCallFlavorText(&structPtr->unk888, &structPtr->unk0, CHECK_PAGE_POKEMON);
+ PrintMatchCallFlavorText(&structPtr->unk888, &structPtr->list, CHECK_PAGE_POKEMON);
break;
case 5:
- PrintMatchCallFieldNames(&structPtr->unk0, 2);
+ PrintMatchCallFieldNames(&structPtr->list, 2);
break;
case 6:
- PrintMatchCallFlavorText(&structPtr->unk888, &structPtr->unk0, CHECK_PAGE_INTRO_1);
+ PrintMatchCallFlavorText(&structPtr->unk888, &structPtr->list, CHECK_PAGE_INTRO_1);
break;
case 7:
- PrintMatchCallFlavorText(&structPtr->unk888, &structPtr->unk0, CHECK_PAGE_INTRO_2);
+ PrintMatchCallFlavorText(&structPtr->unk888, &structPtr->list, CHECK_PAGE_INTRO_2);
break;
default:
return LT_FINISH;
@@ -594,9 +594,9 @@ u32 LoopedTask_sub_81C8A28(s32 state)
if (IsDma3ManagerBusyWithBgCopy())
return LT_PAUSE;
- structPtr = GetSubstructPtr(17);
+ structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_LIST);
subPtr888 = &structPtr->unk888;
- subPtr0 = &structPtr->unk0;
+ subPtr0 = &structPtr->list;
switch (state)
{
@@ -607,7 +607,7 @@ u32 LoopedTask_sub_81C8A28(s32 state)
ptr = &structPtr->unk89C;
if (++(*ptr) < structPtr->unk888.visibleEntries)
{
- sub_81C8B70(&subPtr0->unk0, *ptr, 1);
+ sub_81C8B70(&subPtr0->listWindow, *ptr, 1);
return LT_PAUSE;
}
@@ -618,7 +618,7 @@ u32 LoopedTask_sub_81C8A28(s32 state)
{
s32 r4 = subPtr888->windowTopIndex;
r5 = -r4;
- sub_81C8B70(&subPtr0->unk0, r5, r4);
+ sub_81C8B70(&subPtr0->listWindow, r5, r4);
subPtr888->selectedIndexOffset = r4;
*ptr = r5;
return LT_INC_AND_PAUSE;
@@ -630,7 +630,7 @@ u32 LoopedTask_sub_81C8A28(s32 state)
{
s32 r4 = subPtr888->windowTopIndex + subPtr888->visibleEntries - subPtr888->listLength;
r5 = -r4;
- sub_81C8B70(&subPtr0->unk0, r5, r4);
+ sub_81C8B70(&subPtr0->listWindow, r5, r4);
subPtr888->selectedIndexOffset = r4;
*ptr = r5;
return LT_INC_AND_PAUSE;
@@ -641,14 +641,14 @@ u32 LoopedTask_sub_81C8A28(s32 state)
MatchCall_MoveWindow(structPtr->unk89C, FALSE);
return LT_INC_AND_PAUSE;
case 3:
- if (!sub_81C8630())
+ if (!IsMonListLoopedTaskActive())
{
structPtr->unk89C = 0;
return 1;
}
return 2;
case 4:
- sub_81C83AC(subPtr888->unk10, subPtr888->windowTopIndex + structPtr->unk89C, 1, subPtr888->unkC, structPtr->unk89C, &structPtr->unk0);
+ sub_81C83AC(subPtr888->unk10, subPtr888->windowTopIndex + structPtr->unk89C, 1, subPtr888->unkC, structPtr->unk89C, &structPtr->list);
return LT_INC_AND_PAUSE;
case 5:
if (sub_81C83E0())
@@ -664,16 +664,16 @@ u32 LoopedTask_sub_81C8A28(s32 state)
return LT_FINISH;
}
-void sub_81C8B70(struct UnknownSubSubStruct_0203CF40 *a0, s32 a1, s32 a2)
+void sub_81C8B70(struct PokenavListMenuWindow *listWindow, s32 a1, s32 a2)
{
- u8 *v1 = (u8*)GetWindowAttribute(a0->windowId, WINDOW_TILE_DATA);
- u32 v2 = a0->unk4 * 64;
+ u8 *v1 = (u8*)GetWindowAttribute(listWindow->windowId, WINDOW_TILE_DATA);
+ u32 v2 = listWindow->unk4 * 64;
- a1 = (a0->unkA + a1) & 0xF;
+ a1 = (listWindow->unkA + a1) & 0xF;
if (a1 + a2 <= 16)
{
CpuFastFill8(PIXEL_FILL(1), v1 + a1 * v2, a2 * v2);
- CopyWindowToVram(a0->windowId, 2);
+ CopyWindowToVram(listWindow->windowId, 2);
}
else
{
@@ -682,63 +682,63 @@ void sub_81C8B70(struct UnknownSubSubStruct_0203CF40 *a0, s32 a1, s32 a2)
CpuFastFill8(PIXEL_FILL(1), v1 + a1 * v2, v3 * v2);
CpuFastFill8(PIXEL_FILL(1), v1, v4 * v2);
- CopyWindowToVram(a0->windowId, 2);
+ CopyWindowToVram(listWindow->windowId, 2);
}
for (a2--; a2 != -1; a1 = (a1 + 1) & 0xF, a2--)
- ClearRematchPokeballIcon(a0->windowId, a1);
+ ClearRematchPokeballIcon(listWindow->windowId, a1);
- CopyWindowToVram(a0->windowId, 1);
+ CopyWindowToVram(listWindow->windowId, 1);
}
-void sub_81C8C64(struct UnknownSubSubStruct_0203CF40 *a0, u32 a1)
+void sub_81C8C64(struct PokenavListMenuWindow *listWindow, u32 a1)
{
u16 var;
- u16 *v1 = (u16*)GetBgTilemapBuffer(GetWindowAttribute(a0->windowId, WINDOW_BG));
- v1 += ((a0->unkA << 6) + a0->unk2) - 1;
+ u16 *v1 = (u16*)GetBgTilemapBuffer(GetWindowAttribute(listWindow->windowId, WINDOW_BG));
+ v1 += ((listWindow->unkA << 6) + listWindow->unk2) - 1;
if (a1 != 0)
- var = (a0->unk1 << 12) | (a0->unk6 + 1);
+ var = (listWindow->unk1 << 12) | (listWindow->unk6 + 1);
else
- var = (a0->unk1 << 12) | (a0->unk6);
+ var = (listWindow->unk1 << 12) | (listWindow->unk6);
v1[0] = var;
v1[0x20] = var;
}
-void sub_81C8CB4(struct MatchCallWindowState *a0, struct PokenavSub17Substruct *a1)
+void sub_81C8CB4(struct MatchCallWindowState *state, struct PokenavSub17Substruct *list)
{
u8 colors[3] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GREY, TEXT_COLOR_LIGHT_RED};
- a1->unk34(a0->unk10 + a0->unkC * a0->windowTopIndex, a1->unkTextBuffer);
- a1->unk38(a1->unk0.windowId, a0->windowTopIndex, a1->unk0.unkA);
- FillWindowPixelRect(a1->unk0.windowId, PIXEL_FILL(4), 0, a1->unk0.unkA * 16, a1->unk0.unk4 * 8, 16);
- AddTextPrinterParameterized3(a1->unk0.windowId, a1->unk0.fontId, 8, (a1->unk0.unkA * 16) + 1, colors, TEXT_SPEED_FF, a1->unkTextBuffer);
- sub_81C8C64(&a1->unk0, 1);
- CopyWindowRectToVram(a1->unk0.windowId, 3, 0, a1->unk0.unkA * 2, a1->unk0.unk4, 2);
+ list->unk34(state->unk10 + state->unkC * state->windowTopIndex, list->unkTextBuffer);
+ list->unk38(list->listWindow.windowId, state->windowTopIndex, list->listWindow.unkA);
+ FillWindowPixelRect(list->listWindow.windowId, PIXEL_FILL(4), 0, list->listWindow.unkA * 16, list->listWindow.unk4 * 8, 16);
+ AddTextPrinterParameterized3(list->listWindow.windowId, list->listWindow.fontId, 8, (list->listWindow.unkA * 16) + 1, colors, TEXT_SPEED_FF, list->unkTextBuffer);
+ sub_81C8C64(&list->listWindow, 1);
+ CopyWindowRectToVram(list->listWindow.windowId, 3, 0, list->listWindow.unkA * 2, list->listWindow.unk4, 2);
}
-void sub_81C8D4C(struct MatchCallWindowState *a0, struct PokenavSub17Substruct *a1)
+void sub_81C8D4C(struct MatchCallWindowState *state, struct PokenavSub17Substruct *list)
{
- a1->unk34(a0->unk10 + a0->unkC * a0->windowTopIndex, a1->unkTextBuffer);
- FillWindowPixelRect(a1->unk0.windowId, PIXEL_FILL(1), 0, a1->unk0.unkA * 16, a1->unk0.unk4 * 8, 16);
- AddTextPrinterParameterized(a1->unk0.windowId, a1->unk0.fontId, a1->unkTextBuffer, 8, a1->unk0.unkA * 16 + 1, TEXT_SPEED_FF, NULL);
- sub_81C8C64(&a1->unk0, 0);
- CopyWindowToVram(a1->unk0.windowId, 3);
+ list->unk34(state->unk10 + state->unkC * state->windowTopIndex, list->unkTextBuffer);
+ FillWindowPixelRect(list->listWindow.windowId, PIXEL_FILL(1), 0, list->listWindow.unkA * 16, list->listWindow.unk4 * 8, 16);
+ AddTextPrinterParameterized(list->listWindow.windowId, list->listWindow.fontId, list->unkTextBuffer, 8, list->listWindow.unkA * 16 + 1, TEXT_SPEED_FF, NULL);
+ sub_81C8C64(&list->listWindow, 0);
+ CopyWindowToVram(list->listWindow.windowId, 3);
}
-void PrintMatchCallFieldNames(struct PokenavSub17Substruct *a0, u32 fieldId)
+void PrintMatchCallFieldNames(struct PokenavSub17Substruct *list, u32 fieldId)
{
const u8 *fieldNames[] = {gText_PokenavMatchCall_Strategy, gText_PokenavMatchCall_TrainerPokemon, gText_PokenavMatchCall_SelfIntroduction};
u8 colors[3] = {TEXT_COLOR_WHITE, TEXT_COLOR_RED, TEXT_COLOR_LIGHT_RED};
- u32 top = (a0->unk0.unkA + 1 + (fieldId * 2)) & 0xF;
+ u32 top = (list->listWindow.unkA + 1 + (fieldId * 2)) & 0xF;
- FillWindowPixelRect(a0->unk0.windowId, PIXEL_FILL(1), 0, top << 4, a0->unk0.unk4, 16);
- AddTextPrinterParameterized3(a0->unk0.windowId, 7, 2, (top << 4) + 1, colors, -1, fieldNames[fieldId]);
- CopyWindowRectToVram(a0->unk0.windowId, 2, 0, top << 1, a0->unk0.unk4, 2);
+ FillWindowPixelRect(list->listWindow.windowId, PIXEL_FILL(1), 0, top << 4, list->listWindow.unk4, 16);
+ AddTextPrinterParameterized3(list->listWindow.windowId, 7, 2, (top << 4) + 1, colors, -1, fieldNames[fieldId]);
+ CopyWindowRectToVram(list->listWindow.windowId, 2, 0, top << 1, list->listWindow.unk4, 2);
}
-static void PrintMatchCallFlavorText(struct MatchCallWindowState *a0, struct PokenavSub17Substruct *a1, u32 checkPageEntry)
+static void PrintMatchCallFlavorText(struct MatchCallWindowState *a0, struct PokenavSub17Substruct *list, u32 checkPageEntry)
{
// lines 1, 3, and 5 are the field names printed by PrintMatchCallFieldNames
static const u8 lineOffsets[CHECK_PAGE_ENTRY_COUNT] =
@@ -749,14 +749,14 @@ static void PrintMatchCallFlavorText(struct MatchCallWindowState *a0, struct Pok
[CHECK_PAGE_INTRO_2] = 7
};
- u32 r6 = (a1->unk0.unkA + lineOffsets[checkPageEntry]) & 0xF;
+ u32 r6 = (list->listWindow.unkA + lineOffsets[checkPageEntry]) & 0xF;
const u8 *str = GetMatchCallFlavorText(a0->windowTopIndex, checkPageEntry);
if (str != NULL)
{
- sub_81DB620(a1->unk0.windowId, 1, r6 * 2, a1->unk0.unk4 - 1, 2);
- AddTextPrinterParameterized(a1->unk0.windowId, 7, str, 2, (r6 << 4) + 1, TEXT_SPEED_FF, NULL);
- CopyWindowRectToVram(a1->unk0.windowId, 2, 0, r6 * 2, a1->unk0.unk4, 2);
+ sub_81DB620(list->listWindow.windowId, 1, r6 * 2, list->listWindow.unk4 - 1, 2);
+ AddTextPrinterParameterized(list->listWindow.windowId, 7, str, 2, (r6 << 4) + 1, TEXT_SPEED_FF, NULL);
+ CopyWindowRectToVram(list->listWindow.windowId, 2, 0, r6 * 2, list->listWindow.unk4, 2);
}
}
@@ -839,57 +839,57 @@ void sub_81C8ED0(void)
Pokenav_AllocAndLoadPalettes(sMatchcallArrowPalettes);
}
-void sub_81C8EF8(struct MatchCallWindowState *a0, struct PokenavSub17Substruct *a1)
+void CreateMatchCallArrowSprites(struct MatchCallWindowState *windowState, struct PokenavSub17Substruct *list)
{
u32 spriteId;
s16 x;
- spriteId = CreateSprite(&sMatchCallRightArrowSprite, a1->unk0.unk2 * 8 + 3, (a1->unk0.unk3 + 1) * 8, 7);
- a1->rightArrow = &gSprites[spriteId];
+ spriteId = CreateSprite(&sMatchCallRightArrowSprite, list->listWindow.unk2 * 8 + 3, (list->listWindow.unk3 + 1) * 8, 7);
+ list->rightArrow = &gSprites[spriteId];
- x = a1->unk0.unk2 * 8 + (a1->unk0.unk4 - 1) * 4;
- spriteId = CreateSprite(&sMatchCallUpDownArrowSprite, x, a1->unk0.unk3 * 8 + a0->visibleEntries * 16, 7);
- a1->downArrow = &gSprites[spriteId];
- a1->downArrow->oam.tileNum += 2;
- a1->downArrow->callback = SpriteCB_MatchCallDownArrow;
+ x = list->listWindow.unk2 * 8 + (list->listWindow.unk4 - 1) * 4;
+ spriteId = CreateSprite(&sMatchCallUpDownArrowSprite, x, list->listWindow.unk3 * 8 + windowState->visibleEntries * 16, 7);
+ list->downArrow = &gSprites[spriteId];
+ list->downArrow->oam.tileNum += 2;
+ list->downArrow->callback = SpriteCB_MatchCallDownArrow;
- spriteId = CreateSprite(&sMatchCallUpDownArrowSprite, x, a1->unk0.unk3 * 8, 7);
- a1->upArrow = &gSprites[spriteId];
- a1->upArrow->oam.tileNum += 4;
- a1->upArrow->callback = SpriteCB_MatchCallUpArrow;
+ spriteId = CreateSprite(&sMatchCallUpDownArrowSprite, x, list->listWindow.unk3 * 8, 7);
+ list->upArrow = &gSprites[spriteId];
+ list->upArrow->oam.tileNum += 4;
+ list->upArrow->callback = SpriteCB_MatchCallUpArrow;
}
-void sub_81C8FE0(struct PokenavSub17Substruct *a0)
+void DestroyMatchCallListArrows(struct PokenavSub17Substruct *list)
{
- DestroySprite(a0->rightArrow);
- DestroySprite(a0->upArrow);
- DestroySprite(a0->downArrow);
+ DestroySprite(list->rightArrow);
+ DestroySprite(list->upArrow);
+ DestroySprite(list->downArrow);
FreeSpriteTilesByTag(0xA);
FreeSpritePaletteByTag(0x14);
}
-void ToggleMatchCallArrows(struct PokenavSub17Substruct *a0, bool32 shouldHide)
+void ToggleMatchCallArrows(struct PokenavSub17Substruct *list, bool32 shouldHide)
{
if (shouldHide)
{
- a0->rightArrow->callback = SpriteCallbackDummy;
- a0->upArrow->callback = SpriteCallbackDummy;
- a0->downArrow->callback = SpriteCallbackDummy;
+ list->rightArrow->callback = SpriteCallbackDummy;
+ list->upArrow->callback = SpriteCallbackDummy;
+ list->downArrow->callback = SpriteCallbackDummy;
}
else
{
- a0->rightArrow->callback = SpriteCB_MatchCallRightArrow;
- a0->upArrow->callback = SpriteCB_MatchCallUpArrow;
- a0->downArrow->callback = SpriteCB_MatchCallDownArrow;
+ list->rightArrow->callback = SpriteCB_MatchCallRightArrow;
+ list->upArrow->callback = SpriteCB_MatchCallUpArrow;
+ list->downArrow->callback = SpriteCB_MatchCallDownArrow;
}
- a0->rightArrow->invisible = shouldHide;
- a0->upArrow->invisible = shouldHide;
- a0->downArrow->invisible = shouldHide;
+ list->rightArrow->invisible = shouldHide;
+ list->upArrow->invisible = shouldHide;
+ list->downArrow->invisible = shouldHide;
}
void SpriteCB_MatchCallRightArrow(struct Sprite *sprite)
{
- struct PokenavSub17 *structPtr = GetSubstructPtr(17);
+ struct PokenavSub17 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_LIST);
sprite->pos2.y = structPtr->unk888.selectedIndexOffset << 4;
}
@@ -931,68 +931,68 @@ void SpriteCB_MatchCallUpArrow(struct Sprite *sprite)
void ToggleMatchCallVerticalArrows(bool32 shouldHide)
{
- struct PokenavSub17 *structPtr = GetSubstructPtr(17);
- structPtr->unk0.upArrow->data[7] = shouldHide;
- structPtr->unk0.downArrow->data[7] = shouldHide;
+ struct PokenavSub17 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_LIST);
+ structPtr->list.upArrow->data[7] = shouldHide;
+ structPtr->list.downArrow->data[7] = shouldHide;
}
-void sub_81C9160(struct MatchCallWindowState *a0, struct PokenavListTemplate *a1)
+void InitMatchCallWindowState(struct MatchCallWindowState *dst, struct PokenavListTemplate *template)
{
- a0->unk10 = a1->list.matchCallEntries;
- a0->windowTopIndex = a1->unk6;
- a0->listLength = a1->unk4;
- a0->unkC = a1->unk8;
- a0->visibleEntries = a1->unkC;
- if (a0->visibleEntries >= a0->listLength)
+ dst->unk10 = template->list.matchCallEntries;
+ dst->windowTopIndex = template->unk6;
+ dst->listLength = template->count;
+ dst->unkC = template->unk8;
+ dst->visibleEntries = template->maxShowed;
+ if (dst->visibleEntries >= dst->listLength)
{
- a0->windowTopIndex = 0;
- a0->unk4 = 0;
- a0->selectedIndexOffset = a1->unk6;
+ dst->windowTopIndex = 0;
+ dst->unk4 = 0;
+ dst->selectedIndexOffset = template->unk6;
}
else
{
- a0->unk4 = a0->listLength - a0->visibleEntries;
- if (a0->windowTopIndex + a0->visibleEntries > a0->listLength)
+ dst->unk4 = dst->listLength - dst->visibleEntries;
+ if (dst->windowTopIndex + dst->visibleEntries > dst->listLength)
{
- a0->selectedIndexOffset = a0->windowTopIndex + a0->visibleEntries - a0->listLength;
- a0->windowTopIndex = a1->unk6 - a0->selectedIndexOffset;
+ dst->selectedIndexOffset = dst->windowTopIndex + dst->visibleEntries - dst->listLength;
+ dst->windowTopIndex = template->unk6 - dst->selectedIndexOffset;
}
else
{
- a0->selectedIndexOffset = 0;
+ dst->selectedIndexOffset = 0;
}
}
}
-bool32 sub_81C91AC(struct PokenavSub17Substruct *a0, const struct BgTemplate *a1, struct PokenavListTemplate *a2, s32 a3)
+bool32 CopyPokenavListMenuTemplate(struct PokenavSub17Substruct *dest, const struct BgTemplate *bgTemplate, struct PokenavListTemplate *template, s32 a3)
{
struct WindowTemplate window;
- a0->unk0.bg = a1->bg;
- a0->unk0.unk6 = a3;
- a0->unk34 = a2->listFunc.unk10_2;
- a0->unk38 = a2->unk14;
- a0->unk0.unk1 = a2->unkD;
- a0->unk0.unk2 = a2->unk9;
- a0->unk0.unk3 = a2->unkB;
- a0->unk0.unk4 = a2->unkA;
- a0->unk0.fontId = a2->unkE;
-
- window.bg = a1->bg;
- window.tilemapLeft = a2->unk9;
+ dest->listWindow.bg = bgTemplate->bg;
+ dest->listWindow.unk6 = a3;
+ dest->unk34 = template->listFunc.unk10_2;
+ dest->unk38 = template->unk14;
+ dest->listWindow.unk1 = template->fillValue;
+ dest->listWindow.unk2 = template->item_X;
+ dest->listWindow.unk3 = template->listTop;
+ dest->listWindow.unk4 = template->windowWidth;
+ dest->listWindow.fontId = template->fontId;
+
+ window.bg = bgTemplate->bg;
+ window.tilemapLeft = template->item_X;
window.tilemapTop = 0;
- window.width = a2->unkA;
+ window.width = template->windowWidth;
window.height = 32;
- window.paletteNum = a2->unkD;
+ window.paletteNum = template->fillValue;
window.baseBlock = a3 + 2;
- a0->unk0.windowId = AddWindow(&window);
- if (a0->unk0.windowId == 0xFF)
+ dest->listWindow.windowId = AddWindow(&window);
+ if (dest->listWindow.windowId == 0xFF)
return FALSE;
- a0->unk0.unkA = 0;
- a0->rightArrow = NULL;
- a0->upArrow = NULL;
- a0->downArrow = NULL;
+ dest->listWindow.unkA = 0;
+ dest->rightArrow = NULL;
+ dest->upArrow = NULL;
+ dest->downArrow = NULL;
return 1;
}
diff --git a/src/pokenav_menu_handler_1.c b/src/pokenav_menu_handler_1.c
index d8d8e1509..35e7a84f9 100644
--- a/src/pokenav_menu_handler_1.c
+++ b/src/pokenav_menu_handler_1.c
@@ -32,53 +32,53 @@ static u32 (*GetMainMenuInputHandler(void))(struct Pokenav1Struct*);
static void SetMenuInputHandler(struct Pokenav1Struct *state);
// Number of entries - 1 for that menu type
-static const u8 sLastCursorPositions[] =
+static const u8 sLastCursorPositions[] =
{
- [POKENAV_MENU_TYPE_DEFAULT] = 2,
- [POKENAV_MENU_TYPE_UNLOCK_MC] = 3,
- [POKENAV_MENU_TYPE_UNLOCK_MC_RIBBONS] = 4,
- [POKENAV_MENU_TYPE_CONDITION] = 2,
+ [POKENAV_MENU_TYPE_DEFAULT] = 2,
+ [POKENAV_MENU_TYPE_UNLOCK_MC] = 3,
+ [POKENAV_MENU_TYPE_UNLOCK_MC_RIBBONS] = 4,
+ [POKENAV_MENU_TYPE_CONDITION] = 2,
[POKENAV_MENU_TYPE_CONDITION_SEARCH] = 5
};
static const u8 sMenuItems[][6] =
{
- [POKENAV_MENU_TYPE_DEFAULT] =
- {
- POKENAV_MENUITEM_MAP,
- POKENAV_MENUITEM_CONDITION,
+ [POKENAV_MENU_TYPE_DEFAULT] =
+ {
+ POKENAV_MENUITEM_MAP,
+ POKENAV_MENUITEM_CONDITION,
[2 ... 5] = POKENAV_MENUITEM_SWITCH_OFF
},
- [POKENAV_MENU_TYPE_UNLOCK_MC] =
- {
- POKENAV_MENUITEM_MAP,
- POKENAV_MENUITEM_CONDITION,
- POKENAV_MENUITEM_MATCH_CALL,
+ [POKENAV_MENU_TYPE_UNLOCK_MC] =
+ {
+ POKENAV_MENUITEM_MAP,
+ POKENAV_MENUITEM_CONDITION,
+ POKENAV_MENUITEM_MATCH_CALL,
[3 ... 5] = POKENAV_MENUITEM_SWITCH_OFF
},
- [POKENAV_MENU_TYPE_UNLOCK_MC_RIBBONS] =
- {
- POKENAV_MENUITEM_MAP,
- POKENAV_MENUITEM_CONDITION,
- POKENAV_MENUITEM_MATCH_CALL,
- POKENAV_MENUITEM_RIBBONS,
+ [POKENAV_MENU_TYPE_UNLOCK_MC_RIBBONS] =
+ {
+ POKENAV_MENUITEM_MAP,
+ POKENAV_MENUITEM_CONDITION,
+ POKENAV_MENUITEM_MATCH_CALL,
+ POKENAV_MENUITEM_RIBBONS,
[4 ... 5] = POKENAV_MENUITEM_SWITCH_OFF
},
- [POKENAV_MENU_TYPE_CONDITION] =
- {
- POKENAV_MENUITEM_CONDITION_PARTY,
- POKENAV_MENUITEM_CONDITION_SEARCH,
- POKENAV_MENUITEM_CONDITION_CANCEL,
+ [POKENAV_MENU_TYPE_CONDITION] =
+ {
+ POKENAV_MENUITEM_CONDITION_PARTY,
+ POKENAV_MENUITEM_CONDITION_SEARCH,
+ POKENAV_MENUITEM_CONDITION_CANCEL,
[3 ... 5] = POKENAV_MENUITEM_SWITCH_OFF
},
- [POKENAV_MENU_TYPE_CONDITION_SEARCH] =
- {
- POKENAV_MENUITEM_CONDITION_SEARCH_COOL,
- POKENAV_MENUITEM_CONDITION_SEARCH_BEAUTY,
- POKENAV_MENUITEM_CONDITION_SEARCH_CUTE,
- POKENAV_MENUITEM_CONDITION_SEARCH_SMART,
- POKENAV_MENUITEM_CONDITION_SEARCH_TOUGH,
- POKENAV_MENUITEM_CONDITION_SEARCH_CANCEL
+ [POKENAV_MENU_TYPE_CONDITION_SEARCH] =
+ {
+ POKENAV_MENUITEM_CONDITION_SEARCH_COOL,
+ POKENAV_MENUITEM_CONDITION_SEARCH_BEAUTY,
+ POKENAV_MENUITEM_CONDITION_SEARCH_CUTE,
+ POKENAV_MENUITEM_CONDITION_SEARCH_SMART,
+ POKENAV_MENUITEM_CONDITION_SEARCH_TOUGH,
+ POKENAV_MENUITEM_CONDITION_SEARCH_CANCEL
},
};
@@ -87,24 +87,24 @@ static u8 GetPokenavMainMenuType(void)
u8 menuType = POKENAV_MENU_TYPE_DEFAULT;
if (FlagGet(FLAG_ADDED_MATCH_CALL_TO_POKENAV))
- {
+ {
menuType = POKENAV_MENU_TYPE_UNLOCK_MC;
if (FlagGet(FLAG_SYS_RIBBON_GET))
menuType = POKENAV_MENU_TYPE_UNLOCK_MC_RIBBONS;
}
-
+
return menuType;
}
bool32 PokenavCallback_Init_MainMenuCursorOnMap(void)
{
- struct Pokenav1Struct *state = AllocSubstruct(1, sizeof(struct Pokenav1Struct));
+ struct Pokenav1Struct *state = AllocSubstruct(POKENAV_SUBSTRUCT_MAIN_MENU_HANDLER, sizeof(struct Pokenav1Struct));
if (!state)
return FALSE;
-
+
state->menuType = GetPokenavMainMenuType();
- state->cursorPos = 0;
+ state->cursorPos = POKENAV_MENUITEM_MAP;
state->currMenuItem = POKENAV_MENUITEM_MAP;
state->helpBarIndex = HELPBAR_NONE;
SetMenuInputHandler(state);
@@ -113,12 +113,12 @@ bool32 PokenavCallback_Init_MainMenuCursorOnMap(void)
bool32 PokenavCallback_Init_MainMenuCursorOnMatchCall(void)
{
- struct Pokenav1Struct *state = AllocSubstruct(1, sizeof(struct Pokenav1Struct));
+ struct Pokenav1Struct *state = AllocSubstruct(POKENAV_SUBSTRUCT_MAIN_MENU_HANDLER, sizeof(struct Pokenav1Struct));
if (!state)
return FALSE;
-
+
state->menuType = GetPokenavMainMenuType();
- state->cursorPos = 2;
+ state->cursorPos = POKENAV_MENUITEM_MATCH_CALL;
state->currMenuItem = POKENAV_MENUITEM_MATCH_CALL;
state->helpBarIndex = HELPBAR_NONE;
SetMenuInputHandler(state);
@@ -127,12 +127,12 @@ bool32 PokenavCallback_Init_MainMenuCursorOnMatchCall(void)
bool32 PokenavCallback_Init_MainMenuCursorOnRibbons(void)
{
- struct Pokenav1Struct *state = AllocSubstruct(1, sizeof(struct Pokenav1Struct));
+ struct Pokenav1Struct *state = AllocSubstruct(POKENAV_SUBSTRUCT_MAIN_MENU_HANDLER, sizeof(struct Pokenav1Struct));
if (!state)
return FALSE;
-
+
state->menuType = GetPokenavMainMenuType();
- state->cursorPos = 3;
+ state->cursorPos = POKENAV_MENUITEM_RIBBONS;
state->currMenuItem = POKENAV_MENUITEM_RIBBONS;
SetMenuInputHandler(state);
return TRUE;
@@ -140,12 +140,12 @@ bool32 PokenavCallback_Init_MainMenuCursorOnRibbons(void)
bool32 PokenavCallback_Init_ConditionMenu(void)
{
- struct Pokenav1Struct *state = AllocSubstruct(1, sizeof(struct Pokenav1Struct));
+ struct Pokenav1Struct *state = AllocSubstruct(POKENAV_SUBSTRUCT_MAIN_MENU_HANDLER, sizeof(struct Pokenav1Struct));
if (!state)
return FALSE;
-
+
state->menuType = POKENAV_MENU_TYPE_CONDITION;
- state->cursorPos = 0;
+ state->cursorPos = 0; //party
state->currMenuItem = POKENAV_MENUITEM_CONDITION_PARTY;
state->helpBarIndex = HELPBAR_NONE;
SetMenuInputHandler(state);
@@ -154,10 +154,10 @@ bool32 PokenavCallback_Init_ConditionMenu(void)
bool32 PokenavCallback_Init_ConditionSearchMenu(void)
{
- struct Pokenav1Struct *state = AllocSubstruct(1, sizeof(struct Pokenav1Struct));
+ struct Pokenav1Struct *state = AllocSubstruct(POKENAV_SUBSTRUCT_MAIN_MENU_HANDLER, sizeof(struct Pokenav1Struct));
if (!state)
return FALSE;
-
+
state->menuType = POKENAV_MENU_TYPE_CONDITION_SEARCH;
state->cursorPos = GetSelectedConditionSearch();
state->currMenuItem = state->cursorPos + POKENAV_MENUITEM_CONDITION_SEARCH_COOL;
@@ -202,13 +202,13 @@ static u32 (*GetMainMenuInputHandler(void))(struct Pokenav1Struct*)
u32 GetMenuHandlerCallback(void)
{
- struct Pokenav1Struct *state = GetSubstructPtr(1);
+ struct Pokenav1Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU_HANDLER);
return state->callback(state);
}
void FreeMenuHandlerSubstruct1(void)
{
- FreePokenavSubstruct(1);
+ FreePokenavSubstruct(POKENAV_SUBSTRUCT_MAIN_MENU_HANDLER);
}
static u32 HandleMainMenuInput(struct Pokenav1Struct *state)
@@ -247,12 +247,12 @@ static u32 HandleMainMenuInput(struct Pokenav1Struct *state)
return POKENAV_MENU_FUNC_NO_RIBBON_WINNERS;
}
case POKENAV_MENUITEM_SWITCH_OFF:
- return -1;
+ return POKENAV_MENU_FUNC_EXIT;
}
}
-
- if (gMain.newKeys & B_BUTTON)
- return -1;
+
+ if (JOY_NEW(B_BUTTON))
+ return POKENAV_MENU_FUNC_EXIT;
return POKENAV_MENU_FUNC_NONE;
}
@@ -262,7 +262,7 @@ static u32 HandleMainMenuInputTutorial(struct Pokenav1Struct *state)
{
if (UpdateMenuCursorPos(state))
return POKENAV_MENU_FUNC_MOVE_CURSOR;
-
+
if (gMain.newKeys & A_BUTTON)
{
if (sMenuItems[state->menuType][state->cursorPos] == POKENAV_MENUITEM_MATCH_CALL)
@@ -277,13 +277,13 @@ static u32 HandleMainMenuInputTutorial(struct Pokenav1Struct *state)
return POKENAV_MENU_FUNC_NONE;
}
}
-
+
if (gMain.newKeys & B_BUTTON)
{
PlaySE(SE_FAILURE);
return POKENAV_MENU_FUNC_NONE;
}
-
+
return POKENAV_MENU_FUNC_NONE;
}
@@ -292,7 +292,7 @@ static u32 HandleMainMenuInputEndTutorial(struct Pokenav1Struct *state)
{
if (UpdateMenuCursorPos(state))
return POKENAV_MENU_FUNC_MOVE_CURSOR;
-
+
if (gMain.newKeys & A_BUTTON)
{
u32 menuItem = sMenuItems[state->menuType][state->cursorPos];
@@ -342,7 +342,7 @@ static u32 HandleConditionMenuInput(struct Pokenav1Struct *state)
{
if (UpdateMenuCursorPos(state))
return POKENAV_MENU_FUNC_MOVE_CURSOR;
-
+
if (gMain.newKeys & A_BUTTON)
{
switch (sMenuItems[state->menuType][state->cursorPos])
@@ -386,7 +386,7 @@ static u32 HandleConditionSearchMenuInput(struct Pokenav1Struct *state)
{
if (UpdateMenuCursorPos(state))
return POKENAV_MENU_FUNC_MOVE_CURSOR;
-
+
if (gMain.newKeys & A_BUTTON)
{
u8 menuItem = sMenuItems[state->menuType][state->cursorPos];
@@ -488,26 +488,26 @@ static bool32 UpdateMenuCursorPos(struct Pokenav1Struct *state)
int GetPokenavMenuType(void)
{
- struct Pokenav1Struct *state = GetSubstructPtr(1);
+ struct Pokenav1Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU_HANDLER);
return state->menuType;
}
// Position of cursor relative to number of current menu options
int GetPokenavCursorPos(void)
{
- struct Pokenav1Struct *state = GetSubstructPtr(1);
+ struct Pokenav1Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU_HANDLER);
return state->cursorPos;
}
// ID of menu item the cursor is currently on
int GetCurrentMenuItemId(void)
{
- struct Pokenav1Struct *state = GetSubstructPtr(1);
+ struct Pokenav1Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU_HANDLER);
return state->currMenuItem;
}
u16 GetHelpBarTextId(void)
{
- struct Pokenav1Struct *state = GetSubstructPtr(1);
+ struct Pokenav1Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU_HANDLER);
return state->helpBarIndex;
}
diff --git a/src/pokenav_menu_handler_2.c b/src/pokenav_menu_handler_2.c
index 2be92013f..3fcd41dc9 100644
--- a/src/pokenav_menu_handler_2.c
+++ b/src/pokenav_menu_handler_2.c
@@ -27,7 +27,7 @@ struct Pokenav2Struct
bool8 otherIconsInMotion;
bool8 pokenavAlreadyOpen;
bool32 iconVisible[MAX_POKENAV_MENUITEMS];
- struct Sprite * field_028;
+ struct Sprite * blueLightSpriteId;
struct Sprite * iconSprites[MAX_POKENAV_MENUITEMS][4];
u16 bg1TilemapBuffer[0x400];
};
@@ -43,54 +43,54 @@ static u32 LoopedTask_ReturnToConditionMenu(s32 state);
static u32 LoopedTask_SelectRibbonsNoWinners(s32 state);
static u32 LoopedTask_ReShowDescription(s32 state);
static u32 LoopedTask_OpenPokenavFeature(s32 state);
-static void sub_81C9FC4(void);
-static void sub_81C9FEC(void);
+static void LoadPokenavOptionPalettes(void);
+static void FreeAndDestroyMainMenuSprites(void);
static void CreateMenuOptionSprites(void);
-static void sub_81CA094(void);
+static void DestroyMenuOptionSprites(void);
static void sub_81CA0C8(void);
-static void sub_81CA0EC(const u16 *const * a0, s32 a1, s32 a2);
-static void sub_81CA20C(void);
-static void sub_81CA278(void);
-static void sub_81CA35C(struct Sprite ** sprites, s32 a1, s32 a2, s32 a3);
-static void sub_81CA3B4(struct Sprite ** sprites);
-static void sub_81CA2DC(void);
+static void DrawOptionLabelGfx(const u16 *const * a0, s32 yPos, s32 a2);
+static void SetupCurrentMenuOptionsGfx(void);
+static void SetMenuOptionGfxParams_CursorMoved(void);
+static void SetMenuOptionGfxParamsInactive(struct Sprite ** sprites, s32 x, s32 a2, s32 a3);
+static void SetMenuOptionGfxParamsActive(struct Sprite ** sprites);
+static void SetupPokenavMenuOptions(void);
static bool32 AreMenuOptionSpritesMoving(void);
-static void sub_81CA448(struct Sprite ** sprites, bool32 a1);
+static void SetMenuOptionGfxInvisibility(struct Sprite ** sprites, bool32 a1);
static void sub_81CA474(struct Sprite * sprite);
static void sub_81CA4AC(struct Sprite * sprite);
static void sub_81CA580(u8 taskId);
-static void sub_81CA640(void);
-static void sub_81CA6AC(struct Sprite * sprite);
-static void sub_81CA698(void);
+static void CreateMatchCallBlueLightSprite(void);
+static void SpriteCB_BlinkingBlueLight(struct Sprite * sprite);
+static void DestroyRematchBlueLightSpriteId(void);
static void AddOptionDescriptionWindow(void);
static void PrintCurrentOptionDescription(void);
static void PrintNoRibbonWinners(void);
-static bool32 sub_81CA7C4(void);
-static void sub_81CA7D4(void);
-static void sub_81CA7F4(void);
-static void sub_81CA808(u8 taskId);
-static void sub_81CA818(void);
-static void sub_81CA850(void);
-static void sub_81CA864(void);
-static bool32 sub_81CA89C(void);
-static void sub_81CA8B0(u8 taskId);
-static void sub_81CA92C(void);
-static void sub_81CA994(void);
-static void sub_81CA9C8(void);
-static void sub_81CA9D8(void);
-static void sub_81CA9EC(u8 taskId);
-static void sub_81CAA3C(void);
-
-static const u16 gUnknown_0861FC78[] = INCBIN_U16("graphics/pokenav/bg.gbapal");
-static const u32 gUnknown_0861FC98[] = INCBIN_U32("graphics/pokenav/bg.4bpp.lz");
-static const u32 gUnknown_0861FCAC[] = INCBIN_U32("graphics/pokenav/bg.bin.lz");
-static const u16 gUnknown_0861FD4C[] = INCBIN_U16("graphics/pokenav/outline.gbapal");
-static const u32 gUnknown_0861FD6C[] = INCBIN_U32("graphics/pokenav/outline.4bpp.lz");
-static const u32 gUnknown_0861FFF4[] = INCBIN_U32("graphics/pokenav/outline_map.bin.lz");
-static const u16 gUnknown_08620104[] = INCBIN_U16("graphics/pokenav/blue_light.gbapal");
-static const u32 gUnknown_08620124[] = INCBIN_U32("graphics/pokenav/blue_light.4bpp.lz");
-
-static const struct BgTemplate gUnknown_08620194[] = {
+static bool32 IsDma3ManagerBusyWithBgCopy_(void);
+static void CreateMovingBgDotsTask(void);
+static void DestroyMovingDotsBgTask(void);
+static void Task_MoveBgDots(u8 taskId);
+static void CreateBgDotPurplePalTask(void);
+static void ChangeBgDotsColorToPurple(void);
+static void CreateBgDotLightBluePalTask(void);
+static bool32 IsTaskActive_UpdateBgDotsPalette(void);
+static void Task_UpdateBgDotsPalette(u8 taskId);
+static void SetupPokenavMenuScanlineEffects(void);
+static void DestroyMenuOptionGlowTask(void);
+static void ResetBldCnt(void);
+static void InitMenuOptionGlow(void);
+static void Task_CurrentMenuOptionGlow(u8 taskId);
+static void SetMenuOptionGlow(void);
+
+static const u16 sPokenavBgDotsPal[] = INCBIN_U16("graphics/pokenav/bg_dots.gbapal");
+static const u32 sPokenavBgDotsTiles[] = INCBIN_U32("graphics/pokenav/bg_dots.4bpp.lz");
+static const u32 sPokenavBgDotsTilemap[] = INCBIN_U32("graphics/pokenav/bg_dots.bin.lz");
+static const u16 sPokenavDeviceBgPal[] = INCBIN_U16("graphics/pokenav/device_outline.gbapal");
+static const u32 sPokenavDeviceBgTiles[] = INCBIN_U32("graphics/pokenav/device_outline.4bpp.lz");
+static const u32 sPokenavDeviceBgTilemap[] = INCBIN_U32("graphics/pokenav/device_outline_map.bin.lz");
+static const u16 sMatchCallBlueLightPal[] = INCBIN_U16("graphics/pokenav/blue_light.gbapal");
+static const u32 sMatchCallBlueLightTiles[] = INCBIN_U32("graphics/pokenav/blue_light.4bpp.lz");
+
+static const struct BgTemplate sPokenavMainMenuBgTemplates[] = {
{
.bg = 1,
.charBaseIndex = 1,
@@ -118,7 +118,8 @@ static const struct BgTemplate gUnknown_08620194[] = {
}
};
-static const LoopedTask sMenuHandlerLoopTaskFuncs[] = {
+static const LoopedTask sMenuHandlerLoopTaskFuncs[] =
+{
[POKENAV_MENU_FUNC_NONE] = NULL,
[POKENAV_MENU_FUNC_MOVE_CURSOR] = LoopedTask_MoveMenuCursor,
[POKENAV_MENU_FUNC_OPEN_CONDITION] = LoopedTask_OpenConditionMenu,
@@ -130,7 +131,7 @@ static const LoopedTask sMenuHandlerLoopTaskFuncs[] = {
[POKENAV_MENU_FUNC_OPEN_FEATURE] = LoopedTask_OpenPokenavFeature
};
-static const struct CompressedSpriteSheet gUnknown_086201C4[] =
+static const struct CompressedSpriteSheet sPokenavOptionsSpriteSheets[] =
{
{
.data = gPokenavOptions_Gfx,
@@ -138,76 +139,75 @@ static const struct CompressedSpriteSheet gUnknown_086201C4[] =
.tag = 0x0003
},
{
- .data = gUnknown_08620124,
+ .data = sMatchCallBlueLightTiles,
.size = 0x0100,
.tag = 0x0001
}
};
-static const struct SpritePalette gUnknown_086201D4[] =
+static const struct SpritePalette sPokenavOptionsSpritePalettes[] =
{
{gPokenavOptions_Pal + 0x00, 4},
{gPokenavOptions_Pal + 0x10, 5},
{gPokenavOptions_Pal + 0x20, 6},
{gPokenavOptions_Pal + 0x30, 7},
{gPokenavOptions_Pal + 0x40, 8},
- {gUnknown_08620104, 3},
+ {sMatchCallBlueLightPal, 3},
{}
};
-static const u16 gUnknown_0862020C[] = {0, 0};
-static const u16 gUnknown_08620210[] = {0x20, 1};
-static const u16 gUnknown_08620214[] = {0x40, 4};
-static const u16 gUnknown_08620218[] = {0x60, 2};
-static const u16 gUnknown_0862021C[] = {0x80, 3};
-static const u16 gUnknown_08620220[] = {0xA0, 1};
-static const u16 gUnknown_08620224[] = {0xC0, 1};
-static const u16 gUnknown_08620228[] = {0xE0, 4};
-static const u16 gUnknown_0862022C[] = {0x100, 1};
-static const u16 gUnknown_08620230[] = {0x120, 2};
-static const u16 gUnknown_08620234[] = {0x140, 0};
-static const u16 gUnknown_08620238[] = {0x160, 0};
-static const u16 gUnknown_0862023C[] = {0x180, 3};
-
-struct UnkStruct_08620240
-{
- u16 unk0;
- u16 unk2;
- const u16 *unk4[MAX_POKENAV_MENUITEMS];
+static const u16 sOptionsLabelGfx_RegionMap[] = {0, 0};
+static const u16 sOptionsLabelGfx_Condition[] = {0x20, 1};
+static const u16 sOptionsLabelGfx_MatchCall[] = {0x40, 4};
+static const u16 sOptionsLabelGfx_Ribbons[] = {0x60, 2};
+static const u16 sOptionsLabelGfx_SwitchOff[] = {0x80, 3};
+static const u16 sOptionsLabelGfx_Party[] = {0xA0, 1};
+static const u16 sOptionsLabelGfx_Search[] = {0xC0, 1};
+static const u16 sOptionsLabelGfx_Cool[] = {0xE0, 4};
+static const u16 sOptionsLabelGfx_Beauty[] = {0x100, 1};
+static const u16 sOptionsLabelGfx_Cute[] = {0x120, 2};
+static const u16 sOptionsLabelGfx_Smart[] = {0x140, 0};
+static const u16 sOptionsLabelGfx_Tough[] = {0x160, 0};
+static const u16 sOptionsLabelGfx_Cancel[] = {0x180, 3};
+
+struct OptionsLabelGfx
+{
+ u16 yStart;
+ u16 deltaY;
+ const u16 *tiles[MAX_POKENAV_MENUITEMS];
};
-// TODO
-static const struct UnkStruct_08620240 gUnknown_08620240[POKENAV_MENU_TYPE_COUNT] =
+static const struct OptionsLabelGfx sPokenavMenuOptionLabelGfx[POKENAV_MENU_TYPE_COUNT] =
{
[POKENAV_MENU_TYPE_DEFAULT] =
{
- 0x2A,
- 0x14,
- {gUnknown_0862020C, gUnknown_08620210, gUnknown_0862021C}
+ .yStart = 42,
+ .deltaY = 20,
+ {sOptionsLabelGfx_RegionMap, sOptionsLabelGfx_Condition, sOptionsLabelGfx_SwitchOff}
},
[POKENAV_MENU_TYPE_UNLOCK_MC] =
{
- 0x2A,
- 0x14,
- {gUnknown_0862020C, gUnknown_08620210, gUnknown_08620214, gUnknown_0862021C}
+ .yStart = 42,
+ .deltaY = 20,
+ {sOptionsLabelGfx_RegionMap, sOptionsLabelGfx_Condition, sOptionsLabelGfx_MatchCall, sOptionsLabelGfx_SwitchOff}
},
[POKENAV_MENU_TYPE_UNLOCK_MC_RIBBONS] =
{
- 0x2A,
- 0x14,
- {gUnknown_0862020C, gUnknown_08620210, gUnknown_08620214, gUnknown_08620218, gUnknown_0862021C}
+ .yStart = 42,
+ .deltaY = 20,
+ {sOptionsLabelGfx_RegionMap, sOptionsLabelGfx_Condition, sOptionsLabelGfx_MatchCall, sOptionsLabelGfx_Ribbons, sOptionsLabelGfx_SwitchOff}
},
[POKENAV_MENU_TYPE_CONDITION] =
{
- 0x38,
- 0x14,
- {gUnknown_08620220, gUnknown_08620224, gUnknown_0862023C}
+ .yStart = 56,
+ .deltaY = 20,
+ {sOptionsLabelGfx_Party, sOptionsLabelGfx_Search, sOptionsLabelGfx_Cancel}
},
[POKENAV_MENU_TYPE_CONDITION_SEARCH] =
{
- 0x28,
- 0x10,
- {gUnknown_08620228, gUnknown_0862022C, gUnknown_08620230, gUnknown_08620234, gUnknown_08620238, gUnknown_0862023C}
+ .yStart = 40,
+ .deltaY = 16,
+ {sOptionsLabelGfx_Cool, sOptionsLabelGfx_Beauty, sOptionsLabelGfx_Cute, sOptionsLabelGfx_Smart, sOptionsLabelGfx_Tough, sOptionsLabelGfx_Cancel}
},
};
@@ -287,7 +287,7 @@ static const struct SpriteTemplate sMenuOptionSpriteTemplate =
.callback = SpriteCallbackDummy,
};
-static const struct OamData gUnknown_08620364 =
+static const struct OamData sBlueLightOamData =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
@@ -301,18 +301,18 @@ static const struct OamData gUnknown_08620364 =
.paletteNum = 0,
};
-static const struct SpriteTemplate gUnknown_0862036C =
+static const struct SpriteTemplate sMatchCallBlueLightSpriteTemplate =
{
.tileTag = 1,
.paletteTag = 3,
- .oam = &gUnknown_08620364,
+ .oam = &sBlueLightOamData,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy,
};
-static const struct ScanlineEffectParams gUnknown_08620384 =
+static const struct ScanlineEffectParams sPokenavMainMenuScanlineEffectParams =
{
(void *)REG_ADDR_WIN0H,
((DMA_ENABLE | DMA_START_HBLANK | DMA_REPEAT | DMA_DEST_RELOAD) << 16) | 1,
@@ -320,13 +320,13 @@ static const struct ScanlineEffectParams gUnknown_08620384 =
0
};
-static bool32 sub_81C98D4(void)
+static bool32 PlayerHasTrainerRematches(void)
{
s32 i;
for (i = 0; i < REMATCH_TABLE_ENTRIES; i++)
{
- if (sub_81CB0C8(i) == gMapHeader.regionMapSectionId
+ if (GetMatchTableMapSectionId(i) == gMapHeader.regionMapSectionId
&& IsRematchEntryRegistered(i)
&& gSaveBlock1Ptr->trainerRematches[i])
return TRUE;
@@ -373,43 +373,43 @@ static struct Pokenav2Struct * OpenPokenavMenu(void)
void CreateMenuHandlerLoopedTask(s32 ltIdx)
{
- struct Pokenav2Struct * state = GetSubstructPtr(2);
+ struct Pokenav2Struct * state = GetSubstructPtr(POKENAV_SUBSTRUCT_MENU_ICONS);
state->loopedTaskId = CreateLoopedTask(sMenuHandlerLoopTaskFuncs[ltIdx], 1);
state->isTaskActiveCB = GetCurrentLoopedTaskActive;
}
bool32 IsMenuHandlerLoopedTaskActive(void)
{
- struct Pokenav2Struct * state = GetSubstructPtr(2);
+ struct Pokenav2Struct * state = GetSubstructPtr(POKENAV_SUBSTRUCT_MENU_ICONS);
return state->isTaskActiveCB();
}
void FreeMenuHandlerSubstruct2(void)
{
- struct Pokenav2Struct * unk = GetSubstructPtr(2);
+ struct Pokenav2Struct * unk = GetSubstructPtr(POKENAV_SUBSTRUCT_MENU_ICONS);
- sub_81CA7F4();
+ DestroyMovingDotsBgTask();
RemoveWindow(unk->optionDescWindowId);
- sub_81C9FEC();
- sub_81CA994();
- FreePokenavSubstruct(2);
+ FreeAndDestroyMainMenuSprites();
+ DestroyMenuOptionGlowTask();
+ FreePokenavSubstruct(POKENAV_SUBSTRUCT_MENU_ICONS);
}
static bool32 GetCurrentLoopedTaskActive(void)
{
- struct Pokenav2Struct * unk = GetSubstructPtr(2);
+ struct Pokenav2Struct * unk = GetSubstructPtr(POKENAV_SUBSTRUCT_MENU_ICONS);
return IsLoopedTaskActive(unk->loopedTaskId);
}
static u32 LoopedTask_OpenMenu(s32 state)
{
- struct Pokenav2Struct * unk = GetSubstructPtr(2);
+ struct Pokenav2Struct * unk = GetSubstructPtr(POKENAV_SUBSTRUCT_MENU_ICONS);
switch (state)
{
case 0:
- InitBgTemplates(gUnknown_08620194, ARRAY_COUNT(gUnknown_08620194));
+ InitBgTemplates(sPokenavMainMenuBgTemplates, ARRAY_COUNT(sPokenavMainMenuBgTemplates));
DecompressAndCopyTileDataToVram(1, gPokenavMessageBox_Gfx, 0, 0, 0);
SetBgTilemapBuffer(1, unk->bg1TilemapBuffer);
CopyToBgTilemapBuffer(1, gPokenavMessageBox_Tilemap, 0, 0);
@@ -425,36 +425,36 @@ static u32 LoopedTask_OpenMenu(s32 state)
case 1:
if (FreeTempTileDataBuffersIfPossible())
return LT_PAUSE;
- DecompressAndCopyTileDataToVram(2, gUnknown_0861FD6C, 0, 0, 0);
- DecompressAndCopyTileDataToVram(2, gUnknown_0861FFF4, 0, 0, 1);
- CopyPaletteIntoBufferUnfaded(gUnknown_0861FD4C, 0x20, 0x20);
+ DecompressAndCopyTileDataToVram(2, sPokenavDeviceBgTiles, 0, 0, 0);
+ DecompressAndCopyTileDataToVram(2, sPokenavDeviceBgTilemap, 0, 0, 1);
+ CopyPaletteIntoBufferUnfaded(sPokenavDeviceBgPal, 0x20, 0x20);
return LT_INC_AND_PAUSE;
case 2:
if (FreeTempTileDataBuffersIfPossible())
return LT_PAUSE;
- DecompressAndCopyTileDataToVram(3, gUnknown_0861FC98, 0, 0, 0);
- DecompressAndCopyTileDataToVram(3, gUnknown_0861FCAC, 0, 0, 1);
- CopyPaletteIntoBufferUnfaded(gUnknown_0861FC78, 0x30, 0x20);
+ DecompressAndCopyTileDataToVram(3, sPokenavBgDotsTiles, 0, 0, 0);
+ DecompressAndCopyTileDataToVram(3, sPokenavBgDotsTilemap, 0, 0, 1);
+ CopyPaletteIntoBufferUnfaded(sPokenavBgDotsPal, 0x30, 0x20);
if (GetPokenavMenuType() == POKENAV_MENU_TYPE_CONDITION || GetPokenavMenuType() == POKENAV_MENU_TYPE_CONDITION_SEARCH)
- sub_81CA850();
+ ChangeBgDotsColorToPurple();
return LT_INC_AND_PAUSE;
case 3:
if (FreeTempTileDataBuffersIfPossible())
return LT_PAUSE;
AddOptionDescriptionWindow();
- sub_81CA7D4();
+ CreateMovingBgDotsTask();
return LT_INC_AND_CONTINUE;
case 4:
- sub_81C9FC4();
+ LoadPokenavOptionPalettes();
return LT_INC_AND_CONTINUE;
case 5:
PrintCurrentOptionDescription();
CreateMenuOptionSprites();
- sub_81CA640();
+ CreateMatchCallBlueLightSprite();
sub_81CA0C8();
return LT_INC_AND_PAUSE;
case 6:
- if (sub_81CA7C4())
+ if (IsDma3ManagerBusyWithBgCopy_())
return LT_PAUSE;
return LT_INC_AND_CONTINUE;
case 7:
@@ -487,22 +487,22 @@ static u32 LoopedTask_OpenMenu(s32 state)
switch (GetPokenavMenuType())
{
case POKENAV_MENU_TYPE_CONDITION_SEARCH:
- sub_81C7FA0(7, FALSE, FALSE);
+ ShowLeftHeaderGfx(7, FALSE, FALSE);
// fallthrough
case POKENAV_MENU_TYPE_CONDITION:
- sub_81C7FA0(1, FALSE, FALSE);
+ ShowLeftHeaderGfx(1, FALSE, FALSE);
break;
default:
- sub_81C7FA0(0, FALSE, FALSE);
+ ShowLeftHeaderGfx(0, FALSE, FALSE);
break;
}
- sub_81CA20C();
- sub_81CA92C();
+ SetupCurrentMenuOptionsGfx();
+ SetupPokenavMenuScanlineEffects();
return LT_INC_AND_CONTINUE;
case 9:
if (AreMenuOptionSpritesMoving())
return LT_PAUSE;
- if (sub_81C8010())
+ if (AreLeftHeaderSpritesMoving())
return LT_PAUSE;
break;
}
@@ -514,15 +514,15 @@ static u32 LoopedTask_MoveMenuCursor(s32 state)
switch (state)
{
case 0:
- sub_81CAA3C();
- sub_81CA278();
+ SetMenuOptionGlow();
+ SetMenuOptionGfxParams_CursorMoved();
PrintCurrentOptionDescription();
PlaySE(SE_SELECT);
return LT_INC_AND_PAUSE;
case 1:
if (AreMenuOptionSpritesMoving())
return LT_PAUSE;
- if (sub_81CA7C4())
+ if (IsDma3ManagerBusyWithBgCopy_())
return LT_PAUSE;
break;
}
@@ -534,35 +534,35 @@ static u32 LoopedTask_OpenConditionMenu(s32 state)
switch (state)
{
case 0:
- sub_81CA9C8();
- sub_81CA2DC();
- sub_81C7FC4(0, 0);
+ ResetBldCnt();
+ SetupPokenavMenuOptions();
+ HideMainOrSubMenuLeftHeader(POKENAV_GFX_MAIN_MENU, 0);
PlaySE(SE_SELECT);
return LT_INC_AND_PAUSE;
case 1:
if (AreMenuOptionSpritesMoving())
return LT_PAUSE;
- if (sub_81C8010())
+ if (AreLeftHeaderSpritesMoving())
return LT_PAUSE;
sub_81CA0C8();
LoadLeftHeaderGfxForIndex(1);
return LT_INC_AND_PAUSE;
case 2:
- sub_81CA20C();
- sub_81C7FA0(1, FALSE, FALSE);
- sub_81CA818();
+ SetupCurrentMenuOptionsGfx();
+ ShowLeftHeaderGfx(1, FALSE, FALSE);
+ CreateBgDotPurplePalTask();
PrintCurrentOptionDescription();
return LT_INC_AND_PAUSE;
case 3:
if (AreMenuOptionSpritesMoving())
return LT_PAUSE;
- if (sub_81C8010())
+ if (AreLeftHeaderSpritesMoving())
return LT_PAUSE;
- if (sub_81CA89C())
+ if (IsTaskActive_UpdateBgDotsPalette())
return LT_PAUSE;
- if (sub_81CA7C4())
+ if (IsDma3ManagerBusyWithBgCopy_())
return LT_PAUSE;
- sub_81CA9D8();
+ InitMenuOptionGlow();
break;
}
return LT_FINISH;
@@ -573,34 +573,34 @@ static u32 LoopedTask_ReturnToMainMenu(s32 state)
switch (state)
{
case 0:
- sub_81CA9C8();
- sub_81CA2DC();
- sub_81C7FC4(1, 0);
+ ResetBldCnt();
+ SetupPokenavMenuOptions();
+ HideMainOrSubMenuLeftHeader(POKENAV_GFX_CONDITION_MENU, 0);
return LT_INC_AND_PAUSE;
case 1:
if (AreMenuOptionSpritesMoving())
return LT_PAUSE;
- if (sub_81C8010())
+ if (AreLeftHeaderSpritesMoving())
return LT_PAUSE;
sub_81CA0C8();
LoadLeftHeaderGfxForIndex(0);
return LT_INC_AND_PAUSE;
case 2:
- sub_81CA20C();
- sub_81C7FA0(0, FALSE, FALSE);
- sub_81CA864();
+ SetupCurrentMenuOptionsGfx();
+ ShowLeftHeaderGfx(0, FALSE, FALSE);
+ CreateBgDotLightBluePalTask();
PrintCurrentOptionDescription();
return LT_INC_AND_PAUSE;
case 3:
if (AreMenuOptionSpritesMoving())
return LT_PAUSE;
- if (sub_81C8010())
+ if (AreLeftHeaderSpritesMoving())
return LT_PAUSE;
- if (sub_81CA89C())
+ if (IsTaskActive_UpdateBgDotsPalette())
return LT_PAUSE;
- if (sub_81CA7C4())
+ if (IsDma3ManagerBusyWithBgCopy_())
return LT_PAUSE;
- sub_81CA9D8();
+ InitMenuOptionGlow();
break;
}
return LT_FINISH;
@@ -611,8 +611,8 @@ static u32 LoopedTask_OpenConditionSearchMenu(s32 state)
switch (state)
{
case 0:
- sub_81CA9C8();
- sub_81CA2DC();
+ ResetBldCnt();
+ SetupPokenavMenuOptions();
PlaySE(SE_SELECT);
return LT_INC_AND_PAUSE;
case 1:
@@ -622,18 +622,18 @@ static u32 LoopedTask_OpenConditionSearchMenu(s32 state)
sub_81CA0C8();
return LT_INC_AND_PAUSE;
case 2:
- sub_81CA20C();
- sub_81C7FA0(7, FALSE, FALSE);
+ SetupCurrentMenuOptionsGfx();
+ ShowLeftHeaderGfx(7, FALSE, FALSE);
PrintCurrentOptionDescription();
return LT_INC_AND_PAUSE;
case 3:
if (AreMenuOptionSpritesMoving())
return LT_PAUSE;
- if (sub_81C8010())
+ if (AreLeftHeaderSpritesMoving())
return LT_PAUSE;
- if (sub_81CA89C())
+ if (IsTaskActive_UpdateBgDotsPalette())
return LT_PAUSE;
- sub_81CA9D8();
+ InitMenuOptionGlow();
break;
}
return LT_FINISH;
@@ -644,27 +644,27 @@ static u32 LoopedTask_ReturnToConditionMenu(s32 state)
switch (state)
{
case 0:
- sub_81CA9C8();
- sub_81CA2DC();
- sub_81C7FC4(7, 0);
+ ResetBldCnt();
+ SetupPokenavMenuOptions();
+ HideMainOrSubMenuLeftHeader(POKENAV_GFX_SEARCH_MENU, 0);
return LT_INC_AND_PAUSE;
case 1:
if (AreMenuOptionSpritesMoving())
return LT_PAUSE;
- if (sub_81C8010())
+ if (AreLeftHeaderSpritesMoving())
return LT_PAUSE;
sub_81CA0C8();
return LT_INC_AND_PAUSE;
case 2:
- sub_81CA20C();
+ SetupCurrentMenuOptionsGfx();
PrintCurrentOptionDescription();
return LT_INC_AND_PAUSE;
case 3:
if (AreMenuOptionSpritesMoving())
return LT_PAUSE;
- if (sub_81CA89C())
+ if (IsTaskActive_UpdateBgDotsPalette())
return LT_PAUSE;
- sub_81CA9D8();
+ InitMenuOptionGlow();
break;
}
return LT_FINISH;
@@ -714,19 +714,19 @@ static u32 LoopedTask_OpenPokenavFeature(s32 state)
case 1:
if (WaitForHelpBar())
return LT_PAUSE;
- sub_81C7880();
- sub_81CA9C8();
- sub_81CA2DC();
+ SlideMenuHeaderUp();
+ ResetBldCnt();
+ SetupPokenavMenuOptions();
switch (GetPokenavMenuType())
{
case POKENAV_MENU_TYPE_CONDITION_SEARCH:
- sub_81C7FC4(7, FALSE);
+ HideMainOrSubMenuLeftHeader(POKENAV_GFX_SEARCH_MENU, FALSE);
// fallthrough
case POKENAV_MENU_TYPE_CONDITION:
- sub_81C7FC4(1, FALSE);
+ HideMainOrSubMenuLeftHeader(POKENAV_GFX_CONDITION_MENU, FALSE);
break;
default:
- sub_81C7FC4(0, FALSE);
+ HideMainOrSubMenuLeftHeader(POKENAV_GFX_MAIN_MENU, FALSE);
break;
}
PlaySE(SE_SELECT);
@@ -734,7 +734,7 @@ static u32 LoopedTask_OpenPokenavFeature(s32 state)
case 2:
if (AreMenuOptionSpritesMoving())
return LT_PAUSE;
- if (sub_81C8010())
+ if (AreLeftHeaderSpritesMoving())
return LT_PAUSE;
PokenavFadeScreen(0);
return LT_INC_AND_PAUSE;
@@ -746,16 +746,16 @@ static u32 LoopedTask_OpenPokenavFeature(s32 state)
return LT_FINISH;
}
-static void sub_81C9FC4(void)
+static void LoadPokenavOptionPalettes(void)
{
s32 i;
- for (i = 0; i < NELEMS(gUnknown_086201C4); i++)
- LoadCompressedSpriteSheet(&gUnknown_086201C4[i]);
- Pokenav_AllocAndLoadPalettes(gUnknown_086201D4);
+ for (i = 0; i < NELEMS(sPokenavOptionsSpriteSheets); i++)
+ LoadCompressedSpriteSheet(&sPokenavOptionsSpriteSheets[i]);
+ Pokenav_AllocAndLoadPalettes(sPokenavOptionsSpritePalettes);
}
-static void sub_81C9FEC(void)
+static void FreeAndDestroyMainMenuSprites(void)
{
FreeSpriteTilesByTag(3);
FreeSpriteTilesByTag(1);
@@ -765,14 +765,14 @@ static void sub_81C9FEC(void)
FreeSpritePaletteByTag(7);
FreeSpritePaletteByTag(8);
FreeSpritePaletteByTag(3);
- sub_81CA094();
- sub_81CA698();
+ DestroyMenuOptionSprites();
+ DestroyRematchBlueLightSpriteId();
}
static void CreateMenuOptionSprites(void)
{
s32 i, j;
- struct Pokenav2Struct * unk = GetSubstructPtr(2);
+ struct Pokenav2Struct * unk = GetSubstructPtr(POKENAV_SUBSTRUCT_MENU_ICONS);
for (i = 0; i < MAX_POKENAV_MENUITEMS; i++)
{
@@ -786,10 +786,10 @@ static void CreateMenuOptionSprites(void)
}
}
-static void sub_81CA094(void)
+static void DestroyMenuOptionSprites(void)
{
s32 i, j;
- struct Pokenav2Struct * unk = GetSubstructPtr(2);
+ struct Pokenav2Struct * unk = GetSubstructPtr(POKENAV_SUBSTRUCT_MENU_ICONS);
for (i = 0; i < MAX_POKENAV_MENUITEMS; i++)
{
@@ -804,25 +804,25 @@ static void sub_81CA094(void)
static void sub_81CA0C8(void)
{
s32 menuType = GetPokenavMenuType();
- sub_81CA0EC(gUnknown_08620240[menuType].unk4, gUnknown_08620240[menuType].unk0, gUnknown_08620240[menuType].unk2);
+ DrawOptionLabelGfx(sPokenavMenuOptionLabelGfx[menuType].tiles, sPokenavMenuOptionLabelGfx[menuType].yStart, sPokenavMenuOptionLabelGfx[menuType].deltaY);
}
-static void sub_81CA0EC(const u16 *const *a0, s32 a1, s32 a2)
+static void DrawOptionLabelGfx(const u16 *const *tiles, s32 yPos, s32 deltaY)
{
s32 i, j;
- struct Pokenav2Struct * unk = GetSubstructPtr(2);
+ struct Pokenav2Struct * unk = GetSubstructPtr(POKENAV_SUBSTRUCT_MENU_ICONS);
s32 sp04 = GetSpriteTileStartByTag(3);
for (i = 0; i < MAX_POKENAV_MENUITEMS; i++)
{
- if (*a0 != NULL)
+ if (*tiles != NULL)
{
for (j = 0; j < 4; j++)
{
- unk->iconSprites[i][j]->oam.tileNum = (*a0)[0] + sp04 + 8 * j;
- unk->iconSprites[i][j]->oam.paletteNum = IndexOfSpritePaletteTag((*a0)[1] + 4);
+ unk->iconSprites[i][j]->oam.tileNum = (*tiles)[0] + sp04 + 8 * j;
+ unk->iconSprites[i][j]->oam.paletteNum = IndexOfSpritePaletteTag((*tiles)[1] + 4);
unk->iconSprites[i][j]->invisible = TRUE;
- unk->iconSprites[i][j]->pos1.y = a1;
+ unk->iconSprites[i][j]->pos1.y = yPos;
unk->iconSprites[i][j]->pos1.x = 0x8c;
unk->iconSprites[i][j]->pos2.x = 32 * j;
}
@@ -836,76 +836,78 @@ static void sub_81CA0EC(const u16 *const *a0, s32 a1, s32 a2)
}
unk->iconVisible[i] = FALSE;
}
- a0++;
- a1 += a2;
+ tiles++;
+ yPos += deltaY;
}
}
-static void sub_81CA20C(void)
+static void SetupCurrentMenuOptionsGfx(void)
{
s32 i;
- struct Pokenav2Struct * unk = GetSubstructPtr(2);
+ struct Pokenav2Struct *icons = GetSubstructPtr(POKENAV_SUBSTRUCT_MENU_ICONS);
s32 r8 = GetPokenavCursorPos();
s32 r7 = 0;
s32 r2;
for (i = 0; i < MAX_POKENAV_MENUITEMS; i++)
{
- if (unk->iconVisible[i])
+ if (icons->iconVisible[i])
{
if (r7++ == r8)
{
r2 = 0x82;
- unk->cursorPos = i;
+ icons->cursorPos = i;
}
else
r2 = 0x8c;
- sub_81CA35C(unk->iconSprites[i], 0x100, r2, 0xC);
- sub_81CA448(unk->iconSprites[i], FALSE);
+ SetMenuOptionGfxParamsInactive(icons->iconSprites[i], 0x100, r2, 0xC);
+ SetMenuOptionGfxInvisibility(icons->iconSprites[i], FALSE);
}
else
- sub_81CA448(unk->iconSprites[i], TRUE);
+ {
+ SetMenuOptionGfxInvisibility(icons->iconSprites[i], TRUE);
+ }
}
}
-static void sub_81CA278(void)
+static void SetMenuOptionGfxParams_CursorMoved(void)
{
s32 i;
- struct Pokenav2Struct * unk = GetSubstructPtr(2);
- s32 r3 = GetPokenavCursorPos();
- s32 r5;
+ struct Pokenav2Struct *icons = GetSubstructPtr(POKENAV_SUBSTRUCT_MENU_ICONS);
+ s32 prevPos = GetPokenavCursorPos();
+ s32 newPos;
- for (i = 0, r5 = 0; i < MAX_POKENAV_MENUITEMS; i++)
+ for (i = 0, newPos = 0; i < MAX_POKENAV_MENUITEMS; i++)
{
- if (unk->iconVisible[i])
+ if (icons->iconVisible[i])
{
- if (r5 == r3)
+ if (newPos == prevPos)
{
- r5 = i;
+ newPos = i;
break;
}
- r5++;
+ newPos++;
}
}
- sub_81CA35C(unk->iconSprites[unk->cursorPos], 0x82, 0x8c, 0x4);
- sub_81CA35C(unk->iconSprites[r5], 0x8c, 0x82, 0x4);
- unk->cursorPos = r5;
+ SetMenuOptionGfxParamsInactive(icons->iconSprites[icons->cursorPos], 0x82, 0x8c, 0x4);
+ SetMenuOptionGfxParamsInactive(icons->iconSprites[newPos], 0x8c, 0x82, 0x4);
+ icons->cursorPos = newPos;
}
-static void sub_81CA2DC(void)
+static void SetupPokenavMenuOptions(void)
{
s32 i;
- struct Pokenav2Struct * unk = GetSubstructPtr(2);
+ struct Pokenav2Struct *optionIcons = GetSubstructPtr(POKENAV_SUBSTRUCT_MENU_ICONS);
for (i = 0; i < MAX_POKENAV_MENUITEMS; i++)
{
- if (unk->iconVisible[i])
+ if (optionIcons->iconVisible[i])
{
- if (unk->cursorPos != i)
- sub_81CA35C(unk->iconSprites[i], 0x8C, 0x100, 0x8);
+ if (optionIcons->cursorPos != i)
+ SetMenuOptionGfxParamsInactive(optionIcons->iconSprites[i], 0x8C, 0x100, 0x8);
else
- sub_81CA3B4(unk->iconSprites[i]);
+ SetMenuOptionGfxParamsActive(optionIcons->iconSprites[i]);
}
}
}
@@ -913,40 +915,40 @@ static void sub_81CA2DC(void)
static bool32 AreMenuOptionSpritesMoving(void)
{
s32 i;
- struct Pokenav2Struct * unk = GetSubstructPtr(2);
+ struct Pokenav2Struct *icons = GetSubstructPtr(POKENAV_SUBSTRUCT_MENU_ICONS);
for (i = 0; i < MAX_POKENAV_MENUITEMS; i++)
{
- if (unk->iconSprites[i][0]->callback != SpriteCallbackDummy)
+ if (icons->iconSprites[i][0]->callback != SpriteCallbackDummy)
return TRUE;
}
- if (unk->otherIconsInMotion)
+ if (icons->otherIconsInMotion)
return TRUE;
return FALSE;
}
-static void sub_81CA35C(struct Sprite ** sprites, s32 a1, s32 a2, s32 a3)
+static void SetMenuOptionGfxParamsInactive(struct Sprite ** sprites, s32 x, s32 a2, s32 a3)
{
s32 i;
for (i = 0; i < 4; i++)
{
- (*sprites)->pos1.x = a1;
+ (*sprites)->pos1.x = x;
(*sprites)->data[0] = a3;
- (*sprites)->data[1] = 16 * (a2 - a1) / a3;
- (*sprites)->data[2] = 16 * a1;
+ (*sprites)->data[1] = 16 * (a2 - x) / a3;
+ (*sprites)->data[2] = 16 * x;
(*sprites)->data[7] = a2;
(*sprites)->callback = sub_81CA474;
sprites++;
}
}
-static void sub_81CA3B4(struct Sprite ** sprites)
+static void SetMenuOptionGfxParamsActive(struct Sprite ** sprites)
{
s32 i;
- struct Pokenav2Struct * unk = GetSubstructPtr(2);
+ struct Pokenav2Struct * unk = GetSubstructPtr(POKENAV_SUBSTRUCT_MENU_ICONS);
u8 taskId;
for (i = 0; i < 4; i++)
@@ -968,13 +970,13 @@ static void sub_81CA3B4(struct Sprite ** sprites)
unk->otherIconsInMotion++;
}
-static void sub_81CA448(struct Sprite ** sprites, bool32 a1)
+static void SetMenuOptionGfxInvisibility(struct Sprite ** sprites, bool32 invisible)
{
s32 i;
for (i = 0; i < 4; i++)
{
- (*sprites)->invisible = a1;
+ (*sprites)->invisible = invisible;
sprites++;
}
}
@@ -1078,7 +1080,7 @@ static void sub_81CA580(u8 taskId)
data[4]++;
if (data[4] == 12)
{
- ((struct Pokenav2Struct *)GetSubstructPtr(2))->otherIconsInMotion--;
+ ((struct Pokenav2Struct *)GetSubstructPtr(POKENAV_SUBSTRUCT_MENU_ICONS))->otherIconsInMotion--;
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0x00, 0x10));
DestroyTask(taskId);
}
@@ -1089,24 +1091,24 @@ static void sub_81CA580(u8 taskId)
data[0]--;
}
-static void sub_81CA640(void)
+static void CreateMatchCallBlueLightSprite(void)
{
- struct Pokenav2Struct * ptr = GetSubstructPtr(2);
- u8 spriteId = CreateSprite(&gUnknown_0862036C, 0x10, 0x60, 4);
- ptr->field_028 = &gSprites[spriteId];
- if (sub_81C98D4())
- ptr->field_028->callback = sub_81CA6AC;
+ struct Pokenav2Struct * ptr = GetSubstructPtr(POKENAV_SUBSTRUCT_MENU_ICONS);
+ u8 spriteId = CreateSprite(&sMatchCallBlueLightSpriteTemplate, 0x10, 0x60, 4);
+ ptr->blueLightSpriteId = &gSprites[spriteId];
+ if (PlayerHasTrainerRematches())
+ ptr->blueLightSpriteId->callback = SpriteCB_BlinkingBlueLight;
else
- ptr->field_028->invisible = TRUE;
+ ptr->blueLightSpriteId->invisible = TRUE;
}
-static void sub_81CA698(void)
+static void DestroyRematchBlueLightSpriteId(void)
{
- struct Pokenav2Struct * ptr = GetSubstructPtr(2);
- DestroySprite(ptr->field_028);
+ struct Pokenav2Struct *ptr = GetSubstructPtr(POKENAV_SUBSTRUCT_MENU_ICONS);
+ DestroySprite(ptr->blueLightSpriteId);
}
-static void sub_81CA6AC(struct Sprite * sprite)
+static void SpriteCB_BlinkingBlueLight(struct Sprite * sprite)
{
sprite->data[0]++;
if (sprite->data[0] > 8)
@@ -1118,7 +1120,7 @@ static void sub_81CA6AC(struct Sprite * sprite)
static void AddOptionDescriptionWindow(void)
{
- struct Pokenav2Struct * ptr = GetSubstructPtr(2);
+ struct Pokenav2Struct * ptr = GetSubstructPtr(POKENAV_SUBSTRUCT_MENU_ICONS);
ptr->optionDescWindowId = AddWindow(&sOptionDescWindowTemplate);
PutWindowTilemap(ptr->optionDescWindowId);
@@ -1128,7 +1130,7 @@ static void AddOptionDescriptionWindow(void)
static void PrintCurrentOptionDescription(void)
{
- struct Pokenav2Struct * ptr = GetSubstructPtr(2);
+ struct Pokenav2Struct * ptr = GetSubstructPtr(POKENAV_SUBSTRUCT_MENU_ICONS);
int menuItem = GetCurrentMenuItemId();
const u8 * s = sPageDescriptions[menuItem];
u32 width = GetStringWidth(1, s, -1);
@@ -1140,73 +1142,73 @@ static void PrintCurrentOptionDescription(void)
// Can occur by obtaining a mon with a ribbon and then releasing all ribbon winners
static void PrintNoRibbonWinners(void)
{
- struct Pokenav2Struct * ptr = GetSubstructPtr(2);
+ struct Pokenav2Struct * ptr = GetSubstructPtr(POKENAV_SUBSTRUCT_MENU_ICONS);
const u8 * s = gText_NoRibbonWinners;
u32 width = GetStringWidth(1, s, -1);
FillWindowPixelBuffer(ptr->optionDescWindowId, PIXEL_FILL(6));
AddTextPrinterParameterized3(ptr->optionDescWindowId, 1, (192 - width) / 2, 1, sOptionDescTextColors2, 0, s);
}
-static bool32 sub_81CA7C4(void)
+static bool32 IsDma3ManagerBusyWithBgCopy_(void)
{
return IsDma3ManagerBusyWithBgCopy();
}
-static void sub_81CA7D4(void)
+static void CreateMovingBgDotsTask(void)
{
- struct Pokenav2Struct * ptr = GetSubstructPtr(2);
- ptr->bg3ScrollTaskId = CreateTask(sub_81CA808, 2);
+ struct Pokenav2Struct * ptr = GetSubstructPtr(POKENAV_SUBSTRUCT_MENU_ICONS);
+ ptr->bg3ScrollTaskId = CreateTask(Task_MoveBgDots, 2);
}
-static void sub_81CA7F4(void)
+static void DestroyMovingDotsBgTask(void)
{
- struct Pokenav2Struct * ptr = GetSubstructPtr(2);
+ struct Pokenav2Struct * ptr = GetSubstructPtr(POKENAV_SUBSTRUCT_MENU_ICONS);
DestroyTask(ptr->bg3ScrollTaskId);
}
-static void sub_81CA808(u8 taskId)
+static void Task_MoveBgDots(u8 taskId)
{
ChangeBgX(3, 0x80, 1);
}
-static void sub_81CA818(void)
+static void CreateBgDotPurplePalTask(void)
{
- u8 taskId = CreateTask(sub_81CA8B0, 3);
- SetWordTaskArg(taskId, 1, (uintptr_t)(gUnknown_0861FC78 + 1));
- SetWordTaskArg(taskId, 3, (uintptr_t)(gUnknown_0861FC78 + 7));
+ u8 taskId = CreateTask(Task_UpdateBgDotsPalette, 3);
+ SetWordTaskArg(taskId, 1, (uintptr_t)(sPokenavBgDotsPal + 1));
+ SetWordTaskArg(taskId, 3, (uintptr_t)(sPokenavBgDotsPal + 7));
}
-static void sub_81CA850(void)
+static void ChangeBgDotsColorToPurple(void)
{
- CopyPaletteIntoBufferUnfaded(gUnknown_0861FC78 + 7, 0x31, 4);
+ CopyPaletteIntoBufferUnfaded(sPokenavBgDotsPal + 7, 0x31, 4);
}
-static void sub_81CA864(void)
+static void CreateBgDotLightBluePalTask(void)
{
- u8 taskId = CreateTask(sub_81CA8B0, 3);
- SetWordTaskArg(taskId, 1, (uintptr_t)(gUnknown_0861FC78 + 7));
- SetWordTaskArg(taskId, 3, (uintptr_t)(gUnknown_0861FC78 + 1));
+ u8 taskId = CreateTask(Task_UpdateBgDotsPalette, 3);
+ SetWordTaskArg(taskId, 1, (uintptr_t)(sPokenavBgDotsPal + 7));
+ SetWordTaskArg(taskId, 3, (uintptr_t)(sPokenavBgDotsPal + 1));
}
-static bool32 sub_81CA89C(void)
+static bool32 IsTaskActive_UpdateBgDotsPalette(void)
{
- return FuncIsActiveTask(sub_81CA8B0);
+ return FuncIsActiveTask(Task_UpdateBgDotsPalette);
}
-static void sub_81CA8B0(u8 taskId)
+static void Task_UpdateBgDotsPalette(u8 taskId)
{
u16 sp8[2];
s16 * data = gTasks[taskId].data;
const u16 * pal1 = (const u16 *)GetWordTaskArg(taskId, 1);
const u16 * pal2 = (const u16 *)GetWordTaskArg(taskId, 3);
- sub_81C79BC(pal1, pal2, 2, 12, ++data[0], sp8);
+ PokenavCopyPalette(pal1, pal2, 2, 12, ++data[0], sp8);
LoadPalette(sp8, 0x31, 4);
if (data[0] == 12)
DestroyTask(taskId);
}
-static void sub_81CA914(void)
+static void VBlankCB_PokenavMainMenu(void)
{
TransferPlttBuffer();
LoadOam();
@@ -1214,7 +1216,7 @@ static void sub_81CA914(void)
ScanlineEffect_InitHBlankDmaTransfer();
}
-static void sub_81CA92C(void)
+static void SetupPokenavMenuScanlineEffects(void)
{
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_OBJ | BLDCNT_EFFECT_LIGHTEN);
SetGpuReg(REG_OFFSET_BLDY, 0);
@@ -1223,33 +1225,33 @@ static void sub_81CA92C(void)
SetGpuRegBits(REG_OFFSET_WINOUT, 0x1F);
SetGpuRegBits(REG_OFFSET_WIN0V, 0xA0);
ScanlineEffect_Stop();
- sub_81CAA3C();
- ScanlineEffect_SetParams(gUnknown_08620384);
- SetVBlankCallback_(sub_81CA914);
- CreateTask(sub_81CA9EC, 3);
+ SetMenuOptionGlow();
+ ScanlineEffect_SetParams(sPokenavMainMenuScanlineEffectParams);
+ SetVBlankCallback_(VBlankCB_PokenavMainMenu);
+ CreateTask(Task_CurrentMenuOptionGlow, 3);
}
-static void sub_81CA994(void)
+static void DestroyMenuOptionGlowTask(void)
{
SetGpuReg(REG_OFFSET_BLDCNT, 0);
ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON);
ScanlineEffect_Stop();
- DestroyTask(FindTaskIdByFunc(sub_81CA9EC));
+ DestroyTask(FindTaskIdByFunc(Task_CurrentMenuOptionGlow));
SetPokenavVBlankCallback();
}
-static void sub_81CA9C8(void)
+static void ResetBldCnt(void)
{
SetGpuReg(REG_OFFSET_BLDCNT, 0);
}
-static void sub_81CA9D8(void)
+static void InitMenuOptionGlow(void)
{
- sub_81CAA3C();
+ SetMenuOptionGlow();
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_OBJ | BLDCNT_EFFECT_LIGHTEN);
}
-static void sub_81CA9EC(u8 taskId)
+static void Task_CurrentMenuOptionGlow(u8 taskId)
{
s16 * data = gTasks[taskId].data;
data[0]++;
@@ -1262,18 +1264,18 @@ static void sub_81CA9EC(u8 taskId)
}
}
-static void sub_81CAA3C(void)
+static void SetMenuOptionGlow(void)
{
int menuType = GetPokenavMenuType();
int cursorPos = GetPokenavCursorPos();
- int r4 = gUnknown_08620240[menuType].unk2 * cursorPos + gUnknown_08620240[menuType].unk0 - 8;
+ int r4 = sPokenavMenuOptionLabelGfx[menuType].deltaY * cursorPos + sPokenavMenuOptionLabelGfx[menuType].yStart - 8;
CpuFill16(0, gScanlineEffectRegBuffers[0], 0x140);
CpuFill16(0, gScanlineEffectRegBuffers[1], 0x140);
CpuFill16(RGB(16, 23, 28), &gScanlineEffectRegBuffers[0][r4], 0x20);
CpuFill16(RGB(16, 23, 28), &gScanlineEffectRegBuffers[1][r4], 0x20);
}
-void sub_81CAADC(void)
+void ResetBldCnt_(void)
{
- sub_81CA9C8();
+ ResetBldCnt();
}
diff --git a/src/pokenav_region_map.c b/src/pokenav_region_map.c
index e858fad4a..2b846991e 100755
--- a/src/pokenav_region_map.c
+++ b/src/pokenav_region_map.c
@@ -170,11 +170,11 @@ static const struct SpriteTemplate sCityZoomTextSpriteTemplate =
u32 PokenavCallback_Init_RegionMap(void)
{
- struct Pokenav5Struct *state = AllocSubstruct(3, sizeof(struct Pokenav5Struct));
+ struct Pokenav5Struct *state = AllocSubstruct(POKENAV_SUBSTRUCT_REGION_MAP_STATE, sizeof(struct Pokenav5Struct));
if (!state)
return FALSE;
- if (!AllocSubstruct(16, sizeof(struct RegionMap)))
+ if (!AllocSubstruct(POKENAV_SUBSTRUCT_REGION_MAP, sizeof(struct RegionMap)))
return FALSE;
state->zoomDisabled = IsEventIslandMapSecId(gMapHeader.regionMapSectionId);
@@ -189,13 +189,13 @@ u32 PokenavCallback_Init_RegionMap(void)
void FreeRegionMapSubstruct1(void)
{
gSaveBlock2Ptr->regionMapZoom = IsRegionMapZoomed();
- FreePokenavSubstruct(16);
- FreePokenavSubstruct(3);
+ FreePokenavSubstruct(POKENAV_SUBSTRUCT_REGION_MAP);
+ FreePokenavSubstruct(POKENAV_SUBSTRUCT_REGION_MAP_STATE);
}
u32 GetRegionMapCallback(void)
{
- struct Pokenav5Struct *state = GetSubstructPtr(3);
+ struct Pokenav5Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_REGION_MAP_STATE);
return state->callback(state);
}
@@ -235,13 +235,13 @@ static u32 GetExitRegionMapMenuId(struct Pokenav5Struct *state)
bool32 GetZoomDisabled(void)
{
- struct Pokenav5Struct *state = GetSubstructPtr(3);
+ struct Pokenav5Struct *state = GetSubstructPtr(POKENAV_SUBSTRUCT_REGION_MAP_STATE);
return state->zoomDisabled;
}
bool32 OpenPokenavRegionMap(void)
{
- struct Pokenav5Struct_2 *state = AllocSubstruct(4, sizeof(struct Pokenav5Struct_2));
+ struct Pokenav5Struct_2 *state = AllocSubstruct(POKENAV_SUBSTRUCT_REGION_MAP_ZOOM, sizeof(struct Pokenav5Struct_2));
if (!state)
return FALSE;
@@ -252,25 +252,25 @@ bool32 OpenPokenavRegionMap(void)
void CreateRegionMapLoopedTask(s32 index)
{
- struct Pokenav5Struct_2 *state = GetSubstructPtr(4);
+ struct Pokenav5Struct_2 *state = GetSubstructPtr(POKENAV_SUBSTRUCT_REGION_MAP_ZOOM);
state->loopTaskId = CreateLoopedTask(sRegionMapLoopTaskFuncs[index], 1);
state->isTaskActiveCB = GetCurrentLoopedTaskActive;
}
bool32 IsRegionMapLoopedTaskActive(void)
{
- struct Pokenav5Struct_2 *state = GetSubstructPtr(4);
+ struct Pokenav5Struct_2 *state = GetSubstructPtr(POKENAV_SUBSTRUCT_REGION_MAP_ZOOM);
return state->isTaskActiveCB();
}
void FreeRegionMapSubstruct2(void)
{
- struct Pokenav5Struct_2 *state = GetSubstructPtr(4);
+ struct Pokenav5Struct_2 *state = GetSubstructPtr(POKENAV_SUBSTRUCT_REGION_MAP_ZOOM);
FreeRegionMapIconResources();
FreeCityZoomViewGfx();
RemoveWindow(state->infoWindowId);
- FreePokenavSubstruct(16);
- FreePokenavSubstruct(4);
+ FreePokenavSubstruct(POKENAV_SUBSTRUCT_REGION_MAP);
+ FreePokenavSubstruct(POKENAV_SUBSTRUCT_REGION_MAP_ZOOM);
SetPokenavVBlankCallback();
SetBgMode(0);
}
@@ -285,7 +285,7 @@ static void VBlankCB_RegionMap(void)
static bool32 GetCurrentLoopedTaskActive(void)
{
- struct Pokenav5Struct_2 *state = GetSubstructPtr(4);
+ struct Pokenav5Struct_2 *state = GetSubstructPtr(POKENAV_SUBSTRUCT_REGION_MAP_ZOOM);
return IsLoopedTaskActive(state->loopTaskId);
}
@@ -301,7 +301,7 @@ static u32 LoopedTask_OpenRegionMap(s32 taskState)
{
int menuGfxId;
struct RegionMap *regionMap;
- struct Pokenav5Struct_2 *state = GetSubstructPtr(4);
+ struct Pokenav5Struct_2 *state = GetSubstructPtr(POKENAV_SUBSTRUCT_REGION_MAP_ZOOM);
switch (taskState)
{
case 0:
@@ -311,7 +311,7 @@ static u32 LoopedTask_OpenRegionMap(s32 taskState)
HideBg(3);
SetBgMode(1);
InitBgTemplates(sRegionMapBgTemplates, ARRAY_COUNT(sRegionMapBgTemplates) - 1);
- regionMap = GetSubstructPtr(16);
+ regionMap = GetSubstructPtr(POKENAV_SUBSTRUCT_REGION_MAP);
InitRegionMapData(regionMap, &sRegionMapBgTemplates[1], ShouldOpenRegionMapZoomed());
LoadCityZoomViewGfx();
return LT_INC_AND_PAUSE;
@@ -361,11 +361,11 @@ static u32 LoopedTask_OpenRegionMap(s32 taskState)
menuGfxId = POKENAV_GFX_MAP_MENU_ZOOMED_IN;
LoadLeftHeaderGfxForIndex(menuGfxId);
- sub_81C7FA0(menuGfxId, 1, 1);
+ ShowLeftHeaderGfx(menuGfxId, 1, 1);
PokenavFadeScreen(1);
return LT_INC_AND_PAUSE;
case 7:
- if (IsPaletteFadeActive() || sub_81C8010())
+ if (IsPaletteFadeActive() || AreLeftHeaderSpritesMoving())
return LT_PAUSE;
return LT_INC_AND_CONTINUE;
default:
@@ -375,7 +375,7 @@ static u32 LoopedTask_OpenRegionMap(s32 taskState)
static u32 LoopedTask_UpdateInfoAfterCursorMove(s32 taskState)
{
- struct Pokenav5Struct_2 *state = GetSubstructPtr(4);
+ struct Pokenav5Struct_2 *state = GetSubstructPtr(POKENAV_SUBSTRUCT_REGION_MAP_ZOOM);
switch (taskState)
{
case 0:
@@ -409,7 +409,7 @@ static u32 LoopedTask_RegionMapZoomOut(s32 taskState)
if (WaitForHelpBar())
return LT_PAUSE;
- sub_81C7E14(POKENAV_GFX_MAP_MENU_ZOOMED_OUT);
+ UpdateRegionMapRightHeaderTiles(POKENAV_GFX_MAP_MENU_ZOOMED_OUT);
break;
}
@@ -418,7 +418,7 @@ static u32 LoopedTask_RegionMapZoomOut(s32 taskState)
static u32 LoopedTask_RegionMapZoomIn(s32 taskState)
{
- struct Pokenav5Struct_2 *state = GetSubstructPtr(4);
+ struct Pokenav5Struct_2 *state = GetSubstructPtr(POKENAV_SUBSTRUCT_REGION_MAP_ZOOM);
switch (taskState)
{
case 0:
@@ -442,7 +442,7 @@ static u32 LoopedTask_RegionMapZoomIn(s32 taskState)
if (WaitForHelpBar())
return LT_PAUSE;
- sub_81C7E14(POKENAV_GFX_MAP_MENU_ZOOMED_IN);
+ UpdateRegionMapRightHeaderTiles(POKENAV_GFX_MAP_MENU_ZOOMED_IN);
break;
}
@@ -461,8 +461,8 @@ static u32 LoopedTask_ExitRegionMap(s32 taskState)
if (IsPaletteFadeActive())
return LT_PAUSE;
- sub_81C7FDC();
- sub_81C78A0();
+ SetLeftHeaderSpritesInvisibility();
+ SlideMenuHeaderDown();
return LT_INC_AND_PAUSE;
case 2:
if (MainMenuLoopedTaskIsBusy())
@@ -490,7 +490,7 @@ static void LoadCityZoomViewGfx(void)
static void FreeCityZoomViewGfx(void)
{
int i;
- struct Pokenav5Struct_2 *state = GetSubstructPtr(4);
+ struct Pokenav5Struct_2 *state = GetSubstructPtr(POKENAV_SUBSTRUCT_REGION_MAP_ZOOM);
FreeSpriteTilesByTag(6);
FreeSpritePaletteByTag(11);
for (i = 0; i < (int)ARRAY_COUNT(state->cityZoomTextSprites); i++)
@@ -527,7 +527,7 @@ static bool32 TryFreeTempTileDataBuffers(void)
static void UpdateMapSecInfoWindow(struct Pokenav5Struct_2 *state)
{
- struct RegionMap *regionMap = GetSubstructPtr(16);
+ struct RegionMap *regionMap = GetSubstructPtr(POKENAV_SUBSTRUCT_REGION_MAP);
switch (regionMap->mapSecType)
{
case MAPSECTYPE_CITY_CANFLY:
@@ -619,7 +619,7 @@ static bool32 IsDecompressCityMapsActive(void)
static u32 LoopedTask_DecompressCityMaps(s32 taskState)
{
- struct Pokenav5Struct_2 *state = GetSubstructPtr(4);
+ struct Pokenav5Struct_2 *state = GetSubstructPtr(POKENAV_SUBSTRUCT_REGION_MAP_ZOOM);
if (taskState < NUM_CITY_MAPS)
{
LZ77UnCompWram(sPokenavCityMaps[taskState].tilemap, state->cityZoomPics[taskState]);
@@ -662,7 +662,7 @@ static void CreateCityZoomTextSprites(void)
int i;
int y;
struct Sprite *sprite;
- struct Pokenav5Struct_2 *state = GetSubstructPtr(4);
+ struct Pokenav5Struct_2 *state = GetSubstructPtr(POKENAV_SUBSTRUCT_REGION_MAP_ZOOM);
// When not zoomed in the text is still created but its pushed off screen
if (!IsRegionMapZoomed())
@@ -722,7 +722,7 @@ static void SpriteCB_CityZoomText(struct Sprite *sprite)
static void UpdateCityZoomTextPosition(void)
{
int i;
- struct Pokenav5Struct_2 *state = GetSubstructPtr(4);
+ struct Pokenav5Struct_2 *state = GetSubstructPtr(POKENAV_SUBSTRUCT_REGION_MAP_ZOOM);
int y = 132 - (GetBgY(1) >> 8);
for (i = 0; i < (int)ARRAY_COUNT(state->cityZoomTextSprites); i++)
state->cityZoomTextSprites[i]->pos1.y = y;
@@ -731,7 +731,7 @@ static void UpdateCityZoomTextPosition(void)
static void SetCityZoomTextInvisibility(bool32 invisible)
{
int i;
- struct Pokenav5Struct_2 *state = GetSubstructPtr(4);
+ struct Pokenav5Struct_2 *state = GetSubstructPtr(POKENAV_SUBSTRUCT_REGION_MAP_ZOOM);
for (i = 0; i < (int)ARRAY_COUNT(state->cityZoomTextSprites); i++)
state->cityZoomTextSprites[i]->invisible = invisible;
}
diff --git a/src/pokenav_ribbons_1.c b/src/pokenav_ribbons_1.c
index aad0053a8..9c171dd45 100644
--- a/src/pokenav_ribbons_1.c
+++ b/src/pokenav_ribbons_1.c
@@ -8,16 +8,28 @@
#include "international_string_util.h"
#include "constants/songs.h"
+enum
+{
+ RIBBONS_MON_LIST_FUNC_NONE,
+ RIBBONS_MON_LIST_FUNC_MOVE_UP,
+ RIBBONS_MON_LIST_FUNC_MOVE_DOWN,
+ RIBBONS_MON_LIST_FUNC_PAGE_UP,
+ RIBBONS_MON_LIST_FUNC_PAGE_DOWN,
+ RIBBONS_MON_LIST_FUNC_EXIT,
+ RIBBONS_MON_LIST_FUNC_OPEN_RIBBONS_SUMMARY
+};
+
+
struct PokenavSub9
{
- u32 (*unk0)(struct PokenavSub9*);
+ u32 (*callback)(struct PokenavSub9*);
u32 loopedTaskId;
u16 winid;
- s32 unkC;
- s32 unk10;
- u32 unk14;
- u32 unk18;
- struct PokenavSub18 *unk1C;
+ s32 boxId;
+ s32 monId;
+ u32 changeBgs;
+ u32 saveMonList;
+ struct PokenavSub18 *monList;
};
struct PokenavSub10
@@ -25,46 +37,46 @@ struct PokenavSub10
bool32 (*callback)(void);
u32 ltid;
u16 winid;
- bool32 unkC;
+ bool32 fromSummary;
u8 buff[BG_SCREEN_SIZE];
};
-static u32 sub_81CFA68(struct PokenavSub9 *structPtr);
-static u32 sub_81CFA88(struct PokenavSub9 *structPtr);
-static u32 sub_81CFB08(struct PokenavSub9 *structPtr);
+static u32 HandleRibbonsMonListInput_WaitListInit(struct PokenavSub9 *structPtr);
+static u32 HandleRibbonsMonListInput(struct PokenavSub9 *structPtr);
+static u32 RibbonsMonMenu_ReturnToMainMenu(struct PokenavSub9 *structPtr);
static u32 sub_81CFB10(struct PokenavSub9 *structPtr);
-static u32 sub_81CFB8C(s32 state);
-static u32 sub_81CFC2C(s32 state);
-static u32 sub_81CFC40(s32 state);
-static u32 sub_81CFB74(s32 state);
+static u32 BuildPartyMonRibbonList(s32 state);
+static u32 InitBoxMonRibbonList(s32 state);
+static u32 BuildBoxMonRibbonList(s32 state);
+static u32 GetMonRibbonListLoopTaskFunc(s32 state);
static void sub_81CFCEC(struct PokenavSub9 *structPtr, struct PokenavMonList *item);
-static u32 sub_81CFEB8(s32 state);
-static bool32 sub_81CFE84(void);
-static u32 sub_81CFFFC(s32 state);
-static u32 sub_81D0074(s32 state);
-static u32 sub_81D00EC(s32 state);
-static u32 sub_81D0164(s32 state);
-static u32 sub_81D01DC(s32 state);
-static u32 sub_81D021C(s32 state);
+static u32 LoopedTask_OpenRibbonsMonList(s32 state);
+static bool32 GetRibbonsMonCurrentLoopedTaskActive(void);
+static u32 LoopedTask_RibbonsListMoveCursorUp(s32 state);
+static u32 LoopedTask_RibbonsListMoveCursorDown(s32 state);
+static u32 LoopedTask_RibbonsListMovePageUp(s32 state);
+static u32 LoopedTask_RibbonsListMovePageDown(s32 state);
+static u32 LoopedTask_RibbonsListReturnToMainMenu(s32 state);
+static u32 LoopedTask_RibbonsListOpenSummary(s32 state);
static void sub_81D02B0(s32 windowId, s32 val1, s32 val2);
-static void sub_81D024C(struct PokenavSub10 *ptr);
+static void AddRibbonsMonListWindow(struct PokenavSub10 *ptr);
static void sub_81D0288(struct PokenavSub10 *ptr);
-static void sub_81D0304(void);
+static void InitMonRibbonPokenavListMenuTemplate(void);
static void BufferRibbonMonInfoText(struct PokenavMonList *, u8 *);
-static const LoopedTask gUnknown_086235D8[] =
+static const LoopedTask sMonRibbonListLoopTaskFuncs[] =
{
- sub_81CFB8C,
- sub_81CFC2C,
- sub_81CFC40
+ BuildPartyMonRibbonList,
+ InitBoxMonRibbonList,
+ BuildBoxMonRibbonList
};
-static const u16 gUnknown_086235E4[] = INCBIN_U16("graphics/pokenav/ui_ribbons.gbapal");
-static const u32 gUnknown_08623604[] = INCBIN_U32("graphics/pokenav/ui_ribbons.4bpp.lz");
-static const u32 gUnknown_086236CC[] = INCBIN_U32("graphics/pokenav/ui_ribbons.bin.lz");
+static const u16 sMonRibbonListFramePal[] = INCBIN_U16("graphics/pokenav/ui_ribbons.gbapal");
+static const u32 sMonRibbonListFrameTiles[] = INCBIN_U32("graphics/pokenav/ui_ribbons.4bpp.lz");
+static const u32 sMonRibbonListFrameTilemap[] = INCBIN_U32("graphics/pokenav/ui_ribbons.bin.lz");
static const u16 gUnknown_08623790[] = INCBIN_U16("graphics/pokenav/8623790.gbapal");
-static const struct BgTemplate gUnknown_086237B0[] =
+static const struct BgTemplate sMonRibbonListBgTemplates[] =
{
{
.bg = 1,
@@ -85,18 +97,18 @@ static const struct BgTemplate gUnknown_086237B0[] =
}
};
-static const LoopedTask gUnknown_086237B8[] =
+static const LoopedTask sRibbonsMonMenuLoopTaskFuncs[] =
{
- NULL,
- sub_81CFFFC,
- sub_81D0074,
- sub_81D00EC,
- sub_81D0164,
- sub_81D01DC,
- sub_81D021C
+ [RIBBONS_MON_LIST_FUNC_NONE] = NULL,
+ [RIBBONS_MON_LIST_FUNC_MOVE_UP] = LoopedTask_RibbonsListMoveCursorUp,
+ [RIBBONS_MON_LIST_FUNC_MOVE_DOWN] = LoopedTask_RibbonsListMoveCursorDown,
+ [RIBBONS_MON_LIST_FUNC_PAGE_UP] = LoopedTask_RibbonsListMovePageUp,
+ [RIBBONS_MON_LIST_FUNC_PAGE_DOWN] = LoopedTask_RibbonsListMovePageDown,
+ [RIBBONS_MON_LIST_FUNC_EXIT] = LoopedTask_RibbonsListReturnToMainMenu,
+ [RIBBONS_MON_LIST_FUNC_OPEN_RIBBONS_SUMMARY] = LoopedTask_RibbonsListOpenSummary
};
-static const struct WindowTemplate gUnknown_086237D4 =
+static const struct WindowTemplate sRibbonsMonListWindowTemplate =
{
.bg = 1,
.tilemapLeft = 1,
@@ -111,135 +123,136 @@ static const u8 sText_MaleSymbol[] = _("{COLOR_HIGHLIGHT_SHADOW}{LIGHT_RED}{WHIT
static const u8 sText_FemaleSymbol[] = _("{COLOR_HIGHLIGHT_SHADOW}{LIGHT_GREEN}{WHITE}{BLUE}♀{COLOR_HIGHLIGHT_SHADOW}{DARK_GREY}{WHITE}{LIGHT_GREY}");
static const u8 sText_NoGenderSymbol[] = _("{UNK_SPACER}");
-bool32 PokenavCallback_Init_12(void)
+bool32 PokenavCallback_Init_MonRibbonList(void)
{
- struct PokenavSub9 *structPtr = AllocSubstruct(9, sizeof(struct PokenavSub9));
+ struct PokenavSub9 *structPtr = AllocSubstruct(POKENAV_SUBSTRUCT_RIBBONS_MON_LIST, sizeof(struct PokenavSub9));
if (structPtr == NULL)
return FALSE;
- structPtr->unk1C = AllocSubstruct(18, sizeof(struct PokenavSub18));
- if (structPtr->unk1C == NULL)
+ structPtr->monList = AllocSubstruct(POKENAV_SUBSTRUCT_MON_LIST, sizeof(struct PokenavSub18));
+ if (structPtr->monList == NULL)
return FALSE;
- structPtr->unk0 = sub_81CFA68;
- structPtr->loopedTaskId = CreateLoopedTask(sub_81CFB74, 1);
- structPtr->unk14 = 0;
+ structPtr->callback = HandleRibbonsMonListInput_WaitListInit;
+ structPtr->loopedTaskId = CreateLoopedTask(GetMonRibbonListLoopTaskFunc, 1);
+ structPtr->changeBgs = 0;
return TRUE;
}
-bool32 PokenavCallback_Init_14(void)
+bool32 PokenavCallback_Init_RibbonsMonListFromSummary(void)
{
- struct PokenavSub9 *structPtr = AllocSubstruct(9, sizeof(struct PokenavSub9));
+ struct PokenavSub9 *structPtr = AllocSubstruct(POKENAV_SUBSTRUCT_RIBBONS_MON_LIST, sizeof(struct PokenavSub9));
if (structPtr == NULL)
return FALSE;
- structPtr->unk1C = GetSubstructPtr(18);
- structPtr->unk0 = sub_81CFA88;
- structPtr->unk14 = 1;
+ structPtr->monList = GetSubstructPtr(POKENAV_SUBSTRUCT_MON_LIST);
+ structPtr->callback = HandleRibbonsMonListInput;
+ structPtr->changeBgs = 1;
return TRUE;
}
-u32 sub_81CFA34(void)
+u32 GetRibbonsMonListCallback(void)
{
- struct PokenavSub9 *structPtr = GetSubstructPtr(9);
- return structPtr->unk0(structPtr);
+ struct PokenavSub9 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_RIBBONS_MON_LIST);
+ return structPtr->callback(structPtr);
}
-void sub_81CFA48(void)
+void FreeRibbonsMonList1(void)
{
- struct PokenavSub9 *structPtr = GetSubstructPtr(9);
- if (!structPtr->unk18)
- FreePokenavSubstruct(18);
- FreePokenavSubstruct(9);
+ struct PokenavSub9 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_RIBBONS_MON_LIST);
+ if (!structPtr->saveMonList)
+ FreePokenavSubstruct(POKENAV_SUBSTRUCT_MON_LIST);
+ FreePokenavSubstruct(POKENAV_SUBSTRUCT_RIBBONS_MON_LIST);
}
-static u32 sub_81CFA68(struct PokenavSub9 *structPtr)
+static u32 HandleRibbonsMonListInput_WaitListInit(struct PokenavSub9 *structPtr)
{
if (!IsLoopedTaskActive(structPtr->loopedTaskId))
- structPtr->unk0 = sub_81CFA88;
+ structPtr->callback = HandleRibbonsMonListInput;
return 0;
}
-static u32 sub_81CFA88(struct PokenavSub9 *structPtr)
+static u32 HandleRibbonsMonListInput(struct PokenavSub9 *structPtr)
{
- if (gMain.newAndRepeatedKeys & DPAD_UP)
- return 1;
- if (gMain.newAndRepeatedKeys & DPAD_DOWN)
- return 2;
- if (gMain.newKeys & DPAD_LEFT)
- return 3;
- if (gMain.newKeys & DPAD_RIGHT)
- return 4;
- if (gMain.newKeys & B_BUTTON)
+ if (JOY_REPEAT(DPAD_UP))
+ return RIBBONS_MON_LIST_FUNC_MOVE_UP;
+ if (JOY_REPEAT(DPAD_DOWN))
+ return RIBBONS_MON_LIST_FUNC_MOVE_DOWN;
+ if (JOY_NEW(DPAD_LEFT))
+ return RIBBONS_MON_LIST_FUNC_PAGE_UP;
+ if (JOY_NEW(DPAD_RIGHT))
+ return RIBBONS_MON_LIST_FUNC_PAGE_DOWN;
+ if (JOY_NEW(B_BUTTON))
{
- structPtr->unk18 = 0;
- structPtr->unk0 = sub_81CFB08;
- return 5;
+ structPtr->saveMonList = 0;
+ structPtr->callback = RibbonsMonMenu_ReturnToMainMenu;
+ return RIBBONS_MON_LIST_FUNC_EXIT;
}
- if (gMain.newKeys & A_BUTTON)
+ if (JOY_NEW(A_BUTTON))
{
- structPtr->unk1C->unk2 = GetSelectedMatchCall();
- structPtr->unk18 = 1;
- structPtr->unk0 = sub_81CFB10;
- return 6;
+ structPtr->monList->currIndex = GetSelectedPokenavListIndex();
+ structPtr->saveMonList = 1;
+ structPtr->callback = sub_81CFB10;
+ return RIBBONS_MON_LIST_FUNC_OPEN_RIBBONS_SUMMARY;
}
- return 0;
+ return RIBBONS_MON_LIST_FUNC_NONE;
}
-static u32 sub_81CFB08(struct PokenavSub9 *structPtr)
+static u32 RibbonsMonMenu_ReturnToMainMenu(struct PokenavSub9 *structPtr)
{
return POKENAV_MAIN_MENU_CURSOR_ON_RIBBONS;
}
static u32 sub_81CFB10(struct PokenavSub9 *structPtr)
{
- return POKENAV_MENU_D;
+ return POKENAV_RIBBONS_SUMMARY_SCREEN;
}
-static u32 sub_81CFB18(void)
+static u32 UpdateMonListBgs(void)
{
- struct PokenavSub9 *structPtr = GetSubstructPtr(9);
- return structPtr->unk14;
+ struct PokenavSub9 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_RIBBONS_MON_LIST);
+ return structPtr->changeBgs;
}
-static struct PokenavMonList * sub_81CFB28(void)
+static struct PokenavMonList *GetMonRibbonMonListData(void)
{
- struct PokenavSub9 * ptr = GetSubstructPtr(9);
- return ptr->unk1C->unk4;
+ struct PokenavSub9 * ptr = GetSubstructPtr(POKENAV_SUBSTRUCT_RIBBONS_MON_LIST);
+ return ptr->monList->monData;
}
-static s32 sub_81CFB38(void)
+static s32 GetRibbonsMonListCount(void)
{
- struct PokenavSub9 * ptr = GetSubstructPtr(9);
- return ptr->unk1C->unk0;
+ struct PokenavSub9 * ptr = GetSubstructPtr(POKENAV_SUBSTRUCT_RIBBONS_MON_LIST);
+ return ptr->monList->listCount;
}
-static s32 sub_81CFB48(void)
+//unused
+static s32 GetMonRibbonSelectedMonData(void)
{
- struct PokenavSub9 * ptr = GetSubstructPtr(9);
- s32 idx = GetSelectedMatchCall();
- return ptr->unk1C->unk4[idx].data;
+ struct PokenavSub9 * ptr = GetSubstructPtr(POKENAV_SUBSTRUCT_RIBBONS_MON_LIST);
+ s32 idx = GetSelectedPokenavListIndex();
+ return ptr->monList->monData[idx].data;
}
-static s32 sub_81CFB64(void)
+static s32 GetRibbonListMenuCurrIndex(void)
{
- struct PokenavSub9 * ptr = GetSubstructPtr(9);
- return ptr->unk1C->unk2;
+ struct PokenavSub9 * ptr = GetSubstructPtr(POKENAV_SUBSTRUCT_RIBBONS_MON_LIST);
+ return ptr->monList->currIndex;
}
-static u32 sub_81CFB74(s32 state)
+static u32 GetMonRibbonListLoopTaskFunc(s32 state)
{
- return gUnknown_086235D8[state](state);
+ return sMonRibbonListLoopTaskFuncs[state](state);
}
-static u32 sub_81CFB8C(s32 state)
+static u32 BuildPartyMonRibbonList(s32 state)
{
s32 i;
struct PokenavMonList item;
- struct PokenavSub9 * ptr = GetSubstructPtr(9);
+ struct PokenavSub9 * ptr = GetSubstructPtr(POKENAV_SUBSTRUCT_RIBBONS_MON_LIST);
- ptr->unk1C->unk0 = 0;
- ptr->unk1C->unk2 = 0;
+ ptr->monList->listCount = 0;
+ ptr->monList->currIndex = 0;
item.boxId = TOTAL_BOXES_COUNT;
for (i = 0; i < PARTY_SIZE; i++)
{
@@ -261,19 +274,19 @@ static u32 sub_81CFB8C(s32 state)
return LT_INC_AND_CONTINUE;
}
-static u32 sub_81CFC2C(s32 state)
+static u32 InitBoxMonRibbonList(s32 state)
{
- struct PokenavSub9 * ptr = GetSubstructPtr(9);
- ptr->unk10 = 0;
- ptr->unkC = 0;
+ struct PokenavSub9 *ptr = GetSubstructPtr(POKENAV_SUBSTRUCT_RIBBONS_MON_LIST);
+ ptr->monId = 0;
+ ptr->boxId = 0;
return LT_INC_AND_CONTINUE;
}
-static u32 sub_81CFC40(s32 state)
+static u32 BuildBoxMonRibbonList(s32 state)
{
- struct PokenavSub9 * ptr = GetSubstructPtr(9);
- s32 boxId = ptr->unkC;
- s32 monId = ptr->unk10;
+ struct PokenavSub9 * ptr = GetSubstructPtr(POKENAV_SUBSTRUCT_RIBBONS_MON_LIST);
+ s32 boxId = ptr->boxId;
+ s32 monId = ptr->monId;
s32 boxCount = 0;
struct PokenavMonList item;
@@ -296,8 +309,8 @@ static u32 sub_81CFC40(s32 state)
monId++;
if (boxCount > TOTAL_BOXES_COUNT)
{
- ptr->unkC = boxId;
- ptr->unk10 = monId;
+ ptr->boxId = boxId;
+ ptr->monId = monId;
return LT_CONTINUE;
}
}
@@ -305,37 +318,38 @@ static u32 sub_81CFC40(s32 state)
boxId++;
}
- ptr->unk14 = 1;
+ ptr->changeBgs = 1;
return LT_FINISH;
}
static void sub_81CFCEC(struct PokenavSub9 *structPtr, struct PokenavMonList *item)
{
u32 left = 0;
- u32 right = structPtr->unk1C->unk0;
+ u32 right = structPtr->monList->listCount;
u32 insertionIdx = left + (right - left) / 2;
while (right != insertionIdx)
{
- if (item->data > structPtr->unk1C->unk4[insertionIdx].data)
+ if (item->data > structPtr->monList->monData[insertionIdx].data)
right = insertionIdx;
else
left = insertionIdx + 1;
insertionIdx = left + (right - left) / 2;
}
- for (right = structPtr->unk1C->unk0; right > insertionIdx; right--)
- structPtr->unk1C->unk4[right] = structPtr->unk1C->unk4[right - 1];
- structPtr->unk1C->unk4[insertionIdx] = *item;
- structPtr->unk1C->unk0++;
+ for (right = structPtr->monList->listCount; right > insertionIdx; right--)
+ structPtr->monList->monData[right] = structPtr->monList->monData[right - 1];
+ structPtr->monList->monData[insertionIdx] = *item;
+ structPtr->monList->listCount++;
}
-static bool32 sub_81CFD58(void)
+//unused
+static bool32 Unused_PlayerHasRibbonsMon(void)
{
s32 i, j;
for (i = 0; i < PARTY_SIZE; i++)
{
- struct Pokemon * mon = &gPlayerParty[i];
+ struct Pokemon *mon = &gPlayerParty[i];
if (!GetMonData(mon, MON_DATA_SANITY_HAS_SPECIES))
continue;
if (GetMonData(mon, MON_DATA_SANITY_IS_EGG))
@@ -358,72 +372,72 @@ static bool32 sub_81CFD58(void)
return FALSE;
}
-bool32 sub_81CFDD0(void)
+bool32 OpenRibbonsMonList(void)
{
- struct PokenavSub10 * ptr = AllocSubstruct(10, sizeof(struct PokenavSub10));
+ struct PokenavSub10 *ptr = AllocSubstruct(POKENAV_SUBSTRUCT_RIBBONS_MON_MENU, sizeof(struct PokenavSub10));
if (ptr == NULL)
return FALSE;
- ptr->ltid = CreateLoopedTask(sub_81CFEB8, 1);
- ptr->callback = sub_81CFE84;
- ptr->unkC = FALSE;
+ ptr->ltid = CreateLoopedTask(LoopedTask_OpenRibbonsMonList, 1);
+ ptr->callback = GetRibbonsMonCurrentLoopedTaskActive;
+ ptr->fromSummary = FALSE;
return TRUE;
}
-bool32 sub_81CFE08(void)
+bool32 OpenRibbonsMonListFromRibbonsSummary(void)
{
- struct PokenavSub10 * ptr = AllocSubstruct(10, sizeof(struct PokenavSub10));
- if (ptr == NULL)
+ struct PokenavSub10 *monMenu = AllocSubstruct(POKENAV_SUBSTRUCT_RIBBONS_MON_MENU, sizeof(struct PokenavSub10));
+ if (monMenu == NULL)
return FALSE;
- ptr->ltid = CreateLoopedTask(sub_81CFEB8, 1);
- ptr->callback = sub_81CFE84;
- ptr->unkC = TRUE;
+ monMenu->ltid = CreateLoopedTask(LoopedTask_OpenRibbonsMonList, 1);
+ monMenu->callback = GetRibbonsMonCurrentLoopedTaskActive;
+ monMenu->fromSummary = TRUE;
return TRUE;
}
-void sub_81CFE40(s32 idx)
+void CreateRibbonsMonListLoopedTask(s32 idx)
{
- struct PokenavSub10 * ptr = GetSubstructPtr(10);
- ptr->ltid = CreateLoopedTask(gUnknown_086237B8[idx], 1);
- ptr->callback = sub_81CFE84;
+ struct PokenavSub10 *monMenu = GetSubstructPtr(POKENAV_SUBSTRUCT_RIBBONS_MON_MENU);
+ monMenu->ltid = CreateLoopedTask(sRibbonsMonMenuLoopTaskFuncs[idx], 1);
+ monMenu->callback = GetRibbonsMonCurrentLoopedTaskActive;
}
-bool32 sub_81CFE70(void)
+bool32 IsRibbonsMonListLoopedTaskActive(void)
{
- struct PokenavSub10 * ptr = GetSubstructPtr(10);
- return ptr->callback();
+ struct PokenavSub10 *monMenu = GetSubstructPtr(POKENAV_SUBSTRUCT_RIBBONS_MON_MENU);
+ return monMenu->callback();
}
-bool32 sub_81CFE84(void)
+bool32 GetRibbonsMonCurrentLoopedTaskActive(void)
{
- struct PokenavSub10 * ptr = GetSubstructPtr(10);
+ struct PokenavSub10 * ptr = GetSubstructPtr(POKENAV_SUBSTRUCT_RIBBONS_MON_MENU);
return IsLoopedTaskActive(ptr->ltid);
}
-void sub_81CFE98(void)
+void FreeRibbonsMonList2(void)
{
- struct PokenavSub10 * ptr = GetSubstructPtr(10);
+ struct PokenavSub10 * ptr = GetSubstructPtr(POKENAV_SUBSTRUCT_RIBBONS_MON_MENU);
sub_81C8234();
RemoveWindow(ptr->winid);
- FreePokenavSubstruct(10);
+ FreePokenavSubstruct(POKENAV_SUBSTRUCT_RIBBONS_MON_MENU);
}
-static u32 sub_81CFEB8(s32 state)
+static u32 LoopedTask_OpenRibbonsMonList(s32 state)
{
- struct PokenavSub10 * unk = GetSubstructPtr(10);
+ struct PokenavSub10 *monMenu = GetSubstructPtr(POKENAV_SUBSTRUCT_RIBBONS_MON_MENU);
switch (state)
{
case 0:
- InitBgTemplates(gUnknown_086237B0, NELEMS(gUnknown_086237B0));
- DecompressAndCopyTileDataToVram(1, gUnknown_08623604, 0, 0, 0);
- SetBgTilemapBuffer(1, unk->buff);
- CopyToBgTilemapBuffer(1, gUnknown_086236CC, 0, 0);
- CopyPaletteIntoBufferUnfaded(gUnknown_086235E4, 0x10, 0x20);
+ InitBgTemplates(sMonRibbonListBgTemplates, NELEMS(sMonRibbonListBgTemplates));
+ DecompressAndCopyTileDataToVram(1, sMonRibbonListFrameTiles, 0, 0, 0);
+ SetBgTilemapBuffer(1, monMenu->buff);
+ CopyToBgTilemapBuffer(1, sMonRibbonListFrameTilemap, 0, 0);
+ CopyPaletteIntoBufferUnfaded(sMonRibbonListFramePal, 0x10, 0x20);
CopyBgTilemapBufferToVram(1);
return LT_INC_AND_PAUSE;
case 1:
if (FreeTempTileDataBuffersIfPossible())
return LT_PAUSE;
- if (!sub_81CFB18())
+ if (!UpdateMonListBgs())
return LT_PAUSE;
ChangeBgX(1, 0, 0);
ChangeBgY(1, 0, 0);
@@ -433,12 +447,12 @@ static u32 sub_81CFEB8(s32 state)
if (FreeTempTileDataBuffersIfPossible())
return LT_PAUSE;
CopyPaletteIntoBufferUnfaded(gUnknown_08623790, 0x20, 0x20);
- sub_81D0304();
+ InitMonRibbonPokenavListMenuTemplate();
return LT_INC_AND_PAUSE;
case 3:
if (sub_81C8224())
return LT_PAUSE;
- sub_81D024C(unk);
+ AddRibbonsMonListWindow(monMenu);
return LT_INC_AND_PAUSE;
case 4:
if (FreeTempTileDataBuffersIfPossible())
@@ -447,25 +461,25 @@ static u32 sub_81CFEB8(s32 state)
HideBg(3);
PrintHelpBarText(HELPBAR_RIBBONS_MON_LIST);
PokenavFadeScreen(1);
- if (!unk->unkC)
+ if (!monMenu->fromSummary)
{
- LoadLeftHeaderGfxForIndex(2);
- sub_81C7FA0(2, 1, 0);
+ LoadLeftHeaderGfxForIndex(POKENAV_GFX_RIBBONS_MENU);
+ ShowLeftHeaderGfx(POKENAV_GFX_RIBBONS_MENU, 1, 0);
}
return LT_INC_AND_PAUSE;
case 5:
if (IsPaletteFadeActive())
return LT_PAUSE;
- if (sub_81C8010())
+ if (AreLeftHeaderSpritesMoving())
return LT_PAUSE;
break;
}
return LT_FINISH;
}
-static u32 sub_81CFFFC(s32 state)
+static u32 LoopedTask_RibbonsListMoveCursorUp(s32 state)
{
- struct PokenavSub10 * unk = GetSubstructPtr(10);
+ struct PokenavSub10 *monMenu = GetSubstructPtr(POKENAV_SUBSTRUCT_RIBBONS_MON_MENU);
switch (state)
{
case 0:
@@ -482,11 +496,11 @@ static u32 sub_81CFFFC(s32 state)
}
return LT_INC_AND_PAUSE;
case 1:
- if (sub_81C8630())
+ if (IsMonListLoopedTaskActive())
return LT_PAUSE;
// fallthrough
case 2:
- sub_81D0288(unk);
+ sub_81D0288(monMenu);
return LT_INC_AND_PAUSE;
case 3:
if (IsDma3ManagerBusyWithBgCopy())
@@ -496,9 +510,9 @@ static u32 sub_81CFFFC(s32 state)
return LT_FINISH;
}
-static u32 sub_81D0074(s32 state)
+static u32 LoopedTask_RibbonsListMoveCursorDown(s32 state)
{
- struct PokenavSub10 * unk = GetSubstructPtr(10);
+ struct PokenavSub10 *monMenu = GetSubstructPtr(POKENAV_SUBSTRUCT_RIBBONS_MON_MENU);
switch (state)
{
case 0:
@@ -515,11 +529,11 @@ static u32 sub_81D0074(s32 state)
}
return LT_INC_AND_PAUSE;
case 1:
- if (sub_81C8630())
+ if (IsMonListLoopedTaskActive())
return LT_PAUSE;
// fallthrough
case 2:
- sub_81D0288(unk);
+ sub_81D0288(monMenu);
return LT_INC_AND_PAUSE;
case 3:
if (IsDma3ManagerBusyWithBgCopy())
@@ -529,9 +543,9 @@ static u32 sub_81D0074(s32 state)
return LT_FINISH;
}
-static u32 sub_81D00EC(s32 state)
+static u32 LoopedTask_RibbonsListMovePageUp(s32 state)
{
- struct PokenavSub10 * unk = GetSubstructPtr(10);
+ struct PokenavSub10 *monMenu = GetSubstructPtr(POKENAV_SUBSTRUCT_RIBBONS_MON_MENU);
switch (state)
{
case 0:
@@ -548,11 +562,11 @@ static u32 sub_81D00EC(s32 state)
}
return LT_INC_AND_PAUSE;
case 1:
- if (sub_81C8630())
+ if (IsMonListLoopedTaskActive())
return LT_PAUSE;
// fallthrough
case 2:
- sub_81D0288(unk);
+ sub_81D0288(monMenu);
return LT_INC_AND_PAUSE;
case 3:
if (IsDma3ManagerBusyWithBgCopy())
@@ -562,9 +576,9 @@ static u32 sub_81D00EC(s32 state)
return LT_FINISH;
}
-static u32 sub_81D0164(s32 state)
+static u32 LoopedTask_RibbonsListMovePageDown(s32 state)
{
- struct PokenavSub10 * unk = GetSubstructPtr(10);
+ struct PokenavSub10 *monMenu = GetSubstructPtr(POKENAV_SUBSTRUCT_RIBBONS_MON_MENU);
switch (state)
{
case 0:
@@ -581,11 +595,11 @@ static u32 sub_81D0164(s32 state)
}
return LT_INC_AND_PAUSE;
case 1:
- if (sub_81C8630())
+ if (IsMonListLoopedTaskActive())
return LT_PAUSE;
// fallthrough
case 2:
- sub_81D0288(unk);
+ sub_81D0288(monMenu);
return LT_INC_AND_PAUSE;
case 3:
if (IsDma3ManagerBusyWithBgCopy())
@@ -595,27 +609,27 @@ static u32 sub_81D0164(s32 state)
return LT_FINISH;
}
-static u32 sub_81D01DC(s32 state)
+static u32 LoopedTask_RibbonsListReturnToMainMenu(s32 state)
{
switch (state)
{
case 0:
PlaySE(SE_SELECT);
PokenavFadeScreen(0);
- sub_81C78A0();
+ SlideMenuHeaderDown();
return LT_INC_AND_PAUSE;
case 1:
if (IsPaletteFadeActive())
return LT_PAUSE;
if (MainMenuLoopedTaskIsBusy())
return LT_PAUSE;
- sub_81C7FDC();
+ SetLeftHeaderSpritesInvisibility();
break;
}
return LT_FINISH;
}
-static u32 sub_81D021C(s32 state)
+static u32 LoopedTask_RibbonsListOpenSummary(s32 state)
{
switch (state)
{
@@ -631,23 +645,23 @@ static u32 sub_81D021C(s32 state)
return LT_FINISH;
}
-static void sub_81D024C(struct PokenavSub10 * ptr)
+static void AddRibbonsMonListWindow(struct PokenavSub10 *monMenu)
{
s32 r2;
- ptr->winid = AddWindow(&gUnknown_086237D4);
- PutWindowTilemap(ptr->winid);
- r2 = sub_81CFB38();
- sub_81D02B0(ptr->winid, 0, r2);
- CopyWindowToVram(ptr->winid, 1);
- sub_81D0288(ptr);
+ monMenu->winid = AddWindow(&sRibbonsMonListWindowTemplate);
+ PutWindowTilemap(monMenu->winid);
+ r2 = GetRibbonsMonListCount();
+ sub_81D02B0(monMenu->winid, 0, r2);
+ CopyWindowToVram(monMenu->winid, 1);
+ sub_81D0288(monMenu);
}
-static void sub_81D0288(struct PokenavSub10 * ptr)
+static void sub_81D0288(struct PokenavSub10 *monMenu)
{
- s32 r4 = GetSelectedMatchCall();
- s32 r2 = sub_81CFB38();
- sub_81D02B0(ptr->winid, r4 + 1, r2);
- CopyWindowToVram(ptr->winid, 2);
+ s32 r4 = GetSelectedPokenavListIndex();
+ s32 r2 = GetRibbonsMonListCount();
+ sub_81D02B0(monMenu->winid, r4 + 1, r2);
+ CopyWindowToVram(monMenu->winid, 2);
}
static void sub_81D02B0(s32 windowId, s32 val1, s32 val2)
@@ -663,22 +677,22 @@ static void sub_81D02B0(s32 windowId, s32 val1, s32 val2)
AddTextPrinterParameterized(windowId, 1, strbuf, x, 1, 0xFF, NULL);
}
-static void sub_81D0304(void)
+static void InitMonRibbonPokenavListMenuTemplate(void)
{
struct PokenavListTemplate template;
- template.list.monList = sub_81CFB28();
- template.unk4 = sub_81CFB38();
+ template.list.monList = GetMonRibbonMonListData();
+ template.count = GetRibbonsMonListCount();
template.unk8 = 4;
- template.unk6 = sub_81CFB64();
- template.unk9 = 13;
- template.unkA = 17;
- template.unkB = 1;
- template.unkC = 8;
- template.unkD = 2;
- template.unkE = 1;
- template.listFunc.unk10_1 = BufferRibbonMonInfoText;
+ template.unk6 = GetRibbonListMenuCurrIndex();
+ template.item_X = 13;
+ template.windowWidth = 17;
+ template.listTop = 1;
+ template.maxShowed = 8;
+ template.fillValue = 2;
+ template.fontId = 1;
+ template.listFunc.printMonFunc = BufferRibbonMonInfoText;
template.unk14 = NULL;
- sub_81C81D4(&gUnknown_086237B0[1], &template, 0);
+ sub_81C81D4(&sMonRibbonListBgTemplates[1], &template, 0);
}
// Buffers the "Nickname gender/level" text for the ribbon mon list
diff --git a/src/pokenav_ribbons_2.c b/src/pokenav_ribbons_2.c
index e5a89acad..203aa19e5 100644
--- a/src/pokenav_ribbons_2.c
+++ b/src/pokenav_ribbons_2.c
@@ -13,28 +13,38 @@
#include "window.h"
#include "constants/songs.h"
+enum
+{
+ RIBBONS_SUMMARY_FUNC_NONE,
+ RIBBONS_SUMMARY_FUNC_MOVED_CURSOR,
+ RIBBONS_SUMMARY_FUNC_SELECT_RIBBON,
+ RIBBONS_SUMMARY_FUNC_EXPANDED_CURSOR_MOVE,
+ RIBBONS_SUMMARY_FUNC_EXPANDED_CANCEL,
+ RIBBONS_SUMMARY_FUNC_EXIT,
+};
+
struct PokenavSub13
{
u8 filler0[0x8];
- struct PokenavSub18 *field_8;
+ struct PokenavSub18 *monList;
u16 field_C;
u16 field_E;
u16 field_10;
u16 field_12;
u32 field_14[25];
u32 field_78[8];
- u32 (*field_98)(struct PokenavSub13 *structPtr);
+ u32 (*callback)(struct PokenavSub13 *structPtr);
};
struct PokenavSub14
{
- u32 (*field_0)(void);
+ u32 (*callback)(void);
u32 loopedTaskId;
- u16 field_8;
- u16 field_A;
- u16 field_C;
+ u16 nameWindowId;
+ u16 ribbonCountWindowId;
+ u16 listIdxWindowId;
u16 field_E;
- u16 field_10;
+ u16 monSpriteId;
struct Sprite *field_14;
u32 filler;
u8 tilemapBuffers[2][BG_SCREEN_SIZE];
@@ -43,48 +53,48 @@ struct PokenavSub14
static u32 gUnknown_030012C0;
static u32 gUnknown_030012C4;
-void sub_81D0E84(struct PokenavSub14 *structPtr);
-void sub_81D0FF0(struct PokenavSub14 *structPtr);
-void sub_81D10D0(struct PokenavSub14 *structPtr);
+void PrintCurrentMonRibbonCount(struct PokenavSub14 *structPtr);
+void PrintRibbbonsSummaryMonInfo(struct PokenavSub14 *structPtr);
+void PrintRibbonsMonListIndex(struct PokenavSub14 *structPtr);
void sub_81D1500(struct PokenavSub14 *structPtr);
void sub_81D0EFC(struct PokenavSub14 *structPtr);
-void sub_81D1148(struct PokenavSub14 *structPtr);
-void sub_81D10A4(struct PokenavSub14 *structPtr);
-void sub_81D1178(struct PokenavSub14 *structPtr);
+void ResetSpritesAndDrawRibbonsMonFrontPic(struct PokenavSub14 *structPtr);
+void AddRibbonListIndexWindow(struct PokenavSub14 *structPtr);
+void DestroyRibbonsMonFrontPic(struct PokenavSub14 *structPtr);
void sub_81D11D8(struct PokenavSub14 *structPtr);
void sub_81D11FC(struct PokenavSub14 *structPtr);
-void sub_81D0E60(struct PokenavSub14 *structPtr);
+void AddRibbonCountWindow(struct PokenavSub14 *structPtr);
void sub_81D1448(struct PokenavSub14 *structPtr);
void sub_81D13FC(struct PokenavSub14 *structPtr);
-void sub_81D0FCC(struct PokenavSub14 *structPtr);
+void AddRibbonSummaryMonNameWindow(struct PokenavSub14 *structPtr);
void sub_81D12D8(struct PokenavSub14 *structPtr);
bool32 sub_81D1524(struct PokenavSub14 *structPtr);
bool32 sub_81D1234(struct PokenavSub14 *structPtr);
void sub_81D0814(struct PokenavSub13 *structPtr);
-u32 sub_81D0548(struct PokenavSub13 *structPtr);
-u32 sub_81D04C4(struct PokenavSub13 *structPtr);
-u32 sub_81D05D4(struct PokenavSub13 *structPtr);
+u32 HandleExpandedRibbonInput(struct PokenavSub13 *structPtr);
+u32 RibbonsSummaryHandleInput(struct PokenavSub13 *structPtr);
+u32 ReturnToRibbonsListFromSummary(struct PokenavSub13 *structPtr);
bool32 sub_81D05DC(struct PokenavSub13 *structPtr);
bool32 sub_81D0688(struct PokenavSub13 *structPtr);
bool32 sub_81D0664(struct PokenavSub13 *structPtr);
bool32 sub_81D061C(struct PokenavSub13 *structPtr);
bool32 sub_81D0688(struct PokenavSub13 *structPtr);
-bool32 sub_81D0A58(void);
-u32 sub_81D06C4(void);
-u32 sub_81D06D4(void);
-u16 sub_81D1184(s32 unused0, s32 unused1);
+bool32 GetCurrentLoopedTaskActive(void);
+u32 GetRibbonsSummaryCurrentIndex(void);
+u32 GetRibbonsSummaryMonListCount(void);
+u16 DrawRibbonsMonFrontPic(s32 unused0, s32 unused1);
void sub_81D1258(struct Sprite *sprite, s32 arg1, s32 arg2, s32 arg3);
void sub_81D1284(struct Sprite *sprite);
void sub_81D1350(void);
void sub_81D13BC(u16 *dst, u32 id);
void sub_81D1370(u32 arg0, u32 id);
void sub_81D1538(struct Sprite *sprite);
-u32 sub_81D0A6C(s32 state);
-u32 sub_81D0C84(s32 state);
-u32 sub_81D0D2C(s32 state);
-u32 sub_81D0D8C(s32 state);
-u32 sub_81D0E00(s32 state);
-u32 sub_81D0C54(s32 state);
+u32 LoopedTask_OpenRibbonsSummaryMenu(s32 state);
+u32 LoopedTask_UpdateRibbonsSummaryInfo(s32 state);
+u32 LoopedTask_ExpandSelectedRibbon(s32 state);
+u32 LoopedTask_MoveRibbonsCursorExpanded(s32 state);
+u32 LoopedTask_ShrinkExpandedRibbon(s32 state);
+u32 LoopedTask_ExitRibbonsSummaryMenu(s32 state);
struct
{
@@ -147,95 +157,95 @@ static const struct BgTemplate gUnknown_08624B98[] =
}
};
-static const LoopedTask gUnknown_08624BA0[] =
+static const LoopedTask sRibbonsSummaryMenuLoopTaskFuncs[] =
{
- NULL,
- sub_81D0C84,
- sub_81D0D2C,
- sub_81D0D8C,
- sub_81D0E00,
- sub_81D0C54
+ [RIBBONS_SUMMARY_FUNC_NONE] = NULL,
+ [RIBBONS_SUMMARY_FUNC_MOVED_CURSOR] = LoopedTask_UpdateRibbonsSummaryInfo,
+ [RIBBONS_SUMMARY_FUNC_SELECT_RIBBON] = LoopedTask_ExpandSelectedRibbon,
+ [RIBBONS_SUMMARY_FUNC_EXPANDED_CURSOR_MOVE] = LoopedTask_MoveRibbonsCursorExpanded,
+ [RIBBONS_SUMMARY_FUNC_EXPANDED_CANCEL] = LoopedTask_ShrinkExpandedRibbon,
+ [RIBBONS_SUMMARY_FUNC_EXIT] = LoopedTask_ExitRibbonsSummaryMenu
};
// code
-bool32 PokenavCallback_Init_13(void)
+bool32 PokenavCallback_Init_RibbonsSummaryMenu(void)
{
- struct PokenavSub13 *structPtr = AllocSubstruct(13, sizeof(struct PokenavSub13));
+ struct PokenavSub13 *structPtr = AllocSubstruct(POKENAV_SUBSTRUCT_RIBBONS_SUMMARY_LIST, sizeof(struct PokenavSub13));
if (structPtr == NULL)
return FALSE;
- structPtr->field_8 = GetSubstructPtr(18);
- if (structPtr->field_8 == NULL)
+ structPtr->monList = GetSubstructPtr(POKENAV_SUBSTRUCT_MON_LIST);
+ if (structPtr->monList == NULL)
return FALSE;
sub_81D0814(structPtr);
- structPtr->field_98 = sub_81D04C4;
+ structPtr->callback = RibbonsSummaryHandleInput;
gKeyRepeatContinueDelay = 3;
gKeyRepeatStartDelay = 10;
return TRUE;
}
-u32 sub_81D04A0(void)
+u32 GetRibbonsSummaryMenuCallback(void)
{
- struct PokenavSub13 *structPtr = GetSubstructPtr(13);
- return structPtr->field_98(structPtr);
+ struct PokenavSub13 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_RIBBONS_SUMMARY_LIST);
+ return structPtr->callback(structPtr);
}
-void sub_81D04B8(void)
+void FreeRibbonsSummaryScreen1(void)
{
- FreePokenavSubstruct(13);
+ FreePokenavSubstruct(POKENAV_SUBSTRUCT_RIBBONS_SUMMARY_LIST);
}
-u32 sub_81D04C4(struct PokenavSub13 *structPtr)
+u32 RibbonsSummaryHandleInput(struct PokenavSub13 *structPtr)
{
- if (gMain.newAndRepeatedKeys & DPAD_UP && structPtr->field_8->unk2 != 0)
+ if (JOY_REPEAT(DPAD_UP) && structPtr->monList->currIndex != 0)
{
- structPtr->field_8->unk2--;
+ structPtr->monList->currIndex--;
structPtr->field_C = 0;
sub_81D0814(structPtr);
- return 1;
+ return RIBBONS_SUMMARY_FUNC_MOVED_CURSOR;
}
- else if (gMain.newAndRepeatedKeys & DPAD_DOWN && structPtr->field_8->unk2 < structPtr->field_8->unk0 - 1)
+ if (JOY_REPEAT(DPAD_DOWN) && structPtr->monList->currIndex < structPtr->monList->listCount - 1)
{
- structPtr->field_8->unk2++;
+ structPtr->monList->currIndex++;
structPtr->field_C = 0;
sub_81D0814(structPtr);
- return 1;
+ return RIBBONS_SUMMARY_FUNC_MOVED_CURSOR;
}
- else if (gMain.newKeys & A_BUTTON)
+ if (JOY_NEW(A_BUTTON))
{
- structPtr->field_98 = sub_81D0548;
- return 2;
+ structPtr->callback = HandleExpandedRibbonInput;
+ return RIBBONS_SUMMARY_FUNC_SELECT_RIBBON;
}
- else if (gMain.newKeys & B_BUTTON)
+ if (JOY_NEW(B_BUTTON))
{
- structPtr->field_98 = sub_81D05D4;
- return 5;
+ structPtr->callback = ReturnToRibbonsListFromSummary;
+ return RIBBONS_SUMMARY_FUNC_EXIT;
}
- return 0;
+ return RIBBONS_SUMMARY_FUNC_NONE;
}
-u32 sub_81D0548(struct PokenavSub13 *structPtr)
-{
- if (gMain.newAndRepeatedKeys & DPAD_UP && sub_81D05DC(structPtr))
- return 3;
- else if (gMain.newAndRepeatedKeys & DPAD_DOWN && sub_81D061C(structPtr))
- return 3;
- else if (gMain.newAndRepeatedKeys & DPAD_LEFT && sub_81D0664(structPtr))
- return 3;
- else if (gMain.newAndRepeatedKeys & DPAD_RIGHT && sub_81D0688(structPtr))
- return 3;
- else if (gMain.newKeys & B_BUTTON)
+u32 HandleExpandedRibbonInput(struct PokenavSub13 *structPtr)
+{
+ if (JOY_REPEAT(DPAD_UP) && sub_81D05DC(structPtr))
+ return RIBBONS_SUMMARY_FUNC_EXPANDED_CURSOR_MOVE;
+ if (JOY_REPEAT(DPAD_DOWN) && sub_81D061C(structPtr))
+ return RIBBONS_SUMMARY_FUNC_EXPANDED_CURSOR_MOVE;
+ if (JOY_REPEAT(DPAD_LEFT) && sub_81D0664(structPtr))
+ return RIBBONS_SUMMARY_FUNC_EXPANDED_CURSOR_MOVE;
+ if (JOY_REPEAT(DPAD_RIGHT) && sub_81D0688(structPtr))
+ return RIBBONS_SUMMARY_FUNC_EXPANDED_CURSOR_MOVE;
+ if (JOY_NEW(B_BUTTON))
{
- structPtr->field_98 = sub_81D04C4;
- return 4;
+ structPtr->callback = RibbonsSummaryHandleInput;
+ return RIBBONS_SUMMARY_FUNC_EXPANDED_CANCEL;
}
- return 0;
+ return RIBBONS_SUMMARY_FUNC_NONE;
}
-u32 sub_81D05D4(struct PokenavSub13 *structPtr)
+u32 ReturnToRibbonsListFromSummary(struct PokenavSub13 *structPtr)
{
- return POKENAV_MENU_E;
+ return POKENAV_RIBBONS_RETURN_TO_MON_LIST;
}
bool32 sub_81D05DC(struct PokenavSub13 *structPtr)
@@ -320,23 +330,23 @@ bool32 sub_81D0688(struct PokenavSub13 *structPtr)
return FALSE;
}
-u32 sub_81D06C4(void)
+u32 GetRibbonsSummaryCurrentIndex(void)
{
- struct PokenavSub13 *structPtr = GetSubstructPtr(13);
- return structPtr->field_8->unk2;
+ struct PokenavSub13 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_RIBBONS_SUMMARY_LIST);
+ return structPtr->monList->currIndex;
}
-u32 sub_81D06D4(void)
+u32 GetRibbonsSummaryMonListCount(void)
{
- struct PokenavSub13 *structPtr = GetSubstructPtr(13);
- return structPtr->field_8->unk0;
+ struct PokenavSub13 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_RIBBONS_SUMMARY_LIST);
+ return structPtr->monList->listCount;
}
static void GetCurrMonInfo1(u8 *nick, u8 *level, u8 *gender)
{
- struct PokenavSub13 *structPtr = GetSubstructPtr(13);
- struct PokenavSub18 *mons = structPtr->field_8;
- struct PokenavMonList *monInfo = &mons->unk4[mons->unk2];
+ struct PokenavSub13 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_RIBBONS_SUMMARY_LIST);
+ struct PokenavSub18 *mons = structPtr->monList;
+ struct PokenavMonList *monInfo = &mons->monData[mons->currIndex];
if (monInfo->boxId == TOTAL_BOXES_COUNT)
{
@@ -357,9 +367,9 @@ static void GetCurrMonInfo1(u8 *nick, u8 *level, u8 *gender)
static void GetCurrMonInfo2(u16 *species, u32 *personality, u32 *otId)
{
- struct PokenavSub13 *structPtr = GetSubstructPtr(13);
- struct PokenavSub18 *mons = structPtr->field_8;
- struct PokenavMonList *monInfo = &mons->unk4[mons->unk2];
+ struct PokenavSub13 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_RIBBONS_SUMMARY_LIST);
+ struct PokenavSub18 *mons = structPtr->monList;
+ struct PokenavMonList *monInfo = &mons->monData[mons->currIndex];
if (monInfo->boxId == TOTAL_BOXES_COUNT)
{
@@ -379,9 +389,9 @@ static void GetCurrMonInfo2(u16 *species, u32 *personality, u32 *otId)
static u32 GetCurrMonRibbonCount(void)
{
- struct PokenavSub13 *structPtr = GetSubstructPtr(13);
- struct PokenavSub18 *mons = structPtr->field_8;
- struct PokenavMonList *monInfo = &mons->unk4[mons->unk2];
+ struct PokenavSub13 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_RIBBONS_SUMMARY_LIST);
+ struct PokenavSub18 *mons = structPtr->monList;
+ struct PokenavMonList *monInfo = &mons->monData[mons->currIndex];
if (monInfo->boxId == TOTAL_BOXES_COUNT)
return GetMonData(&gPlayerParty[monInfo->monId], MON_DATA_RIBBON_COUNT);
@@ -393,8 +403,8 @@ void sub_81D0814(struct PokenavSub13 *structPtr)
{
u32 ribbons;
s32 i, j;
- struct PokenavSub18 *mons = structPtr->field_8;
- struct PokenavMonList *monInfo = &mons->unk4[mons->unk2];
+ struct PokenavSub18 *mons = structPtr->monList;
+ struct PokenavMonList *monInfo = &mons->monData[mons->currIndex];
if (monInfo->boxId == TOTAL_BOXES_COUNT)
ribbons = GetMonData(&gPlayerParty[monInfo->monId], MON_DATA_RIBBONS);
@@ -433,27 +443,27 @@ void sub_81D0814(struct PokenavSub13 *structPtr)
u32 *sub_81D0914(u32 *arg0)
{
- struct PokenavSub13 *structPtr = GetSubstructPtr(13);
+ struct PokenavSub13 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_RIBBONS_SUMMARY_LIST);
*arg0 = structPtr->field_10;
return structPtr->field_14;
}
u32 *sub_81D092C(u32 *arg0)
{
- struct PokenavSub13 *structPtr = GetSubstructPtr(13);
+ struct PokenavSub13 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_RIBBONS_SUMMARY_LIST);
*arg0 = structPtr->field_12;
return structPtr->field_78;
}
u16 sub_81D0944(void)
{
- struct PokenavSub13 *structPtr = GetSubstructPtr(13);
+ struct PokenavSub13 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_RIBBONS_SUMMARY_LIST);
return structPtr->field_C;
}
u32 sub_81D0954(void)
{
- struct PokenavSub13 *structPtr = GetSubstructPtr(13);
+ struct PokenavSub13 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_RIBBONS_SUMMARY_LIST);
int var = structPtr->field_C;
if (var <= 24)
return structPtr->field_14[var];
@@ -461,38 +471,38 @@ u32 sub_81D0954(void)
return structPtr->field_78[var - 27];
}
-bool32 sub_81D0978(void)
+bool32 OpenRibbonsSummaryMenu(void)
{
- struct PokenavSub14 *structPtr = AllocSubstruct(14, sizeof(struct PokenavSub14));
+ struct PokenavSub14 *structPtr = AllocSubstruct(POKENAV_SUBSTRUCT_RIBBONS_SUMMARY_MENU, sizeof(struct PokenavSub14));
if (structPtr == NULL)
return FALSE;
- structPtr->loopedTaskId = CreateLoopedTask(sub_81D0A6C, 1);
- structPtr->field_0 = sub_81D0A58;
+ structPtr->loopedTaskId = CreateLoopedTask(LoopedTask_OpenRibbonsSummaryMenu, 1);
+ structPtr->callback = GetCurrentLoopedTaskActive;
return TRUE;
}
-void sub_81D09B0(s32 id)
+void CreateRibbonsSummaryLoopedTask(s32 id)
{
- struct PokenavSub14 *structPtr = GetSubstructPtr(14);
- structPtr->loopedTaskId = CreateLoopedTask(gUnknown_08624BA0[id], 1);
- structPtr->field_0 = sub_81D0A58;
+ struct PokenavSub14 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_RIBBONS_SUMMARY_MENU);
+ structPtr->loopedTaskId = CreateLoopedTask(sRibbonsSummaryMenuLoopTaskFuncs[id], 1);
+ structPtr->callback = GetCurrentLoopedTaskActive;
}
-u32 sub_81D09E0(void)
+u32 IsRibbonsSummaryLoopedTaskActive(void)
{
- struct PokenavSub14 *structPtr = GetSubstructPtr(14);
- return structPtr->field_0();
+ struct PokenavSub14 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_RIBBONS_SUMMARY_MENU);
+ return structPtr->callback();
}
-void sub_81D09F4(void)
+void FreeRibbonsSummaryScreen2(void)
{
- struct PokenavSub14 *structPtr = GetSubstructPtr(14);
- RemoveWindow(structPtr->field_A);
- RemoveWindow(structPtr->field_8);
- RemoveWindow(structPtr->field_C);
+ struct PokenavSub14 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_RIBBONS_SUMMARY_MENU);
+ RemoveWindow(structPtr->ribbonCountWindowId);
+ RemoveWindow(structPtr->nameWindowId);
+ RemoveWindow(structPtr->listIdxWindowId);
RemoveWindow(structPtr->field_E);
- sub_81D1178(structPtr);
+ DestroyRibbonsMonFrontPic(structPtr);
FreeSpriteTilesByTag(9);
FreeSpritePaletteByTag(0xF);
FreeSpritePaletteByTag(0x10);
@@ -501,18 +511,18 @@ void sub_81D09F4(void)
FreeSpritePaletteByTag(0x13);
FreeSpriteOamMatrix(structPtr->field_14);
DestroySprite(structPtr->field_14);
- FreePokenavSubstruct(14);
+ FreePokenavSubstruct(POKENAV_SUBSTRUCT_RIBBONS_SUMMARY_MENU);
}
-bool32 sub_81D0A58(void)
+bool32 GetCurrentLoopedTaskActive(void)
{
- struct PokenavSub14 *structPtr = GetSubstructPtr(14);
+ struct PokenavSub14 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_RIBBONS_SUMMARY_MENU);
return IsLoopedTaskActive(structPtr->loopedTaskId);
}
-u32 sub_81D0A6C(s32 state)
+u32 LoopedTask_OpenRibbonsSummaryMenu(s32 state)
{
- struct PokenavSub14 *structPtr = GetSubstructPtr(14);
+ struct PokenavSub14 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_RIBBONS_SUMMARY_MENU);
switch (state)
{
case 0:
@@ -539,21 +549,21 @@ u32 sub_81D0A6C(s32 state)
case 2:
if (!FreeTempTileDataBuffersIfPossible())
{
- sub_81D0E60(structPtr);
+ AddRibbonCountWindow(structPtr);
return LT_INC_AND_PAUSE;
}
return LT_PAUSE;
case 3:
if (!FreeTempTileDataBuffersIfPossible())
{
- sub_81D0FCC(structPtr);
+ AddRibbonSummaryMonNameWindow(structPtr);
return LT_INC_AND_PAUSE;
}
return LT_PAUSE;
case 4:
if (!FreeTempTileDataBuffersIfPossible())
{
- sub_81D10A4(structPtr);
+ AddRibbonListIndexWindow(structPtr);
return LT_INC_AND_PAUSE;
}
return LT_PAUSE;
@@ -567,7 +577,7 @@ u32 sub_81D0A6C(s32 state)
case 6:
if (!IsDma3ManagerBusyWithBgCopy())
{
- sub_81D1148(structPtr);
+ ResetSpritesAndDrawRibbonsMonFrontPic(structPtr);
return LT_INC_AND_CONTINUE;
}
return LT_PAUSE;
@@ -598,7 +608,7 @@ u32 sub_81D0A6C(s32 state)
return LT_FINISH;
}
-u32 sub_81D0C54(s32 state)
+u32 LoopedTask_ExitRibbonsSummaryMenu(s32 state)
{
switch (state)
{
@@ -614,9 +624,9 @@ u32 sub_81D0C54(s32 state)
return LT_FINISH;
}
-u32 sub_81D0C84(s32 state)
+u32 LoopedTask_UpdateRibbonsSummaryInfo(s32 state)
{
- struct PokenavSub14 *structPtr = GetSubstructPtr(14);
+ struct PokenavSub14 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_RIBBONS_SUMMARY_MENU);
switch (state)
{
case 0:
@@ -626,7 +636,7 @@ u32 sub_81D0C84(s32 state)
case 1:
if (!sub_81D1234(structPtr))
{
- sub_81D0FF0(structPtr);
+ PrintRibbbonsSummaryMonInfo(structPtr);
return LT_INC_AND_CONTINUE;
}
return LT_PAUSE;
@@ -634,10 +644,10 @@ u32 sub_81D0C84(s32 state)
sub_81D12D8(structPtr);
return LT_INC_AND_CONTINUE;
case 3:
- sub_81D10D0(structPtr);
+ PrintRibbonsMonListIndex(structPtr);
return LT_INC_AND_CONTINUE;
case 4:
- sub_81D0E84(structPtr);
+ PrintCurrentMonRibbonCount(structPtr);
return LT_INC_AND_CONTINUE;
case 5:
if (!IsDma3ManagerBusyWithBgCopy())
@@ -654,9 +664,9 @@ u32 sub_81D0C84(s32 state)
return LT_FINISH;
}
-u32 sub_81D0D2C(s32 state)
+u32 LoopedTask_ExpandSelectedRibbon(s32 state)
{
- struct PokenavSub14 *structPtr = GetSubstructPtr(14);
+ struct PokenavSub14 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_RIBBONS_SUMMARY_MENU);
switch (state)
{
case 0:
@@ -678,9 +688,9 @@ u32 sub_81D0D2C(s32 state)
return LT_FINISH;
}
-u32 sub_81D0D8C(s32 state)
+u32 LoopedTask_MoveRibbonsCursorExpanded(s32 state)
{
- struct PokenavSub14 *structPtr = GetSubstructPtr(14);
+ struct PokenavSub14 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_RIBBONS_SUMMARY_MENU);
switch (state)
{
case 0:
@@ -708,9 +718,9 @@ u32 sub_81D0D8C(s32 state)
return LT_FINISH;
}
-u32 sub_81D0E00(s32 state)
+u32 LoopedTask_ShrinkExpandedRibbon(s32 state)
{
- struct PokenavSub14 *structPtr = GetSubstructPtr(14);
+ struct PokenavSub14 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_RIBBONS_SUMMARY_MENU);
switch (state)
{
case 0:
@@ -720,7 +730,7 @@ u32 sub_81D0E00(s32 state)
case 1:
if (!sub_81D1524(structPtr))
{
- sub_81D0E84(structPtr);
+ PrintCurrentMonRibbonCount(structPtr);
PrintHelpBarText(HELPBAR_RIBBONS_LIST);
return LT_INC_AND_PAUSE;
}
@@ -732,7 +742,7 @@ u32 sub_81D0E00(s32 state)
return LT_FINISH;
}
-static const struct WindowTemplate gUnknown_08624BB8 =
+static const struct WindowTemplate sRibbonCountWindowTemplate =
{
.bg = 2,
.tilemapLeft = 12,
@@ -743,14 +753,14 @@ static const struct WindowTemplate gUnknown_08624BB8 =
.baseBlock = 0x14,
};
-void sub_81D0E60(struct PokenavSub14 *structPtr)
+void AddRibbonCountWindow(struct PokenavSub14 *structPtr)
{
- structPtr->field_A = AddWindow(&gUnknown_08624BB8);
- PutWindowTilemap(structPtr->field_A);
- sub_81D0E84(structPtr);
+ structPtr->ribbonCountWindowId = AddWindow(&sRibbonCountWindowTemplate);
+ PutWindowTilemap(structPtr->ribbonCountWindowId);
+ PrintCurrentMonRibbonCount(structPtr);
}
-void sub_81D0E84(struct PokenavSub14 *structPtr)
+void PrintCurrentMonRibbonCount(struct PokenavSub14 *structPtr)
{
u8 color[] = {TEXT_COLOR_RED, TEXT_COLOR_DARK_GREY, TEXT_COLOR_LIGHT_GREY};
@@ -758,9 +768,9 @@ void sub_81D0E84(struct PokenavSub14 *structPtr)
DynamicPlaceholderTextUtil_Reset();
DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, gStringVar1);
DynamicPlaceholderTextUtil_ExpandPlaceholders(gStringVar4, gText_RibbonsF700);
- FillWindowPixelBuffer(structPtr->field_A, PIXEL_FILL(4));
- AddTextPrinterParameterized3(structPtr->field_A, 1, 0, 1, color, -1, gStringVar4);
- CopyWindowToVram(structPtr->field_A, 2);
+ FillWindowPixelBuffer(structPtr->ribbonCountWindowId, PIXEL_FILL(4));
+ AddTextPrinterParameterized3(structPtr->ribbonCountWindowId, 1, 0, 1, color, -1, gStringVar4);
+ CopyWindowToVram(structPtr->ribbonCountWindowId, 2);
}
void sub_81D0EFC(struct PokenavSub14 *structPtr)
@@ -769,11 +779,11 @@ void sub_81D0EFC(struct PokenavSub14 *structPtr)
u32 ribbonId = sub_81D0954();
u8 color[] = {TEXT_COLOR_RED, TEXT_COLOR_DARK_GREY, TEXT_COLOR_LIGHT_GREY};
- FillWindowPixelBuffer(structPtr->field_A, PIXEL_FILL(4));
+ FillWindowPixelBuffer(structPtr->ribbonCountWindowId, PIXEL_FILL(4));
if (ribbonId < 25)
{
for (i = 0; i < 2; i++)
- AddTextPrinterParameterized3(structPtr->field_A, 1, 0, (i * 16) + 1, color, -1, gRibbonDescriptionPointers[ribbonId][i]);
+ AddTextPrinterParameterized3(structPtr->ribbonCountWindowId, 1, 0, (i * 16) + 1, color, -1, gRibbonDescriptionPointers[ribbonId][i]);
}
else
{
@@ -783,13 +793,13 @@ void sub_81D0EFC(struct PokenavSub14 *structPtr)
ribbonId--;
for (i = 0; i < 2; i++)
- AddTextPrinterParameterized3(structPtr->field_A, 1, 0, (i * 16) + 1, color, -1, gGiftRibbonDescriptionPointers[ribbonId][i]);
+ AddTextPrinterParameterized3(structPtr->ribbonCountWindowId, 1, 0, (i * 16) + 1, color, -1, gGiftRibbonDescriptionPointers[ribbonId][i]);
}
- CopyWindowToVram(structPtr->field_A, 2);
+ CopyWindowToVram(structPtr->ribbonCountWindowId, 2);
}
-static const struct WindowTemplate gUnknown_08624BC4 =
+static const struct WindowTemplate sRibbonSummaryMonNameWindowTemplate =
{
.bg = 2,
.tilemapLeft = 14,
@@ -800,23 +810,23 @@ static const struct WindowTemplate gUnknown_08624BC4 =
.baseBlock = 0x54,
};
-void sub_81D0FCC(struct PokenavSub14 *structPtr)
+void AddRibbonSummaryMonNameWindow(struct PokenavSub14 *structPtr)
{
- structPtr->field_8 = AddWindow(&gUnknown_08624BC4);
- PutWindowTilemap(structPtr->field_8);
- sub_81D0FF0(structPtr);
+ structPtr->nameWindowId = AddWindow(&sRibbonSummaryMonNameWindowTemplate);
+ PutWindowTilemap(structPtr->nameWindowId);
+ PrintRibbbonsSummaryMonInfo(structPtr);
}
static const u8 sMaleIconString[] = _("{COLOR_HIGHLIGHT_SHADOW}{LIGHT_RED}{WHITE}{GREEN}♂{COLOR_HIGHLIGHT_SHADOW}{DARK_GREY}{WHITE}{LIGHT_GREY}");
static const u8 sFemaleIconString[] = _("{COLOR_HIGHLIGHT_SHADOW}{LIGHT_GREEN}{WHITE}{BLUE}♀{COLOR_HIGHLIGHT_SHADOW}{DARK_GREY}{WHITE}{LIGHT_GREY}");
static const u8 sGenderlessIconString[] = _("{UNK_SPACER}");
-void sub_81D0FF0(struct PokenavSub14 *structPtr)
+void PrintRibbbonsSummaryMonInfo(struct PokenavSub14 *structPtr)
{
const u8 *genderTxt;
u8 *txtPtr;
u8 level, gender;
- u16 windowId = structPtr->field_8;
+ u16 windowId = structPtr->nameWindowId;
FillWindowPixelBuffer(windowId, PIXEL_FILL(1));
GetCurrMonInfo1(gStringVar3, &level, &gender);
@@ -843,7 +853,7 @@ void sub_81D0FF0(struct PokenavSub14 *structPtr)
CopyWindowToVram(windowId, 2);
}
-static const struct WindowTemplate gUnknown_08624BE8[] =
+static const struct WindowTemplate sRibbonMonListIndexWindowTemplate[] =
{
{
.bg = 2,
@@ -857,46 +867,46 @@ static const struct WindowTemplate gUnknown_08624BE8[] =
{},
};
-void sub_81D10A4(struct PokenavSub14 *structPtr)
+void AddRibbonListIndexWindow(struct PokenavSub14 *structPtr)
{
- structPtr->field_C = AddWindow(gUnknown_08624BE8);
- FillWindowPixelBuffer(structPtr->field_C, PIXEL_FILL(1));
- PutWindowTilemap(structPtr->field_C);
- sub_81D10D0(structPtr);
+ structPtr->listIdxWindowId = AddWindow(sRibbonMonListIndexWindowTemplate);
+ FillWindowPixelBuffer(structPtr->listIdxWindowId, PIXEL_FILL(1));
+ PutWindowTilemap(structPtr->listIdxWindowId);
+ PrintRibbonsMonListIndex(structPtr);
}
-void sub_81D10D0(struct PokenavSub14 *structPtr)
+void PrintRibbonsMonListIndex(struct PokenavSub14 *structPtr)
{
s32 x;
u8 *txtPtr;
- u32 id = sub_81D06C4() + 1;
- u32 count = sub_81D06D4();
+ u32 id = GetRibbonsSummaryCurrentIndex() + 1;
+ u32 count = GetRibbonsSummaryMonListCount();
txtPtr = ConvertIntToDecimalStringN(gStringVar1, id, STR_CONV_MODE_RIGHT_ALIGN, 3);
*(txtPtr++) = CHAR_SLASH;
ConvertIntToDecimalStringN(txtPtr, count, STR_CONV_MODE_RIGHT_ALIGN, 3);
x = GetStringCenterAlignXOffset(1, gStringVar1, 56);
- AddTextPrinterParameterized(structPtr->field_C, 1, gStringVar1, x, 1, TEXT_SPEED_FF, NULL);
- CopyWindowToVram(structPtr->field_C, 2);
+ AddTextPrinterParameterized(structPtr->listIdxWindowId, 1, gStringVar1, x, 1, TEXT_SPEED_FF, NULL);
+ CopyWindowToVram(structPtr->listIdxWindowId, 2);
}
-void sub_81D1148(struct PokenavSub14 *structPtr)
+void ResetSpritesAndDrawRibbonsMonFrontPic(struct PokenavSub14 *structPtr)
{
u16 species;
u32 personality, otId;
GetCurrMonInfo2(&species, &personality, &otId);
ResetAllPicSprites();
- structPtr->field_10 = sub_81D1184(40, 104);
- sub_81C7990(15, 0);
+ structPtr->monSpriteId = DrawRibbonsMonFrontPic(40, 104);
+ PokenavFillPalette(15, 0);
}
-void sub_81D1178(struct PokenavSub14 *structPtr)
+void DestroyRibbonsMonFrontPic(struct PokenavSub14 *structPtr)
{
- FreeAndDestroyMonPicSprite(structPtr->field_10);
+ FreeAndDestroyMonPicSprite(structPtr->monSpriteId);
}
-u16 sub_81D1184(s32 unused0, s32 unused1)
+u16 DrawRibbonsMonFrontPic(s32 unused0, s32 unused1)
{
u16 species, spriteId;
u32 personality, otId;
@@ -909,19 +919,19 @@ u16 sub_81D1184(s32 unused0, s32 unused1)
void sub_81D11D8(struct PokenavSub14 *structPtr)
{
- sub_81D1258(&gSprites[structPtr->field_10], 40, -32, 6);
+ sub_81D1258(&gSprites[structPtr->monSpriteId], 40, -32, 6);
}
void sub_81D11FC(struct PokenavSub14 *structPtr)
{
- FreeAndDestroyMonPicSprite(structPtr->field_10);
- structPtr->field_10 = sub_81D1184(-32, 104);
- sub_81D1258(&gSprites[structPtr->field_10], -32, 40, 6);
+ FreeAndDestroyMonPicSprite(structPtr->monSpriteId);
+ structPtr->monSpriteId = DrawRibbonsMonFrontPic(-32, 104);
+ sub_81D1258(&gSprites[structPtr->monSpriteId], -32, 40, 6);
}
bool32 sub_81D1234(struct PokenavSub14 *structPtr)
{
- return (gSprites[structPtr->field_10].callback != SpriteCallbackDummy);
+ return (gSprites[structPtr->monSpriteId].callback != SpriteCallbackDummy);
}
void sub_81D1258(struct Sprite *sprite, s32 arg1, s32 arg2, s32 arg3)
diff --git a/src/rayquaza_scene.c b/src/rayquaza_scene.c
index 063e6f324..bc6758cae 100644
--- a/src/rayquaza_scene.c
+++ b/src/rayquaza_scene.c
@@ -14,7 +14,6 @@
#include "decompress.h"
#include "sound.h"
#include "constants/songs.h"
-#include "constants/species.h"
#include "constants/rgb.h"
#include "random.h"
diff --git a/src/record_mixing.c b/src/record_mixing.c
index 7bb3df807..898459c0a 100644
--- a/src/record_mixing.c
+++ b/src/record_mixing.c
@@ -5,7 +5,6 @@
#include "text.h"
#include "item.h"
#include "task.h"
-#include "constants/species.h"
#include "save.h"
#include "load_save.h"
#include "pokemon.h"
diff --git a/src/reshow_battle_screen.c b/src/reshow_battle_screen.c
index 46fc4cd41..d8d75a0e0 100644
--- a/src/reshow_battle_screen.c
+++ b/src/reshow_battle_screen.c
@@ -11,7 +11,6 @@
#include "battle_controllers.h"
#include "link.h"
#include "sprite.h"
-#include "constants/species.h"
#include "constants/trainers.h"
#include "battle_interface.h"
#include "battle_anim.h"
diff --git a/src/roamer.c b/src/roamer.c
index 8a67234e3..d053e5b25 100644
--- a/src/roamer.c
+++ b/src/roamer.c
@@ -4,7 +4,6 @@
#include "random.h"
#include "roamer.h"
#include "constants/maps.h"
-#include "constants/species.h"
enum
{
diff --git a/src/roulette.c b/src/roulette.c
index a0d1a7dc0..b4d1c4463 100644
--- a/src/roulette.c
+++ b/src/roulette.c
@@ -30,7 +30,6 @@
#include "constants/coins.h"
#include "constants/rgb.h"
#include "constants/roulette.h"
-#include "constants/species.h"
#include "constants/songs.h"
#define BALLS_PER_ROUND 6
diff --git a/src/scanline_effect.c b/src/scanline_effect.c
index 0a4b0b8fd..1d5814429 100644
--- a/src/scanline_effect.c
+++ b/src/scanline_effect.c
@@ -100,16 +100,16 @@ void ScanlineEffect_InitHBlankDmaTransfer(void)
static void CopyValue16Bit(void)
{
- u16 *dest = (u16 *)gScanlineEffect.dmaDest;
- u16 *src = (u16 *)&gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer];
+ vu16 *dest = (vu16 *)gScanlineEffect.dmaDest;
+ vu16 *src = (vu16 *)&gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer];
*dest = *src;
}
static void CopyValue32Bit(void)
{
- u32 *dest = (u32 *)gScanlineEffect.dmaDest;
- u32 *src = (u32 *)&gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer];
+ vu32 *dest = (vu32 *)gScanlineEffect.dmaDest;
+ vu32 *src = (vu32 *)&gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer];
*dest = *src;
}
diff --git a/src/script_pokemon_util.c b/src/script_pokemon_util.c
index a7b5433f0..c9a2127ac 100755
--- a/src/script_pokemon_util.c
+++ b/src/script_pokemon_util.c
@@ -22,7 +22,6 @@
#include "string_util.h"
#include "tv.h"
#include "constants/items.h"
-#include "constants/species.h"
#include "constants/tv.h"
#include "constants/battle_frontier.h"
diff --git a/src/secret_base.c b/src/secret_base.c
index 83626710f..8e0929593 100644
--- a/src/secret_base.c
+++ b/src/secret_base.c
@@ -46,7 +46,6 @@
#include "constants/moves.h"
#include "constants/secret_bases.h"
#include "constants/songs.h"
-#include "constants/species.h"
#include "constants/trainers.h"
#include "constants/tv.h"
diff --git a/src/shop.c b/src/shop.c
index 5cba2767d..66f775fb0 100755
--- a/src/shop.c
+++ b/src/shop.c
@@ -984,7 +984,7 @@ static void Task_BuyHowManyDialogueInit(u8 taskId)
u16 maxQuantity;
DrawStdFrameWithCustomTileAndPalette(3, FALSE, 1, 13);
- ConvertIntToDecimalStringN(gStringVar1, quantityInBag, STR_CONV_MODE_RIGHT_ALIGN, 4);
+ ConvertIntToDecimalStringN(gStringVar1, quantityInBag, STR_CONV_MODE_RIGHT_ALIGN, MAX_ITEM_DIGITS + 1);
StringExpandPlaceholders(gStringVar4, gText_InBagVar1);
BuyMenuPrint(3, gStringVar4, 0, 1, 0, 0);
tItemCount = 1;
@@ -1026,7 +1026,7 @@ static void Task_BuyHowManyDialogueHandleInput(u8 taskId)
ClearWindowTilemap(3);
PutWindowTilemap(1);
CopyItemName(tItemId, gStringVar1);
- ConvertIntToDecimalStringN(gStringVar2, tItemCount, STR_CONV_MODE_LEFT_ALIGN, 2);
+ ConvertIntToDecimalStringN(gStringVar2, tItemCount, STR_CONV_MODE_LEFT_ALIGN, BAG_ITEM_CAPACITY_DIGITS);
ConvertIntToDecimalStringN(gStringVar3, gShopDataPtr->totalCost, STR_CONV_MODE_LEFT_ALIGN, 6);
BuyMenuDisplayMessage(taskId, gText_Var1AndYouWantedVar2, BuyMenuConfirmPurchase);
}
@@ -1148,7 +1148,7 @@ static void BuyMenuPrintItemQuantityAndPrice(u8 taskId)
FillWindowPixelBuffer(4, PIXEL_FILL(1));
PrintMoneyAmount(4, 38, 1, gShopDataPtr->totalCost, TEXT_SPEED_FF);
- ConvertIntToDecimalStringN(gStringVar1, tItemCount, STR_CONV_MODE_LEADING_ZEROS, 2);
+ ConvertIntToDecimalStringN(gStringVar1, tItemCount, STR_CONV_MODE_LEADING_ZEROS, BAG_ITEM_CAPACITY_DIGITS);
StringExpandPlaceholders(gStringVar4, gText_xVar1);
BuyMenuPrint(4, gStringVar4, 0, 1, 0, 0);
}
diff --git a/src/starter_choose.c b/src/starter_choose.c
index 2585f3408..771db961e 100644
--- a/src/starter_choose.c
+++ b/src/starter_choose.c
@@ -22,7 +22,6 @@
#include "trig.h"
#include "window.h"
#include "constants/songs.h"
-#include "constants/species.h"
#include "constants/rgb.h"
#define STARTER_MON_COUNT 3
diff --git a/src/trade.c b/src/trade.c
index 3072b8585..e61066dc5 100644
--- a/src/trade.c
+++ b/src/trade.c
@@ -49,7 +49,6 @@
#include "constants/moves.h"
#include "constants/region_map_sections.h"
#include "constants/rgb.h"
-#include "constants/species.h"
#include "constants/songs.h"
#include "constants/union_room.h"
diff --git a/src/trainer_hill.c b/src/trainer_hill.c
index 6bbac91ca..18d56723c 100644
--- a/src/trainer_hill.c
+++ b/src/trainer_hill.c
@@ -29,7 +29,6 @@
#include "constants/layouts.h"
#include "constants/moves.h"
#include "constants/maps.h"
-#include "constants/species.h"
#include "constants/trainers.h"
#include "constants/easy_chat.h"
#include "constants/trainer_hill.h"
@@ -672,17 +671,17 @@ bool32 LoadTrainerHillFloorObjectEventScripts(void)
return TRUE;
}
-static u32 sub_81D5F58(u8 floorId, u32 bit, u32 arg2, u32 arg3)
+static u16 GetMetatileForFloor(u8 floorId, u32 x, u32 y, u32 stride) // stride is always 16
{
- u8 var0;
- u16 var1;
- u16 var2;
+ bool8 impassable;
+ u16 metatile;
+ u16 elevation;
- var0 = (sHillData->floors[floorId].display.unk3A0[arg2] >> (15 - bit)) & 1;
- var1 = sHillData->floors[floorId].display.data[arg2 * arg3 + bit] + 0x200;
- var2 = 0x3000;
+ impassable = (sHillData->floors[floorId].display.collisionData[y] >> (15 - x) & 1);
+ metatile = sHillData->floors[floorId].display.metatileData[stride * y + x] + 0x200;
+ elevation = 0x3000;
- return (((var0 << 10) & 0xc00) | var2) | (var1 & 0x3ff);
+ return (((impassable << 10) & METATILE_COLLISION_MASK) | elevation) | (metatile & METATILE_ID_MASK);
}
void GenerateTrainerHillFloorLayout(u16 *mapArg)
@@ -722,7 +721,7 @@ void GenerateTrainerHillFloorLayout(u16 *mapArg)
for (i = 0; i < 16; i++)
{
for (j = 0; j < 16; j++)
- dst[j] = sub_81D5F58(mapId, j, i, 0x10);
+ dst[j] = GetMetatileForFloor(mapId, j, i, 0x10);
dst += 31;
}
diff --git a/src/trainer_pokemon_sprites.c b/src/trainer_pokemon_sprites.c
index d2cb634f0..c23047b01 100644
--- a/src/trainer_pokemon_sprites.c
+++ b/src/trainer_pokemon_sprites.c
@@ -2,7 +2,6 @@
#include "sprite.h"
#include "window.h"
#include "malloc.h"
-#include "constants/species.h"
#include "palette.h"
#include "decompress.h"
#include "trainer_pokemon_sprites.h"
diff --git a/src/tv.c b/src/tv.c
index 7732bb9b1..17af3edff 100644
--- a/src/tv.c
+++ b/src/tv.c
@@ -42,7 +42,6 @@
#include "constants/moves.h"
#include "constants/region_map_sections.h"
#include "constants/script_menu.h"
-#include "constants/species.h"
#include "constants/tv.h"
// Static type declarations
diff --git a/src/union_room.c b/src/union_room.c
index 1bac3678c..cb9c4018e 100644
--- a/src/union_room.c
+++ b/src/union_room.c
@@ -52,7 +52,6 @@
#include "constants/party_menu.h"
#include "constants/rgb.h"
#include "constants/songs.h"
-#include "constants/species.h"
// States for Task_RunUnionRoom
enum {
diff --git a/src/use_pokeblock.c b/src/use_pokeblock.c
index ebb237d54..1af157b90 100644
--- a/src/use_pokeblock.c
+++ b/src/use_pokeblock.c
@@ -486,7 +486,7 @@ static void LoadUsePokeblockMenu(void)
{
case 0:
sMenu->curMonSpriteId = 0xFF;
- sub_81D1ED4(&sMenu->graph);
+ InitConditionGraphData(&sMenu->graph);
sInfo->mainState++;
break;
case 1:
@@ -536,12 +536,12 @@ static void LoadUsePokeblockMenu(void)
sInfo->mainState++;
break;
case 11:
- sub_81D2754(sMenu->graph.unk0[0], sMenu->graph.unk14[0]);
- sub_81D20AC(&sMenu->graph);
+ sub_81D2754(sMenu->graph.stat[0], sMenu->graph.unk14[0]);
+ InitConditionGraphState(&sMenu->graph);
sInfo->mainState++;
break;
case 12:
- if (!sub_81D20BC(&sMenu->graph))
+ if (!SetupConditionGraphScanlineParams(&sMenu->graph))
{
sub_81D1F84(&sMenu->graph, sMenu->graph.unk14[0], sMenu->graph.unk14[0]);
sInfo->mainState++;
@@ -1368,7 +1368,7 @@ static bool8 LoadUsePokeblockMenuGfx(void)
LoadBgTilemap(2, sMenu->tilemapBuffer, 1280, 0);
LoadPalette(gConditionGraphData_Pal, 48, 32);
LoadPalette(gConditionText_Pal, 240, 32);
- sub_81D21DC(2);
+ SetConditionGraphIOWindows(2);
break;
default:
sMenu->info.helperState = 0;
diff --git a/src/wild_encounter.c b/src/wild_encounter.c
index 492a10101..9f81a3b3e 100644
--- a/src/wild_encounter.c
+++ b/src/wild_encounter.c
@@ -21,7 +21,6 @@
#include "constants/items.h"
#include "constants/layouts.h"
#include "constants/maps.h"
-#include "constants/species.h"
#include "constants/weather.h"
extern const u8 EventScript_RepelWoreOff[];