From 3e5dd1d047bada52ab0dce2fe58b04e39bcaa1cc Mon Sep 17 00:00:00 2001 From: Seth Barberee Date: Fri, 22 Oct 2021 10:01:07 -0700 Subject: Death by 74 files (#65) * death by 74 files * 20% reached * doc move stuff in pokemon * fix undef reference * doc more and plumb a few more constanst for num party members and num moves * that struct is def PokemonMove.. clean up all code with it --- include/constants/global.h | 6 ++++++ include/constants/mailbox.h | 6 ++++++ include/constants/personality_test.h | 3 --- include/constants/wonder_mail.h | 4 ++++ include/debug_menu.h | 27 +++++++++++++++++++++++++++ include/dungeon_entity.h | 2 +- include/dungeon_global_data.h | 2 +- include/exclusive_pokemon.h | 1 + include/friend_area_action_menu.h | 15 ++++----------- include/gulpin_shop.h | 2 +- include/input.h | 2 ++ include/item.h | 4 ++++ include/m4a.h | 5 +++-- include/mailbox.h | 7 ++++++- include/music.h | 3 ++- include/play_time.h | 4 ++++ include/pokemon.h | 22 ++++++++-------------- include/rescue_team_info.h | 2 ++ include/team_inventory.h | 2 ++ include/wonder_mail.h | 3 +-- 20 files changed, 85 insertions(+), 37 deletions(-) create mode 100644 include/constants/mailbox.h (limited to 'include') diff --git a/include/constants/global.h b/include/constants/global.h index f4e5961..5512b6a 100644 --- a/include/constants/global.h +++ b/include/constants/global.h @@ -3,5 +3,11 @@ #define POKEMON_NAME_LENGTH 10 #define TEAM_NAME_LENGTH 10 +#define MAX_TEAM_MEMBERS 4 + +#define MAX_MON_MOVES 4 + +#define MALE 0 +#define FEMALE 1 #endif // GUARD_CONSTANTS_GLOBAL_H diff --git a/include/constants/mailbox.h b/include/constants/mailbox.h new file mode 100644 index 0000000..6a91862 --- /dev/null +++ b/include/constants/mailbox.h @@ -0,0 +1,6 @@ +#ifndef GUARD_CONSTANTS_MAILBOX_H +#define GUARD_CONSTANTS_MAILBOX_H + +#define MAX_ACCEPTED_JOBS 8 + +#endif // GUARD_CONSTANTS_MAILBOX_H diff --git a/include/constants/personality_test.h b/include/constants/personality_test.h index bd6f159..cfb9c3d 100644 --- a/include/constants/personality_test.h +++ b/include/constants/personality_test.h @@ -22,7 +22,4 @@ enum NaturePersonalities { #define NUM_QUIZ_QUESTIONS 55 #define MAX_ASKED_QUESTIONS 8 -#define MALE 0 -#define FEMALE 1 - #endif diff --git a/include/constants/wonder_mail.h b/include/constants/wonder_mail.h index ab5a9ee..7ddaac7 100644 --- a/include/constants/wonder_mail.h +++ b/include/constants/wonder_mail.h @@ -25,4 +25,8 @@ enum RewardType END_REWARDS }; +#define NUM_POKEMON_NEWS 56 // 50 normal + 6 special issues +#define PASSWORD_BUFFER_SIZE 54 +#define MAX_ITEM_REWARDS 3 + #endif //GUARD_CONSTANTS_WONDER_MAIL_H diff --git a/include/debug_menu.h b/include/debug_menu.h index 4e0c951..ea3b3d6 100644 --- a/include/debug_menu.h +++ b/include/debug_menu.h @@ -2,6 +2,7 @@ #define GUARD_DEBUG_MENU_H #include "text.h" +#include "menu.h" enum DebugMenuOptions { @@ -24,6 +25,32 @@ struct DebugMenu }; +struct unkStruct_203B3F8 +{ + // size: 0x140 + u32 state; + s16 unk4; + u16 unk6; + struct PokemonStruct *pokemon; + u32 unkC; + const char *unk10; + u8 fill14[0x60 - 0x14]; + u32 unk60; + u32 unk64; + u32 unk68; + u32 unk6C; + u32 unk70; + u32 unk74; + struct UnkTextStruct2 *unk78; + u32 unk7C; + u32 unk80; + u8 fill84[0x90 - 0x84]; + struct MenuItem unk90[8]; + u16 unkD0[8]; + struct UnkTextStruct2 unkE0[4]; +}; + + void CreateDebugMenu(void); void DeleteDebugMenu(void); u32 UpdateDebugMenu(void); diff --git a/include/dungeon_entity.h b/include/dungeon_entity.h index 12bb3da..57ea24b 100644 --- a/include/dungeon_entity.h +++ b/include/dungeon_entity.h @@ -179,7 +179,7 @@ struct DungeonEntityData // Unclear where this is set in-game; it is not set by statuses (e.g., confusion) or mission clients. /* 0x114 */ bool8 moveRandomly; u8 fill115[0x118 - 0x115]; - /* 0x118 */ struct PokemonMove moves[4]; + /* 0x118 */ struct PokemonMove moves[MAX_MON_MOVES]; /* 0x138 */ u8 struggleMoveFlags; u8 fill139[0x13C - 0x139]; /* 0x13C */ u32 belly; diff --git a/include/dungeon_global_data.h b/include/dungeon_global_data.h index bc1ad46..fd2aa0b 100644 --- a/include/dungeon_global_data.h +++ b/include/dungeon_global_data.h @@ -72,7 +72,7 @@ struct DungeonGlobalData u8 fill11444[0x1356C - 0x11484]; u8 unk1356C; u8 fill1356D[0x1357C - 0x1356D]; - /* 0x1357C */ struct DungeonEntity *teamPokemon[4]; + /* 0x1357C */ struct DungeonEntity *teamPokemon[MAX_TEAM_MEMBERS]; /* 0x1358C */ struct DungeonEntity *wildPokemon[0x10]; /* 0x135CC */ struct DungeonEntity *allPokemon[0x14]; // Contains both team and wild Pokémon /* 0x1361C */ struct DungeonEntity *clientPokemon[2]; // Not sure how large this array is. diff --git a/include/exclusive_pokemon.h b/include/exclusive_pokemon.h index ee3e607..3fd09ea 100644 --- a/include/exclusive_pokemon.h +++ b/include/exclusive_pokemon.h @@ -31,6 +31,7 @@ struct ExclusivePokemonData .in_brt = TRUE, \ } +extern struct ExclusivePokemonData *gUnknown_203B498; void LoadExclusivePokemon(void); struct ExclusivePokemonData *GetExclusivePokemon(void); diff --git a/include/friend_area_action_menu.h b/include/friend_area_action_menu.h index e1d07ec..6a3f330 100644 --- a/include/friend_area_action_menu.h +++ b/include/friend_area_action_menu.h @@ -1,24 +1,17 @@ #ifndef GUARD_FRIEND_AREA_ACTION_MENU_H #define GUARD_FRIEND_AREA_ACTION_MENU_H -struct unkSubStruct_203B2BC -{ - u8 fill0[0x2C]; - u32 unk2C; -}; - - struct unkStruct_203B2BC { // size: 0x1E0 u32 state; u32 unk4; - s16 unk8; + s16 targetPoke; u16 unkA; - u32 unkC; - struct HeldItem unk10; + u32 itemIndex; + struct HeldItem itemToGive; struct ItemSlot unk14; - struct unkSubStruct_203B2BC *unk18; + struct PokemonStruct *unk18; u32 unk1C; u32 unk20; u32 unk24; diff --git a/include/gulpin_shop.h b/include/gulpin_shop.h index ffa65a1..1d6f53d 100644 --- a/include/gulpin_shop.h +++ b/include/gulpin_shop.h @@ -13,7 +13,7 @@ struct unkStruct_203B26C u32 unk0; s32 state; u32 unk8; - s16 unkC; + s16 speciesNum; // species of chosen Pokemon u8 unkE; struct unkStruct_Gulpin * unk10; u32 unk14; diff --git a/include/input.h b/include/input.h index 89b6039..fb1322b 100644 --- a/include/input.h +++ b/include/input.h @@ -12,6 +12,8 @@ struct Inputs /* 0xC */ s32 repeatTimerDpad; }; +extern struct Inputs gRealInputs; + struct InputTimers { /* 0x0 */ s16 holdTimerB; diff --git a/include/item.h b/include/item.h index e1a8a0d..5f921e4 100644 --- a/include/item.h +++ b/include/item.h @@ -67,6 +67,8 @@ void LoadItemParameters(void); struct TeamInventory *GetMoneyItemsInfo(void); void InitializeMoneyItems(void); u8 GetItemType(u8 index); +s32 GetStackSellValue(struct ItemSlot *param_1); +s32 GetStackSellPrice(struct ItemSlot *param_1); s32 GetItemBuyPrice(u8 itemIndex); s32 GetItemSellPrice(u8 itemIndex); s32 GetItemOrder(u8 itemIndex); @@ -90,6 +92,8 @@ bool8 CanSellItem(u32 id); bool8 IsGummiItem(u8); void xxx_init_unk230_substruct(u8); bool8 xxx_insert_unk230_80919FC(u8); +struct HeldItem *xxx_get_inv_unk230_at_809185C(u8); +s32 xxx_count_inv_unk230(); u32 xxx_count_non_empty_inv_unk250_8091A48(); void sub_8091BB4(u8); void sub_8090F58(void*, u8 *, struct ItemSlot *, struct unkStruct_8090F58*); diff --git a/include/m4a.h b/include/m4a.h index 52f4281..6f2ffc5 100644 --- a/include/m4a.h +++ b/include/m4a.h @@ -13,14 +13,15 @@ void m4aSongNumStartOrChange(u16 n); void m4aSongNumStop(u16 n); void m4aMPlayAllStop(void); void m4aMPlayContinue(struct MusicPlayerInfo *mplayInfo); -void m4aMPlayFadeOut(struct MusicPlayerInfo *mplayInfo, u16 speed); +void m4aMPlayFadeOut(struct MusicPlayerInfo *mplayInfo, u32 speed); void m4aMPlayFadeOutTemporarily(struct MusicPlayerInfo *mplayInfo, u16 speed); void m4aMPlayFadeIn(struct MusicPlayerInfo *mplayInfo, u16 speed); void m4aMPlayImmInit(struct MusicPlayerInfo *mplayInfo); void m4aMPlayStop(struct MusicPlayerInfo *mplayInfo); void m4aMPlayVolumeControl(struct MusicPlayerInfo *mplayInfo, u16 trackBits, u16 volume); +void m4aSoundVSync(void); extern struct MusicPlayerInfo gMPlayInfo_BGM; // BGM?? - +extern struct MusicPlayerInfo gUnknown_2000970; #endif //GUARD_M4A_H diff --git a/include/mailbox.h b/include/mailbox.h index 2c08a08..1cdfa8e 100644 --- a/include/mailbox.h +++ b/include/mailbox.h @@ -1,13 +1,17 @@ #ifndef GUARD_MAILBOX_H #define GUARD_MAILBOX_H +#include "menu.h" +#include "text.h" +#include "constants/mailbox.h" + struct unkStruct_203B304 { // size: 0xB6 << 1 u32 state; u32 unk4; u8 unk8; - u8 unk9; + u8 mailIndex; u8 fillA[0xC - 0xA]; u32 unkC; u8 fill10[0x50 - 0x10]; @@ -23,5 +27,6 @@ struct unkStruct_203B304 }; extern void SetMailboxState(u32); +extern s32 GetNumAcceptedJobs(void); #endif // GUARD_MAILBOX_H diff --git a/include/music.h b/include/music.h index 849f987..a8710e1 100644 --- a/include/music.h +++ b/include/music.h @@ -8,7 +8,7 @@ void StartNewBGM(u16 songIndex); bool8 IsBGSong(u32 songIndex); bool8 sub_800CAAC(u32 songIndex); bool8 sub_800CACC(u32 songIndex); -u16 sub_800CAE0(u16 songIndex); +u16 GetMusicPlayerIndex(u16 songIndex); bool8 sub_800CAF0(u16 songIndex); void StartNewBGM(u16 songIndex); void FadeInNewBGM(u16 SongIndex, u16 speed); @@ -17,6 +17,7 @@ void sub_800BF48(u16 SongIndex); void sub_800BF80(void); void FadeOutBGM(u16 speed); void sub_800C074(u16 SongIndex, u16 param_2); +void sub_800C298(u16 songIndex); void nullsub_19(void); void nullsub_20(u16 songIndex); diff --git a/include/play_time.h b/include/play_time.h index 7a8ea9e..b4b10b1 100644 --- a/include/play_time.h +++ b/include/play_time.h @@ -9,6 +9,10 @@ struct PlayTimeStruct u8 frames; }; + +extern struct PlayTimeStruct *gPlayTimeRef; +extern struct PlayTimeStruct gPlayTime; + void IncrementPlayTime(struct PlayTimeStruct *Time); void ResetPlayTime(struct PlayTimeStruct *Time); struct PlayTimeStruct *GetPlayTime(void); diff --git a/include/pokemon.h b/include/pokemon.h index 174eda2..969c0f8 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -3,6 +3,7 @@ #include "file_system.h" #include "item.h" +#include "constants/move.h" #define OFFENSE_NRM 0 @@ -24,14 +25,6 @@ struct unkPokeSubStruct_4 { u16 fill6; }; -struct unkPokeSubStruct_2C -{ - u8 unk0; - u8 fill1; - u16 unk2; - u32 fill4; -}; - struct unkPokeSubStruct_C { u8 unk0; @@ -46,7 +39,6 @@ struct PokemonStruct u8 unkHasNextStage; // set to a random value? struct unkPokeSubStruct_4 unk4; /* 0x8 */ s16 speciesNum; // species # - u8 fillA[0xC - 0xA]; struct unkPokeSubStruct_C unkC[2]; /* 0x14 */ s16 IQ; /* 0x16 */ u16 pokeHP; // HP @@ -56,8 +48,8 @@ struct PokemonStruct u8 unk24; u8 fill25[3]; struct HeldItem heldItem; - struct unkPokeSubStruct_2C unk2C[4]; - /* 0x4C */ u8 name[0xA]; + struct PokemonMove moves[MAX_MON_MOVES]; + /* 0x4C */ u8 name[POKEMON_NAME_LENGTH]; }; @@ -88,7 +80,7 @@ struct PokemonStruct2 u16 unk12; // pokeHP struct Offense offense; // offense (other offset) u32 unk18; // unk1C - struct unkPokeSubStruct_2C unk1C[4]; // unk2C + struct PokemonMove moves[MAX_MON_MOVES]; u8 fill3c[4]; /* 40 */ struct ItemSlot itemSlot; // heldItem u32 unk44; // some struct @@ -97,14 +89,14 @@ struct PokemonStruct2 u8 unk50; // unk24 u8 fill51[3]; struct unkStruct_808E6F4 unk54; - u8 name[10]; // name (other offset) + u8 name[POKEMON_NAME_LENGTH]; // name (other offset) }; struct unkStruct_203B45C { /* 0x0 */ struct PokemonStruct pokemon[NUM_SPECIES]; /* 0x8DF8 */ struct PokemonStruct2 pokemon2[4]; - /* 0x8F88 */ struct PokemonStruct team[4]; + /* 0x8F88 */ struct PokemonStruct team[MAX_TEAM_MEMBERS]; }; struct EvolveStruct1 @@ -187,6 +179,8 @@ struct unkStruct_808E218 struct unkStruct_808E6F4 unk0[3]; }; +extern struct unkStruct_203B45C *gRecruitedPokemonRef; + void LoadMonsterParameters(void); struct unkStruct_203B45C *GetRecruitedPokemon(void); void InitializeRecruitedPokemon(void); diff --git a/include/rescue_team_info.h b/include/rescue_team_info.h index 76976c4..e81fbcc 100644 --- a/include/rescue_team_info.h +++ b/include/rescue_team_info.h @@ -20,6 +20,8 @@ struct RescueTeamData u8 unk10; }; +extern struct RescueTeamData *gRescueTeamInfoRef; + void LoadRescueTeamInfo(void); struct RescueTeamData *GetRescueTeamInfo(void); void InitializeRescueTeamInfo(void); diff --git a/include/team_inventory.h b/include/team_inventory.h index 36f5a87..f239a41 100644 --- a/include/team_inventory.h +++ b/include/team_inventory.h @@ -12,4 +12,6 @@ struct TeamInventory /* 0x264 */ u32 teamSavings; }; +extern struct TeamInventory *gTeamInventory_203B460; + #endif diff --git a/include/wonder_mail.h b/include/wonder_mail.h index e079230..b89ce6e 100644 --- a/include/wonder_mail.h +++ b/include/wonder_mail.h @@ -7,8 +7,7 @@ #include "pokemon.h" #include "sub_8095228.h" -#define PASSWORD_BUFFER_SIZE 54 -#define MAX_ITEM_REWARDS 3 +#include "constants/wonder_mail.h" struct unkStruct_802F204 { -- cgit v1.2.3