From 54c7ef9fc69e8dc8ebe953613cc1452cd00d3f75 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Tue, 29 Dec 2015 18:41:57 -0800 Subject: [PATCH] naming/renaming some field object functions --- asm/emerald.s | 5314 +++++++++++--------- asm/gpu_obj.s | 4 +- data/event_script_command_function_table.s | 2 +- 3 files changed, 2807 insertions(+), 2513 deletions(-) diff --git a/asm/emerald.s b/asm/emerald.s index 7bc2bf403..ed3bb2df0 100644 --- a/asm/emerald.s +++ b/asm/emerald.s @@ -21058,7 +21058,7 @@ sub_8014210: ; 8014210 lsrs r6, 16 bl sp000_heal_pokemon bl copy_player_party_to_sav1 - bl sub_8076ECC + bl copy_bags_and_unk_data_from_save_blocks ldr r5, =0x020229e8 ldr r0, =0x00002211 str r0, [r5, 0x14] @@ -21426,7 +21426,7 @@ sub_801440C: ; 801440C bl sub_80143E4 bl sp000_heal_pokemon bl copy_player_party_to_sav1 - bl sub_8076ECC + bl copy_bags_and_unk_data_from_save_blocks movs r0, 0x1 str r0, [sp] movs r0, 0x19 @@ -21439,7 +21439,7 @@ sub_801440C: ; 801440C bl overworld_free_bg_tilemaps bl sp000_heal_pokemon bl copy_player_party_to_sav1 - bl sub_8076ECC + bl copy_bags_and_unk_data_from_save_blocks ldr r0, =0x020228c4 movs r1, 0x1 bl sub_80143E4 @@ -21455,7 +21455,7 @@ sub_801440C: ; 801440C bl overworld_free_bg_tilemaps bl sp000_heal_pokemon bl copy_player_party_to_sav1 - bl sub_8076ECC + bl copy_bags_and_unk_data_from_save_blocks ldr r0, =0x020228c4 movs r1, 0x1 bl sub_80143E4 @@ -23140,8 +23140,8 @@ task00_081182DC: ; 80152F4 bx r0 thumb_func_end task00_081182DC - thumb_func_start sub_801560C -sub_801560C: ; 801560C + thumb_func_start UnionRoomSpecial +UnionRoomSpecial: ; 801560C push {r4,lr} bl sub_8010F60 ldr r0, =sub_80156E0 @@ -23168,7 +23168,7 @@ sub_801560C: ; 801560C pop {r0} bx r0 .pool - thumb_func_end sub_801560C + thumb_func_end UnionRoomSpecial thumb_func_start sub_8015658 sub_8015658: ; 8015658 @@ -31357,7 +31357,7 @@ sub_8019AB8: ; 8019AB8 ldr r2, [r1] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] - bl npc_hide_by_local_id_and_map + bl RemoveFieldObjectByLocalIdAndMap pop {r0} bx r0 .pool @@ -31376,7 +31376,7 @@ sub_8019AD8: ; 8019AD8 ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] mov r3, sp - bl npc_id_by_local_id_and_map_ret_success + bl TryGetFieldObjectIdByLocalIdAndMap lsls r0, 24 cmp r0, 0 bne @08019B30 @@ -31388,13 +31388,13 @@ sub_8019AD8: ; 8019AD8 ldr r1, =0x02037350 adds r4, r0, r1 adds r0, r4, 0 - bl npc_is_visible_or_is_x40 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive lsls r0, 24 cmp r0, 0 bne @08019B30 ldrb r1, [r5] adds r0, r4, 0 - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim lsls r0, 24 cmp r0, 0 bne @08019B30 @@ -31422,7 +31422,7 @@ sub_8019B3C: ; 8019B3C ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] mov r3, sp - bl npc_id_by_local_id_and_map_ret_success + bl TryGetFieldObjectIdByLocalIdAndMap lsls r0, 24 cmp r0, 0 bne @08019B9C @@ -31434,7 +31434,7 @@ sub_8019B3C: ; 8019B3C ldr r1, =0x02037350 adds r4, r0, r1 adds r0, r4, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished lsls r0, 24 cmp r0, 0 bne @08019B84 @@ -31562,7 +31562,7 @@ sub_8019C38: ; 8019C38 adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to + bl PlayerGetDestCoords mov r0, sp movs r1, 0 ldrsh r2, [r0, r1] @@ -32115,7 +32115,7 @@ sub_801A064: ; 801A064 adds r6, 0x2 mov r0, sp adds r1, r6, 0 - bl player_get_pos_to + bl PlayerGetDestCoords add r4, sp, 0x4 mov r5, sp adds r5, 0x6 @@ -32398,7 +32398,7 @@ sub_801A2A8: ; 801A2A8 b @0801A396 @0801A2C4: ldr r4, =gUnknown_082F076A - bl player_get_direction__sp1AA + bl player_get_direction_lower_nybble lsls r0, 24 lsrs r0, 24 adds r0, r4 @@ -77701,7 +77701,7 @@ LoadCompressedObjectPicOverrideBuffer: ; 8034564 thumb_func_end LoadCompressedObjectPicOverrideBuffer thumb_func_start LoadCompressedObjectPalette -; void LoadCompressedObjectPalette(struct ObjectPaletteInfo *palette) +; void LoadCompressedObjectPalette(struct TaggedObjectPalette *palette) LoadCompressedObjectPalette: ; 803458C push {r4,r5,lr} sub sp, 0x8 @@ -77727,7 +77727,7 @@ LoadCompressedObjectPalette: ; 803458C thumb_func_end LoadCompressedObjectPalette thumb_func_start LoadCompressedObjectPaletteOverrideBuffer -; void LoadCompressedObjectPaletteOverrideBuffer(struct ObjectPaletteInfo *palette, void *tempBuffer) +; void LoadCompressedObjectPaletteOverrideBuffer(struct TaggedObjectPalette *palette, void *tempBuffer) LoadCompressedObjectPaletteOverrideBuffer: ; 80345C0 push {r4,r5,lr} sub sp, 0x8 @@ -78297,7 +78297,7 @@ LoadCompressedObjectPicUsingHeap: ; 8034988 thumb_func_end LoadCompressedObjectPicUsingHeap thumb_func_start LoadCompressedObjectPaletteUsingHeap -; u32 LoadCompressedObjectPaletteUsingHeap(struct ObjectPaletteInfo *palette) +; u32 LoadCompressedObjectPaletteUsingHeap(struct TaggedObjectPalette *palette) LoadCompressedObjectPaletteUsingHeap: ; 80349C4 push {r4,r5,lr} sub sp, 0x8 @@ -89776,7 +89776,7 @@ sub_803AC84: ; 803AC84 add r1, r10 ldr r2, [r1] movs r1, 0x2 - bl sub_806F01C + bl SetPokedexFlag b @0803AEC0 .pool @0803AE60: @@ -89803,7 +89803,7 @@ sub_803AC84: ; 803AC84 add r1, r10 ldr r2, [r1] movs r1, 0x2 - bl sub_806F01C + bl SetPokedexFlag @0803AE96: movs r0, 0 bl dp01_build_cmdbuf_x04_4_4_4 @@ -90363,7 +90363,7 @@ bc_801362C: ; 803B314 adds r1, r7 ldr r2, [r1] movs r1, 0x2 - bl sub_806F01C + bl SetPokedexFlag @0803B36C: ldrb r0, [r4] adds r0, 0x1 @@ -121705,7 +121705,7 @@ atk4E_switch3: ; 804CAE8 adds r1, r4 ldr r2, [r1] movs r1, 0x2 - bl sub_806F01C + bl SetPokedexFlag @0804CB3E: ldr r2, =0x02024210 ldr r1, =gUnknown_0832A328 @@ -139738,7 +139738,7 @@ atkF1_802D95C: ; 8056850 lsrs r0, 16 movs r1, 0x3 adds r2, r4, 0 - bl sub_806F01C + bl SetPokedexFlag ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 @@ -173158,8 +173158,8 @@ sub_8068BB0: ; 8068BB0 .pool thumb_func_end sub_8068BB0 - thumb_func_start sub_8068C18 -sub_8068C18: ; 8068C18 + thumb_func_start DoScriptedWildBattle +DoScriptedWildBattle: ; 8068C18 push {r4-r7,lr} sub sp, 0x14 ldr r0, =0x020375e0 @@ -173199,7 +173199,7 @@ sub_8068C18: ; 8068C18 pop {r0} bx r0 .pool - thumb_func_end sub_8068C18 + thumb_func_end DoScriptedWildBattle thumb_func_start pokemon_calc_checksum ; int pokemon_calc_checksum(pokemon *mon) @@ -185736,8 +185736,9 @@ sub_806F000: ; 806F000 bx r1 thumb_func_end sub_806F000 - thumb_func_start sub_806F01C -sub_806F01C: ; 806F01C + thumb_func_start SetPokedexFlag +; void SetPokedexFlag(u16 nationalPokedexNum, u8 op, u32 personality) +SetPokedexFlag: ; 806F01C push {r4-r7,lr} adds r7, r2, 0 lsls r0, 16 @@ -185783,7 +185784,7 @@ sub_806F01C: ; 806F01C pop {r0} bx r0 .pool - thumb_func_end sub_806F01C + thumb_func_end SetPokedexFlag thumb_func_start sub_806F07C sub_806F07C: ; 806F07C @@ -187230,6 +187231,7 @@ sub_806FA9C: ; 806FA9C thumb_func_end sub_806FA9C thumb_func_start daycare_empty_slot +; u8 daycare_empty_slot(struct daycare_mon *dayCareMons) daycare_empty_slot: ; 806FB08 push {r4,r5,lr} adds r5, r0, 0 @@ -187260,6 +187262,7 @@ daycare_empty_slot: ; 806FB08 thumb_func_end daycare_empty_slot thumb_func_start sub_806FB38 +; void sub_806FB38(struct pokemon *mon, struct daycare_mon *dayCareMon) sub_806FB38: ; 806FB38 push {r4-r6,lr} adds r6, r0, 0 @@ -187342,6 +187345,7 @@ sub_806FB38: ; 806FB38 thumb_func_end sub_806FB38 thumb_func_start daycare_send +; void daycare_send(struct pokemon *mon, struct daycare_mon *dayCareMons) daycare_send: ; 806FBF4 push {r4,r5,lr} adds r5, r0, 0 @@ -200925,8 +200929,9 @@ clear_sav1: ; 8076BB8 .pool thumb_func_end clear_sav1 - thumb_func_start sub_8076BDC -sub_8076BDC: ; 8076BDC + thumb_func_start InitSaveBlockPointersWithRandomOffset +; void InitSaveBlockPointersWithRandomOffset(u8 offset) +InitSaveBlockPointersWithRandomOffset: ; 8076BDC push {r4,r5,lr} adds r4, r0, 0 lsls r4, 16 @@ -200953,7 +200958,7 @@ sub_8076BDC: ; 8076BDC pop {r0} bx r0 .pool - thumb_func_end sub_8076BDC + thumb_func_end InitSaveBlockPointersWithRandomOffset thumb_func_start saveblock_randomize_and_relocate saveblock_randomize_and_relocate: ; 8076C2C @@ -201002,7 +201007,7 @@ saveblock_randomize_and_relocate: ; 8076C2C adds r1, r0 ldrb r0, [r4, 0xD] adds r0, r1 - bl sub_8076BDC + bl InitSaveBlockPointersWithRandomOffset ldr r1, =0x03005d90 ldr r0, [r1] adds r1, r4, 0 @@ -201034,7 +201039,7 @@ saveblock_randomize_and_relocate: ; 8076C2C lsrs r0, 16 adds r4, r0 adds r0, r4, 0 - bl saveblock_randomize_position + bl saveblock_apply_crypto ldr r1, =0x03005d90 ldr r0, [r1] adds r0, 0xAC @@ -201277,8 +201282,8 @@ save_deserialize_game: ; 8076EBC bx r0 thumb_func_end save_deserialize_game - thumb_func_start sub_8076ECC -sub_8076ECC: ; 8076ECC + thumb_func_start copy_bags_and_unk_data_from_save_blocks +copy_bags_and_unk_data_from_save_blocks: ; 8076ECC push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -201414,10 +201419,10 @@ sub_8076ECC: ; 8076ECC pop {r0} bx r0 .pool - thumb_func_end sub_8076ECC + thumb_func_end copy_bags_and_unk_data_from_save_blocks - thumb_func_start sub_8076FE0 -sub_8076FE0: ; 8076FE0 + thumb_func_start copy_bags_and_unk_data_to_save_blocks +copy_bags_and_unk_data_to_save_blocks: ; 8076FE0 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -201558,7 +201563,7 @@ sub_8076FE0: ; 8076FE0 pop {r0} bx r0 .pool - thumb_func_end sub_8076FE0 + thumb_func_end copy_bags_and_unk_data_to_save_blocks thumb_func_start apply_u16_xor_crypto apply_u16_xor_crypto: ; 8077100 @@ -201588,8 +201593,8 @@ apply_u32_xor_crypto: ; 8077118 .pool thumb_func_end apply_u32_xor_crypto - thumb_func_start saveblock_randomize_position -saveblock_randomize_position: ; 8077130 + thumb_func_start saveblock_apply_crypto +saveblock_apply_crypto: ; 8077130 push {r4,r5,lr} adds r4, r0, 0 bl sub_8084864 @@ -201613,7 +201618,7 @@ saveblock_randomize_position: ; 8077130 pop {r0} bx r0 .pool - thumb_func_end saveblock_randomize_position + thumb_func_end saveblock_apply_crypto thumb_func_start sub_8077170 sub_8077170: ; 8077170 @@ -209499,7 +209504,7 @@ sub_807B464: ; 807B464 adds r0, r4, 0 movs r1, 0x3 adds r2, r5, 0 - bl sub_806F01C + bl SetPokedexFlag @0807B4B8: pop {r4,r5} pop {r0} @@ -221543,7 +221548,7 @@ sub_8081FC8: ; 8081FC8 @08082284: b @08082458 @08082286: - bl sub_8083450 + bl berry_blender_related lsls r0, 24 cmp r0, 0 bne @08082292 @@ -223655,8 +223660,9 @@ sub_80833F8: ; 80833F8 .pool thumb_func_end sub_80833F8 - thumb_func_start sub_8083418 -sub_8083418: ; 8083418 + thumb_func_start UpdateBerryBlenderRecord +; void UpdateBerryBlenderRecord() +UpdateBerryBlenderRecord: ; 8083418 push {lr} ldr r0, =0x03005d8c ldr r2, [r0] @@ -223680,10 +223686,10 @@ sub_8083418: ; 8083418 pop {r0} bx r0 .pool - thumb_func_end sub_8083418 + thumb_func_end UpdateBerryBlenderRecord - thumb_func_start sub_8083450 -sub_8083450: ; 8083450 + thumb_func_start berry_blender_related +berry_blender_related: ; 8083450 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -224153,7 +224159,7 @@ sub_8083450: ; 8083450 bl sub_808417C cmp r0, 0 beq @08083898 - bl sub_8083418 + bl UpdateBerryBlenderRecord movs r0, 0x1 b @0808389A .pool @@ -224168,7 +224174,7 @@ sub_8083450: ; 8083450 pop {r4-r7} pop {r1} bx r1 - thumb_func_end sub_8083450 + thumb_func_end berry_blender_related thumb_func_start sub_80838AC sub_80838AC: ; 80838AC @@ -224834,8 +224840,8 @@ sub_8083B08: ; 8083B08 bx r1 thumb_func_end sub_8083B08 - thumb_func_start sub_8083E24 -sub_8083E24: ; 8083E24 + thumb_func_start ShowBerryBlenderRecordWindow +ShowBerryBlenderRecordWindow: ; 8083E24 push {r4-r7,lr} sub sp, 0x34 ldr r0, =gUnknown_08339D14 @@ -224945,7 +224951,7 @@ sub_8083E24: ; 8083E24 pop {r0} bx r0 .pool - thumb_func_end sub_8083E24 + thumb_func_end ShowBerryBlenderRecordWindow thumb_func_start sub_8083F3C sub_8083F3C: ; 8083F3C @@ -225927,6 +225933,7 @@ sub_80847A8: ; 80847A8 thumb_func_end sub_80847A8 thumb_func_start sav12_xor_increment +; void sav12_xor_increment(u8 a1) sav12_xor_increment: ; 80847C4 push {r4,lr} lsls r0, 24 @@ -226033,8 +226040,8 @@ sub_8084864: ; 8084864 .pool thumb_func_end sub_8084864 - thumb_func_start sub_8084894 -sub_8084894: ; 8084894 + thumb_func_start copy_rom_field_objects_to_saveblock1 +copy_rom_field_objects_to_saveblock1: ; 8084894 push {r4,r5,lr} sub sp, 0x4 movs r0, 0 @@ -226065,10 +226072,10 @@ sub_8084894: ; 8084894 pop {r0} bx r0 .pool - thumb_func_end sub_8084894 + thumb_func_end copy_rom_field_objects_to_saveblock1 - thumb_func_start sub_80848E0 -sub_80848E0: ; 80848E0 + thumb_func_start copy_rom_field_object_coords_to_saveblock1 +copy_rom_field_object_coords_to_saveblock1: ; 80848E0 push {lr} ldr r0, =0x02037318 ldr r1, [r0, 0x4] @@ -226090,10 +226097,10 @@ sub_80848E0: ; 80848E0 pop {r0} bx r0 .pool - thumb_func_end sub_80848E0 + thumb_func_end copy_rom_field_object_coords_to_saveblock1 - thumb_func_start sub_8084910 -sub_8084910: ; 8084910 + thumb_func_start update_saveblock1_field_object_coords +update_saveblock1_field_object_coords: ; 8084910 push {r4-r6,lr} lsls r0, 24 lsrs r5, r0, 24 @@ -226124,10 +226131,10 @@ sub_8084910: ; 8084910 pop {r4-r6} pop {r0} bx r0 - thumb_func_end sub_8084910 + thumb_func_end update_saveblock1_field_object_coords - thumb_func_start sub_808494C -sub_808494C: ; 808494C + thumb_func_start update_saveblock1_field_object_movement_behavior +update_saveblock1_field_object_movement_behavior: ; 808494C push {r4,r5,lr} lsls r0, 24 lsrs r4, r0, 24 @@ -226155,7 +226162,7 @@ sub_808494C: ; 808494C pop {r4,r5} pop {r0} bx r0 - thumb_func_end sub_808494C + thumb_func_end update_saveblock1_field_object_movement_behavior thumb_func_start mapdata_load_assets_to_gpu_and_full_redraw mapdata_load_assets_to_gpu_and_full_redraw: ; 8084980 @@ -227142,7 +227149,7 @@ mliX_load_map: ; 8085098 @080850C8: bl warp_shift bl set_current_map_header_from_sav1_save_old_name - bl sub_8084894 + bl copy_rom_field_objects_to_saveblock1 bl sav2_set_x9_depending_on_sav1_map bl sub_809D344 bl wild_pokemon_reroll @@ -227154,7 +227161,7 @@ mliX_load_map: ; 8085098 bl sub_80AEDBC bl sub_8085B2C bl update_sav1_flash_used_on_map - bl sav1_reset_x2C + bl sav1_reset_battle_music_maybe bl mapheader_run_script_with_tag_x3 bl sub_8087D54 ldr r0, [r4] @@ -227219,7 +227226,7 @@ mli0_load_map: ; 8085160 bl sub_81D5DF8 b @080851A2 @0808519E: - bl sub_8084894 + bl copy_rom_field_objects_to_saveblock1 @080851A2: ldr r4, =0x02037318 ldrb r0, [r4, 0x17] @@ -227259,7 +227266,7 @@ mli0_load_map: ; 8085160 bl FlagReset @08085200: bl update_sav1_flash_used_on_map - bl sav1_reset_x2C + bl sav1_reset_battle_music_maybe bl mapheader_run_script_with_tag_x3 bl mapnumbers_history_shift_sav1_0_2_4_out bl sub_8161D00 @@ -227310,11 +227317,11 @@ player_avatar_init_params_reset: ; 8085268 thumb_func_start walkrun_find_lowest_active_bit_in_bitfield walkrun_find_lowest_active_bit_in_bitfield: ; 8085278 push {r4,lr} - bl player_get_direction__sp1AA + bl player_get_direction_lower_nybble ldr r4, =0x02032300 strb r0, [r4, 0x1] movs r0, 0x2 - bl walkrun_bitfield_and_r0 + bl TestPlayerAvatarFlags lsls r0, 24 cmp r0, 0 beq @08085298 @@ -227323,7 +227330,7 @@ walkrun_find_lowest_active_bit_in_bitfield: ; 8085278 .pool @08085298: movs r0, 0x4 - bl walkrun_bitfield_and_r0 + bl TestPlayerAvatarFlags lsls r0, 24 cmp r0, 0 beq @080852A8 @@ -227331,7 +227338,7 @@ walkrun_find_lowest_active_bit_in_bitfield: ; 8085278 b @080852CA @080852A8: movs r0, 0x8 - bl walkrun_bitfield_and_r0 + bl TestPlayerAvatarFlags lsls r0, 24 cmp r0, 0 beq @080852B8 @@ -227339,7 +227346,7 @@ walkrun_find_lowest_active_bit_in_bitfield: ; 8085278 b @080852CA @080852B8: movs r0, 0x10 - bl walkrun_bitfield_and_r0 + bl TestPlayerAvatarFlags lsls r0, 24 cmp r0, 0 beq @080852C8 @@ -227417,7 +227424,7 @@ sub_808532C: ; 808532C @08085354: lsls r0, r5, 24 lsrs r0, 24 - bl is_tile_water_maybe + bl MetatileBehavior_IsSurfableWaterOrUnderwater lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -227485,7 +227492,7 @@ sub_808538C: ; 808538C cmp r0, 0x1 beq @08085442 adds r0, r5, 0 - bl is_tile_x65_warp_arrow_down + bl MetatileBehavior_IsSouthArrowWarp lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -227496,13 +227503,13 @@ sub_808538C: ; 808538C .pool @080853F0: adds r0, r5, 0 - bl sub_8088FD4 + bl MetatileBehavior_IsNorthArrowWarp lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @08085442 adds r0, r5, 0 - bl is_tile_x63_warp_arrow_left + bl MetatileBehavior_IsWestArrowWarp lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -227512,7 +227519,7 @@ sub_808538C: ; 808538C b @08085448 @08085410: adds r0, r5, 0 - bl is_tile_x62_warp_arrow_right + bl MetatileBehavior_IsEastArrowWarp lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -228011,7 +228018,7 @@ sub_8085784: ; 8085784 .pool @080857C8: movs r0, 0x8 - bl walkrun_bitfield_and_r0 + bl TestPlayerAvatarFlags lsls r0, 24 cmp r0, 0 beq @080857D6 @@ -228031,24 +228038,24 @@ sub_8085784: ; 8085784 .pool thumb_func_end sub_8085784 - thumb_func_start sav1_set_x2C -sav1_set_x2C: ; 80857F4 + thumb_func_start sav1_set_battle_music_maybe +sav1_set_battle_music_maybe: ; 80857F4 ldr r1, =0x03005d8c ldr r1, [r1] strh r0, [r1, 0x2C] bx lr .pool - thumb_func_end sav1_set_x2C + thumb_func_end sav1_set_battle_music_maybe - thumb_func_start sav1_reset_x2C -sav1_reset_x2C: ; 8085800 + thumb_func_start sav1_reset_battle_music_maybe +sav1_reset_battle_music_maybe: ; 8085800 ldr r0, =0x03005d8c ldr r1, [r0] movs r0, 0 strh r0, [r1, 0x2C] bx lr .pool - thumb_func_end sav1_reset_x2C + thumb_func_end sav1_reset_battle_music_maybe thumb_func_start sub_8085810 sub_8085810: ; 8085810 @@ -228078,7 +228085,7 @@ sub_8085810: ; 8085810 cmp r5, r6 beq @08085890 movs r0, 0x8 - bl walkrun_bitfield_and_r0 + bl TestPlayerAvatarFlags lsls r0, 24 cmp r0, 0 beq @08085856 @@ -228087,7 +228094,7 @@ sub_8085810: ; 8085810 cmp r4, r5 beq @08085890 movs r0, 0x6 - bl walkrun_bitfield_and_r0 + bl TestPlayerAvatarFlags lsls r0, 24 cmp r0, 0 beq @08085888 @@ -228257,7 +228264,7 @@ sub_80859BC: ; 80859BC adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to + bl PlayerGetDestCoords ldr r0, =0x02032306 ldrb r0, [r0] cmp r0, 0x1 @@ -228270,7 +228277,7 @@ sub_80859BC: ; 80859BC bl cur_mapdata_block_get_role_at lsls r0, 24 lsrs r0, 24 - bl is_tile_water_maybe + bl MetatileBehavior_IsSurfableWaterOrUnderwater lsls r0, 24 cmp r0, 0 beq @08085A2C @@ -229290,7 +229297,7 @@ sub_8086230: ; 8086230 bl sub_81D5F48 b @0808628A @08086286: - bl sub_80848E0 + bl copy_rom_field_object_coords_to_saveblock1 @0808628A: bl sub_809757C bl sub_809E7B0 @@ -230098,7 +230105,7 @@ sub_80869DC: ; 80869DC bl sub_808D438 movs r0, 0 movs r1, 0 - bl npc_culling_maybe + bl SpawnFieldObjectsInView bl mapheader_run_first_tag4_script_list_match pop {r0} bx r0 @@ -230131,13 +230138,13 @@ mli4_mapscripts_and_other: ; 8086A04 ldr r3, =0x03005d90 ldr r3, [r3] ldrb r3, [r3, 0x8] - bl player_avatar_init + bl InitPlayerAvatar ldrb r0, [r5] - bl walkrun_set_bike_bits + bl SetPlayerAvatarTransition bl player_avatar_init_params_reset movs r0, 0 movs r1, 0 - bl npc_culling_maybe + bl SpawnFieldObjectsInView bl mapheader_run_first_tag4_script_list_match add sp, 0x4 pop {r4,r5} @@ -231348,7 +231355,7 @@ sub_8087388: ; 8087388 bne @080873AC @08087396: ldrb r0, [r4, 0xC] - bl is_tile_x65_warp_arrow_down + bl MetatileBehavior_IsSouthArrowWarp lsls r0, 24 cmp r0, 0 beq @080873AC @@ -231872,7 +231879,7 @@ sub_808779C: ; 808779C adds r0, 0x8 strh r0, [r4, 0xC] adds r0, r4, 0 - bl sub_8096DB8 + bl FieldObjectUpdateZCoord pop {r4} pop {r0} bx r0 @@ -232200,7 +232207,7 @@ sub_8087A20: ; 8087A20 adds r0, r5, 0 mov r2, sp adds r3, r6, 0 - bl npc_move_direction_hypothetical + bl FieldObjectMoveDestCoords ldrb r0, [r4, 0x2] ldrb r1, [r5, 0x19] mov r2, sp @@ -232224,7 +232231,7 @@ sub_8087A20: ; 8087A20 adds r0, r5, 0 bl npc_coords_shift adds r0, r5, 0 - bl sub_8096DB8 + bl FieldObjectUpdateZCoord movs r0, 0x1 b @08087A80 @08087A7E: @@ -232274,7 +232281,7 @@ sub_8087AA8: ; 8087AA8 adds r1, 0xC adds r2, r4, 0 adds r2, 0xE - bl numbers_move_direction + bl MoveCoords ldrb r0, [r5] cmp r0, 0 bne @08087AD8 @@ -232398,7 +232405,7 @@ npc_080587EC: ; 8087B40 bls @08087B64 asrs r0, r3, 16 asrs r1, r5, 16 - bl cur_mapdata_get_middle2bit_at + bl MapGridIsImpassableAt lsls r0, 24 lsrs r0, 24 @08087BBE: @@ -232524,10 +232531,10 @@ sub_8087C8C: ; 8087C8C lsrs r0, 4 adds r1, r5, 0 movs r2, 0x1 - bl npc_y_height_related + bl SetObjectSubpriorityByZCoord ldrb r0, [r6, 0xB] lsrs r0, 4 - bl sub_8096DA8 + bl ZCoordToPriority movs r1, 0x3 ands r1, r0 lsls r1, 2 @@ -232541,7 +232548,7 @@ sub_8087C8C: ; 8087C8C cmp r0, 0 bne @08087CF8 ldrb r0, [r6, 0x19] - bl npc_direction_to_obj_anim_image_number + bl FieldObjectDirectionToImageAnimId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -232551,7 +232558,7 @@ sub_8087C8C: ; 8087C8C .pool @08087CF8: ldrb r0, [r6, 0x19] - bl an_run_any__impl_pulse + bl get_go_image_anim_num adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -232681,6 +232688,7 @@ sub_8087DE4: ; 8087DE4 thumb_func_end sub_8087DE4 thumb_func_start mapheader_copy_mapdata_with_padding +; void mapheader_copy_mapdata_with_padding(struct mapheader *mapHeader) mapheader_copy_mapdata_with_padding: ; 8087E14 push {r4-r6,lr} sub sp, 0x4 @@ -232770,6 +232778,7 @@ map_copy_with_padding: ; 8087E70 thumb_func_end map_copy_with_padding thumb_func_start mapheader_copy_mapdata_of_adjacent_maps +; void mapheader_copy_mapdata_of_adjacent_maps(struct mapheader *mapHeader) mapheader_copy_mapdata_of_adjacent_maps: ; 8087EC8 push {r4-r7,lr} adds r6, r0, 0 @@ -233108,8 +233117,9 @@ sub_80880E0: ; 80880E0 .pool thumb_func_end sub_80880E0 - thumb_func_start cur_mapdata_get_upper4bit_at -cur_mapdata_get_upper4bit_at: ; 8088144 + thumb_func_start MapGridGetZCoordAt +; u8 MapGridGetZCoordAt(s32 x, s32 y) +MapGridGetZCoordAt: ; 8088144 push {r4,lr} adds r2, r0, 0 adds r4, r1, 0 @@ -233164,10 +233174,11 @@ cur_mapdata_get_upper4bit_at: ; 8088144 pop {r4} pop {r1} bx r1 - thumb_func_end cur_mapdata_get_upper4bit_at + thumb_func_end MapGridGetZCoordAt - thumb_func_start cur_mapdata_get_middle2bit_at -cur_mapdata_get_middle2bit_at: ; 80881B0 + thumb_func_start MapGridIsImpassableAt +; u8 MapGridIsImpassableAt(s32 x, s32 y) +MapGridIsImpassableAt: ; 80881B0 push {r4,lr} adds r2, r0, 0 adds r4, r1, 0 @@ -233225,7 +233236,7 @@ cur_mapdata_get_middle2bit_at: ; 80881B0 pop {r4} pop {r1} bx r1 - thumb_func_end cur_mapdata_get_middle2bit_at + thumb_func_end MapGridIsImpassableAt thumb_func_start cur_mapdata_get_blockid_at ; int cur_mapdata_get_blockid_at(int x, int y) @@ -233829,8 +233840,8 @@ sub_80885C4: ; 80885C4 .pool thumb_func_end sub_80885C4 - thumb_func_start mapborder_visible_from_position -mapborder_visible_from_position: ; 808869C + thumb_func_start GetMapBorderIdAt +GetMapBorderIdAt: ; 808869C push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 @@ -233942,7 +233953,7 @@ mapborder_visible_from_position: ; 808869C pop {r4,r5} pop {r1} bx r1 - thumb_func_end mapborder_visible_from_position + thumb_func_end GetMapBorderIdAt thumb_func_start sub_8088788 sub_8088788: ; 8088788 @@ -233959,15 +233970,16 @@ sub_8088788: ; 8088788 adds r3, 0x7 adds r1, r3 adds r0, r2, 0 - bl mapborder_visible_from_position + bl GetMapBorderIdAt pop {r4} pop {r1} bx r1 .pool thumb_func_end sub_8088788 - thumb_func_start sub_80887B0 -sub_80887B0: ; 80887B0 + thumb_func_start CanCameraMoveInDirection +; BOOL32 CanCameraMoveInDirection(u8 direction) +CanCameraMoveInDirection: ; 80887B0 push {r4,r5,lr} ldr r1, =0x03005d8c ldr r4, [r1] @@ -233987,7 +233999,7 @@ sub_80887B0: ; 80887B0 adds r0, 0x7 adds r1, r0 adds r0, r3, 0 - bl mapborder_visible_from_position + bl GetMapBorderIdAt movs r1, 0x1 negs r1, r1 cmp r0, r1 @@ -234001,7 +234013,7 @@ sub_80887B0: ; 80887B0 pop {r4,r5} pop {r1} bx r1 - thumb_func_end sub_80887B0 + thumb_func_end CanCameraMoveInDirection thumb_func_start sub_80887F8 sub_80887F8: ; 80887F8 @@ -234853,11 +234865,11 @@ apply_map_tileset1_tileset2_palette: ; 8088DD4 bx r0 thumb_func_end apply_map_tileset1_tileset2_palette - thumb_func_start sub_8088DEC -sub_8088DEC: ; 8088DEC + thumb_func_start ShouldDoJumpLandingDustEffect +ShouldDoJumpLandingDustEffect: ; 8088DEC movs r0, 0x1 bx lr - thumb_func_end sub_8088DEC + thumb_func_end ShouldDoJumpLandingDustEffect thumb_func_start sub_8088DF0 sub_8088DF0: ; 8088DF0 @@ -234964,8 +234976,8 @@ sub_8088E64: ; 8088E64 bx r1 thumb_func_end sub_8088E64 - thumb_func_start is_x21_or_x2B -is_x21_or_x2B: ; 8088E80 + thumb_func_start MetatileBehavior_IsSandOrDeepSand +MetatileBehavior_IsSandOrDeepSand: ; 8088E80 push {lr} lsls r0, 24 lsrs r0, 24 @@ -234981,7 +234993,7 @@ is_x21_or_x2B: ; 8088E80 @08088E94: pop {r1} bx r1 - thumb_func_end is_x21_or_x2B + thumb_func_end MetatileBehavior_IsSandOrDeepSand thumb_func_start MetatileBehavior_IsDeepSand MetatileBehavior_IsDeepSand: ; 8088E98 @@ -235165,8 +235177,8 @@ sub_8088F74: ; 8088F74 bx r1 thumb_func_end sub_8088F74 - thumb_func_start is_tile_water_maybe -is_tile_water_maybe: ; 8088F88 + thumb_func_start MetatileBehavior_IsSurfableWaterOrUnderwater +MetatileBehavior_IsSurfableWaterOrUnderwater: ; 8088F88 push {lr} lsls r0, 24 lsrs r0, 24 @@ -235185,10 +235197,10 @@ is_tile_water_maybe: ; 8088F88 @08088FA6: pop {r1} bx r1 - thumb_func_end is_tile_water_maybe + thumb_func_end MetatileBehavior_IsSurfableWaterOrUnderwater - thumb_func_start is_tile_x62_warp_arrow_right -is_tile_x62_warp_arrow_right: ; 8088FAC + thumb_func_start MetatileBehavior_IsEastArrowWarp +MetatileBehavior_IsEastArrowWarp: ; 8088FAC push {lr} lsls r0, 24 lsrs r0, 24 @@ -235201,10 +235213,10 @@ is_tile_x62_warp_arrow_right: ; 8088FAC @08088FBC: pop {r1} bx r1 - thumb_func_end is_tile_x62_warp_arrow_right + thumb_func_end MetatileBehavior_IsEastArrowWarp - thumb_func_start is_tile_x63_warp_arrow_left -is_tile_x63_warp_arrow_left: ; 8088FC0 + thumb_func_start MetatileBehavior_IsWestArrowWarp +MetatileBehavior_IsWestArrowWarp: ; 8088FC0 push {lr} lsls r0, 24 lsrs r0, 24 @@ -235217,10 +235229,10 @@ is_tile_x63_warp_arrow_left: ; 8088FC0 @08088FD0: pop {r1} bx r1 - thumb_func_end is_tile_x63_warp_arrow_left + thumb_func_end MetatileBehavior_IsWestArrowWarp - thumb_func_start sub_8088FD4 -sub_8088FD4: ; 8088FD4 + thumb_func_start MetatileBehavior_IsNorthArrowWarp +MetatileBehavior_IsNorthArrowWarp: ; 8088FD4 push {lr} lsls r0, 24 lsrs r0, 24 @@ -235236,10 +235248,10 @@ sub_8088FD4: ; 8088FD4 @08088FE8: pop {r1} bx r1 - thumb_func_end sub_8088FD4 + thumb_func_end MetatileBehavior_IsNorthArrowWarp - thumb_func_start is_tile_x65_warp_arrow_down -is_tile_x65_warp_arrow_down: ; 8088FEC + thumb_func_start MetatileBehavior_IsSouthArrowWarp +MetatileBehavior_IsSouthArrowWarp: ; 8088FEC push {lr} lsls r0, 24 lsrs r0, 24 @@ -235257,7 +235269,7 @@ is_tile_x65_warp_arrow_down: ; 8088FEC @08089004: pop {r1} bx r1 - thumb_func_end is_tile_x65_warp_arrow_down + thumb_func_end MetatileBehavior_IsSouthArrowWarp thumb_func_start sub_8089008 sub_8089008: ; 8089008 @@ -235266,22 +235278,22 @@ sub_8089008: ; 8089008 lsrs r4, r0, 24 movs r5, 0 adds r0, r4, 0 - bl is_tile_x62_warp_arrow_right + bl MetatileBehavior_IsEastArrowWarp lsls r0, 24 cmp r0, 0 bne @08089040 adds r0, r4, 0 - bl is_tile_x63_warp_arrow_left + bl MetatileBehavior_IsWestArrowWarp lsls r0, 24 cmp r0, 0 bne @08089040 adds r0, r4, 0 - bl sub_8088FD4 + bl MetatileBehavior_IsNorthArrowWarp lsls r0, 24 cmp r0, 0 bne @08089040 adds r0, r4, 0 - bl is_tile_x65_warp_arrow_down + bl MetatileBehavior_IsSouthArrowWarp lsls r0, 24 cmp r0, 0 beq @08089042 @@ -235333,8 +235345,9 @@ sub_808904C: ; 808904C bx r1 thumb_func_end sub_808904C - thumb_func_start sub_808908C -sub_808908C: ; 808908C + thumb_func_start MetatileBehavior_IsIce_2 +; BOOL MetatileBehavior_IsIce_2(u8 metatileBehavior) +MetatileBehavior_IsIce_2: ; 808908C push {lr} lsls r0, 24 lsrs r0, 24 @@ -235347,10 +235360,11 @@ sub_808908C: ; 808908C @0808909C: pop {r1} bx r1 - thumb_func_end sub_808908C + thumb_func_end MetatileBehavior_IsIce_2 - thumb_func_start is_tile_x48_slide_around -is_tile_x48_slide_around: ; 80890A0 + thumb_func_start MetatileBehavior_IsTrickHouseSlipperyFloor +; BOOL MetatileBehavior_IsTrickHouseSlipperyFloor(u8 metatileBehavior) +MetatileBehavior_IsTrickHouseSlipperyFloor: ; 80890A0 push {lr} lsls r0, 24 lsrs r0, 24 @@ -235363,10 +235377,10 @@ is_tile_x48_slide_around: ; 80890A0 @080890B0: pop {r1} bx r1 - thumb_func_end is_tile_x48_slide_around + thumb_func_end MetatileBehavior_IsTrickHouseSlipperyFloor - thumb_func_start sub_80890B4 -sub_80890B4: ; 80890B4 + thumb_func_start MetatileBehavior_0x05 +MetatileBehavior_0x05: ; 80890B4 push {lr} lsls r0, 24 lsrs r0, 24 @@ -235379,10 +235393,11 @@ sub_80890B4: ; 80890B4 @080890C4: pop {r1} bx r1 - thumb_func_end sub_80890B4 + thumb_func_end MetatileBehavior_0x05 - thumb_func_start task00_0800DE4C -task00_0800DE4C: ; 80890C8 + thumb_func_start MetatileBehavior_IsWalkNorth +; BOOL MetatileBehavior_IsWalkNorth(u8 metatileBehavior) +MetatileBehavior_IsWalkNorth: ; 80890C8 push {lr} lsls r0, 24 lsrs r0, 24 @@ -235395,10 +235410,11 @@ task00_0800DE4C: ; 80890C8 @080890D8: pop {r1} bx r1 - thumb_func_end task00_0800DE4C + thumb_func_end MetatileBehavior_IsWalkNorth - thumb_func_start is_tile_x43_walk_down -is_tile_x43_walk_down: ; 80890DC + thumb_func_start MetatileBehavior_IsWalkSouth +; BOOL MetatileBehavior_IsWalkSouth(u8 metatileBehavior) +MetatileBehavior_IsWalkSouth: ; 80890DC push {lr} lsls r0, 24 lsrs r0, 24 @@ -235411,10 +235427,11 @@ is_tile_x43_walk_down: ; 80890DC @080890EC: pop {r1} bx r1 - thumb_func_end is_tile_x43_walk_down + thumb_func_end MetatileBehavior_IsWalkSouth - thumb_func_start is_tile_x41_walk_left -is_tile_x41_walk_left: ; 80890F0 + thumb_func_start MetatileBehavior_IsWalkWest +; BOOL MetatileBehavior_IsWalkWest(u8 metatileBehavior) +MetatileBehavior_IsWalkWest: ; 80890F0 push {lr} lsls r0, 24 lsrs r0, 24 @@ -235427,10 +235444,11 @@ is_tile_x41_walk_left: ; 80890F0 @08089100: pop {r1} bx r1 - thumb_func_end is_tile_x41_walk_left + thumb_func_end MetatileBehavior_IsWalkWest - thumb_func_start is_tile_x40_walk_right -is_tile_x40_walk_right: ; 8089104 + thumb_func_start MetatileBehavior_IsWalkEast +; BOOL MetatileBehavior_IsWalkEast(u8 metatileBehavior) +MetatileBehavior_IsWalkEast: ; 8089104 push {lr} lsls r0, 24 lsrs r0, 24 @@ -235443,10 +235461,11 @@ is_tile_x40_walk_right: ; 8089104 @08089114: pop {r1} bx r1 - thumb_func_end is_tile_x40_walk_right + thumb_func_end MetatileBehavior_IsWalkEast - thumb_func_start is_tile_x52_run_up -is_tile_x52_run_up: ; 8089118 + thumb_func_start MetatileBehavior_IsNorthwardCurrent +; BOOL MetatileBehavior_IsNorthwardCurrent(u8 metatileBehavior) +MetatileBehavior_IsNorthwardCurrent: ; 8089118 push {lr} lsls r0, 24 lsrs r0, 24 @@ -235459,10 +235478,11 @@ is_tile_x52_run_up: ; 8089118 @08089128: pop {r1} bx r1 - thumb_func_end is_tile_x52_run_up + thumb_func_end MetatileBehavior_IsNorthwardCurrent - thumb_func_start is_tile_x53_run_down -is_tile_x53_run_down: ; 808912C + thumb_func_start MetatileBehavior_IsSouthwardCurrent +; BOOL MetatileBehavior_IsSouthwardCurrent(u8 metatileBehavior) +MetatileBehavior_IsSouthwardCurrent: ; 808912C push {lr} lsls r0, 24 lsrs r0, 24 @@ -235475,10 +235495,11 @@ is_tile_x53_run_down: ; 808912C @0808913C: pop {r1} bx r1 - thumb_func_end is_tile_x53_run_down + thumb_func_end MetatileBehavior_IsSouthwardCurrent - thumb_func_start is_tile_x51_run_left -is_tile_x51_run_left: ; 8089140 + thumb_func_start MetatileBehavior_IsWestwardCurrent +; BOOL MetatileBehavior_IsWestwardCurrent(u8 metatileBehavior) +MetatileBehavior_IsWestwardCurrent: ; 8089140 push {lr} lsls r0, 24 lsrs r0, 24 @@ -235491,10 +235512,11 @@ is_tile_x51_run_left: ; 8089140 @08089150: pop {r1} bx r1 - thumb_func_end is_tile_x51_run_left + thumb_func_end MetatileBehavior_IsWestwardCurrent - thumb_func_start is_tile_x50_run_right -is_tile_x50_run_right: ; 8089154 + thumb_func_start MetatileBehavior_IsEastwardCurrent +; BOOL MetatileBehavior_IsEastwardCurrent(u8 metatileBehavior) +MetatileBehavior_IsEastwardCurrent: ; 8089154 push {lr} lsls r0, 24 lsrs r0, 24 @@ -235507,10 +235529,11 @@ is_tile_x50_run_right: ; 8089154 @08089164: pop {r1} bx r1 - thumb_func_end is_tile_x50_run_right + thumb_func_end MetatileBehavior_IsEastwardCurrent - thumb_func_start is_tile_x46_slide_up -is_tile_x46_slide_up: ; 8089168 + thumb_func_start MetatileBehavior_IsSlideNorth +; BOOL MetatileBehavior_IsSlideNorth(u8 metatileBehavior) +MetatileBehavior_IsSlideNorth: ; 8089168 push {lr} lsls r0, 24 lsrs r0, 24 @@ -235523,10 +235546,11 @@ is_tile_x46_slide_up: ; 8089168 @08089178: pop {r1} bx r1 - thumb_func_end is_tile_x46_slide_up + thumb_func_end MetatileBehavior_IsSlideNorth - thumb_func_start is_tile_x47_slide_down -is_tile_x47_slide_down: ; 808917C + thumb_func_start MetatileBehavior_IsSlideSouth +; BOOL MetatileBehavior_IsSlideSouth(u8 metatileBehavior) +MetatileBehavior_IsSlideSouth: ; 808917C push {lr} lsls r0, 24 lsrs r0, 24 @@ -235539,10 +235563,11 @@ is_tile_x47_slide_down: ; 808917C @0808918C: pop {r1} bx r1 - thumb_func_end is_tile_x47_slide_down + thumb_func_end MetatileBehavior_IsSlideSouth - thumb_func_start is_tile_x45_slide_left -is_tile_x45_slide_left: ; 8089190 + thumb_func_start MetatileBehavior_IsSlideWest +; BOOL MetatileBehavior_IsSlideWest(u8 metatileBehavior) +MetatileBehavior_IsSlideWest: ; 8089190 push {lr} lsls r0, 24 lsrs r0, 24 @@ -235555,10 +235580,11 @@ is_tile_x45_slide_left: ; 8089190 @080891A0: pop {r1} bx r1 - thumb_func_end is_tile_x45_slide_left + thumb_func_end MetatileBehavior_IsSlideWest - thumb_func_start is_tile_x44_slide_right -is_tile_x44_slide_right: ; 80891A4 + thumb_func_start MetatileBehavior_IsSlideEast +; BOOL MetatileBehavior_IsSlideEast(u8 metatileBehavior) +MetatileBehavior_IsSlideEast: ; 80891A4 push {lr} lsls r0, 24 lsrs r0, 24 @@ -235571,7 +235597,7 @@ is_tile_x44_slide_right: ; 80891A4 @080891B4: pop {r1} bx r1 - thumb_func_end is_tile_x44_slide_right + thumb_func_end MetatileBehavior_IsSlideEast thumb_func_start MetatileBehavior_IsCounter MetatileBehavior_IsCounter: ; 80891B8 @@ -236048,8 +236074,8 @@ sub_8089404: ; 8089404 bx r1 thumb_func_end sub_8089404 - thumb_func_start is_tile_x10_or_x16 -is_tile_x10_or_x16: ; 8089418 + thumb_func_start MetatileBehavior_HasRipples +MetatileBehavior_HasRipples: ; 8089418 push {lr} lsls r0, 24 lsrs r0, 24 @@ -236067,10 +236093,10 @@ is_tile_x10_or_x16: ; 8089418 @08089430: pop {r1} bx r1 - thumb_func_end is_tile_x10_or_x16 + thumb_func_end MetatileBehavior_HasRipples - thumb_func_start is_tile_x16_clear_water -is_tile_x16_clear_water: ; 8089434 + thumb_func_start MetatileBehavior_IsPuddle +MetatileBehavior_IsPuddle: ; 8089434 push {lr} lsls r0, 24 lsrs r0, 24 @@ -236083,10 +236109,10 @@ is_tile_x16_clear_water: ; 8089434 @08089444: pop {r1} bx r1 - thumb_func_end is_tile_x16_clear_water + thumb_func_end MetatileBehavior_IsPuddle - thumb_func_start is_tile_x02_or_xD1 -is_tile_x02_or_xD1: ; 8089448 + thumb_func_start MetatileBehavior_IsTallGrass +MetatileBehavior_IsTallGrass: ; 8089448 push {lr} lsls r0, 24 lsrs r0, 24 @@ -236099,7 +236125,7 @@ is_tile_x02_or_xD1: ; 8089448 @08089458: pop {r1} bx r1 - thumb_func_end is_tile_x02_or_xD1 + thumb_func_end MetatileBehavior_IsTallGrass thumb_func_start MetatileBehavior_IsLongGrass MetatileBehavior_IsLongGrass: ; 808945C @@ -236149,8 +236175,8 @@ MetatileBehavior_IsAsh: ; 8089484 bx r1 thumb_func_end MetatileBehavior_IsAsh - thumb_func_start sub_8089498 -sub_8089498: ; 8089498 + thumb_func_start MetatileBehavior_IsUnusedFootprintMetatile +MetatileBehavior_IsUnusedFootprintMetatile: ; 8089498 push {lr} lsls r0, 24 lsrs r0, 24 @@ -236163,7 +236189,7 @@ sub_8089498: ; 8089498 @080894A8: pop {r1} bx r1 - thumb_func_end sub_8089498 + thumb_func_end MetatileBehavior_IsUnusedFootprintMetatile thumb_func_start sub_80894AC sub_80894AC: ; 80894AC @@ -236253,7 +236279,7 @@ sub_808952C: ; 808952C lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 - bl is_tile_water_maybe + bl MetatileBehavior_IsSurfableWaterOrUnderwater lsls r0, 24 cmp r0, 0 bne @08089550 @@ -236279,7 +236305,7 @@ sub_8089558: ; 8089558 lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 - bl is_tile_water_maybe + bl MetatileBehavior_IsSurfableWaterOrUnderwater lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -236374,8 +236400,8 @@ sub_80895D0: ; 80895D0 bx r1 thumb_func_end sub_80895D0 - thumb_func_start sub_80895E8 -sub_80895E8: ; 80895E8 + thumb_func_start MetatileBehavior_IsShallowFlowingWater +MetatileBehavior_IsShallowFlowingWater: ; 80895E8 push {lr} lsls r0, 24 lsrs r0, 24 @@ -236393,7 +236419,7 @@ sub_80895E8: ; 80895E8 @08089600: pop {r1} bx r1 - thumb_func_end sub_80895E8 + thumb_func_end MetatileBehavior_IsShallowFlowingWater thumb_func_start sub_8089604 sub_8089604: ; 8089604 @@ -236473,12 +236499,12 @@ sub_8089660: ; 8089660 lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 - bl is_tile_water_maybe + bl MetatileBehavior_IsSurfableWaterOrUnderwater lsls r0, 24 cmp r0, 0 beq @08089682 adds r0, r4, 0 - bl is_tile_x13_waterfall + bl MetatileBehavior_IsWaterfall lsls r0, 24 cmp r0, 0 bne @08089682 @@ -236492,8 +236518,8 @@ sub_8089660: ; 8089660 bx r1 thumb_func_end sub_8089660 - thumb_func_start sub_808968C -sub_808968C: ; 808968C + thumb_func_start MetatileBehavior_IsEastBlocked +MetatileBehavior_IsEastBlocked: ; 808968C push {lr} lsls r0, 24 lsrs r0, 24 @@ -236515,10 +236541,10 @@ sub_808968C: ; 808968C @080896AC: pop {r1} bx r1 - thumb_func_end sub_808968C + thumb_func_end MetatileBehavior_IsEastBlocked - thumb_func_start sub_80896B0 -sub_80896B0: ; 80896B0 + thumb_func_start MetatileBehavior_IsWestBlocked +MetatileBehavior_IsWestBlocked: ; 80896B0 push {lr} lsls r0, 24 lsrs r0, 24 @@ -236540,10 +236566,10 @@ sub_80896B0: ; 80896B0 @080896D0: pop {r1} bx r1 - thumb_func_end sub_80896B0 + thumb_func_end MetatileBehavior_IsWestBlocked - thumb_func_start sub_80896D4 -sub_80896D4: ; 80896D4 + thumb_func_start MetatileBehavior_IsNorthBlocked +MetatileBehavior_IsNorthBlocked: ; 80896D4 push {lr} lsls r0, 24 lsrs r0, 24 @@ -236563,10 +236589,10 @@ sub_80896D4: ; 80896D4 @080896F0: pop {r1} bx r1 - thumb_func_end sub_80896D4 + thumb_func_end MetatileBehavior_IsNorthBlocked - thumb_func_start sub_80896F4 -sub_80896F4: ; 80896F4 + thumb_func_start MetatileBehavior_IsSouthBlocked +MetatileBehavior_IsSouthBlocked: ; 80896F4 push {lr} lsls r0, 24 lsrs r0, 24 @@ -236586,10 +236612,10 @@ sub_80896F4: ; 80896F4 @08089710: pop {r1} bx r1 - thumb_func_end sub_80896F4 + thumb_func_end MetatileBehavior_IsSouthBlocked - thumb_func_start sub_8089714 -sub_8089714: ; 8089714 + thumb_func_start MetatileBehavior_IsShortGrass +MetatileBehavior_IsShortGrass: ; 8089714 push {lr} lsls r0, 24 lsrs r0, 24 @@ -236602,10 +236628,10 @@ sub_8089714: ; 8089714 @08089724: pop {r1} bx r1 - thumb_func_end sub_8089714 + thumb_func_end MetatileBehavior_IsShortGrass - thumb_func_start is_tile_halfwater -is_tile_halfwater: ; 8089728 + thumb_func_start MetatileBehavior_IsHotSprings +MetatileBehavior_IsHotSprings: ; 8089728 push {lr} lsls r0, 24 lsrs r0, 24 @@ -236618,10 +236644,11 @@ is_tile_halfwater: ; 8089728 @08089738: pop {r1} bx r1 - thumb_func_end is_tile_halfwater + thumb_func_end MetatileBehavior_IsHotSprings - thumb_func_start is_tile_x13_waterfall -is_tile_x13_waterfall: ; 808973C + thumb_func_start MetatileBehavior_IsWaterfall +; BOOL MetatileBehavior_IsWaterfall(u8 metatileBehavior) +MetatileBehavior_IsWaterfall: ; 808973C push {lr} lsls r0, 24 lsrs r0, 24 @@ -236634,10 +236661,10 @@ is_tile_x13_waterfall: ; 808973C @0808974C: pop {r1} bx r1 - thumb_func_end is_tile_x13_waterfall + thumb_func_end MetatileBehavior_IsWaterfall - thumb_func_start sub_8089750 -sub_8089750: ; 8089750 + thumb_func_start MetatileBehavior_IsFortreeBridge +MetatileBehavior_IsFortreeBridge: ; 8089750 push {lr} lsls r0, 24 lsrs r0, 24 @@ -236650,7 +236677,7 @@ sub_8089750: ; 8089750 @08089760: pop {r1} bx r1 - thumb_func_end sub_8089750 + thumb_func_end MetatileBehavior_IsFortreeBridge thumb_func_start sub_8089764 sub_8089764: ; 8089764 @@ -236716,8 +236743,8 @@ sub_80897A0: ; 80897A0 bx r1 thumb_func_end sub_80897A0 - thumb_func_start is_tile_x17 -is_tile_x17: ; 80897B4 + thumb_func_start MetatileBehavior_IsPacifidlogLog +MetatileBehavior_IsPacifidlogLog: ; 80897B4 push {lr} lsls r0, 24 movs r1, 0x8C @@ -236733,7 +236760,7 @@ is_tile_x17: ; 80897B4 @080897CA: pop {r1} bx r1 - thumb_func_end is_tile_x17 + thumb_func_end MetatileBehavior_IsPacifidlogLog thumb_func_start is_tile_x8C is_tile_x8C: ; 80897D0 @@ -236831,8 +236858,9 @@ is_tile_x87: ; 8089834 bx r1 thumb_func_end is_tile_x87 - thumb_func_start sub_8089848 -sub_8089848: ; 8089848 + thumb_func_start MetatileBehavior_0xBB +; BOOL MetatileBehavior_0xBB(u8 metatileBehavior) +MetatileBehavior_0xBB: ; 8089848 push {lr} lsls r0, 24 lsrs r0, 24 @@ -236845,10 +236873,11 @@ sub_8089848: ; 8089848 @08089858: pop {r1} bx r1 - thumb_func_end sub_8089848 + thumb_func_end MetatileBehavior_0xBB - thumb_func_start sub_808985C -sub_808985C: ; 808985C + thumb_func_start MetatileBehavior_0xBC +; BOOL MetatileBehavior_0xBC(u8 metatileBehavior) +MetatileBehavior_0xBC: ; 808985C push {lr} lsls r0, 24 lsrs r0, 24 @@ -236861,7 +236890,7 @@ sub_808985C: ; 808985C @0808986C: pop {r1} bx r1 - thumb_func_end sub_808985C + thumb_func_end MetatileBehavior_0xBC thumb_func_start sub_8089870 sub_8089870: ; 8089870 @@ -236895,8 +236924,8 @@ is_role_x68: ; 8089884 bx r1 thumb_func_end is_role_x68 - thumb_func_start sub_8089898 -sub_8089898: ; 8089898 + thumb_func_start MetatileBehavior_IsAquaHideoutWarp +MetatileBehavior_IsAquaHideoutWarp: ; 8089898 push {lr} lsls r0, 24 lsrs r0, 24 @@ -236909,7 +236938,7 @@ sub_8089898: ; 8089898 @080898A8: pop {r1} bx r1 - thumb_func_end sub_8089898 + thumb_func_end MetatileBehavior_IsAquaHideoutWarp thumb_func_start sub_80898AC sub_80898AC: ; 80898AC @@ -236943,8 +236972,8 @@ sub_80898C0: ; 80898C0 bx r1 thumb_func_end sub_80898C0 - thumb_func_start block_field_1_weird_index -block_field_1_weird_index: ; 80898D4 + thumb_func_start MetatileBehavior_IsSurfableFishableWater +MetatileBehavior_IsSurfableFishableWater: ; 80898D4 push {lr} lsls r0, 24 lsrs r0, 24 @@ -236971,7 +237000,7 @@ block_field_1_weird_index: ; 80898D4 @080898FE: pop {r1} bx r1 - thumb_func_end block_field_1_weird_index + thumb_func_end MetatileBehavior_IsSurfableFishableWater thumb_func_start sub_8089904 sub_8089904: ; 8089904 @@ -237021,8 +237050,9 @@ sub_808992C: ; 808992C bx r1 thumb_func_end sub_808992C - thumb_func_start sub_8089940 -sub_8089940: ; 8089940 + thumb_func_start MetatileBehavior_IsMuddySlope +; BOOL MetatileBehavior_IsMuddySlope(u8 metatileBehavior) +MetatileBehavior_IsMuddySlope: ; 8089940 push {lr} lsls r0, 24 lsrs r0, 24 @@ -237035,10 +237065,10 @@ sub_8089940: ; 8089940 @08089950: pop {r1} bx r1 - thumb_func_end sub_8089940 + thumb_func_end MetatileBehavior_IsMuddySlope - thumb_func_start sub_8089954 -sub_8089954: ; 8089954 + thumb_func_start MetatileBehavior_IsBumpySlope +MetatileBehavior_IsBumpySlope: ; 8089954 push {lr} lsls r0, 24 lsrs r0, 24 @@ -237051,10 +237081,10 @@ sub_8089954: ; 8089954 @08089964: pop {r1} bx r1 - thumb_func_end sub_8089954 + thumb_func_end MetatileBehavior_IsBumpySlope - thumb_func_start sub_8089968 -sub_8089968: ; 8089968 + thumb_func_start MetatileBehavior_IsIsolatedVerticalRail +MetatileBehavior_IsIsolatedVerticalRail: ; 8089968 push {lr} lsls r0, 24 lsrs r0, 24 @@ -237067,10 +237097,10 @@ sub_8089968: ; 8089968 @08089978: pop {r1} bx r1 - thumb_func_end sub_8089968 + thumb_func_end MetatileBehavior_IsIsolatedVerticalRail - thumb_func_start sub_808997C -sub_808997C: ; 808997C + thumb_func_start MetatileBehavior_IsIsolatedHorizontalRail +MetatileBehavior_IsIsolatedHorizontalRail: ; 808997C push {lr} lsls r0, 24 lsrs r0, 24 @@ -237083,10 +237113,10 @@ sub_808997C: ; 808997C @0808998C: pop {r1} bx r1 - thumb_func_end sub_808997C + thumb_func_end MetatileBehavior_IsIsolatedHorizontalRail - thumb_func_start sub_8089990 -sub_8089990: ; 8089990 + thumb_func_start MetatileBehavior_IsVerticalRail +MetatileBehavior_IsVerticalRail: ; 8089990 push {lr} lsls r0, 24 lsrs r0, 24 @@ -237099,10 +237129,10 @@ sub_8089990: ; 8089990 @080899A0: pop {r1} bx r1 - thumb_func_end sub_8089990 + thumb_func_end MetatileBehavior_IsVerticalRail - thumb_func_start sub_80899A4 -sub_80899A4: ; 80899A4 + thumb_func_start MetatileBehavior_IsHorizontalRail +MetatileBehavior_IsHorizontalRail: ; 80899A4 push {lr} lsls r0, 24 lsrs r0, 24 @@ -237115,10 +237145,10 @@ sub_80899A4: ; 80899A4 @080899B4: pop {r1} bx r1 - thumb_func_end sub_80899A4 + thumb_func_end MetatileBehavior_IsHorizontalRail - thumb_func_start it_tile_x22 -it_tile_x22: ; 80899B8 + thumb_func_start MetatileBehavior_IsSeaweed +MetatileBehavior_IsSeaweed: ; 80899B8 push {lr} lsls r0, 24 lsrs r0, 24 @@ -237134,10 +237164,10 @@ it_tile_x22: ; 80899B8 @080899CC: pop {r1} bx r1 - thumb_func_end it_tile_x22 + thumb_func_end MetatileBehavior_IsSeaweed - thumb_func_start sub_80899D0 -sub_80899D0: ; 80899D0 + thumb_func_start MetatileBehavior_IsRunningDisallowed +MetatileBehavior_IsRunningDisallowed: ; 80899D0 push {lr} lsls r0, 24 lsrs r0, 24 @@ -237147,7 +237177,7 @@ sub_80899D0: ; 80899D0 beq @080899EC cmp r0, 0x28 beq @080899EC - bl is_tile_x17 + bl MetatileBehavior_IsPacifidlogLog lsls r0, 24 cmp r0, 0 beq @080899F0 @@ -237159,7 +237189,7 @@ sub_80899D0: ; 80899D0 @080899F2: pop {r1} bx r1 - thumb_func_end sub_80899D0 + thumb_func_end MetatileBehavior_IsRunningDisallowed thumb_func_start sub_80899F8 sub_80899F8: ; 80899F8 @@ -238239,7 +238269,7 @@ sub_808A134: ; 808A134 bl RemoveObjectAndFreeTiles @0808A150: adds r0, r5, 0 - bl sub_808ED34 + bl AddCameraObject lsls r0, 24 lsrs r0, 24 str r0, [r4, 0x4] @@ -238348,7 +238378,7 @@ camera_update: ; 808A174 bl camera_move_maybe adds r0, r4, 0 adds r1, r5, 0 - bl overworld_rebase + bl UpdateFieldObjectsForCameraUpdate adds r0, r4, 0 adds r1, r5, 0 bl sub_80FBEA8 @@ -238396,7 +238426,7 @@ camera_move_and_redraw: ; 808A284 asrs r0, 16 lsls r1, r5, 16 asrs r1, 16 - bl overworld_rebase + bl UpdateFieldObjectsForCameraUpdate bl cur_mapdata_full_redraw ldr r1, =0x03005dec lsls r4, 4 @@ -238511,7 +238541,7 @@ nu_805AE74: ; 808A360 movs r0, 0 strb r0, [r1] @0808A39A: - bl player_get_direction_upper_4bits + bl player_get_direction_upper_nybble lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 @@ -239019,6 +239049,7 @@ sub_808A734: ; 808A734 thumb_func_end sub_808A734 thumb_func_start task_overworld_door_add_for_opening_door_at +; s32 task_overworld_door_add_for_opening_door_at(void *a1, s32 x, s32 y) task_overworld_door_add_for_opening_door_at: ; 808A774 push {r4-r6,lr} adds r4, r0, 0 @@ -239306,8 +239337,9 @@ sub_808A964: ; 808A964 bx r1 thumb_func_end sub_808A964 - thumb_func_start sub_808A998 -sub_808A998: ; 808A998 + thumb_func_start FieldObjectCB_NoMovement2 +; void FieldObjectCB_NoMovement2(struct obj *object) +FieldObjectCB_NoMovement2: ; 808A998 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -239317,18 +239349,18 @@ sub_808A998: ; 808A998 lsls r0, 2 ldr r2, =0x02037350 adds r0, r2 - ldr r2, =sub_808A9BC - bl meta_step + ldr r2, =FieldObjectCB2_NoMovement2 + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_808A998 + thumb_func_end FieldObjectCB_NoMovement2 - thumb_func_start sub_808A9BC -sub_808A9BC: ; 808A9BC + thumb_func_start FieldObjectCB2_NoMovement2 +FieldObjectCB2_NoMovement2: ; 808A9BC movs r0, 0 bx lr - thumb_func_end sub_808A9BC + thumb_func_end FieldObjectCB2_NoMovement2 thumb_func_start player_step ; void player_step(int dpad_direction, int buttons_new, int buttons_held) @@ -239360,22 +239392,22 @@ player_step: ; 808A9C0 bl sub_8119C3C adds r0, r5, 0 mov r1, r8 - bl sub_808AA38 + bl TryInterruptFieldObjectSpecialAnim lsls r0, 24 cmp r0, 0 bne @0808AA26 adds r0, r5, 0 bl npc_clear_strange_bits - bl bike_related - bl sub_808AB14 + bl DoPlayerAvatarTransition + bl TryDoMetatileBehaviorForcedMovment lsls r0, 24 cmp r0, 0 bne @0808AA26 mov r0, r8 adds r1, r7, 0 adds r2, r6, 0 - bl player_step_by_keypad - bl walkrun_clear_x20_when_running_fast + bl MovePlayerAvatarUsingKeypadInput + bl PlayerAllowForcedMovementIfMovingSameDirection @0808AA26: pop {r3} mov r8, r3 @@ -239385,24 +239417,25 @@ player_step: ; 808A9C0 .pool thumb_func_end player_step - thumb_func_start sub_808AA38 -sub_808AA38: ; 808AA38 + thumb_func_start TryInterruptFieldObjectSpecialAnim +; BOOL TryInterruptFieldObjectSpecialAnim(struct npc_state *fieldObject, u8 direction) +TryInterruptFieldObjectSpecialAnim: ; 808AA38 push {r4-r6,lr} adds r4, r0, 0 lsls r1, 24 lsrs r5, r1, 24 adds r6, r5, 0 - bl npc_is_visible_or_is_x40 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive lsls r0, 24 cmp r0, 0 beq @0808AA92 adds r0, r4, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished lsls r0, 24 cmp r0, 0 bne @0808AA92 adds r0, r4, 0 - bl npc_get_state_or_xFF + bl FieldObjectGetSpecialAnim lsls r0, 24 movs r1, 0xE7 lsls r1, 24 @@ -239422,7 +239455,7 @@ sub_808AA38: ; 808AA38 beq @0808AA84 @0808AA7C: adds r0, r4, 0 - bl rom_npc_by_local_id_and_map_get_trainer_flag + bl FieldObjectClearAnim b @0808AA92 @0808AA84: adds r0, r6, 0 @@ -239437,10 +239470,10 @@ sub_808AA38: ; 808AA38 pop {r4-r6} pop {r1} bx r1 - thumb_func_end sub_808AA38 + thumb_func_end TryInterruptFieldObjectSpecialAnim thumb_func_start npc_clear_strange_bits -; int npc_clear_strange_bits(npc_state *) +; void npc_clear_strange_bits(struct npc_state *fieldObject) npc_clear_strange_bits: ; 808AA9C ldrb r2, [r0, 0x1] movs r1, 0x11 @@ -239461,9 +239494,9 @@ npc_clear_strange_bits: ; 808AA9C .pool thumb_func_end npc_clear_strange_bits - thumb_func_start player_step_by_keypad -; void player_step_by_keypad(int dpad_direction, int buttons_new, int buttons_held) -player_step_by_keypad: ; 808AAC0 + thumb_func_start MovePlayerAvatarUsingKeypadInput +; void MovePlayerAvatarUsingKeypadInput(int dpad_direction, int buttons_new, int buttons_held) +MovePlayerAvatarUsingKeypadInput: ; 808AAC0 push {r4,lr} lsls r0, 24 lsrs r3, r0, 24 @@ -239479,21 +239512,22 @@ player_step_by_keypad: ; 808AAC0 beq @0808AAE8 adds r0, r3, 0 adds r1, r4, 0 - bl dp04_initiate_movement + bl MovePlayerOnBike b @0808AAF0 .pool @0808AAE8: adds r0, r3, 0 adds r1, r2, 0 - bl dp04_continue_movement + bl MovePlayerNotOnBike @0808AAF0: pop {r4} pop {r0} bx r0 - thumb_func_end player_step_by_keypad + thumb_func_end MovePlayerAvatarUsingKeypadInput - thumb_func_start walkrun_clear_x20_when_running_fast -walkrun_clear_x20_when_running_fast: ; 808AAF8 + thumb_func_start PlayerAllowForcedMovementIfMovingSameDirection +; void PlayerAllowForcedMovementIfMovingSameDirection() +PlayerAllowForcedMovementIfMovingSameDirection: ; 808AAF8 push {lr} ldr r2, =0x02037590 ldrb r0, [r2, 0x2] @@ -239507,13 +239541,14 @@ walkrun_clear_x20_when_running_fast: ; 808AAF8 pop {r0} bx r0 .pool - thumb_func_end walkrun_clear_x20_when_running_fast + thumb_func_end PlayerAllowForcedMovementIfMovingSameDirection - thumb_func_start sub_808AB14 -sub_808AB14: ; 808AB14 + thumb_func_start TryDoMetatileBehaviorForcedMovment +; BOOL TryDoMetatileBehaviorForcedMovment() +TryDoMetatileBehaviorForcedMovment: ; 808AB14 push {r4,lr} ldr r4, =gUnknown_08497444 - bl sub_808AB38 + bl GetForcedMovementByMetatileBehavior lsls r0, 24 lsrs r0, 22 adds r0, r4 @@ -239525,10 +239560,11 @@ sub_808AB14: ; 808AB14 pop {r1} bx r1 .pool - thumb_func_end sub_808AB14 + thumb_func_end TryDoMetatileBehaviorForcedMovment - thumb_func_start sub_808AB38 -sub_808AB38: ; 808AB38 + thumb_func_start GetForcedMovementByMetatileBehavior +; u8 GetForcedMovementByMetatileBehavior() +GetForcedMovementByMetatileBehavior: ; 808AB38 push {r4-r6,lr} ldr r3, =0x02037590 ldrb r1, [r3] @@ -239571,10 +239607,10 @@ sub_808AB38: ; 808AB38 pop {r4-r6} pop {r1} bx r1 - thumb_func_end sub_808AB38 + thumb_func_end GetForcedMovementByMetatileBehavior - thumb_func_start sub_808AB94 -sub_808AB94: ; 808AB94 + thumb_func_start ForcedMovement_None +ForcedMovement_None: ; 808AB94 push {r4,lr} ldr r4, =0x02037590 ldrb r1, [r4] @@ -239598,7 +239634,7 @@ sub_808AB94: ; 808AB94 ldrb r1, [r0, 0x18] lsls r1, 28 lsrs r1, 28 - bl npc_set_direction + bl FieldObjectSetDirection ldrb r1, [r4] movs r0, 0xBF ands r0, r1 @@ -239609,10 +239645,10 @@ sub_808AB94: ; 808AB94 pop {r1} bx r1 .pool - thumb_func_end sub_808AB94 + thumb_func_end ForcedMovement_None - thumb_func_start sub_808ABE0 -sub_808ABE0: ; 808ABE0 + thumb_func_start DoForcedMovement +DoForcedMovement: ; 808ABE0 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -239623,7 +239659,7 @@ sub_808ABE0: ; 808ABE0 lsrs r5, r0, 24 ldr r6, =0x02037590 adds r0, r5, 0 - bl sub_808AFBC + bl CheckForPlayerAvatarCollision lsls r0, 24 lsrs r4, r0, 24 adds r7, r4, 0 @@ -239637,7 +239673,7 @@ sub_808ABE0: ; 808ABE0 strb r0, [r6] cmp r4, 0 beq @0808AC3C - bl sub_808AB94 + bl ForcedMovement_None cmp r4, 0x4 bhi @0808AC24 movs r0, 0 @@ -239647,7 +239683,7 @@ sub_808ABE0: ; 808ABE0 cmp r7, 0x6 bne @0808AC2E adds r0, r5, 0 - bl npc_use_some_d2s_and_sound + bl PlayerJumpLedge @0808AC2E: ldrb r0, [r6] mov r1, r10 @@ -239671,10 +239707,10 @@ sub_808ABE0: ; 808ABE0 pop {r4-r7} pop {r1} bx r1 - thumb_func_end sub_808ABE0 + thumb_func_end DoForcedMovement - thumb_func_start sub_808AC58 -sub_808AC58: ; 808AC58 + thumb_func_start DoForcedMovementInCurrentDirection +DoForcedMovementInCurrentDirection: ; 808AC58 push {lr} adds r1, r0, 0 ldr r0, =0x02037590 @@ -239690,132 +239726,132 @@ sub_808AC58: ; 808AC58 strb r2, [r0, 0x1] ldrb r0, [r0, 0x18] lsrs r0, 4 - bl sub_808ABE0 + bl DoForcedMovement lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .pool - thumb_func_end sub_808AC58 + thumb_func_end DoForcedMovementInCurrentDirection - thumb_func_start sub_808AC8C -sub_808AC8C: ; 808AC8C + thumb_func_start ForcedMovement_Slip +ForcedMovement_Slip: ; 808AC8C push {lr} - ldr r0, =sub_808B738 - bl sub_808AC58 + ldr r0, =PlayerGoSpeed1 + bl DoForcedMovementInCurrentDirection lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .pool - thumb_func_end sub_808AC8C + thumb_func_end ForcedMovement_Slip - thumb_func_start sub_808ACA0 -sub_808ACA0: ; 808ACA0 + thumb_func_start ForcedMovement_WalkSouth +ForcedMovement_WalkSouth: ; 808ACA0 push {lr} - ldr r1, =sub_808B720 + ldr r1, =PlayerGoSpeed0 movs r0, 0x1 - bl sub_808ABE0 + bl DoForcedMovement lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .pool - thumb_func_end sub_808ACA0 + thumb_func_end ForcedMovement_WalkSouth - thumb_func_start sub_808ACB8 -sub_808ACB8: ; 808ACB8 + thumb_func_start ForcedMovement_WalkNorth +ForcedMovement_WalkNorth: ; 808ACB8 push {lr} - ldr r1, =sub_808B720 + ldr r1, =PlayerGoSpeed0 movs r0, 0x2 - bl sub_808ABE0 + bl DoForcedMovement lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .pool - thumb_func_end sub_808ACB8 + thumb_func_end ForcedMovement_WalkNorth - thumb_func_start sub_808ACD0 -sub_808ACD0: ; 808ACD0 + thumb_func_start ForcedMovement_WalkWest +ForcedMovement_WalkWest: ; 808ACD0 push {lr} - ldr r1, =sub_808B720 + ldr r1, =PlayerGoSpeed0 movs r0, 0x3 - bl sub_808ABE0 + bl DoForcedMovement lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .pool - thumb_func_end sub_808ACD0 + thumb_func_end ForcedMovement_WalkWest - thumb_func_start sub_808ACE8 -sub_808ACE8: ; 808ACE8 + thumb_func_start ForcedMovement_WalkEast +ForcedMovement_WalkEast: ; 808ACE8 push {lr} - ldr r1, =sub_808B720 + ldr r1, =PlayerGoSpeed0 movs r0, 0x4 - bl sub_808ABE0 + bl DoForcedMovement lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .pool - thumb_func_end sub_808ACE8 + thumb_func_end ForcedMovement_WalkEast - thumb_func_start sub_808AD00 -sub_808AD00: ; 808AD00 + thumb_func_start ForcedMovement_PushedSouthByCurrent +ForcedMovement_PushedSouthByCurrent: ; 808AD00 push {lr} - ldr r1, =sub_808B750 + ldr r1, =PlayerGoSpeed2 movs r0, 0x1 - bl sub_808ABE0 + bl DoForcedMovement lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .pool - thumb_func_end sub_808AD00 + thumb_func_end ForcedMovement_PushedSouthByCurrent - thumb_func_start sub_808AD18 -sub_808AD18: ; 808AD18 + thumb_func_start ForcedMovement_PushedNorthByCurrent +ForcedMovement_PushedNorthByCurrent: ; 808AD18 push {lr} - ldr r1, =sub_808B750 + ldr r1, =PlayerGoSpeed2 movs r0, 0x2 - bl sub_808ABE0 + bl DoForcedMovement lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .pool - thumb_func_end sub_808AD18 + thumb_func_end ForcedMovement_PushedNorthByCurrent - thumb_func_start sub_808AD30 -sub_808AD30: ; 808AD30 + thumb_func_start ForcedMovement_PushedWestByCurrent +ForcedMovement_PushedWestByCurrent: ; 808AD30 push {lr} - ldr r1, =sub_808B750 + ldr r1, =PlayerGoSpeed2 movs r0, 0x3 - bl sub_808ABE0 + bl DoForcedMovement lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .pool - thumb_func_end sub_808AD30 + thumb_func_end ForcedMovement_PushedWestByCurrent - thumb_func_start sub_808AD48 -sub_808AD48: ; 808AD48 + thumb_func_start ForcedMovement_PushedEastByCurrent +ForcedMovement_PushedEastByCurrent: ; 808AD48 push {lr} - ldr r1, =sub_808B750 + ldr r1, =PlayerGoSpeed2 movs r0, 0x4 - bl sub_808ABE0 + bl DoForcedMovement lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .pool - thumb_func_end sub_808AD48 + thumb_func_end ForcedMovement_PushedEastByCurrent - thumb_func_start sub_808AD60 -sub_808AD60: ; 808AD60 + thumb_func_start ForcedMovement_Slide +ForcedMovement_Slide: ; 808AD60 push {r4,lr} lsls r0, 24 lsrs r0, 24 @@ -239832,87 +239868,87 @@ sub_808AD60: ; 808AD60 movs r4, 0x2 orrs r3, r4 strb r3, [r2, 0x1] - bl sub_808ABE0 + bl DoForcedMovement lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .pool - thumb_func_end sub_808AD60 + thumb_func_end ForcedMovement_Slide - thumb_func_start sub_808AD98 -sub_808AD98: ; 808AD98 + thumb_func_start ForcedMovement_SlideSouth +ForcedMovement_SlideSouth: ; 808AD98 push {lr} - ldr r1, =sub_808B738 + ldr r1, =PlayerGoSpeed1 movs r0, 0x1 - bl sub_808AD60 + bl ForcedMovement_Slide lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .pool - thumb_func_end sub_808AD98 + thumb_func_end ForcedMovement_SlideSouth - thumb_func_start sub_808ADB0 -sub_808ADB0: ; 808ADB0 + thumb_func_start ForcedMovement_SlideNorth +ForcedMovement_SlideNorth: ; 808ADB0 push {lr} - ldr r1, =sub_808B738 + ldr r1, =PlayerGoSpeed1 movs r0, 0x2 - bl sub_808AD60 + bl ForcedMovement_Slide lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .pool - thumb_func_end sub_808ADB0 + thumb_func_end ForcedMovement_SlideNorth - thumb_func_start sub_808ADC8 -sub_808ADC8: ; 808ADC8 + thumb_func_start ForcedMovement_SlideWest +ForcedMovement_SlideWest: ; 808ADC8 push {lr} - ldr r1, =sub_808B738 + ldr r1, =PlayerGoSpeed1 movs r0, 0x3 - bl sub_808AD60 + bl ForcedMovement_Slide lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .pool - thumb_func_end sub_808ADC8 + thumb_func_end ForcedMovement_SlideWest - thumb_func_start sub_808ADE0 -sub_808ADE0: ; 808ADE0 + thumb_func_start ForcedMovement_SlideEast +ForcedMovement_SlideEast: ; 808ADE0 push {lr} - ldr r1, =sub_808B738 + ldr r1, =PlayerGoSpeed1 movs r0, 0x4 - bl sub_808AD60 + bl ForcedMovement_Slide lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .pool - thumb_func_end sub_808ADE0 + thumb_func_end ForcedMovement_SlideEast - thumb_func_start sub_808ADF8 -sub_808ADF8: ; 808ADF8 + thumb_func_start ForcedMovement_0xBB +ForcedMovement_0xBB: ; 808ADF8 push {lr} bl sub_808C4D8 movs r0, 0x1 pop {r1} bx r1 - thumb_func_end sub_808ADF8 + thumb_func_end ForcedMovement_0xBB - thumb_func_start sub_808AE04 -sub_808AE04: ; 808AE04 + thumb_func_start ForcedMovement_0xBC +ForcedMovement_0xBC: ; 808AE04 push {lr} bl sub_808C5B0 movs r0, 0x1 pop {r1} bx r1 - thumb_func_end sub_808AE04 + thumb_func_end ForcedMovement_0xBC - thumb_func_start sub_808AE10 -sub_808AE10: ; 808AE10 + thumb_func_start ForcedMovement_MuddySlope +ForcedMovement_MuddySlope: ; 808AE10 push {r4,lr} ldr r0, =0x02037590 ldrb r1, [r0, 0x5] @@ -239938,9 +239974,9 @@ sub_808AE10: ; 808AE10 movs r1, 0x2 orrs r0, r1 strb r0, [r4, 0x1] - ldr r1, =sub_808B738 + ldr r1, =PlayerGoSpeed1 movs r0, 0x1 - bl sub_808ABE0 + bl DoForcedMovement lsls r0, 24 lsrs r0, 24 b @0808AE62 @@ -239951,11 +239987,11 @@ sub_808AE10: ; 808AE10 pop {r4} pop {r1} bx r1 - thumb_func_end sub_808AE10 + thumb_func_end ForcedMovement_MuddySlope - thumb_func_start dp04_continue_movement -; void dp04_continue_movement(int dpad_direction, int buttons_held) -dp04_continue_movement: ; 808AE68 + thumb_func_start MovePlayerNotOnBike +; void MovePlayerNotOnBike(u8 direction, u8 heldKeys) +MovePlayerNotOnBike: ; 808AE68 push {r4-r6,lr} adds r4, r0, 0 adds r5, r1, 0 @@ -239965,7 +240001,7 @@ dp04_continue_movement: ; 808AE68 lsrs r5, 16 ldr r6, =gUnknown_08497490 adds r0, r4, 0 - bl walkrun_accelerate + bl CheckMovementInputNotOnBike lsls r0, 24 lsrs r0, 22 adds r0, r6 @@ -239977,10 +240013,11 @@ dp04_continue_movement: ; 808AE68 pop {r0} bx r0 .pool - thumb_func_end dp04_continue_movement + thumb_func_end MovePlayerNotOnBike - thumb_func_start walkrun_accelerate -walkrun_accelerate: ; 808AE98 + thumb_func_start CheckMovementInputNotOnBike +; u8 CheckMovementInputNotOnBike(u8 direction) +CheckMovementInputNotOnBike: ; 808AE98 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 @@ -239992,7 +240029,7 @@ walkrun_accelerate: ; 808AE98 b @0808AED2 .pool @0808AEB0: - bl player_get_direction_upper_4bits + bl player_get_direction_upper_nybble lsls r0, 24 lsrs r0, 24 cmp r4, r0 @@ -240014,38 +240051,41 @@ walkrun_accelerate: ; 808AE98 pop {r1} bx r1 .pool - thumb_func_end walkrun_accelerate + thumb_func_end CheckMovementInputNotOnBike - thumb_func_start dp04_look1 -dp04_look1: ; 808AEDC + thumb_func_start PlayerNotOnBikeNotMoving +; void PlayerNotOnBikeNotMoving(u8 direction, u8 heldKeys) +PlayerNotOnBikeNotMoving: ; 808AEDC push {lr} - bl player_get_direction__sp1AA + bl player_get_direction_lower_nybble lsls r0, 24 lsrs r0, 24 - bl player_npc_use_look1 + bl PlayerFaceDirection pop {r0} bx r0 - thumb_func_end dp04_look1 + thumb_func_end PlayerNotOnBikeNotMoving - thumb_func_start sub_808AEF0 -sub_808AEF0: ; 808AEF0 + thumb_func_start PlayerNotOnBikeTurningInPlace +; void PlayerNotOnBikeTurningInPlace(u8 direction, u8 heldKeys) +PlayerNotOnBikeTurningInPlace: ; 808AEF0 push {lr} lsls r0, 24 lsrs r0, 24 - bl sub_808B828 + bl PlayerTurnInPlace pop {r0} bx r0 - thumb_func_end sub_808AEF0 + thumb_func_end PlayerNotOnBikeTurningInPlace - thumb_func_start sub_808AF00 -sub_808AF00: ; 808AF00 + thumb_func_start PlayerNotOnBikeMoving +; void PlayerNotOnBikeMoving(u8 direction, u8 heldKeys) +PlayerNotOnBikeMoving: ; 808AF00 push {r4-r6,lr} lsls r0, 24 lsrs r5, r0, 24 lsls r1, 16 lsrs r6, r1, 16 adds r0, r5, 0 - bl sub_808AFBC + bl CheckForPlayerAvatarCollision lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 @@ -240053,18 +240093,18 @@ sub_808AF00: ; 808AF00 cmp r4, 0x6 bne @0808AF24 adds r0, r5, 0 - bl npc_use_some_d2s_and_sound + bl PlayerJumpLedge b @0808AFB6 @0808AF24: cmp r4, 0x4 bne @0808AF3C adds r0, r5, 0 - bl sub_808B324 + bl IsPlayerCollidingWithFarawayIslandMew lsls r0, 24 cmp r0, 0 beq @0808AF3C adds r0, r5, 0 - bl sub_808B7F8 + bl PlayerNotOnBikeCollideWithFarawayIslandMew b @0808AFB6 @0808AF3C: subs r0, r4, 0x5 @@ -240073,7 +240113,7 @@ sub_808AF00: ; 808AF00 cmp r0, 0x3 bls @0808AFB6 adds r0, r5, 0 - bl npc_use_some_d2s_and_conditional_sound + bl PlayerNotOnBikeCollide b @0808AFB6 @0808AF4E: ldr r4, =0x02037590 @@ -240083,7 +240123,7 @@ sub_808AF00: ; 808AF00 cmp r0, 0 beq @0808AF68 adds r0, r5, 0 - bl sub_808B738 + bl PlayerGoSpeed1 b @0808AFB6 .pool @0808AF68: @@ -240108,11 +240148,11 @@ sub_808AF00: ; 808AF00 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x1E] - bl is_tile_to_run_on + bl IsRunningDisallowed cmp r0, 0 bne @0808AFB0 adds r0, r5, 0 - bl sub_808B780 + bl PlayerRun ldrb r1, [r4] movs r0, 0x80 orrs r0, r1 @@ -240121,15 +240161,15 @@ sub_808AF00: ; 808AF00 .pool @0808AFB0: adds r0, r5, 0 - bl sub_808B720 + bl PlayerGoSpeed0 @0808AFB6: pop {r4-r6} pop {r0} bx r0 - thumb_func_end sub_808AF00 + thumb_func_end PlayerNotOnBikeMoving - thumb_func_start sub_808AFBC -sub_808AFBC: ; 808AFBC + thumb_func_start CheckForPlayerAvatarCollision +CheckForPlayerAvatarCollision: ; 808AFBC push {r4-r6,lr} sub sp, 0x8 adds r6, r0, 0 @@ -240152,7 +240192,7 @@ sub_808AFBC: ; 808AFBC adds r0, r6, 0 add r1, sp, 0x4 adds r2, r5, 0 - bl numbers_move_direction + bl MoveCoords add r0, sp, 0x4 movs r1, 0 ldrsh r0, [r0, r1] @@ -240169,7 +240209,7 @@ sub_808AFBC: ; 808AFBC str r0, [sp] adds r0, r4, 0 adds r3, r6, 0 - bl sub_808B094 + bl CheckForFieldObjectCollision lsls r0, 24 lsrs r0, 24 add sp, 0x8 @@ -240177,7 +240217,7 @@ sub_808AFBC: ; 808AFBC pop {r1} bx r1 .pool - thumb_func_end sub_808AFBC + thumb_func_end CheckForPlayerAvatarCollision thumb_func_start sub_808B028 sub_808B028: ; 808B028 @@ -240203,7 +240243,7 @@ sub_808B028: ; 808B028 adds r0, r6, 0 add r1, sp, 0x4 adds r2, r5, 0 - bl numbers_move_direction + bl MoveCoords add r0, sp, 0x4 movs r1, 0 ldrsh r0, [r0, r1] @@ -240230,8 +240270,9 @@ sub_808B028: ; 808B028 .pool thumb_func_end sub_808B028 - thumb_func_start sub_808B094 -sub_808B094: ; 808B094 + thumb_func_start CheckForFieldObjectCollision +; u8 CheckForFieldObjectCollision(struct npc_state *fieldObject, u16 x, u16 y, u8 direction, u8 metatileBehavior) +CheckForFieldObjectCollision: ; 808B094 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -240279,7 +240320,7 @@ sub_808B094: ; 808B094 asrs r7, r4, 16 adds r1, r7, 0 adds r2, r6, 0 - bl ShouldDoJump + bl ShouldJumpLedge lsls r0, 24 cmp r0, 0 beq @0808B108 @@ -240311,7 +240352,7 @@ sub_808B094: ; 808B094 adds r0, r6, 0 adds r1, r5, 0 adds r2, r4, 0 - bl sub_80FBEF0 + bl CheckForRotatingDoorPuzzleCollision cmp r0, 0 beq @0808B142 movs r0, 0x8 @@ -240321,7 +240362,7 @@ sub_808B094: ; 808B094 adds r1, r4, 0 mov r2, r10 mov r3, sp - bl sub_808B2E4 + bl check_acro_bike_metatile @0808B14E: mov r0, sp ldrb r0, [r0] @@ -240334,7 +240375,7 @@ sub_808B094: ; 808B094 pop {r4-r7} pop {r1} bx r1 - thumb_func_end sub_808B094 + thumb_func_end CheckForFieldObjectCollision thumb_func_start sub_808B164 sub_808B164: ; 808B164 @@ -240372,7 +240413,7 @@ sub_808B164: ; 808B164 adds r1, r4, 0 adds r2, r7, 0 mov r3, sp - bl sub_808B2E4 + bl check_acro_bike_metatile @0808B1AE: mov r0, sp ldrb r0, [r0] @@ -240384,6 +240425,7 @@ sub_808B164: ; 808B164 thumb_func_end sub_808B164 thumb_func_start sub_808B1BC +; BOOL sub_808B1BC(u16 x, u16 y, u8 direction) sub_808B1BC: ; 808B1BC push {r4-r6,lr} lsls r0, 16 @@ -240402,7 +240444,7 @@ sub_808B1BC: ; 808B1BC asrs r0, r5, 16 lsls r4, 16 asrs r1, r4, 16 - bl cur_mapdata_get_upper4bit_at + bl MapGridGetZCoordAt lsls r0, 24 lsrs r0, 24 cmp r0, 0x3 @@ -240410,7 +240452,7 @@ sub_808B1BC: ; 808B1BC lsrs r0, r5, 16 lsrs r1, r4, 16 movs r2, 0x3 - bl npc_id_by_pos_and_height + bl GetFieldObjectIdByXYZ lsls r0, 24 lsrs r0, 24 cmp r0, 0x10 @@ -240428,8 +240470,9 @@ sub_808B1BC: ; 808B1BC bx r1 thumb_func_end sub_808B1BC - thumb_func_start ShouldDoJump -ShouldDoJump: ; 808B214 + thumb_func_start ShouldJumpLedge +; BOOL ShouldJumpLedge(s16 x, s16 y, u8 direction) +ShouldJumpLedge: ; 808B214 push {lr} lsls r2, 24 lsrs r2, 24 @@ -240437,7 +240480,7 @@ ShouldDoJump: ; 808B214 asrs r0, 16 lsls r1, 16 asrs r1, 16 - bl GetJumpDirection + bl GetLedgeJumpDirection lsls r0, 24 cmp r0, 0 bne @0808B230 @@ -240448,7 +240491,7 @@ ShouldDoJump: ; 808B214 @0808B232: pop {r1} bx r1 - thumb_func_end ShouldDoJump + thumb_func_end ShouldJumpLedge thumb_func_start sub_808B238 sub_808B238: ; 808B238 @@ -240471,7 +240514,7 @@ sub_808B238: ; 808B238 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r5, r2] - bl npc_id_by_pos + bl GetFieldObjectIdByXY lsls r0, 24 lsrs r6, r0, 24 cmp r6, 0x10 @@ -240492,7 +240535,7 @@ sub_808B238: ; 808B238 adds r0, r7, 0 mov r1, sp adds r2, r5, 0 - bl numbers_move_direction + bl MoveCoords mov r0, sp movs r2, 0 ldrsh r1, [r0, r2] @@ -240531,8 +240574,9 @@ sub_808B238: ; 808B238 bx r1 thumb_func_end sub_808B238 - thumb_func_start sub_808B2E4 -sub_808B2E4: ; 808B2E4 + thumb_func_start check_acro_bike_metatile +; void check_acro_bike_metatile(s16 x, s16 y, u8 metatileBehavior, u8 *returnValue) +check_acro_bike_metatile: ; 808B2E4 push {r4-r7,lr} adds r6, r3, 0 lsls r2, 24 @@ -240564,10 +240608,11 @@ sub_808B2E4: ; 808B2E4 pop {r4-r7} pop {r0} bx r0 - thumb_func_end sub_808B2E4 + thumb_func_end check_acro_bike_metatile - thumb_func_start sub_808B324 -sub_808B324: ; 808B324 + thumb_func_start IsPlayerCollidingWithFarawayIslandMew +; BOOL IsPlayerCollidingWithFarawayIslandMew(u8 direction) +IsPlayerCollidingWithFarawayIslandMew: ; 808B324 push {r4-r6,lr} sub sp, 0x4 lsls r0, 24 @@ -240588,11 +240633,11 @@ sub_808B324: ; 808B324 strh r1, [r4] mov r1, sp adds r2, r4, 0 - bl numbers_move_direction + bl MoveCoords movs r0, 0x1 movs r1, 0x39 movs r2, 0x1A - bl get_npc_id_by_local_id + bl GetFieldObjectIdByLocalIdAndMap lsls r0, 24 lsrs r1, r0, 24 adds r6, r4, 0 @@ -240648,10 +240693,11 @@ sub_808B324: ; 808B324 pop {r4-r6} pop {r1} bx r1 - thumb_func_end sub_808B324 + thumb_func_end IsPlayerCollidingWithFarawayIslandMew - thumb_func_start walkrun_set_bike_bits -walkrun_set_bike_bits: ; 808B3CC + thumb_func_start SetPlayerAvatarTransition +; void SetPlayerAvatarTransition(u16 stateTransition) +SetPlayerAvatarTransition: ; 808B3CC push {lr} lsls r0, 16 lsrs r0, 16 @@ -240659,14 +240705,15 @@ walkrun_set_bike_bits: ; 808B3CC ldrb r1, [r2, 0x1] orrs r0, r1 strb r0, [r2, 0x1] - bl bike_related + bl DoPlayerAvatarTransition pop {r0} bx r0 .pool - thumb_func_end walkrun_set_bike_bits + thumb_func_end SetPlayerAvatarTransition - thumb_func_start bike_related -bike_related: ; 808B3E8 + thumb_func_start DoPlayerAvatarTransition +; void DoPlayerAvatarTransition() +DoPlayerAvatarTransition: ; 808B3E8 push {r4,r5,lr} ldr r0, =0x02037590 ldrb r4, [r0, 0x1] @@ -240705,77 +240752,81 @@ bike_related: ; 808B3E8 pop {r0} bx r0 .pool - thumb_func_end bike_related + thumb_func_end DoPlayerAvatarTransition - thumb_func_start nullsub_32 -nullsub_32: ; 808B43C + thumb_func_start PlayerAvatarTransition_Dummy +; void PlayerAvatarTransition_Dummy(struct npc_state *fieldObject) +PlayerAvatarTransition_Dummy: ; 808B43C bx lr - thumb_func_end nullsub_32 + thumb_func_end PlayerAvatarTransition_Dummy - thumb_func_start sub_808B440 -sub_808B440: ; 808B440 + thumb_func_start PlayerAvatarTransition_Normal +; void PlayerAvatarTransition_Normal(struct npc_state *fieldObject) +PlayerAvatarTransition_Normal: ; 808B440 push {r4,lr} adds r4, r0, 0 movs r0, 0 - bl sub_808BD8C + bl GetPlayerAvatarGraphicsIdByStateId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl set_field_object_graphics + bl FieldObjectSetGraphicsId ldrb r1, [r4, 0x18] lsrs r1, 4 adds r0, r4, 0 - bl npc_turn + bl FieldObjectTurn movs r0, 0x1 - bl sub_808BF14 + bl SetPlayerAvatarStateMask pop {r4} pop {r0} bx r0 - thumb_func_end sub_808B440 + thumb_func_end PlayerAvatarTransition_Normal - thumb_func_start sub_808B46C -sub_808B46C: ; 808B46C + thumb_func_start PlayerAvatarTransition_MachBike +; void PlayerAvatarTransition_MachBike(struct npc_state *fieldObject) +PlayerAvatarTransition_MachBike: ; 808B46C push {r4,lr} adds r4, r0, 0 movs r0, 0x1 - bl sub_808BD8C + bl GetPlayerAvatarGraphicsIdByStateId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl set_field_object_graphics + bl FieldObjectSetGraphicsId ldrb r1, [r4, 0x18] lsrs r1, 4 adds r0, r4, 0 - bl npc_turn + bl FieldObjectTurn movs r0, 0x2 - bl sub_808BF14 + bl SetPlayerAvatarStateMask movs r0, 0 movs r1, 0 bl sub_811A0D0 pop {r4} pop {r0} bx r0 - thumb_func_end sub_808B46C + thumb_func_end PlayerAvatarTransition_MachBike - thumb_func_start sub_808B4A0 -sub_808B4A0: ; 808B4A0 + thumb_func_start PlayerAvatarTransition_AcroBike +; void PlayerAvatarTransition_AcroBike(struct npc_state *fieldObject) +PlayerAvatarTransition_AcroBike: ; 808B4A0 push {r4,lr} adds r4, r0, 0 movs r0, 0x2 - bl sub_808BD8C + bl GetPlayerAvatarGraphicsIdByStateId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl set_field_object_graphics + bl FieldObjectSetGraphicsId ldrb r1, [r4, 0x18] lsrs r1, 4 adds r0, r4, 0 - bl npc_turn + bl FieldObjectTurn movs r0, 0x4 - bl sub_808BF14 + bl SetPlayerAvatarStateMask movs r0, 0 movs r1, 0 bl sub_811A0D0 @@ -240783,25 +240834,26 @@ sub_808B4A0: ; 808B4A0 pop {r4} pop {r0} bx r0 - thumb_func_end sub_808B4A0 + thumb_func_end PlayerAvatarTransition_AcroBike - thumb_func_start get_on_surf_blob -get_on_surf_blob: ; 808B4D8 + thumb_func_start PlayerAvatarTransition_Surfing +; void PlayerAvatarTransition_Surfing(struct npc_state *fieldObject) +PlayerAvatarTransition_Surfing: ; 808B4D8 push {r4,lr} adds r4, r0, 0 movs r0, 0x3 - bl sub_808BD8C + bl GetPlayerAvatarGraphicsIdByStateId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl set_field_object_graphics + bl FieldObjectSetGraphicsId ldrb r1, [r4, 0x18] lsrs r1, 4 adds r0, r4, 0 - bl npc_turn + bl FieldObjectTurn movs r0, 0x8 - bl sub_808BF14 + bl SetPlayerAvatarStateMask ldr r1, =0x02038c08 movs r2, 0x10 ldrsh r0, [r4, r2] @@ -240823,35 +240875,37 @@ get_on_surf_blob: ; 808B4D8 pop {r0} bx r0 .pool - thumb_func_end get_on_surf_blob + thumb_func_end PlayerAvatarTransition_Surfing - thumb_func_start sub_808B534 -sub_808B534: ; 808B534 + thumb_func_start PlayerAvatarTransition_Underwater +; void PlayerAvatarTransition_Underwater(struct npc_state *fieldObject) +PlayerAvatarTransition_Underwater: ; 808B534 push {r4,lr} adds r4, r0, 0 movs r0, 0x4 - bl sub_808BD8C + bl GetPlayerAvatarGraphicsIdByStateId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl set_field_object_graphics + bl FieldObjectSetGraphicsId ldrb r1, [r4, 0x18] lsrs r1, 4 adds r0, r4, 0 - bl npc_turn + bl FieldObjectTurn movs r0, 0x10 - bl sub_808BF14 + bl SetPlayerAvatarStateMask ldrb r0, [r4, 0x4] bl sub_8155800 strb r0, [r4, 0x1A] pop {r4} pop {r0} bx r0 - thumb_func_end sub_808B534 + thumb_func_end PlayerAvatarTransition_Underwater - thumb_func_start sub_808B568 -sub_808B568: ; 808B568 + thumb_func_start PlayerAvatarTransition_ReturnToField +; void PlayerAvatarTransition_ReturnToField(struct npc_state *fieldObject) +PlayerAvatarTransition_ReturnToField: ; 808B568 ldr r2, =0x02037590 ldrb r1, [r2] movs r0, 0x20 @@ -240859,7 +240913,7 @@ sub_808B568: ; 808B568 strb r0, [r2] bx lr .pool - thumb_func_end sub_808B568 + thumb_func_end PlayerAvatarTransition_ReturnToField thumb_func_start sub_808B578 sub_808B578: ; 808B578 @@ -240867,15 +240921,15 @@ sub_808B578: ; 808B578 ldr r4, =0x02037590 movs r0, 0 strb r0, [r4, 0x3] - bl player_bits_x42 + bl PlayerIsAnimActive lsls r0, 24 cmp r0, 0 beq @0808B5B6 - bl sub_808B660 + bl PlayerCheckIfAnimFinishedOrInactive lsls r0, 24 cmp r0, 0 bne @0808B5A8 - bl sub_808B5BC + bl player_is_anim_in_certain_ranges lsls r0, 24 cmp r0, 0 bne @0808B5B6 @@ -240896,8 +240950,8 @@ sub_808B578: ; 808B578 bx r0 thumb_func_end sub_808B578 - thumb_func_start sub_808B5BC -sub_808B5BC: ; 808B5BC + thumb_func_start player_is_anim_in_certain_ranges +player_is_anim_in_certain_ranges: ; 808B5BC push {lr} ldr r2, =0x02037350 ldr r0, =0x02037590 @@ -240942,12 +240996,12 @@ sub_808B5BC: ; 808B5BC @0808B612: pop {r1} bx r1 - thumb_func_end sub_808B5BC + thumb_func_end player_is_anim_in_certain_ranges thumb_func_start sub_808B618 sub_808B618: ; 808B618 push {lr} - bl sub_808B5BC + bl player_is_anim_in_certain_ranges lsls r0, 24 cmp r0, 0 beq @0808B634 @@ -240965,8 +241019,9 @@ sub_808B618: ; 808B618 bx r1 thumb_func_end sub_808B618 - thumb_func_start player_bits_x42 -player_bits_x42: ; 808B63C + thumb_func_start PlayerIsAnimActive +; BOOL PlayerIsAnimActive() +PlayerIsAnimActive: ; 808B63C push {lr} ldr r0, =0x02037590 ldrb r1, [r0, 0x5] @@ -240975,16 +241030,17 @@ player_bits_x42: ; 808B63C lsls r0, 2 ldr r1, =0x02037350 adds r0, r1 - bl npc_is_visible_or_is_x40 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .pool - thumb_func_end player_bits_x42 + thumb_func_end PlayerIsAnimActive - thumb_func_start sub_808B660 -sub_808B660: ; 808B660 + thumb_func_start PlayerCheckIfAnimFinishedOrInactive +; BOOL PlayerCheckIfAnimFinishedOrInactive() +PlayerCheckIfAnimFinishedOrInactive: ; 808B660 push {lr} ldr r0, =0x02037590 ldrb r1, [r0, 0x5] @@ -240993,13 +241049,13 @@ sub_808B660: ; 808B660 lsls r0, 2 ldr r1, =0x02037350 adds r0, r1 - bl npc_get_bit7_or_const_x10_when_inactive + bl FieldObjectCheckIfSpecialAnimFinishedOrInactive lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .pool - thumb_func_end sub_808B660 + thumb_func_end PlayerCheckIfAnimFinishedOrInactive thumb_func_start player_set_x22 player_set_x22: ; 808B684 @@ -241044,20 +241100,21 @@ sub_808B6BC: ; 808B6BC lsls r0, 2 ldr r2, =0x02037350 adds r0, r2 - bl sub_8093208 + bl FieldObjectForceSetSpecialAnim pop {r0} bx r0 .pool thumb_func_end sub_808B6BC thumb_func_start player_npc_set_state_and_x22_etc +; void player_npc_set_state_and_x22_etc(u8 animState, u8 a2) player_npc_set_state_and_x22_etc: ; 808B6E4 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 lsls r1, 24 lsrs r4, r1, 24 - bl player_bits_x42 + bl PlayerIsAnimActive lsls r0, 24 cmp r0, 0 bne @0808B712 @@ -241071,7 +241128,7 @@ player_npc_set_state_and_x22_etc: ; 808B6E4 ldr r1, =0x02037350 adds r0, r1 adds r1, r5, 0 - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim @0808B712: pop {r4,r5} pop {r0} @@ -241079,86 +241136,92 @@ player_npc_set_state_and_x22_etc: ; 808B6E4 .pool thumb_func_end player_npc_set_state_and_x22_etc - thumb_func_start sub_808B720 -sub_808B720: ; 808B720 + thumb_func_start PlayerGoSpeed0 +; void PlayerGoSpeed0(u8 direction) +PlayerGoSpeed0: ; 808B720 push {lr} lsls r0, 24 lsrs r0, 24 - bl sub_8093388 + bl GetGoSpeed0AnimId lsls r0, 24 lsrs r0, 24 movs r1, 0x2 bl player_npc_set_state_and_x22_etc pop {r0} bx r0 - thumb_func_end sub_808B720 + thumb_func_end PlayerGoSpeed0 - thumb_func_start sub_808B738 -sub_808B738: ; 808B738 + thumb_func_start PlayerGoSpeed1 +; void PlayerGoSpeed1(u8 direction) +PlayerGoSpeed1: ; 808B738 push {lr} lsls r0, 24 lsrs r0, 24 - bl sub_80933B4 + bl GetGoSpeed1AnimId lsls r0, 24 lsrs r0, 24 movs r1, 0x2 bl player_npc_set_state_and_x22_etc pop {r0} bx r0 - thumb_func_end sub_808B738 + thumb_func_end PlayerGoSpeed1 - thumb_func_start sub_808B750 -sub_808B750: ; 808B750 + thumb_func_start PlayerGoSpeed2 +; void PlayerGoSpeed2(u8 direction) +PlayerGoSpeed2: ; 808B750 push {lr} lsls r0, 24 lsrs r0, 24 - bl sub_80933E0 + bl GetGoSpeed2AnimId lsls r0, 24 lsrs r0, 24 movs r1, 0x2 bl player_npc_set_state_and_x22_etc pop {r0} bx r0 - thumb_func_end sub_808B750 + thumb_func_end PlayerGoSpeed2 - thumb_func_start sub_808B768 -sub_808B768: ; 808B768 + thumb_func_start PlayerGoSpeed3 +; void PlayerGoSpeed3(u8 direction) +PlayerGoSpeed3: ; 808B768 push {lr} lsls r0, 24 lsrs r0, 24 - bl sub_809340C + bl GetGoSpeed3AnimId lsls r0, 24 lsrs r0, 24 movs r1, 0x2 bl player_npc_set_state_and_x22_etc pop {r0} bx r0 - thumb_func_end sub_808B768 + thumb_func_end PlayerGoSpeed3 - thumb_func_start sub_808B780 -sub_808B780: ; 808B780 + thumb_func_start PlayerRun +; void PlayerRun(u8 direction) +PlayerRun: ; 808B780 push {lr} lsls r0, 24 lsrs r0, 24 - bl sub_8093464 + bl GetRunAnimId lsls r0, 24 lsrs r0, 24 movs r1, 0x2 bl player_npc_set_state_and_x22_etc pop {r0} bx r0 - thumb_func_end sub_808B780 + thumb_func_end PlayerRun - thumb_func_start tile_sound_react -tile_sound_react: ; 808B798 + thumb_func_start PlayerOnBikeCollide +; void PlayerOnBikeCollide(u8 direction) +PlayerOnBikeCollide: ; 808B798 push {r4,lr} adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 adds r0, r4, 0 - bl tile_conditional_sound + bl PlayCollisionSoundIfNotFacingWarp adds r0, r4, 0 - bl d2s_08064244 + bl GetStepInPlaceDelay16AnimId lsls r0, 24 lsrs r0, 24 movs r1, 0x2 @@ -241166,32 +241229,34 @@ tile_sound_react: ; 808B798 pop {r4} pop {r0} bx r0 - thumb_func_end tile_sound_react + thumb_func_end PlayerOnBikeCollide - thumb_func_start sub_808B7BC -sub_808B7BC: ; 808B7BC + thumb_func_start PlayerOnBikeCollideWithFarawayIslandMew +; void PlayerOnBikeCollideWithFarawayIslandMew(u8 direction) +PlayerOnBikeCollideWithFarawayIslandMew: ; 808B7BC push {lr} lsls r0, 24 lsrs r0, 24 - bl d2s_08064244 + bl GetStepInPlaceDelay16AnimId lsls r0, 24 lsrs r0, 24 movs r1, 0x2 bl player_npc_set_state_and_x22_etc pop {r0} bx r0 - thumb_func_end sub_808B7BC + thumb_func_end PlayerOnBikeCollideWithFarawayIslandMew - thumb_func_start npc_use_some_d2s_and_conditional_sound -npc_use_some_d2s_and_conditional_sound: ; 808B7D4 + thumb_func_start PlayerNotOnBikeCollide +; void PlayerNotOnBikeCollide(u8 direction) +PlayerNotOnBikeCollide: ; 808B7D4 push {r4,lr} adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 adds r0, r4, 0 - bl tile_conditional_sound + bl PlayCollisionSoundIfNotFacingWarp adds r0, r4, 0 - bl sub_809356C + bl GetStepInPlaceDelay32AnimId lsls r0, 24 lsrs r0, 24 movs r1, 0x2 @@ -241199,52 +241264,56 @@ npc_use_some_d2s_and_conditional_sound: ; 808B7D4 pop {r4} pop {r0} bx r0 - thumb_func_end npc_use_some_d2s_and_conditional_sound + thumb_func_end PlayerNotOnBikeCollide - thumb_func_start sub_808B7F8 -sub_808B7F8: ; 808B7F8 + thumb_func_start PlayerNotOnBikeCollideWithFarawayIslandMew +; void PlayerNotOnBikeCollideWithFarawayIslandMew(u8 direction) +PlayerNotOnBikeCollideWithFarawayIslandMew: ; 808B7F8 push {lr} lsls r0, 24 lsrs r0, 24 - bl sub_809356C + bl GetStepInPlaceDelay32AnimId lsls r0, 24 lsrs r0, 24 movs r1, 0x2 bl player_npc_set_state_and_x22_etc pop {r0} bx r0 - thumb_func_end sub_808B7F8 + thumb_func_end PlayerNotOnBikeCollideWithFarawayIslandMew - thumb_func_start player_npc_use_look1 -player_npc_use_look1: ; 808B810 + thumb_func_start PlayerFaceDirection +; void PlayerFaceDirection(u8 direction) +PlayerFaceDirection: ; 808B810 push {lr} lsls r0, 24 lsrs r0, 24 - bl d2s_look1 + bl GetFaceDirectionAnimId lsls r0, 24 lsrs r0, 24 movs r1, 0x1 bl player_npc_set_state_and_x22_etc pop {r0} bx r0 - thumb_func_end player_npc_use_look1 + thumb_func_end PlayerFaceDirection - thumb_func_start sub_808B828 -sub_808B828: ; 808B828 + thumb_func_start PlayerTurnInPlace +; void PlayerTurnInPlace(u8 direction) +PlayerTurnInPlace: ; 808B828 push {lr} lsls r0, 24 lsrs r0, 24 - bl sub_80935C4 + bl GetStepInPlaceDelay8AnimId lsls r0, 24 lsrs r0, 24 movs r1, 0x1 bl player_npc_set_state_and_x22_etc pop {r0} bx r0 - thumb_func_end sub_808B828 + thumb_func_end PlayerTurnInPlace - thumb_func_start npc_use_some_d2s_and_sound -npc_use_some_d2s_and_sound: ; 808B840 + thumb_func_start PlayerJumpLedge +; void PlayerJumpLedge(u8 direction) +PlayerJumpLedge: ; 808B840 push {r4,lr} adds r4, r0, 0 lsls r4, 24 @@ -241252,7 +241321,7 @@ npc_use_some_d2s_and_sound: ; 808B840 movs r0, 0xA bl audio_play adds r0, r4, 0 - bl d2s_08064110 + bl GetJumpLedgeAnimId lsls r0, 24 lsrs r0, 24 movs r1, 0x8 @@ -241260,7 +241329,7 @@ npc_use_some_d2s_and_sound: ; 808B840 pop {r4} pop {r0} bx r0 - thumb_func_end npc_use_some_d2s_and_sound + thumb_func_end PlayerJumpLedge thumb_func_start sub_808B864 sub_808B864: ; 808B864 @@ -241285,7 +241354,7 @@ sub_808B864: ; 808B864 ldrb r0, [r0, 0x18] lsls r0, 28 lsrs r0, 28 - bl d2s_look1 + bl GetFaceDirectionAnimId lsls r0, 24 lsrs r0, 24 bl sub_808B6BC @@ -241475,8 +241544,9 @@ npc_use_some_d2s: ; 808B9D4 bx r0 thumb_func_end npc_use_some_d2s - thumb_func_start tile_conditional_sound -tile_conditional_sound: ; 808B9EC + thumb_func_start PlayCollisionSoundIfNotFacingWarp +; void PlayCollisionSoundIfNotFacingWarp(u8 direction) +PlayCollisionSoundIfNotFacingWarp: ; 808B9EC push {r4,lr} sub sp, 0x4 lsls r0, 24 @@ -241504,11 +241574,11 @@ tile_conditional_sound: ; 808B9EC adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to + bl PlayerGetDestCoords movs r0, 0x2 mov r1, sp adds r2, r4, 0 - bl numbers_move_direction + bl MoveCoords mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] @@ -241530,7 +241600,7 @@ tile_conditional_sound: ; 808B9EC pop {r0} bx r0 .pool - thumb_func_end tile_conditional_sound + thumb_func_end PlayCollisionSoundIfNotFacingWarp thumb_func_start player_get_pos_to_plus_one_step_in_direction_player_is_facing player_get_pos_to_plus_one_step_in_direction_player_is_facing: ; 808BA68 @@ -241553,21 +241623,21 @@ player_get_pos_to_plus_one_step_in_direction_player_is_facing: ; 808BA68 adds r0, r3 ldrh r0, [r0, 0x12] strh r0, [r5] - bl player_get_direction__sp1AA + bl player_get_direction_lower_nybble lsls r0, 24 lsrs r0, 24 adds r1, r4, 0 adds r2, r5, 0 - bl numbers_move_direction + bl MoveCoords pop {r4,r5} pop {r0} bx r0 .pool thumb_func_end player_get_pos_to_plus_one_step_in_direction_player_is_facing - thumb_func_start player_get_pos_to -; void player_get_pos_to(int *x, int *y) -player_get_pos_to: ; 808BAAC + thumb_func_start PlayerGetDestCoords +; void PlayerGetDestCoords(u16 *x, u16 *y) +PlayerGetDestCoords: ; 808BAAC push {r4,r5,lr} ldr r5, =0x02037350 ldr r4, =0x02037590 @@ -241589,7 +241659,7 @@ player_get_pos_to: ; 808BAAC pop {r0} bx r0 .pool - thumb_func_end player_get_pos_to + thumb_func_end PlayerGetDestCoords thumb_func_start plaer_get_pos_including_state_based_drift plaer_get_pos_including_state_based_drift: ; 808BADC @@ -241724,8 +241794,9 @@ plaer_get_pos_including_state_based_drift: ; 808BADC bx r1 thumb_func_end plaer_get_pos_including_state_based_drift - thumb_func_start player_get_direction__sp1AA -player_get_direction__sp1AA: ; 808BC38 + thumb_func_start player_get_direction_lower_nybble +; u8 player_get_direction_lower_nybble() +player_get_direction_lower_nybble: ; 808BC38 ldr r2, =0x02037350 ldr r0, =0x02037590 ldrb r1, [r0, 0x5] @@ -241738,10 +241809,11 @@ player_get_direction__sp1AA: ; 808BC38 lsrs r0, 28 bx lr .pool - thumb_func_end player_get_direction__sp1AA + thumb_func_end player_get_direction_lower_nybble - thumb_func_start player_get_direction_upper_4bits -player_get_direction_upper_4bits: ; 808BC58 + thumb_func_start player_get_direction_upper_nybble +; u8 player_get_direction_upper_nybble() +player_get_direction_upper_nybble: ; 808BC58 ldr r2, =0x02037350 ldr r0, =0x02037590 ldrb r1, [r0, 0x5] @@ -241753,10 +241825,10 @@ player_get_direction_upper_4bits: ; 808BC58 lsrs r0, 4 bx lr .pool - thumb_func_end player_get_direction_upper_4bits + thumb_func_end player_get_direction_upper_nybble - thumb_func_start player_get_height -player_get_height: ; 808BC74 + thumb_func_start PlayerGetZCoord +PlayerGetZCoord: ; 808BC74 ldr r2, =0x02037350 ldr r0, =0x02037590 ldrb r1, [r0, 0x5] @@ -241768,7 +241840,7 @@ player_get_height: ; 808BC74 lsrs r0, 4 bx lr .pool - thumb_func_end player_get_height + thumb_func_end PlayerGetZCoord thumb_func_start sub_808BC90 sub_808BC90: ; 808BC90 @@ -241793,15 +241865,16 @@ sub_808BC90: ; 808BC90 .pool thumb_func_end sub_808BC90 - thumb_func_start walkrun_bitfield_and_r0 -walkrun_bitfield_and_r0: ; 808BCC0 + thumb_func_start TestPlayerAvatarFlags +; u32 TestPlayerAvatarFlags(u32 mask) +TestPlayerAvatarFlags: ; 808BCC0 ldr r1, =0x02037590 ldrb r1, [r1] ands r1, r0 adds r0, r1, 0 bx lr .pool - thumb_func_end walkrun_bitfield_and_r0 + thumb_func_end TestPlayerAvatarFlags thumb_func_start sub_808BCD0 sub_808BCD0: ; 808BCD0 @@ -241811,18 +241884,19 @@ sub_808BCD0: ; 808BCD0 .pool thumb_func_end sub_808BCD0 - thumb_func_start sub_808BCDC -sub_808BCDC: ; 808BCDC + thumb_func_start GetPlayerAvatarObjectId +; u8 GetPlayerAvatarObjectId() +GetPlayerAvatarObjectId: ; 808BCDC ldr r0, =0x02037590 ldrb r0, [r0, 0x4] bx lr .pool - thumb_func_end sub_808BCDC + thumb_func_end GetPlayerAvatarObjectId thumb_func_start sub_808BCE8 sub_808BCE8: ; 808BCE8 push {lr} - bl sub_808AB94 + bl ForcedMovement_None pop {r0} bx r0 thumb_func_end sub_808BCE8 @@ -241843,9 +241917,9 @@ sub_808BCF4: ; 808BCF4 lsls r1, 28 lsrs r1, 28 adds r0, r4, 0 - bl npc_set_direction + bl FieldObjectSetDirection movs r0, 0x6 - bl walkrun_bitfield_and_r0 + bl TestPlayerAvatarFlags lsls r0, 24 cmp r0, 0 beq @0808BD2C @@ -241873,9 +241947,9 @@ sub_808BD3C: ; 808BD3C .pool thumb_func_end sub_808BD3C - thumb_func_start GetPlayerAvatarFieldObjectType -; u8 GetPlayerAvatarFieldObjectType(u8 state, u8 gender) -GetPlayerAvatarFieldObjectType: ; 808BD54 + thumb_func_start GetPlayerAvatarGraphicsIdByStateIdAndGender +; u8 GetPlayerAvatarGraphicsIdByStateIdAndGender(u8 stateId, u8 gender) +GetPlayerAvatarGraphicsIdByStateIdAndGender: ; 808BD54 lsls r0, 24 lsls r1, 24 lsrs r1, 24 @@ -241886,7 +241960,7 @@ GetPlayerAvatarFieldObjectType: ; 808BD54 ldrb r0, [r1] bx lr .pool - thumb_func_end GetPlayerAvatarFieldObjectType + thumb_func_end GetPlayerAvatarGraphicsIdByStateIdAndGender thumb_func_start sub_808BD6C sub_808BD6C: ; 808BD6C @@ -241910,20 +241984,21 @@ sub_808BD7C: ; 808BD7C .pool thumb_func_end sub_808BD7C - thumb_func_start sub_808BD8C -sub_808BD8C: ; 808BD8C + thumb_func_start GetPlayerAvatarGraphicsIdByStateId +; u8 GetPlayerAvatarGraphicsIdByStateId(u8 stateId) +GetPlayerAvatarGraphicsIdByStateId: ; 808BD8C push {lr} lsls r0, 24 lsrs r0, 24 ldr r1, =0x02037590 ldrb r1, [r1, 0x7] - bl GetPlayerAvatarFieldObjectType + bl GetPlayerAvatarGraphicsIdByStateIdAndGender lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .pool - thumb_func_end sub_808BD8C + thumb_func_end GetPlayerAvatarGraphicsIdByStateId thumb_func_start sub_808BDA8 sub_808BDA8: ; 808BDA8 @@ -241955,8 +242030,9 @@ sub_808BDA8: ; 808BDA8 bx r1 thumb_func_end sub_808BDA8 - thumb_func_start sub_808BDD4 -sub_808BDD4: ; 808BDD4 + thumb_func_start GetPlayerAvatarGenderByGraphicsId +; u8 GetPlayerAvatarGenderByGraphicsId(u8 graphicsId) +GetPlayerAvatarGenderByGraphicsId: ; 808BDD4 push {lr} lsls r0, 24 lsrs r0, 24 @@ -241983,13 +242059,14 @@ sub_808BDD4: ; 808BDD4 @0808BDFC: pop {r1} bx r1 - thumb_func_end sub_808BDD4 + thumb_func_end GetPlayerAvatarGenderByGraphicsId - thumb_func_start party_has_pokemon_with_surf -party_has_pokemon_with_surf: ; 808BE00 + thumb_func_start PartyHasMonWithSurf +; BOOL PartyHasMonWithSurf() +PartyHasMonWithSurf: ; 808BE00 push {r4,r5,lr} movs r0, 0x8 - bl walkrun_bitfield_and_r0 + bl TestPlayerAvatarFlags lsls r0, 24 cmp r0, 0 bne @0808BE44 @@ -242028,18 +242105,19 @@ party_has_pokemon_with_surf: ; 808BE00 pop {r1} bx r1 .pool - thumb_func_end party_has_pokemon_with_surf + thumb_func_end PartyHasMonWithSurf - thumb_func_start sub_808BE50 -sub_808BE50: ; 808BE50 + thumb_func_start IsPlayerSurfingNorth +; BOOL IsPlayerSurfingNorth() +IsPlayerSurfingNorth: ; 808BE50 push {lr} - bl player_get_direction_upper_4bits + bl player_get_direction_upper_nybble lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 bne @0808BE6E movs r0, 0x8 - bl walkrun_bitfield_and_r0 + bl TestPlayerAvatarFlags lsls r0, 24 cmp r0, 0 beq @0808BE6E @@ -242050,10 +242128,11 @@ sub_808BE50: ; 808BE50 @0808BE70: pop {r1} bx r1 - thumb_func_end sub_808BE50 + thumb_func_end IsPlayerSurfingNorth - thumb_func_start sub_808BE74 -sub_808BE74: ; 808BE74 + thumb_func_start IsPlayerFacingSurfableFishableWater +; BOOL IsPlayerFacingSurfableFishableWater() +IsPlayerFacingSurfableFishableWater: ; 808BE74 push {r4,r5,lr} sub sp, 0x4 ldr r0, =0x02037590 @@ -242075,7 +242154,7 @@ sub_808BE74: ; 808BE74 lsrs r0, 28 mov r1, sp adds r2, r5, 0 - bl numbers_move_direction + bl MoveCoords mov r0, sp movs r2, 0 ldrsh r1, [r0, r2] @@ -242090,7 +242169,7 @@ sub_808BE74: ; 808BE74 lsrs r0, 24 cmp r0, 0x3 bne @0808BEF4 - bl player_get_height + bl PlayerGetZCoord lsls r0, 24 lsrs r0, 24 cmp r0, 0x3 @@ -242103,7 +242182,7 @@ sub_808BE74: ; 808BE74 bl cur_mapdata_block_get_role_at lsls r0, 24 lsrs r0, 24 - bl block_field_1_weird_index + bl MetatileBehavior_IsSurfableFishableWater lsls r0, 24 cmp r0, 0 beq @0808BEF4 @@ -242117,10 +242196,11 @@ sub_808BE74: ; 808BE74 pop {r4,r5} pop {r1} bx r1 - thumb_func_end sub_808BE74 + thumb_func_end IsPlayerFacingSurfableFishableWater - thumb_func_start walkrun_state_clear -walkrun_state_clear: ; 808BF00 + thumb_func_start ClearPlayerAvatarInfo +; void ClearPlayerAvatarInfo() +ClearPlayerAvatarInfo: ; 808BF00 push {lr} ldr r0, =0x02037590 movs r1, 0 @@ -242129,10 +242209,11 @@ walkrun_state_clear: ; 808BF00 pop {r0} bx r0 .pool - thumb_func_end walkrun_state_clear + thumb_func_end ClearPlayerAvatarInfo - thumb_func_start sub_808BF14 -sub_808BF14: ; 808BF14 + thumb_func_start SetPlayerAvatarStateMask +; void SetPlayerAvatarStateMask(u8 stateMask) +SetPlayerAvatarStateMask: ; 808BF14 lsls r0, 24 lsrs r0, 24 ldr r3, =0x02037590 @@ -242143,10 +242224,11 @@ sub_808BF14: ; 808BF14 strb r0, [r3] bx lr .pool - thumb_func_end sub_808BF14 + thumb_func_end SetPlayerAvatarStateMask - thumb_func_start sub_808BF2C -sub_808BF2C: ; 808BF2C + thumb_func_start GetPlayerAvatarStateTransitionByGraphicsId +; u8 GetPlayerAvatarStateTransitionByGraphicsId(u8 graphicsId, u8 gender) +GetPlayerAvatarStateTransitionByGraphicsId: ; 808BF2C push {r4-r6,lr} lsls r0, 24 lsrs r5, r0, 24 @@ -242180,10 +242262,11 @@ sub_808BF2C: ; 808BF2C pop {r4-r6} pop {r1} bx r1 - thumb_func_end sub_808BF2C + thumb_func_end GetPlayerAvatarStateTransitionByGraphicsId - thumb_func_start sub_808BF6C -sub_808BF6C: ; 808BF6C + thumb_func_start GetPlayerAvatarGraphicsIdByCurrentState +; u8 GetPlayerAvatarGraphicsIdByCurrentState() +GetPlayerAvatarGraphicsIdByCurrentState: ; 808BF6C push {r4-r6,lr} ldr r0, =0x02037590 ldrb r5, [r0] @@ -242217,10 +242300,11 @@ sub_808BF6C: ; 808BF6C pop {r4-r6} pop {r1} bx r1 - thumb_func_end sub_808BF6C + thumb_func_end GetPlayerAvatarGraphicsIdByCurrentState - thumb_func_start sub_808BFB0 -sub_808BFB0: ; 808BFB0 + thumb_func_start SetPlayerAvatarExtraStateTransition +; void SetPlayerAvatarExtraStateTransition(u8 graphicsId, u8 state) +SetPlayerAvatarExtraStateTransition: ; 808BFB0 push {r4,r5,lr} adds r4, r1, 0 lsls r0, 24 @@ -242229,23 +242313,23 @@ sub_808BFB0: ; 808BFB0 lsrs r4, 24 ldr r5, =0x02037590 ldrb r1, [r5, 0x7] - bl sub_808BF2C + bl GetPlayerAvatarStateTransitionByGraphicsId lsls r0, 24 lsrs r0, 24 orrs r0, r4 ldrb r1, [r5, 0x1] orrs r0, r1 strb r0, [r5, 0x1] - bl bike_related + bl DoPlayerAvatarTransition pop {r4,r5} pop {r0} bx r0 .pool - thumb_func_end sub_808BFB0 + thumb_func_end SetPlayerAvatarExtraStateTransition - thumb_func_start player_avatar_init -; void player_avatar_init(u16 a1, u16 a2, u8 a3, u8 gender) -player_avatar_init: ; 808BFE0 + thumb_func_start InitPlayerAvatar +; void InitPlayerAvatar(u16 x, u16 y, u8 direction, u8 gender) +InitPlayerAvatar: ; 808BFE0 push {r4-r6,lr} mov r6, r9 mov r5, r8 @@ -242272,7 +242356,7 @@ player_avatar_init: ; 808BFE0 strb r0, [r1] movs r0, 0 mov r1, r8 - bl GetPlayerAvatarFieldObjectType + bl GetPlayerAvatarGraphicsIdByStateIdAndGender mov r1, sp movs r3, 0 strb r0, [r1, 0x1] @@ -242300,7 +242384,7 @@ player_avatar_init: ; 808BFE0 strh r3, [r0, 0xE] str r3, [sp, 0x10] strh r3, [r0, 0x14] - bl player_avatar_instanciate_maybe + bl SpawnSpecialFieldObject adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 @@ -242317,8 +242401,8 @@ player_avatar_init: ; 808BFE0 strb r0, [r4, 0x1B] adds r0, r4, 0 mov r1, r9 - bl npc_turn - bl walkrun_state_clear + bl FieldObjectTurn + bl ClearPlayerAvatarInfo ldr r0, =0x02037590 strb r6, [r0, 0x2] strb r6, [r0, 0x3] @@ -242328,7 +242412,7 @@ player_avatar_init: ; 808BFE0 mov r1, r8 strb r1, [r0, 0x7] movs r0, 0x21 - bl sub_808BF14 + bl SetPlayerAvatarStateMask add sp, 0x18 pop {r3,r4} mov r8, r3 @@ -242337,7 +242421,7 @@ player_avatar_init: ; 808BFE0 pop {r0} bx r0 .pool - thumb_func_end player_avatar_init + thumb_func_end InitPlayerAvatar thumb_func_start sub_808C0A8 sub_808C0A8: ; 808C0A8 @@ -242361,7 +242445,7 @@ sub_808C0A8: ; 808C0A8 orrs r0, r3 strb r0, [r1, 0x1] movs r0, 0x8 - bl walkrun_bitfield_and_r0 + bl TestPlayerAvatarFlags lsls r0, 24 cmp r0, 0 beq @0808C100 @@ -242402,12 +242486,12 @@ sub_808C114: ; 808C114 ldr r0, =0x02037350 adds r4, r0 movs r0, 0x5 - bl sub_808BD8C + bl GetPlayerAvatarGraphicsIdByStateId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl set_field_object_graphics + bl FieldObjectSetGraphicsId ldrb r1, [r5, 0x4] lsls r0, r1, 4 adds r0, r1 @@ -242436,12 +242520,12 @@ sub_808C15C: ; 808C15C ldr r0, =0x02037350 adds r4, r0 movs r0, 0x6 - bl sub_808BD8C + bl GetPlayerAvatarGraphicsIdByStateId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl set_field_object_graphics + bl FieldObjectSetGraphicsId ldrb r0, [r6, 0x4] lsls r4, r0, 4 adds r4, r0 @@ -242477,12 +242561,12 @@ sub_808C1B4: ; 808C1B4 ldr r0, =0x02037350 adds r4, r0 movs r0, 0x2 - bl sub_808BD8C + bl GetPlayerAvatarGraphicsIdByStateId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl set_field_object_graphics + bl FieldObjectSetGraphicsId ldrb r0, [r6, 0x4] lsls r4, r0, 4 adds r4, r0 @@ -242526,12 +242610,12 @@ sub_808C228: ; 808C228 ldr r0, =0x02037350 adds r4, r0 movs r0, 0x7 - bl sub_808BD8C + bl GetPlayerAvatarGraphicsIdByStateId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl set_field_object_graphics + bl FieldObjectSetGraphicsId ldrb r0, [r6, 0x4] lsls r4, r0, 4 adds r4, r0 @@ -242539,7 +242623,7 @@ sub_808C228: ; 808C228 ldr r0, =0x02020630 adds r4, r0 adds r0, r5, 0 - bl npc_direction_to_obj_anim_image_number + bl FieldObjectDirectionToImageAnimId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -242592,7 +242676,7 @@ sub_808C280: ; 808C280 adds r0, r6, 0 mov r1, sp adds r2, r7, 0 - bl numbers_move_direction + bl MoveCoords ldrb r0, [r5, 0x1B] movs r1, 0 ldrsh r2, [r4, r1] @@ -242714,55 +242798,56 @@ sub_808C3A4: ; 808C3A4 thumb_func_end sub_808C3A4 thumb_func_start do_jump_landing_dust +; int do_jump_landing_dust(int a1, struct npc_state *a2, struct npc_state *a3) do_jump_landing_dust: ; 808C3C4 push {r4-r6,lr} adds r6, r0, 0 adds r5, r1, 0 adds r4, r2, 0 adds r0, r5, 0 - bl npc_is_state_set_and_valid + bl FieldObjectIsSpecialAnimActive lsls r0, 24 cmp r0, 0 beq @0808C3DE adds r0, r5, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished @0808C3DE: adds r0, r4, 0 - bl npc_is_state_set_and_valid + bl FieldObjectIsSpecialAnimActive lsls r0, 24 cmp r0, 0 beq @0808C3F0 adds r0, r4, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished @0808C3F0: adds r0, r5, 0 - bl npc_is_visible_or_is_x40 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive lsls r0, 24 cmp r0, 0 bne @0808C472 adds r0, r4, 0 - bl npc_is_visible_or_is_x40 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive lsls r0, 24 cmp r0, 0 bne @0808C472 adds r0, r5, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished adds r0, r4, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished ldrb r0, [r6, 0xC] - bl d2s_08064244 + bl GetStepInPlaceDelay16AnimId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r5, 0 - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim ldrb r0, [r6, 0xC] - bl d2s_walk + bl GetSimpleGoAnimId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim ldr r2, =0x02038c08 movs r1, 0x10 ldrsh r0, [r4, r1] @@ -242804,19 +242889,19 @@ sub_808C484: ; 808C484 adds r4, r1, 0 adds r5, r2, 0 adds r0, r4, 0 - bl npc_get_bit7_or_const_x10_when_inactive + bl FieldObjectCheckIfSpecialAnimFinishedOrInactive lsls r0, 24 cmp r0, 0 beq @0808C4C6 adds r0, r5, 0 - bl npc_get_bit7_or_const_x10_when_inactive + bl FieldObjectCheckIfSpecialAnimFinishedOrInactive lsls r0, 24 cmp r0, 0 beq @0808C4C6 adds r0, r4, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished adds r0, r5, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished ldr r1, =0x02037590 movs r0, 0 strb r0, [r1, 0x6] @@ -242894,7 +242979,7 @@ sub_808C544: ; 808C544 movs r0, 0x1 strb r0, [r5, 0x6] adds r0, r4, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished lsls r0, 24 cmp r0, 0 beq @0808C5A0 @@ -242908,7 +242993,7 @@ sub_808C544: ; 808C544 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim ldrh r0, [r6, 0xA] adds r0, 0x1 strh r0, [r6, 0xA] @@ -243018,7 +243103,7 @@ sub_808C644: ; 808C644 movs r2, 0x4 bl memcpy adds r0, r5, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished lsls r0, 24 cmp r0, 0 beq @0808C6AC @@ -243028,12 +243113,12 @@ sub_808C644: ; 808C644 add r0, sp ldrb r6, [r0] adds r0, r6, 0 - bl d2s_look1 + bl GetFaceDirectionAnimId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r5, 0 - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim ldrb r0, [r4, 0xA] cmp r6, r0 bne @0808C68A @@ -243049,7 +243134,7 @@ sub_808C644: ; 808C644 cmp r0, 0x3 ble @0808C6AC ldrb r0, [r4, 0xA] - bl direction_reversed + bl GetOppositeDirection lsls r0, 24 lsrs r0, 24 cmp r6, r0 @@ -243077,7 +243162,7 @@ sub_808C6BC: ; 808C6BC movs r2, 0x5 bl memcpy adds r0, r4, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished lsls r0, 24 cmp r0, 0 beq @0808C6EC @@ -243086,7 +243171,7 @@ sub_808C6BC: ; 808C6BC add r0, sp ldrb r1, [r0] adds r0, r4, 0 - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim movs r0, 0x1 strh r0, [r5, 0x8] @0808C6EC: @@ -243104,20 +243189,20 @@ sub_808C6FC: ; 808C6FC adds r4, r0, 0 adds r5, r1, 0 adds r0, r5, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished lsls r0, 24 cmp r0, 0 beq @0808C740 ldrb r0, [r4, 0xA] - bl direction_reversed + bl GetOppositeDirection lsls r0, 24 lsrs r0, 24 - bl d2s_walk + bl GetSimpleGoAnimId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r5, 0 - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim bl script_env_2_disable ldr r1, =0x02037590 movs r0, 0 @@ -243142,7 +243227,7 @@ sub_808C750: ; 808C750 lsls r4, 24 lsrs r4, 24 bl script_env_2_enable - bl sav1_reset_x2C + bl sav1_reset_battle_music_maybe bl sub_8085898 ldr r2, =0x02037590 ldrb r1, [r2] @@ -243185,12 +243270,12 @@ taskFF_0805D1D4: ; 808C7A8 ldr r1, =0x02037350 adds r5, r0, r1 adds r0, r5, 0 - bl npc_is_visible_or_is_x40 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive lsls r0, 24 cmp r0, 0 beq @0808C7D4 adds r0, r5, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished lsls r0, 24 cmp r0, 0 beq @0808C7FC @@ -243209,7 +243294,7 @@ taskFF_0805D1D4: ; 808C7A8 lsls r1, 24 lsrs r1, 24 adds r0, r5, 0 - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim ldr r0, =sub_808C814 str r0, [r4] @0808C7FC: @@ -243232,26 +243317,26 @@ sub_808C814: ; 808C814 ldr r1, =0x02037350 adds r4, r0, r1 adds r0, r4, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished lsls r0, 24 cmp r0, 0 beq @0808C87A movs r0, 0 - bl sub_808BD8C + bl GetPlayerAvatarGraphicsIdByStateId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl set_field_object_graphics + bl FieldObjectSetGraphicsId ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 - bl d2s_look1 + bl GetFaceDirectionAnimId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim movs r0, 0 strb r0, [r6, 0x6] bl script_env_2_disable @@ -243271,13 +243356,13 @@ sub_808C814: ; 808C814 .pool thumb_func_end sub_808C814 - thumb_func_start fishing_start -fishing_start: ; 808C88C + thumb_func_start StartFishing +StartFishing: ; 808C88C push {r4,r5,lr} adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - ldr r5, =sub_808C8C0 + ldr r5, =Task_Fish adds r0, r5, 0 movs r1, 0xFF bl AddTask @@ -243294,10 +243379,10 @@ fishing_start: ; 808C88C pop {r0} bx r0 .pool - thumb_func_end fishing_start + thumb_func_end StartFishing - thumb_func_start sub_808C8C0 -sub_808C8C0: ; 808C8C0 + thumb_func_start Task_Fish +Task_Fish: ; 808C8C0 push {r4,r5,lr} lsls r0, 24 lsrs r0, 24 @@ -243322,10 +243407,10 @@ sub_808C8C0: ; 808C8C0 pop {r0} bx r0 .pool - thumb_func_end sub_808C8C0 + thumb_func_end Task_Fish - thumb_func_start sub_808C8F8 -sub_808C8F8: ; 808C8F8 + thumb_func_start fish0 +fish0: ; 808C8F8 push {r4,lr} adds r4, r0, 0 bl script_env_2_enable @@ -243340,7 +243425,7 @@ sub_808C8F8: ; 808C8F8 pop {r1} bx r1 .pool - thumb_func_end sub_808C8F8 + thumb_func_end fish0 thumb_func_start fish1 fish1: ; 808C918 @@ -243388,7 +243473,7 @@ fish1: ; 808C918 lsls r4, 2 adds r4, r3 adds r0, r4, 0 - bl npc_hide_and_trainer_flag_clear_on_tile_x66_at_pos + bl FieldObjectClearAnimIfSpecialAnimActive ldrb r0, [r4, 0x1] movs r1, 0x8 orrs r0, r1 @@ -243430,8 +243515,8 @@ fish2: ; 808C9B0 bx r1 thumb_func_end fish2 - thumb_func_start sub_808C9D4 -sub_808C9D4: ; 808C9D4 + thumb_func_start fish3 +fish3: ; 808C9D4 push {r4,lr} adds r4, r0, 0 movs r0, 0 @@ -243469,10 +243554,10 @@ sub_808C9D4: ; 808C9D4 pop {r4} pop {r1} bx r1 - thumb_func_end sub_808C9D4 + thumb_func_end fish3 - thumb_func_start sub_808CA20 -sub_808CA20: ; 808CA20 + thumb_func_start fish4 +fish4: ; 808CA20 push {r4,r5,lr} sub sp, 0x10 adds r4, r0, 0 @@ -243551,10 +243636,10 @@ sub_808CA20: ; 808CA20 pop {r4,r5} pop {r1} bx r1 - thumb_func_end sub_808CA20 + thumb_func_end fish4 - thumb_func_start sub_808CABC -sub_808CABC: ; 808CABC + thumb_func_start fish5 +fish5: ; 808CABC push {r4-r6,lr} adds r5, r0, 0 bl sub_808CF78 @@ -243619,7 +243704,7 @@ sub_808CABC: ; 808CABC lsls r4, 2 ldr r0, =0x02020630 adds r4, r0 - bl player_get_direction__sp1AA + bl player_get_direction_lower_nybble lsls r0, 24 lsrs r0, 24 bl sub_8092A2C @@ -243634,10 +243719,10 @@ sub_808CABC: ; 808CABC pop {r1} bx r1 .pool - thumb_func_end sub_808CABC + thumb_func_end fish5 - thumb_func_start sub_808CB6C -sub_808CB6C: ; 808CB6C + thumb_func_start fish6 +fish6: ; 808CB6C push {r4,r5,lr} sub sp, 0xC adds r5, r0, 0 @@ -243662,7 +243747,7 @@ sub_808CB6C: ; 808CB6C pop {r1} bx r1 .pool - thumb_func_end sub_808CB6C + thumb_func_end fish6 thumb_func_start fish7 fish7: ; 808CBA4 @@ -243763,8 +243848,8 @@ fish8: ; 808CBFC .pool thumb_func_end fish8 - thumb_func_start sub_808CC64 -sub_808CC64: ; 808CC64 + thumb_func_start fish9 +fish9: ; 808CC64 push {r4,r5,lr} sub sp, 0x10 adds r4, r0, 0 @@ -243795,7 +243880,7 @@ sub_808CC64: ; 808CC64 pop {r1} bx r1 .pool - thumb_func_end sub_808CC64 + thumb_func_end fish9 thumb_func_start fishA_wait_for_a_pressed fishA_wait_for_a_pressed: ; 808CCA8 @@ -243832,11 +243917,11 @@ fishA_wait_for_a_pressed: ; 808CCA8 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl set_field_object_graphics + bl FieldObjectSetGraphicsId ldrb r1, [r4, 0x18] lsrs r1, 4 adds r0, r4, 0 - bl npc_turn + bl FieldObjectTurn ldrb r1, [r7] movs r0, 0x8 ands r0, r1 @@ -243889,7 +243974,7 @@ fishA_wait_for_a_pressed: ; 808CCA8 bl sub_80B5734 movs r0, 0x1 bl sub_80ED950 - ldr r0, =sub_808C8C0 + ldr r0, =Task_Fish bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 @@ -243904,8 +243989,8 @@ fishA_wait_for_a_pressed: ; 808CCA8 .pool thumb_func_end fishA_wait_for_a_pressed - thumb_func_start sub_808CD94 -sub_808CD94: ; 808CD94 + thumb_func_start fishB +fishB: ; 808CD94 push {r4,r5,lr} sub sp, 0x10 adds r5, r0, 0 @@ -243917,7 +244002,7 @@ sub_808CD94: ; 808CD94 lsls r4, 2 ldr r0, =0x02020630 adds r4, r0 - bl player_get_direction__sp1AA + bl player_get_direction_lower_nybble lsls r0, 24 lsrs r0, 24 bl sub_8092A1C @@ -243950,10 +244035,10 @@ sub_808CD94: ; 808CD94 pop {r1} bx r1 .pool - thumb_func_end sub_808CD94 + thumb_func_end fishB - thumb_func_start sub_808CE04 -sub_808CE04: ; 808CE04 + thumb_func_start fishC +fishC: ; 808CE04 push {r4,r5,lr} sub sp, 0x10 adds r5, r0, 0 @@ -243965,7 +244050,7 @@ sub_808CE04: ; 808CE04 lsls r4, 2 ldr r0, =0x02020630 adds r4, r0 - bl player_get_direction__sp1AA + bl player_get_direction_lower_nybble lsls r0, 24 lsrs r0, 24 bl sub_8092A1C @@ -243999,10 +244084,10 @@ sub_808CE04: ; 808CE04 pop {r1} bx r1 .pool - thumb_func_end sub_808CE04 + thumb_func_end fishC - thumb_func_start sub_808CE74 -sub_808CE74: ; 808CE74 + thumb_func_start fishD +fishD: ; 808CE74 push {r4,lr} adds r4, r0, 0 bl sub_808CF78 @@ -244013,10 +244098,10 @@ sub_808CE74: ; 808CE74 pop {r4} pop {r1} bx r1 - thumb_func_end sub_808CE74 + thumb_func_end fishD - thumb_func_start sub_808CE8C -sub_808CE8C: ; 808CE8C + thumb_func_start fishE +fishE: ; 808CE8C push {r4-r7,lr} mov r7, r8 push {r7} @@ -244045,11 +244130,11 @@ sub_808CE8C: ; 808CE8C lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl set_field_object_graphics + bl FieldObjectSetGraphicsId ldrb r1, [r4, 0x18] lsrs r1, 4 adds r0, r4, 0 - bl npc_turn + bl FieldObjectTurn ldrb r1, [r5] movs r0, 0x8 ands r0, r1 @@ -244089,7 +244174,7 @@ sub_808CE8C: ; 808CE8C pop {r1} bx r1 .pool - thumb_func_end sub_808CE8C + thumb_func_end fishE thumb_func_start fishF fishF: ; 808CF2C @@ -244110,7 +244195,7 @@ fishF: ; 808CF2C bl sub_8197434 movs r0, 0 bl sub_80ED950 - ldr r0, =sub_808C8C0 + ldr r0, =Task_Fish bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 @@ -244202,7 +244287,7 @@ sub_808CF78: ; 808CF78 bhi @0808D022 movs r0, 0x8 strh r0, [r4, 0x24] - bl player_get_direction__sp1AA + bl player_get_direction_lower_nybble lsls r0, 24 lsrs r0, 24 cmp r0, 0x3 @@ -244312,7 +244397,7 @@ sub_808D094: ; 808D094 b @0808D18A @0808D0EE: adds r0, r4, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished lsls r0, 24 cmp r0, 0 beq @0808D18A @@ -244331,7 +244416,7 @@ sub_808D094: ; 808D094 lsls r0, 4 strh r0, [r5, 0x6] strh r6, [r7, 0x26] - bl sub_808EEDC + bl CameraObjectReset2 ldrb r0, [r4, 0x3] movs r1, 0x4 orrs r0, r1 @@ -244503,12 +244588,12 @@ sub_808D1FC: ; 808D1FC ldrsh r0, [r5, r3] adds r0, r1 ldrb r0, [r0] - bl d2s_look1 + bl GetFaceDirectionAnimId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl sub_8093208 + bl FieldObjectForceSetSpecialAnim movs r0, 0 mov r9, r0 strh r6, [r5, 0x2] @@ -244531,7 +244616,7 @@ sub_808D1FC: ; 808D1FC lsls r0, 4 strh r0, [r5, 0x6] strh r6, [r7, 0x26] - bl sub_808EEDC + bl CameraObjectReset2 ldrb r0, [r4, 0x3] movs r2, 0x4 orrs r0, r2 @@ -244630,7 +244715,7 @@ sub_808D1FC: ; 808D1FC adds r0, r7, 0 adds r0, 0x43 strb r1, [r0] - bl sub_808EE8C + bl CameraObjectReset1 mov r0, r8 bl remove_task @0808D37E: @@ -244660,7 +244745,7 @@ sub_808D38C: ; 808D38C ble @0808D3E4 @0808D3A8: adds r0, r5, 0 - bl npc_get_bit7_or_const_x10_when_inactive + bl FieldObjectCheckIfSpecialAnimFinishedOrInactive lsls r0, 24 cmp r0, 0 beq @0808D3E4 @@ -244670,12 +244755,12 @@ sub_808D38C: ; 808D38C lsrs r0, 28 adds r0, r4 ldrb r0, [r0] - bl d2s_look1 + bl GetFaceDirectionAnimId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r5, 0 - bl sub_8093208 + bl FieldObjectForceSetSpecialAnim movs r0, 0 strh r0, [r6] ldrb r0, [r5, 0x18] @@ -244741,7 +244826,7 @@ sub_808D438: ; 808D438 push {lr} bl strange_npc_table_clear bl npcs_clear_ids_and_state - bl walkrun_state_clear + bl ClearPlayerAvatarInfo bl sub_808D450 pop {r0} bx r0 @@ -244853,8 +244938,9 @@ sub_808D4F4: ; 808D4F4 bx r1 thumb_func_end sub_808D4F4 - thumb_func_start get_npc_id_by_local_id -get_npc_id_by_local_id: ; 808D524 + thumb_func_start GetFieldObjectIdByLocalIdAndMap +; u8 GetFieldObjectIdByLocalIdAndMap(u8 localId, u8 mapId, u8 mapGroupId) +GetFieldObjectIdByLocalIdAndMap: ; 808D524 push {lr} lsls r0, 24 lsrs r0, 24 @@ -244864,19 +244950,20 @@ get_npc_id_by_local_id: ; 808D524 lsrs r2, 24 cmp r0, 0xFE bls @0808D53C - bl npc_id_by_local_id_ignore_map + bl GetFieldObjectIdByLocalId b @0808D540 @0808D53C: - bl npc_id_by_local_id_and_map + bl GetFieldObjectIdByLocalIdAndMapInternal @0808D540: lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 - thumb_func_end get_npc_id_by_local_id + thumb_func_end GetFieldObjectIdByLocalIdAndMap - thumb_func_start npc_id_by_local_id_and_map_ret_success -npc_id_by_local_id_and_map_ret_success: ; 808D548 + thumb_func_start TryGetFieldObjectIdByLocalIdAndMap +; BOOL TryGetFieldObjectIdByLocalIdAndMap(u8 localId, u8 mapId, u8 mapGroupId, u8 *fieldObjectId) +TryGetFieldObjectIdByLocalIdAndMap: ; 808D548 push {r4,lr} adds r4, r3, 0 lsls r0, 24 @@ -244885,7 +244972,7 @@ npc_id_by_local_id_and_map_ret_success: ; 808D548 lsrs r1, 24 lsls r2, 24 lsrs r2, 24 - bl get_npc_id_by_local_id + bl GetFieldObjectIdByLocalIdAndMap strb r0, [r4] lsls r0, 24 lsrs r0, 24 @@ -244899,10 +244986,11 @@ npc_id_by_local_id_and_map_ret_success: ; 808D548 pop {r4} pop {r1} bx r1 - thumb_func_end npc_id_by_local_id_and_map_ret_success + thumb_func_end TryGetFieldObjectIdByLocalIdAndMap - thumb_func_start npc_id_by_pos -npc_id_by_pos: ; 808D574 + thumb_func_start GetFieldObjectIdByXY +; u8 GetFieldObjectIdByXY(s16 x, s16 y) +GetFieldObjectIdByXY: ; 808D574 push {r4-r6,lr} movs r3, 0 ldr r5, =0x02037350 @@ -244939,10 +245027,11 @@ npc_id_by_pos: ; 808D574 pop {r1} bx r1 .pool - thumb_func_end npc_id_by_pos + thumb_func_end GetFieldObjectIdByXY - thumb_func_start npc_id_by_local_id_and_map -npc_id_by_local_id_and_map: ; 808D5B8 + thumb_func_start GetFieldObjectIdByLocalIdAndMapInternal +; u8 GetFieldObjectIdByLocalIdAndMapInternal(u8 localId, u8 mapId, u8 mapGroupId) +GetFieldObjectIdByLocalIdAndMapInternal: ; 808D5B8 push {r4-r6,lr} lsls r0, 24 lsrs r5, r0, 24 @@ -244984,10 +245073,11 @@ npc_id_by_local_id_and_map: ; 808D5B8 pop {r4-r6} pop {r1} bx r1 - thumb_func_end npc_id_by_local_id_and_map + thumb_func_end GetFieldObjectIdByLocalIdAndMapInternal - thumb_func_start npc_id_by_local_id_ignore_map -npc_id_by_local_id_ignore_map: ; 808D608 + thumb_func_start GetFieldObjectIdByLocalId +; u8 GetFieldObjectIdByLocalId(u8 localId) +GetFieldObjectIdByLocalId: ; 808D608 push {r4,lr} lsls r0, 24 lsrs r3, r0, 24 @@ -245019,11 +245109,11 @@ npc_id_by_local_id_ignore_map: ; 808D608 pop {r4} pop {r1} bx r1 - thumb_func_end npc_id_by_local_id_ignore_map + thumb_func_end GetFieldObjectIdByLocalId - thumb_func_start npc_set_data -; u8 npc_set_data(struct rom_npc *romNpc, u8 mapId, u8 mapGroupId) -npc_set_data: ; 808D644 + thumb_func_start InitFieldObjectStateFromTemplate +; u8 InitFieldObjectStateFromTemplate(struct FieldObjectTemplate *fieldObjectTemplate, u8 mapId, u8 mapGroupId) +InitFieldObjectStateFromTemplate: ; 808D644 push {r4-r7,lr} mov r7, r9 mov r6, r8 @@ -245038,7 +245128,7 @@ npc_set_data: ; 808D644 adds r1, r6, 0 adds r2, r7, 0 mov r3, sp - bl FindMapObjectIndexByLocalId + bl GetAvailableFieldObjectSlot lsls r0, 24 cmp r0, 0 beq @0808D66E @@ -245127,9 +245217,9 @@ npc_set_data: ; 808D644 strb r1, [r0] ldrb r1, [r0] adds r0, r4, 0 - bl npc_set_direction + bl FieldObjectSetDirection adds r0, r4, 0 - bl sub_808E6DC + bl FieldObjectHandleDynamicGraphicsId ldr r1, =gUnknown_0850557C ldrb r0, [r4, 0x6] adds r0, r1 @@ -245175,7 +245265,7 @@ npc_set_data: ; 808D644 pop {r1} bx r1 .pool - thumb_func_end npc_set_data + thumb_func_end InitFieldObjectStateFromTemplate thumb_func_start sub_808D77C sub_808D77C: ; 808D77C @@ -245209,7 +245299,7 @@ sub_808D77C: ; 808D77C ldrb r1, [r0, 0x5] ldrb r2, [r0, 0x4] adds r0, r4, 0 - bl npc_set_data + bl InitFieldObjectStateFromTemplate lsls r0, 24 lsrs r0, 24 b @0808D800 @@ -245255,9 +245345,9 @@ sub_808D77C: ; 808D77C .pool thumb_func_end sub_808D77C - thumb_func_start FindMapObjectIndexByLocalId -; _BOOL1 FindMapObjectIndexByLocalId(u16 localId, u8 mapId, u8 mapGroupId, u8 *mapObjectIndex) -FindMapObjectIndexByLocalId: ; 808D810 + thumb_func_start GetAvailableFieldObjectSlot +; BOOL GetAvailableFieldObjectSlot(u16 localId, u8 mapId, u8 mapGroupId, u8 *fieldObjectId) +GetAvailableFieldObjectSlot: ; 808D810 push {r4-r7,lr} mov r12, r3 lsls r0, 16 @@ -245343,23 +245433,25 @@ FindMapObjectIndexByLocalId: ; 808D810 pop {r1} bx r1 .pool - thumb_func_end FindMapObjectIndexByLocalId + thumb_func_end GetAvailableFieldObjectSlot - thumb_func_start npc_hide -npc_hide: ; 808D8B0 + thumb_func_start RemoveFieldObject +; void RemoveFieldObject(npc_state *fieldObject) +RemoveFieldObject: ; 808D8B0 push {lr} ldrb r2, [r0] movs r1, 0x2 negs r1, r1 ands r1, r2 strb r1, [r0] - bl npc_delete_obj_and_free_tiles_for_npc_type + bl RemoveFieldObjectInternal pop {r0} bx r0 - thumb_func_end npc_hide + thumb_func_end RemoveFieldObject - thumb_func_start npc_hide_by_local_id_and_map -npc_hide_by_local_id_and_map: ; 808D8C4 + thumb_func_start RemoveFieldObjectByLocalIdAndMap +; void RemoveFieldObjectByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapBank) +RemoveFieldObjectByLocalIdAndMap: ; 808D8C4 push {lr} sub sp, 0x4 lsls r0, 24 @@ -245369,13 +245461,13 @@ npc_hide_by_local_id_and_map: ; 808D8C4 lsls r2, 24 lsrs r2, 24 mov r3, sp - bl npc_id_by_local_id_and_map_ret_success + bl TryGetFieldObjectIdByLocalIdAndMap lsls r0, 24 cmp r0, 0 bne @0808D902 mov r0, sp ldrb r0, [r0] - bl rom_npc_id_in_script_by_npc_id + bl GetFieldObjectFlagIdByFieldObjectId lsls r0, 16 lsrs r0, 16 bl FlagSet @@ -245386,16 +245478,17 @@ npc_hide_by_local_id_and_map: ; 808D8C4 lsls r0, 2 ldr r1, =0x02037350 adds r0, r1 - bl npc_hide + bl RemoveFieldObject @0808D902: add sp, 0x4 pop {r0} bx r0 .pool - thumb_func_end npc_hide_by_local_id_and_map + thumb_func_end RemoveFieldObjectByLocalIdAndMap - thumb_func_start npc_delete_obj_and_free_tiles_for_npc_type -npc_delete_obj_and_free_tiles_for_npc_type: ; 808D90C + thumb_func_start RemoveFieldObjectInternal +; void RemoveFieldObjectInternal(npc_state *fieldObject) +RemoveFieldObjectInternal: ; 808D90C push {r4,lr} sub sp, 0x8 adds r4, r0, 0 @@ -245428,10 +245521,10 @@ npc_delete_obj_and_free_tiles_for_npc_type: ; 808D90C pop {r0} bx r0 .pool - thumb_func_end npc_delete_obj_and_free_tiles_for_npc_type + thumb_func_end RemoveFieldObjectInternal - thumb_func_start npc_hide_all_but_player -npc_hide_all_but_player: ; 808D958 + thumb_func_start sub_808D958 +sub_808D958: ; 808D958 push {r4,lr} movs r4, 0 @0808D95C: @@ -245444,7 +245537,7 @@ npc_hide_all_but_player: ; 808D958 lsls r0, 2 ldr r1, =0x02037350 adds r0, r1 - bl npc_hide + bl RemoveFieldObject @0808D972: adds r0, r4, 0x1 lsls r0, 24 @@ -245455,11 +245548,11 @@ npc_hide_all_but_player: ; 808D958 pop {r0} bx r0 .pool - thumb_func_end npc_hide_all_but_player + thumb_func_end sub_808D958 - thumb_func_start npc_spawn_with_provided_template -; signed int npc_spawn_with_provided_template(struct rom_npc *romNpc, struct objtemplate *objTemplate, int mapId, int mapGroupId, s16 a5, s16 a6) -npc_spawn_with_provided_template: ; 808D98C + thumb_func_start SpawnFieldObjectInternal +; u8 SpawnFieldObjectInternal(struct FieldObjectTemplate *romFieldObject, struct objtemplate *template, int mapId, int mapGroupId, u16 movingCameraOffsetX, u16 movingCameraOffsetY) +SpawnFieldObjectInternal: ; 808D98C push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -245481,7 +245574,7 @@ npc_spawn_with_provided_template: ; 808D98C lsls r4, 16 lsrs r4, 16 str r4, [sp] - bl npc_set_data + bl InitFieldObjectStateFromTemplate lsls r0, 24 lsrs r0, 24 mov r9, r0 @@ -245643,7 +245736,7 @@ npc_spawn_with_provided_template: ; 808D98C ldrb r0, [r6, 0x18] lsls r0, 28 lsrs r0, 28 - bl npc_direction_to_obj_anim_image_number + bl FieldObjectDirectionToImageAnimId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -245654,7 +245747,7 @@ npc_spawn_with_provided_template: ; 808D98C lsrs r0, 4 adds r1, r4, 0 movs r2, 0x1 - bl npc_y_height_related + bl SetObjectSubpriorityByZCoord adds r0, r6, 0 adds r1, r4, 0 bl sub_8096518 @@ -245669,11 +245762,11 @@ npc_spawn_with_provided_template: ; 808D98C pop {r1} bx r1 .pool - thumb_func_end npc_spawn_with_provided_template + thumb_func_end SpawnFieldObjectInternal - thumb_func_start npc_instanciation_something -; signed int npc_instanciation_something(struct rom_npc *romNpc, u8 mapId, u8 mapGroupId) -npc_instanciation_something: ; 808DB40 + thumb_func_start SpawnFieldObject +; u8 SpawnFieldObject(struct FieldObjectTemplate *romNpc, u8 mapId, u8 mapGroupId, u16 movingCameraOffsetX, u16 movingCameraOffsetY) +SpawnFieldObject: ; 808DB40 push {r4-r7,lr} mov r7, r9 mov r6, r8 @@ -245703,7 +245796,7 @@ npc_instanciation_something: ; 808DB40 add r2, sp, 0x20 mov r0, r9 add r1, sp, 0x8 - bl rom_npc_to_template + bl MakeObjectTemplateFromFieldObjectTemplate ldrh r3, [r7, 0x6] ldr r2, =0xffff0000 add r1, sp, 0x24 @@ -245722,7 +245815,7 @@ npc_instanciation_something: ; 808DB40 add r1, sp, 0x8 adds r2, r6, 0 mov r3, r8 - bl npc_spawn_with_provided_template + bl SpawnFieldObjectInternal lsls r0, 24 lsrs r2, r0, 24 adds r5, r2, 0 @@ -245768,10 +245861,11 @@ npc_instanciation_something: ; 808DB40 pop {r1} bx r1 .pool - thumb_func_end npc_instanciation_something + thumb_func_end SpawnFieldObject - thumb_func_start player_avatar_instanciate_maybe -player_avatar_instanciate_maybe: ; 808DC08 + thumb_func_start SpawnSpecialFieldObject +; u8 SpawnSpecialFieldObject(struct FieldObjectTemplate *romFieldObject) +SpawnSpecialFieldObject: ; 808DC08 push {r4-r6,lr} sub sp, 0x8 adds r5, r0, 0 @@ -245779,7 +245873,7 @@ player_avatar_instanciate_maybe: ; 808DC08 adds r4, 0x6 add r0, sp, 0x4 adds r1, r4, 0 - bl sub_809312C + bl GetFieldObjectMovingCameraOffset ldr r0, =0x03005d8c ldr r0, [r0] ldrb r1, [r0, 0x5] @@ -245791,7 +245885,7 @@ player_avatar_instanciate_maybe: ; 808DC08 ldrsh r0, [r4, r6] str r0, [sp] adds r0, r5, 0 - bl npc_instanciation_something + bl SpawnFieldObject lsls r0, 24 lsrs r0, 24 add sp, 0x8 @@ -245799,10 +245893,11 @@ player_avatar_instanciate_maybe: ; 808DC08 pop {r1} bx r1 .pool - thumb_func_end player_avatar_instanciate_maybe + thumb_func_end SpawnSpecialFieldObject - thumb_func_start sub_808DC44 -sub_808DC44: ; 808DC44 + thumb_func_start SpawnSpecialFieldObjectParametrized +; u8 SpawnSpecialFieldObjectParametrized(u8 graphicsId, u8 movementBehavior, u8 localId, u16 x, u16 y, u8 z) +SpawnSpecialFieldObjectParametrized: ; 808DC44 push {r4-r6,lr} mov r6, r8 push {r6} @@ -245842,7 +245937,7 @@ sub_808DC44: ; 808DC44 strb r5, [r0, 0xA] strh r6, [r0, 0xC] strh r6, [r0, 0xE] - bl player_avatar_instanciate_maybe + bl SpawnSpecialFieldObject lsls r0, 24 lsrs r0, 24 add sp, 0x18 @@ -245852,7 +245947,7 @@ sub_808DC44: ; 808DC44 pop {r1} bx r1 .pool - thumb_func_end sub_808DC44 + thumb_func_end SpawnSpecialFieldObjectParametrized thumb_func_start show_sprite show_sprite: ; 808DCAC @@ -245866,7 +245961,7 @@ show_sprite: ; 808DCAC lsrs r6, r2, 24 adds r1, r7, 0 adds r2, r6, 0 - bl rom_npc_by_local_id_and_map + bl GetFieldObjectTemplateByLocalIdAndMap adds r5, r0, 0 cmp r5, 0 beq @0808DCF2 @@ -245874,7 +245969,7 @@ show_sprite: ; 808DCAC adds r4, 0x6 add r0, sp, 0x4 adds r1, r4, 0 - bl sub_809312C + bl GetFieldObjectMovingCameraOffset add r0, sp, 0x4 movs r1, 0 ldrsh r3, [r0, r1] @@ -245884,7 +245979,7 @@ show_sprite: ; 808DCAC adds r0, r5, 0 adds r1, r7, 0 adds r2, r6, 0 - bl npc_instanciation_something + bl SpawnFieldObject lsls r0, 24 lsrs r0, 24 b @0808DCF4 @@ -245897,9 +245992,9 @@ show_sprite: ; 808DCAC bx r1 thumb_func_end show_sprite - thumb_func_start sub_808DCFC -; void sub_808DCFC(u8 a1, int func, struct objtemplate *a3, int a4) -sub_808DCFC: ; 808DCFC + thumb_func_start MakeObjectTemplateFromFieldObjectGraphicsInfo +; void MakeObjectTemplateFromFieldObjectGraphicsInfo(u8 graphicsId, void ( *callback)(), struct objtemplate *objectTemplate, SpriteOamTable **spriteOamTables) +MakeObjectTemplateFromFieldObjectGraphicsInfo: ; 808DCFC push {r4-r6,lr} adds r5, r1, 0 adds r4, r2, 0 @@ -245925,11 +246020,11 @@ sub_808DCFC: ; 808DCFC pop {r4-r6} pop {r0} bx r0 - thumb_func_end sub_808DCFC + thumb_func_end MakeObjectTemplateFromFieldObjectGraphicsInfo - thumb_func_start npc_to_objtemplate__with_indexed_objfunc -; void npc_to_objtemplate__with_indexed_objfunc(u16 graphicsId, u16 functionIndex, struct objtemplate *a3, int a4) -npc_to_objtemplate__with_indexed_objfunc: ; 808DD30 + thumb_func_start MakeObjectTemplateFromFieldObjectGraphicsInfoWithCallbackIndex +; void MakeObjectTemplateFromFieldObjectGraphicsInfoWithCallbackIndex(u16 graphicsId, u16 callbackIndex, struct objtemplate *objectTemplate, SpriteOamTable **spriteOamTables) +MakeObjectTemplateFromFieldObjectGraphicsInfoWithCallbackIndex: ; 808DD30 push {r4,lr} lsls r0, 16 lsrs r0, 16 @@ -245938,16 +246033,16 @@ npc_to_objtemplate__with_indexed_objfunc: ; 808DD30 lsrs r1, 14 adds r1, r4 ldr r1, [r1] - bl sub_808DCFC + bl MakeObjectTemplateFromFieldObjectGraphicsInfo pop {r4} pop {r0} bx r0 .pool - thumb_func_end npc_to_objtemplate__with_indexed_objfunc + thumb_func_end MakeObjectTemplateFromFieldObjectGraphicsInfoWithCallbackIndex - thumb_func_start rom_npc_to_template -; void rom_npc_to_template(struct rom_npc *romNpc, struct objtemplate *objTemplate, int a3) -rom_npc_to_template: ; 808DD50 + thumb_func_start MakeObjectTemplateFromFieldObjectTemplate +; void MakeObjectTemplateFromFieldObjectTemplate(struct FieldObjectTemplate *fieldObjectTemplate, struct objtemplate *objectTemplate, SpriteOamTable **spriteOamTables) +MakeObjectTemplateFromFieldObjectTemplate: ; 808DD50 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 @@ -245955,11 +246050,11 @@ rom_npc_to_template: ; 808DD50 ldrb r0, [r4, 0x1] ldrb r1, [r4, 0x9] adds r2, r5, 0 - bl npc_to_objtemplate__with_indexed_objfunc + bl MakeObjectTemplateFromFieldObjectGraphicsInfoWithCallbackIndex pop {r4,r5} pop {r0} bx r0 - thumb_func_end rom_npc_to_template + thumb_func_end MakeObjectTemplateFromFieldObjectTemplate thumb_func_start sub_808DD68 sub_808DD68: ; 808DD68 @@ -245988,7 +246083,7 @@ sub_808DD68: ; 808DD68 adds r1, r5, 0 adds r2, r6, 0 mov r3, sp - bl sub_808DCFC + bl MakeObjectTemplateFromFieldObjectGraphicsInfo ldrh r1, [r6, 0x2] ldr r0, =0x0000ffff cmp r1, r0 @@ -246073,7 +246168,7 @@ sprite_new: ; 808DE0C add r3, sp, 0x1C adds r0, r5, 0 mov r2, sp - bl sub_808DCFC + bl MakeObjectTemplateFromFieldObjectGraphicsInfo mov r1, sp ldr r2, =0x0000ffff adds r0, r2, 0 @@ -246193,13 +246288,13 @@ sprite_new: ; 808DE0C @0808DF48: adds r0, r5, 0 adds r1, r7, 0 - bl sub_8096D5C + bl InitObjectPriorityByZCoord adds r0, r7, 0 adds r1, r5, 0 movs r2, 0x1 - bl npc_y_height_related + bl SetObjectSubpriorityByZCoord mov r0, r10 - bl npc_direction_to_obj_anim_image_number + bl FieldObjectDirectionToImageAnimId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -246217,8 +246312,9 @@ sprite_new: ; 808DE0C bx r1 thumb_func_end sprite_new - thumb_func_start npc_culling_maybe -npc_culling_maybe: ; 808DF80 + thumb_func_start SpawnFieldObjectsInView +; void SpawnFieldObjectsInView(u16 movingCameraOffsetX, u16 movingCameraOffsetY) +SpawnFieldObjectsInView: ; 808DF80 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -246332,7 +246428,7 @@ npc_culling_maybe: ; 808DF80 str r0, [sp] adds r0, r4, 0 asrs r3, 16 - bl npc_instanciation_something + bl SpawnFieldObject @0808E06E: adds r0, r5, 0x1 lsls r0, 24 @@ -246349,10 +246445,11 @@ npc_culling_maybe: ; 808DF80 pop {r0} bx r0 .pool - thumb_func_end npc_culling_maybe + thumb_func_end SpawnFieldObjectsInView - thumb_func_start sub_808E08C -sub_808E08C: ; 808E08C + thumb_func_start RemoveFieldObjectsOutsideView +; void RemoveFieldObjectsOutsideView() +RemoveFieldObjectsOutsideView: ; 808E08C push {r4-r6,lr} movs r3, 0 ldr r6, =0x02032308 @@ -246389,7 +246486,7 @@ sub_808E08C: ; 808E08C cmp r0, 0x1 bne @0808E0D2 adds r0, r2, 0 - bl sub_808E0EC + bl RemoveFieldObjectIfOutsideView @0808E0D2: lsls r0, r5, 24 lsrs r3, r0, 24 @@ -246399,10 +246496,11 @@ sub_808E08C: ; 808E08C pop {r0} bx r0 .pool - thumb_func_end sub_808E08C + thumb_func_end RemoveFieldObjectsOutsideView - thumb_func_start sub_808E0EC -sub_808E0EC: ; 808E0EC + thumb_func_start RemoveFieldObjectIfOutsideView +; void RemoveFieldObjectIfOutsideView(npc_state *fieldObject) +RemoveFieldObjectIfOutsideView: ; 808E0EC push {r4-r7,lr} adds r3, r0, 0 ldr r0, =0x03005d8c @@ -246461,13 +246559,13 @@ sub_808E0EC: ; 808E0EC ble @0808E160 @0808E15A: adds r0, r3, 0 - bl npc_hide + bl RemoveFieldObject @0808E160: pop {r4-r7} pop {r0} bx r0 .pool - thumb_func_end sub_808E0EC + thumb_func_end RemoveFieldObjectIfOutsideView thumb_func_start sub_808E16C sub_808E16C: ; 808E16C @@ -246478,7 +246576,7 @@ sub_808E16C: ; 808E16C lsrs r4, 16 lsls r5, 16 lsrs r5, 16 - bl walkrun_state_clear + bl ClearPlayerAvatarInfo movs r6, 0 ldr r7, =0x02037350 lsls r4, 16 @@ -246566,7 +246664,7 @@ sub_808E1B8: ; 808E1B8 ldrb r1, [r6, 0x6] add r3, sp, 0x20 mov r2, sp - bl npc_to_objtemplate__with_indexed_objfunc + bl MakeObjectTemplateFromFieldObjectGraphicsInfoWithCallbackIndex str r4, [sp, 0xC] mov r1, sp ldr r2, =0x0000ffff @@ -246670,7 +246768,7 @@ sub_808E1B8: ; 808E1B8 bne @0808E312 mov r0, r9 adds r1, r7, 0 - bl sub_808E3C4 + bl SetPlayerAvatarFieldObjectIdAndObjectId bl sub_8154228 strb r0, [r6, 0x1B] @0808E312: @@ -246706,7 +246804,7 @@ sub_808E1B8: ; 808E1B8 ldrb r0, [r6, 0x18] lsls r0, 28 lsrs r0, 28 - bl npc_direction_to_obj_anim_image_number + bl FieldObjectDirectionToImageAnimId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -246719,7 +246817,7 @@ sub_808E1B8: ; 808E1B8 lsrs r0, 4 adds r1, r4, 0 movs r2, 0x1 - bl npc_y_height_related + bl SetObjectSubpriorityByZCoord @0808E374: add sp, 0x28 pop {r3-r5} @@ -246733,6 +246831,7 @@ sub_808E1B8: ; 808E1B8 thumb_func_end sub_808E1B8 thumb_func_start sub_808E38C +; void sub_808E38C(struct npc_state *fieldObject) sub_808E38C: ; 808E38C push {lr} ldrb r2, [r0] @@ -246758,13 +246857,14 @@ sub_808E38C: ; 808E38C subs r2, 0x10 ands r1, r2 strb r1, [r0, 0x2] - bl rom_npc_by_local_id_and_map_get_trainer_flag + bl FieldObjectClearAnim pop {r0} bx r0 thumb_func_end sub_808E38C - thumb_func_start sub_808E3C4 -sub_808E3C4: ; 808E3C4 + thumb_func_start SetPlayerAvatarFieldObjectIdAndObjectId +; void SetPlayerAvatarFieldObjectIdAndObjectId(u8 fieldObjectId, u8 objectId) +SetPlayerAvatarFieldObjectIdAndObjectId: ; 808E3C4 push {r4,r5,lr} lsls r0, 24 lsrs r0, 24 @@ -246777,20 +246877,20 @@ sub_808E3C4: ; 808E3C4 lsls r4, 2 adds r4, r1 ldrb r0, [r4, 0x5] - bl sub_808BDD4 + bl GetPlayerAvatarGenderByGraphicsId strb r0, [r5, 0x7] ldrb r0, [r4, 0x5] movs r1, 0x20 - bl sub_808BFB0 + bl SetPlayerAvatarExtraStateTransition pop {r4,r5} pop {r0} bx r0 .pool - thumb_func_end sub_808E3C4 + thumb_func_end SetPlayerAvatarFieldObjectIdAndObjectId - thumb_func_start set_field_object_graphics -; void set_field_object_graphics(npc_state *npcState, u8 graphicsId) -set_field_object_graphics: ; 808E3F8 + thumb_func_start FieldObjectSetGraphicsId +; void FieldObjectSetGraphicsId(npc_state *npcState, u8 graphicsId) +FieldObjectSetGraphicsId: ; 808E3F8 push {r4-r7,lr} mov r7, r8 push {r7} @@ -246913,14 +247013,14 @@ set_field_object_graphics: ; 808E3F8 lsrs r0, 7 cmp r0, 0 beq @0808E4F8 - bl sub_808EE8C + bl CameraObjectReset1 @0808E4F8: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 - thumb_func_end set_field_object_graphics + thumb_func_end FieldObjectSetGraphicsId thumb_func_start sub_808E504 sub_808E504: ; 808E504 @@ -246935,7 +247035,7 @@ sub_808E504: ; 808E504 lsls r3, 24 lsrs r4, r3, 24 mov r3, sp - bl npc_id_by_local_id_and_map_ret_success + bl TryGetFieldObjectIdByLocalIdAndMap lsls r0, 24 cmp r0, 0 bne @0808E538 @@ -246947,7 +247047,7 @@ sub_808E504: ; 808E504 ldr r1, =0x02037350 adds r0, r1 adds r1, r4, 0 - bl set_field_object_graphics + bl FieldObjectSetGraphicsId @0808E538: add sp, 0x4 pop {r4} @@ -246956,13 +247056,14 @@ sub_808E504: ; 808E504 .pool thumb_func_end sub_808E504 - thumb_func_start npc_turn -npc_turn: ; 808E544 + thumb_func_start FieldObjectTurn +; void FieldObjectTurn(struct npc_state *fieldObject, u8 direction) +FieldObjectTurn: ; 808E544 push {r4-r6,lr} adds r6, r0, 0 lsls r1, 24 lsrs r1, 24 - bl npc_set_direction + bl FieldObjectSetDirection ldrb r0, [r6, 0x1] lsls r0, 27 cmp r0, 0 @@ -246976,7 +247077,7 @@ npc_turn: ; 808E544 ldrb r0, [r6, 0x18] lsls r0, 28 lsrs r0, 28 - bl npc_direction_to_obj_anim_image_number + bl FieldObjectDirectionToImageAnimId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -246994,10 +247095,11 @@ npc_turn: ; 808E544 pop {r0} bx r0 .pool - thumb_func_end npc_turn + thumb_func_end FieldObjectTurn - thumb_func_start npc_turn_by_local_id_and_map -npc_turn_by_local_id_and_map: ; 808E594 + thumb_func_start FieldObjectTurnByLocalIdAndMap +; void FieldObjectTurnByLocalIdAndMap(u8 localId, u8 mapId, u8 mapGroupId) +FieldObjectTurnByLocalIdAndMap: ; 808E594 push {r4,lr} sub sp, 0x4 lsls r0, 24 @@ -247009,7 +247111,7 @@ npc_turn_by_local_id_and_map: ; 808E594 lsls r3, 24 lsrs r4, r3, 24 mov r3, sp - bl npc_id_by_local_id_and_map_ret_success + bl TryGetFieldObjectIdByLocalIdAndMap lsls r0, 24 cmp r0, 0 bne @0808E5C8 @@ -247021,14 +247123,14 @@ npc_turn_by_local_id_and_map: ; 808E594 ldr r1, =0x02037350 adds r0, r1 adds r1, r4, 0 - bl npc_turn + bl FieldObjectTurn @0808E5C8: add sp, 0x4 pop {r4} pop {r0} bx r0 .pool - thumb_func_end npc_turn_by_local_id_and_map + thumb_func_end FieldObjectTurnByLocalIdAndMap thumb_func_start sub_808E5D4 sub_808E5D4: ; 808E5D4 @@ -247041,7 +247143,7 @@ sub_808E5D4: ; 808E5D4 lsls r0, 2 ldr r2, =0x02037350 adds r0, r2 - bl npc_turn + bl FieldObjectTurn pop {r0} bx r0 .pool @@ -247098,7 +247200,7 @@ get_berry_tree_graphics: ; 808E5F4 adds r0, r6 ldrb r1, [r0] adds r0, r5, 0 - bl set_field_object_graphics + bl FieldObjectSetGraphicsId ldr r0, =gBerryTreePicTablePointers adds r0, r4, r0 ldr r0, [r0] @@ -247125,7 +247227,7 @@ get_berry_tree_graphics: ; 808E5F4 thumb_func_end get_berry_tree_graphics thumb_func_start GetFieldObjectGraphicsInfo -; npc_type *GetFieldObjectGraphicsInfo(u8 graphicsId) +; FieldObjectGraphicsInfo *GetFieldObjectGraphicsInfo(u8 graphicsId) GetFieldObjectGraphicsInfo: ; 808E694 push {lr} lsls r0, 24 @@ -247164,8 +247266,9 @@ GetFieldObjectGraphicsInfo: ; 808E694 .pool thumb_func_end GetFieldObjectGraphicsInfo - thumb_func_start sub_808E6DC -sub_808E6DC: ; 808E6DC + thumb_func_start FieldObjectHandleDynamicGraphicsId +; void FieldObjectHandleDynamicGraphicsId(struct npc_state *fieldObject) +FieldObjectHandleDynamicGraphicsId: ; 808E6DC push {r4,lr} adds r4, r0, 0 ldrb r0, [r4, 0x5] @@ -247180,7 +247283,7 @@ sub_808E6DC: ; 808E6DC pop {r4} pop {r0} bx r0 - thumb_func_end sub_808E6DC + thumb_func_end FieldObjectHandleDynamicGraphicsId thumb_func_start npc_by_local_id_and_map_set_field_1_bit_x20 npc_by_local_id_and_map_set_field_1_bit_x20: ; 808E6F8 @@ -247195,7 +247298,7 @@ npc_by_local_id_and_map_set_field_1_bit_x20: ; 808E6F8 lsls r3, 24 lsrs r4, r3, 24 mov r3, sp - bl npc_id_by_local_id_and_map_ret_success + bl TryGetFieldObjectIdByLocalIdAndMap lsls r0, 24 cmp r0, 0 bne @0808E73A @@ -247224,8 +247327,9 @@ npc_by_local_id_and_map_set_field_1_bit_x20: ; 808E6F8 .pool thumb_func_end npc_by_local_id_and_map_set_field_1_bit_x20 - thumb_func_start npc_get_local_id_and_mapnumbers -npc_get_local_id_and_mapnumbers: ; 808E748 + thumb_func_start FieldObjectGetLocalIdAndMap +; void FieldObjectGetLocalIdAndMap(struct npc_state *fieldObject, u8 *localId, u8 *mapId, u8 *mapGroupId) +FieldObjectGetLocalIdAndMap: ; 808E748 push {r4,lr} ldrb r4, [r0, 0x8] strb r4, [r1] @@ -247236,7 +247340,7 @@ npc_get_local_id_and_mapnumbers: ; 808E748 pop {r4} pop {r0} bx r0 - thumb_func_end npc_get_local_id_and_mapnumbers + thumb_func_end FieldObjectGetLocalIdAndMap thumb_func_start sub_808E75C sub_808E75C: ; 808E75C @@ -247245,7 +247349,7 @@ sub_808E75C: ; 808E75C asrs r0, 16 lsls r1, 16 asrs r1, 16 - bl npc_id_by_pos + bl GetFieldObjectIdByXY lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0x10 @@ -247278,7 +247382,7 @@ sub_808E78C: ; 808E78C lsls r3, 24 lsrs r4, r3, 24 mov r3, sp - bl npc_id_by_local_id_and_map_ret_success + bl TryGetFieldObjectIdByLocalIdAndMap lsls r0, 24 cmp r0, 0 bne @0808E7D2 @@ -247320,7 +247424,7 @@ sub_808E7E4: ; 808E7E4 lsls r2, 24 lsrs r2, 24 mov r3, sp - bl npc_id_by_local_id_and_map_ret_success + bl TryGetFieldObjectIdByLocalIdAndMap lsls r0, 24 cmp r0, 0 bne @0808E820 @@ -247363,7 +247467,7 @@ sub_808E82C: ; 808E82C lsls r4, 16 lsrs r4, 16 mov r3, sp - bl npc_id_by_local_id_and_map_ret_success + bl TryGetFieldObjectIdByLocalIdAndMap lsls r0, 24 cmp r0, 0 bne @0808E870 @@ -247407,7 +247511,7 @@ sub_808E894: ; 808E894 push {lr} lsls r0, 16 lsrs r0, 16 - bl npc_pal_idx_for_given_tag + bl FindFieldObjectPaletteIndexByTag lsls r0, 24 lsrs r1, r0, 24 ldr r0, =0x000011ff @@ -247454,6 +247558,7 @@ sub_808E8C0: ; 808E8C0 thumb_func_end sub_808E8C0 thumb_func_start sub_808E8F4 +; u8 sub_808E8F4(struct TaggedObjectPalette *taggedPalette) sub_808E8F4: ; 808E8F4 push {r4,lr} adds r4, r0, 0 @@ -247485,7 +247590,7 @@ pal_patch_for_npc: ; 808E91C lsrs r0, 16 lsls r4, 24 lsrs r4, 24 - bl npc_pal_idx_for_given_tag + bl FindFieldObjectPaletteIndexByTag lsls r0, 24 ldr r1, =gUnknown_0850BBC8 lsrs r0, 21 @@ -247532,8 +247637,9 @@ pal_patch_for_npc_range: ; 808E954 bx r0 thumb_func_end pal_patch_for_npc_range - thumb_func_start npc_pal_idx_for_given_tag -npc_pal_idx_for_given_tag: ; 808E980 + thumb_func_start FindFieldObjectPaletteIndexByTag +; u8 FindFieldObjectPaletteIndexByTag(u16 tag) +FindFieldObjectPaletteIndexByTag: ; 808E980 push {r4-r6,lr} lsls r0, 16 lsrs r5, r0, 16 @@ -247570,7 +247676,7 @@ npc_pal_idx_for_given_tag: ; 808E980 pop {r4-r6} pop {r1} bx r1 - thumb_func_end npc_pal_idx_for_given_tag + thumb_func_end FindFieldObjectPaletteIndexByTag thumb_func_start npc_load_two_palettes__no_record ; void npc_load_two_palettes__no_record(u16 tag, u8 slot) @@ -247713,6 +247819,7 @@ sub_808EAC4: ; 808EAC4 thumb_func_end sub_808EAC4 thumb_func_start npc_coords_shift +; void npc_coords_shift(struct npc_state *fieldObject, u16 x, u16 y) npc_coords_shift: ; 808EAE4 ldrh r3, [r0, 0x10] strh r3, [r0, 0x14] @@ -247724,6 +247831,7 @@ npc_coords_shift: ; 808EAE4 thumb_func_end npc_coords_shift thumb_func_start npc_coords_set +; void npc_coords_set(struct npc_state *fieldObject, u16 x, u16 y) npc_coords_set: ; 808EAF4 lsls r1, 16 lsrs r1, 16 @@ -247805,7 +247913,7 @@ sub_808EB08: ; 808EB08 lsrs r0, 7 cmp r0, 0 beq @0808EB9A - bl sub_808EE8C + bl CameraObjectReset1 @0808EB9A: pop {r3} mov r8, r3 @@ -247831,7 +247939,7 @@ sub_808EBA8: ; 808EBA8 lsls r4, 16 lsrs r4, 16 mov r3, sp - bl npc_id_by_local_id_and_map_ret_success + bl TryGetFieldObjectIdByLocalIdAndMap lsls r0, 24 cmp r0, 0 bne @0808EBF0 @@ -247860,6 +247968,7 @@ sub_808EBA8: ; 808EBA8 thumb_func_end sub_808EBA8 thumb_func_start npc_coords_shift_still +; void npc_coords_shift_still(struct npc_state *fieldObject) npc_coords_shift_still: ; 808EBFC push {lr} movs r2, 0x10 @@ -247871,8 +247980,9 @@ npc_coords_shift_still: ; 808EBFC bx r0 thumb_func_end npc_coords_shift_still - thumb_func_start npcs_rebase -npcs_rebase: ; 808EC10 + thumb_func_start UpdateFieldObjectCoordsForCameraUpdate +; void UpdateFieldObjectCoordsForCameraUpdate() +UpdateFieldObjectCoordsForCameraUpdate: ; 808EC10 push {r4,r5,lr} ldr r2, =0x02037334 ldrb r1, [r2] @@ -247924,10 +248034,11 @@ npcs_rebase: ; 808EC10 pop {r0} bx r0 .pool - thumb_func_end npcs_rebase + thumb_func_end UpdateFieldObjectCoordsForCameraUpdate - thumb_func_start npc_id_by_pos_and_height -npc_id_by_pos_and_height: ; 808EC78 + thumb_func_start GetFieldObjectIdByXYZ +; u8 GetFieldObjectIdByXYZ(u16 x, u16 y, u8 z) +GetFieldObjectIdByXYZ: ; 808EC78 push {r4-r7,lr} mov r7, r8 push {r7} @@ -247960,7 +248071,7 @@ npc_id_by_pos_and_height: ; 808EC78 bne @0808ECC8 adds r0, r1, 0 adds r1, r5, 0 - bl npc_does_height_match + bl FieldObjectDoesZCoordMatch lsls r0, 24 cmp r0, 0 beq @0808ECC8 @@ -247980,10 +248091,11 @@ npc_id_by_pos_and_height: ; 808EC78 pop {r4-r7} pop {r1} bx r1 - thumb_func_end npc_id_by_pos_and_height + thumb_func_end GetFieldObjectIdByXYZ - thumb_func_start npc_does_height_match -npc_does_height_match: ; 808ECE0 + thumb_func_start FieldObjectDoesZCoordMatch +; BOOL FieldObjectDoesZCoordMatch(struct npc_state *fieldObject) +FieldObjectDoesZCoordMatch: ; 808ECE0 push {lr} lsls r1, 24 lsrs r1, 24 @@ -248005,10 +248117,11 @@ npc_does_height_match: ; 808ECE0 @0808ED02: pop {r1} bx r1 - thumb_func_end npc_does_height_match + thumb_func_end FieldObjectDoesZCoordMatch - thumb_func_start overworld_rebase -overworld_rebase: ; 808ED08 + thumb_func_start UpdateFieldObjectsForCameraUpdate +; void UpdateFieldObjectsForCameraUpdate(u16 movingCameraOffsetX, u16 movingCameraOffsetY) +UpdateFieldObjectsForCameraUpdate: ; 808ED08 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 @@ -248016,22 +248129,23 @@ overworld_rebase: ; 808ED08 lsrs r4, 16 lsls r5, 16 lsrs r5, 16 - bl npcs_rebase + bl UpdateFieldObjectCoordsForCameraUpdate lsls r4, 16 asrs r4, 16 lsls r5, 16 asrs r5, 16 adds r0, r4, 0 adds r1, r5, 0 - bl npc_culling_maybe - bl sub_808E08C + bl SpawnFieldObjectsInView + bl RemoveFieldObjectsOutsideView pop {r4,r5} pop {r0} bx r0 - thumb_func_end overworld_rebase + thumb_func_end UpdateFieldObjectsForCameraUpdate - thumb_func_start sub_808ED34 -sub_808ED34: ; 808ED34 + thumb_func_start AddCameraObject +; u8 AddCameraObject(u8 followedObjectId) +AddCameraObject: ; 808ED34 push {r4,lr} adds r4, r0, 0 lsls r4, 24 @@ -248061,10 +248175,11 @@ sub_808ED34: ; 808ED34 pop {r1} bx r1 .pool - thumb_func_end sub_808ED34 + thumb_func_end AddCameraObject - thumb_func_start oac_0805F994 -oac_0805F994: ; 808ED78 + thumb_func_start ObjectCB_CameraObject +; void ObjectCB_CameraObject(struct obj *object) +ObjectCB_CameraObject: ; 808ED78 push {r4,r5,lr} sub sp, 0xC mov r2, sp @@ -248082,10 +248197,11 @@ oac_0805F994: ; 808ED78 pop {r0} bx r0 .pool - thumb_func_end oac_0805F994 + thumb_func_end ObjectCB_CameraObject - thumb_func_start sub_808EDA0 -sub_808EDA0: ; 808EDA0 + thumb_func_start CameraObject_0 +; void CameraObject_0(struct obj *object) +CameraObject_0: ; 808EDA0 push {lr} ldr r3, =0x02020630 movs r1, 0x2E @@ -248110,14 +248226,15 @@ sub_808EDA0: ; 808EDA0 strb r1, [r3] movs r1, 0x1 strh r1, [r0, 0x30] - bl sub_808EDDC + bl CameraObject_1 pop {r0} bx r0 .pool - thumb_func_end sub_808EDA0 + thumb_func_end CameraObject_0 - thumb_func_start sub_808EDDC -sub_808EDDC: ; 808EDDC + thumb_func_start CameraObject_1 +; void CameraObject_1(struct obj *object) +CameraObject_1: ; 808EDDC push {r4,r5,lr} ldr r3, =0x02020630 movs r1, 0x2E @@ -248144,10 +248261,11 @@ sub_808EDDC: ; 808EDDC pop {r0} bx r0 .pool - thumb_func_end sub_808EDDC + thumb_func_end CameraObject_1 - thumb_func_start sub_808EE14 -sub_808EE14: ; 808EE14 + thumb_func_start CameraObject_2 +; void CameraObject_2(struct obj *object) +CameraObject_2: ; 808EE14 push {r4,lr} ldr r4, =0x02020630 movs r1, 0x2E @@ -248171,10 +248289,11 @@ sub_808EE14: ; 808EE14 pop {r0} bx r0 .pool - thumb_func_end sub_808EE14 + thumb_func_end CameraObject_2 - thumb_func_start find_obj_using_oac_0805F994 -find_obj_using_oac_0805F994: ; 808EE44 + thumb_func_start FindCameraObject +; struct obj *FindCameraObject() +FindCameraObject: ; 808EE44 push {r4,r5,lr} movs r3, 0 ldr r4, =0x02020630 @@ -248193,7 +248312,7 @@ find_obj_using_oac_0805F994: ; 808EE44 beq @0808EE78 adds r0, r1, r5 ldr r1, [r0] - ldr r0, =oac_0805F994 + ldr r0, =ObjectCB_CameraObject cmp r1, r0 bne @0808EE78 adds r0, r2, 0 @@ -248210,12 +248329,13 @@ find_obj_using_oac_0805F994: ; 808EE44 pop {r4,r5} pop {r1} bx r1 - thumb_func_end find_obj_using_oac_0805F994 + thumb_func_end FindCameraObject - thumb_func_start sub_808EE8C -sub_808EE8C: ; 808EE8C + thumb_func_start CameraObjectReset1 +; void CameraObjectReset1() +CameraObjectReset1: ; 808EE8C push {lr} - bl find_obj_using_oac_0805F994 + bl FindCameraObject adds r2, r0, 0 cmp r2, 0 beq @0808EEA4 @@ -248227,28 +248347,30 @@ sub_808EE8C: ; 808EE8C @0808EEA4: pop {r0} bx r0 - thumb_func_end sub_808EE8C + thumb_func_end CameraObjectReset1 - thumb_func_start sub_808EEA8 -sub_808EEA8: ; 808EEA8 + thumb_func_start CameraObjectSetFollowedObjectId +; void CameraObjectSetFollowedObjectId(u8 objectId) +CameraObjectSetFollowedObjectId: ; 808EEA8 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - bl find_obj_using_oac_0805F994 + bl FindCameraObject cmp r0, 0 beq @0808EEBC strh r4, [r0, 0x2E] - bl sub_808EE8C + bl CameraObjectReset1 @0808EEBC: pop {r4} pop {r0} bx r0 - thumb_func_end sub_808EEA8 + thumb_func_end CameraObjectSetFollowedObjectId - thumb_func_start sub_808EEC4 -sub_808EEC4: ; 808EEC4 + thumb_func_start CameraObjectGetFollowedObjectId +; u8 CameraObjectGetFollowedObjectId() +CameraObjectGetFollowedObjectId: ; 808EEC4 push {lr} - bl find_obj_using_oac_0805F994 + bl FindCameraObject cmp r0, 0 beq @0808EED6 ldrh r0, [r0, 0x2E] @@ -248260,17 +248382,18 @@ sub_808EEC4: ; 808EEC4 @0808EED8: pop {r1} bx r1 - thumb_func_end sub_808EEC4 + thumb_func_end CameraObjectGetFollowedObjectId - thumb_func_start sub_808EEDC -sub_808EEDC: ; 808EEDC + thumb_func_start CameraObjectReset2 +; void CameraObjectReset2() +CameraObjectReset2: ; 808EEDC push {lr} - bl find_obj_using_oac_0805F994 + bl FindCameraObject movs r1, 0x2 strh r1, [r0, 0x30] pop {r0} bx r0 - thumb_func_end sub_808EEDC + thumb_func_end CameraObjectReset2 thumb_func_start sub_808EEEC sub_808EEEC: ; 808EEEC @@ -248385,8 +248508,9 @@ obj_unfreeze: ; 808EF50 bx r1 thumb_func_end obj_unfreeze - thumb_func_start npc_set_direction -npc_set_direction: ; 808EFC0 + thumb_func_start FieldObjectSetDirection +; void FieldObjectSetDirection(struct npc_state *fieldObject, u8 direction) +FieldObjectSetDirection: ; 808EFC0 push {r4,lr} adds r3, r0, 0 lsls r1, 24 @@ -248421,10 +248545,11 @@ npc_set_direction: ; 808EFC0 pop {r4} pop {r0} bx r0 - thumb_func_end npc_set_direction + thumb_func_end FieldObjectSetDirection - thumb_func_start npc_script_by_local_id_and_map -npc_script_by_local_id_and_map: ; 808F004 + thumb_func_start GetFieldObjectScriptPointerByLocalIdAndMap +; u32 GetFieldObjectScriptPointerByLocalIdAndMap(u8 localId, u8 mapId, u8 mapGroupId) +GetFieldObjectScriptPointerByLocalIdAndMap: ; 808F004 push {lr} lsls r0, 24 lsrs r0, 24 @@ -248432,14 +248557,15 @@ npc_script_by_local_id_and_map: ; 808F004 lsrs r1, 24 lsls r2, 24 lsrs r2, 24 - bl rom_npc_by_local_id_and_map + bl GetFieldObjectTemplateByLocalIdAndMap ldr r0, [r0, 0x10] pop {r1} bx r1 - thumb_func_end npc_script_by_local_id_and_map + thumb_func_end GetFieldObjectScriptPointerByLocalIdAndMap - thumb_func_start npc_get_script_by_npc_id -npc_get_script_by_npc_id: ; 808F01C + thumb_func_start GetFieldObjectScriptPointerByFieldObjectId +; u32 GetFieldObjectScriptPointerByFieldObjectId(u8 fieldObjectId) +GetFieldObjectScriptPointerByFieldObjectId: ; 808F01C push {lr} lsls r0, 24 lsrs r0, 24 @@ -248451,14 +248577,15 @@ npc_get_script_by_npc_id: ; 808F01C ldrb r0, [r2, 0x8] ldrb r1, [r2, 0x9] ldrb r2, [r2, 0xA] - bl npc_script_by_local_id_and_map + bl GetFieldObjectScriptPointerByLocalIdAndMap pop {r1} bx r1 .pool - thumb_func_end npc_get_script_by_npc_id + thumb_func_end GetFieldObjectScriptPointerByFieldObjectId - thumb_func_start rom_npc_id_in_script_by_local_id_and_map -rom_npc_id_in_script_by_local_id_and_map: ; 808F040 + thumb_func_start GetFieldObjectFlagIdByLocalIdAndMap +; u16 GetFieldObjectFlagIdByLocalIdAndMap(u8 localId, u8 mapId, u8 mapGroupId) +GetFieldObjectFlagIdByLocalIdAndMap: ; 808F040 push {lr} lsls r0, 24 lsrs r0, 24 @@ -248466,14 +248593,15 @@ rom_npc_id_in_script_by_local_id_and_map: ; 808F040 lsrs r1, 24 lsls r2, 24 lsrs r2, 24 - bl rom_npc_by_local_id_and_map + bl GetFieldObjectTemplateByLocalIdAndMap ldrh r0, [r0, 0x14] pop {r1} bx r1 - thumb_func_end rom_npc_id_in_script_by_local_id_and_map + thumb_func_end GetFieldObjectFlagIdByLocalIdAndMap - thumb_func_start rom_npc_id_in_script_by_npc_id -rom_npc_id_in_script_by_npc_id: ; 808F058 + thumb_func_start GetFieldObjectFlagIdByFieldObjectId +; u16 GetFieldObjectFlagIdByFieldObjectId(u8 fieldObjectId) +GetFieldObjectFlagIdByFieldObjectId: ; 808F058 push {lr} lsls r0, 24 lsrs r0, 24 @@ -248485,13 +248613,13 @@ rom_npc_id_in_script_by_npc_id: ; 808F058 ldrb r0, [r2, 0x8] ldrb r1, [r2, 0x9] ldrb r2, [r2, 0xA] - bl rom_npc_id_in_script_by_local_id_and_map + bl GetFieldObjectFlagIdByLocalIdAndMap lsls r0, 16 lsrs r0, 16 pop {r1} bx r1 .pool - thumb_func_end rom_npc_id_in_script_by_npc_id + thumb_func_end GetFieldObjectFlagIdByFieldObjectId thumb_func_start sub_808F080 sub_808F080: ; 808F080 @@ -248504,7 +248632,7 @@ sub_808F080: ; 808F080 lsls r2, 24 lsrs r2, 24 mov r3, sp - bl npc_id_by_local_id_and_map_ret_success + bl TryGetFieldObjectIdByLocalIdAndMap lsls r0, 24 cmp r0, 0 bne @0808F0B4 @@ -248551,7 +248679,7 @@ sub_808F0D4: ; 808F0D4 lsls r2, 24 lsrs r2, 24 mov r3, sp - bl npc_id_by_local_id_and_map_ret_success + bl TryGetFieldObjectIdByLocalIdAndMap lsls r0, 24 cmp r0, 0 bne @0808F108 @@ -248573,8 +248701,9 @@ sub_808F0D4: ; 808F0D4 bx r1 thumb_func_end sub_808F0D4 - thumb_func_start sub_808F110 -sub_808F110: ; 808F110 + thumb_func_start FieldObjectGetBerryTreeId +; u8 FieldObjectGetBerryTreeId(u8 fieldObjectId) +FieldObjectGetBerryTreeId: ; 808F110 lsls r0, 24 lsrs r0, 24 ldr r2, =0x02037350 @@ -248585,10 +248714,11 @@ sub_808F110: ; 808F110 ldrb r0, [r1, 0x1D] bx lr .pool - thumb_func_end sub_808F110 + thumb_func_end FieldObjectGetBerryTreeId - thumb_func_start rom_npc_by_local_id_and_map -rom_npc_by_local_id_and_map: ; 808F128 + thumb_func_start GetFieldObjectTemplateByLocalIdAndMap +; struct FieldObjectTemplate *GetFieldObjectTemplateByLocalIdAndMap(u8 localId, u8 mapId, u8 mapGroupId) +GetFieldObjectTemplateByLocalIdAndMap: ; 808F128 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 @@ -248622,14 +248752,15 @@ rom_npc_by_local_id_and_map: ; 808F128 @0808F16C: ldrb r2, [r0] adds r0, r4, 0 - bl rom_npc_by_nr + bl FindFieldObjectTemplateInArrayByLocalId pop {r4} pop {r1} bx r1 - thumb_func_end rom_npc_by_local_id_and_map + thumb_func_end GetFieldObjectTemplateByLocalIdAndMap - thumb_func_start rom_npc_by_nr -rom_npc_by_nr: ; 808F17C + thumb_func_start FindFieldObjectTemplateInArrayByLocalId +; struct FieldObjectTemplate *FindFieldObjectTemplateInArrayByLocalId(u8 localId, struct FieldObjectTemplate *templates, u8 numTemplates) +FindFieldObjectTemplateInArrayByLocalId: ; 808F17C push {r4,r5,lr} adds r5, r1, 0 lsls r0, 24 @@ -248661,9 +248792,10 @@ rom_npc_by_nr: ; 808F17C pop {r4,r5} pop {r1} bx r1 - thumb_func_end rom_npc_by_nr + thumb_func_end FindFieldObjectTemplateInArrayByLocalId thumb_func_start sub_808F1B4 +; int sub_808F1B4(struct npc_state *fieldObject) sub_808F1B4: ; 808F1B4 push {r4,r5,lr} adds r3, r0, 0 @@ -248713,6 +248845,7 @@ sub_808F1B4: ; 808F1B4 thumb_func_end sub_808F1B4 thumb_func_start sub_808F208 +; void sub_808F208(struct npc_state *fieldObject) sub_808F208: ; 808F208 push {r4,lr} adds r4, r0, 0 @@ -248762,6 +248895,7 @@ sub_808F23C: ; 808F23C thumb_func_end sub_808F23C thumb_func_start sub_808F254 +; void sub_808F254(u8 localId, u8 mapId, u8 mapGroupId) sub_808F254: ; 808F254 push {lr} sub sp, 0x4 @@ -248772,7 +248906,7 @@ sub_808F254: ; 808F254 lsls r2, 24 lsrs r2, 24 mov r3, sp - bl npc_id_by_local_id_and_map_ret_success + bl TryGetFieldObjectIdByLocalIdAndMap lsls r0, 24 cmp r0, 0 bne @0808F282 @@ -248804,7 +248938,7 @@ sub_808F28C: ; 808F28C lsls r3, 24 lsrs r4, r3, 24 mov r3, sp - bl npc_id_by_local_id_and_map_ret_success + bl TryGetFieldObjectIdByLocalIdAndMap lsls r0, 24 cmp r0, 0 bne @0808F2E8 @@ -248950,8 +249084,8 @@ npc_paltag_by_palslot: ; 808F360 .pool thumb_func_end npc_paltag_by_palslot - thumb_func_start sub_808F3E0 -sub_808F3E0: ; 808F3E0 + thumb_func_start FieldObjectCB_NoMovement1 +FieldObjectCB_NoMovement1: ; 808F3E0 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -248961,21 +249095,21 @@ sub_808F3E0: ; 808F3E0 lsls r0, 2 ldr r2, =0x02037350 adds r0, r2 - ldr r2, =sub_808F404 - bl meta_step + ldr r2, =FieldObjectCB2_NoMovement1 + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_808F3E0 + thumb_func_end FieldObjectCB_NoMovement1 - thumb_func_start sub_808F404 -sub_808F404: ; 808F404 + thumb_func_start FieldObjectCB2_NoMovement1 +FieldObjectCB2_NoMovement1: ; 808F404 movs r0, 0 bx lr - thumb_func_end sub_808F404 + thumb_func_end FieldObjectCB2_NoMovement1 - thumb_func_start sub_808F408 -sub_808F408: ; 808F408 + thumb_func_start FieldObjectCB_GoRandomDirections +FieldObjectCB_GoRandomDirections: ; 808F408 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -248985,15 +249119,15 @@ sub_808F408: ; 808F408 lsls r0, 2 ldr r2, =0x02037350 adds r0, r2 - ldr r2, =sub_808F42C - bl meta_step + ldr r2, =FieldObjectCB2_GoRandomDirections + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_808F408 + thumb_func_end FieldObjectCB_GoRandomDirections - thumb_func_start sub_808F42C -sub_808F42C: ; 808F42C + thumb_func_start FieldObjectCB2_GoRandomDirections +FieldObjectCB2_GoRandomDirections: ; 808F42C push {r4,lr} ldr r3, =gUnknown_0850D6F4 movs r4, 0x30 @@ -249008,7 +249142,7 @@ sub_808F42C: ; 808F42C pop {r1} bx r1 .pool - thumb_func_end sub_808F42C + thumb_func_end FieldObjectCB2_GoRandomDirections thumb_func_start sub_808F44C sub_808F44C: ; 808F44C @@ -249030,13 +249164,13 @@ sub_808F460: ; 808F460 ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 - bl d2s_look1 + bl GetFaceDirectionAnimId adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r5, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim movs r0, 0x2 strh r0, [r5, 0x30] movs r0, 0x1 @@ -249049,7 +249183,7 @@ sub_808F460: ; 808F460 sub_808F48C: ; 808F48C push {r4-r6,lr} adds r6, r1, 0 - bl npc_obj_exec_an + bl FieldObjectExecRegularAnim lsls r0, 24 cmp r0, 0 beq @0808F4C0 @@ -249115,7 +249249,7 @@ sub_808F4E8: ; 808F4E8 ldrb r4, [r0] adds r0, r5, 0 adds r1, r4, 0 - bl npc_set_direction + bl FieldObjectSetDirection movs r0, 0x5 strh r0, [r6, 0x30] adds r0, r5, 0 @@ -249142,13 +249276,13 @@ sub_808F534: ; 808F534 adds r5, r1, 0 ldrb r0, [r4, 0x18] lsrs r0, 4 - bl sub_8093388 + bl GetGoSpeed0AnimId adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r5, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim ldrb r0, [r4] movs r1, 0x2 orrs r0, r1 @@ -249166,7 +249300,7 @@ sub_808F564: ; 808F564 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 - bl npc_obj_exec_an + bl FieldObjectExecRegularAnim lsls r0, 24 cmp r0, 0 beq @0808F582 @@ -249190,7 +249324,7 @@ npc_is_trainer_and_within_sight_distance_blocks_of_player: ; 808F58C sub sp, 0x4 adds r5, r0, 0 movs r0, 0x80 - bl walkrun_bitfield_and_r0 + bl TestPlayerAvatarFlags lsls r0, 24 cmp r0, 0 beq @0808F5F8 @@ -249204,7 +249338,7 @@ npc_is_trainer_and_within_sight_distance_blocks_of_player: ; 808F58C adds r7, 0x2 mov r0, sp adds r1, r7, 0 - bl player_get_pos_to + bl PlayerGetDestCoords ldrh r2, [r5, 0x10] ldrh r4, [r5, 0x12] ldrb r1, [r5, 0x1D] @@ -249658,7 +249792,7 @@ sub_808F8BC: ; 808F8BC adds r5, 0x2 mov r0, sp adds r1, r5, 0 - bl player_get_pos_to + bl PlayerGetDestCoords mov r2, sp mov r0, sp ldrh r0, [r0] @@ -249712,8 +249846,8 @@ sub_808F8BC: ; 808F8BC .pool thumb_func_end sub_808F8BC - thumb_func_start sub_808F944 -sub_808F944: ; 808F944 + thumb_func_start FieldObjectCB_LookRandomDirections +FieldObjectCB_LookRandomDirections: ; 808F944 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -249723,15 +249857,16 @@ sub_808F944: ; 808F944 lsls r0, 2 ldr r2, =0x02037350 adds r0, r2 - ldr r2, =sub_808F968 - bl meta_step + ldr r2, =FieldObjectCB2_LookRandomDirections + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_808F944 + thumb_func_end FieldObjectCB_LookRandomDirections - thumb_func_start sub_808F968 -sub_808F968: ; 808F968 + thumb_func_start FieldObjectCB2_LookRandomDirections +; BOOL FieldObjectCB2_LookRandomDirections(struct npc_state *fieldObject, struct obj *object) +FieldObjectCB2_LookRandomDirections: ; 808F968 push {r4,lr} ldr r3, =gUnknown_0850D740 movs r4, 0x30 @@ -249746,9 +249881,10 @@ sub_808F968: ; 808F968 pop {r1} bx r1 .pool - thumb_func_end sub_808F968 + thumb_func_end FieldObjectCB2_LookRandomDirections thumb_func_start sub_808F988 +; BOOL sub_808F988(struct npc_state *fieldObject, struct obj *object) sub_808F988: ; 808F988 push {r4,lr} adds r4, r1, 0 @@ -249761,6 +249897,7 @@ sub_808F988: ; 808F988 thumb_func_end sub_808F988 thumb_func_start sub_808F99C +; BOOL sub_808F99C(struct npc_state *fieldObject, struct obj *object) sub_808F99C: ; 808F99C push {r4,r5,lr} adds r4, r0, 0 @@ -249768,13 +249905,13 @@ sub_808F99C: ; 808F99C ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 - bl d2s_look1 + bl GetFaceDirectionAnimId adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r5, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim movs r0, 0x2 strh r0, [r5, 0x30] movs r0, 0x1 @@ -249784,11 +249921,12 @@ sub_808F99C: ; 808F99C thumb_func_end sub_808F99C thumb_func_start sub_808F9C8 +; BOOL sub_808F9C8(struct npc_state *fieldObject, struct obj *object) sub_808F9C8: ; 808F9C8 push {r4-r7,lr} adds r6, r0, 0 adds r7, r1, 0 - bl npc_obj_exec_an + bl FieldObjectExecRegularAnim lsls r0, 24 cmp r0, 0 beq @0808F9FE @@ -249818,6 +249956,7 @@ sub_808F9C8: ; 808F9C8 thumb_func_end sub_808F9C8 thumb_func_start sub_808FA0C +; BOOL sub_808FA0C(struct npc_state *fieldObject, struct obj *object) sub_808FA0C: ; 808FA0C push {r4,r5,lr} adds r4, r0, 0 @@ -249846,6 +249985,7 @@ sub_808FA0C: ; 808FA0C thumb_func_end sub_808FA0C thumb_func_start sub_808FA3C +; BOOL sub_808FA3C(struct npc_state *fieldObject, struct obj *object) sub_808FA3C: ; 808FA3C push {r4,r5,lr} sub sp, 0x4 @@ -249870,7 +250010,7 @@ sub_808FA3C: ; 808FA3C ldrb r1, [r0] @0808FA6C: adds r0, r4, 0 - bl npc_set_direction + bl FieldObjectSetDirection movs r0, 0x1 strh r0, [r5, 0x30] add sp, 0x4 @@ -249880,8 +250020,8 @@ sub_808FA3C: ; 808FA3C .pool thumb_func_end sub_808FA3C - thumb_func_start sub_808FA84 -sub_808FA84: ; 808FA84 + thumb_func_start FieldObjectCB_RandomlyGoNorthOrSouth +FieldObjectCB_RandomlyGoNorthOrSouth: ; 808FA84 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -249891,15 +250031,15 @@ sub_808FA84: ; 808FA84 lsls r0, 2 ldr r2, =0x02037350 adds r0, r2 - ldr r2, =sub_808FAA8 - bl meta_step + ldr r2, =FieldObjectCB2_RandomlyGoNorthOrSouth + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_808FA84 + thumb_func_end FieldObjectCB_RandomlyGoNorthOrSouth - thumb_func_start sub_808FAA8 -sub_808FAA8: ; 808FAA8 + thumb_func_start FieldObjectCB2_RandomlyGoNorthOrSouth +FieldObjectCB2_RandomlyGoNorthOrSouth: ; 808FAA8 push {r4,lr} ldr r3, =gUnknown_0850D754 movs r4, 0x30 @@ -249914,7 +250054,7 @@ sub_808FAA8: ; 808FAA8 pop {r1} bx r1 .pool - thumb_func_end sub_808FAA8 + thumb_func_end FieldObjectCB2_RandomlyGoNorthOrSouth thumb_func_start sub_808FAC8 sub_808FAC8: ; 808FAC8 @@ -249936,13 +250076,13 @@ sub_808FADC: ; 808FADC ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 - bl d2s_look1 + bl GetFaceDirectionAnimId adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r5, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim movs r0, 0x2 strh r0, [r5, 0x30] movs r0, 0x1 @@ -249952,10 +250092,11 @@ sub_808FADC: ; 808FADC thumb_func_end sub_808FADC thumb_func_start sub_808FB08 +; BOOL sub_808FB08(struct npc_state *fieldObject, struct obj *object) sub_808FB08: ; 808FB08 push {r4-r6,lr} adds r6, r1, 0 - bl npc_obj_exec_an + bl FieldObjectExecRegularAnim lsls r0, 24 cmp r0, 0 beq @0808FB3C @@ -249983,6 +250124,7 @@ sub_808FB08: ; 808FB08 thumb_func_end sub_808FB08 thumb_func_start sub_808FB44 +; BOOL sub_808FB44(struct npc_state *fieldObject, struct obj *object) sub_808FB44: ; 808FB44 push {r4,lr} adds r4, r1, 0 @@ -250004,6 +250146,7 @@ sub_808FB44: ; 808FB44 thumb_func_end sub_808FB44 thumb_func_start sub_808FB64 +; BOOL sub_808FB64(struct npc_state *fieldObject, struct obj *object) sub_808FB64: ; 808FB64 push {r4-r7,lr} sub sp, 0x4 @@ -250022,7 +250165,7 @@ sub_808FB64: ; 808FB64 ldrb r4, [r0] adds r0, r5, 0 adds r1, r4, 0 - bl npc_set_direction + bl FieldObjectSetDirection movs r0, 0x5 strh r0, [r6, 0x30] adds r0, r5, 0 @@ -250048,13 +250191,13 @@ sub_808FBB0: ; 808FBB0 adds r5, r1, 0 ldrb r0, [r4, 0x18] lsrs r0, 4 - bl sub_8093388 + bl GetGoSpeed0AnimId adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r5, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim ldrb r0, [r4] movs r1, 0x2 orrs r0, r1 @@ -250072,7 +250215,7 @@ sub_808FBE0: ; 808FBE0 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 - bl npc_obj_exec_an + bl FieldObjectExecRegularAnim lsls r0, 24 cmp r0, 0 beq @0808FBFE @@ -250090,8 +250233,8 @@ sub_808FBE0: ; 808FBE0 bx r1 thumb_func_end sub_808FBE0 - thumb_func_start sub_808FC08 -sub_808FC08: ; 808FC08 + thumb_func_start FieldObjectCB_RandomlyGoEastOrWest +FieldObjectCB_RandomlyGoEastOrWest: ; 808FC08 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -250101,15 +250244,15 @@ sub_808FC08: ; 808FC08 lsls r0, 2 ldr r2, =0x02037350 adds r0, r2 - ldr r2, =sub_808FC2C - bl meta_step + ldr r2, =FieldObjectCB2_RandomlyGoEastOrWest + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_808FC08 + thumb_func_end FieldObjectCB_RandomlyGoEastOrWest - thumb_func_start sub_808FC2C -sub_808FC2C: ; 808FC2C + thumb_func_start FieldObjectCB2_RandomlyGoEastOrWest +FieldObjectCB2_RandomlyGoEastOrWest: ; 808FC2C push {r4,lr} ldr r3, =gUnknown_0850D774 movs r4, 0x30 @@ -250124,7 +250267,7 @@ sub_808FC2C: ; 808FC2C pop {r1} bx r1 .pool - thumb_func_end sub_808FC2C + thumb_func_end FieldObjectCB2_RandomlyGoEastOrWest thumb_func_start sub_808FC4C sub_808FC4C: ; 808FC4C @@ -250146,13 +250289,13 @@ sub_808FC60: ; 808FC60 ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 - bl d2s_look1 + bl GetFaceDirectionAnimId adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r5, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim movs r0, 0x2 strh r0, [r5, 0x30] movs r0, 0x1 @@ -250165,7 +250308,7 @@ sub_808FC60: ; 808FC60 sub_808FC8C: ; 808FC8C push {r4-r6,lr} adds r6, r1, 0 - bl npc_obj_exec_an + bl FieldObjectExecRegularAnim lsls r0, 24 cmp r0, 0 beq @0808FCC0 @@ -250232,7 +250375,7 @@ sub_808FCE8: ; 808FCE8 ldrb r4, [r0] adds r0, r5, 0 adds r1, r4, 0 - bl npc_set_direction + bl FieldObjectSetDirection movs r0, 0x5 strh r0, [r6, 0x30] adds r0, r5, 0 @@ -250258,13 +250401,13 @@ sub_808FD34: ; 808FD34 adds r5, r1, 0 ldrb r0, [r4, 0x18] lsrs r0, 4 - bl sub_8093388 + bl GetGoSpeed0AnimId adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r5, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim ldrb r0, [r4] movs r1, 0x2 orrs r0, r1 @@ -250282,7 +250425,7 @@ sub_808FD64: ; 808FD64 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 - bl npc_obj_exec_an + bl FieldObjectExecRegularAnim lsls r0, 24 cmp r0, 0 beq @0808FD82 @@ -250300,8 +250443,8 @@ sub_808FD64: ; 808FD64 bx r1 thumb_func_end sub_808FD64 - thumb_func_start sub_808FD8C -sub_808FD8C: ; 808FD8C + thumb_func_start FieldObjectCB_FaceFixedDirection +FieldObjectCB_FaceFixedDirection: ; 808FD8C push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -250311,15 +250454,16 @@ sub_808FD8C: ; 808FD8C lsls r0, 2 ldr r2, =0x02037350 adds r0, r2 - ldr r2, =sub_808FDB0 - bl meta_step + ldr r2, =FieldObjectCB2_FaceFixedDirection + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_808FD8C + thumb_func_end FieldObjectCB_FaceFixedDirection - thumb_func_start sub_808FDB0 -sub_808FDB0: ; 808FDB0 + thumb_func_start FieldObjectCB2_FaceFixedDirection +; BOOL FieldObjectCB2_FaceFixedDirection(struct npc_state *fieldObject, struct obj *object) +FieldObjectCB2_FaceFixedDirection: ; 808FDB0 push {r4,lr} ldr r3, =gUnknown_0850D794 movs r4, 0x30 @@ -250334,9 +250478,10 @@ sub_808FDB0: ; 808FDB0 pop {r1} bx r1 .pool - thumb_func_end sub_808FDB0 + thumb_func_end FieldObjectCB2_FaceFixedDirection thumb_func_start sub_808FDD0 +; BOOL sub_808FDD0(struct npc_state *fieldObject, struct obj *object) sub_808FDD0: ; 808FDD0 push {r4,r5,lr} adds r4, r0, 0 @@ -250345,13 +250490,13 @@ sub_808FDD0: ; 808FDD0 ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 - bl d2s_look1 + bl GetFaceDirectionAnimId adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r5, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim movs r0, 0x1 strh r0, [r5, 0x30] pop {r4,r5} @@ -250360,10 +250505,11 @@ sub_808FDD0: ; 808FDD0 thumb_func_end sub_808FDD0 thumb_func_start sub_808FDFC +; BOOL sub_808FDFC(struct npc_state *fieldObject, struct obj *object) sub_808FDFC: ; 808FDFC push {r4,lr} adds r4, r1, 0 - bl npc_obj_exec_an + bl FieldObjectExecRegularAnim lsls r0, 24 cmp r0, 0 bne @0808FE0E @@ -250380,6 +250526,7 @@ sub_808FDFC: ; 808FDFC thumb_func_end sub_808FDFC thumb_func_start sub_808FE1C +; BOOL sub_808FE1C(struct npc_state *fieldObject, struct obj *object) sub_808FE1C: ; 808FE1C ldrb r2, [r0] movs r1, 0x3 @@ -250390,8 +250537,8 @@ sub_808FE1C: ; 808FE1C bx lr thumb_func_end sub_808FE1C - thumb_func_start sub_808FE2C -sub_808FE2C: ; 808FE2C + thumb_func_start FieldObjectCB_BerryTree +FieldObjectCB_BerryTree: ; 808FE2C push {r4,r5,lr} adds r4, r0, 0 movs r0, 0x2E @@ -250414,18 +250561,18 @@ sub_808FE2C: ; 808FE2C orrs r0, r1 strh r0, [r4, 0x3C] @0808FE58: - ldr r2, =sub_808FE70 + ldr r2, =FieldObjectCB2_BerryTree adds r0, r5, 0 adds r1, r4, 0 - bl meta_step + bl FieldObjectStep pop {r4,r5} pop {r0} bx r0 .pool - thumb_func_end sub_808FE2C + thumb_func_end FieldObjectCB_BerryTree - thumb_func_start sub_808FE70 -sub_808FE70: ; 808FE70 + thumb_func_start FieldObjectCB2_BerryTree +FieldObjectCB2_BerryTree: ; 808FE70 push {r4,lr} ldr r3, =gUnknown_0850D7A0 movs r4, 0x30 @@ -250440,7 +250587,7 @@ sub_808FE70: ; 808FE70 pop {r1} bx r1 .pool - thumb_func_end sub_808FE70 + thumb_func_end FieldObjectCB2_BerryTree thumb_func_start do_berry_tree_growth_sparkle_1 do_berry_tree_growth_sparkle_1: ; 808FE90 @@ -250521,7 +250668,7 @@ do_berry_tree_growth_sparkle_1: ; 808FE90 adds r0, r4, 0 adds r1, r5, 0 movs r2, 0x39 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim movs r0, 0x1 strh r0, [r5, 0x30] b @0808FF42 @@ -250539,7 +250686,7 @@ do_berry_tree_growth_sparkle_1: ; 808FE90 sub_808FF48: ; 808FF48 push {r4,lr} adds r4, r1, 0 - bl npc_obj_exec_an + bl FieldObjectExecRegularAnim lsls r0, 24 cmp r0, 0 bne @0808FF5A @@ -250683,8 +250830,8 @@ sub_8090004: ; 8090004 bx r1 thumb_func_end sub_8090004 - thumb_func_start sub_8090050 -sub_8090050: ; 8090050 + thumb_func_start FieldObjectCB_RandomlyLookNorthOrSouth +FieldObjectCB_RandomlyLookNorthOrSouth: ; 8090050 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -250694,15 +250841,15 @@ sub_8090050: ; 8090050 lsls r0, 2 ldr r2, =0x02037350 adds r0, r2 - ldr r2, =sub_8090074 - bl meta_step + ldr r2, =FieldObjectCB2_RandomlyLookNorthOrSouth + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_8090050 + thumb_func_end FieldObjectCB_RandomlyLookNorthOrSouth - thumb_func_start sub_8090074 -sub_8090074: ; 8090074 + thumb_func_start FieldObjectCB2_RandomlyLookNorthOrSouth +FieldObjectCB2_RandomlyLookNorthOrSouth: ; 8090074 push {r4,lr} ldr r3, =gUnknown_0850D7B4 movs r4, 0x30 @@ -250717,7 +250864,7 @@ sub_8090074: ; 8090074 pop {r1} bx r1 .pool - thumb_func_end sub_8090074 + thumb_func_end FieldObjectCB2_RandomlyLookNorthOrSouth thumb_func_start sub_8090094 sub_8090094: ; 8090094 @@ -250739,13 +250886,13 @@ sub_80900A8: ; 80900A8 ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 - bl d2s_look1 + bl GetFaceDirectionAnimId adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r5, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim movs r0, 0x2 strh r0, [r5, 0x30] movs r0, 0x1 @@ -250759,7 +250906,7 @@ sub_80900D4: ; 80900D4 push {r4-r7,lr} adds r6, r0, 0 adds r7, r1, 0 - bl npc_obj_exec_an + bl FieldObjectExecRegularAnim lsls r0, 24 cmp r0, 0 beq @0809010A @@ -250841,7 +250988,7 @@ sub_8090148: ; 8090148 ldrb r1, [r0] @08090178: adds r0, r4, 0 - bl npc_set_direction + bl FieldObjectSetDirection movs r0, 0x1 strh r0, [r5, 0x30] add sp, 0x4 @@ -250851,8 +250998,8 @@ sub_8090148: ; 8090148 .pool thumb_func_end sub_8090148 - thumb_func_start sub_8090190 -sub_8090190: ; 8090190 + thumb_func_start FieldObjectCB_RandomlyLookEastOrWest +FieldObjectCB_RandomlyLookEastOrWest: ; 8090190 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -250862,15 +251009,15 @@ sub_8090190: ; 8090190 lsls r0, 2 ldr r2, =0x02037350 adds r0, r2 - ldr r2, =sub_80901B4 - bl meta_step + ldr r2, =FieldObjectCB2_RandomlyLookEastOrWest + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_8090190 + thumb_func_end FieldObjectCB_RandomlyLookEastOrWest - thumb_func_start sub_80901B4 -sub_80901B4: ; 80901B4 + thumb_func_start FieldObjectCB2_RandomlyLookEastOrWest +FieldObjectCB2_RandomlyLookEastOrWest: ; 80901B4 push {r4,lr} ldr r3, =gUnknown_0850D7C8 movs r4, 0x30 @@ -250885,7 +251032,7 @@ sub_80901B4: ; 80901B4 pop {r1} bx r1 .pool - thumb_func_end sub_80901B4 + thumb_func_end FieldObjectCB2_RandomlyLookEastOrWest thumb_func_start sub_80901D4 sub_80901D4: ; 80901D4 @@ -250907,13 +251054,13 @@ sub_80901E8: ; 80901E8 ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 - bl d2s_look1 + bl GetFaceDirectionAnimId adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r5, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim movs r0, 0x2 strh r0, [r5, 0x30] movs r0, 0x1 @@ -250927,7 +251074,7 @@ sub_8090214: ; 8090214 push {r4-r7,lr} adds r6, r0, 0 adds r7, r1, 0 - bl npc_obj_exec_an + bl FieldObjectExecRegularAnim lsls r0, 24 cmp r0, 0 beq @0809024A @@ -251009,7 +251156,7 @@ sub_8090288: ; 8090288 ldrb r1, [r0] @080902B8: adds r0, r4, 0 - bl npc_set_direction + bl FieldObjectSetDirection movs r0, 0x1 strh r0, [r5, 0x30] add sp, 0x4 @@ -251019,8 +251166,8 @@ sub_8090288: ; 8090288 .pool thumb_func_end sub_8090288 - thumb_func_start sub_80902D0 -sub_80902D0: ; 80902D0 + thumb_func_start FieldObjectCB_RandomlyLookNorthOrWest +FieldObjectCB_RandomlyLookNorthOrWest: ; 80902D0 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -251030,15 +251177,15 @@ sub_80902D0: ; 80902D0 lsls r0, 2 ldr r2, =0x02037350 adds r0, r2 - ldr r2, =sub_80902F4 - bl meta_step + ldr r2, =FieldObjectCB2_RandomlyLookNorthOrWest + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_80902D0 + thumb_func_end FieldObjectCB_RandomlyLookNorthOrWest - thumb_func_start sub_80902F4 -sub_80902F4: ; 80902F4 + thumb_func_start FieldObjectCB2_RandomlyLookNorthOrWest +FieldObjectCB2_RandomlyLookNorthOrWest: ; 80902F4 push {r4,lr} ldr r3, =gUnknown_0850D7DC movs r4, 0x30 @@ -251053,7 +251200,7 @@ sub_80902F4: ; 80902F4 pop {r1} bx r1 .pool - thumb_func_end sub_80902F4 + thumb_func_end FieldObjectCB2_RandomlyLookNorthOrWest thumb_func_start sub_8090314 sub_8090314: ; 8090314 @@ -251075,13 +251222,13 @@ sub_8090328: ; 8090328 ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 - bl d2s_look1 + bl GetFaceDirectionAnimId adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r5, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim movs r0, 0x2 strh r0, [r5, 0x30] movs r0, 0x1 @@ -251095,7 +251242,7 @@ sub_8090354: ; 8090354 push {r4-r7,lr} adds r6, r0, 0 adds r7, r1, 0 - bl npc_obj_exec_an + bl FieldObjectExecRegularAnim lsls r0, 24 cmp r0, 0 beq @0809038A @@ -251177,7 +251324,7 @@ sub_80903C8: ; 80903C8 ldrb r1, [r0] @080903F8: adds r0, r4, 0 - bl npc_set_direction + bl FieldObjectSetDirection movs r0, 0x1 strh r0, [r5, 0x30] add sp, 0x4 @@ -251187,8 +251334,8 @@ sub_80903C8: ; 80903C8 .pool thumb_func_end sub_80903C8 - thumb_func_start sub_8090410 -sub_8090410: ; 8090410 + thumb_func_start FieldObjectCB_RandomlyLookNorthOrEast +FieldObjectCB_RandomlyLookNorthOrEast: ; 8090410 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -251199,11 +251346,11 @@ sub_8090410: ; 8090410 ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_8090434 - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_8090410 + thumb_func_end FieldObjectCB_RandomlyLookNorthOrEast thumb_func_start sub_8090434 sub_8090434: ; 8090434 @@ -251243,13 +251390,13 @@ sub_8090468: ; 8090468 ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 - bl d2s_look1 + bl GetFaceDirectionAnimId adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r5, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim movs r0, 0x2 strh r0, [r5, 0x30] movs r0, 0x1 @@ -251263,7 +251410,7 @@ sub_8090494: ; 8090494 push {r4-r7,lr} adds r6, r0, 0 adds r7, r1, 0 - bl npc_obj_exec_an + bl FieldObjectExecRegularAnim lsls r0, 24 cmp r0, 0 beq @080904CA @@ -251345,7 +251492,7 @@ sub_8090508: ; 8090508 ldrb r1, [r0] @08090538: adds r0, r4, 0 - bl npc_set_direction + bl FieldObjectSetDirection movs r0, 0x1 strh r0, [r5, 0x30] add sp, 0x4 @@ -251355,8 +251502,8 @@ sub_8090508: ; 8090508 .pool thumb_func_end sub_8090508 - thumb_func_start sub_8090550 -sub_8090550: ; 8090550 + thumb_func_start FieldObjectCB_RandomlyLookSouthOrWest +FieldObjectCB_RandomlyLookSouthOrWest: ; 8090550 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -251367,11 +251514,11 @@ sub_8090550: ; 8090550 ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_8090574 - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_8090550 + thumb_func_end FieldObjectCB_RandomlyLookSouthOrWest thumb_func_start sub_8090574 sub_8090574: ; 8090574 @@ -251411,13 +251558,13 @@ sub_80905A8: ; 80905A8 ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 - bl d2s_look1 + bl GetFaceDirectionAnimId adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r5, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim movs r0, 0x2 strh r0, [r5, 0x30] movs r0, 0x1 @@ -251431,7 +251578,7 @@ sub_80905D4: ; 80905D4 push {r4-r7,lr} adds r6, r0, 0 adds r7, r1, 0 - bl npc_obj_exec_an + bl FieldObjectExecRegularAnim lsls r0, 24 cmp r0, 0 beq @0809060A @@ -251513,7 +251660,7 @@ sub_8090648: ; 8090648 ldrb r1, [r0] @08090678: adds r0, r4, 0 - bl npc_set_direction + bl FieldObjectSetDirection movs r0, 0x1 strh r0, [r5, 0x30] add sp, 0x4 @@ -251523,8 +251670,8 @@ sub_8090648: ; 8090648 .pool thumb_func_end sub_8090648 - thumb_func_start sub_8090690 -sub_8090690: ; 8090690 + thumb_func_start FieldObjectCB_RandomlyLookSouthOrEast +FieldObjectCB_RandomlyLookSouthOrEast: ; 8090690 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -251535,11 +251682,11 @@ sub_8090690: ; 8090690 ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_80906B4 - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_8090690 + thumb_func_end FieldObjectCB_RandomlyLookSouthOrEast thumb_func_start sub_80906B4 sub_80906B4: ; 80906B4 @@ -251579,13 +251726,13 @@ sub_80906E8: ; 80906E8 ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 - bl d2s_look1 + bl GetFaceDirectionAnimId adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r5, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim movs r0, 0x2 strh r0, [r5, 0x30] movs r0, 0x1 @@ -251599,7 +251746,7 @@ sub_8090714: ; 8090714 push {r4-r7,lr} adds r6, r0, 0 adds r7, r1, 0 - bl npc_obj_exec_an + bl FieldObjectExecRegularAnim lsls r0, 24 cmp r0, 0 beq @0809074A @@ -251681,7 +251828,7 @@ sub_8090788: ; 8090788 ldrb r1, [r0] @080907B8: adds r0, r4, 0 - bl npc_set_direction + bl FieldObjectSetDirection movs r0, 0x1 strh r0, [r5, 0x30] add sp, 0x4 @@ -251691,8 +251838,8 @@ sub_8090788: ; 8090788 .pool thumb_func_end sub_8090788 - thumb_func_start sub_80907D0 -sub_80907D0: ; 80907D0 + thumb_func_start FieldObjectCB_RandomlyLookNorthOrSouthOrWest +FieldObjectCB_RandomlyLookNorthOrSouthOrWest: ; 80907D0 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -251703,11 +251850,11 @@ sub_80907D0: ; 80907D0 ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_80907F4 - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_80907D0 + thumb_func_end FieldObjectCB_RandomlyLookNorthOrSouthOrWest thumb_func_start sub_80907F4 sub_80907F4: ; 80907F4 @@ -251747,13 +251894,13 @@ sub_8090828: ; 8090828 ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 - bl d2s_look1 + bl GetFaceDirectionAnimId adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r5, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim movs r0, 0x2 strh r0, [r5, 0x30] movs r0, 0x1 @@ -251767,7 +251914,7 @@ sub_8090854: ; 8090854 push {r4-r7,lr} adds r6, r0, 0 adds r7, r1, 0 - bl npc_obj_exec_an + bl FieldObjectExecRegularAnim lsls r0, 24 cmp r0, 0 beq @0809088A @@ -251849,7 +251996,7 @@ sub_80908C8: ; 80908C8 ldrb r1, [r0] @080908F8: adds r0, r4, 0 - bl npc_set_direction + bl FieldObjectSetDirection movs r0, 0x1 strh r0, [r5, 0x30] add sp, 0x4 @@ -251859,8 +252006,8 @@ sub_80908C8: ; 80908C8 .pool thumb_func_end sub_80908C8 - thumb_func_start sub_8090910 -sub_8090910: ; 8090910 + thumb_func_start FieldObjectCB_RandomlyLookNorthOrSouthOrEast +FieldObjectCB_RandomlyLookNorthOrSouthOrEast: ; 8090910 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -251871,11 +252018,11 @@ sub_8090910: ; 8090910 ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_8090934 - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_8090910 + thumb_func_end FieldObjectCB_RandomlyLookNorthOrSouthOrEast thumb_func_start sub_8090934 sub_8090934: ; 8090934 @@ -251915,13 +252062,13 @@ sub_8090968: ; 8090968 ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 - bl d2s_look1 + bl GetFaceDirectionAnimId adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r5, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim movs r0, 0x2 strh r0, [r5, 0x30] movs r0, 0x1 @@ -251935,7 +252082,7 @@ sub_8090994: ; 8090994 push {r4-r7,lr} adds r6, r0, 0 adds r7, r1, 0 - bl npc_obj_exec_an + bl FieldObjectExecRegularAnim lsls r0, 24 cmp r0, 0 beq @080909CA @@ -252017,7 +252164,7 @@ sub_8090A08: ; 8090A08 ldrb r1, [r0] @08090A38: adds r0, r4, 0 - bl npc_set_direction + bl FieldObjectSetDirection movs r0, 0x1 strh r0, [r5, 0x30] add sp, 0x4 @@ -252027,8 +252174,8 @@ sub_8090A08: ; 8090A08 .pool thumb_func_end sub_8090A08 - thumb_func_start sub_8090A50 -sub_8090A50: ; 8090A50 + thumb_func_start FieldObjectCB_RandomlyLookNorthOrEastOrWest +FieldObjectCB_RandomlyLookNorthOrEastOrWest: ; 8090A50 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -252039,11 +252186,11 @@ sub_8090A50: ; 8090A50 ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_8090A74 - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_8090A50 + thumb_func_end FieldObjectCB_RandomlyLookNorthOrEastOrWest thumb_func_start sub_8090A74 sub_8090A74: ; 8090A74 @@ -252083,13 +252230,13 @@ sub_8090AA8: ; 8090AA8 ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 - bl d2s_look1 + bl GetFaceDirectionAnimId adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r5, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim movs r0, 0x2 strh r0, [r5, 0x30] movs r0, 0x1 @@ -252103,7 +252250,7 @@ sub_8090AD4: ; 8090AD4 push {r4-r7,lr} adds r6, r0, 0 adds r7, r1, 0 - bl npc_obj_exec_an + bl FieldObjectExecRegularAnim lsls r0, 24 cmp r0, 0 beq @08090B0A @@ -252185,7 +252332,7 @@ sub_8090B48: ; 8090B48 ldrb r1, [r0] @08090B78: adds r0, r4, 0 - bl npc_set_direction + bl FieldObjectSetDirection movs r0, 0x1 strh r0, [r5, 0x30] add sp, 0x4 @@ -252195,8 +252342,8 @@ sub_8090B48: ; 8090B48 .pool thumb_func_end sub_8090B48 - thumb_func_start sub_8090B90 -sub_8090B90: ; 8090B90 + thumb_func_start FieldObjectCB_RandomlyLookSouthOrEastOrWest +FieldObjectCB_RandomlyLookSouthOrEastOrWest: ; 8090B90 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -252207,11 +252354,11 @@ sub_8090B90: ; 8090B90 ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_8090BB4 - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_8090B90 + thumb_func_end FieldObjectCB_RandomlyLookSouthOrEastOrWest thumb_func_start sub_8090BB4 sub_8090BB4: ; 8090BB4 @@ -252251,13 +252398,13 @@ sub_8090BE8: ; 8090BE8 ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 - bl d2s_look1 + bl GetFaceDirectionAnimId adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r5, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim movs r0, 0x2 strh r0, [r5, 0x30] movs r0, 0x1 @@ -252271,7 +252418,7 @@ sub_8090C14: ; 8090C14 push {r4-r7,lr} adds r6, r0, 0 adds r7, r1, 0 - bl npc_obj_exec_an + bl FieldObjectExecRegularAnim lsls r0, 24 cmp r0, 0 beq @08090C4A @@ -252353,7 +252500,7 @@ sub_8090C88: ; 8090C88 ldrb r1, [r0] @08090CB8: adds r0, r4, 0 - bl npc_set_direction + bl FieldObjectSetDirection movs r0, 0x1 strh r0, [r5, 0x30] add sp, 0x4 @@ -252363,8 +252510,8 @@ sub_8090C88: ; 8090C88 .pool thumb_func_end sub_8090C88 - thumb_func_start sub_8090CD0 -sub_8090CD0: ; 8090CD0 + thumb_func_start FieldObjectCB_LookAroundCounterclockwise +FieldObjectCB_LookAroundCounterclockwise: ; 8090CD0 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -252375,11 +252522,11 @@ sub_8090CD0: ; 8090CD0 ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_8090CF4 - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_8090CD0 + thumb_func_end FieldObjectCB_LookAroundCounterclockwise thumb_func_start sub_8090CF4 sub_8090CF4: ; 8090CF4 @@ -252408,13 +252555,13 @@ sub_8090D14: ; 8090D14 ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 - bl d2s_look1 + bl GetFaceDirectionAnimId adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r5, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim movs r0, 0x1 strh r0, [r5, 0x30] pop {r4,r5} @@ -252426,7 +252573,7 @@ sub_8090D14: ; 8090D14 sub_8090D40: ; 8090D40 push {r4,lr} adds r4, r1, 0 - bl npc_obj_exec_an + bl FieldObjectExecRegularAnim lsls r0, 24 cmp r0, 0 beq @08090D5A @@ -252468,6 +252615,7 @@ sub_8090D64: ; 8090D64 thumb_func_end sub_8090D64 thumb_func_start sub_8090D90 +; BOOL sub_8090D90(struct npc_state *fieldObject, struct obj *object) sub_8090D90: ; 8090D90 push {r4,r5,lr} sub sp, 0x8 @@ -252491,7 +252639,7 @@ sub_8090D90: ; 8090D90 ldrb r1, [r0] @08090DBC: adds r0, r4, 0 - bl npc_set_direction + bl FieldObjectSetDirection movs r0, 0 strh r0, [r5, 0x30] movs r0, 0x1 @@ -252502,8 +252650,8 @@ sub_8090D90: ; 8090D90 .pool thumb_func_end sub_8090D90 - thumb_func_start sub_8090DD4 -sub_8090DD4: ; 8090DD4 + thumb_func_start FieldObjectCB_LookAroundClockwise +FieldObjectCB_LookAroundClockwise: ; 8090DD4 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -252514,11 +252662,11 @@ sub_8090DD4: ; 8090DD4 ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_8090DF8 - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_8090DD4 + thumb_func_end FieldObjectCB_LookAroundClockwise thumb_func_start sub_8090DF8 sub_8090DF8: ; 8090DF8 @@ -252547,13 +252695,13 @@ sub_8090E18: ; 8090E18 ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 - bl d2s_look1 + bl GetFaceDirectionAnimId adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r5, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim movs r0, 0x1 strh r0, [r5, 0x30] pop {r4,r5} @@ -252565,7 +252713,7 @@ sub_8090E18: ; 8090E18 sub_8090E44: ; 8090E44 push {r4,lr} adds r4, r1, 0 - bl npc_obj_exec_an + bl FieldObjectExecRegularAnim lsls r0, 24 cmp r0, 0 beq @08090E5E @@ -252630,7 +252778,7 @@ sub_8090E94: ; 8090E94 ldrb r1, [r0] @08090EC0: adds r0, r4, 0 - bl npc_set_direction + bl FieldObjectSetDirection movs r0, 0 strh r0, [r5, 0x30] movs r0, 0x1 @@ -252641,8 +252789,8 @@ sub_8090E94: ; 8090E94 .pool thumb_func_end sub_8090E94 - thumb_func_start sub_8090ED8 -sub_8090ED8: ; 8090ED8 + thumb_func_start FieldObjectCB_AlternatelyGoInOppositeDirections +FieldObjectCB_AlternatelyGoInOppositeDirections: ; 8090ED8 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -252653,11 +252801,11 @@ sub_8090ED8: ; 8090ED8 ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_8090EFC - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_8090ED8 + thumb_func_end FieldObjectCB_AlternatelyGoInOppositeDirections thumb_func_start sub_8090EFC sub_8090EFC: ; 8090EFC @@ -252690,6 +252838,7 @@ sub_8090F1C: ; 8090F1C thumb_func_end sub_8090F1C thumb_func_start sub_8090F30 +; BOOL sub_8090F30(struct npc_state *fieldObject, struct obj *object) sub_8090F30: ; 8090F30 push {r4,r5,lr} adds r4, r0, 0 @@ -252704,12 +252853,12 @@ sub_8090F30: ; 8090F30 cmp r0, 0 beq @08090F52 adds r0, r1, 0 - bl direction_reversed + bl GetOppositeDirection lsls r0, 24 lsrs r1, r0, 24 @08090F52: adds r0, r4, 0 - bl npc_set_direction + bl FieldObjectSetDirection movs r0, 0x2 strh r0, [r5, 0x30] movs r0, 0x1 @@ -252720,6 +252869,7 @@ sub_8090F30: ; 8090F30 thumb_func_end sub_8090F30 thumb_func_start sub_8090F68 +; BOOL sub_8090F68(struct npc_state *fieldObject, struct obj *object) sub_8090F68: ; 8090F68 push {r4-r7,lr} adds r4, r0, 0 @@ -252737,12 +252887,12 @@ sub_8090F68: ; 8090F68 strb r0, [r2] ldrb r0, [r4, 0x18] lsrs r0, 4 - bl direction_reversed + bl GetOppositeDirection adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl npc_set_direction + bl FieldObjectSetDirection @08090F98: ldrb r1, [r4, 0x18] lsrs r1, 4 @@ -252752,7 +252902,7 @@ sub_8090F68: ; 8090F68 lsrs r5, r0, 24 ldrb r0, [r4, 0x18] lsrs r0, 4 - bl sub_8093388 + bl GetGoSpeed0AnimId lsls r0, 24 lsrs r6, r0, 24 cmp r5, 0x1 @@ -252764,15 +252914,15 @@ sub_8090F68: ; 8090F68 strb r0, [r1] ldrb r0, [r4, 0x18] lsrs r0, 4 - bl direction_reversed + bl GetOppositeDirection adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl npc_set_direction + bl FieldObjectSetDirection ldrb r0, [r4, 0x18] lsrs r0, 4 - bl sub_8093388 + bl GetGoSpeed0AnimId lsls r0, 24 lsrs r6, r0, 24 ldrb r1, [r4, 0x18] @@ -252787,14 +252937,14 @@ sub_8090F68: ; 8090F68 ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 - bl d2s_08064244 + bl GetStepInPlaceDelay16AnimId lsls r0, 24 lsrs r6, r0, 24 @08091000: adds r0, r4, 0 adds r1, r7, 0 adds r2, r6, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim ldrb r0, [r4] movs r1, 0x2 orrs r0, r1 @@ -252808,11 +252958,12 @@ sub_8090F68: ; 8090F68 thumb_func_end sub_8090F68 thumb_func_start sub_8091020 +; BOOL sub_8091020(struct npc_state *fieldObject, struct obj *object) sub_8091020: ; 8091020 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 - bl npc_obj_exec_an + bl FieldObjectExecRegularAnim lsls r0, 24 cmp r0, 0 beq @0809103E @@ -252831,6 +252982,7 @@ sub_8091020: ; 8091020 thumb_func_end sub_8091020 thumb_func_start sub_8091048 +; BOOL sub_8091048(struct npc_state *fieldObject, struct obj *object) sub_8091048: ; 8091048 push {r4,lr} adds r4, r1, 0 @@ -252842,8 +252994,9 @@ sub_8091048: ; 8091048 bx r1 thumb_func_end sub_8091048 - thumb_func_start sub_809105C -sub_809105C: ; 809105C + thumb_func_start MoveFieldObjectInNextDirectionInSequence +; BOOL MoveFieldObjectInNextDirectionInSequence(struct npc_state *fieldObject, struct obj *object, u8 *directions) +MoveFieldObjectInNextDirectionInSequence: ; 809105C push {r4-r7,lr} mov r7, r8 push {r7} @@ -252868,10 +253021,10 @@ sub_809105C: ; 809105C adds r0, r7, r0 ldrb r1, [r0] adds r0, r4, 0 - bl npc_set_direction + bl FieldObjectSetDirection ldrb r0, [r4, 0x18] lsrs r0, 4 - bl sub_8093388 + bl GetGoSpeed0AnimId lsls r0, 24 lsrs r6, r0, 24 ldrb r1, [r4, 0x18] @@ -252889,10 +253042,10 @@ sub_809105C: ; 809105C adds r0, r7, r0 ldrb r1, [r0] adds r0, r4, 0 - bl npc_set_direction + bl FieldObjectSetDirection ldrb r0, [r4, 0x18] lsrs r0, 4 - bl sub_8093388 + bl GetGoSpeed0AnimId lsls r0, 24 lsrs r6, r0, 24 ldrb r1, [r4, 0x18] @@ -252907,14 +253060,14 @@ sub_809105C: ; 809105C ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 - bl d2s_08064244 + bl GetStepInPlaceDelay16AnimId lsls r0, 24 lsrs r6, r0, 24 @080910EA: adds r0, r4, 0 mov r1, r8 adds r2, r6, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim ldrb r0, [r4] movs r1, 0x2 orrs r0, r1 @@ -252928,14 +253081,15 @@ sub_809105C: ; 809105C pop {r4-r7} pop {r1} bx r1 - thumb_func_end sub_809105C + thumb_func_end MoveFieldObjectInNextDirectionInSequence thumb_func_start sub_8091110 +; BOOL sub_8091110(struct npc_state *fieldObject, struct obj *object) sub_8091110: ; 8091110 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 - bl npc_obj_exec_an + bl FieldObjectExecRegularAnim lsls r0, 24 cmp r0, 0 beq @0809112E @@ -252953,8 +253107,8 @@ sub_8091110: ; 8091110 bx r1 thumb_func_end sub_8091110 - thumb_func_start sub_8091138 -sub_8091138: ; 8091138 + thumb_func_start FieldObjectCB_GoInDirectionSequence1 +FieldObjectCB_GoInDirectionSequence1: ; 8091138 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -252965,11 +253119,11 @@ sub_8091138: ; 8091138 ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_809115C - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_8091138 + thumb_func_end FieldObjectCB_GoInDirectionSequence1 thumb_func_start sub_809115C sub_809115C: ; 809115C @@ -253016,7 +253170,7 @@ sub_809117C: ; 809117C adds r0, r4, 0 adds r1, r5, 0 mov r2, sp - bl sub_809105C + bl MoveFieldObjectInNextDirectionInSequence lsls r0, 24 lsrs r0, 24 add sp, 0x4 @@ -253026,8 +253180,8 @@ sub_809117C: ; 809117C .pool thumb_func_end sub_809117C - thumb_func_start sub_80911C4 -sub_80911C4: ; 80911C4 + thumb_func_start FieldObjectCB_GoInDirectionSequence2 +FieldObjectCB_GoInDirectionSequence2: ; 80911C4 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -253038,11 +253192,11 @@ sub_80911C4: ; 80911C4 ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_80911E8 - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_80911C4 + thumb_func_end FieldObjectCB_GoInDirectionSequence2 thumb_func_start sub_80911E8 sub_80911E8: ; 80911E8 @@ -253089,7 +253243,7 @@ sub_8091208: ; 8091208 adds r0, r4, 0 adds r1, r5, 0 mov r2, sp - bl sub_809105C + bl MoveFieldObjectInNextDirectionInSequence lsls r0, 24 lsrs r0, 24 add sp, 0x4 @@ -253099,8 +253253,8 @@ sub_8091208: ; 8091208 .pool thumb_func_end sub_8091208 - thumb_func_start sub_8091250 -sub_8091250: ; 8091250 + thumb_func_start FieldObjectCB_GoInDirectionSequence3 +FieldObjectCB_GoInDirectionSequence3: ; 8091250 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -253111,11 +253265,11 @@ sub_8091250: ; 8091250 ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_8091274 - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_8091250 + thumb_func_end FieldObjectCB_GoInDirectionSequence3 thumb_func_start sub_8091274 sub_8091274: ; 8091274 @@ -253162,7 +253316,7 @@ sub_8091294: ; 8091294 adds r0, r4, 0 adds r1, r5, 0 mov r2, sp - bl sub_809105C + bl MoveFieldObjectInNextDirectionInSequence lsls r0, 24 lsrs r0, 24 add sp, 0x4 @@ -253172,8 +253326,8 @@ sub_8091294: ; 8091294 .pool thumb_func_end sub_8091294 - thumb_func_start sub_80912DC -sub_80912DC: ; 80912DC + thumb_func_start FieldObjectCB_GoInDirectionSequence4 +FieldObjectCB_GoInDirectionSequence4: ; 80912DC push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -253184,11 +253338,11 @@ sub_80912DC: ; 80912DC ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_8091300 - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_80912DC + thumb_func_end FieldObjectCB_GoInDirectionSequence4 thumb_func_start sub_8091300 sub_8091300: ; 8091300 @@ -253235,7 +253389,7 @@ sub_8091320: ; 8091320 adds r0, r4, 0 adds r1, r5, 0 mov r2, sp - bl sub_809105C + bl MoveFieldObjectInNextDirectionInSequence lsls r0, 24 lsrs r0, 24 add sp, 0x4 @@ -253245,8 +253399,8 @@ sub_8091320: ; 8091320 .pool thumb_func_end sub_8091320 - thumb_func_start sub_8091368 -sub_8091368: ; 8091368 + thumb_func_start FieldObjectCB_GoInDirectionSequence5 +FieldObjectCB_GoInDirectionSequence5: ; 8091368 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -253257,11 +253411,11 @@ sub_8091368: ; 8091368 ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_809138C - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_8091368 + thumb_func_end FieldObjectCB_GoInDirectionSequence5 thumb_func_start sub_809138C sub_809138C: ; 809138C @@ -253282,6 +253436,7 @@ sub_809138C: ; 809138C thumb_func_end sub_809138C thumb_func_start sub_80913AC +; BOOL sub_80913AC(struct npc_state *fieldObject, struct obj *object) sub_80913AC: ; 80913AC push {r4,r5,lr} sub sp, 0x4 @@ -253308,7 +253463,7 @@ sub_80913AC: ; 80913AC adds r0, r4, 0 adds r1, r5, 0 mov r2, sp - bl sub_809105C + bl MoveFieldObjectInNextDirectionInSequence lsls r0, 24 lsrs r0, 24 add sp, 0x4 @@ -253318,8 +253473,8 @@ sub_80913AC: ; 80913AC .pool thumb_func_end sub_80913AC - thumb_func_start sub_80913F4 -sub_80913F4: ; 80913F4 + thumb_func_start FieldObjectCB_GoInDirectionSequence6 +FieldObjectCB_GoInDirectionSequence6: ; 80913F4 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -253330,11 +253485,11 @@ sub_80913F4: ; 80913F4 ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_8091418 - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_80913F4 + thumb_func_end FieldObjectCB_GoInDirectionSequence6 thumb_func_start sub_8091418 sub_8091418: ; 8091418 @@ -253381,7 +253536,7 @@ sub_8091438: ; 8091438 adds r0, r4, 0 adds r1, r5, 0 mov r2, sp - bl sub_809105C + bl MoveFieldObjectInNextDirectionInSequence lsls r0, 24 lsrs r0, 24 add sp, 0x4 @@ -253391,8 +253546,8 @@ sub_8091438: ; 8091438 .pool thumb_func_end sub_8091438 - thumb_func_start sub_8091480 -sub_8091480: ; 8091480 + thumb_func_start FieldObjectCB_GoInDirectionSequence7 +FieldObjectCB_GoInDirectionSequence7: ; 8091480 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -253403,11 +253558,11 @@ sub_8091480: ; 8091480 ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_80914A4 - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_8091480 + thumb_func_end FieldObjectCB_GoInDirectionSequence7 thumb_func_start sub_80914A4 sub_80914A4: ; 80914A4 @@ -253454,7 +253609,7 @@ sub_80914C4: ; 80914C4 adds r0, r4, 0 adds r1, r5, 0 mov r2, sp - bl sub_809105C + bl MoveFieldObjectInNextDirectionInSequence lsls r0, 24 lsrs r0, 24 add sp, 0x4 @@ -253464,8 +253619,8 @@ sub_80914C4: ; 80914C4 .pool thumb_func_end sub_80914C4 - thumb_func_start sub_809150C -sub_809150C: ; 809150C + thumb_func_start FieldObjectCB_GoInDirectionSequence8 +FieldObjectCB_GoInDirectionSequence8: ; 809150C push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -253476,11 +253631,11 @@ sub_809150C: ; 809150C ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_8091530 - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_809150C + thumb_func_end FieldObjectCB_GoInDirectionSequence8 thumb_func_start sub_8091530 sub_8091530: ; 8091530 @@ -253527,7 +253682,7 @@ sub_8091550: ; 8091550 adds r0, r4, 0 adds r1, r5, 0 mov r2, sp - bl sub_809105C + bl MoveFieldObjectInNextDirectionInSequence lsls r0, 24 lsrs r0, 24 add sp, 0x4 @@ -253537,8 +253692,8 @@ sub_8091550: ; 8091550 .pool thumb_func_end sub_8091550 - thumb_func_start sub_8091598 -sub_8091598: ; 8091598 + thumb_func_start FieldObjectCB_GoInDirectionSequence9 +FieldObjectCB_GoInDirectionSequence9: ; 8091598 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -253549,11 +253704,11 @@ sub_8091598: ; 8091598 ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_80915BC - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_8091598 + thumb_func_end FieldObjectCB_GoInDirectionSequence9 thumb_func_start sub_80915BC sub_80915BC: ; 80915BC @@ -253600,7 +253755,7 @@ sub_80915DC: ; 80915DC adds r0, r4, 0 adds r1, r5, 0 mov r2, sp - bl sub_809105C + bl MoveFieldObjectInNextDirectionInSequence lsls r0, 24 lsrs r0, 24 add sp, 0x4 @@ -253610,8 +253765,8 @@ sub_80915DC: ; 80915DC .pool thumb_func_end sub_80915DC - thumb_func_start sub_8091624 -sub_8091624: ; 8091624 + thumb_func_start FieldObjectCB_GoInDirectionSequence10 +FieldObjectCB_GoInDirectionSequence10: ; 8091624 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -253622,11 +253777,11 @@ sub_8091624: ; 8091624 ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_8091648 - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_8091624 + thumb_func_end FieldObjectCB_GoInDirectionSequence10 thumb_func_start sub_8091648 sub_8091648: ; 8091648 @@ -253673,7 +253828,7 @@ sub_8091668: ; 8091668 adds r0, r4, 0 adds r1, r5, 0 mov r2, sp - bl sub_809105C + bl MoveFieldObjectInNextDirectionInSequence lsls r0, 24 lsrs r0, 24 add sp, 0x4 @@ -253683,8 +253838,8 @@ sub_8091668: ; 8091668 .pool thumb_func_end sub_8091668 - thumb_func_start sub_80916B0 -sub_80916B0: ; 80916B0 + thumb_func_start FieldObjectCB_GoInDirectionSequence11 +FieldObjectCB_GoInDirectionSequence11: ; 80916B0 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -253695,11 +253850,11 @@ sub_80916B0: ; 80916B0 ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_80916D4 - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_80916B0 + thumb_func_end FieldObjectCB_GoInDirectionSequence11 thumb_func_start sub_80916D4 sub_80916D4: ; 80916D4 @@ -253746,7 +253901,7 @@ sub_80916F4: ; 80916F4 adds r0, r4, 0 adds r1, r5, 0 mov r2, sp - bl sub_809105C + bl MoveFieldObjectInNextDirectionInSequence lsls r0, 24 lsrs r0, 24 add sp, 0x4 @@ -253756,8 +253911,8 @@ sub_80916F4: ; 80916F4 .pool thumb_func_end sub_80916F4 - thumb_func_start sub_809173C -sub_809173C: ; 809173C + thumb_func_start FieldObjectCB_GoInDirectionSequence12 +FieldObjectCB_GoInDirectionSequence12: ; 809173C push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -253768,11 +253923,11 @@ sub_809173C: ; 809173C ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_8091760 - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_809173C + thumb_func_end FieldObjectCB_GoInDirectionSequence12 thumb_func_start sub_8091760 sub_8091760: ; 8091760 @@ -253819,7 +253974,7 @@ sub_8091780: ; 8091780 adds r0, r4, 0 adds r1, r5, 0 mov r2, sp - bl sub_809105C + bl MoveFieldObjectInNextDirectionInSequence lsls r0, 24 lsrs r0, 24 add sp, 0x4 @@ -253829,8 +253984,8 @@ sub_8091780: ; 8091780 .pool thumb_func_end sub_8091780 - thumb_func_start sub_80917C8 -sub_80917C8: ; 80917C8 + thumb_func_start FieldObjectCB_GoInDirectionSequence13 +FieldObjectCB_GoInDirectionSequence13: ; 80917C8 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -253841,11 +253996,11 @@ sub_80917C8: ; 80917C8 ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_80917EC - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_80917C8 + thumb_func_end FieldObjectCB_GoInDirectionSequence13 thumb_func_start sub_80917EC sub_80917EC: ; 80917EC @@ -253892,7 +254047,7 @@ sub_809180C: ; 809180C adds r0, r4, 0 adds r1, r5, 0 mov r2, sp - bl sub_809105C + bl MoveFieldObjectInNextDirectionInSequence lsls r0, 24 lsrs r0, 24 add sp, 0x4 @@ -253902,8 +254057,8 @@ sub_809180C: ; 809180C .pool thumb_func_end sub_809180C - thumb_func_start sub_8091854 -sub_8091854: ; 8091854 + thumb_func_start FieldObjectCB_GoInDirectionSequence14 +FieldObjectCB_GoInDirectionSequence14: ; 8091854 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -253914,11 +254069,11 @@ sub_8091854: ; 8091854 ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_8091878 - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_8091854 + thumb_func_end FieldObjectCB_GoInDirectionSequence14 thumb_func_start sub_8091878 sub_8091878: ; 8091878 @@ -253965,7 +254120,7 @@ sub_8091898: ; 8091898 adds r0, r4, 0 adds r1, r5, 0 mov r2, sp - bl sub_809105C + bl MoveFieldObjectInNextDirectionInSequence lsls r0, 24 lsrs r0, 24 add sp, 0x4 @@ -253975,8 +254130,8 @@ sub_8091898: ; 8091898 .pool thumb_func_end sub_8091898 - thumb_func_start sub_80918E0 -sub_80918E0: ; 80918E0 + thumb_func_start FieldObjectCB_GoInDirectionSequence15 +FieldObjectCB_GoInDirectionSequence15: ; 80918E0 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -253987,11 +254142,11 @@ sub_80918E0: ; 80918E0 ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_8091904 - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_80918E0 + thumb_func_end FieldObjectCB_GoInDirectionSequence15 thumb_func_start sub_8091904 sub_8091904: ; 8091904 @@ -254038,7 +254193,7 @@ sub_8091924: ; 8091924 adds r0, r4, 0 adds r1, r5, 0 mov r2, sp - bl sub_809105C + bl MoveFieldObjectInNextDirectionInSequence lsls r0, 24 lsrs r0, 24 add sp, 0x4 @@ -254048,8 +254203,8 @@ sub_8091924: ; 8091924 .pool thumb_func_end sub_8091924 - thumb_func_start sub_809196C -sub_809196C: ; 809196C + thumb_func_start FieldObjectCB_GoInDirectionSequence16 +FieldObjectCB_GoInDirectionSequence16: ; 809196C push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -254060,11 +254215,11 @@ sub_809196C: ; 809196C ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_8091990 - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_809196C + thumb_func_end FieldObjectCB_GoInDirectionSequence16 thumb_func_start sub_8091990 sub_8091990: ; 8091990 @@ -254111,7 +254266,7 @@ sub_80919B0: ; 80919B0 adds r0, r4, 0 adds r1, r5, 0 mov r2, sp - bl sub_809105C + bl MoveFieldObjectInNextDirectionInSequence lsls r0, 24 lsrs r0, 24 add sp, 0x4 @@ -254121,8 +254276,8 @@ sub_80919B0: ; 80919B0 .pool thumb_func_end sub_80919B0 - thumb_func_start sub_80919F8 -sub_80919F8: ; 80919F8 + thumb_func_start FieldObjectCB_GoInDirectionSequence17 +FieldObjectCB_GoInDirectionSequence17: ; 80919F8 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -254133,11 +254288,11 @@ sub_80919F8: ; 80919F8 ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_8091A1C - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_80919F8 + thumb_func_end FieldObjectCB_GoInDirectionSequence17 thumb_func_start sub_8091A1C sub_8091A1C: ; 8091A1C @@ -254184,7 +254339,7 @@ sub_8091A3C: ; 8091A3C adds r0, r4, 0 adds r1, r5, 0 mov r2, sp - bl sub_809105C + bl MoveFieldObjectInNextDirectionInSequence lsls r0, 24 lsrs r0, 24 add sp, 0x4 @@ -254194,8 +254349,8 @@ sub_8091A3C: ; 8091A3C .pool thumb_func_end sub_8091A3C - thumb_func_start sub_8091A84 -sub_8091A84: ; 8091A84 + thumb_func_start FieldObjectCB_GoInDirectionSequence18 +FieldObjectCB_GoInDirectionSequence18: ; 8091A84 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -254206,11 +254361,11 @@ sub_8091A84: ; 8091A84 ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_8091AA8 - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_8091A84 + thumb_func_end FieldObjectCB_GoInDirectionSequence18 thumb_func_start sub_8091AA8 sub_8091AA8: ; 8091AA8 @@ -254257,7 +254412,7 @@ sub_8091AC8: ; 8091AC8 adds r0, r4, 0 adds r1, r5, 0 mov r2, sp - bl sub_809105C + bl MoveFieldObjectInNextDirectionInSequence lsls r0, 24 lsrs r0, 24 add sp, 0x4 @@ -254267,8 +254422,8 @@ sub_8091AC8: ; 8091AC8 .pool thumb_func_end sub_8091AC8 - thumb_func_start sub_8091B10 -sub_8091B10: ; 8091B10 + thumb_func_start FieldObjectCB_GoInDirectionSequence19 +FieldObjectCB_GoInDirectionSequence19: ; 8091B10 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -254279,11 +254434,11 @@ sub_8091B10: ; 8091B10 ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_8091B34 - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_8091B10 + thumb_func_end FieldObjectCB_GoInDirectionSequence19 thumb_func_start sub_8091B34 sub_8091B34: ; 8091B34 @@ -254330,7 +254485,7 @@ sub_8091B54: ; 8091B54 adds r0, r4, 0 adds r1, r5, 0 mov r2, sp - bl sub_809105C + bl MoveFieldObjectInNextDirectionInSequence lsls r0, 24 lsrs r0, 24 add sp, 0x4 @@ -254340,8 +254495,8 @@ sub_8091B54: ; 8091B54 .pool thumb_func_end sub_8091B54 - thumb_func_start sub_8091B9C -sub_8091B9C: ; 8091B9C + thumb_func_start FieldObjectCB_GoInDirectionSequence20 +FieldObjectCB_GoInDirectionSequence20: ; 8091B9C push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -254352,11 +254507,11 @@ sub_8091B9C: ; 8091B9C ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_8091BC0 - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_8091B9C + thumb_func_end FieldObjectCB_GoInDirectionSequence20 thumb_func_start sub_8091BC0 sub_8091BC0: ; 8091BC0 @@ -254403,7 +254558,7 @@ sub_8091BE0: ; 8091BE0 adds r0, r4, 0 adds r1, r5, 0 mov r2, sp - bl sub_809105C + bl MoveFieldObjectInNextDirectionInSequence lsls r0, 24 lsrs r0, 24 add sp, 0x4 @@ -254413,8 +254568,8 @@ sub_8091BE0: ; 8091BE0 .pool thumb_func_end sub_8091BE0 - thumb_func_start sub_8091C28 -sub_8091C28: ; 8091C28 + thumb_func_start FieldObjectCB_GoInDirectionSequence21 +FieldObjectCB_GoInDirectionSequence21: ; 8091C28 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -254425,11 +254580,11 @@ sub_8091C28: ; 8091C28 ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_8091C4C - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_8091C28 + thumb_func_end FieldObjectCB_GoInDirectionSequence21 thumb_func_start sub_8091C4C sub_8091C4C: ; 8091C4C @@ -254476,7 +254631,7 @@ sub_8091C6C: ; 8091C6C adds r0, r4, 0 adds r1, r5, 0 mov r2, sp - bl sub_809105C + bl MoveFieldObjectInNextDirectionInSequence lsls r0, 24 lsrs r0, 24 add sp, 0x4 @@ -254486,8 +254641,8 @@ sub_8091C6C: ; 8091C6C .pool thumb_func_end sub_8091C6C - thumb_func_start sub_8091CB4 -sub_8091CB4: ; 8091CB4 + thumb_func_start FieldObjectCB_GoInDirectionSequence22 +FieldObjectCB_GoInDirectionSequence22: ; 8091CB4 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -254498,11 +254653,11 @@ sub_8091CB4: ; 8091CB4 ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_8091CD8 - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_8091CB4 + thumb_func_end FieldObjectCB_GoInDirectionSequence22 thumb_func_start sub_8091CD8 sub_8091CD8: ; 8091CD8 @@ -254549,7 +254704,7 @@ sub_8091CF8: ; 8091CF8 adds r0, r4, 0 adds r1, r5, 0 mov r2, sp - bl sub_809105C + bl MoveFieldObjectInNextDirectionInSequence lsls r0, 24 lsrs r0, 24 add sp, 0x4 @@ -254559,8 +254714,8 @@ sub_8091CF8: ; 8091CF8 .pool thumb_func_end sub_8091CF8 - thumb_func_start sub_8091D40 -sub_8091D40: ; 8091D40 + thumb_func_start FieldObjectCB_GoInDirectionSequence23 +FieldObjectCB_GoInDirectionSequence23: ; 8091D40 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -254571,11 +254726,11 @@ sub_8091D40: ; 8091D40 ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_8091D64 - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_8091D40 + thumb_func_end FieldObjectCB_GoInDirectionSequence23 thumb_func_start sub_8091D64 sub_8091D64: ; 8091D64 @@ -254622,7 +254777,7 @@ sub_8091D84: ; 8091D84 adds r0, r4, 0 adds r1, r5, 0 mov r2, sp - bl sub_809105C + bl MoveFieldObjectInNextDirectionInSequence lsls r0, 24 lsrs r0, 24 add sp, 0x4 @@ -254632,8 +254787,8 @@ sub_8091D84: ; 8091D84 .pool thumb_func_end sub_8091D84 - thumb_func_start sub_8091DCC -sub_8091DCC: ; 8091DCC + thumb_func_start FieldObjectCB_GoInDirectionSequence24 +FieldObjectCB_GoInDirectionSequence24: ; 8091DCC push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -254644,11 +254799,11 @@ sub_8091DCC: ; 8091DCC ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_8091DF0 - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_8091DCC + thumb_func_end FieldObjectCB_GoInDirectionSequence24 thumb_func_start sub_8091DF0 sub_8091DF0: ; 8091DF0 @@ -254695,7 +254850,7 @@ sub_8091E10: ; 8091E10 adds r0, r4, 0 adds r1, r5, 0 mov r2, sp - bl sub_809105C + bl MoveFieldObjectInNextDirectionInSequence lsls r0, 24 lsrs r0, 24 add sp, 0x4 @@ -254705,8 +254860,8 @@ sub_8091E10: ; 8091E10 .pool thumb_func_end sub_8091E10 - thumb_func_start sub_8091E58 -sub_8091E58: ; 8091E58 + thumb_func_start FieldObjectCB_CopyPlayer1 +FieldObjectCB_CopyPlayer1: ; 8091E58 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -254717,11 +254872,11 @@ sub_8091E58: ; 8091E58 ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_8091E7C - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_8091E58 + thumb_func_end FieldObjectCB_CopyPlayer1 thumb_func_start sub_8091E7C sub_8091E7C: ; 8091E7C @@ -254742,6 +254897,7 @@ sub_8091E7C: ; 8091E7C thumb_func_end sub_8091E7C thumb_func_start mss_npc_reset_oampriv3_1_unk2_unk3 +; BOOL mss_npc_reset_oampriv3_1_unk2_unk3(struct npc_state *fieldObject, struct obj *object) mss_npc_reset_oampriv3_1_unk2_unk3: ; 8091E9C push {r4,r5,lr} adds r4, r0, 0 @@ -254751,7 +254907,7 @@ mss_npc_reset_oampriv3_1_unk2_unk3: ; 8091E9C ldrb r0, [r4] cmp r0, 0 bne @08091EB4 - bl player_get_direction__sp1AA + bl player_get_direction_lower_nybble strb r0, [r4] @08091EB4: movs r0, 0x1 @@ -254762,6 +254918,7 @@ mss_npc_reset_oampriv3_1_unk2_unk3: ; 8091E9C thumb_func_end mss_npc_reset_oampriv3_1_unk2_unk3 thumb_func_start sub_8091EC0 +; BOOL sub_8091EC0(struct npc_state *fieldObject, struct obj *object) sub_8091EC0: ; 8091EC0 push {r4-r7,lr} adds r6, r0, 0 @@ -254790,7 +254947,7 @@ sub_8091EC0: ; 8091EC0 lsls r4, 24 lsrs r4, 22 adds r4, r5 - bl player_get_direction_upper_4bits + bl player_get_direction_upper_nybble adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 @@ -254813,7 +254970,7 @@ sub_8091F20: ; 8091F20 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 - bl npc_obj_exec_an + bl FieldObjectExecRegularAnim lsls r0, 24 cmp r0, 0 beq @08091F3E @@ -254852,13 +255009,13 @@ sub_8091F4C: ; 8091F4C adds r1, 0x21 ldrb r1, [r1] bl state_to_direction - bl d2s_look1 + bl GetFaceDirectionAnimId adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r5, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim ldrb r0, [r4] movs r1, 0x2 orrs r0, r1 @@ -254884,7 +255041,7 @@ sub_8091F94: ; 8091F94 lsls r2, 24 lsrs r5, r2, 24 adds r6, r5, 0 - bl is_faraway_island_mew + bl FieldObjectIsFarawayIslandMew lsls r0, 24 cmp r0, 0 beq @08091FFC @@ -254908,15 +255065,15 @@ sub_8091F94: ; 8091F94 adds r0, r4, 0 adds r1, r5, 0 mov r2, sp - bl npc_move_direction_hypothetical + bl FieldObjectMoveDestCoords adds r0, r5, 0 - bl d2s_look1 + bl GetFaceDirectionAnimId adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r7, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim b @08092084 .pool @08091FFC: @@ -254937,15 +255094,15 @@ sub_8091F94: ; 8091F94 adds r1, r5, 0 mov r2, sp adds r3, r6, 0 - bl npc_move_direction_hypothetical + bl FieldObjectMoveDestCoords adds r0, r5, 0 - bl sub_8093388 + bl GetGoSpeed0AnimId adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r7, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim mov r0, sp movs r2, 0 ldrsh r1, [r0, r2] @@ -254974,13 +255131,13 @@ sub_8091F94: ; 8091F94 bne @08092084 @08092070: adds r0, r5, 0 - bl d2s_look1 + bl GetFaceDirectionAnimId adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r7, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim @08092084: ldrb r0, [r4] movs r1, 0x2 @@ -255025,15 +255182,15 @@ sub_80920A4: ; 80920A4 adds r1, r6, 0 mov r2, sp adds r3, r5, 0 - bl npc_move_direction_hypothetical + bl FieldObjectMoveDestCoords adds r0, r6, 0 - bl sub_80933B4 + bl GetGoSpeed1AnimId adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r7, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim mov r0, sp movs r2, 0 ldrsh r1, [r0, r2] @@ -255062,13 +255219,13 @@ sub_80920A4: ; 80920A4 bne @0809213E @0809212A: adds r0, r6, 0 - bl d2s_look1 + bl GetFaceDirectionAnimId adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r7, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim @0809213E: ldrb r0, [r4] movs r1, 0x2 @@ -255113,15 +255270,15 @@ sub_809215C: ; 809215C adds r1, r6, 0 mov r2, sp adds r3, r5, 0 - bl npc_move_direction_hypothetical + bl FieldObjectMoveDestCoords adds r0, r6, 0 - bl sub_809340C + bl GetGoSpeed3AnimId adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r7, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim mov r0, sp movs r2, 0 ldrsh r1, [r0, r2] @@ -255150,13 +255307,13 @@ sub_809215C: ; 809215C bne @080921F6 @080921E2: adds r0, r6, 0 - bl d2s_look1 + bl GetFaceDirectionAnimId adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r7, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim @080921F6: ldrb r0, [r4] movs r1, 0x2 @@ -255201,7 +255358,7 @@ sub_8092214: ; 8092214 adds r1, r6, 0 mov r2, sp adds r3, r5, 0 - bl npc_move_direction_hypothetical + bl FieldObjectMoveDestCoords adds r0, r6, 0 bl sub_8093438 adds r2, r0, 0 @@ -255209,7 +255366,7 @@ sub_8092214: ; 8092214 lsrs r2, 24 adds r0, r4, 0 adds r1, r7, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim mov r0, sp movs r2, 0 ldrsh r1, [r0, r2] @@ -255238,13 +255395,13 @@ sub_8092214: ; 8092214 bne @080922AE @0809229A: adds r0, r6, 0 - bl d2s_look1 + bl GetFaceDirectionAnimId adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r7, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim @080922AE: ldrb r0, [r4] movs r1, 0x2 @@ -255283,7 +255440,7 @@ cph_IM_DIFFERENT: ; 80922CC lsrs r2, 24 adds r0, r4, 0 adds r1, r5, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim ldrb r0, [r4] movs r1, 0x2 orrs r0, r1 @@ -255324,7 +255481,7 @@ sub_8092314: ; 8092314 adds r1, r6, 0 mov r2, sp adds r3, r5, 0 - bl npc_move_direction_hypothetical + bl FieldObjectMoveDestCoords adds r0, r6, 0 bl sub_8093514 adds r2, r0, 0 @@ -255332,7 +255489,7 @@ sub_8092314: ; 8092314 lsrs r2, 24 adds r0, r4, 0 adds r1, r7, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim mov r0, sp movs r2, 0 ldrsh r1, [r0, r2] @@ -255361,13 +255518,13 @@ sub_8092314: ; 8092314 bne @080923AE @0809239A: adds r0, r6, 0 - bl d2s_look1 + bl GetFaceDirectionAnimId adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r7, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim @080923AE: ldrb r0, [r4] movs r1, 0x2 @@ -255421,13 +255578,13 @@ oac_hopping: ; 80923CC movs r3, 0x2 bl sub_8092F88 adds r0, r6, 0 - bl d2s_08064110 + bl GetJumpLedgeAnimId adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r7, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim add r0, sp, 0x4 movs r2, 0 ldrsh r1, [r0, r2] @@ -255456,13 +255613,13 @@ oac_hopping: ; 80923CC bne @08092474 @08092460: adds r0, r6, 0 - bl d2s_look1 + bl GetFaceDirectionAnimId adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r7, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim @08092474: ldrb r0, [r4] movs r1, 0x2 @@ -255480,8 +255637,8 @@ oac_hopping: ; 80923CC .pool thumb_func_end oac_hopping - thumb_func_start sub_8092494 -sub_8092494: ; 8092494 + thumb_func_start FieldObjectCB_CopyPlayer2 +FieldObjectCB_CopyPlayer2: ; 8092494 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -255492,11 +255649,11 @@ sub_8092494: ; 8092494 ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_80924B8 - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_8092494 + thumb_func_end FieldObjectCB_CopyPlayer2 thumb_func_start sub_80924B8 sub_80924B8: ; 80924B8 @@ -255545,7 +255702,7 @@ mss_08062EA4: ; 80924D8 lsls r4, 24 lsrs r4, 22 adds r4, r5 - bl player_get_direction_upper_4bits + bl player_get_direction_upper_nybble adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 @@ -255563,8 +255720,9 @@ mss_08062EA4: ; 80924D8 .pool thumb_func_end mss_08062EA4 - thumb_func_start do_ninja_boy_tree_disguise -do_ninja_boy_tree_disguise: ; 809253C + thumb_func_start FieldObjectCB_TreeDisguise +; void FieldObjectCB_TreeDisguise(struct obj *object) +FieldObjectCB_TreeDisguise: ; 809253C push {r4-r6,lr} adds r5, r0, 0 movs r1, 0x2E @@ -255591,7 +255749,7 @@ do_ninja_boy_tree_disguise: ; 809253C adds r3, r1, 0 adds r3, 0x8 adds r0, r4, 0 - bl npc_get_local_id_and_mapnumbers + bl FieldObjectGetLocalIdAndMap movs r0, 0x1C bl FieldEffectStart strb r0, [r4, 0x1A] @@ -255610,12 +255768,12 @@ do_ninja_boy_tree_disguise: ; 809253C adds r0, r1 ldr r2, =sub_80925AC adds r1, r5, 0 - bl meta_step + bl FieldObjectStep pop {r4-r6} pop {r0} bx r0 .pool - thumb_func_end do_ninja_boy_tree_disguise + thumb_func_end FieldObjectCB_TreeDisguise thumb_func_start sub_80925AC sub_80925AC: ; 80925AC @@ -255626,8 +255784,8 @@ sub_80925AC: ; 80925AC bx r1 thumb_func_end sub_80925AC - thumb_func_start do_ninja_boy_mountain_disguise -do_ninja_boy_mountain_disguise: ; 80925B8 + thumb_func_start FieldObjectCB_MountainDisguise +FieldObjectCB_MountainDisguise: ; 80925B8 push {r4-r6,lr} adds r5, r0, 0 movs r1, 0x2E @@ -255654,7 +255812,7 @@ do_ninja_boy_mountain_disguise: ; 80925B8 adds r3, r1, 0 adds r3, 0x8 adds r0, r4, 0 - bl npc_get_local_id_and_mapnumbers + bl FieldObjectGetLocalIdAndMap movs r0, 0x1D bl FieldEffectStart strb r0, [r4, 0x1A] @@ -255673,15 +255831,16 @@ do_ninja_boy_mountain_disguise: ; 80925B8 adds r0, r1 ldr r2, =sub_80925AC adds r1, r5, 0 - bl meta_step + bl FieldObjectStep pop {r4-r6} pop {r0} bx r0 .pool - thumb_func_end do_ninja_boy_mountain_disguise + thumb_func_end FieldObjectCB_MountainDisguise - thumb_func_start sub_8092628 -sub_8092628: ; 8092628 + thumb_func_start FieldObjectCB_Hidden1 +; void FieldObjectCB_Hidden1(struct obj *object) +FieldObjectCB_Hidden1: ; 8092628 push {r4,lr} adds r3, r0, 0 movs r1, 0x3C @@ -255723,12 +255882,12 @@ sub_8092628: ; 8092628 adds r0, r4 ldr r2, =sub_809268C adds r1, r3, 0 - bl meta_step + bl FieldObjectStep pop {r4} pop {r0} bx r0 .pool - thumb_func_end sub_8092628 + thumb_func_end FieldObjectCB_Hidden1 thumb_func_start sub_809268C sub_809268C: ; 809268C @@ -255758,10 +255917,11 @@ sub_80926AC: ; 80926AC thumb_func_end sub_80926AC thumb_func_start sub_80926B8 +; BOOL sub_80926B8(struct npc_state *fieldObject, struct obj *object) sub_80926B8: ; 80926B8 push {r4,lr} adds r4, r1, 0 - bl npc_obj_exec_an + bl FieldObjectExecRegularAnim lsls r0, 24 cmp r0, 0 beq @080926CA @@ -255774,8 +255934,8 @@ sub_80926B8: ; 80926B8 bx r1 thumb_func_end sub_80926B8 - thumb_func_start sub_80926D4 -sub_80926D4: ; 80926D4 + thumb_func_start FieldObjectCB_WalkInPlace1 +FieldObjectCB_WalkInPlace1: ; 80926D4 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -255786,11 +255946,11 @@ sub_80926D4: ; 80926D4 ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_80926F8 - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_80926D4 + thumb_func_end FieldObjectCB_WalkInPlace1 thumb_func_start sub_80926F8 sub_80926F8: ; 80926F8 @@ -255819,13 +255979,13 @@ sub_8092718: ; 8092718 ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 - bl d2s_08064244 + bl GetStepInPlaceDelay16AnimId adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r5, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim movs r0, 0x1 strh r0, [r5, 0x30] pop {r4,r5} @@ -255833,8 +255993,8 @@ sub_8092718: ; 8092718 bx r1 thumb_func_end sub_8092718 - thumb_func_start sub_8092744 -sub_8092744: ; 8092744 + thumb_func_start FieldObjectCB_WalkInPlace4 +FieldObjectCB_WalkInPlace4: ; 8092744 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -255845,11 +256005,11 @@ sub_8092744: ; 8092744 ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_8092768 - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_8092744 + thumb_func_end FieldObjectCB_WalkInPlace4 thumb_func_start sub_8092768 sub_8092768: ; 8092768 @@ -255878,13 +256038,13 @@ sub_8092788: ; 8092788 ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 - bl sub_809356C + bl GetStepInPlaceDelay32AnimId adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r5, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim movs r0, 0x1 strh r0, [r5, 0x30] pop {r4,r5} @@ -255892,8 +256052,8 @@ sub_8092788: ; 8092788 bx r1 thumb_func_end sub_8092788 - thumb_func_start sub_80927B4 -sub_80927B4: ; 80927B4 + thumb_func_start FieldObjectCB_WalkInPlace2 +FieldObjectCB_WalkInPlace2: ; 80927B4 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -255904,11 +256064,11 @@ sub_80927B4: ; 80927B4 ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_80927D8 - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_80927B4 + thumb_func_end FieldObjectCB_WalkInPlace2 thumb_func_start sub_80927D8 sub_80927D8: ; 80927D8 @@ -255929,6 +256089,7 @@ sub_80927D8: ; 80927D8 thumb_func_end sub_80927D8 thumb_func_start sub_80927F8 +; BOOL sub_80927F8(struct npc_state *fieldObject, struct obj *object) sub_80927F8: ; 80927F8 push {r4,r5,lr} adds r4, r0, 0 @@ -255937,13 +256098,13 @@ sub_80927F8: ; 80927F8 ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 - bl sub_80935C4 + bl GetStepInPlaceDelay8AnimId adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r5, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim movs r0, 0x1 strh r0, [r5, 0x30] pop {r4,r5} @@ -255951,8 +256112,8 @@ sub_80927F8: ; 80927F8 bx r1 thumb_func_end sub_80927F8 - thumb_func_start sub_8092824 -sub_8092824: ; 8092824 + thumb_func_start FieldObjectCB_WalkInPlace3 +FieldObjectCB_WalkInPlace3: ; 8092824 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -255963,11 +256124,11 @@ sub_8092824: ; 8092824 ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_8092848 - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_8092824 + thumb_func_end FieldObjectCB_WalkInPlace3 thumb_func_start sub_8092848 sub_8092848: ; 8092848 @@ -255996,13 +256157,13 @@ sub_8092868: ; 8092868 ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 - bl sub_80935F0 + bl GetStepInPlaceDelay4AnimId adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r5, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim movs r0, 0x1 strh r0, [r5, 0x30] pop {r4,r5} @@ -256010,8 +256171,8 @@ sub_8092868: ; 8092868 bx r1 thumb_func_end sub_8092868 - thumb_func_start sub_8092894 -sub_8092894: ; 8092894 + thumb_func_start FieldObjectCB_Hidden2 +FieldObjectCB_Hidden2: ; 8092894 push {lr} adds r1, r0, 0 movs r0, 0x2E @@ -256022,11 +256183,11 @@ sub_8092894: ; 8092894 ldr r2, =0x02037350 adds r0, r2 ldr r2, =sub_80928B8 - bl meta_step + bl FieldObjectStep pop {r0} bx r0 .pool - thumb_func_end sub_8092894 + thumb_func_end FieldObjectCB_Hidden2 thumb_func_start sub_80928B8 sub_80928B8: ; 80928B8 @@ -256055,13 +256216,13 @@ sub_80928D8: ; 80928D8 ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 - bl d2s_look1 + bl GetFaceDirectionAnimId adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r5, 0 - bl npc_set_state_and_pq_record + bl FieldObjectSetRegularAnim ldrb r0, [r4, 0x1] movs r1, 0x20 orrs r0, r1 @@ -256077,7 +256238,7 @@ sub_80928D8: ; 80928D8 sub_809290C: ; 809290C push {r4,lr} adds r4, r1, 0 - bl npc_obj_exec_an + bl FieldObjectExecRegularAnim lsls r0, 24 cmp r0, 0 bne @0809291E @@ -256105,6 +256266,7 @@ sub_809292C: ; 809292C thumb_func_end sub_809292C thumb_func_start npc_reset +; void npc_reset(struct npc_state *fieldObject, struct obj *object) npc_reset: ; 809293C ldrb r3, [r0] movs r2, 0x3 @@ -256123,8 +256285,9 @@ npc_reset: ; 809293C bx lr thumb_func_end npc_reset - thumb_func_start npc_direction_to_obj_anim_image_number -npc_direction_to_obj_anim_image_number: ; 809295C + thumb_func_start FieldObjectDirectionToImageAnimId +; u8 FieldObjectDirectionToImageAnimId(u8 direction) +FieldObjectDirectionToImageAnimId: ; 809295C lsls r0, 24 lsrs r0, 24 ldr r1, =gUnknown_0850DACC @@ -256132,10 +256295,10 @@ npc_direction_to_obj_anim_image_number: ; 809295C ldrb r0, [r0] bx lr .pool - thumb_func_end npc_direction_to_obj_anim_image_number + thumb_func_end FieldObjectDirectionToImageAnimId - thumb_func_start an_run_any__impl_pulse -an_run_any__impl_pulse: ; 809296C + thumb_func_start get_go_image_anim_num +get_go_image_anim_num: ; 809296C lsls r0, 24 lsrs r0, 24 ldr r1, =gUnknown_0850DAD5 @@ -256143,10 +256306,10 @@ an_run_any__impl_pulse: ; 809296C ldrb r0, [r0] bx lr .pool - thumb_func_end an_run_any__impl_pulse + thumb_func_end get_go_image_anim_num - thumb_func_start sub_809297C -sub_809297C: ; 809297C + thumb_func_start get_go_fast_image_anim_num +get_go_fast_image_anim_num: ; 809297C lsls r0, 24 lsrs r0, 24 ldr r1, =gUnknown_0850DADE @@ -256154,10 +256317,10 @@ sub_809297C: ; 809297C ldrb r0, [r0] bx lr .pool - thumb_func_end sub_809297C + thumb_func_end get_go_fast_image_anim_num - thumb_func_start sub_809298C -sub_809298C: ; 809298C + thumb_func_start get_go_faster_image_anim_num +get_go_faster_image_anim_num: ; 809298C lsls r0, 24 lsrs r0, 24 ldr r1, =gUnknown_0850DAE7 @@ -256165,10 +256328,10 @@ sub_809298C: ; 809298C ldrb r0, [r0] bx lr .pool - thumb_func_end sub_809298C + thumb_func_end get_go_faster_image_anim_num - thumb_func_start sub_809299C -sub_809299C: ; 809299C + thumb_func_start get_go_fastest_image_anim_num +get_go_fastest_image_anim_num: ; 809299C lsls r0, 24 lsrs r0, 24 ldr r1, =gUnknown_0850DAF0 @@ -256176,7 +256339,7 @@ sub_809299C: ; 809299C ldrb r0, [r0] bx lr .pool - thumb_func_end sub_809299C + thumb_func_end get_go_fastest_image_anim_num thumb_func_start sub_80929AC sub_80929AC: ; 80929AC @@ -256277,8 +256440,8 @@ sub_8092A2C: ; 8092A2C .pool thumb_func_end sub_8092A2C - thumb_func_start sub_8092A3C -sub_8092A3C: ; 8092A3C + thumb_func_start get_run_image_anim_num +get_run_image_anim_num: ; 8092A3C lsls r0, 24 lsrs r0, 24 ldr r1, =gUnknown_0850DB4A @@ -256286,7 +256449,7 @@ sub_8092A3C: ; 8092A3C ldrb r0, [r0] bx lr .pool - thumb_func_end sub_8092A3C + thumb_func_end get_run_image_anim_num thumb_func_start sub_8092A4C sub_8092A4C: ; 8092A4C @@ -256314,6 +256477,7 @@ sub_8092A4C: ; 8092A4C thumb_func_end sub_8092A4C thumb_func_start npc_apply_anim_looping +; void npc_apply_anim_looping(struct npc_state *fieldObject, struct obj *object, u8 anim) npc_apply_anim_looping: ; 8092A70 push {r4,lr} adds r4, r1, 0 @@ -256356,6 +256520,7 @@ npc_apply_anim_looping: ; 8092A70 thumb_func_end npc_apply_anim_looping thumb_func_start obj_npc_animation_step +; void obj_npc_animation_step(struct npc_state *fieldObject, struct obj *object, u8 anim) obj_npc_animation_step: ; 8092AB8 push {r4,lr} adds r4, r1, 0 @@ -256491,7 +256656,7 @@ sub_8092B88: ; 8092B88 adds r0, r5, 0 mov r1, sp adds r2, r4, 0 - bl numbers_move_direction + bl MoveCoords mov r0, sp movs r2, 0 ldrsh r1, [r0, r2] @@ -256509,6 +256674,7 @@ sub_8092B88: ; 8092B88 thumb_func_end sub_8092B88 thumb_func_start npc_block_way +; u8 npc_block_way(struct npc_state *fieldObject, u16 x, u16 y, u8 direction) npc_block_way: ; 8092BC8 push {r4-r7,lr} mov r7, r10 @@ -256530,7 +256696,7 @@ npc_block_way: ; 8092BC8 adds r0, r6, 0 adds r1, r5, 0 adds r2, r4, 0 - bl npc_is_outside_of_rectangle_or_map + bl IsCoordOutsideFieldObjectMovementRect lsls r0, 24 cmp r0, 0 beq @08092BFE @@ -256539,13 +256705,13 @@ npc_block_way: ; 8092BC8 @08092BFE: adds r0, r5, 0 adds r1, r4, 0 - bl cur_mapdata_get_middle2bit_at + bl MapGridIsImpassableAt lsls r0, 24 cmp r0, 0 bne @08092C40 adds r0, r5, 0 adds r1, r4, 0 - bl mapborder_visible_from_position + bl GetMapBorderIdAt movs r1, 0x1 negs r1, r1 cmp r0, r1 @@ -256554,7 +256720,7 @@ npc_block_way: ; 8092BC8 adds r1, r5, 0 adds r2, r4, 0 adds r3, r7, 0 - bl tile_x30_to_x37_related + bl IsMetatileDirectionallyImpassable lsls r0, 24 cmp r0, 0 bne @08092C40 @@ -256563,7 +256729,7 @@ npc_block_way: ; 8092BC8 cmp r0, 0 beq @08092C44 mov r0, r8 - bl sub_80887B0 + bl CanCameraMoveInDirection cmp r0, 0 bne @08092C44 @08092C40: @@ -256581,7 +256747,7 @@ npc_block_way: ; 8092BC8 asrs r4, r1, 16 adds r1, r5, 0 adds r2, r4, 0 - bl cur_mapdata_height_mismatch + bl IsZCoordMismatchAt lsls r0, 24 cmp r0, 0 beq @08092C68 @@ -256591,7 +256757,7 @@ npc_block_way: ; 8092BC8 adds r0, r6, 0 adds r1, r5, 0 adds r2, r4, 0 - bl is_there_a_npc_to_interact_with + bl CheckForCollisionBetweenFieldObjects lsls r0, 24 cmp r0, 0 bne @08092C7C @@ -256631,7 +256797,7 @@ sub_8092C8C: ; 8092C8C adds r0, r7, 0 adds r1, r6, 0 adds r2, r5, 0 - bl npc_is_outside_of_rectangle_or_map + bl IsCoordOutsideFieldObjectMovementRect lsls r0, 24 lsrs r0, 24 negs r1, r0 @@ -256639,13 +256805,13 @@ sub_8092C8C: ; 8092C8C lsrs r4, r1, 31 adds r0, r6, 0 adds r1, r5, 0 - bl cur_mapdata_get_middle2bit_at + bl MapGridIsImpassableAt lsls r0, 24 cmp r0, 0 bne @08092D04 adds r0, r6, 0 adds r1, r5, 0 - bl mapborder_visible_from_position + bl GetMapBorderIdAt movs r1, 0x1 negs r1, r1 cmp r0, r1 @@ -256654,7 +256820,7 @@ sub_8092C8C: ; 8092C8C adds r1, r6, 0 adds r2, r5, 0 mov r3, r8 - bl tile_x30_to_x37_related + bl IsMetatileDirectionallyImpassable lsls r0, 24 cmp r0, 0 bne @08092D04 @@ -256663,7 +256829,7 @@ sub_8092C8C: ; 8092C8C cmp r0, 0 beq @08092D08 mov r0, r8 - bl sub_80887B0 + bl CanCameraMoveInDirection cmp r0, 0 bne @08092D08 @08092D04: @@ -256681,7 +256847,7 @@ sub_8092C8C: ; 8092C8C asrs r5, r1, 16 adds r1, r6, 0 adds r2, r5, 0 - bl cur_mapdata_height_mismatch + bl IsZCoordMismatchAt lsls r0, 24 cmp r0, 0 beq @08092D30 @@ -256693,7 +256859,7 @@ sub_8092C8C: ; 8092C8C adds r0, r7, 0 adds r1, r6, 0 adds r2, r5, 0 - bl is_there_a_npc_to_interact_with + bl CheckForCollisionBetweenFieldObjects lsls r0, 24 cmp r0, 0 beq @08092D48 @@ -256712,8 +256878,9 @@ sub_8092C8C: ; 8092C8C bx r1 thumb_func_end sub_8092C8C - thumb_func_start npc_is_outside_of_rectangle_or_map -npc_is_outside_of_rectangle_or_map: ; 8092D58 + thumb_func_start IsCoordOutsideFieldObjectMovementRect +; BOOL IsCoordOutsideFieldObjectMovementRect(struct npc_state *fieldObject, u16 x, u16 y) +IsCoordOutsideFieldObjectMovementRect: ; 8092D58 push {r4,r5,lr} adds r4, r0, 0 lsls r1, 16 @@ -256774,10 +256941,11 @@ npc_is_outside_of_rectangle_or_map: ; 8092D58 pop {r4,r5} pop {r1} bx r1 - thumb_func_end npc_is_outside_of_rectangle_or_map + thumb_func_end IsCoordOutsideFieldObjectMovementRect - thumb_func_start tile_x30_to_x37_related -tile_x30_to_x37_related: ; 8092DC8 + thumb_func_start IsMetatileDirectionallyImpassable +; BOOL IsMetatileDirectionallyImpassable(struct npc_state *fieldObject, u16 x, u16 y, u8 direction) +IsMetatileDirectionallyImpassable: ; 8092DC8 push {r4-r7,lr} lsls r1, 16 lsrs r6, r1, 16 @@ -256818,10 +256986,11 @@ tile_x30_to_x37_related: ; 8092DC8 pop {r4-r7} pop {r1} bx r1 - thumb_func_end tile_x30_to_x37_related + thumb_func_end IsMetatileDirectionallyImpassable - thumb_func_start is_there_a_npc_to_interact_with -is_there_a_npc_to_interact_with: ; 8092E20 + thumb_func_start CheckForCollisionBetweenFieldObjects +; BOOL CheckForCollisionBetweenFieldObjects(struct npc_state *fieldObject, u16 x, u16 y) +CheckForCollisionBetweenFieldObjects: ; 8092E20 push {r4-r7,lr} adds r6, r0, 0 lsls r1, 16 @@ -256867,7 +257036,7 @@ is_there_a_npc_to_interact_with: ; 8092E20 ldrb r1, [r2, 0xB] lsls r1, 28 lsrs r1, 28 - bl r0r1_zero_or_same + bl AreZCoordsCompatible lsls r0, 24 cmp r0, 0 beq @08092E88 @@ -256885,7 +257054,7 @@ is_there_a_npc_to_interact_with: ; 8092E20 pop {r4-r7} pop {r1} bx r1 - thumb_func_end is_there_a_npc_to_interact_with + thumb_func_end CheckForCollisionBetweenFieldObjects thumb_func_start sub_8092E9C sub_8092E9C: ; 8092E9C @@ -256898,7 +257067,7 @@ sub_8092E9C: ; 8092E9C lsls r2, 24 lsrs r2, 24 mov r3, sp - bl npc_id_by_local_id_and_map_ret_success + bl TryGetFieldObjectIdByLocalIdAndMap lsls r0, 24 cmp r0, 0 bne @08092EE8 @@ -256942,7 +257111,7 @@ sub_8092EF0: ; 8092EF0 lsls r2, 24 lsrs r2, 24 mov r3, sp - bl npc_id_by_local_id_and_map_ret_success + bl TryGetFieldObjectIdByLocalIdAndMap lsls r0, 24 cmp r0, 0 bne @08092F2E @@ -256970,8 +257139,9 @@ sub_8092EF0: ; 8092EF0 .pool thumb_func_end sub_8092EF0 - thumb_func_start numbers_move_direction -numbers_move_direction: ; 8092F3C + thumb_func_start MoveCoords +; void MoveCoords(u8 direction, u16 *x, u16 *y) +MoveCoords: ; 8092F3C push {r4,lr} lsls r0, 24 ldr r3, =gUnknown_0850DB7C @@ -256989,7 +257159,7 @@ numbers_move_direction: ; 8092F3C pop {r0} bx r0 .pool - thumb_func_end numbers_move_direction + thumb_func_end MoveCoords thumb_func_start sub_8092F60 sub_8092F60: ; 8092F60 @@ -257228,8 +257398,9 @@ sub_80930E0: ; 80930E0 bx r0 thumb_func_end sub_80930E0 - thumb_func_start sub_809312C -sub_809312C: ; 809312C + thumb_func_start GetFieldObjectMovingCameraOffset +; void GetFieldObjectMovingCameraOffset(s16 *x, s16 *y) +GetFieldObjectMovingCameraOffset: ; 809312C push {lr} adds r2, r0, 0 movs r0, 0 @@ -257265,10 +257436,11 @@ sub_809312C: ; 809312C pop {r0} bx r0 .pool - thumb_func_end sub_809312C + thumb_func_end GetFieldObjectMovingCameraOffset - thumb_func_start npc_move_direction_hypothetical -npc_move_direction_hypothetical: ; 809316C + thumb_func_start FieldObjectMoveDestCoords +; void FieldObjectMoveDestCoords(struct npc_state *fieldObject, u8 direction) +FieldObjectMoveDestCoords: ; 809316C push {r4,lr} lsls r1, 24 lsrs r1, 24 @@ -257279,14 +257451,15 @@ npc_move_direction_hypothetical: ; 809316C adds r0, r1, 0 adds r1, r2, 0 adds r2, r3, 0 - bl numbers_move_direction + bl MoveCoords pop {r4} pop {r0} bx r0 - thumb_func_end npc_move_direction_hypothetical + thumb_func_end FieldObjectMoveDestCoords - thumb_func_start npc_is_visible_or_is_x40 -npc_is_visible_or_is_x40: ; 809318C + thumb_func_start FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive +; BOOL FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive(struct npc_state *fieldObject) +FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive: ; 809318C push {lr} ldrb r1, [r0] movs r0, 0x42 @@ -257300,10 +257473,11 @@ npc_is_visible_or_is_x40: ; 809318C @0809319E: pop {r1} bx r1 - thumb_func_end npc_is_visible_or_is_x40 + thumb_func_end FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive - thumb_func_start npc_is_state_set_and_valid -npc_is_state_set_and_valid: ; 80931A4 + thumb_func_start FieldObjectIsSpecialAnimActive +; BOOL FieldObjectIsSpecialAnimActive(struct npc_state *fieldObject) +FieldObjectIsSpecialAnimActive: ; 80931A4 push {lr} adds r1, r0, 0 ldrb r0, [r1] @@ -257320,15 +257494,16 @@ npc_is_state_set_and_valid: ; 80931A4 @080931BC: pop {r1} bx r1 - thumb_func_end npc_is_state_set_and_valid + thumb_func_end FieldObjectIsSpecialAnimActive - thumb_func_start npc_set_state_2 -npc_set_state_2: ; 80931C0 + thumb_func_start FieldObjectSetSpecialAnim +; BOOL FieldObjectSetSpecialAnim(struct npc_state *fieldObject, u8 animId) +FieldObjectSetSpecialAnim: ; 80931C0 push {r4-r6,lr} adds r4, r0, 0 lsls r1, 24 lsrs r5, r1, 24 - bl npc_is_visible_or_is_x40 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive lsls r0, 24 lsrs r6, r0, 24 cmp r6, 0 @@ -257358,25 +257533,27 @@ npc_set_state_2: ; 80931C0 pop {r4-r6} pop {r1} bx r1 - thumb_func_end npc_set_state_2 + thumb_func_end FieldObjectSetSpecialAnim - thumb_func_start sub_8093208 -sub_8093208: ; 8093208 + thumb_func_start FieldObjectForceSetSpecialAnim +; void FieldObjectForceSetSpecialAnim(struct npc_state *fieldObject, u8 animId) +FieldObjectForceSetSpecialAnim: ; 8093208 push {r4,r5,lr} adds r5, r0, 0 lsls r4, r1, 24 lsrs r4, 24 - bl npc_hide_and_trainer_flag_clear_on_tile_x66_at_pos + bl FieldObjectClearAnimIfSpecialAnimActive adds r0, r5, 0 adds r1, r4, 0 - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim pop {r4,r5} pop {r0} bx r0 - thumb_func_end sub_8093208 + thumb_func_end FieldObjectForceSetSpecialAnim - thumb_func_start npc_hide_and_trainer_flag_clear_on_tile_x66_at_pos -npc_hide_and_trainer_flag_clear_on_tile_x66_at_pos: ; 8093224 + thumb_func_start FieldObjectClearAnimIfSpecialAnimActive +; void FieldObjectClearAnimIfSpecialAnimActive(struct npc_state *fieldObject) +FieldObjectClearAnimIfSpecialAnimActive: ; 8093224 push {lr} adds r1, r0, 0 ldrb r0, [r1] @@ -257384,14 +257561,15 @@ npc_hide_and_trainer_flag_clear_on_tile_x66_at_pos: ; 8093224 cmp r0, 0 bge @08093236 adds r0, r1, 0 - bl rom_npc_by_local_id_and_map_get_trainer_flag + bl FieldObjectClearAnim @08093236: pop {r0} bx r0 - thumb_func_end npc_hide_and_trainer_flag_clear_on_tile_x66_at_pos + thumb_func_end FieldObjectClearAnimIfSpecialAnimActive - thumb_func_start rom_npc_by_local_id_and_map_get_trainer_flag -rom_npc_by_local_id_and_map_get_trainer_flag: ; 809323C + thumb_func_start FieldObjectClearAnim +; void FieldObjectClearAnim(struct npc_state *fieldObject) +FieldObjectClearAnim: ; 809323C movs r1, 0xFF strb r1, [r0, 0x1C] ldrb r2, [r0] @@ -257417,10 +257595,11 @@ rom_npc_by_local_id_and_map_get_trainer_flag: ; 809323C strh r2, [r0, 0x32] bx lr .pool - thumb_func_end rom_npc_by_local_id_and_map_get_trainer_flag + thumb_func_end FieldObjectClearAnim - thumb_func_start npc_get_bit7_or_const_x10_when_inactive -npc_get_bit7_or_const_x10_when_inactive: ; 8093270 + thumb_func_start FieldObjectCheckIfSpecialAnimFinishedOrInactive +; u8 FieldObjectCheckIfSpecialAnimFinishedOrInactive(struct npc_state *fieldObject) +FieldObjectCheckIfSpecialAnimFinishedOrInactive: ; 8093270 push {lr} ldrb r1, [r0] lsls r0, r1, 25 @@ -257433,13 +257612,14 @@ npc_get_bit7_or_const_x10_when_inactive: ; 8093270 @08093280: pop {r1} bx r1 - thumb_func_end npc_get_bit7_or_const_x10_when_inactive + thumb_func_end FieldObjectCheckIfSpecialAnimFinishedOrInactive - thumb_func_start sub_8093284 -sub_8093284: ; 8093284 + thumb_func_start FieldObjectClearAnimIfSpecialAnimFinished +; u8 FieldObjectClearAnimIfSpecialAnimFinished(struct npc_state *fieldObject) +FieldObjectClearAnimIfSpecialAnimFinished: ; 8093284 push {r4,r5,lr} adds r5, r0, 0 - bl npc_get_bit7_or_const_x10_when_inactive + bl FieldObjectCheckIfSpecialAnimFinishedOrInactive lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 @@ -257447,16 +257627,17 @@ sub_8093284: ; 8093284 cmp r4, 0x10 beq @0809329E adds r0, r5, 0 - bl npc_hide_and_trainer_flag_clear_on_tile_x66_at_pos + bl FieldObjectClearAnimIfSpecialAnimActive @0809329E: adds r0, r4, 0 pop {r4,r5} pop {r1} bx r1 - thumb_func_end sub_8093284 + thumb_func_end FieldObjectClearAnimIfSpecialAnimFinished - thumb_func_start npc_get_state_or_xFF -npc_get_state_or_xFF: ; 80932A8 + thumb_func_start FieldObjectGetSpecialAnim +; u8 FieldObjectGetSpecialAnim(struct npc_state *fieldObject) +FieldObjectGetSpecialAnim: ; 80932A8 push {lr} adds r1, r0, 0 ldrb r0, [r1] @@ -257470,27 +257651,27 @@ npc_get_state_or_xFF: ; 80932A8 @080932BA: pop {r1} bx r1 - thumb_func_end npc_get_state_or_xFF + thumb_func_end FieldObjectGetSpecialAnim - thumb_func_start meta_step -; void meta_step(npc_state *npcState, int a2, int func_ptr) -meta_step: ; 80932C0 + thumb_func_start FieldObjectStep +; void FieldObjectStep(struct npc_state *fieldObject, struct obj *object, BOOL ( *callback)(struct npc_state *fieldObject, struct obj *object)) +FieldObjectStep: ; 80932C0 push {r4-r6,lr} adds r4, r0, 0 adds r5, r1, 0 adds r6, r2, 0 - bl dp03_something_2 + bl DoGroundEffects_OnSpawn adds r0, r4, 0 adds r1, r5, 0 bl sub_80964E8 adds r0, r4, 0 - bl npc_is_state_set_and_valid + bl FieldObjectIsSpecialAnimActive lsls r0, 24 cmp r0, 0 beq @080932EA adds r0, r4, 0 adds r1, r5, 0 - bl npc_obj_exec_an_2 + bl FieldObjectExecSpecialAnim b @08093300 @080932EA: ldrb r0, [r4, 0x1] @@ -257507,10 +257688,10 @@ meta_step: ; 80932C0 @08093300: adds r0, r4, 0 adds r1, r5, 0 - bl dp03_something + bl DoGroundEffects_OnBeginStep adds r0, r4, 0 adds r1, r5, 0 - bl ground_effects + bl DoGroundEffects_OnFinishStep adds r0, r4, 0 adds r1, r5, 0 bl npc_obj_transfer_image_anim_pause_flag @@ -257519,14 +257700,15 @@ meta_step: ; 80932C0 bl sub_8096518 adds r0, r4, 0 adds r1, r5, 0 - bl npc_y_height_related_ + bl FieldObjectUpdateSubpriority pop {r4-r6} pop {r0} bx r0 - thumb_func_end meta_step + thumb_func_end FieldObjectStep - thumb_func_start d2s_look1 -d2s_look1: ; 8093330 + thumb_func_start GetFaceDirectionAnimId +; u8 GetFaceDirectionAnimId(u8 direction) +GetFaceDirectionAnimId: ; 8093330 push {r4,lr} sub sp, 0x8 lsls r0, 24 @@ -257547,10 +257729,11 @@ d2s_look1: ; 8093330 pop {r1} bx r1 .pool - thumb_func_end d2s_look1 + thumb_func_end GetFaceDirectionAnimId - thumb_func_start d2s_walk -d2s_walk: ; 809335C + thumb_func_start GetSimpleGoAnimId +; u8 GetSimpleGoAnimId(u8 direction) +GetSimpleGoAnimId: ; 809335C push {r4,lr} sub sp, 0x8 lsls r0, 24 @@ -257571,10 +257754,11 @@ d2s_walk: ; 809335C pop {r1} bx r1 .pool - thumb_func_end d2s_walk + thumb_func_end GetSimpleGoAnimId - thumb_func_start sub_8093388 -sub_8093388: ; 8093388 + thumb_func_start GetGoSpeed0AnimId +; u8 GetGoSpeed0AnimId(u8 direction) +GetGoSpeed0AnimId: ; 8093388 push {r4,lr} sub sp, 0x8 lsls r0, 24 @@ -257595,10 +257779,11 @@ sub_8093388: ; 8093388 pop {r1} bx r1 .pool - thumb_func_end sub_8093388 + thumb_func_end GetGoSpeed0AnimId - thumb_func_start sub_80933B4 -sub_80933B4: ; 80933B4 + thumb_func_start GetGoSpeed1AnimId +; u8 GetGoSpeed1AnimId(u8 direction) +GetGoSpeed1AnimId: ; 80933B4 push {r4,lr} sub sp, 0x8 lsls r0, 24 @@ -257619,10 +257804,11 @@ sub_80933B4: ; 80933B4 pop {r1} bx r1 .pool - thumb_func_end sub_80933B4 + thumb_func_end GetGoSpeed1AnimId - thumb_func_start sub_80933E0 -sub_80933E0: ; 80933E0 + thumb_func_start GetGoSpeed2AnimId +; u8 GetGoSpeed2AnimId(u8 direction) +GetGoSpeed2AnimId: ; 80933E0 push {r4,lr} sub sp, 0x8 lsls r0, 24 @@ -257643,10 +257829,11 @@ sub_80933E0: ; 80933E0 pop {r1} bx r1 .pool - thumb_func_end sub_80933E0 + thumb_func_end GetGoSpeed2AnimId - thumb_func_start sub_809340C -sub_809340C: ; 809340C + thumb_func_start GetGoSpeed3AnimId +; u8 GetGoSpeed3AnimId(u8 direction) +GetGoSpeed3AnimId: ; 809340C push {r4,lr} sub sp, 0x8 lsls r0, 24 @@ -257667,9 +257854,10 @@ sub_809340C: ; 809340C pop {r1} bx r1 .pool - thumb_func_end sub_809340C + thumb_func_end GetGoSpeed3AnimId thumb_func_start sub_8093438 +; u8 sub_8093438(u8 direction) sub_8093438: ; 8093438 push {r4,lr} sub sp, 0x8 @@ -257693,8 +257881,9 @@ sub_8093438: ; 8093438 .pool thumb_func_end sub_8093438 - thumb_func_start sub_8093464 -sub_8093464: ; 8093464 + thumb_func_start GetRunAnimId +; u8 GetRunAnimId(u8 direction) +GetRunAnimId: ; 8093464 push {r4,lr} sub sp, 0x8 lsls r0, 24 @@ -257715,10 +257904,11 @@ sub_8093464: ; 8093464 pop {r1} bx r1 .pool - thumb_func_end sub_8093464 + thumb_func_end GetRunAnimId - thumb_func_start d2s_08064110 -d2s_08064110: ; 8093490 + thumb_func_start GetJumpLedgeAnimId +; u8 GetJumpLedgeAnimId(u8 direction) +GetJumpLedgeAnimId: ; 8093490 push {r4,lr} sub sp, 0x8 lsls r0, 24 @@ -257739,9 +257929,10 @@ d2s_08064110: ; 8093490 pop {r1} bx r1 .pool - thumb_func_end d2s_08064110 + thumb_func_end GetJumpLedgeAnimId thumb_func_start sub_80934BC +; u8 sub_80934BC(u8 direction) sub_80934BC: ; 80934BC push {r4,lr} sub sp, 0x8 @@ -257766,6 +257957,7 @@ sub_80934BC: ; 80934BC thumb_func_end sub_80934BC thumb_func_start sub_80934E8 +; u8 sub_80934E8(u8 direction) sub_80934E8: ; 80934E8 push {r4,lr} sub sp, 0x8 @@ -257790,6 +257982,7 @@ sub_80934E8: ; 80934E8 thumb_func_end sub_80934E8 thumb_func_start sub_8093514 +; u8 sub_8093514(u8 direction) sub_8093514: ; 8093514 push {r4,lr} sub sp, 0x8 @@ -257814,6 +258007,7 @@ sub_8093514: ; 8093514 thumb_func_end sub_8093514 thumb_func_start sub_8093540 +; u8 sub_8093540(u8 direction) sub_8093540: ; 8093540 push {r4,lr} sub sp, 0x8 @@ -257837,8 +258031,9 @@ sub_8093540: ; 8093540 .pool thumb_func_end sub_8093540 - thumb_func_start sub_809356C -sub_809356C: ; 809356C + thumb_func_start GetStepInPlaceDelay32AnimId +; u8 GetStepInPlaceDelay32AnimId(u8 direction) +GetStepInPlaceDelay32AnimId: ; 809356C push {r4,lr} sub sp, 0x8 lsls r0, 24 @@ -257859,10 +258054,11 @@ sub_809356C: ; 809356C pop {r1} bx r1 .pool - thumb_func_end sub_809356C + thumb_func_end GetStepInPlaceDelay32AnimId - thumb_func_start d2s_08064244 -d2s_08064244: ; 8093598 + thumb_func_start GetStepInPlaceDelay16AnimId +; u8 GetStepInPlaceDelay16AnimId(u8 direction) +GetStepInPlaceDelay16AnimId: ; 8093598 push {r4,lr} sub sp, 0x8 lsls r0, 24 @@ -257883,10 +258079,11 @@ d2s_08064244: ; 8093598 pop {r1} bx r1 .pool - thumb_func_end d2s_08064244 + thumb_func_end GetStepInPlaceDelay16AnimId - thumb_func_start sub_80935C4 -sub_80935C4: ; 80935C4 + thumb_func_start GetStepInPlaceDelay8AnimId +; u8 GetStepInPlaceDelay8AnimId(u8 direction) +GetStepInPlaceDelay8AnimId: ; 80935C4 push {r4,lr} sub sp, 0x8 lsls r0, 24 @@ -257907,10 +258104,11 @@ sub_80935C4: ; 80935C4 pop {r1} bx r1 .pool - thumb_func_end sub_80935C4 + thumb_func_end GetStepInPlaceDelay8AnimId - thumb_func_start sub_80935F0 -sub_80935F0: ; 80935F0 + thumb_func_start GetStepInPlaceDelay4AnimId +; u8 GetStepInPlaceDelay4AnimId(u8 direction) +GetStepInPlaceDelay4AnimId: ; 80935F0 push {r4,lr} sub sp, 0x8 lsls r0, 24 @@ -257931,29 +258129,30 @@ sub_80935F0: ; 80935F0 pop {r1} bx r1 .pool - thumb_func_end sub_80935F0 + thumb_func_end GetStepInPlaceDelay4AnimId - thumb_func_start npc_reciprocate_look -npc_reciprocate_look: ; 809361C + thumb_func_start FieldObjectFaceOppositeDirection +; BOOL FieldObjectFaceOppositeDirection(struct npc_state *fieldObject, u8 direction) +FieldObjectFaceOppositeDirection: ; 809361C push {r4,lr} adds r4, r0, 0 lsls r0, r1, 24 lsrs r0, 24 - bl direction_reversed + bl GetOppositeDirection lsls r0, 24 lsrs r0, 24 - bl d2s_look1 + bl GetFaceDirectionAnimId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 - thumb_func_end npc_reciprocate_look + thumb_func_end FieldObjectFaceOppositeDirection thumb_func_start sub_8093648 sub_8093648: ; 8093648 @@ -258195,8 +258394,9 @@ d2s_08064034: ; 80937D4 .pool thumb_func_end d2s_08064034 - thumb_func_start direction_reversed -direction_reversed: ; 8093800 + thumb_func_start GetOppositeDirection +; u8 GetOppositeDirection(u8 direction) +GetOppositeDirection: ; 8093800 push {r4,lr} sub sp, 0x8 lsls r0, 24 @@ -258222,7 +258422,7 @@ direction_reversed: ; 8093800 pop {r4} pop {r1} bx r1 - thumb_func_end direction_reversed + thumb_func_end GetOppositeDirection thumb_func_start zffu_offset_calc zffu_offset_calc: ; 8093834 @@ -258276,9 +258476,9 @@ state_to_direction: ; 809384C .pool thumb_func_end state_to_direction - thumb_func_start npc_obj_exec_an_2 -; void npc_obj_exec_an_2(npc_state *npcState, int a2) -npc_obj_exec_an_2: ; 809388C + thumb_func_start FieldObjectExecSpecialAnim +; void FieldObjectExecSpecialAnim(struct npc_state *fieldObject, struct obj *object) +FieldObjectExecSpecialAnim: ; 809388C push {r4,lr} adds r4, r0, 0 ldr r2, =gUnknown_0850DC50 @@ -258305,10 +258505,11 @@ npc_obj_exec_an_2: ; 809388C pop {r0} bx r0 .pool - thumb_func_end npc_obj_exec_an_2 + thumb_func_end FieldObjectExecSpecialAnim - thumb_func_start npc_obj_exec_an -npc_obj_exec_an: ; 80938C4 + thumb_func_start FieldObjectExecRegularAnim +; BOOL FieldObjectExecRegularAnim(struct npc_state *fieldObject, struct obj *object) +FieldObjectExecRegularAnim: ; 80938C4 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 @@ -258341,30 +258542,32 @@ npc_obj_exec_an: ; 80938C4 pop {r4,r5} pop {r1} bx r1 - thumb_func_end npc_obj_exec_an + thumb_func_end FieldObjectExecRegularAnim - thumb_func_start npc_set_state_and_pq_record -npc_set_state_and_pq_record: ; 8093904 + thumb_func_start FieldObjectSetRegularAnim +; void FieldObjectSetRegularAnim(struct npc_state *fieldObject, struct obj *object, u8 animState) +FieldObjectSetRegularAnim: ; 8093904 movs r3, 0 strb r2, [r0, 0x1C] strh r3, [r1, 0x32] bx lr - thumb_func_end npc_set_state_and_pq_record + thumb_func_end FieldObjectSetRegularAnim thumb_func_start an_look_any +; void an_look_any(struct npc_state *fieldObject, struct obj *object, u8 direction) an_look_any: ; 809390C push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 lsls r1, r2, 24 lsrs r1, 24 - bl npc_set_direction + bl FieldObjectSetDirection adds r0, r4, 0 bl npc_coords_shift_still ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 - bl an_run_any__impl_pulse + bl get_go_image_anim_num adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 @@ -258425,6 +258628,7 @@ sub_8093980: ; 8093980 thumb_func_end sub_8093980 thumb_func_start npc_apply_direction +; void npc_apply_direction(struct npc_state *fieldObject, struct obj *object, u8 direction, u8 speed) npc_apply_direction: ; 8093990 push {r4-r7,lr} mov r7, r8 @@ -258447,11 +258651,11 @@ npc_apply_direction: ; 8093990 strh r0, [r5] adds r0, r7, 0 adds r1, r4, 0 - bl npc_set_direction + bl FieldObjectSetDirection adds r0, r4, 0 mov r1, sp adds r2, r5, 0 - bl numbers_move_direction + bl MoveCoords mov r0, sp movs r2, 0 ldrsh r1, [r0, r2] @@ -258501,8 +258705,9 @@ npc_apply_direction: ; 8093990 .pool thumb_func_end npc_apply_direction - thumb_func_start an_run_any -an_run_any: ; 8093A2C + thumb_func_start do_go_anim +; void do_go_anim(struct npc_state *fieldObject, struct obj *object, u8 direction, u8 speed) +do_go_anim: ; 8093A2C push {r4-r7,lr} mov r7, r8 push {r7} @@ -258545,10 +258750,11 @@ an_run_any: ; 8093A2C pop {r0} bx r0 .pool - thumb_func_end an_run_any + thumb_func_end do_go_anim - thumb_func_start sub_8093A88 -sub_8093A88: ; 8093A88 + thumb_func_start do_run_anim +; void do_run_anim(struct npc_state *fieldObject, struct obj *object, u8 direction) +do_run_anim: ; 8093A88 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 @@ -258559,7 +258765,7 @@ sub_8093A88: ; 8093A88 ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 - bl sub_8092A3C + bl get_run_image_anim_num adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 @@ -258569,9 +258775,10 @@ sub_8093A88: ; 8093A88 pop {r4,r5} pop {r0} bx r0 - thumb_func_end sub_8093A88 + thumb_func_end do_run_anim thumb_func_start npc_obj_ministep_stop_on_arrival +; BOOL npc_obj_ministep_stop_on_arrival(struct npc_state *fieldObject, struct obj *object) npc_obj_ministep_stop_on_arrival: ; 8093AB8 push {r4,r5,lr} adds r4, r0, 0 @@ -258604,6 +258811,7 @@ npc_obj_ministep_stop_on_arrival: ; 8093AB8 thumb_func_end npc_obj_ministep_stop_on_arrival thumb_func_start sub_8093AF0 +; void sub_8093AF0(struct npc_state *fieldObject, struct obj *object, u8 direction) sub_8093AF0: ; 8093AF0 push {r4-r6,lr} mov r6, r8 @@ -258622,11 +258830,11 @@ sub_8093AF0: ; 8093AF0 strh r0, [r4] adds r0, r6, 0 adds r1, r5, 0 - bl npc_set_direction + bl FieldObjectSetDirection adds r0, r5, 0 mov r1, sp adds r2, r4, 0 - bl numbers_move_direction + bl MoveCoords mov r0, sp movs r2, 0 ldrsh r1, [r0, r2] @@ -258660,6 +258868,7 @@ sub_8093AF0: ; 8093AF0 thumb_func_end sub_8093AF0 thumb_func_start sub_8093B60 +; void sub_8093B60(struct npc_state *fieldObject, struct obj *object, u8 direction) sub_8093B60: ; 8093B60 push {r4,r5,lr} adds r4, r0, 0 @@ -258670,7 +258879,7 @@ sub_8093B60: ; 8093B60 ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 - bl an_run_any__impl_pulse + bl get_go_image_anim_num adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 @@ -258683,6 +258892,7 @@ sub_8093B60: ; 8093B60 thumb_func_end sub_8093B60 thumb_func_start an_walk_any_2 +; BOOL an_walk_any_2(struct npc_state *fieldObject, struct obj *object) an_walk_any_2: ; 8093B8C push {r4,r5,lr} adds r4, r0, 0 @@ -258863,6 +259073,7 @@ sub_8093CA4: ; 8093CA4 thumb_func_end sub_8093CA4 thumb_func_start sub_8093CC4 +; BOOL sub_8093CC4(struct npc_state *fieldObject, struct obj *object) sub_8093CC4: ; 8093CC4 push {r4,r5,lr} adds r4, r0, 0 @@ -258880,6 +259091,7 @@ sub_8093CC4: ; 8093CC4 thumb_func_end sub_8093CC4 thumb_func_start sub_8093CE4 +; BOOL sub_8093CE4(struct npc_state *fieldObject, struct obj *object) sub_8093CE4: ; 8093CE4 push {r4,lr} adds r4, r1, 0 @@ -259017,7 +259229,7 @@ sub_8093DC4: ; 8093DC4 adds r5, r1, 0 movs r2, 0x7 movs r3, 0 - bl an_run_any + bl do_go_anim adds r0, r4, 0 adds r1, r5, 0 bl sub_8093DE4 @@ -259029,6 +259241,7 @@ sub_8093DC4: ; 8093DC4 thumb_func_end sub_8093DC4 thumb_func_start sub_8093DE4 +; BOOL sub_8093DE4(struct npc_state *fieldObject, struct obj *object) sub_8093DE4: ; 8093DE4 push {r4,lr} adds r4, r1, 0 @@ -259055,7 +259268,7 @@ sub_8093E04: ; 8093E04 adds r5, r1, 0 movs r2, 0x8 movs r3, 0 - bl an_run_any + bl do_go_anim adds r0, r4, 0 adds r1, r5, 0 bl sub_8093E24 @@ -259093,7 +259306,7 @@ sub_8093E44: ; 8093E44 adds r5, r1, 0 movs r2, 0x5 movs r3, 0 - bl an_run_any + bl do_go_anim adds r0, r4, 0 adds r1, r5, 0 bl sub_8093E64 @@ -259131,7 +259344,7 @@ sub_8093E84: ; 8093E84 adds r5, r1, 0 movs r2, 0x6 movs r3, 0 - bl an_run_any + bl do_go_anim adds r0, r4, 0 adds r1, r5, 0 bl sub_8093EA4 @@ -259169,7 +259382,7 @@ sub_8093EC4: ; 8093EC4 adds r5, r1, 0 movs r2, 0x1 movs r3, 0 - bl an_run_any + bl do_go_anim adds r0, r4, 0 adds r1, r5, 0 bl sub_8093EE4 @@ -259207,7 +259420,7 @@ sub_8093F04: ; 8093F04 adds r5, r1, 0 movs r2, 0x2 movs r3, 0 - bl an_run_any + bl do_go_anim adds r0, r4, 0 adds r1, r5, 0 bl sub_8093F24 @@ -259245,7 +259458,7 @@ sub_8093F44: ; 8093F44 adds r5, r1, 0 movs r2, 0x3 movs r3, 0 - bl an_run_any + bl do_go_anim adds r0, r4, 0 adds r1, r5, 0 bl sub_8093F64 @@ -259283,7 +259496,7 @@ sub_8093F84: ; 8093F84 adds r5, r1, 0 movs r2, 0x4 movs r3, 0 - bl an_run_any + bl do_go_anim adds r0, r4, 0 adds r1, r5, 0 bl sub_8093FA4 @@ -259348,7 +259561,7 @@ sub_8093FC4: ; 8093FC4 strh r0, [r6] adds r0, r7, 0 adds r1, r4, 0 - bl npc_set_direction + bl FieldObjectSetDirection mov r1, r8 lsls r0, r1, 1 add r0, sp @@ -259425,7 +259638,7 @@ maybe_shadow_1: ; 8094080 ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 - bl an_run_any__impl_pulse + bl get_go_image_anim_num adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 @@ -259433,7 +259646,7 @@ maybe_shadow_1: ; 8094080 adds r1, r5, 0 bl npc_apply_anim_looping adds r0, r4, 0 - bl do_animation_x03 + bl DoShadowFieldEffect add sp, 0x4 pop {r4,r5} pop {r0} @@ -259612,16 +259825,16 @@ sub_80941E0: ; 80941E0 @080941FA: ldrb r0, [r4, 0x18] lsrs r0, 4 - bl direction_reversed + bl GetOppositeDirection adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl npc_set_direction + bl FieldObjectSetDirection ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 - bl an_run_any__impl_pulse + bl get_go_image_anim_num adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 @@ -259957,7 +260170,7 @@ sub_8094454: ; 8094454 adds r5, r1, 0 movs r2, 0x1 movs r3, 0x1 - bl an_run_any + bl do_go_anim adds r0, r4, 0 adds r1, r5, 0 bl sub_8094474 @@ -259995,7 +260208,7 @@ sub_8094494: ; 8094494 adds r5, r1, 0 movs r2, 0x2 movs r3, 0x1 - bl an_run_any + bl do_go_anim adds r0, r4, 0 adds r1, r5, 0 bl sub_80944B4 @@ -260033,7 +260246,7 @@ sub_80944D4: ; 80944D4 adds r5, r1, 0 movs r2, 0x3 movs r3, 0x1 - bl an_run_any + bl do_go_anim adds r0, r4, 0 adds r1, r5, 0 bl sub_80944F4 @@ -260071,7 +260284,7 @@ sub_8094514: ; 8094514 adds r5, r1, 0 movs r2, 0x4 movs r3, 0x1 - bl an_run_any + bl do_go_anim adds r0, r4, 0 adds r1, r5, 0 bl sub_8094534 @@ -260118,7 +260331,7 @@ sub_8094554: ; 8094554 lsrs r4, 24 lsls r5, 16 lsrs r5, 16 - bl npc_set_direction + bl FieldObjectSetDirection mov r0, r8 adds r1, r6, 0 adds r2, r4, 0 @@ -260141,6 +260354,7 @@ sub_8094554: ; 8094554 thumb_func_end sub_8094554 thumb_func_start sub_809459C +; signed int sub_809459C(int a1, obj *a2) sub_809459C: ; 809459C push {lr} ldrh r0, [r1, 0x34] @@ -260167,6 +260381,7 @@ sub_809459C: ; 809459C thumb_func_end sub_809459C thumb_func_start sub_80945C4 +; int sub_80945C4(int a1, obj *a2) sub_80945C4: ; 80945C4 push {r4,r5,lr} adds r5, r0, 0 @@ -260207,7 +260422,7 @@ sub_8094600: ; 8094600 adds r4, r0, 0 adds r5, r1, 0 movs r0, 0x1 - bl an_run_any__impl_pulse + bl get_go_image_anim_num adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 @@ -260235,7 +260450,7 @@ sub_8094638: ; 8094638 adds r4, r0, 0 adds r5, r1, 0 movs r0, 0x2 - bl an_run_any__impl_pulse + bl get_go_image_anim_num adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 @@ -260263,7 +260478,7 @@ sub_8094670: ; 8094670 adds r4, r0, 0 adds r5, r1, 0 movs r0, 0x3 - bl an_run_any__impl_pulse + bl get_go_image_anim_num adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 @@ -260291,7 +260506,7 @@ sub_80946A8: ; 80946A8 adds r4, r0, 0 adds r5, r1, 0 movs r0, 0x4 - bl an_run_any__impl_pulse + bl get_go_image_anim_num adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 @@ -260319,7 +260534,7 @@ sub_80946E0: ; 80946E0 adds r4, r0, 0 adds r5, r1, 0 movs r0, 0x1 - bl an_run_any__impl_pulse + bl get_go_image_anim_num adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 @@ -260347,7 +260562,7 @@ sub_8094718: ; 8094718 adds r4, r0, 0 adds r5, r1, 0 movs r0, 0x2 - bl an_run_any__impl_pulse + bl get_go_image_anim_num adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 @@ -260375,7 +260590,7 @@ sub_8094750: ; 8094750 adds r4, r0, 0 adds r5, r1, 0 movs r0, 0x3 - bl an_run_any__impl_pulse + bl get_go_image_anim_num adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 @@ -260403,7 +260618,7 @@ sub_8094788: ; 8094788 adds r4, r0, 0 adds r5, r1, 0 movs r0, 0x4 - bl an_run_any__impl_pulse + bl get_go_image_anim_num adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 @@ -260431,7 +260646,7 @@ sub_80947C0: ; 80947C0 adds r4, r0, 0 adds r5, r1, 0 movs r0, 0x1 - bl sub_809297C + bl get_go_fast_image_anim_num adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 @@ -260459,7 +260674,7 @@ sub_80947F8: ; 80947F8 adds r4, r0, 0 adds r5, r1, 0 movs r0, 0x2 - bl sub_809297C + bl get_go_fast_image_anim_num adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 @@ -260487,7 +260702,7 @@ sub_8094830: ; 8094830 adds r4, r0, 0 adds r5, r1, 0 movs r0, 0x3 - bl sub_809297C + bl get_go_fast_image_anim_num adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 @@ -260515,7 +260730,7 @@ sub_8094868: ; 8094868 adds r4, r0, 0 adds r5, r1, 0 movs r0, 0x4 - bl sub_809297C + bl get_go_fast_image_anim_num adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 @@ -260543,7 +260758,7 @@ sub_80948A0: ; 80948A0 adds r4, r0, 0 adds r5, r1, 0 movs r0, 0x1 - bl sub_809298C + bl get_go_faster_image_anim_num adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 @@ -260571,7 +260786,7 @@ sub_80948D8: ; 80948D8 adds r4, r0, 0 adds r5, r1, 0 movs r0, 0x2 - bl sub_809298C + bl get_go_faster_image_anim_num adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 @@ -260599,7 +260814,7 @@ sub_8094910: ; 8094910 adds r4, r0, 0 adds r5, r1, 0 movs r0, 0x3 - bl sub_809298C + bl get_go_faster_image_anim_num adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 @@ -260627,7 +260842,7 @@ sub_8094948: ; 8094948 adds r4, r0, 0 adds r5, r1, 0 movs r0, 0x4 - bl sub_809298C + bl get_go_faster_image_anim_num adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 @@ -260655,7 +260870,7 @@ sub_8094980: ; 8094980 adds r5, r1, 0 movs r2, 0x1 movs r3, 0x2 - bl an_run_any + bl do_go_anim adds r0, r4, 0 adds r1, r5, 0 bl sub_80949A0 @@ -260693,7 +260908,7 @@ sub_80949C0: ; 80949C0 adds r5, r1, 0 movs r2, 0x2 movs r3, 0x2 - bl an_run_any + bl do_go_anim adds r0, r4, 0 adds r1, r5, 0 bl sub_80949E0 @@ -260731,7 +260946,7 @@ sub_8094A00: ; 8094A00 adds r5, r1, 0 movs r2, 0x3 movs r3, 0x2 - bl an_run_any + bl do_go_anim adds r0, r4, 0 adds r1, r5, 0 bl sub_8094A20 @@ -260769,7 +260984,7 @@ sub_8094A40: ; 8094A40 adds r5, r1, 0 movs r2, 0x4 movs r3, 0x2 - bl an_run_any + bl do_go_anim adds r0, r4, 0 adds r1, r5, 0 bl sub_8094A60 @@ -260807,7 +261022,7 @@ sub_8094A80: ; 8094A80 adds r5, r1, 0 movs r2, 0x1 movs r3, 0x3 - bl an_run_any + bl do_go_anim adds r0, r4, 0 adds r1, r5, 0 bl sub_8094AA0 @@ -260845,7 +261060,7 @@ sub_8094AC0: ; 8094AC0 adds r5, r1, 0 movs r2, 0x2 movs r3, 0x3 - bl an_run_any + bl do_go_anim adds r0, r4, 0 adds r1, r5, 0 bl sub_8094AE0 @@ -260883,7 +261098,7 @@ sub_8094B00: ; 8094B00 adds r5, r1, 0 movs r2, 0x3 movs r3, 0x3 - bl an_run_any + bl do_go_anim adds r0, r4, 0 adds r1, r5, 0 bl sub_8094B20 @@ -260921,7 +261136,7 @@ sub_8094B40: ; 8094B40 adds r5, r1, 0 movs r2, 0x4 movs r3, 0x3 - bl an_run_any + bl do_go_anim adds r0, r4, 0 adds r1, r5, 0 bl sub_8094B60 @@ -260959,7 +261174,7 @@ sub_8094B80: ; 8094B80 adds r5, r1, 0 movs r2, 0x1 movs r3, 0x4 - bl an_run_any + bl do_go_anim adds r0, r4, 0 adds r1, r5, 0 bl sub_8094BA0 @@ -260997,7 +261212,7 @@ sub_8094BC0: ; 8094BC0 adds r5, r1, 0 movs r2, 0x2 movs r3, 0x4 - bl an_run_any + bl do_go_anim adds r0, r4, 0 adds r1, r5, 0 bl sub_8094BE0 @@ -261035,7 +261250,7 @@ sub_8094C00: ; 8094C00 adds r5, r1, 0 movs r2, 0x3 movs r3, 0x4 - bl an_run_any + bl do_go_anim adds r0, r4, 0 adds r1, r5, 0 bl sub_8094C20 @@ -261073,7 +261288,7 @@ sub_8094C40: ; 8094C40 adds r5, r1, 0 movs r2, 0x4 movs r3, 0x4 - bl an_run_any + bl do_go_anim adds r0, r4, 0 adds r1, r5, 0 bl sub_8094C60 @@ -261104,13 +261319,14 @@ sub_8094C60: ; 8094C60 bx r1 thumb_func_end sub_8094C60 - thumb_func_start sub_8094C80 -sub_8094C80: ; 8094C80 + thumb_func_start do_run_south_anim +; BOOL do_run_south_anim(struct npc_state *fieldObject, struct obj *object) +do_run_south_anim: ; 8094C80 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 movs r2, 0x1 - bl sub_8093A88 + bl do_run_anim adds r0, r4, 0 adds r1, r5, 0 bl sub_8094CA0 @@ -261119,9 +261335,10 @@ sub_8094C80: ; 8094C80 pop {r4,r5} pop {r1} bx r1 - thumb_func_end sub_8094C80 + thumb_func_end do_run_south_anim thumb_func_start sub_8094CA0 +; BOOL sub_8094CA0(struct npc_state *fieldObject, struct obj *object) sub_8094CA0: ; 8094CA0 push {r4,lr} adds r4, r1, 0 @@ -261141,13 +261358,13 @@ sub_8094CA0: ; 8094CA0 bx r1 thumb_func_end sub_8094CA0 - thumb_func_start sub_8094CC0 -sub_8094CC0: ; 8094CC0 + thumb_func_start do_run_north_anim +do_run_north_anim: ; 8094CC0 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 movs r2, 0x2 - bl sub_8093A88 + bl do_run_anim adds r0, r4, 0 adds r1, r5, 0 bl sub_8094CE0 @@ -261156,7 +261373,7 @@ sub_8094CC0: ; 8094CC0 pop {r4,r5} pop {r1} bx r1 - thumb_func_end sub_8094CC0 + thumb_func_end do_run_north_anim thumb_func_start sub_8094CE0 sub_8094CE0: ; 8094CE0 @@ -261178,13 +261395,13 @@ sub_8094CE0: ; 8094CE0 bx r1 thumb_func_end sub_8094CE0 - thumb_func_start sub_8094D00 -sub_8094D00: ; 8094D00 + thumb_func_start do_run_west_anim +do_run_west_anim: ; 8094D00 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 movs r2, 0x3 - bl sub_8093A88 + bl do_run_anim adds r0, r4, 0 adds r1, r5, 0 bl sub_8094D20 @@ -261193,7 +261410,7 @@ sub_8094D00: ; 8094D00 pop {r4,r5} pop {r1} bx r1 - thumb_func_end sub_8094D00 + thumb_func_end do_run_west_anim thumb_func_start sub_8094D20 sub_8094D20: ; 8094D20 @@ -261215,13 +261432,13 @@ sub_8094D20: ; 8094D20 bx r1 thumb_func_end sub_8094D20 - thumb_func_start sub_8094D40 -sub_8094D40: ; 8094D40 + thumb_func_start do_run_east_anim +do_run_east_anim: ; 8094D40 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 movs r2, 0x4 - bl sub_8093A88 + bl do_run_anim adds r0, r4, 0 adds r1, r5, 0 bl sub_8094D60 @@ -261230,7 +261447,7 @@ sub_8094D40: ; 8094D40 pop {r4,r5} pop {r1} bx r1 - thumb_func_end sub_8094D40 + thumb_func_end do_run_east_anim thumb_func_start sub_8094D60 sub_8094D60: ; 8094D60 @@ -261268,7 +261485,7 @@ npc_set_direction_and_anim__an_proceed: ; 8094D80 bl obj_anim_image_set_and_seek adds r0, r6, 0 adds r1, r4, 0 - bl npc_set_direction + bl FieldObjectSetDirection movs r0, 0x1 strh r0, [r5, 0x32] pop {r4-r6} @@ -261515,7 +261732,7 @@ sub_8094F38: ; 8094F38 movs r1, 0 movs r2, 0 mov r3, sp - bl npc_id_by_local_id_and_map_ret_success + bl TryGetFieldObjectIdByLocalIdAndMap lsls r0, 24 cmp r0, 0 bne @08094F82 @@ -261561,7 +261778,7 @@ sub_8094F94: ; 8094F94 movs r1, 0 movs r2, 0 mov r3, sp - bl npc_id_by_local_id_and_map_ret_success + bl TryGetFieldObjectIdByLocalIdAndMap lsls r0, 24 cmp r0, 0 bne @08094FE6 @@ -261583,7 +261800,7 @@ sub_8094F94: ; 8094F94 bl sub_8092AF8 lsls r0, 24 lsrs r0, 24 - bl direction_reversed + bl GetOppositeDirection adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 @@ -262326,7 +262543,7 @@ do_exclamation_mark_bubble_1: ; 80954DC adds r2, r1, 0x4 adds r3, r1, 0 adds r3, 0x8 - bl npc_get_local_id_and_mapnumbers + bl FieldObjectGetLocalIdAndMap movs r0, 0 bl FieldEffectStart movs r0, 0x1 @@ -262345,7 +262562,7 @@ do_exclamation_mark_bubble_2: ; 8095500 adds r2, r1, 0x4 adds r3, r1, 0 adds r3, 0x8 - bl npc_get_local_id_and_mapnumbers + bl FieldObjectGetLocalIdAndMap movs r0, 0x21 bl FieldEffectStart movs r0, 0x1 @@ -262364,7 +262581,7 @@ do_heart_bubble: ; 8095524 adds r2, r1, 0x4 adds r3, r1, 0 adds r3, 0x8 - bl npc_get_local_id_and_mapnumbers + bl FieldObjectGetLocalIdAndMap movs r0, 0x2E bl FieldEffectStart movs r0, 0x1 @@ -262780,7 +262997,7 @@ sub_8095800: ; 8095800 adds r4, r1, 0 movs r2, 0x3 movs r3, 0x1 - bl an_run_any + bl do_go_anim adds r2, r4, 0 adds r2, 0x2C ldrb r1, [r2] @@ -262833,7 +263050,7 @@ sub_8095860: ; 8095860 adds r4, r1, 0 movs r2, 0x4 movs r3, 0x1 - bl an_run_any + bl do_go_anim adds r2, r4, 0 adds r2, 0x2C ldrb r1, [r2] @@ -262887,7 +263104,7 @@ sub_80958C0: ; 80958C0 lsls r4, r2, 24 lsrs r4, 24 adds r1, r4, 0 - bl npc_set_direction + bl FieldObjectSetDirection adds r0, r5, 0 bl npc_coords_shift_still adds r0, r4, 0 @@ -263304,7 +263521,7 @@ sub_8095B84: ; 8095B84 adds r0, r5, 0 bl StartObjectImageAnimIfDifferent adds r0, r6, 0 - bl do_animation_x03 + bl DoShadowFieldEffect add sp, 0x4 pop {r4-r6} pop {r0} @@ -264602,6 +264819,7 @@ sub_80964B8: ; 80964B8 thumb_func_end sub_80964B8 thumb_func_start sub_80964BC +; BOOL sub_80964BC(struct npc_state *fieldObject, struct obj *object) sub_80964BC: ; 80964BC adds r1, 0x2C ldrb r0, [r1] @@ -264613,6 +264831,7 @@ sub_80964BC: ; 80964BC thumb_func_end sub_80964BC thumb_func_start npc_obj_transfer_image_anim_pause_flag +; void npc_obj_transfer_image_anim_pause_flag(struct npc_state *fieldObject, struct obj *object) npc_obj_transfer_image_anim_pause_flag: ; 80964CC push {lr} ldrb r0, [r0, 0x1] @@ -264631,6 +264850,7 @@ npc_obj_transfer_image_anim_pause_flag: ; 80964CC thumb_func_end npc_obj_transfer_image_anim_pause_flag thumb_func_start sub_80964E8 +; void sub_80964E8(struct npc_state *fieldObject, struct obj *object) sub_80964E8: ; 80964E8 push {r4,lr} adds r4, r0, 0 @@ -264659,6 +264879,7 @@ sub_80964E8: ; 80964E8 thumb_func_end sub_80964E8 thumb_func_start sub_8096518 +; void sub_8096518(struct npc_state *fieldObject, struct obj *object) sub_8096518: ; 8096518 push {r4,r5,lr} adds r4, r0, 0 @@ -264790,6 +265011,7 @@ sub_8096530: ; 8096530 thumb_func_end sub_8096530 thumb_func_start npc_update_obj_anim_flag +; void npc_update_obj_anim_flag(struct npc_state *fieldObject, struct obj *object) npc_update_obj_anim_flag: ; 8096610 push {lr} adds r2, r1, 0 @@ -264813,114 +265035,117 @@ npc_update_obj_anim_flag: ; 8096610 bx r0 thumb_func_end npc_update_obj_anim_flag - thumb_func_start dp03_build_bits_2 -dp03_build_bits_2: ; 8096638 + thumb_func_start GetAllGroundEffectFlags_OnSpawn +; void GetAllGroundEffectFlags_OnSpawn(struct npc_state *fieldObject, u32 *flags) +GetAllGroundEffectFlags_OnSpawn: ; 8096638 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 - bl npc_update_tile_attributes + bl FieldObjectUpdateMetatileBehaviors adds r0, r4, 0 adds r1, r5, 0 - bl dp03_build_bits_water + bl GetGroundEffectFlags_Reflection adds r0, r4, 0 adds r1, r5, 0 - bl dp03_build_bits_normal_grass__bit_1 + bl GetGroundEffectFlags_TallGrassOnSpawn adds r0, r4, 0 adds r1, r5, 0 - bl dp03_build_bits_tall_grass_1 + bl GetGroundEffectFlags_LongGrassOnSpawn adds r0, r4, 0 adds r1, r5, 0 - bl dp03_build_bits_unknown_1 + bl GetGroundEffectFlags_SandHeap adds r0, r4, 0 adds r1, r5, 0 - bl dp03_build_bits_unknown_2 + bl GetGroundEffectFlags_ShallowFlowingWater adds r0, r4, 0 adds r1, r5, 0 - bl dp03_build_bits_tiny_grass + bl GetGroundEffectFlags_ShortGrass adds r0, r4, 0 adds r1, r5, 0 - bl dp03_build_bits_8067EBC + bl GetGroundEffectFlags_HotSprings pop {r4,r5} pop {r0} bx r0 - thumb_func_end dp03_build_bits_2 + thumb_func_end GetAllGroundEffectFlags_OnSpawn - thumb_func_start dp03_build_bits_1 -dp03_build_bits_1: ; 8096680 + thumb_func_start GetAllGroundEffectFlags_OnBeginStep +; void GetAllGroundEffectFlags_OnBeginStep(struct npc_state *fieldObject, u32 *flags) +GetAllGroundEffectFlags_OnBeginStep: ; 8096680 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 - bl npc_update_tile_attributes + bl FieldObjectUpdateMetatileBehaviors adds r0, r4, 0 adds r1, r5, 0 - bl dp03_build_bits_water + bl GetGroundEffectFlags_Reflection adds r0, r4, 0 adds r1, r5, 0 - bl dp03_build_bits_normal_grass__bit_2 + bl GetGroundEffectFlags_TallGrassOnBeginStep adds r0, r4, 0 adds r1, r5, 0 - bl dp03_build_bits_tall_grass_0 + bl GetGroundEffectFlags_LongGrassOnBeginStep adds r0, r4, 0 adds r1, r5, 0 - bl dp03_build_bits_sand + bl GetGroundEffectFlags_Tracks adds r0, r4, 0 adds r1, r5, 0 - bl dp03_build_bits_unknown_1 + bl GetGroundEffectFlags_SandHeap adds r0, r4, 0 adds r1, r5, 0 - bl dp03_build_bits_unknown_2 + bl GetGroundEffectFlags_ShallowFlowingWater adds r0, r4, 0 adds r1, r5, 0 - bl dp03_build_bits_splash + bl GetGroundEffectFlags_Puddle adds r0, r4, 0 adds r1, r5, 0 - bl dp03_build_bits_tiny_grass + bl GetGroundEffectFlags_ShortGrass adds r0, r4, 0 adds r1, r5, 0 - bl dp03_build_bits_8067EBC + bl GetGroundEffectFlags_HotSprings pop {r4,r5} pop {r0} bx r0 - thumb_func_end dp03_build_bits_1 + thumb_func_end GetAllGroundEffectFlags_OnBeginStep - thumb_func_start npc_analyze_ground -; void npc_analyze_ground(struct npc_state *fieldObject, struct obj *object) -npc_analyze_ground: ; 80966D8 + thumb_func_start GetAllGroundEffectFlags_OnFinishStep +; void GetAllGroundEffectFlags_OnFinishStep(struct npc_state *fieldObject, u32 *flags) +GetAllGroundEffectFlags_OnFinishStep: ; 80966D8 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 - bl npc_update_tile_attributes + bl FieldObjectUpdateMetatileBehaviors adds r0, r4, 0 adds r1, r5, 0 - bl dp03_build_bits_unknown_2 + bl GetGroundEffectFlags_ShallowFlowingWater adds r0, r4, 0 adds r1, r5, 0 - bl dp03_build_bits_unknown_1 + bl GetGroundEffectFlags_SandHeap adds r0, r4, 0 adds r1, r5, 0 - bl dp03_build_bits_splash + bl GetGroundEffectFlags_Puddle adds r0, r4, 0 adds r1, r5, 0 - bl dp03_build_bits_8067E4C + bl GetGroundEffectFlags_Ripple adds r0, r4, 0 adds r1, r5, 0 - bl dp03_build_bits_tiny_grass + bl GetGroundEffectFlags_ShortGrass adds r0, r4, 0 adds r1, r5, 0 - bl dp03_build_bits_8067EBC + bl GetGroundEffectFlags_HotSprings adds r0, r4, 0 adds r1, r5, 0 - bl dp03_build_bits_bubbles + bl GetGroundEffectFlags_Seaweed adds r0, r4, 0 adds r1, r5, 0 - bl dp03_build_bits_by_block_behaviour + bl GetGroundEffectFlags_JumpLanding pop {r4,r5} pop {r0} bx r0 - thumb_func_end npc_analyze_ground + thumb_func_end GetAllGroundEffectFlags_OnFinishStep - thumb_func_start npc_update_tile_attributes -npc_update_tile_attributes: ; 8096728 + thumb_func_start FieldObjectUpdateMetatileBehaviors +; void FieldObjectUpdateMetatileBehaviors(struct npc_state *fieldObject) +FieldObjectUpdateMetatileBehaviors: ; 8096728 push {r4,lr} adds r4, r0, 0 movs r1, 0x14 @@ -264938,10 +265163,11 @@ npc_update_tile_attributes: ; 8096728 pop {r4} pop {r0} bx r0 - thumb_func_end npc_update_tile_attributes + thumb_func_end FieldObjectUpdateMetatileBehaviors - thumb_func_start dp03_build_bits_water -dp03_build_bits_water: ; 8096750 + thumb_func_start GetGroundEffectFlags_Reflection +; void GetGroundEffectFlags_Reflection(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_Reflection: ; 8096750 push {r4,r5,lr} sub sp, 0x8 adds r4, r0, 0 @@ -264952,7 +265178,7 @@ dp03_build_bits_water: ; 8096750 str r0, [sp] str r1, [sp, 0x4] adds r0, r4, 0 - bl npcs_and_water_something + bl FieldObjectCheckForReflectiveSurface lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0 @@ -264987,14 +265213,15 @@ dp03_build_bits_water: ; 8096750 pop {r4,r5} pop {r0} bx r0 - thumb_func_end dp03_build_bits_water + thumb_func_end GetGroundEffectFlags_Reflection - thumb_func_start dp03_build_bits_normal_grass__bit_1 -dp03_build_bits_normal_grass__bit_1: ; 80967AC + thumb_func_start GetGroundEffectFlags_TallGrassOnSpawn +; void GetGroundEffectFlags_TallGrassOnSpawn(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_TallGrassOnSpawn: ; 80967AC push {r4,lr} adds r4, r1, 0 ldrb r0, [r0, 0x1E] - bl is_tile_x02_or_xD1 + bl MetatileBehavior_IsTallGrass lsls r0, 24 cmp r0, 0 beq @080967C4 @@ -265006,14 +265233,15 @@ dp03_build_bits_normal_grass__bit_1: ; 80967AC pop {r4} pop {r0} bx r0 - thumb_func_end dp03_build_bits_normal_grass__bit_1 + thumb_func_end GetGroundEffectFlags_TallGrassOnSpawn - thumb_func_start dp03_build_bits_normal_grass__bit_2 -dp03_build_bits_normal_grass__bit_2: ; 80967CC + thumb_func_start GetGroundEffectFlags_TallGrassOnBeginStep +; void GetGroundEffectFlags_TallGrassOnBeginStep(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_TallGrassOnBeginStep: ; 80967CC push {r4,lr} adds r4, r1, 0 ldrb r0, [r0, 0x1E] - bl is_tile_x02_or_xD1 + bl MetatileBehavior_IsTallGrass lsls r0, 24 cmp r0, 0 beq @080967E4 @@ -265025,10 +265253,11 @@ dp03_build_bits_normal_grass__bit_2: ; 80967CC pop {r4} pop {r0} bx r0 - thumb_func_end dp03_build_bits_normal_grass__bit_2 + thumb_func_end GetGroundEffectFlags_TallGrassOnBeginStep - thumb_func_start dp03_build_bits_tall_grass_1 -dp03_build_bits_tall_grass_1: ; 80967EC + thumb_func_start GetGroundEffectFlags_LongGrassOnSpawn +; void GetGroundEffectFlags_LongGrassOnSpawn(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_LongGrassOnSpawn: ; 80967EC push {r4,lr} adds r4, r1, 0 ldrb r0, [r0, 0x1E] @@ -265044,10 +265273,11 @@ dp03_build_bits_tall_grass_1: ; 80967EC pop {r4} pop {r0} bx r0 - thumb_func_end dp03_build_bits_tall_grass_1 + thumb_func_end GetGroundEffectFlags_LongGrassOnSpawn - thumb_func_start dp03_build_bits_tall_grass_0 -dp03_build_bits_tall_grass_0: ; 809680C + thumb_func_start GetGroundEffectFlags_LongGrassOnBeginStep +; void GetGroundEffectFlags_LongGrassOnBeginStep(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_LongGrassOnBeginStep: ; 809680C push {r4,lr} adds r4, r1, 0 ldrb r0, [r0, 0x1E] @@ -265063,10 +265293,11 @@ dp03_build_bits_tall_grass_0: ; 809680C pop {r4} pop {r0} bx r0 - thumb_func_end dp03_build_bits_tall_grass_0 + thumb_func_end GetGroundEffectFlags_LongGrassOnBeginStep - thumb_func_start dp03_build_bits_sand -dp03_build_bits_sand: ; 809682C + thumb_func_start GetGroundEffectFlags_Tracks +; void GetGroundEffectFlags_Tracks(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_Tracks: ; 809682C push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 @@ -265081,12 +265312,12 @@ dp03_build_bits_sand: ; 809682C b @08096862 @08096846: ldrb r0, [r4, 0x1F] - bl is_x21_or_x2B + bl MetatileBehavior_IsSandOrDeepSand lsls r0, 24 cmp r0, 0 bne @0809685E ldrb r0, [r4, 0x1F] - bl sub_8089498 + bl MetatileBehavior_IsUnusedFootprintMetatile lsls r0, 24 cmp r0, 0 beq @08096866 @@ -265100,10 +265331,11 @@ dp03_build_bits_sand: ; 809682C pop {r4,r5} pop {r0} bx r0 - thumb_func_end dp03_build_bits_sand + thumb_func_end GetGroundEffectFlags_Tracks - thumb_func_start dp03_build_bits_unknown_1 -dp03_build_bits_unknown_1: ; 809686C + thumb_func_start GetGroundEffectFlags_SandHeap +; void GetGroundEffectFlags_SandHeap(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_SandHeap: ; 809686C push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 @@ -265143,31 +265375,32 @@ dp03_build_bits_unknown_1: ; 809686C pop {r4,r5} pop {r0} bx r0 - thumb_func_end dp03_build_bits_unknown_1 + thumb_func_end GetGroundEffectFlags_SandHeap - thumb_func_start dp03_build_bits_unknown_2 -dp03_build_bits_unknown_2: ; 80968BC + thumb_func_start GetGroundEffectFlags_ShallowFlowingWater +; void GetGroundEffectFlags_ShallowFlowingWater(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_ShallowFlowingWater: ; 80968BC push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 ldrb r0, [r4, 0x1E] - bl sub_80895E8 + bl MetatileBehavior_IsShallowFlowingWater lsls r0, 24 cmp r0, 0 beq @080968DA ldrb r0, [r4, 0x1F] - bl sub_80895E8 + bl MetatileBehavior_IsShallowFlowingWater lsls r0, 24 cmp r0, 0 bne @080968F2 @080968DA: ldrb r0, [r4, 0x1E] - bl is_tile_x17 + bl MetatileBehavior_IsPacifidlogLog lsls r0, 24 cmp r0, 0 beq @08096910 ldrb r0, [r4, 0x1F] - bl is_tile_x17 + bl MetatileBehavior_IsPacifidlogLog lsls r0, 24 cmp r0, 0 beq @08096910 @@ -265197,20 +265430,21 @@ dp03_build_bits_unknown_2: ; 80968BC pop {r4,r5} pop {r0} bx r0 - thumb_func_end dp03_build_bits_unknown_2 + thumb_func_end GetGroundEffectFlags_ShallowFlowingWater - thumb_func_start dp03_build_bits_splash -dp03_build_bits_splash: ; 8096920 + thumb_func_start GetGroundEffectFlags_Puddle +; void GetGroundEffectFlags_Puddle(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_Puddle: ; 8096920 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 ldrb r0, [r4, 0x1E] - bl is_tile_x16_clear_water + bl MetatileBehavior_IsPuddle lsls r0, 24 cmp r0, 0 beq @08096948 ldrb r0, [r4, 0x1F] - bl is_tile_x16_clear_water + bl MetatileBehavior_IsPuddle lsls r0, 24 cmp r0, 0 beq @08096948 @@ -265223,14 +265457,15 @@ dp03_build_bits_splash: ; 8096920 pop {r4,r5} pop {r0} bx r0 - thumb_func_end dp03_build_bits_splash + thumb_func_end GetGroundEffectFlags_Puddle - thumb_func_start dp03_build_bits_8067E4C -dp03_build_bits_8067E4C: ; 8096950 + thumb_func_start GetGroundEffectFlags_Ripple +; void GetGroundEffectFlags_Ripple(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_Ripple: ; 8096950 push {r4,lr} adds r4, r1, 0 ldrb r0, [r0, 0x1E] - bl is_tile_x10_or_x16 + bl MetatileBehavior_HasRipples lsls r0, 24 cmp r0, 0 beq @0809696A @@ -265243,20 +265478,21 @@ dp03_build_bits_8067E4C: ; 8096950 pop {r4} pop {r0} bx r0 - thumb_func_end dp03_build_bits_8067E4C + thumb_func_end GetGroundEffectFlags_Ripple - thumb_func_start dp03_build_bits_tiny_grass -dp03_build_bits_tiny_grass: ; 8096970 + thumb_func_start GetGroundEffectFlags_ShortGrass +; void GetGroundEffectFlags_ShortGrass(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_ShortGrass: ; 8096970 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 ldrb r0, [r4, 0x1E] - bl sub_8089714 + bl MetatileBehavior_IsShortGrass lsls r0, 24 cmp r0, 0 beq @080969AE ldrb r0, [r4, 0x1F] - bl sub_8089714 + bl MetatileBehavior_IsShortGrass lsls r0, 24 cmp r0, 0 beq @080969AE @@ -265286,20 +265522,21 @@ dp03_build_bits_tiny_grass: ; 8096970 pop {r4,r5} pop {r0} bx r0 - thumb_func_end dp03_build_bits_tiny_grass + thumb_func_end GetGroundEffectFlags_ShortGrass - thumb_func_start dp03_build_bits_8067EBC -dp03_build_bits_8067EBC: ; 80969C0 + thumb_func_start GetGroundEffectFlags_HotSprings +; void GetGroundEffectFlags_HotSprings(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_HotSprings: ; 80969C0 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 ldrb r0, [r4, 0x1E] - bl is_tile_halfwater + bl MetatileBehavior_IsHotSprings lsls r0, 24 cmp r0, 0 beq @080969FE ldrb r0, [r4, 0x1F] - bl is_tile_halfwater + bl MetatileBehavior_IsHotSprings lsls r0, 24 cmp r0, 0 beq @080969FE @@ -265329,14 +265566,15 @@ dp03_build_bits_8067EBC: ; 80969C0 pop {r4,r5} pop {r0} bx r0 - thumb_func_end dp03_build_bits_8067EBC + thumb_func_end GetGroundEffectFlags_HotSprings - thumb_func_start dp03_build_bits_bubbles -dp03_build_bits_bubbles: ; 8096A10 + thumb_func_start GetGroundEffectFlags_Seaweed +; void GetGroundEffectFlags_Seaweed(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_Seaweed: ; 8096A10 push {r4,lr} adds r4, r1, 0 ldrb r0, [r0, 0x1E] - bl it_tile_x22 + bl MetatileBehavior_IsSeaweed lsls r0, 24 cmp r0, 0 beq @08096A2A @@ -265349,11 +265587,11 @@ dp03_build_bits_bubbles: ; 8096A10 pop {r4} pop {r0} bx r0 - thumb_func_end dp03_build_bits_bubbles + thumb_func_end GetGroundEffectFlags_Seaweed - thumb_func_start dp03_build_bits_by_block_behaviour -; void dp03_build_bits_by_block_behaviour(struct npc_state *fieldObject, struct obj *object) -dp03_build_bits_by_block_behaviour: ; 8096A30 + thumb_func_start GetGroundEffectFlags_JumpLanding +; void GetGroundEffectFlags_JumpLanding(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_JumpLanding: ; 8096A30 push {r4-r7,lr} mov r7, r8 push {r7} @@ -265397,10 +265635,11 @@ dp03_build_bits_by_block_behaviour: ; 8096A30 pop {r4-r7} pop {r0} bx r0 - thumb_func_end dp03_build_bits_by_block_behaviour + thumb_func_end GetGroundEffectFlags_JumpLanding - thumb_func_start npcs_and_water_something -npcs_and_water_something: ; 8096A8C + thumb_func_start FieldObjectCheckForReflectiveSurface +; u8 FieldObjectCheckForReflectiveSurface(struct npc_state *fieldObject) +FieldObjectCheckForReflectiveSurface: ; 8096A8C push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -265442,7 +265681,7 @@ npcs_and_water_something: ; 8096A8C bl cur_mapdata_block_get_role_at lsls r0, 24 lsrs r0, 24 - bl MetatileBehavior_GetReflectionType + bl GetReflectionTypeByMetatileBehavior lsls r0, 24 lsrs r0, 24 mov r9, r4 @@ -265457,7 +265696,7 @@ npcs_and_water_something: ; 8096A8C bl cur_mapdata_block_get_role_at lsls r0, 24 lsrs r0, 24 - bl MetatileBehavior_GetReflectionType + bl GetReflectionTypeByMetatileBehavior lsls r0, 24 lsrs r0, 24 cmp r0, 0 @@ -265485,7 +265724,7 @@ npcs_and_water_something: ; 8096A8C bl cur_mapdata_block_get_role_at lsls r0, 24 lsrs r0, 24 - bl MetatileBehavior_GetReflectionType + bl GetReflectionTypeByMetatileBehavior lsls r0, 24 lsrs r0, 24 cmp r0, 0 @@ -265500,7 +265739,7 @@ npcs_and_water_something: ; 8096A8C bl cur_mapdata_block_get_role_at lsls r0, 24 lsrs r0, 24 - bl MetatileBehavior_GetReflectionType + bl GetReflectionTypeByMetatileBehavior lsls r0, 24 lsrs r0, 24 cmp r0, 0 @@ -265515,7 +265754,7 @@ npcs_and_water_something: ; 8096A8C bl cur_mapdata_block_get_role_at lsls r0, 24 lsrs r0, 24 - bl MetatileBehavior_GetReflectionType + bl GetReflectionTypeByMetatileBehavior lsls r0, 24 lsrs r0, 24 cmp r0, 0 @@ -265530,7 +265769,7 @@ npcs_and_water_something: ; 8096A8C bl cur_mapdata_block_get_role_at lsls r0, 24 lsrs r0, 24 - bl MetatileBehavior_GetReflectionType + bl GetReflectionTypeByMetatileBehavior lsls r0, 24 lsrs r0, 24 cmp r0, 0 @@ -265561,10 +265800,11 @@ npcs_and_water_something: ; 8096A8C pop {r4-r7} pop {r1} bx r1 - thumb_func_end npcs_and_water_something + thumb_func_end FieldObjectCheckForReflectiveSurface - thumb_func_start MetatileBehavior_GetReflectionType -MetatileBehavior_GetReflectionType: ; 8096BDC + thumb_func_start GetReflectionTypeByMetatileBehavior +; u8 GetReflectionTypeByMetatileBehavior(u8 metatileBehavior) +GetReflectionTypeByMetatileBehavior: ; 8096BDC push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 @@ -265589,10 +265829,11 @@ MetatileBehavior_GetReflectionType: ; 8096BDC pop {r4} pop {r1} bx r1 - thumb_func_end MetatileBehavior_GetReflectionType + thumb_func_end GetReflectionTypeByMetatileBehavior - thumb_func_start GetJumpDirection -GetJumpDirection: ; 8096C0C + thumb_func_start GetLedgeJumpDirection +; u8 GetLedgeJumpDirection(u16 x, u16 y, u8 direction) +GetLedgeJumpDirection: ; 8096C0C push {r4,lr} lsls r0, 16 lsrs r3, r0, 16 @@ -265639,11 +265880,11 @@ GetJumpDirection: ; 8096C0C pop {r4} pop {r1} bx r1 - thumb_func_end GetJumpDirection + thumb_func_end GetLedgeJumpDirection - thumb_func_start npc_priority_in_long_grass -; void npc_priority_in_long_grass(struct npc_state *fieldObject, struct obj *object) -npc_priority_in_long_grass: ; 8096C68 + thumb_func_start FieldObjectSetSpriteOamTableForLongGrass +; void FieldObjectSetSpriteOamTableForLongGrass(struct npc_state *fieldObject, struct obj *object) +FieldObjectSetSpriteOamTableForLongGrass: ; 8096C68 push {r4-r6,lr} adds r5, r0, 0 adds r4, r1, 0 @@ -265672,7 +265913,7 @@ npc_priority_in_long_grass: ; 8096C68 strb r0, [r4] ldrb r0, [r5, 0xB] lsrs r0, 4 - bl sub_8096DA8 + bl ZCoordToPriority lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -265687,10 +265928,11 @@ npc_priority_in_long_grass: ; 8096C68 pop {r4-r6} pop {r0} bx r0 - thumb_func_end npc_priority_in_long_grass + thumb_func_end FieldObjectSetSpriteOamTableForLongGrass - thumb_func_start cur_mapdata_height_mismatch -cur_mapdata_height_mismatch: ; 8096CC4 + thumb_func_start IsZCoordMismatchAt +; BOOL IsZCoordMismatchAt(u8 z, u16 x, u16 y) +IsZCoordMismatchAt: ; 8096CC4 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 @@ -265704,7 +265946,7 @@ cur_mapdata_height_mismatch: ; 8096CC4 asrs r0, 16 lsls r1, 16 asrs r1, 16 - bl cur_mapdata_get_upper4bit_at + bl MapGridGetZCoordAt lsls r0, 24 lsrs r0, 24 cmp r0, 0 @@ -265722,11 +265964,11 @@ cur_mapdata_height_mismatch: ; 8096CC4 pop {r4} pop {r1} bx r1 - thumb_func_end cur_mapdata_height_mismatch + thumb_func_end IsZCoordMismatchAt - thumb_func_start sub_8096D00 -; void sub_8096D00(struct npc_state *fieldObject, struct obj *object) -sub_8096D00: ; 8096D00 + thumb_func_start FieldObjectUpdateZCoordAndPriority +; void FieldObjectUpdateZCoordAndPriority(struct npc_state *fieldObject, struct obj *object) +FieldObjectUpdateZCoordAndPriority: ; 8096D00 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 @@ -265735,7 +265977,7 @@ sub_8096D00: ; 8096D00 cmp r0, 0 blt @08096D4E adds r0, r4, 0 - bl sub_8096DB8 + bl FieldObjectUpdateZCoord ldr r1, =gUnknown_0850E644 ldrb r2, [r4, 0xB] lsls r2, 24 @@ -265770,10 +266012,11 @@ sub_8096D00: ; 8096D00 pop {r0} bx r0 .pool - thumb_func_end sub_8096D00 + thumb_func_end FieldObjectUpdateZCoordAndPriority - thumb_func_start sub_8096D5C -sub_8096D5C: ; 8096D5C + thumb_func_start InitObjectPriorityByZCoord +; void InitObjectPriorityByZCoord(struct obj *object, u8 z) +InitObjectPriorityByZCoord: ; 8096D5C push {r4,lr} lsls r1, 24 lsrs r1, 24 @@ -265809,10 +266052,11 @@ sub_8096D5C: ; 8096D5C pop {r0} bx r0 .pool - thumb_func_end sub_8096D5C + thumb_func_end InitObjectPriorityByZCoord - thumb_func_start sub_8096DA8 -sub_8096DA8: ; 8096DA8 + thumb_func_start ZCoordToPriority +; u8 ZCoordToPriority(u8 z) +ZCoordToPriority: ; 8096DA8 lsls r0, 24 lsrs r0, 24 ldr r1, =gUnknown_0850E634 @@ -265820,24 +266064,25 @@ sub_8096DA8: ; 8096DA8 ldrb r0, [r0] bx lr .pool - thumb_func_end sub_8096DA8 + thumb_func_end ZCoordToPriority - thumb_func_start sub_8096DB8 -sub_8096DB8: ; 8096DB8 + thumb_func_start FieldObjectUpdateZCoord +; void FieldObjectUpdateZCoord(struct npc_state *fieldObject) +FieldObjectUpdateZCoord: ; 8096DB8 push {r4,r5,lr} adds r4, r0, 0 movs r1, 0x10 ldrsh r0, [r4, r1] movs r2, 0x12 ldrsh r1, [r4, r2] - bl cur_mapdata_get_upper4bit_at + bl MapGridGetZCoordAt lsls r0, 24 lsrs r5, r0, 24 movs r1, 0x14 ldrsh r0, [r4, r1] movs r2, 0x16 ldrsh r1, [r4, r2] - bl cur_mapdata_get_upper4bit_at + bl MapGridGetZCoordAt lsls r0, 24 lsrs r0, 24 cmp r5, 0xF @@ -265865,11 +266110,11 @@ sub_8096DB8: ; 8096DB8 pop {r4,r5} pop {r0} bx r0 - thumb_func_end sub_8096DB8 + thumb_func_end FieldObjectUpdateZCoord - thumb_func_start npc_y_height_related -; void npc_y_height_related(u8 a1, struct obj *object, u8 a3) -npc_y_height_related: ; 8096E0C + thumb_func_start SetObjectSubpriorityByZCoord +; void SetObjectSubpriorityByZCoord(u8 z, struct obj *object, u8 offset) +SetObjectSubpriorityByZCoord: ; 8096E0C push {r4,r5,lr} lsls r0, 24 lsrs r0, 24 @@ -265903,10 +266148,11 @@ npc_y_height_related: ; 8096E0C pop {r0} bx r0 .pool - thumb_func_end npc_y_height_related + thumb_func_end SetObjectSubpriorityByZCoord - thumb_func_start npc_y_height_related_ -npc_y_height_related_: ; 8096E54 + thumb_func_start FieldObjectUpdateSubpriority +; void FieldObjectUpdateSubpriority(struct npc_state *fieldObject, struct obj *object) +FieldObjectUpdateSubpriority: ; 8096E54 push {lr} adds r2, r0, 0 ldrb r0, [r2, 0x3] @@ -265916,14 +266162,15 @@ npc_y_height_related_: ; 8096E54 ldrb r0, [r2, 0xB] lsrs r0, 4 movs r2, 0x1 - bl npc_y_height_related + bl SetObjectSubpriorityByZCoord @08096E6A: pop {r0} bx r0 - thumb_func_end npc_y_height_related_ + thumb_func_end FieldObjectUpdateSubpriority - thumb_func_start r0r1_zero_or_same -r0r1_zero_or_same: ; 8096E70 + thumb_func_start AreZCoordsCompatible +; BOOL AreZCoordsCompatible(u8 z1, u8 z2) +AreZCoordsCompatible: ; 8096E70 push {lr} lsls r0, 24 lsrs r0, 24 @@ -265943,10 +266190,11 @@ r0r1_zero_or_same: ; 8096E70 @08096E8C: pop {r1} bx r1 - thumb_func_end r0r1_zero_or_same + thumb_func_end AreZCoordsCompatible - thumb_func_start dp03_step_grass_normal -dp03_step_grass_normal: ; 8096E90 + thumb_func_start GroundEffect_SpawnOnTallGrass +; void GroundEffect_SpawnOnTallGrass(struct npc_state *fieldObject, struct obj *object) +GroundEffect_SpawnOnTallGrass: ; 8096E90 push {lr} ldr r3, =0x02038c08 movs r2, 0x10 @@ -265981,10 +266229,11 @@ dp03_step_grass_normal: ; 8096E90 pop {r0} bx r0 .pool - thumb_func_end dp03_step_grass_normal + thumb_func_end GroundEffect_SpawnOnTallGrass - thumb_func_start dp03_step_grass_elastic -dp03_step_grass_elastic: ; 8096EDC + thumb_func_start GroundEffect_StepOnTallGrass +; void GroundEffect_StepOnTallGrass(struct npc_state *fieldObject, struct obj *object) +GroundEffect_StepOnTallGrass: ; 8096EDC push {lr} ldr r3, =0x02038c08 movs r2, 0x10 @@ -266019,10 +266268,11 @@ dp03_step_grass_elastic: ; 8096EDC pop {r0} bx r0 .pool - thumb_func_end dp03_step_grass_elastic + thumb_func_end GroundEffect_StepOnTallGrass - thumb_func_start dp03_step_grass_tall_1 -dp03_step_grass_tall_1: ; 8096F28 + thumb_func_start GroundEffect_SpawnOnLongGrass +; void GroundEffect_SpawnOnLongGrass(struct npc_state *fieldObject, struct obj *object) +GroundEffect_SpawnOnLongGrass: ; 8096F28 push {lr} ldr r3, =0x02038c08 movs r2, 0x10 @@ -266057,10 +266307,11 @@ dp03_step_grass_tall_1: ; 8096F28 pop {r0} bx r0 .pool - thumb_func_end dp03_step_grass_tall_1 + thumb_func_end GroundEffect_SpawnOnLongGrass - thumb_func_start dp03_step_grass_tall_0 -dp03_step_grass_tall_0: ; 8096F74 + thumb_func_start GroundEffect_StepOnLongGrass +; void GroundEffect_StepOnLongGrass(struct npc_state *fieldObject, struct obj *object) +GroundEffect_StepOnLongGrass: ; 8096F74 push {lr} ldr r3, =0x02038c08 movs r2, 0x10 @@ -266095,38 +266346,42 @@ dp03_step_grass_tall_0: ; 8096F74 pop {r0} bx r0 .pool - thumb_func_end dp03_step_grass_tall_0 + thumb_func_end GroundEffect_StepOnLongGrass - thumb_func_start dp03_step_water_reflection_0 -dp03_step_water_reflection_0: ; 8096FC0 + thumb_func_start GroundEffect_WaterReflection +; void GroundEffect_WaterReflection(struct npc_state *fieldObject, struct obj *object) +GroundEffect_WaterReflection: ; 8096FC0 push {lr} movs r2, 0 - bl dp03_step_water_reflection + bl SetUpReflection pop {r0} bx r0 - thumb_func_end dp03_step_water_reflection_0 + thumb_func_end GroundEffect_WaterReflection - thumb_func_start sub_8096FCC -sub_8096FCC: ; 8096FCC + thumb_func_start GroundEffect_IceReflection +; void GroundEffect_IceReflection(struct npc_state *fieldObject, struct obj *object) +GroundEffect_IceReflection: ; 8096FCC push {lr} movs r2, 0x1 - bl dp03_step_water_reflection + bl SetUpReflection pop {r0} bx r0 - thumb_func_end sub_8096FCC + thumb_func_end GroundEffect_IceReflection - thumb_func_start do_feet_in_flowing_water_effect -do_feet_in_flowing_water_effect: ; 8096FD8 + thumb_func_start GroundEffect_FlowingWater +; void GroundEffect_FlowingWater(struct npc_state *fieldObject, struct obj *object) +GroundEffect_FlowingWater: ; 8096FD8 push {lr} adds r1, r0, 0 movs r0, 0x22 bl oe_exec_and_other_stuff pop {r0} bx r0 - thumb_func_end do_feet_in_flowing_water_effect + thumb_func_end GroundEffect_FlowingWater - thumb_func_start step_sand_light -step_sand_light: ; 8096FE8 + thumb_func_start GroundEffect_SandTracks +; void GroundEffect_SandTracks(struct npc_state *fieldObject, struct obj *object) +GroundEffect_SandTracks: ; 8096FE8 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 @@ -266145,10 +266400,11 @@ step_sand_light: ; 8096FE8 pop {r0} bx r0 .pool - thumb_func_end step_sand_light + thumb_func_end GroundEffect_SandTracks - thumb_func_start dp03_step_sand_heavy -dp03_step_sand_heavy: ; 8097014 + thumb_func_start GroundEffect_DeepSandTracks +; void GroundEffect_DeepSandTracks(struct npc_state *fieldObject, struct obj *object) +GroundEffect_DeepSandTracks: ; 8097014 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 @@ -266167,15 +266423,17 @@ dp03_step_sand_heavy: ; 8097014 pop {r0} bx r0 .pool - thumb_func_end dp03_step_sand_heavy + thumb_func_end GroundEffect_DeepSandTracks - thumb_func_start nullsub_93 -nullsub_93: ; 8097040 + thumb_func_start DoTracksGroundEffect_None +; void DoTracksGroundEffect_None(struct npc_state *fieldObject, struct obj *object) +DoTracksGroundEffect_None: ; 8097040 bx lr - thumb_func_end nullsub_93 + thumb_func_end DoTracksGroundEffect_None - thumb_func_start do_sand_step_footprint_effect -do_sand_step_footprint_effect: ; 8097044 + thumb_func_start DoTracksGroundEffect_Footprints +; void DoTracksGroundEffect_Footprints(struct npc_state *fieldObject, struct obj *object) +DoTracksGroundEffect_Footprints: ; 8097044 push {r4,r5,lr} sub sp, 0x4 adds r5, r0, 0 @@ -266210,10 +266468,11 @@ do_sand_step_footprint_effect: ; 8097044 pop {r0} bx r0 .pool - thumb_func_end do_sand_step_footprint_effect + thumb_func_end DoTracksGroundEffect_Footprints - thumb_func_start do_sand_step_bike_tire_tracks_effect -do_sand_step_bike_tire_tracks_effect: ; 8097094 + thumb_func_start DoTracksGroundEffect_BikeTireTracks +; void DoTracksGroundEffect_BikeTireTracks(struct npc_state *fieldObject, struct obj *object) +DoTracksGroundEffect_BikeTireTracks: ; 8097094 push {r4,lr} adds r4, r0, 0 ldr r1, [r4, 0x10] @@ -266251,38 +266510,42 @@ do_sand_step_bike_tire_tracks_effect: ; 8097094 pop {r0} bx r0 .pool - thumb_func_end do_sand_step_bike_tire_tracks_effect + thumb_func_end DoTracksGroundEffect_BikeTireTracks - thumb_func_start step_puddle -step_puddle: ; 80970E4 + thumb_func_start GroundEffect_Ripple +; void GroundEffect_Ripple(struct npc_state *fieldObject, struct obj *object) +GroundEffect_Ripple: ; 80970E4 push {lr} - bl do_puddle_step_effect + bl DoRippleFieldEffect pop {r0} bx r0 - thumb_func_end step_puddle + thumb_func_end GroundEffect_Ripple - thumb_func_start dp03_step_splash_small -dp03_step_splash_small: ; 80970F0 + thumb_func_start GroundEffect_StepOnPuddle +; void GroundEffect_StepOnPuddle(struct npc_state *fieldObject, struct obj *object) +GroundEffect_StepOnPuddle: ; 80970F0 push {lr} adds r1, r0, 0 movs r0, 0xF bl oe_exec_and_other_stuff pop {r0} bx r0 - thumb_func_end dp03_step_splash_small + thumb_func_end GroundEffect_StepOnPuddle - thumb_func_start sub_8097100 -sub_8097100: ; 8097100 + thumb_func_start GroundEffect_SandHeap +; void GroundEffect_SandHeap(struct npc_state *fieldObject, struct obj *object) +GroundEffect_SandHeap: ; 8097100 push {lr} adds r1, r0, 0 movs r0, 0x27 bl oe_exec_and_other_stuff pop {r0} bx r0 - thumb_func_end sub_8097100 + thumb_func_end GroundEffect_SandHeap - thumb_func_start dp03_step_grass_thin -dp03_step_grass_thin: ; 8097110 + thumb_func_start GroundEffect_JumpOnTallGrass +; void GroundEffect_JumpOnTallGrass(struct npc_state *fieldObject, struct obj *object) +GroundEffect_JumpOnTallGrass: ; 8097110 push {r4-r7,lr} sub sp, 0x4 adds r5, r0, 0 @@ -266316,17 +266579,18 @@ dp03_step_grass_thin: ; 8097110 bne @0809715A adds r0, r5, 0 adds r1, r6, 0 - bl dp03_step_grass_normal + bl GroundEffect_SpawnOnTallGrass @0809715A: add sp, 0x4 pop {r4-r7} pop {r0} bx r0 .pool - thumb_func_end dp03_step_grass_thin + thumb_func_end GroundEffect_JumpOnTallGrass - thumb_func_start dp03_step_grass_heavy -dp03_step_grass_heavy: ; 8097168 + thumb_func_start GroundEffect_JumpOnLongGrass +; void GroundEffect_JumpOnLongGrass(struct npc_state *fieldObject, struct obj *object) +GroundEffect_JumpOnLongGrass: ; 8097168 push {lr} ldr r2, =0x02038c08 movs r3, 0x10 @@ -266345,10 +266609,11 @@ dp03_step_grass_heavy: ; 8097168 pop {r0} bx r0 .pool - thumb_func_end dp03_step_grass_heavy + thumb_func_end GroundEffect_JumpOnLongGrass - thumb_func_start dp03_step_bike_splash_probably -dp03_step_bike_splash_probably: ; 8097190 + thumb_func_start GroundEffect_JumpOnShallowWater +; void GroundEffect_JumpOnShallowWater(struct npc_state *fieldObject, struct obj *object) +GroundEffect_JumpOnShallowWater: ; 8097190 push {r4,lr} ldr r3, =0x02038c08 movs r4, 0x10 @@ -266370,10 +266635,11 @@ dp03_step_bike_splash_probably: ; 8097190 pop {r0} bx r0 .pool - thumb_func_end dp03_step_bike_splash_probably + thumb_func_end GroundEffect_JumpOnShallowWater - thumb_func_start dp03_step_drop_water -dp03_step_drop_water: ; 80971C0 + thumb_func_start GroundEffect_JumpOnWater +; void GroundEffect_JumpOnWater(struct npc_state *fieldObject, struct obj *object) +GroundEffect_JumpOnWater: ; 80971C0 push {r4,lr} ldr r3, =0x02038c08 movs r4, 0x10 @@ -266395,10 +266661,11 @@ dp03_step_drop_water: ; 80971C0 pop {r0} bx r0 .pool - thumb_func_end dp03_step_drop_water + thumb_func_end GroundEffect_JumpOnWater - thumb_func_start dp03_step_dust -dp03_step_dust: ; 80971F0 + thumb_func_start GroundEffect_JumpLandingDust +; void GroundEffect_JumpLandingDust(struct npc_state *fieldObject, struct obj *object) +GroundEffect_JumpLandingDust: ; 80971F0 push {r4,lr} ldr r3, =0x02038c08 movs r4, 0x10 @@ -266420,30 +266687,33 @@ dp03_step_dust: ; 80971F0 pop {r0} bx r0 .pool - thumb_func_end dp03_step_dust + thumb_func_end GroundEffect_JumpLandingDust - thumb_func_start dp03_step_grass_tiny -dp03_step_grass_tiny: ; 8097220 + thumb_func_start GroundEffect_ShortGrass +; void GroundEffect_ShortGrass(struct npc_state *fieldObject, struct obj *object) +GroundEffect_ShortGrass: ; 8097220 push {lr} adds r1, r0, 0 movs r0, 0x29 bl oe_exec_and_other_stuff pop {r0} bx r0 - thumb_func_end dp03_step_grass_tiny + thumb_func_end GroundEffect_ShortGrass - thumb_func_start do_hot_springs_water_effect -do_hot_springs_water_effect: ; 8097230 + thumb_func_start GroundEffect_HotSprings +; void GroundEffect_HotSprings(struct npc_state *fieldObject, struct obj *object) +GroundEffect_HotSprings: ; 8097230 push {lr} adds r1, r0, 0 movs r0, 0x2A bl oe_exec_and_other_stuff pop {r0} bx r0 - thumb_func_end do_hot_springs_water_effect + thumb_func_end GroundEffect_HotSprings - thumb_func_start dp03_step_bubbles -dp03_step_bubbles: ; 8097240 + thumb_func_start GroundEffect_Seaweed +; void GroundEffect_Seaweed(struct npc_state *fieldObject, struct obj *object) +GroundEffect_Seaweed: ; 8097240 push {lr} ldr r2, =0x02038c08 movs r3, 0x10 @@ -266457,17 +266727,18 @@ dp03_step_bubbles: ; 8097240 pop {r0} bx r0 .pool - thumb_func_end dp03_step_bubbles + thumb_func_end GroundEffect_Seaweed - thumb_func_start ground_call_by_bits -ground_call_by_bits: ; 8097260 + thumb_func_start DoFlaggedGroundEffects +; void DoFlaggedGroundEffects(struct npc_state *fieldObject, struct obj *object, u32 flags) +DoFlaggedGroundEffects: ; 8097260 push {r4-r7,lr} mov r7, r8 push {r7} adds r6, r0, 0 adds r7, r1, 0 adds r5, r2, 0 - bl is_faraway_island_mew + bl FieldObjectIsFarawayIslandMew lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -266506,10 +266777,11 @@ ground_call_by_bits: ; 8097260 pop {r0} bx r0 .pool - thumb_func_end ground_call_by_bits + thumb_func_end DoFlaggedGroundEffects - thumb_func_start sub_80972BC -sub_80972BC: ; 80972BC + thumb_func_start filters_out_some_ground_effects +; void filters_out_some_ground_effects(struct npc_state *fieldObject, u32 *flags) +filters_out_some_ground_effects: ; 80972BC push {lr} adds r2, r0, 0 adds r3, r1, 0 @@ -266537,10 +266809,11 @@ sub_80972BC: ; 80972BC pop {r0} bx r0 .pool - thumb_func_end sub_80972BC + thumb_func_end filters_out_some_ground_effects - thumb_func_start ground_bits_filter_small_splashes -ground_bits_filter_small_splashes: ; 80972F4 + thumb_func_start FilterOutStepOnPuddleGroundEffectIfJumping +; void FilterOutStepOnPuddleGroundEffectIfJumping(struct npc_state *fieldObject, u32 *flags) +FilterOutStepOnPuddleGroundEffectIfJumping: ; 80972F4 push {lr} adds r2, r1, 0 ldrb r0, [r0] @@ -266555,10 +266828,11 @@ ground_bits_filter_small_splashes: ; 80972F4 pop {r0} bx r0 .pool - thumb_func_end ground_bits_filter_small_splashes + thumb_func_end FilterOutStepOnPuddleGroundEffectIfJumping - thumb_func_start dp03_something_2 -dp03_something_2: ; 8097310 + thumb_func_start DoGroundEffects_OnSpawn +; void DoGroundEffects_OnSpawn(struct npc_state *fieldObject, struct obj *object) +DoGroundEffects_OnSpawn: ; 8097310 push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 @@ -266570,17 +266844,17 @@ dp03_something_2: ; 8097310 movs r0, 0 str r0, [sp] adds r0, r4, 0 - bl sub_8096D00 + bl FieldObjectUpdateZCoordAndPriority adds r0, r4, 0 mov r1, sp - bl dp03_build_bits_2 + bl GetAllGroundEffectFlags_OnSpawn adds r0, r4, 0 adds r1, r5, 0 - bl npc_priority_in_long_grass + bl FieldObjectSetSpriteOamTableForLongGrass ldr r2, [sp] adds r0, r4, 0 adds r1, r5, 0 - bl ground_call_by_bits + bl DoFlaggedGroundEffects ldrb r1, [r4] movs r0, 0x5 negs r0, r0 @@ -266594,10 +266868,11 @@ dp03_something_2: ; 8097310 pop {r4,r5} pop {r0} bx r0 - thumb_func_end dp03_something_2 + thumb_func_end DoGroundEffects_OnSpawn - thumb_func_start dp03_something -dp03_something: ; 809735C + thumb_func_start DoGroundEffects_OnBeginStep +; void DoGroundEffects_OnBeginStep(struct npc_state *fieldObject, struct obj *object) +DoGroundEffects_OnBeginStep: ; 809735C push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 @@ -266609,20 +266884,20 @@ dp03_something: ; 809735C movs r0, 0 str r0, [sp] adds r0, r4, 0 - bl sub_8096D00 + bl FieldObjectUpdateZCoordAndPriority adds r0, r4, 0 mov r1, sp - bl dp03_build_bits_1 + bl GetAllGroundEffectFlags_OnBeginStep adds r0, r4, 0 adds r1, r5, 0 - bl npc_priority_in_long_grass + bl FieldObjectSetSpriteOamTableForLongGrass adds r0, r4, 0 mov r1, sp - bl sub_80972BC + bl filters_out_some_ground_effects ldr r2, [sp] adds r0, r4, 0 adds r1, r5, 0 - bl ground_call_by_bits + bl DoFlaggedGroundEffects ldrb r1, [r4] movs r0, 0x5 negs r0, r0 @@ -266636,11 +266911,11 @@ dp03_something: ; 809735C pop {r4,r5} pop {r0} bx r0 - thumb_func_end dp03_something + thumb_func_end DoGroundEffects_OnBeginStep - thumb_func_start ground_effects -; void ground_effects(struct npc_state *fieldObject, struct obj *object) -ground_effects: ; 80973B0 + thumb_func_start DoGroundEffects_OnFinishStep +; void DoGroundEffects_OnFinishStep(struct npc_state *fieldObject, struct obj *object) +DoGroundEffects_OnFinishStep: ; 80973B0 push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 @@ -266652,20 +266927,20 @@ ground_effects: ; 80973B0 movs r0, 0 str r0, [sp] adds r0, r4, 0 - bl sub_8096D00 + bl FieldObjectUpdateZCoordAndPriority adds r0, r4, 0 mov r1, sp - bl npc_analyze_ground + bl GetAllGroundEffectFlags_OnFinishStep adds r0, r4, 0 adds r1, r5, 0 - bl npc_priority_in_long_grass + bl FieldObjectSetSpriteOamTableForLongGrass adds r0, r4, 0 mov r1, sp - bl ground_bits_filter_small_splashes + bl FilterOutStepOnPuddleGroundEffectIfJumping ldr r2, [sp] adds r0, r4, 0 adds r1, r5, 0 - bl ground_call_by_bits + bl DoFlaggedGroundEffects ldrb r1, [r4] movs r0, 0x9 negs r0, r0 @@ -266679,9 +266954,10 @@ ground_effects: ; 80973B0 pop {r4,r5} pop {r0} bx r0 - thumb_func_end ground_effects + thumb_func_end DoGroundEffects_OnFinishStep thumb_func_start sub_8097404 +; BOOL sub_8097404(struct npc_state *fieldObject) sub_8097404: ; 8097404 push {r4,r5,lr} adds r5, r0, 0 @@ -266758,6 +267034,7 @@ sub_8097404: ; 8097404 thumb_func_end sub_8097404 thumb_func_start player_bitmagic +; void player_bitmagic() player_bitmagic: ; 8097494 push {r4,r5,lr} movs r4, 0 @@ -266826,6 +267103,7 @@ sub_80974D0: ; 80974D0 thumb_func_end sub_80974D0 thumb_func_start npc_sync_anim_pause_bits +; void npc_sync_anim_pause_bits(struct npc_state *fieldObject) npc_sync_anim_pause_bits: ; 8097514 push {r4,r5,lr} adds r5, r0, 0 @@ -266907,6 +267185,7 @@ sub_809757C: ; 809757C thumb_func_end sub_809757C thumb_func_start little_step +; void little_step(struct obj *object, u8 direction) little_step: ; 80975AC lsls r1, 24 ldr r2, =gUnknown_0850DB7C @@ -266987,6 +267266,7 @@ quad_little_steps: ; 8097618 thumb_func_end quad_little_steps thumb_func_start oct_little_steps +; void oct_little_steps(struct obj *object, u8 direction) oct_little_steps: ; 809763C lsls r1, 24 ldr r2, =gUnknown_0850DB7C @@ -267007,6 +267287,7 @@ oct_little_steps: ; 809763C thumb_func_end oct_little_steps thumb_func_start oamt_npc_ministep_reset +; void oamt_npc_ministep_reset(struct obj *object, u8 direction, u8 speed) oamt_npc_ministep_reset: ; 8097660 lsls r1, 24 lsrs r1, 24 @@ -267020,6 +267301,7 @@ oamt_npc_ministep_reset: ; 8097660 thumb_func_end oamt_npc_ministep_reset thumb_func_start obj_npc_ministep +; BOOL obj_npc_ministep(struct obj *object) obj_npc_ministep: ; 8097674 push {r4,r5,lr} adds r4, r0, 0 @@ -267073,6 +267355,7 @@ obj_npc_ministep: ; 8097674 thumb_func_end obj_npc_ministep thumb_func_start sub_80976DC +; void sub_80976DC(struct obj *object, u8 direction) sub_80976DC: ; 80976DC lsls r1, 24 lsrs r1, 24 @@ -267084,6 +267367,7 @@ sub_80976DC: ; 80976DC thumb_func_end sub_80976DC thumb_func_start sub_80976EC +; BOOL sub_80976EC(struct obj *object) sub_80976EC: ; 80976EC push {r4,lr} adds r4, r0, 0 @@ -267437,12 +267721,14 @@ sub_80978E4: ; 80978E4 thumb_func_end sub_80978E4 thumb_func_start sub_8097978 +; void sub_8097978(struct obj *object, u16 a2) sub_8097978: ; 8097978 strh r1, [r0, 0x34] bx lr thumb_func_end sub_8097978 thumb_func_start sub_809797C +; BOOL sub_809797C(struct obj *object) sub_809797C: ; 809797C push {lr} ldrh r1, [r0, 0x34] @@ -267639,7 +267925,7 @@ sub_8097AC8: ; 8097AC8 lsrs r0, 24 adds r1, r4, 0 movs r2, 0x1 - bl npc_y_height_related + bl SetObjectSubpriorityByZCoord ldrh r1, [r4, 0x32] lsls r1, 24 lsrs r1, 24 @@ -267741,7 +268027,7 @@ sub_8097B78: ; 8097B78 ldr r0, =0x02020630 adds r4, r0 adds r0, r5, 0 - bl npc_direction_to_obj_anim_image_number + bl FieldObjectDirectionToImageAnimId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -268065,7 +268351,7 @@ oe_exec_and_other_stuff: ; 8097DD0 adds r2, r1, 0x4 adds r3, r1, 0 adds r3, 0x8 - bl npc_get_local_id_and_mapnumbers + bl FieldObjectGetLocalIdAndMap adds r0, r4, 0 bl FieldEffectStart pop {r4} @@ -268074,8 +268360,8 @@ oe_exec_and_other_stuff: ; 8097DD0 .pool thumb_func_end oe_exec_and_other_stuff - thumb_func_start do_animation_x03 -do_animation_x03: ; 8097DF8 + thumb_func_start DoShadowFieldEffect +DoShadowFieldEffect: ; 8097DF8 push {lr} adds r1, r0, 0 ldrb r2, [r1, 0x2] @@ -268090,10 +268376,11 @@ do_animation_x03: ; 8097DF8 @08097E10: pop {r0} bx r0 - thumb_func_end do_animation_x03 + thumb_func_end DoShadowFieldEffect - thumb_func_start do_puddle_step_effect -do_puddle_step_effect: ; 8097E14 + thumb_func_start DoRippleFieldEffect +; void DoRippleFieldEffect(struct npc_state *fieldObject, struct obj *object) +DoRippleFieldEffect: ; 8097E14 push {r4,lr} adds r4, r1, 0 ldrb r0, [r0, 0x5] @@ -268120,7 +268407,7 @@ do_puddle_step_effect: ; 8097E14 pop {r0} bx r0 .pool - thumb_func_end do_puddle_step_effect + thumb_func_end DoRippleFieldEffect thumb_func_start sub_8097E50 sub_8097E50: ; 8097E50 @@ -268284,6 +268571,7 @@ sub_8097EF0: ; 8097EF0 thumb_func_end sub_8097EF0 thumb_func_start sub_8097F78 +; signed int sub_8097F78(npc_state *a1) sub_8097F78: ; 8097F78 push {lr} movs r2, 0 @@ -269037,7 +269325,7 @@ sub_80984F4: ; 80984F4 movs r0, 0xFF movs r1, 0 movs r2, 0 - bl get_npc_id_by_local_id + bl GetFieldObjectIdByLocalIdAndMap adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -269046,7 +269334,7 @@ sub_80984F4: ; 80984F4 lsls r0, 2 ldr r1, =0x02037350 adds r0, r1 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished bl sub_80D338C bl sub_809757C pop {r0} @@ -269069,12 +269357,12 @@ sub_8098524: ; 8098524 cmp r0, 0 beq @08098542 adds r0, r1, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished @08098542: movs r0, 0xFF movs r1, 0 movs r2, 0 - bl get_npc_id_by_local_id + bl GetFieldObjectIdByLocalIdAndMap adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -269082,7 +269370,7 @@ sub_8098524: ; 8098524 adds r0, r1 lsls r0, 2 adds r0, r4 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished bl sub_80D338C bl sub_809757C pop {r4} @@ -269103,7 +269391,7 @@ sub_8098574: ; 8098574 adds r0, r1 ldr r1, =0x020375f4 ldrb r1, [r1] - bl npc_reciprocate_look + bl FieldObjectFaceOppositeDirection pop {r0} bx r0 .pool @@ -269119,7 +269407,7 @@ sub_809859C: ; 809859C lsls r0, 2 ldr r1, =0x02037350 adds r0, r1 - bl npc_hide_and_trainer_flag_clear_on_tile_x66_at_pos + bl FieldObjectClearAnimIfSpecialAnimActive pop {r0} bx r0 .pool @@ -270709,6 +270997,7 @@ sub_80990FC: ; 80990FC thumb_func_end sub_80990FC thumb_func_start sub_8099188 +; u32 sub_8099188(u8 a1, u32 script) sub_8099188: ; 8099188 push {r4-r7,lr} adds r4, r1, 0 @@ -272683,7 +272972,7 @@ sub_809A054: ; 809A054 adds r4, 0x6 add r0, sp, 0x4 adds r1, r4, 0 - bl player_get_pos_to + bl PlayerGetDestCoords cmp r6, 0xFF bne @0809A092 cmp r5, 0xFF @@ -273299,7 +273588,7 @@ s33_play_music: ; 809A52C cmp r1, 0x1 bne @0809A54C adds r0, r2, 0 - bl sav1_set_x2C + bl sav1_set_battle_music_maybe @0809A54C: adds r0, r5, 0 bl current_map_music_set @@ -273315,7 +273604,7 @@ s34_unknown: ; 809A55C bl script_read_halfword lsls r0, 16 lsrs r0, 16 - bl sav1_set_x2C + bl sav1_set_battle_music_maybe movs r0, 0 pop {r1} bx r1 @@ -273556,7 +273845,7 @@ s53_hide_sprite: ; 809A740 ldr r2, [r1] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] - bl npc_hide_by_local_id_and_map + bl RemoveFieldObjectByLocalIdAndMap movs r0, 0 pop {r1} bx r1 @@ -273580,7 +273869,7 @@ s54_hide_sprite_set_coords: ; 809A768 str r3, [r4, 0x8] lsls r0, 24 lsrs r0, 24 - bl npc_hide_by_local_id_and_map + bl RemoveFieldObjectByLocalIdAndMap movs r0, 0 pop {r4} pop {r1} @@ -273711,7 +274000,7 @@ s63_new_sprite_location_permanent: ; 809A858 asrs r2, 16 adds r0, r5, 0 adds r1, r4, 0 - bl sub_8084910 + bl update_saveblock1_field_object_coords movs r0, 0 pop {r4-r6} pop {r1} @@ -273856,12 +274145,12 @@ s5A_face_player: ; 809A9A4 lsls r0, 31 cmp r0, 0 beq @0809A9CC - bl player_get_direction__sp1AA + bl player_get_direction_lower_nybble adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl npc_reciprocate_look + bl FieldObjectFaceOppositeDirection @0809A9CC: movs r0, 0 pop {r4} @@ -273888,7 +274177,7 @@ s5B_npc_set_direction: ; 809A9DC ldr r2, [r1] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] - bl npc_turn_by_local_id_and_map + bl FieldObjectTurnByLocalIdAndMap movs r0, 0 pop {r4} pop {r1} @@ -273910,7 +274199,7 @@ s65_set_sprite_behaviour: ; 809AA10 str r2, [r4, 0x8] lsls r0, 24 lsrs r0, 24 - bl sub_808494C + bl update_saveblock1_field_object_movement_behavior movs r0, 0 pop {r4} pop {r1} @@ -274059,7 +274348,7 @@ s6B_release: ; 809AB44 movs r0, 0xFF movs r1, 0 movs r2, 0 - bl get_npc_id_by_local_id + bl GetFieldObjectIdByLocalIdAndMap adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -274068,7 +274357,7 @@ s6B_release: ; 809AB44 lsls r0, 2 ldr r1, =0x02037350 adds r0, r1 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished bl sub_80D338C bl sub_809757C movs r0, 0 @@ -274093,12 +274382,12 @@ s6C_release_2: ; 809AB7C cmp r0, 0 beq @0809AB9E adds r0, r1, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished @0809AB9E: movs r0, 0xFF movs r1, 0 movs r2, 0 - bl get_npc_id_by_local_id + bl GetFieldObjectIdByLocalIdAndMap adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -274106,7 +274395,7 @@ s6C_release_2: ; 809AB7C adds r0, r1 lsls r0, 2 adds r0, r4 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished bl sub_80D338C bl sub_809757C movs r0, 0 @@ -274174,8 +274463,8 @@ s9B_unknown: ; 809AC0C .pool thumb_func_end s9B_unknown - thumb_func_start s78_braille_msgbox -s78_braille_msgbox: ; 809AC3C + thumb_func_start sub_809AC3C +sub_809AC3C: ; 809AC3C push {r4,r5,lr} sub sp, 0xC adds r5, r0, 0 @@ -274203,7 +274492,7 @@ s78_braille_msgbox: ; 809AC3C pop {r4,r5} pop {r1} bx r1 - thumb_func_end s78_braille_msgbox + thumb_func_end sub_809AC3C thumb_func_start sub_809AC78 sub_809AC78: ; 809AC78 @@ -276403,7 +276692,7 @@ sD1_warp_v5: ; 809BCDC adds r2, r6, 0 adds r3, r4, 0 bl warp1_set - bl player_get_direction__sp1AA + bl player_get_direction_lower_nybble lsls r0, 24 lsrs r0, 24 bl sub_808D074 @@ -276781,7 +277070,7 @@ sub_809C014: ; 809C014 strh r1, [r0] ldr r0, =0x03005df0 strb r1, [r0] - bl player_get_direction__sp1AA + bl player_get_direction_lower_nybble lsls r0, 24 lsrs r6, r0, 24 mov r4, sp @@ -276795,7 +277084,7 @@ sub_809C014: ; 809C014 bl cur_mapdata_block_get_role_at lsls r0, 16 lsrs r4, r0, 16 - bl sub_80B3BE8 + bl unknown__trainer_related lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -276947,8 +277236,8 @@ player_get_pos_to_and_height: ; 809C17C push {r4,lr} adds r4, r0, 0 adds r1, r4, 0x2 - bl player_get_pos_to - bl player_get_height + bl PlayerGetDestCoords + bl PlayerGetZCoord strb r0, [r4, 0x4] pop {r4} pop {r0} @@ -276966,18 +277255,18 @@ player_get_next_pos_and_height: ; 809C194 adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to + bl PlayerGetDestCoords mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r4, r2] - bl cur_mapdata_get_upper4bit_at + bl MapGridGetZCoordAt lsls r0, 24 lsrs r0, 24 cmp r0, 0 beq @0809C1C6 - bl player_get_height + bl PlayerGetZCoord @0809C1C6: strb r0, [r5, 0x4] add sp, 0x4 @@ -276994,7 +277283,7 @@ cur_mapdata_block_role_at_player_pos: ; 809C1D0 adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to + bl PlayerGetDestCoords mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] @@ -277139,7 +277428,7 @@ sub_809C2C8: ; 809C2C8 lsrs r1, 16 @0809C30E: ldrb r2, [r4, 0x4] - bl npc_id_by_pos_and_height + bl GetFieldObjectIdByXYZ lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0x10 @@ -277183,7 +277472,7 @@ sub_809C2C8: ; 809C2C8 ldr r0, =0x020375f4 strh r6, [r0] adds r0, r3, 0 - bl npc_get_script_by_npc_id + bl GetFieldObjectScriptPointerByFieldObjectId @0809C36E: pop {r4-r6} pop {r1} @@ -277202,7 +277491,7 @@ TryGetMapObjectScript: ; 809C384 ldrh r0, [r5] ldrh r1, [r5, 0x2] ldrb r2, [r5, 0x4] - bl npc_id_by_pos_and_height + bl GetFieldObjectIdByXYZ lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x10 @@ -277239,7 +277528,7 @@ TryGetMapObjectScript: ; 809C384 lsls r1, 16 lsrs r1, 16 ldrb r2, [r5, 0x4] - bl npc_id_by_pos_and_height + bl GetFieldObjectIdByXYZ lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x10 @@ -277276,7 +277565,7 @@ TryGetMapObjectScript: ; 809C384 .pool @0809C43C: adds r0, r4, 0 - bl npc_get_script_by_npc_id + bl GetFieldObjectScriptPointerByFieldObjectId @0809C442: adds r1, r0, 0 ldr r0, =0x020375f2 @@ -277609,7 +277898,7 @@ TryGetMetatileBehaviorScript: ; 809C538 ldrsh r0, [r6, r1] movs r2, 0x2 ldrsh r1, [r6, r2] - bl cur_mapdata_get_upper4bit_at + bl MapGridGetZCoordAt lsls r0, 24 lsrs r0, 24 cmp r4, r0 @@ -277707,12 +277996,12 @@ TryGetFieldMoveScript: ; 809C7EC lsrs r0, 24 cmp r0, 0x1 bne @0809C824 - bl party_has_pokemon_with_surf + bl PartyHasMonWithSurf lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809C824 - bl sub_808BE74 + bl IsPlayerFacingSurfableFishableWater lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -277722,7 +278011,7 @@ TryGetFieldMoveScript: ; 809C7EC .pool @0809C824: adds r0, r4, 0 - bl is_tile_x13_waterfall + bl MetatileBehavior_IsWaterfall lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -277733,7 +278022,7 @@ TryGetFieldMoveScript: ; 809C7EC lsrs r0, 24 cmp r0, 0x1 bne @0809C858 - bl sub_808BE50 + bl IsPlayerSurfingNorth lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -277928,7 +278217,7 @@ sub_809C96C: ; 809C96C adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to + bl PlayerGetDestCoords mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] @@ -278331,7 +278620,7 @@ sub_809CC9C: ; 809CC9C b @0809CD8C @0809CD24: adds r0, r4, 0 - bl sub_8089898 + bl MetatileBehavior_IsAquaHideoutWarp lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -278425,7 +278714,7 @@ is_warp_tile: ; 809CD94 cmp r0, 0x1 beq @0809CE2A adds r0, r4, 0 - bl sub_8089898 + bl MetatileBehavior_IsAquaHideoutWarp lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -278482,22 +278771,22 @@ is_non_stair_warp_tile: ; 809CE34 @0809CE58: lsls r0, 24 lsrs r0, 24 - bl sub_8088FD4 + bl MetatileBehavior_IsNorthArrowWarp b @0809CE7E @0809CE62: lsls r0, 24 lsrs r0, 24 - bl is_tile_x65_warp_arrow_down + bl MetatileBehavior_IsSouthArrowWarp b @0809CE7E @0809CE6C: lsls r0, 24 lsrs r0, 24 - bl is_tile_x63_warp_arrow_left + bl MetatileBehavior_IsWestArrowWarp b @0809CE7E @0809CE76: lsls r0, 24 lsrs r0, 24 - bl is_tile_x62_warp_arrow_right + bl MetatileBehavior_IsEastArrowWarp @0809CE7E: lsls r0, 24 lsrs r0, 24 @@ -278972,7 +279261,7 @@ sub_809D1E8: ; 809D1E8 adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to + bl PlayerGetDestCoords mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] @@ -279043,7 +279332,7 @@ sub_809D1E8: ; 809D1E8 sub_809D280: ; 809D280 push {r4,r5,lr} sub sp, 0x8 - bl player_get_direction_upper_4bits + bl player_get_direction_upper_nybble adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 @@ -279072,7 +279361,7 @@ sub_809D280: ; 809D280 sub_809D2BC: ; 809D2BC push {r4,lr} sub sp, 0x8 - bl player_get_direction_upper_4bits + bl player_get_direction_upper_nybble mov r4, sp mov r0, sp bl player_get_pos_to_and_height @@ -280369,7 +280658,7 @@ sub_809DCB4: ; 809DCB4 adds r5, 0x2 mov r0, sp adds r1, r5, 0 - bl player_get_pos_to + bl PlayerGetDestCoords movs r1, 0x2 ldrsh r0, [r4, r1] adds r6, r5, 0 @@ -280492,7 +280781,7 @@ sub_809DCB4: ; 809DCB4 bl cur_mapdata_block_get_role_at lsls r0, 24 lsrs r0, 24 - bl is_tile_x17 + bl MetatileBehavior_IsPacifidlogLog lsls r0, 24 cmp r0, 0 beq @0809DE1E @@ -280546,7 +280835,7 @@ sub_809DE28: ; 809DE28 lsrs r4, r0, 16 lsls r1, 16 lsrs r5, r1, 16 - bl player_get_height + bl PlayerGetZCoord lsls r0, 24 lsrs r0, 24 movs r1, 0x1 @@ -280595,7 +280884,7 @@ sub_809DE8C: ; 809DE8C lsrs r4, r0, 16 lsls r1, 16 lsrs r5, r1, 16 - bl player_get_height + bl PlayerGetZCoord lsls r0, 24 lsrs r0, 24 movs r1, 0x1 @@ -280656,7 +280945,7 @@ sub_809DEF0: ; 809DEF0 adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to + bl PlayerGetDestCoords movs r0, 0x2 ldrsh r5, [r6, r0] mov r9, r4 @@ -280689,7 +280978,7 @@ sub_809DEF0: ; 809DEF0 bl cur_mapdata_block_get_role_at lsls r0, 24 lsrs r0, 24 - bl sub_8089750 + bl MetatileBehavior_IsFortreeBridge lsls r0, 24 cmp r0, 0 bne @0809DF62 @@ -280741,7 +281030,7 @@ sub_809DEF0: ; 809DEF0 bl cur_mapdata_block_get_role_at lsls r0, 24 lsrs r0, 24 - bl sub_8089750 + bl MetatileBehavior_IsFortreeBridge lsls r0, 24 lsrs r0, 24 str r0, [sp, 0x4] @@ -280752,10 +281041,10 @@ sub_809DEF0: ; 809DEF0 bl cur_mapdata_block_get_role_at lsls r0, 24 lsrs r0, 24 - bl sub_8089750 + bl MetatileBehavior_IsFortreeBridge lsls r0, 24 lsrs r7, r0, 24 - bl player_get_height + bl PlayerGetZCoord movs r1, 0 ands r5, r0 lsls r0, r5, 24 @@ -281079,7 +281368,7 @@ sub_809E224: ; 809E224 adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to + bl PlayerGetDestCoords mov r0, sp ldrh r0, [r0] strh r0, [r5, 0x4] @@ -281091,7 +281380,7 @@ sub_809E224: ; 809E224 adds r7, 0x2 mov r0, sp adds r1, r7, 0 - bl player_get_pos_to + bl PlayerGetDestCoords mov r0, sp ldrh r2, [r0] movs r3, 0 @@ -281258,7 +281547,7 @@ sub_809E3B4: ; 809E3B4 adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to + bl PlayerGetDestCoords mov r0, sp ldrh r2, [r0] movs r3, 0 @@ -281385,7 +281674,7 @@ sub_809E4CC: ; 809E4CC adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to + bl PlayerGetDestCoords mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] @@ -281569,7 +281858,7 @@ sub_809E638: ; 809E638 adds r5, 0x2 mov r0, sp adds r1, r5, 0 - bl player_get_pos_to + bl PlayerGetDestCoords ldr r0, =0x03005d8c ldr r0, [r0] movs r1, 0x4 @@ -281641,7 +281930,7 @@ sub_809E638: ; 809E638 bl cur_mapdata_block_get_role_at lsls r0, 24 lsrs r0, 24 - bl sub_8089940 + bl MetatileBehavior_IsMuddySlope lsls r0, 24 cmp r0, 0 beq @0809E708 @@ -312035,7 +312324,7 @@ sub_80AF334: ; 80AF334 adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to + bl PlayerGetDestCoords mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] @@ -312182,7 +312471,7 @@ sub_80AF438: ; 80AF438 bl player_bitmagic adds r0, r6, 0 adds r1, r7, 0 - bl player_get_pos_to + bl PlayerGetDestCoords movs r1, 0 ldrsh r0, [r6, r1] movs r2, 0 @@ -312200,7 +312489,7 @@ sub_80AF438: ; 80AF438 movs r0, 0xFF movs r1, 0 movs r2, 0 - bl get_npc_id_by_local_id + bl GetFieldObjectIdByLocalIdAndMap adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -312210,7 +312499,7 @@ sub_80AF438: ; 80AF438 ldr r1, =0x02037350 adds r0, r1 movs r1, 0x8 - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim movs r0, 0x2 strh r0, [r5, 0x8] b @080AF54A @@ -312231,7 +312520,7 @@ sub_80AF438: ; 80AF438 movs r0, 0xFF movs r1, 0 movs r2, 0 - bl get_npc_id_by_local_id + bl GetFieldObjectIdByLocalIdAndMap adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -312240,7 +312529,7 @@ sub_80AF438: ; 80AF438 lsls r0, 2 ldr r1, =0x02037350 adds r0, r1 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished movs r0, 0x3 strh r0, [r5, 0x8] b @080AF54A @@ -312308,7 +312597,7 @@ task_map_chg_seq_0807E20C: ; 80AF550 bl player_bitmagic adds r0, r6, 0 adds r1, r7, 0 - bl player_get_pos_to + bl PlayerGetDestCoords movs r0, 0x1 strh r0, [r5, 0x8] b @080AF60A @@ -312321,7 +312610,7 @@ task_map_chg_seq_0807E20C: ; 80AF550 movs r0, 0xFF movs r1, 0 movs r2, 0 - bl get_npc_id_by_local_id + bl GetFieldObjectIdByLocalIdAndMap lsls r0, 24 lsrs r0, 24 lsls r4, r0, 3 @@ -312329,15 +312618,15 @@ task_map_chg_seq_0807E20C: ; 80AF550 lsls r4, 2 ldr r0, =0x02037350 adds r4, r0 - bl player_get_direction__sp1AA + bl player_get_direction_lower_nybble lsls r0, 24 lsrs r0, 24 - bl sub_8093388 + bl GetGoSpeed0AnimId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim movs r0, 0x2 strh r0, [r5, 0x8] b @080AF60A @@ -312933,7 +313222,7 @@ sub_80AFA88: ; 80AFA88 bl player_bitmagic adds r0, r4, 0 adds r1, r6, 0 - bl player_get_pos_to + bl PlayerGetDestCoords movs r1, 0 ldrsh r0, [r4, r1] movs r2, 0 @@ -312971,7 +313260,7 @@ sub_80AFA88: ; 80AFA88 movs r0, 0xFF movs r1, 0 movs r2, 0 - bl get_npc_id_by_local_id + bl GetFieldObjectIdByLocalIdAndMap adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -312980,11 +313269,11 @@ sub_80AFA88: ; 80AFA88 lsls r0, 2 ldr r4, =0x02037350 adds r0, r4 - bl npc_hide_and_trainer_flag_clear_on_tile_x66_at_pos + bl FieldObjectClearAnimIfSpecialAnimActive movs r0, 0xFF movs r1, 0 movs r2, 0 - bl get_npc_id_by_local_id + bl GetFieldObjectIdByLocalIdAndMap adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -312993,7 +313282,7 @@ sub_80AFA88: ; 80AFA88 lsls r0, 2 adds r0, r4 movs r1, 0x9 - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim movs r0, 0x2 strh r0, [r5, 0x8] b @080AFBE8 @@ -313015,7 +313304,7 @@ sub_80AFA88: ; 80AFA88 movs r0, 0xFF movs r1, 0 movs r2, 0 - bl get_npc_id_by_local_id + bl GetFieldObjectIdByLocalIdAndMap adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -313024,7 +313313,7 @@ sub_80AFA88: ; 80AFA88 lsls r0, 2 ldr r1, =0x02037350 adds r0, r1 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished movs r0, 0 bl sub_80AF0F4 movs r0, 0x3 @@ -314944,7 +315233,7 @@ sub_80B0BD0: ; 80B0BD0 adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to + bl PlayerGetDestCoords mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] @@ -314956,7 +315245,7 @@ sub_80B0BD0: ; 80B0BD0 lsls r0, r5, 24 lsrs r4, r0, 24 adds r0, r4, 0 - bl is_tile_x02_or_xD1 + bl MetatileBehavior_IsTallGrass lsls r0, 24 cmp r0, 0 beq @080B0C06 @@ -314972,7 +315261,7 @@ sub_80B0BD0: ; 80B0BD0 b @080B0D1A @080B0C16: adds r0, r4, 0 - bl is_x21_or_x2B + bl MetatileBehavior_IsSandOrDeepSand lsls r0, 24 cmp r0, 0 bne @080B0D18 @@ -315011,7 +315300,7 @@ sub_80B0BD0: ; 80B0BD0 b @080B0D1A @080B0C78: adds r0, r4, 0 - bl is_tile_water_maybe + bl MetatileBehavior_IsSurfableWaterOrUnderwater lsls r0, 24 cmp r0, 0 bne @080B0CE0 @@ -315023,7 +315312,7 @@ sub_80B0BD0: ; 80B0BD0 @080B0C8C: lsls r0, r5, 24 lsrs r0, 24 - bl is_tile_water_maybe + bl MetatileBehavior_IsSurfableWaterOrUnderwater lsls r0, 24 cmp r0, 0 bne @080B0CF2 @@ -315037,7 +315326,7 @@ sub_80B0BD0: ; 80B0BD0 cmp r0, 0 bne @080B0CF2 adds r0, r4, 0 - bl is_tile_water_maybe + bl MetatileBehavior_IsSurfableWaterOrUnderwater lsls r0, 24 cmp r0, 0 bne @080B0CE0 @@ -315050,7 +315339,7 @@ sub_80B0BD0: ; 80B0BD0 b @080B0D1A @080B0CC8: movs r0, 0x8 - bl walkrun_bitfield_and_r0 + bl TestPlayerAvatarFlags lsls r0, 24 cmp r0, 0 beq @080B0CF6 @@ -315106,7 +315395,7 @@ sub_80B0D24: ; 80B0D24 adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to + bl PlayerGetDestCoords mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] @@ -315124,7 +315413,7 @@ sub_80B0D24: ; 80B0D24 @080B0D54: lsls r0, r4, 24 lsrs r0, 24 - bl is_tile_water_maybe + bl MetatileBehavior_IsSurfableWaterOrUnderwater lsls r0, 24 cmp r0, 0 bne @080B0D7C @@ -315704,7 +315993,7 @@ sub_80B11A8: ; 80B11A8 thumb_func_start sub_80B1204 sub_80B1204: ; 80B1204 push {lr} - bl sav1_reset_x2C + bl sav1_reset_battle_music_maybe ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music bl SetMainCallback2 pop {r0} @@ -315970,7 +316259,7 @@ battle_80801F0: ; 80B13F8 ldr r2, [r1] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] - bl get_npc_id_by_local_id + bl GetFieldObjectIdByLocalIdAndMap ldr r1, =0x03005df0 strb r0, [r1] @080B141A: @@ -319986,7 +320275,7 @@ sub_80B360C: ; 80B360C str r0, [r2] bl call_map_music_set_to_zero bl copy_player_party_from_sav1 - bl sub_8076FE0 + bl copy_bags_and_unk_data_to_save_blocks bl sub_813BF10 ldr r0, =0x020375e0 ldrh r0, [r0] @@ -320080,7 +320369,7 @@ sub_80B36EC: ; 80B36EC bne @080B370E @080B3706: bl copy_player_party_from_sav1 - bl sub_8076FE0 + bl copy_bags_and_unk_data_to_save_blocks @080B370E: movs r0, 0x7F bl copy_saved_warp2_bank_and_enter_x_to_warp1 @@ -320667,8 +320956,8 @@ sub_80B3BC4: ; 80B3BC4 .pool thumb_func_end sub_80B3BC4 - thumb_func_start sub_80B3BE8 -sub_80B3BE8: ; 80B3BE8 + thumb_func_start unknown__trainer_related +unknown__trainer_related: ; 80B3BE8 push {r4-r7,lr} ldr r0, =0x030060a8 movs r1, 0 @@ -320791,7 +321080,7 @@ sub_80B3BE8: ; 80B3BE8 pop {r1} bx r1 .pool - thumb_func_end sub_80B3BE8 + thumb_func_end unknown__trainer_related thumb_func_start sub_80B3D00 sub_80B3D00: ; 80B3D00 @@ -320810,7 +321099,7 @@ sub_80B3D00: ; 80B3D00 b @080B3D24 @080B3D1E: adds r0, r5, 0 - bl npc_get_script_by_npc_id + bl GetFieldObjectScriptPointerByFieldObjectId @080B3D24: adds r7, r0, 0 bl sub_81A9E40 @@ -320921,7 +321210,7 @@ sub_80B3DF0: ; 80B3DF0 adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to + bl PlayerGetDestCoords ldrb r0, [r7, 0x7] mov r8, r4 cmp r0, 0x1 @@ -321179,7 +321468,7 @@ sub_80B3FB0: ; 80B3FB0 adds r0, r7, 0 mov r1, sp adds r2, r4, 0 - bl numbers_move_direction + bl MoveCoords movs r5, 0 mov r8, r4 mov r4, r9 @@ -321212,7 +321501,7 @@ sub_80B3FB0: ; 80B3FB0 adds r0, r7, 0 mov r1, sp mov r2, r8 - bl numbers_move_direction + bl MoveCoords cmp r5, r4 blt @080B3FEE @080B4028: @@ -321392,18 +321681,18 @@ sub_80B417C: ; 80B417C adds r3, r1, 0 adds r3, 0x8 adds r0, r4, 0 - bl npc_get_local_id_and_mapnumbers + bl FieldObjectGetLocalIdAndMap movs r0, 0 bl FieldEffectStart ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 - bl d2s_look1 + bl GetFaceDirectionAnimId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim ldrh r0, [r5, 0x8] adds r0, 0x1 strh r0, [r5, 0x8] @@ -321458,12 +321747,12 @@ sub_80B4200: ; 80B4200 adds r5, r1, 0 adds r4, r2, 0 adds r0, r4, 0 - bl npc_is_visible_or_is_x40 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive lsls r0, 24 cmp r0, 0 beq @080B421E adds r0, r4, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished lsls r0, 24 cmp r0, 0 beq @080B4252 @@ -321475,12 +321764,12 @@ sub_80B4200: ; 80B4200 ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 - bl sub_8093388 + bl GetGoSpeed0AnimId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim ldrh r0, [r5, 0xE] subs r0, 0x1 strh r0, [r5, 0xE] @@ -321488,7 +321777,7 @@ sub_80B4200: ; 80B4200 @080B4244: adds r0, r4, 0 movs r1, 0x3E - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim ldrh r0, [r5, 0x8] adds r0, 0x1 strh r0, [r5, 0x8] @@ -321505,12 +321794,12 @@ sub_80B425C: ; 80B425C adds r6, r1, 0 adds r5, r2, 0 adds r0, r5, 0 - bl npc_is_visible_or_is_x40 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive lsls r0, 24 cmp r0, 0 beq @080B427A adds r0, r5, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished lsls r0, 24 cmp r0, 0 beq @080B4308 @@ -321543,12 +321832,12 @@ sub_80B425C: ; 80B425C ldr r1, =0x02037350 adds r4, r0, r1 adds r0, r4, 0 - bl npc_is_visible_or_is_x40 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive lsls r0, 24 cmp r0, 0 beq @080B42D2 adds r0, r4, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished lsls r0, 24 cmp r0, 0 beq @080B4308 @@ -321564,15 +321853,15 @@ sub_80B425C: ; 80B425C ldrb r0, [r5, 0x18] lsls r0, 28 lsrs r0, 28 - bl direction_reversed + bl GetOppositeDirection lsls r0, 24 lsrs r0, 24 - bl d2s_look1 + bl GetFaceDirectionAnimId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim ldrh r0, [r6, 0x8] adds r0, 0x1 strh r0, [r6, 0x8] @@ -321597,12 +321886,12 @@ sub_80B4318: ; 80B4318 ldr r1, =0x02037350 adds r4, r0, r1 adds r0, r4, 0 - bl npc_is_visible_or_is_x40 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive lsls r0, 24 cmp r0, 0 beq @080B4344 adds r0, r4, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished lsls r0, 24 cmp r0, 0 beq @080B434A @@ -321623,19 +321912,19 @@ sub_80B435C: ; 80B435C adds r5, r1, 0 adds r4, r2, 0 adds r0, r4, 0 - bl npc_is_visible_or_is_x40 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive lsls r0, 24 cmp r0, 0 beq @080B437A adds r0, r4, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished lsls r0, 24 cmp r0, 0 beq @080B4388 @080B437A: adds r0, r4, 0 movs r1, 0x59 - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim ldrh r0, [r5, 0x8] adds r0, 0x1 strh r0, [r5, 0x8] @@ -321651,7 +321940,7 @@ sub_80B4390: ; 80B4390 push {r4,lr} adds r4, r1, 0 adds r0, r2, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished lsls r0, 24 cmp r0, 0 beq @080B43A4 @@ -321670,19 +321959,19 @@ sub_80B43AC: ; 80B43AC adds r5, r1, 0 adds r4, r2, 0 adds r0, r4, 0 - bl npc_is_visible_or_is_x40 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive lsls r0, 24 cmp r0, 0 beq @080B43CA adds r0, r4, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished lsls r0, 24 cmp r0, 0 beq @080B43D8 @080B43CA: adds r0, r4, 0 movs r1, 0x3E - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim ldrh r0, [r5, 0x8] adds r0, 0x1 strh r0, [r5, 0x8] @@ -321699,7 +321988,7 @@ sub_80B43E0: ; 80B43E0 adds r5, r1, 0 adds r4, r2, 0 adds r0, r4, 0 - bl npc_get_bit7_or_const_x10_when_inactive + bl FieldObjectCheckIfSpecialAnimFinishedOrInactive lsls r0, 24 cmp r0, 0 beq @080B4426 @@ -321774,7 +322063,7 @@ sub_80B4438: ; 80B4438 orrs r1, r2 strb r1, [r0, 0x5] adds r0, r4, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 @@ -321783,7 +322072,7 @@ sub_80B4438: ; 80B4438 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim ldrh r0, [r5, 0x8] adds r0, 0x1 strh r0, [r5, 0x8] @@ -321834,7 +322123,7 @@ sub_80B44C8: ; 80B44C8 cmp r0, 0 bne @080B44FA ldr r0, [sp] - bl rom_npc_by_local_id_and_map_get_trainer_flag + bl FieldObjectClearAnim ldrh r0, [r4, 0x16] adds r0, 0x1 strh r0, [r4, 0x16] @@ -322118,7 +322407,7 @@ objc_exclamation_mark_probably: ; 80B4724 lsls r2, 24 lsrs r2, 24 mov r3, sp - bl npc_id_by_local_id_and_map_ret_success + bl TryGetFieldObjectIdByLocalIdAndMap lsls r0, 24 cmp r0, 0 bne @080B4756 @@ -322249,10 +322538,10 @@ sub_80B4808: ; 80B4808 ldrb r0, [r0, 0x18] lsls r0, 28 lsrs r0, 28 - bl direction_reversed + bl GetOppositeDirection lsls r0, 24 lsrs r0, 24 - bl d2s_look1 + bl GetFaceDirectionAnimId ldr r3, =0x03006084 strb r0, [r3] movs r0, 0xFE @@ -322276,7 +322565,7 @@ sub_80B4808: ; 80B4808 ldrb r0, [r0, 0x18] lsls r0, 28 lsrs r0, 28 - bl d2s_look1 + bl GetFaceDirectionAnimId ldr r3, =0x03006084 strb r0, [r3] movs r0, 0xFE @@ -323451,7 +323740,7 @@ DoWildEncounterRateTest: ; 80B5170 lsls r0, 4 str r0, [sp] movs r0, 0x6 - bl walkrun_bitfield_and_r0 + bl TestPlayerAvatarFlags lsls r0, 24 cmp r0, 0 beq @080B519A @@ -323794,7 +324083,7 @@ is_it_battle_time_2: ; 80B5288 cmp r0, 0x1 beq @080B5464 movs r0, 0x8 - bl walkrun_bitfield_and_r0 + bl TestPlayerAvatarFlags lsls r0, 24 cmp r0, 0 beq @080B54FE @@ -323941,7 +324230,7 @@ sub_80B5578: ; 80B5578 adds r5, 0x2 mov r0, sp adds r1, r5, 0 - bl player_get_pos_to + bl PlayerGetDestCoords bl get_wild_data_index_for_map lsls r0, 16 lsrs r4, r0, 16 @@ -326689,7 +326978,7 @@ mapldr_08084390: ; 80B6AA4 lsls r0, 2 adds r0, r4 movs r1, 0x3 - bl npc_turn + bl FieldObjectTurn @080B6AE6: bl script_env_2_enable bl player_bitmagic @@ -326812,7 +327101,7 @@ sub_80B6BCC: ; 80B6BCC lsls r4, 2 ldr r0, =0x02020630 adds r4, r0 - bl sub_808EEDC + bl CameraObjectReset2 ldrb r1, [r6, 0x5] lsls r0, r1, 3 adds r0, r1 @@ -326824,15 +327113,15 @@ sub_80B6BCC: ; 80B6BCC strb r1, [r0, 0x1] movs r0, 0x1 strb r0, [r6, 0x6] - bl player_get_direction__sp1AA + bl player_get_direction_lower_nybble lsls r0, 24 lsrs r0, 24 - bl d2s_look1 + bl GetFaceDirectionAnimId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r5, 0 - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim adds r3, r4, 0 adds r3, 0x42 ldrb r0, [r3] @@ -327093,7 +327382,7 @@ sub_80B6E18: ; 80B6E18 movs r0, 0 strb r0, [r1, 0x6] bl script_env_2_disable - bl sub_808EE8C + bl CameraObjectReset1 bl sub_809757C bl sub_808A2E4 ldr r0, =sub_80B6B94 @@ -327170,7 +327459,7 @@ sub_80B6EC0: ; 80B6EC0 push {r4,lr} adds r4, r0, 0 bl player_bitmagic - bl sub_808EEDC + bl CameraObjectReset2 ldrb r0, [r4, 0xA] bl sub_80E1558 ldrh r0, [r4, 0x8] @@ -327194,25 +327483,25 @@ sub_80B6EE0: ; 80B6EE0 ldr r1, =0x02037350 adds r4, r0, r1 adds r0, r4, 0 - bl npc_is_visible_or_is_x40 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive lsls r0, 24 cmp r0, 0 beq @080B6F0A adds r0, r4, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished lsls r0, 24 cmp r0, 0 beq @080B6F3E @080B6F0A: - bl player_get_direction__sp1AA + bl player_get_direction_lower_nybble lsls r0, 24 lsrs r0, 24 - bl d2s_look1 + bl GetFaceDirectionAnimId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim ldrh r0, [r5, 0x8] adds r0, 0x1 movs r1, 0 @@ -327462,7 +327751,7 @@ sub_80B7114: ; 80B7114 push {r4,r5,lr} sub sp, 0x4 adds r5, r0, 0 - bl sub_808EEDC + bl CameraObjectReset2 ldr r0, =0x02037590 ldrb r0, [r0, 0x5] lsls r4, r0, 3 @@ -327471,17 +327760,17 @@ sub_80B7114: ; 80B7114 ldr r0, =0x02037350 adds r4, r0 movs r0, 0x4 - bl d2s_look1 + bl GetFaceDirectionAnimId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim mov r4, sp adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to + bl PlayerGetDestCoords mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] @@ -327706,19 +327995,19 @@ sub_80B72F4: ; 80B72F4 ldr r1, =0x02037350 adds r4, r0, r1 adds r0, r4, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished lsls r0, 24 cmp r0, 0 beq @080B7338 - bl sub_808EE8C + bl CameraObjectReset1 bl script_env_2_disable movs r0, 0x4 - bl sub_8093388 + bl GetGoSpeed0AnimId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim ldr r0, =sub_80B70DC bl get_task_id_by_function lsls r0, 24 @@ -327817,12 +328106,12 @@ waterfall_1_do_anim_probably: ; 80B73F0 adds r5, r1, 0 bl script_env_2_enable adds r0, r5, 0 - bl npc_is_visible_or_is_x40 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive lsls r0, 24 cmp r0, 0 bne @080B7420 adds r0, r5, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished ldr r1, =0x02038c08 movs r2, 0xA ldrsh r0, [r4, r2] @@ -327868,12 +328157,12 @@ sub_80B7450: ; 80B7450 adds r5, r0, 0 adds r4, r1, 0 movs r0, 0x2 - bl d2s_walk + bl GetSimpleGoAnimId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim ldrh r0, [r5, 0x8] adds r0, 0x1 strh r0, [r5, 0x8] @@ -327889,7 +328178,7 @@ sub_80B7478: ; 80B7478 adds r5, r0, 0 adds r4, r1, 0 adds r0, r4, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished lsls r0, 24 cmp r0, 0 bne @080B748E @@ -327897,7 +328186,7 @@ sub_80B7478: ; 80B7478 b @080B74CA @080B748E: ldrb r0, [r4, 0x1E] - bl is_tile_x13_waterfall + bl MetatileBehavior_IsWaterfall lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 @@ -328021,7 +328310,7 @@ dive_3_unknown: ; 80B7580 mov r1, sp adds r1, 0x2 mov r0, sp - bl player_get_pos_to + bl PlayerGetDestCoords movs r0, 0x6 bl FieldEffectActiveListContains lsls r0, 24 @@ -328112,7 +328401,7 @@ sub_80B764C: ; 80B764C adds r4, r0, 0 adds r5, r1, 0 bl player_bitmagic - bl sub_808EEDC + bl CameraObjectReset2 movs r0, 0 bl sub_808A2C0 ldr r0, =0x02037590 @@ -328441,7 +328730,7 @@ sub_80B78EC: ; 80B78EC push {r4,r5,lr} adds r5, r0, 0 adds r4, r1, 0 - bl sub_808EEDC + bl CameraObjectReset2 bl player_bitmagic ldr r1, =0x02037590 movs r0, 0x1 @@ -328524,7 +328813,7 @@ sub_80B7968: ; 80B7968 negs r0, r0 ands r0, r1 strb r0, [r4, 0x1] - bl sub_808EE8C + bl CameraObjectReset1 movs r0, 0xAF bl audio_play movs r0, 0x4 @@ -328533,7 +328822,7 @@ sub_80B7968: ; 80B7968 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim @080B79B0: movs r0, 0 pop {r4} @@ -328546,7 +328835,7 @@ sub_80B7968: ; 80B7968 sub_80B79BC: ; 80B79BC push {lr} adds r0, r1, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished lsls r0, 24 cmp r0, 0 beq @080B79E6 @@ -328691,7 +328980,7 @@ sub_80B7AE8: ; 80B7AE8 adds r5, r0, 0 adds r4, r1, 0 bl player_bitmagic - bl sub_808EEDC + bl CameraObjectReset2 ldr r1, =0x02037590 movs r0, 0x1 strb r0, [r1, 0x6] @@ -328716,7 +329005,7 @@ sub_80B7B18: ; 80B7B18 adds r4, r1, 0 adds r6, r2, 0 adds r0, r4, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished lsls r0, 24 cmp r0, 0 beq @080B7B8C @@ -328755,12 +329044,12 @@ sub_80B7B18: ; 80B7B18 ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 - bl sub_80935F0 + bl GetStepInPlaceDelay4AnimId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim movs r0, 0x27 bl audio_play @080B7B8C: @@ -328963,7 +329252,7 @@ sub_80B7D14: ; 80B7D14 strh r0, [r4, 0x8] movs r0, 0x40 strh r0, [r4, 0x24] - bl player_get_direction__sp1AA + bl player_get_direction_lower_nybble lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x26] @@ -329002,12 +329291,12 @@ sub_80B7D34: ; 80B7D34 ldr r1, =0x02037350 adds r5, r0, r1 adds r0, r5, 0 - bl npc_is_visible_or_is_x40 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive lsls r0, 24 cmp r0, 0 beq @080B7D86 adds r0, r5, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished lsls r0, 24 cmp r0, 0 beq @080B7E40 @@ -329031,7 +329320,7 @@ sub_80B7D34: ; 80B7D34 lsls r1, 24 lsrs r1, 24 adds r0, r5, 0 - bl npc_set_direction + bl FieldObjectSetDirection bl sub_8084E14 bl warp_in ldr r1, =0x03005dac @@ -329063,12 +329352,12 @@ sub_80B7D34: ; 80B7D34 lsrs r0, 28 add r0, sp ldrb r0, [r0] - bl d2s_look1 + bl GetFaceDirectionAnimId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r5, 0 - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim ldrh r1, [r4, 0xC] movs r2, 0xC ldrsh r0, [r4, r2] @@ -329153,7 +329442,7 @@ sub_80B7EC4: ; 80B7EC4 ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] - bl player_get_direction__sp1AA + bl player_get_direction_lower_nybble lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x26] @@ -329191,12 +329480,12 @@ sub_80B7EE8: ; 80B7EE8 bne @080B7FAC @080B7F1A: adds r0, r6, 0 - bl npc_is_visible_or_is_x40 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive lsls r0, 24 cmp r0, 0 beq @080B7F32 adds r0, r6, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished lsls r0, 24 cmp r0, 0 beq @080B7FC0 @@ -329207,7 +329496,7 @@ sub_80B7EE8: ; 80B7EE8 ble @080B7F7C movs r2, 0x26 ldrsh r4, [r5, r2] - bl player_get_direction__sp1AA + bl player_get_direction_lower_nybble lsls r0, 24 lsrs r0, 24 cmp r4, r0 @@ -329232,12 +329521,12 @@ sub_80B7EE8: ; 80B7EE8 lsrs r0, 28 add r0, sp ldrb r0, [r0] - bl d2s_look1 + bl GetFaceDirectionAnimId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r6, 0 - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim ldrh r1, [r5, 0xC] movs r2, 0xC ldrsh r0, [r5, r2] @@ -329308,8 +329597,8 @@ sub_80B800C: ; 80B800C adds r4, r0, 0 bl script_env_2_enable bl player_bitmagic - bl sub_808EEDC - bl player_get_direction__sp1AA + bl CameraObjectReset2 + bl player_get_direction_lower_nybble lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x26] @@ -329354,7 +329643,7 @@ sub_80B8034: ; 80B8034 add r0, sp ldrb r1, [r0] adds r0, r5, 0 - bl npc_turn + bl FieldObjectTurn movs r0, 0x8 strh r0, [r4, 0xA] ldrh r0, [r4, 0xC] @@ -329427,7 +329716,7 @@ sub_80B80C4: ; 80B80C4 add r0, sp ldrb r1, [r0] adds r0, r3, 0 - bl npc_turn + bl FieldObjectTurn @080B810E: ldrh r0, [r5, 0x22] ldrh r1, [r4, 0xE] @@ -329556,7 +329845,7 @@ mapldr_08085D88: ; 80B8200 movs r2, 0x20 orrs r1, r2 strb r1, [r0, 0x1] - bl sub_808EEDC + bl CameraObjectReset2 ldr r0, =sub_80B8250 movs r1, 0 bl AddTask @@ -329640,7 +329929,7 @@ sub_80B8280: ; 80B8280 ldrb r0, [r2] lsrs r0, 6 strh r0, [r6, 0x24] - bl player_get_direction__sp1AA + bl player_get_direction_lower_nybble lsls r0, 24 lsrs r0, 24 strh r0, [r6, 0x26] @@ -329762,7 +330051,7 @@ sub_80B830C: ; 80B830C add r0, sp ldrb r1, [r0] adds r0, r6, 0 - bl npc_turn + bl FieldObjectTurn @080B83F0: movs r1, 0x26 ldrsh r0, [r5, r1] @@ -329810,7 +330099,7 @@ sub_80B8410: ; 80B8410 add r0, sp ldrb r1, [r0] adds r0, r5, 0 - bl npc_turn + bl FieldObjectTurn movs r0, 0x8 strh r0, [r4, 0xA] ldrh r0, [r4, 0xC] @@ -329828,7 +330117,7 @@ sub_80B8410: ; 80B8410 cmp r1, r0 bne @080B8484 bl script_env_2_disable - bl sub_808EE8C + bl CameraObjectReset1 bl sub_809757C ldr r0, =sub_80B8250 bl get_task_id_by_function @@ -330930,7 +331219,7 @@ sub_80B8D44: ; 80B8D44 ldr r0, =0x02038c08 ldr r0, [r0] strh r0, [r1, 0x26] - bl sav1_reset_x2C + bl sav1_reset_battle_music_maybe ldr r0, =0x0000016d bl sub_80858C4 movs r0, 0 @@ -330974,7 +331263,7 @@ sub_80B8DB4: ; 80B8DB4 movs r0, 0x1 strb r0, [r5, 0x6] movs r0, 0x8 - bl sub_808BF14 + bl SetPlayerAvatarStateMask adds r6, r4, 0 adds r6, 0xA movs r0, 0xC @@ -330982,7 +331271,7 @@ sub_80B8DB4: ; 80B8DB4 mov r8, r0 adds r0, r6, 0 mov r1, r8 - bl player_get_pos_to + bl PlayerGetDestCoords ldr r2, =0x02037350 ldrb r1, [r5, 0x5] lsls r0, r1, 3 @@ -330993,7 +331282,7 @@ sub_80B8DB4: ; 80B8DB4 lsrs r0, 4 adds r1, r6, 0 mov r2, r8 - bl numbers_move_direction + bl MoveCoords ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] @@ -331017,12 +331306,12 @@ sub_80B8E14: ; 80B8E14 ldr r1, =0x02037350 adds r4, r0, r1 adds r0, r4, 0 - bl npc_is_visible_or_is_x40 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive lsls r0, 24 cmp r0, 0 beq @080B8E3E adds r0, r4, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished lsls r0, 24 cmp r0, 0 beq @080B8E50 @@ -331030,7 +331319,7 @@ sub_80B8E14: ; 80B8E14 bl sub_808C114 adds r0, r4, 0 movs r1, 0x39 - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim ldrh r0, [r5, 0x8] adds r0, 0x1 strh r0, [r5, 0x8] @@ -331052,7 +331341,7 @@ sub_80B8E60: ; 80B8E60 lsls r0, 2 ldr r1, =0x02037350 adds r0, r1 - bl npc_get_bit7_or_const_x10_when_inactive + bl FieldObjectCheckIfSpecialAnimFinishedOrInactive lsls r0, 24 cmp r0, 0 beq @080B8E96 @@ -331092,14 +331381,14 @@ sub_80B8EA8: ; 80B8EA8 ldr r0, =0x02037350 adds r4, r0 movs r0, 0x3 - bl sub_808BD8C + bl GetPlayerAvatarGraphicsIdByStateId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl set_field_object_graphics + bl FieldObjectSetGraphicsId adds r0, r4, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished ldrb r0, [r4, 0x18] lsrs r0, 4 bl sub_8093540 @@ -331107,7 +331396,7 @@ sub_80B8EA8: ; 80B8EA8 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim ldr r1, =0x02038c08 movs r2, 0xA ldrsh r0, [r6, r2] @@ -331141,7 +331430,7 @@ sub_80B8F24: ; 80B8F24 ldr r1, =0x02037350 adds r4, r0, r1 adds r0, r4, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished lsls r0, 24 cmp r0, 0 beq @080B8F84 @@ -331153,12 +331442,12 @@ sub_80B8F24: ; 80B8F24 strb r0, [r5] ldrb r0, [r4, 0x18] lsrs r0, 4 - bl d2s_look1 + bl GetFaceDirectionAnimId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim ldrb r0, [r4, 0x1A] movs r1, 0x1 bl sub_81555AC @@ -331472,12 +331761,12 @@ sub_80B9204: ; 80B9204 ldr r1, =0x02037350 adds r4, r0, r1 adds r0, r4, 0 - bl npc_is_visible_or_is_x40 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive lsls r0, 24 cmp r0, 0 beq @080B922E adds r0, r4, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished lsls r0, 24 cmp r0, 0 beq @080B924C @@ -331486,11 +331775,11 @@ sub_80B9204: ; 80B9204 strh r0, [r5, 0x26] movs r0, 0x1 strb r0, [r6, 0x6] - bl sub_808BF14 + bl SetPlayerAvatarStateMask bl sub_808C114 adds r0, r4, 0 movs r1, 0x39 - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim ldrh r0, [r5, 0x8] adds r0, 0x1 strh r0, [r5, 0x8] @@ -331512,7 +331801,7 @@ sub_80B925C: ; 80B925C lsls r0, 2 ldr r1, =0x02037350 adds r0, r1 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished lsls r0, 24 cmp r0, 0 beq @080B928C @@ -331589,7 +331878,7 @@ sub_80B92F8: ; 80B92F8 movs r0, 0x10 strh r0, [r4, 0xC] movs r0, 0x1 - bl walkrun_set_bike_bits + bl SetPlayerAvatarTransition ldr r0, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 @@ -331598,7 +331887,7 @@ sub_80B92F8: ; 80B92F8 ldr r1, =0x02037350 adds r0, r1 movs r1, 0x2 - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim @080B932C: pop {r4} pop {r0} @@ -331629,7 +331918,7 @@ sub_80B933C: ; 80B933C bne @080B9380 @080B9362: adds r0, r2, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished lsls r0, 24 cmp r0, 0 beq @080B9380 @@ -331666,12 +331955,12 @@ sub_80B9390: ; 80B9390 ldr r1, =0x02037350 adds r4, r0, r1 movs r0, 0x3 - bl sub_808BD8C + bl GetPlayerAvatarGraphicsIdByStateId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl set_field_object_graphics + bl FieldObjectSetGraphicsId ldrb r1, [r4, 0x4] lsls r0, r1, 4 adds r0, r1 @@ -331686,7 +331975,7 @@ sub_80B9390: ; 80B9390 strb r0, [r4, 0x1] adds r0, r4, 0 movs r1, 0x48 - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim ldrh r1, [r5, 0x26] movs r0, 0x8 ands r0, r1 @@ -331730,7 +332019,7 @@ sub_80B9418: ; 80B9418 ldr r0, =0x02037350 adds r4, r0 adds r0, r4, 0 - bl npc_hide_and_trainer_flag_clear_on_tile_x66_at_pos + bl FieldObjectClearAnimIfSpecialAnimActive ldrb r1, [r4, 0x1] movs r0, 0x11 negs r0, r0 @@ -331744,7 +332033,7 @@ sub_80B9418: ; 80B9418 ldrb r0, [r5, 0xA] ldrb r1, [r4, 0x4] bl sub_80B9560 - bl sub_808EEDC + bl CameraObjectReset2 ldrh r0, [r5, 0x8] adds r0, 0x1 strh r0, [r5, 0x8] @@ -332225,12 +332514,12 @@ sub_80B9804: ; 80B9804 ldr r1, =0x02037350 adds r4, r0, r1 adds r0, r4, 0 - bl npc_is_visible_or_is_x40 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive lsls r0, 24 cmp r0, 0 beq @080B982E adds r0, r4, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished lsls r0, 24 cmp r0, 0 beq @080B98A6 @@ -332244,7 +332533,7 @@ sub_80B9804: ; 80B9804 strh r0, [r5, 0x26] movs r0, 0x1 strb r0, [r6, 0x6] - bl sub_808BF14 + bl SetPlayerAvatarStateMask ldrh r1, [r5, 0x26] movs r0, 0x8 ands r0, r1 @@ -332255,16 +332544,16 @@ sub_80B9804: ; 80B9804 bl sub_81555AC @080B9856: movs r0, 0x3 - bl sub_808BD8C + bl GetPlayerAvatarGraphicsIdByStateId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl set_field_object_graphics - bl sub_808EEDC + bl FieldObjectSetGraphicsId + bl CameraObjectReset2 adds r0, r4, 0 movs r1, 0x3 - bl npc_turn + bl FieldObjectTurn ldrb r1, [r4, 0x4] lsls r0, r1, 4 adds r0, r1 @@ -332430,7 +332719,7 @@ sub_80B9978: ; 80B9978 bl sub_808C114 adds r0, r5, 0 movs r1, 0x39 - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim ldrh r0, [r6, 0x8] adds r0, 0x1 strh r0, [r6, 0x8] @@ -332452,7 +332741,7 @@ sub_80B99F0: ; 80B99F0 lsls r0, 2 ldr r1, =0x02037350 adds r0, r1 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished lsls r0, 24 cmp r0, 0 beq @080B9A18 @@ -332497,8 +332786,8 @@ sub_80B9A28: ; 80B9A28 .pool thumb_func_end sub_80B9A28 - thumb_func_start fishE -fishE: ; 80B9A60 + thumb_func_start sub_80B9A60 +sub_80B9A60: ; 80B9A60 push {r4-r7,lr} adds r5, r0, 0 ldrh r0, [r5, 0xA] @@ -332526,15 +332815,15 @@ fishE: ; 80B9A60 bl sub_81555AC @080B9A94: adds r0, r7, 0 - bl sub_808BD8C + bl GetPlayerAvatarGraphicsIdByStateId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl set_field_object_graphics + bl FieldObjectSetGraphicsId adds r0, r4, 0 movs r1, 0x1 - bl npc_turn + bl FieldObjectTurn ldrh r0, [r5, 0x26] strb r0, [r6] movs r0, 0 @@ -332551,7 +332840,7 @@ fishE: ; 80B9A60 pop {r0} bx r0 .pool - thumb_func_end fishE + thumb_func_end sub_80B9A60 thumb_func_start sub_80B9ADC sub_80B9ADC: ; 80B9ADC @@ -332562,7 +332851,7 @@ sub_80B9ADC: ; 80B9ADC ldrb r1, [r4, 0x4] ldrb r2, [r4, 0x8] mov r3, sp - bl npc_id_by_local_id_and_map_ret_success + bl TryGetFieldObjectIdByLocalIdAndMap lsls r0, 24 cmp r0, 0 bne @080B9B2C @@ -332823,7 +333112,7 @@ sub_80B9CDC: ; 80B9CDC ldrb r0, [r4, 0xC] ldrb r1, [r4, 0xE] ldrb r2, [r4, 0x10] - bl npc_hide_by_local_id_and_map + bl RemoveFieldObjectByLocalIdAndMap movs r0, 0x41 bl FieldEffectActiveListRemove adds r0, r5, 0 @@ -332983,7 +333272,7 @@ sub_80B9E28: ; 80B9E28 ldrb r1, [r7, 0x4] ldrb r2, [r7, 0x8] mov r3, sp - bl npc_id_by_local_id_and_map_ret_success + bl TryGetFieldObjectIdByLocalIdAndMap lsls r0, 24 cmp r0, 0 bne @080B9EBE @@ -344840,6 +345129,7 @@ sub_80C0630: ; 80C0630 thumb_func_end sub_80C0630 thumb_func_start pokedex_flag_operation +; u8 pokedex_flag_operation(u16 nationalPokedexNum, u8 op) pokedex_flag_operation: ; 80C0664 push {r4-r7,lr} lsls r0, 16 @@ -380727,7 +381017,7 @@ exec_movement: ; 80D32E8 lsls r2, 24 lsrs r2, 24 mov r3, sp - bl npc_id_by_local_id_and_map_ret_success + bl TryGetFieldObjectIdByLocalIdAndMap lsls r0, 24 cmp r0, 0 beq @080D330A @@ -380770,7 +381060,7 @@ sub_80D3340: ; 80D3340 lsls r2, 24 lsrs r2, 24 mov r3, sp - bl npc_id_by_local_id_and_map_ret_success + bl TryGetFieldObjectIdByLocalIdAndMap lsls r0, 24 cmp r0, 0 bne @080D3382 @@ -381246,12 +381536,12 @@ sub_80D36A4: ; 80D36A4 ldr r1, =0x02037350 adds r4, r0, r1 adds r0, r4, 0 - bl npc_is_state_set_and_valid + bl FieldObjectIsSpecialAnimActive lsls r0, 24 cmp r0, 0 beq @080D36DC adds r0, r4, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished lsls r0, 24 cmp r0, 0 beq @080D370E @@ -381268,7 +381558,7 @@ sub_80D36A4: ; 80D36A4 .pool @080D36F8: adds r0, r4, 0 - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim lsls r0, 24 cmp r0, 0 bne @080D370E @@ -381310,7 +381600,7 @@ sub_80D3718: ; 80D3718 @080D3754: ldr r0, =0x0203ab40 adds r1, r0, 0x2 - bl player_get_pos_to + bl PlayerGetDestCoords bl brm_get_pokemon_selection lsls r0, 24 lsrs r0, 24 @@ -381395,7 +381685,7 @@ sub_80D3718: ; 80D3718 asrs r4, r0, 16 adds r0, r4, 0 mov r1, r10 - bl cur_mapdata_get_upper4bit_at + bl MapGridGetZCoordAt lsls r0, 24 lsrs r0, 24 ldr r2, =0x0203ab40 @@ -381435,7 +381725,7 @@ sub_80D3718: ; 80D3718 asrs r0, 16 ldr r2, [sp, 0x14] asrs r1, r2, 16 - bl cur_mapdata_get_middle2bit_at + bl MapGridIsImpassableAt lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -381563,7 +381853,7 @@ sub_80D3718: ; 80D3718 asrs r4, r0, 16 adds r0, r5, 0 adds r1, r4, 0 - bl cur_mapdata_get_upper4bit_at + bl MapGridGetZCoordAt lsls r0, 24 lsrs r0, 24 mov r2, r9 @@ -381754,7 +382044,7 @@ sub_80D3B00: ; 80D3B00 ldr r4, =0x0203ab40 adds r1, r4, 0x2 adds r0, r4, 0 - bl player_get_pos_to + bl PlayerGetDestCoords adds r7, r4, 0 @080D3B16: ldr r0, =0x03001108 @@ -406658,7 +406948,7 @@ sub_80E075C: ; 80E075C lsls r1, 16 asrs r1, 16 str r3, [sp, 0x10] - bl npc_id_by_pos + bl GetFieldObjectIdByXY lsls r0, 24 lsrs r6, r0, 24 ldr r3, [sp, 0x10] @@ -408204,7 +408494,7 @@ sub_80E150C: ; 80E150C adds r0, 0x8 adds r1, r7, 0 adds r1, 0xA - bl player_get_pos_to + bl PlayerGetDestCoords movs r0, 0 strh r0, [r7] strh r0, [r7, 0x2] @@ -408402,8 +408692,9 @@ GetRomBerryInfo: ; 80E167C .pool thumb_func_end GetRomBerryInfo - thumb_func_start sub_80E16C0 -sub_80E16C0: ; 80E16C0 + thumb_func_start GetBerryTreeInfo +; struct BerryTreeInfo *GetBerryTreeInfo(u8 berryTreeId) +GetBerryTreeInfo: ; 80E16C0 lsls r0, 24 ldr r1, =0x03005d8c lsrs r0, 21 @@ -408414,17 +408705,17 @@ sub_80E16C0: ; 80E16C0 adds r0, r1, 0 bx lr .pool - thumb_func_end sub_80E16C0 + thumb_func_end GetBerryTreeInfo - thumb_func_start sub_80E16DC -sub_80E16DC: ; 80E16DC + thumb_func_start SetBerryTreeWateredFlag +SetBerryTreeWateredFlag: ; 80E16DC push {lr} ldr r0, =0x03005df0 ldrb r0, [r0] - bl sub_808F110 + bl FieldObjectGetBerryTreeId lsls r0, 24 lsrs r0, 24 - bl sub_80E16C0 + bl GetBerryTreeInfo adds r2, r0, 0 ldrb r0, [r2, 0x1] lsls r0, 25 @@ -408470,7 +408761,7 @@ sub_80E16DC: ; 80E16DC @080E1734: pop {r1} bx r1 - thumb_func_end sub_80E16DC + thumb_func_end SetBerryTreeWateredFlag thumb_func_start sub_80E1738 sub_80E1738: ; 80E1738 @@ -408481,7 +408772,7 @@ sub_80E1738: ; 80E1738 bne @080E1768 ldr r0, =0x03005df0 ldrb r0, [r0] - bl sub_808F110 + bl FieldObjectGetBerryTreeId lsls r0, 24 lsrs r0, 24 bl get_berry_tree_stage @@ -408505,7 +408796,7 @@ sub_80E1770: ; 80E1770 ldr r1, =gUnknown_082742F9 cmp r0, r1 bne @080E178C - bl sub_80E16DC + bl SetBerryTreeWateredFlag lsls r0, 24 lsrs r0, 24 b @080E178E @@ -408730,7 +409021,7 @@ sub_80E191C: ; 80E191C lsrs r5, 24 lsls r3, 24 lsrs r7, r3, 24 - bl sub_80E16C0 + bl GetBerryTreeInfo adds r6, r0, 0 ldr r0, =gUnknown_0858ABD0 ldr r1, [r0, 0x4] @@ -408905,7 +409196,7 @@ sub_80E1A78: ; 80E1A78 push {lr} lsls r0, 24 lsrs r0, 24 - bl sub_80E16C0 + bl GetBerryTreeInfo ldrb r2, [r0, 0x1] movs r1, 0x7F ands r1, r2 @@ -408956,7 +409247,7 @@ sub_80E1ACC: ; 80E1ACC push {lr} lsls r0, 24 lsrs r0, 24 - bl sub_80E16C0 + bl GetBerryTreeInfo bl sub_80E1A90 lsls r0, 24 lsrs r0, 24 @@ -409069,7 +409360,7 @@ sub_80E1B94: ; 80E1B94 push {r4-r6,lr} ldr r0, =0x03005df0 ldrb r0, [r0] - bl sub_808F110 + bl FieldObjectGetBerryTreeId lsls r0, 24 lsrs r5, r0, 24 adds r0, r5, 0 @@ -409128,7 +409419,7 @@ sub_80E1C2C: ; 80E1C2C push {lr} ldr r0, =0x03005df0 ldrb r0, [r0] - bl sub_808F110 + bl FieldObjectGetBerryTreeId lsls r0, 24 lsrs r0, 24 bl get_berry_tree_type @@ -409146,7 +409437,7 @@ sub_80E1C54: ; 80E1C54 push {r4,r5,lr} ldr r0, =0x03005df0 ldrb r0, [r0] - bl sub_808F110 + bl FieldObjectGetBerryTreeId adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 @@ -409190,7 +409481,7 @@ sub_80E1CA4: ; 80E1CA4 lsrs r4, 24 ldr r0, =0x03005df0 ldrb r0, [r0] - bl sub_808F110 + bl FieldObjectGetBerryTreeId lsls r0, 24 lsrs r0, 24 adds r1, r4, 0 @@ -409209,7 +409500,7 @@ sub_80E1CDC: ; 80E1CDC push {r4-r6,lr} ldr r0, =0x03005df0 ldrb r0, [r0] - bl sub_808F110 + bl FieldObjectGetBerryTreeId adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 @@ -409243,7 +409534,7 @@ sub_80E1D28: ; 80E1D28 push {lr} ldr r0, =0x03005df0 ldrb r0, [r0] - bl sub_808F110 + bl FieldObjectGetBerryTreeId lsls r0, 24 lsrs r0, 24 bl sub_80E1984 @@ -423501,7 +423792,7 @@ sub_80E90C8: ; 80E90C8 ldr r1, =0x02037350 adds r0, r1 movs r1, 0x2 - bl npc_turn + bl FieldObjectTurn bl sub_80ABDFC lsls r0, 24 lsrs r0, 24 @@ -424061,7 +424352,7 @@ sub_80E9578: ; 80E9578 ldr r2, [r1] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] - bl npc_hide_by_local_id_and_map + bl RemoveFieldObjectByLocalIdAndMap adds r0, r4, 0 bl FlagSet @080E95B6: @@ -425787,7 +426078,7 @@ sub_80EA3E4: ; 80EA3E4 @080EA438: adds r0, r5, 0x4 adds r1, r5, 0x6 - bl player_get_pos_to + bl PlayerGetDestCoords b @080EA81C .pool @080EA448: @@ -425795,7 +426086,7 @@ sub_80EA3E4: ; 80EA3E4 adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to + bl PlayerGetDestCoords mov r0, sp ldrh r2, [r0] movs r3, 0 @@ -426171,7 +426462,7 @@ sub_80EA3E4: ; 80EA3E4 .pool @080EA7A8: adds r0, r5, 0 - bl sub_8089848 + bl MetatileBehavior_0xBB lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -426191,7 +426482,7 @@ sub_80EA3E4: ; 80EA3E4 .pool @080EA7D8: adds r0, r5, 0 - bl sub_808985C + bl MetatileBehavior_0xBC lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -436511,7 +436802,7 @@ start_menu_append_item: ; 80F01B8 ldrb r1, [r0, 0x5] ldrb r2, [r0, 0x4] movs r0, 0x5 - bl npc_hide_by_local_id_and_map + bl RemoveFieldObjectByLocalIdAndMap ldr r0, =0x00000396 bl FlagSet pop {r0} @@ -451678,7 +451969,7 @@ sub_80F8B94: ; 80F8B94 ldr r2, [r1] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] - bl get_npc_id_by_local_id + bl GetFieldObjectIdByLocalIdAndMap lsls r0, 24 lsrs r0, 24 ldr r2, =0x02037350 @@ -454195,7 +454486,7 @@ sub_80FA004: ; 80FA004 ldrh r0, [r0] cmp r0, 0x1 beq @080FA0AE - bl player_get_direction__sp1AA + bl player_get_direction_lower_nybble lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 @@ -455121,7 +455412,7 @@ sub_80FA794: ; 80FA794 lsls r1, 16 lsrs r4, r1, 16 adds r6, r4, 0 - bl player_get_direction__sp1AA + bl player_get_direction_lower_nybble lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -455443,7 +455734,7 @@ sub_80FAA7C: ; 80FAA7C movs r3, 0 ldrsh r0, [r4, r3] str r0, [r1, 0x18] - bl player_get_direction__sp1AA + bl player_get_direction_lower_nybble lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 @@ -455943,29 +456234,29 @@ sub_80FAEF0: ; 80FAEF0 ldr r1, =0x02037350 adds r4, r0, r1 adds r0, r4, 0 - bl npc_is_visible_or_is_x40 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive lsls r0, 24 cmp r0, 0 beq @080FAF1C adds r0, r4, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished lsls r0, 24 cmp r0, 0 beq @080FAF4E @080FAF1C: - bl player_get_direction__sp1AA + bl player_get_direction_lower_nybble lsls r0, 24 lsrs r0, 24 bl sub_808C228 - bl player_get_direction__sp1AA + bl player_get_direction_lower_nybble lsls r0, 24 lsrs r0, 24 - bl d2s_08064244 + bl GetStepInPlaceDelay16AnimId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 @@ -455993,7 +456284,7 @@ sub_80FAF64: ; 80FAF64 ldr r1, =0x02037350 adds r5, r0, r1 adds r0, r5, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished lsls r0, 24 cmp r0, 0 beq @080FAFC8 @@ -456009,15 +456300,15 @@ sub_80FAF64: ; 80FAF64 asrs r0, 16 cmp r0, 0x9 bgt @080FAFC4 - bl player_get_direction__sp1AA + bl player_get_direction_lower_nybble lsls r0, 24 lsrs r0, 24 - bl d2s_08064244 + bl GetStepInPlaceDelay16AnimId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r5, 0 - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim b @080FAFC8 .pool @080FAFC4: @@ -456039,7 +456330,7 @@ sub_80FAFD4: ; 80FAFD4 bl sub_808BCD0 lsls r0, 24 lsrs r0, 24 - bl walkrun_set_bike_bits + bl SetPlayerAvatarTransition adds r0, r4, 0 bl remove_task bl script_env_2_enable_and_set_ctx_running @@ -456919,7 +457210,7 @@ sub_80FB6EC: ; 80FB6EC cmp r0, 0x2 bne @080FB74C movs r0, 0x4 - bl npc_direction_to_obj_anim_image_number + bl FieldObjectDirectionToImageAnimId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -456929,7 +457220,7 @@ sub_80FB6EC: ; 80FB6EC .pool @080FB74C: movs r0, 0x3 - bl npc_direction_to_obj_anim_image_number + bl FieldObjectDirectionToImageAnimId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -456994,8 +457285,8 @@ sub_80FB7A4: ; 80FB7A4 .pool thumb_func_end sub_80FB7A4 - thumb_func_start sub_80FB7E8 -sub_80FB7E8: ; 80FB7E8 + thumb_func_start GetCurrentMapRotatingDoorPuzzleType +GetCurrentMapRotatingDoorPuzzleType: ; 80FB7E8 push {lr} ldr r0, =0x03005d8c ldr r0, [r0] @@ -457019,7 +457310,7 @@ sub_80FB7E8: ; 80FB7E8 @080FB812: pop {r1} bx r1 - thumb_func_end sub_80FB7E8 + thumb_func_end GetCurrentMapRotatingDoorPuzzleType thumb_func_start sub_80FB818 sub_80FB818: ; 80FB818 @@ -457126,7 +457417,7 @@ sub_80FB890: ; 80FB890 thumb_func_start sub_80FB8CC sub_80FB8CC: ; 80FB8CC push {lr} - bl sub_80FB7E8 + bl GetCurrentMapRotatingDoorPuzzleType cmp r0, 0x1 beq @080FB8E0 cmp r0, 0x1 @@ -457724,7 +458015,7 @@ sub_80FBCDC: ; 80FBCDC asrs r1, 24 add r1, r8 str r3, [sp, 0x8] - bl cur_mapdata_get_middle2bit_at + bl MapGridIsImpassableAt lsls r0, 24 lsrs r0, 24 ldr r3, [sp, 0x8] @@ -457871,7 +458162,7 @@ sub_80FBE3C: ; 80FBE3C thumb_func_start sub_80FBE90 sub_80FBE90: ; 80FBE90 push {lr} - bl sub_80FB7E8 + bl GetCurrentMapRotatingDoorPuzzleType cmp r0, 0 beq @080FBEA2 bl sub_80FB8CC @@ -457888,7 +458179,7 @@ sub_80FBEA8: ; 80FBEA8 lsrs r4, r0, 16 lsls r1, 16 lsrs r5, r1, 16 - bl sub_80FB7E8 + bl GetCurrentMapRotatingDoorPuzzleType cmp r0, 0 beq @080FBECA lsls r0, r4, 16 @@ -457906,7 +458197,7 @@ sub_80FBEA8: ; 80FBEA8 thumb_func_start sub_80FBED0 sub_80FBED0: ; 80FBED0 push {lr} - bl sub_80FB7E8 + bl GetCurrentMapRotatingDoorPuzzleType cmp r0, 0 beq @080FBEEA bl overworld_free_bgmaps @@ -457919,8 +458210,8 @@ sub_80FBED0: ; 80FBED0 bx r0 thumb_func_end sub_80FBED0 - thumb_func_start sub_80FBEF0 -sub_80FBEF0: ; 80FBEF0 + thumb_func_start CheckForRotatingDoorPuzzleCollision +CheckForRotatingDoorPuzzleCollision: ; 80FBEF0 push {r4-r7,lr} mov r7, r9 mov r6, r8 @@ -457933,7 +458224,7 @@ sub_80FBEF0: ; 80FBEF0 lsls r2, 16 lsrs r2, 16 mov r8, r2 - bl sub_80FB7E8 + bl GetCurrentMapRotatingDoorPuzzleType cmp r0, 0 bne @080FBF24 b @080FBFC2 @@ -458030,7 +458321,7 @@ sub_80FBEF0: ; 80FBEF0 pop {r1} bx r1 .pool - thumb_func_end sub_80FBEF0 + thumb_func_end CheckForRotatingDoorPuzzleCollision thumb_func_start sub_80FBFD4 sub_80FBFD4: ; 80FBFD4 @@ -458046,7 +458337,7 @@ sub_80FBFD4: ; 80FBFD4 lsls r2, 16 lsrs r2, 16 mov r8, r2 - bl sub_80FB7E8 + bl GetCurrentMapRotatingDoorPuzzleType cmp r0, 0 bne @080FBFFA b @080FC08A @@ -458406,7 +458697,7 @@ sub_80FC2E8: ; 80FC2E8 adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to + bl PlayerGetDestCoords movs r5, 0 adds r6, r4, 0 ldr r0, =0x03005d8c @@ -460297,7 +460588,7 @@ item_field_func_bike: ; 80FD298 adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to + bl PlayerGetDestCoords mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] @@ -460313,25 +460604,25 @@ item_field_func_bike: ; 80FD298 cmp r0, 0x1 beq @080FD30E adds r0, r4, 0 - bl sub_8089990 + bl MetatileBehavior_IsVerticalRail lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @080FD30E adds r0, r4, 0 - bl sub_80899A4 + bl MetatileBehavior_IsHorizontalRail lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @080FD30E adds r0, r4, 0 - bl sub_8089968 + bl MetatileBehavior_IsIsolatedVerticalRail lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @080FD30E adds r0, r4, 0 - bl sub_808997C + bl MetatileBehavior_IsIsolatedHorizontalRail lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -460416,21 +460707,21 @@ sub_80FD394: ; 80FD394 lsls r0, r6, 24 lsrs r5, r0, 24 adds r0, r5, 0 - bl is_tile_x13_waterfall + bl MetatileBehavior_IsWaterfall lsls r0, 24 cmp r0, 0 bne @080FD41C movs r0, 0x10 - bl walkrun_bitfield_and_r0 + bl TestPlayerAvatarFlags lsls r0, 24 cmp r0, 0 bne @080FD41C movs r0, 0x8 - bl walkrun_bitfield_and_r0 + bl TestPlayerAvatarFlags lsls r0, 24 cmp r0, 0 bne @080FD3EC - bl sub_808BE74 + bl IsPlayerFacingSurfableFishableWater lsls r0, 24 cmp r0, 0 beq @080FD41C @@ -460439,7 +460730,7 @@ sub_80FD394: ; 80FD394 b @080FD41E @080FD3EC: adds r0, r5, 0 - bl is_tile_water_maybe + bl MetatileBehavior_IsSurfableWaterOrUnderwater lsls r0, 24 cmp r0, 0 beq @080FD40C @@ -460448,7 +460739,7 @@ sub_80FD394: ; 80FD394 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r4, r2] - bl cur_mapdata_get_middle2bit_at + bl MapGridIsImpassableAt lsls r0, 24 cmp r0, 0 beq @080FD3E8 @@ -460511,7 +460802,7 @@ sub_80FD468: ; 80FD468 bl itemid_get_x28 lsls r0, 24 lsrs r0, 24 - bl fishing_start + bl StartFishing adds r0, r4, 0 bl remove_task pop {r4} @@ -460616,7 +460907,7 @@ sub_80FD504: ; 80FD504 b @080FD5C2 .pool @080FD564: - bl player_get_direction__sp1AA + bl player_get_direction_lower_nybble lsls r0, 24 lsrs r2, r0, 24 movs r1, 0 @@ -460700,7 +460991,7 @@ sub_80FD5F0: ; 80FD5F0 adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to + bl PlayerGetDestCoords ldr r1, =0x03005e00 lsls r0, r6, 2 adds r0, r6 @@ -460970,7 +461261,7 @@ sub_80FD7C8: ; 80FD7C8 adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to + bl PlayerGetDestCoords mov r0, sp ldrh r0, [r0] subs r0, 0x7 @@ -461289,7 +461580,7 @@ sub_80FDA24: ; 80FDA24 movs r0, 0xFF movs r1, 0 movs r2, 0 - bl get_npc_id_by_local_id + bl GetFieldObjectIdByLocalIdAndMap adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -461298,11 +461589,11 @@ sub_80FDA24: ; 80FDA24 lsls r0, 2 ldr r4, =0x02037350 adds r0, r4 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished movs r0, 0xFF movs r1, 0 movs r2, 0 - bl get_npc_id_by_local_id + bl GetFieldObjectIdByLocalIdAndMap adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -461310,11 +461601,11 @@ sub_80FDA24: ; 80FDA24 adds r0, r1 lsls r0, 2 adds r0, r4 - bl rom_npc_by_local_id_and_map_get_trainer_flag + bl FieldObjectClearAnim movs r0, 0xFF movs r1, 0 movs r2, 0 - bl get_npc_id_by_local_id + bl GetFieldObjectIdByLocalIdAndMap adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -461324,7 +461615,7 @@ sub_80FDA24: ; 80FDA24 adds r0, r4 bl npc_sync_anim_pause_bits adds r0, r5, 0 - bl sub_808B828 + bl PlayerTurnInPlace pop {r4,r5} pop {r0} bx r0 @@ -461339,7 +461630,7 @@ sub_80FDA94: ; 80FDA94 movs r0, 0xFF movs r1, 0 movs r2, 0 - bl get_npc_id_by_local_id + bl GetFieldObjectIdByLocalIdAndMap adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -461348,7 +461639,7 @@ sub_80FDA94: ; 80FDA94 lsls r0, 2 ldr r1, =0x02037350 adds r0, r1 - bl npc_get_bit7_or_const_x10_when_inactive + bl FieldObjectCheckIfSpecialAnimFinishedOrInactive lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -461378,7 +461669,7 @@ sub_80FDADC: ; 80FDADC movs r0, 0xFF movs r1, 0 movs r2, 0 - bl get_npc_id_by_local_id + bl GetFieldObjectIdByLocalIdAndMap adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -461387,7 +461678,7 @@ sub_80FDADC: ; 80FDADC lsls r0, 2 ldr r1, =0x02037350 adds r0, r1 - bl npc_get_bit7_or_const_x10_when_inactive + bl FieldObjectCheckIfSpecialAnimFinishedOrInactive lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -461737,14 +462028,14 @@ sub_80FDE2C: ; 80FDE2C mov r0, sp adds r1, r4, 0 bl player_get_pos_to_plus_one_step_in_direction_player_is_facing - bl player_get_height + bl PlayerGetZCoord adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 mov r0, sp ldrh r0, [r0] ldrh r1, [r4] - bl npc_id_by_pos_and_height + bl GetFieldObjectIdByXYZ lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x10 @@ -515097,9 +515388,9 @@ sub_8119094: ; 8119094 .pool thumb_func_end sub_8119094 - thumb_func_start dp04_initiate_movement -; void dp04_initiate_movement(int dpad_direction, int buttons_new, int buttons_held) -dp04_initiate_movement: ; 8119164 + thumb_func_start MovePlayerOnBike +; void MovePlayerOnBike(int dpad_direction, int buttons_new, int buttons_held) +MovePlayerOnBike: ; 8119164 push {r4,lr} lsls r0, 24 lsrs r3, r0, 24 @@ -515115,28 +515406,28 @@ dp04_initiate_movement: ; 8119164 beq @0811918C adds r0, r3, 0 adds r1, r4, 0 - bl invoke_player_npc_state_changer_chooser + bl MovePlayerOnMachBike b @08119194 .pool @0811918C: adds r0, r3, 0 adds r1, r4, 0 - bl sub_81193C8 + bl MovePlayerOnAcroBike @08119194: pop {r4} pop {r0} bx r0 - thumb_func_end dp04_initiate_movement + thumb_func_end MovePlayerOnBike - thumb_func_start invoke_player_npc_state_changer_chooser -invoke_player_npc_state_changer_chooser: ; 811919C + thumb_func_start MovePlayerOnMachBike +MovePlayerOnMachBike: ; 811919C push {r4,lr} sub sp, 0x4 mov r1, sp strb r0, [r1] ldr r4, =gUnknown_0859744C mov r0, sp - bl sub_81191CC + bl CheckMovementInputMachBike lsls r0, 24 lsrs r0, 22 adds r0, r4 @@ -515150,13 +515441,13 @@ invoke_player_npc_state_changer_chooser: ; 811919C pop {r0} bx r0 .pool - thumb_func_end invoke_player_npc_state_changer_chooser + thumb_func_end MovePlayerOnMachBike - thumb_func_start sub_81191CC -sub_81191CC: ; 81191CC + thumb_func_start CheckMovementInputMachBike +CheckMovementInputMachBike: ; 81191CC push {r4,lr} adds r4, r0, 0 - bl player_get_direction_upper_4bits + bl player_get_direction_upper_nybble lsls r0, 24 lsrs r0, 24 adds r3, r0, 0 @@ -515200,14 +515491,14 @@ sub_81191CC: ; 81191CC pop {r4} pop {r1} bx r1 - thumb_func_end sub_81191CC + thumb_func_end CheckMovementInputMachBike thumb_func_start sub_8119224 sub_8119224: ; 8119224 push {lr} lsls r0, 24 lsrs r0, 24 - bl player_npc_use_look1 + bl PlayerFaceDirection bl sub_811A128 pop {r0} bx r0 @@ -515232,7 +515523,7 @@ sub_8119238: ; 8119238 cmp r0, 0 beq @08119270 adds r0, r5, 0 - bl sub_808B828 + bl PlayerTurnInPlace bl sub_811A128 b @0811927A .pool @@ -515271,7 +515562,7 @@ sub_8119280: ; 8119280 beq @081192BC ldrb r0, [r4, 0x18] lsrs r0, 4 - bl npc_state_reaction_to_tile + bl sub_8119344 b @0811933A .pool @081192BC: @@ -515293,19 +515584,19 @@ sub_8119280: ; 8119280 cmp r4, 0x6 bne @081192E8 adds r0, r5, 0 - bl npc_use_some_d2s_and_sound + bl PlayerJumpLedge b @0811933A @081192E8: bl sub_811A128 cmp r4, 0x4 bne @08119304 adds r0, r5, 0 - bl sub_808B324 + bl IsPlayerCollidingWithFarawayIslandMew lsls r0, 24 cmp r0, 0 beq @08119304 adds r0, r5, 0 - bl sub_808B7BC + bl PlayerOnBikeCollideWithFarawayIslandMew b @0811933A @08119304: subs r0, r4, 0x5 @@ -515314,7 +515605,7 @@ sub_8119280: ; 8119280 cmp r0, 0x3 bls @0811933A adds r0, r7, 0 - bl tile_sound_react + bl PlayerOnBikeCollide b @0811933A @08119316: ldr r1, =gUnknown_0859745C @@ -515341,8 +515632,8 @@ sub_8119280: ; 8119280 .pool thumb_func_end sub_8119280 - thumb_func_start npc_state_reaction_to_tile -npc_state_reaction_to_tile: ; 8119344 + thumb_func_start sub_8119344 +sub_8119344: ; 8119344 push {r4-r7,lr} lsls r0, 24 lsrs r5, r0, 24 @@ -515368,7 +515659,7 @@ npc_state_reaction_to_tile: ; 8119344 cmp r4, 0x6 bne @08119380 adds r0, r5, 0 - bl npc_use_some_d2s_and_sound + bl PlayerJumpLedge b @081193BE .pool @08119380: @@ -515376,12 +515667,12 @@ npc_state_reaction_to_tile: ; 8119344 cmp r4, 0x4 bne @0811939C adds r0, r5, 0 - bl sub_808B324 + bl IsPlayerCollidingWithFarawayIslandMew lsls r0, 24 cmp r0, 0 beq @0811939C adds r0, r5, 0 - bl sub_808B7BC + bl PlayerOnBikeCollideWithFarawayIslandMew b @081193BE @0811939C: subs r0, r4, 0x5 @@ -515390,7 +515681,7 @@ npc_state_reaction_to_tile: ; 8119344 cmp r0, 0x3 bls @081193BE adds r0, r7, 0 - bl tile_sound_react + bl PlayerOnBikeCollide b @081193BE @081193AE: ldr r0, =gUnknown_0859745C @@ -515405,11 +515696,11 @@ npc_state_reaction_to_tile: ; 8119344 pop {r0} bx r0 .pool - thumb_func_end npc_state_reaction_to_tile + thumb_func_end sub_8119344 - thumb_func_start sub_81193C8 -; void sub_81193C8(int dpad_direction, int buttons_new, int buttons_held) -sub_81193C8: ; 81193C8 + thumb_func_start MovePlayerOnAcroBike +; void MovePlayerOnAcroBike(int dpad_direction, int buttons_new, int buttons_held) +MovePlayerOnAcroBike: ; 81193C8 push {r4,lr} sub sp, 0x4 mov r3, sp @@ -515420,7 +515711,7 @@ sub_81193C8: ; 81193C8 lsrs r2, 16 ldr r4, =gUnknown_08597468 mov r0, sp - bl sub_8119400 + bl CheckMovementInputAcroBike lsls r0, 24 lsrs r0, 22 adds r0, r4 @@ -515434,10 +515725,10 @@ sub_81193C8: ; 81193C8 pop {r0} bx r0 .pool - thumb_func_end sub_81193C8 + thumb_func_end MovePlayerOnAcroBike - thumb_func_start sub_8119400 -sub_8119400: ; 8119400 + thumb_func_start CheckMovementInputAcroBike +CheckMovementInputAcroBike: ; 8119400 push {r4,lr} lsls r1, 16 lsrs r1, 16 @@ -515456,17 +515747,17 @@ sub_8119400: ; 8119400 pop {r1} bx r1 .pool - thumb_func_end sub_8119400 + thumb_func_end CheckMovementInputAcroBike - thumb_func_start sub_811942C -sub_811942C: ; 811942C + thumb_func_start CheckMovementInputAcroBikeNormal +CheckMovementInputAcroBikeNormal: ; 811942C push {r4-r6,lr} adds r4, r0, 0 lsls r1, 16 lsrs r6, r1, 16 lsls r2, 16 lsrs r5, r2, 16 - bl player_get_direction_upper_4bits + bl player_get_direction_upper_nybble lsls r0, 24 lsrs r3, r0, 24 ldr r2, =0x02037590 @@ -515527,7 +515818,7 @@ sub_811942C: ; 811942C adds r0, r4, 0 adds r1, r6, 0 adds r2, r5, 0 - bl sub_8119400 + bl CheckMovementInputAcroBike lsls r0, 24 lsrs r0, 24 b @081194C0 @@ -515539,10 +515830,10 @@ sub_811942C: ; 811942C pop {r4-r6} pop {r1} bx r1 - thumb_func_end sub_811942C + thumb_func_end CheckMovementInputAcroBikeNormal - thumb_func_start sub_81194C8 -sub_81194C8: ; 81194C8 + thumb_func_start CheckMovementInputAcroBikeChangingDirection +CheckMovementInputAcroBikeChangingDirection: ; 81194C8 push {r4-r6,lr} adds r5, r0, 0 ldr r4, =0x02037590 @@ -515564,7 +515855,7 @@ sub_81194C8: ; 81194C8 b @0811953A .pool @081194F4: - bl player_get_direction_upper_4bits + bl player_get_direction_upper_nybble lsls r0, 24 lsrs r6, r0, 24 bl sub_8119D30 @@ -515577,7 +515868,7 @@ sub_81194C8: ; 81194C8 movs r0, 0x1 strb r0, [r4, 0xB] adds r0, r6, 0 - bl direction_reversed + bl GetOppositeDirection ldrb r1, [r5] lsls r0, 24 lsrs r0, 24 @@ -515601,15 +515892,15 @@ sub_81194C8: ; 81194C8 pop {r4-r6} pop {r1} bx r1 - thumb_func_end sub_81194C8 + thumb_func_end CheckMovementInputAcroBikeChangingDirection - thumb_func_start sub_8119540 -sub_8119540: ; 8119540 + thumb_func_start CheckMovementInputAcroBikeStandingWheelie +CheckMovementInputAcroBikeStandingWheelie: ; 8119540 push {r4-r7,lr} adds r7, r0, 0 lsls r4, r2, 16 lsrs r4, 16 - bl player_get_direction_upper_4bits + bl player_get_direction_upper_nybble lsls r0, 24 lsrs r6, r0, 24 ldr r5, =0x02037590 @@ -515629,7 +515920,7 @@ sub_8119540: ; 8119540 bne @08119594 strb r4, [r5, 0xA] ldrb r0, [r1, 0x1E] - bl sub_8089954 + bl MetatileBehavior_IsBumpySlope lsls r0, 24 lsrs r0, 24 cmp r0, 0 @@ -515681,10 +515972,10 @@ sub_8119540: ; 8119540 pop {r4-r7} pop {r1} bx r1 - thumb_func_end sub_8119540 + thumb_func_end CheckMovementInputAcroBikeStandingWheelie - thumb_func_start sub_81195E0 -sub_81195E0: ; 81195E0 + thumb_func_start CheckMovementInputAcroBikeBunnyHop +CheckMovementInputAcroBikeBunnyHop: ; 81195E0 push {r4-r7,lr} mov r7, r9 mov r6, r8 @@ -515696,7 +515987,7 @@ sub_81195E0: ; 81195E0 lsls r2, 16 lsrs r2, 16 mov r8, r2 - bl player_get_direction_upper_4bits + bl player_get_direction_upper_nybble lsls r0, 24 lsrs r5, r0, 24 adds r2, r5, 0 @@ -515714,7 +516005,7 @@ sub_81195E0: ; 81195E0 bne @08119652 bl sub_811A128 ldrb r0, [r7, 0x1E] - bl sub_8089954 + bl MetatileBehavior_IsBumpySlope lsls r0, 24 lsrs r0, 24 cmp r0, 0 @@ -515724,7 +516015,7 @@ sub_81195E0: ; 81195E0 adds r0, r6, 0 mov r1, r9 mov r2, r8 - bl sub_8119400 + bl CheckMovementInputAcroBike lsls r0, 24 lsrs r0, 24 b @08119676 @@ -515765,10 +516056,10 @@ sub_81195E0: ; 81195E0 pop {r1} bx r1 .pool - thumb_func_end sub_81195E0 + thumb_func_end CheckMovementInputAcroBikeBunnyHop - thumb_func_start sub_8119688 -sub_8119688: ; 8119688 + thumb_func_start CheckMovementInputAcroBikeMovingWheelie +CheckMovementInputAcroBikeMovingWheelie: ; 8119688 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -515781,7 +516072,7 @@ sub_8119688: ; 8119688 lsls r2, 16 lsrs r2, 16 mov r8, r2 - bl player_get_direction__sp1AA + bl player_get_direction_lower_nybble lsls r0, 24 lsrs r5, r0, 24 adds r2, r5, 0 @@ -515801,7 +516092,7 @@ sub_8119688: ; 8119688 bne @08119720 bl sub_811A128 ldrb r0, [r7, 0x1E] - bl sub_8089954 + bl MetatileBehavior_IsBumpySlope lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 @@ -515836,7 +516127,7 @@ sub_8119688: ; 8119688 adds r0, r6, 0 mov r1, r10 mov r2, r8 - bl sub_8119400 + bl CheckMovementInputAcroBike lsls r0, 24 lsrs r0, 24 b @08119750 @@ -515875,10 +516166,10 @@ sub_8119688: ; 8119688 pop {r1} bx r1 .pool - thumb_func_end sub_8119688 + thumb_func_end CheckMovementInputAcroBikeMovingWheelie - thumb_func_start sub_8119764 -sub_8119764: ; 8119764 + thumb_func_start CheckMovementInputAcroBikeUnknownMode5 +CheckMovementInputAcroBikeUnknownMode5: ; 8119764 push {r4-r6,lr} mov r6, r8 push {r6} @@ -515904,13 +516195,13 @@ sub_8119764: ; 8119764 ldrb r1, [r0, 0x18] lsls r1, 28 lsrs r1, 28 - bl npc_set_direction + bl FieldObjectSetDirection movs r0, 0 strb r0, [r6, 0x8] mov r0, r8 adds r1, r4, 0 adds r2, r5, 0 - bl sub_8119400 + bl CheckMovementInputAcroBike lsls r0, 24 lsrs r0, 24 pop {r3} @@ -515919,10 +516210,10 @@ sub_8119764: ; 8119764 pop {r1} bx r1 .pool - thumb_func_end sub_8119764 + thumb_func_end CheckMovementInputAcroBikeUnknownMode5 - thumb_func_start sub_81197C0 -sub_81197C0: ; 81197C0 + thumb_func_start CheckMovementInputAcroBikeUnknownMode6 +CheckMovementInputAcroBikeUnknownMode6: ; 81197C0 push {r4,lr} lsls r1, 16 lsrs r1, 16 @@ -515931,21 +516222,21 @@ sub_81197C0: ; 81197C0 ldr r4, =0x02037590 movs r3, 0 strb r3, [r4, 0x8] - bl sub_8119400 + bl CheckMovementInputAcroBike lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .pool - thumb_func_end sub_81197C0 + thumb_func_end CheckMovementInputAcroBikeUnknownMode6 thumb_func_start sub_81197E4 sub_81197E4: ; 81197E4 push {lr} lsls r0, 24 lsrs r0, 24 - bl player_npc_use_look1 + bl PlayerFaceDirection pop {r0} bx r0 thumb_func_end sub_81197E4 @@ -515972,7 +516263,7 @@ sub_81197F4: ; 81197F4 lsrs r4, r0, 4 @0811981A: adds r0, r4, 0 - bl player_npc_use_look1 + bl PlayerFaceDirection pop {r4,r5} pop {r0} bx r0 @@ -516017,18 +516308,18 @@ sub_8119830: ; 8119830 cmp r4, 0x6 bne @0811988A adds r0, r5, 0 - bl npc_use_some_d2s_and_sound + bl PlayerJumpLedge b @081198BA @0811988A: cmp r4, 0x4 bne @081198A2 adds r0, r5, 0 - bl sub_808B324 + bl IsPlayerCollidingWithFarawayIslandMew lsls r0, 24 cmp r0, 0 beq @081198A2 adds r0, r5, 0 - bl sub_808B7BC + bl PlayerOnBikeCollideWithFarawayIslandMew b @081198BA @081198A2: subs r0, r4, 0x5 @@ -516037,11 +516328,11 @@ sub_8119830: ; 8119830 cmp r0, 0x3 bls @081198BA adds r0, r6, 0 - bl tile_sound_react + bl PlayerOnBikeCollide b @081198BA @081198B4: adds r0, r6, 0 - bl sub_808B750 + bl PlayerGoSpeed2 @081198BA: pop {r4-r6} pop {r0} @@ -516330,7 +516621,7 @@ sub_8119AA4: ; 8119AA4 cmp r1, 0x4 bhi @08119B2C ldrb r0, [r5, 0x1E] - bl sub_8089954 + bl MetatileBehavior_IsBumpySlope lsls r0, 24 cmp r0, 0 beq @08119B1A @@ -516399,7 +516690,7 @@ sub_8119B34: ; 8119B34 cmp r1, 0x4 bhi @08119BBC ldrb r0, [r5, 0x1E] - bl sub_8089954 + bl MetatileBehavior_IsBumpySlope lsls r0, 24 cmp r0, 0 beq @08119BAA @@ -516460,7 +516751,7 @@ sub_8119BC4: ; 8119BC4 cmp r1, 0x6 bne @08119C1E adds r0, r4, 0 - bl npc_use_some_d2s_and_sound + bl PlayerJumpLedge b @08119C36 @08119C1E: subs r0, r1, 0x5 @@ -516790,7 +517081,7 @@ sub_8119E38: ; 8119E38 adds r0, r6, 0 add r1, sp, 0x4 adds r2, r5, 0 - bl numbers_move_direction + bl MoveCoords add r0, sp, 0x4 movs r1, 0 ldrsh r0, [r0, r1] @@ -516832,7 +517123,7 @@ sub_8119EA4: ; 8119EA4 lsls r2, 16 asrs r2, 16 str r5, [sp] - bl sub_808B094 + bl CheckForFieldObjectCollision lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x4 @@ -516840,7 +517131,7 @@ sub_8119EA4: ; 8119EA4 cmp r4, 0 bne @08119EE0 adds r0, r5, 0 - bl sub_8119F18 + bl IsRunningDisallowedByMetatile lsls r0, 24 cmp r0, 0 beq @08119EDC @@ -516863,7 +517154,7 @@ sub_8119EF0: ; 8119EF0 push {lr} lsls r0, 24 lsrs r0, 24 - bl sub_8119F18 + bl IsRunningDisallowedByMetatile lsls r0, 24 cmp r0, 0 bne @08119F08 @@ -516882,22 +517173,23 @@ sub_8119EF0: ; 8119EF0 bx r1 thumb_func_end sub_8119EF0 - thumb_func_start sub_8119F18 -sub_8119F18: ; 8119F18 + thumb_func_start IsRunningDisallowedByMetatile +; BOOL IsRunningDisallowedByMetatile(u8 metatileBehavior) +IsRunningDisallowedByMetatile: ; 8119F18 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 - bl sub_80899D0 + bl MetatileBehavior_IsRunningDisallowed lsls r0, 24 cmp r0, 0 bne @08119F42 adds r0, r4, 0 - bl sub_8089750 + bl MetatileBehavior_IsFortreeBridge lsls r0, 24 cmp r0, 0 beq @08119F46 - bl player_get_height + bl PlayerGetZCoord movs r1, 0x1 ands r1, r0 cmp r1, 0 @@ -516911,7 +517203,7 @@ sub_8119F18: ; 8119F18 pop {r4} pop {r1} bx r1 - thumb_func_end sub_8119F18 + thumb_func_end IsRunningDisallowedByMetatile thumb_func_start sub_8119F50 sub_8119F50: ; 8119F50 @@ -516946,21 +517238,21 @@ sub_8119F74: ; 8119F74 cmp r0, 0x1 bhi @08119F9E adds r0, r4, 0 - bl sub_8089968 + bl MetatileBehavior_IsIsolatedVerticalRail lsls r0, 24 cmp r0, 0 bne @08119FB6 adds r0, r4, 0 - bl sub_8089990 + bl MetatileBehavior_IsVerticalRail b @08119FB0 @08119F9E: adds r0, r5, 0 - bl sub_808997C + bl MetatileBehavior_IsIsolatedHorizontalRail lsls r0, 24 cmp r0, 0 bne @08119FB6 adds r0, r5, 0 - bl sub_80899A4 + bl MetatileBehavior_IsHorizontalRail @08119FB0: lsls r0, 24 cmp r0, 0 @@ -517023,7 +517315,7 @@ sub_8119FF8: ; 8119FF8 adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to + bl PlayerGetDestCoords mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] @@ -517032,7 +517324,7 @@ sub_8119FF8: ; 8119FF8 bl cur_mapdata_block_get_role_at lsls r0, 24 lsrs r0, 24 - bl sub_8119F18 + bl IsRunningDisallowedByMetatile lsls r0, 24 cmp r0, 0 bne @0811A038 @@ -517052,7 +517344,7 @@ sub_8119FF8: ; 8119FF8 player_should_look_direction_be_enforced_upon_movement: ; 811A044 push {lr} movs r0, 0x4 - bl walkrun_bitfield_and_r0 + bl TestPlayerAvatarFlags lsls r0, 24 cmp r0, 0 beq @0811A078 @@ -517064,7 +517356,7 @@ player_should_look_direction_be_enforced_upon_movement: ; 811A044 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x1E] - bl sub_8089954 + bl MetatileBehavior_IsBumpySlope lsls r0, 24 cmp r0, 0 beq @0811A078 @@ -517093,17 +517385,17 @@ sub_811A080: ; 811A080 cmp r0, 0 beq @0811A0B0 movs r0, 0x1 - bl walkrun_set_bike_bits - bl sav1_reset_x2C + bl SetPlayerAvatarTransition + bl sav1_reset_battle_music_maybe bl sub_8085784 b @0811A0C4 .pool @0811A0B0: adds r0, r2, 0 - bl walkrun_set_bike_bits + bl SetPlayerAvatarTransition ldr r4, =0x00000193 adds r0, r4, 0 - bl sav1_set_x2C + bl sav1_set_battle_music_maybe adds r0, r4, 0 bl sub_80858C4 @0811A0C4: @@ -517230,7 +517522,7 @@ sub_811A188: ; 811A188 adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to + bl PlayerGetDestCoords mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] @@ -517239,13 +517531,13 @@ sub_811A188: ; 811A188 bl cur_mapdata_block_get_role_at lsls r0, 24 lsrs r0, 24 - bl sub_8089954 + bl MetatileBehavior_IsBumpySlope lsls r0, 24 cmp r0, 0 beq @0811A1D0 movs r0, 0x2 strb r0, [r5, 0x8] - bl player_get_direction_upper_4bits + bl player_get_direction_upper_nybble lsls r0, 24 lsrs r0, 24 bl sub_808C1B4 @@ -517257,8 +517549,9 @@ sub_811A188: ; 811A188 .pool thumb_func_end sub_811A188 - thumb_func_start is_tile_to_run_on -is_tile_to_run_on: ; 811A1DC + thumb_func_start IsRunningDisallowed +; BOOL IsRunningDisallowed(u8 metatileBehavior) +IsRunningDisallowed: ; 811A1DC push {lr} lsls r0, 24 lsrs r2, r0, 24 @@ -517269,7 +517562,7 @@ is_tile_to_run_on: ; 811A1DC cmp r0, 0 beq @0811A1FC adds r0, r2, 0 - bl sub_8119F18 + bl IsRunningDisallowedByMetatile lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -517283,7 +517576,7 @@ is_tile_to_run_on: ; 811A1DC @0811A206: pop {r1} bx r1 - thumb_func_end is_tile_to_run_on + thumb_func_end IsRunningDisallowed thumb_func_start sub_811A20C sub_811A20C: ; 811A20C @@ -544605,7 +544898,7 @@ sub_8127ACC: ; 8127ACC adds r2, r3 adds r1, r2, 0x2 adds r0, r2, 0 - bl player_get_pos_to + bl PlayerGetDestCoords pop {r4} pop {r0} bx r0 @@ -545972,7 +546265,7 @@ sub_812853C: ; 812853C ldr r2, [sp, 0xC] lsrs r1, r2, 16 movs r2, 0 - bl npc_id_by_pos_and_height + bl GetFieldObjectIdByXYZ lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 @@ -546094,7 +546387,7 @@ sub_812853C: ; 812853C ldr r2, [sp, 0x20] lsrs r1, r2, 16 movs r2, 0 - bl npc_id_by_pos_and_height + bl GetFieldObjectIdByXYZ lsls r0, 24 lsrs r0, 24 cmp r0, 0x10 @@ -546198,7 +546491,7 @@ sub_812853C: ; 812853C ldr r2, [sp, 0x20] lsrs r1, r2, 16 movs r2, 0 - bl npc_id_by_pos_and_height + bl GetFieldObjectIdByXYZ lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 @@ -546336,7 +546629,7 @@ sub_812853C: ; 812853C ldr r2, [sp, 0x20] lsrs r1, r2, 16 movs r2, 0 - bl npc_id_by_pos_and_height + bl GetFieldObjectIdByXYZ lsls r0, 24 lsrs r0, 24 cmp r0, 0x10 @@ -548407,7 +548700,7 @@ sub_81299DC: ; 81299DC mov r6, r8 push {r6} sub sp, 0x4 - bl player_get_direction__sp1AA + bl player_get_direction_lower_nybble ldr r3, =0x0203aa38 ldr r2, =0x02020630 ldr r4, =0x03005dd0 @@ -571350,12 +571643,12 @@ npc_before_player_of_type: ; 8135424 adds r1, r4, 0x2 adds r0, r4, 0 bl player_get_pos_to_plus_one_step_in_direction_player_is_facing - bl player_get_height + bl PlayerGetZCoord strb r0, [r4, 0x4] ldrh r0, [r4] ldrh r1, [r4, 0x2] ldrb r2, [r4, 0x4] - bl npc_id_by_pos_and_height + bl GetFieldObjectIdByXYZ lsls r0, 24 lsrs r0, 24 ldr r2, =0x02037350 @@ -571413,12 +571706,12 @@ task08_080C9820: ; 813549C ldr r1, =0x02037350 adds r4, r0, r1 adds r0, r4, 0 - bl npc_is_visible_or_is_x40 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive lsls r0, 24 cmp r0, 0 beq @081354D2 adds r0, r4, 0 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished lsls r0, 24 cmp r0, 0 beq @0813551E @@ -571441,7 +571734,7 @@ task08_080C9820: ; 813549C bl sub_808C114 adds r0, r4, 0 movs r1, 0x39 - bl npc_set_state_2 + bl FieldObjectSetSpecialAnim ldr r0, =0x03005e00 lsls r1, r6, 2 adds r1, r6 @@ -571469,7 +571762,7 @@ sub_813552C: ; 813552C lsls r0, 2 ldr r1, =0x02037350 adds r0, r1 - bl npc_get_bit7_or_const_x10_when_inactive + bl FieldObjectCheckIfSpecialAnimFinishedOrInactive lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -571501,7 +571794,7 @@ sub_8135578: ; 8135578 lsrs r4, r0, 24 cmp r4, 0 bne @081355FC - bl player_get_direction__sp1AA + bl player_get_direction_lower_nybble ldr r6, =0x02038c08 lsls r0, 24 lsrs r0, 24 @@ -571533,12 +571826,12 @@ sub_8135578: ; 8135578 lsls r4, 2 ldr r0, =0x02037350 adds r4, r0 - bl sub_808BF6C + bl GetPlayerAvatarGraphicsIdByCurrentState adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl set_field_object_graphics + bl FieldObjectSetGraphicsId ldrb r1, [r5, 0x4] lsls r0, r1, 4 adds r0, r1 @@ -571744,7 +572037,7 @@ sub_8135780: ; 8135780 cmp r0, 0 bne @081357AC movs r0, 0x1 - bl walkrun_set_bike_bits + bl SetPlayerAvatarTransition @081357AC: movs r0, 0 pop {r1} @@ -576096,7 +576389,7 @@ sub_8137D0C: ; 8137D0C sp0E3_walkrun_bitfield_interpretation: ; 8137D34 push {lr} movs r0, 0x4 - bl walkrun_bitfield_and_r0 + bl TestPlayerAvatarFlags lsls r0, 24 cmp r0, 0 beq @08137D46 @@ -576104,7 +576397,7 @@ sp0E3_walkrun_bitfield_interpretation: ; 8137D34 b @08137D58 @08137D46: movs r0, 0x2 - bl walkrun_bitfield_and_r0 + bl TestPlayerAvatarFlags lsls r0, 24 cmp r0, 0 bne @08137D56 @@ -576365,7 +576658,7 @@ sub_8137F44: ; 8137F44 movs r1, 0 bl VarSet movs r0, 0 - bl sav1_set_x2C + bl sav1_set_battle_music_maybe @08137F7C: pop {r4} pop {r0} @@ -576773,8 +577066,8 @@ sub_8138240: ; 8138240 .pool thumb_func_end sub_8138240 - thumb_func_start sub_81382A0 -sub_81382A0: ; 81382A0 + thumb_func_start SpawnLinkPartnerFieldObject +SpawnLinkPartnerFieldObject: ; 81382A0 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -576798,7 +577091,7 @@ sub_81382A0: ; 81382A0 lsls r0, 24 lsrs r0, 24 mov r10, r0 - bl player_get_direction__sp1AA + bl player_get_direction_lower_nybble lsls r0, 24 lsrs r0, 24 adds r1, r0, 0 @@ -576944,7 +577237,7 @@ sub_81382A0: ; 81382A0 adds r0, r5, 0 adds r2, r4, 0 mov r3, r12 - bl sub_808DC44 + bl SpawnSpecialFieldObjectParametrized adds r0, r5, 0 adds r1, r4, 0 adds r2, r6, 0 @@ -576973,7 +577266,7 @@ sub_81382A0: ; 81382A0 pop {r0} bx r0 .pool - thumb_func_end sub_81382A0 + thumb_func_end SpawnLinkPartnerFieldObject thumb_func_start sub_813842C sub_813842C: ; 813842C @@ -577003,7 +577296,7 @@ sub_813842C: ; 813842C ldrb r1, [r0, 0x5] ldrb r2, [r0, 0x4] adds r0, r3, 0 - bl get_npc_id_by_local_id + bl GetFieldObjectIdByLocalIdAndMap lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x10 @@ -578021,7 +578314,7 @@ sub_8138D10: ; 8138D10 cmp r0, 0x6 bne @08138D7C strh r5, [r4, 0xE] - bl player_get_direction__sp1AA + bl player_get_direction_lower_nybble lsls r0, 24 lsrs r0, 24 adds r1, r0, 0 @@ -578166,7 +578459,7 @@ sub_8138E2C: ; 8138E2C movs r6, 0 movs r5, 0 movs r4, 0 - bl player_get_direction__sp1AA + bl player_get_direction_lower_nybble lsls r0, 24 lsrs r0, 24 adds r1, r0, 0 @@ -578569,8 +578862,8 @@ sub_81390E0: ; 81390E0 .pool thumb_func_end sub_81390E0 - thumb_func_start sub_8139158 -sub_8139158: ; 8139158 + thumb_func_start SpawnScriptFieldObject +SpawnScriptFieldObject: ; 8139158 push {lr} sub sp, 0x8 ldr r0, =0x03005d8c @@ -578589,7 +578882,7 @@ sub_8139158: ; 8139158 movs r0, 0x7 movs r1, 0x8 movs r2, 0x7F - bl sub_808DC44 + bl SpawnSpecialFieldObjectParametrized lsls r0, 24 lsrs r0, 24 ldr r2, =0x02037350 @@ -578602,30 +578895,30 @@ sub_8139158: ; 8139158 orrs r0, r2 strb r0, [r1, 0x1] ldrb r0, [r1, 0x4] - bl sub_808EEA8 + bl CameraObjectSetFollowedObjectId add sp, 0x8 pop {r0} bx r0 .pool - thumb_func_end sub_8139158 + thumb_func_end SpawnScriptFieldObject - thumb_func_start sp114_080CAA88 -sp114_080CAA88: ; 81391AC + thumb_func_start RemoveScriptFieldObject +RemoveScriptFieldObject: ; 81391AC push {lr} - bl sub_808BCDC + bl GetPlayerAvatarObjectId lsls r0, 24 lsrs r0, 24 - bl sub_808EEA8 + bl CameraObjectSetFollowedObjectId ldr r0, =0x03005d8c ldr r0, [r0] ldrb r1, [r0, 0x5] ldrb r2, [r0, 0x4] movs r0, 0x7F - bl npc_hide_by_local_id_and_map + bl RemoveFieldObjectByLocalIdAndMap pop {r0} bx r0 .pool - thumb_func_end sp114_080CAA88 + thumb_func_end RemoveScriptFieldObject thumb_func_start sub_81391D0 sub_81391D0: ; 81391D0 @@ -582359,7 +582652,7 @@ sub_813B0B4: ; 813B0B4 ldrb r2, [r0, 0x4] movs r0, 0x1 mov r3, sp - bl npc_id_by_local_id_and_map_ret_success + bl TryGetFieldObjectIdByLocalIdAndMap cmp r4, 0 bne @0813B0F0 movs r0, 0xC4 @@ -582409,7 +582702,7 @@ sub_813B0B4: ; 813B0B4 adds r0, r5, r0 ldrb r2, [r0] movs r0, 0x1 - bl sub_8084910 + bl update_saveblock1_field_object_coords add sp, 0x4 pop {r4,r5} pop {r0} @@ -587599,7 +587892,7 @@ evolution_cutscene: ; 813DA8C orrs r0, r2 strb r0, [r1] bl sub_817BE78 - ldr r0, =sub_813E570 + ldr r0, =evovle_mon_maybe movs r1, 0 bl AddTask ldr r1, =0x0203ab80 @@ -588264,8 +588557,8 @@ sub_813E3C0: ; 813E3C0 bx r0 thumb_func_end sub_813E3C0 - thumb_func_start sub_813E3DC -sub_813E3DC: ; 813E3DC + thumb_func_start evovle_mon_internal_maybe +evovle_mon_internal_maybe: ; 813E3DC push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -588441,10 +588734,10 @@ sub_813E3DC: ; 813E3DC pop {r0} bx r0 .pool - thumb_func_end sub_813E3DC + thumb_func_end evovle_mon_internal_maybe - thumb_func_start sub_813E570 -sub_813E570: ; 813E570 + thumb_func_start evovle_mon_maybe +evovle_mon_maybe: ; 813E570 push {r4-r7,lr} mov r7, r9 mov r6, r8 @@ -589031,7 +589324,7 @@ sub_813E570: ; 813E570 bne @0813EB06 ldrh r0, [r4, 0xA] mov r1, r9 - bl sub_813E3DC + bl evovle_mon_internal_maybe @0813EB06: adds r0, r7, 0 bl remove_task @@ -589732,7 +590025,7 @@ sub_813E570: ; 813E570 pop {r0} bx r0 .pool - thumb_func_end sub_813E570 + thumb_func_end evovle_mon_maybe thumb_func_start sub_813F1B8 sub_813F1B8: ; 813F1B8 @@ -629099,8 +629392,8 @@ sub_8153E88: ; 8153E88 bx r1 thumb_func_end sub_8153E88 - thumb_func_start dp03_step_water_reflection -dp03_step_water_reflection: ; 8153ED4 + thumb_func_start SetUpReflection +SetUpReflection: ; 8153ED4 push {r4-r7,lr} mov r7, r8 push {r7} @@ -629122,7 +629415,7 @@ dp03_step_water_reflection: ; 8153ED4 lsls r1, 2 ldr r0, =0x02020630 adds r7, r1, r0 - ldr r0, =objc_80DAF50 + ldr r0, =objc_reflection_maybe str r0, [r7, 0x1C] ldrb r1, [r7, 0x5] movs r0, 0xC @@ -629188,7 +629481,7 @@ dp03_step_water_reflection: ; 8153ED4 pop {r0} bx r0 .pool - thumb_func_end dp03_step_water_reflection + thumb_func_end SetUpReflection thumb_func_start sub_8153F98 sub_8153F98: ; 8153F98 @@ -629329,8 +629622,9 @@ npc_pal_op_A: ; 8154078 .pool thumb_func_end npc_pal_op_A - thumb_func_start objc_80DAF50 -objc_80DAF50: ; 81540A8 + thumb_func_start objc_reflection_maybe +; void objc_reflection_maybe(struct obj *object) +objc_reflection_maybe: ; 81540A8 push {r4-r7,lr} mov r7, r9 mov r6, r8 @@ -629518,7 +629812,7 @@ objc_80DAF50: ; 81540A8 pop {r0} bx r0 .pool - thumb_func_end objc_80DAF50 + thumb_func_end objc_reflection_maybe thumb_func_start sub_8154228 sub_8154228: ; 8154228 @@ -629671,7 +629965,7 @@ oei_shadow: ; 8154340 ldrb r0, [r5] ldrb r1, [r5, 0x4] ldrb r2, [r5, 0x8] - bl get_npc_id_by_local_id + bl GetFieldObjectIdByLocalIdAndMap lsls r0, 24 lsrs r0, 24 ldr r2, =0x02037350 @@ -629752,7 +630046,7 @@ oamc_shadow: ; 81543E4 lsls r2, 24 lsrs r2, 24 mov r3, sp - bl npc_id_by_local_id_and_map_ret_success + bl TryGetFieldObjectIdByLocalIdAndMap lsls r0, 24 cmp r0, 0 beq @08154412 @@ -629800,12 +630094,12 @@ oamc_shadow: ; 81543E4 cmp r0, 0 bne @08154490 ldrb r0, [r4, 0x1E] - bl is_tile_water_maybe + bl MetatileBehavior_IsSurfableWaterOrUnderwater lsls r0, 24 cmp r0, 0 bne @08154490 ldrb r0, [r4, 0x1F] - bl is_tile_water_maybe + bl MetatileBehavior_IsSurfableWaterOrUnderwater lsls r0, 24 cmp r0, 0 bne @08154490 @@ -629970,12 +630264,12 @@ unc_grass_normal: ; 8154550 adds r1, r4, 0 adds r2, r7, 0 mov r3, sp - bl npc_id_by_local_id_and_map_ret_success + bl TryGetFieldObjectIdByLocalIdAndMap lsls r0, 24 cmp r0, 0 bne @081545F0 adds r0, r6, 0 - bl is_tile_x02_or_xD1 + bl MetatileBehavior_IsTallGrass lsls r0, 24 cmp r0, 0 beq @081545F0 @@ -630211,7 +630505,7 @@ sub_8154758: ; 8154758 orrs r0, r1 strb r0, [r2] ldrb r0, [r5, 0x8] - bl sub_8096DA8 + bl ZCoordToPriority movs r1, 0x3 ands r1, r0 lsls r1, 2 @@ -630309,7 +630603,7 @@ unc_grass_tall: ; 8154800 adds r1, r7, 0 adds r2, r6, 0 mov r3, sp - bl npc_id_by_local_id_and_map_ret_success + bl TryGetFieldObjectIdByLocalIdAndMap lsls r0, 24 cmp r0, 0 bne @081548A0 @@ -630433,7 +630727,7 @@ sub_815496C: ; 815496C ldrb r0, [r6] ldrb r1, [r6, 0x4] ldrb r2, [r6, 0x8] - bl get_npc_id_by_local_id + bl GetFieldObjectIdByLocalIdAndMap lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 @@ -630521,7 +630815,7 @@ sub_8154A10: ; 8154A10 lsls r2, 24 lsrs r2, 24 mov r3, sp - bl npc_id_by_local_id_and_map_ret_success + bl TryGetFieldObjectIdByLocalIdAndMap lsls r0, 24 cmp r0, 0 bne @08154A4E @@ -630874,7 +631168,7 @@ sub_8154CEC: ; 8154CEC ldrb r0, [r6] ldrb r1, [r6, 0x4] ldrb r2, [r6, 0x8] - bl get_npc_id_by_local_id + bl GetFieldObjectIdByLocalIdAndMap lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 @@ -630963,7 +631257,7 @@ sub_8154D90: ; 8154D90 lsls r2, 24 lsrs r2, 24 mov r3, sp - bl npc_id_by_local_id_and_map_ret_success + bl TryGetFieldObjectIdByLocalIdAndMap lsls r0, 24 cmp r0, 0 beq @08154DCA @@ -631127,7 +631421,7 @@ sub_8154EFC: ; 8154EFC ldrb r0, [r7] ldrb r1, [r7, 0x4] ldrb r2, [r7, 0x8] - bl get_npc_id_by_local_id + bl GetFieldObjectIdByLocalIdAndMap lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 @@ -631216,7 +631510,7 @@ sub_8154FB4: ; 8154FB4 lsls r2, 24 lsrs r2, 24 mov r3, sp - bl npc_id_by_local_id_and_map_ret_success + bl TryGetFieldObjectIdByLocalIdAndMap lsls r0, 24 cmp r0, 0 bne @08154FEE @@ -631335,7 +631629,7 @@ sub_81550B4: ; 81550B4 ldrb r0, [r6] ldrb r1, [r6, 0x4] ldrb r2, [r6, 0x8] - bl get_npc_id_by_local_id + bl GetFieldObjectIdByLocalIdAndMap lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 @@ -631421,7 +631715,7 @@ sub_8155158: ; 8155158 lsls r2, 24 lsrs r2, 24 mov r3, sp - bl npc_id_by_local_id_and_map_ret_success + bl TryGetFieldObjectIdByLocalIdAndMap lsls r0, 24 cmp r0, 0 bne @08155192 @@ -632173,12 +632467,12 @@ sub_81556E8: ; 81556E8 adds r0, r5, 0 mov r1, sp adds r2, r7, 0 - bl numbers_move_direction + bl MoveCoords movs r1, 0 ldrsh r0, [r6, r1] movs r2, 0 ldrsh r1, [r7, r2] - bl cur_mapdata_get_upper4bit_at + bl MapGridGetZCoordAt lsls r0, 24 lsrs r0, 24 cmp r0, 0x3 @@ -632412,7 +632706,7 @@ sub_8155900: ; 8155900 ldrb r0, [r7] ldrb r1, [r7, 0x4] ldrb r2, [r7, 0x8] - bl get_npc_id_by_local_id + bl GetFieldObjectIdByLocalIdAndMap lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 @@ -632508,7 +632802,7 @@ sub_81559BC: ; 81559BC lsls r2, 24 lsrs r2, 24 mov r3, sp - bl npc_id_by_local_id_and_map_ret_success + bl TryGetFieldObjectIdByLocalIdAndMap lsls r0, 24 cmp r0, 0 bne @081559F6 @@ -632787,7 +633081,7 @@ ShowDisguiseFieldEffect: ; 8155BD0 ldrb r1, [r5, 0x4] ldrb r2, [r5, 0x8] mov r3, sp - bl npc_id_by_local_id_and_map_ret_success + bl TryGetFieldObjectIdByLocalIdAndMap lsls r0, 24 cmp r0, 0 beq @08155C08 @@ -632876,7 +633170,7 @@ sub_8155C88: ; 8155C88 lsls r2, 24 lsrs r2, 24 mov r3, sp - bl npc_id_by_local_id_and_map_ret_success + bl TryGetFieldObjectIdByLocalIdAndMap lsls r0, 24 cmp r0, 0 beq @08155CB8 @@ -633559,7 +633853,7 @@ sub_8156194: ; 8156194 lsrs r0, 24 adds r1, r4, 0 movs r2, 0 - bl npc_y_height_related + bl SetObjectSubpriorityByZCoord @081561C8: pop {r4} pop {r0} @@ -633601,7 +633895,7 @@ sub_81561FC: ; 81561FC lsls r2, 24 lsrs r2, 24 adds r1, r6, 0 - bl npc_y_height_related + bl SetObjectSubpriorityByZCoord movs r7, 0 @08156212: lsls r0, r7, 3 @@ -641430,7 +641724,7 @@ sub_8159F5C: ; 8159F5C adds r1, r5, 0 adds r2, r4, 0 bl CpuFastSet - bl sub_808BCDC + bl GetPlayerAvatarObjectId ldr r2, =0x02020630 lsls r0, 24 lsrs r0, 24 @@ -641513,7 +641807,7 @@ sub_8159FEC: ; 8159FEC @0815A044: ldr r0, =sub_815A090 str r0, [r4] - bl sub_808BCDC + bl GetPlayerAvatarObjectId ldr r2, =0x02020630 lsls r0, 24 lsrs r0, 24 @@ -677031,7 +677325,7 @@ c2_copyright_1: ; 816CEAC bl sub_815355C lsls r0, 16 lsrs r0, 16 - bl sub_8076BDC + bl InitSaveBlockPointersWithRandomOffset bl sub_808447C bl sub_8152680 movs r0, 0 @@ -683015,7 +683309,7 @@ sub_81700F8: ; 81700F8 bl sub_815355C lsls r0, 16 lsrs r0, 16 - bl sub_8076BDC + bl InitSaveBlockPointersWithRandomOffset bl sub_808447C bl sub_8152680 movs r0, 0 @@ -706188,7 +706482,7 @@ sub_817C91C: ; 817C91C strh r0, [r1, 0x18] strh r2, [r1, 0x1A] movs r0, 0x1 - bl walkrun_set_bike_bits + bl SetPlayerAvatarTransition movs r0, 0 pop {r1} bx r1 @@ -755170,7 +755464,7 @@ sub_81963F0: ; 81963F0 movs r0, 0xFF movs r1, 0 movs r2, 0 - bl get_npc_id_by_local_id + bl GetFieldObjectIdByLocalIdAndMap adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -755179,7 +755473,7 @@ sub_81963F0: ; 81963F0 lsls r0, 2 ldr r1, =0x02037350 adds r0, r1 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished bl sub_80D338C bl sub_809757C bl script_env_2_disable @@ -790697,7 +790991,7 @@ sub_81A895C: ; 81A895C movs r0, 0xFF movs r1, 0 movs r2, 0 - bl get_npc_id_by_local_id + bl GetFieldObjectIdByLocalIdAndMap adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -790706,7 +791000,7 @@ sub_81A895C: ; 81A895C lsls r0, 2 ldr r1, =0x02037350 adds r0, r1 - bl sub_8093284 + bl FieldObjectClearAnimIfSpecialAnimFinished bl sub_80D338C pop {r4} pop {r0} @@ -790839,7 +791133,7 @@ sub_81A89A0: ; 81A89A0 ldr r2, [r6] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] - bl get_npc_id_by_local_id + bl GetFieldObjectIdByLocalIdAndMap lsls r0, 24 lsrs r0, 24 cmp r0, 0x10 @@ -790995,7 +791289,7 @@ sub_81A8AF8: ; 81A8AF8 ldr r2, [r1] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] - bl get_npc_id_by_local_id + bl GetFieldObjectIdByLocalIdAndMap lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x10 @@ -798286,7 +798580,7 @@ sub_81AC644: ; 81AC644 bne @081ACA12 @081AC97A: movs r0, 0x6 - bl walkrun_bitfield_and_r0 + bl TestPlayerAvatarFlags lsls r0, 24 cmp r0, 0 beq @081ACA12 @@ -815247,12 +815541,12 @@ hm_surf_run_dp02scr: ; 81B5804 thumb_func_start sub_81B5820 sub_81B5820: ; 81B5820 push {lr} - bl party_has_pokemon_with_surf + bl PartyHasMonWithSurf lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @081B585C - bl sub_808BE74 + bl IsPlayerFacingSurfableFishableWater lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -815277,7 +815571,7 @@ sub_81B5820: ; 81B5820 sub_81B5864: ; 81B5864 push {lr} movs r0, 0x8 - bl walkrun_bitfield_and_r0 + bl TestPlayerAvatarFlags lsls r0, 24 cmp r0, 0 beq @081B587A @@ -815365,12 +815659,12 @@ hm_prepare_waterfall: ; 81B58F0 bl cur_mapdata_block_get_role_at lsls r0, 24 lsrs r0, 24 - bl is_tile_x13_waterfall + bl MetatileBehavior_IsWaterfall lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @081B594C - bl sub_808BE50 + bl IsPlayerSurfingNorth lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -831109,7 +831403,7 @@ sub_81BE808: ; 81BE808 ldrb r2, [r0, 0x4] movs r0, 0x2D mov r3, sp - bl npc_id_by_local_id_and_map_ret_success + bl TryGetFieldObjectIdByLocalIdAndMap mov r0, sp ldrb r0, [r0] lsls r2, r0, 3 @@ -873559,7 +873853,7 @@ sub_81D4258: ; 81D4258 ldrb r2, [r0, 0x4] movs r0, 0x1 mov r3, sp - bl npc_id_by_local_id_and_map_ret_success + bl TryGetFieldObjectIdByLocalIdAndMap mov r0, sp ldrb r0, [r0] add sp, 0x4 @@ -874478,9 +874772,9 @@ sub_81D4998: ; 81D4998 bx r0 thumb_func_end sub_81D4998 - thumb_func_start is_faraway_island_mew -; BOOL is_faraway_island_mew(struct npc_state *fieldObject) -is_faraway_island_mew: ; 81D49E8 + thumb_func_start FieldObjectIsFarawayIslandMew +; BOOL FieldObjectIsFarawayIslandMew(struct npc_state *fieldObject) +FieldObjectIsFarawayIslandMew: ; 81D49E8 push {lr} adds r2, r0, 0 ldr r0, =0x03005d8c @@ -874500,7 +874794,7 @@ is_faraway_island_mew: ; 81D49E8 @081D4A0E: pop {r1} bx r1 - thumb_func_end is_faraway_island_mew + thumb_func_end FieldObjectIsFarawayIslandMew thumb_func_start unown_chamber_related unown_chamber_related: ; 81D4A14 @@ -883982,8 +884276,8 @@ sub_81D99BC: ; 81D99BC bx r1 thumb_func_end sub_81D99BC - thumb_func_start sub_81D99E4 -sub_81D99E4: ; 81D99E4 + thumb_func_start walda_maybe +walda_maybe: ; 81D99E4 push {r4,lr} sub sp, 0x8 ldr r4, =0x02021dc4 @@ -884005,7 +884299,7 @@ sub_81D99E4: ; 81D99E4 pop {r0} bx r0 .pool - thumb_func_end sub_81D99E4 + thumb_func_end walda_maybe thumb_func_start sub_81D9A1C sub_81D9A1C: ; 81D9A1C diff --git a/asm/gpu_obj.s b/asm/gpu_obj.s index ad39f7db0..eb8ee03ce 100644 --- a/asm/gpu_obj.s +++ b/asm/gpu_obj.s @@ -4031,7 +4031,7 @@ ResetObjectPaletteAllocator: ; 800870C thumb_func_end ResetObjectPaletteAllocator thumb_func_start LoadTaggedObjectPalette -; u8 LoadTaggedObjectPalette(struct ObjectPaletteInfo *palette) +; u8 LoadTaggedObjectPalette(struct TaggedObjectPalette *palette) LoadTaggedObjectPalette: ; 8008744 push {r4,r5,lr} adds r5, r0, 0 @@ -4070,7 +4070,7 @@ LoadTaggedObjectPalette: ; 8008744 thumb_func_end LoadTaggedObjectPalette thumb_func_start LoadTaggedObjectPalettes -; void LoadTaggedObjectPalettes(struct ObjectPaletteInfo *palettes) +; void LoadTaggedObjectPalettes(struct TaggedObjectPalette *palettes) LoadTaggedObjectPalettes: ; 8008790 push {r4,r5,lr} adds r5, r0, 0 diff --git a/data/event_script_command_function_table.s b/data/event_script_command_function_table.s index 48bdace9c..2e5453fa2 100644 --- a/data/event_script_command_function_table.s +++ b/data/event_script_command_function_table.s @@ -220,7 +220,7 @@ gEventScriptCommandFunctionTable: ; 81DB67C .4byte sub_809BBE8 .4byte sub_809BBFC .4byte sub_809AF94 - .4byte s78_braille_msgbox + .4byte sub_809AC3C .4byte sub_8099D20 .4byte sub_809BDD0 .4byte sub_809BE0C