From 758f82c81e5139b9e41c60a545347c6ce0f35177 Mon Sep 17 00:00:00 2001 From: assidion2 Date: Sat, 31 Aug 2024 19:50:20 +0400 Subject: [PATCH 001/204] Couple of functions used for Magic Coat --- headers/functions/arm9.h | 4 ++-- headers/functions/overlay29.h | 3 +++ symbols/overlay29.yml | 20 ++++++++++++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 88455503..e7f31680 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -273,9 +273,9 @@ bool IsExclusiveItemIdForMonster(enum item_id item_id, enum monster_id monster_i 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(int excl_type, enum monster_id monster_id, +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, int excl_type, enum monster_id monster_id, +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 ApplyGummiBoostsToGroundMonster(struct ground_monster* ground_monster, enum item_id item_id, diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index 771ecb72..7c852530 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -883,5 +883,8 @@ void DisplayMessageInternal(int message_id, bool wait_for_input, struct portrait void OpenMenu(undefined param_1, undefined param_2, bool open_bag); int OthersMenuLoop(void); undefined OthersMenu(void); +bool GetExclusiveItemWithEffectFromBag(struct entity* entity, enum exclusive_item_effect_id effect_id, + struct item* item); +bool CanHitWithRegularAttack(struct entity* attacker, struct entity* defender); #endif diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 2542f520..41301df4 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -8641,6 +8641,26 @@ overlay29: Called when the in-dungeon "others" menu is open. Does not return until the menu is closed. return: Always 0 + - name: GetExclusiveItemWithEffectFromBag + address: + EU: 0x23100C8 + description: |- + If an exclusive item with a certain effect is present in the bag and works for the entity, returns true and copies the item struct to the address at item. Otherwise, returns false. + + r0: Entity pointer + r1: exclusive_item_effect_id enum + r2: Item pointer [output] + return: bool + - name: CanHitWithRegularAttack + address: + EU: 0x2333A08 + description: |- + Returns true if the attacker is adjacent to the defender and can hit them with a regular attack. + Notably, this check is what prevents ranged moves, moves that cut corners, etc. from being reflected by Magic Coat and Mirror Move. + + r0: Entity pointer (attacker) + r1: Entity pointer (defender) + return: bool data: - name: DUNGEON_STRUCT_SIZE address: From 4ec49626cdb3128f0a6b7bcb2744ba56600c0575 Mon Sep 17 00:00:00 2001 From: assidion2 Date: Sun, 1 Sep 2024 10:07:09 +0400 Subject: [PATCH 002/204] fix --- headers/functions/overlay29.h | 6 +++--- symbols/overlay29.yml | 40 +++++++++++++++++------------------ 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index 7c852530..608bfdb2 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -396,6 +396,8 @@ void GetPossibleAiThrownItemDirections(struct entity* entity, int ally_or_enemy, 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); @@ -643,6 +645,7 @@ int DealDamageWithType(struct entity* attacker, struct entity* defender, enum ty 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); enum weather_id GetApparentWeather(struct entity* entity); void TryWeatherFormChange(struct entity* entity); @@ -883,8 +886,5 @@ void DisplayMessageInternal(int message_id, bool wait_for_input, struct portrait void OpenMenu(undefined param_1, undefined param_2, bool open_bag); int OthersMenuLoop(void); undefined OthersMenu(void); -bool GetExclusiveItemWithEffectFromBag(struct entity* entity, enum exclusive_item_effect_id effect_id, - struct item* item); -bool CanHitWithRegularAttack(struct entity* attacker, struct entity* defender); #endif diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 41301df4..012f7e51 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -4045,6 +4045,16 @@ overlay29: Used both for enemies and team members. r0: entity pointer + - name: GetExclusiveItemWithEffectFromBag + address: + EU: 0x23100C8 + description: |- + If an exclusive item with a certain effect is present in the bag and works for the entity, returns true and copies the item struct to the address at item. Otherwise, returns false. + + r0: Entity pointer + r1: exclusive_item_effect_id enum + r2: [output] Item pointer + return: bool - name: AuraBowIsActive address: EU: 0x231013C @@ -6290,6 +6300,16 @@ overlay29: r3: [output] struct containing info about the damage calculation stack[0]: Damage source return: Calculated damage + - name: CanHitWithRegularAttack + address: + EU: 0x2333A08 + description: |- + Returns true if the defender is adjacent to the attacker and can hit them with a regular attack. + Notably, this check is what prevents ranged moves, moves that cut corners, etc. from being reflected by Magic Coat and Mirror Move. + + r0: Entity pointer (attacker) + r1: Entity pointer (defender) + return: bool - name: StatusCheckerCheck address: EU: 0x2333AB4 @@ -8641,26 +8661,6 @@ overlay29: Called when the in-dungeon "others" menu is open. Does not return until the menu is closed. return: Always 0 - - name: GetExclusiveItemWithEffectFromBag - address: - EU: 0x23100C8 - description: |- - If an exclusive item with a certain effect is present in the bag and works for the entity, returns true and copies the item struct to the address at item. Otherwise, returns false. - - r0: Entity pointer - r1: exclusive_item_effect_id enum - r2: Item pointer [output] - return: bool - - name: CanHitWithRegularAttack - address: - EU: 0x2333A08 - description: |- - Returns true if the attacker is adjacent to the defender and can hit them with a regular attack. - Notably, this check is what prevents ranged moves, moves that cut corners, etc. from being reflected by Magic Coat and Mirror Move. - - r0: Entity pointer (attacker) - r1: Entity pointer (defender) - return: bool data: - name: DUNGEON_STRUCT_SIZE address: From 42850f4b18f5cab6e7f69c644d7e8d6a5909c98f Mon Sep 17 00:00:00 2001 From: assidion2 Date: Sun, 1 Sep 2024 10:47:47 +0400 Subject: [PATCH 003/204] format --- headers/functions/arm9.h | 4 ++-- headers/functions/overlay29.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index e7f31680..b0447394 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -275,8 +275,8 @@ bool IsExclusiveItemForMonster(struct item* item, enum monster_id monster_id, en 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); +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 ApplyGummiBoostsToGroundMonster(struct ground_monster* ground_monster, enum item_id item_id, bool not_boost_stats, struct gummi_result* gummi_result); diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index 608bfdb2..fed50894 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -396,7 +396,8 @@ void GetPossibleAiThrownItemDirections(struct entity* entity, int ally_or_enemy, 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, +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); From 2d2a498e916f1deac96a47422d1fd138fb6ef0a0 Mon Sep 17 00:00:00 2001 From: assidion2 Date: Sun, 1 Sep 2024 10:50:00 +0400 Subject: [PATCH 004/204] format --- headers/functions/arm9.h | 2 +- headers/functions/overlay29.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index b0447394..eee5721b 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -275,7 +275,7 @@ bool IsExclusiveItemForMonster(struct item* item, enum monster_id monster_id, en 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, +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 ApplyGummiBoostsToGroundMonster(struct ground_monster* ground_monster, enum item_id item_id, diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index fed50894..a96a433d 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -396,7 +396,7 @@ void GetPossibleAiThrownItemDirections(struct entity* entity, int ally_or_enemy, 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, +bool GetExclusiveItemWithEffectFromBag(struct entity* entity, enum exclusive_item_effect_id effect_id, struct item* item); bool AuraBowIsActive(struct entity* entity); From a43f9a8d66a1f478fd014fa2749dc9bfd2bc28d5 Mon Sep 17 00:00:00 2001 From: assidion2 Date: Sun, 1 Sep 2024 10:53:19 +0400 Subject: [PATCH 005/204] test --- headers/functions/arm9.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index eee5721b..854bd34c 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -273,7 +273,8 @@ bool IsExclusiveItemIdForMonster(enum item_id item_id, enum monster_id monster_i 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 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); From 95e7bcc2ca6feb21455fcdcd6a62a37f3ab52a55 Mon Sep 17 00:00:00 2001 From: assidion2 Date: Sun, 1 Sep 2024 22:39:27 +0400 Subject: [PATCH 006/204] format --- headers/functions/arm9.h | 9 +++++---- headers/functions/overlay29.h | 3 +-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 854bd34c..e2fce384 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -273,11 +273,12 @@ bool IsExclusiveItemIdForMonster(enum item_id item_id, enum monster_id monster_i 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); +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); + enum monster_id monster_id, enum type_id type1, + enum type_id type2); int GetHpBoostFromExclusiveItems(undefined* param_1); void ApplyGummiBoostsToGroundMonster(struct ground_monster* ground_monster, enum item_id item_id, bool not_boost_stats, struct gummi_result* gummi_result); diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index a96a433d..dc98ceb0 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -397,8 +397,7 @@ void GetPossibleAiArcItemTargets(struct entity* user, struct item* item, struct bool always_add_position); void TryNonLeaderItemPickUp(struct entity* entity); bool GetExclusiveItemWithEffectFromBag(struct entity* entity, - enum exclusive_item_effect_id effect_id, - struct item* item); + 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); From 8c14d2daf53f972b882de295a988f6a4dbe9e33c Mon Sep 17 00:00:00 2001 From: assidion2 Date: Mon, 2 Sep 2024 20:44:38 +0400 Subject: [PATCH 007/204] Some hidden stairs functions --- headers/functions/overlay29.h | 6 +++++- symbols/overlay29.yml | 36 +++++++++++++++++++++++++++++++++-- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index dc98ceb0..457d697e 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -695,8 +695,12 @@ bool IsSecretRoom(void); bool IsSecretFloor(void); enum hidden_stairs_type GetCurrentHiddenStairsType(void); bool HiddenStairsPresent(void); +bool PositionIsOnHiddenStairs(struct position* position) void HiddenStairsTrigger(bool show_message); -undefined4 GetDungeonGenInfoUnk0C(void); +enum hidden_stairs_type GetHiddenStairsType(void); +void SetHiddenStairsType(enum hidden_stairs_type); +enum hidden_stairs_type GetHiddenFloorType(void); +void SetHiddenFloorType(enum hidden_stairs_type); struct minimap_display_data* GetMinimapData(void); void DrawMinimapTile(int x, int y); void UpdateMinimap(void); diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 012f7e51..841acf88 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -6786,6 +6786,14 @@ overlay29: The function checks that dungeon_generation_info::hidden_stairs_pos isn't (-1, -1) return: True if the hidden stairs are present on this floor, false otherwise. + - name: PositionIsOnHiddenStairs + address: + EU: 0x23392D8 + description: |- + Checks if this location is on top of the hidden stairs. + + r0: position pointer + return: bool - name: HiddenStairsTrigger address: EU: 0x2339364 @@ -6797,12 +6805,36 @@ overlay29: If the stairs hadn't been revealed yet, plays the corresponding animation. r0: True to display a message if the stairs are revealed, false to omit it. - - name: GetDungeonGenInfoUnk0C + - name: GetHiddenStairsType + address: + EU: 0x2339420 + description: |- + Gets the hidden_stairs_type variable from dungeon::gen_info. + + return: hidden_stairs_type + - name: SetHiddenStairsType + address: + EU: 0x2339438 + description: |- + Sets the hidden_stairs_type variable from dungeon::gen_info to a certain value. + + r0: New value + - name: GetHiddenFloorType address: EU: 0x2339450 NA: 0x2338880 JP: 0x2339C44 - description: "return: dungeon_generation_info::field_0xc" + description: |- + Gets the hidden_floor_type variable from dungeon::gen_info. + + return: hidden_stairs_type + - name: SetHiddenFloorType + address: + EU: 0x2339468 + description: |- + Sets the hidden_floor_type variable from dungeon::gen_info to a certain value. + + r0: New value - name: GetMinimapData address: EU: 0x2339CE8 From 13ccebee3b2570cf2a0684d5a543080d0ca1a8b4 Mon Sep 17 00:00:00 2001 From: assidion Date: Mon, 2 Sep 2024 20:50:37 +0400 Subject: [PATCH 008/204] ; --- 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 457d697e..1ab48cbe 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -695,7 +695,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 GetHiddenStairsType(void); void SetHiddenStairsType(enum hidden_stairs_type); From 325874c17ecfcf0d6a9ece6dbc42d8ff55d71ce0 Mon Sep 17 00:00:00 2001 From: assidion Date: Mon, 2 Sep 2024 20:56:34 +0400 Subject: [PATCH 009/204] rename --- headers/functions/overlay29.h | 8 ++++---- symbols/overlay29.yml | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index 1ab48cbe..130253a8 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -697,10 +697,10 @@ enum hidden_stairs_type GetCurrentHiddenStairsType(void); bool HiddenStairsPresent(void); bool PositionIsOnHiddenStairs(struct position* position); void HiddenStairsTrigger(bool show_message); -enum hidden_stairs_type GetHiddenStairsType(void); -void SetHiddenStairsType(enum hidden_stairs_type); -enum hidden_stairs_type GetHiddenFloorType(void); -void SetHiddenFloorType(enum hidden_stairs_type); +enum hidden_stairs_type GetHiddenStairsField(void); +void SetHiddenStairsField(enum hidden_stairs_type); +enum hidden_stairs_type GetHiddenFloorField(void); +void SetHiddenFloorField(enum hidden_stairs_type); struct minimap_display_data* GetMinimapData(void); void DrawMinimapTile(int x, int y); void UpdateMinimap(void); diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 71dbab9b..d64fd787 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -6809,34 +6809,34 @@ overlay29: If the stairs hadn't been revealed yet, plays the corresponding animation. r0: True to display a message if the stairs are revealed, false to omit it. - - name: GetHiddenStairsType + - name: GetHiddenStairsField address: EU: 0x2339420 description: |- - Gets the hidden_stairs_type variable from dungeon::gen_info. + Gets the hidden_stairs_type variable from dungeon::dungeon_generation_info. return: hidden_stairs_type - - name: SetHiddenStairsType + - name: SetHiddenStairsField address: EU: 0x2339438 description: |- - Sets the hidden_stairs_type variable from dungeon::gen_info to a certain value. + Sets the hidden_stairs_type variable from dungeon::dungeon_generation_info to a certain value. r0: New value - - name: GetHiddenFloorType + - name: GetHiddenFloorField address: EU: 0x2339450 NA: 0x2338880 JP: 0x2339C44 description: |- - Gets the hidden_floor_type variable from dungeon::gen_info. + Gets the hidden_floor_type variable from dungeon::dungeon_generation_info. return: hidden_stairs_type - - name: SetHiddenFloorType + - name: SetHiddenFloorField address: EU: 0x2339468 description: |- - Sets the hidden_floor_type variable from dungeon::gen_info to a certain value. + Sets the hidden_floor_type variable from dungeon::dungeon_generation_info to a certain value. r0: New value - name: GetMinimapData From e073de436f7bbbb72d4f1473338902952f30eae3 Mon Sep 17 00:00:00 2001 From: assidion Date: Mon, 2 Sep 2024 20:57:43 +0400 Subject: [PATCH 010/204] test --- symbols/overlay29.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index d64fd787..76e02760 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -6809,7 +6809,7 @@ overlay29: If the stairs hadn't been revealed yet, plays the corresponding animation. r0: True to display a message if the stairs are revealed, false to omit it. - - name: GetHiddenStairsField + - name: GetHiddenStairsField address: EU: 0x2339420 description: |- From 539234138f2e24b71d5d6a988446671505a97ffe Mon Sep 17 00:00:00 2001 From: assidion Date: Mon, 2 Sep 2024 21:02:22 +0400 Subject: [PATCH 011/204] format --- symbols/overlay29.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 76e02760..b59e1194 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -6815,7 +6815,7 @@ overlay29: description: |- Gets the hidden_stairs_type variable from dungeon::dungeon_generation_info. - return: hidden_stairs_type + return: enum hidden_stairs_type - name: SetHiddenStairsField address: EU: 0x2339438 @@ -6831,7 +6831,7 @@ overlay29: description: |- Gets the hidden_floor_type variable from dungeon::dungeon_generation_info. - return: hidden_stairs_type + return: enum hidden_stairs_type - name: SetHiddenFloorField address: EU: 0x2339468 From b4bb64ed219c7986958115831b0ec86c13e0cfa3 Mon Sep 17 00:00:00 2001 From: UsernameFodder Date: Mon, 2 Sep 2024 13:00:22 -0500 Subject: [PATCH 012/204] format --- symbols/overlay29.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index b59e1194..512afdda 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -6814,14 +6814,14 @@ overlay29: EU: 0x2339420 description: |- Gets the hidden_stairs_type variable from dungeon::dungeon_generation_info. - + return: enum hidden_stairs_type - name: SetHiddenStairsField address: EU: 0x2339438 description: |- Sets the hidden_stairs_type variable from dungeon::dungeon_generation_info to a certain value. - + r0: New value - name: GetHiddenFloorField address: @@ -6830,14 +6830,14 @@ overlay29: JP: 0x2339C44 description: |- Gets the hidden_floor_type variable from dungeon::dungeon_generation_info. - + return: enum hidden_stairs_type - name: SetHiddenFloorField address: EU: 0x2339468 description: |- Sets the hidden_floor_type variable from dungeon::dungeon_generation_info to a certain value. - + r0: New value - name: GetMinimapData address: From fb848769f32c9ab37f865632b53f12726534cfad Mon Sep 17 00:00:00 2001 From: UsernameFodder Date: Mon, 2 Sep 2024 13:02:51 -0500 Subject: [PATCH 013/204] Add param names to prototypes --- 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 130253a8..98548c29 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -698,9 +698,9 @@ bool HiddenStairsPresent(void); bool PositionIsOnHiddenStairs(struct position* position); void HiddenStairsTrigger(bool show_message); enum hidden_stairs_type GetHiddenStairsField(void); -void SetHiddenStairsField(enum hidden_stairs_type); +void SetHiddenStairsField(enum hidden_stairs_type hidden_stairs); enum hidden_stairs_type GetHiddenFloorField(void); -void SetHiddenFloorField(enum hidden_stairs_type); +void SetHiddenFloorField(enum hidden_stairs_type hidden_floor); struct minimap_display_data* GetMinimapData(void); void DrawMinimapTile(int x, int y); void UpdateMinimap(void); From 81ffc755741d8038268b3bc687204c286f17ba14 Mon Sep 17 00:00:00 2001 From: assidion Date: Fri, 6 Sep 2024 18:56:22 +0400 Subject: [PATCH 014/204] Monster initialization functions --- headers/functions/overlay29.h | 2 ++ symbols/overlay29.yml | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index 98548c29..1ac75d7e 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -34,6 +34,7 @@ bool ShouldDisplayEntityWrapper(struct entity* entity); bool CanSeeTarget(struct entity* user, struct entity* target); bool CanTargetEntity(struct entity* user, struct entity* target); bool CanTargetPosition(struct entity* monster, struct position* position); +void PopulateActiveMonsterPtrs(); int GetTeamMemberIndex(struct entity* monster); void SubstitutePlaceholderStringTags(int string_id, struct entity* entity, undefined4 param_3); bool UpdateMapSurveyorFlag(void); @@ -55,6 +56,7 @@ void PlayEffectAnimation0x1A9(struct entity* entity); void PlayEffectAnimation0x18E(struct entity* entity); void LoadMappaFileAttributes(int quick_saved, bool disable_monsters, undefined* special_process); enum item_id GetItemIdToSpawn(enum item_list_type item_list); +int CopySpawnEntriesMaster(struct monster_spawn_entry* spawn_entries, int offset); int MonsterSpawnListPartialCopy(struct monster_spawn_entry* buffer, int current_buffer_entries); bool IsOnMonsterSpawnList(enum monster_id monster_id); enum monster_id GetMonsterIdToSpawn(int spawn_weight); diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index ffcce099..bcf8d90b 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -492,6 +492,11 @@ overlay29: r0: Entity pointer r1: Target position return: True if the specified monster can target the target position, false otherwise. + - name: PopulateActiveMonsterPtrs + address: + EU: 0x22E32B8 + description: |- + Populates active_monster_ptrs with all valid monsters in the monster_slot_headers array. - name: GetTeamMemberIndex address: EU: 0x22E3378 @@ -770,6 +775,15 @@ overlay29: r0: Which item list to use return: Item ID + - name: CopySpawnEntriesMaster + address: + EU: 0x22E8598 + description: |- + Copies the array at spawn_entries_master, starting from offset, to spawn_entries and returns the size. + + r0: [output] Size 16 monster_spawn_entry array + r1: Offset (always 0 in practice) + return: int - name: MonsterSpawnListPartialCopy address: EU: 0x22E8610 From d5565bd0dbc8406febf23180cb20c519aca55ce4 Mon Sep 17 00:00:00 2001 From: assidion Date: Fri, 6 Sep 2024 18:58:26 +0400 Subject: [PATCH 015/204] format --- symbols/overlay29.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index bcf8d90b..c832b60b 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -495,8 +495,7 @@ overlay29: - name: PopulateActiveMonsterPtrs address: EU: 0x22E32B8 - description: |- - Populates active_monster_ptrs with all valid monsters in the monster_slot_headers array. + description: Populates active_monster_ptrs with all valid monsters in the monster_slot_headers array. - name: GetTeamMemberIndex address: EU: 0x22E3378 From 06ad07abe6fe36a05558c890e2bce0bfd31a3001 Mon Sep 17 00:00:00 2001 From: assidion Date: Fri, 6 Sep 2024 19:00:03 +0400 Subject: [PATCH 016/204] desc --- symbols/overlay29.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index c832b60b..2af35ea1 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -778,7 +778,7 @@ overlay29: address: EU: 0x22E8598 description: |- - Copies the array at spawn_entries_master, starting from offset, to spawn_entries and returns the size. + Copies the array at spawn_entries_master, starting from offset, to spawn_entries and returns the number of elements copied. r0: [output] Size 16 monster_spawn_entry array r1: Offset (always 0 in practice) From 529d5020dd646282d789eb23bc0b4eab2fa2cfb3 Mon Sep 17 00:00:00 2001 From: assidion2 Date: Sat, 7 Sep 2024 08:10:07 +0400 Subject: [PATCH 017/204] Update headers/functions/overlay29.h Co-authored-by: UsernameFodder <93669634+UsernameFodder@users.noreply.github.com> --- 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 1ac75d7e..84039493 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -34,7 +34,7 @@ bool ShouldDisplayEntityWrapper(struct entity* entity); bool CanSeeTarget(struct entity* user, struct entity* target); bool CanTargetEntity(struct entity* user, struct entity* target); bool CanTargetPosition(struct entity* monster, struct position* position); -void PopulateActiveMonsterPtrs(); +void PopulateActiveMonsterPtrs(void); int GetTeamMemberIndex(struct entity* monster); void SubstitutePlaceholderStringTags(int string_id, struct entity* entity, undefined4 param_3); bool UpdateMapSurveyorFlag(void); From 32d31fc6e6602cdac2b44198a7f7c82c16af3aac Mon Sep 17 00:00:00 2001 From: assidion2 Date: Sat, 7 Sep 2024 08:10:18 +0400 Subject: [PATCH 018/204] Update symbols/overlay29.yml Co-authored-by: UsernameFodder <93669634+UsernameFodder@users.noreply.github.com> --- symbols/overlay29.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 2af35ea1..ba04c296 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -495,7 +495,10 @@ overlay29: - name: PopulateActiveMonsterPtrs address: EU: 0x22E32B8 - description: Populates active_monster_ptrs with all valid monsters in the monster_slot_headers array. + description: |- + Populates active_monster_ptrs with all valid monsters in the monster_slot_headers array. + + No params. - name: GetTeamMemberIndex address: EU: 0x22E3378 From 112304c28a401891498bba4095e73a0a8d042e70 Mon Sep 17 00:00:00 2001 From: assidion Date: Sat, 7 Sep 2024 11:06:26 +0400 Subject: [PATCH 019/204] format --- symbols/overlay29.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 2af35ea1..c281300f 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -779,7 +779,7 @@ overlay29: EU: 0x22E8598 description: |- Copies the array at spawn_entries_master, starting from offset, to spawn_entries and returns the number of elements copied. - + r0: [output] Size 16 monster_spawn_entry array r1: Offset (always 0 in practice) return: int From 2c83d2c1a96787ff51acbfece33fbcf004bbd4eb Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 24 Sep 2024 00:00:07 +0400 Subject: [PATCH 020/204] Animation research + misc. --- headers/functions/overlay29.h | 1 + headers/types/dungeon_mode/dungeon_mode.h | 8 ++++---- symbols/overlay10.yml | 1 + symbols/overlay29.yml | 10 +++++++++- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index 84039493..3963ceea 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -52,6 +52,7 @@ void UpdateStatusIconFlags(struct entity* entity); void PlayEffectAnimation0x171Full(struct entity* entity); void PlayEffectAnimation0x171(struct entity* entity); void ShowPpRestoreEffect(struct entity* entity); +bool ShouldDisplayEntityAdvanced(struct entity* entity); void PlayEffectAnimation0x1A9(struct entity* entity); void PlayEffectAnimation0x18E(struct entity* entity); void LoadMappaFileAttributes(int quick_saved, bool disable_monsters, undefined* special_process); diff --git a/headers/types/dungeon_mode/dungeon_mode.h b/headers/types/dungeon_mode/dungeon_mode.h index b3986ea5..02d436cd 100644 --- a/headers/types/dungeon_mode/dungeon_mode.h +++ b/headers/types/dungeon_mode/dungeon_mode.h @@ -483,11 +483,11 @@ struct monster { // or when using the Gone Pebble? Also hardcoded to be set to 0 for monsters that generally // tend to float? Otherwise 1? bool field_0x171; - // 0x172: Set when the leader and falling through a pitfall trap. + // 0x172: Set when the leader and falling through a pitfall trap. If both this and pitfall_trap_flag_0x174 are set, the sprite will disappear. bool pitfall_trap_flag_0x172; // 0x173: Some kind of visual flag? bool field_0x173; - // 0x174: Set when the leader and falling through a pitfall trap. + // 0x174: Set when the leader and falling through a pitfall trap. If both this and pitfall_trap_flag_0x172 are set, the sprite will disappear. bool pitfall_trap_flag_0x174; undefined field_0x175; undefined field_0x176; @@ -533,7 +533,7 @@ struct monster { undefined field_0x199; undefined field_0x19a; undefined field_0x19b; - struct position pos; // 0x19C: Mirror of the position on the entity struct + struct position pos; // 0x19C: Mirror of the position on the entity struct. Is not updated properly in certain cases, such as in MoveMonsterToPos. undefined field_0x1a0; undefined field_0x1a1; undefined field_0x1a2; @@ -1247,7 +1247,7 @@ struct effect_animation { int field_0x14; uint8_t field_0x18; int8_t field_0x19; - uint8_t field_0x1a; + uint8_t is_non_blocking; // Is non-zero if the animation is non-blocking. In this case, the animation will be delayed until the next time AnimationDelayOrSomething is called. uint8_t field_0x1b; }; ASSERT_SIZE(struct effect_animation, 28); diff --git a/symbols/overlay10.yml b/symbols/overlay10.yml index 5dc8cd6b..4d210376 100644 --- a/symbols/overlay10.yml +++ b/symbols/overlay10.yml @@ -149,6 +149,7 @@ overlay10: JP: 0x22C10A8 description: |- Just a guess. This is called in a loop in PlayEffectAnimation, and the output controls whether or not AdvanceFrame continues to be called. + If the current effect animation's is_non_blocking field is set, the function will return false the very first time it is called. r0: ? return: whether or not the animation still has more frames left? diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 91f3b9af..d4bd876d 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -717,6 +717,14 @@ overlay29: Displays the graphical effect on a monster that just recovered PP. r0: entity pointer + - name: ShouldDisplayEntityAdvanced + address: + EU: 0x22E6880 + description: |- + Returns whether or not the entity should be displayed, using the same checks as ShouldDisplayEntity except also checking whether it is visible and whether the camera entity is blinded. + + r0: entity pointer + return: bool - name: PlayEffectAnimation0x1A9 address: EU: @@ -2935,7 +2943,7 @@ overlay29: description: |- Returns 0 if none of these conditions holds for the given entity: blinded (checked only if blind_check == 1), - asleep, paused, infatuated, wrapping, wrapped, biding, petrified, or terrified. + asleep, frozen, paused, infatuated, wrapping, wrapped, biding, petrified, or terrified. r0: Entity pointer r1: If true, return 1 if entity is blinded From 2c9509ef792a2945af80fa25648baba631f04a92 Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 24 Sep 2024 10:52:53 +0400 Subject: [PATCH 021/204] comment length fix --- headers/types/dungeon_mode/dungeon_mode.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/headers/types/dungeon_mode/dungeon_mode.h b/headers/types/dungeon_mode/dungeon_mode.h index 02d436cd..c811699b 100644 --- a/headers/types/dungeon_mode/dungeon_mode.h +++ b/headers/types/dungeon_mode/dungeon_mode.h @@ -483,11 +483,13 @@ struct monster { // or when using the Gone Pebble? Also hardcoded to be set to 0 for monsters that generally // tend to float? Otherwise 1? bool field_0x171; - // 0x172: Set when the leader and falling through a pitfall trap. If both this and pitfall_trap_flag_0x174 are set, the sprite will disappear. + // 0x172: Set when the leader and falling through a pitfall trap. If both this + // and pitfall_trap_flag_0x174 are set, the sprite will disappear. bool pitfall_trap_flag_0x172; // 0x173: Some kind of visual flag? bool field_0x173; - // 0x174: Set when the leader and falling through a pitfall trap. If both this and pitfall_trap_flag_0x172 are set, the sprite will disappear. + // 0x174: Set when the leader and falling through a pitfall trap. If both this + // and pitfall_trap_flag_0x172 are set, the sprite will disappear. bool pitfall_trap_flag_0x174; undefined field_0x175; undefined field_0x176; @@ -533,7 +535,8 @@ struct monster { undefined field_0x199; undefined field_0x19a; undefined field_0x19b; - struct position pos; // 0x19C: Mirror of the position on the entity struct. Is not updated properly in certain cases, such as in MoveMonsterToPos. + struct position pos; // 0x19C: Mirror of the position on the entity struct. Is not + // updated properly in certain cases, such as in MoveMonsterToPos. undefined field_0x1a0; undefined field_0x1a1; undefined field_0x1a2; @@ -1247,7 +1250,8 @@ struct effect_animation { int field_0x14; uint8_t field_0x18; int8_t field_0x19; - uint8_t is_non_blocking; // Is non-zero if the animation is non-blocking. In this case, the animation will be delayed until the next time AnimationDelayOrSomething is called. + uint8_t is_non_blocking; // Is non-zero if the animation is non-blocking. In this case, + // the animation will be delayed until the next time AnimationDelayOrSomething is called. uint8_t field_0x1b; }; ASSERT_SIZE(struct effect_animation, 28); From 0a9d808900d0040bbbb1ee3c25c5fe704c9fdfaf Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 24 Sep 2024 10:53:47 +0400 Subject: [PATCH 022/204] comment length fix --- headers/types/dungeon_mode/dungeon_mode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/types/dungeon_mode/dungeon_mode.h b/headers/types/dungeon_mode/dungeon_mode.h index c811699b..2f91fd57 100644 --- a/headers/types/dungeon_mode/dungeon_mode.h +++ b/headers/types/dungeon_mode/dungeon_mode.h @@ -535,7 +535,7 @@ struct monster { undefined field_0x199; undefined field_0x19a; undefined field_0x19b; - struct position pos; // 0x19C: Mirror of the position on the entity struct. Is not + struct position pos; // 0x19C: Mirror of the position on the entity struct. Is not // updated properly in certain cases, such as in MoveMonsterToPos. undefined field_0x1a0; undefined field_0x1a1; From ec37bf638cf529371a0a22e0b6caacd067ff5120 Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 24 Sep 2024 23:18:19 +0400 Subject: [PATCH 023/204] some more fields --- headers/types/dungeon_mode/dungeon_mode.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/headers/types/dungeon_mode/dungeon_mode.h b/headers/types/dungeon_mode/dungeon_mode.h index 2f91fd57..f7b13a67 100644 --- a/headers/types/dungeon_mode/dungeon_mode.h +++ b/headers/types/dungeon_mode/dungeon_mode.h @@ -1243,16 +1243,18 @@ ASSERT_SIZE(struct trap_animation, 2); // Unverified, ported from Irdkwia's notes struct effect_animation { int field_0x0; - int field_0x4; + int file_index; // 0x4: File index in pack 3 (effect.bin) int field_0x8; - int field_0xc; - int field_0x10; + int animation_index; // 0xC: Some sort of index into the file. Related animations are + // grouped together into the same file and indexed with this. Is used as the + // animation_id parameter in SetAnimationForAnimationControlInternal. + int se_id; // 0x10: Sound effect id, passed to PlaySeByIdVolume int field_0x14; uint8_t field_0x18; int8_t field_0x19; - uint8_t is_non_blocking; // Is non-zero if the animation is non-blocking. In this case, + uint8_t is_non_blocking; // 0x1A: Is non-zero if the animation is non-blocking. In this case, // the animation will be delayed until the next time AnimationDelayOrSomething is called. - uint8_t field_0x1b; + uint8_t unk_repeat; // 0x1B: If non-zero, makes the animation repeat a bunch of times }; ASSERT_SIZE(struct effect_animation, 28); From eefe0d8da5de54c6452b7182a6e3d8dd1695a310 Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 24 Sep 2024 23:20:22 +0400 Subject: [PATCH 024/204] some more fields --- headers/types/dungeon_mode/dungeon_mode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/types/dungeon_mode/dungeon_mode.h b/headers/types/dungeon_mode/dungeon_mode.h index f7b13a67..0954f969 100644 --- a/headers/types/dungeon_mode/dungeon_mode.h +++ b/headers/types/dungeon_mode/dungeon_mode.h @@ -1247,7 +1247,7 @@ struct effect_animation { int field_0x8; int animation_index; // 0xC: Some sort of index into the file. Related animations are // grouped together into the same file and indexed with this. Is used as the - // animation_id parameter in SetAnimationForAnimationControlInternal. + // animation_key parameter in SetAnimationForAnimationControl. int se_id; // 0x10: Sound effect id, passed to PlaySeByIdVolume int field_0x14; uint8_t field_0x18; From 5ad6a36ada65ddd5c4efaa02cea9d7b5e0eb711d Mon Sep 17 00:00:00 2001 From: UsernameFodder Date: Tue, 24 Sep 2024 22:41:34 -0500 Subject: [PATCH 025/204] format --- headers/types/dungeon_mode/dungeon_mode.h | 25 +++++++++++++---------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/headers/types/dungeon_mode/dungeon_mode.h b/headers/types/dungeon_mode/dungeon_mode.h index 0954f969..948cfaa8 100644 --- a/headers/types/dungeon_mode/dungeon_mode.h +++ b/headers/types/dungeon_mode/dungeon_mode.h @@ -483,13 +483,13 @@ struct monster { // or when using the Gone Pebble? Also hardcoded to be set to 0 for monsters that generally // tend to float? Otherwise 1? bool field_0x171; - // 0x172: Set when the leader and falling through a pitfall trap. If both this - // and pitfall_trap_flag_0x174 are set, the sprite will disappear. + // 0x172: Set when the leader and falling through a pitfall trap. + // If both this and pitfall_trap_flag_0x174 are set, the sprite will disappear. bool pitfall_trap_flag_0x172; // 0x173: Some kind of visual flag? bool field_0x173; - // 0x174: Set when the leader and falling through a pitfall trap. If both this - // and pitfall_trap_flag_0x172 are set, the sprite will disappear. + // 0x174: Set when the leader and falling through a pitfall trap. + // If both this and pitfall_trap_flag_0x172 are set, the sprite will disappear. bool pitfall_trap_flag_0x174; undefined field_0x175; undefined field_0x176; @@ -535,8 +535,9 @@ struct monster { undefined field_0x199; undefined field_0x19a; undefined field_0x19b; - struct position pos; // 0x19C: Mirror of the position on the entity struct. Is not - // updated properly in certain cases, such as in MoveMonsterToPos. + // 0x19C: Mirror of the position on the entity struct. + // Is not updated properly in certain cases, such as in MoveMonsterToPos. + struct position pos; undefined field_0x1a0; undefined field_0x1a1; undefined field_0x1a2; @@ -1245,15 +1246,17 @@ struct effect_animation { int field_0x0; int file_index; // 0x4: File index in pack 3 (effect.bin) int field_0x8; - int animation_index; // 0xC: Some sort of index into the file. Related animations are - // grouped together into the same file and indexed with this. Is used as the - // animation_key parameter in SetAnimationForAnimationControl. + // 0xC: Some sort of index into the file. Related animations are grouped together into the same + // file and indexed with this. Is used as the animation_key parameter in + // SetAnimationForAnimationControl. + int animation_index; int se_id; // 0x10: Sound effect id, passed to PlaySeByIdVolume int field_0x14; uint8_t field_0x18; int8_t field_0x19; - uint8_t is_non_blocking; // 0x1A: Is non-zero if the animation is non-blocking. In this case, - // the animation will be delayed until the next time AnimationDelayOrSomething is called. + // 0x1A: Is non-zero if the animation is non-blocking. In this case, the animation will be + // delayed until the next time AnimationDelayOrSomething is called. + uint8_t is_non_blocking; uint8_t unk_repeat; // 0x1B: If non-zero, makes the animation repeat a bunch of times }; ASSERT_SIZE(struct effect_animation, 28); From 2f9daa2b5d8f52c249550bf49f65f01c687f2f83 Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 1 Oct 2024 15:31:11 +0400 Subject: [PATCH 026/204] Overlay31 research --- headers/data/overlay31.h | 1 + headers/functions/overlay31.h | 3 +++ headers/types/common/enums.h | 8 ++++++++ headers/types/common/window.h | 14 ++++++++++++++ symbols/overlay29.yml | 2 +- symbols/overlay31.yml | 32 ++++++++++++++++++++++++++++++++ 6 files changed, 59 insertions(+), 1 deletion(-) diff --git a/headers/data/overlay31.h b/headers/data/overlay31.h index 334836e5..2f860e46 100644 --- a/headers/data/overlay31.h +++ b/headers/data/overlay31.h @@ -40,5 +40,6 @@ extern struct window_params DUNGEON_WINDOW_PARAMS_29; extern struct window_params DUNGEON_WINDOW_PARAMS_30; extern struct window_params DUNGEON_WINDOW_PARAMS_31; extern struct window_params DUNGEON_WINDOW_PARAMS_32; +extern struct stairs_menu* STAIRS_MENU_PTR; #endif diff --git a/headers/functions/overlay31.h b/headers/functions/overlay31.h index e5ae250c..8d76f315 100644 --- a/headers/functions/overlay31.h +++ b/headers/functions/overlay31.h @@ -4,6 +4,9 @@ void EntryOverlay31(void); void DrawDungeonMenuStatusWindow(int param_1); void DungeonMenuSwitch(int idx); +void CreateStairsMenuState(struct entity* entity); +void StairsSubheadingCallback(int window_id); +int HandleStairsMenu(void); void MovesMenu(struct action_data* action); bool HandleMovesMenuWrapper0(undefined* param_1, undefined param_2, undefined param_3, int monster_index); diff --git a/headers/types/common/enums.h b/headers/types/common/enums.h index dbdad77e..ccf7cba3 100644 --- a/headers/types/common/enums.h +++ b/headers/types/common/enums.h @@ -3894,6 +3894,14 @@ enum item_flag { ITEM_FLAG_THROWABLE_AT_ENEMY = 2, }; +// Type of stairs +enum stairs_type { + STAIRS_TYPE_NORMAL = 0, + STAIRS_TYPE_WARP_ZONE = 1, + STAIRS_TYPE_RESCUE_POINT = 2, + STAIRS_TYPE_HIDDEN = 3, +}; + #pragma pack(push, 1) ENUM_8_BIT(box_type); #pragma pack(pop) diff --git a/headers/types/common/window.h b/headers/types/common/window.h index 3e5935a0..81f832b3 100644 --- a/headers/types/common/window.h +++ b/headers/types/common/window.h @@ -1077,4 +1077,18 @@ struct inventory_menu { }; ASSERT_SIZE(struct inventory_menu, 420); +// Used for creating the stairs menu. +struct stairs_menu { + undefined4 field_0x0; + undefined4 field_0x4; + struct entity* entity; // 0x8: Seems to always point to the leader? + // 0xC: Used for switching in HandleStairsMenu. + // Seems to be 0 when opening the main stairs menu, 1 when the main stairs menu is open, + // 3 when opening the info menu, and 4 when the info menu is open. + int state; + undefined4 unk_info_menu_var; // 0x10: Has something to do with opening the "Info" menu + enum stairs_type stairs_type; // 0x14: Which stairs menu to display +}; +ASSERT_SIZE(struct stairs_menu, 24); + #endif diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index d4bd876d..598f5260 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -248,7 +248,7 @@ overlay29: Floor types: 0 appears to mean the current floor is "normal" - 1 appears to mean the current floor is a fixed floor + 1 means the current floor is a fixed floor with Is Free Layout enabled 2 means the current floor has a rescue point return: floor type diff --git a/symbols/overlay31.yml b/symbols/overlay31.yml index b6e8b517..5055b8a1 100644 --- a/symbols/overlay31.yml +++ b/symbols/overlay31.yml @@ -40,6 +40,31 @@ overlay31: Note: unverified, ported from Irdkwia's notes r0: appears to be an index of some sort, probably the menu index based on the function name? + - name: CreateStairsMenuState + address: + EU: 0x2383AD4 + description: |- + Called when the leader steps on any stairs tile (regular, warp zone, rescue point, hidden stairs). + + Allocates a stairs_menu struct at the address pointed to by STAIRS_MENU_PTR with information for HandleStairsMenu. + + r0: Entity pointer (in practice, always the leader) + - name: StairsSubheadingCallback + address: + EU: 0x2383B68 + description: |- + Callback function passed to CreateAdvancedTextBox for creating the subheading for the stairs menu. + + r0: window_id + - name: HandleStairsMenu + address: + EU: 0x2383BBC + description: |- + Handles displaying the stairs menu and is called on each frame while it is open, also updating the leader's action fields. + + Uses a switch statement based on the state field in stairs_menu to determine what actions to take. + + return: int - name: MovesMenu address: EU: 0x2385DC0 @@ -693,3 +718,10 @@ overlay31: NA: 0x4 JP: 0x4 description: "Note: unverified, ported from Irdkwia's notes" + - name: STAIRS_MENU_PTR + address: + EU: 0x238AEC4 + length: + NA: 0x4 + JP: 0x4 + description: Pointer to the stairs_menu struct. From d4e63517268dac69a8b5e3a703dcbd8cfd4be231 Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 1 Oct 2024 15:39:28 +0400 Subject: [PATCH 027/204] ram --- headers/data/overlay31.h | 1 - headers/data/ram.h | 1 + symbols/overlay31.yml | 9 +-------- symbols/ram.yml | 7 +++++++ 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/headers/data/overlay31.h b/headers/data/overlay31.h index 2f860e46..334836e5 100644 --- a/headers/data/overlay31.h +++ b/headers/data/overlay31.h @@ -40,6 +40,5 @@ extern struct window_params DUNGEON_WINDOW_PARAMS_29; extern struct window_params DUNGEON_WINDOW_PARAMS_30; extern struct window_params DUNGEON_WINDOW_PARAMS_31; extern struct window_params DUNGEON_WINDOW_PARAMS_32; -extern struct stairs_menu* STAIRS_MENU_PTR; #endif diff --git a/headers/data/ram.h b/headers/data/ram.h index add2d7b9..5c6cbf0d 100644 --- a/headers/data/ram.h +++ b/headers/data/ram.h @@ -75,5 +75,6 @@ extern int MULTIHIT_MOVE_SUCCESSIVE_HITS; extern int TRIPLE_KICK_SUCCESSIVE_HITS; extern int METRONOME_NEXT_INDEX; extern struct floor_generation_status FLOOR_GENERATION_STATUS; +extern struct stairs_menu* STAIRS_MENU_PTR; #endif diff --git a/symbols/overlay31.yml b/symbols/overlay31.yml index 5055b8a1..17c59c41 100644 --- a/symbols/overlay31.yml +++ b/symbols/overlay31.yml @@ -63,7 +63,7 @@ overlay31: Handles displaying the stairs menu and is called on each frame while it is open, also updating the leader's action fields. Uses a switch statement based on the state field in stairs_menu to determine what actions to take. - + return: int - name: MovesMenu address: @@ -718,10 +718,3 @@ overlay31: NA: 0x4 JP: 0x4 description: "Note: unverified, ported from Irdkwia's notes" - - name: STAIRS_MENU_PTR - address: - EU: 0x238AEC4 - length: - NA: 0x4 - JP: 0x4 - description: Pointer to the stairs_menu struct. diff --git a/symbols/ram.yml b/symbols/ram.yml index 4a4d80b9..fde2319e 100644 --- a/symbols/ram.yml +++ b/symbols/ram.yml @@ -685,3 +685,10 @@ ram: This data is populated as the dungeon floor is generated. type: struct floor_generation_status + - name: STAIRS_MENU_PTR + address: + EU: 0x238AEC4 + length: + NA: 0x4 + JP: 0x4 + description: Pointer to the stairs_menu struct. From 6ed550585097cc764d3c909325857ac53067f7f5 Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 1 Oct 2024 15:41:23 +0400 Subject: [PATCH 028/204] spacing --- symbols/overlay31.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay31.yml b/symbols/overlay31.yml index 17c59c41..71649800 100644 --- a/symbols/overlay31.yml +++ b/symbols/overlay31.yml @@ -61,7 +61,7 @@ overlay31: EU: 0x2383BBC description: |- Handles displaying the stairs menu and is called on each frame while it is open, also updating the leader's action fields. - + Uses a switch statement based on the state field in stairs_menu to determine what actions to take. return: int From d7aedceb4647710d7a0027259d3fe33169629486 Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 1 Oct 2024 15:43:12 +0400 Subject: [PATCH 029/204] spacing --- symbols/overlay31.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/symbols/overlay31.yml b/symbols/overlay31.yml index 71649800..4afa3b32 100644 --- a/symbols/overlay31.yml +++ b/symbols/overlay31.yml @@ -45,7 +45,7 @@ overlay31: EU: 0x2383AD4 description: |- Called when the leader steps on any stairs tile (regular, warp zone, rescue point, hidden stairs). - + Allocates a stairs_menu struct at the address pointed to by STAIRS_MENU_PTR with information for HandleStairsMenu. r0: Entity pointer (in practice, always the leader) @@ -61,7 +61,7 @@ overlay31: EU: 0x2383BBC description: |- Handles displaying the stairs menu and is called on each frame while it is open, also updating the leader's action fields. - + Uses a switch statement based on the state field in stairs_menu to determine what actions to take. return: int From e4922663d958eabe2ed26f7c9cf546343483147a Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 1 Oct 2024 15:45:47 +0400 Subject: [PATCH 030/204] spacing --- symbols/overlay31.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/symbols/overlay31.yml b/symbols/overlay31.yml index 4afa3b32..8a798b5d 100644 --- a/symbols/overlay31.yml +++ b/symbols/overlay31.yml @@ -47,14 +47,14 @@ overlay31: Called when the leader steps on any stairs tile (regular, warp zone, rescue point, hidden stairs). Allocates a stairs_menu struct at the address pointed to by STAIRS_MENU_PTR with information for HandleStairsMenu. - + r0: Entity pointer (in practice, always the leader) - name: StairsSubheadingCallback address: EU: 0x2383B68 description: |- Callback function passed to CreateAdvancedTextBox for creating the subheading for the stairs menu. - + r0: window_id - name: HandleStairsMenu address: From 7541775fbba512e053e0850447ce87b85696525a Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 1 Oct 2024 15:46:36 +0400 Subject: [PATCH 031/204] spacing --- symbols/overlay31.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay31.yml b/symbols/overlay31.yml index 8a798b5d..bb93ed25 100644 --- a/symbols/overlay31.yml +++ b/symbols/overlay31.yml @@ -61,7 +61,7 @@ overlay31: EU: 0x2383BBC description: |- Handles displaying the stairs menu and is called on each frame while it is open, also updating the leader's action fields. - + Uses a switch statement based on the state field in stairs_menu to determine what actions to take. return: int From 77d6e680e82e38b621edcefca3a99e172cf3a3d1 Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 1 Oct 2024 18:56:27 +0400 Subject: [PATCH 032/204] warp zone --- symbols/overlay29.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 598f5260..f6a6552a 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -248,7 +248,7 @@ overlay29: Floor types: 0 appears to mean the current floor is "normal" - 1 means the current floor is a fixed floor with Is Free Layout enabled + 1 means the current floor is a fixed floor with warp zones enabled 2 means the current floor has a rescue point return: floor type From 03e28e7f64e43a5e1cdf991698364c6f0ac50d1d Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 1 Oct 2024 19:02:13 +0400 Subject: [PATCH 033/204] heap --- symbols/overlay31.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay31.yml b/symbols/overlay31.yml index bb93ed25..a6fdff43 100644 --- a/symbols/overlay31.yml +++ b/symbols/overlay31.yml @@ -46,7 +46,7 @@ overlay31: description: |- Called when the leader steps on any stairs tile (regular, warp zone, rescue point, hidden stairs). - Allocates a stairs_menu struct at the address pointed to by STAIRS_MENU_PTR with information for HandleStairsMenu. + Allocates a stairs_menu struct on the heap with information for HandleStairsMenu, which will be pointed to by STAIRS_MENU_PTR. r0: Entity pointer (in practice, always the leader) - name: StairsSubheadingCallback From bdc6aef48897b1b98a709e6c4b304d84882ccd3f Mon Sep 17 00:00:00 2001 From: assidion2 Date: Wed, 2 Oct 2024 12:25:48 +0400 Subject: [PATCH 034/204] Update ram.yml --- symbols/ram.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/symbols/ram.yml b/symbols/ram.yml index fde2319e..6029d9ad 100644 --- a/symbols/ram.yml +++ b/symbols/ram.yml @@ -689,6 +689,5 @@ ram: address: EU: 0x238AEC4 length: - NA: 0x4 - JP: 0x4 + EU: 0x4 description: Pointer to the stairs_menu struct. From 59e76e44449cd4262b62c62622c8058c86726468 Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 8 Oct 2024 19:25:46 +0400 Subject: [PATCH 035/204] Some functions related to badges/ranks --- headers/functions/arm9.h | 3 +++ symbols/arm9.yml | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index e2fce384..66801d49 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -498,6 +498,7 @@ 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* GetDungeonResultString(int string_number); @@ -533,6 +534,8 @@ void LoadCursors(void); void InitWindowTrailer(struct window_trailer* trailer); void LoadAlert(void); void PrintClearMark(int mark_id, int x, int y, undefined param_4); +void PrintBadgeMark(enum rank badge_id, int x, int y, undefined param_4); +void 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); diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 5dc31485..97eea09e 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -4804,6 +4804,15 @@ arm9: NA: 0x2024428 JP: 0x2024478 description: "Note: unverified, ported from Irdkwia's notes" + - name: GetRankString + address: + EU: 0x2024D88 + description: |- + Gets the string corresponding to the player's current explorer rank. + + r0: [output] str + r1: First 16 bits contain the rank, next 4 are some sort of bitflags + return: r0 if flags are 0, pointer to some static address otherwise - name: GetCurrentTeamNameString address: EU: 0x2024F00 @@ -5211,6 +5220,29 @@ arm9: r1: X pos (unknown units, usually ranges between 3 and 27) r2: Y pos (unknown units, normally 14) r3: ? + - name: PrintBadgeMark + address: + EU: 0x202A728 + description: |- + Prints the specified badge mark on the screen. + + The badge mark is shown when opening the menu in the overworld. + + r0: Badge ID + r1: X pos (unknown units, always 3) + r2: Y pos (unknown units, always 18) + r3: ? (always 3) + - name: PrintMark + address: + EU: 0x202A750 + description: |- + Prints a mark from one of the .w16 files in FONT. + + r0: 0 if file is clrmark1.w16, 1 if file is clrmark2.w16, 2 if file is rankmark.w16. + r1: Mark ID in file + r2: X pos (unknown units) + r3: Y pos (unknown units) + stack[0]: ? - name: CreateParentMenuFromStringIds address: EU: 0x202A8C0 From 50c29b111fe601265c96314dc29081dcbd10df03 Mon Sep 17 00:00:00 2001 From: assidion2 Date: Sun, 13 Oct 2024 09:15:21 +0400 Subject: [PATCH 036/204] Update symbols/arm9.yml Co-authored-by: UsernameFodder <93669634+UsernameFodder@users.noreply.github.com> --- symbols/arm9.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 97eea09e..9e64c6d9 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -4810,7 +4810,7 @@ arm9: description: |- Gets the string corresponding to the player's current explorer rank. - r0: [output] str + r0: [output] Pointer to the buffer where the string will be written r1: First 16 bits contain the rank, next 4 are some sort of bitflags return: r0 if flags are 0, pointer to some static address otherwise - name: GetCurrentTeamNameString From f4d2cc34b3098d271b44c00683296f004cff596a Mon Sep 17 00:00:00 2001 From: assidion Date: Wed, 4 Dec 2024 13:28:21 +0400 Subject: [PATCH 037/204] new functions --- headers/functions/arm9.h | 1 + headers/functions/arm9/itcm.h | 2 ++ headers/functions/overlay29.h | 1 + symbols/arm9.yml | 12 ++++++++++++ symbols/arm9/itcm.yml | 26 ++++++++++++++++++++++++++ symbols/overlay29.yml | 17 +++++++++++++++++ symbols/ram.yml | 2 +- 7 files changed, 60 insertions(+), 1 deletion(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 3a8b1e3e..5fe5d96d 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -520,6 +520,7 @@ 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, int group_id, int restrictions); +int GetColorCodePaletteOffset(char symbol); bool IsAOrBPressed(void); void DrawTextInWindow(int window_id, int x, int y, char* string); struct window* GetWindow(int window_id); diff --git a/headers/functions/arm9/itcm.h b/headers/functions/arm9/itcm.h index b27247de..56df0ff6 100644 --- a/headers/functions/arm9/itcm.h +++ b/headers/functions/arm9/itcm.h @@ -1,6 +1,7 @@ #ifndef HEADERS_FUNCTIONS_ARM9_ITCM_H_ #define HEADERS_FUNCTIONS_ARM9_ITCM_H_ +void CopyAndInterleave(int* dst, int* src, int len, int val); void Render3dSetTextureParams(struct render_3d_texture_params* params, int vram_offset); void Render3dSetPaletteBase(struct render_3d_texture_params* params, uint32_t palette_base_addr); void Render3dRectangle(struct render_3d_rectangle* rectangle); @@ -26,6 +27,7 @@ int GetKeyM2N(enum monster_id monster_id); int GetKeyM2NBaseForm(enum monster_id monster_id); void HardwareInterrupt(void); void ReturnFromInterrupt(void); +void InitDmaTransfer_Standard(int channel, int* src, int* dst, uint16_t word_count); bool ShouldMonsterRunAwayVariationOutlawCheck(struct entity* monster, undefined param_2); void AiMovement(struct entity* monster, undefined param_2); void CalculateAiTargetPos(struct entity* monster); diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index 55355417..f7d25e9a 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -81,6 +81,7 @@ bool IsPositionActuallyInSight(struct position* origin, struct position* target, bool IsPositionInSight(struct position* origin, struct position* target, bool user_has_dropeye); 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, diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 26685dfb..fb4811bd 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -5046,6 +5046,18 @@ arm9: r1: group_id r2: restrictions return: ? + - name: GetColorCodePaletteOffset + address: + EU: 0x20268A8 + NA: 0x20265C4 + JP: 0x202669C + description: |- + Gets the offset of a text color symbol's 2-byte RGB5 color in the palette stored in VRAM at 0x6882000. + + The offset minus 0x10 will also be the corresponding 4-byte RGBX color's position in FONT/text_pal.pal. + + r0: char + return: offset - name: IsAOrBPressed address: EU: 0x20261CC diff --git a/symbols/arm9/itcm.yml b/symbols/arm9/itcm.yml index 573a8149..aeb32444 100644 --- a/symbols/arm9/itcm.yml +++ b/symbols/arm9/itcm.yml @@ -29,6 +29,19 @@ itcm: In Explorers of Sky, a fixed region of the ARM9 binary appears to be loaded in the ITCM at all times, and seems to contain functions related to the dungeon AI, among other things. The ITCM has a max capacity of 0x8000, although not all of it is used. functions: + - name: CopyAndInterleave + address: + EU: 0x20B3CC0 + EU-ITCM: 0x1FF8000 + description: |- + Copies data from src to dst, placing the last 4 bits of val after every 4 bits copied. + + In total, the number of bytes copied from src will be 2 * len, while the number of bytes pasted will be 4 * len. + + r0: [output] dst + r1: src + r2: len (in words) + r3: val - name: Render3dSetTextureParams address: EU: 0x20B3DF0 @@ -341,6 +354,19 @@ itcm: The execution returns to this function after a hardware interrupt function is run. No params. + - name: InitDmaTransfer_Standard + address: + EU: 0x20B5728 + EU-ITCM: 0x1FF9A68 + description: |- + Initiates a DMA transfer. + + See https://problemkaputt.de/gbatek-gba-dma-transfers.htm and https://en.wikipedia.org/wiki/Direct_memory_access + + r0: channel id + r1: source address + r2: destination address + r3: word count - name: ShouldMonsterRunAwayVariationOutlawCheck address: EU: 0x20B6050 diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 75375296..08b77e01 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -1006,6 +1006,23 @@ overlay29: Returns a pointer to the monster data of the current leader. No params. + - name: GetRandomTile + address: + EU: 0x22E9FD8 + description: |- + Gets a random valid tile. Used for warping as well as several other things. + + The selection algorithm is as follows: + First, try to randomly select a valid tile that is not a hallway and at least 6 tiles away from the leader in either direction. + If none are found, try to randomly select a valid tile that is not a hallway. + If none are found, try to randomly select a valid tile. + If none are found, return 0. + + A valid tile is defined as a floor tile that has no object or monster on it and also does not have a key door (if r1 is true). + + r0: [output] position + r1: boolean indicating whether or not to exclude key doors + return: whether a tile was successfully found - name: FindNearbyUnoccupiedTile address: EU: 0x22EA1F4 diff --git a/symbols/ram.yml b/symbols/ram.yml index 647c7a8a..fb492a26 100644 --- a/symbols/ram.yml +++ b/symbols/ram.yml @@ -694,4 +694,4 @@ ram: EU: 0x238AEC4 length: EU: 0x4 - description: Pointer to the stairs_menu struct. + description: Pointer to the stairs_menu struct during dungeon mode. From 510f36909909636c1dbfd649f4358ddd29db6a45 Mon Sep 17 00:00:00 2001 From: assidion Date: Wed, 4 Dec 2024 13:29:50 +0400 Subject: [PATCH 038/204] spacing --- symbols/arm9.yml | 4 ++-- symbols/arm9/itcm.yml | 4 ++-- symbols/overlay29.yml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index fb4811bd..5d517248 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -5053,9 +5053,9 @@ arm9: JP: 0x202669C description: |- Gets the offset of a text color symbol's 2-byte RGB5 color in the palette stored in VRAM at 0x6882000. - + The offset minus 0x10 will also be the corresponding 4-byte RGBX color's position in FONT/text_pal.pal. - + r0: char return: offset - name: IsAOrBPressed diff --git a/symbols/arm9/itcm.yml b/symbols/arm9/itcm.yml index aeb32444..de630aef 100644 --- a/symbols/arm9/itcm.yml +++ b/symbols/arm9/itcm.yml @@ -35,7 +35,7 @@ itcm: EU-ITCM: 0x1FF8000 description: |- Copies data from src to dst, placing the last 4 bits of val after every 4 bits copied. - + In total, the number of bytes copied from src will be 2 * len, while the number of bytes pasted will be 4 * len. r0: [output] dst @@ -360,7 +360,7 @@ itcm: EU-ITCM: 0x1FF9A68 description: |- Initiates a DMA transfer. - + See https://problemkaputt.de/gbatek-gba-dma-transfers.htm and https://en.wikipedia.org/wiki/Direct_memory_access r0: channel id diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 08b77e01..9c5b6193 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -1017,7 +1017,7 @@ overlay29: If none are found, try to randomly select a valid tile that is not a hallway. If none are found, try to randomly select a valid tile. If none are found, return 0. - + A valid tile is defined as a floor tile that has no object or monster on it and also does not have a key door (if r1 is true). r0: [output] position From cfe5ae5f32b7c4bc6bce092c55dd0165b65ab97c Mon Sep 17 00:00:00 2001 From: assidion Date: Wed, 4 Dec 2024 13:41:53 +0400 Subject: [PATCH 039/204] pos --- headers/functions/arm9.h | 2 +- symbols/arm9.yml | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 5fe5d96d..db8cdbc6 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -520,9 +520,9 @@ 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, int group_id, int restrictions); -int GetColorCodePaletteOffset(char symbol); bool IsAOrBPressed(void); void DrawTextInWindow(int window_id, int x, int y, char* string); +int GetColorCodePaletteOffset(char symbol); 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); diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 5d517248..bd8b3aec 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -5046,18 +5046,6 @@ arm9: r1: group_id r2: restrictions return: ? - - name: GetColorCodePaletteOffset - address: - EU: 0x20268A8 - NA: 0x20265C4 - JP: 0x202669C - description: |- - Gets the offset of a text color symbol's 2-byte RGB5 color in the palette stored in VRAM at 0x6882000. - - The offset minus 0x10 will also be the corresponding 4-byte RGBX color's position in FONT/text_pal.pal. - - r0: char - return: offset - name: IsAOrBPressed address: EU: 0x20261CC @@ -5082,6 +5070,18 @@ arm9: r1: x offset within window r2: y offset within window r3: text to draw + - name: GetColorCodePaletteOffset + address: + EU: 0x20268A8 + NA: 0x20265C4 + JP: 0x202669C + description: |- + Gets the offset of a text color symbol's 2-byte RGB5 color in the palette stored in VRAM at 0x6882000. + + The offset minus 0x10 will also be the corresponding 4-byte RGBX color's position in FONT/text_pal.pal. + + r0: char + return: offset - name: GetWindow address: EU: 0x20278EC From 156a45dd96c2a711ce6755944ba15d9eff5397ea Mon Sep 17 00:00:00 2001 From: assidion Date: Wed, 4 Dec 2024 22:13:35 +0400 Subject: [PATCH 040/204] is --- symbols/overlay29.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 9c5b6193..18d28a01 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -1013,7 +1013,7 @@ overlay29: Gets a random valid tile. Used for warping as well as several other things. The selection algorithm is as follows: - First, try to randomly select a valid tile that is not a hallway and at least 6 tiles away from the leader in either direction. + First, try to randomly select a valid tile that is not a hallway and is at least 6 tiles away from the leader in either direction. If none are found, try to randomly select a valid tile that is not a hallway. If none are found, try to randomly select a valid tile. If none are found, return 0. From 73485646cb8ac9eeac96e04619e824b6dd63f05d Mon Sep 17 00:00:00 2001 From: assidion Date: Wed, 4 Dec 2024 22:51:08 +0400 Subject: [PATCH 041/204] fixes --- headers/functions/arm9/itcm.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/headers/functions/arm9/itcm.h b/headers/functions/arm9/itcm.h index 56df0ff6..ab11e636 100644 --- a/headers/functions/arm9/itcm.h +++ b/headers/functions/arm9/itcm.h @@ -1,7 +1,7 @@ #ifndef HEADERS_FUNCTIONS_ARM9_ITCM_H_ #define HEADERS_FUNCTIONS_ARM9_ITCM_H_ -void CopyAndInterleave(int* dst, int* src, int len, int val); +void CopyAndInterleave(uint16_t* dst, uint16_t* src, int len, uint8_t val); void Render3dSetTextureParams(struct render_3d_texture_params* params, int vram_offset); void Render3dSetPaletteBase(struct render_3d_texture_params* params, uint32_t palette_base_addr); void Render3dRectangle(struct render_3d_rectangle* rectangle); @@ -27,7 +27,7 @@ int GetKeyM2N(enum monster_id monster_id); int GetKeyM2NBaseForm(enum monster_id monster_id); void HardwareInterrupt(void); void ReturnFromInterrupt(void); -void InitDmaTransfer_Standard(int channel, int* src, int* dst, uint16_t word_count); +void InitDmaTransfer_Standard(int channel, void* src, void* dst, uint16_t word_count); bool ShouldMonsterRunAwayVariationOutlawCheck(struct entity* monster, undefined param_2); void AiMovement(struct entity* monster, undefined param_2); void CalculateAiTargetPos(struct entity* monster); From 0b4a26797cfdcb5baf02e255d33d533b5ce686b8 Mon Sep 17 00:00:00 2001 From: assidion Date: Wed, 4 Dec 2024 23:18:19 +0400 Subject: [PATCH 042/204] fix --- headers/functions/arm9/itcm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/functions/arm9/itcm.h b/headers/functions/arm9/itcm.h index ab11e636..6f6f73d7 100644 --- a/headers/functions/arm9/itcm.h +++ b/headers/functions/arm9/itcm.h @@ -27,7 +27,7 @@ int GetKeyM2N(enum monster_id monster_id); int GetKeyM2NBaseForm(enum monster_id monster_id); void HardwareInterrupt(void); void ReturnFromInterrupt(void); -void InitDmaTransfer_Standard(int channel, void* src, void* dst, uint16_t word_count); +void InitDmaTransfer_Standard(uint8_t channel, void* src, void* dst, uint16_t word_count); bool ShouldMonsterRunAwayVariationOutlawCheck(struct entity* monster, undefined param_2); void AiMovement(struct entity* monster, undefined param_2); void CalculateAiTargetPos(struct entity* monster); From 4c058c4773b5391fb3589aa105b0026bba8d84da Mon Sep 17 00:00:00 2001 From: assidion Date: Fri, 27 Dec 2024 22:32:23 +0400 Subject: [PATCH 043/204] aaa --- headers/functions/overlay29.h | 3 +++ symbols/arm9.yml | 12 +++++++++++- symbols/arm9/itcm.yml | 4 ++-- symbols/overlay29.yml | 21 +++++++++++++++++++++ 4 files changed, 37 insertions(+), 3 deletions(-) diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index f7d25e9a..ef0a6d2f 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -716,8 +716,11 @@ enum hidden_stairs_type GetHiddenStairsField(void); void SetHiddenStairsField(enum hidden_stairs_type hidden_stairs); enum hidden_stairs_type GetHiddenFloorField(void); void SetHiddenFloorField(enum hidden_stairs_type hidden_floor); +void InitializeWeather3DFiles(void); struct minimap_display_data* GetMinimapData(void); +void RenderWeather3D(void); void DrawMinimapTile(int x, int y); +void FlashLeaderIcon(undefined param_1); void UpdateMinimap(void); void SetMinimapDataE447(uint8_t value); uint8_t GetMinimapDataE447(void); diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 8b8568a3..71dbb599 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -4077,6 +4077,16 @@ arm9: NA: 0x201A9E4 JP: 0x201AA3C description: "Note: unverified, ported from Irdkwia's notes" + - name: CopyAndInterleaveWrapper + address: + EU: 0x0201C08C + description: |- + Calls CopyAndInterleave with the passed len divided by 2. + + r0: dst + r1: src + r2: len (in bytes, will be divided by 2 in the call to CopyAndInterleave) + r3: val - name: InitAnimationControl address: EU: 0x201C0EC @@ -4857,7 +4867,7 @@ arm9: description: |- Gets the string corresponding to the player's current explorer rank. - r0: [output] Pointer to the buffer where the string will be written + r0: [output] Pointer to the buffer where the string will be written (if flags are 0) r1: First 16 bits contain the rank, next 4 are some sort of bitflags return: r0 if flags are 0, pointer to some static address otherwise - name: GetCurrentTeamNameString diff --git a/symbols/arm9/itcm.yml b/symbols/arm9/itcm.yml index fd589a4d..a5df8edd 100644 --- a/symbols/arm9/itcm.yml +++ b/symbols/arm9/itcm.yml @@ -40,11 +40,11 @@ itcm: description: |- Copies data from src to dst, placing the last 4 bits of val after every 4 bits copied. - In total, the number of bytes copied from src will be 2 * len, while the number of bytes pasted will be 4 * len. + In total, the number of bytes copied from src will be len, while the number of bytes pasted will be 2 * len. r0: [output] dst r1: src - r2: len (in words) + r2: len (in bytes) r3: val - name: Render3dSetTextureParams address: diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index b484d38b..795287e3 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -7014,6 +7014,13 @@ overlay29: Sets the hidden_floor_type variable from dungeon::dungeon_generation_info to a certain value. r0: New value + - name: LoadWeather3DFiles + address: + EU: 0x02339694 + description: |- + Loads the 1001.wte, 1005.wte, and 1031.wte files in dungeon.bin, which are used for the 3D effects for the tileset weather as well as the Sandstorm weather condition. + + No params. - name: GetMinimapData address: EU: 0x2339CE8 @@ -7023,6 +7030,13 @@ overlay29: Returns a pointer to the minimap_display_data struct in the dungeon struct. return: minimap_display_data* + - name: RenderWeather3D + address: + EU: 0x02339694 + description: |- + Renders the 3D effects for the tileset weather as well as the Sandstorm weather condition. + + No params. - name: DrawMinimapTile address: EU: 0x2339DBC @@ -7033,6 +7047,13 @@ overlay29: r0: X position r1: Y position + - name: FlashLeaderIcon + address: + EU: 0x0233A5F4 + description: |- + Seems to control flashing the leader's icon on the minimap when r0 = 0? Doesn't seem to ever be called when r0 = 1. + + r0: ? - name: UpdateMinimap address: EU: 0x233A8B8 From 8a240e0ad423c83275f50e87715c176fde11a1cf Mon Sep 17 00:00:00 2001 From: assidion Date: Fri, 27 Dec 2024 22:35:02 +0400 Subject: [PATCH 044/204] aaa --- headers/functions/arm9.h | 1 + 1 file changed, 1 insertion(+) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 957fc29b..107b8231 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -418,6 +418,7 @@ 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 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); From 6989455c8f8fca7348e4ab958cd4c01ef0012d68 Mon Sep 17 00:00:00 2001 From: assidion Date: Fri, 27 Dec 2024 22:39:02 +0400 Subject: [PATCH 045/204] checks --- headers/functions/overlay29.h | 2 +- symbols/arm9.yml | 2 +- symbols/overlay29.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index ef0a6d2f..d76e3610 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -716,7 +716,7 @@ enum hidden_stairs_type GetHiddenStairsField(void); void SetHiddenStairsField(enum hidden_stairs_type hidden_stairs); enum hidden_stairs_type GetHiddenFloorField(void); void SetHiddenFloorField(enum hidden_stairs_type hidden_floor); -void InitializeWeather3DFiles(void); +void LoadWeather3DFiles(void); struct minimap_display_data* GetMinimapData(void); void RenderWeather3D(void); void DrawMinimapTile(int x, int y); diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 71dbb599..960b6392 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -4079,7 +4079,7 @@ arm9: description: "Note: unverified, ported from Irdkwia's notes" - name: CopyAndInterleaveWrapper address: - EU: 0x0201C08C + EU: 0x201C08C description: |- Calls CopyAndInterleave with the passed len divided by 2. diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 795287e3..f4824b7b 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -7016,7 +7016,7 @@ overlay29: r0: New value - name: LoadWeather3DFiles address: - EU: 0x02339694 + EU: 0x2339480 description: |- Loads the 1001.wte, 1005.wte, and 1031.wte files in dungeon.bin, which are used for the 3D effects for the tileset weather as well as the Sandstorm weather condition. @@ -7049,7 +7049,7 @@ overlay29: r1: Y position - name: FlashLeaderIcon address: - EU: 0x0233A5F4 + EU: 0x233A5F4 description: |- Seems to control flashing the leader's icon on the minimap when r0 = 0? Doesn't seem to ever be called when r0 = 1. From ed9b7f490c370c38b1b2e34686a65d1f8d7be47f Mon Sep 17 00:00:00 2001 From: assidion Date: Fri, 27 Dec 2024 22:39:48 +0400 Subject: [PATCH 046/204] checks --- symbols/overlay29.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index f4824b7b..194b12f4 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -7032,7 +7032,7 @@ overlay29: return: minimap_display_data* - name: RenderWeather3D address: - EU: 0x02339694 + EU: 0x2339694 description: |- Renders the 3D effects for the tileset weather as well as the Sandstorm weather condition. From 60dd47f96f97c398bc0d897ee7b6c15fc633f8d3 Mon Sep 17 00:00:00 2001 From: assidion Date: Fri, 27 Dec 2024 22:40:42 +0400 Subject: [PATCH 047/204] checks --- symbols/overlay29.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 194b12f4..3e1251a3 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -7035,7 +7035,7 @@ overlay29: EU: 0x2339694 description: |- Renders the 3D effects for the tileset weather as well as the Sandstorm weather condition. - + No params. - name: DrawMinimapTile address: From fc71355fbf2a1c1c0f2701e7a1344e850a876655 Mon Sep 17 00:00:00 2001 From: assidion Date: Fri, 27 Dec 2024 22:44:31 +0400 Subject: [PATCH 048/204] checks --- symbols/overlay29.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 3e1251a3..194b12f4 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -7035,7 +7035,7 @@ overlay29: EU: 0x2339694 description: |- Renders the 3D effects for the tileset weather as well as the Sandstorm weather condition. - + No params. - name: DrawMinimapTile address: From 9bfa929227b0aedd4647e6178ae41b8c99abee8f Mon Sep 17 00:00:00 2001 From: assidion Date: Fri, 27 Dec 2024 22:46:05 +0400 Subject: [PATCH 049/204] checks --- headers/functions/overlay29.h | 2 +- symbols/overlay29.yml | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index d76e3610..e9e4f9fe 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -717,8 +717,8 @@ void SetHiddenStairsField(enum hidden_stairs_type hidden_stairs); enum hidden_stairs_type GetHiddenFloorField(void); void SetHiddenFloorField(enum hidden_stairs_type hidden_floor); void LoadWeather3DFiles(void); -struct minimap_display_data* GetMinimapData(void); void RenderWeather3D(void); +struct minimap_display_data* GetMinimapData(void); void DrawMinimapTile(int x, int y); void FlashLeaderIcon(undefined param_1); void UpdateMinimap(void); diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 194b12f4..781ef6e8 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -7020,6 +7020,13 @@ overlay29: description: |- Loads the 1001.wte, 1005.wte, and 1031.wte files in dungeon.bin, which are used for the 3D effects for the tileset weather as well as the Sandstorm weather condition. + No params. + - name: RenderWeather3D + address: + EU: 0x2339694 + description: |- + Renders the 3D effects for the tileset weather as well as the Sandstorm weather condition. + No params. - name: GetMinimapData address: @@ -7030,13 +7037,6 @@ overlay29: Returns a pointer to the minimap_display_data struct in the dungeon struct. return: minimap_display_data* - - name: RenderWeather3D - address: - EU: 0x2339694 - description: |- - Renders the 3D effects for the tileset weather as well as the Sandstorm weather condition. - - No params. - name: DrawMinimapTile address: EU: 0x2339DBC From 2865d2eeabc971f7c55dded242b03731a21fb0df Mon Sep 17 00:00:00 2001 From: assidion Date: Fri, 27 Dec 2024 22:48:17 +0400 Subject: [PATCH 050/204] checks --- symbols/overlay29.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 781ef6e8..b88f7451 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -7019,7 +7019,7 @@ overlay29: EU: 0x2339480 description: |- Loads the 1001.wte, 1005.wte, and 1031.wte files in dungeon.bin, which are used for the 3D effects for the tileset weather as well as the Sandstorm weather condition. - + No params. - name: RenderWeather3D address: @@ -7052,7 +7052,7 @@ overlay29: EU: 0x233A5F4 description: |- Seems to control flashing the leader's icon on the minimap when r0 = 0? Doesn't seem to ever be called when r0 = 1. - + r0: ? - name: UpdateMinimap address: From bf18dc7c75a7a6cf16ebb039565b269b7e42f096 Mon Sep 17 00:00:00 2001 From: assidion Date: Fri, 27 Dec 2024 22:50:30 +0400 Subject: [PATCH 051/204] fix --- symbols/overlay29.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index b88f7451..9e6a9cd6 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -7051,7 +7051,7 @@ overlay29: address: EU: 0x233A5F4 description: |- - Seems to control flashing the leader's icon on the minimap when r0 = 0? Doesn't seem to ever be called when r0 = 1. + Seems to control flashing the leader's icon on the minimap when r0 = 0? Seems to be called only when the floor is loaded with r0 = 1. r0: ? - name: UpdateMinimap From 6e524595c9c8389f4db1b75f1a64899f15a83d87 Mon Sep 17 00:00:00 2001 From: assidion Date: Fri, 27 Dec 2024 22:54:25 +0400 Subject: [PATCH 052/204] fix --- symbols/overlay29.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 9e6a9cd6..b88f7451 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -7051,7 +7051,7 @@ overlay29: address: EU: 0x233A5F4 description: |- - Seems to control flashing the leader's icon on the minimap when r0 = 0? Seems to be called only when the floor is loaded with r0 = 1. + Seems to control flashing the leader's icon on the minimap when r0 = 0? Doesn't seem to ever be called when r0 = 1. r0: ? - name: UpdateMinimap From f66f0356d532e68561d35039569e2e17d014a982 Mon Sep 17 00:00:00 2001 From: assidion Date: Fri, 27 Dec 2024 23:41:32 +0400 Subject: [PATCH 053/204] fog --- symbols/overlay29.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index b88f7451..ac31a96d 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -7018,14 +7018,14 @@ overlay29: address: EU: 0x2339480 description: |- - Loads the 1001.wte, 1005.wte, and 1031.wte files in dungeon.bin, which are used for the 3D effects for the tileset weather as well as the Sandstorm weather condition. + Loads the 1001.wte, 1005.wte, and 1031.wte files in dungeon.bin, which are used for the 3D effects for the tileset weather as well as the Sandstorm/Fog weather conditions. No params. - name: RenderWeather3D address: EU: 0x2339694 description: |- - Renders the 3D effects for the tileset weather as well as the Sandstorm weather condition. + Renders the 3D effects for the tileset weather as well as the Sandstorm/Fog weather conditions. No params. - name: GetMinimapData From 2c8162820c3e2036a205db155e819db308e6315d Mon Sep 17 00:00:00 2001 From: assidion Date: Wed, 5 Feb 2025 23:42:42 +0400 Subject: [PATCH 054/204] . --- headers/functions/arm9.h | 4 +++- headers/functions/overlay29.h | 3 +++ headers/types/common/common.h | 4 ++-- symbols/arm9.yml | 27 ++++++++++++++++++++++----- symbols/overlay29.yml | 23 +++++++++++++++++++++++ 5 files changed, 53 insertions(+), 8 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index cdded870..72470795 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -806,6 +806,7 @@ 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); bool IsNoLossPenaltyDungeon(enum dungeon_id dungeon_id); @@ -1069,7 +1070,7 @@ int DungeonRequestsDone(uint8_t param_1, bool param_2); int DungeonRequestsDoneWrapper(uint8_t param_1); bool AnyDungeonRequestsDone(uint8_t param_1); void AddMissionToJobList(struct mission* mission); -int GetAcceptedMission(int mission_id); +int GetAcceptedMission(uint8_t mission_id); 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, @@ -1082,6 +1083,7 @@ void DeleteAllPossibleDungeonsList(void); int GenerateAllPossibleDeliverList(void); void DeleteAllPossibleDeliverList(void); void ClearMissionData(struct mission* mission); +bool ValidateNormalChallengeMission(undefined* param_1, struct mission* mission); 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); diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index 55a24a5d..0066df28 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -169,6 +169,7 @@ void SetLeaderAction(void); bool ShouldLeaderKeepRunning(void); void CheckLeaderTile(void); void ChangeLeader(void); +bool GetPlayerGender(void); void UseSingleUseItemWrapper(struct entity* user); void UseSingleUseItem(struct entity* user, struct entity* target); void UseThrowableItem(struct entity* user); @@ -842,6 +843,7 @@ 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); bool CheckActiveChallengeRequest(void); struct mission_destination_info* GetMissionDestination(void); bool IsOutlawOrChallengeRequestFloor(void); @@ -868,6 +870,7 @@ enum monster_id GetMissionEnemyMinionGroup(int i); void SetTargetMonsterNotFoundFlag(bool value); bool GetTargetMonsterNotFoundFlag(void); bool FloorHasMissionMonster(struct mission_destination_info* mission_dst); +mission* MissionIsActiveOnFloor(enum dungeon_floor_pair* dungeon_floor_pair, uint8_t mission_id); void GenerateMissionEggMonster(struct mission* mission); void LogMessageByIdWithPopupCheckParticipants(struct entity* user, struct entity* target, int message_id, int idx, int16_t val); diff --git a/headers/types/common/common.h b/headers/types/common/common.h index c15fc8f3..8368799d 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -796,8 +796,8 @@ struct mission { uint8_t unique_map_id; // 0xC: for challenges/treasure hunts/certain outlaws undefined field_0xd; struct monster_id_16 client; // 0xE - struct monster_id_16 target; // 0x10 - struct monster_id_16 outlaw_backup_species; // 0x12 + struct monster_id_16 target; // 0x10: Repurposed for storing the second team member of a normal challenge mission + struct monster_id_16 outlaw_backup_species; // 0x12: Repurposed for storing the third team member of a normal challenge mission struct item_id_16 item_wanted; // 0x14 struct mission_reward_type_8 reward_type; // 0x16 undefined field_0x17; diff --git a/symbols/arm9.yml b/symbols/arm9.yml index a98dd2a2..5282fe17 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -7655,8 +7655,16 @@ arm9: Returns whether the conversion was successful. This function does not include any checks if the mission itself is valid, only if the code is valid. r0: string - r1: Pointer to the struct where the data of the converted mission will be written to + r1: [output] Pointer to the struct where the data of the converted mission will be written to return: successful conversion + - name: MissionToWonderMailPassword + address: + EU: 0x204E1B4 + description: |- + Converts a mission struct to a Wonder Mail S password. + + r0: [output] Pointer to the buffer where the string will be written + r1: mission struct pointer - name: SetEnterDungeon address: EU: 0x204EC84 @@ -10284,10 +10292,10 @@ arm9: NA: 0x205F0D8 JP: 0x205F3D8 description: |- - Note: unverified, ported from Irdkwia's notes + Gets the mission struct corresponding to a certain mission number in the player's job list. - r0: mission_id - return: mission + r0: mission id in player's job list + return: mission struct pointer - name: GetMissionByTypeAndDungeon address: EU: 0x205F728 @@ -10393,11 +10401,20 @@ arm9: NA: 0x205F9B8 JP: 0x205FCA8 description: |- - Given a mission struct, clears some of it fields. + Given a mission struct, clears some of its fields. 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: ValidateNormalChallengeMission + address: + EU: 0x2060B80 + description: |- + Validates a normal challenge letter mission by checking whether its client (leader), target (second member), and outlaw_backup_species (third member) match some hardcoded ids (alongside some other conditions). + + r0: ? + r1: mission struct pointer + return: bool - name: IsMonsterMissionAllowed address: EU: 0x2062D90 diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 74e985ed..79e05ff0 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -1882,6 +1882,13 @@ overlay29: Accounts for situations that can prevent changing leaders, such as having stolen from a Kecleon shop. If one of those situations prevents changing leaders, prints the corresponding message to the message log. No params. + - name: GetPlayerGender + address: + EU: 0x22F4C94 + description: |- + Gets the gender of the player. + + return: bool - name: UseSingleUseItemWrapper address: EU: 0x22F5C88 @@ -8282,6 +8289,13 @@ overlay29: r1: floor r2: duration r3: enum hidden_stairs_type + - name: FillMissionDestinationInfo + address: + EU: 0x23490A0 + description: |- + Fills the dungeon::mission_destination_info field with information from the currently active mission on the floor, if one is present. + + No params. - name: CheckActiveChallengeRequest address: EU: 0x2349D4C @@ -8541,6 +8555,15 @@ overlay29: r0: mission destination info pointer return: bool + - name: MissionIsActiveOnFloor + address: + EU: 0x234A390 + description: |- + If the current dungeon floor has the mission corresponding to the mission number active on it, returns its mission struct. + + r0: dungeon_floor_pair struct pointer + r1: mission id in player's job list + return: mission struct pointer - name: GenerateMissionEggMonster address: EU: 0x234A4A0 From 31f30e73ab0818685c6dc101d24073071f8e63ff Mon Sep 17 00:00:00 2001 From: assidion Date: Wed, 5 Feb 2025 23:47:41 +0400 Subject: [PATCH 055/204] fixes --- headers/functions/overlay29.h | 2 +- headers/types/common/common.h | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index 0066df28..5ddc63e2 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -870,7 +870,7 @@ enum monster_id GetMissionEnemyMinionGroup(int i); void SetTargetMonsterNotFoundFlag(bool value); bool GetTargetMonsterNotFoundFlag(void); bool FloorHasMissionMonster(struct mission_destination_info* mission_dst); -mission* MissionIsActiveOnFloor(enum dungeon_floor_pair* dungeon_floor_pair, uint8_t mission_id); +mission* MissionIsActiveOnFloor(struct dungeon_floor_pair* dungeon_floor_pair, uint8_t mission_id); void GenerateMissionEggMonster(struct mission* mission); void LogMessageByIdWithPopupCheckParticipants(struct entity* user, struct entity* target, int message_id, int idx, int16_t val); diff --git a/headers/types/common/common.h b/headers/types/common/common.h index 8368799d..c1cfe467 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -795,9 +795,11 @@ struct mission { int description_id; uint8_t unique_map_id; // 0xC: for challenges/treasure hunts/certain outlaws undefined field_0xd; - struct monster_id_16 client; // 0xE - struct monster_id_16 target; // 0x10: Repurposed for storing the second team member of a normal challenge mission - struct monster_id_16 outlaw_backup_species; // 0x12: Repurposed for storing the third team member of a normal challenge mission + struct monster_id_16 client; // 0xE + // 0x10: Repurposed for storing the second team member of a normal challenge mission + struct monster_id_16 target; + // 0x12: Repurposed for storing the third team member of a normal challenge mission + struct monster_id_16 outlaw_backup_species; struct item_id_16 item_wanted; // 0x14 struct mission_reward_type_8 reward_type; // 0x16 undefined field_0x17; From b1c20451b2d8dcf10e4d7271b26d0a922fb272fa Mon Sep 17 00:00:00 2001 From: assidion Date: Wed, 5 Feb 2025 23:50:27 +0400 Subject: [PATCH 056/204] fixes --- headers/functions/overlay29.h | 2 +- headers/types/common/common.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index 5ddc63e2..d7db72f5 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -870,7 +870,7 @@ enum monster_id GetMissionEnemyMinionGroup(int i); void SetTargetMonsterNotFoundFlag(bool value); bool GetTargetMonsterNotFoundFlag(void); bool FloorHasMissionMonster(struct mission_destination_info* mission_dst); -mission* MissionIsActiveOnFloor(struct dungeon_floor_pair* dungeon_floor_pair, uint8_t mission_id); +struct mission* MissionIsActiveOnFloor(struct dungeon_floor_pair* dungeon_floor_pair, uint8_t mission_id); void GenerateMissionEggMonster(struct mission* mission); void LogMessageByIdWithPopupCheckParticipants(struct entity* user, struct entity* target, int message_id, int idx, int16_t val); diff --git a/headers/types/common/common.h b/headers/types/common/common.h index c1cfe467..6b81a54e 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -795,7 +795,7 @@ struct mission { int description_id; uint8_t unique_map_id; // 0xC: for challenges/treasure hunts/certain outlaws undefined field_0xd; - struct monster_id_16 client; // 0xE + struct monster_id_16 client; // 0xE // 0x10: Repurposed for storing the second team member of a normal challenge mission struct monster_id_16 target; // 0x12: Repurposed for storing the third team member of a normal challenge mission From 60c4156f122571015244baa5d9189ce2e81481bc Mon Sep 17 00:00:00 2001 From: assidion Date: Thu, 6 Feb 2025 01:02:50 +0400 Subject: [PATCH 057/204] fix --- 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 d7db72f5..77f0e5f1 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -169,7 +169,7 @@ void SetLeaderAction(void); bool ShouldLeaderKeepRunning(void); void CheckLeaderTile(void); void ChangeLeader(void); -bool GetPlayerGender(void); +enum monster_gender GetPlayerGender(void); void UseSingleUseItemWrapper(struct entity* user); void UseSingleUseItem(struct entity* user, struct entity* target); void UseThrowableItem(struct entity* user); From 9fe8f57578929300d167952ef6ab3e7ddf9c1420 Mon Sep 17 00:00:00 2001 From: assidion Date: Thu, 6 Feb 2025 01:03:47 +0400 Subject: [PATCH 058/204] fix --- symbols/overlay29.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 79e05ff0..df90d43d 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -1888,7 +1888,7 @@ overlay29: description: |- Gets the gender of the player. - return: bool + return: monster_gender - name: UseSingleUseItemWrapper address: EU: 0x22F5C88 From dae854349e07f3976fb2b51d3979c851b84be211 Mon Sep 17 00:00:00 2001 From: assidion Date: Thu, 6 Feb 2025 09:15:49 +0400 Subject: [PATCH 059/204] fix --- headers/functions/overlay29.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index 77f0e5f1..4881cc2b 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -870,7 +870,8 @@ enum monster_id GetMissionEnemyMinionGroup(int i); void SetTargetMonsterNotFoundFlag(bool value); bool GetTargetMonsterNotFoundFlag(void); bool FloorHasMissionMonster(struct mission_destination_info* mission_dst); -struct mission* MissionIsActiveOnFloor(struct dungeon_floor_pair* dungeon_floor_pair, uint8_t mission_id); +struct mission* MissionIsActiveOnFloor(struct dungeon_floor_pair* dungeon_floor_pair, + uint8_t mission_id); void GenerateMissionEggMonster(struct mission* mission); void LogMessageByIdWithPopupCheckParticipants(struct entity* user, struct entity* target, int message_id, int idx, int16_t val); From 129e0a5923840ffa504309eb4c113104ba34061a Mon Sep 17 00:00:00 2001 From: assidion Date: Thu, 6 Feb 2025 19:12:18 +0400 Subject: [PATCH 060/204] new --- headers/functions/arm9.h | 3 ++- headers/types/common/common.h | 41 +++++++++++++++++++++++++++++++++++ symbols/arm9.yml | 13 +++++++++-- 3 files changed, 54 insertions(+), 3 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 72470795..0cf66f38 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -1083,7 +1083,8 @@ void DeleteAllPossibleDungeonsList(void); int GenerateAllPossibleDeliverList(void); void DeleteAllPossibleDeliverList(void); void ClearMissionData(struct mission* mission); -bool ValidateNormalChallengeMission(undefined* param_1, struct mission* mission); +bool ValidateNormalChallengeMission(struct mission_rescue_bin* param_1, struct mission* mission); +bool ValidateLegendaryChallengeMission(struct mission_rescue_bin* param_1, struct mission* mission); 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); diff --git a/headers/types/common/common.h b/headers/types/common/common.h index 6b81a54e..a0da5146 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -818,6 +818,47 @@ struct mission_floors_forbidden { }; ASSERT_SIZE(struct mission_floors_forbidden, 2); +// Information about a valid mission; a list of these structs is stored in and directly loaded from RESCUE/rescue.bin. +// Used for validation as well as possibly for loading certain missions? +struct mission_rescue_bin { + 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: For challenge missions, is used as a boolean to indicate whether or not the mission unlocks its dungeon. + // For other missions, it is usually 0x4 and its purpose is unknown. + uint8_t unk_unlock_flag; + undefined field_0x9; + undefined field_0xa; + undefined field_0xb; + int8_t restricted_dungeon; // 0xC: Dungeon this mission is restricted to, or 0xFF if none + undefined field_0xd; + undefined field_0xe; + undefined field_0xf; + undefined field_0x10; + undefined field_0x11; + struct monster_id_16 client; // 0x12: Repurposed for storing the leader in challenge letters + undefined field_0x13; + undefined field_0x14; + undefined field_0x15; + undefined field_0x16; + undefined field_0x17; + struct monster_id_16 client; // 0x18: Repurposed for storing team member 2 in normal challenge letters + undefined field_0x19; + undefined field_0x1a; + undefined field_0x1b; + undefined field_0x1c; + undefined field_0x1d; + struct monster_id_16 outlaw_backup_species; // 0x1e: Repurposed for storing team member 3 in normal challenge letters + undefined field_0x1f; + struct mission_type_8 type; // 0x20 + union mission_subtype subtype; // 0x21 +} + // Unverified, ported from Irdkwia's notes struct quiz_answer_points_entry { undefined field_0x0; diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 5282fe17..4cc8b033 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -10410,9 +10410,18 @@ arm9: address: EU: 0x2060B80 description: |- - Validates a normal challenge letter mission by checking whether its client (leader), target (second member), and outlaw_backup_species (third member) match some hardcoded ids (alongside some other conditions). + Validates a normal challenge letter mission by checking whether its client (leader), target (second member), and outlaw_backup_species (third member) match those of some mission_rescue_bin struct (alongside some other conditions). - r0: ? + r0: mission_rescue_bin struct pointer + r1: mission struct pointer + return: bool + - name: ValidateLegendaryChallengeMission + address: + EU: 0x2060C80 + description: |- + Validates a legendary challenge letter mission by checking whether its dungeon matches the restricted dungeon of some mission_rescue_bin struct (alongside some other conditions). + + r0: mission_rescue_bin struct pointer r1: mission struct pointer return: bool - name: IsMonsterMissionAllowed From d776c78e194fb2a0fcff32a72f05922e0acad0f0 Mon Sep 17 00:00:00 2001 From: assidion Date: Thu, 6 Feb 2025 19:14:04 +0400 Subject: [PATCH 061/204] fix --- 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 a0da5146..188a5ceb 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -857,7 +857,7 @@ struct mission_rescue_bin { undefined field_0x1f; struct mission_type_8 type; // 0x20 union mission_subtype subtype; // 0x21 -} +}; // Unverified, ported from Irdkwia's notes struct quiz_answer_points_entry { From f9a570ad185a154c6a767eb4d5511c5261d24115 Mon Sep 17 00:00:00 2001 From: assidion Date: Thu, 6 Feb 2025 19:17:47 +0400 Subject: [PATCH 062/204] fix --- 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 188a5ceb..8fcda7a2 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -847,7 +847,7 @@ struct mission_rescue_bin { undefined field_0x15; undefined field_0x16; undefined field_0x17; - struct monster_id_16 client; // 0x18: Repurposed for storing team member 2 in normal challenge letters + struct monster_id_16 target; // 0x18: Repurposed for storing team member 2 in normal challenge letters undefined field_0x19; undefined field_0x1a; undefined field_0x1b; From 15c38587fb654446abaaf58176dd9cf18f005610 Mon Sep 17 00:00:00 2001 From: assidion Date: Thu, 6 Feb 2025 19:36:31 +0400 Subject: [PATCH 063/204] clang-format --- headers/types/common/common.h | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index 8fcda7a2..58c9348d 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -795,13 +795,13 @@ struct mission { int description_id; uint8_t unique_map_id; // 0xC: for challenges/treasure hunts/certain outlaws undefined field_0xd; - struct monster_id_16 client; // 0xE + struct monster_id_16 client; // 0xE // 0x10: Repurposed for storing the second team member of a normal challenge mission struct monster_id_16 target; // 0x12: Repurposed for storing the third team member of a normal challenge mission struct monster_id_16 outlaw_backup_species; - struct item_id_16 item_wanted; // 0x14 - struct mission_reward_type_8 reward_type; // 0x16 + struct item_id_16 item_wanted; // 0x14 + struct mission_reward_type_8 reward_type; // 0x16 undefined field_0x17; struct item_id_16 item_reward; // 0x18 struct mission_restriction_type_8 restriction_type; // 0x1A @@ -818,8 +818,8 @@ struct mission_floors_forbidden { }; ASSERT_SIZE(struct mission_floors_forbidden, 2); -// Information about a valid mission; a list of these structs is stored in and directly loaded from RESCUE/rescue.bin. -// Used for validation as well as possibly for loading certain missions? +// Information about a valid mission; a list of these structs is stored in and directly loaded from +// RESCUE/rescue.bin. Used for validation as well as possibly for loading certain missions? struct mission_rescue_bin { undefined field_0x0; undefined field_0x1; @@ -829,34 +829,37 @@ struct mission_rescue_bin { undefined field_0x5; undefined field_0x6; undefined field_0x7; - // 0x8: For challenge missions, is used as a boolean to indicate whether or not the mission unlocks its dungeon. - // For other missions, it is usually 0x4 and its purpose is unknown. + // 0x8: For challenge missions, is used as a boolean to indicate whether or not accepting the + // mission unlocks its dungeon. For other missions, it is usually 0x4 and its purpose is + // unknown. uint8_t unk_unlock_flag; undefined field_0x9; undefined field_0xa; undefined field_0xb; - int8_t restricted_dungeon; // 0xC: Dungeon this mission is restricted to, or 0xFF if none + int8_t restricted_dungeon; // 0xC: Dungeon this mission is restricted to, or 0xFF if none undefined field_0xd; undefined field_0xe; undefined field_0xf; undefined field_0x10; undefined field_0x11; - struct monster_id_16 client; // 0x12: Repurposed for storing the leader in challenge letters + struct monster_id_16 client; // 0x12: Repurposed for storing the leader in challenge letters undefined field_0x13; undefined field_0x14; undefined field_0x15; undefined field_0x16; undefined field_0x17; - struct monster_id_16 target; // 0x18: Repurposed for storing team member 2 in normal challenge letters + struct monster_id_16 + target; // 0x18: Repurposed for storing team member 2 in normal challenge letters undefined field_0x19; undefined field_0x1a; undefined field_0x1b; undefined field_0x1c; undefined field_0x1d; - struct monster_id_16 outlaw_backup_species; // 0x1e: Repurposed for storing team member 3 in normal challenge letters + struct monster_id_16 outlaw_backup_species; // 0x1e: Repurposed for storing team member 3 in + // normal challenge letters undefined field_0x1f; - struct mission_type_8 type; // 0x20 - union mission_subtype subtype; // 0x21 + struct mission_type_8 type; // 0x20 + union mission_subtype subtype; // 0x21 }; // Unverified, ported from Irdkwia's notes From 25348a9114801d930003c35d3c8c60815ce7d962 Mon Sep 17 00:00:00 2001 From: assidion Date: Thu, 6 Feb 2025 19:48:22 +0400 Subject: [PATCH 064/204] lol --- headers/types/common/common.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index 58c9348d..8f512688 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -830,8 +830,7 @@ struct mission_rescue_bin { undefined field_0x6; undefined field_0x7; // 0x8: For challenge missions, is used as a boolean to indicate whether or not accepting the - // mission unlocks its dungeon. For other missions, it is usually 0x4 and its purpose is - // unknown. + // mission unlocks its dungeon. For other missions, its purpose is unknown. uint8_t unk_unlock_flag; undefined field_0x9; undefined field_0xa; @@ -848,15 +847,15 @@ struct mission_rescue_bin { undefined field_0x15; undefined field_0x16; undefined field_0x17; - struct monster_id_16 - target; // 0x18: Repurposed for storing team member 2 in normal challenge letters + // 0x18: Repurposed for storing team member 2 in normal challenge letters + struct monster_id_16 target; undefined field_0x19; undefined field_0x1a; undefined field_0x1b; undefined field_0x1c; undefined field_0x1d; - struct monster_id_16 outlaw_backup_species; // 0x1e: Repurposed for storing team member 3 in - // normal challenge letters + // 0x1E: Repurposed for storing team member 3 in normal challenge letters + struct monster_id_16 outlaw_backup_species; undefined field_0x1f; struct mission_type_8 type; // 0x20 union mission_subtype subtype; // 0x21 From 4baccc79b4d93139ffa747b8472d87b84f430f0b Mon Sep 17 00:00:00 2001 From: assidion Date: Thu, 6 Feb 2025 19:53:10 +0400 Subject: [PATCH 065/204] info --- headers/types/common/common.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index 8f512688..72015034 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -829,8 +829,8 @@ struct mission_rescue_bin { undefined field_0x5; undefined field_0x6; undefined field_0x7; - // 0x8: For challenge missions, is used as a boolean to indicate whether or not accepting the - // mission unlocks its dungeon. For other missions, its purpose is unknown. + // 0x8: For legendary challenge missions, is used as a boolean to indicate whether or not + // accepting the mission unlocks its dungeon. For other missions, its purpose is unknown. uint8_t unk_unlock_flag; undefined field_0x9; undefined field_0xa; From 221f7dba8d0e27a30d98c9bed2900bc760be9412 Mon Sep 17 00:00:00 2001 From: assidion2 Date: Fri, 7 Feb 2025 10:21:05 +0400 Subject: [PATCH 066/204] Update symbols/arm9.yml Co-authored-by: UsernameFodder <93669634+UsernameFodder@users.noreply.github.com> --- symbols/arm9.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 4cc8b033..36fa6587 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -10410,7 +10410,7 @@ arm9: address: EU: 0x2060B80 description: |- - Validates a normal challenge letter mission by checking whether its client (leader), target (second member), and outlaw_backup_species (third member) match those of some mission_rescue_bin struct (alongside some other conditions). + Validates a normal (non-legendary) challenge letter mission by checking whether its client (leader), target (second member), and outlaw_backup_species (third member) match those of some mission_rescue_bin struct (alongside some other conditions). r0: mission_rescue_bin struct pointer r1: mission struct pointer From 6bda2f48d1a8309c5d44e74d98e20b149cb54794 Mon Sep 17 00:00:00 2001 From: assidion Date: Fri, 7 Feb 2025 10:30:35 +0400 Subject: [PATCH 067/204] changes --- headers/functions/arm9.h | 8 +++++--- headers/functions/overlay29.h | 2 +- headers/types/common/common.h | 12 ++++++------ symbols/overlay29.yml | 2 +- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 0cf66f38..4b566cd7 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -1070,7 +1070,7 @@ int DungeonRequestsDone(uint8_t param_1, bool param_2); int DungeonRequestsDoneWrapper(uint8_t param_1); bool AnyDungeonRequestsDone(uint8_t param_1); void AddMissionToJobList(struct mission* mission); -int GetAcceptedMission(uint8_t mission_id); +mission* GetAcceptedMission(uint8_t mission_id); 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, @@ -1083,8 +1083,10 @@ void DeleteAllPossibleDungeonsList(void); int GenerateAllPossibleDeliverList(void); void DeleteAllPossibleDeliverList(void); void ClearMissionData(struct mission* mission); -bool ValidateNormalChallengeMission(struct mission_rescue_bin* param_1, struct mission* mission); -bool ValidateLegendaryChallengeMission(struct mission_rescue_bin* param_1, struct mission* mission); +bool ValidateNormalChallengeMission(struct mission_rescue_bin* mission_rescue_bin, + struct mission* mission); +bool ValidateLegendaryChallengeMission(struct mission_rescue_bin* mission_rescue_bin, + struct mission* mission); 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); diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index 4881cc2b..6a357e31 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -870,7 +870,7 @@ enum monster_id GetMissionEnemyMinionGroup(int i); void SetTargetMonsterNotFoundFlag(bool value); bool GetTargetMonsterNotFoundFlag(void); bool FloorHasMissionMonster(struct mission_destination_info* mission_dst); -struct mission* MissionIsActiveOnFloor(struct dungeon_floor_pair* dungeon_floor_pair, +struct mission* GetMissionIfActiveOnFloor(struct dungeon_floor_pair* dungeon_floor_pair, uint8_t mission_id); void GenerateMissionEggMonster(struct mission* mission); void LogMessageByIdWithPopupCheckParticipants(struct entity* user, struct entity* target, diff --git a/headers/types/common/common.h b/headers/types/common/common.h index 72015034..ef6bd8e1 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -795,10 +795,10 @@ struct mission { int description_id; uint8_t unique_map_id; // 0xC: for challenges/treasure hunts/certain outlaws undefined field_0xd; - struct monster_id_16 client; // 0xE - // 0x10: Repurposed for storing the second team member of a normal challenge mission + struct monster_id_16 client; // 0xE: For challenge letter missions, stores the leader + // 0x10: For non-legendary challenge letter missions, stores the second team member struct monster_id_16 target; - // 0x12: Repurposed for storing the third team member of a normal challenge mission + // 0x12: For non-legendary challenge letter missions, stores the third team member struct monster_id_16 outlaw_backup_species; struct item_id_16 item_wanted; // 0x14 struct mission_reward_type_8 reward_type; // 0x16 @@ -841,20 +841,20 @@ struct mission_rescue_bin { undefined field_0xf; undefined field_0x10; undefined field_0x11; - struct monster_id_16 client; // 0x12: Repurposed for storing the leader in challenge letters + struct monster_id_16 client; // 0xE: For challenge letter missions, stores the leader undefined field_0x13; undefined field_0x14; undefined field_0x15; undefined field_0x16; undefined field_0x17; - // 0x18: Repurposed for storing team member 2 in normal challenge letters + // 0x10: For non-legendary challenge letter missions, stores the second team member struct monster_id_16 target; undefined field_0x19; undefined field_0x1a; undefined field_0x1b; undefined field_0x1c; undefined field_0x1d; - // 0x1E: Repurposed for storing team member 3 in normal challenge letters + // 0x10: For non-legendary challenge letter missions, stores the third team member struct monster_id_16 outlaw_backup_species; undefined field_0x1f; struct mission_type_8 type; // 0x20 diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index df90d43d..aa5f387a 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -8555,7 +8555,7 @@ overlay29: r0: mission destination info pointer return: bool - - name: MissionIsActiveOnFloor + - name: GetMissionIfActiveOnFloor address: EU: 0x234A390 description: |- From 4d9b2586b8a4c532a57768225cc87d80f6ec8097 Mon Sep 17 00:00:00 2001 From: assidion Date: Fri, 7 Feb 2025 10:34:14 +0400 Subject: [PATCH 068/204] changes --- headers/functions/arm9.h | 6 +++--- headers/functions/overlay29.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 4b566cd7..ca11c7b7 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -1070,7 +1070,7 @@ int DungeonRequestsDone(uint8_t param_1, bool param_2); int DungeonRequestsDoneWrapper(uint8_t param_1); bool AnyDungeonRequestsDone(uint8_t param_1); void AddMissionToJobList(struct mission* mission); -mission* GetAcceptedMission(uint8_t mission_id); +struct mission* GetAcceptedMission(uint8_t mission_id); 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, @@ -1083,9 +1083,9 @@ void DeleteAllPossibleDungeonsList(void); int GenerateAllPossibleDeliverList(void); void DeleteAllPossibleDeliverList(void); void ClearMissionData(struct mission* mission); -bool ValidateNormalChallengeMission(struct mission_rescue_bin* mission_rescue_bin, +bool ValidateNormalChallengeMission(struct mission_rescue_bin* valid_mission_info, struct mission* mission); -bool ValidateLegendaryChallengeMission(struct mission_rescue_bin* mission_rescue_bin, +bool ValidateLegendaryChallengeMission(struct mission_rescue_bin* valid_mission_info, struct mission* mission); bool IsMonsterMissionAllowed(enum monster_id monster_id); bool CanMonsterBeUsedForMissionWrapper(enum monster_id monster_id); diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index 6a357e31..ba967ee9 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -870,8 +870,8 @@ enum monster_id GetMissionEnemyMinionGroup(int i); void SetTargetMonsterNotFoundFlag(bool value); bool GetTargetMonsterNotFoundFlag(void); bool FloorHasMissionMonster(struct mission_destination_info* mission_dst); -struct mission* GetMissionIfActiveOnFloor(struct dungeon_floor_pair* dungeon_floor_pair, - uint8_t mission_id); +struct mission* GetMissionIfActiveOnFloor(struct dungeon_floor_pair* pair, + uint8_t mission_id); void GenerateMissionEggMonster(struct mission* mission); void LogMessageByIdWithPopupCheckParticipants(struct entity* user, struct entity* target, int message_id, int idx, int16_t val); From ae4c42d399b5aa581778f2a4b46ff9a6a26f99e9 Mon Sep 17 00:00:00 2001 From: assidion Date: Fri, 7 Feb 2025 10:48:59 +0400 Subject: [PATCH 069/204] aaa --- headers/functions/overlay29.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index ba967ee9..f30af9e1 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -870,8 +870,7 @@ enum monster_id GetMissionEnemyMinionGroup(int i); void SetTargetMonsterNotFoundFlag(bool value); bool GetTargetMonsterNotFoundFlag(void); bool FloorHasMissionMonster(struct mission_destination_info* mission_dst); -struct mission* GetMissionIfActiveOnFloor(struct dungeon_floor_pair* pair, - uint8_t mission_id); +struct mission* GetMissionIfActiveOnFloor(struct dungeon_floor_pair* pair, uint8_t mission_id); void GenerateMissionEggMonster(struct mission* mission); void LogMessageByIdWithPopupCheckParticipants(struct entity* user, struct entity* target, int message_id, int idx, int16_t val); From ed5accf9d4289c02b5be47f08fac8a69160a4987 Mon Sep 17 00:00:00 2001 From: assidion Date: Fri, 7 Feb 2025 18:56:20 +0400 Subject: [PATCH 070/204] aaa --- headers/types/common/common.h | 1 + 1 file changed, 1 insertion(+) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index ef6bd8e1..edfcbd9b 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -860,6 +860,7 @@ struct mission_rescue_bin { struct mission_type_8 type; // 0x20 union mission_subtype subtype; // 0x21 }; +ASSERT_SIZE(struct mission_rescue_bin, 34); // Unverified, ported from Irdkwia's notes struct quiz_answer_points_entry { From c6f82f6f2a7a904548db3cb2795a57a813dc935f Mon Sep 17 00:00:00 2001 From: assidion Date: Fri, 7 Feb 2025 18:58:38 +0400 Subject: [PATCH 071/204] aaa --- headers/types/common/common.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index edfcbd9b..7e980dbf 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -841,22 +841,19 @@ struct mission_rescue_bin { undefined field_0xf; undefined field_0x10; undefined field_0x11; - struct monster_id_16 client; // 0xE: For challenge letter missions, stores the leader - undefined field_0x13; + struct monster_id_16 client; // 0x12: For challenge letter missions, stores the leader undefined field_0x14; undefined field_0x15; undefined field_0x16; undefined field_0x17; - // 0x10: For non-legendary challenge letter missions, stores the second team member + // 0x18: For non-legendary challenge letter missions, stores the second team member struct monster_id_16 target; - undefined field_0x19; undefined field_0x1a; undefined field_0x1b; undefined field_0x1c; undefined field_0x1d; - // 0x10: For non-legendary challenge letter missions, stores the third team member + // 0x1E: For non-legendary challenge letter missions, stores the third team member struct monster_id_16 outlaw_backup_species; - undefined field_0x1f; struct mission_type_8 type; // 0x20 union mission_subtype subtype; // 0x21 }; From 5dbf0af37e4e2bb22411859e4b2feb2e2a618728 Mon Sep 17 00:00:00 2001 From: assidion Date: Sat, 17 May 2025 00:01:46 +0400 Subject: [PATCH 072/204] new --- headers/functions/arm9.h | 2 ++ headers/functions/overlay00.h | 6 ++++++ headers/functions/overlay29.h | 3 +++ symbols/arm9.yml | 19 +++++++++++++++++++ symbols/overlay00.yml | 9 ++++++++- symbols/overlay29.yml | 25 +++++++++++++++++++++++++ 6 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 headers/functions/overlay00.h diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index ca11c7b7..f4b73fa4 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -1028,6 +1028,7 @@ int GetPartyMembers(uint16_t* party_members); void RefillTeam(void); int ClearItem(int team_id, bool check); void ChangeGiratinaFormIfSkyDungeon(enum dungeon_id dungeon_id); +void RevertGiratinaAndShaymin(uint8_t member_idx); int GetIqSkillStringId(enum iq_skill_id iq_skill); bool DoesTacticFollowLeader(enum tactic_id tactic_id); void GetUnlockedTactics(enum tactic_id* unlocked_tactics, int level); @@ -1091,6 +1092,7 @@ 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); bool CanSendItem(enum item_id item_id, bool to_sky); bool IsAvailableItem(enum item_id item_id); diff --git a/headers/functions/overlay00.h b/headers/functions/overlay00.h new file mode 100644 index 00000000..a7c35f4c --- /dev/null +++ b/headers/functions/overlay00.h @@ -0,0 +1,6 @@ +#ifndef HEADERS_FUNCTIONS_OVERLAY00_H_ +#define HEADERS_FUNCTIONS_OVERLAY00_H_ + +void SelectRandomBackground(void); + +#endif diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index f30af9e1..b76d0530 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -51,8 +51,11 @@ 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 PlayEffectAnimationEntityStandard(struct entity* entity, int effect_id); void ShowPpRestoreEffect(struct entity* entity); bool ShouldDisplayEntityAdvanced(struct entity* entity); void PlayEffectAnimation0x1A9(struct entity* entity); diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 36fa6587..b0efc733 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -9886,6 +9886,15 @@ arm9: Note: unverified, ported from Irdkwia's notes r0: dungeon ID + - name: RevertGiratinaAndShaymin + address: + EU: 0x20589F0 + NA: 0x2058674 + description: |- + Reverts Giratina and Shaymin party members to their standard forms. + + r0: team member index in party + r1: ? - name: GetIqSkillStringId address: EU: 0x2058F98 @@ -10474,6 +10483,16 @@ arm9: r0: Monster ID return: True if PERFOMANCE_PROGRESS_FLAG[9] is true, false if it isn't and the monster ID (after converting it) is contained in MISSION_BANNED_STORY_MONSTERS or if it's the ID of the player or the partner, true otherwise. + - name: IsMonsterIllegalForMissions + address: + EU: 0x2062EE0 + description: |- + Checks if the monster index is illegal to be used for any mission. + + Illegal indexes include Shaymin-Sky, Giratina-Origin, Purple Kecleon, Shiny Celebi, Primal Dialga, and all the unused Arceus forms. + + r0: Monster ID + return: True if the specified monster is illegal for missions - name: CanDungeonBeUsedForMission address: EU: 0x2062F34 diff --git a/symbols/overlay00.yml b/symbols/overlay00.yml index 1e9dbf04..a733494a 100644 --- a/symbols/overlay00.yml +++ b/symbols/overlay00.yml @@ -15,5 +15,12 @@ overlay0: Likely contains supporting data and code related to the top menu. This is loaded together with overlay 1 while in the top menu. Since it's in overlay group 2 (together with overlay 10, which is another "data" overlay), this overlay probably plays a similar role. It mentions several files from the BACK folder that are known backgrounds for the top menu. - functions: [] + functions: + - name: SelectRandomBackground + address: + EU: 0x22BF12C + description: |- + Selects a random background from the BACK/s09p04-10a.bgp files to be used as the background for the top menu. + + No params. data: [] diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index aa5f387a..48aae1b3 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -707,6 +707,23 @@ overlay29: Also sets icon flags for statuses::exposed, statuses::grudge, critical HP and lowered stats with explicit checks, and applies the effect of the Identifier Orb (see dungeon::identify_orb_flag). + r0: entity pointer + - name: PlayQuestionMarkEffect + address: + EU: 0x22E4788 + description: |- + Plays the question mark effect (id = 0x144) on an entity. + + r0: entity pointer + - name: PlayExclamationPointEffect + address: + EU: + - 0x22E47D4 + - 0x22E4880 + - 0x22E5D4C + description: |- + Plays the exclamation point effect (id = 0x143) on an entity. + r0: entity pointer - name: PlayEffectAnimation0x171Full address: @@ -726,6 +743,14 @@ overlay29: Just a guess. Calls PlayEffectAnimation with data from animation ID 0x171. r0: entity pointer + - name: PlayEffectAnimationEntityStandard + address: + EU: 0x22E4C98 + description: |- + Calls PlayEffectAnimationEntity with standard parameters used in various functions throughout the game. + + r0: entity pointer + r1: effect id - name: ShowPpRestoreEffect address: EU: 0x22E5314 From 99f2f6977f270b1eabc0125e1bd03a4f6b8d50cc Mon Sep 17 00:00:00 2001 From: assidion Date: Sat, 17 May 2025 00:02:32 +0400 Subject: [PATCH 073/204] spacing --- symbols/overlay00.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay00.yml b/symbols/overlay00.yml index a733494a..dd2b2235 100644 --- a/symbols/overlay00.yml +++ b/symbols/overlay00.yml @@ -21,6 +21,6 @@ overlay0: EU: 0x22BF12C description: |- Selects a random background from the BACK/s09p04-10a.bgp files to be used as the background for the top menu. - + No params. data: [] From 098583b92d6fd5548556f30aa0e9eaf29547f5a0 Mon Sep 17 00:00:00 2001 From: assidion Date: Sun, 18 May 2025 12:29:02 +0400 Subject: [PATCH 074/204] fixes --- headers/functions/arm9.h | 2 +- symbols/overlay00.yml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 2cb69775..33723595 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -1038,7 +1038,7 @@ int GetPartyMembers(uint16_t* party_members); void RefillTeam(void); int ClearItem(int team_id, bool check); void ChangeGiratinaFormIfSkyDungeon(enum dungeon_id dungeon_id); -void RevertGiratinaAndShaymin(uint8_t member_idx); +void RevertGiratinaAndShaymin(uint8_t member_idx, undefined4 param_2); int GetIqSkillStringId(enum iq_skill_id iq_skill); bool DoesTacticFollowLeader(enum tactic_id tactic_id); void GetUnlockedTactics(enum tactic_id* unlocked_tactics, int level); diff --git a/symbols/overlay00.yml b/symbols/overlay00.yml index dd2b2235..f48703b0 100644 --- a/symbols/overlay00.yml +++ b/symbols/overlay00.yml @@ -17,10 +17,10 @@ overlay0: This is loaded together with overlay 1 while in the top menu. Since it's in overlay group 2 (together with overlay 10, which is another "data" overlay), this overlay probably plays a similar role. It mentions several files from the BACK folder that are known backgrounds for the top menu. functions: - name: SelectRandomBackground - address: - EU: 0x22BF12C - description: |- - Selects a random background from the BACK/s09p04-10a.bgp files to be used as the background for the top menu. + address: + EU: 0x22BF12C + description: |- + Selects a random background from the BACK/s09p04-10a.bgp files to be used as the background for the top menu. - No params. + No params. data: [] From b835b63c322cbc999ea7c44e727182055226a8d1 Mon Sep 17 00:00:00 2001 From: assidion Date: Sun, 18 May 2025 12:31:56 +0400 Subject: [PATCH 075/204] undefined --- 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 33723595..426992b0 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -1038,7 +1038,7 @@ int GetPartyMembers(uint16_t* party_members); void RefillTeam(void); int ClearItem(int team_id, bool check); void ChangeGiratinaFormIfSkyDungeon(enum dungeon_id dungeon_id); -void RevertGiratinaAndShaymin(uint8_t member_idx, undefined4 param_2); +void RevertGiratinaAndShaymin(uint8_t member_idx, undefined param_2); int GetIqSkillStringId(enum iq_skill_id iq_skill); bool DoesTacticFollowLeader(enum tactic_id tactic_id); void GetUnlockedTactics(enum tactic_id* unlocked_tactics, int level); From d59fcc85eabffcd836e2abf81b430ffe65165dc0 Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 5 Aug 2025 19:47:25 +0400 Subject: [PATCH 076/204] a --- headers/data/overlay10.h | 1 + headers/functions/arm9.h | 2 ++ headers/functions/overlay29.h | 2 ++ symbols/arm9.yml | 18 ++++++++++++++++++ symbols/overlay10.yml | 7 +++++++ symbols/overlay29.yml | 25 +++++++++++++++++++++++++ 6 files changed, 55 insertions(+) diff --git a/headers/data/overlay10.h b/headers/data/overlay10.h index aff5c075..dcf818ad 100644 --- a/headers/data/overlay10.h +++ b/headers/data/overlay10.h @@ -45,6 +45,7 @@ extern int16_t SUPER_LUCK_CRIT_RATE_BOOST; extern int16_t CONSTRICT_LOWER_SPEED_CHANCE; extern int16_t ICE_FANG_FREEZE_CHANCE; extern int16_t SMOG_POISON_CHANCE; +extern int16_t CUTE_CHARM_INFATUATE_CHANCE; extern int16_t LICK_PARALYZE_CHANCE; extern int16_t THUNDER_FANG_PARALYZE_CHANCE; extern int16_t BITE_CRINGE_CHANCE; diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 65864dfd..c02257c0 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -395,6 +395,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); +void PlaySeByIdVolumeWrapper(int index); void PlaySeVolumeWrapper(int index); void PlayBgmById(enum music_id music_id); void PlayBgmByIdVolume(enum music_id music_id, undefined param_2, int volume); @@ -532,6 +533,7 @@ 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); +void SubstitutePlaceholderItemTags(uint8_t tag_id, struct item* item, undefined4* param_3); uint8_t* AllocateTemp1024ByteBufferFromPool(void); void GetStringFromFileVeneer(char* buf, int string_id); char* StringFromId(int string_id); diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index cf5fe5f3..37c40f36 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -176,6 +176,7 @@ 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); @@ -887,6 +888,7 @@ bool GetTargetMonsterNotFoundFlag(void); 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); +void SetPreprocessorArgsIdVal(uint8_t pos, uint32_t val); void LogMessageByIdWithPopupCheckParticipants(struct entity* user, struct entity* target, int message_id, int idx, int16_t val); void LogMessageByIdWithPopupCheckUser(struct entity* user, int message_id); diff --git a/symbols/arm9.yml b/symbols/arm9.yml index a676fa9c..e1da7b9f 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -3882,6 +3882,13 @@ arm9: r0: Music ID r1: (?) Stored on byte 8 on the struct passed to SendAudioCommand r2: Volume (0-255) + - name: PlaySeByIdVolumeWrapper + address: + EU: 0x2017D1C + description: |- + Wrapper for PlaySeByIdVolume with 0x100 as the volume. + + r0: Index - name: PlaySeVolumeWrapper address: EU: 0x2017D68 @@ -5129,6 +5136,17 @@ arm9: Note: unverified, ported from Irdkwia's notes No params. + - name: SubstitutePlaceholderItemTags + address: + EU: 0x20252B4 + description: |- + Sets what item's name should be displayed in place of the [item:r0] tag when printing a string. + + Is almost always accompanied by a SetPreprocessorArgsIdVal(0, tag id | 0x40000) call in dungeon mode. + + r0: tag id + r1: item struct pointer + r2: some static address related to storing the item (always the same throughout the code) - name: AllocateTemp1024ByteBufferFromPool address: EU: 0x2025B54 diff --git a/symbols/overlay10.yml b/symbols/overlay10.yml index 2fe7c4c7..e4d5f45d 100644 --- a/symbols/overlay10.yml +++ b/symbols/overlay10.yml @@ -734,6 +734,13 @@ overlay10: NA: 0x2 JP: 0x2 description: "The chance of Smog (and others, see DoMoveDamagePoison40) poisoning, as a percentage (40%)." + - name: CUTE_CHARM_INFATUATE_CHANCE + address: + EU: 0x22C4E7C + length: + NA: 0x2 + JP: 0x2 + description: "The chance of Cute Charm infatuating, as a percentage (12%)." - name: LICK_PARALYZE_CHANCE address: EU: 0x22C4E80 diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index ce9e9ed2..82b9ac10 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -1957,6 +1957,13 @@ overlay29: Gets the gender of the player. return: monster_gender + - name: HandleHeldItemSwaps + address: + EU: 0x22F4F88 + description: |- + Handles giving/taking held items to/from a party member (and likely other things). + + r0: entity pointer - name: UseSingleUseItemWrapper address: EU: 0x22F5C88 @@ -8251,6 +8258,16 @@ overlay29: See https://developer.arm.com/documentation/dui0474/k/image-structure-and-generation/linker-generated-veneers/what-is-a-veneer- return: bool + - name: PrepareItemForPrinting + address: + EU: + - 0x2345728 + - 0x2345754 + description: |- + Calls functions to prepare an item to be printed in place of the [item:r0] tag. + + r0: tag id + r1: item struct pointer - name: GenerateStandardItem address: EU: 0x23457B4 @@ -8741,6 +8758,14 @@ overlay29: Note: unverified, ported from Irdkwia's notes r0: mission struct + - name: SetPreprocessorArgsIdVal + address: + EU: 0x234BC84 + description: |- + Sets an id_vals element in the global preprocessor_args struct passed throughout the code to PreprocessString to a specified value. + + r0: position in id_vals array + r1: value - name: LogMessageByIdWithPopupCheckParticipants address: EU: 0x234BE50 From 805b4c87b0355b74aba35857b307a21ef53f40d5 Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 5 Aug 2025 20:11:45 +0400 Subject: [PATCH 077/204] aaa --- symbols/overlay10.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/symbols/overlay10.yml b/symbols/overlay10.yml index e4d5f45d..d37b4d8a 100644 --- a/symbols/overlay10.yml +++ b/symbols/overlay10.yml @@ -1439,6 +1439,16 @@ overlay10: description: |- The turn range for the Nightmare status inflicted by Nightmare, [4, 8). + type: int16_t[2] + - name: REFLECT_LIGHT_SCREEN_TURN_RANGE + address: + EU: 0x22C5084 + length: + NA: 0x4 + JP: 0x4 + description: |- + The turn range for the Reflect and Light Screen statuses, [10, 12). + type: int16_t[2] - name: BURN_DAMAGE_MULTIPLIER address: @@ -1481,6 +1491,17 @@ overlay10: length: NA: 0x4 description: "The damage multiplier corresponding to MATCHUP_IMMUNE, as a fixed-point number with 8 fraction bits (0.5)." + - name: GASTRO_ACID_TURN_RANGE + address: + EU: 0x22C50C4 + NA: 0x22C476C + length: + NA: 0x4 + JP: 0x4 + description: |- + The turn range for the Gastro Acid status, [4, 10). + + type: int16_t[2] - name: SPORT_CONDITION_TURN_RANGE address: EU: 0x22C50E4 From 91fe49f62786ea5627271045a8dd70f36213f11e Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 5 Aug 2025 20:12:53 +0400 Subject: [PATCH 078/204] aaa --- headers/data/overlay10.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/headers/data/overlay10.h b/headers/data/overlay10.h index dcf818ad..4e4dfba7 100644 --- a/headers/data/overlay10.h +++ b/headers/data/overlay10.h @@ -120,10 +120,12 @@ extern fx32_8 FACADE_DAMAGE_MULTIPLIER; extern int16_t IMPRISON_TURN_RANGE[2]; extern int16_t SLEEP_TURN_RANGE[2]; extern int16_t NIGHTMARE_TURN_RANGE[2]; +extern int16_t REFLECT_LIGHT_SCREEN_TURN_RANGE[2]; extern fx32_8 BURN_DAMAGE_MULTIPLIER; extern int16_t REST_TURN_RANGE[2]; extern fx32_8 MATCHUP_SUPER_EFFECTIVE_MULTIPLIER_ERRATIC_PLAYER; extern fx32_8 MATCHUP_IMMUNE_MULTIPLIER; +extern int16_t GASTRO_ACID_TURN_RANGE[2]; extern int16_t SPORT_CONDITION_TURN_RANGE[2]; extern int16_t SURE_SHOT_TURN_RANGE[2]; extern int DETECT_BAND_MOVE_ACCURACY_DROP; From cae450071490b814cf053d3781230e7f604c2908 Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 5 Aug 2025 20:15:13 +0400 Subject: [PATCH 079/204] aaa --- symbols/arm9.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index e1da7b9f..aaecb1b3 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -5141,7 +5141,7 @@ arm9: EU: 0x20252B4 description: |- Sets what item's name should be displayed in place of the [item:r0] tag when printing a string. - + Is almost always accompanied by a SetPreprocessorArgsIdVal(0, tag id | 0x40000) call in dungeon mode. r0: tag id From 7620125a5adc3ca9f192f2562ecd69d3861ed604 Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 5 Aug 2025 20:19:04 +0400 Subject: [PATCH 080/204] aaa --- headers/functions/overlay29.h | 1 + 1 file changed, 1 insertion(+) diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index 37c40f36..f8a2dde1 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -837,6 +837,7 @@ void GenerateAndSpawnItem(enum item_id item_id, int16_t x, int16_t y, uint16_t q bool sticky, bool check_in_bag); bool IsHiddenStairsFloor(void); bool IsSecretBazaarVeneer(void); +void PrepareItemForPrinting(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); From 2ae20636a79fc83b9e895ce5c082317f5bcb380e Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 5 Aug 2025 21:40:37 +0400 Subject: [PATCH 081/204] aaa --- symbols/arm9.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index aaecb1b3..dca0b595 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -5141,9 +5141,9 @@ arm9: EU: 0x20252B4 description: |- Sets what item's name should be displayed in place of the [item:r0] tag when printing a string. - + Is almost always accompanied by a SetPreprocessorArgsIdVal(0, tag id | 0x40000) call in dungeon mode. - + r0: tag id r1: item struct pointer r2: some static address related to storing the item (always the same throughout the code) From 07fd967600c50bd76dc0a4a071edba7cc94ed0a4 Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 5 Aug 2025 21:44:57 +0400 Subject: [PATCH 082/204] aaa --- headers/functions/arm9.h | 2 +- symbols/arm9.yml | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index c02257c0..b9604c23 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -523,6 +523,7 @@ char* GetRankString(char* s, int rank_and_flags); char* GetCurrentTeamNameString(char* buffer, int param_2); char* GetBagNameString(char* buffer); 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); @@ -533,7 +534,6 @@ 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); -void SubstitutePlaceholderItemTags(uint8_t tag_id, struct item* item, undefined4* param_3); uint8_t* AllocateTemp1024ByteBufferFromPool(void); void GetStringFromFileVeneer(char* buf, int string_id); char* StringFromId(int string_id); diff --git a/symbols/arm9.yml b/symbols/arm9.yml index dca0b595..09012ef5 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -5022,6 +5022,17 @@ arm9: r0: String to return return: Pointer to resulting string + - name: SubstitutePlaceholderItemTags + address: + EU: 0x20252B4 + description: |- + Sets what item's name should be displayed in place of the [item:r0] tag when printing a string. + + Is almost always accompanied by a SetPreprocessorArgsIdVal(0, tag id | 0x40000) call in dungeon mode. + + r0: tag id + r1: item struct pointer + r2: some static address related to storing the item (always the same throughout the code) - name: SetQuestionMarks address: EU: 0x20253B0 @@ -5136,17 +5147,6 @@ arm9: Note: unverified, ported from Irdkwia's notes No params. - - name: SubstitutePlaceholderItemTags - address: - EU: 0x20252B4 - description: |- - Sets what item's name should be displayed in place of the [item:r0] tag when printing a string. - - Is almost always accompanied by a SetPreprocessorArgsIdVal(0, tag id | 0x40000) call in dungeon mode. - - r0: tag id - r1: item struct pointer - r2: some static address related to storing the item (always the same throughout the code) - name: AllocateTemp1024ByteBufferFromPool address: EU: 0x2025B54 From 89cfcefb357085bc07d486629708535109bd0f5b Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 5 Aug 2025 21:45:52 +0400 Subject: [PATCH 083/204] aaa --- symbols/arm9.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 09012ef5..3b3d3e87 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -5027,9 +5027,9 @@ arm9: EU: 0x20252B4 description: |- Sets what item's name should be displayed in place of the [item:r0] tag when printing a string. - + Is almost always accompanied by a SetPreprocessorArgsIdVal(0, tag id | 0x40000) call in dungeon mode. - + r0: tag id r1: item struct pointer r2: some static address related to storing the item (always the same throughout the code) From 972aecfc152ab3c362fc66f2f366f8a33bd5e8a2 Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 5 Aug 2025 23:49:27 +0400 Subject: [PATCH 084/204] aaa --- 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 f8a2dde1..8e30fa14 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -889,7 +889,7 @@ bool GetTargetMonsterNotFoundFlag(void); 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); -void SetPreprocessorArgsIdVal(uint8_t pos, uint32_t val); +void SetPreprocessorArgsIdVal(uint8_t tag_id, uint32_t val); void LogMessageByIdWithPopupCheckParticipants(struct entity* user, struct entity* target, int message_id, int idx, int16_t val); void LogMessageByIdWithPopupCheckUser(struct entity* user, int message_id); From 8e7a974e41b476ff5136bacdcd9526a068e8034c Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 5 Aug 2025 23:50:40 +0400 Subject: [PATCH 085/204] aaa --- 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 8e30fa14..f8a2dde1 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -889,7 +889,7 @@ bool GetTargetMonsterNotFoundFlag(void); 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); -void SetPreprocessorArgsIdVal(uint8_t tag_id, uint32_t val); +void SetPreprocessorArgsIdVal(uint8_t pos, uint32_t val); void LogMessageByIdWithPopupCheckParticipants(struct entity* user, struct entity* target, int message_id, int idx, int16_t val); void LogMessageByIdWithPopupCheckUser(struct entity* user, int message_id); From 05ae6c0f2acfe87c2baaf5d4d7a24201f59dad93 Mon Sep 17 00:00:00 2001 From: assidion Date: Sun, 10 Aug 2025 22:50:45 +0400 Subject: [PATCH 086/204] corrections --- headers/functions/arm9.h | 2 +- symbols/arm9.yml | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index ff0da600..beeb140a 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -1084,7 +1084,7 @@ int CountJobListMissions(void); int DungeonRequestsDone(uint8_t param_1, bool param_2); int DungeonRequestsDoneWrapper(uint8_t param_1); bool AnyDungeonRequestsDone(uint8_t param_1); -void AddMissionToJobList(struct mission* mission); +bool AddMissionToJobList(struct mission* mission); struct mission* GetAcceptedMission(uint8_t mission_id); int GetMissionByTypeAndDungeon(int start_index, enum mission_type mission_type, undefined* subtype_struct, enum dungeon_id dungeon_id); diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 2b38df2a..fe93f322 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -5042,7 +5042,7 @@ arm9: description: |- Sets what item's name should be displayed in place of the [item:r0] tag when printing a string. - Is almost always accompanied by a SetPreprocessorArgsIdVal(0, tag id | 0x40000) call in dungeon mode. + Is almost always accompanied by a SetPreprocessorArgsIdVal(tag id, tag id | 0x40000) call in dungeon mode. r0: tag id r1: item struct pointer @@ -10385,7 +10385,7 @@ arm9: Calls DungeonRequestsDone with the second argument set to false. r0: ? - return: number of mission completed + return: number of missions completed - name: AnyDungeonRequestsDone address: EU: 0x205F19C @@ -10405,6 +10405,7 @@ arm9: Adds a mission to the Job List. r0: mission to add + return: bool (0 if mission was successfully added) - name: GetAcceptedMission address: EU: 0x205F454 From 7cbcd54df5b6edd4b53febd5fe30844c8cd32f3f Mon Sep 17 00:00:00 2001 From: assidion Date: Mon, 11 Aug 2025 23:14:44 +0400 Subject: [PATCH 087/204] a --- headers/functions/arm9.h | 3 ++- headers/types/common/enums.h | 9 +++++++++ symbols/arm9.yml | 16 ++++++++++++---- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index beeb140a..8153333c 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -541,7 +541,7 @@ 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, int group_id, 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); uint8_t GetCharWidth(char symbol); @@ -1117,6 +1117,7 @@ bool CanDungeonBeUsedForMission(enum dungeon_id dungeon_id); bool CanSendItem(enum item_id item_id, bool to_sky); bool IsAvailableItem(enum item_id item_id); int GetAvailableItemDeliveryList(undefined* item_buffer); +enum monster_id UnkMonsterIdFunc(undefined param_1); int GetActorMatchingStorageId(int actor_id); void SetActorTalkMainAndActorTalkSub(int actor_id_main, int actor_id_sub); void SetActorTalkMain(int actor_id); diff --git a/headers/types/common/enums.h b/headers/types/common/enums.h index 27cc7435..a7df184e 100644 --- a/headers/types/common/enums.h +++ b/headers/types/common/enums.h @@ -4232,6 +4232,15 @@ enum stairs_type { STAIRS_TYPE_HIDDEN = 3, }; +enum talk_type { + TALK_TYPE_HEALTHY = 0, + TALK_TYPE_HALF_LFIE = 1, + TALK_TYPE_PINCH = 2, + TALK_TYPE_LEVEL_UP = 3, + TALK_TYPE_WAIT = 4, + TALK_TYPE_GROUND_WAIT = 5, +}; + #pragma pack(push, 1) ENUM_8_BIT(box_type); #pragma pack(pop) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index fe93f322..e3084e8c 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -5227,12 +5227,12 @@ arm9: NA: 0x202598C JP: 0x202596C description: |- - Note: unverified, ported from Irdkwia's notes + Gets the string id to be displayed for dialogue with a team member. - r0: personality_index - r1: group_id + r0: personality_index (either a monster id or some constant) + r1: talk type r2: restrictions - return: ? + return: string id - name: IsAOrBPressed address: EU: 0x20261CC @@ -10693,6 +10693,14 @@ arm9: r0: item_buffer return: Number of deliverable items for a mission + - name: UnkMonsterIdFunc + address: + EU: 0x02065CF0 + description: |- + When called with r0 = 0x2F, returns the monster id of the current team member the player is talking to in the overworld (or 0 if none). + + r0: ? + return: monster id - name: GetActorMatchingStorageId address: EU: 0x2065D14 From dab1b9e0c25925483b8f6260f976ebb3190270a2 Mon Sep 17 00:00:00 2001 From: assidion Date: Mon, 11 Aug 2025 23:16:56 +0400 Subject: [PATCH 088/204] a --- symbols/arm9.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index e3084e8c..a8813afc 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -10695,7 +10695,7 @@ arm9: return: Number of deliverable items for a mission - name: UnkMonsterIdFunc address: - EU: 0x02065CF0 + EU: 0x2065CF0 description: |- When called with r0 = 0x2F, returns the monster id of the current team member the player is talking to in the overworld (or 0 if none). From 8661f5e8498743e80ed383e470349b68e140e05e Mon Sep 17 00:00:00 2001 From: assidion Date: Mon, 11 Aug 2025 23:37:09 +0400 Subject: [PATCH 089/204] typo --- headers/types/common/enums.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/types/common/enums.h b/headers/types/common/enums.h index a7df184e..032e2e51 100644 --- a/headers/types/common/enums.h +++ b/headers/types/common/enums.h @@ -4234,7 +4234,7 @@ enum stairs_type { enum talk_type { TALK_TYPE_HEALTHY = 0, - TALK_TYPE_HALF_LFIE = 1, + TALK_TYPE_HALF_LIFE = 1, TALK_TYPE_PINCH = 2, TALK_TYPE_LEVEL_UP = 3, TALK_TYPE_WAIT = 4, From f15ce0a59cc7471f61c2fd3b1d06c233dc268fa0 Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 12 Aug 2025 00:16:00 +0400 Subject: [PATCH 090/204] a --- headers/functions/arm9.h | 2 +- symbols/arm9.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 8153333c..502803e0 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -1117,7 +1117,7 @@ bool CanDungeonBeUsedForMission(enum dungeon_id dungeon_id); bool CanSendItem(enum item_id item_id, bool to_sky); bool IsAvailableItem(enum item_id item_id); int GetAvailableItemDeliveryList(undefined* item_buffer); -enum monster_id UnkMonsterIdFunc(undefined param_1); +enum monster_id UnkMonsterIdFunc(int actor_id); int GetActorMatchingStorageId(int actor_id); void SetActorTalkMainAndActorTalkSub(int actor_id_main, int actor_id_sub); void SetActorTalkMain(int actor_id); diff --git a/symbols/arm9.yml b/symbols/arm9.yml index a8813afc..7185f2f0 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -10693,13 +10693,13 @@ arm9: r0: item_buffer return: Number of deliverable items for a mission - - name: UnkMonsterIdFunc + - name: GetActorMonsterId address: EU: 0x2065CF0 description: |- - When called with r0 = 0x2F, returns the monster id of the current team member the player is talking to in the overworld (or 0 if none). + Returns the monster id of the actor given by the actor id. - r0: ? + r0: actor_id return: monster id - name: GetActorMatchingStorageId address: From d3040d77330f46460addafa51ffed96f05bd4422 Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 12 Aug 2025 00:16:22 +0400 Subject: [PATCH 091/204] a --- 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 502803e0..85935132 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -1117,7 +1117,7 @@ bool CanDungeonBeUsedForMission(enum dungeon_id dungeon_id); bool CanSendItem(enum item_id item_id, bool to_sky); bool IsAvailableItem(enum item_id item_id); int GetAvailableItemDeliveryList(undefined* item_buffer); -enum monster_id UnkMonsterIdFunc(int actor_id); +enum monster_id GetActorMonsterId(int actor_id); int GetActorMatchingStorageId(int actor_id); void SetActorTalkMainAndActorTalkSub(int actor_id_main, int actor_id_sub); void SetActorTalkMain(int actor_id); From 07b9dcc93b857bdd9ef4dbe07d7950ce7ef52d64 Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 12 Aug 2025 01:26:12 +0400 Subject: [PATCH 092/204] a --- headers/functions/arm9.h | 4 ++-- symbols/arm9.yml | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 85935132..e1592c28 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -1117,8 +1117,8 @@ bool CanDungeonBeUsedForMission(enum dungeon_id dungeon_id); bool CanSendItem(enum item_id item_id, bool to_sky); bool IsAvailableItem(enum item_id item_id); int GetAvailableItemDeliveryList(undefined* item_buffer); -enum monster_id GetActorMonsterId(int actor_id); -int GetActorMatchingStorageId(int actor_id); +enum monster_id GetScriptEntityMonsterId(enum script_entity_id entity_id); +int GetScriptEntityMatchingStorageId(enum script_entity_id entity_id); void SetActorTalkMainAndActorTalkSub(int actor_id_main, int actor_id_sub); void SetActorTalkMain(int actor_id); void SetActorTalkSub(int actor_id); diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 7185f2f0..d750735f 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -10693,23 +10693,23 @@ arm9: r0: item_buffer return: Number of deliverable items for a mission - - name: GetActorMonsterId + - name: GetScriptEntityMonsterId address: EU: 0x2065CF0 description: |- - Returns the monster id of the actor given by the actor id. + Returns the monster id of the script entity given by the id. - r0: actor_id + r0: script_entity_id return: monster id - - name: GetActorMatchingStorageId + - name: GetScriptEntityMatchingStorageId address: EU: 0x2065D14 NA: 0x2065998 JP: 0x2065C80 description: |- - Note: unverified, ported from Irdkwia's notes + Returns the storage id matching the script entity given by the id. - r0: actor_id + r0: script_entity_id return: storage ID - name: SetActorTalkMainAndActorTalkSub address: From 92f271c3978f9617b6206bc689e8975ef2bd7a9a Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 12 Aug 2025 13:02:47 +0400 Subject: [PATCH 093/204] a --- headers/functions/arm9.h | 1 + symbols/arm9.yml | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index e1592c28..a516b724 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -1117,6 +1117,7 @@ bool CanDungeonBeUsedForMission(enum dungeon_id dungeon_id); bool CanSendItem(enum item_id item_id, bool to_sky); bool IsAvailableItem(enum item_id item_id); int GetAvailableItemDeliveryList(undefined* item_buffer); +int GetScriptEntityActorId(enum script_entity_id entity_id); enum monster_id GetScriptEntityMonsterId(enum script_entity_id entity_id); int GetScriptEntityMatchingStorageId(enum script_entity_id entity_id); void SetActorTalkMainAndActorTalkSub(int actor_id_main, int actor_id_sub); diff --git a/symbols/arm9.yml b/symbols/arm9.yml index d750735f..0072f1ab 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -10693,6 +10693,14 @@ arm9: r0: item_buffer return: Number of deliverable items for a mission + - name: GetScriptEntityActorId + address: + EU: 0x2065CF0 + description: |- + Returns the actor id of the script entity given by the id. + + r0: script_entity_id + return: actor_id - name: GetScriptEntityMonsterId address: EU: 0x2065CF0 From 08535017c8d105e61fd0f2a0bdb4642437e630f8 Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 12 Aug 2025 13:03:55 +0400 Subject: [PATCH 094/204] a --- symbols/arm9.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 0072f1ab..4a30918c 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -10695,7 +10695,7 @@ arm9: return: Number of deliverable items for a mission - name: GetScriptEntityActorId address: - EU: 0x2065CF0 + EU: 0x20653CC description: |- Returns the actor id of the script entity given by the id. From f887158d3bd8242c94e1362a27864317d9884019 Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 12 Aug 2025 13:08:02 +0400 Subject: [PATCH 095/204] a --- headers/functions/arm9.h | 2 +- symbols/arm9.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index a516b724..ca0156e1 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -1117,7 +1117,7 @@ bool CanDungeonBeUsedForMission(enum dungeon_id dungeon_id); bool CanSendItem(enum item_id item_id, bool to_sky); bool IsAvailableItem(enum item_id item_id); int GetAvailableItemDeliveryList(undefined* item_buffer); -int GetScriptEntityActorId(enum script_entity_id entity_id); +int ScriptEntityIdToActorId(enum script_entity_id entity_id); enum monster_id GetScriptEntityMonsterId(enum script_entity_id entity_id); int GetScriptEntityMatchingStorageId(enum script_entity_id entity_id); void SetActorTalkMainAndActorTalkSub(int actor_id_main, int actor_id_sub); diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 4a30918c..cf8862c9 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -10693,11 +10693,11 @@ arm9: r0: item_buffer return: Number of deliverable items for a mission - - name: GetScriptEntityActorId + - name: ScriptEntityIdToActorId address: EU: 0x20653CC description: |- - Returns the actor id of the script entity given by the id. + Converts a script entity id to an actor id (index in the entities table). r0: script_entity_id return: actor_id From 88b86cfc72ab0debbafef8905e83642c0529fb0d Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 12 Aug 2025 13:13:42 +0400 Subject: [PATCH 096/204] a --- symbols/arm9.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index cf8862c9..4800eadb 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -10697,7 +10697,7 @@ arm9: address: EU: 0x20653CC description: |- - Converts a script entity id to an actor id (index in the entities table). + Converts a script entity id to an actor id (index in the entities table), or -1 if invalid. r0: script_entity_id return: actor_id From fbcc2da87cee1481ecf4b322816bfe8930e8df39 Mon Sep 17 00:00:00 2001 From: assidion Date: Wed, 13 Aug 2025 10:10:03 +0400 Subject: [PATCH 097/204] a --- symbols/arm9.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 4800eadb..4e4ec925 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -10710,6 +10710,8 @@ arm9: r0: script_entity_id return: monster id - name: GetScriptEntityMatchingStorageId + aliases: ++ - GetActorMatchingStorageId address: EU: 0x2065D14 NA: 0x2065998 From 651fe2b443c694aabf111f4d40edb193496cc62c Mon Sep 17 00:00:00 2001 From: assidion Date: Wed, 13 Aug 2025 10:12:35 +0400 Subject: [PATCH 098/204] a --- symbols/arm9.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 4e4ec925..928f075b 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -10711,7 +10711,7 @@ arm9: return: monster id - name: GetScriptEntityMatchingStorageId aliases: -+ - GetActorMatchingStorageId + - GetActorMatchingStorageId address: EU: 0x2065D14 NA: 0x2065998 From dbdfaf7c6311f6c928e773218e262eb84e54d109 Mon Sep 17 00:00:00 2001 From: assidion Date: Wed, 13 Aug 2025 10:14:39 +0400 Subject: [PATCH 099/204] a --- symbols/arm9.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 928f075b..d073e694 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -10697,10 +10697,10 @@ arm9: address: EU: 0x20653CC description: |- - Converts a script entity id to an actor id (index in the entities table), or -1 if invalid. + Converts a script entity id to an actor id (index in the entities table). - r0: script_entity_id - return: actor_id + r0: [output] script_entity_id, becomes actor_id + return: ? (-1 if invalid) - name: GetScriptEntityMonsterId address: EU: 0x2065CF0 From ec36f970446d1b62fdaa408784a96fca42c21b97 Mon Sep 17 00:00:00 2001 From: assidion Date: Wed, 13 Aug 2025 10:20:16 +0400 Subject: [PATCH 100/204] a --- headers/functions/arm9.h | 2 +- symbols/arm9.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index ca0156e1..d2f37fd9 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -1117,7 +1117,7 @@ bool CanDungeonBeUsedForMission(enum dungeon_id dungeon_id); bool CanSendItem(enum item_id item_id, bool to_sky); bool IsAvailableItem(enum item_id item_id); int GetAvailableItemDeliveryList(undefined* item_buffer); -int ScriptEntityIdToActorId(enum script_entity_id entity_id); +int ScriptEntityIdToActorId(int* actor_or_script_entity_id); enum monster_id GetScriptEntityMonsterId(enum script_entity_id entity_id); int GetScriptEntityMatchingStorageId(enum script_entity_id entity_id); void SetActorTalkMainAndActorTalkSub(int actor_id_main, int actor_id_sub); diff --git a/symbols/arm9.yml b/symbols/arm9.yml index d073e694..8bc02248 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -10697,7 +10697,7 @@ arm9: address: EU: 0x20653CC description: |- - Converts a script entity id to an actor id (index in the entities table). + When between 0x2e-0x31, converts a script entity id to an actor id (index in the entities table). Otherwise, its behavior is unknown. r0: [output] script_entity_id, becomes actor_id return: ? (-1 if invalid) From 1c713f8d9c8201ccdd3d91b2be563df84382ae9d Mon Sep 17 00:00:00 2001 From: assidion Date: Wed, 13 Aug 2025 19:09:40 +0400 Subject: [PATCH 101/204] a --- headers/functions/arm9.h | 7 +++---- symbols/arm9.yml | 20 ++++++-------------- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index d2f37fd9..6381a174 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -1117,12 +1117,11 @@ bool CanDungeonBeUsedForMission(enum dungeon_id dungeon_id); bool CanSendItem(enum item_id item_id, bool to_sky); bool IsAvailableItem(enum item_id item_id); int GetAvailableItemDeliveryList(undefined* item_buffer); -int ScriptEntityIdToActorId(int* actor_or_script_entity_id); enum monster_id GetScriptEntityMonsterId(enum script_entity_id entity_id); int GetScriptEntityMatchingStorageId(enum script_entity_id entity_id); -void SetActorTalkMainAndActorTalkSub(int actor_id_main, int actor_id_sub); -void SetActorTalkMain(int actor_id); -void SetActorTalkSub(int actor_id); +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 RandomizeDemoActors(void); void ItemAtTableIdx(int idx, struct bulk_item* item); void MainLoop(void); diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 8bc02248..a0130b67 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -10693,14 +10693,6 @@ arm9: r0: item_buffer return: Number of deliverable items for a mission - - name: ScriptEntityIdToActorId - address: - EU: 0x20653CC - description: |- - When between 0x2e-0x31, converts a script entity id to an actor id (index in the entities table). Otherwise, its behavior is unknown. - - r0: [output] script_entity_id, becomes actor_id - return: ? (-1 if invalid) - name: GetScriptEntityMonsterId address: EU: 0x2065CF0 @@ -10729,28 +10721,28 @@ arm9: description: |- Sets ACTOR_TALK_MAIN and ACTOR_TALK_SUB to given actor IDs. - r0: actor_id for ACTOR_TALK_MAIN - r1: actor_id for ACTOR_TALK_SUB + r0: script_entity_id for ACTOR_TALK_MAIN + r1: script_entity_id for ACTOR_TALK_SUB - name: SetActorTalkMain address: EU: 0x2065ECC NA: 0x2065B50 JP: 0x2065E38 description: |- - Sets ACTOR_TALK_MAIN to be actor_id. + Sets ACTOR_TALK_MAIN to be entity_id. Implements SPECIAL_PROC_SET_ACTOR_TALK_MAIN (see ScriptSpecialProcessCall). - r0: actor_id + r0: script_entity_id - name: SetActorTalkSub address: EU: 0x2065EDC NA: 0x2065B60 JP: 0x2065E48 description: |- - Sets ACTOR_TALK_SUB to be actor_id. + Sets ACTOR_TALK_SUB to be entity_id. Implements SPECIAL_PROC_SET_ACTOR_TALK_SUB (see ScriptSpecialProcessCall). - r0: actor_id + r0: script_entity_id - name: RandomizeDemoActors address: EU: 0x2065FC4 From 61a32035005da706b2fe205d80be00a9ca20b607 Mon Sep 17 00:00:00 2001 From: assidion Date: Wed, 13 Aug 2025 19:15:08 +0400 Subject: [PATCH 102/204] a --- headers/functions/arm9.h | 1 - symbols/arm9.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index dabe4707..b21e13e8 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -547,7 +547,6 @@ 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); uint8_t GetCharWidth(char symbol); diff --git a/symbols/arm9.yml b/symbols/arm9.yml index f6d6615e..00934824 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -5254,7 +5254,6 @@ arm9: JP: 0x202596C description: |- Gets the string id to be displayed for dialogue with a team member. - Gets the string id to be displayed for dialogue with a team member. r0: personality_index (either a monster id or some constant) r1: talk type From ef08a5035765d44764ce067031de735f48581e1f Mon Sep 17 00:00:00 2001 From: assidion Date: Wed, 13 Aug 2025 19:16:11 +0400 Subject: [PATCH 103/204] a --- symbols/arm9.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 00934824..37805e91 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -10755,7 +10755,7 @@ arm9: NA: 0x2065B50 JP: 0x2065E38 description: |- - Sets ACTOR_TALK_MAIN to be entity_id. + Sets ACTOR_TALK_MAIN to be actor_id. Implements SPECIAL_PROC_SET_ACTOR_TALK_MAIN (see ScriptSpecialProcessCall). r0: script_entity_id @@ -10765,7 +10765,7 @@ arm9: NA: 0x2065B60 JP: 0x2065E48 description: |- - Sets ACTOR_TALK_SUB to be entity_id. + Sets ACTOR_TALK_SUB to be actor_id. Implements SPECIAL_PROC_SET_ACTOR_TALK_SUB (see ScriptSpecialProcessCall). r0: script_entity_id From ccf1189b386e9c329ea6d64c4ef7ce2c40cd16d1 Mon Sep 17 00:00:00 2001 From: assidion2 Date: Wed, 13 Aug 2025 20:44:29 +0400 Subject: [PATCH 104/204] Update arm9.h --- headers/functions/arm9.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index b21e13e8..7393a84a 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -1124,7 +1124,8 @@ bool IsAvailableItem(enum item_id item_id); int GetAvailableItemDeliveryList(undefined* item_buffer); 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, enum script_entity_id actor_id_sub); +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 RandomizeDemoActors(void); From 89bcb6004de11850927ae32e50232ebad1ac5af0 Mon Sep 17 00:00:00 2001 From: assidion Date: Sun, 31 Aug 2025 23:48:12 +0400 Subject: [PATCH 105/204] a --- headers/functions/arm9.h | 5 +++++ headers/functions/overlay29.h | 2 ++ headers/functions/overlay31.h | 1 + headers/types/common/window.h | 9 +++++++- symbols/arm9.yml | 40 +++++++++++++++++++++++++++++++++++ symbols/overlay29.yml | 16 ++++++++++++++ symbols/overlay31.yml | 7 ++++++ 7 files changed, 79 insertions(+), 1 deletion(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 7393a84a..5330496f 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -614,6 +614,7 @@ bool IsAdvancedMenuActive(int window_id); int GetAdvancedMenuCurrentOption(int window_id); int GetAdvancedMenuResult(int window_id); void UpdateAdvancedMenu(struct window* window); +void HandleCheckIQMenu(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, @@ -713,6 +714,7 @@ void CloseAdvancedTextBox2(int window_id); void SetAdvancedTextBoxState5(int window_id); void CloseAdvancedTextBox(int window_id); 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); @@ -732,6 +734,9 @@ void InitWindowInput(struct window_input_ctx* input_ctx, struct window_flags fla struct window_extra_info* window_extra_info, struct window_rectangle* rect, int n_items, int n_items_per_page); bool IsMenuOptionActive(undefined* param_1); +uint8_t GetPageStart(struct window_input_ctx* input_ctx); +uint8_t GetNumItemsOnPage(struct window_input_ctx* input_ctx); +int GetPageItemYOffset(struct window_input_ctx* input_ctx, uint8_t item); 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, diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index d4d6b316..6879b835 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -236,6 +236,8 @@ 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); +bool IsSpecialStoryAllyOrClient(struct entity* entity); bool IsSpecialStoryAlly(struct monster* monster); bool IsExperienceLocked(struct monster* monster); void InitOtherMonsterData(struct entity* entity, int fixed_room_stats_index, enum direction_id dir); diff --git a/headers/functions/overlay31.h b/headers/functions/overlay31.h index 939983b8..ade91fab 100644 --- a/headers/functions/overlay31.h +++ b/headers/functions/overlay31.h @@ -17,6 +17,7 @@ bool HandleMovesMenu(undefined* param_1, undefined param_2, undefined param_3, i undefined TeamMenu(struct entity* leader); void RestMenu(void); int RecruitmentSearchMenuLoop(void); +void DrawDungeonHintContents(int window_id); int HelpMenuLoop(void); #endif diff --git a/headers/types/common/window.h b/headers/types/common/window.h index 81f832b3..5a9a8983 100644 --- a/headers/types/common/window.h +++ b/headers/types/common/window.h @@ -328,7 +328,14 @@ ASSERT_SIZE(struct window_list, 4480); // Appears to be used to track state related to interactive windows? // Probably used for various things? struct window_input_ctx { - undefined fields_0x0[244]; + undefined fields_0x0[180]; + uint32_t first_item_y_offset; // 0xB4: Y-offset for first item on page + uint32_t y_offset_diff; // 0xB8: Difference in the Y-offset between one item and the next, shifted left by 8 bits + undefined4 field_0xbc; + uint32_t n_items_on_page; // 0xC0: Number of items on the page + uint32_t max_items_on_page; // 0xC4: Maximum possible number of items on the page + uint32_t current_page_id; // 0xC8: Current page the user is on (starts at 0) + undefined fields_0xcc[40]; uint8_t field_0xf4; undefined field_0xf5; undefined field_0xf6; diff --git a/symbols/arm9.yml b/symbols/arm9.yml index a12ac82d..b88f137b 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -5870,6 +5870,13 @@ arm9: description: |- Window update function for advanced menus. + r0: window pointer + - name: HandleCheckIQMenu + address: + EU: 0x202C554 + description: |- + Handles displaying the Check IQ menu in both dungeon and ground mode. + r0: window pointer - name: CreateCollectionMenu address: @@ -6726,6 +6733,14 @@ arm9: r0: window_id return: bool + - name: GetWindowIdPageStart + address: + EU: 0x2030D0C + description: |- + Gets the item the current menu page of a given window id starts on (the current page id times the maximum number of items on one page). + + r0: window id + return: first item on page - name: GetAdvancedTextBoxFlags2 address: EU: 0x2030D34 @@ -6878,6 +6893,31 @@ arm9: r0: ? return: True if the menu option is enabled, false otherwise. + - name: GetPageStart + address: + EU: 0x203285C + description: |- + Gets the item the current menu page starts on (the current page id times the maximum number of items on one page). + + r0: window_input_ctx struct pointer + return: first item on page + - name: GetNumItemsOnPage + address: + EU: 0x2032888 + description: |- + Gets the number of items on the current manu page. + + r0: window_input_ctx struct pointer + return: number of items on page + - name: GetPageItemYOffset + address: + EU: 0x2032BCC + description: |- + Gets the y-offset of a given item on the current manu page. + + r0: window_input_ctx struct pointer + r1: item + return: y-offset - name: PlayWindowInputSound address: EU: 0x2032C54 diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index ce3c18f5..382d6da4 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -2628,6 +2628,22 @@ overlay29: r0: First entity r1: Second entity return: True if both entities are adjacent, false otherwise. + - name: IsHero + address: + EU: 0x22FC0F0 + description: |- + Checks if an entity is the hero, returning true if the "Joined At" field of its monster struct is DUNGEON_JOINED_AT_QUESTION_MARKS (reserved for the hero). + + r0: entity pointer + return: bool + - name: IsSpecialStoryAllyOrClient + address: + EU: 0x22FC46C + description: |- + Same as IsSpecialStoryAlly, except taking an entity pointer and also checking if it is a client. + + r0: entity pointer + return: bool - name: IsSpecialStoryAlly address: EU: 0x22FC4CC diff --git a/symbols/overlay31.yml b/symbols/overlay31.yml index 8fa4bb17..c8af655a 100644 --- a/symbols/overlay31.yml +++ b/symbols/overlay31.yml @@ -162,6 +162,13 @@ overlay31: Called on each frame while the in-dungeon "recruitment search" menu is open. return: int (Actually, this is probably some sort of enum shared by all the MenuLoop functions) + - name: DrawDungeonHintContents + address: + EU: 0x2389DCC + description: |- + Draws the contents of the current dungeon hint that is to be displayed in the Dungeon Hints menu. + + r0: window id - name: HelpMenuLoop address: EU: 0x2389E20 From e60cebd81071ee8028d344001fb975fb0375982b Mon Sep 17 00:00:00 2001 From: assidion Date: Sun, 31 Aug 2025 23:52:29 +0400 Subject: [PATCH 106/204] a --- headers/types/common/window.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/headers/types/common/window.h b/headers/types/common/window.h index 5a9a8983..dc102607 100644 --- a/headers/types/common/window.h +++ b/headers/types/common/window.h @@ -325,8 +325,8 @@ struct window_list { }; ASSERT_SIZE(struct window_list, 4480); -// Appears to be used to track state related to interactive windows? -// Probably used for various things? +// Tracks state related to interactive windows. +// A pointer to this struct is always at +0x4 of the various window contents structs stored in window_params / returned by GetWindowContents. struct window_input_ctx { undefined fields_0x0[180]; uint32_t first_item_y_offset; // 0xB4: Y-offset for first item on page From 10cd93ceb075a0ee90d7e52aec15cc491e068416 Mon Sep 17 00:00:00 2001 From: assidion Date: Sun, 31 Aug 2025 23:53:53 +0400 Subject: [PATCH 107/204] a --- headers/types/common/window.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/types/common/window.h b/headers/types/common/window.h index dc102607..f03a5fee 100644 --- a/headers/types/common/window.h +++ b/headers/types/common/window.h @@ -326,7 +326,7 @@ struct window_list { ASSERT_SIZE(struct window_list, 4480); // Tracks state related to interactive windows. -// A pointer to this struct is always at +0x4 of the various window contents structs stored in window_params / returned by GetWindowContents. +// A pointer to this struct seems to always be at +0x4 of the various window contents structs stored in window_params / returned by GetWindowContents. struct window_input_ctx { undefined fields_0x0[180]; uint32_t first_item_y_offset; // 0xB4: Y-offset for first item on page From a880af2adab5f90ae357c637ca3141bd9e328a19 Mon Sep 17 00:00:00 2001 From: assidion Date: Mon, 1 Sep 2025 00:03:02 +0400 Subject: [PATCH 108/204] a --- headers/functions/arm9.h | 2 +- headers/types/common/window.h | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 5330496f..1adb0c50 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -614,7 +614,7 @@ bool IsAdvancedMenuActive(int window_id); int GetAdvancedMenuCurrentOption(int window_id); int GetAdvancedMenuResult(int window_id); void UpdateAdvancedMenu(struct window* window); -void HandleCheckIQMenu(struct window* window); +void HandleCheckIqMenu(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, diff --git a/headers/types/common/window.h b/headers/types/common/window.h index f03a5fee..47102d8f 100644 --- a/headers/types/common/window.h +++ b/headers/types/common/window.h @@ -326,15 +326,17 @@ struct window_list { ASSERT_SIZE(struct window_list, 4480); // Tracks state related to interactive windows. -// A pointer to this struct seems to always be at +0x4 of the various window contents structs stored in window_params / returned by GetWindowContents. +// A pointer to this struct seems to always be at +0x4 of the various window contents structs +// stored in window_params / returned by GetWindowContents. struct window_input_ctx { undefined fields_0x0[180]; uint32_t first_item_y_offset; // 0xB4: Y-offset for first item on page - uint32_t y_offset_diff; // 0xB8: Difference in the Y-offset between one item and the next, shifted left by 8 bits + // 0xB8: Difference in the Y-offset between one item and the next, shifted left by 8 bits + uint32_t y_offset_diff; undefined4 field_0xbc; - uint32_t n_items_on_page; // 0xC0: Number of items on the page - uint32_t max_items_on_page; // 0xC4: Maximum possible number of items on the page - uint32_t current_page_id; // 0xC8: Current page the user is on (starts at 0) + uint32_t n_items_on_page; // 0xC0: Number of items on the page + uint32_t max_items_on_page; // 0xC4: Maximum possible number of items on the page + uint32_t current_page_id; // 0xC8: Current page the user is on (starts at 0) undefined fields_0xcc[40]; uint8_t field_0xf4; undefined field_0xf5; From 5aea029e2869b1e4f7fa14f6009cf28b39b11322 Mon Sep 17 00:00:00 2001 From: assidion Date: Mon, 1 Sep 2025 00:06:48 +0400 Subject: [PATCH 109/204] AAA --- headers/types/common/window.h | 8 ++++---- symbols/arm9.yml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/headers/types/common/window.h b/headers/types/common/window.h index 47102d8f..d7969c09 100644 --- a/headers/types/common/window.h +++ b/headers/types/common/window.h @@ -326,7 +326,7 @@ struct window_list { ASSERT_SIZE(struct window_list, 4480); // Tracks state related to interactive windows. -// A pointer to this struct seems to always be at +0x4 of the various window contents structs +// A pointer to this struct seems to always be at +0x4 of the various window contents structs // stored in window_params / returned by GetWindowContents. struct window_input_ctx { undefined fields_0x0[180]; @@ -334,9 +334,9 @@ struct window_input_ctx { // 0xB8: Difference in the Y-offset between one item and the next, shifted left by 8 bits uint32_t y_offset_diff; undefined4 field_0xbc; - uint32_t n_items_on_page; // 0xC0: Number of items on the page - uint32_t max_items_on_page; // 0xC4: Maximum possible number of items on the page - uint32_t current_page_id; // 0xC8: Current page the user is on (starts at 0) + uint32_t n_items_on_page; // 0xC0: Number of items on the page + uint32_t max_items_on_page; // 0xC4: Maximum possible number of items on the page + uint32_t current_page_id; // 0xC8: Current page the user is on (starts at 0) undefined fields_0xcc[40]; uint8_t field_0xf4; undefined field_0xf5; diff --git a/symbols/arm9.yml b/symbols/arm9.yml index b88f137b..834fb182 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -5871,7 +5871,7 @@ arm9: Window update function for advanced menus. r0: window pointer - - name: HandleCheckIQMenu + - name: HandleCheckIqMenu address: EU: 0x202C554 description: |- From 80976bc2818f8e6ea6253ba261ef94d4a841734b Mon Sep 17 00:00:00 2001 From: assidion Date: Mon, 1 Sep 2025 00:15:24 +0400 Subject: [PATCH 110/204] a --- headers/types/common/window.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/types/common/window.h b/headers/types/common/window.h index d7969c09..a6d5dc19 100644 --- a/headers/types/common/window.h +++ b/headers/types/common/window.h @@ -326,7 +326,7 @@ struct window_list { ASSERT_SIZE(struct window_list, 4480); // Tracks state related to interactive windows. -// A pointer to this struct seems to always be at +0x4 of the various window contents structs +// This struct seems to always be at +0x4 of the various window contents structs // stored in window_params / returned by GetWindowContents. struct window_input_ctx { undefined fields_0x0[180]; From 6ee130ea7aa2deb5d2968855a86a24941b9e866e Mon Sep 17 00:00:00 2001 From: assidion Date: Mon, 1 Sep 2025 00:16:46 +0400 Subject: [PATCH 111/204] a --- headers/types/common/window.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/types/common/window.h b/headers/types/common/window.h index a6d5dc19..1600ed51 100644 --- a/headers/types/common/window.h +++ b/headers/types/common/window.h @@ -334,7 +334,7 @@ struct window_input_ctx { // 0xB8: Difference in the Y-offset between one item and the next, shifted left by 8 bits uint32_t y_offset_diff; undefined4 field_0xbc; - uint32_t n_items_on_page; // 0xC0: Number of items on the page + uint32_t n_items_on_page; // 0xC0: Actual number of items on the page uint32_t max_items_on_page; // 0xC4: Maximum possible number of items on the page uint32_t current_page_id; // 0xC8: Current page the user is on (starts at 0) undefined fields_0xcc[40]; From 3751df7436a9167c69549cf16ab0ce3d6d18f4c6 Mon Sep 17 00:00:00 2001 From: assidion2 Date: Mon, 1 Sep 2025 09:45:37 +0400 Subject: [PATCH 112/204] Update symbols/arm9.yml Co-authored-by: UsernameFodder <93669634+UsernameFodder@users.noreply.github.com> --- symbols/arm9.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 834fb182..cb172b81 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -6913,7 +6913,7 @@ arm9: address: EU: 0x2032BCC description: |- - Gets the y-offset of a given item on the current manu page. + Gets the y-offset of a given item on the current menu page. r0: window_input_ctx struct pointer r1: item From 3a209a2ec52674ff714a7e4e2392955f2674343b Mon Sep 17 00:00:00 2001 From: assidion2 Date: Mon, 1 Sep 2025 09:45:53 +0400 Subject: [PATCH 113/204] Update symbols/arm9.yml Co-authored-by: UsernameFodder <93669634+UsernameFodder@users.noreply.github.com> --- symbols/arm9.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index cb172b81..f95bfc9a 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -6905,7 +6905,7 @@ arm9: address: EU: 0x2032888 description: |- - Gets the number of items on the current manu page. + Gets the number of items on the current menu page. r0: window_input_ctx struct pointer return: number of items on page From c977d953c392713cc4fcf38eaa76784f4c0a4b63 Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 2 Sep 2025 00:02:54 +0400 Subject: [PATCH 114/204] a --- headers/functions/arm9.h | 3 ++- headers/types/common/window.h | 9 +++------ symbols/arm9.yml | 15 +++++++++++++-- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 1adb0c50..52622417 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -614,7 +614,7 @@ bool IsAdvancedMenuActive(int window_id); int GetAdvancedMenuCurrentOption(int window_id); int GetAdvancedMenuResult(int window_id); void UpdateAdvancedMenu(struct window* window); -void HandleCheckIqMenu(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, @@ -750,6 +750,7 @@ char* TeamSelectionMenuGetItem(char* buffer, int member_idx); 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 monster_iq_id); bool GetNotifyNote(void); void SetNotifyNote(bool flag); void InitSpecialEpisodeHero(void); diff --git a/headers/types/common/window.h b/headers/types/common/window.h index 1600ed51..8c131754 100644 --- a/headers/types/common/window.h +++ b/headers/types/common/window.h @@ -852,9 +852,9 @@ struct team_selection_menu { }; ASSERT_SIZE(struct team_selection_menu, 436); -// Functions for advanced menus to get the strings for the current list of options. +// Functions for advanced menus to get the string for an item on the page. // Returns the input buffer. -typedef char* (*advanced_menu_entry_fn_t)(char* buffer, int option_id); +typedef char* (*advanced_menu_entry_fn_t)(char* buffer, int item); // Also see CreateAdvancedMenu // Menu with complex layout and functionality, like paging. @@ -868,10 +868,7 @@ struct advanced_menu { struct window_input_ctx input_ctx; // 0x4 int field_0xfc; struct window_extra_info extra_info; // 0x100 - undefined field_0x198; - undefined field_0x199; - undefined field_0x19a; - undefined field_0x19b; + advanced_menu_entry_fn_t get_item_string; // 0x198 int state; // 0x19C: appears to be a state value uint8_t field_0x1a0; uint8_t field_0x1a1; diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 834fb182..820ec663 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -5871,11 +5871,11 @@ arm9: Window update function for advanced menus. r0: window pointer - - name: HandleCheckIqMenu + - name: DrawAdvancedMenu address: EU: 0x202C554 description: |- - Handles displaying the Check IQ menu in both dungeon and ground mode. + Draws the contents of an advanced menu on the screen. r0: window pointer - name: CreateCollectionMenu @@ -7018,6 +7018,17 @@ arm9: r1: Pointer to bitarray where the enabled skills will be written when enabling or disabling them in the menu r2: Monster IQ r3: True if the monster is blinded + - name: GetCheckIqMenuSkillString + address: + EU: 0x2042438 + description: |- + Gets the string for a team member's IQ skill to be displayed in the Check IQ menu. + + Is stored as an advanced_menu_entry_fn_t in the advanced_menu struct. + + r0: [output] buffer + r1: id in team member's IQ skill list + return: buffer - name: GetNotifyNote address: EU: 0x20487BC From 56eb9b90e429808619f751de2fad3c1cbf5bcda9 Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 2 Sep 2025 00:15:59 +0400 Subject: [PATCH 115/204] a --- headers/types/common/window.h | 4 ++-- symbols/arm9.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/headers/types/common/window.h b/headers/types/common/window.h index 8c131754..578108f7 100644 --- a/headers/types/common/window.h +++ b/headers/types/common/window.h @@ -867,9 +867,9 @@ struct advanced_menu { update_window_fn_t update; // 0x0 struct window_input_ctx input_ctx; // 0x4 int field_0xfc; - struct window_extra_info extra_info; // 0x100 + struct window_extra_info extra_info; // 0x100 advanced_menu_entry_fn_t get_item_string; // 0x198 - int state; // 0x19C: appears to be a state value + int state; // 0x19C: appears to be a state value uint8_t field_0x1a0; uint8_t field_0x1a1; undefined field_0x1a2; diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 14ba9c3b..575dfb9f 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -7023,7 +7023,7 @@ arm9: EU: 0x2042438 description: |- Gets the string for a team member's IQ skill to be displayed in the Check IQ menu. - + Is stored as an advanced_menu_entry_fn_t in the advanced_menu struct. r0: [output] buffer From d5b3af23225e96d3bcec5e69648cf9accaf7bb33 Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 2 Sep 2025 00:18:51 +0400 Subject: [PATCH 116/204] a --- symbols/arm9.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 575dfb9f..42436ba4 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -7028,7 +7028,7 @@ arm9: r0: [output] buffer r1: id in team member's IQ skill list - return: buffer + return: input buffer - name: GetNotifyNote address: EU: 0x20487BC From c73a58b554f9729d151f19887a706f58148afa1b Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 2 Sep 2025 01:02:07 +0400 Subject: [PATCH 117/204] a --- 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 52622417..7653370e 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -750,7 +750,7 @@ char* TeamSelectionMenuGetItem(char* buffer, int member_idx); 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 monster_iq_id); +char* GetCheckIqMenuSkillString(char* buf, int iq_entry_idx); bool GetNotifyNote(void); void SetNotifyNote(bool flag); void InitSpecialEpisodeHero(void); From a4a3095ed468d59c6dc978760a7d3119e175a9ec Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 2 Sep 2025 19:09:58 +0400 Subject: [PATCH 118/204] a --- headers/functions/arm9.h | 14 +++++++------- headers/types/common/window.h | 10 +++++----- symbols/arm9.yml | 28 ++++++++++++++-------------- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 7653370e..8b093b37 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -706,7 +706,7 @@ int CreateAdvancedTextBoxWithArg(struct window_params* params, struct window_fla 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); + int n_entries, int n_entries_per_page); void SetAdvancedTextBoxPartialMenu(int window_id, bool partial_menu); void SetAdvancedTextBoxField0x1C4(int window_id, uint8_t value); void SetAdvancedTextBoxField0x1C2(int window_id); @@ -722,8 +722,8 @@ 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); + team_selection_menu_get_item_fn_t get_item, int n_entries, + int n_entries_per_page); void CloseTeamSelectionMenu(int window_id); bool IsTeamSelectionMenuActive(int window_id); void UpdateTeamSelectionMenu(struct window* window); @@ -732,15 +732,15 @@ int CalcMenuHeightDiv8(struct window_flags flags, struct window_extra_info* extr 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); + int n_entries, int n_entries_per_page); bool IsMenuOptionActive(undefined* param_1); uint8_t GetPageStart(struct window_input_ctx* input_ctx); -uint8_t GetNumItemsOnPage(struct window_input_ctx* input_ctx); -int GetPageItemYOffset(struct window_input_ctx* input_ctx, uint8_t item); +uint8_t GetNumEntriesOnPage(struct window_input_ctx* input_ctx); +int GetPageEntryYOffset(struct window_input_ctx* input_ctx, uint8_t entry_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, + struct window_rectangle* rect, int n_entries, int n_entries_per_page, undefined param_7); int SetupAndShowKeyboard(int menu_type, char* buffer1, char* buffer2); int ShowKeyboard(int menu_type, char* buffer1, int param_3, char* buffer2); diff --git a/headers/types/common/window.h b/headers/types/common/window.h index 578108f7..6434c89e 100644 --- a/headers/types/common/window.h +++ b/headers/types/common/window.h @@ -330,12 +330,12 @@ ASSERT_SIZE(struct window_list, 4480); // stored in window_params / returned by GetWindowContents. struct window_input_ctx { undefined fields_0x0[180]; - uint32_t first_item_y_offset; // 0xB4: Y-offset for first item on page - // 0xB8: Difference in the Y-offset between one item and the next, shifted left by 8 bits + uint32_t first_item_y_offset; // 0xB4: Y-offset for first entry on page + // 0xB8: Difference in the Y-offset between one entry and the next, shifted left by 8 bits uint32_t y_offset_diff; undefined4 field_0xbc; - uint32_t n_items_on_page; // 0xC0: Actual number of items on the page - uint32_t max_items_on_page; // 0xC4: Maximum possible number of items on the page + uint32_t n_entries_on_page; // 0xC0: Actual number of entries on the page + uint32_t max_entries_on_page; // 0xC4: Maximum possible number of entries on the page uint32_t current_page_id; // 0xC8: Current page the user is on (starts at 0) undefined fields_0xcc[40]; uint8_t field_0xf4; @@ -852,7 +852,7 @@ struct team_selection_menu { }; ASSERT_SIZE(struct team_selection_menu, 436); -// Functions for advanced menus to get the string for an item on the page. +// Functions for advanced menus to get the strings for the current list of options. // Returns the input buffer. typedef char* (*advanced_menu_entry_fn_t)(char* buffer, int item); diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 42436ba4..1b0f4610 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -6662,8 +6662,8 @@ arm9: r0: window_params r1: window_flags r2: window_extra_info pointer - r3: total number of selectable items - stack[0]: number of selectable items per page + r3: total number of selectable entries + stack[0]: number of selectable entries per page return: advanced_text_box pointer - name: SetAdvancedTextBoxPartialMenu address: @@ -6881,8 +6881,8 @@ arm9: r1: window_flags r2: window_extra_info pointer r3: window rectangle - stack[0]: total number of selectable items - stack[1]: number of selectable items per page + stack[0]: total number of selectable entries + stack[1]: number of selectable entries per page - name: IsMenuOptionActive address: EU: 0x2032768 @@ -6897,26 +6897,26 @@ arm9: address: EU: 0x203285C description: |- - Gets the item the current menu page starts on (the current page id times the maximum number of items on one page). + Gets the index of the entry the current menu page starts on (the current page id times the maximum number of entries on one page). r0: window_input_ctx struct pointer - return: first item on page - - name: GetNumItemsOnPage + return: index of first entry on page + - name: GetNumEntriesOnPage address: EU: 0x2032888 description: |- - Gets the number of items on the current menu page. + Gets the number of entries on the current menu page. r0: window_input_ctx struct pointer - return: number of items on page - - name: GetPageItemYOffset + return: number of entries on page + - name: GetPageEntryYOffset address: EU: 0x2032BCC description: |- - Gets the y-offset of a given item on the current menu page. + Gets the y-offset of a given entry on the current menu page. r0: window_input_ctx struct pointer - r1: item + r1: entry index return: y-offset - name: PlayWindowInputSound address: @@ -6940,8 +6940,8 @@ arm9: r1: window_flags r2: window_extra_info pointer r3: window rectangle - stack[0]: total number of selectable items - stack[1]: number of selectable items per page + stack[0]: total number of selectable entries + stack[1]: number of selectable entries per page stack[2]: ? - name: SetupAndShowKeyboard address: From e8bc1ad83878585848fb71021dc4abb1f787684a Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 2 Sep 2025 19:10:39 +0400 Subject: [PATCH 119/204] a --- headers/types/common/window.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/types/common/window.h b/headers/types/common/window.h index 6434c89e..b2fe2cf4 100644 --- a/headers/types/common/window.h +++ b/headers/types/common/window.h @@ -336,7 +336,7 @@ struct window_input_ctx { undefined4 field_0xbc; uint32_t n_entries_on_page; // 0xC0: Actual number of entries on the page uint32_t max_entries_on_page; // 0xC4: Maximum possible number of entries on the page - uint32_t current_page_id; // 0xC8: Current page the user is on (starts at 0) + uint32_t current_page_id; // 0xC8: Current page the user is on (starts at 0) undefined fields_0xcc[40]; uint8_t field_0xf4; undefined field_0xf5; From a053b9045d6f7db3b90cf848e9b51df24edaec46 Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 2 Sep 2025 19:13:45 +0400 Subject: [PATCH 120/204] a --- headers/types/common/window.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/types/common/window.h b/headers/types/common/window.h index b2fe2cf4..dd50fc3d 100644 --- a/headers/types/common/window.h +++ b/headers/types/common/window.h @@ -854,7 +854,7 @@ ASSERT_SIZE(struct team_selection_menu, 436); // Functions for advanced menus to get the strings for the current list of options. // Returns the input buffer. -typedef char* (*advanced_menu_entry_fn_t)(char* buffer, int item); +typedef char* (*advanced_menu_entry_fn_t)(char* buffer, int option_id); // Also see CreateAdvancedMenu // Menu with complex layout and functionality, like paging. From 02bb966f1b2231a2560b61c5b180b546b2b6d919 Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 2 Sep 2025 20:52:27 +0400 Subject: [PATCH 121/204] a --- headers/types/common/window.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/headers/types/common/window.h b/headers/types/common/window.h index dd50fc3d..9310895e 100644 --- a/headers/types/common/window.h +++ b/headers/types/common/window.h @@ -867,9 +867,9 @@ struct advanced_menu { update_window_fn_t update; // 0x0 struct window_input_ctx input_ctx; // 0x4 int field_0xfc; - struct window_extra_info extra_info; // 0x100 - advanced_menu_entry_fn_t get_item_string; // 0x198 - int state; // 0x19C: appears to be a state value + struct window_extra_info extra_info; // 0x100 + advanced_menu_entry_fn_t get_entry_string; // 0x198 + int state; // 0x19C: appears to be a state value uint8_t field_0x1a0; uint8_t field_0x1a1; undefined field_0x1a2; From ac694da12574b7ebb5476e4c8157e05536ec6c93 Mon Sep 17 00:00:00 2001 From: assidion Date: Wed, 3 Sep 2025 19:06:47 +0400 Subject: [PATCH 122/204] a --- headers/functions/arm9.h | 10 +++++----- symbols/arm9.yml | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 8b093b37..66ea5467 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -706,7 +706,7 @@ int CreateAdvancedTextBoxWithArg(struct window_params* params, struct window_fla struct advanced_text_box* CreateAdvancedTextBoxInternal(struct window_params* params, struct window_flags flags, struct window_extra_info* extra_info, - int n_entries, int n_entries_per_page); + 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); @@ -722,8 +722,8 @@ 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_entries, - int n_entries_per_page); + 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); @@ -732,7 +732,7 @@ int CalcMenuHeightDiv8(struct window_flags flags, struct window_extra_info* extr 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_entries, int n_entries_per_page); + int n_items, int n_items_per_page); bool IsMenuOptionActive(undefined* param_1); uint8_t GetPageStart(struct window_input_ctx* input_ctx); uint8_t GetNumEntriesOnPage(struct window_input_ctx* input_ctx); @@ -740,7 +740,7 @@ int GetPageEntryYOffset(struct window_input_ctx* input_ctx, uint8_t entry_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_entries, int n_entries_per_page, + struct window_rectangle* rect, int n_items, int n_items_per_page, undefined param_7); int SetupAndShowKeyboard(int menu_type, char* buffer1, char* buffer2); int ShowKeyboard(int menu_type, char* buffer1, int param_3, char* buffer2); diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 1b0f4610..1d0970ec 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -6662,8 +6662,8 @@ arm9: r0: window_params r1: window_flags r2: window_extra_info pointer - r3: total number of selectable entries - stack[0]: number of selectable entries per page + r3: total number of selectable items + stack[0]: number of selectable items per page return: advanced_text_box pointer - name: SetAdvancedTextBoxPartialMenu address: @@ -6881,8 +6881,8 @@ arm9: r1: window_flags r2: window_extra_info pointer r3: window rectangle - stack[0]: total number of selectable entries - stack[1]: number of selectable entries per page + stack[0]: total number of selectable items + stack[1]: number of selectable items per page - name: IsMenuOptionActive address: EU: 0x2032768 @@ -6940,8 +6940,8 @@ arm9: r1: window_flags r2: window_extra_info pointer r3: window rectangle - stack[0]: total number of selectable entries - stack[1]: number of selectable entries per page + stack[0]: total number of selectable items + stack[1]: number of selectable items per page stack[2]: ? - name: SetupAndShowKeyboard address: From 27d52b608db9946a8e2dd67698f8aa58c84c35ae Mon Sep 17 00:00:00 2001 From: assidion Date: Thu, 4 Sep 2025 21:09:32 +0400 Subject: [PATCH 123/204] a --- headers/types/common/window.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/types/common/window.h b/headers/types/common/window.h index 9310895e..67762699 100644 --- a/headers/types/common/window.h +++ b/headers/types/common/window.h @@ -336,7 +336,7 @@ struct window_input_ctx { undefined4 field_0xbc; uint32_t n_entries_on_page; // 0xC0: Actual number of entries on the page uint32_t max_entries_on_page; // 0xC4: Maximum possible number of entries on the page - uint32_t current_page_id; // 0xC8: Current page the user is on (starts at 0) + uint32_t current_page_idx; // 0xC8: Current page the user is on (starts at 0) undefined fields_0xcc[40]; uint8_t field_0xf4; undefined field_0xf5; From d15584e7230cc600815d17e21a42802cc844dba0 Mon Sep 17 00:00:00 2001 From: assidion Date: Thu, 4 Sep 2025 21:11:37 +0400 Subject: [PATCH 124/204] a --- headers/types/common/window.h | 2 +- symbols/arm9.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/headers/types/common/window.h b/headers/types/common/window.h index 67762699..9310895e 100644 --- a/headers/types/common/window.h +++ b/headers/types/common/window.h @@ -336,7 +336,7 @@ struct window_input_ctx { undefined4 field_0xbc; uint32_t n_entries_on_page; // 0xC0: Actual number of entries on the page uint32_t max_entries_on_page; // 0xC4: Maximum possible number of entries on the page - uint32_t current_page_idx; // 0xC8: Current page the user is on (starts at 0) + uint32_t current_page_id; // 0xC8: Current page the user is on (starts at 0) undefined fields_0xcc[40]; uint8_t field_0xf4; undefined field_0xf5; diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 1d0970ec..a8af9ccf 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -6897,7 +6897,7 @@ arm9: address: EU: 0x203285C description: |- - Gets the index of the entry the current menu page starts on (the current page id times the maximum number of entries on one page). + Gets the index of the entry the current menu page starts on (the current page index times the maximum number of entries on one page). r0: window_input_ctx struct pointer return: index of first entry on page From 042829cc59f438b0940b6a93f07a42a4e7f36b07 Mon Sep 17 00:00:00 2001 From: assidion Date: Fri, 5 Sep 2025 19:47:26 +0400 Subject: [PATCH 125/204] a --- headers/functions/arm9.h | 4 ++-- headers/types/common/window.h | 14 +++++++------- symbols/arm9.yml | 16 ++++++++-------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 66ea5467..99addd8d 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -735,8 +735,8 @@ void InitWindowInput(struct window_input_ctx* input_ctx, struct window_flags fla int n_items, int n_items_per_page); bool IsMenuOptionActive(undefined* param_1); uint8_t GetPageStart(struct window_input_ctx* input_ctx); -uint8_t GetNumEntriesOnPage(struct window_input_ctx* input_ctx); -int GetPageEntryYOffset(struct window_input_ctx* input_ctx, uint8_t entry_idx); +uint8_t GetNumItemsOnPage(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, diff --git a/headers/types/common/window.h b/headers/types/common/window.h index 9310895e..471fd53b 100644 --- a/headers/types/common/window.h +++ b/headers/types/common/window.h @@ -330,12 +330,12 @@ ASSERT_SIZE(struct window_list, 4480); // stored in window_params / returned by GetWindowContents. struct window_input_ctx { undefined fields_0x0[180]; - uint32_t first_item_y_offset; // 0xB4: Y-offset for first entry on page - // 0xB8: Difference in the Y-offset between one entry and the next, shifted left by 8 bits + uint32_t first_item_y_offset; // 0xB4: Y-offset for first item on page + // 0xB8: Difference in the Y-offset between one item and the next, shifted left by 8 bits uint32_t y_offset_diff; undefined4 field_0xbc; - uint32_t n_entries_on_page; // 0xC0: Actual number of entries on the page - uint32_t max_entries_on_page; // 0xC4: Maximum possible number of entries on the page + uint32_t n_items_on_page; // 0xC0: Actual number of items on the page + uint32_t max_items_on_page; // 0xC4: Maximum possible number of items on the page uint32_t current_page_id; // 0xC8: Current page the user is on (starts at 0) undefined fields_0xcc[40]; uint8_t field_0xf4; @@ -867,9 +867,9 @@ struct advanced_menu { update_window_fn_t update; // 0x0 struct window_input_ctx input_ctx; // 0x4 int field_0xfc; - struct window_extra_info extra_info; // 0x100 - advanced_menu_entry_fn_t get_entry_string; // 0x198 - int state; // 0x19C: appears to be a state value + struct window_extra_info extra_info; // 0x100 + advanced_menu_entry_fn_t get_item_string; // 0x198 + int state; // 0x19C: appears to be a state value uint8_t field_0x1a0; uint8_t field_0x1a1; undefined field_0x1a2; diff --git a/symbols/arm9.yml b/symbols/arm9.yml index a8af9ccf..98883e4e 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -6897,26 +6897,26 @@ arm9: address: EU: 0x203285C description: |- - Gets the index of the entry the current menu page starts on (the current page index times the maximum number of entries on one page). + Gets the index of the item the current menu page starts on (the current page index times the maximum number of items on one page). r0: window_input_ctx struct pointer - return: index of first entry on page - - name: GetNumEntriesOnPage + return: index of first item on page + - name: GetNumItemsOnPage address: EU: 0x2032888 description: |- - Gets the number of entries on the current menu page. + Gets the number of items on the current menu page. r0: window_input_ctx struct pointer - return: number of entries on page - - name: GetPageEntryYOffset + return: number of items on page + - name: GetPageItemYOffset address: EU: 0x2032BCC description: |- - Gets the y-offset of a given entry on the current menu page. + Gets the y-offset of a given item on the current menu page. r0: window_input_ctx struct pointer - r1: entry index + r1: item index return: y-offset - name: PlayWindowInputSound address: From 2b853a8aa95e8d3095c189889187f64103d6e023 Mon Sep 17 00:00:00 2001 From: assidion Date: Fri, 5 Sep 2025 19:48:06 +0400 Subject: [PATCH 126/204] a --- headers/types/common/window.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/types/common/window.h b/headers/types/common/window.h index 471fd53b..42de2cd9 100644 --- a/headers/types/common/window.h +++ b/headers/types/common/window.h @@ -336,7 +336,7 @@ struct window_input_ctx { undefined4 field_0xbc; uint32_t n_items_on_page; // 0xC0: Actual number of items on the page uint32_t max_items_on_page; // 0xC4: Maximum possible number of items on the page - uint32_t current_page_id; // 0xC8: Current page the user is on (starts at 0) + uint32_t current_page_id; // 0xC8: Current page the user is on (starts at 0) undefined fields_0xcc[40]; uint8_t field_0xf4; undefined field_0xf5; From e4776135600f69abbdddc29e3c748f797fd69718 Mon Sep 17 00:00:00 2001 From: assidion Date: Fri, 5 Sep 2025 23:30:30 +0400 Subject: [PATCH 127/204] a --- symbols/arm9.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 98883e4e..ed48c961 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -6916,7 +6916,7 @@ arm9: Gets the y-offset of a given item on the current menu page. r0: window_input_ctx struct pointer - r1: item index + r1: item index on page, in range [0, n_items_on_page) return: y-offset - name: PlayWindowInputSound address: From e539cd69b60d7fc95913e766bb5d35953f5d8587 Mon Sep 17 00:00:00 2001 From: assidion Date: Sat, 6 Sep 2025 13:16:36 +0400 Subject: [PATCH 128/204] a --- headers/functions/arm9.h | 18 +++++++++--------- headers/types/common/window.h | 12 ++++++------ symbols/arm9.yml | 36 +++++++++++++++++------------------ 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 99addd8d..a45fc44a 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -699,14 +699,14 @@ 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 n_entries); 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); + text_box_callback_with_arg_fn_t cb, void* cb_arg, int n_entries); 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); + int n_entries, int n_entries_per_page); void SetAdvancedTextBoxPartialMenu(int window_id, bool partial_menu); void SetAdvancedTextBoxField0x1C4(int window_id, uint8_t value); void SetAdvancedTextBoxField0x1C2(int window_id); @@ -722,8 +722,8 @@ 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); + team_selection_menu_get_item_fn_t get_item, int n_entries, + int n_entries_per_page); void CloseTeamSelectionMenu(int window_id); bool IsTeamSelectionMenuActive(int window_id); void UpdateTeamSelectionMenu(struct window* window); @@ -732,15 +732,15 @@ int CalcMenuHeightDiv8(struct window_flags flags, struct window_extra_info* extr 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); + int n_entries, int n_entries_per_page); bool IsMenuOptionActive(undefined* param_1); uint8_t GetPageStart(struct window_input_ctx* input_ctx); -uint8_t GetNumItemsOnPage(struct window_input_ctx* input_ctx); -int GetPageItemYOffset(struct window_input_ctx* input_ctx, uint8_t item_idx); +uint8_t GetNumEntriesOnPage(struct window_input_ctx* input_ctx); +int GetPageEntryYOffset(struct window_input_ctx* input_ctx, uint8_t entry_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, + struct window_rectangle* rect, int n_entries, int n_entries_per_page, undefined param_7); int SetupAndShowKeyboard(int menu_type, char* buffer1, char* buffer2); int ShowKeyboard(int menu_type, char* buffer1, int param_3, char* buffer2); diff --git a/headers/types/common/window.h b/headers/types/common/window.h index 42de2cd9..4b11d130 100644 --- a/headers/types/common/window.h +++ b/headers/types/common/window.h @@ -330,13 +330,13 @@ ASSERT_SIZE(struct window_list, 4480); // stored in window_params / returned by GetWindowContents. struct window_input_ctx { undefined fields_0x0[180]; - uint32_t first_item_y_offset; // 0xB4: Y-offset for first item on page - // 0xB8: Difference in the Y-offset between one item and the next, shifted left by 8 bits + uint32_t first_item_y_offset; // 0xB4: Y-offset for first entry on page + // 0xB8: Difference in the Y-offset between one entry and the next, shifted left by 8 bits uint32_t y_offset_diff; undefined4 field_0xbc; - uint32_t n_items_on_page; // 0xC0: Actual number of items on the page - uint32_t max_items_on_page; // 0xC4: Maximum possible number of items on the page - uint32_t current_page_id; // 0xC8: Current page the user is on (starts at 0) + uint32_t n_entries_on_page; // 0xC0: Actual number of entries on the page + uint32_t max_entries_on_page; // 0xC4: Maximum possible number of entries on the page + uint32_t current_page_id; // 0xC8: Current page the user is on (starts at 0) undefined fields_0xcc[40]; uint8_t field_0xf4; undefined field_0xf5; @@ -868,7 +868,7 @@ struct advanced_menu { struct window_input_ctx input_ctx; // 0x4 int field_0xfc; struct window_extra_info extra_info; // 0x100 - advanced_menu_entry_fn_t get_item_string; // 0x198 + advanced_menu_entry_fn_t get_entry_string; // 0x198 int state; // 0x19C: appears to be a state value uint8_t field_0x1a0; uint8_t field_0x1a1; diff --git a/symbols/arm9.yml b/symbols/arm9.yml index ed48c961..1cc9b011 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -6622,7 +6622,7 @@ arm9: NA: 0x20305B4 JP: 0x20308F8 description: |- - Calls CreateAdvancedTextBoxInternal with all the selectable items on one page (n_items_per_page = n_items), sets the callback without an argument, and returns the window_id. + Calls CreateAdvancedTextBoxInternal with all the selectable entries on one page (n_entries_per_page = n_entries), sets the callback without an argument, and returns the window_id. If window_params is NULL, ADVANCED_TEXT_BOX_DEFAULT_WINDOW_PARAMS will be used. Otherwise, it will be copied onto the window, ignoring the update and contents fields. @@ -6632,7 +6632,7 @@ arm9: r1: window_flags r2: window_extra_info pointer r3: text box callback function - stack[0]: number of selectable items + stack[0]: number of selectable entries return: window_id - name: CreateAdvancedTextBoxWithArg address: @@ -6640,14 +6640,14 @@ arm9: NA: 0x20305E4 JP: 0x2030928 description: |- - Calls CreateAdvancedTextBoxInternal with all the selectable items on one page (n_items_per_page = n_items), sets the callback with an argument, and returns the window_id. + Calls CreateAdvancedTextBoxInternal with all the selectable entries on one page (n_entries_per_page = n_entries), sets the callback with an argument, and returns the window_id. r0: window_params r1: window_flags r2: window_extra_info pointer r3: text box callback with arg function stack[0]: callback argument - stack[1]: number of selectable items + stack[1]: number of selectable entries return: window_id - name: CreateAdvancedTextBoxInternal address: @@ -6662,8 +6662,8 @@ arm9: r0: window_params r1: window_flags r2: window_extra_info pointer - r3: total number of selectable items - stack[0]: number of selectable items per page + r3: total number of selectable entries + stack[0]: number of selectable entries per page return: advanced_text_box pointer - name: SetAdvancedTextBoxPartialMenu address: @@ -6881,8 +6881,8 @@ arm9: r1: window_flags r2: window_extra_info pointer r3: window rectangle - stack[0]: total number of selectable items - stack[1]: number of selectable items per page + stack[0]: total number of selectable entries + stack[1]: number of selectable entries per page - name: IsMenuOptionActive address: EU: 0x2032768 @@ -6897,26 +6897,26 @@ arm9: address: EU: 0x203285C description: |- - Gets the index of the item the current menu page starts on (the current page index times the maximum number of items on one page). + Gets the index of the entry the current menu page starts on (the current page index times the maximum number of entries on one page). r0: window_input_ctx struct pointer - return: index of first item on page - - name: GetNumItemsOnPage + return: index of first entry on page + - name: GetNumEntriesOnPage address: EU: 0x2032888 description: |- - Gets the number of items on the current menu page. + Gets the number of entries on the current menu page. r0: window_input_ctx struct pointer - return: number of items on page - - name: GetPageItemYOffset + return: number of entries on page + - name: GetPageEntryYOffset address: EU: 0x2032BCC description: |- - Gets the y-offset of a given item on the current menu page. + Gets the y-offset of a given entry on the current menu page. r0: window_input_ctx struct pointer - r1: item index on page, in range [0, n_items_on_page) + r1: entry index on page, in range [0, n_entries_on_page) return: y-offset - name: PlayWindowInputSound address: @@ -6940,8 +6940,8 @@ arm9: r1: window_flags r2: window_extra_info pointer r3: window rectangle - stack[0]: total number of selectable items - stack[1]: number of selectable items per page + stack[0]: total number of selectable entries + stack[1]: number of selectable entries per page stack[2]: ? - name: SetupAndShowKeyboard address: From 1eac8e9c4f2cc6195a8f52afae4bcf915633437e Mon Sep 17 00:00:00 2001 From: assidion Date: Sat, 13 Sep 2025 23:37:44 +0400 Subject: [PATCH 129/204] aaaRevert "a" This reverts commit e539cd69b60d7fc95913e766bb5d35953f5d8587. --- headers/functions/arm9.h | 18 +++++++++--------- headers/types/common/window.h | 12 ++++++------ symbols/arm9.yml | 36 +++++++++++++++++------------------ 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index a45fc44a..99addd8d 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -699,14 +699,14 @@ 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_entries); + 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_entries); + 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_entries, int n_entries_per_page); + 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); @@ -722,8 +722,8 @@ 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_entries, - int n_entries_per_page); + 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); @@ -732,15 +732,15 @@ int CalcMenuHeightDiv8(struct window_flags flags, struct window_extra_info* extr 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_entries, int n_entries_per_page); + int n_items, int n_items_per_page); bool IsMenuOptionActive(undefined* param_1); uint8_t GetPageStart(struct window_input_ctx* input_ctx); -uint8_t GetNumEntriesOnPage(struct window_input_ctx* input_ctx); -int GetPageEntryYOffset(struct window_input_ctx* input_ctx, uint8_t entry_idx); +uint8_t GetNumItemsOnPage(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_entries, int n_entries_per_page, + struct window_rectangle* rect, int n_items, int n_items_per_page, undefined param_7); int SetupAndShowKeyboard(int menu_type, char* buffer1, char* buffer2); int ShowKeyboard(int menu_type, char* buffer1, int param_3, char* buffer2); diff --git a/headers/types/common/window.h b/headers/types/common/window.h index 4b11d130..42de2cd9 100644 --- a/headers/types/common/window.h +++ b/headers/types/common/window.h @@ -330,13 +330,13 @@ ASSERT_SIZE(struct window_list, 4480); // stored in window_params / returned by GetWindowContents. struct window_input_ctx { undefined fields_0x0[180]; - uint32_t first_item_y_offset; // 0xB4: Y-offset for first entry on page - // 0xB8: Difference in the Y-offset between one entry and the next, shifted left by 8 bits + uint32_t first_item_y_offset; // 0xB4: Y-offset for first item on page + // 0xB8: Difference in the Y-offset between one item and the next, shifted left by 8 bits uint32_t y_offset_diff; undefined4 field_0xbc; - uint32_t n_entries_on_page; // 0xC0: Actual number of entries on the page - uint32_t max_entries_on_page; // 0xC4: Maximum possible number of entries on the page - uint32_t current_page_id; // 0xC8: Current page the user is on (starts at 0) + uint32_t n_items_on_page; // 0xC0: Actual number of items on the page + uint32_t max_items_on_page; // 0xC4: Maximum possible number of items on the page + uint32_t current_page_id; // 0xC8: Current page the user is on (starts at 0) undefined fields_0xcc[40]; uint8_t field_0xf4; undefined field_0xf5; @@ -868,7 +868,7 @@ struct advanced_menu { struct window_input_ctx input_ctx; // 0x4 int field_0xfc; struct window_extra_info extra_info; // 0x100 - advanced_menu_entry_fn_t get_entry_string; // 0x198 + advanced_menu_entry_fn_t get_item_string; // 0x198 int state; // 0x19C: appears to be a state value uint8_t field_0x1a0; uint8_t field_0x1a1; diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 1cc9b011..ed48c961 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -6622,7 +6622,7 @@ arm9: NA: 0x20305B4 JP: 0x20308F8 description: |- - Calls CreateAdvancedTextBoxInternal with all the selectable entries on one page (n_entries_per_page = n_entries), sets the callback without an argument, and returns the window_id. + Calls CreateAdvancedTextBoxInternal with all the selectable items on one page (n_items_per_page = n_items), sets the callback without an argument, and returns the window_id. If window_params is NULL, ADVANCED_TEXT_BOX_DEFAULT_WINDOW_PARAMS will be used. Otherwise, it will be copied onto the window, ignoring the update and contents fields. @@ -6632,7 +6632,7 @@ arm9: r1: window_flags r2: window_extra_info pointer r3: text box callback function - stack[0]: number of selectable entries + stack[0]: number of selectable items return: window_id - name: CreateAdvancedTextBoxWithArg address: @@ -6640,14 +6640,14 @@ arm9: NA: 0x20305E4 JP: 0x2030928 description: |- - Calls CreateAdvancedTextBoxInternal with all the selectable entries on one page (n_entries_per_page = n_entries), sets the callback with an argument, and returns the window_id. + Calls CreateAdvancedTextBoxInternal with all the selectable items on one page (n_items_per_page = n_items), sets the callback with an argument, and returns the window_id. r0: window_params r1: window_flags r2: window_extra_info pointer r3: text box callback with arg function stack[0]: callback argument - stack[1]: number of selectable entries + stack[1]: number of selectable items return: window_id - name: CreateAdvancedTextBoxInternal address: @@ -6662,8 +6662,8 @@ arm9: r0: window_params r1: window_flags r2: window_extra_info pointer - r3: total number of selectable entries - stack[0]: number of selectable entries per page + r3: total number of selectable items + stack[0]: number of selectable items per page return: advanced_text_box pointer - name: SetAdvancedTextBoxPartialMenu address: @@ -6881,8 +6881,8 @@ arm9: r1: window_flags r2: window_extra_info pointer r3: window rectangle - stack[0]: total number of selectable entries - stack[1]: number of selectable entries per page + stack[0]: total number of selectable items + stack[1]: number of selectable items per page - name: IsMenuOptionActive address: EU: 0x2032768 @@ -6897,26 +6897,26 @@ arm9: address: EU: 0x203285C description: |- - Gets the index of the entry the current menu page starts on (the current page index times the maximum number of entries on one page). + Gets the index of the item the current menu page starts on (the current page index times the maximum number of items on one page). r0: window_input_ctx struct pointer - return: index of first entry on page - - name: GetNumEntriesOnPage + return: index of first item on page + - name: GetNumItemsOnPage address: EU: 0x2032888 description: |- - Gets the number of entries on the current menu page. + Gets the number of items on the current menu page. r0: window_input_ctx struct pointer - return: number of entries on page - - name: GetPageEntryYOffset + return: number of items on page + - name: GetPageItemYOffset address: EU: 0x2032BCC description: |- - Gets the y-offset of a given entry on the current menu page. + Gets the y-offset of a given item on the current menu page. r0: window_input_ctx struct pointer - r1: entry index on page, in range [0, n_entries_on_page) + r1: item index on page, in range [0, n_items_on_page) return: y-offset - name: PlayWindowInputSound address: @@ -6940,8 +6940,8 @@ arm9: r1: window_flags r2: window_extra_info pointer r3: window rectangle - stack[0]: total number of selectable entries - stack[1]: number of selectable entries per page + stack[0]: total number of selectable items + stack[1]: number of selectable items per page stack[2]: ? - name: SetupAndShowKeyboard address: From 7b4c092ab38c45b29f758b4189c917ace30f830b Mon Sep 17 00:00:00 2001 From: assidion Date: Sun, 14 Sep 2025 15:40:09 +0400 Subject: [PATCH 130/204] a --- headers/data/overlay29.h | 1 + headers/functions/overlay29.h | 16 ++- headers/types/common/graphics.h | 8 +- headers/types/dungeon_mode/dungeon_mode.h | 44 +++++++- headers/types/dungeon_mode/enums.h | 12 +++ symbols/overlay29.yml | 116 +++++++++++++++++++++- 6 files changed, 187 insertions(+), 10 deletions(-) diff --git a/headers/data/overlay29.h b/headers/data/overlay29.h index e79667d3..81755e0e 100644 --- a/headers/data/overlay29.h +++ b/headers/data/overlay29.h @@ -106,6 +106,7 @@ extern struct exclusive_item_effect_id_8 EXCL_ITEM_EFFECTS_EVASION_BOOST[8]; extern struct tile DEFAULT_TILE; extern bool HIDDEN_STAIRS_SPAWN_BLOCKED; extern void* FIXED_ROOM_DATA_PTR; +extern struct message_log_info MESSAGE_LOG_INFO; extern struct dungeon_fades* DUNGEON_FADES_PTR; #endif diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index 8f5de85d..17264c28 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -146,6 +146,7 @@ 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 TryTriggerTrap(struct entity* entity, struct position* pos, undefined param_3, undefined param_4); void ApplyMudTrapEffect(struct entity* attacker, struct entity* defender); @@ -238,6 +239,7 @@ bool HasLowHealth(struct entity* entity); bool AreEntitiesAdjacent(struct entity* first, struct entity* second); bool IsHero(struct entity* entity); bool IsSpecialStoryAllyOrClient(struct entity* entity); +void ResetTriggerFlags(struct entity* entity); bool IsSpecialStoryAlly(struct monster* monster); bool IsExperienceLocked(struct monster* monster); void InitOtherMonsterData(struct entity* entity, int fixed_room_stats_index, enum direction_id dir); @@ -719,6 +721,7 @@ bool NearbyAllyIqSkillIsEnabled(struct entity* entity, enum iq_skill_id iq_skill void ResetGravity(void); bool GravityIsActive(void); bool TryActivateGravity(void); +void RevealAttackedTile(struct position* pos); bool ShouldBoostKecleonShopSpawnChance(void); void SetShouldBoostKecleonShopSpawnChance(bool value); void UpdateShouldBoostKecleonShopSpawnChance(void); @@ -898,8 +901,19 @@ bool GetTargetMonsterNotFoundFlag(void); 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); +void InitAlertBoxInfo(void); +void FreeAlertBoxInfo(void); +void SetMessageGroupStartFlag(bool should_start_group); +struct preprocessor_args* GetGlobalPreprocessorArgs(void); +void InitGlobalPreprocessorArgs(void); +void SetPreprocessorArgsFlagVal(uint8_t pos, uint32_t val); void SetPreprocessorArgsIdVal(uint8_t pos, uint32_t val); -void LogMessageByIdWithPopupCheckParticipants(struct entity* user, struct entity* target, +void SetPreprocessorArgsNumberVal(uint8_t pos, uint32_t val); +void SetPreprocessorArgsString(uint8_t pos, char* string); +void SetPreprocessorArgsStringToName(uint8_t pos, enum monster_id monster_id); +void SetPreprocessorArgsSpeakerId(enum monster_id monster_id); +void SetPreprocessorArgsSpeakerId0x30000(int16_t team_index); +void LogMessageByIdWithPopupAndAbility(struct entity* user, struct entity* target, int message_id, int idx, int16_t val); void LogMessageByIdWithPopupCheckUser(struct entity* user, int message_id); void LogMessageWithPopupCheckUser(struct entity* user, const char* message); diff --git a/headers/types/common/graphics.h b/headers/types/common/graphics.h index 1c71c6ce..11703480 100644 --- a/headers/types/common/graphics.h +++ b/headers/types/common/graphics.h @@ -18,8 +18,12 @@ struct animation_control { uint16_t field6_0xc; // (from struct entity) animation frame counter for the idle animation? undefined field7_0xe; undefined field8_0xf; - // appears to be a structure used for unknown purpose with 6 2-byte value - undefined2 field9_0x10[6]; + // 0x10: Information used to create an object's OAM attributes. + // See https://problemkaputt.de/gbatek.htm#lcdobjoamattributes + // In particular, the first three elements of the array are ANDed with some value, then ORed + // with the element three indexes above. + // Notably, setting bit 0x400 of the fourth element will make the object semi-transparent. + uint16_t oam_attribute_info[6]; struct vec2_16 position; struct vec2_16 anim_frame_offset; struct vec2_16 anim_frame_shadow_offset; diff --git a/headers/types/dungeon_mode/dungeon_mode.h b/headers/types/dungeon_mode/dungeon_mode.h index 9cbebe57..7b6182b5 100644 --- a/headers/types/dungeon_mode/dungeon_mode.h +++ b/headers/types/dungeon_mode/dungeon_mode.h @@ -718,8 +718,8 @@ struct entity { int elevation; bool is_visible; // 0x20: For traps/hidden stairs undefined field_0x21; - // 0x22: If true, the sprite will be shown with a certain degree of transparency - bool transparent; + // 0x22: Set when a monster is taking damage + enum damage_visual damage_visual_effect; // 0x23: Seems to be the animation frame counter for the 10-frame "shuffle" animation that // plays at the end of a walk sequence uint8_t end_walk_anim_frame; @@ -2520,6 +2520,46 @@ struct target_list { }; ASSERT_SIZE(struct target_list, 256); +// Contains information for the "popup alert" messages at the bottom of the screen, which are also +// printed to the message log. +struct alert_box_info { + char alert_box_messages[10][320]; + // 0xC80: Whether the message specified by the index is the start of a group + bool message_starts_group[10]; + undefined field_0xc8a; + undefined field_0xc8b; + short alert_box_message_idx; // 0xC8C: Index of current message in alert_box_messages + short field_0xc8e; // Also some sort of index into alert_box_messages + undefined2 field_0xc90; + undefined2 field_0xc92; + undefined field_0xc93; + undefined field_0xc94; + undefined field_0xc95; + undefined field_0xc96; + undefined field_0xc97; + undefined4 field_0xc98; + struct preprocessor_args preprocessor_args; + uint8_t alert_box_window_id; // 0xCEC + undefined field_0xced; + undefined field_0xcee; + undefined4 field_0xcef; +} +ASSERT_SIZE(struct alert_box_info, 3312); + +// Contains the alert_box_info struct as well as information related to the current message group. +struct message_log_info { + // 0x0: If true, a new message group will start on the next LogMessage call, even if the user + // matches the last user. A "group" of messages is separated by a horizontal line. + bool should_start_group; + undefined field_0x1; + undefined field_0x2; + undefined field_0x3; + struct alert_box_info* alert_box_info; + // 0x4: If this does not match the current user, a new group will always start + struct entity* last_user; +} +ASSERT_SIZE(struct message_log_info, 12); + // Separate this out into its own file because it's massive #include "dungeon.h" diff --git a/headers/types/dungeon_mode/enums.h b/headers/types/dungeon_mode/enums.h index 8ba23780..e1710d79 100644 --- a/headers/types/dungeon_mode/enums.h +++ b/headers/types/dungeon_mode/enums.h @@ -1468,4 +1468,16 @@ enum monster_treatment { TREATMENT_IGNORE = 2, }; +// Used to indicate what visual effect a monster should undergo while taking damage +enum damage_visual { + DAMAGE_VISUAL_NONE = 0, + DAMAGE_VISUAL_FLICKERING = 1, + DAMAGE_VISUAL_INVISIBLE = 2, // For fissure +}; + +// This is usually stored as an 8-bit integer +#pragma pack(push, 1) +ENUM_8_BIT(damage_visual); +#pragma pack(pop) + #endif diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 83b7e8a1..8446ce2e 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -1669,6 +1669,16 @@ overlay29: r0: position r1: bool update trap visibility return: whether a trap was succesfully removed or not + - name: TryRevealAttackedTrap + address: + EU: 0x22EE88C + description: |- + Reveals the trap given by the position if the dungeon struct's regular_attack_reveal_traps field is true. + + Is also activated on a tile if a fainted monster drops an item on it. + + r0: position struct pointer + r1: boolean for whether to update trap visibility afterwards (always 1 in practice) - name: TryTriggerTrap address: EU: 0x22EE950 @@ -2650,6 +2660,13 @@ overlay29: r0: entity pointer return: bool + - name: ResetTriggerFlags + address: + EU: 0x22FC4B0 + description: |- + Resets a monster's contact_ability_trigger_bitflags and exclusive_item_trigger_bitflags fields to 0. + + r0: entity pointer - name: IsSpecialStoryAlly address: EU: 0x22FC4CC @@ -7073,6 +7090,15 @@ overlay29: Attempts to activate Gravity for this dungeon floor. return: whether or not gravity was activated + - name: RevealAttackedTile + address: + EU: 0x2339000 + description: |- + Reveals the tile given by the position. + + Is also activated on a tile if a fainted monster drops an item on it. + + r0: position struct pointer - name: ShouldBoostKecleonShopSpawnChance address: EU: 0x2339090 @@ -8845,17 +8871,91 @@ overlay29: Note: unverified, ported from Irdkwia's notes r0: mission struct + - name: InitAlertBoxInfo + address: + EU: 0x234BBA4 + description: Initializes the heap-allocated alert_box_info struct in MESSAGE_LOG_INFO. + - name: FreeAlertBoxInfo + address: + EU: 0x234BBD0 + description: Frees the heap-allocated alert_box_info struct in MESSAGE_LOG_INFO. + - name: SetMessageLogGroupStartFlag + address: + EU: 0x234BC24 + description: |- + Sets whether the next message in the message log should be the start of a new group separated by a horizontal line. + + r0: bool + - name: GetGlobalPreprocessorArgs + address: + EU: 0x234BC34 + description: |- + Gets a pointer to the global preprocessor_args struct used for the message log. + + return: preprocessor_args pointer + - name: InitGlobalPreprocessorArgs + address: + EU: 0x234BC4C + description: Initializes the global preprocessor_args struct used for the message log. + - name: SetPreprocessorArgsFlagVal + address: + EU: 0x234BC6C + description: |- + Sets a flag_vals element in the global preprocessor_args struct used for the message log to a specified value. + + r0: position in flag_vals array + r1: value - name: SetPreprocessorArgsIdVal address: EU: 0x234BC84 NA: 0x234B084 JP: 0x234C2F4 description: |- - Sets an id_vals element in the global preprocessor_args struct passed throughout the code to PreprocessString to a specified value. + Sets an id_vals element in the global preprocessor_args struct used for the message log to a specified value. r0: position in id_vals array r1: value - - name: LogMessageByIdWithPopupCheckParticipants + - name: SetPreprocessorArgsNumberVal + address: + EU: 0x234BC9C + description: |- + Sets a number_vals element in the global preprocessor_args struct used for the message log to a specified value. + + r0: position in number_vals array + r1: value + - name: SetPreprocessorArgsString + address: + EU: 0x234BC9C + description: |- + Sets a strings element in the global preprocessor_args struct used for the message log to a specified string. + + r0: position in strings array + r1: string pointer + - name: SetPreprocessorArgsStringToName + address: + EU: 0x234BCCC + description: |- + Sets a strings element in the global preprocessor_args struct used for the message log to the name of a monster. + + r0: position in strings array + r1: monster_id + - name: SetPreprocessorArgsSpeakerId + address: + EU: 0x234BD04 + description: |- + Sets the speaker_id in the global preprocessor_args struct used for the message log to the id of a monster. + + r0: monster_id + - name: SetPreprocessorArgsSpeakerId0x30000 + address: + EU: 0x234BD18 + description: |- + Sets the speaker_id in the global preprocessor_args struct used for the message log to a monster's team index, ORed with 0x30000. + + r0: team_index + - name: LogMessageByIdWithPopupAndAbility + aliases: + - LogMessageByIdWithPopupCheckParticipants address: EU: 0x234BE50 NA: 0x234B250 @@ -8863,13 +8963,13 @@ overlay29: description: |- Logs the appropriate message based on the participating entites; this function calls LogMessageByIdWithPopupCheckUserTarget is both the user and target pointers are non-null, otherwise it calls LogMessageByIdWithPopupCheckUser if the user pointer is non-null, otherwise doesn't log anything. - This function also seems to set some global table entry to some value? + This function also replaces the [c_i:r3] tag by setting an id_vals element in the global preprocessor_args struct used for the message log to an ability. r0: user entity pointer r1: target entity pointer r2: message ID - r3: index into some table? - stack[0]: value to set at the table index specified by r3? + r3: position in id_vals array + stack[0]: value (in practice, always the ability, although could be used for any other text tag that uses id_vals) - name: LogMessageByIdWithPopupCheckUser address: EU: 0x234BEA4 @@ -10418,6 +10518,12 @@ overlay29: EU: 0x4 NA: 0x4 description: "[Runtime] Pointer to decoded fixed room data loaded from the BALANCE/fixed.bin file." + - name: MESSAGE_LOG_INFO + address: + EU: 0x023543E4 + length: + EU: 0xC + description: "[Runtime] Struct containing information and state for logged messages." - name: DUNGEON_FADES_PTR address: EU: 0x23543F8 From 9ecad59b5ec8d840607da03d2dc92714db59c869 Mon Sep 17 00:00:00 2001 From: assidion Date: Sun, 14 Sep 2025 15:45:28 +0400 Subject: [PATCH 131/204] a --- headers/functions/overlay29.h | 2 +- headers/types/dungeon_mode/dungeon_mode.h | 4 ++-- symbols/overlay29.yml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index 17264c28..8b99ac7c 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -903,7 +903,7 @@ struct mission* GetMissionIfActiveOnFloor(struct dungeon_floor_pair* pair, uint8 void GenerateMissionEggMonster(struct mission* mission); void InitAlertBoxInfo(void); void FreeAlertBoxInfo(void); -void SetMessageGroupStartFlag(bool should_start_group); +void SetMessageLogGroupStartFlag(bool should_start_group); struct preprocessor_args* GetGlobalPreprocessorArgs(void); void InitGlobalPreprocessorArgs(void); void SetPreprocessorArgsFlagVal(uint8_t pos, uint32_t val); diff --git a/headers/types/dungeon_mode/dungeon_mode.h b/headers/types/dungeon_mode/dungeon_mode.h index 7b6182b5..99fcae6c 100644 --- a/headers/types/dungeon_mode/dungeon_mode.h +++ b/headers/types/dungeon_mode/dungeon_mode.h @@ -2543,7 +2543,7 @@ struct alert_box_info { undefined field_0xced; undefined field_0xcee; undefined4 field_0xcef; -} +}; ASSERT_SIZE(struct alert_box_info, 3312); // Contains the alert_box_info struct as well as information related to the current message group. @@ -2557,7 +2557,7 @@ struct message_log_info { struct alert_box_info* alert_box_info; // 0x4: If this does not match the current user, a new group will always start struct entity* last_user; -} +}; ASSERT_SIZE(struct message_log_info, 12); // Separate this out into its own file because it's massive diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 8446ce2e..b31cd4a0 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -8925,7 +8925,7 @@ overlay29: r1: value - name: SetPreprocessorArgsString address: - EU: 0x234BC9C + EU: 0x234BCB4 description: |- Sets a strings element in the global preprocessor_args struct used for the message log to a specified string. @@ -10520,7 +10520,7 @@ overlay29: description: "[Runtime] Pointer to decoded fixed room data loaded from the BALANCE/fixed.bin file." - name: MESSAGE_LOG_INFO address: - EU: 0x023543E4 + EU: 0x23543E4 length: EU: 0xC description: "[Runtime] Struct containing information and state for logged messages." From cb72db795ad939e7d9dec55e3ef190c58916994e Mon Sep 17 00:00:00 2001 From: assidion Date: Sun, 14 Sep 2025 15:47:15 +0400 Subject: [PATCH 132/204] a --- headers/types/dungeon_mode/dungeon_mode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/types/dungeon_mode/dungeon_mode.h b/headers/types/dungeon_mode/dungeon_mode.h index 99fcae6c..d694d504 100644 --- a/headers/types/dungeon_mode/dungeon_mode.h +++ b/headers/types/dungeon_mode/dungeon_mode.h @@ -719,7 +719,7 @@ struct entity { bool is_visible; // 0x20: For traps/hidden stairs undefined field_0x21; // 0x22: Set when a monster is taking damage - enum damage_visual damage_visual_effect; + enum damage_visual_8 damage_visual_effect; // 0x23: Seems to be the animation frame counter for the 10-frame "shuffle" animation that // plays at the end of a walk sequence uint8_t end_walk_anim_frame; From 9d0d360622b973a05be4a78b32d080561ddf938d Mon Sep 17 00:00:00 2001 From: assidion Date: Sun, 14 Sep 2025 15:48:18 +0400 Subject: [PATCH 133/204] a --- 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 8b99ac7c..de1551d1 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -914,7 +914,7 @@ void SetPreprocessorArgsStringToName(uint8_t pos, enum monster_id monster_id); void SetPreprocessorArgsSpeakerId(enum monster_id monster_id); void SetPreprocessorArgsSpeakerId0x30000(int16_t team_index); void LogMessageByIdWithPopupAndAbility(struct entity* user, struct entity* target, - int message_id, int idx, int16_t val); + int message_id, int idx, int16_t val); void LogMessageByIdWithPopupCheckUser(struct entity* user, int message_id); void LogMessageWithPopupCheckUser(struct entity* user, const char* message); void LogMessageByIdQuiet(struct entity* user, int message_id); From f935193a43cb577b69bb13905b75454a1357897e Mon Sep 17 00:00:00 2001 From: assidion Date: Sun, 14 Sep 2025 15:51:55 +0400 Subject: [PATCH 134/204] a --- headers/functions/overlay29.h | 4 ++-- headers/types/dungeon_mode/dungeon_mode.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index de1551d1..dbb87732 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -913,8 +913,8 @@ void SetPreprocessorArgsString(uint8_t pos, char* string); void SetPreprocessorArgsStringToName(uint8_t pos, enum monster_id monster_id); void SetPreprocessorArgsSpeakerId(enum monster_id monster_id); void SetPreprocessorArgsSpeakerId0x30000(int16_t team_index); -void LogMessageByIdWithPopupAndAbility(struct entity* user, struct entity* target, - int message_id, int idx, int16_t val); +void LogMessageByIdWithPopupAndAbility(struct entity* user, struct entity* target, int message_id, + int idx, int16_t val); void LogMessageByIdWithPopupCheckUser(struct entity* user, int message_id); void LogMessageWithPopupCheckUser(struct entity* user, const char* message); void LogMessageByIdQuiet(struct entity* user, int message_id); diff --git a/headers/types/dungeon_mode/dungeon_mode.h b/headers/types/dungeon_mode/dungeon_mode.h index d694d504..94f9a16e 100644 --- a/headers/types/dungeon_mode/dungeon_mode.h +++ b/headers/types/dungeon_mode/dungeon_mode.h @@ -719,7 +719,7 @@ struct entity { bool is_visible; // 0x20: For traps/hidden stairs undefined field_0x21; // 0x22: Set when a monster is taking damage - enum damage_visual_8 damage_visual_effect; + struct damage_visual_8 damage_visual_effect; // 0x23: Seems to be the animation frame counter for the 10-frame "shuffle" animation that // plays at the end of a walk sequence uint8_t end_walk_anim_frame; From c08418f58f9e3730759a2bf5d20a078297d62144 Mon Sep 17 00:00:00 2001 From: assidion Date: Sun, 14 Sep 2025 15:53:34 +0400 Subject: [PATCH 135/204] a --- headers/types/dungeon_mode/dungeon_mode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/types/dungeon_mode/dungeon_mode.h b/headers/types/dungeon_mode/dungeon_mode.h index 94f9a16e..a02776d0 100644 --- a/headers/types/dungeon_mode/dungeon_mode.h +++ b/headers/types/dungeon_mode/dungeon_mode.h @@ -2542,7 +2542,7 @@ struct alert_box_info { uint8_t alert_box_window_id; // 0xCEC undefined field_0xced; undefined field_0xcee; - undefined4 field_0xcef; + undefined field_0xcef; }; ASSERT_SIZE(struct alert_box_info, 3312); From 6894d460aa1a1a5f73b3360dab53da9359d7b791 Mon Sep 17 00:00:00 2001 From: assidion Date: Sun, 14 Sep 2025 15:54:33 +0400 Subject: [PATCH 136/204] a --- headers/types/dungeon_mode/dungeon_mode.h | 1 - 1 file changed, 1 deletion(-) diff --git a/headers/types/dungeon_mode/dungeon_mode.h b/headers/types/dungeon_mode/dungeon_mode.h index a02776d0..2659dce6 100644 --- a/headers/types/dungeon_mode/dungeon_mode.h +++ b/headers/types/dungeon_mode/dungeon_mode.h @@ -2532,7 +2532,6 @@ struct alert_box_info { short field_0xc8e; // Also some sort of index into alert_box_messages undefined2 field_0xc90; undefined2 field_0xc92; - undefined field_0xc93; undefined field_0xc94; undefined field_0xc95; undefined field_0xc96; From bb97e87072401045d84ae6feab193f2c9c338b7a Mon Sep 17 00:00:00 2001 From: assidion Date: Sun, 14 Sep 2025 16:08:09 +0400 Subject: [PATCH 137/204] a --- headers/types/dungeon_mode/dungeon_mode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/types/dungeon_mode/dungeon_mode.h b/headers/types/dungeon_mode/dungeon_mode.h index 2659dce6..4a634701 100644 --- a/headers/types/dungeon_mode/dungeon_mode.h +++ b/headers/types/dungeon_mode/dungeon_mode.h @@ -2528,7 +2528,7 @@ struct alert_box_info { bool message_starts_group[10]; undefined field_0xc8a; undefined field_0xc8b; - short alert_box_message_idx; // 0xC8C: Index of current message in alert_box_messages + short alert_box_current_idx; // 0xC8C: Index of current message in alert_box_messages short field_0xc8e; // Also some sort of index into alert_box_messages undefined2 field_0xc90; undefined2 field_0xc92; From 2747ecf54f2f03819b1a968dbf65f86e6103c85c Mon Sep 17 00:00:00 2001 From: assidion Date: Mon, 15 Sep 2025 00:51:20 +0400 Subject: [PATCH 138/204] a --- headers/types/common/graphics.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/types/common/graphics.h b/headers/types/common/graphics.h index 11703480..054d4eee 100644 --- a/headers/types/common/graphics.h +++ b/headers/types/common/graphics.h @@ -20,7 +20,7 @@ struct animation_control { undefined field8_0xf; // 0x10: Information used to create an object's OAM attributes. // See https://problemkaputt.de/gbatek.htm#lcdobjoamattributes - // In particular, the first three elements of the array are ANDed with some value, then ORed + // To do so, the first three elements of the array are ANDed with some value, then ORed // with the element three indexes above. // Notably, setting bit 0x400 of the fourth element will make the object semi-transparent. uint16_t oam_attribute_info[6]; From d43f581aebf46a0e2af63864b742b9829b41c5fe Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 16 Sep 2025 13:12:59 +0400 Subject: [PATCH 139/204] a --- headers/functions/overlay29.h | 18 ++++++++--------- headers/types/common/graphics.h | 2 +- symbols/overlay29.yml | 34 +++++++++++++++++++++------------ 3 files changed, 32 insertions(+), 22 deletions(-) diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index dbb87732..20fae858 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -904,15 +904,15 @@ void GenerateMissionEggMonster(struct mission* mission); void InitAlertBoxInfo(void); void FreeAlertBoxInfo(void); void SetMessageLogGroupStartFlag(bool should_start_group); -struct preprocessor_args* GetGlobalPreprocessorArgs(void); -void InitGlobalPreprocessorArgs(void); -void SetPreprocessorArgsFlagVal(uint8_t pos, uint32_t val); -void SetPreprocessorArgsIdVal(uint8_t pos, uint32_t val); -void SetPreprocessorArgsNumberVal(uint8_t pos, uint32_t val); -void SetPreprocessorArgsString(uint8_t pos, char* string); -void SetPreprocessorArgsStringToName(uint8_t pos, enum monster_id monster_id); -void SetPreprocessorArgsSpeakerId(enum monster_id monster_id); -void SetPreprocessorArgsSpeakerId0x30000(int16_t team_index); +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 LogMessageByIdWithPopupCheckUser(struct entity* user, int message_id); diff --git a/headers/types/common/graphics.h b/headers/types/common/graphics.h index 054d4eee..c362aafb 100644 --- a/headers/types/common/graphics.h +++ b/headers/types/common/graphics.h @@ -22,7 +22,7 @@ struct animation_control { // See https://problemkaputt.de/gbatek.htm#lcdobjoamattributes // To do so, the first three elements of the array are ANDed with some value, then ORed // with the element three indexes above. - // Notably, setting bit 0x400 of the fourth element will make the object semi-transparent. + // Notably, setting bit 0x400 of oam_attribute_info[3] will make the object semi-transparent. uint16_t oam_attribute_info[6]; struct vec2_16 position; struct vec2_16 anim_frame_offset; diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index b31cd4a0..1734c3d5 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -1679,6 +1679,7 @@ overlay29: r0: position struct pointer r1: boolean for whether to update trap visibility afterwards (always 1 in practice) + return: true if there is a trap on the position - name: TryTriggerTrap address: EU: 0x22EE950 @@ -8874,11 +8875,17 @@ overlay29: - name: InitAlertBoxInfo address: EU: 0x234BBA4 - description: Initializes the heap-allocated alert_box_info struct in MESSAGE_LOG_INFO. + description: |- + Initializes the heap-allocated alert_box_info struct in MESSAGE_LOG_INFO. + + No params. - name: FreeAlertBoxInfo address: EU: 0x234BBD0 - description: Frees the heap-allocated alert_box_info struct in MESSAGE_LOG_INFO. + description: |- + Frees the heap-allocated alert_box_info struct in MESSAGE_LOG_INFO. + + No params. - name: SetMessageLogGroupStartFlag address: EU: 0x234BC24 @@ -8886,18 +8893,21 @@ overlay29: Sets whether the next message in the message log should be the start of a new group separated by a horizontal line. r0: bool - - name: GetGlobalPreprocessorArgs + - name: GetMessageLogPreprocessorArgs address: EU: 0x234BC34 description: |- Gets a pointer to the global preprocessor_args struct used for the message log. return: preprocessor_args pointer - - name: InitGlobalPreprocessorArgs + - name: InitMessageLogPreprocessorArgs address: EU: 0x234BC4C - description: Initializes the global preprocessor_args struct used for the message log. - - name: SetPreprocessorArgsFlagVal + description: |- + Initializes the global preprocessor_args struct used for the message log. + + No params. + - name: SetMessageLogPreprocessorArgsFlagVal address: EU: 0x234BC6C description: |- @@ -8905,7 +8915,7 @@ overlay29: r0: position in flag_vals array r1: value - - name: SetPreprocessorArgsIdVal + - name: SetMessageLogPreprocessorArgsIdVal address: EU: 0x234BC84 NA: 0x234B084 @@ -8915,7 +8925,7 @@ overlay29: r0: position in id_vals array r1: value - - name: SetPreprocessorArgsNumberVal + - name: SetMessageLogPreprocessorArgsNumberVal address: EU: 0x234BC9C description: |- @@ -8923,7 +8933,7 @@ overlay29: r0: position in number_vals array r1: value - - name: SetPreprocessorArgsString + - name: SetMessageLogPreprocessorArgsString address: EU: 0x234BCB4 description: |- @@ -8931,7 +8941,7 @@ overlay29: r0: position in strings array r1: string pointer - - name: SetPreprocessorArgsStringToName + - name: SetMessageLogPreprocessorArgsStringToName address: EU: 0x234BCCC description: |- @@ -8939,14 +8949,14 @@ overlay29: r0: position in strings array r1: monster_id - - name: SetPreprocessorArgsSpeakerId + - name: SetMessageLogPreprocessorArgsSpeakerId address: EU: 0x234BD04 description: |- Sets the speaker_id in the global preprocessor_args struct used for the message log to the id of a monster. r0: monster_id - - name: SetPreprocessorArgsSpeakerId0x30000 + - name: SetMessageLogPreprocessorArgsSpeakerId0x30000 address: EU: 0x234BD18 description: |- From 14bc2a8f38ded3eaff059d1a2e91884292527a3b Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 16 Sep 2025 20:30:22 +0400 Subject: [PATCH 140/204] a --- symbols/overlay29.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 1734c3d5..6426ab6e 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -8916,6 +8916,8 @@ overlay29: r0: position in flag_vals array r1: value - name: SetMessageLogPreprocessorArgsIdVal + aliases: + - SetPreprocessorArgsIdVal address: EU: 0x234BC84 NA: 0x234B084 From 02ad3adf37d6f55f2182bbdbbe4b38330a1b96c6 Mon Sep 17 00:00:00 2001 From: assidion Date: Wed, 17 Sep 2025 12:56:24 +0400 Subject: [PATCH 141/204] a --- symbols/arm9.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index dd4f6aa8..8efbd406 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -5072,9 +5072,9 @@ arm9: NA: 0x2024FE8 JP: 0x2025038 description: |- - Sets what item's name should be displayed in place of the [item:r0] tag when printing a string. + Sets what item's name should be displayed in place of the [item:r0] tag when printing a string to the message log. - Is almost always accompanied by a SetPreprocessorArgsIdVal(tag id, tag id | 0x40000) call in dungeon mode. + Is almost always accompanied by a SetMessageLogPreprocessorArgsIdVal(tag id, tag id | 0x40000) call. r0: tag id r1: item struct pointer From d6ead9a11371d91c7462feab68050419ce734b04 Mon Sep 17 00:00:00 2001 From: assidion Date: Wed, 17 Sep 2025 15:33:24 +0400 Subject: [PATCH 142/204] a --- headers/functions/arm9.h | 1 + headers/functions/overlay29.h | 2 ++ symbols/arm9.yml | 8 ++++++++ symbols/overlay29.yml | 11 +++++++++++ 4 files changed, 22 insertions(+) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 99addd8d..0d55a2ce 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -528,6 +528,7 @@ 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* GetDungeonResultString(int string_number); void SubstitutePlaceholderItemTags(uint8_t tag_id, struct item* item, undefined4* param_3); void SetQuestionMarks(char* s); diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index 20fae858..9b70e616 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -276,6 +276,8 @@ 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, int buffer_idx, + 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); diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 8efbd406..7462238f 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -5050,6 +5050,14 @@ arm9: r0: [output] Pointer to the buffer where the string will be written return: Pointer to the buffer where the string was written (in other words, the same value passed in r0) + - name: GetSize0x80Buffer + address: + EU: 0x02025284 + description: |- + Returns a pointer to a buffer of size 0x80. + + r0: index in a global list of buffers + return: buffer pointer - name: GetDungeonResultString address: EU: 0x20252A4 diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 6426ab6e..24a80912 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -3026,6 +3026,17 @@ overlay29: r1: format ...: variadic return: number of characters printed, excluding the null-terminator + - name: SetPreprocessorArgsStringToName + address: + EU: 0x2300E38 + description: |- + Sets a strings element in a preprocessor_args struct to the name of a monster. + + r0: preprocessor_args pointer (if this is null, will use the global message log preprocessor_args struct) + r1: index of buffer in a global list + r2: monster pointer + r3: unused + stack[0]: if 0, will call GetMonsterName; if 1, will call GetMonsterNameWithGender; the 2 case is unknown and seemingly unused. - name: IsMonsterDrowsy address: EU: 0x2300EDC From 5212ea36da48ebd53c694eaf47c722537f3760d6 Mon Sep 17 00:00:00 2001 From: assidion Date: Wed, 17 Sep 2025 15:34:11 +0400 Subject: [PATCH 143/204] a --- symbols/arm9.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 7462238f..86f1d4c3 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -5052,7 +5052,7 @@ arm9: return: Pointer to the buffer where the string was written (in other words, the same value passed in r0) - name: GetSize0x80Buffer address: - EU: 0x02025284 + EU: 0x2025284 description: |- Returns a pointer to a buffer of size 0x80. From 0d1d487e815215f034a39b5647c9ca2ea819fab1 Mon Sep 17 00:00:00 2001 From: assidion Date: Wed, 17 Sep 2025 15:36:52 +0400 Subject: [PATCH 144/204] a --- headers/functions/overlay29.h | 2 +- symbols/overlay29.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index 9b70e616..5d86ad12 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -276,7 +276,7 @@ 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, int buffer_idx, +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); diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 24a80912..2526de85 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -3033,7 +3033,7 @@ overlay29: Sets a strings element in a preprocessor_args struct to the name of a monster. r0: preprocessor_args pointer (if this is null, will use the global message log preprocessor_args struct) - r1: index of buffer in a global list + r1: position in strings array r2: monster pointer r3: unused stack[0]: if 0, will call GetMonsterName; if 1, will call GetMonsterNameWithGender; the 2 case is unknown and seemingly unused. From 4432674910e2e61a7c3845a1f41a5d852bac12d2 Mon Sep 17 00:00:00 2001 From: assidion Date: Wed, 17 Sep 2025 19:40:04 +0400 Subject: [PATCH 145/204] a --- headers/functions/arm9.h | 1 + headers/functions/overlay29.h | 3 +++ symbols/arm9.yml | 8 ++++++++ symbols/overlay29.yml | 20 +++++++++++++++++++- 4 files changed, 31 insertions(+), 1 deletion(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 0d55a2ce..4fe217b5 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -529,6 +529,7 @@ 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); diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index 5d86ad12..d4ce71b6 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -147,6 +147,8 @@ bool TrySpawnTrap(struct position* pos, enum trap_id trap_id, uint8_t team, bool bool TrySpawnTrapperTrap(struct entity* entity); bool TryRemoveTrap(struct position* pos, bool update_trap_visibility); bool TryRevealAttackedTrap(struct position* pos, bool update_trap_visibility); +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); @@ -849,6 +851,7 @@ void GenerateAndSpawnItem(enum item_id item_id, int16_t x, int16_t y, uint16_t q bool IsHiddenStairsFloor(void); bool IsSecretBazaarVeneer(void); 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); diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 86f1d4c3..6f9be42c 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -5056,6 +5056,14 @@ arm9: description: |- Returns a pointer to a buffer of size 0x80. + r0: index in a global list of buffers + return: buffer pointer + - name: GetSize0x80Buffer2 + address: + EU: 0x2025294 + description: |- + Same as GetSize0x80Buffer, except the buffer is from a separate list. + r0: index in a global list of buffers return: buffer pointer - name: GetDungeonResultString diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 2526de85..0541a16d 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -1680,6 +1680,15 @@ overlay29: r0: position struct pointer r1: boolean for whether to update trap visibility afterwards (always 1 in practice) return: true if there is a trap on the position + - name: SubstitutePlaceholderTrapTags + address: + EU: 0x22EE92C + description: |- + Used in SubstitutePlaceholderStringTags. Substitutes a [trap:r1] tag in a message log message for the name of a trap. + + r0: preprocessor_args pointer (in practice, always the global struct used for the message log) + r1: tag id + r2: trap id - name: TryTriggerTrap address: EU: 0x22EE950 @@ -8376,10 +8385,19 @@ overlay29: - 0x2345F08 - 0x2345F34 description: |- - Calls functions to prepare an item to be printed in place of the [item:r0] tag. + Calls functions to prepare an item to be printed in place of the [item:r0] tag in a message log message. r0: tag id r1: item struct pointer + - name: PrepareItemForPrinting2 + address: + EU: 0x234578C + description: |- + Used in SubstitutePlaceholderStringTags. Has the same functionality as PrepareItemForPrinting, except the message log preprocessor_args struct is passed as a parameter. + + r0: preprocessor_args pointer (in practice, always the global struct used for the message log) + r1: tag id + r2: some static address - name: GenerateStandardItem address: EU: 0x23457B4 From e6a4767b8eb48b396b814f84471cc954256d8cfd Mon Sep 17 00:00:00 2001 From: assidion Date: Wed, 17 Sep 2025 19:43:12 +0400 Subject: [PATCH 146/204] a --- symbols/overlay29.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 0541a16d..ac24a998 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -543,7 +543,7 @@ overlay29: r0: string ID (unclear what this means) r1: entity pointer - r2: ? + r2: unused - name: UpdateMapSurveyorFlag address: EU: 0x22E375C From 8848b5fb6361f46540115cfebc8e28540a532152 Mon Sep 17 00:00:00 2001 From: assidion Date: Wed, 17 Sep 2025 19:44:42 +0400 Subject: [PATCH 147/204] a --- headers/functions/overlay29.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index d4ce71b6..0879cd37 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -851,7 +851,8 @@ void GenerateAndSpawnItem(enum item_id item_id, int16_t x, int16_t y, uint16_t q bool IsHiddenStairsFloor(void); bool IsSecretBazaarVeneer(void); void PrepareItemForPrinting(uint8_t tag_id, struct item* item); -void PrepareItemForPrinting2(struct preprocessor_args* preprocessor_args, 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); From e653a1ce7ccebf36920f53fc625480ffbbbbe5e1 Mon Sep 17 00:00:00 2001 From: assidion Date: Wed, 17 Sep 2025 20:22:36 +0400 Subject: [PATCH 148/204] a --- symbols/overlay29.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index ac24a998..66944764 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -8397,7 +8397,7 @@ overlay29: r0: preprocessor_args pointer (in practice, always the global struct used for the message log) r1: tag id - r2: some static address + r2: item pointer - name: GenerateStandardItem address: EU: 0x23457B4 From de83a3422d558e04f1f0207a41aba7a99f26e32e Mon Sep 17 00:00:00 2001 From: assidion Date: Sun, 28 Sep 2025 23:25:31 +0400 Subject: [PATCH 149/204] a --- headers/data/overlay10.h | 7 +++ headers/data/overlay31.h | 8 +-- headers/functions/arm9.h | 11 +++- headers/functions/overlay29.h | 15 ++++-- headers/functions/overlay31.h | 2 + headers/types/common/sound.h | 5 +- headers/types/common/window.h | 28 ++++++---- symbols/arm9.yml | 99 ++++++++++++++++++++++++++++++----- symbols/overlay10.yml | 42 +++++++++++++++ symbols/overlay29.yml | 94 ++++++++++++++++++++++++++++++--- symbols/overlay31.yml | 28 ++++++++-- 11 files changed, 296 insertions(+), 43 deletions(-) diff --git a/headers/data/overlay10.h b/headers/data/overlay10.h index 8761c297..61c298d8 100644 --- a/headers/data/overlay10.h +++ b/headers/data/overlay10.h @@ -30,6 +30,7 @@ extern int16_t WHIRLPOOL_CONSTRICTION_CHANCE; extern int16_t EXP_ELITE_EXP_BOOST; extern int16_t MONSTER_HOUSE_MAX_NON_MONSTER_SPAWNS; extern int16_t HEAL_ORDER_HP_RESTORATION; +extern int16_t CURSE_DAMAGE_COOLDOWN; extern int16_t STEEL_WING_BOOST_DEFENSE_CHANCE; extern int16_t GOLD_THORN_POWER; extern int16_t BURN_DAMAGE; @@ -63,11 +64,15 @@ extern int16_t RAIN_ABILITY_BONUS_REGEN; extern int16_t AI_CONFUSED_NO_ATTACK_CHANCE; extern int16_t LEECH_SEED_HP_DRAIN; extern int16_t EXCLUSIVE_ITEM_EXP_BOOST; +extern int16_t INGRAIN_BONUS_REGEN; extern int16_t AFTERMATH_CHANCE; extern int16_t SET_DAMAGE_STATUS_DAMAGE; extern int16_t INTIMIDATOR_ACTIVATION_CHANCE; +extern int16_t WRAP_DAMAGE; extern int16_t TYPE_ADVANTAGE_MASTER_CRIT_RATE; +extern int16_t INGRAIN_BONUS_REGEN_COOLDOWN; extern int16_t ORAN_BERRY_HP_RESTORATION; +extern int16_t WRAP_DAMAGE_COOLDOWN; extern int16_t SITRUS_BERRY_FULL_HP_BOOST; extern int16_t SNORE_CRINGE_CHANCE; extern int16_t METEOR_MASH_BOOST_ATTACK_CHANCE; @@ -75,6 +80,7 @@ extern int16_t CRUSH_CLAW_LOWER_DEFENSE_CHANCE; extern int16_t BURN_DAMAGE_COOLDOWN; extern int16_t SHADOW_BALL_LOWER_SPECIAL_DEFENSE_CHANCE; extern int16_t STICK_POWER; +extern int16_t AQUA_RING_BONUS_REGEN; extern int16_t BUBBLE_LOWER_SPEED_CHANCE; extern int16_t ICE_BODY_BONUS_REGEN; extern int16_t POWDER_SNOW_FREEZE_CHANCE; @@ -114,6 +120,7 @@ extern int16_t CACNEA_SPIKE_POWER; extern int16_t GOLD_FANG_POWER; extern int16_t SILVER_SPIKE_POWER; extern int16_t IRON_THORN_POWER; +extern int16_t BAD_WEATHER_DAMAGE; extern int16_t SCOPE_LENS_CRIT_RATE_BOOST; extern int16_t HEALING_WISH_HP_RESTORATION; extern fx32_8 ME_FIRST_MULTIPLIER; diff --git a/headers/data/overlay31.h b/headers/data/overlay31.h index 7b24c14b..8f5d34e6 100644 --- a/headers/data/overlay31.h +++ b/headers/data/overlay31.h @@ -10,10 +10,10 @@ extern char DUNGEON_MENU_SWITCH_STR1[12]; extern struct window_params DUNGEON_WINDOW_PARAMS_5; extern struct window_params DUNGEON_WINDOW_PARAMS_6; extern struct window_params DUNGEON_WINDOW_PARAMS_7; -extern struct simple_menu_id_item DUNGEON_SUBMENU_ITEMS_1[4]; -extern struct simple_menu_id_item DUNGEON_SUBMENU_ITEMS_2[4]; -extern struct simple_menu_id_item DUNGEON_SUBMENU_ITEMS_3[4]; -extern struct simple_menu_id_item DUNGEON_SUBMENU_ITEMS_4[4]; +extern struct simple_menu_id_item STAIRS_MENU_ITEMS_NORMAL[4]; +extern struct simple_menu_id_item STAIRS_MENU_ITEMS_WARP_ZONE[4]; +extern struct simple_menu_id_item STAIRS_MENU_ITEMS_RESCUE_POINT[4]; +extern struct simple_menu_id_item STAIRS_MENU_ITEMS_HIDDEN_STAIRS[4]; extern struct window_params DUNGEON_WINDOW_PARAMS_8; extern struct window_params DUNGEON_WINDOW_PARAMS_9; extern struct window_params DUNGEON_WINDOW_PARAMS_10; diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 13d8388e..5b3a4281 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -407,6 +407,7 @@ void PlaySeVolumeWrapper(int index); void PlayBgmById(enum music_id music_id); void PlayBgmByIdVolume(enum music_id music_id, undefined param_2, int volume); 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); @@ -589,6 +590,7 @@ void SetParentMenuState7(int window_id); void CloseParentMenu(int window_id); bool IsParentMenuActive(int window_id); bool CheckParentMenuField0x1A0(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, @@ -604,7 +606,6 @@ void CloseSimpleMenu(int window_id); bool IsSimpleMenuActive(int window_id); bool CheckSimpleMenuField0x1A0(int window_id); int GetSimpleMenuField0x1A4(int window_id); -int GetSimpleMenuResult(int window_id); void UpdateSimpleMenu(struct window* window); void SetSimpleMenuField0x1AC(int window_id, int value); int CreateAdvancedMenu(struct window_params* params, struct window_flags flags, @@ -698,6 +699,8 @@ bool IsControlsChartActive(int window_id); 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 IsAlertBoxActive(int window_id); void UpdateAlertBox(struct window* window); int CreateAdvancedTextBox(struct window_params* params, struct window_flags flags, @@ -736,8 +739,12 @@ int CalcMenuHeightDiv8(struct window_flags flags, struct window_extra_info* extr 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(undefined* param_1); +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); int GetPageItemYOffset(struct window_input_ctx* input_ctx, uint8_t item_idx); void PlayWindowInputSound(struct window_input_ctx* input_ctx, int index); diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index 7974da1b..48291a44 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -57,11 +57,13 @@ void PlayEffectAnimation0x171Full(struct entity* entity); void PlayEffectAnimation0x171(struct entity* entity); void PlayEffectAnimationEntityStandard(struct entity* entity, int effect_id); void ShowPpRestoreEffect(struct entity* entity); +void PlaySeIfShouldDisplayEntity(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 GetRandomTrapId(void); enum item_id GetItemIdToSpawn(enum item_list_type item_list); int CopySpawnEntriesMaster(struct monster_spawn_entry* spawn_entries, int offset); int MonsterSpawnListPartialCopy(struct monster_spawn_entry* buffer, int current_buffer_entries); @@ -138,6 +140,7 @@ bool IsDungeonEndReasonFailure(void); void SetForcedLossReason(enum forced_loss_reason forced_loss_reason); enum forced_loss_reason GetForcedLossReason(void); void BindTrapToTile(struct tile* tile, struct entity* trap, bool is_visible); +void SpawnTraps(void); bool AreLateGameTrapsEnabledWrapper(void); void SpawnEnemyTrapAtPos(enum trap_id trap_id, int16_t x, int16_t y, uint8_t flags, bool is_visible); @@ -147,6 +150,7 @@ bool TrySpawnTrap(struct position* pos, enum trap_id trap_id, uint8_t team, bool 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, @@ -453,8 +457,8 @@ void TryInflictNightmareStatus(struct entity* user, struct entity* target, int t 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, int param_3, int turns, - bool log_failure, bool check_only); +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, @@ -541,7 +545,7 @@ bool TryInflictExposedStatus(struct entity* user, struct entity* target, int eff bool only_check); void TryActivateIdentifyCondition(struct entity* user, struct entity* target); bool TryInflictBlinkerStatus(struct entity* user, struct entity* target, bool check_only, - bool log_failure); + 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); @@ -572,6 +576,7 @@ bool TryInflictEmbargoStatus(struct entity* user, struct entity* target, bool lo 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 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); @@ -637,6 +642,7 @@ int GetAiUseItemProbability(struct entity* item_consumer, struct item* item, uin bool IsAdjacentToEnemy(struct entity* entity); bool ShouldTryEatItem(enum item_id item_id); int GetMaxPpWrapper(struct move* move); +void MakeFloorOneRoom(struct entity* user); bool MoveIsNotPhysical(enum move_id move_id); bool CategoryIsNotPhysical(enum move_category category_id); void TryDrought(struct entity* user); @@ -926,6 +932,7 @@ 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); @@ -941,6 +948,8 @@ 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); diff --git a/headers/functions/overlay31.h b/headers/functions/overlay31.h index ade91fab..5d55fabc 100644 --- a/headers/functions/overlay31.h +++ b/headers/functions/overlay31.h @@ -7,6 +7,8 @@ void DungeonMenuSwitch(int idx); void CreateStairsMenuState(struct entity* entity); void StairsSubheadingCallback(int window_id); int HandleStairsMenu(void); +void CloseStairsMenu(void); +void FreeStairsMenuState(void); bool EntityIsValidOverlay31(struct entity* entity); void MovesMenu(struct action_data* action); bool HandleMovesMenuWrapper0(undefined* param_1, undefined param_2, undefined param_3, diff --git a/headers/types/common/sound.h b/headers/types/common/sound.h index 154fae5e..ef4952dc 100644 --- a/headers/types/common/sound.h +++ b/headers/types/common/sound.h @@ -91,8 +91,9 @@ struct audio_command { // 0x0: Seems to be a value that marks the status of this entry. It's probably an enum, maybe a // command ID. Seems to be 0 when the entry is not in use. int status; - struct music_id_16 music_id; // 0x4: ID of the music to play - uint16_t volume; // 0x6: Volume (0-255) + // 0x4: ID of the music to play. Is a ME ID instead when a ME is to be played. + struct music_id_16 music_id; + uint16_t volume; // 0x6: Volume (0-255) undefined2 field_0x8; undefined field_0xA; undefined field_0xB; diff --git a/headers/types/common/window.h b/headers/types/common/window.h index 42de2cd9..e9d8ed59 100644 --- a/headers/types/common/window.h +++ b/headers/types/common/window.h @@ -333,11 +333,13 @@ struct window_input_ctx { uint32_t first_item_y_offset; // 0xB4: Y-offset for first item on page // 0xB8: Difference in the Y-offset between one item and the next, shifted left by 8 bits uint32_t y_offset_diff; - undefined4 field_0xbc; - uint32_t n_items_on_page; // 0xC0: Actual number of items on the page - uint32_t max_items_on_page; // 0xC4: Maximum possible number of items on the page - uint32_t current_page_id; // 0xC8: Current page the user is on (starts at 0) - undefined fields_0xcc[40]; + uint32_t selected_item_on_page; // 0xBC: Index on the page of the current selected item + uint32_t n_items_on_page; // 0xC0: Actual number of items on the page + uint32_t max_items_on_page; // 0xC4: Maximum possible number of items on the page + uint32_t current_page_idx; // 0xC8: Current page the user is on (starts at 0) + uint32_t total_num_pages; // 0xCC: Total number of pages + uint32_t total_num_items; // 0xD0: Total number of menu items + undefined fields_0xd4[32]; uint8_t field_0xf4; undefined field_0xf5; undefined field_0xf6; @@ -643,8 +645,13 @@ struct controls_chart { }; ASSERT_SIZE(struct controls_chart, 168); -struct unk_alert_box_struct { - undefined fields_0x0[328]; +struct alert_box_message { + undefined4 field_0x0; + // 0x4: Whether the message is the start of a new group separated by a horizontal line + bool is_new_group; + char message[320]; // 0x5 + undefined field_0x145; + struct preprocessor_flags flags; // 0x146 }; ASSERT_SIZE(struct unk_alert_box_struct, 328); @@ -1085,8 +1092,11 @@ ASSERT_SIZE(struct inventory_menu, 420); // Used for creating the stairs menu. struct stairs_menu { - undefined4 field_0x0; - undefined4 field_0x4; + uint8_t header_window_id; // 0x0: window id for the header showing the type of stairs + uint8_t main_menu_window_id; // 0x1: window id for the main menu for selecting the action + uint8_t info_window_id; // 0x2: window id for the "Info" menu + undefined field_0x3; + int main_menu_result; // 0x4: Store the result of the main menu for selecting the action struct entity* entity; // 0x8: Seems to always point to the leader? // 0xC: Used for switching in HandleStairsMenu. // Seems to be 0 when opening the main stairs menu, 1 when the main stairs menu is open, diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 33539214..eb367019 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -3942,7 +3942,7 @@ arm9: description: |- Wrapper for PlaySeByIdVolume with 0x100 as the volume. - r0: Index + r0: Sound effect ID - name: PlaySeVolumeWrapper address: EU: 0x2017D68 @@ -3985,6 +3985,17 @@ arm9: Stops the BGM that is being currently played by calling SendAudioCommand. No params. + - name: PlayMeById + address: + EU: 0x2017E90 + NA: 0x2017DF4 + JP: 0x2017E4C + description: |- + Initializes some values and then calls SendAudioCommand to play a ME track. + + Checks for DEBUG_FLAG_BGM_OFF. The volume is set to either 0 or 255 depending on the flag before calling SendAudioCommand. + + r0: ME ID - name: PlaySeByIdVolume address: EU: 0x2018354 @@ -5667,6 +5678,18 @@ arm9: r0: window_id return: bool + - name: GetSimpleMenuResult + address: + EU: + - 0x202AEA4 + - 0x202B870 + NA: 0x202B57C + JP: 0x202B8D4 + description: |- + Note: unverified, ported from Irdkwia's notes + + r0: window_id + return: ? - name: UpdateParentMenu address: EU: 0x202AEF0 @@ -5776,16 +5799,6 @@ arm9: r0: window_id return: field_0x1a4 - - name: GetSimpleMenuResult - address: - EU: 0x202B870 - NA: 0x202B57C - JP: 0x202B8D4 - description: |- - Note: unverified, ported from Irdkwia's notes - - r0: window_id - return: ? - name: UpdateSimpleMenu address: EU: 0x202B8BC @@ -6627,6 +6640,18 @@ arm9: Closes a window created with CreateAlertBox. r0: window_id + - name: AddMessageToAlertBox + address: + EU: 0x2030400 + description: |- + Adds a message to the dungeon alert box. + + r0: window_id + r1: preprocessor flags + r2: message string pointer + r3: preprocessor_args struct pointer + stack[0]: whether the message is the start of a new group (meaning it should be preceded by a horizontal line) + return: whether the message was sucessfully added - name: IsAlertBoxActive address: EU: 0x20304E8 @@ -6925,8 +6950,26 @@ arm9: description: |- Called whenever a menu option is selected. Returns whether the option is active or not. - r0: ? + r0: window_input_ctx struct pointer return: True if the menu option is enabled, false otherwise. + - name: GetSelectedItemOnPage + address: + EU: 0x203286C + description: |- + Gets the index on the page of the current item the user has selected. + + r0: window_input_ctx struct pointer + return: index of current selected item on the page + - name: GetCurrentPage + address: + EU: 0x2032854 + NA: 0x2032568 + JP: 0x2032888 + description: |- + Gets the index of the current menu page the user is on. + + r0: window_input_ctx struct pointer + return: current page - name: GetPageStart address: EU: 0x203285C @@ -6937,6 +6980,22 @@ arm9: r0: window_input_ctx struct pointer return: index of first item on page + - name: GetSelectedMenuItemIdx + address: + EU: 0x203286C + description: |- + Gets the index of the current menu item the user has selected. + + r0: window_input_ctx struct pointer + return: index of current selected item + - name: GetTotalNumMenuItems + address: + EU: 0x2032880 + description: |- + Gets the total number of items in the menu. + + r0: window_input_ctx struct pointer + return: number of menu items - name: GetNumItemsOnPage address: EU: 0x2032888 @@ -6947,6 +7006,22 @@ arm9: r0: window_input_ctx struct pointer return: number of items on page + - name: GetMaxItemsOnPage + address: + EU: 0x2032890 + description: |- + Gets the maximum possible number of items the menu can hold on one of its pages. + + r0: window_input_ctx struct pointer + return: number of menu pages + - name: GetTotalNumPages + address: + EU: 0x2032898 + description: |- + Gets the total number of pages in the menu. + + r0: window_input_ctx struct pointer + return: number of menu pages - name: GetPageItemYOffset address: EU: 0x2032BCC diff --git a/symbols/overlay10.yml b/symbols/overlay10.yml index 8c41fa79..85b7779d 100644 --- a/symbols/overlay10.yml +++ b/symbols/overlay10.yml @@ -597,6 +597,12 @@ overlay10: NA: 0x2 JP: 0x2 description: The amount of HP restored by Heal Order (40). + - name: CURSE_DAMAGE_COOLDOWN + address: + EU: 0x22C4E14 + length: + EU: 0x2 + description: The number of turns between passive curse damage (3). - name: STEEL_WING_BOOST_DEFENSE_CHANCE address: EU: 0x22C4E1C @@ -897,6 +903,12 @@ overlay10: NA: 0x2 JP: 0x2 description: The percentage increase in experience from exp-boosting exclusive items. + - name: INGRAIN_BONUS_REGEN + address: + EU: 0x22C4EE8 + length: + EU: 0x2 + description: The passive bonus regen given by the Ingrain status condition (10). - name: AFTERMATH_CHANCE address: EU: 0x22C4EEC @@ -926,6 +938,12 @@ overlay10: NA: 0x2 JP: 0x2 description: The percentage chance that Intimidator will activate. + - name: WRAP_DAMAGE + address: + EU: 0x22C4F28 + length: + EU: 0x2 + description: Damage dealt by the wrap status condition (6). - name: TYPE_ADVANTAGE_MASTER_CRIT_RATE address: EU: 0x22C4F38 @@ -935,6 +953,12 @@ overlay10: NA: 0x2 JP: 0x2 description: "The flat critical hit rate with Type-Advantage Master, 40%." + - name: INGRAIN_BONUS_REGEN_COOLDOWN + address: + EU: 0x22C4F40 + length: + EU: 0x2 + description: The number of turns between ingrain health regeneration (5). - name: ORAN_BERRY_HP_RESTORATION address: EU: 0x22C4F44 @@ -945,6 +969,12 @@ overlay10: NA: 0x2 JP: 0x2 description: The amount of HP restored by eating a Oran Berry. + - name: WRAP_DAMAGE_COOLDOWN + address: + EU: 0x22C4F48 + length: + EU: 0x2 + description: The number of turns between passive wrap damage (2). - name: SITRUS_BERRY_FULL_HP_BOOST address: EU: 0x22C4F4C @@ -1011,6 +1041,12 @@ overlay10: NA: 0x2 JP: 0x2 description: Attack power for Sticks. + - name: AQUA_RING_BONUS_REGEN + address: + EU: 0x22C4F80 + length: + EU: 0x2 + description: The passive bonus regen given by the Aqua Ring status condition (8). - name: BUBBLE_LOWER_SPEED_CHANCE address: EU: 0x22C4F84 @@ -1379,6 +1415,12 @@ overlay10: NA: 0x2 JP: 0x2 description: Attack power for Iron Thorns. + - name: BAD_WEATHER_DAMAGE + address: + EU: 0x22c5044 + length: + EU: 0x2 + description: Damage dealt by the Sandstorm and Hail weather conditions (3). - name: SCOPE_LENS_CRIT_RATE_BOOST address: EU: 0x22C5048 diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index e81a2a9d..f2af206f 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -772,6 +772,15 @@ overlay29: Displays the graphical effect on a monster that just recovered PP. r0: entity pointer + - name: PlaySeByIdIfShouldDisplayEntity + address: + EU: 0x22E6050 + description: |- + Plays the specified sound effect if ShouldDisplayEntityAdvanced returns true for the entity (or if the entity pointer is null). + + r0: entity pointer + r1: Sound effect ID + return: bool - name: ShouldDisplayEntityAdvanced address: EU: 0x22E6880 @@ -841,6 +850,13 @@ overlay29: r0: quick_saved r1: disable_monsters r2: special_process + - name: GetRandomTrapId + address: + EU: 0x22E843C + description: |- + Gets the id of the trap to be used as the effect of a Random Trap. + + return: trap id - name: GetItemIdToSpawn address: EU: 0x22E8474 @@ -1315,6 +1331,13 @@ overlay29: Sets the dungeon PRNG to use the primary LCG for subsequent random number generation. No params. + - name: PlaySeByIdIfNotSilence + address: + EU: 0x22EB67C + description: |- + Plays the specified sound effect if it is not the designated silence value (0x3F00). + + r0: Sound effect ID - name: MusicTableIdxToMusicId address: EU: 0x22EB6B0 @@ -1584,6 +1607,13 @@ overlay29: r0: tile pointer r1: entity pointer r2: visibility flag + - name: SpawnTraps + address: + EU: 0x22EE238 + description: |- + Spawns a new dungeon floor's traps. + + No params. - name: AreLateGameTrapsEnabledWrapper address: EU: 0x22EE218 @@ -1682,6 +1712,14 @@ overlay29: r0: position struct pointer r1: boolean for whether to update trap visibility afterwards (always 1 in practice) return: true if there is a trap on the position + - name: SubstitutePlaceholderTrapTags2 + address: + EU: 0x22EE90C + description: |- + Used in TryTriggerTrap. Has the same functionality as SubstitutePlaceholderTrapTags. + + r1: tag id + r2: trap id - name: SubstitutePlaceholderTrapTags address: EU: 0x22EE92C @@ -1690,7 +1728,6 @@ overlay29: description: |- Used in SubstitutePlaceholderStringTags. Substitutes a [trap:r1] tag in a message log message for the name of a trap. - r0: preprocessor_args pointer (in practice, always the global struct used for the message log) r1: tag id r2: trap id - name: TryTriggerTrap @@ -3192,7 +3229,9 @@ overlay29: return: bool - name: CheckVariousStatuses2 address: - EU: 0x2301244 + EU: + - 0x2301244 + - 0x2301308 NA: 0x2300818 JP: 0x2301BFC description: |- @@ -3205,7 +3244,9 @@ overlay29: return: bool - name: CheckVariousConditions address: - EU: 0x230156C + EU: + - 0x230156C + - 0x2301624 NA: 0x2300B40 JP: 0x2301F24 description: |- @@ -3217,7 +3258,9 @@ overlay29: return: bool - name: CheckVariousStatuses address: - EU: 0x23016DC + EU: + - 0x23016DC + - 0x230172C NA: 0x2300CB0 JP: 0x2302094 description: |- @@ -4620,7 +4663,7 @@ overlay29: r0: user entity pointer r1: target entity pointer - r2: ? + r2: bool for whether status should not be inflicted if Safeguard is active r3: number of turns stack[0]: flag to log a message on failure stack[1]: flag to only perform the check for inflicting without actually inflicting @@ -5373,7 +5416,7 @@ overlay29: r0: user entity pointer r1: target entity pointer r2: flag to only perform the check for inflicting without actually inflicting - r3: flag to log a message on failure + r3: flag to make the status permanent (always 0 in the base game) return: Whether or not the status could be inflicted - name: IsBlinded address: @@ -5660,6 +5703,17 @@ overlay29: r0: entity pointer return: bool + - name: SetReflectStatus + address: + EU: 0x23197F8 + description: |- + Sets a target monster's reflect status to the specified value. + + If it already has the Counter, Mini Counter or Metal Burst status, its remaining turn counter will remain the same. + + r0: user entity pointer + r1: target entity pointer + r2: reflect status - name: TryInflictSafeguardStatus address: EU: 0x23198D0 @@ -6288,6 +6342,13 @@ overlay29: r0: move pointer return: max PP for the given move, capped at 99 + - name: MakeFloorOneRoom + address: + EU: 0x231F4A8 + description: |- + Removes all walls to make the floor one room. + + r0: user entity pointer - name: MoveIsNotPhysical address: EU: 0x231F480 @@ -9088,6 +9149,13 @@ overlay29: r2: message ID r3: position in id_vals array stack[0]: value (in practice, always the ability, although could be used for any other text tag that uses id_vals) + - name: WaitUntilAlertBoxTextIsLoadedWrapper + address: + EU: 0x234BE94 + description: |- + Calls WaitUntilAlertBoxTextIsLoaded with r0 = 0x50. + + No params. - name: LogMessageByIdWithPopupCheckUser address: EU: 0x234BEA4 @@ -9214,6 +9282,20 @@ overlay29: r0: user entity pointer r1: message ID r2: bool, whether or not to present a message popup + - name: AlertBoxIsScrolling + address: + EU: 0x234C3EC + description: |- + Returns true if the alert box is currently scrolling (i.e. a message is being loaded). + + return: bool + - name: WaitUntilAlertBoxTextIsLoaded + address: + EU: 0x234C618 + description: |- + Calls AdvanceFrame in a loop until the dungeon alert box has finished scrolling. + + r0: value to pass to AdvanceFrame (unused by the function) - name: InitPortraitDungeon address: EU: 0x234C6C0 diff --git a/symbols/overlay31.yml b/symbols/overlay31.yml index 7ea09dec..868616e8 100644 --- a/symbols/overlay31.yml +++ b/symbols/overlay31.yml @@ -70,7 +70,21 @@ overlay31: Uses a switch statement based on the state field in stairs_menu to determine what actions to take. - return: int + return: 4 if should close stairs menu entirely, 1 otherwise (including when switching between main/info menus) + - name: CloseStairsMenu + address: + EU: 0x2383E8C + description: |- + Closes the main stairs menu. Used both when closing it entirely as well as when switching to the info menu. + + No params. + - name: FreeStairsMenuState + address: + EU: 0x2383E8C + description: |- + Closes the main stairs menu and frees the heap-allocated stairs_menu struct pointed to by STAIRS_MENU_PTR. + + No params. - name: EntityIsValidOverlay31 address: EU: @@ -289,7 +303,7 @@ overlay31: NA: 0x10 JP: 0x10 description: "Note: unverified, ported from Irdkwia's notes" - - name: DUNGEON_SUBMENU_ITEMS_1 + - name: STAIRS_MENU_ITEMS_NORMAL address: EU: 0x238AA94 NA: 0x2389E70 @@ -298,7 +312,8 @@ overlay31: EU: 0x20 NA: 0x20 JP: 0x20 - - name: DUNGEON_SUBMENU_ITEMS_2 + description: "List of 4 simple_menu_id_items for the normal stairs menu." + - name: STAIRS_MENU_ITEMS_WARP_ZONE address: EU: 0x238AAB4 NA: 0x2389E90 @@ -307,7 +322,8 @@ overlay31: EU: 0x20 NA: 0x20 JP: 0x20 - - name: DUNGEON_SUBMENU_ITEMS_3 + description: "List of 4 simple_menu_id_items for the Warp Zone stairs menu." + - name: STAIRS_MENU_ITEMS_RESCUE_POINT address: EU: 0x238AAD4 NA: 0x2389EB0 @@ -316,7 +332,8 @@ overlay31: EU: 0x20 NA: 0x20 JP: 0x20 - - name: DUNGEON_SUBMENU_ITEMS_4 + description: "List of 4 simple_menu_id_items for the Rescue Point stairs menu." + - name: STAIRS_MENU_ITEMS_HIDDEN_STAIRS address: EU: 0x238AAF4 NA: 0x2389ED0 @@ -325,6 +342,7 @@ overlay31: EU: 0x20 NA: 0x20 JP: 0x20 + description: "List of 4 simple_menu_id_items for the hidden stairs menu." - name: OVERLAY31_UNKNOWN_STRUCT__NA_2389EF0 address: EU: 0x238AB14 From ee939251bd0adde85564d608aabb39e64a1654f2 Mon Sep 17 00:00:00 2001 From: assidion Date: Sun, 28 Sep 2025 23:30:33 +0400 Subject: [PATCH 150/204] a --- headers/types/common/window.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/headers/types/common/window.h b/headers/types/common/window.h index e9d8ed59..d151a515 100644 --- a/headers/types/common/window.h +++ b/headers/types/common/window.h @@ -649,11 +649,11 @@ struct alert_box_message { undefined4 field_0x0; // 0x4: Whether the message is the start of a new group separated by a horizontal line bool is_new_group; - char message[320]; // 0x5 + char message_contents[320]; // 0x5 undefined field_0x145; struct preprocessor_flags flags; // 0x146 }; -ASSERT_SIZE(struct unk_alert_box_struct, 328); +ASSERT_SIZE(struct alert_box_message, 328); // Also see CreateAlertBox // Used for popup log messages in dungeon mode that disappear after some time @@ -664,10 +664,10 @@ struct alert_box { undefined field_0x3; int state; // 0x4: appears to be a state value struct dialogue_display_ctx display_ctx; // 0x8 - struct unk_alert_box_struct field_0x124[4]; // length is a guess, but the size fits nicely - int16_t field_0x644; - int16_t idx1; // 0x646: some index into field_0x124 - int16_t idx2; // 0x648: some index into field_0x124 + struct alert_box_message messages[4]; // 0x124 + int16_t next_idx; // 0x644: Index to add next message at + int16_t idx1; // 0x646: some index into messages + int16_t idx2; // 0x648: some index into messages int16_t field_0x64a; int16_t field_0x64c; undefined field_0x64e; From 11b5dd7d4f32e876c9eb9f507aeaf49dc02ec024 Mon Sep 17 00:00:00 2001 From: assidion Date: Sun, 28 Sep 2025 23:32:19 +0400 Subject: [PATCH 151/204] a --- headers/functions/overlay29.h | 2 +- headers/types/common/window.h | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index 48291a44..ab48820e 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -57,7 +57,7 @@ void PlayEffectAnimation0x171Full(struct entity* entity); void PlayEffectAnimation0x171(struct entity* entity); void PlayEffectAnimationEntityStandard(struct entity* entity, int effect_id); void ShowPpRestoreEffect(struct entity* entity); -void PlaySeIfShouldDisplayEntity(struct entity* entity, int se_id); +void PlaySeByIdIfShouldDisplayEntity(struct entity* entity, int se_id); bool ShouldDisplayEntityAdvanced(struct entity* entity); void PlayEffectAnimation0x1A9(struct entity* entity); void PlayEffectAnimation0x29(struct entity* entity); diff --git a/headers/types/common/window.h b/headers/types/common/window.h index d151a515..c21bf9f7 100644 --- a/headers/types/common/window.h +++ b/headers/types/common/window.h @@ -662,12 +662,12 @@ struct alert_box { undefined field_0x1; undefined field_0x2; undefined field_0x3; - int state; // 0x4: appears to be a state value - struct dialogue_display_ctx display_ctx; // 0x8 - struct alert_box_message messages[4]; // 0x124 - int16_t next_idx; // 0x644: Index to add next message at - int16_t idx1; // 0x646: some index into messages - int16_t idx2; // 0x648: some index into messages + int state; // 0x4: appears to be a state value + struct dialogue_display_ctx display_ctx; // 0x8 + struct alert_box_message messages[4]; // 0x124 + int16_t next_idx; // 0x644: Index to add next message at + int16_t idx1; // 0x646: some index into messages + int16_t idx2; // 0x648: some index into messages int16_t field_0x64a; int16_t field_0x64c; undefined field_0x64e; From 74f9c6c475f5d323c48b1166f25949fa760e2ab7 Mon Sep 17 00:00:00 2001 From: assidion Date: Sun, 28 Sep 2025 23:37:34 +0400 Subject: [PATCH 152/204] a --- headers/functions/overlay29.h | 4 ++-- symbols/arm9.yml | 6 ++---- symbols/overlay10.yml | 2 +- symbols/overlay29.yml | 38 +++++++++++++++++------------------ symbols/overlay31.yml | 12 +++++------ 5 files changed, 30 insertions(+), 32 deletions(-) diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index ab48820e..a4e37d49 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -140,8 +140,8 @@ bool IsDungeonEndReasonFailure(void); void SetForcedLossReason(enum forced_loss_reason forced_loss_reason); enum forced_loss_reason GetForcedLossReason(void); void BindTrapToTile(struct tile* tile, struct entity* trap, bool is_visible); -void SpawnTraps(void); 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); @@ -642,8 +642,8 @@ int GetAiUseItemProbability(struct entity* item_consumer, struct item* item, uin bool IsAdjacentToEnemy(struct entity* entity); bool ShouldTryEatItem(enum item_id item_id); int GetMaxPpWrapper(struct move* move); -void MakeFloorOneRoom(struct entity* user); bool MoveIsNotPhysical(enum move_id move_id); +void MakeFloorOneRoom(struct entity* user); bool CategoryIsNotPhysical(enum move_category category_id); void TryDrought(struct entity* user); void TryPounce(struct entity* user, struct entity* target, enum direction_id direction); diff --git a/symbols/arm9.yml b/symbols/arm9.yml index eb367019..a2f8d8a2 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -3987,9 +3987,7 @@ arm9: No params. - name: PlayMeById address: - EU: 0x2017E90 - NA: 0x2017DF4 - JP: 0x2017E4C + EU: 0x20182A8 description: |- Initializes some values and then calls SendAudioCommand to play a ME track. @@ -6954,7 +6952,7 @@ arm9: return: True if the menu option is enabled, false otherwise. - name: GetSelectedItemOnPage address: - EU: 0x203286C + EU: 0x203284C description: |- Gets the index on the page of the current item the user has selected. diff --git a/symbols/overlay10.yml b/symbols/overlay10.yml index 85b7779d..26118977 100644 --- a/symbols/overlay10.yml +++ b/symbols/overlay10.yml @@ -1417,7 +1417,7 @@ overlay10: description: Attack power for Iron Thorns. - name: BAD_WEATHER_DAMAGE address: - EU: 0x22c5044 + EU: 0x22C5044 length: EU: 0x2 description: Damage dealt by the Sandstorm and Hail weather conditions (3). diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index f2af206f..eafbdd6c 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -855,7 +855,7 @@ overlay29: EU: 0x22E843C description: |- Gets the id of the trap to be used as the effect of a Random Trap. - + return: trap id - name: GetItemIdToSpawn address: @@ -1607,13 +1607,6 @@ overlay29: r0: tile pointer r1: entity pointer r2: visibility flag - - name: SpawnTraps - address: - EU: 0x22EE238 - description: |- - Spawns a new dungeon floor's traps. - - No params. - name: AreLateGameTrapsEnabledWrapper address: EU: 0x22EE218 @@ -1623,6 +1616,13 @@ overlay29: A wrapper around AreLateGameTrapsEnabled that passes the fixed room for the floor. return: bool + - name: SpawnTraps + address: + EU: 0x22EE238 + description: |- + Spawns a new dungeon floor's traps. + + No params. - name: SpawnEnemyTrapAtPos address: EU: 0x22EE320 @@ -3229,7 +3229,7 @@ overlay29: return: bool - name: CheckVariousStatuses2 address: - EU: + EU: - 0x2301244 - 0x2301308 NA: 0x2300818 @@ -3244,7 +3244,7 @@ overlay29: return: bool - name: CheckVariousConditions address: - EU: + EU: - 0x230156C - 0x2301624 NA: 0x2300B40 @@ -3258,7 +3258,7 @@ overlay29: return: bool - name: CheckVariousStatuses address: - EU: + EU: - 0x23016DC - 0x230172C NA: 0x2300CB0 @@ -6342,13 +6342,6 @@ overlay29: r0: move pointer return: max PP for the given move, capped at 99 - - name: MakeFloorOneRoom - address: - EU: 0x231F4A8 - description: |- - Removes all walls to make the floor one room. - - r0: user entity pointer - name: MoveIsNotPhysical address: EU: 0x231F480 @@ -6359,6 +6352,13 @@ overlay29: r0: move ID return: bool + - name: MakeFloorOneRoom + address: + EU: 0x231F4A8 + description: |- + Removes all walls to make the floor one room. + + r0: user entity pointer - name: CategoryIsNotPhysical address: EU: 0x231F498 @@ -9154,7 +9154,7 @@ overlay29: EU: 0x234BE94 description: |- Calls WaitUntilAlertBoxTextIsLoaded with r0 = 0x50. - + No params. - name: LogMessageByIdWithPopupCheckUser address: diff --git a/symbols/overlay31.yml b/symbols/overlay31.yml index 868616e8..24379164 100644 --- a/symbols/overlay31.yml +++ b/symbols/overlay31.yml @@ -76,14 +76,14 @@ overlay31: EU: 0x2383E8C description: |- Closes the main stairs menu. Used both when closing it entirely as well as when switching to the info menu. - + No params. - name: FreeStairsMenuState address: EU: 0x2383E8C description: |- Closes the main stairs menu and frees the heap-allocated stairs_menu struct pointed to by STAIRS_MENU_PTR. - + No params. - name: EntityIsValidOverlay31 address: @@ -312,7 +312,7 @@ overlay31: EU: 0x20 NA: 0x20 JP: 0x20 - description: "List of 4 simple_menu_id_items for the normal stairs menu." + description: List of 4 simple_menu_id_items for the normal stairs menu. - name: STAIRS_MENU_ITEMS_WARP_ZONE address: EU: 0x238AAB4 @@ -322,7 +322,7 @@ overlay31: EU: 0x20 NA: 0x20 JP: 0x20 - description: "List of 4 simple_menu_id_items for the Warp Zone stairs menu." + description: List of 4 simple_menu_id_items for the Warp Zone stairs menu. - name: STAIRS_MENU_ITEMS_RESCUE_POINT address: EU: 0x238AAD4 @@ -332,7 +332,7 @@ overlay31: EU: 0x20 NA: 0x20 JP: 0x20 - description: "List of 4 simple_menu_id_items for the Rescue Point stairs menu." + description: List of 4 simple_menu_id_items for the Rescue Point stairs menu. - name: STAIRS_MENU_ITEMS_HIDDEN_STAIRS address: EU: 0x238AAF4 @@ -342,7 +342,7 @@ overlay31: EU: 0x20 NA: 0x20 JP: 0x20 - description: "List of 4 simple_menu_id_items for the hidden stairs menu." + description: List of 4 simple_menu_id_items for the hidden stairs menu. - name: OVERLAY31_UNKNOWN_STRUCT__NA_2389EF0 address: EU: 0x238AB14 From 44faf654f0ae1e20351484e474680e8da07715df Mon Sep 17 00:00:00 2001 From: assidion Date: Sun, 28 Sep 2025 23:38:29 +0400 Subject: [PATCH 153/204] a --- symbols/overlay31.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay31.yml b/symbols/overlay31.yml index 24379164..5fe1c12b 100644 --- a/symbols/overlay31.yml +++ b/symbols/overlay31.yml @@ -80,7 +80,7 @@ overlay31: No params. - name: FreeStairsMenuState address: - EU: 0x2383E8C + EU: 0x2383EF0 description: |- Closes the main stairs menu and frees the heap-allocated stairs_menu struct pointed to by STAIRS_MENU_PTR. From f4217dcc3715490b0c461da31a22d1eda574a608 Mon Sep 17 00:00:00 2001 From: assidion Date: Sun, 28 Sep 2025 23:45:41 +0400 Subject: [PATCH 154/204] a --- headers/functions/overlay29.h | 4 ++-- symbols/arm9.yml | 2 -- symbols/overlay29.yml | 14 +++++++------- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index a4e37d49..be715376 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -457,7 +457,7 @@ void TryInflictNightmareStatus(struct entity* user, struct entity* target, int t 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, +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); @@ -643,8 +643,8 @@ bool IsAdjacentToEnemy(struct entity* entity); bool ShouldTryEatItem(enum item_id item_id); int GetMaxPpWrapper(struct move* move); bool MoveIsNotPhysical(enum move_id move_id); -void MakeFloorOneRoom(struct entity* user); bool CategoryIsNotPhysical(enum move_category category_id); +void MakeFloorOneRoom(struct entity* user); void TryDrought(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); diff --git a/symbols/arm9.yml b/symbols/arm9.yml index a2f8d8a2..9ecc5049 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -6961,8 +6961,6 @@ arm9: - name: GetCurrentPage address: EU: 0x2032854 - NA: 0x2032568 - JP: 0x2032888 description: |- Gets the index of the current menu page the user is on. diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index eafbdd6c..ecc16935 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -6352,13 +6352,6 @@ overlay29: r0: move ID return: bool - - name: MakeFloorOneRoom - address: - EU: 0x231F4A8 - description: |- - Removes all walls to make the floor one room. - - r0: user entity pointer - name: CategoryIsNotPhysical address: EU: 0x231F498 @@ -6369,6 +6362,13 @@ overlay29: r0: move category ID return: bool + - name: MakeFloorOneRoom + address: + EU: 0x231F4A8 + description: |- + Removes all walls to make the floor one room. + + r0: user entity pointer - name: TryDrought address: EU: 0x231FFFC From 142e54920504b850dbcc5366d744fdbae5d140e6 Mon Sep 17 00:00:00 2001 From: assidion Date: Sun, 28 Sep 2025 23:58:29 +0400 Subject: [PATCH 155/204] a --- headers/functions/overlay31.h | 2 +- symbols/overlay31.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/headers/functions/overlay31.h b/headers/functions/overlay31.h index 5d55fabc..18b1e3c0 100644 --- a/headers/functions/overlay31.h +++ b/headers/functions/overlay31.h @@ -7,7 +7,7 @@ void DungeonMenuSwitch(int idx); void CreateStairsMenuState(struct entity* entity); void StairsSubheadingCallback(int window_id); int HandleStairsMenu(void); -void CloseStairsMenu(void); +void CloseMainStairsMenu(void); void FreeStairsMenuState(void); bool EntityIsValidOverlay31(struct entity* entity); void MovesMenu(struct action_data* action); diff --git a/symbols/overlay31.yml b/symbols/overlay31.yml index 5fe1c12b..222916de 100644 --- a/symbols/overlay31.yml +++ b/symbols/overlay31.yml @@ -71,7 +71,7 @@ overlay31: Uses a switch statement based on the state field in stairs_menu to determine what actions to take. return: 4 if should close stairs menu entirely, 1 otherwise (including when switching between main/info menus) - - name: CloseStairsMenu + - name: CloseMainStairsMenu address: EU: 0x2383E8C description: |- From bb12f9d426b543130570582c1979864818c8160f Mon Sep 17 00:00:00 2001 From: assidion Date: Mon, 29 Sep 2025 18:54:54 +0400 Subject: [PATCH 156/204] a --- headers/types/common/window.h | 2 +- headers/types/dungeon_mode/dungeon_mode.h | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/headers/types/common/window.h b/headers/types/common/window.h index c21bf9f7..93b040a1 100644 --- a/headers/types/common/window.h +++ b/headers/types/common/window.h @@ -1096,7 +1096,7 @@ struct stairs_menu { uint8_t main_menu_window_id; // 0x1: window id for the main menu for selecting the action uint8_t info_window_id; // 0x2: window id for the "Info" menu undefined field_0x3; - int main_menu_result; // 0x4: Store the result of the main menu for selecting the action + int main_menu_result; // 0x4: Stores the result of the main menu for selecting the action struct entity* entity; // 0x8: Seems to always point to the leader? // 0xC: Used for switching in HandleStairsMenu. // Seems to be 0 when opening the main stairs menu, 1 when the main stairs menu is open, diff --git a/headers/types/dungeon_mode/dungeon_mode.h b/headers/types/dungeon_mode/dungeon_mode.h index 4a634701..f04a078c 100644 --- a/headers/types/dungeon_mode/dungeon_mode.h +++ b/headers/types/dungeon_mode/dungeon_mode.h @@ -2529,14 +2529,18 @@ struct alert_box_info { undefined field_0xc8a; undefined field_0xc8b; short alert_box_current_idx; // 0xC8C: Index of current message in alert_box_messages - short field_0xc8e; // Also some sort of index into alert_box_messages - undefined2 field_0xc90; + // 0xC8E: Index of current fully loaded message in alert_box_messages + // (i.e. for which the scrolling is finished) + short alert_box_current_loaded_idx; + short frames_until_close; // 0xC90 undefined2 field_0xc92; undefined field_0xc94; undefined field_0xc95; undefined field_0xc96; undefined field_0xc97; - undefined4 field_0xc98; + // 0xC98: 0 means nothing is being loaded, 1 means a message is about to start loading, + // 2 means a message is currently loading/scrolling. + int loading_status; struct preprocessor_args preprocessor_args; uint8_t alert_box_window_id; // 0xCEC undefined field_0xced; From 3d6b559e0df1bbf022e2ff29fe5647acb99bc122 Mon Sep 17 00:00:00 2001 From: assidion Date: Sun, 5 Oct 2025 23:14:11 +0400 Subject: [PATCH 157/204] a --- headers/functions/arm9.h | 2 ++ headers/functions/overlay29.h | 1 + symbols/overlay29.yml | 2 +- symbols/overlay31.yml | 8 ++++++++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 5b3a4281..f53756bb 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -746,6 +746,8 @@ 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, diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index be715376..8efbe0fb 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -112,6 +112,7 @@ int CalcStatusDuration(struct entity* entity, int16_t* turn_range, bool iq_skill void DungeonRngUnsetSecondary(void); void DungeonRngSetSecondary(int i); void DungeonRngSetPrimary(void); +void PlaySeByIdIfNotSilence(int se_id); enum music_id MusicTableIdxToMusicId(int music_table_idx); void ChangeDungeonMusic(enum music_id music_id); void TrySwitchPlace(struct entity* user, struct entity* target); diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index ecc16935..9a8f56ec 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -780,7 +780,6 @@ overlay29: r0: entity pointer r1: Sound effect ID - return: bool - name: ShouldDisplayEntityAdvanced address: EU: 0x22E6880 @@ -1728,6 +1727,7 @@ overlay29: description: |- Used in SubstitutePlaceholderStringTags. Substitutes a [trap:r1] tag in a message log message for the name of a trap. + r0: preprocessor_args pointer (in practice, always the global struct used for the message log) r1: tag id r2: trap id - name: TryTriggerTrap diff --git a/symbols/overlay31.yml b/symbols/overlay31.yml index 222916de..41faf47f 100644 --- a/symbols/overlay31.yml +++ b/symbols/overlay31.yml @@ -304,6 +304,8 @@ overlay31: JP: 0x10 description: "Note: unverified, ported from Irdkwia's notes" - name: STAIRS_MENU_ITEMS_NORMAL + aliases: + - DUNGEON_SUBMENU_ITEMS_1 address: EU: 0x238AA94 NA: 0x2389E70 @@ -314,6 +316,8 @@ overlay31: JP: 0x20 description: List of 4 simple_menu_id_items for the normal stairs menu. - name: STAIRS_MENU_ITEMS_WARP_ZONE + aliases: + - DUNGEON_SUBMENU_ITEMS_2 address: EU: 0x238AAB4 NA: 0x2389E90 @@ -324,6 +328,8 @@ overlay31: JP: 0x20 description: List of 4 simple_menu_id_items for the Warp Zone stairs menu. - name: STAIRS_MENU_ITEMS_RESCUE_POINT + aliases: + - DUNGEON_SUBMENU_ITEMS_3 address: EU: 0x238AAD4 NA: 0x2389EB0 @@ -334,6 +340,8 @@ overlay31: JP: 0x20 description: List of 4 simple_menu_id_items for the Rescue Point stairs menu. - name: STAIRS_MENU_ITEMS_HIDDEN_STAIRS + aliases: + - DUNGEON_SUBMENU_ITEMS_4 address: EU: 0x238AAF4 NA: 0x2389ED0 From 664d16df800678ce85af4ccd37bd64af0a79e8e2 Mon Sep 17 00:00:00 2001 From: assidion Date: Fri, 10 Oct 2025 15:16:38 +0400 Subject: [PATCH 158/204] a --- headers/functions/overlay31.h | 8 +++++--- symbols/overlay31.yml | 28 +++++++++++++++++++++++----- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/headers/functions/overlay31.h b/headers/functions/overlay31.h index 18b1e3c0..908974ff 100644 --- a/headers/functions/overlay31.h +++ b/headers/functions/overlay31.h @@ -1,14 +1,16 @@ #ifndef HEADERS_FUNCTIONS_OVERLAY31_H_ #define HEADERS_FUNCTIONS_OVERLAY31_H_ -void EntryOverlay31(void); +void InitDungeonMenu(void); void DrawDungeonMenuStatusWindow(int param_1); void DungeonMenuSwitch(int idx); -void CreateStairsMenuState(struct entity* entity); +int HandleDungeonMenu(void); +void FreeDungeonMenu(void); +void InitStairsMenu(struct entity* entity); void StairsSubheadingCallback(int window_id); int HandleStairsMenu(void); void CloseMainStairsMenu(void); -void FreeStairsMenuState(void); +void FreeStairsMenu(void); bool EntityIsValidOverlay31(struct entity* entity); void MovesMenu(struct action_data* action); bool HandleMovesMenuWrapper0(undefined* param_1, undefined param_2, undefined param_3, diff --git a/symbols/overlay31.yml b/symbols/overlay31.yml index 41faf47f..fd179ac5 100644 --- a/symbols/overlay31.yml +++ b/symbols/overlay31.yml @@ -13,13 +13,13 @@ overlay31: JP: 0x7AC0 description: Controls the dungeon menu (during dungeon mode). functions: - - name: EntryOverlay31 + - name: InitDungeonMenu address: EU: 0x2383420 NA: 0x2382820 JP: 0x2383AA0 description: |- - Note: unverified, ported from Irdkwia's notes + Initializes the main dungeon menu and allocates a struct on the heap with information for HandleDungeonMenu No params. - name: DrawDungeonMenuStatusWindow @@ -40,7 +40,25 @@ overlay31: Note: unverified, ported from Irdkwia's notes r0: appears to be an index of some sort, probably the menu index based on the function name? - - name: CreateStairsMenuState + - name: HandleDungeonMenu + address: + EU: 0x2383754 + description: |- + Handles displaying the main dungeon menu and is called on each frame while it is open. + + Uses a switch statement based on a state field of the struct allocated in InitDungeonMenu to determine what actions to take. + + return: 4 if should close main dungeon menu (including when switching menus), 1 otherwise + - name: FreeDungeonMenu + address: + EU: 0x23839AC + description: |- + Closes the main dungeon menu and frees the heap-allocated struct initialized in InitDungeonMenu. + + No params. + - name: InitStairsMenu + aliases: + - CreateStairsMenuState address: EU: 0x2383AD4 NA: 0x2382ED4 @@ -48,7 +66,7 @@ overlay31: description: |- Called when the leader steps on any stairs tile (regular, warp zone, rescue point, hidden stairs). - Allocates a stairs_menu struct on the heap with information for HandleStairsMenu, which will be pointed to by STAIRS_MENU_PTR. + Initializes the stairs menu and allocates a stairs_menu struct on the heap with information for HandleStairsMenu, which will be pointed to by STAIRS_MENU_PTR. r0: Entity pointer (in practice, always the leader) - name: StairsSubheadingCallback @@ -78,7 +96,7 @@ overlay31: Closes the main stairs menu. Used both when closing it entirely as well as when switching to the info menu. No params. - - name: FreeStairsMenuState + - name: FreeStairsMenu address: EU: 0x2383EF0 description: |- From 813f1684fb26370914a29b80323790f011a8ba1e Mon Sep 17 00:00:00 2001 From: assidion Date: Fri, 10 Oct 2025 20:29:42 +0400 Subject: [PATCH 159/204] a --- symbols/overlay31.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay31.yml b/symbols/overlay31.yml index fd179ac5..d2cc5f41 100644 --- a/symbols/overlay31.yml +++ b/symbols/overlay31.yml @@ -19,7 +19,7 @@ overlay31: NA: 0x2382820 JP: 0x2383AA0 description: |- - Initializes the main dungeon menu and allocates a struct on the heap with information for HandleDungeonMenu + Initializes the main dungeon menu and allocates a struct on the heap with information for HandleDungeonMenu. No params. - name: DrawDungeonMenuStatusWindow From 95eb28393206ae9d5d735dedf57e4f5c91031dcc Mon Sep 17 00:00:00 2001 From: assidion Date: Sat, 11 Oct 2025 19:27:20 +0400 Subject: [PATCH 160/204] a --- headers/data/arm9.h | 2 ++ headers/functions/arm9.h | 5 +++ headers/functions/overlay29.h | 3 ++ headers/functions/overlay31.h | 8 +++-- headers/types/common/common.h | 19 +++++++++++ symbols/arm9.yml | 59 +++++++++++++++++++++++++++++++++++ symbols/overlay29.yml | 22 +++++++++++++ symbols/overlay31.yml | 23 ++++++++++++-- 8 files changed, 136 insertions(+), 5 deletions(-) diff --git a/headers/data/arm9.h b/headers/data/arm9.h index bb025506..3703c06d 100644 --- a/headers/data/arm9.h +++ b/headers/data/arm9.h @@ -64,6 +64,7 @@ extern struct partner_talk_kind_table_entry PARTNER_TALK_KIND_TABLE[11]; extern struct script_local_var_table SCRIPT_VARS_LOCALS; extern struct script_var_table SCRIPT_VARS; extern struct portrait_layout PORTRAIT_LAYOUTS[32]; +extern struct overlay_load_entry NULL_OVERLAY_LOAD_ENTRY; extern char KAOMADO_FILEPATH[20]; extern uint8_t WONDER_MAIL_BITS_MAP[32]; extern uint8_t WONDER_MAIL_BITS_SWAP[36]; @@ -180,6 +181,7 @@ extern struct wan_table* WAN_TABLE; extern struct render_3d_global RENDER_3D; 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 bool NOTIFY_NOTE; extern struct monster_id_16 DEFAULT_HERO_ID; diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index f53756bb..f844a7b6 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -590,6 +590,7 @@ void SetParentMenuState7(int window_id); void CloseParentMenu(int window_id); 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, @@ -754,6 +755,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); +bool OverlayLoadEntriesEqual(struct overlay_load_entry* entry1, struct overlay_load_entry* entry2); +void FreeMenu(void); +bool InitMenu(struct overlay_load_entry* entry); +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 GetKeyboardStatus(void); diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index 8efbe0fb..13327285 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -116,6 +116,7 @@ void PlaySeByIdIfNotSilence(int se_id); enum music_id MusicTableIdxToMusicId(int music_table_idx); void ChangeDungeonMusic(enum music_id music_id); 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); @@ -178,6 +179,7 @@ bool DebugRecruitingEnabled(void); void TryActivateIqBooster(void); bool IsSecretBazaarNpcBehavior(enum monster_behavior behavior); struct action_16* GetLeaderAction(void); +enum action_id GetLeaderActionId(void); void GetEntityTouchscreenArea(struct entity* entity, struct touchscreen_area* area); void SetLeaderAction(void); bool ShouldLeaderKeepRunning(void); @@ -971,6 +973,7 @@ bool YesNoMenu(undefined param_1, int string_id, int default_option, undefined p void DisplayMessageInternal(int message_id, bool wait_for_input, struct portrait_params* portrait, undefined4 param_4, undefined4 param_5, undefined4 param_6); 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); diff --git a/headers/functions/overlay31.h b/headers/functions/overlay31.h index 908974ff..8fff2654 100644 --- a/headers/functions/overlay31.h +++ b/headers/functions/overlay31.h @@ -4,14 +4,16 @@ void InitDungeonMenu(void); void DrawDungeonMenuStatusWindow(int param_1); void DungeonMenuSwitch(int idx); -int HandleDungeonMenu(void); +int DungeonMenuLoop(void); void FreeDungeonMenu(void); -void InitStairsMenu(struct entity* entity); +void StairsMenu(struct entity* leader, bool leave_minimap_closed_after); +void InitStairsMenu(struct entity* leader); void StairsSubheadingCallback(int window_id); -int HandleStairsMenu(void); +int StairsMenuLoop(void); void CloseMainStairsMenu(void); void FreeStairsMenu(void); bool EntityIsValidOverlay31(struct entity* entity); +bool ItemsMenu(struct entity* leader, undefined* param_2); void MovesMenu(struct action_data* action); bool HandleMovesMenuWrapper0(undefined* param_1, undefined param_2, undefined param_3, int monster_index); diff --git a/headers/types/common/common.h b/headers/types/common/common.h index bdf9343d..43010d24 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -1363,4 +1363,23 @@ struct monster_file_contents { }; ASSERT_SIZE(struct monster_file_contents, 78548); +// Master struct for controlling the game's menus. +struct menu_control { + undefined fields_0x0[16]; + // 0x10: Whether to load a new menu on the next call of HandleMenus + bool load_new_menu; + undefined fields_0x11[3]; + // 0x14: The incoming entry which is set in InitMenu. + // When loading a new menu, it is copied to active_entry and then zeroed out. + struct overlay_load_entry incoming_entry; + undefined fields_0x24[160]; + struct overlay_load_entry active_entry; // 0xC4: The entry for the currently active menu + // 0xD4: 0 means no menu active, 1 means menu initializing, 2 means menu active, 3 means ??? + int state; + // 0xD8: Whether the overlay in active_entry should be unloaded upon calling FreeMenu + bool should_unload_overlay_on_free; + undefined fields_0xd9[3]; +}; +ASSERT_SIZE(struct menu_control, 220); + #endif diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 9ecc5049..5c9483b6 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -5676,6 +5676,14 @@ arm9: r0: window_id return: bool + - name: GetWindowIdSelectedItemOnPage + address: + EU: 0x202AE74 + description: |- + Gets the index on the page of the current item the user has selected on the menu given by the window_id. + + r0: window id + return: index of current selected item on the page - name: GetSimpleMenuResult address: EU: @@ -7054,6 +7062,39 @@ arm9: stack[0]: total number of selectable items stack[1]: number of selectable items per page stack[2]: ? + - name: OverlayLoadEntriesEqual + address: + EU: 0x2034A94 + description: |- + Checks if two overlay_load_entries have the same values for all of their fields. + + r0: overlay_load_entry pointer + r1: overlay_load_entry pointer + return: bool + - name: FreeMenu + address: + EU: 0x2034AE4 + description: |- + Frees the currently active menu by calling the destructor function of the active entry in menu_control. + + No params. + - name: InitMenu + address: + EU: 0x2034BD8 + description: |- + Initializes a menu by setting the incoming_entry field of menu_control to the given overlay_load_entry. + + r0: overlay_load_entry pointer + return: whether the menu was successfully initialized + - name: HandleMenus + address: + EU: 0x2034D74 + description: |- + Master function called on every frame for handling the game's menus. + + This includes updating them, freeing them, and entering and exiting their respective overlays if applicable. + + No params. - name: SetupAndShowKeyboard address: EU: 0x2036AA8 @@ -11713,6 +11754,15 @@ arm9: All the possible layouts a portrait can be placed in by default. type: struct portrait_layout[32] + - name: NULL_OVERLAY_LOAD_ENTRY + address: + EU: 0x209B5C8 + length: + EU: 0x10 + description: |- + An overlay_load_entry whose values are all zeroes. + + type: overlay_load_entry - name: KAOMADO_FILEPATH address: EU: 0x209E658 @@ -13314,6 +13364,15 @@ arm9: Note: unverified, ported from Irdkwia's notes type: int16_t[6] + - name: MENU_CONTROL_PTR + address: + EU: 0x20B06B4 + length: + EU: 0x4 + description: |- + Pointer to the master struct used for handling menus. + + type: menu_control* - name: KEYBOARD_STRING_IDS address: EU: 0x20B0718 diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 9a8f56ec..f8a3912d 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -1368,6 +1368,13 @@ overlay29: r0: pointer to user entity r1: pointer to target entity + - name: ResetLeaderActionFields + address: + EU: 0x22EBD48 + description: |- + Resets the leader monster's action_id fields to 0. + + r0: whether to also set the action_use_idx fields of the action_parameters structs and the arc_item_target_pos fields to 0 - name: SetLeaderActionFields address: EU: 0x22EBD78 @@ -1956,6 +1963,13 @@ overlay29: Returns a pointer to the action data of the current leader (field 0x4A on its monster struct). No params. + - name: GetLeaderActionId + address: + EU: 0x22F1550 + description: |- + Gets the current action id of the leader monster's action data. + + return: action_id - name: GetEntityTouchscreenArea address: EU: 0x22F1560 @@ -9482,6 +9496,14 @@ overlay29: r0: (?) Unused by the function. Seems to be 1 byte long. r1: (?) Unused by the function. Seems to be 1 byte long. r2: True to open the bag menu, false to open the main dungeon menu + - name: StairsMenuAfterStep + address: + EU: 0x234F504 + description: |- + Opens the stairs menu after stepping on a stairs tile. + + r0: Entity pointer (in practice, always the leader) + r1: whether to not open minimap upon menu close - name: DungeonModeSetupAndShowNameKeyboard address: EU: 0x234FC14 diff --git a/symbols/overlay31.yml b/symbols/overlay31.yml index d2cc5f41..22dca3af 100644 --- a/symbols/overlay31.yml +++ b/symbols/overlay31.yml @@ -40,7 +40,7 @@ overlay31: Note: unverified, ported from Irdkwia's notes r0: appears to be an index of some sort, probably the menu index based on the function name? - - name: HandleDungeonMenu + - name: DungeonMenuLoop address: EU: 0x2383754 description: |- @@ -56,6 +56,14 @@ overlay31: Closes the main dungeon menu and frees the heap-allocated struct initialized in InitDungeonMenu. No params. + - name: StairsMenu + address: + EU: 0x23839AC + description: |- + Called when the stairs menu is open. Does not return until the menu is closed. + + r0: Entity pointer (in practice, always the leader) + r1: whether to not open minimap upon menu close - name: InitStairsMenu aliases: - CreateStairsMenuState @@ -78,7 +86,9 @@ overlay31: Callback function passed to CreateAdvancedTextBox for creating the subheading for the stairs menu. r0: window_id - - name: HandleStairsMenu + - name: StairsMenuLoop + aliases: + - CreateStairsMenuState address: EU: 0x2383BBC NA: 0x2382FBC @@ -112,6 +122,15 @@ overlay31: JP: - 0x23848D8 description: "See overlay29.yml::EntityIsValid" + - name: ItemsMenu + address: + EU: 0x23844E4 + description: |- + Called when the in-dungeon "items" menu is open. Does not return until the menu is closed. + + r0: Pointer to the leader's entity struct + r1: ? + return: ? - name: MovesMenu address: EU: 0x2385DC0 From a645c66f6379b5d32d4faff9687813a6aa0590a9 Mon Sep 17 00:00:00 2001 From: assidion Date: Sat, 11 Oct 2025 19:30:34 +0400 Subject: [PATCH 161/204] a --- headers/data/arm9.h | 2 +- symbols/arm9.yml | 18 +++++++++--------- symbols/overlay31.yml | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/headers/data/arm9.h b/headers/data/arm9.h index 3703c06d..d2ad31af 100644 --- a/headers/data/arm9.h +++ b/headers/data/arm9.h @@ -60,11 +60,11 @@ extern struct window_params CONTROLS_CHART_DEFAULT_WINDOW_PARAMS; extern struct window_params ALERT_BOX_DEFAULT_WINDOW_PARAMS; extern struct window_params ADVANCED_TEXT_BOX_DEFAULT_WINDOW_PARAMS; extern struct window_params TEAM_SELECTION_MENU_DEFAULT_WINDOW_PARAMS; +extern struct overlay_load_entry NULL_OVERLAY_LOAD_ENTRY; extern struct partner_talk_kind_table_entry PARTNER_TALK_KIND_TABLE[11]; extern struct script_local_var_table SCRIPT_VARS_LOCALS; extern struct script_var_table SCRIPT_VARS; extern struct portrait_layout PORTRAIT_LAYOUTS[32]; -extern struct overlay_load_entry NULL_OVERLAY_LOAD_ENTRY; extern char KAOMADO_FILEPATH[20]; extern uint8_t WONDER_MAIL_BITS_MAP[32]; extern uint8_t WONDER_MAIL_BITS_SWAP[36]; diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 5c9483b6..cd2de8cf 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -11698,6 +11698,15 @@ arm9: Note that x_offset and y_offset refer to the right and bottom edges, since they will be paired with the x_offset_end and y_offset_end window flags in CreateTeamSelectionMenu. Additionally, width and height are 0, and will be computed in CreateTeamSelectionMenu. + - name: NULL_OVERLAY_LOAD_ENTRY + address: + EU: 0x209B5C8 + length: + EU: 0x10 + description: |- + An overlay_load_entry whose values are all zeroes. + + type: overlay_load_entry - name: PARTNER_TALK_KIND_TABLE address: EU: 0x209D268 @@ -11754,15 +11763,6 @@ arm9: All the possible layouts a portrait can be placed in by default. type: struct portrait_layout[32] - - name: NULL_OVERLAY_LOAD_ENTRY - address: - EU: 0x209B5C8 - length: - EU: 0x10 - description: |- - An overlay_load_entry whose values are all zeroes. - - type: overlay_load_entry - name: KAOMADO_FILEPATH address: EU: 0x209E658 diff --git a/symbols/overlay31.yml b/symbols/overlay31.yml index 22dca3af..60c018e7 100644 --- a/symbols/overlay31.yml +++ b/symbols/overlay31.yml @@ -58,7 +58,7 @@ overlay31: No params. - name: StairsMenu address: - EU: 0x23839AC + EU: 0x2383A18 description: |- Called when the stairs menu is open. Does not return until the menu is closed. From 128eaf2f51e9173d4b3da7093597c8b6624d131f Mon Sep 17 00:00:00 2001 From: assidion Date: Sat, 11 Oct 2025 19:50:48 +0400 Subject: [PATCH 162/204] a --- symbols/arm9.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index cd2de8cf..290d4ea9 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -7090,7 +7090,7 @@ arm9: address: EU: 0x2034D74 description: |- - Master function called on every frame for handling the game's menus. + Master function called on every frame for handling the game's menus (seemingly almost all with the exception of some in dungeon mode). This includes updating them, freeing them, and entering and exiting their respective overlays if applicable. From 99edfa785b94b9b2a04a20075d2c0f8e40a9d76a Mon Sep 17 00:00:00 2001 From: assidion Date: Sat, 11 Oct 2025 19:51:52 +0400 Subject: [PATCH 163/204] a --- symbols/arm9.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 290d4ea9..9bb749ef 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -7090,7 +7090,7 @@ arm9: address: EU: 0x2034D74 description: |- - Master function called on every frame for handling the game's menus (seemingly almost all with the exception of some in dungeon mode). + Master function called on every frame for handling the game's menus (seemingly the vast majority with the exception of some in dungeon mode). This includes updating them, freeing them, and entering and exiting their respective overlays if applicable. From 67e47f8b49c9af8fe708944423d52a748bbe9e24 Mon Sep 17 00:00:00 2001 From: assidion2 Date: Sat, 11 Oct 2025 21:13:28 +0400 Subject: [PATCH 164/204] Update overlay31.yml --- symbols/overlay31.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay31.yml b/symbols/overlay31.yml index 60c018e7..95c747f9 100644 --- a/symbols/overlay31.yml +++ b/symbols/overlay31.yml @@ -88,7 +88,7 @@ overlay31: r0: window_id - name: StairsMenuLoop aliases: - - CreateStairsMenuState + - HandleStairsMenu address: EU: 0x2383BBC NA: 0x2382FBC From c15677b2aeefb96235bcd079038c94222c2fdcde Mon Sep 17 00:00:00 2001 From: assidion2 Date: Sat, 11 Oct 2025 21:15:56 +0400 Subject: [PATCH 165/204] 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 9bb749ef..9108bb9c 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -7093,7 +7093,7 @@ arm9: Master function called on every frame for handling the game's menus (seemingly the vast majority with the exception of some in dungeon mode). This includes updating them, freeing them, and entering and exiting their respective overlays if applicable. - + No params. - name: SetupAndShowKeyboard address: From 2ea5258e9ca38433960d92fbecd5fc539d593c5f Mon Sep 17 00:00:00 2001 From: assidion2 Date: Sat, 11 Oct 2025 21:20:20 +0400 Subject: [PATCH 166/204] Update arm9.yml --- symbols/arm9.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 9108bb9c..7a4061a7 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -7067,7 +7067,7 @@ arm9: EU: 0x2034A94 description: |- Checks if two overlay_load_entries have the same values for all of their fields. - + r0: overlay_load_entry pointer r1: overlay_load_entry pointer return: bool @@ -7076,14 +7076,14 @@ arm9: EU: 0x2034AE4 description: |- Frees the currently active menu by calling the destructor function of the active entry in menu_control. - + No params. - name: InitMenu address: EU: 0x2034BD8 description: |- Initializes a menu by setting the incoming_entry field of menu_control to the given overlay_load_entry. - + r0: overlay_load_entry pointer return: whether the menu was successfully initialized - name: HandleMenus From a393514a1da41d5dad6ef3d59df5126afea799f6 Mon Sep 17 00:00:00 2001 From: assidion Date: Sun, 12 Oct 2025 01:04:10 +0400 Subject: [PATCH 167/204] a --- headers/functions/arm9.h | 3 +++ headers/types/common/common.h | 4 +++- symbols/arm9.yml | 18 ++++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index f844a7b6..dcf7c6ca 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -758,6 +758,9 @@ void InitInventoryMenuInput(struct inventory_menu_input_ctx* input_ctx, struct w bool OverlayLoadEntriesEqual(struct overlay_load_entry* entry1, struct overlay_load_entry* entry2); void FreeMenu(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); void HandleMenus(void); int SetupAndShowKeyboard(int menu_type, char* buffer1, char* buffer2); int ShowKeyboard(int menu_type, char* buffer1, int param_3, char* buffer2); diff --git a/headers/types/common/common.h b/headers/types/common/common.h index 43010d24..f70f03ee 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -1372,7 +1372,9 @@ struct menu_control { // 0x14: The incoming entry which is set in InitMenu. // When loading a new menu, it is copied to active_entry and then zeroed out. struct overlay_load_entry incoming_entry; - undefined fields_0x24[160]; + // 0x24: Whether there is a window_extra_info struct for CopyMenuControlWindowExtraInfo + int has_window_extra_info; + struct window_extra_info window_extra_info; struct overlay_load_entry active_entry; // 0xC4: The entry for the currently active menu // 0xD4: 0 means no menu active, 1 means menu initializing, 2 means menu active, 3 means ??? int state; diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 7a4061a7..df3e0148 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -7086,6 +7086,24 @@ arm9: r0: overlay_load_entry pointer return: whether the menu was successfully initialized + - name: InitMenuWithWindowExtraInfo + address: + EU: 0x2034BD8 + description: |- + Has the same functionality as InitMenu except also tries to initialize menu_control's window_extra_info struct. + + r0: overlay_load_entry pointer + r1: whether there is a window_extra_info struct + r2: window_extra_info pointer + return: whether the menu was successfully initialized + - name: CopyMenuControlWindowExtraInfo + address: + EU: 0x2034D2C + description: |- + Copies menu_control's window_extra_info to the given address. + + r0: [output] window_extra_info pointer + return: whether the window extra info was successfully copied - name: HandleMenus address: EU: 0x2034D74 From 7a73dcbe56ffe5fe5aba026739c2201858e20edf Mon Sep 17 00:00:00 2001 From: assidion Date: Sun, 12 Oct 2025 01:28:04 +0400 Subject: [PATCH 168/204] a --- headers/types/common/common.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index f70f03ee..278b5a58 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -1374,7 +1374,8 @@ struct menu_control { struct overlay_load_entry incoming_entry; // 0x24: Whether there is a window_extra_info struct for CopyMenuControlWindowExtraInfo int has_window_extra_info; - struct window_extra_info window_extra_info; + struct window_extra_info window_extra_info; // 0x28 + undefined4 fields_0xc0[4]; struct overlay_load_entry active_entry; // 0xC4: The entry for the currently active menu // 0xD4: 0 means no menu active, 1 means menu initializing, 2 means menu active, 3 means ??? int state; From 69b0d2fedeb83bcf3c8411c42b6cae9ef1f6c123 Mon Sep 17 00:00:00 2001 From: assidion Date: Sun, 12 Oct 2025 01:28:47 +0400 Subject: [PATCH 169/204] a --- symbols/arm9.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index df3e0148..b08fb059 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -7088,7 +7088,7 @@ arm9: return: whether the menu was successfully initialized - name: InitMenuWithWindowExtraInfo address: - EU: 0x2034BD8 + EU: 0x2034C68 description: |- Has the same functionality as InitMenu except also tries to initialize menu_control's window_extra_info struct. From 6766bd6de7faa0b13e16c8274cef015a3b85a4b8 Mon Sep 17 00:00:00 2001 From: assidion Date: Sun, 12 Oct 2025 01:32:35 +0400 Subject: [PATCH 170/204] a --- 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 278b5a58..35b30025 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -1375,7 +1375,7 @@ struct menu_control { // 0x24: Whether there is a window_extra_info struct for CopyMenuControlWindowExtraInfo int has_window_extra_info; struct window_extra_info window_extra_info; // 0x28 - undefined4 fields_0xc0[4]; + undefined fields_0xc0[4]; struct overlay_load_entry active_entry; // 0xC4: The entry for the currently active menu // 0xD4: 0 means no menu active, 1 means menu initializing, 2 means menu active, 3 means ??? int state; From 914aa72ad21f1c85317b5bc87ebbaf9584006040 Mon Sep 17 00:00:00 2001 From: assidion2 Date: Sun, 12 Oct 2025 13:43:10 +0400 Subject: [PATCH 171/204] Update symbols/arm9.yml Co-authored-by: UsernameFodder <93669634+UsernameFodder@users.noreply.github.com> --- symbols/arm9.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index b08fb059..5f12512b 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -6657,7 +6657,7 @@ arm9: r2: message string pointer r3: preprocessor_args struct pointer stack[0]: whether the message is the start of a new group (meaning it should be preceded by a horizontal line) - return: whether the message was sucessfully added + return: whether the message was successfully added - name: IsAlertBoxActive address: EU: 0x20304E8 From ae60e38eb82cd3c7452d5940b7af51cd19c3fd36 Mon Sep 17 00:00:00 2001 From: assidion2 Date: Sun, 12 Oct 2025 13:43:28 +0400 Subject: [PATCH 172/204] Update symbols/arm9.yml Co-authored-by: UsernameFodder <93669634+UsernameFodder@users.noreply.github.com> --- symbols/arm9.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 5f12512b..0ad11ef3 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -3989,7 +3989,7 @@ arm9: address: EU: 0x20182A8 description: |- - Initializes some values and then calls SendAudioCommand to play a ME track. + Initializes some values and then calls SendAudioCommand to play a ME track (musical sound effect). Checks for DEBUG_FLAG_BGM_OFF. The volume is set to either 0 or 255 depending on the flag before calling SendAudioCommand. From 4c90458e9baf9b75ef5977d1da9e4f3aa687adb7 Mon Sep 17 00:00:00 2001 From: assidion Date: Sun, 12 Oct 2025 13:55:52 +0400 Subject: [PATCH 173/204] a --- headers/functions/arm9.h | 2 +- headers/types/common/common.h | 16 ++++++++++++---- symbols/arm9.yml | 2 +- symbols/overlay31.yml | 2 ++ 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index dcf7c6ca..d30c0149 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -756,7 +756,7 @@ void InitInventoryMenuInput(struct inventory_menu_input_ctx* input_ctx, struct w struct window_rectangle* rect, int n_items, int n_items_per_page, undefined param_7); bool OverlayLoadEntriesEqual(struct overlay_load_entry* entry1, struct overlay_load_entry* entry2); -void FreeMenu(void); +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); diff --git a/headers/types/common/common.h b/headers/types/common/common.h index 35b30025..794330d0 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -1365,23 +1365,31 @@ ASSERT_SIZE(struct monster_file_contents, 78548); // Master struct for controlling the game's menus. struct menu_control { - undefined fields_0x0[16]; + // 0x0: An overlay_load_entry with all zeroes. Doesn't seem to be used for anything. + struct overlay_load_entry null_entry; // 0x10: Whether to load a new menu on the next call of HandleMenus bool load_new_menu; - undefined fields_0x11[3]; + undefined field_0x11; + undefined field_0x12; + undefined field_0x13; // 0x14: The incoming entry which is set in InitMenu. // When loading a new menu, it is copied to active_entry and then zeroed out. struct overlay_load_entry incoming_entry; // 0x24: Whether there is a window_extra_info struct for CopyMenuControlWindowExtraInfo int has_window_extra_info; struct window_extra_info window_extra_info; // 0x28 - undefined fields_0xc0[4]; + undefined field_0xc0; + undefined field_0xc1; + undefined field_0xc2; + undefined field_0xc3; struct overlay_load_entry active_entry; // 0xC4: The entry for the currently active menu // 0xD4: 0 means no menu active, 1 means menu initializing, 2 means menu active, 3 means ??? int state; // 0xD8: Whether the overlay in active_entry should be unloaded upon calling FreeMenu bool should_unload_overlay_on_free; - undefined fields_0xd9[3]; + undefined field_0xd9; + undefined field_0xda; + undefined field_0xdb; }; ASSERT_SIZE(struct menu_control, 220); diff --git a/symbols/arm9.yml b/symbols/arm9.yml index b08fb059..38cd90dc 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -7071,7 +7071,7 @@ arm9: r0: overlay_load_entry pointer r1: overlay_load_entry pointer return: bool - - name: FreeMenu + - name: FreeActiveMenu address: EU: 0x2034AE4 description: |- diff --git a/symbols/overlay31.yml b/symbols/overlay31.yml index 95c747f9..de5ca9c9 100644 --- a/symbols/overlay31.yml +++ b/symbols/overlay31.yml @@ -14,6 +14,8 @@ overlay31: description: Controls the dungeon menu (during dungeon mode). functions: - name: InitDungeonMenu + aliases: + - EntryOverlay31 address: EU: 0x2383420 NA: 0x2382820 From 8e454bd2765ae71ffe66f95f643d5001b499f6e2 Mon Sep 17 00:00:00 2001 From: assidion Date: Sun, 12 Oct 2025 14:35:30 +0400 Subject: [PATCH 174/204] a --- symbols/arm9.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 957b738b..bebe3082 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -3990,6 +3990,8 @@ arm9: EU: 0x20182A8 description: |- Initializes some values and then calls SendAudioCommand to play a ME track (musical sound effect). + + For a list of tracks, see https://wiki.skytemple.org/index.php?title=List_of_Sound_Effects#ME Checks for DEBUG_FLAG_BGM_OFF. The volume is set to either 0 or 255 depending on the flag before calling SendAudioCommand. From bb2e25259abfc3b746840237b8cee2e1da754e53 Mon Sep 17 00:00:00 2001 From: assidion2 Date: Mon, 13 Oct 2025 11:01:19 +0400 Subject: [PATCH 175/204] 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 bebe3082..28d9cdc4 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -3990,7 +3990,7 @@ arm9: EU: 0x20182A8 description: |- Initializes some values and then calls SendAudioCommand to play a ME track (musical sound effect). - + For a list of tracks, see https://wiki.skytemple.org/index.php?title=List_of_Sound_Effects#ME Checks for DEBUG_FLAG_BGM_OFF. The volume is set to either 0 or 255 depending on the flag before calling SendAudioCommand. From cc899c7580198b6f0171e3131a554e4cc67c8750 Mon Sep 17 00:00:00 2001 From: assidion Date: Wed, 29 Oct 2025 20:23:32 +0400 Subject: [PATCH 176/204] . --- headers/data/overlay10.h | 2 ++ headers/functions/overlay29.h | 7 ++++--- symbols/overlay10.yml | 22 ++++++++++++++++++++++ symbols/overlay29.yml | 4 ++++ 4 files changed, 32 insertions(+), 3 deletions(-) diff --git a/headers/data/overlay10.h b/headers/data/overlay10.h index 839ffab5..d22a96df 100644 --- a/headers/data/overlay10.h +++ b/headers/data/overlay10.h @@ -138,6 +138,7 @@ extern fx32_8 FACADE_DAMAGE_MULTIPLIER; extern int16_t IMPRISON_TURN_RANGE[2]; extern int16_t SLEEP_TURN_RANGE[2]; extern int16_t NIGHTMARE_TURN_RANGE[2]; +extern int16_t SLEEPLESSNESS_TURN_RANGE[2]; extern int16_t REFLECT_LIGHT_SCREEN_TURN_RANGE[2]; extern fx32_8 BURN_DAMAGE_MULTIPLIER; extern int16_t REST_TURN_RANGE[2]; @@ -165,6 +166,7 @@ extern fx32_8 MATCHUP_NEUTRAL_MULTIPLIER_ERRATIC_PLAYER; extern fx32_8 AIR_BLADE_DAMAGE_MULTIPLIER; extern fx32_8 KECLEON_SHOP_BOOST_CHANCE_MULTIPLIER; extern fx32_8 HIDDEN_STAIRS_SPAWN_CHANCE_MULTIPLIER; +extern int16_t MIRROR_MOVE_TURN_RANGE[2]; extern int16_t YAWN_TURN_RANGE[2]; extern int16_t SPEED_BOOST_TURN_RANGE[2]; extern fx32_8 SOLARBEAM_DAMAGE_MULTIPLIER; diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index 41d79004..6c499226 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -536,14 +536,15 @@ 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); -void TryInflictWhifferStatus(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); void TryInflictCurseStatus(struct entity* user, struct entity* target); void TryInflictSnatchStatus(struct entity* user, struct entity* target); -bool TryInflictTauntStatus(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); diff --git a/symbols/overlay10.yml b/symbols/overlay10.yml index 82cc9230..96213dcc 100644 --- a/symbols/overlay10.yml +++ b/symbols/overlay10.yml @@ -1607,6 +1607,17 @@ overlay10: description: |- The turn range for the Nightmare status inflicted by Nightmare, [4, 8). + type: int16_t[2] + - name: SLEEPLESSNESS_TURN_RANGE + address: + EU: 0x22C5080 + length: + EU: 0x4 + NA: 0x4 + JP: 0x4 + description: |- + The turn range for the Sleepless status, [0x7F, 0x7F] (infinite). + type: int16_t[2] - name: REFLECT_LIGHT_SCREEN_TURN_RANGE address: @@ -1849,6 +1860,17 @@ overlay10: NA: 0x4 JP: 0x4 description: "The damage multiplier corresponding to MATCHUP_NEUTRAL when Erratic Player is active, as a fixed-point number with 8 fraction bits (1)." + - name: MIRROR_MOVE_TURN_RANGE + address: + EU: 0x22C5198 + length: + EU: 0x4 + NA: 0x4 + JP: 0x4 + description: |- + The turn range for the Mirror Move status, [1, 3). + + type: int16_t[2] - name: AIR_BLADE_DAMAGE_MULTIPLIER address: EU: 0x22C519C diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 1c8129cd..6769bba5 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -5338,6 +5338,7 @@ overlay29: r0: user entity pointer r1: target entity pointer + r2: number of turns the status will last for - name: TryInflictWhifferStatus address: EU: 0x2316660 @@ -5348,6 +5349,8 @@ overlay29: r0: user entity pointer r1: target entity pointer + r2: number of turns the status will last for + r3: flag to only perform the check for inflicting without actually inflicting - name: TryInflictSetDamageStatus address: EU: 0x2316748 @@ -5411,6 +5414,7 @@ overlay29: r0: user entity pointer r1: target entity pointer + r2: flag to only perform the check for inflicting without actually inflicting return: Whether or not the status could be inflicted - name: TryInflictStockpileStatus address: From 6ac3e5f17ece8dcc280ba413143a82462020dbc0 Mon Sep 17 00:00:00 2001 From: assidion Date: Wed, 29 Oct 2025 20:27:21 +0400 Subject: [PATCH 177/204] . --- headers/data/overlay10.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/data/overlay10.h b/headers/data/overlay10.h index d22a96df..64e24dc3 100644 --- a/headers/data/overlay10.h +++ b/headers/data/overlay10.h @@ -163,10 +163,10 @@ extern fx32_8 MATCHUP_NEUTRAL_MULTIPLIER; extern fx32_8 MATCHUP_IMMUNE_MULTIPLIER_ERRATIC_PLAYER; extern fx32_8 MATCHUP_NOT_VERY_EFFECTIVE_MULTIPLIER_ERRATIC_PLAYER; extern fx32_8 MATCHUP_NEUTRAL_MULTIPLIER_ERRATIC_PLAYER; +extern int16_t MIRROR_MOVE_TURN_RANGE[2]; extern fx32_8 AIR_BLADE_DAMAGE_MULTIPLIER; extern fx32_8 KECLEON_SHOP_BOOST_CHANCE_MULTIPLIER; extern fx32_8 HIDDEN_STAIRS_SPAWN_CHANCE_MULTIPLIER; -extern int16_t MIRROR_MOVE_TURN_RANGE[2]; extern int16_t YAWN_TURN_RANGE[2]; extern int16_t SPEED_BOOST_TURN_RANGE[2]; extern fx32_8 SOLARBEAM_DAMAGE_MULTIPLIER; From 459e401f4c3ce88addb661e504f8889ff2677fb3 Mon Sep 17 00:00:00 2001 From: assidion Date: Wed, 29 Oct 2025 22:25:37 +0400 Subject: [PATCH 178/204] . --- headers/functions/overlay29.h | 2 ++ symbols/overlay29.yml | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index 6c499226..eab4f4e8 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -19,6 +19,8 @@ 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); +uint32_t GetSuccessfulExitTracker(void); bool CheckTouchscreenArea(int x1, int y1, int x2, int y2); struct trap* GetTrapInfo(struct entity* trap_entity); struct item* GetItemInfo(struct entity* item_entity); diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 6769bba5..b4e8fd28 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -327,6 +327,21 @@ overlay29: description: |- Fades the screen to black across several frames. + No params. + - name: SetDungeonEscapeFields + address: + EU: 0x22E1328 + description: |- + Sets the successful_exit_tracker and end_floor_no_death_check_flag fields of the dungeon struct. + + r0: new successful_exit_tracker + r1: new end_floor_no_death_check_flag + - name: GetSuccessfulExitTracker + address: + EU: 0x22E1344 + description: |- + Returns the successful_exit_tracker field of the dungeon struct. + No params. - name: CheckTouchscreenArea address: From cefac98241ed9c68b67d897ddc1e87b12ccbd7f0 Mon Sep 17 00:00:00 2001 From: assidion Date: Fri, 31 Oct 2025 22:40:52 +0400 Subject: [PATCH 179/204] . --- headers/functions/overlay29.h | 2 +- symbols/overlay29.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index eab4f4e8..2edf103e 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -516,7 +516,7 @@ void BoostSpeed(struct entity* user, struct entity* target, int n_stages, int tu 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 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, diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index b4e8fd28..974a6b94 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -5167,7 +5167,7 @@ overlay29: r0: user entity pointer r1: target entity pointer - r2: flag to log a message on failure + r2: flag to only perform the check for inflicting without actually inflicting return: Whether or not a move was sealed - name: BoostOrLowerSpeed address: From 3bea68cbc2cb9cee0238ac47116fbe1e8d4f1bb4 Mon Sep 17 00:00:00 2001 From: assidion Date: Fri, 31 Oct 2025 22:48:03 +0400 Subject: [PATCH 180/204] . --- headers/functions/overlay29.h | 1 + symbols/overlay29.yml | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index 2edf103e..7f2f0f14 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -663,6 +663,7 @@ bool MoveIsNotPhysical(enum move_id move_id); bool CategoryIsNotPhysical(enum move_category category_id); void MakeFloorOneRoom(struct entity* user); 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, diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 974a6b94..52d4f583 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -6546,6 +6546,15 @@ overlay29: Fails if orbs are disabled on the floor or if the current tileset has the is_water_tileset flag set. r0: user pointer + - name: TryTrawl + address: + EU: 0x232014C + description: |- + Attempts to pull all items on the floor towards the user. + + Fails if the floor is a fixed room on which Trawl Orbs are disabled. + + r0: user entity pointer - name: TryPounce address: EU: 0x2320688 From fdcda403db786e9dbf7e1d998055a1b3f3f79c34 Mon Sep 17 00:00:00 2001 From: assidion Date: Fri, 31 Oct 2025 22:48:47 +0400 Subject: [PATCH 181/204] . --- symbols/overlay29.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 52d4f583..35a37cfb 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -6551,7 +6551,7 @@ overlay29: EU: 0x232014C description: |- Attempts to pull all items on the floor towards the user. - + Fails if the floor is a fixed room on which Trawl Orbs are disabled. r0: user entity pointer From c0d923bd937cb4843672c4540bfc4f075d5dadf6 Mon Sep 17 00:00:00 2001 From: assidion Date: Fri, 31 Oct 2025 23:51:32 +0400 Subject: [PATCH 182/204] . --- headers/functions/arm9.h | 2 +- headers/functions/overlay29.h | 2 ++ symbols/arm9.yml | 2 +- symbols/overlay29.yml | 18 ++++++++++++++++++ 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index d30c0149..902d2634 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -333,7 +333,7 @@ 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); +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); diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index 7f2f0f14..922780e7 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -358,6 +358,7 @@ void LevelUpItemEffect(struct entity* user, struct entity* target, int levels, b 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 ChangeMonsterAnimation(struct entity* monster, int8_t animation_id, @@ -659,6 +660,7 @@ int GetAiUseItemProbability(struct entity* item_consumer, struct item* item, uin 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); bool MoveIsNotPhysical(enum move_id move_id); bool CategoryIsNotPhysical(enum move_category category_id); void MakeFloorOneRoom(struct entity* user); diff --git a/symbols/arm9.yml b/symbols/arm9.yml index eb4a534d..4c238364 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -3247,7 +3247,7 @@ arm9: This sets f_exists and f_enabled_for_ai on the flags, the ID to the given ID, the PP to the max PP for the move ID, and the ginseng boost to 0. - r0: pointer to move to initialize + r0: [output] pointer to move to initialize r1: move ID - name: InitMoveCheckId address: diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 35a37cfb..33e9b4ea 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -3854,6 +3854,15 @@ overlay29: r2: bool message flag? r3: bool show level up dialogue (for example "Hey, I leveled up!" with a portrait)? return: success flag + - name: DungeonTmLearnMove + address: + EU: 0x2304300 + description: |- + Makes a team member learn a given move, or prompts them to forget one first if their move list is full. Used when activating a TM in dungeon mode. + + r0: user + r1: move id + return: whether the move was successfully learned - name: GetMonsterMoves address: EU: 0x2304544 @@ -6506,6 +6515,15 @@ overlay29: r0: move pointer return: max PP for the given move, capped at 99 + - name: InitMoveWrapper + address: + EU: 0x231F46C + description: |- + Wrapper for InitMove which takes a superfluous parameter. + + r0: unused + r1: [output] pointer to move to initialize + r2: move ID - name: MoveIsNotPhysical address: EU: 0x231F480 From 0c7d18f3c4a72f78717e25e60242b4d5d224470f Mon Sep 17 00:00:00 2001 From: assidion Date: Fri, 31 Oct 2025 23:55:16 +0400 Subject: [PATCH 183/204] . --- symbols/overlay29.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 33e9b4ea..99a101f1 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -3860,7 +3860,7 @@ overlay29: description: |- Makes a team member learn a given move, or prompts them to forget one first if their move list is full. Used when activating a TM in dungeon mode. - r0: user + r0: user entity pointer r1: move id return: whether the move was successfully learned - name: GetMonsterMoves From 6acc4b87a4a6dbbf356666b32b30767fb06b8f5a Mon Sep 17 00:00:00 2001 From: assidion Date: Fri, 31 Oct 2025 23:55:27 +0400 Subject: [PATCH 184/204] . --- symbols/overlay29.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 99a101f1..f65f055b 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -3858,7 +3858,7 @@ overlay29: address: EU: 0x2304300 description: |- - Makes a team member learn a given move, or prompts them to forget one first if their move list is full. Used when activating a TM in dungeon mode. + Makes a monster learn a given move, or prompts them to forget one first if their move list is full. Used when activating a TM in dungeon mode. r0: user entity pointer r1: move id From 3ac4f874735148777b2194c86a238e40b982a85b Mon Sep 17 00:00:00 2001 From: assidion Date: Fri, 31 Oct 2025 23:57:57 +0400 Subject: [PATCH 185/204] . --- symbols/overlay29.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index f65f055b..99a101f1 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -3858,7 +3858,7 @@ overlay29: address: EU: 0x2304300 description: |- - Makes a monster learn a given move, or prompts them to forget one first if their move list is full. Used when activating a TM in dungeon mode. + Makes a team member learn a given move, or prompts them to forget one first if their move list is full. Used when activating a TM in dungeon mode. r0: user entity pointer r1: move id From e24c8a6b07a2cf136223d7a296fce47cd2d31057 Mon Sep 17 00:00:00 2001 From: assidion Date: Sat, 1 Nov 2025 23:07:50 +0400 Subject: [PATCH 186/204] . --- symbols/overlay29.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 99a101f1..f4108102 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -342,7 +342,7 @@ overlay29: description: |- Returns the successful_exit_tracker field of the dungeon struct. - No params. + return: successful_exit_tracker - name: CheckTouchscreenArea address: EU: 0x22E15F8 From 9d28d45c742a3a5734f050b0b005f35522e15330 Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 4 Nov 2025 18:24:48 +0400 Subject: [PATCH 187/204] . --- headers/data/overlay10.h | 1 + headers/functions/overlay29.h | 4 +++- headers/types/dungeon_mode/dungeon.h | 2 +- symbols/overlay10.yml | 11 +++++++++++ symbols/overlay29.yml | 13 +++++++++++++ 5 files changed, 29 insertions(+), 2 deletions(-) diff --git a/headers/data/overlay10.h b/headers/data/overlay10.h index 64e24dc3..9afcb6c1 100644 --- a/headers/data/overlay10.h +++ b/headers/data/overlay10.h @@ -148,6 +148,7 @@ extern int16_t GASTRO_ACID_TURN_RANGE[2]; extern int16_t SPORT_CONDITION_TURN_RANGE[2]; extern int16_t SURE_SHOT_TURN_RANGE[2]; extern int DETECT_BAND_MOVE_ACCURACY_DROP; +extern int16_t DECOY_TURN_RANGE[2]; extern fx32_8 TINTED_LENS_MULTIPLIER; extern int16_t SMOKESCREEN_TURN_RANGE[2]; extern int16_t PERISH_SONG_TURN_RANGE[2]; diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index 922780e7..491f1c80 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -176,6 +176,7 @@ bool ApplyRandomTrapEffect(struct trap* trap, struct entity* user, struct entity 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); +int SpawnMonstersAroundPos(struct entity* monster, struct position* pos, uint8_t num_enemies); void RevealTrapsNearby(struct entity* monster); bool ShouldRunMonsterAi(struct entity* monster); bool DebugRecruitingEnabled(void); @@ -544,7 +545,8 @@ void TryInflictWhifferStatus(struct entity* user, struct entity* target, uint8_t 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); +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); void TryInflictSnatchStatus(struct entity* user, struct entity* target); bool TryInflictTauntStatus(struct entity* user, struct entity* target, bool only_check); diff --git a/headers/types/dungeon_mode/dungeon.h b/headers/types/dungeon_mode/dungeon.h index ccf2378d..e57437a5 100644 --- a/headers/types/dungeon_mode/dungeon.h +++ b/headers/types/dungeon_mode/dungeon.h @@ -53,7 +53,7 @@ struct dungeon { // an action (such as walking or attacking) bool no_action_in_progress; bool iq_disabled; // 0x12: IQ skills won't work in the dungeon. - bool regular_attack_reveal_traps; // 0x13: Regular attacks will reveal traps. + bool regular_attack_no_reveal_traps; // 0x13: Regular attacks will not reveal traps. // 0x14: If > 0, you get kicked out of the dungeon, usually because an important team member // (such as your client) fainted. enum forced_loss_reason forced_loss_reason; diff --git a/symbols/overlay10.yml b/symbols/overlay10.yml index 96213dcc..19f59edc 100644 --- a/symbols/overlay10.yml +++ b/symbols/overlay10.yml @@ -1717,6 +1717,17 @@ overlay10: NA: 0x4 JP: 0x4 description: The (subtractive) move accuracy drop induced on an attacker if the defender is wearing a Detect Band (30). + - name: DECOY_TURN_RANGE + address: + EU: 0x22C510C + length: + EU: 0x4 + NA: 0x4 + JP: 0x4 + description: |- + The turn range for the Decoy status, [20, 50). + + type: int16_t[2] - name: TINTED_LENS_MULTIPLIER address: EU: 0x22C5118 diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index f4108102..a50f5e3f 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -1939,6 +1939,16 @@ overlay29: stack[1]: trap ID stack[2]: bool caused by random trap return: True if the trap should be destroyed after the effect is applied + - name: SpawnMonstersAroundPos + address: + EU: 0x22EFE68 + description: |- + Spawns a given number of monsters around a position. Used by the Summon Trap and Grudge Trap. + + r0: entity pointer (unused) + r1: position + r2: number of enemies to spawn + return: number of enemies that have actually been spawned - name: RevealTrapsNearby address: EU: 0x22EFF8C @@ -5405,6 +5415,9 @@ overlay29: r0: user entity pointer r1: target entity pointer + r2: value to set the target monster's unk_decoy_tracker flag to + r3: flag to log a message + stack[0]: flag to only perform the check for inflicting without actually inflicting return: Whether or not the status could be inflicted - name: TryInflictCurseStatus address: From 4929ec5c34edec5441f2968b4cde567494ddbd26 Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 4 Nov 2025 18:26:48 +0400 Subject: [PATCH 188/204] . --- symbols/overlay29.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index a50f5e3f..9ee9c5c3 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -5415,7 +5415,7 @@ overlay29: r0: user entity pointer r1: target entity pointer - r2: value to set the target monster's unk_decoy_tracker flag to + r2: value to set the target monster's unk_decoy_tracker field to r3: flag to log a message stack[0]: flag to only perform the check for inflicting without actually inflicting return: Whether or not the status could be inflicted From 78a2ae7b8c646a388874884805ab462d0d4c5397 Mon Sep 17 00:00:00 2001 From: assidion Date: Tue, 4 Nov 2025 18:28:31 +0400 Subject: [PATCH 189/204] . --- headers/types/dungeon_mode/dungeon.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/types/dungeon_mode/dungeon.h b/headers/types/dungeon_mode/dungeon.h index e57437a5..7e80dc78 100644 --- a/headers/types/dungeon_mode/dungeon.h +++ b/headers/types/dungeon_mode/dungeon.h @@ -52,7 +52,7 @@ struct dungeon { // 0x11: True if the leader isn't doing anything right now. False if it's currently performing // an action (such as walking or attacking) bool no_action_in_progress; - bool iq_disabled; // 0x12: IQ skills won't work in the dungeon. + bool iq_disabled; // 0x12: IQ skills won't work in the dungeon. bool regular_attack_no_reveal_traps; // 0x13: Regular attacks will not reveal traps. // 0x14: If > 0, you get kicked out of the dungeon, usually because an important team member // (such as your client) fainted. From 321db5995728f21564a12660219098615c38d431 Mon Sep 17 00:00:00 2001 From: assidion Date: Thu, 6 Nov 2025 17:03:16 +0400 Subject: [PATCH 190/204] . --- headers/functions/arm9.h | 1 + headers/functions/overlay29.h | 1 + symbols/arm9.yml | 12 ++++++++++-- symbols/overlay29.yml | 9 +++++++++ 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 902d2634..7f345231 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -856,6 +856,7 @@ 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); undefined CheckMissionRestrictions(undefined param_1); +bool TilesetSecondaryTerrainIsChasm(int16_t tileset_id); int GetNbFloors(enum dungeon_id dungeon_id); int GetNbFloorsPlusOne(enum dungeon_id dungeon_id); enum dungeon_group_id GetDungeonGroup(enum dungeon_id dungeon_id); diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index 491f1c80..e0380bfa 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -10,6 +10,7 @@ void DungeonZInit(void); void DungeonFree(void); int RunDungeon(struct dungeon_init* dungeon_init_data, struct dungeon* dungeon); bool EntityIsValid(struct entity* entity); +bool TilesetSecondaryTerrainIsChasm2(int16_t tileset_id); enum floor_type GetFloorType(void); bool TryForcedLoss(bool skip_floor_end_check); bool IsBossFight(enum fixed_room_id fixed_room_id); diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 4c238364..ff865015 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -8105,6 +8105,14 @@ arm9: r0: ? return: (?) Seems to be composed of multiple bitflags. + - name: TilesetSecondaryTerrainIsChasm + address: + EU: 0x204F894 + description: |- + Returns true if the given tileset has a chasm secondary terrain. + + r0: tileset id + return: bool - name: GetNbFloors address: EU: 0x204F8B4 @@ -12474,9 +12482,9 @@ arm9: NA: 0xC8 JP: 0xC8 description: |- - The type of secondary terrain for each dungeon in the game. + The type of secondary terrain for each tileset in the game. - This is an array of 200 bytes. Each byte is an enum corresponding to one dungeon. + This is an array of 200 bytes. Each byte is an enum corresponding to one tileset. type: struct secondary_terrain_type_8[200] - name: SENTRY_DUTY_MONSTER_IDS diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 9ee9c5c3..304c86a6 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -238,6 +238,15 @@ overlay29: r0: entity pointer return: bool + - name: TilesetSecondaryTerrainIsChasm2 + address: + EU: 0x22E0CB8 + description: |- + Returns true if the given tileset has a chasm secondary terrain, checking first if floor_generation_status::has_chasms_as_secondary_terrain is true + and if not, whether the tileset's entry in SECONDARY_TERRAIN_TYPES is SECONDARY_TERRAIN_CHASM. + + r0: tileset id + return: bool - name: GetFloorType address: EU: 0x22E0CF0 From a3c9c84cee80b1d141f59773ab4080ac60f00321 Mon Sep 17 00:00:00 2001 From: assidion Date: Thu, 6 Nov 2025 17:09:53 +0400 Subject: [PATCH 191/204] . --- headers/functions/overlay29.h | 2 +- symbols/overlay29.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index e0380bfa..123a978b 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -10,7 +10,7 @@ void DungeonZInit(void); void DungeonFree(void); int RunDungeon(struct dungeon_init* dungeon_init_data, struct dungeon* dungeon); bool EntityIsValid(struct entity* entity); -bool TilesetSecondaryTerrainIsChasm2(int16_t tileset_id); +bool FloorSecondaryTerrainIsChasm(int16_t tileset_id); enum floor_type GetFloorType(void); bool TryForcedLoss(bool skip_floor_end_check); bool IsBossFight(enum fixed_room_id fixed_room_id); diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 304c86a6..3353430b 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -238,11 +238,11 @@ overlay29: r0: entity pointer return: bool - - name: TilesetSecondaryTerrainIsChasm2 + - name: FloorSecondaryTerrainIsChasm address: EU: 0x22E0CB8 description: |- - Returns true if the given tileset has a chasm secondary terrain, checking first if floor_generation_status::has_chasms_as_secondary_terrain is true + Returns true if the given floor has a chasm secondary terrain, checking first if floor_generation_status::has_chasms_as_secondary_terrain is true and if not, whether the tileset's entry in SECONDARY_TERRAIN_TYPES is SECONDARY_TERRAIN_CHASM. r0: tileset id From 099bf0802fb7e08766a0c53a918697cee06bdacc Mon Sep 17 00:00:00 2001 From: assidion Date: Thu, 6 Nov 2025 17:22:18 +0400 Subject: [PATCH 192/204] . --- symbols/overlay29.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 3353430b..90196f69 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -242,7 +242,7 @@ overlay29: address: EU: 0x22E0CB8 description: |- - Returns true if the given floor has a chasm secondary terrain, checking first if floor_generation_status::has_chasms_as_secondary_terrain is true + Returns true if the current floor has a chasm secondary terrain, checking first if floor_generation_status::has_chasms_as_secondary_terrain is true and if not, whether the tileset's entry in SECONDARY_TERRAIN_TYPES is SECONDARY_TERRAIN_CHASM. r0: tileset id From 7042c877a1648d8bdea52f7e9638229365474e39 Mon Sep 17 00:00:00 2001 From: assidion Date: Fri, 7 Nov 2025 13:52:49 +0400 Subject: [PATCH 193/204] . --- headers/data/overlay10.h | 7 ++++- symbols/overlay10.yml | 60 ++++++++++++++++++++++++++++++++++++++-- 2 files changed, 64 insertions(+), 3 deletions(-) diff --git a/headers/data/overlay10.h b/headers/data/overlay10.h index 9afcb6c1..0e7aae23 100644 --- a/headers/data/overlay10.h +++ b/headers/data/overlay10.h @@ -139,7 +139,12 @@ extern int16_t IMPRISON_TURN_RANGE[2]; extern int16_t SLEEP_TURN_RANGE[2]; extern int16_t NIGHTMARE_TURN_RANGE[2]; extern int16_t SLEEPLESSNESS_TURN_RANGE[2]; -extern int16_t REFLECT_LIGHT_SCREEN_TURN_RANGE[2]; +extern int16_t REFLECT_TURN_RANGE[2]; +extern int16_t LIGHT_SCREEN_TURN_RANGE[2]; +extern int16_t SAFEGUARD_TURN_RANGE[2]; +extern int16_t MIST_TURN_RANGE[2]; +extern int16_t MAGIC_COAT_TURN_RANGE[2]; +extern int16_t SET_REFLECT_STATUS_TURN_RANGE[2]; extern fx32_8 BURN_DAMAGE_MULTIPLIER; extern int16_t REST_TURN_RANGE[2]; extern fx32_8 MATCHUP_SUPER_EFFECTIVE_MULTIPLIER_ERRATIC_PLAYER; diff --git a/symbols/overlay10.yml b/symbols/overlay10.yml index 19f59edc..add6db00 100644 --- a/symbols/overlay10.yml +++ b/symbols/overlay10.yml @@ -1619,16 +1619,72 @@ overlay10: The turn range for the Sleepless status, [0x7F, 0x7F] (infinite). type: int16_t[2] - - name: REFLECT_LIGHT_SCREEN_TURN_RANGE + - name: REFLECT_TURN_RANGE address: EU: 0x22C5084 NA: 0x22C472C JP: 0x22C5E14 length: + EU: 0x4 + NA: 0x4 + JP: 0x4 + description: |- + The turn range for the Reflect status, [10, 12). + + type: int16_t[2] + - name: LIGHT_SCREEN_TURN_RANGE + address: + EU: 0x22C5088 + length: + EU: 0x4 + NA: 0x4 + JP: 0x4 + description: |- + The turn range for the Light Screen status, [10, 12). + + type: int16_t[2] + - name: SAFEGUARD_TURN_RANGE + address: + EU: 0x22C508C + length: + EU: 0x4 + NA: 0x4 + JP: 0x4 + description: |- + The turn range for the Safeguard status, [15, 20). + + type: int16_t[2] + - name: MIST_TURN_RANGE + address: + EU: 0x22C5090 + length: + EU: 0x4 + NA: 0x4 + JP: 0x4 + description: |- + The turn range for the Mist status, [10, 14). + + type: int16_t[2] + - name: MAGIC_COAT_TURN_RANGE + address: + EU: 0x22C5098 + length: + EU: 0x4 + NA: 0x4 + JP: 0x4 + description: |- + The turn range for the Magic Coat status, [10, 14). + + type: int16_t[2] + - name: SET_REFLECT_STATUS_TURN_RANGE + address: + EU: 0x22C50A8 + length: + EU: 0x4 NA: 0x4 JP: 0x4 description: |- - The turn range for the Reflect and Light Screen statuses, [10, 12). + The turn range for the statuses (Counter, Mini Counter, Metal Burst) set by SetReflctStatus, [6, 12). type: int16_t[2] - name: BURN_DAMAGE_MULTIPLIER From 668b3e372e4bc164085190f41acb1a1652bdff5f Mon Sep 17 00:00:00 2001 From: assidion Date: Fri, 7 Nov 2025 13:56:30 +0400 Subject: [PATCH 194/204] . --- headers/data/overlay10.h | 2 +- symbols/overlay10.yml | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/headers/data/overlay10.h b/headers/data/overlay10.h index 0e7aae23..ba0ffdf3 100644 --- a/headers/data/overlay10.h +++ b/headers/data/overlay10.h @@ -144,10 +144,10 @@ extern int16_t LIGHT_SCREEN_TURN_RANGE[2]; extern int16_t SAFEGUARD_TURN_RANGE[2]; extern int16_t MIST_TURN_RANGE[2]; extern int16_t MAGIC_COAT_TURN_RANGE[2]; -extern int16_t SET_REFLECT_STATUS_TURN_RANGE[2]; extern fx32_8 BURN_DAMAGE_MULTIPLIER; extern int16_t REST_TURN_RANGE[2]; extern fx32_8 MATCHUP_SUPER_EFFECTIVE_MULTIPLIER_ERRATIC_PLAYER; +extern int16_t SET_REFLECT_STATUS_TURN_RANGE[2]; extern fx32_8 MATCHUP_IMMUNE_MULTIPLIER; extern int16_t GASTRO_ACID_TURN_RANGE[2]; extern int16_t SPORT_CONDITION_TURN_RANGE[2]; diff --git a/symbols/overlay10.yml b/symbols/overlay10.yml index add6db00..912dcf40 100644 --- a/symbols/overlay10.yml +++ b/symbols/overlay10.yml @@ -1675,17 +1675,6 @@ overlay10: description: |- The turn range for the Magic Coat status, [10, 14). - type: int16_t[2] - - name: SET_REFLECT_STATUS_TURN_RANGE - address: - EU: 0x22C50A8 - length: - EU: 0x4 - NA: 0x4 - JP: 0x4 - description: |- - The turn range for the statuses (Counter, Mini Counter, Metal Burst) set by SetReflctStatus, [6, 12). - type: int16_t[2] - name: BURN_DAMAGE_MULTIPLIER address: @@ -1720,6 +1709,17 @@ overlay10: NA: 0x4 JP: 0x4 description: "The damage multiplier corresponding to MATCHUP_SUPER_EFFECTIVE when Erratic Player is active, as a fixed-point number with 8 fraction bits (the raw value is 0x1B3, the closest possible representation of 1.7)." + - name: SET_REFLECT_STATUS_TURN_RANGE + address: + EU: 0x22C50A8 + length: + EU: 0x4 + NA: 0x4 + JP: 0x4 + description: |- + The turn range for the statuses (Counter, Mini Counter, Metal Burst) set by SetReflctStatus, [6, 12). + + type: int16_t[2] - name: MATCHUP_IMMUNE_MULTIPLIER address: EU: 0x22C50B0 From b220307e7ec621f07fa2cf72e31c79bfd888059b Mon Sep 17 00:00:00 2001 From: assidion Date: Fri, 7 Nov 2025 16:04:23 +0400 Subject: [PATCH 195/204] . --- headers/data/overlay10.h | 1 + headers/functions/overlay29.h | 1 + symbols/overlay10.yml | 8 ++++++++ symbols/overlay29.yml | 8 ++++++++ 4 files changed, 18 insertions(+) diff --git a/headers/data/overlay10.h b/headers/data/overlay10.h index ba0ffdf3..83fe7c38 100644 --- a/headers/data/overlay10.h +++ b/headers/data/overlay10.h @@ -17,6 +17,7 @@ extern int16_t TWINEEDLE_POISON_CHANCE; extern int16_t EXTRASENSORY_CRINGE_CHANCE; extern int16_t ROCK_SLIDE_CRINGE_CHANCE; extern int16_t CRUNCH_LOWER_DEFENSE_CHANCE; +extern int16_t HURL_DAMAGE; extern int16_t TRAP_BUSTER_ACTIVATION_CHANCE; extern int16_t FOREWARN_FORCED_MISS_CHANCE; extern int16_t UNOWN_STONE_DROP_CHANCE; diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index 123a978b..291314cc 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -667,6 +667,7 @@ 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); diff --git a/symbols/overlay10.yml b/symbols/overlay10.yml index 912dcf40..600fcd07 100644 --- a/symbols/overlay10.yml +++ b/symbols/overlay10.yml @@ -480,6 +480,14 @@ overlay10: NA: 0x2 JP: 0x2 description: "The chance of Crunch (and others, see DoMoveDamageLowerDef20) lowering defense, as a percentage (20%)." + - name: HURL_DAMAGE + address: + EU: 0x22C4DB0 + length: + EU: 0x2 + NA: 0x2 + JP: 0x2 + description: Damage dealt from hurling a monster at another monster (10). - name: TRAP_BUSTER_ACTIVATION_CHANCE address: EU: 0x22C4DB4 diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 90196f69..ef2dcb63 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -6575,6 +6575,14 @@ overlay29: Removes all walls to make the floor one room. r0: user entity pointer + - name: TryHurl + address: + EU: 0x231F864 + description: |- + Attempts to hurl the target monster at another monster, or to an unoccupied tile if there is no valid one in range. + + r0: user entity pointer + r1: target entity pointer - name: TryDrought address: EU: 0x231FFFC From 2a9309e768b9405357b1849a541cdbb54f411670 Mon Sep 17 00:00:00 2001 From: assidion Date: Sat, 8 Nov 2025 00:02:13 +0400 Subject: [PATCH 196/204] . --- symbols/overlay10.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay10.yml b/symbols/overlay10.yml index 600fcd07..ba02e612 100644 --- a/symbols/overlay10.yml +++ b/symbols/overlay10.yml @@ -1725,7 +1725,7 @@ overlay10: NA: 0x4 JP: 0x4 description: |- - The turn range for the statuses (Counter, Mini Counter, Metal Burst) set by SetReflctStatus, [6, 12). + The turn range for the statuses (Counter, Mini Counter, Metal Burst) set by SetReflectStatus, [6, 12). type: int16_t[2] - name: MATCHUP_IMMUNE_MULTIPLIER From af55feda3a6dd59ce7ad7f43060d6a4bcddd8319 Mon Sep 17 00:00:00 2001 From: assidion Date: Sat, 8 Nov 2025 23:46:27 +0400 Subject: [PATCH 197/204] . --- symbols/overlay10.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/symbols/overlay10.yml b/symbols/overlay10.yml index ba02e612..91690f1f 100644 --- a/symbols/overlay10.yml +++ b/symbols/overlay10.yml @@ -1628,6 +1628,8 @@ overlay10: type: int16_t[2] - name: REFLECT_TURN_RANGE + aliases: + - REFLECT_LIGHT_SCREEN_TURN_RANGE address: EU: 0x22C5084 NA: 0x22C472C From a22d616b05f40f0d9093e1bbfbe7ebf626a3c750 Mon Sep 17 00:00:00 2001 From: assidion Date: Sat, 14 Mar 2026 00:57:09 +0400 Subject: [PATCH 198/204] aaa --- headers/data/ram.h | 1 + headers/functions/arm9.h | 4 ++-- headers/functions/overlay29.h | 2 ++ headers/types/dungeon_mode/dungeon_mode.h | 17 +++++++++++++++++ symbols/overlay29.yml | 17 +++++++++++++++++ symbols/ram.yml | 9 +++++++++ 6 files changed, 48 insertions(+), 2 deletions(-) diff --git a/headers/data/ram.h b/headers/data/ram.h index 5fe76651..8923b9c6 100644 --- a/headers/data/ram.h +++ b/headers/data/ram.h @@ -67,6 +67,7 @@ extern struct mem_arena GROUND_MEMORY_ARENA_1; extern struct mem_block GROUND_MEMORY_ARENA_1_BLOCKS[52]; extern uint8_t GROUND_MEMORY_ARENA_1_MEMORY[408324]; extern struct sentry_duty SENTRY_DUTY_STRUCT; +extern struct dungeon_button_info DUNGEON_BUTTON_INFO; extern bool TURNING_ON_THE_SPOT_FLAG; extern struct loaded_attack_sprite_data* LOADED_ATTACK_SPRITE_DATA; extern enum mobility_type MOBILITY_TYPE_TO_DUNGEON_MOBILITY_TYPE[8]; diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 99cefde4..86e2c965 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -476,8 +476,8 @@ void LoadWteFromFileDirectory(struct wte_handle* handle, enum pack_file_id pack_ 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 pal_vram_offset, - undefined4 pal_texture_vram_offset_upper, undefined4 pal_texture_vram_offset_lower); +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, diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index ba97e7ce..5343a678 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -22,6 +22,7 @@ int GetScenarioBalanceVeneer(void); void FadeToBlack(void); 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); struct trap* GetTrapInfo(struct entity* trap_entity); struct item* GetItemInfo(struct entity* item_entity); @@ -748,6 +749,7 @@ void ActivateSportCondition(bool water_sport); bool TryActivateWeather(bool param_1, bool param_2); int DigitCount(int n); void LoadTextureUi(void); +int GetPaletteBaseAddress(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); diff --git a/headers/types/dungeon_mode/dungeon_mode.h b/headers/types/dungeon_mode/dungeon_mode.h index 7ae77e33..bd9aa1bb 100644 --- a/headers/types/dungeon_mode/dungeon_mode.h +++ b/headers/types/dungeon_mode/dungeon_mode.h @@ -2564,6 +2564,23 @@ struct message_log_info { }; ASSERT_SIZE(struct message_log_info, 12); +// Contains information about the user's current button input in dungeon mode. +// For a mapping of keys <-> bits, see https://problemkaputt.de/gbatek.htm#gbakeypadinput +// (with the additions of bit 10 = x, bit 11 = y, bit 13 = debug) +struct dungeon_button_info { + uint16_t cur_held_buttons; // 0x0 + uint16_t cur_pressed_buttons; // 0x2 + uint16_t field_0x4; + // 0x6: This and the next bitfield are duplicates of each other, and store whether + // a certain key has been released this frame after being held for 2-11 frames. + // Only implemented for B and R. + uint16_t cur_released_buttons; + uint16_t cur_released_buttons_2; // 0x8 + uint16_t b_frames_counter; // 0x10: How many frames B has been held for (caps at 100) + uint16_t r_frames_counter; // 0x10: How many frames R has been held for (caps at 100) +}; +ASSERT_SIZE(struct dungeon_button_info, 14); + // Separate this out into its own file because it's massive #include "dungeon.h" diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 055fcaf8..7ead0416 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -358,6 +358,13 @@ overlay29: Returns the successful_exit_tracker field of the dungeon struct. return: successful_exit_tracker + - name: GetAndStoreButtonInput + address: + EU: 0x22E13A4 + description: |- + Gets and stores the button input for the current frame in DUNGEON_BUTTON_INPUT. + + No params. - name: CheckTouchscreenArea address: EU: 0x22E15F8 @@ -7347,6 +7354,16 @@ overlay29: Note: unverified, ported from Irdkwia's notes No params. + - name: GetPaletteBaseAddress + address: + EU: 0x23362B0 + description: |- + Gets the palette base address for a 3D element loaded from a WTE file. + Takes the same parameters as were used in the specified file's ProcessWte call. + + r0: upper part of the palette VRAM + r1: lower part of the palette VRAM + return: palette base address - name: DisplayNumberTextureUi address: EU: 0x23362CC diff --git a/symbols/ram.yml b/symbols/ram.yml index 12f33007..7def1aa7 100644 --- a/symbols/ram.yml +++ b/symbols/ram.yml @@ -662,6 +662,15 @@ ram: NA: 0x237A5D0 length: NA: 0x38D4 + - name: DUNGEON_BUTTON_INPUT + address: + EU: 0x237D294 + length: + EU: 0xE + description: |- + [Runtime] Stores information about the user's current button input in dungeon mode. + + type: struct dungeon_button_input - name: TURNING_ON_THE_SPOT_FLAG address: EU: 0x237D5A6 From dba58460d0aec54463e009e7e63240171f898002 Mon Sep 17 00:00:00 2001 From: assidion Date: Sat, 14 Mar 2026 01:00:22 +0400 Subject: [PATCH 199/204] aaa --- headers/data/ram.h | 2 +- headers/types/dungeon_mode/dungeon_mode.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/headers/data/ram.h b/headers/data/ram.h index 8923b9c6..3b06a553 100644 --- a/headers/data/ram.h +++ b/headers/data/ram.h @@ -67,7 +67,7 @@ extern struct mem_arena GROUND_MEMORY_ARENA_1; extern struct mem_block GROUND_MEMORY_ARENA_1_BLOCKS[52]; extern uint8_t GROUND_MEMORY_ARENA_1_MEMORY[408324]; extern struct sentry_duty SENTRY_DUTY_STRUCT; -extern struct dungeon_button_info DUNGEON_BUTTON_INFO; +extern struct dungeon_button_input DUNGEON_BUTTON_INPUT; extern bool TURNING_ON_THE_SPOT_FLAG; extern struct loaded_attack_sprite_data* LOADED_ATTACK_SPRITE_DATA; extern enum mobility_type MOBILITY_TYPE_TO_DUNGEON_MOBILITY_TYPE[8]; diff --git a/headers/types/dungeon_mode/dungeon_mode.h b/headers/types/dungeon_mode/dungeon_mode.h index bd9aa1bb..d83d988f 100644 --- a/headers/types/dungeon_mode/dungeon_mode.h +++ b/headers/types/dungeon_mode/dungeon_mode.h @@ -2567,7 +2567,7 @@ ASSERT_SIZE(struct message_log_info, 12); // Contains information about the user's current button input in dungeon mode. // For a mapping of keys <-> bits, see https://problemkaputt.de/gbatek.htm#gbakeypadinput // (with the additions of bit 10 = x, bit 11 = y, bit 13 = debug) -struct dungeon_button_info { +struct dungeon_button_input { uint16_t cur_held_buttons; // 0x0 uint16_t cur_pressed_buttons; // 0x2 uint16_t field_0x4; @@ -2579,7 +2579,7 @@ struct dungeon_button_info { uint16_t b_frames_counter; // 0x10: How many frames B has been held for (caps at 100) uint16_t r_frames_counter; // 0x10: How many frames R has been held for (caps at 100) }; -ASSERT_SIZE(struct dungeon_button_info, 14); +ASSERT_SIZE(struct dungeon_button_input, 14); // Separate this out into its own file because it's massive #include "dungeon.h" From 2f44c6ae8fee4d000493a0ae333b69e0c9c0d806 Mon Sep 17 00:00:00 2001 From: assidion Date: Sat, 14 Mar 2026 13:02:52 +0400 Subject: [PATCH 200/204] aaa --- headers/types/common/common.h | 22 ++++++++++++++++++++++ headers/types/dungeon_mode/dungeon_mode.h | 3 +-- symbols/arm9.yml | 6 ++++-- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index 0b49123d..24290d23 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -1412,4 +1412,26 @@ struct options { }; ASSERT_SIZE(struct options, 10); +// This is the layout of all button bitflags in the input/controller structs. This is present only +// for analysis purposes, as internally the code does not seem to actually store these as a struct. +struct buttons { + bool a : 1; + bool b : 1; + bool select : 1; + bool start : 1; + bool right : 1; + bool left : 1; + bool up : 1; + bool down : 1; + bool r : 1; + bool l : 1; + bool x : 1; + bool y : 1; + bool unk12 : 1; + bool debug : 1; + bool unk14 : 1; + bool unk15 : 1; +}; +ASSERT_SIZE(struct buttons, 0x2); + #endif diff --git a/headers/types/dungeon_mode/dungeon_mode.h b/headers/types/dungeon_mode/dungeon_mode.h index d83d988f..d49ced8d 100644 --- a/headers/types/dungeon_mode/dungeon_mode.h +++ b/headers/types/dungeon_mode/dungeon_mode.h @@ -2565,8 +2565,7 @@ struct message_log_info { ASSERT_SIZE(struct message_log_info, 12); // Contains information about the user's current button input in dungeon mode. -// For a mapping of keys <-> bits, see https://problemkaputt.de/gbatek.htm#gbakeypadinput -// (with the additions of bit 10 = x, bit 11 = y, bit 13 = debug) +// For a mapping of keys <-> bits, see the buttons struct in common.h. struct dungeon_button_input { uint16_t cur_held_buttons; // 0x0 uint16_t cur_pressed_buttons; // 0x2 diff --git a/symbols/arm9.yml b/symbols/arm9.yml index d905b695..bd6bfadb 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -908,7 +908,8 @@ arm9: NA: 0x20061EC JP: 0x20061EC description: |- - Note: unverified, ported from Irdkwia's notes + Gets a bitfield representing the currently held buttons. + For a mapping of keys <-> bits, see the buttons struct in common.h. r0: controller r1: btn_ptr @@ -919,7 +920,8 @@ arm9: NA: 0x200625C JP: 0x200625C description: |- - Note: unverified, ported from Irdkwia's notes + Gets a bitfield representing the currently pressed buttons. + For a mapping of keys <-> bits, see the buttons struct in common.h. r0: controller r1: btn_ptr From 8b7eed63c1905654dedefdec768d5afe671d74ae Mon Sep 17 00:00:00 2001 From: assidion Date: Sat, 14 Mar 2026 20:14:24 +0400 Subject: [PATCH 201/204] aaa --- headers/functions/arm9.h | 4 ++-- headers/types/common/common.h | 9 ++++++--- headers/types/dungeon_mode/dungeon_mode.h | 11 +++++------ symbols/arm9.yml | 6 ++---- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 86e2c965..65df6295 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -90,8 +90,8 @@ 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, undefined* btn_ptr); -bool GetPressedButtons(int controller, undefined* btn_ptr); +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); diff --git a/headers/types/common/common.h b/headers/types/common/common.h index 24290d23..67d8c3f6 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -1412,8 +1412,11 @@ struct options { }; ASSERT_SIZE(struct options, 10); -// This is the layout of all button bitflags in the input/controller structs. This is present only -// for analysis purposes, as internally the code does not seem to actually store these as a struct. +// This is the layout of all button bitflags in the input/controller structs. +// Derived from https://problemkaputt.de/gbatek.htm#gbakeypadinput +// as well as https://problemkaputt.de/gbatek.htm#dskeypad for the DS-specific buttons. +// Note that the referenced IO registers represents the flags the opposite way +// to this struct, using 0 to mean pressed and 1 to mean released. struct buttons { bool a : 1; bool b : 1; @@ -1432,6 +1435,6 @@ struct buttons { bool unk14 : 1; bool unk15 : 1; }; -ASSERT_SIZE(struct buttons, 0x2); +ASSERT_SIZE(struct buttons, 2); #endif diff --git a/headers/types/dungeon_mode/dungeon_mode.h b/headers/types/dungeon_mode/dungeon_mode.h index d49ced8d..70ec1010 100644 --- a/headers/types/dungeon_mode/dungeon_mode.h +++ b/headers/types/dungeon_mode/dungeon_mode.h @@ -2565,16 +2565,15 @@ struct message_log_info { ASSERT_SIZE(struct message_log_info, 12); // Contains information about the user's current button input in dungeon mode. -// For a mapping of keys <-> bits, see the buttons struct in common.h. struct dungeon_button_input { - uint16_t cur_held_buttons; // 0x0 - uint16_t cur_pressed_buttons; // 0x2 - uint16_t field_0x4; + struct buttons cur_held_buttons; // 0x0 + struct buttons cur_pressed_buttons; // 0x2 + struct buttons field_0x4; // 0x6: This and the next bitfield are duplicates of each other, and store whether // a certain key has been released this frame after being held for 2-11 frames. // Only implemented for B and R. - uint16_t cur_released_buttons; - uint16_t cur_released_buttons_2; // 0x8 + struct buttons cur_released_buttons; + struct buttons cur_released_buttons_2; // 0x8 uint16_t b_frames_counter; // 0x10: How many frames B has been held for (caps at 100) uint16_t r_frames_counter; // 0x10: How many frames R has been held for (caps at 100) }; diff --git a/symbols/arm9.yml b/symbols/arm9.yml index bd6bfadb..da1ff5c3 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -908,8 +908,7 @@ arm9: NA: 0x20061EC JP: 0x20061EC description: |- - Gets a bitfield representing the currently held buttons. - For a mapping of keys <-> bits, see the buttons struct in common.h. + Gets the currently held buttons. r0: controller r1: btn_ptr @@ -920,8 +919,7 @@ arm9: NA: 0x200625C JP: 0x200625C description: |- - Gets a bitfield representing the currently pressed buttons. - For a mapping of keys <-> bits, see the buttons struct in common.h. + Gets the currently pressed buttons. r0: controller r1: btn_ptr From 0018af278357ef72abb023c9e9c13c5bb3770bc9 Mon Sep 17 00:00:00 2001 From: assidion Date: Sat, 14 Mar 2026 20:15:51 +0400 Subject: [PATCH 202/204] aaa --- headers/types/dungeon_mode/dungeon_mode.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/headers/types/dungeon_mode/dungeon_mode.h b/headers/types/dungeon_mode/dungeon_mode.h index 70ec1010..0e3827be 100644 --- a/headers/types/dungeon_mode/dungeon_mode.h +++ b/headers/types/dungeon_mode/dungeon_mode.h @@ -2574,8 +2574,8 @@ struct dungeon_button_input { // Only implemented for B and R. struct buttons cur_released_buttons; struct buttons cur_released_buttons_2; // 0x8 - uint16_t b_frames_counter; // 0x10: How many frames B has been held for (caps at 100) - uint16_t r_frames_counter; // 0x10: How many frames R has been held for (caps at 100) + uint16_t b_frames_counter; // 0x10: How many frames B has been held for (caps at 100) + uint16_t r_frames_counter; // 0x10: How many frames R has been held for (caps at 100) }; ASSERT_SIZE(struct dungeon_button_input, 14); From c23529dbbbe9d1cd2278de9ba894bf1ec295f44e Mon Sep 17 00:00:00 2001 From: assidion Date: Sat, 14 Mar 2026 20:25:17 +0400 Subject: [PATCH 203/204] aaa --- 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 67d8c3f6..0535cec8 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -1415,7 +1415,7 @@ ASSERT_SIZE(struct options, 10); // This is the layout of all button bitflags in the input/controller structs. // Derived from https://problemkaputt.de/gbatek.htm#gbakeypadinput // as well as https://problemkaputt.de/gbatek.htm#dskeypad for the DS-specific buttons. -// Note that the referenced IO registers represents the flags the opposite way +// Note that the referenced IO registers represent the flags the opposite way // to this struct, using 0 to mean pressed and 1 to mean released. struct buttons { bool a : 1; From a6fa2e3ea78a219cfec6a8e68572701d24520633 Mon Sep 17 00:00:00 2001 From: assidion Date: Sun, 15 Mar 2026 00:46:47 +0400 Subject: [PATCH 204/204] aaa --- headers/data/ram.h | 2 +- symbols/ram.yml | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/headers/data/ram.h b/headers/data/ram.h index 3b06a553..371116b2 100644 --- a/headers/data/ram.h +++ b/headers/data/ram.h @@ -64,10 +64,10 @@ extern struct mem_arena* GROUND_MEMORY_ARENA_1_PTR; extern struct mem_arena* GROUND_MEMORY_ARENA_2_PTR; extern bool LOCK_NOTIFY_ARRAY[20]; extern struct mem_arena GROUND_MEMORY_ARENA_1; +extern struct dungeon_button_input DUNGEON_BUTTON_INPUT; extern struct mem_block GROUND_MEMORY_ARENA_1_BLOCKS[52]; extern uint8_t GROUND_MEMORY_ARENA_1_MEMORY[408324]; extern struct sentry_duty SENTRY_DUTY_STRUCT; -extern struct dungeon_button_input DUNGEON_BUTTON_INPUT; extern bool TURNING_ON_THE_SPOT_FLAG; extern struct loaded_attack_sprite_data* LOADED_ATTACK_SPRITE_DATA; extern enum mobility_type MOBILITY_TYPE_TO_DUNGEON_MOBILITY_TYPE[8]; diff --git a/symbols/ram.yml b/symbols/ram.yml index 7def1aa7..460703ca 100644 --- a/symbols/ram.yml +++ b/symbols/ram.yml @@ -642,6 +642,15 @@ ram: Including the allocator metadata, this arena occupies 0x64000 bytes of space. type: struct mem_arena + - name: DUNGEON_BUTTON_INPUT + address: + EU: 0x237D294 + length: + EU: 0xE + description: |- + [Runtime] Stores information about the user's current button input in dungeon mode. + + type: struct dungeon_button_input - name: GROUND_MEMORY_ARENA_1_BLOCKS address: NA: 0x2324FDC @@ -662,15 +671,6 @@ ram: NA: 0x237A5D0 length: NA: 0x38D4 - - name: DUNGEON_BUTTON_INPUT - address: - EU: 0x237D294 - length: - EU: 0xE - description: |- - [Runtime] Stores information about the user's current button input in dungeon mode. - - type: struct dungeon_button_input - name: TURNING_ON_THE_SPOT_FLAG address: EU: 0x237D5A6