diff --git a/headers/data/arm9.h b/headers/data/arm9.h index 9fb8e209..c0f91a1e 100644 --- a/headers/data/arm9.h +++ b/headers/data/arm9.h @@ -156,6 +156,7 @@ extern int16_t IQ_SKILL_RESTRICTIONS[69]; extern struct secondary_terrain_type_8 SECONDARY_TERRAIN_TYPES[200]; extern struct monster_id_16 SENTRY_DUTY_MONSTER_IDS[102]; extern int32_t IQ_SKILLS[69]; +extern int MIN_TEAM_MEMBER_IQ; extern uint8_t IQ_GROUP_SKILLS[400]; extern int MONEY_QUANTITY_TABLE[100]; extern int16_t IQ_GUMMI_GAIN_TABLE[18][18]; diff --git a/headers/data/overlay29.h b/headers/data/overlay29.h index 6dc11fca..c345aad2 100644 --- a/headers/data/overlay29.h +++ b/headers/data/overlay29.h @@ -60,6 +60,7 @@ extern struct status_icon_flags STATUS_ICON_ARRAY_FREEZE[8]; extern struct status_icon_flags STATUS_ICON_ARRAY_CRINGE[8]; extern struct status_icon_flags STATUS_ICON_ARRAY_BIDE[14]; extern struct status_icon_flags STATUS_ICON_ARRAY_REFLECT[18]; +extern struct window_params DUNGEON_CONTROLS_MENU_WINDOW_PARAMS; extern enum direction_id POSITION_DISPLACEMENT_TO_DIRECTION[3][3]; extern int16_t DIRECTIONS_XY[8][2]; extern int FACING_DIRECTION_INCREMENTS[8]; @@ -97,6 +98,7 @@ extern undefined4 OV29_STATIC_INITIALIZER; extern struct dungeon* DUNGEON_PTR; extern struct dungeon* DUNGEON_PTR_MASTER; extern struct top_screen_status* TOP_SCREEN_STATUS_PTR; +extern struct dungeon_controls_menu* DUNGEON_CONTROLS_MENU_PTR; extern struct entity* LEADER_PTR; extern struct prng_state DUNGEON_PRNG_STATE; extern uint32_t DUNGEON_PRNG_STATE_SECONDARY_VALUES[5]; diff --git a/headers/functions/arm9.h b/headers/functions/arm9.h index 88afe22b..89e624bd 100644 --- a/headers/functions/arm9.h +++ b/headers/functions/arm9.h @@ -533,6 +533,7 @@ void DisplayAnimationControlCurrentFrame(struct animation_control* anim_ctrl); void DisplayAndSwitchAnimationControlCurrentFrame(struct animation_control* anim_ctrl); void FillOamAdjustmentInfo(struct animation_control* dst, uint16_t* src); uint32_t AnimationControlGetAllocForMaxFrame(struct animation_control* anim_ctrl); +void SetAnimationControlPausedFlag(struct animation_control* anim_ctrl, bool new_val); void DeleteWanTableEntry(struct wan_table* wan_table, int wan_id); int AllocateWanTableEntry(struct wan_table* wan_table); int FindWanTableEntry(struct wan_table* wan_table, const char* path); @@ -820,6 +821,7 @@ void CloseAdvancedTextBox(int window_id); bool IsAdvancedTextBoxActive(int window_id); uint32_t GetDigitInputResult(int window_id); uint8_t GetWindowIdPageStart(int window_id); +void SetWindowTitle(int window_id, uint16_t string_id); uint32_t GetAdvancedTextBoxFlags2(int window_id); void SetUnkAdvancedTextBoxFn(int window_id, unk_advanced_text_box_fn_t fn); void SetUnkAdvancedTextBoxWindowFn(int window_id, unk_advanced_text_box_window_fn_t fn); @@ -1290,7 +1292,7 @@ void GetNameOfTeamMemberAtIdx(char* out, int roster_idx); void GetRecoloredTeamMemberName(char* out, struct team_member* team_member); void ChangeGiratinaFormIfSkyDungeon(enum dungeon_id dungeon_id); void RevertGiratinaAndShaymin(uint8_t member_idx, undefined param_2); -void* OamTileNumberToVramAddress(uint16_t oam_tile_num, uint8_t screen); +void* OamTileNumberToVramAddress(uint16_t oam_tile_num, enum screen screen); int GetIqSkillStringId(enum iq_skill_id iq_skill); bool DoesTacticFollowLeader(enum tactic_id tactic_id); void GetUnlockedTactics(enum tactic_id* unlocked_tactics, int level); @@ -1298,7 +1300,7 @@ void GetUnlockedTacticFlags(bool* tactic_unlock_flags, int level); bool CanLearnIqSkill(int iq_amount, enum iq_skill_id iq_id); int GetLearnableIqSkills(struct iq_skill_id_8* out_iq_skill_id, enum monster_id monster_id, int monster_iq); -void DisableIqSkill(uint32_t* iq_skills_flags, enum iq_skill_id iq_id); +void ToggleIqSkill(uint32_t* iq_skills_flags, enum iq_skill_id iq_id); void EnableIqSkill(uint32_t* iq_skills_flags, enum iq_skill_id iq_id); enum iq_skill_id GetSpeciesIqSkill(enum monster_id monster_id, int index); void DisableAllIqSkills(uint32_t* iq_skills_flags); diff --git a/headers/functions/overlay10.h b/headers/functions/overlay10.h index a720024b..e6f6f155 100644 --- a/headers/functions/overlay10.h +++ b/headers/functions/overlay10.h @@ -14,7 +14,9 @@ void UpdateInventoryMenu(struct window* window); bool IsInventoryMenuState3(int window_id); void CreateInventoryMenuOuter(int n_items, int param_2, int param_3, uint8_t* param_4, undefined* param_5, undefined* param_6, uint32_t param_7); +void LoadPaletteBase(uint8_t sprite_index, bool is_4bpp); int GetEffectAnimationField0x19(int anim_id); +bool ScreenEffectActive(enum screen screen); bool AnimationHasMoreFrames(int param_1); struct effect_animation* GetEffectAnimation(int anim_id); struct move_animation* GetMoveAnimation(enum move_id move_id); @@ -27,8 +29,8 @@ undefined4 DrawTeamStats(undefined4 param_1, int param_2, undefined4 param_3, ui void UpdateTeamStats(void); int FreeTeamStats(void); int FreeMapAndTeam(void); -void ProcessTeamStatsLvHp(int idx); -void ProcessTeamStatsNameGender(int idx); +void ProcessTeamStatsLvHp(int window_id); +void ProcessTeamStatsNameGender(int window_id); bool IsBackgroundTileset(int tileset_id); void InitTilesetBuffer(void* buffer, int tileset_id, uint32_t malloc_flags); int MainGame(int end_cond); diff --git a/headers/functions/overlay29.h b/headers/functions/overlay29.h index 56dd2388..39fadcb2 100644 --- a/headers/functions/overlay29.h +++ b/headers/functions/overlay29.h @@ -25,7 +25,7 @@ void SetDungeonEscapeFields(uint32_t successful_exit_tracker, bool end_floor_no_ uint32_t GetSuccessfulExitTracker(void); void GetAndStoreButtonInput(void); bool CheckTouchscreenArea(int x1, int y1, int x2, int y2); -void* OamTileNumberToVramAddressOv29(short oam_tile_num, uint8_t screen); +void* OamTileNumberToVramAddressOv29(short oam_tile_num, enum screen screen); void ResetDungeonColorPalette(void); struct trap* GetTrapInfo(struct entity* trap_entity); struct item* GetItemInfo(struct entity* item_entity); @@ -57,6 +57,7 @@ void UpdateCamera(undefined param_1); bool ItemIsActive(struct entity* entity, enum item_id item_id); int GetVisibilityRange(void); void RevealWholeFloor(struct entity* entity); +bool DungeonScreenEffectActive(void); int PlayEffectAnimationEntity(struct entity* entity, int effect_id, bool play_now, int param_4, int param_5, undefined param_6, enum direction_id effect_dir, uint16_t* custom_oam_adjustment_info); @@ -87,10 +88,12 @@ void PlayDefensiveStatMultiplierDownEffect(struct entity* entity, int stat_index void PlayHitChanceUpEffect(struct entity* entity, int stat_index); void PlayHitChanceDownEffect(struct entity* entity, int stat_index); void PlaySeByIdIfShouldDisplayEntity(struct entity* entity, int se_id); +void PlayStairsSfx(void); bool ShouldDisplayEntityAdvanced(struct entity* entity); void PlayEffectAnimation0x1A9(struct entity* entity); void PlayEffectAnimation0x29(struct entity* entity); void PlayEffectAnimation0x18E(struct entity* entity); +void PlayKeyDoorUnlockEffect(struct entity* entity, bool is_not_treasure_memo); void PlayStairSensorArrowEffect(struct entity* entity, enum direction_id arrow_dir); void LoadMappaFileAttributes(int quick_saved, bool disable_monsters, undefined* special_process); enum trap_id GetRandomSpawnTrapId(void); @@ -110,6 +113,8 @@ int InitializeTeamStats(void); int UpdateTeamStatsWrapper(void); int FreeTeamStatsWrapper(void); void DisplayTeamStatsSprite(struct entity* team_member, int actual_idx, int roster_idx); +void InitDungeonControlsMenuWithBg(void); +void FreeDungeonControlsMenuWithBg(void); void AssignTopScreenHandlers(void** funcs, top_screen_status_fn_t init_func, top_screen_status_fn_t update_func, void* param_4, top_screen_status_fn_t free_func); @@ -117,6 +122,8 @@ void HandleTopScreenFades(void); int FreeTopScreen(void); void DungeonChangeTopScreenType(int top_screen_type); void DrawDungeonControlsText(int window_id); +void InitDungeonControlsMenu(void); +void FreeDungeonControlsMenu(void); enum direction_id GetDirectionTowardsPosition(struct position* origin, struct position* target); int GetChebyshevDistance(struct position* position_a, struct position* position_b); bool IsPositionActuallyInSight(struct position* origin, struct position* target, @@ -229,7 +236,7 @@ int SpawnMonstersAroundPos(struct entity* monster, struct position* pos, uint8_t void RevealTrapsNearby(struct entity* monster); bool RevealTrapAtPos(int x, int y); void CheckBossFightVictory(struct entity* fainted_entity, enum monster_behavior behavior, - bool change_music); + bool dont_change_music); void ChangeTeamAnimationsToIdle(void); bool IsFloorOver2(void); bool ShouldRunMonsterAi(struct entity* monster); @@ -237,6 +244,8 @@ bool DebugRecruitingEnabled(void); void TryActivateIqBooster(void); bool IsBehaviorLoneOutlaw(enum monster_behavior behavior); bool IsSecretBazaarNpcBehavior(enum monster_behavior behavior); +void FreezeAnim(struct entity* entity); +void UnfreezeAnim(struct entity* entity); bool TalkToSecretBazaarNpcStandard(int string_id, struct entity* shopkeeper, enum portrait_emotion emotion); bool TalkToSecretBazaarNpcWithYesNoMenu(int string_id, struct entity* shopkeeper, @@ -258,15 +267,22 @@ void CheckLeaderTile(void); void ChangeLeader(void); enum monster_gender GetPlayerGender(void); void HandleHeldItemSwaps(struct entity* entity); +void TryPlaceItem(struct entity* user); +void UseSingleUseItemSelf(struct entity* user); void UseSingleUseItemWrapper(struct entity* user); void UseSingleUseItem(struct entity* user, struct entity* target); void UseThrowableItem(struct entity* user); +void TalkToTeamMemberInFront(struct entity* entity); +void PlayerUseMove(struct entity* entity); +void UseRegularAttackOrStruggle(struct entity* entity); void ResetDamageData(struct damage_data* damage); void FreeLoadedAttackSpriteAndMore(void); uint16_t SetAndLoadCurrentAttackAnimation(enum pack_file_id pack_id, uint16_t file_index); void ClearLoadedAttackSprite(void); uint16_t GetLoadedAttackSpriteId(void); int DungeonGetTotalSpriteFileSize(enum monster_id monster_id); +void LoadMonsterSprites(void); +void LoadActiveMonsterSprites(void); uint16_t DungeonGetSpriteIndex(enum monster_id monster_id); bool JoinedAtRangeCheck2Veneer(struct dungeon_id_8 joined_at); bool FloorNumberIsEven(void); @@ -277,10 +293,12 @@ void SwapMonsterWanFileIndex(int src_id, int dst_id); void LoadMonsterSprite(enum monster_id monster_id, undefined param_2); void DeleteMonsterSpriteFile(enum monster_id monster_id); void DeleteAllMonsterSpriteFiles(void); +bool CanMonsterBeAddedToTeam(struct entity* entity); void EuFaintCheck(bool non_team_member_fainted, bool set_unk_byte); void HandleFaint(struct entity* fainted_entity, union damage_source damage_source, struct entity* killer); -void MoveMonsterToPos(struct entity* entity, int x_pos, int y_pos, undefined param_4); +void MoveMonsterToPos(struct entity* entity, int x_pos, int y_pos, bool reset_prev_pos_fields); +struct entity* GetMonsterInFront(struct entity* entity); void CreateMonsterSummaryFromEntity(struct monster_summary* monster_summary, struct entity* monster_entity); void FillRecruitInfo(struct recruit_info* recruit_info, struct entity* monster); @@ -342,6 +360,9 @@ void InitOtherMonsterData(struct entity* entity, int fixed_room_stats_index, enu void InitEnemySpawnStats(void); void InitEnemyStatsAndMoves(struct move* move_list, int16_t* hp, uint8_t* offensive_stats, uint8_t* defensive_stats); +void InitExplorerMazeMonsterStatsMovesAndIq(struct move* move_list, int16_t* hp, + uint8_t* offensive_stats, uint8_t* defensive_stats, + int16_t* iq, enum monster_behavior behavior); void SpawnTeam(undefined param_1); void SpawnInitialMonsters(void); struct entity* SpawnMonster(struct spawned_monster_data* monster_data, bool cannot_be_asleep); @@ -623,6 +644,8 @@ void ResetHitChanceStat(struct entity* user, struct entity* target, int stat_idx bool ExclusiveItemEffectIsActiveWithLogging(struct entity* user, struct entity* target, bool should_log, int message_id, enum exclusive_item_effect_id effect_id); +void LogMessageWithTargetAndExclusiveItemName(struct entity* user, struct entity* target, + int message_id, enum exclusive_item_effect_id effect); bool TryActivateQuickFeet(struct entity* attacker, struct entity* defender); void TryInflictTerrifiedStatus(struct entity* user, struct entity* target); bool TryInflictGrudgeStatus(struct entity* user, struct entity* target, bool log_message); @@ -733,6 +756,7 @@ bool TargetRegularAttack(struct entity* user, enum direction_id* direction, bool bool IsTargetInRange(struct entity* user, struct entity* target, enum direction_id direction, int n_tiles); bool ShouldUsePp(struct entity* entity); +void AiUseMove(struct entity* entity); struct move_target_and_range GetEntityMoveTargetAndRange(struct entity* entity, struct move* move, bool is_ai); struct natural_gift_item_info* GetEntityNaturalGiftInfo(struct entity* entity); @@ -894,6 +918,7 @@ void SetHiddenStairsField(enum hidden_stairs_type hidden_stairs); enum hidden_stairs_type GetHiddenFloorField(void); void SetHiddenFloorField(enum hidden_stairs_type hidden_floor); void LoadWeather3DFiles(void); +bool Weather3DEffectActive(void); void RenderWeather3D(void); struct minimap_display_data* GetMinimapData(void); void DrawMinimapTile(int x, int y); @@ -979,6 +1004,7 @@ void ResetHiddenStairsSpawn(void); void PlaceFixedRoomTile(struct tile* tile, union fixed_room_action action, int x, int y, bool place_item_or_trap); enum direction_id FixedRoomActionParamToDirection(uint8_t fixed_room_action_param); +void TryOpenKeyDoor(struct entity* user, struct tile* tile, int success_msg_id, int fail_msg_id); void ApplyKeyEffect(struct entity* user, struct entity* target); void LoadFixedRoomData(void); int LoadFixedRoom(int param_1, int param_2, int param_3, undefined4 param_4); @@ -1023,7 +1049,7 @@ void RemoveEmptyItemsInBagWrapper(void); void GenerateItem(struct item* item, enum item_id item_id, uint16_t quantity, enum gen_item_stickiness sticky_type); void HandleRegularProjectileThrow(struct entity* user, struct item* item, - struct position* start_pos, enum direction dir, + struct position* start_pos, enum direction_id dir, struct projectile_throw_info* projectile_throw_info); void HandleCurvedProjectileThrow(struct entity* user, struct item* item, struct position* start_pos, struct position* target_pos, @@ -1101,6 +1127,7 @@ int GetAlertBoxLoadingStatus(void); void LogMessage(struct entity* user, const char* message, bool show_popup); void LogMessageById(struct entity* user, int message_id, bool show_popup); bool AlertBoxIsActive(void); +bool FullyCloseAlertBox(void); bool AlertBoxIsScrolling(void); void WaitUntilAlertBoxTextIsLoaded(undefined param_1); void WaitUntilAlertBoxPauseIsOver(undefined param_1); diff --git a/headers/types/common/common.h b/headers/types/common/common.h index cc426307..b0d98461 100644 --- a/headers/types/common/common.h +++ b/headers/types/common/common.h @@ -1289,7 +1289,7 @@ struct menu_control { struct menu_load_entry active_entry; // 0xC4: The entry for the currently active menu // 0xD4: 0 means no menu active, 1 means menu initializing, 2 means menu active, 3 means ??? int state; - // 0xD8: Whether the overlay in active_entry should be unloaded upon calling FreeMenu + // 0xD8: Whether the overlay in active_entry should be unloaded upon calling FreeActiveMenu bool should_unload_overlay_on_free; undefined field_0xd9; undefined field_0xda; diff --git a/headers/types/common/graphics.h b/headers/types/common/graphics.h index f921839e..e28593e3 100644 --- a/headers/types/common/graphics.h +++ b/headers/types/common/graphics.h @@ -9,10 +9,13 @@ // Contains data relating to animation. // Mentioned under the name of "AnimeCtrl" in a debug message. struct animation_control { - uint16_t some_bitfield; + uint16_t some_bitfield1 : 14; + uint16_t anim_paused : 1; + uint16_t some_bitfield2 : 1; uint16_t unk_flags1 : 4; uint16_t no_auto_frame_switch : 1; - uint16_t unk_flags2 : 11; + uint16_t use_oam_adjustment_info : 1; + uint16_t unk_flags2 : 10; undefined2 field2_0x4; uint16_t anim_frame_duration; undefined2 field4_0x8; @@ -485,7 +488,7 @@ struct unk_palette_struct { struct palette_data_substruct extended_palette_sub; // 0x3C: Unused for top screen struct palette_data extended_palette_data; // 0x50: Unused for top screen undefined field_0x78; - bool is_top_screen; // 0x79 + struct screen_8 screen; // 0x79 undefined field_0x7a[34]; }; ASSERT_SIZE(struct unk_palette_struct, 156); diff --git a/headers/types/common/window.h b/headers/types/common/window.h index 3caba2e2..1775ab9b 100644 --- a/headers/types/common/window.h +++ b/headers/types/common/window.h @@ -329,7 +329,9 @@ ASSERT_SIZE(struct window_list, 4480); // This struct seems to always be at +0x4 of the various window contents structs // stored in window_params / returned by GetWindowContents. struct window_input_ctx { - undefined fields_0x0[180]; + undefined fields_0x0[28]; + uint16_t title_string_id; // 0x1C: String ID to use for the title + undefined fields_0x1e[150]; uint32_t first_item_y_offset; // 0xB4: Y-offset for first item on page // 0xB8: Difference in the Y-offset between one item and the next, shifted left by 8 bits uint32_t y_offset_diff; diff --git a/headers/types/dungeon_mode/dungeon_mode.h b/headers/types/dungeon_mode/dungeon_mode.h index a133f3c2..9604b9c9 100644 --- a/headers/types/dungeon_mode/dungeon_mode.h +++ b/headers/types/dungeon_mode/dungeon_mode.h @@ -2628,6 +2628,15 @@ struct recruit_info { }; ASSERT_SIZE(struct recruit_info, 72); +struct dungeon_controls_menu { + int8_t window_id; // 0x0 + undefined field_0x1; + undefined field_0x2; + undefined field_0x3; + struct preprocessor_args preprocessor_args; // 0x4 +}; +ASSERT_SIZE(struct dungeon_controls_menu, 84); + // Separate this out into its own file because it's massive #include "dungeon.h" diff --git a/symbols/arm9.yml b/symbols/arm9.yml index 92d30e64..014c0c05 100644 --- a/symbols/arm9.yml +++ b/symbols/arm9.yml @@ -5062,6 +5062,14 @@ arm9: r0: animation_control return: allocation for max frame + - name: SetAnimationControlPausedFlag + address: + EU: 0x201D234 + description: |- + Changes the flag for whether the animation should be paused. + + r0: animation_control + r1: whether the animation should be paused - name: DeleteWanTableEntry address: EU: 0x201D278 @@ -7685,6 +7693,14 @@ arm9: r0: window id return: first item on page + - name: SetWindowTitle + address: + EU: 0x2030D28 + description: |- + Sets the string ID to use for a window's title. + + r0: window id + r1: string id - name: GetAdvancedTextBoxFlags2 address: EU: 0x2030D34 @@ -12360,7 +12376,7 @@ arm9: Maps an object's designated OAM tile number (bits 0-9 in attribute 2) to the address its texture should be placed at in VRAM. r0: tile number - r1: 0 for bottom screen, 1 for top screen + r1: screen return: VRAM tile address - name: GetIqSkillStringId address: @@ -12430,16 +12446,18 @@ arm9: r1: Monster species r2: Monster IQ return: Amount of skills written to the output array - - name: DisableIqSkill + - name: ToggleIqSkill + aliases: + - DisableIqSkill address: EU: 0x2059120 NA: 0x2058DA4 JP: 0x20590A0 description: |- - Disables an IQ skill. + Turns an IQ skill on if it is inactive, or off if it is active. r0: Pointer to the bitarray containing the list of enabled IQ skills - r1: ID of the skill to disable + r1: ID of the skill to toggle - name: EnableIqSkill address: EU: 0x2059170 @@ -15318,6 +15336,12 @@ arm9: Table of 4-byte values for each IQ skill that represent the required IQ value to unlock a skill. type: int[69] + - name: MIN_TEAM_MEMBER_IQ + address: + EU: 0x20A2220 + length: + EU: 0x4 + description: The minimum IQ for a team member or Explorer Maze monster. - name: IQ_GROUP_SKILLS address: EU: 0x20A2314 @@ -16458,9 +16482,7 @@ arm9: type: int16_t[6] - name: MENU_CONTROL_PTR address: - EU: 0x20B06B4 - NA: 0x20AFD98 - JP: 0x20B11D8 + EU: 0x20B06D4 length: EU: 0x4 NA: 0x4 diff --git a/symbols/overlay10.yml b/symbols/overlay10.yml index a9046943..5c4efaf4 100644 --- a/symbols/overlay10.yml +++ b/symbols/overlay10.yml @@ -148,6 +148,16 @@ overlay10: stack[0]: ? stack[1]: ? statk[2]: uint32_t + - name: LoadPaletteBase + address: + EU: 0x22BE09C + description: |- + Loads either the 8bpp or 4bpp palette base (from WAN file 292 or 1, respectively). + + See https://github.com/WraithFire/wanimation-studio/blob/master/docs/README.md#sprite-modes + + r0: sprite index in wan_table to load from + r1: 0 for 8bpp, 1 for 4bpp - name: GetEffectAnimationField0x19 address: EU: 0x22BE7F4 @@ -158,6 +168,13 @@ overlay10: r0: anim_id return: GetEffectAnimation(anim_id)->field_0x19. + - name: ScreenEffectActive + address: + EU: 0x22C0228 + description: |- + Returns true if a screen effect (like Leaf Storm's or cutscene rain) is currently active on the given screen. + + r0: screen - name: AnimationHasMoreFrames address: EU: 0x22C0244 @@ -289,7 +306,7 @@ overlay10: description: |- Appears to populate the Lv./HP row in the "Team stats" top screen. - r0: index of some kind + r0: window id - name: ProcessTeamStatsNameGender address: EU: 0x22C21BC @@ -298,7 +315,7 @@ overlay10: description: |- Appears to populate the name/gender row in the "Team stats" top screen. - r0: index of some kind + r0: window id - name: IsBackgroundTileset address: EU: 0x22C2ECC diff --git a/symbols/overlay29.yml b/symbols/overlay29.yml index d8c13ae7..6b822c9c 100644 --- a/symbols/overlay29.yml +++ b/symbols/overlay29.yml @@ -400,7 +400,7 @@ overlay29: Is an exact copy of OamTileNumberToVramAddress in arm9. r0: tile number - r1: 0 for bottom screen, 1 for top screen + r1: screen return: VRAM tile address - name: ResetDungeonColorPalette address: @@ -767,6 +767,13 @@ overlay29: More specifically, sets dungeon::display_data::luminous to 1, sets visibility_flags::f_revealed for all tiles on the floor, calls UpdateCamera, UpdateTrapsVisibility, UpdateMinimap and logs the message "It became brighter on the floor!". r0: Pointer to the entity who revealed the floor + - name: DungeonScreenEffectActive + address: + EU: 0x22E3F30 + description: |- + Returns true if a screen effect (like Leaf Storm's or Sunny Day's) is currently active. + + return: bool - name: PlayEffectAnimationEntity address: EU: 0x22E3F94 @@ -1061,6 +1068,13 @@ overlay29: r0: entity pointer r1: Sound effect ID + - name: PlayStairsSfx + address: + EU: 0x22E6718 + description: |- + Plays the appropriate sound effect for climbing/descending the stairs, or nothing if the stairs are replaced by a warp zone or rescue point. + + No params. - name: ShouldDisplayEntityAdvanced address: EU: 0x22E6880 @@ -1116,6 +1130,14 @@ overlay29: Just a guess. Calls PlayEffectAnimation with data from animation ID 0x18E. r0: entity pointer + - name: PlayKeyDoorUnlockEffect + address: + EU: 0x22E7044 + description: |- + Plays the key door unlock effect. + + r0: entity pointer + r1: whether the key door is not for a treasure memo (plays a sound if true) - name: PlayStairSensorArrowEffect address: EU: 0x22E72D8 @@ -1307,6 +1329,20 @@ overlay29: r0: Team member entity pointer r1: Actual index to display the sprite at r2: Roster index + - name: InitDungeonControlsMenuWithBg + address: + EU: 0x22E8EB0 + description: |- + Calls InitDungeonControlsMenu and loads the menu's background. + + No params. + - name: FreeDungeonControlsMenuWithBg + address: + EU: 0x22E8F38 + description: |- + Calls FreeDungeonControlsMenu and unloads the menu's background. + + No params. - name: AssignTopScreenHandlers address: EU: 0x22E9078 @@ -1358,6 +1394,20 @@ overlay29: Draws the text for the top screen controls menu in the given window. r0: window id + - name: InitDungeonControlsMenu + address: + EU: 0x22E9844 + description: |- + Initializes the dungeon controls menu. + + No params. + - name: FreeDungeonControlsMenu + address: + EU: 0x22E98D8 + description: |- + Frees the dungeon controls menu. + + No params. - name: GetDirectionTowardsPosition address: EU: 0x22E99D0 @@ -2454,7 +2504,7 @@ overlay29: r0: fainted entity r1: behavior of fainted monster (the function will do nothing if it's not a fixed room enemy) - r2: whether to change the music if the boss fight is over + r2: whether to not change the music if the boss fight is over - name: ChangeTeamAnimationsToIdle address: EU: 0x22F02EC @@ -2527,6 +2577,20 @@ overlay29: r0: monster behavior ID return: bool + - name: FreezeAnim + address: + EU: 0x22F0EA4 + description: |- + Freezes a monster's current animation. + + r0: entity pointer + - name: UnfreezeAnim + address: + EU: 0x22F0ECC + description: |- + Unfreezes a monster's current animation. + + r0: entity pointer - name: TalkToSecretBazaarNpcStandard address: EU: 0x22F0FB8 @@ -2700,6 +2764,22 @@ overlay29: Handles giving/taking held items to/from a party member (and likely other things). r0: entity pointer + - name: TryPlaceItem + address: + EU: 0x22F55B4 + description: |- + Tries to place an item on the floor, and logs various failure messages under different conditions. + + The item to use is determined by the user's monster::action_data::action_parameter[0]. + + r0: User entity pointer + - name: UseSingleUseItemSelf + address: + EU: 0x22F5C78 + description: |- + Same as UseSingleUseItem, but the target will be set to the user. + + r0: User - name: UseSingleUseItemWrapper address: EU: 0x22F5C88 @@ -2733,6 +2813,27 @@ overlay29: If the item's category is CATEGORY_THROWN_LINE or CATEGORY_THROWN_ARC, the game will attempt to decrement the count of the used item by 1. If it's not or there's only 1 item left, it is destroyed instead. r0: User (monster who used the item) + - name: TalkToTeamMemberInFront + address: + EU: 0x22F6380 + description: |- + Talks to the team member in front of the given entity, if there is one and it is on a tile the entity can attack in. + + r0: Entity pointer + - name: PlayerUseMove + address: + EU: 0x22F68D0 + description: |- + Handles using a move by the player. + + r0: entity pointer + - name: UseRegularAttackOrStruggle + address: + EU: 0x22F6A10 + description: |- + Handles using the regular attack or Struggle by the entity. + + r0: entity pointer - name: ResetDamageData address: EU: 0x22F77D0 @@ -2793,6 +2894,20 @@ overlay29: r0: monster ID return: sprite file size + - name: LoadMonsterSprites + address: + EU: 0x22F7AE8 + description: |- + The main function for loading monster sprites at the beginning of a floor. + + No params. + - name: LoadActiveMonsterSprites + address: + EU: 0x22F7CC0 + description: |- + Loads the sprites of all active monsters on the floor based on their apparent ids. Used when loading quicksaves. + + No params. - name: DungeonGetSpriteIndex address: EU: 0x22F7D40 @@ -2893,6 +3008,13 @@ overlay29: Note: unverified, ported from Irdkwia's notes No params. + - name: CanMonsterBeAddedToTeam + address: + EU: 0x22F81EC + description: |- + Returns false if there are already four members on the active team or if the total body size of the team would be greater than 6 if this monster was added. + + r0: entity pointer - name: EuFaintCheck address: EU: 0x22F88E8 @@ -2924,7 +3046,15 @@ overlay29: r0: Entity pointer r1: X target position r2: Y target position - r3: ? + r3: whether to reset the monster struct's prev_pos, prev_pos_2, etc. fields to the target position + - name: GetMonsterInFront + address: + EU: 0x22F91CC + description: |- + Returns the monster in front of the given entity, or null if there is none or it is on a tile they cannot attack in. + + r0: Entity pointer + return: Entity pointer of monster in front - name: CreateMonsterSummaryFromEntity aliases: - CreateMonsterSummaryFromMonster @@ -3605,10 +3735,22 @@ overlay29: description: |- Initializes the HP, Atk, Sp. Atk, Def, Sp. Def and moveset of a newly spawned enemy. Might do something else too. - r0: Pointer to the monster's move list - r1: Pointer to the monster's current HP - r2: Pointer to the monster's offensive stats - r3: Pointer to the monster's defensive stats + r0: [output] Pointer to the monster's move list + r1: [output] Pointer to the monster's current HP + r2: [output] Pointer to the monster's offensive stats + r3: [output] Pointer to the monster's defensive stats + - name: InitExplorerMazeMonsterStatsMovesAndIq + address: + EU: 0x22FCE64 + description: |- + Initializes the HP, offensive/defensive stats, and IQ of an explorer maze monster. + + r0: [output] Pointer to the monster's move list + r1: [output] Pointer to the monster's current HP + r2: [output] Pointer to the monster's offensive stats + r3: [output] Pointer to the monster's defensive stats + stack[0]: Pointer to the monster's IQ + stack[1]: Monster behavior - name: SpawnTeam address: EU: 0x22FCF08 @@ -6163,6 +6305,16 @@ overlay29: r3: message ID to be logged if the effect is active stack[0]: exclusive item effect ID return: bool, same as ExclusiveItemEffectIsActive + - name: LogMessageWithTargetAndExclusiveItemName + address: + EU: 0x2315824 + description: |- + Logs the given string ID, substituting its [string:0] tag for the target's name and [item:1] for an exclusive item in the bag which has the given effect id. + + r0: user entity pointer + r1: target entity pointer + r2: string id + r3: exclusive item effect id - name: TryActivateQuickFeet address: EU: 0x231587C @@ -7173,6 +7325,13 @@ overlay29: r0: entity pointer return: True if the monster should not use PP, false if it should. + - name: AiUseMove + address: + EU: 0x231B300 + description: |- + Handles using a move by the AI. + + r0: entity pointer - name: GetEntityMoveTargetAndRange address: EU: 0x231B70C @@ -8723,6 +8882,13 @@ overlay29: Loads the 1001.wte, 1005.wte, and 1031.wte files in dungeon.bin, which are used for the 3D effects for the tileset weather as well as the Sandstorm/Fog weather conditions. No params. + - name: Weather3DEffectActive + address: + EU: 0x2339558 + description: |- + Returns true if a 3D weather effect (a tileset weather or Sandstorm/Fog) is active. + + return: bool - name: RenderWeather3D address: EU: 0x2339694 @@ -9594,14 +9760,25 @@ overlay29: r0: Parameter value return: Direction + - name: TryOpenKeyDoor + address: + EU: 0x23445BC + description: |- + Attempts to open a locked door at the given tile if a locked door has not already + been opened on the floor. + + r0: user entity pointer + r1: tile pointer + r2: success string id + r3: failure string id - name: ApplyKeyEffect address: EU: 0x23448BC NA: 0x2343CD8 JP: 0x234509C description: |- - Attempts to open a locked door in front of the target if a locked door has not already - been open on the floor. + Attempts to open a locked door above the target if a locked door has not already + been opened on the floor. r0: user entity pointer r1: target entity pointer @@ -10707,6 +10884,13 @@ overlay29: Returns true if the alert box is currently open. return: bool + - name: FullyCloseAlertBox + address: + EU: 0x234C368 + description: |- + Fully closes the alert box, calling CloseAlertBox and various other functions as well as changing the window id and loading status. + + return: whether the alert box was closed - name: AlertBoxIsScrolling address: EU: 0x234C3EC @@ -11705,6 +11889,11 @@ overlay29: EU: 0x90 NA: 0x90 description: "Array of bit masks used to set monster::status_icon. Indexed by monster::statuses::reflect * 8. See UpdateStatusIconFlags for details." + - name: DUNGEON_CONTROLS_MENU_WINDOW_PARAMS + address: + EU: 0x2352200 + length: + EU: 0x10 - name: POSITION_DISPLACEMENT_TO_DIRECTION address: EU: 0x2352210 @@ -12117,7 +12306,16 @@ overlay29: description: |- [Runtime] Pointer for struct for handling the status of the top screen in dungeon mode. - type: struct top_screen_status + type: struct top_screen_status* + - name: DUNGEON_CONTROLS_MENU_PTR + address: + EU: 0x2354158 + length: + EU: 0x4 + description: |- + [Runtime] Pointer for struct for displaying the dungeon controls menu. + + type: struct dungeon_controls_menu* - name: LEADER_PTR address: EU: 0x235415C