From 11149e58af3df1b411ce3420bee4b68259eec638 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 1 Jun 2025 16:21:25 -0400 Subject: [PATCH 001/151] Add Remaining Mission Subtypes Most mission types have subtypes, though many are irrelevant for dungeon generation in particular. --- headers/types/dungeon_mode/enums.h | 175 ++++++++++++++++++++++++++++- 1 file changed, 171 insertions(+), 4 deletions(-) diff --git a/headers/types/dungeon_mode/enums.h b/headers/types/dungeon_mode/enums.h index fa54c1a8..31a2c62c 100644 --- a/headers/types/dungeon_mode/enums.h +++ b/headers/types/dungeon_mode/enums.h @@ -887,6 +887,7 @@ enum mission_type { MISSION_TREASURE_MEMO = 12, MISSION_TYPE_UNK_0xD = 13, MISSION_SPECIAL_EPISODE = 14, + MISSION_TYPE_SEVEN_TREASURE = 15 }; // This is usually stored as an 8-bit integer @@ -894,6 +895,51 @@ enum mission_type { ENUM_8_BIT(mission_type); #pragma pack(pop) +// Mission subtype for MISSION_RESCUE_CLIENT +enum mission_subtype_rescue_client { + MISSION_TEMPLATE_DEFAULT = 0 // Random Client +}; + +// This is usually stored as an 8-bit integer +#pragma pack(push, 1) +ENUM_8_BIT(mission_subtype_rescue_client); +#pragma pack(pop) + +// Mission subtype for MISSION_RESCUE_TARGET +// The distinction is mainly for dialogue +enum mission_subtype_rescue_target { + // Client and Target are randomly selected + MISSION_CLIENT_TARGET_RANDOM = 0, + // Client is the evolved form of the target + // (IE: Beedrill/Weedle, Aggron/Aron) + MISSION_CLIENT_TARGET_CHILD = 1, + // Client and Target are deeply similar + // (IE: Dodrio/Exeggutor, Muk/Swalot, Magikarp/Feebas) + MISSION_CLIENT_TARGET_SIMILAR_FRIENDS = 2, + // Client and Target are lovers or rivals + // (IE: Nidoking/Nidoqueen, Seviper/Zangoose, Volbeat/Illumise) + MISSION_CLIENT_TARGET_LOVERS_RIVALS = 3 +}; + +// This is usually stored as an 8-bit integer +#pragma pack(push, 1) +ENUM_8_BIT(mission_subtype_rescue_target); +#pragma pack(pop) + +// Mission subtype for MISSION_ESCORT_TO_TARGET +enum mission_subtype_escort_to_target { + // Client and Target are randomly selected + MISSION_CLIENT_TARGET_RANDOM = 0, + // Client and Target are counterparts + // (IE: Nidoran-M/Nidoran-F, Volbeat/Illumise, Miltank/Tauros) + MISSION_CLIENT_TARGET_SPECIFIC = 1 +}; + +// This is usually stored as an 8-bit integer +#pragma pack(push, 1) +ENUM_8_BIT(mission_subtype_escort_to_target); +#pragma pack(pop) + // Mission subtype for MISSION_EXPLORE_WITH_CLIENT enum mission_subtype_explore { MISSION_EXPLORE_NORMAL = 0, @@ -907,7 +953,76 @@ enum mission_subtype_explore { ENUM_8_BIT(mission_subtype_explore); #pragma pack(pop) +// Mission subtype for MISSION_PROSPECT_WITH_CLIENT +// There seems to be no distinction between prospecting +// for a random or specific item in this subtype. +enum mission_subtype_prospect_with_client { + MISSION_TEMPLATE_DEFAULT = 0 +}; + +// This is usually stored as an 8-bit integer +#pragma pack(push, 1) +ENUM_8_BIT(mission_subtype_prospect_with_client); +#pragma pack(pop) + + +// Mission subtype for MISSION_GUIDE_CLIENT +enum mission_subtype_guide_client { + MISSION_TEMPLATE_DEFAULT = 0 +}; + +// This is usually stored as an 8-bit integer +#pragma pack(push, 1) +ENUM_8_BIT(mission_subtype_guide_client); +#pragma pack(pop) + +// Mission subtype for MISSION_FIND_ITEM +enum mission_subtype_find_item { + // Item Table parameters are 0x16, 0x00 + // Client is random + MISSION_ITEM_TABLE_16_00 = 0, + // Item Table parameters are 0x14, 0x16 + // Client is random + MISSION_ITEM_TABLE_14_16 = 1, + // Item is an evolution item for the client + // (IE: Gloom/Leaf Stone, Dusclops/Reaper Cloth, Magmar/Magmarizer) + MISSION_ITEM_EVOLVES_CLIENT = 2, + // Item is a gummi of one of the client's types + // (IE: Flaafy/Yellow Gummi, Baltoy/Brown Gummi, Dratini/Royal Gummi) + MISSION_ITEM_CLIENT_FAVORITE_GUMMI = 3, + // This is the special Togetic Mission that unlocks Labyrinth Cave + MISSION_TOGETIC_GABITE_SCALE = 4 +}; + +// This is usually stored as an 8-bit integer +#pragma pack(push, 1) +ENUM_8_BIT(mission_subtype_find_item); +#pragma pack(pop) + +// Mission subtype for MISSION_DELIVER_ITEM +enum mission_subtype_deliver_item { + // Random Client, Item from table 0x16 0x00 + MISSION_TEMPLATE_DEFAULT = 0 +}; + +// This is usually stored as an 8-bit integer +#pragma pack(push, 1) +ENUM_8_BIT(mission_subtype_deliver_item); +#pragma pack(pop) + + +// Mission subtype for MISSION_SEARCH_FOR_TARGET +enum mission_subtype_search_for_target { + MISSION_TEMPLATE_DEFAULT = 0 // Random Client and Target +}; + +// This is usually stored as an 8-bit integer +#pragma pack(push, 1) +ENUM_8_BIT(mission_subtype_search_for_target); +#pragma pack(pop) + // Mission subtype for MISSION_TAKE_ITEM_FROM_OUTLAW +// Random Client and Outlaw. NOT Magnezone/Magnemite enum mission_subtype_take_item { MISSION_TAKE_ITEM_NORMAL_OUTLAW = 0, MISSION_TAKE_ITEM_HIDDEN_OUTLAW = 1, @@ -921,13 +1036,15 @@ ENUM_8_BIT(mission_subtype_take_item); // Mission subtype for MISSION_ARREST_OUTLAW // 0-3 all occur naturally in-game, but don't seem to have any obvious differences? +// The distinction might be intensity or perceived difficulty? enum mission_subtype_outlaw { - MISSION_OUTLAW_NORMAL_0 = 0, - MISSION_OUTLAW_NORMAL_1 = 1, - MISSION_OUTLAW_NORMAL_2 = 2, - MISSION_OUTLAW_NORMAL_3 = 3, + MISSION_OUTLAW_NORMAL_0 = 0, // in mission_template, client is magnezone + MISSION_OUTLAW_NORMAL_1 = 1, // in mission_template, client is magnezone + MISSION_OUTLAW_NORMAL_2 = 2, // in mission_template, client is magnemite + MISSION_OUTLAW_NORMAL_3 = 3, // in mission_template, client is magnemite MISSION_OUTLAW_ESCORT = 4, MISSION_OUTLAW_FLEEING = 5, + // One of 30 specific pairings (IE: Vespiquen/Combee, Golduck/Psyduck, Cloyster/Clampearl) MISSION_OUTLAW_HIDEOUT = 6, MISSION_OUTLAW_MONSTER_HOUSE = 7, }; @@ -939,6 +1056,8 @@ ENUM_8_BIT(mission_subtype_outlaw); // Mission subtype for MISSION_CHALLENGE_REQUEST enum mission_subtype_challenge { + // One of 28 specific pairings + // (IE: Charizard/Blastoise/Venusaur, Hitmontop/Hitmonchan/HitmonLee, Nidoking/Nidorina/Nidorino) MISSION_CHALLENGE_NORMAL = 0, MISSION_CHALLENGE_MEWTWO = 1, MISSION_CHALLENGE_ENTEI = 2, @@ -952,13 +1071,61 @@ enum mission_subtype_challenge { ENUM_8_BIT(mission_subtype_challenge); #pragma pack(pop) +// Mission subtype for MISSION_TREASURE_MEMO +enum mission_subtype_treasure_memo { + MISSION_TEMPLATE_DEFAULT = 0 +}; + +// This is usually stored as an 8-bit integer +#pragma pack(push, 1) +ENUM_8_BIT(mission_subtype_treasure_memo); +#pragma pack(pop) + + +// Mission subtype for MISSION_SPECIAL_EPISODE +enum mission_subtype_special_episode { + MISSION_UNK_0 = 0, + // Checked for at 0x0205E2E0 [EU] when determining mission restrictions + MISSION_UNK_1 = 1, + MISSION_UNK_2 = 2 +}; + +// This is usually stored as an 8-bit integer +#pragma pack(push, 1) +ENUM_8_BIT(mission_subtype_special_episode); +#pragma pack(pop) + +// Mission subtype for MISSION_SEVEN_TREASURE +enum mission_subtype_seven_treasure { + MISSION_UNK_0 = 0, + // Subtype 0x1 is used in the template, NOT 0x0 + MISSION_TEMPLATE_DEFAULT = 1 +}; + +// This is usually stored as an 8-bit integer +#pragma pack(push, 1) +ENUM_8_BIT(mission_subtype_seven_treasure); +#pragma pack(pop) + // The meaning of the mission subtype depends on the mission type union mission_subtype { uint8_t none; + struct mission_subtype_rescue_client_8 rescue_client; + struct mission_subtype_rescue_target_8 rescue_target; + struct mission_subtype_escort_to_target_8 escort; struct mission_subtype_explore_8 explore; + struct mission_subtype_prospect_with_client_8 prospect; + struct mission_subtype_guide_client_8 guide; + struct mission_subtype_find_item_8 find_item; + struct mission_subtype_deliver_item_8 deliver_item; + struct mission_subtype_search_for_target_8 search_target; struct mission_subtype_take_item_8 take_item; struct mission_subtype_outlaw_8 outlaw; struct mission_subtype_challenge_8 challenge; + struct mission_subtype_treasure_memo_8 treasure_memo; + // unk_0xd + struct mission_subtype_special_episode_8 special_episode; + struct mission_subtype_seven_treasure_8 seven_treasure; }; // Different types of rewards that a mission can have From 4289ebb9c249ee6ada47e789336641f42c607a33 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 1 Jun 2025 23:39:22 -0400 Subject: [PATCH 002/151] "Complete" mission_template struct --- headers/types/common/common.h | 81 +++++++++++++++++++++-------------- 1 file changed, 49 insertions(+), 32 deletions(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index 7e980dbf..be7cfc1e 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -818,47 +818,64 @@ 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 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; +struct mission_template { + // 0x0 This field is populated with a value that might be used for flavor text. + // Benford's Law suggests that it's one field, not two. As does context... + uint_16 field_0x0; + // 0x2: Called in a switch case at 0x0205DED4 [EU] during mission generation + // which affect how the template_item_data are interpreted + enum mission_template_item_case item_case; + // 0x4: Ignored if mission_template_item_case is not "0x2". + union mission_template_item_data_1 template_item_data_1; + // 0x6: Ignored if mission_template_item_case is "0x4". + // Usually stores the item_id of an item used in the mission + union mission_template_item_data_2 template_item_data_2; + // 0x8: Called in a switch case at 0x0205DED4 [EU] during mission generation + // For legendary challenge missions, is also used as a boolean to indicate whether or not + // accepting the mission unlocks its dungeon. + enum mission_template_dungeon_case dungeon_case; + // 0xA: Always Zero in the template, not referenced during mission generation. undefined field_0xa; + // 0xB: Always Zero in the template, not referenced during mission generation. 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: For challenge letter missions, stores the leader - undefined field_0x14; - undefined field_0x15; - undefined field_0x16; - undefined field_0x17; - // 0x18: For non-legendary challenge letter missions, stores the second team member - struct monster_id_16 target; - undefined field_0x1a; - undefined field_0x1b; - undefined field_0x1c; - undefined field_0x1d; - // 0x1E: For non-legendary challenge letter missions, stores the third team member - struct monster_id_16 outlaw_backup_species; + // 0xC: Dungeon this mission is restricted to, or 0xFF if none. + // Use is governed by mission_template_dungeon_case + int16_t restricted_dungeon; + // 0xE: Called in a switch case at 0x0205D8C4 [EU] during mission generation + enum mission_template_client_case client_case; + // 0x10: Ignored if mission_template_client_case is not "0x2" + union mission_template_client_data_1 template_client_data_1; + // 0x12: Ignored if mission_template_client_case is "0x4" + // For challenge letter missions, stores the leader (who is ALSO the client) + // Usually stores a monster_id + union mission_template_client_data_2 template_client_data_2; + // 0x14: Called in a looped switch case at 0x0205DBEC[EU] during mission generation + enum mission_template_target_case target_case_1; + // 0x16: Ignored if mission_template_target_case (at 0x14) is not "0x2" + union mission_template_target_data_1 template_target_data_1; + // 0x18: Ignored if mission_template_target_case (at 0x14) is "0x4" or "0x6" + // For non-legendary challenge letter missions, stores the second team member + union mission_template_target_data_2 template_target_data_2; + // 0x1A: Called in the same looped switch case at 0x0205DBEC[EU] during mission generation + enum mission_template_target_case target_backup_case_1; + // 0x1C: Ignored if mission_template_target_case (at 0x1A) is not "0x2" + union mission_template_target_data_1 target_backup_data_1; + // 0x1E: Ignored if mission_template_target_case (at 0x1A) is "0x4" or "0x6" + // For non-legendary challenge letter missions, stores the third team member + union mission_template_target_data_2 target_backup_data_2; 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 { undefined field_0x0; From 542d5d2c06d1f2e29f6b28f35c47b3409b159d3e Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 1 Jun 2025 23:39:53 -0400 Subject: [PATCH 003/151] New mission_template structs + enums --- headers/types/common/enums.h | 94 ++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) diff --git a/headers/types/common/enums.h b/headers/types/common/enums.h index ccf7cba3..51e59a7a 100644 --- a/headers/types/common/enums.h +++ b/headers/types/common/enums.h @@ -3726,6 +3726,100 @@ enum mission_rank { ENUM_8_BIT(mission_rank); #pragma pack(pop) + +enum mission_template_item_case { + // Treated same as CASE_SPECIFIC_ITEM, unused in template + CASE_UNK_0 = 0, + // mission_template_item_data_1 is ignored, and mission_template_item_data_2 is an item_id + CASE_SPECIFIC_ITEM = 1, + // mission_template_item_data_1 and mission_template_item_data_2 are indices to a table + CASE_USE_ITEM_TABLE = 2, + // Has a distinct case menu, unused in template. + CASE_UNK_3 = 3, + // mission_template_item_data_1 and mission_template_item_data_2 are ignored + CASE_NO_ITEM = 4 +} + +union mission_template_item_data_1 { + uint16_t none; + uint16_t template_item_table_id; // if CASE_USE_ITEM_TABLE +} + +union mission_template_item_data_2 { + uint16_t none; + uint16_t template_item_table_id; // if CASE_USE_ITEM_TABLE + struct item_id_16 mission_item_id; // if CASE_SPECIFIC_ITEM +} + + + +enum mission_template_dungeon_case { + CASE_SPECIFIC_OPENED = 0, // Used for Legendary Challenge Letters, among other things + CASE_SPECIFIC_CLOSED = 1, // Used for Jirachi Challenge Letter and Togetic Mission + CASE_UNK_2 = 2, // Treated same as CASE_REVEALED_AND_UNLOCKED + CASE_UNK_3 = 3, // Treated same as CASE_REVEALED_AND_UNLOCKED + CASE_RANDOM_OPEN = 4, // Used for most missions + CASE_RANDOM_CLOSED = 5 // Used for EXPLORE_NEW_DUNGEON subtype +} + +enum mission_template_client_case { + // Must be attacked in a dungeon to yield a valid mission + CASE_FIXED_CLIENT_OLD = 0, + // Does not need to be attacked in a dungeon to yield a valid mission + // Examples include magnemite/magnezone, and legendary challenge letters + CASE_FIXED_CLIENT_NEW = 1, + // mission_template_client_data_1 and mission_template_client_data_2 are indices to a table + // This determines the final client in a more restricted manner. + // Only used for MISSION_GUIDE_CLIENT in the template + CASE_TABLE_CLIENT = 2, + // Has a distinct case menu, unused in template. + CASE_UNK_3 = 3, + // Client is selected at random from GetAllPossibleMonsters. Most missions use this. + CASE_RANDOM_CLIENT = 4, +} + +union mission_template_client_data_1 { + uint16_t none; + uint16_t template_client_table_id; // if CASE_TABLE_CLIENT +} + +union mission_template_client_data_2 { + uint16_t none; // If CASE_RANDOM_CLIENT + uint16_t template_client_table_id; // if CASE_TABLE_CLIENT + struct monster_id_16 client; // if CASE_FIXED_CLIENT_OLD or CASE_FIXED_CLIENT_NEW +} + +enum mission_template_target_case { + // Must be attacked in a dungeon to yield a valid mission + CASE_FIXED_TARGET_OLD = 0, + // Does not need to be attacked in a dungeon to yield a valid mission + // Not present in template. + CASE_FIXED_TARGET_NEW = 1, + // mission_template_target_data_1 and mission_template_target_data_2 are indices to a table + // This determines the final target in a more restricted manner. + // Primarily used for outlaw missions in the template + CASE_TABLE_TARGET = 2, + // Has a distinct case menu, unused in template. + CASE_UNK_3 = 3, + // Target is selected at random from GetAllPossibleMonsters. Most missions use this. + CASE_RANDOM_TARGET = 4, + CASE_UNK_5 = 5, + // Used by HIDDEN_OUTLAW, seems identical to CASE_RANDOM_TARGET? + CASE_RANDOM_TARGET_06 = 6, +} + +union mission_template_target_data_1 { + uint16_t none; + uint16_t template_target_table_id; // if CASE_TABLE_CLIENT +} + +union mission_template_target_data_2 { + uint16_t none; // If CASE_RANDOM_TARGET or CASE_RANDOM_TARGET_06 + uint16_t template_target_table_id; // if CASE_TABLE_TARGET + struct monster_id_16 target; // if CASE_FIXED_TARGET_OLD +} + + // base-level 3D rendering variants enum render_type { // solid rectangle From d5ef888419098963e908cd7d66dbbc9fde8d5c98 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 1 Jun 2025 23:46:59 -0400 Subject: [PATCH 004/151] Update mission_rescue_bin name Now called mission_template --- headers/functions/arm9.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 426992b0..33b4de7e 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -1094,9 +1094,9 @@ void DeleteAllPossibleDungeonsList(void); int GenerateAllPossibleDeliverList(void); void DeleteAllPossibleDeliverList(void); void ClearMissionData(struct mission* mission); -bool ValidateNormalChallengeMission(struct mission_rescue_bin* valid_mission_info, +bool ValidateNormalChallengeMission(struct mission_template* valid_mission_info, struct mission* mission); -bool ValidateLegendaryChallengeMission(struct mission_rescue_bin* valid_mission_info, +bool ValidateLegendaryChallengeMission(struct mission_template* valid_mission_info, struct mission* mission); bool IsMonsterMissionAllowed(enum monster_id monster_id); bool CanMonsterBeUsedForMissionWrapper(enum monster_id monster_id); From 6f2179cf6a1cc7fd44780f0923b8d4d4ef87988e Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Mon, 2 Jun 2025 00:10:47 -0400 Subject: [PATCH 005/151] Add mission_weighted_categories struct --- headers/types/common/common.h | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index be7cfc1e..ea0bfb0c 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -820,9 +820,32 @@ ASSERT_SIZE(struct mission_floors_forbidden, 2); +struct mission_weighted_categories { + // 0x0: Weight for this category to appear on the Job Board + uint16_t job_board_weight; + // 0x2: Weight for this category to appear on the Outlaw Board + uint16_t outlaw_board_weight; + // 0x4: Weight for this category to appear from a client in Spinda's Cafe + uint16_t cafe_weight; + // 0x6: Weight for this category to appear in a bottle on the beach + uint16_t bottle_weight; + // 0x8: Minimum Guild Rank required for this category to be considered + rank minimum_rank; + // 0x9: Is 0x2 for the gabite mission category, and 0x0 otherwise. + // Likely related to SCENARIO_BALANCE_FLAG. + uint8_t gabite_flag; + // 0xA: Boolean for whether Secret Rank is required for this mission. + uint16_t secret_rank_needed; + // 0xC: Number of mission_template structs within this category + uint16_t number_of_templates; + // 0xE: Index of the first mission_template struct within this category + uint16_t first_template_index; +} +ASSERT_SIZE(struct mission_weighted_categories, 16); // 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? +// RESCUE/rescue.bin at 0x1560, where 600 of these structs exist. These are templates for mission generation, +// which are categorized by mission_weighted_categories above. struct mission_template { // 0x0 This field is populated with a value that might be used for flavor text. // Benford's Law suggests that it's one field, not two. As does context... From 464d2160275b80ba8fa72e847830b6ef7bc9c330 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Mon, 2 Jun 2025 00:21:48 -0400 Subject: [PATCH 006/151] Add comments to new struct :D --- headers/types/common/common.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index ea0bfb0c..4bbab711 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -819,8 +819,10 @@ struct mission_floors_forbidden { ASSERT_SIZE(struct mission_floors_forbidden, 2); - -struct mission_weighted_categories { +// Information valid mission; a list of these structs is stored in and directly loaded from +// RESCUE/rescue.bin at 0x6520, where 40 of these structs exist. One of these categories is picked +// at random during mission generation, after which a template is chosen from within that category. +struct mission_weighted_category { // 0x0: Weight for this category to appear on the Job Board uint16_t job_board_weight; // 0x2: Weight for this category to appear on the Outlaw Board @@ -841,11 +843,11 @@ struct mission_weighted_categories { // 0xE: Index of the first mission_template struct within this category uint16_t first_template_index; } -ASSERT_SIZE(struct mission_weighted_categories, 16); +ASSERT_SIZE(struct mission_weighted_category, 16); // Information about a valid mission; a list of these structs is stored in and directly loaded from // RESCUE/rescue.bin at 0x1560, where 600 of these structs exist. These are templates for mission generation, -// which are categorized by mission_weighted_categories above. +// which are categorized by mission_weighted_category above. struct mission_template { // 0x0 This field is populated with a value that might be used for flavor text. // Benford's Law suggests that it's one field, not two. As does context... From c91aa76db1a5234539efdf898d85aa637214ccbb Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Wed, 4 Jun 2025 14:45:32 -0400 Subject: [PATCH 007/151] Move mission types and subtypes to common/enum.h They don't really belong in dungeon/enum.h, as they are used in both modes. --- headers/types/common/enums.h | 308 +++++++++++++++++++++++++++++++++++ 1 file changed, 308 insertions(+) diff --git a/headers/types/common/enums.h b/headers/types/common/enums.h index 51e59a7a..8c65ae14 100644 --- a/headers/types/common/enums.h +++ b/headers/types/common/enums.h @@ -3726,6 +3726,314 @@ enum mission_rank { ENUM_8_BIT(mission_rank); #pragma pack(pop) +// Mission type on a floor +enum mission_type { + MISSION_RESCUE_CLIENT = 0, + MISSION_RESCUE_TARGET = 1, + MISSION_ESCORT_TO_TARGET = 2, + MISSION_EXPLORE_WITH_CLIENT = 3, + MISSION_PROSPECT_WITH_CLIENT = 4, + MISSION_GUIDE_CLIENT = 5, + MISSION_FIND_ITEM = 6, + MISSION_DELIVER_ITEM = 7, + MISSION_SEARCH_FOR_TARGET = 8, + MISSION_TAKE_ITEM_FROM_OUTLAW = 9, + MISSION_ARREST_OUTLAW = 10, + MISSION_CHALLENGE_REQUEST = 11, + MISSION_TREASURE_MEMO = 12, + MISSION_TYPE_UNK_0xD = 13, + MISSION_SPECIAL_EPISODE = 14, + MISSION_TYPE_SEVEN_TREASURE = 15 +}; + +// This is usually stored as an 8-bit integer +#pragma pack(push, 1) +ENUM_8_BIT(mission_type); +#pragma pack(pop) + +// Mission subtype for MISSION_RESCUE_CLIENT +enum mission_subtype_rescue_client { + MISSION_TEMPLATE_DEFAULT = 0 // Random Client +}; + +// This is usually stored as an 8-bit integer +#pragma pack(push, 1) +ENUM_8_BIT(mission_subtype_rescue_client); +#pragma pack(pop) + +// Mission subtype for MISSION_RESCUE_TARGET +// The distinction is mainly for dialogue +enum mission_subtype_rescue_target { + // Client and Target are randomly selected + MISSION_CLIENT_TARGET_RANDOM = 0, + // Client is the evolved form of the target + // (IE: Beedrill/Weedle, Aggron/Aron) + MISSION_CLIENT_TARGET_CHILD = 1, + // Client and Target are deeply similar + // (IE: Dodrio/Exeggutor, Muk/Swalot, Magikarp/Feebas) + MISSION_CLIENT_TARGET_SIMILAR_FRIENDS = 2, + // Client and Target are lovers or rivals + // (IE: Nidoking/Nidoqueen, Seviper/Zangoose, Volbeat/Illumise) + MISSION_CLIENT_TARGET_LOVERS_RIVALS = 3 +}; + +// This is usually stored as an 8-bit integer +#pragma pack(push, 1) +ENUM_8_BIT(mission_subtype_rescue_target); +#pragma pack(pop) + +// Mission subtype for MISSION_ESCORT_TO_TARGET +enum mission_subtype_escort_to_target { + // Client and Target are randomly selected + MISSION_CLIENT_TARGET_RANDOM = 0, + // Client and Target are counterparts + // (IE: Nidoran-M/Nidoran-F, Volbeat/Illumise, Miltank/Tauros) + MISSION_CLIENT_TARGET_SPECIFIC = 1 +}; + +// This is usually stored as an 8-bit integer +#pragma pack(push, 1) +ENUM_8_BIT(mission_subtype_escort_to_target); +#pragma pack(pop) + +// Mission subtype for MISSION_EXPLORE_WITH_CLIENT +enum mission_subtype_explore { + MISSION_EXPLORE_NORMAL = 0, + MISSION_EXPLORE_SEALED_CHAMBER = 1, + MISSION_EXPLORE_GOLDEN_CHAMBER = 2, + MISSION_EXPLORE_NEW_DUNGEON = 3, +}; + +// This is usually stored as an 8-bit integer +#pragma pack(push, 1) +ENUM_8_BIT(mission_subtype_explore); +#pragma pack(pop) + +// Mission subtype for MISSION_PROSPECT_WITH_CLIENT +// There seems to be no distinction between prospecting +// for a random or specific item in this subtype. +enum mission_subtype_prospect_with_client { + MISSION_TEMPLATE_DEFAULT = 0 +}; + +// This is usually stored as an 8-bit integer +#pragma pack(push, 1) +ENUM_8_BIT(mission_subtype_prospect_with_client); +#pragma pack(pop) + + +// Mission subtype for MISSION_GUIDE_CLIENT +enum mission_subtype_guide_client { + MISSION_TEMPLATE_DEFAULT = 0 +}; + +// This is usually stored as an 8-bit integer +#pragma pack(push, 1) +ENUM_8_BIT(mission_subtype_guide_client); +#pragma pack(pop) + +// Mission subtype for MISSION_FIND_ITEM +enum mission_subtype_find_item { + // Item Table parameters are 0x16, 0x00 + // Client is random + MISSION_ITEM_TABLE_16_00 = 0, + // Item Table parameters are 0x14, 0x16 + // Client is random + MISSION_ITEM_TABLE_14_16 = 1, + // Item is an evolution item for the client + // (IE: Gloom/Leaf Stone, Dusclops/Reaper Cloth, Magmar/Magmarizer) + MISSION_ITEM_EVOLVES_CLIENT = 2, + // Item is a gummi of one of the client's types + // (IE: Flaafy/Yellow Gummi, Baltoy/Brown Gummi, Dratini/Royal Gummi) + MISSION_ITEM_CLIENT_FAVORITE_GUMMI = 3, + // This is the special Togetic Mission that unlocks Labyrinth Cave + MISSION_TOGETIC_GABITE_SCALE = 4 +}; + +// This is usually stored as an 8-bit integer +#pragma pack(push, 1) +ENUM_8_BIT(mission_subtype_find_item); +#pragma pack(pop) + +// Mission subtype for MISSION_DELIVER_ITEM +enum mission_subtype_deliver_item { + // Random Client, Item from table 0x16 0x00 + MISSION_TEMPLATE_DEFAULT = 0 +}; + +// This is usually stored as an 8-bit integer +#pragma pack(push, 1) +ENUM_8_BIT(mission_subtype_deliver_item); +#pragma pack(pop) + + +// Mission subtype for MISSION_SEARCH_FOR_TARGET +enum mission_subtype_search_for_target { + MISSION_TEMPLATE_DEFAULT = 0 // Random Client and Target +}; + +// This is usually stored as an 8-bit integer +#pragma pack(push, 1) +ENUM_8_BIT(mission_subtype_search_for_target); +#pragma pack(pop) + +// Mission subtype for MISSION_TAKE_ITEM_FROM_OUTLAW +// Random Client and Outlaw. NOT Magnezone/Magnemite +enum mission_subtype_take_item { + MISSION_TAKE_ITEM_NORMAL_OUTLAW = 0, + MISSION_TAKE_ITEM_HIDDEN_OUTLAW = 1, + MISSION_TAKE_ITEM_FLEEING_OUTLAW = 2, +}; + +// This is usually stored as an 8-bit integer +#pragma pack(push, 1) +ENUM_8_BIT(mission_subtype_take_item); +#pragma pack(pop) + +// Mission subtype for MISSION_ARREST_OUTLAW +// 0-3 all occur naturally in-game, but don't seem to have any obvious differences? +// The distinction might be intensity or perceived difficulty? +enum mission_subtype_outlaw { + MISSION_OUTLAW_NORMAL_0 = 0, // in mission_template, client is magnezone + MISSION_OUTLAW_NORMAL_1 = 1, // in mission_template, client is magnezone + MISSION_OUTLAW_NORMAL_2 = 2, // in mission_template, client is magnemite + MISSION_OUTLAW_NORMAL_3 = 3, // in mission_template, client is magnemite + MISSION_OUTLAW_ESCORT = 4, + MISSION_OUTLAW_FLEEING = 5, + // One of 30 specific pairings (IE: Vespiquen/Combee, Golduck/Psyduck, Cloyster/Clampearl) + MISSION_OUTLAW_HIDEOUT = 6, + MISSION_OUTLAW_MONSTER_HOUSE = 7, +}; + +// This is usually stored as an 8-bit integer +#pragma pack(push, 1) +ENUM_8_BIT(mission_subtype_outlaw); +#pragma pack(pop) + +// Mission subtype for MISSION_CHALLENGE_REQUEST +enum mission_subtype_challenge { + // One of 28 specific pairings + // (IE: Charizard/Blastoise/Venusaur, Hitmontop/Hitmonchan/HitmonLee, Nidoking/Nidorina/Nidorino) + MISSION_CHALLENGE_NORMAL = 0, + MISSION_CHALLENGE_MEWTWO = 1, + MISSION_CHALLENGE_ENTEI = 2, + MISSION_CHALLENGE_RAIKOU = 3, + MISSION_CHALLENGE_SUICUNE = 4, + MISSION_CHALLENGE_JIRACHI = 5, +}; + +// This is usually stored as an 8-bit integer +#pragma pack(push, 1) +ENUM_8_BIT(mission_subtype_challenge); +#pragma pack(pop) + +// Mission subtype for MISSION_TREASURE_MEMO +enum mission_subtype_treasure_memo { + MISSION_TEMPLATE_DEFAULT = 0 +}; + +// This is usually stored as an 8-bit integer +#pragma pack(push, 1) +ENUM_8_BIT(mission_subtype_treasure_memo); +#pragma pack(pop) + + +// Mission subtype for MISSION_SPECIAL_EPISODE +enum mission_subtype_special_episode { + MISSION_UNK_0 = 0, + // Checked for at 0x0205E2E0 [EU] when determining mission restrictions + MISSION_UNK_1 = 1, + MISSION_UNK_2 = 2 +}; + +// This is usually stored as an 8-bit integer +#pragma pack(push, 1) +ENUM_8_BIT(mission_subtype_special_episode); +#pragma pack(pop) + +// Mission subtype for MISSION_SEVEN_TREASURE +enum mission_subtype_seven_treasure { + MISSION_UNK_0 = 0, + // Subtype 0x1 is used in the template, NOT 0x0 + MISSION_TEMPLATE_DEFAULT = 1 +}; + +// This is usually stored as an 8-bit integer +#pragma pack(push, 1) +ENUM_8_BIT(mission_subtype_seven_treasure); +#pragma pack(pop) + +// The meaning of the mission subtype depends on the mission type +union mission_subtype { + uint8_t none; + struct mission_subtype_rescue_client_8 rescue_client; + struct mission_subtype_rescue_target_8 rescue_target; + struct mission_subtype_escort_to_target_8 escort; + struct mission_subtype_explore_8 explore; + struct mission_subtype_prospect_with_client_8 prospect; + struct mission_subtype_guide_client_8 guide; + struct mission_subtype_find_item_8 find_item; + struct mission_subtype_deliver_item_8 deliver_item; + struct mission_subtype_search_for_target_8 search_target; + struct mission_subtype_take_item_8 take_item; + struct mission_subtype_outlaw_8 outlaw; + struct mission_subtype_challenge_8 challenge; + struct mission_subtype_treasure_memo_8 treasure_memo; + // unk_0xd + struct mission_subtype_special_episode_8 special_episode; + struct mission_subtype_seven_treasure_8 seven_treasure; +}; + +// Different types of rewards that a mission can have +enum mission_reward_type { + MISSION_REWARD_MONEY = 0, + MISSION_REWARD_MONEY_AND_MORE = 1, // Money + (?) + MISSION_REWARD_ITEM = 2, + MISSION_REWARD_ITEM_AND_MORE = 3, // Item + (?) + MISSION_REWARD_ITEM_HIDDEN = 4, // Item, displayed as "(?)" + MISSION_REWARD_MONEY_HIDDEN = 5, // Money, displayed as "(?)" + // Either an egg or the client requests to join the team, displayed as "(?)" + MISSION_REWARD_SPECIAL = 6, +}; +// This is usually stored as an 8-bit integer +#pragma pack(push, 1) +ENUM_8_BIT(mission_reward_type); +#pragma pack(pop) + +// Different types of restrictions that a mission can have +enum mission_restriction_type { + MISSION_RESTRICTION_NONE = 0, + MISSION_RESTRICTION_TYPE = 1, // Requires a pokémon of a certain type on the team + MISSION_RESTRICTION_MONSTER = 2, // Requires a certain pokémon on the team +}; +// This is usually stored as an 8-bit integer +#pragma pack(push, 1) +ENUM_8_BIT(mission_restriction_type); +#pragma pack(pop) + +// The restriction of a mission can be a monster ID or a type ID +union mission_restriction { + struct monster_id_16 monster_id; + struct type_id_8 type_id; +}; + +// Represents the different statuses that a mission can have +enum mission_status { + MISSION_STATUS_INVALID = 0, // Used for empty mission slots + MISSION_STATUS_UNK_1 = 1, // The mission won't display a status + MISSION_STATUS_UNK_2 = 2, // The mission won't display a status + MISSION_STATUS_UNK_3 = 3, // The mission won't display a status + MISSION_STATUS_SUSPENDED = 4, + MISSION_STATUS_ACCEPTED = 5, + MISSION_STATUS_DONE = 6, + MISSION_STATUS_UNK_7 = 7, // Shows up as "accepted" + MISSION_STATUS_UNK_8 = 8, // Shows up as "accepted" +}; +// This is usually stored as an 8-bit integer +#pragma pack(push, 1) +ENUM_8_BIT(mission_status); +#pragma pack(pop) + enum mission_template_item_case { // Treated same as CASE_SPECIFIC_ITEM, unused in template From aba0f44bb2e597eb7e43e37214e683cc778d9c08 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Wed, 4 Jun 2025 14:46:05 -0400 Subject: [PATCH 008/151] Port mission types/subtypes to common/enums.h (2) see previous commit --- headers/types/dungeon_mode/enums.h | 307 ----------------------------- 1 file changed, 307 deletions(-) diff --git a/headers/types/dungeon_mode/enums.h b/headers/types/dungeon_mode/enums.h index 31a2c62c..1b1fe30f 100644 --- a/headers/types/dungeon_mode/enums.h +++ b/headers/types/dungeon_mode/enums.h @@ -870,313 +870,6 @@ enum dungeon_objective { ENUM_8_BIT(dungeon_objective); #pragma pack(pop) -// Mission type on a floor -enum mission_type { - MISSION_RESCUE_CLIENT = 0, - MISSION_RESCUE_TARGET = 1, - MISSION_ESCORT_TO_TARGET = 2, - MISSION_EXPLORE_WITH_CLIENT = 3, - MISSION_PROSPECT_WITH_CLIENT = 4, - MISSION_GUIDE_CLIENT = 5, - MISSION_FIND_ITEM = 6, - MISSION_DELIVER_ITEM = 7, - MISSION_SEARCH_FOR_TARGET = 8, - MISSION_TAKE_ITEM_FROM_OUTLAW = 9, - MISSION_ARREST_OUTLAW = 10, - MISSION_CHALLENGE_REQUEST = 11, - MISSION_TREASURE_MEMO = 12, - MISSION_TYPE_UNK_0xD = 13, - MISSION_SPECIAL_EPISODE = 14, - MISSION_TYPE_SEVEN_TREASURE = 15 -}; - -// This is usually stored as an 8-bit integer -#pragma pack(push, 1) -ENUM_8_BIT(mission_type); -#pragma pack(pop) - -// Mission subtype for MISSION_RESCUE_CLIENT -enum mission_subtype_rescue_client { - MISSION_TEMPLATE_DEFAULT = 0 // Random Client -}; - -// This is usually stored as an 8-bit integer -#pragma pack(push, 1) -ENUM_8_BIT(mission_subtype_rescue_client); -#pragma pack(pop) - -// Mission subtype for MISSION_RESCUE_TARGET -// The distinction is mainly for dialogue -enum mission_subtype_rescue_target { - // Client and Target are randomly selected - MISSION_CLIENT_TARGET_RANDOM = 0, - // Client is the evolved form of the target - // (IE: Beedrill/Weedle, Aggron/Aron) - MISSION_CLIENT_TARGET_CHILD = 1, - // Client and Target are deeply similar - // (IE: Dodrio/Exeggutor, Muk/Swalot, Magikarp/Feebas) - MISSION_CLIENT_TARGET_SIMILAR_FRIENDS = 2, - // Client and Target are lovers or rivals - // (IE: Nidoking/Nidoqueen, Seviper/Zangoose, Volbeat/Illumise) - MISSION_CLIENT_TARGET_LOVERS_RIVALS = 3 -}; - -// This is usually stored as an 8-bit integer -#pragma pack(push, 1) -ENUM_8_BIT(mission_subtype_rescue_target); -#pragma pack(pop) - -// Mission subtype for MISSION_ESCORT_TO_TARGET -enum mission_subtype_escort_to_target { - // Client and Target are randomly selected - MISSION_CLIENT_TARGET_RANDOM = 0, - // Client and Target are counterparts - // (IE: Nidoran-M/Nidoran-F, Volbeat/Illumise, Miltank/Tauros) - MISSION_CLIENT_TARGET_SPECIFIC = 1 -}; - -// This is usually stored as an 8-bit integer -#pragma pack(push, 1) -ENUM_8_BIT(mission_subtype_escort_to_target); -#pragma pack(pop) - -// Mission subtype for MISSION_EXPLORE_WITH_CLIENT -enum mission_subtype_explore { - MISSION_EXPLORE_NORMAL = 0, - MISSION_EXPLORE_SEALED_CHAMBER = 1, - MISSION_EXPLORE_GOLDEN_CHAMBER = 2, - MISSION_EXPLORE_NEW_DUNGEON = 3, -}; - -// This is usually stored as an 8-bit integer -#pragma pack(push, 1) -ENUM_8_BIT(mission_subtype_explore); -#pragma pack(pop) - -// Mission subtype for MISSION_PROSPECT_WITH_CLIENT -// There seems to be no distinction between prospecting -// for a random or specific item in this subtype. -enum mission_subtype_prospect_with_client { - MISSION_TEMPLATE_DEFAULT = 0 -}; - -// This is usually stored as an 8-bit integer -#pragma pack(push, 1) -ENUM_8_BIT(mission_subtype_prospect_with_client); -#pragma pack(pop) - - -// Mission subtype for MISSION_GUIDE_CLIENT -enum mission_subtype_guide_client { - MISSION_TEMPLATE_DEFAULT = 0 -}; - -// This is usually stored as an 8-bit integer -#pragma pack(push, 1) -ENUM_8_BIT(mission_subtype_guide_client); -#pragma pack(pop) - -// Mission subtype for MISSION_FIND_ITEM -enum mission_subtype_find_item { - // Item Table parameters are 0x16, 0x00 - // Client is random - MISSION_ITEM_TABLE_16_00 = 0, - // Item Table parameters are 0x14, 0x16 - // Client is random - MISSION_ITEM_TABLE_14_16 = 1, - // Item is an evolution item for the client - // (IE: Gloom/Leaf Stone, Dusclops/Reaper Cloth, Magmar/Magmarizer) - MISSION_ITEM_EVOLVES_CLIENT = 2, - // Item is a gummi of one of the client's types - // (IE: Flaafy/Yellow Gummi, Baltoy/Brown Gummi, Dratini/Royal Gummi) - MISSION_ITEM_CLIENT_FAVORITE_GUMMI = 3, - // This is the special Togetic Mission that unlocks Labyrinth Cave - MISSION_TOGETIC_GABITE_SCALE = 4 -}; - -// This is usually stored as an 8-bit integer -#pragma pack(push, 1) -ENUM_8_BIT(mission_subtype_find_item); -#pragma pack(pop) - -// Mission subtype for MISSION_DELIVER_ITEM -enum mission_subtype_deliver_item { - // Random Client, Item from table 0x16 0x00 - MISSION_TEMPLATE_DEFAULT = 0 -}; - -// This is usually stored as an 8-bit integer -#pragma pack(push, 1) -ENUM_8_BIT(mission_subtype_deliver_item); -#pragma pack(pop) - - -// Mission subtype for MISSION_SEARCH_FOR_TARGET -enum mission_subtype_search_for_target { - MISSION_TEMPLATE_DEFAULT = 0 // Random Client and Target -}; - -// This is usually stored as an 8-bit integer -#pragma pack(push, 1) -ENUM_8_BIT(mission_subtype_search_for_target); -#pragma pack(pop) - -// Mission subtype for MISSION_TAKE_ITEM_FROM_OUTLAW -// Random Client and Outlaw. NOT Magnezone/Magnemite -enum mission_subtype_take_item { - MISSION_TAKE_ITEM_NORMAL_OUTLAW = 0, - MISSION_TAKE_ITEM_HIDDEN_OUTLAW = 1, - MISSION_TAKE_ITEM_FLEEING_OUTLAW = 2, -}; - -// This is usually stored as an 8-bit integer -#pragma pack(push, 1) -ENUM_8_BIT(mission_subtype_take_item); -#pragma pack(pop) - -// Mission subtype for MISSION_ARREST_OUTLAW -// 0-3 all occur naturally in-game, but don't seem to have any obvious differences? -// The distinction might be intensity or perceived difficulty? -enum mission_subtype_outlaw { - MISSION_OUTLAW_NORMAL_0 = 0, // in mission_template, client is magnezone - MISSION_OUTLAW_NORMAL_1 = 1, // in mission_template, client is magnezone - MISSION_OUTLAW_NORMAL_2 = 2, // in mission_template, client is magnemite - MISSION_OUTLAW_NORMAL_3 = 3, // in mission_template, client is magnemite - MISSION_OUTLAW_ESCORT = 4, - MISSION_OUTLAW_FLEEING = 5, - // One of 30 specific pairings (IE: Vespiquen/Combee, Golduck/Psyduck, Cloyster/Clampearl) - MISSION_OUTLAW_HIDEOUT = 6, - MISSION_OUTLAW_MONSTER_HOUSE = 7, -}; - -// This is usually stored as an 8-bit integer -#pragma pack(push, 1) -ENUM_8_BIT(mission_subtype_outlaw); -#pragma pack(pop) - -// Mission subtype for MISSION_CHALLENGE_REQUEST -enum mission_subtype_challenge { - // One of 28 specific pairings - // (IE: Charizard/Blastoise/Venusaur, Hitmontop/Hitmonchan/HitmonLee, Nidoking/Nidorina/Nidorino) - MISSION_CHALLENGE_NORMAL = 0, - MISSION_CHALLENGE_MEWTWO = 1, - MISSION_CHALLENGE_ENTEI = 2, - MISSION_CHALLENGE_RAIKOU = 3, - MISSION_CHALLENGE_SUICUNE = 4, - MISSION_CHALLENGE_JIRACHI = 5, -}; - -// This is usually stored as an 8-bit integer -#pragma pack(push, 1) -ENUM_8_BIT(mission_subtype_challenge); -#pragma pack(pop) - -// Mission subtype for MISSION_TREASURE_MEMO -enum mission_subtype_treasure_memo { - MISSION_TEMPLATE_DEFAULT = 0 -}; - -// This is usually stored as an 8-bit integer -#pragma pack(push, 1) -ENUM_8_BIT(mission_subtype_treasure_memo); -#pragma pack(pop) - - -// Mission subtype for MISSION_SPECIAL_EPISODE -enum mission_subtype_special_episode { - MISSION_UNK_0 = 0, - // Checked for at 0x0205E2E0 [EU] when determining mission restrictions - MISSION_UNK_1 = 1, - MISSION_UNK_2 = 2 -}; - -// This is usually stored as an 8-bit integer -#pragma pack(push, 1) -ENUM_8_BIT(mission_subtype_special_episode); -#pragma pack(pop) - -// Mission subtype for MISSION_SEVEN_TREASURE -enum mission_subtype_seven_treasure { - MISSION_UNK_0 = 0, - // Subtype 0x1 is used in the template, NOT 0x0 - MISSION_TEMPLATE_DEFAULT = 1 -}; - -// This is usually stored as an 8-bit integer -#pragma pack(push, 1) -ENUM_8_BIT(mission_subtype_seven_treasure); -#pragma pack(pop) - -// The meaning of the mission subtype depends on the mission type -union mission_subtype { - uint8_t none; - struct mission_subtype_rescue_client_8 rescue_client; - struct mission_subtype_rescue_target_8 rescue_target; - struct mission_subtype_escort_to_target_8 escort; - struct mission_subtype_explore_8 explore; - struct mission_subtype_prospect_with_client_8 prospect; - struct mission_subtype_guide_client_8 guide; - struct mission_subtype_find_item_8 find_item; - struct mission_subtype_deliver_item_8 deliver_item; - struct mission_subtype_search_for_target_8 search_target; - struct mission_subtype_take_item_8 take_item; - struct mission_subtype_outlaw_8 outlaw; - struct mission_subtype_challenge_8 challenge; - struct mission_subtype_treasure_memo_8 treasure_memo; - // unk_0xd - struct mission_subtype_special_episode_8 special_episode; - struct mission_subtype_seven_treasure_8 seven_treasure; -}; - -// Different types of rewards that a mission can have -enum mission_reward_type { - MISSION_REWARD_MONEY = 0, - MISSION_REWARD_MONEY_AND_MORE = 1, // Money + (?) - MISSION_REWARD_ITEM = 2, - MISSION_REWARD_ITEM_AND_MORE = 3, // Item + (?) - MISSION_REWARD_ITEM_HIDDEN = 4, // Item, displayed as "(?)" - MISSION_REWARD_MONEY_HIDDEN = 5, // Money, displayed as "(?)" - // Either an egg or the client requests to join the team, displayed as "(?)" - MISSION_REWARD_SPECIAL = 6, -}; -// This is usually stored as an 8-bit integer -#pragma pack(push, 1) -ENUM_8_BIT(mission_reward_type); -#pragma pack(pop) - -// Different types of restrictions that a mission can have -enum mission_restriction_type { - MISSION_RESTRICTION_NONE = 0, - MISSION_RESTRICTION_TYPE = 1, // Requires a pokémon of a certain type on the team - MISSION_RESTRICTION_MONSTER = 2, // Requires a certain pokémon on the team -}; -// This is usually stored as an 8-bit integer -#pragma pack(push, 1) -ENUM_8_BIT(mission_restriction_type); -#pragma pack(pop) - -// The restriction of a mission can be a monster ID or a type ID -union mission_restriction { - struct monster_id_16 monster_id; - struct type_id_8 type_id; -}; - -// Represents the different statuses that a mission can have -enum mission_status { - MISSION_STATUS_INVALID = 0, // Used for empty mission slots - MISSION_STATUS_UNK_1 = 1, // The mission won't display a status - MISSION_STATUS_UNK_2 = 2, // The mission won't display a status - MISSION_STATUS_UNK_3 = 3, // The mission won't display a status - MISSION_STATUS_SUSPENDED = 4, - MISSION_STATUS_ACCEPTED = 5, - MISSION_STATUS_DONE = 6, - MISSION_STATUS_UNK_7 = 7, // Shows up as "accepted" - MISSION_STATUS_UNK_8 = 8, // Shows up as "accepted" -}; -// This is usually stored as an 8-bit integer -#pragma pack(push, 1) -ENUM_8_BIT(mission_status); -#pragma pack(pop) // The cause of a monster taking damage, not including the move case. // These codes should all be greater than any move ID. From 7747fd9a003702fc189d1b9a921cc290fb2682ac Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Wed, 4 Jun 2025 14:53:13 -0400 Subject: [PATCH 009/151] Complete mission_template struct Finally, all non-zero fields are accounted for! We have TEXT STRINGS! --- headers/types/common/common.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index 4bbab711..28978b4f 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -819,6 +819,7 @@ struct mission_floors_forbidden { ASSERT_SIZE(struct mission_floors_forbidden, 2); + // Information valid mission; a list of these structs is stored in and directly loaded from // RESCUE/rescue.bin at 0x6520, where 40 of these structs exist. One of these categories is picked // at random during mission generation, after which a template is chosen from within that category. @@ -833,9 +834,9 @@ struct mission_weighted_category { uint16_t bottle_weight; // 0x8: Minimum Guild Rank required for this category to be considered rank minimum_rank; - // 0x9: Is 0x2 for the gabite mission category, and 0x0 otherwise. - // Likely related to SCENARIO_BALANCE_FLAG. - uint8_t gabite_flag; + // 0x9: Minimum SCENARIO_BALANCE_FLAG required for this category to be considered. + // Is 0x2 for the gabite scale mission category, and 0x0 for all other categories. + uint8_t min_scenario_balance; // 0xA: Boolean for whether Secret Rank is required for this mission. uint16_t secret_rank_needed; // 0xC: Number of mission_template structs within this category @@ -849,9 +850,10 @@ ASSERT_SIZE(struct mission_weighted_category, 16); // RESCUE/rescue.bin at 0x1560, where 600 of these structs exist. These are templates for mission generation, // which are categorized by mission_weighted_category above. struct mission_template { - // 0x0 This field is populated with a value that might be used for flavor text. - // Benford's Law suggests that it's one field, not two. As does context... - uint_16 field_0x0; + // 0x0: Points to an index for mission_title_groups and mission_summary_groups + // These structs contain data for an appropriate range of titles/summaries + // for the mission template from MISSION_STRING_IDS. + uint_16 text_string_offset; // 0x2: Called in a switch case at 0x0205DED4 [EU] during mission generation // which affect how the template_item_data are interpreted enum mission_template_item_case item_case; From 0255bc30b89b8a452d390df1f064d09d95a2cbaf Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 6 Jun 2025 13:59:42 -0400 Subject: [PATCH 010/151] Create rescue.h Documentation for the rescue.bin file --- headers/types/files/rescue.h | 276 +++++++++++++++++++++++++++++++++++ 1 file changed, 276 insertions(+) create mode 100644 headers/types/files/rescue.h diff --git a/headers/types/files/rescue.h b/headers/types/files/rescue.h new file mode 100644 index 00000000..cd9f6143 --- /dev/null +++ b/headers/types/files/rescue.h @@ -0,0 +1,276 @@ +#ifndef HEADERS_TYPES_FILES_RESCUE_H_ +#define HEADERS_TYPES_FILES_RESCUE_H_ + +#include "../common/util.h" // (?) +#include "../common/common.h" +#include "../common/enums.h" + +// 0x0 in rescue.bin +struct rescue_header { + struct rescue_str_variant_table* variant_table_pointer; // 0x00 + struct rescue_str_continuity_table* continuity_table_pointer; // 0x04 + struct rescue_item_tables* item_tables_pointer; // 0x08 + struct rescue_monster_tables* monster_tables_pointer; // 0x0C + struct mission_templates_table* template_table_pointer; // 0x10 + struct mission_categories_table* category_table_pointer; // 0x14 + // Likely Padding + undefined field1_0x18; + undefined field1_0x19; + undefined field1_0x1A; + undefined field1_0x1B; + undefined field1_0x1C; + undefined field1_0x1D; + undefined field1_0x1E; + undefined field1_0x1F; +}; + +ASSERT_SIZE(struct rescue_header, 32); + + +// 0x20 in rescue.bin +struct rescue_str_variant_table { + struct rescue_str_variant_group string_groups[481]; + uint32_t padding[7]; // 0x00000000 +} + +ASSERT_SIZE(struct rescue_str_variant_table, 1952); + + + +struct rescue_str_variant_group { + // 0x0: Index of MISSION_STRING_IDS the group starts from. + uint16_t starting_index; + // 0x2: Number of other MISSION_STRING_ID entries the group contains. A random int on the range + // [0, group_size) is added to starting_index to produce the final MISSION_STRING_ID entry. + // This final index is then used again to select an index in rescue_str_continuity_table + uint16_t group_size; +} +ASSERT_SIZE(struct rescue_str_variant_group, 4); + + +// 0x7C0 in rescue.bin +struct rescue_str_continuity_table { + struct rescue_str_continuity continuities[964]; +} + +ASSERT_SIZE(struct rescue_str_continuity_table, 1952); + + +// Determines the entry in rescue_str_variant_table for the next string in sequence, if any. +struct rescue_str_continuity { + /* This field is interpreted as follows: + * If 0xFFFF, there is no next string. + * If 0x1NNN, index 0xNNN is for a summary string, NOT a title string. + * If 0x0NNN, index 0xNNN is for a title string, NOT a summary string. + */ + uint16_t next_variant_table_id; +} + +ASSERT_SIZE(struct rescue_str_continuity, 4); + + +// Item tables used by certain mission templates. This could be considered as one table, +// though in the templates themselves, none of the ranges overlap. +// 0xF48 in rescue.bin +struct rescue_item_tables { + // [0, 22): The "Common Table" seems to be for easily obtainable items of low value. + // Used by TAKE_ITEM_FROM_OUTLAW and DELIVER_ITEM templates, as well as the FIND_ITEM + // template with the MISSION_ITEM_COMMON_TABLE subtype. Mostly Seeds, Berries, and Orbs. + // Life Seeds, Sitrus Berries, and Reviver Seeds are on this table, for some reason. + struct item_id_16 common_table[22]; + // [22, 42): The "Rare Table" seems to be for higher-value items, more suitable for their mission types. + // Used only by the PROSPECT_WITH_CLIENT subtype, as well as the FIND_ITEM template with the + // MISSION_ITEM_RARE_TABLE subtype. Consists mostly of Gummis, but Lost Loot is also present. + // Sitrus Berries and Reviver Seeds are ALSO on this table, for some reason. + struct item_id_16 rare_table[20]; + // If this is an item table, it's always zero and unused by any template. + uint16_t padding[2]; +} + +ASSERT_SIZE(struct rescue_item_tables, 176); + +// Pokemon tables used by certain mission templates. This could be considered as one table, +// though barring one exception, none of the ranges overlap. +// 0xFA0 in rescue.bin +struct rescue_monster_tables { + // [0, 65): Used exclusively for the OUTLAW_NORMAL_2 mission subtype, and consists mostly of middle-stage + // evolutions, such as Flaafy and Pidgeotto, with a few of the stronger fully-evolved pokemon like Masquerain and Beautifly. + // Seem to be stronger on average than those in normal_outlaw_3_table. + struct monster_id_16 normal_outlaw_2_table[65]; + // [65, 106): Used exclusively for the OUTLAW_NORMAL_2 mission subtype, and consists mostly of basic + // Pokemon, such as Lotad, Teddiursa, and Abra. Also contains all 3 forms of Burmy and Wormadam. + struct monster_id_16 normal_outlaw_3_table[41]; + // [106, 167): Used exclusively for fleeing outlaws, such as OUTLAW_FLEEING and TAKE_ITEM_FLEEING_OUTLAW. + // Consists mostly of cowardly Pokemon such as Magikarp, Dunsparce, or Luvdisc, as well as fast Pokemon like + // Doduo, Ponyta, Ninjask, and Yanmega. + struct monster_id_16 fleeing_outlaw_table[61]; + // [167, 211): Used exclusively for the OUTLAW_MONSTER_HOUSE mission subtype, and consists mostly of evolved Pokemon + // such as Tyranitar, Nidoking, Honchkrow, and Metagross. Manetric, Electrike, Chinchou, and Lanturn are also present. + struct monster_id_16 monster_house_outlaw_table[44]; + // [211, 244): Used for the OUTLAW_ESCORT mission subtype, and consists mostly of intimidating pokemon such as + // Arbok, Absol, Sharpedo, and Drapion, as well as pseudo-legendaries such as Metagross, Dragonite, Garchomp, Tyranitar, + // and Salamence. Every Pokemon on this list is fully evolved if it has evolutions. This list is the same regardless of + // Whether Magnezone or Magnemite accompanies you. Overlaps with the range used by the GUIDE_CLIENT template. + + // [227, 471): Used for the GUIDE_CLIENT mission type, and consists of a wide variety of Pokemon defying categorization. + // Outside of the overlap, the list seems to contain mostly weaker Pokemon. There is one invalid Pokemon entry in this table, 0x0CBE. + // Likely intended to be Aipom (0xBE). Should be filtered out by mission generation. + // Because these two tables overlap, it is most efficient to merge them in this struct. + struct monster_id_16 magnet_escort_and_guide_client_table[260]; + // [471, 582): Used for the OUTLAW_NORMAL_0 mission type, as well as one of the TAKE_ITEM_NORMAL_OUTLAW templates. + // Consists mostly of unevolved Pokemon, such as Anorith, Weedle, Magby, and Buizel. Outliers exist, such as Victreebel, + // Hitmonlee, and Hitmonchan, but the vast majority are unevolved. Seem to be weaker on average than the normal_outlaw_1_table. + struct monster_id_16 normal_outlaw_0_table[111]; + // [582, 725): Used for the OUTLAW_NORMAL_1 mission type, as well as the other TAKE_ITEM_NORMAL_OUTLAW template. + // Consists mostly of fully-evolved Pokemon, such as Blaziken, Tyranitar, Torterra, and Gengar. Outliers exists, + // such as Gligar, Golbat, Cubone, and Cranidos. + struct monster_id_16 normal_outlaw_1_table[143]; + uint16_t padding[11]; +} + +ASSERT_SIZE(struct rescue_monster_tables, 2944); + + + + +struct mission_templates_table { + struct mission_template hideout_magnemite_1[8]; + struct mission_template hideout_magnemite_2[5]; + struct mission_template hideout_magnezone_1[9]; + struct mission_template hideout_magnezone_2[8]; + struct mission_template outlaw_monster_house[1]; + struct mission_template magnemite_escort[1]; + struct mission_template magnezone_escort[1]; + struct mission_template arrest_fleeing[1]; + struct mission_template arrest_normal_0[1]; + struct mission_template arrest_normal_1[1]; + struct mission_template arrest_normal_2[1]; + struct mission_template arrest_normal_3[1]; + struct mission_template escort_random[1]; + struct mission_template escort_specific[12]; + struct mission_template explore_normal[1]; + struct mission_template explore_sealed[1]; + struct mission_template explore_golden[1]; + struct mission_template explore_new[1]; + struct mission_template prospect_random[1]; + struct mission_template prospect_fixed[6]; + struct mission_template guide_client[1]; + struct mission_template rescue_client[1]; + struct mission_template rescue_target_random[1]; + struct mission_template rescue_target_child[18]; + struct mission_template rescue_friends[24]; + struct mission_template rescue_lovers_rivals[23]; + struct mission_template search_for_target[1]; + struct mission_template challenge_mewtwo[1]; + struct mission_template challenge_entei[1]; + struct mission_template challenge_raikou[1]; + struct mission_template challenge_suicune[1]; + struct mission_template challenge_jirachi[1]; + struct mission_template challenge_other[28]; + struct mission_template take_outlaw_0[1]; + struct mission_template take_outlaw_1[1]; + struct mission_template take_hidden_outlaw[1]; + struct mission_template take_fleeing_outlaw[1]; + struct mission_template find_item_common[1]; + struct mission_template find_item_rare[1]; + struct mission_template find_favorite_gummi[324]; + struct mission_template find_evo_item[43]; + struct mission_template deliver_item[1]; + struct mission_template seven_treasures[7]; + struct mission_template gabite_scale[1]; + struct mission_template treasure_memo[54]; + uint16 padding[4]; +} +ASSERT_SIZE(struct mission_templates_table, 20416); + + +// One of these categories is selected via weighted random whenever the game tries to generate a mission. +// Each category corresponds to a range of templates in mission_template_table, which contains the specifics +// of the missions themselves. This struct is primarily used for generation restrictions. +struct mission_categories_table { + // [0]: Outlaw Hideout (0/10/10/0) Requirements: {None} Templates: [0, 30) + struct mission_weighted_category cat_hideout; + // [1]: Outlaw Monster House (0/10/5/0) Requirements: {None} Templates: [30, 31) + struct mission_weighted_category cat_monster_house; + // [2]: Outlaw Escort Magnezone/Magnemite (0/10/5/0) Requirements: {Rank >= Gold} Templates: [31, 33) + struct mission_weighted_category cat_escort_magnet; + // [3]: Outlaw Fleeing (0/10/10/0) Requirements: {None} Templates: [33, 34) + struct mission_weighted_category cat_fleeing_outlaw; + // [4]: Outlaw Normal 0 (0/10/10/0) Requirements: {None} Templates: [34, 35) + struct mission_weighted_category cat_outlaw_norm_0; + // [5]: Outlaw Normal 1 (0/10/10/0) Requirements: {None} Templates: [35, 36) + struct mission_weighted_category cat_outlaw_norm_1; + // [6]: Outlaw Normal 2 (0/10/10/0) Requirements: {None} Templates: [36, 37) + struct mission_weighted_category cat_outlaw_norm_2; + // [7]: Outlaw Normal 3 (0/10/10/0) Requirements: {None} Templates: [37, 38) + struct mission_weighted_category cat_outlaw_norm_3; + // [8]: Escort To Target (Random) (10/0/10/0) Requirements: {Rank >= Bronze} Templates: [38, 39) + struct mission_weighted_category cat_escort_random; + // [9]: Escort to Target (Specific) (10/0/10/0) Requirements: {Rank >= Silver} Templates: [39, 51) + struct mission_weighted_category cat_escort_specific; + // [10]: Explore Client Normal (10/0/10/0) Requirements: {Rank >= Gold} Templates: [51, 52) + struct mission_weighted_category cat_explore_normal; + // [11]: Explore Client Sealed Chamber (5/0/5/0) Requirements: {Rank >= Diamond} Templates: [52, 53) + struct mission_weighted_category cat_explore_sealed; + // [12]: Explore Client Gold Chamber (5/0/5/0) Requirements: {Rank >= Diamond} Templates: [53, 54) + struct mission_weighted_category cat_explore_gold; + // [13]: Explore Client New Dungeon (10/0/10/0) Requirements: {Rank >= Bronze} Templates: [54, 55) + struct mission_weighted_category cat_explore_new; + // [14]: Prospect With Client (5/0/5/0) Requirements: {Rank >= Diamond} Templates: [55, 62) + struct mission_weighted_category cat_prospect; + // [15]: Guide Client (10/0/10/0) Requirements: {Rank >= Silver} Templates: [62, 63) + struct mission_weighted_category cat_guide_client; + // [16]: Rescue Client (10/0/0/10) Requirements: {None} Templates: [63, 64) + struct mission_weighted_category cat_rescue_random_client; + // [17]: Rescue Target (Random) (10/0/10/0) Requirements: {None} Templates: [64, 65) + struct mission_weighted_category cat_rescue_random_target; + // [18]: Rescue Target (Child) (10/0/10/0) Requirements: {None} Templates: [65, 83) + struct mission_weighted_category cat_rescue_child; + // [19]: Rescue Species (10/0/10/0) Requirements: {None} Templates: [83, 107) + struct mission_weighted_category cat_rescue_species; + // [20]: Rescue Lover/Rival (10/0/10/0) Requirements: {None} Templates: [107, 130) + struct mission_weighted_category cat_rescue_lover_rival; + // [21]: Search For Target (10/0/10/0) Requirements: {None} Templates: [130, 131) + struct mission_weighted_category cat_search_target; + // [22]: Challenge Mewtwo (0/0/5/0) Requirements: {Secret Rank} Templates: [131, 132) + struct mission_weighted_category cat_challenge_mewtwo; + // [23]: Challenge Entei (0/0/5/0) Requirements: {Secret Rank} Templates: [132, 133) + struct mission_weighted_category cat_challenge_entei; + // [24]: Challenge Raikou (0/0/5/0) Requirements: {Secret Rank} Templates: [133, 134) + struct mission_weighted_category cat_challenge_raikou; + // [25]: Challenge Suicune (0/0/5/0) Requirements: {Secret Rank} Templates: [134, 135) + struct mission_weighted_category cat_challenge_suicune; + // [26]: Challenge Jirachi (0/0/5/0) Requirements: {Secret Rank} Templates: [135, 136) + // Additional requirements are checked during generation! + struct mission_weighted_category cat_challenge_jirachi; + // [27]: Challenge Normal (0/0/10/0) Requirements: {None} Templates: [136, 164) + struct mission_weighted_category cat_challenge_other; + // [28]: Take From Outlaw (0/10/10/0) Requirements: {None} Templates: [164, 166) + struct mission_weighted_category cat_take_outlaw_norm; + // [29]: Take Hidden Outlaw (0/10/10/0) Requirements: {None} Templates: [166, 167) + struct mission_weighted_category cat_take_outlaw_hidden; + // [30]: Take Fleeing Outlaw (0/10/10/0) Requirements: {None} Templates: [167, 168) + struct mission_weighted_category cat_take_outlaw_fleeing; + // [31]: Find Item (Random) (10/0/10/0) Requirements: {None} Templates: [168, 169) + struct mission_weighted_category cat_find_item_random; + // [32]: Find Item (Table) (5/0/5/0) Requirements: {None} Templates: [169, 170) + struct mission_weighted_category cat_find_table_item; + // [33]: Find Item Gummi (10/0/10/0) Requirements: {None} Templates: [170, 494) + struct mission_weighted_category cat_find_specific_gummi; + // [34]: Find Item Evolve (3/0/5/0) Requirements: {None} Templates: [494, 537) + struct mission_weighted_category cat_find_evo_item; + // [35]: Deliver Item (Random) (10/0/0/10) Requirements: {None} Templates: [537, 538) + struct mission_weighted_category cat_deliver_item_random; + // [36]: 7 Treasure Mission (0/0/300/0) Requirements: {Secret Rank} Templates: [538, 545) + struct mission_weighted_category cat_7_treasure_mission; + // [37]: Gabite Scale (0/0/150/0) Requirements: {Balance Flag >= 2} Templates: [545, 546) + struct mission_weighted_category cat_gabite_scale_mission; + // [38]: Treasure Memo (0/0/0/10) Requirements: {None} Templates: [546, 600) + struct mission_weighted_category cat_treasure_memo; + // [39]: No Job (Failsafe) (0/0/0/0) Requirements: {None} Templates: [0, 0) + // This category is used in the event that no other categories are available. + struct mission_weighted_category cat_failsafe_job; +} + +ASSERT_SIZE(struct mission_categories_table, 640); + From 65b1f0b3e6c3c236f8759518afee94104d733d7f Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 6 Jun 2025 16:04:22 -0400 Subject: [PATCH 011/151] Update rescue.h --- headers/types/files/rescue.h | 165 +++-------------------------------- 1 file changed, 12 insertions(+), 153 deletions(-) diff --git a/headers/types/files/rescue.h b/headers/types/files/rescue.h index cd9f6143..758570e6 100644 --- a/headers/types/files/rescue.h +++ b/headers/types/files/rescue.h @@ -26,7 +26,8 @@ struct rescue_header { ASSERT_SIZE(struct rescue_header, 32); - +// Table of rescue_str_variant_group structs, corresponding to the "text_string_offset" field of +// a mission_template struct or equivalently of a rescue_str_continuity struct. // 0x20 in rescue.bin struct rescue_str_variant_table { struct rescue_str_variant_group string_groups[481]; @@ -37,17 +38,9 @@ ASSERT_SIZE(struct rescue_str_variant_table, 1952); -struct rescue_str_variant_group { - // 0x0: Index of MISSION_STRING_IDS the group starts from. - uint16_t starting_index; - // 0x2: Number of other MISSION_STRING_ID entries the group contains. A random int on the range - // [0, group_size) is added to starting_index to produce the final MISSION_STRING_ID entry. - // This final index is then used again to select an index in rescue_str_continuity_table - uint16_t group_size; -} -ASSERT_SIZE(struct rescue_str_variant_group, 4); - +// Table of rescue_str_continuity structs, corresponding to each string in MISSION_TEXT_STRINGS +// and determines what index of the rescue_str_variant_table should follow each one (if any). // 0x7C0 in rescue.bin struct rescue_str_continuity_table { struct rescue_str_continuity continuities[964]; @@ -56,19 +49,6 @@ struct rescue_str_continuity_table { ASSERT_SIZE(struct rescue_str_continuity_table, 1952); -// Determines the entry in rescue_str_variant_table for the next string in sequence, if any. -struct rescue_str_continuity { - /* This field is interpreted as follows: - * If 0xFFFF, there is no next string. - * If 0x1NNN, index 0xNNN is for a summary string, NOT a title string. - * If 0x0NNN, index 0xNNN is for a title string, NOT a summary string. - */ - uint16_t next_variant_table_id; -} - -ASSERT_SIZE(struct rescue_str_continuity, 4); - - // Item tables used by certain mission templates. This could be considered as one table, // though in the templates themselves, none of the ranges overlap. // 0xF48 in rescue.bin @@ -131,54 +111,11 @@ struct rescue_monster_tables { ASSERT_SIZE(struct rescue_monster_tables, 2944); - - +// Table of mission templates used for mission generation. A template is chosen from range indicated by the +// selected mission_weighted_category, and GenerateMission converts the template into a mission struct. +// 0x1560 in rescue.bin struct mission_templates_table { - struct mission_template hideout_magnemite_1[8]; - struct mission_template hideout_magnemite_2[5]; - struct mission_template hideout_magnezone_1[9]; - struct mission_template hideout_magnezone_2[8]; - struct mission_template outlaw_monster_house[1]; - struct mission_template magnemite_escort[1]; - struct mission_template magnezone_escort[1]; - struct mission_template arrest_fleeing[1]; - struct mission_template arrest_normal_0[1]; - struct mission_template arrest_normal_1[1]; - struct mission_template arrest_normal_2[1]; - struct mission_template arrest_normal_3[1]; - struct mission_template escort_random[1]; - struct mission_template escort_specific[12]; - struct mission_template explore_normal[1]; - struct mission_template explore_sealed[1]; - struct mission_template explore_golden[1]; - struct mission_template explore_new[1]; - struct mission_template prospect_random[1]; - struct mission_template prospect_fixed[6]; - struct mission_template guide_client[1]; - struct mission_template rescue_client[1]; - struct mission_template rescue_target_random[1]; - struct mission_template rescue_target_child[18]; - struct mission_template rescue_friends[24]; - struct mission_template rescue_lovers_rivals[23]; - struct mission_template search_for_target[1]; - struct mission_template challenge_mewtwo[1]; - struct mission_template challenge_entei[1]; - struct mission_template challenge_raikou[1]; - struct mission_template challenge_suicune[1]; - struct mission_template challenge_jirachi[1]; - struct mission_template challenge_other[28]; - struct mission_template take_outlaw_0[1]; - struct mission_template take_outlaw_1[1]; - struct mission_template take_hidden_outlaw[1]; - struct mission_template take_fleeing_outlaw[1]; - struct mission_template find_item_common[1]; - struct mission_template find_item_rare[1]; - struct mission_template find_favorite_gummi[324]; - struct mission_template find_evo_item[43]; - struct mission_template deliver_item[1]; - struct mission_template seven_treasures[7]; - struct mission_template gabite_scale[1]; - struct mission_template treasure_memo[54]; + struct mission_template [600]; uint16 padding[4]; } ASSERT_SIZE(struct mission_templates_table, 20416); @@ -187,89 +124,11 @@ ASSERT_SIZE(struct mission_templates_table, 20416); // One of these categories is selected via weighted random whenever the game tries to generate a mission. // Each category corresponds to a range of templates in mission_template_table, which contains the specifics // of the missions themselves. This struct is primarily used for generation restrictions. +// 0x6520 in rescue.bin struct mission_categories_table { - // [0]: Outlaw Hideout (0/10/10/0) Requirements: {None} Templates: [0, 30) - struct mission_weighted_category cat_hideout; - // [1]: Outlaw Monster House (0/10/5/0) Requirements: {None} Templates: [30, 31) - struct mission_weighted_category cat_monster_house; - // [2]: Outlaw Escort Magnezone/Magnemite (0/10/5/0) Requirements: {Rank >= Gold} Templates: [31, 33) - struct mission_weighted_category cat_escort_magnet; - // [3]: Outlaw Fleeing (0/10/10/0) Requirements: {None} Templates: [33, 34) - struct mission_weighted_category cat_fleeing_outlaw; - // [4]: Outlaw Normal 0 (0/10/10/0) Requirements: {None} Templates: [34, 35) - struct mission_weighted_category cat_outlaw_norm_0; - // [5]: Outlaw Normal 1 (0/10/10/0) Requirements: {None} Templates: [35, 36) - struct mission_weighted_category cat_outlaw_norm_1; - // [6]: Outlaw Normal 2 (0/10/10/0) Requirements: {None} Templates: [36, 37) - struct mission_weighted_category cat_outlaw_norm_2; - // [7]: Outlaw Normal 3 (0/10/10/0) Requirements: {None} Templates: [37, 38) - struct mission_weighted_category cat_outlaw_norm_3; - // [8]: Escort To Target (Random) (10/0/10/0) Requirements: {Rank >= Bronze} Templates: [38, 39) - struct mission_weighted_category cat_escort_random; - // [9]: Escort to Target (Specific) (10/0/10/0) Requirements: {Rank >= Silver} Templates: [39, 51) - struct mission_weighted_category cat_escort_specific; - // [10]: Explore Client Normal (10/0/10/0) Requirements: {Rank >= Gold} Templates: [51, 52) - struct mission_weighted_category cat_explore_normal; - // [11]: Explore Client Sealed Chamber (5/0/5/0) Requirements: {Rank >= Diamond} Templates: [52, 53) - struct mission_weighted_category cat_explore_sealed; - // [12]: Explore Client Gold Chamber (5/0/5/0) Requirements: {Rank >= Diamond} Templates: [53, 54) - struct mission_weighted_category cat_explore_gold; - // [13]: Explore Client New Dungeon (10/0/10/0) Requirements: {Rank >= Bronze} Templates: [54, 55) - struct mission_weighted_category cat_explore_new; - // [14]: Prospect With Client (5/0/5/0) Requirements: {Rank >= Diamond} Templates: [55, 62) - struct mission_weighted_category cat_prospect; - // [15]: Guide Client (10/0/10/0) Requirements: {Rank >= Silver} Templates: [62, 63) - struct mission_weighted_category cat_guide_client; - // [16]: Rescue Client (10/0/0/10) Requirements: {None} Templates: [63, 64) - struct mission_weighted_category cat_rescue_random_client; - // [17]: Rescue Target (Random) (10/0/10/0) Requirements: {None} Templates: [64, 65) - struct mission_weighted_category cat_rescue_random_target; - // [18]: Rescue Target (Child) (10/0/10/0) Requirements: {None} Templates: [65, 83) - struct mission_weighted_category cat_rescue_child; - // [19]: Rescue Species (10/0/10/0) Requirements: {None} Templates: [83, 107) - struct mission_weighted_category cat_rescue_species; - // [20]: Rescue Lover/Rival (10/0/10/0) Requirements: {None} Templates: [107, 130) - struct mission_weighted_category cat_rescue_lover_rival; - // [21]: Search For Target (10/0/10/0) Requirements: {None} Templates: [130, 131) - struct mission_weighted_category cat_search_target; - // [22]: Challenge Mewtwo (0/0/5/0) Requirements: {Secret Rank} Templates: [131, 132) - struct mission_weighted_category cat_challenge_mewtwo; - // [23]: Challenge Entei (0/0/5/0) Requirements: {Secret Rank} Templates: [132, 133) - struct mission_weighted_category cat_challenge_entei; - // [24]: Challenge Raikou (0/0/5/0) Requirements: {Secret Rank} Templates: [133, 134) - struct mission_weighted_category cat_challenge_raikou; - // [25]: Challenge Suicune (0/0/5/0) Requirements: {Secret Rank} Templates: [134, 135) - struct mission_weighted_category cat_challenge_suicune; - // [26]: Challenge Jirachi (0/0/5/0) Requirements: {Secret Rank} Templates: [135, 136) - // Additional requirements are checked during generation! - struct mission_weighted_category cat_challenge_jirachi; - // [27]: Challenge Normal (0/0/10/0) Requirements: {None} Templates: [136, 164) - struct mission_weighted_category cat_challenge_other; - // [28]: Take From Outlaw (0/10/10/0) Requirements: {None} Templates: [164, 166) - struct mission_weighted_category cat_take_outlaw_norm; - // [29]: Take Hidden Outlaw (0/10/10/0) Requirements: {None} Templates: [166, 167) - struct mission_weighted_category cat_take_outlaw_hidden; - // [30]: Take Fleeing Outlaw (0/10/10/0) Requirements: {None} Templates: [167, 168) - struct mission_weighted_category cat_take_outlaw_fleeing; - // [31]: Find Item (Random) (10/0/10/0) Requirements: {None} Templates: [168, 169) - struct mission_weighted_category cat_find_item_random; - // [32]: Find Item (Table) (5/0/5/0) Requirements: {None} Templates: [169, 170) - struct mission_weighted_category cat_find_table_item; - // [33]: Find Item Gummi (10/0/10/0) Requirements: {None} Templates: [170, 494) - struct mission_weighted_category cat_find_specific_gummi; - // [34]: Find Item Evolve (3/0/5/0) Requirements: {None} Templates: [494, 537) - struct mission_weighted_category cat_find_evo_item; - // [35]: Deliver Item (Random) (10/0/0/10) Requirements: {None} Templates: [537, 538) - struct mission_weighted_category cat_deliver_item_random; - // [36]: 7 Treasure Mission (0/0/300/0) Requirements: {Secret Rank} Templates: [538, 545) - struct mission_weighted_category cat_7_treasure_mission; - // [37]: Gabite Scale (0/0/150/0) Requirements: {Balance Flag >= 2} Templates: [545, 546) - struct mission_weighted_category cat_gabite_scale_mission; - // [38]: Treasure Memo (0/0/0/10) Requirements: {None} Templates: [546, 600) - struct mission_weighted_category cat_treasure_memo; - // [39]: No Job (Failsafe) (0/0/0/0) Requirements: {None} Templates: [0, 0) - // This category is used in the event that no other categories are available. - struct mission_weighted_category cat_failsafe_job; + struct mission_weighted_category mission_categories[39]; + // Initially thought this to be a failsafe mission category, but this seems to just be padding. + uint16 padding[4]; } ASSERT_SIZE(struct mission_categories_table, 640); From 306efca09da4968be4d886498cc50a14dd6fd545 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 6 Jun 2025 16:05:13 -0400 Subject: [PATCH 012/151] Add New Mission Template Structs --- headers/types/common/common.h | 81 ++++++++++++++++++++++++----------- 1 file changed, 55 insertions(+), 26 deletions(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index 28978b4f..1c122d90 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -791,7 +791,8 @@ struct mission { uint8_t floor; // 0x5 undefined field_0x6; // Likely padding undefined field_0x7; // Likely padding - // 0x8: changing it seems to affect the text of the mission, maybe a string ID? + // 0x8: A random value determined FUN_0205146C [EU], which is used to randomly generate + // int description_id; uint8_t unique_map_id; // 0xC: for challenges/treasure hunts/certain outlaws undefined field_0xd; @@ -820,31 +821,35 @@ ASSERT_SIZE(struct mission_floors_forbidden, 2); -// Information valid mission; a list of these structs is stored in and directly loaded from -// RESCUE/rescue.bin at 0x6520, where 40 of these structs exist. One of these categories is picked -// at random during mission generation, after which a template is chosen from within that category. -struct mission_weighted_category { - // 0x0: Weight for this category to appear on the Job Board - uint16_t job_board_weight; - // 0x2: Weight for this category to appear on the Outlaw Board - uint16_t outlaw_board_weight; - // 0x4: Weight for this category to appear from a client in Spinda's Cafe - uint16_t cafe_weight; - // 0x6: Weight for this category to appear in a bottle on the beach - uint16_t bottle_weight; - // 0x8: Minimum Guild Rank required for this category to be considered - rank minimum_rank; - // 0x9: Minimum SCENARIO_BALANCE_FLAG required for this category to be considered. - // Is 0x2 for the gabite scale mission category, and 0x0 for all other categories. - uint8_t min_scenario_balance; - // 0xA: Boolean for whether Secret Rank is required for this mission. - uint16_t secret_rank_needed; - // 0xC: Number of mission_template structs within this category - uint16_t number_of_templates; - // 0xE: Index of the first mission_template struct within this category - uint16_t first_template_index; +// Information about a valid mission; a list of these structs is stored in and directly loaded from +// RESCUE/rescue.bin at 0x20, where 481 of these structs exist. These are used to select a string +// from MISSION_STRING_IDS at random, to provide variance to mission flavor text. +struct rescue_str_variant_group { + // 0x0: Index of MISSION_STRING_IDS the group starts from. + uint16_t starting_index; + // 0x2: Number of other MISSION_STRING_IDS entries the group contains. A random int on the range + // [0, group_size) is added to starting_index to produce the final MISSION_STRING_ID entry. + // This final index is reused to select an index in rescue_str_continuity_table + uint16_t group_size; } -ASSERT_SIZE(struct mission_weighted_category, 16); + +ASSERT_SIZE(struct rescue_str_variant_group, 4); + + +// Information about a valid mission; a list of these structs is stored in and directly loaded from +// RESCUE/rescue.bin at 0x7C0, where 964 of these structs exist. These correspond to each string in +// MISSION_STRING_IDS, and determines whether other strings should be appended to them. +struct rescue_str_continuity { + /* This field is interpreted as follows: + * If 0xFFFF, there is no next string. + * If 0x1NNN, index 0xNNN is for a summary string, NOT a title string. + * If 0x0NNN, index 0xNNN is for a title string, NOT a summary string. + */ + uint16_t next_variant_table_id; +} + +ASSERT_SIZE(struct rescue_str_continuity, 4); + // Information about a valid mission; a list of these structs is stored in and directly loaded from // RESCUE/rescue.bin at 0x1560, where 600 of these structs exist. These are templates for mission generation, @@ -900,7 +905,31 @@ struct mission_template { }; ASSERT_SIZE(struct mission_rescue_bin, 34); - +// Information valid mission; a list of these structs is stored in and directly loaded from +// RESCUE/rescue.bin at 0x6520, where 40 of these structs exist. One of these categories is picked +// at random during mission generation, after which a template is chosen from within that category. +struct mission_weighted_category { + // 0x0: Weight for this category to appear on the Job Board + uint16_t job_board_weight; + // 0x2: Weight for this category to appear on the Outlaw Board + uint16_t outlaw_board_weight; + // 0x4: Weight for this category to appear from a client in Spinda's Cafe + uint16_t cafe_weight; + // 0x6: Weight for this category to appear in a bottle on the beach + uint16_t bottle_weight; + // 0x8: Minimum Guild Rank required for this category to be considered + rank minimum_rank; + // 0x9: Minimum SCENARIO_BALANCE_FLAG required for this category to be considered. + // Is 0x2 for the gabite scale mission category, and 0x0 for all other categories. + uint8_t min_scenario_balance; + // 0xA: Boolean for whether Secret Rank is required for this mission. + uint16_t secret_rank_needed; + // 0xC: Number of mission_template structs within this category + uint16_t number_of_templates; + // 0xE: Index of the first mission_template struct within this category + uint16_t first_template_index; +} +ASSERT_SIZE(struct mission_weighted_category, 16); // Unverified, ported from Irdkwia's notes From ad3337cf0193e812c3fd18eac507cecf557be95e Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 6 Jun 2025 16:13:09 -0400 Subject: [PATCH 013/151] Update Enums Added context and renamed certain mission enums --- headers/types/common/enums.h | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/headers/types/common/enums.h b/headers/types/common/enums.h index 8c65ae14..2452a4a5 100644 --- a/headers/types/common/enums.h +++ b/headers/types/common/enums.h @@ -3834,12 +3834,12 @@ ENUM_8_BIT(mission_subtype_guide_client); // Mission subtype for MISSION_FIND_ITEM enum mission_subtype_find_item { - // Item Table parameters are 0x16, 0x00 + // In the template, pulls from the "common" table in rescue_item_tables. // Client is random - MISSION_ITEM_TABLE_16_00 = 0, - // Item Table parameters are 0x14, 0x16 + MISSION_ITEM_COMMON_TABLE = 0, + // In the template, pulls from the "rare" table in rescue_item_tables. // Client is random - MISSION_ITEM_TABLE_14_16 = 1, + MISSION_ITEM_RARE_TABLE = 1, // Item is an evolution item for the client // (IE: Gloom/Leaf Stone, Dusclops/Reaper Cloth, Magmar/Magmarizer) MISSION_ITEM_EVOLVES_CLIENT = 2, @@ -3891,8 +3891,8 @@ ENUM_8_BIT(mission_subtype_take_item); #pragma pack(pop) // Mission subtype for MISSION_ARREST_OUTLAW -// 0-3 all occur naturally in-game, but don't seem to have any obvious differences? -// The distinction might be intensity or perceived difficulty? +// 0-3 all occur naturally in-game, the distinction is in intensity of the mission. +// Each uses a different table of outlaws (see and the client for 0-1 is Magnezone enum mission_subtype_outlaw { MISSION_OUTLAW_NORMAL_0 = 0, // in mission_template, client is magnezone MISSION_OUTLAW_NORMAL_1 = 1, // in mission_template, client is magnezone @@ -3990,9 +3990,15 @@ enum mission_reward_type { MISSION_REWARD_MONEY_AND_MORE = 1, // Money + (?) MISSION_REWARD_ITEM = 2, MISSION_REWARD_ITEM_AND_MORE = 3, // Item + (?) - MISSION_REWARD_ITEM_HIDDEN = 4, // Item, displayed as "(?)" - MISSION_REWARD_MONEY_HIDDEN = 5, // Money, displayed as "(?)" + // Exclusive Item, displayed as "(?)" (Will be 1 star, and beneficial of the client/target) + // $SCENARIO_MAIN must be [8, 0] or above AND mission rank must be >=5 stars to be selected. + // Also used for the Togetic Wing given from the Gabite Scale mission. + MISSION_REWARD_EXCLUSIVE_ITEM = 4, + // Money, displayed as "(?)" + // $SCENARIO_MAIN must be [12, 0] or above to be selected. + MISSION_REWARD_MONEY_HIDDEN = 5, // Either an egg or the client requests to join the team, displayed as "(?)" + // $SCENARIO_MAIN must be [6, 0] or above for this to be selected MISSION_REWARD_SPECIAL = 6, }; // This is usually stored as an 8-bit integer From 30854911781fa8e80c50a3fb698fa0fddc8e7fa9 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 6 Jun 2025 16:53:24 -0400 Subject: [PATCH 014/151] add mission_window_details struct I don't know much about it, but functions are using certain fields of it. --- headers/types/common/common.h | 104 +++++++++++++++++++++++++++++++++- 1 file changed, 102 insertions(+), 2 deletions(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index 1c122d90..f954213e 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -791,8 +791,8 @@ struct mission { uint8_t floor; // 0x5 undefined field_0x6; // Likely padding undefined field_0x7; // Likely padding - // 0x8: A random value determined FUN_0205146C [EU], which is used to randomly generate - // + // 0x8: A random value determined FUN_0205146C [EU], which is used to + // randomly generate the mission title and description. int description_id; uint8_t unique_map_id; // 0xC: for challenges/treasure hunts/certain outlaws undefined field_0xd; @@ -820,6 +820,106 @@ struct mission_floors_forbidden { ASSERT_SIZE(struct mission_floors_forbidden, 2); +// Used throughout the process of displaying a mission +struct mission_window_details { + undefined field_0x0; + undefined field_0x1; + undefined field_0x2; + undefined field_0x3; + undefined field_0x4; + undefined field_0x5; + undefined field_0x6; + undefined field_0x7; + // 0x8: Pointer to mission struct + 0x4 (new substruct?) + struct mission *mission_ptr; + undefined field_0xb; + undefined field_0xc; + undefined field_0xd; + undefined field_0xe; + undefined field_0xf; + undefined field_0x10; + undefined field_0x11; + undefined field_0x12; + undefined field_0x13; + undefined field_0x14; + undefined field_0x15; + undefined field_0x16; + undefined field_0x17; + undefined field_0x18; + undefined field_0x19; + undefined field_0x1a; + undefined field_0x1b; + undefined field_0x1c; + undefined field_0x1d; + undefined field_0x1e; + undefined field_0x1f; + undefined field_0x20; + undefined field_0x21; + undefined field_0x22; + undefined field_0x23; + undefined field_0x24; + undefined field_0x25; + undefined field_0x26; + undefined field_0x27; + undefined field_0x28; + undefined field_0x29; + undefined field_0x2a; + undefined field_0x2b; + undefined field_0x2c; + undefined field_0x2d; + undefined field_0x2e; + undefined field_0x2f; + undefined field_0x30; + undefined field_0x31; + undefined field_0x32; + undefined field_0x33; + undefined field_0x34; + undefined field_0x35; + undefined field_0x36; + undefined field_0x37; + undefined field_0x38; + undefined field_0x39; + undefined field_0x3a; + undefined field_0x3b; + undefined field_0x3c; + undefined field_0x3d; + undefined field_0x3e; + undefined field_0x3f; + undefined field_0x40; + undefined field_0x41; + undefined field_0x42; + undefined field_0x43; + undefined field_0x44; + undefined field_0x45; + undefined field_0x46; + undefined field_0x47; + undefined field_0x48; + undefined field_0x49; + undefined field_0x4a; + undefined field_0x4b; + undefined field_0x4c; + undefined field_0x4d; + undefined field_0x4e; + undefined field_0x4f; + undefined field_0x50; + undefined field_0x51; + undefined field_0x52; + undefined field_0x53; + undefined field_0x54; + undefined field_0x55; + undefined field_0x56; + undefined field_0x57; + undefined field_0x58; + undefined field_0x59; + undefined field_0x5a; + undefined field_0x5b; + undefined field_0x5c; + undefined field_0x5d; + undefined field_0x5e; + undefined field_0x5f; + // 0x60: pointer to mission_template struct + struct mission_template *template_ptr; +} // Information about a valid mission; a list of these structs is stored in and directly loaded from // RESCUE/rescue.bin at 0x20, where 481 of these structs exist. These are used to select a string From 17d1f88f75496f7895ac47332820bad364063908 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 6 Jun 2025 17:07:45 -0400 Subject: [PATCH 015/151] Add New Functions --- symbols/arm9.yml | 95 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 79 insertions(+), 16 deletions(-) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 4c2c107d..2f7fa41a 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -10482,6 +10482,18 @@ arm9: In particular, mission::status is set to mission_status::MISSION_STATUS_INVALID, mission::dungeon_id is set to -1, mission::floor is set to 0 and mission::reward_type is set to mission_reward_type::MISSION_REWARD_MONEY. r0: Pointer to the mission to clear + - name: GenerateMissionDetailsStruct + address: + EU: 0x2060B80 + NA: + JP: + description: |- + Generates a mission_details struct, to be used for printing mission details such as the title, summary, and objective. + + r0: mission struct pointer + r1: [output] location of mission_details struct + r2: unknown + r3: unknown - name: ValidateNormalChallengeMission address: EU: 0x2060B80 @@ -10490,7 +10502,7 @@ arm9: description: |- 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 + r0: mission_template struct pointer r1: mission struct pointer return: bool - name: ValidateLegendaryChallengeMission @@ -10501,9 +10513,44 @@ arm9: 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 + r0: mission_template struct pointer r1: mission struct pointer return: bool + - name: AppendMissionTitle + address: + EU: 0x02060D8C + NA: + JP: + description: |- + Generates the mission title of the mission, and appends it to the string location. + r0: [output] output buffer + r1: intermediate buffer, filled then concatenated to output buffer + r2: pointer to preprocessor args + r3: pointer to "mission details" struct (Spooky Struct) + - name: AppendMissionTitle + address: + EU: 0x02060D8C + NA: + JP: + description: |- + Generates the mission title of a mission, and appends it to the string location. + r0: [output] output buffer + r1: intermediate buffer, filled then concatenated to output buffer + r2: pointer to preprocessor args + r3: pointer to mission_window_details struct + - name: AppendMissionSummary + address: + EU: 0x02060D8C + NA: + JP: + description: |- + Generates the mission title of a mission, and appends it to the string location. + r0: [output] main string location + r1: temporary string buffer, concatenated to main string + r2: window_id for DrawTextInWindow + r3: y offset for DrawTextInWindow + stack[0]: pointer to preprocessor args + stack[1]: pointer to mission_window_details struct - name: IsMonsterMissionAllowed address: EU: 0x2062D90 @@ -12350,34 +12397,49 @@ arm9: A list of items that are forbidden from being used in a mission sent by Wonder Mail. type: struct item_id_16[3] - - name: ARM9_UNKNOWN_TABLE__NA_20A3CC8 + - name: CAFE_MISSION_REWARD_TYPE_WEIGHTS address: EU: 0x20A42C8 NA: 0x20A3CC8 JP: 0x20A50AC + length: + EU: 0xE + NA: 0xE + JP: 0xE + description: |- + Weights for each possible mission_reward_type, used only by cafe mission generation. + Seems identical to DEFAULT_MISSION_REWARD_TYPE_WEIGHTS. + + type: int16_t[7] + - name: OUTLAW_MISSION_REWARD_TYPE_WEIGHTS + address: + EU: 0x20A42D6 + NA: 0x20A3CD6 + JP: 0x20A50BA length: EU: 0x1C NA: 0x1C JP: 0x1C description: |- - 14*0x2 - Linked to ARM9_UNKNOWN_TABLE__NA_20A3CE4 + Weights for each possible mission_reward_type, exclusively for the ARREST_OUTLAW mision type. + Takes priority over CAFE_MISSION_REWARD_TYPE_WEIGHTS and CAFE_MISSION_REWARD_TYPE_WEIGHTS. - Note: unverified, ported from Irdkwia's notes - - name: ARM9_UNKNOWN_TABLE__NA_20A3CE4 + type: int16_t[7] + - name: DEFAULT_MISSION_REWARD_TYPE_WEIGHTS address: EU: 0x20A42E4 NA: 0x20A3CE4 JP: 0x20A50C8 length: - EU: 0x10 - NA: 0x10 - JP: 0x10 + EU: 0xE + NA: 0xE + JP: 0xE description: |- - 8*0x2 + Weights for each possible mission_reward_type, used for non-cafe missions. + Seems identical to CAFE_MISSION_REWARD_TYPE_WEIGHTS. - Note: unverified, ported from Irdkwia's notes - - name: ARM9_UNKNOWN_FUNCTION_TABLE__NA_20A3CF4 + type: int16_t[7] + - name: MISSION_VALIDATION_FUNCTION_LIST address: EU: 0x20A42F4 NA: 0x20A3CF4 @@ -12387,9 +12449,9 @@ arm9: NA: 0x20 JP: 0x20 description: |- - Could be related to missions + A list of functions used to validate missions of different types at 02060CEC [EU]. - Note: unverified, ported from Irdkwia's notes + type: function[8] - name: MISSION_BANNED_STORY_MONSTERS address: EU: 0x20A4314 @@ -12454,7 +12516,8 @@ arm9: NA: 0x788 JP: 0x788 description: |- - Note: unverified, ported from Irdkwia's notes + String IDs for mission title and summary flavor-text. + Used by GenerateMissionTitle and GenerateMissionSummary. type: int16_t[964] - name: LEVEL_LIST From 6d6735d23e772be6107ac72cdc73850bbcf16c4c Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 6 Jun 2025 17:18:19 -0400 Subject: [PATCH 016/151] Add New Functions (2) --- headers/functions/arm9.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 33b4de7e..03617589 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -1094,10 +1094,16 @@ void DeleteAllPossibleDungeonsList(void); int GenerateAllPossibleDeliverList(void); void DeleteAllPossibleDeliverList(void); void ClearMissionData(struct mission* mission); +void GenerateMissionDetailsStruct(struct mission* mission, struct mission_details* details, + undefined unk_2, undefined unk_3); bool ValidateNormalChallengeMission(struct mission_template* valid_mission_info, struct mission* mission); bool ValidateLegendaryChallengeMission(struct mission_template* valid_mission_info, struct mission* mission); +void AppendMissonTitle(char* main_buffer, char* temp_buffer, struct preprocessor_args* args, + struct mission_details* details); +void AppendMissonSummary(char* main_buffer, char* temp_buffer, struct preprocessor_args* args, + int window_id, int y_offset, struct mission_details* details); 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); From 7e6954b4f97d5c889c016edced4acbb6ec8ae2c9 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 6 Jun 2025 17:19:23 -0400 Subject: [PATCH 017/151] Add New Functions (3) --- headers/data/arm9.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/headers/data/arm9.h b/headers/data/arm9.h index 2fc9d0ea..b6d3c6c2 100644 --- a/headers/data/arm9.h +++ b/headers/data/arm9.h @@ -129,6 +129,10 @@ extern int16_t MISSION_MENU_STRING_IDS_1[8]; extern int16_t MISSION_MENU_STRING_IDS_2[8]; extern struct dungeon_unlock_entry MISSION_DUNGEON_UNLOCK_TABLE[3]; extern struct item_id_16 NO_SEND_ITEM_TABLE[3]; +extern uint16_t CAFE_MISSION_REWARD_TYPE_WEIGHTS[7]; +extern uint16_t OUTLAW_MISSION_REWARD_TYPE_WEIGHTS[7]; +extern uint16_t DEFAULT_MISSION_REWARD_TYPE_WEIGHTS[7]; +extern int32_t MISSION_VALIDATION_FUNCTION_LIST[8]; // Functions extern struct monster_id_16 MISSION_BANNED_STORY_MONSTERS[21]; extern struct item_id_16 ITEM_DELIVERY_TABLE[23]; extern int MISSION_RANK_POINTS[16]; From 52ac1066afd657a167dfe69796da7ba569d79067 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 6 Jun 2025 17:31:17 -0400 Subject: [PATCH 018/151] Add an ASSERT_SIZE ...with appropriate signage --- headers/types/common/common.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index f954213e..8b92749a 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -821,7 +821,7 @@ ASSERT_SIZE(struct mission_floors_forbidden, 2); // Used throughout the process of displaying a mission -struct mission_window_details { +struct mission_details { undefined field_0x0; undefined field_0x1; undefined field_0x2; @@ -920,6 +920,9 @@ struct mission_window_details { // 0x60: pointer to mission_template struct struct mission_template *template_ptr; } +// mission_details is at least this big. unclear bigger it actually is. +ASSERT_SIZE(struct mission_details, 100); + // Information about a valid mission; a list of these structs is stored in and directly loaded from // RESCUE/rescue.bin at 0x20, where 481 of these structs exist. These are used to select a string From f8f30be0ea93d9afdc96eb20ddb8c291824f4131 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 6 Jun 2025 17:55:03 -0400 Subject: [PATCH 019/151] Fix Syntax Errors and overlapping enums --- headers/types/common/enums.h | 131 ++++++++++------------------------- 1 file changed, 35 insertions(+), 96 deletions(-) diff --git a/headers/types/common/enums.h b/headers/types/common/enums.h index 2452a4a5..bbe8c2e2 100644 --- a/headers/types/common/enums.h +++ b/headers/types/common/enums.h @@ -3751,30 +3751,30 @@ enum mission_type { ENUM_8_BIT(mission_type); #pragma pack(pop) -// Mission subtype for MISSION_RESCUE_CLIENT -enum mission_subtype_rescue_client { - MISSION_TEMPLATE_DEFAULT = 0 // Random Client +// Mission subtype for mission types without distinct subtypes +enum mission_subtype_other { + MISSION_TEMPLATE_DEFAULT = 0; }; // This is usually stored as an 8-bit integer #pragma pack(push, 1) -ENUM_8_BIT(mission_subtype_rescue_client); +ENUM_8_BIT(mission_subtype_other); #pragma pack(pop) // Mission subtype for MISSION_RESCUE_TARGET // The distinction is mainly for dialogue enum mission_subtype_rescue_target { // Client and Target are randomly selected - MISSION_CLIENT_TARGET_RANDOM = 0, + MISSION_RESCUE_CLIENT_TARGET_RANDOM = 0, // Client is the evolved form of the target // (IE: Beedrill/Weedle, Aggron/Aron) - MISSION_CLIENT_TARGET_CHILD = 1, + MISSION_RESCUE_CLIENT_TARGET_CHILD = 1, // Client and Target are deeply similar // (IE: Dodrio/Exeggutor, Muk/Swalot, Magikarp/Feebas) - MISSION_CLIENT_TARGET_SIMILAR_FRIENDS = 2, + MISSION_RESCUE_CLIENT_TARGET_SIMILAR_FRIENDS = 2, // Client and Target are lovers or rivals // (IE: Nidoking/Nidoqueen, Seviper/Zangoose, Volbeat/Illumise) - MISSION_CLIENT_TARGET_LOVERS_RIVALS = 3 + MISSION_RESCUE_CLIENT_TARGET_LOVERS_RIVALS = 3 }; // This is usually stored as an 8-bit integer @@ -3785,10 +3785,10 @@ ENUM_8_BIT(mission_subtype_rescue_target); // Mission subtype for MISSION_ESCORT_TO_TARGET enum mission_subtype_escort_to_target { // Client and Target are randomly selected - MISSION_CLIENT_TARGET_RANDOM = 0, + MISSION_ESCORT_CLIENT_TARGET_RANDOM = 0, // Client and Target are counterparts // (IE: Nidoran-M/Nidoran-F, Volbeat/Illumise, Miltank/Tauros) - MISSION_CLIENT_TARGET_SPECIFIC = 1 + MISSION_ESCORT_CLIENT_TARGET_SPECIFIC = 1 }; // This is usually stored as an 8-bit integer @@ -3809,43 +3809,21 @@ enum mission_subtype_explore { ENUM_8_BIT(mission_subtype_explore); #pragma pack(pop) -// Mission subtype for MISSION_PROSPECT_WITH_CLIENT -// There seems to be no distinction between prospecting -// for a random or specific item in this subtype. -enum mission_subtype_prospect_with_client { - MISSION_TEMPLATE_DEFAULT = 0 -}; - -// This is usually stored as an 8-bit integer -#pragma pack(push, 1) -ENUM_8_BIT(mission_subtype_prospect_with_client); -#pragma pack(pop) - - -// Mission subtype for MISSION_GUIDE_CLIENT -enum mission_subtype_guide_client { - MISSION_TEMPLATE_DEFAULT = 0 -}; - -// This is usually stored as an 8-bit integer -#pragma pack(push, 1) -ENUM_8_BIT(mission_subtype_guide_client); -#pragma pack(pop) // Mission subtype for MISSION_FIND_ITEM enum mission_subtype_find_item { // In the template, pulls from the "common" table in rescue_item_tables. // Client is random - MISSION_ITEM_COMMON_TABLE = 0, + MISSION_FIND_ITEM_COMMON_TABLE = 0, // In the template, pulls from the "rare" table in rescue_item_tables. // Client is random - MISSION_ITEM_RARE_TABLE = 1, + MISSION_FIND_ITEM_RARE_TABLE = 1, // Item is an evolution item for the client // (IE: Gloom/Leaf Stone, Dusclops/Reaper Cloth, Magmar/Magmarizer) - MISSION_ITEM_EVOLVES_CLIENT = 2, + MISSION_FIND_ITEM_EVOLVES_CLIENT = 2, // Item is a gummi of one of the client's types // (IE: Flaafy/Yellow Gummi, Baltoy/Brown Gummi, Dratini/Royal Gummi) - MISSION_ITEM_CLIENT_FAVORITE_GUMMI = 3, + MISSION_FIND_ITEM_CLIENT_FAVORITE_GUMMI = 3, // This is the special Togetic Mission that unlocks Labyrinth Cave MISSION_TOGETIC_GABITE_SCALE = 4 }; @@ -3855,28 +3833,6 @@ enum mission_subtype_find_item { ENUM_8_BIT(mission_subtype_find_item); #pragma pack(pop) -// Mission subtype for MISSION_DELIVER_ITEM -enum mission_subtype_deliver_item { - // Random Client, Item from table 0x16 0x00 - MISSION_TEMPLATE_DEFAULT = 0 -}; - -// This is usually stored as an 8-bit integer -#pragma pack(push, 1) -ENUM_8_BIT(mission_subtype_deliver_item); -#pragma pack(pop) - - -// Mission subtype for MISSION_SEARCH_FOR_TARGET -enum mission_subtype_search_for_target { - MISSION_TEMPLATE_DEFAULT = 0 // Random Client and Target -}; - -// This is usually stored as an 8-bit integer -#pragma pack(push, 1) -ENUM_8_BIT(mission_subtype_search_for_target); -#pragma pack(pop) - // Mission subtype for MISSION_TAKE_ITEM_FROM_OUTLAW // Random Client and Outlaw. NOT Magnezone/Magnemite enum mission_subtype_take_item { @@ -3892,7 +3848,7 @@ ENUM_8_BIT(mission_subtype_take_item); // Mission subtype for MISSION_ARREST_OUTLAW // 0-3 all occur naturally in-game, the distinction is in intensity of the mission. -// Each uses a different table of outlaws (see and the client for 0-1 is Magnezone +// Each uses a different table of outlaws of varying difficulties. enum mission_subtype_outlaw { MISSION_OUTLAW_NORMAL_0 = 0, // in mission_template, client is magnezone MISSION_OUTLAW_NORMAL_1 = 1, // in mission_template, client is magnezone @@ -3927,23 +3883,13 @@ enum mission_subtype_challenge { ENUM_8_BIT(mission_subtype_challenge); #pragma pack(pop) -// Mission subtype for MISSION_TREASURE_MEMO -enum mission_subtype_treasure_memo { - MISSION_TEMPLATE_DEFAULT = 0 -}; - -// This is usually stored as an 8-bit integer -#pragma pack(push, 1) -ENUM_8_BIT(mission_subtype_treasure_memo); -#pragma pack(pop) - // Mission subtype for MISSION_SPECIAL_EPISODE enum mission_subtype_special_episode { - MISSION_UNK_0 = 0, + MISSION_SE_UNK_0 = 0, // Checked for at 0x0205E2E0 [EU] when determining mission restrictions - MISSION_UNK_1 = 1, - MISSION_UNK_2 = 2 + MISSION_SE_UNK_1 = 1, + MISSION_SE_UNK_2 = 2 }; // This is usually stored as an 8-bit integer @@ -3953,9 +3899,9 @@ ENUM_8_BIT(mission_subtype_special_episode); // Mission subtype for MISSION_SEVEN_TREASURE enum mission_subtype_seven_treasure { - MISSION_UNK_0 = 0, + MISSION_SEVEN_UNK_0 = 0, // Subtype 0x1 is used in the template, NOT 0x0 - MISSION_TEMPLATE_DEFAULT = 1 + MISSION_SEVEN_TEMPLATE = 1 }; // This is usually stored as an 8-bit integer @@ -3965,23 +3911,16 @@ ENUM_8_BIT(mission_subtype_seven_treasure); // The meaning of the mission subtype depends on the mission type union mission_subtype { - uint8_t none; - struct mission_subtype_rescue_client_8 rescue_client; struct mission_subtype_rescue_target_8 rescue_target; struct mission_subtype_escort_to_target_8 escort; struct mission_subtype_explore_8 explore; - struct mission_subtype_prospect_with_client_8 prospect; - struct mission_subtype_guide_client_8 guide; struct mission_subtype_find_item_8 find_item; - struct mission_subtype_deliver_item_8 deliver_item; - struct mission_subtype_search_for_target_8 search_target; struct mission_subtype_take_item_8 take_item; struct mission_subtype_outlaw_8 outlaw; struct mission_subtype_challenge_8 challenge; - struct mission_subtype_treasure_memo_8 treasure_memo; - // unk_0xd struct mission_subtype_special_episode_8 special_episode; struct mission_subtype_seven_treasure_8 seven_treasure; + struct mission_subtype_other_8 other; }; // Different types of rewards that a mission can have @@ -4052,29 +3991,29 @@ enum mission_template_item_case { CASE_UNK_3 = 3, // mission_template_item_data_1 and mission_template_item_data_2 are ignored CASE_NO_ITEM = 4 -} +}; union mission_template_item_data_1 { uint16_t none; uint16_t template_item_table_id; // if CASE_USE_ITEM_TABLE -} +}; union mission_template_item_data_2 { uint16_t none; uint16_t template_item_table_id; // if CASE_USE_ITEM_TABLE struct item_id_16 mission_item_id; // if CASE_SPECIFIC_ITEM -} +}; enum mission_template_dungeon_case { CASE_SPECIFIC_OPENED = 0, // Used for Legendary Challenge Letters, among other things CASE_SPECIFIC_CLOSED = 1, // Used for Jirachi Challenge Letter and Togetic Mission - CASE_UNK_2 = 2, // Treated same as CASE_REVEALED_AND_UNLOCKED - CASE_UNK_3 = 3, // Treated same as CASE_REVEALED_AND_UNLOCKED + CASE_UNK_02 = 2, // Treated same as CASE_REVEALED_AND_UNLOCKED + CASE_UNK_03 = 3, // Treated same as CASE_REVEALED_AND_UNLOCKED CASE_RANDOM_OPEN = 4, // Used for most missions CASE_RANDOM_CLOSED = 5 // Used for EXPLORE_NEW_DUNGEON subtype -} +}; enum mission_template_client_case { // Must be attacked in a dungeon to yield a valid mission @@ -4090,18 +4029,18 @@ enum mission_template_client_case { CASE_UNK_3 = 3, // Client is selected at random from GetAllPossibleMonsters. Most missions use this. CASE_RANDOM_CLIENT = 4, -} +}; union mission_template_client_data_1 { uint16_t none; uint16_t template_client_table_id; // if CASE_TABLE_CLIENT -} +}; union mission_template_client_data_2 { uint16_t none; // If CASE_RANDOM_CLIENT uint16_t template_client_table_id; // if CASE_TABLE_CLIENT struct monster_id_16 client; // if CASE_FIXED_CLIENT_OLD or CASE_FIXED_CLIENT_NEW -} +}; enum mission_template_target_case { // Must be attacked in a dungeon to yield a valid mission @@ -4114,24 +4053,24 @@ enum mission_template_target_case { // Primarily used for outlaw missions in the template CASE_TABLE_TARGET = 2, // Has a distinct case menu, unused in template. - CASE_UNK_3 = 3, + CASE_UNK_003 = 3, // Target is selected at random from GetAllPossibleMonsters. Most missions use this. CASE_RANDOM_TARGET = 4, - CASE_UNK_5 = 5, + CASE_UNK_005 = 5, // Used by HIDDEN_OUTLAW, seems identical to CASE_RANDOM_TARGET? CASE_RANDOM_TARGET_06 = 6, -} +}; union mission_template_target_data_1 { uint16_t none; uint16_t template_target_table_id; // if CASE_TABLE_CLIENT -} +}; union mission_template_target_data_2 { uint16_t none; // If CASE_RANDOM_TARGET or CASE_RANDOM_TARGET_06 uint16_t template_target_table_id; // if CASE_TABLE_TARGET struct monster_id_16 target; // if CASE_FIXED_TARGET_OLD -} +}; // base-level 3D rendering variants From cccabbd8c6f092682a57ac613d6bf23df79139ae Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 6 Jun 2025 17:58:31 -0400 Subject: [PATCH 020/151] Add Aliases I have to wonder if these aliases will even be missed... --- symbols/arm9.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 2f7fa41a..2543ce38 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -12398,6 +12398,7 @@ arm9: type: struct item_id_16[3] - name: CAFE_MISSION_REWARD_TYPE_WEIGHTS + aliases: ARM9_UNKNOWN_TABLE__NA_20A3CC8 // Covers both this and the next table address: EU: 0x20A42C8 NA: 0x20A3CC8 @@ -12412,6 +12413,7 @@ arm9: type: int16_t[7] - name: OUTLAW_MISSION_REWARD_TYPE_WEIGHTS + aliases: ARM9_UNKNOWN_TABLE__NA_20A3CC8 // Covers both this and the prior table address: EU: 0x20A42D6 NA: 0x20A3CD6 @@ -12426,6 +12428,7 @@ arm9: type: int16_t[7] - name: DEFAULT_MISSION_REWARD_TYPE_WEIGHTS + aliases: ARM9_UNKNOWN_TABLE__NA_20A3CE4 address: EU: 0x20A42E4 NA: 0x20A3CE4 @@ -12440,6 +12443,7 @@ arm9: type: int16_t[7] - name: MISSION_VALIDATION_FUNCTION_LIST + aliases: ARM9_UNKNOWN_FUNCTION_TABLE__NA_20A3CF4 address: EU: 0x20A42F4 NA: 0x20A3CF4 From 04414d00193d5c89f1594275a70cdf6780482828 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 6 Jun 2025 18:05:13 -0400 Subject: [PATCH 021/151] Fix Overlapping Enums... again --- headers/types/common/enums.h | 70 ++++++++++++++++++------------------ 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/headers/types/common/enums.h b/headers/types/common/enums.h index bbe8c2e2..b7f822b7 100644 --- a/headers/types/common/enums.h +++ b/headers/types/common/enums.h @@ -3981,95 +3981,95 @@ ENUM_8_BIT(mission_status); enum mission_template_item_case { - // Treated same as CASE_SPECIFIC_ITEM, unused in template - CASE_UNK_0 = 0, + // Treated same as ITEM_CASE_SPECIFIC_ITEM, unused in template + ITEM_CASE_UNK_0 = 0, // mission_template_item_data_1 is ignored, and mission_template_item_data_2 is an item_id - CASE_SPECIFIC_ITEM = 1, + ITEM_CASE_SPECIFIC_ITEM = 1, // mission_template_item_data_1 and mission_template_item_data_2 are indices to a table - CASE_USE_ITEM_TABLE = 2, + ITEM_CASE_USE_ITEM_TABLE = 2, // Has a distinct case menu, unused in template. - CASE_UNK_3 = 3, + ITEM_CASE_UNK_3 = 3, // mission_template_item_data_1 and mission_template_item_data_2 are ignored - CASE_NO_ITEM = 4 + ITEM_CASE_NO_ITEM = 4 }; union mission_template_item_data_1 { uint16_t none; - uint16_t template_item_table_id; // if CASE_USE_ITEM_TABLE + uint16_t template_item_table_id; // if ITEM_CASE_USE_ITEM_TABLE }; union mission_template_item_data_2 { uint16_t none; - uint16_t template_item_table_id; // if CASE_USE_ITEM_TABLE - struct item_id_16 mission_item_id; // if CASE_SPECIFIC_ITEM + uint16_t template_item_table_id; // if ITEM_CASE_USE_ITEM_TABLE + struct item_id_16 mission_item_id; // if ITEM_CASE_SPECIFIC_ITEM }; enum mission_template_dungeon_case { - CASE_SPECIFIC_OPENED = 0, // Used for Legendary Challenge Letters, among other things - CASE_SPECIFIC_CLOSED = 1, // Used for Jirachi Challenge Letter and Togetic Mission - CASE_UNK_02 = 2, // Treated same as CASE_REVEALED_AND_UNLOCKED - CASE_UNK_03 = 3, // Treated same as CASE_REVEALED_AND_UNLOCKED - CASE_RANDOM_OPEN = 4, // Used for most missions - CASE_RANDOM_CLOSED = 5 // Used for EXPLORE_NEW_DUNGEON subtype + DUNGEON_CASE_SPECIFIC_OPENED = 0, // Used for Legendary Challenge Letters, among other things + DUNGEON_CASE_SPECIFIC_CLOSED = 1, // Used for Jirachi Challenge Letter and Togetic Mission + DUNGEON_CASE_UNK_2 = 2, // Treated same as DUNGEON_CASE_REVEALED_AND_UNLOCKED + DUNGEON_CASE_UNK_3 = 3, // Treated same as DUNGEON_CASE_REVEALED_AND_UNLOCKED + DUNGEON_CASE_RANDOM_OPEN = 4, // Used for most missions + DUNGEON_CASE_RANDOM_CLOSED = 5 // Used for EXPLORE_NEW_DUNGEON subtype }; enum mission_template_client_case { // Must be attacked in a dungeon to yield a valid mission - CASE_FIXED_CLIENT_OLD = 0, + CLIENT_CASE_FIXED_CLIENT_OLD = 0, // Does not need to be attacked in a dungeon to yield a valid mission // Examples include magnemite/magnezone, and legendary challenge letters - CASE_FIXED_CLIENT_NEW = 1, + CLIENT_CASE_FIXED_CLIENT_NEW = 1, // mission_template_client_data_1 and mission_template_client_data_2 are indices to a table // This determines the final client in a more restricted manner. // Only used for MISSION_GUIDE_CLIENT in the template - CASE_TABLE_CLIENT = 2, + CLIENT_CASE_TABLE_CLIENT = 2, // Has a distinct case menu, unused in template. - CASE_UNK_3 = 3, + CLIENT_CASE_UNK_3 = 3, // Client is selected at random from GetAllPossibleMonsters. Most missions use this. - CASE_RANDOM_CLIENT = 4, + CLIENT_CASE_RANDOM_CLIENT = 4, }; union mission_template_client_data_1 { uint16_t none; - uint16_t template_client_table_id; // if CASE_TABLE_CLIENT + uint16_t template_client_table_id; // if CLIENT_CASE_TABLE_CLIENT }; union mission_template_client_data_2 { - uint16_t none; // If CASE_RANDOM_CLIENT - uint16_t template_client_table_id; // if CASE_TABLE_CLIENT - struct monster_id_16 client; // if CASE_FIXED_CLIENT_OLD or CASE_FIXED_CLIENT_NEW + uint16_t none; // If CLIENT_CASE_RANDOM_CLIENT + uint16_t template_client_table_id; // if CLIENT_CASE_TABLE_CLIENT + struct monster_id_16 client; // if CLIENT_CASE_FIXED_CLIENT_OLD or CLIENT_CASE_FIXED_CLIENT_NEW }; enum mission_template_target_case { // Must be attacked in a dungeon to yield a valid mission - CASE_FIXED_TARGET_OLD = 0, + TARGET_CASE_FIXED_TARGET_OLD = 0, // Does not need to be attacked in a dungeon to yield a valid mission // Not present in template. - CASE_FIXED_TARGET_NEW = 1, + TARGET_CASE_FIXED_TARGET_NEW = 1, // mission_template_target_data_1 and mission_template_target_data_2 are indices to a table // This determines the final target in a more restricted manner. // Primarily used for outlaw missions in the template - CASE_TABLE_TARGET = 2, + TARGET_CASE_TABLE_TARGET = 2, // Has a distinct case menu, unused in template. - CASE_UNK_003 = 3, + TARGET_CASE_UNK_3 = 3, // Target is selected at random from GetAllPossibleMonsters. Most missions use this. CASE_RANDOM_TARGET = 4, - CASE_UNK_005 = 5, - // Used by HIDDEN_OUTLAW, seems identical to CASE_RANDOM_TARGET? - CASE_RANDOM_TARGET_06 = 6, + TARGET_CASE_UNK_5 = 5, + // Used by HIDDEN_OUTLAW, seems identical to TARGET_CASE_RANDOM_TARGET? + TARGET_CASE_RANDOM_TARGET_06 = 6, }; union mission_template_target_data_1 { uint16_t none; - uint16_t template_target_table_id; // if CASE_TABLE_CLIENT + uint16_t template_target_table_id; // if TARGET_CASE_TABLE_CLIENT }; union mission_template_target_data_2 { - uint16_t none; // If CASE_RANDOM_TARGET or CASE_RANDOM_TARGET_06 - uint16_t template_target_table_id; // if CASE_TABLE_TARGET - struct monster_id_16 target; // if CASE_FIXED_TARGET_OLD + uint16_t none; // If CASE_RANDOM_TARGET or TARGET_CASE_RANDOM_TARGET_06 + uint16_t template_target_table_id; // if TARGET_CASE_TABLE_TARGET + struct monster_id_16 target; // if TARGET_CASE_FIXED_TARGET_OLD }; From b6c22314740b278fe446f6d00c353f0d71aedc9c Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 6 Jun 2025 18:11:10 -0400 Subject: [PATCH 022/151] Fix c syntax Oops! --- headers/types/common/common.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index 8b92749a..3bc14810 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -919,9 +919,9 @@ struct mission_details { undefined field_0x5f; // 0x60: pointer to mission_template struct struct mission_template *template_ptr; -} +}; // mission_details is at least this big. unclear bigger it actually is. -ASSERT_SIZE(struct mission_details, 100); +ASSERT_SIZE(struct mission_details, 104); // Information about a valid mission; a list of these structs is stored in and directly loaded from @@ -934,7 +934,7 @@ struct rescue_str_variant_group { // [0, group_size) is added to starting_index to produce the final MISSION_STRING_ID entry. // This final index is reused to select an index in rescue_str_continuity_table uint16_t group_size; -} +}; ASSERT_SIZE(struct rescue_str_variant_group, 4); @@ -949,9 +949,9 @@ struct rescue_str_continuity { * If 0x0NNN, index 0xNNN is for a title string, NOT a summary string. */ uint16_t next_variant_table_id; -} +}; -ASSERT_SIZE(struct rescue_str_continuity, 4); +ASSERT_SIZE(struct rescue_str_continuity, 2); // Information about a valid mission; a list of these structs is stored in and directly loaded from @@ -961,7 +961,7 @@ struct mission_template { // 0x0: Points to an index for mission_title_groups and mission_summary_groups // These structs contain data for an appropriate range of titles/summaries // for the mission template from MISSION_STRING_IDS. - uint_16 text_string_offset; + uint16_t text_string_offset; // 0x2: Called in a switch case at 0x0205DED4 [EU] during mission generation // which affect how the template_item_data are interpreted enum mission_template_item_case item_case; @@ -1021,7 +1021,7 @@ struct mission_weighted_category { // 0x6: Weight for this category to appear in a bottle on the beach uint16_t bottle_weight; // 0x8: Minimum Guild Rank required for this category to be considered - rank minimum_rank; + enum rank minimum_rank; // 0x9: Minimum SCENARIO_BALANCE_FLAG required for this category to be considered. // Is 0x2 for the gabite scale mission category, and 0x0 for all other categories. uint8_t min_scenario_balance; From eec26234b5e27ccf19d3d4ebd2e20a8904fbda3c Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 6 Jun 2025 18:15:11 -0400 Subject: [PATCH 023/151] remove enums from mission_weighted_cetegory :D --- 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 3bc14810..49412a66 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -1021,7 +1021,7 @@ struct mission_weighted_category { // 0x6: Weight for this category to appear in a bottle on the beach uint16_t bottle_weight; // 0x8: Minimum Guild Rank required for this category to be considered - enum rank minimum_rank; + uint8_t minimum_rank; // 0x9: Minimum SCENARIO_BALANCE_FLAG required for this category to be considered. // Is 0x2 for the gabite scale mission category, and 0x0 for all other categories. uint8_t min_scenario_balance; From 4a3018fc94db8c9c9af54eef66748b5edb23424b Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 6 Jun 2025 18:18:13 -0400 Subject: [PATCH 024/151] C Syntax (x2) :D --- headers/types/common/common.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index 49412a66..b76c7a14 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -1006,6 +1006,7 @@ struct mission_template { struct mission_type_8 type; // 0x20 union mission_subtype subtype; // 0x21 }; + ASSERT_SIZE(struct mission_rescue_bin, 34); // Information valid mission; a list of these structs is stored in and directly loaded from @@ -1031,7 +1032,8 @@ struct mission_weighted_category { uint16_t number_of_templates; // 0xE: Index of the first mission_template struct within this category uint16_t first_template_index; -} +}; + ASSERT_SIZE(struct mission_weighted_category, 16); From 966de7f937d4a46837b44f4b4735bf9f4c763b70 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 6 Jun 2025 18:18:51 -0400 Subject: [PATCH 025/151] Move ";" from enum to common :D :D :D --- 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 b7f822b7..e4068eaf 100644 --- a/headers/types/common/enums.h +++ b/headers/types/common/enums.h @@ -3753,7 +3753,7 @@ ENUM_8_BIT(mission_type); // Mission subtype for mission types without distinct subtypes enum mission_subtype_other { - MISSION_TEMPLATE_DEFAULT = 0; + MISSION_TEMPLATE_DEFAULT = 0 }; // This is usually stored as an 8-bit integer From 4df0d9362c10af5e4254c18009bb99af69932b4d Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 6 Jun 2025 18:20:52 -0400 Subject: [PATCH 026/151] Maybe I should assert the size of the right struct... --- 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 b76c7a14..469e61cf 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -1007,7 +1007,7 @@ struct mission_template { union mission_subtype subtype; // 0x21 }; -ASSERT_SIZE(struct mission_rescue_bin, 34); +ASSERT_SIZE(struct mission_template, 34); // Information valid mission; a list of these structs is stored in and directly loaded from // RESCUE/rescue.bin at 0x6520, where 40 of these structs exist. One of these categories is picked From f0fa197b9bf52593f293da61aae66af65cca6c54 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 6 Jun 2025 20:01:42 -0400 Subject: [PATCH 027/151] Slowly learning how enums work... --- headers/types/common/common.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index 469e61cf..60949b8c 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -964,7 +964,7 @@ struct mission_template { uint16_t text_string_offset; // 0x2: Called in a switch case at 0x0205DED4 [EU] during mission generation // which affect how the template_item_data are interpreted - enum mission_template_item_case item_case; + enum mission_template_item_case item_case : 2; // 0x4: Ignored if mission_template_item_case is not "0x2". union mission_template_item_data_1 template_item_data_1; // 0x6: Ignored if mission_template_item_case is "0x4". @@ -973,7 +973,7 @@ struct mission_template { // 0x8: Called in a switch case at 0x0205DED4 [EU] during mission generation // For legendary challenge missions, is also used as a boolean to indicate whether or not // accepting the mission unlocks its dungeon. - enum mission_template_dungeon_case dungeon_case; + enum mission_template_dungeon_case dungeon_case : 2; // 0xA: Always Zero in the template, not referenced during mission generation. undefined field_0xa; // 0xB: Always Zero in the template, not referenced during mission generation. @@ -982,7 +982,7 @@ struct mission_template { // Use is governed by mission_template_dungeon_case int16_t restricted_dungeon; // 0xE: Called in a switch case at 0x0205D8C4 [EU] during mission generation - enum mission_template_client_case client_case; + enum mission_template_client_case client_case : 2; // 0x10: Ignored if mission_template_client_case is not "0x2" union mission_template_client_data_1 template_client_data_1; // 0x12: Ignored if mission_template_client_case is "0x4" @@ -990,14 +990,14 @@ struct mission_template { // Usually stores a monster_id union mission_template_client_data_2 template_client_data_2; // 0x14: Called in a looped switch case at 0x0205DBEC[EU] during mission generation - enum mission_template_target_case target_case_1; + enum mission_template_target_case target_case_1 : 2; // 0x16: Ignored if mission_template_target_case (at 0x14) is not "0x2" union mission_template_target_data_1 template_target_data_1; // 0x18: Ignored if mission_template_target_case (at 0x14) is "0x4" or "0x6" // For non-legendary challenge letter missions, stores the second team member union mission_template_target_data_2 template_target_data_2; // 0x1A: Called in the same looped switch case at 0x0205DBEC[EU] during mission generation - enum mission_template_target_case target_backup_case_1; + enum mission_template_target_case target_backup_case_1 : 2; // 0x1C: Ignored if mission_template_target_case (at 0x1A) is not "0x2" union mission_template_target_data_1 target_backup_data_1; // 0x1E: Ignored if mission_template_target_case (at 0x1A) is "0x4" or "0x6" From ab055ba18cc175a45f7236ca9e924209a98a20b5 Mon Sep 17 00:00:00 2001 From: Parker Zhiss <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 6 Jun 2025 20:12:50 -0400 Subject: [PATCH 028/151] Formatting yay! --- headers/functions/arm9.h | 4 +- headers/types/common/common.h | 35 ++++----- headers/types/common/enums.h | 95 ++++++++++++------------- headers/types/dungeon_mode/enums.h | 1 - headers/types/files/rescue.h | 109 ++++++++++++++--------------- 5 files changed, 115 insertions(+), 129 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 03617589..b22e100e 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -1095,7 +1095,7 @@ int GenerateAllPossibleDeliverList(void); void DeleteAllPossibleDeliverList(void); void ClearMissionData(struct mission* mission); void GenerateMissionDetailsStruct(struct mission* mission, struct mission_details* details, - undefined unk_2, undefined unk_3); + undefined unk_2, undefined unk_3); bool ValidateNormalChallengeMission(struct mission_template* valid_mission_info, struct mission* mission); bool ValidateLegendaryChallengeMission(struct mission_template* valid_mission_info, @@ -1103,7 +1103,7 @@ bool ValidateLegendaryChallengeMission(struct mission_template* valid_mission_in void AppendMissonTitle(char* main_buffer, char* temp_buffer, struct preprocessor_args* args, struct mission_details* details); void AppendMissonSummary(char* main_buffer, char* temp_buffer, struct preprocessor_args* args, - int window_id, int y_offset, struct mission_details* details); + int window_id, int y_offset, struct mission_details* details); 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 60949b8c..23996292 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -819,7 +819,6 @@ struct mission_floors_forbidden { }; ASSERT_SIZE(struct mission_floors_forbidden, 2); - // Used throughout the process of displaying a mission struct mission_details { undefined field_0x0; @@ -831,7 +830,7 @@ struct mission_details { undefined field_0x6; undefined field_0x7; // 0x8: Pointer to mission struct + 0x4 (new substruct?) - struct mission *mission_ptr; + struct mission* mission_ptr; undefined field_0xb; undefined field_0xc; undefined field_0xd; @@ -918,19 +917,18 @@ struct mission_details { undefined field_0x5e; undefined field_0x5f; // 0x60: pointer to mission_template struct - struct mission_template *template_ptr; + struct mission_template* template_ptr; }; // mission_details is at least this big. unclear bigger it actually is. ASSERT_SIZE(struct mission_details, 104); - // Information about a valid mission; a list of these structs is stored in and directly loaded from // RESCUE/rescue.bin at 0x20, where 481 of these structs exist. These are used to select a string // from MISSION_STRING_IDS at random, to provide variance to mission flavor text. struct rescue_str_variant_group { - // 0x0: Index of MISSION_STRING_IDS the group starts from. + // 0x0: Index of MISSION_STRING_IDS the group starts from. uint16_t starting_index; - // 0x2: Number of other MISSION_STRING_IDS entries the group contains. A random int on the range + // 0x2: Number of other MISSION_STRING_IDS entries the group contains. A random int on the range // [0, group_size) is added to starting_index to produce the final MISSION_STRING_ID entry. // This final index is reused to select an index in rescue_str_continuity_table uint16_t group_size; @@ -938,7 +936,6 @@ struct rescue_str_variant_group { ASSERT_SIZE(struct rescue_str_variant_group, 4); - // Information about a valid mission; a list of these structs is stored in and directly loaded from // RESCUE/rescue.bin at 0x7C0, where 964 of these structs exist. These correspond to each string in // MISSION_STRING_IDS, and determines whether other strings should be appended to them. @@ -947,30 +944,29 @@ struct rescue_str_continuity { * If 0xFFFF, there is no next string. * If 0x1NNN, index 0xNNN is for a summary string, NOT a title string. * If 0x0NNN, index 0xNNN is for a title string, NOT a summary string. - */ + */ uint16_t next_variant_table_id; }; ASSERT_SIZE(struct rescue_str_continuity, 2); - // Information about a valid mission; a list of these structs is stored in and directly loaded from -// RESCUE/rescue.bin at 0x1560, where 600 of these structs exist. These are templates for mission generation, -// which are categorized by mission_weighted_category above. +// RESCUE/rescue.bin at 0x1560, where 600 of these structs exist. These are templates for mission +// generation, which are categorized by mission_weighted_category above. struct mission_template { // 0x0: Points to an index for mission_title_groups and mission_summary_groups - // These structs contain data for an appropriate range of titles/summaries + // These structs contain data for an appropriate range of titles/summaries // for the mission template from MISSION_STRING_IDS. uint16_t text_string_offset; - // 0x2: Called in a switch case at 0x0205DED4 [EU] during mission generation + // 0x2: Called in a switch case at 0x0205DED4 [EU] during mission generation // which affect how the template_item_data are interpreted enum mission_template_item_case item_case : 2; - // 0x4: Ignored if mission_template_item_case is not "0x2". + // 0x4: Ignored if mission_template_item_case is not "0x2". union mission_template_item_data_1 template_item_data_1; // 0x6: Ignored if mission_template_item_case is "0x4". // Usually stores the item_id of an item used in the mission union mission_template_item_data_2 template_item_data_2; - // 0x8: Called in a switch case at 0x0205DED4 [EU] during mission generation + // 0x8: Called in a switch case at 0x0205DED4 [EU] during mission generation // For legendary challenge missions, is also used as a boolean to indicate whether or not // accepting the mission unlocks its dungeon. enum mission_template_dungeon_case dungeon_case : 2; @@ -978,18 +974,18 @@ struct mission_template { undefined field_0xa; // 0xB: Always Zero in the template, not referenced during mission generation. undefined field_0xb; - // 0xC: Dungeon this mission is restricted to, or 0xFF if none. + // 0xC: Dungeon this mission is restricted to, or 0xFF if none. // Use is governed by mission_template_dungeon_case - int16_t restricted_dungeon; + int16_t restricted_dungeon; // 0xE: Called in a switch case at 0x0205D8C4 [EU] during mission generation enum mission_template_client_case client_case : 2; // 0x10: Ignored if mission_template_client_case is not "0x2" union mission_template_client_data_1 template_client_data_1; // 0x12: Ignored if mission_template_client_case is "0x4" - // For challenge letter missions, stores the leader (who is ALSO the client) + // For challenge letter missions, stores the leader (who is ALSO the client) // Usually stores a monster_id union mission_template_client_data_2 template_client_data_2; - // 0x14: Called in a looped switch case at 0x0205DBEC[EU] during mission generation + // 0x14: Called in a looped switch case at 0x0205DBEC[EU] during mission generation enum mission_template_target_case target_case_1 : 2; // 0x16: Ignored if mission_template_target_case (at 0x14) is not "0x2" union mission_template_target_data_1 template_target_data_1; @@ -1036,7 +1032,6 @@ struct mission_weighted_category { ASSERT_SIZE(struct mission_weighted_category, 16); - // Unverified, ported from Irdkwia's notes struct quiz_answer_points_entry { undefined field_0x0; diff --git a/headers/types/common/enums.h b/headers/types/common/enums.h index e4068eaf..b40d8bc0 100644 --- a/headers/types/common/enums.h +++ b/headers/types/common/enums.h @@ -3752,9 +3752,7 @@ ENUM_8_BIT(mission_type); #pragma pack(pop) // Mission subtype for mission types without distinct subtypes -enum mission_subtype_other { - MISSION_TEMPLATE_DEFAULT = 0 -}; +enum mission_subtype_other { MISSION_TEMPLATE_DEFAULT = 0 }; // This is usually stored as an 8-bit integer #pragma pack(push, 1) @@ -3763,16 +3761,16 @@ ENUM_8_BIT(mission_subtype_other); // Mission subtype for MISSION_RESCUE_TARGET // The distinction is mainly for dialogue -enum mission_subtype_rescue_target { +enum mission_subtype_rescue_target { // Client and Target are randomly selected MISSION_RESCUE_CLIENT_TARGET_RANDOM = 0, - // Client is the evolved form of the target + // Client is the evolved form of the target // (IE: Beedrill/Weedle, Aggron/Aron) - MISSION_RESCUE_CLIENT_TARGET_CHILD = 1, - // Client and Target are deeply similar + MISSION_RESCUE_CLIENT_TARGET_CHILD = 1, + // Client and Target are deeply similar // (IE: Dodrio/Exeggutor, Muk/Swalot, Magikarp/Feebas) - MISSION_RESCUE_CLIENT_TARGET_SIMILAR_FRIENDS = 2, - // Client and Target are lovers or rivals + MISSION_RESCUE_CLIENT_TARGET_SIMILAR_FRIENDS = 2, + // Client and Target are lovers or rivals // (IE: Nidoking/Nidoqueen, Seviper/Zangoose, Volbeat/Illumise) MISSION_RESCUE_CLIENT_TARGET_LOVERS_RIVALS = 3 }; @@ -3783,10 +3781,10 @@ ENUM_8_BIT(mission_subtype_rescue_target); #pragma pack(pop) // Mission subtype for MISSION_ESCORT_TO_TARGET -enum mission_subtype_escort_to_target { +enum mission_subtype_escort_to_target { // Client and Target are randomly selected - MISSION_ESCORT_CLIENT_TARGET_RANDOM = 0, - // Client and Target are counterparts + MISSION_ESCORT_CLIENT_TARGET_RANDOM = 0, + // Client and Target are counterparts // (IE: Nidoran-M/Nidoran-F, Volbeat/Illumise, Miltank/Tauros) MISSION_ESCORT_CLIENT_TARGET_SPECIFIC = 1 }; @@ -3809,21 +3807,20 @@ enum mission_subtype_explore { ENUM_8_BIT(mission_subtype_explore); #pragma pack(pop) - // Mission subtype for MISSION_FIND_ITEM -enum mission_subtype_find_item { +enum mission_subtype_find_item { // In the template, pulls from the "common" table in rescue_item_tables. // Client is random - MISSION_FIND_ITEM_COMMON_TABLE = 0, + MISSION_FIND_ITEM_COMMON_TABLE = 0, // In the template, pulls from the "rare" table in rescue_item_tables. // Client is random - MISSION_FIND_ITEM_RARE_TABLE = 1, + MISSION_FIND_ITEM_RARE_TABLE = 1, // Item is an evolution item for the client // (IE: Gloom/Leaf Stone, Dusclops/Reaper Cloth, Magmar/Magmarizer) - MISSION_FIND_ITEM_EVOLVES_CLIENT = 2, + MISSION_FIND_ITEM_EVOLVES_CLIENT = 2, // Item is a gummi of one of the client's types // (IE: Flaafy/Yellow Gummi, Baltoy/Brown Gummi, Dratini/Royal Gummi) - MISSION_FIND_ITEM_CLIENT_FAVORITE_GUMMI = 3, + MISSION_FIND_ITEM_CLIENT_FAVORITE_GUMMI = 3, // This is the special Togetic Mission that unlocks Labyrinth Cave MISSION_TOGETIC_GABITE_SCALE = 4 }; @@ -3868,8 +3865,9 @@ ENUM_8_BIT(mission_subtype_outlaw); // Mission subtype for MISSION_CHALLENGE_REQUEST enum mission_subtype_challenge { - // One of 28 specific pairings - // (IE: Charizard/Blastoise/Venusaur, Hitmontop/Hitmonchan/HitmonLee, Nidoking/Nidorina/Nidorino) + // One of 28 specific pairings + // (IE: Charizard/Blastoise/Venusaur, Hitmontop/Hitmonchan/HitmonLee, + // Nidoking/Nidorina/Nidorino) MISSION_CHALLENGE_NORMAL = 0, MISSION_CHALLENGE_MEWTWO = 1, MISSION_CHALLENGE_ENTEI = 2, @@ -3883,12 +3881,11 @@ enum mission_subtype_challenge { ENUM_8_BIT(mission_subtype_challenge); #pragma pack(pop) - // Mission subtype for MISSION_SPECIAL_EPISODE -enum mission_subtype_special_episode { - MISSION_SE_UNK_0 = 0, +enum mission_subtype_special_episode { + MISSION_SE_UNK_0 = 0, // Checked for at 0x0205E2E0 [EU] when determining mission restrictions - MISSION_SE_UNK_1 = 1, + MISSION_SE_UNK_1 = 1, MISSION_SE_UNK_2 = 2 }; @@ -3898,8 +3895,8 @@ ENUM_8_BIT(mission_subtype_special_episode); #pragma pack(pop) // Mission subtype for MISSION_SEVEN_TREASURE -enum mission_subtype_seven_treasure { - MISSION_SEVEN_UNK_0 = 0, +enum mission_subtype_seven_treasure { + MISSION_SEVEN_UNK_0 = 0, // Subtype 0x1 is used in the template, NOT 0x0 MISSION_SEVEN_TEMPLATE = 1 }; @@ -3932,8 +3929,8 @@ enum mission_reward_type { // Exclusive Item, displayed as "(?)" (Will be 1 star, and beneficial of the client/target) // $SCENARIO_MAIN must be [8, 0] or above AND mission rank must be >=5 stars to be selected. // Also used for the Togetic Wing given from the Gabite Scale mission. - MISSION_REWARD_EXCLUSIVE_ITEM = 4, - // Money, displayed as "(?)" + MISSION_REWARD_EXCLUSIVE_ITEM = 4, + // Money, displayed as "(?)" // $SCENARIO_MAIN must be [12, 0] or above to be selected. MISSION_REWARD_MONEY_HIDDEN = 5, // Either an egg or the client requests to join the team, displayed as "(?)" @@ -3979,18 +3976,17 @@ enum mission_status { ENUM_8_BIT(mission_status); #pragma pack(pop) - enum mission_template_item_case { // Treated same as ITEM_CASE_SPECIFIC_ITEM, unused in template - ITEM_CASE_UNK_0 = 0, + ITEM_CASE_UNK_0 = 0, // mission_template_item_data_1 is ignored, and mission_template_item_data_2 is an item_id - ITEM_CASE_SPECIFIC_ITEM = 1, + ITEM_CASE_SPECIFIC_ITEM = 1, // mission_template_item_data_1 and mission_template_item_data_2 are indices to a table - ITEM_CASE_USE_ITEM_TABLE = 2, + ITEM_CASE_USE_ITEM_TABLE = 2, // Has a distinct case menu, unused in template. - ITEM_CASE_UNK_3 = 3, + ITEM_CASE_UNK_3 = 3, // mission_template_item_data_1 and mission_template_item_data_2 are ignored - ITEM_CASE_NO_ITEM = 4 + ITEM_CASE_NO_ITEM = 4 }; union mission_template_item_data_1 { @@ -4000,29 +3996,27 @@ union mission_template_item_data_1 { union mission_template_item_data_2 { uint16_t none; - uint16_t template_item_table_id; // if ITEM_CASE_USE_ITEM_TABLE + uint16_t template_item_table_id; // if ITEM_CASE_USE_ITEM_TABLE struct item_id_16 mission_item_id; // if ITEM_CASE_SPECIFIC_ITEM }; - - enum mission_template_dungeon_case { DUNGEON_CASE_SPECIFIC_OPENED = 0, // Used for Legendary Challenge Letters, among other things DUNGEON_CASE_SPECIFIC_CLOSED = 1, // Used for Jirachi Challenge Letter and Togetic Mission - DUNGEON_CASE_UNK_2 = 2, // Treated same as DUNGEON_CASE_REVEALED_AND_UNLOCKED - DUNGEON_CASE_UNK_3 = 3, // Treated same as DUNGEON_CASE_REVEALED_AND_UNLOCKED - DUNGEON_CASE_RANDOM_OPEN = 4, // Used for most missions - DUNGEON_CASE_RANDOM_CLOSED = 5 // Used for EXPLORE_NEW_DUNGEON subtype + DUNGEON_CASE_UNK_2 = 2, // Treated same as DUNGEON_CASE_REVEALED_AND_UNLOCKED + DUNGEON_CASE_UNK_3 = 3, // Treated same as DUNGEON_CASE_REVEALED_AND_UNLOCKED + DUNGEON_CASE_RANDOM_OPEN = 4, // Used for most missions + DUNGEON_CASE_RANDOM_CLOSED = 5 // Used for EXPLORE_NEW_DUNGEON subtype }; enum mission_template_client_case { // Must be attacked in a dungeon to yield a valid mission - CLIENT_CASE_FIXED_CLIENT_OLD = 0, + CLIENT_CASE_FIXED_CLIENT_OLD = 0, // Does not need to be attacked in a dungeon to yield a valid mission // Examples include magnemite/magnezone, and legendary challenge letters CLIENT_CASE_FIXED_CLIENT_NEW = 1, // mission_template_client_data_1 and mission_template_client_data_2 are indices to a table - // This determines the final client in a more restricted manner. + // This determines the final client in a more restricted manner. // Only used for MISSION_GUIDE_CLIENT in the template CLIENT_CASE_TABLE_CLIENT = 2, // Has a distinct case menu, unused in template. @@ -4032,24 +4026,24 @@ enum mission_template_client_case { }; union mission_template_client_data_1 { - uint16_t none; + uint16_t none; uint16_t template_client_table_id; // if CLIENT_CASE_TABLE_CLIENT }; union mission_template_client_data_2 { - uint16_t none; // If CLIENT_CASE_RANDOM_CLIENT + uint16_t none; // If CLIENT_CASE_RANDOM_CLIENT uint16_t template_client_table_id; // if CLIENT_CASE_TABLE_CLIENT struct monster_id_16 client; // if CLIENT_CASE_FIXED_CLIENT_OLD or CLIENT_CASE_FIXED_CLIENT_NEW }; enum mission_template_target_case { // Must be attacked in a dungeon to yield a valid mission - TARGET_CASE_FIXED_TARGET_OLD = 0, + TARGET_CASE_FIXED_TARGET_OLD = 0, // Does not need to be attacked in a dungeon to yield a valid mission // Not present in template. TARGET_CASE_FIXED_TARGET_NEW = 1, // mission_template_target_data_1 and mission_template_target_data_2 are indices to a table - // This determines the final target in a more restricted manner. + // This determines the final target in a more restricted manner. // Primarily used for outlaw missions in the template TARGET_CASE_TABLE_TARGET = 2, // Has a distinct case menu, unused in template. @@ -4062,17 +4056,16 @@ enum mission_template_target_case { }; union mission_template_target_data_1 { - uint16_t none; + uint16_t none; uint16_t template_target_table_id; // if TARGET_CASE_TABLE_CLIENT }; union mission_template_target_data_2 { - uint16_t none; // If CASE_RANDOM_TARGET or TARGET_CASE_RANDOM_TARGET_06 + uint16_t none; // If CASE_RANDOM_TARGET or TARGET_CASE_RANDOM_TARGET_06 uint16_t template_target_table_id; // if TARGET_CASE_TABLE_TARGET - struct monster_id_16 target; // if TARGET_CASE_FIXED_TARGET_OLD + struct monster_id_16 target; // if TARGET_CASE_FIXED_TARGET_OLD }; - // base-level 3D rendering variants enum render_type { // solid rectangle diff --git a/headers/types/dungeon_mode/enums.h b/headers/types/dungeon_mode/enums.h index 1b1fe30f..f353d76e 100644 --- a/headers/types/dungeon_mode/enums.h +++ b/headers/types/dungeon_mode/enums.h @@ -870,7 +870,6 @@ enum dungeon_objective { ENUM_8_BIT(dungeon_objective); #pragma pack(pop) - // The cause of a monster taking damage, not including the move case. // These codes should all be greater than any move ID. // Some of the values are used as faint reasons or on the "The Last Outing" screen diff --git a/headers/types/files/rescue.h b/headers/types/files/rescue.h index 758570e6..e2d2d041 100644 --- a/headers/types/files/rescue.h +++ b/headers/types/files/rescue.h @@ -7,12 +7,12 @@ // 0x0 in rescue.bin struct rescue_header { - struct rescue_str_variant_table* variant_table_pointer; // 0x00 + struct rescue_str_variant_table* variant_table_pointer; // 0x00 struct rescue_str_continuity_table* continuity_table_pointer; // 0x04 - struct rescue_item_tables* item_tables_pointer; // 0x08 - struct rescue_monster_tables* monster_tables_pointer; // 0x0C - struct mission_templates_table* template_table_pointer; // 0x10 - struct mission_categories_table* category_table_pointer; // 0x14 + struct rescue_item_tables* item_tables_pointer; // 0x08 + struct rescue_monster_tables* monster_tables_pointer; // 0x0C + struct mission_templates_table* template_table_pointer; // 0x10 + struct mission_categories_table* category_table_pointer; // 0x14 // Likely Padding undefined field1_0x18; undefined field1_0x19; @@ -36,9 +36,6 @@ struct rescue_str_variant_table { ASSERT_SIZE(struct rescue_str_variant_table, 1952); - - - // Table of rescue_str_continuity structs, corresponding to each string in MISSION_TEXT_STRINGS // and determines what index of the rescue_str_variant_table should follow each one (if any). // 0x7C0 in rescue.bin @@ -48,20 +45,19 @@ struct rescue_str_continuity_table { ASSERT_SIZE(struct rescue_str_continuity_table, 1952); - // Item tables used by certain mission templates. This could be considered as one table, -// though in the templates themselves, none of the ranges overlap. +// though in the templates themselves, none of the ranges overlap. // 0xF48 in rescue.bin struct rescue_item_tables { - // [0, 22): The "Common Table" seems to be for easily obtainable items of low value. - // Used by TAKE_ITEM_FROM_OUTLAW and DELIVER_ITEM templates, as well as the FIND_ITEM + // [0, 22): The "Common Table" seems to be for easily obtainable items of low value. + // Used by TAKE_ITEM_FROM_OUTLAW and DELIVER_ITEM templates, as well as the FIND_ITEM // template with the MISSION_ITEM_COMMON_TABLE subtype. Mostly Seeds, Berries, and Orbs. // Life Seeds, Sitrus Berries, and Reviver Seeds are on this table, for some reason. struct item_id_16 common_table[22]; - // [22, 42): The "Rare Table" seems to be for higher-value items, more suitable for their mission types. - // Used only by the PROSPECT_WITH_CLIENT subtype, as well as the FIND_ITEM template with the - // MISSION_ITEM_RARE_TABLE subtype. Consists mostly of Gummis, but Lost Loot is also present. - // Sitrus Berries and Reviver Seeds are ALSO on this table, for some reason. + // [22, 42): The "Rare Table" seems to be for higher-value items, more suitable for their + // mission types. Used only by the PROSPECT_WITH_CLIENT subtype, as well as the FIND_ITEM + // template with the MISSION_ITEM_RARE_TABLE subtype. Consists mostly of Gummis, but Lost Loot + // is also present. Sitrus Berries and Reviver Seeds are ALSO on this table, for some reason. struct item_id_16 rare_table[20]; // If this is an item table, it's always zero and unused by any template. uint16_t padding[2]; @@ -70,61 +66,65 @@ struct rescue_item_tables { ASSERT_SIZE(struct rescue_item_tables, 176); // Pokemon tables used by certain mission templates. This could be considered as one table, -// though barring one exception, none of the ranges overlap. +// though barring one exception, none of the ranges overlap. // 0xFA0 in rescue.bin struct rescue_monster_tables { - // [0, 65): Used exclusively for the OUTLAW_NORMAL_2 mission subtype, and consists mostly of middle-stage - // evolutions, such as Flaafy and Pidgeotto, with a few of the stronger fully-evolved pokemon like Masquerain and Beautifly. - // Seem to be stronger on average than those in normal_outlaw_3_table. + // [0, 65): Used exclusively for the OUTLAW_NORMAL_2 mission subtype, and consists mostly of + // middle-stage evolutions, such as Flaafy and Pidgeotto, with a few of the stronger + // fully-evolved pokemon like Masquerain and Beautifly. Seem to be stronger on average than + // those in normal_outlaw_3_table. struct monster_id_16 normal_outlaw_2_table[65]; - // [65, 106): Used exclusively for the OUTLAW_NORMAL_2 mission subtype, and consists mostly of basic - // Pokemon, such as Lotad, Teddiursa, and Abra. Also contains all 3 forms of Burmy and Wormadam. + // [65, 106): Used exclusively for the OUTLAW_NORMAL_2 mission subtype, and consists mostly of + // basic Pokemon, such as Lotad, Teddiursa, and Abra. Also contains all 3 forms of Burmy and + // Wormadam. struct monster_id_16 normal_outlaw_3_table[41]; - // [106, 167): Used exclusively for fleeing outlaws, such as OUTLAW_FLEEING and TAKE_ITEM_FLEEING_OUTLAW. - // Consists mostly of cowardly Pokemon such as Magikarp, Dunsparce, or Luvdisc, as well as fast Pokemon like - // Doduo, Ponyta, Ninjask, and Yanmega. + // [106, 167): Used exclusively for fleeing outlaws, such as OUTLAW_FLEEING and + // TAKE_ITEM_FLEEING_OUTLAW. Consists mostly of cowardly Pokemon such as Magikarp, Dunsparce, or + // Luvdisc, as well as fast Pokemon like Doduo, Ponyta, Ninjask, and Yanmega. struct monster_id_16 fleeing_outlaw_table[61]; - // [167, 211): Used exclusively for the OUTLAW_MONSTER_HOUSE mission subtype, and consists mostly of evolved Pokemon - // such as Tyranitar, Nidoking, Honchkrow, and Metagross. Manetric, Electrike, Chinchou, and Lanturn are also present. + // [167, 211): Used exclusively for the OUTLAW_MONSTER_HOUSE mission subtype, and consists + // mostly of evolved Pokemon such as Tyranitar, Nidoking, Honchkrow, and Metagross. Manetric, + // Electrike, Chinchou, and Lanturn are also present. struct monster_id_16 monster_house_outlaw_table[44]; - // [211, 244): Used for the OUTLAW_ESCORT mission subtype, and consists mostly of intimidating pokemon such as - // Arbok, Absol, Sharpedo, and Drapion, as well as pseudo-legendaries such as Metagross, Dragonite, Garchomp, Tyranitar, - // and Salamence. Every Pokemon on this list is fully evolved if it has evolutions. This list is the same regardless of - // Whether Magnezone or Magnemite accompanies you. Overlaps with the range used by the GUIDE_CLIENT template. - - // [227, 471): Used for the GUIDE_CLIENT mission type, and consists of a wide variety of Pokemon defying categorization. - // Outside of the overlap, the list seems to contain mostly weaker Pokemon. There is one invalid Pokemon entry in this table, 0x0CBE. - // Likely intended to be Aipom (0xBE). Should be filtered out by mission generation. - // Because these two tables overlap, it is most efficient to merge them in this struct. + // [211, 244): Used for the OUTLAW_ESCORT mission subtype, and consists mostly of intimidating + // pokemon such as Arbok, Absol, Sharpedo, and Drapion, as well as pseudo-legendaries such as + // Metagross, Dragonite, Garchomp, Tyranitar, and Salamence. Every Pokemon on this list is fully + // evolved if it has evolutions. This list is the same regardless of Whether Magnezone or + // Magnemite accompanies you. Overlaps with the range used by the GUIDE_CLIENT template. + + // [227, 471): Used for the GUIDE_CLIENT mission type, and consists of a wide variety of Pokemon + // defying categorization. Outside of the overlap, the list seems to contain mostly weaker + // Pokemon. There is one invalid Pokemon entry in this table, 0x0CBE. Likely intended to be + // Aipom (0xBE). Should be filtered out by mission generation. Because these two tables overlap, + // it is most efficient to merge them in this struct. struct monster_id_16 magnet_escort_and_guide_client_table[260]; - // [471, 582): Used for the OUTLAW_NORMAL_0 mission type, as well as one of the TAKE_ITEM_NORMAL_OUTLAW templates. - // Consists mostly of unevolved Pokemon, such as Anorith, Weedle, Magby, and Buizel. Outliers exist, such as Victreebel, - // Hitmonlee, and Hitmonchan, but the vast majority are unevolved. Seem to be weaker on average than the normal_outlaw_1_table. + // [471, 582): Used for the OUTLAW_NORMAL_0 mission type, as well as one of the + // TAKE_ITEM_NORMAL_OUTLAW templates. Consists mostly of unevolved Pokemon, such as Anorith, + // Weedle, Magby, and Buizel. Outliers exist, such as Victreebel, Hitmonlee, and Hitmonchan, but + // the vast majority are unevolved. Seem to be weaker on average than the normal_outlaw_1_table. struct monster_id_16 normal_outlaw_0_table[111]; - // [582, 725): Used for the OUTLAW_NORMAL_1 mission type, as well as the other TAKE_ITEM_NORMAL_OUTLAW template. - // Consists mostly of fully-evolved Pokemon, such as Blaziken, Tyranitar, Torterra, and Gengar. Outliers exists, - // such as Gligar, Golbat, Cubone, and Cranidos. + // [582, 725): Used for the OUTLAW_NORMAL_1 mission type, as well as the other + // TAKE_ITEM_NORMAL_OUTLAW template. Consists mostly of fully-evolved Pokemon, such as Blaziken, + // Tyranitar, Torterra, and Gengar. Outliers exists, such as Gligar, Golbat, Cubone, and + // Cranidos. struct monster_id_16 normal_outlaw_1_table[143]; uint16_t padding[11]; } ASSERT_SIZE(struct rescue_monster_tables, 2944); - -// Table of mission templates used for mission generation. A template is chosen from range indicated by the -// selected mission_weighted_category, and GenerateMission converts the template into a mission struct. -// 0x1560 in rescue.bin +// Table of mission templates used for mission generation. A template is chosen from range indicated +// by the selected mission_weighted_category, and GenerateMission converts the template into a +// mission struct. 0x1560 in rescue.bin struct mission_templates_table { - struct mission_template [600]; + struct mission_template[600]; uint16 padding[4]; -} -ASSERT_SIZE(struct mission_templates_table, 20416); +} ASSERT_SIZE(struct mission_templates_table, 20416); - -// One of these categories is selected via weighted random whenever the game tries to generate a mission. -// Each category corresponds to a range of templates in mission_template_table, which contains the specifics -// of the missions themselves. This struct is primarily used for generation restrictions. -// 0x6520 in rescue.bin +// One of these categories is selected via weighted random whenever the game tries to generate a +// mission. Each category corresponds to a range of templates in mission_template_table, which +// contains the specifics of the missions themselves. This struct is primarily used for generation +// restrictions. 0x6520 in rescue.bin struct mission_categories_table { struct mission_weighted_category mission_categories[39]; // Initially thought this to be a failsafe mission category, but this seems to just be padding. @@ -132,4 +132,3 @@ struct mission_categories_table { } ASSERT_SIZE(struct mission_categories_table, 640); - From 2a72129f0b1aae60922859cff41a56d67aed058d Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 6 Jun 2025 20:15:35 -0400 Subject: [PATCH 029/151] Look ma! I'm in the credits! --- CREDITS.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CREDITS.txt b/CREDITS.txt index 55581f85..2373a3a7 100644 --- a/CREDITS.txt +++ b/CREDITS.txt @@ -34,6 +34,8 @@ other parts of the project, feel free to add yourself to this file! - ElectricGeorge - Assidion - Chritchy +- happylappy + - The rest of the contributors to Project Pokémon's technical documentation for the NDS Mystery Dungeon games, which can be found here: https://projectpokemon.org/home/docs/mystery-dungeon-nds/ From 616fd27de9ea75b8851c69cffaac71ce2ec65c9e Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 6 Jun 2025 20:17:16 -0400 Subject: [PATCH 030/151] Yeah that makes sense... Please be fix? --- symbols/arm9.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 2543ce38..bbd88cbb 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -10485,8 +10485,6 @@ arm9: - name: GenerateMissionDetailsStruct address: EU: 0x2060B80 - NA: - JP: description: |- Generates a mission_details struct, to be used for printing mission details such as the title, summary, and objective. @@ -10519,8 +10517,6 @@ arm9: - name: AppendMissionTitle address: EU: 0x02060D8C - NA: - JP: description: |- Generates the mission title of the mission, and appends it to the string location. r0: [output] output buffer @@ -10530,8 +10526,6 @@ arm9: - name: AppendMissionTitle address: EU: 0x02060D8C - NA: - JP: description: |- Generates the mission title of a mission, and appends it to the string location. r0: [output] output buffer @@ -10541,8 +10535,6 @@ arm9: - name: AppendMissionSummary address: EU: 0x02060D8C - NA: - JP: description: |- Generates the mission title of a mission, and appends it to the string location. r0: [output] main string location From 78dbaf8536d9b1b8d9dd7c8a63138579e0365d1a Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 6 Jun 2025 20:28:11 -0400 Subject: [PATCH 031/151] Learning to pragma --- headers/types/common/enums.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/headers/types/common/enums.h b/headers/types/common/enums.h index b40d8bc0..8ec94b0a 100644 --- a/headers/types/common/enums.h +++ b/headers/types/common/enums.h @@ -3989,17 +3989,24 @@ enum mission_template_item_case { ITEM_CASE_NO_ITEM = 4 }; +#pragma pack(push, 2) +ENUM_16_BIT(mission_template_item_case); +#pragma pack(pop) + union mission_template_item_data_1 { uint16_t none; uint16_t template_item_table_id; // if ITEM_CASE_USE_ITEM_TABLE }; + union mission_template_item_data_2 { uint16_t none; uint16_t template_item_table_id; // if ITEM_CASE_USE_ITEM_TABLE struct item_id_16 mission_item_id; // if ITEM_CASE_SPECIFIC_ITEM }; + + enum mission_template_dungeon_case { DUNGEON_CASE_SPECIFIC_OPENED = 0, // Used for Legendary Challenge Letters, among other things DUNGEON_CASE_SPECIFIC_CLOSED = 1, // Used for Jirachi Challenge Letter and Togetic Mission @@ -4009,6 +4016,11 @@ enum mission_template_dungeon_case { DUNGEON_CASE_RANDOM_CLOSED = 5 // Used for EXPLORE_NEW_DUNGEON subtype }; +#pragma pack(push, 2) +ENUM_16_BIT(mission_template_dungeon_case); +#pragma pack(pop) + + enum mission_template_client_case { // Must be attacked in a dungeon to yield a valid mission CLIENT_CASE_FIXED_CLIENT_OLD = 0, @@ -4025,6 +4037,11 @@ enum mission_template_client_case { CLIENT_CASE_RANDOM_CLIENT = 4, }; +#pragma pack(push, 2) +ENUM_16_BIT(mission_template_client_case); +#pragma pack(pop) + + union mission_template_client_data_1 { uint16_t none; uint16_t template_client_table_id; // if CLIENT_CASE_TABLE_CLIENT @@ -4055,6 +4072,11 @@ enum mission_template_target_case { TARGET_CASE_RANDOM_TARGET_06 = 6, }; +#pragma pack(push, 2) +ENUM_16_BIT(mission_template_target_case); +#pragma pack(pop) + + union mission_template_target_data_1 { uint16_t none; uint16_t template_target_table_id; // if TARGET_CASE_TABLE_CLIENT From e06ac577a8a46b7d28a0cbf1bdc5a696fe112ddf Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 6 Jun 2025 20:30:01 -0400 Subject: [PATCH 032/151] Fixed Enums (pt. 2) --- headers/types/common/common.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index 23996292..5f59a5a1 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -960,7 +960,7 @@ struct mission_template { uint16_t text_string_offset; // 0x2: Called in a switch case at 0x0205DED4 [EU] during mission generation // which affect how the template_item_data are interpreted - enum mission_template_item_case item_case : 2; + enum mission_template_item_case_16 item_case; // 0x4: Ignored if mission_template_item_case is not "0x2". union mission_template_item_data_1 template_item_data_1; // 0x6: Ignored if mission_template_item_case is "0x4". @@ -969,7 +969,7 @@ struct mission_template { // 0x8: Called in a switch case at 0x0205DED4 [EU] during mission generation // For legendary challenge missions, is also used as a boolean to indicate whether or not // accepting the mission unlocks its dungeon. - enum mission_template_dungeon_case dungeon_case : 2; + enum mission_template_dungeon_case_16 dungeon_case; // 0xA: Always Zero in the template, not referenced during mission generation. undefined field_0xa; // 0xB: Always Zero in the template, not referenced during mission generation. @@ -978,7 +978,7 @@ struct mission_template { // Use is governed by mission_template_dungeon_case int16_t restricted_dungeon; // 0xE: Called in a switch case at 0x0205D8C4 [EU] during mission generation - enum mission_template_client_case client_case : 2; + enum mission_template_client_case_16 client_case; // 0x10: Ignored if mission_template_client_case is not "0x2" union mission_template_client_data_1 template_client_data_1; // 0x12: Ignored if mission_template_client_case is "0x4" @@ -986,14 +986,14 @@ struct mission_template { // Usually stores a monster_id union mission_template_client_data_2 template_client_data_2; // 0x14: Called in a looped switch case at 0x0205DBEC[EU] during mission generation - enum mission_template_target_case target_case_1 : 2; + enum mission_template_target_case_16 target_case_1; // 0x16: Ignored if mission_template_target_case (at 0x14) is not "0x2" union mission_template_target_data_1 template_target_data_1; // 0x18: Ignored if mission_template_target_case (at 0x14) is "0x4" or "0x6" // For non-legendary challenge letter missions, stores the second team member union mission_template_target_data_2 template_target_data_2; // 0x1A: Called in the same looped switch case at 0x0205DBEC[EU] during mission generation - enum mission_template_target_case target_backup_case_1 : 2; + enum mission_template_target_case_16 target_backup_case_1; // 0x1C: Ignored if mission_template_target_case (at 0x1A) is not "0x2" union mission_template_target_data_1 target_backup_data_1; // 0x1E: Ignored if mission_template_target_case (at 0x1A) is "0x4" or "0x6" From b7f479bc2e3995ae1d530b1908eac7c72921766c Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 6 Jun 2025 20:33:31 -0400 Subject: [PATCH 033/151] Ohhhh they turn into structs! Cool! --- headers/types/common/common.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index 5f59a5a1..7fa07e35 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -960,7 +960,7 @@ struct mission_template { uint16_t text_string_offset; // 0x2: Called in a switch case at 0x0205DED4 [EU] during mission generation // which affect how the template_item_data are interpreted - enum mission_template_item_case_16 item_case; + struct mission_template_item_case_16 item_case; // 0x4: Ignored if mission_template_item_case is not "0x2". union mission_template_item_data_1 template_item_data_1; // 0x6: Ignored if mission_template_item_case is "0x4". @@ -969,7 +969,7 @@ struct mission_template { // 0x8: Called in a switch case at 0x0205DED4 [EU] during mission generation // For legendary challenge missions, is also used as a boolean to indicate whether or not // accepting the mission unlocks its dungeon. - enum mission_template_dungeon_case_16 dungeon_case; + struct mission_template_dungeon_case_16 dungeon_case; // 0xA: Always Zero in the template, not referenced during mission generation. undefined field_0xa; // 0xB: Always Zero in the template, not referenced during mission generation. @@ -978,7 +978,7 @@ struct mission_template { // Use is governed by mission_template_dungeon_case int16_t restricted_dungeon; // 0xE: Called in a switch case at 0x0205D8C4 [EU] during mission generation - enum mission_template_client_case_16 client_case; + struct mission_template_client_case_16 client_case; // 0x10: Ignored if mission_template_client_case is not "0x2" union mission_template_client_data_1 template_client_data_1; // 0x12: Ignored if mission_template_client_case is "0x4" @@ -986,14 +986,14 @@ struct mission_template { // Usually stores a monster_id union mission_template_client_data_2 template_client_data_2; // 0x14: Called in a looped switch case at 0x0205DBEC[EU] during mission generation - enum mission_template_target_case_16 target_case_1; + struct mission_template_target_case_16 target_case; // 0x16: Ignored if mission_template_target_case (at 0x14) is not "0x2" union mission_template_target_data_1 template_target_data_1; // 0x18: Ignored if mission_template_target_case (at 0x14) is "0x4" or "0x6" // For non-legendary challenge letter missions, stores the second team member union mission_template_target_data_2 template_target_data_2; // 0x1A: Called in the same looped switch case at 0x0205DBEC[EU] during mission generation - enum mission_template_target_case_16 target_backup_case_1; + struct mission_template_target_case_16 target_backup_case; // 0x1C: Ignored if mission_template_target_case (at 0x1A) is not "0x2" union mission_template_target_data_1 target_backup_data_1; // 0x1E: Ignored if mission_template_target_case (at 0x1A) is "0x4" or "0x6" From 8ff8fc9dae0a4662ee54981308a963ccd12ae142 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 6 Jun 2025 20:39:46 -0400 Subject: [PATCH 034/151] Still learning to pragma --- headers/types/common/common.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index 7fa07e35..d5877ec2 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -820,6 +820,8 @@ struct mission_floors_forbidden { ASSERT_SIZE(struct mission_floors_forbidden, 2); // Used throughout the process of displaying a mission +#pragma pack(push, 1) // Align all members to a 1-byte boundary + struct mission_details { undefined field_0x0; undefined field_0x1; @@ -919,6 +921,9 @@ struct mission_details { // 0x60: pointer to mission_template struct struct mission_template* template_ptr; }; + +#pragma pack(pop) // Go back to the default packing behavior + // mission_details is at least this big. unclear bigger it actually is. ASSERT_SIZE(struct mission_details, 104); From 854dad677331e48cffa0a0446ea38f1833048083 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 6 Jun 2025 20:45:01 -0400 Subject: [PATCH 035/151] What if I move the space BEFORE the * --- headers/types/common/common.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index d5877ec2..4365d5c0 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -832,7 +832,7 @@ struct mission_details { undefined field_0x6; undefined field_0x7; // 0x8: Pointer to mission struct + 0x4 (new substruct?) - struct mission* mission_ptr; + struct mission *mission_ptr; undefined field_0xb; undefined field_0xc; undefined field_0xd; @@ -919,9 +919,8 @@ struct mission_details { undefined field_0x5e; undefined field_0x5f; // 0x60: pointer to mission_template struct - struct mission_template* template_ptr; + struct mission_template *template_ptr; }; - #pragma pack(pop) // Go back to the default packing behavior // mission_details is at least this big. unclear bigger it actually is. From db04379f6d7a448c1a4378b6fc834f5138ac81ee Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 6 Jun 2025 20:49:42 -0400 Subject: [PATCH 036/151] Update common.h --- headers/types/common/common.h | 95 +---------------------------------- 1 file changed, 2 insertions(+), 93 deletions(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index 4365d5c0..3bbbfc8d 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -823,101 +823,10 @@ ASSERT_SIZE(struct mission_floors_forbidden, 2); #pragma pack(push, 1) // Align all members to a 1-byte boundary struct mission_details { - undefined field_0x0; - undefined field_0x1; - undefined field_0x2; - undefined field_0x3; - undefined field_0x4; - undefined field_0x5; - undefined field_0x6; - undefined field_0x7; + undefined field_1[8]; // 0x8: Pointer to mission struct + 0x4 (new substruct?) struct mission *mission_ptr; - undefined field_0xb; - undefined field_0xc; - undefined field_0xd; - undefined field_0xe; - undefined field_0xf; - undefined field_0x10; - undefined field_0x11; - undefined field_0x12; - undefined field_0x13; - undefined field_0x14; - undefined field_0x15; - undefined field_0x16; - undefined field_0x17; - undefined field_0x18; - undefined field_0x19; - undefined field_0x1a; - undefined field_0x1b; - undefined field_0x1c; - undefined field_0x1d; - undefined field_0x1e; - undefined field_0x1f; - undefined field_0x20; - undefined field_0x21; - undefined field_0x22; - undefined field_0x23; - undefined field_0x24; - undefined field_0x25; - undefined field_0x26; - undefined field_0x27; - undefined field_0x28; - undefined field_0x29; - undefined field_0x2a; - undefined field_0x2b; - undefined field_0x2c; - undefined field_0x2d; - undefined field_0x2e; - undefined field_0x2f; - undefined field_0x30; - undefined field_0x31; - undefined field_0x32; - undefined field_0x33; - undefined field_0x34; - undefined field_0x35; - undefined field_0x36; - undefined field_0x37; - undefined field_0x38; - undefined field_0x39; - undefined field_0x3a; - undefined field_0x3b; - undefined field_0x3c; - undefined field_0x3d; - undefined field_0x3e; - undefined field_0x3f; - undefined field_0x40; - undefined field_0x41; - undefined field_0x42; - undefined field_0x43; - undefined field_0x44; - undefined field_0x45; - undefined field_0x46; - undefined field_0x47; - undefined field_0x48; - undefined field_0x49; - undefined field_0x4a; - undefined field_0x4b; - undefined field_0x4c; - undefined field_0x4d; - undefined field_0x4e; - undefined field_0x4f; - undefined field_0x50; - undefined field_0x51; - undefined field_0x52; - undefined field_0x53; - undefined field_0x54; - undefined field_0x55; - undefined field_0x56; - undefined field_0x57; - undefined field_0x58; - undefined field_0x59; - undefined field_0x5a; - undefined field_0x5b; - undefined field_0x5c; - undefined field_0x5d; - undefined field_0x5e; - undefined field_0x5f; + undefined field_2[54]; // 0x60: pointer to mission_template struct struct mission_template *template_ptr; }; From c0e053c6e85112a97abb0851e1069025b79534fd Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 6 Jun 2025 20:55:16 -0400 Subject: [PATCH 037/151] Let's try this... --- 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 3bbbfc8d..6ab4b193 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -824,9 +824,9 @@ ASSERT_SIZE(struct mission_floors_forbidden, 2); struct mission_details { undefined field_1[8]; - // 0x8: Pointer to mission struct + 0x4 (new substruct?) + // 0x8: Pointer to "mission struct + 0x4" (new substruct?) struct mission *mission_ptr; - undefined field_2[54]; + undefined field_2[88]; // 0x60: pointer to mission_template struct struct mission_template *template_ptr; }; From 3c2a59790de69ad42f4e36d679be6bed9f61debb Mon Sep 17 00:00:00 2001 From: Parker Zhiss <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 6 Jun 2025 21:00:16 -0400 Subject: [PATCH 038/151] Formatting, yay! (x2) --- headers/types/common/common.h | 4 ++-- headers/types/common/enums.h | 6 ------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index 6ab4b193..d96390ee 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -825,10 +825,10 @@ ASSERT_SIZE(struct mission_floors_forbidden, 2); struct mission_details { undefined field_1[8]; // 0x8: Pointer to "mission struct + 0x4" (new substruct?) - struct mission *mission_ptr; + struct mission* mission_ptr; undefined field_2[88]; // 0x60: pointer to mission_template struct - struct mission_template *template_ptr; + struct mission_template* template_ptr; }; #pragma pack(pop) // Go back to the default packing behavior diff --git a/headers/types/common/enums.h b/headers/types/common/enums.h index 8ec94b0a..b3d927d3 100644 --- a/headers/types/common/enums.h +++ b/headers/types/common/enums.h @@ -3998,15 +3998,12 @@ union mission_template_item_data_1 { uint16_t template_item_table_id; // if ITEM_CASE_USE_ITEM_TABLE }; - union mission_template_item_data_2 { uint16_t none; uint16_t template_item_table_id; // if ITEM_CASE_USE_ITEM_TABLE struct item_id_16 mission_item_id; // if ITEM_CASE_SPECIFIC_ITEM }; - - enum mission_template_dungeon_case { DUNGEON_CASE_SPECIFIC_OPENED = 0, // Used for Legendary Challenge Letters, among other things DUNGEON_CASE_SPECIFIC_CLOSED = 1, // Used for Jirachi Challenge Letter and Togetic Mission @@ -4020,7 +4017,6 @@ enum mission_template_dungeon_case { ENUM_16_BIT(mission_template_dungeon_case); #pragma pack(pop) - enum mission_template_client_case { // Must be attacked in a dungeon to yield a valid mission CLIENT_CASE_FIXED_CLIENT_OLD = 0, @@ -4041,7 +4037,6 @@ enum mission_template_client_case { ENUM_16_BIT(mission_template_client_case); #pragma pack(pop) - union mission_template_client_data_1 { uint16_t none; uint16_t template_client_table_id; // if CLIENT_CASE_TABLE_CLIENT @@ -4076,7 +4071,6 @@ enum mission_template_target_case { ENUM_16_BIT(mission_template_target_case); #pragma pack(pop) - union mission_template_target_data_1 { uint16_t none; uint16_t template_target_table_id; // if TARGET_CASE_TABLE_CLIENT From d28c6c7fd3886a35c5dbd167775092a65b6aeebe Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 6 Jun 2025 21:04:24 -0400 Subject: [PATCH 039/151] Fix Alias Syntax --- symbols/arm9.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index bbd88cbb..462b8c76 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -12387,10 +12387,11 @@ arm9: JP: 0x6 description: |- A list of items that are forbidden from being used in a mission sent by Wonder Mail. - + Alias covers both this and the next table. type: struct item_id_16[3] - name: CAFE_MISSION_REWARD_TYPE_WEIGHTS - aliases: ARM9_UNKNOWN_TABLE__NA_20A3CC8 // Covers both this and the next table + aliases: + - ARM9_UNKNOWN_TABLE__NA_20A3CC8 address: EU: 0x20A42C8 NA: 0x20A3CC8 @@ -12402,10 +12403,11 @@ arm9: description: |- Weights for each possible mission_reward_type, used only by cafe mission generation. Seems identical to DEFAULT_MISSION_REWARD_TYPE_WEIGHTS. - + Alias covers both this and the prior table. type: int16_t[7] - name: OUTLAW_MISSION_REWARD_TYPE_WEIGHTS - aliases: ARM9_UNKNOWN_TABLE__NA_20A3CC8 // Covers both this and the prior table + aliases: + - ARM9_UNKNOWN_TABLE__NA_20A3CC8 address: EU: 0x20A42D6 NA: 0x20A3CD6 @@ -12420,7 +12422,8 @@ arm9: type: int16_t[7] - name: DEFAULT_MISSION_REWARD_TYPE_WEIGHTS - aliases: ARM9_UNKNOWN_TABLE__NA_20A3CE4 + aliases: + - ARM9_UNKNOWN_TABLE__NA_20A3CE4 address: EU: 0x20A42E4 NA: 0x20A3CE4 @@ -12435,7 +12438,8 @@ arm9: type: int16_t[7] - name: MISSION_VALIDATION_FUNCTION_LIST - aliases: ARM9_UNKNOWN_FUNCTION_TABLE__NA_20A3CF4 + aliases: + - ARM9_UNKNOWN_FUNCTION_TABLE__NA_20A3CF4 address: EU: 0x20A42F4 NA: 0x20A3CF4 From ef1e7777299b4557e30fab8140067193ab0b4af5 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 6 Jun 2025 21:09:23 -0400 Subject: [PATCH 040/151] Remove duplicate symbols and bogus addresses --- symbols/arm9.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 462b8c76..7bdbdab8 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -10484,7 +10484,7 @@ arm9: r0: Pointer to the mission to clear - name: GenerateMissionDetailsStruct address: - EU: 0x2060B80 + EU: 0x020604CC description: |- Generates a mission_details struct, to be used for printing mission details such as the title, summary, and objective. @@ -10514,15 +10514,6 @@ arm9: r0: mission_template struct pointer r1: mission struct pointer return: bool - - name: AppendMissionTitle - address: - EU: 0x02060D8C - description: |- - Generates the mission title of the mission, and appends it to the string location. - r0: [output] output buffer - r1: intermediate buffer, filled then concatenated to output buffer - r2: pointer to preprocessor args - r3: pointer to "mission details" struct (Spooky Struct) - name: AppendMissionTitle address: EU: 0x02060D8C From 7bd312d58c7f67f4930f666dfb208bc351ea88d7 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 6 Jun 2025 21:14:19 -0400 Subject: [PATCH 041/151] More wrong addresses... --- symbols/arm9.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 7bdbdab8..72a2424c 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -10525,7 +10525,7 @@ arm9: r3: pointer to mission_window_details struct - name: AppendMissionSummary address: - EU: 0x02060D8C + EU: 0x02061230 description: |- Generates the mission title of a mission, and appends it to the string location. r0: [output] main string location From 38ed07ab49caddc2d460a9c8bc9e37a7d3ea4a94 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 6 Jun 2025 21:17:36 -0400 Subject: [PATCH 042/151] Gut the excess aliases --- symbols/arm9.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 72a2424c..50d9eefd 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -12381,8 +12381,6 @@ arm9: Alias covers both this and the next table. type: struct item_id_16[3] - name: CAFE_MISSION_REWARD_TYPE_WEIGHTS - aliases: - - ARM9_UNKNOWN_TABLE__NA_20A3CC8 address: EU: 0x20A42C8 NA: 0x20A3CC8 @@ -12397,8 +12395,6 @@ arm9: Alias covers both this and the prior table. type: int16_t[7] - name: OUTLAW_MISSION_REWARD_TYPE_WEIGHTS - aliases: - - ARM9_UNKNOWN_TABLE__NA_20A3CC8 address: EU: 0x20A42D6 NA: 0x20A3CD6 @@ -12413,8 +12409,6 @@ arm9: type: int16_t[7] - name: DEFAULT_MISSION_REWARD_TYPE_WEIGHTS - aliases: - - ARM9_UNKNOWN_TABLE__NA_20A3CE4 address: EU: 0x20A42E4 NA: 0x20A3CE4 @@ -12429,8 +12423,6 @@ arm9: type: int16_t[7] - name: MISSION_VALIDATION_FUNCTION_LIST - aliases: - - ARM9_UNKNOWN_FUNCTION_TABLE__NA_20A3CF4 address: EU: 0x20A42F4 NA: 0x20A3CF4 From 7f09aae1cbc3c36bb10215113081ed45fa6b23bf Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 6 Jun 2025 21:20:26 -0400 Subject: [PATCH 043/151] "Misson". Incredible --- headers/functions/arm9.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index b22e100e..8037fe0f 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -1100,9 +1100,9 @@ bool ValidateNormalChallengeMission(struct mission_template* valid_mission_info, struct mission* mission); bool ValidateLegendaryChallengeMission(struct mission_template* valid_mission_info, struct mission* mission); -void AppendMissonTitle(char* main_buffer, char* temp_buffer, struct preprocessor_args* args, +void AppendMissionTitle(char* main_buffer, char* temp_buffer, struct preprocessor_args* args, struct mission_details* details); -void AppendMissonSummary(char* main_buffer, char* temp_buffer, struct preprocessor_args* args, +void AppendMissionSummary(char* main_buffer, char* temp_buffer, struct preprocessor_args* args, int window_id, int y_offset, struct mission_details* details); bool IsMonsterMissionAllowed(enum monster_id monster_id); bool CanMonsterBeUsedForMissionWrapper(enum monster_id monster_id); From 5633d31e9c23e680659c85a1b4aa36d9684c1fc4 Mon Sep 17 00:00:00 2001 From: Parker Zhiss <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 6 Jun 2025 21:24:15 -0400 Subject: [PATCH 044/151] Final Syntax Fix??? --- headers/functions/arm9.h | 8 ++++---- symbols/arm9.yml | 27 +++++++-------------------- 2 files changed, 11 insertions(+), 24 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index b22e100e..07014609 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -1100,10 +1100,10 @@ bool ValidateNormalChallengeMission(struct mission_template* valid_mission_info, struct mission* mission); bool ValidateLegendaryChallengeMission(struct mission_template* valid_mission_info, struct mission* mission); -void AppendMissonTitle(char* main_buffer, char* temp_buffer, struct preprocessor_args* args, - struct mission_details* details); -void AppendMissonSummary(char* main_buffer, char* temp_buffer, struct preprocessor_args* args, - int window_id, int y_offset, struct mission_details* details); +void AppendMissionTitle(char* main_buffer, char* temp_buffer, struct preprocessor_args* args, + struct mission_details* details); +void AppendMissionSummary(char* main_buffer, char* temp_buffer, struct preprocessor_args* args, + int window_id, int y_offset, struct mission_details* details); 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/symbols/arm9.yml b/symbols/arm9.yml index bbd88cbb..3005d20b 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -10484,14 +10484,14 @@ arm9: r0: Pointer to the mission to clear - name: GenerateMissionDetailsStruct address: - EU: 0x2060B80 + EU: 0x20604CC description: |- Generates a mission_details struct, to be used for printing mission details such as the title, summary, and objective. r0: mission struct pointer r1: [output] location of mission_details struct r2: unknown - r3: unknown + r3: unknown - name: ValidateNormalChallengeMission address: EU: 0x2060B80 @@ -10516,16 +10516,7 @@ arm9: return: bool - name: AppendMissionTitle address: - EU: 0x02060D8C - description: |- - Generates the mission title of the mission, and appends it to the string location. - r0: [output] output buffer - r1: intermediate buffer, filled then concatenated to output buffer - r2: pointer to preprocessor args - r3: pointer to "mission details" struct (Spooky Struct) - - name: AppendMissionTitle - address: - EU: 0x02060D8C + EU: 0x2060D8C description: |- Generates the mission title of a mission, and appends it to the string location. r0: [output] output buffer @@ -10534,7 +10525,7 @@ arm9: r3: pointer to mission_window_details struct - name: AppendMissionSummary address: - EU: 0x02060D8C + EU: 0x2061230 description: |- Generates the mission title of a mission, and appends it to the string location. r0: [output] main string location @@ -12387,25 +12378,23 @@ arm9: JP: 0x6 description: |- A list of items that are forbidden from being used in a mission sent by Wonder Mail. - + Alias covers both this and the next table. type: struct item_id_16[3] - name: CAFE_MISSION_REWARD_TYPE_WEIGHTS - aliases: ARM9_UNKNOWN_TABLE__NA_20A3CC8 // Covers both this and the next table address: EU: 0x20A42C8 NA: 0x20A3CC8 JP: 0x20A50AC - length: + length: EU: 0xE NA: 0xE JP: 0xE description: |- Weights for each possible mission_reward_type, used only by cafe mission generation. Seems identical to DEFAULT_MISSION_REWARD_TYPE_WEIGHTS. - + Alias covers both this and the prior table. type: int16_t[7] - name: OUTLAW_MISSION_REWARD_TYPE_WEIGHTS - aliases: ARM9_UNKNOWN_TABLE__NA_20A3CC8 // Covers both this and the prior table address: EU: 0x20A42D6 NA: 0x20A3CD6 @@ -12420,7 +12409,6 @@ arm9: type: int16_t[7] - name: DEFAULT_MISSION_REWARD_TYPE_WEIGHTS - aliases: ARM9_UNKNOWN_TABLE__NA_20A3CE4 address: EU: 0x20A42E4 NA: 0x20A3CE4 @@ -12435,7 +12423,6 @@ arm9: type: int16_t[7] - name: MISSION_VALIDATION_FUNCTION_LIST - aliases: ARM9_UNKNOWN_FUNCTION_TABLE__NA_20A3CF4 address: EU: 0x20A42F4 NA: 0x20A3CF4 From 422fe63031a8ad1dfa1b2b5c43b934926591180f Mon Sep 17 00:00:00 2001 From: Parker Zhiss <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 6 Jun 2025 21:28:28 -0400 Subject: [PATCH 045/151] Final Syntax Fix Real? --- headers/functions/arm9.h | 4 ++-- symbols/arm9.yml | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 8037fe0f..07014609 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -1101,9 +1101,9 @@ bool ValidateNormalChallengeMission(struct mission_template* valid_mission_info, bool ValidateLegendaryChallengeMission(struct mission_template* valid_mission_info, struct mission* mission); void AppendMissionTitle(char* main_buffer, char* temp_buffer, struct preprocessor_args* args, - struct mission_details* details); + struct mission_details* details); void AppendMissionSummary(char* main_buffer, char* temp_buffer, struct preprocessor_args* args, - int window_id, int y_offset, struct mission_details* details); + int window_id, int y_offset, struct mission_details* details); 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/symbols/arm9.yml b/symbols/arm9.yml index 50d9eefd..3005d20b 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -10484,14 +10484,14 @@ arm9: r0: Pointer to the mission to clear - name: GenerateMissionDetailsStruct address: - EU: 0x020604CC + EU: 0x20604CC description: |- Generates a mission_details struct, to be used for printing mission details such as the title, summary, and objective. r0: mission struct pointer r1: [output] location of mission_details struct r2: unknown - r3: unknown + r3: unknown - name: ValidateNormalChallengeMission address: EU: 0x2060B80 @@ -10516,7 +10516,7 @@ arm9: return: bool - name: AppendMissionTitle address: - EU: 0x02060D8C + EU: 0x2060D8C description: |- Generates the mission title of a mission, and appends it to the string location. r0: [output] output buffer @@ -10525,7 +10525,7 @@ arm9: r3: pointer to mission_window_details struct - name: AppendMissionSummary address: - EU: 0x02061230 + EU: 0x2061230 description: |- Generates the mission title of a mission, and appends it to the string location. r0: [output] main string location @@ -12385,7 +12385,7 @@ arm9: EU: 0x20A42C8 NA: 0x20A3CC8 JP: 0x20A50AC - length: + length: EU: 0xE NA: 0xE JP: 0xE From 74504518723b2ea1b5918233cd56ff67d5e13b87 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 7 Jun 2025 18:56:30 -0400 Subject: [PATCH 046/151] Update headers/functions/arm9.h Co-authored-by: UsernameFodder <93669634+UsernameFodder@users.noreply.github.com> --- 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 07014609..c32ed320 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -1095,7 +1095,7 @@ int GenerateAllPossibleDeliverList(void); void DeleteAllPossibleDeliverList(void); void ClearMissionData(struct mission* mission); void GenerateMissionDetailsStruct(struct mission* mission, struct mission_details* details, - undefined unk_2, undefined unk_3); + undefined param_3, undefined param_4); bool ValidateNormalChallengeMission(struct mission_template* valid_mission_info, struct mission* mission); bool ValidateLegendaryChallengeMission(struct mission_template* valid_mission_info, From 56812a1edbd7fe243bbc3fe932d6d0f67b4dda22 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 7 Jun 2025 18:56:44 -0400 Subject: [PATCH 047/151] Update symbols/arm9.yml Co-authored-by: UsernameFodder <93669634+UsernameFodder@users.noreply.github.com> --- symbols/arm9.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 3005d20b..9460e999 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -10490,8 +10490,8 @@ arm9: r0: mission struct pointer r1: [output] location of mission_details struct - r2: unknown - r3: unknown + r2: ? + r3: ? - name: ValidateNormalChallengeMission address: EU: 0x2060B80 From c95b7e3bbee9f304d6f557b07903131f759493cd Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 7 Jun 2025 19:05:46 -0400 Subject: [PATCH 048/151] Apply feedback Co-authored-by: UsernameFodder <93669634+UsernameFodder@users.noreply.github.com> --- headers/types/common/common.h | 2 +- headers/types/files/rescue.h | 15 ++++++++------- symbols/arm9.yml | 3 ++- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index d96390ee..11c6a132 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -832,7 +832,7 @@ struct mission_details { }; #pragma pack(pop) // Go back to the default packing behavior -// mission_details is at least this big. unclear bigger it actually is. +// mission_details is at least this big. Unclear how much bigger it actually is. ASSERT_SIZE(struct mission_details, 104); // Information about a valid mission; a list of these structs is stored in and directly loaded from diff --git a/headers/types/files/rescue.h b/headers/types/files/rescue.h index e2d2d041..8b254977 100644 --- a/headers/types/files/rescue.h +++ b/headers/types/files/rescue.h @@ -32,7 +32,7 @@ ASSERT_SIZE(struct rescue_header, 32); struct rescue_str_variant_table { struct rescue_str_variant_group string_groups[481]; uint32_t padding[7]; // 0x00000000 -} +}; ASSERT_SIZE(struct rescue_str_variant_table, 1952); @@ -41,7 +41,7 @@ ASSERT_SIZE(struct rescue_str_variant_table, 1952); // 0x7C0 in rescue.bin struct rescue_str_continuity_table { struct rescue_str_continuity continuities[964]; -} +}; ASSERT_SIZE(struct rescue_str_continuity_table, 1952); @@ -61,7 +61,7 @@ struct rescue_item_tables { struct item_id_16 rare_table[20]; // If this is an item table, it's always zero and unused by any template. uint16_t padding[2]; -} +}; ASSERT_SIZE(struct rescue_item_tables, 176); @@ -91,7 +91,7 @@ struct rescue_monster_tables { // Metagross, Dragonite, Garchomp, Tyranitar, and Salamence. Every Pokemon on this list is fully // evolved if it has evolutions. This list is the same regardless of Whether Magnezone or // Magnemite accompanies you. Overlaps with the range used by the GUIDE_CLIENT template. - + // // [227, 471): Used for the GUIDE_CLIENT mission type, and consists of a wide variety of Pokemon // defying categorization. Outside of the overlap, the list seems to contain mostly weaker // Pokemon. There is one invalid Pokemon entry in this table, 0x0CBE. Likely intended to be @@ -109,7 +109,7 @@ struct rescue_monster_tables { // Cranidos. struct monster_id_16 normal_outlaw_1_table[143]; uint16_t padding[11]; -} +}; ASSERT_SIZE(struct rescue_monster_tables, 2944); @@ -119,7 +119,8 @@ ASSERT_SIZE(struct rescue_monster_tables, 2944); struct mission_templates_table { struct mission_template[600]; uint16 padding[4]; -} ASSERT_SIZE(struct mission_templates_table, 20416); +}; +ASSERT_SIZE(struct mission_templates_table, 20416); // One of these categories is selected via weighted random whenever the game tries to generate a // mission. Each category corresponds to a range of templates in mission_template_table, which @@ -129,6 +130,6 @@ struct mission_categories_table { struct mission_weighted_category mission_categories[39]; // Initially thought this to be a failsafe mission category, but this seems to just be padding. uint16 padding[4]; -} +}; ASSERT_SIZE(struct mission_categories_table, 640); diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 9460e999..23b668b2 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -10519,6 +10519,7 @@ arm9: EU: 0x2060D8C description: |- Generates the mission title of a mission, and appends it to the string location. + r0: [output] output buffer r1: intermediate buffer, filled then concatenated to output buffer r2: pointer to preprocessor args @@ -12404,7 +12405,7 @@ arm9: NA: 0x1C JP: 0x1C description: |- - Weights for each possible mission_reward_type, exclusively for the ARREST_OUTLAW mision type. + Weights for each possible mission_reward_type, exclusively for the ARREST_OUTLAW mission type. Takes priority over CAFE_MISSION_REWARD_TYPE_WEIGHTS and CAFE_MISSION_REWARD_TYPE_WEIGHTS. type: int16_t[7] From 0ac41085360771890417c3a1a65f44727dca5efb Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 7 Jun 2025 19:35:25 -0400 Subject: [PATCH 049/151] Apply suggestions to common.h Syntax is about to explode, but that'll be an easy fix later --- headers/types/common/common.h | 103 ++++++++++++++++++++++++++++++---- 1 file changed, 93 insertions(+), 10 deletions(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index 11c6a132..2483f061 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -791,7 +791,7 @@ struct mission { uint8_t floor; // 0x5 undefined field_0x6; // Likely padding undefined field_0x7; // Likely padding - // 0x8: A random value determined FUN_0205146C [EU], which is used to + // 0x8: A random value determined by FUN_0205146C [EU], which is used to // randomly generate the mission title and description. int description_id; uint8_t unique_map_id; // 0xC: for challenges/treasure hunts/certain outlaws @@ -820,17 +820,104 @@ struct mission_floors_forbidden { ASSERT_SIZE(struct mission_floors_forbidden, 2); // Used throughout the process of displaying a mission -#pragma pack(push, 1) // Align all members to a 1-byte boundary - struct mission_details { - undefined field_1[8]; + undefined field_0x0; + undefined field_0x1; + undefined field_0x2; + undefined field_0x3; + undefined field_0x4; + undefined field_0x5; + undefined field_0x6; + undefined field_0x7; // 0x8: Pointer to "mission struct + 0x4" (new substruct?) struct mission* mission_ptr; - undefined field_2[88]; + undefined field_0xc; + undefined field_0xd; + undefined field_0xe; + undefined field_0xf; + undefined field_0x10; + undefined field_0x11; + undefined field_0x12; + undefined field_0x13; + undefined field_0x14; + undefined field_0x15; + undefined field_0x16; + undefined field_0x17; + undefined field_0x18; + undefined field_0x19; + undefined field_0x1a; + undefined field_0x1b; + undefined field_0x1c; + undefined field_0x1d; + undefined field_0x1e; + undefined field_0x1f; + undefined field_0x20; + undefined field_0x21; + undefined field_0x22; + undefined field_0x23; + undefined field_0x24; + undefined field_0x25; + undefined field_0x26; + undefined field_0x27; + undefined field_0x28; + undefined field_0x29; + undefined field_0x2a; + undefined field_0x2b; + undefined field_0x2c; + undefined field_0x2d; + undefined field_0x2e; + undefined field_0x2f; + undefined field_0x30; + undefined field_0x31; + undefined field_0x32; + undefined field_0x33; + undefined field_0x34; + undefined field_0x35; + undefined field_0x36; + undefined field_0x37; + undefined field_0x38; + undefined field_0x39; + undefined field_0x3a; + undefined field_0x3b; + undefined field_0x3c; + undefined field_0x3d; + undefined field_0x3e; + undefined field_0x3f; + undefined field_0x40; + undefined field_0x41; + undefined field_0x42; + undefined field_0x43; + undefined field_0x44; + undefined field_0x45; + undefined field_0x46; + undefined field_0x47; + undefined field_0x48; + undefined field_0x49; + undefined field_0x4a; + undefined field_0x4b; + undefined field_0x4c; + undefined field_0x4d; + undefined field_0x4e; + undefined field_0x4f; + undefined field_0x50; + undefined field_0x51; + undefined field_0x52; + undefined field_0x53; + undefined field_0x54; + undefined field_0x55; + undefined field_0x56; + undefined field_0x57; + undefined field_0x58; + undefined field_0x59; + undefined field_0x5a; + undefined field_0x5b; + undefined field_0x5c; + undefined field_0x5d; + undefined field_0x5e; + undefined field_0x5f; // 0x60: pointer to mission_template struct struct mission_template* template_ptr; }; -#pragma pack(pop) // Go back to the default packing behavior // mission_details is at least this big. Unclear how much bigger it actually is. ASSERT_SIZE(struct mission_details, 104); @@ -846,7 +933,6 @@ struct rescue_str_variant_group { // This final index is reused to select an index in rescue_str_continuity_table uint16_t group_size; }; - ASSERT_SIZE(struct rescue_str_variant_group, 4); // Information about a valid mission; a list of these structs is stored in and directly loaded from @@ -860,7 +946,6 @@ struct rescue_str_continuity { */ uint16_t next_variant_table_id; }; - ASSERT_SIZE(struct rescue_str_continuity, 2); // Information about a valid mission; a list of these structs is stored in and directly loaded from @@ -915,7 +1000,6 @@ struct mission_template { struct mission_type_8 type; // 0x20 union mission_subtype subtype; // 0x21 }; - ASSERT_SIZE(struct mission_template, 34); // Information valid mission; a list of these structs is stored in and directly loaded from @@ -942,7 +1026,6 @@ struct mission_weighted_category { // 0xE: Index of the first mission_template struct within this category uint16_t first_template_index; }; - ASSERT_SIZE(struct mission_weighted_category, 16); // Unverified, ported from Irdkwia's notes From 0f5f3ffec43c17a2567dbe71a5d47141fb0446f3 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 7 Jun 2025 19:46:12 -0400 Subject: [PATCH 050/151] Remove Redundant Enums --- headers/types/common/enums.h | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/headers/types/common/enums.h b/headers/types/common/enums.h index b3d927d3..9ff7edc0 100644 --- a/headers/types/common/enums.h +++ b/headers/types/common/enums.h @@ -3751,14 +3751,6 @@ enum mission_type { ENUM_8_BIT(mission_type); #pragma pack(pop) -// Mission subtype for mission types without distinct subtypes -enum mission_subtype_other { MISSION_TEMPLATE_DEFAULT = 0 }; - -// This is usually stored as an 8-bit integer -#pragma pack(push, 1) -ENUM_8_BIT(mission_subtype_other); -#pragma pack(pop) - // Mission subtype for MISSION_RESCUE_TARGET // The distinction is mainly for dialogue enum mission_subtype_rescue_target { @@ -3917,7 +3909,7 @@ union mission_subtype { struct mission_subtype_challenge_8 challenge; struct mission_subtype_special_episode_8 special_episode; struct mission_subtype_seven_treasure_8 seven_treasure; - struct mission_subtype_other_8 other; + uint8_t other; }; // Different types of rewards that a mission can have @@ -3993,12 +3985,8 @@ enum mission_template_item_case { ENUM_16_BIT(mission_template_item_case); #pragma pack(pop) -union mission_template_item_data_1 { - uint16_t none; - uint16_t template_item_table_id; // if ITEM_CASE_USE_ITEM_TABLE -}; -union mission_template_item_data_2 { +union mission_template_item_data { uint16_t none; uint16_t template_item_table_id; // if ITEM_CASE_USE_ITEM_TABLE struct item_id_16 mission_item_id; // if ITEM_CASE_SPECIFIC_ITEM @@ -4037,12 +4025,7 @@ enum mission_template_client_case { ENUM_16_BIT(mission_template_client_case); #pragma pack(pop) -union mission_template_client_data_1 { - uint16_t none; - uint16_t template_client_table_id; // if CLIENT_CASE_TABLE_CLIENT -}; - -union mission_template_client_data_2 { +union mission_template_client_data { uint16_t none; // If CLIENT_CASE_RANDOM_CLIENT uint16_t template_client_table_id; // if CLIENT_CASE_TABLE_CLIENT struct monster_id_16 client; // if CLIENT_CASE_FIXED_CLIENT_OLD or CLIENT_CASE_FIXED_CLIENT_NEW @@ -4071,12 +4054,8 @@ enum mission_template_target_case { ENUM_16_BIT(mission_template_target_case); #pragma pack(pop) -union mission_template_target_data_1 { - uint16_t none; - uint16_t template_target_table_id; // if TARGET_CASE_TABLE_CLIENT -}; -union mission_template_target_data_2 { +union mission_template_target_data { uint16_t none; // If CASE_RANDOM_TARGET or TARGET_CASE_RANDOM_TARGET_06 uint16_t template_target_table_id; // if TARGET_CASE_TABLE_TARGET struct monster_id_16 target; // if TARGET_CASE_FIXED_TARGET_OLD From ffbe9d1649e16b739b28ae2c333c76062d0b8869 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 7 Jun 2025 19:46:21 -0400 Subject: [PATCH 051/151] Stop using redundant enums --- headers/types/common/common.h | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index 2483f061..58e92626 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -960,10 +960,12 @@ struct mission_template { // which affect how the template_item_data are interpreted struct mission_template_item_case_16 item_case; // 0x4: Ignored if mission_template_item_case is not "0x2". - union mission_template_item_data_1 template_item_data_1; + // If not ignored, stores a table index. + union mission_template_item_data template_item_data_1; // 0x6: Ignored if mission_template_item_case is "0x4". - // Usually stores the item_id of an item used in the mission - union mission_template_item_data_2 template_item_data_2; + // Usually stores the item_id of an item used in the mission. + // Can instead store a table index. + union mission_template_item_data template_item_data_2; // 0x8: Called in a switch case at 0x0205DED4 [EU] during mission generation // For legendary challenge missions, is also used as a boolean to indicate whether or not // accepting the mission unlocks its dungeon. @@ -978,25 +980,26 @@ struct mission_template { // 0xE: Called in a switch case at 0x0205D8C4 [EU] during mission generation struct mission_template_client_case_16 client_case; // 0x10: Ignored if mission_template_client_case is not "0x2" - union mission_template_client_data_1 template_client_data_1; + // If not ignored, stores a table index. + union mission_template_client_data template_client_data_1; // 0x12: Ignored if mission_template_client_case is "0x4" // For challenge letter missions, stores the leader (who is ALSO the client) - // Usually stores a monster_id - union mission_template_client_data_2 template_client_data_2; + // Usually stores a monster_id, but could instead store a table index. + union mission_template_client_data template_client_data_2; // 0x14: Called in a looped switch case at 0x0205DBEC[EU] during mission generation struct mission_template_target_case_16 target_case; // 0x16: Ignored if mission_template_target_case (at 0x14) is not "0x2" - union mission_template_target_data_1 template_target_data_1; + union mission_template_target_data template_target_data_1; // 0x18: Ignored if mission_template_target_case (at 0x14) is "0x4" or "0x6" // For non-legendary challenge letter missions, stores the second team member - union mission_template_target_data_2 template_target_data_2; + union mission_template_target_data template_target_data_2; // 0x1A: Called in the same looped switch case at 0x0205DBEC[EU] during mission generation struct mission_template_target_case_16 target_backup_case; // 0x1C: Ignored if mission_template_target_case (at 0x1A) is not "0x2" - union mission_template_target_data_1 target_backup_data_1; + union mission_template_target_data target_backup_data_1; // 0x1E: Ignored if mission_template_target_case (at 0x1A) is "0x4" or "0x6" // For non-legendary challenge letter missions, stores the third team member - union mission_template_target_data_2 target_backup_data_2; + union mission_template_target_data target_backup_data_2; struct mission_type_8 type; // 0x20 union mission_subtype subtype; // 0x21 }; From b1745fc9cfb763e2fd55e5d8582119ef17af613d Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 7 Jun 2025 19:58:11 -0400 Subject: [PATCH 052/151] Apply suggestions to rescue.h --- headers/types/files/rescue.h | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/headers/types/files/rescue.h b/headers/types/files/rescue.h index 8b254977..87346743 100644 --- a/headers/types/files/rescue.h +++ b/headers/types/files/rescue.h @@ -14,14 +14,14 @@ struct rescue_header { struct mission_templates_table* template_table_pointer; // 0x10 struct mission_categories_table* category_table_pointer; // 0x14 // Likely Padding - undefined field1_0x18; - undefined field1_0x19; - undefined field1_0x1A; - undefined field1_0x1B; - undefined field1_0x1C; - undefined field1_0x1D; - undefined field1_0x1E; - undefined field1_0x1F; + undefined field_0x18; + undefined field_0x19; + undefined field_0x1A; + undefined field_0x1B; + undefined field_0x1C; + undefined field_0x1D; + undefined field_0x1E; + undefined field_0x1F; }; ASSERT_SIZE(struct rescue_header, 32); @@ -30,8 +30,8 @@ ASSERT_SIZE(struct rescue_header, 32); // a mission_template struct or equivalently of a rescue_str_continuity struct. // 0x20 in rescue.bin struct rescue_str_variant_table { - struct rescue_str_variant_group string_groups[481]; - uint32_t padding[7]; // 0x00000000 + struct rescue_str_variant_group string_groups[482]; + struct rescue_str_variant_group unused[6]; }; ASSERT_SIZE(struct rescue_str_variant_table, 1952); @@ -60,7 +60,7 @@ struct rescue_item_tables { // is also present. Sitrus Berries and Reviver Seeds are ALSO on this table, for some reason. struct item_id_16 rare_table[20]; // If this is an item table, it's always zero and unused by any template. - uint16_t padding[2]; + uint16_t unused_item_table_entries[2]; }; ASSERT_SIZE(struct rescue_item_tables, 176); @@ -74,7 +74,7 @@ struct rescue_monster_tables { // fully-evolved pokemon like Masquerain and Beautifly. Seem to be stronger on average than // those in normal_outlaw_3_table. struct monster_id_16 normal_outlaw_2_table[65]; - // [65, 106): Used exclusively for the OUTLAW_NORMAL_2 mission subtype, and consists mostly of + // [65, 106): Used exclusively for the OUTLAW_NORMAL_3 mission subtype, and consists mostly of // basic Pokemon, such as Lotad, Teddiursa, and Abra. Also contains all 3 forms of Burmy and // Wormadam. struct monster_id_16 normal_outlaw_3_table[41]; @@ -108,7 +108,7 @@ struct rescue_monster_tables { // Tyranitar, Torterra, and Gengar. Outliers exists, such as Gligar, Golbat, Cubone, and // Cranidos. struct monster_id_16 normal_outlaw_1_table[143]; - uint16_t padding[11]; + uint16_t unused_monster_table_entries[11]; }; ASSERT_SIZE(struct rescue_monster_tables, 2944); @@ -118,7 +118,8 @@ ASSERT_SIZE(struct rescue_monster_tables, 2944); // mission struct. 0x1560 in rescue.bin struct mission_templates_table { struct mission_template[600]; - uint16 padding[4]; + // This is the perfect size for a mission_category, but not for a template... + uint16_t unused[4]; }; ASSERT_SIZE(struct mission_templates_table, 20416); @@ -128,8 +129,8 @@ ASSERT_SIZE(struct mission_templates_table, 20416); // restrictions. 0x6520 in rescue.bin struct mission_categories_table { struct mission_weighted_category mission_categories[39]; - // Initially thought this to be a failsafe mission category, but this seems to just be padding. - uint16 padding[4]; + // This category is never read, but that might be a one-instruction change. + struct mission_weighted_category unused_category; }; ASSERT_SIZE(struct mission_categories_table, 640); From 9ade5f1d0e47ee49e997d746c8f11bbb43364aa2 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 7 Jun 2025 19:59:43 -0400 Subject: [PATCH 053/151] I think I did bad hex math... 0x64 != 104 --- 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 58e92626..80343e08 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -920,7 +920,7 @@ struct mission_details { }; // mission_details is at least this big. Unclear how much bigger it actually is. -ASSERT_SIZE(struct mission_details, 104); +ASSERT_SIZE(struct mission_details, 100); // Information about a valid mission; a list of these structs is stored in and directly loaded from // RESCUE/rescue.bin at 0x20, where 481 of these structs exist. These are used to select a string From 32465ef0a37dc4a7590b90bc9edbd626d6a81dea Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 7 Jun 2025 20:02:03 -0400 Subject: [PATCH 054/151] Update rescue.h Let's see if I actually need this... --- headers/types/files/rescue.h | 1 - 1 file changed, 1 deletion(-) diff --git a/headers/types/files/rescue.h b/headers/types/files/rescue.h index 87346743..300c055f 100644 --- a/headers/types/files/rescue.h +++ b/headers/types/files/rescue.h @@ -1,7 +1,6 @@ #ifndef HEADERS_TYPES_FILES_RESCUE_H_ #define HEADERS_TYPES_FILES_RESCUE_H_ -#include "../common/util.h" // (?) #include "../common/common.h" #include "../common/enums.h" From 554f3f65c7382acc7aa0db940c271012bcc9d419 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 7 Jun 2025 20:03:03 -0400 Subject: [PATCH 055/151] Remove redundant \n --- CREDITS.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CREDITS.txt b/CREDITS.txt index 2373a3a7..8aea6ef0 100644 --- a/CREDITS.txt +++ b/CREDITS.txt @@ -35,7 +35,6 @@ other parts of the project, feel free to add yourself to this file! - Assidion - Chritchy - happylappy - - The rest of the contributors to Project Pokémon's technical documentation for the NDS Mystery Dungeon games, which can be found here: https://projectpokemon.org/home/docs/mystery-dungeon-nds/ From 4256c3c930044d51ace05211801bc48b45b8b0be Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 7 Jun 2025 20:18:07 -0400 Subject: [PATCH 056/151] Fix AppendMissionSummary params --- headers/functions/arm9.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index c32ed320..dc30835e 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -1102,8 +1102,8 @@ bool ValidateLegendaryChallengeMission(struct mission_template* valid_mission_in struct mission* mission); void AppendMissionTitle(char* main_buffer, char* temp_buffer, struct preprocessor_args* args, struct mission_details* details); -void AppendMissionSummary(char* main_buffer, char* temp_buffer, struct preprocessor_args* args, - int window_id, int y_offset, struct mission_details* details); +void AppendMissionSummary(char* main_buffer, char* temp_buffer, int window_id, int y_offset, + struct preprocessor_args* args, struct mission_details* details); 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); From a9bfd4482021cc4fdace58ed82b0d6d91dd0ba07 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 7 Jun 2025 20:18:42 -0400 Subject: [PATCH 057/151] Fix symbols --- symbols/arm9.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 23b668b2..ea807a61 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -10489,7 +10489,7 @@ arm9: Generates a mission_details struct, to be used for printing mission details such as the title, summary, and objective. r0: mission struct pointer - r1: [output] location of mission_details struct + r1: [output] mission_details struct pointer r2: ? r3: ? - name: ValidateNormalChallengeMission @@ -10523,7 +10523,7 @@ arm9: r0: [output] output buffer r1: intermediate buffer, filled then concatenated to output buffer r2: pointer to preprocessor args - r3: pointer to mission_window_details struct + r3: pointer to mission_details struct - name: AppendMissionSummary address: EU: 0x2061230 @@ -10534,7 +10534,7 @@ arm9: r2: window_id for DrawTextInWindow r3: y offset for DrawTextInWindow stack[0]: pointer to preprocessor args - stack[1]: pointer to mission_window_details struct + stack[1]: pointer to mission_details struct - name: IsMonsterMissionAllowed address: EU: 0x2062D90 @@ -12379,7 +12379,7 @@ arm9: JP: 0x6 description: |- A list of items that are forbidden from being used in a mission sent by Wonder Mail. - Alias covers both this and the next table. + type: struct item_id_16[3] - name: CAFE_MISSION_REWARD_TYPE_WEIGHTS address: @@ -12393,7 +12393,7 @@ arm9: description: |- Weights for each possible mission_reward_type, used only by cafe mission generation. Seems identical to DEFAULT_MISSION_REWARD_TYPE_WEIGHTS. - Alias covers both this and the prior table. + type: int16_t[7] - name: OUTLAW_MISSION_REWARD_TYPE_WEIGHTS address: @@ -12408,7 +12408,6 @@ arm9: Weights for each possible mission_reward_type, exclusively for the ARREST_OUTLAW mission type. Takes priority over CAFE_MISSION_REWARD_TYPE_WEIGHTS and CAFE_MISSION_REWARD_TYPE_WEIGHTS. - type: int16_t[7] - name: DEFAULT_MISSION_REWARD_TYPE_WEIGHTS address: EU: 0x20A42E4 @@ -12421,8 +12420,7 @@ arm9: description: |- Weights for each possible mission_reward_type, used for non-cafe missions. Seems identical to CAFE_MISSION_REWARD_TYPE_WEIGHTS. - - type: int16_t[7] + - name: MISSION_VALIDATION_FUNCTION_LIST address: EU: 0x20A42F4 From 358f6c4e0180d97b68a214122711490c75af6aeb Mon Sep 17 00:00:00 2001 From: Parker Zhiss <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 7 Jun 2025 20:25:50 -0400 Subject: [PATCH 058/151] Final Syntax Fix Real Again? --- headers/types/common/enums.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/headers/types/common/enums.h b/headers/types/common/enums.h index 9ff7edc0..12cc2e97 100644 --- a/headers/types/common/enums.h +++ b/headers/types/common/enums.h @@ -3985,7 +3985,6 @@ enum mission_template_item_case { ENUM_16_BIT(mission_template_item_case); #pragma pack(pop) - union mission_template_item_data { uint16_t none; uint16_t template_item_table_id; // if ITEM_CASE_USE_ITEM_TABLE @@ -4054,7 +4053,6 @@ enum mission_template_target_case { ENUM_16_BIT(mission_template_target_case); #pragma pack(pop) - union mission_template_target_data { uint16_t none; // If CASE_RANDOM_TARGET or TARGET_CASE_RANDOM_TARGET_06 uint16_t template_target_table_id; // if TARGET_CASE_TABLE_TARGET From d982a68490ebf17e3368aca509da1a82787fa920 Mon Sep 17 00:00:00 2001 From: Parker Zhiss <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 7 Jun 2025 20:28:44 -0400 Subject: [PATCH 059/151] Syntax Real True Actual I --- symbols/arm9.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index ea807a61..f3b8f891 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -12379,7 +12379,7 @@ arm9: JP: 0x6 description: |- A list of items that are forbidden from being used in a mission sent by Wonder Mail. - + type: struct item_id_16[3] - name: CAFE_MISSION_REWARD_TYPE_WEIGHTS address: @@ -12393,7 +12393,7 @@ arm9: description: |- Weights for each possible mission_reward_type, used only by cafe mission generation. Seems identical to DEFAULT_MISSION_REWARD_TYPE_WEIGHTS. - + type: int16_t[7] - name: OUTLAW_MISSION_REWARD_TYPE_WEIGHTS address: @@ -12407,7 +12407,6 @@ arm9: description: |- Weights for each possible mission_reward_type, exclusively for the ARREST_OUTLAW mission type. Takes priority over CAFE_MISSION_REWARD_TYPE_WEIGHTS and CAFE_MISSION_REWARD_TYPE_WEIGHTS. - - name: DEFAULT_MISSION_REWARD_TYPE_WEIGHTS address: EU: 0x20A42E4 @@ -12420,7 +12419,6 @@ arm9: description: |- Weights for each possible mission_reward_type, used for non-cafe missions. Seems identical to CAFE_MISSION_REWARD_TYPE_WEIGHTS. - - name: MISSION_VALIDATION_FUNCTION_LIST address: EU: 0x20A42F4 From 16bb1a07d8822ba8cc59b651e974320f9ae51db5 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 7 Jun 2025 20:35:39 -0400 Subject: [PATCH 060/151] Update arm9.h --- headers/data/arm9.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/data/arm9.h b/headers/data/arm9.h index b6d3c6c2..64259f51 100644 --- a/headers/data/arm9.h +++ b/headers/data/arm9.h @@ -132,7 +132,7 @@ extern struct item_id_16 NO_SEND_ITEM_TABLE[3]; extern uint16_t CAFE_MISSION_REWARD_TYPE_WEIGHTS[7]; extern uint16_t OUTLAW_MISSION_REWARD_TYPE_WEIGHTS[7]; extern uint16_t DEFAULT_MISSION_REWARD_TYPE_WEIGHTS[7]; -extern int32_t MISSION_VALIDATION_FUNCTION_LIST[8]; // Functions +extern undefined* MISSION_VALIDATION_FUNCTION_LIST[8]; // Functions extern struct monster_id_16 MISSION_BANNED_STORY_MONSTERS[21]; extern struct item_id_16 ITEM_DELIVERY_TABLE[23]; extern int MISSION_RANK_POINTS[16]; From c143da99d3faac6859ccd77a29e07f97d7d2e607 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 8 Jun 2025 20:45:36 -0400 Subject: [PATCH 061/151] 7 Treasures is actually 0xE, not 0xF... --- headers/types/common/enums.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/headers/types/common/enums.h b/headers/types/common/enums.h index 12cc2e97..d9822708 100644 --- a/headers/types/common/enums.h +++ b/headers/types/common/enums.h @@ -3742,8 +3742,7 @@ enum mission_type { MISSION_CHALLENGE_REQUEST = 11, MISSION_TREASURE_MEMO = 12, MISSION_TYPE_UNK_0xD = 13, - MISSION_SPECIAL_EPISODE = 14, - MISSION_TYPE_SEVEN_TREASURE = 15 + MISSION_TYPE_SEVEN_TREASURE = 14 }; // This is usually stored as an 8-bit integer From 663a2fb98f5002153acd642f55497e1783ec69e5 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Mon, 9 Jun 2025 18:33:02 -0400 Subject: [PATCH 062/151] Merge SPECIAL_EPISODE and SEVEN_TREASURE (they are subtypes of the same mission type) --- headers/types/common/enums.h | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/headers/types/common/enums.h b/headers/types/common/enums.h index d9822708..e7af5c28 100644 --- a/headers/types/common/enums.h +++ b/headers/types/common/enums.h @@ -3742,7 +3742,7 @@ enum mission_type { MISSION_CHALLENGE_REQUEST = 11, MISSION_TREASURE_MEMO = 12, MISSION_TYPE_UNK_0xD = 13, - MISSION_TYPE_SEVEN_TREASURE = 14 + MISSION_TYPE_CONSUMABLE = 14 // Used for SE3 wondermail and Seven Treasures! }; // This is usually stored as an 8-bit integer @@ -3872,29 +3872,19 @@ enum mission_subtype_challenge { ENUM_8_BIT(mission_subtype_challenge); #pragma pack(pop) -// Mission subtype for MISSION_SPECIAL_EPISODE -enum mission_subtype_special_episode { - MISSION_SE_UNK_0 = 0, - // Checked for at 0x0205E2E0 [EU] when determining mission restrictions - MISSION_SE_UNK_1 = 1, - MISSION_SE_UNK_2 = 2 -}; - -// This is usually stored as an 8-bit integer -#pragma pack(push, 1) -ENUM_8_BIT(mission_subtype_special_episode); -#pragma pack(pop) -// Mission subtype for MISSION_SEVEN_TREASURE -enum mission_subtype_seven_treasure { - MISSION_SEVEN_UNK_0 = 0, - // Subtype 0x1 is used in the template, NOT 0x0 - MISSION_SEVEN_TEMPLATE = 1 +// Mission subtype for MISSION_TYPE_CONSUMABLE +enum mission_subtype_consumable { + MISSION_CONSUMABLE_UNK_0 = 0, + // Subtype 0x1 is used in the template for seven-treasure missions + MISSION_SEVEN_TREASURE = 1, + // Subtype 0x2 is used by the SE3 wondermail + MISSION_SPECIAL_EPISODE = 2 }; // This is usually stored as an 8-bit integer #pragma pack(push, 1) -ENUM_8_BIT(mission_subtype_seven_treasure); +ENUM_8_BIT(mission_subtype_consumable); #pragma pack(pop) // The meaning of the mission subtype depends on the mission type @@ -3906,8 +3896,7 @@ union mission_subtype { struct mission_subtype_take_item_8 take_item; struct mission_subtype_outlaw_8 outlaw; struct mission_subtype_challenge_8 challenge; - struct mission_subtype_special_episode_8 special_episode; - struct mission_subtype_seven_treasure_8 seven_treasure; + struct mission_subtype_consumable_8 seven_treasure; uint8_t other; }; From 6ceafc91689bb9cb3cf0642d91d0941eff18256c Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Mon, 9 Jun 2025 18:35:56 -0400 Subject: [PATCH 063/151] Remove extraneous comment --- headers/data/arm9.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/data/arm9.h b/headers/data/arm9.h index 64259f51..48e52825 100644 --- a/headers/data/arm9.h +++ b/headers/data/arm9.h @@ -132,7 +132,7 @@ extern struct item_id_16 NO_SEND_ITEM_TABLE[3]; extern uint16_t CAFE_MISSION_REWARD_TYPE_WEIGHTS[7]; extern uint16_t OUTLAW_MISSION_REWARD_TYPE_WEIGHTS[7]; extern uint16_t DEFAULT_MISSION_REWARD_TYPE_WEIGHTS[7]; -extern undefined* MISSION_VALIDATION_FUNCTION_LIST[8]; // Functions +extern undefined* MISSION_VALIDATION_FUNCTION_LIST[8]; extern struct monster_id_16 MISSION_BANNED_STORY_MONSTERS[21]; extern struct item_id_16 ITEM_DELIVERY_TABLE[23]; extern int MISSION_RANK_POINTS[16]; From b9917eb79575a0c8f1b51a2635a31697b34955c5 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Mon, 9 Jun 2025 18:38:30 -0400 Subject: [PATCH 064/151] Apply suggestions from code review Co-authored-by: UsernameFodder <93669634+UsernameFodder@users.noreply.github.com> --- headers/types/files/rescue.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/headers/types/files/rescue.h b/headers/types/files/rescue.h index 300c055f..f098cc0c 100644 --- a/headers/types/files/rescue.h +++ b/headers/types/files/rescue.h @@ -15,14 +15,13 @@ struct rescue_header { // Likely Padding undefined field_0x18; undefined field_0x19; - undefined field_0x1A; + undefined field_0x1a; undefined field_0x1B; undefined field_0x1C; undefined field_0x1D; undefined field_0x1E; undefined field_0x1F; }; - ASSERT_SIZE(struct rescue_header, 32); // Table of rescue_str_variant_group structs, corresponding to the "text_string_offset" field of From 51dcdf684fe8eb20be1575bf622392deecf8cebd Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Mon, 9 Jun 2025 18:39:15 -0400 Subject: [PATCH 065/151] Update rescue.h --- headers/types/files/rescue.h | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/headers/types/files/rescue.h b/headers/types/files/rescue.h index f098cc0c..63f8a597 100644 --- a/headers/types/files/rescue.h +++ b/headers/types/files/rescue.h @@ -16,11 +16,11 @@ struct rescue_header { undefined field_0x18; undefined field_0x19; undefined field_0x1a; - undefined field_0x1B; - undefined field_0x1C; - undefined field_0x1D; - undefined field_0x1E; - undefined field_0x1F; + undefined field_0x1b; + undefined field_0x1c; + undefined field_0x1d; + undefined field_0x1e; + undefined field_0x1f; }; ASSERT_SIZE(struct rescue_header, 32); @@ -31,7 +31,6 @@ struct rescue_str_variant_table { struct rescue_str_variant_group string_groups[482]; struct rescue_str_variant_group unused[6]; }; - ASSERT_SIZE(struct rescue_str_variant_table, 1952); // Table of rescue_str_continuity structs, corresponding to each string in MISSION_TEXT_STRINGS @@ -40,7 +39,6 @@ ASSERT_SIZE(struct rescue_str_variant_table, 1952); struct rescue_str_continuity_table { struct rescue_str_continuity continuities[964]; }; - ASSERT_SIZE(struct rescue_str_continuity_table, 1952); // Item tables used by certain mission templates. This could be considered as one table, @@ -60,7 +58,6 @@ struct rescue_item_tables { // If this is an item table, it's always zero and unused by any template. uint16_t unused_item_table_entries[2]; }; - ASSERT_SIZE(struct rescue_item_tables, 176); // Pokemon tables used by certain mission templates. This could be considered as one table, @@ -108,7 +105,6 @@ struct rescue_monster_tables { struct monster_id_16 normal_outlaw_1_table[143]; uint16_t unused_monster_table_entries[11]; }; - ASSERT_SIZE(struct rescue_monster_tables, 2944); // Table of mission templates used for mission generation. A template is chosen from range indicated @@ -130,5 +126,4 @@ struct mission_categories_table { // This category is never read, but that might be a one-instruction change. struct mission_weighted_category unused_category; }; - ASSERT_SIZE(struct mission_categories_table, 640); From 8789cb88df02beb737de5dd89573c0a4cf11c24a Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Mon, 9 Jun 2025 18:42:56 -0400 Subject: [PATCH 066/151] Apply suggestions from code review Co-authored-by: UsernameFodder <93669634+UsernameFodder@users.noreply.github.com> --- headers/types/common/common.h | 1 - 1 file changed, 1 deletion(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index 80343e08..87e21ad6 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -918,7 +918,6 @@ struct mission_details { // 0x60: pointer to mission_template struct struct mission_template* template_ptr; }; - // mission_details is at least this big. Unclear how much bigger it actually is. ASSERT_SIZE(struct mission_details, 100); From 1b5e2be2bdcc2784852d3679110736ccabbecbac Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Mon, 9 Jun 2025 18:45:46 -0400 Subject: [PATCH 067/151] Apply feedback to arm9.yml --- symbols/arm9.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index f3b8f891..0c027011 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -10529,6 +10529,7 @@ arm9: EU: 0x2061230 description: |- Generates the mission title of a mission, and appends it to the string location. + r0: [output] main string location r1: temporary string buffer, concatenated to main string r2: window_id for DrawTextInWindow @@ -12393,17 +12394,15 @@ arm9: description: |- Weights for each possible mission_reward_type, used only by cafe mission generation. Seems identical to DEFAULT_MISSION_REWARD_TYPE_WEIGHTS. - - type: int16_t[7] - name: OUTLAW_MISSION_REWARD_TYPE_WEIGHTS address: EU: 0x20A42D6 NA: 0x20A3CD6 JP: 0x20A50BA length: - EU: 0x1C - NA: 0x1C - JP: 0x1C + EU: 0xE + NA: 0xE + JP: 0xE description: |- Weights for each possible mission_reward_type, exclusively for the ARREST_OUTLAW mission type. Takes priority over CAFE_MISSION_REWARD_TYPE_WEIGHTS and CAFE_MISSION_REWARD_TYPE_WEIGHTS. From 84ba81d3fcc3d188419cbba090e17e13b5a73c1b Mon Sep 17 00:00:00 2001 From: Parker Zhiss <86489014+HappyLappy1@users.noreply.github.com> Date: Mon, 9 Jun 2025 18:50:34 -0400 Subject: [PATCH 068/151] Formatting fix real true ultra mega final --- headers/types/common/enums.h | 1 - 1 file changed, 1 deletion(-) diff --git a/headers/types/common/enums.h b/headers/types/common/enums.h index e7af5c28..b6a8ac3e 100644 --- a/headers/types/common/enums.h +++ b/headers/types/common/enums.h @@ -3872,7 +3872,6 @@ enum mission_subtype_challenge { ENUM_8_BIT(mission_subtype_challenge); #pragma pack(pop) - // Mission subtype for MISSION_TYPE_CONSUMABLE enum mission_subtype_consumable { MISSION_CONSUMABLE_UNK_0 = 0, From af7dfb90b0d532df6f6dae54b6aaff17b9a1fcaa Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Mon, 9 Jun 2025 22:56:36 -0400 Subject: [PATCH 069/151] Apply suggestions from code review Co-authored-by: UsernameFodder <93669634+UsernameFodder@users.noreply.github.com> --- 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 b6a8ac3e..6c3333c8 100644 --- a/headers/types/common/enums.h +++ b/headers/types/common/enums.h @@ -3895,7 +3895,7 @@ union mission_subtype { struct mission_subtype_take_item_8 take_item; struct mission_subtype_outlaw_8 outlaw; struct mission_subtype_challenge_8 challenge; - struct mission_subtype_consumable_8 seven_treasure; + struct mission_subtype_consumable_8 consumable; uint8_t other; }; From 1c93a5947867b13e7d5305a00055d1b25a76463e Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Mon, 9 Jun 2025 22:57:11 -0400 Subject: [PATCH 070/151] Update arm9.yml --- symbols/arm9.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 0c027011..080ba6f4 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -12430,7 +12430,6 @@ arm9: description: |- A list of functions used to validate missions of different types at 02060CEC [EU]. - type: function[8] - name: MISSION_BANNED_STORY_MONSTERS address: EU: 0x20A4314 From 2b06856c1571a3d087c513d86ee5409fabf7d491 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Mon, 9 Jun 2025 23:02:55 -0400 Subject: [PATCH 071/151] Syntax? --- symbols/arm9.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 080ba6f4..8b1045de 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -12429,7 +12429,6 @@ arm9: JP: 0x20 description: |- A list of functions used to validate missions of different types at 02060CEC [EU]. - - name: MISSION_BANNED_STORY_MONSTERS address: EU: 0x20A4314 From 46a0a2138969e43afd234d760c06bb2a2a47e762 Mon Sep 17 00:00:00 2001 From: Parker Zhiss <86489014+HappyLappy1@users.noreply.github.com> Date: Mon, 9 Jun 2025 23:08:52 -0400 Subject: [PATCH 072/151] Final Syntax edits on yml --- symbols/arm9.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 8b1045de..05ade41b 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -12427,8 +12427,7 @@ arm9: EU: 0x20 NA: 0x20 JP: 0x20 - description: |- - A list of functions used to validate missions of different types at 02060CEC [EU]. + description: "A list of functions used to validate missions of different types at 02060CEC [EU]." - name: MISSION_BANNED_STORY_MONSTERS address: EU: 0x20A4314 From 8353b7bb6fe39566825d4c1c8eb8bd2c7297ad96 Mon Sep 17 00:00:00 2001 From: Parker Zhiss <86489014+HappyLappy1@users.noreply.github.com> Date: Mon, 11 Aug 2025 20:12:26 -0400 Subject: [PATCH 073/151] Formatting, yay! --- headers/functions/arm9.h | 7 +++++- headers/types/common/common.h | 47 ++++++++++++++++++++++++++++++++++- headers/types/common/enums.h | 39 ++++++++++++++++++----------- headers/types/files/rescue.h | 13 ++++------ 4 files changed, 82 insertions(+), 24 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index beeb140a..a5e0c2b5 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -196,6 +196,7 @@ enum move_id GetItemMoveId(enum item_id item_id); bool TestItemAiFlag(enum item_id item_id, enum item_flag flag); bool IsItemInTimeDarkness(enum item_id item_id); bool IsItemValidVeneer(enum item_id item_id); +struct item_id_16 ReturnEggExclusiveItem(struct monster_id_16); void SetActiveInventoryToMain(void); void AllInventoriesZInit(void); void SpecialEpisodeInventoryZInit(void); @@ -319,7 +320,11 @@ void ApplyGummiBoostsGroundMode(struct monster_id_16* monster_id, uint16_t* mons struct gummi_result* gummi_result); bool LoadSynthBin(void); void CloseSynthBin(void); -undefined* GetSynthItem(int param_1); +bool GenerateCroagunkItems(void); +struct synth_template* GetSynthItem(struct item_id_16 exclusive_item); +bool GetValidSynthsForSpecies(struct monster_id_16 monster_id, + struct monster_synth_data* monster_synth_data, + struct type_synth_data* type_synth_data); void LoadWazaP(void); void LoadWazaP2(void); void UnloadCurrentWazaP(void); diff --git a/headers/types/common/common.h b/headers/types/common/common.h index ee5747be..d48e3d5d 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -755,6 +755,50 @@ struct adventure_log { }; ASSERT_SIZE(struct adventure_log, 636); +struct monster_synth_data { + // 0x0: Number of Exclusive Items Checked + int32_t num_items_looped; + // 0x4: Sum of all num_to_trade in stored templates + int32_t total_num_to_trade; + // 0x8: synth_templates with exclusive items applicable to the species + struct synth_template* applicable_templates[5]; +}; +ASSERT_SIZE(struct monster_synth_data, 28); + +struct type_synth_data { + // 0x0: A bitfield of which types have species exclusive items. + // Presumably for determining type-specific exclusive items? Croagunk doesn't sell these... + bool type_is_available[20]; +}; +ASSERT_SIZE(struct type_synth_data, 20); + +struct baby_exclusive_item_pair { + struct item_id_16 exc_item_id; + struct monster_id_16 baby_monster; +}; +ASSERT_SIZE(struct baby_exclusive_item_pair, 4); + +struct synth_template { + // 0x0: Item ID of the exclusive item. + struct item_id_16 exc_item_id; + // 0x2: Number of items that need to be traded to Croagunk for that item. + int16_t num_to_trade; + // 0x4: Likely weights for the items to be rolled in the Swap Shop. + int16_t weights_perhaps; + // 0x6: Minimum $SCENARIO_BALANCE_FLAG value for it to spawn. + // Only used for the Water Float (6) and the Phione/Manaphy items (7). + int16_t min_balance_flag; +}; +ASSERT_SIZE(struct synth_template, 8); + +// Structure of SYNTH/synth.bin file, which is used for the Croagunk Swap Shop. +struct synth_file { + struct synth_template synth_templates[780]; + // The last 4 templates appear to be empty, with 0 weight. + struct synth_template unused_templates[4]; +}; +ASSERT_SIZE(struct synth_file, 6272); + struct exclusive_item_stat_boost_entry { int8_t atk; int8_t def; @@ -892,7 +936,8 @@ struct mission_details { undefined field_0x45; undefined field_0x46; undefined field_0x47; - undefined field_0x48; + // Used to pull a string from MISSION_MENU_STRING_IDS_1 + uint8_t mission_menu_string_index; undefined field_0x49; undefined field_0x4a; undefined field_0x4b; diff --git a/headers/types/common/enums.h b/headers/types/common/enums.h index 27cc7435..6f773954 100644 --- a/headers/types/common/enums.h +++ b/headers/types/common/enums.h @@ -3966,16 +3966,25 @@ ENUM_8_BIT(mission_status); #pragma pack(pop) enum mission_template_item_case { - // Treated same as ITEM_CASE_SPECIFIC_ITEM, unused in template - ITEM_CASE_UNK_0 = 0, + // Treated same as ITEM_CASE_SPECIFIC_ITEM, but the item ID must also be obtainable for the + // player. + // Unused by the template. + ITEM_CASE_SPECIFIC_AVAILABLE_ITEM = 0, // mission_template_item_data_1 is ignored, and mission_template_item_data_2 is an item_id ITEM_CASE_SPECIFIC_ITEM = 1, // mission_template_item_data_1 and mission_template_item_data_2 are indices to a table - ITEM_CASE_USE_ITEM_TABLE = 2, - // Has a distinct case menu, unused in template. - ITEM_CASE_UNK_3 = 3, - // mission_template_item_data_1 and mission_template_item_data_2 are ignored - ITEM_CASE_NO_ITEM = 4 + ITEM_CASE_TABLE_AVAILABLE_ITEM = 2, + // similar to ITEM_CASE_TABLE_ITEM, but without a check for availability. Unused in template. + ITEM_CASE_TABLE_ITEM = 3, + // mission_template_item_data_1 and mission_template_item_data_2 are ignored. Instead, pulls + // from + // MISSION_DELIVERY_LIST if possible, or an oran berry (0x46) if not. + // If that gives item ID 0, and this isn't a DELIVERY or FIND_ITEM mission, runs + // RetrieveFromItemList2 + // with a table_id determined by mission rank, ignoring thrown/unstorable items. + // Used mainly by templates without mission-relevant items, or where the item ID is intended to + // be random. + ITEM_CASE_IGNORED = 4 }; #pragma pack(push, 2) @@ -3991,8 +4000,8 @@ union mission_template_item_data { enum mission_template_dungeon_case { DUNGEON_CASE_SPECIFIC_OPENED = 0, // Used for Legendary Challenge Letters, among other things DUNGEON_CASE_SPECIFIC_CLOSED = 1, // Used for Jirachi Challenge Letter and Togetic Mission - DUNGEON_CASE_UNK_2 = 2, // Treated same as DUNGEON_CASE_REVEALED_AND_UNLOCKED - DUNGEON_CASE_UNK_3 = 3, // Treated same as DUNGEON_CASE_REVEALED_AND_UNLOCKED + DUNGEON_CASE_UNK_2 = 2, // Treated same as DUNGEON_CASE_RANDOM_OPEN + DUNGEON_CASE_UNK_3 = 3, // Treated same as DUNGEON_CASE_RANDOM_OPEN DUNGEON_CASE_RANDOM_OPEN = 4, // Used for most missions DUNGEON_CASE_RANDOM_CLOSED = 5 // Used for EXPLORE_NEW_DUNGEON subtype }; @@ -4010,9 +4019,11 @@ enum mission_template_client_case { // mission_template_client_data_1 and mission_template_client_data_2 are indices to a table // This determines the final client in a more restricted manner. // Only used for MISSION_GUIDE_CLIENT in the template - CLIENT_CASE_TABLE_CLIENT = 2, - // Has a distinct case menu, unused in template. - CLIENT_CASE_UNK_3 = 3, + // Also ensures that the client and target are not the same species? + CLIENT_CASE_TABLE_UNIQUE_CLIENT = 2, + // Has a distinct case menu, but seems to do the same as CLIENT_CASE_TABLE_UNIQUE_CLIENT. + // However, no check for uniqueness between target and client is done. Unused in template + CLIENT_CASE_TABLE_CLIENT = 3, // Client is selected at random from GetAllPossibleMonsters. Most missions use this. CLIENT_CASE_RANDOM_CLIENT = 4, }; @@ -4036,9 +4047,9 @@ enum mission_template_target_case { // mission_template_target_data_1 and mission_template_target_data_2 are indices to a table // This determines the final target in a more restricted manner. // Primarily used for outlaw missions in the template - TARGET_CASE_TABLE_TARGET = 2, + TARGET_CASE_TABLE_UNIQUE_TARGET = 2, // Has a distinct case menu, unused in template. - TARGET_CASE_UNK_3 = 3, + TARGET_CASE_TABLE_TARGET = 3, // Target is selected at random from GetAllPossibleMonsters. Most missions use this. CASE_RANDOM_TARGET = 4, TARGET_CASE_UNK_5 = 5, diff --git a/headers/types/files/rescue.h b/headers/types/files/rescue.h index 63f8a597..982e89e1 100644 --- a/headers/types/files/rescue.h +++ b/headers/types/files/rescue.h @@ -61,7 +61,7 @@ struct rescue_item_tables { ASSERT_SIZE(struct rescue_item_tables, 176); // Pokemon tables used by certain mission templates. This could be considered as one table, -// though barring one exception, none of the ranges overlap. +// though none of the ranges overlap. // 0xFA0 in rescue.bin struct rescue_monster_tables { // [0, 65): Used exclusively for the OUTLAW_NORMAL_2 mission subtype, and consists mostly of @@ -86,13 +86,10 @@ struct rescue_monster_tables { // Metagross, Dragonite, Garchomp, Tyranitar, and Salamence. Every Pokemon on this list is fully // evolved if it has evolutions. This list is the same regardless of Whether Magnezone or // Magnemite accompanies you. Overlaps with the range used by the GUIDE_CLIENT template. - // - // [227, 471): Used for the GUIDE_CLIENT mission type, and consists of a wide variety of Pokemon - // defying categorization. Outside of the overlap, the list seems to contain mostly weaker - // Pokemon. There is one invalid Pokemon entry in this table, 0x0CBE. Likely intended to be - // Aipom (0xBE). Should be filtered out by mission generation. Because these two tables overlap, - // it is most efficient to merge them in this struct. - struct monster_id_16 magnet_escort_and_guide_client_table[260]; + struct monster_id_16 magnet_escort_table[33]; + // [244, 471): Used for the GUIDE_CLIENT mission type, and consists of mostly weaker Pokemon, + // such as Torchic, Masquerain, and Squirtle. + struct monster_id_16 guide_client_table[227]; // [471, 582): Used for the OUTLAW_NORMAL_0 mission type, as well as one of the // TAKE_ITEM_NORMAL_OUTLAW templates. Consists mostly of unevolved Pokemon, such as Anorith, // Weedle, Magby, and Buizel. Outliers exist, such as Victreebel, Hitmonlee, and Hitmonchan, but From 587f1da25e6ddfc3d90183892beeb94e8069d3e9 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Tue, 19 Aug 2025 16:42:55 -0400 Subject: [PATCH 074/151] I thiiink I made an endian oopsie? --- headers/types/common/common.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index f3ccc3de..ef63e2a8 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -782,10 +782,10 @@ ASSERT_SIZE(struct baby_exclusive_item_pair, 4); struct synth_template { // 0x0: Item ID of the exclusive item. struct item_id_16 exc_item_id; - // 0x2: Weight for that item to appear in the swap shop. - int16_t item_weight; + // 0x2: Number of items needed to trade. 2/3/5, though only 5 is ever used internally. + int16_t num_to_trade; // 0x4: Seem to be powers of 2: 2/4/8/16/32. Possibly unused weights from EoTD? - int16_t unk_0x4; + int16_t weight; // 0x6: Minimum $SCENARIO_BALANCE_FLAG value for it to spawn. // Only used for the Water Float (6) and the Phione/Manaphy items (7). int16_t min_balance_flag; From ad40296f2ea338b930f145edbf09002e760dde00 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Tue, 19 Aug 2025 16:56:40 -0400 Subject: [PATCH 075/151] Update common.h --- headers/types/common/common.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index f3ccc3de..bbb930fe 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -782,10 +782,10 @@ ASSERT_SIZE(struct baby_exclusive_item_pair, 4); struct synth_template { // 0x0: Item ID of the exclusive item. struct item_id_16 exc_item_id; - // 0x2: Weight for that item to appear in the swap shop. + // 0x2: The individual weight for the item to be selected. int16_t item_weight; - // 0x4: Seem to be powers of 2: 2/4/8/16/32. Possibly unused weights from EoTD? - int16_t unk_0x4; + // 0x2: Number of items required to trade for that item in the shop. Seems to match even for items with specific requirements. + int16_t num_to_trade; // 0x6: Minimum $SCENARIO_BALANCE_FLAG value for it to spawn. // Only used for the Water Float (6) and the Phione/Manaphy items (7). int16_t min_balance_flag; From 61b74f64e743e90e391cd9b8a8dd2ba774969624 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 22 Aug 2025 13:32:29 -0400 Subject: [PATCH 076/151] Update overlay21.yml --- symbols/overlay21.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/symbols/overlay21.yml b/symbols/overlay21.yml index 400cf2b0..4b0648ca 100644 --- a/symbols/overlay21.yml +++ b/symbols/overlay21.yml @@ -12,7 +12,25 @@ overlay21: NA: 0x2E20 JP: 0x2E40 description: Controls the Croagunk Swap Shop. - functions: [] + functions: + - name: SwapShopDialogueManager + address: + EU: 0x238AC80 + description: |- + Called primarily to fill dialogue boxes or display portraits, this function exists to print the next portrait, dialogue, or input for the Swap Shop. + Consistently writes the provided input to shared_switch_case, and occasionally writes to next_switch_case. + Often calls SwapShopInventoryManager, and is often called by SwapShopMainManager. + + r0: New current_switch_case value. + - name: SwapShopMainManager + address: + EU: 0x238C468 + description: |- + Called every frame the Croagunk Swap Shop is open, acting as a parent function for the various processes the Swap Shop is responsible for. + Primarily handles displaying dialogue boxes, retrieving menu selections, and contributing updates to the various switch case indices. + Often calls SwapShopDialogueManager, either with an immediate or with the designated next_switch_case value. + + return: Typically returns 1, but seems to return 4 to exit the Swap Shop. Possibly related to the explorerscript output? data: - name: SWAP_SHOP_WINDOW_PARAMS_1 address: From f5c21f59009d60c06c592cabbec5b330a73efb58 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 22 Aug 2025 13:33:22 -0400 Subject: [PATCH 077/151] Update overlay11.yml --- symbols/overlay11.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/symbols/overlay11.yml b/symbols/overlay11.yml index 1aad05ac..e9bed1ef 100644 --- a/symbols/overlay11.yml +++ b/symbols/overlay11.yml @@ -1,3 +1,4 @@ + overlay11: versions: - EU @@ -1487,6 +1488,16 @@ overlay11: r0: ? r1: ? + - name: SwapShopInventoryManager + address: + EU: 0x230BBA8 + description: |- + Called primarily to fill dialogue boxes or display portraits, this function exists to print the next portrait, dialogue, or input for the Swap Shop. + Consistently writes the provided input to shared_switch_case, and occasionally writes to next_switch_case. + Is the parent function to SwapShopInventoryManager. + + r0: switch case index for the function: 0 = Swap List Inventory, 1 = Unknown, 2 = Species Exclusive Item List, 3 = Item Trade Away Selection List. + r1: Depends on r0. If case 2: ID of the monster to retrieve an exclusive item list for. If case 3: Number of Exclusive Items the player owns. - name: HandleControlsTopScreenGround address: EU: 0x230EFB4 From 5717c64f93a4afbbfa30795ad6b956749e171df7 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 22 Aug 2025 13:51:06 -0400 Subject: [PATCH 078/151] Update overlay21.yml --- symbols/overlay21.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/symbols/overlay21.yml b/symbols/overlay21.yml index 4b0648ca..2fbb7a98 100644 --- a/symbols/overlay21.yml +++ b/symbols/overlay21.yml @@ -22,6 +22,28 @@ overlay21: Often calls SwapShopInventoryManager, and is often called by SwapShopMainManager. r0: New current_switch_case value. + - name: GetFirstExclusivePrerequisite + address: + EU: 0x238C468 + description: |- + Retrieves the item ID of the first item needed to trade for the specified item. There are hardcoded exceptions for the Eeveelution/Hitmontrio items, + but outside of that, the output will be as follows. + output_id = input_id - ((input_id - 0x1FA) % 4) + r0: item ID of the exclusive item to be checked. + return: item ID of the first exclusive item required to trade for the input. + - name: SwapShopEntryPoint + address: + EU: 0x238C388 + description: |- + Is the entrypoint of the overlay_load_entry, and seems to run once to initiate the Swap Shop. Is not called anywhere else. + Allocates space for [TO BE NAMED astruct_9], and initializes many of its fields. + return: Always returns 1. + - name: SwapShopEntryPoint + address: + EU: 0x238C43C + description: |- + Is the destructor of the overlay_load_entry, and seems to run once on closing the Swap Shop. Is not called anywhere else. + Frees up the allocated space for [TO BE NAMED astruct_9] if it is not already empty. - name: SwapShopMainManager address: EU: 0x238C468 From 47a307dd301393395630b380f56e666569082e0e Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Fri, 22 Aug 2025 21:20:35 -0400 Subject: [PATCH 079/151] Update overlay21.yml --- symbols/overlay21.yml | 216 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 205 insertions(+), 11 deletions(-) diff --git a/symbols/overlay21.yml b/symbols/overlay21.yml index 2fbb7a98..78760caf 100644 --- a/symbols/overlay21.yml +++ b/symbols/overlay21.yml @@ -53,6 +53,15 @@ overlay21: Often calls SwapShopDialogueManager, either with an immediate or with the designated next_switch_case value. return: Typically returns 1, but seems to return 4 to exit the Swap Shop. Possibly related to the explorerscript output? + - name: CloseTextboxAndSimpleMenu + address: + EU: 0x238D460 + description: Checks both the text_window_id and menu_window_id for -2. If either are not -2, close the textbox/simple menu, and assign the id to -2. + - name: SwapShopPrintCurrentGold + address: + EU: 0x238D4E4 + description: A text box callback function containing the player's current gold, seen on the Swap Shop main menu. + r0: window_id of the textbox data: - name: SWAP_SHOP_WINDOW_PARAMS_1 address: @@ -120,27 +129,31 @@ overlay21: - name: OVERLAY21_UNKNOWN_STRING_IDS address: NA: 0x238CB00 + EU: 0x238D640 length: NA: 0x38 - description: "Note: unverified, ported from Irdkwia's notes" + description: Seem to be completely unused by the Swap Shop, but the strings are 1:1 for the ones that are in use elsewhere. - name: SWAP_SHOP_WINDOW_PARAMS_2 address: NA: 0x238CB38 + EU: 0x238D678 length: NA: 0x10 - description: "Note: unverified, ported from Irdkwia's notes" + description: Seem to be completely unused by the Swap Shop. - name: SWAP_SHOP_WINDOW_PARAMS_3 address: NA: 0x238CB48 + EU: 0x238d6A8 length: NA: 0x10 - description: "Note: unverified, ported from Irdkwia's notes" + description: Seem to be completely unused by the Swap Shop. - name: SWAP_SHOP_WINDOW_PARAMS_4 address: NA: 0x238CB58 + EU: length: NA: 0x10 - description: "Note: unverified, ported from Irdkwia's notes" + description: Seem to be completely unused by the Swap Shop. - name: SWAP_SHOP_WINDOW_PARAMS_5 address: EU: 0x238D6A8 @@ -149,7 +162,7 @@ overlay21: length: EU: 0x10 NA: 0x10 - description: "Note: unverified, ported from Irdkwia's notes" + description: Used alongside SWAP_SHOP_MAIN_MENU_ITEMS_2. - name: SWAP_SHOP_WINDOW_PARAMS_6 address: EU: 0x238D6B8 @@ -158,7 +171,7 @@ overlay21: length: EU: 0x10 NA: 0x10 - description: "Note: unverified, ported from Irdkwia's notes" + description: Used alongside SWAP_SHOP_MAIN_MENU_ITEMS_1. - name: SWAP_SHOP_WINDOW_PARAMS_7 address: EU: 0x238D6C8 @@ -167,7 +180,7 @@ overlay21: length: EU: 0x10 NA: 0x10 - description: "Note: unverified, ported from Irdkwia's notes" + description: Used alongside SWAP_SHOP_MENU_ITEMS_CONFIRM. - name: SWAP_SHOP_WINDOW_PARAMS_8 address: EU: 0x238D6D8 @@ -176,7 +189,7 @@ overlay21: length: EU: 0x10 NA: 0x10 - description: "Note: unverified, ported from Irdkwia's notes" + description: Used alone, seemingly for the exclusive item description window. - name: SWAP_SHOP_WINDOW_PARAMS_9 address: EU: 0x238D6E8 @@ -185,15 +198,196 @@ overlay21: length: EU: 0x10 NA: 0x10 - description: "Note: unverified, ported from Irdkwia's notes" - - name: OVERLAY21_JP_STRING + description: Used alongside SWAP_SHOP_SUBMENU_ITEMS_3. + - name: SWAP_SHOP_DEBUG_STRING_1 + address: + EU: 0x238D6F8 + length: + EU: 0x1D + description: MENU_SYNTHESIS_MODE_START:\n + + - name: SWAP_SHOP_DEBUG_STRING_2 + address: + EU: 0x238D714 + length: + EU: 0x22 + description: MENU_SYNTHESIS_MODE_SELECTMENU:\n + + - name: SWAP_SHOP_DEBUG_STRING_3 + address: + EU: 0x238D738 + length: + EU: 0x1F + description: MENU_SYNTHESIS_MODE_RESTART:\n + + - name: SWAP_SHOP_DEBUG_STRING_4 + address: + EU: 0x238D758 + length: + EU: 0x23 + description: MENU_SYNTHESIS_MODE_EXPLANATION:\n + + - name: SWAP_SHOP_DEBUG_STRING_5 + address: + EU: 0x238D77C + length: + EU: 0x1E + description: MENU_SYNTHESIS_MODE_THANKS:\n + + - name: SWAP_SHOP_DEBUG_STRING_6 + address: + EU: 0x238D79C + length: + EU: 0x20 + description: MENU_SYNTHESIS_MODE_ITEM_NON:\n + + - name: SWAP_SHOP_DEBUG_STRING_7 + address: + EU: 0x238D7BC + length: + EU: 0x1F + description: MENU_SYNTHESIS_MODE_GOLD_NON\n + + - name: SWAP_SHOP_DEBUG_STRING_8 + address: + EU: 0x238D7DC + length: + EU: 0x14 + description: MENU_SYNTHESIS_GOLD + + - name: SWAP_SHOP_DEBUG_STRING_9 + address: + EU: 0x238D800 + length: + EU: 0x23 + description: MENU_SYNTHESIS_MODE_SELECT_FULL:\n + + - name: SWAP_SHOP_DEBUG_STRING_10 + address: + EU: 0x238D824 + length: + EU: 0x1B + description: MENU_SYNTHESIS_MODE_QUIT\n + + - name: SWAP_SHOP_DEBUG_STRING_11 + address: + EU: 0x238D840 + length: + EU: 0x24 + description: MENU_SYNTHESIS_MODE_SELECT_START:\n + + - name: SWAP_SHOP_DEBUG_STRING_12 + address: + EU: 0x238D864 + length: + EU: 0x20 + description: MENU_SYNTHESIS_MODE__RESTART:\n + + - name: SWAP_SHOP_DEBUG_STRING_13 + address: + EU: 0x238D884 + length: + EU: 0x23 + description: MENU_SYNTHESIS_MODE_SELECT_INIT:\n + + - name: SWAP_SHOP_DEBUG_STRING_14 + address: + EU: 0x238D8A8 + length: + EU: 0x25 + description: MENU_SYNTHESIS_MODE_SELECT_SELECT:\n + + - name: SWAP_SHOP_DEBUG_STRING_15 + address: + EU: 0x238D8CC + length: + EU: 0x27 + description: MENU_SYNTHESIS_MODE_SELECT_RESELECT:\n + + - name: SWAP_SHOP_DEBUG_STRING_16 + address: + EU: 0x238D8F4 + length: + EU: 0x29 + description: \tMENU_SYNTHESIS_MODE_SELECT_SUB_MENU:\n + + - name: SWAP_SHOP_DEBUG_STRING_17 + address: + EU: 0x238D91C + length: + EU: 0x23 + description: MENU_SYNTHESIS_MODE_SELECT_EXPLA\n + + - name: SWAP_SHOP_DEBUG_STRING_18 + address: + EU: 0x238D940 + length: + EU: 0x9 + description: [item:0] + + - name: SWAP_SHOP_DEBUG_STRING_19 + address: + EU: 0x238D94C + length: + EU: 0x28 + description: MENU_SYNTHESIS_MODE_SELECT_CONFIRM_1:\n + + - name: SWAP_SHOP_DEBUG_STRING_20 + address: + EU: 0x238D974 + length: + EU: 0x16 + description: _SELL_CONFIRM NEW_1\n + + - name: SWAP_SHOP_DEBUG_STRING_21 + address: + EU: 0x238D98C + length: + EU: 0x2C + description: MENU_SYNTHESIS_MODE_SELECT_THANKS_ACTION:\n + + - name: SWAP_SHOP_DEBUG_STRING_22 + address: + EU: 0x238D9B8 + length: + EU: 0x2D + description: MENU_SYNTHESIS_MODE_SELECT_THANKS_ACTION2:\n + + - name: SWAP_SHOP_DEBUG_STRING_23 + address: + EU: 0x238D9E4 + length: + EU: 0x2D + description: MENU_SYNTHESIS_MODE_SELECT_THANKS_ACTION3:\n + + - name: SWAP_SHOP_DEBUG_STRING_24 + address: + EU: 0x238DA10 + length: + EU: 0x27 + description: MENU_SYNTHESIS_MODE_SELECT_THANKS_1:\n + + - name: SWAP_SHOP_DEBUG_STRING_25 + address: + EU: 0x238DA38 + length: + EU: 0x25 + description: MENU_SYNTHESIS_MODE_SELECT_THANKS:\n + - name: SWAP_SHOP_DEBUG_STRING_26 + - alias: OVERLAY21_JP_STRING address: EU: 0x238DA5C NA: 0x238CF1C JP: 0x238E48C length: NA: 0x8 - description: 合成: + description: 合成:("synthesis: " in Japanese) + - name: SWAP_SHOP_DEBUG_STRING_27 + address: + EU: 0x238DA64 + length: + EU: 0x13 + description: [CS:V][gold:0][CR] - name: OVERLAY21_RESERVED_SPACE address: NA: 0x238CF38 From 434476054f3ad33af78806a407faf43ee8aecedf Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 23 Aug 2025 15:26:00 -0400 Subject: [PATCH 080/151] Create overlay21.h --- headers/functions/overlay21.h | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 headers/functions/overlay21.h diff --git a/headers/functions/overlay21.h b/headers/functions/overlay21.h new file mode 100644 index 00000000..5d9df4e5 --- /dev/null +++ b/headers/functions/overlay21.h @@ -0,0 +1,11 @@ +#ifndef HEADERS_FUNCTIONS_OVERLAY21_H_ +#define HEADERS_FUNCTIONS_OVERLAY21_H_ + +void SwapShopDialogueManager(int current_switch_case); +struct item_id GetFirstExclusivePrerequisite(struct item_id); +int SwapShopEntryPoint(void); +void SwapShopDestructor(void); +void SwapShopMainManager(void); +void CloseTextboxAndSimpleMenu(void); +void SwapShopPrintCurrentGold(int window_id); +#endif From d2b450d74f9a598b937d82df2e59da20bd54d02a Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 23 Aug 2025 15:41:42 -0400 Subject: [PATCH 081/151] Update overlay21.yml --- symbols/overlay21.yml | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/symbols/overlay21.yml b/symbols/overlay21.yml index 78760caf..7593e881 100644 --- a/symbols/overlay21.yml +++ b/symbols/overlay21.yml @@ -38,7 +38,7 @@ overlay21: Is the entrypoint of the overlay_load_entry, and seems to run once to initiate the Swap Shop. Is not called anywhere else. Allocates space for [TO BE NAMED astruct_9], and initializes many of its fields. return: Always returns 1. - - name: SwapShopEntryPoint + - name: SwapShopDestructor address: EU: 0x238C43C description: |- @@ -71,7 +71,7 @@ overlay21: length: EU: 0x10 NA: 0x10 - description: "Note: unverified, ported from Irdkwia's notes" + description: Used with SwapShopPrintCurrentGold for a simple textbox. - name: SWAP_SHOP_MENU_ITEMS_CONFIRM address: EU: 0x238D578 @@ -81,6 +81,7 @@ overlay21: EU: 0x18 NA: 0x18 JP: 0x18 + description: Used with SWAP_SHOP_WINDOW_PARAMS_7. - name: SWAP_SHOP_SUBMENU_ITEMS_1 address: EU: 0x238D590 @@ -90,6 +91,7 @@ overlay21: EU: 0x18 NA: 0x18 JP: 0x18 + description: Used with SWAP_SHOP_WINDOW_PARAMS_6. - name: SWAP_SHOP_SUBMENU_ITEMS_2 address: EU: 0x238D5A8 @@ -99,6 +101,7 @@ overlay21: EU: 0x20 NA: 0x20 JP: 0x20 + description: Used with SWAP_SHOP_WINDOW_PARAMS_7. - name: SWAP_SHOP_MAIN_MENU_ITEMS_1 address: EU: 0x238D5C8 @@ -108,6 +111,7 @@ overlay21: EU: 0x20 NA: 0x20 JP: 0x20 + description: Used with SWAP_SHOP_WINDOW_PARAMS_6. - name: SWAP_SHOP_MAIN_MENU_ITEMS_2 address: EU: 0x238D5E8 @@ -117,6 +121,7 @@ overlay21: EU: 0x28 NA: 0x28 JP: 0x28 + description: Used alongside SWAP_SHOP_WINDOW_PARAMS_5. - name: SWAP_SHOP_SUBMENU_ITEMS_3 address: EU: 0x238D610 @@ -126,13 +131,14 @@ overlay21: EU: 0x30 NA: 0x30 JP: 0x30 + description: Used alongside SWAP_SHOP_WINDOW_PARAMS_9. - name: OVERLAY21_UNKNOWN_STRING_IDS address: NA: 0x238CB00 EU: 0x238D640 length: NA: 0x38 - description: Seem to be completely unused by the Swap Shop, but the strings are 1:1 for the ones that are in use elsewhere. + description: Seem to be completely unused by the Swap Shop, but the strings are 1:1 for the ones that are in use elsewhere in the shop. - name: SWAP_SHOP_WINDOW_PARAMS_2 address: NA: 0x238CB38 @@ -171,7 +177,7 @@ overlay21: length: EU: 0x10 NA: 0x10 - description: Used alongside SWAP_SHOP_MAIN_MENU_ITEMS_1. + description: Used alongside both SWAP_SHOP_MAIN_MENU_ITEMS_1 and SWAP_SHOP_SUBMENU_ITEMS_1. - name: SWAP_SHOP_WINDOW_PARAMS_7 address: EU: 0x238D6C8 @@ -180,7 +186,7 @@ overlay21: length: EU: 0x10 NA: 0x10 - description: Used alongside SWAP_SHOP_MENU_ITEMS_CONFIRM. + description: Used alongside both SWAP_SHOP_MENU_ITEMS_CONFIRM and SWAP_SHOP_SUBMENU_ITEMS_2. - name: SWAP_SHOP_WINDOW_PARAMS_8 address: EU: 0x238D6D8 @@ -374,7 +380,8 @@ overlay21: EU: 0x25 description: MENU_SYNTHESIS_MODE_SELECT_THANKS:\n - name: SWAP_SHOP_DEBUG_STRING_26 - - alias: OVERLAY21_JP_STRING + aliases: + - OVERLAY21_JP_STRING address: EU: 0x238DA5C NA: 0x238CF1C @@ -394,17 +401,17 @@ overlay21: length: NA: 0x8 description: "Note: unverified, ported from Irdkwia's notes" - - name: OVERLAY21_UNKNOWN_POINTER__NA_238CF40 + - name: SWAP_SHOP_[TO BE NAMED astruct_9]_PTR address: EU: 0x238DA80 NA: 0x238CF40 JP: 0x238E4C0 length: NA: 0x4 - description: "Note: unverified, ported from Irdkwia's notes" + description: Pointer to the [TO BE NAMED astruct_9] that governs the operations of most overlay_21 functions. - name: OVERLAY21_UNKNOWN_POINTER__NA_238CF44 address: NA: 0x238CF44 length: NA: 0x4 - description: "Note: unverified, ported from Irdkwia's notes" + description: "Note: unverified, ported from Irdkwia's notes". Unable to locate, may be unused. From fb477196d5da0c7b173351078520ebd9cb599f27 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 23 Aug 2025 15:54:10 -0400 Subject: [PATCH 082/151] Update overlay21.yml --- symbols/overlay21.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/symbols/overlay21.yml b/symbols/overlay21.yml index 7593e881..c84aa68c 100644 --- a/symbols/overlay21.yml +++ b/symbols/overlay21.yml @@ -379,9 +379,7 @@ overlay21: length: EU: 0x25 description: MENU_SYNTHESIS_MODE_SELECT_THANKS:\n - - name: SWAP_SHOP_DEBUG_STRING_26 - aliases: - - OVERLAY21_JP_STRING + - name: OVERLAY21_JP_STRING address: EU: 0x238DA5C NA: 0x238CF1C @@ -389,7 +387,7 @@ overlay21: length: NA: 0x8 description: 合成:("synthesis: " in Japanese) - - name: SWAP_SHOP_DEBUG_STRING_27 + - name: SWAP_SHOP_GOLD_STRING address: EU: 0x238DA64 length: From 02e7639b1e05aad159544a13742029eaeef0b5a4 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 23 Aug 2025 15:57:42 -0400 Subject: [PATCH 083/151] Update overlay21.h --- headers/data/overlay21.h | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/headers/data/overlay21.h b/headers/data/overlay21.h index 033e3afa..ccb7bd3c 100644 --- a/headers/data/overlay21.h +++ b/headers/data/overlay21.h @@ -8,6 +8,7 @@ extern struct simple_menu_id_item SWAP_SHOP_SUBMENU_ITEMS_2[4]; extern struct simple_menu_id_item SWAP_SHOP_MAIN_MENU_ITEMS_1[4]; extern struct simple_menu_id_item SWAP_SHOP_MAIN_MENU_ITEMS_2[5]; extern struct simple_menu_id_item SWAP_SHOP_SUBMENU_ITEMS_3[6]; +extern int16_t OVERLAY21_UNKNOWN_STRING_IDS[24]; extern struct window_params SWAP_SHOP_WINDOW_PARAMS_2; extern struct window_params SWAP_SHOP_WINDOW_PARAMS_3; extern struct window_params SWAP_SHOP_WINDOW_PARAMS_4; @@ -16,5 +17,34 @@ extern struct window_params SWAP_SHOP_WINDOW_PARAMS_6; extern struct window_params SWAP_SHOP_WINDOW_PARAMS_7; extern struct window_params SWAP_SHOP_WINDOW_PARAMS_8; extern struct window_params SWAP_SHOP_WINDOW_PARAMS_9; - +extern char SWAP_SHOP_DEBUG_STRING_1[28]; +extern char SWAP_SHOP_DEBUG_STRING_2[33]; +extern char SWAP_SHOP_DEBUG_STRING_3[30]; +extern char SWAP_SHOP_DEBUG_STRING_4[34]; +extern char SWAP_SHOP_DEBUG_STRING_5[29]; +extern char SWAP_SHOP_DEBUG_STRING_6[31]; +extern char SWAP_SHOP_DEBUG_STRING_7[30]; +extern char SWAP_SHOP_DEBUG_STRING_8[19]; +extern char SWAP_SHOP_DEBUG_STRING_9[34]; +extern char SWAP_SHOP_DEBUG_STRING_10[26]; +extern char SWAP_SHOP_DEBUG_STRING_11[35]; +extern char SWAP_SHOP_DEBUG_STRING_12[31]; +extern char SWAP_SHOP_DEBUG_STRING_13[34]; +extern char SWAP_SHOP_DEBUG_STRING_14[36]; +extern char SWAP_SHOP_DEBUG_STRING_15[38]; +extern char SWAP_SHOP_DEBUG_STRING_16[40]; +extern char SWAP_SHOP_DEBUG_STRING_17[34]; +extern char SWAP_SHOP_DEBUG_STRING_18[8]; +extern char SWAP_SHOP_DEBUG_STRING_19[39]; +extern char SWAP_SHOP_DEBUG_STRING_20[21]; +extern char SWAP_SHOP_DEBUG_STRING_21[43]; +extern char SWAP_SHOP_DEBUG_STRING_22[44]; +extern char SWAP_SHOP_DEBUG_STRING_23[44]; +extern char SWAP_SHOP_DEBUG_STRING_24[38]; +extern char SWAP_SHOP_DEBUG_STRING_25[36]; +extern int16_t OVERLAY21_JP_STRING[3]; +extern char SWAP_SHOP_GOLD_STRING[18]; +extern byte OVERLAY21_RESERVED_SPACE[8]; +extern astruct_9* SWAP_SHOP_[TO BE NAMED astruct_9]_PTR; +extern undefined* OVERLAY21_UNKNOWN_POINTER__NA_238CF44; #endif From 3981fdf0a7693de526b345aba45b420f832e11d4 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 23 Aug 2025 18:40:26 -0400 Subject: [PATCH 084/151] Update ground_mode.h --- headers/types/ground_mode/ground_mode.h | 72 +++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index 9f48f6f7..2f729c0a 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -636,4 +636,76 @@ struct ground_entity_function_table { }; ASSERT_SIZE(struct ground_entity_function_table, 80); +struct swap_menu_manager { + // 0x0: The switch case index shared by SwapShopMainManager and SwapShopDialogueManager. + int32_t shared_switch_case; + // 0x4: The "next" switch case index to be shared, typically assigned by SwapShopMainManager. + int32_t next_switch_case; + // 0x8: Used exclusively by SwapShopMainManager. More research needed. + int32_t unk_windows_counter; + // 0xC: If true, croagunk will not ask the player if they want to continue swapping. + bool croagunk_out_of_swaps; + undefined field_0xd; + // 0xE: The item the player will receive by swapping. + struct bulk_item received_item; + undefined field_0x12; + undefined field_0x13; + undefined field_0x14; + undefined field_0x15; + undefined field_0x16; + undefined field_0x17; + // 0x18: While selecting which items to give croagunk, this field is filled when selecting "info" on an item in the list. + struct bulk_item described_item; + // 0x1C: Whenever a simple menu is run, this field is where the result is stored. + int32_t simple_menu_result; + // 0x20: Zeroed in SwapShopEntryPoint, but never modified + struct undefined4 unk_int_1; + // 0x24: Zeroed in SwapShopEntryPoint, but never modified + struct undefined4 unk_int_2; + // 0x28: Emotion for croagunk's portrait. + int32_t emotion_id; + // 0x2C: The case menu for a smaller switch case at the top of SwapShopMainManager. + int32_t window_manager_case; + // 0x30: Stores preprocessor_args for the next window. + struct preprocessor_args preprocessor_args; + // 0x80: The window_id of the current dialogue box window. -2 if none are present. + int8_t dialogue_window_id; + // 0x81: The window_id of the current portrait window. -2 if none are present. + int8_t portrait_window_id; + // 0x82: The window_id of the current advanced textbox window. -2 if none are present. + int8_t advanced_textbox_window_id; + // 0x83: The window_id of the current simple menu window. -2 if none are present. + int8_t simple_menu_window_id; + // 0x84: The window_id of the current text box window. -2 if none are present. + int8_t text_window_id; + // 0x85: The window_id of the current scroll box window. -2 if none are present. + int8_t scroll_box_window_id; + // 0x86: A small buffer for preprocessed text strings. + char text_string[66]; + // 0xC8: Stores portrait_params for croagunk's next portrait. + struct portrait_params portrait_params; + // 0xD8: Stores the number of items required to trade for the current trade. + int16_t exc_item_trade_count; + // 0xDA: The number of exclusive items currently in the bag. + int16_t exc_bag_item_count; + // 0xDC: The individual item IDs of the exclusive items present in the bag. + struct item_id_16 exc_bag_item_ids[50]; + // 0x140: The number of exclusive items currently in storage. + int16_t exc_storage_item_count; + // 0x142: The individual item IDs of the exclusive items in storage. + struct item_id_16 exc_storage_item_ids[1000]; + undefined field_0x912; + undefined field_0x913; + // 0x914: The team member slot whose exclusive items are about to be viewed. + int32_t selected_team_member_slot; + // 0x918: The move slot to create an info menu for. + int16_t selected_move_slot; + // 0x91A: The four moves known by selected_team_member_slot. + struct move known_moves[4]; + undefined field_0x93a; + undefined field_0x93b; +} +ASSERT_SIZE(struct swap_menu_manager, 2364); + + #endif From 9d222aa58ea0f5040a4faa3f4e14acde0f79155c Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 23 Aug 2025 18:41:19 -0400 Subject: [PATCH 085/151] Update overlay21.yml --- symbols/overlay21.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/symbols/overlay21.yml b/symbols/overlay21.yml index c84aa68c..b3069bd9 100644 --- a/symbols/overlay21.yml +++ b/symbols/overlay21.yml @@ -36,14 +36,14 @@ overlay21: EU: 0x238C388 description: |- Is the entrypoint of the overlay_load_entry, and seems to run once to initiate the Swap Shop. Is not called anywhere else. - Allocates space for [TO BE NAMED astruct_9], and initializes many of its fields. + Allocates space for the swap_menu_manager, and initializes many of its fields. return: Always returns 1. - name: SwapShopDestructor address: EU: 0x238C43C description: |- Is the destructor of the overlay_load_entry, and seems to run once on closing the Swap Shop. Is not called anywhere else. - Frees up the allocated space for [TO BE NAMED astruct_9] if it is not already empty. + Frees up the allocated space for the swap_menu_manager if it is not already empty. - name: SwapShopMainManager address: EU: 0x238C468 @@ -399,14 +399,14 @@ overlay21: length: NA: 0x8 description: "Note: unverified, ported from Irdkwia's notes" - - name: SWAP_SHOP_[TO BE NAMED astruct_9]_PTR + - name: SWAP_SHOP_MENU_MANAGER_PTR address: EU: 0x238DA80 NA: 0x238CF40 JP: 0x238E4C0 length: NA: 0x4 - description: Pointer to the [TO BE NAMED astruct_9] that governs the operations of most overlay_21 functions. + description: Pointer to the swap_menu_manager that governs the operations of most overlay_21 functions. - name: OVERLAY21_UNKNOWN_POINTER__NA_238CF44 address: NA: 0x238CF44 From 2510de25e9eda10cda444f803b3ca3b37fc066c5 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 23 Aug 2025 18:42:13 -0400 Subject: [PATCH 086/151] Update overlay21.h --- headers/data/overlay21.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/data/overlay21.h b/headers/data/overlay21.h index ccb7bd3c..d947fb6b 100644 --- a/headers/data/overlay21.h +++ b/headers/data/overlay21.h @@ -45,6 +45,6 @@ extern char SWAP_SHOP_DEBUG_STRING_25[36]; extern int16_t OVERLAY21_JP_STRING[3]; extern char SWAP_SHOP_GOLD_STRING[18]; extern byte OVERLAY21_RESERVED_SPACE[8]; -extern astruct_9* SWAP_SHOP_[TO BE NAMED astruct_9]_PTR; +extern astruct_9* SWAP_SHOP_MENU_MANAGER_PTR; extern undefined* OVERLAY21_UNKNOWN_POINTER__NA_238CF44; #endif From 6e8e5aa1ed55c11a19c95ef2cf8158bc0083f1a7 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 23 Aug 2025 18:42:29 -0400 Subject: [PATCH 087/151] Update ground_mode.h --- headers/types/ground_mode/ground_mode.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index 2f729c0a..32f8cd19 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -636,7 +636,7 @@ struct ground_entity_function_table { }; ASSERT_SIZE(struct ground_entity_function_table, 80); -struct swap_menu_manager { +struct swap_shop_menu_manager { // 0x0: The switch case index shared by SwapShopMainManager and SwapShopDialogueManager. int32_t shared_switch_case; // 0x4: The "next" switch case index to be shared, typically assigned by SwapShopMainManager. @@ -705,7 +705,7 @@ struct swap_menu_manager { undefined field_0x93a; undefined field_0x93b; } -ASSERT_SIZE(struct swap_menu_manager, 2364); +ASSERT_SIZE(struct swap_shop_menu_manager, 2364); #endif From facaa3cd4c17302627799c77cab33107c958726a Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sat, 23 Aug 2025 18:42:59 -0400 Subject: [PATCH 088/151] Update overlay21.yml --- symbols/overlay21.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/symbols/overlay21.yml b/symbols/overlay21.yml index b3069bd9..7189ef6c 100644 --- a/symbols/overlay21.yml +++ b/symbols/overlay21.yml @@ -36,14 +36,14 @@ overlay21: EU: 0x238C388 description: |- Is the entrypoint of the overlay_load_entry, and seems to run once to initiate the Swap Shop. Is not called anywhere else. - Allocates space for the swap_menu_manager, and initializes many of its fields. + Allocates space for the swap_shop_menu_manager, and initializes many of its fields. return: Always returns 1. - name: SwapShopDestructor address: EU: 0x238C43C description: |- Is the destructor of the overlay_load_entry, and seems to run once on closing the Swap Shop. Is not called anywhere else. - Frees up the allocated space for the swap_menu_manager if it is not already empty. + Frees up the allocated space for the swap_shop_menu_manager if it is not already empty. - name: SwapShopMainManager address: EU: 0x238C468 @@ -406,7 +406,7 @@ overlay21: JP: 0x238E4C0 length: NA: 0x4 - description: Pointer to the swap_menu_manager that governs the operations of most overlay_21 functions. + description: Pointer to the swap_shop_menu_manager that governs the operations of most overlay_21 functions. - name: OVERLAY21_UNKNOWN_POINTER__NA_238CF44 address: NA: 0x238CF44 From 5bf91f4f8369d5af993e1feabfac524dd26b0113 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 00:20:10 -0400 Subject: [PATCH 089/151] Update overlay21.yml --- symbols/overlay21.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/symbols/overlay21.yml b/symbols/overlay21.yml index 7189ef6c..02bc5324 100644 --- a/symbols/overlay21.yml +++ b/symbols/overlay21.yml @@ -36,14 +36,14 @@ overlay21: EU: 0x238C388 description: |- Is the entrypoint of the overlay_load_entry, and seems to run once to initiate the Swap Shop. Is not called anywhere else. - Allocates space for the swap_shop_menu_manager, and initializes many of its fields. + Allocates space for swap_shop_menu_data, and initializes many of its fields. return: Always returns 1. - name: SwapShopDestructor address: EU: 0x238C43C description: |- Is the destructor of the overlay_load_entry, and seems to run once on closing the Swap Shop. Is not called anywhere else. - Frees up the allocated space for the swap_shop_menu_manager if it is not already empty. + Frees up the allocated space for swap_shop_menu_data if it is not already empty. - name: SwapShopMainManager address: EU: 0x238C468 @@ -399,14 +399,14 @@ overlay21: length: NA: 0x8 description: "Note: unverified, ported from Irdkwia's notes" - - name: SWAP_SHOP_MENU_MANAGER_PTR + - name: SWAP_SHOP_MENU_DATA_PTR address: EU: 0x238DA80 NA: 0x238CF40 JP: 0x238E4C0 length: NA: 0x4 - description: Pointer to the swap_shop_menu_manager that governs the operations of most overlay_21 functions. + description: Pointer to the swap_shop_menu_data that governs the operations of most overlay_21 functions. - name: OVERLAY21_UNKNOWN_POINTER__NA_238CF44 address: NA: 0x238CF44 From ba485ae4a5e2e3c09efc95720e8a5bc691edd1a3 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 00:20:32 -0400 Subject: [PATCH 090/151] Update overlay21.h --- headers/data/overlay21.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/data/overlay21.h b/headers/data/overlay21.h index d947fb6b..1fae4a7c 100644 --- a/headers/data/overlay21.h +++ b/headers/data/overlay21.h @@ -45,6 +45,6 @@ extern char SWAP_SHOP_DEBUG_STRING_25[36]; extern int16_t OVERLAY21_JP_STRING[3]; extern char SWAP_SHOP_GOLD_STRING[18]; extern byte OVERLAY21_RESERVED_SPACE[8]; -extern astruct_9* SWAP_SHOP_MENU_MANAGER_PTR; +extern astruct_9* SWAP_SHOP_MENU_DATA_PTR; extern undefined* OVERLAY21_UNKNOWN_POINTER__NA_238CF44; #endif From 9f66edeb8a8bc3de75093e4e08054a59bc88ce1d Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 00:36:16 -0400 Subject: [PATCH 091/151] Update ground_mode.h --- headers/types/ground_mode/ground_mode.h | 66 ++++++++++++++++++++++++- 1 file changed, 65 insertions(+), 1 deletion(-) diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index 32f8cd19..ab594802 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -705,7 +705,71 @@ struct swap_shop_menu_manager { undefined field_0x93a; undefined field_0x93b; } -ASSERT_SIZE(struct swap_shop_menu_manager, 2364); +ASSERT_SIZE(struct swap_shop_menu_data, 2364); +struct swap_shop_inventory_ptrs { + // 0x0: Seems to be a pointer to some kind of temporary variable? + undefined* temp_variable; + // 0x4: A pointer to the swap_shop_inventory_data struct. + struct swap_shop_inventory_data* inventory_data; +} +ASSERT_SIZE(struct exc_item_trade_slot, 8); + +// +struct swap_shop_inventory_data { + // 0x0: switch case id for SwapShopInventoryManager + int32_t inventory_case_id; + // 0x4: A copy of num_valid_shop_items to be used by CreateCollectionMenu? + int32_t num_valid_shop_items_temp; + // 0x8: Seemingly unused, these are zeroed for some reason? + int32_t mystery_ints[1068]; + // 0x10B8: If the item is purchasable, this field will be 0x2. Otherwise, it will be 0x0. + int8_t is_item_purchasable[1068]; + // 0x14E4: Seems to be a window_id for a collection menu. + int8_t collection_menu_window_id; + undefined field_0x14e5; + // 0x14E6: Seems to be a struct for each item in the shop. + struct exc_item_trade_slot exc_item_trade_slots[1068]; + // 0x2DEE: For each item in the swap list, is the number of that item available? + struct int16_t item_quantities[1068]; + // 0x3646: List of every exclusive item the player owns. + struct item_id_16 owned_exclusive_items[1000]; + // 0x3E16: List of how much of each owned_exclusive_item the player owns. + struct int16_t owned_item_quantities[1000]; + // 0x45E6: The synth_templates matching today's rolled swap shop items. + struct synth_template shop_synth_templates[8]; + // 0x4626: Total number of items for sale in the swap shop. + int16_t num_valid_shop_items; + // 0x4628: Number of items required to be traded to croagunk for the selected item. + int16_t num_required_trade_items; + undefined field_0x462a; + undefined field_0x462b; + // 0x462C + struct window_extra_info window_extra_info_ptr; + // 0x46C4: Whether or not the synth.bin file is open. + struct bool synth_bin_open; + undefined field_0x46c5; + undefined field_0x46c6; + undefined field_0x46c7; + // 0x46C8 + int32_t textbox_window_id; + struct text_box * textbox_ptr; + // 0x46D0: The item ID the player selects when choosing items to give croagunk. Used to check the item info. + struct item_id_16 selected_item_id; + undefined field_0x46d2; + undefined field_0x46d3; +} +ASSERT_SIZE(struct swap_shop_inventory_data, 18132); + +struct exc_item_trade_slot { + // 0x0: The trade type the item slot uses. + enum trade_type trade_type; + // 0x2: This is likely either the item_id of the slot, or the index of the slot. It might vary depending on the trade_type. + undefined2 unk_0x2; + // 0x4: If the player has enough exclusive items to swap for the item, this will be true. + bool can_afford_item; + undefined unk_0x5; +} +ASSERT_SIZE(struct exc_item_trade_slot, 6); #endif From e05dae04f50efb71469b955fb41422d55439dbc0 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 00:37:57 -0400 Subject: [PATCH 092/151] Update overlay11.yml --- symbols/overlay11.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/symbols/overlay11.yml b/symbols/overlay11.yml index e9bed1ef..04b65a7e 100644 --- a/symbols/overlay11.yml +++ b/symbols/overlay11.yml @@ -1822,6 +1822,14 @@ overlay11: Host pointers to multiple structure used for performing an overworld scene type: struct main_ground_data + - name: SWAP_SHOP_INVENTORY_PTRS + address: + EU: 0x23258E4 + length: + EU: 0x8 + description: |- + Host pointers to multiple structures used for performing internal Swap Shop checks. + - name: WORLD_MAP_MODE address: EU: 0x2325924 From 9eb924a79940371727286f31ff09c9b0e039d582 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 00:38:39 -0400 Subject: [PATCH 093/151] Update overlay21.h --- headers/data/overlay21.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/headers/data/overlay21.h b/headers/data/overlay21.h index 1fae4a7c..01131c35 100644 --- a/headers/data/overlay21.h +++ b/headers/data/overlay21.h @@ -44,7 +44,7 @@ extern char SWAP_SHOP_DEBUG_STRING_24[38]; extern char SWAP_SHOP_DEBUG_STRING_25[36]; extern int16_t OVERLAY21_JP_STRING[3]; extern char SWAP_SHOP_GOLD_STRING[18]; -extern byte OVERLAY21_RESERVED_SPACE[8]; -extern astruct_9* SWAP_SHOP_MENU_DATA_PTR; +extern undefined OVERLAY21_RESERVED_SPACE[8]; +extern swap_shop_menu_data* SWAP_SHOP_MENU_DATA_PTR; extern undefined* OVERLAY21_UNKNOWN_POINTER__NA_238CF44; #endif From 1b71f53df887e0f8201e560dca03f4deeee145cb Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 00:41:54 -0400 Subject: [PATCH 094/151] Update overlay11.yml --- symbols/overlay11.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/symbols/overlay11.yml b/symbols/overlay11.yml index 04b65a7e..2954b720 100644 --- a/symbols/overlay11.yml +++ b/symbols/overlay11.yml @@ -1492,9 +1492,9 @@ overlay11: address: EU: 0x230BBA8 description: |- - Called primarily to fill dialogue boxes or display portraits, this function exists to print the next portrait, dialogue, or input for the Swap Shop. - Consistently writes the provided input to shared_switch_case, and occasionally writes to next_switch_case. - Is the parent function to SwapShopInventoryManager. + Called primarily handle the display and preparation of the swap shop inventory list, exclusive items list, and the item trade list. + Creates a swap_shop_inventory_data struct if one does not already exist. + Is the child function to SwapShopDialogueManager. r0: switch case index for the function: 0 = Swap List Inventory, 1 = Unknown, 2 = Species Exclusive Item List, 3 = Item Trade Away Selection List. r1: Depends on r0. If case 2: ID of the monster to retrieve an exclusive item list for. If case 3: Number of Exclusive Items the player owns. From 26008f5d5297c31871e614be1a157e54111d607e Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 00:43:16 -0400 Subject: [PATCH 095/151] Update overlay21.h --- headers/data/overlay21.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/data/overlay21.h b/headers/data/overlay21.h index 01131c35..b4d2f2cf 100644 --- a/headers/data/overlay21.h +++ b/headers/data/overlay21.h @@ -45,6 +45,6 @@ extern char SWAP_SHOP_DEBUG_STRING_25[36]; extern int16_t OVERLAY21_JP_STRING[3]; extern char SWAP_SHOP_GOLD_STRING[18]; extern undefined OVERLAY21_RESERVED_SPACE[8]; -extern swap_shop_menu_data* SWAP_SHOP_MENU_DATA_PTR; +extern struct swap_shop_menu_data* SWAP_SHOP_MENU_DATA_PTR; extern undefined* OVERLAY21_UNKNOWN_POINTER__NA_238CF44; #endif From f2cb48e7c34016d26cca0630cbeb007bbcdc31cc Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 00:43:49 -0400 Subject: [PATCH 096/151] Update ground_mode.h --- headers/types/ground_mode/ground_mode.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index ab594802..5b33f06c 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -704,7 +704,7 @@ struct swap_shop_menu_manager { struct move known_moves[4]; undefined field_0x93a; undefined field_0x93b; -} +}; ASSERT_SIZE(struct swap_shop_menu_data, 2364); struct swap_shop_inventory_ptrs { @@ -712,10 +712,10 @@ struct swap_shop_inventory_ptrs { undefined* temp_variable; // 0x4: A pointer to the swap_shop_inventory_data struct. struct swap_shop_inventory_data* inventory_data; -} +}; ASSERT_SIZE(struct exc_item_trade_slot, 8); -// + struct swap_shop_inventory_data { // 0x0: switch case id for SwapShopInventoryManager int32_t inventory_case_id; @@ -758,7 +758,7 @@ struct swap_shop_inventory_data { struct item_id_16 selected_item_id; undefined field_0x46d2; undefined field_0x46d3; -} +}; ASSERT_SIZE(struct swap_shop_inventory_data, 18132); struct exc_item_trade_slot { @@ -769,7 +769,7 @@ struct exc_item_trade_slot { // 0x4: If the player has enough exclusive items to swap for the item, this will be true. bool can_afford_item; undefined unk_0x5; -} +}; ASSERT_SIZE(struct exc_item_trade_slot, 6); #endif From cd1292626b576c8a6a810f53bb33016f10155180 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 00:46:05 -0400 Subject: [PATCH 097/151] Update ground_mode.h --- headers/types/ground_mode/ground_mode.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index 5b33f06c..58d17f91 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -659,9 +659,9 @@ struct swap_shop_menu_manager { // 0x1C: Whenever a simple menu is run, this field is where the result is stored. int32_t simple_menu_result; // 0x20: Zeroed in SwapShopEntryPoint, but never modified - struct undefined4 unk_int_1; + undefined4 unk_int_1; // 0x24: Zeroed in SwapShopEntryPoint, but never modified - struct undefined4 unk_int_2; + undefined4 unk_int_2; // 0x28: Emotion for croagunk's portrait. int32_t emotion_id; // 0x2C: The case menu for a smaller switch case at the top of SwapShopMainManager. From d69f745ef9bc33b61f6cb11bc3c66255f077eccc Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 00:48:41 -0400 Subject: [PATCH 098/151] Update ground_mode.h --- headers/types/ground_mode/ground_mode.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index 58d17f91..7fd3d3ef 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -747,7 +747,7 @@ struct swap_shop_inventory_data { // 0x462C struct window_extra_info window_extra_info_ptr; // 0x46C4: Whether or not the synth.bin file is open. - struct bool synth_bin_open; + bool synth_bin_open; undefined field_0x46c5; undefined field_0x46c6; undefined field_0x46c7; @@ -763,7 +763,7 @@ ASSERT_SIZE(struct swap_shop_inventory_data, 18132); struct exc_item_trade_slot { // 0x0: The trade type the item slot uses. - enum trade_type trade_type; + int16_t trade_type; // 0x2: This is likely either the item_id of the slot, or the index of the slot. It might vary depending on the trade_type. undefined2 unk_0x2; // 0x4: If the player has enough exclusive items to swap for the item, this will be true. From c2eef4c2d9bdb50f1b65ad4c13008c483dc86ad5 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 00:50:28 -0400 Subject: [PATCH 099/151] Update ground_mode.h --- headers/types/ground_mode/ground_mode.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index 7fd3d3ef..aaf0a76e 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -731,11 +731,11 @@ struct swap_shop_inventory_data { // 0x14E6: Seems to be a struct for each item in the shop. struct exc_item_trade_slot exc_item_trade_slots[1068]; // 0x2DEE: For each item in the swap list, is the number of that item available? - struct int16_t item_quantities[1068]; + int16_t item_quantities[1068]; // 0x3646: List of every exclusive item the player owns. struct item_id_16 owned_exclusive_items[1000]; // 0x3E16: List of how much of each owned_exclusive_item the player owns. - struct int16_t owned_item_quantities[1000]; + int16_t owned_item_quantities[1000]; // 0x45E6: The synth_templates matching today's rolled swap shop items. struct synth_template shop_synth_templates[8]; // 0x4626: Total number of items for sale in the swap shop. From 6d14f6d9907f1ee3b92d9ce0066dd54b6a5ee0db Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 00:52:31 -0400 Subject: [PATCH 100/151] Update ground_mode.h --- headers/types/ground_mode/ground_mode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index aaf0a76e..01dd128a 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -765,7 +765,7 @@ struct exc_item_trade_slot { // 0x0: The trade type the item slot uses. int16_t trade_type; // 0x2: This is likely either the item_id of the slot, or the index of the slot. It might vary depending on the trade_type. - undefined2 unk_0x2; + int16_t unk_0x2; // 0x4: If the player has enough exclusive items to swap for the item, this will be true. bool can_afford_item; undefined unk_0x5; From cd34182a0849069318edc33a484895779f0723a5 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 00:56:24 -0400 Subject: [PATCH 101/151] Update ground_mode.h From 9241e311e2ec30e71ae8fb0c08e6fd40b0b38013 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 00:58:37 -0400 Subject: [PATCH 102/151] Update overlay11.yml --- symbols/overlay11.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/symbols/overlay11.yml b/symbols/overlay11.yml index 2954b720..83bb30a9 100644 --- a/symbols/overlay11.yml +++ b/symbols/overlay11.yml @@ -1827,9 +1827,7 @@ overlay11: EU: 0x23258E4 length: EU: 0x8 - description: |- - Host pointers to multiple structures used for performing internal Swap Shop checks. - + description: "Host pointers to multiple structures used for performing internal Swap Shop checks." - name: WORLD_MAP_MODE address: EU: 0x2325924 From b176f9ce1e476e1a9d371115a4317e2e9bc3081b Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 01:02:08 -0400 Subject: [PATCH 103/151] Update ground_mode.h --- headers/types/ground_mode/ground_mode.h | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index 01dd128a..6b4dabdc 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -715,6 +715,16 @@ struct swap_shop_inventory_ptrs { }; ASSERT_SIZE(struct exc_item_trade_slot, 8); +struct exc_item_trade_slot { + // 0x0: The trade type the item slot uses. + int16_t trade_type; + // 0x2: This is likely either the item_id of the slot, or the index of the slot. It might vary depending on the trade_type. + int16_t unk_0x2; + // 0x4: If the player has enough exclusive items to swap for the item, this will be true. + bool can_afford_item; + undefined unk_0x5; +}; +ASSERT_SIZE(struct exc_item_trade_slot, 6); struct swap_shop_inventory_data { // 0x0: switch case id for SwapShopInventoryManager @@ -761,15 +771,4 @@ struct swap_shop_inventory_data { }; ASSERT_SIZE(struct swap_shop_inventory_data, 18132); -struct exc_item_trade_slot { - // 0x0: The trade type the item slot uses. - int16_t trade_type; - // 0x2: This is likely either the item_id of the slot, or the index of the slot. It might vary depending on the trade_type. - int16_t unk_0x2; - // 0x4: If the player has enough exclusive items to swap for the item, this will be true. - bool can_afford_item; - undefined unk_0x5; -}; -ASSERT_SIZE(struct exc_item_trade_slot, 6); - #endif From f8fca2df069920572f4dba972065e63041785ced Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 01:07:50 -0400 Subject: [PATCH 104/151] Update ground_mode.h --- headers/types/ground_mode/ground_mode.h | 135 ------------------------ 1 file changed, 135 deletions(-) diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index 6b4dabdc..9f48f6f7 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -636,139 +636,4 @@ struct ground_entity_function_table { }; ASSERT_SIZE(struct ground_entity_function_table, 80); -struct swap_shop_menu_manager { - // 0x0: The switch case index shared by SwapShopMainManager and SwapShopDialogueManager. - int32_t shared_switch_case; - // 0x4: The "next" switch case index to be shared, typically assigned by SwapShopMainManager. - int32_t next_switch_case; - // 0x8: Used exclusively by SwapShopMainManager. More research needed. - int32_t unk_windows_counter; - // 0xC: If true, croagunk will not ask the player if they want to continue swapping. - bool croagunk_out_of_swaps; - undefined field_0xd; - // 0xE: The item the player will receive by swapping. - struct bulk_item received_item; - undefined field_0x12; - undefined field_0x13; - undefined field_0x14; - undefined field_0x15; - undefined field_0x16; - undefined field_0x17; - // 0x18: While selecting which items to give croagunk, this field is filled when selecting "info" on an item in the list. - struct bulk_item described_item; - // 0x1C: Whenever a simple menu is run, this field is where the result is stored. - int32_t simple_menu_result; - // 0x20: Zeroed in SwapShopEntryPoint, but never modified - undefined4 unk_int_1; - // 0x24: Zeroed in SwapShopEntryPoint, but never modified - undefined4 unk_int_2; - // 0x28: Emotion for croagunk's portrait. - int32_t emotion_id; - // 0x2C: The case menu for a smaller switch case at the top of SwapShopMainManager. - int32_t window_manager_case; - // 0x30: Stores preprocessor_args for the next window. - struct preprocessor_args preprocessor_args; - // 0x80: The window_id of the current dialogue box window. -2 if none are present. - int8_t dialogue_window_id; - // 0x81: The window_id of the current portrait window. -2 if none are present. - int8_t portrait_window_id; - // 0x82: The window_id of the current advanced textbox window. -2 if none are present. - int8_t advanced_textbox_window_id; - // 0x83: The window_id of the current simple menu window. -2 if none are present. - int8_t simple_menu_window_id; - // 0x84: The window_id of the current text box window. -2 if none are present. - int8_t text_window_id; - // 0x85: The window_id of the current scroll box window. -2 if none are present. - int8_t scroll_box_window_id; - // 0x86: A small buffer for preprocessed text strings. - char text_string[66]; - // 0xC8: Stores portrait_params for croagunk's next portrait. - struct portrait_params portrait_params; - // 0xD8: Stores the number of items required to trade for the current trade. - int16_t exc_item_trade_count; - // 0xDA: The number of exclusive items currently in the bag. - int16_t exc_bag_item_count; - // 0xDC: The individual item IDs of the exclusive items present in the bag. - struct item_id_16 exc_bag_item_ids[50]; - // 0x140: The number of exclusive items currently in storage. - int16_t exc_storage_item_count; - // 0x142: The individual item IDs of the exclusive items in storage. - struct item_id_16 exc_storage_item_ids[1000]; - undefined field_0x912; - undefined field_0x913; - // 0x914: The team member slot whose exclusive items are about to be viewed. - int32_t selected_team_member_slot; - // 0x918: The move slot to create an info menu for. - int16_t selected_move_slot; - // 0x91A: The four moves known by selected_team_member_slot. - struct move known_moves[4]; - undefined field_0x93a; - undefined field_0x93b; -}; -ASSERT_SIZE(struct swap_shop_menu_data, 2364); - -struct swap_shop_inventory_ptrs { - // 0x0: Seems to be a pointer to some kind of temporary variable? - undefined* temp_variable; - // 0x4: A pointer to the swap_shop_inventory_data struct. - struct swap_shop_inventory_data* inventory_data; -}; -ASSERT_SIZE(struct exc_item_trade_slot, 8); - -struct exc_item_trade_slot { - // 0x0: The trade type the item slot uses. - int16_t trade_type; - // 0x2: This is likely either the item_id of the slot, or the index of the slot. It might vary depending on the trade_type. - int16_t unk_0x2; - // 0x4: If the player has enough exclusive items to swap for the item, this will be true. - bool can_afford_item; - undefined unk_0x5; -}; -ASSERT_SIZE(struct exc_item_trade_slot, 6); - -struct swap_shop_inventory_data { - // 0x0: switch case id for SwapShopInventoryManager - int32_t inventory_case_id; - // 0x4: A copy of num_valid_shop_items to be used by CreateCollectionMenu? - int32_t num_valid_shop_items_temp; - // 0x8: Seemingly unused, these are zeroed for some reason? - int32_t mystery_ints[1068]; - // 0x10B8: If the item is purchasable, this field will be 0x2. Otherwise, it will be 0x0. - int8_t is_item_purchasable[1068]; - // 0x14E4: Seems to be a window_id for a collection menu. - int8_t collection_menu_window_id; - undefined field_0x14e5; - // 0x14E6: Seems to be a struct for each item in the shop. - struct exc_item_trade_slot exc_item_trade_slots[1068]; - // 0x2DEE: For each item in the swap list, is the number of that item available? - int16_t item_quantities[1068]; - // 0x3646: List of every exclusive item the player owns. - struct item_id_16 owned_exclusive_items[1000]; - // 0x3E16: List of how much of each owned_exclusive_item the player owns. - int16_t owned_item_quantities[1000]; - // 0x45E6: The synth_templates matching today's rolled swap shop items. - struct synth_template shop_synth_templates[8]; - // 0x4626: Total number of items for sale in the swap shop. - int16_t num_valid_shop_items; - // 0x4628: Number of items required to be traded to croagunk for the selected item. - int16_t num_required_trade_items; - undefined field_0x462a; - undefined field_0x462b; - // 0x462C - struct window_extra_info window_extra_info_ptr; - // 0x46C4: Whether or not the synth.bin file is open. - bool synth_bin_open; - undefined field_0x46c5; - undefined field_0x46c6; - undefined field_0x46c7; - // 0x46C8 - int32_t textbox_window_id; - struct text_box * textbox_ptr; - // 0x46D0: The item ID the player selects when choosing items to give croagunk. Used to check the item info. - struct item_id_16 selected_item_id; - undefined field_0x46d2; - undefined field_0x46d3; -}; -ASSERT_SIZE(struct swap_shop_inventory_data, 18132); - #endif From e5571a36c8f64960dcf60b98e4f098d4240bc20c Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 01:08:04 -0400 Subject: [PATCH 105/151] Update common.h --- headers/types/common/common.h | 135 ++++++++++++++++++++++++++++++++++ 1 file changed, 135 insertions(+) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index a4c86063..bfd1f56c 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -1362,4 +1362,139 @@ struct monster_file_contents { }; ASSERT_SIZE(struct monster_file_contents, 78548); +struct swap_shop_menu_manager { + // 0x0: The switch case index shared by SwapShopMainManager and SwapShopDialogueManager. + int32_t shared_switch_case; + // 0x4: The "next" switch case index to be shared, typically assigned by SwapShopMainManager. + int32_t next_switch_case; + // 0x8: Used exclusively by SwapShopMainManager. More research needed. + int32_t unk_windows_counter; + // 0xC: If true, croagunk will not ask the player if they want to continue swapping. + bool croagunk_out_of_swaps; + undefined field_0xd; + // 0xE: The item the player will receive by swapping. + struct bulk_item received_item; + undefined field_0x12; + undefined field_0x13; + undefined field_0x14; + undefined field_0x15; + undefined field_0x16; + undefined field_0x17; + // 0x18: While selecting which items to give croagunk, this field is filled when selecting "info" on an item in the list. + struct bulk_item described_item; + // 0x1C: Whenever a simple menu is run, this field is where the result is stored. + int32_t simple_menu_result; + // 0x20: Zeroed in SwapShopEntryPoint, but never modified + undefined4 unk_int_1; + // 0x24: Zeroed in SwapShopEntryPoint, but never modified + undefined4 unk_int_2; + // 0x28: Emotion for croagunk's portrait. + int32_t emotion_id; + // 0x2C: The case menu for a smaller switch case at the top of SwapShopMainManager. + int32_t window_manager_case; + // 0x30: Stores preprocessor_args for the next window. + struct preprocessor_args preprocessor_args; + // 0x80: The window_id of the current dialogue box window. -2 if none are present. + int8_t dialogue_window_id; + // 0x81: The window_id of the current portrait window. -2 if none are present. + int8_t portrait_window_id; + // 0x82: The window_id of the current advanced textbox window. -2 if none are present. + int8_t advanced_textbox_window_id; + // 0x83: The window_id of the current simple menu window. -2 if none are present. + int8_t simple_menu_window_id; + // 0x84: The window_id of the current text box window. -2 if none are present. + int8_t text_window_id; + // 0x85: The window_id of the current scroll box window. -2 if none are present. + int8_t scroll_box_window_id; + // 0x86: A small buffer for preprocessed text strings. + char text_string[66]; + // 0xC8: Stores portrait_params for croagunk's next portrait. + struct portrait_params portrait_params; + // 0xD8: Stores the number of items required to trade for the current trade. + int16_t exc_item_trade_count; + // 0xDA: The number of exclusive items currently in the bag. + int16_t exc_bag_item_count; + // 0xDC: The individual item IDs of the exclusive items present in the bag. + struct item_id_16 exc_bag_item_ids[50]; + // 0x140: The number of exclusive items currently in storage. + int16_t exc_storage_item_count; + // 0x142: The individual item IDs of the exclusive items in storage. + struct item_id_16 exc_storage_item_ids[1000]; + undefined field_0x912; + undefined field_0x913; + // 0x914: The team member slot whose exclusive items are about to be viewed. + int32_t selected_team_member_slot; + // 0x918: The move slot to create an info menu for. + int16_t selected_move_slot; + // 0x91A: The four moves known by selected_team_member_slot. + struct move known_moves[4]; + undefined field_0x93a; + undefined field_0x93b; +}; +ASSERT_SIZE(struct swap_shop_menu_data, 2364); + +struct swap_shop_inventory_ptrs { + // 0x0: Seems to be a pointer to some kind of temporary variable? + undefined* temp_variable; + // 0x4: A pointer to the swap_shop_inventory_data struct. + struct swap_shop_inventory_data* inventory_data; +}; +ASSERT_SIZE(struct exc_item_trade_slot, 8); + +struct exc_item_trade_slot { + // 0x0: The trade type the item slot uses. + int16_t trade_type; + // 0x2: This is likely either the item_id of the slot, or the index of the slot. It might vary depending on the trade_type. + int16_t unk_0x2; + // 0x4: If the player has enough exclusive items to swap for the item, this will be true. + bool can_afford_item; + undefined unk_0x5; +}; +ASSERT_SIZE(struct exc_item_trade_slot, 6); + +struct swap_shop_inventory_data { + // 0x0: switch case id for SwapShopInventoryManager + int32_t inventory_case_id; + // 0x4: A copy of num_valid_shop_items to be used by CreateCollectionMenu? + int32_t num_valid_shop_items_temp; + // 0x8: Seemingly unused, these are zeroed for some reason? + int32_t mystery_ints[1068]; + // 0x10B8: If the item is purchasable, this field will be 0x2. Otherwise, it will be 0x0. + int8_t is_item_purchasable[1068]; + // 0x14E4: Seems to be a window_id for a collection menu. + int8_t collection_menu_window_id; + undefined field_0x14e5; + // 0x14E6: Seems to be a struct for each item in the shop. + struct exc_item_trade_slot exc_item_trade_slots[1068]; + // 0x2DEE: For each item in the swap list, is the number of that item available? + int16_t item_quantities[1068]; + // 0x3646: List of every exclusive item the player owns. + struct item_id_16 owned_exclusive_items[1000]; + // 0x3E16: List of how much of each owned_exclusive_item the player owns. + int16_t owned_item_quantities[1000]; + // 0x45E6: The synth_templates matching today's rolled swap shop items. + struct synth_template shop_synth_templates[8]; + // 0x4626: Total number of items for sale in the swap shop. + int16_t num_valid_shop_items; + // 0x4628: Number of items required to be traded to croagunk for the selected item. + int16_t num_required_trade_items; + undefined field_0x462a; + undefined field_0x462b; + // 0x462C + struct window_extra_info window_extra_info_ptr; + // 0x46C4: Whether or not the synth.bin file is open. + bool synth_bin_open; + undefined field_0x46c5; + undefined field_0x46c6; + undefined field_0x46c7; + // 0x46C8 + int32_t textbox_window_id; + struct text_box * textbox_ptr; + // 0x46D0: The item ID the player selects when choosing items to give croagunk. Used to check the item info. + struct item_id_16 selected_item_id; + undefined field_0x46d2; + undefined field_0x46d3; +}; +ASSERT_SIZE(struct swap_shop_inventory_data, 18132); + #endif From 292ce4d9858f274d31ccaf2e916a5bf22a926da9 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 01:27:49 -0400 Subject: [PATCH 106/151] Update common.h --- headers/types/common/common.h | 136 ---------------------------------- 1 file changed, 136 deletions(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index bfd1f56c..89c67ae4 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -1361,140 +1361,4 @@ struct monster_file_contents { struct monster_data_table table; // 0x8: The main contents of the data table. }; ASSERT_SIZE(struct monster_file_contents, 78548); - -struct swap_shop_menu_manager { - // 0x0: The switch case index shared by SwapShopMainManager and SwapShopDialogueManager. - int32_t shared_switch_case; - // 0x4: The "next" switch case index to be shared, typically assigned by SwapShopMainManager. - int32_t next_switch_case; - // 0x8: Used exclusively by SwapShopMainManager. More research needed. - int32_t unk_windows_counter; - // 0xC: If true, croagunk will not ask the player if they want to continue swapping. - bool croagunk_out_of_swaps; - undefined field_0xd; - // 0xE: The item the player will receive by swapping. - struct bulk_item received_item; - undefined field_0x12; - undefined field_0x13; - undefined field_0x14; - undefined field_0x15; - undefined field_0x16; - undefined field_0x17; - // 0x18: While selecting which items to give croagunk, this field is filled when selecting "info" on an item in the list. - struct bulk_item described_item; - // 0x1C: Whenever a simple menu is run, this field is where the result is stored. - int32_t simple_menu_result; - // 0x20: Zeroed in SwapShopEntryPoint, but never modified - undefined4 unk_int_1; - // 0x24: Zeroed in SwapShopEntryPoint, but never modified - undefined4 unk_int_2; - // 0x28: Emotion for croagunk's portrait. - int32_t emotion_id; - // 0x2C: The case menu for a smaller switch case at the top of SwapShopMainManager. - int32_t window_manager_case; - // 0x30: Stores preprocessor_args for the next window. - struct preprocessor_args preprocessor_args; - // 0x80: The window_id of the current dialogue box window. -2 if none are present. - int8_t dialogue_window_id; - // 0x81: The window_id of the current portrait window. -2 if none are present. - int8_t portrait_window_id; - // 0x82: The window_id of the current advanced textbox window. -2 if none are present. - int8_t advanced_textbox_window_id; - // 0x83: The window_id of the current simple menu window. -2 if none are present. - int8_t simple_menu_window_id; - // 0x84: The window_id of the current text box window. -2 if none are present. - int8_t text_window_id; - // 0x85: The window_id of the current scroll box window. -2 if none are present. - int8_t scroll_box_window_id; - // 0x86: A small buffer for preprocessed text strings. - char text_string[66]; - // 0xC8: Stores portrait_params for croagunk's next portrait. - struct portrait_params portrait_params; - // 0xD8: Stores the number of items required to trade for the current trade. - int16_t exc_item_trade_count; - // 0xDA: The number of exclusive items currently in the bag. - int16_t exc_bag_item_count; - // 0xDC: The individual item IDs of the exclusive items present in the bag. - struct item_id_16 exc_bag_item_ids[50]; - // 0x140: The number of exclusive items currently in storage. - int16_t exc_storage_item_count; - // 0x142: The individual item IDs of the exclusive items in storage. - struct item_id_16 exc_storage_item_ids[1000]; - undefined field_0x912; - undefined field_0x913; - // 0x914: The team member slot whose exclusive items are about to be viewed. - int32_t selected_team_member_slot; - // 0x918: The move slot to create an info menu for. - int16_t selected_move_slot; - // 0x91A: The four moves known by selected_team_member_slot. - struct move known_moves[4]; - undefined field_0x93a; - undefined field_0x93b; -}; -ASSERT_SIZE(struct swap_shop_menu_data, 2364); - -struct swap_shop_inventory_ptrs { - // 0x0: Seems to be a pointer to some kind of temporary variable? - undefined* temp_variable; - // 0x4: A pointer to the swap_shop_inventory_data struct. - struct swap_shop_inventory_data* inventory_data; -}; -ASSERT_SIZE(struct exc_item_trade_slot, 8); - -struct exc_item_trade_slot { - // 0x0: The trade type the item slot uses. - int16_t trade_type; - // 0x2: This is likely either the item_id of the slot, or the index of the slot. It might vary depending on the trade_type. - int16_t unk_0x2; - // 0x4: If the player has enough exclusive items to swap for the item, this will be true. - bool can_afford_item; - undefined unk_0x5; -}; -ASSERT_SIZE(struct exc_item_trade_slot, 6); - -struct swap_shop_inventory_data { - // 0x0: switch case id for SwapShopInventoryManager - int32_t inventory_case_id; - // 0x4: A copy of num_valid_shop_items to be used by CreateCollectionMenu? - int32_t num_valid_shop_items_temp; - // 0x8: Seemingly unused, these are zeroed for some reason? - int32_t mystery_ints[1068]; - // 0x10B8: If the item is purchasable, this field will be 0x2. Otherwise, it will be 0x0. - int8_t is_item_purchasable[1068]; - // 0x14E4: Seems to be a window_id for a collection menu. - int8_t collection_menu_window_id; - undefined field_0x14e5; - // 0x14E6: Seems to be a struct for each item in the shop. - struct exc_item_trade_slot exc_item_trade_slots[1068]; - // 0x2DEE: For each item in the swap list, is the number of that item available? - int16_t item_quantities[1068]; - // 0x3646: List of every exclusive item the player owns. - struct item_id_16 owned_exclusive_items[1000]; - // 0x3E16: List of how much of each owned_exclusive_item the player owns. - int16_t owned_item_quantities[1000]; - // 0x45E6: The synth_templates matching today's rolled swap shop items. - struct synth_template shop_synth_templates[8]; - // 0x4626: Total number of items for sale in the swap shop. - int16_t num_valid_shop_items; - // 0x4628: Number of items required to be traded to croagunk for the selected item. - int16_t num_required_trade_items; - undefined field_0x462a; - undefined field_0x462b; - // 0x462C - struct window_extra_info window_extra_info_ptr; - // 0x46C4: Whether or not the synth.bin file is open. - bool synth_bin_open; - undefined field_0x46c5; - undefined field_0x46c6; - undefined field_0x46c7; - // 0x46C8 - int32_t textbox_window_id; - struct text_box * textbox_ptr; - // 0x46D0: The item ID the player selects when choosing items to give croagunk. Used to check the item info. - struct item_id_16 selected_item_id; - undefined field_0x46d2; - undefined field_0x46d3; -}; -ASSERT_SIZE(struct swap_shop_inventory_data, 18132); - #endif From a84eee631c4fecde40c76b59c5798932509c6e60 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 01:28:08 -0400 Subject: [PATCH 107/151] Update ground_mode.h --- headers/types/ground_mode/ground_mode.h | 135 ++++++++++++++++++++++++ 1 file changed, 135 insertions(+) diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index 9f48f6f7..3494430a 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -636,4 +636,139 @@ struct ground_entity_function_table { }; ASSERT_SIZE(struct ground_entity_function_table, 80); +struct swap_shop_menu_data { + // 0x0: The switch case index shared by SwapShopMainManager and SwapShopDialogueManager. + int32_t shared_switch_case; + // 0x4: The "next" switch case index to be shared, typically assigned by SwapShopMainManager. + int32_t next_switch_case; + // 0x8: Used exclusively by SwapShopMainManager. More research needed. + int32_t unk_windows_counter; + // 0xC: If true, croagunk will not ask the player if they want to continue swapping. + bool croagunk_out_of_swaps; + undefined field_0xd; + // 0xE: The item the player will receive by swapping. + struct bulk_item received_item; + undefined field_0x12; + undefined field_0x13; + undefined field_0x14; + undefined field_0x15; + undefined field_0x16; + undefined field_0x17; + // 0x18: While selecting which items to give croagunk, this field is filled when selecting "info" on an item in the list. + struct bulk_item described_item; + // 0x1C: Whenever a simple menu is run, this field is where the result is stored. + int32_t simple_menu_result; + // 0x20: Zeroed in SwapShopEntryPoint, but never modified + undefined4 unk_int_1; + // 0x24: Zeroed in SwapShopEntryPoint, but never modified + undefined4 unk_int_2; + // 0x28: Emotion for croagunk's portrait. + int32_t emotion_id; + // 0x2C: The case menu for a smaller switch case at the top of SwapShopMainManager. + int32_t window_manager_case; + // 0x30: Stores preprocessor_args for the next window. + struct preprocessor_args preprocessor_args; + // 0x80: The window_id of the current dialogue box window. -2 if none are present. + int8_t dialogue_window_id; + // 0x81: The window_id of the current portrait window. -2 if none are present. + int8_t portrait_window_id; + // 0x82: The window_id of the current advanced textbox window. -2 if none are present. + int8_t advanced_textbox_window_id; + // 0x83: The window_id of the current simple menu window. -2 if none are present. + int8_t simple_menu_window_id; + // 0x84: The window_id of the current text box window. -2 if none are present. + int8_t text_window_id; + // 0x85: The window_id of the current scroll box window. -2 if none are present. + int8_t scroll_box_window_id; + // 0x86: A small buffer for preprocessed text strings. + char text_string[66]; + // 0xC8: Stores portrait_params for croagunk's next portrait. + struct portrait_params portrait_params; + // 0xD8: Stores the number of items required to trade for the current trade. + int16_t exc_item_trade_count; + // 0xDA: The number of exclusive items currently in the bag. + int16_t exc_bag_item_count; + // 0xDC: The individual item IDs of the exclusive items present in the bag. + struct item_id_16 exc_bag_item_ids[50]; + // 0x140: The number of exclusive items currently in storage. + int16_t exc_storage_item_count; + // 0x142: The individual item IDs of the exclusive items in storage. + struct item_id_16 exc_storage_item_ids[1000]; + undefined field_0x912; + undefined field_0x913; + // 0x914: The team member slot whose exclusive items are about to be viewed. + int32_t selected_team_member_slot; + // 0x918: The move slot to create an info menu for. + int16_t selected_move_slot; + // 0x91A: The four moves known by selected_team_member_slot. + struct move known_moves[4]; + undefined field_0x93a; + undefined field_0x93b; +}; +ASSERT_SIZE(struct swap_shop_menu_data, 2364); + +struct swap_shop_inventory_ptrs { + // 0x0: Seems to be a pointer to some kind of temporary variable? + undefined* temp_variable; + // 0x4: A pointer to the swap_shop_inventory_data struct. + struct swap_shop_inventory_data* inventory_data; +}; +ASSERT_SIZE(struct swap_shop_inventory_ptrs, 8); + +struct exc_item_trade_slot { + // 0x0: The trade type the item slot uses. + int16_t trade_type; + // 0x2: This is likely either the item_id of the slot, or the index of the slot. It might vary depending on the trade_type. + int16_t unk_0x2; + // 0x4: If the player has enough exclusive items to swap for the item, this will be true. + bool can_afford_item; + undefined unk_0x5; +}; +ASSERT_SIZE(struct exc_item_trade_slot, 6); + +struct swap_shop_inventory_data { + // 0x0: switch case id for SwapShopInventoryManager + int32_t inventory_case_id; + // 0x4: A copy of num_valid_shop_items to be used by CreateCollectionMenu? + int32_t num_valid_shop_items_temp; + // 0x8: Seemingly unused, these are zeroed for some reason? + int32_t mystery_ints[1068]; + // 0x10B8: If the item is purchasable, this field will be 0x2. Otherwise, it will be 0x0. + int8_t is_item_purchasable[1068]; + // 0x14E4: Seems to be a window_id for a collection menu. + int8_t collection_menu_window_id; + undefined field_0x14e5; + // 0x14E6: Seems to be a struct for each item in the shop. + struct exc_item_trade_slot exc_item_trade_slots[1068]; + // 0x2DEE: For each item in the swap list, is the number of that item available? + int16_t item_quantities[1068]; + // 0x3646: List of every exclusive item the player owns. + struct item_id_16 owned_exclusive_items[1000]; + // 0x3E16: List of how much of each owned_exclusive_item the player owns. + int16_t owned_item_quantities[1000]; + // 0x45E6: The synth_templates matching today's rolled swap shop items. + struct synth_template shop_synth_templates[8]; + // 0x4626: Total number of items for sale in the swap shop. + int16_t num_valid_shop_items; + // 0x4628: Number of items required to be traded to croagunk for the selected item. + int16_t num_required_trade_items; + undefined field_0x462a; + undefined field_0x462b; + // 0x462C + struct window_extra_info window_extra_info_ptr; + // 0x46C4: Whether or not the synth.bin file is open. + bool synth_bin_open; + undefined field_0x46c5; + undefined field_0x46c6; + undefined field_0x46c7; + // 0x46C8 + int32_t textbox_window_id; + struct text_box * textbox_ptr; + // 0x46D0: The item ID the player selects when choosing items to give croagunk. Used to check the item info. + struct item_id_16 selected_item_id; + undefined field_0x46d2; + undefined field_0x46d3; +}; +ASSERT_SIZE(struct swap_shop_inventory_data, 18132); + #endif From 7696f6d90b4ee41031925e7beaefae453b638ecd Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 01:29:32 -0400 Subject: [PATCH 108/151] Update overlay11.yml --- symbols/overlay11.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay11.yml b/symbols/overlay11.yml index 83bb30a9..cb1f4934 100644 --- a/symbols/overlay11.yml +++ b/symbols/overlay11.yml @@ -1827,7 +1827,7 @@ overlay11: EU: 0x23258E4 length: EU: 0x8 - description: "Host pointers to multiple structures used for performing internal Swap Shop checks." + description: Host pointers to multiple structures used for performing internal Swap Shop checks. - name: WORLD_MAP_MODE address: EU: 0x2325924 From 6c1a1e6927a6d37a53048ee010374f99f3bf88b6 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 01:33:53 -0400 Subject: [PATCH 109/151] Update overlay21.yml --- symbols/overlay21.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/symbols/overlay21.yml b/symbols/overlay21.yml index 02bc5324..6ca8c6ef 100644 --- a/symbols/overlay21.yml +++ b/symbols/overlay21.yml @@ -61,6 +61,7 @@ overlay21: address: EU: 0x238D4E4 description: A text box callback function containing the player's current gold, seen on the Swap Shop main menu. + r0: window_id of the textbox data: - name: SWAP_SHOP_WINDOW_PARAMS_1 From b11c72e291650d5d8c6bb48872d4984b71fa3bd3 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 01:36:21 -0400 Subject: [PATCH 110/151] Update overlay21.yml --- symbols/overlay21.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/symbols/overlay21.yml b/symbols/overlay21.yml index 6ca8c6ef..96890693 100644 --- a/symbols/overlay21.yml +++ b/symbols/overlay21.yml @@ -60,7 +60,8 @@ overlay21: - name: SwapShopPrintCurrentGold address: EU: 0x238D4E4 - description: A text box callback function containing the player's current gold, seen on the Swap Shop main menu. + description: |- + A text box callback function containing the player's current gold, seen on the Swap Shop main menu. r0: window_id of the textbox data: From d2ab5d98fbfcb33193f103867063b756ca3b67e4 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 01:37:52 -0400 Subject: [PATCH 111/151] Update overlay21.yml --- symbols/overlay21.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay21.yml b/symbols/overlay21.yml index 96890693..17f9a2cf 100644 --- a/symbols/overlay21.yml +++ b/symbols/overlay21.yml @@ -388,7 +388,7 @@ overlay21: JP: 0x238E48C length: NA: 0x8 - description: 合成:("synthesis: " in Japanese) + description: 合成:(synthesis in Japanese) - name: SWAP_SHOP_GOLD_STRING address: EU: 0x238DA64 From bc31dfa6b569a458190852447c19af002fc69970 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 01:40:21 -0400 Subject: [PATCH 112/151] Update overlay21.yml --- symbols/overlay21.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay21.yml b/symbols/overlay21.yml index 17f9a2cf..ef953adf 100644 --- a/symbols/overlay21.yml +++ b/symbols/overlay21.yml @@ -394,7 +394,7 @@ overlay21: EU: 0x238DA64 length: EU: 0x13 - description: [CS:V][gold:0][CR] + description: [CS:V][gold:0][CR] - name: OVERLAY21_RESERVED_SPACE address: NA: 0x238CF38 From 7c69f6a9a96ed9ad608baf5859db33669fef5812 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 01:42:09 -0400 Subject: [PATCH 113/151] Update overlay21.yml --- symbols/overlay21.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay21.yml b/symbols/overlay21.yml index ef953adf..bacd240a 100644 --- a/symbols/overlay21.yml +++ b/symbols/overlay21.yml @@ -394,7 +394,7 @@ overlay21: EU: 0x238DA64 length: EU: 0x13 - description: [CS:V][gold:0][CR] + description: The amount of gold specified, in the proper color. - name: OVERLAY21_RESERVED_SPACE address: NA: 0x238CF38 From a384749fb71f306b9f454c05ffa460a52c177ebf Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 01:43:25 -0400 Subject: [PATCH 114/151] Update overlay21.yml --- symbols/overlay21.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/symbols/overlay21.yml b/symbols/overlay21.yml index bacd240a..5dc1bbed 100644 --- a/symbols/overlay21.yml +++ b/symbols/overlay21.yml @@ -331,7 +331,7 @@ overlay21: EU: 0x238D940 length: EU: 0x9 - description: [item:0] + description: "[item:0]" - name: SWAP_SHOP_DEBUG_STRING_19 address: @@ -394,7 +394,7 @@ overlay21: EU: 0x238DA64 length: EU: 0x13 - description: The amount of gold specified, in the proper color. + description: "[CS:V][gold:0][CR]" - name: OVERLAY21_RESERVED_SPACE address: NA: 0x238CF38 @@ -414,4 +414,4 @@ overlay21: NA: 0x238CF44 length: NA: 0x4 - description: "Note: unverified, ported from Irdkwia's notes". Unable to locate, may be unused. + description: "Note: unverified, ported from Irdkwia's notes." From d396b9daca2450bc4b0c66d929aaa5b9b149871a Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 01:48:18 -0400 Subject: [PATCH 115/151] Update overlay21.yml --- symbols/overlay21.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay21.yml b/symbols/overlay21.yml index 5dc1bbed..3d5c8462 100644 --- a/symbols/overlay21.yml +++ b/symbols/overlay21.yml @@ -158,7 +158,7 @@ overlay21: - name: SWAP_SHOP_WINDOW_PARAMS_4 address: NA: 0x238CB58 - EU: + EU: 0x238D698 length: NA: 0x10 description: Seem to be completely unused by the Swap Shop. From 5b636c1803d41dabfd9dab1ef359dc0dd56482be Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 01:51:04 -0400 Subject: [PATCH 116/151] Update overlay21.yml --- symbols/overlay21.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay21.yml b/symbols/overlay21.yml index 3d5c8462..dc50bcdc 100644 --- a/symbols/overlay21.yml +++ b/symbols/overlay21.yml @@ -24,7 +24,7 @@ overlay21: r0: New current_switch_case value. - name: GetFirstExclusivePrerequisite address: - EU: 0x238C468 + EU: 0x0238C320 description: |- Retrieves the item ID of the first item needed to trade for the specified item. There are hardcoded exceptions for the Eeveelution/Hitmontrio items, but outside of that, the output will be as follows. From f77a1e79836b178a414f61b0adb73e4a07a30818 Mon Sep 17 00:00:00 2001 From: Parker Zhiss <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 02:03:57 -0400 Subject: [PATCH 117/151] Revert "Merge branch 'master' of https://github.com/HappyLappy1/pmdsky-debug" This reverts commit 0e70daceabfac01ade72a8912eb0ed51de27962e, reversing changes made to 8353b7bb6fe39566825d4c1c8eb8bd2c7297ad96. --- headers/data/arm9.h | 1 - headers/data/overlay21.h | 32 +-- headers/functions/overlay21.h | 11 - headers/functions/overlay29.h | 1 - headers/types/ground_mode/ground_mode.h | 135 ------------ symbols/arm9.yml | 75 ++----- symbols/overlay11.yml | 17 -- symbols/overlay21.yml | 271 ++---------------------- symbols/overlay29.yml | 11 - 9 files changed, 33 insertions(+), 521 deletions(-) delete mode 100644 headers/functions/overlay21.h diff --git a/headers/data/arm9.h b/headers/data/arm9.h index 51f7ea30..4676a837 100644 --- a/headers/data/arm9.h +++ b/headers/data/arm9.h @@ -34,7 +34,6 @@ extern char STRING_DUNGEON_DUNGEON_BIN[20]; extern char STRING_MONSTER_M_ATTACK_BIN[24]; extern char STRING_MONSTER_M_GROUND_BIN[24]; extern char STRING_FILE_DIRECTORY_INIT[40]; -extern struct baby_exclusive_item_pair BABY_EXCLUSIVE_ITEM_PAIRS[16]; extern enum item_id KECLEON_SHOP_ITEM_TABLE_LISTS_1[4]; extern enum item_id KECLEON_SHOP_ITEM_TABLE_LISTS_2[4]; extern struct exclusive_item_stat_boost_entry EXCLUSIVE_ITEM_STAT_BOOST_DATA[15]; diff --git a/headers/data/overlay21.h b/headers/data/overlay21.h index b4d2f2cf..033e3afa 100644 --- a/headers/data/overlay21.h +++ b/headers/data/overlay21.h @@ -8,7 +8,6 @@ extern struct simple_menu_id_item SWAP_SHOP_SUBMENU_ITEMS_2[4]; extern struct simple_menu_id_item SWAP_SHOP_MAIN_MENU_ITEMS_1[4]; extern struct simple_menu_id_item SWAP_SHOP_MAIN_MENU_ITEMS_2[5]; extern struct simple_menu_id_item SWAP_SHOP_SUBMENU_ITEMS_3[6]; -extern int16_t OVERLAY21_UNKNOWN_STRING_IDS[24]; extern struct window_params SWAP_SHOP_WINDOW_PARAMS_2; extern struct window_params SWAP_SHOP_WINDOW_PARAMS_3; extern struct window_params SWAP_SHOP_WINDOW_PARAMS_4; @@ -17,34 +16,5 @@ extern struct window_params SWAP_SHOP_WINDOW_PARAMS_6; extern struct window_params SWAP_SHOP_WINDOW_PARAMS_7; extern struct window_params SWAP_SHOP_WINDOW_PARAMS_8; extern struct window_params SWAP_SHOP_WINDOW_PARAMS_9; -extern char SWAP_SHOP_DEBUG_STRING_1[28]; -extern char SWAP_SHOP_DEBUG_STRING_2[33]; -extern char SWAP_SHOP_DEBUG_STRING_3[30]; -extern char SWAP_SHOP_DEBUG_STRING_4[34]; -extern char SWAP_SHOP_DEBUG_STRING_5[29]; -extern char SWAP_SHOP_DEBUG_STRING_6[31]; -extern char SWAP_SHOP_DEBUG_STRING_7[30]; -extern char SWAP_SHOP_DEBUG_STRING_8[19]; -extern char SWAP_SHOP_DEBUG_STRING_9[34]; -extern char SWAP_SHOP_DEBUG_STRING_10[26]; -extern char SWAP_SHOP_DEBUG_STRING_11[35]; -extern char SWAP_SHOP_DEBUG_STRING_12[31]; -extern char SWAP_SHOP_DEBUG_STRING_13[34]; -extern char SWAP_SHOP_DEBUG_STRING_14[36]; -extern char SWAP_SHOP_DEBUG_STRING_15[38]; -extern char SWAP_SHOP_DEBUG_STRING_16[40]; -extern char SWAP_SHOP_DEBUG_STRING_17[34]; -extern char SWAP_SHOP_DEBUG_STRING_18[8]; -extern char SWAP_SHOP_DEBUG_STRING_19[39]; -extern char SWAP_SHOP_DEBUG_STRING_20[21]; -extern char SWAP_SHOP_DEBUG_STRING_21[43]; -extern char SWAP_SHOP_DEBUG_STRING_22[44]; -extern char SWAP_SHOP_DEBUG_STRING_23[44]; -extern char SWAP_SHOP_DEBUG_STRING_24[38]; -extern char SWAP_SHOP_DEBUG_STRING_25[36]; -extern int16_t OVERLAY21_JP_STRING[3]; -extern char SWAP_SHOP_GOLD_STRING[18]; -extern undefined OVERLAY21_RESERVED_SPACE[8]; -extern struct swap_shop_menu_data* SWAP_SHOP_MENU_DATA_PTR; -extern undefined* OVERLAY21_UNKNOWN_POINTER__NA_238CF44; + #endif diff --git a/headers/functions/overlay21.h b/headers/functions/overlay21.h deleted file mode 100644 index 5d9df4e5..00000000 --- a/headers/functions/overlay21.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef HEADERS_FUNCTIONS_OVERLAY21_H_ -#define HEADERS_FUNCTIONS_OVERLAY21_H_ - -void SwapShopDialogueManager(int current_switch_case); -struct item_id GetFirstExclusivePrerequisite(struct item_id); -int SwapShopEntryPoint(void); -void SwapShopDestructor(void); -void SwapShopMainManager(void); -void CloseTextboxAndSimpleMenu(void); -void SwapShopPrintCurrentGold(int window_id); -#endif diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index d4d6b316..f2eb0b00 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -679,7 +679,6 @@ int PerformDamageSequence(struct entity* attacker, struct entity* defender, stru bool CanHitWithRegularAttack(struct entity* attacker, struct entity* defender); bool StatusCheckerCheck(struct entity* attacker, struct move* move); bool StatusCheckerCheckOnTarget(struct entity* attacker, struct entity* target, struct move* move); -bool HasLastUsedMove(struct move* moves); enum weather_id GetApparentWeather(struct entity* entity); void TryWeatherFormChange(struct entity* entity); void ActivateSportCondition(bool water_sport); diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index 3494430a..9f48f6f7 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -636,139 +636,4 @@ struct ground_entity_function_table { }; ASSERT_SIZE(struct ground_entity_function_table, 80); -struct swap_shop_menu_data { - // 0x0: The switch case index shared by SwapShopMainManager and SwapShopDialogueManager. - int32_t shared_switch_case; - // 0x4: The "next" switch case index to be shared, typically assigned by SwapShopMainManager. - int32_t next_switch_case; - // 0x8: Used exclusively by SwapShopMainManager. More research needed. - int32_t unk_windows_counter; - // 0xC: If true, croagunk will not ask the player if they want to continue swapping. - bool croagunk_out_of_swaps; - undefined field_0xd; - // 0xE: The item the player will receive by swapping. - struct bulk_item received_item; - undefined field_0x12; - undefined field_0x13; - undefined field_0x14; - undefined field_0x15; - undefined field_0x16; - undefined field_0x17; - // 0x18: While selecting which items to give croagunk, this field is filled when selecting "info" on an item in the list. - struct bulk_item described_item; - // 0x1C: Whenever a simple menu is run, this field is where the result is stored. - int32_t simple_menu_result; - // 0x20: Zeroed in SwapShopEntryPoint, but never modified - undefined4 unk_int_1; - // 0x24: Zeroed in SwapShopEntryPoint, but never modified - undefined4 unk_int_2; - // 0x28: Emotion for croagunk's portrait. - int32_t emotion_id; - // 0x2C: The case menu for a smaller switch case at the top of SwapShopMainManager. - int32_t window_manager_case; - // 0x30: Stores preprocessor_args for the next window. - struct preprocessor_args preprocessor_args; - // 0x80: The window_id of the current dialogue box window. -2 if none are present. - int8_t dialogue_window_id; - // 0x81: The window_id of the current portrait window. -2 if none are present. - int8_t portrait_window_id; - // 0x82: The window_id of the current advanced textbox window. -2 if none are present. - int8_t advanced_textbox_window_id; - // 0x83: The window_id of the current simple menu window. -2 if none are present. - int8_t simple_menu_window_id; - // 0x84: The window_id of the current text box window. -2 if none are present. - int8_t text_window_id; - // 0x85: The window_id of the current scroll box window. -2 if none are present. - int8_t scroll_box_window_id; - // 0x86: A small buffer for preprocessed text strings. - char text_string[66]; - // 0xC8: Stores portrait_params for croagunk's next portrait. - struct portrait_params portrait_params; - // 0xD8: Stores the number of items required to trade for the current trade. - int16_t exc_item_trade_count; - // 0xDA: The number of exclusive items currently in the bag. - int16_t exc_bag_item_count; - // 0xDC: The individual item IDs of the exclusive items present in the bag. - struct item_id_16 exc_bag_item_ids[50]; - // 0x140: The number of exclusive items currently in storage. - int16_t exc_storage_item_count; - // 0x142: The individual item IDs of the exclusive items in storage. - struct item_id_16 exc_storage_item_ids[1000]; - undefined field_0x912; - undefined field_0x913; - // 0x914: The team member slot whose exclusive items are about to be viewed. - int32_t selected_team_member_slot; - // 0x918: The move slot to create an info menu for. - int16_t selected_move_slot; - // 0x91A: The four moves known by selected_team_member_slot. - struct move known_moves[4]; - undefined field_0x93a; - undefined field_0x93b; -}; -ASSERT_SIZE(struct swap_shop_menu_data, 2364); - -struct swap_shop_inventory_ptrs { - // 0x0: Seems to be a pointer to some kind of temporary variable? - undefined* temp_variable; - // 0x4: A pointer to the swap_shop_inventory_data struct. - struct swap_shop_inventory_data* inventory_data; -}; -ASSERT_SIZE(struct swap_shop_inventory_ptrs, 8); - -struct exc_item_trade_slot { - // 0x0: The trade type the item slot uses. - int16_t trade_type; - // 0x2: This is likely either the item_id of the slot, or the index of the slot. It might vary depending on the trade_type. - int16_t unk_0x2; - // 0x4: If the player has enough exclusive items to swap for the item, this will be true. - bool can_afford_item; - undefined unk_0x5; -}; -ASSERT_SIZE(struct exc_item_trade_slot, 6); - -struct swap_shop_inventory_data { - // 0x0: switch case id for SwapShopInventoryManager - int32_t inventory_case_id; - // 0x4: A copy of num_valid_shop_items to be used by CreateCollectionMenu? - int32_t num_valid_shop_items_temp; - // 0x8: Seemingly unused, these are zeroed for some reason? - int32_t mystery_ints[1068]; - // 0x10B8: If the item is purchasable, this field will be 0x2. Otherwise, it will be 0x0. - int8_t is_item_purchasable[1068]; - // 0x14E4: Seems to be a window_id for a collection menu. - int8_t collection_menu_window_id; - undefined field_0x14e5; - // 0x14E6: Seems to be a struct for each item in the shop. - struct exc_item_trade_slot exc_item_trade_slots[1068]; - // 0x2DEE: For each item in the swap list, is the number of that item available? - int16_t item_quantities[1068]; - // 0x3646: List of every exclusive item the player owns. - struct item_id_16 owned_exclusive_items[1000]; - // 0x3E16: List of how much of each owned_exclusive_item the player owns. - int16_t owned_item_quantities[1000]; - // 0x45E6: The synth_templates matching today's rolled swap shop items. - struct synth_template shop_synth_templates[8]; - // 0x4626: Total number of items for sale in the swap shop. - int16_t num_valid_shop_items; - // 0x4628: Number of items required to be traded to croagunk for the selected item. - int16_t num_required_trade_items; - undefined field_0x462a; - undefined field_0x462b; - // 0x462C - struct window_extra_info window_extra_info_ptr; - // 0x46C4: Whether or not the synth.bin file is open. - bool synth_bin_open; - undefined field_0x46c5; - undefined field_0x46c6; - undefined field_0x46c7; - // 0x46C8 - int32_t textbox_window_id; - struct text_box * textbox_ptr; - // 0x46D0: The item ID the player selects when choosing items to give croagunk. Used to check the item info. - struct item_id_16 selected_item_id; - undefined field_0x46d2; - undefined field_0x46d3; -}; -ASSERT_SIZE(struct swap_shop_inventory_data, 18132); - #endif diff --git a/symbols/arm9.yml b/symbols/arm9.yml index a12ac82d..fe93f322 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -2095,16 +2095,6 @@ arm9: r0: item ID return: bool - - name: ReturnEggExclusiveItem - address: - EU: 0x200EC38 - NA: 0x200EB90 - JP: 0x200EBC0 - description: |- - Checks if a species has an egg exclusive item, for the purposes of the Croagunk Swap Shop. - Pulls from BABY_EXCLUSIVE_ITEM_PAIRS, so Pichu/Thundershard is not correctly accounted for by this function. - r0: monster ID - return: Exclusive item_id for that monster, 0 if none found. - name: SetActiveInventoryToMain address: EU: 0x200EC74 @@ -3148,34 +3138,12 @@ arm9: NA: 0x2012B34 JP: 0x2012B04 description: "Note: unverified, ported from Irdkwia's notes" - - name: GenerateCroagunkItems - address: - EU: 0x2012C24 - NA: 0x2012B7C - JP: 0x2012B4C - description: |- - Generates the Croagunk Swap Shop items for Croagunk in Wigglytuff's Guild. - return: 1 if at least one item generated, 0 otherwise. - name: GetSynthItem address: EU: 0x20132F8 NA: 0x2013250 JP: 0x2013220 - description: |- - Searches synth_template in SYNTH/synth.bin for a matching exclusive item. - r0: item_id of an exclusive item. - return: pointer to synth_template containing that item. 0 if no match was found. - - name: GetValidSynthsForSpecies - address: - EU: 0x201334C - NA: 0x20132A4 - JP: 0x2013274 - description: |- - Fills out monster_synth_data for the specified monster, containing the synth templates that apply to said monster. - r0: monster_id of the monster - r1: [output] Pointer to an empty monster_synth_data, to be filled by the function. - r2: Pointer to a type_synth_data, so the monster's types can be enabled in the bitfield. - return: 1 if at least one synth_template matches the species, and 0 if not. + description: "Note: unverified, ported from Irdkwia's notes" - name: LoadWazaP address: EU: 0x201346C @@ -5259,12 +5227,12 @@ arm9: NA: 0x202598C JP: 0x202596C description: |- - Gets the string id to be displayed for dialogue with a team member. + Note: unverified, ported from Irdkwia's notes - r0: personality_index (either a monster id or some constant) - r1: talk type + r0: personality_index + r1: group_id r2: restrictions - return: string id + return: ? - name: IsAOrBPressed address: EU: 0x20261CC @@ -10725,27 +10693,15 @@ arm9: r0: item_buffer return: Number of deliverable items for a mission - - name: GetScriptEntityMonsterId - address: - EU: 0x2065CF0 - NA: 0x2065974 - JP: 0x2065C5C - description: |- - Returns the monster id of the script entity given by the id. - - r0: script_entity_id - return: monster id - - name: GetScriptEntityMatchingStorageId - aliases: - - GetActorMatchingStorageId + - name: GetActorMatchingStorageId address: EU: 0x2065D14 NA: 0x2065998 JP: 0x2065C80 description: |- - Returns the storage id matching the script entity given by the id. + Note: unverified, ported from Irdkwia's notes - r0: script_entity_id + r0: actor_id return: storage ID - name: SetActorTalkMainAndActorTalkSub address: @@ -10755,8 +10711,8 @@ arm9: description: |- Sets ACTOR_TALK_MAIN and ACTOR_TALK_SUB to given actor IDs. - r0: script_entity_id for ACTOR_TALK_MAIN - r1: script_entity_id for ACTOR_TALK_SUB + r0: actor_id for ACTOR_TALK_MAIN + r1: actor_id for ACTOR_TALK_SUB - name: SetActorTalkMain address: EU: 0x2065ECC @@ -10766,7 +10722,7 @@ arm9: Sets ACTOR_TALK_MAIN to be actor_id. Implements SPECIAL_PROC_SET_ACTOR_TALK_MAIN (see ScriptSpecialProcessCall). - r0: script_entity_id + r0: actor_id - name: SetActorTalkSub address: EU: 0x2065EDC @@ -10776,7 +10732,7 @@ arm9: Sets ACTOR_TALK_SUB to be actor_id. Implements SPECIAL_PROC_SET_ACTOR_TALK_SUB (see ScriptSpecialProcessCall). - r0: script_entity_id + r0: actor_id - name: RandomizeDemoActors address: EU: 0x2065FC4 @@ -11137,7 +11093,7 @@ arm9: Linked to the dungeon group id Note: unverified, ported from Irdkwia's notes - - name: BABY_EXCLUSIVE_ITEM_PAIRS + - name: ARM9_UNKNOWN_TABLE__NA_2097FF8 address: EU: 0x2098444 NA: 0x2097FF8 @@ -11146,7 +11102,10 @@ arm9: EU: 0x40 NA: 0x40 JP: 0x40 - description: "Stores the IDs of each baby Pokemon (and Phione), as well as the exclusive item they hatch with." + description: |- + 16*0x4 (0x2+0x2) + + Note: unverified, ported from Irdkwia's notes - name: KECLEON_SHOP_ITEM_TABLE_LISTS_1 address: EU: 0x2098504 diff --git a/symbols/overlay11.yml b/symbols/overlay11.yml index cb1f4934..1aad05ac 100644 --- a/symbols/overlay11.yml +++ b/symbols/overlay11.yml @@ -1,4 +1,3 @@ - overlay11: versions: - EU @@ -1488,16 +1487,6 @@ overlay11: r0: ? r1: ? - - name: SwapShopInventoryManager - address: - EU: 0x230BBA8 - description: |- - Called primarily handle the display and preparation of the swap shop inventory list, exclusive items list, and the item trade list. - Creates a swap_shop_inventory_data struct if one does not already exist. - Is the child function to SwapShopDialogueManager. - - r0: switch case index for the function: 0 = Swap List Inventory, 1 = Unknown, 2 = Species Exclusive Item List, 3 = Item Trade Away Selection List. - r1: Depends on r0. If case 2: ID of the monster to retrieve an exclusive item list for. If case 3: Number of Exclusive Items the player owns. - name: HandleControlsTopScreenGround address: EU: 0x230EFB4 @@ -1822,12 +1811,6 @@ overlay11: Host pointers to multiple structure used for performing an overworld scene type: struct main_ground_data - - name: SWAP_SHOP_INVENTORY_PTRS - address: - EU: 0x23258E4 - length: - EU: 0x8 - description: Host pointers to multiple structures used for performing internal Swap Shop checks. - name: WORLD_MAP_MODE address: EU: 0x2325924 diff --git a/symbols/overlay21.yml b/symbols/overlay21.yml index dc50bcdc..400cf2b0 100644 --- a/symbols/overlay21.yml +++ b/symbols/overlay21.yml @@ -12,58 +12,7 @@ overlay21: NA: 0x2E20 JP: 0x2E40 description: Controls the Croagunk Swap Shop. - functions: - - name: SwapShopDialogueManager - address: - EU: 0x238AC80 - description: |- - Called primarily to fill dialogue boxes or display portraits, this function exists to print the next portrait, dialogue, or input for the Swap Shop. - Consistently writes the provided input to shared_switch_case, and occasionally writes to next_switch_case. - Often calls SwapShopInventoryManager, and is often called by SwapShopMainManager. - - r0: New current_switch_case value. - - name: GetFirstExclusivePrerequisite - address: - EU: 0x0238C320 - description: |- - Retrieves the item ID of the first item needed to trade for the specified item. There are hardcoded exceptions for the Eeveelution/Hitmontrio items, - but outside of that, the output will be as follows. - output_id = input_id - ((input_id - 0x1FA) % 4) - r0: item ID of the exclusive item to be checked. - return: item ID of the first exclusive item required to trade for the input. - - name: SwapShopEntryPoint - address: - EU: 0x238C388 - description: |- - Is the entrypoint of the overlay_load_entry, and seems to run once to initiate the Swap Shop. Is not called anywhere else. - Allocates space for swap_shop_menu_data, and initializes many of its fields. - return: Always returns 1. - - name: SwapShopDestructor - address: - EU: 0x238C43C - description: |- - Is the destructor of the overlay_load_entry, and seems to run once on closing the Swap Shop. Is not called anywhere else. - Frees up the allocated space for swap_shop_menu_data if it is not already empty. - - name: SwapShopMainManager - address: - EU: 0x238C468 - description: |- - Called every frame the Croagunk Swap Shop is open, acting as a parent function for the various processes the Swap Shop is responsible for. - Primarily handles displaying dialogue boxes, retrieving menu selections, and contributing updates to the various switch case indices. - Often calls SwapShopDialogueManager, either with an immediate or with the designated next_switch_case value. - - return: Typically returns 1, but seems to return 4 to exit the Swap Shop. Possibly related to the explorerscript output? - - name: CloseTextboxAndSimpleMenu - address: - EU: 0x238D460 - description: Checks both the text_window_id and menu_window_id for -2. If either are not -2, close the textbox/simple menu, and assign the id to -2. - - name: SwapShopPrintCurrentGold - address: - EU: 0x238D4E4 - description: |- - A text box callback function containing the player's current gold, seen on the Swap Shop main menu. - - r0: window_id of the textbox + functions: [] data: - name: SWAP_SHOP_WINDOW_PARAMS_1 address: @@ -73,7 +22,7 @@ overlay21: length: EU: 0x10 NA: 0x10 - description: Used with SwapShopPrintCurrentGold for a simple textbox. + description: "Note: unverified, ported from Irdkwia's notes" - name: SWAP_SHOP_MENU_ITEMS_CONFIRM address: EU: 0x238D578 @@ -83,7 +32,6 @@ overlay21: EU: 0x18 NA: 0x18 JP: 0x18 - description: Used with SWAP_SHOP_WINDOW_PARAMS_7. - name: SWAP_SHOP_SUBMENU_ITEMS_1 address: EU: 0x238D590 @@ -93,7 +41,6 @@ overlay21: EU: 0x18 NA: 0x18 JP: 0x18 - description: Used with SWAP_SHOP_WINDOW_PARAMS_6. - name: SWAP_SHOP_SUBMENU_ITEMS_2 address: EU: 0x238D5A8 @@ -103,7 +50,6 @@ overlay21: EU: 0x20 NA: 0x20 JP: 0x20 - description: Used with SWAP_SHOP_WINDOW_PARAMS_7. - name: SWAP_SHOP_MAIN_MENU_ITEMS_1 address: EU: 0x238D5C8 @@ -113,7 +59,6 @@ overlay21: EU: 0x20 NA: 0x20 JP: 0x20 - description: Used with SWAP_SHOP_WINDOW_PARAMS_6. - name: SWAP_SHOP_MAIN_MENU_ITEMS_2 address: EU: 0x238D5E8 @@ -123,7 +68,6 @@ overlay21: EU: 0x28 NA: 0x28 JP: 0x28 - description: Used alongside SWAP_SHOP_WINDOW_PARAMS_5. - name: SWAP_SHOP_SUBMENU_ITEMS_3 address: EU: 0x238D610 @@ -133,35 +77,30 @@ overlay21: EU: 0x30 NA: 0x30 JP: 0x30 - description: Used alongside SWAP_SHOP_WINDOW_PARAMS_9. - name: OVERLAY21_UNKNOWN_STRING_IDS address: NA: 0x238CB00 - EU: 0x238D640 length: NA: 0x38 - description: Seem to be completely unused by the Swap Shop, but the strings are 1:1 for the ones that are in use elsewhere in the shop. + description: "Note: unverified, ported from Irdkwia's notes" - name: SWAP_SHOP_WINDOW_PARAMS_2 address: NA: 0x238CB38 - EU: 0x238D678 length: NA: 0x10 - description: Seem to be completely unused by the Swap Shop. + description: "Note: unverified, ported from Irdkwia's notes" - name: SWAP_SHOP_WINDOW_PARAMS_3 address: NA: 0x238CB48 - EU: 0x238d6A8 length: NA: 0x10 - description: Seem to be completely unused by the Swap Shop. + description: "Note: unverified, ported from Irdkwia's notes" - name: SWAP_SHOP_WINDOW_PARAMS_4 address: NA: 0x238CB58 - EU: 0x238D698 length: NA: 0x10 - description: Seem to be completely unused by the Swap Shop. + description: "Note: unverified, ported from Irdkwia's notes" - name: SWAP_SHOP_WINDOW_PARAMS_5 address: EU: 0x238D6A8 @@ -170,7 +109,7 @@ overlay21: length: EU: 0x10 NA: 0x10 - description: Used alongside SWAP_SHOP_MAIN_MENU_ITEMS_2. + description: "Note: unverified, ported from Irdkwia's notes" - name: SWAP_SHOP_WINDOW_PARAMS_6 address: EU: 0x238D6B8 @@ -179,7 +118,7 @@ overlay21: length: EU: 0x10 NA: 0x10 - description: Used alongside both SWAP_SHOP_MAIN_MENU_ITEMS_1 and SWAP_SHOP_SUBMENU_ITEMS_1. + description: "Note: unverified, ported from Irdkwia's notes" - name: SWAP_SHOP_WINDOW_PARAMS_7 address: EU: 0x238D6C8 @@ -188,7 +127,7 @@ overlay21: length: EU: 0x10 NA: 0x10 - description: Used alongside both SWAP_SHOP_MENU_ITEMS_CONFIRM and SWAP_SHOP_SUBMENU_ITEMS_2. + description: "Note: unverified, ported from Irdkwia's notes" - name: SWAP_SHOP_WINDOW_PARAMS_8 address: EU: 0x238D6D8 @@ -197,7 +136,7 @@ overlay21: length: EU: 0x10 NA: 0x10 - description: Used alone, seemingly for the exclusive item description window. + description: "Note: unverified, ported from Irdkwia's notes" - name: SWAP_SHOP_WINDOW_PARAMS_9 address: EU: 0x238D6E8 @@ -206,181 +145,7 @@ overlay21: length: EU: 0x10 NA: 0x10 - description: Used alongside SWAP_SHOP_SUBMENU_ITEMS_3. - - name: SWAP_SHOP_DEBUG_STRING_1 - address: - EU: 0x238D6F8 - length: - EU: 0x1D - description: MENU_SYNTHESIS_MODE_START:\n - - - name: SWAP_SHOP_DEBUG_STRING_2 - address: - EU: 0x238D714 - length: - EU: 0x22 - description: MENU_SYNTHESIS_MODE_SELECTMENU:\n - - - name: SWAP_SHOP_DEBUG_STRING_3 - address: - EU: 0x238D738 - length: - EU: 0x1F - description: MENU_SYNTHESIS_MODE_RESTART:\n - - - name: SWAP_SHOP_DEBUG_STRING_4 - address: - EU: 0x238D758 - length: - EU: 0x23 - description: MENU_SYNTHESIS_MODE_EXPLANATION:\n - - - name: SWAP_SHOP_DEBUG_STRING_5 - address: - EU: 0x238D77C - length: - EU: 0x1E - description: MENU_SYNTHESIS_MODE_THANKS:\n - - - name: SWAP_SHOP_DEBUG_STRING_6 - address: - EU: 0x238D79C - length: - EU: 0x20 - description: MENU_SYNTHESIS_MODE_ITEM_NON:\n - - - name: SWAP_SHOP_DEBUG_STRING_7 - address: - EU: 0x238D7BC - length: - EU: 0x1F - description: MENU_SYNTHESIS_MODE_GOLD_NON\n - - - name: SWAP_SHOP_DEBUG_STRING_8 - address: - EU: 0x238D7DC - length: - EU: 0x14 - description: MENU_SYNTHESIS_GOLD - - - name: SWAP_SHOP_DEBUG_STRING_9 - address: - EU: 0x238D800 - length: - EU: 0x23 - description: MENU_SYNTHESIS_MODE_SELECT_FULL:\n - - - name: SWAP_SHOP_DEBUG_STRING_10 - address: - EU: 0x238D824 - length: - EU: 0x1B - description: MENU_SYNTHESIS_MODE_QUIT\n - - - name: SWAP_SHOP_DEBUG_STRING_11 - address: - EU: 0x238D840 - length: - EU: 0x24 - description: MENU_SYNTHESIS_MODE_SELECT_START:\n - - - name: SWAP_SHOP_DEBUG_STRING_12 - address: - EU: 0x238D864 - length: - EU: 0x20 - description: MENU_SYNTHESIS_MODE__RESTART:\n - - - name: SWAP_SHOP_DEBUG_STRING_13 - address: - EU: 0x238D884 - length: - EU: 0x23 - description: MENU_SYNTHESIS_MODE_SELECT_INIT:\n - - - name: SWAP_SHOP_DEBUG_STRING_14 - address: - EU: 0x238D8A8 - length: - EU: 0x25 - description: MENU_SYNTHESIS_MODE_SELECT_SELECT:\n - - - name: SWAP_SHOP_DEBUG_STRING_15 - address: - EU: 0x238D8CC - length: - EU: 0x27 - description: MENU_SYNTHESIS_MODE_SELECT_RESELECT:\n - - - name: SWAP_SHOP_DEBUG_STRING_16 - address: - EU: 0x238D8F4 - length: - EU: 0x29 - description: \tMENU_SYNTHESIS_MODE_SELECT_SUB_MENU:\n - - - name: SWAP_SHOP_DEBUG_STRING_17 - address: - EU: 0x238D91C - length: - EU: 0x23 - description: MENU_SYNTHESIS_MODE_SELECT_EXPLA\n - - - name: SWAP_SHOP_DEBUG_STRING_18 - address: - EU: 0x238D940 - length: - EU: 0x9 - description: "[item:0]" - - - name: SWAP_SHOP_DEBUG_STRING_19 - address: - EU: 0x238D94C - length: - EU: 0x28 - description: MENU_SYNTHESIS_MODE_SELECT_CONFIRM_1:\n - - - name: SWAP_SHOP_DEBUG_STRING_20 - address: - EU: 0x238D974 - length: - EU: 0x16 - description: _SELL_CONFIRM NEW_1\n - - - name: SWAP_SHOP_DEBUG_STRING_21 - address: - EU: 0x238D98C - length: - EU: 0x2C - description: MENU_SYNTHESIS_MODE_SELECT_THANKS_ACTION:\n - - - name: SWAP_SHOP_DEBUG_STRING_22 - address: - EU: 0x238D9B8 - length: - EU: 0x2D - description: MENU_SYNTHESIS_MODE_SELECT_THANKS_ACTION2:\n - - - name: SWAP_SHOP_DEBUG_STRING_23 - address: - EU: 0x238D9E4 - length: - EU: 0x2D - description: MENU_SYNTHESIS_MODE_SELECT_THANKS_ACTION3:\n - - - name: SWAP_SHOP_DEBUG_STRING_24 - address: - EU: 0x238DA10 - length: - EU: 0x27 - description: MENU_SYNTHESIS_MODE_SELECT_THANKS_1:\n - - - name: SWAP_SHOP_DEBUG_STRING_25 - address: - EU: 0x238DA38 - length: - EU: 0x25 - description: MENU_SYNTHESIS_MODE_SELECT_THANKS:\n + description: "Note: unverified, ported from Irdkwia's notes" - name: OVERLAY21_JP_STRING address: EU: 0x238DA5C @@ -388,30 +153,24 @@ overlay21: JP: 0x238E48C length: NA: 0x8 - description: 合成:(synthesis in Japanese) - - name: SWAP_SHOP_GOLD_STRING - address: - EU: 0x238DA64 - length: - EU: 0x13 - description: "[CS:V][gold:0][CR]" + description: 合成: - name: OVERLAY21_RESERVED_SPACE address: NA: 0x238CF38 length: NA: 0x8 description: "Note: unverified, ported from Irdkwia's notes" - - name: SWAP_SHOP_MENU_DATA_PTR + - name: OVERLAY21_UNKNOWN_POINTER__NA_238CF40 address: EU: 0x238DA80 NA: 0x238CF40 JP: 0x238E4C0 length: NA: 0x4 - description: Pointer to the swap_shop_menu_data that governs the operations of most overlay_21 functions. + description: "Note: unverified, ported from Irdkwia's notes" - name: OVERLAY21_UNKNOWN_POINTER__NA_238CF44 address: NA: 0x238CF44 length: NA: 0x4 - description: "Note: unverified, ported from Irdkwia's notes." + description: "Note: unverified, ported from Irdkwia's notes" diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index ce3c18f5..0f958e80 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -6674,17 +6674,6 @@ overlay29: r2: Pointer to the entity being targeted by the move r1: Move pointer return: True if it makes sense to use the move, false if it would be redundant given the effects it causes and the effects that the target already has. - - name: HasLastUsedMove - address: - EU: 0x23356EC - NA: 0x2334CAC - JP: 0x2336098 - description: |- - Determines whether a monster has used any of its moves on this floor. - This function takes in the monster's move list and checks if any moves have the f_last_used flag set. - - r0: Pointer to the monster's moves. - return: True if the move list has any moves with the f_last_used flag set, false otherwise. - name: GetApparentWeather address: EU: 0x2335748 From 6a54bdedb259874e245f99a3ad1734260e94d9b5 Mon Sep 17 00:00:00 2001 From: Parker Zhiss <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 02:06:53 -0400 Subject: [PATCH 118/151] Reapply "Merge branch 'master' of https://github.com/HappyLappy1/pmdsky-debug" This reverts commit f77a1e79836b178a414f61b0adb73e4a07a30818. --- headers/data/arm9.h | 1 + headers/data/overlay21.h | 32 ++- headers/functions/overlay21.h | 11 + headers/functions/overlay29.h | 1 + headers/types/ground_mode/ground_mode.h | 135 ++++++++++++ symbols/arm9.yml | 75 +++++-- symbols/overlay11.yml | 17 ++ symbols/overlay21.yml | 271 ++++++++++++++++++++++-- symbols/overlay29.yml | 11 + 9 files changed, 521 insertions(+), 33 deletions(-) create mode 100644 headers/functions/overlay21.h diff --git a/headers/data/arm9.h b/headers/data/arm9.h index 4676a837..51f7ea30 100644 --- a/headers/data/arm9.h +++ b/headers/data/arm9.h @@ -34,6 +34,7 @@ extern char STRING_DUNGEON_DUNGEON_BIN[20]; extern char STRING_MONSTER_M_ATTACK_BIN[24]; extern char STRING_MONSTER_M_GROUND_BIN[24]; extern char STRING_FILE_DIRECTORY_INIT[40]; +extern struct baby_exclusive_item_pair BABY_EXCLUSIVE_ITEM_PAIRS[16]; extern enum item_id KECLEON_SHOP_ITEM_TABLE_LISTS_1[4]; extern enum item_id KECLEON_SHOP_ITEM_TABLE_LISTS_2[4]; extern struct exclusive_item_stat_boost_entry EXCLUSIVE_ITEM_STAT_BOOST_DATA[15]; diff --git a/headers/data/overlay21.h b/headers/data/overlay21.h index 033e3afa..b4d2f2cf 100644 --- a/headers/data/overlay21.h +++ b/headers/data/overlay21.h @@ -8,6 +8,7 @@ extern struct simple_menu_id_item SWAP_SHOP_SUBMENU_ITEMS_2[4]; extern struct simple_menu_id_item SWAP_SHOP_MAIN_MENU_ITEMS_1[4]; extern struct simple_menu_id_item SWAP_SHOP_MAIN_MENU_ITEMS_2[5]; extern struct simple_menu_id_item SWAP_SHOP_SUBMENU_ITEMS_3[6]; +extern int16_t OVERLAY21_UNKNOWN_STRING_IDS[24]; extern struct window_params SWAP_SHOP_WINDOW_PARAMS_2; extern struct window_params SWAP_SHOP_WINDOW_PARAMS_3; extern struct window_params SWAP_SHOP_WINDOW_PARAMS_4; @@ -16,5 +17,34 @@ extern struct window_params SWAP_SHOP_WINDOW_PARAMS_6; extern struct window_params SWAP_SHOP_WINDOW_PARAMS_7; extern struct window_params SWAP_SHOP_WINDOW_PARAMS_8; extern struct window_params SWAP_SHOP_WINDOW_PARAMS_9; - +extern char SWAP_SHOP_DEBUG_STRING_1[28]; +extern char SWAP_SHOP_DEBUG_STRING_2[33]; +extern char SWAP_SHOP_DEBUG_STRING_3[30]; +extern char SWAP_SHOP_DEBUG_STRING_4[34]; +extern char SWAP_SHOP_DEBUG_STRING_5[29]; +extern char SWAP_SHOP_DEBUG_STRING_6[31]; +extern char SWAP_SHOP_DEBUG_STRING_7[30]; +extern char SWAP_SHOP_DEBUG_STRING_8[19]; +extern char SWAP_SHOP_DEBUG_STRING_9[34]; +extern char SWAP_SHOP_DEBUG_STRING_10[26]; +extern char SWAP_SHOP_DEBUG_STRING_11[35]; +extern char SWAP_SHOP_DEBUG_STRING_12[31]; +extern char SWAP_SHOP_DEBUG_STRING_13[34]; +extern char SWAP_SHOP_DEBUG_STRING_14[36]; +extern char SWAP_SHOP_DEBUG_STRING_15[38]; +extern char SWAP_SHOP_DEBUG_STRING_16[40]; +extern char SWAP_SHOP_DEBUG_STRING_17[34]; +extern char SWAP_SHOP_DEBUG_STRING_18[8]; +extern char SWAP_SHOP_DEBUG_STRING_19[39]; +extern char SWAP_SHOP_DEBUG_STRING_20[21]; +extern char SWAP_SHOP_DEBUG_STRING_21[43]; +extern char SWAP_SHOP_DEBUG_STRING_22[44]; +extern char SWAP_SHOP_DEBUG_STRING_23[44]; +extern char SWAP_SHOP_DEBUG_STRING_24[38]; +extern char SWAP_SHOP_DEBUG_STRING_25[36]; +extern int16_t OVERLAY21_JP_STRING[3]; +extern char SWAP_SHOP_GOLD_STRING[18]; +extern undefined OVERLAY21_RESERVED_SPACE[8]; +extern struct swap_shop_menu_data* SWAP_SHOP_MENU_DATA_PTR; +extern undefined* OVERLAY21_UNKNOWN_POINTER__NA_238CF44; #endif diff --git a/headers/functions/overlay21.h b/headers/functions/overlay21.h new file mode 100644 index 00000000..5d9df4e5 --- /dev/null +++ b/headers/functions/overlay21.h @@ -0,0 +1,11 @@ +#ifndef HEADERS_FUNCTIONS_OVERLAY21_H_ +#define HEADERS_FUNCTIONS_OVERLAY21_H_ + +void SwapShopDialogueManager(int current_switch_case); +struct item_id GetFirstExclusivePrerequisite(struct item_id); +int SwapShopEntryPoint(void); +void SwapShopDestructor(void); +void SwapShopMainManager(void); +void CloseTextboxAndSimpleMenu(void); +void SwapShopPrintCurrentGold(int window_id); +#endif diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index f2eb0b00..d4d6b316 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -679,6 +679,7 @@ int PerformDamageSequence(struct entity* attacker, struct entity* defender, stru bool CanHitWithRegularAttack(struct entity* attacker, struct entity* defender); bool StatusCheckerCheck(struct entity* attacker, struct move* move); bool StatusCheckerCheckOnTarget(struct entity* attacker, struct entity* target, struct move* move); +bool HasLastUsedMove(struct move* moves); enum weather_id GetApparentWeather(struct entity* entity); void TryWeatherFormChange(struct entity* entity); void ActivateSportCondition(bool water_sport); diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index 9f48f6f7..3494430a 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -636,4 +636,139 @@ struct ground_entity_function_table { }; ASSERT_SIZE(struct ground_entity_function_table, 80); +struct swap_shop_menu_data { + // 0x0: The switch case index shared by SwapShopMainManager and SwapShopDialogueManager. + int32_t shared_switch_case; + // 0x4: The "next" switch case index to be shared, typically assigned by SwapShopMainManager. + int32_t next_switch_case; + // 0x8: Used exclusively by SwapShopMainManager. More research needed. + int32_t unk_windows_counter; + // 0xC: If true, croagunk will not ask the player if they want to continue swapping. + bool croagunk_out_of_swaps; + undefined field_0xd; + // 0xE: The item the player will receive by swapping. + struct bulk_item received_item; + undefined field_0x12; + undefined field_0x13; + undefined field_0x14; + undefined field_0x15; + undefined field_0x16; + undefined field_0x17; + // 0x18: While selecting which items to give croagunk, this field is filled when selecting "info" on an item in the list. + struct bulk_item described_item; + // 0x1C: Whenever a simple menu is run, this field is where the result is stored. + int32_t simple_menu_result; + // 0x20: Zeroed in SwapShopEntryPoint, but never modified + undefined4 unk_int_1; + // 0x24: Zeroed in SwapShopEntryPoint, but never modified + undefined4 unk_int_2; + // 0x28: Emotion for croagunk's portrait. + int32_t emotion_id; + // 0x2C: The case menu for a smaller switch case at the top of SwapShopMainManager. + int32_t window_manager_case; + // 0x30: Stores preprocessor_args for the next window. + struct preprocessor_args preprocessor_args; + // 0x80: The window_id of the current dialogue box window. -2 if none are present. + int8_t dialogue_window_id; + // 0x81: The window_id of the current portrait window. -2 if none are present. + int8_t portrait_window_id; + // 0x82: The window_id of the current advanced textbox window. -2 if none are present. + int8_t advanced_textbox_window_id; + // 0x83: The window_id of the current simple menu window. -2 if none are present. + int8_t simple_menu_window_id; + // 0x84: The window_id of the current text box window. -2 if none are present. + int8_t text_window_id; + // 0x85: The window_id of the current scroll box window. -2 if none are present. + int8_t scroll_box_window_id; + // 0x86: A small buffer for preprocessed text strings. + char text_string[66]; + // 0xC8: Stores portrait_params for croagunk's next portrait. + struct portrait_params portrait_params; + // 0xD8: Stores the number of items required to trade for the current trade. + int16_t exc_item_trade_count; + // 0xDA: The number of exclusive items currently in the bag. + int16_t exc_bag_item_count; + // 0xDC: The individual item IDs of the exclusive items present in the bag. + struct item_id_16 exc_bag_item_ids[50]; + // 0x140: The number of exclusive items currently in storage. + int16_t exc_storage_item_count; + // 0x142: The individual item IDs of the exclusive items in storage. + struct item_id_16 exc_storage_item_ids[1000]; + undefined field_0x912; + undefined field_0x913; + // 0x914: The team member slot whose exclusive items are about to be viewed. + int32_t selected_team_member_slot; + // 0x918: The move slot to create an info menu for. + int16_t selected_move_slot; + // 0x91A: The four moves known by selected_team_member_slot. + struct move known_moves[4]; + undefined field_0x93a; + undefined field_0x93b; +}; +ASSERT_SIZE(struct swap_shop_menu_data, 2364); + +struct swap_shop_inventory_ptrs { + // 0x0: Seems to be a pointer to some kind of temporary variable? + undefined* temp_variable; + // 0x4: A pointer to the swap_shop_inventory_data struct. + struct swap_shop_inventory_data* inventory_data; +}; +ASSERT_SIZE(struct swap_shop_inventory_ptrs, 8); + +struct exc_item_trade_slot { + // 0x0: The trade type the item slot uses. + int16_t trade_type; + // 0x2: This is likely either the item_id of the slot, or the index of the slot. It might vary depending on the trade_type. + int16_t unk_0x2; + // 0x4: If the player has enough exclusive items to swap for the item, this will be true. + bool can_afford_item; + undefined unk_0x5; +}; +ASSERT_SIZE(struct exc_item_trade_slot, 6); + +struct swap_shop_inventory_data { + // 0x0: switch case id for SwapShopInventoryManager + int32_t inventory_case_id; + // 0x4: A copy of num_valid_shop_items to be used by CreateCollectionMenu? + int32_t num_valid_shop_items_temp; + // 0x8: Seemingly unused, these are zeroed for some reason? + int32_t mystery_ints[1068]; + // 0x10B8: If the item is purchasable, this field will be 0x2. Otherwise, it will be 0x0. + int8_t is_item_purchasable[1068]; + // 0x14E4: Seems to be a window_id for a collection menu. + int8_t collection_menu_window_id; + undefined field_0x14e5; + // 0x14E6: Seems to be a struct for each item in the shop. + struct exc_item_trade_slot exc_item_trade_slots[1068]; + // 0x2DEE: For each item in the swap list, is the number of that item available? + int16_t item_quantities[1068]; + // 0x3646: List of every exclusive item the player owns. + struct item_id_16 owned_exclusive_items[1000]; + // 0x3E16: List of how much of each owned_exclusive_item the player owns. + int16_t owned_item_quantities[1000]; + // 0x45E6: The synth_templates matching today's rolled swap shop items. + struct synth_template shop_synth_templates[8]; + // 0x4626: Total number of items for sale in the swap shop. + int16_t num_valid_shop_items; + // 0x4628: Number of items required to be traded to croagunk for the selected item. + int16_t num_required_trade_items; + undefined field_0x462a; + undefined field_0x462b; + // 0x462C + struct window_extra_info window_extra_info_ptr; + // 0x46C4: Whether or not the synth.bin file is open. + bool synth_bin_open; + undefined field_0x46c5; + undefined field_0x46c6; + undefined field_0x46c7; + // 0x46C8 + int32_t textbox_window_id; + struct text_box * textbox_ptr; + // 0x46D0: The item ID the player selects when choosing items to give croagunk. Used to check the item info. + struct item_id_16 selected_item_id; + undefined field_0x46d2; + undefined field_0x46d3; +}; +ASSERT_SIZE(struct swap_shop_inventory_data, 18132); + #endif diff --git a/symbols/arm9.yml b/symbols/arm9.yml index fe93f322..a12ac82d 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -2095,6 +2095,16 @@ arm9: r0: item ID return: bool + - name: ReturnEggExclusiveItem + address: + EU: 0x200EC38 + NA: 0x200EB90 + JP: 0x200EBC0 + description: |- + Checks if a species has an egg exclusive item, for the purposes of the Croagunk Swap Shop. + Pulls from BABY_EXCLUSIVE_ITEM_PAIRS, so Pichu/Thundershard is not correctly accounted for by this function. + r0: monster ID + return: Exclusive item_id for that monster, 0 if none found. - name: SetActiveInventoryToMain address: EU: 0x200EC74 @@ -3138,12 +3148,34 @@ arm9: NA: 0x2012B34 JP: 0x2012B04 description: "Note: unverified, ported from Irdkwia's notes" + - name: GenerateCroagunkItems + address: + EU: 0x2012C24 + NA: 0x2012B7C + JP: 0x2012B4C + description: |- + Generates the Croagunk Swap Shop items for Croagunk in Wigglytuff's Guild. + return: 1 if at least one item generated, 0 otherwise. - name: GetSynthItem address: EU: 0x20132F8 NA: 0x2013250 JP: 0x2013220 - description: "Note: unverified, ported from Irdkwia's notes" + description: |- + Searches synth_template in SYNTH/synth.bin for a matching exclusive item. + r0: item_id of an exclusive item. + return: pointer to synth_template containing that item. 0 if no match was found. + - name: GetValidSynthsForSpecies + address: + EU: 0x201334C + NA: 0x20132A4 + JP: 0x2013274 + description: |- + Fills out monster_synth_data for the specified monster, containing the synth templates that apply to said monster. + r0: monster_id of the monster + r1: [output] Pointer to an empty monster_synth_data, to be filled by the function. + r2: Pointer to a type_synth_data, so the monster's types can be enabled in the bitfield. + return: 1 if at least one synth_template matches the species, and 0 if not. - name: LoadWazaP address: EU: 0x201346C @@ -5227,12 +5259,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,15 +10725,27 @@ arm9: r0: item_buffer return: Number of deliverable items for a mission - - name: GetActorMatchingStorageId + - name: GetScriptEntityMonsterId + address: + EU: 0x2065CF0 + NA: 0x2065974 + JP: 0x2065C5C + description: |- + Returns the monster id of the script entity given by the id. + + r0: script_entity_id + return: monster id + - name: GetScriptEntityMatchingStorageId + aliases: + - GetActorMatchingStorageId 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: @@ -10711,8 +10755,8 @@ 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 @@ -10722,7 +10766,7 @@ arm9: Sets ACTOR_TALK_MAIN to be actor_id. Implements SPECIAL_PROC_SET_ACTOR_TALK_MAIN (see ScriptSpecialProcessCall). - r0: actor_id + r0: script_entity_id - name: SetActorTalkSub address: EU: 0x2065EDC @@ -10732,7 +10776,7 @@ arm9: Sets ACTOR_TALK_SUB to be actor_id. Implements SPECIAL_PROC_SET_ACTOR_TALK_SUB (see ScriptSpecialProcessCall). - r0: actor_id + r0: script_entity_id - name: RandomizeDemoActors address: EU: 0x2065FC4 @@ -11093,7 +11137,7 @@ arm9: Linked to the dungeon group id Note: unverified, ported from Irdkwia's notes - - name: ARM9_UNKNOWN_TABLE__NA_2097FF8 + - name: BABY_EXCLUSIVE_ITEM_PAIRS address: EU: 0x2098444 NA: 0x2097FF8 @@ -11102,10 +11146,7 @@ arm9: EU: 0x40 NA: 0x40 JP: 0x40 - description: |- - 16*0x4 (0x2+0x2) - - Note: unverified, ported from Irdkwia's notes + description: "Stores the IDs of each baby Pokemon (and Phione), as well as the exclusive item they hatch with." - name: KECLEON_SHOP_ITEM_TABLE_LISTS_1 address: EU: 0x2098504 diff --git a/symbols/overlay11.yml b/symbols/overlay11.yml index 1aad05ac..cb1f4934 100644 --- a/symbols/overlay11.yml +++ b/symbols/overlay11.yml @@ -1,3 +1,4 @@ + overlay11: versions: - EU @@ -1487,6 +1488,16 @@ overlay11: r0: ? r1: ? + - name: SwapShopInventoryManager + address: + EU: 0x230BBA8 + description: |- + Called primarily handle the display and preparation of the swap shop inventory list, exclusive items list, and the item trade list. + Creates a swap_shop_inventory_data struct if one does not already exist. + Is the child function to SwapShopDialogueManager. + + r0: switch case index for the function: 0 = Swap List Inventory, 1 = Unknown, 2 = Species Exclusive Item List, 3 = Item Trade Away Selection List. + r1: Depends on r0. If case 2: ID of the monster to retrieve an exclusive item list for. If case 3: Number of Exclusive Items the player owns. - name: HandleControlsTopScreenGround address: EU: 0x230EFB4 @@ -1811,6 +1822,12 @@ overlay11: Host pointers to multiple structure used for performing an overworld scene type: struct main_ground_data + - name: SWAP_SHOP_INVENTORY_PTRS + address: + EU: 0x23258E4 + length: + EU: 0x8 + description: Host pointers to multiple structures used for performing internal Swap Shop checks. - name: WORLD_MAP_MODE address: EU: 0x2325924 diff --git a/symbols/overlay21.yml b/symbols/overlay21.yml index 400cf2b0..dc50bcdc 100644 --- a/symbols/overlay21.yml +++ b/symbols/overlay21.yml @@ -12,7 +12,58 @@ overlay21: NA: 0x2E20 JP: 0x2E40 description: Controls the Croagunk Swap Shop. - functions: [] + functions: + - name: SwapShopDialogueManager + address: + EU: 0x238AC80 + description: |- + Called primarily to fill dialogue boxes or display portraits, this function exists to print the next portrait, dialogue, or input for the Swap Shop. + Consistently writes the provided input to shared_switch_case, and occasionally writes to next_switch_case. + Often calls SwapShopInventoryManager, and is often called by SwapShopMainManager. + + r0: New current_switch_case value. + - name: GetFirstExclusivePrerequisite + address: + EU: 0x0238C320 + description: |- + Retrieves the item ID of the first item needed to trade for the specified item. There are hardcoded exceptions for the Eeveelution/Hitmontrio items, + but outside of that, the output will be as follows. + output_id = input_id - ((input_id - 0x1FA) % 4) + r0: item ID of the exclusive item to be checked. + return: item ID of the first exclusive item required to trade for the input. + - name: SwapShopEntryPoint + address: + EU: 0x238C388 + description: |- + Is the entrypoint of the overlay_load_entry, and seems to run once to initiate the Swap Shop. Is not called anywhere else. + Allocates space for swap_shop_menu_data, and initializes many of its fields. + return: Always returns 1. + - name: SwapShopDestructor + address: + EU: 0x238C43C + description: |- + Is the destructor of the overlay_load_entry, and seems to run once on closing the Swap Shop. Is not called anywhere else. + Frees up the allocated space for swap_shop_menu_data if it is not already empty. + - name: SwapShopMainManager + address: + EU: 0x238C468 + description: |- + Called every frame the Croagunk Swap Shop is open, acting as a parent function for the various processes the Swap Shop is responsible for. + Primarily handles displaying dialogue boxes, retrieving menu selections, and contributing updates to the various switch case indices. + Often calls SwapShopDialogueManager, either with an immediate or with the designated next_switch_case value. + + return: Typically returns 1, but seems to return 4 to exit the Swap Shop. Possibly related to the explorerscript output? + - name: CloseTextboxAndSimpleMenu + address: + EU: 0x238D460 + description: Checks both the text_window_id and menu_window_id for -2. If either are not -2, close the textbox/simple menu, and assign the id to -2. + - name: SwapShopPrintCurrentGold + address: + EU: 0x238D4E4 + description: |- + A text box callback function containing the player's current gold, seen on the Swap Shop main menu. + + r0: window_id of the textbox data: - name: SWAP_SHOP_WINDOW_PARAMS_1 address: @@ -22,7 +73,7 @@ overlay21: length: EU: 0x10 NA: 0x10 - description: "Note: unverified, ported from Irdkwia's notes" + description: Used with SwapShopPrintCurrentGold for a simple textbox. - name: SWAP_SHOP_MENU_ITEMS_CONFIRM address: EU: 0x238D578 @@ -32,6 +83,7 @@ overlay21: EU: 0x18 NA: 0x18 JP: 0x18 + description: Used with SWAP_SHOP_WINDOW_PARAMS_7. - name: SWAP_SHOP_SUBMENU_ITEMS_1 address: EU: 0x238D590 @@ -41,6 +93,7 @@ overlay21: EU: 0x18 NA: 0x18 JP: 0x18 + description: Used with SWAP_SHOP_WINDOW_PARAMS_6. - name: SWAP_SHOP_SUBMENU_ITEMS_2 address: EU: 0x238D5A8 @@ -50,6 +103,7 @@ overlay21: EU: 0x20 NA: 0x20 JP: 0x20 + description: Used with SWAP_SHOP_WINDOW_PARAMS_7. - name: SWAP_SHOP_MAIN_MENU_ITEMS_1 address: EU: 0x238D5C8 @@ -59,6 +113,7 @@ overlay21: EU: 0x20 NA: 0x20 JP: 0x20 + description: Used with SWAP_SHOP_WINDOW_PARAMS_6. - name: SWAP_SHOP_MAIN_MENU_ITEMS_2 address: EU: 0x238D5E8 @@ -68,6 +123,7 @@ overlay21: EU: 0x28 NA: 0x28 JP: 0x28 + description: Used alongside SWAP_SHOP_WINDOW_PARAMS_5. - name: SWAP_SHOP_SUBMENU_ITEMS_3 address: EU: 0x238D610 @@ -77,30 +133,35 @@ overlay21: EU: 0x30 NA: 0x30 JP: 0x30 + description: Used alongside SWAP_SHOP_WINDOW_PARAMS_9. - name: OVERLAY21_UNKNOWN_STRING_IDS address: NA: 0x238CB00 + EU: 0x238D640 length: NA: 0x38 - description: "Note: unverified, ported from Irdkwia's notes" + description: Seem to be completely unused by the Swap Shop, but the strings are 1:1 for the ones that are in use elsewhere in the shop. - name: SWAP_SHOP_WINDOW_PARAMS_2 address: NA: 0x238CB38 + EU: 0x238D678 length: NA: 0x10 - description: "Note: unverified, ported from Irdkwia's notes" + description: Seem to be completely unused by the Swap Shop. - name: SWAP_SHOP_WINDOW_PARAMS_3 address: NA: 0x238CB48 + EU: 0x238d6A8 length: NA: 0x10 - description: "Note: unverified, ported from Irdkwia's notes" + description: Seem to be completely unused by the Swap Shop. - name: SWAP_SHOP_WINDOW_PARAMS_4 address: NA: 0x238CB58 + EU: 0x238D698 length: NA: 0x10 - description: "Note: unverified, ported from Irdkwia's notes" + description: Seem to be completely unused by the Swap Shop. - name: SWAP_SHOP_WINDOW_PARAMS_5 address: EU: 0x238D6A8 @@ -109,7 +170,7 @@ overlay21: length: EU: 0x10 NA: 0x10 - description: "Note: unverified, ported from Irdkwia's notes" + description: Used alongside SWAP_SHOP_MAIN_MENU_ITEMS_2. - name: SWAP_SHOP_WINDOW_PARAMS_6 address: EU: 0x238D6B8 @@ -118,7 +179,7 @@ overlay21: length: EU: 0x10 NA: 0x10 - description: "Note: unverified, ported from Irdkwia's notes" + description: Used alongside both SWAP_SHOP_MAIN_MENU_ITEMS_1 and SWAP_SHOP_SUBMENU_ITEMS_1. - name: SWAP_SHOP_WINDOW_PARAMS_7 address: EU: 0x238D6C8 @@ -127,7 +188,7 @@ overlay21: length: EU: 0x10 NA: 0x10 - description: "Note: unverified, ported from Irdkwia's notes" + description: Used alongside both SWAP_SHOP_MENU_ITEMS_CONFIRM and SWAP_SHOP_SUBMENU_ITEMS_2. - name: SWAP_SHOP_WINDOW_PARAMS_8 address: EU: 0x238D6D8 @@ -136,7 +197,7 @@ overlay21: length: EU: 0x10 NA: 0x10 - description: "Note: unverified, ported from Irdkwia's notes" + description: Used alone, seemingly for the exclusive item description window. - name: SWAP_SHOP_WINDOW_PARAMS_9 address: EU: 0x238D6E8 @@ -145,7 +206,181 @@ overlay21: length: EU: 0x10 NA: 0x10 - description: "Note: unverified, ported from Irdkwia's notes" + description: Used alongside SWAP_SHOP_SUBMENU_ITEMS_3. + - name: SWAP_SHOP_DEBUG_STRING_1 + address: + EU: 0x238D6F8 + length: + EU: 0x1D + description: MENU_SYNTHESIS_MODE_START:\n + + - name: SWAP_SHOP_DEBUG_STRING_2 + address: + EU: 0x238D714 + length: + EU: 0x22 + description: MENU_SYNTHESIS_MODE_SELECTMENU:\n + + - name: SWAP_SHOP_DEBUG_STRING_3 + address: + EU: 0x238D738 + length: + EU: 0x1F + description: MENU_SYNTHESIS_MODE_RESTART:\n + + - name: SWAP_SHOP_DEBUG_STRING_4 + address: + EU: 0x238D758 + length: + EU: 0x23 + description: MENU_SYNTHESIS_MODE_EXPLANATION:\n + + - name: SWAP_SHOP_DEBUG_STRING_5 + address: + EU: 0x238D77C + length: + EU: 0x1E + description: MENU_SYNTHESIS_MODE_THANKS:\n + + - name: SWAP_SHOP_DEBUG_STRING_6 + address: + EU: 0x238D79C + length: + EU: 0x20 + description: MENU_SYNTHESIS_MODE_ITEM_NON:\n + + - name: SWAP_SHOP_DEBUG_STRING_7 + address: + EU: 0x238D7BC + length: + EU: 0x1F + description: MENU_SYNTHESIS_MODE_GOLD_NON\n + + - name: SWAP_SHOP_DEBUG_STRING_8 + address: + EU: 0x238D7DC + length: + EU: 0x14 + description: MENU_SYNTHESIS_GOLD + + - name: SWAP_SHOP_DEBUG_STRING_9 + address: + EU: 0x238D800 + length: + EU: 0x23 + description: MENU_SYNTHESIS_MODE_SELECT_FULL:\n + + - name: SWAP_SHOP_DEBUG_STRING_10 + address: + EU: 0x238D824 + length: + EU: 0x1B + description: MENU_SYNTHESIS_MODE_QUIT\n + + - name: SWAP_SHOP_DEBUG_STRING_11 + address: + EU: 0x238D840 + length: + EU: 0x24 + description: MENU_SYNTHESIS_MODE_SELECT_START:\n + + - name: SWAP_SHOP_DEBUG_STRING_12 + address: + EU: 0x238D864 + length: + EU: 0x20 + description: MENU_SYNTHESIS_MODE__RESTART:\n + + - name: SWAP_SHOP_DEBUG_STRING_13 + address: + EU: 0x238D884 + length: + EU: 0x23 + description: MENU_SYNTHESIS_MODE_SELECT_INIT:\n + + - name: SWAP_SHOP_DEBUG_STRING_14 + address: + EU: 0x238D8A8 + length: + EU: 0x25 + description: MENU_SYNTHESIS_MODE_SELECT_SELECT:\n + + - name: SWAP_SHOP_DEBUG_STRING_15 + address: + EU: 0x238D8CC + length: + EU: 0x27 + description: MENU_SYNTHESIS_MODE_SELECT_RESELECT:\n + + - name: SWAP_SHOP_DEBUG_STRING_16 + address: + EU: 0x238D8F4 + length: + EU: 0x29 + description: \tMENU_SYNTHESIS_MODE_SELECT_SUB_MENU:\n + + - name: SWAP_SHOP_DEBUG_STRING_17 + address: + EU: 0x238D91C + length: + EU: 0x23 + description: MENU_SYNTHESIS_MODE_SELECT_EXPLA\n + + - name: SWAP_SHOP_DEBUG_STRING_18 + address: + EU: 0x238D940 + length: + EU: 0x9 + description: "[item:0]" + + - name: SWAP_SHOP_DEBUG_STRING_19 + address: + EU: 0x238D94C + length: + EU: 0x28 + description: MENU_SYNTHESIS_MODE_SELECT_CONFIRM_1:\n + + - name: SWAP_SHOP_DEBUG_STRING_20 + address: + EU: 0x238D974 + length: + EU: 0x16 + description: _SELL_CONFIRM NEW_1\n + + - name: SWAP_SHOP_DEBUG_STRING_21 + address: + EU: 0x238D98C + length: + EU: 0x2C + description: MENU_SYNTHESIS_MODE_SELECT_THANKS_ACTION:\n + + - name: SWAP_SHOP_DEBUG_STRING_22 + address: + EU: 0x238D9B8 + length: + EU: 0x2D + description: MENU_SYNTHESIS_MODE_SELECT_THANKS_ACTION2:\n + + - name: SWAP_SHOP_DEBUG_STRING_23 + address: + EU: 0x238D9E4 + length: + EU: 0x2D + description: MENU_SYNTHESIS_MODE_SELECT_THANKS_ACTION3:\n + + - name: SWAP_SHOP_DEBUG_STRING_24 + address: + EU: 0x238DA10 + length: + EU: 0x27 + description: MENU_SYNTHESIS_MODE_SELECT_THANKS_1:\n + + - name: SWAP_SHOP_DEBUG_STRING_25 + address: + EU: 0x238DA38 + length: + EU: 0x25 + description: MENU_SYNTHESIS_MODE_SELECT_THANKS:\n - name: OVERLAY21_JP_STRING address: EU: 0x238DA5C @@ -153,24 +388,30 @@ overlay21: JP: 0x238E48C length: NA: 0x8 - description: 合成: + description: 合成:(synthesis in Japanese) + - name: SWAP_SHOP_GOLD_STRING + address: + EU: 0x238DA64 + length: + EU: 0x13 + description: "[CS:V][gold:0][CR]" - name: OVERLAY21_RESERVED_SPACE address: NA: 0x238CF38 length: NA: 0x8 description: "Note: unverified, ported from Irdkwia's notes" - - name: OVERLAY21_UNKNOWN_POINTER__NA_238CF40 + - name: SWAP_SHOP_MENU_DATA_PTR address: EU: 0x238DA80 NA: 0x238CF40 JP: 0x238E4C0 length: NA: 0x4 - description: "Note: unverified, ported from Irdkwia's notes" + description: Pointer to the swap_shop_menu_data that governs the operations of most overlay_21 functions. - name: OVERLAY21_UNKNOWN_POINTER__NA_238CF44 address: NA: 0x238CF44 length: NA: 0x4 - description: "Note: unverified, ported from Irdkwia's notes" + description: "Note: unverified, ported from Irdkwia's notes." diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index 0f958e80..ce3c18f5 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -6674,6 +6674,17 @@ overlay29: r2: Pointer to the entity being targeted by the move r1: Move pointer return: True if it makes sense to use the move, false if it would be redundant given the effects it causes and the effects that the target already has. + - name: HasLastUsedMove + address: + EU: 0x23356EC + NA: 0x2334CAC + JP: 0x2336098 + description: |- + Determines whether a monster has used any of its moves on this floor. + This function takes in the monster's move list and checks if any moves have the f_last_used flag set. + + r0: Pointer to the monster's moves. + return: True if the move list has any moves with the f_last_used flag set, false otherwise. - name: GetApparentWeather address: EU: 0x2335748 From b075187ec83669c4c22915b26f08e80cb7f819df Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 02:14:19 -0400 Subject: [PATCH 119/151] Why did everything break???? --- 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 a5e0c2b5..90e85ad8 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -1122,7 +1122,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 GetActorMatchingStorageId(int actor_id); +int GetScriptEntityMatchingStorageId(int actor_id); void SetActorTalkMainAndActorTalkSub(int actor_id_main, int actor_id_sub); void SetActorTalkMain(int actor_id); void SetActorTalkSub(int actor_id); From 4eb5dda12dc5dc81ad76b4c18a0ddf439ac72a80 Mon Sep 17 00:00:00 2001 From: Parker Zhiss <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 02:20:16 -0400 Subject: [PATCH 120/151] Formatting... again.... I was trying to do this earlier, but that seemed to NOT go well... --- headers/types/common/common.h | 16 ++--- headers/types/ground_mode/ground_mode.h | 15 ++-- symbols/overlay11.yml | 1 - symbols/overlay21.yml | 96 ++++++++++--------------- 4 files changed, 53 insertions(+), 75 deletions(-) diff --git a/headers/types/common/common.h b/headers/types/common/common.h index d48e3d5d..71a17909 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -766,8 +766,9 @@ struct monster_synth_data { ASSERT_SIZE(struct monster_synth_data, 28); struct type_synth_data { - // 0x0: A bitfield of which types have species exclusive items. - // Presumably for determining type-specific exclusive items? Croagunk doesn't sell these... + // 0x0: A list of which pokemon types can have exclusive items. + // For determining applicability of type-specific exclusive items. + // Croagunk doesn't sell these, because no templates for type-specific items are present. bool type_is_available[20]; }; ASSERT_SIZE(struct type_synth_data, 20); @@ -781,10 +782,11 @@ ASSERT_SIZE(struct baby_exclusive_item_pair, 4); struct synth_template { // 0x0: Item ID of the exclusive item. struct item_id_16 exc_item_id; - // 0x2: Number of items that need to be traded to Croagunk for that item. + // 0x2: The individual weight for the item to be selected. + int16_t item_weight; + // 0x4: Number of items required to trade for that item in the shop. Seems to match even for + // items with specific requirements. int16_t num_to_trade; - // 0x4: Likely weights for the items to be rolled in the Swap Shop. - int16_t weights_perhaps; // 0x6: Minimum $SCENARIO_BALANCE_FLAG value for it to spawn. // Only used for the Water Float (6) and the Phione/Manaphy items (7). int16_t min_balance_flag; @@ -793,9 +795,8 @@ ASSERT_SIZE(struct synth_template, 8); // Structure of SYNTH/synth.bin file, which is used for the Croagunk Swap Shop. struct synth_file { - struct synth_template synth_templates[780]; // The last 4 templates appear to be empty, with 0 weight. - struct synth_template unused_templates[4]; + struct synth_template synth_templates[784]; }; ASSERT_SIZE(struct synth_file, 6272); @@ -1361,5 +1362,4 @@ struct monster_file_contents { struct monster_data_table table; // 0x8: The main contents of the data table. }; ASSERT_SIZE(struct monster_file_contents, 78548); - #endif diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index 3494430a..dd813754 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -654,7 +654,8 @@ struct swap_shop_menu_data { undefined field_0x15; undefined field_0x16; undefined field_0x17; - // 0x18: While selecting which items to give croagunk, this field is filled when selecting "info" on an item in the list. + // 0x18: While selecting which items to give croagunk, this field is filled when selecting + // "info" on an item in the list. struct bulk_item described_item; // 0x1C: Whenever a simple menu is run, this field is where the result is stored. int32_t simple_menu_result; @@ -716,9 +717,10 @@ struct swap_shop_inventory_ptrs { ASSERT_SIZE(struct swap_shop_inventory_ptrs, 8); struct exc_item_trade_slot { - // 0x0: The trade type the item slot uses. + // 0x0: The trade type the item slot uses. int16_t trade_type; - // 0x2: This is likely either the item_id of the slot, or the index of the slot. It might vary depending on the trade_type. + // 0x2: This is likely either the item_id of the slot, or the index of the slot. It might vary + // depending on the trade_type. int16_t unk_0x2; // 0x4: If the player has enough exclusive items to swap for the item, this will be true. bool can_afford_item; @@ -738,7 +740,7 @@ struct swap_shop_inventory_data { // 0x14E4: Seems to be a window_id for a collection menu. int8_t collection_menu_window_id; undefined field_0x14e5; - // 0x14E6: Seems to be a struct for each item in the shop. + // 0x14E6: Seems to be a struct for each item in the shop. struct exc_item_trade_slot exc_item_trade_slots[1068]; // 0x2DEE: For each item in the swap list, is the number of that item available? int16_t item_quantities[1068]; @@ -763,8 +765,9 @@ struct swap_shop_inventory_data { undefined field_0x46c7; // 0x46C8 int32_t textbox_window_id; - struct text_box * textbox_ptr; - // 0x46D0: The item ID the player selects when choosing items to give croagunk. Used to check the item info. + struct text_box* textbox_ptr; + // 0x46D0: The item ID the player selects when choosing items to give croagunk. Used to check + // the item info. struct item_id_16 selected_item_id; undefined field_0x46d2; undefined field_0x46d3; diff --git a/symbols/overlay11.yml b/symbols/overlay11.yml index cb1f4934..87a8e609 100644 --- a/symbols/overlay11.yml +++ b/symbols/overlay11.yml @@ -1,4 +1,3 @@ - overlay11: versions: - EU diff --git a/symbols/overlay21.yml b/symbols/overlay21.yml index dc50bcdc..8527a3b0 100644 --- a/symbols/overlay21.yml +++ b/symbols/overlay21.yml @@ -24,7 +24,7 @@ overlay21: r0: New current_switch_case value. - name: GetFirstExclusivePrerequisite address: - EU: 0x0238C320 + EU: 0x238C320 description: |- Retrieves the item ID of the first item needed to trade for the specified item. There are hardcoded exceptions for the Eeveelution/Hitmontrio items, but outside of that, the output will be as follows. @@ -43,7 +43,7 @@ overlay21: EU: 0x238C43C description: |- Is the destructor of the overlay_load_entry, and seems to run once on closing the Swap Shop. Is not called anywhere else. - Frees up the allocated space for swap_shop_menu_data if it is not already empty. + Frees up the allocated space for swap_shop_menu_data if it is not already empty. - name: SwapShopMainManager address: EU: 0x238C468 @@ -56,7 +56,7 @@ overlay21: - name: CloseTextboxAndSimpleMenu address: EU: 0x238D460 - description: Checks both the text_window_id and menu_window_id for -2. If either are not -2, close the textbox/simple menu, and assign the id to -2. + description: "Checks both the text_window_id and menu_window_id for -2. If either are not -2, close the textbox/simple menu, and assign the id to -2." - name: SwapShopPrintCurrentGold address: EU: 0x238D4E4 @@ -136,29 +136,29 @@ overlay21: description: Used alongside SWAP_SHOP_WINDOW_PARAMS_9. - name: OVERLAY21_UNKNOWN_STRING_IDS address: - NA: 0x238CB00 EU: 0x238D640 + NA: 0x238CB00 length: NA: 0x38 - description: Seem to be completely unused by the Swap Shop, but the strings are 1:1 for the ones that are in use elsewhere in the shop. + description: "Seem to be completely unused by the Swap Shop, but the strings are 1:1 for the ones that are in use elsewhere in the shop." - name: SWAP_SHOP_WINDOW_PARAMS_2 address: - NA: 0x238CB38 EU: 0x238D678 + NA: 0x238CB38 length: NA: 0x10 description: Seem to be completely unused by the Swap Shop. - - name: SWAP_SHOP_WINDOW_PARAMS_3 + - name: SWAP_SHOP_WINDOW_PARAMS_4 address: - NA: 0x238CB48 - EU: 0x238d6A8 + EU: 0x238D698 + NA: 0x238CB58 length: NA: 0x10 description: Seem to be completely unused by the Swap Shop. - - name: SWAP_SHOP_WINDOW_PARAMS_4 + - name: SWAP_SHOP_WINDOW_PARAMS_3 address: - NA: 0x238CB58 - EU: 0x238D698 + EU: 0x238D6A8 + NA: 0x238CB48 length: NA: 0x10 description: Seem to be completely unused by the Swap Shop. @@ -197,7 +197,7 @@ overlay21: length: EU: 0x10 NA: 0x10 - description: Used alone, seemingly for the exclusive item description window. + description: "Used alone, seemingly for the exclusive item description window." - name: SWAP_SHOP_WINDOW_PARAMS_9 address: EU: 0x238D6E8 @@ -212,175 +212,151 @@ overlay21: EU: 0x238D6F8 length: EU: 0x1D - description: MENU_SYNTHESIS_MODE_START:\n - + description: "MENU_SYNTHESIS_MODE_START:\\n" - name: SWAP_SHOP_DEBUG_STRING_2 address: EU: 0x238D714 length: EU: 0x22 - description: MENU_SYNTHESIS_MODE_SELECTMENU:\n - + description: "MENU_SYNTHESIS_MODE_SELECTMENU:\\n" - name: SWAP_SHOP_DEBUG_STRING_3 address: EU: 0x238D738 length: EU: 0x1F - description: MENU_SYNTHESIS_MODE_RESTART:\n - + description: "MENU_SYNTHESIS_MODE_RESTART:\\n" - name: SWAP_SHOP_DEBUG_STRING_4 address: EU: 0x238D758 length: EU: 0x23 - description: MENU_SYNTHESIS_MODE_EXPLANATION:\n - + description: "MENU_SYNTHESIS_MODE_EXPLANATION:\\n" - name: SWAP_SHOP_DEBUG_STRING_5 address: EU: 0x238D77C length: EU: 0x1E - description: MENU_SYNTHESIS_MODE_THANKS:\n - + description: "MENU_SYNTHESIS_MODE_THANKS:\\n" - name: SWAP_SHOP_DEBUG_STRING_6 address: EU: 0x238D79C length: EU: 0x20 - description: MENU_SYNTHESIS_MODE_ITEM_NON:\n - + description: "MENU_SYNTHESIS_MODE_ITEM_NON:\\n" - name: SWAP_SHOP_DEBUG_STRING_7 address: EU: 0x238D7BC length: EU: 0x1F - description: MENU_SYNTHESIS_MODE_GOLD_NON\n - + description: "MENU_SYNTHESIS_MODE_GOLD_NON\\n" - name: SWAP_SHOP_DEBUG_STRING_8 address: EU: 0x238D7DC length: EU: 0x14 description: MENU_SYNTHESIS_GOLD - - name: SWAP_SHOP_DEBUG_STRING_9 address: EU: 0x238D800 length: EU: 0x23 - description: MENU_SYNTHESIS_MODE_SELECT_FULL:\n - + description: "MENU_SYNTHESIS_MODE_SELECT_FULL:\\n" - name: SWAP_SHOP_DEBUG_STRING_10 address: EU: 0x238D824 length: EU: 0x1B - description: MENU_SYNTHESIS_MODE_QUIT\n - + description: "MENU_SYNTHESIS_MODE_QUIT\\n" - name: SWAP_SHOP_DEBUG_STRING_11 address: EU: 0x238D840 length: EU: 0x24 - description: MENU_SYNTHESIS_MODE_SELECT_START:\n - + description: "MENU_SYNTHESIS_MODE_SELECT_START:\\n" - name: SWAP_SHOP_DEBUG_STRING_12 address: EU: 0x238D864 length: EU: 0x20 - description: MENU_SYNTHESIS_MODE__RESTART:\n - + description: "MENU_SYNTHESIS_MODE__RESTART:\\n" - name: SWAP_SHOP_DEBUG_STRING_13 address: EU: 0x238D884 length: EU: 0x23 - description: MENU_SYNTHESIS_MODE_SELECT_INIT:\n - + description: "MENU_SYNTHESIS_MODE_SELECT_INIT:\\n" - name: SWAP_SHOP_DEBUG_STRING_14 address: EU: 0x238D8A8 length: EU: 0x25 - description: MENU_SYNTHESIS_MODE_SELECT_SELECT:\n - + description: "MENU_SYNTHESIS_MODE_SELECT_SELECT:\\n" - name: SWAP_SHOP_DEBUG_STRING_15 address: EU: 0x238D8CC length: EU: 0x27 - description: MENU_SYNTHESIS_MODE_SELECT_RESELECT:\n - + description: "MENU_SYNTHESIS_MODE_SELECT_RESELECT:\\n" - name: SWAP_SHOP_DEBUG_STRING_16 address: EU: 0x238D8F4 length: EU: 0x29 - description: \tMENU_SYNTHESIS_MODE_SELECT_SUB_MENU:\n - + description: "\\tMENU_SYNTHESIS_MODE_SELECT_SUB_MENU:\\n" - name: SWAP_SHOP_DEBUG_STRING_17 address: EU: 0x238D91C length: EU: 0x23 - description: MENU_SYNTHESIS_MODE_SELECT_EXPLA\n - + description: "MENU_SYNTHESIS_MODE_SELECT_EXPLA\\n" - name: SWAP_SHOP_DEBUG_STRING_18 address: EU: 0x238D940 length: EU: 0x9 description: "[item:0]" - - name: SWAP_SHOP_DEBUG_STRING_19 address: EU: 0x238D94C length: EU: 0x28 - description: MENU_SYNTHESIS_MODE_SELECT_CONFIRM_1:\n - + description: "MENU_SYNTHESIS_MODE_SELECT_CONFIRM_1:\\n" - name: SWAP_SHOP_DEBUG_STRING_20 address: EU: 0x238D974 length: EU: 0x16 - description: _SELL_CONFIRM NEW_1\n - + description: "_SELL_CONFIRM NEW_1\\n" - name: SWAP_SHOP_DEBUG_STRING_21 address: EU: 0x238D98C length: EU: 0x2C - description: MENU_SYNTHESIS_MODE_SELECT_THANKS_ACTION:\n - + description: "MENU_SYNTHESIS_MODE_SELECT_THANKS_ACTION:\\n" - name: SWAP_SHOP_DEBUG_STRING_22 address: EU: 0x238D9B8 length: EU: 0x2D - description: MENU_SYNTHESIS_MODE_SELECT_THANKS_ACTION2:\n - + description: "MENU_SYNTHESIS_MODE_SELECT_THANKS_ACTION2:\\n" - name: SWAP_SHOP_DEBUG_STRING_23 address: EU: 0x238D9E4 length: EU: 0x2D - description: MENU_SYNTHESIS_MODE_SELECT_THANKS_ACTION3:\n - + description: "MENU_SYNTHESIS_MODE_SELECT_THANKS_ACTION3:\\n" - name: SWAP_SHOP_DEBUG_STRING_24 address: EU: 0x238DA10 length: EU: 0x27 - description: MENU_SYNTHESIS_MODE_SELECT_THANKS_1:\n - + description: "MENU_SYNTHESIS_MODE_SELECT_THANKS_1:\\n" - name: SWAP_SHOP_DEBUG_STRING_25 address: EU: 0x238DA38 length: EU: 0x25 - description: MENU_SYNTHESIS_MODE_SELECT_THANKS:\n + description: "MENU_SYNTHESIS_MODE_SELECT_THANKS:\\n" - name: OVERLAY21_JP_STRING address: EU: 0x238DA5C From 4f1887889d191924a7518aebed8df5400720e1b1 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 02:24:47 -0400 Subject: [PATCH 121/151] Update overlay21.yml --- symbols/overlay21.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/symbols/overlay21.yml b/symbols/overlay21.yml index 8527a3b0..a163f53a 100644 --- a/symbols/overlay21.yml +++ b/symbols/overlay21.yml @@ -148,17 +148,17 @@ overlay21: length: NA: 0x10 description: Seem to be completely unused by the Swap Shop. - - name: SWAP_SHOP_WINDOW_PARAMS_4 + - name: SWAP_SHOP_WINDOW_PARAMS_3 address: - EU: 0x238D698 - NA: 0x238CB58 + EU: 0x238D688 + NA: 0x238CB48 length: NA: 0x10 description: Seem to be completely unused by the Swap Shop. - - name: SWAP_SHOP_WINDOW_PARAMS_3 + - name: SWAP_SHOP_WINDOW_PARAMS_4 address: - EU: 0x238D6A8 - NA: 0x238CB48 + EU: 0x238D698 + NA: 0x238CB58 length: NA: 0x10 description: Seem to be completely unused by the Swap Shop. From f8378a7361bda0b5a008e3fac9fdd2166f8cf786 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 13:35:56 -0400 Subject: [PATCH 122/151] Apply suggestions from code review Co-authored-by: UsernameFodder <93669634+UsernameFodder@users.noreply.github.com> --- headers/functions/overlay21.h | 3 ++- headers/types/ground_mode/ground_mode.h | 2 +- symbols/overlay21.yml | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/headers/functions/overlay21.h b/headers/functions/overlay21.h index 5d9df4e5..d970b707 100644 --- a/headers/functions/overlay21.h +++ b/headers/functions/overlay21.h @@ -2,10 +2,11 @@ #define HEADERS_FUNCTIONS_OVERLAY21_H_ void SwapShopDialogueManager(int current_switch_case); -struct item_id GetFirstExclusivePrerequisite(struct item_id); +enum item_id GetFirstExclusivePrerequisite(enum item_id item_id); int SwapShopEntryPoint(void); void SwapShopDestructor(void); void SwapShopMainManager(void); void CloseTextboxAndSimpleMenu(void); void SwapShopPrintCurrentGold(int window_id); + #endif diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index dd813754..a3e3b40c 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -768,7 +768,7 @@ struct swap_shop_inventory_data { struct text_box* textbox_ptr; // 0x46D0: The item ID the player selects when choosing items to give croagunk. Used to check // the item info. - struct item_id_16 selected_item_id; + struct item_id_16 selected_item; undefined field_0x46d2; undefined field_0x46d3; }; diff --git a/symbols/overlay21.yml b/symbols/overlay21.yml index a163f53a..ceb1fb67 100644 --- a/symbols/overlay21.yml +++ b/symbols/overlay21.yml @@ -29,6 +29,7 @@ overlay21: Retrieves the item ID of the first item needed to trade for the specified item. There are hardcoded exceptions for the Eeveelution/Hitmontrio items, but outside of that, the output will be as follows. output_id = input_id - ((input_id - 0x1FA) % 4) + r0: item ID of the exclusive item to be checked. return: item ID of the first exclusive item required to trade for the input. - name: SwapShopEntryPoint @@ -37,6 +38,7 @@ overlay21: description: |- Is the entrypoint of the overlay_load_entry, and seems to run once to initiate the Swap Shop. Is not called anywhere else. Allocates space for swap_shop_menu_data, and initializes many of its fields. + return: Always returns 1. - name: SwapShopDestructor address: @@ -44,6 +46,8 @@ overlay21: description: |- Is the destructor of the overlay_load_entry, and seems to run once on closing the Swap Shop. Is not called anywhere else. Frees up the allocated space for swap_shop_menu_data if it is not already empty. + + No params. - name: SwapShopMainManager address: EU: 0x238C468 From 98eebfa3d48942eec414f137eb87eaef7db641de Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 13:37:06 -0400 Subject: [PATCH 123/151] Update overlay21.h --- headers/data/overlay21.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/headers/data/overlay21.h b/headers/data/overlay21.h index b4d2f2cf..ee32a037 100644 --- a/headers/data/overlay21.h +++ b/headers/data/overlay21.h @@ -42,9 +42,10 @@ extern char SWAP_SHOP_DEBUG_STRING_22[44]; extern char SWAP_SHOP_DEBUG_STRING_23[44]; extern char SWAP_SHOP_DEBUG_STRING_24[38]; extern char SWAP_SHOP_DEBUG_STRING_25[36]; -extern int16_t OVERLAY21_JP_STRING[3]; +extern wchar_t OVERLAY21_JP_STRING[3]; extern char SWAP_SHOP_GOLD_STRING[18]; extern undefined OVERLAY21_RESERVED_SPACE[8]; extern struct swap_shop_menu_data* SWAP_SHOP_MENU_DATA_PTR; extern undefined* OVERLAY21_UNKNOWN_POINTER__NA_238CF44; + #endif From 9f55be9399c0d8d0ac2a4f137359c207edbca691 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 13:41:12 -0400 Subject: [PATCH 124/151] Update arm9.h --- headers/functions/arm9.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 90e85ad8..7393a84a 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -196,7 +196,7 @@ enum move_id GetItemMoveId(enum item_id item_id); bool TestItemAiFlag(enum item_id item_id, enum item_flag flag); bool IsItemInTimeDarkness(enum item_id item_id); bool IsItemValidVeneer(enum item_id item_id); -struct item_id_16 ReturnEggExclusiveItem(struct monster_id_16); +enum item_id ReturnEggExclusiveItem(enum monster_id monster_id); void SetActiveInventoryToMain(void); void AllInventoriesZInit(void); void SpecialEpisodeInventoryZInit(void); @@ -321,8 +321,8 @@ void ApplyGummiBoostsGroundMode(struct monster_id_16* monster_id, uint16_t* mons bool LoadSynthBin(void); void CloseSynthBin(void); bool GenerateCroagunkItems(void); -struct synth_template* GetSynthItem(struct item_id_16 exclusive_item); -bool GetValidSynthsForSpecies(struct monster_id_16 monster_id, +struct synth_template* GetSynthItem(enum item_id exclusive_item); +bool GetValidSynthsForSpecies(enum monster_id monster_id, struct monster_synth_data* monster_synth_data, struct type_synth_data* type_synth_data); void LoadWazaP(void); @@ -546,7 +546,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); @@ -1122,10 +1122,12 @@ 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 GetScriptEntityMatchingStorageId(int actor_id); -void SetActorTalkMainAndActorTalkSub(int actor_id_main, int actor_id_sub); -void SetActorTalkMain(int actor_id); -void SetActorTalkSub(int actor_id); +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 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); From 03ac86aaa7d8ccd8e40c1c68492c9843be171834 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 13:43:51 -0400 Subject: [PATCH 125/151] Update overlay21.h --- headers/functions/overlay21.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/functions/overlay21.h b/headers/functions/overlay21.h index d970b707..47b3a20f 100644 --- a/headers/functions/overlay21.h +++ b/headers/functions/overlay21.h @@ -5,7 +5,7 @@ void SwapShopDialogueManager(int current_switch_case); enum item_id GetFirstExclusivePrerequisite(enum item_id item_id); int SwapShopEntryPoint(void); void SwapShopDestructor(void); -void SwapShopMainManager(void); +int SwapShopMainManager(void); void CloseTextboxAndSimpleMenu(void); void SwapShopPrintCurrentGold(int window_id); From 00a24b6c988280b17ace84604ed124000ba1c0c7 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 13:46:15 -0400 Subject: [PATCH 126/151] Update common.h --- 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 71a17909..bdf9343d 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -782,7 +782,7 @@ ASSERT_SIZE(struct baby_exclusive_item_pair, 4); struct synth_template { // 0x0: Item ID of the exclusive item. struct item_id_16 exc_item_id; - // 0x2: The individual weight for the item to be selected. + // 0x2: Weight for that item to appear in the swap shop. int16_t item_weight; // 0x4: Number of items required to trade for that item in the shop. Seems to match even for // items with specific requirements. @@ -1362,4 +1362,5 @@ struct monster_file_contents { struct monster_data_table table; // 0x8: The main contents of the data table. }; ASSERT_SIZE(struct monster_file_contents, 78548); + #endif From b98b9b2fa9a601460731013eb9fb9f48f990fed7 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 13:49:31 -0400 Subject: [PATCH 127/151] Update enums.h --- headers/types/common/enums.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/headers/types/common/enums.h b/headers/types/common/enums.h index 6f773954..1edf8739 100644 --- a/headers/types/common/enums.h +++ b/headers/types/common/enums.h @@ -3974,7 +3974,7 @@ enum mission_template_item_case { ITEM_CASE_SPECIFIC_ITEM = 1, // mission_template_item_data_1 and mission_template_item_data_2 are indices to a table ITEM_CASE_TABLE_AVAILABLE_ITEM = 2, - // similar to ITEM_CASE_TABLE_ITEM, but without a check for availability. Unused in template. + // similar to ITEM_CASE_TABLE_AVAILABLE_ITEM, but without a check for availability. Unused in template. ITEM_CASE_TABLE_ITEM = 3, // mission_template_item_data_1 and mission_template_item_data_2 are ignored. Instead, pulls // from @@ -4243,6 +4243,15 @@ enum stairs_type { STAIRS_TYPE_HIDDEN = 3, }; +enum talk_type { + TALK_TYPE_HEALTHY = 0, + TALK_TYPE_HALF_LIFE = 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) From 129be4d3dd170da47e09bc647ba5f4e0c0c29ad0 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 13:53:46 -0400 Subject: [PATCH 128/151] Update ground_mode.h --- headers/types/ground_mode/ground_mode.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index a3e3b40c..9ead8fe1 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -664,7 +664,7 @@ struct swap_shop_menu_data { // 0x24: Zeroed in SwapShopEntryPoint, but never modified undefined4 unk_int_2; // 0x28: Emotion for croagunk's portrait. - int32_t emotion_id; + enum portrait_emotion emotion_id; // 0x2C: The case menu for a smaller switch case at the top of SwapShopMainManager. int32_t window_manager_case; // 0x30: Stores preprocessor_args for the next window. @@ -690,11 +690,11 @@ struct swap_shop_menu_data { // 0xDA: The number of exclusive items currently in the bag. int16_t exc_bag_item_count; // 0xDC: The individual item IDs of the exclusive items present in the bag. - struct item_id_16 exc_bag_item_ids[50]; + struct item_id_16 exc_bag_items[50]; // 0x140: The number of exclusive items currently in storage. int16_t exc_storage_item_count; // 0x142: The individual item IDs of the exclusive items in storage. - struct item_id_16 exc_storage_item_ids[1000]; + struct item_id_16 exc_storage_items[1000]; undefined field_0x912; undefined field_0x913; // 0x914: The team member slot whose exclusive items are about to be viewed. @@ -734,7 +734,7 @@ struct swap_shop_inventory_data { // 0x4: A copy of num_valid_shop_items to be used by CreateCollectionMenu? int32_t num_valid_shop_items_temp; // 0x8: Seemingly unused, these are zeroed for some reason? - int32_t mystery_ints[1068]; + int32_t field_0x8[1068]; // 0x10B8: If the item is purchasable, this field will be 0x2. Otherwise, it will be 0x0. int8_t is_item_purchasable[1068]; // 0x14E4: Seems to be a window_id for a collection menu. @@ -757,7 +757,7 @@ struct swap_shop_inventory_data { undefined field_0x462a; undefined field_0x462b; // 0x462C - struct window_extra_info window_extra_info_ptr; + struct window_extra_info window_extra_info; // 0x46C4: Whether or not the synth.bin file is open. bool synth_bin_open; undefined field_0x46c5; From c832618ff91baf8ecd12bcd5e90af2773f5c51f1 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 14:02:15 -0400 Subject: [PATCH 129/151] Update overlay21.yml --- symbols/overlay21.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/symbols/overlay21.yml b/symbols/overlay21.yml index ceb1fb67..bd0a6a02 100644 --- a/symbols/overlay21.yml +++ b/symbols/overlay21.yml @@ -60,7 +60,10 @@ overlay21: - name: CloseTextboxAndSimpleMenu address: EU: 0x238D460 - description: "Checks both the text_window_id and menu_window_id for -2. If either are not -2, close the textbox/simple menu, and assign the id to -2." + description: |- + Checks both the text_window_id and menu_window_id for -2. If either are not -2, close the textbox/simple menu, and assign the id to -2. + + No params. - name: SwapShopPrintCurrentGold address: EU: 0x238D4E4 @@ -394,4 +397,4 @@ overlay21: NA: 0x238CF44 length: NA: 0x4 - description: "Note: unverified, ported from Irdkwia's notes." + description: "Note: unverified, ported from Irdkwia's notes" From bef3a7e3345644df728b61393af213e85745098f Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 17:07:18 -0400 Subject: [PATCH 130/151] Update enums.h --- headers/types/ground_mode/enums.h | 93 +++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) diff --git a/headers/types/ground_mode/enums.h b/headers/types/ground_mode/enums.h index 4a36955a..4755a8fd 100644 --- a/headers/types/ground_mode/enums.h +++ b/headers/types/ground_mode/enums.h @@ -2116,6 +2116,99 @@ enum script_routine_kind { ENUM_16_BIT(script_routine_kind); #pragma pack(pop) + +enum swap_shop_shared_case { + SWAP_SHARED_CASE_TALK_WELCOME = 0, + SWAP_SHARED_CASE_TALK_CONTINUE_SWAP = 1, + SWAP_SHARED_CASE_TALK_WHAT_INFO = 2, + SWAP_SHARED_CASE_TALK_COME_AGAIN = 3, + SWAP_SHARED_CASE_CLOSE_SHOP = 4, + SWAP_SHARED_CASE_TALK_LACKING_SWAP_ITEMS = 5, + SWAP_SHARED_CASE_TALK_SWAP_BROKE = 6, + SWAP_SHARED_CASE_TALK_SWAP_POOR = 7, + // Seems to be an identical copy of SWAP_SHARED_CASE_TALK_SEND_TO_STORAGE. + // Perhaps this was once intended for trying to swap with a full storage, which is impossible by design. + SWAP_SHARED_CASE_UNK_0x8 = 8, + SWAP_SHARED_CASE_TALK_WHAT_ITEMS = 9, + SWAP_SHARED_CASE_TALK_VALUABLE_SWAP = 10, + SWAP_SHARED_CASE_INIT_SWAP_ITEMS_MENU = 11, + SWAP_SHARED_CASE_SWAP_ITEMS_MENU = 12, + SWAP_SHARED_CASE_RETURN_SWAP_ITEMS_MENU = 13, + SWAP_SHARED_CASE_SELECT_SWAP_ITEM_OPTIONS = 14, + SWAP_SHARED_CASE_SWAP_ITEM_GET_INFO = 15, + SWAP_SHARED_CASE_TALK_CONFIRM_SWAP = 16, + SWAP_SHARED_CASE_DO_SWAP_THEN_TALK = 17, + SWAP_SHARED_CASE_INIT_SCRIPT_ACTION_1 = 18, + SWAP_SHARED_CASE_INIT_SCRIPT_ACTION_2 = 19, + SWAP_SHARED_CASE_INIT_SCRIPT_ACTION_3 = 20, + SWAP_SHARED_CASE_TEXT_PUT_IN_CAULDRON = 21, + SWAP_SHARED_CASE_TALK_WHAT_WOAH = 22, + SWAP_SHARED_CASE_TALK_SUCCESSFUL_SWAP = 23, + SWAP_SHARED_CASE_TEXT_RECEIVE_SWAP_ITEM = 24, + SWAP_SHARED_CASE_TALK_SEND_TO_STORAGE = 25, + SWAP_SHARED_CASE_CLOSE_DIALOGUE_BOX = 26, + SWAP_SHARED_CASE_MAIN_MENU_OPTIONS = 27, + SWAP_SHARED_CASE_SWAP_CANCELLED = 28, + SWAP_SHARED_CASE_UNK_0x1D = 29, + SWAP_SHARED_CASE_CONFIRM_CHOICE = 30, + SWAP_SHARED_CASE_SWAP_DENIED = 31, + SWAP_SHARED_CASE_TALK_SUBINFO_TRADE_2 = 32, + SWAP_SHARED_CASE_SUBINFO_OPTIONS = 33, + SWAP_SHARED_CASE_TALK_SUBINFO_TRADE_1 = 34, + SWAP_SHARED_CASE_TALK_SUBINFO_LIST = 35, + SWAP_SHARED_CASE_TALK_VIEW_WHOSE_LIST = 36, + SWAP_SHARED_CASE_WHOSE_LIST_OPTIONS = 37, + SWAP_SHARED_CASE_WHOSE_LIST_SUBOPTIONS = 38, + SWAP_SHARED_CASE_CLOSE_LIST_SUBOPTIONS = 39, + SWAP_SHARED_CASE_SHOW_SPECIES_SUMMARY = 40, + SWAP_SHARED_CASE_CLOSE_SPECIES_SUMMARY = 41, + SWAP_SHARED_CASE_SHOW_SPECIES_MOVES = 42, + SWAP_SHARED_CASE_CLOSE_SPECIES_MOVES = 43, + SWAP_SHARED_CASE_SHOW_SPECIES_MOVE_INFO = 44, + SWAP_SHARED_CASE_RETURN_SPECIES_MOVES = 45, + SWAP_SHARED_CASE_SHOW_SPECIES_IQ = 46, + SWAP_SHARED_CASE_CLOSE_SPECIES_IQ = 47, + SWAP_SHARED_CASE_TALK_LIST_SPECIES_CAN_USE = 48, + SWAP_SHARED_CASE_INIT_SPECIES_LIST = 49, + SWAP_SHARED_CASE_CLOSE_SPECIES_LIST = 50, + SWAP_SHARED_CASE_SPECIES_LIST_ITEM_OPTIONS = 51, + SWAP_SHARED_CASE_SPECIES_LIST_ITEM_INFO = 52, + SWAP_SHARED_CASE_TALK_CANCEL_SPECIES_ITEM_LIST = 53, + SWAP_SHARED_CASE_TALK_SEE_OTHER_LISTS = 54, + SWAP_SHARED_CASE_SEE_OTHER_LIST_OPTIONS = 55, + SWAP_SHARED_CASE_TALK_NOBODY_TO_TRADE_WITH = 56, + SWAP_SHARED_CASE_TALK_WHICH_ITEMS_IN_RETURN = 57, + SWAP_SHARED_CASE_INIT_TRADE_AWAY_LIST = 58, + SWAP_SHARED_CASE_RESUME_TRADE_AWAY_LIST = 59, + SWAP_SHARED_CASE_CLOSE_TRADE_AWAY_ITEM_LIST = 60, + SWAP_SHARED_CASE_CLOSE_TRADE_AWAY_ITEM_LIST_INFO = 61, + SWAP_SHARED_CASE_TRADE_AWAY_LIST_ITEM_OPTIONS = 62, + SWAP_SHARED_CASE_SHOW_TRADE_AWAY_LIST_ITEM_INFO = 63, + SWAP_SHARED_CASE_TALK_CANCEL_TRADE_AWAY_ITEM_LIST = 64, + SWAP_SHARED_CASE_INIT_SWAP_SHOP = 65, + SWAP_SHARED_CASE_UNK_0x42 = 66, + SWAP_SHARED_CASE_UNK_0x43 = 67, +}; +// Used exclusively by SwapShopMainManager. +enum swap_shop_main_manager_case { + SWAP_MAIN_CASE_ENTRY_POINT = 0, // Assigned by SwapShopEntryPoint. Seems to set the script output case to 0, perhaps resetting it? + SWAP_MAIN_CASE_USE_SHARED_CASE = 1, // Will navigate to the shared_case-specific index. + SWAP_MAIN_CASE_CLOSE_PORTRAIT_AND_TEXTBOX = 2, // Subsequently sets the case to SWAP_MAIN_CASE_EXIT_SWAP_SHOP + SWAP_MAIN_CASE_EXIT_SWAP_SHOP = 3, // Also sets the script output case to -1. + SWAP_MAIN_CASE_RUN_SCRIPT_ACTION = 4, // Called after each script action, and the entry point. Possibly enables the script to run? + SWAP_MAIN_CASE_UNK_0x5 = 5, // Always returns 1. Seems unused. + SWAP_MAIN_CASE_SET_SCRIPT_ACTION_1 = 6, // Sets script output to 1, allowing croagunk to turn towards the cauldron. + SWAP_MAIN_CASE_SET_SCRIPT_ACTION_2 = 7, // Sets script output to 2, causing flashing lights and earthquake effects + SWAP_MAIN_CASE_SET_SCRIPT_ACTION_3 = 8, // Sets script output to 3, causing croagunk to turn towards the player. +}; + +enum swap_shop_inventory_case { + SWAP_INV_CASE_SHOP_ITEMS = 0, + SWAP_INV_CASE_UNK_0x1 = 1, + SWAP_INV_CASE_SPECIES_EXC_ITEM_LIST = 2, + SWAP_INV_CASE_CHOOSE_TRADE_AWAY_ITEMS_LIST = 3, +}; + // These are super long, so split them out into a separate file #include "version_dep_enums.h" From e51668d93a6607fc1c0103eca970c88ff2121db6 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 17:07:37 -0400 Subject: [PATCH 131/151] Update ground_mode.h --- headers/types/ground_mode/ground_mode.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/headers/types/ground_mode/ground_mode.h b/headers/types/ground_mode/ground_mode.h index 9ead8fe1..9aa51606 100644 --- a/headers/types/ground_mode/ground_mode.h +++ b/headers/types/ground_mode/ground_mode.h @@ -638,9 +638,9 @@ ASSERT_SIZE(struct ground_entity_function_table, 80); struct swap_shop_menu_data { // 0x0: The switch case index shared by SwapShopMainManager and SwapShopDialogueManager. - int32_t shared_switch_case; + enum swap_shop_shared_case current_shared_case; // 0x4: The "next" switch case index to be shared, typically assigned by SwapShopMainManager. - int32_t next_switch_case; + enum swap_shop_shared_case next_shared_case; // 0x8: Used exclusively by SwapShopMainManager. More research needed. int32_t unk_windows_counter; // 0xC: If true, croagunk will not ask the player if they want to continue swapping. @@ -666,7 +666,7 @@ struct swap_shop_menu_data { // 0x28: Emotion for croagunk's portrait. enum portrait_emotion emotion_id; // 0x2C: The case menu for a smaller switch case at the top of SwapShopMainManager. - int32_t window_manager_case; + enum swap_shop_main_manager_case main_manager_case; // 0x30: Stores preprocessor_args for the next window. struct preprocessor_args preprocessor_args; // 0x80: The window_id of the current dialogue box window. -2 if none are present. @@ -730,7 +730,7 @@ ASSERT_SIZE(struct exc_item_trade_slot, 6); struct swap_shop_inventory_data { // 0x0: switch case id for SwapShopInventoryManager - int32_t inventory_case_id; + enum swap_shop_inventory_case inventory_case; // 0x4: A copy of num_valid_shop_items to be used by CreateCollectionMenu? int32_t num_valid_shop_items_temp; // 0x8: Seemingly unused, these are zeroed for some reason? From 472b2a6018b975df09c29a157b74b70cbec9703e Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 18:15:28 -0400 Subject: [PATCH 132/151] Update overlay11.h --- headers/functions/overlay11.h | 1 + 1 file changed, 1 insertion(+) diff --git a/headers/functions/overlay11.h b/headers/functions/overlay11.h index ce96892b..a83d599e 100644 --- a/headers/functions/overlay11.h +++ b/headers/functions/overlay11.h @@ -157,6 +157,7 @@ void CloseTopGroundMenu(void); int UpdateTopGroundMenu(void); bool IsBagNotEmpty(void); void GetExclusiveItemRequirements(undefined param_1, undefined param_2); +void SwapShopInventoryManager(enum swap_shop_inventory_case, int monster_id_or_exc_item_count); void HandleControlsTopScreenGround(void); bool GetDungeonMapPos(struct uvec2* out_pos, enum dungeon_id dungeon); void WorldMapSetMode(uint32_t world_map_mode); From 1bf9e0a6f677ceacaf321d46c9e8fc0f23ce5da8 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 18:16:58 -0400 Subject: [PATCH 133/151] Update overlay21.yml --- symbols/overlay21.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/symbols/overlay21.yml b/symbols/overlay21.yml index bd0a6a02..37181794 100644 --- a/symbols/overlay21.yml +++ b/symbols/overlay21.yml @@ -61,9 +61,9 @@ overlay21: address: EU: 0x238D460 description: |- - Checks both the text_window_id and menu_window_id for -2. If either are not -2, close the textbox/simple menu, and assign the id to -2. - - No params. + Checks both the text_window_id and menu_window_id for -2. If either are not -2, close the textbox/simple menu, and assign the id to -2. + + No params. - name: SwapShopPrintCurrentGold address: EU: 0x238D4E4 From 73e777170af6a46096f54cf3a7d75951c38af35c Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 18:18:29 -0400 Subject: [PATCH 134/151] Update overlay21.yml --- symbols/overlay21.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/symbols/overlay21.yml b/symbols/overlay21.yml index 37181794..00ff87ae 100644 --- a/symbols/overlay21.yml +++ b/symbols/overlay21.yml @@ -37,8 +37,8 @@ overlay21: EU: 0x238C388 description: |- Is the entrypoint of the overlay_load_entry, and seems to run once to initiate the Swap Shop. Is not called anywhere else. - Allocates space for swap_shop_menu_data, and initializes many of its fields. - + Allocates space for swap_shop_menu_data, and initializes many of its fields. + return: Always returns 1. - name: SwapShopDestructor address: From 91ad371795e1e1668928a9f74a4f73a9f0ca5bce Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 18:49:56 -0400 Subject: [PATCH 135/151] Update overlay21.h --- headers/data/overlay21.h | 50 ++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/headers/data/overlay21.h b/headers/data/overlay21.h index ee32a037..435baee0 100644 --- a/headers/data/overlay21.h +++ b/headers/data/overlay21.h @@ -17,31 +17,31 @@ extern struct window_params SWAP_SHOP_WINDOW_PARAMS_6; extern struct window_params SWAP_SHOP_WINDOW_PARAMS_7; extern struct window_params SWAP_SHOP_WINDOW_PARAMS_8; extern struct window_params SWAP_SHOP_WINDOW_PARAMS_9; -extern char SWAP_SHOP_DEBUG_STRING_1[28]; -extern char SWAP_SHOP_DEBUG_STRING_2[33]; -extern char SWAP_SHOP_DEBUG_STRING_3[30]; -extern char SWAP_SHOP_DEBUG_STRING_4[34]; -extern char SWAP_SHOP_DEBUG_STRING_5[29]; -extern char SWAP_SHOP_DEBUG_STRING_6[31]; -extern char SWAP_SHOP_DEBUG_STRING_7[30]; -extern char SWAP_SHOP_DEBUG_STRING_8[19]; -extern char SWAP_SHOP_DEBUG_STRING_9[34]; -extern char SWAP_SHOP_DEBUG_STRING_10[26]; -extern char SWAP_SHOP_DEBUG_STRING_11[35]; -extern char SWAP_SHOP_DEBUG_STRING_12[31]; -extern char SWAP_SHOP_DEBUG_STRING_13[34]; -extern char SWAP_SHOP_DEBUG_STRING_14[36]; -extern char SWAP_SHOP_DEBUG_STRING_15[38]; -extern char SWAP_SHOP_DEBUG_STRING_16[40]; -extern char SWAP_SHOP_DEBUG_STRING_17[34]; -extern char SWAP_SHOP_DEBUG_STRING_18[8]; -extern char SWAP_SHOP_DEBUG_STRING_19[39]; -extern char SWAP_SHOP_DEBUG_STRING_20[21]; -extern char SWAP_SHOP_DEBUG_STRING_21[43]; -extern char SWAP_SHOP_DEBUG_STRING_22[44]; -extern char SWAP_SHOP_DEBUG_STRING_23[44]; -extern char SWAP_SHOP_DEBUG_STRING_24[38]; -extern char SWAP_SHOP_DEBUG_STRING_25[36]; +extern char SWAP_SHOP_TALK_WELCOME_DEBUG_STRING[28]; +extern char SWAP_SHOP_MAIN_MENU_OPTIONS_DEBUG_STRING[33]; +extern char SWAP_SHOP_TALK_CONTINUE_SWAP_DEBUG_STRING[30]; +extern char SWAP_SHOP_TALK_SUBINFO_DEBUG_STRING[34]; +extern char SWAP_SHOP_TALK_COME_AGAIN_DEBUG_STRING[29]; +extern char SWAP_SHOP_TALK_LACKING_SWAP_ITEMS_DEBUG_STRING[31]; +extern char SWAP_SHOP_TALK_SWAP_BROKE_DEBUG_STRING[30]; +extern char SWAP_SHOP_TALK_SWAP_POOR_DEBUG_STRING[19]; +extern char SWAP_SHOP_UNK_0x8_DEBUG_STRING[34]; +extern char SWAP_SHOP_CLOSE_SHOP_DEBUG_STRING[26]; +extern char SWAP_SHOP_TALK_WHAT_ITEMS_DEBUG_STRING[35]; +extern char SWAP_SHOP_TALK_VALUABLE_SWAP_DEBUG_STRING[31]; +extern char SWAP_SHOP_INIT_SWAP_ITEMS_MENU_DEBUG_STRING[34]; +extern char SWAP_SHOP_SWAP_ITEMS_MENU_DEBUG_STRING[36]; +extern char SWAP_SHOP_RETURN_SWAP_ITEMS_MENU_DEBUG_STRING[38]; +extern char SWAP_SHOP_SELECT_SWAP_ITEM_OPTIONS_DEBUG_STRING[40]; +extern char SWAP_SHOP_SWAP_ITEM_GET_INFO_DEBUG_STRING[34]; +extern char SWAP_SHOP_ITEM_ZERO_STRING[8]; +extern char SWAP_SHOP_TALK_CONFIRM_SWAP_DEBUG_STRING[39]; +extern char SWAP_SHOP_CONFIRM_CHOICE_DEBUG_STRING[21]; +extern char SWAP_SHOP_INIT_SCRIPT_ACTION_1_DEBUG_STRING[43]; +extern char SWAP_SHOP_INIT_SCRIPT_ACTION_2_DEBUG_STRING[44]; +extern char SWAP_SHOP_INIT_SCRIPT_ACTION_3_DEBUG_STRING[44]; +extern char SWAP_SHOP_TEXT_PUT_IN_CAULDRON_DEBUG_STRING[38]; +extern char SWAP_SHOP_DO_SWAP_THEN_TALK_DEBUG_STRING[36]; extern wchar_t OVERLAY21_JP_STRING[3]; extern char SWAP_SHOP_GOLD_STRING[18]; extern undefined OVERLAY21_RESERVED_SPACE[8]; From 88494fd9a49355f26d8f5a4f30244d0a01856438 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 18:54:53 -0400 Subject: [PATCH 136/151] Update overlay21.yml --- symbols/overlay21.yml | 52 +++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/symbols/overlay21.yml b/symbols/overlay21.yml index 00ff87ae..ab9de302 100644 --- a/symbols/overlay21.yml +++ b/symbols/overlay21.yml @@ -68,7 +68,7 @@ overlay21: address: EU: 0x238D4E4 description: |- - A text box callback function containing the player's current gold, seen on the Swap Shop main menu. + A text box callback function containing the player's current gold using SWAP_SHOP_GOLD_STRING, as seen on the Swap Shop main menu. r0: window_id of the textbox data: @@ -214,151 +214,151 @@ overlay21: EU: 0x10 NA: 0x10 description: Used alongside SWAP_SHOP_SUBMENU_ITEMS_3. - - name: SWAP_SHOP_DEBUG_STRING_1 +- name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING address: EU: 0x238D6F8 length: EU: 0x1D description: "MENU_SYNTHESIS_MODE_START:\\n" - - name: SWAP_SHOP_DEBUG_STRING_2 + - name: SWAP_SHOP_MAIN_MENU_OPTIONS_DEBUG_STRING address: EU: 0x238D714 length: EU: 0x22 description: "MENU_SYNTHESIS_MODE_SELECTMENU:\\n" - - name: SWAP_SHOP_DEBUG_STRING_3 + - name: SWAP_SHOP_TALK_CONTINUE_SWAP_DEBUG_STRING address: EU: 0x238D738 length: EU: 0x1F description: "MENU_SYNTHESIS_MODE_RESTART:\\n" - - name: SWAP_SHOP_DEBUG_STRING_4 + - name: SWAP_SHOP_TALK_SUBINFO_DEBUG_STRING address: EU: 0x238D758 length: EU: 0x23 description: "MENU_SYNTHESIS_MODE_EXPLANATION:\\n" - - name: SWAP_SHOP_DEBUG_STRING_5 + - name: SWAP_SHOP_TALK_COME_AGAIN_DEBUG_STRING address: EU: 0x238D77C length: EU: 0x1E description: "MENU_SYNTHESIS_MODE_THANKS:\\n" - - name: SWAP_SHOP_DEBUG_STRING_6 + - name: SWAP_SHOP_TALK_LACKING_SWAP_ITEMS_DEBUG_STRING address: EU: 0x238D79C length: EU: 0x20 description: "MENU_SYNTHESIS_MODE_ITEM_NON:\\n" - - name: SWAP_SHOP_DEBUG_STRING_7 + - name: SWAP_SHOP_TALK_SWAP_BROKE_DEBUG_STRING address: EU: 0x238D7BC length: EU: 0x1F description: "MENU_SYNTHESIS_MODE_GOLD_NON\\n" - - name: SWAP_SHOP_DEBUG_STRING_8 + - name: SWAP_SHOP_TALK_SWAP_POOR_DEBUG_STRING address: EU: 0x238D7DC length: EU: 0x14 description: MENU_SYNTHESIS_GOLD - - name: SWAP_SHOP_DEBUG_STRING_9 + - name: SWAP_SHOP_UNK_0x8_DEBUG_STRING address: EU: 0x238D800 length: EU: 0x23 description: "MENU_SYNTHESIS_MODE_SELECT_FULL:\\n" - - name: SWAP_SHOP_DEBUG_STRING_10 + - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING0 address: EU: 0x238D824 length: EU: 0x1B description: "MENU_SYNTHESIS_MODE_QUIT\\n" - - name: SWAP_SHOP_DEBUG_STRING_11 + - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING1 address: EU: 0x238D840 length: EU: 0x24 description: "MENU_SYNTHESIS_MODE_SELECT_START:\\n" - - name: SWAP_SHOP_DEBUG_STRING_12 + - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING2 address: EU: 0x238D864 length: EU: 0x20 description: "MENU_SYNTHESIS_MODE__RESTART:\\n" - - name: SWAP_SHOP_DEBUG_STRING_13 + - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING3 address: EU: 0x238D884 length: EU: 0x23 description: "MENU_SYNTHESIS_MODE_SELECT_INIT:\\n" - - name: SWAP_SHOP_DEBUG_STRING_14 + - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING4 address: EU: 0x238D8A8 length: EU: 0x25 description: "MENU_SYNTHESIS_MODE_SELECT_SELECT:\\n" - - name: SWAP_SHOP_DEBUG_STRING_15 + - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING5 address: EU: 0x238D8CC length: EU: 0x27 description: "MENU_SYNTHESIS_MODE_SELECT_RESELECT:\\n" - - name: SWAP_SHOP_DEBUG_STRING_16 + - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING6 address: EU: 0x238D8F4 length: EU: 0x29 description: "\\tMENU_SYNTHESIS_MODE_SELECT_SUB_MENU:\\n" - - name: SWAP_SHOP_DEBUG_STRING_17 + - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING7 address: EU: 0x238D91C length: EU: 0x23 description: "MENU_SYNTHESIS_MODE_SELECT_EXPLA\\n" - - name: SWAP_SHOP_DEBUG_STRING_18 + - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING8 address: EU: 0x238D940 length: EU: 0x9 description: "[item:0]" - - name: SWAP_SHOP_DEBUG_STRING_19 + - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING9 address: EU: 0x238D94C length: EU: 0x28 description: "MENU_SYNTHESIS_MODE_SELECT_CONFIRM_1:\\n" - - name: SWAP_SHOP_DEBUG_STRING_20 + - name: SWAP_SHOP_MAIN_MENU_OPTIONS_DEBUG_STRING0 address: EU: 0x238D974 length: EU: 0x16 description: "_SELL_CONFIRM NEW_1\\n" - - name: SWAP_SHOP_DEBUG_STRING_21 + - name: SWAP_SHOP_MAIN_MENU_OPTIONS_DEBUG_STRING1 address: EU: 0x238D98C length: EU: 0x2C description: "MENU_SYNTHESIS_MODE_SELECT_THANKS_ACTION:\\n" - - name: SWAP_SHOP_DEBUG_STRING_22 + - name: SWAP_SHOP_MAIN_MENU_OPTIONS_DEBUG_STRING2 address: EU: 0x238D9B8 length: EU: 0x2D description: "MENU_SYNTHESIS_MODE_SELECT_THANKS_ACTION2:\\n" - - name: SWAP_SHOP_DEBUG_STRING_23 + - name: SWAP_SHOP_MAIN_MENU_OPTIONS_DEBUG_STRING3 address: EU: 0x238D9E4 length: EU: 0x2D description: "MENU_SYNTHESIS_MODE_SELECT_THANKS_ACTION3:\\n" - - name: SWAP_SHOP_DEBUG_STRING_24 + - name: SWAP_SHOP_MAIN_MENU_OPTIONS_DEBUG_STRING4 address: EU: 0x238DA10 length: EU: 0x27 description: "MENU_SYNTHESIS_MODE_SELECT_THANKS_1:\\n" - - name: SWAP_SHOP_DEBUG_STRING_25 + - name: SWAP_SHOP_MAIN_MENU_OPTIONS_DEBUG_STRING5 address: EU: 0x238DA38 length: From bdc92de1156733081d49677a9841947884ef9caf Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 18:56:22 -0400 Subject: [PATCH 137/151] Update overlay21.yml --- symbols/overlay21.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay21.yml b/symbols/overlay21.yml index ab9de302..3dd7c1a5 100644 --- a/symbols/overlay21.yml +++ b/symbols/overlay21.yml @@ -214,7 +214,7 @@ overlay21: EU: 0x10 NA: 0x10 description: Used alongside SWAP_SHOP_SUBMENU_ITEMS_3. -- name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING + - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING address: EU: 0x238D6F8 length: From 8e8eafd83d4aa0aff399b18043b5fd95f3334e29 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 18:57:48 -0400 Subject: [PATCH 138/151] Update overlay21.yml --- symbols/overlay21.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay21.yml b/symbols/overlay21.yml index 3dd7c1a5..1eff0a32 100644 --- a/symbols/overlay21.yml +++ b/symbols/overlay21.yml @@ -262,7 +262,7 @@ overlay21: length: EU: 0x14 description: MENU_SYNTHESIS_GOLD - - name: SWAP_SHOP_UNK_0x8_DEBUG_STRING + - name: SWAP_SHOP_UNK_8_DEBUG_STRING address: EU: 0x238D800 length: From f24253da78a6f0c14d92cecd31eaffa3f73164a6 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 18:58:20 -0400 Subject: [PATCH 139/151] Update overlay21.h --- headers/data/overlay21.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/data/overlay21.h b/headers/data/overlay21.h index 435baee0..77d3f837 100644 --- a/headers/data/overlay21.h +++ b/headers/data/overlay21.h @@ -25,7 +25,7 @@ extern char SWAP_SHOP_TALK_COME_AGAIN_DEBUG_STRING[29]; extern char SWAP_SHOP_TALK_LACKING_SWAP_ITEMS_DEBUG_STRING[31]; extern char SWAP_SHOP_TALK_SWAP_BROKE_DEBUG_STRING[30]; extern char SWAP_SHOP_TALK_SWAP_POOR_DEBUG_STRING[19]; -extern char SWAP_SHOP_UNK_0x8_DEBUG_STRING[34]; +extern char SWAP_SHOP_UNK_8_DEBUG_STRING[34]; extern char SWAP_SHOP_CLOSE_SHOP_DEBUG_STRING[26]; extern char SWAP_SHOP_TALK_WHAT_ITEMS_DEBUG_STRING[35]; extern char SWAP_SHOP_TALK_VALUABLE_SWAP_DEBUG_STRING[31]; From 1d5b086ede1def7fa4efd867b33548c092895a8f Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 18:59:50 -0400 Subject: [PATCH 140/151] Update overlay21.h From ece5783b17641095e5eb2c0aaa4f16db54778ede Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 19:02:30 -0400 Subject: [PATCH 141/151] Update overlay21.yml --- symbols/overlay21.yml | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/symbols/overlay21.yml b/symbols/overlay21.yml index 1eff0a32..85757704 100644 --- a/symbols/overlay21.yml +++ b/symbols/overlay21.yml @@ -262,103 +262,103 @@ overlay21: length: EU: 0x14 description: MENU_SYNTHESIS_GOLD - - name: SWAP_SHOP_UNK_8_DEBUG_STRING + - name: SWAP_SHOP_UNK_0x8_DEBUG_STRING address: EU: 0x238D800 length: EU: 0x23 description: "MENU_SYNTHESIS_MODE_SELECT_FULL:\\n" - - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING0 + - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING address: EU: 0x238D824 length: EU: 0x1B description: "MENU_SYNTHESIS_MODE_QUIT\\n" - - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING1 + - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING address: EU: 0x238D840 length: EU: 0x24 description: "MENU_SYNTHESIS_MODE_SELECT_START:\\n" - - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING2 + - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING address: EU: 0x238D864 length: EU: 0x20 description: "MENU_SYNTHESIS_MODE__RESTART:\\n" - - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING3 + - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING address: EU: 0x238D884 length: EU: 0x23 description: "MENU_SYNTHESIS_MODE_SELECT_INIT:\\n" - - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING4 + - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING address: EU: 0x238D8A8 length: EU: 0x25 description: "MENU_SYNTHESIS_MODE_SELECT_SELECT:\\n" - - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING5 + - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING address: EU: 0x238D8CC length: EU: 0x27 description: "MENU_SYNTHESIS_MODE_SELECT_RESELECT:\\n" - - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING6 + - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING address: EU: 0x238D8F4 length: EU: 0x29 description: "\\tMENU_SYNTHESIS_MODE_SELECT_SUB_MENU:\\n" - - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING7 + - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING address: EU: 0x238D91C length: EU: 0x23 description: "MENU_SYNTHESIS_MODE_SELECT_EXPLA\\n" - - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING8 + - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING address: EU: 0x238D940 length: EU: 0x9 description: "[item:0]" - - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING9 + - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING address: EU: 0x238D94C length: EU: 0x28 description: "MENU_SYNTHESIS_MODE_SELECT_CONFIRM_1:\\n" - - name: SWAP_SHOP_MAIN_MENU_OPTIONS_DEBUG_STRING0 + - name: SWAP_SHOP_MAIN_MENU_OPTIONS_DEBUG_STRING address: EU: 0x238D974 length: EU: 0x16 description: "_SELL_CONFIRM NEW_1\\n" - - name: SWAP_SHOP_MAIN_MENU_OPTIONS_DEBUG_STRING1 + - name: SWAP_SHOP_MAIN_MENU_OPTIONS_DEBUG_STRING address: EU: 0x238D98C length: EU: 0x2C description: "MENU_SYNTHESIS_MODE_SELECT_THANKS_ACTION:\\n" - - name: SWAP_SHOP_MAIN_MENU_OPTIONS_DEBUG_STRING2 + - name: SWAP_SHOP_MAIN_MENU_OPTIONS_DEBUG_STRING address: EU: 0x238D9B8 length: EU: 0x2D description: "MENU_SYNTHESIS_MODE_SELECT_THANKS_ACTION2:\\n" - - name: SWAP_SHOP_MAIN_MENU_OPTIONS_DEBUG_STRING3 + - name: SWAP_SHOP_MAIN_MENU_OPTIONS_DEBUG_STRING address: EU: 0x238D9E4 length: EU: 0x2D description: "MENU_SYNTHESIS_MODE_SELECT_THANKS_ACTION3:\\n" - - name: SWAP_SHOP_MAIN_MENU_OPTIONS_DEBUG_STRING4 + - name: SWAP_SHOP_MAIN_MENU_OPTIONS_DEBUG_STRING address: EU: 0x238DA10 length: EU: 0x27 description: "MENU_SYNTHESIS_MODE_SELECT_THANKS_1:\\n" - - name: SWAP_SHOP_MAIN_MENU_OPTIONS_DEBUG_STRING5 + - name: SWAP_SHOP_MAIN_MENU_OPTIONS_DEBUG_STRING address: EU: 0x238DA38 length: From e5109d4e035eb9a86710292e80675c0326dd6bdc Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 19:06:52 -0400 Subject: [PATCH 142/151] Update overlay21.yml --- symbols/overlay21.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/symbols/overlay21.yml b/symbols/overlay21.yml index 85757704..bcd10c5a 100644 --- a/symbols/overlay21.yml +++ b/symbols/overlay21.yml @@ -268,97 +268,97 @@ overlay21: length: EU: 0x23 description: "MENU_SYNTHESIS_MODE_SELECT_FULL:\\n" - - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING + - name: SWAP_SHOP_CLOSE_SHOP_DEBUG_STRING address: EU: 0x238D824 length: EU: 0x1B description: "MENU_SYNTHESIS_MODE_QUIT\\n" - - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING + - name: SWAP_SHOP_TALK_WHAT_ITEMS_DEBUG_STRING address: EU: 0x238D840 length: EU: 0x24 description: "MENU_SYNTHESIS_MODE_SELECT_START:\\n" - - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING + - name: SWAP_SHOP_TALK_VALUABLE_SWAP_DEBUG_STRING address: EU: 0x238D864 length: EU: 0x20 description: "MENU_SYNTHESIS_MODE__RESTART:\\n" - - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING + - name: SWAP_SHOP_INIT_SWAP_ITEMS_MENU_DEBUG_STRING address: EU: 0x238D884 length: EU: 0x23 description: "MENU_SYNTHESIS_MODE_SELECT_INIT:\\n" - - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING + - name: SWAP_SHOP_SWAP_ITEMS_MENU_DEBUG_STRING address: EU: 0x238D8A8 length: EU: 0x25 description: "MENU_SYNTHESIS_MODE_SELECT_SELECT:\\n" - - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING + - name: SWAP_SHOP_RETURN_SWAP_ITEMS_MENU_DEBUG_STRING address: EU: 0x238D8CC length: EU: 0x27 description: "MENU_SYNTHESIS_MODE_SELECT_RESELECT:\\n" - - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING + - name: SWAP_SHOP_SELECT_SWAP_ITEM_OPTIONS_DEBUG_STRING address: EU: 0x238D8F4 length: EU: 0x29 description: "\\tMENU_SYNTHESIS_MODE_SELECT_SUB_MENU:\\n" - - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING + - name: SWAP_SHOP_SWAP_ITEM_GET_INFO_DEBUG_STRING address: EU: 0x238D91C length: EU: 0x23 description: "MENU_SYNTHESIS_MODE_SELECT_EXPLA\\n" - - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING + - name: SWAP_SHOP_ITEM_ZERO_STRING address: EU: 0x238D940 length: EU: 0x9 description: "[item:0]" - - name: SWAP_SHOP_TALK_WELCOME_DEBUG_STRING + - name: SWAP_SHOP_TALK_CONFIRM_SWAP_DEBUG_STRING address: EU: 0x238D94C length: EU: 0x28 description: "MENU_SYNTHESIS_MODE_SELECT_CONFIRM_1:\\n" - - name: SWAP_SHOP_MAIN_MENU_OPTIONS_DEBUG_STRING + - name: SWAP_SHOP_CONFIRM_CHOICE_DEBUG_STRING address: EU: 0x238D974 length: EU: 0x16 description: "_SELL_CONFIRM NEW_1\\n" - - name: SWAP_SHOP_MAIN_MENU_OPTIONS_DEBUG_STRING + - name: SWAP_SHOP_INIT_SCRIPT_ACTION_1_DEBUG_STRING address: EU: 0x238D98C length: EU: 0x2C description: "MENU_SYNTHESIS_MODE_SELECT_THANKS_ACTION:\\n" - - name: SWAP_SHOP_MAIN_MENU_OPTIONS_DEBUG_STRING + - name: SWAP_SHOP_INIT_SCRIPT_ACTION_2_DEBUG_STRING address: EU: 0x238D9B8 length: EU: 0x2D description: "MENU_SYNTHESIS_MODE_SELECT_THANKS_ACTION2:\\n" - - name: SWAP_SHOP_MAIN_MENU_OPTIONS_DEBUG_STRING + - name: SWAP_SHOP_INIT_SCRIPT_ACTION_3_DEBUG_STRING address: EU: 0x238D9E4 length: EU: 0x2D description: "MENU_SYNTHESIS_MODE_SELECT_THANKS_ACTION3:\\n" - - name: SWAP_SHOP_MAIN_MENU_OPTIONS_DEBUG_STRING + - name: SWAP_SHOP_TEXT_PUT_IN_CAULDRON_DEBUG_STRING address: EU: 0x238DA10 length: EU: 0x27 description: "MENU_SYNTHESIS_MODE_SELECT_THANKS_1:\\n" - - name: SWAP_SHOP_MAIN_MENU_OPTIONS_DEBUG_STRING + - name: SWAP_SHOP_DO_SWAP_THEN_TALK_DEBUG_STRING address: EU: 0x238DA38 length: From 7e1da84778b1f4be57558cd5b589af08ed994ffe Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 19:07:40 -0400 Subject: [PATCH 143/151] Update overlay21.yml --- symbols/overlay21.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbols/overlay21.yml b/symbols/overlay21.yml index bcd10c5a..c50843fe 100644 --- a/symbols/overlay21.yml +++ b/symbols/overlay21.yml @@ -262,7 +262,7 @@ overlay21: length: EU: 0x14 description: MENU_SYNTHESIS_GOLD - - name: SWAP_SHOP_UNK_0x8_DEBUG_STRING + - name: SWAP_SHOP_UNK_8_DEBUG_STRING address: EU: 0x238D800 length: From 8cede1b7980fbb0001d47a49d79c038975bb8a4f Mon Sep 17 00:00:00 2001 From: Parker Zhiss <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 19:11:09 -0400 Subject: [PATCH 144/151] Formatting.... again. Whitespace whyyyyyy --- headers/types/common/enums.h | 17 +++++++++-------- headers/types/ground_mode/enums.h | 28 +++++++++++++++++----------- symbols/overlay21.yml | 4 ++-- 3 files changed, 28 insertions(+), 21 deletions(-) diff --git a/headers/types/common/enums.h b/headers/types/common/enums.h index 1edf8739..8d981c60 100644 --- a/headers/types/common/enums.h +++ b/headers/types/common/enums.h @@ -3974,7 +3974,8 @@ enum mission_template_item_case { ITEM_CASE_SPECIFIC_ITEM = 1, // mission_template_item_data_1 and mission_template_item_data_2 are indices to a table ITEM_CASE_TABLE_AVAILABLE_ITEM = 2, - // similar to ITEM_CASE_TABLE_AVAILABLE_ITEM, but without a check for availability. Unused in template. + // similar to ITEM_CASE_TABLE_AVAILABLE_ITEM, but without a check for availability. Unused in + // template. ITEM_CASE_TABLE_ITEM = 3, // mission_template_item_data_1 and mission_template_item_data_2 are ignored. Instead, pulls // from @@ -4244,13 +4245,13 @@ enum stairs_type { }; enum talk_type { - TALK_TYPE_HEALTHY = 0, - TALK_TYPE_HALF_LIFE = 1, - TALK_TYPE_PINCH = 2, - TALK_TYPE_LEVEL_UP = 3, - TALK_TYPE_WAIT = 4, - TALK_TYPE_GROUND_WAIT = 5, -}; + TALK_TYPE_HEALTHY = 0, + TALK_TYPE_HALF_LIFE = 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); diff --git a/headers/types/ground_mode/enums.h b/headers/types/ground_mode/enums.h index 4755a8fd..0fff3c11 100644 --- a/headers/types/ground_mode/enums.h +++ b/headers/types/ground_mode/enums.h @@ -2116,7 +2116,6 @@ enum script_routine_kind { ENUM_16_BIT(script_routine_kind); #pragma pack(pop) - enum swap_shop_shared_case { SWAP_SHARED_CASE_TALK_WELCOME = 0, SWAP_SHARED_CASE_TALK_CONTINUE_SWAP = 1, @@ -2127,7 +2126,8 @@ enum swap_shop_shared_case { SWAP_SHARED_CASE_TALK_SWAP_BROKE = 6, SWAP_SHARED_CASE_TALK_SWAP_POOR = 7, // Seems to be an identical copy of SWAP_SHARED_CASE_TALK_SEND_TO_STORAGE. - // Perhaps this was once intended for trying to swap with a full storage, which is impossible by design. + // Perhaps this was once intended for trying to swap with a full storage, which is impossible by + // design. SWAP_SHARED_CASE_UNK_0x8 = 8, SWAP_SHARED_CASE_TALK_WHAT_ITEMS = 9, SWAP_SHARED_CASE_TALK_VALUABLE_SWAP = 10, @@ -2191,20 +2191,26 @@ enum swap_shop_shared_case { }; // Used exclusively by SwapShopMainManager. enum swap_shop_main_manager_case { - SWAP_MAIN_CASE_ENTRY_POINT = 0, // Assigned by SwapShopEntryPoint. Seems to set the script output case to 0, perhaps resetting it? + SWAP_MAIN_CASE_ENTRY_POINT = 0, // Assigned by SwapShopEntryPoint. Seems to set the script + // output case to 0, perhaps resetting it? SWAP_MAIN_CASE_USE_SHARED_CASE = 1, // Will navigate to the shared_case-specific index. - SWAP_MAIN_CASE_CLOSE_PORTRAIT_AND_TEXTBOX = 2, // Subsequently sets the case to SWAP_MAIN_CASE_EXIT_SWAP_SHOP - SWAP_MAIN_CASE_EXIT_SWAP_SHOP = 3, // Also sets the script output case to -1. - SWAP_MAIN_CASE_RUN_SCRIPT_ACTION = 4, // Called after each script action, and the entry point. Possibly enables the script to run? - SWAP_MAIN_CASE_UNK_0x5 = 5, // Always returns 1. Seems unused. - SWAP_MAIN_CASE_SET_SCRIPT_ACTION_1 = 6, // Sets script output to 1, allowing croagunk to turn towards the cauldron. - SWAP_MAIN_CASE_SET_SCRIPT_ACTION_2 = 7, // Sets script output to 2, causing flashing lights and earthquake effects - SWAP_MAIN_CASE_SET_SCRIPT_ACTION_3 = 8, // Sets script output to 3, causing croagunk to turn towards the player. + SWAP_MAIN_CASE_CLOSE_PORTRAIT_AND_TEXTBOX = + 2, // Subsequently sets the case to SWAP_MAIN_CASE_EXIT_SWAP_SHOP + SWAP_MAIN_CASE_EXIT_SWAP_SHOP = 3, // Also sets the script output case to -1. + SWAP_MAIN_CASE_RUN_SCRIPT_ACTION = 4, // Called after each script action, and the entry point. + // Possibly enables the script to run? + SWAP_MAIN_CASE_UNK_0x5 = 5, // Always returns 1. Seems unused. + SWAP_MAIN_CASE_SET_SCRIPT_ACTION_1 = + 6, // Sets script output to 1, allowing croagunk to turn towards the cauldron. + SWAP_MAIN_CASE_SET_SCRIPT_ACTION_2 = + 7, // Sets script output to 2, causing flashing lights and earthquake effects + SWAP_MAIN_CASE_SET_SCRIPT_ACTION_3 = + 8, // Sets script output to 3, causing croagunk to turn towards the player. }; enum swap_shop_inventory_case { SWAP_INV_CASE_SHOP_ITEMS = 0, - SWAP_INV_CASE_UNK_0x1 = 1, + SWAP_INV_CASE_UNK_0x1 = 1, SWAP_INV_CASE_SPECIES_EXC_ITEM_LIST = 2, SWAP_INV_CASE_CHOOSE_TRADE_AWAY_ITEMS_LIST = 3, }; diff --git a/symbols/overlay21.yml b/symbols/overlay21.yml index c50843fe..fbb33fe5 100644 --- a/symbols/overlay21.yml +++ b/symbols/overlay21.yml @@ -38,7 +38,7 @@ overlay21: description: |- Is the entrypoint of the overlay_load_entry, and seems to run once to initiate the Swap Shop. Is not called anywhere else. Allocates space for swap_shop_menu_data, and initializes many of its fields. - + return: Always returns 1. - name: SwapShopDestructor address: @@ -46,7 +46,7 @@ overlay21: description: |- Is the destructor of the overlay_load_entry, and seems to run once on closing the Swap Shop. Is not called anywhere else. Frees up the allocated space for swap_shop_menu_data if it is not already empty. - + No params. - name: SwapShopMainManager address: From 3a3062fe15f383b73c842c4cec43befc5796159d Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 19:44:07 -0400 Subject: [PATCH 145/151] Apply suggestions from code review Co-authored-by: UsernameFodder <93669634+UsernameFodder@users.noreply.github.com> --- headers/functions/overlay11.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/functions/overlay11.h b/headers/functions/overlay11.h index a83d599e..f50423d4 100644 --- a/headers/functions/overlay11.h +++ b/headers/functions/overlay11.h @@ -157,7 +157,7 @@ void CloseTopGroundMenu(void); int UpdateTopGroundMenu(void); bool IsBagNotEmpty(void); void GetExclusiveItemRequirements(undefined param_1, undefined param_2); -void SwapShopInventoryManager(enum swap_shop_inventory_case, int monster_id_or_exc_item_count); +void SwapShopInventoryManager(enum swap_shop_inventory_case case, int monster_id_or_exc_item_count); void HandleControlsTopScreenGround(void); bool GetDungeonMapPos(struct uvec2* out_pos, enum dungeon_id dungeon); void WorldMapSetMode(uint32_t world_map_mode); From e4f5daf8768869941d5a560df1f1478136b27755 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 19:45:41 -0400 Subject: [PATCH 146/151] Update overlay21.h --- headers/functions/overlay21.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/functions/overlay21.h b/headers/functions/overlay21.h index 47b3a20f..bad53433 100644 --- a/headers/functions/overlay21.h +++ b/headers/functions/overlay21.h @@ -1,7 +1,7 @@ #ifndef HEADERS_FUNCTIONS_OVERLAY21_H_ #define HEADERS_FUNCTIONS_OVERLAY21_H_ -void SwapShopDialogueManager(int current_switch_case); +void SwapShopDialogueManager(enum swap_shared_case new_shared_case); enum item_id GetFirstExclusivePrerequisite(enum item_id item_id); int SwapShopEntryPoint(void); void SwapShopDestructor(void); From 4fe75b5ef2861a400e528698c1e7e396ddd3f4d7 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 19:48:43 -0400 Subject: [PATCH 147/151] Update overlay11.yml --- symbols/overlay11.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/symbols/overlay11.yml b/symbols/overlay11.yml index 87a8e609..390452fd 100644 --- a/symbols/overlay11.yml +++ b/symbols/overlay11.yml @@ -1827,6 +1827,8 @@ overlay11: length: EU: 0x8 description: Host pointers to multiple structures used for performing internal Swap Shop checks. + + type: struct swap_shop_inventory_ptrs - name: WORLD_MAP_MODE address: EU: 0x2325924 From efbb9d259694ace540d13aaea0c21a49bea5758a Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 19:50:43 -0400 Subject: [PATCH 148/151] Update overlay11.h --- headers/data/overlay11.h | 1 + 1 file changed, 1 insertion(+) diff --git a/headers/data/overlay11.h b/headers/data/overlay11.h index 88b346a3..bb02a375 100644 --- a/headers/data/overlay11.h +++ b/headers/data/overlay11.h @@ -21,6 +21,7 @@ extern struct ground_entity_function_table PERFORMER_FUNCTION_TABLE; extern struct window_params TEAM_INFO_BOX_DEFAULT_WINDOW_PARAMS; extern struct overlay_load_entry OVERLAY11_OVERLAY_LOAD_TABLE[21]; extern struct main_ground_data GROUND_STATE_PTRS; +extern struct swap_shop_inventory_ptrs SWAP_SHOP_INVENTORY_PTRS; extern uint32_t WORLD_MAP_MODE; #endif From 0da535a11946b0878b76c354a45ada39e44dc41f Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 19:55:55 -0400 Subject: [PATCH 149/151] Update overlay11.h --- headers/functions/overlay11.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headers/functions/overlay11.h b/headers/functions/overlay11.h index f50423d4..3a93e42e 100644 --- a/headers/functions/overlay11.h +++ b/headers/functions/overlay11.h @@ -157,7 +157,7 @@ void CloseTopGroundMenu(void); int UpdateTopGroundMenu(void); bool IsBagNotEmpty(void); void GetExclusiveItemRequirements(undefined param_1, undefined param_2); -void SwapShopInventoryManager(enum swap_shop_inventory_case case, int monster_id_or_exc_item_count); +void SwapShopInventoryManager(enum swap_shop_inventory_case inventory_case, int monster_id_or_exc_item_count); void HandleControlsTopScreenGround(void); bool GetDungeonMapPos(struct uvec2* out_pos, enum dungeon_id dungeon); void WorldMapSetMode(uint32_t world_map_mode); From 00b7d108000ac6c436d78ecb849b53d5064bec92 Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 19:57:21 -0400 Subject: [PATCH 150/151] Update overlay11.yml --- symbols/overlay11.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/symbols/overlay11.yml b/symbols/overlay11.yml index 390452fd..87a8e609 100644 --- a/symbols/overlay11.yml +++ b/symbols/overlay11.yml @@ -1827,8 +1827,6 @@ overlay11: length: EU: 0x8 description: Host pointers to multiple structures used for performing internal Swap Shop checks. - - type: struct swap_shop_inventory_ptrs - name: WORLD_MAP_MODE address: EU: 0x2325924 From 4b900dfd72f4a1ef1f9aafedfd0249fd800f2cad Mon Sep 17 00:00:00 2001 From: HappyLappy1 <86489014+HappyLappy1@users.noreply.github.com> Date: Sun, 24 Aug 2025 20:00:17 -0400 Subject: [PATCH 151/151] Update overlay11.h --- headers/functions/overlay11.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/headers/functions/overlay11.h b/headers/functions/overlay11.h index 3a93e42e..1d0f5784 100644 --- a/headers/functions/overlay11.h +++ b/headers/functions/overlay11.h @@ -157,7 +157,8 @@ void CloseTopGroundMenu(void); int UpdateTopGroundMenu(void); bool IsBagNotEmpty(void); void GetExclusiveItemRequirements(undefined param_1, undefined param_2); -void SwapShopInventoryManager(enum swap_shop_inventory_case inventory_case, int monster_id_or_exc_item_count); +void SwapShopInventoryManager(enum swap_shop_inventory_case inventory_case, + int monster_id_or_exc_item_count); void HandleControlsTopScreenGround(void); bool GetDungeonMapPos(struct uvec2* out_pos, enum dungeon_id dungeon); void WorldMapSetMode(uint32_t world_map_mode);