diff --git a/include/overlay006/battle_params.h b/include/overlay006/battle_params.h index 2eb07f5f36..63b6df4bdd 100644 --- a/include/overlay006/battle_params.h +++ b/include/overlay006/battle_params.h @@ -31,7 +31,7 @@ typedef struct { UnkStruct_0207D99C * unk_E4; UnkStruct_02026324 * unk_E8; PCBoxes * unk_EC; - UnkStruct_0202CC84 * unk_F0[4]; + ChatotCryData * unk_F0[4]; UnkStruct_02056B24 * unk_100; UnkStruct_0202C878 * unk_104; UnkStruct_020279FC * unk_108; diff --git a/include/overlay016/ov16_0223DF00.h b/include/overlay016/ov16_0223DF00.h index 567a5007a0..9460b6a665 100644 --- a/include/overlay016/ov16_0223DF00.h +++ b/include/overlay016/ov16_0223DF00.h @@ -196,7 +196,7 @@ int ov16_0223EDE0(BattleSystem * param0); u8 BattleSystem_TextSpeed(BattleSystem * param0); int BattleSystem_Ruleset(BattleSystem * param0); UnkStruct_02015F84 * ov16_0223EE28(BattleSystem * param0); -UnkStruct_0202CC84 * BattleSystem_ChatotVoice(BattleSystem * param0, int param1); +ChatotCryData * BattleSystem_ChatotVoice(BattleSystem * param0, int param1); void ov16_0223EE70(BattleSystem * param0); void ov16_0223EF2C(BattleSystem * param0, int param1, int param2); void ov16_0223EF48(BattleSystem * param0, Pokemon * param1); diff --git a/include/overlay016/struct_ov16_02264408.h b/include/overlay016/struct_ov16_02264408.h index 15fc1645ca..aee115ceb3 100644 --- a/include/overlay016/struct_ov16_02264408.h +++ b/include/overlay016/struct_ov16_02264408.h @@ -25,7 +25,7 @@ typedef struct { u32 unk_4C[4]; int unk_50; UnkStruct_ov16_02264408_sub1 unk_54; - UnkStruct_0202CC84 * unk_6C; + ChatotCryData * unk_6C; u8 * unk_70; u16 * unk_74; } UnkStruct_ov16_02264408; diff --git a/include/pokemon.h b/include/pokemon.h index 097f45b1e2..94ac9e5b13 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -764,10 +764,10 @@ int Pokemon_LoadLevelUpMoveIdsOf(int monSpecies, int monForm, u16 *monLevelUpMov void Pokemon_ApplyPokerus(Party *party); u8 Pokemon_HasPokerus(Party *party, u8 param1); -void sub_020777B4(Party *party, s32 param1); +void UpdatePokerusStatusInParty(Party *party, s32 param1); void Pokemon_ValidatePokerus(Party *party); -BOOL sub_020778D8(Pokemon *mon); -BOOL sub_020778F8(Pokemon *mon); +BOOL IsPokemonInfectedWithPokerus(Pokemon *mon); +BOOL CanPokemonSpreadPokerus(Pokemon *mon); /** * @brief Sets Arceus' form based on its held item. Has no effect if the given Pokemon is not an Arceus @@ -886,14 +886,14 @@ BOOL Pokemon_SetRotomForm(Pokemon *mon, int monForm, int moveSlot); */ void Pokemon_LoadLevelUpMovesOf(int monSpecies, int monForm, u16 *monLevelUpMoves); -void sub_02077D3C(UnkStruct_0202CC84 *param0, int param1, u16 monSpecies, int param3, int param4, int param5, int param6, int param7); -void sub_02077DB4(UnkStruct_0202CC84 *param0, int param1, u16 monSpecies, int param3, int param4, int param5, int param6, int param7, u8 param8); -BOOL sub_02077E3C(Pokemon *mon); -void sub_02077E64(Pokemon *mon, TrainerInfo *param1, int monPokeball, int param3, int param4, int param5); -void sub_02077EE4(Pokemon *mon, TrainerInfo *param1, int monPokeball, int param3, int param4, int param5); -void sub_02077F0C(Pokemon *mon, u32 param1, int param2); +void HandleChatotSpecialInteraction(ChatotCryData *param0, int param1, u16 monSpecies, int param3, int param4, int param5, int param6, int param7); +void HandleChatotSpecialAction(ChatotCryData *param0, int param1, u16 monSpecies, int param3, int param4, int param5, int param6, int param7, u8 param8); +BOOL IsPokemonEligibleForAction(Pokemon *mon); +void InitializePokemonAfterCapture(Pokemon *mon, TrainerInfo *param1, int monPokeball, int param3, int param4, int param5); +void PostCapturePokemonProcessing(Pokemon *mon, TrainerInfo *param1, int monPokeball, int param3, int param4, int param5); +void AssignHeldItemToPokemon(Pokemon *mon, u32 param1, int param2); BOOL Pokemon_CanLearnTM(Pokemon *mon, u8 tmID); -BOOL Pokemon_CanFormLearnTM(u16 monSpecies, int monForm, u8 tmID); +BOOL CanPokemonFormLearnTM(u16 monSpecies, int monForm, u8 tmID); /** * @brief Sets the ability of a Pokemon based on its species, form and peronsality value diff --git a/include/struct_decls/struct_0202CC84_decl.h b/include/struct_decls/struct_0202CC84_decl.h index 9bd363927f..a8af717922 100644 --- a/include/struct_decls/struct_0202CC84_decl.h +++ b/include/struct_decls/struct_0202CC84_decl.h @@ -1,6 +1,6 @@ #ifndef POKEPLATINUM_STRUCT_0202CC84_DECL_H #define POKEPLATINUM_STRUCT_0202CC84_DECL_H -typedef struct UnkStruct_0202CC84_t UnkStruct_0202CC84; +typedef struct ChatotCryData_t ChatotCryData; #endif // POKEPLATINUM_STRUCT_0202CC84_DECL_H diff --git a/include/struct_defs/battle_system.h b/include/struct_defs/battle_system.h index 9476c55313..19b4246039 100644 --- a/include/struct_defs/battle_system.h +++ b/include/struct_defs/battle_system.h @@ -65,7 +65,7 @@ struct BattleSystem { UnkStruct_02026324 *pokedex; PCBoxes *pcBoxes; Party *parties[4]; - UnkStruct_0202CC84 * unk_78[4]; + ChatotCryData * unk_78[4]; UnkStruct_02007768 * unk_88; UnkStruct_ov12_0221FCDC * unk_8C; UnkStruct_0200C6E4 * unk_90; diff --git a/include/struct_defs/struct_02090800.h b/include/struct_defs/struct_02090800.h index e3317b8381..67d43abc98 100644 --- a/include/struct_defs/struct_02090800.h +++ b/include/struct_defs/struct_02090800.h @@ -12,11 +12,11 @@ typedef struct { UnkStruct_0200B358 * unk_08; Pokemon * unk_0C; BOOL unk_10; - UnkStruct_02090800_sub1 unk_14; - UnkStruct_02090800_sub1 unk_1C; - UnkStruct_02090800_sub1 unk_24; - UnkStruct_02090800_sub1 unk_2C; - UnkStruct_02090800_sub1 unk_34; -} UnkStruct_02090800; + PokemonInfoDisplayStruct_sub1 unk_14; + PokemonInfoDisplayStruct_sub1 unk_1C; + PokemonInfoDisplayStruct_sub1 unk_24; + PokemonInfoDisplayStruct_sub1 unk_2C; + PokemonInfoDisplayStruct_sub1 unk_34; +} PokemonInfoDisplayStruct; #endif // POKEPLATINUM_STRUCT_02090800_H diff --git a/include/struct_defs/struct_02090800_sub1.h b/include/struct_defs/struct_02090800_sub1.h index 74baf68cdc..a0b7ddc81e 100644 --- a/include/struct_defs/struct_02090800_sub1.h +++ b/include/struct_defs/struct_02090800_sub1.h @@ -6,6 +6,6 @@ typedef struct { int unk_00; Strbuf* unk_04; -} UnkStruct_02090800_sub1; +} PokemonInfoDisplayStruct_sub1; #endif // POKEPLATINUM_STRUCT_02090800_SUB1_H diff --git a/include/struct_defs/struct_02095E80_t.h b/include/struct_defs/struct_02095E80_t.h index 0784c2fc17..d8a0169a1f 100644 --- a/include/struct_defs/struct_02095E80_t.h +++ b/include/struct_defs/struct_02095E80_t.h @@ -110,7 +110,7 @@ struct UnkStruct_02095E80_t { int (* unk_226C)(UnkStruct_02095E80 *); Party * unk_2270; Party * unk_2274; - UnkStruct_0202CC84 * unk_2278; + ChatotCryData * unk_2278; UnkStruct_02027F8C * unk_227C; UnkStruct_02027F8C unk_2280; int unk_2308; diff --git a/include/struct_defs/struct_02098D38.h b/include/struct_defs/struct_02098D38.h index d70881c43c..b942aafdbc 100644 --- a/include/struct_defs/struct_02098D38.h +++ b/include/struct_defs/struct_02098D38.h @@ -22,7 +22,7 @@ typedef struct { u32 unk_1C; void * unk_20; void * unk_24; - UnkStruct_0202CC84 * unk_28; + ChatotCryData * unk_28; BOOL unk_2C; } UnkStruct_02098D38; diff --git a/include/unk_02003B60.h b/include/unk_02003B60.h index 3c02baf761..d5d4399a80 100644 --- a/include/unk_02003B60.h +++ b/include/unk_02003B60.h @@ -7,7 +7,7 @@ #include -void sub_02003B60(UnkStruct_0202CC84 * param0, UnkStruct_020279FC * param1); +void sub_02003B60(ChatotCryData * param0, UnkStruct_020279FC * param1); void sub_02003BD8(void); void sub_02003D0C(int param0); UnkStruct_02003D54 * sub_02003D54(void); diff --git a/include/unk_02006224.h b/include/unk_02006224.h index e59d2b18d6..30a63401b7 100644 --- a/include/unk_02006224.h +++ b/include/unk_02006224.h @@ -5,17 +5,17 @@ #include -BOOL sub_02006224(void); -BOOL sub_02006260(const UnkStruct_0202CC84 * param0); -BOOL sub_0200629C(const UnkStruct_0202CC84 * param0, u32 param1, int param2, int param3); -void sub_02006350(void); -MICResult sub_0200637C(void); -MICResult sub_020063B8(void); -void sub_020063C0(UnkStruct_0202CC84 * param0); -void sub_020063D4(u8 param0); -BOOL sub_020063E4(UnkStruct_0202CC84 * param0, u32 param1, int param2, int param3); -BOOL sub_02006438(UnkStruct_0202CC84 * param0, u32 param1, int param2, int param3, u8 param4); -int Sound_Chatter(UnkStruct_0202CC84 * param0); -BOOL sub_020064C8(int param0); +BOOL CheckMicRecordingStatus(void); +BOOL IsChatotCryStructReadyForProcessing(const ChatotCryData * param0); +BOOL ProcessAudioInput(const ChatotCryData * param0, u32 param1, int param2, int param3); +void ResetMicStatusFlags(void); +MICResult StartMicSampling(void); +MICResult StopMicSampling(void); +void StoreMicDataInChatotCryStruct(ChatotCryData * param0); +void SetMicProcessingFlag(u8 param0); +BOOL ProcessChatotCryStructWithAudioParams(ChatotCryData * param0, u32 param1, int param2, int param3); +BOOL ProcessChatotCryStructWithExtendedAudioParams(ChatotCryData * param0, u32 param1, int param2, int param3, u8 param4); +int Sound_Chatter(ChatotCryData * param0); +BOOL IsAudioParamValid(int param0); #endif // POKEPLATINUM_UNK_02006224_H diff --git a/include/unk_0202CC64.h b/include/unk_0202CC64.h index 091097227d..b850325366 100644 --- a/include/unk_0202CC64.h +++ b/include/unk_0202CC64.h @@ -4,15 +4,15 @@ #include "struct_decls/struct_0202CC84_decl.h" #include "struct_decls/struct_021C0794_decl.h" -int ChatotCry_SaveSize(void); -void ChatotCry_Init(UnkStruct_0202CC84 * param0); -UnkStruct_0202CC84 * sub_0202CC84(int param0); -UnkStruct_0202CC84 * sub_0202CC98(SaveData * param0); -BOOL sub_0202CCA4(const UnkStruct_0202CC84 * param0); -void sub_0202CCA8(UnkStruct_0202CC84 * param0); -const void * sub_0202CCB0(const UnkStruct_0202CC84 * param0); -void sub_0202CCB4(s8 * param0, const s8 * param1); -void sub_0202CCEC(UnkStruct_0202CC84 * param0, const s8 * param1); -void sub_0202CD3C(UnkStruct_0202CC84 * param0, const UnkStruct_0202CC84 * param1); +int GetSizeOfChatotCryData(void); +void ChatotCry_Init(ChatotCryData * param0); +ChatotCryData * AllocateAndInitializeChatotCryData(int param0); +ChatotCryData * GetChatotCryDataFromSave(SaveData * param0); +BOOL IsChatotCryDataValid(const ChatotCryData * param0); +void ResetChatotCryDataStatus(ChatotCryData * param0); +const void * GetChatotCryAudioBuffer(const ChatotCryData * param0); +void ProcessChatotCryAudioData(s8 * param0, const s8 * param1); +void StoreProcessedAudioInChatotCryData(ChatotCryData * param0, const s8 * param1); +void CopyChatotCryData(ChatotCryData * param0, const ChatotCryData * param1); #endif // POKEPLATINUM_UNK_0202CC64_H diff --git a/include/unk_02051D8C.h b/include/unk_02051D8C.h index 28b5082912..fb80211a43 100644 --- a/include/unk_02051D8C.h +++ b/include/unk_02051D8C.h @@ -20,7 +20,7 @@ void sub_020520A4(BattleParams * param0); void sub_0205213C(BattleParams * param0, Pokemon * param1, int param2); void sub_02052164(BattleParams * param0, const Party * param1, int param2); void sub_02052184(BattleParams * param0, const TrainerInfo * param1, int param2); -void sub_020521A4(BattleParams * param0, const UnkStruct_0202CC84 * param1, int param2); +void sub_020521A4(BattleParams * param0, const ChatotCryData * param1, int param2); void sub_020521B8(BattleParams * param0, const UnkStruct_0203CDB0 * param1, SaveData * param2, int param3, UnkStruct_0202B628 * param4, UnkStruct_0207D99C * param5, UnkStruct_0209C370 * param6); void sub_02052314(BattleParams * param0, const UnkStruct_0203CDB0 * param1); void sub_02052348(BattleParams * param0, const UnkStruct_0203CDB0 * param1, int param2); diff --git a/include/unk_02092494.h b/include/unk_02092494.h index 5c031db7d0..b6a288d67b 100644 --- a/include/unk_02092494.h +++ b/include/unk_02092494.h @@ -5,9 +5,9 @@ #include "pokemon.h" #include "struct_defs/struct_02090800.h" -UnkStruct_02090800 * sub_02092494(Pokemon * param0, BOOL param1, int param2); -void sub_0209282C(UnkStruct_02090800 * param0); +PokemonInfoDisplayStruct * sub_02092494(Pokemon * param0, BOOL param1, int param2); +void sub_0209282C(PokemonInfoDisplayStruct * param0); void sub_0209304C(Pokemon * param0, TrainerInfo * param1, int param2, int param3, int param4); -void sub_0209305C(BoxPokemon * param0, TrainerInfo * param1, int param2, int param3, int param4); +void ProcessBoxPokemonWithTrainerInfo(BoxPokemon * param0, TrainerInfo * param1, int param2, int param3, int param4); #endif // POKEPLATINUM_UNK_02092494_H diff --git a/src/main.c b/src/main.c index 68022ad75a..870fc4428d 100644 --- a/src/main.c +++ b/src/main.c @@ -82,7 +82,7 @@ void NitroMain (void) Unk_02101D28.unk_10.unk_00 = -1; Unk_02101D28.unk_10.unk_08 = sub_020244AC(); - sub_02003B60(sub_0202CC98(Unk_02101D28.unk_10.unk_08), sub_02025E44(Unk_02101D28.unk_10.unk_08)); + sub_02003B60(GetChatotCryDataFromSave(Unk_02101D28.unk_10.unk_08), sub_02025E44(Unk_02101D28.unk_10.unk_08)); sub_02022844(); if (sub_02038FFC(3) == DWC_INIT_RESULT_DESTROY_OTHER_SETTING) { diff --git a/src/overlay005/ov5_021E622C.c b/src/overlay005/ov5_021E622C.c index d26a0dd3b4..65027aa875 100644 --- a/src/overlay005/ov5_021E622C.c +++ b/src/overlay005/ov5_021E622C.c @@ -2041,8 +2041,8 @@ static void ov5_021E62C4 (Party * param0, int param1, UnkStruct_02026218 * param Party_RemovePokemonBySlotIndex(param0, param1); if (Party_HasSpecies(param0, 441) == 0) { - UnkStruct_0202CC84 * v7 = sub_0202CC98(param3); - sub_0202CCA8(v7); + ChatotCryData * v7 = GetChatotCryDataFromSave(param3); + ResetChatotCryDataStatus(v7); } } @@ -2441,7 +2441,7 @@ static void ov5_021E6948 (Pokemon * param0, BoxPokemon * param1, BoxPokemon * pa if (v7->unk_00[v0] != 0) { for (v1 = 0; v1 < 100; v1++) { if (v7->unk_00[v0] == Item_MoveForTMHM(328 + v1)) { - if (Pokemon_CanFormLearnTM(v3, v6, v1)) { + if (CanPokemonFormLearnTM(v3, v6, v1)) { if (Pokemon_AddMove(param0, v7->unk_00[v0]) == 0xffff) { Pokemon_ReplaceMove(param0, v7->unk_00[v0]); } diff --git a/src/overlay006/ov6_02240C9C.c b/src/overlay006/ov6_02240C9C.c index 1cd0cace76..5bba0a6bb0 100644 --- a/src/overlay006/ov6_02240C9C.c +++ b/src/overlay006/ov6_02240C9C.c @@ -1686,7 +1686,7 @@ static BOOL ov6_02242514 (const int param0, const UnkStruct_ov6_022422D0 * param } } - sub_02077F0C(param2, param3->battleType, v0); + AssignHeldItemToPokemon(param2, param3->battleType, v0); { u8 v1; diff --git a/src/overlay006/ov6_02243258.c b/src/overlay006/ov6_02243258.c index 17cd1c2379..9a10d644bf 100644 --- a/src/overlay006/ov6_02243258.c +++ b/src/overlay006/ov6_02243258.c @@ -1233,7 +1233,7 @@ static int ov6_02244228 (UnkStruct_ov6_02243FFC * param0) param0->unk_00++; { - sub_02077E3C(param0->unk_5C); + IsPokemonEligibleForAction(param0->unk_5C); } } diff --git a/src/overlay006/ov6_022489E4.c b/src/overlay006/ov6_022489E4.c index ae1b733e26..a89354a0e2 100644 --- a/src/overlay006/ov6_022489E4.c +++ b/src/overlay006/ov6_022489E4.c @@ -296,7 +296,7 @@ void ov6_02248D38 (int param0, int param1, void * param2, void * param3) int v2; u8 * v3; - v1 = ChatotCry_SaveSize(); + v1 = GetSizeOfChatotCryData(); v3 = param2; v2 = v3[v1]; @@ -311,7 +311,7 @@ BOOL ov6_02248D64 (UnkStruct_02095C48 * param0, int param1, void * param2) int v1; int v2; - v1 = ChatotCry_SaveSize(); + v1 = GetSizeOfChatotCryData(); v0 = param0->unk_569; if (param2 != NULL) { diff --git a/src/overlay012/ov12_0221FC20.c b/src/overlay012/ov12_0221FC20.c index f6165a9f2b..36a46ce888 100644 --- a/src/overlay012/ov12_0221FC20.c +++ b/src/overlay012/ov12_0221FC20.c @@ -85,7 +85,7 @@ typedef struct UnkStruct_ov12_02223178_t { u8 unk_E8[4]; u32 unk_EC[4]; u32 unk_FC[4]; - UnkStruct_0202CC84 * unk_10C; + ChatotCryData * unk_10C; u8 * unk_110; u16 * unk_114; int unk_118; @@ -3836,7 +3836,7 @@ static void ov12_022230D4 (UnkStruct_ov12_0221FCDC * param0) v3 = param0->unk_BC->unk_D8[param0->unk_BC->unk_14]; v4 = param0->unk_BC->unk_E8[param0->unk_BC->unk_14]; - sub_02077D3C(param0->unk_BC->unk_10C, v0, v3, v4, v1, v2, param0->unk_BC->unk_118, param0->unk_00); + HandleChatotSpecialInteraction(param0->unk_BC->unk_10C, v0, v3, v4, v1, v2, param0->unk_BC->unk_118, param0->unk_00); } static void ov12_02223134 (UnkStruct_ov12_0221FCDC * param0) diff --git a/src/overlay016/ov16_0223DF00.c b/src/overlay016/ov16_0223DF00.c index b83d46b102..6d0d4f1ce1 100644 --- a/src/overlay016/ov16_0223DF00.c +++ b/src/overlay016/ov16_0223DF00.c @@ -143,7 +143,7 @@ int ov16_0223EDE0(BattleSystem * param0); u8 BattleSystem_TextSpeed(BattleSystem * param0); int BattleSystem_Ruleset(BattleSystem * param0); UnkStruct_02015F84 * ov16_0223EE28(BattleSystem * param0); -UnkStruct_0202CC84 * BattleSystem_ChatotVoice(BattleSystem * param0, int param1); +ChatotCryData * BattleSystem_ChatotVoice(BattleSystem * param0, int param1); void ov16_0223EE70(BattleSystem * param0); void ov16_0223EF2C(BattleSystem * param0, int param1, int param2); void ov16_0223EF48(BattleSystem * param0, Pokemon * param1); @@ -1053,7 +1053,7 @@ UnkStruct_02015F84 * ov16_0223EE28 (BattleSystem * param0) return param0->unk_1C4; } -UnkStruct_0202CC84 * BattleSystem_ChatotVoice (BattleSystem * param0, int param1) +ChatotCryData * BattleSystem_ChatotVoice (BattleSystem * param0, int param1) { if ((param0->battleType & 0x8) || ((param0->battleType & 0x10) && (BattleSystem_BattlerSlot(param0, param1) & 0x1))) { return param0->unk_78[param1]; diff --git a/src/overlay016/ov16_0225177C.c b/src/overlay016/ov16_0225177C.c index 77ac97843e..0c387b1ccf 100644 --- a/src/overlay016/ov16_0225177C.c +++ b/src/overlay016/ov16_0225177C.c @@ -6252,7 +6252,7 @@ void ov16_02259A5C (BattleSystem * param0, BattleContext * param1, Pokemon * par v3 = param1->msgItemTemp; } - sub_02077E64(param2, v0, v3, v1, v2, 5); + InitializePokemonAfterCapture(param2, v0, v3, v1, v2, 5); } u8 BattleContext_IOBufferVal (BattleContext *battleCtx, int battler) diff --git a/src/overlay016/ov16_0225CBB8.c b/src/overlay016/ov16_0225CBB8.c index a731a26351..1b94205697 100644 --- a/src/overlay016/ov16_0225CBB8.c +++ b/src/overlay016/ov16_0225CBB8.c @@ -1625,7 +1625,7 @@ static void ov16_0225E4E8 (SysTask * param0, void * param1) { u8 v4; sub_02078A4C(v0->unk_04->unk_1A0, &v4, v0->unk_16, v0->unk_1C); - sub_02077DB4(BattleSystem_ChatotVoice(v0->unk_00, v0->unk_11), v0->unk_18, v0->unk_16, v0->unk_2C, 117, 127, NULL, 5, v4); + HandleChatotSpecialAction(BattleSystem_ChatotVoice(v0->unk_00, v0->unk_11), v0->unk_18, v0->unk_16, v0->unk_2C, 117, 127, NULL, 5, v4); } if ((v0->unk_1C == 1) || (v0->unk_1C == 3)) { @@ -1668,7 +1668,7 @@ static void ov16_0225E4E8 (SysTask * param0, void * param1) u8 v5; sub_02078A4C(v0->unk_04->unk_1A0, &v5, v0->unk_16, v0->unk_1C); - sub_02077DB4(BattleSystem_ChatotVoice(v0->unk_00, v0->unk_11), v0->unk_18, v0->unk_16, v0->unk_2C, -117, 127, NULL, 5, v5); + HandleChatotSpecialAction(BattleSystem_ChatotVoice(v0->unk_00, v0->unk_11), v0->unk_18, v0->unk_16, v0->unk_2C, -117, 127, NULL, 5, v5); } if ((v0->unk_1C == 0) || (v0->unk_1C == 2)) { @@ -1752,7 +1752,7 @@ static void ov16_0225E894 (SysTask * param0, void * param1) u8 v4; sub_02078A4C(v0->unk_04->unk_1A0, &v4, v0->unk_16, v0->unk_1C); - sub_02077DB4(BattleSystem_ChatotVoice(v0->unk_00, v0->unk_11), v0->unk_18, v0->unk_16, v0->unk_2C, 117, 127, NULL, 5, v4); + HandleChatotSpecialAction(BattleSystem_ChatotVoice(v0->unk_00, v0->unk_11), v0->unk_18, v0->unk_16, v0->unk_2C, 117, 127, NULL, 5, v4); } sub_0200D4C4(v0->unk_0C->unk_00, (24 * 8), (8 * 11)); @@ -1913,7 +1913,7 @@ static void ov16_0225EA80 (SysTask * param0, void * param1) u8 v4; sub_02078A4C(v0->unk_04->unk_1A0, &v4, v0->unk_86, v0->unk_82); - sub_02077DB4(BattleSystem_ChatotVoice(v0->unk_00, v0->unk_81), v0->unk_88, v0->unk_86, v0->unk_97, 117, 127, NULL, 5, v4); + HandleChatotSpecialAction(BattleSystem_ChatotVoice(v0->unk_00, v0->unk_81), v0->unk_88, v0->unk_86, v0->unk_97, 117, 127, NULL, 5, v4); } } else { sub_02007B98(v0->unk_04->unk_20, 1); @@ -1922,7 +1922,7 @@ static void ov16_0225EA80 (SysTask * param0, void * param1) u8 v5; sub_02078A4C(v0->unk_04->unk_1A0, &v5, v0->unk_86, v0->unk_82); - sub_02077DB4(BattleSystem_ChatotVoice(v0->unk_00, v0->unk_81), v0->unk_88, v0->unk_86, v0->unk_97, -117, 127, NULL, 5, v5); + HandleChatotSpecialAction(BattleSystem_ChatotVoice(v0->unk_00, v0->unk_81), v0->unk_88, v0->unk_86, v0->unk_97, -117, 127, NULL, 5, v5); } } @@ -1942,7 +1942,7 @@ static void ov16_0225EA80 (SysTask * param0, void * param1) u8 v6; sub_02078A4C(v0->unk_04->unk_1A0, &v6, v0->unk_86, v0->unk_82); - sub_02077DB4(BattleSystem_ChatotVoice(v0->unk_00, v0->unk_81), v0->unk_88, v0->unk_86, v0->unk_97, 117, 127, NULL, 5, v6); + HandleChatotSpecialAction(BattleSystem_ChatotVoice(v0->unk_00, v0->unk_81), v0->unk_88, v0->unk_86, v0->unk_97, 117, 127, NULL, 5, v6); } } else { sub_02007B98(v0->unk_04->unk_20, 1); @@ -1951,7 +1951,7 @@ static void ov16_0225EA80 (SysTask * param0, void * param1) u8 v7; sub_02078A4C(v0->unk_04->unk_1A0, &v7, v0->unk_86, v0->unk_82); - sub_02077DB4(BattleSystem_ChatotVoice(v0->unk_00, v0->unk_81), v0->unk_88, v0->unk_86, v0->unk_97, -117, 127, NULL, 5, v7); + HandleChatotSpecialAction(BattleSystem_ChatotVoice(v0->unk_00, v0->unk_81), v0->unk_88, v0->unk_86, v0->unk_97, -117, 127, NULL, 5, v7); } } @@ -2109,7 +2109,7 @@ static void ov16_0225F0C0 (SysTask * param0, void * param1) u8 v6; sub_02078A4C(v0->unk_04->unk_1A0, &v6, v0->unk_86, v0->unk_82); - sub_02077DB4(BattleSystem_ChatotVoice(v0->unk_00, v0->unk_81), v0->unk_88, v0->unk_86, v0->unk_97, 117, 127, NULL, 5, v6); + HandleChatotSpecialAction(BattleSystem_ChatotVoice(v0->unk_00, v0->unk_81), v0->unk_88, v0->unk_86, v0->unk_97, 117, 127, NULL, 5, v6); } } else { sub_02007B98(v0->unk_04->unk_20, 1); @@ -2118,7 +2118,7 @@ static void ov16_0225F0C0 (SysTask * param0, void * param1) u8 v7; sub_02078A4C(v0->unk_04->unk_1A0, &v7, v0->unk_86, v0->unk_82); - sub_02077DB4(BattleSystem_ChatotVoice(v0->unk_00, v0->unk_81), v0->unk_88, v0->unk_86, v0->unk_97, -117, 127, NULL, 5, v7); + HandleChatotSpecialAction(BattleSystem_ChatotVoice(v0->unk_00, v0->unk_81), v0->unk_88, v0->unk_86, v0->unk_97, -117, 127, NULL, 5, v7); } } @@ -2137,7 +2137,7 @@ static void ov16_0225F0C0 (SysTask * param0, void * param1) u8 v8; sub_02078A4C(v0->unk_04->unk_1A0, &v8, v0->unk_86, v0->unk_82); - sub_02077DB4(BattleSystem_ChatotVoice(v0->unk_00, v0->unk_81), v0->unk_88, v0->unk_86, v0->unk_97, 117, 127, NULL, 5, v8); + HandleChatotSpecialAction(BattleSystem_ChatotVoice(v0->unk_00, v0->unk_81), v0->unk_88, v0->unk_86, v0->unk_97, 117, 127, NULL, 5, v8); } } else { sub_02007B98(v0->unk_04->unk_20, 1); @@ -2146,7 +2146,7 @@ static void ov16_0225F0C0 (SysTask * param0, void * param1) u8 v9; sub_02078A4C(v0->unk_04->unk_1A0, &v9, v0->unk_86, v0->unk_82); - sub_02077DB4(BattleSystem_ChatotVoice(v0->unk_00, v0->unk_81), v0->unk_88, v0->unk_86, v0->unk_97, -117, 127, NULL, 5, v9); + HandleChatotSpecialAction(BattleSystem_ChatotVoice(v0->unk_00, v0->unk_81), v0->unk_88, v0->unk_86, v0->unk_97, -117, 127, NULL, 5, v9); } } @@ -4911,7 +4911,7 @@ static void ov16_02262A9C (SysTask * param0, void * param1) v7 = -117; } - sub_02077DB4(BattleSystem_ChatotVoice(v0->unk_00, v0->unk_65), 5, v0->unk_68, v0->unk_6B, v7, 127, v0->unk_72, 5, 0); + HandleChatotSpecialAction(BattleSystem_ChatotVoice(v0->unk_00, v0->unk_65), 5, v0->unk_68, v0->unk_6B, v7, 127, v0->unk_72, 5, 0); v0->unk_66++; } case 5: diff --git a/src/overlay017/ov17_02247A48.c b/src/overlay017/ov17_02247A48.c index 85e62bf9c3..9aae9740ff 100644 --- a/src/overlay017/ov17_02247A48.c +++ b/src/overlay017/ov17_02247A48.c @@ -1088,7 +1088,7 @@ static void ov17_02248AA4 (SysTask * param0, void * param1) if (v0->unk_04 >= FX32_ONE) { v2 = Pokemon_GetValue(v0->unk_00->unk_0C.unk_00->unk_00[v0->unk_0E], MON_DATA_SPECIES, NULL); v3 = Pokemon_GetValue(v0->unk_00->unk_0C.unk_00->unk_00[v0->unk_0E], MON_DATA_FORM, NULL); - sub_02077D3C(v0->unk_00->unk_00->unk_14C[v0->unk_0E], 0, v2, v3, 0, 127, NULL, 22); + HandleChatotSpecialInteraction(v0->unk_00->unk_00->unk_14C[v0->unk_0E], 0, v2, v3, 0, 127, NULL, 22); v0->unk_0C++; } break; diff --git a/src/overlay017/ov17_02251D6C.c b/src/overlay017/ov17_02251D6C.c index 1be341731e..5ae205bbea 100644 --- a/src/overlay017/ov17_02251D6C.c +++ b/src/overlay017/ov17_02251D6C.c @@ -679,7 +679,7 @@ static void ov17_0225266C (SysTask * param0, void * param1) v1 = Pokemon_GetValue(v0->unk_00->unk_10.unk_00->unk_00[v0->unk_11], MON_DATA_SPECIES, NULL); v2 = Pokemon_GetValue(v0->unk_00->unk_10.unk_00->unk_00[v0->unk_11], MON_DATA_FORM, NULL); - sub_02077D3C(v0->unk_00->unk_00->unk_14C[v0->unk_11], 0, v1, v2, 0, 127, NULL, 24); + HandleChatotSpecialInteraction(v0->unk_00->unk_00->unk_14C[v0->unk_11], 0, v1, v2, 0, 127, NULL, 24); } v0->unk_10++; break; diff --git a/src/overlay019/ov19_021D0D80.c b/src/overlay019/ov19_021D0D80.c index dcfaccb34c..afd78b3c2c 100644 --- a/src/overlay019/ov19_021D0D80.c +++ b/src/overlay019/ov19_021D0D80.c @@ -330,9 +330,9 @@ int ov19_021D0E58 (UnkStruct_020067E8 * param0, int * param1) UnkStruct_ov19_021D5DF8 * v0 = sub_0200682C(param0); if (Party_HasSpecies(v0->unk_124, 441) == 0) { - UnkStruct_0202CC84 * v1 = sub_0202CC98(v0->unk_11C); + ChatotCryData * v1 = GetChatotCryDataFromSave(v0->unk_11C); - sub_0202CCA8(v1); + ResetChatotCryDataStatus(v1); } ov19_021D64A0(v0->unk_114); diff --git a/src/overlay087/ov87_021D106C.c b/src/overlay087/ov87_021D106C.c index 80639ae6a1..be29973a5c 100644 --- a/src/overlay087/ov87_021D106C.c +++ b/src/overlay087/ov87_021D106C.c @@ -213,7 +213,7 @@ static BOOL ov87_021D12C0 (UnkStruct_ov87_021D106C * param0, int * param1) if (v1 == v0->unk_18) { sub_02021FE0(param0->unk_1C4[v1], GX_OAM_MODE_NORMAL); sub_02021F58(param0->unk_1C4[v1], 0); - sub_020063D4(1); + SetMicProcessingFlag(1); sub_02005844(v0->unk_20[v1].unk_10, v0->unk_20[v1].unk_13); } else { @@ -562,7 +562,7 @@ static void ov87_021D1970 (UnkStruct_ov87_021D106C * param0) sub_02006E84(v1.archive, v1.palette, 1, v3 * 0x20, 0x20, 61); if (v3 == v2->unk_18) { - sub_020063D4(1); + SetMicProcessingFlag(1); sub_02005844(v2->unk_20[v3].unk_10, v2->unk_20[v3].unk_13); sub_02021FE0(param0->unk_1C4[v3], GX_OAM_MODE_NORMAL); } else { diff --git a/src/overlay088/ov88_0223B140.c b/src/overlay088/ov88_0223B140.c index 9178a1910f..778b0fe5b0 100644 --- a/src/overlay088/ov88_0223B140.c +++ b/src/overlay088/ov88_0223B140.c @@ -122,7 +122,7 @@ static void ov88_0223CF68(int param0, UnkStruct_02022550 * param1, int param2); static int ov88_0223CFF4(u32 * param0, int * param1, UnkStruct_02022550 * param2, UnkStruct_ov88_0223C8AC * param3, int param4); static int ov88_0223C800(int param0, Pokemon * param1, u8 * param2, ArchivedSprite * param3); static void ov88_0223E7F0(UnkStruct_0202B628 * param0, Pokemon * param1); -static void ov88_0223D140(UnkStruct_0202CC84 * param0); +static void ov88_0223D140(ChatotCryData * param0); static void ov88_0223E894(UnkStruct_02095E80 * param0); static void ov88_0223E8B4(UnkStruct_02095E80 * param0); static int ov88_0223E8D0(UnkStruct_02095E80 * param0); @@ -700,7 +700,7 @@ static int ov88_0223B914 (UnkStruct_02095E80 * param0) } break; case 14: - ov88_0223D140(sub_0202CC98(param0->unk_04)); + ov88_0223D140(GetChatotCryDataFromSave(param0->unk_04)); param0->unk_4C++; break; case 15: @@ -1538,7 +1538,7 @@ static void ov88_0223CE74 (UnkStruct_02095E80 * param0) v1 = param0->unk_6F4[param0->unk_88[0]].unk_06; if (v0 == 441) { - sub_020063E4(sub_0202CC98(param0->unk_04), 0, 100, 0); + ProcessChatotCryStructWithAudioParams(GetChatotCryDataFromSave(param0->unk_04), 0, 100, 0); } else { sub_02005844(v0, v1); } @@ -1697,7 +1697,7 @@ static void ov88_0223D0D4 (TrainerInfo * param0, UnkStruct_02027F8C * param1, Un sub_0203597C(28, param2, sizeof(UnkStruct_02027F8C)); } -static void ov88_0223D140 (UnkStruct_0202CC84 * param0) +static void ov88_0223D140 (ChatotCryData * param0) { sub_0203597C(29, param0, 1000); } @@ -1751,7 +1751,7 @@ static void ov88_0223D1EC (UnkStruct_02095E80 * param0, int param1) } else { param0->unk_0C.unk_00 = param0->unk_2274; param0->unk_0C.unk_13 = Party_GetCurrentCount(param0->unk_2274); - param0->unk_0C.unk_28 = (UnkStruct_0202CC84 *)param0->unk_2E6C[sub_0203608C() ^ 1]; + param0->unk_0C.unk_28 = (ChatotCryData *)param0->unk_2E6C[sub_0203608C() ^ 1]; sub_0208E9C0(¶m0->unk_0C, sub_02032EE8(sub_0203608C() ^ 1)); } @@ -2528,8 +2528,8 @@ static void ov88_0223E694 (Party * param0, Party * param1, int param2, int param param4->unk_2C = param2; if (Party_HasSpecies(param0, 441) == 0) { - UnkStruct_0202CC84 * v4 = sub_0202CC98(param4->unk_10); - sub_0202CCA8(v4); + ChatotCryData * v4 = GetChatotCryDataFromSave(param4->unk_10); + ResetChatotCryDataStatus(v4); } sub_0202F180(param4->unk_10, v1); diff --git a/src/overlay094/ov94_02242AD0.c b/src/overlay094/ov94_02242AD0.c index 0bacc9b4af..c613fc11e0 100644 --- a/src/overlay094/ov94_02242AD0.c +++ b/src/overlay094/ov94_02242AD0.c @@ -1264,8 +1264,8 @@ static void ov94_02243B08 (UnkStruct_ov94_0223FD4C * param0, int param1) Party_RemovePokemonBySlotIndex(param0->unk_00->unk_08, param0->unk_112); if (Party_HasSpecies(param0->unk_00->unk_08, 441) == 0) { - UnkStruct_0202CC84 * v2 = sub_0202CC98(param0->unk_00->unk_20); - sub_0202CCA8(v2); + ChatotCryData * v2 = GetChatotCryDataFromSave(param0->unk_00->unk_20); + ResetChatotCryDataStatus(v2); } } diff --git a/src/overlay104/ov104_0222DCE0.c b/src/overlay104/ov104_0222DCE0.c index 3ab1757092..4d97b14e64 100644 --- a/src/overlay104/ov104_0222DCE0.c +++ b/src/overlay104/ov104_0222DCE0.c @@ -361,7 +361,7 @@ void ov104_0222E134 (SaveData * param0, Pokemon * param1) TrainerInfo * v5 = sub_02025E38(param0); v0 = Pokemon_GetValue(param1, MON_DATA_OT_ID, NULL); - sub_02077EE4(param1, sub_02025E38(param0), 4, 0, 0, 11); + PostCapturePokemonProcessing(param1, sub_02025E38(param0), 4, 0, 0, 11); v3 = sub_0203A138(562); sub_0209304C(param1, v5, v4, v3, 11); diff --git a/src/overlay104/ov104_0223B6F4.c b/src/overlay104/ov104_0223B6F4.c index 29ade4d96a..9be9bd123b 100644 --- a/src/overlay104/ov104_0223B6F4.c +++ b/src/overlay104/ov104_0223B6F4.c @@ -308,7 +308,7 @@ void ov104_0223BA24 (Party * param0) void ov104_0223BA7C (UnkStruct_ov104_0223BA10 * param0, Pokemon * param1) { - sub_02077EE4(param1, sub_02025E38(param0->unk_04), 4, 0, 0, 11); + PostCapturePokemonProcessing(param1, sub_02025E38(param0->unk_04), 4, 0, 0, 11); return; } diff --git a/src/overlay104/ov104_0223BCBC.c b/src/overlay104/ov104_0223BCBC.c index ed99606854..3cd45f61c5 100644 --- a/src/overlay104/ov104_0223BCBC.c +++ b/src/overlay104/ov104_0223BCBC.c @@ -294,7 +294,7 @@ BOOL ov104_0223C000 (u8 param0) void ov104_0223C010 (UnkStruct_ov104_0223BFFC * param0, Pokemon * param1) { - sub_02077EE4(param1, sub_02025E38(param0->unk_04), 4, 0, 0, 11); + PostCapturePokemonProcessing(param1, sub_02025E38(param0->unk_04), 4, 0, 0, 11); return; } diff --git a/src/overlay118/ov118_021D0D80.c b/src/overlay118/ov118_021D0D80.c index 1abe9739fa..ea62b16381 100644 --- a/src/overlay118/ov118_021D0D80.c +++ b/src/overlay118/ov118_021D0D80.c @@ -132,7 +132,7 @@ int ov118_021D0DBC (UnkStruct_0207F248 * param0) v0->unk_00++; break; case 7: - sub_02077E3C(v1); + IsPokemonEligibleForAction(v1); v0->unk_00++; break; case 8: diff --git a/src/pokemon.c b/src/pokemon.c index 9c27ea2889..9af539cf6c 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -123,11 +123,11 @@ static void BoxPokemon_ReplaceMove(BoxPokemon *boxMon, u16 moveID); static void BoxPokemon_SetMoveSlot(BoxPokemon *boxMon, u16 moveID, u8 moveSlot); static BOOL Pokemon_HasMove(Pokemon *mon, u16 moveID); static s8 BoxPokemon_GetFlavorAffinity(BoxPokemon *boxMon, int flavor); -static BOOL sub_020778E0(BoxPokemon *boxMon); -static BOOL sub_02077900(BoxPokemon *boxMon); -static void sub_02077EA4(BoxPokemon *boxMon, TrainerInfo *param1, int monPokeball, int param3, int param4, int param5); -static void sub_02077EF8(BoxPokemon *boxMon, TrainerInfo *param1, int monPokeball, int param3, int param4, int param5); -static BOOL BoxPokemon_CanLearnTM(BoxPokemon *boxMon, u8 tmID); +static BOOL IsBoxPokemonInfectedWithPokerus(BoxPokemon *boxMon); +static BOOL CanBoxPokemonSpreadPokerus(BoxPokemon *boxMon); +static void InitializeBoxPokemonAfterCapture(BoxPokemon *boxMon, TrainerInfo *param1, int monPokeball, int param3, int param4, int param5); +static void PostCaptureBoxPokemonProcessing(BoxPokemon *boxMon, TrainerInfo *param1, int monPokeball, int param3, int param4, int param5); +static BOOL CanBoxPokemonLearnTM(BoxPokemon *boxMon, u8 tmID); static void BoxPokemon_CalcAbility(BoxPokemon *boxMon); static void PokemonPersonalData_LoadSpecies(int monSpecies, PokemonPersonalData *monPersonalData); static void PokemonPersonalData_LoadForm(int monSpecies, int monForm, PokemonPersonalData *monPersonalData); @@ -3756,7 +3756,7 @@ u8 Pokemon_HasPokerus(Party *party, u8 param1) return result; } -void sub_020777B4(Party *party, s32 param1) +void UpdatePokerusStatusInParty(Party *party, s32 param1) { int currentPartyCount = Party_GetCurrentCount(party); @@ -3817,22 +3817,22 @@ void Pokemon_ValidatePokerus(Party *party) } } -BOOL sub_020778D8(Pokemon *mon) +BOOL IsPokemonInfectedWithPokerus(Pokemon *mon) { - return sub_020778E0(&mon->box); + return IsBoxPokemonInfectedWithPokerus(&mon->box); } -static BOOL sub_020778E0(BoxPokemon *boxMon) +static BOOL IsBoxPokemonInfectedWithPokerus(BoxPokemon *boxMon) { return (BoxPokemon_GetValue(boxMon, MON_DATA_POKERUS, NULL) & 0xf) != 0; } -BOOL sub_020778F8(Pokemon *mon) +BOOL CanPokemonSpreadPokerus(Pokemon *mon) { - return sub_02077900(&mon->box); + return CanBoxPokemonSpreadPokerus(&mon->box); } -static BOOL sub_02077900(BoxPokemon *boxMon) +static BOOL CanBoxPokemonSpreadPokerus(BoxPokemon *boxMon) { u8 monPokerus = BoxPokemon_GetValue(boxMon, MON_DATA_POKERUS, NULL); @@ -4146,43 +4146,43 @@ void Pokemon_LoadLevelUpMovesOf(int monSpecies, int monForm, u16 *monLevelUpMove NARC_ReadWholeMemberByIndexPair(monLevelUpMoves, NARC_INDEX_POKETOOL__PERSONAL__WOTBL, monSpecies); } -void sub_02077D3C(UnkStruct_0202CC84 *param0, int param1, u16 monSpecies, int param3, int param4, int param5, int param6, int param7) +void HandleChatotSpecialInteraction(ChatotCryData *param0, int param1, u16 monSpecies, int param3, int param4, int param5, int param6, int param7) { if (monSpecies == SPECIES_CHATOT) { - if (sub_020064C8(param1) == 0) { - sub_020063D4(1); + if (IsAudioParamValid(param1) == 0) { + SetMicProcessingFlag(1); sub_020059D0(param1, monSpecies, param4, param5, param7, param3); } else { if (param6) { - sub_020063D4(1); + SetMicProcessingFlag(1); } - sub_020063E4(param0, NULL, param5, param4); + ProcessChatotCryStructWithAudioParams(param0, NULL, param5, param4); } } else { sub_020059D0(param1, monSpecies, param4, param5, param7, param3); } } -void sub_02077DB4(UnkStruct_0202CC84 *param0, int param1, u16 monSpecies, int param3, int param4, int param5, int param6, int param7, u8 param8) +void HandleChatotSpecialAction(ChatotCryData *param0, int param1, u16 monSpecies, int param3, int param4, int param5, int param6, int param7, u8 param8) { if (monSpecies == SPECIES_CHATOT) { - if (sub_020064C8(param1) == 0) { - sub_020063D4(1); + if (IsAudioParamValid(param1) == 0) { + SetMicProcessingFlag(1); sub_02005F4C(param1, monSpecies, param4, param5, param7, param8, param3); } else { if (param6) { - sub_020063D4(1); + SetMicProcessingFlag(1); } - sub_02006438(param0, NULL, param5, param4, param8); + ProcessChatotCryStructWithExtendedAudioParams(param0, NULL, param5, param4, param8); } } else { sub_02005F4C(param1, monSpecies, param4, param5, param7, param8, param3); } } -BOOL sub_02077E3C(Pokemon *mon) +BOOL IsPokemonEligibleForAction(Pokemon *mon) { int monSpecies = Pokemon_GetValue(mon, MON_DATA_SPECIES, NULL); int monForm = Pokemon_GetValue(mon, MON_DATA_FORM, NULL); @@ -4190,9 +4190,9 @@ BOOL sub_02077E3C(Pokemon *mon) return sub_02005844(monSpecies, monForm); } -void sub_02077E64(Pokemon *mon, TrainerInfo *param1, int monPokeball, int param3, int param4, int param5) +void InitializePokemonAfterCapture(Pokemon *mon, TrainerInfo *param1, int monPokeball, int param3, int param4, int param5) { - sub_02077EA4(&mon->box, param1, monPokeball, param3, param4, param5); + InitializeBoxPokemonAfterCapture(&mon->box, param1, monPokeball, param3, param4, param5); if (monPokeball == ITEM_HEAL_BALL) { int monMaxHP = Pokemon_GetValue(mon, MON_DATA_MAX_HP, NULL); @@ -4203,22 +4203,22 @@ void sub_02077E64(Pokemon *mon, TrainerInfo *param1, int monPokeball, int param3 } } -static void sub_02077EA4(BoxPokemon *boxMon, TrainerInfo *param1, int monPokeball, int param3, int param4, int param5) +static void InitializeBoxPokemonAfterCapture(BoxPokemon *boxMon, TrainerInfo *param1, int monPokeball, int param3, int param4, int param5) { - sub_0209305C(boxMon, param1, 0, param3, param5); + ProcessBoxPokemonWithTrainerInfo(boxMon, param1, 0, param3, param5); BoxPokemon_SetValue(boxMon, MON_DATA_MET_GAME, &Unk_020E4C40); BoxPokemon_SetValue(boxMon, MON_DATA_POKEBALL, &monPokeball); BoxPokemon_SetValue(boxMon, MON_DATA_158, ¶m4); } -void sub_02077EE4(Pokemon *mon, TrainerInfo *param1, int monPokeball, int param3, int param4, int param5) +void PostCapturePokemonProcessing(Pokemon *mon, TrainerInfo *param1, int monPokeball, int param3, int param4, int param5) { - sub_02077EF8(&mon->box, param1, monPokeball, param3, param4, param5); + PostCaptureBoxPokemonProcessing(&mon->box, param1, monPokeball, param3, param4, param5); } -static void sub_02077EF8(BoxPokemon *boxMon, TrainerInfo *param1, int monPokeball, int param3, int param4, int param5) +static void PostCaptureBoxPokemonProcessing(BoxPokemon *boxMon, TrainerInfo *param1, int monPokeball, int param3, int param4, int param5) { - sub_02077EA4(boxMon, param1, monPokeball, param3, param4, param5); + InitializeBoxPokemonAfterCapture(boxMon, param1, monPokeball, param3, param4, param5); } static const u16 sHeldItemChance[][2] = { @@ -4226,7 +4226,7 @@ static const u16 sHeldItemChance[][2] = { {20, 80} }; -void sub_02077F0C(Pokemon *mon, u32 param1, int param2) +void AssignHeldItemToPokemon(Pokemon *mon, u32 param1, int param2) { if (param1 & (0x1 | 0x80)) { return; @@ -4254,18 +4254,18 @@ void sub_02077F0C(Pokemon *mon, u32 param1, int param2) BOOL Pokemon_CanLearnTM(Pokemon *mon, u8 tmID) { - return BoxPokemon_CanLearnTM(&mon->box, tmID); + return CanBoxPokemonLearnTM(&mon->box, tmID); } -static BOOL BoxPokemon_CanLearnTM(BoxPokemon *boxMon, u8 tmID) +static BOOL CanBoxPokemonLearnTM(BoxPokemon *boxMon, u8 tmID) { u16 monSpeciesEgg = BoxPokemon_GetValue(boxMon, MON_DATA_SPECIES_EGG, NULL); int monForm = BoxPokemon_GetValue(boxMon, MON_DATA_FORM, NULL); - return Pokemon_CanFormLearnTM(monSpeciesEgg, monForm, tmID); + return CanPokemonFormLearnTM(monSpeciesEgg, monForm, tmID); } -BOOL Pokemon_CanFormLearnTM(u16 monSpecies, int monForm, u8 tmID) +BOOL CanPokemonFormLearnTM(u16 monSpecies, int monForm, u8 tmID) { if (monSpecies == SPECIES_EGG) { return FALSE; diff --git a/src/savedata/save_table.c b/src/savedata/save_table.c index 1528fc4274..5aca2357cb 100644 --- a/src/savedata/save_table.c +++ b/src/savedata/save_table.c @@ -68,7 +68,7 @@ const SaveTableEntry gSaveTable[] = { { SAVE_TABLE_ENTRY_TRAINER_CARD, SAVE_BLOCK_ID_NORMAL, (SaveEntrySizeFunc)TrainerCard_SaveSize, (SaveEntryInitFunc)TrainerCard_Init }, { SAVE_TABLE_ENTRY_GAME_RECORDS, SAVE_BLOCK_ID_NORMAL, (SaveEntrySizeFunc)GameRecord_SaveSize, (SaveEntryInitFunc)GameRecord_Init }, { SAVE_TABLE_ENTRY_BALL_SEALS, SAVE_BLOCK_ID_NORMAL, (SaveEntrySizeFunc)BallSeal_SaveSize, (SaveEntryInitFunc)BallSeal_Init }, - { SAVE_TABLE_ENTRY_CHATOT, SAVE_BLOCK_ID_NORMAL, (SaveEntrySizeFunc)ChatotCry_SaveSize, (SaveEntryInitFunc)ChatotCry_Init }, + { SAVE_TABLE_ENTRY_CHATOT, SAVE_BLOCK_ID_NORMAL, (SaveEntrySizeFunc)GetSizeOfChatotCryData, (SaveEntryInitFunc)ChatotCry_Init }, { SAVE_TABLE_ENTRY_FRONTIER, SAVE_BLOCK_ID_NORMAL, (SaveEntrySizeFunc)Frontier_SaveSize, (SaveEntryInitFunc)Frontier_Init }, { SAVE_TABLE_ENTRY_RIBBONS, SAVE_BLOCK_ID_NORMAL, (SaveEntrySizeFunc)Ribbons_SaveSize, (SaveEntryInitFunc)Ribbons_Init }, { SAVE_TABLE_ENTRY_ENCOUNTERS, SAVE_BLOCK_ID_NORMAL, (SaveEntrySizeFunc)SpecialEncounter_SaveSize, (SaveEntryInitFunc)SpecialEncounter_Init }, diff --git a/src/unk_02003B60.c b/src/unk_02003B60.c index 4076d7b04b..216691974a 100644 --- a/src/unk_02003B60.c +++ b/src/unk_02003B60.c @@ -49,8 +49,8 @@ struct UnkStruct_02003D54_t { void * unk_BCD8C; int unk_BCD90; SysTask * unk_BCD94; - UnkStruct_0202CC84 * unk_BCD98; - UnkStruct_0202CC84 * unk_BCD9C[4]; + ChatotCryData * unk_BCD98; + ChatotCryData * unk_BCD9C[4]; int unk_BCDAC[2]; int unk_BCDB4[2]; int unk_BCDBC[2]; @@ -61,7 +61,7 @@ struct UnkStruct_02003D54_t { u8 unk_BCDD3; }; -void sub_02003B60(UnkStruct_0202CC84 * param0, UnkStruct_020279FC * param1); +void sub_02003B60(ChatotCryData * param0, UnkStruct_020279FC * param1); void sub_02003BD8(void); void sub_02003D0C(int param0); UnkStruct_02003D54 * sub_02003D54(void); @@ -87,7 +87,7 @@ static UnkStruct_02003D54 Unk_02101DF8; static int Unk_02101DF0; static NNSSndCaptureOutputEffectType Unk_02101DF4; -void sub_02003B60 (UnkStruct_0202CC84 * param0, UnkStruct_020279FC * param1) +void sub_02003B60 (ChatotCryData * param0, UnkStruct_020279FC * param1) { UnkStruct_02003D54 * v0 = sub_02003D54(); @@ -125,7 +125,7 @@ void sub_02003BD8 (void) sub_02003C64(); } - sub_02006224(); + CheckMicRecordingStatus(); for (v0 = 0; v0 < 2; v0++) { if (v1->unk_BCDD0[v0] != 0) { diff --git a/src/unk_02005474.c b/src/unk_02005474.c index 43884cd274..58b40f5769 100644 --- a/src/unk_02005474.c +++ b/src/unk_02005474.c @@ -407,7 +407,7 @@ BOOL sub_02005844 (u16 param0, u8 param1) u16 v0; int v1; u8 * v2 = sub_02003D5C(18); - UnkStruct_0202CC84 ** v3 = sub_02003D5C(36); + ChatotCryData ** v3 = sub_02003D5C(36); u8 * v4 = sub_02003D5C(53); v0 = param0; @@ -423,8 +423,8 @@ BOOL sub_02005844 (u16 param0, u8 param1) } if (v0 == 441) { - if (sub_0200629C(*v3, 0, 127, 0) == 1) { - sub_020063D4(0); + if (ProcessAudioInput(*v3, 0, 127, 0) == 1) { + SetMicProcessingFlag(0); return 1; } } @@ -441,7 +441,7 @@ BOOL sub_02005844 (u16 param0, u8 param1) sub_02004AA0(v0, 8); } - sub_020063D4(0); + SetMicProcessingFlag(0); if (v1 == 0) { (void)0; @@ -475,7 +475,7 @@ void sub_0200592C (int param0) sub_02004C4C(15); } - sub_02006350(); + ResetMicStatusFlags(); sub_0200605C(); return; @@ -509,7 +509,7 @@ BOOL sub_020059D0 (int param0, u16 param1, int param2, int param3, int param4, u u8 * v9 = sub_02003D5C(17); u8 * v10 = sub_02003D5C(18); u8 * v11 = sub_02003D5C(30); - UnkStruct_0202CC84 ** v12 = sub_02003D5C(36); + ChatotCryData ** v12 = sub_02003D5C(36); v4 = 0; v5 = 0; @@ -577,7 +577,7 @@ BOOL sub_020059D0 (int param0, u16 param1, int param2, int param3, int param4, u return 1; default: - sub_020063D4(1); + SetMicProcessingFlag(1); break; } } @@ -890,7 +890,7 @@ static BOOL sub_020060EC (u16 param0, s8 param1, u8 param2) *v1 = 1; - sub_020063D4(1); + SetMicProcessingFlag(1); v0 = sub_02005844(param0, param2); sub_02004F68(8, 0xffff, param1); diff --git a/src/unk_02006224.c b/src/unk_02006224.c index 148f5796bf..c56a843b20 100644 --- a/src/unk_02006224.c +++ b/src/unk_02006224.c @@ -11,20 +11,20 @@ #include "unk_0201D15C.h" #include "unk_0202CC64.h" -BOOL sub_02006224(void); -BOOL sub_02006260(const UnkStruct_0202CC84 * param0); -BOOL sub_0200629C(const UnkStruct_0202CC84 * param0, u32 param1, int param2, int param3); -void sub_02006350(void); -MICResult sub_0200637C(void); -MICResult sub_020063B8(void); -void sub_020063C0(UnkStruct_0202CC84 * param0); -void sub_020063D4(u8 param0); -BOOL sub_020063E4(UnkStruct_0202CC84 * param0, u32 param1, int param2, int param3); -BOOL sub_02006438(UnkStruct_0202CC84 * param0, u32 param1, int param2, int param3, u8 param4); -int Sound_Chatter(UnkStruct_0202CC84 * param0); -BOOL sub_020064C8(int param0); - -BOOL sub_02006224 (void) +BOOL CheckMicRecordingStatus(void); +BOOL IsChatotCryStructReadyForProcessing(const ChatotCryData * param0); +BOOL ProcessAudioInput(const ChatotCryData * param0, u32 param1, int param2, int param3); +void ResetMicStatusFlags(void); +MICResult StartMicSampling(void); +MICResult StopMicSampling(void); +void StoreMicDataInChatotCryStruct(ChatotCryData * param0); +void SetMicProcessingFlag(u8 param0); +BOOL ProcessChatotCryStructWithAudioParams(ChatotCryData * param0, u32 param1, int param2, int param3); +BOOL ProcessChatotCryStructWithExtendedAudioParams(ChatotCryData * param0, u32 param1, int param2, int param3, u8 param4); +int Sound_Chatter(ChatotCryData * param0); +BOOL IsAudioParamValid(int param0); + +BOOL CheckMicRecordingStatus (void) { u8 * v0 = sub_02003D5C(16); u8 * v1 = sub_02003D5C(30); @@ -32,11 +32,11 @@ BOOL sub_02006224 (void) if (*v1 == 1) { if (*v0 == 1) { if (sub_02004D04(14) == 0) { - sub_02006350(); + ResetMicStatusFlags(); return 1; } } else { - sub_02006350(); + ResetMicStatusFlags(); return 1; } } @@ -44,12 +44,12 @@ BOOL sub_02006224 (void) return 0; } -BOOL sub_02006260 (const UnkStruct_0202CC84 * param0) +BOOL IsChatotCryStructReadyForProcessing (const ChatotCryData * cry) { u8 * v0 = sub_02003D5C(31); u8 * v1 = sub_02003D5C(54); - if (sub_0202CCA4(param0) == 0) { + if (IsChatotCryDataValid(cry) == 0) { return 0; } @@ -64,14 +64,14 @@ BOOL sub_02006260 (const UnkStruct_0202CC84 * param0) return 1; } -BOOL sub_0200629C (const UnkStruct_0202CC84 * param0, u32 param1, int param2, int param3) +BOOL ProcessAudioInput (const ChatotCryData * param0, u32 param1, int param2, int param3) { u16 v0; int v1, v2; s8 * v3 = sub_02005014(); u8 * v4 = sub_02003D5C(30); - if (sub_02006260(param0) == 0) { + if (IsChatotCryStructReadyForProcessing(param0) == 0) { return 0; } @@ -82,11 +82,11 @@ BOOL sub_0200629C (const UnkStruct_0202CC84 * param0, u32 param1, int param2, in } sub_0200592C(0); - sub_02006350(); + ResetMicStatusFlags(); sub_02004BCC(14); v0 = (LCRNG_Next() % 8192); - sub_0202CCB4(v3, sub_0202CCB0(param0)); + ProcessChatotCryAudioData(v3, GetChatotCryAudioBuffer(param0)); { UnkStruct_02004CB4 v5; @@ -107,12 +107,12 @@ BOOL sub_0200629C (const UnkStruct_0202CC84 * param0, u32 param1, int param2, in } *v4 = 1; - sub_020063D4(0); + SetMicProcessingFlag(0); return v1; } -void sub_02006350 (void) +void ResetMicStatusFlags (void) { u8 * v0 = sub_02003D5C(16); u8 * v1 = sub_02003D5C(30); @@ -126,7 +126,7 @@ void sub_02006350 (void) return; } -MICResult sub_0200637C (void) +MICResult StartMicSampling (void) { MICAutoParam v0; @@ -146,18 +146,18 @@ MICResult sub_0200637C (void) return sub_02004B5C(&v0); } -MICResult sub_020063B8 (void) +MICResult StopMicSampling (void) { return sub_02004B64(); } -void sub_020063C0 (UnkStruct_0202CC84 * param0) +void StoreMicDataInChatotCryStruct (ChatotCryData * param0) { - sub_0202CCEC(param0, (const s8 *)sub_02005014()); + StoreProcessedAudioInChatotCryData(param0, (const s8 *)sub_02005014()); return; } -void sub_020063D4 (u8 param0) +void SetMicProcessingFlag (u8 param0) { u8 * v0 = sub_02003D5C(31); @@ -165,38 +165,38 @@ void sub_020063D4 (u8 param0) return; } -BOOL sub_020063E4 (UnkStruct_0202CC84 * param0, u32 param1, int param2, int param3) +BOOL ProcessChatotCryStructWithAudioParams (ChatotCryData * param0, u32 param1, int param2, int param3) { int v0; - UnkStruct_0202CC84 ** v1 = sub_02003D5C(36); + ChatotCryData ** v1 = sub_02003D5C(36); if (param0 == NULL) { - v0 = sub_0200629C(*v1, param1, param2, param3); + v0 = ProcessAudioInput(*v1, param1, param2, param3); } else { - v0 = sub_0200629C(param0, param1, param2, param3); + v0 = ProcessAudioInput(param0, param1, param2, param3); } if (v0 == 0) { - sub_020063D4(1); + SetMicProcessingFlag(1); v0 = sub_020059D0(0, 441, param3, param2, 11, 0); } return v0; } -BOOL sub_02006438 (UnkStruct_0202CC84 * param0, u32 param1, int param2, int param3, u8 param4) +BOOL ProcessChatotCryStructWithExtendedAudioParams (ChatotCryData * param0, u32 param1, int param2, int param3, u8 param4) { int v0; - UnkStruct_0202CC84 ** v1 = sub_02003D5C(36); + ChatotCryData ** v1 = sub_02003D5C(36); if (param0 == NULL) { - v0 = sub_0200629C(*v1, param1, param2, param3); + v0 = ProcessAudioInput(*v1, param1, param2, param3); } else { - v0 = sub_0200629C(param0, param1, param2, param3); + v0 = ProcessAudioInput(param0, param1, param2, param3); } if (v0 == 0) { - sub_020063D4(1); + SetMicProcessingFlag(1); sub_02005F4C(0, 441, param3, param2, 11, param4, 0); v0 = 1; } @@ -204,16 +204,16 @@ BOOL sub_02006438 (UnkStruct_0202CC84 * param0, u32 param1, int param2, int para return v0; } -int Sound_Chatter (UnkStruct_0202CC84 * param0) +int Sound_Chatter (ChatotCryData * param0) { const s8 * v0; s8 v1; - if (sub_0202CCA4(param0) == 0) { + if (IsChatotCryDataValid(param0) == 0) { return 0; } - v0 = sub_0202CCB0(param0); + v0 = GetChatotCryAudioBuffer(param0); v1 = v0[15]; if ((-128 <= v1) && (v1 < -30)) { @@ -227,7 +227,7 @@ int Sound_Chatter (UnkStruct_0202CC84 * param0) return 0; } -BOOL sub_020064C8 (int param0) +BOOL IsAudioParamValid (int param0) { switch (param0) { case 0: diff --git a/src/unk_0202440C.c b/src/unk_0202440C.c index a14501debf..cb4d673ccf 100644 --- a/src/unk_0202440C.c +++ b/src/unk_0202440C.c @@ -78,7 +78,7 @@ const SaveTableEntry gSaveTable[] = { { SAVE_TABLE_ENTRY_TRAINER_CARD, SAVE_BLOCK_ID_NORMAL, (SaveEntrySizeFunc)TrainerCard_SaveSize, (SaveEntryInitFunc)TrainerCard_Init }, { SAVE_TABLE_ENTRY_GAME_RECORDS, SAVE_BLOCK_ID_NORMAL, (SaveEntrySizeFunc)GameRecord_SaveSize, (SaveEntryInitFunc)GameRecord_Init }, { SAVE_TABLE_ENTRY_BALL_SEALS, SAVE_BLOCK_ID_NORMAL, (SaveEntrySizeFunc)BallSeal_SaveSize, (SaveEntryInitFunc)BallSeal_Init }, - { SAVE_TABLE_ENTRY_CHATOT, SAVE_BLOCK_ID_NORMAL, (SaveEntrySizeFunc)ChatotCry_SaveSize, (SaveEntryInitFunc)ChatotCry_Init }, + { SAVE_TABLE_ENTRY_CHATOT, SAVE_BLOCK_ID_NORMAL, (SaveEntrySizeFunc)GetSizeOfChatotCryData, (SaveEntryInitFunc)ChatotCry_Init }, { SAVE_TABLE_ENTRY_FRONTIER, SAVE_BLOCK_ID_NORMAL, (SaveEntrySizeFunc)Frontier_SaveSize, (SaveEntryInitFunc)Frontier_Init }, { SAVE_TABLE_ENTRY_RIBBONS, SAVE_BLOCK_ID_NORMAL, (SaveEntrySizeFunc)Ribbons_SaveSize, (SaveEntryInitFunc)Ribbons_Init }, { SAVE_TABLE_ENTRY_ENCOUNTERS, SAVE_BLOCK_ID_NORMAL, (SaveEntrySizeFunc)SpecialEncounter_SaveSize, (SaveEntryInitFunc)SpecialEncounter_Init }, diff --git a/src/unk_0202CC64.c b/src/unk_0202CC64.c index 07c4b7d0ef..4f03745d63 100644 --- a/src/unk_0202CC64.c +++ b/src/unk_0202CC64.c @@ -7,51 +7,51 @@ #include "unk_020244AC.h" #include "unk_0202CC64.h" -typedef struct UnkStruct_0202CC84_t { +typedef struct ChatotCryData_t { BOOL unk_00; s8 unk_04[1000]; -} UnkStruct_0202CC84; +} ChatotCryData; -int ChatotCry_SaveSize (void) +int GetSizeOfChatotCryData (void) { - return sizeof(UnkStruct_0202CC84); + return sizeof(ChatotCryData); } -void ChatotCry_Init (UnkStruct_0202CC84 * param0) +void ChatotCry_Init (ChatotCryData * param0) { - MI_CpuClear32(param0, sizeof(UnkStruct_0202CC84)); + MI_CpuClear32(param0, sizeof(ChatotCryData)); param0->unk_00 = 0; } -UnkStruct_0202CC84 * sub_0202CC84 (int param0) +ChatotCryData * AllocateAndInitializeChatotCryData (int param0) { - UnkStruct_0202CC84 * v0 = Heap_AllocFromHeap(param0, sizeof(UnkStruct_0202CC84)); + ChatotCryData * v0 = Heap_AllocFromHeap(param0, sizeof(ChatotCryData)); ChatotCry_Init(v0); return v0; } -UnkStruct_0202CC84 * sub_0202CC98 (SaveData * param0) +ChatotCryData * GetChatotCryDataFromSave (SaveData * param0) { - return (UnkStruct_0202CC84 *)SaveData_Get(param0, 22); + return (ChatotCryData *)SaveData_Get(param0, 22); } -BOOL sub_0202CCA4 (const UnkStruct_0202CC84 * param0) +BOOL IsChatotCryDataValid (const ChatotCryData * param0) { return param0->unk_00; } -void sub_0202CCA8 (UnkStruct_0202CC84 * param0) +void ResetChatotCryDataStatus (ChatotCryData * param0) { param0->unk_00 = 0; } -const void * sub_0202CCB0 (const UnkStruct_0202CC84 * param0) +const void * GetChatotCryAudioBuffer (const ChatotCryData * param0) { return param0->unk_04; } -void sub_0202CCB4 (s8 * param0, const s8 * param1) +void ProcessChatotCryAudioData (s8 * param0, const s8 * param1) { int v0, v1 = 0; s8 v2; @@ -72,7 +72,7 @@ void sub_0202CCB4 (s8 * param0, const s8 * param1) } } -void sub_0202CCEC (UnkStruct_0202CC84 * param0, const s8 * param1) +void StoreProcessedAudioInChatotCryData (ChatotCryData * param0, const s8 * param1) { int v0, v1; s8 v2; @@ -96,7 +96,7 @@ void sub_0202CCEC (UnkStruct_0202CC84 * param0, const s8 * param1) } } -void sub_0202CD3C (UnkStruct_0202CC84 * param0, const UnkStruct_0202CC84 * param1) +void CopyChatotCryData (ChatotCryData * param0, const ChatotCryData * param1) { - MI_CpuCopyFast(param1, param0, sizeof(UnkStruct_0202CC84)); + MI_CpuCopyFast(param1, param0, sizeof(ChatotCryData)); } diff --git a/src/unk_02046C7C.c b/src/unk_02046C7C.c index 5183e5c5fd..d8a271781a 100644 --- a/src/unk_02046C7C.c +++ b/src/unk_02046C7C.c @@ -121,7 +121,7 @@ BOOL sub_02046CFC (UnkStruct_0203E724 * param0) v8.unk_14 = sub_0202A750(param0->unk_34->unk_0C); v8.unk_18 = sub_02025E44(param0->unk_34->unk_0C); v8.unk_1C = param0->unk_34->unk_0C; - v8.unk_20 = sub_0202CC98(param0->unk_34->unk_0C); + v8.unk_20 = GetChatotCryDataFromSave(param0->unk_34->unk_0C); *v2 = sub_02093800(&v8); diff --git a/src/unk_020482D4.c b/src/unk_020482D4.c index 55894354a9..bf7a30cac6 100644 --- a/src/unk_020482D4.c +++ b/src/unk_020482D4.c @@ -223,7 +223,7 @@ BOOL sub_020484F8 (UnkStruct_0203E724 * param0) { u16 * v0 = inline_0204FCAC(param0); - if (sub_02006260(sub_0202CC98(param0->unk_34->unk_0C)) == 1) { + if (IsChatotCryStructReadyForProcessing(GetChatotCryDataFromSave(param0->unk_34->unk_0C)) == 1) { *v0 = 1; return 0; } @@ -236,7 +236,7 @@ BOOL sub_02048530 (UnkStruct_0203E724 * param0) { u16 * v0 = inline_0204FCAC(param0); - if (sub_0200637C() == MIC_RESULT_SUCCESS) { + if (StartMicSampling() == MIC_RESULT_SUCCESS) { *v0 = 1; return 0; } @@ -247,13 +247,13 @@ BOOL sub_02048530 (UnkStruct_0203E724 * param0) BOOL sub_0204855C (UnkStruct_0203E724 * param0) { - sub_020063B8(); + StopMicSampling(); return 1; } BOOL sub_02048568 (UnkStruct_0203E724 * param0) { - sub_020063C0(sub_0202CC98(param0->unk_34->unk_0C)); + StoreMicDataInChatotCryStruct(GetChatotCryDataFromSave(param0->unk_34->unk_0C)); return 1; } diff --git a/src/unk_02051D8C.c b/src/unk_02051D8C.c index 779c46bb7a..29fbe167d0 100644 --- a/src/unk_02051D8C.c +++ b/src/unk_02051D8C.c @@ -100,7 +100,7 @@ BattleParams * sub_02051D8C (int param0, u32 param1) } for (v0 = 0; v0 < 4; v0++) { - v1->unk_F0[v0] = sub_0202CC84(param0); + v1->unk_F0[v0] = AllocateAndInitializeChatotCryData(param0); } v1->unk_E0 = sub_0207D3C0(param0); @@ -245,9 +245,9 @@ void sub_02052184 (BattleParams * param0, const TrainerInfo * param1, int param2 TrainerInfo_Copy(param1, param0->unk_D0[param2]); } -void sub_020521A4 (BattleParams * param0, const UnkStruct_0202CC84 * param1, int param2) +void sub_020521A4 (BattleParams * param0, const ChatotCryData * param1, int param2) { - sub_0202CD3C(param0->unk_F0[param2], param1); + CopyChatotCryData(param0->unk_F0[param2], param1); } void sub_020521B8 (BattleParams * param0, const UnkStruct_0203CDB0 * param1, SaveData * param2, int param3, UnkStruct_0202B628 * param4, UnkStruct_0207D99C * param5, UnkStruct_0209C370 * param6) @@ -256,7 +256,7 @@ void sub_020521B8 (BattleParams * param0, const UnkStruct_0203CDB0 * param1, Sav Party * v1 = Party_GetFromSavedata(param2); UnkStruct_0207D3C0 * v2 = sub_0207D990(param2); UnkStruct_02026324 * v3 = sub_02027560(param2); - UnkStruct_0202CC84 * v4 = sub_0202CC98(param2); + ChatotCryData * v4 = GetChatotCryDataFromSave(param2); UnkStruct_020279FC * v5 = sub_02025E44(param2); UnkStruct_0203A790 * v6 = sub_0203A790(param2); @@ -311,7 +311,7 @@ void sub_02052348 (BattleParams * param0, const UnkStruct_0203CDB0 * param1, int Party * v3 = Party_GetFromSavedata(param1->unk_0C); UnkStruct_0207D3C0 * v4 = sub_0207D990(param1->unk_0C); UnkStruct_02026324 * v5 = sub_02027560(param1->unk_0C); - UnkStruct_0202CC84 * v6 = sub_0202CC98(param1->unk_0C); + ChatotCryData * v6 = GetChatotCryDataFromSave(param1->unk_0C); UnkStruct_020279FC * v7 = sub_02025E44(param1->unk_0C); Pokemon * v8; @@ -361,7 +361,7 @@ void sub_020524E4 (BattleParams * param0, const UnkStruct_0203CDB0 * param1, con TrainerInfo * v0 = sub_02025E38(param1->unk_0C); UnkStruct_0207D3C0 * v1 = sub_0207D990(param1->unk_0C); UnkStruct_02026324 * v2 = sub_02027560(param1->unk_0C); - UnkStruct_0202CC84 * v3 = sub_0202CC98(param1->unk_0C); + ChatotCryData * v3 = GetChatotCryDataFromSave(param1->unk_0C); UnkStruct_020279FC * v4 = sub_02025E44(param1->unk_0C); const UnkStruct_0202610C * v5 = param1->unk_B0; int v6, v7, v8; diff --git a/src/unk_02054884.c b/src/unk_02054884.c index 5d6017b3db..b58c469a53 100644 --- a/src/unk_02054884.c +++ b/src/unk_02054884.c @@ -41,7 +41,7 @@ BOOL sub_020548B0 (int param0, SaveData * param1, u16 param2, u8 param3, u16 par Pokemon_Init(v1); Pokemon_InitWith(v1, param2, param3, 32, 0, 0, 0, 0); - sub_02077E64(v1, v4, 4, param5, param6, param0); + InitializePokemonAfterCapture(v1, v4, 4, param5, param6, param0); v2 = param4; Pokemon_SetValue(v1, 6, &v2); diff --git a/src/unk_020559DC.c b/src/unk_020559DC.c index c787cdbac2..c36df1b541 100644 --- a/src/unk_020559DC.c +++ b/src/unk_020559DC.c @@ -101,7 +101,7 @@ static void sub_02055AC0 (UnkStruct_0203CDB0 * param0, s32 param1) Party * v0; v0 = Party_GetFromSavedata(param0->unk_0C); - sub_020777B4(v0, param1); + UpdatePokerusStatusInParty(v0, param1); } { diff --git a/src/unk_0207A6DC.c b/src/unk_0207A6DC.c index 8a869d63b2..bb7770affd 100644 --- a/src/unk_0207A6DC.c +++ b/src/unk_0207A6DC.c @@ -414,14 +414,14 @@ static void sub_0207AA90 (int param0, int param1, void * param2, void * param3) BOOL sub_0207AAA0 (UnkStruct_0207A778 * param0) { - UnkStruct_0202CC84 * v0; + ChatotCryData * v0; if (sub_02035B54() != 264) { return 0; } - v0 = (UnkStruct_0202CC84 *)¶m0->unk_20[0]; - sub_0202CD3C(v0, param0->unk_00->unk_F0[0]); + v0 = (ChatotCryData *)¶m0->unk_20[0]; + CopyChatotCryData(v0, param0->unk_00->unk_F0[0]); return 1; } diff --git a/src/unk_0208C324.c b/src/unk_0208C324.c index 4032356c10..95e6c7d92f 100644 --- a/src/unk_0208C324.c +++ b/src/unk_0208C324.c @@ -1102,9 +1102,9 @@ static void sub_0208D200 (UnkStruct_0208D7BC * param0, Pokemon * param1, UnkStru param2->unk_4E = Pokemon_GetValue(param1, MON_DATA_FORM, NULL); param2->unk_50_0 = sub_0208E9F0(param1); - if (sub_020778F8(param1) == 1) { + if (CanPokemonSpreadPokerus(param1) == 1) { param2->unk_50_30 = 2; - } else if (sub_020778D8(param1) == 1) { + } else if (IsPokemonInfectedWithPokerus(param1) == 1) { param2->unk_50_30 = 1; if (param2->unk_50_0 == 7) { @@ -1147,7 +1147,7 @@ static void sub_0208D618 (UnkStruct_0208D7BC * param0) sub_02078A4C(param0->unk_6A0, &v0, param0->unk_250.unk_0C, 1); if (param0->unk_250.unk_0C == 441) { - sub_02006438(param0->unk_24C->unk_28, 0, 100, 0, v0); + ProcessChatotCryStructWithExtendedAudioParams(param0->unk_24C->unk_28, 0, 100, 0, v0); } else { sub_0200590C(param0->unk_250.unk_0C, v0, param0->unk_250.unk_4E); } diff --git a/src/unk_0208FCF8.c b/src/unk_0208FCF8.c index 13a6988ee2..25f19a52f3 100644 --- a/src/unk_0208FCF8.c +++ b/src/unk_0208FCF8.c @@ -535,7 +535,7 @@ static void sub_02090578 (UnkStruct_0208D7BC * param0) static void sub_02090800 (Window * param0, Pokemon * param1, BOOL param2) { - UnkStruct_02090800 * v0 = sub_02092494(param1, param2, 19); + PokemonInfoDisplayStruct * v0 = sub_02092494(param1, param2, 19); if (v0->unk_14.unk_04 != NULL) { sub_0201D78C(param0, 0, v0->unk_14.unk_04, 0, 0 + (v0->unk_14.unk_00 - 1) * 16, 0xff, ((u32)(((1 & 0xff) << 16) | ((2 & 0xff) << 8) | ((0 & 0xff) << 0))), NULL); diff --git a/src/unk_02092494.c b/src/unk_02092494.c index ff00950354..615ef63bf7 100644 --- a/src/unk_02092494.c +++ b/src/unk_02092494.c @@ -13,25 +13,25 @@ #include "pokemon.h" #include "unk_02092494.h" -static int sub_02092E8C(Pokemon * param0, BOOL param1, int param2); -static void sub_02092878(UnkStruct_02090800 * param0); -static void sub_020928A0(UnkStruct_02090800 * param0, int param1); -static void sub_020929C0(UnkStruct_02090800 * param0, int param1); -static void sub_02092B1C(UnkStruct_02090800 * param0, int param1, int param2); -static void sub_02092C24(UnkStruct_02090800 * param0); -static void sub_02092E10(UnkStruct_02090800 * param0); -static void sub_02092E4C(UnkStruct_02090800 * param0); -static void sub_020932A4(BoxPokemon * param0, TrainerInfo * param1, int param2); -static void sub_020932F0(BoxPokemon * param0, int param1, int param2); -static void sub_02093368(BoxPokemon * param0, int param1); -static void sub_020933C8(BoxPokemon * param0); -static void sub_020933E8(BoxPokemon * param0); - -UnkStruct_02090800 * sub_02092494 (Pokemon * param0, BOOL param1, int param2) +static int DeterminePokemonStatus(Pokemon * param0, BOOL param1, int param2); +static void InitializeNatureRelatedStrBuf(PokemonInfoDisplayStruct * param0); +static void InitializePokemonMetInfoStrBuf(PokemonInfoDisplayStruct * param0, int param1); +static void InitializeAlternateMetInfoStrBuf(PokemonInfoDisplayStruct * param0, int param1); +static void InitializeSpecialMetInfoStrBuf(PokemonInfoDisplayStruct * param0, int param1, int param2); +static void InitializeIVsStrBuf(PokemonInfoDisplayStruct * param0); +static void InitializeFlavorAffinityStrBuf(PokemonInfoDisplayStruct * param0); +static void InitializeFriendshipLevelStrBuf(PokemonInfoDisplayStruct * param0); +static void AssignTrainerInfoToBoxPokemon(BoxPokemon * param0, TrainerInfo * param1, int param2); +static void SetMetLocationForBoxPokemon(BoxPokemon * param0, int param1, int param2); +static void ResetBoxPokemonEggStatus(BoxPokemon * param0, int param1); +static void FinalizeBoxPokemonData(BoxPokemon * param0); +static void UpdateBoxPokemonAfterCheck(BoxPokemon * param0); + +PokemonInfoDisplayStruct * sub_02092494 (Pokemon * param0, BOOL param1, int param2) { - UnkStruct_02090800 * v0; + PokemonInfoDisplayStruct * v0; - v0 = Heap_AllocFromHeap(param2, sizeof(UnkStruct_02090800)); + v0 = Heap_AllocFromHeap(param2, sizeof(PokemonInfoDisplayStruct)); v0->unk_00 = param2; v0->unk_04 = MessageLoader_Init(1, 26, 455, v0->unk_00); v0->unk_08 = sub_0200B368(9, 32, v0->unk_00); @@ -55,238 +55,238 @@ UnkStruct_02090800 * sub_02092494 (Pokemon * param0, BOOL param1, int param2) v0->unk_34.unk_04 = NULL; } - switch (sub_02092E8C(v0->unk_0C, v0->unk_10, v0->unk_00)) { + switch (DeterminePokemonStatus(v0->unk_0C, v0->unk_10, v0->unk_00)) { case 0: v0->unk_14.unk_00 = 1; - sub_02092878(v0); + InitializeNatureRelatedStrBuf(v0); v0->unk_1C.unk_00 = 2; - sub_020928A0(v0, 49); + InitializePokemonMetInfoStrBuf(v0, 49); v0->unk_24.unk_00 = 6; - sub_02092C24(v0); + InitializeIVsStrBuf(v0); v0->unk_2C.unk_00 = 7; - sub_02092E10(v0); + InitializeFlavorAffinityStrBuf(v0); break; case 1: v0->unk_14.unk_00 = 1; - sub_02092878(v0); + InitializeNatureRelatedStrBuf(v0); v0->unk_1C.unk_00 = 2; - sub_020928A0(v0, 50); + InitializePokemonMetInfoStrBuf(v0, 50); v0->unk_24.unk_00 = 6; - sub_02092C24(v0); + InitializeIVsStrBuf(v0); v0->unk_2C.unk_00 = 7; - sub_02092E10(v0); + InitializeFlavorAffinityStrBuf(v0); break; case 2: v0->unk_14.unk_00 = 1; - sub_02092878(v0); + InitializeNatureRelatedStrBuf(v0); v0->unk_1C.unk_00 = 2; - sub_020928A0(v0, 51); + InitializePokemonMetInfoStrBuf(v0, 51); v0->unk_24.unk_00 = 6; - sub_02092C24(v0); + InitializeIVsStrBuf(v0); v0->unk_2C.unk_00 = 7; - sub_02092E10(v0); + InitializeFlavorAffinityStrBuf(v0); break; case 3: v0->unk_14.unk_00 = 1; - sub_02092878(v0); + InitializeNatureRelatedStrBuf(v0); v0->unk_1C.unk_00 = 2; - sub_020928A0(v0, 52); + InitializePokemonMetInfoStrBuf(v0, 52); v0->unk_24.unk_00 = 8; - sub_02092C24(v0); + InitializeIVsStrBuf(v0); v0->unk_2C.unk_00 = 9; - sub_02092E10(v0); + InitializeFlavorAffinityStrBuf(v0); break; case 4: v0->unk_14.unk_00 = 1; - sub_02092878(v0); + InitializeNatureRelatedStrBuf(v0); v0->unk_1C.unk_00 = 2; - sub_020928A0(v0, 53); + InitializePokemonMetInfoStrBuf(v0, 53); v0->unk_24.unk_00 = 8; - sub_02092C24(v0); + InitializeIVsStrBuf(v0); v0->unk_2C.unk_00 = 9; - sub_02092E10(v0); + InitializeFlavorAffinityStrBuf(v0); break; case 5: v0->unk_14.unk_00 = 1; - sub_02092878(v0); + InitializeNatureRelatedStrBuf(v0); v0->unk_1C.unk_00 = 2; - sub_020928A0(v0, 54); + InitializePokemonMetInfoStrBuf(v0, 54); v0->unk_24.unk_00 = 8; - sub_02092C24(v0); + InitializeIVsStrBuf(v0); v0->unk_2C.unk_00 = 9; - sub_02092E10(v0); + InitializeFlavorAffinityStrBuf(v0); break; case 6: v0->unk_14.unk_00 = 1; - sub_02092878(v0); + InitializeNatureRelatedStrBuf(v0); v0->unk_1C.unk_00 = 2; - sub_020928A0(v0, 55); + InitializePokemonMetInfoStrBuf(v0, 55); v0->unk_24.unk_00 = 8; - sub_02092C24(v0); + InitializeIVsStrBuf(v0); v0->unk_2C.unk_00 = 9; - sub_02092E10(v0); + InitializeFlavorAffinityStrBuf(v0); break; case 7: v0->unk_14.unk_00 = 1; - sub_02092878(v0); + InitializeNatureRelatedStrBuf(v0); v0->unk_1C.unk_00 = 2; - sub_020928A0(v0, 56); + InitializePokemonMetInfoStrBuf(v0, 56); v0->unk_24.unk_00 = 7; - sub_02092C24(v0); + InitializeIVsStrBuf(v0); v0->unk_2C.unk_00 = 8; - sub_02092E10(v0); + InitializeFlavorAffinityStrBuf(v0); break; case 8: v0->unk_14.unk_00 = 1; - sub_02092878(v0); + InitializeNatureRelatedStrBuf(v0); v0->unk_1C.unk_00 = 2; - sub_020928A0(v0, 57); + InitializePokemonMetInfoStrBuf(v0, 57); v0->unk_24.unk_00 = 7; - sub_02092C24(v0); + InitializeIVsStrBuf(v0); v0->unk_2C.unk_00 = 8; - sub_02092E10(v0); + InitializeFlavorAffinityStrBuf(v0); break; case 9: v0->unk_14.unk_00 = 1; - sub_02092878(v0); + InitializeNatureRelatedStrBuf(v0); v0->unk_1C.unk_00 = 2; - sub_020928A0(v0, 58); + InitializePokemonMetInfoStrBuf(v0, 58); v0->unk_24.unk_00 = 9; - sub_02092C24(v0); + InitializeIVsStrBuf(v0); break; case 10: v0->unk_14.unk_00 = 1; - sub_02092878(v0); + InitializeNatureRelatedStrBuf(v0); v0->unk_1C.unk_00 = 2; - sub_020928A0(v0, 59); + InitializePokemonMetInfoStrBuf(v0, 59); v0->unk_24.unk_00 = 9; - sub_02092C24(v0); + InitializeIVsStrBuf(v0); break; case 11: v0->unk_14.unk_00 = 1; - sub_02092878(v0); + InitializeNatureRelatedStrBuf(v0); v0->unk_1C.unk_00 = 2; - sub_020928A0(v0, 60); + InitializePokemonMetInfoStrBuf(v0, 60); v0->unk_24.unk_00 = 9; - sub_02092C24(v0); + InitializeIVsStrBuf(v0); break; case 12: v0->unk_14.unk_00 = 1; - sub_02092878(v0); + InitializeNatureRelatedStrBuf(v0); v0->unk_1C.unk_00 = 2; - sub_020928A0(v0, 61); + InitializePokemonMetInfoStrBuf(v0, 61); v0->unk_24.unk_00 = 9; - sub_02092C24(v0); + InitializeIVsStrBuf(v0); break; case 13: v0->unk_14.unk_00 = 1; - sub_02092878(v0); + InitializeNatureRelatedStrBuf(v0); v0->unk_1C.unk_00 = 2; - sub_020928A0(v0, 62); + InitializePokemonMetInfoStrBuf(v0, 62); v0->unk_24.unk_00 = 9; - sub_02092C24(v0); + InitializeIVsStrBuf(v0); break; case 14: v0->unk_14.unk_00 = 1; - sub_02092878(v0); + InitializeNatureRelatedStrBuf(v0); v0->unk_1C.unk_00 = 2; - sub_020928A0(v0, 63); + InitializePokemonMetInfoStrBuf(v0, 63); v0->unk_24.unk_00 = 9; - sub_02092C24(v0); + InitializeIVsStrBuf(v0); break; case 15: v0->unk_14.unk_00 = 1; - sub_02092878(v0); + InitializeNatureRelatedStrBuf(v0); v0->unk_1C.unk_00 = 2; - sub_020929C0(v0, 64); + InitializeAlternateMetInfoStrBuf(v0, 64); v0->unk_24.unk_00 = 6; - sub_02092C24(v0); + InitializeIVsStrBuf(v0); v0->unk_2C.unk_00 = 7; - sub_02092E10(v0); + InitializeFlavorAffinityStrBuf(v0); break; case 16: v0->unk_1C.unk_00 = 1; - sub_02092B1C(v0, 101, 0); + InitializeSpecialMetInfoStrBuf(v0, 101, 0); v0->unk_34.unk_00 = 6; - sub_02092E4C(v0); + InitializeFriendshipLevelStrBuf(v0); break; case 17: v0->unk_1C.unk_00 = 1; - sub_02092B1C(v0, 102, 1); + InitializeSpecialMetInfoStrBuf(v0, 102, 1); v0->unk_34.unk_00 = 6; - sub_02092E4C(v0); + InitializeFriendshipLevelStrBuf(v0); break; case 18: v0->unk_1C.unk_00 = 1; - sub_02092B1C(v0, 103, 0); + InitializeSpecialMetInfoStrBuf(v0, 103, 0); v0->unk_34.unk_00 = 6; - sub_02092E4C(v0); + InitializeFriendshipLevelStrBuf(v0); break; case 19: v0->unk_1C.unk_00 = 1; - sub_02092B1C(v0, 103, 1); + InitializeSpecialMetInfoStrBuf(v0, 103, 1); v0->unk_34.unk_00 = 6; - sub_02092E4C(v0); + InitializeFriendshipLevelStrBuf(v0); break; case 20: v0->unk_1C.unk_00 = 1; - sub_02092B1C(v0, 104, 0); + InitializeSpecialMetInfoStrBuf(v0, 104, 0); v0->unk_34.unk_00 = 6; - sub_02092E4C(v0); + InitializeFriendshipLevelStrBuf(v0); break; } return v0; } -void sub_0209282C (UnkStruct_02090800 * param0) +void sub_0209282C (PokemonInfoDisplayStruct * param0) { if (param0->unk_14.unk_04 != NULL) { Heap_FreeToHeap(param0->unk_14.unk_04); @@ -313,7 +313,7 @@ void sub_0209282C (UnkStruct_02090800 * param0) Heap_FreeToHeap(param0); } -static void sub_02092878 (UnkStruct_02090800 * param0) +static void InitializeNatureRelatedStrBuf (PokemonInfoDisplayStruct * param0) { int v0 = Pokemon_GetNature(param0->unk_0C); @@ -325,7 +325,7 @@ static void sub_02092878 (UnkStruct_02090800 * param0) MessageLoader_GetStrbuf(param0->unk_04, (24 + v0), param0->unk_14.unk_04); } -static void sub_020928A0 (UnkStruct_02090800 * param0, int param1) +static void InitializePokemonMetInfoStrBuf (PokemonInfoDisplayStruct * param0, int param1) { Strbuf* v0 = Strbuf_Init((((2 * 18) * 2) * 8), param0->unk_00); @@ -345,7 +345,7 @@ static void sub_020928A0 (UnkStruct_02090800 * param0, int param1) Strbuf_Free(v0); } -static void sub_020929C0 (UnkStruct_02090800 * param0, int param1) +static void InitializeAlternateMetInfoStrBuf (PokemonInfoDisplayStruct * param0, int param1) { Strbuf* v0 = Strbuf_Init((((2 * 18) * 2) * 4), param0->unk_00); @@ -388,7 +388,7 @@ static void sub_020929C0 (UnkStruct_02090800 * param0, int param1) Strbuf_Free(v0); } -static void sub_02092B1C (UnkStruct_02090800 * param0, int param1, int param2) +static void InitializeSpecialMetInfoStrBuf (PokemonInfoDisplayStruct * param0, int param1, int param2) { Strbuf* v0 = Strbuf_Init((((2 * 18) * 2) * 5), param0->unk_00); @@ -421,7 +421,7 @@ static const u16 Unk_020F5578[6][5] = { {0x60, 0x61, 0x62, 0x63, 0x64} }; -static void sub_02092C24 (UnkStruct_02090800 * param0) +static void InitializeIVsStrBuf (PokemonInfoDisplayStruct * param0) { int v0[6], v1, v2; int v3, v4; @@ -596,7 +596,7 @@ static const u16 Unk_020F556C[6] = { 0x45 }; -static void sub_02092E10 (UnkStruct_02090800 * param0) +static void InitializeFlavorAffinityStrBuf (PokemonInfoDisplayStruct * param0) { int v0, v1, v2; @@ -613,7 +613,7 @@ static void sub_02092E10 (UnkStruct_02090800 * param0) MessageLoader_GetStrbuf(param0->unk_04, v2, param0->unk_2C.unk_04); } -static void sub_02092E4C (UnkStruct_02090800 * param0) +static void InitializeFriendshipLevelStrBuf (PokemonInfoDisplayStruct * param0) { int v0 = Pokemon_GetValue(param0->unk_0C, MON_DATA_FRIENDSHIP, NULL); int v1; @@ -633,7 +633,7 @@ static void sub_02092E4C (UnkStruct_02090800 * param0) MessageLoader_GetStrbuf(param0->unk_04, v1, param0->unk_34.unk_04); } -static int sub_02092E8C (Pokemon * param0, BOOL param1, int param2) +static int DeterminePokemonStatus (Pokemon * param0, BOOL param1, int param2) { int v0 = 0; @@ -718,10 +718,10 @@ static int sub_02092E8C (Pokemon * param0, BOOL param1, int param2) void sub_0209304C (Pokemon * param0, TrainerInfo * param1, int param2, int param3, int param4) { - sub_0209305C(¶m0->box, param1, param2, param3, param4); + ProcessBoxPokemonWithTrainerInfo(¶m0->box, param1, param2, param3, param4); } -void sub_0209305C (BoxPokemon * param0, TrainerInfo * param1, int param2, int param3, int param4) +void ProcessBoxPokemonWithTrainerInfo (BoxPokemon * param0, TrainerInfo * param1, int param2, int param3, int param4) { switch (param2) { case 0: @@ -730,64 +730,64 @@ void sub_0209305C (BoxPokemon * param0, TrainerInfo * param1, int param2, int pa } if (BoxPokemon_GetValue(param0, MON_DATA_IS_EGG, NULL) == 0) { - sub_02093368(param0, 0); - sub_020932F0(param0, param3, 1); - sub_020933C8(param0); + ResetBoxPokemonEggStatus(param0, 0); + SetMetLocationForBoxPokemon(param0, param3, 1); + FinalizeBoxPokemonData(param0); } else { - sub_020932F0(param0, param3, 0); - sub_02093368(param0, 1); + SetMetLocationForBoxPokemon(param0, param3, 0); + ResetBoxPokemonEggStatus(param0, 1); } - sub_020932A4(param0, param1, param4); + AssignTrainerInfoToBoxPokemon(param0, param1, param4); break; case 1: if (BoxPokemon_GetValue(param0, MON_DATA_IS_EGG, NULL) == 0) { - sub_02093368(param0, 0); - sub_020932F0(param0, (sub_02017070(1, 1)), 1); - sub_020933C8(param0); + ResetBoxPokemonEggStatus(param0, 0); + SetMetLocationForBoxPokemon(param0, (sub_02017070(1, 1)), 1); + FinalizeBoxPokemonData(param0); } else { - sub_02093368(param0, 0); - sub_020932F0(param0, (sub_02017070(1, 1)), 1); + ResetBoxPokemonEggStatus(param0, 0); + SetMetLocationForBoxPokemon(param0, (sub_02017070(1, 1)), 1); } break; case 2: - sub_02093368(param0, 0); - sub_020932F0(param0, (sub_02017070(0, 55)), 1); - sub_020933C8(param0); + ResetBoxPokemonEggStatus(param0, 0); + SetMetLocationForBoxPokemon(param0, (sub_02017070(0, 55)), 1); + FinalizeBoxPokemonData(param0); break; case 3: - sub_020932F0(param0, param3, 0); - sub_02093368(param0, 1); - sub_020932A4(param0, param1, param4); + SetMetLocationForBoxPokemon(param0, param3, 0); + ResetBoxPokemonEggStatus(param0, 1); + AssignTrainerInfoToBoxPokemon(param0, param1, param4); break; case 4: if (sub_0207884C(param0, param1, param4) == 1) { if (BoxPokemon_GetValue(param0, MON_DATA_IS_EGG, NULL) == 0) { - sub_02093368(param0, 0); - sub_020932F0(param0, param3, 1); - sub_020933C8(param0); + ResetBoxPokemonEggStatus(param0, 0); + SetMetLocationForBoxPokemon(param0, param3, 1); + FinalizeBoxPokemonData(param0); } else { - sub_020932F0(param0, param3, 0); - sub_02093368(param0, 1); + SetMetLocationForBoxPokemon(param0, param3, 0); + ResetBoxPokemonEggStatus(param0, 1); } } else { if (BoxPokemon_GetValue(param0, MON_DATA_IS_EGG, NULL) == 0) { - sub_02093368(param0, 0); - sub_020932F0(param0, param3, 1); - sub_020933C8(param0); + ResetBoxPokemonEggStatus(param0, 0); + SetMetLocationForBoxPokemon(param0, param3, 1); + FinalizeBoxPokemonData(param0); } else { - sub_02093368(param0, 0); - sub_020932F0(param0, param3, 1); + ResetBoxPokemonEggStatus(param0, 0); + SetMetLocationForBoxPokemon(param0, param3, 1); } } - sub_020933E8(param0); + UpdateBoxPokemonAfterCheck(param0); break; case 5: if (BoxPokemon_GetValue(param0, MON_DATA_IS_EGG, NULL) == 0) { (void)0; } else { - sub_020932F0(param0, (sub_02017070(1, 2)), 1); + SetMetLocationForBoxPokemon(param0, (sub_02017070(1, 2)), 1); } break; case 6: @@ -813,13 +813,13 @@ void sub_0209305C (BoxPokemon * param0, TrainerInfo * param1, int param2, int pa } } - sub_020932F0(param0, param3, 1); - sub_020932A4(param0, param1, param4); + SetMetLocationForBoxPokemon(param0, param3, 1); + AssignTrainerInfoToBoxPokemon(param0, param1, param4); break; } } -static void sub_020932A4 (BoxPokemon * param0, TrainerInfo * param1, int param2) +static void AssignTrainerInfoToBoxPokemon (BoxPokemon * param0, TrainerInfo * param1, int param2) { int v0 = TrainerInfo_ID(param1); int v1 = TrainerInfo_Gender(param1); @@ -831,7 +831,7 @@ static void sub_020932A4 (BoxPokemon * param0, TrainerInfo * param1, int param2) Strbuf_Free(v2); } -static void sub_020932F0 (BoxPokemon * param0, int param1, int param2) +static void SetMetLocationForBoxPokemon (BoxPokemon * param0, int param1, int param2) { RTCDate v0; @@ -850,7 +850,7 @@ static void sub_020932F0 (BoxPokemon * param0, int param1, int param2) } } -static void sub_02093368 (BoxPokemon * param0, int param1) +static void ResetBoxPokemonEggStatus (BoxPokemon * param0, int param1) { int v0 = 0; @@ -867,13 +867,13 @@ static void sub_02093368 (BoxPokemon * param0, int param1) } } -static void sub_020933C8 (BoxPokemon * param0) +static void FinalizeBoxPokemonData (BoxPokemon * param0) { int v0 = BoxPokemon_GetValue(param0, MON_DATA_LEVEL, NULL); BoxPokemon_SetValue(param0, 156, &v0); } -static void sub_020933E8 (BoxPokemon * param0) +static void UpdateBoxPokemonAfterCheck (BoxPokemon * param0) { int v0 = 1; BoxPokemon_SetValue(param0, 110, &v0); diff --git a/src/unk_020933F8.c b/src/unk_020933F8.c index 967eb02014..1a32ecf6ca 100644 --- a/src/unk_020933F8.c +++ b/src/unk_020933F8.c @@ -445,10 +445,10 @@ UnkStruct_02095C48 * sub_02093800 (const UnkStruct_02093800 * param0) } for (v2 = 0; v2 < 4; v2++) { - v0->unk_14C[v2] = sub_0202CC84(20); + v0->unk_14C[v2] = AllocateAndInitializeChatotCryData(20); } - sub_0202CD3C(v0->unk_14C[0], param0->unk_20); + CopyChatotCryData(v0->unk_14C[0], param0->unk_20); { Pokemon_Copy(param0->unk_08, v0->unk_00.unk_00[0]); @@ -808,7 +808,7 @@ static void sub_02093C6C (SysTask * param0, void * param1) } break; case 28: - MI_CpuCopy8(v0->unk_14C[0], v0->unk_569, ChatotCry_SaveSize()); + MI_CpuCopy8(v0->unk_14C[0], v0->unk_569, GetSizeOfChatotCryData()); sub_020364F0(12); v0->unk_568 = 0;