diff --git a/include/constants/sound.h b/include/constants/sound.h index d353843070..7d13fe5ee2 100644 --- a/include/constants/sound.h +++ b/include/constants/sound.h @@ -3,8 +3,20 @@ enum PokemonCryMod { POKECRY_NORMAL = 0, - - POKECRY_PINCH_NORMAL = 11, + POKECRY_HALF_DURATION, + POKECRY_FIELD_EVENT, + POKECRY_MID_MOVE, + POKECRY_HYPERVOICE_1, + POKECRY_FAINT, + POKECRY_HYPERVOICE_2, + POKECRY_HOWL_1, + POKECRY_HOWL_2, + POKECRY_UPROAR_1, + POKECRY_UPROAR_2, + POKECRY_PINCH_NORMAL, + POKECRY_PINCH_HALF_DURATION, + POKECRY_POKEDEX_CHORUS, + POKECRY_POKEDEX, }; #endif // POKEPLATINUM_CONSTANTS_SOUND_H diff --git a/include/overlay006/battle_params.h b/include/overlay006/battle_params.h index 2eb07f5f36..311ccd1ba9 100644 --- a/include/overlay006/battle_params.h +++ b/include/overlay006/battle_params.h @@ -7,7 +7,7 @@ #include "struct_decls/struct_02027F8C_decl.h" #include "struct_decls/struct_0202B628_decl.h" #include "struct_decls/struct_0202C878_decl.h" -#include "struct_decls/struct_0202CC84_decl.h" +#include "struct_defs/chatot_cry.h" #include "struct_decls/struct_0202CD88_decl.h" #include "struct_decls/struct_02056B24_decl.h" #include "struct_decls/struct_0206D140_decl.h" @@ -31,7 +31,7 @@ typedef struct { UnkStruct_0207D99C * unk_E4; UnkStruct_02026324 * unk_E8; PCBoxes * unk_EC; - UnkStruct_0202CC84 * unk_F0[4]; + ChatotCry * 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 a4fe65c754..1d08b6b625 100644 --- a/include/overlay016/ov16_0223DF00.h +++ b/include/overlay016/ov16_0223DF00.h @@ -18,7 +18,7 @@ #include "trainer_info.h" #include "struct_decls/struct_02026324_decl.h" #include "struct_defs/struct_020279FC.h" -#include "struct_decls/struct_0202CC84_decl.h" +#include "struct_defs/chatot_cry.h" #include "struct_defs/struct_0205AA50.h" #include "pokemon.h" #include "struct_decls/struct_020797DC_decl.h" @@ -204,7 +204,7 @@ int ov16_0223EDE0(BattleSystem * param0); u8 BattleSystem_TextSpeed(BattleSystem * param0); int BattleSystem_Ruleset(BattleSystem * param0); PokemonAnimationSys * ov16_0223EE28(BattleSystem * param0); -UnkStruct_0202CC84 * BattleSystem_ChatotVoice(BattleSystem * param0, int param1); +ChatotCry * 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 306bfe4de9..3d02198be3 100644 --- a/include/overlay016/struct_ov16_02264408.h +++ b/include/overlay016/struct_ov16_02264408.h @@ -5,7 +5,7 @@ #include "struct_decls/sprite_decl.h" #include "struct_decls/struct_0200C6E4_decl.h" #include "struct_decls/struct_02018340_decl.h" -#include "struct_decls/struct_0202CC84_decl.h" +#include "struct_defs/chatot_cry.h" #include "overlay016/struct_ov16_0223E0C8.h" #include "overlay016/struct_ov16_02264408_sub1.h" @@ -25,7 +25,7 @@ typedef struct { u32 unk_4C[4]; int unk_50; UnkStruct_ov16_02264408_sub1 unk_54; - UnkStruct_0202CC84 * unk_6C; + ChatotCry * unk_6C; u8 * unk_70; u16 * unk_74; } UnkStruct_ov16_02264408; diff --git a/include/pokemon.h b/include/pokemon.h index bb9e6026df..253c51d47a 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -1,6 +1,8 @@ #ifndef POKEPLATINUM_POKEMON_H #define POKEPLATINUM_POKEMON_H +#include "constants/sound.h" + #include "struct_decls/struct_02002F38_decl.h" #include "struct_decls/struct_02006C24_decl.h" #include "struct_defs/sprite_animation_frame.h" @@ -11,7 +13,7 @@ #include "struct_decls/cell_actor_data.h" #include "struct_decls/pokemon_animation_sys_decl.h" #include "trainer_info.h" -#include "struct_decls/struct_0202CC84_decl.h" +#include "struct_defs/chatot_cry.h" #include "struct_decls/struct_02078B40_decl.h" #include "struct_decls/struct_party_decl.h" #include "overlay005/struct_ov5_021DE5D0.h" @@ -919,8 +921,36 @@ 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); +/** + * @brief Play a Pokemon's cry, according to the given species and form number. + * + * @param chatotCry Chatot cry data from the save block. Only used + * if the Pokemon itself is Chatot. + * @param crymod Modification to apply to the Pokemon's cry. + * @param species + * @param form + * @param pan + * @param volume + * @param forceDefaultChatot If TRUE, force usage of Chatot's default cry. + * @param heapID + */ +void Pokemon_PlayCry(ChatotCry *chatotCry, enum PokemonCryMod crymod, u16 species, int form, int pan, int volume, int forceDefaultChatot, int heapID); + +/** + * @brief Play a Pokemon's cry, according to the given species and form number. + * + * @param chatotCry Chatot cry data from the save block. Only used + * if the Pokemon itself is Chatot. + * @param crymod Modification to apply to the Pokemon's cry. + * @param species + * @param form + * @param pan + * @param volume + * @param forceDefaultChatot If TRUE, force usage of Chatot's default cry. + * @param heapID + * @param delay Number of frames until playback will begin. + */ +void Pokemon_PlayDelayedCry(ChatotCry *chatotCry, enum PokemonCryMod crymod, u16 species, int form, int pan, int volume, int forceDefaultChatot, int heapID, u8 delay); BOOL sub_02077E3C(Pokemon *mon); void Pokemon_SetCatchData(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); diff --git a/include/struct_decls/struct_0202CC84_decl.h b/include/struct_decls/struct_0202CC84_decl.h deleted file mode 100644 index 9bd363927f..0000000000 --- a/include/struct_decls/struct_0202CC84_decl.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef POKEPLATINUM_STRUCT_0202CC84_DECL_H -#define POKEPLATINUM_STRUCT_0202CC84_DECL_H - -typedef struct UnkStruct_0202CC84_t UnkStruct_0202CC84; - -#endif // POKEPLATINUM_STRUCT_0202CC84_DECL_H diff --git a/include/struct_defs/battle_system.h b/include/struct_defs/battle_system.h index 2c008cf9f4..3c59cba8a6 100644 --- a/include/struct_defs/battle_system.h +++ b/include/struct_defs/battle_system.h @@ -19,7 +19,7 @@ #include "struct_decls/struct_02026324_decl.h" #include "struct_defs/struct_020279FC.h" #include "struct_decls/struct_02027F8C_decl.h" -#include "struct_decls/struct_0202CC84_decl.h" +#include "struct_defs/chatot_cry.h" #include "struct_decls/struct_0202CD88_decl.h" #include "struct_decls/struct_02056B24_decl.h" #include "struct_defs/struct_0205AA50.h" @@ -65,7 +65,7 @@ struct BattleSystem { UnkStruct_02026324 *pokedex; PCBoxes *pcBoxes; Party *parties[4]; - UnkStruct_0202CC84 * unk_78[4]; + ChatotCry * unk_78[4]; UnkStruct_02007768 * unk_88; UnkStruct_ov12_0221FCDC * unk_8C; UnkStruct_0200C6E4 * unk_90; diff --git a/include/struct_defs/chatot_cry.h b/include/struct_defs/chatot_cry.h new file mode 100644 index 0000000000..37ec9ea703 --- /dev/null +++ b/include/struct_defs/chatot_cry.h @@ -0,0 +1,11 @@ +#ifndef POKEPLATINUM_STRUCT_DEF_CHATOT_CRY_H +#define POKEPLATINUM_STRUCT_DEF_CHATOT_CRY_H + +#define CHATOT_CRY_SIZE 1000 + +typedef struct ChatotCry { + BOOL exists; + s8 data[CHATOT_CRY_SIZE]; +} ChatotCry; + +#endif // POKEPLATINUM_STRUCT_DEF_CHATOT_CRY_H diff --git a/include/struct_defs/struct_02095E80_t.h b/include/struct_defs/struct_02095E80_t.h index 0784c2fc17..98ccba01fe 100644 --- a/include/struct_defs/struct_02095E80_t.h +++ b/include/struct_defs/struct_02095E80_t.h @@ -19,7 +19,7 @@ #include "struct_defs/struct_02027F8C.h" #include "struct_decls/struct_02027F8C_decl.h" #include "struct_decls/struct_0202B370_decl.h" -#include "struct_decls/struct_0202CC84_decl.h" +#include "struct_defs/chatot_cry.h" #include "struct_decls/struct_0203CDB0_decl.h" #include "struct_defs/struct_0205AA50.h" #include "struct_decls/struct_party_decl.h" @@ -110,7 +110,7 @@ struct UnkStruct_02095E80_t { int (* unk_226C)(UnkStruct_02095E80 *); Party * unk_2270; Party * unk_2274; - UnkStruct_0202CC84 * unk_2278; + ChatotCry * 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..3a1c618044 100644 --- a/include/struct_defs/struct_02098D38.h +++ b/include/struct_defs/struct_02098D38.h @@ -2,7 +2,7 @@ #define POKEPLATINUM_STRUCT_02098D38_H #include "struct_defs/struct_020279FC.h" -#include "struct_decls/struct_0202CC84_decl.h" +#include "struct_defs/chatot_cry.h" typedef struct { void * unk_00; @@ -22,7 +22,7 @@ typedef struct { u32 unk_1C; void * unk_20; void * unk_24; - UnkStruct_0202CC84 * unk_28; + ChatotCry * unk_28; BOOL unk_2C; } UnkStruct_02098D38; diff --git a/include/unk_02003B60.h b/include/unk_02003B60.h index 3c02baf761..b90f910f73 100644 --- a/include/unk_02003B60.h +++ b/include/unk_02003B60.h @@ -3,11 +3,11 @@ #include "struct_decls/struct_02003D54_decl.h" #include "struct_defs/struct_020279FC.h" -#include "struct_decls/struct_0202CC84_decl.h" +#include "struct_defs/chatot_cry.h" #include -void sub_02003B60(UnkStruct_0202CC84 * param0, UnkStruct_020279FC * param1); +void sub_02003B60(ChatotCry * param0, UnkStruct_020279FC * param1); void sub_02003BD8(void); void sub_02003D0C(int param0); UnkStruct_02003D54 * sub_02003D54(void); diff --git a/include/unk_02005474.h b/include/unk_02005474.h index f8edb8d720..c90ed9ca28 100644 --- a/include/unk_02005474.h +++ b/include/unk_02005474.h @@ -25,8 +25,8 @@ BOOL sub_02005844(u16 param0, u8 param1); BOOL sub_0200590C(u16 param0, u8 param1, u8 param2); void sub_0200592C(int param0); int sub_0200598C(void); -BOOL sub_020059D0(int param0, u16 param1, int param2, int param3, int param4, u8 param5); -void sub_02005F4C(int param0, u16 param1, int param2, int param3, int param4, u8 param5, u8 param6); +BOOL Sound_PlayPokemonCry(int param0, u16 param1, int param2, int param3, int param4, u8 param5); +void Sound_PlayDelayedPokemonCry(int param0, u16 param1, int param2, int param3, int param4, u8 param5, u8 param6); void sub_0200605C(void); BOOL sub_02006150(u16 param0); int sub_0200619C(void); diff --git a/include/unk_02006224.h b/include/unk_02006224.h index e59d2b18d6..41548f85f3 100644 --- a/include/unk_02006224.h +++ b/include/unk_02006224.h @@ -1,21 +1,21 @@ #ifndef POKEPLATINUM_UNK_02006224_H #define POKEPLATINUM_UNK_02006224_H -#include "struct_decls/struct_0202CC84_decl.h" +#include "struct_defs/chatot_cry.h" #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); +BOOL sub_02006260(const ChatotCry * param0); +BOOL sub_0200629C(const ChatotCry * 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); +void sub_020063C0(ChatotCry * param0); +void Sound_FlagDefaultChatotCry(u8 param0); +BOOL Sound_PlayChatotCry(ChatotCry * param0, u32 param1, int param2, int param3); +BOOL Sound_PlayDelayedChatotCry(ChatotCry * param0, u32 param1, int param2, int param3, u8 param4); +int Sound_Chatter(ChatotCry * param0); +BOOL Sound_CanPlayChatotCry(int param0); #endif // POKEPLATINUM_UNK_02006224_H diff --git a/include/unk_0202CC64.h b/include/unk_0202CC64.h index 091097227d..b28120292e 100644 --- a/include/unk_0202CC64.h +++ b/include/unk_0202CC64.h @@ -1,18 +1,18 @@ #ifndef POKEPLATINUM_UNK_0202CC64_H #define POKEPLATINUM_UNK_0202CC64_H -#include "struct_decls/struct_0202CC84_decl.h" +#include "struct_defs/chatot_cry.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 ChatotCry_Init(ChatotCry * param0); +ChatotCry * sub_0202CC84(int param0); +ChatotCry * sub_0202CC98(SaveData * param0); +BOOL sub_0202CCA4(const ChatotCry * param0); +void sub_0202CCA8(ChatotCry * param0); +const void * sub_0202CCB0(const ChatotCry * 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); +void sub_0202CCEC(ChatotCry * param0, const s8 * param1); +void sub_0202CD3C(ChatotCry * param0, const ChatotCry * param1); #endif // POKEPLATINUM_UNK_0202CC64_H diff --git a/include/unk_02051D8C.h b/include/unk_02051D8C.h index 28b5082912..4114c8c26c 100644 --- a/include/unk_02051D8C.h +++ b/include/unk_02051D8C.h @@ -3,7 +3,7 @@ #include "trainer_info.h" #include "struct_decls/struct_0202B628_decl.h" -#include "struct_decls/struct_0202CC84_decl.h" +#include "struct_defs/chatot_cry.h" #include "struct_decls/struct_0203CDB0_decl.h" #include "pokemon.h" #include "struct_decls/struct_party_decl.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 ChatotCry * 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/src/overlay005/ov5_021E622C.c b/src/overlay005/ov5_021E622C.c index d26a0dd3b4..4b0eee2ab7 100644 --- a/src/overlay005/ov5_021E622C.c +++ b/src/overlay005/ov5_021E622C.c @@ -7,7 +7,7 @@ #include "struct_decls/struct_02026218_decl.h" #include "struct_decls/struct_02026224_decl.h" #include "struct_decls/struct_02026310_decl.h" -#include "struct_decls/struct_0202CC84_decl.h" +#include "struct_defs/chatot_cry.h" #include "struct_decls/struct_0202CD88_decl.h" #include "pokemon.h" #include "struct_decls/struct_party_decl.h" @@ -2041,7 +2041,7 @@ 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); + ChatotCry * v7 = sub_0202CC98(param3); sub_0202CCA8(v7); } } diff --git a/src/overlay006/ov6_0223E140.c b/src/overlay006/ov6_0223E140.c index b3663b3e4c..58eb4eab19 100644 --- a/src/overlay006/ov6_0223E140.c +++ b/src/overlay006/ov6_0223E140.c @@ -1136,7 +1136,7 @@ static BOOL ov6_0223EBDC (UnkStruct_ov6_0223EA98 * param0) sub_02017350(¶m0->unk_24, param0->unk_E4.unk_00, v2, param0->unk_F4.unk_00); if (v0[0] && v0[1]) { - sub_020059D0(0, 480, 0, 100, 4, 0); + Sound_PlayPokemonCry(0, 480, 0, 100, 4, 0); param0->unk_18++; } break; @@ -1359,7 +1359,7 @@ static BOOL ov6_0223EE5C (UnkStruct_ov6_0223EA98 * param0) } param0->unk_D0 = 0; - sub_020059D0(0, 481, 0, 100, 4, 0); + Sound_PlayPokemonCry(0, 481, 0, 100, 4, 0); param0->unk_18++; break; case 16: @@ -1500,7 +1500,7 @@ static BOOL ov6_0223F744 (UnkStruct_ov6_0223EA98 * param0) sub_02017350(¶m0->unk_24, param0->unk_E4.unk_00, v2, param0->unk_F4.unk_00); if (v0[0] && v0[1]) { - sub_020059D0(0, 482, 0, 100, 4, 0); + Sound_PlayPokemonCry(0, 482, 0, 100, 4, 0); param0->unk_18++; } diff --git a/src/overlay012/ov12_0221FC20.c b/src/overlay012/ov12_0221FC20.c index b21aafe84e..995e68e407 100644 --- a/src/overlay012/ov12_0221FC20.c +++ b/src/overlay012/ov12_0221FC20.c @@ -12,7 +12,7 @@ #include "struct_decls/struct_02014014_decl.h" #include "struct_decls/struct_02018340_decl.h" #include "struct_decls/sys_task.h" -#include "struct_decls/struct_0202CC84_decl.h" +#include "struct_defs/chatot_cry.h" #include "struct_decls/battle_system.h" #include "overlay012/struct_ov12_0222118C_decl.h" #include "overlay012/struct_ov12_022211D8_decl.h" @@ -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; + ChatotCry * 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); + Pokemon_PlayCry(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 7ea8ece307..033f35b9af 100644 --- a/src/overlay016/ov16_0223DF00.c +++ b/src/overlay016/ov16_0223DF00.c @@ -21,7 +21,7 @@ #include "strbuf.h" #include "trainer_info.h" #include "struct_decls/struct_02026324_decl.h" -#include "struct_decls/struct_0202CC84_decl.h" +#include "struct_defs/chatot_cry.h" #include "struct_decls/struct_020797DC_decl.h" #include "struct_decls/struct_party_decl.h" #include "struct_decls/battle_system.h" @@ -143,7 +143,7 @@ int ov16_0223EDE0(BattleSystem * param0); u8 BattleSystem_TextSpeed(BattleSystem * param0); int BattleSystem_Ruleset(BattleSystem * param0); PokemonAnimationSys * ov16_0223EE28(BattleSystem * param0); -UnkStruct_0202CC84 * BattleSystem_ChatotVoice(BattleSystem * param0, int param1); +ChatotCry * 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); @@ -1056,7 +1056,7 @@ PokemonAnimationSys * ov16_0223EE28 (BattleSystem * param0) return param0->unk_1C4; } -UnkStruct_0202CC84 * BattleSystem_ChatotVoice (BattleSystem * param0, int param1) +ChatotCry * 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_0225CBB8.c b/src/overlay016/ov16_0225CBB8.c index 09dc6dfd08..30b3c0993c 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; PokeSprite_LoadCryDelay(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); + Pokemon_PlayDelayedCry(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; PokeSprite_LoadCryDelay(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); + Pokemon_PlayDelayedCry(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; PokeSprite_LoadCryDelay(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); + Pokemon_PlayDelayedCry(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; PokeSprite_LoadCryDelay(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); + Pokemon_PlayDelayedCry(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; PokeSprite_LoadCryDelay(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); + Pokemon_PlayDelayedCry(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; PokeSprite_LoadCryDelay(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); + Pokemon_PlayDelayedCry(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; PokeSprite_LoadCryDelay(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); + Pokemon_PlayDelayedCry(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; PokeSprite_LoadCryDelay(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); + Pokemon_PlayDelayedCry(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; PokeSprite_LoadCryDelay(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); + Pokemon_PlayDelayedCry(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; PokeSprite_LoadCryDelay(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); + Pokemon_PlayDelayedCry(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; PokeSprite_LoadCryDelay(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); + Pokemon_PlayDelayedCry(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); + Pokemon_PlayDelayedCry(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 e9312d66ac..6bc77d332f 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); + Pokemon_PlayCry(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..62e4e60542 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); + Pokemon_PlayCry(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 8857ada0b0..61d76c54b0 100644 --- a/src/overlay019/ov19_021D0D80.c +++ b/src/overlay019/ov19_021D0D80.c @@ -11,7 +11,7 @@ #include "struct_decls/struct_0200B358_decl.h" #include "struct_decls/sys_task.h" #include "struct_decls/struct_02023FCC_decl.h" -#include "struct_decls/struct_0202CC84_decl.h" +#include "struct_defs/chatot_cry.h" #include "pokemon.h" #include "struct_decls/struct_020797DC_decl.h" #include "struct_decls/struct_party_decl.h" @@ -330,7 +330,7 @@ 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); + ChatotCry * v1 = sub_0202CC98(v0->unk_11C); sub_0202CCA8(v1); } diff --git a/src/overlay021/ov21_021DE668.c b/src/overlay021/ov21_021DE668.c index a91fbf7df2..3ec757e2b3 100644 --- a/src/overlay021/ov21_021DE668.c +++ b/src/overlay021/ov21_021DE668.c @@ -228,7 +228,7 @@ static int ov21_021DE79C (UnkStruct_ov21_021E6A68 * param0, void * param1) switch (param0->unk_00) { case 0: if (v0->unk_1C == 1) { - sub_020059D0(14, ov21_021D37BC(v0->unk_04), 0x1ff, 0x1ff, 0x1ff, 0); + Sound_PlayPokemonCry(14, ov21_021D37BC(v0->unk_04), 0x1ff, 0x1ff, 0x1ff, 0); v0->unk_1C = 0; } diff --git a/src/overlay021/ov21_021E4CA4.c b/src/overlay021/ov21_021E4CA4.c index c699e877ec..54ef4680d3 100644 --- a/src/overlay021/ov21_021E4CA4.c +++ b/src/overlay021/ov21_021E4CA4.c @@ -1266,7 +1266,7 @@ static void ov21_021E5DE8 (UnkStruct_ov21_021E51DC * param0, UnkStruct_ov21_021E { param0->unk_2C = 1; - sub_020059D0(13, param2, 0, 127, 0x1ff, 0); + Sound_PlayPokemonCry(13, param2, 0, 127, 0x1ff, 0); ov21_021E5F00(param0); } diff --git a/src/overlay021/ov21_021E8D48.c b/src/overlay021/ov21_021E8D48.c index 32f6094654..87b88bf0b2 100644 --- a/src/overlay021/ov21_021E8D48.c +++ b/src/overlay021/ov21_021E8D48.c @@ -703,7 +703,7 @@ static void ov21_021E9828 (SysTask * param0, void * param1) } break; case 2: - v1 = sub_020059D0(14, v0->unk_220, 0x1ff, 0x1ff, 0x1ff, 0); + v1 = Sound_PlayPokemonCry(14, v0->unk_220, 0x1ff, 0x1ff, 0x1ff, 0); GF_ASSERT(v1); v0->unk_21C++; break; diff --git a/src/overlay079/ov79_021D2268.c b/src/overlay079/ov79_021D2268.c index 23ecde7eb3..8c9ffb5c21 100644 --- a/src/overlay079/ov79_021D2268.c +++ b/src/overlay079/ov79_021D2268.c @@ -694,10 +694,10 @@ static int ov79_021D2AF0 (UnkStruct_ov79_021D2928 * param0, UnkStruct_ov79_021D2 switch (param0->unk_30.unk_09) { case 1: - sub_020059D0(11, param0->unk_30.unk_04, 0, 127, param0->unk_00, v0); + Sound_PlayPokemonCry(11, param0->unk_30.unk_04, 0, 127, param0->unk_00, v0); break; default: - sub_020059D0(0, param0->unk_30.unk_04, 0, 127, param0->unk_00, v0); + Sound_PlayPokemonCry(0, param0->unk_30.unk_04, 0, 127, param0->unk_00, v0); break; } diff --git a/src/overlay087/ov87_021D106C.c b/src/overlay087/ov87_021D106C.c index 80639ae6a1..1150dabbfe 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); + Sound_FlagDefaultChatotCry(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); + Sound_FlagDefaultChatotCry(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 0184803ad4..93de3cbe9a 100644 --- a/src/overlay088/ov88_0223B140.c +++ b/src/overlay088/ov88_0223B140.c @@ -14,7 +14,7 @@ #include "trainer_info.h" #include "struct_decls/struct_0202B370_decl.h" #include "struct_decls/struct_0202B628_decl.h" -#include "struct_decls/struct_0202CC84_decl.h" +#include "struct_defs/chatot_cry.h" #include "struct_decls/struct_020507E4_decl.h" #include "pokemon.h" #include "struct_decls/struct_party_decl.h" @@ -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(ChatotCry * param0); static void ov88_0223E894(UnkStruct_02095E80 * param0); static void ov88_0223E8B4(UnkStruct_02095E80 * param0); static int ov88_0223E8D0(UnkStruct_02095E80 * param0); @@ -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); + Sound_PlayChatotCry(sub_0202CC98(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 (ChatotCry * 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 = (ChatotCry *)param0->unk_2E6C[sub_0203608C() ^ 1]; sub_0208E9C0(¶m0->unk_0C, sub_02032EE8(sub_0203608C() ^ 1)); } @@ -2528,7 +2528,7 @@ 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); + ChatotCry * v4 = sub_0202CC98(param4->unk_10); sub_0202CCA8(v4); } diff --git a/src/overlay094/ov94_02242AD0.c b/src/overlay094/ov94_02242AD0.c index 0bacc9b4af..1ee3747d12 100644 --- a/src/overlay094/ov94_02242AD0.c +++ b/src/overlay094/ov94_02242AD0.c @@ -8,7 +8,7 @@ #include "struct_decls/struct_0202440C_decl.h" #include "struct_decls/struct_0202B628_decl.h" #include "struct_decls/struct_0202C878_decl.h" -#include "struct_decls/struct_0202CC84_decl.h" +#include "struct_defs/chatot_cry.h" #include "struct_decls/struct_0202DA40_decl.h" #include "struct_decls/struct_020507E4_decl.h" #include "pokemon.h" @@ -1264,7 +1264,7 @@ 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); + ChatotCry * v2 = sub_0202CC98(param0->unk_00->unk_20); sub_0202CCA8(v2); } } diff --git a/src/overlay100/ov100_021D13E4.c b/src/overlay100/ov100_021D13E4.c index 262e4e55ae..27f963e4fb 100644 --- a/src/overlay100/ov100_021D13E4.c +++ b/src/overlay100/ov100_021D13E4.c @@ -124,7 +124,7 @@ BOOL ov100_021D14A8 (void * param0) } if (v0->unk_04 == v2[v0->unk_08]) { - sub_020059D0(0, v4[v0->unk_08], 0, 100, 111, 0); + Sound_PlayPokemonCry(0, v4[v0->unk_08], 0, 100, 111, 0); } if ((++v0->unk_04) >= v1[v0->unk_08]) { diff --git a/src/overlay100/ov100_021D1C44.c b/src/overlay100/ov100_021D1C44.c index 67c504745b..48882feefc 100644 --- a/src/overlay100/ov100_021D1C44.c +++ b/src/overlay100/ov100_021D1C44.c @@ -515,11 +515,11 @@ BOOL ov100_021D2428 (void * param0) } if (v0->unk_04 == 15 + 25) { - sub_020059D0(0, 483, -80, 40, 111, 0); + Sound_PlayPokemonCry(0, 483, -80, 40, 111, 0); } if (v0->unk_04 == 40 + 25) { - sub_020059D0(0, 484, +80, 40, 111, 0); + Sound_PlayPokemonCry(0, 484, +80, 40, 111, 0); } if (v0->unk_04 < 15 + 25) { @@ -557,7 +557,7 @@ BOOL ov100_021D2428 (void * param0) sub_02017348(&v0->unk_1A0.unk_934[1].unk_00, 0); sub_02017348(&v0->unk_1A0.unk_934[2].unk_00, 1); - sub_020059D0(2, 487, 0, 127, 111, 0); + Sound_PlayPokemonCry(2, 487, 0, 127, 111, 0); v0->unk_04 = 0; v0->unk_00++; @@ -597,7 +597,7 @@ BOOL ov100_021D2428 (void * param0) break; case 19: if ((++v0->unk_04) == 238) { - sub_020059D0(2, 487, 0, 127, 111, 0); + Sound_PlayPokemonCry(2, 487, 0, 127, 111, 0); } if (v0->unk_04 == 170) { diff --git a/src/overlay100/ov100_021D2F0C.c b/src/overlay100/ov100_021D2F0C.c index 48d80d23a7..09022dfe36 100644 --- a/src/overlay100/ov100_021D2F0C.c +++ b/src/overlay100/ov100_021D2F0C.c @@ -370,7 +370,7 @@ static void ov100_021D37F4 (SysTask * param0, void * param1) break; case 1: if ((++v0->unk_04) >= NELEMS(v1)) { - sub_020059D0(0, v0->unk_08, v0->unk_0C, 80, 111, 0); + Sound_PlayPokemonCry(0, v0->unk_08, v0->unk_0C, 80, 111, 0); v0->unk_00++; } else { sub_0201736C(&v0->unk_10->unk_00, FX32_CONST(v1[v0->unk_04]), FX32_CONST(1.00f), FX32_CONST(1.00f)); diff --git a/src/pokemon.c b/src/pokemon.c index 736dec94f7..d1c54ad6f7 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -1,6 +1,14 @@ #include #include +#include "consts/generated/c/gender.h" + +#include "constants/items.h" +#include "constants/moves.h" +#include "constants/pokemon.h" +#include "constants/sound.h" +#include "constants/species.h" + #include "inlines.h" #include "struct_decls/struct_02002F38_decl.h" @@ -10,7 +18,7 @@ #include "struct_decls/struct_0200C704_decl.h" #include "struct_decls/pokemon_animation_sys_decl.h" #include "struct_decls/struct_02023790_decl.h" -#include "struct_decls/struct_0202CC84_decl.h" +#include "struct_defs/chatot_cry.h" #include "struct_decls/struct_party_decl.h" #include "struct_defs/sprite_animation_frame.h" @@ -49,12 +57,6 @@ #include "unk_02092494.h" #include "flags.h" -#include "consts/generated/c/gender.h" -#include "constants/pokemon.h" -#include "constants/species.h" -#include "constants/items.h" -#include "constants/moves.h" - // Columns: Spicy, Dry, Sweet, Bitter, Sour // TODO enum here? static const s8 sNatureFlavorAffinities[][5] = { @@ -4172,40 +4174,44 @@ 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 Pokemon_PlayCry(ChatotCry *chatotCry, enum PokemonCryMod crymod, u16 species, int form, int pan, int volume, int forceDefaultChatot, int heapID) { - if (monSpecies == SPECIES_CHATOT) { - if (sub_020064C8(param1) == 0) { - sub_020063D4(1); - sub_020059D0(param1, monSpecies, param4, param5, param7, param3); + if (species == SPECIES_CHATOT) { + if (Sound_CanPlayChatotCry(crymod) == FALSE) { + Sound_FlagDefaultChatotCry(TRUE); + Sound_PlayPokemonCry(crymod, species, pan, volume, heapID, form); } else { - if (param6) { - sub_020063D4(1); + if (forceDefaultChatot) { + Sound_FlagDefaultChatotCry(TRUE); } - sub_020063E4(param0, NULL, param5, param4); + Sound_PlayChatotCry(chatotCry, NULL, volume, pan); } - } else { - sub_020059D0(param1, monSpecies, param4, param5, param7, param3); + + return; } + + Sound_PlayPokemonCry(crymod, species, pan, volume, heapID, form); } -void sub_02077DB4(UnkStruct_0202CC84 *param0, int param1, u16 monSpecies, int param3, int param4, int param5, int param6, int param7, u8 param8) +void Pokemon_PlayDelayedCry(ChatotCry *chatotCry, enum PokemonCryMod crymod, u16 species, int form, int pan, int volume, int forceDefaultChatot, int heapID, u8 delay) { - if (monSpecies == SPECIES_CHATOT) { - if (sub_020064C8(param1) == 0) { - sub_020063D4(1); - sub_02005F4C(param1, monSpecies, param4, param5, param7, param8, param3); + if (species == SPECIES_CHATOT) { + if (Sound_CanPlayChatotCry(crymod) == FALSE) { + Sound_FlagDefaultChatotCry(TRUE); + Sound_PlayDelayedPokemonCry(crymod, species, pan, volume, heapID, delay, form); } else { - if (param6) { - sub_020063D4(1); + if (forceDefaultChatot) { + Sound_FlagDefaultChatotCry(TRUE); } - sub_02006438(param0, NULL, param5, param4, param8); + Sound_PlayDelayedChatotCry(chatotCry, NULL, volume, pan, delay); } - } else { - sub_02005F4C(param1, monSpecies, param4, param5, param7, param8, param3); + + return; } + + Sound_PlayDelayedPokemonCry(crymod, species, pan, volume, heapID, delay, form); } BOOL sub_02077E3C(Pokemon *mon) diff --git a/src/unk_02003B60.c b/src/unk_02003B60.c index 4076d7b04b..98ba3e4b55 100644 --- a/src/unk_02003B60.c +++ b/src/unk_02003B60.c @@ -3,7 +3,7 @@ #include "struct_decls/struct_02003D54_decl.h" #include "struct_decls/sys_task.h" -#include "struct_decls/struct_0202CC84_decl.h" +#include "struct_defs/chatot_cry.h" #include "struct_defs/struct_020052C8.h" #include "struct_defs/struct_020279FC.h" @@ -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]; + ChatotCry * unk_BCD98; + ChatotCry * 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(ChatotCry * 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 (ChatotCry * param0, UnkStruct_020279FC * param1) { UnkStruct_02003D54 * v0 = sub_02003D54(); @@ -132,7 +132,7 @@ void sub_02003BD8 (void) v1->unk_BCDD0[v0]--; if (v1->unk_BCDD0[v0] == 0) { - sub_020059D0(v1->unk_BCDAC[v0], v1->unk_BCDCC[v0], v1->unk_BCDB4[v0], v1->unk_BCDBC[v0], v1->unk_BCDC4[v0], 0); + Sound_PlayPokemonCry(v1->unk_BCDAC[v0], v1->unk_BCDCC[v0], v1->unk_BCDB4[v0], v1->unk_BCDBC[v0], v1->unk_BCDC4[v0], 0); } } } diff --git a/src/unk_02005474.c b/src/unk_02005474.c index 43884cd274..798b7592c9 100644 --- a/src/unk_02005474.c +++ b/src/unk_02005474.c @@ -1,8 +1,10 @@ #include #include +#include "constants/species.h" + #include "struct_decls/sys_task.h" -#include "struct_decls/struct_0202CC84_decl.h" +#include "struct_defs/chatot_cry.h" #include "unk_02003B60.h" #include "unk_020041CC.h" @@ -46,11 +48,11 @@ BOOL sub_02005844(u16 param0, u8 param1); BOOL sub_0200590C(u16 param0, u8 param1, u8 param2); void sub_0200592C(int param0); int sub_0200598C(void); -BOOL sub_020059D0(int param0, u16 param1, int param2, int param3, int param4, u8 param5); +BOOL Sound_PlayPokemonCry(int param0, u16 param1, int param2, int param3, int param4, u8 param5); void sub_02005E64(int param0, int param1); static void sub_02005EB0(SysTask * param0, void * param1); void sub_02005F24(void); -void sub_02005F4C(int param0, u16 param1, int param2, int param3, int param4, u8 param5, u8 param6); +void Sound_PlayDelayedPokemonCry(int param0, u16 param1, int param2, int param3, int param4, u8 param5, u8 param6); static BOOL sub_02006038(u16 param0, u8 param1); void sub_0200605C(void); static BOOL sub_020060EC(u16 param0, s8 param1, u8 param2); @@ -407,7 +409,7 @@ BOOL sub_02005844 (u16 param0, u8 param1) u16 v0; int v1; u8 * v2 = sub_02003D5C(18); - UnkStruct_0202CC84 ** v3 = sub_02003D5C(36); + ChatotCry ** v3 = sub_02003D5C(36); u8 * v4 = sub_02003D5C(53); v0 = param0; @@ -424,7 +426,7 @@ BOOL sub_02005844 (u16 param0, u8 param1) if (v0 == 441) { if (sub_0200629C(*v3, 0, 127, 0) == 1) { - sub_020063D4(0); + Sound_FlagDefaultChatotCry(0); return 1; } } @@ -441,7 +443,7 @@ BOOL sub_02005844 (u16 param0, u8 param1) sub_02004AA0(v0, 8); } - sub_020063D4(0); + Sound_FlagDefaultChatotCry(0); if (v1 == 0) { (void)0; @@ -452,7 +454,7 @@ BOOL sub_02005844 (u16 param0, u8 param1) BOOL sub_0200590C (u16 param0, u8 param1, u8 param2) { - sub_02005F4C(0, param0, 0, 127, 11, param1, param2); + Sound_PlayDelayedPokemonCry(0, param0, 0, 127, 11, param1, param2); return 1; } @@ -499,7 +501,7 @@ int sub_0200598C (void) return sub_02004B04(0); } -BOOL sub_020059D0 (int param0, u16 param1, int param2, int param3, int param4, u8 param5) +BOOL Sound_PlayPokemonCry (int param0, u16 param1, int param2, int param3, int param4, u8 param5) { int v0, v1; u16 v2; @@ -509,7 +511,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); + ChatotCry ** v12 = sub_02003D5C(36); v4 = 0; v5 = 0; @@ -522,8 +524,8 @@ BOOL sub_020059D0 (int param0, u16 param1, int param2, int param3, int param4, u } if (v2 != 494) { - if ((v2 > 495) || (v2 == 0)) { - v2 = 1; + if ((v2 > MAX_SPECIES) || (v2 == 0)) { + v2 = SPECIES_BULBASAUR; } } @@ -552,7 +554,7 @@ BOOL sub_020059D0 (int param0, u16 param1, int param2, int param3, int param4, u sub_02004C4C(15); } - if (v2 == 441) { + if (v2 == SPECIES_CHATOT) { switch (param0) { case 0: case 1: @@ -577,7 +579,7 @@ BOOL sub_020059D0 (int param0, u16 param1, int param2, int param3, int param4, u return 1; default: - sub_020063D4(1); + Sound_FlagDefaultChatotCry(1); break; } } @@ -779,7 +781,7 @@ void sub_02005F24 () return; } -void sub_02005F4C (int param0, u16 param1, int param2, int param3, int param4, u8 param5, u8 param6) +void Sound_PlayDelayedPokemonCry (int param0, u16 param1, int param2, int param3, int param4, u8 param5, u8 param6) { u16 v0; int * v1; @@ -822,7 +824,7 @@ void sub_02005F4C (int param0, u16 param1, int param2, int param3, int param4, u } if (param5 == 0) { - sub_020059D0(param0, v0, param2, param3, param4, param6); + Sound_PlayPokemonCry(param0, v0, param2, param3, param4, param6); return; } @@ -890,7 +892,7 @@ static BOOL sub_020060EC (u16 param0, s8 param1, u8 param2) *v1 = 1; - sub_020063D4(1); + Sound_FlagDefaultChatotCry(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..66e1da6579 100644 --- a/src/unk_02006224.c +++ b/src/unk_02006224.c @@ -1,7 +1,7 @@ #include #include -#include "struct_decls/struct_0202CC84_decl.h" +#include "struct_defs/chatot_cry.h" #include "struct_defs/struct_02004CB4.h" @@ -12,17 +12,17 @@ #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); +BOOL sub_02006260(const ChatotCry * param0); +BOOL sub_0200629C(const ChatotCry * 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); +void sub_020063C0(ChatotCry * param0); +void Sound_FlagDefaultChatotCry(u8 param0); +BOOL Sound_PlayChatotCry(ChatotCry * param0, u32 param1, int param2, int param3); +BOOL Sound_PlayDelayedChatotCry(ChatotCry * param0, u32 param1, int param2, int param3, u8 param4); +int Sound_Chatter(ChatotCry * param0); +BOOL Sound_CanPlayChatotCry(int param0); BOOL sub_02006224 (void) { @@ -44,7 +44,7 @@ BOOL sub_02006224 (void) return 0; } -BOOL sub_02006260 (const UnkStruct_0202CC84 * param0) +BOOL sub_02006260 (const ChatotCry * param0) { u8 * v0 = sub_02003D5C(31); u8 * v1 = sub_02003D5C(54); @@ -64,7 +64,7 @@ BOOL sub_02006260 (const UnkStruct_0202CC84 * param0) return 1; } -BOOL sub_0200629C (const UnkStruct_0202CC84 * param0, u32 param1, int param2, int param3) +BOOL sub_0200629C (const ChatotCry * param0, u32 param1, int param2, int param3) { u16 v0; int v1, v2; @@ -107,7 +107,7 @@ BOOL sub_0200629C (const UnkStruct_0202CC84 * param0, u32 param1, int param2, in } *v4 = 1; - sub_020063D4(0); + Sound_FlagDefaultChatotCry(0); return v1; } @@ -151,13 +151,13 @@ MICResult sub_020063B8 (void) return sub_02004B64(); } -void sub_020063C0 (UnkStruct_0202CC84 * param0) +void sub_020063C0 (ChatotCry * param0) { sub_0202CCEC(param0, (const s8 *)sub_02005014()); return; } -void sub_020063D4 (u8 param0) +void Sound_FlagDefaultChatotCry (u8 param0) { u8 * v0 = sub_02003D5C(31); @@ -165,10 +165,10 @@ void sub_020063D4 (u8 param0) return; } -BOOL sub_020063E4 (UnkStruct_0202CC84 * param0, u32 param1, int param2, int param3) +BOOL Sound_PlayChatotCry (ChatotCry * param0, u32 param1, int param2, int param3) { int v0; - UnkStruct_0202CC84 ** v1 = sub_02003D5C(36); + ChatotCry ** v1 = sub_02003D5C(36); if (param0 == NULL) { v0 = sub_0200629C(*v1, param1, param2, param3); @@ -177,17 +177,17 @@ BOOL sub_020063E4 (UnkStruct_0202CC84 * param0, u32 param1, int param2, int para } if (v0 == 0) { - sub_020063D4(1); - v0 = sub_020059D0(0, 441, param3, param2, 11, 0); + Sound_FlagDefaultChatotCry(1); + v0 = Sound_PlayPokemonCry(0, 441, param3, param2, 11, 0); } return v0; } -BOOL sub_02006438 (UnkStruct_0202CC84 * param0, u32 param1, int param2, int param3, u8 param4) +BOOL Sound_PlayDelayedChatotCry (ChatotCry * param0, u32 param1, int param2, int param3, u8 param4) { int v0; - UnkStruct_0202CC84 ** v1 = sub_02003D5C(36); + ChatotCry ** v1 = sub_02003D5C(36); if (param0 == NULL) { v0 = sub_0200629C(*v1, param1, param2, param3); @@ -196,15 +196,15 @@ BOOL sub_02006438 (UnkStruct_0202CC84 * param0, u32 param1, int param2, int para } if (v0 == 0) { - sub_020063D4(1); - sub_02005F4C(0, 441, param3, param2, 11, param4, 0); + Sound_FlagDefaultChatotCry(1); + Sound_PlayDelayedPokemonCry(0, 441, param3, param2, 11, param4, 0); v0 = 1; } return v0; } -int Sound_Chatter (UnkStruct_0202CC84 * param0) +int Sound_Chatter (ChatotCry * param0) { const s8 * v0; s8 v1; @@ -227,7 +227,7 @@ int Sound_Chatter (UnkStruct_0202CC84 * param0) return 0; } -BOOL sub_020064C8 (int param0) +BOOL Sound_CanPlayChatotCry (int param0) { switch (param0) { case 0: diff --git a/src/unk_0202CC64.c b/src/unk_0202CC64.c index 07c4b7d0ef..16521409d2 100644 --- a/src/unk_0202CC64.c +++ b/src/unk_0202CC64.c @@ -2,53 +2,49 @@ #include #include "struct_decls/struct_021C0794_decl.h" +#include "struct_defs/chatot_cry.h" #include "heap.h" #include "unk_020244AC.h" #include "unk_0202CC64.h" -typedef struct UnkStruct_0202CC84_t { - BOOL unk_00; - s8 unk_04[1000]; -} UnkStruct_0202CC84; - int ChatotCry_SaveSize (void) { - return sizeof(UnkStruct_0202CC84); + return sizeof(ChatotCry); } -void ChatotCry_Init (UnkStruct_0202CC84 * param0) +void ChatotCry_Init (ChatotCry * param0) { - MI_CpuClear32(param0, sizeof(UnkStruct_0202CC84)); - param0->unk_00 = 0; + MI_CpuClear32(param0, sizeof(ChatotCry)); + param0->exists = FALSE; } -UnkStruct_0202CC84 * sub_0202CC84 (int param0) +ChatotCry * sub_0202CC84 (int param0) { - UnkStruct_0202CC84 * v0 = Heap_AllocFromHeap(param0, sizeof(UnkStruct_0202CC84)); + ChatotCry * v0 = Heap_AllocFromHeap(param0, sizeof(ChatotCry)); ChatotCry_Init(v0); return v0; } -UnkStruct_0202CC84 * sub_0202CC98 (SaveData * param0) +ChatotCry * sub_0202CC98 (SaveData * param0) { - return (UnkStruct_0202CC84 *)SaveData_Get(param0, 22); + return (ChatotCry *)SaveData_Get(param0, 22); } -BOOL sub_0202CCA4 (const UnkStruct_0202CC84 * param0) +BOOL sub_0202CCA4 (const ChatotCry * param0) { - return param0->unk_00; + return param0->exists; } -void sub_0202CCA8 (UnkStruct_0202CC84 * param0) +void sub_0202CCA8 (ChatotCry * param0) { - param0->unk_00 = 0; + param0->exists = FALSE; } -const void * sub_0202CCB0 (const UnkStruct_0202CC84 * param0) +const void * sub_0202CCB0 (const ChatotCry * param0) { - return param0->unk_04; + return param0->data; } void sub_0202CCB4 (s8 * param0, const s8 * param1) @@ -72,31 +68,31 @@ void sub_0202CCB4 (s8 * param0, const s8 * param1) } } -void sub_0202CCEC (UnkStruct_0202CC84 * param0, const s8 * param1) +void sub_0202CCEC (ChatotCry * param0, const s8 * param1) { int v0, v1; s8 v2; u8 v3; - param0->unk_00 = 1; + param0->exists = TRUE; v1 = 0; for (v0 = 0; v0 < 1000 * 2; v0 += 2) { v2 = (param1[v0] / 16); v3 = v2 + 8; - param0->unk_04[v1] = v3; + param0->data[v1] = v3; v2 = (param1[v0 + 1] / 16); v3 = v2 + 8; - param0->unk_04[v1] |= (v3 << 4); + param0->data[v1] |= (v3 << 4); v1++; } } -void sub_0202CD3C (UnkStruct_0202CC84 * param0, const UnkStruct_0202CC84 * param1) +void sub_0202CD3C (ChatotCry * param0, const ChatotCry * param1) { - MI_CpuCopyFast(param1, param0, sizeof(UnkStruct_0202CC84)); + MI_CpuCopyFast(param1, param0, sizeof(ChatotCry)); } diff --git a/src/unk_02051D8C.c b/src/unk_02051D8C.c index d906dee323..686d937e13 100644 --- a/src/unk_02051D8C.c +++ b/src/unk_02051D8C.c @@ -8,7 +8,7 @@ #include "trainer_info.h" #include "struct_decls/struct_02026324_decl.h" #include "struct_decls/struct_0202B628_decl.h" -#include "struct_decls/struct_0202CC84_decl.h" +#include "struct_defs/chatot_cry.h" #include "struct_decls/struct_0203A790_decl.h" #include "pokemon.h" #include "struct_decls/struct_party_decl.h" @@ -245,7 +245,7 @@ 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 ChatotCry * param1, int param2) { sub_0202CD3C(param0->unk_F0[param2], param1); } @@ -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); + ChatotCry * v4 = sub_0202CC98(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); + ChatotCry * v6 = sub_0202CC98(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); + ChatotCry * v3 = sub_0202CC98(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_0207A6DC.c b/src/unk_0207A6DC.c index 8a869d63b2..7fac2abe71 100644 --- a/src/unk_0207A6DC.c +++ b/src/unk_0207A6DC.c @@ -5,7 +5,7 @@ #include "struct_decls/sys_task.h" #include "trainer_info.h" -#include "struct_decls/struct_0202CC84_decl.h" +#include "struct_defs/chatot_cry.h" #include "struct_decls/struct_party_decl.h" #include "struct_decls/battle_system.h" @@ -414,13 +414,13 @@ static void sub_0207AA90 (int param0, int param1, void * param2, void * param3) BOOL sub_0207AAA0 (UnkStruct_0207A778 * param0) { - UnkStruct_0202CC84 * v0; + ChatotCry * v0; if (sub_02035B54() != 264) { return 0; } - v0 = (UnkStruct_0202CC84 *)¶m0->unk_20[0]; + v0 = (ChatotCry *)¶m0->unk_20[0]; sub_0202CD3C(v0, param0->unk_00->unk_F0[0]); return 1; diff --git a/src/unk_0208C324.c b/src/unk_0208C324.c index c5f5364886..eb817dac90 100644 --- a/src/unk_0208C324.c +++ b/src/unk_0208C324.c @@ -1147,7 +1147,7 @@ static void sub_0208D618 (UnkStruct_0208D7BC * param0) PokeSprite_LoadCryDelay(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); + Sound_PlayDelayedChatotCry(param0->unk_24C->unk_28, 0, 100, 0, v0); } else { sub_0200590C(param0->unk_250.unk_0C, v0, param0->unk_250.unk_4E); }