From 79107108e6412e4fb93fb3ec14ded86c25a29e82 Mon Sep 17 00:00:00 2001 From: Parker Zhiss <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 31 May 2026 00:13:47 -0400 Subject: [PATCH 001/117] Spring Cleaning Overlay 19 Tests are passing on my end. Somehow I have those now? --- headers/data/overlay19.h | 21 +- headers/functions/overlay19.h | 42 ++- headers/types/ground_mode/enums.h | 104 +++++++ headers/types/ground_mode/ground_mode.h | 73 +++++ symbols/overlay19.yml | 398 ++++++++++++++++++++++-- 5 files changed, 600 insertions(+), 38 deletions(-) diff --git a/headers/data/overlay19.h b/headers/data/overlay19.h index f0065c77..a3f83b77 100644 --- a/headers/data/overlay19.h +++ b/headers/data/overlay19.h @@ -1,17 +1,34 @@ #ifndef HEADERS_DATA_OVERLAY19_H_ #define HEADERS_DATA_OVERLAY19_H_ +int16_t BAR_MIRACLE_EVENT_WEIGHTS[4]; extern struct dungeon_id_16 BAR_UNLOCKABLE_DUNGEONS_TABLE[6]; -extern struct monster_id_16 BAR_RECRUITABLE_MONSTER_TABLE[108]; +extern struct monster_id_16 BAR_RECRUITABLE_GOURMET_MONSTER_TABLE[108]; extern struct bar_item BAR_AVAILABLE_ITEMS[66]; +int16_t BAR_STAT_REACTION_STRINGS[3]; +int16_t GOOD_DRINK_REACTION_STRINGS[3]; +int16_t BAR_STAT_CHANGE_STRINGS[3]; +int16_t NEUTRAL_DRINK_REACTION_STRINGS[3]; +int16_t AWFUL_DRINK_REACTION_STRINGS[3]; +int16_t BAR_IQ_CHANGE_STRINGS[3]; +int16_t BAR_IQ_UNABLE_TO_CHANGE_STRINGS[3]; +extern struct vec2 GOURMET_PORTRAIT_OFFSET_TABLE[5]; +int16_t BAR_STAT_NAME_STRINGS[6]; extern struct window_params BAR_WINDOW_PARAMS_1; extern struct window_params BAR_WINDOW_PARAMS_2; extern struct window_params BAR_WINDOW_PARAMS_3; extern struct simple_menu_id_item BAR_MENU_ITEMS_CONFIRM_1[3]; extern struct simple_menu_id_item BAR_MENU_ITEMS_CONFIRM_2[3]; +int16_t BAR_DRINK_NAMES_STRINGS[12]; extern struct simple_menu_id_item BAR_MAIN_MENU_ITEMS[4]; extern struct simple_menu_id_item BAR_SUBMENU_ITEMS_1[4]; extern struct simple_menu_id_item BAR_SUBMENU_ITEMS_2[6]; +wchar_t BAR_NEW_LINE_CHAR; +char BAR_ME_PLAY_TEXT_TAG[12]; +char DEBUG_MESSAGE_REQUEST_STR[23]; +char DEBUG_MESSAGE_REQUEST_AND_RETURN_STR[28]; +char DEBUG_MESSAGE_BEFORE_SET_STR[30]; +char DEBUG_MESSAGE_AFTER_SET_STR[29]; extern undefined4 OV19_STATIC_INITIALIZER; - +int16_t BAR_MENU_PRIOR_CHOICE_INDICES[3]; #endif diff --git a/headers/functions/overlay19.h b/headers/functions/overlay19.h index 987800c9..4a64b142 100644 --- a/headers/functions/overlay19.h +++ b/headers/functions/overlay19.h @@ -2,8 +2,42 @@ #define HEADERS_FUNCTIONS_OVERLAY19_H_ struct bar_item* GetBarItem(enum item_id item_id); -int GetRecruitableMonsterAll(void); -int GetRecruitableMonsterList(void); -int GetRecruitableMonsterListRestricted(void); - +void SetMiracleDrinkStatCountRange(undefined4 *param_1,undefined4 *param_2); +void SetBadDrinkStatCountRange(undefined4 *param_1,undefined4 *param_2); +unsigned short * GetBarItemResultWeights(int param_1); +unsigned short * BarGetDrinkEventWeights(void); +enum monster_id BarGetRandomValidEggRecruit(void); +enum monster_id BarGetValidEggGiverFromGourmetTable(void); +enum monster_id BarGetRandomValidRecruitFromGourmetTable(void); +int BarGetUnlockableDungeonPtr(struct bar_dungeon_unlock **param_1); +int BarPopulateUnlockableDungeons(struct dungeon_id_8 *param_1); +void BarTryClosePortraitBox(void); +undefined4 BarCaseManagerSub(void); +undefined4 BarMaybeSetBarScrollBoxWindowId(undefined4 param_1,undefined4 param_2,undefined4 param_3); +void BarPopulateDrinkableBagItems(void); +void BarSetPreprocessorFlagsAndSubcase(void); +bool BarStrBufferZeroToPreprocessorFlags(void); +undefined4 BarTrySetEventMainActor(void); +bool BarStrBufferOneToPreprocessorFlags(void); +undefined4 BarPrintHpIncreaseString(int param_1,int32_t param_2,undefined4 param_3,undefined4 param_4); +undefined4 BarPrintOtherStatIncreaseString(int param_1,int param_2,int param_3); +undefined4 BarPrintIqAndSkills(int param_1); +void BarPrintLevelMaxedOutString(int param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4); +undefined4 BarDrawAndUpdateGainedIqSkills(char *param_1,char *param_2,int param_3,int param_4,int param_5,int param_6,int param_7); +undefined4 BarUpdateDrinkEventNewStats(struct bar_stats_data *param_1,int param_2); +void BarPrintReactionsAndStatIncreases(struct bar_stats_data *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4); +void BarHandleDrinkEventSubcase(void); +void BarPostDrinkCaseForCustomer(void); +undefined4 BarMaybeIsClosedUnkStringIdMenu(void); +void BarCreateUnkStringIdMenu(undefined4 param_1,undefined4 param_2,struct simple_menu_id_item *param_3,undefined4 param_4,char param_5,uint32_t param_6); +int GetUnkStringIdMenuResult(void); +void BarDisplayPortrait(void); +void BarTryHidePortraitBox(void); +undefined4 BarInventoryMenuCallback(undefined4 param_1,int param_2,undefined4 param_3); +void BarTryCloseInventoryMenu(void); +void BarTryCloseTeamMovesMenu(void); +undefined4 SpindaBarEntry(void); +undefined4 SpindaBarResume(void); +void SpindaBarDestruct(void); +undefined4 SpindaBarMenuUpdate(void); #endif diff --git a/headers/types/ground_mode/enums.h b/headers/types/ground_mode/enums.h index 1c405f71..d7408227 100644 --- a/headers/types/ground_mode/enums.h +++ b/headers/types/ground_mode/enums.h @@ -2254,6 +2254,110 @@ enum performance_progress_flag { PERFORMANCE_PROGRESS_FLAG_NO_CHATOT_IN_BRINE_CAVE = 25 }; +enum bar_update_case { + BAR_INIT_AND_RETURN=0, + BAR_SUBCASE_FUNC=1, + BAR_GOTO_ESCAPE=2, + BAR_ESCAPE=3, + BAR_SUSPEND_NO_MSG=4, + BAR_DRINK_FOR_HERO=5, + BAR_DRINK_FOR_PARTNER=6, + BAR_DRINK_FOR_RECRUIT=7, + BAR_DRINK_END_RECRUIT=8, + BAR_DRINK_END_HERO=9, + BAR_DRINK_END_PARTNER=10, + BAR_MAKE_DRINK=11, + BAR_SELECT_MSG_SUSPEND=12, + BAR_MSG_PRE_SUSPEND=13, + BAR_SUSPEND_MSG=14, + BAR_MSG_POST_SUSPEND=15, + BAR_EGG_HERO_PARTNER=16, + BAR_EGG_RECRUIT=17, + BAR_GOURMET_HERO_PARTNER=18, + BAR_GOURMET_RECRUIT=19, + BAR_GOURMET_LEAVE=20, + BAR_UNLOCK_DUNGEON=21 +}; + +enum bar_subcase { + SBAR_MAYBE_ESCAPE_SUB=-1, + SBAR_INIT=0, + BAR_UNK_0x1=1, + SBAR_MAIN_M_1ST_T=2, + SBAR_MAIN_M_AGAIN_T=3, + SBAR_MAIN_M_RESULTS=4, + SBAR_MAIN_M_INFO_W=5, + SBAR_MAIN_M_NO_ITEMS_W=6, + SBAR_ITEM_SEL_W=7, + SBAR_ITEM_SEL_M_INIT=8, + SBAR_ITEM_SEL_SUBM_INIT=9, + SBAR_ITEM_SEL_SUBM_RESULTS=10, + SBAR_ITEM_INFO_INIT=11, + SBAR_ITEM_INFO_CLOSE=12, + SBAR_TEAM_SEL_W=13, + SBAR_TEAM_SEL_M_INIT=14, + SBAR_TEAM_SEL_SUBM_INIT=15, + SBAR_TEAM_CONFIRM_M_INIT=16, + SBAR_TEAM_SUMMARY_INIT=17, + SBAR_TEAM_SUMMARY_CLOSE=18, + SBAR_TEAM_MOVES_M_INIT=19, + SBAR_TEAM_MOVES_M_RESULTS=20, + SBAR_TEAM_MOVE_INFO_INIT=21, + SBAR_TEAM_MOVE_INFO_CLOSE=22, + SBAR_TEAM_IQ_INIT=23, + SBAR_TEAM_IQ_CLOSE=24, + SBAR_TEAM_CONFIRM_M_RESULTS=25, + SBAR_TEAM_CONFIRM_M_CANCEL=26, + SBAR_CALL_MENTRY=27, + SBAR_ROLL_DRINK_DATA=28, + BAR_GOOD_SPINDA_REACT=29, + SBAR_MIRACLE_SPINDA_REACT=30, + SBAR_MIRACLE_1ST_TASTE=31, + SBAR_MIRACLE_REACT_1=32, + SBAR_MIRACLE_REACT_2=33, + SBAR_OTHER_1ST_TASTE=34, + SBAR_OTHER_REACT_1=35, + SBAR_BAD_DRINK_RARE_RESUME=36, + SBAR_CALC_STAT_CHANGES=37, + SBAR_DO_POSITIVE_DRINK_EVENT=38, + SBAR_MIRACLE_DRINK_RESUME=39, + SBAR_DO_NEGATIVE_DRINK_EVENT=40, + SBAR_HANDLE_LEVEL_UP=41, + SBAR_EGG_TURN_SUSPEND=42, + SBAR_EGG_TURN_RESUME=43, + SBAR_EGG_UNTURN_SUSPEND=44, + SBAR_EGG_UNTURN_RESUME=45, + SBAR_EGG_FINISH=46, + SBAR_GOURMET_FIRST_LINE=47, + SBAR_GOURMET_SUSPEND=48, + SBAR_GOURMET_DISP_PORTRAIT=49, + SBAR_GOURMET_ASK_JOIN=50, + SBAR_GOURMET_CHECK_CHOICE=51, + SBAR_GOURMET_REJECT_DELAY=52, + SBAR_GOURMET_REJECT_END=53, + SBAR_GOURMET_ACCEPT_DELAY=54, + SBAR_GOURMET_ACCEPT_SUSPEND=55, + SBAR_GOURMET_FINISH=56, + SBAR_EMPTY_0x39=57, + SBAR_DUNGEON_FIRST_LINE=58, + SBAR_DUNGEON_DISPLAY_MAP=59, + SBAR_DUNGEON_FINISH=60, + SBAR_DEFAULT_RESUME=61, + SBAR_MAYBE_WAIT_OUT_FRAMES=62, + SBAR_MAYBE_WAIT_CLOSE=63, + SBAR_MIRACLE_FINISH=64 +}; + +enum drink_event_type { + DRINK_NORMAL=0, + DRINK_GOOD=1, + DRINK_BAD=2, + DRINK_EVENT_EGG=3, + DRINK_EVENT_GOURMET=4, + DRINK_EVENT_DUNGEON=5, + DRINK_EVENT_MIRACLE=6 +}; + // These are super long, so split them out into a separate file #include "version_dep_enums.h" diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index f1d51a93..9c008816 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -1025,4 +1025,77 @@ struct link_shop { }; ASSERT_SIZE(struct link_shop, 964); + +struct bar_dungeon_unlock { + struct dungeon_id_8 dungeon_id; + uint8_t scenario_balance_min; +}; +ASSERT_SIZE(struct bar_dungeon_unlock, 2); + +// Pointer lives at 0x23258F0 EU, which is squarely part of overlay_11. Other overlays likely share this address too. +struct spinda_cafe { + enum bar_update_case main_case; + enum bar_subcase curr_subcase; + enum bar_subcase next_subcase; + int8_t portrait_window_id; + undefined1 unk_0xd; + undefined1 unk_0xe; + undefined1 unk_0xf; + struct portrait_params portrait_params; + int8_t inventory_window_id; + int8_t team_window_id; + int8_t scroll_box_window_id; + bool item_validities[50]; + undefined1 unk_0x55; + undefined1 unk_0x56; + undefined1 unk_0x57; + int sel_item_index; + bool team_member_valid[4]; + undefined1 unk_0x60; + undefined1 unk_0x61; + undefined1 unk_0x62; + undefined1 unk_0x63; + int number_of_items; + struct item_id_16 bag_items[50]; + struct item selected_item; + undefined1 unk_0xd2; + undefined1 unk_0xd3; + uint team_member_index; + short selected_move_index; + struct move_id_16 team_move_ids[16]; + int16_t drink_type_index; // random [0,11] and determines what spinda calls the drink (IE: Mix, Juice, Dew, Soda, Shake) + enum drink_event_type drink_event; + short frame_delay; + struct dungeon_id_8 unlocked_dungeon; + undefined1 unk_0x103; + struct monster_id_16 cafe_recruit_species; + struct monster_id_16 egg_giver_species; + int drink_stat_kind; + struct bar_stats_data bar_stats; + int return_case; + struct preprocessor_flags preprocessor_flags_0; + struct preprocessor_flags preprocessor_flags_1; + char string_buffer_0[1024]; + char string_buffer_1[1024]; + int unknown_flags_1; + struct window_extra_info window_extra_info; +}; +ASSERT_SIZE(struct spinda_cafe, 2664); + +struct bar_stats_data { + int16_t stat_modifiers[6]; + int16_t new_stats[6]; + int8_t actual_stat_changes[6]; + undefined unk_field_0x1e; + undefined unk_field_0x1f; + int stat_drink_event_kind; // 0x0: stat_down, 0x1: surprise_stat_up, 0x2: expected_stat_up + int num_iq_skills_pre; + int num_iq_skills_post; + struct iq_skill_id_8 iq_skills_pre[69]; + struct iq_skill_id_8 iq_skills_post[69]; + undefined unk_field_0xb6; + undefined unk_field_0xb7; +}; +ASSERT_SIZE(struct bar_stats_data, 184); + #endif diff --git a/symbols/overlay19.yml b/symbols/overlay19.yml index 5a837703..10b19f4a 100644 --- a/symbols/overlay19.yml +++ b/symbols/overlay19.yml @@ -23,35 +23,296 @@ overlay19: r0: item ID return: struct bar_item* - - name: GetRecruitableMonsterAll + - name: SetMiracleDrinkStatCountRange + address: + EU: 0x238ACC0 + description: |- + [MANUAL DESCRIPTION] + + r0: undefined4 + r1: undefined4 + - name: SetBadDrinkStatCountRange + address: + EU: 0x238ACD4 + description: |- + [MANUAL DESCRIPTION] + + r0: undefined4 + r1: undefined4 + - name: GetBarItemResultWeights + address: + EU: 0x238ACE8 + description: |- + [MANUAL DESCRIPTION] + + r0: int + return: ushort * + - name: BarGetDrinkEventWeights + address: + EU: 0x238ACF8 + description: |- + [MANUAL DESCRIPTION] + return: ushort * + - name: BarGetRandomValidEggRecruit address: EU: 0x238AD04 NA: 0x238A1C4 JP: 0x238B724 description: |- - Note: unverified, ported from Irdkwia's notes - - return: int? - - name: GetRecruitableMonsterList + [MANUAL DESCRIPTION] + return: enum + - name: BarGetValidEggGiverFromGourmetTable address: EU: 0x238ADB4 NA: 0x238A274 JP: 0x238B7D4 description: |- - Note: unverified, ported from Irdkwia's notes - - return: int? - - name: GetRecruitableMonsterListRestricted + [MANUAL DESCRIPTION] + return: enum + - name: BarGetRandomValidRecruitFromGourmetTable address: EU: 0x238AE5C NA: 0x238A31C JP: 0x238B87C description: |- - Note: unverified, ported from Irdkwia's notes + [MANUAL DESCRIPTION] + return: enum + - name: BarGetUnlockableDungeonPtr + address: + EU: 0x238AF14 + description: |- + [MANUAL DESCRIPTION] + + r0: struct bar_dungeon_unlock ** + return: int + - name: BarPopulateUnlockableDungeons + address: + EU: 0x238AF2C + description: |- + [MANUAL DESCRIPTION] + + r0: struct + return: int + - name: BarTryClosePortraitBox + address: + EU: 0x238AFA8 + description: |- + [MANUAL DESCRIPTION] + No params or return. + - name: BarCaseManagerSub + address: + EU: 0x238AFE4 + description: |- + [MANUAL DESCRIPTION] + return: undefined4 + - name: BarMaybeSetBarScrollBoxWindowId + address: + EU: 0x238B93C + description: |- + [MANUAL DESCRIPTION] + + r0: undefined4 + r1: undefined4 + r2: undefined4 + return: undefined4 + - name: BarPopulateDrinkableBagItems + address: + EU: 0x238D0DC + description: |- + [MANUAL DESCRIPTION] + No params or return. + - name: BarSetPreprocessorFlagsAndSubcase + address: + EU: 0x238D174 + description: |- + [MANUAL DESCRIPTION] + No params or return. + - name: BarStrBufferZeroToPreprocessorFlags + address: + EU: 0x238D1A4 + description: |- + [MANUAL DESCRIPTION] + return: bool + - name: BarTrySetEventMainActor + address: + EU: 0x238D1F8 + description: |- + [MANUAL DESCRIPTION] + return: undefined4 + - name: BarStrBufferOneToPreprocessorFlags + address: + EU: 0x238D2E4 + description: |- + [MANUAL DESCRIPTION] + return: bool + - name: BarPrintHpIncreaseString + address: + EU: 0x238D340 + description: |- + [MANUAL DESCRIPTION] + + r0: int + r1: int32_t + r2: undefined4 + r3: undefined4 + return: undefined4 + - name: BarPrintOtherStatIncreaseString + address: + EU: 0x238D434 + description: |- + [MANUAL DESCRIPTION] + + r0: int + r1: int + r2: int + return: undefined4 + - name: BarPrintIqAndSkills + address: + EU: 0x238D524 + description: |- + [MANUAL DESCRIPTION] + + r0: int + return: undefined4 + - name: BarPrintLevelMaxedOutString + address: + EU: 0x238D660 + description: |- + [MANUAL DESCRIPTION] + + r0: int + r1: undefined4 + r2: undefined4 + r3: undefined4 + - name: BarDrawAndUpdateGainedIqSkills + address: + EU: 0x238D6F4 + description: |- + [MANUAL DESCRIPTION] + + r0: char + r1: char + r2: int + r3: int + stack[0]: int + stack[1]: int + stack[2]: int + return: undefined4 + - name: BarUpdateDrinkEventNewStats + address: + EU: 0x238D820 + description: |- + [MANUAL DESCRIPTION] - return: int? + r0: struct + r1: int + return: undefined4 + - name: BarPrintReactionsAndStatIncreases + address: + EU: 0x238D9F4 + description: |- + [MANUAL DESCRIPTION] + + r0: struct + r1: undefined4 + r2: undefined4 + r3: undefined4 + - name: BarHandleDrinkEventSubcase + address: + EU: 0x238DC0C + description: |- + [MANUAL DESCRIPTION] + No params or return. + - name: BarPostDrinkCaseForCustomer + address: + EU: 0x238DE44 + description: |- + [MANUAL DESCRIPTION] + No params or return. + - name: BarMaybeIsClosedUnkStringIdMenu + address: + EU: 0x238DEBC + description: |- + [MANUAL DESCRIPTION] + return: undefined4 + - name: BarCreateUnkStringIdMenu + address: + EU: 0x238DED4 + description: |- + [MANUAL DESCRIPTION] + + r0: undefined4 + r1: undefined4 + r2: struct + r3: undefined4 + stack[0]: char + stack[1]: uint32_t + - name: GetUnkStringIdMenuResult + address: + EU: 0x238DF4C + description: |- + [MANUAL DESCRIPTION] + return: int + - name: BarDisplayPortrait + address: + EU: 0x238DF84 + description: |- + [MANUAL DESCRIPTION] + No params or return. + - name: BarTryHidePortraitBox + address: + EU: 0x238DFB0 + description: |- + [MANUAL DESCRIPTION] + No params or return. + - name: BarInventoryMenuCallback + address: + EU: 0x238DFD8 + description: |- + [MANUAL DESCRIPTION] + + r0: undefined4 + r1: int + r2: undefined4 + return: undefined4 + - name: BarTryCloseInventoryMenu + address: + EU: 0x238E018 + description: |- + [MANUAL DESCRIPTION] + No params or return. + - name: BarTryCloseTeamMovesMenu + address: + EU: 0x238E050 + description: |- + [MANUAL DESCRIPTION] + No params or return. + - name: SpindaBarEntry + address: + EU: 0x238E0A0 + description: |- + [MANUAL DESCRIPTION] + return: undefined4 + - name: SpindaBarResume + address: + EU: 0x238E130 + description: |- + [MANUAL DESCRIPTION] + return: undefined4 + - name: SpindaBarDestruct + address: + EU: 0x238E1C0 + description: |- + [MANUAL DESCRIPTION] + No params or return. + - name: SpindaBarMenuUpdate + address: + EU: 0x238E1CC + description: |- + [MANUAL DESCRIPTION] + return: undefined4 data: - - name: OVERLAY19_UNKNOWN_TABLE__NA_238DAE0 + - name: BAR_MIRACLE_EVENT_WEIGHTS address: EU: 0x238E614 NA: 0x238DAE0 @@ -59,9 +320,8 @@ overlay19: length: NA: 0x8 description: |- - 4*0x2 - - Note: unverified, ported from Irdkwia's notes + [MANUAL DESCRIPTION] + int16_t - name: BAR_UNLOCKABLE_DUNGEONS_TABLE address: EU: 0x238E61C @@ -73,7 +333,7 @@ overlay19: Note: unverified, ported from Irdkwia's notes type: struct dungeon_id_16[6] - - name: BAR_RECRUITABLE_MONSTER_TABLE + - name: BAR_RECRUITABLE_GOURMET_MONSTER_TABLE address: EU: 0x238E628 NA: 0x238DAF4 @@ -82,9 +342,8 @@ overlay19: NA: 0xD8 JP: 0xD8 description: |- - Note: unverified, ported from Irdkwia's notes - - type: struct monster_id_16[108] + [MANUAL DESCRIPTION] + monster_id_16 - name: BAR_AVAILABLE_ITEMS address: EU: 0x238E700 @@ -96,15 +355,53 @@ overlay19: Note: unverified, ported from Irdkwia's notes type: struct bar_item[66] - - name: OVERLAY19_UNKNOWN_STRING_IDS__NA_238E178 + - name: BAR_STAT_REACTION_STRINGS address: EU: 0x238ECAC NA: 0x238E178 JP: 0x238F6D0 length: NA: 0x2C - description: "Note: unverified, ported from Irdkwia's notes" - - name: OVERLAY19_UNKNOWN_STRUCT__NA_238E1A4 + description: |- + [MANUAL DESCRIPTION] + int16_t + - name: GOOD_DRINK_REACTION_STRINGS + address: + EU: 0x238ECB2 + description: |- + [MANUAL DESCRIPTION] + int16_t + - name: BAR_STAT_CHANGE_STRINGS + address: + EU: 0x238ECB8 + description: |- + [MANUAL DESCRIPTION] + int16_t + - name: NEUTRAL_DRINK_REACTION_STRINGS + address: + EU: 0x238ECBE + description: |- + [MANUAL DESCRIPTION] + int16_t + - name: AWFUL_DRINK_REACTION_STRINGS + address: + EU: 0x238ECC4 + description: |- + [MANUAL DESCRIPTION] + int16_t + - name: BAR_IQ_CHANGE_STRINGS + address: + EU: 0x238ECCA + description: |- + [MANUAL DESCRIPTION] + int16_t + - name: BAR_IQ_UNABLE_TO_CHANGE_STRINGS + address: + EU: 0x238ECD0 + description: |- + [MANUAL DESCRIPTION] + int16_t + - name: GOURMET_PORTRAIT_OFFSET_TABLE address: EU: 0x238ECD8 NA: 0x238E1A4 @@ -112,17 +409,18 @@ overlay19: length: NA: 0x28 description: |- - 5*0x8 - - Note: unverified, ported from Irdkwia's notes - - name: OVERLAY19_UNKNOWN_STRING_IDS__NA_238E1CC + [MANUAL DESCRIPTION] + vec2 + - name: BAR_STAT_NAME_STRINGS address: EU: 0x238ED00 NA: 0x238E1CC JP: 0x238F724 length: NA: 0xC - description: "Note: unverified, ported from Irdkwia's notes" + description: |- + [MANUAL DESCRIPTION] + int16_t - name: BAR_WINDOW_PARAMS_1 address: EU: 0x238ED0C @@ -168,14 +466,14 @@ overlay19: EU: 0x18 NA: 0x18 JP: 0x18 - - name: OVERLAY19_UNKNOWN_STRING_IDS__NA_238E238 + - name: BAR_DRINK_NAMES_STRINGS address: EU: 0x238ED6C NA: 0x238E238 JP: 0x238F790 - length: - NA: 0x18 - description: "Note: unverified, ported from Irdkwia's notes" + description: |- + [MANUAL DESCRIPTION] + int16_t - name: BAR_MAIN_MENU_ITEMS address: EU: 0x238ED84 @@ -203,6 +501,42 @@ overlay19: EU: 0x30 NA: 0x30 JP: 0x30 + - name: BAR_NEW_LINE_CHAR + address: + EU: 0x238EDF4 + description: |- + [MANUAL DESCRIPTION] + wchar_t + - name: BAR_ME_PLAY_TEXT_TAG + address: + EU: 0x238EDF8 + description: |- + [MANUAL DESCRIPTION] + char + - name: DEBUG_MESSAGE_REQUEST_STR + address: + EU: 0x238EE04 + description: |- + [MANUAL DESCRIPTION] + char + - name: DEBUG_MESSAGE_REQUEST_AND_RETURN_STR + address: + EU: 0x238EE1C + description: |- + [MANUAL DESCRIPTION] + char + - name: DEBUG_MESSAGE_BEFORE_SET_STR + address: + EU: 0x238EE38 + description: |- + [MANUAL DESCRIPTION] + char + - name: DEBUG_MESSAGE_AFTER_SET_STR + address: + EU: 0x238EE58 + description: |- + [MANUAL DESCRIPTION] + char - name: OV19_STATIC_INITIALIZER aliases: - OVERLAY19_RESERVED_SPACE @@ -215,7 +549,7 @@ overlay19: NA: 0x4 JP: 0x4 description: Static initializer for overlay 19. - - name: OVERLAY19_UNKNOWN_POINTER__NA_238E360 + - name: BAR_MENU_PRIOR_CHOICE_INDICES address: EU: 0x238EE80 NA: 0x238E360 From bdffcdbf9cd28fb8396afb8f7073e69c462bcef6 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 31 May 2026 00:39:31 -0400 Subject: [PATCH 002/117] Oops --- headers/types/ground_mode/ground_mode.h | 34 ++++++++++++------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index 9c008816..8118b9db 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -1032,6 +1032,22 @@ struct bar_dungeon_unlock { }; ASSERT_SIZE(struct bar_dungeon_unlock, 2); +struct bar_stats_data { + int16_t stat_modifiers[6]; + int16_t new_stats[6]; + int8_t actual_stat_changes[6]; + undefined unk_field_0x1e; + undefined unk_field_0x1f; + int stat_drink_event_kind; // 0x0: stat_down, 0x1: surprise_stat_up, 0x2: expected_stat_up + int num_iq_skills_pre; + int num_iq_skills_post; + struct iq_skill_id_8 iq_skills_pre[69]; + struct iq_skill_id_8 iq_skills_post[69]; + undefined unk_field_0xb6; + undefined unk_field_0xb7; +}; +ASSERT_SIZE(struct bar_stats_data, 184); + // Pointer lives at 0x23258F0 EU, which is squarely part of overlay_11. Other overlays likely share this address too. struct spinda_cafe { enum bar_update_case main_case; @@ -1060,7 +1076,7 @@ struct spinda_cafe { struct item selected_item; undefined1 unk_0xd2; undefined1 unk_0xd3; - uint team_member_index; + uint32_t team_member_index; short selected_move_index; struct move_id_16 team_move_ids[16]; int16_t drink_type_index; // random [0,11] and determines what spinda calls the drink (IE: Mix, Juice, Dew, Soda, Shake) @@ -1082,20 +1098,4 @@ struct spinda_cafe { }; ASSERT_SIZE(struct spinda_cafe, 2664); -struct bar_stats_data { - int16_t stat_modifiers[6]; - int16_t new_stats[6]; - int8_t actual_stat_changes[6]; - undefined unk_field_0x1e; - undefined unk_field_0x1f; - int stat_drink_event_kind; // 0x0: stat_down, 0x1: surprise_stat_up, 0x2: expected_stat_up - int num_iq_skills_pre; - int num_iq_skills_post; - struct iq_skill_id_8 iq_skills_pre[69]; - struct iq_skill_id_8 iq_skills_post[69]; - undefined unk_field_0xb6; - undefined unk_field_0xb7; -}; -ASSERT_SIZE(struct bar_stats_data, 184); - #endif From 1f6f5c68a2bee44882298c021393162147ff1bea Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 31 May 2026 00:42:45 -0400 Subject: [PATCH 003/117] Format Symbols The headers look like a nightmare to properly format without actual clang. So I'll pass on that for now. --- symbols/overlay19.yml | 82 +++++++++++++++++++++---------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/symbols/overlay19.yml b/symbols/overlay19.yml index 10b19f4a..cb803d3d 100644 --- a/symbols/overlay19.yml +++ b/symbols/overlay19.yml @@ -46,13 +46,13 @@ overlay19: [MANUAL DESCRIPTION] r0: int - return: ushort * + return: ushort * - name: BarGetDrinkEventWeights address: EU: 0x238ACF8 description: |- [MANUAL DESCRIPTION] - return: ushort * + return: ushort * - name: BarGetRandomValidEggRecruit address: EU: 0x238AD04 @@ -60,7 +60,7 @@ overlay19: JP: 0x238B724 description: |- [MANUAL DESCRIPTION] - return: enum + return: enum - name: BarGetValidEggGiverFromGourmetTable address: EU: 0x238ADB4 @@ -68,7 +68,7 @@ overlay19: JP: 0x238B7D4 description: |- [MANUAL DESCRIPTION] - return: enum + return: enum - name: BarGetRandomValidRecruitFromGourmetTable address: EU: 0x238AE5C @@ -76,15 +76,15 @@ overlay19: JP: 0x238B87C description: |- [MANUAL DESCRIPTION] - return: enum + return: enum - name: BarGetUnlockableDungeonPtr address: EU: 0x238AF14 description: |- [MANUAL DESCRIPTION] - r0: struct bar_dungeon_unlock ** - return: int + r0: struct bar_dungeon_unlock ** + return: int - name: BarPopulateUnlockableDungeons address: EU: 0x238AF2C @@ -92,7 +92,7 @@ overlay19: [MANUAL DESCRIPTION] r0: struct - return: int + return: int - name: BarTryClosePortraitBox address: EU: 0x238AFA8 @@ -104,7 +104,7 @@ overlay19: EU: 0x238AFE4 description: |- [MANUAL DESCRIPTION] - return: undefined4 + return: undefined4 - name: BarMaybeSetBarScrollBoxWindowId address: EU: 0x238B93C @@ -114,7 +114,7 @@ overlay19: r0: undefined4 r1: undefined4 r2: undefined4 - return: undefined4 + return: undefined4 - name: BarPopulateDrinkableBagItems address: EU: 0x238D0DC @@ -132,19 +132,19 @@ overlay19: EU: 0x238D1A4 description: |- [MANUAL DESCRIPTION] - return: bool + return: bool - name: BarTrySetEventMainActor address: EU: 0x238D1F8 description: |- [MANUAL DESCRIPTION] - return: undefined4 + return: undefined4 - name: BarStrBufferOneToPreprocessorFlags address: EU: 0x238D2E4 description: |- [MANUAL DESCRIPTION] - return: bool + return: bool - name: BarPrintHpIncreaseString address: EU: 0x238D340 @@ -155,7 +155,7 @@ overlay19: r1: int32_t r2: undefined4 r3: undefined4 - return: undefined4 + return: undefined4 - name: BarPrintOtherStatIncreaseString address: EU: 0x238D434 @@ -165,7 +165,7 @@ overlay19: r0: int r1: int r2: int - return: undefined4 + return: undefined4 - name: BarPrintIqAndSkills address: EU: 0x238D524 @@ -173,7 +173,7 @@ overlay19: [MANUAL DESCRIPTION] r0: int - return: undefined4 + return: undefined4 - name: BarPrintLevelMaxedOutString address: EU: 0x238D660 @@ -197,7 +197,7 @@ overlay19: stack[0]: int stack[1]: int stack[2]: int - return: undefined4 + return: undefined4 - name: BarUpdateDrinkEventNewStats address: EU: 0x238D820 @@ -206,7 +206,7 @@ overlay19: r0: struct r1: int - return: undefined4 + return: undefined4 - name: BarPrintReactionsAndStatIncreases address: EU: 0x238D9F4 @@ -234,7 +234,7 @@ overlay19: EU: 0x238DEBC description: |- [MANUAL DESCRIPTION] - return: undefined4 + return: undefined4 - name: BarCreateUnkStringIdMenu address: EU: 0x238DED4 @@ -252,7 +252,7 @@ overlay19: EU: 0x238DF4C description: |- [MANUAL DESCRIPTION] - return: int + return: int - name: BarDisplayPortrait address: EU: 0x238DF84 @@ -274,7 +274,7 @@ overlay19: r0: undefined4 r1: int r2: undefined4 - return: undefined4 + return: undefined4 - name: BarTryCloseInventoryMenu address: EU: 0x238E018 @@ -292,13 +292,13 @@ overlay19: EU: 0x238E0A0 description: |- [MANUAL DESCRIPTION] - return: undefined4 + return: undefined4 - name: SpindaBarResume address: EU: 0x238E130 description: |- [MANUAL DESCRIPTION] - return: undefined4 + return: undefined4 - name: SpindaBarDestruct address: EU: 0x238E1C0 @@ -321,7 +321,7 @@ overlay19: NA: 0x8 description: |- [MANUAL DESCRIPTION] - int16_t + int16_t - name: BAR_UNLOCKABLE_DUNGEONS_TABLE address: EU: 0x238E61C @@ -343,7 +343,7 @@ overlay19: JP: 0xD8 description: |- [MANUAL DESCRIPTION] - monster_id_16 + monster_id_16 - name: BAR_AVAILABLE_ITEMS address: EU: 0x238E700 @@ -364,43 +364,43 @@ overlay19: NA: 0x2C description: |- [MANUAL DESCRIPTION] - int16_t + int16_t - name: GOOD_DRINK_REACTION_STRINGS address: EU: 0x238ECB2 description: |- [MANUAL DESCRIPTION] - int16_t + int16_t - name: BAR_STAT_CHANGE_STRINGS address: EU: 0x238ECB8 description: |- [MANUAL DESCRIPTION] - int16_t + int16_t - name: NEUTRAL_DRINK_REACTION_STRINGS address: EU: 0x238ECBE description: |- [MANUAL DESCRIPTION] - int16_t + int16_t - name: AWFUL_DRINK_REACTION_STRINGS address: EU: 0x238ECC4 description: |- [MANUAL DESCRIPTION] - int16_t + int16_t - name: BAR_IQ_CHANGE_STRINGS address: EU: 0x238ECCA description: |- [MANUAL DESCRIPTION] - int16_t + int16_t - name: BAR_IQ_UNABLE_TO_CHANGE_STRINGS address: EU: 0x238ECD0 description: |- [MANUAL DESCRIPTION] - int16_t + int16_t - name: GOURMET_PORTRAIT_OFFSET_TABLE address: EU: 0x238ECD8 @@ -410,7 +410,7 @@ overlay19: NA: 0x28 description: |- [MANUAL DESCRIPTION] - vec2 + vec2 - name: BAR_STAT_NAME_STRINGS address: EU: 0x238ED00 @@ -420,7 +420,7 @@ overlay19: NA: 0xC description: |- [MANUAL DESCRIPTION] - int16_t + int16_t - name: BAR_WINDOW_PARAMS_1 address: EU: 0x238ED0C @@ -473,7 +473,7 @@ overlay19: JP: 0x238F790 description: |- [MANUAL DESCRIPTION] - int16_t + int16_t - name: BAR_MAIN_MENU_ITEMS address: EU: 0x238ED84 @@ -506,37 +506,37 @@ overlay19: EU: 0x238EDF4 description: |- [MANUAL DESCRIPTION] - wchar_t + wchar_t - name: BAR_ME_PLAY_TEXT_TAG address: EU: 0x238EDF8 description: |- [MANUAL DESCRIPTION] - char + char - name: DEBUG_MESSAGE_REQUEST_STR address: EU: 0x238EE04 description: |- [MANUAL DESCRIPTION] - char + char - name: DEBUG_MESSAGE_REQUEST_AND_RETURN_STR address: EU: 0x238EE1C description: |- [MANUAL DESCRIPTION] - char + char - name: DEBUG_MESSAGE_BEFORE_SET_STR address: EU: 0x238EE38 description: |- [MANUAL DESCRIPTION] - char + char - name: DEBUG_MESSAGE_AFTER_SET_STR address: EU: 0x238EE58 description: |- [MANUAL DESCRIPTION] - char + char - name: OV19_STATIC_INITIALIZER aliases: - OVERLAY19_RESERVED_SPACE From 576dd138f1931549bb244c6822b23dad82b59c65 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 31 May 2026 02:10:20 -0400 Subject: [PATCH 004/117] Describe Symbols --- headers/data/overlay19.h | 2 +- headers/functions/overlay19.h | 22 +- headers/types/ground_mode/ground_mode.h | 18 +- symbols/overlay19.yml | 301 ++++++++++++++---------- 4 files changed, 193 insertions(+), 150 deletions(-) diff --git a/headers/data/overlay19.h b/headers/data/overlay19.h index a3f83b77..83f32271 100644 --- a/headers/data/overlay19.h +++ b/headers/data/overlay19.h @@ -9,7 +9,7 @@ int16_t BAR_STAT_REACTION_STRINGS[3]; int16_t GOOD_DRINK_REACTION_STRINGS[3]; int16_t BAR_STAT_CHANGE_STRINGS[3]; int16_t NEUTRAL_DRINK_REACTION_STRINGS[3]; -int16_t AWFUL_DRINK_REACTION_STRINGS[3]; +int16_t BAD_DRINK_REACTION_STRINGS[3]; int16_t BAR_IQ_CHANGE_STRINGS[3]; int16_t BAR_IQ_UNABLE_TO_CHANGE_STRINGS[3]; extern struct vec2 GOURMET_PORTRAIT_OFFSET_TABLE[5]; diff --git a/headers/functions/overlay19.h b/headers/functions/overlay19.h index 4a64b142..3734ae9e 100644 --- a/headers/functions/overlay19.h +++ b/headers/functions/overlay19.h @@ -2,9 +2,9 @@ #define HEADERS_FUNCTIONS_OVERLAY19_H_ struct bar_item* GetBarItem(enum item_id item_id); -void SetMiracleDrinkStatCountRange(undefined4 *param_1,undefined4 *param_2); -void SetBadDrinkStatCountRange(undefined4 *param_1,undefined4 *param_2); -unsigned short * GetBarItemResultWeights(int param_1); +void SetMiracleDrinkStatCountRange(int *param_1,int *param_2); +void SetBadDrinkStatCountRange(int *param_1,int *param_2); +unsigned short * GetBarItemResultWeights(enum item_id param_1); unsigned short * BarGetDrinkEventWeights(void); enum monster_id BarGetRandomValidEggRecruit(void); enum monster_id BarGetValidEggGiverFromGourmetTable(void); @@ -15,24 +15,24 @@ void BarTryClosePortraitBox(void); undefined4 BarCaseManagerSub(void); undefined4 BarMaybeSetBarScrollBoxWindowId(undefined4 param_1,undefined4 param_2,undefined4 param_3); void BarPopulateDrinkableBagItems(void); -void BarSetPreprocessorFlagsAndSubcase(void); -bool BarStrBufferZeroToPreprocessorFlags(void); +void BarZeroInitPreprocessorFlagsAndReturnCase(void); +bool BarZeroInitBufferAndPreprocessorArgsZero(void); undefined4 BarTrySetEventMainActor(void); -bool BarStrBufferOneToPreprocessorFlags(void); -undefined4 BarPrintHpIncreaseString(int param_1,int32_t param_2,undefined4 param_3,undefined4 param_4); +bool BarZeroInitBufferAndPreprocessorArgsZero(void); +undefined4 BarPrintHpIncreaseString(int32_t param_1,int32_t param_2); undefined4 BarPrintOtherStatIncreaseString(int param_1,int param_2,int param_3); undefined4 BarPrintIqAndSkills(int param_1); -void BarPrintLevelMaxedOutString(int param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4); +void BarPrintLevelMaxedOutString(int param_1); undefined4 BarDrawAndUpdateGainedIqSkills(char *param_1,char *param_2,int param_3,int param_4,int param_5,int param_6,int param_7); undefined4 BarUpdateDrinkEventNewStats(struct bar_stats_data *param_1,int param_2); -void BarPrintReactionsAndStatIncreases(struct bar_stats_data *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4); +void BarPrintReactionsAndStatIncreases(struct bar_stats_data *param_1); void BarHandleDrinkEventSubcase(void); void BarPostDrinkCaseForCustomer(void); undefined4 BarMaybeIsClosedUnkStringIdMenu(void); void BarCreateUnkStringIdMenu(undefined4 param_1,undefined4 param_2,struct simple_menu_id_item *param_3,undefined4 param_4,char param_5,uint32_t param_6); int GetUnkStringIdMenuResult(void); -void BarDisplayPortrait(void); -void BarTryHidePortraitBox(void); +void BarTryShowPortrait(void); +void BarTryHidePortrait(void); undefined4 BarInventoryMenuCallback(undefined4 param_1,int param_2,undefined4 param_3); void BarTryCloseInventoryMenu(void); void BarTryCloseTeamMovesMenu(void); diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index 8118b9db..5f8b3fa1 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -577,14 +577,16 @@ ASSERT_SIZE(struct partner_talk_kind_table_entry, 8); struct bar_item { struct item_id_16 id; - int16_t field_0x2; - int16_t field_0x4; - int16_t field_0x6; - int16_t field_0x8; - int16_t field_0xa; - int16_t field_0xc; - // Probably padding - undefined field_0xe[8]; + int16_t hp_increase; + int16_t iq_increase; + int16_t atk_increase; + int16_t def_increase; + int16_t spa_increase; + int16_t spdef_increase; + ushort normal_drink_wght; + ushort good_drink_wght; + ushort miracle_drink_wght; + ushort bad_drink_wght; }; ASSERT_SIZE(struct bar_item, 22); diff --git a/symbols/overlay19.yml b/symbols/overlay19.yml index cb803d3d..fc2593e7 100644 --- a/symbols/overlay19.yml +++ b/symbols/overlay19.yml @@ -27,89 +27,98 @@ overlay19: address: EU: 0x238ACC0 description: |- - [MANUAL DESCRIPTION] + Retrieves the minimum and maximum stat boost for a miracle drink. In vanilla this is [2,5]. - r0: undefined4 - r1: undefined4 + r0: int* + r1: int* - name: SetBadDrinkStatCountRange address: EU: 0x238ACD4 description: |- - [MANUAL DESCRIPTION] + Retrieves the minimum and maximum stat reduction for a bad drink. In vanilla this is [1,3]. - r0: undefined4 - r1: undefined4 + r0: int* + r1: int* - name: GetBarItemResultWeights address: EU: 0x238ACE8 description: |- - [MANUAL DESCRIPTION] - - r0: int - return: ushort * + Retrieves a pointer to the weights for normal, good, miracle, and bad drink results by item. + The miracle drink event chance is actually a shared chance for a random drink event such as a dungeon unlock, recruit, or a real miracle drink. + + r0: item_id + return: uint16_t* - name: BarGetDrinkEventWeights address: EU: 0x238ACF8 description: |- - [MANUAL DESCRIPTION] - return: ushort * + Retrieves the static chances for an egg, recruit, dungeon unlock, or a miracle drink. + + return: uint16_t * - name: BarGetRandomValidEggRecruit address: EU: 0x238AD04 NA: 0x238A1C4 JP: 0x238B724 description: |- - [MANUAL DESCRIPTION] - return: enum + Retrives a random valid egg species for an egg event at the cafe. + + return: enum monster_id - name: BarGetValidEggGiverFromGourmetTable address: EU: 0x238ADB4 NA: 0x238A274 JP: 0x238B7D4 description: |- - [MANUAL DESCRIPTION] - return: enum + Retrieves a random valid species from BAR_RECRUITABLE_GOURMET_MONSTER_TABLE to serve as the egg giver for an egg event at the cafe. + + return: enum monster_id - name: BarGetRandomValidRecruitFromGourmetTable address: EU: 0x238AE5C NA: 0x238A31C JP: 0x238B87C description: |- - [MANUAL DESCRIPTION] - return: enum + Retrieves a random valid species from BAR_RECRUITABLE_GOURMET_MONSTER_TABLE to serve as the recruit for an gourmet recruit event at the cafe. + + return: enum monster_id - name: BarGetUnlockableDungeonPtr address: EU: 0x238AF14 description: |- - [MANUAL DESCRIPTION] - + If not zero, stores a double pointer to the BAR_UNLOCKABLE_DUNGEONS_TABLE to r0. Then returns 6 for some reason... + Unclear what this is intended to actually do... + r0: struct bar_dungeon_unlock ** - return: int + return: Always 6? - name: BarPopulateUnlockableDungeons address: EU: 0x238AF2C description: |- - [MANUAL DESCRIPTION] + Populates a pointer of dungeon ids based on the current $SCENARIO_BALANCE_FLAG and unlock statuses of dungeons in the BAR_UNLOCKABLE_DUNGEONS_TABLE. - r0: struct - return: int + r0: struct dungeon_id_8* + return: number of allowed dungeons - name: BarTryClosePortraitBox address: EU: 0x238AFA8 description: |- - [MANUAL DESCRIPTION] + Seems to handle closing portrait boxes for the overlay. + No params or return. - name: BarCaseManagerSub address: EU: 0x238AFE4 description: |- - [MANUAL DESCRIPTION] - return: undefined4 + Called once every frame by SpindaBarMenuUpdate if the bar_update_case is BAR_SUBCASE_FUNC. + State Case with unique behaviors enumerated by enum bar_subcase. + + return: maybe a return code for SpindaBarMenuUpdate? - name: BarMaybeSetBarScrollBoxWindowId address: EU: 0x238B93C description: |- - [MANUAL DESCRIPTION] + Seems to set the scroll_box_window_id for spinda_cafe. r0: undefined4 r1: undefined4 @@ -119,76 +128,75 @@ overlay19: address: EU: 0x238D0DC description: |- - [MANUAL DESCRIPTION] + Populates an item list of only valid bar items within spinda_cafe. + No params or return. - - name: BarSetPreprocessorFlagsAndSubcase + - name: BarZeroInitPreprocessorFlagsAndReturnCase address: EU: 0x238D174 description: |- - [MANUAL DESCRIPTION] + Zero Inits many preprocessor_flag fields, but also sets the return_case for scripts to zero within spinda_cafe. + No params or return. - - name: BarStrBufferZeroToPreprocessorFlags + - name: BarZeroInitBufferAndPreprocessorArgsZero address: EU: 0x238D1A4 description: |- - [MANUAL DESCRIPTION] - return: bool + Zero initializes the preprocessor_args_0 and string_buffer_0 fields of spinda_cafe. + return: bool for if buffer was empty string - name: BarTrySetEventMainActor address: EU: 0x238D1F8 description: |- - [MANUAL DESCRIPTION] + Seems to set ACTOR_NPC_EVENT_MAIN to whoever the player ordered the drink for. + Seems to do other things before that though... + return: undefined4 - - name: BarStrBufferOneToPreprocessorFlags + - name: BarZeroInitBufferAndPreprocessorArgsOne address: EU: 0x238D2E4 description: |- - [MANUAL DESCRIPTION] - return: bool + Zero initializes the preprocessor_args_1 and string_buffer_1 fields of spinda_cafe. + return: bool for if buffer was empty string - name: BarPrintHpIncreaseString address: EU: 0x238D340 description: |- - [MANUAL DESCRIPTION] + Handles printing the correct text for a HP stat increase from a drink. - r0: int - r1: int32_t - r2: undefined4 - r3: undefined4 + r0: hp increase amount? + r1: a different hp increase amount? return: undefined4 - name: BarPrintOtherStatIncreaseString address: EU: 0x238D434 description: |- - [MANUAL DESCRIPTION] + Seems to handle printing the correct text for a non-HP, non-IQ stat increase from a drink. - r0: int - r1: int - r2: int + r0: stat increase amount? + r1: a different stat increase amount? + r2: Stat Index return: undefined4 - name: BarPrintIqAndSkills address: EU: 0x238D524 description: |- - [MANUAL DESCRIPTION] + Seems to handle printing the correct text for an IQ stat increase from a drink, including learned skills. - r0: int + r0: IQ increase amount return: undefined4 - name: BarPrintLevelMaxedOutString address: EU: 0x238D660 description: |- - [MANUAL DESCRIPTION] + Seems to handle printing the correct text for a "level increase" from a drink, but only if the pokemon is already level 100. - r0: int - r1: undefined4 - r2: undefined4 - r3: undefined4 + r0: levels "increased" - name: BarDrawAndUpdateGainedIqSkills address: EU: 0x238D6F4 description: |- - [MANUAL DESCRIPTION] + Called by BarPrintIqAndSkills to name any IQ skills gained from a drink. r0: char r1: char @@ -202,48 +210,49 @@ overlay19: address: EU: 0x238D820 description: |- - [MANUAL DESCRIPTION] + Actually apply stat changes from a drink. - r0: struct - r1: int + r0: struct bar_stats_data* + r1: stored to bar_stats_data->stat_drink_event_kind return: undefined4 - name: BarPrintReactionsAndStatIncreases address: EU: 0x238D9F4 description: |- - [MANUAL DESCRIPTION] + Seems to handle drink reactions, and calling the correct stat increase text function. - r0: struct - r1: undefined4 - r2: undefined4 - r3: undefined4 + r0: struct bar_stats_data* - name: BarHandleDrinkEventSubcase address: EU: 0x238DC0C description: |- - [MANUAL DESCRIPTION] + Has different behavior based on the type of drink. Usually assigns the next correct bar_subcase, and for good stat based drink events, seems to handle or roll that somehow. + No params or return. - name: BarPostDrinkCaseForCustomer address: EU: 0x238DE44 description: |- - [MANUAL DESCRIPTION] + Sets the correct bar_update_case after completing a drink, depending on who ordered the drink. + No params or return. - name: BarMaybeIsClosedUnkStringIdMenu address: EU: 0x238DEBC description: |- - [MANUAL DESCRIPTION] + Seems to check if a currently unknown String Id based menu type's window is closed? + Just a guess. + return: undefined4 - name: BarCreateUnkStringIdMenu address: EU: 0x238DED4 description: |- - [MANUAL DESCRIPTION] + Seems to handle initialization of a currently unknown String Id based menu type. r0: undefined4 r1: undefined4 - r2: struct + r2: struct simple_menu_id_item* r3: undefined4 stack[0]: char stack[1]: uint32_t @@ -251,65 +260,75 @@ overlay19: address: EU: 0x238DF4C description: |- - [MANUAL DESCRIPTION] - return: int - - name: BarDisplayPortrait + Seems to retrieve the result of some kind of player choice from a currently unknown String Id based menu type. + + return: menu result + - name: BarTryShowPortrait address: EU: 0x238DF84 description: |- - [MANUAL DESCRIPTION] + Calls ShowPortraitInPortraitBox with portrait data from the spinda_cafe struct. + No params or return. - - name: BarTryHidePortraitBox + - name: BarTryHidePortrait address: EU: 0x238DFB0 description: |- - [MANUAL DESCRIPTION] + Calls HidePortraitBox with portrait data from the spinda_cafe struct. + No params or return. - name: BarInventoryMenuCallback address: EU: 0x238DFD8 description: |- - [MANUAL DESCRIPTION] + Seems to be some sort of callback function used by an inventory menu for the cafe. r0: undefined4 - r1: int + r1: spinda_cafe->item_validities index? r2: undefined4 return: undefined4 - name: BarTryCloseInventoryMenu address: EU: 0x238E018 description: |- - [MANUAL DESCRIPTION] + Calls CloseInventoryMenu with spinda_cafe->inventory_window_id. + No params or return. - name: BarTryCloseTeamMovesMenu address: EU: 0x238E050 description: |- - [MANUAL DESCRIPTION] + Calls CloseAdvancedTextBox with spinda_cafe->inventory_window_id. + Contextually seems responsible for closing the menu for team moves. + No params or return. - name: SpindaBarEntry address: EU: 0x238E0A0 description: |- - [MANUAL DESCRIPTION] + First entry point into overlay 19, called by MENU_JUICE_BAR. + return: undefined4 - name: SpindaBarResume address: EU: 0x238E130 description: |- - [MANUAL DESCRIPTION] + Subsequent entry point into overlay 19, called by MENU_JUICE_BAR_PICK_ITEM. + return: undefined4 - name: SpindaBarDestruct address: EU: 0x238E1C0 description: |- - [MANUAL DESCRIPTION] + The destructor of overlay 19 for both entry points. + Does nothing but call BarTryClosePortraitBox... + No params or return. - name: SpindaBarMenuUpdate address: EU: 0x238E1CC description: |- - [MANUAL DESCRIPTION] + Called every frame overlay 19 is active, primarily handling interface between the script, and BarCaseManagerSub. return: undefined4 data: - name: BAR_MIRACLE_EVENT_WEIGHTS @@ -320,8 +339,9 @@ overlay19: length: NA: 0x8 description: |- - [MANUAL DESCRIPTION] - int16_t + Weights for a "miracle drink event" to be an egg, a gourmet recruit, a dungeon unlock, or a regular miracle drink in that order. + By default, it's 10 weight for each. + type: int16_t[4] - name: BAR_UNLOCKABLE_DUNGEONS_TABLE address: EU: 0x238E61C @@ -330,9 +350,9 @@ overlay19: length: NA: 0xC description: |- - Note: unverified, ported from Irdkwia's notes + Stores dungeon ids, as well as the required $SCENARIO_BALANCE_FLAG to obtain them from the cafe. - type: struct dungeon_id_16[6] + type: struct bar_dungeon_unlock[6] - name: BAR_RECRUITABLE_GOURMET_MONSTER_TABLE address: EU: 0x238E628 @@ -340,10 +360,12 @@ overlay19: JP: 0x238F04C length: NA: 0xD8 + EU: 0xD8 JP: 0xD8 description: |- - [MANUAL DESCRIPTION] - monster_id_16 + A table of valid monsters for both the recruit for the gourmet recruit event, and the egg-giver for egg event. + + type: monster_id_16[108] - name: BAR_AVAILABLE_ITEMS address: EU: 0x238E700 @@ -352,7 +374,7 @@ overlay19: length: NA: 0x5AC description: |- - Note: unverified, ported from Irdkwia's notes + A table of valid bar items, the stats they would give for a good drink, and the weights for normal/good/"miracle"/bad drinks. type: struct bar_item[66] - name: BAR_STAT_REACTION_STRINGS @@ -363,44 +385,53 @@ overlay19: length: NA: 0x2C description: |- - [MANUAL DESCRIPTION] - int16_t + Text string ids for bad/miracle/good drink reactions to stat changes, in that order. + Ex: "Huh?[K] Whaaat?[K]" or "Shock!!!" + + type: int16_t[3] - name: GOOD_DRINK_REACTION_STRINGS address: EU: 0x238ECB2 description: |- - [MANUAL DESCRIPTION] - int16_t + Text string ids for good drinks if a stat goes up/a stat is already maxed out/IQ went up in that order. + + type: int16_t[3] - name: BAR_STAT_CHANGE_STRINGS address: EU: 0x238ECB8 description: |- - [MANUAL DESCRIPTION] - int16_t + Text string ids for stats changing because of bad/miracle/good drinks in that order. + + type: int16_t[3] - name: NEUTRAL_DRINK_REACTION_STRINGS address: EU: 0x238ECBE description: |- - [MANUAL DESCRIPTION] - int16_t - - name: AWFUL_DRINK_REACTION_STRINGS + Text string ids for the flavor of neutral drinks. + + type: int16_t[3] + - name: BAD_DRINK_REACTION_STRINGS address: EU: 0x238ECC4 description: |- - [MANUAL DESCRIPTION] - int16_t + Text string ids for the flavor of bad drinks. + + type: int16_t[3] - name: BAR_IQ_CHANGE_STRINGS address: EU: 0x238ECCA description: |- - [MANUAL DESCRIPTION] - int16_t + Text string ids for how IQ changed, depending on the source of the IQ increase (guaranteed, good, miracle). + + type: int16_t[3] - name: BAR_IQ_UNABLE_TO_CHANGE_STRINGS address: EU: 0x238ECD0 description: |- - [MANUAL DESCRIPTION] - int16_t + Text string ids for how IQ would have changed, depending on the source of the IQ increase (guaranteed, good, miracle). + Play if IQ is already maxed out. One of these strings falsely claims IQ increases anyway. + + type int16_t[3] - name: GOURMET_PORTRAIT_OFFSET_TABLE address: EU: 0x238ECD8 @@ -409,8 +440,9 @@ overlay19: length: NA: 0x28 description: |- - [MANUAL DESCRIPTION] - vec2 + Table of portrait offsets for the gourmet recruit's portraits during the gourmet recruit drink event. + + type: vec2[5] - name: BAR_STAT_NAME_STRINGS address: EU: 0x238ED00 @@ -419,8 +451,9 @@ overlay19: length: NA: 0xC description: |- - [MANUAL DESCRIPTION] - int16_t + Text string ids for the names of the stats, to be used by other text strings. + + type: int16_t[6] - name: BAR_WINDOW_PARAMS_1 address: EU: 0x238ED0C @@ -472,8 +505,10 @@ overlay19: NA: 0x238E238 JP: 0x238F790 description: |- - [MANUAL DESCRIPTION] - int16_t + A list of types of drinks, such as "Tea", "Milk", or "Juice" to refer to the drink by. + Not all of the text strings designed for this purpose are actually in use. + + type: int16_t[12] - name: BAR_MAIN_MENU_ITEMS address: EU: 0x238ED84 @@ -505,38 +540,49 @@ overlay19: address: EU: 0x238EDF4 description: |- - [MANUAL DESCRIPTION] - wchar_t + A new line character, appended to various other strings during operation of the menu. + Always loaded as a full 4 bytes... + + type: wchar_t - name: BAR_ME_PLAY_TEXT_TAG address: EU: 0x238EDF8 description: |- - [MANUAL DESCRIPTION] - char + "[me_play:0]" + + type: string - name: DEBUG_MESSAGE_REQUEST_STR address: EU: 0x238EE04 description: |- - [MANUAL DESCRIPTION] - char + "dirinkbar request %3d\n" + Request likely refers to requesting the script to do something. + + type: string - name: DEBUG_MESSAGE_REQUEST_AND_RETURN_STR address: EU: 0x238EE1C description: |- - [MANUAL DESCRIPTION] - char + "dirinkbar request %3d[%3d]\n" + Request again likely refers to requesting the script to do something. + + type: string - name: DEBUG_MESSAGE_BEFORE_SET_STR address: EU: 0x238EE38 description: |- - [MANUAL DESCRIPTION] - char + "dirinkbar message before set\n" + Message before likely refers to a textbox appearing immediately before passing control to the script engine. + + type: string - name: DEBUG_MESSAGE_AFTER_SET_STR address: EU: 0x238EE58 description: |- - [MANUAL DESCRIPTION] - char + "dirinkbar message after set\n" + Message before likely refers to a textbox appearing immediately after passing control to the script engine. + + type: string - name: OV19_STATIC_INITIALIZER aliases: - OVERLAY19_RESERVED_SPACE @@ -555,11 +601,6 @@ overlay19: NA: 0x238E360 JP: 0x238F8A0 length: - NA: 0x4 - description: "Note: unverified, ported from Irdkwia's notes" - - name: OVERLAY19_UNKNOWN_POINTER__NA_238E364 - address: - NA: 0x238E364 - length: - NA: 0x4 - description: "Note: unverified, ported from Irdkwia's notes" + NA: 0x6 + description: |- + Seems to remember where the player's cursor was previously during menu navigation. From 7a6935b8df8fcc0a2c4fb47dba708ebb0ae6cb76 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 31 May 2026 02:11:53 -0400 Subject: [PATCH 005/117] Fix Bar Items --- headers/types/ground_mode/ground_mode.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index 5f8b3fa1..19739690 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -583,10 +583,10 @@ struct bar_item { int16_t def_increase; int16_t spa_increase; int16_t spdef_increase; - ushort normal_drink_wght; - ushort good_drink_wght; - ushort miracle_drink_wght; - ushort bad_drink_wght; + uint16_t normal_drink_wght; + uint16_t good_drink_wght; + uint16_t miracle_drink_wght; + uint16_t bad_drink_wght; }; ASSERT_SIZE(struct bar_item, 22); From 1e97972c90f572f51c1f3d776f3f002808323d4e Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 31 May 2026 02:15:43 -0400 Subject: [PATCH 006/117] Ignore this, I changed these function names by hand poorly --- headers/functions/overlay19.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/functions/overlay19.h b/headers/functions/overlay19.h index 3734ae9e..6cc23222 100644 --- a/headers/functions/overlay19.h +++ b/headers/functions/overlay19.h @@ -18,7 +18,7 @@ void BarPopulateDrinkableBagItems(void); void BarZeroInitPreprocessorFlagsAndReturnCase(void); bool BarZeroInitBufferAndPreprocessorArgsZero(void); undefined4 BarTrySetEventMainActor(void); -bool BarZeroInitBufferAndPreprocessorArgsZero(void); +bool BarZeroInitBufferAndPreprocessorArgsOne(void); undefined4 BarPrintHpIncreaseString(int32_t param_1,int32_t param_2); undefined4 BarPrintOtherStatIncreaseString(int param_1,int param_2,int param_3); undefined4 BarPrintIqAndSkills(int param_1); From eb45402c845594be2806d053ced0fd08149ddb8b Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 31 May 2026 02:20:31 -0400 Subject: [PATCH 007/117] Syntax It probably isn't hard to run clang on the header files with the python script, but I can't really be bothered... --- headers/functions/overlay19.h | 32 ++-- headers/types/ground_mode/enums.h | 190 ++++++++++++------------ headers/types/ground_mode/ground_mode.h | 7 +- symbols/overlay19.yml | 61 ++++---- 4 files changed, 147 insertions(+), 143 deletions(-) diff --git a/headers/functions/overlay19.h b/headers/functions/overlay19.h index 6cc23222..f289745c 100644 --- a/headers/functions/overlay19.h +++ b/headers/functions/overlay19.h @@ -2,38 +2,42 @@ #define HEADERS_FUNCTIONS_OVERLAY19_H_ struct bar_item* GetBarItem(enum item_id item_id); -void SetMiracleDrinkStatCountRange(int *param_1,int *param_2); -void SetBadDrinkStatCountRange(int *param_1,int *param_2); -unsigned short * GetBarItemResultWeights(enum item_id param_1); -unsigned short * BarGetDrinkEventWeights(void); +void SetMiracleDrinkStatCountRange(int* param_1, int* param_2); +void SetBadDrinkStatCountRange(int* param_1, int* param_2); +unsigned short* GetBarItemResultWeights(enum item_id param_1); +unsigned short* BarGetDrinkEventWeights(void); enum monster_id BarGetRandomValidEggRecruit(void); enum monster_id BarGetValidEggGiverFromGourmetTable(void); enum monster_id BarGetRandomValidRecruitFromGourmetTable(void); -int BarGetUnlockableDungeonPtr(struct bar_dungeon_unlock **param_1); -int BarPopulateUnlockableDungeons(struct dungeon_id_8 *param_1); +int BarGetUnlockableDungeonPtr(struct bar_dungeon_unlock** param_1); +int BarPopulateUnlockableDungeons(struct dungeon_id_8* param_1); void BarTryClosePortraitBox(void); undefined4 BarCaseManagerSub(void); -undefined4 BarMaybeSetBarScrollBoxWindowId(undefined4 param_1,undefined4 param_2,undefined4 param_3); +undefined4 BarMaybeSetBarScrollBoxWindowId(undefined4 param_1, undefined4 param_2, + undefined4 param_3); void BarPopulateDrinkableBagItems(void); void BarZeroInitPreprocessorFlagsAndReturnCase(void); bool BarZeroInitBufferAndPreprocessorArgsZero(void); undefined4 BarTrySetEventMainActor(void); bool BarZeroInitBufferAndPreprocessorArgsOne(void); -undefined4 BarPrintHpIncreaseString(int32_t param_1,int32_t param_2); -undefined4 BarPrintOtherStatIncreaseString(int param_1,int param_2,int param_3); +undefined4 BarPrintHpIncreaseString(int32_t param_1, int32_t param_2); +undefined4 BarPrintOtherStatIncreaseString(int param_1, int param_2, int param_3); undefined4 BarPrintIqAndSkills(int param_1); void BarPrintLevelMaxedOutString(int param_1); -undefined4 BarDrawAndUpdateGainedIqSkills(char *param_1,char *param_2,int param_3,int param_4,int param_5,int param_6,int param_7); -undefined4 BarUpdateDrinkEventNewStats(struct bar_stats_data *param_1,int param_2); -void BarPrintReactionsAndStatIncreases(struct bar_stats_data *param_1); +undefined4 BarDrawAndUpdateGainedIqSkills(char* param_1, char* param_2, int param_3, int param_4, + int param_5, int param_6, int param_7); +undefined4 BarUpdateDrinkEventNewStats(struct bar_stats_data* param_1, int param_2); +void BarPrintReactionsAndStatIncreases(struct bar_stats_data* param_1); void BarHandleDrinkEventSubcase(void); void BarPostDrinkCaseForCustomer(void); undefined4 BarMaybeIsClosedUnkStringIdMenu(void); -void BarCreateUnkStringIdMenu(undefined4 param_1,undefined4 param_2,struct simple_menu_id_item *param_3,undefined4 param_4,char param_5,uint32_t param_6); +void BarCreateUnkStringIdMenu(undefined4 param_1, undefined4 param_2, + struct simple_menu_id_item* param_3, undefined4 param_4, char param_5, + uint32_t param_6); int GetUnkStringIdMenuResult(void); void BarTryShowPortrait(void); void BarTryHidePortrait(void); -undefined4 BarInventoryMenuCallback(undefined4 param_1,int param_2,undefined4 param_3); +undefined4 BarInventoryMenuCallback(undefined4 param_1, int param_2, undefined4 param_3); void BarTryCloseInventoryMenu(void); void BarTryCloseTeamMovesMenu(void); undefined4 SpindaBarEntry(void); diff --git a/headers/types/ground_mode/enums.h b/headers/types/ground_mode/enums.h index d7408227..256af15f 100644 --- a/headers/types/ground_mode/enums.h +++ b/headers/types/ground_mode/enums.h @@ -2255,107 +2255,107 @@ enum performance_progress_flag { }; enum bar_update_case { - BAR_INIT_AND_RETURN=0, - BAR_SUBCASE_FUNC=1, - BAR_GOTO_ESCAPE=2, - BAR_ESCAPE=3, - BAR_SUSPEND_NO_MSG=4, - BAR_DRINK_FOR_HERO=5, - BAR_DRINK_FOR_PARTNER=6, - BAR_DRINK_FOR_RECRUIT=7, - BAR_DRINK_END_RECRUIT=8, - BAR_DRINK_END_HERO=9, - BAR_DRINK_END_PARTNER=10, - BAR_MAKE_DRINK=11, - BAR_SELECT_MSG_SUSPEND=12, - BAR_MSG_PRE_SUSPEND=13, - BAR_SUSPEND_MSG=14, - BAR_MSG_POST_SUSPEND=15, - BAR_EGG_HERO_PARTNER=16, - BAR_EGG_RECRUIT=17, - BAR_GOURMET_HERO_PARTNER=18, - BAR_GOURMET_RECRUIT=19, - BAR_GOURMET_LEAVE=20, - BAR_UNLOCK_DUNGEON=21 + BAR_INIT_AND_RETURN = 0, + BAR_SUBCASE_FUNC = 1, + BAR_GOTO_ESCAPE = 2, + BAR_ESCAPE = 3, + BAR_SUSPEND_NO_MSG = 4, + BAR_DRINK_FOR_HERO = 5, + BAR_DRINK_FOR_PARTNER = 6, + BAR_DRINK_FOR_RECRUIT = 7, + BAR_DRINK_END_RECRUIT = 8, + BAR_DRINK_END_HERO = 9, + BAR_DRINK_END_PARTNER = 10, + BAR_MAKE_DRINK = 11, + BAR_SELECT_MSG_SUSPEND = 12, + BAR_MSG_PRE_SUSPEND = 13, + BAR_SUSPEND_MSG = 14, + BAR_MSG_POST_SUSPEND = 15, + BAR_EGG_HERO_PARTNER = 16, + BAR_EGG_RECRUIT = 17, + BAR_GOURMET_HERO_PARTNER = 18, + BAR_GOURMET_RECRUIT = 19, + BAR_GOURMET_LEAVE = 20, + BAR_UNLOCK_DUNGEON = 21 }; enum bar_subcase { - SBAR_MAYBE_ESCAPE_SUB=-1, - SBAR_INIT=0, - BAR_UNK_0x1=1, - SBAR_MAIN_M_1ST_T=2, - SBAR_MAIN_M_AGAIN_T=3, - SBAR_MAIN_M_RESULTS=4, - SBAR_MAIN_M_INFO_W=5, - SBAR_MAIN_M_NO_ITEMS_W=6, - SBAR_ITEM_SEL_W=7, - SBAR_ITEM_SEL_M_INIT=8, - SBAR_ITEM_SEL_SUBM_INIT=9, - SBAR_ITEM_SEL_SUBM_RESULTS=10, - SBAR_ITEM_INFO_INIT=11, - SBAR_ITEM_INFO_CLOSE=12, - SBAR_TEAM_SEL_W=13, - SBAR_TEAM_SEL_M_INIT=14, - SBAR_TEAM_SEL_SUBM_INIT=15, - SBAR_TEAM_CONFIRM_M_INIT=16, - SBAR_TEAM_SUMMARY_INIT=17, - SBAR_TEAM_SUMMARY_CLOSE=18, - SBAR_TEAM_MOVES_M_INIT=19, - SBAR_TEAM_MOVES_M_RESULTS=20, - SBAR_TEAM_MOVE_INFO_INIT=21, - SBAR_TEAM_MOVE_INFO_CLOSE=22, - SBAR_TEAM_IQ_INIT=23, - SBAR_TEAM_IQ_CLOSE=24, - SBAR_TEAM_CONFIRM_M_RESULTS=25, - SBAR_TEAM_CONFIRM_M_CANCEL=26, - SBAR_CALL_MENTRY=27, - SBAR_ROLL_DRINK_DATA=28, - BAR_GOOD_SPINDA_REACT=29, - SBAR_MIRACLE_SPINDA_REACT=30, - SBAR_MIRACLE_1ST_TASTE=31, - SBAR_MIRACLE_REACT_1=32, - SBAR_MIRACLE_REACT_2=33, - SBAR_OTHER_1ST_TASTE=34, - SBAR_OTHER_REACT_1=35, - SBAR_BAD_DRINK_RARE_RESUME=36, - SBAR_CALC_STAT_CHANGES=37, - SBAR_DO_POSITIVE_DRINK_EVENT=38, - SBAR_MIRACLE_DRINK_RESUME=39, - SBAR_DO_NEGATIVE_DRINK_EVENT=40, - SBAR_HANDLE_LEVEL_UP=41, - SBAR_EGG_TURN_SUSPEND=42, - SBAR_EGG_TURN_RESUME=43, - SBAR_EGG_UNTURN_SUSPEND=44, - SBAR_EGG_UNTURN_RESUME=45, - SBAR_EGG_FINISH=46, - SBAR_GOURMET_FIRST_LINE=47, - SBAR_GOURMET_SUSPEND=48, - SBAR_GOURMET_DISP_PORTRAIT=49, - SBAR_GOURMET_ASK_JOIN=50, - SBAR_GOURMET_CHECK_CHOICE=51, - SBAR_GOURMET_REJECT_DELAY=52, - SBAR_GOURMET_REJECT_END=53, - SBAR_GOURMET_ACCEPT_DELAY=54, - SBAR_GOURMET_ACCEPT_SUSPEND=55, - SBAR_GOURMET_FINISH=56, - SBAR_EMPTY_0x39=57, - SBAR_DUNGEON_FIRST_LINE=58, - SBAR_DUNGEON_DISPLAY_MAP=59, - SBAR_DUNGEON_FINISH=60, - SBAR_DEFAULT_RESUME=61, - SBAR_MAYBE_WAIT_OUT_FRAMES=62, - SBAR_MAYBE_WAIT_CLOSE=63, - SBAR_MIRACLE_FINISH=64 + SBAR_MAYBE_ESCAPE_SUB = -1, + SBAR_INIT = 0, + BAR_UNK_0x1 = 1, + SBAR_MAIN_M_1ST_T = 2, + SBAR_MAIN_M_AGAIN_T = 3, + SBAR_MAIN_M_RESULTS = 4, + SBAR_MAIN_M_INFO_W = 5, + SBAR_MAIN_M_NO_ITEMS_W = 6, + SBAR_ITEM_SEL_W = 7, + SBAR_ITEM_SEL_M_INIT = 8, + SBAR_ITEM_SEL_SUBM_INIT = 9, + SBAR_ITEM_SEL_SUBM_RESULTS = 10, + SBAR_ITEM_INFO_INIT = 11, + SBAR_ITEM_INFO_CLOSE = 12, + SBAR_TEAM_SEL_W = 13, + SBAR_TEAM_SEL_M_INIT = 14, + SBAR_TEAM_SEL_SUBM_INIT = 15, + SBAR_TEAM_CONFIRM_M_INIT = 16, + SBAR_TEAM_SUMMARY_INIT = 17, + SBAR_TEAM_SUMMARY_CLOSE = 18, + SBAR_TEAM_MOVES_M_INIT = 19, + SBAR_TEAM_MOVES_M_RESULTS = 20, + SBAR_TEAM_MOVE_INFO_INIT = 21, + SBAR_TEAM_MOVE_INFO_CLOSE = 22, + SBAR_TEAM_IQ_INIT = 23, + SBAR_TEAM_IQ_CLOSE = 24, + SBAR_TEAM_CONFIRM_M_RESULTS = 25, + SBAR_TEAM_CONFIRM_M_CANCEL = 26, + SBAR_CALL_MENTRY = 27, + SBAR_ROLL_DRINK_DATA = 28, + BAR_GOOD_SPINDA_REACT = 29, + SBAR_MIRACLE_SPINDA_REACT = 30, + SBAR_MIRACLE_1ST_TASTE = 31, + SBAR_MIRACLE_REACT_1 = 32, + SBAR_MIRACLE_REACT_2 = 33, + SBAR_OTHER_1ST_TASTE = 34, + SBAR_OTHER_REACT_1 = 35, + SBAR_BAD_DRINK_RARE_RESUME = 36, + SBAR_CALC_STAT_CHANGES = 37, + SBAR_DO_POSITIVE_DRINK_EVENT = 38, + SBAR_MIRACLE_DRINK_RESUME = 39, + SBAR_DO_NEGATIVE_DRINK_EVENT = 40, + SBAR_HANDLE_LEVEL_UP = 41, + SBAR_EGG_TURN_SUSPEND = 42, + SBAR_EGG_TURN_RESUME = 43, + SBAR_EGG_UNTURN_SUSPEND = 44, + SBAR_EGG_UNTURN_RESUME = 45, + SBAR_EGG_FINISH = 46, + SBAR_GOURMET_FIRST_LINE = 47, + SBAR_GOURMET_SUSPEND = 48, + SBAR_GOURMET_DISP_PORTRAIT = 49, + SBAR_GOURMET_ASK_JOIN = 50, + SBAR_GOURMET_CHECK_CHOICE = 51, + SBAR_GOURMET_REJECT_DELAY = 52, + SBAR_GOURMET_REJECT_END = 53, + SBAR_GOURMET_ACCEPT_DELAY = 54, + SBAR_GOURMET_ACCEPT_SUSPEND = 55, + SBAR_GOURMET_FINISH = 56, + SBAR_EMPTY_0x39 = 57, + SBAR_DUNGEON_FIRST_LINE = 58, + SBAR_DUNGEON_DISPLAY_MAP = 59, + SBAR_DUNGEON_FINISH = 60, + SBAR_DEFAULT_RESUME = 61, + SBAR_MAYBE_WAIT_OUT_FRAMES = 62, + SBAR_MAYBE_WAIT_CLOSE = 63, + SBAR_MIRACLE_FINISH = 64 }; enum drink_event_type { - DRINK_NORMAL=0, - DRINK_GOOD=1, - DRINK_BAD=2, - DRINK_EVENT_EGG=3, - DRINK_EVENT_GOURMET=4, - DRINK_EVENT_DUNGEON=5, - DRINK_EVENT_MIRACLE=6 + DRINK_NORMAL = 0, + DRINK_GOOD = 1, + DRINK_BAD = 2, + DRINK_EVENT_EGG = 3, + DRINK_EVENT_GOURMET = 4, + DRINK_EVENT_DUNGEON = 5, + DRINK_EVENT_MIRACLE = 6 }; // These are super long, so split them out into a separate file diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index 19739690..03922455 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -1027,7 +1027,6 @@ struct link_shop { }; ASSERT_SIZE(struct link_shop, 964); - struct bar_dungeon_unlock { struct dungeon_id_8 dungeon_id; uint8_t scenario_balance_min; @@ -1050,7 +1049,8 @@ struct bar_stats_data { }; ASSERT_SIZE(struct bar_stats_data, 184); -// Pointer lives at 0x23258F0 EU, which is squarely part of overlay_11. Other overlays likely share this address too. +// Pointer lives at 0x23258F0 EU, which is squarely part of overlay_11. Other overlays likely share +// this address too. struct spinda_cafe { enum bar_update_case main_case; enum bar_subcase curr_subcase; @@ -1081,7 +1081,8 @@ struct spinda_cafe { uint32_t team_member_index; short selected_move_index; struct move_id_16 team_move_ids[16]; - int16_t drink_type_index; // random [0,11] and determines what spinda calls the drink (IE: Mix, Juice, Dew, Soda, Shake) + int16_t drink_type_index; // random [0,11] and determines what spinda calls the drink (IE: Mix, + // Juice, Dew, Soda, Shake) enum drink_event_type drink_event; short frame_delay; struct dungeon_id_8 unlocked_dungeon; diff --git a/symbols/overlay19.yml b/symbols/overlay19.yml index fc2593e7..58d1fbac 100644 --- a/symbols/overlay19.yml +++ b/symbols/overlay19.yml @@ -45,7 +45,7 @@ overlay19: description: |- Retrieves a pointer to the weights for normal, good, miracle, and bad drink results by item. The miracle drink event chance is actually a shared chance for a random drink event such as a dungeon unlock, recruit, or a real miracle drink. - + r0: item_id return: uint16_t* - name: BarGetDrinkEventWeights @@ -53,7 +53,7 @@ overlay19: EU: 0x238ACF8 description: |- Retrieves the static chances for an egg, recruit, dungeon unlock, or a miracle drink. - + return: uint16_t * - name: BarGetRandomValidEggRecruit address: @@ -62,7 +62,7 @@ overlay19: JP: 0x238B724 description: |- Retrives a random valid egg species for an egg event at the cafe. - + return: enum monster_id - name: BarGetValidEggGiverFromGourmetTable address: @@ -71,7 +71,7 @@ overlay19: JP: 0x238B7D4 description: |- Retrieves a random valid species from BAR_RECRUITABLE_GOURMET_MONSTER_TABLE to serve as the egg giver for an egg event at the cafe. - + return: enum monster_id - name: BarGetRandomValidRecruitFromGourmetTable address: @@ -80,7 +80,7 @@ overlay19: JP: 0x238B87C description: |- Retrieves a random valid species from BAR_RECRUITABLE_GOURMET_MONSTER_TABLE to serve as the recruit for an gourmet recruit event at the cafe. - + return: enum monster_id - name: BarGetUnlockableDungeonPtr address: @@ -88,7 +88,7 @@ overlay19: description: |- If not zero, stores a double pointer to the BAR_UNLOCKABLE_DUNGEONS_TABLE to r0. Then returns 6 for some reason... Unclear what this is intended to actually do... - + r0: struct bar_dungeon_unlock ** return: Always 6? - name: BarPopulateUnlockableDungeons @@ -104,7 +104,7 @@ overlay19: EU: 0x238AFA8 description: |- Seems to handle closing portrait boxes for the overlay. - + No params or return. - name: BarCaseManagerSub address: @@ -112,7 +112,7 @@ overlay19: description: |- Called once every frame by SpindaBarMenuUpdate if the bar_update_case is BAR_SUBCASE_FUNC. State Case with unique behaviors enumerated by enum bar_subcase. - + return: maybe a return code for SpindaBarMenuUpdate? - name: BarMaybeSetBarScrollBoxWindowId address: @@ -136,7 +136,7 @@ overlay19: EU: 0x238D174 description: |- Zero Inits many preprocessor_flag fields, but also sets the return_case for scripts to zero within spinda_cafe. - + No params or return. - name: BarZeroInitBufferAndPreprocessorArgsZero address: @@ -150,7 +150,7 @@ overlay19: description: |- Seems to set ACTOR_NPC_EVENT_MAIN to whoever the player ordered the drink for. Seems to do other things before that though... - + return: undefined4 - name: BarZeroInitBufferAndPreprocessorArgsOne address: @@ -242,7 +242,7 @@ overlay19: description: |- Seems to check if a currently unknown String Id based menu type's window is closed? Just a guess. - + return: undefined4 - name: BarCreateUnkStringIdMenu address: @@ -261,21 +261,21 @@ overlay19: EU: 0x238DF4C description: |- Seems to retrieve the result of some kind of player choice from a currently unknown String Id based menu type. - + return: menu result - name: BarTryShowPortrait address: EU: 0x238DF84 description: |- Calls ShowPortraitInPortraitBox with portrait data from the spinda_cafe struct. - + No params or return. - name: BarTryHidePortrait address: EU: 0x238DFB0 description: |- Calls HidePortraitBox with portrait data from the spinda_cafe struct. - + No params or return. - name: BarInventoryMenuCallback address: @@ -292,7 +292,7 @@ overlay19: EU: 0x238E018 description: |- Calls CloseInventoryMenu with spinda_cafe->inventory_window_id. - + No params or return. - name: BarTryCloseTeamMovesMenu address: @@ -300,21 +300,21 @@ overlay19: description: |- Calls CloseAdvancedTextBox with spinda_cafe->inventory_window_id. Contextually seems responsible for closing the menu for team moves. - + No params or return. - name: SpindaBarEntry address: EU: 0x238E0A0 description: |- First entry point into overlay 19, called by MENU_JUICE_BAR. - + return: undefined4 - name: SpindaBarResume address: EU: 0x238E130 description: |- Subsequent entry point into overlay 19, called by MENU_JUICE_BAR_PICK_ITEM. - + return: undefined4 - name: SpindaBarDestruct address: @@ -322,7 +322,7 @@ overlay19: description: |- The destructor of overlay 19 for both entry points. Does nothing but call BarTryClosePortraitBox... - + No params or return. - name: SpindaBarMenuUpdate address: @@ -359,12 +359,12 @@ overlay19: NA: 0x238DAF4 JP: 0x238F04C length: - NA: 0xD8 EU: 0xD8 + NA: 0xD8 JP: 0xD8 description: |- A table of valid monsters for both the recruit for the gourmet recruit event, and the egg-giver for egg event. - + type: monster_id_16[108] - name: BAR_AVAILABLE_ITEMS address: @@ -408,7 +408,7 @@ overlay19: EU: 0x238ECBE description: |- Text string ids for the flavor of neutral drinks. - + type: int16_t[3] - name: BAD_DRINK_REACTION_STRINGS address: @@ -422,7 +422,7 @@ overlay19: EU: 0x238ECCA description: |- Text string ids for how IQ changed, depending on the source of the IQ increase (guaranteed, good, miracle). - + type: int16_t[3] - name: BAR_IQ_UNABLE_TO_CHANGE_STRINGS address: @@ -430,7 +430,7 @@ overlay19: description: |- Text string ids for how IQ would have changed, depending on the source of the IQ increase (guaranteed, good, miracle). Play if IQ is already maxed out. One of these strings falsely claims IQ increases anyway. - + type int16_t[3] - name: GOURMET_PORTRAIT_OFFSET_TABLE address: @@ -441,7 +441,7 @@ overlay19: NA: 0x28 description: |- Table of portrait offsets for the gourmet recruit's portraits during the gourmet recruit drink event. - + type: vec2[5] - name: BAR_STAT_NAME_STRINGS address: @@ -542,7 +542,7 @@ overlay19: description: |- A new line character, appended to various other strings during operation of the menu. Always loaded as a full 4 bytes... - + type: wchar_t - name: BAR_ME_PLAY_TEXT_TAG address: @@ -557,7 +557,7 @@ overlay19: description: |- "dirinkbar request %3d\n" Request likely refers to requesting the script to do something. - + type: string - name: DEBUG_MESSAGE_REQUEST_AND_RETURN_STR address: @@ -565,7 +565,7 @@ overlay19: description: |- "dirinkbar request %3d[%3d]\n" Request again likely refers to requesting the script to do something. - + type: string - name: DEBUG_MESSAGE_BEFORE_SET_STR address: @@ -573,7 +573,7 @@ overlay19: description: |- "dirinkbar message before set\n" Message before likely refers to a textbox appearing immediately before passing control to the script engine. - + type: string - name: DEBUG_MESSAGE_AFTER_SET_STR address: @@ -602,5 +602,4 @@ overlay19: JP: 0x238F8A0 length: NA: 0x6 - description: |- - Seems to remember where the player's cursor was previously during menu navigation. + description: "Seems to remember where the player's cursor was previously during menu navigation." From 915b40e41bc5ba6ac1056ca23514c66cfb74f6f1 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 31 May 2026 16:20:17 -0400 Subject: [PATCH 008/117] Update symbols/overlay19.yml Co-authored-by: UsernameFodder <93669634+UsernameFodder@users.noreply.github.com> --- symbols/overlay19.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay19.yml b/symbols/overlay19.yml index 58d1fbac..b025ddd4 100644 --- a/symbols/overlay19.yml +++ b/symbols/overlay19.yml @@ -135,7 +135,7 @@ overlay19: address: EU: 0x238D174 description: |- - Zero Inits many preprocessor_flag fields, but also sets the return_case for scripts to zero within spinda_cafe. + Zero inits many preprocessor_flag fields, but also sets the return_case for scripts to zero within spinda_cafe. No params or return. - name: BarZeroInitBufferAndPreprocessorArgsZero From 9774b7f42a54492b2d2d05bd0a56ac4db45da672 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 31 May 2026 16:34:57 -0400 Subject: [PATCH 009/117] Update symbols/overlay19.yml Co-authored-by: UsernameFodder <93669634+UsernameFodder@users.noreply.github.com> --- symbols/overlay19.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay19.yml b/symbols/overlay19.yml index b025ddd4..5d43cc33 100644 --- a/symbols/overlay19.yml +++ b/symbols/overlay19.yml @@ -61,7 +61,7 @@ overlay19: NA: 0x238A1C4 JP: 0x238B724 description: |- - Retrives a random valid egg species for an egg event at the cafe. + Retrieves a random valid egg species for an egg event at the cafe. return: enum monster_id - name: BarGetValidEggGiverFromGourmetTable From 5f5effa586cfc13b5c0a67037e8f7e200268cc59 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 31 May 2026 16:35:51 -0400 Subject: [PATCH 010/117] Fix a few things --- headers/data/overlay19.h | 35 ++++++++++++++++--------------- headers/functions/overlay19.h | 5 +++-- headers/types/ground_mode/enums.h | 2 +- symbols/overlay19.yml | 2 ++ 4 files changed, 24 insertions(+), 20 deletions(-) diff --git a/headers/data/overlay19.h b/headers/data/overlay19.h index 83f32271..549220d1 100644 --- a/headers/data/overlay19.h +++ b/headers/data/overlay19.h @@ -1,34 +1,35 @@ #ifndef HEADERS_DATA_OVERLAY19_H_ #define HEADERS_DATA_OVERLAY19_H_ -int16_t BAR_MIRACLE_EVENT_WEIGHTS[4]; +extern int16_t BAR_MIRACLE_EVENT_WEIGHTS[4]; extern struct dungeon_id_16 BAR_UNLOCKABLE_DUNGEONS_TABLE[6]; extern struct monster_id_16 BAR_RECRUITABLE_GOURMET_MONSTER_TABLE[108]; extern struct bar_item BAR_AVAILABLE_ITEMS[66]; -int16_t BAR_STAT_REACTION_STRINGS[3]; -int16_t GOOD_DRINK_REACTION_STRINGS[3]; -int16_t BAR_STAT_CHANGE_STRINGS[3]; -int16_t NEUTRAL_DRINK_REACTION_STRINGS[3]; -int16_t BAD_DRINK_REACTION_STRINGS[3]; -int16_t BAR_IQ_CHANGE_STRINGS[3]; -int16_t BAR_IQ_UNABLE_TO_CHANGE_STRINGS[3]; +extern int16_t BAR_STAT_REACTION_STRINGS[3]; +extern int16_t GOOD_DRINK_REACTION_STRINGS[3]; +extern int16_t BAR_STAT_CHANGE_STRINGS[3]; +extern int16_t NEUTRAL_DRINK_REACTION_STRINGS[3]; +extern int16_t BAD_DRINK_REACTION_STRINGS[3]; +extern int16_t BAR_IQ_CHANGE_STRINGS[3]; +extern int16_t BAR_IQ_UNABLE_TO_CHANGE_STRINGS[3]; extern struct vec2 GOURMET_PORTRAIT_OFFSET_TABLE[5]; -int16_t BAR_STAT_NAME_STRINGS[6]; +extern int16_t BAR_STAT_NAME_STRINGS[6]; extern struct window_params BAR_WINDOW_PARAMS_1; extern struct window_params BAR_WINDOW_PARAMS_2; extern struct window_params BAR_WINDOW_PARAMS_3; extern struct simple_menu_id_item BAR_MENU_ITEMS_CONFIRM_1[3]; extern struct simple_menu_id_item BAR_MENU_ITEMS_CONFIRM_2[3]; -int16_t BAR_DRINK_NAMES_STRINGS[12]; +extern int16_t BAR_DRINK_NAMES_STRINGS[12]; extern struct simple_menu_id_item BAR_MAIN_MENU_ITEMS[4]; extern struct simple_menu_id_item BAR_SUBMENU_ITEMS_1[4]; extern struct simple_menu_id_item BAR_SUBMENU_ITEMS_2[6]; -wchar_t BAR_NEW_LINE_CHAR; -char BAR_ME_PLAY_TEXT_TAG[12]; -char DEBUG_MESSAGE_REQUEST_STR[23]; -char DEBUG_MESSAGE_REQUEST_AND_RETURN_STR[28]; -char DEBUG_MESSAGE_BEFORE_SET_STR[30]; -char DEBUG_MESSAGE_AFTER_SET_STR[29]; +extern wchar_t BAR_NEW_LINE_CHAR; +extern char BAR_ME_PLAY_TEXT_TAG[12]; +extern char DEBUG_MESSAGE_REQUEST_STR[23]; +extern char DEBUG_MESSAGE_REQUEST_AND_RETURN_STR[28]; +extern char DEBUG_MESSAGE_BEFORE_SET_STR[30]; +extern char DEBUG_MESSAGE_AFTER_SET_STR[29]; extern undefined4 OV19_STATIC_INITIALIZER; -int16_t BAR_MENU_PRIOR_CHOICE_INDICES[3]; +extern int16_t BAR_MENU_PRIOR_CHOICE_INDICES[3]; + #endif diff --git a/headers/functions/overlay19.h b/headers/functions/overlay19.h index f289745c..d85d052e 100644 --- a/headers/functions/overlay19.h +++ b/headers/functions/overlay19.h @@ -4,8 +4,8 @@ struct bar_item* GetBarItem(enum item_id item_id); void SetMiracleDrinkStatCountRange(int* param_1, int* param_2); void SetBadDrinkStatCountRange(int* param_1, int* param_2); -unsigned short* GetBarItemResultWeights(enum item_id param_1); -unsigned short* BarGetDrinkEventWeights(void); +uint16_t* GetBarItemResultWeights(enum item_id param_1); +uint16_t* BarGetDrinkEventWeights(void); enum monster_id BarGetRandomValidEggRecruit(void); enum monster_id BarGetValidEggGiverFromGourmetTable(void); enum monster_id BarGetRandomValidRecruitFromGourmetTable(void); @@ -44,4 +44,5 @@ undefined4 SpindaBarEntry(void); undefined4 SpindaBarResume(void); void SpindaBarDestruct(void); undefined4 SpindaBarMenuUpdate(void); + #endif diff --git a/headers/types/ground_mode/enums.h b/headers/types/ground_mode/enums.h index 256af15f..9c9d6a4c 100644 --- a/headers/types/ground_mode/enums.h +++ b/headers/types/ground_mode/enums.h @@ -2276,7 +2276,7 @@ enum bar_update_case { BAR_GOURMET_HERO_PARTNER = 18, BAR_GOURMET_RECRUIT = 19, BAR_GOURMET_LEAVE = 20, - BAR_UNLOCK_DUNGEON = 21 + BAR_UNLOCK_DUNGEON = 21, }; enum bar_subcase { diff --git a/symbols/overlay19.yml b/symbols/overlay19.yml index 5d43cc33..d3275e9e 100644 --- a/symbols/overlay19.yml +++ b/symbols/overlay19.yml @@ -143,6 +143,7 @@ overlay19: EU: 0x238D1A4 description: |- Zero initializes the preprocessor_args_0 and string_buffer_0 fields of spinda_cafe. + return: bool for if buffer was empty string - name: BarTrySetEventMainActor address: @@ -157,6 +158,7 @@ overlay19: EU: 0x238D2E4 description: |- Zero initializes the preprocessor_args_1 and string_buffer_1 fields of spinda_cafe. + return: bool for if buffer was empty string - name: BarPrintHpIncreaseString address: From 5f6b9aad4f68b6ddcd55dc1cea8dce61cdcf17e1 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 31 May 2026 16:38:58 -0400 Subject: [PATCH 011/117] Add Aliases --- headers/types/ground_mode/enums.h | 4 ++-- symbols/overlay19.yml | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/headers/types/ground_mode/enums.h b/headers/types/ground_mode/enums.h index 9c9d6a4c..6d937872 100644 --- a/headers/types/ground_mode/enums.h +++ b/headers/types/ground_mode/enums.h @@ -2345,7 +2345,7 @@ enum bar_subcase { SBAR_DEFAULT_RESUME = 61, SBAR_MAYBE_WAIT_OUT_FRAMES = 62, SBAR_MAYBE_WAIT_CLOSE = 63, - SBAR_MIRACLE_FINISH = 64 + SBAR_MIRACLE_FINISH = 64, }; enum drink_event_type { @@ -2355,7 +2355,7 @@ enum drink_event_type { DRINK_EVENT_EGG = 3, DRINK_EVENT_GOURMET = 4, DRINK_EVENT_DUNGEON = 5, - DRINK_EVENT_MIRACLE = 6 + DRINK_EVENT_MIRACLE = 6, }; // These are super long, so split them out into a separate file diff --git a/symbols/overlay19.yml b/symbols/overlay19.yml index d3275e9e..e072a1ec 100644 --- a/symbols/overlay19.yml +++ b/symbols/overlay19.yml @@ -56,6 +56,8 @@ overlay19: return: uint16_t * - name: BarGetRandomValidEggRecruit + aliases: + - GetRecruitableMonsterAll address: EU: 0x238AD04 NA: 0x238A1C4 @@ -65,6 +67,8 @@ overlay19: return: enum monster_id - name: BarGetValidEggGiverFromGourmetTable + aliases: + - GetRecruitableMonsterList address: EU: 0x238ADB4 NA: 0x238A274 @@ -74,6 +78,8 @@ overlay19: return: enum monster_id - name: BarGetRandomValidRecruitFromGourmetTable + aliases: + - GetRecruitableMonsterListRestricted address: EU: 0x238AE5C NA: 0x238A31C @@ -356,6 +362,8 @@ overlay19: type: struct bar_dungeon_unlock[6] - name: BAR_RECRUITABLE_GOURMET_MONSTER_TABLE + aliases: + - BAR_RECRUITABLE_MONSTER_TABLE address: EU: 0x238E628 NA: 0x238DAF4 From fe2b5d97bf57ec21838b0b70eb59c9da35fd943d Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 31 May 2026 16:49:42 -0400 Subject: [PATCH 012/117] Update overlay19.yml --- symbols/overlay19.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/symbols/overlay19.yml b/symbols/overlay19.yml index e072a1ec..3fbe8454 100644 --- a/symbols/overlay19.yml +++ b/symbols/overlay19.yml @@ -337,6 +337,7 @@ overlay19: EU: 0x238E1CC description: |- Called every frame overlay 19 is active, primarily handling interface between the script, and BarCaseManagerSub. + return: undefined4 data: - name: BAR_MIRACLE_EVENT_WEIGHTS @@ -349,6 +350,7 @@ overlay19: description: |- Weights for a "miracle drink event" to be an egg, a gourmet recruit, a dungeon unlock, or a regular miracle drink in that order. By default, it's 10 weight for each. + type: int16_t[4] - name: BAR_UNLOCKABLE_DUNGEONS_TABLE address: From 8f2ecda82ee0032a833dc42a02ff232290d6b8eb Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 31 May 2026 16:53:34 -0400 Subject: [PATCH 013/117] Update overlay19.yml --- symbols/overlay19.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/symbols/overlay19.yml b/symbols/overlay19.yml index 3fbe8454..5f3493fa 100644 --- a/symbols/overlay19.yml +++ b/symbols/overlay19.yml @@ -111,7 +111,7 @@ overlay19: description: |- Seems to handle closing portrait boxes for the overlay. - No params or return. + No params. - name: BarCaseManagerSub address: EU: 0x238AFE4 @@ -136,14 +136,14 @@ overlay19: description: |- Populates an item list of only valid bar items within spinda_cafe. - No params or return. + No params. - name: BarZeroInitPreprocessorFlagsAndReturnCase address: EU: 0x238D174 description: |- Zero inits many preprocessor_flag fields, but also sets the return_case for scripts to zero within spinda_cafe. - No params or return. + No params. - name: BarZeroInitBufferAndPreprocessorArgsZero address: EU: 0x238D1A4 @@ -236,14 +236,14 @@ overlay19: description: |- Has different behavior based on the type of drink. Usually assigns the next correct bar_subcase, and for good stat based drink events, seems to handle or roll that somehow. - No params or return. + No params. - name: BarPostDrinkCaseForCustomer address: EU: 0x238DE44 description: |- Sets the correct bar_update_case after completing a drink, depending on who ordered the drink. - No params or return. + No params. - name: BarMaybeIsClosedUnkStringIdMenu address: EU: 0x238DEBC @@ -277,14 +277,14 @@ overlay19: description: |- Calls ShowPortraitInPortraitBox with portrait data from the spinda_cafe struct. - No params or return. + No params. - name: BarTryHidePortrait address: EU: 0x238DFB0 description: |- Calls HidePortraitBox with portrait data from the spinda_cafe struct. - No params or return. + No params. - name: BarInventoryMenuCallback address: EU: 0x238DFD8 @@ -301,7 +301,7 @@ overlay19: description: |- Calls CloseInventoryMenu with spinda_cafe->inventory_window_id. - No params or return. + No params. - name: BarTryCloseTeamMovesMenu address: EU: 0x238E050 @@ -309,7 +309,7 @@ overlay19: Calls CloseAdvancedTextBox with spinda_cafe->inventory_window_id. Contextually seems responsible for closing the menu for team moves. - No params or return. + No params. - name: SpindaBarEntry address: EU: 0x238E0A0 @@ -331,7 +331,7 @@ overlay19: The destructor of overlay 19 for both entry points. Does nothing but call BarTryClosePortraitBox... - No params or return. + No params. - name: SpindaBarMenuUpdate address: EU: 0x238E1CC From b52e13716ae0ce8a1e1ff0dd038f700456359f22 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 31 May 2026 19:28:24 -0400 Subject: [PATCH 014/117] Initial Dump --- headers/functions/arm9.h | 8 ++++ headers/functions/overlay11.h | 11 +++++ headers/functions/overlay21.h | 1 + symbols/arm9.yml | 62 ++++++++++++++++++++++++++ symbols/overlay11.yml | 83 +++++++++++++++++++++++++++++++++++ symbols/overlay21.yml | 8 ++++ 6 files changed, 173 insertions(+) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index b8dc0ab6..68fc69d0 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -300,6 +300,7 @@ bool GetExclusiveItemForMonsterFromBag(struct item* item, enum exclusive_item_ef enum monster_id monster_id, enum type_id type1, enum type_id type2); int GetHpBoostFromExclusiveItems(undefined* param_1); +void FreePointerAndDestination(void); void ApplyGummiBoostsToGroundMonster(struct ground_monster* ground_monster, enum item_id item_id, bool not_boost_stats, struct gummi_result* gummi_result); void ApplyGummiBoostsToTeamMember(struct team_member* team_member, enum item_id item_id, @@ -327,9 +328,14 @@ void ApplyGummiBoostsGroundMode(struct monster_id_16* monster_id, uint16_t* mons uint8_t* monster_offensive_stats, uint8_t* monster_defensive_stats, enum item_id item_id, bool not_boost_stats, struct gummi_result* gummi_result); +void EmptySwapShop(void); bool LoadSynthBin(void); void CloseSynthBin(void); bool GenerateCroagunkItems(void); +uint InitSynthShopItems(struct synth_template* param_1); +bool PopCroagunkItem(void); +undefined4 LoadCroagunkShop(void); +undefined4 SaveCroagunkShop(void); struct synth_template* GetSynthItem(enum item_id exclusive_item); bool GetValidSynthsForSpecies(enum monster_id monster_id, struct monster_synth_data* monster_synth_data, @@ -579,6 +585,8 @@ void LoadTblTalk(void); int GetTalkLine(int personality_idx, enum talk_type talk_type, int restrictions); bool IsAOrBPressed(void); void DrawTextInWindow(int window_id, int x, int y, char* string); +void PrintNumExclusiveItemsHeld(void); +void PrintNumExclusiveItems(undefined4 param_1,undefined4 param_2,undefined4 param_3,uint32_t param_4, preprocessor_args* param_5); uint8_t GetCharWidth(char symbol); int GetColorCodePaletteOffset(char symbol); uint8_t DrawChar(int window_id, int x, int y, char symbol, int color_offset); diff --git a/headers/functions/overlay11.h b/headers/functions/overlay11.h index 1f10d56f..e5dcc0fc 100644 --- a/headers/functions/overlay11.h +++ b/headers/functions/overlay11.h @@ -165,6 +165,17 @@ bool IsBagNotEmpty(void); void GetExclusiveItemRequirements(undefined param_1, undefined param_2); void SwapShopInventoryManager(enum swap_shop_inventory_case inventory_case, int monster_id_or_exc_item_count); +void GetTradeTypeOfIndex(void); +uint16_t RetreiveTradeCountReq(void); +void ShopWipeEverything(void); +int Return3IfNotQuadExcItem(void); +void CheckExclusiveItemRequirements(void); +void DoSomethingFunkyWithBag(void); +undefined4 ExclusiveItemCountingThing(uint enum item_id,uint param_2,int param_3); +void LoopExclusiveItemReqs(void); +void AddExclusiveItemToShop(int Loop_Index,uint16_t param_2,uint16_t Exclusive_Item_ID); +int GetItemByTradeType(void); +void CloseTextBox2AndResetWindowID(void); void HandleControlsTopScreenGround(void); bool GetDungeonMapPos(struct uvec2* out_pos, enum dungeon_id dungeon); void WorldMapSetMode(uint32_t world_map_mode); diff --git a/headers/functions/overlay21.h b/headers/functions/overlay21.h index bad53433..fc63e42f 100644 --- a/headers/functions/overlay21.h +++ b/headers/functions/overlay21.h @@ -2,6 +2,7 @@ #define HEADERS_FUNCTIONS_OVERLAY21_H_ void SwapShopDialogueManager(enum swap_shared_case new_shared_case); +void SwapShopSetSimpleMenuWindowId(int8_t window_id); enum item_id GetFirstExclusivePrerequisite(enum item_id item_id); int SwapShopEntryPoint(void); void SwapShopDestructor(void); diff --git a/symbols/arm9.yml b/symbols/arm9.yml index dda5e6ef..5614ec89 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -3070,6 +3070,13 @@ arm9: r0: some struct that has species ID in it? return: max HP boost from exclusive items + - name: FreePointerAndDestination + address: + EU: 0x20115A0 + description: |- + [MANUAL DESCRIPTION] + + No params. - name: ApplyGummiBoostsToGroundMonster address: EU: 0x20115D0 @@ -3221,6 +3228,13 @@ arm9: stack[0]: Item ID stack[1]: bool to NOT increase stats stack[2]: [output] pointer to a struct gummi_result + - name: EmptySwapShop + address: + EU: 0x2012B60 + description: |- + [MANUAL DESCRIPTION] + + No params. - name: LoadSynthBin address: EU: 0x2012B88 @@ -3241,6 +3255,35 @@ arm9: description: |- Generates the Croagunk Swap Shop items for Croagunk in Wigglytuff's Guild. return: 1 if at least one item generated, 0 otherwise. + - name: InitSynthShopItems + address: + EU: 0x2013160 + description: |- + [MANUAL DESCRIPTION] + + r0: struct + return: uint + - name: PopCroagunkItem + address: + EU: 0x20131F8 + description: |- + [MANUAL DESCRIPTION] + + return: undefined4 + - name: LoadCroagunkShop + address: + EU: 0x2013238 + description: |- + [MANUAL DESCRIPTION] + + return: undefined4 + - name: SaveCroagunkShop + address: + EU: 0x2013298 + description: |- + [MANUAL DESCRIPTION] + + return: undefined4 - name: GetSynthItem address: EU: 0x20132F8 @@ -5515,6 +5558,25 @@ arm9: r1: x offset within window r2: y offset within window r3: text to draw + - name: PrintNumExclusiveItemsHeld + address: + EU: 0x202654C + description: |- + [MANUAL DESCRIPTION] + + No params. + - name: PrintNumExclusiveItems + address: + EU: 0x20265C4 + description: |- + [MANUAL DESCRIPTION] + + r0: undefined4 + r1: undefined4 + r2: undefined4 + r3: undefined4 + stack[0]: undefined4 + - name: GetCharWidth address: EU: 0x2026830 diff --git a/symbols/overlay11.yml b/symbols/overlay11.yml index 53a0aedd..0aa488af 100644 --- a/symbols/overlay11.yml +++ b/symbols/overlay11.yml @@ -1540,6 +1540,89 @@ overlay11: r0: switch case index for the function: 0 = Swap List Inventory, 1 = Unknown, 2 = Species Exclusive Item List, 3 = Item Trade Away Selection List. r1: Depends on r0. If case 2: ID of the monster to retrieve an exclusive item list for. If case 3: Number of Exclusive Items the player owns. + - name: GetTradeTypeOfIndex + address: + EU: 0x230C2B0 + description: |- + [MANUAL DESCRIPTION] + + No params. + - name: RetreiveTradeCountReq + address: + EU: 0x230C2F4 + description: |- + [MANUAL DESCRIPTION] + + return: uint16_t + - name: ShopWipeEverything + address: + EU: 0x230C934 + description: |- + [MANUAL DESCRIPTION] + + No params. + - name: Return3IfNotQuadExcItem + address: + EU: 0x230CA04 + description: |- + [MANUAL DESCRIPTION] + + return: int + - name: CheckExclusiveItemRequirements + address: + EU: 0x230CB6C + description: |- + [MANUAL DESCRIPTION] + + No params. + - name: DoSomethingFunkyWithBag + address: + EU: 0x230CE70 + description: |- + [MANUAL DESCRIPTION] + + No params. + - name: ExclusiveItemCountingThing + address: + EU: 0x230CF3C + description: |- + [MANUAL DESCRIPTION] + + r0: uint32_t32_t + r1: uint32_t32_t + r2: int + return: undefined4 + - name: LoopExclusiveItemReqs + address: + EU: 0x230CFB8 + description: |- + [MANUAL DESCRIPTION] + + No params. + - name: AddExclusiveItemToShop + address: + EU: 0x230D2C0 + description: |- + [MANUAL DESCRIPTION] + + r0: int32_t + r1: uint16_t + r2: uint16_t + + - name: GetItemByTradeType + address: + EU: 0x230D30C + description: |- + [MANUAL DESCRIPTION] + + return: int + - name: CloseTextBox2AndResetWindowID + address: + EU: 0x230D480 + description: |- + [MANUAL DESCRIPTION] + + No params. - name: HandleControlsTopScreenGround address: EU: 0x230EFB4 diff --git a/symbols/overlay21.yml b/symbols/overlay21.yml index 1783b59e..a8393cdb 100644 --- a/symbols/overlay21.yml +++ b/symbols/overlay21.yml @@ -24,6 +24,14 @@ overlay21: Often calls SwapShopInventoryManager, and is often called by SwapShopMainManager. r0: New current_switch_case value. + - name: SwapShopSetSimpleMenuWindowId + address: + EU: 0x238AFA8 + description: |- + [MANUAL DESCRIPTION] + + r0: int8_t + - name: GetFirstExclusivePrerequisite address: EU: 0x238C320 From 48427200918d783ff2d9da52b38399cf6c51b40b Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 31 May 2026 20:15:41 -0400 Subject: [PATCH 015/117] Manual Fixed + Additions --- headers/data/arm9.h | 2 ++ headers/data/overlay11.h | 9 +++++++ headers/functions/arm9.h | 10 +++----- symbols/arm9.yml | 53 +++++++++++++++----------------------- symbols/overlay11.yml | 55 +++++++++++++++++++++++++++++++++++++++- symbols/overlay21.yml | 5 ++-- 6 files changed, 91 insertions(+), 43 deletions(-) diff --git a/headers/data/arm9.h b/headers/data/arm9.h index 7f5facf0..081eb03e 100644 --- a/headers/data/arm9.h +++ b/headers/data/arm9.h @@ -232,6 +232,8 @@ extern void* ITEM_DATA_TABLE_PTRS[3]; #if PMDSKY_VERSION == PMDSKY_EU extern char* ITEM_LANG_FILE_ARRAY[5]; #endif + +extern void* SYNTH_BIN_FILE_PTR; extern struct move_data_table* MOVE_DATA_TABLE_PTR; extern struct obj_graphics_controls* OBJ_GRAPHICS_CONTROLS_PTR; extern struct wan_table* WAN_TABLE; diff --git a/headers/data/overlay11.h b/headers/data/overlay11.h index de272ba6..ffa2bdb2 100644 --- a/headers/data/overlay11.h +++ b/headers/data/overlay11.h @@ -20,9 +20,18 @@ extern struct animation_data SETANIMATION_TABLE[84]; extern struct ground_entity_function_table OBJECT_FUNCTION_TABLE; extern struct ground_entity_function_table PERFORMER_FUNCTION_TABLE; extern struct window_params TEAM_INFO_BOX_DEFAULT_WINDOW_PARAMS; +extern char SWAP_SHOP_ONE_STAR_STR[7]; +extern char SWAP_SHOP_TWO_STAR_STR[13]; +extern char SWAP_SHOP_THREE_STAR_STR[19]; +extern char SWAP_SHOP_RED_TEXT_TAG_STR[7]; +extern char SWAP_SHOP_UNCENTER_TEXT_TAG_STR[5]; +extern char SWAP_SHOP_CLUMSET_ONE_STAR_STR[21]; +extern char SWAP_SHOP_CLUMSET_TWO_STAR_STR[27]; +extern char SWAP_SHOP_CLUMSET_THREE_STAR_STR[33]; extern struct overlay_load_entry OVERLAY11_OVERLAY_LOAD_TABLE[21]; extern undefined4 OV11_STATIC_INITIALIZER; extern struct main_ground_data GROUND_STATE_PTRS; +extern struct exclusive_item_requirements* EXCLUSIVE_ITEM_REQUIREMENTS_PTR; extern struct swap_shop_inventory_ptrs SWAP_SHOP_INVENTORY_PTRS; extern uint32_t WORLD_MAP_MODE; diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 68fc69d0..fa2265ae 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -300,7 +300,7 @@ bool GetExclusiveItemForMonsterFromBag(struct item* item, enum exclusive_item_ef enum monster_id monster_id, enum type_id type1, enum type_id type2); int GetHpBoostFromExclusiveItems(undefined* param_1); -void FreePointerAndDestination(void); +void SwapShopFreeDoublePointer(void); void ApplyGummiBoostsToGroundMonster(struct ground_monster* ground_monster, enum item_id item_id, bool not_boost_stats, struct gummi_result* gummi_result); void ApplyGummiBoostsToTeamMember(struct team_member* team_member, enum item_id item_id, @@ -328,12 +328,12 @@ void ApplyGummiBoostsGroundMode(struct monster_id_16* monster_id, uint16_t* mons uint8_t* monster_offensive_stats, uint8_t* monster_defensive_stats, enum item_id item_id, bool not_boost_stats, struct gummi_result* gummi_result); -void EmptySwapShop(void); +void ClearCroagunkItems(void); bool LoadSynthBin(void); void CloseSynthBin(void); bool GenerateCroagunkItems(void); -uint InitSynthShopItems(struct synth_template* param_1); -bool PopCroagunkItem(void); +uint GetCroagunkItemTemplates(struct synth_template* param_1); +bool PopCroagunkItem(enum item_id item); undefined4 LoadCroagunkShop(void); undefined4 SaveCroagunkShop(void); struct synth_template* GetSynthItem(enum item_id exclusive_item); @@ -585,8 +585,6 @@ void LoadTblTalk(void); int GetTalkLine(int personality_idx, enum talk_type talk_type, int restrictions); bool IsAOrBPressed(void); void DrawTextInWindow(int window_id, int x, int y, char* string); -void PrintNumExclusiveItemsHeld(void); -void PrintNumExclusiveItems(undefined4 param_1,undefined4 param_2,undefined4 param_3,uint32_t param_4, preprocessor_args* param_5); uint8_t GetCharWidth(char symbol); int GetColorCodePaletteOffset(char symbol); uint8_t DrawChar(int window_id, int x, int y, char symbol, int color_offset); diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 5614ec89..ef1ab892 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -3070,13 +3070,14 @@ arm9: r0: some struct that has species ID in it? return: max HP boost from exclusive items - - name: FreePointerAndDestination + - name: SwapShopFreeDoublePointer address: EU: 0x20115A0 description: |- - [MANUAL DESCRIPTION] - - No params. + Seems to call MemFree on *param_1 and **param_1, with a safety check that the **param_1 isn't zero. + Only known XREF is to SwapShopInventoryManager, so a more specific purpose for this function may exist. + + r0: double pointer to free - name: ApplyGummiBoostsToGroundMonster address: EU: 0x20115D0 @@ -3228,11 +3229,11 @@ arm9: stack[0]: Item ID stack[1]: bool to NOT increase stats stack[2]: [output] pointer to a struct gummi_result - - name: EmptySwapShop + - name: ClearCroagunkItems address: EU: 0x2012B60 description: |- - [MANUAL DESCRIPTION] + Zeroes the 8 daily random items Croagunk can swap for. No params. - name: LoadSynthBin @@ -3255,33 +3256,34 @@ arm9: description: |- Generates the Croagunk Swap Shop items for Croagunk in Wigglytuff's Guild. return: 1 if at least one item generated, 0 otherwise. - - name: InitSynthShopItems + - name: GetCroagunkItemTemplates address: EU: 0x2013160 description: |- - [MANUAL DESCRIPTION] + Retrieves the current Croagunk Swap Shop items as synth_template structs. - r0: struct + r0: pointer to at least 8 synth_template structs return: uint - name: PopCroagunkItem address: EU: 0x20131F8 description: |- - [MANUAL DESCRIPTION] + Tries to pop an item by id from Croagunk Swap Shop items. - return: undefined4 - - name: LoadCroagunkShop + r0: item_id + return: 1 if the item was found, 0 if not. + - name: LoadCroagunkItems address: EU: 0x2013238 description: |- - [MANUAL DESCRIPTION] + Seems to load the Croagunk Swap Shop items from the save file. return: undefined4 - name: SaveCroagunkShop address: EU: 0x2013298 description: |- - [MANUAL DESCRIPTION] + Seems to store the Croagunk Swap Shop items to the save file. return: undefined4 - name: GetSynthItem @@ -5558,25 +5560,6 @@ arm9: r1: x offset within window r2: y offset within window r3: text to draw - - name: PrintNumExclusiveItemsHeld - address: - EU: 0x202654C - description: |- - [MANUAL DESCRIPTION] - - No params. - - name: PrintNumExclusiveItems - address: - EU: 0x20265C4 - description: |- - [MANUAL DESCRIPTION] - - r0: undefined4 - r1: undefined4 - r2: undefined4 - r3: undefined4 - stack[0]: undefined4 - - name: GetCharWidth address: EU: 0x2026830 @@ -14716,6 +14699,10 @@ arm9: length: EU: 0x14 description: An array containing the names of each language file. Only exists in EU. + - name: SYNTH_BIN_FILE_PTR + address: + EU: 0x20AFFA0 + description: The location of the data/SYNTH/synth.bin file while loaded. - name: DUNGEON_MOVE_TABLES address: EU: 0x20AFFA8 diff --git a/symbols/overlay11.yml b/symbols/overlay11.yml index 0aa488af..3cba14bd 100644 --- a/symbols/overlay11.yml +++ b/symbols/overlay11.yml @@ -1608,7 +1608,6 @@ overlay11: r0: int32_t r1: uint16_t r2: uint16_t - - name: GetItemByTradeType address: EU: 0x230D30C @@ -1913,6 +1912,54 @@ overlay11: length: NA: 0x10 description: Default window_params for a team_info_box. + - name: SWAP_SHOP_ONE_STAR_STR + address: + EU: 0x2323AD8 + descrition: |- + "[M:S3]" + Used exclusively by GetExclusiveItemRequirements. + - name: SWAP_SHOP_TWO_STAR_STR + address: + EU: 0x2323AE0 + descrition: |- + "[M:S3][M:S3]" + Used exclusively by GetExclusiveItemRequirements. + - name: SWAP_SHOP_THREE_STAR_STR + address: + EU: 0x2323AF0 + descrition: |- + "[M:S3][M:S3][M:S3]" + Used exclusively by GetExclusiveItemRequirements. + - name: SWAP_SHOP_RED_TEXT_TAG_STR + address: + EU: 0x2323B34 + descrition: |- + "[CS:W]" + Used exclusively by a subfunction of SwapShopInventoryManager. + - name: SWAP_SHOP_UNCENTER_TEXT_TAG_STR + address: + EU: 0x2323B3C + descrition: |- + "[CR]" + Used exclusively by a subfunction of SwapShopInventoryManager. + - name: SWAP_SHOP_CLUMSET_ONE_STAR_STR + address: + EU: 0x2323B44 + descrition: |- + "[CLUM_SET:130][M:S3]" + Used exclusively by a subfunction of SwapShopInventoryManager. + - name: SWAP_SHOP_CLUMSET_TWO_STAR_STR + address: + EU: 0x2323B5C + descrition: |- + "[CLUM_SET:122][M:S3][M:S3]" + Used exclusively by a subfunction of SwapShopInventoryManager. + - name: SWAP_SHOP_CLUMSET_THREE_STAR_STR + address: + EU: 0x2323B78 + descrition: |- + "[CLUM_SET:114][M:S3][M:S3][M:S3]" + Used exclusively by a subfunction of SwapShopInventoryManager. - name: OVERLAY11_OVERLAY_LOAD_TABLE address: EU: 0x2323B9C @@ -1970,6 +2017,12 @@ overlay11: Host pointers to multiple structure used for performing an overworld scene type: struct main_ground_data + - name: EXCLUSIVE_ITEM_REQUIREMENTS_PTR + address: + EU: 0x23258E0 + length: + EU: 0x4 + description: Pointer to the exclusive_item_requirements struct, used by the swap shop. - name: SWAP_SHOP_INVENTORY_PTRS address: EU: 0x23258E4 diff --git a/symbols/overlay21.yml b/symbols/overlay21.yml index a8393cdb..79bafeaa 100644 --- a/symbols/overlay21.yml +++ b/symbols/overlay21.yml @@ -28,10 +28,9 @@ overlay21: address: EU: 0x238AFA8 description: |- - [MANUAL DESCRIPTION] - - r0: int8_t + Assigns a specified window_id to SWAP_SHOP_MENU_DATA_PTR->simple_menu_window_id. + r0: window_id - name: GetFirstExclusivePrerequisite address: EU: 0x238C320 From ebfd6842718d700fa5816bc82d0a37889b52dc77 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 31 May 2026 21:29:39 -0400 Subject: [PATCH 016/117] More manual fixes plus a few cafe things --- headers/functions/arm9.h | 13 +++- headers/functions/overlay10.h | 1 + headers/functions/overlay11.h | 15 ++--- symbols/arm9.yml | 74 ++++++++++++++++++++++- symbols/overlay10.yml | 14 +++++ symbols/overlay11.yml | 111 +++++++++------------------------- 6 files changed, 132 insertions(+), 96 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index fa2265ae..75d2d776 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -276,6 +276,7 @@ void SetActiveKecleonShop(enum team_id team_id); int GetMoneyStored(void); void SetMoneyStored(int amount); void AddMoneyStored(int amount); +enum monster_id GetEggSpecies(void); void RemoveItemFromKecleonShop1(int slot); void SortKecleonItems1(void); void GenerateKecleonItems1(enum kecleon_shop_version kecleon_shop_version); @@ -457,7 +458,7 @@ int AddSimpleObjToOam(struct obj_graphics_control* obj_graphics_control, uint16_ void GroupOamAttributesWrapper(struct obj_graphics_control* obj_graphics_control); void CopyAttributesToOamWrapper(struct obj_graphics_control* obj_graphics_control); void ChangeSimpleObjTexture(struct obj_graphics_control* obj_graphics_control, undefined4* src, - short oam_tile_num, uint16_t texture_size, bool extended_palette, + uint16_t oam_tile_num, uint16_t texture_size, bool extended_palette, uint8_t ext_palette_upper_shifted); void InitObjGraphicsControls(void); void CopyAttributesToOamBothScreens(void); @@ -1134,6 +1135,10 @@ bool DexNumbersEqual(enum monster_id monster1, enum monster_id monster2); bool GendersEqual(enum monster_id monster1, enum monster_id monster2); bool GendersEqualNotGenderless(enum monster_id monster1, enum monster_id monster2); bool GendersNotEqualNotGenderless(enum monster_id monster1, enum monster_id monster2); +void ModifyHpStat(int16_t *stat_ptr,int32_t amount); +void ModifyOffensiveStat(int8_t *stat_ptr,int32_t amount); +void ModifyDefensiveStat(int8_t *stat_ptr,int32_t amount); +void ModifyIqStat(int16_t *stat_ptr,int32_t amount); bool IsMonsterOnTeam(enum monster_id monster_id, int recruit_strategy); void GetNbRecruited(undefined* recruit); bool IsValidTeamMember(int member_idx); @@ -1166,10 +1171,11 @@ void SetTeamSetupHeroAndPartnerOnly(void); void SetTeamSetupHeroOnly(void); int GetPartyMembers(uint16_t* party_members); void RefillTeam(void); +void ValidateTeamMembers(bool *param_1); int ClearItem(int team_id, bool check); void ChangeGiratinaFormIfSkyDungeon(enum dungeon_id dungeon_id); void RevertGiratinaAndShaymin(uint8_t member_idx, undefined param_2); -void* OamTileNumberToVramAddress(short oam_tile_num, uint8_t screen); +void* OamTileNumberToVramAddress(uint16_t oam_tile_num, uint8_t screen); int GetIqSkillStringId(enum iq_skill_id iq_skill); bool DoesTacticFollowLeader(enum tactic_id tactic_id); void GetUnlockedTactics(enum tactic_id* unlocked_tactics, int level); @@ -1252,6 +1258,9 @@ void SetActorTalkMainAndActorTalkSub(enum script_entity_id actor_id_main, enum script_entity_id actor_id_sub); void SetActorTalkMain(enum script_entity_id actor_id); void SetActorTalkSub(enum script_entity_id actor_id); +void SetActorEventMain(undefined2 param_1); +void SetRandomRequestNpcs1And2(undefined2 param_1,undefined2 param_2); +void SetAllEventNpcs(undefined2 param_1,undefined2 param_2,undefined2 param_3,undefined2 param_4); void RandomizeDemoActors(void); void ItemAtTableIdx(int idx, struct bulk_item* item); void MainLoop(void); diff --git a/headers/functions/overlay10.h b/headers/functions/overlay10.h index 3d1a04d2..8ffd2ea4 100644 --- a/headers/functions/overlay10.h +++ b/headers/functions/overlay10.h @@ -12,6 +12,7 @@ bool CheckInventoryMenuField0x1A0(int window_id); uint8_t PopInventoryMenuField0x1A3(int window_id); void UpdateInventoryMenu(struct window* window); bool IsInventoryMenuState3(int window_id); +void CreateInventoryMenuOuter(int n_items,int param_2,int param_3,uint8_t *param_4,void *param_5,update_window_fn_t *param_6,uint param_7); int GetEffectAnimationField0x19(int anim_id); bool AnimationHasMoreFrames(int param_1); struct effect_animation* GetEffectAnimation(int anim_id); diff --git a/headers/functions/overlay11.h b/headers/functions/overlay11.h index e5dcc0fc..f207a833 100644 --- a/headers/functions/overlay11.h +++ b/headers/functions/overlay11.h @@ -19,6 +19,9 @@ int16_t ScriptParamToFixedPoint16(uint16_t parameter); void StationLoadHanger(void); void ScriptStationLoadTalk(void); void SsbLoad1(void); +void ReturnScriptMenuResultZero(void); +void ReturnScriptMenuResult(int param_1); +bool IsScriptMenuReturnDisabled(void); int ScriptSpecialProcessCall(undefined4* param_1, enum special_process_id id, int arg1, int arg2); bool GetCoroutineInfo(struct coroutine_info* coroutine_info, enum common_routine_id coroutine_id); enum monster_id GetSpecialRecruitmentSpecies(int idx); @@ -162,20 +165,10 @@ int CreateTopGroundMenu(void); void CloseTopGroundMenu(void); int UpdateTopGroundMenu(void); bool IsBagNotEmpty(void); +bool IsGroundMonsterAtMaxLevel(struct ground_monster* param_1); void GetExclusiveItemRequirements(undefined param_1, undefined param_2); void SwapShopInventoryManager(enum swap_shop_inventory_case inventory_case, int monster_id_or_exc_item_count); -void GetTradeTypeOfIndex(void); -uint16_t RetreiveTradeCountReq(void); -void ShopWipeEverything(void); -int Return3IfNotQuadExcItem(void); -void CheckExclusiveItemRequirements(void); -void DoSomethingFunkyWithBag(void); -undefined4 ExclusiveItemCountingThing(uint enum item_id,uint param_2,int param_3); -void LoopExclusiveItemReqs(void); -void AddExclusiveItemToShop(int Loop_Index,uint16_t param_2,uint16_t Exclusive_Item_ID); -int GetItemByTradeType(void); -void CloseTextBox2AndResetWindowID(void); void HandleControlsTopScreenGround(void); bool GetDungeonMapPos(struct uvec2* out_pos, enum dungeon_id dungeon); void WorldMapSetMode(uint32_t world_map_mode); diff --git a/symbols/arm9.yml b/symbols/arm9.yml index ef1ab892..e85bbcdd 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -2885,6 +2885,13 @@ arm9: Adds money to the amount of money the player has stored in the Duskull Bank. Just calls SetMoneyStored with the current money + money gained. r0: money gained (can be negative) + - name: GetEggSpecies + address: + EU: 0x2010824 + description: |- + Seems to retrieve the species of the egg the player currently has, or zero for no egg. + + return: monster_id - name: RemoveItemFromKecleonShop1 address: EU: 0x2010914 @@ -10798,6 +10805,38 @@ arm9: r0: id1 r1: id2 return: bool + - name: ModifyHpStat + address: + EU: 0x2055334 + description: |- + Used to raise or lower the Hp stat, bounding the value to [1,999]. + + r0: hp stat pointer + r1: amount + - name: ModifyOffensiveStat + address: + EU: 0x2055368 + description: |- + Used to raise or lower a defensive stat, bounding the value to [1,255]. + + r0: offensive stat pointer + r1: amount + - name: ModifyDefensiveStat + address: + EU: 0x205539C + description: |- + Used to raise or lower a defensive stat, bounding the value to [1,255]. + + r0: defensive stat pointer + r1: amount + - name: ModifyIqStat + address: + EU: 0x20553D0 + description: |- + Used to raise or lower the Iq stat, bounding the value to [1,999]. + + r0: iq stat pointer + r1: amount - name: IsMonsterOnTeam address: EU: 0x20554C4 @@ -11128,6 +11167,13 @@ arm9: Note: unverified, ported from Irdkwia's notes No params. + - name: ValidateTeamMembers + address: + EU: 0x2058440 + description: |- + Fills out a table of 4 bools for whether each member of the active team is valid. + + r0: bool* (Points to at least 4 bools) - name: ClearItem address: EU: 0x205856C @@ -11940,7 +11986,33 @@ arm9: Sets ACTOR_TALK_SUB to be actor_id. Implements SPECIAL_PROC_SET_ACTOR_TALK_SUB (see ScriptSpecialProcessCall). - r0: script_entity_id + r0: actor_id + - name: SetActorEventMain + address: + EU: 0x2065EEC + description: |- + Sets ACTOR_NPC_EVENT_MAIN to a specific actor_id. + + r0: actor_id + - name: SetRandomRequestNpcs1And2 + address: + EU: 0x2065EFC + description: |- + Sets ACTOR_REQUEST_NPC01 and ACTOR_REQUEST_NPC02 to specific actor_ids. + Has no impact on ACTOR_REQUEST_NPC03. + + r0: ACTOR_REQUEST_NPC01 actor_id + r1: ACTOR_REQUEST_NPC02 actor_id + - name: SetAllEventNpcs + address: + EU: 0x2065F28 + description: |- + Sets ACTOR_EVENT_NPC01 through ACTOR_EVENT_NPC04 to specific actor_ids. + + r0: ACTOR_EVENT_NPC01 actor_id + r1: ACTOR_EVENT_NPC02 actor_id + r2: ACTOR_EVENT_NPC03 actor_id + r3: ACTOR_EVENT_NPC04 actor_id - name: RandomizeDemoActors address: EU: 0x2065FC4 diff --git a/symbols/overlay10.yml b/symbols/overlay10.yml index e99294a4..ecf6b9dd 100644 --- a/symbols/overlay10.yml +++ b/symbols/overlay10.yml @@ -132,6 +132,20 @@ overlay10: r1: format ...: variadic return: number of characters printed, excluding the null-terminator + - name: CreateInventoryMenuOuter + address: + EU: 0x22BDDB4 + description: |- + Seems to handle the creation of an inventory menu for the spinda cafe. + The fact that this lives in overlay_10 suggests it may serve a more general purpose + + r0: int32_t + r1: int32_t + r2: int32_t + r3: uint8_t * + stack[0]: void + stack[1]: update_window_fn_t + statk[2]: uint32_t - name: GetEffectAnimationField0x19 address: EU: 0x22BE7F4 diff --git a/symbols/overlay11.yml b/symbols/overlay11.yml index 3cba14bd..176407dc 100644 --- a/symbols/overlay11.yml +++ b/symbols/overlay11.yml @@ -189,6 +189,27 @@ overlay11: EU: 0x22E6690 NA: 0x22E5D50 JP: 0x22E737C + - name: ReturnScriptMenuResultZero + address: + EU: 0x22E77A8 + description: |- + Returns control to the scripting engine for a message_menu, with case id 0. + + No params. + - name: ReturnScriptMenuResult + address: + EU: 0x22E77CC + description: |- + Returns control to the scripting engine for a message_menu, with a specified case_id. + + r0: case id to pass to the scripting engine + - name: IsScriptMenuReturnDisabled + address: + EU: 0x22E7808 + description: |- + Checks if the scripting engine is ready to return control to an overlay-based menu. + + return: 1 if the menu should continue execution, 0 if not. - name: ScriptSpecialProcessCall address: EU: 0x22E7A58 @@ -1518,6 +1539,14 @@ overlay11: r1: format ...: variadic return: number of characters printed, excluding the null-terminator + - name: IsGroundMonsterAtMaxLevel + address: + EU: 0x230B718 + description: |- + Checks if a ground_monster is above level 99. + + r0: ground_monster pointer + return: 1 if ground monster is above level 99, 0 if not. - name: GetExclusiveItemRequirements address: EU: 0x230B8D4 @@ -1540,88 +1569,6 @@ overlay11: r0: switch case index for the function: 0 = Swap List Inventory, 1 = Unknown, 2 = Species Exclusive Item List, 3 = Item Trade Away Selection List. r1: Depends on r0. If case 2: ID of the monster to retrieve an exclusive item list for. If case 3: Number of Exclusive Items the player owns. - - name: GetTradeTypeOfIndex - address: - EU: 0x230C2B0 - description: |- - [MANUAL DESCRIPTION] - - No params. - - name: RetreiveTradeCountReq - address: - EU: 0x230C2F4 - description: |- - [MANUAL DESCRIPTION] - - return: uint16_t - - name: ShopWipeEverything - address: - EU: 0x230C934 - description: |- - [MANUAL DESCRIPTION] - - No params. - - name: Return3IfNotQuadExcItem - address: - EU: 0x230CA04 - description: |- - [MANUAL DESCRIPTION] - - return: int - - name: CheckExclusiveItemRequirements - address: - EU: 0x230CB6C - description: |- - [MANUAL DESCRIPTION] - - No params. - - name: DoSomethingFunkyWithBag - address: - EU: 0x230CE70 - description: |- - [MANUAL DESCRIPTION] - - No params. - - name: ExclusiveItemCountingThing - address: - EU: 0x230CF3C - description: |- - [MANUAL DESCRIPTION] - - r0: uint32_t32_t - r1: uint32_t32_t - r2: int - return: undefined4 - - name: LoopExclusiveItemReqs - address: - EU: 0x230CFB8 - description: |- - [MANUAL DESCRIPTION] - - No params. - - name: AddExclusiveItemToShop - address: - EU: 0x230D2C0 - description: |- - [MANUAL DESCRIPTION] - - r0: int32_t - r1: uint16_t - r2: uint16_t - - name: GetItemByTradeType - address: - EU: 0x230D30C - description: |- - [MANUAL DESCRIPTION] - - return: int - - name: CloseTextBox2AndResetWindowID - address: - EU: 0x230D480 - description: |- - [MANUAL DESCRIPTION] - - No params. - name: HandleControlsTopScreenGround address: EU: 0x230EFB4 From 54e859b7f4cdfae248513f32face6e1000a0dde4 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Mon, 1 Jun 2026 00:10:13 -0400 Subject: [PATCH 017/117] Update overlay19.yml --- symbols/overlay19.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/symbols/overlay19.yml b/symbols/overlay19.yml index 5f3493fa..429e8b0e 100644 --- a/symbols/overlay19.yml +++ b/symbols/overlay19.yml @@ -347,6 +347,7 @@ overlay19: JP: 0x238F038 length: NA: 0x8 + EU: 0x8 description: |- Weights for a "miracle drink event" to be an egg, a gourmet recruit, a dungeon unlock, or a regular miracle drink in that order. By default, it's 10 weight for each. @@ -359,6 +360,7 @@ overlay19: JP: 0x238F040 length: NA: 0xC + EU: 0xC description: |- Stores dungeon ids, as well as the required $SCENARIO_BALANCE_FLAG to obtain them from the cafe. @@ -385,6 +387,7 @@ overlay19: JP: 0x238F124 length: NA: 0x5AC + EU: 0x5AC description: |- A table of valid bar items, the stats they would give for a good drink, and the weights for normal/good/"miracle"/bad drinks. @@ -396,6 +399,7 @@ overlay19: JP: 0x238F6D0 length: NA: 0x2C + EU: 0x2C description: |- Text string ids for bad/miracle/good drink reactions to stat changes, in that order. Ex: "Huh?[K] Whaaat?[K]" or "Shock!!!" @@ -404,6 +408,8 @@ overlay19: - name: GOOD_DRINK_REACTION_STRINGS address: EU: 0x238ECB2 + length: + EU: 0x6 description: |- Text string ids for good drinks if a stat goes up/a stat is already maxed out/IQ went up in that order. @@ -411,6 +417,8 @@ overlay19: - name: BAR_STAT_CHANGE_STRINGS address: EU: 0x238ECB8 + length: + EU: 0x6 description: |- Text string ids for stats changing because of bad/miracle/good drinks in that order. @@ -418,6 +426,8 @@ overlay19: - name: NEUTRAL_DRINK_REACTION_STRINGS address: EU: 0x238ECBE + length: + EU: 0x6 description: |- Text string ids for the flavor of neutral drinks. @@ -425,6 +435,8 @@ overlay19: - name: BAD_DRINK_REACTION_STRINGS address: EU: 0x238ECC4 + length: + EU: 0x6 description: |- Text string ids for the flavor of bad drinks. @@ -432,6 +444,8 @@ overlay19: - name: BAR_IQ_CHANGE_STRINGS address: EU: 0x238ECCA + length: + EU: 0x6 description: |- Text string ids for how IQ changed, depending on the source of the IQ increase (guaranteed, good, miracle). @@ -439,6 +453,8 @@ overlay19: - name: BAR_IQ_UNABLE_TO_CHANGE_STRINGS address: EU: 0x238ECD0 + length: + EU: 0x6 description: |- Text string ids for how IQ would have changed, depending on the source of the IQ increase (guaranteed, good, miracle). Play if IQ is already maxed out. One of these strings falsely claims IQ increases anyway. @@ -451,6 +467,7 @@ overlay19: JP: 0x238F6FC length: NA: 0x28 + EU: 0x28 description: |- Table of portrait offsets for the gourmet recruit's portraits during the gourmet recruit drink event. @@ -462,6 +479,7 @@ overlay19: JP: 0x238F724 length: NA: 0xC + EU: 0xC description: |- Text string ids for the names of the stats, to be used by other text strings. @@ -516,6 +534,10 @@ overlay19: EU: 0x238ED6C NA: 0x238E238 JP: 0x238F790 + length: + EU: 0x18 + NA: 0x18 + JP: 0x18 description: |- A list of types of drinks, such as "Tea", "Milk", or "Juice" to refer to the drink by. Not all of the text strings designed for this purpose are actually in use. @@ -551,6 +573,8 @@ overlay19: - name: BAR_NEW_LINE_CHAR address: EU: 0x238EDF4 + length: + EU: 0x4 description: |- A new line character, appended to various other strings during operation of the menu. Always loaded as a full 4 bytes... @@ -614,4 +638,5 @@ overlay19: JP: 0x238F8A0 length: NA: 0x6 + EU: 0x6 description: "Seems to remember where the player's cursor was previously during menu navigation." From f55a78e9c99f29d11a3e9c5323cccf4fef6ea460 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Mon, 1 Jun 2026 00:14:06 -0400 Subject: [PATCH 018/117] Fix Syntax --- symbols/overlay19.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/symbols/overlay19.yml b/symbols/overlay19.yml index 429e8b0e..1601f08a 100644 --- a/symbols/overlay19.yml +++ b/symbols/overlay19.yml @@ -346,8 +346,8 @@ overlay19: NA: 0x238DAE0 JP: 0x238F038 length: - NA: 0x8 EU: 0x8 + NA: 0x8 description: |- Weights for a "miracle drink event" to be an egg, a gourmet recruit, a dungeon unlock, or a regular miracle drink in that order. By default, it's 10 weight for each. @@ -359,8 +359,8 @@ overlay19: NA: 0x238DAE8 JP: 0x238F040 length: - NA: 0xC EU: 0xC + NA: 0xC description: |- Stores dungeon ids, as well as the required $SCENARIO_BALANCE_FLAG to obtain them from the cafe. @@ -386,8 +386,8 @@ overlay19: NA: 0x238DBCC JP: 0x238F124 length: - NA: 0x5AC EU: 0x5AC + NA: 0x5AC description: |- A table of valid bar items, the stats they would give for a good drink, and the weights for normal/good/"miracle"/bad drinks. @@ -398,8 +398,8 @@ overlay19: NA: 0x238E178 JP: 0x238F6D0 length: - NA: 0x2C EU: 0x2C + NA: 0x2C description: |- Text string ids for bad/miracle/good drink reactions to stat changes, in that order. Ex: "Huh?[K] Whaaat?[K]" or "Shock!!!" @@ -466,8 +466,8 @@ overlay19: NA: 0x238E1A4 JP: 0x238F6FC length: - NA: 0x28 EU: 0x28 + NA: 0x28 description: |- Table of portrait offsets for the gourmet recruit's portraits during the gourmet recruit drink event. @@ -478,8 +478,8 @@ overlay19: NA: 0x238E1CC JP: 0x238F724 length: - NA: 0xC EU: 0xC + NA: 0xC description: |- Text string ids for the names of the stats, to be used by other text strings. @@ -637,6 +637,6 @@ overlay19: NA: 0x238E360 JP: 0x238F8A0 length: - NA: 0x6 EU: 0x6 + NA: 0x6 description: "Seems to remember where the player's cursor was previously during menu navigation." From ac2a5e0b03d9339eac7a06f724f3593dc99d43b5 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Mon, 1 Jun 2026 01:11:05 -0400 Subject: [PATCH 019/117] Update ground_mode.h --- headers/types/ground_mode/ground_mode.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index 03922455..c3bdcf05 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -1079,12 +1079,12 @@ struct spinda_cafe { undefined1 unk_0xd2; undefined1 unk_0xd3; uint32_t team_member_index; - short selected_move_index; + int16_t selected_move_index; struct move_id_16 team_move_ids[16]; int16_t drink_type_index; // random [0,11] and determines what spinda calls the drink (IE: Mix, // Juice, Dew, Soda, Shake) enum drink_event_type drink_event; - short frame_delay; + uint16_t frame_delay; struct dungeon_id_8 unlocked_dungeon; undefined1 unk_0x103; struct monster_id_16 cafe_recruit_species; From b7943accd26d450de0cec0a9a19cb83a6a0d1ef6 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Mon, 1 Jun 2026 03:01:45 -0400 Subject: [PATCH 020/117] Overlay 26 Findings --- headers/data/arm9.h | 3 +- headers/data/overlay26.h | 20 ++ headers/functions/arm9.h | 7 + headers/functions/overlay26.h | 22 +++ symbols/arm9.yml | 66 +++++++ symbols/overlay26.yml | 334 +++++++++++++++++++++++++++++++--- 6 files changed, 428 insertions(+), 24 deletions(-) create mode 100644 headers/functions/overlay26.h diff --git a/headers/data/arm9.h b/headers/data/arm9.h index 081eb03e..f8adf305 100644 --- a/headers/data/arm9.h +++ b/headers/data/arm9.h @@ -233,7 +233,7 @@ extern void* ITEM_DATA_TABLE_PTRS[3]; extern char* ITEM_LANG_FILE_ARRAY[5]; #endif -extern void* SYNTH_BIN_FILE_PTR; +extern struct synth_file* SYNTH_BIN_FILE_PTR; extern struct move_data_table* MOVE_DATA_TABLE_PTR; extern struct obj_graphics_controls* OBJ_GRAPHICS_CONTROLS_PTR; extern struct wan_table* WAN_TABLE; @@ -242,6 +242,7 @@ extern render_3d_element_64_fn_t RENDER_3D_FUNCTIONS_64[8]; extern int16_t TBL_TALK_GROUP_STRING_ID_START[6]; extern struct menu_control* MENU_CONTROL_PTR; extern int16_t KEYBOARD_STRING_IDS[30]; +extern struct mission_reward_struct_main * MISSION_REWARD_STRUCT_MAIN_PTR; extern bool NOTIFY_NOTE; extern struct monster_id_16 DEFAULT_HERO_ID; extern struct monster_id_16 DEFAULT_PARTNER_ID; diff --git a/headers/data/overlay26.h b/headers/data/overlay26.h index ad49a533..1b608fe4 100644 --- a/headers/data/overlay26.h +++ b/headers/data/overlay26.h @@ -1,6 +1,26 @@ #ifndef HEADERS_DATA_OVERLAY26_H_ #define HEADERS_DATA_OVERLAY26_H_ +extern mission_reward_dialogue_sequence MISSION_TYPE_12_DIALOGUE_SEQS[1]; +extern mission_reward_dialogue_sequence MISSION_DEFAULT_DIALOGUE_SEQS[2]; +extern mission_reward_dialogue_sequence MISSION_TYPE_10_DIALOGUE_SEQS[2]; +extern mission_reward_dialogue_sequence MISSION_TYPE_9_DIALOGUE_SEQS[2]; +extern mission_reward_dialogue_sequence MISSION_TYPE_8_DIALOGUE_SEQS[2]; +extern mission_reward_dialogue_sequence MISSION_TYPE_6_DIALOGUE_SEQS[2]; +extern mission_reward_dialogue_sequence MISSION_TYPE_7_DIALOGUE_SEQS[2]; +extern mission_reward_dialogue_sequence MISSION_TYPE_3_DIALOGUE_SEQS[2]; +extern mission_reward_dialogue_sequence MISSION_TYPE_2_DIALOGUE_SEQS[2]; +extern mission_reward_dialogue_sequence MISSION_TYPE_1_DIALOGUE_SEQS[2]; +extern mission_reward_dialogue_sequence MISSION_TYPE_0_DIALOGUE_SEQS[2]; +extern mission_reward_dialogue_sequence MISSION_TYPE_11_DIALOGUE_SEQS[2]; +extern char DEBUG_CONQUEST_COUNT_STR[54]; +extern char DEBUG_DEAD_COUNT_STR[50]; +extern char DEBUG_NO_COUNT_STR[48]; extern undefined4 OV26_STATIC_INITIALIZER; +extern mission_reward_struct_overlay * MISSION_REWARD_OVERLAY_STRUCT_PTR; +extern undefined* APPLY_RULE_DUNGEON_EFFECTS_STRUCT_PTR; +extern undefined* OV26_UNK_ENTRY_POINT_STRUCT_PTR; +extern undefined* EXIT_DUNGEON_1_STRUCT_PTR; +extern undefined* EXIT_DUNGEON_2_STRUCT_PTR; #endif diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 75d2d776..97cca596 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -802,10 +802,13 @@ int ShowKeyboard(int menu_type, char* buffer1, int param_3, char* buffer2); int GetKeyboardStatus(void); int GetKeyboardStringResult(void); char* TeamSelectionMenuGetItem(char* buffer, int member_idx); +void FreeMissionRewardStructMain(void); +void MissionRewardCloseAllBoxes(void); void PrintMoveOptionMenu(void); void PrintIqSkillsMenu(enum monster_id monster_id, uint32_t* iq_skills_flags, int monster_iq, bool is_blinded); char* GetCheckIqMenuSkillString(char* buf, int iq_entry_idx); +void PlayMissionClearBgm(void); bool GetNotifyNote(void); void SetNotifyNote(bool flag); void InitSpecialEpisodeHero(void); @@ -946,6 +949,7 @@ void MissionToWonderMailPassword(char* password, struct mission* mission_data); void SetEnterDungeon(enum dungeon_id dungeon_id); void InitDungeonInit(struct dungeon_init* dungeon_init_data, enum dungeon_id dungeon_id); bool IsNoLossPenaltyDungeon(enum dungeon_id dungeon_id); +bool MissionRewardValidateDungeonId(dungeon_id_8 *param_1); undefined CheckMissionRestrictions(undefined param_1); bool TilesetSecondaryTerrainIsChasm(int16_t tileset_id); int GetNbFloors(enum dungeon_id dungeon_id); @@ -1250,8 +1254,11 @@ bool IsMonsterMissionAllowedStory(enum monster_id monster_id); bool IsMonsterIllegalForMissions(enum monster_id monster_id); bool CanDungeonBeUsedForMission(enum dungeon_id dungeon_id); bool CanSendItem(enum item_id item_id, bool to_sky); +void InitMissionReward(struct mission *param_1,struct mission_reward_data *param_2,undefined4 param_3,undefined4 param_4); +void RollRandomItemReward(undefined4 param_1,undefined4 param_2, item_id_16 *param_3); bool IsAvailableItem(enum item_id item_id); int GetAvailableItemDeliveryList(undefined* item_buffer); +void ZeroInitMissionRewardDataStruct(struct mission_reward_data *param_1); enum monster_id GetScriptEntityMonsterId(enum script_entity_id entity_id); int GetScriptEntityMatchingStorageId(enum script_entity_id entity_id); void SetActorTalkMainAndActorTalkSub(enum script_entity_id actor_id_main, diff --git a/headers/functions/overlay26.h b/headers/functions/overlay26.h new file mode 100644 index 00000000..ba7452e6 --- /dev/null +++ b/headers/functions/overlay26.h @@ -0,0 +1,22 @@ +#ifndef HEADERS_FUNCTIONS_OVERLAY26_H_ +#define HEADERS_FUNCTIONS_OVERLAY26_H_ + + +undefined4 MissionRewardOverlayEntryPoint(void); +void MissionRewardOverlayDestructor(void); +undefined4 MissionRewardOverlayFrameUpdate(void); +void MissionRewardClosePortraitAndDialogueBox(void); +undefined4 EnterDungeonEntryPoint(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4); +void EnterDungeonDestructor(void); +undefined4 EnterDungeonFrameUpdate(void); +undefined4 ExitDungeon1EntryPoint(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4); +void ExitDungeon1Destructor(void); +undefined4 ExitDungeon1FrameUpdate(void); +undefined4 UnkOv26EntryPoint_0238b754_EU(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4); +void UnkOv26Destructor_0238b780_EU(void); +undefined4 UnkOv26FrameUpdate_0238b7ac_EU(void); +undefined4 DungeonExitEntryPoint2(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4); +void DungeonExitDestructor2(void); +undefined4 DungeonExitFrameUpdate2(void); + +#endif diff --git a/symbols/arm9.yml b/symbols/arm9.yml index e85bbcdd..583cdae9 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -7456,6 +7456,20 @@ arm9: r0: buffer r1: team member index return: menu item text (points into buffer) + - name: FreeMissionRewardStructMain + address: + EU: 0x203F2D0 + description: |- + Frees MISSION_REWARD_STRUCT_MAIN_PTR if it is currently active. + + No params. + - name: MissionRewardCloseAllBoxes + address: + EU: 0x203F358 + description: |- + Closes all textboxes from MISSION_REWARD_STRUCT_MAIN_PTR for the overlay 11 portion of the mission reward sequence. + + No params. - name: PrintMoveOptionMenu address: EU: 0x20405BC @@ -7490,6 +7504,13 @@ arm9: r0: [output] buffer r1: id in team member's IQ skill list return: input buffer + - name: PlayMissionClearBgm + address: + EU: 0x2046A5C + description: |- + Plays the mission clear bgm after completing a dungeon. Called by overlay 26. + + No params. - name: GetNotifyNote address: EU: 0x20487BC @@ -8890,6 +8911,15 @@ arm9: If true you won't lose your money and items upon fainting. Also used to initialize dungeon_init::skip_faint_animation_flag. Returns: True for DUNGEON_CRYSTAL_LAKE and DUNGEON_5TH_STATION_CLEARING, as well as for DUNGEON_DEEP_STAR_CAVE_TEAM_ROGUE if the ground variable SIDE01_BOSS2ND is 0; false otherwise. + - name: MissionRewardValidateDungeonId + address: + EU: 0x204F490 + description: |- + Checks script variables $DUNGEON_ENTER and $DUNGEON_ENTER_INDEX for "mission dungeon" and a valid non-dojo dungeon respectively. + If so, stores the dungeon id from $DUNGEON_ENTER_INDEX to a pointer. + + r0: dungeon_id_8* (return) + return: 1 if the dungeon pulled from script variables is valid for mission rewards, 0 otherwise. - name: CheckMissionRestrictions address: EU: 0x204F6FC @@ -11913,6 +11943,27 @@ arm9: r0: item ID r1: to_sky return: bool + - name: InitMissionReward + address: + EU: 0x20631D8 + description: |- + Seems to initialize a mission_reward_data struct from a mission. + Called by MissionRewardEntryPoint in overlay 26. + + + r0: struct mission* + r1: struct mission_reward_data* + r2: undefined4 + r3: undefined4 + - name: RollRandomItemReward + address: + EU: 0x2063420 + description: |- + Seems to select a random item for an item mission reward, calling RetrieveFromItemList2 until it succeeds. + + r0: undefined4 + r1: undefined4 + r2: mission reward item pointer - name: IsAvailableItem address: EU: 0x20637D8 @@ -11935,6 +11986,13 @@ arm9: r0: item_buffer return: Number of deliverable items for a mission + - name: ZeroInitMissionRewardDataStruct + address: + EU: 0x2063898 + description: |- + Zero initializes a mission_reward_data struct. + + r0: struct mission_reward_data* - name: GetScriptEntityMonsterId address: EU: 0x2065CF0 @@ -14881,6 +14939,14 @@ arm9: Note: unverified, ported from Irdkwia's notes type: int16_t[30] + - name: MISSION_REWARD_STRUCT_MAIN_PTR + address: + EU: 0x20B0790 + description: |- + Points to a mission_reward_struct_main struct, responsible for handling the overlay 11 portion of the mission reward sequence. + Is also used sparingly during the Spinda Cafe egg event. + + type: mission_reward_struct_main - name: NOTIFY_NOTE address: EU: 0x20B0814 diff --git a/symbols/overlay26.yml b/symbols/overlay26.yml index 31028ac2..b238f12f 100644 --- a/symbols/overlay26.yml +++ b/symbols/overlay26.yml @@ -11,20 +11,304 @@ overlay26: EU: 0xE40 NA: 0xE40 JP: 0xE40 - description: "Related to mission completion. It's loaded when the dungeon completion summary is shown upon exiting a dungeon, and during the cutscenes where you collect mission rewards from clients." - functions: [] + description: "Related to mission completion. It's loaded when the dungeon completion summary is shown upon exiting a dungeon and during the cutscenes where you collect mission rewards from clients. May also be related to preparing for dungeon entry." + functions: + - name: MissionRewardOverlayEntryPoint + address: + EU: 0x238AC80 + description: |- + The entry point for part of the mission reward sequence. + A significant portion of this process lives in overlay 11 instead. + + return: undefined4 + - name: MissionRewardOverlayDestructor + address: + EU: 0x238B0A8 + description: |- + The destructor for initializing the mission reward sequence. + + No params. + - name: MissionRewardOverlayFrameUpdate + address: + EU: 0x238B0E0 + description: |- + The entry point for part of the mission reward sequence. + The actual mission reward process itself is primarily done in overlay 11. + + return: undefined4 + - name: MissionRewardClosePortraitAndDialogueBox + address: + EU: 0x238B44C + description: |- + Responsible for closing the current portrait and dialogue box for the above functions. + + No params. + - name: ApplyRuleDungeonEffectsEntryPoint + address: + EU: 0x238B4B0 + description: |- + Just a guess. See ApplyRuleDungeonEffectsFrameUpdate for further explanation. + Is an entry_point for an overlay_load_entry. + + r0: undefined4 + r1: undefined4 + r2: undefined4 + r3: undefined4 + return: undefined4 + - name: ApplyRuleDungeonEffectsDestructor + address: + EU: 0x238B4DC + description: |- + Just a guess. See ApplyRuleDungeonEffectsFrameUpdate for further explanation. + Is a destructor for an overlay_load_entry. + + No params. + - name: ApplyRuleDungeonEffectsFrameUpdate + address: + EU: 0x238B508 + description: |- + Just a guess. After enough frames pass, conditionally calls GetMaxItemsAllowed, RemoveAllItemsStartingAt, IsMoneyAllowed, and SetMoneyCarried, + as well as a handful of unknown functions that likely check if the entered dungeon is a rule dungeon. + Is a frame_update for an overlay_load_entry. + + return: undefined4 + - name: ExitDungeon1EntryPoint + address: + EU: 0x238B5A8 + description: |- + Seems to get called on exiting a dungeon. Might be exclusive to whether the dungeon is in mission mode? + Is an entry_point for an overlay_load_entry. + + r0: undefined4 + r1: undefined4 + r2: undefined4 + r3: undefined4 + return: undefined4 + - name: ExitDungeon1Destructor + address: + EU: 0x238B5D4 + description: |- + Seems to get called on exiting a dungeon. Might be exclusive to whether the dungeon is in mission mode? + Is a destructor for an overlay_load_entry. + + No params. + - name: ExitDungeon1FrameUpdate + address: + EU: 0x238B600 + description: |- + Seems to get called on exiting a dungeon. Might be exclusive to whether the dungeon is in mission mode? + Is a frame_update for an overlay_load_entry. + + return: undefined4 + - name: UnkOv26EntryPoint_0238b754_EU + address: + EU: 0x238B818 + description: |- + Is an unidentified entry_point for an overlay_load_entry. + + r0: undefined4 + r1: undefined4 + r2: undefined4 + r3: undefined4 + return: undefined4 + - name: UnkOv26Destructor_0238b780_EU + address: + EU: 0x238B850 + description: |- + Is an unidentified destructor for an overlay_load_entry. + + No params. + - name: UnkOv26FrameUpdate_0238b7ac_EU + address: + EU: 0x238B87C + description: |- + Is an unidentified frame_update for an overlay_load_entry. + + return: undefined4 + - name: DungeonExitEntryPoint2 + address: + EU: 0x238B818 + description: |- + Seems to get called on exiting a dungeon. Might be exclusive to whether the dungeon is not in mission mode? + Is an entry_point for an overlay_load_entry. + + r0: undefined4 + r1: undefined4 + r2: undefined4 + r3: undefined4 + return: undefined4 + - name: DungeonExitDestructor2 + address: + EU: 0x238B850 + description: |- + Seems to get called on exiting a dungeon. Might be exclusive to whether the dungeon is not in mission mode? + Is a destructor for an overlay_load_entry. + + No params. + - name: DungeonExitFrameUpdate2 + address: + EU: 0x238B87C + description: |- + Seems to get called on exiting a dungeon. Might be exclusive to whether the dungeon is not in mission mode? + Is a frame_update for an overlay_load_entry. + + return: undefined4 data: - - name: OVERLAY26_UNKNOWN_TABLE__NA_238AE20 + - name: MISSION_TYPE_12_DIALOGUE_SEQS address: EU: 0x238B960 NA: 0x238AE20 JP: 0x238C380 length: - NA: 0x8C + EU: 0x6 + NA: 0x6 description: |- - 0x6 + 11*0xC + 0x2 + A singular mission_reward_dialogue_sequence struct for treasure hoard missions. + Is fed sequentially to MissionRewardFrameUpdate to either produce a textbox, or conclude the dialogue. - Note: unverified, ported from Irdkwia's notes + type: mission_reward_dialogue_sequence + - name: MISSION_DEFAULT_DIALOGUE_SEQS + address: + EU: 0x238B966 + length: + EU: 0xC + NA: 0xC + description: |- + A pair of mission_reward_dialogue_sequence structs used for missions of type 4, 5, and technically 14. + Is fed sequentially to MissionRewardFrameUpdate to either produce a textbox, or conclude the dialogue. + + type: mission_reward_dialogue_sequence + - name: MISSION_TYPE_10_DIALOGUE_SEQS + address: + EU: 0x238B972 + length: + EU: 0xC + NA: 0xC + description: |- + A pair of mission_reward_dialogue_sequence structs used for missions of type 10. + Is fed sequentially to MissionRewardFrameUpdate to either produce a textbox, or conclude the dialogue. + + type: mission_reward_dialogue_sequence + - name: MISSION_TYPE_9_DIALOGUE_SEQS + address: + EU: 0x238B97E + length: + EU: 0xC + NA: 0xC + description: |- + A pair of mission_reward_dialogue_sequence structs used for missions of type 9. + Is fed sequentially to MissionRewardFrameUpdate to either produce a textbox, or conclude the dialogue. + + type: mission_reward_dialogue_sequence + - name: MISSION_TYPE_8_DIALOGUE_SEQS + address: + EU: 0x238B98A + length: + EU: 0xC + NA: 0xC + description: |- + A pair of mission_reward_dialogue_sequence structs used for missions of type 8. + Is fed sequentially to MissionRewardFrameUpdate to either produce a textbox, or conclude the dialogue. + + type: mission_reward_dialogue_sequence + - name: MISSION_TYPE_6_DIALOGUE_SEQS + address: + EU: 0x238B996 + length: + EU: 0xC + NA: 0xC + description: |- + A pair of mission_reward_dialogue_sequence structs used for missions of type 6. + Is fed sequentially to MissionRewardFrameUpdate to either produce a textbox, or conclude the dialogue. + + type: mission_reward_dialogue_sequence + - name: MISSION_TYPE_7_DIALOGUE_SEQS + address: + EU: 0x238B9A2 + length: + EU: 0xC + NA: 0xC + description: |- + A pair of mission_reward_dialogue_sequence structs used for missions of type 7. + Is fed sequentially to MissionRewardFrameUpdate to either produce a textbox, or conclude the dialogue. + + type: mission_reward_dialogue_sequence + - name: MISSION_TYPE_3_DIALOGUE_SEQS + address: + EU: 0x238B9AE + length: + EU: 0xC + NA: 0xC + description: |- + A pair of mission_reward_dialogue_sequence structs used for missions of type 3. + Is fed sequentially to MissionRewardFrameUpdate to either produce a textbox, or conclude the dialogue. + + type: mission_reward_dialogue_sequence + - name: MISSION_TYPE_2_DIALOGUE_SEQS + address: + EU: 0x238B9BA + length: + EU: 0xC + NA: 0xC + description: |- + A pair of mission_reward_dialogue_sequence structs used for missions of type 2. + Is fed sequentially to MissionRewardFrameUpdate to either produce a textbox, or conclude the dialogue. + + type: mission_reward_dialogue_sequence + - name: MISSION_TYPE_1_DIALOGUE_SEQS + address: + EU: 0x238B9C6 + length: + EU: 0xC + NA: 0xC + description: |- + A pair of mission_reward_dialogue_sequence structs used for missions of type 1. + Is fed sequentially to MissionRewardFrameUpdate to either produce a textbox, or conclude the dialogue. + + type: mission_reward_dialogue_sequence + - name: MISSION_TYPE_0_DIALOGUE_SEQS + address: + EU: 0x238B9D2 + length: + EU: 0xC + NA: 0xC + description: |- + A pair of mission_reward_dialogue_sequence structs used for missions of type 0. + Is fed sequentially to MissionRewardFrameUpdate to either produce a textbox, or conclude the dialogue. + + type: mission_reward_dialogue_sequence + - name: MISSION_TYPE_11_DIALOGUE_SEQS + address: + EU: 0x238B9DE + length: + EU: 0xC + NA: 0xC + description: |- + A pair of mission_reward_dialogue_sequence structs used for missions of type 11. + Is fed sequentially to MissionRewardFrameUpdate to either produce a textbox, or conclude the dialogue. + + type: mission_reward_dialogue_sequence + - name: DEBUG_CONQUEST_COUNT_STR + address: + EU: 0x238B9EC + description: |- + "UNIT RETURN %3d conquest count =======================" + + type: string + - name: DEBUG_DEAD_COUNT_STR + address: + EU: 0x238BA24 + description: |- + "UNIT RETURN %3d dead count =======================" + + type: string + - name: DEBUG_NO_COUNT_STR + address: + EU: 0x238BA58 + description: |- + "UNIT RETURN %3d no count =======================" + + type: string - name: OV26_STATIC_INITIALIZER aliases: - OVERLAY26_RESERVED_SPACE @@ -37,30 +321,33 @@ overlay26: NA: 0x4 JP: 0x4 description: Static initializer for overlay 26. - - name: OVERLAY26_UNKNOWN_POINTER__NA_238AF60 + - name: MISSION_REWARD_OVERLAY_STRUCT_PTR address: EU: 0x238BAA0 NA: 0x238AF60 JP: 0x238C4C0 - length: - NA: 0x4 - description: "Note: unverified, ported from Irdkwia's notes" - - name: OVERLAY26_UNKNOWN_POINTER__NA_238AF64 + description: |- + A pointer to a mission_reward_struct_overlay struct, responsible for the operations of part of the mission reward sequence. + + type: mission_reward_struct_overlay* + - name: APPLY_RULE_DUNGEON_EFFECTS_STRUCT_PTR address: EU: 0x238BAA4 NA: 0x238AF64 JP: 0x238C4C4 - length: - NA: 0x4 - description: "Note: unverified, ported from Irdkwia's notes" - - name: OVERLAY26_UNKNOWN_POINTER__NA_238AF68 + description: |- + A pointer to a struct of unknown size, responsible for the operations of the ApplyRuleDungeonEffects* overlay_load_entry. + + type: undefined* + - name: EXIT_DUNGEON_1_STRUCT_PTR address: EU: 0x238BAA8 NA: 0x238AF68 JP: 0x238C4C8 - length: - NA: 0x4 - description: "Note: unverified, ported from Irdkwia's notes" + description: |- + A pointer to a struct of unknown size, responsible for the operations of the DungeonExit1* overlay_load_entry. + + type: undefined* - name: OVERLAY26_UNKNOWN_POINTER__NA_238AF6C address: EU: 0x238BAAC @@ -68,12 +355,13 @@ overlay26: JP: 0x238C4CC length: NA: 0x4 - description: "Note: unverified, ported from Irdkwia's notes" - - name: OVERLAY26_UNKNOWN_POINTER5__NA_238AF70 + description: "Note: unverified, ported from Irdkwia's notes. Used exclusively by the UnkOv26EntryPoint_* structs." + - name: EXIT_DUNGEON_2_STRUCT_PTR address: EU: 0x238BAB0 NA: 0x238AF70 JP: 0x238C4D0 - length: - NA: 0x4 - description: "Note: unverified, ported from Irdkwia's notes" + description: |- + A pointer to a struct of unknown size, responsible for the operations of the DungeonExit2* overlay_load_entry. + + type: undefined* From 7294ff000f63de0d4d03605d030132cb0de545dc Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Tue, 2 Jun 2026 03:16:17 -0400 Subject: [PATCH 021/117] Update overlay19.yml --- symbols/overlay19.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/symbols/overlay19.yml b/symbols/overlay19.yml index 1601f08a..c8cb8264 100644 --- a/symbols/overlay19.yml +++ b/symbols/overlay19.yml @@ -583,6 +583,8 @@ overlay19: - name: BAR_ME_PLAY_TEXT_TAG address: EU: 0x238EDF8 + length: + EU: 0xC description: |- "[me_play:0]" @@ -590,6 +592,8 @@ overlay19: - name: DEBUG_MESSAGE_REQUEST_STR address: EU: 0x238EE04 + length: + EU: 0x17 description: |- "dirinkbar request %3d\n" Request likely refers to requesting the script to do something. @@ -598,6 +602,8 @@ overlay19: - name: DEBUG_MESSAGE_REQUEST_AND_RETURN_STR address: EU: 0x238EE1C + length: + EU: 0x1C description: |- "dirinkbar request %3d[%3d]\n" Request again likely refers to requesting the script to do something. @@ -606,6 +612,8 @@ overlay19: - name: DEBUG_MESSAGE_BEFORE_SET_STR address: EU: 0x238EE38 + length: + EU: 0x1E description: |- "dirinkbar message before set\n" Message before likely refers to a textbox appearing immediately before passing control to the script engine. @@ -614,6 +622,8 @@ overlay19: - name: DEBUG_MESSAGE_AFTER_SET_STR address: EU: 0x238EE58 + length: + EU: 0x1D description: |- "dirinkbar message after set\n" Message before likely refers to a textbox appearing immediately after passing control to the script engine. From 9bdd3df67c70b9a7e908aaf7b93026f828085b27 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Wed, 3 Jun 2026 00:01:24 -0400 Subject: [PATCH 022/117] Recycle Shop Stuff and fixes --- headers/data/arm9.h | 3 + headers/data/overlay19.h | 2 +- headers/functions/arm9.h | 60 +++ headers/functions/overlay11.h | 11 + headers/functions/overlay20.h | 26 ++ headers/types/ground_mode/ground_mode.h | 6 - symbols/arm9.yml | 549 +++++++++++++++++++++++- symbols/overlay11.yml | 87 +++- symbols/overlay19.yml | 4 +- symbols/overlay20.yml | 186 +++++++- symbols/overlay26.yml | 12 +- 11 files changed, 906 insertions(+), 40 deletions(-) create mode 100644 headers/functions/overlay20.h diff --git a/headers/data/arm9.h b/headers/data/arm9.h index f8adf305..9e415504 100644 --- a/headers/data/arm9.h +++ b/headers/data/arm9.h @@ -138,10 +138,13 @@ extern fx32_8 DAMAGE_FORMULA_LN_PREFACTOR; extern fx32_8 DAMAGE_FORMULA_DEF_PREFACTOR; extern fx32_8 DAMAGE_FORMULA_AT_PREFACTOR; extern fx32_8 DAMAGE_FORMULA_LN_ARG_PREFACTOR; +extern uint8_t OUTLAW_HIDEOUT_FIXED_ROOM_IDS[5]; +extern uint8_t CHALLENGE_NORMAL_FIXED_ROOM_IDS[5]; extern bool TACTICS_FOLLOW_LEADER[12]; extern struct forbidden_forgot_move_entry FORBIDDEN_FORGOT_MOVE_LIST[3]; extern struct type_id_8 CONVERSION2_TYPE_TABLE[18]; extern int16_t TACTICS_UNLOCK_LEVEL_TABLE[12]; +extern uint8_t TREASURE_MEMO_FIXED_ROOM_IDS[30]; extern int16_t CLIENT_LEVEL_TABLE[16]; extern int16_t OUTLAW_LEVEL_TABLE[16]; extern int16_t OUTLAW_MINION_LEVEL_TABLE[16]; diff --git a/headers/data/overlay19.h b/headers/data/overlay19.h index 549220d1..15365566 100644 --- a/headers/data/overlay19.h +++ b/headers/data/overlay19.h @@ -2,7 +2,7 @@ #define HEADERS_DATA_OVERLAY19_H_ extern int16_t BAR_MIRACLE_EVENT_WEIGHTS[4]; -extern struct dungeon_id_16 BAR_UNLOCKABLE_DUNGEONS_TABLE[6]; +extern struct dungeon_unlock_entry BAR_UNLOCKABLE_DUNGEONS_TABLE[6]; extern struct monster_id_16 BAR_RECRUITABLE_GOURMET_MONSTER_TABLE[108]; extern struct bar_item BAR_AVAILABLE_ITEMS[66]; extern int16_t BAR_STAT_REACTION_STRINGS[3]; diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 97cca596..40d8b8ae 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -277,6 +277,13 @@ int GetMoneyStored(void); void SetMoneyStored(int amount); void AddMoneyStored(int amount); enum monster_id GetEggSpecies(void); +void SetEggSpecies(struct monster_id_16 param_1); +undefined2 GetUnkGameState0x13a6(void); +void SetUnkGameState0x13a6(undefined2 param_1); +uint16_t GetEggHatchTimer(void); +void SetEggHatchTimer(uint16_t param_1); +void DecrementEggHatchTimer(void); +int RemoveInvalidKecleonShop1Items(void); void RemoveItemFromKecleonShop1(int slot); void SortKecleonItems1(void); void GenerateKecleonItems1(enum kecleon_shop_version kecleon_shop_version); @@ -329,6 +336,27 @@ void ApplyGummiBoostsGroundMode(struct monster_id_16* monster_id, uint16_t* mons uint8_t* monster_offensive_stats, uint8_t* monster_defensive_stats, enum item_id item_id, bool not_boost_stats, struct gummi_result* gummi_result); +void WipeRecycleShopRecords(void); +void FreeRecycleOfferItems(struct recycle_offer_items *param_1); +enum item_id GetRecycleItemId(struct recycle_item **param_1); +bool RecycleItemHasTradeTypePrizeTicket(struct recycle_item **param_1); +int CountTradedRecycleItems(struct recycle_item_data *param_1); +bool RecycleShopTradeIsNonspecific(struct recycle_item **param_1); +bool RecycleShopOfferExists(void); +void ClearRecycleShopOffer(void); +uint32_t GetGameStateRecycleCount(void); +byte GetRankForRecycleShop(void); +void IncrementRecycleCountVar(void); +void UpdateRecycleShop(void); +void DecrementRecycleOfferCooldown(void); +bool IsRecycleOfferCooldownOver(void); +int GetRecycleOfferCooldown(void); +bool RecycleShopIsNotThrownItem(enum item_id param_1); +bool RecycleShopIsTradableItem(enum item_id param_1,bool param_2); +int RecycleShopCountTradableItemsInBag(bool param_1); +int RecycleShopCountTradableItemsInStorage(bool param_1); +int CountValidRecycleShopItems(int filter,uint recycles,enum rank rank); +bool IsRecycleTradeTypeValid(int param_1,int param_2); void ClearCroagunkItems(void); bool LoadSynthBin(void); void CloseSynthBin(void); @@ -586,6 +614,7 @@ void LoadTblTalk(void); int GetTalkLine(int personality_idx, enum talk_type talk_type, int restrictions); bool IsAOrBPressed(void); void DrawTextInWindow(int window_id, int x, int y, char* string); +void AppendStandardStringToMission(undefined4 param_1, undefined4 param_2, undefined4 param_3, int string_id); uint8_t GetCharWidth(char symbol); int GetColorCodePaletteOffset(char symbol); uint8_t DrawChar(int window_id, int x, int y, char symbol, int color_offset); @@ -1148,6 +1177,7 @@ void GetNbRecruited(undefined* recruit); bool IsValidTeamMember(int member_idx); bool IsMainCharacter(int member_idx); struct ground_monster* GetTeamMember(int member_idx); +int GetRecruitMentryIdBySpecies(enum monster_id param_1,int param_2); int GetHeroMemberIdx(void); int GetPartnerMemberIdx(void); int GetMainCharacter1MemberIdx(void); @@ -1170,10 +1200,13 @@ void SetActiveTeam(enum team_id team_id); struct team_member* GetActiveTeamMember(int roster_idx); int GetActiveRosterIndex(int member_idx); int TryAddMonsterToActiveTeam(int member_idx); +int GetAppointedLeaderMemberIdx(void); void RemoveActiveMembersFromMainTeam(void); void SetTeamSetupHeroAndPartnerOnly(void); void SetTeamSetupHeroOnly(void); int GetPartyMembers(uint16_t* party_members); +int GetAdventureNpcIds(struct monster_id_16* param_1); +int GetUnitNpcIds(struct monster_id_16* param_1); void RefillTeam(void); void ValidateTeamMembers(bool *param_1); int ClearItem(int team_id, bool check); @@ -1215,9 +1248,16 @@ int GetSosMailCount(int param_1, bool param_2); bool IsMissionSuspendedAndValid(struct mission* mission); bool AreMissionsEquivalent(struct mission* mission1, struct mission* mission2); bool IsMissionValid(struct mission* mission); +bool CheckMonsterForMissionType(enum mission_type type,int * subtype, enum monster_id target, bool param_4); +bool CheckItemForMissionType(enum mission_type type,int * subtype, enum item_id param_3); enum mission_generation_result GenerateMission(undefined* param_1, struct mission* mission_data); +int CountAndPopulateValidMissionTableMonsters(undefined4 *param_1,undefined4 *param_2); bool IsMissionTypeSpecialEpisode(struct mission* mission); +bool DoesMissionHaveTypeAndSubtype(struct mission, struct mission_type_8* type, int * subtype) +bool AlreadyHasSimilarMission(struct mission_type_8* type, int8_t * subtype_8); void GenerateDailyMissions(void); +int IsItTrueNormal(int param_1); +int IsItTrueBottle(int param_1); bool AlreadyHaveMission(struct mission* mission); int CountJobListMissions(void); int DungeonRequestsDone(uint8_t param_1, bool param_2); @@ -1225,6 +1265,7 @@ int DungeonRequestsDoneWrapper(uint8_t param_1); bool AnyDungeonRequestsDone(uint8_t param_1); bool AddMissionToJobList(struct mission* mission); struct mission* GetAcceptedMission(uint8_t mission_id); +bool WasMissionCompletedToday(struct mission_result_and_client *param_1,struct mission *param_2,enum mission_type param_3); int GetMissionByTypeAndDungeon(int start_index, enum mission_type mission_type, undefined* subtype_struct, enum dungeon_id dungeon_id); bool CheckAcceptedMissionByTypeAndDungeon(enum mission_type mission_type, undefined* subtype_struct, @@ -1237,25 +1278,43 @@ void DeleteAllPossibleDungeonsList(void); int GenerateAllPossibleDeliverList(void); void DeleteAllPossibleDeliverList(void); void ClearMissionData(struct mission* mission); +int GetMissionSpecificFixedRoom(enum mission_type type,int subtype); +int8_t SelectRandomFixedRoomInRange(int8_t * fixed_rooms,int max); +void ReadRescueBinFile(void); void GenerateMissionDetailsStruct(struct mission* mission, struct mission_details* details, undefined param_3, undefined param_4); bool ValidateNormalChallengeMission(struct mission_template* valid_mission_info, struct mission* mission); bool ValidateLegendaryChallengeMission(struct mission_template* valid_mission_info, struct mission* mission); +int MatchMissionTemplateToMission(struct mission *param_1,undefined4 param_2); void AppendMissionTitle(char* main_buffer, char* temp_buffer, struct preprocessor_args* args, struct mission_details* details); +void FormatMissionTitle(char *buffer,struct misson_details *param_2); +void FormatSpecialEpisodeMissionTitle(char *param_1); void AppendMissionSummary(char* main_buffer, char* temp_buffer, int window_id, int y_offset, struct preprocessor_args* args, struct mission_details* details); +void MakeMissionDetails(struct misson_details *param_1,char *buffer,undefined param_3); +void MakeSpecialEpisodeMissionDetails(struct mission_details, undefined param_2) +undefined PrintWonderMailSkyCode(undefined param_1,undefined param_2,undefined param_3,undefined param_4); +void AppendMissionObjective(char *param_1,int param_2,undefined4 param_3,uint32_t param_4,short param_5); +void MissionAppendDungeonLocation(struct misson_details *param_1,char *buffer,int param_3); +bool SumValidMissionCategoryWeights(undefined4 mission_vendor); +struct mission_template * GetRandomMissionTemplate(void); +undefined4 LoadMissionTemplates(void); bool IsMonsterMissionAllowed(enum monster_id monster_id); bool CanMonsterBeUsedForMissionWrapper(enum monster_id monster_id); bool CanMonsterBeUsedForMission(enum monster_id monster_id, bool check_story_banned); bool IsMonsterMissionAllowedStory(enum monster_id monster_id); bool IsMonsterIllegalForMissions(enum monster_id monster_id); bool CanDungeonBeUsedForMission(enum dungeon_id dungeon_id); +int8_t GetMissionRankWithCapAndModifiers(void); +int8_t GetMissionRankWithCapAndModifiersAndCap(void); bool CanSendItem(enum item_id item_id, bool to_sky); void InitMissionReward(struct mission *param_1,struct mission_reward_data *param_2,undefined4 param_3,undefined4 param_4); void RollRandomItemReward(undefined4 param_1,undefined4 param_2, item_id_16 *param_3); +void GenerateMissionRewards(struct mission *MissionPtr,int IsCafeMission); +undefined4 CheckDungeonMissionUnlock(enum dungeon_id param_1); bool IsAvailableItem(enum item_id item_id); int GetAvailableItemDeliveryList(undefined* item_buffer); void ZeroInitMissionRewardDataStruct(struct mission_reward_data *param_1); @@ -1271,6 +1330,7 @@ void SetAllEventNpcs(undefined2 param_1,undefined2 param_2,undefined2 param_3,un void RandomizeDemoActors(void); void ItemAtTableIdx(int idx, struct bulk_item* item); void MainLoop(void); +char * ChooseMissionTitle(char *main_buffer,int param_2,uint *param_3); void CreateJobSummary(struct mission* mission, int param_2); int DungeonSwapIdToIdx(enum dungeon_id dungeon_id); enum dungeon_id DungeonSwapIdxToId(int idx); diff --git a/headers/functions/overlay11.h b/headers/functions/overlay11.h index f207a833..f9150fb0 100644 --- a/headers/functions/overlay11.h +++ b/headers/functions/overlay11.h @@ -161,14 +161,25 @@ int CreateTeamInfoBox(void); void CloseTeamInfoBox(int window_id); bool IsTeamInfoBoxActive(int window_id); void UpdateTeamInfoBox(struct window* window); +undefined4 EatOverworldGummiEntryPoint(void); +void EatOverworldGummiDestructor(void); +undefined4 EatOverworldGummiFrameUpdate(void); int CreateTopGroundMenu(void); void CloseTopGroundMenu(void); int UpdateTopGroundMenu(void); +undefined4 GroundBagOthersMenuEntryPoint(void); +void GroundBagOthersMenuDestructor(void); +undefined4 GroundBagOthersMenuFrameUpdate(void); +undefined4 DiaryMenuDiaryMenuEntryPoint(undefined4 param_1); +void DiaryMenuDestructor(void); +undefined4 DiaryMenuFrameUpdate(void); +void InitDiaryandFaqBoardMenu(undefined4 param_1); bool IsBagNotEmpty(void); bool IsGroundMonsterAtMaxLevel(struct ground_monster* param_1); void GetExclusiveItemRequirements(undefined param_1, undefined param_2); void SwapShopInventoryManager(enum swap_shop_inventory_case inventory_case, int monster_id_or_exc_item_count); +void LoadRecycleShopOverlay(void); void HandleControlsTopScreenGround(void); bool GetDungeonMapPos(struct uvec2* out_pos, enum dungeon_id dungeon); void WorldMapSetMode(uint32_t world_map_mode); diff --git a/headers/functions/overlay20.h b/headers/functions/overlay20.h new file mode 100644 index 00000000..207c96c8 --- /dev/null +++ b/headers/functions/overlay20.h @@ -0,0 +1,26 @@ +#ifndef HEADERS_FUNCTIONS_OVERLAY20_H_ +#define HEADERS_FUNCTIONS_OVERLAY20_H_ + + + +undefined4 RecycleShopEntryPointFirst(void); +undefined4 RecycleShopEntryPointResume(void); +void RecycleShopDestructor(void); +undefined4 RecycleShopFrameUpdate(void); +undefined4 RecycleShopCommonEntryPoint(bool resuming_menu); +void PrintWynautTextbox(int strind_id); +void PrintWynautSimpleMenu(struct recycle_shop_main *param_1,undefined4 string_id,struct simple_menu_id_item *param_3); +void RecycleShopTryHidePortraitBox(struct recycle_shop_main *param_1,bool param_2); +void PrintWynautNormalPortrait(struct recycle_shop_main *param_1); +void RecycleShopClosePortraitBox(struct recycle_shop_main *param_1); +void RecycleShopCloseAllWindows(void); +undefined4 RecycleShopHandleTopScreenWindow(void); +void RecycleShopTopScreenDrawItemStats(int param_1); +void RecycleShopTopScreenDrawItemName(int window_id); +void RecycleShopTopScreenDrawInfoWindow(int param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4); +undefined4 MaybeCheckIfPlayerHasRequiredItems(undefined4 param_1); +bool MaybeHandleItemTradingLogic(uint param_1); +void MaybeDistinguishBetweenStorageAndBagItems(undefined4 param_1,undefined *param_2,int owned_item_list_index,int param_4); +void DisplaySelectionTutorialWindow(int window_id,undefined4 param_2,undefined4 param_3,undefined4 param_4); + +#endif \ No newline at end of file diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index c3bdcf05..659d9984 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -1027,12 +1027,6 @@ struct link_shop { }; ASSERT_SIZE(struct link_shop, 964); -struct bar_dungeon_unlock { - struct dungeon_id_8 dungeon_id; - uint8_t scenario_balance_min; -}; -ASSERT_SIZE(struct bar_dungeon_unlock, 2); - struct bar_stats_data { int16_t stat_modifiers[6]; int16_t new_stats[6]; diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 583cdae9..16290892 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -2889,9 +2889,60 @@ arm9: address: EU: 0x2010824 description: |- - Seems to retrieve the species of the egg the player currently has, or zero for no egg. + Seems to retrieve the species of the egg the player currently has in Chansey Daycare from GAME_STATE_VALUES. + If no egg is present, returns zero. return: monster_id + - name: SetEggSpecies + address: + EU: 0x201083C + description: |- + Seems to set the species of the egg in Chansey Daycare to GAME_STATE_VALUES. + + r0: struct monster_id_16 + - name: GetUnkGameState0x13a6 + address: + EU: 0x2010854 + description: |- + Seems to get unknown field 0x13a6 of GAME_STATE_VALUES. Only known to be called by overlay 24, Chansey Daycare. + + return: undefined2 + - name: SetUnkGameState0x13a6 + address: + EU: 0x201086C + description: |- + Seems to set unknown field 0x13a6 of GAME_STATE_VALUES. Only known to be called by overlay 24, Chansey Daycare. + + r0: undefined2 + - name: GetEggHatchTimer + address: + EU: 0x2010884 + description: |- + Seems to get the number of days until the current egg in Chansey Daycare hatches from GAME_STATE_VALUES. + Appears to be entirely unused, in favor of DecementEggHatchTimer. + + return: uint16_t + - name: SetEggHatchTimer + address: + EU: 0x201089C + description: |- + Seems to set the number of days until the current egg in Chansey Daycare hatches to GAME_STATE_VALUES. + + r0: uint16_t + - name: DecrementEggHatchTimer + address: + EU: 0x20108B4 + description: |- + Seems to decrement the number of days until the current egg in Chansey Daycare hatches. Called by GroundMainNextDay. + + No params. + - name: RemoveInvalidKecleonShop1Items + address: + EU: 0x20108D8 + description: |- + Iterates through the current first Kecleon Shop items, and removes any with item_id ITEM_NONE. + + return: number of items removed from the shop. - name: RemoveItemFromKecleonShop1 address: EU: 0x2010914 @@ -3236,6 +3287,175 @@ arm9: stack[0]: Item ID stack[1]: bool to NOT increase stats stack[2]: [output] pointer to a struct gummi_result + - name: WipeRecycleShopRecords + address: + EU: 0x2011B60 + description: |- + Sets the guild_rank, recycle_count, and recycle_offer_cooldown fields to zero, and sets the reycle_shop_offer to -1 of GAME_STATE_VALUES. + Also zeroes VAR_SUB30_SPOT_LEVEL, VAR_SUB30_SPOT_DISCOVER, VAR_RECYCLE_COUNT, and VAR_SUB30_TREASURE_DISCOVER script variables. + + No params. + - name: FreeRecycleOfferItems + address: + EU: 0x2011E60 + description: |- + Seems to free a recycle_offer_items struct from memory. + + r0: recycle_offer_items pointer + - name: GetRecycleItemId + address: + EU: 0x2011E98 + description: |- + Gets the item_id of a dereferenced recycle_item struct. + + r0: struct recycle_item double pointer + return: item_id + - name: RecycleItemHasTradeTypePrizeTicket + address: + EU: 0x2011EA4 + description: |- + Checks if the trade_type of a recycle_item is 1, indicating that the item uses the trade method for prize tickets. + + r0: struct recycle_item double pointer + return: 1 if trade_type is 1, 0 otherwise. + - name: CountTradedRecycleItems + address: + EU: 0x2011ECC + description: |- + Counts the number of valid traded_items in a recycle_item_data struct, effectively returning the number of specific items required to do the trade. + + r0: struct recycle_item_data + return: number of items required for trade + - name: RecycleShopTradeIsNonspecific + address: + EU: 0x2011F6C + description: |- + Checks if the first slot of a recycle_item struct's traded_items is 1400, indicative of a nonspecific prize ticket trade. + Unclear how this differs in functionally from RecycleItemHasTradeTypePrizeTicket, as they conditions they check fully overlap in vanilla. + + r0: recycle_item double pointer + return: 1 if the traded item is 1400, 0 if not. + - name: RecycleShopOfferExists + address: + EU: 0x2011F90 + description: |- + Checks if GAME_STATE_VALUES->recycle_shop_offer is anything but -1, which indicates no offer for the day. + + return: 1 if an offer exists, 0 if not. + - name: ClearRecycleShopOffer + address: + EU: 0x2011FBC + description: |- + Sets GAME_STATE_VALUES->recycle_shop_offer to -1, indicating no offer for the day. + + No params. + - name: GetGameStateRecycleCount + address: + EU: 0x2011FD8 + description: |- + Retrieves GAME_STATE_VALUES->recycle_count. May differ from the recycle count at ADVENTURE_LOG_PTR->nb_recycled. + + return: Recycle count + - name: GetRankForRecycleShop + address: + EU: 0x2011FF0 + description: |- + Retrieves GAME_STATE_VALUES->rank. Seems to exclusively be used for recycle shop prize ticket unlocks, but does correlate with guild rank. + + return: rank_8 + - name: IncrementRecycleCountVar + address: + EU: 0x2012008 + description: |- + Seems to increment the RECYCLE_COUNT script variable, capping it at 999,999 recycles. + + No params. + - name: UpdateRecycleShop + address: + EU: 0x2012048 + description: |- + Call by GroundMainNextDay to prepare the recycle shop for the next day of operations. + Updates offers, offer cooldowns, recycle counts, available trades, and the flags for new dungeons or treasure. + + No params. + - name: DecrementRecycleOfferCooldown + address: + EU: 0x20122CC + description: |- + Calls IsRecycleOfferCooldownOver, and if that returns false, decrements GAME_STATE_VALUES->recycle_offer_cooldown by one day. + + No params. + - name: IsRecycleOfferCooldownOver + address: + EU: 0x20122FC + description: |- + Checks if GAME_STATE_VALUES->recycle_offer_cooldown is zero. + + return: 1 if the cooldown is over, 0 if not. + - name: GetRecycleOfferCooldown + address: + EU: 0x2012324 + description: |- + Retrieves the GAME_STATE_VALUES->recycle_offer_cooldown, the number of days until a new recycle shop offer is allowed. + + return: number of days until next offer. + - name: RecycleShopIsNotThrownItem + address: + EU: 0x20126A4 + description: |- + Checks if the item_category of an item is anything but CATEGORY_THROWN_ARC or CATEGORY_THROWN_LINE. + This likely exists to prevent stackable items from being traded in the recycle shop, as in vanilla only thrown items are stackable. + + r0: item_id + return: 0 if the item is throwable, 1 if not. + - name: RecycleShopIsTradableItem + address: + EU: 0x20126D8 + description: |- + Checks if an item is capable of being traded in the recycle shop, calling RecycleShopIsNotThrownItem. + Also returns if the item is a prize ticket from IsTicketItem, if r1 is not 0. + + r0: item_id + r1: 0 if prize tickets are tradable, 1 if not. + return: 0 if the item is not tradable, 1 if so. + - name: RecycleShopCountTradableItemsInBag + address: + EU: 0x2012704 + description: |- + Count the number of tradable items in the current bag with RecycleShopIsTradableItem. + + r0: 0 if prize tickets are tradable, 1 if not. + return: number of tradable items + - name: RecycleShopCountTradableItemsInStorage + address: + EU: 0x2012770 + description: |- + Count the number of tradable items in storage with RecycleShopIsTradableItem. + + r0: 0 if prize tickets are tradable, 1 if not. + return: number of tradable items + - name: CountValidRecycleShopItems + address: + EU: 0x2012984 + description: |- + Loops through the RECYCLE_SHOP_ITEM_LIST, counting the number of valid recycle shop trades. + Filters each entry by guild rank, minimum recycle count, and a specified filter on trade type. + + + r0: trade filter. 3 to not exclude by trade type, else see IsRecycleTradeTypeValid. + r1: number of recycles + r2: guild rank + return: number of valid recycle shop items + - name: IsRecycleTradeTypeValid + address: + EU: 0x20129FC + description: |- + Uses the following logic to check if a recycle trade type fits a trade filter. + return not ((filter != type) && ((filter != 0 || (type == 2)))) + + r0: trade filter. 2 to whitelist offers, 1 to blacklist offers, 0 to blacklist offer and prize ticket trade types. + r1: trade_type + return: 1 if the item is valid, 0 if not. - name: ClearCroagunkItems address: EU: 0x2012B60 @@ -5567,6 +5787,17 @@ arm9: r1: x offset within window r2: y offset within window r3: text to draw + - name: AppendStandardStringToMission + address: + EU: 0x202654C + description: |- + Seems to append a string from a string_id to text. Known to be used for this purpose in MakeMissionDetails. + + + r0: undefined4 + r1: undefined4 + r2: undefined4 + r3: string_id - name: GetCharWidth address: EU: 0x2026830 @@ -7581,6 +7812,15 @@ arm9: Implements SPECIAL_PROC_0x4 (see ScriptSpecialProcessCall). No params. + - name: AssignSpecialEpisodePC + address: + EU: 0x2048DE0 + description: |- + Seems to be responsible for creating special episode ground_monster for special episodes. + + + r0: team_member_id + r1: special_episode_pc pointer - name: ReadStringSave address: EU: 0x2048ED0 @@ -9016,7 +9256,9 @@ arm9: r1: Struct containing the dungeon ID and floor number - name: GetMissionRank address: - EU: 0x204FB4C + EU: + - 0x204FB4C + - 0x204FAE0 NA: 0x204F814 JP: 0x204FB68 description: |- @@ -10925,6 +11167,16 @@ arm9: r0: team member index return: ground monster pointer + - name: GetRecruitMentryIdBySpecies + address: + EU: 0x205594C + description: |- + Seems to retrieve a regular recruit in the mentry's id with a specified monster_id, looping through the entire mentry starting from slot 5. + The second param can be used to skip a specified number of matches, though this appears to be zero in both known calls to this function. + + r0: monster_id + r1: number of target species to skip in the mentry + return: mentry index - name: GetHeroMemberIdx address: EU: 0x20559CC @@ -11151,6 +11403,13 @@ arm9: r0: member index return: Team index + - name: GetAppointedLeaderMemberIdx + address: + EU: 0x2056C20 + description: |- + Retrieves the team member index of the current leader. + + return: member index - name: RemoveActiveMembersFromMainTeam address: EU: 0x2056CDC @@ -11188,6 +11447,22 @@ arm9: r0: [output] Array of 4 2-byte values (they seem to be indexes of some sort) describing each party member, which will be filled in by the function. The input can be a null pointer if the party members aren't needed return: Number of party members + - name: GetAdventureNpcIds + address: + EU: 0x20570EC + description: |- + Retrieves the monster_ids of the active team, to set ACTOR_ADVENTURE_NPC01 through ACTOR_ADVENTURE_NPC04. + + r0: monster_id_16 pointers (minimum 4) + return: number of members on the team. + - name: GetUnitNpcIds + address: + EU: 0x2057180 + description: |- + Retrieves the monster_ids of the active team, to set ACTOR_UNIT_NPC01 through ACTOR_UNIT_NPC04. + + r0: monster_id_16 pointers (minimum 4) + return: number of members on the team. - name: RefillTeam address: EU: 0x20580D4 @@ -11586,6 +11861,31 @@ arm9: r0: mission to check return: True if the mission is valid, false if it's not. + - name: CheckMonsterForMissionType + address: + EU: 0x205D384 + description: |- + Seems to check if a monster is valid for a specific mission type and subtype. + Checks monster id range, some kind of legality check for purple kecleon, and if the monster is using its base form (IE: castform-sun would fail the base form check.) + Also checks body size for missions that use a monster, and are not MISSION_ARREST_OUTLAW, MISSION_CHALLENGE_REQUEST, or MISSION_TYPE_CONSUMABLE. + + r0: mission_type + r1: mission_subtype pointer + r2: monster_id + r3: 1 if the monster is allowed to be nothing, 0 if not. + return: 1 if the monster is allowed for the mission. 0 if not. + - name: CheckItemForMissionType + address: + EU: 0x205D498 + description: |- + Seems to check if an item is valid for a specific mission type and subtype. + Calls IsValidTargetItem, IsItemValidVeneer, and IsStorableItem. + Also checks IsThrownItem, with secondary checks permitting Rare Fossil/Gold Thorn for MISION_PROSPECT_WITH_CLIENT only. + + r0: mission_type + r1: mission_subtype pointer + r2: item_id + return: 1 if the item is allowed for the mission. 0 if not. - name: GenerateMission address: EU: 0x205D5A0 @@ -11597,16 +11897,45 @@ arm9: r0: Pointer to something r1: Pointer to the struct where the data of the generated mission will be written to return: MISSION_GENERATION_SUCCESS if the mission was successfully generated, MISSION_GENERATION_FAILURE if it failed and MISSION_GENERATION_GLOBAL_FAILURE if it failed and the game shouldn't try to generate more. + - name: CountAndPopulateValidMissionTableMonsters + address: + EU: 0x205E328 + description: |- + Reads a portion of the mission monster table from rescue.bin, counting and populating the valid monsters for the mission. + + r0: [secondary return] Pointer to the subset of valid monster_ids + r1: Involved in the bounds of the min and max table indices. + return: number of valid monsters - name: IsMissionTypeSpecialEpisode address: EU: 0x205E5B4 NA: 0x205E238 JP: 0x205E538 description: |- - Checks if a mission is for a Special Episode Transmission, which unlocks Special Episode 3. This specifically checks for a mission of type MISSION_SPECIAL_EPISODE and subtype 0x2. + Checks if a mission is for a Special Episode Transmission, which unlocks Special Episode 3. This specifically checks for a mission of type MISSION_CONSUMABLE and subtype 0x2. r0: mission pointer return: bool + - name: DoesMissionHaveTypeAndSubtype + address: + EU: 0x205E604 + description: |- + Checks if a specified mission has a specified mission_type and subtype. More general than AreMissionsEquivalent. + + r0: mission pointer + r1: mission_type pointer + r2: mission_subtype pointer + return: 1 if the player already has this mission, 0 if not. + - name: AlreadyHasSimilarMission + address: + EU: 0x205E634 + description: |- + Seems to check if the player already has a mission of the same type and subtype on the job list, or any mission vendor like the job board. + Likely used for "unique" missions like challenge letters, as this uses DoesMissionHaveTypeAndSubtype. + + r0: mission_type pointer + r1: mission_subtype pointer + return: 1 if the player already has this mission, 0 if not. - name: GenerateDailyMissions address: EU: 0x205E94C @@ -11688,6 +12017,18 @@ arm9: r0: mission id in player's job list return: mission struct pointer + - name: WasMissionCompletedToday + address: + EU: 0x205F494 + description: |- + Runs a series of mission_type specific checks to determine if the mission really was completed today, before running mission rewards. + Examples of checks include: Being in the right dungeon, and having a specific item or item within a treasure box in the bag. + Also seems to initialize the mission_result_and_client struct's NPC fields to correctly fit the mission_type. + + r0: struct mission_result_and_client + r1: struct mission + r2: enum mission_type + return: 1 if the mission was completed, 0 if not. - name: GetMissionByTypeAndDungeon address: EU: 0x205F728 @@ -11798,6 +12139,34 @@ arm9: In particular, mission::status is set to mission_status::MISSION_STATUS_INVALID, mission::dungeon_id is set to -1, mission::floor is set to 0 and mission::reward_type is set to mission_reward_type::MISSION_REWARD_MONEY. r0: Pointer to the mission to clear + - name: GetMissionSpecificFixedRoom + address: + EU: 0x20602FC + description: |- + Returns a fixed room id for a mission based on the specified mission type and subtype. + For missions with multiple valid fixed rooms, uses SelectRandomFixedRoomInRange to select one at random. + + r0: mission_type + r1: mission_subtype + return: fixed room id + - name: SelectRandomFixedRoomInRange + address: + EU: 0x2060400 + description: |- + Returns a random fixed room from a list for a specified range. Checks for "null-termination" if no ending table entry is given. + It seems that the TREASURE_MEMO_FIXED_ROOM_IDS table is frontloaded with 15 "easy" layouts, and only those are allowed before performance flag 9 is enabled. + + r0: table of fixed room ids (int8_t pointer) + r1: number of entries to choose from, -1 to use the entire table. + return: int8_t + - name: ReadRescueBinFile + address: + EU: 0x2060448 + description: |- + Seems to open data/RESCUE/rescue.bin, if it is not already open. + Contains various mission data, see rescue.h for further details. + + No params. - name: GenerateMissionDetailsStruct address: EU: 0x20604CC @@ -11832,6 +12201,16 @@ arm9: r0: mission_template struct pointer r1: mission struct pointer return: bool + - name: MatchMissionTemplateToMission + address: + EU: 0x2060CE8 + description: |- + Seems to find a matching mission_template for the corresponding mission struct if one exists. + Uses a table of validation functions ARM9_UNKNOWN_FUNCTION_TABLE__NA_20A3CF4, not all of which are known. + + r0: index of ARM9_UNKNOWN_FUNCTION_TABLE__NA_20A3CF4? + r1: mission pointer + return: mission_template pointer - name: AppendMissionTitle address: EU: 0x2060D8C @@ -11844,13 +12223,30 @@ arm9: r1: intermediate buffer, filled then concatenated to output buffer r2: pointer to preprocessor args r3: pointer to mission_details struct + - name: FormatMissionHeader + address: + EU: 0x2060E78 + description: |- + Constructs a "mission header" for a normal mission, shown in the job list on the bottom screen. Is also used for SOS/A-OK Mail. + Can consist of a title, mission rank, mission status, dungeon, and floor. Some missions exclude some of these fields. + + r0: header buffer + r1: struct misson_details + - name: FormatSpecialEpisodeMissionTitle + address: + EU: 0x20611A0 + description: |- + Constructs a "mission header" for a special episode transmission mission, shown in the job list on the bottom screen. + Uses a specific text string (15439 EU) to generate the header. + + r0: header buffer - name: AppendMissionSummary address: EU: 0x2061230 NA: 0x2060EB4 JP: 0x20611A0 description: |- - Generates the mission title of a mission, and appends it to the string location. + Generates the mission summary for a mission, and appends it to the string location. r0: [output] main string location r1: temporary string buffer, concatenated to main string @@ -11858,6 +12254,78 @@ arm9: r3: y offset for DrawTextInWindow stack[0]: pointer to preprocessor args stack[1]: pointer to mission_details struct + - name: MakeMissionDetails + address: + EU: 0x2061354 + description: |- + Creates the mission details displayed on the top screen when viewing a mission. Is also used for SOS/A-OK Mail. + Can consist of a mission summary, client, objective, dungeon+floor, restrictions, difficulty, reward, and WMS code. + Some missions exclude one or more of these fields. + + r0: struct misson_details + r1: buffer + r2: ? + - name: MakeSpecialEpisodeMissionDetails + address: + EU: 0x2061354 + description: |- + Creates the mission details displayed on the top screen when viewing a special episode transmission. + Seems to contain only a hard-coded mission summary, and a WMS code. + + r0: buffer + r1: ? + - name: PrintWonderMailSkyCode + address: + EU: 0x2062044 + description: |- + Seems to print a WMS code for a mission, based on context and live analysis. + + r0+: ? + return: ? + - name: AppendMissionObjective + address: + EU: 0x2062144 + description: |- + Generates the "Objective: ..." string for MakeMissionDetails. + + r0: buffer + r1: buffer size + r2: type of objective to display? + r3: monster_id to embed in the string + stack[0]: item_id_16 to embed in the string + - name: AppendDungeonLocation + address: + EU: 0x2062358 + description: |- + Generates the "Place: ..." string for MakeMissionDetails. + + r0: misson_details pointer + r1: buffer + r2: buffer size + - name: SumValidMissionCategoryWeights + address: + EU: 0x206260C + description: |- + Seems to tally up the total weights for each mission_category under a specified mission vendor. + + + r0: 0 for job board, 1 for outlaw board, 2 for cafe client, 3 for beach bottle + return: 1 if the total weight is non-zero, 0 if not. + - name: GetRandomMissionTemplate + address: + EU: 0x20628F4 + description: |- + Retrieves a random mission_template from a weighted random mission_category. + + return: mission_template pointer + - name: LoadMissionTemplates + address: + EU: 0x2062B80 + description: |- + Retrieves a pointer to the mission_template table from the rescue.bin file. + Does not check if the file has been loaded first. + + return: mission_template* - name: IsMonsterMissionAllowed address: EU: 0x2062D90 @@ -11932,6 +12400,25 @@ arm9: r0: Dungeon ID return: True if the specified dungeon can be part of a mission + - name: GetMissionRankWithCapAndModifiers + address: + EU: 0x2063118 + description: |- + Calls GetMissionRank, then adds one to the rank if the mission requires escorting a client, or defeating an outlaw. + Before returning, caps the mission rank at 15 (9 stars). + + r0: dungeon_floor_pair pointer + r1: mission_type + return: mission rank + - name: GetMissionRankWithCapAndModifiersAndCap + address: + EU: 0x2063118 + description: |- + Calls GetMissionRankWithModifiersWithCeil, then redundantly caps the return again at 15 (9 stars). + + r0: dungeon_floor_pair pointer + r1: mission_type + return: mission rank - name: CanSendItem address: EU: 0x2063158 @@ -11964,6 +12451,22 @@ arm9: r0: undefined4 r1: undefined4 r2: mission reward item pointer + - name: GenerateMissionRewards + address: + EU: 0x20634D8 + description: |- + Seems to handle initializing the mission reward related fields of a mission struct, after generating the mission. + + r0: mission pointer + r1: 1 if mission is from the cafe, 0 if not. + - name: CheckDungeonMissionUnlockConditions + address: + EU: 0x2063710 + description: |- + Checks if a specified dungeon is eligible to be unlocked by a mission. + + r0: dungeon_id + return: 3 if the dungeon is not in MISSION_DUNGEON_UNLOCK_TABLE, 2 if the dungeon is open or entered, 1 if $SCENARIO_BALANCE_FLAG is not large enough, and 0 otherwise. - name: IsAvailableItem address: EU: 0x20637D8 @@ -12103,6 +12606,16 @@ arm9: This function gets called shortly after the game is started. Contains a single infinite loop and has no return statement. No params. + - name: ChooseMissionTitle + address: + EU: 0x20699F8 + description: |- + Seems to determine whether or not to use the standard system for generating a mission title, or to use a separate function for a special episode transmission. + + r0: main_buffer + r1: int32_t + r2: uint pointer + return: main_buffer - name: CreateJobSummary address: EU: 0x2069B98 @@ -13628,6 +14141,24 @@ arm9: NA: 0x4 JP: 0x4 description: "The prefactor to the argument of ClampedLn in the damage formula (FLV + DAMAGE_FORMULA_FLV_SHIFT), as a binary fixed-point number with 8 fraction bits (10)." + - name: OUTLAW_HIDEOUT_FIXED_ROOM_IDS + address: + EU: 0x20A1E80 + length: + EU: 0x5 + description: |- + Table of fixed room ids used by the MISSION_ARREST_OUTLAW and MISSION_OUTLAW_HIDEOUT type and subtype. + + type: uint8_t + - name: CHALLENGE_NORMAL_FIXED_ROOM_IDS + address: + EU: 0x20A1E88 + length: + EU: 0x5 + description: |- + Table of fixed room ids used by the MISSION_CHALLENGE_REQUEST and MISSION_CHALLENGE_NORMAL type and subtype. + + type: uint8_t - name: TACTICS_FOLLOW_LEADER address: EU: 0x20A1E90 @@ -13638,6 +14169,16 @@ arm9: NA: 0xC JP: 0xC description: "Array of boolean values corresponding to each tactic_id enum, determining whether the tactic makes party members follow the leader." + - name: TREASURE_MEMO_FIXED_ROOM_IDS + address: + EU: 0x20A1EdC + length: + EU: 0x1E + description: |- + Table of fixed room ids used by the MISSION_TREASURE_MEMO type. + The last 15 entries only show up after the postgame (performance flag 9). + + type: uint8_t - name: FORBIDDEN_FORGOT_MOVE_LIST address: EU: 0x20A1E9C diff --git a/symbols/overlay11.yml b/symbols/overlay11.yml index 176407dc..db13ab9b 100644 --- a/symbols/overlay11.yml +++ b/symbols/overlay11.yml @@ -1491,6 +1491,27 @@ overlay11: Window update function for team info boxes. r0: window pointer + - name: EatOverworldGummiEntryPoint + address: + EU: 0x22FFBB8 + description: |- + Seems to be the entry_point for a "mini-overlay" overlay_load_entry that lives in overlay 11, that controls eating gummis in the overworld. + + return: undefined4 + - name: EatOverworldGummiDestructor + address: + EU: 0x22FFCB8 + description: |- + Seems to be the destructor for a "mini-overlay" overlay_load_entry that lives in overlay 11, that controls eating gummis in the overworld. + + No params. + - name: EatOverworldGummiFrameUpdate + address: + EU: 0x22FFCF4 + description: |- + Seems to be the frame_update for a "mini-overlay" overlay_load_entry that lives in overlay 11, that controls eating gummis in the overworld. + + return: undefined4 - name: CreateTopGroundMenu address: EU: 0x2301724 @@ -1518,6 +1539,49 @@ overlay11: Window update function for the top-level ground mode menu. return: status code + - name: GroundBagOthersMenuEntryPoint + address: + EU: 0x2301B38 + description: |- + Seems to be the entry_point for a "mini-overlay" overlay_load_entry that lives in overlay 11, which controls the others menu in ground mode. + + return: undefined4 + - name: GroundBagOthersMenuDestructor + address: + EU: 0x2301BBC + description: |- + Seems to be the destructor for a "mini-overlay" overlay_load_entry that lives in overlay 11, which controls the others menu in ground mode. + + No params. + - name: GroundBagOthersMenuFrameUpdate + address: + EU: 0x2301BF8 + description: |- + Seems to be the frame_update for a "mini-overlay" overlay_load_entry that lives in overlay 11, which controls the others menu in ground mode. + + return: undefined4 + - name: InitDiaryAndFaqBoardMenu + address: + EU: 0x2303C60 + description: |- + Seems to initialize the menu which controls bidoof and sunflora's diaries, as well as the FAQ board on B1F of the guild. + + r0: undefined4 + return: undefined4 + - name: FreeDiaryAndFaqBoardMenuMenu + address: + EU: 0x23042A0 + description: |- + Seems to free them menu which controls bidoof and sunflora's diaries, as well as the FAQ board on B1F of the guild. + + No params. + - name: DiaryAndFaqBoardMenuFrameUpdate + address: + EU: 0x23042CC + description: |- + Seems to run each frame to manage the menu which controls bidoof and sunflora's diaries, as well as the FAQ board on B1F of the guild. + + return: undefined4 - name: IsBagNotEmpty address: EU: 0x2305460 @@ -1569,6 +1633,13 @@ overlay11: r0: switch case index for the function: 0 = Swap List Inventory, 1 = Unknown, 2 = Species Exclusive Item List, 3 = Item Trade Away Selection List. r1: Depends on r0. If case 2: ID of the monster to retrieve an exclusive item list for. If case 3: Number of Exclusive Items the player owns. + - name: LoadRecycleShopOverlay + address: + EU: 0x230D768 + description: |- + Seems to be responsible for loading overlay 20 for the recycle shop. + + No params. - name: HandleControlsTopScreenGround address: EU: 0x230EFB4 @@ -1862,49 +1933,49 @@ overlay11: - name: SWAP_SHOP_ONE_STAR_STR address: EU: 0x2323AD8 - descrition: |- + description: |- "[M:S3]" Used exclusively by GetExclusiveItemRequirements. - name: SWAP_SHOP_TWO_STAR_STR address: EU: 0x2323AE0 - descrition: |- + description: |- "[M:S3][M:S3]" Used exclusively by GetExclusiveItemRequirements. - name: SWAP_SHOP_THREE_STAR_STR address: EU: 0x2323AF0 - descrition: |- + description: |- "[M:S3][M:S3][M:S3]" Used exclusively by GetExclusiveItemRequirements. - name: SWAP_SHOP_RED_TEXT_TAG_STR address: EU: 0x2323B34 - descrition: |- + description: |- "[CS:W]" Used exclusively by a subfunction of SwapShopInventoryManager. - name: SWAP_SHOP_UNCENTER_TEXT_TAG_STR address: EU: 0x2323B3C - descrition: |- + description: |- "[CR]" Used exclusively by a subfunction of SwapShopInventoryManager. - name: SWAP_SHOP_CLUMSET_ONE_STAR_STR address: EU: 0x2323B44 - descrition: |- + description: |- "[CLUM_SET:130][M:S3]" Used exclusively by a subfunction of SwapShopInventoryManager. - name: SWAP_SHOP_CLUMSET_TWO_STAR_STR address: EU: 0x2323B5C - descrition: |- + description: |- "[CLUM_SET:122][M:S3][M:S3]" Used exclusively by a subfunction of SwapShopInventoryManager. - name: SWAP_SHOP_CLUMSET_THREE_STAR_STR address: EU: 0x2323B78 - descrition: |- + description: |- "[CLUM_SET:114][M:S3][M:S3][M:S3]" Used exclusively by a subfunction of SwapShopInventoryManager. - name: OVERLAY11_OVERLAY_LOAD_TABLE diff --git a/symbols/overlay19.yml b/symbols/overlay19.yml index c8cb8264..27551fde 100644 --- a/symbols/overlay19.yml +++ b/symbols/overlay19.yml @@ -95,7 +95,7 @@ overlay19: If not zero, stores a double pointer to the BAR_UNLOCKABLE_DUNGEONS_TABLE to r0. Then returns 6 for some reason... Unclear what this is intended to actually do... - r0: struct bar_dungeon_unlock ** + r0: struct dungeon_unlock_entry ** return: Always 6? - name: BarPopulateUnlockableDungeons address: @@ -364,7 +364,7 @@ overlay19: description: |- Stores dungeon ids, as well as the required $SCENARIO_BALANCE_FLAG to obtain them from the cafe. - type: struct bar_dungeon_unlock[6] + type: struct dungeon_unlock_entry[6] - name: BAR_RECRUITABLE_GOURMET_MONSTER_TABLE aliases: - BAR_RECRUITABLE_MONSTER_TABLE diff --git a/symbols/overlay20.yml b/symbols/overlay20.yml index dbf41bc4..6c332300 100644 --- a/symbols/overlay20.yml +++ b/symbols/overlay20.yml @@ -12,7 +12,138 @@ overlay20: NA: 0x3000 JP: 0x3000 description: Controls the Recycle Shop. - functions: [] + functions: + - name: RecycleShopEntryPointFirst + address: + EU: 0x238AC80 + description: |- + The entry point for the overlay, when called by MENU_RECYCLE_SHOP, serving to initialize the recycle shop. + Calls RecycleShopCommonEntryPoint(0). + + return: undefined4 + - name: RecycleShopEntryPointResume + address: + EU: 0x238AC90 + description: |- + The entry point for the overlay, when called by MENU_RECYCLE_SHOP2, resuming operations of the overlay. + Calls RecycleShopCommonEntryPoint(0). + + + return: undefined4 + - name: RecycleShopDestructor + address: + EU: 0x238ACA0 + description: |- + The shared destructor of both recycle shop overlay_load_entries, suspending operations of the overlay. + + No params. + - name: RecycleShopFrameUpdate + address: + EU: 0x238ACF0 + description: |- + The shared frame_update of both recycle shop overlay_load_entries, managing operations of the overlay each frame. + + return: undefined4 + - name: RecycleShopCommonEntryPoint + address: + EU: 0x238BDD4 + description: |- + Effectively the shared entry_point of both recycle shop overlay_load_entry, called immediately by both real entry_points to the overlay. + + + r0: 1 if resuming, 0 if first entry. + return: undefined4 + - name: PrintWynautTextbox + address: + EU: 0x238BE80 + description: |- + Seems to display a textbox with wynaut's default portrait and a specified text string id. + + + r0: string_id + - name: PrintWynautSimpleMenu + address: + EU: 0x238BEDC + description: |- + Seems to display a simple_menu with wynaut's default portrait, a specified text string id, and a few simple_menu_id_item pointers. + + + r0: struct recycle_shop_main + r1: string_id + r2: simple_menu_id_items pointer + - name: RecycleShopTryHidePortraitBox + address: + EU: 0x238BF50 + description: |- + Seems to hide the active portrait box? Might be doing something else in addition. + + + r0: struct recycle_shop_main pointer + r1: ? + - name: PrintWynautNormalPortrait + address: + EU: 0x238BFE8 + description: |- + Prepares a normal portrait for wynaut, and updates the necessary fields of recycle_shop_main to do so. + + r0: struct recycle_shop_main pointer + - name: RecycleShopClosePortraitBox + address: + EU: 0x238C050 + description: |- + Seems to close the currently active portrait box, if one exists. + + r0: struct recycle_shop_main pointer + - name: RecycleShopCloseAllWindows + address: + EU: 0x238C0EC + description: |- + Seems to close all windows of the recycle shop when called. Retrieves window_ids from RECYCLE_SHOP_UNK_STRUCT_SIZE_84H_PTR. + + No params. + - name: RecycleShopHandleTopScreenWindow + address: + EU: 0x238C19C + description: |- + Seems to generally manage the top screen window during item selection, assigning the below callbacks to some window creation function. + + return: undefined4 + - name: RecycleShopTopScreenDrawItemStats + address: + EU: 0x238C40C + description: |- + Seems to display the trade info and stats for the item the cursor is currently on on the top screen window. + + + r0: int + - name: RecycleShopTopScreenDrawItemName + address: + EU: 0x238C580 + description: |- + Seems to print the item the cursor is currently on to the top screen window. + + + r0: int + - name: RecycleShopTopScreenDrawInfoWindow + address: + EU: 0x238C5F4 + description: |- + Seems to display the bottom window in the top screen display of the recycle shop, which explains how to read the top window. + + r0: int32_t + r1: undefined4 + r2: undefined4 + r3: undefined4 + - name: DisplaySelectionTutorialWindow + address: + EU: 0x238DA60 + description: |- + Displays a side window explaining how to multi-select items for non-specific recycling. + + r0: int32_t + r1: undefined4 + r2: undefined4 + r3: undefined4 data: - name: OVERLAY20_UNKNOWN_POINTER__NA_238CF7C address: @@ -21,7 +152,10 @@ overlay20: JP: 0x238E4D8 length: NA: 0x8 - description: "Note: unverified, ported from Irdkwia's notes" + EU: 0x8 + description: |- + Note: unverified, ported from Irdkwia's notes. + Seems to consist of a pointer to RECYCLE_SHOP_S14P02A_BGP_FILE_STR and an unknown value. Perhaps a pointer to the file at runtime? - name: RECYCLE_MENU_ITEMS_CONFIRM_1 address: EU: 0x238DAC4 @@ -67,14 +201,18 @@ overlay20: EU: 0x28 NA: 0x28 JP: 0x28 - - name: OVERLAY20_UNKNOWN_TABLE__NA_238D014 + - name: RECYCLE_SHOP_S14P02A_BGP_FILE_STR address: EU: 0x238DB54 NA: 0x238D014 JP: 0x238E570 length: - NA: 0x14 - description: "Note: unverified, ported from Irdkwia's notes" + NA: 0x11 + description: |- + "BACK/s14p02a.bgp" + Likely a background file loaded in manually by the recycle shop. + + type: string - name: RECYCLE_WINDOW_PARAMS_1 address: EU: 0x238DB68 @@ -209,39 +347,61 @@ overlay20: NA: 0x4 JP: 0x4 description: Static initializer for overlay 20. - - name: OVERLAY20_UNKNOWN_POINTER__NA_238D120 + - name: RECYCLE_SHOP_MAIN_STRUCT_PTR address: EU: 0x238DC60 NA: 0x238D120 JP: 0x238E680 length: + EU: 0x4 NA: 0x4 JP: 0x4 - description: "Note: unverified, ported from Irdkwia's notes" - - name: OVERLAY20_UNKNOWN_POINTER__NA_238D124 + description: |- + A permanent pointer to the recycle_shop_main struct. + + type: recycle_shop_main* + - name: RECYCLE_SHOP_UNK_STRUCT_SIZE_84H_PTR + aliases: + - OVERLAY20_UNKNOWN_POINTER__NA_238D124 address: EU: 0x238DC64 NA: 0x238D124 JP: 0x238E684 length: + EU: 0x4 NA: 0x4 JP: 0x4 - description: "Note: unverified, ported from Irdkwia's notes" - - name: OVERLAY20_UNKNOWN_POINTER__NA_238D128 + description: |- + Seems to be a pointer to a struct of unknown purpose with size 0x84. + + type: recycle_shop_struct_0x84* + - name: RECYCLE_SHOP_UNK_STRUCT_SIZE_340H_PTR + aliases: + - OVERLAY20_UNKNOWN_POINTER__NA_238D128 address: EU: 0x238DC68 NA: 0x238D128 JP: 0x238E688 length: + EU: 0x4 NA: 0x4 JP: 0x4 - description: "Note: unverified, ported from Irdkwia's notes" - - name: OVERLAY20_UNKNOWN_POINTER__NA_238D12C + description: |- + Seems to be a pointer to a struct of unknown purpose with size 0x340. + + type: recycle_shop_struct_0x340* + - name: RECYCLE_SHOP_UNK_STRUCT_SIZE_1CCH_PTR + aliases: + - OVERLAY20_UNKNOWN_POINTER__NA_238D12C address: EU: 0x238DC6C NA: 0x238D12C JP: 0x238E68C length: + EU: 0x4 NA: 0x4 JP: 0x4 - description: "Note: unverified, ported from Irdkwia's notes" + description: |- + Seems to be a pointer to a struct of unknown purpose with size 0x1CC. + + type: recycle_shop_struct_0x1cc* \ No newline at end of file diff --git a/symbols/overlay26.yml b/symbols/overlay26.yml index b238f12f..f0c0fb41 100644 --- a/symbols/overlay26.yml +++ b/symbols/overlay26.yml @@ -100,9 +100,9 @@ overlay26: Is a frame_update for an overlay_load_entry. return: undefined4 - - name: UnkOv26EntryPoint_0238b754_EU + - name: UnkOv26EntryPoint0238b754EU address: - EU: 0x238B818 + EU: 0x238B754 description: |- Is an unidentified entry_point for an overlay_load_entry. @@ -111,16 +111,16 @@ overlay26: r2: undefined4 r3: undefined4 return: undefined4 - - name: UnkOv26Destructor_0238b780_EU + - name: UnkOv26Destructor0238b780EU address: - EU: 0x238B850 + EU: 0x238B780 description: |- Is an unidentified destructor for an overlay_load_entry. No params. - - name: UnkOv26FrameUpdate_0238b7ac_EU + - name: UnkOv26FrameUpdate0238b7acEU address: - EU: 0x238B87C + EU: 0x0238B7AC description: |- Is an unidentified frame_update for an overlay_load_entry. From bb64b8b32e670b97f5c7adf81c823e3facc46a4f Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Wed, 3 Jun 2026 00:12:32 -0400 Subject: [PATCH 023/117] Fixes Round 1 --- headers/data/arm9.h | 2 +- headers/functions/arm9.h | 8 +++----- headers/functions/overlay11.h | 7 +++---- headers/functions/overlay19.h | 2 +- headers/functions/overlay20.h | 3 --- headers/functions/overlay26.h | 12 ++++++------ symbols/arm9.yml | 8 ++++---- 7 files changed, 18 insertions(+), 24 deletions(-) diff --git a/headers/data/arm9.h b/headers/data/arm9.h index 9e415504..9237957b 100644 --- a/headers/data/arm9.h +++ b/headers/data/arm9.h @@ -141,10 +141,10 @@ extern fx32_8 DAMAGE_FORMULA_LN_ARG_PREFACTOR; extern uint8_t OUTLAW_HIDEOUT_FIXED_ROOM_IDS[5]; extern uint8_t CHALLENGE_NORMAL_FIXED_ROOM_IDS[5]; extern bool TACTICS_FOLLOW_LEADER[12]; +extern uint8_t TREASURE_MEMO_FIXED_ROOM_IDS[30]; extern struct forbidden_forgot_move_entry FORBIDDEN_FORGOT_MOVE_LIST[3]; extern struct type_id_8 CONVERSION2_TYPE_TABLE[18]; extern int16_t TACTICS_UNLOCK_LEVEL_TABLE[12]; -extern uint8_t TREASURE_MEMO_FIXED_ROOM_IDS[30]; extern int16_t CLIENT_LEVEL_TABLE[16]; extern int16_t OUTLAW_LEVEL_TABLE[16]; extern int16_t OUTLAW_MINION_LEVEL_TABLE[16]; diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 40d8b8ae..059cf19f 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -363,8 +363,8 @@ void CloseSynthBin(void); bool GenerateCroagunkItems(void); uint GetCroagunkItemTemplates(struct synth_template* param_1); bool PopCroagunkItem(enum item_id item); -undefined4 LoadCroagunkShop(void); -undefined4 SaveCroagunkShop(void); +undefined4 LoadCroagunkItems(void); +undefined4 SaveCroagunkItems(void); struct synth_template* GetSynthItem(enum item_id exclusive_item); bool GetValidSynthsForSpecies(enum monster_id monster_id, struct monster_synth_data* monster_synth_data, @@ -1256,8 +1256,6 @@ bool IsMissionTypeSpecialEpisode(struct mission* mission); bool DoesMissionHaveTypeAndSubtype(struct mission, struct mission_type_8* type, int * subtype) bool AlreadyHasSimilarMission(struct mission_type_8* type, int8_t * subtype_8); void GenerateDailyMissions(void); -int IsItTrueNormal(int param_1); -int IsItTrueBottle(int param_1); bool AlreadyHaveMission(struct mission* mission); int CountJobListMissions(void); int DungeonRequestsDone(uint8_t param_1, bool param_2); @@ -1298,7 +1296,7 @@ void MakeMissionDetails(struct misson_details *param_1,char *buffer,undefined pa void MakeSpecialEpisodeMissionDetails(struct mission_details, undefined param_2) undefined PrintWonderMailSkyCode(undefined param_1,undefined param_2,undefined param_3,undefined param_4); void AppendMissionObjective(char *param_1,int param_2,undefined4 param_3,uint32_t param_4,short param_5); -void MissionAppendDungeonLocation(struct misson_details *param_1,char *buffer,int param_3); +void MissionAppendMissionDungeonLocation(struct misson_details *param_1,char *buffer,int param_3); bool SumValidMissionCategoryWeights(undefined4 mission_vendor); struct mission_template * GetRandomMissionTemplate(void); undefined4 LoadMissionTemplates(void); diff --git a/headers/functions/overlay11.h b/headers/functions/overlay11.h index f9150fb0..58964cc4 100644 --- a/headers/functions/overlay11.h +++ b/headers/functions/overlay11.h @@ -170,10 +170,9 @@ int UpdateTopGroundMenu(void); undefined4 GroundBagOthersMenuEntryPoint(void); void GroundBagOthersMenuDestructor(void); undefined4 GroundBagOthersMenuFrameUpdate(void); -undefined4 DiaryMenuDiaryMenuEntryPoint(undefined4 param_1); -void DiaryMenuDestructor(void); -undefined4 DiaryMenuFrameUpdate(void); -void InitDiaryandFaqBoardMenu(undefined4 param_1); +undefined4 InitDiaryAndFaqBoardMenu(undefined4 param_1); +void FreeDiaryAndFaqBoardMenuMenu(void); +undefined4 DiaryAndFaqBoardMenuFrameUpdate(void); bool IsBagNotEmpty(void); bool IsGroundMonsterAtMaxLevel(struct ground_monster* param_1); void GetExclusiveItemRequirements(undefined param_1, undefined param_2); diff --git a/headers/functions/overlay19.h b/headers/functions/overlay19.h index d85d052e..10f753cc 100644 --- a/headers/functions/overlay19.h +++ b/headers/functions/overlay19.h @@ -9,7 +9,7 @@ uint16_t* BarGetDrinkEventWeights(void); enum monster_id BarGetRandomValidEggRecruit(void); enum monster_id BarGetValidEggGiverFromGourmetTable(void); enum monster_id BarGetRandomValidRecruitFromGourmetTable(void); -int BarGetUnlockableDungeonPtr(struct bar_dungeon_unlock** param_1); +int BarGetUnlockableDungeonPtr(struct dungeon_unlock_entry** param_1); int BarPopulateUnlockableDungeons(struct dungeon_id_8* param_1); void BarTryClosePortraitBox(void); undefined4 BarCaseManagerSub(void); diff --git a/headers/functions/overlay20.h b/headers/functions/overlay20.h index 207c96c8..9508751e 100644 --- a/headers/functions/overlay20.h +++ b/headers/functions/overlay20.h @@ -18,9 +18,6 @@ undefined4 RecycleShopHandleTopScreenWindow(void); void RecycleShopTopScreenDrawItemStats(int param_1); void RecycleShopTopScreenDrawItemName(int window_id); void RecycleShopTopScreenDrawInfoWindow(int param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4); -undefined4 MaybeCheckIfPlayerHasRequiredItems(undefined4 param_1); -bool MaybeHandleItemTradingLogic(uint param_1); -void MaybeDistinguishBetweenStorageAndBagItems(undefined4 param_1,undefined *param_2,int owned_item_list_index,int param_4); void DisplaySelectionTutorialWindow(int window_id,undefined4 param_2,undefined4 param_3,undefined4 param_4); #endif \ No newline at end of file diff --git a/headers/functions/overlay26.h b/headers/functions/overlay26.h index ba7452e6..d4d3a5f2 100644 --- a/headers/functions/overlay26.h +++ b/headers/functions/overlay26.h @@ -6,15 +6,15 @@ undefined4 MissionRewardOverlayEntryPoint(void); void MissionRewardOverlayDestructor(void); undefined4 MissionRewardOverlayFrameUpdate(void); void MissionRewardClosePortraitAndDialogueBox(void); -undefined4 EnterDungeonEntryPoint(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4); -void EnterDungeonDestructor(void); -undefined4 EnterDungeonFrameUpdate(void); +undefined4 ApplyRuleDungeonEffectsEntryPoint(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4); +void ApplyRuleDungeonEffectsDestructor(void); +undefined4 ApplyRuleDungeonEffectsFrameUpdate(void); undefined4 ExitDungeon1EntryPoint(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4); void ExitDungeon1Destructor(void); undefined4 ExitDungeon1FrameUpdate(void); -undefined4 UnkOv26EntryPoint_0238b754_EU(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4); -void UnkOv26Destructor_0238b780_EU(void); -undefined4 UnkOv26FrameUpdate_0238b7ac_EU(void); +undefined4 UnkOv26EntryPoint0238b754EU(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4); +void UnkOv26Destructor0238b780EU(void); +undefined4 UnkOv26FrameUpdate0238b7acEU(void); undefined4 DungeonExitEntryPoint2(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4); void DungeonExitDestructor2(void); undefined4 DungeonExitFrameUpdate2(void); diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 16290892..5d2c5114 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -3506,7 +3506,7 @@ arm9: Seems to load the Croagunk Swap Shop items from the save file. return: undefined4 - - name: SaveCroagunkShop + - name: SaveCroagunkItems address: EU: 0x2013298 description: |- @@ -12267,7 +12267,7 @@ arm9: r2: ? - name: MakeSpecialEpisodeMissionDetails address: - EU: 0x2061354 + EU: 0x2061FDC description: |- Creates the mission details displayed on the top screen when viewing a special episode transmission. Seems to contain only a hard-coded mission summary, and a WMS code. @@ -12293,7 +12293,7 @@ arm9: r2: type of objective to display? r3: monster_id to embed in the string stack[0]: item_id_16 to embed in the string - - name: AppendDungeonLocation + - name: AppendMissionDungeonLocation address: EU: 0x2062358 description: |- @@ -14171,7 +14171,7 @@ arm9: description: "Array of boolean values corresponding to each tactic_id enum, determining whether the tactic makes party members follow the leader." - name: TREASURE_MEMO_FIXED_ROOM_IDS address: - EU: 0x20A1EdC + EU: 0x20A1EDC length: EU: 0x1E description: |- From ea387df608a52b05709d5b6e77d3a7a55f41fbc7 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Wed, 3 Jun 2026 00:47:28 -0400 Subject: [PATCH 024/117] More Fixes --- headers/data/overlay20.h | 6 +++++- headers/data/overlay26.h | 1 - headers/functions/arm9.h | 9 +++++---- symbols/arm9.yml | 6 +++--- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/headers/data/overlay20.h b/headers/data/overlay20.h index 8153eb50..1f834faa 100644 --- a/headers/data/overlay20.h +++ b/headers/data/overlay20.h @@ -6,6 +6,7 @@ extern struct simple_menu_id_item RECYCLE_MENU_ITEMS_CONFIRM_2[3]; extern struct simple_menu_id_item RECYCLE_SUBMENU_ITEMS_1[3]; extern struct simple_menu_id_item RECYCLE_SUBMENU_ITEMS_2[4]; extern struct simple_menu_id_item RECYCLE_MAIN_MENU_ITEMS_1[5]; +extern char RECYCLE_SHOP_S14P02A_BGP_FILE_STR[17]; extern struct window_params RECYCLE_WINDOW_PARAMS_1; extern struct window_params RECYCLE_WINDOW_PARAMS_2; extern struct window_params RECYCLE_WINDOW_PARAMS_3; @@ -20,5 +21,8 @@ extern struct window_params RECYCLE_WINDOW_PARAMS_10; extern struct window_params RECYCLE_WINDOW_PARAMS_11; extern struct simple_menu_id_item RECYCLE_MAIN_MENU_ITEMS_3[3]; extern undefined4 OV20_STATIC_INITIALIZER; - +extern struct recycle_shop_main* RECYCLE_SHOP_MAIN_STRUCT_PTR; +extern struct recycle_unk_struct_0x84* RECYCLE_SHOP_UNK_STRUCT_SIZE_84H_PTR; +extern struct recycle_unk_struct_0x340* RECYCLE_SHOP_UNK_STRUCT_SIZE_340H_PTR; +extern struct recycle_unk_struct_0x1cc* RECYCLE_SHOP_UNK_STRUCT_SIZE_1CCH_PTR; #endif diff --git a/headers/data/overlay26.h b/headers/data/overlay26.h index 1b608fe4..5a42f947 100644 --- a/headers/data/overlay26.h +++ b/headers/data/overlay26.h @@ -19,7 +19,6 @@ extern char DEBUG_NO_COUNT_STR[48]; extern undefined4 OV26_STATIC_INITIALIZER; extern mission_reward_struct_overlay * MISSION_REWARD_OVERLAY_STRUCT_PTR; extern undefined* APPLY_RULE_DUNGEON_EFFECTS_STRUCT_PTR; -extern undefined* OV26_UNK_ENTRY_POINT_STRUCT_PTR; extern undefined* EXIT_DUNGEON_1_STRUCT_PTR; extern undefined* EXIT_DUNGEON_2_STRUCT_PTR; diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 059cf19f..9ae86ace 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -845,6 +845,7 @@ void EventFlagBackupVeneer(void); void InitMainTeamAfterQuiz(void); void InitSpecialEpisodePartners(void); void InitSpecialEpisodeExtraPartner(void); +void AssignSpecialEpisodePc(int team_member_id,special_episode_pc *param_2); void ReadStringSave(char* buf); bool CheckStringSave(const char* buf); int WriteSaveFile(undefined* save_info, undefined* buf, int size); @@ -1288,15 +1289,15 @@ bool ValidateLegendaryChallengeMission(struct mission_template* valid_mission_in int MatchMissionTemplateToMission(struct mission *param_1,undefined4 param_2); void AppendMissionTitle(char* main_buffer, char* temp_buffer, struct preprocessor_args* args, struct mission_details* details); -void FormatMissionTitle(char *buffer,struct misson_details *param_2); -void FormatSpecialEpisodeMissionTitle(char *param_1); +void FormatMissionHeader(char *buffer,struct misson_details *param_2); +void FormatSpecialEpisodeMissionHeader(char *param_1); void AppendMissionSummary(char* main_buffer, char* temp_buffer, int window_id, int y_offset, struct preprocessor_args* args, struct mission_details* details); void MakeMissionDetails(struct misson_details *param_1,char *buffer,undefined param_3); void MakeSpecialEpisodeMissionDetails(struct mission_details, undefined param_2) undefined PrintWonderMailSkyCode(undefined param_1,undefined param_2,undefined param_3,undefined param_4); void AppendMissionObjective(char *param_1,int param_2,undefined4 param_3,uint32_t param_4,short param_5); -void MissionAppendMissionDungeonLocation(struct misson_details *param_1,char *buffer,int param_3); +void AppendMissionDungeonLocation(struct misson_details *param_1,char *buffer,int param_3); bool SumValidMissionCategoryWeights(undefined4 mission_vendor); struct mission_template * GetRandomMissionTemplate(void); undefined4 LoadMissionTemplates(void); @@ -1312,7 +1313,7 @@ bool CanSendItem(enum item_id item_id, bool to_sky); void InitMissionReward(struct mission *param_1,struct mission_reward_data *param_2,undefined4 param_3,undefined4 param_4); void RollRandomItemReward(undefined4 param_1,undefined4 param_2, item_id_16 *param_3); void GenerateMissionRewards(struct mission *MissionPtr,int IsCafeMission); -undefined4 CheckDungeonMissionUnlock(enum dungeon_id param_1); +undefined4 CheckDungeonMissionUnlockConditions(enum dungeon_id param_1); bool IsAvailableItem(enum item_id item_id); int GetAvailableItemDeliveryList(undefined* item_buffer); void ZeroInitMissionRewardDataStruct(struct mission_reward_data *param_1); diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 5d2c5114..30f345d6 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -7812,7 +7812,7 @@ arm9: Implements SPECIAL_PROC_0x4 (see ScriptSpecialProcessCall). No params. - - name: AssignSpecialEpisodePC + - name: AssignSpecialEpisodePc address: EU: 0x2048DE0 description: |- @@ -12232,7 +12232,7 @@ arm9: r0: header buffer r1: struct misson_details - - name: FormatSpecialEpisodeMissionTitle + - name: FormatSpecialEpisodeMissionHeader address: EU: 0x20611A0 description: |- @@ -12402,7 +12402,7 @@ arm9: return: True if the specified dungeon can be part of a mission - name: GetMissionRankWithCapAndModifiers address: - EU: 0x2063118 + EU: 0x20630D8 description: |- Calls GetMissionRank, then adds one to the rank if the mission requires escorting a client, or defeating an outlaw. Before returning, caps the mission rank at 15 (9 stars). From 37c464ea4f1c2eb2d50b4dfd6692e6494ea255c2 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Wed, 3 Jun 2026 00:54:29 -0400 Subject: [PATCH 025/117] Header Fixes --- headers/data/overlay26.h | 26 +++++++++++++------------- headers/functions/arm9.h | 14 +++++++------- headers/functions/overlay10.h | 2 +- symbols/arm9.yml | 4 ++-- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/headers/data/overlay26.h b/headers/data/overlay26.h index 5a42f947..c5017f68 100644 --- a/headers/data/overlay26.h +++ b/headers/data/overlay26.h @@ -1,23 +1,23 @@ #ifndef HEADERS_DATA_OVERLAY26_H_ #define HEADERS_DATA_OVERLAY26_H_ -extern mission_reward_dialogue_sequence MISSION_TYPE_12_DIALOGUE_SEQS[1]; -extern mission_reward_dialogue_sequence MISSION_DEFAULT_DIALOGUE_SEQS[2]; -extern mission_reward_dialogue_sequence MISSION_TYPE_10_DIALOGUE_SEQS[2]; -extern mission_reward_dialogue_sequence MISSION_TYPE_9_DIALOGUE_SEQS[2]; -extern mission_reward_dialogue_sequence MISSION_TYPE_8_DIALOGUE_SEQS[2]; -extern mission_reward_dialogue_sequence MISSION_TYPE_6_DIALOGUE_SEQS[2]; -extern mission_reward_dialogue_sequence MISSION_TYPE_7_DIALOGUE_SEQS[2]; -extern mission_reward_dialogue_sequence MISSION_TYPE_3_DIALOGUE_SEQS[2]; -extern mission_reward_dialogue_sequence MISSION_TYPE_2_DIALOGUE_SEQS[2]; -extern mission_reward_dialogue_sequence MISSION_TYPE_1_DIALOGUE_SEQS[2]; -extern mission_reward_dialogue_sequence MISSION_TYPE_0_DIALOGUE_SEQS[2]; -extern mission_reward_dialogue_sequence MISSION_TYPE_11_DIALOGUE_SEQS[2]; +extern struct mission_reward_dialogue_sequence MISSION_TYPE_12_DIALOGUE_SEQS[1]; +extern struct mission_reward_dialogue_sequence MISSION_DEFAULT_DIALOGUE_SEQS[2]; +extern struct mission_reward_dialogue_sequence MISSION_TYPE_10_DIALOGUE_SEQS[2]; +extern struct mission_reward_dialogue_sequence MISSION_TYPE_9_DIALOGUE_SEQS[2]; +extern struct mission_reward_dialogue_sequence MISSION_TYPE_8_DIALOGUE_SEQS[2]; +extern struct mission_reward_dialogue_sequence MISSION_TYPE_6_DIALOGUE_SEQS[2]; +extern struct mission_reward_dialogue_sequence MISSION_TYPE_7_DIALOGUE_SEQS[2]; +extern struct mission_reward_dialogue_sequence MISSION_TYPE_3_DIALOGUE_SEQS[2]; +extern struct mission_reward_dialogue_sequence MISSION_TYPE_2_DIALOGUE_SEQS[2]; +extern struct mission_reward_dialogue_sequence MISSION_TYPE_1_DIALOGUE_SEQS[2]; +extern struct mission_reward_dialogue_sequence MISSION_TYPE_0_DIALOGUE_SEQS[2]; +extern struct mission_reward_dialogue_sequence MISSION_TYPE_11_DIALOGUE_SEQS[2]; extern char DEBUG_CONQUEST_COUNT_STR[54]; extern char DEBUG_DEAD_COUNT_STR[50]; extern char DEBUG_NO_COUNT_STR[48]; extern undefined4 OV26_STATIC_INITIALIZER; -extern mission_reward_struct_overlay * MISSION_REWARD_OVERLAY_STRUCT_PTR; +extern struct mission_reward_struct_overlay * MISSION_REWARD_OVERLAY_STRUCT_PTR; extern undefined* APPLY_RULE_DUNGEON_EFFECTS_STRUCT_PTR; extern undefined* EXIT_DUNGEON_1_STRUCT_PTR; extern undefined* EXIT_DUNGEON_2_STRUCT_PTR; diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 9ae86ace..d41a23ae 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -355,13 +355,13 @@ bool RecycleShopIsNotThrownItem(enum item_id param_1); bool RecycleShopIsTradableItem(enum item_id param_1,bool param_2); int RecycleShopCountTradableItemsInBag(bool param_1); int RecycleShopCountTradableItemsInStorage(bool param_1); -int CountValidRecycleShopItems(int filter,uint recycles,enum rank rank); +int CountValidRecycleShopItems(int filter,uint32_t recycles,enum rank rank); bool IsRecycleTradeTypeValid(int param_1,int param_2); void ClearCroagunkItems(void); bool LoadSynthBin(void); void CloseSynthBin(void); bool GenerateCroagunkItems(void); -uint GetCroagunkItemTemplates(struct synth_template* param_1); +uint32_t GetCroagunkItemTemplates(struct synth_template* param_1); bool PopCroagunkItem(enum item_id item); undefined4 LoadCroagunkItems(void); undefined4 SaveCroagunkItems(void); @@ -979,7 +979,7 @@ void MissionToWonderMailPassword(char* password, struct mission* mission_data); void SetEnterDungeon(enum dungeon_id dungeon_id); void InitDungeonInit(struct dungeon_init* dungeon_init_data, enum dungeon_id dungeon_id); bool IsNoLossPenaltyDungeon(enum dungeon_id dungeon_id); -bool MissionRewardValidateDungeonId(dungeon_id_8 *param_1); +bool MissionRewardValidateDungeonId(struct dungeon_id_8 *param_1); undefined CheckMissionRestrictions(undefined param_1); bool TilesetSecondaryTerrainIsChasm(int16_t tileset_id); int GetNbFloors(enum dungeon_id dungeon_id); @@ -1254,7 +1254,7 @@ bool CheckItemForMissionType(enum mission_type type,int * subtype, enum item_id enum mission_generation_result GenerateMission(undefined* param_1, struct mission* mission_data); int CountAndPopulateValidMissionTableMonsters(undefined4 *param_1,undefined4 *param_2); bool IsMissionTypeSpecialEpisode(struct mission* mission); -bool DoesMissionHaveTypeAndSubtype(struct mission, struct mission_type_8* type, int * subtype) +bool DoesMissionHaveTypeAndSubtype(struct mission, struct mission_type_8* type, int * subtype); bool AlreadyHasSimilarMission(struct mission_type_8* type, int8_t * subtype_8); void GenerateDailyMissions(void); bool AlreadyHaveMission(struct mission* mission); @@ -1294,7 +1294,7 @@ void FormatSpecialEpisodeMissionHeader(char *param_1); void AppendMissionSummary(char* main_buffer, char* temp_buffer, int window_id, int y_offset, struct preprocessor_args* args, struct mission_details* details); void MakeMissionDetails(struct misson_details *param_1,char *buffer,undefined param_3); -void MakeSpecialEpisodeMissionDetails(struct mission_details, undefined param_2) +void MakeSpecialEpisodeMissionDetails(struct mission_details, undefined param_2); undefined PrintWonderMailSkyCode(undefined param_1,undefined param_2,undefined param_3,undefined param_4); void AppendMissionObjective(char *param_1,int param_2,undefined4 param_3,uint32_t param_4,short param_5); void AppendMissionDungeonLocation(struct misson_details *param_1,char *buffer,int param_3); @@ -1311,7 +1311,7 @@ int8_t GetMissionRankWithCapAndModifiers(void); int8_t GetMissionRankWithCapAndModifiersAndCap(void); bool CanSendItem(enum item_id item_id, bool to_sky); void InitMissionReward(struct mission *param_1,struct mission_reward_data *param_2,undefined4 param_3,undefined4 param_4); -void RollRandomItemReward(undefined4 param_1,undefined4 param_2, item_id_16 *param_3); +void RollRandomItemReward(undefined4 param_1,undefined4 param_2, struct item_id_16 *param_3); void GenerateMissionRewards(struct mission *MissionPtr,int IsCafeMission); undefined4 CheckDungeonMissionUnlockConditions(enum dungeon_id param_1); bool IsAvailableItem(enum item_id item_id); @@ -1329,7 +1329,7 @@ void SetAllEventNpcs(undefined2 param_1,undefined2 param_2,undefined2 param_3,un void RandomizeDemoActors(void); void ItemAtTableIdx(int idx, struct bulk_item* item); void MainLoop(void); -char * ChooseMissionTitle(char *main_buffer,int param_2,uint *param_3); +char * ChooseMissionTitle(char *main_buffer,int param_2,uint32_t *param_3); void CreateJobSummary(struct mission* mission, int param_2); int DungeonSwapIdToIdx(enum dungeon_id dungeon_id); enum dungeon_id DungeonSwapIdxToId(int idx); diff --git a/headers/functions/overlay10.h b/headers/functions/overlay10.h index 8ffd2ea4..1504931a 100644 --- a/headers/functions/overlay10.h +++ b/headers/functions/overlay10.h @@ -12,7 +12,7 @@ bool CheckInventoryMenuField0x1A0(int window_id); uint8_t PopInventoryMenuField0x1A3(int window_id); void UpdateInventoryMenu(struct window* window); bool IsInventoryMenuState3(int window_id); -void CreateInventoryMenuOuter(int n_items,int param_2,int param_3,uint8_t *param_4,void *param_5,update_window_fn_t *param_6,uint param_7); +void CreateInventoryMenuOuter(int n_items,int param_2,int param_3,uint8_t *param_4,void *param_5,update_window_fn_t *param_6,uint32_t param_7); int GetEffectAnimationField0x19(int anim_id); bool AnimationHasMoreFrames(int param_1); struct effect_animation* GetEffectAnimation(int anim_id); diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 30f345d6..6f3ba46b 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -3490,7 +3490,7 @@ arm9: Retrieves the current Croagunk Swap Shop items as synth_template structs. r0: pointer to at least 8 synth_template structs - return: uint + return: uint32_t - name: PopCroagunkItem address: EU: 0x20131F8 @@ -12614,7 +12614,7 @@ arm9: r0: main_buffer r1: int32_t - r2: uint pointer + r2: uint32_t pointer return: main_buffer - name: CreateJobSummary address: From 2c6441bd9e5b0f0b3950a83dd9f5d5ada8b297f7 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Wed, 3 Jun 2026 01:17:25 -0400 Subject: [PATCH 026/117] Update arm9.h --- headers/functions/arm9.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index d41a23ae..901e0505 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -345,7 +345,7 @@ bool RecycleShopTradeIsNonspecific(struct recycle_item **param_1); bool RecycleShopOfferExists(void); void ClearRecycleShopOffer(void); uint32_t GetGameStateRecycleCount(void); -byte GetRankForRecycleShop(void); +struct rank_8 GetRankForRecycleShop(void); void IncrementRecycleCountVar(void); void UpdateRecycleShop(void); void DecrementRecycleOfferCooldown(void); @@ -845,7 +845,7 @@ void EventFlagBackupVeneer(void); void InitMainTeamAfterQuiz(void); void InitSpecialEpisodePartners(void); void InitSpecialEpisodeExtraPartner(void); -void AssignSpecialEpisodePc(int team_member_id,special_episode_pc *param_2); +void AssignSpecialEpisodePc(int team_member_id, struct special_episode_pc *param_2); void ReadStringSave(char* buf); bool CheckStringSave(const char* buf); int WriteSaveFile(undefined* save_info, undefined* buf, int size); From c26a2017351798f45232996437840664cd5554ef Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Wed, 3 Jun 2026 01:57:11 -0400 Subject: [PATCH 027/117] Let's see how badly it explodes. --- headers/data/arm9.h | 1 + headers/types/common/common.h | 153 ++++++ headers/types/ground_mode/enums.h | 35 ++ headers/types/ground_mode/ground_mode.h | 693 ++++++++++++++++++++++++ symbols/arm9.yml | 5 +- 5 files changed, 886 insertions(+), 1 deletion(-) diff --git a/headers/data/arm9.h b/headers/data/arm9.h index 9237957b..f1d0dc3b 100644 --- a/headers/data/arm9.h +++ b/headers/data/arm9.h @@ -59,6 +59,7 @@ extern enum item_id KECLEON_SHOP_ITEM_TABLE_LISTS_1[4]; extern enum item_id KECLEON_SHOP_ITEM_TABLE_LISTS_2[4]; extern struct exclusive_item_stat_boost_entry EXCLUSIVE_ITEM_STAT_BOOST_DATA[15]; extern struct exclusive_item_effect_entry EXCLUSIVE_ITEM_EFFECT_DATA[956]; +extern struct recycle_item recycle_item[24]; extern struct item_id_16 TYPE_SPECIFIC_EXCLUSIVE_ITEMS[17][4]; extern struct move_id_16 RECOIL_MOVE_LIST[11]; extern struct move_id_16 PUNCH_MOVE_LIST[16]; diff --git a/headers/types/common/common.h b/headers/types/common/common.h index 8d5a1a1c..69bf270b 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -1447,4 +1447,157 @@ struct bitstream { }; ASSERT_SIZE(struct bitstream, 16); +struct kec_shop_1 { + struct bulk_item field0_0x0[8]; +}; + +struct kec_shop_2 { + struct bulk_item field0_0x0[4]; +}; + +struct item_storage { + struct item_id_16 ids[1000]; + int16_t quantities[1000]; +}; + +struct item_bag { + struct item bag_items[50]; +}; + +struct game_state_values { + struct item_bag bag_items[3]; + struct item_bag *current_bag_ptr; + int8_t team_id; + undefined field3_0x389; + struct item_storage storage_items; + int8_t active_kec_shops; + undefined field6_0x132b; + struct bulk_item *active_kec_shop_1_ptr; + struct kec_shop_1 kec_shop_1_items[2]; // One inventory for main game, one for special episodes + struct bulk_item *active_kec_shop_2_ptr; + struct kec_shop_2 kec_shop_2_items[2]; // One inventory for main game, one for special episodes + uint32_t carry_gold[3]; // Copies 0x18 bits to save file (in a loop) + uint32_t bank_gold; // Copies 0x18 bits to save file (both in a loop and out of one) + struct monster_id_16 egg_species; // Copies 0xC bits to save file + undefined2 field14_0x13a6; // Copies 0xC bits to save file, read and written to by functions used in overlay 24. + uint16_t egg_hatch_timer; // Copies 0x8 bits to save file + enum rank guild_rank:8; // Copies 0x8 bits to save file? + undefined field17_0x13ab; + uint32_t recycle_count; // Copies 0x10 bits to save file + uint16_t recycle_offer_cooldown; // Copies 0x10 bits to save file + struct item_id_16 recycle_shop_offer; // Copies 0x10 bits to save file + undefined2 field_0x13b2; +}; +ASSERT_SIZE(game_state_values, 5044); + +struct diary_menu_main_menu_data { + int current_case_1; + int diary_type; + int next_case_1; + undefined field3_0xc; + undefined field4_0xd; + undefined field5_0xe; + undefined field6_0xf; + int num_options; + int loop_counter; + int advanced_menu_result; + undefined field10_0x1c; + undefined field11_0x1d; + undefined field12_0x1e; + undefined field13_0x1f; + undefined field14_0x20; + undefined field15_0x21; + undefined field16_0x22; + undefined field17_0x23; + char title_text_buffer[1024]; + char options_text_buffers[32][64]; + int frame_case_id; + struct preprocessor_args preprocessor_args; + undefined field22_0xc78; + undefined field23_0xc79; + undefined field24_0xc7a; + undefined field25_0xc7b; + int8_t advanced_menu_window_id; + int8_t dialogue_box_window_id; + undefined field28_0xc7e; + undefined field29_0xc7f; +}; +ASSERT_SIZE(struct diary_menu_main_menu_data, 1320); + +// mission_NPC_2 is misspelled to NCP02 in debug prints +struct mission_result_and_client { + int16_t mission_result; + struct monster_id_16 mission_NPC_1; + struct monster_id_16 mission_NPC_2; +}; +// TODO: size me! + +struct reward_overlay_data { + int16_t field_0x0; + int16_t is_egg_or_item; // This seems to determine whether this struct describes an egg or item. + int16_t item_or_recruit; // monster_id_16 of the recruit, or item_id_16 of the item. +}; +// TODO: size me! + +struct mission_substruct_1 { + struct dungeon_id_8 dungeon_id; + uint8_t floor; + undefined field_0x6; + undefined field_0x7; + int description_id; + uint8_t unique_map_id; + undefined field_0xd; + struct monster_id_16 client; + struct monster_id_16 target; + struct monster_id_16 outlaw_backup_species; + struct item_id_16 item_wanted; + struct mission_reward_type_8 reward_type; + undefined field_0x17; + struct item_id_16 item_reward; + struct mission_restriction_type_8 restriction_type; + undefined field_0x1b; + union mission_restriction restriction; + undefined field_0x1e; + undefined field_0x1f; +}; +// TODO: size me! + +struct misson_details { + undefined4 field_0x0; + undefined4 field_0x4; + struct mission_substruct_1 *mission_substruct_ptr; + char *temp_buffer_ptr; + struct monster_id_16 client; + struct monster_id_16 target; + struct item_id_16 reward_item; + struct item_id_16 item_wanted; + struct monster_id_16 client_ov26; + struct mission_reward_type_8 mission_reward_type_ov26; + undefined field_0x + int outlaw_leader_level; + int amount_money; + int num_items_to_roll; + struct reward_overlay_data reward_data[4]; + int mission_rank_points; + uint8_t params_1; + uint8_t params_2; + uint8_t objective; + undefined1 related_to_menu_str_index; + undefined1 menu_str_index; + struct mission_restriction_type_8 mission_restriction_kind; + union mission_restriction mission_restriction; + int8_t mission_restriction_type_id; + undefined field_0x + undefined field_0x + undefined field_0x + undefined4 field_0x + undefined2 field_0x + undefined2 field_0x + undefined4 field_0x + struct mission *mission_ptr; + struct mission_template *mission_template; + int8_t *rescue_mission_kind_ptr; +}; +// TODO: size me! + #endif diff --git a/headers/types/ground_mode/enums.h b/headers/types/ground_mode/enums.h index 6d937872..696c1e5f 100644 --- a/headers/types/ground_mode/enums.h +++ b/headers/types/ground_mode/enums.h @@ -2121,6 +2121,16 @@ enum rank { RANK_GUILDMASTER = 12, }; +// This is sometimes stored as a 16-bit integer +#pragma pack(push, 2) +ENUM_16_BIT(rank); +#pragma pack(pop) + +// This is sometimes stored as an 8-bit integer +#pragma pack(push, 1) +ENUM_8_BIT(rank); +#pragma pack(pop) + enum animation_speed { ANIMATION_SPEED_NORMAL = 0, ANIMATION_SPEED_SLOW = 1, @@ -2358,6 +2368,31 @@ enum drink_event_type { DRINK_EVENT_MIRACLE = 6, }; +enum recycle_main_menu_state { + REC_MMENU_UNK_0x0=0, + REC_MMENU_UNK_0x1=1, + REC_MMENU_UNK_0x2=2, + REC_MMENU_UNK_0x3=3, + REC_MMENU_UNK_0x4=4, + REC_MMENU_OFFER=5, + REC_MMENU_CLOSE_PORTRAIT=6, + REC_MMENU_INFO=7, + REC_MMENU_EXIT_DIALOGUE=8, + REC_MMENU_UNK_0x9=9, +}; + +typedef enum recycle_case_id { + RECYCLE_INIT_FIRST=0, + RECYCLE_INIT_RESUME=1, + RECYCLE_MAIN_CASE=2, + RECYCLE_EXIT_BEGIN=3, + RECYCLE_EXIT_CLOSE_PORTRAIT=4, + RECYCLE_EXIT_TO_SCRIPT=5, + RECYCLE_RESUME_FROM_SCRIPT=6, + RECYCLE_REDEEM_TICKET=7, + RECYCLE_UNK_SUSPEND_0x8=8, +}; + // These are super long, so split them out into a separate file #include "version_dep_enums.h" diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index 659d9984..3ce97ca7 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -1095,4 +1095,697 @@ struct spinda_cafe { }; ASSERT_SIZE(struct spinda_cafe, 2664); +struct recycle_item { + struct item_id_16 id; + undefined field1_0x2; + undefined field2_0x3; + int32_t trade_type; // 0x0 = Normal, 0x1 = Ticket, 0x2 = Offer + int32_t num_items_to_trade; // Exclusively for prize tickets, which do not have specific requirements + int32_t min_recycles; + int16_t field6_0x10; + struct rank_16 min_rank; + undefined field1_0x2; + undefined field2_0x3; + struct bulk_item traded_item_ids[4]; +}; +ASSERT_SIZE(struct recycle_item, 36); + +// Unclear why this needs to be different from recycle_item besides optimization... +// The "double pointers" to recycle_items could perhaps be recycle_item_data pointers. +struct recycle_item_data { + struct recycle_item *shop_item; + uint trade_type; + uint num_items_to_trade; + uint min_recycles; + int16_t field4_0x10; + int16_t field5_0x12; + struct bulk_item field6_0x14; +}; +ASSERT_SIZE(struct recycle_item_data, 24); + + +struct recycle_shop_main { + enum recycle_case_id case_id; + enum recycle_main_menu_state mmenu_case; + int init_neg_1; + int unk_subcase; + int init_zero; + int unk_counter_0x14; + int8_t portrait_window_id; + undefined field_0x19; + undefined field_0x1a; + undefined field_0x1b; + struct portrait_params portrait_params; + int8_t window_id_2; + int8_t window_id_3; + int8_t window_id_4; + undefined field_0x2f; + struct preprocessor_args preprocessor_args; + int recycle_trade_type; + struct recycle_item **recycle_items_ptr; + undefined field16_0x88; + undefined field17_0x89; + undefined field18_0x8a; + undefined field19_0x8b; + undefined field20_0x8c; + undefined field21_0x8d; + undefined field22_0x8e; + undefined field23_0x8f; + undefined field24_0x90; + undefined field25_0x91; + undefined field26_0x92; + undefined field27_0x93; + undefined field28_0x94; + undefined field29_0x95; + undefined field30_0x96; + undefined field31_0x97; + undefined field32_0x98; + undefined field33_0x99; + undefined field34_0x9a; + undefined field35_0x9b; + undefined4 field_0x9c; + undefined4 field_0xa0; + bool portrait_is_active; + bool resuming_menu; + bool portrait_is_hidden; + undefined field_0xa7; + struct item_id_16 item_id; + undefined field_0xaa; + undefined field_0xab; + undefined field_0xac; + undefined field_0xad; + undefined field_0xae; + undefined4 field_0xaf; + int8_t related_to_trade_type; + undefined field_0xb1; + undefined field_0xb2; + undefined field_0xb3; +}; + +struct recycle_offer_items { + struct recycle_item **item_ids_ptr; + int num_offers; +}; +ASSERT_SIZE(struct recycle_shop_main, 180); + +struct recycle_unk_struct_0x84 { + int case_id; + int subcase_id; + int field2_0x8; + int field3_0xc; + int field4_0x10; + int8_t text_box_window_ids[3]; + undefined fields_0x15[81]; + undefined field7_0x68; + undefined field8_0x69; + undefined field9_0x6a; + undefined field10_0x6b; + struct recycle_item *recycle_ite_ptr; + int16_t matching_items_bag[4]; + int16_t matching_items_storage[4]; + int16_t num_items_to_trade; + undefined field15_0x82; + undefined field16_0x83; +}; +ASSERT_SIZE(struct recycle_unk_struct_0x84, 132); + +struct recycle_unk_struct_0x340 { + int case_id; + int8_t simple_menu_wid_1; // Created by retype action + int8_t simple_menu_wid_2; // Created by retype action + int8_t scrollbox_window_id; // Created by retype action + undefined field4_0x7; + int simple_menu_1_result; + int smenu_1_result_old; + int starts_zero_1; + int starts_zero_2; + int8_t uhhhh; + undefined field10_0x19; + undefined field11_0x1a; + undefined field12_0x1b; + int arm9_unk_field; // Arm9LoadUnkFieldNa0x2029EC8 + int is_0xd; + int16_t text_string_id; + undefined field16_0x26; + undefined field17_0x27; + int field18_0x28; + undefined field19_0x2c; + undefined field20_0x2d; + undefined field21_0x2e; + undefined field22_0x2f; + undefined field23_0x30; + undefined field24_0x31; + undefined field25_0x32; + undefined field26_0x33; + undefined field27_0x34; + undefined field28_0x35; + undefined field29_0x36; + undefined field30_0x37; + undefined field31_0x38; + undefined field32_0x39; + undefined field33_0x3a; + undefined field34_0x3b; + undefined field35_0x3c; + undefined field36_0x3d; + undefined field37_0x3e; + undefined field38_0x3f; + undefined field39_0x40; + undefined field40_0x41; + undefined field41_0x42; + undefined field42_0x43; + undefined field43_0x44; + undefined field44_0x45; + undefined field45_0x46; + undefined field46_0x47; + undefined field47_0x48; + undefined field48_0x49; + undefined field49_0x4a; + undefined field50_0x4b; + undefined field51_0x4c; + undefined field52_0x4d; + undefined field53_0x4e; + undefined field54_0x4f; + undefined field55_0x50; + undefined field56_0x51; + undefined field57_0x52; + undefined field58_0x53; + undefined field59_0x54; + undefined field60_0x55; + undefined field61_0x56; + undefined field62_0x57; + undefined field63_0x58; + undefined field64_0x59; + undefined field65_0x5a; + undefined field66_0x5b; + undefined field67_0x5c; + undefined field68_0x5d; + undefined field69_0x5e; + undefined field70_0x5f; + undefined field71_0x60; + undefined field72_0x61; + undefined field73_0x62; + undefined field74_0x63; + undefined field75_0x64; + undefined field76_0x65; + undefined field77_0x66; + undefined field78_0x67; + undefined field79_0x68; + undefined field80_0x69; + undefined field81_0x6a; + undefined field82_0x6b; + undefined field83_0x6c; + undefined field84_0x6d; + undefined field85_0x6e; + undefined field86_0x6f; + undefined field87_0x70; + undefined field88_0x71; + undefined field89_0x72; + undefined field90_0x73; + undefined field91_0x74; + undefined field92_0x75; + undefined field93_0x76; + undefined field94_0x77; + undefined field95_0x78; + undefined field96_0x79; + undefined field97_0x7a; + undefined field98_0x7b; + undefined field99_0x7c; + undefined field100_0x7d; + undefined field101_0x7e; + undefined field102_0x7f; + undefined field103_0x80; + undefined field104_0x81; + undefined field105_0x82; + undefined field106_0x83; + undefined field107_0x84; + undefined field108_0x85; + undefined field109_0x86; + undefined field110_0x87; + undefined field111_0x88; + undefined field112_0x89; + undefined field113_0x8a; + undefined field114_0x8b; + undefined field115_0x8c; + undefined field116_0x8d; + undefined field117_0x8e; + undefined field118_0x8f; + int field119_0x90; + undefined field120_0x94; + undefined field121_0x95; + undefined field122_0x96; + undefined field123_0x97; + undefined field124_0x98; + undefined field125_0x99; + undefined field126_0x9a; + undefined field127_0x9b; + undefined field128_0x9c; + undefined field129_0x9d; + undefined field130_0x9e; + undefined field131_0x9f; + undefined field132_0xa0; + undefined field133_0xa1; + undefined field134_0xa2; + undefined field135_0xa3; + undefined field136_0xa4; + undefined field137_0xa5; + undefined field138_0xa6; + undefined field139_0xa7; + undefined field140_0xa8; + undefined field141_0xa9; + undefined field142_0xaa; + undefined field143_0xab; + undefined field144_0xac; + undefined field145_0xad; + undefined field146_0xae; + undefined field147_0xaf; + undefined field148_0xb0; + undefined field149_0xb1; + undefined field150_0xb2; + undefined field151_0xb3; + struct window_input_ctx window_input_ctx; + undefined field153_0x1ac; + undefined field154_0x1ad; + undefined field155_0x1ae; + undefined field156_0x1af; + undefined field157_0x1b0; + undefined field158_0x1b1; + undefined field159_0x1b2; + undefined field160_0x1b3; + undefined field161_0x1b4; + undefined field162_0x1b5; + undefined field163_0x1b6; + undefined field164_0x1b7; + undefined field165_0x1b8; + undefined field166_0x1b9; + undefined field167_0x1ba; + undefined field168_0x1bb; + undefined field169_0x1bc; + undefined field170_0x1bd; + undefined field171_0x1be; + undefined field172_0x1bf; + undefined field173_0x1c0; + undefined field174_0x1c1; + undefined field175_0x1c2; + undefined field176_0x1c3; + undefined field177_0x1c4; + undefined field178_0x1c5; + undefined field179_0x1c6; + undefined field180_0x1c7; + undefined field181_0x1c8; + undefined field182_0x1c9; + undefined field183_0x1ca; + undefined field184_0x1cb; + undefined field185_0x1cc; + undefined field186_0x1cd; + undefined field187_0x1ce; + undefined field188_0x1cf; + undefined field189_0x1d0; + undefined field190_0x1d1; + undefined field191_0x1d2; + undefined field192_0x1d3; + undefined field193_0x1d4; + undefined field194_0x1d5; + undefined field195_0x1d6; + undefined field196_0x1d7; + undefined field197_0x1d8; + undefined field198_0x1d9; + undefined field199_0x1da; + undefined field200_0x1db; + undefined field201_0x1dc; + undefined field202_0x1dd; + undefined field203_0x1de; + undefined field204_0x1df; + undefined field205_0x1e0; + undefined field206_0x1e1; + undefined field207_0x1e2; + undefined field208_0x1e3; + undefined field209_0x1e4; + undefined field210_0x1e5; + undefined field211_0x1e6; + undefined field212_0x1e7; + undefined field213_0x1e8; + undefined field214_0x1e9; + undefined field215_0x1ea; + undefined field216_0x1eb; + undefined field217_0x1ec; + undefined field218_0x1ed; + undefined field219_0x1ee; + undefined field220_0x1ef; + undefined field221_0x1f0; + undefined field222_0x1f1; + undefined field223_0x1f2; + undefined field224_0x1f3; + undefined field225_0x1f4; + undefined field226_0x1f5; + undefined field227_0x1f6; + undefined field228_0x1f7; + undefined field229_0x1f8; + undefined field230_0x1f9; + undefined field231_0x1fa; + undefined field232_0x1fb; + undefined field233_0x1fc; + undefined field234_0x1fd; + undefined field235_0x1fe; + undefined field236_0x1ff; + undefined field237_0x200; + undefined field238_0x201; + undefined field239_0x202; + undefined field240_0x203; + undefined field241_0x204; + undefined field242_0x205; + undefined field243_0x206; + undefined field244_0x207; + undefined field245_0x208; + undefined field246_0x209; + undefined field247_0x20a; + undefined field248_0x20b; + undefined field249_0x20c; + undefined field250_0x20d; + undefined field251_0x20e; + undefined field252_0x20f; + undefined field253_0x210; + undefined field254_0x211; + undefined field255_0x212; + undefined field256_0x213; + undefined field257_0x214; + undefined field258_0x215; + undefined field259_0x216; + undefined field260_0x217; + undefined field261_0x218; + undefined field262_0x219; + undefined field263_0x21a; + undefined field264_0x21b; + undefined field265_0x21c; + undefined field266_0x21d; + undefined field267_0x21e; + undefined field268_0x21f; + undefined field269_0x220; + undefined field270_0x221; + undefined field271_0x222; + undefined field272_0x223; + undefined field273_0x224; + undefined field274_0x225; + undefined field275_0x226; + undefined field276_0x227; + undefined field277_0x228; + undefined field278_0x229; + undefined field279_0x22a; + undefined field280_0x22b; + undefined field281_0x22c; + undefined field282_0x22d; + undefined field283_0x22e; + undefined field284_0x22f; + undefined field285_0x230; + undefined field286_0x231; + undefined field287_0x232; + undefined field288_0x233; + undefined field289_0x234; + undefined field290_0x235; + undefined field291_0x236; + undefined field292_0x237; + undefined field293_0x238; + undefined field294_0x239; + undefined field295_0x23a; + undefined field296_0x23b; + undefined field297_0x23c; + undefined field298_0x23d; + undefined field299_0x23e; + undefined field300_0x23f; + undefined field301_0x240; + undefined field302_0x241; + undefined field303_0x242; + undefined field304_0x243; + undefined field305_0x244; + undefined field306_0x245; + undefined field307_0x246; + undefined field308_0x247; + undefined field309_0x248; + undefined field310_0x249; + undefined field311_0x24a; + undefined field312_0x24b; + undefined field313_0x24c; + undefined field314_0x24d; + undefined field315_0x24e; + undefined field316_0x24f; + undefined field317_0x250; + undefined field318_0x251; + undefined field319_0x252; + undefined field320_0x253; + undefined field321_0x254; + undefined field322_0x255; + undefined field323_0x256; + undefined field324_0x257; + undefined field325_0x258; + undefined field326_0x259; + undefined field327_0x25a; + undefined field328_0x25b; + undefined field329_0x25c; + undefined field330_0x25d; + undefined field331_0x25e; + undefined field332_0x25f; + undefined field333_0x260; + undefined field334_0x261; + undefined field335_0x262; + undefined field336_0x263; + undefined field337_0x264; + undefined field338_0x265; + undefined field339_0x266; + undefined field340_0x267; + undefined field341_0x268; + undefined field342_0x269; + undefined field343_0x26a; + undefined field344_0x26b; + undefined field345_0x26c; + undefined field346_0x26d; + undefined field347_0x26e; + undefined field348_0x26f; + undefined field349_0x270; + undefined field350_0x271; + undefined field351_0x272; + undefined field352_0x273; + undefined field353_0x274; + undefined field354_0x275; + undefined field355_0x276; + undefined field356_0x277; + undefined field357_0x278; + undefined field358_0x279; + undefined field359_0x27a; + undefined field360_0x27b; + undefined field361_0x27c; + undefined field362_0x27d; + undefined field363_0x27e; + undefined field364_0x27f; + undefined field365_0x280; + undefined field366_0x281; + undefined field367_0x282; + undefined field368_0x283; + undefined field369_0x284; + undefined field370_0x285; + undefined field371_0x286; + undefined field372_0x287; + undefined field373_0x288; + undefined field374_0x289; + undefined field375_0x28a; + undefined field376_0x28b; + undefined field377_0x28c; + undefined field378_0x28d; + undefined field379_0x28e; + undefined field380_0x28f; + undefined field381_0x290; + undefined field382_0x291; + undefined field383_0x292; + undefined field384_0x293; + undefined field385_0x294; + undefined field386_0x295; + undefined field387_0x296; + undefined field388_0x297; + undefined field389_0x298; + undefined field390_0x299; + undefined field391_0x29a; + undefined field392_0x29b; + undefined field393_0x29c; + undefined field394_0x29d; + undefined field395_0x29e; + undefined field396_0x29f; + undefined field397_0x2a0; + undefined field398_0x2a1; + undefined field399_0x2a2; + undefined field400_0x2a3; + undefined field401_0x2a4; + undefined field402_0x2a5; + undefined field403_0x2a6; + undefined field404_0x2a7; + undefined field405_0x2a8; + undefined field406_0x2a9; + undefined field407_0x2aa; + undefined field408_0x2ab; + undefined field409_0x2ac; + undefined field410_0x2ad; + undefined field411_0x2ae; + undefined field412_0x2af; + undefined field413_0x2b0; + undefined field414_0x2b1; + undefined field415_0x2b2; + undefined field416_0x2b3; + undefined field417_0x2b4; + undefined field418_0x2b5; + undefined field419_0x2b6; + undefined field420_0x2b7; + undefined field421_0x2b8; + undefined field422_0x2b9; + undefined field423_0x2ba; + undefined field424_0x2bb; + undefined field425_0x2bc; + undefined field426_0x2bd; + undefined field427_0x2be; + undefined field428_0x2bf; + undefined field429_0x2c0; + undefined field430_0x2c1; + undefined field431_0x2c2; + undefined field432_0x2c3; + undefined field433_0x2c4; + undefined field434_0x2c5; + undefined field435_0x2c6; + undefined field436_0x2c7; + undefined field437_0x2c8; + undefined field438_0x2c9; + undefined field439_0x2ca; + undefined field440_0x2cb; + undefined field441_0x2cc; + undefined field442_0x2cd; + undefined field443_0x2ce; + undefined field444_0x2cf; + undefined field445_0x2d0; + undefined field446_0x2d1; + undefined field447_0x2d2; + undefined field448_0x2d3; + undefined field449_0x2d4; + undefined field450_0x2d5; + undefined field451_0x2d6; + undefined field452_0x2d7; + undefined field453_0x2d8; + undefined field454_0x2d9; + undefined field455_0x2da; + undefined field456_0x2db; + undefined field457_0x2dc; + undefined field458_0x2dd; + undefined field459_0x2de; + undefined field460_0x2df; + undefined field461_0x2e0; + undefined field462_0x2e1; + undefined field463_0x2e2; + undefined field464_0x2e3; + undefined field465_0x2e4; + undefined field466_0x2e5; + undefined field467_0x2e6; + undefined field468_0x2e7; + undefined field469_0x2e8; + undefined field470_0x2e9; + undefined field471_0x2ea; + undefined field472_0x2eb; + undefined field473_0x2ec; + undefined field474_0x2ed; + undefined field475_0x2ee; + undefined field476_0x2ef; + undefined field477_0x2f0; + undefined field478_0x2f1; + undefined field479_0x2f2; + undefined field480_0x2f3; + undefined field481_0x2f4; + undefined field482_0x2f5; + undefined field483_0x2f6; + undefined field484_0x2f7; + undefined field485_0x2f8; + undefined field486_0x2f9; + undefined field487_0x2fa; + undefined field488_0x2fb; + undefined field489_0x2fc; + undefined field490_0x2fd; + undefined field491_0x2fe; + undefined field492_0x2ff; + undefined field493_0x300; + undefined field494_0x301; + undefined field495_0x302; + undefined field496_0x303; + undefined field497_0x304; + undefined field498_0x305; + undefined field499_0x306; + undefined field500_0x307; + undefined field501_0x308; + undefined field502_0x309; + undefined field503_0x30a; + undefined field504_0x30b; + undefined field505_0x30c; + undefined field506_0x30d; + undefined field507_0x30e; + undefined field508_0x30f; + undefined field509_0x310; + undefined field510_0x311; + undefined field511_0x312; + undefined field512_0x313; + undefined field513_0x314; + undefined field514_0x315; + undefined field515_0x316; + undefined field516_0x317; + undefined field517_0x318; + undefined field518_0x319; + undefined field519_0x31a; + undefined field520_0x31b; + undefined field521_0x31c; + undefined field522_0x31d; + undefined field523_0x31e; + undefined field524_0x31f; + undefined field525_0x320; + undefined field526_0x321; + undefined field527_0x322; + undefined field528_0x323; + undefined field529_0x324; + undefined field530_0x325; + undefined field531_0x326; + undefined field532_0x327; + undefined field533_0x328; + undefined field534_0x329; + undefined field535_0x32a; + undefined field536_0x32b; + undefined field537_0x32c; + undefined field538_0x32d; + undefined field539_0x32e; + undefined field540_0x32f; + int simple_menu_2_result; + struct recycle_offer_items offer_items; + struct simple_menu_item *simple_menu_item_ptr; // Created by retype action +}; +ASSERT_SIZE(struct recycle_unk_struct_0x340, 832); + +// Likely used for selecting items you own between bag and storage. May be shared with the swap shop? +struct recycle_unk_struct_0x1cc { + int case_id; + int8_t collection_window_id; + int8_t simple_menu_window_id; + int8_t scroll_box_window_id; + int8_t textbox_window_id_1; + int8_t textbox_window_id_2; + undefined field_0x9; + undefined field_0xa; + undefined field_0xb; + int item_selection_index; + int item_selection_index_backup; + int starts_zero; + int also_starts_zero; + bool explain; + undefined field12_0x1d; + undefined field13_0x1e; + undefined field14_0x1f; + struct window_extra_info window_extra_info; + struct window_input_ctx window_input_ctx; + char *option_states; + int simple_menu_result; + struct owned_item **owned_items_list_ptr; + int num_items_required; + void *function_1; + void *function_2; + void *function_3; +}; +ASSERT_SIZE(struct recycle_unk_struct_0x1cc, 460); + #endif diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 6f3ba46b..d7ecbc7d 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -13170,7 +13170,10 @@ arm9: EU: 0x360 NA: 0x360 JP: 0x360 - description: "Note: unverified, ported from Irdkwia's notes" + description: |- + Table of recycle_item structs, used to track all possible trades in the recycle shop. + + type: recycle_item[24] - name: TYPE_SPECIFIC_EXCLUSIVE_ITEMS address: EU: 0x2099070 From 14ffe6403257751ba880a84b257cef82d4828443 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Wed, 3 Jun 2026 01:59:05 -0400 Subject: [PATCH 028/117] Update arm9.h --- headers/data/arm9.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/data/arm9.h b/headers/data/arm9.h index f1d0dc3b..0730361b 100644 --- a/headers/data/arm9.h +++ b/headers/data/arm9.h @@ -59,7 +59,7 @@ extern enum item_id KECLEON_SHOP_ITEM_TABLE_LISTS_1[4]; extern enum item_id KECLEON_SHOP_ITEM_TABLE_LISTS_2[4]; extern struct exclusive_item_stat_boost_entry EXCLUSIVE_ITEM_STAT_BOOST_DATA[15]; extern struct exclusive_item_effect_entry EXCLUSIVE_ITEM_EFFECT_DATA[956]; -extern struct recycle_item recycle_item[24]; +extern struct recycle_item RECYCLE_SHOP_ITEM_LIST[24]; extern struct item_id_16 TYPE_SPECIFIC_EXCLUSIVE_ITEMS[17][4]; extern struct move_id_16 RECOIL_MOVE_LIST[11]; extern struct move_id_16 PUNCH_MOVE_LIST[16]; From a6ab1f35c30bcbfbc1d5766539f757ad63a33cd5 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Wed, 3 Jun 2026 17:07:37 -0400 Subject: [PATCH 029/117] More fixes --- headers/types/common/common.h | 4 ++-- headers/types/ground_mode/enums.h | 2 +- headers/types/ground_mode/ground_mode.h | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index 69bf270b..fad5ab91 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -1481,7 +1481,7 @@ struct game_state_values { struct monster_id_16 egg_species; // Copies 0xC bits to save file undefined2 field14_0x13a6; // Copies 0xC bits to save file, read and written to by functions used in overlay 24. uint16_t egg_hatch_timer; // Copies 0x8 bits to save file - enum rank guild_rank:8; // Copies 0x8 bits to save file? + struct rank_8 guild_rank; // Copies 0x8 bits to save file? undefined field17_0x13ab; uint32_t recycle_count; // Copies 0x10 bits to save file uint16_t recycle_offer_cooldown; // Copies 0x10 bits to save file @@ -1522,7 +1522,7 @@ struct diary_menu_main_menu_data { undefined field28_0xc7e; undefined field29_0xc7f; }; -ASSERT_SIZE(struct diary_menu_main_menu_data, 1320); +ASSERT_SIZE(struct diary_menu_main_menu_data, 3200); // mission_NPC_2 is misspelled to NCP02 in debug prints struct mission_result_and_client { diff --git a/headers/types/ground_mode/enums.h b/headers/types/ground_mode/enums.h index 696c1e5f..30c19589 100644 --- a/headers/types/ground_mode/enums.h +++ b/headers/types/ground_mode/enums.h @@ -2381,7 +2381,7 @@ enum recycle_main_menu_state { REC_MMENU_UNK_0x9=9, }; -typedef enum recycle_case_id { +enum recycle_case_id { RECYCLE_INIT_FIRST=0, RECYCLE_INIT_RESUME=1, RECYCLE_MAIN_CASE=2, diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index 3ce97ca7..0ea6412c 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -1104,8 +1104,8 @@ struct recycle_item { int32_t min_recycles; int16_t field6_0x10; struct rank_16 min_rank; - undefined field1_0x2; - undefined field2_0x3; + undefined field1_0x12; + undefined field2_0x13; struct bulk_item traded_item_ids[4]; }; ASSERT_SIZE(struct recycle_item, 36); @@ -1114,9 +1114,9 @@ ASSERT_SIZE(struct recycle_item, 36); // The "double pointers" to recycle_items could perhaps be recycle_item_data pointers. struct recycle_item_data { struct recycle_item *shop_item; - uint trade_type; - uint num_items_to_trade; - uint min_recycles; + uint32_t trade_type; + uint32_t num_items_to_trade; + uint32_t min_recycles; int16_t field4_0x10; int16_t field5_0x12; struct bulk_item field6_0x14; From e3a34ecf4f0e681846b038ba4992d849a77d0beb Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Wed, 3 Jun 2026 18:23:35 -0400 Subject: [PATCH 030/117] More fixes, plus one new function --- headers/functions/arm9.h | 3 +- headers/types/common/enums.h | 26 +++++++++++++++ headers/types/ground_mode/enums.h | 26 --------------- headers/types/ground_mode/ground_mode.h | 44 +++++++++++++------------ symbols/arm9.yml | 10 +++++- 5 files changed, 60 insertions(+), 49 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 901e0505..3a546789 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -340,7 +340,8 @@ void WipeRecycleShopRecords(void); void FreeRecycleOfferItems(struct recycle_offer_items *param_1); enum item_id GetRecycleItemId(struct recycle_item **param_1); bool RecycleItemHasTradeTypePrizeTicket(struct recycle_item **param_1); -int CountTradedRecycleItems(struct recycle_item_data *param_1); +int16_t GetRecycleItemBonusOdds(struct recycle_item **param_1); +int CountTradedRecycleItems(struct recycle_item **param_1); bool RecycleShopTradeIsNonspecific(struct recycle_item **param_1); bool RecycleShopOfferExists(void); void ClearRecycleShopOffer(void); diff --git a/headers/types/common/enums.h b/headers/types/common/enums.h index 8d0122dc..b245dbfc 100644 --- a/headers/types/common/enums.h +++ b/headers/types/common/enums.h @@ -4346,4 +4346,30 @@ enum os_intr_mode { OS_INTRMODE_DISABLE_IRQ = 0x80 }; +enum rank { + RANK_NORMAL = 0, + RANK_BRONZE = 1, + RANK_SILVER = 2, + RANK_GOLD = 3, + RANK_DIAMOND = 4, + RANK_SUPER = 5, + RANK_ULTRA = 6, + RANK_HYPER = 7, + RANK_MASTER = 8, + RANK_MASTER_1_STAR = 9, + RANK_MASTER_2_STARS = 10, + RANK_MASTER_3_STARS = 11, + RANK_GUILDMASTER = 12, +}; + +// This is sometimes stored as a 16-bit integer +#pragma pack(push, 2) +ENUM_16_BIT(rank); +#pragma pack(pop) + +// This is sometimes stored as an 8-bit integer +#pragma pack(push, 1) +ENUM_8_BIT(rank); +#pragma pack(pop) + #endif diff --git a/headers/types/ground_mode/enums.h b/headers/types/ground_mode/enums.h index 30c19589..6071e48d 100644 --- a/headers/types/ground_mode/enums.h +++ b/headers/types/ground_mode/enums.h @@ -2105,32 +2105,6 @@ enum talk_kind { TALK_HERO_FEMALE = 5, }; -enum rank { - RANK_NORMAL = 0, - RANK_BRONZE = 1, - RANK_SILVER = 2, - RANK_GOLD = 3, - RANK_DIAMOND = 4, - RANK_SUPER = 5, - RANK_ULTRA = 6, - RANK_HYPER = 7, - RANK_MASTER = 8, - RANK_MASTER_1_STAR = 9, - RANK_MASTER_2_STARS = 10, - RANK_MASTER_3_STARS = 11, - RANK_GUILDMASTER = 12, -}; - -// This is sometimes stored as a 16-bit integer -#pragma pack(push, 2) -ENUM_16_BIT(rank); -#pragma pack(pop) - -// This is sometimes stored as an 8-bit integer -#pragma pack(push, 1) -ENUM_8_BIT(rank); -#pragma pack(pop) - enum animation_speed { ANIMATION_SPEED_NORMAL = 0, ANIMATION_SPEED_SLOW = 1, diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index 0ea6412c..e6bd46a0 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -1096,33 +1096,35 @@ struct spinda_cafe { ASSERT_SIZE(struct spinda_cafe, 2664); struct recycle_item { - struct item_id_16 id; - undefined field1_0x2; - undefined field2_0x3; + enum item_id id; int32_t trade_type; // 0x0 = Normal, 0x1 = Ticket, 0x2 = Offer - int32_t num_items_to_trade; // Exclusively for prize tickets, which do not have specific requirements + enum rank min_rank; // Vanilla prize tickets require a guild rank to unlock int32_t min_recycles; - int16_t field6_0x10; - struct rank_16 min_rank; - undefined field1_0x12; - undefined field2_0x13; - struct bulk_item traded_item_ids[4]; + // Some kind of key for which item to offer as a bonus after trading. + // 0x5: Prize Ticket, 0x8: Silver Ticket, 0xD: Gold Ticket, 0x14: Prism Ticket + int16_t bonus_item; + // Odds out of 100 to get that bonus item after trading. + int16_t bonus_odds; + struct bulk_item traded_items[4]; }; ASSERT_SIZE(struct recycle_item, 36); -// Unclear why this needs to be different from recycle_item besides optimization... -// The "double pointers" to recycle_items could perhaps be recycle_item_data pointers. -struct recycle_item_data { - struct recycle_item *shop_item; - uint32_t trade_type; - uint32_t num_items_to_trade; - uint32_t min_recycles; - int16_t field4_0x10; - int16_t field5_0x12; - struct bulk_item field6_0x14; +// This struct seems to only exist in RAM. More research into it's purpose may be necessary. +// Note that it has all the same fields as recycle_item, but compressed into far fewer bytes. +struct short_recycle_item { + struct item_id_16 id; + int8_t trade_type; // 0x0 = Normal, 0x1 = Ticket, 0x2 = Offer + struct rank_8 min_rank; + int16_t min_recycles; + // Some kind of key for which item to offer as a bonus after trading. + // 0x5: Prize Ticket, 0x8: Silver Ticket, 0xD: Gold Ticket, 0x14: Prism Ticket + int8_t bonus_item; + // Odds out of 100 to get that bonus item after trading. + int8_t bonus_odds; + int8_t traded_item_quantities[4]; + struct item_id_16 traded_item_ids[4]; }; -ASSERT_SIZE(struct recycle_item_data, 24); - +ASSERT_SIZE(struct short_recycle_item, 20); struct recycle_shop_main { enum recycle_case_id case_id; diff --git a/symbols/arm9.yml b/symbols/arm9.yml index d7ecbc7d..d5827760 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -3318,13 +3318,21 @@ arm9: r0: struct recycle_item double pointer return: 1 if trade_type is 1, 0 otherwise. + - name: GetRecycleItemBonusOdds + address: + EU: 0x2011EC0 + description: |- + Retrieves the odds of a recycle shop item to produce a bonus item when recycled. + + r0: struct recycle_item double pointer + return: Odds to produce a bonus item, out of 100. - name: CountTradedRecycleItems address: EU: 0x2011ECC description: |- Counts the number of valid traded_items in a recycle_item_data struct, effectively returning the number of specific items required to do the trade. - r0: struct recycle_item_data + r0: struct recycle_item double pointer return: number of items required for trade - name: RecycleShopTradeIsNonspecific address: From b47dc1194a77d3c298277b1d66f40e07a8ae93b1 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Wed, 3 Jun 2026 18:41:07 -0400 Subject: [PATCH 031/117] Maybe Fixes --- headers/types/common/common.h | 59 +++++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 23 deletions(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index fad5ab91..6c50cfd7 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -1448,47 +1448,52 @@ struct bitstream { ASSERT_SIZE(struct bitstream, 16); struct kec_shop_1 { - struct bulk_item field0_0x0[8]; + struct bulk_item items[8]; }; +ASSERT_SIZE(kec_shop_1, 32); struct kec_shop_2 { - struct bulk_item field0_0x0[4]; + struct bulk_item items[4]; }; +ASSERT_SIZE(kec_shop_2, 16); struct item_storage { struct item_id_16 ids[1000]; int16_t quantities[1000]; }; +ASSERT_SIZE(struct item_storage, 4000); struct item_bag { struct item bag_items[50]; }; +ASSERT_SIZE(struct item_bag, 300); struct game_state_values { struct item_bag bag_items[3]; struct item_bag *current_bag_ptr; int8_t team_id; - undefined field3_0x389; + undefined field3_0x389; // Likely padding. Not copied to save file. struct item_storage storage_items; int8_t active_kec_shops; - undefined field6_0x132b; + undefined field6_0x132b; // Likely padding. Not copied to save file. struct bulk_item *active_kec_shop_1_ptr; struct kec_shop_1 kec_shop_1_items[2]; // One inventory for main game, one for special episodes struct bulk_item *active_kec_shop_2_ptr; struct kec_shop_2 kec_shop_2_items[2]; // One inventory for main game, one for special episodes - uint32_t carry_gold[3]; // Copies 0x18 bits to save file (in a loop) - uint32_t bank_gold; // Copies 0x18 bits to save file (both in a loop and out of one) + uint32_t carry_gold[3]; // Copies 0x18 bits to save file (in a loop with bank_gold) + uint32_t bank_gold; // Copies 0x18 bits to save file (twice! once inside and once more outside the loop!) struct monster_id_16 egg_species; // Copies 0xC bits to save file undefined2 field14_0x13a6; // Copies 0xC bits to save file, read and written to by functions used in overlay 24. uint16_t egg_hatch_timer; // Copies 0x8 bits to save file struct rank_8 guild_rank; // Copies 0x8 bits to save file? - undefined field17_0x13ab; + undefined field17_0x13ab; // Likely padding. Not copied to save file. uint32_t recycle_count; // Copies 0x10 bits to save file uint16_t recycle_offer_cooldown; // Copies 0x10 bits to save file struct item_id_16 recycle_shop_offer; // Copies 0x10 bits to save file - undefined2 field_0x13b2; + undefined field_0x13b2; // Likely padding. Not copied to save file. + undefined field_0x13b3; // Likely padding. Not copied to save file. }; -ASSERT_SIZE(game_state_values, 5044); +ASSERT_SIZE(struct game_state_values, 5044); struct diary_menu_main_menu_data { int current_case_1; @@ -1529,15 +1534,23 @@ struct mission_result_and_client { int16_t mission_result; struct monster_id_16 mission_NPC_1; struct monster_id_16 mission_NPC_2; + // Padding, if these fields even exist. + undefined field_0x6; + undefined field_0x7; }; -// TODO: size me! +ASSERT_SIZE(struct mission_result_and_client, 8); + -struct reward_overlay_data { +// This substruct is exactly 0x6 bytes long. +#pragma pack(push, 2) +// May actually be a union of several 0x6 byte structs... +struct mission_reward_params { int16_t field_0x0; int16_t is_egg_or_item; // This seems to determine whether this struct describes an egg or item. int16_t item_or_recruit; // monster_id_16 of the recruit, or item_id_16 of the item. }; -// TODO: size me! +#pragma pack(pop) +ASSERT_SIZE(struct mission_reward_params, 6); struct mission_substruct_1 { struct dungeon_id_8 dungeon_id; @@ -1560,7 +1573,7 @@ struct mission_substruct_1 { undefined field_0x1e; undefined field_0x1f; }; -// TODO: size me! +ASSERT_SIZE(struct mission_substruct_1, 28); struct misson_details { undefined4 field_0x0; @@ -1573,11 +1586,11 @@ struct misson_details { struct item_id_16 item_wanted; struct monster_id_16 client_ov26; struct mission_reward_type_8 mission_reward_type_ov26; - undefined field_0x + undefined field_0x1b; int outlaw_leader_level; int amount_money; int num_items_to_roll; - struct reward_overlay_data reward_data[4]; + struct mission_reward_params reward_params[4]; int mission_rank_points; uint8_t params_1; uint8_t params_2; @@ -1587,17 +1600,17 @@ struct misson_details { struct mission_restriction_type_8 mission_restriction_kind; union mission_restriction mission_restriction; int8_t mission_restriction_type_id; - undefined field_0x - undefined field_0x - undefined field_0x - undefined4 field_0x - undefined2 field_0x - undefined2 field_0x - undefined4 field_0x + undefined field_0x4d; + undefined field_0x4e; + undefined field_0x4f; + undefined4 field_0x50; + undefined2 field_0x51; + undefined2 field_0x52; + undefined4 field_0x53; struct mission *mission_ptr; struct mission_template *mission_template; int8_t *rescue_mission_kind_ptr; }; -// TODO: size me! +ASSERT_SIZE(struct mission_details, 104); #endif From 57d8cce745ea97cddd1a8508ed98bf1421dfbe9d Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Wed, 3 Jun 2026 18:51:39 -0400 Subject: [PATCH 032/117] Fix Headers More --- headers/types/common/common.h | 27 ++++++++++++++++--------- headers/types/ground_mode/ground_mode.h | 7 +++++-- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index 6c50cfd7..957eea50 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -1450,12 +1450,12 @@ ASSERT_SIZE(struct bitstream, 16); struct kec_shop_1 { struct bulk_item items[8]; }; -ASSERT_SIZE(kec_shop_1, 32); +ASSERT_SIZE(struct kec_shop_1, 32); struct kec_shop_2 { struct bulk_item items[4]; }; -ASSERT_SIZE(kec_shop_2, 16); +ASSERT_SIZE(struct kec_shop_2, 16); struct item_storage { struct item_id_16 ids[1000]; @@ -1490,8 +1490,6 @@ struct game_state_values { uint32_t recycle_count; // Copies 0x10 bits to save file uint16_t recycle_offer_cooldown; // Copies 0x10 bits to save file struct item_id_16 recycle_shop_offer; // Copies 0x10 bits to save file - undefined field_0x13b2; // Likely padding. Not copied to save file. - undefined field_0x13b3; // Likely padding. Not copied to save file. }; ASSERT_SIZE(struct game_state_values, 5044); @@ -1580,12 +1578,13 @@ struct misson_details { undefined4 field_0x4; struct mission_substruct_1 *mission_substruct_ptr; char *temp_buffer_ptr; + // Maybe NPC1 and NPC2? Otherwise makes little sense why the client field is repeated... struct monster_id_16 client; struct monster_id_16 target; struct item_id_16 reward_item; struct item_id_16 item_wanted; - struct monster_id_16 client_ov26; - struct mission_reward_type_8 mission_reward_type_ov26; + struct monster_id_16 client_again; + struct mission_reward_type_8 mission_reward_type; undefined field_0x1b; int outlaw_leader_level; int amount_money; @@ -1603,10 +1602,18 @@ struct misson_details { undefined field_0x4d; undefined field_0x4e; undefined field_0x4f; - undefined4 field_0x50; - undefined2 field_0x51; - undefined2 field_0x52; - undefined4 field_0x53; + undefined field_0x50; + undefined field_0x51; + undefined field_0x52; + undefined field_0x53; + undefined field_0x54; + undefined field_0x55; + undefined field_0x56; + undefined field_0x57; + undefined field_0x58; + undefined field_0x59; + undefined field_0x5a; + undefined field_0x5b; struct mission *mission_ptr; struct mission_template *mission_template; int8_t *rescue_mission_kind_ptr; diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index e6bd46a0..cbb2a9b5 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -1167,9 +1167,12 @@ struct recycle_shop_main { undefined field35_0x9b; undefined4 field_0x9c; undefined4 field_0xa0; - bool portrait_is_active; + undefined field34_0xa1; + undefined field35_0xa2; + undefined4 field_0xa3; + bool portrait_active; bool resuming_menu; - bool portrait_is_hidden; + bool portrait_hidden; undefined field_0xa7; struct item_id_16 item_id; undefined field_0xaa; From d2cb266bc72845d41efa4e44ad3b5034101278f3 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Wed, 3 Jun 2026 19:05:54 -0400 Subject: [PATCH 033/117] test --- headers/types/common/common.h | 6 ++++-- headers/types/ground_mode/ground_mode.h | 27 ++++++++++++++++--------- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index 957eea50..ce283103 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -1594,14 +1594,15 @@ struct misson_details { uint8_t params_1; uint8_t params_2; uint8_t objective; - undefined1 related_to_menu_str_index; - undefined1 menu_str_index; + undefined related_to_menu_str_index; + int8_t menu_str_index; struct mission_restriction_type_8 mission_restriction_kind; union mission_restriction mission_restriction; int8_t mission_restriction_type_id; undefined field_0x4d; undefined field_0x4e; undefined field_0x4f; +/* undefined field_0x50; undefined field_0x51; undefined field_0x52; @@ -1617,6 +1618,7 @@ struct misson_details { struct mission *mission_ptr; struct mission_template *mission_template; int8_t *rescue_mission_kind_ptr; +*/ }; ASSERT_SIZE(struct mission_details, 104); diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index cbb2a9b5..1e933f88 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -1129,9 +1129,15 @@ ASSERT_SIZE(struct short_recycle_item, 20); struct recycle_shop_main { enum recycle_case_id case_id; enum recycle_main_menu_state mmenu_case; - int init_neg_1; + undefined field_0x8; + undefined field_0x9; + undefined field_0xa; + undefined field_0xb; int unk_subcase; - int init_zero; + undefined field_0x10; + undefined field_0x11; + undefined field_0x12; + undefined field_0x13; int unk_counter_0x14; int8_t portrait_window_id; undefined field_0x19; @@ -1144,7 +1150,7 @@ struct recycle_shop_main { undefined field_0x2f; struct preprocessor_args preprocessor_args; int recycle_trade_type; - struct recycle_item **recycle_items_ptr; + struct recycle_item *recycle_items_ptr; undefined field16_0x88; undefined field17_0x89; undefined field18_0x8a; @@ -1165,11 +1171,11 @@ struct recycle_shop_main { undefined field33_0x99; undefined field34_0x9a; undefined field35_0x9b; - undefined4 field_0x9c; - undefined4 field_0xa0; - undefined field34_0xa1; - undefined field35_0xa2; - undefined4 field_0xa3; + undefined field_0x9c; + undefined field_0xa0; + undefined field_0xa1; + undefined field_0xa2; + undefined field_0xa3; bool portrait_active; bool resuming_menu; bool portrait_hidden; @@ -1180,18 +1186,19 @@ struct recycle_shop_main { undefined field_0xac; undefined field_0xad; undefined field_0xae; - undefined4 field_0xaf; + undefined field_0xaf; int8_t related_to_trade_type; undefined field_0xb1; undefined field_0xb2; undefined field_0xb3; }; +ASSERT_SIZE(struct recycle_shop_main, 180); struct recycle_offer_items { struct recycle_item **item_ids_ptr; int num_offers; }; -ASSERT_SIZE(struct recycle_shop_main, 180); + struct recycle_unk_struct_0x84 { int case_id; From b37c8a28652bd142213e1cb359c29068e3fb2dc3 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Wed, 3 Jun 2026 19:07:19 -0400 Subject: [PATCH 034/117] ... --- headers/types/common/common.h | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index ce283103..08cf3364 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -1602,23 +1602,6 @@ struct misson_details { undefined field_0x4d; undefined field_0x4e; undefined field_0x4f; -/* - undefined field_0x50; - undefined field_0x51; - undefined field_0x52; - undefined field_0x53; - undefined field_0x54; - undefined field_0x55; - undefined field_0x56; - undefined field_0x57; - undefined field_0x58; - undefined field_0x59; - undefined field_0x5a; - undefined field_0x5b; - struct mission *mission_ptr; - struct mission_template *mission_template; - int8_t *rescue_mission_kind_ptr; -*/ }; ASSERT_SIZE(struct mission_details, 104); From 86a9b46a95fd75fe3292b7f8831e60e28f6b4cf5 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Wed, 3 Jun 2026 19:09:14 -0400 Subject: [PATCH 035/117] That was stupid... --- headers/types/common/common.h | 120 +++++----------------------------- 1 file changed, 16 insertions(+), 104 deletions(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index 08cf3364..8ccf59a2 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -870,109 +870,6 @@ struct mission_floors_forbidden { }; ASSERT_SIZE(struct mission_floors_forbidden, 2); -// Used throughout the process of displaying a mission -struct mission_details { - undefined field_0x0; - undefined field_0x1; - undefined field_0x2; - undefined field_0x3; - undefined field_0x4; - undefined field_0x5; - undefined field_0x6; - undefined field_0x7; - // 0x8: Pointer to "mission struct + 0x4" (new substruct?) - struct mission* mission_ptr; - undefined field_0xc; - undefined field_0xd; - undefined field_0xe; - undefined field_0xf; - undefined field_0x10; - undefined field_0x11; - undefined field_0x12; - undefined field_0x13; - undefined field_0x14; - undefined field_0x15; - undefined field_0x16; - undefined field_0x17; - undefined field_0x18; - undefined field_0x19; - undefined field_0x1a; - undefined field_0x1b; - undefined field_0x1c; - undefined field_0x1d; - undefined field_0x1e; - undefined field_0x1f; - undefined field_0x20; - undefined field_0x21; - undefined field_0x22; - undefined field_0x23; - undefined field_0x24; - undefined field_0x25; - undefined field_0x26; - undefined field_0x27; - undefined field_0x28; - undefined field_0x29; - undefined field_0x2a; - undefined field_0x2b; - undefined field_0x2c; - undefined field_0x2d; - undefined field_0x2e; - undefined field_0x2f; - undefined field_0x30; - undefined field_0x31; - undefined field_0x32; - undefined field_0x33; - undefined field_0x34; - undefined field_0x35; - undefined field_0x36; - undefined field_0x37; - undefined field_0x38; - undefined field_0x39; - undefined field_0x3a; - undefined field_0x3b; - undefined field_0x3c; - undefined field_0x3d; - undefined field_0x3e; - undefined field_0x3f; - undefined field_0x40; - undefined field_0x41; - undefined field_0x42; - undefined field_0x43; - undefined field_0x44; - undefined field_0x45; - undefined field_0x46; - undefined field_0x47; - // Used to pull a string from MISSION_MENU_STRING_IDS_1 - uint8_t mission_menu_string_index; - undefined field_0x49; - undefined field_0x4a; - undefined field_0x4b; - undefined field_0x4c; - undefined field_0x4d; - undefined field_0x4e; - undefined field_0x4f; - undefined field_0x50; - undefined field_0x51; - undefined field_0x52; - undefined field_0x53; - undefined field_0x54; - undefined field_0x55; - undefined field_0x56; - undefined field_0x57; - undefined field_0x58; - undefined field_0x59; - undefined field_0x5a; - undefined field_0x5b; - undefined field_0x5c; - undefined field_0x5d; - undefined field_0x5e; - undefined field_0x5f; - // 0x60: pointer to mission_template struct - struct mission_template* template_ptr; -}; -// mission_details is at least this big. Unclear how much bigger it actually is. -ASSERT_SIZE(struct mission_details, 100); - // Information about a valid mission; a list of these structs is stored in and directly loaded from // RESCUE/rescue.bin at 0x20, where 481 of these structs exist. These are used to select a string // from MISSION_STRING_IDS at random, to provide variance to mission flavor text. @@ -1573,7 +1470,7 @@ struct mission_substruct_1 { }; ASSERT_SIZE(struct mission_substruct_1, 28); -struct misson_details { +struct mission_details { undefined4 field_0x0; undefined4 field_0x4; struct mission_substruct_1 *mission_substruct_ptr; @@ -1602,6 +1499,21 @@ struct misson_details { undefined field_0x4d; undefined field_0x4e; undefined field_0x4f; + undefined field_0x50; + undefined field_0x51; + undefined field_0x52; + undefined field_0x53; + undefined field_0x54; + undefined field_0x55; + undefined field_0x56; + undefined field_0x57; + undefined field_0x58; + undefined field_0x59; + undefined field_0x5a; + undefined field_0x5b; + struct mission *mission_ptr; + struct mission_template *mission_template; + int8_t *rescue_mission_kind_ptr; }; ASSERT_SIZE(struct mission_details, 104); From 9406cc9cc5fb87ad166fdca6da0ce78899d55577 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Wed, 3 Jun 2026 19:12:37 -0400 Subject: [PATCH 036/117] Fix typo... --- headers/functions/arm9.h | 6 +++--- symbols/arm9.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 3a546789..176ca17f 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -1290,15 +1290,15 @@ bool ValidateLegendaryChallengeMission(struct mission_template* valid_mission_in int MatchMissionTemplateToMission(struct mission *param_1,undefined4 param_2); void AppendMissionTitle(char* main_buffer, char* temp_buffer, struct preprocessor_args* args, struct mission_details* details); -void FormatMissionHeader(char *buffer,struct misson_details *param_2); +void FormatMissionHeader(char *buffer,struct mission_details *param_2); void FormatSpecialEpisodeMissionHeader(char *param_1); void AppendMissionSummary(char* main_buffer, char* temp_buffer, int window_id, int y_offset, struct preprocessor_args* args, struct mission_details* details); -void MakeMissionDetails(struct misson_details *param_1,char *buffer,undefined param_3); +void MakeMissionDetails(struct mission_details *param_1,char *buffer,undefined param_3); void MakeSpecialEpisodeMissionDetails(struct mission_details, undefined param_2); undefined PrintWonderMailSkyCode(undefined param_1,undefined param_2,undefined param_3,undefined param_4); void AppendMissionObjective(char *param_1,int param_2,undefined4 param_3,uint32_t param_4,short param_5); -void AppendMissionDungeonLocation(struct misson_details *param_1,char *buffer,int param_3); +void AppendMissionDungeonLocation(struct mission_details *param_1,char *buffer,int param_3); bool SumValidMissionCategoryWeights(undefined4 mission_vendor); struct mission_template * GetRandomMissionTemplate(void); undefined4 LoadMissionTemplates(void); diff --git a/symbols/arm9.yml b/symbols/arm9.yml index d5827760..68973c9e 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -12239,7 +12239,7 @@ arm9: Can consist of a title, mission rank, mission status, dungeon, and floor. Some missions exclude some of these fields. r0: header buffer - r1: struct misson_details + r1: struct mission_details - name: FormatSpecialEpisodeMissionHeader address: EU: 0x20611A0 @@ -12270,7 +12270,7 @@ arm9: Can consist of a mission summary, client, objective, dungeon+floor, restrictions, difficulty, reward, and WMS code. Some missions exclude one or more of these fields. - r0: struct misson_details + r0: struct mission_details r1: buffer r2: ? - name: MakeSpecialEpisodeMissionDetails @@ -12307,7 +12307,7 @@ arm9: description: |- Generates the "Place: ..." string for MakeMissionDetails. - r0: misson_details pointer + r0: mission_details pointer r1: buffer r2: buffer size - name: SumValidMissionCategoryWeights From 5abc8ed3e740972efcffb33f297f7d8afa274a03 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Wed, 3 Jun 2026 19:34:12 -0400 Subject: [PATCH 037/117] Add more types --- headers/types/common/common.h | 67 ++++++++++++++++++++++++++++++----- headers/types/common/enums.h | 12 +++++++ 2 files changed, 70 insertions(+), 9 deletions(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index 8ccf59a2..1dd7744f 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -1390,6 +1390,20 @@ struct game_state_values { }; ASSERT_SIZE(struct game_state_values, 5044); + +struct special_episode_pc { + struct monster_id_16 species; + struct dungeon_id_8 met_location; + undefined field2_0x3; + struct move_id_16 move_ids[4]; + bool moves_fixed; + undefined field5_0xd; + int16_t level; + int16_t iq; + int16_t fixed_hp; +}; +ASSERT_SIZE(struct special_episode_pc, 20); + struct diary_menu_main_menu_data { int current_case_1; int diary_type; @@ -1470,24 +1484,30 @@ struct mission_substruct_1 { }; ASSERT_SIZE(struct mission_substruct_1, 28); +struct mission_reward_data { + struct monster_id_16 client; + struct mission_reward_type_8 mission_reward_type; + undefined field2_0x3; + int outlaw_leader_level; + int amount_money; + undefined4 num_items_to_roll; + struct mission_reward_params item_rewards[4]; + undefined field10_0x26; + undefined field11_0x27; + int mission_rank_points; +}; +ASSERT_SIZE(struct mission_reward_data, 44); + struct mission_details { undefined4 field_0x0; undefined4 field_0x4; struct mission_substruct_1 *mission_substruct_ptr; char *temp_buffer_ptr; - // Maybe NPC1 and NPC2? Otherwise makes little sense why the client field is repeated... struct monster_id_16 client; struct monster_id_16 target; struct item_id_16 reward_item; struct item_id_16 item_wanted; - struct monster_id_16 client_again; - struct mission_reward_type_8 mission_reward_type; - undefined field_0x1b; - int outlaw_leader_level; - int amount_money; - int num_items_to_roll; - struct mission_reward_params reward_params[4]; - int mission_rank_points; + struct mission_reward_data reward_data; uint8_t params_1; uint8_t params_2; uint8_t objective; @@ -1517,4 +1537,33 @@ struct mission_details { }; ASSERT_SIZE(struct mission_details, 104); +// This struct is exactly 0x6 bytes long. +#pragma pack(push, 2) +struct mission_reward_dialogue_sequence { + int16_t case_id; + struct preprocessor_flags preprocessor_flags; + uint16_t text_string_id; +}; +#pragma pack(pop) +ASSERT_SIZE(struct mission_reward_dialogue_sequence, 6); + +struct mission_reward_struct_overlay { + enum mission_reward_frame_update_case case_id; + int8_t dialogue_box_window_id; + int8_t portrait_box_window_id; + undefined2 field_0x6; + struct preprocessor_args dialogue_box_preprocessor_args; + int frame_counter; + int npc_count; + struct mission_reward_data reward_data; + int8_t scen_1; + undefined field_0x8d; + undefined field_0x8e; + undefined field_0x8f; + struct mission *mission_ptr; + struct mission_reward_dialogue_sequence *mission_dialogue_params_ptr; + int subtype; +}; +ASSERT_SIZE(struct mission_reward_struct_overlay, 156); + #endif diff --git a/headers/types/common/enums.h b/headers/types/common/enums.h index b245dbfc..b936ec7e 100644 --- a/headers/types/common/enums.h +++ b/headers/types/common/enums.h @@ -4372,4 +4372,16 @@ ENUM_16_BIT(rank); ENUM_8_BIT(rank); #pragma pack(pop) +enum mission_reward_frame_update_case { + CASE_ENTRY=0, + CASE_INIT_DIALOGUE=1, + CASE_DIALOGUE_END=2, + CASE_WAIT_10_FRAMES=3, + CASE_INIT_REWARD_STRUCT=4, + CASE_CONTINUE_REWARD_DATA=5, + CASE_RUN_DESTRUCTOR=6, + CASE_EXIT=7, + // There are more, seems like it goes up to case 21 +}; + #endif From f5a1006fc1452492a10947f530aba73eefae8baf Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Wed, 3 Jun 2026 19:39:17 -0400 Subject: [PATCH 038/117] Fix Sizes --- headers/types/common/common.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index 1dd7744f..4f59197c 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -1492,8 +1492,6 @@ struct mission_reward_data { int amount_money; undefined4 num_items_to_roll; struct mission_reward_params item_rewards[4]; - undefined field10_0x26; - undefined field11_0x27; int mission_rank_points; }; ASSERT_SIZE(struct mission_reward_data, 44); From ac09593131670c9bebcdf3f9798220533d5982b9 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Wed, 3 Jun 2026 19:46:46 -0400 Subject: [PATCH 039/117] ... --- headers/types/ground_mode/ground_mode.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index 1e933f88..1e1d1b04 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -1172,6 +1172,9 @@ struct recycle_shop_main { undefined field34_0x9a; undefined field35_0x9b; undefined field_0x9c; + undefined field_0x9d; + undefined field_0x9e; + undefined field_0x9f; undefined field_0xa0; undefined field_0xa1; undefined field_0xa2; From b8e574f90bf1577ce3b87b477c6f6ba2a524becc Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Wed, 3 Jun 2026 21:35:22 -0400 Subject: [PATCH 040/117] Fix Syntax --- headers/data/arm9.h | 2 +- headers/data/overlay26.h | 2 +- headers/functions/arm9.h | 91 +++++++++++++------------ headers/functions/overlay10.h | 3 +- headers/functions/overlay20.h | 17 ++--- headers/functions/overlay26.h | 13 ++-- headers/types/common/common.h | 40 +++++------ headers/types/common/enums.h | 16 ++--- headers/types/ground_mode/enums.h | 38 +++++------ headers/types/ground_mode/ground_mode.h | 34 ++++----- symbols/arm9.yml | 80 +++++++++++----------- symbols/overlay11.yml | 18 ++--- symbols/overlay20.yml | 28 ++++---- symbols/overlay26.yml | 50 +++++++------- 14 files changed, 222 insertions(+), 210 deletions(-) diff --git a/headers/data/arm9.h b/headers/data/arm9.h index 0730361b..a10565f6 100644 --- a/headers/data/arm9.h +++ b/headers/data/arm9.h @@ -246,7 +246,7 @@ extern render_3d_element_64_fn_t RENDER_3D_FUNCTIONS_64[8]; extern int16_t TBL_TALK_GROUP_STRING_ID_START[6]; extern struct menu_control* MENU_CONTROL_PTR; extern int16_t KEYBOARD_STRING_IDS[30]; -extern struct mission_reward_struct_main * MISSION_REWARD_STRUCT_MAIN_PTR; +extern struct mission_reward_struct_main* MISSION_REWARD_STRUCT_MAIN_PTR; extern bool NOTIFY_NOTE; extern struct monster_id_16 DEFAULT_HERO_ID; extern struct monster_id_16 DEFAULT_PARTNER_ID; diff --git a/headers/data/overlay26.h b/headers/data/overlay26.h index c5017f68..083887fc 100644 --- a/headers/data/overlay26.h +++ b/headers/data/overlay26.h @@ -17,7 +17,7 @@ extern char DEBUG_CONQUEST_COUNT_STR[54]; extern char DEBUG_DEAD_COUNT_STR[50]; extern char DEBUG_NO_COUNT_STR[48]; extern undefined4 OV26_STATIC_INITIALIZER; -extern struct mission_reward_struct_overlay * MISSION_REWARD_OVERLAY_STRUCT_PTR; +extern struct mission_reward_struct_overlay* MISSION_REWARD_OVERLAY_STRUCT_PTR; extern undefined* APPLY_RULE_DUNGEON_EFFECTS_STRUCT_PTR; extern undefined* EXIT_DUNGEON_1_STRUCT_PTR; extern undefined* EXIT_DUNGEON_2_STRUCT_PTR; diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 176ca17f..87e4c3b8 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -337,12 +337,12 @@ void ApplyGummiBoostsGroundMode(struct monster_id_16* monster_id, uint16_t* mons enum item_id item_id, bool not_boost_stats, struct gummi_result* gummi_result); void WipeRecycleShopRecords(void); -void FreeRecycleOfferItems(struct recycle_offer_items *param_1); -enum item_id GetRecycleItemId(struct recycle_item **param_1); -bool RecycleItemHasTradeTypePrizeTicket(struct recycle_item **param_1); -int16_t GetRecycleItemBonusOdds(struct recycle_item **param_1); -int CountTradedRecycleItems(struct recycle_item **param_1); -bool RecycleShopTradeIsNonspecific(struct recycle_item **param_1); +void FreeRecycleOfferItems(struct recycle_offer_items* param_1); +enum item_id GetRecycleItemId(struct recycle_item** param_1); +bool RecycleItemHasTradeTypePrizeTicket(struct recycle_item** param_1); +int16_t GetRecycleItemBonusOdds(struct recycle_item** param_1); +int CountTradedRecycleItems(struct recycle_item** param_1); +bool RecycleShopTradeIsNonspecific(struct recycle_item** param_1); bool RecycleShopOfferExists(void); void ClearRecycleShopOffer(void); uint32_t GetGameStateRecycleCount(void); @@ -353,11 +353,11 @@ void DecrementRecycleOfferCooldown(void); bool IsRecycleOfferCooldownOver(void); int GetRecycleOfferCooldown(void); bool RecycleShopIsNotThrownItem(enum item_id param_1); -bool RecycleShopIsTradableItem(enum item_id param_1,bool param_2); +bool RecycleShopIsTradableItem(enum item_id param_1, bool param_2); int RecycleShopCountTradableItemsInBag(bool param_1); int RecycleShopCountTradableItemsInStorage(bool param_1); -int CountValidRecycleShopItems(int filter,uint32_t recycles,enum rank rank); -bool IsRecycleTradeTypeValid(int param_1,int param_2); +int CountValidRecycleShopItems(int filter, uint32_t recycles, enum rank rank); +bool IsRecycleTradeTypeValid(int param_1, int param_2); void ClearCroagunkItems(void); bool LoadSynthBin(void); void CloseSynthBin(void); @@ -615,7 +615,8 @@ void LoadTblTalk(void); int GetTalkLine(int personality_idx, enum talk_type talk_type, int restrictions); bool IsAOrBPressed(void); void DrawTextInWindow(int window_id, int x, int y, char* string); -void AppendStandardStringToMission(undefined4 param_1, undefined4 param_2, undefined4 param_3, int string_id); +void AppendStandardStringToMission(undefined4 param_1, undefined4 param_2, undefined4 param_3, + int string_id); uint8_t GetCharWidth(char symbol); int GetColorCodePaletteOffset(char symbol); uint8_t DrawChar(int window_id, int x, int y, char symbol, int color_offset); @@ -846,7 +847,7 @@ void EventFlagBackupVeneer(void); void InitMainTeamAfterQuiz(void); void InitSpecialEpisodePartners(void); void InitSpecialEpisodeExtraPartner(void); -void AssignSpecialEpisodePc(int team_member_id, struct special_episode_pc *param_2); +void AssignSpecialEpisodePc(int team_member_id, struct special_episode_pc* param_2); void ReadStringSave(char* buf); bool CheckStringSave(const char* buf); int WriteSaveFile(undefined* save_info, undefined* buf, int size); @@ -980,7 +981,7 @@ void MissionToWonderMailPassword(char* password, struct mission* mission_data); void SetEnterDungeon(enum dungeon_id dungeon_id); void InitDungeonInit(struct dungeon_init* dungeon_init_data, enum dungeon_id dungeon_id); bool IsNoLossPenaltyDungeon(enum dungeon_id dungeon_id); -bool MissionRewardValidateDungeonId(struct dungeon_id_8 *param_1); +bool MissionRewardValidateDungeonId(struct dungeon_id_8* param_1); undefined CheckMissionRestrictions(undefined param_1); bool TilesetSecondaryTerrainIsChasm(int16_t tileset_id); int GetNbFloors(enum dungeon_id dungeon_id); @@ -1170,16 +1171,16 @@ bool DexNumbersEqual(enum monster_id monster1, enum monster_id monster2); bool GendersEqual(enum monster_id monster1, enum monster_id monster2); bool GendersEqualNotGenderless(enum monster_id monster1, enum monster_id monster2); bool GendersNotEqualNotGenderless(enum monster_id monster1, enum monster_id monster2); -void ModifyHpStat(int16_t *stat_ptr,int32_t amount); -void ModifyOffensiveStat(int8_t *stat_ptr,int32_t amount); -void ModifyDefensiveStat(int8_t *stat_ptr,int32_t amount); -void ModifyIqStat(int16_t *stat_ptr,int32_t amount); +void ModifyHpStat(int16_t* stat_ptr, int32_t amount); +void ModifyOffensiveStat(int8_t* stat_ptr, int32_t amount); +void ModifyDefensiveStat(int8_t* stat_ptr, int32_t amount); +void ModifyIqStat(int16_t* stat_ptr, int32_t amount); bool IsMonsterOnTeam(enum monster_id monster_id, int recruit_strategy); void GetNbRecruited(undefined* recruit); bool IsValidTeamMember(int member_idx); bool IsMainCharacter(int member_idx); struct ground_monster* GetTeamMember(int member_idx); -int GetRecruitMentryIdBySpecies(enum monster_id param_1,int param_2); +int GetRecruitMentryIdBySpecies(enum monster_id param_1, int param_2); int GetHeroMemberIdx(void); int GetPartnerMemberIdx(void); int GetMainCharacter1MemberIdx(void); @@ -1207,10 +1208,10 @@ void RemoveActiveMembersFromMainTeam(void); void SetTeamSetupHeroAndPartnerOnly(void); void SetTeamSetupHeroOnly(void); int GetPartyMembers(uint16_t* party_members); -int GetAdventureNpcIds(struct monster_id_16* param_1); +int GetAdventureNpcIds(struct monster_id_16* param_1); int GetUnitNpcIds(struct monster_id_16* param_1); void RefillTeam(void); -void ValidateTeamMembers(bool *param_1); +void ValidateTeamMembers(bool* param_1); int ClearItem(int team_id, bool check); void ChangeGiratinaFormIfSkyDungeon(enum dungeon_id dungeon_id); void RevertGiratinaAndShaymin(uint8_t member_idx, undefined param_2); @@ -1250,13 +1251,14 @@ int GetSosMailCount(int param_1, bool param_2); bool IsMissionSuspendedAndValid(struct mission* mission); bool AreMissionsEquivalent(struct mission* mission1, struct mission* mission2); bool IsMissionValid(struct mission* mission); -bool CheckMonsterForMissionType(enum mission_type type,int * subtype, enum monster_id target, bool param_4); -bool CheckItemForMissionType(enum mission_type type,int * subtype, enum item_id param_3); +bool CheckMonsterForMissionType(enum mission_type type, int* subtype, enum monster_id target, + bool param_4); +bool CheckItemForMissionType(enum mission_type type, int* subtype, enum item_id param_3); enum mission_generation_result GenerateMission(undefined* param_1, struct mission* mission_data); -int CountAndPopulateValidMissionTableMonsters(undefined4 *param_1,undefined4 *param_2); +int CountAndPopulateValidMissionTableMonsters(undefined4* param_1, undefined4* param_2); bool IsMissionTypeSpecialEpisode(struct mission* mission); -bool DoesMissionHaveTypeAndSubtype(struct mission, struct mission_type_8* type, int * subtype); -bool AlreadyHasSimilarMission(struct mission_type_8* type, int8_t * subtype_8); +bool DoesMissionHaveTypeAndSubtype(struct mission, struct mission_type_8* type, int* subtype); +bool AlreadyHasSimilarMission(struct mission_type_8* type, int8_t* subtype_8); void GenerateDailyMissions(void); bool AlreadyHaveMission(struct mission* mission); int CountJobListMissions(void); @@ -1265,7 +1267,8 @@ int DungeonRequestsDoneWrapper(uint8_t param_1); bool AnyDungeonRequestsDone(uint8_t param_1); bool AddMissionToJobList(struct mission* mission); struct mission* GetAcceptedMission(uint8_t mission_id); -bool WasMissionCompletedToday(struct mission_result_and_client *param_1,struct mission *param_2,enum mission_type param_3); +bool WasMissionCompletedToday(struct mission_result_and_client* param_1, struct mission* param_2, + enum mission_type param_3); int GetMissionByTypeAndDungeon(int start_index, enum mission_type mission_type, undefined* subtype_struct, enum dungeon_id dungeon_id); bool CheckAcceptedMissionByTypeAndDungeon(enum mission_type mission_type, undefined* subtype_struct, @@ -1278,8 +1281,8 @@ void DeleteAllPossibleDungeonsList(void); int GenerateAllPossibleDeliverList(void); void DeleteAllPossibleDeliverList(void); void ClearMissionData(struct mission* mission); -int GetMissionSpecificFixedRoom(enum mission_type type,int subtype); -int8_t SelectRandomFixedRoomInRange(int8_t * fixed_rooms,int max); +int GetMissionSpecificFixedRoom(enum mission_type type, int subtype); +int8_t SelectRandomFixedRoomInRange(int8_t* fixed_rooms, int max); void ReadRescueBinFile(void); void GenerateMissionDetailsStruct(struct mission* mission, struct mission_details* details, undefined param_3, undefined param_4); @@ -1287,20 +1290,22 @@ bool ValidateNormalChallengeMission(struct mission_template* valid_mission_info, struct mission* mission); bool ValidateLegendaryChallengeMission(struct mission_template* valid_mission_info, struct mission* mission); -int MatchMissionTemplateToMission(struct mission *param_1,undefined4 param_2); +int MatchMissionTemplateToMission(struct mission* param_1, undefined4 param_2); void AppendMissionTitle(char* main_buffer, char* temp_buffer, struct preprocessor_args* args, struct mission_details* details); -void FormatMissionHeader(char *buffer,struct mission_details *param_2); -void FormatSpecialEpisodeMissionHeader(char *param_1); +void FormatMissionHeader(char* buffer, struct mission_details* param_2); +void FormatSpecialEpisodeMissionHeader(char* param_1); void AppendMissionSummary(char* main_buffer, char* temp_buffer, int window_id, int y_offset, struct preprocessor_args* args, struct mission_details* details); -void MakeMissionDetails(struct mission_details *param_1,char *buffer,undefined param_3); +void MakeMissionDetails(struct mission_details* param_1, char* buffer, undefined param_3); void MakeSpecialEpisodeMissionDetails(struct mission_details, undefined param_2); -undefined PrintWonderMailSkyCode(undefined param_1,undefined param_2,undefined param_3,undefined param_4); -void AppendMissionObjective(char *param_1,int param_2,undefined4 param_3,uint32_t param_4,short param_5); -void AppendMissionDungeonLocation(struct mission_details *param_1,char *buffer,int param_3); +undefined PrintWonderMailSkyCode(undefined param_1, undefined param_2, undefined param_3, + undefined param_4); +void AppendMissionObjective(char* param_1, int param_2, undefined4 param_3, uint32_t param_4, + short param_5); +void AppendMissionDungeonLocation(struct mission_details* param_1, char* buffer, int param_3); bool SumValidMissionCategoryWeights(undefined4 mission_vendor); -struct mission_template * GetRandomMissionTemplate(void); +struct mission_template* GetRandomMissionTemplate(void); undefined4 LoadMissionTemplates(void); bool IsMonsterMissionAllowed(enum monster_id monster_id); bool CanMonsterBeUsedForMissionWrapper(enum monster_id monster_id); @@ -1311,13 +1316,14 @@ bool CanDungeonBeUsedForMission(enum dungeon_id dungeon_id); int8_t GetMissionRankWithCapAndModifiers(void); int8_t GetMissionRankWithCapAndModifiersAndCap(void); bool CanSendItem(enum item_id item_id, bool to_sky); -void InitMissionReward(struct mission *param_1,struct mission_reward_data *param_2,undefined4 param_3,undefined4 param_4); -void RollRandomItemReward(undefined4 param_1,undefined4 param_2, struct item_id_16 *param_3); -void GenerateMissionRewards(struct mission *MissionPtr,int IsCafeMission); +void InitMissionReward(struct mission* param_1, struct mission_reward_data* param_2, + undefined4 param_3, undefined4 param_4); +void RollRandomItemReward(undefined4 param_1, undefined4 param_2, struct item_id_16* param_3); +void GenerateMissionRewards(struct mission* MissionPtr, int IsCafeMission); undefined4 CheckDungeonMissionUnlockConditions(enum dungeon_id param_1); bool IsAvailableItem(enum item_id item_id); int GetAvailableItemDeliveryList(undefined* item_buffer); -void ZeroInitMissionRewardDataStruct(struct mission_reward_data *param_1); +void ZeroInitMissionRewardDataStruct(struct mission_reward_data* param_1); enum monster_id GetScriptEntityMonsterId(enum script_entity_id entity_id); int GetScriptEntityMatchingStorageId(enum script_entity_id entity_id); void SetActorTalkMainAndActorTalkSub(enum script_entity_id actor_id_main, @@ -1325,12 +1331,13 @@ void SetActorTalkMainAndActorTalkSub(enum script_entity_id actor_id_main, void SetActorTalkMain(enum script_entity_id actor_id); void SetActorTalkSub(enum script_entity_id actor_id); void SetActorEventMain(undefined2 param_1); -void SetRandomRequestNpcs1And2(undefined2 param_1,undefined2 param_2); -void SetAllEventNpcs(undefined2 param_1,undefined2 param_2,undefined2 param_3,undefined2 param_4); +void SetRandomRequestNpcs1And2(undefined2 param_1, undefined2 param_2); +void SetAllEventNpcs(undefined2 param_1, undefined2 param_2, undefined2 param_3, + undefined2 param_4); void RandomizeDemoActors(void); void ItemAtTableIdx(int idx, struct bulk_item* item); void MainLoop(void); -char * ChooseMissionTitle(char *main_buffer,int param_2,uint32_t *param_3); +char* ChooseMissionTitle(char* main_buffer, int param_2, uint32_t* param_3); void CreateJobSummary(struct mission* mission, int param_2); int DungeonSwapIdToIdx(enum dungeon_id dungeon_id); enum dungeon_id DungeonSwapIdxToId(int idx); diff --git a/headers/functions/overlay10.h b/headers/functions/overlay10.h index 1504931a..8aa3603b 100644 --- a/headers/functions/overlay10.h +++ b/headers/functions/overlay10.h @@ -12,7 +12,8 @@ bool CheckInventoryMenuField0x1A0(int window_id); uint8_t PopInventoryMenuField0x1A3(int window_id); void UpdateInventoryMenu(struct window* window); bool IsInventoryMenuState3(int window_id); -void CreateInventoryMenuOuter(int n_items,int param_2,int param_3,uint8_t *param_4,void *param_5,update_window_fn_t *param_6,uint32_t param_7); +void CreateInventoryMenuOuter(int n_items, int param_2, int param_3, uint8_t* param_4, + void* param_5, update_window_fn_t* param_6, uint32_t param_7); int GetEffectAnimationField0x19(int anim_id); bool AnimationHasMoreFrames(int param_1); struct effect_animation* GetEffectAnimation(int anim_id); diff --git a/headers/functions/overlay20.h b/headers/functions/overlay20.h index 9508751e..3ca4e14e 100644 --- a/headers/functions/overlay20.h +++ b/headers/functions/overlay20.h @@ -1,23 +1,24 @@ #ifndef HEADERS_FUNCTIONS_OVERLAY20_H_ #define HEADERS_FUNCTIONS_OVERLAY20_H_ - - undefined4 RecycleShopEntryPointFirst(void); undefined4 RecycleShopEntryPointResume(void); void RecycleShopDestructor(void); undefined4 RecycleShopFrameUpdate(void); undefined4 RecycleShopCommonEntryPoint(bool resuming_menu); void PrintWynautTextbox(int strind_id); -void PrintWynautSimpleMenu(struct recycle_shop_main *param_1,undefined4 string_id,struct simple_menu_id_item *param_3); -void RecycleShopTryHidePortraitBox(struct recycle_shop_main *param_1,bool param_2); -void PrintWynautNormalPortrait(struct recycle_shop_main *param_1); -void RecycleShopClosePortraitBox(struct recycle_shop_main *param_1); +void PrintWynautSimpleMenu(struct recycle_shop_main* param_1, undefined4 string_id, + struct simple_menu_id_item* param_3); +void RecycleShopTryHidePortraitBox(struct recycle_shop_main* param_1, bool param_2); +void PrintWynautNormalPortrait(struct recycle_shop_main* param_1); +void RecycleShopClosePortraitBox(struct recycle_shop_main* param_1); void RecycleShopCloseAllWindows(void); undefined4 RecycleShopHandleTopScreenWindow(void); void RecycleShopTopScreenDrawItemStats(int param_1); void RecycleShopTopScreenDrawItemName(int window_id); -void RecycleShopTopScreenDrawInfoWindow(int param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4); -void DisplaySelectionTutorialWindow(int window_id,undefined4 param_2,undefined4 param_3,undefined4 param_4); +void RecycleShopTopScreenDrawInfoWindow(int param_1, undefined4 param_2, undefined4 param_3, + undefined4 param_4); +void DisplaySelectionTutorialWindow(int window_id, undefined4 param_2, undefined4 param_3, + undefined4 param_4); #endif \ No newline at end of file diff --git a/headers/functions/overlay26.h b/headers/functions/overlay26.h index d4d3a5f2..394a9335 100644 --- a/headers/functions/overlay26.h +++ b/headers/functions/overlay26.h @@ -1,21 +1,24 @@ #ifndef HEADERS_FUNCTIONS_OVERLAY26_H_ #define HEADERS_FUNCTIONS_OVERLAY26_H_ - undefined4 MissionRewardOverlayEntryPoint(void); void MissionRewardOverlayDestructor(void); undefined4 MissionRewardOverlayFrameUpdate(void); void MissionRewardClosePortraitAndDialogueBox(void); -undefined4 ApplyRuleDungeonEffectsEntryPoint(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4); +undefined4 ApplyRuleDungeonEffectsEntryPoint(undefined4 param_1, undefined4 param_2, + undefined4 param_3, undefined4 param_4); void ApplyRuleDungeonEffectsDestructor(void); undefined4 ApplyRuleDungeonEffectsFrameUpdate(void); -undefined4 ExitDungeon1EntryPoint(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4); +undefined4 ExitDungeon1EntryPoint(undefined4 param_1, undefined4 param_2, undefined4 param_3, + undefined4 param_4); void ExitDungeon1Destructor(void); undefined4 ExitDungeon1FrameUpdate(void); -undefined4 UnkOv26EntryPoint0238b754EU(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4); +undefined4 UnkOv26EntryPoint0238b754EU(undefined4 param_1, undefined4 param_2, undefined4 param_3, + undefined4 param_4); void UnkOv26Destructor0238b780EU(void); undefined4 UnkOv26FrameUpdate0238b7acEU(void); -undefined4 DungeonExitEntryPoint2(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4); +undefined4 DungeonExitEntryPoint2(undefined4 param_1, undefined4 param_2, undefined4 param_3, + undefined4 param_4); void DungeonExitDestructor2(void); undefined4 DungeonExitFrameUpdate2(void); diff --git a/headers/types/common/common.h b/headers/types/common/common.h index 4f59197c..15b3f6b9 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -1367,30 +1367,31 @@ ASSERT_SIZE(struct item_bag, 300); struct game_state_values { struct item_bag bag_items[3]; - struct item_bag *current_bag_ptr; + struct item_bag* current_bag_ptr; int8_t team_id; undefined field3_0x389; // Likely padding. Not copied to save file. struct item_storage storage_items; int8_t active_kec_shops; undefined field6_0x132b; // Likely padding. Not copied to save file. - struct bulk_item *active_kec_shop_1_ptr; + struct bulk_item* active_kec_shop_1_ptr; struct kec_shop_1 kec_shop_1_items[2]; // One inventory for main game, one for special episodes - struct bulk_item *active_kec_shop_2_ptr; + struct bulk_item* active_kec_shop_2_ptr; struct kec_shop_2 kec_shop_2_items[2]; // One inventory for main game, one for special episodes uint32_t carry_gold[3]; // Copies 0x18 bits to save file (in a loop with bank_gold) - uint32_t bank_gold; // Copies 0x18 bits to save file (twice! once inside and once more outside the loop!) + uint32_t bank_gold; // Copies 0x18 bits to save file (twice! once inside and once more outside + // the loop!) struct monster_id_16 egg_species; // Copies 0xC bits to save file - undefined2 field14_0x13a6; // Copies 0xC bits to save file, read and written to by functions used in overlay 24. - uint16_t egg_hatch_timer; // Copies 0x8 bits to save file - struct rank_8 guild_rank; // Copies 0x8 bits to save file? - undefined field17_0x13ab; // Likely padding. Not copied to save file. - uint32_t recycle_count; // Copies 0x10 bits to save file - uint16_t recycle_offer_cooldown; // Copies 0x10 bits to save file + undefined2 field14_0x13a6; // Copies 0xC bits to save file, read and written to by functions + // used in overlay 24. + uint16_t egg_hatch_timer; // Copies 0x8 bits to save file + struct rank_8 guild_rank; // Copies 0x8 bits to save file? + undefined field17_0x13ab; // Likely padding. Not copied to save file. + uint32_t recycle_count; // Copies 0x10 bits to save file + uint16_t recycle_offer_cooldown; // Copies 0x10 bits to save file struct item_id_16 recycle_shop_offer; // Copies 0x10 bits to save file }; ASSERT_SIZE(struct game_state_values, 5044); - struct special_episode_pc { struct monster_id_16 species; struct dungeon_id_8 met_location; @@ -1449,13 +1450,12 @@ struct mission_result_and_client { }; ASSERT_SIZE(struct mission_result_and_client, 8); - // This substruct is exactly 0x6 bytes long. #pragma pack(push, 2) // May actually be a union of several 0x6 byte structs... struct mission_reward_params { int16_t field_0x0; - int16_t is_egg_or_item; // This seems to determine whether this struct describes an egg or item. + int16_t is_egg_or_item; // This seems to determine whether this struct describes an egg or item. int16_t item_or_recruit; // monster_id_16 of the recruit, or item_id_16 of the item. }; #pragma pack(pop) @@ -1499,8 +1499,8 @@ ASSERT_SIZE(struct mission_reward_data, 44); struct mission_details { undefined4 field_0x0; undefined4 field_0x4; - struct mission_substruct_1 *mission_substruct_ptr; - char *temp_buffer_ptr; + struct mission_substruct_1* mission_substruct_ptr; + char* temp_buffer_ptr; struct monster_id_16 client; struct monster_id_16 target; struct item_id_16 reward_item; @@ -1529,9 +1529,9 @@ struct mission_details { undefined field_0x59; undefined field_0x5a; undefined field_0x5b; - struct mission *mission_ptr; - struct mission_template *mission_template; - int8_t *rescue_mission_kind_ptr; + struct mission* mission_ptr; + struct mission_template* mission_template; + int8_t* rescue_mission_kind_ptr; }; ASSERT_SIZE(struct mission_details, 104); @@ -1558,8 +1558,8 @@ struct mission_reward_struct_overlay { undefined field_0x8d; undefined field_0x8e; undefined field_0x8f; - struct mission *mission_ptr; - struct mission_reward_dialogue_sequence *mission_dialogue_params_ptr; + struct mission* mission_ptr; + struct mission_reward_dialogue_sequence* mission_dialogue_params_ptr; int subtype; }; ASSERT_SIZE(struct mission_reward_struct_overlay, 156); diff --git a/headers/types/common/enums.h b/headers/types/common/enums.h index b936ec7e..891dd7d7 100644 --- a/headers/types/common/enums.h +++ b/headers/types/common/enums.h @@ -4373,14 +4373,14 @@ ENUM_8_BIT(rank); #pragma pack(pop) enum mission_reward_frame_update_case { - CASE_ENTRY=0, - CASE_INIT_DIALOGUE=1, - CASE_DIALOGUE_END=2, - CASE_WAIT_10_FRAMES=3, - CASE_INIT_REWARD_STRUCT=4, - CASE_CONTINUE_REWARD_DATA=5, - CASE_RUN_DESTRUCTOR=6, - CASE_EXIT=7, + CASE_ENTRY = 0, + CASE_INIT_DIALOGUE = 1, + CASE_DIALOGUE_END = 2, + CASE_WAIT_10_FRAMES = 3, + CASE_INIT_REWARD_STRUCT = 4, + CASE_CONTINUE_REWARD_DATA = 5, + CASE_RUN_DESTRUCTOR = 6, + CASE_EXIT = 7, // There are more, seems like it goes up to case 21 }; diff --git a/headers/types/ground_mode/enums.h b/headers/types/ground_mode/enums.h index 6071e48d..edab74dd 100644 --- a/headers/types/ground_mode/enums.h +++ b/headers/types/ground_mode/enums.h @@ -2343,28 +2343,28 @@ enum drink_event_type { }; enum recycle_main_menu_state { - REC_MMENU_UNK_0x0=0, - REC_MMENU_UNK_0x1=1, - REC_MMENU_UNK_0x2=2, - REC_MMENU_UNK_0x3=3, - REC_MMENU_UNK_0x4=4, - REC_MMENU_OFFER=5, - REC_MMENU_CLOSE_PORTRAIT=6, - REC_MMENU_INFO=7, - REC_MMENU_EXIT_DIALOGUE=8, - REC_MMENU_UNK_0x9=9, + REC_MMENU_UNK_0x0 = 0, + REC_MMENU_UNK_0x1 = 1, + REC_MMENU_UNK_0x2 = 2, + REC_MMENU_UNK_0x3 = 3, + REC_MMENU_UNK_0x4 = 4, + REC_MMENU_OFFER = 5, + REC_MMENU_CLOSE_PORTRAIT = 6, + REC_MMENU_INFO = 7, + REC_MMENU_EXIT_DIALOGUE = 8, + REC_MMENU_UNK_0x9 = 9, }; enum recycle_case_id { - RECYCLE_INIT_FIRST=0, - RECYCLE_INIT_RESUME=1, - RECYCLE_MAIN_CASE=2, - RECYCLE_EXIT_BEGIN=3, - RECYCLE_EXIT_CLOSE_PORTRAIT=4, - RECYCLE_EXIT_TO_SCRIPT=5, - RECYCLE_RESUME_FROM_SCRIPT=6, - RECYCLE_REDEEM_TICKET=7, - RECYCLE_UNK_SUSPEND_0x8=8, + RECYCLE_INIT_FIRST = 0, + RECYCLE_INIT_RESUME = 1, + RECYCLE_MAIN_CASE = 2, + RECYCLE_EXIT_BEGIN = 3, + RECYCLE_EXIT_CLOSE_PORTRAIT = 4, + RECYCLE_EXIT_TO_SCRIPT = 5, + RECYCLE_RESUME_FROM_SCRIPT = 6, + RECYCLE_REDEEM_TICKET = 7, + RECYCLE_UNK_SUSPEND_0x8 = 8, }; // These are super long, so split them out into a separate file diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index 1e1d1b04..1c36119f 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -1098,13 +1098,13 @@ ASSERT_SIZE(struct spinda_cafe, 2664); struct recycle_item { enum item_id id; int32_t trade_type; // 0x0 = Normal, 0x1 = Ticket, 0x2 = Offer - enum rank min_rank; // Vanilla prize tickets require a guild rank to unlock + enum rank min_rank; // Vanilla prize tickets require a guild rank to unlock int32_t min_recycles; // Some kind of key for which item to offer as a bonus after trading. // 0x5: Prize Ticket, 0x8: Silver Ticket, 0xD: Gold Ticket, 0x14: Prism Ticket int16_t bonus_item; // Odds out of 100 to get that bonus item after trading. - int16_t bonus_odds; + int16_t bonus_odds; struct bulk_item traded_items[4]; }; ASSERT_SIZE(struct recycle_item, 36); @@ -1120,7 +1120,7 @@ struct short_recycle_item { // 0x5: Prize Ticket, 0x8: Silver Ticket, 0xD: Gold Ticket, 0x14: Prism Ticket int8_t bonus_item; // Odds out of 100 to get that bonus item after trading. - int8_t bonus_odds; + int8_t bonus_odds; int8_t traded_item_quantities[4]; struct item_id_16 traded_item_ids[4]; }; @@ -1150,7 +1150,7 @@ struct recycle_shop_main { undefined field_0x2f; struct preprocessor_args preprocessor_args; int recycle_trade_type; - struct recycle_item *recycle_items_ptr; + struct recycle_item* recycle_items_ptr; undefined field16_0x88; undefined field17_0x89; undefined field18_0x8a; @@ -1198,11 +1198,10 @@ struct recycle_shop_main { ASSERT_SIZE(struct recycle_shop_main, 180); struct recycle_offer_items { - struct recycle_item **item_ids_ptr; + struct recycle_item** item_ids_ptr; int num_offers; }; - struct recycle_unk_struct_0x84 { int case_id; int subcase_id; @@ -1215,7 +1214,7 @@ struct recycle_unk_struct_0x84 { undefined field8_0x69; undefined field9_0x6a; undefined field10_0x6b; - struct recycle_item *recycle_ite_ptr; + struct recycle_item* recycle_ite_ptr; int16_t matching_items_bag[4]; int16_t matching_items_storage[4]; int16_t num_items_to_trade; @@ -1226,8 +1225,8 @@ ASSERT_SIZE(struct recycle_unk_struct_0x84, 132); struct recycle_unk_struct_0x340 { int case_id; - int8_t simple_menu_wid_1; // Created by retype action - int8_t simple_menu_wid_2; // Created by retype action + int8_t simple_menu_wid_1; // Created by retype action + int8_t simple_menu_wid_2; // Created by retype action int8_t scrollbox_window_id; // Created by retype action undefined field4_0x7; int simple_menu_1_result; @@ -1768,12 +1767,13 @@ struct recycle_unk_struct_0x340 { undefined field540_0x32f; int simple_menu_2_result; struct recycle_offer_items offer_items; - struct simple_menu_item *simple_menu_item_ptr; // Created by retype action + struct simple_menu_item* simple_menu_item_ptr; // Created by retype action }; ASSERT_SIZE(struct recycle_unk_struct_0x340, 832); -// Likely used for selecting items you own between bag and storage. May be shared with the swap shop? -struct recycle_unk_struct_0x1cc { +// Likely used for selecting items you own between bag and storage. May be shared with the swap +// shop? +struct recycle_unk_struct_0x1cc { int case_id; int8_t collection_window_id; int8_t simple_menu_window_id; @@ -1793,13 +1793,13 @@ struct recycle_unk_struct_0x1cc { undefined field14_0x1f; struct window_extra_info window_extra_info; struct window_input_ctx window_input_ctx; - char *option_states; + char* option_states; int simple_menu_result; - struct owned_item **owned_items_list_ptr; + struct owned_item** owned_items_list_ptr; int num_items_required; - void *function_1; - void *function_2; - void *function_3; + void* function_1; + void* function_2; + void* function_3; }; ASSERT_SIZE(struct recycle_unk_struct_0x1cc, 460); diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 68973c9e..3ef19517 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -2906,7 +2906,7 @@ arm9: description: |- Seems to get unknown field 0x13a6 of GAME_STATE_VALUES. Only known to be called by overlay 24, Chansey Daycare. - return: undefined2 + return: undefined2 - name: SetUnkGameState0x13a6 address: EU: 0x201086C @@ -2921,7 +2921,7 @@ arm9: Seems to get the number of days until the current egg in Chansey Daycare hatches from GAME_STATE_VALUES. Appears to be entirely unused, in favor of DecementEggHatchTimer. - return: uint16_t + return: uint16_t - name: SetEggHatchTimer address: EU: 0x201089C @@ -3134,7 +3134,7 @@ arm9: description: |- Seems to call MemFree on *param_1 and **param_1, with a safety check that the **param_1 isn't zero. Only known XREF is to SwapShopInventoryManager, so a more specific purpose for this function may exist. - + r0: double pointer to free - name: ApplyGummiBoostsToGroundMonster address: @@ -3317,13 +3317,13 @@ arm9: Checks if the trade_type of a recycle_item is 1, indicating that the item uses the trade method for prize tickets. r0: struct recycle_item double pointer - return: 1 if trade_type is 1, 0 otherwise. + return: 1 if trade_type is 1, 0 otherwise. - name: GetRecycleItemBonusOdds address: EU: 0x2011EC0 description: |- Retrieves the odds of a recycle shop item to produce a bonus item when recycled. - + r0: struct recycle_item double pointer return: Odds to produce a bonus item, out of 100. - name: CountTradedRecycleItems @@ -3342,7 +3342,7 @@ arm9: Unclear how this differs in functionally from RecycleItemHasTradeTypePrizeTicket, as they conditions they check fully overlap in vanilla. r0: recycle_item double pointer - return: 1 if the traded item is 1400, 0 if not. + return: 1 if the traded item is 1400, 0 if not. - name: RecycleShopOfferExists address: EU: 0x2011F90 @@ -3448,7 +3448,7 @@ arm9: description: |- Loops through the RECYCLE_SHOP_ITEM_LIST, counting the number of valid recycle shop trades. Filters each entry by guild rank, minimum recycle count, and a specified filter on trade type. - + r0: trade filter. 3 to not exclude by trade type, else see IsRecycleTradeTypeValid. r1: number of recycles @@ -3460,7 +3460,7 @@ arm9: description: |- Uses the following logic to check if a recycle trade type fits a trade filter. return not ((filter != type) && ((filter != 0 || (type == 2)))) - + r0: trade filter. 2 to whitelist offers, 1 to blacklist offers, 0 to blacklist offer and prize ticket trade types. r1: trade_type return: 1 if the item is valid, 0 if not. @@ -3498,7 +3498,7 @@ arm9: Retrieves the current Croagunk Swap Shop items as synth_template structs. r0: pointer to at least 8 synth_template structs - return: uint32_t + return: uint32_t - name: PopCroagunkItem address: EU: 0x20131F8 @@ -3506,21 +3506,21 @@ arm9: Tries to pop an item by id from Croagunk Swap Shop items. r0: item_id - return: 1 if the item was found, 0 if not. + return: 1 if the item was found, 0 if not. - name: LoadCroagunkItems address: EU: 0x2013238 description: |- Seems to load the Croagunk Swap Shop items from the save file. - return: undefined4 + return: undefined4 - name: SaveCroagunkItems address: EU: 0x2013298 description: |- Seems to store the Croagunk Swap Shop items to the save file. - return: undefined4 + return: undefined4 - name: GetSynthItem address: EU: 0x20132F8 @@ -9167,7 +9167,7 @@ arm9: If so, stores the dungeon id from $DUNGEON_ENTER_INDEX to a pointer. r0: dungeon_id_8* (return) - return: 1 if the dungeon pulled from script variables is valid for mission rewards, 0 otherwise. + return: 1 if the dungeon pulled from script variables is valid for mission rewards, 0 otherwise. - name: CheckMissionRestrictions address: EU: 0x204F6FC @@ -9264,9 +9264,9 @@ arm9: r1: Struct containing the dungeon ID and floor number - name: GetMissionRank address: - EU: - - 0x204FB4C + EU: - 0x204FAE0 + - 0x204FB4C NA: 0x204F814 JP: 0x204FB68 description: |- @@ -11485,8 +11485,8 @@ arm9: EU: 0x2058440 description: |- Fills out a table of 4 bools for whether each member of the active team is valid. - - r0: bool* (Points to at least 4 bools) + + r0: bool* (Points to at least 4 bools) - name: ClearItem address: EU: 0x205856C @@ -11929,11 +11929,11 @@ arm9: EU: 0x205E604 description: |- Checks if a specified mission has a specified mission_type and subtype. More general than AreMissionsEquivalent. - + r0: mission pointer r1: mission_type pointer r2: mission_subtype pointer - return: 1 if the player already has this mission, 0 if not. + return: 1 if the player already has this mission, 0 if not. - name: AlreadyHasSimilarMission address: EU: 0x205E634 @@ -11943,7 +11943,7 @@ arm9: r0: mission_type pointer r1: mission_subtype pointer - return: 1 if the player already has this mission, 0 if not. + return: 1 if the player already has this mission, 0 if not. - name: GenerateDailyMissions address: EU: 0x205E94C @@ -12032,11 +12032,11 @@ arm9: Runs a series of mission_type specific checks to determine if the mission really was completed today, before running mission rewards. Examples of checks include: Being in the right dungeon, and having a specific item or item within a treasure box in the bag. Also seems to initialize the mission_result_and_client struct's NPC fields to correctly fit the mission_type. - + r0: struct mission_result_and_client r1: struct mission r2: enum mission_type - return: 1 if the mission was completed, 0 if not. + return: 1 if the mission was completed, 0 if not. - name: GetMissionByTypeAndDungeon address: EU: 0x205F728 @@ -12414,7 +12414,7 @@ arm9: description: |- Calls GetMissionRank, then adds one to the rank if the mission requires escorting a client, or defeating an outlaw. Before returning, caps the mission rank at 15 (9 stars). - + r0: dungeon_floor_pair pointer r1: mission_type return: mission rank @@ -12472,9 +12472,9 @@ arm9: EU: 0x2063710 description: |- Checks if a specified dungeon is eligible to be unlocked by a mission. - + r0: dungeon_id - return: 3 if the dungeon is not in MISSION_DUNGEON_UNLOCK_TABLE, 2 if the dungeon is open or entered, 1 if $SCENARIO_BALANCE_FLAG is not large enough, and 0 otherwise. + return: 3 if the dungeon is not in MISSION_DUNGEON_UNLOCK_TABLE, 2 if the dungeon is open or entered, 1 if $SCENARIO_BALANCE_FLAG is not large enough, and 0 otherwise. - name: IsAvailableItem address: EU: 0x20637D8 @@ -12569,7 +12569,7 @@ arm9: description: |- Sets ACTOR_REQUEST_NPC01 and ACTOR_REQUEST_NPC02 to specific actor_ids. Has no impact on ACTOR_REQUEST_NPC03. - + r0: ACTOR_REQUEST_NPC01 actor_id r1: ACTOR_REQUEST_NPC02 actor_id - name: SetAllEventNpcs @@ -13180,7 +13180,7 @@ arm9: JP: 0x360 description: |- Table of recycle_item structs, used to track all possible trades in the recycle shop. - + type: recycle_item[24] - name: TYPE_SPECIFIC_EXCLUSIVE_ITEMS address: @@ -14159,7 +14159,7 @@ arm9: EU: 0x5 description: |- Table of fixed room ids used by the MISSION_ARREST_OUTLAW and MISSION_OUTLAW_HIDEOUT type and subtype. - + type: uint8_t - name: CHALLENGE_NORMAL_FIXED_ROOM_IDS address: @@ -14168,7 +14168,7 @@ arm9: EU: 0x5 description: |- Table of fixed room ids used by the MISSION_CHALLENGE_REQUEST and MISSION_CHALLENGE_NORMAL type and subtype. - + type: uint8_t - name: TACTICS_FOLLOW_LEADER address: @@ -14180,16 +14180,6 @@ arm9: NA: 0xC JP: 0xC description: "Array of boolean values corresponding to each tactic_id enum, determining whether the tactic makes party members follow the leader." - - name: TREASURE_MEMO_FIXED_ROOM_IDS - address: - EU: 0x20A1EDC - length: - EU: 0x1E - description: |- - Table of fixed room ids used by the MISSION_TREASURE_MEMO type. - The last 15 entries only show up after the postgame (performance flag 9). - - type: uint8_t - name: FORBIDDEN_FORGOT_MOVE_LIST address: EU: 0x20A1E9C @@ -14224,6 +14214,16 @@ arm9: NA: 0x18 JP: 0x18 description: "type: int16_t[12]" + - name: TREASURE_MEMO_FIXED_ROOM_IDS + address: + EU: 0x20A1EDC + length: + EU: 0x1E + description: |- + Table of fixed room ids used by the MISSION_TREASURE_MEMO type. + The last 15 entries only show up after the postgame (performance flag 9). + + type: uint8_t - name: CLIENT_LEVEL_TABLE address: EU: 0x20A1EFC @@ -15497,7 +15497,7 @@ arm9: description: |- Points to a mission_reward_struct_main struct, responsible for handling the overlay 11 portion of the mission reward sequence. Is also used sparingly during the Spinda Cafe egg event. - + type: mission_reward_struct_main - name: NOTIFY_NOTE address: diff --git a/symbols/overlay11.yml b/symbols/overlay11.yml index db13ab9b..9a7383b8 100644 --- a/symbols/overlay11.yml +++ b/symbols/overlay11.yml @@ -201,7 +201,7 @@ overlay11: EU: 0x22E77CC description: |- Returns control to the scripting engine for a message_menu, with a specified case_id. - + r0: case id to pass to the scripting engine - name: IsScriptMenuReturnDisabled address: @@ -1497,7 +1497,7 @@ overlay11: description: |- Seems to be the entry_point for a "mini-overlay" overlay_load_entry that lives in overlay 11, that controls eating gummis in the overworld. - return: undefined4 + return: undefined4 - name: EatOverworldGummiDestructor address: EU: 0x22FFCB8 @@ -1511,7 +1511,7 @@ overlay11: description: |- Seems to be the frame_update for a "mini-overlay" overlay_load_entry that lives in overlay 11, that controls eating gummis in the overworld. - return: undefined4 + return: undefined4 - name: CreateTopGroundMenu address: EU: 0x2301724 @@ -1544,8 +1544,8 @@ overlay11: EU: 0x2301B38 description: |- Seems to be the entry_point for a "mini-overlay" overlay_load_entry that lives in overlay 11, which controls the others menu in ground mode. - - return: undefined4 + + return: undefined4 - name: GroundBagOthersMenuDestructor address: EU: 0x2301BBC @@ -1567,7 +1567,7 @@ overlay11: Seems to initialize the menu which controls bidoof and sunflora's diaries, as well as the FAQ board on B1F of the guild. r0: undefined4 - return: undefined4 + return: undefined4 - name: FreeDiaryAndFaqBoardMenuMenu address: EU: 0x23042A0 @@ -1610,7 +1610,7 @@ overlay11: Checks if a ground_monster is above level 99. r0: ground_monster pointer - return: 1 if ground monster is above level 99, 0 if not. + return: 1 if ground monster is above level 99, 0 if not. - name: GetExclusiveItemRequirements address: EU: 0x230B8D4 @@ -2039,8 +2039,8 @@ overlay11: address: EU: 0x23258E0 length: - EU: 0x4 - description: Pointer to the exclusive_item_requirements struct, used by the swap shop. + EU: 0x4 + description: "Pointer to the exclusive_item_requirements struct, used by the swap shop." - name: SWAP_SHOP_INVENTORY_PTRS address: EU: 0x23258E4 diff --git a/symbols/overlay20.yml b/symbols/overlay20.yml index 6c332300..a2a2b3c1 100644 --- a/symbols/overlay20.yml +++ b/symbols/overlay20.yml @@ -20,7 +20,7 @@ overlay20: The entry point for the overlay, when called by MENU_RECYCLE_SHOP, serving to initialize the recycle shop. Calls RecycleShopCommonEntryPoint(0). - return: undefined4 + return: undefined4 - name: RecycleShopEntryPointResume address: EU: 0x238AC90 @@ -29,7 +29,7 @@ overlay20: Calls RecycleShopCommonEntryPoint(0). - return: undefined4 + return: undefined4 - name: RecycleShopDestructor address: EU: 0x238ACA0 @@ -43,7 +43,7 @@ overlay20: description: |- The shared frame_update of both recycle shop overlay_load_entries, managing operations of the overlay each frame. - return: undefined4 + return: undefined4 - name: RecycleShopCommonEntryPoint address: EU: 0x238BDD4 @@ -52,7 +52,7 @@ overlay20: r0: 1 if resuming, 0 if first entry. - return: undefined4 + return: undefined4 - name: PrintWynautTextbox address: EU: 0x238BE80 @@ -107,7 +107,7 @@ overlay20: description: |- Seems to generally manage the top screen window during item selection, assigning the below callbacks to some window creation function. - return: undefined4 + return: undefined4 - name: RecycleShopTopScreenDrawItemStats address: EU: 0x238C40C @@ -151,9 +151,9 @@ overlay20: NA: 0x238CF7C JP: 0x238E4D8 length: - NA: 0x8 EU: 0x8 - description: |- + NA: 0x8 + description: |- Note: unverified, ported from Irdkwia's notes. Seems to consist of a pointer to RECYCLE_SHOP_S14P02A_BGP_FILE_STR and an unknown value. Perhaps a pointer to the file at runtime? - name: RECYCLE_MENU_ITEMS_CONFIRM_1 @@ -211,7 +211,7 @@ overlay20: description: |- "BACK/s14p02a.bgp" Likely a background file loaded in manually by the recycle shop. - + type: string - name: RECYCLE_WINDOW_PARAMS_1 address: @@ -358,7 +358,7 @@ overlay20: JP: 0x4 description: |- A permanent pointer to the recycle_shop_main struct. - + type: recycle_shop_main* - name: RECYCLE_SHOP_UNK_STRUCT_SIZE_84H_PTR aliases: @@ -373,7 +373,7 @@ overlay20: JP: 0x4 description: |- Seems to be a pointer to a struct of unknown purpose with size 0x84. - + type: recycle_shop_struct_0x84* - name: RECYCLE_SHOP_UNK_STRUCT_SIZE_340H_PTR aliases: @@ -388,7 +388,7 @@ overlay20: JP: 0x4 description: |- Seems to be a pointer to a struct of unknown purpose with size 0x340. - + type: recycle_shop_struct_0x340* - name: RECYCLE_SHOP_UNK_STRUCT_SIZE_1CCH_PTR aliases: @@ -401,7 +401,7 @@ overlay20: EU: 0x4 NA: 0x4 JP: 0x4 - description: |- + description: |- Seems to be a pointer to a struct of unknown purpose with size 0x1CC. - - type: recycle_shop_struct_0x1cc* \ No newline at end of file + + type: recycle_shop_struct_0x1cc* diff --git a/symbols/overlay26.yml b/symbols/overlay26.yml index f0c0fb41..24d0d25c 100644 --- a/symbols/overlay26.yml +++ b/symbols/overlay26.yml @@ -61,7 +61,7 @@ overlay26: description: |- Just a guess. See ApplyRuleDungeonEffectsFrameUpdate for further explanation. Is a destructor for an overlay_load_entry. - + No params. - name: ApplyRuleDungeonEffectsFrameUpdate address: @@ -70,7 +70,7 @@ overlay26: Just a guess. After enough frames pass, conditionally calls GetMaxItemsAllowed, RemoveAllItemsStartingAt, IsMoneyAllowed, and SetMoneyCarried, as well as a handful of unknown functions that likely check if the entered dungeon is a rule dungeon. Is a frame_update for an overlay_load_entry. - + return: undefined4 - name: ExitDungeon1EntryPoint address: @@ -90,7 +90,7 @@ overlay26: description: |- Seems to get called on exiting a dungeon. Might be exclusive to whether the dungeon is in mission mode? Is a destructor for an overlay_load_entry. - + No params. - name: ExitDungeon1FrameUpdate address: @@ -98,7 +98,7 @@ overlay26: description: |- Seems to get called on exiting a dungeon. Might be exclusive to whether the dungeon is in mission mode? Is a frame_update for an overlay_load_entry. - + return: undefined4 - name: UnkOv26EntryPoint0238b754EU address: @@ -116,14 +116,14 @@ overlay26: EU: 0x238B780 description: |- Is an unidentified destructor for an overlay_load_entry. - + No params. - name: UnkOv26FrameUpdate0238b7acEU address: - EU: 0x0238B7AC + EU: 0x238B7AC description: |- Is an unidentified frame_update for an overlay_load_entry. - + return: undefined4 - name: DungeonExitEntryPoint2 address: @@ -143,7 +143,7 @@ overlay26: description: |- Seems to get called on exiting a dungeon. Might be exclusive to whether the dungeon is not in mission mode? Is a destructor for an overlay_load_entry. - + No params. - name: DungeonExitFrameUpdate2 address: @@ -151,7 +151,7 @@ overlay26: description: |- Seems to get called on exiting a dungeon. Might be exclusive to whether the dungeon is not in mission mode? Is a frame_update for an overlay_load_entry. - + return: undefined4 data: - name: MISSION_TYPE_12_DIALOGUE_SEQS @@ -166,7 +166,7 @@ overlay26: A singular mission_reward_dialogue_sequence struct for treasure hoard missions. Is fed sequentially to MissionRewardFrameUpdate to either produce a textbox, or conclude the dialogue. - type: mission_reward_dialogue_sequence + type: mission_reward_dialogue_sequence - name: MISSION_DEFAULT_DIALOGUE_SEQS address: EU: 0x238B966 @@ -177,7 +177,7 @@ overlay26: A pair of mission_reward_dialogue_sequence structs used for missions of type 4, 5, and technically 14. Is fed sequentially to MissionRewardFrameUpdate to either produce a textbox, or conclude the dialogue. - type: mission_reward_dialogue_sequence + type: mission_reward_dialogue_sequence - name: MISSION_TYPE_10_DIALOGUE_SEQS address: EU: 0x238B972 @@ -188,7 +188,7 @@ overlay26: A pair of mission_reward_dialogue_sequence structs used for missions of type 10. Is fed sequentially to MissionRewardFrameUpdate to either produce a textbox, or conclude the dialogue. - type: mission_reward_dialogue_sequence + type: mission_reward_dialogue_sequence - name: MISSION_TYPE_9_DIALOGUE_SEQS address: EU: 0x238B97E @@ -199,7 +199,7 @@ overlay26: A pair of mission_reward_dialogue_sequence structs used for missions of type 9. Is fed sequentially to MissionRewardFrameUpdate to either produce a textbox, or conclude the dialogue. - type: mission_reward_dialogue_sequence + type: mission_reward_dialogue_sequence - name: MISSION_TYPE_8_DIALOGUE_SEQS address: EU: 0x238B98A @@ -210,7 +210,7 @@ overlay26: A pair of mission_reward_dialogue_sequence structs used for missions of type 8. Is fed sequentially to MissionRewardFrameUpdate to either produce a textbox, or conclude the dialogue. - type: mission_reward_dialogue_sequence + type: mission_reward_dialogue_sequence - name: MISSION_TYPE_6_DIALOGUE_SEQS address: EU: 0x238B996 @@ -221,7 +221,7 @@ overlay26: A pair of mission_reward_dialogue_sequence structs used for missions of type 6. Is fed sequentially to MissionRewardFrameUpdate to either produce a textbox, or conclude the dialogue. - type: mission_reward_dialogue_sequence + type: mission_reward_dialogue_sequence - name: MISSION_TYPE_7_DIALOGUE_SEQS address: EU: 0x238B9A2 @@ -232,7 +232,7 @@ overlay26: A pair of mission_reward_dialogue_sequence structs used for missions of type 7. Is fed sequentially to MissionRewardFrameUpdate to either produce a textbox, or conclude the dialogue. - type: mission_reward_dialogue_sequence + type: mission_reward_dialogue_sequence - name: MISSION_TYPE_3_DIALOGUE_SEQS address: EU: 0x238B9AE @@ -243,7 +243,7 @@ overlay26: A pair of mission_reward_dialogue_sequence structs used for missions of type 3. Is fed sequentially to MissionRewardFrameUpdate to either produce a textbox, or conclude the dialogue. - type: mission_reward_dialogue_sequence + type: mission_reward_dialogue_sequence - name: MISSION_TYPE_2_DIALOGUE_SEQS address: EU: 0x238B9BA @@ -254,7 +254,7 @@ overlay26: A pair of mission_reward_dialogue_sequence structs used for missions of type 2. Is fed sequentially to MissionRewardFrameUpdate to either produce a textbox, or conclude the dialogue. - type: mission_reward_dialogue_sequence + type: mission_reward_dialogue_sequence - name: MISSION_TYPE_1_DIALOGUE_SEQS address: EU: 0x238B9C6 @@ -265,7 +265,7 @@ overlay26: A pair of mission_reward_dialogue_sequence structs used for missions of type 1. Is fed sequentially to MissionRewardFrameUpdate to either produce a textbox, or conclude the dialogue. - type: mission_reward_dialogue_sequence + type: mission_reward_dialogue_sequence - name: MISSION_TYPE_0_DIALOGUE_SEQS address: EU: 0x238B9D2 @@ -276,7 +276,7 @@ overlay26: A pair of mission_reward_dialogue_sequence structs used for missions of type 0. Is fed sequentially to MissionRewardFrameUpdate to either produce a textbox, or conclude the dialogue. - type: mission_reward_dialogue_sequence + type: mission_reward_dialogue_sequence - name: MISSION_TYPE_11_DIALOGUE_SEQS address: EU: 0x238B9DE @@ -287,7 +287,7 @@ overlay26: A pair of mission_reward_dialogue_sequence structs used for missions of type 11. Is fed sequentially to MissionRewardFrameUpdate to either produce a textbox, or conclude the dialogue. - type: mission_reward_dialogue_sequence + type: mission_reward_dialogue_sequence - name: DEBUG_CONQUEST_COUNT_STR address: EU: 0x238B9EC @@ -329,7 +329,7 @@ overlay26: description: |- A pointer to a mission_reward_struct_overlay struct, responsible for the operations of part of the mission reward sequence. - type: mission_reward_struct_overlay* + type: mission_reward_struct_overlay* - name: APPLY_RULE_DUNGEON_EFFECTS_STRUCT_PTR address: EU: 0x238BAA4 @@ -338,7 +338,7 @@ overlay26: description: |- A pointer to a struct of unknown size, responsible for the operations of the ApplyRuleDungeonEffects* overlay_load_entry. - type: undefined* + type: undefined* - name: EXIT_DUNGEON_1_STRUCT_PTR address: EU: 0x238BAA8 @@ -347,7 +347,7 @@ overlay26: description: |- A pointer to a struct of unknown size, responsible for the operations of the DungeonExit1* overlay_load_entry. - type: undefined* + type: undefined* - name: OVERLAY26_UNKNOWN_POINTER__NA_238AF6C address: EU: 0x238BAAC @@ -364,4 +364,4 @@ overlay26: description: |- A pointer to a struct of unknown size, responsible for the operations of the DungeonExit2* overlay_load_entry. - type: undefined* + type: undefined* From f5e1edfd1b065a50c7546235f290999870310147 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Wed, 3 Jun 2026 21:36:53 -0400 Subject: [PATCH 041/117] ... --- headers/data/arm9.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/data/arm9.h b/headers/data/arm9.h index a10565f6..3251c045 100644 --- a/headers/data/arm9.h +++ b/headers/data/arm9.h @@ -142,10 +142,10 @@ extern fx32_8 DAMAGE_FORMULA_LN_ARG_PREFACTOR; extern uint8_t OUTLAW_HIDEOUT_FIXED_ROOM_IDS[5]; extern uint8_t CHALLENGE_NORMAL_FIXED_ROOM_IDS[5]; extern bool TACTICS_FOLLOW_LEADER[12]; -extern uint8_t TREASURE_MEMO_FIXED_ROOM_IDS[30]; extern struct forbidden_forgot_move_entry FORBIDDEN_FORGOT_MOVE_LIST[3]; extern struct type_id_8 CONVERSION2_TYPE_TABLE[18]; extern int16_t TACTICS_UNLOCK_LEVEL_TABLE[12]; +extern uint8_t TREASURE_MEMO_FIXED_ROOM_IDS[30]; extern int16_t CLIENT_LEVEL_TABLE[16]; extern int16_t OUTLAW_LEVEL_TABLE[16]; extern int16_t OUTLAW_MINION_LEVEL_TABLE[16]; From 51b7aeb6c885f67d0f02a3d2ab73f0e60f9f10bf Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Wed, 3 Jun 2026 23:58:22 -0400 Subject: [PATCH 042/117] Ground Mode Discoveries --- headers/data/arm9.h | 5 ++ headers/functions/arm9.h | 21 ++++-- headers/types/files/rescue.h | 15 +++++ symbols/arm9.yml | 125 +++++++++++++++++++++++++++++++++++ 4 files changed, 162 insertions(+), 4 deletions(-) diff --git a/headers/data/arm9.h b/headers/data/arm9.h index 3251c045..1932b43c 100644 --- a/headers/data/arm9.h +++ b/headers/data/arm9.h @@ -15,6 +15,7 @@ extern uint32_t MAX_MONEY_STORED; extern struct window_list* WINDOW_LIST_PTR; extern struct script_var_value_table* SCRIPT_VARS_VALUES_PTR; extern uint32_t MAX_PLAY_TIME; +int MT_MULT; extern uint32_t MONSTER_ID_LIMIT; extern uint32_t MAX_RECRUITABLE_TEAM_MEMBERS; extern int16_t SINE_VALUE_TABLE[1024]; @@ -253,6 +254,9 @@ extern struct monster_id_16 DEFAULT_PARTNER_ID; extern uint8_t GAME_MODE; extern struct global_progress* GLOBAL_PROGRESS_PTR; extern struct adventure_log* ADVENTURE_LOG_PTR; +extern int MT_TABLE_INDEX; +extern int TWIST_LOW_BIT_MULTS[2]; +extern int MT_TABLE[624]; extern void* ITEM_TABLES_PTRS_1[26]; extern struct monster_data_table* MONSTER_DATA_TABLE_PTR; extern enum monster_id* UNOWN_SPECIES_ADDITIONAL_CHAR_PTR_TABLE[28]; @@ -266,6 +270,7 @@ extern int MISSION_MONSTER_COUNT; extern undefined* MISSION_LIST_PTR; extern const char* REMOTE_STRING_PTR_TABLE[7]; extern const char* RANK_STRING_PTR_TABLE[16]; +extern struct rescue_bin_unpack RESCUE_BIN_UNPACK; extern void* SMD_EVENTS_FUN_TABLE[127]; extern int16_t MUSIC_DURATION_LOOKUP_TABLE_1[128]; extern int32_t MUSIC_DURATION_LOOKUP_TABLE_2[128]; diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 87e4c3b8..f74e35ec 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -821,6 +821,10 @@ void InitInventoryMenuInput(struct inventory_menu_input_ctx* input_ctx, struct w struct window_extra_info* window_extra_info, struct window_rectangle* rect, int n_items, int n_items_per_page, undefined param_7); +void InventoryMenuNextPage(struct inventory_menu_input_ctx *param_1); +void InventoryMenuPreviousPage(struct inventory_menu_input_ctx *param_1); +void InventoryMenuNext10Pages(struct inventory_menu_input_ctx *param_1); +void InventoryMenuPrevious10Pages(struct inventory_menu_input_ctx *param_1); bool OverlayLoadEntriesEqual(struct overlay_load_entry* entry1, struct overlay_load_entry* entry2); void FreeActiveMenu(void); bool InitMenu(struct overlay_load_entry* entry); @@ -946,6 +950,7 @@ int GetScenarioBalance(void); void ScenarioFlagRestore(void); void ScenarioFlagBackup(void); void InitWorldMapScriptVars(void); +void SetWorldMapLevel(undefined4 param_1); void InitDungeonListScriptVars(void); void SetDungeonConquest(enum dungeon_id dungeon_id, int bit_value); enum dungeon_mode GetDungeonMode(enum dungeon_id dungeon_id); @@ -1062,6 +1067,8 @@ uint32_t GetPlayTimeSeconds(struct play_time* igt); uint32_t SubFixedPoint(uint32_t val_fp, uint32_t dec_fp); uint32_t BinToDecFixedPoint(ufx32_16* q16); int CeilFixedPoint(uint32_t val_fp); +void MtInit(int32_t initial_seed); +int32_t MtNext(void); bool DungeonGoesUp(enum dungeon_id dungeon_id); int GetTurnLimit(enum dungeon_id dungeon_id); bool DoesNotSaveWhenEntering(enum dungeon_id dungeon_id); @@ -1267,6 +1274,7 @@ int DungeonRequestsDoneWrapper(uint8_t param_1); bool AnyDungeonRequestsDone(uint8_t param_1); bool AddMissionToJobList(struct mission* mission); struct mission* GetAcceptedMission(uint8_t mission_id); +bool IsAcceptedMissionSlotEmpty(int param_1); bool WasMissionCompletedToday(struct mission_result_and_client* param_1, struct mission* param_2, enum mission_type param_3); int GetMissionByTypeAndDungeon(int start_index, enum mission_type mission_type, @@ -1304,6 +1312,7 @@ undefined PrintWonderMailSkyCode(undefined param_1, undefined param_2, undefined void AppendMissionObjective(char* param_1, int param_2, undefined4 param_3, uint32_t param_4, short param_5); void AppendMissionDungeonLocation(struct mission_details* param_1, char* buffer, int param_3); +uint RandomizeMissionCategory(uint32_t MissionWghtSum,uint param_2,struct mission_weighted_category *param_3); bool SumValidMissionCategoryWeights(undefined4 mission_vendor); struct mission_template* GetRandomMissionTemplate(void); undefined4 LoadMissionTemplates(void); @@ -1323,6 +1332,8 @@ void GenerateMissionRewards(struct mission* MissionPtr, int IsCafeMission); undefined4 CheckDungeonMissionUnlockConditions(enum dungeon_id param_1); bool IsAvailableItem(enum item_id item_id); int GetAvailableItemDeliveryList(undefined* item_buffer); +void WriteMissionMtState(int32_t* state_ptr); +int16_t ReadMissionMtStateLower(void); void ZeroInitMissionRewardDataStruct(struct mission_reward_data* param_1); enum monster_id GetScriptEntityMonsterId(enum script_entity_id entity_id); int GetScriptEntityMatchingStorageId(enum script_entity_id entity_id); @@ -1330,10 +1341,12 @@ void SetActorTalkMainAndActorTalkSub(enum script_entity_id actor_id_main, enum script_entity_id actor_id_sub); void SetActorTalkMain(enum script_entity_id actor_id); void SetActorTalkSub(enum script_entity_id actor_id); -void SetActorEventMain(undefined2 param_1); -void SetRandomRequestNpcs1And2(undefined2 param_1, undefined2 param_2); -void SetAllEventNpcs(undefined2 param_1, undefined2 param_2, undefined2 param_3, - undefined2 param_4); +void SetActorEventMain(enum script_entity_id actor_id); +void SetRandomRequestNpcs1And2(enum script_entity_id actor_id1, enum script_entity_id actor_id2); +void SetRandomRequestNPC03KindVar(enum monster_id param_1); +void SetAllEventNpcs(enum script_entity_id param_1, enum script_entity_id param_2, enum script_entity_id param_3, + enum script_entity_id param_4); +void SetNewFriendActor(enum script_entity_id param_1); void RandomizeDemoActors(void); void ItemAtTableIdx(int idx, struct bulk_item* item); void MainLoop(void); diff --git a/headers/types/files/rescue.h b/headers/types/files/rescue.h index 982e89e1..8adbe1eb 100644 --- a/headers/types/files/rescue.h +++ b/headers/types/files/rescue.h @@ -124,3 +124,18 @@ struct mission_categories_table { struct mission_weighted_category unused_category; }; ASSERT_SIZE(struct mission_categories_table, 640); + + +// The unpacked rescue.bin file after being loaded in arm9. +struct rescue_bin_unpack { + int mt_state; + struct rescue_str_variant_table *string_variants; + struct monster_id_16 *monster_table_entries; + struct mission_weighted_category *all_categories; + struct item_id_16 *item_table_entries; + struct rescue_str_continuity_table *string_continuities; + struct mission_template *mission_templates; + struct mission_weighted_category *valid_categories; + int category_weight_sum; // Sum of all weighted categories + undefined *file_pointer; // Points to the raw rescue.bin file loaded in memory. +}; diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 3ef19517..ebef2a97 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -7578,6 +7578,38 @@ arm9: stack[0]: total number of selectable items stack[1]: number of selectable items per page stack[2]: ? + - name: InventoryMenuNextPage + address: + EU: 0x2033578 + description: |- + Tries to go to the next page of an inventory_menu window. + + + r0: struct inventory_menu_input_ctx + - name: InventoryMenuPreviousPage + address: + EU: 0x20335A0 + description: |- + Tries to go to the previous page of an inventory_menu window. + + + r0: struct inventory_menu_input_ctx + - name: InventoryMenuNext10Pages + address: + EU: 0x20335C0 + description: |- + Tries to go forward by 10 pages in an inventory_menu window. + + + r0: struct inventory_menu_input_ctx + - name: InventoryMenuPrevious10Pages + address: + EU: 0x20335E4 + description: |- + Tries to go backward by 10 pages in an inventory_menu window. + + + r0: struct inventory_menu_input_ctx - name: OverlayLoadEntriesEqual address: EU: 0x2034A94 @@ -8783,6 +8815,13 @@ arm9: Initializes the WORLD_MAP_* script variable values (IDs 0x55-0x57). No params. + - name: SetWorldMapLevel + address: + EU: 0x204D120 + description: |- + Calls SaveScriptVariableValue with script variable $WORLD_MAP_LEVEL. + + r0: value to save - name: InitDungeonListScriptVars address: EU: 0x204D1C8 @@ -9963,6 +10002,20 @@ arm9: r0: number return: ceil(number) + - name: MtInit + address: + EU: 0x2051420 + description: |- + Initializes the MT_TABLE Mersenne Twister with a specified initial seed. + + r0: seed + - name: MtNext + address: + EU: 0x205146C + description: |- + Advances the MT_TABLE Mersenne Twister by one, and returns the result. + + return: next rand - name: DungeonGoesUp address: EU: 0x20515C0 @@ -12025,6 +12078,14 @@ arm9: r0: mission id in player's job list return: mission struct pointer + - name: IsAcceptedMissionSlotEmpty + address: + EU: 0x205F46C + description: |- + Checks if a specified slot of the player's mission list is empty. + + r0: slot id + return: 1 if the slot is empty, 0 if not. - name: WasMissionCompletedToday address: EU: 0x205F494 @@ -12497,6 +12558,21 @@ arm9: r0: item_buffer return: Number of deliverable items for a mission + - name: WriteMissionMtState + address: + EU: 0x2063870 + description: |- + Stores a Mersenne Twister state to RESCUE_BIN_UNPACK->mt_state. + + + r0: state pointer + - name: ReadMissionMtStateLower + address: + EU: 0x2063880 + description: |- + Returns the bottom half of RESCUE_BIN_UNPACK->mt_state. + + return: bottom half of the current mt_state. - name: ZeroInitMissionRewardDataStruct address: EU: 0x2063898 @@ -12572,6 +12648,13 @@ arm9: r0: ACTOR_REQUEST_NPC01 actor_id r1: ACTOR_REQUEST_NPC02 actor_id + - name: SetRandomRequestNPC03KindVar + address: + EU: 0x2065F10 + description: |- + Sets the RANDOM_REQUEST_NPC03_KIND script variable, which controls the species of ACTOR_REQUEST_NPC03. + + r0: species to store in RANDOM_REQUEST_NPC03_KIND. - name: SetAllEventNpcs address: EU: 0x2065F28 @@ -12582,6 +12665,13 @@ arm9: r1: ACTOR_EVENT_NPC02 actor_id r2: ACTOR_EVENT_NPC03 actor_id r3: ACTOR_EVENT_NPC04 actor_id + - name: SetNewFriendActor + address: + EU: 0x2065F44 + description: |- + Sets NPC_NEW_FRIEND to a specific actor_id. + + r0: NPC_NEW_FRIEND actor_id - name: RandomizeDemoActors address: EU: 0x2065FC4 @@ -12789,6 +12879,13 @@ arm9: Maximum number of seconds that the file timer counts up to. 35999999 seconds (one second under 10000 hours). + - name: MT_MULT + address: + EU: 0x2051464 + description: |- + The standard mult for Mersenne Twister initialization, 0x6C078965. + + type: int - name: MONSTER_ID_LIMIT address: EU: 0x2054818 @@ -15576,6 +15673,27 @@ arm9: [Runtime] type: struct adventure_log* + - name: MT_TABLE_INDEX + address: + EU: 0x20B0898 + description: |- + The current index of the Mersenne Twister Table. + + type: int + - name: TWIST_LOW_BIT_MULTS + address: + EU: 0x20B0898 + description: |- + The mults for the "twist" of a Mersenne Twister, 0x0 and 0x9908B0DF. + + type: int[2] + - name: MT_TABLE + address: + EU: 0x20B0898 + description: |- + A full Mersenne Twister table. Only known to be used by mission generation. + + type: int[624] - name: ITEM_TABLES_PTRS_1 address: EU: 0x20B1264 @@ -15713,6 +15831,13 @@ arm9: Note: unverified, ported from Irdkwia's notes type: const char*[16] + - name: RESCUE_BIN_UNPACK + address: + EU: 0x20B141C + description: |- + The unpacked contents of the RESCUE/rescue.bin file. Also contains a mersenne twister state, for some reason. + + type: rescue_bin_unpack struct - name: SMD_EVENTS_FUN_TABLE address: EU: 0x20B14D4 From d214202b0e49b2ad2454cb2479c6a191d5ff9b31 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Thu, 4 Jun 2026 00:05:18 -0400 Subject: [PATCH 043/117] Fix Smol Mistakes --- headers/functions/arm9.h | 2 +- symbols/arm9.yml | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index f74e35ec..00bcc89a 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -1343,7 +1343,7 @@ void SetActorTalkMain(enum script_entity_id actor_id); void SetActorTalkSub(enum script_entity_id actor_id); void SetActorEventMain(enum script_entity_id actor_id); void SetRandomRequestNpcs1And2(enum script_entity_id actor_id1, enum script_entity_id actor_id2); -void SetRandomRequestNPC03KindVar(enum monster_id param_1); +void SetRandomRequestNpc03KindVar(enum monster_id param_1); void SetAllEventNpcs(enum script_entity_id param_1, enum script_entity_id param_2, enum script_entity_id param_3, enum script_entity_id param_4); void SetNewFriendActor(enum script_entity_id param_1); diff --git a/symbols/arm9.yml b/symbols/arm9.yml index ebef2a97..32d573e4 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -12371,13 +12371,22 @@ arm9: r0: mission_details pointer r1: buffer r2: buffer size + - name: RandomizeMissionCategory + address: + EU: 0x20625C4 + description: |- + Seems to select a mission_weighted_category at weighted random, of the valid options. + + r0: sum of mission weight categories + r1: ? + r2: mission_weighted_category pointers to select at random. + return: mission_weighted_category index, selected at random - name: SumValidMissionCategoryWeights address: EU: 0x206260C description: |- Seems to tally up the total weights for each mission_category under a specified mission vendor. - r0: 0 for job board, 1 for outlaw board, 2 for cafe client, 3 for beach bottle return: 1 if the total weight is non-zero, 0 if not. - name: GetRandomMissionTemplate @@ -12648,7 +12657,7 @@ arm9: r0: ACTOR_REQUEST_NPC01 actor_id r1: ACTOR_REQUEST_NPC02 actor_id - - name: SetRandomRequestNPC03KindVar + - name: SetRandomRequestNpc03KindVar address: EU: 0x2065F10 description: |- From c3163480c010da2390ded73c514f2eeceacfc9f6 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Thu, 4 Jun 2026 00:06:36 -0400 Subject: [PATCH 044/117] Update arm9.h --- headers/functions/arm9.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 00bcc89a..f34d2a17 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -1312,7 +1312,7 @@ undefined PrintWonderMailSkyCode(undefined param_1, undefined param_2, undefined void AppendMissionObjective(char* param_1, int param_2, undefined4 param_3, uint32_t param_4, short param_5); void AppendMissionDungeonLocation(struct mission_details* param_1, char* buffer, int param_3); -uint RandomizeMissionCategory(uint32_t MissionWghtSum,uint param_2,struct mission_weighted_category *param_3); +uint32_t RandomizeMissionCategory(uint32_t MissionWghtSum,uint32_t param_2,struct mission_weighted_category *param_3); bool SumValidMissionCategoryWeights(undefined4 mission_vendor); struct mission_template* GetRandomMissionTemplate(void); undefined4 LoadMissionTemplates(void); From 84a68c61024e73ad755ddb0012bdb3f1873d474a Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 6 Jun 2026 18:25:57 -0400 Subject: [PATCH 045/117] Finish Descriptions --- headers/functions/arm9.h | 2 + headers/functions/overlay29.h | 15 ++++ symbols/arm9.yml | 18 +++++ symbols/overlay29.yml | 125 ++++++++++++++++++++++++++++++++++ 4 files changed, 160 insertions(+) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index f34d2a17..0089c2bd 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -446,6 +446,7 @@ void OpenWaza(int waza_id); void SelectWaza(int waza_id); void PlayBgmByIdVeneer(enum music_id music_id); void PlayBgmByIdVolumeVeneer(enum music_id music_id, undefined param_2, int volume); +bool IsMePlaying(int me_id); void PlaySeByIdVolumeWrapper(int index); void PlaySeVolumeWrapper(int index); void PlayBgmById(enum music_id music_id); @@ -1146,6 +1147,7 @@ void GuestMonsterToGroundMonster(struct ground_monster* ground_monster, struct guest_monster* guest_monster); void SetBaseStatsMovesGroundMonster(struct ground_monster* ground_monster); bool StrcmpMonsterName(char* string, enum monster_id monster_id); +void InitializeTeamMemberFromMentry(struct team_member *param_1,struct ground_monster *param_2,int32_t param_3); void GetLvlUpEntry(struct level_up_entry* level_up_entry, enum monster_id monster_id, int level); uint8_t* GetEncodedHalfword(uint8_t* data_ptr, uint16_t* result); int GetEvoFamily(undefined* monster, undefined* evo_family); diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index a272f5f4..b518f8c8 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -3,6 +3,7 @@ #include "overlay29/move_effects.h" +void InitDungeonPalatteStruct(void); struct rgba* GetWeatherColorTable(enum weather_id); struct dungeon* DungeonAlloc(void); struct dungeon* GetDungeonPtrMaster(void); @@ -25,6 +26,7 @@ uint32_t GetSuccessfulExitTracker(void); void GetAndStoreButtonInput(void); bool CheckTouchscreenArea(int x1, int y1, int x2, int y2); void* OamTileNumberToVramAddressOv29(short oam_tile_num, uint8_t screen); +void ResetDungeonColorPalette(void); struct trap* GetTrapInfo(struct entity* trap_entity); struct item* GetItemInfo(struct entity* item_entity); struct tile* GetTileAtEntity(struct entity* entity); @@ -105,6 +107,7 @@ void AssignTopScreenHandlers(void** funcs, top_screen_status_fn_t init_func, top_screen_status_fn_t free_func); void HandleTopScreenFades(void); int FreeTopScreen(void); +void DungeonChangeTopScreenType(int param_1); enum direction_id GetDirectionTowardsPosition(struct position* origin, struct position* target); int GetChebyshevDistance(struct position* position_a, struct position* position_b); bool IsPositionActuallyInSight(struct position* origin, struct position* target, @@ -141,8 +144,10 @@ void DungeonRngUnsetSecondary(void); void DungeonRngSetSecondary(int i); void DungeonRngSetPrimary(void); void PlaySeByIdIfNotSilence(int se_id); +void PlayMeByIdIfNot998(int me_id); enum music_id MusicTableIdxToMusicId(int music_table_idx); void ChangeDungeonMusic(enum music_id music_id); +void SetUnkMusicFlag(uint8_t param_1); void TrySwitchPlace(struct entity* user, struct entity* target); void ResetLeaderActionFields(bool clear_additional_fields); void SetLeaderActionFields(enum action action_id); @@ -153,6 +158,7 @@ struct item* GetItemToUseByIndex(struct entity* entity, union item_index item_in struct item* GetItemToUse(struct entity* entity, int param_index, undefined param_3); enum action GetItemAction(enum item_id item_id); void RemoveUsedItem(struct entity* entity, int param_index); +void ConvertTmToUsedTm(void); void AddDungeonSubMenuOption(int action_id, bool enabled); void DisableDungeonSubMenuOption(int action_id); void SetActionRegularAttack(struct action_data* monster_action, enum direction_id direction); @@ -166,6 +172,7 @@ bool RunLeaderTurn(undefined param_1); void TrySpawnMonsterAndActivatePlusMinus(void); bool IsFloorOver(void); void DecrementWindCounter(void); +void GenerateMonsterSummaryOuter(damage_source_16 param_1,struct entity *param_2,struct monster *param_3,int param_4); bool IsDungeonEndReasonFailure(void); void SetForcedLossReason(enum forced_loss_reason forced_loss_reason); enum forced_loss_reason GetForcedLossReason(void); @@ -208,6 +215,7 @@ bool DebugRecruitingEnabled(void); void TryActivateIqBooster(void); bool IsBehaviorLoneOutlaw(enum monster_behavior behavior); bool IsSecretBazaarNpcBehavior(enum monster_behavior behavior); +void GonePebbleGradualPaletteShift(struct rgba *param_1,uint param_2); struct action_16* GetLeaderAction(void); enum action_id GetLeaderActionId(void); void GetEntityTouchscreenArea(struct entity* entity, struct touchscreen_area* area); @@ -262,6 +270,7 @@ bool CheckTeamMemberIdxVeneer(int member_idx); bool IsMonsterIdInNormalRangeVeneer(enum monster_id monster_id); void BoostIQ(struct entity* entity, int iq_boost, bool suppress_logs); bool ShouldMonsterHeadToStairs(struct entity* entity); +void DisplayLinkedMovesWarnings(struct entity *param_1,int move_slot); bool MewSpawnCheck(enum monster_id monster_id, bool fail_if_mew); void TryEndStatusWithAbility(struct entity* attacker, struct entity* defender); bool ExclusiveItemEffectIsActive(struct entity* entity, enum exclusive_item_effect_id effect_id); @@ -284,6 +293,7 @@ void ResetTriggerFlags(struct entity* entity); bool IsSpecialStoryAlly(struct monster* monster); bool IsExperienceLocked(struct monster* monster); struct entity* FindMonsterWithBehavior(enum monster_behavior monster_behavior); +undefined4 CountActiveMonsters(void); bool IsMonsterLoneOutlaw(struct monster* monster); bool IsSecretBazaarNpc(struct entity* entity); bool IsTeamMemberOnFirstTurnInFixedRoom(struct monster* monster); @@ -952,6 +962,7 @@ void DisplayFloorCard(int duration); void HandleFloorCard(enum dungeon_id dungeon_id, uint8_t floor, int duration, enum hidden_stairs_type hidden_stairs_type); void FillMissionDestinationInfo(void); +undefined4 MissionExitPrompt(int param_1); bool IsItemUnkMissionItem2(struct item* item); bool CheckActiveChallengeRequest(void); struct mission_destination_info* GetMissionDestination(void); @@ -978,10 +989,13 @@ enum monster_id GetMissionTargetEnemy(void); enum monster_id GetMissionEnemyMinionGroup(int i); void SetTargetMonsterNotFoundFlag(bool value); bool GetTargetMonsterNotFoundFlag(void); +void ClearMissionDestinationInfo(struct mission_destination_info *param_1); bool FloorHasMissionMonster(struct mission_destination_info* mission_dst); struct mission* GetMissionIfActiveOnFloor(struct dungeon_floor_pair* pair, uint8_t mission_id); void GenerateMissionEggMonster(struct mission* mission); struct entity* GetFirstExperienceLockedTeamMember(void); +void TryCompleteMission(int param_1, int param_2); +void TreasureMemoComplete(void); void TeleportFleeingOutlaw(void); void InitAlertBoxInfo(void); void FreeAlertBoxInfo(void); @@ -1034,6 +1048,7 @@ void DisplayMessage2(struct portrait_params* portrait, int message_id, bool wait bool YesNoMenu(undefined param_1, int string_id, int default_option, undefined param_4); void DisplayMessageInternal(int message_id, bool wait_for_input, struct portrait_params* portrait, undefined4 param_4, undefined4 param_5, undefined4 param_6); +void PrintMissionCompleteString(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,undefined1 param_5); void InitSecretBazaarDialogueInfo(void); void OpenMenu(undefined param_1, undefined param_2, bool open_bag); void StairsMenuAfterStep(struct entity* leader, bool leave_minimap_closed_after); diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 32d573e4..213544b3 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -4305,6 +4305,15 @@ arm9: r0: Music ID r1: (?) Stored on byte 8 on the struct passed to SendAudioCommand r2: Volume (0-255) + - name: IsMePlaying + address: + EU: 0x2017CAC + description: |- + Seems to check if the specified ME effect is currently active. Has some kind of special logic for unknown ME value 0x3E6, which is not known to be a valid ME value... + MEs are usually short jingles that are used when notifying the player of something, like unlocking a dungeon or receiving an item. + + r0: ME_id + return: 1 if that ME is playing, 0 if not. - name: PlaySeByIdVolumeWrapper address: EU: 0x2017D1C @@ -10813,6 +10822,15 @@ arm9: r0: string_buffer r1: monster ID return: bool + - name: InitializeTeamMemberFromMentry + address: + EU: 0x20535CC + description: |- + Seems to copy a ground_monster pokemon from the Chimecho Assembly to the active team. + + r0: team_member pointer + r1: ground_monster pointer + r2: team_member index - name: GetLvlUpEntry address: EU: 0x2053B18 diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index f9865665..9ca26e14 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -18,6 +18,13 @@ overlay29: subregions: - move_effects.yml functions: + - name: InitDungeonPalatteStruct + address: + EU: 0x22DEC40 + description: |- + Seems to initialize the dungeon_palette_struct, which likely handles background color display in dungeon mode. + + No params. - name: GetWeatherColorTable address: EU: 0x22DEF60 @@ -391,6 +398,13 @@ overlay29: r0: tile number r1: 0 for bottom screen, 1 for top screen return: VRAM tile address + - name: ResetDungeonColorPalette + address: + EU: 0x22E1E4C + description: |- + Zeroes the entire color_table in the dungeon struct. + + No params. - name: GetTrapInfo address: EU: 0x22E1F48 @@ -1252,6 +1266,13 @@ overlay29: Gets called twice when fading out the top screen. First it calls the free_func of the top screen type and sets the handlers to null and on the second pass it just returns. return: always 1, seems unused + - name: DungeonChangeTopScreenType + address: + EU: 0x22E9658 + description: |- + Seems to change the top screen display type in dungeon mode. + + r0: index of top screen mode to change to - name: GetDirectionTowardsPosition address: EU: 0x22E99D0 @@ -1623,6 +1644,14 @@ overlay29: Plays the specified sound effect if it is not the designated silence value (0x3F00). r0: Sound effect ID + - name: PlayMeByIdIfNot998 + address: + EU: 0x22EB694 + description: |- + Plays the specified ME effect if it is not a specific unknown ME value (0x3E6). This is not known to be a valid ME value... + MEs are usually short jingles that are used when notifying the player of something, like unlocking a dungeon or receiving an item. + + r0: ME_id - name: MusicTableIdxToMusicId address: EU: 0x22EB6B0 @@ -1642,6 +1671,14 @@ overlay29: Replace the currently playing music with the provided music r0: music ID + - name: SetUnkMusicFlag + address: + EU: 0x22EB8E4 + description: |- + Seems to set some kind of flag in the dungeon struct that affects bgm in some way. + Called in ApplyDamage immediately before and after reviving a pokemon, as well as other places. + + r0: uint8_t - name: TrySwitchPlace address: EU: 0x22EBB28 @@ -1751,6 +1788,15 @@ overlay29: r0: Pointer to the entity that used the item r1: Parameter index in monster::action_data::action_parameters. Will be used to use to determine the index of the used item. + - name: ConvertTmToUsedTm + address: + EU: 0x22EC018 + description: |- + Seems to be responsible for turning a TM into a Used TM after use. Explicitly checks if the TM is an HM, and if so, does not transform it. + + r0: Pointer to the entity that used the TM. + r1: Parameter index in monster::action_data::action_parameters. Will be used to use to determine the index of the used item. + No params. - name: AddDungeonSubMenuOption address: EU: 0x22EC1CC @@ -1862,6 +1908,17 @@ overlay29: Decrements dungeon::wind_turns and displays a wind warning message if required. No params. + - name: CreateMonsterSummaryFromEntityOuter + address: + EU: 0x22ED794 + description: |- + Seems to be the parent function for CreateMonsterSummaryFromEntity. + Sets the fainted_monster_dungeon_end_reason field to a damage_source. + + r0: damage_source_16 + r1: entity pointer + r2: monster pointer + r3: int - name: IsDungeonEndReasonFailure address: EU: 0x22ED8F4 @@ -2268,6 +2325,14 @@ overlay29: r0: monster behavior ID return: bool + - name: GonePebbleGradualPaletteShift + address: + EU: 0x22F1210 + description: |- + Seems to be responsible for the palette shift of the dungeon background for the Gone Pebble item effect. + + r0: rgba table pointer + r1: uint - name: GetLeaderAction address: EU: 0x22F1540 @@ -2837,6 +2902,14 @@ overlay29: r0: Entity pointer return: True if the monster should try to reach the stairs, false otherwise + - name: DisplayLinkedMovesWarnings + address: + EU: 0x22FAF80 + description: |- + Seems to handle displaying the text string for linked moves de-linking when at 2, 1, or 0 PP. + + r0: entity pointer + r1: move_slot id - name: MewSpawnCheck address: EU: 0x22FAFFC @@ -3106,6 +3179,13 @@ overlay29: r0: monster behavior to search for return: the first entity in the dungeon with the given monster behavior, or null if not found + - name: CountActiveMonsters + address: + EU: 0x22FC648 + description: |- + Loops through the monster entity table, counting the number of valid entities. + + return: number of monsters on the floor - name: IsMonsterLoneOutlaw address: EU: 0x22FC7DC @@ -9341,6 +9421,15 @@ overlay29: Fills the dungeon::mission_destination_info field with information from the currently active mission on the floor, if one is present. No params. + - name: MissionExitPrompt + address: + EU: 0x2349618 + description: |- + Responsible for asking the player if they want to leave the dungeon after a mission via nested YesNoMenu() calls. + The first YesNoMenu uses a text string id from the param of this function. + + r0: int + return: undefined4 - name: IsItemUnkMissionItem2 address: EU: 0x2349900 @@ -9590,6 +9679,14 @@ overlay29: Gets the value of dungeon::target_monster_not_found_flag. return: dungeon::target_monster_not_found_flag + - name: ClearMissionDestinationInfo + address: + EU: 0x234A2EC + description: |- + Zeroes all fields of a mission_destination_info struct. + Seems to be called as part of FillMissionDestinationInfo, and one other place. + + r0: mission_destination_info pointer - name: FloorHasMissionMonster address: EU: 0x234A348 @@ -9642,6 +9739,22 @@ overlay29: Returns a null pointer instead if none are present. return: entity pointer + - name: TryCompleteMission + address: + EU: 0x234A6D4 + description: |- + Seems to check if the mission on the current floor has been completed. Each mission type seems to use the params differently. + + r0: target monster_id or arrest outlaw item_id? + r1: treasure memo item_id? + - name: TreasureMemoComplete + address: + EU: 0x234B88C + description: |- + Seems to run when a treasure memo mission has been completed. + Handles the fanfare for completing the mission, runs TryCompleteMission, and calls MissionExitPrompt. + + No params. - name: TeleportFleeingOutlaw address: EU: 0x234BAA4 @@ -10109,6 +10222,18 @@ overlay29: r3: ? stack[0]: ? stack[1]: ? + - name: PrintMissionCompleteString + address: + EU: 0x234E30C + description: |- + Seems to handle the displaying the textbox for completing a specific kind of mission. + Only known to be called by TreasureMemoComplete. + + r0: string_id to play for completing the mission. + r1: ? + r2: ? + r3: ? + stack[0]: ? - name: InitSecretBazaarDialogueInfo address: EU: 0x234E758 From e3e2fe44321a3175b91fcdea4b6306cf80a8b032 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 6 Jun 2026 18:28:04 -0400 Subject: [PATCH 046/117] Fix header inconsistencies --- headers/functions/overlay29.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index b518f8c8..a1bb65d8 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -172,7 +172,7 @@ bool RunLeaderTurn(undefined param_1); void TrySpawnMonsterAndActivatePlusMinus(void); bool IsFloorOver(void); void DecrementWindCounter(void); -void GenerateMonsterSummaryOuter(damage_source_16 param_1,struct entity *param_2,struct monster *param_3,int param_4); +void CreateMonsterSummaryFromEntityOuter(union damage_source_16 param_1,struct entity *param_2,struct monster *param_3,int param_4); bool IsDungeonEndReasonFailure(void); void SetForcedLossReason(enum forced_loss_reason forced_loss_reason); enum forced_loss_reason GetForcedLossReason(void); @@ -215,7 +215,7 @@ bool DebugRecruitingEnabled(void); void TryActivateIqBooster(void); bool IsBehaviorLoneOutlaw(enum monster_behavior behavior); bool IsSecretBazaarNpcBehavior(enum monster_behavior behavior); -void GonePebbleGradualPaletteShift(struct rgba *param_1,uint param_2); +void GonePebbleGradualPaletteShift(struct rgba *param_1,uint32_t param_2); struct action_16* GetLeaderAction(void); enum action_id GetLeaderActionId(void); void GetEntityTouchscreenArea(struct entity* entity, struct touchscreen_area* area); From bc67c0dd27313065ed593bcb723fcf29032473db Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 6 Jun 2026 18:30:41 -0400 Subject: [PATCH 047/117] Fix Syntax --- headers/functions/arm9.h | 18 ++++++++++-------- headers/functions/overlay29.h | 12 +++++++----- headers/types/files/rescue.h | 19 +++++++++---------- symbols/arm9.yml | 32 +++++++++++++++++++++++++++----- symbols/overlay29.yml | 8 +++++++- 5 files changed, 60 insertions(+), 29 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 0089c2bd..7bd9cd07 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -822,10 +822,10 @@ void InitInventoryMenuInput(struct inventory_menu_input_ctx* input_ctx, struct w struct window_extra_info* window_extra_info, struct window_rectangle* rect, int n_items, int n_items_per_page, undefined param_7); -void InventoryMenuNextPage(struct inventory_menu_input_ctx *param_1); -void InventoryMenuPreviousPage(struct inventory_menu_input_ctx *param_1); -void InventoryMenuNext10Pages(struct inventory_menu_input_ctx *param_1); -void InventoryMenuPrevious10Pages(struct inventory_menu_input_ctx *param_1); +void InventoryMenuNextPage(struct inventory_menu_input_ctx* param_1); +void InventoryMenuPreviousPage(struct inventory_menu_input_ctx* param_1); +void InventoryMenuNext10Pages(struct inventory_menu_input_ctx* param_1); +void InventoryMenuPrevious10Pages(struct inventory_menu_input_ctx* param_1); bool OverlayLoadEntriesEqual(struct overlay_load_entry* entry1, struct overlay_load_entry* entry2); void FreeActiveMenu(void); bool InitMenu(struct overlay_load_entry* entry); @@ -1147,7 +1147,8 @@ void GuestMonsterToGroundMonster(struct ground_monster* ground_monster, struct guest_monster* guest_monster); void SetBaseStatsMovesGroundMonster(struct ground_monster* ground_monster); bool StrcmpMonsterName(char* string, enum monster_id monster_id); -void InitializeTeamMemberFromMentry(struct team_member *param_1,struct ground_monster *param_2,int32_t param_3); +void InitializeTeamMemberFromMentry(struct team_member* param_1, struct ground_monster* param_2, + int32_t param_3); void GetLvlUpEntry(struct level_up_entry* level_up_entry, enum monster_id monster_id, int level); uint8_t* GetEncodedHalfword(uint8_t* data_ptr, uint16_t* result); int GetEvoFamily(undefined* monster, undefined* evo_family); @@ -1314,7 +1315,8 @@ undefined PrintWonderMailSkyCode(undefined param_1, undefined param_2, undefined void AppendMissionObjective(char* param_1, int param_2, undefined4 param_3, uint32_t param_4, short param_5); void AppendMissionDungeonLocation(struct mission_details* param_1, char* buffer, int param_3); -uint32_t RandomizeMissionCategory(uint32_t MissionWghtSum,uint32_t param_2,struct mission_weighted_category *param_3); +uint32_t RandomizeMissionCategory(uint32_t MissionWghtSum, uint32_t param_2, + struct mission_weighted_category* param_3); bool SumValidMissionCategoryWeights(undefined4 mission_vendor); struct mission_template* GetRandomMissionTemplate(void); undefined4 LoadMissionTemplates(void); @@ -1346,8 +1348,8 @@ void SetActorTalkSub(enum script_entity_id actor_id); void SetActorEventMain(enum script_entity_id actor_id); void SetRandomRequestNpcs1And2(enum script_entity_id actor_id1, enum script_entity_id actor_id2); void SetRandomRequestNpc03KindVar(enum monster_id param_1); -void SetAllEventNpcs(enum script_entity_id param_1, enum script_entity_id param_2, enum script_entity_id param_3, - enum script_entity_id param_4); +void SetAllEventNpcs(enum script_entity_id param_1, enum script_entity_id param_2, + enum script_entity_id param_3, enum script_entity_id param_4); void SetNewFriendActor(enum script_entity_id param_1); void RandomizeDemoActors(void); void ItemAtTableIdx(int idx, struct bulk_item* item); diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index a1bb65d8..c368b784 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -172,7 +172,8 @@ bool RunLeaderTurn(undefined param_1); void TrySpawnMonsterAndActivatePlusMinus(void); bool IsFloorOver(void); void DecrementWindCounter(void); -void CreateMonsterSummaryFromEntityOuter(union damage_source_16 param_1,struct entity *param_2,struct monster *param_3,int param_4); +void CreateMonsterSummaryFromEntityOuter(union damage_source_16 param_1, struct entity* param_2, + struct monster* param_3, int param_4); bool IsDungeonEndReasonFailure(void); void SetForcedLossReason(enum forced_loss_reason forced_loss_reason); enum forced_loss_reason GetForcedLossReason(void); @@ -215,7 +216,7 @@ bool DebugRecruitingEnabled(void); void TryActivateIqBooster(void); bool IsBehaviorLoneOutlaw(enum monster_behavior behavior); bool IsSecretBazaarNpcBehavior(enum monster_behavior behavior); -void GonePebbleGradualPaletteShift(struct rgba *param_1,uint32_t param_2); +void GonePebbleGradualPaletteShift(struct rgba* param_1, uint32_t param_2); struct action_16* GetLeaderAction(void); enum action_id GetLeaderActionId(void); void GetEntityTouchscreenArea(struct entity* entity, struct touchscreen_area* area); @@ -270,7 +271,7 @@ bool CheckTeamMemberIdxVeneer(int member_idx); bool IsMonsterIdInNormalRangeVeneer(enum monster_id monster_id); void BoostIQ(struct entity* entity, int iq_boost, bool suppress_logs); bool ShouldMonsterHeadToStairs(struct entity* entity); -void DisplayLinkedMovesWarnings(struct entity *param_1,int move_slot); +void DisplayLinkedMovesWarnings(struct entity* param_1, int move_slot); bool MewSpawnCheck(enum monster_id monster_id, bool fail_if_mew); void TryEndStatusWithAbility(struct entity* attacker, struct entity* defender); bool ExclusiveItemEffectIsActive(struct entity* entity, enum exclusive_item_effect_id effect_id); @@ -989,7 +990,7 @@ enum monster_id GetMissionTargetEnemy(void); enum monster_id GetMissionEnemyMinionGroup(int i); void SetTargetMonsterNotFoundFlag(bool value); bool GetTargetMonsterNotFoundFlag(void); -void ClearMissionDestinationInfo(struct mission_destination_info *param_1); +void ClearMissionDestinationInfo(struct mission_destination_info* param_1); bool FloorHasMissionMonster(struct mission_destination_info* mission_dst); struct mission* GetMissionIfActiveOnFloor(struct dungeon_floor_pair* pair, uint8_t mission_id); void GenerateMissionEggMonster(struct mission* mission); @@ -1048,7 +1049,8 @@ void DisplayMessage2(struct portrait_params* portrait, int message_id, bool wait bool YesNoMenu(undefined param_1, int string_id, int default_option, undefined param_4); void DisplayMessageInternal(int message_id, bool wait_for_input, struct portrait_params* portrait, undefined4 param_4, undefined4 param_5, undefined4 param_6); -void PrintMissionCompleteString(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,undefined1 param_5); +void PrintMissionCompleteString(undefined4 param_1, undefined4 param_2, undefined4 param_3, + undefined4 param_4, undefined1 param_5); void InitSecretBazaarDialogueInfo(void); void OpenMenu(undefined param_1, undefined param_2, bool open_bag); void StairsMenuAfterStep(struct entity* leader, bool leave_minimap_closed_after); diff --git a/headers/types/files/rescue.h b/headers/types/files/rescue.h index 8adbe1eb..a2620680 100644 --- a/headers/types/files/rescue.h +++ b/headers/types/files/rescue.h @@ -125,17 +125,16 @@ struct mission_categories_table { }; ASSERT_SIZE(struct mission_categories_table, 640); - -// The unpacked rescue.bin file after being loaded in arm9. +// The unpacked rescue.bin file after being loaded in arm9. struct rescue_bin_unpack { int mt_state; - struct rescue_str_variant_table *string_variants; - struct monster_id_16 *monster_table_entries; - struct mission_weighted_category *all_categories; - struct item_id_16 *item_table_entries; - struct rescue_str_continuity_table *string_continuities; - struct mission_template *mission_templates; - struct mission_weighted_category *valid_categories; + struct rescue_str_variant_table* string_variants; + struct monster_id_16* monster_table_entries; + struct mission_weighted_category* all_categories; + struct item_id_16* item_table_entries; + struct rescue_str_continuity_table* string_continuities; + struct mission_template* mission_templates; + struct mission_weighted_category* valid_categories; int category_weight_sum; // Sum of all weighted categories - undefined *file_pointer; // Points to the raw rescue.bin file loaded in memory. + undefined* file_pointer; // Points to the raw rescue.bin file loaded in memory. }; diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 213544b3..19dea00b 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -4574,6 +4574,8 @@ arm9: - name: FillCopyToFlatVramCommand address: EU: 0x201AB74 + NA: 0x201AAD8 + JP: 0x201AB30 description: |- Fills the command contained in a copy_to_obj_vram_order struct with the specified values. @@ -4606,6 +4608,8 @@ arm9: - name: LoadObjPalette address: EU: 0x201B4D8 + NA: 0x201B43C + JP: 0x201B494 description: |- Loads an object palette into obj_graphics_control, from which it will be copied into VRAM. @@ -4616,6 +4620,8 @@ arm9: - name: AddSimpleObjToOam address: EU: 0x201BA94 + NA: 0x201B9F8 + JP: 0x201BA50 description: |- Adds a simple object (one not tied to an animation_control struct) to OAM. @@ -4629,14 +4635,20 @@ arm9: - name: GroupOamAttributesWrapper address: EU: 0x201BB38 + NA: 0x201BA9C + JP: 0x201BAF4 description: "r0: obj_graphics_control" - name: CopyAttributesToOamWrapper address: EU: 0x201BB48 + NA: 0x201BAAC + JP: 0x201BB04 description: "r0: obj_graphics_control" - name: ChangeSimpleObjTexture address: EU: 0x201BB64 + NA: 0x201BAC8 + JP: 0x201BB20 description: |- Changes the texture in VRAM of all objects that use the specified OAM tile number. Used for simple objects (ones not tied to an animation_control struct). @@ -4649,6 +4661,8 @@ arm9: - name: InitObjGraphicsControls address: EU: 0x201BBD8 + NA: 0x201BB3C + JP: 0x201BB94 description: |- Initializes the obj_graphics_controls struct. @@ -4656,10 +4670,14 @@ arm9: - name: CopyAttributesToOamBothScreens address: EU: 0x201BE50 + NA: 0x201BDB4 + JP: 0x201BE0C description: No params. - name: GroupOamAttributesBothScreens address: EU: 0x201BEF8 + NA: 0x201BE5C + JP: 0x201BEB4 description: No params. - name: CopyAndInterleaveWrapper address: @@ -5275,6 +5293,8 @@ arm9: - name: FillPaletteInitInfo address: EU: 0x201F634 + NA: 0x201F598 + JP: 0x201F5F0 description: |- Fills a palette_init_info struct's fields with the given parameters, besides multi_ext_palettes which will always be made 0. @@ -11590,6 +11610,8 @@ arm9: - name: OamTileNumberToVramAddress address: EU: 0x2058E38 + NA: 0x2058ABC + JP: 0x2058DB8 description: |- Maps an object's designated OAM tile number (bits 0-9 in attribute 2) to the address its texture should be placed at in VRAM. @@ -12103,7 +12125,7 @@ arm9: Checks if a specified slot of the player's mission list is empty. r0: slot id - return: 1 if the slot is empty, 0 if not. + return: 1 if the slot is empty, 0 if not. - name: WasMissionCompletedToday address: EU: 0x205F494 @@ -12394,7 +12416,7 @@ arm9: EU: 0x20625C4 description: |- Seems to select a mission_weighted_category at weighted random, of the valid options. - + r0: sum of mission weight categories r1: ? r2: mission_weighted_category pointers to select at random. @@ -15712,14 +15734,14 @@ arm9: EU: 0x20B0898 description: |- The mults for the "twist" of a Mersenne Twister, 0x0 and 0x9908B0DF. - + type: int[2] - name: MT_TABLE address: EU: 0x20B0898 description: |- A full Mersenne Twister table. Only known to be used by mission generation. - + type: int[624] - name: ITEM_TABLES_PTRS_1 address: @@ -15863,7 +15885,7 @@ arm9: EU: 0x20B141C description: |- The unpacked contents of the RESCUE/rescue.bin file. Also contains a mersenne twister state, for some reason. - + type: rescue_bin_unpack struct - name: SMD_EVENTS_FUN_TABLE address: diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 9ca26e14..445eea06 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -390,6 +390,8 @@ overlay29: - name: OamTileNumberToVramAddressOv29 address: EU: 0x22E186C + NA: 0x22E0F2C + JP: 0x22E25BC description: |- Maps an object's designated OAM tile number (bits 0-9 in attribute 2) to the address its texture should be placed at in VRAM. @@ -1466,6 +1468,8 @@ overlay29: - name: AnimateWaterShadows address: EU: 0x22EAFFC + NA: 0x22EA64C + JP: 0x22EBCB4 description: |- Animates the water shadows beneath entities. @@ -4283,6 +4287,8 @@ overlay29: - name: DisplayMonsterShadow address: EU: 0x2304888 + NA: 0x2303E5C + JP: 0x23053AC description: |- Displays a shadow under a monster. @@ -9429,7 +9435,7 @@ overlay29: The first YesNoMenu uses a text string id from the param of this function. r0: int - return: undefined4 + return: undefined4 - name: IsItemUnkMissionItem2 address: EU: 0x2349900 From 15766f0e0f68313b9b9d35a2c8911ba4a12686cd Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 6 Jun 2026 18:33:01 -0400 Subject: [PATCH 048/117] Revert "Ground Mode Discoveries and more!" --- headers/data/arm9.h | 5 -- headers/functions/arm9.h | 25 +----- headers/functions/overlay29.h | 17 ---- headers/types/files/rescue.h | 14 ---- symbols/arm9.yml | 154 +--------------------------------- symbols/overlay29.yml | 125 --------------------------- 6 files changed, 5 insertions(+), 335 deletions(-) diff --git a/headers/data/arm9.h b/headers/data/arm9.h index 1932b43c..3251c045 100644 --- a/headers/data/arm9.h +++ b/headers/data/arm9.h @@ -15,7 +15,6 @@ extern uint32_t MAX_MONEY_STORED; extern struct window_list* WINDOW_LIST_PTR; extern struct script_var_value_table* SCRIPT_VARS_VALUES_PTR; extern uint32_t MAX_PLAY_TIME; -int MT_MULT; extern uint32_t MONSTER_ID_LIMIT; extern uint32_t MAX_RECRUITABLE_TEAM_MEMBERS; extern int16_t SINE_VALUE_TABLE[1024]; @@ -254,9 +253,6 @@ extern struct monster_id_16 DEFAULT_PARTNER_ID; extern uint8_t GAME_MODE; extern struct global_progress* GLOBAL_PROGRESS_PTR; extern struct adventure_log* ADVENTURE_LOG_PTR; -extern int MT_TABLE_INDEX; -extern int TWIST_LOW_BIT_MULTS[2]; -extern int MT_TABLE[624]; extern void* ITEM_TABLES_PTRS_1[26]; extern struct monster_data_table* MONSTER_DATA_TABLE_PTR; extern enum monster_id* UNOWN_SPECIES_ADDITIONAL_CHAR_PTR_TABLE[28]; @@ -270,7 +266,6 @@ extern int MISSION_MONSTER_COUNT; extern undefined* MISSION_LIST_PTR; extern const char* REMOTE_STRING_PTR_TABLE[7]; extern const char* RANK_STRING_PTR_TABLE[16]; -extern struct rescue_bin_unpack RESCUE_BIN_UNPACK; extern void* SMD_EVENTS_FUN_TABLE[127]; extern int16_t MUSIC_DURATION_LOOKUP_TABLE_1[128]; extern int32_t MUSIC_DURATION_LOOKUP_TABLE_2[128]; diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 7bd9cd07..87e4c3b8 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -446,7 +446,6 @@ void OpenWaza(int waza_id); void SelectWaza(int waza_id); void PlayBgmByIdVeneer(enum music_id music_id); void PlayBgmByIdVolumeVeneer(enum music_id music_id, undefined param_2, int volume); -bool IsMePlaying(int me_id); void PlaySeByIdVolumeWrapper(int index); void PlaySeVolumeWrapper(int index); void PlayBgmById(enum music_id music_id); @@ -822,10 +821,6 @@ void InitInventoryMenuInput(struct inventory_menu_input_ctx* input_ctx, struct w struct window_extra_info* window_extra_info, struct window_rectangle* rect, int n_items, int n_items_per_page, undefined param_7); -void InventoryMenuNextPage(struct inventory_menu_input_ctx* param_1); -void InventoryMenuPreviousPage(struct inventory_menu_input_ctx* param_1); -void InventoryMenuNext10Pages(struct inventory_menu_input_ctx* param_1); -void InventoryMenuPrevious10Pages(struct inventory_menu_input_ctx* param_1); bool OverlayLoadEntriesEqual(struct overlay_load_entry* entry1, struct overlay_load_entry* entry2); void FreeActiveMenu(void); bool InitMenu(struct overlay_load_entry* entry); @@ -951,7 +946,6 @@ int GetScenarioBalance(void); void ScenarioFlagRestore(void); void ScenarioFlagBackup(void); void InitWorldMapScriptVars(void); -void SetWorldMapLevel(undefined4 param_1); void InitDungeonListScriptVars(void); void SetDungeonConquest(enum dungeon_id dungeon_id, int bit_value); enum dungeon_mode GetDungeonMode(enum dungeon_id dungeon_id); @@ -1068,8 +1062,6 @@ uint32_t GetPlayTimeSeconds(struct play_time* igt); uint32_t SubFixedPoint(uint32_t val_fp, uint32_t dec_fp); uint32_t BinToDecFixedPoint(ufx32_16* q16); int CeilFixedPoint(uint32_t val_fp); -void MtInit(int32_t initial_seed); -int32_t MtNext(void); bool DungeonGoesUp(enum dungeon_id dungeon_id); int GetTurnLimit(enum dungeon_id dungeon_id); bool DoesNotSaveWhenEntering(enum dungeon_id dungeon_id); @@ -1147,8 +1139,6 @@ void GuestMonsterToGroundMonster(struct ground_monster* ground_monster, struct guest_monster* guest_monster); void SetBaseStatsMovesGroundMonster(struct ground_monster* ground_monster); bool StrcmpMonsterName(char* string, enum monster_id monster_id); -void InitializeTeamMemberFromMentry(struct team_member* param_1, struct ground_monster* param_2, - int32_t param_3); void GetLvlUpEntry(struct level_up_entry* level_up_entry, enum monster_id monster_id, int level); uint8_t* GetEncodedHalfword(uint8_t* data_ptr, uint16_t* result); int GetEvoFamily(undefined* monster, undefined* evo_family); @@ -1277,7 +1267,6 @@ int DungeonRequestsDoneWrapper(uint8_t param_1); bool AnyDungeonRequestsDone(uint8_t param_1); bool AddMissionToJobList(struct mission* mission); struct mission* GetAcceptedMission(uint8_t mission_id); -bool IsAcceptedMissionSlotEmpty(int param_1); bool WasMissionCompletedToday(struct mission_result_and_client* param_1, struct mission* param_2, enum mission_type param_3); int GetMissionByTypeAndDungeon(int start_index, enum mission_type mission_type, @@ -1315,8 +1304,6 @@ undefined PrintWonderMailSkyCode(undefined param_1, undefined param_2, undefined void AppendMissionObjective(char* param_1, int param_2, undefined4 param_3, uint32_t param_4, short param_5); void AppendMissionDungeonLocation(struct mission_details* param_1, char* buffer, int param_3); -uint32_t RandomizeMissionCategory(uint32_t MissionWghtSum, uint32_t param_2, - struct mission_weighted_category* param_3); bool SumValidMissionCategoryWeights(undefined4 mission_vendor); struct mission_template* GetRandomMissionTemplate(void); undefined4 LoadMissionTemplates(void); @@ -1336,8 +1323,6 @@ void GenerateMissionRewards(struct mission* MissionPtr, int IsCafeMission); undefined4 CheckDungeonMissionUnlockConditions(enum dungeon_id param_1); bool IsAvailableItem(enum item_id item_id); int GetAvailableItemDeliveryList(undefined* item_buffer); -void WriteMissionMtState(int32_t* state_ptr); -int16_t ReadMissionMtStateLower(void); void ZeroInitMissionRewardDataStruct(struct mission_reward_data* param_1); enum monster_id GetScriptEntityMonsterId(enum script_entity_id entity_id); int GetScriptEntityMatchingStorageId(enum script_entity_id entity_id); @@ -1345,12 +1330,10 @@ void SetActorTalkMainAndActorTalkSub(enum script_entity_id actor_id_main, enum script_entity_id actor_id_sub); void SetActorTalkMain(enum script_entity_id actor_id); void SetActorTalkSub(enum script_entity_id actor_id); -void SetActorEventMain(enum script_entity_id actor_id); -void SetRandomRequestNpcs1And2(enum script_entity_id actor_id1, enum script_entity_id actor_id2); -void SetRandomRequestNpc03KindVar(enum monster_id param_1); -void SetAllEventNpcs(enum script_entity_id param_1, enum script_entity_id param_2, - enum script_entity_id param_3, enum script_entity_id param_4); -void SetNewFriendActor(enum script_entity_id param_1); +void SetActorEventMain(undefined2 param_1); +void SetRandomRequestNpcs1And2(undefined2 param_1, undefined2 param_2); +void SetAllEventNpcs(undefined2 param_1, undefined2 param_2, undefined2 param_3, + undefined2 param_4); void RandomizeDemoActors(void); void ItemAtTableIdx(int idx, struct bulk_item* item); void MainLoop(void); diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index c368b784..a272f5f4 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -3,7 +3,6 @@ #include "overlay29/move_effects.h" -void InitDungeonPalatteStruct(void); struct rgba* GetWeatherColorTable(enum weather_id); struct dungeon* DungeonAlloc(void); struct dungeon* GetDungeonPtrMaster(void); @@ -26,7 +25,6 @@ uint32_t GetSuccessfulExitTracker(void); void GetAndStoreButtonInput(void); bool CheckTouchscreenArea(int x1, int y1, int x2, int y2); void* OamTileNumberToVramAddressOv29(short oam_tile_num, uint8_t screen); -void ResetDungeonColorPalette(void); struct trap* GetTrapInfo(struct entity* trap_entity); struct item* GetItemInfo(struct entity* item_entity); struct tile* GetTileAtEntity(struct entity* entity); @@ -107,7 +105,6 @@ void AssignTopScreenHandlers(void** funcs, top_screen_status_fn_t init_func, top_screen_status_fn_t free_func); void HandleTopScreenFades(void); int FreeTopScreen(void); -void DungeonChangeTopScreenType(int param_1); enum direction_id GetDirectionTowardsPosition(struct position* origin, struct position* target); int GetChebyshevDistance(struct position* position_a, struct position* position_b); bool IsPositionActuallyInSight(struct position* origin, struct position* target, @@ -144,10 +141,8 @@ void DungeonRngUnsetSecondary(void); void DungeonRngSetSecondary(int i); void DungeonRngSetPrimary(void); void PlaySeByIdIfNotSilence(int se_id); -void PlayMeByIdIfNot998(int me_id); enum music_id MusicTableIdxToMusicId(int music_table_idx); void ChangeDungeonMusic(enum music_id music_id); -void SetUnkMusicFlag(uint8_t param_1); void TrySwitchPlace(struct entity* user, struct entity* target); void ResetLeaderActionFields(bool clear_additional_fields); void SetLeaderActionFields(enum action action_id); @@ -158,7 +153,6 @@ struct item* GetItemToUseByIndex(struct entity* entity, union item_index item_in struct item* GetItemToUse(struct entity* entity, int param_index, undefined param_3); enum action GetItemAction(enum item_id item_id); void RemoveUsedItem(struct entity* entity, int param_index); -void ConvertTmToUsedTm(void); void AddDungeonSubMenuOption(int action_id, bool enabled); void DisableDungeonSubMenuOption(int action_id); void SetActionRegularAttack(struct action_data* monster_action, enum direction_id direction); @@ -172,8 +166,6 @@ bool RunLeaderTurn(undefined param_1); void TrySpawnMonsterAndActivatePlusMinus(void); bool IsFloorOver(void); void DecrementWindCounter(void); -void CreateMonsterSummaryFromEntityOuter(union damage_source_16 param_1, struct entity* param_2, - struct monster* param_3, int param_4); bool IsDungeonEndReasonFailure(void); void SetForcedLossReason(enum forced_loss_reason forced_loss_reason); enum forced_loss_reason GetForcedLossReason(void); @@ -216,7 +208,6 @@ bool DebugRecruitingEnabled(void); void TryActivateIqBooster(void); bool IsBehaviorLoneOutlaw(enum monster_behavior behavior); bool IsSecretBazaarNpcBehavior(enum monster_behavior behavior); -void GonePebbleGradualPaletteShift(struct rgba* param_1, uint32_t param_2); struct action_16* GetLeaderAction(void); enum action_id GetLeaderActionId(void); void GetEntityTouchscreenArea(struct entity* entity, struct touchscreen_area* area); @@ -271,7 +262,6 @@ bool CheckTeamMemberIdxVeneer(int member_idx); bool IsMonsterIdInNormalRangeVeneer(enum monster_id monster_id); void BoostIQ(struct entity* entity, int iq_boost, bool suppress_logs); bool ShouldMonsterHeadToStairs(struct entity* entity); -void DisplayLinkedMovesWarnings(struct entity* param_1, int move_slot); bool MewSpawnCheck(enum monster_id monster_id, bool fail_if_mew); void TryEndStatusWithAbility(struct entity* attacker, struct entity* defender); bool ExclusiveItemEffectIsActive(struct entity* entity, enum exclusive_item_effect_id effect_id); @@ -294,7 +284,6 @@ void ResetTriggerFlags(struct entity* entity); bool IsSpecialStoryAlly(struct monster* monster); bool IsExperienceLocked(struct monster* monster); struct entity* FindMonsterWithBehavior(enum monster_behavior monster_behavior); -undefined4 CountActiveMonsters(void); bool IsMonsterLoneOutlaw(struct monster* monster); bool IsSecretBazaarNpc(struct entity* entity); bool IsTeamMemberOnFirstTurnInFixedRoom(struct monster* monster); @@ -963,7 +952,6 @@ void DisplayFloorCard(int duration); void HandleFloorCard(enum dungeon_id dungeon_id, uint8_t floor, int duration, enum hidden_stairs_type hidden_stairs_type); void FillMissionDestinationInfo(void); -undefined4 MissionExitPrompt(int param_1); bool IsItemUnkMissionItem2(struct item* item); bool CheckActiveChallengeRequest(void); struct mission_destination_info* GetMissionDestination(void); @@ -990,13 +978,10 @@ enum monster_id GetMissionTargetEnemy(void); enum monster_id GetMissionEnemyMinionGroup(int i); void SetTargetMonsterNotFoundFlag(bool value); bool GetTargetMonsterNotFoundFlag(void); -void ClearMissionDestinationInfo(struct mission_destination_info* param_1); bool FloorHasMissionMonster(struct mission_destination_info* mission_dst); struct mission* GetMissionIfActiveOnFloor(struct dungeon_floor_pair* pair, uint8_t mission_id); void GenerateMissionEggMonster(struct mission* mission); struct entity* GetFirstExperienceLockedTeamMember(void); -void TryCompleteMission(int param_1, int param_2); -void TreasureMemoComplete(void); void TeleportFleeingOutlaw(void); void InitAlertBoxInfo(void); void FreeAlertBoxInfo(void); @@ -1049,8 +1034,6 @@ void DisplayMessage2(struct portrait_params* portrait, int message_id, bool wait bool YesNoMenu(undefined param_1, int string_id, int default_option, undefined param_4); void DisplayMessageInternal(int message_id, bool wait_for_input, struct portrait_params* portrait, undefined4 param_4, undefined4 param_5, undefined4 param_6); -void PrintMissionCompleteString(undefined4 param_1, undefined4 param_2, undefined4 param_3, - undefined4 param_4, undefined1 param_5); void InitSecretBazaarDialogueInfo(void); void OpenMenu(undefined param_1, undefined param_2, bool open_bag); void StairsMenuAfterStep(struct entity* leader, bool leave_minimap_closed_after); diff --git a/headers/types/files/rescue.h b/headers/types/files/rescue.h index a2620680..982e89e1 100644 --- a/headers/types/files/rescue.h +++ b/headers/types/files/rescue.h @@ -124,17 +124,3 @@ struct mission_categories_table { struct mission_weighted_category unused_category; }; ASSERT_SIZE(struct mission_categories_table, 640); - -// The unpacked rescue.bin file after being loaded in arm9. -struct rescue_bin_unpack { - int mt_state; - struct rescue_str_variant_table* string_variants; - struct monster_id_16* monster_table_entries; - struct mission_weighted_category* all_categories; - struct item_id_16* item_table_entries; - struct rescue_str_continuity_table* string_continuities; - struct mission_template* mission_templates; - struct mission_weighted_category* valid_categories; - int category_weight_sum; // Sum of all weighted categories - undefined* file_pointer; // Points to the raw rescue.bin file loaded in memory. -}; diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 19dea00b..bdba053c 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -4305,15 +4305,6 @@ arm9: r0: Music ID r1: (?) Stored on byte 8 on the struct passed to SendAudioCommand r2: Volume (0-255) - - name: IsMePlaying - address: - EU: 0x2017CAC - description: |- - Seems to check if the specified ME effect is currently active. Has some kind of special logic for unknown ME value 0x3E6, which is not known to be a valid ME value... - MEs are usually short jingles that are used when notifying the player of something, like unlocking a dungeon or receiving an item. - - r0: ME_id - return: 1 if that ME is playing, 0 if not. - name: PlaySeByIdVolumeWrapper address: EU: 0x2017D1C @@ -7607,38 +7598,6 @@ arm9: stack[0]: total number of selectable items stack[1]: number of selectable items per page stack[2]: ? - - name: InventoryMenuNextPage - address: - EU: 0x2033578 - description: |- - Tries to go to the next page of an inventory_menu window. - - - r0: struct inventory_menu_input_ctx - - name: InventoryMenuPreviousPage - address: - EU: 0x20335A0 - description: |- - Tries to go to the previous page of an inventory_menu window. - - - r0: struct inventory_menu_input_ctx - - name: InventoryMenuNext10Pages - address: - EU: 0x20335C0 - description: |- - Tries to go forward by 10 pages in an inventory_menu window. - - - r0: struct inventory_menu_input_ctx - - name: InventoryMenuPrevious10Pages - address: - EU: 0x20335E4 - description: |- - Tries to go backward by 10 pages in an inventory_menu window. - - - r0: struct inventory_menu_input_ctx - name: OverlayLoadEntriesEqual address: EU: 0x2034A94 @@ -8844,13 +8803,6 @@ arm9: Initializes the WORLD_MAP_* script variable values (IDs 0x55-0x57). No params. - - name: SetWorldMapLevel - address: - EU: 0x204D120 - description: |- - Calls SaveScriptVariableValue with script variable $WORLD_MAP_LEVEL. - - r0: value to save - name: InitDungeonListScriptVars address: EU: 0x204D1C8 @@ -10031,20 +9983,6 @@ arm9: r0: number return: ceil(number) - - name: MtInit - address: - EU: 0x2051420 - description: |- - Initializes the MT_TABLE Mersenne Twister with a specified initial seed. - - r0: seed - - name: MtNext - address: - EU: 0x205146C - description: |- - Advances the MT_TABLE Mersenne Twister by one, and returns the result. - - return: next rand - name: DungeonGoesUp address: EU: 0x20515C0 @@ -10842,15 +10780,6 @@ arm9: r0: string_buffer r1: monster ID return: bool - - name: InitializeTeamMemberFromMentry - address: - EU: 0x20535CC - description: |- - Seems to copy a ground_monster pokemon from the Chimecho Assembly to the active team. - - r0: team_member pointer - r1: ground_monster pointer - r2: team_member index - name: GetLvlUpEntry address: EU: 0x2053B18 @@ -12118,14 +12047,6 @@ arm9: r0: mission id in player's job list return: mission struct pointer - - name: IsAcceptedMissionSlotEmpty - address: - EU: 0x205F46C - description: |- - Checks if a specified slot of the player's mission list is empty. - - r0: slot id - return: 1 if the slot is empty, 0 if not. - name: WasMissionCompletedToday address: EU: 0x205F494 @@ -12411,22 +12332,13 @@ arm9: r0: mission_details pointer r1: buffer r2: buffer size - - name: RandomizeMissionCategory - address: - EU: 0x20625C4 - description: |- - Seems to select a mission_weighted_category at weighted random, of the valid options. - - r0: sum of mission weight categories - r1: ? - r2: mission_weighted_category pointers to select at random. - return: mission_weighted_category index, selected at random - name: SumValidMissionCategoryWeights address: EU: 0x206260C description: |- Seems to tally up the total weights for each mission_category under a specified mission vendor. + r0: 0 for job board, 1 for outlaw board, 2 for cafe client, 3 for beach bottle return: 1 if the total weight is non-zero, 0 if not. - name: GetRandomMissionTemplate @@ -12607,21 +12519,6 @@ arm9: r0: item_buffer return: Number of deliverable items for a mission - - name: WriteMissionMtState - address: - EU: 0x2063870 - description: |- - Stores a Mersenne Twister state to RESCUE_BIN_UNPACK->mt_state. - - - r0: state pointer - - name: ReadMissionMtStateLower - address: - EU: 0x2063880 - description: |- - Returns the bottom half of RESCUE_BIN_UNPACK->mt_state. - - return: bottom half of the current mt_state. - name: ZeroInitMissionRewardDataStruct address: EU: 0x2063898 @@ -12697,13 +12594,6 @@ arm9: r0: ACTOR_REQUEST_NPC01 actor_id r1: ACTOR_REQUEST_NPC02 actor_id - - name: SetRandomRequestNpc03KindVar - address: - EU: 0x2065F10 - description: |- - Sets the RANDOM_REQUEST_NPC03_KIND script variable, which controls the species of ACTOR_REQUEST_NPC03. - - r0: species to store in RANDOM_REQUEST_NPC03_KIND. - name: SetAllEventNpcs address: EU: 0x2065F28 @@ -12714,13 +12604,6 @@ arm9: r1: ACTOR_EVENT_NPC02 actor_id r2: ACTOR_EVENT_NPC03 actor_id r3: ACTOR_EVENT_NPC04 actor_id - - name: SetNewFriendActor - address: - EU: 0x2065F44 - description: |- - Sets NPC_NEW_FRIEND to a specific actor_id. - - r0: NPC_NEW_FRIEND actor_id - name: RandomizeDemoActors address: EU: 0x2065FC4 @@ -12928,13 +12811,6 @@ arm9: Maximum number of seconds that the file timer counts up to. 35999999 seconds (one second under 10000 hours). - - name: MT_MULT - address: - EU: 0x2051464 - description: |- - The standard mult for Mersenne Twister initialization, 0x6C078965. - - type: int - name: MONSTER_ID_LIMIT address: EU: 0x2054818 @@ -15722,27 +15598,6 @@ arm9: [Runtime] type: struct adventure_log* - - name: MT_TABLE_INDEX - address: - EU: 0x20B0898 - description: |- - The current index of the Mersenne Twister Table. - - type: int - - name: TWIST_LOW_BIT_MULTS - address: - EU: 0x20B0898 - description: |- - The mults for the "twist" of a Mersenne Twister, 0x0 and 0x9908B0DF. - - type: int[2] - - name: MT_TABLE - address: - EU: 0x20B0898 - description: |- - A full Mersenne Twister table. Only known to be used by mission generation. - - type: int[624] - name: ITEM_TABLES_PTRS_1 address: EU: 0x20B1264 @@ -15880,13 +15735,6 @@ arm9: Note: unverified, ported from Irdkwia's notes type: const char*[16] - - name: RESCUE_BIN_UNPACK - address: - EU: 0x20B141C - description: |- - The unpacked contents of the RESCUE/rescue.bin file. Also contains a mersenne twister state, for some reason. - - type: rescue_bin_unpack struct - name: SMD_EVENTS_FUN_TABLE address: EU: 0x20B14D4 diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 445eea06..ce66733a 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -18,13 +18,6 @@ overlay29: subregions: - move_effects.yml functions: - - name: InitDungeonPalatteStruct - address: - EU: 0x22DEC40 - description: |- - Seems to initialize the dungeon_palette_struct, which likely handles background color display in dungeon mode. - - No params. - name: GetWeatherColorTable address: EU: 0x22DEF60 @@ -400,13 +393,6 @@ overlay29: r0: tile number r1: 0 for bottom screen, 1 for top screen return: VRAM tile address - - name: ResetDungeonColorPalette - address: - EU: 0x22E1E4C - description: |- - Zeroes the entire color_table in the dungeon struct. - - No params. - name: GetTrapInfo address: EU: 0x22E1F48 @@ -1268,13 +1254,6 @@ overlay29: Gets called twice when fading out the top screen. First it calls the free_func of the top screen type and sets the handlers to null and on the second pass it just returns. return: always 1, seems unused - - name: DungeonChangeTopScreenType - address: - EU: 0x22E9658 - description: |- - Seems to change the top screen display type in dungeon mode. - - r0: index of top screen mode to change to - name: GetDirectionTowardsPosition address: EU: 0x22E99D0 @@ -1648,14 +1627,6 @@ overlay29: Plays the specified sound effect if it is not the designated silence value (0x3F00). r0: Sound effect ID - - name: PlayMeByIdIfNot998 - address: - EU: 0x22EB694 - description: |- - Plays the specified ME effect if it is not a specific unknown ME value (0x3E6). This is not known to be a valid ME value... - MEs are usually short jingles that are used when notifying the player of something, like unlocking a dungeon or receiving an item. - - r0: ME_id - name: MusicTableIdxToMusicId address: EU: 0x22EB6B0 @@ -1675,14 +1646,6 @@ overlay29: Replace the currently playing music with the provided music r0: music ID - - name: SetUnkMusicFlag - address: - EU: 0x22EB8E4 - description: |- - Seems to set some kind of flag in the dungeon struct that affects bgm in some way. - Called in ApplyDamage immediately before and after reviving a pokemon, as well as other places. - - r0: uint8_t - name: TrySwitchPlace address: EU: 0x22EBB28 @@ -1792,15 +1755,6 @@ overlay29: r0: Pointer to the entity that used the item r1: Parameter index in monster::action_data::action_parameters. Will be used to use to determine the index of the used item. - - name: ConvertTmToUsedTm - address: - EU: 0x22EC018 - description: |- - Seems to be responsible for turning a TM into a Used TM after use. Explicitly checks if the TM is an HM, and if so, does not transform it. - - r0: Pointer to the entity that used the TM. - r1: Parameter index in monster::action_data::action_parameters. Will be used to use to determine the index of the used item. - No params. - name: AddDungeonSubMenuOption address: EU: 0x22EC1CC @@ -1912,17 +1866,6 @@ overlay29: Decrements dungeon::wind_turns and displays a wind warning message if required. No params. - - name: CreateMonsterSummaryFromEntityOuter - address: - EU: 0x22ED794 - description: |- - Seems to be the parent function for CreateMonsterSummaryFromEntity. - Sets the fainted_monster_dungeon_end_reason field to a damage_source. - - r0: damage_source_16 - r1: entity pointer - r2: monster pointer - r3: int - name: IsDungeonEndReasonFailure address: EU: 0x22ED8F4 @@ -2329,14 +2272,6 @@ overlay29: r0: monster behavior ID return: bool - - name: GonePebbleGradualPaletteShift - address: - EU: 0x22F1210 - description: |- - Seems to be responsible for the palette shift of the dungeon background for the Gone Pebble item effect. - - r0: rgba table pointer - r1: uint - name: GetLeaderAction address: EU: 0x22F1540 @@ -2906,14 +2841,6 @@ overlay29: r0: Entity pointer return: True if the monster should try to reach the stairs, false otherwise - - name: DisplayLinkedMovesWarnings - address: - EU: 0x22FAF80 - description: |- - Seems to handle displaying the text string for linked moves de-linking when at 2, 1, or 0 PP. - - r0: entity pointer - r1: move_slot id - name: MewSpawnCheck address: EU: 0x22FAFFC @@ -3183,13 +3110,6 @@ overlay29: r0: monster behavior to search for return: the first entity in the dungeon with the given monster behavior, or null if not found - - name: CountActiveMonsters - address: - EU: 0x22FC648 - description: |- - Loops through the monster entity table, counting the number of valid entities. - - return: number of monsters on the floor - name: IsMonsterLoneOutlaw address: EU: 0x22FC7DC @@ -9427,15 +9347,6 @@ overlay29: Fills the dungeon::mission_destination_info field with information from the currently active mission on the floor, if one is present. No params. - - name: MissionExitPrompt - address: - EU: 0x2349618 - description: |- - Responsible for asking the player if they want to leave the dungeon after a mission via nested YesNoMenu() calls. - The first YesNoMenu uses a text string id from the param of this function. - - r0: int - return: undefined4 - name: IsItemUnkMissionItem2 address: EU: 0x2349900 @@ -9685,14 +9596,6 @@ overlay29: Gets the value of dungeon::target_monster_not_found_flag. return: dungeon::target_monster_not_found_flag - - name: ClearMissionDestinationInfo - address: - EU: 0x234A2EC - description: |- - Zeroes all fields of a mission_destination_info struct. - Seems to be called as part of FillMissionDestinationInfo, and one other place. - - r0: mission_destination_info pointer - name: FloorHasMissionMonster address: EU: 0x234A348 @@ -9745,22 +9648,6 @@ overlay29: Returns a null pointer instead if none are present. return: entity pointer - - name: TryCompleteMission - address: - EU: 0x234A6D4 - description: |- - Seems to check if the mission on the current floor has been completed. Each mission type seems to use the params differently. - - r0: target monster_id or arrest outlaw item_id? - r1: treasure memo item_id? - - name: TreasureMemoComplete - address: - EU: 0x234B88C - description: |- - Seems to run when a treasure memo mission has been completed. - Handles the fanfare for completing the mission, runs TryCompleteMission, and calls MissionExitPrompt. - - No params. - name: TeleportFleeingOutlaw address: EU: 0x234BAA4 @@ -10228,18 +10115,6 @@ overlay29: r3: ? stack[0]: ? stack[1]: ? - - name: PrintMissionCompleteString - address: - EU: 0x234E30C - description: |- - Seems to handle the displaying the textbox for completing a specific kind of mission. - Only known to be called by TreasureMemoComplete. - - r0: string_id to play for completing the mission. - r1: ? - r2: ? - r3: ? - stack[0]: ? - name: InitSecretBazaarDialogueInfo address: EU: 0x234E758 From e91a851b91dc340217d58edc8559878611cd21f2 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 6 Jun 2026 18:34:06 -0400 Subject: [PATCH 049/117] Revert "Revert "Ground Mode Discoveries and more!"" --- headers/data/arm9.h | 5 ++ headers/functions/arm9.h | 25 +++++- headers/functions/overlay29.h | 17 ++++ headers/types/files/rescue.h | 14 ++++ symbols/arm9.yml | 154 +++++++++++++++++++++++++++++++++- symbols/overlay29.yml | 125 +++++++++++++++++++++++++++ 6 files changed, 335 insertions(+), 5 deletions(-) diff --git a/headers/data/arm9.h b/headers/data/arm9.h index 3251c045..1932b43c 100644 --- a/headers/data/arm9.h +++ b/headers/data/arm9.h @@ -15,6 +15,7 @@ extern uint32_t MAX_MONEY_STORED; extern struct window_list* WINDOW_LIST_PTR; extern struct script_var_value_table* SCRIPT_VARS_VALUES_PTR; extern uint32_t MAX_PLAY_TIME; +int MT_MULT; extern uint32_t MONSTER_ID_LIMIT; extern uint32_t MAX_RECRUITABLE_TEAM_MEMBERS; extern int16_t SINE_VALUE_TABLE[1024]; @@ -253,6 +254,9 @@ extern struct monster_id_16 DEFAULT_PARTNER_ID; extern uint8_t GAME_MODE; extern struct global_progress* GLOBAL_PROGRESS_PTR; extern struct adventure_log* ADVENTURE_LOG_PTR; +extern int MT_TABLE_INDEX; +extern int TWIST_LOW_BIT_MULTS[2]; +extern int MT_TABLE[624]; extern void* ITEM_TABLES_PTRS_1[26]; extern struct monster_data_table* MONSTER_DATA_TABLE_PTR; extern enum monster_id* UNOWN_SPECIES_ADDITIONAL_CHAR_PTR_TABLE[28]; @@ -266,6 +270,7 @@ extern int MISSION_MONSTER_COUNT; extern undefined* MISSION_LIST_PTR; extern const char* REMOTE_STRING_PTR_TABLE[7]; extern const char* RANK_STRING_PTR_TABLE[16]; +extern struct rescue_bin_unpack RESCUE_BIN_UNPACK; extern void* SMD_EVENTS_FUN_TABLE[127]; extern int16_t MUSIC_DURATION_LOOKUP_TABLE_1[128]; extern int32_t MUSIC_DURATION_LOOKUP_TABLE_2[128]; diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 87e4c3b8..7bd9cd07 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -446,6 +446,7 @@ void OpenWaza(int waza_id); void SelectWaza(int waza_id); void PlayBgmByIdVeneer(enum music_id music_id); void PlayBgmByIdVolumeVeneer(enum music_id music_id, undefined param_2, int volume); +bool IsMePlaying(int me_id); void PlaySeByIdVolumeWrapper(int index); void PlaySeVolumeWrapper(int index); void PlayBgmById(enum music_id music_id); @@ -821,6 +822,10 @@ void InitInventoryMenuInput(struct inventory_menu_input_ctx* input_ctx, struct w struct window_extra_info* window_extra_info, struct window_rectangle* rect, int n_items, int n_items_per_page, undefined param_7); +void InventoryMenuNextPage(struct inventory_menu_input_ctx* param_1); +void InventoryMenuPreviousPage(struct inventory_menu_input_ctx* param_1); +void InventoryMenuNext10Pages(struct inventory_menu_input_ctx* param_1); +void InventoryMenuPrevious10Pages(struct inventory_menu_input_ctx* param_1); bool OverlayLoadEntriesEqual(struct overlay_load_entry* entry1, struct overlay_load_entry* entry2); void FreeActiveMenu(void); bool InitMenu(struct overlay_load_entry* entry); @@ -946,6 +951,7 @@ int GetScenarioBalance(void); void ScenarioFlagRestore(void); void ScenarioFlagBackup(void); void InitWorldMapScriptVars(void); +void SetWorldMapLevel(undefined4 param_1); void InitDungeonListScriptVars(void); void SetDungeonConquest(enum dungeon_id dungeon_id, int bit_value); enum dungeon_mode GetDungeonMode(enum dungeon_id dungeon_id); @@ -1062,6 +1068,8 @@ uint32_t GetPlayTimeSeconds(struct play_time* igt); uint32_t SubFixedPoint(uint32_t val_fp, uint32_t dec_fp); uint32_t BinToDecFixedPoint(ufx32_16* q16); int CeilFixedPoint(uint32_t val_fp); +void MtInit(int32_t initial_seed); +int32_t MtNext(void); bool DungeonGoesUp(enum dungeon_id dungeon_id); int GetTurnLimit(enum dungeon_id dungeon_id); bool DoesNotSaveWhenEntering(enum dungeon_id dungeon_id); @@ -1139,6 +1147,8 @@ void GuestMonsterToGroundMonster(struct ground_monster* ground_monster, struct guest_monster* guest_monster); void SetBaseStatsMovesGroundMonster(struct ground_monster* ground_monster); bool StrcmpMonsterName(char* string, enum monster_id monster_id); +void InitializeTeamMemberFromMentry(struct team_member* param_1, struct ground_monster* param_2, + int32_t param_3); void GetLvlUpEntry(struct level_up_entry* level_up_entry, enum monster_id monster_id, int level); uint8_t* GetEncodedHalfword(uint8_t* data_ptr, uint16_t* result); int GetEvoFamily(undefined* monster, undefined* evo_family); @@ -1267,6 +1277,7 @@ int DungeonRequestsDoneWrapper(uint8_t param_1); bool AnyDungeonRequestsDone(uint8_t param_1); bool AddMissionToJobList(struct mission* mission); struct mission* GetAcceptedMission(uint8_t mission_id); +bool IsAcceptedMissionSlotEmpty(int param_1); bool WasMissionCompletedToday(struct mission_result_and_client* param_1, struct mission* param_2, enum mission_type param_3); int GetMissionByTypeAndDungeon(int start_index, enum mission_type mission_type, @@ -1304,6 +1315,8 @@ undefined PrintWonderMailSkyCode(undefined param_1, undefined param_2, undefined void AppendMissionObjective(char* param_1, int param_2, undefined4 param_3, uint32_t param_4, short param_5); void AppendMissionDungeonLocation(struct mission_details* param_1, char* buffer, int param_3); +uint32_t RandomizeMissionCategory(uint32_t MissionWghtSum, uint32_t param_2, + struct mission_weighted_category* param_3); bool SumValidMissionCategoryWeights(undefined4 mission_vendor); struct mission_template* GetRandomMissionTemplate(void); undefined4 LoadMissionTemplates(void); @@ -1323,6 +1336,8 @@ void GenerateMissionRewards(struct mission* MissionPtr, int IsCafeMission); undefined4 CheckDungeonMissionUnlockConditions(enum dungeon_id param_1); bool IsAvailableItem(enum item_id item_id); int GetAvailableItemDeliveryList(undefined* item_buffer); +void WriteMissionMtState(int32_t* state_ptr); +int16_t ReadMissionMtStateLower(void); void ZeroInitMissionRewardDataStruct(struct mission_reward_data* param_1); enum monster_id GetScriptEntityMonsterId(enum script_entity_id entity_id); int GetScriptEntityMatchingStorageId(enum script_entity_id entity_id); @@ -1330,10 +1345,12 @@ void SetActorTalkMainAndActorTalkSub(enum script_entity_id actor_id_main, enum script_entity_id actor_id_sub); void SetActorTalkMain(enum script_entity_id actor_id); void SetActorTalkSub(enum script_entity_id actor_id); -void SetActorEventMain(undefined2 param_1); -void SetRandomRequestNpcs1And2(undefined2 param_1, undefined2 param_2); -void SetAllEventNpcs(undefined2 param_1, undefined2 param_2, undefined2 param_3, - undefined2 param_4); +void SetActorEventMain(enum script_entity_id actor_id); +void SetRandomRequestNpcs1And2(enum script_entity_id actor_id1, enum script_entity_id actor_id2); +void SetRandomRequestNpc03KindVar(enum monster_id param_1); +void SetAllEventNpcs(enum script_entity_id param_1, enum script_entity_id param_2, + enum script_entity_id param_3, enum script_entity_id param_4); +void SetNewFriendActor(enum script_entity_id param_1); void RandomizeDemoActors(void); void ItemAtTableIdx(int idx, struct bulk_item* item); void MainLoop(void); diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index a272f5f4..c368b784 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -3,6 +3,7 @@ #include "overlay29/move_effects.h" +void InitDungeonPalatteStruct(void); struct rgba* GetWeatherColorTable(enum weather_id); struct dungeon* DungeonAlloc(void); struct dungeon* GetDungeonPtrMaster(void); @@ -25,6 +26,7 @@ uint32_t GetSuccessfulExitTracker(void); void GetAndStoreButtonInput(void); bool CheckTouchscreenArea(int x1, int y1, int x2, int y2); void* OamTileNumberToVramAddressOv29(short oam_tile_num, uint8_t screen); +void ResetDungeonColorPalette(void); struct trap* GetTrapInfo(struct entity* trap_entity); struct item* GetItemInfo(struct entity* item_entity); struct tile* GetTileAtEntity(struct entity* entity); @@ -105,6 +107,7 @@ void AssignTopScreenHandlers(void** funcs, top_screen_status_fn_t init_func, top_screen_status_fn_t free_func); void HandleTopScreenFades(void); int FreeTopScreen(void); +void DungeonChangeTopScreenType(int param_1); enum direction_id GetDirectionTowardsPosition(struct position* origin, struct position* target); int GetChebyshevDistance(struct position* position_a, struct position* position_b); bool IsPositionActuallyInSight(struct position* origin, struct position* target, @@ -141,8 +144,10 @@ void DungeonRngUnsetSecondary(void); void DungeonRngSetSecondary(int i); void DungeonRngSetPrimary(void); void PlaySeByIdIfNotSilence(int se_id); +void PlayMeByIdIfNot998(int me_id); enum music_id MusicTableIdxToMusicId(int music_table_idx); void ChangeDungeonMusic(enum music_id music_id); +void SetUnkMusicFlag(uint8_t param_1); void TrySwitchPlace(struct entity* user, struct entity* target); void ResetLeaderActionFields(bool clear_additional_fields); void SetLeaderActionFields(enum action action_id); @@ -153,6 +158,7 @@ struct item* GetItemToUseByIndex(struct entity* entity, union item_index item_in struct item* GetItemToUse(struct entity* entity, int param_index, undefined param_3); enum action GetItemAction(enum item_id item_id); void RemoveUsedItem(struct entity* entity, int param_index); +void ConvertTmToUsedTm(void); void AddDungeonSubMenuOption(int action_id, bool enabled); void DisableDungeonSubMenuOption(int action_id); void SetActionRegularAttack(struct action_data* monster_action, enum direction_id direction); @@ -166,6 +172,8 @@ bool RunLeaderTurn(undefined param_1); void TrySpawnMonsterAndActivatePlusMinus(void); bool IsFloorOver(void); void DecrementWindCounter(void); +void CreateMonsterSummaryFromEntityOuter(union damage_source_16 param_1, struct entity* param_2, + struct monster* param_3, int param_4); bool IsDungeonEndReasonFailure(void); void SetForcedLossReason(enum forced_loss_reason forced_loss_reason); enum forced_loss_reason GetForcedLossReason(void); @@ -208,6 +216,7 @@ bool DebugRecruitingEnabled(void); void TryActivateIqBooster(void); bool IsBehaviorLoneOutlaw(enum monster_behavior behavior); bool IsSecretBazaarNpcBehavior(enum monster_behavior behavior); +void GonePebbleGradualPaletteShift(struct rgba* param_1, uint32_t param_2); struct action_16* GetLeaderAction(void); enum action_id GetLeaderActionId(void); void GetEntityTouchscreenArea(struct entity* entity, struct touchscreen_area* area); @@ -262,6 +271,7 @@ bool CheckTeamMemberIdxVeneer(int member_idx); bool IsMonsterIdInNormalRangeVeneer(enum monster_id monster_id); void BoostIQ(struct entity* entity, int iq_boost, bool suppress_logs); bool ShouldMonsterHeadToStairs(struct entity* entity); +void DisplayLinkedMovesWarnings(struct entity* param_1, int move_slot); bool MewSpawnCheck(enum monster_id monster_id, bool fail_if_mew); void TryEndStatusWithAbility(struct entity* attacker, struct entity* defender); bool ExclusiveItemEffectIsActive(struct entity* entity, enum exclusive_item_effect_id effect_id); @@ -284,6 +294,7 @@ void ResetTriggerFlags(struct entity* entity); bool IsSpecialStoryAlly(struct monster* monster); bool IsExperienceLocked(struct monster* monster); struct entity* FindMonsterWithBehavior(enum monster_behavior monster_behavior); +undefined4 CountActiveMonsters(void); bool IsMonsterLoneOutlaw(struct monster* monster); bool IsSecretBazaarNpc(struct entity* entity); bool IsTeamMemberOnFirstTurnInFixedRoom(struct monster* monster); @@ -952,6 +963,7 @@ void DisplayFloorCard(int duration); void HandleFloorCard(enum dungeon_id dungeon_id, uint8_t floor, int duration, enum hidden_stairs_type hidden_stairs_type); void FillMissionDestinationInfo(void); +undefined4 MissionExitPrompt(int param_1); bool IsItemUnkMissionItem2(struct item* item); bool CheckActiveChallengeRequest(void); struct mission_destination_info* GetMissionDestination(void); @@ -978,10 +990,13 @@ enum monster_id GetMissionTargetEnemy(void); enum monster_id GetMissionEnemyMinionGroup(int i); void SetTargetMonsterNotFoundFlag(bool value); bool GetTargetMonsterNotFoundFlag(void); +void ClearMissionDestinationInfo(struct mission_destination_info* param_1); bool FloorHasMissionMonster(struct mission_destination_info* mission_dst); struct mission* GetMissionIfActiveOnFloor(struct dungeon_floor_pair* pair, uint8_t mission_id); void GenerateMissionEggMonster(struct mission* mission); struct entity* GetFirstExperienceLockedTeamMember(void); +void TryCompleteMission(int param_1, int param_2); +void TreasureMemoComplete(void); void TeleportFleeingOutlaw(void); void InitAlertBoxInfo(void); void FreeAlertBoxInfo(void); @@ -1034,6 +1049,8 @@ void DisplayMessage2(struct portrait_params* portrait, int message_id, bool wait bool YesNoMenu(undefined param_1, int string_id, int default_option, undefined param_4); void DisplayMessageInternal(int message_id, bool wait_for_input, struct portrait_params* portrait, undefined4 param_4, undefined4 param_5, undefined4 param_6); +void PrintMissionCompleteString(undefined4 param_1, undefined4 param_2, undefined4 param_3, + undefined4 param_4, undefined1 param_5); void InitSecretBazaarDialogueInfo(void); void OpenMenu(undefined param_1, undefined param_2, bool open_bag); void StairsMenuAfterStep(struct entity* leader, bool leave_minimap_closed_after); diff --git a/headers/types/files/rescue.h b/headers/types/files/rescue.h index 982e89e1..a2620680 100644 --- a/headers/types/files/rescue.h +++ b/headers/types/files/rescue.h @@ -124,3 +124,17 @@ struct mission_categories_table { struct mission_weighted_category unused_category; }; ASSERT_SIZE(struct mission_categories_table, 640); + +// The unpacked rescue.bin file after being loaded in arm9. +struct rescue_bin_unpack { + int mt_state; + struct rescue_str_variant_table* string_variants; + struct monster_id_16* monster_table_entries; + struct mission_weighted_category* all_categories; + struct item_id_16* item_table_entries; + struct rescue_str_continuity_table* string_continuities; + struct mission_template* mission_templates; + struct mission_weighted_category* valid_categories; + int category_weight_sum; // Sum of all weighted categories + undefined* file_pointer; // Points to the raw rescue.bin file loaded in memory. +}; diff --git a/symbols/arm9.yml b/symbols/arm9.yml index bdba053c..19dea00b 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -4305,6 +4305,15 @@ arm9: r0: Music ID r1: (?) Stored on byte 8 on the struct passed to SendAudioCommand r2: Volume (0-255) + - name: IsMePlaying + address: + EU: 0x2017CAC + description: |- + Seems to check if the specified ME effect is currently active. Has some kind of special logic for unknown ME value 0x3E6, which is not known to be a valid ME value... + MEs are usually short jingles that are used when notifying the player of something, like unlocking a dungeon or receiving an item. + + r0: ME_id + return: 1 if that ME is playing, 0 if not. - name: PlaySeByIdVolumeWrapper address: EU: 0x2017D1C @@ -7598,6 +7607,38 @@ arm9: stack[0]: total number of selectable items stack[1]: number of selectable items per page stack[2]: ? + - name: InventoryMenuNextPage + address: + EU: 0x2033578 + description: |- + Tries to go to the next page of an inventory_menu window. + + + r0: struct inventory_menu_input_ctx + - name: InventoryMenuPreviousPage + address: + EU: 0x20335A0 + description: |- + Tries to go to the previous page of an inventory_menu window. + + + r0: struct inventory_menu_input_ctx + - name: InventoryMenuNext10Pages + address: + EU: 0x20335C0 + description: |- + Tries to go forward by 10 pages in an inventory_menu window. + + + r0: struct inventory_menu_input_ctx + - name: InventoryMenuPrevious10Pages + address: + EU: 0x20335E4 + description: |- + Tries to go backward by 10 pages in an inventory_menu window. + + + r0: struct inventory_menu_input_ctx - name: OverlayLoadEntriesEqual address: EU: 0x2034A94 @@ -8803,6 +8844,13 @@ arm9: Initializes the WORLD_MAP_* script variable values (IDs 0x55-0x57). No params. + - name: SetWorldMapLevel + address: + EU: 0x204D120 + description: |- + Calls SaveScriptVariableValue with script variable $WORLD_MAP_LEVEL. + + r0: value to save - name: InitDungeonListScriptVars address: EU: 0x204D1C8 @@ -9983,6 +10031,20 @@ arm9: r0: number return: ceil(number) + - name: MtInit + address: + EU: 0x2051420 + description: |- + Initializes the MT_TABLE Mersenne Twister with a specified initial seed. + + r0: seed + - name: MtNext + address: + EU: 0x205146C + description: |- + Advances the MT_TABLE Mersenne Twister by one, and returns the result. + + return: next rand - name: DungeonGoesUp address: EU: 0x20515C0 @@ -10780,6 +10842,15 @@ arm9: r0: string_buffer r1: monster ID return: bool + - name: InitializeTeamMemberFromMentry + address: + EU: 0x20535CC + description: |- + Seems to copy a ground_monster pokemon from the Chimecho Assembly to the active team. + + r0: team_member pointer + r1: ground_monster pointer + r2: team_member index - name: GetLvlUpEntry address: EU: 0x2053B18 @@ -12047,6 +12118,14 @@ arm9: r0: mission id in player's job list return: mission struct pointer + - name: IsAcceptedMissionSlotEmpty + address: + EU: 0x205F46C + description: |- + Checks if a specified slot of the player's mission list is empty. + + r0: slot id + return: 1 if the slot is empty, 0 if not. - name: WasMissionCompletedToday address: EU: 0x205F494 @@ -12332,13 +12411,22 @@ arm9: r0: mission_details pointer r1: buffer r2: buffer size + - name: RandomizeMissionCategory + address: + EU: 0x20625C4 + description: |- + Seems to select a mission_weighted_category at weighted random, of the valid options. + + r0: sum of mission weight categories + r1: ? + r2: mission_weighted_category pointers to select at random. + return: mission_weighted_category index, selected at random - name: SumValidMissionCategoryWeights address: EU: 0x206260C description: |- Seems to tally up the total weights for each mission_category under a specified mission vendor. - r0: 0 for job board, 1 for outlaw board, 2 for cafe client, 3 for beach bottle return: 1 if the total weight is non-zero, 0 if not. - name: GetRandomMissionTemplate @@ -12519,6 +12607,21 @@ arm9: r0: item_buffer return: Number of deliverable items for a mission + - name: WriteMissionMtState + address: + EU: 0x2063870 + description: |- + Stores a Mersenne Twister state to RESCUE_BIN_UNPACK->mt_state. + + + r0: state pointer + - name: ReadMissionMtStateLower + address: + EU: 0x2063880 + description: |- + Returns the bottom half of RESCUE_BIN_UNPACK->mt_state. + + return: bottom half of the current mt_state. - name: ZeroInitMissionRewardDataStruct address: EU: 0x2063898 @@ -12594,6 +12697,13 @@ arm9: r0: ACTOR_REQUEST_NPC01 actor_id r1: ACTOR_REQUEST_NPC02 actor_id + - name: SetRandomRequestNpc03KindVar + address: + EU: 0x2065F10 + description: |- + Sets the RANDOM_REQUEST_NPC03_KIND script variable, which controls the species of ACTOR_REQUEST_NPC03. + + r0: species to store in RANDOM_REQUEST_NPC03_KIND. - name: SetAllEventNpcs address: EU: 0x2065F28 @@ -12604,6 +12714,13 @@ arm9: r1: ACTOR_EVENT_NPC02 actor_id r2: ACTOR_EVENT_NPC03 actor_id r3: ACTOR_EVENT_NPC04 actor_id + - name: SetNewFriendActor + address: + EU: 0x2065F44 + description: |- + Sets NPC_NEW_FRIEND to a specific actor_id. + + r0: NPC_NEW_FRIEND actor_id - name: RandomizeDemoActors address: EU: 0x2065FC4 @@ -12811,6 +12928,13 @@ arm9: Maximum number of seconds that the file timer counts up to. 35999999 seconds (one second under 10000 hours). + - name: MT_MULT + address: + EU: 0x2051464 + description: |- + The standard mult for Mersenne Twister initialization, 0x6C078965. + + type: int - name: MONSTER_ID_LIMIT address: EU: 0x2054818 @@ -15598,6 +15722,27 @@ arm9: [Runtime] type: struct adventure_log* + - name: MT_TABLE_INDEX + address: + EU: 0x20B0898 + description: |- + The current index of the Mersenne Twister Table. + + type: int + - name: TWIST_LOW_BIT_MULTS + address: + EU: 0x20B0898 + description: |- + The mults for the "twist" of a Mersenne Twister, 0x0 and 0x9908B0DF. + + type: int[2] + - name: MT_TABLE + address: + EU: 0x20B0898 + description: |- + A full Mersenne Twister table. Only known to be used by mission generation. + + type: int[624] - name: ITEM_TABLES_PTRS_1 address: EU: 0x20B1264 @@ -15735,6 +15880,13 @@ arm9: Note: unverified, ported from Irdkwia's notes type: const char*[16] + - name: RESCUE_BIN_UNPACK + address: + EU: 0x20B141C + description: |- + The unpacked contents of the RESCUE/rescue.bin file. Also contains a mersenne twister state, for some reason. + + type: rescue_bin_unpack struct - name: SMD_EVENTS_FUN_TABLE address: EU: 0x20B14D4 diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index ce66733a..445eea06 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -18,6 +18,13 @@ overlay29: subregions: - move_effects.yml functions: + - name: InitDungeonPalatteStruct + address: + EU: 0x22DEC40 + description: |- + Seems to initialize the dungeon_palette_struct, which likely handles background color display in dungeon mode. + + No params. - name: GetWeatherColorTable address: EU: 0x22DEF60 @@ -393,6 +400,13 @@ overlay29: r0: tile number r1: 0 for bottom screen, 1 for top screen return: VRAM tile address + - name: ResetDungeonColorPalette + address: + EU: 0x22E1E4C + description: |- + Zeroes the entire color_table in the dungeon struct. + + No params. - name: GetTrapInfo address: EU: 0x22E1F48 @@ -1254,6 +1268,13 @@ overlay29: Gets called twice when fading out the top screen. First it calls the free_func of the top screen type and sets the handlers to null and on the second pass it just returns. return: always 1, seems unused + - name: DungeonChangeTopScreenType + address: + EU: 0x22E9658 + description: |- + Seems to change the top screen display type in dungeon mode. + + r0: index of top screen mode to change to - name: GetDirectionTowardsPosition address: EU: 0x22E99D0 @@ -1627,6 +1648,14 @@ overlay29: Plays the specified sound effect if it is not the designated silence value (0x3F00). r0: Sound effect ID + - name: PlayMeByIdIfNot998 + address: + EU: 0x22EB694 + description: |- + Plays the specified ME effect if it is not a specific unknown ME value (0x3E6). This is not known to be a valid ME value... + MEs are usually short jingles that are used when notifying the player of something, like unlocking a dungeon or receiving an item. + + r0: ME_id - name: MusicTableIdxToMusicId address: EU: 0x22EB6B0 @@ -1646,6 +1675,14 @@ overlay29: Replace the currently playing music with the provided music r0: music ID + - name: SetUnkMusicFlag + address: + EU: 0x22EB8E4 + description: |- + Seems to set some kind of flag in the dungeon struct that affects bgm in some way. + Called in ApplyDamage immediately before and after reviving a pokemon, as well as other places. + + r0: uint8_t - name: TrySwitchPlace address: EU: 0x22EBB28 @@ -1755,6 +1792,15 @@ overlay29: r0: Pointer to the entity that used the item r1: Parameter index in monster::action_data::action_parameters. Will be used to use to determine the index of the used item. + - name: ConvertTmToUsedTm + address: + EU: 0x22EC018 + description: |- + Seems to be responsible for turning a TM into a Used TM after use. Explicitly checks if the TM is an HM, and if so, does not transform it. + + r0: Pointer to the entity that used the TM. + r1: Parameter index in monster::action_data::action_parameters. Will be used to use to determine the index of the used item. + No params. - name: AddDungeonSubMenuOption address: EU: 0x22EC1CC @@ -1866,6 +1912,17 @@ overlay29: Decrements dungeon::wind_turns and displays a wind warning message if required. No params. + - name: CreateMonsterSummaryFromEntityOuter + address: + EU: 0x22ED794 + description: |- + Seems to be the parent function for CreateMonsterSummaryFromEntity. + Sets the fainted_monster_dungeon_end_reason field to a damage_source. + + r0: damage_source_16 + r1: entity pointer + r2: monster pointer + r3: int - name: IsDungeonEndReasonFailure address: EU: 0x22ED8F4 @@ -2272,6 +2329,14 @@ overlay29: r0: monster behavior ID return: bool + - name: GonePebbleGradualPaletteShift + address: + EU: 0x22F1210 + description: |- + Seems to be responsible for the palette shift of the dungeon background for the Gone Pebble item effect. + + r0: rgba table pointer + r1: uint - name: GetLeaderAction address: EU: 0x22F1540 @@ -2841,6 +2906,14 @@ overlay29: r0: Entity pointer return: True if the monster should try to reach the stairs, false otherwise + - name: DisplayLinkedMovesWarnings + address: + EU: 0x22FAF80 + description: |- + Seems to handle displaying the text string for linked moves de-linking when at 2, 1, or 0 PP. + + r0: entity pointer + r1: move_slot id - name: MewSpawnCheck address: EU: 0x22FAFFC @@ -3110,6 +3183,13 @@ overlay29: r0: monster behavior to search for return: the first entity in the dungeon with the given monster behavior, or null if not found + - name: CountActiveMonsters + address: + EU: 0x22FC648 + description: |- + Loops through the monster entity table, counting the number of valid entities. + + return: number of monsters on the floor - name: IsMonsterLoneOutlaw address: EU: 0x22FC7DC @@ -9347,6 +9427,15 @@ overlay29: Fills the dungeon::mission_destination_info field with information from the currently active mission on the floor, if one is present. No params. + - name: MissionExitPrompt + address: + EU: 0x2349618 + description: |- + Responsible for asking the player if they want to leave the dungeon after a mission via nested YesNoMenu() calls. + The first YesNoMenu uses a text string id from the param of this function. + + r0: int + return: undefined4 - name: IsItemUnkMissionItem2 address: EU: 0x2349900 @@ -9596,6 +9685,14 @@ overlay29: Gets the value of dungeon::target_monster_not_found_flag. return: dungeon::target_monster_not_found_flag + - name: ClearMissionDestinationInfo + address: + EU: 0x234A2EC + description: |- + Zeroes all fields of a mission_destination_info struct. + Seems to be called as part of FillMissionDestinationInfo, and one other place. + + r0: mission_destination_info pointer - name: FloorHasMissionMonster address: EU: 0x234A348 @@ -9648,6 +9745,22 @@ overlay29: Returns a null pointer instead if none are present. return: entity pointer + - name: TryCompleteMission + address: + EU: 0x234A6D4 + description: |- + Seems to check if the mission on the current floor has been completed. Each mission type seems to use the params differently. + + r0: target monster_id or arrest outlaw item_id? + r1: treasure memo item_id? + - name: TreasureMemoComplete + address: + EU: 0x234B88C + description: |- + Seems to run when a treasure memo mission has been completed. + Handles the fanfare for completing the mission, runs TryCompleteMission, and calls MissionExitPrompt. + + No params. - name: TeleportFleeingOutlaw address: EU: 0x234BAA4 @@ -10115,6 +10228,18 @@ overlay29: r3: ? stack[0]: ? stack[1]: ? + - name: PrintMissionCompleteString + address: + EU: 0x234E30C + description: |- + Seems to handle the displaying the textbox for completing a specific kind of mission. + Only known to be called by TreasureMemoComplete. + + r0: string_id to play for completing the mission. + r1: ? + r2: ? + r3: ? + stack[0]: ? - name: InitSecretBazaarDialogueInfo address: EU: 0x234E758 From cbcc3a628d58c5c9b90b527fb4f7d590b4e28310 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 7 Jun 2026 19:40:26 -0400 Subject: [PATCH 050/117] Apply Fixes from Review --- headers/data/arm9.h | 7 +- headers/data/overlay20.h | 1 + headers/functions/arm9.h | 72 ++-- headers/functions/overlay10.h | 2 +- headers/functions/overlay11.h | 2 +- headers/functions/overlay20.h | 14 +- headers/types/common/common.h | 12 +- headers/types/common/enums.h | 9 + headers/types/ground_mode/ground_mode.h | 525 +----------------------- symbols/arm9.yml | 21 +- symbols/overlay10.yml | 4 +- symbols/overlay11.yml | 16 + symbols/overlay20.yml | 28 +- symbols/overlay26.yml | 43 +- 14 files changed, 137 insertions(+), 619 deletions(-) diff --git a/headers/data/arm9.h b/headers/data/arm9.h index 3251c045..6324322d 100644 --- a/headers/data/arm9.h +++ b/headers/data/arm9.h @@ -139,13 +139,13 @@ extern fx32_8 DAMAGE_FORMULA_LN_PREFACTOR; extern fx32_8 DAMAGE_FORMULA_DEF_PREFACTOR; extern fx32_8 DAMAGE_FORMULA_AT_PREFACTOR; extern fx32_8 DAMAGE_FORMULA_LN_ARG_PREFACTOR; -extern uint8_t OUTLAW_HIDEOUT_FIXED_ROOM_IDS[5]; -extern uint8_t CHALLENGE_NORMAL_FIXED_ROOM_IDS[5]; +extern struct fixed_room_id_8 OUTLAW_HIDEOUT_FIXED_ROOM_IDS[5]; +extern struct fixed_room_id_8 CHALLENGE_NORMAL_FIXED_ROOM_IDS[5]; extern bool TACTICS_FOLLOW_LEADER[12]; extern struct forbidden_forgot_move_entry FORBIDDEN_FORGOT_MOVE_LIST[3]; extern struct type_id_8 CONVERSION2_TYPE_TABLE[18]; extern int16_t TACTICS_UNLOCK_LEVEL_TABLE[12]; -extern uint8_t TREASURE_MEMO_FIXED_ROOM_IDS[30]; +extern struct fixed_room_id_8 TREASURE_MEMO_FIXED_ROOM_IDS[30]; extern int16_t CLIENT_LEVEL_TABLE[16]; extern int16_t OUTLAW_LEVEL_TABLE[16]; extern int16_t OUTLAW_MINION_LEVEL_TABLE[16]; @@ -236,7 +236,6 @@ extern void* ITEM_DATA_TABLE_PTRS[3]; #if PMDSKY_VERSION == PMDSKY_EU extern char* ITEM_LANG_FILE_ARRAY[5]; #endif - extern struct synth_file* SYNTH_BIN_FILE_PTR; extern struct move_data_table* MOVE_DATA_TABLE_PTR; extern struct obj_graphics_controls* OBJ_GRAPHICS_CONTROLS_PTR; diff --git a/headers/data/overlay20.h b/headers/data/overlay20.h index 1f834faa..9341979d 100644 --- a/headers/data/overlay20.h +++ b/headers/data/overlay20.h @@ -25,4 +25,5 @@ extern struct recycle_shop_main* RECYCLE_SHOP_MAIN_STRUCT_PTR; extern struct recycle_unk_struct_0x84* RECYCLE_SHOP_UNK_STRUCT_SIZE_84H_PTR; extern struct recycle_unk_struct_0x340* RECYCLE_SHOP_UNK_STRUCT_SIZE_340H_PTR; extern struct recycle_unk_struct_0x1cc* RECYCLE_SHOP_UNK_STRUCT_SIZE_1CCH_PTR; + #endif diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 87e4c3b8..deb2043d 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -277,7 +277,7 @@ int GetMoneyStored(void); void SetMoneyStored(int amount); void AddMoneyStored(int amount); enum monster_id GetEggSpecies(void); -void SetEggSpecies(struct monster_id_16 param_1); +void SetEggSpecies(enum monster_id param_1); undefined2 GetUnkGameState0x13a6(void); void SetUnkGameState0x13a6(undefined2 param_1); uint16_t GetEggHatchTimer(void); @@ -308,7 +308,7 @@ bool GetExclusiveItemForMonsterFromBag(struct item* item, enum exclusive_item_ef enum monster_id monster_id, enum type_id type1, enum type_id type2); int GetHpBoostFromExclusiveItems(undefined* param_1); -void SwapShopFreeDoublePointer(void); +void SwapShopFreeDoublePointer(undefined** param_1); void ApplyGummiBoostsToGroundMonster(struct ground_monster* ground_monster, enum item_id item_id, bool not_boost_stats, struct gummi_result* gummi_result); void ApplyGummiBoostsToTeamMember(struct team_member* team_member, enum item_id item_id, @@ -332,7 +332,7 @@ int ApplyNectarBoostToGroundMonster(struct ground_monster* ground_monster, bool IsMonsterAffectedByGravelyrockGroundMode(struct ground_monster* ground_monster); int ApplyGravelyrockBoostToGroundMonster(struct ground_monster* ground_monster, int* attempted_iq_boost_out); -void ApplyGummiBoostsGroundMode(struct monster_id_16* monster_id, uint16_t* monster_iq, +void ApplyGummiBoostsGroundMode(enum monster_id* monster_id, uint16_t* monster_iq, uint8_t* monster_offensive_stats, uint8_t* monster_defensive_stats, enum item_id item_id, bool not_boost_stats, struct gummi_result* gummi_result); @@ -346,18 +346,18 @@ bool RecycleShopTradeIsNonspecific(struct recycle_item** param_1); bool RecycleShopOfferExists(void); void ClearRecycleShopOffer(void); uint32_t GetGameStateRecycleCount(void); -struct rank_8 GetRankForRecycleShop(void); +enum rank GetRankForRecycleShop(void); void IncrementRecycleCountVar(void); void UpdateRecycleShop(void); void DecrementRecycleOfferCooldown(void); bool IsRecycleOfferCooldownOver(void); int GetRecycleOfferCooldown(void); bool RecycleShopIsNotThrownItem(enum item_id param_1); -bool RecycleShopIsTradableItem(enum item_id param_1, bool param_2); -int RecycleShopCountTradableItemsInBag(bool param_1); -int RecycleShopCountTradableItemsInStorage(bool param_1); +bool RecycleShopIsTradableItem(enum item_id param_1, bool disallow_tickets); +int RecycleShopCountTradableItemsInBag(bool disallow_tickets); +int RecycleShopCountTradableItemsInStorage(bool disallow_tickets); int CountValidRecycleShopItems(int filter, uint32_t recycles, enum rank rank); -bool IsRecycleTradeTypeValid(int param_1, int param_2); +bool IsRecycleTradeTypeValid(int filter, int trade_type); void ClearCroagunkItems(void); bool LoadSynthBin(void); void CloseSynthBin(void); @@ -1180,7 +1180,7 @@ void GetNbRecruited(undefined* recruit); bool IsValidTeamMember(int member_idx); bool IsMainCharacter(int member_idx); struct ground_monster* GetTeamMember(int member_idx); -int GetRecruitMentryIdBySpecies(enum monster_id param_1, int param_2); +int GetRecruitMentryIdBySpecies(enum monster_id param_1, int num_to_skip); int GetHeroMemberIdx(void); int GetPartnerMemberIdx(void); int GetMainCharacter1MemberIdx(void); @@ -1208,8 +1208,8 @@ void RemoveActiveMembersFromMainTeam(void); void SetTeamSetupHeroAndPartnerOnly(void); void SetTeamSetupHeroOnly(void); int GetPartyMembers(uint16_t* party_members); -int GetAdventureNpcIds(struct monster_id_16* param_1); -int GetUnitNpcIds(struct monster_id_16* param_1); +int GetAdventureNpcIds(enum monster_id* param_1); +int GetUnitNpcIds(enum monster_id* param_1); void RefillTeam(void); void ValidateTeamMembers(bool* param_1); int ClearItem(int team_id, bool check); @@ -1251,14 +1251,14 @@ int GetSosMailCount(int param_1, bool param_2); bool IsMissionSuspendedAndValid(struct mission* mission); bool AreMissionsEquivalent(struct mission* mission1, struct mission* mission2); bool IsMissionValid(struct mission* mission); -bool CheckMonsterForMissionType(enum mission_type type, int* subtype, enum monster_id target, - bool param_4); -bool CheckItemForMissionType(enum mission_type type, int* subtype, enum item_id param_3); +bool CheckMonsterForMissionType(enum mission_type type, union mission_subtype* subtype, enum monster_id target, + bool allow_no_monster); +bool CheckItemForMissionType(enum mission_type type, union mission_subtype* subtype, enum item_id item); enum mission_generation_result GenerateMission(undefined* param_1, struct mission* mission_data); -int CountAndPopulateValidMissionTableMonsters(undefined4* param_1, undefined4* param_2); +int CountAndPopulateValidMissionTableMonsters(enum monster_id* monster_table, undefined4* range); bool IsMissionTypeSpecialEpisode(struct mission* mission); -bool DoesMissionHaveTypeAndSubtype(struct mission, struct mission_type_8* type, int* subtype); -bool AlreadyHasSimilarMission(struct mission_type_8* type, int8_t* subtype_8); +bool DoesMissionHaveTypeAndSubtype(struct mission, struct mission_type_8* type, union mission_subtype* subtype); +bool AlreadyHasSimilarMission(struct mission_type_8* type, union mission_subtype* subtype); void GenerateDailyMissions(void); bool AlreadyHaveMission(struct mission* mission); int CountJobListMissions(void); @@ -1281,8 +1281,8 @@ void DeleteAllPossibleDungeonsList(void); int GenerateAllPossibleDeliverList(void); void DeleteAllPossibleDeliverList(void); void ClearMissionData(struct mission* mission); -int GetMissionSpecificFixedRoom(enum mission_type type, int subtype); -int8_t SelectRandomFixedRoomInRange(int8_t* fixed_rooms, int max); +enum fixed_room_id GetMissionSpecificFixedRoom(enum mission_type type, union mission_subtype subtype); +int8_t SelectRandomFixedRoomInRange(struct fixed_room_id_8* fixed_rooms, int max); void ReadRescueBinFile(void); void GenerateMissionDetailsStruct(struct mission* mission, struct mission_details* details, undefined param_3, undefined param_4); @@ -1290,37 +1290,37 @@ bool ValidateNormalChallengeMission(struct mission_template* valid_mission_info, struct mission* mission); bool ValidateLegendaryChallengeMission(struct mission_template* valid_mission_info, struct mission* mission); -int MatchMissionTemplateToMission(struct mission* param_1, undefined4 param_2); +struct mission_template* MatchMissionTemplateToMission(undefined4 table_index,struct mission* mission); void AppendMissionTitle(char* main_buffer, char* temp_buffer, struct preprocessor_args* args, struct mission_details* details); void FormatMissionHeader(char* buffer, struct mission_details* param_2); -void FormatSpecialEpisodeMissionHeader(char* param_1); +void FormatSpecialEpisodeMissionHeader(char* buffer); void AppendMissionSummary(char* main_buffer, char* temp_buffer, int window_id, int y_offset, struct preprocessor_args* args, struct mission_details* details); void MakeMissionDetails(struct mission_details* param_1, char* buffer, undefined param_3); -void MakeSpecialEpisodeMissionDetails(struct mission_details, undefined param_2); +void MakeSpecialEpisodeMissionDetails(struct mission_details details, undefined param_2); undefined PrintWonderMailSkyCode(undefined param_1, undefined param_2, undefined param_3, undefined param_4); -void AppendMissionObjective(char* param_1, int param_2, undefined4 param_3, uint32_t param_4, - short param_5); -void AppendMissionDungeonLocation(struct mission_details* param_1, char* buffer, int param_3); -bool SumValidMissionCategoryWeights(undefined4 mission_vendor); +void AppendMissionObjective(char* buffer, int buffer_size, undefined4 objective, enum monster_id monster, + enum item_id_16 item); +void AppendMissionDungeonLocation(struct mission_details* param_1, char* buffer, int buffer_size); +bool SumValidMissionCategoryWeights(enum mission_vendor vendor); struct mission_template* GetRandomMissionTemplate(void); -undefined4 LoadMissionTemplates(void); +struct mission_template* LoadMissionTemplates(void); bool IsMonsterMissionAllowed(enum monster_id monster_id); bool CanMonsterBeUsedForMissionWrapper(enum monster_id monster_id); bool CanMonsterBeUsedForMission(enum monster_id monster_id, bool check_story_banned); bool IsMonsterMissionAllowedStory(enum monster_id monster_id); bool IsMonsterIllegalForMissions(enum monster_id monster_id); bool CanDungeonBeUsedForMission(enum dungeon_id dungeon_id); -int8_t GetMissionRankWithCapAndModifiers(void); -int8_t GetMissionRankWithCapAndModifiersAndCap(void); +enum mission_rank GetMissionRankWithCapAndModifiers(struct dungeon_floor_pair* dungeon_floor_pair, enum mission_type type); +enum mission_rank GetMissionRankWithCapAndModifiersAndCap(struct dungeon_floor_pair* dungeon_floor_pair, enum mission_type type); bool CanSendItem(enum item_id item_id, bool to_sky); void InitMissionReward(struct mission* param_1, struct mission_reward_data* param_2, undefined4 param_3, undefined4 param_4); -void RollRandomItemReward(undefined4 param_1, undefined4 param_2, struct item_id_16* param_3); -void GenerateMissionRewards(struct mission* MissionPtr, int IsCafeMission); -undefined4 CheckDungeonMissionUnlockConditions(enum dungeon_id param_1); +void RollRandomItemReward(undefined4 param_1, undefined4 param_2, struct item_id_16* item_id); +void GenerateMissionRewards(struct mission* mission, bool is_cafe_mission); +int CheckDungeonMissionUnlockConditions(enum dungeon_id dungeon); bool IsAvailableItem(enum item_id item_id); int GetAvailableItemDeliveryList(undefined* item_buffer); void ZeroInitMissionRewardDataStruct(struct mission_reward_data* param_1); @@ -1330,10 +1330,10 @@ void SetActorTalkMainAndActorTalkSub(enum script_entity_id actor_id_main, enum script_entity_id actor_id_sub); void SetActorTalkMain(enum script_entity_id actor_id); void SetActorTalkSub(enum script_entity_id actor_id); -void SetActorEventMain(undefined2 param_1); -void SetRandomRequestNpcs1And2(undefined2 param_1, undefined2 param_2); -void SetAllEventNpcs(undefined2 param_1, undefined2 param_2, undefined2 param_3, - undefined2 param_4); +void SetActorEventMain(enum script_entity_id actor_id); +void SetRandomRequestNpcs1And2(enum script_entity_id actor_id_1, enum script_entity_id actor_id_2); +void SetAllEventNpcs(enum script_entity_id actor_id_1, enum script_entity_id actor_id_2, enum script_entity_id actor_id_3, + enum script_entity_id actor_id_4); void RandomizeDemoActors(void); void ItemAtTableIdx(int idx, struct bulk_item* item); void MainLoop(void); diff --git a/headers/functions/overlay10.h b/headers/functions/overlay10.h index 8aa3603b..0f3f74d9 100644 --- a/headers/functions/overlay10.h +++ b/headers/functions/overlay10.h @@ -13,7 +13,7 @@ uint8_t PopInventoryMenuField0x1A3(int window_id); void UpdateInventoryMenu(struct window* window); bool IsInventoryMenuState3(int window_id); void CreateInventoryMenuOuter(int n_items, int param_2, int param_3, uint8_t* param_4, - void* param_5, update_window_fn_t* param_6, uint32_t param_7); + undefined* param_5, update_window_fn_t* param_6, uint32_t param_7); int GetEffectAnimationField0x19(int anim_id); bool AnimationHasMoreFrames(int param_1); struct effect_animation* GetEffectAnimation(int anim_id); diff --git a/headers/functions/overlay11.h b/headers/functions/overlay11.h index 58964cc4..a728b85e 100644 --- a/headers/functions/overlay11.h +++ b/headers/functions/overlay11.h @@ -20,7 +20,7 @@ void StationLoadHanger(void); void ScriptStationLoadTalk(void); void SsbLoad1(void); void ReturnScriptMenuResultZero(void); -void ReturnScriptMenuResult(int param_1); +void ReturnScriptMenuResult(int case_id); bool IsScriptMenuReturnDisabled(void); int ScriptSpecialProcessCall(undefined4* param_1, enum special_process_id id, int arg1, int arg2); bool GetCoroutineInfo(struct coroutine_info* coroutine_info, enum common_routine_id coroutine_id); diff --git a/headers/functions/overlay20.h b/headers/functions/overlay20.h index 3ca4e14e..5d28e32f 100644 --- a/headers/functions/overlay20.h +++ b/headers/functions/overlay20.h @@ -7,18 +7,18 @@ void RecycleShopDestructor(void); undefined4 RecycleShopFrameUpdate(void); undefined4 RecycleShopCommonEntryPoint(bool resuming_menu); void PrintWynautTextbox(int strind_id); -void PrintWynautSimpleMenu(struct recycle_shop_main* param_1, undefined4 string_id, - struct simple_menu_id_item* param_3); -void RecycleShopTryHidePortraitBox(struct recycle_shop_main* param_1, bool param_2); -void PrintWynautNormalPortrait(struct recycle_shop_main* param_1); -void RecycleShopClosePortraitBox(struct recycle_shop_main* param_1); +void PrintWynautSimpleMenu(struct recycle_shop_main* recycle_shop_main, int string_id, + struct simple_menu_id_item* simple_menu_id_item); +void RecycleShopTryHidePortraitBox(struct recycle_shop_main* recycle_shop_main, bool param_2); +void PrintWynautNormalPortrait(struct recycle_shop_main* recycle_shop_main); +void RecycleShopClosePortraitBox(struct recycle_shop_main* recycle_shop_main); void RecycleShopCloseAllWindows(void); undefined4 RecycleShopHandleTopScreenWindow(void); void RecycleShopTopScreenDrawItemStats(int param_1); void RecycleShopTopScreenDrawItemName(int window_id); -void RecycleShopTopScreenDrawInfoWindow(int param_1, undefined4 param_2, undefined4 param_3, +void RecycleShopTopScreenDrawInfoWindow(int window_id, undefined4 param_2, undefined4 param_3, undefined4 param_4); void DisplaySelectionTutorialWindow(int window_id, undefined4 param_2, undefined4 param_3, undefined4 param_4); -#endif \ No newline at end of file +#endif diff --git a/headers/types/common/common.h b/headers/types/common/common.h index 15b3f6b9..b7d076f3 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -1442,8 +1442,8 @@ ASSERT_SIZE(struct diary_menu_main_menu_data, 3200); // mission_NPC_2 is misspelled to NCP02 in debug prints struct mission_result_and_client { int16_t mission_result; - struct monster_id_16 mission_NPC_1; - struct monster_id_16 mission_NPC_2; + struct monster_id_16 mission_npc_1; + struct monster_id_16 mission_npc_2; // Padding, if these fields even exist. undefined field_0x6; undefined field_0x7; @@ -1451,14 +1451,14 @@ struct mission_result_and_client { ASSERT_SIZE(struct mission_result_and_client, 8); // This substruct is exactly 0x6 bytes long. -#pragma pack(push, 2) +//#pragma pack(push, 2) // May actually be a union of several 0x6 byte structs... struct mission_reward_params { int16_t field_0x0; int16_t is_egg_or_item; // This seems to determine whether this struct describes an egg or item. int16_t item_or_recruit; // monster_id_16 of the recruit, or item_id_16 of the item. }; -#pragma pack(pop) +//#pragma pack(pop) ASSERT_SIZE(struct mission_reward_params, 6); struct mission_substruct_1 { @@ -1536,13 +1536,13 @@ struct mission_details { ASSERT_SIZE(struct mission_details, 104); // This struct is exactly 0x6 bytes long. -#pragma pack(push, 2) +//#pragma pack(push, 2) struct mission_reward_dialogue_sequence { int16_t case_id; struct preprocessor_flags preprocessor_flags; uint16_t text_string_id; }; -#pragma pack(pop) +//#pragma pack(pop) ASSERT_SIZE(struct mission_reward_dialogue_sequence, 6); struct mission_reward_struct_overlay { diff --git a/headers/types/common/enums.h b/headers/types/common/enums.h index 891dd7d7..179ab941 100644 --- a/headers/types/common/enums.h +++ b/headers/types/common/enums.h @@ -3931,6 +3931,15 @@ enum mission_reward_type { ENUM_8_BIT(mission_reward_type); #pragma pack(pop) + +enum mission_vendor { + MISSION_VENDOR_JOB_BOARD = 0, + MISSION_VENDOR_OUTLAW_BOARD = 1, + MISSION_VENDOR_SPINDA_CAFE = 2, + MISSION_VENDOR_BEACH_BOTTLE = 3, +}; + + // Different types of restrictions that a mission can have enum mission_restriction_type { MISSION_RESTRICTION_NONE = 0, diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index 1c36119f..740bf117 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -1233,7 +1233,7 @@ struct recycle_unk_struct_0x340 { int smenu_1_result_old; int starts_zero_1; int starts_zero_2; - int8_t uhhhh; + undefined field9_0x18; undefined field10_0x19; undefined field11_0x1a; undefined field12_0x1b; @@ -1243,528 +1243,11 @@ struct recycle_unk_struct_0x340 { undefined field16_0x26; undefined field17_0x27; int field18_0x28; - undefined field19_0x2c; - undefined field20_0x2d; - undefined field21_0x2e; - undefined field22_0x2f; - undefined field23_0x30; - undefined field24_0x31; - undefined field25_0x32; - undefined field26_0x33; - undefined field27_0x34; - undefined field28_0x35; - undefined field29_0x36; - undefined field30_0x37; - undefined field31_0x38; - undefined field32_0x39; - undefined field33_0x3a; - undefined field34_0x3b; - undefined field35_0x3c; - undefined field36_0x3d; - undefined field37_0x3e; - undefined field38_0x3f; - undefined field39_0x40; - undefined field40_0x41; - undefined field41_0x42; - undefined field42_0x43; - undefined field43_0x44; - undefined field44_0x45; - undefined field45_0x46; - undefined field46_0x47; - undefined field47_0x48; - undefined field48_0x49; - undefined field49_0x4a; - undefined field50_0x4b; - undefined field51_0x4c; - undefined field52_0x4d; - undefined field53_0x4e; - undefined field54_0x4f; - undefined field55_0x50; - undefined field56_0x51; - undefined field57_0x52; - undefined field58_0x53; - undefined field59_0x54; - undefined field60_0x55; - undefined field61_0x56; - undefined field62_0x57; - undefined field63_0x58; - undefined field64_0x59; - undefined field65_0x5a; - undefined field66_0x5b; - undefined field67_0x5c; - undefined field68_0x5d; - undefined field69_0x5e; - undefined field70_0x5f; - undefined field71_0x60; - undefined field72_0x61; - undefined field73_0x62; - undefined field74_0x63; - undefined field75_0x64; - undefined field76_0x65; - undefined field77_0x66; - undefined field78_0x67; - undefined field79_0x68; - undefined field80_0x69; - undefined field81_0x6a; - undefined field82_0x6b; - undefined field83_0x6c; - undefined field84_0x6d; - undefined field85_0x6e; - undefined field86_0x6f; - undefined field87_0x70; - undefined field88_0x71; - undefined field89_0x72; - undefined field90_0x73; - undefined field91_0x74; - undefined field92_0x75; - undefined field93_0x76; - undefined field94_0x77; - undefined field95_0x78; - undefined field96_0x79; - undefined field97_0x7a; - undefined field98_0x7b; - undefined field99_0x7c; - undefined field100_0x7d; - undefined field101_0x7e; - undefined field102_0x7f; - undefined field103_0x80; - undefined field104_0x81; - undefined field105_0x82; - undefined field106_0x83; - undefined field107_0x84; - undefined field108_0x85; - undefined field109_0x86; - undefined field110_0x87; - undefined field111_0x88; - undefined field112_0x89; - undefined field113_0x8a; - undefined field114_0x8b; - undefined field115_0x8c; - undefined field116_0x8d; - undefined field117_0x8e; - undefined field118_0x8f; + undefined field_0x2c[100]; int field119_0x90; - undefined field120_0x94; - undefined field121_0x95; - undefined field122_0x96; - undefined field123_0x97; - undefined field124_0x98; - undefined field125_0x99; - undefined field126_0x9a; - undefined field127_0x9b; - undefined field128_0x9c; - undefined field129_0x9d; - undefined field130_0x9e; - undefined field131_0x9f; - undefined field132_0xa0; - undefined field133_0xa1; - undefined field134_0xa2; - undefined field135_0xa3; - undefined field136_0xa4; - undefined field137_0xa5; - undefined field138_0xa6; - undefined field139_0xa7; - undefined field140_0xa8; - undefined field141_0xa9; - undefined field142_0xaa; - undefined field143_0xab; - undefined field144_0xac; - undefined field145_0xad; - undefined field146_0xae; - undefined field147_0xaf; - undefined field148_0xb0; - undefined field149_0xb1; - undefined field150_0xb2; - undefined field151_0xb3; + undefined field_0x94[32]; struct window_input_ctx window_input_ctx; - undefined field153_0x1ac; - undefined field154_0x1ad; - undefined field155_0x1ae; - undefined field156_0x1af; - undefined field157_0x1b0; - undefined field158_0x1b1; - undefined field159_0x1b2; - undefined field160_0x1b3; - undefined field161_0x1b4; - undefined field162_0x1b5; - undefined field163_0x1b6; - undefined field164_0x1b7; - undefined field165_0x1b8; - undefined field166_0x1b9; - undefined field167_0x1ba; - undefined field168_0x1bb; - undefined field169_0x1bc; - undefined field170_0x1bd; - undefined field171_0x1be; - undefined field172_0x1bf; - undefined field173_0x1c0; - undefined field174_0x1c1; - undefined field175_0x1c2; - undefined field176_0x1c3; - undefined field177_0x1c4; - undefined field178_0x1c5; - undefined field179_0x1c6; - undefined field180_0x1c7; - undefined field181_0x1c8; - undefined field182_0x1c9; - undefined field183_0x1ca; - undefined field184_0x1cb; - undefined field185_0x1cc; - undefined field186_0x1cd; - undefined field187_0x1ce; - undefined field188_0x1cf; - undefined field189_0x1d0; - undefined field190_0x1d1; - undefined field191_0x1d2; - undefined field192_0x1d3; - undefined field193_0x1d4; - undefined field194_0x1d5; - undefined field195_0x1d6; - undefined field196_0x1d7; - undefined field197_0x1d8; - undefined field198_0x1d9; - undefined field199_0x1da; - undefined field200_0x1db; - undefined field201_0x1dc; - undefined field202_0x1dd; - undefined field203_0x1de; - undefined field204_0x1df; - undefined field205_0x1e0; - undefined field206_0x1e1; - undefined field207_0x1e2; - undefined field208_0x1e3; - undefined field209_0x1e4; - undefined field210_0x1e5; - undefined field211_0x1e6; - undefined field212_0x1e7; - undefined field213_0x1e8; - undefined field214_0x1e9; - undefined field215_0x1ea; - undefined field216_0x1eb; - undefined field217_0x1ec; - undefined field218_0x1ed; - undefined field219_0x1ee; - undefined field220_0x1ef; - undefined field221_0x1f0; - undefined field222_0x1f1; - undefined field223_0x1f2; - undefined field224_0x1f3; - undefined field225_0x1f4; - undefined field226_0x1f5; - undefined field227_0x1f6; - undefined field228_0x1f7; - undefined field229_0x1f8; - undefined field230_0x1f9; - undefined field231_0x1fa; - undefined field232_0x1fb; - undefined field233_0x1fc; - undefined field234_0x1fd; - undefined field235_0x1fe; - undefined field236_0x1ff; - undefined field237_0x200; - undefined field238_0x201; - undefined field239_0x202; - undefined field240_0x203; - undefined field241_0x204; - undefined field242_0x205; - undefined field243_0x206; - undefined field244_0x207; - undefined field245_0x208; - undefined field246_0x209; - undefined field247_0x20a; - undefined field248_0x20b; - undefined field249_0x20c; - undefined field250_0x20d; - undefined field251_0x20e; - undefined field252_0x20f; - undefined field253_0x210; - undefined field254_0x211; - undefined field255_0x212; - undefined field256_0x213; - undefined field257_0x214; - undefined field258_0x215; - undefined field259_0x216; - undefined field260_0x217; - undefined field261_0x218; - undefined field262_0x219; - undefined field263_0x21a; - undefined field264_0x21b; - undefined field265_0x21c; - undefined field266_0x21d; - undefined field267_0x21e; - undefined field268_0x21f; - undefined field269_0x220; - undefined field270_0x221; - undefined field271_0x222; - undefined field272_0x223; - undefined field273_0x224; - undefined field274_0x225; - undefined field275_0x226; - undefined field276_0x227; - undefined field277_0x228; - undefined field278_0x229; - undefined field279_0x22a; - undefined field280_0x22b; - undefined field281_0x22c; - undefined field282_0x22d; - undefined field283_0x22e; - undefined field284_0x22f; - undefined field285_0x230; - undefined field286_0x231; - undefined field287_0x232; - undefined field288_0x233; - undefined field289_0x234; - undefined field290_0x235; - undefined field291_0x236; - undefined field292_0x237; - undefined field293_0x238; - undefined field294_0x239; - undefined field295_0x23a; - undefined field296_0x23b; - undefined field297_0x23c; - undefined field298_0x23d; - undefined field299_0x23e; - undefined field300_0x23f; - undefined field301_0x240; - undefined field302_0x241; - undefined field303_0x242; - undefined field304_0x243; - undefined field305_0x244; - undefined field306_0x245; - undefined field307_0x246; - undefined field308_0x247; - undefined field309_0x248; - undefined field310_0x249; - undefined field311_0x24a; - undefined field312_0x24b; - undefined field313_0x24c; - undefined field314_0x24d; - undefined field315_0x24e; - undefined field316_0x24f; - undefined field317_0x250; - undefined field318_0x251; - undefined field319_0x252; - undefined field320_0x253; - undefined field321_0x254; - undefined field322_0x255; - undefined field323_0x256; - undefined field324_0x257; - undefined field325_0x258; - undefined field326_0x259; - undefined field327_0x25a; - undefined field328_0x25b; - undefined field329_0x25c; - undefined field330_0x25d; - undefined field331_0x25e; - undefined field332_0x25f; - undefined field333_0x260; - undefined field334_0x261; - undefined field335_0x262; - undefined field336_0x263; - undefined field337_0x264; - undefined field338_0x265; - undefined field339_0x266; - undefined field340_0x267; - undefined field341_0x268; - undefined field342_0x269; - undefined field343_0x26a; - undefined field344_0x26b; - undefined field345_0x26c; - undefined field346_0x26d; - undefined field347_0x26e; - undefined field348_0x26f; - undefined field349_0x270; - undefined field350_0x271; - undefined field351_0x272; - undefined field352_0x273; - undefined field353_0x274; - undefined field354_0x275; - undefined field355_0x276; - undefined field356_0x277; - undefined field357_0x278; - undefined field358_0x279; - undefined field359_0x27a; - undefined field360_0x27b; - undefined field361_0x27c; - undefined field362_0x27d; - undefined field363_0x27e; - undefined field364_0x27f; - undefined field365_0x280; - undefined field366_0x281; - undefined field367_0x282; - undefined field368_0x283; - undefined field369_0x284; - undefined field370_0x285; - undefined field371_0x286; - undefined field372_0x287; - undefined field373_0x288; - undefined field374_0x289; - undefined field375_0x28a; - undefined field376_0x28b; - undefined field377_0x28c; - undefined field378_0x28d; - undefined field379_0x28e; - undefined field380_0x28f; - undefined field381_0x290; - undefined field382_0x291; - undefined field383_0x292; - undefined field384_0x293; - undefined field385_0x294; - undefined field386_0x295; - undefined field387_0x296; - undefined field388_0x297; - undefined field389_0x298; - undefined field390_0x299; - undefined field391_0x29a; - undefined field392_0x29b; - undefined field393_0x29c; - undefined field394_0x29d; - undefined field395_0x29e; - undefined field396_0x29f; - undefined field397_0x2a0; - undefined field398_0x2a1; - undefined field399_0x2a2; - undefined field400_0x2a3; - undefined field401_0x2a4; - undefined field402_0x2a5; - undefined field403_0x2a6; - undefined field404_0x2a7; - undefined field405_0x2a8; - undefined field406_0x2a9; - undefined field407_0x2aa; - undefined field408_0x2ab; - undefined field409_0x2ac; - undefined field410_0x2ad; - undefined field411_0x2ae; - undefined field412_0x2af; - undefined field413_0x2b0; - undefined field414_0x2b1; - undefined field415_0x2b2; - undefined field416_0x2b3; - undefined field417_0x2b4; - undefined field418_0x2b5; - undefined field419_0x2b6; - undefined field420_0x2b7; - undefined field421_0x2b8; - undefined field422_0x2b9; - undefined field423_0x2ba; - undefined field424_0x2bb; - undefined field425_0x2bc; - undefined field426_0x2bd; - undefined field427_0x2be; - undefined field428_0x2bf; - undefined field429_0x2c0; - undefined field430_0x2c1; - undefined field431_0x2c2; - undefined field432_0x2c3; - undefined field433_0x2c4; - undefined field434_0x2c5; - undefined field435_0x2c6; - undefined field436_0x2c7; - undefined field437_0x2c8; - undefined field438_0x2c9; - undefined field439_0x2ca; - undefined field440_0x2cb; - undefined field441_0x2cc; - undefined field442_0x2cd; - undefined field443_0x2ce; - undefined field444_0x2cf; - undefined field445_0x2d0; - undefined field446_0x2d1; - undefined field447_0x2d2; - undefined field448_0x2d3; - undefined field449_0x2d4; - undefined field450_0x2d5; - undefined field451_0x2d6; - undefined field452_0x2d7; - undefined field453_0x2d8; - undefined field454_0x2d9; - undefined field455_0x2da; - undefined field456_0x2db; - undefined field457_0x2dc; - undefined field458_0x2dd; - undefined field459_0x2de; - undefined field460_0x2df; - undefined field461_0x2e0; - undefined field462_0x2e1; - undefined field463_0x2e2; - undefined field464_0x2e3; - undefined field465_0x2e4; - undefined field466_0x2e5; - undefined field467_0x2e6; - undefined field468_0x2e7; - undefined field469_0x2e8; - undefined field470_0x2e9; - undefined field471_0x2ea; - undefined field472_0x2eb; - undefined field473_0x2ec; - undefined field474_0x2ed; - undefined field475_0x2ee; - undefined field476_0x2ef; - undefined field477_0x2f0; - undefined field478_0x2f1; - undefined field479_0x2f2; - undefined field480_0x2f3; - undefined field481_0x2f4; - undefined field482_0x2f5; - undefined field483_0x2f6; - undefined field484_0x2f7; - undefined field485_0x2f8; - undefined field486_0x2f9; - undefined field487_0x2fa; - undefined field488_0x2fb; - undefined field489_0x2fc; - undefined field490_0x2fd; - undefined field491_0x2fe; - undefined field492_0x2ff; - undefined field493_0x300; - undefined field494_0x301; - undefined field495_0x302; - undefined field496_0x303; - undefined field497_0x304; - undefined field498_0x305; - undefined field499_0x306; - undefined field500_0x307; - undefined field501_0x308; - undefined field502_0x309; - undefined field503_0x30a; - undefined field504_0x30b; - undefined field505_0x30c; - undefined field506_0x30d; - undefined field507_0x30e; - undefined field508_0x30f; - undefined field509_0x310; - undefined field510_0x311; - undefined field511_0x312; - undefined field512_0x313; - undefined field513_0x314; - undefined field514_0x315; - undefined field515_0x316; - undefined field516_0x317; - undefined field517_0x318; - undefined field518_0x319; - undefined field519_0x31a; - undefined field520_0x31b; - undefined field521_0x31c; - undefined field522_0x31d; - undefined field523_0x31e; - undefined field524_0x31f; - undefined field525_0x320; - undefined field526_0x321; - undefined field527_0x322; - undefined field528_0x323; - undefined field529_0x324; - undefined field530_0x325; - undefined field531_0x326; - undefined field532_0x327; - undefined field533_0x328; - undefined field534_0x329; - undefined field535_0x32a; - undefined field536_0x32b; - undefined field537_0x32c; - undefined field538_0x32d; - undefined field539_0x32e; - undefined field540_0x32f; + undefined field153_0x1ac[388]; int simple_menu_2_result; struct recycle_offer_items offer_items; struct simple_menu_item* simple_menu_item_ptr; // Created by retype action diff --git a/symbols/arm9.yml b/symbols/arm9.yml index bdba053c..0dd7c2bf 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -12178,7 +12178,7 @@ arm9: r0: mission_type r1: mission_subtype - return: fixed room id + return: fixed_room_id - name: SelectRandomFixedRoomInRange address: EU: 0x2060400 @@ -12186,7 +12186,7 @@ arm9: Returns a random fixed room from a list for a specified range. Checks for "null-termination" if no ending table entry is given. It seems that the TREASURE_MEMO_FIXED_ROOM_IDS table is frontloaded with 15 "easy" layouts, and only those are allowed before performance flag 9 is enabled. - r0: table of fixed room ids (int8_t pointer) + r0: fixed_room_id_8 table pointer r1: number of entries to choose from, -1 to use the entire table. return: int8_t - name: ReadRescueBinFile @@ -12310,8 +12310,7 @@ arm9: description: |- Seems to print a WMS code for a mission, based on context and live analysis. - r0+: ? - return: ? + - name: AppendMissionObjective address: EU: 0x2062144 @@ -12339,7 +12338,7 @@ arm9: Seems to tally up the total weights for each mission_category under a specified mission vendor. - r0: 0 for job board, 1 for outlaw board, 2 for cafe client, 3 for beach bottle + r0: mission_vendor return: 1 if the total weight is non-zero, 0 if not. - name: GetRandomMissionTemplate address: @@ -14182,7 +14181,7 @@ arm9: description: |- Table of fixed room ids used by the MISSION_ARREST_OUTLAW and MISSION_OUTLAW_HIDEOUT type and subtype. - type: uint8_t + type: fixed_room_id_8[5] - name: CHALLENGE_NORMAL_FIXED_ROOM_IDS address: EU: 0x20A1E88 @@ -14191,7 +14190,7 @@ arm9: description: |- Table of fixed room ids used by the MISSION_CHALLENGE_REQUEST and MISSION_CHALLENGE_NORMAL type and subtype. - type: uint8_t + type: fixed_room_id_8[5] - name: TACTICS_FOLLOW_LEADER address: EU: 0x20A1E90 @@ -14245,7 +14244,7 @@ arm9: Table of fixed room ids used by the MISSION_TREASURE_MEMO type. The last 15 entries only show up after the postgame (performance flag 9). - type: uint8_t + type: fixed_room_id_8[30] - name: CLIENT_LEVEL_TABLE address: EU: 0x20A1EFC @@ -15406,6 +15405,8 @@ arm9: - name: SYNTH_BIN_FILE_PTR address: EU: 0x20AFFA0 + length: + EU: 0x4 description: The location of the data/SYNTH/synth.bin file while loaded. - name: DUNGEON_MOVE_TABLES address: @@ -15516,11 +15517,13 @@ arm9: - name: MISSION_REWARD_STRUCT_MAIN_PTR address: EU: 0x20B0790 + length: + EU: 0x4 description: |- Points to a mission_reward_struct_main struct, responsible for handling the overlay 11 portion of the mission reward sequence. Is also used sparingly during the Spinda Cafe egg event. - type: mission_reward_struct_main + type: mission_reward_struct_main pointer - name: NOTIFY_NOTE address: EU: 0x20B0814 diff --git a/symbols/overlay10.yml b/symbols/overlay10.yml index ecf6b9dd..4f14a893 100644 --- a/symbols/overlay10.yml +++ b/symbols/overlay10.yml @@ -139,11 +139,11 @@ overlay10: Seems to handle the creation of an inventory menu for the spinda cafe. The fact that this lives in overlay_10 suggests it may serve a more general purpose - r0: int32_t + r0: n_items r1: int32_t r2: int32_t r3: uint8_t * - stack[0]: void + stack[0]: ? stack[1]: update_window_fn_t statk[2]: uint32_t - name: GetEffectAnimationField0x19 diff --git a/symbols/overlay11.yml b/symbols/overlay11.yml index 9a7383b8..2aefc755 100644 --- a/symbols/overlay11.yml +++ b/symbols/overlay11.yml @@ -1933,48 +1933,64 @@ overlay11: - name: SWAP_SHOP_ONE_STAR_STR address: EU: 0x2323AD8 + length: + EU: 0x7 description: |- "[M:S3]" Used exclusively by GetExclusiveItemRequirements. - name: SWAP_SHOP_TWO_STAR_STR address: EU: 0x2323AE0 + length: + EU: 0xD description: |- "[M:S3][M:S3]" Used exclusively by GetExclusiveItemRequirements. - name: SWAP_SHOP_THREE_STAR_STR address: EU: 0x2323AF0 + length: + EU: 0x13 description: |- "[M:S3][M:S3][M:S3]" Used exclusively by GetExclusiveItemRequirements. - name: SWAP_SHOP_RED_TEXT_TAG_STR address: EU: 0x2323B34 + length: + EU: 0x7 description: |- "[CS:W]" Used exclusively by a subfunction of SwapShopInventoryManager. - name: SWAP_SHOP_UNCENTER_TEXT_TAG_STR address: EU: 0x2323B3C + length: + EU: 0x5 description: |- "[CR]" Used exclusively by a subfunction of SwapShopInventoryManager. - name: SWAP_SHOP_CLUMSET_ONE_STAR_STR address: EU: 0x2323B44 + length: + EU: 0x15 description: |- "[CLUM_SET:130][M:S3]" Used exclusively by a subfunction of SwapShopInventoryManager. - name: SWAP_SHOP_CLUMSET_TWO_STAR_STR address: EU: 0x2323B5C + length: + EU: 0x1B description: |- "[CLUM_SET:122][M:S3][M:S3]" Used exclusively by a subfunction of SwapShopInventoryManager. - name: SWAP_SHOP_CLUMSET_THREE_STAR_STR address: EU: 0x2323B78 + length: + EU: 0x21 description: |- "[CLUM_SET:114][M:S3][M:S3][M:S3]" Used exclusively by a subfunction of SwapShopInventoryManager. diff --git a/symbols/overlay20.yml b/symbols/overlay20.yml index a2a2b3c1..a61e0d27 100644 --- a/symbols/overlay20.yml +++ b/symbols/overlay20.yml @@ -28,7 +28,6 @@ overlay20: The entry point for the overlay, when called by MENU_RECYCLE_SHOP2, resuming operations of the overlay. Calls RecycleShopCommonEntryPoint(0). - return: undefined4 - name: RecycleShopDestructor address: @@ -50,7 +49,6 @@ overlay20: description: |- Effectively the shared entry_point of both recycle shop overlay_load_entry, called immediately by both real entry_points to the overlay. - r0: 1 if resuming, 0 if first entry. return: undefined4 - name: PrintWynautTextbox @@ -59,7 +57,6 @@ overlay20: description: |- Seems to display a textbox with wynaut's default portrait and a specified text string id. - r0: string_id - name: PrintWynautSimpleMenu address: @@ -67,7 +64,6 @@ overlay20: description: |- Seems to display a simple_menu with wynaut's default portrait, a specified text string id, and a few simple_menu_id_item pointers. - r0: struct recycle_shop_main r1: string_id r2: simple_menu_id_items pointer @@ -77,7 +73,6 @@ overlay20: description: |- Seems to hide the active portrait box? Might be doing something else in addition. - r0: struct recycle_shop_main pointer r1: ? - name: PrintWynautNormalPortrait @@ -114,23 +109,21 @@ overlay20: description: |- Seems to display the trade info and stats for the item the cursor is currently on on the top screen window. - r0: int - name: RecycleShopTopScreenDrawItemName address: EU: 0x238C580 description: |- Seems to print the item the cursor is currently on to the top screen window. - - - r0: int + + r0: window_id - name: RecycleShopTopScreenDrawInfoWindow address: EU: 0x238C5F4 description: |- Seems to display the bottom window in the top screen display of the recycle shop, which explains how to read the top window. - r0: int32_t + r0: window_id r1: undefined4 r2: undefined4 r3: undefined4 @@ -140,7 +133,7 @@ overlay20: description: |- Displays a side window explaining how to multi-select items for non-specific recycling. - r0: int32_t + r0: window_id r1: undefined4 r2: undefined4 r3: undefined4 @@ -207,6 +200,7 @@ overlay20: NA: 0x238D014 JP: 0x238E570 length: + EU: 0x11 NA: 0x11 description: |- "BACK/s14p02a.bgp" @@ -361,8 +355,6 @@ overlay20: type: recycle_shop_main* - name: RECYCLE_SHOP_UNK_STRUCT_SIZE_84H_PTR - aliases: - - OVERLAY20_UNKNOWN_POINTER__NA_238D124 address: EU: 0x238DC64 NA: 0x238D124 @@ -374,10 +366,8 @@ overlay20: description: |- Seems to be a pointer to a struct of unknown purpose with size 0x84. - type: recycle_shop_struct_0x84* + type: recycle_unk_struct_0x84* - name: RECYCLE_SHOP_UNK_STRUCT_SIZE_340H_PTR - aliases: - - OVERLAY20_UNKNOWN_POINTER__NA_238D128 address: EU: 0x238DC68 NA: 0x238D128 @@ -389,10 +379,8 @@ overlay20: description: |- Seems to be a pointer to a struct of unknown purpose with size 0x340. - type: recycle_shop_struct_0x340* + type: recycle_unk_struct_0x340* - name: RECYCLE_SHOP_UNK_STRUCT_SIZE_1CCH_PTR - aliases: - - OVERLAY20_UNKNOWN_POINTER__NA_238D12C address: EU: 0x238DC6C NA: 0x238D12C @@ -404,4 +392,4 @@ overlay20: description: |- Seems to be a pointer to a struct of unknown purpose with size 0x1CC. - type: recycle_shop_struct_0x1cc* + type: recycle_unk_struct_0x1cc* diff --git a/symbols/overlay26.yml b/symbols/overlay26.yml index 24d0d25c..e5d19c5c 100644 --- a/symbols/overlay26.yml +++ b/symbols/overlay26.yml @@ -166,7 +166,7 @@ overlay26: A singular mission_reward_dialogue_sequence struct for treasure hoard missions. Is fed sequentially to MissionRewardFrameUpdate to either produce a textbox, or conclude the dialogue. - type: mission_reward_dialogue_sequence + type: mission_reward_dialogue_sequence[1] - name: MISSION_DEFAULT_DIALOGUE_SEQS address: EU: 0x238B966 @@ -177,7 +177,7 @@ overlay26: A pair of mission_reward_dialogue_sequence structs used for missions of type 4, 5, and technically 14. Is fed sequentially to MissionRewardFrameUpdate to either produce a textbox, or conclude the dialogue. - type: mission_reward_dialogue_sequence + type: mission_reward_dialogue_sequence[2] - name: MISSION_TYPE_10_DIALOGUE_SEQS address: EU: 0x238B972 @@ -188,7 +188,7 @@ overlay26: A pair of mission_reward_dialogue_sequence structs used for missions of type 10. Is fed sequentially to MissionRewardFrameUpdate to either produce a textbox, or conclude the dialogue. - type: mission_reward_dialogue_sequence + type: mission_reward_dialogue_sequence[2] - name: MISSION_TYPE_9_DIALOGUE_SEQS address: EU: 0x238B97E @@ -199,7 +199,7 @@ overlay26: A pair of mission_reward_dialogue_sequence structs used for missions of type 9. Is fed sequentially to MissionRewardFrameUpdate to either produce a textbox, or conclude the dialogue. - type: mission_reward_dialogue_sequence + type: mission_reward_dialogue_sequence[2] - name: MISSION_TYPE_8_DIALOGUE_SEQS address: EU: 0x238B98A @@ -210,7 +210,7 @@ overlay26: A pair of mission_reward_dialogue_sequence structs used for missions of type 8. Is fed sequentially to MissionRewardFrameUpdate to either produce a textbox, or conclude the dialogue. - type: mission_reward_dialogue_sequence + type: mission_reward_dialogue_sequence[2] - name: MISSION_TYPE_6_DIALOGUE_SEQS address: EU: 0x238B996 @@ -221,7 +221,7 @@ overlay26: A pair of mission_reward_dialogue_sequence structs used for missions of type 6. Is fed sequentially to MissionRewardFrameUpdate to either produce a textbox, or conclude the dialogue. - type: mission_reward_dialogue_sequence + type: mission_reward_dialogue_sequence[2] - name: MISSION_TYPE_7_DIALOGUE_SEQS address: EU: 0x238B9A2 @@ -232,7 +232,7 @@ overlay26: A pair of mission_reward_dialogue_sequence structs used for missions of type 7. Is fed sequentially to MissionRewardFrameUpdate to either produce a textbox, or conclude the dialogue. - type: mission_reward_dialogue_sequence + type: mission_reward_dialogue_sequence[2] - name: MISSION_TYPE_3_DIALOGUE_SEQS address: EU: 0x238B9AE @@ -243,7 +243,7 @@ overlay26: A pair of mission_reward_dialogue_sequence structs used for missions of type 3. Is fed sequentially to MissionRewardFrameUpdate to either produce a textbox, or conclude the dialogue. - type: mission_reward_dialogue_sequence + type: mission_reward_dialogue_sequence[2] - name: MISSION_TYPE_2_DIALOGUE_SEQS address: EU: 0x238B9BA @@ -254,7 +254,7 @@ overlay26: A pair of mission_reward_dialogue_sequence structs used for missions of type 2. Is fed sequentially to MissionRewardFrameUpdate to either produce a textbox, or conclude the dialogue. - type: mission_reward_dialogue_sequence + type: mission_reward_dialogue_sequence[2] - name: MISSION_TYPE_1_DIALOGUE_SEQS address: EU: 0x238B9C6 @@ -265,7 +265,7 @@ overlay26: A pair of mission_reward_dialogue_sequence structs used for missions of type 1. Is fed sequentially to MissionRewardFrameUpdate to either produce a textbox, or conclude the dialogue. - type: mission_reward_dialogue_sequence + type: mission_reward_dialogue_sequence[2] - name: MISSION_TYPE_0_DIALOGUE_SEQS address: EU: 0x238B9D2 @@ -276,7 +276,7 @@ overlay26: A pair of mission_reward_dialogue_sequence structs used for missions of type 0. Is fed sequentially to MissionRewardFrameUpdate to either produce a textbox, or conclude the dialogue. - type: mission_reward_dialogue_sequence + type: mission_reward_dialogue_sequence[2] - name: MISSION_TYPE_11_DIALOGUE_SEQS address: EU: 0x238B9DE @@ -287,10 +287,12 @@ overlay26: A pair of mission_reward_dialogue_sequence structs used for missions of type 11. Is fed sequentially to MissionRewardFrameUpdate to either produce a textbox, or conclude the dialogue. - type: mission_reward_dialogue_sequence + type: mission_reward_dialogue_sequence[2] - name: DEBUG_CONQUEST_COUNT_STR address: EU: 0x238B9EC + length: + EU: 0x36 description: |- "UNIT RETURN %3d conquest count =======================" @@ -298,6 +300,8 @@ overlay26: - name: DEBUG_DEAD_COUNT_STR address: EU: 0x238BA24 + length: + EU: 0x32 description: |- "UNIT RETURN %3d dead count =======================" @@ -305,6 +309,8 @@ overlay26: - name: DEBUG_NO_COUNT_STR address: EU: 0x238BA58 + length: + EU: 0x30 description: |- "UNIT RETURN %3d no count =======================" @@ -326,6 +332,9 @@ overlay26: EU: 0x238BAA0 NA: 0x238AF60 JP: 0x238C4C0 + length: + EU: 0x4 + NA: 0x4 description: |- A pointer to a mission_reward_struct_overlay struct, responsible for the operations of part of the mission reward sequence. @@ -335,6 +344,9 @@ overlay26: EU: 0x238BAA4 NA: 0x238AF64 JP: 0x238C4C4 + length: + EU: 0x4 + NA: 0x4 description: |- A pointer to a struct of unknown size, responsible for the operations of the ApplyRuleDungeonEffects* overlay_load_entry. @@ -344,6 +356,9 @@ overlay26: EU: 0x238BAA8 NA: 0x238AF68 JP: 0x238C4C8 + length: + EU: 0x4 + NA: 0x4 description: |- A pointer to a struct of unknown size, responsible for the operations of the DungeonExit1* overlay_load_entry. @@ -354,6 +369,7 @@ overlay26: NA: 0x238AF6C JP: 0x238C4CC length: + EU: 0x4 NA: 0x4 description: "Note: unverified, ported from Irdkwia's notes. Used exclusively by the UnkOv26EntryPoint_* structs." - name: EXIT_DUNGEON_2_STRUCT_PTR @@ -361,6 +377,9 @@ overlay26: EU: 0x238BAB0 NA: 0x238AF70 JP: 0x238C4D0 + length: + EU: 0x4 + NA: 0x4 description: |- A pointer to a struct of unknown size, responsible for the operations of the DungeonExit2* overlay_load_entry. From 3262fbbc0c613b7338e1625b6500f107230eee61 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 7 Jun 2026 19:41:38 -0400 Subject: [PATCH 051/117] Update arm9.h --- headers/functions/arm9.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index deb2043d..3b56588d 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -1302,7 +1302,7 @@ void MakeSpecialEpisodeMissionDetails(struct mission_details details, undefined undefined PrintWonderMailSkyCode(undefined param_1, undefined param_2, undefined param_3, undefined param_4); void AppendMissionObjective(char* buffer, int buffer_size, undefined4 objective, enum monster_id monster, - enum item_id_16 item); + struct item_id_16 item); void AppendMissionDungeonLocation(struct mission_details* param_1, char* buffer, int buffer_size); bool SumValidMissionCategoryWeights(enum mission_vendor vendor); struct mission_template* GetRandomMissionTemplate(void); From cf5dd625d5ed035d40c48e65e19e49b7604c3e49 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 7 Jun 2026 19:45:35 -0400 Subject: [PATCH 052/117] test two-aligned struct --- headers/types/common/enums.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/headers/types/common/enums.h b/headers/types/common/enums.h index 179ab941..3b4e53cc 100644 --- a/headers/types/common/enums.h +++ b/headers/types/common/enums.h @@ -3878,9 +3878,9 @@ enum mission_subtype_challenge { }; // This is usually stored as an 8-bit integer -#pragma pack(push, 1) -ENUM_8_BIT(mission_subtype_challenge); -#pragma pack(pop) +//#pragma pack(push, 1) +//ENUM_8_BIT(mission_subtype_challenge); +//#pragma pack(pop) // Mission subtype for MISSION_TYPE_CONSUMABLE enum mission_subtype_consumable { @@ -3892,9 +3892,9 @@ enum mission_subtype_consumable { }; // This is usually stored as an 8-bit integer -#pragma pack(push, 1) -ENUM_8_BIT(mission_subtype_consumable); -#pragma pack(pop) +//#pragma pack(push, 1) +//ENUM_8_BIT(mission_subtype_consumable); +//#pragma pack(pop) // The meaning of the mission subtype depends on the mission type union mission_subtype { From f2d75a1102e19b9d8765ec11b78e69b6e412acd4 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 7 Jun 2026 19:47:46 -0400 Subject: [PATCH 053/117] Oops. Yeah they're working. --- headers/types/common/common.h | 6 ------ headers/types/common/enums.h | 12 ++++++------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index b7d076f3..1a51da1e 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -1450,15 +1450,12 @@ struct mission_result_and_client { }; ASSERT_SIZE(struct mission_result_and_client, 8); -// This substruct is exactly 0x6 bytes long. -//#pragma pack(push, 2) // May actually be a union of several 0x6 byte structs... struct mission_reward_params { int16_t field_0x0; int16_t is_egg_or_item; // This seems to determine whether this struct describes an egg or item. int16_t item_or_recruit; // monster_id_16 of the recruit, or item_id_16 of the item. }; -//#pragma pack(pop) ASSERT_SIZE(struct mission_reward_params, 6); struct mission_substruct_1 { @@ -1535,14 +1532,11 @@ struct mission_details { }; ASSERT_SIZE(struct mission_details, 104); -// This struct is exactly 0x6 bytes long. -//#pragma pack(push, 2) struct mission_reward_dialogue_sequence { int16_t case_id; struct preprocessor_flags preprocessor_flags; uint16_t text_string_id; }; -//#pragma pack(pop) ASSERT_SIZE(struct mission_reward_dialogue_sequence, 6); struct mission_reward_struct_overlay { diff --git a/headers/types/common/enums.h b/headers/types/common/enums.h index 3b4e53cc..179ab941 100644 --- a/headers/types/common/enums.h +++ b/headers/types/common/enums.h @@ -3878,9 +3878,9 @@ enum mission_subtype_challenge { }; // This is usually stored as an 8-bit integer -//#pragma pack(push, 1) -//ENUM_8_BIT(mission_subtype_challenge); -//#pragma pack(pop) +#pragma pack(push, 1) +ENUM_8_BIT(mission_subtype_challenge); +#pragma pack(pop) // Mission subtype for MISSION_TYPE_CONSUMABLE enum mission_subtype_consumable { @@ -3892,9 +3892,9 @@ enum mission_subtype_consumable { }; // This is usually stored as an 8-bit integer -//#pragma pack(push, 1) -//ENUM_8_BIT(mission_subtype_consumable); -//#pragma pack(pop) +#pragma pack(push, 1) +ENUM_8_BIT(mission_subtype_consumable); +#pragma pack(pop) // The meaning of the mission subtype depends on the mission type union mission_subtype { From 5e7ecbc78971774a04443d08b7d019f9f5da9797 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 7 Jun 2026 19:57:01 -0400 Subject: [PATCH 054/117] more fixes --- headers/functions/arm9.h | 2 +- headers/types/ground_mode/ground_mode.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 3b56588d..029a1fda 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -1257,7 +1257,7 @@ bool CheckItemForMissionType(enum mission_type type, union mission_subtype* subt enum mission_generation_result GenerateMission(undefined* param_1, struct mission* mission_data); int CountAndPopulateValidMissionTableMonsters(enum monster_id* monster_table, undefined4* range); bool IsMissionTypeSpecialEpisode(struct mission* mission); -bool DoesMissionHaveTypeAndSubtype(struct mission, struct mission_type_8* type, union mission_subtype* subtype); +bool DoesMissionHaveTypeAndSubtype(struct mission* mission, struct mission_type_8* type, union mission_subtype* subtype); bool AlreadyHasSimilarMission(struct mission_type_8* type, union mission_subtype* subtype); void GenerateDailyMissions(void); bool AlreadyHaveMission(struct mission* mission); diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index 740bf117..24ecdea5 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -1209,6 +1209,7 @@ struct recycle_unk_struct_0x84 { int field3_0xc; int field4_0x10; int8_t text_box_window_ids[3]; + // These 81 bytes appear to be fully unused. undefined fields_0x15[81]; undefined field7_0x68; undefined field8_0x69; From 63e6a3222afdb394e1431acb2f38c816cdcbf14e Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 7 Jun 2026 20:00:15 -0400 Subject: [PATCH 055/117] Apply suggestions from code review Co-authored-by: UsernameFodder <93669634+UsernameFodder@users.noreply.github.com> --- headers/functions/overlay20.h | 2 +- headers/types/ground_mode/ground_mode.h | 2 +- symbols/arm9.yml | 6 +++--- symbols/overlay26.yml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/headers/functions/overlay20.h b/headers/functions/overlay20.h index 5d28e32f..9a0d141d 100644 --- a/headers/functions/overlay20.h +++ b/headers/functions/overlay20.h @@ -6,7 +6,7 @@ undefined4 RecycleShopEntryPointResume(void); void RecycleShopDestructor(void); undefined4 RecycleShopFrameUpdate(void); undefined4 RecycleShopCommonEntryPoint(bool resuming_menu); -void PrintWynautTextbox(int strind_id); +void PrintWynautTextbox(int string_id); void PrintWynautSimpleMenu(struct recycle_shop_main* recycle_shop_main, int string_id, struct simple_menu_id_item* simple_menu_id_item); void RecycleShopTryHidePortraitBox(struct recycle_shop_main* recycle_shop_main, bool param_2); diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index 24ecdea5..3ade0a97 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -1215,7 +1215,7 @@ struct recycle_unk_struct_0x84 { undefined field8_0x69; undefined field9_0x6a; undefined field10_0x6b; - struct recycle_item* recycle_ite_ptr; + struct recycle_item* recycle_item_ptr; int16_t matching_items_bag[4]; int16_t matching_items_storage[4]; int16_t num_items_to_trade; diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 0dd7c2bf..c17f9334 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -9186,7 +9186,7 @@ arm9: Checks script variables $DUNGEON_ENTER and $DUNGEON_ENTER_INDEX for "mission dungeon" and a valid non-dojo dungeon respectively. If so, stores the dungeon id from $DUNGEON_ENTER_INDEX to a pointer. - r0: dungeon_id_8* (return) + r0: [output] dungeon_id_8* return: 1 if the dungeon pulled from script variables is valid for mission rewards, 0 otherwise. - name: CheckMissionRestrictions address: @@ -11933,7 +11933,7 @@ arm9: description: |- Reads a portion of the mission monster table from rescue.bin, counting and populating the valid monsters for the mission. - r0: [secondary return] Pointer to the subset of valid monster_ids + r0: [output] Pointer to the subset of valid monster_ids r1: Involved in the bounds of the min and max table indices. return: number of valid monsters - name: IsMissionTypeSpecialEpisode @@ -11942,7 +11942,7 @@ arm9: NA: 0x205E238 JP: 0x205E538 description: |- - Checks if a mission is for a Special Episode Transmission, which unlocks Special Episode 3. This specifically checks for a mission of type MISSION_CONSUMABLE and subtype 0x2. + Checks if a mission is for a Special Episode Transmission, which unlocks Special Episode 3. This specifically checks for a mission of type MISSION_TYPE_CONSUMABLE and subtype MISSION_SPECIAL_EPISODE. r0: mission pointer return: bool diff --git a/symbols/overlay26.yml b/symbols/overlay26.yml index e5d19c5c..22af0da5 100644 --- a/symbols/overlay26.yml +++ b/symbols/overlay26.yml @@ -100,7 +100,7 @@ overlay26: Is a frame_update for an overlay_load_entry. return: undefined4 - - name: UnkOv26EntryPoint0238b754EU + - name: UnkOv26EntryPointEu0238b754 address: EU: 0x238B754 description: |- From f9f080df63c6ea65306b1b8cd0146aac54c07e0b Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 7 Jun 2026 20:01:43 -0400 Subject: [PATCH 056/117] Finish fixing EuAddr Names --- headers/functions/overlay26.h | 6 +++--- symbols/overlay26.yml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/headers/functions/overlay26.h b/headers/functions/overlay26.h index 394a9335..e9033557 100644 --- a/headers/functions/overlay26.h +++ b/headers/functions/overlay26.h @@ -13,10 +13,10 @@ undefined4 ExitDungeon1EntryPoint(undefined4 param_1, undefined4 param_2, undefi undefined4 param_4); void ExitDungeon1Destructor(void); undefined4 ExitDungeon1FrameUpdate(void); -undefined4 UnkOv26EntryPoint0238b754EU(undefined4 param_1, undefined4 param_2, undefined4 param_3, +undefined4 UnkOv26EntryPointEu0238b754(undefined4 param_1, undefined4 param_2, undefined4 param_3, undefined4 param_4); -void UnkOv26Destructor0238b780EU(void); -undefined4 UnkOv26FrameUpdate0238b7acEU(void); +void UnkOv26DestructorEu0238b780(void); +undefined4 UnkOv26FrameUpdateEu0238b7ac(void); undefined4 DungeonExitEntryPoint2(undefined4 param_1, undefined4 param_2, undefined4 param_3, undefined4 param_4); void DungeonExitDestructor2(void); diff --git a/symbols/overlay26.yml b/symbols/overlay26.yml index 22af0da5..bf75b8bf 100644 --- a/symbols/overlay26.yml +++ b/symbols/overlay26.yml @@ -111,14 +111,14 @@ overlay26: r2: undefined4 r3: undefined4 return: undefined4 - - name: UnkOv26Destructor0238b780EU + - name: UnkOv26DestructorEu0238b780 address: EU: 0x238B780 description: |- Is an unidentified destructor for an overlay_load_entry. No params. - - name: UnkOv26FrameUpdate0238b7acEU + - name: UnkOv26FrameUpdateEu0238b7ac address: EU: 0x238B7AC description: |- From aa7da8abcdd6f28f6aa7a5888184981f2130a767 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 7 Jun 2026 20:09:37 -0400 Subject: [PATCH 057/117] Fix Syntax --- headers/functions/arm9.h | 31 +++++++++++++++++++------------ symbols/arm9.yml | 5 +---- symbols/overlay20.yml | 2 +- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 029a1fda..53e4ed06 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -1251,13 +1251,15 @@ int GetSosMailCount(int param_1, bool param_2); bool IsMissionSuspendedAndValid(struct mission* mission); bool AreMissionsEquivalent(struct mission* mission1, struct mission* mission2); bool IsMissionValid(struct mission* mission); -bool CheckMonsterForMissionType(enum mission_type type, union mission_subtype* subtype, enum monster_id target, - bool allow_no_monster); -bool CheckItemForMissionType(enum mission_type type, union mission_subtype* subtype, enum item_id item); +bool CheckMonsterForMissionType(enum mission_type type, union mission_subtype* subtype, + enum monster_id target, bool allow_no_monster); +bool CheckItemForMissionType(enum mission_type type, union mission_subtype* subtype, + enum item_id item); enum mission_generation_result GenerateMission(undefined* param_1, struct mission* mission_data); int CountAndPopulateValidMissionTableMonsters(enum monster_id* monster_table, undefined4* range); bool IsMissionTypeSpecialEpisode(struct mission* mission); -bool DoesMissionHaveTypeAndSubtype(struct mission* mission, struct mission_type_8* type, union mission_subtype* subtype); +bool DoesMissionHaveTypeAndSubtype(struct mission* mission, struct mission_type_8* type, + union mission_subtype* subtype); bool AlreadyHasSimilarMission(struct mission_type_8* type, union mission_subtype* subtype); void GenerateDailyMissions(void); bool AlreadyHaveMission(struct mission* mission); @@ -1281,7 +1283,8 @@ void DeleteAllPossibleDungeonsList(void); int GenerateAllPossibleDeliverList(void); void DeleteAllPossibleDeliverList(void); void ClearMissionData(struct mission* mission); -enum fixed_room_id GetMissionSpecificFixedRoom(enum mission_type type, union mission_subtype subtype); +enum fixed_room_id GetMissionSpecificFixedRoom(enum mission_type type, + union mission_subtype subtype); int8_t SelectRandomFixedRoomInRange(struct fixed_room_id_8* fixed_rooms, int max); void ReadRescueBinFile(void); void GenerateMissionDetailsStruct(struct mission* mission, struct mission_details* details, @@ -1290,7 +1293,8 @@ bool ValidateNormalChallengeMission(struct mission_template* valid_mission_info, struct mission* mission); bool ValidateLegendaryChallengeMission(struct mission_template* valid_mission_info, struct mission* mission); -struct mission_template* MatchMissionTemplateToMission(undefined4 table_index,struct mission* mission); +struct mission_template* MatchMissionTemplateToMission(undefined4 table_index, + struct mission* mission); void AppendMissionTitle(char* main_buffer, char* temp_buffer, struct preprocessor_args* args, struct mission_details* details); void FormatMissionHeader(char* buffer, struct mission_details* param_2); @@ -1301,8 +1305,8 @@ void MakeMissionDetails(struct mission_details* param_1, char* buffer, undefined void MakeSpecialEpisodeMissionDetails(struct mission_details details, undefined param_2); undefined PrintWonderMailSkyCode(undefined param_1, undefined param_2, undefined param_3, undefined param_4); -void AppendMissionObjective(char* buffer, int buffer_size, undefined4 objective, enum monster_id monster, - struct item_id_16 item); +void AppendMissionObjective(char* buffer, int buffer_size, undefined4 objective, + enum monster_id monster, struct item_id_16 item); void AppendMissionDungeonLocation(struct mission_details* param_1, char* buffer, int buffer_size); bool SumValidMissionCategoryWeights(enum mission_vendor vendor); struct mission_template* GetRandomMissionTemplate(void); @@ -1313,8 +1317,11 @@ bool CanMonsterBeUsedForMission(enum monster_id monster_id, bool check_story_ban bool IsMonsterMissionAllowedStory(enum monster_id monster_id); bool IsMonsterIllegalForMissions(enum monster_id monster_id); bool CanDungeonBeUsedForMission(enum dungeon_id dungeon_id); -enum mission_rank GetMissionRankWithCapAndModifiers(struct dungeon_floor_pair* dungeon_floor_pair, enum mission_type type); -enum mission_rank GetMissionRankWithCapAndModifiersAndCap(struct dungeon_floor_pair* dungeon_floor_pair, enum mission_type type); +enum mission_rank GetMissionRankWithCapAndModifiers(struct dungeon_floor_pair* dungeon_floor_pair, + enum mission_type type); +enum mission_rank +GetMissionRankWithCapAndModifiersAndCap(struct dungeon_floor_pair* dungeon_floor_pair, + enum mission_type type); bool CanSendItem(enum item_id item_id, bool to_sky); void InitMissionReward(struct mission* param_1, struct mission_reward_data* param_2, undefined4 param_3, undefined4 param_4); @@ -1332,8 +1339,8 @@ void SetActorTalkMain(enum script_entity_id actor_id); void SetActorTalkSub(enum script_entity_id actor_id); void SetActorEventMain(enum script_entity_id actor_id); void SetRandomRequestNpcs1And2(enum script_entity_id actor_id_1, enum script_entity_id actor_id_2); -void SetAllEventNpcs(enum script_entity_id actor_id_1, enum script_entity_id actor_id_2, enum script_entity_id actor_id_3, - enum script_entity_id actor_id_4); +void SetAllEventNpcs(enum script_entity_id actor_id_1, enum script_entity_id actor_id_2, + enum script_entity_id actor_id_3, enum script_entity_id actor_id_4); void RandomizeDemoActors(void); void ItemAtTableIdx(int idx, struct bulk_item* item); void MainLoop(void); diff --git a/symbols/arm9.yml b/symbols/arm9.yml index c17f9334..8ff8124e 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -12307,10 +12307,7 @@ arm9: - name: PrintWonderMailSkyCode address: EU: 0x2062044 - description: |- - Seems to print a WMS code for a mission, based on context and live analysis. - - + description: "Seems to print a WMS code for a mission, based on context and live analysis." - name: AppendMissionObjective address: EU: 0x2062144 diff --git a/symbols/overlay20.yml b/symbols/overlay20.yml index a61e0d27..d834a9af 100644 --- a/symbols/overlay20.yml +++ b/symbols/overlay20.yml @@ -115,7 +115,7 @@ overlay20: EU: 0x238C580 description: |- Seems to print the item the cursor is currently on to the top screen window. - + r0: window_id - name: RecycleShopTopScreenDrawInfoWindow address: From 49ff55ba7120861d5df0770e83e9e760e8abb7cd Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 7 Jun 2026 20:12:12 -0400 Subject: [PATCH 058/117] Fix Syntax... A second time??? --- headers/types/common/enums.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/headers/types/common/enums.h b/headers/types/common/enums.h index 179ab941..3cf01119 100644 --- a/headers/types/common/enums.h +++ b/headers/types/common/enums.h @@ -3931,7 +3931,6 @@ enum mission_reward_type { ENUM_8_BIT(mission_reward_type); #pragma pack(pop) - enum mission_vendor { MISSION_VENDOR_JOB_BOARD = 0, MISSION_VENDOR_OUTLAW_BOARD = 1, @@ -3939,7 +3938,6 @@ enum mission_vendor { MISSION_VENDOR_BEACH_BOTTLE = 3, }; - // Different types of restrictions that a mission can have enum mission_restriction_type { MISSION_RESTRICTION_NONE = 0, From 0c3bceeaf0f0bdd46f727752cb6a81d5bfd6b909 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 13 Jun 2026 18:10:34 -0400 Subject: [PATCH 059/117] Update headers/types/ground_mode/ground_mode.h Co-authored-by: UsernameFodder <93669634+UsernameFodder@users.noreply.github.com> --- headers/types/ground_mode/ground_mode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index 3ade0a97..a14c1da0 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -1244,7 +1244,7 @@ struct recycle_unk_struct_0x340 { undefined field16_0x26; undefined field17_0x27; int field18_0x28; - undefined field_0x2c[100]; + undefined fields_0x2c[100]; int field119_0x90; undefined field_0x94[32]; struct window_input_ctx window_input_ctx; From b9c335e02ffbfbd35eef1b0a3a975119c2708bc7 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 13 Jun 2026 18:10:50 -0400 Subject: [PATCH 060/117] Update headers/types/ground_mode/ground_mode.h Co-authored-by: UsernameFodder <93669634+UsernameFodder@users.noreply.github.com> --- headers/types/ground_mode/ground_mode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index a14c1da0..0c645e24 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -1246,7 +1246,7 @@ struct recycle_unk_struct_0x340 { int field18_0x28; undefined fields_0x2c[100]; int field119_0x90; - undefined field_0x94[32]; + undefined fields_0x94[32]; struct window_input_ctx window_input_ctx; undefined field153_0x1ac[388]; int simple_menu_2_result; From f4773ac5399f9f239d3b66b0c6e3f6c7a772b5a5 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 13 Jun 2026 18:11:03 -0400 Subject: [PATCH 061/117] Update headers/types/ground_mode/ground_mode.h Co-authored-by: UsernameFodder <93669634+UsernameFodder@users.noreply.github.com> --- headers/types/ground_mode/ground_mode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index 0c645e24..74480b8f 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -1248,7 +1248,7 @@ struct recycle_unk_struct_0x340 { int field119_0x90; undefined fields_0x94[32]; struct window_input_ctx window_input_ctx; - undefined field153_0x1ac[388]; + undefined fields_0x1ac[388]; int simple_menu_2_result; struct recycle_offer_items offer_items; struct simple_menu_item* simple_menu_item_ptr; // Created by retype action From a23e6546c1ef2e3b290f10bfb4161b38746c3e75 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 13 Jun 2026 18:14:37 -0400 Subject: [PATCH 062/117] Update common.h --- headers/types/common/common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index 1a51da1e..79ddd871 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -1487,7 +1487,7 @@ struct mission_reward_data { undefined field2_0x3; int outlaw_leader_level; int amount_money; - undefined4 num_items_to_roll; + int num_items_to_roll; struct mission_reward_params item_rewards[4]; int mission_rank_points; }; From 801cacca48f6816900ce966e630776ea468fdebd Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 13 Jun 2026 18:15:19 -0400 Subject: [PATCH 063/117] Update ground_mode.h --- headers/types/ground_mode/ground_mode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index 74480b8f..bb68890f 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -1210,7 +1210,7 @@ struct recycle_unk_struct_0x84 { int field4_0x10; int8_t text_box_window_ids[3]; // These 81 bytes appear to be fully unused. - undefined fields_0x15[81]; + undefined unused_0x15[81]; undefined field7_0x68; undefined field8_0x69; undefined field9_0x6a; From 5ffffc07e053721ae6868404141d59f39a95e27d Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 13 Jun 2026 18:26:31 -0400 Subject: [PATCH 064/117] Name params --- headers/functions/arm9.h | 48 ++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 99cdab06..0ec2f2eb 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -278,11 +278,11 @@ int GetMoneyStored(void); void SetMoneyStored(int amount); void AddMoneyStored(int amount); enum monster_id GetEggSpecies(void); -void SetEggSpecies(enum monster_id param_1); +void SetEggSpecies(enum monster_id monster); undefined2 GetUnkGameState0x13a6(void); void SetUnkGameState0x13a6(undefined2 param_1); uint16_t GetEggHatchTimer(void); -void SetEggHatchTimer(uint16_t param_1); +void SetEggHatchTimer(uint16_t hatch_timer); void DecrementEggHatchTimer(void); int RemoveInvalidKecleonShop1Items(void); void RemoveItemFromKecleonShop1(int slot); @@ -333,17 +333,17 @@ int ApplyNectarBoostToGroundMonster(struct ground_monster* ground_monster, bool IsMonsterAffectedByGravelyrockGroundMode(struct ground_monster* ground_monster); int ApplyGravelyrockBoostToGroundMonster(struct ground_monster* ground_monster, int* attempted_iq_boost_out); -void ApplyGummiBoostsGroundMode(enum monster_id* monster_id, uint16_t* monster_iq, +void ApplyGummiBoostsGroundMode(enum monster_id_16* monster_id, uint16_t* monster_iq, uint8_t* monster_offensive_stats, uint8_t* monster_defensive_stats, enum item_id item_id, bool not_boost_stats, struct gummi_result* gummi_result); void WipeRecycleShopRecords(void); -void FreeRecycleOfferItems(struct recycle_offer_items* param_1); -enum item_id GetRecycleItemId(struct recycle_item** param_1); -bool RecycleItemHasTradeTypePrizeTicket(struct recycle_item** param_1); -int16_t GetRecycleItemBonusOdds(struct recycle_item** param_1); -int CountTradedRecycleItems(struct recycle_item** param_1); -bool RecycleShopTradeIsNonspecific(struct recycle_item** param_1); +void FreeRecycleOfferItems(struct recycle_offer_items* offer_items); +enum item_id GetRecycleItemId(struct recycle_item** recycle_item); +bool RecycleItemHasTradeTypePrizeTicket(struct recycle_item** recycle_item); +int16_t GetRecycleItemBonusOdds(struct recycle_item** recycle_item); +int CountTradedRecycleItems(struct recycle_item** recycle_item); +bool RecycleShopTradeIsNonspecific(struct recycle_item** recycle_item); bool RecycleShopOfferExists(void); void ClearRecycleShopOffer(void); uint32_t GetGameStateRecycleCount(void); @@ -353,8 +353,8 @@ void UpdateRecycleShop(void); void DecrementRecycleOfferCooldown(void); bool IsRecycleOfferCooldownOver(void); int GetRecycleOfferCooldown(void); -bool RecycleShopIsNotThrownItem(enum item_id param_1); -bool RecycleShopIsTradableItem(enum item_id param_1, bool disallow_tickets); +bool RecycleShopIsNotThrownItem(enum item_id item); +bool RecycleShopIsTradableItem(enum item_id item, bool disallow_tickets); int RecycleShopCountTradableItemsInBag(bool disallow_tickets); int RecycleShopCountTradableItemsInStorage(bool disallow_tickets); int CountValidRecycleShopItems(int filter, uint32_t recycles, enum rank rank); @@ -363,7 +363,7 @@ void ClearCroagunkItems(void); bool LoadSynthBin(void); void CloseSynthBin(void); bool GenerateCroagunkItems(void); -uint32_t GetCroagunkItemTemplates(struct synth_template* param_1); +uint32_t GetCroagunkItemTemplates(struct synth_template* synth_template); bool PopCroagunkItem(enum item_id item); undefined4 LoadCroagunkItems(void); undefined4 SaveCroagunkItems(void); @@ -983,7 +983,7 @@ void MissionToWonderMailPassword(char* password, struct mission* mission_data); void SetEnterDungeon(enum dungeon_id dungeon_id); void InitDungeonInit(struct dungeon_init* dungeon_init_data, enum dungeon_id dungeon_id); bool IsNoLossPenaltyDungeon(enum dungeon_id dungeon_id); -bool MissionRewardValidateDungeonId(struct dungeon_id_8* param_1); +bool MissionRewardValidateDungeonId(struct dungeon_id_8* dungeon_id); undefined CheckMissionRestrictions(undefined param_1); bool TilesetSecondaryTerrainIsChasm(int16_t tileset_id); int GetNbFloors(enum dungeon_id dungeon_id); @@ -1184,7 +1184,7 @@ void GetNbRecruited(undefined* recruit); bool IsValidTeamMember(int member_idx); bool IsMainCharacter(int member_idx); struct ground_monster* GetTeamMember(int member_idx); -int GetRecruitMentryIdBySpecies(enum monster_id param_1, int num_to_skip); +int GetRecruitMentryIdBySpecies(enum monster_id monster_id, int num_to_skip); int GetHeroMemberIdx(void); int GetPartnerMemberIdx(void); int GetMainCharacter1MemberIdx(void); @@ -1213,10 +1213,10 @@ void RemoveActiveMembersFromMainTeam(void); void SetTeamSetupHeroAndPartnerOnly(void); void SetTeamSetupHeroOnly(void); int GetPartyMembers(uint16_t* party_members); -int GetAdventureNpcIds(enum monster_id* param_1); -int GetUnitNpcIds(enum monster_id* param_1); +int GetAdventureNpcIds(enum monster_id_16* monster_id_table); +int GetUnitNpcIds(enum monster_id_16* monster_id_table); void RefillTeam(void); -void ValidateTeamMembers(bool* param_1); +void ValidateTeamMembers(bool* valid_member_table); int ClearItem(int team_id, bool check); void GetRecoloredNameOfTeamMemberAtIdx(char* out, int roster_idx); void GetNameOfTeamMemberAtIdx(char* out, int roster_idx); @@ -1277,8 +1277,8 @@ int DungeonRequestsDoneWrapper(uint8_t param_1); bool AnyDungeonRequestsDone(uint8_t param_1); bool AddMissionToJobList(struct mission* mission); struct mission* GetAcceptedMission(uint8_t mission_id); -bool WasMissionCompletedToday(struct mission_result_and_client* param_1, struct mission* param_2, - enum mission_type param_3); +bool WasMissionCompletedToday(struct mission_result_and_client* result_and_client, struct mission* mission, + enum mission_type type); int GetMissionByTypeAndDungeon(int start_index, enum mission_type mission_type, undefined* subtype_struct, enum dungeon_id dungeon_id); bool CheckAcceptedMissionByTypeAndDungeon(enum mission_type mission_type, undefined* subtype_struct, @@ -1305,17 +1305,17 @@ struct mission_template* MatchMissionTemplateToMission(undefined4 table_index, struct mission* mission); void AppendMissionTitle(char* main_buffer, char* temp_buffer, struct preprocessor_args* args, struct mission_details* details); -void FormatMissionHeader(char* buffer, struct mission_details* param_2); +void FormatMissionHeader(char* buffer, struct mission_details* mission_details); void FormatSpecialEpisodeMissionHeader(char* buffer); void AppendMissionSummary(char* main_buffer, char* temp_buffer, int window_id, int y_offset, struct preprocessor_args* args, struct mission_details* details); -void MakeMissionDetails(struct mission_details* param_1, char* buffer, undefined param_3); +void MakeMissionDetails(struct mission_details* mission_details, char* buffer, undefined param_3); void MakeSpecialEpisodeMissionDetails(struct mission_details details, undefined param_2); undefined PrintWonderMailSkyCode(undefined param_1, undefined param_2, undefined param_3, undefined param_4); void AppendMissionObjective(char* buffer, int buffer_size, undefined4 objective, enum monster_id monster, struct item_id_16 item); -void AppendMissionDungeonLocation(struct mission_details* param_1, char* buffer, int buffer_size); +void AppendMissionDungeonLocation(struct mission_details* mission_details, char* buffer, int buffer_size); bool SumValidMissionCategoryWeights(enum mission_vendor vendor); struct mission_template* GetRandomMissionTemplate(void); struct mission_template* LoadMissionTemplates(void); @@ -1331,14 +1331,14 @@ enum mission_rank GetMissionRankWithCapAndModifiersAndCap(struct dungeon_floor_pair* dungeon_floor_pair, enum mission_type type); bool CanSendItem(enum item_id item_id, bool to_sky); -void InitMissionReward(struct mission* param_1, struct mission_reward_data* param_2, +void InitMissionReward(struct mission* mission, struct mission_reward_data* reward_data, undefined4 param_3, undefined4 param_4); void RollRandomItemReward(undefined4 param_1, undefined4 param_2, struct item_id_16* item_id); void GenerateMissionRewards(struct mission* mission, bool is_cafe_mission); int CheckDungeonMissionUnlockConditions(enum dungeon_id dungeon); bool IsAvailableItem(enum item_id item_id); int GetAvailableItemDeliveryList(undefined* item_buffer); -void ZeroInitMissionRewardDataStruct(struct mission_reward_data* param_1); +void ZeroInitMissionRewardDataStruct(struct mission_reward_data* reward_data); enum monster_id GetScriptEntityMonsterId(enum script_entity_id entity_id); int GetScriptEntityMatchingStorageId(enum script_entity_id entity_id); void SetActorTalkMainAndActorTalkSub(enum script_entity_id actor_id_main, From e0154b5dee24ab215445efa1e835f2ba206942dd Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 13 Jun 2026 18:28:34 -0400 Subject: [PATCH 065/117] Update ground_mode.h --- headers/types/ground_mode/ground_mode.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index bb68890f..d8d10c67 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -1281,9 +1281,9 @@ struct recycle_unk_struct_0x1cc { int simple_menu_result; struct owned_item** owned_items_list_ptr; int num_items_required; - void* function_1; - void* function_2; - void* function_3; + undefined* function_1; + undefined* function_2; + undefined* function_3; }; ASSERT_SIZE(struct recycle_unk_struct_0x1cc, 460); From 288e8c9dc0240f548ac0b0ce5ed551b792f0e7eb Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 13 Jun 2026 18:30:57 -0400 Subject: [PATCH 066/117] Update arm9.yml --- symbols/arm9.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 48456a5d..fba31cd6 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -2907,7 +2907,7 @@ arm9: description: |- Seems to set the species of the egg in Chansey Daycare to GAME_STATE_VALUES. - r0: struct monster_id_16 + r0: monster_id - name: GetUnkGameState0x13a6 address: EU: 0x2010854 @@ -3378,7 +3378,7 @@ arm9: description: |- Retrieves GAME_STATE_VALUES->rank. Seems to exclusively be used for recycle shop prize ticket unlocks, but does correlate with guild rank. - return: rank_8 + return: guild rank - name: IncrementRecycleCountVar address: EU: 0x2012008 From d71699fb823061c7573bbd5f604c695d758cb537 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 13 Jun 2026 18:32:16 -0400 Subject: [PATCH 067/117] Update arm9.h --- headers/functions/arm9.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 0ec2f2eb..e2483031 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -1213,8 +1213,8 @@ void RemoveActiveMembersFromMainTeam(void); void SetTeamSetupHeroAndPartnerOnly(void); void SetTeamSetupHeroOnly(void); int GetPartyMembers(uint16_t* party_members); -int GetAdventureNpcIds(enum monster_id_16* monster_id_table); -int GetUnitNpcIds(enum monster_id_16* monster_id_table); +int GetAdventureNpcIds(struct monster_id_16* monster_id_table); +int GetUnitNpcIds(struct monster_id_16* monster_id_table); void RefillTeam(void); void ValidateTeamMembers(bool* valid_member_table); int ClearItem(int team_id, bool check); From 2a450a02da186051677014873cf89ffad4fedea4 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 13 Jun 2026 18:33:39 -0400 Subject: [PATCH 068/117] Update arm9.h --- headers/functions/arm9.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index e2483031..9cd3ec79 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -333,7 +333,7 @@ int ApplyNectarBoostToGroundMonster(struct ground_monster* ground_monster, bool IsMonsterAffectedByGravelyrockGroundMode(struct ground_monster* ground_monster); int ApplyGravelyrockBoostToGroundMonster(struct ground_monster* ground_monster, int* attempted_iq_boost_out); -void ApplyGummiBoostsGroundMode(enum monster_id_16* monster_id, uint16_t* monster_iq, +void ApplyGummiBoostsGroundMode(struct monster_id_16* monster_id, uint16_t* monster_iq, uint8_t* monster_offensive_stats, uint8_t* monster_defensive_stats, enum item_id item_id, bool not_boost_stats, struct gummi_result* gummi_result); From 0ce46a2bfc6cdaa8cfe99c1f04dc6cb092f447c4 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 13 Jun 2026 18:37:18 -0400 Subject: [PATCH 069/117] Fix Syntax --- headers/functions/arm9.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 9cd3ec79..c542ffc2 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -1277,8 +1277,8 @@ int DungeonRequestsDoneWrapper(uint8_t param_1); bool AnyDungeonRequestsDone(uint8_t param_1); bool AddMissionToJobList(struct mission* mission); struct mission* GetAcceptedMission(uint8_t mission_id); -bool WasMissionCompletedToday(struct mission_result_and_client* result_and_client, struct mission* mission, - enum mission_type type); +bool WasMissionCompletedToday(struct mission_result_and_client* result_and_client, + struct mission* mission, enum mission_type type); int GetMissionByTypeAndDungeon(int start_index, enum mission_type mission_type, undefined* subtype_struct, enum dungeon_id dungeon_id); bool CheckAcceptedMissionByTypeAndDungeon(enum mission_type mission_type, undefined* subtype_struct, @@ -1315,7 +1315,8 @@ undefined PrintWonderMailSkyCode(undefined param_1, undefined param_2, undefined undefined param_4); void AppendMissionObjective(char* buffer, int buffer_size, undefined4 objective, enum monster_id monster, struct item_id_16 item); -void AppendMissionDungeonLocation(struct mission_details* mission_details, char* buffer, int buffer_size); +void AppendMissionDungeonLocation(struct mission_details* mission_details, char* buffer, + int buffer_size); bool SumValidMissionCategoryWeights(enum mission_vendor vendor); struct mission_template* GetRandomMissionTemplate(void); struct mission_template* LoadMissionTemplates(void); From 6f62db4e679e84fd0dfb38d4984c94066aea797a Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 13 Jun 2026 22:14:18 -0400 Subject: [PATCH 070/117] Update overlay10.h --- headers/functions/overlay10.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/functions/overlay10.h b/headers/functions/overlay10.h index 0f3f74d9..a720024b 100644 --- a/headers/functions/overlay10.h +++ b/headers/functions/overlay10.h @@ -13,7 +13,7 @@ uint8_t PopInventoryMenuField0x1A3(int window_id); void UpdateInventoryMenu(struct window* window); bool IsInventoryMenuState3(int window_id); void CreateInventoryMenuOuter(int n_items, int param_2, int param_3, uint8_t* param_4, - undefined* param_5, update_window_fn_t* param_6, uint32_t param_7); + undefined* param_5, undefined* param_6, uint32_t param_7); int GetEffectAnimationField0x19(int anim_id); bool AnimationHasMoreFrames(int param_1); struct effect_animation* GetEffectAnimation(int anim_id); From 73d40be01d988c08b8c9545f032f809effc6fe37 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 13 Jun 2026 22:14:37 -0400 Subject: [PATCH 071/117] Update overlay10.yml --- symbols/overlay10.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay10.yml b/symbols/overlay10.yml index 5d4c5d8b..e7926caf 100644 --- a/symbols/overlay10.yml +++ b/symbols/overlay10.yml @@ -144,7 +144,7 @@ overlay10: r2: int32_t r3: uint8_t * stack[0]: ? - stack[1]: update_window_fn_t + stack[1]: ? statk[2]: uint32_t - name: GetEffectAnimationField0x19 address: From e77676edf42872577133a450008b3bb8b69b971c Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 13 Jun 2026 22:16:29 -0400 Subject: [PATCH 072/117] Update overlay11.h --- headers/functions/overlay11.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/functions/overlay11.h b/headers/functions/overlay11.h index a728b85e..5bb8b0a1 100644 --- a/headers/functions/overlay11.h +++ b/headers/functions/overlay11.h @@ -174,7 +174,7 @@ undefined4 InitDiaryAndFaqBoardMenu(undefined4 param_1); void FreeDiaryAndFaqBoardMenuMenu(void); undefined4 DiaryAndFaqBoardMenuFrameUpdate(void); bool IsBagNotEmpty(void); -bool IsGroundMonsterAtMaxLevel(struct ground_monster* param_1); +bool IsGroundMonsterAtMaxLevel(struct ground_monster* ground_monster); void GetExclusiveItemRequirements(undefined param_1, undefined param_2); void SwapShopInventoryManager(enum swap_shop_inventory_case inventory_case, int monster_id_or_exc_item_count); From 54f22276a33fe8af7d40706fccd4f6eb55e24230 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 13 Jun 2026 22:18:55 -0400 Subject: [PATCH 073/117] Update overlay19.h --- headers/functions/overlay19.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/headers/functions/overlay19.h b/headers/functions/overlay19.h index 10f753cc..209def4e 100644 --- a/headers/functions/overlay19.h +++ b/headers/functions/overlay19.h @@ -4,13 +4,13 @@ struct bar_item* GetBarItem(enum item_id item_id); void SetMiracleDrinkStatCountRange(int* param_1, int* param_2); void SetBadDrinkStatCountRange(int* param_1, int* param_2); -uint16_t* GetBarItemResultWeights(enum item_id param_1); +uint16_t* GetBarItemResultWeights(enum item_id item); uint16_t* BarGetDrinkEventWeights(void); enum monster_id BarGetRandomValidEggRecruit(void); enum monster_id BarGetValidEggGiverFromGourmetTable(void); enum monster_id BarGetRandomValidRecruitFromGourmetTable(void); -int BarGetUnlockableDungeonPtr(struct dungeon_unlock_entry** param_1); -int BarPopulateUnlockableDungeons(struct dungeon_id_8* param_1); +int BarGetUnlockableDungeonPtr(struct dungeon_unlock_entry** unlock_entry_table); +int BarPopulateUnlockableDungeons(struct dungeon_id_8* dungeon_id); void BarTryClosePortraitBox(void); undefined4 BarCaseManagerSub(void); undefined4 BarMaybeSetBarScrollBoxWindowId(undefined4 param_1, undefined4 param_2, @@ -26,13 +26,13 @@ undefined4 BarPrintIqAndSkills(int param_1); void BarPrintLevelMaxedOutString(int param_1); undefined4 BarDrawAndUpdateGainedIqSkills(char* param_1, char* param_2, int param_3, int param_4, int param_5, int param_6, int param_7); -undefined4 BarUpdateDrinkEventNewStats(struct bar_stats_data* param_1, int param_2); -void BarPrintReactionsAndStatIncreases(struct bar_stats_data* param_1); +undefined4 BarUpdateDrinkEventNewStats(struct bar_stats_data* bar_stats, int param_2); +void BarPrintReactionsAndStatIncreases(struct bar_stats_data* bar_stats); void BarHandleDrinkEventSubcase(void); void BarPostDrinkCaseForCustomer(void); undefined4 BarMaybeIsClosedUnkStringIdMenu(void); void BarCreateUnkStringIdMenu(undefined4 param_1, undefined4 param_2, - struct simple_menu_id_item* param_3, undefined4 param_4, char param_5, + struct simple_menu_id_item* simple_menu_id_item, undefined4 param_4, char param_5, uint32_t param_6); int GetUnkStringIdMenuResult(void); void BarTryShowPortrait(void); From 251b0e2920db8f2ddc221281b999d456c6e1be1a Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 13 Jun 2026 22:21:56 -0400 Subject: [PATCH 074/117] Fix syntax --- headers/functions/overlay19.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/headers/functions/overlay19.h b/headers/functions/overlay19.h index 209def4e..7881a5b8 100644 --- a/headers/functions/overlay19.h +++ b/headers/functions/overlay19.h @@ -32,8 +32,8 @@ void BarHandleDrinkEventSubcase(void); void BarPostDrinkCaseForCustomer(void); undefined4 BarMaybeIsClosedUnkStringIdMenu(void); void BarCreateUnkStringIdMenu(undefined4 param_1, undefined4 param_2, - struct simple_menu_id_item* simple_menu_id_item, undefined4 param_4, char param_5, - uint32_t param_6); + struct simple_menu_id_item* simple_menu_id_item, undefined4 param_4, + char param_5, uint32_t param_6); int GetUnkStringIdMenuResult(void); void BarTryShowPortrait(void); void BarTryHidePortrait(void); From 2fc926f2d40e584dde1aa22c7c062b59337c5f7e Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Mon, 15 Jun 2026 00:47:41 -0400 Subject: [PATCH 075/117] Update arm9.h --- headers/functions/arm9.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index c542ffc2..7ef7c12f 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -849,7 +849,7 @@ void EventFlagBackupVeneer(void); void InitMainTeamAfterQuiz(void); void InitSpecialEpisodePartners(void); void InitSpecialEpisodeExtraPartner(void); -void AssignSpecialEpisodePc(int team_member_id, struct special_episode_pc* param_2); +void AssignSpecialEpisodePc(int team_member_id, struct special_episode_pc* special_episode_pc); void ReadStringSave(char* buf); bool CheckStringSave(const char* buf); int WriteSaveFile(undefined* save_info, undefined* buf, int size); @@ -1310,7 +1310,7 @@ void FormatSpecialEpisodeMissionHeader(char* buffer); void AppendMissionSummary(char* main_buffer, char* temp_buffer, int window_id, int y_offset, struct preprocessor_args* args, struct mission_details* details); void MakeMissionDetails(struct mission_details* mission_details, char* buffer, undefined param_3); -void MakeSpecialEpisodeMissionDetails(struct mission_details details, undefined param_2); +void MakeSpecialEpisodeMissionDetails(char* buffer, struct mission_details* details); undefined PrintWonderMailSkyCode(undefined param_1, undefined param_2, undefined param_3, undefined param_4); void AppendMissionObjective(char* buffer, int buffer_size, undefined4 objective, From 6ccc684df0344a914300103993260d6a333e9168 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Mon, 15 Jun 2026 00:49:27 -0400 Subject: [PATCH 076/117] Update arm9.yml --- symbols/arm9.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index fba31cd6..0b0e84b0 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -7864,7 +7864,6 @@ arm9: description: |- Seems to be responsible for creating special episode ground_monster for special episodes. - r0: team_member_id r1: special_episode_pc pointer - name: ReadStringSave From f4a2c15102b61d471d3e3124d4670cc1a99ce752 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Mon, 15 Jun 2026 00:49:55 -0400 Subject: [PATCH 077/117] Update arm9.h --- headers/functions/arm9.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 7ef7c12f..2b82d4a5 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -1310,7 +1310,7 @@ void FormatSpecialEpisodeMissionHeader(char* buffer); void AppendMissionSummary(char* main_buffer, char* temp_buffer, int window_id, int y_offset, struct preprocessor_args* args, struct mission_details* details); void MakeMissionDetails(struct mission_details* mission_details, char* buffer, undefined param_3); -void MakeSpecialEpisodeMissionDetails(char* buffer, struct mission_details* details); +void MakeSpecialEpisodeMissionDetails(char* buffer, undefined param_2); undefined PrintWonderMailSkyCode(undefined param_1, undefined param_2, undefined param_3, undefined param_4); void AppendMissionObjective(char* buffer, int buffer_size, undefined4 objective, From 73a671d10e4e821f8f22375e3687eafa8b5389b8 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Tue, 16 Jun 2026 21:53:02 -0400 Subject: [PATCH 078/117] Update arm9.h --- headers/functions/arm9.h | 1 + 1 file changed, 1 insertion(+) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 43967e21..0cc19359 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -1367,6 +1367,7 @@ void SetRandomRequestNpc03KindVar(enum monster_id param_1); void SetRandomRequestNpcs1And2(enum script_entity_id actor_id_1, enum script_entity_id actor_id_2); void SetAllEventNpcs(enum script_entity_id actor_id_1, enum script_entity_id actor_id_2, enum script_entity_id actor_id_3, enum script_entity_id actor_id_4); +void SetNewFriendActor(enum script_entity_id actor_id); void RandomizeDemoActors(void); void ItemAtTableIdx(int idx, struct bulk_item* item); void MainLoop(void); From e16018b4c5fe3d95c475f15ad8173546219a9b9c Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Tue, 16 Jun 2026 21:55:52 -0400 Subject: [PATCH 079/117] Update arm9.h --- headers/functions/arm9.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 0cc19359..5fe9b2a8 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -1362,9 +1362,8 @@ void SetActorTalkMainAndActorTalkSub(enum script_entity_id actor_id_main, void SetActorTalkMain(enum script_entity_id actor_id); void SetActorTalkSub(enum script_entity_id actor_id); void SetActorEventMain(enum script_entity_id actor_id); -void SetRandomRequestNpcs1And2(enum script_entity_id actor_id1, enum script_entity_id actor_id2); -void SetRandomRequestNpc03KindVar(enum monster_id param_1); void SetRandomRequestNpcs1And2(enum script_entity_id actor_id_1, enum script_entity_id actor_id_2); +void SetRandomRequestNpc03KindVar(enum monster_id param_1); void SetAllEventNpcs(enum script_entity_id actor_id_1, enum script_entity_id actor_id_2, enum script_entity_id actor_id_3, enum script_entity_id actor_id_4); void SetNewFriendActor(enum script_entity_id actor_id); From f73dcbcaa190a22d3c1c28150e99766fb7696ca7 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Tue, 16 Jun 2026 21:57:49 -0400 Subject: [PATCH 080/117] Update arm9.h --- headers/functions/arm9.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 5fe9b2a8..be52d76f 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -953,7 +953,7 @@ int GetScenarioBalance(void); void ScenarioFlagRestore(void); void ScenarioFlagBackup(void); void InitWorldMapScriptVars(void); -void SetWorldMapLevel(undefined4 param_1); +void SetWorldMapLevel(int32_t world_map_level); void InitDungeonListScriptVars(void); void SetDungeonConquest(enum dungeon_id dungeon_id, int bit_value); enum dungeon_mode GetDungeonMode(enum dungeon_id dungeon_id); @@ -1287,7 +1287,7 @@ int DungeonRequestsDoneWrapper(uint8_t param_1); bool AnyDungeonRequestsDone(uint8_t param_1); bool AddMissionToJobList(struct mission* mission); struct mission* GetAcceptedMission(uint8_t mission_id); -bool IsAcceptedMissionSlotEmpty(int param_1); +bool IsAcceptedMissionSlotEmpty(int32_t mission_slot); bool WasMissionCompletedToday(struct mission_result_and_client* result_and_client, struct mission* mission, enum mission_type type); int GetMissionByTypeAndDungeon(int start_index, enum mission_type mission_type, From 037b4dc0b2745184d7844101cc60ea62ba0c36c8 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Tue, 16 Jun 2026 22:00:27 -0400 Subject: [PATCH 081/117] Update overlay29.h --- headers/functions/overlay29.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index 2c949d18..22adc617 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -111,7 +111,7 @@ void AssignTopScreenHandlers(void** funcs, top_screen_status_fn_t init_func, top_screen_status_fn_t free_func); void HandleTopScreenFades(void); int FreeTopScreen(void); -void DungeonChangeTopScreenType(int param_1); +void DungeonChangeTopScreenType(int top_screen_type); enum direction_id GetDirectionTowardsPosition(struct position* origin, struct position* target); int GetChebyshevDistance(struct position* position_a, struct position* position_b); bool IsPositionActuallyInSight(struct position* origin, struct position* target, @@ -984,7 +984,7 @@ void DisplayFloorCard(int duration); void HandleFloorCard(enum dungeon_id dungeon_id, uint8_t floor, int duration, enum hidden_stairs_type hidden_stairs_type); void FillMissionDestinationInfo(void); -undefined4 MissionExitPrompt(int param_1); +undefined4 MissionExitPrompt(int string_id); bool IsItemUnkMissionItem2(struct item* item); bool CheckActiveChallengeRequest(void); struct mission_destination_info* GetMissionDestination(void); @@ -1011,12 +1011,12 @@ enum monster_id GetMissionTargetEnemy(void); enum monster_id GetMissionEnemyMinionGroup(int i); void SetTargetMonsterNotFoundFlag(bool value); bool GetTargetMonsterNotFoundFlag(void); -void ClearMissionDestinationInfo(struct mission_destination_info* param_1); +void ClearMissionDestinationInfo(struct mission_destination_info* mission_dest_info); bool FloorHasMissionMonster(struct mission_destination_info* mission_dst); struct mission* GetMissionIfActiveOnFloor(struct dungeon_floor_pair* pair, uint8_t mission_id); void GenerateMissionEggMonster(struct mission* mission); struct entity* GetFirstExperienceLockedTeamMember(void); -void TryCompleteMission(int param_1, int param_2); +void TryCompleteMission(undefined param_1, undefined param_2); void TreasureMemoComplete(void); void TeleportFleeingOutlaw(void); void InitAlertBoxInfo(void); @@ -1070,7 +1070,7 @@ void DisplayMessage2(struct portrait_params* portrait, int message_id, bool wait bool YesNoMenu(undefined param_1, int string_id, int default_option, undefined param_4); void DisplayMessageInternal(int message_id, bool wait_for_input, struct portrait_params* portrait, undefined4 param_4, undefined4 param_5, undefined4 param_6); -void PrintMissionCompleteString(undefined4 param_1, undefined4 param_2, undefined4 param_3, +void PrintMissionCompleteString(uint string_id, undefined4 param_2, undefined4 param_3, undefined4 param_4, undefined1 param_5); void InitSecretBazaarDialogueInfo(void); void OpenMenu(undefined param_1, undefined param_2, bool open_bag); From 0dc12048706a227fa562ef8dbf0ed8809f57a66c Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Tue, 16 Jun 2026 22:05:34 -0400 Subject: [PATCH 082/117] Update overlay29.h --- headers/functions/overlay29.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index 22adc617..5bfc65b3 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -1070,7 +1070,7 @@ void DisplayMessage2(struct portrait_params* portrait, int message_id, bool wait bool YesNoMenu(undefined param_1, int string_id, int default_option, undefined param_4); void DisplayMessageInternal(int message_id, bool wait_for_input, struct portrait_params* portrait, undefined4 param_4, undefined4 param_5, undefined4 param_6); -void PrintMissionCompleteString(uint string_id, undefined4 param_2, undefined4 param_3, +void PrintMissionCompleteString(int string_id, undefined4 param_2, undefined4 param_3, undefined4 param_4, undefined1 param_5); void InitSecretBazaarDialogueInfo(void); void OpenMenu(undefined param_1, undefined param_2, bool open_bag); From 841cbff101f061978d5fd9e0a96293b4cbff5946 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Tue, 16 Jun 2026 22:12:48 -0400 Subject: [PATCH 083/117] Update arm9.h --- headers/data/arm9.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/data/arm9.h b/headers/data/arm9.h index acd727d3..820019a8 100644 --- a/headers/data/arm9.h +++ b/headers/data/arm9.h @@ -15,7 +15,7 @@ extern uint32_t MAX_MONEY_STORED; extern struct window_list* WINDOW_LIST_PTR; extern struct script_var_value_table* SCRIPT_VARS_VALUES_PTR; extern uint32_t MAX_PLAY_TIME; -int MT_MULT; +extern int MT_MULT; extern uint32_t MONSTER_ID_LIMIT; extern uint32_t MAX_RECRUITABLE_TEAM_MEMBERS; extern int16_t SINE_VALUE_TABLE[1024]; From a4af5d78dea5073d3aea12d856757fb358e1328e Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Wed, 17 Jun 2026 23:03:12 -0400 Subject: [PATCH 084/117] Duskull Bank Functions and Data --- headers/data/overlay11.h | 2 + headers/data/overlay15.h | 17 ++- headers/functions/arm9.h | 14 ++- headers/functions/overlay11.h | 19 ++++ headers/functions/overlay15.h | 13 +++ symbols/arm9.yml | 91 +++++++++++++++- symbols/overlay11.yml | 144 +++++++++++++++++++++++- symbols/overlay15.yml | 200 ++++++++++++++++++++++++++++++++-- 8 files changed, 479 insertions(+), 21 deletions(-) create mode 100644 headers/functions/overlay15.h diff --git a/headers/data/overlay11.h b/headers/data/overlay11.h index ffa2bdb2..f3bc4128 100644 --- a/headers/data/overlay11.h +++ b/headers/data/overlay11.h @@ -33,6 +33,8 @@ extern undefined4 OV11_STATIC_INITIALIZER; extern struct main_ground_data GROUND_STATE_PTRS; extern struct exclusive_item_requirements* EXCLUSIVE_ITEM_REQUIREMENTS_PTR; extern struct swap_shop_inventory_ptrs SWAP_SHOP_INVENTORY_PTRS; +extern bool SPINDA_CAFE_OVERLAY_STATUS; +extern bool RECYCLE_SHOP_OVERLAY_STATUS; extern uint32_t WORLD_MAP_MODE; #endif diff --git a/headers/data/overlay15.h b/headers/data/overlay15.h index 3275d3b1..c9b2b714 100644 --- a/headers/data/overlay15.h +++ b/headers/data/overlay15.h @@ -3,10 +3,21 @@ extern struct simple_menu_id_item BANK_MAIN_MENU_ITEMS[5]; extern struct window_params BANK_WINDOW_PARAMS_1; -extern struct window_params BANK_WINDOW_PARAMS_2; -extern struct window_params BANK_WINDOW_PARAMS_3; -extern struct window_params BANK_WINDOW_PARAMS_4; +extern struct window_params BANK_GOLD_STATUS_WINDOW_PARAMS_2; +extern struct window_params BANK_ADVANCED_TEXTBOX_WINDOW_PARAMS; +extern struct window_params BANK_MAIN_MENU_WINDOW_PARAMS; extern struct window_params BANK_WINDOW_PARAMS_5; +extern char BANK_R_CLOSE_STR[9]; +extern char BANK_M_OPEN_STR[8]; +extern char BANK_S_CLOSE_STR[9]; +extern char MENU_BANK_MODE_CANCEL_STR[23]; +extern char BANK_P_OPEN_STR[8]; +extern char BANK_G_OPEN_STR[8]; +extern char BANK_MES_NOT_CLOSE_STR[15]; +extern char BANK_SUB_NOT_CLOSE_STR[15]; +extern char BANK_SELECT_NOT_CLOSE_STR[18]; +extern char BANK_INPUT_NOT_CLOSE_STR[17]; extern undefined4 OV15_STATIC_INITIALIZER; +extern struct duskull_bank *DUSKULL_BANK_STRUCT_PTR; #endif diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 2b82d4a5..914f500a 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -616,8 +616,8 @@ void LoadTblTalk(void); int GetTalkLine(int personality_idx, enum talk_type talk_type, int restrictions); bool IsAOrBPressed(void); void DrawTextInWindow(int window_id, int x, int y, char* string); -void AppendStandardStringToMission(undefined4 param_1, undefined4 param_2, undefined4 param_3, - int string_id); +void AppendStringIdToWindow(undefined4 param_1, undefined4 param_2, undefined4 param_3, + int string_id); uint8_t GetCharWidth(char symbol); int GetColorCodePaletteOffset(char symbol); uint8_t DrawChar(int window_id, int x, int y, char symbol, int color_offset); @@ -789,6 +789,7 @@ void CloseAdvancedTextBox2(int window_id); void SetAdvancedTextBoxState5(int window_id); void CloseAdvancedTextBox(int window_id); bool IsAdvancedTextBoxActive(int window_id); +uint32_t GetDigitInputResult(int window_id); uint8_t GetWindowIdPageStart(int window_id); uint32_t GetAdvancedTextBoxFlags2(int window_id); void SetUnkAdvancedTextBoxFn(int window_id, unk_advanced_text_box_fn_t fn); @@ -834,6 +835,15 @@ int SetupAndShowKeyboard(int menu_type, char* buffer1, char* buffer2); int ShowKeyboard(int menu_type, char* buffer1, int param_3, char* buffer2); int GetKeyboardStatus(void); int GetKeyboardStringResult(void); +void DigitInputMenuInit(struct digit_input_window_manager *digit_input_manager); +int32_t DigitInputMenuReturn(struct digit_input_window_manager *digit_input_manager); +void DigitInputMenuInitDigits(struct digit_input_window_manager *digit_input_manager); +undefined DigitInputMenuGetDigits(int *digit_values,int max_value,int max_digit); +undefined4 DigitInputMenuFrameUpdate(struct digit_input_window_manager *digit_input_manager); +undefined4 DigitInputMenuCheckValidTouchScreenInput(struct digit_input_window_manager *digit_input_manager); +undefined DigitInputMenuCheckTouchUpDownArrow(struct digit_input_window_manager *digit_input_manager,int param_2,int param_3); +void DigitInputMenuDrawDigits(struct digit_input_window_manager *digit_input_manager); +void DigitInputMenuDrawDigitsCallback(void); char* TeamSelectionMenuGetItem(char* buffer, int member_idx); void FreeMissionRewardStructMain(void); void MissionRewardCloseAllBoxes(void); diff --git a/headers/functions/overlay11.h b/headers/functions/overlay11.h index 5bb8b0a1..f2274ecb 100644 --- a/headers/functions/overlay11.h +++ b/headers/functions/overlay11.h @@ -178,7 +178,26 @@ bool IsGroundMonsterAtMaxLevel(struct ground_monster* ground_monster); void GetExclusiveItemRequirements(undefined param_1, undefined param_2); void SwapShopInventoryManager(enum swap_shop_inventory_case inventory_case, int monster_id_or_exc_item_count); +void LoadDuskullBankOverlay(void); +void LoadLuminousSpringOverlay(void); +void LoadChimechoAssemblyOverlay(undefined4 param_1); +void LoadElectivireLinkShopOverlay(undefined4 param_1); +void LoadSpindaCafeOverlayInit(void); +void LoadSpindaCafeOverlayResume(void); +bool IsSpindaCafeOverlaySuspended(void); +void LoadRecycleShopOverlayInit(void); +void LoadRecycleShopOverlayResume(void); +bool IsRecycleShopOverlaySuspended(void); +void LoadCroagunkSwapShopOverlay(void); +void LoadKecleonShopOverlay(bool param_1); +void LoadKangaskhanOverlay(bool param_1); +void LoadChanseyDaycareOverlay(void); +void LoadXatuAppraisalOverlay(void); +void LoadMissionRewardOverlay(void); void LoadRecycleShopOverlay(void); +void LoadRuleDungeonEffectsOverlay(void); +void LoadSpecialEpisodeDiscardOverlay1(void); +void LoadSpecialEpisodeDiscardOverlay2(void); void HandleControlsTopScreenGround(void); bool GetDungeonMapPos(struct uvec2* out_pos, enum dungeon_id dungeon); void WorldMapSetMode(uint32_t world_map_mode); diff --git a/headers/functions/overlay15.h b/headers/functions/overlay15.h new file mode 100644 index 00000000..e7864491 --- /dev/null +++ b/headers/functions/overlay15.h @@ -0,0 +1,13 @@ +#ifndef HEADERS_FUNCTIONS_OVERLAY15_H_ +#define HEADERS_FUNCTIONS_OVERLAY15_H_ +void InitDuskullBankStruct(void); +undefined4 DuskullBankSubcaseManager1(void); +void DuskullBankSubcaseManager2(enum bank_subcase subcase); +void BankUpdateDigitInputMenuDisplay(bool is_withdrawing); +void DuskullBankTextboxGoldStatusCallback(int window_id); +void DuskullBankDigitInputDisplayCallback(void); +undefined4 DuskullBankEntryPoint(void); +void DuskullBankDestructor(void); +undefined4 DuskullBankFrameUpdate(void); + +#endif diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 4938afcd..2971c3ed 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -5897,14 +5897,15 @@ arm9: r1: x offset within window r2: y offset within window r3: text to draw - - name: AppendStandardStringToMission + - name: AppendStringIdToWindow + aliases: + - AppendStandardStringToMission address: EU: 0x202654C NA: 0x2026268 JP: 0x2026340 description: |- - Seems to append a string from a string_id to text. Known to be used for this purpose in MakeMissionDetails. - + Seems to append a string from a string_id to text. Known to be used for this purpose in MakeMissionDetails and BankUpdateDigitInputMenuDisplay. r0: undefined4 r1: undefined4 @@ -7416,6 +7417,14 @@ arm9: r0: window_id return: bool + - name: GetDigitInputResult + address: + EU: 0x2030C34 + description: |- + Seems to retrieve the result of a digit input advanced textbox. + + r0: advanced textbox window_id + return: value submitted in a digit input advanced texbox. - name: GetWindowIdPageStart address: EU: 0x2030D0C @@ -7800,6 +7809,82 @@ arm9: Note: unverified, ported from Irdkwia's notes return: ? + - name: DigitInputMenuInit + address: + EU: 0x203975C + description: |- + Seems to handle initialization of a digit_input_window_manager. + Used by something other than Duskull Bank! + + r0: digit_input_window_manager pointer + - name: DigitInputMenuReturn + address: + EU: 0x2039824 + description: |- + Seems to process the result of DigitInputMenuFrameUpdate. + Used by something other than Duskull Bank! + + r0: digit_input_window_manager pointer + return: int32_t + - name: DigitInputMenuInitDigits + address: + EU: 0x20398C8 + description: |- + Seems to handle initializing the digit fields of a digit_input_window_manager struct, adjusting the max_digits to align with max_value, and more. + + r0: digit_input_window_manager pointer + - name: DigitInputMenuGetDigits + address: + EU: 0x203997C + description: |- + Seems to handle generating the digits of a digit input menu, given the max value it can display and the number of digits it can hold. + + r0: [output] digit_values + r1: max_value + r2: max_digits + return: ? + - name: DigitInputMenuFrameUpdate + address: + EU: 0x20399E0 + description: |- + Run every frame a digit input menu is active, detecting player inputs via both buttons and the touch screen. + + r0: digit_input_window_manager pointer + return: Some kind of exit code, interpreted by DigitInputMenuReturn + - name: DigitInputMenuCheckValidTouchScreenInput + address: + EU: 0x2039C48 + description: |- + Just a guess. Seems to be checking for touch screen input, and interpreting the results as an equivalent set of button inputs? + + r0: digit_input_window_manager pointer + return: undefined4 + - name: DigitInputMenuCheckTouchUpDownArrow + address: + EU: 0x2039CF8 + description: |- + Called by DigitInputMenuCheckValidTouchScreenInput, which this function assumes to be generally correct. + Seems to specifically check for a touch screen press above or below the current digit, to increment/decrement it + + r0: digit_input_window_manager pointer + r1: int + r2: int + return: ? + - name: DigitInputMenuDrawDigits + address: + EU: 0x2039E08 + description: |- + Seems to handle actually drawing the digits on the advanced textbox for a digit_input_window_manager. + + r0: digit_input_window_manager pointer + - name: DigitInputMenuDrawDigitsCallback + address: + EU: 0x2039F10 + description: |- + A text_box_callback_fn_t for a digit input window advanced_text_box. + Is used by something other than the Duskull Bank! + + No params. - name: TeamSelectionMenuGetItem address: EU: 0x203AA58 diff --git a/symbols/overlay11.yml b/symbols/overlay11.yml index c9c2cc7d..ef87112b 100644 --- a/symbols/overlay11.yml +++ b/symbols/overlay11.yml @@ -1659,13 +1659,139 @@ overlay11: r0: switch case index for the function: 0 = Swap List Inventory, 1 = Unknown, 2 = Species Exclusive Item List, 3 = Item Trade Away Selection List. r1: Depends on r0. If case 2: ID of the monster to retrieve an exclusive item list for. If case 3: Number of Exclusive Items the player owns. - - name: LoadRecycleShopOverlay + - name: LoadDuskullBankOverlay + address: + EU: 0x230D54C + description: |- + Seems to handle loading overlay 15 for the duskull bank. + + No params. + - name: LoadLuminousSpringOverlay + address: + EU: 0x230D560 + description: |- + Seems to handle loading overlay 16 for luminous spring. + + No params. + - name: LoadChimechoAssemblyOverlay + address: + EU: 0x230D574 + description: |- + Seems to handle loading overlay 17 for the chimecho assembly. + + r0: undefined4 + - name: LoadElectivireLinkShopOverlay + address: + EU: 0x230D59C + description: |- + Seems to handle loading overlay 18 for the electivire link shop. + + r0: undefined4 + - name: LoadSpindaCafeOverlayInit + address: + EU: 0x230D5C4 + description: |- + Seems to handle loading overlay 19 for initializing the spinda cafe. + + No params. + - name: LoadSpindaCafeOverlayResume + address: + EU: 0x230D5E8 + description: |- + Seems to handle loading overlay 19 for resuming operations of the spinda cafe. + + No params. + - name: IsSpindaCafeOverlaySuspended + address: + EU: 0x230D60C + description: |- + Checks SPINDA_CAFE_OVERLAY_STATUS for if the Spinda Cafe is inactive. + + return: 1 if the cafe is suspended, 0 if not. + - name: LoadRecycleShopOverlayInit + address: + EU: 0x230D61C + description: |- + Seems to handle loading overlay 20 for initializing the recycle shop. + + No params. + - name: LoadRecycleShopOverlayResume + address: + EU: 0x230D644 + description: |- + Seems to handle loading overlay 20 for resuming operations of the recycle shop. + + No params. + - name: IsRecycleShopOverlaySuspended + address: + EU: 0x230D67C + description: |- + Checks RECYCLE_SHOP_OVERLAY_STATUS for if the recycle shop is inactive. + + return: 1 if the recycle shop is suspended, 0 if not. + - name: LoadCroagunkSwapShopOverlay + address: + EU: 0x230D6E4 + description: |- + Seems to handle loading overlay 21 for the croagunk swap shop. + + No params. + - name: LoadKecleonShopOverlay + address: + EU: 0x230D6F8 + description: |- + Seems to handle loading overlay 22 for the kecleon brothers shop. Is used by both colors of Kecleon. + + r0: 1 for purple kecleon, 0 for green kecleon. + - name: LoadKangaskhanOverlay + address: + EU: 0x230D720 + description: |- + Seems to handle loading overlay 23 for Kangaskhan storage, as well as Kangaskhan rock storage. + + r0: 2 for kangaskhan rock, 0 otherwise? + - name: LoadChanseyDaycareOverlay + address: + EU: 0x230D740 + description: |- + Seems to handle loading overlay 24 for the Chansey daycare. + + No params. + - name: LoadXatuAppraisalOverlay + address: + EU: 0x230D754 + description: |- + Seems to handle loading overlay 24 for Xatu's appraisal. + + No params. + - name: LoadMissionRewardOverlay address: EU: 0x230D768 NA: 0x230CDCC JP: 0x230E378 description: |- - Seems to be responsible for loading overlay 20 for the recycle shop. + Seems to be responsible for loading overlay 26 for the mission reward sequence. + + No params. + - name: LoadRuleDungeonEffectsOverlay + address: + EU: 0x230D77C + description: |- + Seems to be responsible for loading overlay 26 to handle rule dungeon effects. + + No params. + - name: LoadSpecialEpisodeDiscardOverlay1 + address: + EU: 0x230D7CC + description: |- + Seems to load overlay 27, which is believed to handle special episode discarding. + + No params. + - name: LoadSpecialEpisodeDiscardOverlay2 + address: + EU: 0x230D7E0 + description: |- + Seems to load overlay 27, which is believed to handle special episode discarding. No params. - name: HandleControlsTopScreenGround @@ -2111,6 +2237,20 @@ overlay11: length: EU: 0x8 description: Host pointers to multiple structures used for performing internal Swap Shop checks. + - name: SPINDA_CAFE_OVERLAY_STATUS + address: + EU: 0x23258EC + description: |- + Tracks whether or not the spinda cafe overlay is suspended. 1 if it is inactive, 0 if it is active. + + type: bool + - name: RECYCLE_SHOP_OVERLAY_STATUS + address: + EU: 0x23258F4 + description: |- + Tracks whether or not the recycle shop overlay is suspended. 1 if it is inactive, 0 if it is active. + + type: bool - name: WORLD_MAP_MODE address: EU: 0x2325924 diff --git a/symbols/overlay15.yml b/symbols/overlay15.yml index 26985e45..0d81d36f 100644 --- a/symbols/overlay15.yml +++ b/symbols/overlay15.yml @@ -12,7 +12,72 @@ overlay15: NA: 0x1060 JP: 0x1060 description: Controls the Duskull Bank. - functions: [] + functions: + - name: InitDuskullBankStruct + address: + EU: 0x238AC80 + description: |- + Allocates and initializes a duskull_bank struct at DUSKULL_BANK_STRUCT_PTR. + + No params. + - name: DuskullBankSubcaseManager1 + address: + EU: 0x238AD74 + description: |- + Seems to manage the more niche operations of the bank, primarily window management and player input interpretation. + Consists of a switch case over the bank_subcase enum. + + return: undefined4 + - name: DuskullBankSubcaseManager2 + address: + EU: 0x238B02C + description: |- + Seems to manage the more niche operations of the bank, primarily window generation. + Consists of a switch case over the bank_subcase enum. + + r0: enum bank_subcase + - name: BankUpdateDigitInputMenuDisplay + address: + EU: 0x238B8E4 + description: |- + Runs once every frame while the digit display menu is up, to redraw it as needed. + + r0: 1 for the withdrawing text string, 0 for depositing. + - name: DuskullBankTextboxGoldStatusCallback + address: + EU: 0x238B930 + description: |- + A text_box_callback_fn_t function for the gold status window that seems to populate the current and stored money. + + r0: window_id + - name: DuskullBankDigitInputDisplayCallback + address: + EU: 0x238B9D8 + description: |- + A text_box_callback_fn_t function for the digit display window that calls BankUpdateDigitInputMenuDisplay with the correct param from the duskull_bank struct. + + No params. + - name: DuskullBankEntryPoint + address: + EU: 0x238B9F4 + description: |- + The sole entry_point function for the duskull bank overlay. + + return: undefined4 + - name: DuskullBankDestructor + address: + EU: 0x238BA04 + description: |- + The sole destructor function for the duskull bank overlay. + + No params. + - name: DuskullBankFrameUpdate + address: + EU: 0x238BAC0 + description: |- + The sole frame_update function for the duskull bank overlay. + + return: undefined4 data: - name: BANK_MAIN_MENU_ITEMS address: @@ -25,11 +90,16 @@ overlay15: JP: 0x28 - name: BANK_WINDOW_PARAMS_1 address: + EU: 0x238BBE8 NA: 0x238B07C length: + EU: 0x10 NA: 0x10 - description: "Note: unverified, ported from Irdkwia's notes" - - name: BANK_WINDOW_PARAMS_2 + description: |- + Seems to be fully unused. May be a leftover from Time/Darkness or Rescue Team? + + type: struct window_params + - name: BANK_GOLD_STATUS_WINDOW_PARAMS_2 address: EU: 0x238BBF8 NA: 0x238B08C @@ -37,8 +107,11 @@ overlay15: length: EU: 0x10 NA: 0x10 - description: "Note: unverified, ported from Irdkwia's notes" - - name: BANK_WINDOW_PARAMS_3 + description: |- + A window_params struct used by the window displaying stored and carried gold for the duskull bank. + + type: struct window_params + - name: BANK_ADVANCED_TEXTBOX_WINDOW_PARAMS address: EU: 0x238BC08 NA: 0x238B09C @@ -46,8 +119,11 @@ overlay15: length: EU: 0x10 NA: 0x10 - description: "Note: unverified, ported from Irdkwia's notes" - - name: BANK_WINDOW_PARAMS_4 + description: |- + A window_params struct used by the digit input advanced textbox for the duskull bank. + + type: struct window_params + - name: BANK_MAIN_MENU_WINDOW_PARAMS address: EU: 0x238BC18 NA: 0x238B0AC @@ -55,13 +131,111 @@ overlay15: length: EU: 0x10 NA: 0x10 - description: "Note: unverified, ported from Irdkwia's notes" + description: |- + A window_params struct used by the main menu of the duskull bank. + + type: struct window_params - name: BANK_WINDOW_PARAMS_5 address: + EU: 0x238BC28 NA: 0x238B0BC length: + EU: 0x10 NA: 0x10 - description: "Note: unverified, ported from Irdkwia's notes" + description: |- + Seems to be fully unused. May be a leftover from Time/Darkness or Rescue Team? + + type: struct window_params + - name: BANK_R_CLOSE_STR + address: + EU: 0x238BC38 + length: + EU: 0x9 + description: |- + "R-Close\n" + + type: string + - name: BANK_M_OPEN_STR + address: + EU: 0x238BC44 + length: + EU: 0x8 + description: |- + "M-Open\n" + + type: string + - name: BANK_S_CLOSE_STR + address: + EU: 0x238BC4C + length: + EU: 0x9 + description: |- + "S-Close\n" + + type: string + - name: MENU_BANK_MODE_CANCEL_STR + address: + EU: 0x238BC58 + length: + EU: 0x17 + description: |- + "Menu_Bank_Mode_Cancel\n" + + type: string + - name: BANK_P_OPEN_STR + address: + EU: 0x238BC70 + length: + EU: 0x8 + description: |- + "P-Open\n" + + type: string + - name: BANK_G_OPEN_STR + address: + EU: 0x238BC78 + length: + EU: 0x8 + description: |- + "G-Open\n" + + type: string + - name: BANK_MES_NOT_CLOSE_STR + address: + EU: 0x238BC80 + length: + EU: 0xF + description: |- + "mes not close\n" + + type: string + - name: BANK_SUB_NOT_CLOSE_STR + address: + EU: 0x238BC90 + length: + EU: 0xF + description: |- + "sub not close\n" + + type: string + - name: BANK_SELECT_NOT_CLOSE_STR + address: + EU: 0x238BCA0 + length: + EU: 0x12 + description: |- + "select not close\n" + + type: string + - name: BANK_INPUT_NOT_CLOSE_STR + address: + EU: 0x238BCB4 + length: + EU: 0x11 + description: |- + "Input not close\n" + + type: string - name: OV15_STATIC_INITIALIZER aliases: - OVERLAY15_RESERVED_SPACE @@ -74,11 +248,15 @@ overlay15: NA: 0x4 JP: 0x4 description: Static initializer for overlay 15. - - name: OVERLAY15_UNKNOWN_POINTER__NA_238B180 + - name: DUSKULL_BANK_STRUCT_PTR address: EU: 0x238BCE0 NA: 0x238B180 JP: 0x238C6E0 length: + EU: 0x4 NA: 0x4 - description: "Note: unverified, ported from Irdkwia's notes" + description: |- + Manages the majority of duskull bank operations for the overlay. + + type: duskull_bank struct pointer From 9315b77eb42dabae0c9018bcee0f458a9394031d Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Thu, 18 Jun 2026 01:32:07 -0400 Subject: [PATCH 085/117] Arm9 Kecleon Shop --- headers/functions/arm9.h | 5 +++++ symbols/arm9.yml | 41 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 914f500a..45162ad5 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -177,6 +177,8 @@ int GetActualBuyPrice(struct item* item); int GetActualSellPrice(struct item* item); int FindItemInInventory(enum item_id item_id); int SprintfStatic(char* str, const char* format, ...); +void MaybeGetUncoloredFormattedItemName(char *item_name,struct item *item, bool * category_table); +void MaybeGetColoredFormattedItemName(char *item_name,struct item *item, bool * category_table); void ItemZInit(struct item* item); bool AreItemsEquivalent(struct item* item1, struct item* item2, int bitmask); int GetMoneyQuantity(struct item* item); @@ -286,10 +288,13 @@ void SetEggHatchTimer(uint16_t hatch_timer); void DecrementEggHatchTimer(void); int RemoveInvalidKecleonShop1Items(void); void RemoveItemFromKecleonShop1(int slot); +struct bulk_item * GetCurrentKecleonShop1ItemByIndex(int index); void SortKecleonItems1(void); void GenerateKecleonItems1(enum kecleon_shop_version kecleon_shop_version); bool AddItemToKecleonShop1(enum item_id item_id); +int RemoveInvalidKecleonShop2Items(void); void RemoveItemFromKecleonShop2(int slot); +struct bulk_item * GetCurrentKecleonShop2ItemByIndex(int index); void SortKecleonItems2(void); void GenerateKecleonItems2(enum kecleon_shop_version kecleon_shop_version); bool AddItemToKecleonShop2(enum item_id item_id); diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 2971c3ed..dc9262c9 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -1873,6 +1873,24 @@ arm9: r1: format ...: variadic return: number of characters printed, excluding the null-terminator + - name: MaybeGetUncoloredFormattedItemName + address: + EU: 0x200D6E4 + description: |- + Seems to return an uncolored copy of the item name, with the appropriate quantity tag. + + r0: [output] name string + r1: item pointer + r2: bool table corresponding to item categories? + - name: MaybeGetColoredFormattedItemName + address: + EU: 0x200D6F8 + description: |- + Seems to return a colored copy of the item name, with the appropriate color and quantity tag. + + r0: [output] name string + r1: item pointer + r2: bool table corresponding to item categories? - name: ItemZInit address: EU: 0x200D8A4 @@ -2978,6 +2996,14 @@ arm9: Removes an item from the first Kecleon Shop at a specific slot in the shop list. r0: item slot (0-7) + - name: GetCurrentKecleonShop1ItemByIndex + address: + EU: 0x2010940 + description: |- + Retrieves a bulk_item from the first Kecleon Shop at a specified index. + + r0: index + return: bulk_item pointer - name: SortKecleonItems1 address: EU: 0x20109FC @@ -3009,6 +3035,13 @@ arm9: r0: item ID return: whether the item was added succesfully + - name: RemoveInvalidKecleonShop2Items + address: + EU: 0x2010BE4 + description: |- + Iterates through the current first Kecleon Shop items, and removes any with item_id ITEM_NONE. + + return: number of items removed from the shop. - name: RemoveItemFromKecleonShop2 address: EU: 0x2010C20 @@ -3018,6 +3051,14 @@ arm9: Removes an item from the second Kecleon Shop at a specific slot in the shop list. r0: item slot (0-4) + - name: GetCurrentKecleonShop2ItemByIndex + address: + EU: 0x2010C4C + description: |- + Retrieves a bulk_item from the first Kecleon Shop at a specified index. + + r0: index + return: bulk_item pointer - name: SortKecleonItems2 address: EU: 0x2010D08 From 726f8bf4e88d743efc28cd7b8c83e78d60bb438a Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Thu, 18 Jun 2026 22:23:16 -0400 Subject: [PATCH 086/117] Update overlay29.yml --- symbols/overlay29.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 7e936fb0..f754b1dc 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -1823,7 +1823,6 @@ overlay29: r0: Pointer to the entity that used the TM. r1: Parameter index in monster::action_data::action_parameters. Will be used to use to determine the index of the used item. - No params. - name: AddDungeonSubMenuOption address: EU: 0x22EC1CC From 3ab0eb899e15cd251669a44831e1a8a7a20efc04 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Thu, 18 Jun 2026 22:23:54 -0400 Subject: [PATCH 087/117] Update overlay29.yml --- symbols/overlay29.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index f754b1dc..61cdd927 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -18,7 +18,7 @@ overlay29: subregions: - move_effects.yml functions: - - name: InitDungeonPalatteStruct + - name: InitDungeonPaletteStruct address: EU: 0x22DEC40 description: |- From c0d336a9661cd91d9ccc70bdba7b9ca20fc3e6e9 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Thu, 18 Jun 2026 22:35:29 -0400 Subject: [PATCH 088/117] Update overlay29.h --- headers/functions/overlay29.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index 5bfc65b3..2916f7a3 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -3,7 +3,7 @@ #include "overlay29/move_effects.h" -void InitDungeonPalatteStruct(void); +void InitDungeonPaletteStruct(void); struct rgba* GetWeatherColorTable(enum weather_id); struct dungeon* DungeonAlloc(void); struct dungeon* GetDungeonPtrMaster(void); @@ -176,8 +176,8 @@ bool RunLeaderTurn(undefined param_1); void TrySpawnMonsterAndActivatePlusMinus(void); bool IsFloorOver(void); void DecrementWindCounter(void); -void CreateMonsterSummaryFromEntityOuter(union damage_source_16 param_1, struct entity* param_2, - struct monster* param_3, int param_4); +void CreateMonsterSummaryFromEntityOuter(union damage_source_16 damage_source, struct entity* entity, + struct monster* monster, int param_4); bool IsDungeonEndReasonFailure(void); void SetForcedLossReason(enum forced_loss_reason forced_loss_reason); enum forced_loss_reason GetForcedLossReason(void); @@ -230,7 +230,7 @@ bool TalkToSecretBazaarNpcWithYesNoMenu(int string_id, struct entity* shopkeeper struct simple_menu_id_item* menu_items); void MakeTargetFaceUserAndIdle(struct entity* target, struct entity* user); void SubtractMoneyCarriedWithSfx(int amount); -void GonePebbleGradualPaletteShift(struct rgba* param_1, uint32_t param_2); +void GonePebbleGradualPaletteShift(struct rgba* palette, uint32_t param_2); bool TalkToSecretBazaarNpc(int string_id, struct entity* shopkeeper, enum portrait_emotion emotion, struct simple_menu_id_item* menu_items, bool param_5); struct action_16* GetLeaderAction(void); @@ -289,7 +289,7 @@ bool IsMonsterIdInNormalRangeVeneer(enum monster_id monster_id); void BoostIQ(struct entity* entity, int iq_boost, bool suppress_logs); void ChangeMonsterAnimationToIdle(struct entity* entity, enum direction_id direction); bool ShouldMonsterHeadToStairs(struct entity* entity); -void DisplayLinkedMovesWarnings(struct entity* param_1, int move_slot); +void DisplayLinkedMovesWarnings(struct entity* entity, int move_slot); bool MewSpawnCheck(enum monster_id monster_id, bool fail_if_mew); void TryEndStatusWithAbility(struct entity* attacker, struct entity* defender); bool ExclusiveItemEffectIsActive(struct entity* entity, enum exclusive_item_effect_id effect_id); @@ -312,7 +312,7 @@ void ResetTriggerFlags(struct entity* entity); bool IsSpecialStoryAlly(struct monster* monster); bool IsExperienceLocked(struct monster* monster); struct entity* FindMonsterWithBehavior(enum monster_behavior monster_behavior); -undefined4 CountActiveMonsters(void); +int CountActiveMonsters(void); bool IsMonsterLoneOutlaw(struct monster* monster); bool IsSecretBazaarNpc(struct entity* entity); bool IsTeamMemberOnFirstTurnInFixedRoom(struct monster* monster); From 17c52180cbb657d489dd5d32ddccf44f159b4669 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Thu, 18 Jun 2026 22:38:58 -0400 Subject: [PATCH 089/117] Update arm9.h --- headers/functions/arm9.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index be52d76f..b2b3a7af 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -824,10 +824,10 @@ void InitInventoryMenuInput(struct inventory_menu_input_ctx* input_ctx, struct w struct window_extra_info* window_extra_info, struct window_rectangle* rect, int n_items, int n_items_per_page, undefined param_7); -void InventoryMenuNextPage(struct inventory_menu_input_ctx* param_1); -void InventoryMenuPreviousPage(struct inventory_menu_input_ctx* param_1); -void InventoryMenuNext10Pages(struct inventory_menu_input_ctx* param_1); -void InventoryMenuPrevious10Pages(struct inventory_menu_input_ctx* param_1); +void InventoryMenuNextPage(struct inventory_menu_input_ctx* ctx); +void InventoryMenuPreviousPage(struct inventory_menu_input_ctx* ctx); +void InventoryMenuNext10Pages(struct inventory_menu_input_ctx* ctx); +void InventoryMenuPrevious10Pages(struct inventory_menu_input_ctx* ctx); bool OverlayLoadEntriesEqual(struct overlay_load_entry* entry1, struct overlay_load_entry* entry2); void FreeActiveMenu(void); bool InitMenu(struct overlay_load_entry* entry); @@ -1149,8 +1149,8 @@ void GuestMonsterToGroundMonster(struct ground_monster* ground_monster, struct guest_monster* guest_monster); void SetBaseStatsMovesGroundMonster(struct ground_monster* ground_monster); bool StrcmpMonsterName(char* string, enum monster_id monster_id); -void InitializeTeamMemberFromMentry(struct team_member* param_1, struct ground_monster* param_2, - int32_t param_3); +void InitializeTeamMemberFromMentry(struct team_member* team_member, struct ground_monster* ground_monster, + int32_t slot_index); void GetLvlUpEntry(struct level_up_entry* level_up_entry, enum monster_id monster_id, int level); uint8_t* GetEncodedHalfword(uint8_t* data_ptr, uint16_t* result); int GetEvoFamily(undefined* monster, undefined* evo_family); @@ -1363,7 +1363,7 @@ void SetActorTalkMain(enum script_entity_id actor_id); void SetActorTalkSub(enum script_entity_id actor_id); void SetActorEventMain(enum script_entity_id actor_id); void SetRandomRequestNpcs1And2(enum script_entity_id actor_id_1, enum script_entity_id actor_id_2); -void SetRandomRequestNpc03KindVar(enum monster_id param_1); +void SetRandomRequestNpc03KindVar(enum monster_id id); void SetAllEventNpcs(enum script_entity_id actor_id_1, enum script_entity_id actor_id_2, enum script_entity_id actor_id_3, enum script_entity_id actor_id_4); void SetNewFriendActor(enum script_entity_id actor_id); From 77ca8c58afb1c6cbb92379f8c580c57191940c12 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Thu, 18 Jun 2026 22:45:31 -0400 Subject: [PATCH 090/117] Update arm9.h --- headers/functions/arm9.h | 1598 +++++++++++++++++++++----------------- 1 file changed, 872 insertions(+), 726 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index b2b3a7af..95a76647 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -16,42 +16,47 @@ void NitroMain(void); void InitMemAllocTable(void); void SetMemAllocatorParams(get_alloc_arena_fn_t get_alloc_arena, get_free_arena_fn_t get_free_arena); -struct mem_arena* GetAllocArenaDefault(struct mem_arena* arena, uint32_t flags); -struct mem_arena* GetFreeArenaDefault(struct mem_arena* arena, uint32_t flags); -void InitMemArena(struct mem_arena* arena, struct iovec* mem, struct mem_block* blocks, - uint32_t max_blocks); +struct mem_arena *GetAllocArenaDefault(struct mem_arena *arena, uint32_t flags); +struct mem_arena *GetFreeArenaDefault(struct mem_arena *arena, uint32_t flags); +void InitMemArena(struct mem_arena *arena, struct iovec *mem, + struct mem_block *blocks, uint32_t max_blocks); uint32_t MemAllocFlagsToBlockType(uint32_t alloc_flags); -int FindAvailableMemBlock(struct mem_arena* arena, uint32_t alloc_flags, uint32_t len); -struct mem_block* SplitMemBlock(struct mem_arena* arena, uint32_t idx, uint32_t alloc_flags, - uint32_t len, uint32_t user_flags); -void* MemAlloc(uint32_t len, uint32_t flags); -void MemFree(void* ptr); -struct mem_arena* MemArenaAlloc(struct mem_arena* parent_arena, uint32_t len, uint32_t max_blocks, - uint32_t flags); -struct mem_arena* CreateMemArena(struct iovec* mem, uint32_t max_blocks); -void* MemLocateSet(struct mem_arena* arena, uint32_t len, uint32_t flags); -void MemLocateUnset(struct mem_arena* arena, void* ptr); +int FindAvailableMemBlock(struct mem_arena *arena, uint32_t alloc_flags, + uint32_t len); +struct mem_block *SplitMemBlock(struct mem_arena *arena, uint32_t idx, + uint32_t alloc_flags, uint32_t len, + uint32_t user_flags); +void *MemAlloc(uint32_t len, uint32_t flags); +void MemFree(void *ptr); +struct mem_arena *MemArenaAlloc(struct mem_arena *parent_arena, uint32_t len, + uint32_t max_blocks, uint32_t flags); +struct mem_arena *CreateMemArena(struct iovec *mem, uint32_t max_blocks); +void *MemLocateSet(struct mem_arena *arena, uint32_t len, uint32_t flags); +void MemLocateUnset(struct mem_arena *arena, void *ptr); int RoundUpDiv256(int x); int SinAbs4096(int x); int CosAbs4096(int x); -bool UFixedPoint64CmpLt(int32_t x_upper, uint32_t x_lower, int32_t y_upper, uint32_t y_lower); +bool UFixedPoint64CmpLt(int32_t x_upper, uint32_t x_lower, int32_t y_upper, + uint32_t y_lower); int MultiplyByFixedPoint(int x, fx32_8 mult_fp); uint32_t UMultiplyByFixedPoint(uint32_t x, ufx32_8 mult_fp); -void IntToFixedPoint64(struct fx64_16* out, int x); -int FixedPoint64ToInt(struct fx64_16* x); -void FixedPoint32To64(struct fx64_16* out, fx32_8 x_fp); -void NegateFixedPoint64(struct fx64_16* x); -bool FixedPoint64IsZero(struct fx64_16* x); -bool FixedPoint64IsNegative(struct fx64_16* x); -bool FixedPoint64CmpLt(struct fx64_16* x, struct fx64_16* y); -void MultiplyFixedPoint64(struct fx64_16* prod, struct fx64_16* x, struct fx64_16* y); -void DivideFixedPoint64(struct fx64_16* quotient, struct fx64_16* dividend, - struct fx64_16* divisor); -void UMultiplyFixedPoint64(struct fx64_16* prod, struct fx64_16* x, struct fx64_16* y); -void UDivideFixedPoint64(struct fx64_16* quotient, struct fx64_16* dividend, - struct fx64_16* divisor); -void AddFixedPoint64(struct fx64_16* sum, struct fx64_16* x, struct fx64_16* y); -void ClampedLn(struct fx64_16* out, int x); +void IntToFixedPoint64(struct fx64_16 *out, int x); +int FixedPoint64ToInt(struct fx64_16 *x); +void FixedPoint32To64(struct fx64_16 *out, fx32_8 x_fp); +void NegateFixedPoint64(struct fx64_16 *x); +bool FixedPoint64IsZero(struct fx64_16 *x); +bool FixedPoint64IsNegative(struct fx64_16 *x); +bool FixedPoint64CmpLt(struct fx64_16 *x, struct fx64_16 *y); +void MultiplyFixedPoint64(struct fx64_16 *prod, struct fx64_16 *x, + struct fx64_16 *y); +void DivideFixedPoint64(struct fx64_16 *quotient, struct fx64_16 *dividend, + struct fx64_16 *divisor); +void UMultiplyFixedPoint64(struct fx64_16 *prod, struct fx64_16 *x, + struct fx64_16 *y); +void UDivideFixedPoint64(struct fx64_16 *quotient, struct fx64_16 *dividend, + struct fx64_16 *divisor); +void AddFixedPoint64(struct fx64_16 *sum, struct fx64_16 *x, struct fx64_16 *y); +void ClampedLn(struct fx64_16 *out, int x); uint16_t GetRngSeed(void); void SetRngSeed(uint16_t seed); uint16_t Rand16Bit(void); @@ -64,16 +69,16 @@ void WaitForever(void); uint16_t InterruptMasterDisable(void); uint16_t InterruptMasterEnable(void); void InitMemAllocTableVeneer(void); -void ZInit8(void* ptr); -bool PointsToZero(int* ptr); -void MemZero(void* ptr, uint32_t len); -void MemZero16(void* ptr, int len); -void MemZero32(void* ptr, int len); -void MemsetSimple(void* ptr, char val, uint32_t len); -void Memset32(void* ptr, int val, int len); -void MemcpySimple(void* dest, void* src, uint32_t n); -void Memcpy16(void* dest, void* src, int n); -void Memcpy32(void* dest, void* src, int n); +void ZInit8(void *ptr); +bool PointsToZero(int *ptr); +void MemZero(void *ptr, uint32_t len); +void MemZero16(void *ptr, int len); +void MemZero32(void *ptr, int len); +void MemsetSimple(void *ptr, char val, uint32_t len); +void Memset32(void *ptr, int val, int len); +void MemcpySimple(void *dest, void *src, uint32_t n); +void Memcpy16(void *dest, void *src, int n); +void Memcpy32(void *dest, void *src, int n); void TaskProcBoot(void); bool EnableAllInterrupts(void); float GetTime(void); @@ -86,70 +91,75 @@ void HaltProcessDisp(int status); bool OverlayIsLoaded(enum overlay_group_id group_id); void LoadOverlay(enum overlay_group_id group_id); void UnloadOverlay(enum overlay_group_id group_id); -void GetDsFirmwareUserSettingsVeneer(struct user_settings* settings); -void Rgb8ToRgb5(struct rgb5* target, struct rgba* source); -float EuclideanNorm(int* vec2); -void ClampComponentAbs(int* vec2, int max); -bool GetHeldButtons(int controller, struct buttons* btn_ptr); -bool GetPressedButtons(int controller, struct buttons* btn_ptr); -bool GetReleasedStylus(undefined* stylus_ptr); +void GetDsFirmwareUserSettingsVeneer(struct user_settings *settings); +void Rgb8ToRgb5(struct rgb5 *target, struct rgba *source); +float EuclideanNorm(int *vec2); +void ClampComponentAbs(int *vec2, int max); +bool GetHeldButtons(int controller, struct buttons *btn_ptr); +bool GetPressedButtons(int controller, struct buttons *btn_ptr); +bool GetReleasedStylus(undefined *stylus_ptr); void KeyWaitInit(void); void DebugPrintSystemClock(void); -void GetSystemClock(struct system_clock* clock); -void SprintfSystemClock(struct system_clock* clock, char* str); +void GetSystemClock(struct system_clock *clock); +void SprintfSystemClock(struct system_clock *clock, char *str); void DataTransferInit(void); void DataTransferStop(void); -void FileInitVeneer(struct file_stream* file); -void FileOpen(struct file_stream* file, const char* filepath); -uint32_t FileGetSize(struct file_stream* file); -uint32_t FileRead(struct file_stream* file, void* buf, uint32_t size); -void FileSeek(struct file_stream* file, int offset, int whence); -void FileClose(struct file_stream* file); -void UnloadFile(void* ptr); -void LoadFileFromRom(struct iovec* iov, const char* filepath, uint32_t flags); -void TransformPaletteDataWithFlushDivideFade(struct palette_data* palette); -void InitOamInfo(struct oam_info* oam_info, int max_num_objs, int max_num_groups, - int oam_base_address, uint32_t mem_alloc_flags); -void SetShouldCopyToOam(struct oam_info* oam_info); -void GroupOamObjs(struct oam_info* oam_info); -void CopyAttributesToOam(struct oam_info* oam_info); -void ClearGroupedOamObjsAndGroups(struct oam_info* oam_info); -void AddObjToUngroupedOamObjs(struct oam_info* oam_info, uint16_t* oam_attributes, int group); -void UpdateFadeStatus(struct screen_fade* fstruct, int param_2, int duration); -bool HandleFades(struct screen_fade* fstruct); -bool HandleFadesVeneer(struct screen_fade* fstruct); -int GetFadeStatus(struct screen_fade* fstruct); +void FileInitVeneer(struct file_stream *file); +void FileOpen(struct file_stream *file, const char *filepath); +uint32_t FileGetSize(struct file_stream *file); +uint32_t FileRead(struct file_stream *file, void *buf, uint32_t size); +void FileSeek(struct file_stream *file, int offset, int whence); +void FileClose(struct file_stream *file); +void UnloadFile(void *ptr); +void LoadFileFromRom(struct iovec *iov, const char *filepath, uint32_t flags); +void TransformPaletteDataWithFlushDivideFade(struct palette_data *palette); +void InitOamInfo(struct oam_info *oam_info, int max_num_objs, + int max_num_groups, int oam_base_address, + uint32_t mem_alloc_flags); +void SetShouldCopyToOam(struct oam_info *oam_info); +void GroupOamObjs(struct oam_info *oam_info); +void CopyAttributesToOam(struct oam_info *oam_info); +void ClearGroupedOamObjsAndGroups(struct oam_info *oam_info); +void AddObjToUngroupedOamObjs(struct oam_info *oam_info, + uint16_t *oam_attributes, int group); +void UpdateFadeStatus(struct screen_fade *fstruct, int param_2, int duration); +bool HandleFades(struct screen_fade *fstruct); +bool HandleFadesVeneer(struct screen_fade *fstruct); +int GetFadeStatus(struct screen_fade *fstruct); void InitDebug(void); void InitDebugFlag(void); bool GetDebugFlag(enum debug_flag flag); void SetDebugFlag(enum debug_flag flag, bool val); void InitDebugStripped6(void); -int AppendProgPos(char* str, struct prog_pos_info* prog_pos, const char* msg); +int AppendProgPos(char *str, struct prog_pos_info *prog_pos, const char *msg); void InitDebugStripped5(void); -void DebugPrintTrace(const char* msg, struct prog_pos_info* prog_pos); -void DebugDisplay(const char* fmt, ...); -void DebugPrint0(const char* fmt, ...); +void DebugPrintTrace(const char *msg, struct prog_pos_info *prog_pos); +void DebugDisplay(const char *fmt, ...); +void DebugPrint0(const char *fmt, ...); void InitDebugLogFlag(void); bool GetDebugLogFlag(enum debug_log_flag flag); void SetDebugLogFlag(enum debug_log_flag flag, bool val); -void DebugPrint(uint8_t level, const char* fmt, ...); +void DebugPrint(uint8_t level, const char *fmt, ...); void InitDebugStripped4(void); void InitDebugStripped3(void); void InitDebugStripped2(void); void InitDebugStripped1(void); -void FatalError(struct prog_pos_info prog_pos, const char* fmt, ...); +void FatalError(struct prog_pos_info prog_pos, const char *fmt, ...); void OpenAllPackFiles(void); -uint32_t GetFileLengthInPackWithPackNb(enum pack_file_id pack_id, uint32_t file_index); -uint32_t LoadFileInPackWithPackId(enum pack_file_id pack_id, uint32_t file_index, - void* output_buffer); +uint32_t GetFileLengthInPackWithPackNb(enum pack_file_id pack_id, + uint32_t file_index); +uint32_t LoadFileInPackWithPackId(enum pack_file_id pack_id, + uint32_t file_index, void *output_buffer); void AllocAndLoadFileInPack(enum pack_file_id pack_id, uint32_t file_index, - struct pack_alloc_and_load_result* output, uint32_t malloc_flags); -void OpenPackFile(struct pack_file_opened* pack_file, const char* file_name); -uint32_t GetFileLengthInPack(struct pack_file_opened* pack_file, uint32_t file_index); -uint32_t LoadFileInPack(struct pack_file_opened* pack_file, void* output_buffer, + struct pack_alloc_and_load_result *output, + uint32_t malloc_flags); +void OpenPackFile(struct pack_file_opened *pack_file, const char *file_name); +uint32_t GetFileLengthInPack(struct pack_file_opened *pack_file, + uint32_t file_index); +uint32_t LoadFileInPack(struct pack_file_opened *pack_file, void *output_buffer, uint32_t file_index); -void GetDungeonResultMsg(union damage_source damage_source_or_result, char* buffer, int buffer_size, - undefined* param_4); +void GetDungeonResultMsg(union damage_source damage_source_or_result, + char *buffer, int buffer_size, undefined *param_4); union damage_source GetDamageSource(enum move_id, enum item_id); enum item_category GetItemCategoryVeneer(enum item_id item_id); enum move_id GetItemMoveId16(enum item_id item_id); @@ -159,34 +169,36 @@ bool IsEdible(enum item_id item_id); bool IsHM(enum item_id item_id); bool IsGummi(enum item_id item_id); bool IsAuraBow(enum item_id item_id); -bool IsLosableItem(struct item* item); +bool IsLosableItem(struct item *item); bool IsTreasureBox(enum item_id item_id); bool IsStorableItem(enum item_id item_id); bool IsShoppableItem(enum item_id item_id); bool IsValidTargetItem(enum item_id item_id); -bool IsItemUsableNow(struct item* item); +bool IsItemUsableNow(struct item *item); bool IsTicketItem(enum item_id item_id); -void InitItem(struct item* item, enum item_id item_id, uint16_t quantity, bool sticky); -void InitStandardItem(struct item* item, enum item_id item_id, bool sticky); -void InitBulkItem(struct bulk_item* item, enum item_id item_id); -void BulkItemToItem(struct item* item, struct bulk_item* bulk_item); -void ItemToBulkItem(struct bulk_item* bulk_item, struct item* item); -int GetDisplayedBuyPrice(struct item* item); -int GetDisplayedSellPrice(struct item* item); -int GetActualBuyPrice(struct item* item); -int GetActualSellPrice(struct item* item); +void InitItem(struct item *item, enum item_id item_id, uint16_t quantity, + bool sticky); +void InitStandardItem(struct item *item, enum item_id item_id, bool sticky); +void InitBulkItem(struct bulk_item *item, enum item_id item_id); +void BulkItemToItem(struct item *item, struct bulk_item *bulk_item); +void ItemToBulkItem(struct bulk_item *bulk_item, struct item *item); +int GetDisplayedBuyPrice(struct item *item); +int GetDisplayedSellPrice(struct item *item); +int GetActualBuyPrice(struct item *item); +int GetActualSellPrice(struct item *item); int FindItemInInventory(enum item_id item_id); -int SprintfStatic(char* str, const char* format, ...); -void ItemZInit(struct item* item); -bool AreItemsEquivalent(struct item* item1, struct item* item2, int bitmask); -int GetMoneyQuantity(struct item* item); -int GetItemsForSave(void* dst, uint32_t len); -int ReadItemsFromSave(void* src, uint32_t len); -bool IsItemAvailableInDungeonGroup(enum dungeon_id dungeon_id, enum item_id item_id); +int SprintfStatic(char *str, const char *format, ...); +void ItemZInit(struct item *item); +bool AreItemsEquivalent(struct item *item1, struct item *item2, int bitmask); +int GetMoneyQuantity(struct item *item); +int GetItemsForSave(void *dst, uint32_t len); +int ReadItemsFromSave(void *src, uint32_t len); +bool IsItemAvailableInDungeonGroup(enum dungeon_id dungeon_id, + enum item_id item_id); enum item_id GetItemIdFromList(int list_id, int category_num, int item_num); enum item_id NormalizeTreasureBox(enum item_id item_id); -void SortItemList(struct item* item_list, int length); -void RemoveEmptyItems(struct item* list, int size); +void SortItemList(struct item *item_list, int length); +void RemoveEmptyItems(struct item *list, int size); void LoadItemPspi2n(void); uint8_t GetExclusiveItemType(enum item_id item_id); int GetExclusiveItemOffsetEnsureValid(enum item_id item_id); @@ -194,8 +206,9 @@ bool IsItemValid(enum item_id item_id); int16_t GetExclusiveItemParameter(enum item_id item_id); enum item_category GetItemCategory(enum item_id item_id); enum item_id EnsureValidItem(enum item_id item_id); -char* GetItemName(enum item_id item_id); -void GetItemNameFormatted(char* name_out, enum item_id item_id, bool flag1, bool flag2); +char *GetItemName(enum item_id item_id); +void GetItemNameFormatted(char *name_out, enum item_id item_id, bool flag1, + bool flag2); uint16_t GetItemBuyPrice(enum item_id item_id); uint16_t GetItemSellPrice(enum item_id item_id); uint8_t GetItemSpriteId(enum item_id item_id); @@ -223,36 +236,36 @@ int CountItemTypeInBag(enum item_id item_id); bool IsItemInBag(enum item_id item_id); bool IsItemWithFlagsInBag(enum item_id item_id, int flags); bool IsItemInTreasureBoxes(enum item_id item_id); -bool IsHeldItemInBag(struct item* item); +bool IsHeldItemInBag(struct item *item); bool IsItemForSpecialSpawnInBag(void); bool HasStorableItems(void); -int GetItemIndex(struct item* item); -int GetEquivItemIndex(struct item* item); +int GetItemIndex(struct item *item); +int GetEquivItemIndex(struct item *item); int GetEquippedThrowableItem(void); int GetFirstUnequippedItemOfType(enum item_id item_id); -bool CopyItemAtIdx(int idx, struct item* item_out); -struct item* GetItemAtIdx(int idx); +bool CopyItemAtIdx(int idx, struct item *item_out); +struct item *GetItemAtIdx(int idx); void RemoveEmptyItemsInBag(void); bool RemoveItemNoHole(int idx); void RemoveItem(int idx); void RemoveHeldItemNoHole(int held_idx); -bool RemoveItemByIdAndStackNoHole(struct item* item); -bool RemoveEquivItem(struct item* item); -bool RemoveEquivItemNoHole(struct item* item); -bool DecrementStackItem(struct item* item); +bool RemoveItemByIdAndStackNoHole(struct item *item); +bool RemoveEquivItem(struct item *item); +bool RemoveEquivItemNoHole(struct item *item); +bool DecrementStackItem(struct item *item); bool RemoveItemNoHoleCheck(int idx); bool RemoveFirstUnequippedItemOfType(enum item_id item_id); void RemoveAllItems(void); void RemoveAllItemsStartingAt(int idx); -bool SpecialProcAddItemToBag(struct bulk_item* item); -bool AddItemToBagNoHeld(struct item* item); -bool AddItemToBag(struct item* item, int held_by); +bool SpecialProcAddItemToBag(struct bulk_item *item); +bool AddItemToBagNoHeld(struct item *item); +bool AddItemToBag(struct item *item, int held_by); void CleanStickyItemsInBag(void); int CountStickyItemsInBag(void); -bool TransmuteHeldItemInBag(struct item* item); +bool TransmuteHeldItemInBag(struct item *item); void SetFlagsForHeldItemInBag(int held_by, int bitflags); -void RemoveHolderForItemInBag(struct item* item); -void SetHolderForItemInBag(int idx, struct item* item, int held_by); +void RemoveHolderForItemInBag(struct item *item); +void SetHolderForItemInBag(int idx, struct item *item, int held_by); void SortItemsInBag(void); void RemovePokeItemsInBag(void); bool IsStorageFull(void); @@ -260,17 +273,17 @@ int CountNbOfItemsInStorage(void); int CountNbOfValidItemsInStorage(void); int CountNbOfValidItemsInTimeDarknessInStorage(void); int CountNbItemsOfTypeInStorage(enum item_id item_id); -int CountItemTypeInStorage(struct bulk_item* bulk_item); -int GetEquivBulkItemIdxInStorage(struct bulk_item* bulk_item); -bool ConvertStorageItemAtIdxToBulkItem(int idx, struct bulk_item* bulk_item); -bool ConvertStorageItemAtIdxToItem(int idx, struct item* item); +int CountItemTypeInStorage(struct bulk_item *bulk_item); +int GetEquivBulkItemIdxInStorage(struct bulk_item *bulk_item); +bool ConvertStorageItemAtIdxToBulkItem(int idx, struct bulk_item *bulk_item); +bool ConvertStorageItemAtIdxToItem(int idx, struct item *item); bool RemoveItemAtIdxInStorage(int idx); -bool RemoveBulkItemInStorage(struct bulk_item* bulk_item); -bool RemoveItemInStorage(struct item* item); +bool RemoveBulkItemInStorage(struct bulk_item *bulk_item); +bool RemoveItemInStorage(struct item *item); void StorageZInit(void); -bool AddBulkItemToStorage(struct bulk_item* bulk_item); -bool AddItemToStorage(struct item* item); -void SortItemsInStorage(bool* param_1, int num_items_to_sort); +bool AddBulkItemToStorage(struct bulk_item *bulk_item); +bool AddItemToStorage(struct item *item); +void SortItemsInStorage(bool *param_1, int num_items_to_sort); void AllKecleonShopsZInit(void); void SpecialEpisodeKecleonShopZInit(void); void SetActiveKecleonShop(enum team_id team_id); @@ -294,56 +307,68 @@ void SortKecleonItems2(void); void GenerateKecleonItems2(enum kecleon_shop_version kecleon_shop_version); bool AddItemToKecleonShop2(enum item_id item_id); int GetExclusiveItemOffset(enum item_id item_id); -void ApplyExclusiveItemStatBoosts(enum item_id item_id, uint8_t* atk_boost, uint8_t* sp_atk_boost, - uint8_t* def_boost, uint8_t* sp_def_boost); -void SetExclusiveItemEffect(uint32_t* effect_flags, enum exclusive_item_effect_id effect_id); -bool ExclusiveItemEffectFlagTest(uint32_t* effect_flags, enum exclusive_item_effect_id effect_id); -bool IsExclusiveItemIdForMonster(enum item_id item_id, enum monster_id monster_id, - enum type_id type1, enum type_id type2); -bool IsExclusiveItemForMonster(struct item* item, enum monster_id monster_id, enum type_id type1, - enum type_id type2); -enum item_id BagHasExclusiveItemTypeForMonster(enum exclusive_item_effect_id effect_id, - enum monster_id monster_id, enum type_id type1, - enum type_id type2); -bool GetExclusiveItemForMonsterFromBag(struct item* item, enum exclusive_item_effect_id effect_id, - enum monster_id monster_id, enum type_id type1, - enum type_id type2); -int GetHpBoostFromExclusiveItems(undefined* param_1); -void SwapShopFreeDoublePointer(undefined** param_1); -void ApplyGummiBoostsToGroundMonster(struct ground_monster* ground_monster, enum item_id item_id, - bool not_boost_stats, struct gummi_result* gummi_result); -void ApplyGummiBoostsToTeamMember(struct team_member* team_member, enum item_id item_id, - bool not_boost_stats, struct gummi_result* gummi_result); -int ApplySitrusBerryBoostToGroundMonster(struct ground_monster* ground_monster, - int* attempted_hp_boost_out); -int ApplyLifeSeedBoostToGroundMonster(struct ground_monster* ground_monster, - int* attempted_hp_boost_out); -int ApplyGinsengToGroundMonster(struct ground_monster* ground_monster, - struct move_id_16* move_id_out, int* attempted_move_boost_out); -int ApplyProteinBoostToGroundMonster(struct ground_monster* ground_monster, - int* attempted_attack_boost_out); -int ApplyCalciumBoostToGroundMonster(struct ground_monster* ground_monster, - int* attempted_sp_attack_boost_out); -int ApplyIronBoostToGroundMonster(struct ground_monster* ground_monster, - int* attempted_defense_boost_out); -int ApplyZincBoostToGroundMonster(struct ground_monster* ground_monster, - int* attempted_sp_defense_boost_out); -int ApplyNectarBoostToGroundMonster(struct ground_monster* ground_monster, - int* attempted_iq_boost_out); -bool IsMonsterAffectedByGravelyrockGroundMode(struct ground_monster* ground_monster); -int ApplyGravelyrockBoostToGroundMonster(struct ground_monster* ground_monster, - int* attempted_iq_boost_out); -void ApplyGummiBoostsGroundMode(struct monster_id_16* monster_id, uint16_t* monster_iq, - uint8_t* monster_offensive_stats, uint8_t* monster_defensive_stats, +void ApplyExclusiveItemStatBoosts(enum item_id item_id, uint8_t *atk_boost, + uint8_t *sp_atk_boost, uint8_t *def_boost, + uint8_t *sp_def_boost); +void SetExclusiveItemEffect(uint32_t *effect_flags, + enum exclusive_item_effect_id effect_id); +bool ExclusiveItemEffectFlagTest(uint32_t *effect_flags, + enum exclusive_item_effect_id effect_id); +bool IsExclusiveItemIdForMonster(enum item_id item_id, + enum monster_id monster_id, enum type_id type1, + enum type_id type2); +bool IsExclusiveItemForMonster(struct item *item, enum monster_id monster_id, + enum type_id type1, enum type_id type2); +enum item_id +BagHasExclusiveItemTypeForMonster(enum exclusive_item_effect_id effect_id, + enum monster_id monster_id, + enum type_id type1, enum type_id type2); +bool GetExclusiveItemForMonsterFromBag(struct item *item, + enum exclusive_item_effect_id effect_id, + enum monster_id monster_id, + enum type_id type1, enum type_id type2); +int GetHpBoostFromExclusiveItems(undefined *param_1); +void SwapShopFreeDoublePointer(undefined **param_1); +void ApplyGummiBoostsToGroundMonster(struct ground_monster *ground_monster, + enum item_id item_id, bool not_boost_stats, + struct gummi_result *gummi_result); +void ApplyGummiBoostsToTeamMember(struct team_member *team_member, + enum item_id item_id, bool not_boost_stats, + struct gummi_result *gummi_result); +int ApplySitrusBerryBoostToGroundMonster(struct ground_monster *ground_monster, + int *attempted_hp_boost_out); +int ApplyLifeSeedBoostToGroundMonster(struct ground_monster *ground_monster, + int *attempted_hp_boost_out); +int ApplyGinsengToGroundMonster(struct ground_monster *ground_monster, + struct move_id_16 *move_id_out, + int *attempted_move_boost_out); +int ApplyProteinBoostToGroundMonster(struct ground_monster *ground_monster, + int *attempted_attack_boost_out); +int ApplyCalciumBoostToGroundMonster(struct ground_monster *ground_monster, + int *attempted_sp_attack_boost_out); +int ApplyIronBoostToGroundMonster(struct ground_monster *ground_monster, + int *attempted_defense_boost_out); +int ApplyZincBoostToGroundMonster(struct ground_monster *ground_monster, + int *attempted_sp_defense_boost_out); +int ApplyNectarBoostToGroundMonster(struct ground_monster *ground_monster, + int *attempted_iq_boost_out); +bool IsMonsterAffectedByGravelyrockGroundMode( + struct ground_monster *ground_monster); +int ApplyGravelyrockBoostToGroundMonster(struct ground_monster *ground_monster, + int *attempted_iq_boost_out); +void ApplyGummiBoostsGroundMode(struct monster_id_16 *monster_id, + uint16_t *monster_iq, + uint8_t *monster_offensive_stats, + uint8_t *monster_defensive_stats, enum item_id item_id, bool not_boost_stats, - struct gummi_result* gummi_result); + struct gummi_result *gummi_result); void WipeRecycleShopRecords(void); -void FreeRecycleOfferItems(struct recycle_offer_items* offer_items); -enum item_id GetRecycleItemId(struct recycle_item** recycle_item); -bool RecycleItemHasTradeTypePrizeTicket(struct recycle_item** recycle_item); -int16_t GetRecycleItemBonusOdds(struct recycle_item** recycle_item); -int CountTradedRecycleItems(struct recycle_item** recycle_item); -bool RecycleShopTradeIsNonspecific(struct recycle_item** recycle_item); +void FreeRecycleOfferItems(struct recycle_offer_items *offer_items); +enum item_id GetRecycleItemId(struct recycle_item **recycle_item); +bool RecycleItemHasTradeTypePrizeTicket(struct recycle_item **recycle_item); +int16_t GetRecycleItemBonusOdds(struct recycle_item **recycle_item); +int CountTradedRecycleItems(struct recycle_item **recycle_item); +bool RecycleShopTradeIsNonspecific(struct recycle_item **recycle_item); bool RecycleShopOfferExists(void); void ClearRecycleShopOffer(void); uint32_t GetGameStateRecycleCount(void); @@ -363,70 +388,72 @@ void ClearCroagunkItems(void); bool LoadSynthBin(void); void CloseSynthBin(void); bool GenerateCroagunkItems(void); -uint32_t GetCroagunkItemTemplates(struct synth_template* synth_template); +uint32_t GetCroagunkItemTemplates(struct synth_template *synth_template); bool PopCroagunkItem(enum item_id item); undefined4 LoadCroagunkItems(void); undefined4 SaveCroagunkItems(void); -struct synth_template* GetSynthItem(enum item_id exclusive_item); +struct synth_template *GetSynthItem(enum item_id exclusive_item); bool GetValidSynthsForSpecies(enum monster_id monster_id, - struct monster_synth_data* monster_synth_data, - struct type_synth_data* type_synth_data); + struct monster_synth_data *monster_synth_data, + struct type_synth_data *type_synth_data); void LoadWazaP(void); void LoadWazaP2(void); void UnloadCurrentWazaP(void); -char* GetMoveName(enum move_id move_id); -void FormatMoveString(char* string, struct move* move, undefined* type_print); -void FormatMoveStringMore(undefined* param_1, int param_2, struct move* move, - undefined* type_print); -void InitMove(struct move* move, enum move_id move_id); -void InitMoveCheckId(struct move* move, enum move_id move_id); -void GetInfoMoveGround(struct ground_move* move, enum move_id move_id); -struct move_target_and_range GetMoveTargetAndRange(struct move* move, bool is_ai); -enum type_id GetMoveType(struct move* move); -uint8_t* GetMovesetLevelUpPtr(enum monster_id monster_id); +char *GetMoveName(enum move_id move_id); +void FormatMoveString(char *string, struct move *move, undefined *type_print); +void FormatMoveStringMore(undefined *param_1, int param_2, struct move *move, + undefined *type_print); +void InitMove(struct move *move, enum move_id move_id); +void InitMoveCheckId(struct move *move, enum move_id move_id); +void GetInfoMoveGround(struct ground_move *move, enum move_id move_id); +struct move_target_and_range GetMoveTargetAndRange(struct move *move, + bool is_ai); +enum type_id GetMoveType(struct move *move); +uint8_t *GetMovesetLevelUpPtr(enum monster_id monster_id); bool IsInvalidMoveset(int moveset_id); -undefined* GetMovesetHmTmPtr(enum monster_id monster_id); -undefined* GetMovesetEggPtr(enum monster_id monster_id); -uint8_t GetMoveAiWeight(struct move* move); -uint8_t GetMoveNbStrikes(struct move* move); -int GetMoveBasePower(struct move* move); -int16_t GetMoveBasePowerGround(struct ground_move* move); -uint8_t GetMoveAccuracyOrAiChance(struct move* move, int which); -uint8_t GetMoveBasePp(struct move* move); -int GetMaxPp(struct move* move); -uint8_t GetMoveMaxGinsengBoost(struct move* move); -uint8_t GetMoveMaxGinsengBoostGround(struct ground_move* move); -int GetMoveCritChance(struct move* move); -bool IsThawingMove(struct move* move); -bool IsUsableWhileTaunted(struct move* move); -uint8_t GetMoveRangeId(struct move* move); +undefined *GetMovesetHmTmPtr(enum monster_id monster_id); +undefined *GetMovesetEggPtr(enum monster_id monster_id); +uint8_t GetMoveAiWeight(struct move *move); +uint8_t GetMoveNbStrikes(struct move *move); +int GetMoveBasePower(struct move *move); +int16_t GetMoveBasePowerGround(struct ground_move *move); +uint8_t GetMoveAccuracyOrAiChance(struct move *move, int which); +uint8_t GetMoveBasePp(struct move *move); +int GetMaxPp(struct move *move); +uint8_t GetMoveMaxGinsengBoost(struct move *move); +uint8_t GetMoveMaxGinsengBoostGround(struct ground_move *move); +int GetMoveCritChance(struct move *move); +bool IsThawingMove(struct move *move); +bool IsUsableWhileTaunted(struct move *move); +uint8_t GetMoveRangeId(struct move *move); int GetMoveActualAccuracy(enum move_id move_id); int GetMoveBasePowerFromId(enum move_id move_id); -bool IsMoveRangeStringUser(struct move* move); -char* GetMoveMessageFromId(enum move_id move_id); -int GetNbMoves(undefined* moveset); -int GetMovesetIdx(undefined* moveset, enum move_id move_id); +bool IsMoveRangeStringUser(struct move *move); +char *GetMoveMessageFromId(enum move_id move_id); +int GetNbMoves(undefined *moveset); +int GetMovesetIdx(undefined *moveset, enum move_id move_id); bool IsReflectedByMagicCoat(enum move_id move_id); bool CanBeSnatched(enum move_id move_id); bool FailsWhileMuzzled(enum move_id move_id); -bool IsSoundMove(struct move* move); +bool IsSoundMove(struct move *move); bool IsRecoilMove(enum move_id move_id); void AllManip1(undefined4 param_1); void AllManip2(undefined4 param_1); -void ManipMoves1v1(undefined* param_1, undefined* param_2); -void ManipMoves1v2(undefined* param_1, undefined* param_2); -void ManipMoves2v1(undefined* param_1, undefined* param_2); -void ManipMoves2v2(undefined* param_1, undefined* param_2); -void DungeonMoveToGroundMove(struct ground_move* dst, struct move* src); -void GroundToDungeonMoveset(undefined* dst, undefined* src); -void DungeonToGroundMoveset(undefined* dst, undefined* src); -void GetInfoGroundMoveset(undefined* moveset, struct move_id_16* moves); -int FindFirstFreeMovesetIdx(undefined* moveset); -void LearnMoves(undefined* moveset, struct move_id_16* moves); -void CopyMoveToStream(struct bitstream* bitstream, struct ground_move* src); -void CopyMoveFromStream(struct bitstream* bitstream, struct ground_move* dst); -void CopyMovesetToStream(struct bitstream* bitstream, struct ground_move* src); -void CopyMovesetFromStream(struct bitstream* bitstream, struct ground_move* dst); +void ManipMoves1v1(undefined *param_1, undefined *param_2); +void ManipMoves1v2(undefined *param_1, undefined *param_2); +void ManipMoves2v1(undefined *param_1, undefined *param_2); +void ManipMoves2v2(undefined *param_1, undefined *param_2); +void DungeonMoveToGroundMove(struct ground_move *dst, struct move *src); +void GroundToDungeonMoveset(undefined *dst, undefined *src); +void DungeonToGroundMoveset(undefined *dst, undefined *src); +void GetInfoGroundMoveset(undefined *moveset, struct move_id_16 *moves); +int FindFirstFreeMovesetIdx(undefined *moveset); +void LearnMoves(undefined *moveset, struct move_id_16 *moves); +void CopyMoveToStream(struct bitstream *bitstream, struct ground_move *src); +void CopyMoveFromStream(struct bitstream *bitstream, struct ground_move *dst); +void CopyMovesetToStream(struct bitstream *bitstream, struct ground_move *src); +void CopyMovesetFromStream(struct bitstream *bitstream, + struct ground_move *dst); bool Is2TurnsMove(enum move_id move_id); bool IsRegularAttackOrProjectile(enum move_id move_id); bool IsPunchMove(enum move_id move_id); @@ -436,17 +463,18 @@ bool IsTrappingMove(enum move_id move_id); bool IsOneHitKoMove(enum move_id move_id); bool IsNot2TurnsMoveOrSketch(enum move_id move_id); bool IsRealMove(enum move_id move_id); -bool IsMovesetValid(undefined* moveset); +bool IsMovesetValid(undefined *moveset); bool IsRealMoveInTimeDarkness(enum move_id move_id); -bool IsMovesetValidInTimeDarkness(undefined* moveset); -int GetFirstNotRealMoveInTimeDarkness(undefined* moveset); -bool IsSameMove(undefined* moveset, struct move* move); +bool IsMovesetValidInTimeDarkness(undefined *moveset); +int GetFirstNotRealMoveInTimeDarkness(undefined *moveset); +bool IsSameMove(undefined *moveset, struct move *move); enum move_category GetMoveCategory(enum move_id move_id); -int GetPpIncrease(enum monster_id monster_id, uint32_t* iq_skill_flags); +int GetPpIncrease(enum monster_id monster_id, uint32_t *iq_skill_flags); void OpenWaza(int waza_id); void SelectWaza(int waza_id); void PlayBgmByIdVeneer(enum music_id music_id); -void PlayBgmByIdVolumeVeneer(enum music_id music_id, undefined param_2, int volume); +void PlayBgmByIdVolumeVeneer(enum music_id music_id, undefined param_2, + int volume); bool IsMePlaying(int me_id); void PlaySeByIdVolumeWrapper(int index); void PlaySeVolumeWrapper(int index); @@ -456,12 +484,12 @@ void StopBgmCommand(void); void PlayMeById(int me_id); void PlaySeByIdVolume(int se_id, int volume); void SendAudioCommand2(struct audio_command command); -struct audio_command* AllocAudioCommand(int status); +struct audio_command *AllocAudioCommand(int status); void SendAudioCommand(struct audio_command command); void InitSoundSystem(void); void ManipBgmPlayback(void); void SoundDriverReset(void); -uint32_t LoadDseFile(struct iovec* iov, const char* filename); +uint32_t LoadDseFile(struct iovec *iov, const char *filename); undefined4 PlaySeLoad(int param_1); bool IsSongOver(void); void PlayBgm(int param_1, int param_2, int param_3); @@ -477,183 +505,226 @@ void PlaySeFullSpec(int param_1, int param_2, int param_3, int param_4); void SeChangeVolume(int param_1, int param_2, int param_3); void SeChangePan(int param_1, int param_2, int param_3); void StopSe(int param_1, int param_2); -void FillCopyToFlatVramCommand(struct copy_to_obj_vram_order* order, void* dst, void* src, - uint32_t len_output, enum copy_to_obj_vram_order_type copy_type, +void FillCopyToFlatVramCommand(struct copy_to_obj_vram_order *order, void *dst, + void *src, uint32_t len_output, + enum copy_to_obj_vram_order_type copy_type, uint16_t interleave_with); -void ExecuteCopyToFlatVramCommand(struct copy_to_obj_vram_order* order); -uint32_t DecodeFragmentByteAssemblyTable(struct wan_fragment_bytes_assembly_entry* entry, - void* dst); -int LoadObjPalette(struct obj_graphics_control* obj_graphics_control, - struct palette_init_info* palette_init_info, uint8_t palette_num); -int AddSimpleObjToOam(struct obj_graphics_control* obj_graphics_control, uint16_t* obj, int group); -void GroupOamAttributesWrapper(struct obj_graphics_control* obj_graphics_control); -void CopyAttributesToOamWrapper(struct obj_graphics_control* obj_graphics_control); -void ChangeSimpleObjTexture(struct obj_graphics_control* obj_graphics_control, undefined4* src, - uint16_t oam_tile_num, uint16_t texture_size, bool extended_palette, +void ExecuteCopyToFlatVramCommand(struct copy_to_obj_vram_order *order); +uint32_t +DecodeFragmentByteAssemblyTable(struct wan_fragment_bytes_assembly_entry *entry, + void *dst); +int LoadObjPalette(struct obj_graphics_control *obj_graphics_control, + struct palette_init_info *palette_init_info, + uint8_t palette_num); +int AddSimpleObjToOam(struct obj_graphics_control *obj_graphics_control, + uint16_t *obj, int group); +void GroupOamAttributesWrapper( + struct obj_graphics_control *obj_graphics_control); +void CopyAttributesToOamWrapper( + struct obj_graphics_control *obj_graphics_control); +void ChangeSimpleObjTexture(struct obj_graphics_control *obj_graphics_control, + undefined4 *src, uint16_t oam_tile_num, + uint16_t texture_size, bool extended_palette, uint8_t ext_palette_upper_shifted); void InitObjGraphicsControls(void); void CopyAttributesToOamBothScreens(void); void GroupOamAttributesBothScreens(void); -void CopyAndInterleaveWrapper(uint16_t* dst, uint16_t* src, uint32_t len, uint8_t val); -void InitAnimationControl(struct animation_control* animation_control); -void InitAnimationControlWithSet(struct animation_control* animation_control); -void SetSpriteIdForAnimationControl(struct animation_control* anim_ctrl, uint16_t sprite_id); -void SetAnimationForAnimationControlInternal(struct animation_control* anim_ctrl, - struct wan_header* wan_header, int animation_group_id, - int animation_id, int unk1, int low_palette_pos, - int unk2, int unk3, int palette_bank); -void SetAnimationForAnimationControl(struct animation_control* anim_ctrl, int animation_key, - enum direction_id direction, int unk1, int low_palette_pos, - int unk2, int unk3, int unk4); -struct wan_header* GetWanForAnimationControl(struct animation_control* anim_ctrl); -void SetAndPlayAnimationForAnimationControl(struct animation_control* anim_ctrl, int animation_key, - enum direction_id direction, int unk1, - int low_palette_pos, int unk2, int unk3, int unk4); -void SwitchAnimationControlToNextFrame(struct animation_control* anim_ctrl); -void LoadAnimationFrameAndIncrementInAnimationControl(struct animation_control* anim_ctrl, - struct wan_animation_frame* anim_frame); -void FillOamAttributeInfo(struct animation_control* dst, uint16_t* src); -uint32_t AnimationControlGetAllocForMaxFrame(struct animation_control* anim_ctrl); -void DeleteWanTableEntry(struct wan_table* wan_table, int wan_id); -int AllocateWanTableEntry(struct wan_table* wan_table); -int FindWanTableEntry(struct wan_table* wan_table, const char* path); -int GetLoadedWanTableEntry(struct wan_table* wan_table, enum pack_file_id pack_id, - uint16_t file_index); -void InitWanTable(struct wan_table* wan_table); -int LoadWanTableEntry(struct wan_table* wan_table, const char* path, uint32_t flags); -int LoadWanTableEntryFromPack(struct wan_table* wan_table, enum pack_file_id pack_id, - uint16_t file_index, uint32_t alloc_flags, bool is_compressed); -int LoadWanTableEntryFromPackUseProvidedMemory(struct wan_table* wan_table, - enum pack_file_id pack_id, uint16_t file_index, - void* sprite_storage, bool is_compressed); -int ReplaceWanFromBinFile(struct wan_table* wan_table, int wan_id, enum pack_file_id pack_id, - uint16_t file_index, bool compressed); -void DeleteWanTableEntryVeneer(struct wan_table* wan_table, int wan_id); -bool WanHasAnimationGroup(struct wan_header* wan_header, uint16_t animation_group_id); -bool WanTableSpriteHasAnimationGroup(uint16_t sprite_id, uint16_t animation_group_id); +void CopyAndInterleaveWrapper(uint16_t *dst, uint16_t *src, uint32_t len, + uint8_t val); +void InitAnimationControl(struct animation_control *animation_control); +void InitAnimationControlWithSet(struct animation_control *animation_control); +void SetSpriteIdForAnimationControl(struct animation_control *anim_ctrl, + uint16_t sprite_id); +void SetAnimationForAnimationControlInternal( + struct animation_control *anim_ctrl, struct wan_header *wan_header, + int animation_group_id, int animation_id, int unk1, int low_palette_pos, + int unk2, int unk3, int palette_bank); +void SetAnimationForAnimationControl(struct animation_control *anim_ctrl, + int animation_key, + enum direction_id direction, int unk1, + int low_palette_pos, int unk2, int unk3, + int unk4); +struct wan_header * +GetWanForAnimationControl(struct animation_control *anim_ctrl); +void SetAndPlayAnimationForAnimationControl(struct animation_control *anim_ctrl, + int animation_key, + enum direction_id direction, + int unk1, int low_palette_pos, + int unk2, int unk3, int unk4); +void SwitchAnimationControlToNextFrame(struct animation_control *anim_ctrl); +void LoadAnimationFrameAndIncrementInAnimationControl( + struct animation_control *anim_ctrl, + struct wan_animation_frame *anim_frame); +void FillOamAttributeInfo(struct animation_control *dst, uint16_t *src); +uint32_t +AnimationControlGetAllocForMaxFrame(struct animation_control *anim_ctrl); +void DeleteWanTableEntry(struct wan_table *wan_table, int wan_id); +int AllocateWanTableEntry(struct wan_table *wan_table); +int FindWanTableEntry(struct wan_table *wan_table, const char *path); +int GetLoadedWanTableEntry(struct wan_table *wan_table, + enum pack_file_id pack_id, uint16_t file_index); +void InitWanTable(struct wan_table *wan_table); +int LoadWanTableEntry(struct wan_table *wan_table, const char *path, + uint32_t flags); +int LoadWanTableEntryFromPack(struct wan_table *wan_table, + enum pack_file_id pack_id, uint16_t file_index, + uint32_t alloc_flags, bool is_compressed); +int LoadWanTableEntryFromPackUseProvidedMemory(struct wan_table *wan_table, + enum pack_file_id pack_id, + uint16_t file_index, + void *sprite_storage, + bool is_compressed); +int ReplaceWanFromBinFile(struct wan_table *wan_table, int wan_id, + enum pack_file_id pack_id, uint16_t file_index, + bool compressed); +void DeleteWanTableEntryVeneer(struct wan_table *wan_table, int wan_id); +bool WanHasAnimationGroup(struct wan_header *wan_header, + uint16_t animation_group_id); +bool WanTableSpriteHasAnimationGroup(uint16_t sprite_id, + uint16_t animation_group_id); enum wan_sprite_type SpriteTypeInWanTable(uint16_t sprite_id); -void LoadWteFromRom(struct wte_handle* handle, const char* path, uint32_t flags); -void LoadWteFromFileDirectory(struct wte_handle* handle, enum pack_file_id pack_id, - uint16_t file_index, uint32_t malloc_flags); -void UnloadWte(struct wte_handle* handle); -undefined* LoadWtuFromBin(int bin_file_id, int file_id, int load_type); -void ProcessWte(undefined* wte_header_ptr, undefined4 texture_vram_offset, - undefined4 pal_vram_offset_upper, undefined4 pal_vram_offset_lower); -void DelayWteFree(struct wte_handle* handle); -void ResetPlannedVramTransfer(struct delayed_texture_vram_container* container); -uint32_t PlanCopyTextureToTextureVram(struct delayed_texture_vram_container* container, - void* image_pointer, uint32_t dest_vram_offset, - uint32_t image_length, - enum delayed_texture_vram_order_type order_type); -void PerformPlannedTextureVramTransfer(struct delayed_texture_vram_container* container); -void GeomSetTexImageParam(int texture_format, int texture_coordinates_transformation_modes, - int texture_s_size, int texture_t_size, int repeat_s_t, int flip_s_t, - bool color_0, int vram_offset); +void LoadWteFromRom(struct wte_handle *handle, const char *path, + uint32_t flags); +void LoadWteFromFileDirectory(struct wte_handle *handle, + enum pack_file_id pack_id, uint16_t file_index, + uint32_t malloc_flags); +void UnloadWte(struct wte_handle *handle); +undefined *LoadWtuFromBin(int bin_file_id, int file_id, int load_type); +void ProcessWte(undefined *wte_header_ptr, undefined4 texture_vram_offset, + undefined4 pal_vram_offset_upper, + undefined4 pal_vram_offset_lower); +void DelayWteFree(struct wte_handle *handle); +void ResetPlannedVramTransfer(struct delayed_texture_vram_container *container); +uint32_t +PlanCopyTextureToTextureVram(struct delayed_texture_vram_container *container, + void *image_pointer, uint32_t dest_vram_offset, + uint32_t image_length, + enum delayed_texture_vram_order_type order_type); +void PerformPlannedTextureVramTransfer( + struct delayed_texture_vram_container *container); +void GeomSetTexImageParam(int texture_format, + int texture_coordinates_transformation_modes, + int texture_s_size, int texture_t_size, + int repeat_s_t, int flip_s_t, bool color_0, + int vram_offset); void GeomSetVertexCoord16(int x, int y, int z); void InitRender3dData(void); void GeomSwapBuffers(void); -void InitRender3dElement64(struct render_3d_element_64* element64); -void Render3d64Texture0x7(struct render_3d_element_64* element64); -void Render3d64WindowFrame(struct render_3d_element_64* element64); -void EnqueueRender3d64Tiling(struct render_3d_element_64* element64); -void Render3d64Tiling(struct render_3d_element_64* element64); -void Render3d64Quadrilateral(struct render_3d_element_64* element64); -void Render3d64RectangleMulticolor(struct render_3d_element_64* element64); -void Render3d64Rectangle(struct render_3d_element_64* element64); -void Render3d64Nothing(struct render_3d_element_64* element64); -void Render3d64Texture(struct render_3d_element_64* element64); -void Render3dElement64(struct render_3d_element_64* element64); -int HandleSir0Translation(uint8_t** dst, uint8_t* src); -void ConvertPointersSir0(undefined* sir0_ptr); -int HandleSir0TranslationVeneer(uint8_t** dst, uint8_t* src); -void FillPaletteInitInfo(struct palette_init_info* palette_init_info, struct rgba* palette_bytes, - uint16_t palette_mode, uint16_t nb_colors_or_palettes, +void InitRender3dElement64(struct render_3d_element_64 *element64); +void Render3d64Texture0x7(struct render_3d_element_64 *element64); +void Render3d64WindowFrame(struct render_3d_element_64 *element64); +void EnqueueRender3d64Tiling(struct render_3d_element_64 *element64); +void Render3d64Tiling(struct render_3d_element_64 *element64); +void Render3d64Quadrilateral(struct render_3d_element_64 *element64); +void Render3d64RectangleMulticolor(struct render_3d_element_64 *element64); +void Render3d64Rectangle(struct render_3d_element_64 *element64); +void Render3d64Nothing(struct render_3d_element_64 *element64); +void Render3d64Texture(struct render_3d_element_64 *element64); +void Render3dElement64(struct render_3d_element_64 *element64); +int HandleSir0Translation(uint8_t **dst, uint8_t *src); +void ConvertPointersSir0(undefined *sir0_ptr); +int HandleSir0TranslationVeneer(uint8_t **dst, uint8_t *src); +void FillPaletteInitInfo(struct palette_init_info *palette_init_info, + struct rgba *palette_bytes, uint16_t palette_mode, + uint16_t nb_colors_or_palettes, uint16_t ext_palette_upper, int8_t palette_num_custom); -int DecompressAtNormalVeneer(undefined* addr_decomp, int expected_size, undefined* at_ptr); -int DecompressAtNormal(undefined* addr_decomp, int expected_size, undefined* at_ptr); -int DecompressAtHalf(undefined* addr_decomp, int expected_size, undefined* at_ptr, int high_nibble); -int DecompressAtFromMemoryPointerVeneer(undefined* addr_decomp, int expected_size, - undefined* at_ptr); -int DecompressAtFromMemoryPointer(undefined* addr_decomp, int expected_size, undefined* at_ptr); +int DecompressAtNormalVeneer(undefined *addr_decomp, int expected_size, + undefined *at_ptr); +int DecompressAtNormal(undefined *addr_decomp, int expected_size, + undefined *at_ptr); +int DecompressAtHalf(undefined *addr_decomp, int expected_size, + undefined *at_ptr, int high_nibble); +int DecompressAtFromMemoryPointerVeneer(undefined *addr_decomp, + int expected_size, undefined *at_ptr); +int DecompressAtFromMemoryPointer(undefined *addr_decomp, int expected_size, + undefined *at_ptr); void WriteByteFromMemoryPointer(uint8_t byte); -int GetAtSize(undefined* at_ptr, int param_2); +int GetAtSize(undefined *at_ptr, int param_2); int GetLanguageType(void); int GetLanguage(void); -bool StrcmpTag(const char* s1, const char* s2); -int AtoiTag(const char* s); -int AnalyzeText(undefined* buf); -int PreprocessString(char* output, int output_size, const char* format, - struct preprocessor_flags flags, struct preprocessor_args* args); -int PreprocessStringFromId(char* output, int output_size, int string_id, - struct preprocessor_flags flags, struct preprocessor_args* args); -bool StrcmpTagVeneer(const char* s1, const char* s2); -int AtoiTagVeneer(const char* s); -void InitPreprocessorArgs(struct preprocessor_args* args); -char* SetStringAccuracy(char* s, int param_2); -char* SetStringPower(char* s, int param_2); -char* GetRankString(char* s, int rank_and_flags); -char* GetCurrentTeamNameString(char* buffer, int param_2); -char* GetBagNameString(char* buffer); -char* GetSize0x80Buffer(int idx); -char* GetSize0x80Buffer2(int idx); -char* GetDungeonResultString(int string_number); -void SubstitutePlaceholderItemTags(uint8_t tag_id, struct item* item, undefined4* param_3); -void SetQuestionMarks(char* s); -void StrcpySimple(char* dest, const char* src); -void StrncpySimple(char* dest, const char* src, uint32_t n); -void StrncpySimpleNoPad(char* dest, const char* src, uint32_t n); -int StrncmpSimple(const char* s1, const char* s2, uint32_t n); -void StrncpySimpleNoPadSafe(char* dest, const char* src, uint32_t n); -void StrcpyName(char* dest, const char* src); -void StrncpyName(char* dest, const char* src, uint32_t n); -void GetStringFromFile(char* buf, int string_id); +bool StrcmpTag(const char *s1, const char *s2); +int AtoiTag(const char *s); +int AnalyzeText(undefined *buf); +int PreprocessString(char *output, int output_size, const char *format, + struct preprocessor_flags flags, + struct preprocessor_args *args); +int PreprocessStringFromId(char *output, int output_size, int string_id, + struct preprocessor_flags flags, + struct preprocessor_args *args); +bool StrcmpTagVeneer(const char *s1, const char *s2); +int AtoiTagVeneer(const char *s); +void InitPreprocessorArgs(struct preprocessor_args *args); +char *SetStringAccuracy(char *s, int param_2); +char *SetStringPower(char *s, int param_2); +char *GetRankString(char *s, int rank_and_flags); +char *GetCurrentTeamNameString(char *buffer, int param_2); +char *GetBagNameString(char *buffer); +char *GetSize0x80Buffer(int idx); +char *GetSize0x80Buffer2(int idx); +char *GetDungeonResultString(int string_number); +void SubstitutePlaceholderItemTags(uint8_t tag_id, struct item *item, + undefined4 *param_3); +void SetQuestionMarks(char *s); +void StrcpySimple(char *dest, const char *src); +void StrncpySimple(char *dest, const char *src, uint32_t n); +void StrncpySimpleNoPad(char *dest, const char *src, uint32_t n); +int StrncmpSimple(const char *s1, const char *s2, uint32_t n); +void StrncpySimpleNoPadSafe(char *dest, const char *src, uint32_t n); +void StrcpyName(char *dest, const char *src); +void StrncpyName(char *dest, const char *src, uint32_t n); +void GetStringFromFile(char *buf, int string_id); void LoadStringFile(void); -uint8_t* AllocateTemp1024ByteBufferFromPool(void); -void GetStringFromFileVeneer(char* buf, int string_id); -char* StringFromId(int string_id); -void CopyStringFromId(char* buf, int string_id); -void CopyNStringFromId(char* buf, int string_id, int buf_len); +uint8_t *AllocateTemp1024ByteBufferFromPool(void); +void GetStringFromFileVeneer(char *buf, int string_id); +char *StringFromId(int string_id); +void CopyStringFromId(char *buf, int string_id); +void CopyNStringFromId(char *buf, int string_id, int buf_len); void LoadTblTalk(void); -int GetTalkLine(int personality_idx, enum talk_type talk_type, int restrictions); +int GetTalkLine(int personality_idx, enum talk_type talk_type, + int restrictions); bool IsAOrBPressed(void); -void DrawTextInWindow(int window_id, int x, int y, char* string); -void AppendStandardStringToMission(undefined4 param_1, undefined4 param_2, undefined4 param_3, - int string_id); +void DrawTextInWindow(int window_id, int x, int y, char *string); +void AppendStandardStringToMission(undefined4 param_1, undefined4 param_2, + undefined4 param_3, int string_id); uint8_t GetCharWidth(char symbol); int GetColorCodePaletteOffset(char symbol); uint8_t DrawChar(int window_id, int x, int y, char symbol, int color_offset); -struct window* GetWindow(int window_id); -int NewWindowScreenCheck(struct window_params* params, uint8_t param_2); -int NewWindow(struct window_params* params, uint8_t param_2); -int GetPaletteBaseAddress(undefined4 pal_vram_offset_upper, undefined4 pal_vram_offset_lower); +struct window *GetWindow(int window_id); +int NewWindowScreenCheck(struct window_params *params, uint8_t param_2); +int NewWindow(struct window_params *params, uint8_t param_2); +int GetPaletteBaseAddress(undefined4 pal_vram_offset_upper, + undefined4 pal_vram_offset_lower); void SetScreenWindowsColor(int palette_idx, bool upper_screen); void SetBothScreensWindowsColor(int palette_idx); void UpdateWindow(int window_id); void ClearWindow(int window_id); void DeleteWindow(int window_id); -void GetWindowRectangle(int window_id, struct window_rectangle* rect_out); -void* GetWindowContents(int window_id); +void GetWindowRectangle(int window_id, struct window_rectangle *rect_out); +void *GetWindowContents(int window_id); void LoadCursors(void); -void InitWindowTrailer(struct window_trailer* trailer); +void InitWindowTrailer(struct window_trailer *trailer); void LoadAlert(void); int PrintClearMark(int mark_id, int x, int y, undefined param_4); -int PrintSpecialEpisodeClearMark(enum special_episode_type special_episode_type, int x, int y, - undefined param_4); +int PrintSpecialEpisodeClearMark(enum special_episode_type special_episode_type, + int x, int y, undefined param_4); int PrintBadgeMark(enum rank badge_id, int x, int y, undefined param_4); int PrintMark(int file, int id_in_file, int x, int y, undefined param_5); -int CreateParentMenuFromStringIds(struct window_params* params, struct window_flags flags, - struct window_extra_info* window_extra_info, - struct simple_menu_id_item* menu_items); -bool IsEmptyString(const char* s); -int CreateParentMenu(struct window_params* params, struct window_flags flags, - struct window_extra_info* window_extra_info, - struct simple_menu_ptr_item* menu_items); -int CreateParentMenuWrapper(struct window_params* params, struct window_flags flags, - struct window_extra_info* window_extra_info, - struct simple_menu_ptr_item* menu_items); -int CreateParentMenuInternal(struct window_params* params, struct window_flags flags, - struct window_extra_info* window_extra_info, - struct simple_menu_item* menu_items); +int CreateParentMenuFromStringIds(struct window_params *params, + struct window_flags flags, + struct window_extra_info *window_extra_info, + struct simple_menu_id_item *menu_items); +bool IsEmptyString(const char *s); +int CreateParentMenu(struct window_params *params, struct window_flags flags, + struct window_extra_info *window_extra_info, + struct simple_menu_ptr_item *menu_items); +int CreateParentMenuWrapper(struct window_params *params, + struct window_flags flags, + struct window_extra_info *window_extra_info, + struct simple_menu_ptr_item *menu_items); +int CreateParentMenuInternal(struct window_params *params, + struct window_flags flags, + struct window_extra_info *window_extra_info, + struct simple_menu_item *menu_items); void ResumeParentMenu(int window_id); void SetParentMenuState7(int window_id); void CloseParentMenu(int window_id); @@ -661,38 +732,43 @@ bool IsParentMenuActive(int window_id); bool CheckParentMenuField0x1A0(int window_id); uint8_t GetWindowIdSelectedItemOnPage(int window_id); int GetSimpleMenuResult(int window_id); -void UpdateParentMenu(struct window* window); -int CreateSimpleMenuFromStringIds(struct window_params* params, struct window_flags flags, - struct window_extra_info* window_extra_info, - struct simple_menu_id_item* menu_items, int n_items); -int CreateSimpleMenu(struct window_params* params, struct window_flags flags, - struct window_extra_info* window_extra_info, - struct simple_menu_item* menu_items, int n_items); -int CreateSimpleMenuInternal(struct window_params* params, struct window_flags flags, - struct window_extra_info* window_extra_info, - struct simple_menu_item* menu_items, int n_items); +void UpdateParentMenu(struct window *window); +int CreateSimpleMenuFromStringIds(struct window_params *params, + struct window_flags flags, + struct window_extra_info *window_extra_info, + struct simple_menu_id_item *menu_items, + int n_items); +int CreateSimpleMenu(struct window_params *params, struct window_flags flags, + struct window_extra_info *window_extra_info, + struct simple_menu_item *menu_items, int n_items); +int CreateSimpleMenuInternal(struct window_params *params, + struct window_flags flags, + struct window_extra_info *window_extra_info, + struct simple_menu_item *menu_items, int n_items); void ResumeSimpleMenu(int window_id); void CloseSimpleMenu(int window_id); bool IsSimpleMenuActive(int window_id); bool CheckSimpleMenuField0x1A0(int window_id); int GetSimpleMenuField0x1A4(int window_id); -void UpdateSimpleMenu(struct window* window); +void UpdateSimpleMenu(struct window *window); void SetSimpleMenuField0x1AC(int window_id, int value); -int CreateAdvancedMenu(struct window_params* params, struct window_flags flags, - struct window_extra_info* window_extra_info, - advanced_menu_entry_fn_t entry_fn, int n_options, int n_opt_per_page); +int CreateAdvancedMenu(struct window_params *params, struct window_flags flags, + struct window_extra_info *window_extra_info, + advanced_menu_entry_fn_t entry_fn, int n_options, + int n_opt_per_page); void ResumeAdvancedMenu(int window_id); void CloseAdvancedMenu(int window_id); bool IsAdvancedMenuActive2(int window_id); bool IsAdvancedMenuActive(int window_id); int GetAdvancedMenuCurrentOption(int window_id); int GetAdvancedMenuResult(int window_id); -void UpdateAdvancedMenu(struct window* window); -void DrawAdvancedMenu(struct window* window); -int CreateCollectionMenu(struct window_params* params, struct window_flags flags, - struct window_extra_info* window_extra_info, - unk_collection_menu_fn_t param_4, undefined4 param_5, int n_options, - int n_opt_per_page); +void UpdateAdvancedMenu(struct window *window); +void DrawAdvancedMenu(struct window *window); +int CreateCollectionMenu(struct window_params *params, + struct window_flags flags, + struct window_extra_info *window_extra_info, + unk_collection_menu_fn_t param_4, undefined4 param_5, + int n_options, int n_opt_per_page); void SetCollectionMenuField0x1BC(int window_id, int value); void SetCollectionMenuWidth(int window_id, int width); void CloseCollectionMenu(int window_id); @@ -701,88 +777,98 @@ void SetCollectionMenuField0x1C8(int window_id, uint8_t value); void SetCollectionMenuField0x1A0(int window_id, undefined4 value); void SetCollectionMenuField0x1A4(int window_id, undefined4 value); void SetCollectionMenuVoidFn(int window_id, unk_collection_menu_void_fn_t fn); -void UpdateCollectionMenu(struct window* window); +void UpdateCollectionMenu(struct window *window); void SetCollectionMenuField0x1B2(int window_id, undefined4 value); bool IsCollectionMenuState3(int window_id); -int CreateOptionsMenu(struct window_params* params, struct window_flags flags, - struct window_extra_info* window_extra_info, - struct options_menu_id_item* menu_items, int n_items, int* option_states); +int CreateOptionsMenu(struct window_params *params, struct window_flags flags, + struct window_extra_info *window_extra_info, + struct options_menu_id_item *menu_items, int n_items, + int *option_states); void CloseOptionsMenu(int window_id); bool IsOptionsMenuActive(int window_id); bool CheckOptionsMenuField0x1A4(int window_id); -void GetOptionsMenuStates(int window_id, int* option_states); +void GetOptionsMenuStates(int window_id, int *option_states); bool GetOptionsMenuResult(int window_id); -void UpdateOptionsMenu(struct window* window); -int CreateDebugMenu(struct window_params* params, struct window_flags flags, - struct window_extra_info* window_extra_info, uint16_t* menu_item_string_ids, - int n_items, undefined* param_6); +void UpdateOptionsMenu(struct window *window); +int CreateDebugMenu(struct window_params *params, struct window_flags flags, + struct window_extra_info *window_extra_info, + uint16_t *menu_item_string_ids, int n_items, + undefined *param_6); void CloseDebugMenu(int window_id); bool IsDebugMenuActive(int window_id); bool CheckDebugMenuField0x1A4(int window_id); -void UpdateDebugMenu(struct window* window); -int CreateScrollBoxSingle(struct window_params* params, struct window_flags flags, - struct window_extra_info* window_extra_info, uint16_t string_id1, - struct preprocessor_args* args1, uint16_t string_id2, - struct preprocessor_args* args2); -int CreateScrollBoxMulti(struct window_params* params, struct window_flags flags, - struct window_extra_info* window_extra_info, int n_strings, - uint16_t* string_ids1, struct preprocessor_args* args1, - uint16_t* string_ids2, struct preprocessor_args* args2); +void UpdateDebugMenu(struct window *window); +int CreateScrollBoxSingle(struct window_params *params, + struct window_flags flags, + struct window_extra_info *window_extra_info, + uint16_t string_id1, struct preprocessor_args *args1, + uint16_t string_id2, struct preprocessor_args *args2); +int CreateScrollBoxMulti(struct window_params *params, + struct window_flags flags, + struct window_extra_info *window_extra_info, + int n_strings, uint16_t *string_ids1, + struct preprocessor_args *args1, uint16_t *string_ids2, + struct preprocessor_args *args2); void SetScrollBoxState7(int window_id); void CloseScrollBox(int window_id); bool IsScrollBoxActive(int window_id); -void UpdateScrollBox(struct window* window); -int CreateDialogueBox(struct window_params* params); +void UpdateScrollBox(struct window *window); +int CreateDialogueBox(struct window_params *params); void CloseDialogueBox(int window_id); bool IsDialogueBoxActive(int window_id); -void ShowStringIdInDialogueBox(int window_id, struct preprocessor_flags flags, int string_id, - struct preprocessor_args* args); -void ShowStringInDialogueBox(int window_id, struct preprocessor_flags flags, char* string, - struct preprocessor_args* args); +void ShowStringIdInDialogueBox(int window_id, struct preprocessor_flags flags, + int string_id, struct preprocessor_args *args); +void ShowStringInDialogueBox(int window_id, struct preprocessor_flags flags, + char *string, struct preprocessor_args *args); void ShowDialogueBox(int window_id); -void ReadStringFromDialogueBox(int window_id, char* buffer, uint32_t n); -void UpdateDialogueBox(struct window* window); +void ReadStringFromDialogueBox(int window_id, char *buffer, uint32_t n); +void UpdateDialogueBox(struct window *window); int CreatePortraitBox(enum screen screen, uint32_t palette_idx, bool framed); void ClosePortraitBox(int window_id); bool PortraitBoxNeedsUpdate(int window_id); -void ShowPortraitInPortraitBox(int window_id, struct portrait_params* portrait); +void ShowPortraitInPortraitBox(int window_id, struct portrait_params *portrait); void HidePortraitBox(int window_id); -void UpdatePortraitBox(struct window* window); -int CreateTextBox(struct window_params* params, text_box_callback_fn_t cb); -int CreateTextBoxWithArg(struct window_params* params, text_box_callback_with_arg_fn_t cb, - void* cb_arg); +void UpdatePortraitBox(struct window *window); +int CreateTextBox(struct window_params *params, text_box_callback_fn_t cb); +int CreateTextBoxWithArg(struct window_params *params, + text_box_callback_with_arg_fn_t cb, void *cb_arg); void CloseTextBox(int window_id); void CloseTextBox2(int window_id); -struct text_box* CreateTextBoxInternal(struct window_params* params); -void UpdateTextBox(struct window* window); +struct text_box *CreateTextBoxInternal(struct window_params *params); +void UpdateTextBox(struct window *window); bool IsTextBoxActive(int window_id); -int CreateAreaNameBox(struct window_params* params, struct window_flags flags, - struct window_extra_info* window_extra_info, uint32_t id); +int CreateAreaNameBox(struct window_params *params, struct window_flags flags, + struct window_extra_info *window_extra_info, uint32_t id); void SetAreaNameBoxState3(int window_id); void CloseAreaNameBox(int window_id); bool IsAreaNameBoxActive(int window_id); -void UpdateAreaNameBox(struct window* window); -int CreateControlsChart(struct window_params* params, struct window_flags flags, - struct window_extra_info* window_extra_info, uint16_t string_id); +void UpdateAreaNameBox(struct window *window); +int CreateControlsChart(struct window_params *params, struct window_flags flags, + struct window_extra_info *window_extra_info, + uint16_t string_id); void CloseControlsChart(int window_id); bool IsControlsChartActive(int window_id); -void UpdateControlsChart(struct window* window); -int CreateAlertBox(struct window_params* params); +void UpdateControlsChart(struct window *window); +int CreateAlertBox(struct window_params *params); void CloseAlertBox(int window_id); -bool AddMessageToAlertBox(int window_id, struct preprocessor_flags flags, char* message, - struct preprocessor_args* preprocessor_args, bool is_new_group); +bool AddMessageToAlertBox(int window_id, struct preprocessor_flags flags, + char *message, + struct preprocessor_args *preprocessor_args, + bool is_new_group); bool IsAlertBoxActive(int window_id); -void UpdateAlertBox(struct window* window); -int CreateAdvancedTextBox(struct window_params* params, struct window_flags flags, - struct window_extra_info* extra_info, text_box_callback_fn_t cb, - int n_items); -int CreateAdvancedTextBoxWithArg(struct window_params* params, struct window_flags flags, - struct window_extra_info* extra_info, - text_box_callback_with_arg_fn_t cb, void* cb_arg, int n_items); -struct advanced_text_box* CreateAdvancedTextBoxInternal(struct window_params* params, - struct window_flags flags, - struct window_extra_info* extra_info, - int n_items, int n_items_per_page); +void UpdateAlertBox(struct window *window); +int CreateAdvancedTextBox(struct window_params *params, + struct window_flags flags, + struct window_extra_info *extra_info, + text_box_callback_fn_t cb, int n_items); +int CreateAdvancedTextBoxWithArg(struct window_params *params, + struct window_flags flags, + struct window_extra_info *extra_info, + text_box_callback_with_arg_fn_t cb, + void *cb_arg, int n_items); +struct advanced_text_box *CreateAdvancedTextBoxInternal( + struct window_params *params, struct window_flags flags, + struct window_extra_info *extra_info, int n_items, int n_items_per_page); void SetAdvancedTextBoxPartialMenu(int window_id, bool partial_menu); void SetAdvancedTextBoxField0x1C4(int window_id, uint8_t value); void SetAdvancedTextBoxField0x1C2(int window_id); @@ -793,59 +879,68 @@ bool IsAdvancedTextBoxActive(int window_id); uint8_t GetWindowIdPageStart(int window_id); uint32_t GetAdvancedTextBoxFlags2(int window_id); void SetUnkAdvancedTextBoxFn(int window_id, unk_advanced_text_box_fn_t fn); -void SetUnkAdvancedTextBoxWindowFn(int window_id, unk_advanced_text_box_window_fn_t fn); -void UpdateAdvancedTextBox(struct window* window); +void SetUnkAdvancedTextBoxWindowFn(int window_id, + unk_advanced_text_box_window_fn_t fn); +void UpdateAdvancedTextBox(struct window *window); void PlayAdvancedTextBoxInputSound(int window_id, int index); -int CreateTeamSelectionMenu(struct window_params* params, struct window_flags flags, - struct window_extra_info* window_extra_info, - team_selection_menu_get_item_fn_t get_item, int n_items, - int n_items_per_page); +int CreateTeamSelectionMenu(struct window_params *params, + struct window_flags flags, + struct window_extra_info *window_extra_info, + team_selection_menu_get_item_fn_t get_item, + int n_items, int n_items_per_page); void CloseTeamSelectionMenu(int window_id); bool IsTeamSelectionMenuActive(int window_id); -void UpdateTeamSelectionMenu(struct window* window); +void UpdateTeamSelectionMenu(struct window *window); bool IsTeamSelectionMenuState3(int window_id); -int CalcMenuHeightDiv8(struct window_flags flags, struct window_extra_info* extra_info, - int* n_options, int* n_opt_per_page); -void InitWindowInput(struct window_input_ctx* input_ctx, struct window_flags flags, - struct window_extra_info* window_extra_info, struct window_rectangle* rect, - int n_items, int n_items_per_page); -bool IsMenuOptionActive(struct window_input_ctx* input_ctx); -uint8_t GetSelectedItemOnPage(struct window_input_ctx* input_ctx); -uint8_t GetCurrentPage(struct window_input_ctx* input_ctx); -uint8_t GetPageStart(struct window_input_ctx* input_ctx); -uint8_t GetSelectedMenuItemIdx(struct window_input_ctx* input_ctx); -uint8_t GetTotalNumMenuItems(struct window_input_ctx* input_ctx); -uint8_t GetNumItemsOnPage(struct window_input_ctx* input_ctx); -uint8_t GetMaxItemsOnPage(struct window_input_ctx* input_ctx); -uint8_t GetTotalNumPages(struct window_input_ctx* input_ctx); -int GetPageItemYOffset(struct window_input_ctx* input_ctx, uint8_t item_idx); -void PlayWindowInputSound(struct window_input_ctx* input_ctx, int index); -void InitInventoryMenuInput(struct inventory_menu_input_ctx* input_ctx, struct window_flags flags, - struct window_extra_info* window_extra_info, - struct window_rectangle* rect, int n_items, int n_items_per_page, - undefined param_7); -void InventoryMenuNextPage(struct inventory_menu_input_ctx* ctx); -void InventoryMenuPreviousPage(struct inventory_menu_input_ctx* ctx); -void InventoryMenuNext10Pages(struct inventory_menu_input_ctx* ctx); -void InventoryMenuPrevious10Pages(struct inventory_menu_input_ctx* ctx); -bool OverlayLoadEntriesEqual(struct overlay_load_entry* entry1, struct overlay_load_entry* entry2); +int CalcMenuHeightDiv8(struct window_flags flags, + struct window_extra_info *extra_info, int *n_options, + int *n_opt_per_page); +void InitWindowInput(struct window_input_ctx *input_ctx, + struct window_flags flags, + struct window_extra_info *window_extra_info, + struct window_rectangle *rect, int n_items, + int n_items_per_page); +bool IsMenuOptionActive(struct window_input_ctx *input_ctx); +uint8_t GetSelectedItemOnPage(struct window_input_ctx *input_ctx); +uint8_t GetCurrentPage(struct window_input_ctx *input_ctx); +uint8_t GetPageStart(struct window_input_ctx *input_ctx); +uint8_t GetSelectedMenuItemIdx(struct window_input_ctx *input_ctx); +uint8_t GetTotalNumMenuItems(struct window_input_ctx *input_ctx); +uint8_t GetNumItemsOnPage(struct window_input_ctx *input_ctx); +uint8_t GetMaxItemsOnPage(struct window_input_ctx *input_ctx); +uint8_t GetTotalNumPages(struct window_input_ctx *input_ctx); +int GetPageItemYOffset(struct window_input_ctx *input_ctx, uint8_t item_idx); +void PlayWindowInputSound(struct window_input_ctx *input_ctx, int index); +void InitInventoryMenuInput(struct inventory_menu_input_ctx *input_ctx, + struct window_flags flags, + struct window_extra_info *window_extra_info, + struct window_rectangle *rect, int n_items, + int n_items_per_page, undefined param_7); +void InventoryMenuNextPage(struct inventory_menu_input_ctx *ctx); +void InventoryMenuPreviousPage(struct inventory_menu_input_ctx *ctx); +void InventoryMenuNext10Pages(struct inventory_menu_input_ctx *ctx); +void InventoryMenuPrevious10Pages(struct inventory_menu_input_ctx *ctx); +bool OverlayLoadEntriesEqual(struct overlay_load_entry *entry1, + struct overlay_load_entry *entry2); void FreeActiveMenu(void); -bool InitMenu(struct overlay_load_entry* entry); -bool InitMenuWithWindowExtraInfo(struct overlay_load_entry* entry, bool init_extra_info, - struct window_extra_info* window_extra_info); -bool CopyMenuControlWindowExtraInfo(struct window_extra_info* window_extra_info); +bool InitMenu(struct overlay_load_entry *entry); +bool InitMenuWithWindowExtraInfo(struct overlay_load_entry *entry, + bool init_extra_info, + struct window_extra_info *window_extra_info); +bool CopyMenuControlWindowExtraInfo( + struct window_extra_info *window_extra_info); void HandleMenus(void); -int SetupAndShowKeyboard(int menu_type, char* buffer1, char* buffer2); -int ShowKeyboard(int menu_type, char* buffer1, int param_3, char* buffer2); +int SetupAndShowKeyboard(int menu_type, char *buffer1, char *buffer2); +int ShowKeyboard(int menu_type, char *buffer1, int param_3, char *buffer2); int GetKeyboardStatus(void); int GetKeyboardStringResult(void); -char* TeamSelectionMenuGetItem(char* buffer, int member_idx); +char *TeamSelectionMenuGetItem(char *buffer, int member_idx); void FreeMissionRewardStructMain(void); void MissionRewardCloseAllBoxes(void); void PrintMoveOptionMenu(void); -void PrintIqSkillsMenu(enum monster_id monster_id, uint32_t* iq_skills_flags, int monster_iq, - bool is_blinded); -char* GetCheckIqMenuSkillString(char* buf, int iq_entry_idx); +void PrintIqSkillsMenu(enum monster_id monster_id, uint32_t *iq_skills_flags, + int monster_iq, bool is_blinded); +char *GetCheckIqMenuSkillString(char *buf, int iq_entry_idx); void PlayMissionClearBgm(void); bool GetNotifyNote(void); void SetNotifyNote(bool flag); @@ -854,25 +949,26 @@ void EventFlagBackupVeneer(void); void InitMainTeamAfterQuiz(void); void InitSpecialEpisodePartners(void); void InitSpecialEpisodeExtraPartner(void); -void AssignSpecialEpisodePc(int team_member_id, struct special_episode_pc* special_episode_pc); -void ReadStringSave(char* buf); -bool CheckStringSave(const char* buf); -int WriteSaveFile(undefined* save_info, undefined* buf, int size); -int ReadSaveFile(undefined* save_info, undefined* buf, int size); -void CalcChecksum(undefined* save_info, int size); -bool CheckChecksumInvalid(undefined* save_info, int size); +void AssignSpecialEpisodePc(int team_member_id, + struct special_episode_pc *special_episode_pc); +void ReadStringSave(char *buf); +bool CheckStringSave(const char *buf); +int WriteSaveFile(undefined *save_info, undefined *buf, int size); +int ReadSaveFile(undefined *save_info, undefined *buf, int size); +void CalcChecksum(undefined *save_info, int size); +bool CheckChecksumInvalid(undefined *save_info, int size); int NoteSaveBase(int param_1); -void WriteQuickSaveInfo(undefined* buf, int size); -undefined4 ReadSaveHeader(undefined4* param_1, undefined4 param_2, undefined4 param_3, - undefined4 param_4); +void WriteQuickSaveInfo(undefined *buf, int size); +undefined4 ReadSaveHeader(undefined4 *param_1, undefined4 param_2, + undefined4 param_3, undefined4 param_4); int NoteLoadBase(void); -int ReadQuickSaveInfo(undefined* buf, int size); +int ReadQuickSaveInfo(undefined *buf, int size); void InitOptionsVeneer(void); void InitOptions(void); -void GetOptions(struct options* dest_opts_ptr); -void SetOptions(struct options* src_options_ptr); -void SaveOptionsToCtx(uint8_t* ctx); -void LoadOptionsFromCtx(uint8_t* ctx); +void GetOptions(struct options *dest_opts_ptr); +void SetOptions(struct options *src_options_ptr); +void SaveOptionsToCtx(uint8_t *ctx); +void LoadOptionsFromCtx(uint8_t *ctx); bool IsTouchScreenNotOff(void); bool IsTouchScreenUseAnywhere(void); uint8_t GetTopScreenOption(void); @@ -887,46 +983,59 @@ bool GetCheckDirectionOption(void); bool IsMapShownOnEitherScreen(void); bool IsTeamStatsOnTopScreen(void); bool IsTextLogOnTopScreen(void); -void CopyFrameTypeOption(uint8_t* dst); -void SetFrameTypeOption(uint8_t* new_ft); +void CopyFrameTypeOption(uint8_t *dst); +void SetFrameTypeOption(uint8_t *new_ft); enum game_mode GetGameMode(void); bool IsGameModeRescue(void); void SetGameMode(enum game_mode new_game_mode); void DebugPrintEventFlagSize(void); void InitScriptVariableValues(void); void InitEventFlagScriptVars(void); -void DefaultInitScriptVariable(void* local_var_vals, enum script_var_id id); -void ZinitScriptVariable(void* local_var_vals, enum script_var_id id); -void LoadScriptVariableRaw(struct script_var_desc* var, void* local_var_vals, +void DefaultInitScriptVariable(void *local_var_vals, enum script_var_id id); +void ZinitScriptVariable(void *local_var_vals, enum script_var_id id); +void LoadScriptVariableRaw(struct script_var_desc *var, void *local_var_vals, enum script_var_id id); -int LoadScriptVariableValue(void* local_var_vals, enum script_var_id id); -int LoadScriptVariableValueAtIndex(void* local_var_vals, enum script_var_id id, int idx); -void SaveScriptVariableValue(void* local_var_vals, enum script_var_id id, int val); -void SaveScriptVariableValueAtIndex(void* local_var_vals, enum script_var_id id, int idx, int val); -int LoadScriptVariableValueSum(void* local_var_vals, enum script_var_id id); -void LoadScriptVariableValueBytes(enum script_var_id id, void* dest, uint32_t n); -void LoadScriptVariableValueString(enum script_var_id id, void* dest, uint8_t n); -void SaveScriptVariableValueBytes(enum script_var_id id, void* src, uint32_t n); -bool ScriptVariablesEqual(void* local_var_vals, enum script_var_id id1, enum script_var_id id2); -int CalcScriptVariables(int val0, int val1, enum script_calc_operation operation); -bool CompareScriptVariables(int val0, int val1, enum script_compare_operation operation); -int CalcScriptVariablesVeneer(int val0, int val1, enum script_calc_operation operation); -void CalcAndUpdateScriptVarWithOtherValue(void* local_var_vals, enum script_var_id id, - int other_val, enum script_calc_operation operation); -void CalcAndUpdateScriptVarWithOtherScriptVar(void* local_var_vals, enum script_var_id id1, - enum script_var_id id2, - enum script_calc_operation operation); -bool CompareScriptVariablesVeneer(int val0, int val1, enum script_compare_operation operation); -bool LoadAndCompareScriptVarAndValue(void* local_var_vals, enum script_var_id id, int other_val, +int LoadScriptVariableValue(void *local_var_vals, enum script_var_id id); +int LoadScriptVariableValueAtIndex(void *local_var_vals, enum script_var_id id, + int idx); +void SaveScriptVariableValue(void *local_var_vals, enum script_var_id id, + int val); +void SaveScriptVariableValueAtIndex(void *local_var_vals, enum script_var_id id, + int idx, int val); +int LoadScriptVariableValueSum(void *local_var_vals, enum script_var_id id); +void LoadScriptVariableValueBytes(enum script_var_id id, void *dest, + uint32_t n); +void LoadScriptVariableValueString(enum script_var_id id, void *dest, + uint8_t n); +void SaveScriptVariableValueBytes(enum script_var_id id, void *src, uint32_t n); +bool ScriptVariablesEqual(void *local_var_vals, enum script_var_id id1, + enum script_var_id id2); +int CalcScriptVariables(int val0, int val1, + enum script_calc_operation operation); +bool CompareScriptVariables(int val0, int val1, + enum script_compare_operation operation); +int CalcScriptVariablesVeneer(int val0, int val1, + enum script_calc_operation operation); +void CalcAndUpdateScriptVarWithOtherValue(void *local_var_vals, + enum script_var_id id, int other_val, + enum script_calc_operation operation); +void CalcAndUpdateScriptVarWithOtherScriptVar( + void *local_var_vals, enum script_var_id id1, enum script_var_id id2, + enum script_calc_operation operation); +bool CompareScriptVariablesVeneer(int val0, int val1, + enum script_compare_operation operation); +bool LoadAndCompareScriptVarAndValue(void *local_var_vals, + enum script_var_id id, int other_val, enum script_compare_operation operation); -bool LoadAndCompareScriptVars(void* local_var_vals, enum script_var_id id1, enum script_var_id id2, +bool LoadAndCompareScriptVars(void *local_var_vals, enum script_var_id id1, + enum script_var_id id2, enum script_compare_operation operation); void EventFlagResume(void); void EventFlagBackup(void); -int DumpScriptVariableValues(void* dest); -bool RestoreScriptVariableValues(void* src); +int DumpScriptVariableValues(void *dest); +bool RestoreScriptVariableValues(void *src); void InitScenarioScriptVars(void); -void LoadScriptVarValuePair(enum script_var_id id, int* val0, int* val1); +void LoadScriptVarValuePair(enum script_var_id id, int *val0, int *val1); void SetScenarioScriptVar(enum script_var_id id, uint8_t val0, uint8_t val1); bool IsStoryBeforePoint(enum script_var_id id, int chapter, int subsection); bool IsStoryBeforeOrAtPoint(enum script_var_id id, int chapter, int subsection); @@ -939,10 +1048,12 @@ int GetDebugSpecialEpisodeNumber(void); void SetDebugSpecialEpisodeNumber(int special_episode_number); int GetExecuteSpecialEpisodeType(void); bool IsSpecialEpisodeOpen(enum special_episode_type special_episode_type); -void SetSpecialEpisodeOpen(enum special_episode_type special_episode_type, bool episode_open); +void SetSpecialEpisodeOpen(enum special_episode_type special_episode_type, + bool episode_open); bool IsSpecialEpisodeOpenMismatch(void); bool IsSpecialEpisodeOpenOld(enum special_episode_type special_episode_type); -void SetSpecialEpisodeOpenOld(enum special_episode_type special_episode_type, bool episode_open); +void SetSpecialEpisodeOpenOld(enum special_episode_type special_episode_type, + bool episode_open); bool IsSpecialEpisodeBeaten(enum special_episode_type special_episode_type); void SetSpecialEpisodeBeaten(enum special_episode_type special_episode_type, bool special_episode_beaten); @@ -957,7 +1068,7 @@ void SetWorldMapLevel(int32_t world_map_level); void InitDungeonListScriptVars(void); void SetDungeonConquest(enum dungeon_id dungeon_id, int bit_value); enum dungeon_mode GetDungeonMode(enum dungeon_id dungeon_id); -struct global_progress* GlobalProgressAlloc(void); +struct global_progress *GlobalProgressAlloc(void); void ResetGlobalProgress(void); void SetMonsterFlag1(enum monster_id monster_id); bool GetMonsterFlag1(enum monster_id monster_id); @@ -971,25 +1082,28 @@ void IncrementNbAdventures(void); int GetNbAdventures(void); bool CanMonsterSpawn(enum monster_id monster_id); void IncrementExclusiveMonsterCounts(enum monster_id monster_id); -void CopyProgressInfoToStream(struct bitstream* stream); -uint32_t GetProgressInfoForSave(void* dst, uint32_t len); -void CopyProgressInfoFromStream(struct bitstream* stream); -uint32_t ReadProgressInfoFromSave(void* src, uint32_t len); +void CopyProgressInfoToStream(struct bitstream *stream); +uint32_t GetProgressInfoForSave(void *dst, uint32_t len); +void CopyProgressInfoFromStream(struct bitstream *stream); +uint32_t ReadProgressInfoFromSave(void *src, uint32_t len); void InitKaomadoStream(void); -void InitPortraitParams(struct portrait_params* portrait); -void InitPortraitParamsWithMonsterId(struct portrait_params* portrait, enum monster_id monster_id); -void SetPortraitEmotion(struct portrait_params* portrait, enum portrait_emotion emotion); -void SetPortraitLayout(struct portrait_params* portrait, uint8_t layout_idx); -void SetPortraitOffset(struct portrait_params* portrait, struct vec2* offset); -void AllowPortraitDefault(struct portrait_params* portrait, bool allow); -bool IsValidPortrait(struct portrait_params* portrait); -bool LoadPortrait(struct portrait_params* portrait, struct kaomado_buffer* buf); -bool WonderMailPasswordToMission(char* password, struct mission* mission_data); -void MissionToWonderMailPassword(char* password, struct mission* mission_data); +void InitPortraitParams(struct portrait_params *portrait); +void InitPortraitParamsWithMonsterId(struct portrait_params *portrait, + enum monster_id monster_id); +void SetPortraitEmotion(struct portrait_params *portrait, + enum portrait_emotion emotion); +void SetPortraitLayout(struct portrait_params *portrait, uint8_t layout_idx); +void SetPortraitOffset(struct portrait_params *portrait, struct vec2 *offset); +void AllowPortraitDefault(struct portrait_params *portrait, bool allow); +bool IsValidPortrait(struct portrait_params *portrait); +bool LoadPortrait(struct portrait_params *portrait, struct kaomado_buffer *buf); +bool WonderMailPasswordToMission(char *password, struct mission *mission_data); +void MissionToWonderMailPassword(char *password, struct mission *mission_data); void SetEnterDungeon(enum dungeon_id dungeon_id); -void InitDungeonInit(struct dungeon_init* dungeon_init_data, enum dungeon_id dungeon_id); +void InitDungeonInit(struct dungeon_init *dungeon_init_data, + enum dungeon_id dungeon_id); bool IsNoLossPenaltyDungeon(enum dungeon_id dungeon_id); -bool MissionRewardValidateDungeonId(struct dungeon_id_8* dungeon_id); +bool MissionRewardValidateDungeonId(struct dungeon_id_8 *dungeon_id); undefined CheckMissionRestrictions(undefined param_1); bool TilesetSecondaryTerrainIsChasm(int16_t tileset_id); int GetNbFloors(enum dungeon_id dungeon_id); @@ -997,14 +1111,15 @@ int GetNbFloorsPlusOne(enum dungeon_id dungeon_id); enum dungeon_group_id GetDungeonGroup(enum dungeon_id dungeon_id); int GetNbPrecedingFloors(enum dungeon_id dungeon_id); int GetNbFloorsDungeonGroup(enum dungeon_id dungeon_id); -void DungeonFloorToGroupFloor(struct dungeon_group_and_group_floor* out_group_data, - struct dungeon_floor_pair* dungeon_and_floor); -enum mission_rank GetMissionRank(struct dungeon_floor_pair* dungeon_and_floor); -int GetOutlawLevel(struct dungeon_floor_pair* dungeon_and_floor); -int GetOutlawLeaderLevel(struct dungeon_floor_pair* dungeon_and_floor); -int GetOutlawMinionLevel(struct dungeon_floor_pair* dungeon_and_floor); -void AddGuestMonster(struct dungeon_init* dungeon_init_data, int guest_number, - struct guest_monster* guest_monster); +void DungeonFloorToGroupFloor( + struct dungeon_group_and_group_floor *out_group_data, + struct dungeon_floor_pair *dungeon_and_floor); +enum mission_rank GetMissionRank(struct dungeon_floor_pair *dungeon_and_floor); +int GetOutlawLevel(struct dungeon_floor_pair *dungeon_and_floor); +int GetOutlawLeaderLevel(struct dungeon_floor_pair *dungeon_and_floor); +int GetOutlawMinionLevel(struct dungeon_floor_pair *dungeon_and_floor); +void AddGuestMonster(struct dungeon_init *dungeon_init_data, int guest_number, + struct guest_monster *guest_monster); int GetGroundNameId(int param_1); void SetAdventureLogStructLocation(void); void SetAdventureLogDungeonFloor(struct dungeon_floor_pair dungeon_floor); @@ -1041,34 +1156,34 @@ void ComputeSpecialCounters(void); void RecruitSpecialPokemonLog(enum monster_id monster_id); void IncrementNbFainted(void); uint32_t GetNbFainted(void); -void SetItemAcquired(struct item* item); +void SetItemAcquired(struct item *item); uint32_t GetNbItemAcquired(void); void SetChallengeLetterCleared(uint32_t challenge_id); uint32_t GetSentryDutyGamePoints(int32_t rank); int32_t SetSentryDutyGamePoints(uint32_t points); -void CopyLogToStream(struct bitstream* stream); -void CopyLogFromStream(struct bitstream* stream); -void GetAbilityString(undefined* buf, enum ability_id ability_id); +void CopyLogToStream(struct bitstream *stream); +void CopyLogFromStream(struct bitstream *stream); +void GetAbilityString(undefined *buf, enum ability_id ability_id); int GetAbilityDescStringId(enum ability_id ability_id); int GetTypeStringId(enum type_id type_id); enum type_id GetConversion2ConvertToType(enum type_id attack_type_id); -void InitBitstreamForWrite(struct bitstream* stream, void* src, uint32_t len); -void InitBitstreamForRead(struct bitstream* stream, void* dst, uint32_t len); -void BitstreamDebug(struct bitstream* stream); -void CopyBitsToStream(struct bitstream* stream, void* src, int nbits); -void CopyBitsFromStream(struct bitstream* stream, void* dst, int nbits); +void InitBitstreamForWrite(struct bitstream *stream, void *src, uint32_t len); +void InitBitstreamForRead(struct bitstream *stream, void *dst, uint32_t len); +void BitstreamDebug(struct bitstream *stream); +void CopyBitsToStream(struct bitstream *stream, void *src, int nbits); +void CopyBitsFromStream(struct bitstream *stream, void *dst, int nbits); void StoreDefaultTeamData(void); -void GetMainTeamNameWithCheck(char* buf); -void GetMainTeamName(char* buf); -void SetMainTeamName(char* buf); +void GetMainTeamNameWithCheck(char *buf); +void GetMainTeamName(char *buf); +void SetMainTeamName(char *buf); int GetRankupPoints(void); enum rank GetRank(void); int GetRankStorageSize(void); -void ResetPlayTimer(struct play_time* igt); -void PlayTimerTick(struct play_time* igt); -uint32_t GetPlayTimeSeconds(struct play_time* igt); +void ResetPlayTimer(struct play_time *igt); +void PlayTimerTick(struct play_time *igt); +uint32_t GetPlayTimeSeconds(struct play_time *igt); uint32_t SubFixedPoint(uint32_t val_fp, uint32_t dec_fp); -uint32_t BinToDecFixedPoint(ufx32_16* q16); +uint32_t BinToDecFixedPoint(ufx32_16 *q16); int CeilFixedPoint(uint32_t val_fp); void MtInit(int32_t initial_seed); int32_t MtNext(void); @@ -1091,29 +1206,29 @@ bool JoinedAtRangeCheck(struct dungeon_id_8 joined_at); bool IsDojoDungeon(enum dungeon_id dungeon_id); bool IsFutureDungeon(enum dungeon_id dungeon_id); bool IsSpecialEpisodeDungeon(enum dungeon_id dungeon_id); -enum item_id RetrieveFromItemList1(undefined* dungeon_info, undefined4 param_2); -bool IsForbiddenFloor(undefined* dungeon_info, undefined4 param_2, undefined4 param_3, - undefined4 param_4); -void Copy16BitsToStream(struct bitstream* stream, void* src); -void Copy16BitsFromStream(struct bitstream* stream, void* dst); -enum item_id RetrieveFromItemList2(undefined* dungeon_info, undefined4 param_2); +enum item_id RetrieveFromItemList1(undefined *dungeon_info, undefined4 param_2); +bool IsForbiddenFloor(undefined *dungeon_info, undefined4 param_2, + undefined4 param_3, undefined4 param_4); +void Copy16BitsToStream(struct bitstream *stream, void *src); +void Copy16BitsFromStream(struct bitstream *stream, void *dst); +enum item_id RetrieveFromItemList2(undefined *dungeon_info, undefined4 param_2); bool IsInvalidForMission(enum dungeon_id dungeon_id); bool IsExpEnabledInDungeon(enum dungeon_id dungeon_id); bool IsSkyExclusiveDungeon(enum dungeon_id dungeon_id); bool JoinedAtRangeCheck2(struct dungeon_id_8 joined_at); uint32_t GetBagCapacity(int scenario_balance); uint32_t GetBagCapacitySpecialEpisode(int se_type); -struct rankup_table_entry* GetRankUpEntry(int rank); +struct rankup_table_entry *GetRankUpEntry(int rank); int GetBgRegionArea(int offset, int subregion_id, int region_id); void LoadMonsterMd(void); -void GetNameRaw(char* dst, enum monster_id monster_id); -void GetName(char* dst, enum monster_id monster_id, char color_id); -void GetNameWithGender(char* dst, enum monster_id monster_id, char color_id); -void GetSpeciesString(char* dst, enum monster_id monster_id); -char* GetNameString(enum monster_id monster_id); +void GetNameRaw(char *dst, enum monster_id monster_id); +void GetName(char *dst, enum monster_id monster_id, char color_id); +void GetNameWithGender(char *dst, enum monster_id monster_id, char color_id); +void GetSpeciesString(char *dst, enum monster_id monster_id); +char *GetNameString(enum monster_id monster_id); int GetSpriteIndex(enum monster_id monster_id); int GetDexNumber(enum monster_id monster_id); -char* GetCategoryString(enum monster_id monster_id); +char *GetCategoryString(enum monster_id monster_id); enum monster_gender GetMonsterGender(enum monster_id monster_id); int GetBodySize(enum monster_id monster_id); uint8_t GetSpriteSize(enum monster_id monster_id); @@ -1137,37 +1252,42 @@ int GetAbility(enum monster_id monster_id, int ability_idx); int GetRecruitRate2(enum monster_id monster_id); int GetRecruitRate1(enum monster_id monster_id); int GetExp(enum monster_id monster_id, int level); -void GetEvoParameters(undefined* evo_params, enum monster_id monster_id); -void GetTreasureBoxChances(enum monster_id monster_id, undefined* chances); +void GetEvoParameters(undefined *evo_params, enum monster_id monster_id); +void GetTreasureBoxChances(enum monster_id monster_id, undefined *chances); int GetIqGroup(enum monster_id monster_id); int GetSpawnThreshold(enum monster_id monster_id); bool NeedsItemToSpawn(enum monster_id monster_id); int GetExclusiveItem(enum monster_id monster_id, int excl_idx); int GetFamilyIndex(enum monster_id monster_id); void LoadM2nAndN2m(void); -void GuestMonsterToGroundMonster(struct ground_monster* ground_monster, - struct guest_monster* guest_monster); -void SetBaseStatsMovesGroundMonster(struct ground_monster* ground_monster); -bool StrcmpMonsterName(char* string, enum monster_id monster_id); -void InitializeTeamMemberFromMentry(struct team_member* team_member, struct ground_monster* ground_monster, +void GuestMonsterToGroundMonster(struct ground_monster *ground_monster, + struct guest_monster *guest_monster); +void SetBaseStatsMovesGroundMonster(struct ground_monster *ground_monster); +bool StrcmpMonsterName(char *string, enum monster_id monster_id); +void InitializeTeamMemberFromMentry(struct team_member *team_member, + struct ground_monster *ground_monster, int32_t slot_index); -void GetLvlUpEntry(struct level_up_entry* level_up_entry, enum monster_id monster_id, int level); -uint8_t* GetEncodedHalfword(uint8_t* data_ptr, uint16_t* result); -int GetEvoFamily(undefined* monster, undefined* evo_family); -int GetEvolutions(enum monster_id monster_id, enum monster_id* output_list, +void GetLvlUpEntry(struct level_up_entry *level_up_entry, + enum monster_id monster_id, int level); +uint8_t *GetEncodedHalfword(uint8_t *data_ptr, uint16_t *result); +int GetEvoFamily(undefined *monster, undefined *evo_family); +int GetEvolutions(enum monster_id monster_id, enum monster_id *output_list, bool skip_sprite_size_check, bool skip_shedinja_check); -void ShuffleHiddenPower(undefined* dmons_addr); +void ShuffleHiddenPower(undefined *dmons_addr); enum monster_id GetBaseForm(enum monster_id); -enum monster_id GetBaseFormBurmyWormadamShellosGastrodonCherrim(enum monster_id monster_id); +enum monster_id +GetBaseFormBurmyWormadamShellosGastrodonCherrim(enum monster_id monster_id); enum monster_id GetBaseFormCastformCherrimDeoxys(enum monster_id monster_id); int GetAllBaseForms(enum monster_id monster_id); int GetDexNumberVeneer(enum monster_id monster_id); -enum monster_id GetMonsterIdFromSpawnEntry(struct monster_spawn_entry*); -void SetMonsterId(struct monster_spawn_entry* monster_spawn, enum monster_id monster_id); -void SetMonsterLevelAndId(struct monster_spawn_entry* monster_spawn, int level, +enum monster_id GetMonsterIdFromSpawnEntry(struct monster_spawn_entry *); +void SetMonsterId(struct monster_spawn_entry *monster_spawn, + enum monster_id monster_id); +void SetMonsterLevelAndId(struct monster_spawn_entry *monster_spawn, int level, enum monster_id monster_id); -uint8_t GetMonsterLevelFromSpawnEntry(struct monster_spawn_entry* entry); -void ApplyLevelUpBoostsToGroundMonster(struct ground_monster* ground_monster, int level, bool flag); +uint8_t GetMonsterLevelFromSpawnEntry(struct monster_spawn_entry *entry); +void ApplyLevelUpBoostsToGroundMonster(struct ground_monster *ground_monster, + int level, bool flag); enum monster_gender GetMonsterGenderVeneer(enum monster_id monster_id); bool IsMonsterValid(enum monster_id monster_id); bool IsUnown(enum monster_id monster_id); @@ -1181,180 +1301,203 @@ enum monster_id GetBaseFormCastformDeoxysCherrim(enum monster_id monster_id); bool BaseFormsEqual(enum monster_id monster1, enum monster_id monster2); bool DexNumbersEqual(enum monster_id monster1, enum monster_id monster2); bool GendersEqual(enum monster_id monster1, enum monster_id monster2); -bool GendersEqualNotGenderless(enum monster_id monster1, enum monster_id monster2); -bool GendersNotEqualNotGenderless(enum monster_id monster1, enum monster_id monster2); -void RecolorNameString(char* out, char* name, char color_symbol); -void RecolorTeamMemberNameString(char* out, char* name, bool is_leader); -void ModifyHpStat(int16_t* stat_ptr, int32_t amount); -void ModifyOffensiveStat(int8_t* stat_ptr, int32_t amount); -void ModifyDefensiveStat(int8_t* stat_ptr, int32_t amount); -void ModifyIqStat(int16_t* stat_ptr, int32_t amount); +bool GendersEqualNotGenderless(enum monster_id monster1, + enum monster_id monster2); +bool GendersNotEqualNotGenderless(enum monster_id monster1, + enum monster_id monster2); +void RecolorNameString(char *out, char *name, char color_symbol); +void RecolorTeamMemberNameString(char *out, char *name, bool is_leader); +void ModifyHpStat(int16_t *stat_ptr, int32_t amount); +void ModifyOffensiveStat(int8_t *stat_ptr, int32_t amount); +void ModifyDefensiveStat(int8_t *stat_ptr, int32_t amount); +void ModifyIqStat(int16_t *stat_ptr, int32_t amount); bool IsMonsterOnTeam(enum monster_id monster_id, int recruit_strategy); -void GetNbRecruited(undefined* recruit); +void GetNbRecruited(undefined *recruit); bool IsValidTeamMember(int member_idx); bool IsMainCharacter(int member_idx); -struct ground_monster* GetTeamMember(int member_idx); +struct ground_monster *GetTeamMember(int member_idx); int GetRecruitMentryIdBySpecies(enum monster_id monster_id, int num_to_skip); int GetHeroMemberIdx(void); int GetPartnerMemberIdx(void); int GetMainCharacter1MemberIdx(void); int GetMainCharacter2MemberIdx(void); int GetMainCharacter3MemberIdx(void); -struct ground_monster* GetHero(void); -struct ground_monster* GetPartner(void); -struct ground_monster* GetMainCharacter1(void); -struct ground_monster* GetMainCharacter2(void); -struct ground_monster* GetMainCharacter3(void); +struct ground_monster *GetHero(void); +struct ground_monster *GetPartner(void); +struct ground_monster *GetMainCharacter1(void); +struct ground_monster *GetMainCharacter2(void); +struct ground_monster *GetMainCharacter3(void); int GetFirstMatchingMemberIdx(enum monster_id monster_id); int GetFirstEmptyMemberIdx(int param_1); -bool IsMonsterNotNicknamed(struct ground_monster* monster); -void GetRecoloredGroundMonsterName(char* out, struct ground_monster* monster, char color_symbol); +bool IsMonsterNotNicknamed(struct ground_monster *monster); +void GetRecoloredGroundMonsterName(char *out, struct ground_monster *monster, + char color_symbol); void RemoveActiveMembersFromAllTeams(void); void RemoveActiveMembersFromSpecialEpisodeTeam(void); void RemoveActiveMembersFromRescueTeam(void); bool CheckTeamMemberIdx(int member_idx); bool IsMonsterIdInNormalRange(enum monster_id monster_id); void SetActiveTeam(enum team_id team_id); -struct team_member* GetActiveTeamMember(int roster_idx); +struct team_member *GetActiveTeamMember(int roster_idx); int GetActiveRosterIndex(int member_idx); int TryAddMonsterToActiveTeam(int member_idx); int GetAppointedLeaderMemberIdx(void); void RemoveActiveMembersFromMainTeam(void); void SetTeamSetupHeroAndPartnerOnly(void); void SetTeamSetupHeroOnly(void); -int GetPartyMembers(uint16_t* party_members); -int GetAdventureNpcIds(struct monster_id_16* monster_id_table); -int GetUnitNpcIds(struct monster_id_16* monster_id_table); +int GetPartyMembers(uint16_t *party_members); +int GetAdventureNpcIds(struct monster_id_16 *monster_id_table); +int GetUnitNpcIds(struct monster_id_16 *monster_id_table); void RefillTeam(void); -void ValidateTeamMembers(bool* valid_member_table); +void ValidateTeamMembers(bool *valid_member_table); int ClearItem(int team_id, bool check); -void GetRecoloredNameOfTeamMemberAtIdx(char* out, int roster_idx); -void GetNameOfTeamMemberAtIdx(char* out, int roster_idx); -void GetRecoloredTeamMemberName(char* out, struct team_member* team_member); +void GetRecoloredNameOfTeamMemberAtIdx(char *out, int roster_idx); +void GetNameOfTeamMemberAtIdx(char *out, int roster_idx); +void GetRecoloredTeamMemberName(char *out, struct team_member *team_member); void ChangeGiratinaFormIfSkyDungeon(enum dungeon_id dungeon_id); void RevertGiratinaAndShaymin(uint8_t member_idx, undefined param_2); -void* OamTileNumberToVramAddress(uint16_t oam_tile_num, uint8_t screen); +void *OamTileNumberToVramAddress(uint16_t oam_tile_num, uint8_t screen); int GetIqSkillStringId(enum iq_skill_id iq_skill); bool DoesTacticFollowLeader(enum tactic_id tactic_id); -void GetUnlockedTactics(enum tactic_id* unlocked_tactics, int level); -void GetUnlockedTacticFlags(bool* tactic_unlock_flags, int level); +void GetUnlockedTactics(enum tactic_id *unlocked_tactics, int level); +void GetUnlockedTacticFlags(bool *tactic_unlock_flags, int level); bool CanLearnIqSkill(int iq_amount, enum iq_skill_id iq_id); -int GetLearnableIqSkills(struct iq_skill_id_8* out_iq_skill_id, enum monster_id monster_id, - int monster_iq); -void DisableIqSkill(uint32_t* iq_skills_flags, enum iq_skill_id iq_id); -void EnableIqSkill(uint32_t* iq_skills_flags, enum iq_skill_id iq_id); +int GetLearnableIqSkills(struct iq_skill_id_8 *out_iq_skill_id, + enum monster_id monster_id, int monster_iq); +void DisableIqSkill(uint32_t *iq_skills_flags, enum iq_skill_id iq_id); +void EnableIqSkill(uint32_t *iq_skills_flags, enum iq_skill_id iq_id); enum iq_skill_id GetSpeciesIqSkill(enum monster_id monster_id, int index); -void DisableAllIqSkills(uint32_t* iq_skills_flags); -void EnableAllLearnableIqSkills(uint32_t* iq_skills_flags, enum monster_id monster_id, - int monster_iq); -bool IqSkillFlagTest(uint32_t* iq_skill_flags, enum iq_skill_id iq_id); +void DisableAllIqSkills(uint32_t *iq_skills_flags); +void EnableAllLearnableIqSkills(uint32_t *iq_skills_flags, + enum monster_id monster_id, int monster_iq); +bool IqSkillFlagTest(uint32_t *iq_skill_flags, enum iq_skill_id iq_id); enum iq_skill_id GetNextIqSkill(enum monster_id monster_id, int monster_iq); bool ExplorerMazeMonsterExists(void); -void GetExplorerMazeTeamName(char* buffer); -struct ground_monster* GetExplorerMazeMonster(uint8_t entry_number); -uint32_t GetMonsterInfoForSave(void* dst, uint32_t len); -uint32_t ReadMonsterInfoFromSave(void* src, uint32_t len); -void CopyMonsterToStream(struct bitstream* stream, struct ground_monster* monster); -void CopyMonsterFromStream(struct bitstream* stream, struct ground_monster* monster); -void GetEvolutionPossibilities(struct ground_monster* monster, undefined* evo); -int GetMonsterEvoStatus(struct ground_monster* monster); -bool HandleShedinjaEvolution(int16_t* member_idx, enum monster_id monster_id); -void CopyTacticString(char* buffer, enum tactic_id tactic_id); -void GetStatBoostsForMonsterSummary(struct monster_summary* monster_summary, - enum monster_id monster_id, struct item* item, int iq, +void GetExplorerMazeTeamName(char *buffer); +struct ground_monster *GetExplorerMazeMonster(uint8_t entry_number); +uint32_t GetMonsterInfoForSave(void *dst, uint32_t len); +uint32_t ReadMonsterInfoFromSave(void *src, uint32_t len); +void CopyMonsterToStream(struct bitstream *stream, + struct ground_monster *monster); +void CopyMonsterFromStream(struct bitstream *stream, + struct ground_monster *monster); +void GetEvolutionPossibilities(struct ground_monster *monster, undefined *evo); +int GetMonsterEvoStatus(struct ground_monster *monster); +bool HandleShedinjaEvolution(int16_t *member_idx, enum monster_id monster_id); +void CopyTacticString(char *buffer, enum tactic_id tactic_id); +void GetStatBoostsForMonsterSummary(struct monster_summary *monster_summary, + enum monster_id monster_id, + struct item *item, int iq, bool klutz_active); -void CreateMonsterSummaryFromTeamMember(struct monster_summary* monster_summary, - struct team_member* team_member, bool is_leader); +void CreateMonsterSummaryFromTeamMember(struct monster_summary *monster_summary, + struct team_member *team_member, + bool is_leader); int GetSosMailCount(int param_1, bool param_2); -bool IsMissionSuspendedAndValid(struct mission* mission); -bool AreMissionsEquivalent(struct mission* mission1, struct mission* mission2); -bool IsMissionValid(struct mission* mission); -bool CheckMonsterForMissionType(enum mission_type type, union mission_subtype* subtype, +bool IsMissionSuspendedAndValid(struct mission *mission); +bool AreMissionsEquivalent(struct mission *mission1, struct mission *mission2); +bool IsMissionValid(struct mission *mission); +bool CheckMonsterForMissionType(enum mission_type type, + union mission_subtype *subtype, enum monster_id target, bool allow_no_monster); -bool CheckItemForMissionType(enum mission_type type, union mission_subtype* subtype, - enum item_id item); -enum mission_generation_result GenerateMission(undefined* param_1, struct mission* mission_data); -int CountAndPopulateValidMissionTableMonsters(enum monster_id* monster_table, undefined4* range); -bool IsMissionTypeSpecialEpisode(struct mission* mission); -bool DoesMissionHaveTypeAndSubtype(struct mission* mission, struct mission_type_8* type, - union mission_subtype* subtype); -bool AlreadyHasSimilarMission(struct mission_type_8* type, union mission_subtype* subtype); +bool CheckItemForMissionType(enum mission_type type, + union mission_subtype *subtype, enum item_id item); +enum mission_generation_result GenerateMission(undefined *param_1, + struct mission *mission_data); +int CountAndPopulateValidMissionTableMonsters(enum monster_id *monster_table, + undefined4 *range); +bool IsMissionTypeSpecialEpisode(struct mission *mission); +bool DoesMissionHaveTypeAndSubtype(struct mission *mission, + struct mission_type_8 *type, + union mission_subtype *subtype); +bool AlreadyHasSimilarMission(struct mission_type_8 *type, + union mission_subtype *subtype); void GenerateDailyMissions(void); -bool AlreadyHaveMission(struct mission* mission); +bool AlreadyHaveMission(struct mission *mission); int CountJobListMissions(void); int DungeonRequestsDone(uint8_t param_1, bool param_2); int DungeonRequestsDoneWrapper(uint8_t param_1); bool AnyDungeonRequestsDone(uint8_t param_1); -bool AddMissionToJobList(struct mission* mission); -struct mission* GetAcceptedMission(uint8_t mission_id); +bool AddMissionToJobList(struct mission *mission); +struct mission *GetAcceptedMission(uint8_t mission_id); bool IsAcceptedMissionSlotEmpty(int32_t mission_slot); -bool WasMissionCompletedToday(struct mission_result_and_client* result_and_client, - struct mission* mission, enum mission_type type); +bool WasMissionCompletedToday( + struct mission_result_and_client *result_and_client, + struct mission *mission, enum mission_type type); int GetMissionByTypeAndDungeon(int start_index, enum mission_type mission_type, - undefined* subtype_struct, enum dungeon_id dungeon_id); -bool CheckAcceptedMissionByTypeAndDungeon(enum mission_type mission_type, undefined* subtype_struct, + undefined *subtype_struct, + enum dungeon_id dungeon_id); +bool CheckAcceptedMissionByTypeAndDungeon(enum mission_type mission_type, + undefined *subtype_struct, enum dungeon_id dungeon_id); -int GetAllPossibleMonsters(void* buf); +int GetAllPossibleMonsters(void *buf); int GenerateAllPossibleMonstersList(void); void DeleteAllPossibleMonstersList(void); int GenerateAllPossibleDungeonsList(void); void DeleteAllPossibleDungeonsList(void); int GenerateAllPossibleDeliverList(void); void DeleteAllPossibleDeliverList(void); -void ClearMissionData(struct mission* mission); +void ClearMissionData(struct mission *mission); enum fixed_room_id GetMissionSpecificFixedRoom(enum mission_type type, union mission_subtype subtype); -int8_t SelectRandomFixedRoomInRange(struct fixed_room_id_8* fixed_rooms, int max); +int8_t SelectRandomFixedRoomInRange(struct fixed_room_id_8 *fixed_rooms, + int max); void ReadRescueBinFile(void); -void GenerateMissionDetailsStruct(struct mission* mission, struct mission_details* details, +void GenerateMissionDetailsStruct(struct mission *mission, + struct mission_details *details, undefined param_3, undefined param_4); -bool ValidateNormalChallengeMission(struct mission_template* valid_mission_info, - struct mission* mission); -bool ValidateLegendaryChallengeMission(struct mission_template* valid_mission_info, - struct mission* mission); -struct mission_template* MatchMissionTemplateToMission(undefined4 table_index, - struct mission* mission); -void AppendMissionTitle(char* main_buffer, char* temp_buffer, struct preprocessor_args* args, - struct mission_details* details); -void FormatMissionHeader(char* buffer, struct mission_details* mission_details); -void FormatSpecialEpisodeMissionHeader(char* buffer); -void AppendMissionSummary(char* main_buffer, char* temp_buffer, int window_id, int y_offset, - struct preprocessor_args* args, struct mission_details* details); -void MakeMissionDetails(struct mission_details* mission_details, char* buffer, undefined param_3); -void MakeSpecialEpisodeMissionDetails(char* buffer, undefined param_2); -undefined PrintWonderMailSkyCode(undefined param_1, undefined param_2, undefined param_3, - undefined param_4); -void AppendMissionObjective(char* buffer, int buffer_size, undefined4 objective, +bool ValidateNormalChallengeMission(struct mission_template *valid_mission_info, + struct mission *mission); +bool ValidateLegendaryChallengeMission( + struct mission_template *valid_mission_info, struct mission *mission); +struct mission_template *MatchMissionTemplateToMission(undefined4 table_index, + struct mission *mission); +void AppendMissionTitle(char *main_buffer, char *temp_buffer, + struct preprocessor_args *args, + struct mission_details *details); +void FormatMissionHeader(char *buffer, struct mission_details *mission_details); +void FormatSpecialEpisodeMissionHeader(char *buffer); +void AppendMissionSummary(char *main_buffer, char *temp_buffer, int window_id, + int y_offset, struct preprocessor_args *args, + struct mission_details *details); +void MakeMissionDetails(struct mission_details *mission_details, char *buffer, + undefined param_3); +void MakeSpecialEpisodeMissionDetails(char *buffer, undefined param_2); +undefined PrintWonderMailSkyCode(undefined param_1, undefined param_2, + undefined param_3, undefined param_4); +void AppendMissionObjective(char *buffer, int buffer_size, undefined4 objective, enum monster_id monster, struct item_id_16 item); -void AppendMissionDungeonLocation(struct mission_details* mission_details, char* buffer, - int buffer_size); +void AppendMissionDungeonLocation(struct mission_details *mission_details, + char *buffer, int buffer_size); uint32_t RandomizeMissionCategory(uint32_t mission_wght_sum, undefined param_2, - struct mission_weighted_category* category); + struct mission_weighted_category *category); bool SumValidMissionCategoryWeights(enum mission_vendor vendor); -struct mission_template* GetRandomMissionTemplate(void); -struct mission_template* LoadMissionTemplates(void); +struct mission_template *GetRandomMissionTemplate(void); +struct mission_template *LoadMissionTemplates(void); bool IsMonsterMissionAllowed(enum monster_id monster_id); bool CanMonsterBeUsedForMissionWrapper(enum monster_id monster_id); -bool CanMonsterBeUsedForMission(enum monster_id monster_id, bool check_story_banned); +bool CanMonsterBeUsedForMission(enum monster_id monster_id, + bool check_story_banned); bool IsMonsterMissionAllowedStory(enum monster_id monster_id); bool IsMonsterIllegalForMissions(enum monster_id monster_id); bool CanDungeonBeUsedForMission(enum dungeon_id dungeon_id); -enum mission_rank GetMissionRankWithCapAndModifiers(struct dungeon_floor_pair* dungeon_floor_pair, - enum mission_type type); enum mission_rank -GetMissionRankWithCapAndModifiersAndCap(struct dungeon_floor_pair* dungeon_floor_pair, - enum mission_type type); +GetMissionRankWithCapAndModifiers(struct dungeon_floor_pair *dungeon_floor_pair, + enum mission_type type); +enum mission_rank GetMissionRankWithCapAndModifiersAndCap( + struct dungeon_floor_pair *dungeon_floor_pair, enum mission_type type); bool CanSendItem(enum item_id item_id, bool to_sky); -void InitMissionReward(struct mission* mission, struct mission_reward_data* reward_data, +void InitMissionReward(struct mission *mission, + struct mission_reward_data *reward_data, undefined4 param_3, undefined4 param_4); -void RollRandomItemReward(undefined4 param_1, undefined4 param_2, struct item_id_16* item_id); -void GenerateMissionRewards(struct mission* mission, bool is_cafe_mission); +void RollRandomItemReward(undefined4 param_1, undefined4 param_2, + struct item_id_16 *item_id); +void GenerateMissionRewards(struct mission *mission, bool is_cafe_mission); int CheckDungeonMissionUnlockConditions(enum dungeon_id dungeon); bool IsAvailableItem(enum item_id item_id); -int GetAvailableItemDeliveryList(undefined* item_buffer); -void WriteMissionMtState(int32_t* state_ptr); +int GetAvailableItemDeliveryList(undefined *item_buffer); +void WriteMissionMtState(int32_t *state_ptr); int16_t ReadMissionMtStateLower(void); -void ZeroInitMissionRewardDataStruct(struct mission_reward_data* reward_data); +void ZeroInitMissionRewardDataStruct(struct mission_reward_data *reward_data); enum monster_id GetScriptEntityMonsterId(enum script_entity_id entity_id); int GetScriptEntityMatchingStorageId(enum script_entity_id entity_id); void SetActorTalkMainAndActorTalkSub(enum script_entity_id actor_id_main, @@ -1362,16 +1505,19 @@ void SetActorTalkMainAndActorTalkSub(enum script_entity_id actor_id_main, void SetActorTalkMain(enum script_entity_id actor_id); void SetActorTalkSub(enum script_entity_id actor_id); void SetActorEventMain(enum script_entity_id actor_id); -void SetRandomRequestNpcs1And2(enum script_entity_id actor_id_1, enum script_entity_id actor_id_2); +void SetRandomRequestNpcs1And2(enum script_entity_id actor_id_1, + enum script_entity_id actor_id_2); void SetRandomRequestNpc03KindVar(enum monster_id id); -void SetAllEventNpcs(enum script_entity_id actor_id_1, enum script_entity_id actor_id_2, - enum script_entity_id actor_id_3, enum script_entity_id actor_id_4); +void SetAllEventNpcs(enum script_entity_id actor_id_1, + enum script_entity_id actor_id_2, + enum script_entity_id actor_id_3, + enum script_entity_id actor_id_4); void SetNewFriendActor(enum script_entity_id actor_id); void RandomizeDemoActors(void); -void ItemAtTableIdx(int idx, struct bulk_item* item); +void ItemAtTableIdx(int idx, struct bulk_item *item); void MainLoop(void); -char* ChooseMissionTitle(char* main_buffer, int param_2, uint32_t* param_3); -void CreateJobSummary(struct mission* mission, int param_2); +char *ChooseMissionTitle(char *main_buffer, int param_2, uint32_t *param_3); +void CreateJobSummary(struct mission *mission, int param_2); int DungeonSwapIdToIdx(enum dungeon_id dungeon_id); enum dungeon_id DungeonSwapIdxToId(int idx); enum dungeon_mode GetDungeonModeSpecial(enum dungeon_id dungeon_id); From e3afc7198c2c4c408de23a179a75be6669b67295 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Thu, 18 Jun 2026 22:45:58 -0400 Subject: [PATCH 091/117] Update overlay29.h --- headers/functions/overlay29.h | 1706 ++++++++++++++++----------------- 1 file changed, 853 insertions(+), 853 deletions(-) diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index 2916f7a3..caa792f2 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -4,13 +4,13 @@ #include "overlay29/move_effects.h" void InitDungeonPaletteStruct(void); -struct rgba* GetWeatherColorTable(enum weather_id); -struct dungeon* DungeonAlloc(void); -struct dungeon* GetDungeonPtrMaster(void); +struct rgba *GetWeatherColorTable(enum weather_id); +struct dungeon *DungeonAlloc(void); +struct dungeon *GetDungeonPtrMaster(void); void DungeonZInit(void); void DungeonFree(void); -int RunDungeon(struct dungeon_init* dungeon_init_data, struct dungeon* dungeon); -bool EntityIsValid(struct entity* entity); +int RunDungeon(struct dungeon_init *dungeon_init_data, struct dungeon *dungeon); +bool EntityIsValid(struct entity *entity); bool FloorSecondaryTerrainIsChasm(int16_t tileset_id); enum floor_type GetFloorType(void); bool TryForcedLoss(bool skip_floor_end_check); @@ -21,81 +21,91 @@ bool FixedRoomIsSubstituteRoom(void); bool StoryRestrictionsEnabled(void); int GetScenarioBalanceVeneer(void); void FadeToBlack(void); -void SetDungeonEscapeFields(uint32_t successful_exit_tracker, bool end_floor_no_death_check_flag); +void SetDungeonEscapeFields(uint32_t successful_exit_tracker, + bool end_floor_no_death_check_flag); uint32_t GetSuccessfulExitTracker(void); void GetAndStoreButtonInput(void); bool CheckTouchscreenArea(int x1, int y1, int x2, int y2); -void* OamTileNumberToVramAddressOv29(short oam_tile_num, uint8_t screen); +void *OamTileNumberToVramAddressOv29(short oam_tile_num, uint8_t screen); void ResetDungeonColorPalette(void); -struct trap* GetTrapInfo(struct entity* trap_entity); -struct item* GetItemInfo(struct entity* item_entity); -struct tile* GetTileAtEntity(struct entity* entity); -void UpdateEntityPixelPos(struct entity* entity, struct pixel_position* pixel_pos); -void SetEntityPixelPosXY(struct entity* entity, uint32_t x, uint32_t y); -void IncrementEntityPixelPosXY(struct entity* entity, uint32_t x, uint32_t y); -struct entity* CreateEnemyEntity(enum monster_id monster_id); -struct entity* SpawnTrap(enum trap_id trap_id, struct position* position, uint8_t team, - uint8_t flags); -struct entity* SpawnItemEntity(struct position* position); -bool ShouldMinimapDisplayEntity(struct entity* entity); -bool ShouldDisplayEntity(struct entity* entity, undefined param_2); -bool ShouldDisplayEntityWrapper(struct entity* entity); -bool CanSeeTarget(struct entity* user, struct entity* target); -bool CanTargetEntity(struct entity* user, struct entity* target); -bool IsValidTargetEntity(struct entity* user, struct entity* target); -bool CanSeePosition(struct entity* monster, struct position* position); -bool CanTargetPosition(struct entity* monster, struct position* position); +struct trap *GetTrapInfo(struct entity *trap_entity); +struct item *GetItemInfo(struct entity *item_entity); +struct tile *GetTileAtEntity(struct entity *entity); +void UpdateEntityPixelPos(struct entity *entity, + struct pixel_position *pixel_pos); +void SetEntityPixelPosXY(struct entity *entity, uint32_t x, uint32_t y); +void IncrementEntityPixelPosXY(struct entity *entity, uint32_t x, uint32_t y); +struct entity *CreateEnemyEntity(enum monster_id monster_id); +struct entity *SpawnTrap(enum trap_id trap_id, struct position *position, + uint8_t team, uint8_t flags); +struct entity *SpawnItemEntity(struct position *position); +bool ShouldMinimapDisplayEntity(struct entity *entity); +bool ShouldDisplayEntity(struct entity *entity, undefined param_2); +bool ShouldDisplayEntityWrapper(struct entity *entity); +bool CanSeeTarget(struct entity *user, struct entity *target); +bool CanTargetEntity(struct entity *user, struct entity *target); +bool IsValidTargetEntity(struct entity *user, struct entity *target); +bool CanSeePosition(struct entity *monster, struct position *position); +bool CanTargetPosition(struct entity *monster, struct position *position); void PopulateActiveMonsterPtrs(void); -int GetTeamMemberIndex(struct entity* monster); -void GetMonsterOrTrapName(char* buffer, struct entity* entity); -void SubstitutePlaceholderStringTags(int string_id, struct entity* entity, undefined4 param_3); +int GetTeamMemberIndex(struct entity *monster); +void GetMonsterOrTrapName(char *buffer, struct entity *entity); +void SubstitutePlaceholderStringTags(int string_id, struct entity *entity, + undefined4 param_3); bool UpdateMapSurveyorFlag(void); -void PointCameraToMonster(struct entity* entity, bool update_trap_vis_and_map); +void PointCameraToMonster(struct entity *entity, bool update_trap_vis_and_map); void UpdateCamera(undefined param_1); -bool ItemIsActive(struct entity* entity, enum item_id item_id); +bool ItemIsActive(struct entity *entity, enum item_id item_id); int GetVisibilityRange(void); -void RevealWholeFloor(struct entity* entity); -int PlayEffectAnimationEntity(struct entity* entity, int effect_id, bool play_now, int param_4, - int param_5, undefined param_6, enum direction_id effect_dir, - undefined2* param_8); -int PlayEffectAnimationPos(struct position* pos, int effect_id, bool play_now); -int PlayEffectAnimationPixelPos(struct pixel_position* pixel_pos, int effect_id, bool play_now); +void RevealWholeFloor(struct entity *entity); +int PlayEffectAnimationEntity(struct entity *entity, int effect_id, + bool play_now, int param_4, int param_5, + undefined param_6, enum direction_id effect_dir, + undefined2 *param_8); +int PlayEffectAnimationPos(struct position *pos, int effect_id, bool play_now); +int PlayEffectAnimationPixelPos(struct pixel_position *pixel_pos, int effect_id, + bool play_now); void AnimationDelayOrSomething(undefined param_1); -void UpdateStatusIconFlags(struct entity* entity); -void PlayQuestionMarkEffect(struct entity* entity); -void PlayExclamationPointEffect(struct entity* entity); -void PlayEffectAnimation0x171Full(struct entity* entity); -void PlayEffectAnimation0x171(struct entity* entity); -void PlayParalysisEffect(struct entity* entity); -void PlayEffectAnimationEntityStandard(struct entity* entity, int effect_id); -void PlaySpeedUpEffect(struct entity* entity); -void PlaySpeedDownEffect(struct entity* entity); -void DisplayStockpileNumbers(struct entity* entity); -void PlayInvisifySeIfShouldDisplayEntity(struct entity* entity); -void ShowPpRestoreEffect(struct entity* entity); -void PlayOffensiveStatDownEffect(struct entity* entity, int stat_index); -void PlayDefensiveStatDownEffect(struct entity* entity, int stat_index); -void PlayOffensiveStatUpEffect(struct entity* entity, int stat_index); -void PlayDefensiveStatUpEffect(struct entity* entity, int stat_index); -void PlayOffensiveStatMultiplierUpEffect(struct entity* entity, int stat_index); -void PlayOffensiveStatMultiplierDownEffect(struct entity* entity, int stat_index); -void PlayDefensiveStatMultiplierUpEffect(struct entity* entity, int stat_index); -void PlayDefensiveStatMultiplierDownEffect(struct entity* entity, int stat_index); -void PlayHitChanceUpEffect(struct entity* entity, int stat_index); -void PlayHitChanceDownEffect(struct entity* entity, int stat_index); -void PlaySeByIdIfShouldDisplayEntity(struct entity* entity, int se_id); -bool ShouldDisplayEntityAdvanced(struct entity* entity); -void PlayEffectAnimation0x1A9(struct entity* entity); -void PlayEffectAnimation0x29(struct entity* entity); -void PlayEffectAnimation0x18E(struct entity* entity); -void LoadMappaFileAttributes(int quick_saved, bool disable_monsters, undefined* special_process); +void UpdateStatusIconFlags(struct entity *entity); +void PlayQuestionMarkEffect(struct entity *entity); +void PlayExclamationPointEffect(struct entity *entity); +void PlayEffectAnimation0x171Full(struct entity *entity); +void PlayEffectAnimation0x171(struct entity *entity); +void PlayParalysisEffect(struct entity *entity); +void PlayEffectAnimationEntityStandard(struct entity *entity, int effect_id); +void PlaySpeedUpEffect(struct entity *entity); +void PlaySpeedDownEffect(struct entity *entity); +void DisplayStockpileNumbers(struct entity *entity); +void PlayInvisifySeIfShouldDisplayEntity(struct entity *entity); +void ShowPpRestoreEffect(struct entity *entity); +void PlayOffensiveStatDownEffect(struct entity *entity, int stat_index); +void PlayDefensiveStatDownEffect(struct entity *entity, int stat_index); +void PlayOffensiveStatUpEffect(struct entity *entity, int stat_index); +void PlayDefensiveStatUpEffect(struct entity *entity, int stat_index); +void PlayOffensiveStatMultiplierUpEffect(struct entity *entity, int stat_index); +void PlayOffensiveStatMultiplierDownEffect(struct entity *entity, + int stat_index); +void PlayDefensiveStatMultiplierUpEffect(struct entity *entity, int stat_index); +void PlayDefensiveStatMultiplierDownEffect(struct entity *entity, + int stat_index); +void PlayHitChanceUpEffect(struct entity *entity, int stat_index); +void PlayHitChanceDownEffect(struct entity *entity, int stat_index); +void PlaySeByIdIfShouldDisplayEntity(struct entity *entity, int se_id); +bool ShouldDisplayEntityAdvanced(struct entity *entity); +void PlayEffectAnimation0x1A9(struct entity *entity); +void PlayEffectAnimation0x29(struct entity *entity); +void PlayEffectAnimation0x18E(struct entity *entity); +void LoadMappaFileAttributes(int quick_saved, bool disable_monsters, + undefined *special_process); enum trap_id GetRandomSpawnTrapId(void); enum trap_id GetRandomTrapId(void); enum item_id GetItemIdToSpawn(enum item_list_type item_list); enum item_id GetRandomBazaarItem(void); enum item_id GetRandomSecretRoomItem(void); -int CopySpawnEntriesMaster(struct monster_spawn_entry* spawn_entries, int offset); -int MonsterSpawnListPartialCopy(struct monster_spawn_entry* buffer, int current_buffer_entries); +int CopySpawnEntriesMaster(struct monster_spawn_entry *spawn_entries, + int offset); +int MonsterSpawnListPartialCopy(struct monster_spawn_entry *buffer, + int current_buffer_entries); void CopySpawnEntriesOnce(void); bool IsOnMonsterSpawnList(enum monster_id monster_id); enum monster_id GetMonsterIdToSpawn(int spawn_weight); @@ -105,35 +115,43 @@ void FreeTopScreenStatus(void); int InitializeTeamStats(void); int UpdateTeamStatsWrapper(void); int FreeTeamStatsWrapper(void); -void DisplayTeamStatsSprite(struct entity* team_member, undefined4 param_2, undefined4 param_3); -void AssignTopScreenHandlers(void** funcs, top_screen_status_fn_t init_func, - top_screen_status_fn_t update_func, void* param_4, +void DisplayTeamStatsSprite(struct entity *team_member, undefined4 param_2, + undefined4 param_3); +void AssignTopScreenHandlers(void **funcs, top_screen_status_fn_t init_func, + top_screen_status_fn_t update_func, void *param_4, top_screen_status_fn_t free_func); void HandleTopScreenFades(void); int FreeTopScreen(void); void DungeonChangeTopScreenType(int top_screen_type); -enum direction_id GetDirectionTowardsPosition(struct position* origin, struct position* target); -int GetChebyshevDistance(struct position* position_a, struct position* position_b); -bool IsPositionActuallyInSight(struct position* origin, struct position* target, +enum direction_id GetDirectionTowardsPosition(struct position *origin, + struct position *target); +int GetChebyshevDistance(struct position *position_a, + struct position *position_b); +bool IsPositionActuallyInSight(struct position *origin, struct position *target, bool user_has_dropeye); -bool IsPositionInSight(struct position* origin, struct position* target, bool user_has_dropeye); -bool IsPositionWithinTwoTiles(struct position* origin, struct position* target); -struct entity* GetLeader(void); -struct monster* GetLeaderMonster(void); -bool GetRandomTile(struct position* pos_out, bool exclude_key_doors); -bool FindNearbyUnoccupiedTile(struct position* pos_out, struct position* origin, - struct position* search_list, int search_list_len, bool random_room); -bool FindClosestUnoccupiedTileWithin2(struct position* pos_out, struct position* origin, +bool IsPositionInSight(struct position *origin, struct position *target, + bool user_has_dropeye); +bool IsPositionWithinTwoTiles(struct position *origin, struct position *target); +struct entity *GetLeader(void); +struct monster *GetLeaderMonster(void); +bool GetRandomTile(struct position *pos_out, bool exclude_key_doors); +bool FindNearbyUnoccupiedTile(struct position *pos_out, struct position *origin, + struct position *search_list, int search_list_len, + bool random_room); +bool FindClosestUnoccupiedTileWithin2(struct position *pos_out, + struct position *origin, bool random_room); -bool FindFarthestUnoccupiedTileWithin2(struct position* pos_out, struct position* origin, +bool FindFarthestUnoccupiedTileWithin2(struct position *pos_out, + struct position *origin, bool random_room); -bool FindUnoccupiedTileWithin3(struct position* pos_out, struct position* origin, bool random_room); -uint8_t TickStatusTurnCounter(uint8_t* counter); +bool FindUnoccupiedTileWithin3(struct position *pos_out, + struct position *origin, bool random_room); +uint8_t TickStatusTurnCounter(uint8_t *counter); void AdvanceFrame(undefined param_1); void UnkMapRelatedFunc(int switch_case, undefined4 param_2); void AnimateWaterShadows(void); -void DisplayAnimatedNumbers(int amount, struct entity* entity, bool display_sign, - enum number_color number_color); +void DisplayAnimatedNumbers(int amount, struct entity *entity, + bool display_sign, enum number_color number_color); void SetDungeonRngPreseed23Bit(uint32_t preseed23); uint32_t GenerateDungeonRngSeed(void); uint32_t GetDungeonRngPreseed(void); @@ -143,7 +161,8 @@ uint32_t DungeonRand16Bit(void); uint32_t DungeonRandInt(uint32_t n); int DungeonRandRange(int x, int y); bool DungeonRandOutcome(int percentage); -int CalcStatusDuration(struct entity* entity, int16_t* turn_range, bool iq_skill_effects); +int CalcStatusDuration(struct entity *entity, int16_t *turn_range, + bool iq_skill_effects); void DungeonRngUnsetSecondary(void); void DungeonRngSetSecondary(int i); void DungeonRngSetPrimary(void); @@ -152,102 +171,121 @@ void PlayMeByIdIfNot998(int me_id); enum music_id MusicTableIdxToMusicId(int music_table_idx); void ChangeDungeonMusic(enum music_id music_id); void SetUnkMusicFlag(uint8_t param_1); -void TrySwitchPlace(struct entity* user, struct entity* target); +void TrySwitchPlace(struct entity *user, struct entity *target); void ResetLeaderActionFields(bool clear_additional_fields); void SetLeaderActionFields(enum action action_id); -void ClearMonsterActionFields(struct action_data* monster_action); -void SetMonsterActionFields(struct action_data* monster_action, enum action action_id); -void SetActionPassTurnOrWalk(struct action_data* monster_action, enum monster_id monster_id); -struct item* GetItemToUseByIndex(struct entity* entity, union item_index item_index); -struct item* GetItemToUse(struct entity* entity, int param_index, undefined param_3); +void ClearMonsterActionFields(struct action_data *monster_action); +void SetMonsterActionFields(struct action_data *monster_action, + enum action action_id); +void SetActionPassTurnOrWalk(struct action_data *monster_action, + enum monster_id monster_id); +struct item *GetItemToUseByIndex(struct entity *entity, + union item_index item_index); +struct item *GetItemToUse(struct entity *entity, int param_index, + undefined param_3); enum action GetItemAction(enum item_id item_id); -void RemoveUsedItem(struct entity* entity, int param_index); +void RemoveUsedItem(struct entity *entity, int param_index); void ConvertTmToUsedTm(void); void AddDungeonSubMenuOption(int action_id, bool enabled); void DisableDungeonSubMenuOption(int action_id); -void SetActionRegularAttack(struct action_data* monster_action, enum direction_id direction); -void SetActionStruggle(struct action_data* monster_action, enum direction_id direction); -void SetActionUseMovePlayer(struct action_data* monster_action, uint8_t entity_index, - uint8_t move_index); -void SetActionUseMoveAi(struct action_data* monster_action, uint8_t move_index, +void SetActionRegularAttack(struct action_data *monster_action, + enum direction_id direction); +void SetActionStruggle(struct action_data *monster_action, + enum direction_id direction); +void SetActionUseMovePlayer(struct action_data *monster_action, + uint8_t entity_index, uint8_t move_index); +void SetActionUseMoveAi(struct action_data *monster_action, uint8_t move_index, enum direction_id direction); void RunFractionalTurn(bool is_first_loop); bool RunLeaderTurn(undefined param_1); void TrySpawnMonsterAndActivatePlusMinus(void); bool IsFloorOver(void); void DecrementWindCounter(void); -void CreateMonsterSummaryFromEntityOuter(union damage_source_16 damage_source, struct entity* entity, - struct monster* monster, int param_4); +void CreateMonsterSummaryFromEntityOuter(union damage_source_16 damage_source, + struct entity *entity, + struct monster *monster, int param_4); bool IsDungeonEndReasonFailure(void); void SetForcedLossReason(enum forced_loss_reason forced_loss_reason); enum forced_loss_reason GetForcedLossReason(void); -void GetTrapName(char* buffer, enum trap_id trap_id); -void BindTrapToTile(struct tile* tile, struct entity* trap, bool is_visible); +void GetTrapName(char *buffer, enum trap_id trap_id); +void BindTrapToTile(struct tile *tile, struct entity *trap, bool is_visible); bool AreLateGameTrapsEnabledWrapper(void); void SpawnTraps(void); -void SpawnEnemyTrapAtPos(enum trap_id trap_id, int16_t x, int16_t y, uint8_t flags, - bool is_visible); -void PrepareTrapperTrap(struct entity* entity, enum trap_id trap_id, uint8_t team); -bool CanLayTrap(struct position* pos); -bool TrySpawnTrap(struct position* pos, enum trap_id trap_id, uint8_t team, bool visible); -bool TrySpawnTrapperTrap(struct entity* entity); -bool TryRemoveTrap(struct position* pos, bool update_trap_visibility); -bool TryRevealAttackedTrap(struct position* pos, bool update_trap_visibility); +void SpawnEnemyTrapAtPos(enum trap_id trap_id, int16_t x, int16_t y, + uint8_t flags, bool is_visible); +void PrepareTrapperTrap(struct entity *entity, enum trap_id trap_id, + uint8_t team); +bool CanLayTrap(struct position *pos); +bool TrySpawnTrap(struct position *pos, enum trap_id trap_id, uint8_t team, + bool visible); +bool TrySpawnTrapperTrap(struct entity *entity); +bool TryRemoveTrap(struct position *pos, bool update_trap_visibility); +bool TryRevealAttackedTrap(struct position *pos, bool update_trap_visibility); void SubstitutePlaceholderTrapTags2(uint8_t tag_id, enum trap_id trap_id); -void SubstitutePlaceholderTrapTags(struct preprocessor_args* preprocessor_args, uint8_t tag_id, - enum trap_id trap_id); -void TryTriggerTrap(struct entity* entity, struct position* pos, undefined param_3, - undefined param_4); -void ApplyMudTrapEffect(struct entity* attacker, struct entity* defender); -void ApplyStickyTrapEffect(struct entity* attacker, struct entity* defender); -void ApplyGrimyTrapEffect(struct entity* attacker, struct entity* defender); -void ApplyPitfallTrapEffect(struct entity* attacker, struct entity* defender, struct tile* tile, - bool grate_stay_intact); -void ApplySummonTrapEffect(struct entity* monster, struct position* pos); -void ApplyPpZeroTrapEffect(struct entity* attacker, struct entity* defender); -void ApplyPokemonTrapEffect(struct entity* monster, struct position* pos); -void ApplyTripTrapEffect(struct entity* attacker, struct entity* defender); -void ApplyStealthRockTrapEffect(struct entity* attacker, struct entity* defender); -void ApplyToxicSpikesTrapEffect(struct entity* attacker, struct entity* defender); -bool ApplyRandomTrapEffect(struct trap* trap, struct entity* user, struct entity* target, - struct tile* tile, struct position* pos); -void ApplyGrudgeTrapEffect(struct entity* monster, struct position* pos); -bool ApplyTrapEffect(struct trap* trap, struct entity* user, struct entity* target, - struct tile* tile, struct position* pos, enum trap_id, bool random_trap); -void ChangeTrapOnTile(struct tile* tile, enum trap_id trap_id); -int SpawnMonstersAroundPos(struct entity* monster, struct position* pos, uint8_t num_enemies); -void RevealTrapsNearby(struct entity* monster); +void SubstitutePlaceholderTrapTags(struct preprocessor_args *preprocessor_args, + uint8_t tag_id, enum trap_id trap_id); +void TryTriggerTrap(struct entity *entity, struct position *pos, + undefined param_3, undefined param_4); +void ApplyMudTrapEffect(struct entity *attacker, struct entity *defender); +void ApplyStickyTrapEffect(struct entity *attacker, struct entity *defender); +void ApplyGrimyTrapEffect(struct entity *attacker, struct entity *defender); +void ApplyPitfallTrapEffect(struct entity *attacker, struct entity *defender, + struct tile *tile, bool grate_stay_intact); +void ApplySummonTrapEffect(struct entity *monster, struct position *pos); +void ApplyPpZeroTrapEffect(struct entity *attacker, struct entity *defender); +void ApplyPokemonTrapEffect(struct entity *monster, struct position *pos); +void ApplyTripTrapEffect(struct entity *attacker, struct entity *defender); +void ApplyStealthRockTrapEffect(struct entity *attacker, + struct entity *defender); +void ApplyToxicSpikesTrapEffect(struct entity *attacker, + struct entity *defender); +bool ApplyRandomTrapEffect(struct trap *trap, struct entity *user, + struct entity *target, struct tile *tile, + struct position *pos); +void ApplyGrudgeTrapEffect(struct entity *monster, struct position *pos); +bool ApplyTrapEffect(struct trap *trap, struct entity *user, + struct entity *target, struct tile *tile, + struct position *pos, enum trap_id, bool random_trap); +void ChangeTrapOnTile(struct tile *tile, enum trap_id trap_id); +int SpawnMonstersAroundPos(struct entity *monster, struct position *pos, + uint8_t num_enemies); +void RevealTrapsNearby(struct entity *monster); bool RevealTrapAtPos(int x, int y); -bool ShouldRunMonsterAi(struct entity* monster); +bool ShouldRunMonsterAi(struct entity *monster); bool DebugRecruitingEnabled(void); void TryActivateIqBooster(void); bool IsBehaviorLoneOutlaw(enum monster_behavior behavior); bool IsSecretBazaarNpcBehavior(enum monster_behavior behavior); -bool TalkToSecretBazaarNpcStandard(int string_id, struct entity* shopkeeper, +bool TalkToSecretBazaarNpcStandard(int string_id, struct entity *shopkeeper, enum portrait_emotion emotion); -bool TalkToSecretBazaarNpcWithYesNoMenu(int string_id, struct entity* shopkeeper, +bool TalkToSecretBazaarNpcWithYesNoMenu(int string_id, + struct entity *shopkeeper, enum portrait_emotion emotion, - struct simple_menu_id_item* menu_items); -void MakeTargetFaceUserAndIdle(struct entity* target, struct entity* user); + struct simple_menu_id_item *menu_items); +void MakeTargetFaceUserAndIdle(struct entity *target, struct entity *user); void SubtractMoneyCarriedWithSfx(int amount); -void GonePebbleGradualPaletteShift(struct rgba* palette, uint32_t param_2); -bool TalkToSecretBazaarNpc(int string_id, struct entity* shopkeeper, enum portrait_emotion emotion, - struct simple_menu_id_item* menu_items, bool param_5); -struct action_16* GetLeaderAction(void); +void GonePebbleGradualPaletteShift(struct rgba *palette, uint32_t param_2); +bool TalkToSecretBazaarNpc(int string_id, struct entity *shopkeeper, + enum portrait_emotion emotion, + struct simple_menu_id_item *menu_items, + bool param_5); +struct action_16 *GetLeaderAction(void); enum action_id GetLeaderActionId(void); -void GetEntityTouchscreenArea(struct entity* entity, struct touchscreen_area* area); +void GetEntityTouchscreenArea(struct entity *entity, + struct touchscreen_area *area); void SetLeaderAction(void); bool ShouldLeaderKeepRunning(void); void CheckLeaderTile(void); void ChangeLeader(void); enum monster_gender GetPlayerGender(void); -void HandleHeldItemSwaps(struct entity* entity); -void UseSingleUseItemWrapper(struct entity* user); -void UseSingleUseItem(struct entity* user, struct entity* target); -void UseThrowableItem(struct entity* user); -void ResetDamageData(struct damage_data* damage); +void HandleHeldItemSwaps(struct entity *entity); +void UseSingleUseItemWrapper(struct entity *user); +void UseSingleUseItem(struct entity *user, struct entity *target); +void UseThrowableItem(struct entity *user); +void ResetDamageData(struct damage_data *damage); void FreeLoadedAttackSpriteAndMore(void); -uint16_t SetAndLoadCurrentAttackAnimation(enum pack_file_id pack_id, uint16_t file_index); +uint16_t SetAndLoadCurrentAttackAnimation(enum pack_file_id pack_id, + uint16_t file_index); void ClearLoadedAttackSprite(void); uint16_t GetLoadedAttackSpriteId(void); int DungeonGetTotalSpriteFileSize(enum monster_id monster_id); @@ -262,572 +300,709 @@ void LoadMonsterSprite(enum monster_id monster_id, undefined param_2); void DeleteMonsterSpriteFile(enum monster_id monster_id); void DeleteAllMonsterSpriteFiles(void); void EuFaintCheck(bool non_team_member_fainted, bool set_unk_byte); -void HandleFaint(struct entity* fainted_entity, union damage_source damage_source, - struct entity* killer); -void MoveMonsterToPos(struct entity* entity, int x_pos, int y_pos, undefined param_4); -void CreateMonsterSummaryFromEntity(struct monster_summary* monster_summary, - struct entity* monster_entity); -void UpdateAiTargetPos(struct entity* monster); -void SetMonsterTypeAndAbility(struct entity* target); +void HandleFaint(struct entity *fainted_entity, + union damage_source damage_source, struct entity *killer); +void MoveMonsterToPos(struct entity *entity, int x_pos, int y_pos, + undefined param_4); +void CreateMonsterSummaryFromEntity(struct monster_summary *monster_summary, + struct entity *monster_entity); +void UpdateAiTargetPos(struct entity *monster); +void SetMonsterTypeAndAbility(struct entity *target); void TryActivateSlowStart(void); void TryActivateArtificialWeatherAbilities(void); -int GetMonsterApparentId(struct entity* target, enum monster_id current_id); -void TryActivateTraceAndColorChange(struct entity* attacker, struct entity* defender, - struct move* move); -bool DefenderAbilityIsActive(struct entity* attacker, struct entity* defender, - enum ability_id ability_id, bool attacker_ability_enabled); -bool IsMonster(struct entity* entity); -void TryActivateConversion2(struct entity* attacker, struct entity* defender, struct move* move); -void TryActivateTruant(struct entity* entity); -void TryPointCameraToMonster(struct entity* entity, undefined param_2, undefined param_3); +int GetMonsterApparentId(struct entity *target, enum monster_id current_id); +void TryActivateTraceAndColorChange(struct entity *attacker, + struct entity *defender, struct move *move); +bool DefenderAbilityIsActive(struct entity *attacker, struct entity *defender, + enum ability_id ability_id, + bool attacker_ability_enabled); +bool IsMonster(struct entity *entity); +void TryActivateConversion2(struct entity *attacker, struct entity *defender, + struct move *move); +void TryActivateTruant(struct entity *entity); +void TryPointCameraToMonster(struct entity *entity, undefined param_2, + undefined param_3); void ReevaluateSnatchMonster(void); -struct entity* GetRandomExplorerMazeMonster(void); -void RestorePpAllMovesSetFlags(struct entity* entity); +struct entity *GetRandomExplorerMazeMonster(void); +void RestorePpAllMovesSetFlags(struct entity *entity); bool CheckTeamMemberIdxVeneer(int member_idx); -bool CheckMonsterTeamMemberIdx(struct entity* entity); +bool CheckMonsterTeamMemberIdx(struct entity *entity); bool IsMonsterIdInNormalRangeVeneer(enum monster_id monster_id); -void BoostIQ(struct entity* entity, int iq_boost, bool suppress_logs); -void ChangeMonsterAnimationToIdle(struct entity* entity, enum direction_id direction); -bool ShouldMonsterHeadToStairs(struct entity* entity); -void DisplayLinkedMovesWarnings(struct entity* entity, int move_slot); +void BoostIQ(struct entity *entity, int iq_boost, bool suppress_logs); +void ChangeMonsterAnimationToIdle(struct entity *entity, + enum direction_id direction); +bool ShouldMonsterHeadToStairs(struct entity *entity); +void DisplayLinkedMovesWarnings(struct entity *entity, int move_slot); bool MewSpawnCheck(enum monster_id monster_id, bool fail_if_mew); -void TryEndStatusWithAbility(struct entity* attacker, struct entity* defender); -bool ExclusiveItemEffectIsActive(struct entity* entity, enum exclusive_item_effect_id effect_id); -struct entity* GetTeamMemberWithIqSkill(enum iq_skill_id iq_skill); +void TryEndStatusWithAbility(struct entity *attacker, struct entity *defender); +bool ExclusiveItemEffectIsActive(struct entity *entity, + enum exclusive_item_effect_id effect_id); +struct entity *GetTeamMemberWithIqSkill(enum iq_skill_id iq_skill); bool TeamMemberHasEnabledIqSkill(enum iq_skill_id iq_skill); bool TeamLeaderIqSkillIsEnabled(enum iq_skill_id iq_skill); -int CountMovesOutOfPp(struct entity* entity); -bool HasSuperEffectiveMoveAgainstUser(struct entity* user, struct entity* target, - bool ignore_moves_with_max_ginseng_not_99); -bool TryEatItem(struct entity* user, struct entity* target); -void SetDecoyAiTracker(struct entity* entity); +int CountMovesOutOfPp(struct entity *entity); +bool HasSuperEffectiveMoveAgainstUser( + struct entity *user, struct entity *target, + bool ignore_moves_with_max_ginseng_not_99); +bool TryEatItem(struct entity *user, struct entity *target); +void SetDecoyAiTracker(struct entity *entity); bool CheckSpawnThreshold(enum monster_id monster_id); -bool HasLowHealth(struct entity* entity); -bool AreEntitiesAdjacent(struct entity* first, struct entity* second); -bool IsHero(struct entity* entity); -int16_t FindMoveOnMonster(struct entity* entity, enum move_id move_id); -bool DoesMonsterHaveMove(struct entity* entity, enum move_id move_id); -bool IsSpecialStoryAllyOrClient(struct entity* entity); -void ResetTriggerFlags(struct entity* entity); -bool IsSpecialStoryAlly(struct monster* monster); -bool IsExperienceLocked(struct monster* monster); -struct entity* FindMonsterWithBehavior(enum monster_behavior monster_behavior); +bool HasLowHealth(struct entity *entity); +bool AreEntitiesAdjacent(struct entity *first, struct entity *second); +bool IsHero(struct entity *entity); +int16_t FindMoveOnMonster(struct entity *entity, enum move_id move_id); +bool DoesMonsterHaveMove(struct entity *entity, enum move_id move_id); +bool IsSpecialStoryAllyOrClient(struct entity *entity); +void ResetTriggerFlags(struct entity *entity); +bool IsSpecialStoryAlly(struct monster *monster); +bool IsExperienceLocked(struct monster *monster); +struct entity *FindMonsterWithBehavior(enum monster_behavior monster_behavior); int CountActiveMonsters(void); -bool IsMonsterLoneOutlaw(struct monster* monster); -bool IsSecretBazaarNpc(struct entity* entity); -bool IsTeamMemberOnFirstTurnInFixedRoom(struct monster* monster); -void InitOtherMonsterData(struct entity* entity, int fixed_room_stats_index, enum direction_id dir); +bool IsMonsterLoneOutlaw(struct monster *monster); +bool IsSecretBazaarNpc(struct entity *entity); +bool IsTeamMemberOnFirstTurnInFixedRoom(struct monster *monster); +void InitOtherMonsterData(struct entity *entity, int fixed_room_stats_index, + enum direction_id dir); void InitEnemySpawnStats(void); -void InitEnemyStatsAndMoves(struct move* move_list, int16_t* hp, uint8_t* offensive_stats, - uint8_t* defensive_stats); +void InitEnemyStatsAndMoves(struct move *move_list, int16_t *hp, + uint8_t *offensive_stats, uint8_t *defensive_stats); void SpawnTeam(undefined param_1); void SpawnInitialMonsters(void); -struct entity* SpawnMonster(struct spawned_monster_data* monster_data, bool cannot_be_asleep); +struct entity *SpawnMonster(struct spawned_monster_data *monster_data, + bool cannot_be_asleep); void InitTeamMember(enum monster_id, int16_t x_position, int16_t y_position, - struct team_member* team_member_data, undefined param_5, undefined param_6, - undefined param_7, undefined param_8, undefined param_9); -void InitMonster(undefined param_1, struct entity* entity, struct spawned_monster_data* spawn_data, - undefined* param_4); -void SubInitMonster(struct monster* monster, bool flag); -void MarkShopkeeperSpawn(int x, int y, enum monster_id monster_id, enum monster_behavior behavior); + struct team_member *team_member_data, undefined param_5, + undefined param_6, undefined param_7, undefined param_8, + undefined param_9); +void InitMonster(undefined param_1, struct entity *entity, + struct spawned_monster_data *spawn_data, undefined *param_4); +void SubInitMonster(struct monster *monster, bool flag); +void MarkShopkeeperSpawn(int x, int y, enum monster_id monster_id, + enum monster_behavior behavior); void SpawnShopkeepers(void); uint16_t GetMaxHpAtLevel(enum monster_id monster_id, int level); -uint8_t GetOffensiveStatAtLevel(enum monster_id monster_id, int level, int stat_idx); -uint8_t GetDefensiveStatAtLevel(enum monster_id monster_id, int level, int stat_idx); -void GetOutlawSpawnData(struct spawned_target_data* outlaw); -bool ExecuteMonsterAction(struct entity* monster); +uint8_t GetOffensiveStatAtLevel(enum monster_id monster_id, int level, + int stat_idx); +uint8_t GetDefensiveStatAtLevel(enum monster_id monster_id, int level, + int stat_idx); +void GetOutlawSpawnData(struct spawned_target_data *outlaw); +bool ExecuteMonsterAction(struct entity *monster); void TryActivateFlashFireOnAllMonsters(void); -bool HasStatusThatPreventsActing(struct entity* monster); -enum mobility_type GetMobilityTypeCheckSlip(enum monster_id species, bool walk_on_water); -enum mobility_type GetMobilityTypeCheckSlipAndFloating(struct entity* monster, +bool HasStatusThatPreventsActing(struct entity *monster); +enum mobility_type GetMobilityTypeCheckSlip(enum monster_id species, + bool walk_on_water); +enum mobility_type GetMobilityTypeCheckSlipAndFloating(struct entity *monster, enum monster_id species); -bool IsInvalidSpawnTile(enum monster_id monster_id, struct tile* tile); -enum mobility_type GetMobilityTypeAfterIqSkills(struct entity* monster, - enum mobility_type mobility_type); -bool CanMoveThroughWalls(struct entity* monster); -bool CannotStandOnTile(struct entity* monster, struct tile* tile); -int CalcSpeedStage(struct entity* entity, int counter_weight); -int CalcSpeedStageWrapper(struct entity* entity); -int GetNumberOfAttacks(struct entity* entity); -enum display_name_type GetMonsterDisplayNameType(struct monster* monster); -void GetMonsterName(char* buffer, struct monster* target_info); -void SetPreprocessorArgsStringToName(struct preprocessor_args* preprocessor_args, uint8_t pos, - struct monster* monster, undefined param_4, uint8_t name_type); -bool IsMonsterDrowsy(struct entity* monster); -bool MonsterHasNonvolatileNonsleepStatus(struct entity* monster); -bool MonsterHasImmobilizingStatus(struct entity* monster); -bool MonsterHasAttackInterferingStatus(struct entity* monster); -bool MonsterHasSkillInterferingStatus(struct entity* monster); -bool MonsterHasLeechSeedStatus(struct entity* monster); -bool MonsterHasWhifferStatus(struct entity* monster); -bool IsMonsterVisuallyImpaired(struct entity* monster, bool check_held_item); -bool IsMonsterMuzzled(struct entity* monster); -bool MonsterHasMiracleEyeStatus(struct entity* monster); -bool MonsterHasNegativeStatus(struct entity* monster, bool check_held_item); -bool IsMonsterSleeping(struct entity* monster); -bool MonsterHasQuarterHp(struct entity* monster); -bool CheckVariousStatuses2(struct entity* entity, bool blind_check); -bool CheckVariousConditions(struct entity* entity); -bool CheckVariousStatuses(struct entity* entity); -bool MonsterCannotAttack(struct entity* entity, bool skip_sleep); -bool CanMonsterMoveInDirection(struct entity* monster, enum direction_id direction); -enum mobility_type GetDirectionalMobilityType(struct entity* monster, +bool IsInvalidSpawnTile(enum monster_id monster_id, struct tile *tile); +enum mobility_type +GetMobilityTypeAfterIqSkills(struct entity *monster, + enum mobility_type mobility_type); +bool CanMoveThroughWalls(struct entity *monster); +bool CannotStandOnTile(struct entity *monster, struct tile *tile); +int CalcSpeedStage(struct entity *entity, int counter_weight); +int CalcSpeedStageWrapper(struct entity *entity); +int GetNumberOfAttacks(struct entity *entity); +enum display_name_type GetMonsterDisplayNameType(struct monster *monster); +void GetMonsterName(char *buffer, struct monster *target_info); +void SetPreprocessorArgsStringToName( + struct preprocessor_args *preprocessor_args, uint8_t pos, + struct monster *monster, undefined param_4, uint8_t name_type); +bool IsMonsterDrowsy(struct entity *monster); +bool MonsterHasNonvolatileNonsleepStatus(struct entity *monster); +bool MonsterHasImmobilizingStatus(struct entity *monster); +bool MonsterHasAttackInterferingStatus(struct entity *monster); +bool MonsterHasSkillInterferingStatus(struct entity *monster); +bool MonsterHasLeechSeedStatus(struct entity *monster); +bool MonsterHasWhifferStatus(struct entity *monster); +bool IsMonsterVisuallyImpaired(struct entity *monster, bool check_held_item); +bool IsMonsterMuzzled(struct entity *monster); +bool MonsterHasMiracleEyeStatus(struct entity *monster); +bool MonsterHasNegativeStatus(struct entity *monster, bool check_held_item); +bool IsMonsterSleeping(struct entity *monster); +bool MonsterHasQuarterHp(struct entity *monster); +bool CheckVariousStatuses2(struct entity *entity, bool blind_check); +bool CheckVariousConditions(struct entity *entity); +bool CheckVariousStatuses(struct entity *entity); +bool MonsterCannotAttack(struct entity *entity, bool skip_sleep); +bool CanMonsterMoveInDirection(struct entity *monster, + enum direction_id direction); +enum mobility_type GetDirectionalMobilityType(struct entity *monster, enum mobility_type base_mobility, enum direction_id direction); -bool CanMonsterMoveOrSwapWithAllyInAnyDirection(struct entity* monster); -bool CanMonsterMoveOrSwapWithAllyInDirection(struct entity* monster, enum direction_id direction); -bool CanAttackInDirection(struct entity* monster, enum direction_id direction); -bool CanAiMonsterMoveInDirection(struct entity* monster, enum direction_id direction, - bool* out_monster_in_target_position); -bool IsAtJunction(struct entity* monster); -bool ShouldAvoidFirstHit(struct entity* monster, bool should_avoid); -bool ShouldMonsterRunAway(struct entity* monster); -bool ShouldMonsterRunAwayAndShowEffect(struct entity* monster, bool show_run_away_effect); -void DisplayRunAwayIfTriggered(struct entity* monster, bool show_run_away_effect); -enum monster_treatment GetTreatmentBetweenMonsters(struct entity* entity1, struct entity* entity2, - bool see_invisible_targets, - bool ignore_petrified_targets); -enum monster_treatment GetTreatmentBetweenMonstersIgnoreStatus(struct entity* entity1, - struct entity* entity2); -bool SafeguardIsActive(struct entity* user, struct entity* target, bool log_message); -bool LeafGuardIsActive(struct entity* user, struct entity* target, bool log_message); -bool IsProtectedFromStatDrops(struct entity* user, struct entity* target, bool log_message); -bool NoGastroAcidStatus(struct entity* entity, enum ability_id ability_id); -bool AbilityIsActive(struct entity* entity, enum ability_id ability_id); -bool AbilityIsActiveVeneer(struct entity* entity, enum ability_id ability_id); -bool OtherMonsterAbilityIsActive(struct entity* user, enum ability_id ability_id); -bool LevitateIsActive(struct entity* entity); -bool MonsterIsType(struct entity* entity, enum type_id type_id); -bool IsTypeAffectedByGravity(struct entity* entity, enum type_id type_id); -bool HasTypeAffectedByGravity(struct entity* entity, enum type_id type_id); -bool CanSeeInvisibleMonsters(struct entity* entity); -bool IsTacticSet(struct entity* entity, enum tactic_id tactic_id); -bool HasDropeyeStatus(struct entity* entity); -bool IqSkillIsEnabled(struct entity* entity, enum iq_skill_id iq_id); -void UpdateIqSkills(struct monster* monster); -bool CanSeeTeammate(struct monster* monster); -enum type_id GetMoveTypeForMonster(struct entity* entity, struct move* move); -int GetMovePower(struct entity* entity, struct move* move); -bool MonsterCanThrowItems(struct monster* monster); -bool UpdateStateFlags(struct monster* monster, uint16_t mask, bool set_flags); -bool IsProtectedFromNegativeStatus(struct entity* user, struct entity* target, bool log_message); -void AddExpSpecial(struct entity* attacker, struct entity* defender, int base_exp); -void EnemyEvolution(struct entity* entity); -void LevelUpItemEffect(struct entity* user, struct entity* target, int levels, bool message, - bool dialogue); -bool TryDecreaseLevel(struct entity* user, struct entity* target, int n_levels); -bool LevelUp(struct entity* user, struct entity* target, bool message, bool dialogue); -bool DungeonTmLearnMove(struct entity* user, enum move_id move_id); -void GetMonsterMoves(struct move_id_16* out_moves, enum monster_id monster_id, int level); -void EvolveMonster(struct entity* user, struct entity* target, enum monster_id new_monster_id); -void DisplayMonsterShadow(bool display_shadow, enum shadow_type shadow_type, bool yellow_circle, - int16_t x, int16_t y); -void ChangeMonsterAnimation(struct entity* monster, int8_t animation_id, +bool CanMonsterMoveOrSwapWithAllyInAnyDirection(struct entity *monster); +bool CanMonsterMoveOrSwapWithAllyInDirection(struct entity *monster, + enum direction_id direction); +bool CanAttackInDirection(struct entity *monster, enum direction_id direction); +bool CanAiMonsterMoveInDirection(struct entity *monster, + enum direction_id direction, + bool *out_monster_in_target_position); +bool IsAtJunction(struct entity *monster); +bool ShouldAvoidFirstHit(struct entity *monster, bool should_avoid); +bool ShouldMonsterRunAway(struct entity *monster); +bool ShouldMonsterRunAwayAndShowEffect(struct entity *monster, + bool show_run_away_effect); +void DisplayRunAwayIfTriggered(struct entity *monster, + bool show_run_away_effect); +enum monster_treatment +GetTreatmentBetweenMonsters(struct entity *entity1, struct entity *entity2, + bool see_invisible_targets, + bool ignore_petrified_targets); +enum monster_treatment +GetTreatmentBetweenMonstersIgnoreStatus(struct entity *entity1, + struct entity *entity2); +bool SafeguardIsActive(struct entity *user, struct entity *target, + bool log_message); +bool LeafGuardIsActive(struct entity *user, struct entity *target, + bool log_message); +bool IsProtectedFromStatDrops(struct entity *user, struct entity *target, + bool log_message); +bool NoGastroAcidStatus(struct entity *entity, enum ability_id ability_id); +bool AbilityIsActive(struct entity *entity, enum ability_id ability_id); +bool AbilityIsActiveVeneer(struct entity *entity, enum ability_id ability_id); +bool OtherMonsterAbilityIsActive(struct entity *user, + enum ability_id ability_id); +bool LevitateIsActive(struct entity *entity); +bool MonsterIsType(struct entity *entity, enum type_id type_id); +bool IsTypeAffectedByGravity(struct entity *entity, enum type_id type_id); +bool HasTypeAffectedByGravity(struct entity *entity, enum type_id type_id); +bool CanSeeInvisibleMonsters(struct entity *entity); +bool IsTacticSet(struct entity *entity, enum tactic_id tactic_id); +bool HasDropeyeStatus(struct entity *entity); +bool IqSkillIsEnabled(struct entity *entity, enum iq_skill_id iq_id); +void UpdateIqSkills(struct monster *monster); +bool CanSeeTeammate(struct monster *monster); +enum type_id GetMoveTypeForMonster(struct entity *entity, struct move *move); +int GetMovePower(struct entity *entity, struct move *move); +bool MonsterCanThrowItems(struct monster *monster); +bool UpdateStateFlags(struct monster *monster, uint16_t mask, bool set_flags); +bool IsProtectedFromNegativeStatus(struct entity *user, struct entity *target, + bool log_message); +void AddExpSpecial(struct entity *attacker, struct entity *defender, + int base_exp); +void EnemyEvolution(struct entity *entity); +void LevelUpItemEffect(struct entity *user, struct entity *target, int levels, + bool message, bool dialogue); +bool TryDecreaseLevel(struct entity *user, struct entity *target, int n_levels); +bool LevelUp(struct entity *user, struct entity *target, bool message, + bool dialogue); +bool DungeonTmLearnMove(struct entity *user, enum move_id move_id); +void GetMonsterMoves(struct move_id_16 *out_moves, enum monster_id monster_id, + int level); +void EvolveMonster(struct entity *user, struct entity *target, + enum monster_id new_monster_id); +void DisplayMonsterShadow(bool display_shadow, enum shadow_type shadow_type, + bool yellow_circle, int16_t x, int16_t y); +void ChangeMonsterAnimation(struct entity *monster, int8_t animation_id, enum direction_id direction); -uint8_t GetIdleAnimationId(struct entity* entity); +uint8_t GetIdleAnimationId(struct entity *entity); void DetermineAllMonsterShadow(void); -enum shadow_type DetermineMonsterShadow(struct entity* monster); -bool DisplayActions(struct entity* param_1); -void CheckNonLeaderTile(struct entity* entity); -bool EndNegativeStatusCondition(struct entity* user, struct entity* target, bool animation, - bool fail_message, bool remove_wrapping); -bool EndNegativeStatusConditionWrapper(struct entity* user, struct entity* target, bool animation, +enum shadow_type DetermineMonsterShadow(struct entity *monster); +bool DisplayActions(struct entity *param_1); +void CheckNonLeaderTile(struct entity *entity); +bool EndNegativeStatusCondition(struct entity *user, struct entity *target, + bool animation, bool fail_message, + bool remove_wrapping); +bool EndNegativeStatusConditionWrapper(struct entity *user, + struct entity *target, bool animation, bool fail_message); -void TransferNegativeStatusCondition(struct entity* user, struct entity* target); -void EndSleepClassStatus(struct entity* user, struct entity* target); -void EndBurnClassStatus(struct entity* user, struct entity* target); -void EndFrozenClassStatus(struct entity* user, struct entity* target, bool log); -void EndCringeClassStatus(struct entity* user, struct entity* target); -void EndReflectClassStatus(struct entity* user, struct entity* target); -void TryRemoveSnatchedMonsterFromDungeonStruct(struct entity* user, struct entity* target); -void EndCurseClassStatus(struct entity* user, struct entity* target, - uint8_t next_curse_class_status_being_applied, bool log_message); -void EndLeechSeedClassStatus(struct entity* user, struct entity* target); -void EndSureShotClassStatus(struct entity* user, struct entity* target); -void EndInvisibleClassStatus(struct entity* user, struct entity* target, bool no_slip_message); -void EndBlinkerClassStatus(struct entity* user, struct entity* target); -void EndMuzzledStatus(struct entity* user, struct entity* target); -void EndMiracleEyeStatus(struct entity* user, struct entity* target); -void EndMagnetRiseStatus(struct entity* user, struct entity* target); -bool TransferNegativeBlinkerClassStatus(struct entity* user, struct entity* target); -bool TryEndPetrifiedOrSleepStatus(struct entity* user, struct entity* target); -void EndFrozenStatus(struct entity* user, struct entity* target); -void EndProtectStatus(struct entity* user, struct entity* target); -void TryRestoreRoostTyping(struct entity* user, struct entity* target); -void TryTriggerMonsterHouse(struct entity* entity, bool outside_enemies); -bool ShouldMonsterFollowLeader(struct entity* monster); -struct entity* GetLeaderIfVisible(struct entity* monster); -void RunMonsterAi(struct entity* monster, int unused); -void ApplyDamageAndEffects(struct entity* attacker, struct entity* defender, - struct damage_data* damage_data, bool false_swipe, bool exp_on_faint, - union damage_source damage_source, bool defender_response); -bool ApplyDamage(struct entity* attacker, struct entity* defender, struct damage_data* damage_data, - bool false_swipe, bool exp_on_faint, union damage_source damage_source); -bool AftermathCheck(struct entity* attacker, struct entity* defender, +void TransferNegativeStatusCondition(struct entity *user, + struct entity *target); +void EndSleepClassStatus(struct entity *user, struct entity *target); +void EndBurnClassStatus(struct entity *user, struct entity *target); +void EndFrozenClassStatus(struct entity *user, struct entity *target, bool log); +void EndCringeClassStatus(struct entity *user, struct entity *target); +void EndReflectClassStatus(struct entity *user, struct entity *target); +void TryRemoveSnatchedMonsterFromDungeonStruct(struct entity *user, + struct entity *target); +void EndCurseClassStatus(struct entity *user, struct entity *target, + uint8_t next_curse_class_status_being_applied, + bool log_message); +void EndLeechSeedClassStatus(struct entity *user, struct entity *target); +void EndSureShotClassStatus(struct entity *user, struct entity *target); +void EndInvisibleClassStatus(struct entity *user, struct entity *target, + bool no_slip_message); +void EndBlinkerClassStatus(struct entity *user, struct entity *target); +void EndMuzzledStatus(struct entity *user, struct entity *target); +void EndMiracleEyeStatus(struct entity *user, struct entity *target); +void EndMagnetRiseStatus(struct entity *user, struct entity *target); +bool TransferNegativeBlinkerClassStatus(struct entity *user, + struct entity *target); +bool TryEndPetrifiedOrSleepStatus(struct entity *user, struct entity *target); +void EndFrozenStatus(struct entity *user, struct entity *target); +void EndProtectStatus(struct entity *user, struct entity *target); +void TryRestoreRoostTyping(struct entity *user, struct entity *target); +void TryTriggerMonsterHouse(struct entity *entity, bool outside_enemies); +bool ShouldMonsterFollowLeader(struct entity *monster); +struct entity *GetLeaderIfVisible(struct entity *monster); +void RunMonsterAi(struct entity *monster, int unused); +void ApplyDamageAndEffects(struct entity *attacker, struct entity *defender, + struct damage_data *damage_data, bool false_swipe, + bool exp_on_faint, union damage_source damage_source, + bool defender_response); +bool ApplyDamage(struct entity *attacker, struct entity *defender, + struct damage_data *damage_data, bool false_swipe, + bool exp_on_faint, union damage_source damage_source); +bool AftermathCheck(struct entity *attacker, struct entity *defender, union damage_source damage_source); -enum type_matchup GetTypeMatchupBothTypes(struct entity* attacker, struct entity* defender, +enum type_matchup GetTypeMatchupBothTypes(struct entity *attacker, + struct entity *defender, enum type_id attack_type); -bool ScrappyShouldActivate(struct entity* attacker, struct entity* defender, +bool ScrappyShouldActivate(struct entity *attacker, struct entity *defender, enum type_id attack_type); bool IsTypeIneffectiveAgainstGhost(enum type_id attack_type); -bool GhostImmunityIsActive(struct entity* attacker, struct entity* defender, int target_type_idx); -enum type_matchup GetTypeMatchup(struct entity* attacker, struct entity* defender, - int target_type_idx, enum type_id attack_type); -bool CalcTypeBasedDamageEffects(struct fx64_16* damage_mult_out, struct entity* attacker, - struct entity* defender, int attack_power, enum type_id attack_type, - struct damage_data* damage_out, bool partial); -int WeightWeakTypePicker(struct entity* user, struct entity* target, enum type_id move_type); -void CalcDamage(struct entity* attacker, struct entity* defender, enum type_id attack_type, - int attack_power, int crit_chance, struct damage_data* damage_out, - fx32_8 damage_mult_fp, enum move_id move_id, bool full_calc); -void ApplyDamageAndEffectsWrapper(struct entity* monster, int damage, enum damage_message message, +bool GhostImmunityIsActive(struct entity *attacker, struct entity *defender, + int target_type_idx); +enum type_matchup GetTypeMatchup(struct entity *attacker, + struct entity *defender, int target_type_idx, + enum type_id attack_type); +bool CalcTypeBasedDamageEffects(struct fx64_16 *damage_mult_out, + struct entity *attacker, + struct entity *defender, int attack_power, + enum type_id attack_type, + struct damage_data *damage_out, bool partial); +int WeightWeakTypePicker(struct entity *user, struct entity *target, + enum type_id move_type); +void CalcDamage(struct entity *attacker, struct entity *defender, + enum type_id attack_type, int attack_power, int crit_chance, + struct damage_data *damage_out, fx32_8 damage_mult_fp, + enum move_id move_id, bool full_calc); +void ApplyDamageAndEffectsWrapper(struct entity *monster, int damage, + enum damage_message message, union damage_source damage_source); -void CalcRecoilDamageFixed(struct entity* attacker, int fixed_damage, undefined4 param_3, - struct damage_data* damage_out, enum move_id move_id, - enum type_id attack_type, union damage_source damage_source, - enum damage_message damage_message, undefined4 param_9, - undefined4 param_10); -void CalcDamageFixed(struct entity* attacker, struct entity* defender, int fixed_damage, - bool exp_on_faint, struct damage_data* damage_out, enum type_id attack_type, - enum move_category move_category, union damage_source damage_source, - enum damage_message damage_message, undefined4 param_10, undefined4 param_11); -void CalcDamageFixedNoCategory(struct entity* attacker, struct entity* defender, int fixed_damage, - bool exp_on_faint, struct damage_data* damage_out, - enum type_id attack_type, union damage_source damage_source, - enum damage_message damage_message, undefined4 param_9, - undefined4 param_10); -void CalcDamageFixedWrapper(struct entity* attacker, struct entity* defender, int fixed_damage, - bool exp_on_faint, struct damage_data* damage_out, - enum type_id attack_type, enum move_category move_category, - union damage_source damage_source, enum damage_message damage_message, +void CalcRecoilDamageFixed(struct entity *attacker, int fixed_damage, + undefined4 param_3, struct damage_data *damage_out, + enum move_id move_id, enum type_id attack_type, + union damage_source damage_source, + enum damage_message damage_message, + undefined4 param_9, undefined4 param_10); +void CalcDamageFixed(struct entity *attacker, struct entity *defender, + int fixed_damage, bool exp_on_faint, + struct damage_data *damage_out, enum type_id attack_type, + enum move_category move_category, + union damage_source damage_source, + enum damage_message damage_message, undefined4 param_10, + undefined4 param_11); +void CalcDamageFixedNoCategory(struct entity *attacker, struct entity *defender, + int fixed_damage, bool exp_on_faint, + struct damage_data *damage_out, + enum type_id attack_type, + union damage_source damage_source, + enum damage_message damage_message, + undefined4 param_9, undefined4 param_10); +void CalcDamageFixedWrapper(struct entity *attacker, struct entity *defender, + int fixed_damage, bool exp_on_faint, + struct damage_data *damage_out, + enum type_id attack_type, + enum move_category move_category, + union damage_source damage_source, + enum damage_message damage_message, undefined4 param_10, undefined4 param_11); -void UpdateShopkeeperModeAfterAttack(struct entity* attacker, struct entity* defender); -void UpdateShopkeeperModeAfterTrap(struct entity* shopkeeper, bool non_team_member); +void UpdateShopkeeperModeAfterAttack(struct entity *attacker, + struct entity *defender); +void UpdateShopkeeperModeAfterTrap(struct entity *shopkeeper, + bool non_team_member); void ResetDamageCalcDiagnostics(void); -void PointCameraToMonsterWrapper(struct entity* entity); -bool IsEitherMonsterInvalid(struct entity* entity1, struct entity* entity2); +void PointCameraToMonsterWrapper(struct entity *entity); +bool IsEitherMonsterInvalid(struct entity *entity1, struct entity *entity2); bool SpecificRecruitCheck(enum monster_id monster_id); -bool RecruitCheck(struct entity* user, struct entity* target); -bool TryRecruit(struct entity* user, struct entity* recruit); +bool RecruitCheck(struct entity *user, struct entity *target); +bool TryRecruit(struct entity *user, struct entity *recruit); void TrySpawnMonsterAndTickSpawnCounter(void); -void AiDecideUseItem(struct entity* entity); -void GetPossibleAiThrownItemDirections(struct entity* entity, int ally_or_enemy, struct item* item, - bool always_add); -void GetPossibleAiArcItemTargets(struct entity* user, struct item* item, struct position* positions, +void AiDecideUseItem(struct entity *entity); +void GetPossibleAiThrownItemDirections(struct entity *entity, int ally_or_enemy, + struct item *item, bool always_add); +void GetPossibleAiArcItemTargets(struct entity *user, struct item *item, + struct position *positions, bool always_add_position); -void TryNonLeaderItemPickUp(struct entity* entity); -bool GetExclusiveItemWithEffectFromBag(struct entity* entity, - enum exclusive_item_effect_id effect_id, struct item* item); -bool AuraBowIsActive(struct entity* entity); -int ExclusiveItemOffenseBoost(struct entity* entity, int move_category_idx); -int ExclusiveItemDefenseBoost(struct entity* entity, int move_category_idx); -int TeamMemberHasItemActive(struct entity* monsters, enum item_id item_id); -bool TeamMemberHasExclusiveItemEffectActive(enum exclusive_item_effect_id effect_id); -enum direction_id FindDirectionOfAdjacentMonsterWithItem(struct entity* entity, +void TryNonLeaderItemPickUp(struct entity *entity); +bool GetExclusiveItemWithEffectFromBag(struct entity *entity, + enum exclusive_item_effect_id effect_id, + struct item *item); +bool AuraBowIsActive(struct entity *entity); +int ExclusiveItemOffenseBoost(struct entity *entity, int move_category_idx); +int ExclusiveItemDefenseBoost(struct entity *entity, int move_category_idx); +int TeamMemberHasItemActive(struct entity *monsters, enum item_id item_id); +bool TeamMemberHasExclusiveItemEffectActive( + enum exclusive_item_effect_id effect_id); +enum direction_id FindDirectionOfAdjacentMonsterWithItem(struct entity *entity, enum item_id item_id); -void TrySpawnEnemyItemDrop(struct entity* attacker, struct entity* defender); -void TickNoSlipCap(struct entity* entity); -void ActivateEndOfTurnEffects(struct entity* entity); -void TickStatusAndHealthRegen(struct entity* entity); -void InflictSleepStatusSingle(struct entity* entity, int turns); -void TryInflictSleepStatus(struct entity* user, struct entity* target, int turns, bool log_failure); -bool IsProtectedFromSleepClassStatus(struct entity* user, struct entity* target, - bool ignore_safeguard, bool ingnore_protections, +void TrySpawnEnemyItemDrop(struct entity *attacker, struct entity *defender); +void TickNoSlipCap(struct entity *entity); +void ActivateEndOfTurnEffects(struct entity *entity); +void TickStatusAndHealthRegen(struct entity *entity); +void InflictSleepStatusSingle(struct entity *entity, int turns); +void TryInflictSleepStatus(struct entity *user, struct entity *target, + int turns, bool log_failure); +bool IsProtectedFromSleepClassStatus(struct entity *user, struct entity *target, + bool ignore_safeguard, + bool ingnore_protections, bool log_failure); -void TryInflictNightmareStatus(struct entity* user, struct entity* target, int turns); -void TryInflictNappingStatus(struct entity* user, struct entity* target, int turns); -void TryInflictYawningStatus(struct entity* user, struct entity* target, int turns); -void TryInflictSleeplessStatus(struct entity* user, struct entity* target); -bool TryInflictPausedStatus(struct entity* user, struct entity* target, bool check_safeguard, - int turns, bool log_failure, bool check_only); -bool TryInflictInfatuatedStatus(struct entity* user, struct entity* target, bool log_failure, - bool check_only); -bool TryInflictBurnStatus(struct entity* user, struct entity* target, bool special_effect, - bool log_failure, bool check_only); +void TryInflictNightmareStatus(struct entity *user, struct entity *target, + int turns); +void TryInflictNappingStatus(struct entity *user, struct entity *target, + int turns); +void TryInflictYawningStatus(struct entity *user, struct entity *target, + int turns); +void TryInflictSleeplessStatus(struct entity *user, struct entity *target); +bool TryInflictPausedStatus(struct entity *user, struct entity *target, + bool check_safeguard, int turns, bool log_failure, + bool check_only); +bool TryInflictInfatuatedStatus(struct entity *user, struct entity *target, + bool log_failure, bool check_only); +bool TryInflictBurnStatus(struct entity *user, struct entity *target, + bool special_effect, bool log_failure, + bool check_only); void TryInflictBurnStatusWholeTeam(void); -bool TryInflictPoisonedStatus(struct entity* user, struct entity* target, bool log_failure, - bool check_only); -bool TryInflictBadlyPoisonedStatus(struct entity* user, struct entity* target, bool log_failure, - bool check_only); -void TryInflictFrozenStatus(struct entity* user, struct entity* target, bool log_failure); -void TryInflictConstrictionStatus(struct entity* user, struct entity* target, int animation_id, - bool log_failure); -void TryInflictShadowHoldStatus(struct entity* user, struct entity* target, bool check_only); -void TryInflictIngrainStatus(struct entity* user, struct entity* target); -void TryInflictWrappedStatus(struct entity* user, struct entity* target); -void FreeOtherWrappedMonsters(struct entity* entity); -void TryInflictPetrifiedStatus(struct entity* user, struct entity* target); -void LowerOffensiveStat(struct entity* user, struct entity* target, int stat_idx, int16_t n_stages, +bool TryInflictPoisonedStatus(struct entity *user, struct entity *target, + bool log_failure, bool check_only); +bool TryInflictBadlyPoisonedStatus(struct entity *user, struct entity *target, + bool log_failure, bool check_only); +void TryInflictFrozenStatus(struct entity *user, struct entity *target, + bool log_failure); +void TryInflictConstrictionStatus(struct entity *user, struct entity *target, + int animation_id, bool log_failure); +void TryInflictShadowHoldStatus(struct entity *user, struct entity *target, + bool check_only); +void TryInflictIngrainStatus(struct entity *user, struct entity *target); +void TryInflictWrappedStatus(struct entity *user, struct entity *target); +void FreeOtherWrappedMonsters(struct entity *entity); +void TryInflictPetrifiedStatus(struct entity *user, struct entity *target); +void LowerOffensiveStat(struct entity *user, struct entity *target, + int stat_idx, int16_t n_stages, bool check_is_protected_from_stat_drops, bool log_message_if_protected_from_stat_drops); -void LowerDefensiveStat(struct entity* user, struct entity* target, int stat_idx, int16_t n_stages, +void LowerDefensiveStat(struct entity *user, struct entity *target, + int stat_idx, int16_t n_stages, bool check_is_protected_from_stat_drops, bool log_message_if_protected_from_stat_drops); -void BoostOffensiveStat(struct entity* user, struct entity* target, int stat_idx, int16_t n_stages); -void BoostDefensiveStat(struct entity* user, struct entity* target, int stat_idx, int16_t n_stages); -int FlashFireShouldActivate(struct entity* attacker, struct entity* defender); -void ActivateFlashFire(struct entity* attacker, struct entity* defender); -void ApplyOffensiveStatMultiplier(struct entity* user, struct entity* target, int stat_idx, - int multiplier, undefined param_5); -void ApplyDefensiveStatMultiplier(struct entity* user, struct entity* target, int stat_idx, - int multiplier, undefined param_5); -void BoostHitChanceStat(struct entity* user, struct entity* target, int stat_idx); -void LowerHitChanceStat(struct entity* user, struct entity* target, int stat_idx, int param_4); -bool TryInflictCringeStatus(struct entity* user, struct entity* target, bool log_failure, - bool check_only); -bool TryInflictParalysisStatus(struct entity* user, struct entity* target, bool log_failure, - bool check_only); -void BoostSpeed(struct entity* user, struct entity* target, int n_stages, int turns, +void BoostOffensiveStat(struct entity *user, struct entity *target, + int stat_idx, int16_t n_stages); +void BoostDefensiveStat(struct entity *user, struct entity *target, + int stat_idx, int16_t n_stages); +int FlashFireShouldActivate(struct entity *attacker, struct entity *defender); +void ActivateFlashFire(struct entity *attacker, struct entity *defender); +void ApplyOffensiveStatMultiplier(struct entity *user, struct entity *target, + int stat_idx, int multiplier, + undefined param_5); +void ApplyDefensiveStatMultiplier(struct entity *user, struct entity *target, + int stat_idx, int multiplier, + undefined param_5); +void BoostHitChanceStat(struct entity *user, struct entity *target, + int stat_idx); +void LowerHitChanceStat(struct entity *user, struct entity *target, + int stat_idx, int param_4); +bool TryInflictCringeStatus(struct entity *user, struct entity *target, + bool log_failure, bool check_only); +bool TryInflictParalysisStatus(struct entity *user, struct entity *target, + bool log_failure, bool check_only); +void BoostSpeed(struct entity *user, struct entity *target, int n_stages, + int turns, bool log_failure); +void BoostSpeedOneStage(struct entity *user, struct entity *target, int turns, + bool log_failure); +void LowerSpeed(struct entity *user, struct entity *target, int n_stages, bool log_failure); -void BoostSpeedOneStage(struct entity* user, struct entity* target, int turns, bool log_failure); -void LowerSpeed(struct entity* user, struct entity* target, int n_stages, bool log_failure); -bool TrySealMove(struct entity* user, struct entity* target, bool only_check); -void BoostOrLowerSpeed(struct entity* user, struct entity* target); -void ResetHitChanceStat(struct entity* user, struct entity* target, int stat_idx, int param_4); -bool ExclusiveItemEffectIsActiveWithLogging(struct entity* user, struct entity* target, - bool should_log, int message_id, - enum exclusive_item_effect_id effect_id); -bool TryActivateQuickFeet(struct entity* attacker, struct entity* defender); -void TryInflictTerrifiedStatus(struct entity* user, struct entity* target); -bool TryInflictGrudgeStatus(struct entity* user, struct entity* target, bool log_message); -bool TryInflictConfusedStatus(struct entity* user, struct entity* target, bool log_failure, - bool check_only); -bool TryInflictCoweringStatus(struct entity* user, struct entity* target, bool log_failure, - bool check_only); -bool TryRestoreHp(struct entity* user, struct entity* target, int hp_restoration); -bool TryIncreaseHp(struct entity* user, struct entity* target, int hp_restoration, int max_hp_boost, - bool log_failure); -void RevealItems(struct entity* user, struct entity* target); -void RevealStairs(struct entity* user, struct entity* target); -void RevealEnemies(struct entity* user, struct entity* target); -bool TryInflictLeechSeedStatus(struct entity* user, struct entity* target, bool log_failure, - bool check_only); -void TryInflictDestinyBondStatus(struct entity* user, struct entity* target); -void TryInflictSureShotStatus(struct entity* user, struct entity* target, uint8_t turns); -void TryInflictWhifferStatus(struct entity* user, struct entity* target, uint8_t turns, - bool only_check); -void TryInflictSetDamageStatus(struct entity* user, struct entity* target); -void TryInflictFocusEnergyStatus(struct entity* user, struct entity* target); -bool TryInflictDecoyStatus(struct entity* user, struct entity* target, undefined unk_decoy_tracker, - bool log_message, bool only_check); -void TryInflictCurseStatus(struct entity* user, struct entity* target, bool log_message); -void TryInflictSnatchStatus(struct entity* user, struct entity* target); -bool TryInflictTauntStatus(struct entity* user, struct entity* target, bool only_check); -bool TryInflictStockpileStatus(struct entity* user, struct entity* target); -void TryInflictInvisibleStatus(struct entity* user, struct entity* target); -bool TryInflictPerishSongStatus(struct entity* user, struct entity* target, bool only_check); -bool TryInflictEncoreStatus(struct entity* user, struct entity* target, bool only_check); -void TryDecreaseBelly(struct entity* user, struct entity* target, int belly_lost, - int max_belly_shrink); -void TryIncreaseBelly(struct entity* user, struct entity* target, int belly_restoration, - int max_belly_boost, bool log_failure); -bool TryInflictMuzzledStatus(struct entity* user, struct entity* target, bool only_check); -void TryTransform(struct entity* user, struct entity* target); -void TryInflictMobileStatus(struct entity* user, struct entity* target); -bool TryInflictExposedStatus(struct entity* user, struct entity* target, int effect_id, +bool TrySealMove(struct entity *user, struct entity *target, bool only_check); +void BoostOrLowerSpeed(struct entity *user, struct entity *target); +void ResetHitChanceStat(struct entity *user, struct entity *target, + int stat_idx, int param_4); +bool ExclusiveItemEffectIsActiveWithLogging( + struct entity *user, struct entity *target, bool should_log, int message_id, + enum exclusive_item_effect_id effect_id); +bool TryActivateQuickFeet(struct entity *attacker, struct entity *defender); +void TryInflictTerrifiedStatus(struct entity *user, struct entity *target); +bool TryInflictGrudgeStatus(struct entity *user, struct entity *target, + bool log_message); +bool TryInflictConfusedStatus(struct entity *user, struct entity *target, + bool log_failure, bool check_only); +bool TryInflictCoweringStatus(struct entity *user, struct entity *target, + bool log_failure, bool check_only); +bool TryRestoreHp(struct entity *user, struct entity *target, + int hp_restoration); +bool TryIncreaseHp(struct entity *user, struct entity *target, + int hp_restoration, int max_hp_boost, bool log_failure); +void RevealItems(struct entity *user, struct entity *target); +void RevealStairs(struct entity *user, struct entity *target); +void RevealEnemies(struct entity *user, struct entity *target); +bool TryInflictLeechSeedStatus(struct entity *user, struct entity *target, + bool log_failure, bool check_only); +void TryInflictDestinyBondStatus(struct entity *user, struct entity *target); +void TryInflictSureShotStatus(struct entity *user, struct entity *target, + uint8_t turns); +void TryInflictWhifferStatus(struct entity *user, struct entity *target, + uint8_t turns, bool only_check); +void TryInflictSetDamageStatus(struct entity *user, struct entity *target); +void TryInflictFocusEnergyStatus(struct entity *user, struct entity *target); +bool TryInflictDecoyStatus(struct entity *user, struct entity *target, + undefined unk_decoy_tracker, bool log_message, + bool only_check); +void TryInflictCurseStatus(struct entity *user, struct entity *target, + bool log_message); +void TryInflictSnatchStatus(struct entity *user, struct entity *target); +bool TryInflictTauntStatus(struct entity *user, struct entity *target, + bool only_check); +bool TryInflictStockpileStatus(struct entity *user, struct entity *target); +void TryInflictInvisibleStatus(struct entity *user, struct entity *target); +bool TryInflictPerishSongStatus(struct entity *user, struct entity *target, + bool only_check); +bool TryInflictEncoreStatus(struct entity *user, struct entity *target, + bool only_check); +void TryDecreaseBelly(struct entity *user, struct entity *target, + int belly_lost, int max_belly_shrink); +void TryIncreaseBelly(struct entity *user, struct entity *target, + int belly_restoration, int max_belly_boost, + bool log_failure); +bool TryInflictMuzzledStatus(struct entity *user, struct entity *target, bool only_check); -void TryActivateIdentifyCondition(struct entity* user, struct entity* target); -bool TryInflictBlinkerStatus(struct entity* user, struct entity* target, bool check_only, - bool is_permanent); -bool IsBlinded(struct entity* entity, bool check_held_item); -bool TryInflictCrossEyedStatus(struct entity* user, struct entity* target, bool check_only); -void TryInflictEyedropStatus(struct entity* user, struct entity* target); -bool TryInflictSlipStatus(struct entity* user, struct entity* target); -bool TryInflictDropeyeStatus(struct entity* user, struct entity* target); -void RestoreAllMovePP(struct entity* user, struct entity* target, int pp, bool suppress_logs); -void RestoreOneMovePP(struct entity* user, struct entity* target, int move_index, int pp, - bool log_message); -void RestoreRandomMovePP(struct entity* user, struct entity* target, int pp, bool log_message); -void ApplyProteinEffect(struct entity* user, struct entity* target, int stat_boost); -void ApplyCalciumEffect(struct entity* user, struct entity* target, int stat_boost); -void ApplyIronEffect(struct entity* user, struct entity* target, int stat_boost); -void ApplyZincEffect(struct entity* user, struct entity* target, int stat_boost); -void TryInflictLongTossStatus(struct entity* user, struct entity* target); -void TryInflictPierceStatus(struct entity* user, struct entity* target); -bool TryInflictGastroAcidStatus(struct entity* user, struct entity* target, bool log_message, - bool check_only); -void SetAquaRingHealingCountdownTo4(struct entity* entity); -void ApplyAquaRingHealing(struct entity* entity); -void TryInflictAquaRingStatus(struct entity* user, struct entity* target); -void TryInflictLuckyChantStatus(struct entity* user, struct entity* target); -bool TryInflictHealBlockStatus(struct entity* user, struct entity* target, bool log_message, +void TryTransform(struct entity *user, struct entity *target); +void TryInflictMobileStatus(struct entity *user, struct entity *target); +bool TryInflictExposedStatus(struct entity *user, struct entity *target, + int effect_id, bool only_check); +void TryActivateIdentifyCondition(struct entity *user, struct entity *target); +bool TryInflictBlinkerStatus(struct entity *user, struct entity *target, + bool check_only, bool is_permanent); +bool IsBlinded(struct entity *entity, bool check_held_item); +bool TryInflictCrossEyedStatus(struct entity *user, struct entity *target, bool check_only); -bool MonsterHasEmbargoStatus(struct entity* entity); -void LogItemBlockedByEmbargo(struct entity* entity); -bool TryInflictEmbargoStatus(struct entity* user, struct entity* target, bool log_message, - bool check_only); -bool TryInflictMiracleEyeStatus(struct entity* user, struct entity* target, bool check_only); -void TryInflictMagnetRiseStatus(struct entity* user, struct entity* target); -bool IsFloating(struct entity* entity); -void SetTwoTurnInvincibility(struct entity* target, enum two_turn_invincibility value); -void SetReflectStatus(struct entity* user, struct entity* target, enum status_reflect_id status); -void TryInflictSafeguardStatus(struct entity* user, struct entity* target); -void TryInflictMistStatus(struct entity* user, struct entity* target); -void TryInflictWishStatus(struct entity* user, struct entity* target); -void TryInflictMagicCoatStatus(struct entity* user, struct entity* target); -void TryInflictLightScreenStatus(struct entity* user, struct entity* target); -void TryInflictReflectStatus(struct entity* user, struct entity* target); -void TryInflictProtectStatus(struct entity* user, struct entity* target); -void TryInflictMirrorCoatStatus(struct entity* user, struct entity* target); -void TryInflictEndureStatus(struct entity* user, struct entity* target); -void TryInflictMirrorMoveStatus(struct entity* user, struct entity* target); -void TryInflictConversion2Status(struct entity* user, struct entity* target); -void TryInflictVitalThrowStatus(struct entity* user, struct entity* target); -void TryResetStatChanges(struct entity* attacker, struct entity* defender, bool force_animation); -int MirrorMoveIsActive(struct entity* entity); -int MistIsActive(struct entity* entity); -int Conversion2IsActive(struct entity* entity); +void TryInflictEyedropStatus(struct entity *user, struct entity *target); +bool TryInflictSlipStatus(struct entity *user, struct entity *target); +bool TryInflictDropeyeStatus(struct entity *user, struct entity *target); +void RestoreAllMovePP(struct entity *user, struct entity *target, int pp, + bool suppress_logs); +void RestoreOneMovePP(struct entity *user, struct entity *target, + int move_index, int pp, bool log_message); +void RestoreRandomMovePP(struct entity *user, struct entity *target, int pp, + bool log_message); +void ApplyProteinEffect(struct entity *user, struct entity *target, + int stat_boost); +void ApplyCalciumEffect(struct entity *user, struct entity *target, + int stat_boost); +void ApplyIronEffect(struct entity *user, struct entity *target, + int stat_boost); +void ApplyZincEffect(struct entity *user, struct entity *target, + int stat_boost); +void TryInflictLongTossStatus(struct entity *user, struct entity *target); +void TryInflictPierceStatus(struct entity *user, struct entity *target); +bool TryInflictGastroAcidStatus(struct entity *user, struct entity *target, + bool log_message, bool check_only); +void SetAquaRingHealingCountdownTo4(struct entity *entity); +void ApplyAquaRingHealing(struct entity *entity); +void TryInflictAquaRingStatus(struct entity *user, struct entity *target); +void TryInflictLuckyChantStatus(struct entity *user, struct entity *target); +bool TryInflictHealBlockStatus(struct entity *user, struct entity *target, + bool log_message, bool check_only); +bool MonsterHasEmbargoStatus(struct entity *entity); +void LogItemBlockedByEmbargo(struct entity *entity); +bool TryInflictEmbargoStatus(struct entity *user, struct entity *target, + bool log_message, bool check_only); +bool TryInflictMiracleEyeStatus(struct entity *user, struct entity *target, + bool check_only); +void TryInflictMagnetRiseStatus(struct entity *user, struct entity *target); +bool IsFloating(struct entity *entity); +void SetTwoTurnInvincibility(struct entity *target, + enum two_turn_invincibility value); +void SetReflectStatus(struct entity *user, struct entity *target, + enum status_reflect_id status); +void TryInflictSafeguardStatus(struct entity *user, struct entity *target); +void TryInflictMistStatus(struct entity *user, struct entity *target); +void TryInflictWishStatus(struct entity *user, struct entity *target); +void TryInflictMagicCoatStatus(struct entity *user, struct entity *target); +void TryInflictLightScreenStatus(struct entity *user, struct entity *target); +void TryInflictReflectStatus(struct entity *user, struct entity *target); +void TryInflictProtectStatus(struct entity *user, struct entity *target); +void TryInflictMirrorCoatStatus(struct entity *user, struct entity *target); +void TryInflictEndureStatus(struct entity *user, struct entity *target); +void TryInflictMirrorMoveStatus(struct entity *user, struct entity *target); +void TryInflictConversion2Status(struct entity *user, struct entity *target); +void TryInflictVitalThrowStatus(struct entity *user, struct entity *target); +void TryResetStatChanges(struct entity *attacker, struct entity *defender, + bool force_animation); +int MirrorMoveIsActive(struct entity *entity); +int MistIsActive(struct entity *entity); +int Conversion2IsActive(struct entity *entity); void ResetAiCanAttackInDirection(void); -int AiConsiderMove(struct ai_possible_move* ai_possible_move, struct entity* monster, - struct move* move); -int TryAddTargetToAiTargetList(int current_num_targets, struct move_target_and_range move_ai_range, - struct entity* user, struct entity* target, struct move* move, - bool check_all_conditions); -bool IsAiTargetEligible(struct move_target_and_range move_ai_range, struct entity* user, - struct entity* target, struct move* move, bool check_all_conditions); -int WeightMoveWithIqSkills(struct entity* user, struct move_target_and_range move_ai_range, - struct entity* target, enum type_id move_type); -bool TargetRegularAttack(struct entity* user, enum direction_id* direction, bool skip_petrified); -bool IsTargetInRange(struct entity* user, struct entity* target, enum direction_id direction, - int n_tiles); -bool ShouldUsePp(struct entity* entity); -struct move_target_and_range GetEntityMoveTargetAndRange(struct entity* entity, struct move* move, +int AiConsiderMove(struct ai_possible_move *ai_possible_move, + struct entity *monster, struct move *move); +int TryAddTargetToAiTargetList(int current_num_targets, + struct move_target_and_range move_ai_range, + struct entity *user, struct entity *target, + struct move *move, bool check_all_conditions); +bool IsAiTargetEligible(struct move_target_and_range move_ai_range, + struct entity *user, struct entity *target, + struct move *move, bool check_all_conditions); +int WeightMoveWithIqSkills(struct entity *user, + struct move_target_and_range move_ai_range, + struct entity *target, enum type_id move_type); +bool TargetRegularAttack(struct entity *user, enum direction_id *direction, + bool skip_petrified); +bool IsTargetInRange(struct entity *user, struct entity *target, + enum direction_id direction, int n_tiles); +bool ShouldUsePp(struct entity *entity); +struct move_target_and_range GetEntityMoveTargetAndRange(struct entity *entity, + struct move *move, bool is_ai); -struct natural_gift_item_info* GetEntityNaturalGiftInfo(struct entity* entity); -enum type_id GetEntityWeatherBallType(struct entity* entity); -void UseMoveByMoveId(struct entity* entity, enum move_id move_id, bool add_move_if_not_exists); -void ActivateMotorDrive(struct entity* entity); -void TryActivateFrisk(struct entity* attacker, struct entity* defender); -void TryActivateBadDreams(struct entity* entity); -void ActivateStench(struct entity* entity); -void TryActivateSteadfast(struct entity* attacker, struct entity* defender); -bool IsInSpawnList(undefined* spawn_list, enum monster_id monster_id); -int ChangeShayminForme(struct entity* entity, int forme); +struct natural_gift_item_info *GetEntityNaturalGiftInfo(struct entity *entity); +enum type_id GetEntityWeatherBallType(struct entity *entity); +void UseMoveByMoveId(struct entity *entity, enum move_id move_id, + bool add_move_if_not_exists); +void ActivateMotorDrive(struct entity *entity); +void TryActivateFrisk(struct entity *attacker, struct entity *defender); +void TryActivateBadDreams(struct entity *entity); +void ActivateStench(struct entity *entity); +void TryActivateSteadfast(struct entity *attacker, struct entity *defender); +bool IsInSpawnList(undefined *spawn_list, enum monster_id monster_id); +int ChangeShayminForme(struct entity *entity, int forme); void ApplyItemEffect(undefined4 param_1, undefined4 param_2, undefined4 param_3, - struct entity* attacker, struct entity* defender, struct item* thrown_item); -void ApplyCheriBerryEffect(struct entity* user, struct entity* target); -void ApplyPechaBerryEffect(struct entity* user, struct entity* target); -void ApplyRawstBerryEffect(struct entity* user, struct entity* target); -void ApplyHungerSeedEffect(struct entity* user, struct entity* target); -void ApplyVileSeedEffect(struct entity* user, struct entity* target); -void ApplyViolentSeedEffect(struct entity* user, struct entity* target); -void ApplyGinsengEffect(struct entity* user, struct entity* target); -void ApplyBlastSeedEffect(struct entity* user, struct entity* target, bool thrown); -void ApplyGummiBoostsDungeonMode(struct entity* user, struct entity* target, - enum type_id gummi_type, int random_stat_boost); -bool CanMonsterUseItem(struct entity* entity, struct item* item); -void ApplyGrimyFoodEffect(struct entity* user, struct entity* target); -void ApplyMixElixirEffect(struct entity* user, struct entity* target); -void ApplyDoughSeedEffect(struct entity* user, struct entity* target); -void ApplyViaSeedEffect(struct entity* user, struct entity* target); -void ApplyGravelyrockEffect(struct entity* user, struct entity* target); -void ApplyGonePebbleEffect(struct entity* user, struct entity* target); -void ApplyGracideaEffect(struct entity* user, struct entity* target); -int GetAiUseItemProbability(struct entity* item_consumer, struct item* item, uint32_t flags); -bool IsAdjacentToEnemy(struct entity* entity); + struct entity *attacker, struct entity *defender, + struct item *thrown_item); +void ApplyCheriBerryEffect(struct entity *user, struct entity *target); +void ApplyPechaBerryEffect(struct entity *user, struct entity *target); +void ApplyRawstBerryEffect(struct entity *user, struct entity *target); +void ApplyHungerSeedEffect(struct entity *user, struct entity *target); +void ApplyVileSeedEffect(struct entity *user, struct entity *target); +void ApplyViolentSeedEffect(struct entity *user, struct entity *target); +void ApplyGinsengEffect(struct entity *user, struct entity *target); +void ApplyBlastSeedEffect(struct entity *user, struct entity *target, + bool thrown); +void ApplyGummiBoostsDungeonMode(struct entity *user, struct entity *target, + enum type_id gummi_type, + int random_stat_boost); +bool CanMonsterUseItem(struct entity *entity, struct item *item); +void ApplyGrimyFoodEffect(struct entity *user, struct entity *target); +void ApplyMixElixirEffect(struct entity *user, struct entity *target); +void ApplyDoughSeedEffect(struct entity *user, struct entity *target); +void ApplyViaSeedEffect(struct entity *user, struct entity *target); +void ApplyGravelyrockEffect(struct entity *user, struct entity *target); +void ApplyGonePebbleEffect(struct entity *user, struct entity *target); +void ApplyGracideaEffect(struct entity *user, struct entity *target); +int GetAiUseItemProbability(struct entity *item_consumer, struct item *item, + uint32_t flags); +bool IsAdjacentToEnemy(struct entity *entity); bool ShouldTryEatItem(enum item_id item_id); -int GetMaxPpWrapper(struct move* move); -void InitMoveWrapper(undefined4 param_1, struct move* move, enum move_id move_id); +int GetMaxPpWrapper(struct move *move); +void InitMoveWrapper(undefined4 param_1, struct move *move, + enum move_id move_id); bool MoveIsNotPhysical(enum move_id move_id); bool CategoryIsNotPhysical(enum move_category category_id); -void MakeFloorOneRoom(struct entity* user); -void TryHurl(struct entity* user, struct entity* target); -void TryDrought(struct entity* user); -void TryTrawl(struct entity* user); -void TryPounce(struct entity* user, struct entity* target, enum direction_id direction); -void TryBlowAway(struct entity* user, struct entity* target, enum direction_id direction); -void TryExplosion(struct entity* user, struct entity* target, struct position* pos, int radius, - enum type_id attack_type, union damage_source damage_source); -void TryAftermathExplosion(struct entity* user, struct entity* target, struct position* pos, - int radius, enum type_id attack_type, union damage_source damage_source); -void TryWarp(struct entity* user, struct entity* target, enum warp_type warp_type, - struct position* position); -void EnsureCanStandCurrentTile(struct entity* entity); -void UseMove(struct entity* entity, uint16_t move_index, undefined4 param_3, undefined4 param_4, - undefined4 param5); -void TryActivateNondamagingDefenderAbility(struct entity* entity); -void TryActivateNondamagingDefenderExclusiveItem(struct entity* attacker, struct entity* defender); -int GetMoveRangeDistance(struct entity* user, struct move* move, bool check_two_turn_moves); -bool MoveHitCheck(struct entity* attacker, struct entity* defender, struct move* move, - bool use_second_accuracy, bool never_miss_self); -void BuildMoveTargetList(struct target_list* output, struct entity* user, struct move* move); -bool IsHyperBeamVariant(struct move* move); -bool IsChargingTwoTurnMove(struct entity* user, struct move* move); -bool IsChargingAnyTwoTurnMove(struct entity* entity, bool charge_check_unused); -bool HasMaxGinsengBoost99(struct move* move); -bool TwoTurnMoveForcedMiss(struct entity* target, struct move* move); -bool DungeonRandOutcomeUserTargetInteraction(struct entity* user, struct entity* target, +void MakeFloorOneRoom(struct entity *user); +void TryHurl(struct entity *user, struct entity *target); +void TryDrought(struct entity *user); +void TryTrawl(struct entity *user); +void TryPounce(struct entity *user, struct entity *target, + enum direction_id direction); +void TryBlowAway(struct entity *user, struct entity *target, + enum direction_id direction); +void TryExplosion(struct entity *user, struct entity *target, + struct position *pos, int radius, enum type_id attack_type, + union damage_source damage_source); +void TryAftermathExplosion(struct entity *user, struct entity *target, + struct position *pos, int radius, + enum type_id attack_type, + union damage_source damage_source); +void TryWarp(struct entity *user, struct entity *target, + enum warp_type warp_type, struct position *position); +void EnsureCanStandCurrentTile(struct entity *entity); +void UseMove(struct entity *entity, uint16_t move_index, undefined4 param_3, + undefined4 param_4, undefined4 param5); +void TryActivateNondamagingDefenderAbility(struct entity *entity); +void TryActivateNondamagingDefenderExclusiveItem(struct entity *attacker, + struct entity *defender); +int GetMoveRangeDistance(struct entity *user, struct move *move, + bool check_two_turn_moves); +bool MoveHitCheck(struct entity *attacker, struct entity *defender, + struct move *move, bool use_second_accuracy, + bool never_miss_self); +void BuildMoveTargetList(struct target_list *output, struct entity *user, + struct move *move); +bool IsHyperBeamVariant(struct move *move); +bool IsChargingTwoTurnMove(struct entity *user, struct move *move); +bool IsChargingAnyTwoTurnMove(struct entity *entity, bool charge_check_unused); +bool HasMaxGinsengBoost99(struct move *move); +bool TwoTurnMoveForcedMiss(struct entity *target, struct move *move); +bool DungeonRandOutcomeUserTargetInteraction(struct entity *user, + struct entity *target, int percentage); -bool DungeonRandOutcomeUserAction(struct entity* user, int percentage); -bool CanAiUseMove(struct entity* monster, int move_index, bool extra_checks); -bool CanMonsterUseMove(struct entity* monster, struct move* move, bool extra_checks); -void UpdateMovePp(struct entity* entity, bool can_consume_pp); -union damage_source GetDamageSourceWrapper(struct move* move, enum item_id item_id); +bool DungeonRandOutcomeUserAction(struct entity *user, int percentage); +bool CanAiUseMove(struct entity *monster, int move_index, bool extra_checks); +bool CanMonsterUseMove(struct entity *monster, struct move *move, + bool extra_checks); +void UpdateMovePp(struct entity *entity, bool can_consume_pp); +union damage_source GetDamageSourceWrapper(struct move *move, + enum item_id item_id); int LowerSshort(int x); -void PlayMoveAnimation(struct entity* user, struct entity* target, struct move* move, - struct position* position); -uint16_t GetMoveAnimationId(struct move* move, enum weather_id apparent_weather, +void PlayMoveAnimation(struct entity *user, struct entity *target, + struct move *move, struct position *position); +uint16_t GetMoveAnimationId(struct move *move, enum weather_id apparent_weather, bool should_play_alternative_animation); -bool ShouldMovePlayAlternativeAnimation(struct entity* user, struct move* move); -void ExecuteMoveEffect(struct target_list* targets, struct entity* attacker, struct move* move, - undefined4 param_4, undefined4 param_5); -bool DoMoveDamageInlined(struct entity* attacker, struct entity* defender, struct move* move, +bool ShouldMovePlayAlternativeAnimation(struct entity *user, struct move *move); +void ExecuteMoveEffect(struct target_list *targets, struct entity *attacker, + struct move *move, undefined4 param_4, + undefined4 param_5); +bool DoMoveDamageInlined(struct entity *attacker, struct entity *defender, + struct move *move, enum item_id item_id); +int DealDamage(struct entity *attacker, struct entity *defender, + struct move *move, fx32_8 damage_mult_fp, enum item_id item_id); +int DealDamageWithTypeAndPowerBoost(struct entity *attacker, + struct entity *defender, struct move *move, + fx32_8 damage_mult_fp, enum item_id item_id, + enum type_id attack_type, + int16_t power_boost); +int DealDamageProjectile(struct entity *attacker, struct entity *defender, + struct move *move, int power, fx32_8 damage_mult_fp, enum item_id item_id); -int DealDamage(struct entity* attacker, struct entity* defender, struct move* move, - fx32_8 damage_mult_fp, enum item_id item_id); -int DealDamageWithTypeAndPowerBoost(struct entity* attacker, struct entity* defender, - struct move* move, fx32_8 damage_mult_fp, enum item_id item_id, - enum type_id attack_type, int16_t power_boost); -int DealDamageProjectile(struct entity* attacker, struct entity* defender, struct move* move, - int power, fx32_8 damage_mult_fp, enum item_id item_id); -int DealDamageWithType(struct entity* attacker, struct entity* defender, enum type_id attack_type, - struct move* move, fx32_8 damage_mult_fp, enum item_id item_id); -int PerformDamageSequence(struct entity* attacker, struct entity* defender, struct move* move, - struct damage_data* damage_out, union damage_source damage_source); -bool CanHitWithRegularAttack(struct entity* attacker, struct entity* defender); -bool StatusCheckerCheck(struct entity* attacker, struct move* move); -bool StatusCheckerCheckOnTarget(struct entity* attacker, struct entity* target, struct move* move); -bool HasLastUsedMove(struct move* moves); -enum weather_id GetApparentWeather(struct entity* entity); -void TryWeatherFormChange(struct entity* entity); +int DealDamageWithType(struct entity *attacker, struct entity *defender, + enum type_id attack_type, struct move *move, + fx32_8 damage_mult_fp, enum item_id item_id); +int PerformDamageSequence(struct entity *attacker, struct entity *defender, + struct move *move, struct damage_data *damage_out, + union damage_source damage_source); +bool CanHitWithRegularAttack(struct entity *attacker, struct entity *defender); +bool StatusCheckerCheck(struct entity *attacker, struct move *move); +bool StatusCheckerCheckOnTarget(struct entity *attacker, struct entity *target, + struct move *move); +bool HasLastUsedMove(struct move *moves); +enum weather_id GetApparentWeather(struct entity *entity); +void TryWeatherFormChange(struct entity *entity); void ActivateSportCondition(bool water_sport); bool TryActivateWeather(bool param_1, bool param_2); int DigitCount(int n); void LoadTextureUi(void); -int GetPaletteBaseAddressOv29(undefined4 pal_vram_offset_upper, undefined4 pal_vram_offset_lower); +int GetPaletteBaseAddressOv29(undefined4 pal_vram_offset_upper, + undefined4 pal_vram_offset_lower); int DisplayNumberTextureUi(int16_t x, int16_t y, int n, int ally_mode); -int DisplayCharTextureUi(struct render_3d_element_64* element64, int16_t x, int16_t y, int char_id, - int16_t param_5); +int DisplayCharTextureUi(struct render_3d_element_64 *element64, int16_t x, + int16_t y, int char_id, int16_t param_5); void DisplayUi(void); -struct tile* GetTile(int x, int y); -struct tile* GetTileSafe(int x, int y); +struct tile *GetTile(int x, int y); +struct tile *GetTileSafe(int x, int y); bool IsFullFloorFixedRoom(void); bool IsCurrentTilesetBackground(void); void TrySpawnGoldenChamber(void); void CountItemsOnFloorForAcuteSniffer(void); -void GetStairsSpawnPosition(int16_t* x, int16_t* y); +void GetStairsSpawnPosition(int16_t *x, int16_t *y); bool PositionIsOnStairs(int x, int y); uint8_t GetStairsRoom(void); uint16_t GetDefaultTileTextureId(void); void DetermineAllTilesWalkableNeighbors(void); void DetermineTileWalkableNeighbors(int x, int y); void UpdateTrapsVisibility(void); -void DrawTileGrid(struct position* pos, undefined param_2, undefined param_3, undefined param_4); +void DrawTileGrid(struct position *pos, undefined param_2, undefined param_3, + undefined param_4); void HideTileGrid(void); -void DiscoverMinimap(struct position* pos); -bool PositionHasItem(struct position* pos); -bool PositionHasMonster(struct position* pos); -bool TrySmashWall(struct position* pos); -bool IsTileGround(struct position* pos); +void DiscoverMinimap(struct position *pos); +bool PositionHasItem(struct position *pos); +bool PositionHasMonster(struct position *pos); +bool TrySmashWall(struct position *pos); +bool IsTileGround(struct position *pos); bool IsWaterTileset(void); enum monster_id GetRandomSpawnMonsterID(void); -bool NearbyAllyIqSkillIsEnabled(struct entity* entity, enum iq_skill_id iq_skill); -struct entity* FindAdjacentEnemy(struct entity* monster); -bool IsAdjacentToEnemyIgnoreTreatment(struct entity* monster); +bool NearbyAllyIqSkillIsEnabled(struct entity *entity, + enum iq_skill_id iq_skill); +struct entity *FindAdjacentEnemy(struct entity *monster); +bool IsAdjacentToEnemyIgnoreTreatment(struct entity *monster); void ResetGravity(void); bool GravityIsActive(void); bool TryActivateGravity(void); -void RevealAttackedTile(struct position* pos); +void RevealAttackedTile(struct position *pos); void ResetVictoryCounter(void); bool ShouldBoostKecleonShopSpawnChance(void); void SetShouldBoostKecleonShopSpawnChance(bool value); @@ -843,7 +1018,7 @@ bool IsSecretRoom(void); bool IsSecretFloor(void); enum hidden_stairs_type GetCurrentHiddenStairsType(void); bool HiddenStairsPresent(void); -bool PositionIsOnHiddenStairs(struct position* position); +bool PositionIsOnHiddenStairs(struct position *position); void HiddenStairsTrigger(bool show_message); enum hidden_stairs_type GetHiddenStairsField(void); void SetHiddenStairsField(enum hidden_stairs_type hidden_stairs); @@ -851,7 +1026,7 @@ enum hidden_stairs_type GetHiddenFloorField(void); void SetHiddenFloorField(enum hidden_stairs_type hidden_floor); void LoadWeather3DFiles(void); void RenderWeather3D(void); -struct minimap_display_data* GetMinimapData(void); +struct minimap_display_data *GetMinimapData(void); void DrawMinimapTile(int x, int y); void FlashLeaderIcon(undefined param_1); void UpdateMinimap(void); @@ -859,225 +1034,50 @@ void SetMinimapDataE447(uint8_t value); uint8_t GetMinimapDataE447(void); void SetMinimapDataE448(uint8_t value); void InitWeirdMinimapMatrix(void); -void InitMinimapDisplayTile(struct minimap_display_tile* minimap_display_tile, undefined* ptr); +void InitMinimapDisplayTile(struct minimap_display_tile *minimap_display_tile, + undefined *ptr); void LoadFixedRoomDataVeneer(void); void UnloadFixedRoomData(void); bool IsNormalFloor(void); void GenerateFloor(void); -enum terrain_type GetTileTerrain(struct tile* tile); +enum terrain_type GetTileTerrain(struct tile *tile); uint32_t DungeonRand100(void); void ClearHiddenStairs(void); void FlagHallwayJunctions(int x0, int y0, int x1, int y1); -void GenerateStandardFloor(int grid_size_x, int grid_size_y, struct floor_properties* floor_props); -void GenerateOuterRingFloor(struct floor_properties* floor_props); -void GenerateCrossroadsFloor(struct floor_properties* floor_props); -void GenerateLineFloor(struct floor_properties* floor_props); -void GenerateCrossFloor(struct floor_properties* floor_props); -void GenerateBeetleFloor(struct floor_properties* floor_props); -void MergeRoomsVertically(int x, int y0, int dy, struct dungeon_grid_cell* grid); +void GenerateStandardFloor(int grid_size_x, int grid_size_y, + struct floor_properties *floor_props); +void GenerateOuterRingFloor(struct floor_properties *floor_props); +void GenerateCrossroadsFloor(struct floor_properties *floor_props); +void GenerateLineFloor(struct floor_properties *floor_props); +void GenerateCrossFloor(struct floor_properties *floor_props); +void GenerateBeetleFloor(struct floor_properties *floor_props); +void MergeRoomsVertically(int x, int y0, int dy, + struct dungeon_grid_cell *grid); void GenerateOuterRoomsFloor(int grid_size_x, int grid_size_y, - struct floor_properties* floor_props); + struct floor_properties *floor_props); bool IsNotFullFloorFixedRoom(enum fixed_room_id fixed_room_id); -bool GenerateFixedRoom(enum fixed_room_id fixed_room_id, struct floor_properties* floor_props); +bool GenerateFixedRoom(enum fixed_room_id fixed_room_id, + struct floor_properties *floor_props); void GenerateOneRoomMonsterHouseFloor(void); void GenerateTwoRoomsWithMonsterHouseFloor(void); -void GenerateExtraHallways(struct dungeon_grid_cell* grid, int grid_size_x, int grid_size_y, - int n_extra_hallways); -void GetGridPositions(int* grid_starts_x, int* grid_starts_y, int grid_size_x, int grid_size_y); -void InitDungeonGrid(struct dungeon_grid_cell* grid, int grid_size_x, int grid_size_y); -void AssignRooms(struct dungeon_grid_cell* grid, int grid_size_x, int grid_size_y, int n_rooms); -void CreateRoomsAndAnchors(struct dungeon_grid_cell* grid, int grid_size_x, int grid_size_y, - int* grid_starts_x, int* grid_starts_y, struct room_flags room_flags); -void GenerateSecondaryStructures(struct dungeon_grid_cell* grid, int grid_size_x, int grid_size_y); -void AssignGridCellConnections(struct dungeon_grid_cell* grid, int grid_size_x, int grid_size_y, - int cursor_x, int cursor_y, struct floor_properties* floor_props); -void CreateGridCellConnections(struct dungeon_grid_cell* grid, int grid_size_x, int grid_size_y, - int* grid_starts_x, int* grid_starts_y, bool disable_room_merging); -void GenerateRoomImperfections(struct dungeon_grid_cell* grid, int grid_size_x, int grid_size_y); -void CreateHallway(int x0, int y0, int x1, int y1, bool vertical, int x_mid, int y_mid); -void EnsureConnectedGrid(struct dungeon_grid_cell* grid, int grid_size_x, int grid_size_y, - int* grid_starts_x, int* grid_starts_y); -void SetTerrainObstacleChecked(struct tile* tile, bool use_secondary_terrain, uint8_t room); -void FinalizeJunctions(void); -void GenerateKecleonShop(struct dungeon_grid_cell* grid, int grid_size_x, int grid_size_y, - int spawn_chance); -void GenerateMonsterHouse(struct dungeon_grid_cell* grid, int grid_size_x, int grid_size_y, - int spawn_chance); -void GenerateMazeRoom(struct dungeon_grid_cell* grid, int grid_size_x, int grid_size_y, - int spawn_chance); -void GenerateMaze(struct dungeon_grid_cell* grid_cell, bool use_secondary_terrain); -void GenerateMazeLine(int x0, int y0, int xmin, int ymin, int xmax, int ymax, - bool use_secondary_terrain, uint8_t room); -void SetSpawnFlag5(struct dungeon_grid_cell* grid_cell); -bool IsNextToHallway(int x, int y); -void ResolveInvalidSpawns(void); -void ConvertSecondaryTerrainToChasms(void); -void EnsureImpassableTilesAreWalls(void); -void InitializeTile(struct tile* tile); -void ResetFloor(void); -bool PosIsOutOfBounds(int x, int y); -void ShuffleSpawnPositions(struct spawn_position* spawn_positions, int n_spawn_positions); -void MarkNonEnemySpawns(struct floor_properties* floor_props, bool empty_monster_house); -void MarkEnemySpawns(struct floor_properties* floor_props, bool empty_monster_house); -void SetSecondaryTerrainOnWall(struct tile* tile); -void GenerateSecondaryTerrainFormations(uint8_t test_flag, struct floor_properties* floor_props); -bool StairsAlwaysReachable(int x_stairs, int y_stairs, bool mark_unreachable); -union fixed_room_action GetNextFixedRoomAction(void); -void ConvertWallsToChasms(void); -void ResetInnerBoundaryTileRows(void); -void ResetImportantSpawnPositions(struct dungeon_generation_info* gen_info); -void SpawnStairs(uint8_t* pos, struct dungeon_generation_info* gen_info, - enum hidden_stairs_type hidden_stairs_type); -enum hidden_stairs_type GetHiddenStairsType(struct dungeon_generation_info* gen_info, - struct floor_properties* floor_props); -int GetFinalKecleonShopSpawnChance(int base_kecleon_shop_chance); -void ResetHiddenStairsSpawn(void); -void PlaceFixedRoomTile(struct tile* tile, union fixed_room_action action, int x, int y, - bool place_item_or_trap); -enum direction_id FixedRoomActionParamToDirection(uint8_t fixed_room_action_param); -void ApplyKeyEffect(struct entity* user, struct entity* target); -void LoadFixedRoomData(void); -int LoadFixedRoom(int param_1, int param_2, int param_3, undefined4 param_4); -void OpenFixedBin(void); -void CloseFixedBin(void); -bool AreOrbsAllowed(enum fixed_room_id fixed_room_id); -bool AreTileJumpsAllowed(enum fixed_room_id fixed_room_id); -bool AreTrawlOrbsAllowed(enum fixed_room_id fixed_room_id); -bool AreOrbsAllowedVeneer(enum fixed_room_id fixed_room_id); -bool AreLateGameTrapsEnabled(enum fixed_room_id fixed_room_id); -bool AreMovesEnabled(enum fixed_room_id fixed_room_id); -bool IsRoomIlluminated(enum fixed_room_id fixed_room_id); -enum monster_id GetMatchingMonsterId(enum monster_id monster_id, undefined4 param_2, - undefined4 param_3); -void GenerateItemExplicit(struct item* item, enum item_id item_id, uint16_t quantity, bool sticky); -void GenerateAndSpawnItem(enum item_id item_id, int16_t x, int16_t y, uint16_t quantity, - bool sticky, bool check_in_bag); -bool IsHiddenStairsFloor(void); -bool IsSecretBazaarVeneer(void); -void InteractWithSecretBazaarNpc(struct entity* user, struct entity* shopkeeper); -void PrepareItemForPrinting(uint8_t tag_id, struct item* item); -void PrepareItemForPrinting2(struct preprocessor_args* preprocessor_args, uint8_t tag_id, - struct item* item); -void GenerateStandardItem(struct item* item, enum item_id item_id, - enum gen_item_stickiness sticky_type); -void GenerateCleanItem(struct item* item, enum item_id item_id); -void TryLeaderItemPickUp(struct position* position, bool flag); -bool SpawnItem(struct position* position, struct item* item, bool flag); -void RemoveGroundItem(struct position* position, bool update_shop_counters); -void SpawnDroppedItemWrapper(struct entity* entity, struct position* pos, struct item* item, - undefined4 param_4); -void SpawnDroppedItem(struct entity* entity, struct entity* item_entity, struct item* item, - int param_4, int16_t* dir_xy, undefined param_6); -bool TryGenerateUnownStoneDrop(struct item* item, enum monster_id monster_id); -bool HasHeldItem(struct entity* entity, enum item_id item_id); -void GenerateMoneyQuantity(struct item* item, int max_amount); -bool CheckTeamItemsFlags(int flags); -void AddHeldItemToBag(struct monster* monster); -void RemoveEmptyItemsInBagWrapper(void); -void GenerateItem(struct item* item, enum item_id item_id, uint16_t quantity, - enum gen_item_stickiness sticky_type); -void HandleCurvedProjectileThrow(struct entity* user, struct item* item, struct position* start_pos, - struct position* target_pos, - struct projectile_throw_info* projectile_throw_info); -bool DoesProjectileHitTarget(struct entity* user, struct entity* target); -void DisplayFloorCard(int duration); -void HandleFloorCard(enum dungeon_id dungeon_id, uint8_t floor, int duration, - enum hidden_stairs_type hidden_stairs_type); -void FillMissionDestinationInfo(void); -undefined4 MissionExitPrompt(int string_id); -bool IsItemUnkMissionItem2(struct item* item); -bool CheckActiveChallengeRequest(void); -struct mission_destination_info* GetMissionDestination(void); -bool IsOutlawOrChallengeRequestFloor(void); -bool IsDestinationFloor(void); -bool IsCurrentMissionType(enum mission_type type); -bool IsCurrentMissionTypeExact(enum mission_type type, union mission_subtype subtype); -bool IsOutlawMonsterHouseFloor(void); -bool IsGoldenChamber(void); -bool IsLegendaryChallengeFloor(void); -bool IsJirachiChallengeFloor(void); -bool IsDestinationFloorWithMonster(void); -void LoadMissionMonsterSprites(void); -bool MissionTargetEnemyIsDefeated(void); -void SetMissionTargetEnemyDefeated(bool defeated); -bool IsDestinationFloorWithFixedRoom(void); -enum item_id GetItemToRetrieve(void); -enum item_id GetItemToDeliver(void); -enum item_id GetSpecialTargetItem(void); -bool IsDestinationFloorWithItem(void); -bool IsDestinationFloorWithHiddenOutlaw(void); -bool IsDestinationFloorWithFleeingOutlaw(void); -enum monster_id GetMissionTargetEnemy(void); -enum monster_id GetMissionEnemyMinionGroup(int i); -void SetTargetMonsterNotFoundFlag(bool value); -bool GetTargetMonsterNotFoundFlag(void); -void ClearMissionDestinationInfo(struct mission_destination_info* mission_dest_info); -bool FloorHasMissionMonster(struct mission_destination_info* mission_dst); -struct mission* GetMissionIfActiveOnFloor(struct dungeon_floor_pair* pair, uint8_t mission_id); -void GenerateMissionEggMonster(struct mission* mission); -struct entity* GetFirstExperienceLockedTeamMember(void); -void TryCompleteMission(undefined param_1, undefined param_2); -void TreasureMemoComplete(void); -void TeleportFleeingOutlaw(void); -void InitAlertBoxInfo(void); -void FreeAlertBoxInfo(void); -void SetMessageLogGroupStartFlag(bool should_start_group); -struct preprocessor_args* GetMessageLogPreprocessorArgs(void); -void InitMessageLogPreprocessorArgs(void); -void SetMessageLogPreprocessorArgsFlagVal(uint8_t pos, uint32_t val); -void SetMessageLogPreprocessorArgsIdVal(uint8_t pos, uint32_t val); -void SetMessageLogPreprocessorArgsNumberVal(uint8_t pos, uint32_t val); -void SetMessageLogPreprocessorArgsString(uint8_t pos, char* string); -void SetMessageLogPreprocessorArgsStringToName(uint8_t pos, enum monster_id monster_id); -void SetMessageLogPreprocessorArgsSpeakerId(enum monster_id monster_id); -void SetMessageLogPreprocessorArgsSpeakerId0x30000(int16_t team_index); -void LogMessageByIdWithPopupAndAbility(struct entity* user, struct entity* target, int message_id, - int idx, int16_t val); -void WaitUntilAlertBoxTextIsLoadedWrapper(void); -void LogMessageByIdWithPopupCheckUser(struct entity* user, int message_id); -void LogMessageWithPopupCheckUser(struct entity* user, const char* message); -void LogMessageByIdQuiet(struct entity* user, int message_id); -void LogMessageQuiet(struct entity* user, const char* message); -void LogMessageByIdWithPopupCheckUserTarget(struct entity* user, struct entity* target, - int message_id); -void LogMessageWithPopupCheckUserTarget(struct entity* user, struct entity* target, - const char* message); -void LogMessageByIdQuietCheckUserTarget(struct entity* user, struct entity* target, int message_id); -void LogMessageByIdWithPopupCheckUserUnknown(struct entity* user, undefined4* param_2, - int message_id); -void LogMessageByIdWithPopup(struct entity* user, int message_id); -void LogMessageWithPopup(struct entity* user, const char* message); -void LogMessage(struct entity* user, const char* message, bool show_popup); -void LogMessageById(struct entity* user, int message_id, bool show_popup); -bool AlertBoxIsScrolling(void); -void WaitUntilAlertBoxTextIsLoaded(undefined param_1); -void InitPortraitDungeon(struct portrait_params* portrait, enum monster_id monster_id, - enum portrait_emotion emotion); -void OpenMessageLog(undefined4 param_1, undefined4 param_2); -bool RunDungeonMode(undefined4* param_1, undefined4 param_2); -void StartFadeDungeon(struct dungeon_fade* fstruct, int delta_delta_brightness, - enum fade_status_dungeon fade_type); -void StartFadeDungeonWrapper(int fade_type, int delta_delta_brightness, enum screen screen); -void HandleFadesDungeon(enum screen screen); -void HandleFadesDungeonBothScreens(); -bool DisplayFloorTip(void); -bool DisplayItemTip(enum item_id item_id); -bool DisplayDungeonTip(struct message_tip* message_tip, bool log); -void SetBothScreensWindowColorToDefault(void); -int GetPersonalityIndex(struct monster* monster); -void DisplayMessage(struct portrait_params* portrait, int message_id, bool wait_for_input); -void DisplayMessage2(struct portrait_params* portrait, int message_id, bool wait_for_input); -bool YesNoMenu(undefined param_1, int string_id, int default_option, undefined param_4); -void DisplayMessageInternal(int message_id, bool wait_for_input, struct portrait_params* portrait, - undefined4 param_4, undefined4 param_5, undefined4 param_6); -void PrintMissionCompleteString(int string_id, undefined4 param_2, undefined4 param_3, - undefined4 param_4, undefined1 param_5); -void InitSecretBazaarDialogueInfo(void); -void OpenMenu(undefined param_1, undefined param_2, bool open_bag); -void StairsMenuAfterStep(struct entity* leader, bool leave_minimap_closed_after); -int DungeonModeSetupAndShowNameKeyboard(char* str_keyboard_result, char* buffer, - undefined4 param_3); -int OthersMenuLoop(void); -undefined OthersMenu(void); - -#endif +void GenerateExtraHallways(struct dungeon_grid_cell *grid, int grid_size_x, + int grid_size_y, int n_extra_hallways); +void GetGridPositions(int *grid_starts_x, int *grid_starts_y, int grid_size_x, + int grid_size_y); +void InitDungeonGrid(struct dungeon_grid_cell *grid, int grid_size_x, + int grid_size_y); +void AssignRooms(struct dungeon_grid_cell *grid, int grid_size_x, + int grid_size_y, int n_rooms); +void CreateRoomsAndAnchors(struct dungeon_grid_cell *grid, int grid_size_x, + int grid_size_y, int *grid_starts_x, + int *grid_starts_y, struct room_flags room_flags); +void GenerateSecondaryStructures(struct dungeon_grid_cell *grid, + int grid_size_x, int grid_size_y); +void AssignGridCellConnections(struct dungeon_grid_cell *grid, int grid_size_x, + int grid_size_y, int cursor_x, int cursor_y, + struct floor_properties *floor_props); +void CreateGridCellConnections(struct dungeon_grid_cell *grid, int grid_size_x, + int grid_size_y, int *grid_starts_x, + int *grid_starts_y, bool disable_room_merging); +void GenerateRoomImperfections(struct dungeon_grid_cell *grid, int grid_size_x, + int grid_size_y); From 73b7e23b4a23c1ba40aea25886e26122171d1493 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Thu, 18 Jun 2026 22:47:15 -0400 Subject: [PATCH 092/117] Revert "Update overlay29.h" This reverts commit e3afc7198c2c4c408de23a179a75be6669b67295. --- headers/functions/overlay29.h | 1706 ++++++++++++++++----------------- 1 file changed, 853 insertions(+), 853 deletions(-) diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index caa792f2..2916f7a3 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -4,13 +4,13 @@ #include "overlay29/move_effects.h" void InitDungeonPaletteStruct(void); -struct rgba *GetWeatherColorTable(enum weather_id); -struct dungeon *DungeonAlloc(void); -struct dungeon *GetDungeonPtrMaster(void); +struct rgba* GetWeatherColorTable(enum weather_id); +struct dungeon* DungeonAlloc(void); +struct dungeon* GetDungeonPtrMaster(void); void DungeonZInit(void); void DungeonFree(void); -int RunDungeon(struct dungeon_init *dungeon_init_data, struct dungeon *dungeon); -bool EntityIsValid(struct entity *entity); +int RunDungeon(struct dungeon_init* dungeon_init_data, struct dungeon* dungeon); +bool EntityIsValid(struct entity* entity); bool FloorSecondaryTerrainIsChasm(int16_t tileset_id); enum floor_type GetFloorType(void); bool TryForcedLoss(bool skip_floor_end_check); @@ -21,91 +21,81 @@ bool FixedRoomIsSubstituteRoom(void); bool StoryRestrictionsEnabled(void); int GetScenarioBalanceVeneer(void); void FadeToBlack(void); -void SetDungeonEscapeFields(uint32_t successful_exit_tracker, - bool end_floor_no_death_check_flag); +void SetDungeonEscapeFields(uint32_t successful_exit_tracker, bool end_floor_no_death_check_flag); uint32_t GetSuccessfulExitTracker(void); void GetAndStoreButtonInput(void); bool CheckTouchscreenArea(int x1, int y1, int x2, int y2); -void *OamTileNumberToVramAddressOv29(short oam_tile_num, uint8_t screen); +void* OamTileNumberToVramAddressOv29(short oam_tile_num, uint8_t screen); void ResetDungeonColorPalette(void); -struct trap *GetTrapInfo(struct entity *trap_entity); -struct item *GetItemInfo(struct entity *item_entity); -struct tile *GetTileAtEntity(struct entity *entity); -void UpdateEntityPixelPos(struct entity *entity, - struct pixel_position *pixel_pos); -void SetEntityPixelPosXY(struct entity *entity, uint32_t x, uint32_t y); -void IncrementEntityPixelPosXY(struct entity *entity, uint32_t x, uint32_t y); -struct entity *CreateEnemyEntity(enum monster_id monster_id); -struct entity *SpawnTrap(enum trap_id trap_id, struct position *position, - uint8_t team, uint8_t flags); -struct entity *SpawnItemEntity(struct position *position); -bool ShouldMinimapDisplayEntity(struct entity *entity); -bool ShouldDisplayEntity(struct entity *entity, undefined param_2); -bool ShouldDisplayEntityWrapper(struct entity *entity); -bool CanSeeTarget(struct entity *user, struct entity *target); -bool CanTargetEntity(struct entity *user, struct entity *target); -bool IsValidTargetEntity(struct entity *user, struct entity *target); -bool CanSeePosition(struct entity *monster, struct position *position); -bool CanTargetPosition(struct entity *monster, struct position *position); +struct trap* GetTrapInfo(struct entity* trap_entity); +struct item* GetItemInfo(struct entity* item_entity); +struct tile* GetTileAtEntity(struct entity* entity); +void UpdateEntityPixelPos(struct entity* entity, struct pixel_position* pixel_pos); +void SetEntityPixelPosXY(struct entity* entity, uint32_t x, uint32_t y); +void IncrementEntityPixelPosXY(struct entity* entity, uint32_t x, uint32_t y); +struct entity* CreateEnemyEntity(enum monster_id monster_id); +struct entity* SpawnTrap(enum trap_id trap_id, struct position* position, uint8_t team, + uint8_t flags); +struct entity* SpawnItemEntity(struct position* position); +bool ShouldMinimapDisplayEntity(struct entity* entity); +bool ShouldDisplayEntity(struct entity* entity, undefined param_2); +bool ShouldDisplayEntityWrapper(struct entity* entity); +bool CanSeeTarget(struct entity* user, struct entity* target); +bool CanTargetEntity(struct entity* user, struct entity* target); +bool IsValidTargetEntity(struct entity* user, struct entity* target); +bool CanSeePosition(struct entity* monster, struct position* position); +bool CanTargetPosition(struct entity* monster, struct position* position); void PopulateActiveMonsterPtrs(void); -int GetTeamMemberIndex(struct entity *monster); -void GetMonsterOrTrapName(char *buffer, struct entity *entity); -void SubstitutePlaceholderStringTags(int string_id, struct entity *entity, - undefined4 param_3); +int GetTeamMemberIndex(struct entity* monster); +void GetMonsterOrTrapName(char* buffer, struct entity* entity); +void SubstitutePlaceholderStringTags(int string_id, struct entity* entity, undefined4 param_3); bool UpdateMapSurveyorFlag(void); -void PointCameraToMonster(struct entity *entity, bool update_trap_vis_and_map); +void PointCameraToMonster(struct entity* entity, bool update_trap_vis_and_map); void UpdateCamera(undefined param_1); -bool ItemIsActive(struct entity *entity, enum item_id item_id); +bool ItemIsActive(struct entity* entity, enum item_id item_id); int GetVisibilityRange(void); -void RevealWholeFloor(struct entity *entity); -int PlayEffectAnimationEntity(struct entity *entity, int effect_id, - bool play_now, int param_4, int param_5, - undefined param_6, enum direction_id effect_dir, - undefined2 *param_8); -int PlayEffectAnimationPos(struct position *pos, int effect_id, bool play_now); -int PlayEffectAnimationPixelPos(struct pixel_position *pixel_pos, int effect_id, - bool play_now); +void RevealWholeFloor(struct entity* entity); +int PlayEffectAnimationEntity(struct entity* entity, int effect_id, bool play_now, int param_4, + int param_5, undefined param_6, enum direction_id effect_dir, + undefined2* param_8); +int PlayEffectAnimationPos(struct position* pos, int effect_id, bool play_now); +int PlayEffectAnimationPixelPos(struct pixel_position* pixel_pos, int effect_id, bool play_now); void AnimationDelayOrSomething(undefined param_1); -void UpdateStatusIconFlags(struct entity *entity); -void PlayQuestionMarkEffect(struct entity *entity); -void PlayExclamationPointEffect(struct entity *entity); -void PlayEffectAnimation0x171Full(struct entity *entity); -void PlayEffectAnimation0x171(struct entity *entity); -void PlayParalysisEffect(struct entity *entity); -void PlayEffectAnimationEntityStandard(struct entity *entity, int effect_id); -void PlaySpeedUpEffect(struct entity *entity); -void PlaySpeedDownEffect(struct entity *entity); -void DisplayStockpileNumbers(struct entity *entity); -void PlayInvisifySeIfShouldDisplayEntity(struct entity *entity); -void ShowPpRestoreEffect(struct entity *entity); -void PlayOffensiveStatDownEffect(struct entity *entity, int stat_index); -void PlayDefensiveStatDownEffect(struct entity *entity, int stat_index); -void PlayOffensiveStatUpEffect(struct entity *entity, int stat_index); -void PlayDefensiveStatUpEffect(struct entity *entity, int stat_index); -void PlayOffensiveStatMultiplierUpEffect(struct entity *entity, int stat_index); -void PlayOffensiveStatMultiplierDownEffect(struct entity *entity, - int stat_index); -void PlayDefensiveStatMultiplierUpEffect(struct entity *entity, int stat_index); -void PlayDefensiveStatMultiplierDownEffect(struct entity *entity, - int stat_index); -void PlayHitChanceUpEffect(struct entity *entity, int stat_index); -void PlayHitChanceDownEffect(struct entity *entity, int stat_index); -void PlaySeByIdIfShouldDisplayEntity(struct entity *entity, int se_id); -bool ShouldDisplayEntityAdvanced(struct entity *entity); -void PlayEffectAnimation0x1A9(struct entity *entity); -void PlayEffectAnimation0x29(struct entity *entity); -void PlayEffectAnimation0x18E(struct entity *entity); -void LoadMappaFileAttributes(int quick_saved, bool disable_monsters, - undefined *special_process); +void UpdateStatusIconFlags(struct entity* entity); +void PlayQuestionMarkEffect(struct entity* entity); +void PlayExclamationPointEffect(struct entity* entity); +void PlayEffectAnimation0x171Full(struct entity* entity); +void PlayEffectAnimation0x171(struct entity* entity); +void PlayParalysisEffect(struct entity* entity); +void PlayEffectAnimationEntityStandard(struct entity* entity, int effect_id); +void PlaySpeedUpEffect(struct entity* entity); +void PlaySpeedDownEffect(struct entity* entity); +void DisplayStockpileNumbers(struct entity* entity); +void PlayInvisifySeIfShouldDisplayEntity(struct entity* entity); +void ShowPpRestoreEffect(struct entity* entity); +void PlayOffensiveStatDownEffect(struct entity* entity, int stat_index); +void PlayDefensiveStatDownEffect(struct entity* entity, int stat_index); +void PlayOffensiveStatUpEffect(struct entity* entity, int stat_index); +void PlayDefensiveStatUpEffect(struct entity* entity, int stat_index); +void PlayOffensiveStatMultiplierUpEffect(struct entity* entity, int stat_index); +void PlayOffensiveStatMultiplierDownEffect(struct entity* entity, int stat_index); +void PlayDefensiveStatMultiplierUpEffect(struct entity* entity, int stat_index); +void PlayDefensiveStatMultiplierDownEffect(struct entity* entity, int stat_index); +void PlayHitChanceUpEffect(struct entity* entity, int stat_index); +void PlayHitChanceDownEffect(struct entity* entity, int stat_index); +void PlaySeByIdIfShouldDisplayEntity(struct entity* entity, int se_id); +bool ShouldDisplayEntityAdvanced(struct entity* entity); +void PlayEffectAnimation0x1A9(struct entity* entity); +void PlayEffectAnimation0x29(struct entity* entity); +void PlayEffectAnimation0x18E(struct entity* entity); +void LoadMappaFileAttributes(int quick_saved, bool disable_monsters, undefined* special_process); enum trap_id GetRandomSpawnTrapId(void); enum trap_id GetRandomTrapId(void); enum item_id GetItemIdToSpawn(enum item_list_type item_list); enum item_id GetRandomBazaarItem(void); enum item_id GetRandomSecretRoomItem(void); -int CopySpawnEntriesMaster(struct monster_spawn_entry *spawn_entries, - int offset); -int MonsterSpawnListPartialCopy(struct monster_spawn_entry *buffer, - int current_buffer_entries); +int CopySpawnEntriesMaster(struct monster_spawn_entry* spawn_entries, int offset); +int MonsterSpawnListPartialCopy(struct monster_spawn_entry* buffer, int current_buffer_entries); void CopySpawnEntriesOnce(void); bool IsOnMonsterSpawnList(enum monster_id monster_id); enum monster_id GetMonsterIdToSpawn(int spawn_weight); @@ -115,43 +105,35 @@ void FreeTopScreenStatus(void); int InitializeTeamStats(void); int UpdateTeamStatsWrapper(void); int FreeTeamStatsWrapper(void); -void DisplayTeamStatsSprite(struct entity *team_member, undefined4 param_2, - undefined4 param_3); -void AssignTopScreenHandlers(void **funcs, top_screen_status_fn_t init_func, - top_screen_status_fn_t update_func, void *param_4, +void DisplayTeamStatsSprite(struct entity* team_member, undefined4 param_2, undefined4 param_3); +void AssignTopScreenHandlers(void** funcs, top_screen_status_fn_t init_func, + top_screen_status_fn_t update_func, void* param_4, top_screen_status_fn_t free_func); void HandleTopScreenFades(void); int FreeTopScreen(void); void DungeonChangeTopScreenType(int top_screen_type); -enum direction_id GetDirectionTowardsPosition(struct position *origin, - struct position *target); -int GetChebyshevDistance(struct position *position_a, - struct position *position_b); -bool IsPositionActuallyInSight(struct position *origin, struct position *target, +enum direction_id GetDirectionTowardsPosition(struct position* origin, struct position* target); +int GetChebyshevDistance(struct position* position_a, struct position* position_b); +bool IsPositionActuallyInSight(struct position* origin, struct position* target, bool user_has_dropeye); -bool IsPositionInSight(struct position *origin, struct position *target, - bool user_has_dropeye); -bool IsPositionWithinTwoTiles(struct position *origin, struct position *target); -struct entity *GetLeader(void); -struct monster *GetLeaderMonster(void); -bool GetRandomTile(struct position *pos_out, bool exclude_key_doors); -bool FindNearbyUnoccupiedTile(struct position *pos_out, struct position *origin, - struct position *search_list, int search_list_len, - bool random_room); -bool FindClosestUnoccupiedTileWithin2(struct position *pos_out, - struct position *origin, +bool IsPositionInSight(struct position* origin, struct position* target, bool user_has_dropeye); +bool IsPositionWithinTwoTiles(struct position* origin, struct position* target); +struct entity* GetLeader(void); +struct monster* GetLeaderMonster(void); +bool GetRandomTile(struct position* pos_out, bool exclude_key_doors); +bool FindNearbyUnoccupiedTile(struct position* pos_out, struct position* origin, + struct position* search_list, int search_list_len, bool random_room); +bool FindClosestUnoccupiedTileWithin2(struct position* pos_out, struct position* origin, bool random_room); -bool FindFarthestUnoccupiedTileWithin2(struct position *pos_out, - struct position *origin, +bool FindFarthestUnoccupiedTileWithin2(struct position* pos_out, struct position* origin, bool random_room); -bool FindUnoccupiedTileWithin3(struct position *pos_out, - struct position *origin, bool random_room); -uint8_t TickStatusTurnCounter(uint8_t *counter); +bool FindUnoccupiedTileWithin3(struct position* pos_out, struct position* origin, bool random_room); +uint8_t TickStatusTurnCounter(uint8_t* counter); void AdvanceFrame(undefined param_1); void UnkMapRelatedFunc(int switch_case, undefined4 param_2); void AnimateWaterShadows(void); -void DisplayAnimatedNumbers(int amount, struct entity *entity, - bool display_sign, enum number_color number_color); +void DisplayAnimatedNumbers(int amount, struct entity* entity, bool display_sign, + enum number_color number_color); void SetDungeonRngPreseed23Bit(uint32_t preseed23); uint32_t GenerateDungeonRngSeed(void); uint32_t GetDungeonRngPreseed(void); @@ -161,8 +143,7 @@ uint32_t DungeonRand16Bit(void); uint32_t DungeonRandInt(uint32_t n); int DungeonRandRange(int x, int y); bool DungeonRandOutcome(int percentage); -int CalcStatusDuration(struct entity *entity, int16_t *turn_range, - bool iq_skill_effects); +int CalcStatusDuration(struct entity* entity, int16_t* turn_range, bool iq_skill_effects); void DungeonRngUnsetSecondary(void); void DungeonRngSetSecondary(int i); void DungeonRngSetPrimary(void); @@ -171,121 +152,102 @@ void PlayMeByIdIfNot998(int me_id); enum music_id MusicTableIdxToMusicId(int music_table_idx); void ChangeDungeonMusic(enum music_id music_id); void SetUnkMusicFlag(uint8_t param_1); -void TrySwitchPlace(struct entity *user, struct entity *target); +void TrySwitchPlace(struct entity* user, struct entity* target); void ResetLeaderActionFields(bool clear_additional_fields); void SetLeaderActionFields(enum action action_id); -void ClearMonsterActionFields(struct action_data *monster_action); -void SetMonsterActionFields(struct action_data *monster_action, - enum action action_id); -void SetActionPassTurnOrWalk(struct action_data *monster_action, - enum monster_id monster_id); -struct item *GetItemToUseByIndex(struct entity *entity, - union item_index item_index); -struct item *GetItemToUse(struct entity *entity, int param_index, - undefined param_3); +void ClearMonsterActionFields(struct action_data* monster_action); +void SetMonsterActionFields(struct action_data* monster_action, enum action action_id); +void SetActionPassTurnOrWalk(struct action_data* monster_action, enum monster_id monster_id); +struct item* GetItemToUseByIndex(struct entity* entity, union item_index item_index); +struct item* GetItemToUse(struct entity* entity, int param_index, undefined param_3); enum action GetItemAction(enum item_id item_id); -void RemoveUsedItem(struct entity *entity, int param_index); +void RemoveUsedItem(struct entity* entity, int param_index); void ConvertTmToUsedTm(void); void AddDungeonSubMenuOption(int action_id, bool enabled); void DisableDungeonSubMenuOption(int action_id); -void SetActionRegularAttack(struct action_data *monster_action, - enum direction_id direction); -void SetActionStruggle(struct action_data *monster_action, - enum direction_id direction); -void SetActionUseMovePlayer(struct action_data *monster_action, - uint8_t entity_index, uint8_t move_index); -void SetActionUseMoveAi(struct action_data *monster_action, uint8_t move_index, +void SetActionRegularAttack(struct action_data* monster_action, enum direction_id direction); +void SetActionStruggle(struct action_data* monster_action, enum direction_id direction); +void SetActionUseMovePlayer(struct action_data* monster_action, uint8_t entity_index, + uint8_t move_index); +void SetActionUseMoveAi(struct action_data* monster_action, uint8_t move_index, enum direction_id direction); void RunFractionalTurn(bool is_first_loop); bool RunLeaderTurn(undefined param_1); void TrySpawnMonsterAndActivatePlusMinus(void); bool IsFloorOver(void); void DecrementWindCounter(void); -void CreateMonsterSummaryFromEntityOuter(union damage_source_16 damage_source, - struct entity *entity, - struct monster *monster, int param_4); +void CreateMonsterSummaryFromEntityOuter(union damage_source_16 damage_source, struct entity* entity, + struct monster* monster, int param_4); bool IsDungeonEndReasonFailure(void); void SetForcedLossReason(enum forced_loss_reason forced_loss_reason); enum forced_loss_reason GetForcedLossReason(void); -void GetTrapName(char *buffer, enum trap_id trap_id); -void BindTrapToTile(struct tile *tile, struct entity *trap, bool is_visible); +void GetTrapName(char* buffer, enum trap_id trap_id); +void BindTrapToTile(struct tile* tile, struct entity* trap, bool is_visible); bool AreLateGameTrapsEnabledWrapper(void); void SpawnTraps(void); -void SpawnEnemyTrapAtPos(enum trap_id trap_id, int16_t x, int16_t y, - uint8_t flags, bool is_visible); -void PrepareTrapperTrap(struct entity *entity, enum trap_id trap_id, - uint8_t team); -bool CanLayTrap(struct position *pos); -bool TrySpawnTrap(struct position *pos, enum trap_id trap_id, uint8_t team, - bool visible); -bool TrySpawnTrapperTrap(struct entity *entity); -bool TryRemoveTrap(struct position *pos, bool update_trap_visibility); -bool TryRevealAttackedTrap(struct position *pos, bool update_trap_visibility); +void SpawnEnemyTrapAtPos(enum trap_id trap_id, int16_t x, int16_t y, uint8_t flags, + bool is_visible); +void PrepareTrapperTrap(struct entity* entity, enum trap_id trap_id, uint8_t team); +bool CanLayTrap(struct position* pos); +bool TrySpawnTrap(struct position* pos, enum trap_id trap_id, uint8_t team, bool visible); +bool TrySpawnTrapperTrap(struct entity* entity); +bool TryRemoveTrap(struct position* pos, bool update_trap_visibility); +bool TryRevealAttackedTrap(struct position* pos, bool update_trap_visibility); void SubstitutePlaceholderTrapTags2(uint8_t tag_id, enum trap_id trap_id); -void SubstitutePlaceholderTrapTags(struct preprocessor_args *preprocessor_args, - uint8_t tag_id, enum trap_id trap_id); -void TryTriggerTrap(struct entity *entity, struct position *pos, - undefined param_3, undefined param_4); -void ApplyMudTrapEffect(struct entity *attacker, struct entity *defender); -void ApplyStickyTrapEffect(struct entity *attacker, struct entity *defender); -void ApplyGrimyTrapEffect(struct entity *attacker, struct entity *defender); -void ApplyPitfallTrapEffect(struct entity *attacker, struct entity *defender, - struct tile *tile, bool grate_stay_intact); -void ApplySummonTrapEffect(struct entity *monster, struct position *pos); -void ApplyPpZeroTrapEffect(struct entity *attacker, struct entity *defender); -void ApplyPokemonTrapEffect(struct entity *monster, struct position *pos); -void ApplyTripTrapEffect(struct entity *attacker, struct entity *defender); -void ApplyStealthRockTrapEffect(struct entity *attacker, - struct entity *defender); -void ApplyToxicSpikesTrapEffect(struct entity *attacker, - struct entity *defender); -bool ApplyRandomTrapEffect(struct trap *trap, struct entity *user, - struct entity *target, struct tile *tile, - struct position *pos); -void ApplyGrudgeTrapEffect(struct entity *monster, struct position *pos); -bool ApplyTrapEffect(struct trap *trap, struct entity *user, - struct entity *target, struct tile *tile, - struct position *pos, enum trap_id, bool random_trap); -void ChangeTrapOnTile(struct tile *tile, enum trap_id trap_id); -int SpawnMonstersAroundPos(struct entity *monster, struct position *pos, - uint8_t num_enemies); -void RevealTrapsNearby(struct entity *monster); +void SubstitutePlaceholderTrapTags(struct preprocessor_args* preprocessor_args, uint8_t tag_id, + enum trap_id trap_id); +void TryTriggerTrap(struct entity* entity, struct position* pos, undefined param_3, + undefined param_4); +void ApplyMudTrapEffect(struct entity* attacker, struct entity* defender); +void ApplyStickyTrapEffect(struct entity* attacker, struct entity* defender); +void ApplyGrimyTrapEffect(struct entity* attacker, struct entity* defender); +void ApplyPitfallTrapEffect(struct entity* attacker, struct entity* defender, struct tile* tile, + bool grate_stay_intact); +void ApplySummonTrapEffect(struct entity* monster, struct position* pos); +void ApplyPpZeroTrapEffect(struct entity* attacker, struct entity* defender); +void ApplyPokemonTrapEffect(struct entity* monster, struct position* pos); +void ApplyTripTrapEffect(struct entity* attacker, struct entity* defender); +void ApplyStealthRockTrapEffect(struct entity* attacker, struct entity* defender); +void ApplyToxicSpikesTrapEffect(struct entity* attacker, struct entity* defender); +bool ApplyRandomTrapEffect(struct trap* trap, struct entity* user, struct entity* target, + struct tile* tile, struct position* pos); +void ApplyGrudgeTrapEffect(struct entity* monster, struct position* pos); +bool ApplyTrapEffect(struct trap* trap, struct entity* user, struct entity* target, + struct tile* tile, struct position* pos, enum trap_id, bool random_trap); +void ChangeTrapOnTile(struct tile* tile, enum trap_id trap_id); +int SpawnMonstersAroundPos(struct entity* monster, struct position* pos, uint8_t num_enemies); +void RevealTrapsNearby(struct entity* monster); bool RevealTrapAtPos(int x, int y); -bool ShouldRunMonsterAi(struct entity *monster); +bool ShouldRunMonsterAi(struct entity* monster); bool DebugRecruitingEnabled(void); void TryActivateIqBooster(void); bool IsBehaviorLoneOutlaw(enum monster_behavior behavior); bool IsSecretBazaarNpcBehavior(enum monster_behavior behavior); -bool TalkToSecretBazaarNpcStandard(int string_id, struct entity *shopkeeper, +bool TalkToSecretBazaarNpcStandard(int string_id, struct entity* shopkeeper, enum portrait_emotion emotion); -bool TalkToSecretBazaarNpcWithYesNoMenu(int string_id, - struct entity *shopkeeper, +bool TalkToSecretBazaarNpcWithYesNoMenu(int string_id, struct entity* shopkeeper, enum portrait_emotion emotion, - struct simple_menu_id_item *menu_items); -void MakeTargetFaceUserAndIdle(struct entity *target, struct entity *user); + struct simple_menu_id_item* menu_items); +void MakeTargetFaceUserAndIdle(struct entity* target, struct entity* user); void SubtractMoneyCarriedWithSfx(int amount); -void GonePebbleGradualPaletteShift(struct rgba *palette, uint32_t param_2); -bool TalkToSecretBazaarNpc(int string_id, struct entity *shopkeeper, - enum portrait_emotion emotion, - struct simple_menu_id_item *menu_items, - bool param_5); -struct action_16 *GetLeaderAction(void); +void GonePebbleGradualPaletteShift(struct rgba* palette, uint32_t param_2); +bool TalkToSecretBazaarNpc(int string_id, struct entity* shopkeeper, enum portrait_emotion emotion, + struct simple_menu_id_item* menu_items, bool param_5); +struct action_16* GetLeaderAction(void); enum action_id GetLeaderActionId(void); -void GetEntityTouchscreenArea(struct entity *entity, - struct touchscreen_area *area); +void GetEntityTouchscreenArea(struct entity* entity, struct touchscreen_area* area); void SetLeaderAction(void); bool ShouldLeaderKeepRunning(void); void CheckLeaderTile(void); void ChangeLeader(void); enum monster_gender GetPlayerGender(void); -void HandleHeldItemSwaps(struct entity *entity); -void UseSingleUseItemWrapper(struct entity *user); -void UseSingleUseItem(struct entity *user, struct entity *target); -void UseThrowableItem(struct entity *user); -void ResetDamageData(struct damage_data *damage); +void HandleHeldItemSwaps(struct entity* entity); +void UseSingleUseItemWrapper(struct entity* user); +void UseSingleUseItem(struct entity* user, struct entity* target); +void UseThrowableItem(struct entity* user); +void ResetDamageData(struct damage_data* damage); void FreeLoadedAttackSpriteAndMore(void); -uint16_t SetAndLoadCurrentAttackAnimation(enum pack_file_id pack_id, - uint16_t file_index); +uint16_t SetAndLoadCurrentAttackAnimation(enum pack_file_id pack_id, uint16_t file_index); void ClearLoadedAttackSprite(void); uint16_t GetLoadedAttackSpriteId(void); int DungeonGetTotalSpriteFileSize(enum monster_id monster_id); @@ -300,709 +262,572 @@ void LoadMonsterSprite(enum monster_id monster_id, undefined param_2); void DeleteMonsterSpriteFile(enum monster_id monster_id); void DeleteAllMonsterSpriteFiles(void); void EuFaintCheck(bool non_team_member_fainted, bool set_unk_byte); -void HandleFaint(struct entity *fainted_entity, - union damage_source damage_source, struct entity *killer); -void MoveMonsterToPos(struct entity *entity, int x_pos, int y_pos, - undefined param_4); -void CreateMonsterSummaryFromEntity(struct monster_summary *monster_summary, - struct entity *monster_entity); -void UpdateAiTargetPos(struct entity *monster); -void SetMonsterTypeAndAbility(struct entity *target); +void HandleFaint(struct entity* fainted_entity, union damage_source damage_source, + struct entity* killer); +void MoveMonsterToPos(struct entity* entity, int x_pos, int y_pos, undefined param_4); +void CreateMonsterSummaryFromEntity(struct monster_summary* monster_summary, + struct entity* monster_entity); +void UpdateAiTargetPos(struct entity* monster); +void SetMonsterTypeAndAbility(struct entity* target); void TryActivateSlowStart(void); void TryActivateArtificialWeatherAbilities(void); -int GetMonsterApparentId(struct entity *target, enum monster_id current_id); -void TryActivateTraceAndColorChange(struct entity *attacker, - struct entity *defender, struct move *move); -bool DefenderAbilityIsActive(struct entity *attacker, struct entity *defender, - enum ability_id ability_id, - bool attacker_ability_enabled); -bool IsMonster(struct entity *entity); -void TryActivateConversion2(struct entity *attacker, struct entity *defender, - struct move *move); -void TryActivateTruant(struct entity *entity); -void TryPointCameraToMonster(struct entity *entity, undefined param_2, - undefined param_3); +int GetMonsterApparentId(struct entity* target, enum monster_id current_id); +void TryActivateTraceAndColorChange(struct entity* attacker, struct entity* defender, + struct move* move); +bool DefenderAbilityIsActive(struct entity* attacker, struct entity* defender, + enum ability_id ability_id, bool attacker_ability_enabled); +bool IsMonster(struct entity* entity); +void TryActivateConversion2(struct entity* attacker, struct entity* defender, struct move* move); +void TryActivateTruant(struct entity* entity); +void TryPointCameraToMonster(struct entity* entity, undefined param_2, undefined param_3); void ReevaluateSnatchMonster(void); -struct entity *GetRandomExplorerMazeMonster(void); -void RestorePpAllMovesSetFlags(struct entity *entity); +struct entity* GetRandomExplorerMazeMonster(void); +void RestorePpAllMovesSetFlags(struct entity* entity); bool CheckTeamMemberIdxVeneer(int member_idx); -bool CheckMonsterTeamMemberIdx(struct entity *entity); +bool CheckMonsterTeamMemberIdx(struct entity* entity); bool IsMonsterIdInNormalRangeVeneer(enum monster_id monster_id); -void BoostIQ(struct entity *entity, int iq_boost, bool suppress_logs); -void ChangeMonsterAnimationToIdle(struct entity *entity, - enum direction_id direction); -bool ShouldMonsterHeadToStairs(struct entity *entity); -void DisplayLinkedMovesWarnings(struct entity *entity, int move_slot); +void BoostIQ(struct entity* entity, int iq_boost, bool suppress_logs); +void ChangeMonsterAnimationToIdle(struct entity* entity, enum direction_id direction); +bool ShouldMonsterHeadToStairs(struct entity* entity); +void DisplayLinkedMovesWarnings(struct entity* entity, int move_slot); bool MewSpawnCheck(enum monster_id monster_id, bool fail_if_mew); -void TryEndStatusWithAbility(struct entity *attacker, struct entity *defender); -bool ExclusiveItemEffectIsActive(struct entity *entity, - enum exclusive_item_effect_id effect_id); -struct entity *GetTeamMemberWithIqSkill(enum iq_skill_id iq_skill); +void TryEndStatusWithAbility(struct entity* attacker, struct entity* defender); +bool ExclusiveItemEffectIsActive(struct entity* entity, enum exclusive_item_effect_id effect_id); +struct entity* GetTeamMemberWithIqSkill(enum iq_skill_id iq_skill); bool TeamMemberHasEnabledIqSkill(enum iq_skill_id iq_skill); bool TeamLeaderIqSkillIsEnabled(enum iq_skill_id iq_skill); -int CountMovesOutOfPp(struct entity *entity); -bool HasSuperEffectiveMoveAgainstUser( - struct entity *user, struct entity *target, - bool ignore_moves_with_max_ginseng_not_99); -bool TryEatItem(struct entity *user, struct entity *target); -void SetDecoyAiTracker(struct entity *entity); +int CountMovesOutOfPp(struct entity* entity); +bool HasSuperEffectiveMoveAgainstUser(struct entity* user, struct entity* target, + bool ignore_moves_with_max_ginseng_not_99); +bool TryEatItem(struct entity* user, struct entity* target); +void SetDecoyAiTracker(struct entity* entity); bool CheckSpawnThreshold(enum monster_id monster_id); -bool HasLowHealth(struct entity *entity); -bool AreEntitiesAdjacent(struct entity *first, struct entity *second); -bool IsHero(struct entity *entity); -int16_t FindMoveOnMonster(struct entity *entity, enum move_id move_id); -bool DoesMonsterHaveMove(struct entity *entity, enum move_id move_id); -bool IsSpecialStoryAllyOrClient(struct entity *entity); -void ResetTriggerFlags(struct entity *entity); -bool IsSpecialStoryAlly(struct monster *monster); -bool IsExperienceLocked(struct monster *monster); -struct entity *FindMonsterWithBehavior(enum monster_behavior monster_behavior); +bool HasLowHealth(struct entity* entity); +bool AreEntitiesAdjacent(struct entity* first, struct entity* second); +bool IsHero(struct entity* entity); +int16_t FindMoveOnMonster(struct entity* entity, enum move_id move_id); +bool DoesMonsterHaveMove(struct entity* entity, enum move_id move_id); +bool IsSpecialStoryAllyOrClient(struct entity* entity); +void ResetTriggerFlags(struct entity* entity); +bool IsSpecialStoryAlly(struct monster* monster); +bool IsExperienceLocked(struct monster* monster); +struct entity* FindMonsterWithBehavior(enum monster_behavior monster_behavior); int CountActiveMonsters(void); -bool IsMonsterLoneOutlaw(struct monster *monster); -bool IsSecretBazaarNpc(struct entity *entity); -bool IsTeamMemberOnFirstTurnInFixedRoom(struct monster *monster); -void InitOtherMonsterData(struct entity *entity, int fixed_room_stats_index, - enum direction_id dir); +bool IsMonsterLoneOutlaw(struct monster* monster); +bool IsSecretBazaarNpc(struct entity* entity); +bool IsTeamMemberOnFirstTurnInFixedRoom(struct monster* monster); +void InitOtherMonsterData(struct entity* entity, int fixed_room_stats_index, enum direction_id dir); void InitEnemySpawnStats(void); -void InitEnemyStatsAndMoves(struct move *move_list, int16_t *hp, - uint8_t *offensive_stats, uint8_t *defensive_stats); +void InitEnemyStatsAndMoves(struct move* move_list, int16_t* hp, uint8_t* offensive_stats, + uint8_t* defensive_stats); void SpawnTeam(undefined param_1); void SpawnInitialMonsters(void); -struct entity *SpawnMonster(struct spawned_monster_data *monster_data, - bool cannot_be_asleep); +struct entity* SpawnMonster(struct spawned_monster_data* monster_data, bool cannot_be_asleep); void InitTeamMember(enum monster_id, int16_t x_position, int16_t y_position, - struct team_member *team_member_data, undefined param_5, - undefined param_6, undefined param_7, undefined param_8, - undefined param_9); -void InitMonster(undefined param_1, struct entity *entity, - struct spawned_monster_data *spawn_data, undefined *param_4); -void SubInitMonster(struct monster *monster, bool flag); -void MarkShopkeeperSpawn(int x, int y, enum monster_id monster_id, - enum monster_behavior behavior); + struct team_member* team_member_data, undefined param_5, undefined param_6, + undefined param_7, undefined param_8, undefined param_9); +void InitMonster(undefined param_1, struct entity* entity, struct spawned_monster_data* spawn_data, + undefined* param_4); +void SubInitMonster(struct monster* monster, bool flag); +void MarkShopkeeperSpawn(int x, int y, enum monster_id monster_id, enum monster_behavior behavior); void SpawnShopkeepers(void); uint16_t GetMaxHpAtLevel(enum monster_id monster_id, int level); -uint8_t GetOffensiveStatAtLevel(enum monster_id monster_id, int level, - int stat_idx); -uint8_t GetDefensiveStatAtLevel(enum monster_id monster_id, int level, - int stat_idx); -void GetOutlawSpawnData(struct spawned_target_data *outlaw); -bool ExecuteMonsterAction(struct entity *monster); +uint8_t GetOffensiveStatAtLevel(enum monster_id monster_id, int level, int stat_idx); +uint8_t GetDefensiveStatAtLevel(enum monster_id monster_id, int level, int stat_idx); +void GetOutlawSpawnData(struct spawned_target_data* outlaw); +bool ExecuteMonsterAction(struct entity* monster); void TryActivateFlashFireOnAllMonsters(void); -bool HasStatusThatPreventsActing(struct entity *monster); -enum mobility_type GetMobilityTypeCheckSlip(enum monster_id species, - bool walk_on_water); -enum mobility_type GetMobilityTypeCheckSlipAndFloating(struct entity *monster, +bool HasStatusThatPreventsActing(struct entity* monster); +enum mobility_type GetMobilityTypeCheckSlip(enum monster_id species, bool walk_on_water); +enum mobility_type GetMobilityTypeCheckSlipAndFloating(struct entity* monster, enum monster_id species); -bool IsInvalidSpawnTile(enum monster_id monster_id, struct tile *tile); -enum mobility_type -GetMobilityTypeAfterIqSkills(struct entity *monster, - enum mobility_type mobility_type); -bool CanMoveThroughWalls(struct entity *monster); -bool CannotStandOnTile(struct entity *monster, struct tile *tile); -int CalcSpeedStage(struct entity *entity, int counter_weight); -int CalcSpeedStageWrapper(struct entity *entity); -int GetNumberOfAttacks(struct entity *entity); -enum display_name_type GetMonsterDisplayNameType(struct monster *monster); -void GetMonsterName(char *buffer, struct monster *target_info); -void SetPreprocessorArgsStringToName( - struct preprocessor_args *preprocessor_args, uint8_t pos, - struct monster *monster, undefined param_4, uint8_t name_type); -bool IsMonsterDrowsy(struct entity *monster); -bool MonsterHasNonvolatileNonsleepStatus(struct entity *monster); -bool MonsterHasImmobilizingStatus(struct entity *monster); -bool MonsterHasAttackInterferingStatus(struct entity *monster); -bool MonsterHasSkillInterferingStatus(struct entity *monster); -bool MonsterHasLeechSeedStatus(struct entity *monster); -bool MonsterHasWhifferStatus(struct entity *monster); -bool IsMonsterVisuallyImpaired(struct entity *monster, bool check_held_item); -bool IsMonsterMuzzled(struct entity *monster); -bool MonsterHasMiracleEyeStatus(struct entity *monster); -bool MonsterHasNegativeStatus(struct entity *monster, bool check_held_item); -bool IsMonsterSleeping(struct entity *monster); -bool MonsterHasQuarterHp(struct entity *monster); -bool CheckVariousStatuses2(struct entity *entity, bool blind_check); -bool CheckVariousConditions(struct entity *entity); -bool CheckVariousStatuses(struct entity *entity); -bool MonsterCannotAttack(struct entity *entity, bool skip_sleep); -bool CanMonsterMoveInDirection(struct entity *monster, - enum direction_id direction); -enum mobility_type GetDirectionalMobilityType(struct entity *monster, +bool IsInvalidSpawnTile(enum monster_id monster_id, struct tile* tile); +enum mobility_type GetMobilityTypeAfterIqSkills(struct entity* monster, + enum mobility_type mobility_type); +bool CanMoveThroughWalls(struct entity* monster); +bool CannotStandOnTile(struct entity* monster, struct tile* tile); +int CalcSpeedStage(struct entity* entity, int counter_weight); +int CalcSpeedStageWrapper(struct entity* entity); +int GetNumberOfAttacks(struct entity* entity); +enum display_name_type GetMonsterDisplayNameType(struct monster* monster); +void GetMonsterName(char* buffer, struct monster* target_info); +void SetPreprocessorArgsStringToName(struct preprocessor_args* preprocessor_args, uint8_t pos, + struct monster* monster, undefined param_4, uint8_t name_type); +bool IsMonsterDrowsy(struct entity* monster); +bool MonsterHasNonvolatileNonsleepStatus(struct entity* monster); +bool MonsterHasImmobilizingStatus(struct entity* monster); +bool MonsterHasAttackInterferingStatus(struct entity* monster); +bool MonsterHasSkillInterferingStatus(struct entity* monster); +bool MonsterHasLeechSeedStatus(struct entity* monster); +bool MonsterHasWhifferStatus(struct entity* monster); +bool IsMonsterVisuallyImpaired(struct entity* monster, bool check_held_item); +bool IsMonsterMuzzled(struct entity* monster); +bool MonsterHasMiracleEyeStatus(struct entity* monster); +bool MonsterHasNegativeStatus(struct entity* monster, bool check_held_item); +bool IsMonsterSleeping(struct entity* monster); +bool MonsterHasQuarterHp(struct entity* monster); +bool CheckVariousStatuses2(struct entity* entity, bool blind_check); +bool CheckVariousConditions(struct entity* entity); +bool CheckVariousStatuses(struct entity* entity); +bool MonsterCannotAttack(struct entity* entity, bool skip_sleep); +bool CanMonsterMoveInDirection(struct entity* monster, enum direction_id direction); +enum mobility_type GetDirectionalMobilityType(struct entity* monster, enum mobility_type base_mobility, enum direction_id direction); -bool CanMonsterMoveOrSwapWithAllyInAnyDirection(struct entity *monster); -bool CanMonsterMoveOrSwapWithAllyInDirection(struct entity *monster, - enum direction_id direction); -bool CanAttackInDirection(struct entity *monster, enum direction_id direction); -bool CanAiMonsterMoveInDirection(struct entity *monster, - enum direction_id direction, - bool *out_monster_in_target_position); -bool IsAtJunction(struct entity *monster); -bool ShouldAvoidFirstHit(struct entity *monster, bool should_avoid); -bool ShouldMonsterRunAway(struct entity *monster); -bool ShouldMonsterRunAwayAndShowEffect(struct entity *monster, - bool show_run_away_effect); -void DisplayRunAwayIfTriggered(struct entity *monster, - bool show_run_away_effect); -enum monster_treatment -GetTreatmentBetweenMonsters(struct entity *entity1, struct entity *entity2, - bool see_invisible_targets, - bool ignore_petrified_targets); -enum monster_treatment -GetTreatmentBetweenMonstersIgnoreStatus(struct entity *entity1, - struct entity *entity2); -bool SafeguardIsActive(struct entity *user, struct entity *target, - bool log_message); -bool LeafGuardIsActive(struct entity *user, struct entity *target, - bool log_message); -bool IsProtectedFromStatDrops(struct entity *user, struct entity *target, - bool log_message); -bool NoGastroAcidStatus(struct entity *entity, enum ability_id ability_id); -bool AbilityIsActive(struct entity *entity, enum ability_id ability_id); -bool AbilityIsActiveVeneer(struct entity *entity, enum ability_id ability_id); -bool OtherMonsterAbilityIsActive(struct entity *user, - enum ability_id ability_id); -bool LevitateIsActive(struct entity *entity); -bool MonsterIsType(struct entity *entity, enum type_id type_id); -bool IsTypeAffectedByGravity(struct entity *entity, enum type_id type_id); -bool HasTypeAffectedByGravity(struct entity *entity, enum type_id type_id); -bool CanSeeInvisibleMonsters(struct entity *entity); -bool IsTacticSet(struct entity *entity, enum tactic_id tactic_id); -bool HasDropeyeStatus(struct entity *entity); -bool IqSkillIsEnabled(struct entity *entity, enum iq_skill_id iq_id); -void UpdateIqSkills(struct monster *monster); -bool CanSeeTeammate(struct monster *monster); -enum type_id GetMoveTypeForMonster(struct entity *entity, struct move *move); -int GetMovePower(struct entity *entity, struct move *move); -bool MonsterCanThrowItems(struct monster *monster); -bool UpdateStateFlags(struct monster *monster, uint16_t mask, bool set_flags); -bool IsProtectedFromNegativeStatus(struct entity *user, struct entity *target, - bool log_message); -void AddExpSpecial(struct entity *attacker, struct entity *defender, - int base_exp); -void EnemyEvolution(struct entity *entity); -void LevelUpItemEffect(struct entity *user, struct entity *target, int levels, - bool message, bool dialogue); -bool TryDecreaseLevel(struct entity *user, struct entity *target, int n_levels); -bool LevelUp(struct entity *user, struct entity *target, bool message, - bool dialogue); -bool DungeonTmLearnMove(struct entity *user, enum move_id move_id); -void GetMonsterMoves(struct move_id_16 *out_moves, enum monster_id monster_id, - int level); -void EvolveMonster(struct entity *user, struct entity *target, - enum monster_id new_monster_id); -void DisplayMonsterShadow(bool display_shadow, enum shadow_type shadow_type, - bool yellow_circle, int16_t x, int16_t y); -void ChangeMonsterAnimation(struct entity *monster, int8_t animation_id, +bool CanMonsterMoveOrSwapWithAllyInAnyDirection(struct entity* monster); +bool CanMonsterMoveOrSwapWithAllyInDirection(struct entity* monster, enum direction_id direction); +bool CanAttackInDirection(struct entity* monster, enum direction_id direction); +bool CanAiMonsterMoveInDirection(struct entity* monster, enum direction_id direction, + bool* out_monster_in_target_position); +bool IsAtJunction(struct entity* monster); +bool ShouldAvoidFirstHit(struct entity* monster, bool should_avoid); +bool ShouldMonsterRunAway(struct entity* monster); +bool ShouldMonsterRunAwayAndShowEffect(struct entity* monster, bool show_run_away_effect); +void DisplayRunAwayIfTriggered(struct entity* monster, bool show_run_away_effect); +enum monster_treatment GetTreatmentBetweenMonsters(struct entity* entity1, struct entity* entity2, + bool see_invisible_targets, + bool ignore_petrified_targets); +enum monster_treatment GetTreatmentBetweenMonstersIgnoreStatus(struct entity* entity1, + struct entity* entity2); +bool SafeguardIsActive(struct entity* user, struct entity* target, bool log_message); +bool LeafGuardIsActive(struct entity* user, struct entity* target, bool log_message); +bool IsProtectedFromStatDrops(struct entity* user, struct entity* target, bool log_message); +bool NoGastroAcidStatus(struct entity* entity, enum ability_id ability_id); +bool AbilityIsActive(struct entity* entity, enum ability_id ability_id); +bool AbilityIsActiveVeneer(struct entity* entity, enum ability_id ability_id); +bool OtherMonsterAbilityIsActive(struct entity* user, enum ability_id ability_id); +bool LevitateIsActive(struct entity* entity); +bool MonsterIsType(struct entity* entity, enum type_id type_id); +bool IsTypeAffectedByGravity(struct entity* entity, enum type_id type_id); +bool HasTypeAffectedByGravity(struct entity* entity, enum type_id type_id); +bool CanSeeInvisibleMonsters(struct entity* entity); +bool IsTacticSet(struct entity* entity, enum tactic_id tactic_id); +bool HasDropeyeStatus(struct entity* entity); +bool IqSkillIsEnabled(struct entity* entity, enum iq_skill_id iq_id); +void UpdateIqSkills(struct monster* monster); +bool CanSeeTeammate(struct monster* monster); +enum type_id GetMoveTypeForMonster(struct entity* entity, struct move* move); +int GetMovePower(struct entity* entity, struct move* move); +bool MonsterCanThrowItems(struct monster* monster); +bool UpdateStateFlags(struct monster* monster, uint16_t mask, bool set_flags); +bool IsProtectedFromNegativeStatus(struct entity* user, struct entity* target, bool log_message); +void AddExpSpecial(struct entity* attacker, struct entity* defender, int base_exp); +void EnemyEvolution(struct entity* entity); +void LevelUpItemEffect(struct entity* user, struct entity* target, int levels, bool message, + bool dialogue); +bool TryDecreaseLevel(struct entity* user, struct entity* target, int n_levels); +bool LevelUp(struct entity* user, struct entity* target, bool message, bool dialogue); +bool DungeonTmLearnMove(struct entity* user, enum move_id move_id); +void GetMonsterMoves(struct move_id_16* out_moves, enum monster_id monster_id, int level); +void EvolveMonster(struct entity* user, struct entity* target, enum monster_id new_monster_id); +void DisplayMonsterShadow(bool display_shadow, enum shadow_type shadow_type, bool yellow_circle, + int16_t x, int16_t y); +void ChangeMonsterAnimation(struct entity* monster, int8_t animation_id, enum direction_id direction); -uint8_t GetIdleAnimationId(struct entity *entity); +uint8_t GetIdleAnimationId(struct entity* entity); void DetermineAllMonsterShadow(void); -enum shadow_type DetermineMonsterShadow(struct entity *monster); -bool DisplayActions(struct entity *param_1); -void CheckNonLeaderTile(struct entity *entity); -bool EndNegativeStatusCondition(struct entity *user, struct entity *target, - bool animation, bool fail_message, - bool remove_wrapping); -bool EndNegativeStatusConditionWrapper(struct entity *user, - struct entity *target, bool animation, +enum shadow_type DetermineMonsterShadow(struct entity* monster); +bool DisplayActions(struct entity* param_1); +void CheckNonLeaderTile(struct entity* entity); +bool EndNegativeStatusCondition(struct entity* user, struct entity* target, bool animation, + bool fail_message, bool remove_wrapping); +bool EndNegativeStatusConditionWrapper(struct entity* user, struct entity* target, bool animation, bool fail_message); -void TransferNegativeStatusCondition(struct entity *user, - struct entity *target); -void EndSleepClassStatus(struct entity *user, struct entity *target); -void EndBurnClassStatus(struct entity *user, struct entity *target); -void EndFrozenClassStatus(struct entity *user, struct entity *target, bool log); -void EndCringeClassStatus(struct entity *user, struct entity *target); -void EndReflectClassStatus(struct entity *user, struct entity *target); -void TryRemoveSnatchedMonsterFromDungeonStruct(struct entity *user, - struct entity *target); -void EndCurseClassStatus(struct entity *user, struct entity *target, - uint8_t next_curse_class_status_being_applied, - bool log_message); -void EndLeechSeedClassStatus(struct entity *user, struct entity *target); -void EndSureShotClassStatus(struct entity *user, struct entity *target); -void EndInvisibleClassStatus(struct entity *user, struct entity *target, - bool no_slip_message); -void EndBlinkerClassStatus(struct entity *user, struct entity *target); -void EndMuzzledStatus(struct entity *user, struct entity *target); -void EndMiracleEyeStatus(struct entity *user, struct entity *target); -void EndMagnetRiseStatus(struct entity *user, struct entity *target); -bool TransferNegativeBlinkerClassStatus(struct entity *user, - struct entity *target); -bool TryEndPetrifiedOrSleepStatus(struct entity *user, struct entity *target); -void EndFrozenStatus(struct entity *user, struct entity *target); -void EndProtectStatus(struct entity *user, struct entity *target); -void TryRestoreRoostTyping(struct entity *user, struct entity *target); -void TryTriggerMonsterHouse(struct entity *entity, bool outside_enemies); -bool ShouldMonsterFollowLeader(struct entity *monster); -struct entity *GetLeaderIfVisible(struct entity *monster); -void RunMonsterAi(struct entity *monster, int unused); -void ApplyDamageAndEffects(struct entity *attacker, struct entity *defender, - struct damage_data *damage_data, bool false_swipe, - bool exp_on_faint, union damage_source damage_source, - bool defender_response); -bool ApplyDamage(struct entity *attacker, struct entity *defender, - struct damage_data *damage_data, bool false_swipe, - bool exp_on_faint, union damage_source damage_source); -bool AftermathCheck(struct entity *attacker, struct entity *defender, +void TransferNegativeStatusCondition(struct entity* user, struct entity* target); +void EndSleepClassStatus(struct entity* user, struct entity* target); +void EndBurnClassStatus(struct entity* user, struct entity* target); +void EndFrozenClassStatus(struct entity* user, struct entity* target, bool log); +void EndCringeClassStatus(struct entity* user, struct entity* target); +void EndReflectClassStatus(struct entity* user, struct entity* target); +void TryRemoveSnatchedMonsterFromDungeonStruct(struct entity* user, struct entity* target); +void EndCurseClassStatus(struct entity* user, struct entity* target, + uint8_t next_curse_class_status_being_applied, bool log_message); +void EndLeechSeedClassStatus(struct entity* user, struct entity* target); +void EndSureShotClassStatus(struct entity* user, struct entity* target); +void EndInvisibleClassStatus(struct entity* user, struct entity* target, bool no_slip_message); +void EndBlinkerClassStatus(struct entity* user, struct entity* target); +void EndMuzzledStatus(struct entity* user, struct entity* target); +void EndMiracleEyeStatus(struct entity* user, struct entity* target); +void EndMagnetRiseStatus(struct entity* user, struct entity* target); +bool TransferNegativeBlinkerClassStatus(struct entity* user, struct entity* target); +bool TryEndPetrifiedOrSleepStatus(struct entity* user, struct entity* target); +void EndFrozenStatus(struct entity* user, struct entity* target); +void EndProtectStatus(struct entity* user, struct entity* target); +void TryRestoreRoostTyping(struct entity* user, struct entity* target); +void TryTriggerMonsterHouse(struct entity* entity, bool outside_enemies); +bool ShouldMonsterFollowLeader(struct entity* monster); +struct entity* GetLeaderIfVisible(struct entity* monster); +void RunMonsterAi(struct entity* monster, int unused); +void ApplyDamageAndEffects(struct entity* attacker, struct entity* defender, + struct damage_data* damage_data, bool false_swipe, bool exp_on_faint, + union damage_source damage_source, bool defender_response); +bool ApplyDamage(struct entity* attacker, struct entity* defender, struct damage_data* damage_data, + bool false_swipe, bool exp_on_faint, union damage_source damage_source); +bool AftermathCheck(struct entity* attacker, struct entity* defender, union damage_source damage_source); -enum type_matchup GetTypeMatchupBothTypes(struct entity *attacker, - struct entity *defender, +enum type_matchup GetTypeMatchupBothTypes(struct entity* attacker, struct entity* defender, enum type_id attack_type); -bool ScrappyShouldActivate(struct entity *attacker, struct entity *defender, +bool ScrappyShouldActivate(struct entity* attacker, struct entity* defender, enum type_id attack_type); bool IsTypeIneffectiveAgainstGhost(enum type_id attack_type); -bool GhostImmunityIsActive(struct entity *attacker, struct entity *defender, - int target_type_idx); -enum type_matchup GetTypeMatchup(struct entity *attacker, - struct entity *defender, int target_type_idx, - enum type_id attack_type); -bool CalcTypeBasedDamageEffects(struct fx64_16 *damage_mult_out, - struct entity *attacker, - struct entity *defender, int attack_power, - enum type_id attack_type, - struct damage_data *damage_out, bool partial); -int WeightWeakTypePicker(struct entity *user, struct entity *target, - enum type_id move_type); -void CalcDamage(struct entity *attacker, struct entity *defender, - enum type_id attack_type, int attack_power, int crit_chance, - struct damage_data *damage_out, fx32_8 damage_mult_fp, - enum move_id move_id, bool full_calc); -void ApplyDamageAndEffectsWrapper(struct entity *monster, int damage, - enum damage_message message, +bool GhostImmunityIsActive(struct entity* attacker, struct entity* defender, int target_type_idx); +enum type_matchup GetTypeMatchup(struct entity* attacker, struct entity* defender, + int target_type_idx, enum type_id attack_type); +bool CalcTypeBasedDamageEffects(struct fx64_16* damage_mult_out, struct entity* attacker, + struct entity* defender, int attack_power, enum type_id attack_type, + struct damage_data* damage_out, bool partial); +int WeightWeakTypePicker(struct entity* user, struct entity* target, enum type_id move_type); +void CalcDamage(struct entity* attacker, struct entity* defender, enum type_id attack_type, + int attack_power, int crit_chance, struct damage_data* damage_out, + fx32_8 damage_mult_fp, enum move_id move_id, bool full_calc); +void ApplyDamageAndEffectsWrapper(struct entity* monster, int damage, enum damage_message message, union damage_source damage_source); -void CalcRecoilDamageFixed(struct entity *attacker, int fixed_damage, - undefined4 param_3, struct damage_data *damage_out, - enum move_id move_id, enum type_id attack_type, - union damage_source damage_source, - enum damage_message damage_message, - undefined4 param_9, undefined4 param_10); -void CalcDamageFixed(struct entity *attacker, struct entity *defender, - int fixed_damage, bool exp_on_faint, - struct damage_data *damage_out, enum type_id attack_type, - enum move_category move_category, - union damage_source damage_source, - enum damage_message damage_message, undefined4 param_10, - undefined4 param_11); -void CalcDamageFixedNoCategory(struct entity *attacker, struct entity *defender, - int fixed_damage, bool exp_on_faint, - struct damage_data *damage_out, - enum type_id attack_type, - union damage_source damage_source, - enum damage_message damage_message, - undefined4 param_9, undefined4 param_10); -void CalcDamageFixedWrapper(struct entity *attacker, struct entity *defender, - int fixed_damage, bool exp_on_faint, - struct damage_data *damage_out, - enum type_id attack_type, - enum move_category move_category, - union damage_source damage_source, - enum damage_message damage_message, +void CalcRecoilDamageFixed(struct entity* attacker, int fixed_damage, undefined4 param_3, + struct damage_data* damage_out, enum move_id move_id, + enum type_id attack_type, union damage_source damage_source, + enum damage_message damage_message, undefined4 param_9, + undefined4 param_10); +void CalcDamageFixed(struct entity* attacker, struct entity* defender, int fixed_damage, + bool exp_on_faint, struct damage_data* damage_out, enum type_id attack_type, + enum move_category move_category, union damage_source damage_source, + enum damage_message damage_message, undefined4 param_10, undefined4 param_11); +void CalcDamageFixedNoCategory(struct entity* attacker, struct entity* defender, int fixed_damage, + bool exp_on_faint, struct damage_data* damage_out, + enum type_id attack_type, union damage_source damage_source, + enum damage_message damage_message, undefined4 param_9, + undefined4 param_10); +void CalcDamageFixedWrapper(struct entity* attacker, struct entity* defender, int fixed_damage, + bool exp_on_faint, struct damage_data* damage_out, + enum type_id attack_type, enum move_category move_category, + union damage_source damage_source, enum damage_message damage_message, undefined4 param_10, undefined4 param_11); -void UpdateShopkeeperModeAfterAttack(struct entity *attacker, - struct entity *defender); -void UpdateShopkeeperModeAfterTrap(struct entity *shopkeeper, - bool non_team_member); +void UpdateShopkeeperModeAfterAttack(struct entity* attacker, struct entity* defender); +void UpdateShopkeeperModeAfterTrap(struct entity* shopkeeper, bool non_team_member); void ResetDamageCalcDiagnostics(void); -void PointCameraToMonsterWrapper(struct entity *entity); -bool IsEitherMonsterInvalid(struct entity *entity1, struct entity *entity2); +void PointCameraToMonsterWrapper(struct entity* entity); +bool IsEitherMonsterInvalid(struct entity* entity1, struct entity* entity2); bool SpecificRecruitCheck(enum monster_id monster_id); -bool RecruitCheck(struct entity *user, struct entity *target); -bool TryRecruit(struct entity *user, struct entity *recruit); +bool RecruitCheck(struct entity* user, struct entity* target); +bool TryRecruit(struct entity* user, struct entity* recruit); void TrySpawnMonsterAndTickSpawnCounter(void); -void AiDecideUseItem(struct entity *entity); -void GetPossibleAiThrownItemDirections(struct entity *entity, int ally_or_enemy, - struct item *item, bool always_add); -void GetPossibleAiArcItemTargets(struct entity *user, struct item *item, - struct position *positions, +void AiDecideUseItem(struct entity* entity); +void GetPossibleAiThrownItemDirections(struct entity* entity, int ally_or_enemy, struct item* item, + bool always_add); +void GetPossibleAiArcItemTargets(struct entity* user, struct item* item, struct position* positions, bool always_add_position); -void TryNonLeaderItemPickUp(struct entity *entity); -bool GetExclusiveItemWithEffectFromBag(struct entity *entity, - enum exclusive_item_effect_id effect_id, - struct item *item); -bool AuraBowIsActive(struct entity *entity); -int ExclusiveItemOffenseBoost(struct entity *entity, int move_category_idx); -int ExclusiveItemDefenseBoost(struct entity *entity, int move_category_idx); -int TeamMemberHasItemActive(struct entity *monsters, enum item_id item_id); -bool TeamMemberHasExclusiveItemEffectActive( - enum exclusive_item_effect_id effect_id); -enum direction_id FindDirectionOfAdjacentMonsterWithItem(struct entity *entity, +void TryNonLeaderItemPickUp(struct entity* entity); +bool GetExclusiveItemWithEffectFromBag(struct entity* entity, + enum exclusive_item_effect_id effect_id, struct item* item); +bool AuraBowIsActive(struct entity* entity); +int ExclusiveItemOffenseBoost(struct entity* entity, int move_category_idx); +int ExclusiveItemDefenseBoost(struct entity* entity, int move_category_idx); +int TeamMemberHasItemActive(struct entity* monsters, enum item_id item_id); +bool TeamMemberHasExclusiveItemEffectActive(enum exclusive_item_effect_id effect_id); +enum direction_id FindDirectionOfAdjacentMonsterWithItem(struct entity* entity, enum item_id item_id); -void TrySpawnEnemyItemDrop(struct entity *attacker, struct entity *defender); -void TickNoSlipCap(struct entity *entity); -void ActivateEndOfTurnEffects(struct entity *entity); -void TickStatusAndHealthRegen(struct entity *entity); -void InflictSleepStatusSingle(struct entity *entity, int turns); -void TryInflictSleepStatus(struct entity *user, struct entity *target, - int turns, bool log_failure); -bool IsProtectedFromSleepClassStatus(struct entity *user, struct entity *target, - bool ignore_safeguard, - bool ingnore_protections, +void TrySpawnEnemyItemDrop(struct entity* attacker, struct entity* defender); +void TickNoSlipCap(struct entity* entity); +void ActivateEndOfTurnEffects(struct entity* entity); +void TickStatusAndHealthRegen(struct entity* entity); +void InflictSleepStatusSingle(struct entity* entity, int turns); +void TryInflictSleepStatus(struct entity* user, struct entity* target, int turns, bool log_failure); +bool IsProtectedFromSleepClassStatus(struct entity* user, struct entity* target, + bool ignore_safeguard, bool ingnore_protections, bool log_failure); -void TryInflictNightmareStatus(struct entity *user, struct entity *target, - int turns); -void TryInflictNappingStatus(struct entity *user, struct entity *target, - int turns); -void TryInflictYawningStatus(struct entity *user, struct entity *target, - int turns); -void TryInflictSleeplessStatus(struct entity *user, struct entity *target); -bool TryInflictPausedStatus(struct entity *user, struct entity *target, - bool check_safeguard, int turns, bool log_failure, - bool check_only); -bool TryInflictInfatuatedStatus(struct entity *user, struct entity *target, - bool log_failure, bool check_only); -bool TryInflictBurnStatus(struct entity *user, struct entity *target, - bool special_effect, bool log_failure, - bool check_only); -void TryInflictBurnStatusWholeTeam(void); -bool TryInflictPoisonedStatus(struct entity *user, struct entity *target, - bool log_failure, bool check_only); -bool TryInflictBadlyPoisonedStatus(struct entity *user, struct entity *target, - bool log_failure, bool check_only); -void TryInflictFrozenStatus(struct entity *user, struct entity *target, - bool log_failure); -void TryInflictConstrictionStatus(struct entity *user, struct entity *target, - int animation_id, bool log_failure); -void TryInflictShadowHoldStatus(struct entity *user, struct entity *target, +void TryInflictNightmareStatus(struct entity* user, struct entity* target, int turns); +void TryInflictNappingStatus(struct entity* user, struct entity* target, int turns); +void TryInflictYawningStatus(struct entity* user, struct entity* target, int turns); +void TryInflictSleeplessStatus(struct entity* user, struct entity* target); +bool TryInflictPausedStatus(struct entity* user, struct entity* target, bool check_safeguard, + int turns, bool log_failure, bool check_only); +bool TryInflictInfatuatedStatus(struct entity* user, struct entity* target, bool log_failure, bool check_only); -void TryInflictIngrainStatus(struct entity *user, struct entity *target); -void TryInflictWrappedStatus(struct entity *user, struct entity *target); -void FreeOtherWrappedMonsters(struct entity *entity); -void TryInflictPetrifiedStatus(struct entity *user, struct entity *target); -void LowerOffensiveStat(struct entity *user, struct entity *target, - int stat_idx, int16_t n_stages, +bool TryInflictBurnStatus(struct entity* user, struct entity* target, bool special_effect, + bool log_failure, bool check_only); +void TryInflictBurnStatusWholeTeam(void); +bool TryInflictPoisonedStatus(struct entity* user, struct entity* target, bool log_failure, + bool check_only); +bool TryInflictBadlyPoisonedStatus(struct entity* user, struct entity* target, bool log_failure, + bool check_only); +void TryInflictFrozenStatus(struct entity* user, struct entity* target, bool log_failure); +void TryInflictConstrictionStatus(struct entity* user, struct entity* target, int animation_id, + bool log_failure); +void TryInflictShadowHoldStatus(struct entity* user, struct entity* target, bool check_only); +void TryInflictIngrainStatus(struct entity* user, struct entity* target); +void TryInflictWrappedStatus(struct entity* user, struct entity* target); +void FreeOtherWrappedMonsters(struct entity* entity); +void TryInflictPetrifiedStatus(struct entity* user, struct entity* target); +void LowerOffensiveStat(struct entity* user, struct entity* target, int stat_idx, int16_t n_stages, bool check_is_protected_from_stat_drops, bool log_message_if_protected_from_stat_drops); -void LowerDefensiveStat(struct entity *user, struct entity *target, - int stat_idx, int16_t n_stages, +void LowerDefensiveStat(struct entity* user, struct entity* target, int stat_idx, int16_t n_stages, bool check_is_protected_from_stat_drops, bool log_message_if_protected_from_stat_drops); -void BoostOffensiveStat(struct entity *user, struct entity *target, - int stat_idx, int16_t n_stages); -void BoostDefensiveStat(struct entity *user, struct entity *target, - int stat_idx, int16_t n_stages); -int FlashFireShouldActivate(struct entity *attacker, struct entity *defender); -void ActivateFlashFire(struct entity *attacker, struct entity *defender); -void ApplyOffensiveStatMultiplier(struct entity *user, struct entity *target, - int stat_idx, int multiplier, - undefined param_5); -void ApplyDefensiveStatMultiplier(struct entity *user, struct entity *target, - int stat_idx, int multiplier, - undefined param_5); -void BoostHitChanceStat(struct entity *user, struct entity *target, - int stat_idx); -void LowerHitChanceStat(struct entity *user, struct entity *target, - int stat_idx, int param_4); -bool TryInflictCringeStatus(struct entity *user, struct entity *target, - bool log_failure, bool check_only); -bool TryInflictParalysisStatus(struct entity *user, struct entity *target, - bool log_failure, bool check_only); -void BoostSpeed(struct entity *user, struct entity *target, int n_stages, - int turns, bool log_failure); -void BoostSpeedOneStage(struct entity *user, struct entity *target, int turns, - bool log_failure); -void LowerSpeed(struct entity *user, struct entity *target, int n_stages, +void BoostOffensiveStat(struct entity* user, struct entity* target, int stat_idx, int16_t n_stages); +void BoostDefensiveStat(struct entity* user, struct entity* target, int stat_idx, int16_t n_stages); +int FlashFireShouldActivate(struct entity* attacker, struct entity* defender); +void ActivateFlashFire(struct entity* attacker, struct entity* defender); +void ApplyOffensiveStatMultiplier(struct entity* user, struct entity* target, int stat_idx, + int multiplier, undefined param_5); +void ApplyDefensiveStatMultiplier(struct entity* user, struct entity* target, int stat_idx, + int multiplier, undefined param_5); +void BoostHitChanceStat(struct entity* user, struct entity* target, int stat_idx); +void LowerHitChanceStat(struct entity* user, struct entity* target, int stat_idx, int param_4); +bool TryInflictCringeStatus(struct entity* user, struct entity* target, bool log_failure, + bool check_only); +bool TryInflictParalysisStatus(struct entity* user, struct entity* target, bool log_failure, + bool check_only); +void BoostSpeed(struct entity* user, struct entity* target, int n_stages, int turns, bool log_failure); -bool TrySealMove(struct entity *user, struct entity *target, bool only_check); -void BoostOrLowerSpeed(struct entity *user, struct entity *target); -void ResetHitChanceStat(struct entity *user, struct entity *target, - int stat_idx, int param_4); -bool ExclusiveItemEffectIsActiveWithLogging( - struct entity *user, struct entity *target, bool should_log, int message_id, - enum exclusive_item_effect_id effect_id); -bool TryActivateQuickFeet(struct entity *attacker, struct entity *defender); -void TryInflictTerrifiedStatus(struct entity *user, struct entity *target); -bool TryInflictGrudgeStatus(struct entity *user, struct entity *target, - bool log_message); -bool TryInflictConfusedStatus(struct entity *user, struct entity *target, - bool log_failure, bool check_only); -bool TryInflictCoweringStatus(struct entity *user, struct entity *target, - bool log_failure, bool check_only); -bool TryRestoreHp(struct entity *user, struct entity *target, - int hp_restoration); -bool TryIncreaseHp(struct entity *user, struct entity *target, - int hp_restoration, int max_hp_boost, bool log_failure); -void RevealItems(struct entity *user, struct entity *target); -void RevealStairs(struct entity *user, struct entity *target); -void RevealEnemies(struct entity *user, struct entity *target); -bool TryInflictLeechSeedStatus(struct entity *user, struct entity *target, - bool log_failure, bool check_only); -void TryInflictDestinyBondStatus(struct entity *user, struct entity *target); -void TryInflictSureShotStatus(struct entity *user, struct entity *target, - uint8_t turns); -void TryInflictWhifferStatus(struct entity *user, struct entity *target, - uint8_t turns, bool only_check); -void TryInflictSetDamageStatus(struct entity *user, struct entity *target); -void TryInflictFocusEnergyStatus(struct entity *user, struct entity *target); -bool TryInflictDecoyStatus(struct entity *user, struct entity *target, - undefined unk_decoy_tracker, bool log_message, - bool only_check); -void TryInflictCurseStatus(struct entity *user, struct entity *target, - bool log_message); -void TryInflictSnatchStatus(struct entity *user, struct entity *target); -bool TryInflictTauntStatus(struct entity *user, struct entity *target, - bool only_check); -bool TryInflictStockpileStatus(struct entity *user, struct entity *target); -void TryInflictInvisibleStatus(struct entity *user, struct entity *target); -bool TryInflictPerishSongStatus(struct entity *user, struct entity *target, - bool only_check); -bool TryInflictEncoreStatus(struct entity *user, struct entity *target, - bool only_check); -void TryDecreaseBelly(struct entity *user, struct entity *target, - int belly_lost, int max_belly_shrink); -void TryIncreaseBelly(struct entity *user, struct entity *target, - int belly_restoration, int max_belly_boost, - bool log_failure); -bool TryInflictMuzzledStatus(struct entity *user, struct entity *target, - bool only_check); -void TryTransform(struct entity *user, struct entity *target); -void TryInflictMobileStatus(struct entity *user, struct entity *target); -bool TryInflictExposedStatus(struct entity *user, struct entity *target, - int effect_id, bool only_check); -void TryActivateIdentifyCondition(struct entity *user, struct entity *target); -bool TryInflictBlinkerStatus(struct entity *user, struct entity *target, - bool check_only, bool is_permanent); -bool IsBlinded(struct entity *entity, bool check_held_item); -bool TryInflictCrossEyedStatus(struct entity *user, struct entity *target, +void BoostSpeedOneStage(struct entity* user, struct entity* target, int turns, bool log_failure); +void LowerSpeed(struct entity* user, struct entity* target, int n_stages, bool log_failure); +bool TrySealMove(struct entity* user, struct entity* target, bool only_check); +void BoostOrLowerSpeed(struct entity* user, struct entity* target); +void ResetHitChanceStat(struct entity* user, struct entity* target, int stat_idx, int param_4); +bool ExclusiveItemEffectIsActiveWithLogging(struct entity* user, struct entity* target, + bool should_log, int message_id, + enum exclusive_item_effect_id effect_id); +bool TryActivateQuickFeet(struct entity* attacker, struct entity* defender); +void TryInflictTerrifiedStatus(struct entity* user, struct entity* target); +bool TryInflictGrudgeStatus(struct entity* user, struct entity* target, bool log_message); +bool TryInflictConfusedStatus(struct entity* user, struct entity* target, bool log_failure, + bool check_only); +bool TryInflictCoweringStatus(struct entity* user, struct entity* target, bool log_failure, + bool check_only); +bool TryRestoreHp(struct entity* user, struct entity* target, int hp_restoration); +bool TryIncreaseHp(struct entity* user, struct entity* target, int hp_restoration, int max_hp_boost, + bool log_failure); +void RevealItems(struct entity* user, struct entity* target); +void RevealStairs(struct entity* user, struct entity* target); +void RevealEnemies(struct entity* user, struct entity* target); +bool TryInflictLeechSeedStatus(struct entity* user, struct entity* target, bool log_failure, bool check_only); -void TryInflictEyedropStatus(struct entity *user, struct entity *target); -bool TryInflictSlipStatus(struct entity *user, struct entity *target); -bool TryInflictDropeyeStatus(struct entity *user, struct entity *target); -void RestoreAllMovePP(struct entity *user, struct entity *target, int pp, - bool suppress_logs); -void RestoreOneMovePP(struct entity *user, struct entity *target, - int move_index, int pp, bool log_message); -void RestoreRandomMovePP(struct entity *user, struct entity *target, int pp, - bool log_message); -void ApplyProteinEffect(struct entity *user, struct entity *target, - int stat_boost); -void ApplyCalciumEffect(struct entity *user, struct entity *target, - int stat_boost); -void ApplyIronEffect(struct entity *user, struct entity *target, - int stat_boost); -void ApplyZincEffect(struct entity *user, struct entity *target, - int stat_boost); -void TryInflictLongTossStatus(struct entity *user, struct entity *target); -void TryInflictPierceStatus(struct entity *user, struct entity *target); -bool TryInflictGastroAcidStatus(struct entity *user, struct entity *target, - bool log_message, bool check_only); -void SetAquaRingHealingCountdownTo4(struct entity *entity); -void ApplyAquaRingHealing(struct entity *entity); -void TryInflictAquaRingStatus(struct entity *user, struct entity *target); -void TryInflictLuckyChantStatus(struct entity *user, struct entity *target); -bool TryInflictHealBlockStatus(struct entity *user, struct entity *target, - bool log_message, bool check_only); -bool MonsterHasEmbargoStatus(struct entity *entity); -void LogItemBlockedByEmbargo(struct entity *entity); -bool TryInflictEmbargoStatus(struct entity *user, struct entity *target, - bool log_message, bool check_only); -bool TryInflictMiracleEyeStatus(struct entity *user, struct entity *target, +void TryInflictDestinyBondStatus(struct entity* user, struct entity* target); +void TryInflictSureShotStatus(struct entity* user, struct entity* target, uint8_t turns); +void TryInflictWhifferStatus(struct entity* user, struct entity* target, uint8_t turns, + bool only_check); +void TryInflictSetDamageStatus(struct entity* user, struct entity* target); +void TryInflictFocusEnergyStatus(struct entity* user, struct entity* target); +bool TryInflictDecoyStatus(struct entity* user, struct entity* target, undefined unk_decoy_tracker, + bool log_message, bool only_check); +void TryInflictCurseStatus(struct entity* user, struct entity* target, bool log_message); +void TryInflictSnatchStatus(struct entity* user, struct entity* target); +bool TryInflictTauntStatus(struct entity* user, struct entity* target, bool only_check); +bool TryInflictStockpileStatus(struct entity* user, struct entity* target); +void TryInflictInvisibleStatus(struct entity* user, struct entity* target); +bool TryInflictPerishSongStatus(struct entity* user, struct entity* target, bool only_check); +bool TryInflictEncoreStatus(struct entity* user, struct entity* target, bool only_check); +void TryDecreaseBelly(struct entity* user, struct entity* target, int belly_lost, + int max_belly_shrink); +void TryIncreaseBelly(struct entity* user, struct entity* target, int belly_restoration, + int max_belly_boost, bool log_failure); +bool TryInflictMuzzledStatus(struct entity* user, struct entity* target, bool only_check); +void TryTransform(struct entity* user, struct entity* target); +void TryInflictMobileStatus(struct entity* user, struct entity* target); +bool TryInflictExposedStatus(struct entity* user, struct entity* target, int effect_id, + bool only_check); +void TryActivateIdentifyCondition(struct entity* user, struct entity* target); +bool TryInflictBlinkerStatus(struct entity* user, struct entity* target, bool check_only, + bool is_permanent); +bool IsBlinded(struct entity* entity, bool check_held_item); +bool TryInflictCrossEyedStatus(struct entity* user, struct entity* target, bool check_only); +void TryInflictEyedropStatus(struct entity* user, struct entity* target); +bool TryInflictSlipStatus(struct entity* user, struct entity* target); +bool TryInflictDropeyeStatus(struct entity* user, struct entity* target); +void RestoreAllMovePP(struct entity* user, struct entity* target, int pp, bool suppress_logs); +void RestoreOneMovePP(struct entity* user, struct entity* target, int move_index, int pp, + bool log_message); +void RestoreRandomMovePP(struct entity* user, struct entity* target, int pp, bool log_message); +void ApplyProteinEffect(struct entity* user, struct entity* target, int stat_boost); +void ApplyCalciumEffect(struct entity* user, struct entity* target, int stat_boost); +void ApplyIronEffect(struct entity* user, struct entity* target, int stat_boost); +void ApplyZincEffect(struct entity* user, struct entity* target, int stat_boost); +void TryInflictLongTossStatus(struct entity* user, struct entity* target); +void TryInflictPierceStatus(struct entity* user, struct entity* target); +bool TryInflictGastroAcidStatus(struct entity* user, struct entity* target, bool log_message, bool check_only); -void TryInflictMagnetRiseStatus(struct entity *user, struct entity *target); -bool IsFloating(struct entity *entity); -void SetTwoTurnInvincibility(struct entity *target, - enum two_turn_invincibility value); -void SetReflectStatus(struct entity *user, struct entity *target, - enum status_reflect_id status); -void TryInflictSafeguardStatus(struct entity *user, struct entity *target); -void TryInflictMistStatus(struct entity *user, struct entity *target); -void TryInflictWishStatus(struct entity *user, struct entity *target); -void TryInflictMagicCoatStatus(struct entity *user, struct entity *target); -void TryInflictLightScreenStatus(struct entity *user, struct entity *target); -void TryInflictReflectStatus(struct entity *user, struct entity *target); -void TryInflictProtectStatus(struct entity *user, struct entity *target); -void TryInflictMirrorCoatStatus(struct entity *user, struct entity *target); -void TryInflictEndureStatus(struct entity *user, struct entity *target); -void TryInflictMirrorMoveStatus(struct entity *user, struct entity *target); -void TryInflictConversion2Status(struct entity *user, struct entity *target); -void TryInflictVitalThrowStatus(struct entity *user, struct entity *target); -void TryResetStatChanges(struct entity *attacker, struct entity *defender, - bool force_animation); -int MirrorMoveIsActive(struct entity *entity); -int MistIsActive(struct entity *entity); -int Conversion2IsActive(struct entity *entity); +void SetAquaRingHealingCountdownTo4(struct entity* entity); +void ApplyAquaRingHealing(struct entity* entity); +void TryInflictAquaRingStatus(struct entity* user, struct entity* target); +void TryInflictLuckyChantStatus(struct entity* user, struct entity* target); +bool TryInflictHealBlockStatus(struct entity* user, struct entity* target, bool log_message, + bool check_only); +bool MonsterHasEmbargoStatus(struct entity* entity); +void LogItemBlockedByEmbargo(struct entity* entity); +bool TryInflictEmbargoStatus(struct entity* user, struct entity* target, bool log_message, + bool check_only); +bool TryInflictMiracleEyeStatus(struct entity* user, struct entity* target, bool check_only); +void TryInflictMagnetRiseStatus(struct entity* user, struct entity* target); +bool IsFloating(struct entity* entity); +void SetTwoTurnInvincibility(struct entity* target, enum two_turn_invincibility value); +void SetReflectStatus(struct entity* user, struct entity* target, enum status_reflect_id status); +void TryInflictSafeguardStatus(struct entity* user, struct entity* target); +void TryInflictMistStatus(struct entity* user, struct entity* target); +void TryInflictWishStatus(struct entity* user, struct entity* target); +void TryInflictMagicCoatStatus(struct entity* user, struct entity* target); +void TryInflictLightScreenStatus(struct entity* user, struct entity* target); +void TryInflictReflectStatus(struct entity* user, struct entity* target); +void TryInflictProtectStatus(struct entity* user, struct entity* target); +void TryInflictMirrorCoatStatus(struct entity* user, struct entity* target); +void TryInflictEndureStatus(struct entity* user, struct entity* target); +void TryInflictMirrorMoveStatus(struct entity* user, struct entity* target); +void TryInflictConversion2Status(struct entity* user, struct entity* target); +void TryInflictVitalThrowStatus(struct entity* user, struct entity* target); +void TryResetStatChanges(struct entity* attacker, struct entity* defender, bool force_animation); +int MirrorMoveIsActive(struct entity* entity); +int MistIsActive(struct entity* entity); +int Conversion2IsActive(struct entity* entity); void ResetAiCanAttackInDirection(void); -int AiConsiderMove(struct ai_possible_move *ai_possible_move, - struct entity *monster, struct move *move); -int TryAddTargetToAiTargetList(int current_num_targets, - struct move_target_and_range move_ai_range, - struct entity *user, struct entity *target, - struct move *move, bool check_all_conditions); -bool IsAiTargetEligible(struct move_target_and_range move_ai_range, - struct entity *user, struct entity *target, - struct move *move, bool check_all_conditions); -int WeightMoveWithIqSkills(struct entity *user, - struct move_target_and_range move_ai_range, - struct entity *target, enum type_id move_type); -bool TargetRegularAttack(struct entity *user, enum direction_id *direction, - bool skip_petrified); -bool IsTargetInRange(struct entity *user, struct entity *target, - enum direction_id direction, int n_tiles); -bool ShouldUsePp(struct entity *entity); -struct move_target_and_range GetEntityMoveTargetAndRange(struct entity *entity, - struct move *move, +int AiConsiderMove(struct ai_possible_move* ai_possible_move, struct entity* monster, + struct move* move); +int TryAddTargetToAiTargetList(int current_num_targets, struct move_target_and_range move_ai_range, + struct entity* user, struct entity* target, struct move* move, + bool check_all_conditions); +bool IsAiTargetEligible(struct move_target_and_range move_ai_range, struct entity* user, + struct entity* target, struct move* move, bool check_all_conditions); +int WeightMoveWithIqSkills(struct entity* user, struct move_target_and_range move_ai_range, + struct entity* target, enum type_id move_type); +bool TargetRegularAttack(struct entity* user, enum direction_id* direction, bool skip_petrified); +bool IsTargetInRange(struct entity* user, struct entity* target, enum direction_id direction, + int n_tiles); +bool ShouldUsePp(struct entity* entity); +struct move_target_and_range GetEntityMoveTargetAndRange(struct entity* entity, struct move* move, bool is_ai); -struct natural_gift_item_info *GetEntityNaturalGiftInfo(struct entity *entity); -enum type_id GetEntityWeatherBallType(struct entity *entity); -void UseMoveByMoveId(struct entity *entity, enum move_id move_id, - bool add_move_if_not_exists); -void ActivateMotorDrive(struct entity *entity); -void TryActivateFrisk(struct entity *attacker, struct entity *defender); -void TryActivateBadDreams(struct entity *entity); -void ActivateStench(struct entity *entity); -void TryActivateSteadfast(struct entity *attacker, struct entity *defender); -bool IsInSpawnList(undefined *spawn_list, enum monster_id monster_id); -int ChangeShayminForme(struct entity *entity, int forme); +struct natural_gift_item_info* GetEntityNaturalGiftInfo(struct entity* entity); +enum type_id GetEntityWeatherBallType(struct entity* entity); +void UseMoveByMoveId(struct entity* entity, enum move_id move_id, bool add_move_if_not_exists); +void ActivateMotorDrive(struct entity* entity); +void TryActivateFrisk(struct entity* attacker, struct entity* defender); +void TryActivateBadDreams(struct entity* entity); +void ActivateStench(struct entity* entity); +void TryActivateSteadfast(struct entity* attacker, struct entity* defender); +bool IsInSpawnList(undefined* spawn_list, enum monster_id monster_id); +int ChangeShayminForme(struct entity* entity, int forme); void ApplyItemEffect(undefined4 param_1, undefined4 param_2, undefined4 param_3, - struct entity *attacker, struct entity *defender, - struct item *thrown_item); -void ApplyCheriBerryEffect(struct entity *user, struct entity *target); -void ApplyPechaBerryEffect(struct entity *user, struct entity *target); -void ApplyRawstBerryEffect(struct entity *user, struct entity *target); -void ApplyHungerSeedEffect(struct entity *user, struct entity *target); -void ApplyVileSeedEffect(struct entity *user, struct entity *target); -void ApplyViolentSeedEffect(struct entity *user, struct entity *target); -void ApplyGinsengEffect(struct entity *user, struct entity *target); -void ApplyBlastSeedEffect(struct entity *user, struct entity *target, - bool thrown); -void ApplyGummiBoostsDungeonMode(struct entity *user, struct entity *target, - enum type_id gummi_type, - int random_stat_boost); -bool CanMonsterUseItem(struct entity *entity, struct item *item); -void ApplyGrimyFoodEffect(struct entity *user, struct entity *target); -void ApplyMixElixirEffect(struct entity *user, struct entity *target); -void ApplyDoughSeedEffect(struct entity *user, struct entity *target); -void ApplyViaSeedEffect(struct entity *user, struct entity *target); -void ApplyGravelyrockEffect(struct entity *user, struct entity *target); -void ApplyGonePebbleEffect(struct entity *user, struct entity *target); -void ApplyGracideaEffect(struct entity *user, struct entity *target); -int GetAiUseItemProbability(struct entity *item_consumer, struct item *item, - uint32_t flags); -bool IsAdjacentToEnemy(struct entity *entity); + struct entity* attacker, struct entity* defender, struct item* thrown_item); +void ApplyCheriBerryEffect(struct entity* user, struct entity* target); +void ApplyPechaBerryEffect(struct entity* user, struct entity* target); +void ApplyRawstBerryEffect(struct entity* user, struct entity* target); +void ApplyHungerSeedEffect(struct entity* user, struct entity* target); +void ApplyVileSeedEffect(struct entity* user, struct entity* target); +void ApplyViolentSeedEffect(struct entity* user, struct entity* target); +void ApplyGinsengEffect(struct entity* user, struct entity* target); +void ApplyBlastSeedEffect(struct entity* user, struct entity* target, bool thrown); +void ApplyGummiBoostsDungeonMode(struct entity* user, struct entity* target, + enum type_id gummi_type, int random_stat_boost); +bool CanMonsterUseItem(struct entity* entity, struct item* item); +void ApplyGrimyFoodEffect(struct entity* user, struct entity* target); +void ApplyMixElixirEffect(struct entity* user, struct entity* target); +void ApplyDoughSeedEffect(struct entity* user, struct entity* target); +void ApplyViaSeedEffect(struct entity* user, struct entity* target); +void ApplyGravelyrockEffect(struct entity* user, struct entity* target); +void ApplyGonePebbleEffect(struct entity* user, struct entity* target); +void ApplyGracideaEffect(struct entity* user, struct entity* target); +int GetAiUseItemProbability(struct entity* item_consumer, struct item* item, uint32_t flags); +bool IsAdjacentToEnemy(struct entity* entity); bool ShouldTryEatItem(enum item_id item_id); -int GetMaxPpWrapper(struct move *move); -void InitMoveWrapper(undefined4 param_1, struct move *move, - enum move_id move_id); +int GetMaxPpWrapper(struct move* move); +void InitMoveWrapper(undefined4 param_1, struct move* move, enum move_id move_id); bool MoveIsNotPhysical(enum move_id move_id); bool CategoryIsNotPhysical(enum move_category category_id); -void MakeFloorOneRoom(struct entity *user); -void TryHurl(struct entity *user, struct entity *target); -void TryDrought(struct entity *user); -void TryTrawl(struct entity *user); -void TryPounce(struct entity *user, struct entity *target, - enum direction_id direction); -void TryBlowAway(struct entity *user, struct entity *target, - enum direction_id direction); -void TryExplosion(struct entity *user, struct entity *target, - struct position *pos, int radius, enum type_id attack_type, - union damage_source damage_source); -void TryAftermathExplosion(struct entity *user, struct entity *target, - struct position *pos, int radius, - enum type_id attack_type, - union damage_source damage_source); -void TryWarp(struct entity *user, struct entity *target, - enum warp_type warp_type, struct position *position); -void EnsureCanStandCurrentTile(struct entity *entity); -void UseMove(struct entity *entity, uint16_t move_index, undefined4 param_3, - undefined4 param_4, undefined4 param5); -void TryActivateNondamagingDefenderAbility(struct entity *entity); -void TryActivateNondamagingDefenderExclusiveItem(struct entity *attacker, - struct entity *defender); -int GetMoveRangeDistance(struct entity *user, struct move *move, - bool check_two_turn_moves); -bool MoveHitCheck(struct entity *attacker, struct entity *defender, - struct move *move, bool use_second_accuracy, - bool never_miss_self); -void BuildMoveTargetList(struct target_list *output, struct entity *user, - struct move *move); -bool IsHyperBeamVariant(struct move *move); -bool IsChargingTwoTurnMove(struct entity *user, struct move *move); -bool IsChargingAnyTwoTurnMove(struct entity *entity, bool charge_check_unused); -bool HasMaxGinsengBoost99(struct move *move); -bool TwoTurnMoveForcedMiss(struct entity *target, struct move *move); -bool DungeonRandOutcomeUserTargetInteraction(struct entity *user, - struct entity *target, +void MakeFloorOneRoom(struct entity* user); +void TryHurl(struct entity* user, struct entity* target); +void TryDrought(struct entity* user); +void TryTrawl(struct entity* user); +void TryPounce(struct entity* user, struct entity* target, enum direction_id direction); +void TryBlowAway(struct entity* user, struct entity* target, enum direction_id direction); +void TryExplosion(struct entity* user, struct entity* target, struct position* pos, int radius, + enum type_id attack_type, union damage_source damage_source); +void TryAftermathExplosion(struct entity* user, struct entity* target, struct position* pos, + int radius, enum type_id attack_type, union damage_source damage_source); +void TryWarp(struct entity* user, struct entity* target, enum warp_type warp_type, + struct position* position); +void EnsureCanStandCurrentTile(struct entity* entity); +void UseMove(struct entity* entity, uint16_t move_index, undefined4 param_3, undefined4 param_4, + undefined4 param5); +void TryActivateNondamagingDefenderAbility(struct entity* entity); +void TryActivateNondamagingDefenderExclusiveItem(struct entity* attacker, struct entity* defender); +int GetMoveRangeDistance(struct entity* user, struct move* move, bool check_two_turn_moves); +bool MoveHitCheck(struct entity* attacker, struct entity* defender, struct move* move, + bool use_second_accuracy, bool never_miss_self); +void BuildMoveTargetList(struct target_list* output, struct entity* user, struct move* move); +bool IsHyperBeamVariant(struct move* move); +bool IsChargingTwoTurnMove(struct entity* user, struct move* move); +bool IsChargingAnyTwoTurnMove(struct entity* entity, bool charge_check_unused); +bool HasMaxGinsengBoost99(struct move* move); +bool TwoTurnMoveForcedMiss(struct entity* target, struct move* move); +bool DungeonRandOutcomeUserTargetInteraction(struct entity* user, struct entity* target, int percentage); -bool DungeonRandOutcomeUserAction(struct entity *user, int percentage); -bool CanAiUseMove(struct entity *monster, int move_index, bool extra_checks); -bool CanMonsterUseMove(struct entity *monster, struct move *move, - bool extra_checks); -void UpdateMovePp(struct entity *entity, bool can_consume_pp); -union damage_source GetDamageSourceWrapper(struct move *move, - enum item_id item_id); +bool DungeonRandOutcomeUserAction(struct entity* user, int percentage); +bool CanAiUseMove(struct entity* monster, int move_index, bool extra_checks); +bool CanMonsterUseMove(struct entity* monster, struct move* move, bool extra_checks); +void UpdateMovePp(struct entity* entity, bool can_consume_pp); +union damage_source GetDamageSourceWrapper(struct move* move, enum item_id item_id); int LowerSshort(int x); -void PlayMoveAnimation(struct entity *user, struct entity *target, - struct move *move, struct position *position); -uint16_t GetMoveAnimationId(struct move *move, enum weather_id apparent_weather, +void PlayMoveAnimation(struct entity* user, struct entity* target, struct move* move, + struct position* position); +uint16_t GetMoveAnimationId(struct move* move, enum weather_id apparent_weather, bool should_play_alternative_animation); -bool ShouldMovePlayAlternativeAnimation(struct entity *user, struct move *move); -void ExecuteMoveEffect(struct target_list *targets, struct entity *attacker, - struct move *move, undefined4 param_4, - undefined4 param_5); -bool DoMoveDamageInlined(struct entity *attacker, struct entity *defender, - struct move *move, enum item_id item_id); -int DealDamage(struct entity *attacker, struct entity *defender, - struct move *move, fx32_8 damage_mult_fp, enum item_id item_id); -int DealDamageWithTypeAndPowerBoost(struct entity *attacker, - struct entity *defender, struct move *move, - fx32_8 damage_mult_fp, enum item_id item_id, - enum type_id attack_type, - int16_t power_boost); -int DealDamageProjectile(struct entity *attacker, struct entity *defender, - struct move *move, int power, fx32_8 damage_mult_fp, +bool ShouldMovePlayAlternativeAnimation(struct entity* user, struct move* move); +void ExecuteMoveEffect(struct target_list* targets, struct entity* attacker, struct move* move, + undefined4 param_4, undefined4 param_5); +bool DoMoveDamageInlined(struct entity* attacker, struct entity* defender, struct move* move, enum item_id item_id); -int DealDamageWithType(struct entity *attacker, struct entity *defender, - enum type_id attack_type, struct move *move, - fx32_8 damage_mult_fp, enum item_id item_id); -int PerformDamageSequence(struct entity *attacker, struct entity *defender, - struct move *move, struct damage_data *damage_out, - union damage_source damage_source); -bool CanHitWithRegularAttack(struct entity *attacker, struct entity *defender); -bool StatusCheckerCheck(struct entity *attacker, struct move *move); -bool StatusCheckerCheckOnTarget(struct entity *attacker, struct entity *target, - struct move *move); -bool HasLastUsedMove(struct move *moves); -enum weather_id GetApparentWeather(struct entity *entity); -void TryWeatherFormChange(struct entity *entity); +int DealDamage(struct entity* attacker, struct entity* defender, struct move* move, + fx32_8 damage_mult_fp, enum item_id item_id); +int DealDamageWithTypeAndPowerBoost(struct entity* attacker, struct entity* defender, + struct move* move, fx32_8 damage_mult_fp, enum item_id item_id, + enum type_id attack_type, int16_t power_boost); +int DealDamageProjectile(struct entity* attacker, struct entity* defender, struct move* move, + int power, fx32_8 damage_mult_fp, enum item_id item_id); +int DealDamageWithType(struct entity* attacker, struct entity* defender, enum type_id attack_type, + struct move* move, fx32_8 damage_mult_fp, enum item_id item_id); +int PerformDamageSequence(struct entity* attacker, struct entity* defender, struct move* move, + struct damage_data* damage_out, union damage_source damage_source); +bool CanHitWithRegularAttack(struct entity* attacker, struct entity* defender); +bool StatusCheckerCheck(struct entity* attacker, struct move* move); +bool StatusCheckerCheckOnTarget(struct entity* attacker, struct entity* target, struct move* move); +bool HasLastUsedMove(struct move* moves); +enum weather_id GetApparentWeather(struct entity* entity); +void TryWeatherFormChange(struct entity* entity); void ActivateSportCondition(bool water_sport); bool TryActivateWeather(bool param_1, bool param_2); int DigitCount(int n); void LoadTextureUi(void); -int GetPaletteBaseAddressOv29(undefined4 pal_vram_offset_upper, - undefined4 pal_vram_offset_lower); +int GetPaletteBaseAddressOv29(undefined4 pal_vram_offset_upper, undefined4 pal_vram_offset_lower); int DisplayNumberTextureUi(int16_t x, int16_t y, int n, int ally_mode); -int DisplayCharTextureUi(struct render_3d_element_64 *element64, int16_t x, - int16_t y, int char_id, int16_t param_5); +int DisplayCharTextureUi(struct render_3d_element_64* element64, int16_t x, int16_t y, int char_id, + int16_t param_5); void DisplayUi(void); -struct tile *GetTile(int x, int y); -struct tile *GetTileSafe(int x, int y); +struct tile* GetTile(int x, int y); +struct tile* GetTileSafe(int x, int y); bool IsFullFloorFixedRoom(void); bool IsCurrentTilesetBackground(void); void TrySpawnGoldenChamber(void); void CountItemsOnFloorForAcuteSniffer(void); -void GetStairsSpawnPosition(int16_t *x, int16_t *y); +void GetStairsSpawnPosition(int16_t* x, int16_t* y); bool PositionIsOnStairs(int x, int y); uint8_t GetStairsRoom(void); uint16_t GetDefaultTileTextureId(void); void DetermineAllTilesWalkableNeighbors(void); void DetermineTileWalkableNeighbors(int x, int y); void UpdateTrapsVisibility(void); -void DrawTileGrid(struct position *pos, undefined param_2, undefined param_3, - undefined param_4); +void DrawTileGrid(struct position* pos, undefined param_2, undefined param_3, undefined param_4); void HideTileGrid(void); -void DiscoverMinimap(struct position *pos); -bool PositionHasItem(struct position *pos); -bool PositionHasMonster(struct position *pos); -bool TrySmashWall(struct position *pos); -bool IsTileGround(struct position *pos); +void DiscoverMinimap(struct position* pos); +bool PositionHasItem(struct position* pos); +bool PositionHasMonster(struct position* pos); +bool TrySmashWall(struct position* pos); +bool IsTileGround(struct position* pos); bool IsWaterTileset(void); enum monster_id GetRandomSpawnMonsterID(void); -bool NearbyAllyIqSkillIsEnabled(struct entity *entity, - enum iq_skill_id iq_skill); -struct entity *FindAdjacentEnemy(struct entity *monster); -bool IsAdjacentToEnemyIgnoreTreatment(struct entity *monster); +bool NearbyAllyIqSkillIsEnabled(struct entity* entity, enum iq_skill_id iq_skill); +struct entity* FindAdjacentEnemy(struct entity* monster); +bool IsAdjacentToEnemyIgnoreTreatment(struct entity* monster); void ResetGravity(void); bool GravityIsActive(void); bool TryActivateGravity(void); -void RevealAttackedTile(struct position *pos); +void RevealAttackedTile(struct position* pos); void ResetVictoryCounter(void); bool ShouldBoostKecleonShopSpawnChance(void); void SetShouldBoostKecleonShopSpawnChance(bool value); @@ -1018,7 +843,7 @@ bool IsSecretRoom(void); bool IsSecretFloor(void); enum hidden_stairs_type GetCurrentHiddenStairsType(void); bool HiddenStairsPresent(void); -bool PositionIsOnHiddenStairs(struct position *position); +bool PositionIsOnHiddenStairs(struct position* position); void HiddenStairsTrigger(bool show_message); enum hidden_stairs_type GetHiddenStairsField(void); void SetHiddenStairsField(enum hidden_stairs_type hidden_stairs); @@ -1026,7 +851,7 @@ enum hidden_stairs_type GetHiddenFloorField(void); void SetHiddenFloorField(enum hidden_stairs_type hidden_floor); void LoadWeather3DFiles(void); void RenderWeather3D(void); -struct minimap_display_data *GetMinimapData(void); +struct minimap_display_data* GetMinimapData(void); void DrawMinimapTile(int x, int y); void FlashLeaderIcon(undefined param_1); void UpdateMinimap(void); @@ -1034,50 +859,225 @@ void SetMinimapDataE447(uint8_t value); uint8_t GetMinimapDataE447(void); void SetMinimapDataE448(uint8_t value); void InitWeirdMinimapMatrix(void); -void InitMinimapDisplayTile(struct minimap_display_tile *minimap_display_tile, - undefined *ptr); +void InitMinimapDisplayTile(struct minimap_display_tile* minimap_display_tile, undefined* ptr); void LoadFixedRoomDataVeneer(void); void UnloadFixedRoomData(void); bool IsNormalFloor(void); void GenerateFloor(void); -enum terrain_type GetTileTerrain(struct tile *tile); +enum terrain_type GetTileTerrain(struct tile* tile); uint32_t DungeonRand100(void); void ClearHiddenStairs(void); void FlagHallwayJunctions(int x0, int y0, int x1, int y1); -void GenerateStandardFloor(int grid_size_x, int grid_size_y, - struct floor_properties *floor_props); -void GenerateOuterRingFloor(struct floor_properties *floor_props); -void GenerateCrossroadsFloor(struct floor_properties *floor_props); -void GenerateLineFloor(struct floor_properties *floor_props); -void GenerateCrossFloor(struct floor_properties *floor_props); -void GenerateBeetleFloor(struct floor_properties *floor_props); -void MergeRoomsVertically(int x, int y0, int dy, - struct dungeon_grid_cell *grid); +void GenerateStandardFloor(int grid_size_x, int grid_size_y, struct floor_properties* floor_props); +void GenerateOuterRingFloor(struct floor_properties* floor_props); +void GenerateCrossroadsFloor(struct floor_properties* floor_props); +void GenerateLineFloor(struct floor_properties* floor_props); +void GenerateCrossFloor(struct floor_properties* floor_props); +void GenerateBeetleFloor(struct floor_properties* floor_props); +void MergeRoomsVertically(int x, int y0, int dy, struct dungeon_grid_cell* grid); void GenerateOuterRoomsFloor(int grid_size_x, int grid_size_y, - struct floor_properties *floor_props); + struct floor_properties* floor_props); bool IsNotFullFloorFixedRoom(enum fixed_room_id fixed_room_id); -bool GenerateFixedRoom(enum fixed_room_id fixed_room_id, - struct floor_properties *floor_props); +bool GenerateFixedRoom(enum fixed_room_id fixed_room_id, struct floor_properties* floor_props); void GenerateOneRoomMonsterHouseFloor(void); void GenerateTwoRoomsWithMonsterHouseFloor(void); -void GenerateExtraHallways(struct dungeon_grid_cell *grid, int grid_size_x, - int grid_size_y, int n_extra_hallways); -void GetGridPositions(int *grid_starts_x, int *grid_starts_y, int grid_size_x, - int grid_size_y); -void InitDungeonGrid(struct dungeon_grid_cell *grid, int grid_size_x, - int grid_size_y); -void AssignRooms(struct dungeon_grid_cell *grid, int grid_size_x, - int grid_size_y, int n_rooms); -void CreateRoomsAndAnchors(struct dungeon_grid_cell *grid, int grid_size_x, - int grid_size_y, int *grid_starts_x, - int *grid_starts_y, struct room_flags room_flags); -void GenerateSecondaryStructures(struct dungeon_grid_cell *grid, - int grid_size_x, int grid_size_y); -void AssignGridCellConnections(struct dungeon_grid_cell *grid, int grid_size_x, - int grid_size_y, int cursor_x, int cursor_y, - struct floor_properties *floor_props); -void CreateGridCellConnections(struct dungeon_grid_cell *grid, int grid_size_x, - int grid_size_y, int *grid_starts_x, - int *grid_starts_y, bool disable_room_merging); -void GenerateRoomImperfections(struct dungeon_grid_cell *grid, int grid_size_x, - int grid_size_y); +void GenerateExtraHallways(struct dungeon_grid_cell* grid, int grid_size_x, int grid_size_y, + int n_extra_hallways); +void GetGridPositions(int* grid_starts_x, int* grid_starts_y, int grid_size_x, int grid_size_y); +void InitDungeonGrid(struct dungeon_grid_cell* grid, int grid_size_x, int grid_size_y); +void AssignRooms(struct dungeon_grid_cell* grid, int grid_size_x, int grid_size_y, int n_rooms); +void CreateRoomsAndAnchors(struct dungeon_grid_cell* grid, int grid_size_x, int grid_size_y, + int* grid_starts_x, int* grid_starts_y, struct room_flags room_flags); +void GenerateSecondaryStructures(struct dungeon_grid_cell* grid, int grid_size_x, int grid_size_y); +void AssignGridCellConnections(struct dungeon_grid_cell* grid, int grid_size_x, int grid_size_y, + int cursor_x, int cursor_y, struct floor_properties* floor_props); +void CreateGridCellConnections(struct dungeon_grid_cell* grid, int grid_size_x, int grid_size_y, + int* grid_starts_x, int* grid_starts_y, bool disable_room_merging); +void GenerateRoomImperfections(struct dungeon_grid_cell* grid, int grid_size_x, int grid_size_y); +void CreateHallway(int x0, int y0, int x1, int y1, bool vertical, int x_mid, int y_mid); +void EnsureConnectedGrid(struct dungeon_grid_cell* grid, int grid_size_x, int grid_size_y, + int* grid_starts_x, int* grid_starts_y); +void SetTerrainObstacleChecked(struct tile* tile, bool use_secondary_terrain, uint8_t room); +void FinalizeJunctions(void); +void GenerateKecleonShop(struct dungeon_grid_cell* grid, int grid_size_x, int grid_size_y, + int spawn_chance); +void GenerateMonsterHouse(struct dungeon_grid_cell* grid, int grid_size_x, int grid_size_y, + int spawn_chance); +void GenerateMazeRoom(struct dungeon_grid_cell* grid, int grid_size_x, int grid_size_y, + int spawn_chance); +void GenerateMaze(struct dungeon_grid_cell* grid_cell, bool use_secondary_terrain); +void GenerateMazeLine(int x0, int y0, int xmin, int ymin, int xmax, int ymax, + bool use_secondary_terrain, uint8_t room); +void SetSpawnFlag5(struct dungeon_grid_cell* grid_cell); +bool IsNextToHallway(int x, int y); +void ResolveInvalidSpawns(void); +void ConvertSecondaryTerrainToChasms(void); +void EnsureImpassableTilesAreWalls(void); +void InitializeTile(struct tile* tile); +void ResetFloor(void); +bool PosIsOutOfBounds(int x, int y); +void ShuffleSpawnPositions(struct spawn_position* spawn_positions, int n_spawn_positions); +void MarkNonEnemySpawns(struct floor_properties* floor_props, bool empty_monster_house); +void MarkEnemySpawns(struct floor_properties* floor_props, bool empty_monster_house); +void SetSecondaryTerrainOnWall(struct tile* tile); +void GenerateSecondaryTerrainFormations(uint8_t test_flag, struct floor_properties* floor_props); +bool StairsAlwaysReachable(int x_stairs, int y_stairs, bool mark_unreachable); +union fixed_room_action GetNextFixedRoomAction(void); +void ConvertWallsToChasms(void); +void ResetInnerBoundaryTileRows(void); +void ResetImportantSpawnPositions(struct dungeon_generation_info* gen_info); +void SpawnStairs(uint8_t* pos, struct dungeon_generation_info* gen_info, + enum hidden_stairs_type hidden_stairs_type); +enum hidden_stairs_type GetHiddenStairsType(struct dungeon_generation_info* gen_info, + struct floor_properties* floor_props); +int GetFinalKecleonShopSpawnChance(int base_kecleon_shop_chance); +void ResetHiddenStairsSpawn(void); +void PlaceFixedRoomTile(struct tile* tile, union fixed_room_action action, int x, int y, + bool place_item_or_trap); +enum direction_id FixedRoomActionParamToDirection(uint8_t fixed_room_action_param); +void ApplyKeyEffect(struct entity* user, struct entity* target); +void LoadFixedRoomData(void); +int LoadFixedRoom(int param_1, int param_2, int param_3, undefined4 param_4); +void OpenFixedBin(void); +void CloseFixedBin(void); +bool AreOrbsAllowed(enum fixed_room_id fixed_room_id); +bool AreTileJumpsAllowed(enum fixed_room_id fixed_room_id); +bool AreTrawlOrbsAllowed(enum fixed_room_id fixed_room_id); +bool AreOrbsAllowedVeneer(enum fixed_room_id fixed_room_id); +bool AreLateGameTrapsEnabled(enum fixed_room_id fixed_room_id); +bool AreMovesEnabled(enum fixed_room_id fixed_room_id); +bool IsRoomIlluminated(enum fixed_room_id fixed_room_id); +enum monster_id GetMatchingMonsterId(enum monster_id monster_id, undefined4 param_2, + undefined4 param_3); +void GenerateItemExplicit(struct item* item, enum item_id item_id, uint16_t quantity, bool sticky); +void GenerateAndSpawnItem(enum item_id item_id, int16_t x, int16_t y, uint16_t quantity, + bool sticky, bool check_in_bag); +bool IsHiddenStairsFloor(void); +bool IsSecretBazaarVeneer(void); +void InteractWithSecretBazaarNpc(struct entity* user, struct entity* shopkeeper); +void PrepareItemForPrinting(uint8_t tag_id, struct item* item); +void PrepareItemForPrinting2(struct preprocessor_args* preprocessor_args, uint8_t tag_id, + struct item* item); +void GenerateStandardItem(struct item* item, enum item_id item_id, + enum gen_item_stickiness sticky_type); +void GenerateCleanItem(struct item* item, enum item_id item_id); +void TryLeaderItemPickUp(struct position* position, bool flag); +bool SpawnItem(struct position* position, struct item* item, bool flag); +void RemoveGroundItem(struct position* position, bool update_shop_counters); +void SpawnDroppedItemWrapper(struct entity* entity, struct position* pos, struct item* item, + undefined4 param_4); +void SpawnDroppedItem(struct entity* entity, struct entity* item_entity, struct item* item, + int param_4, int16_t* dir_xy, undefined param_6); +bool TryGenerateUnownStoneDrop(struct item* item, enum monster_id monster_id); +bool HasHeldItem(struct entity* entity, enum item_id item_id); +void GenerateMoneyQuantity(struct item* item, int max_amount); +bool CheckTeamItemsFlags(int flags); +void AddHeldItemToBag(struct monster* monster); +void RemoveEmptyItemsInBagWrapper(void); +void GenerateItem(struct item* item, enum item_id item_id, uint16_t quantity, + enum gen_item_stickiness sticky_type); +void HandleCurvedProjectileThrow(struct entity* user, struct item* item, struct position* start_pos, + struct position* target_pos, + struct projectile_throw_info* projectile_throw_info); +bool DoesProjectileHitTarget(struct entity* user, struct entity* target); +void DisplayFloorCard(int duration); +void HandleFloorCard(enum dungeon_id dungeon_id, uint8_t floor, int duration, + enum hidden_stairs_type hidden_stairs_type); +void FillMissionDestinationInfo(void); +undefined4 MissionExitPrompt(int string_id); +bool IsItemUnkMissionItem2(struct item* item); +bool CheckActiveChallengeRequest(void); +struct mission_destination_info* GetMissionDestination(void); +bool IsOutlawOrChallengeRequestFloor(void); +bool IsDestinationFloor(void); +bool IsCurrentMissionType(enum mission_type type); +bool IsCurrentMissionTypeExact(enum mission_type type, union mission_subtype subtype); +bool IsOutlawMonsterHouseFloor(void); +bool IsGoldenChamber(void); +bool IsLegendaryChallengeFloor(void); +bool IsJirachiChallengeFloor(void); +bool IsDestinationFloorWithMonster(void); +void LoadMissionMonsterSprites(void); +bool MissionTargetEnemyIsDefeated(void); +void SetMissionTargetEnemyDefeated(bool defeated); +bool IsDestinationFloorWithFixedRoom(void); +enum item_id GetItemToRetrieve(void); +enum item_id GetItemToDeliver(void); +enum item_id GetSpecialTargetItem(void); +bool IsDestinationFloorWithItem(void); +bool IsDestinationFloorWithHiddenOutlaw(void); +bool IsDestinationFloorWithFleeingOutlaw(void); +enum monster_id GetMissionTargetEnemy(void); +enum monster_id GetMissionEnemyMinionGroup(int i); +void SetTargetMonsterNotFoundFlag(bool value); +bool GetTargetMonsterNotFoundFlag(void); +void ClearMissionDestinationInfo(struct mission_destination_info* mission_dest_info); +bool FloorHasMissionMonster(struct mission_destination_info* mission_dst); +struct mission* GetMissionIfActiveOnFloor(struct dungeon_floor_pair* pair, uint8_t mission_id); +void GenerateMissionEggMonster(struct mission* mission); +struct entity* GetFirstExperienceLockedTeamMember(void); +void TryCompleteMission(undefined param_1, undefined param_2); +void TreasureMemoComplete(void); +void TeleportFleeingOutlaw(void); +void InitAlertBoxInfo(void); +void FreeAlertBoxInfo(void); +void SetMessageLogGroupStartFlag(bool should_start_group); +struct preprocessor_args* GetMessageLogPreprocessorArgs(void); +void InitMessageLogPreprocessorArgs(void); +void SetMessageLogPreprocessorArgsFlagVal(uint8_t pos, uint32_t val); +void SetMessageLogPreprocessorArgsIdVal(uint8_t pos, uint32_t val); +void SetMessageLogPreprocessorArgsNumberVal(uint8_t pos, uint32_t val); +void SetMessageLogPreprocessorArgsString(uint8_t pos, char* string); +void SetMessageLogPreprocessorArgsStringToName(uint8_t pos, enum monster_id monster_id); +void SetMessageLogPreprocessorArgsSpeakerId(enum monster_id monster_id); +void SetMessageLogPreprocessorArgsSpeakerId0x30000(int16_t team_index); +void LogMessageByIdWithPopupAndAbility(struct entity* user, struct entity* target, int message_id, + int idx, int16_t val); +void WaitUntilAlertBoxTextIsLoadedWrapper(void); +void LogMessageByIdWithPopupCheckUser(struct entity* user, int message_id); +void LogMessageWithPopupCheckUser(struct entity* user, const char* message); +void LogMessageByIdQuiet(struct entity* user, int message_id); +void LogMessageQuiet(struct entity* user, const char* message); +void LogMessageByIdWithPopupCheckUserTarget(struct entity* user, struct entity* target, + int message_id); +void LogMessageWithPopupCheckUserTarget(struct entity* user, struct entity* target, + const char* message); +void LogMessageByIdQuietCheckUserTarget(struct entity* user, struct entity* target, int message_id); +void LogMessageByIdWithPopupCheckUserUnknown(struct entity* user, undefined4* param_2, + int message_id); +void LogMessageByIdWithPopup(struct entity* user, int message_id); +void LogMessageWithPopup(struct entity* user, const char* message); +void LogMessage(struct entity* user, const char* message, bool show_popup); +void LogMessageById(struct entity* user, int message_id, bool show_popup); +bool AlertBoxIsScrolling(void); +void WaitUntilAlertBoxTextIsLoaded(undefined param_1); +void InitPortraitDungeon(struct portrait_params* portrait, enum monster_id monster_id, + enum portrait_emotion emotion); +void OpenMessageLog(undefined4 param_1, undefined4 param_2); +bool RunDungeonMode(undefined4* param_1, undefined4 param_2); +void StartFadeDungeon(struct dungeon_fade* fstruct, int delta_delta_brightness, + enum fade_status_dungeon fade_type); +void StartFadeDungeonWrapper(int fade_type, int delta_delta_brightness, enum screen screen); +void HandleFadesDungeon(enum screen screen); +void HandleFadesDungeonBothScreens(); +bool DisplayFloorTip(void); +bool DisplayItemTip(enum item_id item_id); +bool DisplayDungeonTip(struct message_tip* message_tip, bool log); +void SetBothScreensWindowColorToDefault(void); +int GetPersonalityIndex(struct monster* monster); +void DisplayMessage(struct portrait_params* portrait, int message_id, bool wait_for_input); +void DisplayMessage2(struct portrait_params* portrait, int message_id, bool wait_for_input); +bool YesNoMenu(undefined param_1, int string_id, int default_option, undefined param_4); +void DisplayMessageInternal(int message_id, bool wait_for_input, struct portrait_params* portrait, + undefined4 param_4, undefined4 param_5, undefined4 param_6); +void PrintMissionCompleteString(int string_id, undefined4 param_2, undefined4 param_3, + undefined4 param_4, undefined1 param_5); +void InitSecretBazaarDialogueInfo(void); +void OpenMenu(undefined param_1, undefined param_2, bool open_bag); +void StairsMenuAfterStep(struct entity* leader, bool leave_minimap_closed_after); +int DungeonModeSetupAndShowNameKeyboard(char* str_keyboard_result, char* buffer, + undefined4 param_3); +int OthersMenuLoop(void); +undefined OthersMenu(void); + +#endif From 995c1b8996062dc714b240d8e5904018d8ab81e1 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Thu, 18 Jun 2026 22:47:21 -0400 Subject: [PATCH 093/117] Revert "Update arm9.h" This reverts commit 77ca8c58afb1c6cbb92379f8c580c57191940c12. --- headers/functions/arm9.h | 1598 +++++++++++++++++--------------------- 1 file changed, 726 insertions(+), 872 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 95a76647..b2b3a7af 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -16,47 +16,42 @@ void NitroMain(void); void InitMemAllocTable(void); void SetMemAllocatorParams(get_alloc_arena_fn_t get_alloc_arena, get_free_arena_fn_t get_free_arena); -struct mem_arena *GetAllocArenaDefault(struct mem_arena *arena, uint32_t flags); -struct mem_arena *GetFreeArenaDefault(struct mem_arena *arena, uint32_t flags); -void InitMemArena(struct mem_arena *arena, struct iovec *mem, - struct mem_block *blocks, uint32_t max_blocks); +struct mem_arena* GetAllocArenaDefault(struct mem_arena* arena, uint32_t flags); +struct mem_arena* GetFreeArenaDefault(struct mem_arena* arena, uint32_t flags); +void InitMemArena(struct mem_arena* arena, struct iovec* mem, struct mem_block* blocks, + uint32_t max_blocks); uint32_t MemAllocFlagsToBlockType(uint32_t alloc_flags); -int FindAvailableMemBlock(struct mem_arena *arena, uint32_t alloc_flags, - uint32_t len); -struct mem_block *SplitMemBlock(struct mem_arena *arena, uint32_t idx, - uint32_t alloc_flags, uint32_t len, - uint32_t user_flags); -void *MemAlloc(uint32_t len, uint32_t flags); -void MemFree(void *ptr); -struct mem_arena *MemArenaAlloc(struct mem_arena *parent_arena, uint32_t len, - uint32_t max_blocks, uint32_t flags); -struct mem_arena *CreateMemArena(struct iovec *mem, uint32_t max_blocks); -void *MemLocateSet(struct mem_arena *arena, uint32_t len, uint32_t flags); -void MemLocateUnset(struct mem_arena *arena, void *ptr); +int FindAvailableMemBlock(struct mem_arena* arena, uint32_t alloc_flags, uint32_t len); +struct mem_block* SplitMemBlock(struct mem_arena* arena, uint32_t idx, uint32_t alloc_flags, + uint32_t len, uint32_t user_flags); +void* MemAlloc(uint32_t len, uint32_t flags); +void MemFree(void* ptr); +struct mem_arena* MemArenaAlloc(struct mem_arena* parent_arena, uint32_t len, uint32_t max_blocks, + uint32_t flags); +struct mem_arena* CreateMemArena(struct iovec* mem, uint32_t max_blocks); +void* MemLocateSet(struct mem_arena* arena, uint32_t len, uint32_t flags); +void MemLocateUnset(struct mem_arena* arena, void* ptr); int RoundUpDiv256(int x); int SinAbs4096(int x); int CosAbs4096(int x); -bool UFixedPoint64CmpLt(int32_t x_upper, uint32_t x_lower, int32_t y_upper, - uint32_t y_lower); +bool UFixedPoint64CmpLt(int32_t x_upper, uint32_t x_lower, int32_t y_upper, uint32_t y_lower); int MultiplyByFixedPoint(int x, fx32_8 mult_fp); uint32_t UMultiplyByFixedPoint(uint32_t x, ufx32_8 mult_fp); -void IntToFixedPoint64(struct fx64_16 *out, int x); -int FixedPoint64ToInt(struct fx64_16 *x); -void FixedPoint32To64(struct fx64_16 *out, fx32_8 x_fp); -void NegateFixedPoint64(struct fx64_16 *x); -bool FixedPoint64IsZero(struct fx64_16 *x); -bool FixedPoint64IsNegative(struct fx64_16 *x); -bool FixedPoint64CmpLt(struct fx64_16 *x, struct fx64_16 *y); -void MultiplyFixedPoint64(struct fx64_16 *prod, struct fx64_16 *x, - struct fx64_16 *y); -void DivideFixedPoint64(struct fx64_16 *quotient, struct fx64_16 *dividend, - struct fx64_16 *divisor); -void UMultiplyFixedPoint64(struct fx64_16 *prod, struct fx64_16 *x, - struct fx64_16 *y); -void UDivideFixedPoint64(struct fx64_16 *quotient, struct fx64_16 *dividend, - struct fx64_16 *divisor); -void AddFixedPoint64(struct fx64_16 *sum, struct fx64_16 *x, struct fx64_16 *y); -void ClampedLn(struct fx64_16 *out, int x); +void IntToFixedPoint64(struct fx64_16* out, int x); +int FixedPoint64ToInt(struct fx64_16* x); +void FixedPoint32To64(struct fx64_16* out, fx32_8 x_fp); +void NegateFixedPoint64(struct fx64_16* x); +bool FixedPoint64IsZero(struct fx64_16* x); +bool FixedPoint64IsNegative(struct fx64_16* x); +bool FixedPoint64CmpLt(struct fx64_16* x, struct fx64_16* y); +void MultiplyFixedPoint64(struct fx64_16* prod, struct fx64_16* x, struct fx64_16* y); +void DivideFixedPoint64(struct fx64_16* quotient, struct fx64_16* dividend, + struct fx64_16* divisor); +void UMultiplyFixedPoint64(struct fx64_16* prod, struct fx64_16* x, struct fx64_16* y); +void UDivideFixedPoint64(struct fx64_16* quotient, struct fx64_16* dividend, + struct fx64_16* divisor); +void AddFixedPoint64(struct fx64_16* sum, struct fx64_16* x, struct fx64_16* y); +void ClampedLn(struct fx64_16* out, int x); uint16_t GetRngSeed(void); void SetRngSeed(uint16_t seed); uint16_t Rand16Bit(void); @@ -69,16 +64,16 @@ void WaitForever(void); uint16_t InterruptMasterDisable(void); uint16_t InterruptMasterEnable(void); void InitMemAllocTableVeneer(void); -void ZInit8(void *ptr); -bool PointsToZero(int *ptr); -void MemZero(void *ptr, uint32_t len); -void MemZero16(void *ptr, int len); -void MemZero32(void *ptr, int len); -void MemsetSimple(void *ptr, char val, uint32_t len); -void Memset32(void *ptr, int val, int len); -void MemcpySimple(void *dest, void *src, uint32_t n); -void Memcpy16(void *dest, void *src, int n); -void Memcpy32(void *dest, void *src, int n); +void ZInit8(void* ptr); +bool PointsToZero(int* ptr); +void MemZero(void* ptr, uint32_t len); +void MemZero16(void* ptr, int len); +void MemZero32(void* ptr, int len); +void MemsetSimple(void* ptr, char val, uint32_t len); +void Memset32(void* ptr, int val, int len); +void MemcpySimple(void* dest, void* src, uint32_t n); +void Memcpy16(void* dest, void* src, int n); +void Memcpy32(void* dest, void* src, int n); void TaskProcBoot(void); bool EnableAllInterrupts(void); float GetTime(void); @@ -91,75 +86,70 @@ void HaltProcessDisp(int status); bool OverlayIsLoaded(enum overlay_group_id group_id); void LoadOverlay(enum overlay_group_id group_id); void UnloadOverlay(enum overlay_group_id group_id); -void GetDsFirmwareUserSettingsVeneer(struct user_settings *settings); -void Rgb8ToRgb5(struct rgb5 *target, struct rgba *source); -float EuclideanNorm(int *vec2); -void ClampComponentAbs(int *vec2, int max); -bool GetHeldButtons(int controller, struct buttons *btn_ptr); -bool GetPressedButtons(int controller, struct buttons *btn_ptr); -bool GetReleasedStylus(undefined *stylus_ptr); +void GetDsFirmwareUserSettingsVeneer(struct user_settings* settings); +void Rgb8ToRgb5(struct rgb5* target, struct rgba* source); +float EuclideanNorm(int* vec2); +void ClampComponentAbs(int* vec2, int max); +bool GetHeldButtons(int controller, struct buttons* btn_ptr); +bool GetPressedButtons(int controller, struct buttons* btn_ptr); +bool GetReleasedStylus(undefined* stylus_ptr); void KeyWaitInit(void); void DebugPrintSystemClock(void); -void GetSystemClock(struct system_clock *clock); -void SprintfSystemClock(struct system_clock *clock, char *str); +void GetSystemClock(struct system_clock* clock); +void SprintfSystemClock(struct system_clock* clock, char* str); void DataTransferInit(void); void DataTransferStop(void); -void FileInitVeneer(struct file_stream *file); -void FileOpen(struct file_stream *file, const char *filepath); -uint32_t FileGetSize(struct file_stream *file); -uint32_t FileRead(struct file_stream *file, void *buf, uint32_t size); -void FileSeek(struct file_stream *file, int offset, int whence); -void FileClose(struct file_stream *file); -void UnloadFile(void *ptr); -void LoadFileFromRom(struct iovec *iov, const char *filepath, uint32_t flags); -void TransformPaletteDataWithFlushDivideFade(struct palette_data *palette); -void InitOamInfo(struct oam_info *oam_info, int max_num_objs, - int max_num_groups, int oam_base_address, - uint32_t mem_alloc_flags); -void SetShouldCopyToOam(struct oam_info *oam_info); -void GroupOamObjs(struct oam_info *oam_info); -void CopyAttributesToOam(struct oam_info *oam_info); -void ClearGroupedOamObjsAndGroups(struct oam_info *oam_info); -void AddObjToUngroupedOamObjs(struct oam_info *oam_info, - uint16_t *oam_attributes, int group); -void UpdateFadeStatus(struct screen_fade *fstruct, int param_2, int duration); -bool HandleFades(struct screen_fade *fstruct); -bool HandleFadesVeneer(struct screen_fade *fstruct); -int GetFadeStatus(struct screen_fade *fstruct); +void FileInitVeneer(struct file_stream* file); +void FileOpen(struct file_stream* file, const char* filepath); +uint32_t FileGetSize(struct file_stream* file); +uint32_t FileRead(struct file_stream* file, void* buf, uint32_t size); +void FileSeek(struct file_stream* file, int offset, int whence); +void FileClose(struct file_stream* file); +void UnloadFile(void* ptr); +void LoadFileFromRom(struct iovec* iov, const char* filepath, uint32_t flags); +void TransformPaletteDataWithFlushDivideFade(struct palette_data* palette); +void InitOamInfo(struct oam_info* oam_info, int max_num_objs, int max_num_groups, + int oam_base_address, uint32_t mem_alloc_flags); +void SetShouldCopyToOam(struct oam_info* oam_info); +void GroupOamObjs(struct oam_info* oam_info); +void CopyAttributesToOam(struct oam_info* oam_info); +void ClearGroupedOamObjsAndGroups(struct oam_info* oam_info); +void AddObjToUngroupedOamObjs(struct oam_info* oam_info, uint16_t* oam_attributes, int group); +void UpdateFadeStatus(struct screen_fade* fstruct, int param_2, int duration); +bool HandleFades(struct screen_fade* fstruct); +bool HandleFadesVeneer(struct screen_fade* fstruct); +int GetFadeStatus(struct screen_fade* fstruct); void InitDebug(void); void InitDebugFlag(void); bool GetDebugFlag(enum debug_flag flag); void SetDebugFlag(enum debug_flag flag, bool val); void InitDebugStripped6(void); -int AppendProgPos(char *str, struct prog_pos_info *prog_pos, const char *msg); +int AppendProgPos(char* str, struct prog_pos_info* prog_pos, const char* msg); void InitDebugStripped5(void); -void DebugPrintTrace(const char *msg, struct prog_pos_info *prog_pos); -void DebugDisplay(const char *fmt, ...); -void DebugPrint0(const char *fmt, ...); +void DebugPrintTrace(const char* msg, struct prog_pos_info* prog_pos); +void DebugDisplay(const char* fmt, ...); +void DebugPrint0(const char* fmt, ...); void InitDebugLogFlag(void); bool GetDebugLogFlag(enum debug_log_flag flag); void SetDebugLogFlag(enum debug_log_flag flag, bool val); -void DebugPrint(uint8_t level, const char *fmt, ...); +void DebugPrint(uint8_t level, const char* fmt, ...); void InitDebugStripped4(void); void InitDebugStripped3(void); void InitDebugStripped2(void); void InitDebugStripped1(void); -void FatalError(struct prog_pos_info prog_pos, const char *fmt, ...); +void FatalError(struct prog_pos_info prog_pos, const char* fmt, ...); void OpenAllPackFiles(void); -uint32_t GetFileLengthInPackWithPackNb(enum pack_file_id pack_id, - uint32_t file_index); -uint32_t LoadFileInPackWithPackId(enum pack_file_id pack_id, - uint32_t file_index, void *output_buffer); +uint32_t GetFileLengthInPackWithPackNb(enum pack_file_id pack_id, uint32_t file_index); +uint32_t LoadFileInPackWithPackId(enum pack_file_id pack_id, uint32_t file_index, + void* output_buffer); void AllocAndLoadFileInPack(enum pack_file_id pack_id, uint32_t file_index, - struct pack_alloc_and_load_result *output, - uint32_t malloc_flags); -void OpenPackFile(struct pack_file_opened *pack_file, const char *file_name); -uint32_t GetFileLengthInPack(struct pack_file_opened *pack_file, - uint32_t file_index); -uint32_t LoadFileInPack(struct pack_file_opened *pack_file, void *output_buffer, + struct pack_alloc_and_load_result* output, uint32_t malloc_flags); +void OpenPackFile(struct pack_file_opened* pack_file, const char* file_name); +uint32_t GetFileLengthInPack(struct pack_file_opened* pack_file, uint32_t file_index); +uint32_t LoadFileInPack(struct pack_file_opened* pack_file, void* output_buffer, uint32_t file_index); -void GetDungeonResultMsg(union damage_source damage_source_or_result, - char *buffer, int buffer_size, undefined *param_4); +void GetDungeonResultMsg(union damage_source damage_source_or_result, char* buffer, int buffer_size, + undefined* param_4); union damage_source GetDamageSource(enum move_id, enum item_id); enum item_category GetItemCategoryVeneer(enum item_id item_id); enum move_id GetItemMoveId16(enum item_id item_id); @@ -169,36 +159,34 @@ bool IsEdible(enum item_id item_id); bool IsHM(enum item_id item_id); bool IsGummi(enum item_id item_id); bool IsAuraBow(enum item_id item_id); -bool IsLosableItem(struct item *item); +bool IsLosableItem(struct item* item); bool IsTreasureBox(enum item_id item_id); bool IsStorableItem(enum item_id item_id); bool IsShoppableItem(enum item_id item_id); bool IsValidTargetItem(enum item_id item_id); -bool IsItemUsableNow(struct item *item); +bool IsItemUsableNow(struct item* item); bool IsTicketItem(enum item_id item_id); -void InitItem(struct item *item, enum item_id item_id, uint16_t quantity, - bool sticky); -void InitStandardItem(struct item *item, enum item_id item_id, bool sticky); -void InitBulkItem(struct bulk_item *item, enum item_id item_id); -void BulkItemToItem(struct item *item, struct bulk_item *bulk_item); -void ItemToBulkItem(struct bulk_item *bulk_item, struct item *item); -int GetDisplayedBuyPrice(struct item *item); -int GetDisplayedSellPrice(struct item *item); -int GetActualBuyPrice(struct item *item); -int GetActualSellPrice(struct item *item); +void InitItem(struct item* item, enum item_id item_id, uint16_t quantity, bool sticky); +void InitStandardItem(struct item* item, enum item_id item_id, bool sticky); +void InitBulkItem(struct bulk_item* item, enum item_id item_id); +void BulkItemToItem(struct item* item, struct bulk_item* bulk_item); +void ItemToBulkItem(struct bulk_item* bulk_item, struct item* item); +int GetDisplayedBuyPrice(struct item* item); +int GetDisplayedSellPrice(struct item* item); +int GetActualBuyPrice(struct item* item); +int GetActualSellPrice(struct item* item); int FindItemInInventory(enum item_id item_id); -int SprintfStatic(char *str, const char *format, ...); -void ItemZInit(struct item *item); -bool AreItemsEquivalent(struct item *item1, struct item *item2, int bitmask); -int GetMoneyQuantity(struct item *item); -int GetItemsForSave(void *dst, uint32_t len); -int ReadItemsFromSave(void *src, uint32_t len); -bool IsItemAvailableInDungeonGroup(enum dungeon_id dungeon_id, - enum item_id item_id); +int SprintfStatic(char* str, const char* format, ...); +void ItemZInit(struct item* item); +bool AreItemsEquivalent(struct item* item1, struct item* item2, int bitmask); +int GetMoneyQuantity(struct item* item); +int GetItemsForSave(void* dst, uint32_t len); +int ReadItemsFromSave(void* src, uint32_t len); +bool IsItemAvailableInDungeonGroup(enum dungeon_id dungeon_id, enum item_id item_id); enum item_id GetItemIdFromList(int list_id, int category_num, int item_num); enum item_id NormalizeTreasureBox(enum item_id item_id); -void SortItemList(struct item *item_list, int length); -void RemoveEmptyItems(struct item *list, int size); +void SortItemList(struct item* item_list, int length); +void RemoveEmptyItems(struct item* list, int size); void LoadItemPspi2n(void); uint8_t GetExclusiveItemType(enum item_id item_id); int GetExclusiveItemOffsetEnsureValid(enum item_id item_id); @@ -206,9 +194,8 @@ bool IsItemValid(enum item_id item_id); int16_t GetExclusiveItemParameter(enum item_id item_id); enum item_category GetItemCategory(enum item_id item_id); enum item_id EnsureValidItem(enum item_id item_id); -char *GetItemName(enum item_id item_id); -void GetItemNameFormatted(char *name_out, enum item_id item_id, bool flag1, - bool flag2); +char* GetItemName(enum item_id item_id); +void GetItemNameFormatted(char* name_out, enum item_id item_id, bool flag1, bool flag2); uint16_t GetItemBuyPrice(enum item_id item_id); uint16_t GetItemSellPrice(enum item_id item_id); uint8_t GetItemSpriteId(enum item_id item_id); @@ -236,36 +223,36 @@ int CountItemTypeInBag(enum item_id item_id); bool IsItemInBag(enum item_id item_id); bool IsItemWithFlagsInBag(enum item_id item_id, int flags); bool IsItemInTreasureBoxes(enum item_id item_id); -bool IsHeldItemInBag(struct item *item); +bool IsHeldItemInBag(struct item* item); bool IsItemForSpecialSpawnInBag(void); bool HasStorableItems(void); -int GetItemIndex(struct item *item); -int GetEquivItemIndex(struct item *item); +int GetItemIndex(struct item* item); +int GetEquivItemIndex(struct item* item); int GetEquippedThrowableItem(void); int GetFirstUnequippedItemOfType(enum item_id item_id); -bool CopyItemAtIdx(int idx, struct item *item_out); -struct item *GetItemAtIdx(int idx); +bool CopyItemAtIdx(int idx, struct item* item_out); +struct item* GetItemAtIdx(int idx); void RemoveEmptyItemsInBag(void); bool RemoveItemNoHole(int idx); void RemoveItem(int idx); void RemoveHeldItemNoHole(int held_idx); -bool RemoveItemByIdAndStackNoHole(struct item *item); -bool RemoveEquivItem(struct item *item); -bool RemoveEquivItemNoHole(struct item *item); -bool DecrementStackItem(struct item *item); +bool RemoveItemByIdAndStackNoHole(struct item* item); +bool RemoveEquivItem(struct item* item); +bool RemoveEquivItemNoHole(struct item* item); +bool DecrementStackItem(struct item* item); bool RemoveItemNoHoleCheck(int idx); bool RemoveFirstUnequippedItemOfType(enum item_id item_id); void RemoveAllItems(void); void RemoveAllItemsStartingAt(int idx); -bool SpecialProcAddItemToBag(struct bulk_item *item); -bool AddItemToBagNoHeld(struct item *item); -bool AddItemToBag(struct item *item, int held_by); +bool SpecialProcAddItemToBag(struct bulk_item* item); +bool AddItemToBagNoHeld(struct item* item); +bool AddItemToBag(struct item* item, int held_by); void CleanStickyItemsInBag(void); int CountStickyItemsInBag(void); -bool TransmuteHeldItemInBag(struct item *item); +bool TransmuteHeldItemInBag(struct item* item); void SetFlagsForHeldItemInBag(int held_by, int bitflags); -void RemoveHolderForItemInBag(struct item *item); -void SetHolderForItemInBag(int idx, struct item *item, int held_by); +void RemoveHolderForItemInBag(struct item* item); +void SetHolderForItemInBag(int idx, struct item* item, int held_by); void SortItemsInBag(void); void RemovePokeItemsInBag(void); bool IsStorageFull(void); @@ -273,17 +260,17 @@ int CountNbOfItemsInStorage(void); int CountNbOfValidItemsInStorage(void); int CountNbOfValidItemsInTimeDarknessInStorage(void); int CountNbItemsOfTypeInStorage(enum item_id item_id); -int CountItemTypeInStorage(struct bulk_item *bulk_item); -int GetEquivBulkItemIdxInStorage(struct bulk_item *bulk_item); -bool ConvertStorageItemAtIdxToBulkItem(int idx, struct bulk_item *bulk_item); -bool ConvertStorageItemAtIdxToItem(int idx, struct item *item); +int CountItemTypeInStorage(struct bulk_item* bulk_item); +int GetEquivBulkItemIdxInStorage(struct bulk_item* bulk_item); +bool ConvertStorageItemAtIdxToBulkItem(int idx, struct bulk_item* bulk_item); +bool ConvertStorageItemAtIdxToItem(int idx, struct item* item); bool RemoveItemAtIdxInStorage(int idx); -bool RemoveBulkItemInStorage(struct bulk_item *bulk_item); -bool RemoveItemInStorage(struct item *item); +bool RemoveBulkItemInStorage(struct bulk_item* bulk_item); +bool RemoveItemInStorage(struct item* item); void StorageZInit(void); -bool AddBulkItemToStorage(struct bulk_item *bulk_item); -bool AddItemToStorage(struct item *item); -void SortItemsInStorage(bool *param_1, int num_items_to_sort); +bool AddBulkItemToStorage(struct bulk_item* bulk_item); +bool AddItemToStorage(struct item* item); +void SortItemsInStorage(bool* param_1, int num_items_to_sort); void AllKecleonShopsZInit(void); void SpecialEpisodeKecleonShopZInit(void); void SetActiveKecleonShop(enum team_id team_id); @@ -307,68 +294,56 @@ void SortKecleonItems2(void); void GenerateKecleonItems2(enum kecleon_shop_version kecleon_shop_version); bool AddItemToKecleonShop2(enum item_id item_id); int GetExclusiveItemOffset(enum item_id item_id); -void ApplyExclusiveItemStatBoosts(enum item_id item_id, uint8_t *atk_boost, - uint8_t *sp_atk_boost, uint8_t *def_boost, - uint8_t *sp_def_boost); -void SetExclusiveItemEffect(uint32_t *effect_flags, - enum exclusive_item_effect_id effect_id); -bool ExclusiveItemEffectFlagTest(uint32_t *effect_flags, - enum exclusive_item_effect_id effect_id); -bool IsExclusiveItemIdForMonster(enum item_id item_id, - enum monster_id monster_id, enum type_id type1, - enum type_id type2); -bool IsExclusiveItemForMonster(struct item *item, enum monster_id monster_id, - enum type_id type1, enum type_id type2); -enum item_id -BagHasExclusiveItemTypeForMonster(enum exclusive_item_effect_id effect_id, - enum monster_id monster_id, - enum type_id type1, enum type_id type2); -bool GetExclusiveItemForMonsterFromBag(struct item *item, - enum exclusive_item_effect_id effect_id, - enum monster_id monster_id, - enum type_id type1, enum type_id type2); -int GetHpBoostFromExclusiveItems(undefined *param_1); -void SwapShopFreeDoublePointer(undefined **param_1); -void ApplyGummiBoostsToGroundMonster(struct ground_monster *ground_monster, - enum item_id item_id, bool not_boost_stats, - struct gummi_result *gummi_result); -void ApplyGummiBoostsToTeamMember(struct team_member *team_member, - enum item_id item_id, bool not_boost_stats, - struct gummi_result *gummi_result); -int ApplySitrusBerryBoostToGroundMonster(struct ground_monster *ground_monster, - int *attempted_hp_boost_out); -int ApplyLifeSeedBoostToGroundMonster(struct ground_monster *ground_monster, - int *attempted_hp_boost_out); -int ApplyGinsengToGroundMonster(struct ground_monster *ground_monster, - struct move_id_16 *move_id_out, - int *attempted_move_boost_out); -int ApplyProteinBoostToGroundMonster(struct ground_monster *ground_monster, - int *attempted_attack_boost_out); -int ApplyCalciumBoostToGroundMonster(struct ground_monster *ground_monster, - int *attempted_sp_attack_boost_out); -int ApplyIronBoostToGroundMonster(struct ground_monster *ground_monster, - int *attempted_defense_boost_out); -int ApplyZincBoostToGroundMonster(struct ground_monster *ground_monster, - int *attempted_sp_defense_boost_out); -int ApplyNectarBoostToGroundMonster(struct ground_monster *ground_monster, - int *attempted_iq_boost_out); -bool IsMonsterAffectedByGravelyrockGroundMode( - struct ground_monster *ground_monster); -int ApplyGravelyrockBoostToGroundMonster(struct ground_monster *ground_monster, - int *attempted_iq_boost_out); -void ApplyGummiBoostsGroundMode(struct monster_id_16 *monster_id, - uint16_t *monster_iq, - uint8_t *monster_offensive_stats, - uint8_t *monster_defensive_stats, +void ApplyExclusiveItemStatBoosts(enum item_id item_id, uint8_t* atk_boost, uint8_t* sp_atk_boost, + uint8_t* def_boost, uint8_t* sp_def_boost); +void SetExclusiveItemEffect(uint32_t* effect_flags, enum exclusive_item_effect_id effect_id); +bool ExclusiveItemEffectFlagTest(uint32_t* effect_flags, enum exclusive_item_effect_id effect_id); +bool IsExclusiveItemIdForMonster(enum item_id item_id, enum monster_id monster_id, + enum type_id type1, enum type_id type2); +bool IsExclusiveItemForMonster(struct item* item, enum monster_id monster_id, enum type_id type1, + enum type_id type2); +enum item_id BagHasExclusiveItemTypeForMonster(enum exclusive_item_effect_id effect_id, + enum monster_id monster_id, enum type_id type1, + enum type_id type2); +bool GetExclusiveItemForMonsterFromBag(struct item* item, enum exclusive_item_effect_id effect_id, + enum monster_id monster_id, enum type_id type1, + enum type_id type2); +int GetHpBoostFromExclusiveItems(undefined* param_1); +void SwapShopFreeDoublePointer(undefined** param_1); +void ApplyGummiBoostsToGroundMonster(struct ground_monster* ground_monster, enum item_id item_id, + bool not_boost_stats, struct gummi_result* gummi_result); +void ApplyGummiBoostsToTeamMember(struct team_member* team_member, enum item_id item_id, + bool not_boost_stats, struct gummi_result* gummi_result); +int ApplySitrusBerryBoostToGroundMonster(struct ground_monster* ground_monster, + int* attempted_hp_boost_out); +int ApplyLifeSeedBoostToGroundMonster(struct ground_monster* ground_monster, + int* attempted_hp_boost_out); +int ApplyGinsengToGroundMonster(struct ground_monster* ground_monster, + struct move_id_16* move_id_out, int* attempted_move_boost_out); +int ApplyProteinBoostToGroundMonster(struct ground_monster* ground_monster, + int* attempted_attack_boost_out); +int ApplyCalciumBoostToGroundMonster(struct ground_monster* ground_monster, + int* attempted_sp_attack_boost_out); +int ApplyIronBoostToGroundMonster(struct ground_monster* ground_monster, + int* attempted_defense_boost_out); +int ApplyZincBoostToGroundMonster(struct ground_monster* ground_monster, + int* attempted_sp_defense_boost_out); +int ApplyNectarBoostToGroundMonster(struct ground_monster* ground_monster, + int* attempted_iq_boost_out); +bool IsMonsterAffectedByGravelyrockGroundMode(struct ground_monster* ground_monster); +int ApplyGravelyrockBoostToGroundMonster(struct ground_monster* ground_monster, + int* attempted_iq_boost_out); +void ApplyGummiBoostsGroundMode(struct monster_id_16* monster_id, uint16_t* monster_iq, + uint8_t* monster_offensive_stats, uint8_t* monster_defensive_stats, enum item_id item_id, bool not_boost_stats, - struct gummi_result *gummi_result); + struct gummi_result* gummi_result); void WipeRecycleShopRecords(void); -void FreeRecycleOfferItems(struct recycle_offer_items *offer_items); -enum item_id GetRecycleItemId(struct recycle_item **recycle_item); -bool RecycleItemHasTradeTypePrizeTicket(struct recycle_item **recycle_item); -int16_t GetRecycleItemBonusOdds(struct recycle_item **recycle_item); -int CountTradedRecycleItems(struct recycle_item **recycle_item); -bool RecycleShopTradeIsNonspecific(struct recycle_item **recycle_item); +void FreeRecycleOfferItems(struct recycle_offer_items* offer_items); +enum item_id GetRecycleItemId(struct recycle_item** recycle_item); +bool RecycleItemHasTradeTypePrizeTicket(struct recycle_item** recycle_item); +int16_t GetRecycleItemBonusOdds(struct recycle_item** recycle_item); +int CountTradedRecycleItems(struct recycle_item** recycle_item); +bool RecycleShopTradeIsNonspecific(struct recycle_item** recycle_item); bool RecycleShopOfferExists(void); void ClearRecycleShopOffer(void); uint32_t GetGameStateRecycleCount(void); @@ -388,72 +363,70 @@ void ClearCroagunkItems(void); bool LoadSynthBin(void); void CloseSynthBin(void); bool GenerateCroagunkItems(void); -uint32_t GetCroagunkItemTemplates(struct synth_template *synth_template); +uint32_t GetCroagunkItemTemplates(struct synth_template* synth_template); bool PopCroagunkItem(enum item_id item); undefined4 LoadCroagunkItems(void); undefined4 SaveCroagunkItems(void); -struct synth_template *GetSynthItem(enum item_id exclusive_item); +struct synth_template* GetSynthItem(enum item_id exclusive_item); bool GetValidSynthsForSpecies(enum monster_id monster_id, - struct monster_synth_data *monster_synth_data, - struct type_synth_data *type_synth_data); + struct monster_synth_data* monster_synth_data, + struct type_synth_data* type_synth_data); void LoadWazaP(void); void LoadWazaP2(void); void UnloadCurrentWazaP(void); -char *GetMoveName(enum move_id move_id); -void FormatMoveString(char *string, struct move *move, undefined *type_print); -void FormatMoveStringMore(undefined *param_1, int param_2, struct move *move, - undefined *type_print); -void InitMove(struct move *move, enum move_id move_id); -void InitMoveCheckId(struct move *move, enum move_id move_id); -void GetInfoMoveGround(struct ground_move *move, enum move_id move_id); -struct move_target_and_range GetMoveTargetAndRange(struct move *move, - bool is_ai); -enum type_id GetMoveType(struct move *move); -uint8_t *GetMovesetLevelUpPtr(enum monster_id monster_id); +char* GetMoveName(enum move_id move_id); +void FormatMoveString(char* string, struct move* move, undefined* type_print); +void FormatMoveStringMore(undefined* param_1, int param_2, struct move* move, + undefined* type_print); +void InitMove(struct move* move, enum move_id move_id); +void InitMoveCheckId(struct move* move, enum move_id move_id); +void GetInfoMoveGround(struct ground_move* move, enum move_id move_id); +struct move_target_and_range GetMoveTargetAndRange(struct move* move, bool is_ai); +enum type_id GetMoveType(struct move* move); +uint8_t* GetMovesetLevelUpPtr(enum monster_id monster_id); bool IsInvalidMoveset(int moveset_id); -undefined *GetMovesetHmTmPtr(enum monster_id monster_id); -undefined *GetMovesetEggPtr(enum monster_id monster_id); -uint8_t GetMoveAiWeight(struct move *move); -uint8_t GetMoveNbStrikes(struct move *move); -int GetMoveBasePower(struct move *move); -int16_t GetMoveBasePowerGround(struct ground_move *move); -uint8_t GetMoveAccuracyOrAiChance(struct move *move, int which); -uint8_t GetMoveBasePp(struct move *move); -int GetMaxPp(struct move *move); -uint8_t GetMoveMaxGinsengBoost(struct move *move); -uint8_t GetMoveMaxGinsengBoostGround(struct ground_move *move); -int GetMoveCritChance(struct move *move); -bool IsThawingMove(struct move *move); -bool IsUsableWhileTaunted(struct move *move); -uint8_t GetMoveRangeId(struct move *move); +undefined* GetMovesetHmTmPtr(enum monster_id monster_id); +undefined* GetMovesetEggPtr(enum monster_id monster_id); +uint8_t GetMoveAiWeight(struct move* move); +uint8_t GetMoveNbStrikes(struct move* move); +int GetMoveBasePower(struct move* move); +int16_t GetMoveBasePowerGround(struct ground_move* move); +uint8_t GetMoveAccuracyOrAiChance(struct move* move, int which); +uint8_t GetMoveBasePp(struct move* move); +int GetMaxPp(struct move* move); +uint8_t GetMoveMaxGinsengBoost(struct move* move); +uint8_t GetMoveMaxGinsengBoostGround(struct ground_move* move); +int GetMoveCritChance(struct move* move); +bool IsThawingMove(struct move* move); +bool IsUsableWhileTaunted(struct move* move); +uint8_t GetMoveRangeId(struct move* move); int GetMoveActualAccuracy(enum move_id move_id); int GetMoveBasePowerFromId(enum move_id move_id); -bool IsMoveRangeStringUser(struct move *move); -char *GetMoveMessageFromId(enum move_id move_id); -int GetNbMoves(undefined *moveset); -int GetMovesetIdx(undefined *moveset, enum move_id move_id); +bool IsMoveRangeStringUser(struct move* move); +char* GetMoveMessageFromId(enum move_id move_id); +int GetNbMoves(undefined* moveset); +int GetMovesetIdx(undefined* moveset, enum move_id move_id); bool IsReflectedByMagicCoat(enum move_id move_id); bool CanBeSnatched(enum move_id move_id); bool FailsWhileMuzzled(enum move_id move_id); -bool IsSoundMove(struct move *move); +bool IsSoundMove(struct move* move); bool IsRecoilMove(enum move_id move_id); void AllManip1(undefined4 param_1); void AllManip2(undefined4 param_1); -void ManipMoves1v1(undefined *param_1, undefined *param_2); -void ManipMoves1v2(undefined *param_1, undefined *param_2); -void ManipMoves2v1(undefined *param_1, undefined *param_2); -void ManipMoves2v2(undefined *param_1, undefined *param_2); -void DungeonMoveToGroundMove(struct ground_move *dst, struct move *src); -void GroundToDungeonMoveset(undefined *dst, undefined *src); -void DungeonToGroundMoveset(undefined *dst, undefined *src); -void GetInfoGroundMoveset(undefined *moveset, struct move_id_16 *moves); -int FindFirstFreeMovesetIdx(undefined *moveset); -void LearnMoves(undefined *moveset, struct move_id_16 *moves); -void CopyMoveToStream(struct bitstream *bitstream, struct ground_move *src); -void CopyMoveFromStream(struct bitstream *bitstream, struct ground_move *dst); -void CopyMovesetToStream(struct bitstream *bitstream, struct ground_move *src); -void CopyMovesetFromStream(struct bitstream *bitstream, - struct ground_move *dst); +void ManipMoves1v1(undefined* param_1, undefined* param_2); +void ManipMoves1v2(undefined* param_1, undefined* param_2); +void ManipMoves2v1(undefined* param_1, undefined* param_2); +void ManipMoves2v2(undefined* param_1, undefined* param_2); +void DungeonMoveToGroundMove(struct ground_move* dst, struct move* src); +void GroundToDungeonMoveset(undefined* dst, undefined* src); +void DungeonToGroundMoveset(undefined* dst, undefined* src); +void GetInfoGroundMoveset(undefined* moveset, struct move_id_16* moves); +int FindFirstFreeMovesetIdx(undefined* moveset); +void LearnMoves(undefined* moveset, struct move_id_16* moves); +void CopyMoveToStream(struct bitstream* bitstream, struct ground_move* src); +void CopyMoveFromStream(struct bitstream* bitstream, struct ground_move* dst); +void CopyMovesetToStream(struct bitstream* bitstream, struct ground_move* src); +void CopyMovesetFromStream(struct bitstream* bitstream, struct ground_move* dst); bool Is2TurnsMove(enum move_id move_id); bool IsRegularAttackOrProjectile(enum move_id move_id); bool IsPunchMove(enum move_id move_id); @@ -463,18 +436,17 @@ bool IsTrappingMove(enum move_id move_id); bool IsOneHitKoMove(enum move_id move_id); bool IsNot2TurnsMoveOrSketch(enum move_id move_id); bool IsRealMove(enum move_id move_id); -bool IsMovesetValid(undefined *moveset); +bool IsMovesetValid(undefined* moveset); bool IsRealMoveInTimeDarkness(enum move_id move_id); -bool IsMovesetValidInTimeDarkness(undefined *moveset); -int GetFirstNotRealMoveInTimeDarkness(undefined *moveset); -bool IsSameMove(undefined *moveset, struct move *move); +bool IsMovesetValidInTimeDarkness(undefined* moveset); +int GetFirstNotRealMoveInTimeDarkness(undefined* moveset); +bool IsSameMove(undefined* moveset, struct move* move); enum move_category GetMoveCategory(enum move_id move_id); -int GetPpIncrease(enum monster_id monster_id, uint32_t *iq_skill_flags); +int GetPpIncrease(enum monster_id monster_id, uint32_t* iq_skill_flags); void OpenWaza(int waza_id); void SelectWaza(int waza_id); void PlayBgmByIdVeneer(enum music_id music_id); -void PlayBgmByIdVolumeVeneer(enum music_id music_id, undefined param_2, - int volume); +void PlayBgmByIdVolumeVeneer(enum music_id music_id, undefined param_2, int volume); bool IsMePlaying(int me_id); void PlaySeByIdVolumeWrapper(int index); void PlaySeVolumeWrapper(int index); @@ -484,12 +456,12 @@ void StopBgmCommand(void); void PlayMeById(int me_id); void PlaySeByIdVolume(int se_id, int volume); void SendAudioCommand2(struct audio_command command); -struct audio_command *AllocAudioCommand(int status); +struct audio_command* AllocAudioCommand(int status); void SendAudioCommand(struct audio_command command); void InitSoundSystem(void); void ManipBgmPlayback(void); void SoundDriverReset(void); -uint32_t LoadDseFile(struct iovec *iov, const char *filename); +uint32_t LoadDseFile(struct iovec* iov, const char* filename); undefined4 PlaySeLoad(int param_1); bool IsSongOver(void); void PlayBgm(int param_1, int param_2, int param_3); @@ -505,226 +477,183 @@ void PlaySeFullSpec(int param_1, int param_2, int param_3, int param_4); void SeChangeVolume(int param_1, int param_2, int param_3); void SeChangePan(int param_1, int param_2, int param_3); void StopSe(int param_1, int param_2); -void FillCopyToFlatVramCommand(struct copy_to_obj_vram_order *order, void *dst, - void *src, uint32_t len_output, - enum copy_to_obj_vram_order_type copy_type, +void FillCopyToFlatVramCommand(struct copy_to_obj_vram_order* order, void* dst, void* src, + uint32_t len_output, enum copy_to_obj_vram_order_type copy_type, uint16_t interleave_with); -void ExecuteCopyToFlatVramCommand(struct copy_to_obj_vram_order *order); -uint32_t -DecodeFragmentByteAssemblyTable(struct wan_fragment_bytes_assembly_entry *entry, - void *dst); -int LoadObjPalette(struct obj_graphics_control *obj_graphics_control, - struct palette_init_info *palette_init_info, - uint8_t palette_num); -int AddSimpleObjToOam(struct obj_graphics_control *obj_graphics_control, - uint16_t *obj, int group); -void GroupOamAttributesWrapper( - struct obj_graphics_control *obj_graphics_control); -void CopyAttributesToOamWrapper( - struct obj_graphics_control *obj_graphics_control); -void ChangeSimpleObjTexture(struct obj_graphics_control *obj_graphics_control, - undefined4 *src, uint16_t oam_tile_num, - uint16_t texture_size, bool extended_palette, +void ExecuteCopyToFlatVramCommand(struct copy_to_obj_vram_order* order); +uint32_t DecodeFragmentByteAssemblyTable(struct wan_fragment_bytes_assembly_entry* entry, + void* dst); +int LoadObjPalette(struct obj_graphics_control* obj_graphics_control, + struct palette_init_info* palette_init_info, uint8_t palette_num); +int AddSimpleObjToOam(struct obj_graphics_control* obj_graphics_control, uint16_t* obj, int group); +void GroupOamAttributesWrapper(struct obj_graphics_control* obj_graphics_control); +void CopyAttributesToOamWrapper(struct obj_graphics_control* obj_graphics_control); +void ChangeSimpleObjTexture(struct obj_graphics_control* obj_graphics_control, undefined4* src, + uint16_t oam_tile_num, uint16_t texture_size, bool extended_palette, uint8_t ext_palette_upper_shifted); void InitObjGraphicsControls(void); void CopyAttributesToOamBothScreens(void); void GroupOamAttributesBothScreens(void); -void CopyAndInterleaveWrapper(uint16_t *dst, uint16_t *src, uint32_t len, - uint8_t val); -void InitAnimationControl(struct animation_control *animation_control); -void InitAnimationControlWithSet(struct animation_control *animation_control); -void SetSpriteIdForAnimationControl(struct animation_control *anim_ctrl, - uint16_t sprite_id); -void SetAnimationForAnimationControlInternal( - struct animation_control *anim_ctrl, struct wan_header *wan_header, - int animation_group_id, int animation_id, int unk1, int low_palette_pos, - int unk2, int unk3, int palette_bank); -void SetAnimationForAnimationControl(struct animation_control *anim_ctrl, - int animation_key, - enum direction_id direction, int unk1, - int low_palette_pos, int unk2, int unk3, - int unk4); -struct wan_header * -GetWanForAnimationControl(struct animation_control *anim_ctrl); -void SetAndPlayAnimationForAnimationControl(struct animation_control *anim_ctrl, - int animation_key, - enum direction_id direction, - int unk1, int low_palette_pos, - int unk2, int unk3, int unk4); -void SwitchAnimationControlToNextFrame(struct animation_control *anim_ctrl); -void LoadAnimationFrameAndIncrementInAnimationControl( - struct animation_control *anim_ctrl, - struct wan_animation_frame *anim_frame); -void FillOamAttributeInfo(struct animation_control *dst, uint16_t *src); -uint32_t -AnimationControlGetAllocForMaxFrame(struct animation_control *anim_ctrl); -void DeleteWanTableEntry(struct wan_table *wan_table, int wan_id); -int AllocateWanTableEntry(struct wan_table *wan_table); -int FindWanTableEntry(struct wan_table *wan_table, const char *path); -int GetLoadedWanTableEntry(struct wan_table *wan_table, - enum pack_file_id pack_id, uint16_t file_index); -void InitWanTable(struct wan_table *wan_table); -int LoadWanTableEntry(struct wan_table *wan_table, const char *path, - uint32_t flags); -int LoadWanTableEntryFromPack(struct wan_table *wan_table, - enum pack_file_id pack_id, uint16_t file_index, - uint32_t alloc_flags, bool is_compressed); -int LoadWanTableEntryFromPackUseProvidedMemory(struct wan_table *wan_table, - enum pack_file_id pack_id, - uint16_t file_index, - void *sprite_storage, - bool is_compressed); -int ReplaceWanFromBinFile(struct wan_table *wan_table, int wan_id, - enum pack_file_id pack_id, uint16_t file_index, - bool compressed); -void DeleteWanTableEntryVeneer(struct wan_table *wan_table, int wan_id); -bool WanHasAnimationGroup(struct wan_header *wan_header, - uint16_t animation_group_id); -bool WanTableSpriteHasAnimationGroup(uint16_t sprite_id, - uint16_t animation_group_id); +void CopyAndInterleaveWrapper(uint16_t* dst, uint16_t* src, uint32_t len, uint8_t val); +void InitAnimationControl(struct animation_control* animation_control); +void InitAnimationControlWithSet(struct animation_control* animation_control); +void SetSpriteIdForAnimationControl(struct animation_control* anim_ctrl, uint16_t sprite_id); +void SetAnimationForAnimationControlInternal(struct animation_control* anim_ctrl, + struct wan_header* wan_header, int animation_group_id, + int animation_id, int unk1, int low_palette_pos, + int unk2, int unk3, int palette_bank); +void SetAnimationForAnimationControl(struct animation_control* anim_ctrl, int animation_key, + enum direction_id direction, int unk1, int low_palette_pos, + int unk2, int unk3, int unk4); +struct wan_header* GetWanForAnimationControl(struct animation_control* anim_ctrl); +void SetAndPlayAnimationForAnimationControl(struct animation_control* anim_ctrl, int animation_key, + enum direction_id direction, int unk1, + int low_palette_pos, int unk2, int unk3, int unk4); +void SwitchAnimationControlToNextFrame(struct animation_control* anim_ctrl); +void LoadAnimationFrameAndIncrementInAnimationControl(struct animation_control* anim_ctrl, + struct wan_animation_frame* anim_frame); +void FillOamAttributeInfo(struct animation_control* dst, uint16_t* src); +uint32_t AnimationControlGetAllocForMaxFrame(struct animation_control* anim_ctrl); +void DeleteWanTableEntry(struct wan_table* wan_table, int wan_id); +int AllocateWanTableEntry(struct wan_table* wan_table); +int FindWanTableEntry(struct wan_table* wan_table, const char* path); +int GetLoadedWanTableEntry(struct wan_table* wan_table, enum pack_file_id pack_id, + uint16_t file_index); +void InitWanTable(struct wan_table* wan_table); +int LoadWanTableEntry(struct wan_table* wan_table, const char* path, uint32_t flags); +int LoadWanTableEntryFromPack(struct wan_table* wan_table, enum pack_file_id pack_id, + uint16_t file_index, uint32_t alloc_flags, bool is_compressed); +int LoadWanTableEntryFromPackUseProvidedMemory(struct wan_table* wan_table, + enum pack_file_id pack_id, uint16_t file_index, + void* sprite_storage, bool is_compressed); +int ReplaceWanFromBinFile(struct wan_table* wan_table, int wan_id, enum pack_file_id pack_id, + uint16_t file_index, bool compressed); +void DeleteWanTableEntryVeneer(struct wan_table* wan_table, int wan_id); +bool WanHasAnimationGroup(struct wan_header* wan_header, uint16_t animation_group_id); +bool WanTableSpriteHasAnimationGroup(uint16_t sprite_id, uint16_t animation_group_id); enum wan_sprite_type SpriteTypeInWanTable(uint16_t sprite_id); -void LoadWteFromRom(struct wte_handle *handle, const char *path, - uint32_t flags); -void LoadWteFromFileDirectory(struct wte_handle *handle, - enum pack_file_id pack_id, uint16_t file_index, - uint32_t malloc_flags); -void UnloadWte(struct wte_handle *handle); -undefined *LoadWtuFromBin(int bin_file_id, int file_id, int load_type); -void ProcessWte(undefined *wte_header_ptr, undefined4 texture_vram_offset, - undefined4 pal_vram_offset_upper, - undefined4 pal_vram_offset_lower); -void DelayWteFree(struct wte_handle *handle); -void ResetPlannedVramTransfer(struct delayed_texture_vram_container *container); -uint32_t -PlanCopyTextureToTextureVram(struct delayed_texture_vram_container *container, - void *image_pointer, uint32_t dest_vram_offset, - uint32_t image_length, - enum delayed_texture_vram_order_type order_type); -void PerformPlannedTextureVramTransfer( - struct delayed_texture_vram_container *container); -void GeomSetTexImageParam(int texture_format, - int texture_coordinates_transformation_modes, - int texture_s_size, int texture_t_size, - int repeat_s_t, int flip_s_t, bool color_0, - int vram_offset); +void LoadWteFromRom(struct wte_handle* handle, const char* path, uint32_t flags); +void LoadWteFromFileDirectory(struct wte_handle* handle, enum pack_file_id pack_id, + uint16_t file_index, uint32_t malloc_flags); +void UnloadWte(struct wte_handle* handle); +undefined* LoadWtuFromBin(int bin_file_id, int file_id, int load_type); +void ProcessWte(undefined* wte_header_ptr, undefined4 texture_vram_offset, + undefined4 pal_vram_offset_upper, undefined4 pal_vram_offset_lower); +void DelayWteFree(struct wte_handle* handle); +void ResetPlannedVramTransfer(struct delayed_texture_vram_container* container); +uint32_t PlanCopyTextureToTextureVram(struct delayed_texture_vram_container* container, + void* image_pointer, uint32_t dest_vram_offset, + uint32_t image_length, + enum delayed_texture_vram_order_type order_type); +void PerformPlannedTextureVramTransfer(struct delayed_texture_vram_container* container); +void GeomSetTexImageParam(int texture_format, int texture_coordinates_transformation_modes, + int texture_s_size, int texture_t_size, int repeat_s_t, int flip_s_t, + bool color_0, int vram_offset); void GeomSetVertexCoord16(int x, int y, int z); void InitRender3dData(void); void GeomSwapBuffers(void); -void InitRender3dElement64(struct render_3d_element_64 *element64); -void Render3d64Texture0x7(struct render_3d_element_64 *element64); -void Render3d64WindowFrame(struct render_3d_element_64 *element64); -void EnqueueRender3d64Tiling(struct render_3d_element_64 *element64); -void Render3d64Tiling(struct render_3d_element_64 *element64); -void Render3d64Quadrilateral(struct render_3d_element_64 *element64); -void Render3d64RectangleMulticolor(struct render_3d_element_64 *element64); -void Render3d64Rectangle(struct render_3d_element_64 *element64); -void Render3d64Nothing(struct render_3d_element_64 *element64); -void Render3d64Texture(struct render_3d_element_64 *element64); -void Render3dElement64(struct render_3d_element_64 *element64); -int HandleSir0Translation(uint8_t **dst, uint8_t *src); -void ConvertPointersSir0(undefined *sir0_ptr); -int HandleSir0TranslationVeneer(uint8_t **dst, uint8_t *src); -void FillPaletteInitInfo(struct palette_init_info *palette_init_info, - struct rgba *palette_bytes, uint16_t palette_mode, - uint16_t nb_colors_or_palettes, +void InitRender3dElement64(struct render_3d_element_64* element64); +void Render3d64Texture0x7(struct render_3d_element_64* element64); +void Render3d64WindowFrame(struct render_3d_element_64* element64); +void EnqueueRender3d64Tiling(struct render_3d_element_64* element64); +void Render3d64Tiling(struct render_3d_element_64* element64); +void Render3d64Quadrilateral(struct render_3d_element_64* element64); +void Render3d64RectangleMulticolor(struct render_3d_element_64* element64); +void Render3d64Rectangle(struct render_3d_element_64* element64); +void Render3d64Nothing(struct render_3d_element_64* element64); +void Render3d64Texture(struct render_3d_element_64* element64); +void Render3dElement64(struct render_3d_element_64* element64); +int HandleSir0Translation(uint8_t** dst, uint8_t* src); +void ConvertPointersSir0(undefined* sir0_ptr); +int HandleSir0TranslationVeneer(uint8_t** dst, uint8_t* src); +void FillPaletteInitInfo(struct palette_init_info* palette_init_info, struct rgba* palette_bytes, + uint16_t palette_mode, uint16_t nb_colors_or_palettes, uint16_t ext_palette_upper, int8_t palette_num_custom); -int DecompressAtNormalVeneer(undefined *addr_decomp, int expected_size, - undefined *at_ptr); -int DecompressAtNormal(undefined *addr_decomp, int expected_size, - undefined *at_ptr); -int DecompressAtHalf(undefined *addr_decomp, int expected_size, - undefined *at_ptr, int high_nibble); -int DecompressAtFromMemoryPointerVeneer(undefined *addr_decomp, - int expected_size, undefined *at_ptr); -int DecompressAtFromMemoryPointer(undefined *addr_decomp, int expected_size, - undefined *at_ptr); +int DecompressAtNormalVeneer(undefined* addr_decomp, int expected_size, undefined* at_ptr); +int DecompressAtNormal(undefined* addr_decomp, int expected_size, undefined* at_ptr); +int DecompressAtHalf(undefined* addr_decomp, int expected_size, undefined* at_ptr, int high_nibble); +int DecompressAtFromMemoryPointerVeneer(undefined* addr_decomp, int expected_size, + undefined* at_ptr); +int DecompressAtFromMemoryPointer(undefined* addr_decomp, int expected_size, undefined* at_ptr); void WriteByteFromMemoryPointer(uint8_t byte); -int GetAtSize(undefined *at_ptr, int param_2); +int GetAtSize(undefined* at_ptr, int param_2); int GetLanguageType(void); int GetLanguage(void); -bool StrcmpTag(const char *s1, const char *s2); -int AtoiTag(const char *s); -int AnalyzeText(undefined *buf); -int PreprocessString(char *output, int output_size, const char *format, - struct preprocessor_flags flags, - struct preprocessor_args *args); -int PreprocessStringFromId(char *output, int output_size, int string_id, - struct preprocessor_flags flags, - struct preprocessor_args *args); -bool StrcmpTagVeneer(const char *s1, const char *s2); -int AtoiTagVeneer(const char *s); -void InitPreprocessorArgs(struct preprocessor_args *args); -char *SetStringAccuracy(char *s, int param_2); -char *SetStringPower(char *s, int param_2); -char *GetRankString(char *s, int rank_and_flags); -char *GetCurrentTeamNameString(char *buffer, int param_2); -char *GetBagNameString(char *buffer); -char *GetSize0x80Buffer(int idx); -char *GetSize0x80Buffer2(int idx); -char *GetDungeonResultString(int string_number); -void SubstitutePlaceholderItemTags(uint8_t tag_id, struct item *item, - undefined4 *param_3); -void SetQuestionMarks(char *s); -void StrcpySimple(char *dest, const char *src); -void StrncpySimple(char *dest, const char *src, uint32_t n); -void StrncpySimpleNoPad(char *dest, const char *src, uint32_t n); -int StrncmpSimple(const char *s1, const char *s2, uint32_t n); -void StrncpySimpleNoPadSafe(char *dest, const char *src, uint32_t n); -void StrcpyName(char *dest, const char *src); -void StrncpyName(char *dest, const char *src, uint32_t n); -void GetStringFromFile(char *buf, int string_id); +bool StrcmpTag(const char* s1, const char* s2); +int AtoiTag(const char* s); +int AnalyzeText(undefined* buf); +int PreprocessString(char* output, int output_size, const char* format, + struct preprocessor_flags flags, struct preprocessor_args* args); +int PreprocessStringFromId(char* output, int output_size, int string_id, + struct preprocessor_flags flags, struct preprocessor_args* args); +bool StrcmpTagVeneer(const char* s1, const char* s2); +int AtoiTagVeneer(const char* s); +void InitPreprocessorArgs(struct preprocessor_args* args); +char* SetStringAccuracy(char* s, int param_2); +char* SetStringPower(char* s, int param_2); +char* GetRankString(char* s, int rank_and_flags); +char* GetCurrentTeamNameString(char* buffer, int param_2); +char* GetBagNameString(char* buffer); +char* GetSize0x80Buffer(int idx); +char* GetSize0x80Buffer2(int idx); +char* GetDungeonResultString(int string_number); +void SubstitutePlaceholderItemTags(uint8_t tag_id, struct item* item, undefined4* param_3); +void SetQuestionMarks(char* s); +void StrcpySimple(char* dest, const char* src); +void StrncpySimple(char* dest, const char* src, uint32_t n); +void StrncpySimpleNoPad(char* dest, const char* src, uint32_t n); +int StrncmpSimple(const char* s1, const char* s2, uint32_t n); +void StrncpySimpleNoPadSafe(char* dest, const char* src, uint32_t n); +void StrcpyName(char* dest, const char* src); +void StrncpyName(char* dest, const char* src, uint32_t n); +void GetStringFromFile(char* buf, int string_id); void LoadStringFile(void); -uint8_t *AllocateTemp1024ByteBufferFromPool(void); -void GetStringFromFileVeneer(char *buf, int string_id); -char *StringFromId(int string_id); -void CopyStringFromId(char *buf, int string_id); -void CopyNStringFromId(char *buf, int string_id, int buf_len); +uint8_t* AllocateTemp1024ByteBufferFromPool(void); +void GetStringFromFileVeneer(char* buf, int string_id); +char* StringFromId(int string_id); +void CopyStringFromId(char* buf, int string_id); +void CopyNStringFromId(char* buf, int string_id, int buf_len); void LoadTblTalk(void); -int GetTalkLine(int personality_idx, enum talk_type talk_type, - int restrictions); +int GetTalkLine(int personality_idx, enum talk_type talk_type, int restrictions); bool IsAOrBPressed(void); -void DrawTextInWindow(int window_id, int x, int y, char *string); -void AppendStandardStringToMission(undefined4 param_1, undefined4 param_2, - undefined4 param_3, int string_id); +void DrawTextInWindow(int window_id, int x, int y, char* string); +void AppendStandardStringToMission(undefined4 param_1, undefined4 param_2, undefined4 param_3, + int string_id); uint8_t GetCharWidth(char symbol); int GetColorCodePaletteOffset(char symbol); uint8_t DrawChar(int window_id, int x, int y, char symbol, int color_offset); -struct window *GetWindow(int window_id); -int NewWindowScreenCheck(struct window_params *params, uint8_t param_2); -int NewWindow(struct window_params *params, uint8_t param_2); -int GetPaletteBaseAddress(undefined4 pal_vram_offset_upper, - undefined4 pal_vram_offset_lower); +struct window* GetWindow(int window_id); +int NewWindowScreenCheck(struct window_params* params, uint8_t param_2); +int NewWindow(struct window_params* params, uint8_t param_2); +int GetPaletteBaseAddress(undefined4 pal_vram_offset_upper, undefined4 pal_vram_offset_lower); void SetScreenWindowsColor(int palette_idx, bool upper_screen); void SetBothScreensWindowsColor(int palette_idx); void UpdateWindow(int window_id); void ClearWindow(int window_id); void DeleteWindow(int window_id); -void GetWindowRectangle(int window_id, struct window_rectangle *rect_out); -void *GetWindowContents(int window_id); +void GetWindowRectangle(int window_id, struct window_rectangle* rect_out); +void* GetWindowContents(int window_id); void LoadCursors(void); -void InitWindowTrailer(struct window_trailer *trailer); +void InitWindowTrailer(struct window_trailer* trailer); void LoadAlert(void); int PrintClearMark(int mark_id, int x, int y, undefined param_4); -int PrintSpecialEpisodeClearMark(enum special_episode_type special_episode_type, - int x, int y, undefined param_4); +int PrintSpecialEpisodeClearMark(enum special_episode_type special_episode_type, int x, int y, + undefined param_4); int PrintBadgeMark(enum rank badge_id, int x, int y, undefined param_4); int PrintMark(int file, int id_in_file, int x, int y, undefined param_5); -int CreateParentMenuFromStringIds(struct window_params *params, - struct window_flags flags, - struct window_extra_info *window_extra_info, - struct simple_menu_id_item *menu_items); -bool IsEmptyString(const char *s); -int CreateParentMenu(struct window_params *params, struct window_flags flags, - struct window_extra_info *window_extra_info, - struct simple_menu_ptr_item *menu_items); -int CreateParentMenuWrapper(struct window_params *params, - struct window_flags flags, - struct window_extra_info *window_extra_info, - struct simple_menu_ptr_item *menu_items); -int CreateParentMenuInternal(struct window_params *params, - struct window_flags flags, - struct window_extra_info *window_extra_info, - struct simple_menu_item *menu_items); +int CreateParentMenuFromStringIds(struct window_params* params, struct window_flags flags, + struct window_extra_info* window_extra_info, + struct simple_menu_id_item* menu_items); +bool IsEmptyString(const char* s); +int CreateParentMenu(struct window_params* params, struct window_flags flags, + struct window_extra_info* window_extra_info, + struct simple_menu_ptr_item* menu_items); +int CreateParentMenuWrapper(struct window_params* params, struct window_flags flags, + struct window_extra_info* window_extra_info, + struct simple_menu_ptr_item* menu_items); +int CreateParentMenuInternal(struct window_params* params, struct window_flags flags, + struct window_extra_info* window_extra_info, + struct simple_menu_item* menu_items); void ResumeParentMenu(int window_id); void SetParentMenuState7(int window_id); void CloseParentMenu(int window_id); @@ -732,43 +661,38 @@ bool IsParentMenuActive(int window_id); bool CheckParentMenuField0x1A0(int window_id); uint8_t GetWindowIdSelectedItemOnPage(int window_id); int GetSimpleMenuResult(int window_id); -void UpdateParentMenu(struct window *window); -int CreateSimpleMenuFromStringIds(struct window_params *params, - struct window_flags flags, - struct window_extra_info *window_extra_info, - struct simple_menu_id_item *menu_items, - int n_items); -int CreateSimpleMenu(struct window_params *params, struct window_flags flags, - struct window_extra_info *window_extra_info, - struct simple_menu_item *menu_items, int n_items); -int CreateSimpleMenuInternal(struct window_params *params, - struct window_flags flags, - struct window_extra_info *window_extra_info, - struct simple_menu_item *menu_items, int n_items); +void UpdateParentMenu(struct window* window); +int CreateSimpleMenuFromStringIds(struct window_params* params, struct window_flags flags, + struct window_extra_info* window_extra_info, + struct simple_menu_id_item* menu_items, int n_items); +int CreateSimpleMenu(struct window_params* params, struct window_flags flags, + struct window_extra_info* window_extra_info, + struct simple_menu_item* menu_items, int n_items); +int CreateSimpleMenuInternal(struct window_params* params, struct window_flags flags, + struct window_extra_info* window_extra_info, + struct simple_menu_item* menu_items, int n_items); void ResumeSimpleMenu(int window_id); void CloseSimpleMenu(int window_id); bool IsSimpleMenuActive(int window_id); bool CheckSimpleMenuField0x1A0(int window_id); int GetSimpleMenuField0x1A4(int window_id); -void UpdateSimpleMenu(struct window *window); +void UpdateSimpleMenu(struct window* window); void SetSimpleMenuField0x1AC(int window_id, int value); -int CreateAdvancedMenu(struct window_params *params, struct window_flags flags, - struct window_extra_info *window_extra_info, - advanced_menu_entry_fn_t entry_fn, int n_options, - int n_opt_per_page); +int CreateAdvancedMenu(struct window_params* params, struct window_flags flags, + struct window_extra_info* window_extra_info, + advanced_menu_entry_fn_t entry_fn, int n_options, int n_opt_per_page); void ResumeAdvancedMenu(int window_id); void CloseAdvancedMenu(int window_id); bool IsAdvancedMenuActive2(int window_id); bool IsAdvancedMenuActive(int window_id); int GetAdvancedMenuCurrentOption(int window_id); int GetAdvancedMenuResult(int window_id); -void UpdateAdvancedMenu(struct window *window); -void DrawAdvancedMenu(struct window *window); -int CreateCollectionMenu(struct window_params *params, - struct window_flags flags, - struct window_extra_info *window_extra_info, - unk_collection_menu_fn_t param_4, undefined4 param_5, - int n_options, int n_opt_per_page); +void UpdateAdvancedMenu(struct window* window); +void DrawAdvancedMenu(struct window* window); +int CreateCollectionMenu(struct window_params* params, struct window_flags flags, + struct window_extra_info* window_extra_info, + unk_collection_menu_fn_t param_4, undefined4 param_5, int n_options, + int n_opt_per_page); void SetCollectionMenuField0x1BC(int window_id, int value); void SetCollectionMenuWidth(int window_id, int width); void CloseCollectionMenu(int window_id); @@ -777,98 +701,88 @@ void SetCollectionMenuField0x1C8(int window_id, uint8_t value); void SetCollectionMenuField0x1A0(int window_id, undefined4 value); void SetCollectionMenuField0x1A4(int window_id, undefined4 value); void SetCollectionMenuVoidFn(int window_id, unk_collection_menu_void_fn_t fn); -void UpdateCollectionMenu(struct window *window); +void UpdateCollectionMenu(struct window* window); void SetCollectionMenuField0x1B2(int window_id, undefined4 value); bool IsCollectionMenuState3(int window_id); -int CreateOptionsMenu(struct window_params *params, struct window_flags flags, - struct window_extra_info *window_extra_info, - struct options_menu_id_item *menu_items, int n_items, - int *option_states); +int CreateOptionsMenu(struct window_params* params, struct window_flags flags, + struct window_extra_info* window_extra_info, + struct options_menu_id_item* menu_items, int n_items, int* option_states); void CloseOptionsMenu(int window_id); bool IsOptionsMenuActive(int window_id); bool CheckOptionsMenuField0x1A4(int window_id); -void GetOptionsMenuStates(int window_id, int *option_states); +void GetOptionsMenuStates(int window_id, int* option_states); bool GetOptionsMenuResult(int window_id); -void UpdateOptionsMenu(struct window *window); -int CreateDebugMenu(struct window_params *params, struct window_flags flags, - struct window_extra_info *window_extra_info, - uint16_t *menu_item_string_ids, int n_items, - undefined *param_6); +void UpdateOptionsMenu(struct window* window); +int CreateDebugMenu(struct window_params* params, struct window_flags flags, + struct window_extra_info* window_extra_info, uint16_t* menu_item_string_ids, + int n_items, undefined* param_6); void CloseDebugMenu(int window_id); bool IsDebugMenuActive(int window_id); bool CheckDebugMenuField0x1A4(int window_id); -void UpdateDebugMenu(struct window *window); -int CreateScrollBoxSingle(struct window_params *params, - struct window_flags flags, - struct window_extra_info *window_extra_info, - uint16_t string_id1, struct preprocessor_args *args1, - uint16_t string_id2, struct preprocessor_args *args2); -int CreateScrollBoxMulti(struct window_params *params, - struct window_flags flags, - struct window_extra_info *window_extra_info, - int n_strings, uint16_t *string_ids1, - struct preprocessor_args *args1, uint16_t *string_ids2, - struct preprocessor_args *args2); +void UpdateDebugMenu(struct window* window); +int CreateScrollBoxSingle(struct window_params* params, struct window_flags flags, + struct window_extra_info* window_extra_info, uint16_t string_id1, + struct preprocessor_args* args1, uint16_t string_id2, + struct preprocessor_args* args2); +int CreateScrollBoxMulti(struct window_params* params, struct window_flags flags, + struct window_extra_info* window_extra_info, int n_strings, + uint16_t* string_ids1, struct preprocessor_args* args1, + uint16_t* string_ids2, struct preprocessor_args* args2); void SetScrollBoxState7(int window_id); void CloseScrollBox(int window_id); bool IsScrollBoxActive(int window_id); -void UpdateScrollBox(struct window *window); -int CreateDialogueBox(struct window_params *params); +void UpdateScrollBox(struct window* window); +int CreateDialogueBox(struct window_params* params); void CloseDialogueBox(int window_id); bool IsDialogueBoxActive(int window_id); -void ShowStringIdInDialogueBox(int window_id, struct preprocessor_flags flags, - int string_id, struct preprocessor_args *args); -void ShowStringInDialogueBox(int window_id, struct preprocessor_flags flags, - char *string, struct preprocessor_args *args); +void ShowStringIdInDialogueBox(int window_id, struct preprocessor_flags flags, int string_id, + struct preprocessor_args* args); +void ShowStringInDialogueBox(int window_id, struct preprocessor_flags flags, char* string, + struct preprocessor_args* args); void ShowDialogueBox(int window_id); -void ReadStringFromDialogueBox(int window_id, char *buffer, uint32_t n); -void UpdateDialogueBox(struct window *window); +void ReadStringFromDialogueBox(int window_id, char* buffer, uint32_t n); +void UpdateDialogueBox(struct window* window); int CreatePortraitBox(enum screen screen, uint32_t palette_idx, bool framed); void ClosePortraitBox(int window_id); bool PortraitBoxNeedsUpdate(int window_id); -void ShowPortraitInPortraitBox(int window_id, struct portrait_params *portrait); +void ShowPortraitInPortraitBox(int window_id, struct portrait_params* portrait); void HidePortraitBox(int window_id); -void UpdatePortraitBox(struct window *window); -int CreateTextBox(struct window_params *params, text_box_callback_fn_t cb); -int CreateTextBoxWithArg(struct window_params *params, - text_box_callback_with_arg_fn_t cb, void *cb_arg); +void UpdatePortraitBox(struct window* window); +int CreateTextBox(struct window_params* params, text_box_callback_fn_t cb); +int CreateTextBoxWithArg(struct window_params* params, text_box_callback_with_arg_fn_t cb, + void* cb_arg); void CloseTextBox(int window_id); void CloseTextBox2(int window_id); -struct text_box *CreateTextBoxInternal(struct window_params *params); -void UpdateTextBox(struct window *window); +struct text_box* CreateTextBoxInternal(struct window_params* params); +void UpdateTextBox(struct window* window); bool IsTextBoxActive(int window_id); -int CreateAreaNameBox(struct window_params *params, struct window_flags flags, - struct window_extra_info *window_extra_info, uint32_t id); +int CreateAreaNameBox(struct window_params* params, struct window_flags flags, + struct window_extra_info* window_extra_info, uint32_t id); void SetAreaNameBoxState3(int window_id); void CloseAreaNameBox(int window_id); bool IsAreaNameBoxActive(int window_id); -void UpdateAreaNameBox(struct window *window); -int CreateControlsChart(struct window_params *params, struct window_flags flags, - struct window_extra_info *window_extra_info, - uint16_t string_id); +void UpdateAreaNameBox(struct window* window); +int CreateControlsChart(struct window_params* params, struct window_flags flags, + struct window_extra_info* window_extra_info, uint16_t string_id); void CloseControlsChart(int window_id); bool IsControlsChartActive(int window_id); -void UpdateControlsChart(struct window *window); -int CreateAlertBox(struct window_params *params); +void UpdateControlsChart(struct window* window); +int CreateAlertBox(struct window_params* params); void CloseAlertBox(int window_id); -bool AddMessageToAlertBox(int window_id, struct preprocessor_flags flags, - char *message, - struct preprocessor_args *preprocessor_args, - bool is_new_group); +bool AddMessageToAlertBox(int window_id, struct preprocessor_flags flags, char* message, + struct preprocessor_args* preprocessor_args, bool is_new_group); bool IsAlertBoxActive(int window_id); -void UpdateAlertBox(struct window *window); -int CreateAdvancedTextBox(struct window_params *params, - struct window_flags flags, - struct window_extra_info *extra_info, - text_box_callback_fn_t cb, int n_items); -int CreateAdvancedTextBoxWithArg(struct window_params *params, - struct window_flags flags, - struct window_extra_info *extra_info, - text_box_callback_with_arg_fn_t cb, - void *cb_arg, int n_items); -struct advanced_text_box *CreateAdvancedTextBoxInternal( - struct window_params *params, struct window_flags flags, - struct window_extra_info *extra_info, int n_items, int n_items_per_page); +void UpdateAlertBox(struct window* window); +int CreateAdvancedTextBox(struct window_params* params, struct window_flags flags, + struct window_extra_info* extra_info, text_box_callback_fn_t cb, + int n_items); +int CreateAdvancedTextBoxWithArg(struct window_params* params, struct window_flags flags, + struct window_extra_info* extra_info, + text_box_callback_with_arg_fn_t cb, void* cb_arg, int n_items); +struct advanced_text_box* CreateAdvancedTextBoxInternal(struct window_params* params, + struct window_flags flags, + struct window_extra_info* extra_info, + int n_items, int n_items_per_page); void SetAdvancedTextBoxPartialMenu(int window_id, bool partial_menu); void SetAdvancedTextBoxField0x1C4(int window_id, uint8_t value); void SetAdvancedTextBoxField0x1C2(int window_id); @@ -879,68 +793,59 @@ bool IsAdvancedTextBoxActive(int window_id); uint8_t GetWindowIdPageStart(int window_id); uint32_t GetAdvancedTextBoxFlags2(int window_id); void SetUnkAdvancedTextBoxFn(int window_id, unk_advanced_text_box_fn_t fn); -void SetUnkAdvancedTextBoxWindowFn(int window_id, - unk_advanced_text_box_window_fn_t fn); -void UpdateAdvancedTextBox(struct window *window); +void SetUnkAdvancedTextBoxWindowFn(int window_id, unk_advanced_text_box_window_fn_t fn); +void UpdateAdvancedTextBox(struct window* window); void PlayAdvancedTextBoxInputSound(int window_id, int index); -int CreateTeamSelectionMenu(struct window_params *params, - struct window_flags flags, - struct window_extra_info *window_extra_info, - team_selection_menu_get_item_fn_t get_item, - int n_items, int n_items_per_page); +int CreateTeamSelectionMenu(struct window_params* params, struct window_flags flags, + struct window_extra_info* window_extra_info, + team_selection_menu_get_item_fn_t get_item, int n_items, + int n_items_per_page); void CloseTeamSelectionMenu(int window_id); bool IsTeamSelectionMenuActive(int window_id); -void UpdateTeamSelectionMenu(struct window *window); +void UpdateTeamSelectionMenu(struct window* window); bool IsTeamSelectionMenuState3(int window_id); -int CalcMenuHeightDiv8(struct window_flags flags, - struct window_extra_info *extra_info, int *n_options, - int *n_opt_per_page); -void InitWindowInput(struct window_input_ctx *input_ctx, - struct window_flags flags, - struct window_extra_info *window_extra_info, - struct window_rectangle *rect, int n_items, - int n_items_per_page); -bool IsMenuOptionActive(struct window_input_ctx *input_ctx); -uint8_t GetSelectedItemOnPage(struct window_input_ctx *input_ctx); -uint8_t GetCurrentPage(struct window_input_ctx *input_ctx); -uint8_t GetPageStart(struct window_input_ctx *input_ctx); -uint8_t GetSelectedMenuItemIdx(struct window_input_ctx *input_ctx); -uint8_t GetTotalNumMenuItems(struct window_input_ctx *input_ctx); -uint8_t GetNumItemsOnPage(struct window_input_ctx *input_ctx); -uint8_t GetMaxItemsOnPage(struct window_input_ctx *input_ctx); -uint8_t GetTotalNumPages(struct window_input_ctx *input_ctx); -int GetPageItemYOffset(struct window_input_ctx *input_ctx, uint8_t item_idx); -void PlayWindowInputSound(struct window_input_ctx *input_ctx, int index); -void InitInventoryMenuInput(struct inventory_menu_input_ctx *input_ctx, - struct window_flags flags, - struct window_extra_info *window_extra_info, - struct window_rectangle *rect, int n_items, - int n_items_per_page, undefined param_7); -void InventoryMenuNextPage(struct inventory_menu_input_ctx *ctx); -void InventoryMenuPreviousPage(struct inventory_menu_input_ctx *ctx); -void InventoryMenuNext10Pages(struct inventory_menu_input_ctx *ctx); -void InventoryMenuPrevious10Pages(struct inventory_menu_input_ctx *ctx); -bool OverlayLoadEntriesEqual(struct overlay_load_entry *entry1, - struct overlay_load_entry *entry2); +int CalcMenuHeightDiv8(struct window_flags flags, struct window_extra_info* extra_info, + int* n_options, int* n_opt_per_page); +void InitWindowInput(struct window_input_ctx* input_ctx, struct window_flags flags, + struct window_extra_info* window_extra_info, struct window_rectangle* rect, + int n_items, int n_items_per_page); +bool IsMenuOptionActive(struct window_input_ctx* input_ctx); +uint8_t GetSelectedItemOnPage(struct window_input_ctx* input_ctx); +uint8_t GetCurrentPage(struct window_input_ctx* input_ctx); +uint8_t GetPageStart(struct window_input_ctx* input_ctx); +uint8_t GetSelectedMenuItemIdx(struct window_input_ctx* input_ctx); +uint8_t GetTotalNumMenuItems(struct window_input_ctx* input_ctx); +uint8_t GetNumItemsOnPage(struct window_input_ctx* input_ctx); +uint8_t GetMaxItemsOnPage(struct window_input_ctx* input_ctx); +uint8_t GetTotalNumPages(struct window_input_ctx* input_ctx); +int GetPageItemYOffset(struct window_input_ctx* input_ctx, uint8_t item_idx); +void PlayWindowInputSound(struct window_input_ctx* input_ctx, int index); +void InitInventoryMenuInput(struct inventory_menu_input_ctx* input_ctx, struct window_flags flags, + struct window_extra_info* window_extra_info, + struct window_rectangle* rect, int n_items, int n_items_per_page, + undefined param_7); +void InventoryMenuNextPage(struct inventory_menu_input_ctx* ctx); +void InventoryMenuPreviousPage(struct inventory_menu_input_ctx* ctx); +void InventoryMenuNext10Pages(struct inventory_menu_input_ctx* ctx); +void InventoryMenuPrevious10Pages(struct inventory_menu_input_ctx* ctx); +bool OverlayLoadEntriesEqual(struct overlay_load_entry* entry1, struct overlay_load_entry* entry2); void FreeActiveMenu(void); -bool InitMenu(struct overlay_load_entry *entry); -bool InitMenuWithWindowExtraInfo(struct overlay_load_entry *entry, - bool init_extra_info, - struct window_extra_info *window_extra_info); -bool CopyMenuControlWindowExtraInfo( - struct window_extra_info *window_extra_info); +bool InitMenu(struct overlay_load_entry* entry); +bool InitMenuWithWindowExtraInfo(struct overlay_load_entry* entry, bool init_extra_info, + struct window_extra_info* window_extra_info); +bool CopyMenuControlWindowExtraInfo(struct window_extra_info* window_extra_info); void HandleMenus(void); -int SetupAndShowKeyboard(int menu_type, char *buffer1, char *buffer2); -int ShowKeyboard(int menu_type, char *buffer1, int param_3, char *buffer2); +int SetupAndShowKeyboard(int menu_type, char* buffer1, char* buffer2); +int ShowKeyboard(int menu_type, char* buffer1, int param_3, char* buffer2); int GetKeyboardStatus(void); int GetKeyboardStringResult(void); -char *TeamSelectionMenuGetItem(char *buffer, int member_idx); +char* TeamSelectionMenuGetItem(char* buffer, int member_idx); void FreeMissionRewardStructMain(void); void MissionRewardCloseAllBoxes(void); void PrintMoveOptionMenu(void); -void PrintIqSkillsMenu(enum monster_id monster_id, uint32_t *iq_skills_flags, - int monster_iq, bool is_blinded); -char *GetCheckIqMenuSkillString(char *buf, int iq_entry_idx); +void PrintIqSkillsMenu(enum monster_id monster_id, uint32_t* iq_skills_flags, int monster_iq, + bool is_blinded); +char* GetCheckIqMenuSkillString(char* buf, int iq_entry_idx); void PlayMissionClearBgm(void); bool GetNotifyNote(void); void SetNotifyNote(bool flag); @@ -949,26 +854,25 @@ void EventFlagBackupVeneer(void); void InitMainTeamAfterQuiz(void); void InitSpecialEpisodePartners(void); void InitSpecialEpisodeExtraPartner(void); -void AssignSpecialEpisodePc(int team_member_id, - struct special_episode_pc *special_episode_pc); -void ReadStringSave(char *buf); -bool CheckStringSave(const char *buf); -int WriteSaveFile(undefined *save_info, undefined *buf, int size); -int ReadSaveFile(undefined *save_info, undefined *buf, int size); -void CalcChecksum(undefined *save_info, int size); -bool CheckChecksumInvalid(undefined *save_info, int size); +void AssignSpecialEpisodePc(int team_member_id, struct special_episode_pc* special_episode_pc); +void ReadStringSave(char* buf); +bool CheckStringSave(const char* buf); +int WriteSaveFile(undefined* save_info, undefined* buf, int size); +int ReadSaveFile(undefined* save_info, undefined* buf, int size); +void CalcChecksum(undefined* save_info, int size); +bool CheckChecksumInvalid(undefined* save_info, int size); int NoteSaveBase(int param_1); -void WriteQuickSaveInfo(undefined *buf, int size); -undefined4 ReadSaveHeader(undefined4 *param_1, undefined4 param_2, - undefined4 param_3, undefined4 param_4); +void WriteQuickSaveInfo(undefined* buf, int size); +undefined4 ReadSaveHeader(undefined4* param_1, undefined4 param_2, undefined4 param_3, + undefined4 param_4); int NoteLoadBase(void); -int ReadQuickSaveInfo(undefined *buf, int size); +int ReadQuickSaveInfo(undefined* buf, int size); void InitOptionsVeneer(void); void InitOptions(void); -void GetOptions(struct options *dest_opts_ptr); -void SetOptions(struct options *src_options_ptr); -void SaveOptionsToCtx(uint8_t *ctx); -void LoadOptionsFromCtx(uint8_t *ctx); +void GetOptions(struct options* dest_opts_ptr); +void SetOptions(struct options* src_options_ptr); +void SaveOptionsToCtx(uint8_t* ctx); +void LoadOptionsFromCtx(uint8_t* ctx); bool IsTouchScreenNotOff(void); bool IsTouchScreenUseAnywhere(void); uint8_t GetTopScreenOption(void); @@ -983,59 +887,46 @@ bool GetCheckDirectionOption(void); bool IsMapShownOnEitherScreen(void); bool IsTeamStatsOnTopScreen(void); bool IsTextLogOnTopScreen(void); -void CopyFrameTypeOption(uint8_t *dst); -void SetFrameTypeOption(uint8_t *new_ft); +void CopyFrameTypeOption(uint8_t* dst); +void SetFrameTypeOption(uint8_t* new_ft); enum game_mode GetGameMode(void); bool IsGameModeRescue(void); void SetGameMode(enum game_mode new_game_mode); void DebugPrintEventFlagSize(void); void InitScriptVariableValues(void); void InitEventFlagScriptVars(void); -void DefaultInitScriptVariable(void *local_var_vals, enum script_var_id id); -void ZinitScriptVariable(void *local_var_vals, enum script_var_id id); -void LoadScriptVariableRaw(struct script_var_desc *var, void *local_var_vals, +void DefaultInitScriptVariable(void* local_var_vals, enum script_var_id id); +void ZinitScriptVariable(void* local_var_vals, enum script_var_id id); +void LoadScriptVariableRaw(struct script_var_desc* var, void* local_var_vals, enum script_var_id id); -int LoadScriptVariableValue(void *local_var_vals, enum script_var_id id); -int LoadScriptVariableValueAtIndex(void *local_var_vals, enum script_var_id id, - int idx); -void SaveScriptVariableValue(void *local_var_vals, enum script_var_id id, - int val); -void SaveScriptVariableValueAtIndex(void *local_var_vals, enum script_var_id id, - int idx, int val); -int LoadScriptVariableValueSum(void *local_var_vals, enum script_var_id id); -void LoadScriptVariableValueBytes(enum script_var_id id, void *dest, - uint32_t n); -void LoadScriptVariableValueString(enum script_var_id id, void *dest, - uint8_t n); -void SaveScriptVariableValueBytes(enum script_var_id id, void *src, uint32_t n); -bool ScriptVariablesEqual(void *local_var_vals, enum script_var_id id1, - enum script_var_id id2); -int CalcScriptVariables(int val0, int val1, - enum script_calc_operation operation); -bool CompareScriptVariables(int val0, int val1, - enum script_compare_operation operation); -int CalcScriptVariablesVeneer(int val0, int val1, - enum script_calc_operation operation); -void CalcAndUpdateScriptVarWithOtherValue(void *local_var_vals, - enum script_var_id id, int other_val, - enum script_calc_operation operation); -void CalcAndUpdateScriptVarWithOtherScriptVar( - void *local_var_vals, enum script_var_id id1, enum script_var_id id2, - enum script_calc_operation operation); -bool CompareScriptVariablesVeneer(int val0, int val1, - enum script_compare_operation operation); -bool LoadAndCompareScriptVarAndValue(void *local_var_vals, - enum script_var_id id, int other_val, +int LoadScriptVariableValue(void* local_var_vals, enum script_var_id id); +int LoadScriptVariableValueAtIndex(void* local_var_vals, enum script_var_id id, int idx); +void SaveScriptVariableValue(void* local_var_vals, enum script_var_id id, int val); +void SaveScriptVariableValueAtIndex(void* local_var_vals, enum script_var_id id, int idx, int val); +int LoadScriptVariableValueSum(void* local_var_vals, enum script_var_id id); +void LoadScriptVariableValueBytes(enum script_var_id id, void* dest, uint32_t n); +void LoadScriptVariableValueString(enum script_var_id id, void* dest, uint8_t n); +void SaveScriptVariableValueBytes(enum script_var_id id, void* src, uint32_t n); +bool ScriptVariablesEqual(void* local_var_vals, enum script_var_id id1, enum script_var_id id2); +int CalcScriptVariables(int val0, int val1, enum script_calc_operation operation); +bool CompareScriptVariables(int val0, int val1, enum script_compare_operation operation); +int CalcScriptVariablesVeneer(int val0, int val1, enum script_calc_operation operation); +void CalcAndUpdateScriptVarWithOtherValue(void* local_var_vals, enum script_var_id id, + int other_val, enum script_calc_operation operation); +void CalcAndUpdateScriptVarWithOtherScriptVar(void* local_var_vals, enum script_var_id id1, + enum script_var_id id2, + enum script_calc_operation operation); +bool CompareScriptVariablesVeneer(int val0, int val1, enum script_compare_operation operation); +bool LoadAndCompareScriptVarAndValue(void* local_var_vals, enum script_var_id id, int other_val, enum script_compare_operation operation); -bool LoadAndCompareScriptVars(void *local_var_vals, enum script_var_id id1, - enum script_var_id id2, +bool LoadAndCompareScriptVars(void* local_var_vals, enum script_var_id id1, enum script_var_id id2, enum script_compare_operation operation); void EventFlagResume(void); void EventFlagBackup(void); -int DumpScriptVariableValues(void *dest); -bool RestoreScriptVariableValues(void *src); +int DumpScriptVariableValues(void* dest); +bool RestoreScriptVariableValues(void* src); void InitScenarioScriptVars(void); -void LoadScriptVarValuePair(enum script_var_id id, int *val0, int *val1); +void LoadScriptVarValuePair(enum script_var_id id, int* val0, int* val1); void SetScenarioScriptVar(enum script_var_id id, uint8_t val0, uint8_t val1); bool IsStoryBeforePoint(enum script_var_id id, int chapter, int subsection); bool IsStoryBeforeOrAtPoint(enum script_var_id id, int chapter, int subsection); @@ -1048,12 +939,10 @@ int GetDebugSpecialEpisodeNumber(void); void SetDebugSpecialEpisodeNumber(int special_episode_number); int GetExecuteSpecialEpisodeType(void); bool IsSpecialEpisodeOpen(enum special_episode_type special_episode_type); -void SetSpecialEpisodeOpen(enum special_episode_type special_episode_type, - bool episode_open); +void SetSpecialEpisodeOpen(enum special_episode_type special_episode_type, bool episode_open); bool IsSpecialEpisodeOpenMismatch(void); bool IsSpecialEpisodeOpenOld(enum special_episode_type special_episode_type); -void SetSpecialEpisodeOpenOld(enum special_episode_type special_episode_type, - bool episode_open); +void SetSpecialEpisodeOpenOld(enum special_episode_type special_episode_type, bool episode_open); bool IsSpecialEpisodeBeaten(enum special_episode_type special_episode_type); void SetSpecialEpisodeBeaten(enum special_episode_type special_episode_type, bool special_episode_beaten); @@ -1068,7 +957,7 @@ void SetWorldMapLevel(int32_t world_map_level); void InitDungeonListScriptVars(void); void SetDungeonConquest(enum dungeon_id dungeon_id, int bit_value); enum dungeon_mode GetDungeonMode(enum dungeon_id dungeon_id); -struct global_progress *GlobalProgressAlloc(void); +struct global_progress* GlobalProgressAlloc(void); void ResetGlobalProgress(void); void SetMonsterFlag1(enum monster_id monster_id); bool GetMonsterFlag1(enum monster_id monster_id); @@ -1082,28 +971,25 @@ void IncrementNbAdventures(void); int GetNbAdventures(void); bool CanMonsterSpawn(enum monster_id monster_id); void IncrementExclusiveMonsterCounts(enum monster_id monster_id); -void CopyProgressInfoToStream(struct bitstream *stream); -uint32_t GetProgressInfoForSave(void *dst, uint32_t len); -void CopyProgressInfoFromStream(struct bitstream *stream); -uint32_t ReadProgressInfoFromSave(void *src, uint32_t len); +void CopyProgressInfoToStream(struct bitstream* stream); +uint32_t GetProgressInfoForSave(void* dst, uint32_t len); +void CopyProgressInfoFromStream(struct bitstream* stream); +uint32_t ReadProgressInfoFromSave(void* src, uint32_t len); void InitKaomadoStream(void); -void InitPortraitParams(struct portrait_params *portrait); -void InitPortraitParamsWithMonsterId(struct portrait_params *portrait, - enum monster_id monster_id); -void SetPortraitEmotion(struct portrait_params *portrait, - enum portrait_emotion emotion); -void SetPortraitLayout(struct portrait_params *portrait, uint8_t layout_idx); -void SetPortraitOffset(struct portrait_params *portrait, struct vec2 *offset); -void AllowPortraitDefault(struct portrait_params *portrait, bool allow); -bool IsValidPortrait(struct portrait_params *portrait); -bool LoadPortrait(struct portrait_params *portrait, struct kaomado_buffer *buf); -bool WonderMailPasswordToMission(char *password, struct mission *mission_data); -void MissionToWonderMailPassword(char *password, struct mission *mission_data); +void InitPortraitParams(struct portrait_params* portrait); +void InitPortraitParamsWithMonsterId(struct portrait_params* portrait, enum monster_id monster_id); +void SetPortraitEmotion(struct portrait_params* portrait, enum portrait_emotion emotion); +void SetPortraitLayout(struct portrait_params* portrait, uint8_t layout_idx); +void SetPortraitOffset(struct portrait_params* portrait, struct vec2* offset); +void AllowPortraitDefault(struct portrait_params* portrait, bool allow); +bool IsValidPortrait(struct portrait_params* portrait); +bool LoadPortrait(struct portrait_params* portrait, struct kaomado_buffer* buf); +bool WonderMailPasswordToMission(char* password, struct mission* mission_data); +void MissionToWonderMailPassword(char* password, struct mission* mission_data); void SetEnterDungeon(enum dungeon_id dungeon_id); -void InitDungeonInit(struct dungeon_init *dungeon_init_data, - enum dungeon_id dungeon_id); +void InitDungeonInit(struct dungeon_init* dungeon_init_data, enum dungeon_id dungeon_id); bool IsNoLossPenaltyDungeon(enum dungeon_id dungeon_id); -bool MissionRewardValidateDungeonId(struct dungeon_id_8 *dungeon_id); +bool MissionRewardValidateDungeonId(struct dungeon_id_8* dungeon_id); undefined CheckMissionRestrictions(undefined param_1); bool TilesetSecondaryTerrainIsChasm(int16_t tileset_id); int GetNbFloors(enum dungeon_id dungeon_id); @@ -1111,15 +997,14 @@ int GetNbFloorsPlusOne(enum dungeon_id dungeon_id); enum dungeon_group_id GetDungeonGroup(enum dungeon_id dungeon_id); int GetNbPrecedingFloors(enum dungeon_id dungeon_id); int GetNbFloorsDungeonGroup(enum dungeon_id dungeon_id); -void DungeonFloorToGroupFloor( - struct dungeon_group_and_group_floor *out_group_data, - struct dungeon_floor_pair *dungeon_and_floor); -enum mission_rank GetMissionRank(struct dungeon_floor_pair *dungeon_and_floor); -int GetOutlawLevel(struct dungeon_floor_pair *dungeon_and_floor); -int GetOutlawLeaderLevel(struct dungeon_floor_pair *dungeon_and_floor); -int GetOutlawMinionLevel(struct dungeon_floor_pair *dungeon_and_floor); -void AddGuestMonster(struct dungeon_init *dungeon_init_data, int guest_number, - struct guest_monster *guest_monster); +void DungeonFloorToGroupFloor(struct dungeon_group_and_group_floor* out_group_data, + struct dungeon_floor_pair* dungeon_and_floor); +enum mission_rank GetMissionRank(struct dungeon_floor_pair* dungeon_and_floor); +int GetOutlawLevel(struct dungeon_floor_pair* dungeon_and_floor); +int GetOutlawLeaderLevel(struct dungeon_floor_pair* dungeon_and_floor); +int GetOutlawMinionLevel(struct dungeon_floor_pair* dungeon_and_floor); +void AddGuestMonster(struct dungeon_init* dungeon_init_data, int guest_number, + struct guest_monster* guest_monster); int GetGroundNameId(int param_1); void SetAdventureLogStructLocation(void); void SetAdventureLogDungeonFloor(struct dungeon_floor_pair dungeon_floor); @@ -1156,34 +1041,34 @@ void ComputeSpecialCounters(void); void RecruitSpecialPokemonLog(enum monster_id monster_id); void IncrementNbFainted(void); uint32_t GetNbFainted(void); -void SetItemAcquired(struct item *item); +void SetItemAcquired(struct item* item); uint32_t GetNbItemAcquired(void); void SetChallengeLetterCleared(uint32_t challenge_id); uint32_t GetSentryDutyGamePoints(int32_t rank); int32_t SetSentryDutyGamePoints(uint32_t points); -void CopyLogToStream(struct bitstream *stream); -void CopyLogFromStream(struct bitstream *stream); -void GetAbilityString(undefined *buf, enum ability_id ability_id); +void CopyLogToStream(struct bitstream* stream); +void CopyLogFromStream(struct bitstream* stream); +void GetAbilityString(undefined* buf, enum ability_id ability_id); int GetAbilityDescStringId(enum ability_id ability_id); int GetTypeStringId(enum type_id type_id); enum type_id GetConversion2ConvertToType(enum type_id attack_type_id); -void InitBitstreamForWrite(struct bitstream *stream, void *src, uint32_t len); -void InitBitstreamForRead(struct bitstream *stream, void *dst, uint32_t len); -void BitstreamDebug(struct bitstream *stream); -void CopyBitsToStream(struct bitstream *stream, void *src, int nbits); -void CopyBitsFromStream(struct bitstream *stream, void *dst, int nbits); +void InitBitstreamForWrite(struct bitstream* stream, void* src, uint32_t len); +void InitBitstreamForRead(struct bitstream* stream, void* dst, uint32_t len); +void BitstreamDebug(struct bitstream* stream); +void CopyBitsToStream(struct bitstream* stream, void* src, int nbits); +void CopyBitsFromStream(struct bitstream* stream, void* dst, int nbits); void StoreDefaultTeamData(void); -void GetMainTeamNameWithCheck(char *buf); -void GetMainTeamName(char *buf); -void SetMainTeamName(char *buf); +void GetMainTeamNameWithCheck(char* buf); +void GetMainTeamName(char* buf); +void SetMainTeamName(char* buf); int GetRankupPoints(void); enum rank GetRank(void); int GetRankStorageSize(void); -void ResetPlayTimer(struct play_time *igt); -void PlayTimerTick(struct play_time *igt); -uint32_t GetPlayTimeSeconds(struct play_time *igt); +void ResetPlayTimer(struct play_time* igt); +void PlayTimerTick(struct play_time* igt); +uint32_t GetPlayTimeSeconds(struct play_time* igt); uint32_t SubFixedPoint(uint32_t val_fp, uint32_t dec_fp); -uint32_t BinToDecFixedPoint(ufx32_16 *q16); +uint32_t BinToDecFixedPoint(ufx32_16* q16); int CeilFixedPoint(uint32_t val_fp); void MtInit(int32_t initial_seed); int32_t MtNext(void); @@ -1206,29 +1091,29 @@ bool JoinedAtRangeCheck(struct dungeon_id_8 joined_at); bool IsDojoDungeon(enum dungeon_id dungeon_id); bool IsFutureDungeon(enum dungeon_id dungeon_id); bool IsSpecialEpisodeDungeon(enum dungeon_id dungeon_id); -enum item_id RetrieveFromItemList1(undefined *dungeon_info, undefined4 param_2); -bool IsForbiddenFloor(undefined *dungeon_info, undefined4 param_2, - undefined4 param_3, undefined4 param_4); -void Copy16BitsToStream(struct bitstream *stream, void *src); -void Copy16BitsFromStream(struct bitstream *stream, void *dst); -enum item_id RetrieveFromItemList2(undefined *dungeon_info, undefined4 param_2); +enum item_id RetrieveFromItemList1(undefined* dungeon_info, undefined4 param_2); +bool IsForbiddenFloor(undefined* dungeon_info, undefined4 param_2, undefined4 param_3, + undefined4 param_4); +void Copy16BitsToStream(struct bitstream* stream, void* src); +void Copy16BitsFromStream(struct bitstream* stream, void* dst); +enum item_id RetrieveFromItemList2(undefined* dungeon_info, undefined4 param_2); bool IsInvalidForMission(enum dungeon_id dungeon_id); bool IsExpEnabledInDungeon(enum dungeon_id dungeon_id); bool IsSkyExclusiveDungeon(enum dungeon_id dungeon_id); bool JoinedAtRangeCheck2(struct dungeon_id_8 joined_at); uint32_t GetBagCapacity(int scenario_balance); uint32_t GetBagCapacitySpecialEpisode(int se_type); -struct rankup_table_entry *GetRankUpEntry(int rank); +struct rankup_table_entry* GetRankUpEntry(int rank); int GetBgRegionArea(int offset, int subregion_id, int region_id); void LoadMonsterMd(void); -void GetNameRaw(char *dst, enum monster_id monster_id); -void GetName(char *dst, enum monster_id monster_id, char color_id); -void GetNameWithGender(char *dst, enum monster_id monster_id, char color_id); -void GetSpeciesString(char *dst, enum monster_id monster_id); -char *GetNameString(enum monster_id monster_id); +void GetNameRaw(char* dst, enum monster_id monster_id); +void GetName(char* dst, enum monster_id monster_id, char color_id); +void GetNameWithGender(char* dst, enum monster_id monster_id, char color_id); +void GetSpeciesString(char* dst, enum monster_id monster_id); +char* GetNameString(enum monster_id monster_id); int GetSpriteIndex(enum monster_id monster_id); int GetDexNumber(enum monster_id monster_id); -char *GetCategoryString(enum monster_id monster_id); +char* GetCategoryString(enum monster_id monster_id); enum monster_gender GetMonsterGender(enum monster_id monster_id); int GetBodySize(enum monster_id monster_id); uint8_t GetSpriteSize(enum monster_id monster_id); @@ -1252,42 +1137,37 @@ int GetAbility(enum monster_id monster_id, int ability_idx); int GetRecruitRate2(enum monster_id monster_id); int GetRecruitRate1(enum monster_id monster_id); int GetExp(enum monster_id monster_id, int level); -void GetEvoParameters(undefined *evo_params, enum monster_id monster_id); -void GetTreasureBoxChances(enum monster_id monster_id, undefined *chances); +void GetEvoParameters(undefined* evo_params, enum monster_id monster_id); +void GetTreasureBoxChances(enum monster_id monster_id, undefined* chances); int GetIqGroup(enum monster_id monster_id); int GetSpawnThreshold(enum monster_id monster_id); bool NeedsItemToSpawn(enum monster_id monster_id); int GetExclusiveItem(enum monster_id monster_id, int excl_idx); int GetFamilyIndex(enum monster_id monster_id); void LoadM2nAndN2m(void); -void GuestMonsterToGroundMonster(struct ground_monster *ground_monster, - struct guest_monster *guest_monster); -void SetBaseStatsMovesGroundMonster(struct ground_monster *ground_monster); -bool StrcmpMonsterName(char *string, enum monster_id monster_id); -void InitializeTeamMemberFromMentry(struct team_member *team_member, - struct ground_monster *ground_monster, +void GuestMonsterToGroundMonster(struct ground_monster* ground_monster, + struct guest_monster* guest_monster); +void SetBaseStatsMovesGroundMonster(struct ground_monster* ground_monster); +bool StrcmpMonsterName(char* string, enum monster_id monster_id); +void InitializeTeamMemberFromMentry(struct team_member* team_member, struct ground_monster* ground_monster, int32_t slot_index); -void GetLvlUpEntry(struct level_up_entry *level_up_entry, - enum monster_id monster_id, int level); -uint8_t *GetEncodedHalfword(uint8_t *data_ptr, uint16_t *result); -int GetEvoFamily(undefined *monster, undefined *evo_family); -int GetEvolutions(enum monster_id monster_id, enum monster_id *output_list, +void GetLvlUpEntry(struct level_up_entry* level_up_entry, enum monster_id monster_id, int level); +uint8_t* GetEncodedHalfword(uint8_t* data_ptr, uint16_t* result); +int GetEvoFamily(undefined* monster, undefined* evo_family); +int GetEvolutions(enum monster_id monster_id, enum monster_id* output_list, bool skip_sprite_size_check, bool skip_shedinja_check); -void ShuffleHiddenPower(undefined *dmons_addr); +void ShuffleHiddenPower(undefined* dmons_addr); enum monster_id GetBaseForm(enum monster_id); -enum monster_id -GetBaseFormBurmyWormadamShellosGastrodonCherrim(enum monster_id monster_id); +enum monster_id GetBaseFormBurmyWormadamShellosGastrodonCherrim(enum monster_id monster_id); enum monster_id GetBaseFormCastformCherrimDeoxys(enum monster_id monster_id); int GetAllBaseForms(enum monster_id monster_id); int GetDexNumberVeneer(enum monster_id monster_id); -enum monster_id GetMonsterIdFromSpawnEntry(struct monster_spawn_entry *); -void SetMonsterId(struct monster_spawn_entry *monster_spawn, - enum monster_id monster_id); -void SetMonsterLevelAndId(struct monster_spawn_entry *monster_spawn, int level, +enum monster_id GetMonsterIdFromSpawnEntry(struct monster_spawn_entry*); +void SetMonsterId(struct monster_spawn_entry* monster_spawn, enum monster_id monster_id); +void SetMonsterLevelAndId(struct monster_spawn_entry* monster_spawn, int level, enum monster_id monster_id); -uint8_t GetMonsterLevelFromSpawnEntry(struct monster_spawn_entry *entry); -void ApplyLevelUpBoostsToGroundMonster(struct ground_monster *ground_monster, - int level, bool flag); +uint8_t GetMonsterLevelFromSpawnEntry(struct monster_spawn_entry* entry); +void ApplyLevelUpBoostsToGroundMonster(struct ground_monster* ground_monster, int level, bool flag); enum monster_gender GetMonsterGenderVeneer(enum monster_id monster_id); bool IsMonsterValid(enum monster_id monster_id); bool IsUnown(enum monster_id monster_id); @@ -1301,203 +1181,180 @@ enum monster_id GetBaseFormCastformDeoxysCherrim(enum monster_id monster_id); bool BaseFormsEqual(enum monster_id monster1, enum monster_id monster2); bool DexNumbersEqual(enum monster_id monster1, enum monster_id monster2); bool GendersEqual(enum monster_id monster1, enum monster_id monster2); -bool GendersEqualNotGenderless(enum monster_id monster1, - enum monster_id monster2); -bool GendersNotEqualNotGenderless(enum monster_id monster1, - enum monster_id monster2); -void RecolorNameString(char *out, char *name, char color_symbol); -void RecolorTeamMemberNameString(char *out, char *name, bool is_leader); -void ModifyHpStat(int16_t *stat_ptr, int32_t amount); -void ModifyOffensiveStat(int8_t *stat_ptr, int32_t amount); -void ModifyDefensiveStat(int8_t *stat_ptr, int32_t amount); -void ModifyIqStat(int16_t *stat_ptr, int32_t amount); +bool GendersEqualNotGenderless(enum monster_id monster1, enum monster_id monster2); +bool GendersNotEqualNotGenderless(enum monster_id monster1, enum monster_id monster2); +void RecolorNameString(char* out, char* name, char color_symbol); +void RecolorTeamMemberNameString(char* out, char* name, bool is_leader); +void ModifyHpStat(int16_t* stat_ptr, int32_t amount); +void ModifyOffensiveStat(int8_t* stat_ptr, int32_t amount); +void ModifyDefensiveStat(int8_t* stat_ptr, int32_t amount); +void ModifyIqStat(int16_t* stat_ptr, int32_t amount); bool IsMonsterOnTeam(enum monster_id monster_id, int recruit_strategy); -void GetNbRecruited(undefined *recruit); +void GetNbRecruited(undefined* recruit); bool IsValidTeamMember(int member_idx); bool IsMainCharacter(int member_idx); -struct ground_monster *GetTeamMember(int member_idx); +struct ground_monster* GetTeamMember(int member_idx); int GetRecruitMentryIdBySpecies(enum monster_id monster_id, int num_to_skip); int GetHeroMemberIdx(void); int GetPartnerMemberIdx(void); int GetMainCharacter1MemberIdx(void); int GetMainCharacter2MemberIdx(void); int GetMainCharacter3MemberIdx(void); -struct ground_monster *GetHero(void); -struct ground_monster *GetPartner(void); -struct ground_monster *GetMainCharacter1(void); -struct ground_monster *GetMainCharacter2(void); -struct ground_monster *GetMainCharacter3(void); +struct ground_monster* GetHero(void); +struct ground_monster* GetPartner(void); +struct ground_monster* GetMainCharacter1(void); +struct ground_monster* GetMainCharacter2(void); +struct ground_monster* GetMainCharacter3(void); int GetFirstMatchingMemberIdx(enum monster_id monster_id); int GetFirstEmptyMemberIdx(int param_1); -bool IsMonsterNotNicknamed(struct ground_monster *monster); -void GetRecoloredGroundMonsterName(char *out, struct ground_monster *monster, - char color_symbol); +bool IsMonsterNotNicknamed(struct ground_monster* monster); +void GetRecoloredGroundMonsterName(char* out, struct ground_monster* monster, char color_symbol); void RemoveActiveMembersFromAllTeams(void); void RemoveActiveMembersFromSpecialEpisodeTeam(void); void RemoveActiveMembersFromRescueTeam(void); bool CheckTeamMemberIdx(int member_idx); bool IsMonsterIdInNormalRange(enum monster_id monster_id); void SetActiveTeam(enum team_id team_id); -struct team_member *GetActiveTeamMember(int roster_idx); +struct team_member* GetActiveTeamMember(int roster_idx); int GetActiveRosterIndex(int member_idx); int TryAddMonsterToActiveTeam(int member_idx); int GetAppointedLeaderMemberIdx(void); void RemoveActiveMembersFromMainTeam(void); void SetTeamSetupHeroAndPartnerOnly(void); void SetTeamSetupHeroOnly(void); -int GetPartyMembers(uint16_t *party_members); -int GetAdventureNpcIds(struct monster_id_16 *monster_id_table); -int GetUnitNpcIds(struct monster_id_16 *monster_id_table); +int GetPartyMembers(uint16_t* party_members); +int GetAdventureNpcIds(struct monster_id_16* monster_id_table); +int GetUnitNpcIds(struct monster_id_16* monster_id_table); void RefillTeam(void); -void ValidateTeamMembers(bool *valid_member_table); +void ValidateTeamMembers(bool* valid_member_table); int ClearItem(int team_id, bool check); -void GetRecoloredNameOfTeamMemberAtIdx(char *out, int roster_idx); -void GetNameOfTeamMemberAtIdx(char *out, int roster_idx); -void GetRecoloredTeamMemberName(char *out, struct team_member *team_member); +void GetRecoloredNameOfTeamMemberAtIdx(char* out, int roster_idx); +void GetNameOfTeamMemberAtIdx(char* out, int roster_idx); +void GetRecoloredTeamMemberName(char* out, struct team_member* team_member); void ChangeGiratinaFormIfSkyDungeon(enum dungeon_id dungeon_id); void RevertGiratinaAndShaymin(uint8_t member_idx, undefined param_2); -void *OamTileNumberToVramAddress(uint16_t oam_tile_num, uint8_t screen); +void* OamTileNumberToVramAddress(uint16_t oam_tile_num, uint8_t screen); int GetIqSkillStringId(enum iq_skill_id iq_skill); bool DoesTacticFollowLeader(enum tactic_id tactic_id); -void GetUnlockedTactics(enum tactic_id *unlocked_tactics, int level); -void GetUnlockedTacticFlags(bool *tactic_unlock_flags, int level); +void GetUnlockedTactics(enum tactic_id* unlocked_tactics, int level); +void GetUnlockedTacticFlags(bool* tactic_unlock_flags, int level); bool CanLearnIqSkill(int iq_amount, enum iq_skill_id iq_id); -int GetLearnableIqSkills(struct iq_skill_id_8 *out_iq_skill_id, - enum monster_id monster_id, int monster_iq); -void DisableIqSkill(uint32_t *iq_skills_flags, enum iq_skill_id iq_id); -void EnableIqSkill(uint32_t *iq_skills_flags, enum iq_skill_id iq_id); +int GetLearnableIqSkills(struct iq_skill_id_8* out_iq_skill_id, enum monster_id monster_id, + int monster_iq); +void DisableIqSkill(uint32_t* iq_skills_flags, enum iq_skill_id iq_id); +void EnableIqSkill(uint32_t* iq_skills_flags, enum iq_skill_id iq_id); enum iq_skill_id GetSpeciesIqSkill(enum monster_id monster_id, int index); -void DisableAllIqSkills(uint32_t *iq_skills_flags); -void EnableAllLearnableIqSkills(uint32_t *iq_skills_flags, - enum monster_id monster_id, int monster_iq); -bool IqSkillFlagTest(uint32_t *iq_skill_flags, enum iq_skill_id iq_id); +void DisableAllIqSkills(uint32_t* iq_skills_flags); +void EnableAllLearnableIqSkills(uint32_t* iq_skills_flags, enum monster_id monster_id, + int monster_iq); +bool IqSkillFlagTest(uint32_t* iq_skill_flags, enum iq_skill_id iq_id); enum iq_skill_id GetNextIqSkill(enum monster_id monster_id, int monster_iq); bool ExplorerMazeMonsterExists(void); -void GetExplorerMazeTeamName(char *buffer); -struct ground_monster *GetExplorerMazeMonster(uint8_t entry_number); -uint32_t GetMonsterInfoForSave(void *dst, uint32_t len); -uint32_t ReadMonsterInfoFromSave(void *src, uint32_t len); -void CopyMonsterToStream(struct bitstream *stream, - struct ground_monster *monster); -void CopyMonsterFromStream(struct bitstream *stream, - struct ground_monster *monster); -void GetEvolutionPossibilities(struct ground_monster *monster, undefined *evo); -int GetMonsterEvoStatus(struct ground_monster *monster); -bool HandleShedinjaEvolution(int16_t *member_idx, enum monster_id monster_id); -void CopyTacticString(char *buffer, enum tactic_id tactic_id); -void GetStatBoostsForMonsterSummary(struct monster_summary *monster_summary, - enum monster_id monster_id, - struct item *item, int iq, +void GetExplorerMazeTeamName(char* buffer); +struct ground_monster* GetExplorerMazeMonster(uint8_t entry_number); +uint32_t GetMonsterInfoForSave(void* dst, uint32_t len); +uint32_t ReadMonsterInfoFromSave(void* src, uint32_t len); +void CopyMonsterToStream(struct bitstream* stream, struct ground_monster* monster); +void CopyMonsterFromStream(struct bitstream* stream, struct ground_monster* monster); +void GetEvolutionPossibilities(struct ground_monster* monster, undefined* evo); +int GetMonsterEvoStatus(struct ground_monster* monster); +bool HandleShedinjaEvolution(int16_t* member_idx, enum monster_id monster_id); +void CopyTacticString(char* buffer, enum tactic_id tactic_id); +void GetStatBoostsForMonsterSummary(struct monster_summary* monster_summary, + enum monster_id monster_id, struct item* item, int iq, bool klutz_active); -void CreateMonsterSummaryFromTeamMember(struct monster_summary *monster_summary, - struct team_member *team_member, - bool is_leader); +void CreateMonsterSummaryFromTeamMember(struct monster_summary* monster_summary, + struct team_member* team_member, bool is_leader); int GetSosMailCount(int param_1, bool param_2); -bool IsMissionSuspendedAndValid(struct mission *mission); -bool AreMissionsEquivalent(struct mission *mission1, struct mission *mission2); -bool IsMissionValid(struct mission *mission); -bool CheckMonsterForMissionType(enum mission_type type, - union mission_subtype *subtype, +bool IsMissionSuspendedAndValid(struct mission* mission); +bool AreMissionsEquivalent(struct mission* mission1, struct mission* mission2); +bool IsMissionValid(struct mission* mission); +bool CheckMonsterForMissionType(enum mission_type type, union mission_subtype* subtype, enum monster_id target, bool allow_no_monster); -bool CheckItemForMissionType(enum mission_type type, - union mission_subtype *subtype, enum item_id item); -enum mission_generation_result GenerateMission(undefined *param_1, - struct mission *mission_data); -int CountAndPopulateValidMissionTableMonsters(enum monster_id *monster_table, - undefined4 *range); -bool IsMissionTypeSpecialEpisode(struct mission *mission); -bool DoesMissionHaveTypeAndSubtype(struct mission *mission, - struct mission_type_8 *type, - union mission_subtype *subtype); -bool AlreadyHasSimilarMission(struct mission_type_8 *type, - union mission_subtype *subtype); +bool CheckItemForMissionType(enum mission_type type, union mission_subtype* subtype, + enum item_id item); +enum mission_generation_result GenerateMission(undefined* param_1, struct mission* mission_data); +int CountAndPopulateValidMissionTableMonsters(enum monster_id* monster_table, undefined4* range); +bool IsMissionTypeSpecialEpisode(struct mission* mission); +bool DoesMissionHaveTypeAndSubtype(struct mission* mission, struct mission_type_8* type, + union mission_subtype* subtype); +bool AlreadyHasSimilarMission(struct mission_type_8* type, union mission_subtype* subtype); void GenerateDailyMissions(void); -bool AlreadyHaveMission(struct mission *mission); +bool AlreadyHaveMission(struct mission* mission); int CountJobListMissions(void); int DungeonRequestsDone(uint8_t param_1, bool param_2); int DungeonRequestsDoneWrapper(uint8_t param_1); bool AnyDungeonRequestsDone(uint8_t param_1); -bool AddMissionToJobList(struct mission *mission); -struct mission *GetAcceptedMission(uint8_t mission_id); +bool AddMissionToJobList(struct mission* mission); +struct mission* GetAcceptedMission(uint8_t mission_id); bool IsAcceptedMissionSlotEmpty(int32_t mission_slot); -bool WasMissionCompletedToday( - struct mission_result_and_client *result_and_client, - struct mission *mission, enum mission_type type); +bool WasMissionCompletedToday(struct mission_result_and_client* result_and_client, + struct mission* mission, enum mission_type type); int GetMissionByTypeAndDungeon(int start_index, enum mission_type mission_type, - undefined *subtype_struct, - enum dungeon_id dungeon_id); -bool CheckAcceptedMissionByTypeAndDungeon(enum mission_type mission_type, - undefined *subtype_struct, + undefined* subtype_struct, enum dungeon_id dungeon_id); +bool CheckAcceptedMissionByTypeAndDungeon(enum mission_type mission_type, undefined* subtype_struct, enum dungeon_id dungeon_id); -int GetAllPossibleMonsters(void *buf); +int GetAllPossibleMonsters(void* buf); int GenerateAllPossibleMonstersList(void); void DeleteAllPossibleMonstersList(void); int GenerateAllPossibleDungeonsList(void); void DeleteAllPossibleDungeonsList(void); int GenerateAllPossibleDeliverList(void); void DeleteAllPossibleDeliverList(void); -void ClearMissionData(struct mission *mission); +void ClearMissionData(struct mission* mission); enum fixed_room_id GetMissionSpecificFixedRoom(enum mission_type type, union mission_subtype subtype); -int8_t SelectRandomFixedRoomInRange(struct fixed_room_id_8 *fixed_rooms, - int max); +int8_t SelectRandomFixedRoomInRange(struct fixed_room_id_8* fixed_rooms, int max); void ReadRescueBinFile(void); -void GenerateMissionDetailsStruct(struct mission *mission, - struct mission_details *details, +void GenerateMissionDetailsStruct(struct mission* mission, struct mission_details* details, undefined param_3, undefined param_4); -bool ValidateNormalChallengeMission(struct mission_template *valid_mission_info, - struct mission *mission); -bool ValidateLegendaryChallengeMission( - struct mission_template *valid_mission_info, struct mission *mission); -struct mission_template *MatchMissionTemplateToMission(undefined4 table_index, - struct mission *mission); -void AppendMissionTitle(char *main_buffer, char *temp_buffer, - struct preprocessor_args *args, - struct mission_details *details); -void FormatMissionHeader(char *buffer, struct mission_details *mission_details); -void FormatSpecialEpisodeMissionHeader(char *buffer); -void AppendMissionSummary(char *main_buffer, char *temp_buffer, int window_id, - int y_offset, struct preprocessor_args *args, - struct mission_details *details); -void MakeMissionDetails(struct mission_details *mission_details, char *buffer, - undefined param_3); -void MakeSpecialEpisodeMissionDetails(char *buffer, undefined param_2); -undefined PrintWonderMailSkyCode(undefined param_1, undefined param_2, - undefined param_3, undefined param_4); -void AppendMissionObjective(char *buffer, int buffer_size, undefined4 objective, +bool ValidateNormalChallengeMission(struct mission_template* valid_mission_info, + struct mission* mission); +bool ValidateLegendaryChallengeMission(struct mission_template* valid_mission_info, + struct mission* mission); +struct mission_template* MatchMissionTemplateToMission(undefined4 table_index, + struct mission* mission); +void AppendMissionTitle(char* main_buffer, char* temp_buffer, struct preprocessor_args* args, + struct mission_details* details); +void FormatMissionHeader(char* buffer, struct mission_details* mission_details); +void FormatSpecialEpisodeMissionHeader(char* buffer); +void AppendMissionSummary(char* main_buffer, char* temp_buffer, int window_id, int y_offset, + struct preprocessor_args* args, struct mission_details* details); +void MakeMissionDetails(struct mission_details* mission_details, char* buffer, undefined param_3); +void MakeSpecialEpisodeMissionDetails(char* buffer, undefined param_2); +undefined PrintWonderMailSkyCode(undefined param_1, undefined param_2, undefined param_3, + undefined param_4); +void AppendMissionObjective(char* buffer, int buffer_size, undefined4 objective, enum monster_id monster, struct item_id_16 item); -void AppendMissionDungeonLocation(struct mission_details *mission_details, - char *buffer, int buffer_size); +void AppendMissionDungeonLocation(struct mission_details* mission_details, char* buffer, + int buffer_size); uint32_t RandomizeMissionCategory(uint32_t mission_wght_sum, undefined param_2, - struct mission_weighted_category *category); + struct mission_weighted_category* category); bool SumValidMissionCategoryWeights(enum mission_vendor vendor); -struct mission_template *GetRandomMissionTemplate(void); -struct mission_template *LoadMissionTemplates(void); +struct mission_template* GetRandomMissionTemplate(void); +struct mission_template* LoadMissionTemplates(void); bool IsMonsterMissionAllowed(enum monster_id monster_id); bool CanMonsterBeUsedForMissionWrapper(enum monster_id monster_id); -bool CanMonsterBeUsedForMission(enum monster_id monster_id, - bool check_story_banned); +bool CanMonsterBeUsedForMission(enum monster_id monster_id, bool check_story_banned); bool IsMonsterMissionAllowedStory(enum monster_id monster_id); bool IsMonsterIllegalForMissions(enum monster_id monster_id); bool CanDungeonBeUsedForMission(enum dungeon_id dungeon_id); +enum mission_rank GetMissionRankWithCapAndModifiers(struct dungeon_floor_pair* dungeon_floor_pair, + enum mission_type type); enum mission_rank -GetMissionRankWithCapAndModifiers(struct dungeon_floor_pair *dungeon_floor_pair, - enum mission_type type); -enum mission_rank GetMissionRankWithCapAndModifiersAndCap( - struct dungeon_floor_pair *dungeon_floor_pair, enum mission_type type); +GetMissionRankWithCapAndModifiersAndCap(struct dungeon_floor_pair* dungeon_floor_pair, + enum mission_type type); bool CanSendItem(enum item_id item_id, bool to_sky); -void InitMissionReward(struct mission *mission, - struct mission_reward_data *reward_data, +void InitMissionReward(struct mission* mission, struct mission_reward_data* reward_data, undefined4 param_3, undefined4 param_4); -void RollRandomItemReward(undefined4 param_1, undefined4 param_2, - struct item_id_16 *item_id); -void GenerateMissionRewards(struct mission *mission, bool is_cafe_mission); +void RollRandomItemReward(undefined4 param_1, undefined4 param_2, struct item_id_16* item_id); +void GenerateMissionRewards(struct mission* mission, bool is_cafe_mission); int CheckDungeonMissionUnlockConditions(enum dungeon_id dungeon); bool IsAvailableItem(enum item_id item_id); -int GetAvailableItemDeliveryList(undefined *item_buffer); -void WriteMissionMtState(int32_t *state_ptr); +int GetAvailableItemDeliveryList(undefined* item_buffer); +void WriteMissionMtState(int32_t* state_ptr); int16_t ReadMissionMtStateLower(void); -void ZeroInitMissionRewardDataStruct(struct mission_reward_data *reward_data); +void ZeroInitMissionRewardDataStruct(struct mission_reward_data* reward_data); enum monster_id GetScriptEntityMonsterId(enum script_entity_id entity_id); int GetScriptEntityMatchingStorageId(enum script_entity_id entity_id); void SetActorTalkMainAndActorTalkSub(enum script_entity_id actor_id_main, @@ -1505,19 +1362,16 @@ void SetActorTalkMainAndActorTalkSub(enum script_entity_id actor_id_main, void SetActorTalkMain(enum script_entity_id actor_id); void SetActorTalkSub(enum script_entity_id actor_id); void SetActorEventMain(enum script_entity_id actor_id); -void SetRandomRequestNpcs1And2(enum script_entity_id actor_id_1, - enum script_entity_id actor_id_2); +void SetRandomRequestNpcs1And2(enum script_entity_id actor_id_1, enum script_entity_id actor_id_2); void SetRandomRequestNpc03KindVar(enum monster_id id); -void SetAllEventNpcs(enum script_entity_id actor_id_1, - enum script_entity_id actor_id_2, - enum script_entity_id actor_id_3, - enum script_entity_id actor_id_4); +void SetAllEventNpcs(enum script_entity_id actor_id_1, enum script_entity_id actor_id_2, + enum script_entity_id actor_id_3, enum script_entity_id actor_id_4); void SetNewFriendActor(enum script_entity_id actor_id); void RandomizeDemoActors(void); -void ItemAtTableIdx(int idx, struct bulk_item *item); +void ItemAtTableIdx(int idx, struct bulk_item* item); void MainLoop(void); -char *ChooseMissionTitle(char *main_buffer, int param_2, uint32_t *param_3); -void CreateJobSummary(struct mission *mission, int param_2); +char* ChooseMissionTitle(char* main_buffer, int param_2, uint32_t* param_3); +void CreateJobSummary(struct mission* mission, int param_2); int DungeonSwapIdToIdx(enum dungeon_id dungeon_id); enum dungeon_id DungeonSwapIdxToId(int idx); enum dungeon_mode GetDungeonModeSpecial(enum dungeon_id dungeon_id); From 228f95db6938502c7b491eec46f9ac92ed083e40 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Thu, 18 Jun 2026 22:48:53 -0400 Subject: [PATCH 094/117] External formatter did NOT work as intended... --- headers/functions/arm9.h | 4 ++-- headers/functions/overlay29.h | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index b2b3a7af..a523ba3e 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -1149,8 +1149,8 @@ void GuestMonsterToGroundMonster(struct ground_monster* ground_monster, struct guest_monster* guest_monster); void SetBaseStatsMovesGroundMonster(struct ground_monster* ground_monster); bool StrcmpMonsterName(char* string, enum monster_id monster_id); -void InitializeTeamMemberFromMentry(struct team_member* team_member, struct ground_monster* ground_monster, - int32_t slot_index); +void InitializeTeamMemberFromMentry(struct team_member* team_member, + struct ground_monster* ground_monster, int32_t slot_index); void GetLvlUpEntry(struct level_up_entry* level_up_entry, enum monster_id monster_id, int level); uint8_t* GetEncodedHalfword(uint8_t* data_ptr, uint16_t* result); int GetEvoFamily(undefined* monster, undefined* evo_family); diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index 2916f7a3..df7bba4a 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -176,8 +176,9 @@ bool RunLeaderTurn(undefined param_1); void TrySpawnMonsterAndActivatePlusMinus(void); bool IsFloorOver(void); void DecrementWindCounter(void); -void CreateMonsterSummaryFromEntityOuter(union damage_source_16 damage_source, struct entity* entity, - struct monster* monster, int param_4); +void CreateMonsterSummaryFromEntityOuter(union damage_source_16 damage_source, + struct entity* entity, struct monster* monster, + int param_4); bool IsDungeonEndReasonFailure(void); void SetForcedLossReason(enum forced_loss_reason forced_loss_reason); enum forced_loss_reason GetForcedLossReason(void); From fc7c82ebee620789908bf4f730a775e422524bed Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 19 Jun 2026 01:29:29 -0400 Subject: [PATCH 095/117] Update rescue.h --- headers/types/files/rescue.h | 1 + 1 file changed, 1 insertion(+) diff --git a/headers/types/files/rescue.h b/headers/types/files/rescue.h index a2620680..0ab602b7 100644 --- a/headers/types/files/rescue.h +++ b/headers/types/files/rescue.h @@ -138,3 +138,4 @@ struct rescue_bin_unpack { int category_weight_sum; // Sum of all weighted categories undefined* file_pointer; // Points to the raw rescue.bin file loaded in memory. }; +ASSERT_SIZE(struct rescue_bin_unpack, 40); From 15e168c24dda1ad6ec0c0c90ea690fd170ef95f4 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 19 Jun 2026 01:29:40 -0400 Subject: [PATCH 096/117] Update arm9.yml --- symbols/arm9.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index f55dc205..47d822ec 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -13180,6 +13180,8 @@ arm9: - name: MT_MULT address: EU: 0x2051464 + length: + EU: 0x4 description: |- The standard mult for Mersenne Twister initialization, 0x6C078965. @@ -15985,6 +15987,8 @@ arm9: - name: MT_TABLE_INDEX address: EU: 0x20B0898 + length: + EU: 0x4 description: |- The current index of the Mersenne Twister Table. @@ -15992,6 +15996,8 @@ arm9: - name: TWIST_LOW_BIT_MULTS address: EU: 0x20B0898 + length: + EU: 0x8 description: |- The mults for the "twist" of a Mersenne Twister, 0x0 and 0x9908B0DF. @@ -15999,6 +16005,8 @@ arm9: - name: MT_TABLE address: EU: 0x20B0898 + length: + EU: 0x9C0 description: |- A full Mersenne Twister table. Only known to be used by mission generation. @@ -16143,6 +16151,8 @@ arm9: - name: RESCUE_BIN_UNPACK address: EU: 0x20B141C + length: + EU: 0x28 description: |- The unpacked contents of the RESCUE/rescue.bin file. Also contains a mersenne twister state, for some reason. From 9fc4a6fcbcf3ed7836aab3023951d53d18718b8f Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 19 Jun 2026 23:36:57 -0400 Subject: [PATCH 097/117] Overlays 22 and 23 --- headers/data/arm9.h | 6 + headers/data/overlay22.h | 52 +++ headers/data/overlay23.h | 4 + headers/functions/arm9.h | 20 + headers/functions/overlay22.h | 45 +++ headers/functions/overlay23.h | 16 + symbols/arm9.yml | 227 +++++++++++ symbols/overlay22.yml | 713 ++++++++++++++++++++++++++++++++-- symbols/overlay23.yml | 120 +++++- 9 files changed, 1167 insertions(+), 36 deletions(-) create mode 100644 headers/functions/overlay22.h create mode 100644 headers/functions/overlay23.h diff --git a/headers/data/arm9.h b/headers/data/arm9.h index 6324322d..b545e4a5 100644 --- a/headers/data/arm9.h +++ b/headers/data/arm9.h @@ -246,6 +246,12 @@ extern int16_t TBL_TALK_GROUP_STRING_ID_START[6]; extern struct menu_control* MENU_CONTROL_PTR; extern int16_t KEYBOARD_STRING_IDS[30]; extern struct mission_reward_struct_main* MISSION_REWARD_STRUCT_MAIN_PTR; +extern struct unk_storage_struct_0xc UNK_STORAGE_STRUCT_0xC; +extern struct unk_storage_struct_0x14 UNK_STORAGE_STRUCT_0x14; +extern struct unk_storage_struct_0x8* UNK_STORAGE_STRUCT_0x8_PTR_1; +extern struct unk_storage_window_struct_0xc* UNK_STORAGE_WINDOW_STRUCT_0xC_PTR; +extern struct unk_storage_struct_0x8* UNK_STORAGE_STRUCT_0x8_PTR_2; +extern struct unk_storage_struct_0x410* UNK_STORAGE_STRUCT_0x410_PTR; extern bool NOTIFY_NOTE; extern struct monster_id_16 DEFAULT_HERO_ID; extern struct monster_id_16 DEFAULT_PARTNER_ID; diff --git a/headers/data/overlay22.h b/headers/data/overlay22.h index cd5676ce..d472136a 100644 --- a/headers/data/overlay22.h +++ b/headers/data/overlay22.h @@ -2,11 +2,17 @@ #define HEADERS_DATA_OVERLAY22_H_ extern struct window_params SHOP_WINDOW_PARAMS_1; +extern char GREEN_KEC_SHOP_RED_COLOR_TEXT_TAG[7]; +extern char GREEN_KEC_SHOP_UNCOLOR_TEXT_TAG[5]; extern struct window_params SHOP_WINDOW_PARAMS_2; +extern char PURPLE_KEC_SHOP_RED_COLOR_TEXT_TAG[7]; +extern char PURPLE_KEC_SHOP_UNCOLOR_TEXT_TAG[5]; +extern bool KECLEON_SHOP_ITEM_CATEGORY_BOOLS[12]; extern struct simple_menu_id_item SHOP_MENU_ITEMS_CONFIRM[3]; extern struct simple_menu_id_item SHOP_MAIN_MENU_ITEMS_1[4]; extern struct simple_menu_id_item SHOP_MAIN_MENU_ITEMS_2[4]; extern struct simple_menu_id_item SHOP_MAIN_MENU_ITEMS_3[6]; +extern int16_t KECLEON_SHOP_TEXT_STRINGS[2][24]; extern struct window_params SHOP_WINDOW_PARAMS_3; extern struct window_params SHOP_WINDOW_PARAMS_4; extern struct window_params SHOP_WINDOW_PARAMS_5; @@ -15,6 +21,52 @@ extern struct window_params SHOP_WINDOW_PARAMS_7; extern struct window_params SHOP_WINDOW_PARAMS_8; extern struct window_params SHOP_WINDOW_PARAMS_9; extern struct window_params SHOP_WINDOW_PARAMS_10; +extern char KEC_SHOP_START_STR[8]; +extern char KEC_SHOP_RESTART_STR[10]; +extern char KEC_SHOP_SELECTMENU_STR[13]; +extern char KEC_SHOP_EXPLANATION_STR[14]; +extern char KEC_SHOP_THANKS_STR[9]; +extern char KEC_SHOP_SHOP_NON_STR[11]; +extern char KEC_SHOP_GOLD_NON_STR[11]; +extern char KEC_SHOP_GOLD_MAX_STR[11]; +extern char KEC_SHOP_GOLD_FULL_STR[12]; +extern char KEC_SHOP_SELL_NON_STR[11]; +extern char KEC_SHOP_ITEM_NON_STR[11]; +extern char KEC_SHOP_ITEM_MAX_STR[11]; +extern char KEC_SHOP_SOLD_OUT_STR[11]; +extern char KEC_SHOP_BUY_POOR_STR[11]; +extern char KEC_SHOP_SELL_BAD_STR[11]; +extern char KEC_SHOP_SELL_FULL_STR[12]; +extern char KEC_SHOP_MODE_BUY_START_STR[17]; +extern char KEC_SHOP_BUY_RESTART_STR[14]; +extern char KEC_SHOP_BUY_SELECT_STR[13]; +extern char KEC_SHOP_BUY_RESELECT_STR[15]; +extern char KEC_SHOP_SUB_MENU_BUY_STR[15]; +extern char KEC_SHOP_BUY_CONFIRM_STR[14]; +extern char KEC_SHOP_BUY_EXPLA_ITEM_STR[27]; +extern char KEC_SHOP_ITEM_TEXT_TAG[9]; +extern char KEC_SHOP_BUY_THANKS_STR[13]; +extern char KEC_SHOP_SELL_START_STR[13]; +extern char KEC_SHOP_SELL_RESTART_STR[15]; +extern char KEC_SHOP_SELL_SELECT_STR[14]; +extern char KEC_SHOP_SELL_RESELECT_STR[16]; +extern char KEC_SHOP_SELL_SUB_MENU_STR[16]; +extern char KEC_SHOP_SELL_CONFIRM_STR[15]; +extern char KEC_SHOP_SELL_CONFIRM_NEW_STR[19]; +extern char KEC_SHOP_BUY_CONFIRM_NEW_STR[18]; +extern char KEC_SHOP_SELL_EXPLA_STR[13]; +extern char KEC_SHOP_SELL_THANKS_STR[14]; +extern char KEC_SHOP_SELL_ALL_STR[11]; +extern char KEC_SHOP_BUT_MULTI_STR[12]; +extern char KEC_SHOP_SELL_MULTI_STR[13]; +extern char KEC_SHOP_ALL_CONFIRM_STR[14]; +extern char KEC_SHOP_SELL_ALL_THANKS_STR[17]; +extern char KEC_SHOP_BUY_MULTI_THANKS_STR[18]; +extern char KEC_SHOP_SELL_MULTI_THANKS_STR[19]; +extern char KEC_SHOP_CHANGEJOB_STR[11]; extern undefined4 OV22_STATIC_INITIALIZER; +extern struct unk_green_kec_struct_0x8 UNK_GREEN_KEC_STRUCT_0x8; +extern struct unk_purple_kec_struct_0x8 UNK_PURPLE_KEC_STRUCT_0x8; +extern struct kecleon_shop_shared_struct* KECLEON_SHOP_SHARED_STRUCT_PTR; #endif diff --git a/headers/data/overlay23.h b/headers/data/overlay23.h index a71df23c..4f93a6f0 100644 --- a/headers/data/overlay23.h +++ b/headers/data/overlay23.h @@ -1,6 +1,9 @@ #ifndef HEADERS_DATA_OVERLAY23_H_ #define HEADERS_DATA_OVERLAY23_H_ +extern int8_t STORAGE_OPTION_STATES_1[4]; +extern int8_t STORAGE_OPTION_STATES_2[4]; +extern bool STORAGE_ITEM_CATEGORY_BOOLS[12]; extern struct simple_menu_id_item STORAGE_MENU_ITEMS_CONFIRM[3]; extern struct simple_menu_id_item STORAGE_MAIN_MENU_ITEMS_1[4]; extern struct simple_menu_id_item STORAGE_MAIN_MENU_ITEMS_2[4]; @@ -15,5 +18,6 @@ extern struct window_params STORAGE_WINDOW_PARAMS_6; extern struct window_params STORAGE_WINDOW_PARAMS_7; extern struct window_params STORAGE_WINDOW_PARAMS_8; extern undefined4 OV23_STATIC_INITIALIZER; +extern struct kangaskhan_storage_menu* KANGASKHAN_STORAGE_MENU_PTR; #endif diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 45162ad5..bd8c8614 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -266,6 +266,7 @@ int CountItemTypeInStorage(struct bulk_item* bulk_item); int GetEquivBulkItemIdxInStorage(struct bulk_item* bulk_item); bool ConvertStorageItemAtIdxToBulkItem(int idx, struct bulk_item* bulk_item); bool ConvertStorageItemAtIdxToItem(int idx, struct item* item); +void MaybeUpdateStorage(void); bool RemoveItemAtIdxInStorage(int idx); bool RemoveBulkItemInStorage(struct bulk_item* bulk_item); bool RemoveItemInStorage(struct item* item); @@ -757,6 +758,7 @@ int CreateTextBoxWithArg(struct window_params* params, text_box_callback_with_ar void* cb_arg); void CloseTextBox(int window_id); void CloseTextBox2(int window_id); +bool IsTextboxState3(int window_id); struct text_box* CreateTextBoxInternal(struct window_params* params); void UpdateTextBox(struct window* window); bool IsTextBoxActive(int window_id); @@ -856,6 +858,24 @@ void PrintMoveOptionMenu(void); void PrintIqSkillsMenu(enum monster_id monster_id, uint32_t* iq_skills_flags, int monster_iq, bool is_blinded); char* GetCheckIqMenuSkillString(char* buf, int iq_entry_idx); +int InitUnkStorageStruct0xA0(int32_t param_1,undefined4 param_2,int param_3,int param_4); +void FreeUnkStorageStruct0xA0(void); +void ClearBagSelectedItemTable(void); +bool IsBagItemIndexSelected(int index); +void AllocUnkBagStruct(void); +void FreeUnkBagStruct(void); +int InitUnkStorageStruct0x18c0(int param_1,undefined4 param_2,int param_3); +bool MaybeTrySelectStorageItem(struct buttons inputs); +void FreeUnkStorageStruct0x18c0(void); +void ClearStorageSelectedItemTable(void); +int CountSelectedStorageItems(void); +int GetFirstSelectedStorageItemIndex(void); +bool IsStorageItemIndexSelected(int index); +void AllocStorageSelectedItemTable(void); +void FreeStorageSelectedItemTable(void); +undefined4 InitUnkStorageStruct0x410(undefined2 *param_1,int param_2); +void UnkStorageStruct0x410CloseSimpleMenu(void); +void UnkStorageStruct0x410CreateDialogueBox(void); void PlayMissionClearBgm(void); bool GetNotifyNote(void); void SetNotifyNote(bool flag); diff --git a/headers/functions/overlay22.h b/headers/functions/overlay22.h new file mode 100644 index 00000000..79c4ed43 --- /dev/null +++ b/headers/functions/overlay22.h @@ -0,0 +1,45 @@ +#ifndef HEADERS_FUNCTIONS_OVERLAY22_H_ +#define HEADERS_FUNCTIONS_OVERLAY22_H_ + +void GreenKecleonShopUpdateItemNamesAndCollectionMenu(void); +int GreenKecleonShopInitCollectionMenu(void); +void GreenKecleonShopDoNothing(void); +undefined4 GreenKecleonShopGetCollectionMenuStatus(void); +uint16_t GreenKecleonShopGetSelectedItemSlot(void); +void GreenKecleonShopInitItemNameData(void); +void GreenKecleonShopFreeItemNameData(void); +void GreenKecleonShopFillItemNameData(void); +int GreenKecleonShopCountSelectedItems(void); +int GreenKecleonShopGetFirstSelectedItemIndex(void); +int GreenKecleonShopSumSelectedItemPrices(void); +void GreenKecleonShopPurchaseSingleItem(uint32_t param_1); +void GreenKecleonShopPurchaseSelectedItems(void); +char* GreenKecleonGetItemNameStringByIndex(undefined4 param_1,int param_2,uint32_t *param_3); +undefined4 GreenKecleonShopUnkCollectionMenuCallback(uint32_t param_1); +void GreenKecleonShopVoidFnCollectionMenuCallback(uint32_t param_1); +void PurpleKecleonShopUpdateItemNamesAndCollectionMenu(void); +int PurpleKecleonShopInitCollectionMenu(void); +void PurpleKecleonShopDoNothing(void); +undefined4 PurpleKecleonShopGetCollectionMenuStatus(void); +void PurpleKecleonShopInitItemNameData(void); +void PurpleKecleonShopFreeItemNameData(void); +void PurpleKecleonShopFillItemNameData(void); +int PurpleKecleonShopCountSelectedItems(void); +int PurpleKecleonShopGetFirstSelectedItemIndex(void); +int PurpleKecleonShopSumSelectedItemPrices(void); +void PurpleKecleonShopPurchaseSingleItem(uint32_t param_1); +void PurpleKecleonShopPurchaseSelectedItems(void); +char* PurpleKecleonGetItemNameStringByIndex(undefined4 param_1,int param_2,uint32_t *param_3); +undefined4 PurpleKecleonShopUnkCollectionMenuCallback(uint32_t param_1); +void PurpleKecleonShopCollectionMenuCallback(uint32_t param_1); +void KecleonShopSubcaseManager1(undefined4 param_1); +void KecleonShopSubcaseManager2(void); +void RemoveInvalidKecleonShopItems(void); +void KecleonShopSumBagItemSellPrices(void); +void KecleonShopUpdatePortraitEmotion(bool is_angry); +undefined4 KecleonShopEntryPoint(void); +void KecleonShopDestructor(void); +undefined4 KecleonShopFrameUpdate(void); +void KecleonShopCloseSimpleMenu(void); + +#endif diff --git a/headers/functions/overlay23.h b/headers/functions/overlay23.h new file mode 100644 index 00000000..42a90f53 --- /dev/null +++ b/headers/functions/overlay23.h @@ -0,0 +1,16 @@ +#ifndef HEADERS_FUNCTIONS_OVERLAY23_H_ +#define HEADERS_FUNCTIONS_OVERLAY23_H_ + +void KangaskhanStorageSubcaseManager1(int32_t subcase_id); +void KangaskhanStorageSubcaseManager2(void); +undefined4 KangaskhanStorageEntryPoint(void); +void KangaskhanStorageDestructor(void); +undefined4 KangaskhanStorageFrameUpdate(void); +void KangaskhanStorageCloseSimpleMenu(void); +void KangaskhanStorageShowDialogueAndPortraitIfNotRock(int window_id,struct preprocessor_flags flags,int string_id); +void KangaskhanStorageWithdrawSelectedItems(void); +void KangaskhanStorageDepositSelectedItems(void); +void KangaskhanStorageWithdrawSingleItem(void); +void KangaskhanStorageDepositSingleItem(void); + +#endif diff --git a/symbols/arm9.yml b/symbols/arm9.yml index dc9262c9..5eee9a1a 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -2784,6 +2784,15 @@ arm9: r0: item index r1: [output] pointer to an item return: bool whether or not the item id is not 0 + - name: MaybeUpdateStorage + address: + EU: 0x2010124 + description: |- + Just a guess. + Seems like it might handle updating storage, syncing the item count data to the temporary item slots after interacting with storage. + Used as a sort parallel to RemoveEmptyItemsInBag. + + No params. - name: RemoveItemAtIdxInStorage address: EU: 0x2010248 @@ -7143,6 +7152,14 @@ arm9: Seems to do some things with the text box, before doing the same things that CloseTextBox does. r0: window_id + - name: IsTextboxState3 + address: + EU: 0x202FCAC + description: |- + Checks if a text_box is in state 3. + + r0: window_id + return: bool - name: CreateTextBoxInternal address: EU: 0x202FCD0 @@ -7989,6 +8006,162 @@ arm9: r0: [output] buffer r1: id in team member's IQ skill list return: input buffer + - name: InitUnkStorageStruct0xA0 + address: + EU: 0x2042554 + description: |- + Initializes an unknown struct of size 0xA0, to a pointer in UNK_STORAGE_STRUCT_0xC. + Appears to be used for kangaskhan storage. + + r0: int32_t + r1: undefined4 + r2: int + r3: int + return: int + - name: FreeUnkStorageStruct0xA0 + address: + EU: 0x2042980 + description: |- + Frees an unknown struct of size 0xA0, to a pointer in UNK_STORAGE_STRUCT_0xC. + Appears to be used for kangaskhan storage. + + No params. + - name: ClearBagSelectedItemTable + address: + EU: 0x2042E14 + description: |- + Seems to clear the list of selected bag item bools. + Known to be used by Kangaskhan Storage. + + No params. + - name: IsBagItemIndexSelected + address: + EU: 0x2042EA0 + description: |- + Seems to check if a specified index in the bag is selected. + Known to be used by Kangaskhan Storage. + + r0: index + return: bool + - name: AllocUnkBagStruct + address: + EU: 0x2042EB4 + description: |- + Allocates a currently unknown struct UNK_STORAGE_STRUCT_0xC, that seems to manage the bag while interacting with storage. + Known to be used by Kangaskhan Storage. + + No params. + - name: FreeUnkBagStruct + address: + EU: 0x2042ED8 + description: |- + Frees a currently unknown struct UNK_STORAGE_STRUCT_0xC, that seems to manage the bag while interacting with storage. + Known to be used by Kangaskhan Storage. + + No params. + - name: InitUnkStorageStruct0x18c0 + address: + EU: 0x204300C + description: |- + Allocates a currently unknown struct of size 0x18c0, and stores it to a pointer at UNK_STORAGE_STRUCT_0x14. + Known to be used by Kangaskhan Storage. + + r0: int + r1: undefined4 + r2: int + return: int + - name: MaybeTrySelectStorageItem + address: + EU: 0x20432D4 + description: |- + Seems to be responsible for selecting an item from storage, for multi-select. + Known to be used by Kangaskhan Storage. + + r0: buttons struct? Seems to be checking for the R button... + return: bool + - name: FreeUnkStorageStruct0x18c0 + address: + EU: 0x2043498 + description: |- + Frees a currently unknown struct of size 0x18c0 from a pointer at UNK_STORAGE_STRUCT_0x14. + Known to be used by Kangaskhan Storage. + + No params. + - name: ClearStorageSelectedItemTable + address: + EU: 0x20437F0 + description: |- + Seems to clear the selected item bool table for storage. + Known to be used by Kangaskhan Storage. + + No params. + - name: CountSelectedStorageItems + address: + EU: 0x2043818 + description: |- + Seems to count the number of currently selected items in storage. + Known to be used by Kangaskhan Storage. + + return: number of selected items + - name: GetFirstSelectedStorageItemIndex + address: + EU: 0x2043848 + description: |- + Seems to retrieve the index of the first currently selected item in storage. + Known to be used by Kangaskhan Storage. + + return: index of first selected item + - name: IsStorageItemIndexSelected + address: + EU: 0x2043884 + description: |- + Seems to check if a specified storage item index is selected. + Known to be used by Kangaskhan Storage. + + r0: index + return: bool + - name: AllocStorageSelectedItemTable + address: + EU: 0x20443B0 + description: |- + Seems to allocate a table of bools for selected storage items to a pointer in UNK_STORAGE_STRUCT_0x14. + Known to be used by Kangaskhan Storage. + + No params. + - name: FreeStorageSelectedItemTable + address: + EU: 0x20443D4 + description: |- + Seems to free a table of bools for selected storage items from a pointer in UNK_STORAGE_STRUCT_0x14. + Known to be used by Kangaskhan Storage. + + No params. + - name: InitUnkStorageStruct0x410 + address: + EU: 0x2045714 + description: |- + Allocates a currently unknown struct of size 0x410 at UNK_STORAGE_STRUCT_0x410_PTR. May be a state case structure of some kind. + Likely used by Kangaskhan Storage, or some other storage interaction menu. + + r0: undefined2 + r1: int + return: undefined4 + - name: UnkStorageStruct0x410CloseSimpleMenu + address: + EU: 0x20468F8 + description: |- + Seems to close a simple menu for a currently unknown struct of size 0x410 at UNK_STORAGE_STRUCT_0x410_PTR. May be a state case structure of some kind. + Likely used by Kangaskhan Storage, or some other storage interaction menu. + + No params. + - name: UnkStorageStruct0x410CreateDialogueBox + address: + EU: 0x2046940 + description: |- + Seems to create a dialogue box for a currently unknown struct of size 0x410 at UNK_STORAGE_STRUCT_0x410_PTR. May be a state case structure of some kind. + Likely used by Kangaskhan Storage, or some other storage interaction menu. + + No params. - name: PlayMissionClearBgm address: EU: 0x2046A5C @@ -15906,6 +16079,60 @@ arm9: Is also used sparingly during the Spinda Cafe egg event. type: mission_reward_struct_main pointer + - name: UNK_STORAGE_STRUCT_0xC + address: + EU: 0x20B07C4 + length: + EU: 0xC + description: |- + A currently unknown struct of size 0xc, with ties to kangaskhan storage. + + type: struct unk_storage_struct_0xc + - name: UNK_STORAGE_STRUCT_0x14 + address: + EU: 0x20B07D0 + length: + EU: 0x14 + description: |- + A currently unknown struct of size 0x14, with ties to kangaskhan storage. + + type: struct unk_storage_struct_0x14 + - name: UNK_STORAGE_STRUCT_0x8_PTR_1 + address: + EU: 0x20B07E4 + length: + EU: 0x4 + description: |- + A pointer to a currently unknown struct of size 0x8, with ties to kangaskhan storage. + + type: struct unk_storage_struct_0x8* + - name: UNK_STORAGE_WINDOW_STRUCT_0xC_PTR + address: + EU: 0x20B07E8 + length: + EU: 0x4 + description: |- + A pointer to a currently unknown struct of size 0xc, with ties to kangaskhan storage. + + type: struct unk_storage_window_struct_0xc* + - name: UNK_STORAGE_STRUCT_0x8_PTR_2 + address: + EU: 0x20B07EC + length: + EU: 0x4 + description: |- + A pointer to a currently unknown struct of size 0x8, with ties to kangaskhan storage. + + type: struct unk_storage_struct_0x8* + - name: UNK_STORAGE_STRUCT_0x410_PTR + address: + EU: 0x20B07F0 + length: + EU: 0x4 + description: |- + A pointer to a currently unknown struct of size 0x410, with ties to kangaskhan storage. + + type: struct unk_storage_struct_0x410* - name: NOTIFY_NOTE address: EU: 0x20B0814 diff --git a/symbols/overlay22.yml b/symbols/overlay22.yml index 3bd44b79..acf07a70 100644 --- a/symbols/overlay22.yml +++ b/symbols/overlay22.yml @@ -12,7 +12,312 @@ overlay22: NA: 0x4B40 JP: 0x4B40 description: Controls the Kecleon Shop in Treasure Town. - functions: [] + functions: + - name: GreenKecleonShopUpdateItemNamesAndCollectionMenu + address: + EU: 0x238AC80 + description: |- + [MANUAL DESCRIPTION] + + No params. + - name: GreenKecleonShopInitCollectionMenu + address: + EU: 0x238AC90 + description: |- + [MANUAL DESCRIPTION] + + return: int + - name: GreenKecleonShopDoNothing + address: + EU: 0x238AD6C + description: |- + [MANUAL DESCRIPTION] + + No params. + - name: GreenKecleonShopGetCollectionMenuStatus + address: + EU: 0x238AD70 + description: |- + [MANUAL DESCRIPTION] + + return: undefined4 + - name: GreenKecleonShopGetSelectedItemSlot + address: + EU: 0x238ADEC + description: |- + [MANUAL DESCRIPTION] + + return: ushort + - name: GreenKecleonShopInitItemNameData + address: + EU: 0x238AE00 + description: |- + [MANUAL DESCRIPTION] + + No params. + - name: GreenKecleonShopFreeItemNameData + address: + EU: 0x238AE34 + description: |- + [MANUAL DESCRIPTION] + + No params. + - name: GreenKecleonShopFillItemNameData + address: + EU: 0x238AE60 + description: |- + [MANUAL DESCRIPTION] + + No params. + - name: GreenKecleonShopCountSelectedItems + address: + EU: 0x238B00C + description: |- + [MANUAL DESCRIPTION] + + return: int + - name: GreenKecleonShopGetFirstSelectedItemIndex + address: + EU: 0x238B048 + description: |- + [MANUAL DESCRIPTION] + + return: int + - name: GreenKecleonShopSumSelectedItemPrices + address: + EU: 0x238B084 + description: |- + [MANUAL DESCRIPTION] + + return: int + - name: GreenKecleonShopPurchaseSingleItem + address: + EU: 0x238B0C8 + description: |- + [MANUAL DESCRIPTION] + + + r0: uint + - name: GreenKecleonShopPurchaseSelectedItems + address: + EU: 0x238B10C + description: |- + [MANUAL DESCRIPTION] + + No params. + - name: GreenKecleonGetItemNameStringByIndex + address: + EU: 0x238B180 + description: |- + [MANUAL DESCRIPTION] + + + r0: *) + r1: int + r2: uint + return: char + - name: GreenKecleonShopUnkCollectionMenuCallback + address: + EU: 0x238B1BC + description: |- + [MANUAL DESCRIPTION] + + + r0: uint + return: undefined4 + - name: GreenKecleonShopVoidFnCollectionMenuCallback + address: + EU: 0x238B2B4 + description: |- + [MANUAL DESCRIPTION] + + + r0: uint + - name: PurpleKecleonShopUpdateItemNamesAndCollectionMenu + address: + EU: 0x238B2CC + description: |- + [MANUAL DESCRIPTION] + + No params. + - name: PurpleKecleonShopInitCollectionMenu + address: + EU: 0x238B2DC + description: |- + [MANUAL DESCRIPTION] + + return: int + - name: PurpleKecleonShopDoNothing + address: + EU: 0x238B3B8 + description: |- + [MANUAL DESCRIPTION] + + No params. + - name: PurpleKecleonShopGetCollectionMenuStatus + address: + EU: 0x238B3BC + description: |- + [MANUAL DESCRIPTION] + + return: undefined4 + - name: PurpleKecleonShopGetSelectedItemSlot? + address: + EU: 0x238B438 + description: |- + [MANUAL DESCRIPTION] + + return: ushort + - name: PurpleKecleonShopInitItemNameData + address: + EU: 0x238B44C + description: |- + [MANUAL DESCRIPTION] + + No params. + - name: PurpleKecleonShopFreeItemNameData + address: + EU: 0x238B480 + description: |- + [MANUAL DESCRIPTION] + + No params. + - name: PurpleKecleonShopFillItemNameData + address: + EU: 0x238B4AC + description: |- + [MANUAL DESCRIPTION] + + No params. + - name: PurpleKecleonShopCountSelectedItems + address: + EU: 0x238B658 + description: |- + [MANUAL DESCRIPTION] + + return: int + - name: PurpleKecleonShopGetFirstSelectedItemIndex + address: + EU: 0x238B694 + description: |- + [MANUAL DESCRIPTION] + + return: int + - name: PurpleKecleonShopSumSelectedItemPrices + address: + EU: 0x238B6D0 + description: |- + [MANUAL DESCRIPTION] + + return: int + - name: PurpleKecleonShopPurchaseSingleItem + address: + EU: 0x238B714 + description: |- + [MANUAL DESCRIPTION] + + + r0: uint + - name: PurpleKecleonShopPurchaseSelectedItems + address: + EU: 0x238B758 + description: |- + [MANUAL DESCRIPTION] + + No params. + - name: PurpleKecleonGetItemNameStringByIndex + address: + EU: 0x238B7CC + description: |- + [MANUAL DESCRIPTION] + + + r0: *) + r1: int + r2: uint + return: char + - name: PurpleKecleonShopUnkCollectionMenuCallback + address: + EU: 0x238B808 + description: |- + [MANUAL DESCRIPTION] + + + r0: uint + return: undefined4 + - name: PurpleKecleonShopCollectionMenuCallback + address: + EU: 0x238B900 + description: |- + [MANUAL DESCRIPTION] + + + r0: uint + - name: KecleonShopSubcaseManager1 + address: + EU: 0x238B918 + description: |- + [MANUAL DESCRIPTION] + + + r0: undefined4 + - name: KecleonShopSubcaseManager2 + address: + EU: 0x238CCC4 + description: |- + [MANUAL DESCRIPTION] + + No params. + - name: RemoveInvalidKecleonShopItems + address: + EU: 0x238E068 + description: |- + [MANUAL DESCRIPTION] + + No params. + - name: KecleonShopSumBagItemSellPrices + address: + EU: 0x238E094 + description: |- + [MANUAL DESCRIPTION] + + No params. + - name: KecleonShopUpdatePortraitEmotion + address: + EU: 0x238E134 + description: |- + [MANUAL DESCRIPTION] + + + r0: bool + - name: KecleonShopEntryPoint + address: + EU: 0x238E180 + description: |- + [MANUAL DESCRIPTION] + + return: undefined4 + - name: KecleonShopDestructor + address: + EU: 0x238E2F0 + description: |- + [MANUAL DESCRIPTION] + + No params. + - name: KecleonShopFrameUpdate + address: + EU: 0x238E340 + description: |- + [MANUAL DESCRIPTION] + + return: undefined4 + - name: KecleonShopCloseSimpleMenu + address: + EU: 0x238F324 + description: |- + [MANUAL DESCRIPTION] + + No params. data: - name: SHOP_WINDOW_PARAMS_1 address: @@ -23,6 +328,26 @@ overlay22: EU: 0x10 NA: 0x10 description: "Note: unverified, ported from Irdkwia's notes" + - name: GREEN_KEC_SHOP_RED_COLOR_TEXT_TAG + address: + EU: 0x238F36C + length: + EU: 0x7 + description: |- + "[CS:W]" + Used exclusively before items in green kecleon's shop that the player cannot buy/sell. + + type: string + - name: GREEN_KEC_SHOP_UNCOLOR_TEXT_TAG + address: + EU: 0x238F374 + length: + EU: 0x5 + description: |- + "[CR]" + Used exclusively after items in green kecleon's shop that the player cannot buy/sell. + + type: string - name: SHOP_WINDOW_PARAMS_2 address: EU: 0x238F37C @@ -32,14 +357,37 @@ overlay22: EU: 0x10 NA: 0x10 description: "Note: unverified, ported from Irdkwia's notes" - - name: OVERLAY22_UNKNOWN_STRUCT__NA_238E85C + - name: PURPLE_KEC_SHOP_RED_COLOR_TEXT_TAG + address: + EU: 0x238F38C + length: + EU: 0x7 + description: |- + "[CS:W]" + Used exclusively before items in purple kecleon's shop that the player cannot buy/sell. + + type: string + - name: PURPLE_KEC_SHOP_UNCOLOR_TEXT_TAG + address: + EU: 0x238F394 + length: + EU: 0x5 + description: |- + "[CR]" + Used exclusively after items in purple kecleon's shop that the player cannot buy/sell. + + type: string + - name: KECLEON_SHOP_ITEM_CATEGORY_BOOLS address: EU: 0x238F39C NA: 0x238E85C JP: 0x238FDBC length: NA: 0xC - description: "Note: unverified, ported from Irdkwia's notes" + EU: 0xC + description: |- + Exclusively passed into MaybeGetUncoloredFormattedItemName and MaybeGetColoredFormattedItemName. + The exact purpose of this struct is unknown, but the only "true" bool in the table is for "Other" items. - name: SHOP_MENU_ITEMS_CONFIRM address: EU: 0x238F3A8 @@ -76,31 +424,40 @@ overlay22: EU: 0x30 NA: 0x30 JP: 0x30 - - name: OVERLAY22_UNKNOWN_STRING_IDS + - name: KECLEON_SHOP_TEXT_STRINGS address: EU: 0x238F430 NA: 0x238E8F0 JP: 0x238FE50 length: NA: 0x60 - description: "Note: unverified, ported from Irdkwia's notes" + description: |- + A collection of 48 text string ids, 24 for green kecleon, and 24 for purple kecleon. + + type: int16_t[2][24] - name: SHOP_WINDOW_PARAMS_3 address: + EU: 0x238F490 NA: 0x238E950 length: + EU: 0x10 NA: 0x10 description: "Note: unverified, ported from Irdkwia's notes" - name: SHOP_WINDOW_PARAMS_4 address: + EU: 0x238F4A0 NA: 0x238E960 length: - NA: 0x10 + EU: 0x10 + NA: 0x10 description: "Note: unverified, ported from Irdkwia's notes" - name: SHOP_WINDOW_PARAMS_5 address: + EU: 0x238F4B0 NA: 0x238E970 length: - NA: 0x10 + EU: 0x10 + NA: 0x10 description: "Note: unverified, ported from Irdkwia's notes" - name: SHOP_WINDOW_PARAMS_6 address: @@ -147,6 +504,308 @@ overlay22: EU: 0x10 NA: 0x10 description: "Note: unverified, ported from Irdkwia's notes" + - name: KEC_SHOP_START_STR + address: + EU: 0x238F510 + description: |- + "_START\n" + + type: string + - name: KEC_SHOP_RESTART_STR + address: + EU: 0x238F518 + description: |- + "_RESTART\n" + + type: string + - name: KEC_SHOP_SELECTMENU_STR + address: + EU: 0x238F524 + description: |- + "_SELECTMENU\n" + + type: string + - name: KEC_SHOP_EXPLANATION_STR + address: + EU: 0x238F534 + description: |- + "_EXPLANATION\n" + + type: string + - name: KEC_SHOP_THANKS_STR + address: + EU: 0x238F544 + description: |- + "_THANKS\n" + + type: string + - name: KEC_SHOP_SHOP_NON_STR + address: + EU: 0x238F550 + description: |- + "_SHOP_NON\n" + + type: string + - name: KEC_SHOP_GOLD_NON_STR + address: + EU: 0x238F55C + description: |- + "_GOLD_NON\n" + + type: string + - name: KEC_SHOP_GOLD_MAX_STR + address: + EU: 0x238F568 + description: |- + "_GOLD_MAX\n" + + type: string + - name: KEC_SHOP_GOLD_FULL_STR + address: + EU: 0x238F574 + description: |- + "_GOLD_FULL\n" + + type: string + - name: KEC_SHOP_SELL_NON_STR + address: + EU: 0x238F580 + description: |- + "_SELL_NON\n" + + type: string + - name: KEC_SHOP_ITEM_NON_STR + address: + EU: 0x238F58C + description: |- + "_ITEM_NON\n" + + type: string + - name: KEC_SHOP_ITEM_MAX_STR + address: + EU: 0x238F598 + description: |- + "_ITEM_MAX\n" + + type: string + - name: KEC_SHOP_SOLD_OUT_STR + address: + EU: 0x238F5A4 + description: |- + "_SOLD_OUT\n" + + type: string + - name: KEC_SHOP_BUY_POOR_STR + address: + EU: 0x238F5B0 + description: |- + "_BUY_POOR\n" + + type: string + - name: KEC_SHOP_SELL_BAD_STR + address: + EU: 0x238F5BC + description: |- + "_SELL_BAD\n" + + type: string + - name: KEC_SHOP_SELL_FULL_STR + address: + EU: 0x238F5C8 + description: |- + "_SELL_FULL\n" + + type: string + - name: KEC_SHOP_MODE_BUY_START_STR + address: + EU: 0x238F5D4 + description: |- + "_MODE_BUY_START\n" + + type: string + - name: KEC_SHOP_BUY_RESTART_STR + address: + EU: 0x238F5E8 + description: |- + "_BUY_RESTART\n" + + type: string + - name: KEC_SHOP_BUY_SELECT_STR + address: + EU: 0x238F5F8 + description: |- + "_BUY_SELECT\n" + + type: string + - name: KEC_SHOP_BUY_RESELECT_STR + address: + EU: 0x238F608 + description: |- + "_BUY_RESELECT\n" + + type: string + - name: KEC_SHOP_SUB_MENU_BUY_STR + address: + EU: 0x238F618 + description: |- + "_SUB_MENU_BUY\n" + + type: string + - name: KEC_SHOP_BUY_CONFIRM_STR + address: + EU: 0x238F628 + description: |- + "_BUY_CONFIRM\n" + + type: string + - name: KEC_SHOP_BUY_EXPLA_ITEM_STR + address: + EU: 0x238F638 + description: |- + "_BUY_EXPLA Item%d Count%d\n" + + type: string + - name: KEC_SHOP_ITEM_TEXT_TAG + address: + EU: 0x238F654 + description: |- + "[item:0]" + + type: string + - name: KEC_SHOP_BUY_THANKS_STR + address: + EU: 0x238F660 + description: |- + "_BUY_THANKS\n" + + type: string + - name: KEC_SHOP_SELL_START_STR + address: + EU: 0x238F670 + description: |- + "_SELL_START\n" + + type: string + - name: KEC_SHOP_SELL_RESTART_STR + address: + EU: 0x238F680 + description: |- + "_SELL_RESTART\n" + + type: string + - name: KEC_SHOP_SELL_SELECT_STR + address: + EU: 0x238F690 + description: |- + "_SELL_SELECT\n" + + type: string + - name: KEC_SHOP_SELL_RESELECT_STR + address: + EU: 0x238F6A0 + description: |- + "_SELL_RESELECT\n" + + type: string + - name: KEC_SHOP_SELL_SUB_MENU_STR + address: + EU: 0x238F6B0 + description: |- + "_SELL_SUB_MENU\n" + + type: string + - name: KEC_SHOP_SELL_CONFIRM_STR + address: + EU: 0x238F6C0 + description: |- + "_SELL_CONFIRM\n" + + type: string + - name: KEC_SHOP_SELL_CONFIRM_NEW_STR + address: + EU: 0x238F6D0 + description: |- + "_SELL_CONFIRM NEW\n" + + type: string + - name: KEC_SHOP_BUY_CONFIRM_NEW_STR + address: + EU: 0x238F6E4 + description: |- + "_BUY_CONFIRM NEW\n" + + type: string + - name: KEC_SHOP_SELL_EXPLA_STR + address: + EU: 0x238F6F8 + description: |- + "_SELL_EXPLA\n" + + type: string + - name: KEC_SHOP_SELL_THANKS_STR + address: + EU: 0x238F708 + description: |- + "_SELL_THANKS\n" + + type: string + - name: KEC_SHOP_SELL_ALL_STR + address: + EU: 0x238F718 + description: |- + "_SELL_ALL\n" + + type: string + - name: KEC_SHOP_BUT_MULTI_STR + address: + EU: 0x238F724 + description: |- + "_BUT_MULTI\n" + Likely a typo for "_BUY_MULTI\n". + + type: string + - name: KEC_SHOP_SELL_MULTI_STR + address: + EU: 0x238F730 + description: |- + "_SELL_MULTI\n" + + type: string + - name: KEC_SHOP_ALL_CONFIRM_STR + address: + EU: 0x238F740 + description: |- + "_ALL_CONFIRM\n" + + type: string + - name: KEC_SHOP_SELL_ALL_THANKS_STR + address: + EU: 0x238F750 + description: |- + "SELL_ALL_THANKS\n" + + type: string + - name: KEC_SHOP_BUY_MULTI_THANKS_STR + address: + EU: 0x238F764 + description: |- + "BUY_MULTI_THANKS\n" + + type: string + - name: KEC_SHOP_SELL_MULTI_THANKS_STR + address: + EU: 0x238F778 + description: |- + "SELL_MULTI_THANKS\n" + + type: string + - name: KEC_SHOP_CHANGEJOB_STR + address: + EU: 0x238F78C + description: |- + "ChangeJob\n" + + type: string - name: OV22_STATIC_INITIALIZER aliases: - OVERLAY22_RESERVED_SPACE @@ -159,39 +818,39 @@ overlay22: NA: 0x4 JP: 0x4 description: Static initializer for overlay 22. - - name: OVERLAY22_UNKNOWN_POINTER__NA_238EC60 + - name: UNK_GREEN_KEC_STRUCT_0x8 address: EU: 0x238F7A0 NA: 0x238EC60 JP: 0x23901C0 length: - NA: 0x4 - description: "Note: unverified, ported from Irdkwia's notes" - - name: OVERLAY22_UNKNOWN_POINTER__NA_238EC64 - address: - NA: 0x238EC64 - length: - NA: 0x4 - description: "Note: unverified, ported from Irdkwia's notes" - - name: OVERLAY22_UNKNOWN_POINTER__NA_238EC68 + EU: 0x8 + NA: 0x8 + description: |- + [MANUAL DESCRIPTION] + + type: unk_green_kec_struct_0x8 + - name: UNK_PURPLE_KEC_STRUCT_0x8 address: EU: 0x238F7A8 NA: 0x238EC68 JP: 0x23901C8 length: - NA: 0x4 - description: "Note: unverified, ported from Irdkwia's notes" - - name: OVERLAY22_UNKNOWN_POINTER__NA_238EC6C - address: - NA: 0x238EC6C - length: - NA: 0x4 - description: "Note: unverified, ported from Irdkwia's notes" - - name: OVERLAY22_UNKNOWN_POINTER__NA_238EC70 + EU: 0x8 + NA: 0x8 + description: |- + [MANUAL DESCRIPTION] + + type: unk_purple_kec_struct_0x8 + - name: KECLEON_SHOP_SHARED_STRUCT_PTR address: EU: 0x238F7B0 NA: 0x238EC70 JP: 0x23901D0 length: + EU: 0x4 NA: 0x4 - description: "Note: unverified, ported from Irdkwia's notes" + description: |- + [MANUAL DESCRIPTION] + + type: kecleon_shop_shared_struct* diff --git a/symbols/overlay23.yml b/symbols/overlay23.yml index 85d306e7..949dd244 100644 --- a/symbols/overlay23.yml +++ b/symbols/overlay23.yml @@ -12,32 +12,131 @@ overlay23: NA: 0x3780 JP: 0x37E0 description: Controls Kangaskhan Storage (both in Treasure Town and via Kangaskhan Rocks). - functions: [] + functions: + - name: KangaskhanStorageSubcaseManager1 + address: + EU: 0x238AC80 + description: |- + Seems responsible for handling the majority of the frame update behavior for kangaskhan storage, particularly window management. + Shares this responsibility with KangaskhanStorageSubcaseManager1. + + r0: subcase id (should eventually be an enum) + - name: KangaskhanStorageSubcaseManager2 + address: + EU: 0x238BD78 + description: |- + Seems responsible for handling the majority of the frame update behavior for kangaskhan storage, particularly window management. + Shares this responsibility with KangaskhanStorageSubcaseManager2. + + No params. + - name: KangaskhanStorageEntryPoint + address: + EU: 0x238CE68 + description: |- + The sole entry_point for the kangaskhan storage overlay. + + return: undefined4 + - name: KangaskhanStorageDestructor + address: + EU: 0x238CF88 + description: |- + The sole destructor for the kangaskhan storage overlay. + + No params. + - name: KangaskhanStorageFrameUpdate + address: + EU: 0x238CFB4 + description: |- + The sole frame_update for the kangaskhan storage overlay. + + return: undefined4 + - name: KangaskhanStorageCloseSimpleMenu + address: + EU: 0x238DBD8 + description: |- + Closes a simple menu with the simple_menu_window_id from KANGASKHAN_STORAGE_MENU_PTR. + + No params. + - name: KangaskhanStorageShowDialogueAndPortraitIfNotRock + address: + EU: 0x238DC20 + description: |- + Seems responsible for handling dialogue from kangaskhan. + Does nothing if "KANGASKHAN_STORAGE_MENU_PTR->is_kanga_rock" is true. + + r0: window_id + r1: preprocessor_flags pointer + r2: string_id + - name: KangaskhanStorageWithdrawSelectedItems + address: + EU: 0x238DC88 + description: |- + Seems to iteratively remove selected items from storage, and add them to the bag. + Only used when multiple items are selected. + + No params. + - name: KangaskhanStorageDepositSelectedItems + address: + EU: 0x238DCF8 + description: |- + Seems to iteratively remove selected items from the bag, and add them to storage. + Only used when multiple items are selected. + + No params. + - name: KangaskhanStorageWithdrawSingleItem + address: + EU: 0x238DD78 + description: |- + Seems to remove a single item from storage, and add it to the bag. + Subsequently clears the storage selected item table, likely for if multi-select was used on a single item. + + No params. + - name: KangaskhanStorageDepositSingleItem + address: + EU: 0x238DDB8 + description: |- + Seems to remove a single item from the bag, and add it to storage. + Subsequently clears the bag selected item table, likely for if multi-select was used on a single item. + + No params. data: - - name: OVERLAY23_UNKNOWN_VALUE__NA_238D2E8 + - name: STORAGE_OPTION_STATES_1 address: EU: 0x238DE28 NA: 0x238D2E8 JP: 0x238E8A0 length: NA: 0x4 - description: "Note: unverified, ported from Irdkwia's notes" - - name: OVERLAY23_UNKNOWN_VALUE__NA_238D2EC + description: |- + A list of states per menu option. Enabled is 0x0 and Disabled is 0x3. + Not currently known how these are used. + + type: int8_t[4] + - name: STORAGE_OPTION_STATES_2 address: EU: 0x238DE2C NA: 0x238D2EC JP: 0x238E8A4 length: NA: 0x4 - description: "Note: unverified, ported from Irdkwia's notes" - - name: OVERLAY23_UNKNOWN_STRUCT__NA_238D2F0 + description: |- + A list of states per menu option. Enabled is 0x0 and Disabled is 0x3. + Not currently known how these are used. + + type: int8_t[4] + - name: STORAGE_ITEM_CATEGORY_BOOLS address: EU: 0x238DE30 NA: 0x238D2F0 JP: 0x238E8A8 length: NA: 0xC - description: "Note: unverified, ported from Irdkwia's notes" + EU: 0xC + description: |- + Exclusively passed into MaybeGetUncoloredFormattedItemName and MaybeGetColoredFormattedItemName. + The exact purpose of this struct is unknown, but the only "true" bool in the table is for "Other" items. + + type: bool - name: STORAGE_MENU_ITEMS_CONFIRM address: EU: 0x238DE3C @@ -164,11 +263,14 @@ overlay23: NA: 0x4 JP: 0x4 description: Static initializer for overlay 23. - - name: OVERLAY23_UNKNOWN_POINTER__NA_238D8A0 + - name: KANGASKHAN_STORAGE_MENU_PTR address: EU: 0x238E3E0 NA: 0x238D8A0 JP: 0x238EE60 length: NA: 0x4 - description: "Note: unverified, ported from Irdkwia's notes" + description: |- + The main struct that manages kangaskhan storage behavior for the overlay. + + type: kangaskhan_storage_menu struct pointer From 058c5ba97a1622eeed64f84792799fea1dd84211 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 19 Jun 2026 23:46:25 -0400 Subject: [PATCH 098/117] Round 1 fixes --- headers/data/arm9.h | 12 ++++++------ headers/data/overlay22.h | 4 ++-- headers/functions/overlay11.h | 1 - headers/functions/overlay22.h | 1 + symbols/arm9.yml | 34 +++++++++++++++++----------------- symbols/overlay22.yml | 6 +++--- 6 files changed, 29 insertions(+), 29 deletions(-) diff --git a/headers/data/arm9.h b/headers/data/arm9.h index 8cdeb2d9..127a44b4 100644 --- a/headers/data/arm9.h +++ b/headers/data/arm9.h @@ -247,12 +247,12 @@ extern int16_t TBL_TALK_GROUP_STRING_ID_START[6]; extern struct menu_control* MENU_CONTROL_PTR; extern int16_t KEYBOARD_STRING_IDS[30]; extern struct mission_reward_struct_main* MISSION_REWARD_STRUCT_MAIN_PTR; -extern struct unk_storage_struct_0xc UNK_STORAGE_STRUCT_0xC; -extern struct unk_storage_struct_0x14 UNK_STORAGE_STRUCT_0x14; -extern struct unk_storage_struct_0x8* UNK_STORAGE_STRUCT_0x8_PTR_1; -extern struct unk_storage_window_struct_0xc* UNK_STORAGE_WINDOW_STRUCT_0xC_PTR; -extern struct unk_storage_struct_0x8* UNK_STORAGE_STRUCT_0x8_PTR_2; -extern struct unk_storage_struct_0x410* UNK_STORAGE_STRUCT_0x410_PTR; +extern struct unk_storage_struct_0xc UNK_STORAGE_STRUCT_0XC; +extern struct unk_storage_struct_0x14 UNK_STORAGE_STRUCT_0X14; +extern struct unk_storage_struct_0x8* UNK_STORAGE_STRUCT_0X8_PTR_1; +extern struct unk_storage_window_struct_0xc* UNK_STORAGE_WINDOW_STRUCT_0XC_PTR; +extern struct unk_storage_struct_0x8* UNK_STORAGE_STRUCT_0X8_PTR_2; +extern struct unk_storage_struct_0x410* UNK_STORAGE_STRUCT_0X410_PTR; extern bool NOTIFY_NOTE; extern struct monster_id_16 DEFAULT_HERO_ID; extern struct monster_id_16 DEFAULT_PARTNER_ID; diff --git a/headers/data/overlay22.h b/headers/data/overlay22.h index d472136a..a4bf3920 100644 --- a/headers/data/overlay22.h +++ b/headers/data/overlay22.h @@ -65,8 +65,8 @@ extern char KEC_SHOP_BUY_MULTI_THANKS_STR[18]; extern char KEC_SHOP_SELL_MULTI_THANKS_STR[19]; extern char KEC_SHOP_CHANGEJOB_STR[11]; extern undefined4 OV22_STATIC_INITIALIZER; -extern struct unk_green_kec_struct_0x8 UNK_GREEN_KEC_STRUCT_0x8; -extern struct unk_purple_kec_struct_0x8 UNK_PURPLE_KEC_STRUCT_0x8; +extern struct unk_green_kec_struct_0x8 UNK_GREEN_KEC_STRUCT_0X8; +extern struct unk_purple_kec_struct_0x8 UNK_PURPLE_KEC_STRUCT_0X8; extern struct kecleon_shop_shared_struct* KECLEON_SHOP_SHARED_STRUCT_PTR; #endif diff --git a/headers/functions/overlay11.h b/headers/functions/overlay11.h index f2274ecb..2b94b81f 100644 --- a/headers/functions/overlay11.h +++ b/headers/functions/overlay11.h @@ -193,7 +193,6 @@ void LoadKecleonShopOverlay(bool param_1); void LoadKangaskhanOverlay(bool param_1); void LoadChanseyDaycareOverlay(void); void LoadXatuAppraisalOverlay(void); -void LoadMissionRewardOverlay(void); void LoadRecycleShopOverlay(void); void LoadRuleDungeonEffectsOverlay(void); void LoadSpecialEpisodeDiscardOverlay1(void); diff --git a/headers/functions/overlay22.h b/headers/functions/overlay22.h index 79c4ed43..2bc0f4e6 100644 --- a/headers/functions/overlay22.h +++ b/headers/functions/overlay22.h @@ -21,6 +21,7 @@ void PurpleKecleonShopUpdateItemNamesAndCollectionMenu(void); int PurpleKecleonShopInitCollectionMenu(void); void PurpleKecleonShopDoNothing(void); undefined4 PurpleKecleonShopGetCollectionMenuStatus(void); +uint16_t PurpleKecleonShopGetSelectedItemSlot(void); void PurpleKecleonShopInitItemNameData(void); void PurpleKecleonShopFreeItemNameData(void); void PurpleKecleonShopFillItemNameData(void); diff --git a/symbols/arm9.yml b/symbols/arm9.yml index a096b0f6..30b28334 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -8051,7 +8051,7 @@ arm9: address: EU: 0x2042554 description: |- - Initializes an unknown struct of size 0xA0, to a pointer in UNK_STORAGE_STRUCT_0xC. + Initializes an unknown struct of size 0xA0, to a pointer in UNK_STORAGE_STRUCT_0XC. Appears to be used for kangaskhan storage. r0: int32_t @@ -8063,7 +8063,7 @@ arm9: address: EU: 0x2042980 description: |- - Frees an unknown struct of size 0xA0, to a pointer in UNK_STORAGE_STRUCT_0xC. + Frees an unknown struct of size 0xA0, to a pointer in UNK_STORAGE_STRUCT_0XC. Appears to be used for kangaskhan storage. No params. @@ -8088,7 +8088,7 @@ arm9: address: EU: 0x2042EB4 description: |- - Allocates a currently unknown struct UNK_STORAGE_STRUCT_0xC, that seems to manage the bag while interacting with storage. + Allocates a currently unknown struct UNK_STORAGE_STRUCT_0XC, that seems to manage the bag while interacting with storage. Known to be used by Kangaskhan Storage. No params. @@ -8096,7 +8096,7 @@ arm9: address: EU: 0x2042ED8 description: |- - Frees a currently unknown struct UNK_STORAGE_STRUCT_0xC, that seems to manage the bag while interacting with storage. + Frees a currently unknown struct UNK_STORAGE_STRUCT_0XC, that seems to manage the bag while interacting with storage. Known to be used by Kangaskhan Storage. No params. @@ -8104,7 +8104,7 @@ arm9: address: EU: 0x204300C description: |- - Allocates a currently unknown struct of size 0x18c0, and stores it to a pointer at UNK_STORAGE_STRUCT_0x14. + Allocates a currently unknown struct of size 0x18c0, and stores it to a pointer at UNK_STORAGE_STRUCT_0X14. Known to be used by Kangaskhan Storage. r0: int @@ -8124,7 +8124,7 @@ arm9: address: EU: 0x2043498 description: |- - Frees a currently unknown struct of size 0x18c0 from a pointer at UNK_STORAGE_STRUCT_0x14. + Frees a currently unknown struct of size 0x18c0 from a pointer at UNK_STORAGE_STRUCT_0X14. Known to be used by Kangaskhan Storage. No params. @@ -8165,7 +8165,7 @@ arm9: address: EU: 0x20443B0 description: |- - Seems to allocate a table of bools for selected storage items to a pointer in UNK_STORAGE_STRUCT_0x14. + Seems to allocate a table of bools for selected storage items to a pointer in UNK_STORAGE_STRUCT_0X14. Known to be used by Kangaskhan Storage. No params. @@ -8173,7 +8173,7 @@ arm9: address: EU: 0x20443D4 description: |- - Seems to free a table of bools for selected storage items from a pointer in UNK_STORAGE_STRUCT_0x14. + Seems to free a table of bools for selected storage items from a pointer in UNK_STORAGE_STRUCT_0X14. Known to be used by Kangaskhan Storage. No params. @@ -8181,7 +8181,7 @@ arm9: address: EU: 0x2045714 description: |- - Allocates a currently unknown struct of size 0x410 at UNK_STORAGE_STRUCT_0x410_PTR. May be a state case structure of some kind. + Allocates a currently unknown struct of size 0x410 at UNK_STORAGE_STRUCT_0X410_PTR. May be a state case structure of some kind. Likely used by Kangaskhan Storage, or some other storage interaction menu. r0: undefined2 @@ -8191,7 +8191,7 @@ arm9: address: EU: 0x20468F8 description: |- - Seems to close a simple menu for a currently unknown struct of size 0x410 at UNK_STORAGE_STRUCT_0x410_PTR. May be a state case structure of some kind. + Seems to close a simple menu for a currently unknown struct of size 0x410 at UNK_STORAGE_STRUCT_0X410_PTR. May be a state case structure of some kind. Likely used by Kangaskhan Storage, or some other storage interaction menu. No params. @@ -8199,7 +8199,7 @@ arm9: address: EU: 0x2046940 description: |- - Seems to create a dialogue box for a currently unknown struct of size 0x410 at UNK_STORAGE_STRUCT_0x410_PTR. May be a state case structure of some kind. + Seems to create a dialogue box for a currently unknown struct of size 0x410 at UNK_STORAGE_STRUCT_0X410_PTR. May be a state case structure of some kind. Likely used by Kangaskhan Storage, or some other storage interaction menu. No params. @@ -16206,7 +16206,7 @@ arm9: Is also used sparingly during the Spinda Cafe egg event. type: mission_reward_struct_main pointer - - name: UNK_STORAGE_STRUCT_0xC + - name: UNK_STORAGE_STRUCT_0XC address: EU: 0x20B07C4 length: @@ -16215,7 +16215,7 @@ arm9: A currently unknown struct of size 0xc, with ties to kangaskhan storage. type: struct unk_storage_struct_0xc - - name: UNK_STORAGE_STRUCT_0x14 + - name: UNK_STORAGE_STRUCT_0X14 address: EU: 0x20B07D0 length: @@ -16224,7 +16224,7 @@ arm9: A currently unknown struct of size 0x14, with ties to kangaskhan storage. type: struct unk_storage_struct_0x14 - - name: UNK_STORAGE_STRUCT_0x8_PTR_1 + - name: UNK_STORAGE_STRUCT_0X8_PTR_1 address: EU: 0x20B07E4 length: @@ -16233,7 +16233,7 @@ arm9: A pointer to a currently unknown struct of size 0x8, with ties to kangaskhan storage. type: struct unk_storage_struct_0x8* - - name: UNK_STORAGE_WINDOW_STRUCT_0xC_PTR + - name: UNK_STORAGE_WINDOW_STRUCT_0XC_PTR address: EU: 0x20B07E8 length: @@ -16242,7 +16242,7 @@ arm9: A pointer to a currently unknown struct of size 0xc, with ties to kangaskhan storage. type: struct unk_storage_window_struct_0xc* - - name: UNK_STORAGE_STRUCT_0x8_PTR_2 + - name: UNK_STORAGE_STRUCT_0X8_PTR_2 address: EU: 0x20B07EC length: @@ -16251,7 +16251,7 @@ arm9: A pointer to a currently unknown struct of size 0x8, with ties to kangaskhan storage. type: struct unk_storage_struct_0x8* - - name: UNK_STORAGE_STRUCT_0x410_PTR + - name: UNK_STORAGE_STRUCT_0X410_PTR address: EU: 0x20B07F0 length: diff --git a/symbols/overlay22.yml b/symbols/overlay22.yml index acf07a70..9a3fdeae 100644 --- a/symbols/overlay22.yml +++ b/symbols/overlay22.yml @@ -161,7 +161,7 @@ overlay22: [MANUAL DESCRIPTION] return: undefined4 - - name: PurpleKecleonShopGetSelectedItemSlot? + - name: PurpleKecleonShopGetSelectedItemSlot address: EU: 0x238B438 description: |- @@ -818,7 +818,7 @@ overlay22: NA: 0x4 JP: 0x4 description: Static initializer for overlay 22. - - name: UNK_GREEN_KEC_STRUCT_0x8 + - name: UNK_GREEN_KEC_STRUCT_0X8 address: EU: 0x238F7A0 NA: 0x238EC60 @@ -830,7 +830,7 @@ overlay22: [MANUAL DESCRIPTION] type: unk_green_kec_struct_0x8 - - name: UNK_PURPLE_KEC_STRUCT_0x8 + - name: UNK_PURPLE_KEC_STRUCT_0X8 address: EU: 0x238F7A8 NA: 0x238EC68 From f43371ac83756e8ac0716f65867188357ae03958 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 19 Jun 2026 23:47:29 -0400 Subject: [PATCH 099/117] ... --- headers/functions/overlay11.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/functions/overlay11.h b/headers/functions/overlay11.h index 2b94b81f..0f1bded1 100644 --- a/headers/functions/overlay11.h +++ b/headers/functions/overlay11.h @@ -193,7 +193,7 @@ void LoadKecleonShopOverlay(bool param_1); void LoadKangaskhanOverlay(bool param_1); void LoadChanseyDaycareOverlay(void); void LoadXatuAppraisalOverlay(void); -void LoadRecycleShopOverlay(void); +void LoadMissionRewardOverlay(void); void LoadRuleDungeonEffectsOverlay(void); void LoadSpecialEpisodeDiscardOverlay1(void); void LoadSpecialEpisodeDiscardOverlay2(void); From a23fdb456d648bd2c9f41c3bf917514ffbd41103 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 20 Jun 2026 00:29:57 -0400 Subject: [PATCH 100/117] Add lengths and descriptions --- headers/functions/overlay22.h | 10 +- symbols/overlay22.yml | 231 +++++++++++++++++++++++----------- 2 files changed, 161 insertions(+), 80 deletions(-) diff --git a/headers/functions/overlay22.h b/headers/functions/overlay22.h index 2bc0f4e6..b0b07218 100644 --- a/headers/functions/overlay22.h +++ b/headers/functions/overlay22.h @@ -5,14 +5,14 @@ void GreenKecleonShopUpdateItemNamesAndCollectionMenu(void); int GreenKecleonShopInitCollectionMenu(void); void GreenKecleonShopDoNothing(void); undefined4 GreenKecleonShopGetCollectionMenuStatus(void); -uint16_t GreenKecleonShopGetSelectedItemSlot(void); +uint16_t GreenKecleonShopGetShopItemSlot(void); void GreenKecleonShopInitItemNameData(void); void GreenKecleonShopFreeItemNameData(void); void GreenKecleonShopFillItemNameData(void); int GreenKecleonShopCountSelectedItems(void); int GreenKecleonShopGetFirstSelectedItemIndex(void); int GreenKecleonShopSumSelectedItemPrices(void); -void GreenKecleonShopPurchaseSingleItem(uint32_t param_1); +void GreenKecleonShopPurchaseSingleItem(uint32_t item_slot); void GreenKecleonShopPurchaseSelectedItems(void); char* GreenKecleonGetItemNameStringByIndex(undefined4 param_1,int param_2,uint32_t *param_3); undefined4 GreenKecleonShopUnkCollectionMenuCallback(uint32_t param_1); @@ -21,19 +21,19 @@ void PurpleKecleonShopUpdateItemNamesAndCollectionMenu(void); int PurpleKecleonShopInitCollectionMenu(void); void PurpleKecleonShopDoNothing(void); undefined4 PurpleKecleonShopGetCollectionMenuStatus(void); -uint16_t PurpleKecleonShopGetSelectedItemSlot(void); +uint16_t PurpleKecleonShopGetShopItemSlot(void); void PurpleKecleonShopInitItemNameData(void); void PurpleKecleonShopFreeItemNameData(void); void PurpleKecleonShopFillItemNameData(void); int PurpleKecleonShopCountSelectedItems(void); int PurpleKecleonShopGetFirstSelectedItemIndex(void); int PurpleKecleonShopSumSelectedItemPrices(void); -void PurpleKecleonShopPurchaseSingleItem(uint32_t param_1); +void PurpleKecleonShopPurchaseSingleItem(uint32_t item_slot); void PurpleKecleonShopPurchaseSelectedItems(void); char* PurpleKecleonGetItemNameStringByIndex(undefined4 param_1,int param_2,uint32_t *param_3); undefined4 PurpleKecleonShopUnkCollectionMenuCallback(uint32_t param_1); void PurpleKecleonShopCollectionMenuCallback(uint32_t param_1); -void KecleonShopSubcaseManager1(undefined4 param_1); +void KecleonShopSubcaseManager1(int32_t subcase_id); void KecleonShopSubcaseManager2(void); void RemoveInvalidKecleonShopItems(void); void KecleonShopSumBagItemSellPrices(void); diff --git a/symbols/overlay22.yml b/symbols/overlay22.yml index 9a3fdeae..b5c2f8bb 100644 --- a/symbols/overlay22.yml +++ b/symbols/overlay22.yml @@ -17,111 +17,109 @@ overlay22: address: EU: 0x238AC80 description: |- - [MANUAL DESCRIPTION] + Calls GreenKecleonShopFillItemNameData and GreenKecleonShopInitCollectionMenu, then returns. No params. - name: GreenKecleonShopInitCollectionMenu address: EU: 0x238AC90 description: |- - [MANUAL DESCRIPTION] + Seems to initialize a collection menu for green kecleon with data from UNK_GREEN_KEC_STRUCT_0X8. - return: int + return: collection menu window_id - name: GreenKecleonShopDoNothing address: EU: 0x238AD6C description: |- - [MANUAL DESCRIPTION] + Does nothing but return. Is exclusively called by the green kecleon shop. No params. - name: GreenKecleonShopGetCollectionMenuStatus address: EU: 0x238AD70 description: |- - [MANUAL DESCRIPTION] + Seems to return some kind of status data for the collection menu from UNK_GREEN_KEC_STRUCT_0X8. - return: undefined4 - - name: GreenKecleonShopGetSelectedItemSlot + return: collection menu status? + - name: GreenKecleonShopGetShopItemSlot address: EU: 0x238ADEC description: |- - [MANUAL DESCRIPTION] + Seems to retrieve the item slot the cursor is currently pointing to from UNK_GREEN_KEC_STRUCT_0X8. - return: ushort + return: shop item slot index - name: GreenKecleonShopInitItemNameData address: EU: 0x238AE00 description: |- - [MANUAL DESCRIPTION] + Initializes a green_kec_shop_item_data struct in UNK_GREEN_KEC_STRUCT_0X8. No params. - name: GreenKecleonShopFreeItemNameData address: EU: 0x238AE34 description: |- - [MANUAL DESCRIPTION] + Frees a green_kec_shop_item_data struct in UNK_GREEN_KEC_STRUCT_0X8. No params. - name: GreenKecleonShopFillItemNameData address: EU: 0x238AE60 description: |- - [MANUAL DESCRIPTION] + Populates a green_kec_shop_item_data struct in UNK_GREEN_KEC_STRUCT_0X8. No params. - name: GreenKecleonShopCountSelectedItems address: EU: 0x238B00C description: |- - [MANUAL DESCRIPTION] + Counts the number of multi-selected items in the green kecleon shop. - return: int + return: # of selected items. - name: GreenKecleonShopGetFirstSelectedItemIndex address: EU: 0x238B048 description: |- - [MANUAL DESCRIPTION] + Retrieves the index of the first multi-selected item in the green kecleon shop. - return: int + return: index of the first selected shop item. - name: GreenKecleonShopSumSelectedItemPrices address: EU: 0x238B084 description: |- - [MANUAL DESCRIPTION] + Sums the prices of all currently selected items in the green kecleon shop. - return: int + return: total price of all selected shop items. - name: GreenKecleonShopPurchaseSingleItem address: EU: 0x238B0C8 description: |- - [MANUAL DESCRIPTION] - + Handles purchasing a single item from the green kecleon shop, by index. - r0: uint + r0: shop item slot - name: GreenKecleonShopPurchaseSelectedItems address: EU: 0x238B10C description: |- - [MANUAL DESCRIPTION] + Handles purchasing all selected items from the green kecleon shop. + Will not be used if only one item is selected. No params. - name: GreenKecleonGetItemNameStringByIndex address: EU: 0x238B180 description: |- - [MANUAL DESCRIPTION] - + Retrieves the item name string for a shop item in the green kecleon shop by index. - r0: *) + r0: unused r1: int r2: uint - return: char + return: item name string (buffer size 80) - name: GreenKecleonShopUnkCollectionMenuCallback address: EU: 0x238B1BC description: |- - [MANUAL DESCRIPTION] - + An unk_collection_menu_fn_t function used by GreenKecleonShopInitCollectionMenu. r0: uint return: undefined4 @@ -129,119 +127,116 @@ overlay22: address: EU: 0x238B2B4 description: |- - [MANUAL DESCRIPTION] - + An unk_collection_menu_void_fn_t function used by GreenKecleonShopInitCollectionMenu. r0: uint - name: PurpleKecleonShopUpdateItemNamesAndCollectionMenu address: EU: 0x238B2CC description: |- - [MANUAL DESCRIPTION] + Calls PurpleKecleonShopFillItemNameData and PurpleKecleonShopInitCollectionMenu, then returns. No params. - name: PurpleKecleonShopInitCollectionMenu address: EU: 0x238B2DC description: |- - [MANUAL DESCRIPTION] + Seems to initialize a collection menu for purple kecleon with data from UNK_PURPLE_KEC_STRUCT_0X8. - return: int + return: collection menu window_id - name: PurpleKecleonShopDoNothing address: EU: 0x238B3B8 description: |- - [MANUAL DESCRIPTION] + Does nothing but return. Is exclusively called by the purple kecleon shop. No params. - name: PurpleKecleonShopGetCollectionMenuStatus address: EU: 0x238B3BC description: |- - [MANUAL DESCRIPTION] + Seems to return some kind of status data for the collection menu from UNK_PURPLE_KEC_STRUCT_0X8. - return: undefined4 - - name: PurpleKecleonShopGetSelectedItemSlot + return: collection menu status? + - name: PurpleKecleonShopGetShopItemSlot address: EU: 0x238B438 description: |- - [MANUAL DESCRIPTION] + Seems to retrieve the item slot the cursor is currently pointing to from UNK_PURPLE_KEC_STRUCT_0X8. - return: ushort + return: shop item slot index - name: PurpleKecleonShopInitItemNameData address: EU: 0x238B44C description: |- - [MANUAL DESCRIPTION] + Initializes a purple_kec_shop_item_data struct in UNK_PURPLE_KEC_STRUCT_0X8. No params. - name: PurpleKecleonShopFreeItemNameData address: EU: 0x238B480 description: |- - [MANUAL DESCRIPTION] + Frees a purple_kec_shop_item_data struct in UNK_PURPLE_KEC_STRUCT_0X8. No params. - name: PurpleKecleonShopFillItemNameData address: EU: 0x238B4AC description: |- - [MANUAL DESCRIPTION] + Frees a purple_kec_shop_item_data struct in UNK_PURPLE_KEC_STRUCT_0X8. No params. - name: PurpleKecleonShopCountSelectedItems address: EU: 0x238B658 description: |- - [MANUAL DESCRIPTION] + Counts the number of multi-selected items in the purple kecleon shop. - return: int + return: # of selected items. - name: PurpleKecleonShopGetFirstSelectedItemIndex address: EU: 0x238B694 description: |- - [MANUAL DESCRIPTION] + Retrieves the index of the first multi-selected item in the purple kecleon shop. - return: int + return: index of the first selected shop item. - name: PurpleKecleonShopSumSelectedItemPrices address: EU: 0x238B6D0 description: |- - [MANUAL DESCRIPTION] + Sums the prices of all currently selected items in the purple kecleon shop. - return: int + return: total price of all selected shop items. - name: PurpleKecleonShopPurchaseSingleItem address: EU: 0x238B714 description: |- - [MANUAL DESCRIPTION] - + Handles purchasing a single item from the purple kecleon shop, by index. - r0: uint + r0: shop item slot - name: PurpleKecleonShopPurchaseSelectedItems address: EU: 0x238B758 description: |- - [MANUAL DESCRIPTION] + Handles purchasing all selected items from the purple kecleon shop. + Will not be used if only one item is selected. No params. - name: PurpleKecleonGetItemNameStringByIndex address: EU: 0x238B7CC description: |- - [MANUAL DESCRIPTION] - + Retrieves the item name string for a shop item in the purple kecleon shop by index. - r0: *) + r0: unused r1: int r2: uint - return: char + return: item name string (buffer size 80) - name: PurpleKecleonShopUnkCollectionMenuCallback address: EU: 0x238B808 description: |- - [MANUAL DESCRIPTION] - + An unk_collection_menu_fn_t function used by PurpleKecleonShopInitCollectionMenu. r0: uint return: undefined4 @@ -249,73 +244,73 @@ overlay22: address: EU: 0x238B900 description: |- - [MANUAL DESCRIPTION] - + An unk_collection_menu_void_fn_t function used by PurpleKecleonShopInitCollectionMenu. r0: uint - name: KecleonShopSubcaseManager1 address: EU: 0x238B918 description: |- - [MANUAL DESCRIPTION] - - - r0: undefined4 + Seems responsible for handling the majority of the frame update behavior for both kecleon shops, particularly window management. + Shares this responsibility with KecleonShopSubcaseManager2. + + r0: subcase id (should eventually be an enum) - name: KecleonShopSubcaseManager2 address: EU: 0x238CCC4 description: |- - [MANUAL DESCRIPTION] - + Seems responsible for handling the majority of the frame update behavior for both kecleon shops, particularly window management. + Shares this responsibility with KecleonShopSubcaseManager1. + No params. - name: RemoveInvalidKecleonShopItems address: EU: 0x238E068 description: |- - [MANUAL DESCRIPTION] + Calls either RemoveInvalidKecleonShop1Items or RemoveInvalidKecleonShop2Items depending on which kecleon shop is active. No params. - name: KecleonShopSumBagItemSellPrices address: EU: 0x238E094 description: |- - [MANUAL DESCRIPTION] + Sums the sell prices of all items in the bag, presumably for the Sell All option for both kecleon shops. No params. - name: KecleonShopUpdatePortraitEmotion address: EU: 0x238E134 description: |- - [MANUAL DESCRIPTION] + Updates the portrait emotion for the currently active kecleon shop. + Can only change the portrait to PORTRAIT_NORMAL or PORTRAIT_ANGRY. - - r0: bool + r0: 1 if angry, 0 if normal. - name: KecleonShopEntryPoint address: EU: 0x238E180 description: |- - [MANUAL DESCRIPTION] + The sole entry_point for the kecleon shop overlay. return: undefined4 - name: KecleonShopDestructor address: EU: 0x238E2F0 description: |- - [MANUAL DESCRIPTION] + The sole destructor for the kecleon shop overlay. No params. - name: KecleonShopFrameUpdate address: EU: 0x238E340 description: |- - [MANUAL DESCRIPTION] + The sole frame_update for the kecleon shop overlay. return: undefined4 - name: KecleonShopCloseSimpleMenu address: EU: 0x238F324 description: |- - [MANUAL DESCRIPTION] + Closes a simple menu for the kecleon shop. No params. data: @@ -507,6 +502,8 @@ overlay22: - name: KEC_SHOP_START_STR address: EU: 0x238F510 + length: + EU: 0x8 description: |- "_START\n" @@ -514,6 +511,8 @@ overlay22: - name: KEC_SHOP_RESTART_STR address: EU: 0x238F518 + length: + EU: 0xA description: |- "_RESTART\n" @@ -521,6 +520,8 @@ overlay22: - name: KEC_SHOP_SELECTMENU_STR address: EU: 0x238F524 + length: + EU: 0xD description: |- "_SELECTMENU\n" @@ -528,6 +529,8 @@ overlay22: - name: KEC_SHOP_EXPLANATION_STR address: EU: 0x238F534 + length: + EU: 0xE description: |- "_EXPLANATION\n" @@ -535,6 +538,8 @@ overlay22: - name: KEC_SHOP_THANKS_STR address: EU: 0x238F544 + length: + EU: 0x9 description: |- "_THANKS\n" @@ -542,6 +547,8 @@ overlay22: - name: KEC_SHOP_SHOP_NON_STR address: EU: 0x238F550 + length: + EU: 0xB description: |- "_SHOP_NON\n" @@ -549,6 +556,8 @@ overlay22: - name: KEC_SHOP_GOLD_NON_STR address: EU: 0x238F55C + length: + EU: 0xB description: |- "_GOLD_NON\n" @@ -556,6 +565,8 @@ overlay22: - name: KEC_SHOP_GOLD_MAX_STR address: EU: 0x238F568 + length: + EU: 0xB description: |- "_GOLD_MAX\n" @@ -563,6 +574,8 @@ overlay22: - name: KEC_SHOP_GOLD_FULL_STR address: EU: 0x238F574 + length: + EU: 0xC description: |- "_GOLD_FULL\n" @@ -570,6 +583,8 @@ overlay22: - name: KEC_SHOP_SELL_NON_STR address: EU: 0x238F580 + length: + EU: 0xB description: |- "_SELL_NON\n" @@ -577,6 +592,8 @@ overlay22: - name: KEC_SHOP_ITEM_NON_STR address: EU: 0x238F58C + length: + EU: 0xB description: |- "_ITEM_NON\n" @@ -584,6 +601,8 @@ overlay22: - name: KEC_SHOP_ITEM_MAX_STR address: EU: 0x238F598 + length: + EU: 0xB description: |- "_ITEM_MAX\n" @@ -591,6 +610,8 @@ overlay22: - name: KEC_SHOP_SOLD_OUT_STR address: EU: 0x238F5A4 + length: + EU: 0xB description: |- "_SOLD_OUT\n" @@ -598,6 +619,8 @@ overlay22: - name: KEC_SHOP_BUY_POOR_STR address: EU: 0x238F5B0 + length: + EU: 0xB description: |- "_BUY_POOR\n" @@ -605,6 +628,8 @@ overlay22: - name: KEC_SHOP_SELL_BAD_STR address: EU: 0x238F5BC + length: + EU: 0xB description: |- "_SELL_BAD\n" @@ -612,6 +637,8 @@ overlay22: - name: KEC_SHOP_SELL_FULL_STR address: EU: 0x238F5C8 + length: + EU: 0xC description: |- "_SELL_FULL\n" @@ -619,6 +646,8 @@ overlay22: - name: KEC_SHOP_MODE_BUY_START_STR address: EU: 0x238F5D4 + length: + EU: 0x11 description: |- "_MODE_BUY_START\n" @@ -626,6 +655,8 @@ overlay22: - name: KEC_SHOP_BUY_RESTART_STR address: EU: 0x238F5E8 + length: + EU: 0xE description: |- "_BUY_RESTART\n" @@ -633,6 +664,8 @@ overlay22: - name: KEC_SHOP_BUY_SELECT_STR address: EU: 0x238F5F8 + length: + EU: 0xD description: |- "_BUY_SELECT\n" @@ -640,6 +673,8 @@ overlay22: - name: KEC_SHOP_BUY_RESELECT_STR address: EU: 0x238F608 + length: + EU: 0xF description: |- "_BUY_RESELECT\n" @@ -647,6 +682,8 @@ overlay22: - name: KEC_SHOP_SUB_MENU_BUY_STR address: EU: 0x238F618 + length: + EU: 0xF description: |- "_SUB_MENU_BUY\n" @@ -654,6 +691,8 @@ overlay22: - name: KEC_SHOP_BUY_CONFIRM_STR address: EU: 0x238F628 + length: + EU: 0xE description: |- "_BUY_CONFIRM\n" @@ -661,6 +700,8 @@ overlay22: - name: KEC_SHOP_BUY_EXPLA_ITEM_STR address: EU: 0x238F638 + length: + EU: 0x1B description: |- "_BUY_EXPLA Item%d Count%d\n" @@ -668,6 +709,8 @@ overlay22: - name: KEC_SHOP_ITEM_TEXT_TAG address: EU: 0x238F654 + length: + EU: 0x9 description: |- "[item:0]" @@ -675,6 +718,8 @@ overlay22: - name: KEC_SHOP_BUY_THANKS_STR address: EU: 0x238F660 + length: + EU: 0xD description: |- "_BUY_THANKS\n" @@ -682,6 +727,8 @@ overlay22: - name: KEC_SHOP_SELL_START_STR address: EU: 0x238F670 + length: + EU: 0xD description: |- "_SELL_START\n" @@ -689,6 +736,8 @@ overlay22: - name: KEC_SHOP_SELL_RESTART_STR address: EU: 0x238F680 + length: + EU: 0xF description: |- "_SELL_RESTART\n" @@ -696,6 +745,8 @@ overlay22: - name: KEC_SHOP_SELL_SELECT_STR address: EU: 0x238F690 + length: + EU: 0xE description: |- "_SELL_SELECT\n" @@ -703,6 +754,8 @@ overlay22: - name: KEC_SHOP_SELL_RESELECT_STR address: EU: 0x238F6A0 + length: + EU: 0x10 description: |- "_SELL_RESELECT\n" @@ -710,6 +763,8 @@ overlay22: - name: KEC_SHOP_SELL_SUB_MENU_STR address: EU: 0x238F6B0 + length: + EU: 0x10 description: |- "_SELL_SUB_MENU\n" @@ -717,6 +772,8 @@ overlay22: - name: KEC_SHOP_SELL_CONFIRM_STR address: EU: 0x238F6C0 + length: + EU: 0xF description: |- "_SELL_CONFIRM\n" @@ -724,6 +781,8 @@ overlay22: - name: KEC_SHOP_SELL_CONFIRM_NEW_STR address: EU: 0x238F6D0 + length: + EU: 0x13 description: |- "_SELL_CONFIRM NEW\n" @@ -731,6 +790,8 @@ overlay22: - name: KEC_SHOP_BUY_CONFIRM_NEW_STR address: EU: 0x238F6E4 + length: + EU: 0x12 description: |- "_BUY_CONFIRM NEW\n" @@ -738,6 +799,8 @@ overlay22: - name: KEC_SHOP_SELL_EXPLA_STR address: EU: 0x238F6F8 + length: + EU: 0xD description: |- "_SELL_EXPLA\n" @@ -745,6 +808,8 @@ overlay22: - name: KEC_SHOP_SELL_THANKS_STR address: EU: 0x238F708 + length: + EU: 0xE description: |- "_SELL_THANKS\n" @@ -752,6 +817,8 @@ overlay22: - name: KEC_SHOP_SELL_ALL_STR address: EU: 0x238F718 + length: + EU: 0xB description: |- "_SELL_ALL\n" @@ -759,6 +826,8 @@ overlay22: - name: KEC_SHOP_BUT_MULTI_STR address: EU: 0x238F724 + length: + EU: 0xC description: |- "_BUT_MULTI\n" Likely a typo for "_BUY_MULTI\n". @@ -767,6 +836,8 @@ overlay22: - name: KEC_SHOP_SELL_MULTI_STR address: EU: 0x238F730 + length: + EU: 0xD description: |- "_SELL_MULTI\n" @@ -774,6 +845,8 @@ overlay22: - name: KEC_SHOP_ALL_CONFIRM_STR address: EU: 0x238F740 + length: + EU: 0xE description: |- "_ALL_CONFIRM\n" @@ -781,6 +854,8 @@ overlay22: - name: KEC_SHOP_SELL_ALL_THANKS_STR address: EU: 0x238F750 + length: + EU: 0x11 description: |- "SELL_ALL_THANKS\n" @@ -788,6 +863,8 @@ overlay22: - name: KEC_SHOP_BUY_MULTI_THANKS_STR address: EU: 0x238F764 + length: + EU: 0x12 description: |- "BUY_MULTI_THANKS\n" @@ -795,6 +872,8 @@ overlay22: - name: KEC_SHOP_SELL_MULTI_THANKS_STR address: EU: 0x238F778 + length: + EU: 0x13 description: |- "SELL_MULTI_THANKS\n" @@ -802,6 +881,8 @@ overlay22: - name: KEC_SHOP_CHANGEJOB_STR address: EU: 0x238F78C + length: + EU: 0xB description: |- "ChangeJob\n" From 8e8fbfe7bcf8a7ea40c5794aa2b95e71cf60d857 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 20 Jun 2026 01:29:18 -0400 Subject: [PATCH 101/117] Add datatypes... Surely nothing will go wrong. --- headers/data/overlay22.h | 4 +- headers/data/overlay23.h | 2 +- headers/functions/arm9.h | 14 +- headers/types/common/common.h | 100 ++++++++++++ headers/types/common/window.h | 34 +++++ headers/types/ground_mode/enums.h | 27 ++++ headers/types/ground_mode/ground_mode.h | 194 ++++++++++++++++++++++++ symbols/arm9.yml | 16 +- symbols/overlay22.yml | 32 ++-- symbols/overlay23.yml | 4 +- 10 files changed, 391 insertions(+), 36 deletions(-) diff --git a/headers/data/overlay22.h b/headers/data/overlay22.h index a4bf3920..f20abe03 100644 --- a/headers/data/overlay22.h +++ b/headers/data/overlay22.h @@ -65,8 +65,8 @@ extern char KEC_SHOP_BUY_MULTI_THANKS_STR[18]; extern char KEC_SHOP_SELL_MULTI_THANKS_STR[19]; extern char KEC_SHOP_CHANGEJOB_STR[11]; extern undefined4 OV22_STATIC_INITIALIZER; -extern struct unk_green_kec_struct_0x8 UNK_GREEN_KEC_STRUCT_0X8; -extern struct unk_purple_kec_struct_0x8 UNK_PURPLE_KEC_STRUCT_0X8; +extern struct green_kec_shop_item_data_wrapper GREEN_KEC_SHOP_ITEM_DATA_WRAPPER; +extern struct purple_kec_shop_item_data_wrapper PURPLE_KEC_SHOP_ITEM_DATA_WRAPPER; extern struct kecleon_shop_shared_struct* KECLEON_SHOP_SHARED_STRUCT_PTR; #endif diff --git a/headers/data/overlay23.h b/headers/data/overlay23.h index 4f93a6f0..b508f438 100644 --- a/headers/data/overlay23.h +++ b/headers/data/overlay23.h @@ -18,6 +18,6 @@ extern struct window_params STORAGE_WINDOW_PARAMS_6; extern struct window_params STORAGE_WINDOW_PARAMS_7; extern struct window_params STORAGE_WINDOW_PARAMS_8; extern undefined4 OV23_STATIC_INITIALIZER; -extern struct kangaskhan_storage_menu* KANGASKHAN_STORAGE_MENU_PTR; +extern struct kangaskhan_storage_manager* KANGASKHAN_STORAGE_MANAGER_PTR; #endif diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 72cf9bf9..9ebd6dad 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -847,14 +847,14 @@ int SetupAndShowKeyboard(int menu_type, char* buffer1, char* buffer2); int ShowKeyboard(int menu_type, char* buffer1, int param_3, char* buffer2); int GetKeyboardStatus(void); int GetKeyboardStringResult(void); -void DigitInputMenuInit(struct digit_input_window_manager *digit_input_manager); -int32_t DigitInputMenuReturn(struct digit_input_window_manager *digit_input_manager); -void DigitInputMenuInitDigits(struct digit_input_window_manager *digit_input_manager); +void DigitInputMenuInit(struct digit_input_menu *digit_input_menu); +int32_t DigitInputMenuReturn(struct digit_input_menu *digit_input_menu); +void DigitInputMenuInitDigits(struct digit_input_menu *digit_input_menu); undefined DigitInputMenuGetDigits(int *digit_values,int max_value,int max_digit); -undefined4 DigitInputMenuFrameUpdate(struct digit_input_window_manager *digit_input_manager); -undefined4 DigitInputMenuCheckValidTouchScreenInput(struct digit_input_window_manager *digit_input_manager); -undefined DigitInputMenuCheckTouchUpDownArrow(struct digit_input_window_manager *digit_input_manager,int param_2,int param_3); -void DigitInputMenuDrawDigits(struct digit_input_window_manager *digit_input_manager); +undefined4 DigitInputMenuFrameUpdate(struct digit_input_menu *digit_input_menu); +undefined4 DigitInputMenuCheckValidTouchScreenInput(struct digit_input_menu *digit_input_menu); +undefined DigitInputMenuCheckTouchUpDownArrow(struct digit_input_menu *digit_input_menu,int param_2,int param_3); +void DigitInputMenuDrawDigits(struct digit_input_menu *digit_input_menu); void DigitInputMenuDrawDigitsCallback(void); char* TeamSelectionMenuGetItem(char* buffer, int member_idx); void FreeMissionRewardStructMain(void); diff --git a/headers/types/common/common.h b/headers/types/common/common.h index 79ddd871..401370b6 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -1558,4 +1558,104 @@ struct mission_reward_struct_overlay { }; ASSERT_SIZE(struct mission_reward_struct_overlay, 156); +struct unk_storage_struct_0x18c0 { + int field0_0x0; + int16_t storage_block_indices[1000]; + int8_t collection_menu_window_id; + int8_t textbox_window_id_1; + int8_t textbox_window_id_2; + int8_t field5_0x7d7; + int8_t field6_0x7d8; + int8_t field7_0x7d9; + undefined field8_0x7da; + undefined field9_0x7db; + struct window_extra_info window_extra_info; + undefined field11_0x874[4164]; + undefined4 field4175_0x18bc; +}; +ASSERT_SIZE(struct unk_storage_struct_0x18c0, 6336); + +struct unk_storage_struct_0x14 { + int16_t field0_0x0; + int16_t field1_0x2; + struct unk_storage_struct_0x18c0 *struct_0x18c0_ptr; + bool *are_selected_items; // Points to bool table of size 1000 + undefined4 field4_0xc; + undefined4 field5_0x10; +}; +ASSERT_SIZE(struct unk_storage_struct_0x14, 20); + +struct unk_storage_struct_0xc { + undefined2 field0_0x0; + undefined field1_0x2; + undefined field2_0x3; + struct storage_collection_menu_manager *unk_struct_size_0xa0; + bool *are_selected_items; // Points to a bool table of size 50 +}; +ASSERT_SIZE(struct unk_storage_struct_0xc, 12); + +struct unk_storage_window_struct_0xc { + undefined4 field0_0x0; + undefined field1_0x4; + undefined field2_0x5; + undefined2 field3_0x6; + undefined2 field4_0x8; + int8_t textbox_window_id; + undefined field6_0xb; +}; +ASSERT_SIZE(struct unk_storage_window_struct_0xc, 12); + +struct unk_storage_struct_0x8 { + undefined4 field0_0x0; + undefined field1_0x4; + int8_t textbox_window_id; + undefined field3_0x6; + undefined field4_0x7; +}; +ASSERT_SIZE(struct unk_storage_struct_0x18c0, 8); + +struct unk_storage_struct_0x410 { + undefined4 field0_0x0; + int32_t case_id; + int32_t next_case; + undefined field3_0xc; + undefined field4_0xd; + undefined field5_0xe; + undefined field6_0xf; + undefined field7_0x10; + undefined field8_0x11; + undefined field9_0x12; + undefined field10_0x13; + int8_t dialogue_box_window_id; + int8_t window_id_0x15; + int8_t simple_menu_window_id; + int8_t scroll_box_window_id; + undefined4 subcase_id?; + struct preprocessor_args preprocessor_args; + undefined4 field17_0x6c; + char unk_buffer_0x70[256]; + undefined4 field271_0x170; + char unk_buffer_0x174[256]; + undefined4 field528_0x274; + // The usage of this field is inconsistent with it being a buffer, but it is suspiciously sized... + undefined field529_0x278[256]; + undefined4 field785_0x378; + undefined field786_0x37c; + undefined field787_0x37d; + undefined field788_0x37e; + undefined field789_0x37f; + undefined2 field790_0x380; + undefined2 field791_0x382; + undefined2 field792_0x384; + undefined field793_0x386; + undefined field794_0x387; + undefined2 field795_0x388; + undefined field796_0x38a; + undefined field797_0x38b; + undefined4 field798_0x38c; + char unk_buffer_0x390[128]; +}; +ASSERT_SIZE(struct unk_storage_struct_0x18c0, 1040); + + #endif diff --git a/headers/types/common/window.h b/headers/types/common/window.h index 93b040a1..13577715 100644 --- a/headers/types/common/window.h +++ b/headers/types/common/window.h @@ -1107,4 +1107,38 @@ struct stairs_menu { }; ASSERT_SIZE(struct stairs_menu, 24); + +// Used for creating and managing the advanced textbox that handles digit inputs, such as duskull bank transactions. +struct digit_input_menu { + int32_t current_value; + int32_t initial_value; + int32_t min_value; + int32_t max_value; + int32_t initial_digit; + uint8_t advanced_textbox_window_id; + undefined field6_0x15; + undefined field7_0x16; + undefined field8_0x17; + // Offset for the advanced menu's position. Not used by the duskull bank. + int32_t window_offset_coords[2]; + // Seems to be related to the touch screen hitbox for the up and down arrows for a digit. Relative to the position of the window. + int32_t ts_arrow_coords[2]; + int8_t selected_digit; + int8_t num_digits; + undefined field13_0x2a; + undefined field14_0x2b; +}; +ASSERT_SIZE(struct digit_input_window_manager, 44); + +// Not a window, but seems to be a manger struct for the collection menu that handles kangaskhan storage. +struct storage_collection_menu_manager { + int32_t case_id; + int8_t collection_menu_window_id; + undefined field2_0x5; + undefined field3_0x6; + undefined field4_0x7; + struct window_extra_info window_extra_info; +}; +ASSERT_SIZE(struct storage_collection_menu_manager, 160); + #endif diff --git a/headers/types/ground_mode/enums.h b/headers/types/ground_mode/enums.h index edab74dd..3670a257 100644 --- a/headers/types/ground_mode/enums.h +++ b/headers/types/ground_mode/enums.h @@ -2367,6 +2367,33 @@ enum recycle_case_id { RECYCLE_UNK_SUSPEND_0x8 = 8, }; +enum bank_main_case_id { + BANK_BEGIN_MENU=0, + BANK_DO_SUBCASE=1, + BANK_WAIT_CLOSE_MENU=2, + BANK_END_MENU=3, + BANK_UNK_0x4=4, + BANK_CLOSE_MENU=5, +}; + +enum bank_subcase { + SBANK_WELCOME=0, + SBANK_MAIN_MENU_DIALOGUE=1, + SBANK_MAIN_MENU_SELECTION=2, + SBANK_INFO_DIALOGUE=3, + SBANK_BEGIN_EXIT=4, + SBANK_BACK_OUT_DIGIT_MENU=5, + SBANK_EXIT=6, + SBANK_TRY_BEGIN_DEPOSIT=7, + SBANK_DEPOSIT_DIGIT_MENU=8, + SBANK_DEPOSIT_END=9, + SBANK_TRY_BEGIN_WITHDRAW=10, + SBANK_WITHDRAW_DIGIT_MENU=11, + SBANK_WITHDRAW_END=12, + SBANK_UPDATE_GOLD_STATUS=13, +}; + + // These are super long, so split them out into a separate file #include "version_dep_enums.h" diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index d8d10c67..25bfd30d 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -1287,4 +1287,198 @@ struct recycle_unk_struct_0x1cc { }; ASSERT_SIZE(struct recycle_unk_struct_0x1cc, 460); +struct duskull_bank { + enum bank_main_case_id main_case_id; + enum bank_subcase current_subcase_id; + enum bank_subcase next_subcase_id; + int gold_withdrawn; // If negative, is storing gold + undefined4 field4_0x10; // Zeroed but otherwise unused + undefined field5_0x14[64]; // Seems to be fully unused. + struct digit_input_menu digit_input_menu; + int8_t dialogue_box_window_id; + int8_t portrait_box_window_id; + int8_t gold_status_window_id; // Referred to by debug prints as a "sub" of some kind + int8_t simple_menu_window_id; + int8_t unk_input_window_id; + undefined field12_0x85; + undefined field13_0x86; + undefined field14_0x87; + struct preprocessor_args preprocessor_args; + bool is_withdrawing; + undefined field17_0xd9; + undefined field18_0xda; + undefined field19_0xdb; + struct portrait_params portrait_params; +}; +ASSERT_SIZE(struct duskull_bank, 236); + +struct kecleon_shop_shared_struct { + bool is_purple_kec; + undefined field_0x1; + undefined field_0x2; + undefined field_0x3; + int32_t main_case_id; // As the menu is better understood, a subcase should be made for this field. + bool is_green_kec; + undefined field3_0x9; + undefined field4_0xa; + undefined field5_0xb; + undefined4 field6_0xc; + int32_t subcase_id; // As the menu is better understood, a subcase should be made for this field. + undefined field8_0x14; + undefined field9_0x15; + undefined field10_0x16; + undefined field11_0x17; + undefined field12_0x18; + undefined field13_0x19; + undefined field14_0x1a; + undefined field15_0x1b; + undefined field16_0x1c; + undefined field17_0x1d; + undefined field18_0x1e; + undefined field19_0x1f; + undefined field20_0x20; + undefined field21_0x21; + undefined field22_0x22; + undefined field23_0x23; + int num_items_to_sell; + int total_sell_price; + struct item selected_item; + int8_t selected_item_green; + int8_t selected_item_purple; + undefined field29_0x34; + undefined field30_0x35; + undefined field31_0x36; + undefined field32_0x37; + undefined4 field33_0x38; + undefined4 field34_0x3c; + undefined4 field35_0x40; + struct game_state_values *game_state_values_ptr; + int8_t dialogue_box_window_id; + int8_t portrait_box_window_id; + int8_t collection_menu_window_id; + int8_t window_id_0x4b; + int8_t simple_menu_window_id; + undefined field42_0x4d; + undefined field43_0x4e; + undefined field44_0x4f; + struct preprocessor_args preprocessor_args; + undefined fields46_0xa0[320]; + struct portrait_params portrait_params; +}; +ASSERT_SIZE(struct kecleon_shop_shared_struct, 496); + +struct shop_item_name { + char *item_name_ptr; // Points to buffer of size 80 + int item_slot_id; +}; +ASSERT_SIZE(struct shop_item_name, 8); + +struct purple_kec_shop_item_data { + undefined4 field0_0x0; // Set by Arm9LoadUnkFieldNa0x2029EC8... + undefined4 field1_0x4; + int16_t shop_name_string_id; + undefined field3_0xa; + undefined field4_0xb; + undefined4 field5_0xc; + undefined fields6_0x10[136]; + int8_t collection_menu_window_id; // Created by Rename Structure Field action + undefined field143_0x99; + undefined field144_0x9a; + undefined field145_0x9b; + int32_t num_items_for_sale; + struct shop_item_name shop_item_name_table[4]; + struct shop_item_name unk_shop_item_name; + char item_name_buffers[4][80]; + undefined1 unk_item_field_tbl_1[4]; + undefined1 unk_item_field_tbl_1_unuse[4]; + int32_t item_prices[4]; + int32_t item_prices_unused[4]; + bool items_are_selected[4]; +}; +ASSERT_SIZE(struct purple_kec_shop_item_data, 564); + +struct purple_kec_shop_item_data_wrapper { + int16_t selected_item_slot; + undefined field1_0x2; + undefined field2_0x3; + struct purple_kec_shop_item_data *purple_kec_item_data_ptr; +}; +ASSERT_SIZE(struct purple_kec_shop_item_data_wrapper, 8); + +struct green_kec_shop_item_data { + undefined4 field0_0x0; // Set by Arm9LoadUnkFieldNa0x2029EC8... + int field1_0x4; + int16_t shop_name_string_id; // Created by Rename Structure Field action + undefined field3_0xa; + undefined field4_0xb; + int field5_0xc; + undefined fields_0x10[136]; + int8_t collection_menu_window_id; + undefined field143_0x99; + undefined field144_0x9a; + undefined field145_0x9b; + int32_t num_items_for_sale; // Created by Rename Structure Field action + struct shop_item_name shop_item_name_table[8]; + struct shop_item_name unk_shop_item_name; + char item_name_buffers[8][80]; + int8_t unk_item_field_tbl_1[8]; + int item_prices[8]; + undefined1 items_are_selected[8]; +}; +ASSERT_SIZE(struct green_kec_shop_item_data, 920); + +struct green_kec_shop_item_data_wrapper { + int16_t selected_item_slot; + undefined field1_0x2; + undefined field2_0x3; + struct green_kec_shop_item_data *green_kec_item_data_ptr; +}; +ASSERT_SIZE(struct green_kec_shop_item_data_wrapper, 8); + +struct kangaskhan_storage_manager { + int32_t kangaskhan_type; // 0 is likely kangaskhan, 1 and 2 are treated the same, consistent with kanga rock behavior. + undefined4 field1_0x4; + int32_t subcase_id; + int32_t next_subcase; + int32_t unk_counter_0x10; + int32_t unk_timer_0x14; + struct item bag_item_to_store; + undefined field7_0x1e; + undefined field8_0x1f; + int8_t item_slot; + undefined field10_0x21; + undefined field11_0x22; + undefined field12_0x23; + int16_t block_storage_item_slot; + undefined field14_0x26; + undefined field15_0x27; + undefined4 field16_0x28; + undefined4 field17_0x2c; + undefined4 field18_0x30; + undefined fields19_0x34[30]; + struct portrait_emotion_8 portrait_emotion; + undefined field104_0x89; + undefined field105_0x8a; + undefined field106_0x8b; + undefined4 case_id; // Seems strange for it to be all the way down here... + undefined1 field108_0x90[5]; + int8_t dialogue_box_window_id; + int8_t portrait_box_window_id; + int8_t collection_menu_window_id; + int8_t window_id_0x98; + int8_t simple_menu_window_id; + undefined field114_0x9a; + undefined field115_0x9b; + struct preprocessor_args preprocessor_args; + undefined fields117_0xec[64]; + char string_buffer[128]; + struct portrait_params portrait_params; + bool window_is_copied; + undefined field_0x1bd; + undefined field_0x1be; + undefined field_0x1bf; + struct window_extra_info window_extra_info; +}; +ASSERT_SIZE(struct kangaskhan_storage_manager, 600); + #endif diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 30b28334..81523965 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -7915,7 +7915,7 @@ arm9: Seems to handle initialization of a digit_input_window_manager. Used by something other than Duskull Bank! - r0: digit_input_window_manager pointer + r0: digit_input_menu pointer - name: DigitInputMenuReturn address: EU: 0x2039824 @@ -7923,15 +7923,15 @@ arm9: Seems to process the result of DigitInputMenuFrameUpdate. Used by something other than Duskull Bank! - r0: digit_input_window_manager pointer + r0: digit_input_menu pointer return: int32_t - name: DigitInputMenuInitDigits address: EU: 0x20398C8 description: |- - Seems to handle initializing the digit fields of a digit_input_window_manager struct, adjusting the max_digits to align with max_value, and more. + Seems to handle initializing the digit fields of a digit_input_menu struct, adjusting the max_digits to align with max_value, and more. - r0: digit_input_window_manager pointer + r0: digit_input_menu pointer - name: DigitInputMenuGetDigits address: EU: 0x203997C @@ -7948,7 +7948,7 @@ arm9: description: |- Run every frame a digit input menu is active, detecting player inputs via both buttons and the touch screen. - r0: digit_input_window_manager pointer + r0: digit_input_menu pointer return: Some kind of exit code, interpreted by DigitInputMenuReturn - name: DigitInputMenuCheckValidTouchScreenInput address: @@ -7956,7 +7956,7 @@ arm9: description: |- Just a guess. Seems to be checking for touch screen input, and interpreting the results as an equivalent set of button inputs? - r0: digit_input_window_manager pointer + r0: digit_input_menu pointer return: undefined4 - name: DigitInputMenuCheckTouchUpDownArrow address: @@ -7965,7 +7965,7 @@ arm9: Called by DigitInputMenuCheckValidTouchScreenInput, which this function assumes to be generally correct. Seems to specifically check for a touch screen press above or below the current digit, to increment/decrement it - r0: digit_input_window_manager pointer + r0: digit_input_menu pointer r1: int r2: int return: ? @@ -7975,7 +7975,7 @@ arm9: description: |- Seems to handle actually drawing the digits on the advanced textbox for a digit_input_window_manager. - r0: digit_input_window_manager pointer + r0: digit_input_menu pointer - name: DigitInputMenuDrawDigitsCallback address: EU: 0x2039F10 diff --git a/symbols/overlay22.yml b/symbols/overlay22.yml index b5c2f8bb..f417b5e0 100644 --- a/symbols/overlay22.yml +++ b/symbols/overlay22.yml @@ -24,7 +24,7 @@ overlay22: address: EU: 0x238AC90 description: |- - Seems to initialize a collection menu for green kecleon with data from UNK_GREEN_KEC_STRUCT_0X8. + Seems to initialize a collection menu for green kecleon with data from GREEN_KEC_SHOP_ITEM_DATA_WRAPPER. return: collection menu window_id - name: GreenKecleonShopDoNothing @@ -38,35 +38,35 @@ overlay22: address: EU: 0x238AD70 description: |- - Seems to return some kind of status data for the collection menu from UNK_GREEN_KEC_STRUCT_0X8. + Seems to return some kind of status data for the collection menu from GREEN_KEC_SHOP_ITEM_DATA_WRAPPER. return: collection menu status? - name: GreenKecleonShopGetShopItemSlot address: EU: 0x238ADEC description: |- - Seems to retrieve the item slot the cursor is currently pointing to from UNK_GREEN_KEC_STRUCT_0X8. + Seems to retrieve the item slot the cursor is currently pointing to from GREEN_KEC_SHOP_ITEM_DATA_WRAPPER. return: shop item slot index - name: GreenKecleonShopInitItemNameData address: EU: 0x238AE00 description: |- - Initializes a green_kec_shop_item_data struct in UNK_GREEN_KEC_STRUCT_0X8. + Initializes a green_kec_shop_item_data struct in GREEN_KEC_SHOP_ITEM_DATA_WRAPPER. No params. - name: GreenKecleonShopFreeItemNameData address: EU: 0x238AE34 description: |- - Frees a green_kec_shop_item_data struct in UNK_GREEN_KEC_STRUCT_0X8. + Frees a green_kec_shop_item_data struct in GREEN_KEC_SHOP_ITEM_DATA_WRAPPER. No params. - name: GreenKecleonShopFillItemNameData address: EU: 0x238AE60 description: |- - Populates a green_kec_shop_item_data struct in UNK_GREEN_KEC_STRUCT_0X8. + Populates a green_kec_shop_item_data struct in GREEN_KEC_SHOP_ITEM_DATA_WRAPPER. No params. - name: GreenKecleonShopCountSelectedItems @@ -141,7 +141,7 @@ overlay22: address: EU: 0x238B2DC description: |- - Seems to initialize a collection menu for purple kecleon with data from UNK_PURPLE_KEC_STRUCT_0X8. + Seems to initialize a collection menu for purple kecleon with data from PURPLE_KEC_SHOP_ITEM_DATA_WRAPPER. return: collection menu window_id - name: PurpleKecleonShopDoNothing @@ -155,35 +155,35 @@ overlay22: address: EU: 0x238B3BC description: |- - Seems to return some kind of status data for the collection menu from UNK_PURPLE_KEC_STRUCT_0X8. + Seems to return some kind of status data for the collection menu from PURPLE_KEC_SHOP_ITEM_DATA_WRAPPER. return: collection menu status? - name: PurpleKecleonShopGetShopItemSlot address: EU: 0x238B438 description: |- - Seems to retrieve the item slot the cursor is currently pointing to from UNK_PURPLE_KEC_STRUCT_0X8. + Seems to retrieve the item slot the cursor is currently pointing to from PURPLE_KEC_SHOP_ITEM_DATA_WRAPPER. return: shop item slot index - name: PurpleKecleonShopInitItemNameData address: EU: 0x238B44C description: |- - Initializes a purple_kec_shop_item_data struct in UNK_PURPLE_KEC_STRUCT_0X8. + Initializes a purple_kec_shop_item_data struct in PURPLE_KEC_SHOP_ITEM_DATA_WRAPPER. No params. - name: PurpleKecleonShopFreeItemNameData address: EU: 0x238B480 description: |- - Frees a purple_kec_shop_item_data struct in UNK_PURPLE_KEC_STRUCT_0X8. + Frees a purple_kec_shop_item_data struct in PURPLE_KEC_SHOP_ITEM_DATA_WRAPPER. No params. - name: PurpleKecleonShopFillItemNameData address: EU: 0x238B4AC description: |- - Frees a purple_kec_shop_item_data struct in UNK_PURPLE_KEC_STRUCT_0X8. + Frees a purple_kec_shop_item_data struct in PURPLE_KEC_SHOP_ITEM_DATA_WRAPPER. No params. - name: PurpleKecleonShopCountSelectedItems @@ -899,7 +899,7 @@ overlay22: NA: 0x4 JP: 0x4 description: Static initializer for overlay 22. - - name: UNK_GREEN_KEC_STRUCT_0X8 + - name: GREEN_KEK_SHOP_ITEM_DATA_WRAPPER address: EU: 0x238F7A0 NA: 0x238EC60 @@ -910,8 +910,8 @@ overlay22: description: |- [MANUAL DESCRIPTION] - type: unk_green_kec_struct_0x8 - - name: UNK_PURPLE_KEC_STRUCT_0X8 + type: green_kec_shop_item_data_wrapper + - name: PURPLE_KEK_SHOP_ITEM_DATA_WRAPPER address: EU: 0x238F7A8 NA: 0x238EC68 @@ -922,7 +922,7 @@ overlay22: description: |- [MANUAL DESCRIPTION] - type: unk_purple_kec_struct_0x8 + type: purple_kec_shop_item_data_wrapper - name: KECLEON_SHOP_SHARED_STRUCT_PTR address: EU: 0x238F7B0 diff --git a/symbols/overlay23.yml b/symbols/overlay23.yml index 949dd244..b0cd1dfa 100644 --- a/symbols/overlay23.yml +++ b/symbols/overlay23.yml @@ -263,7 +263,7 @@ overlay23: NA: 0x4 JP: 0x4 description: Static initializer for overlay 23. - - name: KANGASKHAN_STORAGE_MENU_PTR + - name: KANGASKHAN_STORAGE_MANAGER_PTR address: EU: 0x238E3E0 NA: 0x238D8A0 @@ -273,4 +273,4 @@ overlay23: description: |- The main struct that manages kangaskhan storage behavior for the overlay. - type: kangaskhan_storage_menu struct pointer + type: kangaskhan_storage_manager struct pointer From a2dec380e4e3a2ba80dbe09994fee3a711746781 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 20 Jun 2026 01:31:38 -0400 Subject: [PATCH 102/117] Update overlay22.yml --- symbols/overlay22.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/symbols/overlay22.yml b/symbols/overlay22.yml index f417b5e0..96de54ce 100644 --- a/symbols/overlay22.yml +++ b/symbols/overlay22.yml @@ -899,7 +899,7 @@ overlay22: NA: 0x4 JP: 0x4 description: Static initializer for overlay 22. - - name: GREEN_KEK_SHOP_ITEM_DATA_WRAPPER + - name: GREEN_KEC_SHOP_ITEM_DATA_WRAPPER address: EU: 0x238F7A0 NA: 0x238EC60 @@ -908,10 +908,10 @@ overlay22: EU: 0x8 NA: 0x8 description: |- - [MANUAL DESCRIPTION] + Seems to contain item property data for the green kecleon shop. type: green_kec_shop_item_data_wrapper - - name: PURPLE_KEK_SHOP_ITEM_DATA_WRAPPER + - name: PURPLE_KEC_SHOP_ITEM_DATA_WRAPPER address: EU: 0x238F7A8 NA: 0x238EC68 @@ -920,7 +920,7 @@ overlay22: EU: 0x8 NA: 0x8 description: |- - [MANUAL DESCRIPTION] + Seems to contain item property data for the purple kecleon shop. type: purple_kec_shop_item_data_wrapper - name: KECLEON_SHOP_SHARED_STRUCT_PTR @@ -932,6 +932,6 @@ overlay22: EU: 0x4 NA: 0x4 description: |- - [MANUAL DESCRIPTION] + Seems to handle the operations of the kecleon shop, and is shared for both brothers. type: kecleon_shop_shared_struct* From 08482afe5cd40704b7d9cc4f75fd670f4a67aa5c Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 20 Jun 2026 01:34:26 -0400 Subject: [PATCH 103/117] Please work? --- headers/types/common/common.h | 6 +++--- headers/types/common/window.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index 401370b6..1415f9fe 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -1570,7 +1570,7 @@ struct unk_storage_struct_0x18c0 { undefined field8_0x7da; undefined field9_0x7db; struct window_extra_info window_extra_info; - undefined field11_0x874[4164]; + undefined field11_0x874[4168]; undefined4 field4175_0x18bc; }; ASSERT_SIZE(struct unk_storage_struct_0x18c0, 6336); @@ -1612,7 +1612,7 @@ struct unk_storage_struct_0x8 { undefined field3_0x6; undefined field4_0x7; }; -ASSERT_SIZE(struct unk_storage_struct_0x18c0, 8); +ASSERT_SIZE(struct unk_storage_struct_0x8, 8); struct unk_storage_struct_0x410 { undefined4 field0_0x0; @@ -1655,7 +1655,7 @@ struct unk_storage_struct_0x410 { undefined4 field798_0x38c; char unk_buffer_0x390[128]; }; -ASSERT_SIZE(struct unk_storage_struct_0x18c0, 1040); +ASSERT_SIZE(struct unk_storage_struct_0x410, 1040); #endif diff --git a/headers/types/common/window.h b/headers/types/common/window.h index 13577715..44bce010 100644 --- a/headers/types/common/window.h +++ b/headers/types/common/window.h @@ -1128,7 +1128,7 @@ struct digit_input_menu { undefined field13_0x2a; undefined field14_0x2b; }; -ASSERT_SIZE(struct digit_input_window_manager, 44); +ASSERT_SIZE(struct digit_input_menu, 44); // Not a window, but seems to be a manger struct for the collection menu that handles kangaskhan storage. struct storage_collection_menu_manager { From ce3df8eee08e6171b6a6d8447d38ddd015d32ed6 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 20 Jun 2026 01:35:43 -0400 Subject: [PATCH 104/117] ... --- headers/types/common/common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index 1415f9fe..62787325 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -1630,7 +1630,7 @@ struct unk_storage_struct_0x410 { int8_t window_id_0x15; int8_t simple_menu_window_id; int8_t scroll_box_window_id; - undefined4 subcase_id?; + undefined4 subcase_id; struct preprocessor_args preprocessor_args; undefined4 field17_0x6c; char unk_buffer_0x70[256]; From 21a8d5b0c4ecf59590533f60b3a5d6c91e4c145a Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 20 Jun 2026 01:38:21 -0400 Subject: [PATCH 105/117] oops --- headers/types/ground_mode/ground_mode.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index 25bfd30d..78b64e07 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -1435,6 +1435,8 @@ struct green_kec_shop_item_data_wrapper { }; ASSERT_SIZE(struct green_kec_shop_item_data_wrapper, 8); + +// Exclusively used within the overlay struct kangaskhan_storage_manager { int32_t kangaskhan_type; // 0 is likely kangaskhan, 1 and 2 are treated the same, consistent with kanga rock behavior. undefined4 field1_0x4; @@ -1455,7 +1457,7 @@ struct kangaskhan_storage_manager { undefined4 field16_0x28; undefined4 field17_0x2c; undefined4 field18_0x30; - undefined fields19_0x34[30]; + undefined fields19_0x34[84]; struct portrait_emotion_8 portrait_emotion; undefined field104_0x89; undefined field105_0x8a; From 4f455a61475c401a4da42bfbd6da1f86ab74d0f3 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 20 Jun 2026 01:40:55 -0400 Subject: [PATCH 106/117] Fix Syntax --- headers/data/overlay15.h | 2 +- headers/functions/arm9.h | 33 ++++++++++---------- headers/functions/overlay22.h | 4 +-- headers/functions/overlay23.h | 4 ++- headers/types/common/common.h | 12 ++++---- headers/types/common/window.h | 10 +++--- headers/types/ground_mode/enums.h | 41 ++++++++++++------------- headers/types/ground_mode/ground_mode.h | 22 +++++++------ symbols/arm9.yml | 38 +++++++++++------------ symbols/overlay11.yml | 2 +- symbols/overlay15.yml | 16 +++++----- symbols/overlay22.yml | 26 ++++++++-------- symbols/overlay23.yml | 16 +++++----- 13 files changed, 116 insertions(+), 110 deletions(-) diff --git a/headers/data/overlay15.h b/headers/data/overlay15.h index c9b2b714..375e97b4 100644 --- a/headers/data/overlay15.h +++ b/headers/data/overlay15.h @@ -18,6 +18,6 @@ extern char BANK_SUB_NOT_CLOSE_STR[15]; extern char BANK_SELECT_NOT_CLOSE_STR[18]; extern char BANK_INPUT_NOT_CLOSE_STR[17]; extern undefined4 OV15_STATIC_INITIALIZER; -extern struct duskull_bank *DUSKULL_BANK_STRUCT_PTR; +extern struct duskull_bank* DUSKULL_BANK_STRUCT_PTR; #endif diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 9ebd6dad..b65396ad 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -177,8 +177,8 @@ int GetActualBuyPrice(struct item* item); int GetActualSellPrice(struct item* item); int FindItemInInventory(enum item_id item_id); int SprintfStatic(char* str, const char* format, ...); -void MaybeGetUncoloredFormattedItemName(char *item_name,struct item *item, bool * category_table); -void MaybeGetColoredFormattedItemName(char *item_name,struct item *item, bool * category_table); +void MaybeGetUncoloredFormattedItemName(char* item_name, struct item* item, bool* category_table); +void MaybeGetColoredFormattedItemName(char* item_name, struct item* item, bool* category_table); void ItemZInit(struct item* item); bool AreItemsEquivalent(struct item* item1, struct item* item2, int bitmask); int GetMoneyQuantity(struct item* item); @@ -289,13 +289,13 @@ void SetEggHatchTimer(uint16_t hatch_timer); void DecrementEggHatchTimer(void); int RemoveInvalidKecleonShop1Items(void); void RemoveItemFromKecleonShop1(int slot); -struct bulk_item * GetCurrentKecleonShop1ItemByIndex(int index); +struct bulk_item* GetCurrentKecleonShop1ItemByIndex(int index); void SortKecleonItems1(void); void GenerateKecleonItems1(enum kecleon_shop_version kecleon_shop_version); bool AddItemToKecleonShop1(enum item_id item_id); int RemoveInvalidKecleonShop2Items(void); void RemoveItemFromKecleonShop2(int slot); -struct bulk_item * GetCurrentKecleonShop2ItemByIndex(int index); +struct bulk_item* GetCurrentKecleonShop2ItemByIndex(int index); void SortKecleonItems2(void); void GenerateKecleonItems2(enum kecleon_shop_version kecleon_shop_version); bool AddItemToKecleonShop2(enum item_id item_id); @@ -624,7 +624,7 @@ int GetTalkLine(int personality_idx, enum talk_type talk_type, int restrictions) bool IsAOrBPressed(void); void DrawTextInWindow(int window_id, int x, int y, char* string); void AppendStringIdToWindow(undefined4 param_1, undefined4 param_2, undefined4 param_3, - int string_id); + int string_id); uint8_t GetCharWidth(char symbol); int GetColorCodePaletteOffset(char symbol); uint8_t DrawChar(int window_id, int x, int y, char symbol, int color_offset); @@ -847,14 +847,15 @@ int SetupAndShowKeyboard(int menu_type, char* buffer1, char* buffer2); int ShowKeyboard(int menu_type, char* buffer1, int param_3, char* buffer2); int GetKeyboardStatus(void); int GetKeyboardStringResult(void); -void DigitInputMenuInit(struct digit_input_menu *digit_input_menu); -int32_t DigitInputMenuReturn(struct digit_input_menu *digit_input_menu); -void DigitInputMenuInitDigits(struct digit_input_menu *digit_input_menu); -undefined DigitInputMenuGetDigits(int *digit_values,int max_value,int max_digit); -undefined4 DigitInputMenuFrameUpdate(struct digit_input_menu *digit_input_menu); -undefined4 DigitInputMenuCheckValidTouchScreenInput(struct digit_input_menu *digit_input_menu); -undefined DigitInputMenuCheckTouchUpDownArrow(struct digit_input_menu *digit_input_menu,int param_2,int param_3); -void DigitInputMenuDrawDigits(struct digit_input_menu *digit_input_menu); +void DigitInputMenuInit(struct digit_input_menu* digit_input_menu); +int32_t DigitInputMenuReturn(struct digit_input_menu* digit_input_menu); +void DigitInputMenuInitDigits(struct digit_input_menu* digit_input_menu); +undefined DigitInputMenuGetDigits(int* digit_values, int max_value, int max_digit); +undefined4 DigitInputMenuFrameUpdate(struct digit_input_menu* digit_input_menu); +undefined4 DigitInputMenuCheckValidTouchScreenInput(struct digit_input_menu* digit_input_menu); +undefined DigitInputMenuCheckTouchUpDownArrow(struct digit_input_menu* digit_input_menu, + int param_2, int param_3); +void DigitInputMenuDrawDigits(struct digit_input_menu* digit_input_menu); void DigitInputMenuDrawDigitsCallback(void); char* TeamSelectionMenuGetItem(char* buffer, int member_idx); void FreeMissionRewardStructMain(void); @@ -863,13 +864,13 @@ void PrintMoveOptionMenu(void); void PrintIqSkillsMenu(enum monster_id monster_id, uint32_t* iq_skills_flags, int monster_iq, bool is_blinded); char* GetCheckIqMenuSkillString(char* buf, int iq_entry_idx); -int InitUnkStorageStruct0xA0(int32_t param_1,undefined4 param_2,int param_3,int param_4); +int InitUnkStorageStruct0xA0(int32_t param_1, undefined4 param_2, int param_3, int param_4); void FreeUnkStorageStruct0xA0(void); void ClearBagSelectedItemTable(void); bool IsBagItemIndexSelected(int index); void AllocUnkBagStruct(void); void FreeUnkBagStruct(void); -int InitUnkStorageStruct0x18c0(int param_1,undefined4 param_2,int param_3); +int InitUnkStorageStruct0x18c0(int param_1, undefined4 param_2, int param_3); bool MaybeTrySelectStorageItem(struct buttons inputs); void FreeUnkStorageStruct0x18c0(void); void ClearStorageSelectedItemTable(void); @@ -878,7 +879,7 @@ int GetFirstSelectedStorageItemIndex(void); bool IsStorageItemIndexSelected(int index); void AllocStorageSelectedItemTable(void); void FreeStorageSelectedItemTable(void); -undefined4 InitUnkStorageStruct0x410(undefined2 *param_1,int param_2); +undefined4 InitUnkStorageStruct0x410(undefined2* param_1, int param_2); void UnkStorageStruct0x410CloseSimpleMenu(void); void UnkStorageStruct0x410CreateDialogueBox(void); void PlayMissionClearBgm(void); diff --git a/headers/functions/overlay22.h b/headers/functions/overlay22.h index b0b07218..00c830e1 100644 --- a/headers/functions/overlay22.h +++ b/headers/functions/overlay22.h @@ -14,7 +14,7 @@ int GreenKecleonShopGetFirstSelectedItemIndex(void); int GreenKecleonShopSumSelectedItemPrices(void); void GreenKecleonShopPurchaseSingleItem(uint32_t item_slot); void GreenKecleonShopPurchaseSelectedItems(void); -char* GreenKecleonGetItemNameStringByIndex(undefined4 param_1,int param_2,uint32_t *param_3); +char* GreenKecleonGetItemNameStringByIndex(undefined4 param_1, int param_2, uint32_t* param_3); undefined4 GreenKecleonShopUnkCollectionMenuCallback(uint32_t param_1); void GreenKecleonShopVoidFnCollectionMenuCallback(uint32_t param_1); void PurpleKecleonShopUpdateItemNamesAndCollectionMenu(void); @@ -30,7 +30,7 @@ int PurpleKecleonShopGetFirstSelectedItemIndex(void); int PurpleKecleonShopSumSelectedItemPrices(void); void PurpleKecleonShopPurchaseSingleItem(uint32_t item_slot); void PurpleKecleonShopPurchaseSelectedItems(void); -char* PurpleKecleonGetItemNameStringByIndex(undefined4 param_1,int param_2,uint32_t *param_3); +char* PurpleKecleonGetItemNameStringByIndex(undefined4 param_1, int param_2, uint32_t* param_3); undefined4 PurpleKecleonShopUnkCollectionMenuCallback(uint32_t param_1); void PurpleKecleonShopCollectionMenuCallback(uint32_t param_1); void KecleonShopSubcaseManager1(int32_t subcase_id); diff --git a/headers/functions/overlay23.h b/headers/functions/overlay23.h index 42a90f53..6cf89d61 100644 --- a/headers/functions/overlay23.h +++ b/headers/functions/overlay23.h @@ -7,7 +7,9 @@ undefined4 KangaskhanStorageEntryPoint(void); void KangaskhanStorageDestructor(void); undefined4 KangaskhanStorageFrameUpdate(void); void KangaskhanStorageCloseSimpleMenu(void); -void KangaskhanStorageShowDialogueAndPortraitIfNotRock(int window_id,struct preprocessor_flags flags,int string_id); +void KangaskhanStorageShowDialogueAndPortraitIfNotRock(int window_id, + struct preprocessor_flags flags, + int string_id); void KangaskhanStorageWithdrawSelectedItems(void); void KangaskhanStorageDepositSelectedItems(void); void KangaskhanStorageWithdrawSingleItem(void); diff --git a/headers/types/common/common.h b/headers/types/common/common.h index 62787325..83edd9e6 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -1578,8 +1578,8 @@ ASSERT_SIZE(struct unk_storage_struct_0x18c0, 6336); struct unk_storage_struct_0x14 { int16_t field0_0x0; int16_t field1_0x2; - struct unk_storage_struct_0x18c0 *struct_0x18c0_ptr; - bool *are_selected_items; // Points to bool table of size 1000 + struct unk_storage_struct_0x18c0* struct_0x18c0_ptr; + bool* are_selected_items; // Points to bool table of size 1000 undefined4 field4_0xc; undefined4 field5_0x10; }; @@ -1589,8 +1589,8 @@ struct unk_storage_struct_0xc { undefined2 field0_0x0; undefined field1_0x2; undefined field2_0x3; - struct storage_collection_menu_manager *unk_struct_size_0xa0; - bool *are_selected_items; // Points to a bool table of size 50 + struct storage_collection_menu_manager* unk_struct_size_0xa0; + bool* are_selected_items; // Points to a bool table of size 50 }; ASSERT_SIZE(struct unk_storage_struct_0xc, 12); @@ -1637,7 +1637,8 @@ struct unk_storage_struct_0x410 { undefined4 field271_0x170; char unk_buffer_0x174[256]; undefined4 field528_0x274; - // The usage of this field is inconsistent with it being a buffer, but it is suspiciously sized... + // The usage of this field is inconsistent with it being a buffer, but it is suspiciously + // sized... undefined field529_0x278[256]; undefined4 field785_0x378; undefined field786_0x37c; @@ -1657,5 +1658,4 @@ struct unk_storage_struct_0x410 { }; ASSERT_SIZE(struct unk_storage_struct_0x410, 1040); - #endif diff --git a/headers/types/common/window.h b/headers/types/common/window.h index 44bce010..3caba2e2 100644 --- a/headers/types/common/window.h +++ b/headers/types/common/window.h @@ -1107,8 +1107,8 @@ struct stairs_menu { }; ASSERT_SIZE(struct stairs_menu, 24); - -// Used for creating and managing the advanced textbox that handles digit inputs, such as duskull bank transactions. +// Used for creating and managing the advanced textbox that handles digit inputs, such as duskull +// bank transactions. struct digit_input_menu { int32_t current_value; int32_t initial_value; @@ -1121,7 +1121,8 @@ struct digit_input_menu { undefined field8_0x17; // Offset for the advanced menu's position. Not used by the duskull bank. int32_t window_offset_coords[2]; - // Seems to be related to the touch screen hitbox for the up and down arrows for a digit. Relative to the position of the window. + // Seems to be related to the touch screen hitbox for the up and down arrows for a digit. + // Relative to the position of the window. int32_t ts_arrow_coords[2]; int8_t selected_digit; int8_t num_digits; @@ -1130,7 +1131,8 @@ struct digit_input_menu { }; ASSERT_SIZE(struct digit_input_menu, 44); -// Not a window, but seems to be a manger struct for the collection menu that handles kangaskhan storage. +// Not a window, but seems to be a manger struct for the collection menu that handles kangaskhan +// storage. struct storage_collection_menu_manager { int32_t case_id; int8_t collection_menu_window_id; diff --git a/headers/types/ground_mode/enums.h b/headers/types/ground_mode/enums.h index 3670a257..28f3a16f 100644 --- a/headers/types/ground_mode/enums.h +++ b/headers/types/ground_mode/enums.h @@ -2368,32 +2368,31 @@ enum recycle_case_id { }; enum bank_main_case_id { - BANK_BEGIN_MENU=0, - BANK_DO_SUBCASE=1, - BANK_WAIT_CLOSE_MENU=2, - BANK_END_MENU=3, - BANK_UNK_0x4=4, - BANK_CLOSE_MENU=5, + BANK_BEGIN_MENU = 0, + BANK_DO_SUBCASE = 1, + BANK_WAIT_CLOSE_MENU = 2, + BANK_END_MENU = 3, + BANK_UNK_0x4 = 4, + BANK_CLOSE_MENU = 5, }; enum bank_subcase { - SBANK_WELCOME=0, - SBANK_MAIN_MENU_DIALOGUE=1, - SBANK_MAIN_MENU_SELECTION=2, - SBANK_INFO_DIALOGUE=3, - SBANK_BEGIN_EXIT=4, - SBANK_BACK_OUT_DIGIT_MENU=5, - SBANK_EXIT=6, - SBANK_TRY_BEGIN_DEPOSIT=7, - SBANK_DEPOSIT_DIGIT_MENU=8, - SBANK_DEPOSIT_END=9, - SBANK_TRY_BEGIN_WITHDRAW=10, - SBANK_WITHDRAW_DIGIT_MENU=11, - SBANK_WITHDRAW_END=12, - SBANK_UPDATE_GOLD_STATUS=13, + SBANK_WELCOME = 0, + SBANK_MAIN_MENU_DIALOGUE = 1, + SBANK_MAIN_MENU_SELECTION = 2, + SBANK_INFO_DIALOGUE = 3, + SBANK_BEGIN_EXIT = 4, + SBANK_BACK_OUT_DIGIT_MENU = 5, + SBANK_EXIT = 6, + SBANK_TRY_BEGIN_DEPOSIT = 7, + SBANK_DEPOSIT_DIGIT_MENU = 8, + SBANK_DEPOSIT_END = 9, + SBANK_TRY_BEGIN_WITHDRAW = 10, + SBANK_WITHDRAW_DIGIT_MENU = 11, + SBANK_WITHDRAW_END = 12, + SBANK_UPDATE_GOLD_STATUS = 13, }; - // These are super long, so split them out into a separate file #include "version_dep_enums.h" diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index 78b64e07..7a7c9e78 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -1291,8 +1291,8 @@ struct duskull_bank { enum bank_main_case_id main_case_id; enum bank_subcase current_subcase_id; enum bank_subcase next_subcase_id; - int gold_withdrawn; // If negative, is storing gold - undefined4 field4_0x10; // Zeroed but otherwise unused + int gold_withdrawn; // If negative, is storing gold + undefined4 field4_0x10; // Zeroed but otherwise unused undefined field5_0x14[64]; // Seems to be fully unused. struct digit_input_menu digit_input_menu; int8_t dialogue_box_window_id; @@ -1317,13 +1317,15 @@ struct kecleon_shop_shared_struct { undefined field_0x1; undefined field_0x2; undefined field_0x3; - int32_t main_case_id; // As the menu is better understood, a subcase should be made for this field. + int32_t + main_case_id; // As the menu is better understood, a subcase should be made for this field. bool is_green_kec; undefined field3_0x9; undefined field4_0xa; undefined field5_0xb; undefined4 field6_0xc; - int32_t subcase_id; // As the menu is better understood, a subcase should be made for this field. + int32_t + subcase_id; // As the menu is better understood, a subcase should be made for this field. undefined field8_0x14; undefined field9_0x15; undefined field10_0x16; @@ -1352,7 +1354,7 @@ struct kecleon_shop_shared_struct { undefined4 field33_0x38; undefined4 field34_0x3c; undefined4 field35_0x40; - struct game_state_values *game_state_values_ptr; + struct game_state_values* game_state_values_ptr; int8_t dialogue_box_window_id; int8_t portrait_box_window_id; int8_t collection_menu_window_id; @@ -1368,7 +1370,7 @@ struct kecleon_shop_shared_struct { ASSERT_SIZE(struct kecleon_shop_shared_struct, 496); struct shop_item_name { - char *item_name_ptr; // Points to buffer of size 80 + char* item_name_ptr; // Points to buffer of size 80 int item_slot_id; }; ASSERT_SIZE(struct shop_item_name, 8); @@ -1401,7 +1403,7 @@ struct purple_kec_shop_item_data_wrapper { int16_t selected_item_slot; undefined field1_0x2; undefined field2_0x3; - struct purple_kec_shop_item_data *purple_kec_item_data_ptr; + struct purple_kec_shop_item_data* purple_kec_item_data_ptr; }; ASSERT_SIZE(struct purple_kec_shop_item_data_wrapper, 8); @@ -1431,14 +1433,14 @@ struct green_kec_shop_item_data_wrapper { int16_t selected_item_slot; undefined field1_0x2; undefined field2_0x3; - struct green_kec_shop_item_data *green_kec_item_data_ptr; + struct green_kec_shop_item_data* green_kec_item_data_ptr; }; ASSERT_SIZE(struct green_kec_shop_item_data_wrapper, 8); - // Exclusively used within the overlay struct kangaskhan_storage_manager { - int32_t kangaskhan_type; // 0 is likely kangaskhan, 1 and 2 are treated the same, consistent with kanga rock behavior. + int32_t kangaskhan_type; // 0 is likely kangaskhan, 1 and 2 are treated the same, consistent + // with kanga rock behavior. undefined4 field1_0x4; int32_t subcase_id; int32_t next_subcase; diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 81523965..d718a0bf 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -2791,7 +2791,7 @@ arm9: Just a guess. Seems like it might handle updating storage, syncing the item count data to the temporary item slots after interacting with storage. Used as a sort parallel to RemoveEmptyItemsInBag. - + No params. - name: RemoveItemAtIdxInStorage address: @@ -7924,7 +7924,7 @@ arm9: Used by something other than Duskull Bank! r0: digit_input_menu pointer - return: int32_t + return: int32_t - name: DigitInputMenuInitDigits address: EU: 0x20398C8 @@ -7957,7 +7957,7 @@ arm9: Just a guess. Seems to be checking for touch screen input, and interpreting the results as an equivalent set of button inputs? r0: digit_input_menu pointer - return: undefined4 + return: undefined4 - name: DigitInputMenuCheckTouchUpDownArrow address: EU: 0x2039CF8 @@ -7968,7 +7968,7 @@ arm9: r0: digit_input_menu pointer r1: int r2: int - return: ? + return: ? - name: DigitInputMenuDrawDigits address: EU: 0x2039E08 @@ -8058,14 +8058,14 @@ arm9: r1: undefined4 r2: int r3: int - return: int + return: int - name: FreeUnkStorageStruct0xA0 address: EU: 0x2042980 description: |- Frees an unknown struct of size 0xA0, to a pointer in UNK_STORAGE_STRUCT_0XC. Appears to be used for kangaskhan storage. - + No params. - name: ClearBagSelectedItemTable address: @@ -8083,7 +8083,7 @@ arm9: Known to be used by Kangaskhan Storage. r0: index - return: bool + return: bool - name: AllocUnkBagStruct address: EU: 0x2042EB4 @@ -8110,16 +8110,16 @@ arm9: r0: int r1: undefined4 r2: int - return: int + return: int - name: MaybeTrySelectStorageItem address: EU: 0x20432D4 description: |- Seems to be responsible for selecting an item from storage, for multi-select. Known to be used by Kangaskhan Storage. - + r0: buttons struct? Seems to be checking for the R button... - return: bool + return: bool - name: FreeUnkStorageStruct0x18c0 address: EU: 0x2043498 @@ -8143,7 +8143,7 @@ arm9: Seems to count the number of currently selected items in storage. Known to be used by Kangaskhan Storage. - return: number of selected items + return: number of selected items - name: GetFirstSelectedStorageItemIndex address: EU: 0x2043848 @@ -8167,7 +8167,7 @@ arm9: description: |- Seems to allocate a table of bools for selected storage items to a pointer in UNK_STORAGE_STRUCT_0X14. Known to be used by Kangaskhan Storage. - + No params. - name: FreeStorageSelectedItemTable address: @@ -8193,7 +8193,7 @@ arm9: description: |- Seems to close a simple menu for a currently unknown struct of size 0x410 at UNK_STORAGE_STRUCT_0X410_PTR. May be a state case structure of some kind. Likely used by Kangaskhan Storage, or some other storage interaction menu. - + No params. - name: UnkStorageStruct0x410CreateDialogueBox address: @@ -16214,7 +16214,7 @@ arm9: description: |- A currently unknown struct of size 0xc, with ties to kangaskhan storage. - type: struct unk_storage_struct_0xc + type: struct unk_storage_struct_0xc - name: UNK_STORAGE_STRUCT_0X14 address: EU: 0x20B07D0 @@ -16223,7 +16223,7 @@ arm9: description: |- A currently unknown struct of size 0x14, with ties to kangaskhan storage. - type: struct unk_storage_struct_0x14 + type: struct unk_storage_struct_0x14 - name: UNK_STORAGE_STRUCT_0X8_PTR_1 address: EU: 0x20B07E4 @@ -16232,7 +16232,7 @@ arm9: description: |- A pointer to a currently unknown struct of size 0x8, with ties to kangaskhan storage. - type: struct unk_storage_struct_0x8* + type: struct unk_storage_struct_0x8* - name: UNK_STORAGE_WINDOW_STRUCT_0XC_PTR address: EU: 0x20B07E8 @@ -16241,7 +16241,7 @@ arm9: description: |- A pointer to a currently unknown struct of size 0xc, with ties to kangaskhan storage. - type: struct unk_storage_window_struct_0xc* + type: struct unk_storage_window_struct_0xc* - name: UNK_STORAGE_STRUCT_0X8_PTR_2 address: EU: 0x20B07EC @@ -16250,7 +16250,7 @@ arm9: description: |- A pointer to a currently unknown struct of size 0x8, with ties to kangaskhan storage. - type: struct unk_storage_struct_0x8* + type: struct unk_storage_struct_0x8* - name: UNK_STORAGE_STRUCT_0X410_PTR address: EU: 0x20B07F0 @@ -16259,7 +16259,7 @@ arm9: description: |- A pointer to a currently unknown struct of size 0x410, with ties to kangaskhan storage. - type: struct unk_storage_struct_0x410* + type: struct unk_storage_struct_0x410* - name: NOTIFY_NOTE address: EU: 0x20B0814 diff --git a/symbols/overlay11.yml b/symbols/overlay11.yml index ef87112b..e1b0b4f1 100644 --- a/symbols/overlay11.yml +++ b/symbols/overlay11.yml @@ -2250,7 +2250,7 @@ overlay11: description: |- Tracks whether or not the recycle shop overlay is suspended. 1 if it is inactive, 0 if it is active. - type: bool + type: bool - name: WORLD_MAP_MODE address: EU: 0x2325924 diff --git a/symbols/overlay15.yml b/symbols/overlay15.yml index 0d81d36f..8a32e7f1 100644 --- a/symbols/overlay15.yml +++ b/symbols/overlay15.yml @@ -63,7 +63,7 @@ overlay15: description: |- The sole entry_point function for the duskull bank overlay. - return: undefined4 + return: undefined4 - name: DuskullBankDestructor address: EU: 0x238BA04 @@ -77,7 +77,7 @@ overlay15: description: |- The sole frame_update function for the duskull bank overlay. - return: undefined4 + return: undefined4 data: - name: BANK_MAIN_MENU_ITEMS address: @@ -97,8 +97,8 @@ overlay15: NA: 0x10 description: |- Seems to be fully unused. May be a leftover from Time/Darkness or Rescue Team? - - type: struct window_params + + type: struct window_params - name: BANK_GOLD_STATUS_WINDOW_PARAMS_2 address: EU: 0x238BBF8 @@ -110,7 +110,7 @@ overlay15: description: |- A window_params struct used by the window displaying stored and carried gold for the duskull bank. - type: struct window_params + type: struct window_params - name: BANK_ADVANCED_TEXTBOX_WINDOW_PARAMS address: EU: 0x238BC08 @@ -122,7 +122,7 @@ overlay15: description: |- A window_params struct used by the digit input advanced textbox for the duskull bank. - type: struct window_params + type: struct window_params - name: BANK_MAIN_MENU_WINDOW_PARAMS address: EU: 0x238BC18 @@ -134,7 +134,7 @@ overlay15: description: |- A window_params struct used by the main menu of the duskull bank. - type: struct window_params + type: struct window_params - name: BANK_WINDOW_PARAMS_5 address: EU: 0x238BC28 @@ -144,7 +144,7 @@ overlay15: NA: 0x10 description: |- Seems to be fully unused. May be a leftover from Time/Darkness or Rescue Team? - + type: struct window_params - name: BANK_R_CLOSE_STR address: diff --git a/symbols/overlay22.yml b/symbols/overlay22.yml index 96de54ce..e505c84f 100644 --- a/symbols/overlay22.yml +++ b/symbols/overlay22.yml @@ -122,7 +122,7 @@ overlay22: An unk_collection_menu_fn_t function used by GreenKecleonShopInitCollectionMenu. r0: uint - return: undefined4 + return: undefined4 - name: GreenKecleonShopVoidFnCollectionMenuCallback address: EU: 0x238B2B4 @@ -239,7 +239,7 @@ overlay22: An unk_collection_menu_fn_t function used by PurpleKecleonShopInitCollectionMenu. r0: uint - return: undefined4 + return: undefined4 - name: PurpleKecleonShopCollectionMenuCallback address: EU: 0x238B900 @@ -253,7 +253,7 @@ overlay22: description: |- Seems responsible for handling the majority of the frame update behavior for both kecleon shops, particularly window management. Shares this responsibility with KecleonShopSubcaseManager2. - + r0: subcase id (should eventually be an enum) - name: KecleonShopSubcaseManager2 address: @@ -261,7 +261,7 @@ overlay22: description: |- Seems responsible for handling the majority of the frame update behavior for both kecleon shops, particularly window management. Shares this responsibility with KecleonShopSubcaseManager1. - + No params. - name: RemoveInvalidKecleonShopItems address: @@ -291,7 +291,7 @@ overlay22: description: |- The sole entry_point for the kecleon shop overlay. - return: undefined4 + return: undefined4 - name: KecleonShopDestructor address: EU: 0x238E2F0 @@ -305,7 +305,7 @@ overlay22: description: |- The sole frame_update for the kecleon shop overlay. - return: undefined4 + return: undefined4 - name: KecleonShopCloseSimpleMenu address: EU: 0x238F324 @@ -341,7 +341,7 @@ overlay22: description: |- "[CR]" Used exclusively after items in green kecleon's shop that the player cannot buy/sell. - + type: string - name: SHOP_WINDOW_PARAMS_2 address: @@ -378,11 +378,11 @@ overlay22: NA: 0x238E85C JP: 0x238FDBC length: - NA: 0xC EU: 0xC - description: |- + NA: 0xC + description: |- Exclusively passed into MaybeGetUncoloredFormattedItemName and MaybeGetColoredFormattedItemName. - The exact purpose of this struct is unknown, but the only "true" bool in the table is for "Other" items. + The exact purpose of this struct is unknown, but the only "true" bool in the table is for "Other" items. - name: SHOP_MENU_ITEMS_CONFIRM address: EU: 0x238F3A8 @@ -444,7 +444,7 @@ overlay22: NA: 0x238E960 length: EU: 0x10 - NA: 0x10 + NA: 0x10 description: "Note: unverified, ported from Irdkwia's notes" - name: SHOP_WINDOW_PARAMS_5 address: @@ -452,7 +452,7 @@ overlay22: NA: 0x238E970 length: EU: 0x10 - NA: 0x10 + NA: 0x10 description: "Note: unverified, ported from Irdkwia's notes" - name: SHOP_WINDOW_PARAMS_6 address: @@ -934,4 +934,4 @@ overlay22: description: |- Seems to handle the operations of the kecleon shop, and is shared for both brothers. - type: kecleon_shop_shared_struct* + type: kecleon_shop_shared_struct* diff --git a/symbols/overlay23.yml b/symbols/overlay23.yml index b0cd1dfa..2171d632 100644 --- a/symbols/overlay23.yml +++ b/symbols/overlay23.yml @@ -19,7 +19,7 @@ overlay23: description: |- Seems responsible for handling the majority of the frame update behavior for kangaskhan storage, particularly window management. Shares this responsibility with KangaskhanStorageSubcaseManager1. - + r0: subcase id (should eventually be an enum) - name: KangaskhanStorageSubcaseManager2 address: @@ -35,7 +35,7 @@ overlay23: description: |- The sole entry_point for the kangaskhan storage overlay. - return: undefined4 + return: undefined4 - name: KangaskhanStorageDestructor address: EU: 0x238CF88 @@ -49,7 +49,7 @@ overlay23: description: |- The sole frame_update for the kangaskhan storage overlay. - return: undefined4 + return: undefined4 - name: KangaskhanStorageCloseSimpleMenu address: EU: 0x238DBD8 @@ -73,7 +73,7 @@ overlay23: description: |- Seems to iteratively remove selected items from storage, and add them to the bag. Only used when multiple items are selected. - + No params. - name: KangaskhanStorageDepositSelectedItems address: @@ -110,7 +110,7 @@ overlay23: description: |- A list of states per menu option. Enabled is 0x0 and Disabled is 0x3. Not currently known how these are used. - + type: int8_t[4] - name: STORAGE_OPTION_STATES_2 address: @@ -130,13 +130,13 @@ overlay23: NA: 0x238D2F0 JP: 0x238E8A8 length: - NA: 0xC EU: 0xC - description: |- + NA: 0xC + description: |- Exclusively passed into MaybeGetUncoloredFormattedItemName and MaybeGetColoredFormattedItemName. The exact purpose of this struct is unknown, but the only "true" bool in the table is for "Other" items. - type: bool + type: bool - name: STORAGE_MENU_ITEMS_CONFIRM address: EU: 0x238DE3C From c495f1e29e6aa8bcbb556b3c42e440c464f0cfc2 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 21 Jun 2026 20:03:15 -0400 Subject: [PATCH 107/117] Apply suggestions --- headers/data/overlay15.h | 2 +- headers/functions/arm9.h | 1 + headers/types/ground_mode/ground_mode.h | 8 ++++---- symbols/arm9.yml | 11 +++++++++++ symbols/overlay11.yml | 6 ++++++ symbols/overlay15.yml | 2 +- 6 files changed, 24 insertions(+), 6 deletions(-) diff --git a/headers/data/overlay15.h b/headers/data/overlay15.h index 375e97b4..e40272dc 100644 --- a/headers/data/overlay15.h +++ b/headers/data/overlay15.h @@ -3,7 +3,7 @@ extern struct simple_menu_id_item BANK_MAIN_MENU_ITEMS[5]; extern struct window_params BANK_WINDOW_PARAMS_1; -extern struct window_params BANK_GOLD_STATUS_WINDOW_PARAMS_2; +extern struct window_params BANK_GOLD_STATUS_WINDOW_PARAMS; extern struct window_params BANK_ADVANCED_TEXTBOX_WINDOW_PARAMS; extern struct window_params BANK_MAIN_MENU_WINDOW_PARAMS; extern struct window_params BANK_WINDOW_PARAMS_5; diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index b65396ad..a5c4e6da 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -176,6 +176,7 @@ int GetDisplayedSellPrice(struct item* item); int GetActualBuyPrice(struct item* item); int GetActualSellPrice(struct item* item); int FindItemInInventory(enum item_id item_id); +void MaybeGetFormattedItemName(char* item_name, struct item* item, bool* category_table, bool is_colored, bool space_align_non_sticky_items); int SprintfStatic(char* str, const char* format, ...); void MaybeGetUncoloredFormattedItemName(char* item_name, struct item* item, bool* category_table); void MaybeGetColoredFormattedItemName(char* item_name, struct item* item, bool* category_table); diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index 7a7c9e78..69bf3a30 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -1317,15 +1317,15 @@ struct kecleon_shop_shared_struct { undefined field_0x1; undefined field_0x2; undefined field_0x3; - int32_t - main_case_id; // As the menu is better understood, a subcase should be made for this field. + // As the menu is better understood, an enum should be made for this field. + int32_t main_case_id; bool is_green_kec; undefined field3_0x9; undefined field4_0xa; undefined field5_0xb; undefined4 field6_0xc; - int32_t - subcase_id; // As the menu is better understood, a subcase should be made for this field. + // As the menu is better understood, an enum should be made for this field. + int32_t subcase_id; undefined field8_0x14; undefined field9_0x15; undefined field10_0x16; diff --git a/symbols/arm9.yml b/symbols/arm9.yml index d718a0bf..65f728f5 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -1811,6 +1811,17 @@ arm9: r0: item_id return: inventory index + - name: MaybeGetFormattedItemName + address: + EU: 0x200D398 + description: |- + Seems to get a formatted copy of an item. + + r0: [output] name string + r1: item pointer + r2: bool table corresponding to item categories? + r3: 1 if name should be colored, 0 if not + stack[0]: 1 if should align with sticky items, 0 if not. - name: SprintfStatic address: EU: diff --git a/symbols/overlay11.yml b/symbols/overlay11.yml index e1b0b4f1..a85bd6e9 100644 --- a/symbols/overlay11.yml +++ b/symbols/overlay11.yml @@ -1765,6 +1765,8 @@ overlay11: No params. - name: LoadMissionRewardOverlay + aliases: + - LoadRecycleShopOverlay address: EU: 0x230D768 NA: 0x230CDCC @@ -2240,6 +2242,8 @@ overlay11: - name: SPINDA_CAFE_OVERLAY_STATUS address: EU: 0x23258EC + length: + EU: 0x4 description: |- Tracks whether or not the spinda cafe overlay is suspended. 1 if it is inactive, 0 if it is active. @@ -2247,6 +2251,8 @@ overlay11: - name: RECYCLE_SHOP_OVERLAY_STATUS address: EU: 0x23258F4 + length: + EU: 0x4 description: |- Tracks whether or not the recycle shop overlay is suspended. 1 if it is inactive, 0 if it is active. diff --git a/symbols/overlay15.yml b/symbols/overlay15.yml index 8a32e7f1..a3a08aa1 100644 --- a/symbols/overlay15.yml +++ b/symbols/overlay15.yml @@ -99,7 +99,7 @@ overlay15: Seems to be fully unused. May be a leftover from Time/Darkness or Rescue Team? type: struct window_params - - name: BANK_GOLD_STATUS_WINDOW_PARAMS_2 + - name: BANK_GOLD_STATUS_WINDOW_PARAMS address: EU: 0x238BBF8 NA: 0x238B08C From f083e5112c309ca768850ce636411e71d86d4d9b Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 21 Jun 2026 20:03:31 -0400 Subject: [PATCH 108/117] Update headers/functions/overlay15.h Co-authored-by: UsernameFodder <93669634+UsernameFodder@users.noreply.github.com> --- headers/functions/overlay15.h | 1 + 1 file changed, 1 insertion(+) diff --git a/headers/functions/overlay15.h b/headers/functions/overlay15.h index e7864491..ecfcb96c 100644 --- a/headers/functions/overlay15.h +++ b/headers/functions/overlay15.h @@ -1,5 +1,6 @@ #ifndef HEADERS_FUNCTIONS_OVERLAY15_H_ #define HEADERS_FUNCTIONS_OVERLAY15_H_ + void InitDuskullBankStruct(void); undefined4 DuskullBankSubcaseManager1(void); void DuskullBankSubcaseManager2(enum bank_subcase subcase); From b5f1da16816e1dcc607b51e2f1f8dbd3a57e0a98 Mon Sep 17 00:00:00 2001 From: happylappy <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 21 Jun 2026 20:07:11 -0400 Subject: [PATCH 109/117] Maybe fix syntax manually? --- headers/functions/arm9.h | 3 ++- headers/types/ground_mode/ground_mode.h | 2 +- symbols/arm9.yml | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index a5c4e6da..bb45a22b 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -176,7 +176,8 @@ int GetDisplayedSellPrice(struct item* item); int GetActualBuyPrice(struct item* item); int GetActualSellPrice(struct item* item); int FindItemInInventory(enum item_id item_id); -void MaybeGetFormattedItemName(char* item_name, struct item* item, bool* category_table, bool is_colored, bool space_align_non_sticky_items); +void MaybeGetFormattedItemName(char* item_name, struct item* item, bool* category_table, + bool is_colored, bool space_align_non_sticky_items); int SprintfStatic(char* str, const char* format, ...); void MaybeGetUncoloredFormattedItemName(char* item_name, struct item* item, bool* category_table); void MaybeGetColoredFormattedItemName(char* item_name, struct item* item, bool* category_table); diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index 69bf3a30..b78161de 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -1325,7 +1325,7 @@ struct kecleon_shop_shared_struct { undefined field5_0xb; undefined4 field6_0xc; // As the menu is better understood, an enum should be made for this field. - int32_t subcase_id; + int32_t subcase_id; undefined field8_0x14; undefined field9_0x15; undefined field10_0x16; diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 65f728f5..0e1a6eee 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -1816,7 +1816,7 @@ arm9: EU: 0x200D398 description: |- Seems to get a formatted copy of an item. - + r0: [output] name string r1: item pointer r2: bool table corresponding to item categories? From 266bc68cc912df836cbc7da11d40fb1a85922380 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 28 Jun 2026 03:40:17 -0400 Subject: [PATCH 110/117] Update overlay11.h --- headers/data/overlay11.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/headers/data/overlay11.h b/headers/data/overlay11.h index f3bc4128..4681ac6c 100644 --- a/headers/data/overlay11.h +++ b/headers/data/overlay11.h @@ -33,8 +33,8 @@ extern undefined4 OV11_STATIC_INITIALIZER; extern struct main_ground_data GROUND_STATE_PTRS; extern struct exclusive_item_requirements* EXCLUSIVE_ITEM_REQUIREMENTS_PTR; extern struct swap_shop_inventory_ptrs SWAP_SHOP_INVENTORY_PTRS; -extern bool SPINDA_CAFE_OVERLAY_STATUS; -extern bool RECYCLE_SHOP_OVERLAY_STATUS; +extern int SPINDA_CAFE_OVERLAY_STATUS; +extern int RECYCLE_SHOP_OVERLAY_STATUS; extern uint32_t WORLD_MAP_MODE; #endif From 96c5108772503c4f0abe91bcde657a087337337c Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 28 Jun 2026 03:41:55 -0400 Subject: [PATCH 111/117] Update overlay11.yml --- symbols/overlay11.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/symbols/overlay11.yml b/symbols/overlay11.yml index a85bd6e9..403e1108 100644 --- a/symbols/overlay11.yml +++ b/symbols/overlay11.yml @@ -2247,7 +2247,7 @@ overlay11: description: |- Tracks whether or not the spinda cafe overlay is suspended. 1 if it is inactive, 0 if it is active. - type: bool + type: int - name: RECYCLE_SHOP_OVERLAY_STATUS address: EU: 0x23258F4 @@ -2256,7 +2256,7 @@ overlay11: description: |- Tracks whether or not the recycle shop overlay is suspended. 1 if it is inactive, 0 if it is active. - type: bool + type: int - name: WORLD_MAP_MODE address: EU: 0x2325924 From a72b968b5717ae237054a26aed4163a2086125ad Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 28 Jun 2026 03:43:35 -0400 Subject: [PATCH 112/117] Update overlay23.yml --- symbols/overlay23.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay23.yml b/symbols/overlay23.yml index 2171d632..8033e5bc 100644 --- a/symbols/overlay23.yml +++ b/symbols/overlay23.yml @@ -136,7 +136,7 @@ overlay23: Exclusively passed into MaybeGetUncoloredFormattedItemName and MaybeGetColoredFormattedItemName. The exact purpose of this struct is unknown, but the only "true" bool in the table is for "Other" items. - type: bool + type: bool[12] - name: STORAGE_MENU_ITEMS_CONFIRM address: EU: 0x238DE3C From 322cf2a1b49f5d77e9d4a2e3bc4eb8a93d185e1a Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 28 Jun 2026 03:45:22 -0400 Subject: [PATCH 113/117] Update overlay11.h --- headers/functions/overlay11.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/headers/functions/overlay11.h b/headers/functions/overlay11.h index 0f1bded1..e5987faf 100644 --- a/headers/functions/overlay11.h +++ b/headers/functions/overlay11.h @@ -189,8 +189,8 @@ void LoadRecycleShopOverlayInit(void); void LoadRecycleShopOverlayResume(void); bool IsRecycleShopOverlaySuspended(void); void LoadCroagunkSwapShopOverlay(void); -void LoadKecleonShopOverlay(bool param_1); -void LoadKangaskhanOverlay(bool param_1); +void LoadKecleonShopOverlay(bool is_purple_kec); +void LoadKangaskhanOverlay(undefined param_1); void LoadChanseyDaycareOverlay(void); void LoadXatuAppraisalOverlay(void); void LoadMissionRewardOverlay(void); From 29836fb4f1763e8d51ceff54a34ef57ad364f982 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 28 Jun 2026 03:46:08 -0400 Subject: [PATCH 114/117] Update overlay11.h --- headers/functions/overlay11.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/functions/overlay11.h b/headers/functions/overlay11.h index e5987faf..71ffa3a9 100644 --- a/headers/functions/overlay11.h +++ b/headers/functions/overlay11.h @@ -190,7 +190,7 @@ void LoadRecycleShopOverlayResume(void); bool IsRecycleShopOverlaySuspended(void); void LoadCroagunkSwapShopOverlay(void); void LoadKecleonShopOverlay(bool is_purple_kec); -void LoadKangaskhanOverlay(undefined param_1); +void LoadKangaskhanOverlay(int param_1); void LoadChanseyDaycareOverlay(void); void LoadXatuAppraisalOverlay(void); void LoadMissionRewardOverlay(void); From 4c0814a976343a5f0f62301d52db7cc0c9b9c6cf Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 28 Jun 2026 03:50:07 -0400 Subject: [PATCH 115/117] Update overlay22.yml --- symbols/overlay22.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/symbols/overlay22.yml b/symbols/overlay22.yml index e505c84f..aba39469 100644 --- a/symbols/overlay22.yml +++ b/symbols/overlay22.yml @@ -113,7 +113,7 @@ overlay22: r0: unused r1: int - r2: uint + r2: uint32_t pointer return: item name string (buffer size 80) - name: GreenKecleonShopUnkCollectionMenuCallback address: @@ -230,7 +230,7 @@ overlay22: r0: unused r1: int - r2: uint + r2: uint32_t pointer return: item name string (buffer size 80) - name: PurpleKecleonShopUnkCollectionMenuCallback address: From 4e1e89d9bb91afd91619a95f5595cf973e81f814 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 28 Jun 2026 03:53:29 -0400 Subject: [PATCH 116/117] Update overlay23.yml --- symbols/overlay23.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay23.yml b/symbols/overlay23.yml index 8033e5bc..ce0a366b 100644 --- a/symbols/overlay23.yml +++ b/symbols/overlay23.yml @@ -65,7 +65,7 @@ overlay23: Does nothing if "KANGASKHAN_STORAGE_MENU_PTR->is_kanga_rock" is true. r0: window_id - r1: preprocessor_flags pointer + r1: preprocessor_flags r2: string_id - name: KangaskhanStorageWithdrawSelectedItems address: From 6fd9717ac55a638bbc635559cc7f6253698651cf Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 28 Jun 2026 03:54:50 -0400 Subject: [PATCH 117/117] Update arm9.yml --- symbols/arm9.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index ca0553cb..9b485e1a 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -8205,7 +8205,7 @@ arm9: Allocates a currently unknown struct of size 0x410 at UNK_STORAGE_STRUCT_0X410_PTR. May be a state case structure of some kind. Likely used by Kangaskhan Storage, or some other storage interaction menu. - r0: undefined2 + r0: undefined2 pointer r1: int return: undefined4 - name: UnkStorageStruct0x410CloseSimpleMenu