Skip to content

Commit

Permalink
Assortment of arm9 findings (#247)
Browse files Browse the repository at this point in the history
Documents various things from arm9, though mostly related to missions.
  • Loading branch information
Adex-8x authored Jan 14, 2024
1 parent b090c1a commit 26e5ea0
Show file tree
Hide file tree
Showing 5 changed files with 272 additions and 24 deletions.
6 changes: 6 additions & 0 deletions headers/data/arm9.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@ extern struct adventure_log* ADVENTURE_LOG_PTR;
extern void* ITEM_TABLES_PTRS_1[26];
extern enum monster_id* UNOWN_SPECIES_ADDITIONAL_CHAR_PTR_TABLE[28];
extern struct team_member_table* TEAM_MEMBER_TABLE_PTR;
extern undefined* MISSION_DELIVER_LIST_PTR;
extern int MISSION_DELIVER_COUNT;
extern undefined* MISSION_DUNGEON_LIST_PTR;
extern int MISSION_DUNGEON_COUNT;
extern undefined* MISSION_MONSTER_LIST_PTR;
extern int MISSION_MONSTER_COUNT;
extern undefined* MISSION_LIST_PTR;
extern const char* REMOTE_STRING_PTR_TABLE[7];
extern const char* RANK_STRING_PTR_TABLE[16];
Expand Down
16 changes: 16 additions & 0 deletions headers/functions/arm9.h
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ int CreateParentMenuWrapper(struct window_params* params, struct window_flags fl
int CreateParentMenuInternal(struct window_params* params, struct window_flags flags,
struct window_extra_info* window_extra_info,
struct simple_menu_item* menu_items);
void ResumeParentMenu(int window_id);
void SetParentMenuState7(int window_id);
void CloseParentMenu(int window_id);
bool IsParentMenuActive(int window_id);
Expand All @@ -556,6 +557,7 @@ int CreateSimpleMenu(struct window_params* params, struct window_flags flags,
int CreateSimpleMenuInternal(struct window_params* params, struct window_flags flags,
struct window_extra_info* window_extra_info,
struct simple_menu_item* menu_items, int n_items);
void ResumeSimpleMenu(int window_id);
void CloseSimpleMenu(int window_id);
bool IsSimpleMenuActive(int window_id);
bool CheckSimpleMenuField0x1A0(int window_id);
Expand All @@ -566,6 +568,7 @@ void SetSimpleMenuField0x1AC(int window_id, int value);
int CreateAdvancedMenu(struct window_params* params, struct window_flags flags,
struct window_extra_info* window_extra_info,
advanced_menu_entry_fn_t* entry_fn, int n_options, int n_opt_per_page);
void ResumeAdvancedMenu(int window_id);
void CloseAdvancedMenu(int window_id);
bool IsAdvancedMenuActive2(int window_id);
bool IsAdvancedMenuActive(int window_id);
Expand Down Expand Up @@ -740,7 +743,9 @@ bool RestoreScriptVariableValues(void* src);
void InitScenarioScriptVars(void);
void SetScenarioScriptVar(enum script_var_id id, uint8_t val0, uint8_t val1);
int GetSpecialEpisodeType(void);
void SetSpecialEpisodeType(enum special_episode_type special_episode_type);
int GetExecuteSpecialEpisodeType(void);
bool IsSpecialEpisodeOpen(enum special_episode_type special_episode_type);
bool HasPlayedOldGame(void);
bool GetPerformanceFlagWithChecks(int flag_id);
int GetScenarioBalance(void);
Expand Down Expand Up @@ -776,6 +781,7 @@ void SetPortraitOffset(struct portrait_params* portrait, struct vec2* offset);
void AllowPortraitDefault(struct portrait_params* portrait, bool allow);
bool IsValidPortrait(struct portrait_params* portrait);
bool LoadPortrait(struct portrait_params* portrait, struct kaomado_buffer* buf);
bool WonderMailPasswordToMission(char* password, struct mission* mission_data);
void SetEnterDungeon(enum dungeon_id dungeon_id);
void InitDungeonInit(struct dungeon_init* dungeon_init_data, enum dungeon_id dungeon_id);
bool IsNoLossPenaltyDungeon(enum dungeon_id dungeon_id);
Expand Down Expand Up @@ -975,6 +981,7 @@ struct ground_monster* GetPartner(void);
struct ground_monster* GetMainCharacter1(void);
struct ground_monster* GetMainCharacter2(void);
struct ground_monster* GetMainCharacter3(void);
int GetFirstMatchingMemberIdx(enum monster_id monster_id);
int GetFirstEmptyMemberIdx(int param_1);
bool IsMonsterNotNicknamed(struct ground_monster* monster);
void RemoveActiveMembersFromAllTeams(void);
Expand Down Expand Up @@ -1023,17 +1030,24 @@ void GetStatBoostsForMonsterSummary(struct monster_summary* monster_summary,
void CreateMonsterSummaryFromTeamMember(struct monster_summary* monster_summary,
struct team_member* team_member, bool is_leader);
int GetSosMailCount(int param_1, bool param_2);
bool IsMissionSuspendedAndValid(struct mission* mission);
bool AreMissionsEquivalent(struct mission* mission1, struct mission* mission2);
bool IsMissionValid(struct mission* mission);
enum mission_generation_result GenerateMission(undefined* param_1, struct mission* mission_data);
bool IsMissionTypeSpecialEpisode(struct mission* mission);
void GenerateDailyMissions(void);
bool AlreadyHaveMission(struct mission* mission);
int CountJobListMissions(void);
int DungeonRequestsDone(uint8_t param_1, bool param_2);
int DungeonRequestsDoneWrapper(uint8_t param_1);
bool AnyDungeonRequestsDone(uint8_t param_1);
void AddMissionToJobList(struct mission* mission);
int GetAcceptedMission(int mission_id);
int GetMissionByTypeAndDungeon(int start_index, enum mission_type mission_type,
undefined* subtype_struct, enum dungeon_id dungeon_id);
bool CheckAcceptedMissionByTypeAndDungeon(enum mission_type mission_type, undefined* subtype_struct,
enum dungeon_id dungeon_id);
int GetAllPossibleMonsters(void* buf);
int GenerateAllPossibleMonstersList(void);
void DeleteAllPossibleMonstersList(void);
int GenerateAllPossibleDungeonsList(void);
Expand All @@ -1045,6 +1059,7 @@ bool IsMonsterMissionAllowed(enum monster_id monster_id);
bool CanMonsterBeUsedForMissionWrapper(enum monster_id monster_id);
bool CanMonsterBeUsedForMission(enum monster_id monster_id, bool check_story_banned);
bool IsMonsterMissionAllowedStory(enum monster_id monster_id);
bool 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);
Expand All @@ -1055,6 +1070,7 @@ void SetActorTalkSub(int actor_id);
void RandomizeDemoActors(void);
void ItemAtTableIdx(int idx, struct bulk_item* item);
void MainLoop(void);
void CreateJobSummary(struct mission* mission, int param_2);
int DungeonSwapIdToIdx(enum dungeon_id dungeon_id);
enum dungeon_id DungeonSwapIdxToId(int idx);
enum dungeon_mode GetDungeonModeSpecial(enum dungeon_id dungeon_id);
Expand Down
2 changes: 1 addition & 1 deletion headers/types/common/window.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ struct window_flags {
uint32_t unknown18 : 2; // 18-19 (0x40000-0x80000)
bool y_offset_end : 1; // 20 (0x100000): If set, window_params::y_offset sets the bottom edge
bool x_offset_end : 1; // 21 (0x200000): If set, window_params::x_offset sets the right edge
bool partial_menu : 1; // 22 (0x400000)
bool partial_menu : 1; // 22 (0x400000): If set, menu will not close upon selecting an option
bool no_cursor : 1; // 23 (0x800000)
bool no_up_down : 1; // 24 (0x1000000)
bool no_left_right : 1; // 25 (0x2000000)
Expand Down
2 changes: 2 additions & 0 deletions headers/types/dungeon_mode/enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,8 @@ enum mission_type {
MISSION_ARREST_OUTLAW = 10,
MISSION_CHALLENGE_REQUEST = 11,
MISSION_TREASURE_MEMO = 12,
MISSION_TYPE_UNK_0xD = 13,
MISSION_SPECIAL_EPISODE = 14,
};

// This is usually stored as an 8-bit integer
Expand Down
Loading

0 comments on commit 26e5ea0

Please sign in to comment.