diff --git a/asm/emerald.s b/asm/emerald.s index ed3bb2df0..e794eec35 100644 --- a/asm/emerald.s +++ b/asm/emerald.s @@ -18042,8 +18042,8 @@ sub_80126CC: ; 80126CC bx r1 thumb_func_end sub_80126CC - thumb_func_start sub_801273C -sub_801273C: ; 801273C + thumb_func_start BerryBlenderLinkBecomeLeader +BerryBlenderLinkBecomeLeader: ; 801273C push {lr} ldr r0, =sub_8012780 movs r1, 0 @@ -18067,7 +18067,7 @@ sub_801273C: ; 801273C pop {r0} bx r0 .pool - thumb_func_end sub_801273C + thumb_func_end BerryBlenderLinkBecomeLeader thumb_func_start sub_8012780 sub_8012780: ; 8012780 @@ -19567,8 +19567,8 @@ sub_8013398: ; 8013398 bx r1 thumb_func_end sub_8013398 - thumb_func_start sub_80134A4 -sub_80134A4: ; 80134A4 + thumb_func_start BerryBlenderLinkJoinGroup +BerryBlenderLinkJoinGroup: ; 80134A4 push {lr} ldr r0, =sub_80134E8 movs r1, 0 @@ -19592,7 +19592,7 @@ sub_80134A4: ; 80134A4 pop {r0} bx r0 .pool - thumb_func_end sub_80134A4 + thumb_func_end BerryBlenderLinkJoinGroup thumb_func_start sub_80134E8 sub_80134E8: ; 80134E8 @@ -25084,7 +25084,7 @@ sub_80156E0: ; 80156E0 thumb_func_start var_800D_set_xB var_800D_set_xB: ; 8016884 push {lr} - bl in_trade_center + bl InUnionRoom cmp r0, 0x1 bne @08016894 ldr r1, =0x020375f0 @@ -26060,7 +26060,7 @@ sub_8017020: ; 8017020 bl ExpandStringRefs movs r0, 0 movs r1, 0x1 - bl sub_819735C + bl AddTextPrinterWithCustomSpeedForMessage movs r0, 0 pop {r4} pop {r1} @@ -26104,7 +26104,7 @@ sub_8017064: ; 8017064 adds r1, r5, 0 bl ExpandStringRefs movs r0, 0x1 - bl sub_8197310 + bl AddTextPrinterForMessage_2 ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] @@ -27138,7 +27138,7 @@ sub_80177B8: ; 80177B8 movs r0, 0x1 adds r1, r5, 0 movs r2, 0x88 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 @@ -27213,7 +27213,7 @@ sub_80178A0: ; 80178A0 movs r0, 0x1 adds r1, r4, 0 movs r2, 0x68 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 @@ -27243,7 +27243,7 @@ sub_8017940: ; 8017940 adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + bl GetXYCoordsOneStepInFrontOfPlayer mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] @@ -28085,8 +28085,8 @@ sub_8017FD8: ; 8017FD8 bx r1 thumb_func_end sub_8017FD8 - thumb_func_start in_trade_center -in_trade_center: ; 8018004 + thumb_func_start InUnionRoom +InUnionRoom: ; 8018004 push {lr} movs r2, 0 ldr r0, =0x03005d8c @@ -28101,7 +28101,7 @@ in_trade_center: ; 8018004 pop {r1} bx r1 .pool - thumb_func_end in_trade_center + thumb_func_end InUnionRoom thumb_func_start sub_8018024 sub_8018024: ; 8018024 @@ -28929,11 +28929,11 @@ sub_80186EC: ; 80186EC movs r1, 0x1 movs r2, 0x4 movs r3, 0x1 - bl sub_8199EEC + bl AddTextPrinterParametrized2 movs r0, 0 adds r1, r7, 0 movs r2, 0xDE - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 @@ -28945,7 +28945,7 @@ sub_80186EC: ; 80186EC movs r0, 0 movs r1, 0 movs r3, 0x1 - bl sub_8199EEC + bl AddTextPrinterParametrized2 movs r0, 0 movs r1, 0x2 bl CopyWindowToVram @@ -29117,7 +29117,7 @@ sub_8018884: ; 8018884 movs r1, 0x1 movs r2, 0 movs r3, 0x1 - bl sub_8199EEC + bl AddTextPrinterParametrized2 movs r0, 0x1 movs r1, 0x1 movs r2, 0xF @@ -29470,7 +29470,7 @@ sub_8018B08: ; 8018B08 str r1, [sp, 0x10] movs r1, 0x1 movs r3, 0x1 - bl sub_8199EEC + bl AddTextPrinterParametrized2 ldrb r0, [r4] movs r1, 0x1 movs r2, 0xF @@ -29616,7 +29616,7 @@ sub_8018C4C: ; 8018C4C str r1, [sp, 0x10] movs r1, 0x1 movs r3, 0x1 - bl sub_8199EEC + bl AddTextPrinterParametrized2 ldrb r0, [r5] movs r1, 0x1 movs r2, 0xF @@ -32420,7 +32420,7 @@ sub_801A2A8: ; 801A2A8 adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + bl GetXYCoordsOneStepInFrontOfPlayer movs r0, 0 str r0, [sp, 0xC] ldr r0, =gUnknown_082F0740 @@ -32784,7 +32784,7 @@ sub_801A600: ; 801A600 movs r0, 0x1 adds r1, r4, 0 movs r2, 0xC0 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 @@ -33168,7 +33168,7 @@ sub_801A8B0: ; 801A8B0 adds r0, r7, 0 adds r1, r6, 0 adds r2, r5, 0 - bl sub_8199EEC + bl AddTextPrinterParametrized2 add sp, 0x18 pop {r4-r7} pop {r0} @@ -33489,7 +33489,7 @@ sub_801AB68: ; 801AB68 movs r1, 0x1 adds r2, r6, 0 ldr r3, [sp, 0x14] - bl sub_8199EEC + bl AddTextPrinterParametrized2 add sp, 0x18 pop {r3-r5} mov r8, r3 @@ -46480,7 +46480,7 @@ sub_80214A8: ; 80214A8 lsrs r3, 16 ldr r0, =gUnknown_082F436C adds r1, r2, 0 - bl sub_81AFF34 + bl AddItemIconObjectWithCustomObjectTemplate lsls r0, 24 lsrs r0, 24 mov r2, r9 @@ -46592,7 +46592,7 @@ sub_80214A8: ; 80214A8 bge @080215D0 ldr r0, [r6] movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim @080215D0: mov r0, r9 adds r0, 0x1 @@ -47439,7 +47439,7 @@ sub_8021A28: ; 8021A28 movs r0, 0x2 ldr r1, =0x02021fc4 adds r2, r4, 0 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r2, r0, 0 ldr r3, [sp, 0xC] movs r4, 0xDD @@ -48566,7 +48566,7 @@ sub_8022600: ; 8022600 str r4, [sp, 0x10] movs r1, 0x2 movs r3, 0x1 - bl sub_8199EEC + bl AddTextPrinterParametrized2 b @0802269C .pool @08022668: @@ -48593,7 +48593,7 @@ sub_8022600: ; 8022600 str r4, [sp, 0x10] movs r1, 0x2 movs r3, 0x1 - bl sub_8199EEC + bl AddTextPrinterParametrized2 @0802269C: ldr r1, =0x000001bb adds r0, r6, r1 @@ -49469,7 +49469,7 @@ sub_8022D14: ; 8022D14 movs r0, 0 movs r1, 0x1 adds r2, r4, 0 - bl text_box_related_one + bl AddTextPrinterParametrized b @08022DB2 .pool @08022D90: @@ -49488,7 +49488,7 @@ sub_8022D14: ; 8022D14 str r0, [sp, 0xC] movs r0, 0 movs r1, 0x1 - bl text_box_related_one + bl AddTextPrinterParametrized @08022DB2: movs r0, 0 movs r1, 0x3 @@ -52052,7 +52052,7 @@ sub_8024134: ; 8024134 movs r0, 0 movs r1, 0x1 movs r3, 0 - bl text_box_related_one + bl AddTextPrinterParametrized movs r0, 0 movs r1, 0x3 bl CopyWindowToVram @@ -52411,7 +52411,7 @@ sub_8024444: ; 8024444 str r1, [sp, 0xC] movs r0, 0 movs r1, 0x1 - bl text_box_related_one + bl AddTextPrinterParametrized b @080244AC .pool @08024490: @@ -52427,7 +52427,7 @@ sub_8024444: ; 8024444 str r0, [sp, 0xC] movs r0, 0 movs r1, 0x1 - bl text_box_related_one + bl AddTextPrinterParametrized @080244AC: movs r0, 0 movs r1, 0x3 @@ -59437,7 +59437,7 @@ sub_8027BEC: ; 8027BEC lsls r2, r0, 3 movs r0, 0x1 adds r1, r4, 0 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 @@ -64141,7 +64141,7 @@ sub_802A380: ; 802A380 movs r0, 0 movs r1, 0x1 movs r3, 0 - bl text_box_related_one + bl AddTextPrinterParametrized b @0802A410 .pool @0802A3D8: @@ -72430,7 +72430,7 @@ sub_802E500: ; 802E500 lsls r2, r1, 3 movs r0, 0x1 adds r1, r5, 0 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 @@ -73407,7 +73407,7 @@ sub_802EC98: ; 802EC98 strh r0, [r4, 0x2E] adds r0, r4, 0 movs r1, 0x2 - bl sub_8008258 + bl StartObjectRotScalAnim b @0802EDC4 @0802ED4E: ldrh r0, [r4, 0x22] @@ -73455,7 +73455,7 @@ sub_802EC98: ; 802EC98 adds r0, r4, 0 movs r1, 0x3 @0802EDA2: - bl sub_8008258 + bl StartObjectRotScalAnim @0802EDA6: ldrh r0, [r4, 0x2E] adds r0, 0x1 @@ -82154,10 +82154,10 @@ sub_8036B44: ; 8036B44 .pool @08036BC0: movs r0, 0xAF - bl berryid_from_itemid + bl ItemIdToBerryType lsls r0, 24 lsrs r0, 24 - bl GetRomBerryInfo + bl GetBerryInfo adds r3, r0, 0 movs r2, 0 movs r0, 0xC6 @@ -82291,10 +82291,10 @@ berry_801017C: ; 8036C08 .pool @08036CDC: movs r0, 0xAF - bl berryid_from_itemid + bl ItemIdToBerryType lsls r0, 24 lsrs r0, 24 - bl GetRomBerryInfo + bl GetBerryInfo adds r6, r0, 0 movs r5, 0 ldr r4, =0x02024404 @@ -85736,7 +85736,7 @@ sub_8038B74: ; 8038B74 push {r4,lr} adds r4, r0, 0 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim ldr r0, =sub_8038B04 str r0, [r4, 0x1C] movs r0, 0x68 @@ -92002,7 +92002,7 @@ sub_803BE74: ; 803BE74 ldrb r1, [r1] lsls r2, r4, 24 lsrs r2, 24 - bl move_get_pp_info + bl CalcPPWithPPUps mov r2, r10 adds r1, r2, r4 strb r0, [r1] @@ -96584,7 +96584,7 @@ sub_803EC20: ; 803EC20 ldrb r6, [r0] cmp r6, 0x32 bne @0803ED5C - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 beq @0803ED38 @@ -96677,7 +96677,7 @@ sub_803EC20: ; 803EC20 ands r0, r1 cmp r0, 0 bne @0803EE06 - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 beq @0803EDBC @@ -106704,7 +106704,7 @@ berry_effects_maybe: ; 80444DC lsls r2, r5, 24 lsrs r2, 24 adds r0, r6, 0 - bl move_get_pp_info + bl CalcPPWithPPUps lsls r0, 24 lsrs r2, r0, 24 add r0, sp, 0x4 @@ -126136,7 +126136,7 @@ sub_804F220: ; 804F220 adds r0, r4 ldr r5, =0x02021fc4 adds r1, r5, 0 - bl sub_81B1B44 + bl GetMonNickname str r5, [sp] mov r2, sp movs r1, 0 @@ -126754,7 +126754,7 @@ atk75_8026A58: ; 804F754 movs r3, 0x1 str r3, [sp] movs r3, 0 - bl sub_806BD28 + bl ExecuteTableBasedItemEffect ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 @@ -138342,13 +138342,13 @@ atkE5_pickupitemcalculation: ; 8055C00 mov r5, r8 push {r5-r7} sub sp, 0x4 - bl sub_81A80A8 + bl InBattlePike lsls r0, 24 cmp r0, 0 beq @08055C18 b @08055DD8 @08055C18: - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 beq @08055CC4 @@ -152228,13 +152228,13 @@ sub_805D770: ; 805D770 bne @0805D798 adds r0, r4, 0 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim b @0805D7A0 .pool @0805D798: adds r0, r4, 0 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim @0805D7A0: adds r0, r4, 0 bl AnimateObject @@ -171321,7 +171321,7 @@ create_pokemon: ; 8067BBC bl pokemon_encrypt mov r0, sp ldrh r1, [r0, 0xE] - bl get_pokemon_name + bl GetSpeciesName adds r0, r7, 0 movs r1, 0x2 mov r2, sp @@ -176347,7 +176347,7 @@ pokemon_data_permutator: ; 806A270 thumb_func_end pokemon_data_permutator thumb_func_start pokemon_getattr -; int pokemon_getattr(pokemon *mon, enum pokemon_data_request req) +; int pokemon_getattr(pokemon *mon, enum pokemon_data_request req, void *data) pokemon_getattr: ; 806A518 push {r4,lr} adds r4, r0, 0 @@ -178506,8 +178506,9 @@ sub_806B5C4: ; 806B5C4 .pool thumb_func_end sub_806B5C4 - thumb_func_start sub_806B638 -sub_806B638: ; 806B638 + thumb_func_start CheckPlayerPartySize +; u8 CheckPlayerPartySize() +CheckPlayerPartySize: ; 806B638 push {r4-r6,lr} movs r6, 0 movs r5, 0 @@ -178553,7 +178554,7 @@ sub_806B638: ; 806B638 pop {r4-r6} pop {r1} bx r1 - thumb_func_end sub_806B638 + thumb_func_end CheckPlayerPartySize thumb_func_start sub_806B694 ; int sub_806B694(u16 a1, int a2) @@ -178876,9 +178877,9 @@ sub_806B8E4: ; 806B8E4 bx r1 thumb_func_end sub_806B8E4 - thumb_func_start get_pokemon_name -; void get_pokemon_name(char *dest, u16 species_num) -get_pokemon_name: ; 806B914 + thumb_func_start GetSpeciesName +; void GetSpeciesName(u8 *dest, u16 speciesId) +GetSpeciesName: ; 806B914 push {r4-r7,lr} adds r6, r0, 0 lsls r1, 16 @@ -178920,10 +178921,11 @@ get_pokemon_name: ; 806B914 pop {r4-r7} pop {r0} bx r0 - thumb_func_end get_pokemon_name + thumb_func_end GetSpeciesName - thumb_func_start move_get_pp_info -move_get_pp_info: ; 806B960 + thumb_func_start CalcPPWithPPUps +; u16 CalcPPWithPPUps(u16 moveId, s32 ppUpCounts, u8 monMoveIndex) +CalcPPWithPPUps: ; 806B960 push {r4,lr} lsls r0, 16 lsrs r0, 16 @@ -178955,7 +178957,7 @@ move_get_pp_info: ; 806B960 pop {r1} bx r1 .pool - thumb_func_end move_get_pp_info + thumb_func_end CalcPPWithPPUps thumb_func_start sub_806B9A8 sub_806B9A8: ; 806B9A8 @@ -179351,8 +179353,9 @@ battle_data_fill: ; 806B9FC .pool thumb_func_end battle_data_fill - thumb_func_start sub_806BD04 -sub_806BD04: ; 806BD04 + thumb_func_start ExecuteTableBasedItemEffect_ +; BOOL ExecuteTableBasedItemEffect_(struct pokemon *mon, u16 itemId, u8 a3, u8 monMoveIndex) +ExecuteTableBasedItemEffect_: ; 806BD04 push {r4,lr} sub sp, 0x4 lsls r1, 16 @@ -179363,17 +179366,18 @@ sub_806BD04: ; 806BD04 lsrs r3, 24 movs r4, 0 str r4, [sp] - bl sub_806BD28 + bl ExecuteTableBasedItemEffect lsls r0, 24 lsrs r0, 24 add sp, 0x4 pop {r4} pop {r1} bx r1 - thumb_func_end sub_806BD04 + thumb_func_end ExecuteTableBasedItemEffect_ - thumb_func_start sub_806BD28 -sub_806BD28: ; 806BD28 + thumb_func_start ExecuteTableBasedItemEffect +; BOOL ExecuteTableBasedItemEffect(struct pokemon *mon, u16 itemId, u8 a3, u8 monMoveIndex, u8 a5) +ExecuteTableBasedItemEffect: ; 806BD28 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -179928,7 +179932,7 @@ sub_806BD28: ; 806BD28 ldr r1, [sp, 0x10] movs r2, 0x7 ldr r3, [sp, 0x38] - bl pokemon_clear_ailments + bl HealStatusConditions lsls r0, 24 cmp r0, 0 bne @0806C206 @@ -179959,7 +179963,7 @@ sub_806BD28: ; 806BD28 mov r0, r8 ldr r1, [sp, 0x10] ldr r3, [sp, 0x38] - bl pokemon_clear_ailments + bl HealStatusConditions lsls r0, 24 cmp r0, 0 bne @0806C226 @@ -179975,7 +179979,7 @@ sub_806BD28: ; 806BD28 ldr r1, [sp, 0x10] movs r2, 0x10 ldr r3, [sp, 0x38] - bl pokemon_clear_ailments + bl HealStatusConditions lsls r0, 24 cmp r0, 0 bne @0806C246 @@ -179991,7 +179995,7 @@ sub_806BD28: ; 806BD28 ldr r1, [sp, 0x10] movs r2, 0x20 ldr r3, [sp, 0x38] - bl pokemon_clear_ailments + bl HealStatusConditions lsls r0, 24 cmp r0, 0 bne @0806C266 @@ -180007,7 +180011,7 @@ sub_806BD28: ; 806BD28 ldr r1, [sp, 0x10] movs r2, 0x40 ldr r3, [sp, 0x38] - bl pokemon_clear_ailments + bl HealStatusConditions lsls r0, 24 cmp r0, 0 bne @0806C286 @@ -180101,7 +180105,7 @@ sub_806BD28: ; 806BD28 lsrs r1, 24 adds r0, r4, 0 ldr r2, [sp, 0x14] - bl move_get_pp_info + bl CalcPPWithPPUps lsls r0, 24 lsrs r0, 24 str r0, [sp, 0x2C] @@ -180135,7 +180139,7 @@ sub_806BD28: ; 806BD28 lsls r1, 24 lsrs r1, 24 ldr r2, [sp, 0x14] - bl move_get_pp_info + bl CalcPPWithPPUps lsls r0, 24 lsrs r0, 24 ldr r3, [sp, 0x2C] @@ -180560,7 +180564,7 @@ sub_806BD28: ; 806BD28 lsrs r6, r0, 24 adds r0, r4, 0 adds r2, r6, 0 - bl move_get_pp_info + bl CalcPPWithPPUps lsls r0, 24 lsrs r0, 24 ldr r1, [sp] @@ -180588,7 +180592,7 @@ sub_806BD28: ; 806BD28 lsrs r1, 24 adds r0, r4, 0 adds r2, r6, 0 - bl move_get_pp_info + bl CalcPPWithPPUps lsls r0, 24 lsrs r0, 24 ldr r1, [sp] @@ -180610,7 +180614,7 @@ sub_806BD28: ; 806BD28 lsrs r1, 24 adds r0, r4, 0 adds r2, r6, 0 - bl move_get_pp_info + bl CalcPPWithPPUps lsls r0, 24 lsrs r0, 24 str r0, [sp] @@ -180705,7 +180709,7 @@ sub_806BD28: ; 806BD28 lsrs r1, 24 adds r0, r4, 0 ldr r2, [sp, 0x14] - bl move_get_pp_info + bl CalcPPWithPPUps lsls r0, 24 lsrs r0, 24 ldr r2, [sp] @@ -180739,7 +180743,7 @@ sub_806BD28: ; 806BD28 lsrs r1, 24 adds r0, r4, 0 ldr r2, [sp, 0x14] - bl move_get_pp_info + bl CalcPPWithPPUps lsls r0, 24 lsrs r0, 24 ldr r1, [sp] @@ -180761,7 +180765,7 @@ sub_806BD28: ; 806BD28 lsrs r1, 24 adds r0, r4, 0 ldr r2, [sp, 0x14] - bl move_get_pp_info + bl CalcPPWithPPUps lsls r0, 24 lsrs r0, 24 str r0, [sp] @@ -180995,7 +180999,7 @@ sub_806BD28: ; 806BD28 lsrs r1, 24 adds r0, r4, 0 ldr r2, [sp, 0x14] - bl move_get_pp_info + bl CalcPPWithPPUps lsls r0, 24 lsrs r5, r0, 24 ldr r0, [sp] @@ -181040,7 +181044,7 @@ sub_806BD28: ; 806BD28 lsls r1, 24 lsrs r1, 24 ldr r2, [sp, 0x14] - bl move_get_pp_info + bl CalcPPWithPPUps lsls r0, 24 lsrs r0, 24 subs r0, r5 @@ -181304,10 +181308,11 @@ sub_806BD28: ; 806BD28 pop {r4-r7} pop {r1} bx r1 - thumb_func_end sub_806BD28 + thumb_func_end ExecuteTableBasedItemEffect - thumb_func_start pokemon_clear_ailments -pokemon_clear_ailments: ; 806CD6C + thumb_func_start HealStatusConditions +; BOOL HealStatusConditions(struct pokemon *a1, int a2, u32 healMask, u8 a4) +HealStatusConditions: ; 806CD6C push {r4-r6,lr} sub sp, 0x4 adds r5, r0, 0 @@ -181358,7 +181363,7 @@ pokemon_clear_ailments: ; 806CD6C pop {r4-r6} pop {r1} bx r1 - thumb_func_end pokemon_clear_ailments + thumb_func_end HealStatusConditions thumb_func_start sub_806CDDC sub_806CDDC: ; 806CDDC @@ -182761,13 +182766,14 @@ sub_806D864: ; 806D864 bx r1 thumb_func_end sub_806D864 - thumb_func_start read_trainer_data_byte2 -read_trainer_data_byte2: ; 806D888 + thumb_func_start GetTrainerEncounterMusicId +; u8 GetTrainerEncounterMusicId(u16 trainerOpponentId) +GetTrainerEncounterMusicId: ; 806D888 push {r4,r5,lr} lsls r0, 16 lsrs r4, r0, 16 adds r5, r4, 0 - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 beq @0806D8A2 @@ -182799,7 +182805,7 @@ read_trainer_data_byte2: ; 806D888 pop {r4,r5} pop {r1} bx r1 - thumb_func_end read_trainer_data_byte2 + thumb_func_end GetTrainerEncounterMusicId thumb_func_start nature_stat_mod nature_stat_mod: ; 806D8D4 @@ -184915,7 +184921,7 @@ pokemon_restore_pp: ; 806E930 lsls r2, r6, 24 lsrs r2, 24 adds r0, r4, 0 - bl move_get_pp_info + bl CalcPPWithPPUps mov r1, sp strb r0, [r1] adds r1, r6, 0 @@ -185883,11 +185889,11 @@ sub_806F104: ; 806F104 ands r0, r1 cmp r0, 0 bne @0806F158 - bl sub_81A80A8 + bl InBattlePike lsls r0, 24 cmp r0, 0 bne @0806F144 - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 beq @0806F158 @@ -190099,7 +190105,7 @@ sub_8071148: ; 8071148 movs r0, 0x1 mov r1, sp movs r2, 0x70 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r2, r0, 0 adds r0, r5, 0 mov r1, sp @@ -190494,7 +190500,7 @@ sub_80714B8: ; 80714B8 lsrs r4, 16 mov r0, sp adds r1, r4, 0 - bl get_pokemon_name + bl GetSpeciesName adds r0, r5, 0 movs r1, 0x2 mov r2, sp @@ -191758,7 +191764,7 @@ sub_8072048: ; 8072048 lsls r0, 2 adds r0, r4 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim @08072084: movs r2, 0x2E ldrsh r0, [r5, r2] @@ -192009,7 +192015,7 @@ sub_8072214: ; 8072214 movs r1, 0x1 adds r2, r6, 0 mov r3, r8 - bl sub_8199EEC + bl AddTextPrinterParametrized2 add sp, 0x14 pop {r3,r4} mov r8, r3 @@ -196511,7 +196517,7 @@ sub_80747D8: ; 80747D8 movs r0, 0 add r1, sp, 0x4 movs r2, 0x2F - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r1, r0, 0 add r0, sp, 0x14 str r0, [sp] @@ -197671,7 +197677,7 @@ write_to_rbox: ; 8075094 movs r1, 0 mov r2, r8 mov r3, r9 - bl sub_8199EEC + bl AddTextPrinterParametrized2 str r4, [r7] adds r0, r6, 0 movs r1, 0x7 @@ -198384,7 +198390,7 @@ sub_80756E0: ; 80756E0 ldr r4, =0x02020630 adds r0, r4 movs r1, 0x2 - bl sub_8008258 + bl StartObjectRotScalAnim movs r1, 0x3A ldrsh r0, [r6, r1] adds r0, r5 @@ -198676,7 +198682,7 @@ sub_8075930: ; 8075930 strb r0, [r2] adds r0, r4, 0 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim ldr r0, =sub_8075970 str r0, [r4, 0x1C] movs r0, 0x17 @@ -198833,20 +198839,20 @@ sub_8075970: ; 8075970 strh r0, [r4, 0x34] adds r0, r4, 0 movs r1, 0x3 - bl sub_8008258 + bl StartObjectRotScalAnim movs r1, 0x36 ldrsh r0, [r4, r1] cmp r0, 0 bge @08075AA8 adds r0, r4, 0 movs r1, 0x2 - bl sub_8008258 + bl StartObjectRotScalAnim b @08075AB0 .pool @08075AA8: adds r0, r4, 0 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim @08075AB0: movs r0, 0x17 bl audio_play @@ -199343,7 +199349,7 @@ sub_8075D14: ; 8075D14 ldr r5, =0x02020630 adds r0, r5 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim ldrh r0, [r6, 0x3A] lsls r0, 24 lsrs r0, 24 @@ -199479,7 +199485,7 @@ sub_8075FD4: ; 8075FD4 bge @08076040 adds r0, r1, 0 movs r1, 0 - bl sub_8008258 + bl StartObjectRotScalAnim movs r7, 0x1 b @0807605C .pool @@ -199735,7 +199741,7 @@ sub_8076204: ; 8076204 strh r7, [r5, 0x32] adds r0, r5, 0 movs r1, 0x4 - bl sub_8008258 + bl StartObjectRotScalAnim @08076266: ldrh r4, [r5, 0x2E] adds r0, r5, 0 @@ -199857,7 +199863,7 @@ sub_8076204: ; 8076204 str r0, [r5, 0x1C] adds r0, r5, 0 movs r1, 0 - bl sub_8008258 + bl StartObjectRotScalAnim @08076364: pop {r3} mov r8, r3 @@ -200155,7 +200161,7 @@ sub_8076524: ; 8076524 strb r0, [r2] adds r0, r4, 0 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim adds r0, r4, 0 bl AnimateObject movs r0, 0x80 @@ -200216,7 +200222,7 @@ sub_80765E0: ; 80765E0 bge @08076634 adds r0, r5, 0 movs r1, 0 - bl sub_8008258 + bl StartObjectRotScalAnim movs r1, 0x1 mov r12, r1 @08076634: @@ -200486,7 +200492,7 @@ sub_80767D4: ; 80767D4 adds r4, r0 adds r0, r4, 0 movs r1, 0x2 - bl sub_8008258 + bl StartObjectRotScalAnim adds r0, r4, 0 bl AnimateObject strh r5, [r4, 0x30] @@ -202432,7 +202438,7 @@ sub_80773D0: ; 80773D0 ldr r1, [r0] movs r0, 0x1 movs r2, 0x78 - bl sub_81DB35C + bl GetStringCenterAlignXOffset movs r6, 0 add r5, sp, 0x10 adds r4, r0, 0 @@ -202469,7 +202475,7 @@ sub_80773D0: ; 80773D0 adds r1, r0 movs r0, 0x1 movs r2, 0x78 - bl sub_81DB35C + bl GetStringCenterAlignXOffset movs r6, 0 add r5, sp, 0x10 adds r4, r0, 0 @@ -203056,7 +203062,7 @@ sub_8077B74: ; 8077B74 ldr r1, [r0] movs r0, 0x1 movs r2, 0x78 - bl sub_81DB35C + bl GetStringCenterAlignXOffset movs r6, 0 add r5, sp, 0xC adds r4, r0, 0 @@ -203093,7 +203099,7 @@ sub_8077B74: ; 8077B74 adds r1, r0 movs r0, 0x1 movs r2, 0x78 - bl sub_81DB35C + bl GetStringCenterAlignXOffset movs r6, 0 add r5, sp, 0xC adds r4, r0, 0 @@ -206222,7 +206228,7 @@ sub_80796B4: ; 80796B4 movs r1, 0x1 movs r2, 0 movs r3, 0 - bl sub_8199EEC + bl AddTextPrinterParametrized2 adds r0, r5, 0 bl PutWindowTilemap adds r0, r5, 0 @@ -206449,7 +206455,7 @@ sub_8079B84: ; 8079B84 movs r0, 0 adds r1, r5, 0 movs r2, 0x40 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 @@ -211247,7 +211253,7 @@ sub_807BBEC: ; 807BBEC lsls r0, 2 adds r0, r4 movs r1, 0 - bl sub_8008258 + bl StartObjectRotScalAnim b @0807C6FA .pool @0807C6E4: @@ -211260,7 +211266,7 @@ sub_807BBEC: ; 807BBEC ldr r1, =0x02020630 adds r0, r1 movs r1, 0 - bl sub_8008258 + bl StartObjectRotScalAnim @0807C6FA: ldr r5, =0x020322a0 ldr r0, [r5] @@ -211272,7 +211278,7 @@ sub_807BBEC: ; 807BBEC ldr r4, =0x02020630 adds r0, r4 movs r1, 0 - bl sub_8008258 + bl StartObjectRotScalAnim ldr r2, [r5] adds r3, r2, 0 adds r3, 0x8E @@ -211913,7 +211919,7 @@ sub_807BBEC: ; 807BBEC lsls r0, 2 adds r0, r4 movs r1, 0x2 - bl sub_8008258 + bl StartObjectRotScalAnim ldr r0, [r5] adds r0, 0xD3 ldrb r1, [r0] @@ -213321,7 +213327,7 @@ sub_807CFC8: ; 807CFC8 lsls r0, 2 adds r0, r4 movs r1, 0 - bl sub_8008258 + bl StartObjectRotScalAnim b @0807DB02 .pool @0807DAEC: @@ -213334,7 +213340,7 @@ sub_807CFC8: ; 807CFC8 ldr r1, =0x02020630 adds r0, r1 movs r1, 0 - bl sub_8008258 + bl StartObjectRotScalAnim @0807DB02: ldr r5, =0x020322a0 ldr r0, [r5] @@ -213346,7 +213352,7 @@ sub_807CFC8: ; 807CFC8 ldr r4, =0x02020630 adds r0, r4 movs r1, 0 - bl sub_8008258 + bl StartObjectRotScalAnim ldr r2, [r5] adds r3, r2, 0 adds r3, 0x8E @@ -214018,7 +214024,7 @@ sub_807CFC8: ; 807CFC8 lsls r0, 2 adds r0, r4 movs r1, 0x2 - bl sub_8008258 + bl StartObjectRotScalAnim ldr r0, [r5] adds r0, 0xD3 ldrb r1, [r0] @@ -214677,7 +214683,7 @@ sub_807E64C: ; 807E64C bne @0807E660 adds r0, r4, 0 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim @0807E660: ldrh r0, [r4, 0x30] adds r0, 0x1 @@ -215440,7 +215446,7 @@ sub_807EB50: ; 807EB50 b @0807F03A .pool @0807EDC0: - bl in_trade_center + bl InUnionRoom cmp r0, 0 bne @0807EDCE movs r0, 0x15 @@ -215909,7 +215915,7 @@ sub_807F1A8: ; 807F1A8 movs r1, 0x1 movs r2, 0 movs r3, 0x2 - bl sub_8199EEC + bl AddTextPrinterParametrized2 adds r0, r5, 0 movs r1, 0x3 bl CopyWindowToVram @@ -217275,7 +217281,7 @@ sub_807FE14: ; 807FE14 adds r0, 0x7C lsls r0, 24 lsrs r0, 24 - bl GetRomBerryInfo + bl GetBerryInfo adds r4, r0, 0 strh r5, [r6] adds r0, r6, 0x2 @@ -218451,7 +218457,7 @@ sub_80807BC: ; 80807BC movs r0, 0x1 add r1, sp, 0x8 movs r2, 0x38 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r2, r0, 0 ldr r0, [r7] adds r0, 0x8E @@ -221696,7 +221702,7 @@ sub_8081FC8: ; 8081FC8 cmp r5, 0 bne @0808241C movs r0, 0x4 - bl sub_80D66EC + bl IsBagPocketNonEmpty lsls r0, 24 cmp r0, 0 bne @080823EC @@ -223789,7 +223795,7 @@ berry_blender_related: ; 8083450 movs r0, 0x1 adds r1, r4, 0 movs r2, 0xA8 - bl sub_81DB35C + bl GetStringCenterAlignXOffset lsls r2, r0, 24 lsrs r2, 24 movs r0, 0xFF @@ -223960,7 +223966,7 @@ berry_blender_related: ; 8083450 adds r1, 0x9F movs r0, 0x1 movs r2, 0xA8 - bl sub_81DB368 + bl GetStringRightAlignXOffset ldr r1, [r6] adds r1, 0x9F lsls r2, r0, 24 @@ -224022,7 +224028,7 @@ berry_blender_related: ; 8083450 adds r1, 0x9F movs r0, 0x1 movs r2, 0xA8 - bl sub_81DB368 + bl GetStringRightAlignXOffset ldr r1, [r6] adds r1, 0x9F lsls r2, r0, 24 @@ -224554,7 +224560,7 @@ sub_8083B08: ; 8083B08 movs r0, 0x1 adds r1, r4, 0 movs r2, 0xA8 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 @@ -224863,7 +224869,7 @@ ShowBerryBlenderRecordWindow: ; 8083E24 movs r0, 0x1 adds r1, r6, 0 movs r2, 0x90 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r3, r0, 0 ldrb r0, [r5] lsls r3, 24 @@ -224921,7 +224927,7 @@ ShowBerryBlenderRecordWindow: ; 8083E24 movs r0, 0x1 add r1, sp, 0xC movs r2, 0x8C - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r3, r0, 0 ldr r4, =0x0203ab74 ldrb r0, [r4] @@ -225229,7 +225235,7 @@ sub_80840D4: ; 80840D4 movs r1, 0x1 mov r2, r8 adds r3, r7, 0 - bl sub_8199EEC + bl AddTextPrinterParametrized2 add sp, 0x18 pop {r3,r4} mov r8, r3 @@ -225651,8 +225657,9 @@ sub_808447C: ; 808447C .pool thumb_func_end sub_808447C - thumb_func_start new_game_init_data -new_game_init_data: ; 80844A0 + thumb_func_start NewGameInitData +; void NewGameInitData() +NewGameInitData: ; 80844A0 push {r4,r5,lr} ldr r0, =0x03006210 ldrh r0, [r0] @@ -225689,7 +225696,7 @@ new_game_init_data: ; 80844A0 bl sub_80EBEE0 bl sub_80EC21C bl sub_80E8B28 - bl sub_80E1794 + bl RemoveAllBerryTrees ldr r4, =0x03005d8c ldr r0, [r4] movs r1, 0x92 @@ -225698,7 +225705,7 @@ new_game_init_data: ; 80844A0 ldr r1, =0x00000bb8 bl encrypt_money movs r0, 0 - bl sub_8145C58 + bl SetCoins bl sub_80D766C bl sub_80847A8 bl sub_80843C0 @@ -225741,7 +225748,7 @@ new_game_init_data: ; 80844A0 pop {r0} bx r0 .pool - thumb_func_end new_game_init_data + thumb_func_end NewGameInitData thumb_func_start sub_80845CC sub_80845CC: ; 80845CC @@ -225827,8 +225834,8 @@ flag_var_implications_of_teleport_: ; 8084660 .pool thumb_func_end flag_var_implications_of_teleport_ - thumb_func_start new_game -new_game: ; 808469C + thumb_func_start sub_808469C +sub_808469C: ; 808469C push {lr} bl player_avatar_init_params_reset ldr r0, =0x0000088b @@ -225846,7 +225853,7 @@ new_game: ; 808469C pop {r0} bx r0 .pool - thumb_func_end new_game + thumb_func_end sub_808469C thumb_func_start flagmods_08054D70 flagmods_08054D70: ; 80846E4 @@ -226040,8 +226047,9 @@ sub_8084864: ; 8084864 .pool thumb_func_end sub_8084864 - thumb_func_start copy_rom_field_objects_to_saveblock1 -copy_rom_field_objects_to_saveblock1: ; 8084894 + thumb_func_start CopyFieldObjectTemplatesToSav1 +; void CopyFieldObjectTemplatesToSav1() +CopyFieldObjectTemplatesToSav1: ; 8084894 push {r4,r5,lr} sub sp, 0x4 movs r0, 0 @@ -226072,10 +226080,11 @@ copy_rom_field_objects_to_saveblock1: ; 8084894 pop {r0} bx r0 .pool - thumb_func_end copy_rom_field_objects_to_saveblock1 + thumb_func_end CopyFieldObjectTemplatesToSav1 - thumb_func_start copy_rom_field_object_coords_to_saveblock1 -copy_rom_field_object_coords_to_saveblock1: ; 80848E0 + thumb_func_start CopyFieldObjectTemplateCoordsToSav1 +; void CopyFieldObjectTemplateCoordsToSav1() +CopyFieldObjectTemplateCoordsToSav1: ; 80848E0 push {lr} ldr r0, =0x02037318 ldr r1, [r0, 0x4] @@ -226097,7 +226106,7 @@ copy_rom_field_object_coords_to_saveblock1: ; 80848E0 pop {r0} bx r0 .pool - thumb_func_end copy_rom_field_object_coords_to_saveblock1 + thumb_func_end CopyFieldObjectTemplateCoordsToSav1 thumb_func_start update_saveblock1_field_object_coords update_saveblock1_field_object_coords: ; 8084910 @@ -226173,7 +226182,7 @@ mapdata_load_assets_to_gpu_and_full_redraw: ; 8084980 bl copy_map_tileset1_tileset2_to_vram ldr r0, [r4] bl apply_map_tileset1_tileset2_palette - bl cur_mapdata_full_redraw + bl DrawWholeMapView bl cur_mapheader_run_tileset_funcs_after_some_cpuset pop {r4} pop {r0} @@ -227149,7 +227158,7 @@ mliX_load_map: ; 8085098 @080850C8: bl warp_shift bl set_current_map_header_from_sav1_save_old_name - bl copy_rom_field_objects_to_saveblock1 + bl CopyFieldObjectTemplatesToSav1 bl sav2_set_x9_depending_on_sav1_map bl sub_809D344 bl wild_pokemon_reroll @@ -227163,7 +227172,7 @@ mliX_load_map: ; 8085098 bl update_sav1_flash_used_on_map bl sav1_reset_battle_music_maybe bl mapheader_run_script_with_tag_x3 - bl sub_8087D54 + bl not_trainer_hill_battle_pyramid ldr r0, [r4] bl copy_map_tileset2_to_vram_2 ldr r0, [r4] @@ -227191,7 +227200,7 @@ mliX_load_map: ; 8085098 cmp r0, r1 beq @08085150 @0808514C: - bl sub_80D47E4 + bl AddMapNamePopUpWindowTask @08085150: add sp, 0x4 pop {r4-r6} @@ -227220,13 +227229,13 @@ mli0_load_map: ; 8085160 b @080851A2 .pool @08085190: - bl sub_81D6074 + bl InTrainerHill cmp r0, 0 beq @0808519E bl sub_81D5DF8 b @080851A2 @0808519E: - bl copy_rom_field_objects_to_saveblock1 + bl CopyFieldObjectTemplatesToSav1 @080851A2: ldr r4, =0x02037318 ldrb r0, [r4, 0x17] @@ -227275,17 +227284,17 @@ mli0_load_map: ; 8085160 cmp r1, r0 bne @08085234 movs r0, 0 - bl sub_8087DAC + bl battle_pyramid_map_load_related b @08085246 .pool @08085234: - bl sub_81D6074 + bl InTrainerHill cmp r0, 0 beq @08085242 - bl sub_8087DE4 + bl trainer_hill_map_load_related b @08085246 @08085242: - bl sub_8087D54 + bl not_trainer_hill_battle_pyramid @08085246: cmp r7, 0x1 beq @0808525E @@ -227566,7 +227575,7 @@ cur_mapdata_block_role_at_screen_center_acc_to_sav1: ; 8085450 movs r2, 0x2 ldrsh r1, [r1, r2] adds r1, 0x7 - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 16 lsrs r0, 16 pop {r1} @@ -228274,7 +228283,7 @@ sub_80859BC: ; 80859BC ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r4, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 bl MetatileBehavior_IsSurfableWaterOrUnderwater @@ -228744,13 +228753,13 @@ overworld_free_bg_tilemaps: ; 8085D34 .pool thumb_func_end overworld_free_bg_tilemaps - thumb_func_start flag_clear_is_in_safari_zone_ -flag_clear_is_in_safari_zone_: ; 8085D80 + thumb_func_start ResetSafariZoneFlag_ +ResetSafariZoneFlag_: ; 8085D80 push {lr} - bl flag_clear_is_in_safari_zone + bl ResetSafariZoneFlag pop {r0} bx r0 - thumb_func_end flag_clear_is_in_safari_zone_ + thumb_func_end ResetSafariZoneFlag_ thumb_func_start is_c1_link_related_active ; _BOOL4 is_c1_link_related_active() @@ -228799,7 +228808,7 @@ c1_overworld_normal: ; 8085DAC cmp r0, 0x1 bne @08085DF0 bl script_env_2_enable - bl call_203AE8C + bl HideMapNamePopUpWindow b @08085DFA @08085DF0: ldrb r0, [r6, 0x2] @@ -228831,13 +228840,14 @@ c1_overworld: ; 8085E04 thumb_func_end c1_overworld thumb_func_start c2_overworld_basic +; void c2_overworld_basic() c2_overworld_basic: ; 8085E24 push {lr} bl script_env_2_run_current_script bl run_active_tasks bl CallObjectCallbacks - bl camera_update - bl sub_808A314 + bl CameraUpdate + bl UpdateCameraPanning bl PrepareSpritesForOamLoad bl fade_and_return_progress_probably bl sub_80A0A38 @@ -228869,7 +228879,7 @@ c2_overworld: ; 8085E5C bl c2_overworld_basic cmp r4, 0 beq @08085E7C - bl set_vblank_callback_8086390 + bl SetFieldVBlankCallback @08085E7C: pop {r4} pop {r0} @@ -228937,13 +228947,13 @@ map_post_load_hook_exec: ; 8085EA0 .pool thumb_func_end map_post_load_hook_exec - thumb_func_start c2_new_game -c2_new_game: ; 8085EF8 + thumb_func_start CB2_NewGame +CB2_NewGame: ; 8085EF8 push {lr} bl sub_808631C bl sub_80A2F30 - bl flag_clear_is_in_safari_zone_ - bl new_game_init_data + bl ResetSafariZoneFlag_ + bl NewGameInitData bl player_avatar_init_params_reset bl set_max_playtime_if_appropriate bl script_env_1_init @@ -228956,7 +228966,7 @@ c2_new_game: ; 8085EF8 str r0, [r1] ldr r0, =0x030026f8 bl do_load_map_stuff_loop - bl set_vblank_callback_8086390 + bl SetFieldVBlankCallback ldr r0, =c1_overworld bl set_callback1 ldr r0, =c2_overworld @@ -228964,7 +228974,7 @@ c2_new_game: ; 8085EF8 pop {r0} bx r0 .pool - thumb_func_end c2_new_game + thumb_func_end CB2_NewGame thumb_func_start c2_whiteout c2_whiteout: ; 8085F58 @@ -228983,7 +228993,7 @@ c2_whiteout: ; 8085F58 bls @08085FB0 bl sub_808631C bl sub_80A2F30 - bl flag_clear_is_in_safari_zone_ + bl ResetSafariZoneFlag_ bl sub_8084620 bl player_avatar_init_params_reset bl script_env_1_init @@ -228996,7 +229006,7 @@ c2_whiteout: ; 8085F58 strb r0, [r1] mov r0, sp bl do_load_map_stuff_loop - bl set_vblank_callback_8086390 + bl SetFieldVBlankCallback ldr r0, =c1_overworld bl set_callback1 ldr r0, =c2_overworld @@ -229031,7 +229041,7 @@ c2_load_new_map_2: ; 8085FFC push {lr} ldr r0, =0x030026f8 bl do_load_map_stuff_loop - bl set_vblank_callback_8086390 + bl SetFieldVBlankCallback ldr r0, =c1_overworld bl set_callback1 ldr r0, =c2_overworld @@ -229062,7 +229072,7 @@ sub_8086024: ; 8086024 bl load_map_stuff cmp r0, 0 beq @08086062 - bl set_vblank_callback_8086390 + bl SetFieldVBlankCallback ldr r0, =c1_overworld bl set_callback1 ldr r0, =c2_overworld @@ -229095,7 +229105,7 @@ c2_80567AC: ; 8086098 bl map_loading_iteration_3 cmp r0, 0 beq @080860B8 - bl set_vblank_callback_8086390 + bl SetFieldVBlankCallback ldr r0, =c1_link_related bl set_callback1 bl sub_8086C2C @@ -229134,7 +229144,7 @@ c2_exit_to_overworld_2_local: ; 80860F4 bl sub_8086638 cmp r0, 0 beq @0808610A - bl set_vblank_callback_8086390 + bl SetFieldVBlankCallback ldr r0, =c2_overworld bl SetMainCallback2 @0808610A: @@ -229256,7 +229266,7 @@ sub_8086204: ; 8086204 lsrs r0, 24 cmp r0, 0x1 bne @08086222 - bl sub_80D47E4 + bl AddMapNamePopUpWindowTask @08086222: bl sub_80AF3C8 pop {r0} @@ -229269,7 +229279,7 @@ sub_8086230: ; 8086230 push {r4,lr} bl sub_808631C bl sub_80A2F30 - bl flag_clear_is_in_safari_zone_ + bl ResetSafariZoneFlag_ ldr r0, =0x03006210 ldrh r0, [r0] cmp r0, 0xFF @@ -229278,7 +229288,7 @@ sub_8086230: ; 8086230 @0808624A: bl set_current_map_header_from_sav1 bl set_warp2_warp3_to_neg_1 - bl sub_81D609C + bl GetCurrentTrainerHillMapId lsls r0, 24 lsrs r4, r0, 24 ldr r0, =0x02037318 @@ -229297,7 +229307,7 @@ sub_8086230: ; 8086230 bl sub_81D5F48 b @0808628A @08086286: - bl copy_rom_field_object_coords_to_saveblock1 + bl CopyFieldObjectTemplateCoordsToSav1 @0808628A: bl sub_809757C bl sub_809E7B0 @@ -229308,13 +229318,13 @@ sub_8086230: ; 8086230 cmp r1, r0 bne @080862B0 movs r0, 0x1 - bl sub_8087DAC + bl battle_pyramid_map_load_related b @080862BE .pool @080862B0: cmp r4, 0 beq @080862BA - bl sub_8087DE4 + bl trainer_hill_map_load_related b @080862BE @080862BA: bl sub_8087D74 @@ -229395,28 +229405,29 @@ sub_808631C: ; 808631C .pool thumb_func_end sub_808631C - thumb_func_start set_vblank_callback_8086390 -set_vblank_callback_8086390: ; 8086380 + thumb_func_start SetFieldVBlankCallback +; void SetFieldVBlankCallback() +SetFieldVBlankCallback: ; 8086380 push {lr} - ldr r0, =vblank_cb_8086390 + ldr r0, =VBlankCB_Field bl SetVBlankCallback pop {r0} bx r0 .pool - thumb_func_end set_vblank_callback_8086390 + thumb_func_end SetFieldVBlankCallback - thumb_func_start vblank_cb_8086390 -vblank_cb_8086390: ; 8086390 + thumb_func_start VBlankCB_Field +VBlankCB_Field: ; 8086390 push {lr} bl LoadOamFromSprites bl ProcessObjectCopyRequests bl sub_80BA0A8 - bl sub_8089BA4 + bl FieldUpdateBgTilemapScroll bl copy_pal_bg_faded_to_pal_ram bl sub_80A09D0 pop {r0} bx r0 - thumb_func_end vblank_cb_8086390 + thumb_func_end VBlankCB_Field thumb_func_start sub_80863B0 sub_80863B0: ; 80863B0 @@ -229535,7 +229546,7 @@ map_loading_iteration_3: ; 80863F8 b @08086506 .pool @080864D4: - bl cur_mapdata_full_redraw + bl DrawWholeMapView b @08086506 @080864DA: bl cur_mapheader_run_tileset_funcs_after_some_cpuset @@ -229654,7 +229665,7 @@ load_map_stuff: ; 808651C b @08086622 .pool @080865E8: - bl cur_mapdata_full_redraw + bl DrawWholeMapView b @08086622 @080865EE: bl cur_mapheader_run_tileset_funcs_after_some_cpuset @@ -229671,7 +229682,7 @@ load_map_stuff: ; 808651C lsrs r0, 24 cmp r0, 0x1 bne @08086622 - bl sub_80D47E4 + bl AddMapNamePopUpWindowTask b @08086622 .pool @08086618: @@ -229823,7 +229834,7 @@ map_loading_iteration_2_link: ; 8086698 b @08086792 .pool @08086760: - bl cur_mapdata_full_redraw + bl DrawWholeMapView b @08086792 @08086766: bl cur_mapheader_run_tileset_funcs_after_some_cpuset @@ -229850,7 +229861,7 @@ map_loading_iteration_2_link: ; 8086698 strb r0, [r4] b @080867A8 @0808679A: - bl set_vblank_callback_8086390 + bl SetFieldVBlankCallback ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] @@ -230069,8 +230080,8 @@ sub_8086988: ; 8086988 bl sub_80A1A74 bl dp12_8087EA4 bl dp13_810BB8C - bl clear_all_callback6 - bl sub_808A2E4 + bl ResetCameraUpdateInfo + bl InstallCameraPanAheadCallback cmp r4, 0 bne @080869B4 movs r0, 0 @@ -230140,7 +230151,7 @@ mli4_mapscripts_and_other: ; 8086A04 ldrb r3, [r3, 0x8] bl InitPlayerAvatar ldrb r0, [r5] - bl SetPlayerAvatarTransition + bl SetPlayerAvatarTransitionFlags bl player_avatar_init_params_reset movs r0, 0 movs r1, 0 @@ -230180,7 +230191,7 @@ sub_8086A80: ; 8086A80 orrs r1, r2 strb r1, [r0, 0x1] ldrb r0, [r3, 0x4] - bl sub_808A134 + bl InitCameraUpdateCallback pop {r0} bx r0 .pool @@ -230194,7 +230205,7 @@ sub_8086AAC: ; 8086AAC bl sub_8087858 lsls r0, 24 lsrs r0, 24 - bl sub_808A134 + bl InitCameraUpdateCallback pop {r0} bx r0 .pool @@ -230208,7 +230219,7 @@ sub_8086AC8: ; 8086AC8 bl sub_8087858 lsls r0, 24 lsrs r0, 24 - bl sub_808A134 + bl InitCameraUpdateCallback pop {r0} bx r0 .pool @@ -231282,7 +231293,7 @@ sub_80872D8: ; 80872D8 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r5, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt strh r0, [r6, 0xC] add sp, 0x4 pop {r4-r6} @@ -232479,7 +232490,7 @@ sub_8087BCC: ; 8087BCC movs r2, 0 str r2, [sp] movs r3, 0 - bl sub_808DD68 + bl AddPseudoFieldObject strb r0, [r4, 0x4] @08087C56: ldrb r1, [r4, 0x4] @@ -232606,8 +232617,8 @@ mapconnection_get_mapheader: ; 8087D44 bx r1 thumb_func_end mapconnection_get_mapheader - thumb_func_start sub_8087D54 -sub_8087D54: ; 8087D54 + thumb_func_start not_trainer_hill_battle_pyramid +not_trainer_hill_battle_pyramid: ; 8087D54 push {r4,lr} ldr r4, =0x02037318 adds r0, r4, 0 @@ -232619,7 +232630,7 @@ sub_8087D54: ; 8087D54 pop {r0} bx r0 .pool - thumb_func_end sub_8087D54 + thumb_func_end not_trainer_hill_battle_pyramid thumb_func_start sub_8087D74 sub_8087D74: ; 8087D74 @@ -232643,8 +232654,8 @@ sub_8087D74: ; 8087D74 .pool thumb_func_end sub_8087D74 - thumb_func_start sub_8087DAC -sub_8087DAC: ; 8087DAC + thumb_func_start battle_pyramid_map_load_related +battle_pyramid_map_load_related: ; 8087DAC push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 @@ -232665,10 +232676,10 @@ sub_8087DAC: ; 8087DAC pop {r0} bx r0 .pool - thumb_func_end sub_8087DAC + thumb_func_end battle_pyramid_map_load_related - thumb_func_start sub_8087DE4 -sub_8087DE4: ; 8087DE4 + thumb_func_start trainer_hill_map_load_related +trainer_hill_map_load_related: ; 8087DE4 push {r4,lr} sub sp, 0x4 ldr r0, =0x03ff03ff @@ -232685,7 +232696,7 @@ sub_8087DE4: ; 8087DE4 pop {r0} bx r0 .pool - thumb_func_end sub_8087DE4 + thumb_func_end trainer_hill_map_load_related thumb_func_start mapheader_copy_mapdata_with_padding ; void mapheader_copy_mapdata_with_padding(struct mapheader *mapHeader) @@ -233238,9 +233249,9 @@ MapGridIsImpassableAt: ; 80881B0 bx r1 thumb_func_end MapGridIsImpassableAt - thumb_func_start cur_mapdata_get_blockid_at -; int cur_mapdata_get_blockid_at(int x, int y) -cur_mapdata_get_blockid_at: ; 8088224 + thumb_func_start MapGridGetMetatileIdAt +; u16 MapGridGetMetatileIdAt(s32 x, s32 y) +MapGridGetMetatileIdAt: ; 8088224 push {r4-r6,lr} adds r5, r0, 0 adds r6, r1, 0 @@ -233315,31 +233326,31 @@ cur_mapdata_get_blockid_at: ; 8088224 pop {r1} bx r1 .pool - thumb_func_end cur_mapdata_get_blockid_at + thumb_func_end MapGridGetMetatileIdAt - thumb_func_start cur_mapdata_block_get_role_at -; int cur_mapdata_block_get_role_at(int x, int y) -cur_mapdata_block_get_role_at: ; 80882BC + thumb_func_start MapGridGetMetatileBehaviorAt +; u8 MapGridGetMetatileBehaviorAt(s32 x, s32 y) +MapGridGetMetatileBehaviorAt: ; 80882BC push {lr} - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt lsls r0, 16 lsrs r0, 16 - bl cur_mapdata_get_behaviour_by_blockid + bl GetBehaviorByMetatileId adds r1, r0, 0 movs r0, 0xFF ands r0, r1 pop {r1} bx r1 - thumb_func_end cur_mapdata_block_get_role_at + thumb_func_end MapGridGetMetatileBehaviorAt - thumb_func_start cur_mapdata_block_get_bgs_at -; int cur_mapdata_block_get_bgs_at(int x, int y) -cur_mapdata_block_get_bgs_at: ; 80882D4 + thumb_func_start MapGridGetMetatileLayerTypeAt +; u8 MapGridGetMetatileLayerTypeAt(s32 x, s32 y) +MapGridGetMetatileLayerTypeAt: ; 80882D4 push {lr} - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt lsls r0, 16 lsrs r0, 16 - bl cur_mapdata_get_behaviour_by_blockid + bl GetBehaviorByMetatileId adds r1, r0, 0 movs r0, 0xF0 lsls r0, 8 @@ -233347,10 +233358,11 @@ cur_mapdata_block_get_bgs_at: ; 80882D4 lsrs r0, 12 pop {r1} bx r1 - thumb_func_end cur_mapdata_block_get_bgs_at + thumb_func_end MapGridGetMetatileLayerTypeAt - thumb_func_start setmaptile_0 -setmaptile_0: ; 80882F0 + thumb_func_start MapGridSetMetatileIdAt +; void MapGridSetMetatileIdAt(s32 x, s32 y, u16 metatileId) +MapGridSetMetatileIdAt: ; 80882F0 push {r4,r5,lr} adds r3, r0, 0 lsls r2, 16 @@ -233384,10 +233396,11 @@ setmaptile_0: ; 80882F0 pop {r0} bx r0 .pool - thumb_func_end setmaptile_0 + thumb_func_end MapGridSetMetatileIdAt - thumb_func_start sub_8088338 -sub_8088338: ; 8088338 + thumb_func_start MapGridSetMetatileEntryAt +; void MapGridSetMetatileEntryAt(s32 x, s32 y, u16 metatileEntry) +MapGridSetMetatileEntryAt: ; 8088338 push {r4,r5,lr} adds r3, r0, 0 lsls r2, 16 @@ -233415,11 +233428,11 @@ sub_8088338: ; 8088338 pop {r0} bx r0 .pool - thumb_func_end sub_8088338 + thumb_func_end MapGridSetMetatileEntryAt - thumb_func_start cur_mapdata_get_behaviour_by_blockid -; int cur_mapdata_get_behaviour_by_blockid(u16 block_id) -cur_mapdata_get_behaviour_by_blockid: ; 8088370 + thumb_func_start GetBehaviorByMetatileId +; u16 GetBehaviorByMetatileId(u16 metatileId) +GetBehaviorByMetatileId: ; 8088370 push {lr} lsls r0, 16 lsrs r2, r0, 16 @@ -233456,7 +233469,7 @@ cur_mapdata_get_behaviour_by_blockid: ; 8088370 pop {r1} bx r1 .pool - thumb_func_end cur_mapdata_get_behaviour_by_blockid + thumb_func_end GetBehaviorByMetatileId thumb_func_start save_serialize_map save_serialize_map: ; 80883C4 @@ -233700,7 +233713,7 @@ mapdata_from_sav2: ; 808849C bge @08088598 asrs r0, r4, 16 asrs r1, r7, 16 - bl task00_bag_acit_10 + bl sub_80D42B8 @08088598: movs r0, 0x80 lsls r0, 9 @@ -233841,6 +233854,7 @@ sub_80885C4: ; 80885C4 thumb_func_end sub_80885C4 thumb_func_start GetMapBorderIdAt +; u32 GetMapBorderIdAt(s32 x, s32 y) GetMapBorderIdAt: ; 808869C push {r4,r5,lr} adds r4, r0, 0 @@ -233955,8 +233969,9 @@ GetMapBorderIdAt: ; 808869C bx r1 thumb_func_end GetMapBorderIdAt - thumb_func_start sub_8088788 -sub_8088788: ; 8088788 + thumb_func_start GetPostCameraMoveMapBorderId +; u32 GetPostCameraMoveMapBorderId(s32 deltaX, s32 deltaY) +GetPostCameraMoveMapBorderId: ; 8088788 push {r4,lr} adds r3, r1, 0 ldr r1, =0x03005d8c @@ -233975,7 +233990,7 @@ sub_8088788: ; 8088788 pop {r1} bx r1 .pool - thumb_func_end sub_8088788 + thumb_func_end GetPostCameraMoveMapBorderId thumb_func_start CanCameraMoveInDirection ; BOOL32 CanCameraMoveInDirection(u8 direction) @@ -234084,8 +234099,9 @@ sub_80887F8: ; 80887F8 .pool thumb_func_end sub_80887F8 - thumb_func_start camera_move_maybe -camera_move_maybe: ; 808887C + thumb_func_start CameraMove +; u8 CameraMove(s32 deltaX, s32 deltaY) +CameraMove: ; 808887C push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -234102,7 +234118,7 @@ camera_move_maybe: ; 808887C strb r1, [r2] mov r0, r10 mov r1, r9 - bl sub_8088788 + bl GetPostCameraMoveMapBorderId adds r7, r0, 0 adds r0, r7, 0x1 cmp r0, 0x1 @@ -234180,7 +234196,7 @@ camera_move_maybe: ; 808887C pop {r1} bx r1 .pool - thumb_func_end camera_move_maybe + thumb_func_end CameraMove thumb_func_start sub_8088950 sub_8088950: ; 8088950 @@ -234493,18 +234509,20 @@ sav1_camera_get_focus_coords: ; 8088B58 .pool thumb_func_end sav1_camera_get_focus_coords - thumb_func_start sub_8088B70 -sub_8088B70: ; 8088B70 + thumb_func_start SetCameraCoords +; void SetCameraCoords(u16 x, u16 y) +SetCameraCoords: ; 8088B70 ldr r2, =0x03005d8c ldr r2, [r2] strh r0, [r2] strh r1, [r2, 0x2] bx lr .pool - thumb_func_end sub_8088B70 + thumb_func_end SetCameraCoords - thumb_func_start sub_8088B80 -sub_8088B80: ; 8088B80 + thumb_func_start GetCameraCoords +; void GetCameraCoords(u16 *x, u16 *y) +GetCameraCoords: ; 8088B80 ldr r2, =0x03005d8c ldr r3, [r2] ldrh r2, [r3] @@ -234513,7 +234531,7 @@ sub_8088B80: ; 8088B80 strh r0, [r1] bx lr .pool - thumb_func_end sub_8088B80 + thumb_func_end GetCameraCoords thumb_func_start sub_8088B94 sub_8088B94: ; 8088B94 @@ -235636,8 +235654,8 @@ is_tile_x86_and_npcunk2_is_x2: ; 80891CC bx r1 thumb_func_end is_tile_x86_and_npcunk2_is_x2 - thumb_func_start IsMetatileComputer -IsMetatileComputer: ; 80891E8 + thumb_func_start MetatileBehavior_IsPC +MetatileBehavior_IsPC: ; 80891E8 push {lr} lsls r0, 24 lsrs r0, 24 @@ -235650,7 +235668,7 @@ IsMetatileComputer: ; 80891E8 @080891F8: pop {r1} bx r1 - thumb_func_end IsMetatileComputer + thumb_func_end MetatileBehavior_IsPC thumb_func_start is_tile_x84 is_tile_x84: ; 80891FC @@ -237402,8 +237420,8 @@ sub_8089AEC: ; 8089AEC bx r1 thumb_func_end sub_8089AEC - thumb_func_start is_tile_x8F -is_tile_x8F: ; 8089B08 + thumb_func_start MetatileBehavior_IsQuestionnaire +MetatileBehavior_IsQuestionnaire: ; 8089B08 push {lr} lsls r0, 24 lsrs r0, 24 @@ -237416,10 +237434,10 @@ is_tile_x8F: ; 8089B08 @08089B18: pop {r1} bx r1 - thumb_func_end is_tile_x8F + thumb_func_end MetatileBehavior_IsQuestionnaire - thumb_func_start sub_8089B1C -sub_8089B1C: ; 8089B1C + thumb_func_start MetatileBehavior_IsLongGrass2 +MetatileBehavior_IsLongGrass2: ; 8089B1C push {lr} lsls r0, 24 lsrs r0, 24 @@ -237432,10 +237450,10 @@ sub_8089B1C: ; 8089B1C @08089B2C: pop {r1} bx r1 - thumb_func_end sub_8089B1C + thumb_func_end MetatileBehavior_IsLongGrass2 - thumb_func_start sub_8089B30 -sub_8089B30: ; 8089B30 + thumb_func_start MetatileBehavior_IsLongGrassSouthEdge +MetatileBehavior_IsLongGrassSouthEdge: ; 8089B30 push {lr} lsls r0, 24 lsrs r0, 24 @@ -237448,10 +237466,10 @@ sub_8089B30: ; 8089B30 @08089B40: pop {r1} bx r1 - thumb_func_end sub_8089B30 + thumb_func_end MetatileBehavior_IsLongGrassSouthEdge - thumb_func_start sub_8089B44 -sub_8089B44: ; 8089B44 + thumb_func_start MetatileBehavior_IsTrainerHillTimer +MetatileBehavior_IsTrainerHillTimer: ; 8089B44 push {lr} lsls r0, 24 lsrs r0, 24 @@ -237464,7 +237482,7 @@ sub_8089B44: ; 8089B44 @08089B54: pop {r1} bx r1 - thumb_func_end sub_8089B44 + thumb_func_end MetatileBehavior_IsTrainerHillTimer thumb_func_start move_tilemap_camera_to_upper_left_corner_ ; void move_tilemap_camera_to_upper_left_corner_(struc_28 *a1) @@ -237480,6 +237498,7 @@ move_tilemap_camera_to_upper_left_corner_: ; 8089B58 thumb_func_end move_tilemap_camera_to_upper_left_corner_ thumb_func_start tilemap_move_something +; void tilemap_move_something(struct struc_28 *, u8 deltaX, u8 deltaY) tilemap_move_something: ; 8089B68 ldrb r3, [r0, 0x2] adds r3, r1 @@ -237498,6 +237517,7 @@ tilemap_move_something: ; 8089B68 thumb_func_end tilemap_move_something thumb_func_start coords8_add +; void coords8_add(struct coords8 *coords, u8 x, u8 y) coords8_add: ; 8089B84 ldrb r3, [r0] adds r3, r1 @@ -237519,8 +237539,9 @@ move_tilemap_camera_to_upper_left_corner: ; 8089B94 .pool thumb_func_end move_tilemap_camera_to_upper_left_corner - thumb_func_start sub_8089BA4 -sub_8089BA4: ; 8089BA4 + thumb_func_start FieldUpdateBgTilemapScroll +; void FieldUpdateBgTilemapScroll() +FieldUpdateBgTilemapScroll: ; 8089BA4 push {r4,r5,lr} ldr r1, =0x03000e20 ldr r0, =0x03000e28 @@ -237560,7 +237581,7 @@ sub_8089BA4: ; 8089BA4 pop {r0} bx r0 .pool - thumb_func_end sub_8089BA4 + thumb_func_end FieldUpdateBgTilemapScroll thumb_func_start sub_8089C08 sub_8089C08: ; 8089C08 @@ -237583,9 +237604,9 @@ sub_8089C08: ; 8089C08 .pool thumb_func_end sub_8089C08 - thumb_func_start cur_mapdata_full_redraw -; void cur_mapdata_full_redraw() -cur_mapdata_full_redraw: ; 8089C34 + thumb_func_start DrawWholeMapView +; void DrawWholeMapView() +DrawWholeMapView: ; 8089C34 push {lr} ldr r0, =0x03005d8c ldr r1, [r0] @@ -237595,18 +237616,18 @@ cur_mapdata_full_redraw: ; 8089C34 ldrsh r1, [r1, r2] ldr r2, =0x02037318 ldr r2, [r2] - bl cur_mapdata_redraw_all_blocks_at + bl DrawWholeMapViewInternal ldr r1, =0x03000e20 movs r0, 0x1 strb r0, [r1, 0x4] pop {r0} bx r0 .pool - thumb_func_end cur_mapdata_full_redraw + thumb_func_end DrawWholeMapView - thumb_func_start cur_mapdata_redraw_all_blocks_at -; void cur_mapdata_redraw_all_blocks_at(int x, int y, mapdata_header *mapdata_header) -cur_mapdata_redraw_all_blocks_at: ; 8089C60 + thumb_func_start DrawWholeMapViewInternal +; void DrawWholeMapViewInternal(s32 x, s32 y, struct mapdata_header *mapGrid) +DrawWholeMapViewInternal: ; 8089C60 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -237654,7 +237675,7 @@ cur_mapdata_redraw_all_blocks_at: ; 8089C60 mov r0, r8 mov r7, r9 adds r3, r7, r5 - bl cur_mapdata_draw_block_at_internal + bl DrawMetatileAt adds r0, r4, 0x2 lsls r0, 24 lsrs r4, r0, 24 @@ -237674,10 +237695,11 @@ cur_mapdata_redraw_all_blocks_at: ; 8089C60 pop {r0} bx r0 .pool - thumb_func_end cur_mapdata_redraw_all_blocks_at + thumb_func_end DrawWholeMapViewInternal - thumb_func_start cur_mapheader_draw_map_slice -cur_mapheader_draw_map_slice: ; 8089CE4 + thumb_func_start RedrawMapSlicesForCameraUpdate +; void RedrawMapSlicesForCameraUpdate(struct struc_28 *, u8 deltaX, u8 deltaY) +RedrawMapSlicesForCameraUpdate: ; 8089CE4 push {r4-r7,lr} adds r5, r0, 0 adds r6, r1, 0 @@ -237688,25 +237710,25 @@ cur_mapheader_draw_map_slice: ; 8089CE4 ble @08089CFC adds r0, r5, 0 adds r1, r4, 0 - bl cur_mapheader_draw_map_slice_left + bl RedrawMapSliceWest @08089CFC: cmp r6, 0 bge @08089D08 adds r0, r5, 0 adds r1, r4, 0 - bl cur_mapheader_draw_map_slice_right + bl RedrawMapSliceEast @08089D08: cmp r7, 0 ble @08089D14 adds r0, r5, 0 adds r1, r4, 0 - bl cur_mapheader_draw_map_slice_above + bl RedrawMapSliceNorth @08089D14: cmp r7, 0 bge @08089D20 adds r0, r5, 0 adds r1, r4, 0 - bl cur_mapheader_draw_map_slice_below + bl RedrawMapSliceSouth @08089D20: movs r0, 0x1 strb r0, [r5, 0x4] @@ -237714,10 +237736,11 @@ cur_mapheader_draw_map_slice: ; 8089CE4 pop {r0} bx r0 .pool - thumb_func_end cur_mapheader_draw_map_slice + thumb_func_end RedrawMapSlicesForCameraUpdate - thumb_func_start cur_mapheader_draw_map_slice_above -cur_mapheader_draw_map_slice_above: ; 8089D30 + thumb_func_start RedrawMapSliceNorth +; void RedrawMapSliceNorth(struct struc_28 *, struct mapdata_header *mapGrid) +RedrawMapSliceNorth: ; 8089D30 push {r4-r7,lr} adds r5, r0, 0 adds r7, r1, 0 @@ -237757,7 +237780,7 @@ cur_mapheader_draw_map_slice_above: ; 8089D30 ldrsh r3, [r3, r0] adds r3, 0xE adds r0, r7, 0 - bl cur_mapdata_draw_block_at_internal + bl DrawMetatileAt adds r0, r4, 0x2 lsls r0, 24 lsrs r4, r0, 24 @@ -237767,10 +237790,11 @@ cur_mapheader_draw_map_slice_above: ; 8089D30 pop {r0} bx r0 .pool - thumb_func_end cur_mapheader_draw_map_slice_above + thumb_func_end RedrawMapSliceNorth - thumb_func_start cur_mapheader_draw_map_slice_below -cur_mapheader_draw_map_slice_below: ; 8089D90 + thumb_func_start RedrawMapSliceSouth +; void RedrawMapSliceSouth(struct struc_28 *, struct mapdata_header *mapGrid) +RedrawMapSliceSouth: ; 8089D90 push {r4-r7,lr} adds r5, r0, 0 adds r7, r1, 0 @@ -237798,7 +237822,7 @@ cur_mapheader_draw_map_slice_below: ; 8089D90 movs r0, 0x2 ldrsh r3, [r3, r0] adds r0, r7, 0 - bl cur_mapdata_draw_block_at_internal + bl DrawMetatileAt adds r0, r4, 0x2 lsls r0, 24 lsrs r4, r0, 24 @@ -237808,10 +237832,11 @@ cur_mapheader_draw_map_slice_below: ; 8089D90 pop {r0} bx r0 .pool - thumb_func_end cur_mapheader_draw_map_slice_below + thumb_func_end RedrawMapSliceSouth - thumb_func_start cur_mapheader_draw_map_slice_right -cur_mapheader_draw_map_slice_right: ; 8089DDC + thumb_func_start RedrawMapSliceEast +; void RedrawMapSliceEast(struct struc_28 *, struct mapdata_header *mapGrid) +RedrawMapSliceEast: ; 8089DDC push {r4-r7,lr} mov r7, r8 push {r7} @@ -237843,7 +237868,7 @@ cur_mapheader_draw_map_slice_right: ; 8089DDC lsrs r0, r4, 1 adds r3, r0 mov r0, r8 - bl cur_mapdata_draw_block_at_internal + bl DrawMetatileAt adds r0, r4, 0x2 lsls r0, 24 lsrs r4, r0, 24 @@ -237855,10 +237880,11 @@ cur_mapheader_draw_map_slice_right: ; 8089DDC pop {r0} bx r0 .pool - thumb_func_end cur_mapheader_draw_map_slice_right + thumb_func_end RedrawMapSliceEast - thumb_func_start cur_mapheader_draw_map_slice_left -cur_mapheader_draw_map_slice_left: ; 8089E34 + thumb_func_start RedrawMapSliceWest +; void RedrawMapSliceWest(struct struc_28 *, struct mapdata_header *mapGrid) +RedrawMapSliceWest: ; 8089E34 push {r4-r7,lr} mov r7, r8 push {r7} @@ -237901,7 +237927,7 @@ cur_mapheader_draw_map_slice_left: ; 8089E34 lsrs r0, r4, 1 adds r3, r0 mov r0, r8 - bl cur_mapdata_draw_block_at_internal + bl DrawMetatileAt adds r0, r4, 0x2 lsls r0, 24 lsrs r4, r0, 24 @@ -237913,10 +237939,11 @@ cur_mapheader_draw_map_slice_left: ; 8089E34 pop {r0} bx r0 .pool - thumb_func_end cur_mapheader_draw_map_slice_left + thumb_func_end RedrawMapSliceWest - thumb_func_start cur_mapdata_draw_block_at -cur_mapdata_draw_block_at: ; 8089EA0 + thumb_func_start CurrentMapDrawMetatileAt +; void CurrentMapDrawMetatileAt(u32 x, u32 y) +CurrentMapDrawMetatileAt: ; 8089EA0 push {r4-r6,lr} adds r4, r0, 0 adds r5, r1, 0 @@ -237924,7 +237951,7 @@ cur_mapdata_draw_block_at: ; 8089EA0 adds r0, r6, 0 adds r1, r4, 0 adds r2, r5, 0 - bl map_pos_to_screenspace + bl MapPosToBgTilemapOffset adds r1, r0, 0 cmp r1, 0 blt @08089ECC @@ -237934,7 +237961,7 @@ cur_mapdata_draw_block_at: ; 8089EA0 lsrs r1, 16 adds r2, r4, 0 adds r3, r5, 0 - bl cur_mapdata_draw_block_at_internal + bl DrawMetatileAt movs r0, 0x1 strb r0, [r6, 0x4] @08089ECC: @@ -237942,10 +237969,11 @@ cur_mapdata_draw_block_at: ; 8089EA0 pop {r0} bx r0 .pool - thumb_func_end cur_mapdata_draw_block_at + thumb_func_end CurrentMapDrawMetatileAt - thumb_func_start overworld_draw_block_type1_on_map_coord -overworld_draw_block_type1_on_map_coord: ; 8089EDC + thumb_func_start DrawDoorMetatileAt +; void DrawDoorMetatileAt(u32 x, u32 y, u16 *metatile) +DrawDoorMetatileAt: ; 8089EDC push {r4-r6,lr} adds r3, r0, 0 adds r4, r1, 0 @@ -237954,14 +237982,14 @@ overworld_draw_block_type1_on_map_coord: ; 8089EDC adds r0, r6, 0 adds r1, r3, 0 adds r2, r4, 0 - bl map_pos_to_screenspace + bl MapPosToBgTilemapOffset cmp r0, 0 blt @08089F04 lsls r2, r0, 16 lsrs r2, 16 movs r0, 0x1 adds r1, r5, 0 - bl overworld_draw_block + bl DrawMetatile movs r0, 0x1 strb r0, [r6, 0x4] @08089F04: @@ -237969,11 +237997,11 @@ overworld_draw_block_type1_on_map_coord: ; 8089EDC pop {r0} bx r0 .pool - thumb_func_end overworld_draw_block_type1_on_map_coord + thumb_func_end DrawDoorMetatileAt - thumb_func_start cur_mapdata_draw_block_at_internal -; void cur_mapdata_draw_block_at_internal(mapdata_header *mapdata_header, u16 offset, int x, int y) -cur_mapdata_draw_block_at_internal: ; 8089F10 + thumb_func_start DrawMetatileAt +; void DrawMetatileAt(struct mapdata_header *mapGrid, u16 offset, s32 x, s32 y) +DrawMetatileAt: ; 8089F10 push {r4-r7,lr} mov r7, r8 push {r7} @@ -237985,7 +238013,7 @@ cur_mapdata_draw_block_at_internal: ; 8089F10 mov r8, r1 adds r0, r6, 0 adds r1, r7, 0 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt lsls r0, 16 lsrs r4, r0, 16 movs r0, 0x80 @@ -238011,24 +238039,24 @@ cur_mapdata_draw_block_at_internal: ; 8089F10 @08089F54: adds r0, r6, 0 adds r1, r7, 0 - bl cur_mapdata_block_get_bgs_at + bl MapGridGetMetatileLayerTypeAt lsls r0, 24 lsrs r0, 24 lsls r1, r4, 4 adds r1, r5, r1 mov r2, r8 - bl overworld_draw_block + bl DrawMetatile pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .pool - thumb_func_end cur_mapdata_draw_block_at_internal + thumb_func_end DrawMetatileAt - thumb_func_start overworld_draw_block -; void overworld_draw_block(int bg, void *block, u16 offset) -overworld_draw_block: ; 8089F78 + thumb_func_start DrawMetatile +; void DrawMetatile(u32 layerType, u16 *metatile, u16 offset) +DrawMetatile: ; 8089F78 push {r4,lr} adds r4, r1, 0 lsls r2, 16 @@ -238168,10 +238196,11 @@ overworld_draw_block: ; 8089F78 pop {r0} bx r0 .pool - thumb_func_end overworld_draw_block + thumb_func_end DrawMetatile - thumb_func_start map_pos_to_screenspace -map_pos_to_screenspace: ; 808A0AC + thumb_func_start MapPosToBgTilemapOffset +; u32 MapPosToBgTilemapOffset(struct struc_28 *, u32 x, u32 y) +MapPosToBgTilemapOffset: ; 808A0AC push {r4,r5,lr} adds r4, r0, 0 ldr r0, =0x03005d8c @@ -238212,10 +238241,11 @@ map_pos_to_screenspace: ; 808A0AC pop {r4,r5} pop {r1} bx r1 - thumb_func_end map_pos_to_screenspace + thumb_func_end MapPosToBgTilemapOffset - thumb_func_start sub_808A0F4 -sub_808A0F4: ; 808A0F4 + thumb_func_start CameraUpdateCallback +; void CameraUpdateCallback(struct CameraUpdateInfo *info) +CameraUpdateCallback: ; 808A0F4 push {lr} adds r3, r0, 0 ldr r2, [r3, 0x4] @@ -238236,10 +238266,11 @@ sub_808A0F4: ; 808A0F4 pop {r0} bx r0 .pool - thumb_func_end sub_808A0F4 + thumb_func_end CameraUpdateCallback - thumb_func_start clear_all_callback6 -clear_all_callback6: ; 808A11C + thumb_func_start ResetCameraUpdateInfo +; void ResetCameraUpdateInfo() +ResetCameraUpdateInfo: ; 808A11C ldr r1, =0x03005dd0 movs r0, 0 str r0, [r1, 0x8] @@ -238250,10 +238281,11 @@ clear_all_callback6: ; 808A11C str r0, [r1] bx lr .pool - thumb_func_end clear_all_callback6 + thumb_func_end ResetCameraUpdateInfo - thumb_func_start sub_808A134 -sub_808A134: ; 808A134 + thumb_func_start InitCameraUpdateCallback +; u8 InitCameraUpdateCallback(u8 followedObjectId) +InitCameraUpdateCallback: ; 808A134 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 @@ -238273,17 +238305,18 @@ sub_808A134: ; 808A134 lsls r0, 24 lsrs r0, 24 str r0, [r4, 0x4] - ldr r0, =sub_808A0F4 + ldr r0, =CameraUpdateCallback str r0, [r4] movs r0, 0 pop {r4,r5} pop {r1} bx r1 .pool - thumb_func_end sub_808A134 + thumb_func_end InitCameraUpdateCallback - thumb_func_start camera_update -camera_update: ; 808A174 + thumb_func_start CameraUpdate +; void CameraUpdate() +CameraUpdate: ; 808A174 push {r4-r7,lr} mov r7, r8 push {r7} @@ -238375,14 +238408,14 @@ camera_update: ; 808A174 @0808A218: adds r0, r4, 0 adds r1, r5, 0 - bl camera_move_maybe + bl CameraMove adds r0, r4, 0 adds r1, r5, 0 bl UpdateFieldObjectsForCameraUpdate adds r0, r4, 0 adds r1, r5, 0 - bl sub_80FBEA8 - bl sub_80E1D6C + bl RotatingGatePuzzleCameraUpdate + bl ResetBerryTreeSparkleFlags ldr r6, =0x03000e20 lsls r4, 1 lsls r5, 1 @@ -238393,7 +238426,7 @@ camera_update: ; 808A174 adds r0, r6, 0 adds r1, r4, 0 adds r2, r5, 0 - bl cur_mapheader_draw_map_slice + bl RedrawMapSlicesForCameraUpdate @0808A24E: ldr r0, =0x03000e20 adds r1, r7, 0 @@ -238414,20 +238447,20 @@ camera_update: ; 808A174 pop {r0} bx r0 .pool - thumb_func_end camera_update + thumb_func_end CameraUpdate - thumb_func_start camera_move_and_redraw -camera_move_and_redraw: ; 808A284 + thumb_func_start sub_808A284 +sub_808A284: ; 808A284 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 - bl camera_move_maybe + bl CameraMove lsls r0, r4, 16 asrs r0, 16 lsls r1, r5, 16 asrs r1, 16 bl UpdateFieldObjectsForCameraUpdate - bl cur_mapdata_full_redraw + bl DrawWholeMapView ldr r1, =0x03005dec lsls r4, 4 ldrh r0, [r1] @@ -238442,18 +238475,20 @@ camera_move_and_redraw: ; 808A284 pop {r0} bx r0 .pool - thumb_func_end camera_move_and_redraw + thumb_func_end sub_808A284 - thumb_func_start sub_808A2C0 -sub_808A2C0: ; 808A2C0 + thumb_func_start SetCameraPanningCallback +; void SetCameraPanningCallback(void ( *callback)()) +SetCameraPanningCallback: ; 808A2C0 ldr r1, =0x03000e30 str r0, [r1] bx lr .pool - thumb_func_end sub_808A2C0 + thumb_func_end SetCameraPanningCallback - thumb_func_start sub_808A2CC -sub_808A2CC: ; 808A2CC + thumb_func_start SetCameraPanning +; void SetCameraPanning(s16 x, s16 y) +SetCameraPanning: ; 808A2CC ldr r2, =0x03000e28 strh r0, [r2] ldr r0, =0x03000e2a @@ -238463,12 +238498,13 @@ sub_808A2CC: ; 808A2CC strh r1, [r0] bx lr .pool - thumb_func_end sub_808A2CC + thumb_func_end SetCameraPanning - thumb_func_start sub_808A2E4 -sub_808A2E4: ; 808A2E4 + thumb_func_start InstallCameraPanAheadCallback +; void InstallCameraPanAheadCallback() +InstallCameraPanAheadCallback: ; 808A2E4 ldr r1, =0x03000e30 - ldr r0, =nu_805AE74 + ldr r0, =CameraPanningCB_PanAhead str r0, [r1] ldr r1, =0x03000e2c movs r0, 0 @@ -238481,10 +238517,11 @@ sub_808A2E4: ; 808A2E4 strh r0, [r1] bx lr .pool - thumb_func_end sub_808A2E4 + thumb_func_end InstallCameraPanAheadCallback - thumb_func_start sub_808A314 -sub_808A314: ; 808A314 + thumb_func_start UpdateCameraPanning +; void UpdateCameraPanning() +UpdateCameraPanning: ; 808A314 push {lr} ldr r0, =0x03000e30 ldr r0, [r0] @@ -238510,16 +238547,17 @@ sub_808A314: ; 808A314 pop {r0} bx r0 .pool - thumb_func_end sub_808A314 + thumb_func_end UpdateCameraPanning - thumb_func_start nu_805AE74 -nu_805AE74: ; 808A360 + thumb_func_start CameraPanningCB_PanAhead +; void CameraPanningCB_PanAhead() +CameraPanningCB_PanAhead: ; 808A360 push {lr} ldr r0, =0x02037348 ldrb r0, [r0] cmp r0, 0 bne @0808A374 - bl sub_808A2E4 + bl InstallCameraPanAheadCallback b @0808A3FC .pool @0808A374: @@ -238589,7 +238627,7 @@ nu_805AE74: ; 808A360 @0808A3FC: pop {r0} bx r0 - thumb_func_end nu_805AE74 + thumb_func_end CameraPanningCB_PanAhead thumb_func_start sub_808A400 sub_808A400: ; 808A400 @@ -238682,7 +238720,7 @@ door_patch_tilemap: ; 808A478 adds r0, r7, 0 adds r1, r6, 0 adds r2, r4, 0 - bl overworld_draw_block_type1_on_map_coord + bl DrawDoorMetatileAt movs r1, 0xFD lsls r1, 2 adds r0, r5, 0x4 @@ -238693,7 +238731,7 @@ door_patch_tilemap: ; 808A478 adds r0, r7, 0 mov r1, r9 adds r2, r4, 0 - bl overworld_draw_block_type1_on_map_coord + bl DrawDoorMetatileAt movs r1, 0xFE lsls r1, 2 adds r0, r4, 0 @@ -238703,7 +238741,7 @@ door_patch_tilemap: ; 808A478 adds r0, r5, 0 adds r1, r6, 0 adds r2, r4, 0 - bl overworld_draw_block_type1_on_map_coord + bl DrawDoorMetatileAt movs r1, 0xFF lsls r1, 2 adds r0, r4, 0 @@ -238712,7 +238750,7 @@ door_patch_tilemap: ; 808A478 adds r0, r5, 0 mov r1, r9 adds r2, r4, 0 - bl overworld_draw_block_type1_on_map_coord + bl DrawDoorMetatileAt b @0808A522 @0808A4F4: movs r1, 0xFE @@ -238724,7 +238762,7 @@ door_patch_tilemap: ; 808A478 subs r1, 0x1 adds r0, r7, 0 mov r2, sp - bl overworld_draw_block_type1_on_map_coord + bl DrawDoorMetatileAt movs r1, 0xFF lsls r1, 2 adds r2, r5, 0x4 @@ -238733,7 +238771,7 @@ door_patch_tilemap: ; 808A478 adds r0, r7, 0 mov r1, r9 mov r2, sp - bl overworld_draw_block_type1_on_map_coord + bl DrawDoorMetatileAt @0808A522: add sp, 0x30 pop {r3,r4} @@ -238753,20 +238791,20 @@ sub_808A530: ; 808A530 subs r7, r6, 0x1 adds r0, r5, 0 adds r1, r7, 0 - bl cur_mapdata_draw_block_at + bl CurrentMapDrawMetatileAt adds r0, r5, 0 adds r1, r6, 0 - bl cur_mapdata_draw_block_at + bl CurrentMapDrawMetatileAt ldrb r0, [r4, 0x3] cmp r0, 0x2 bne @0808A562 adds r4, r5, 0x1 adds r0, r4, 0 adds r1, r7, 0 - bl cur_mapdata_draw_block_at + bl CurrentMapDrawMetatileAt adds r0, r4, 0 adds r1, r6, 0 - bl cur_mapdata_draw_block_at + bl CurrentMapDrawMetatileAt @0808A562: pop {r4-r7} pop {r0} @@ -239024,7 +239062,7 @@ sub_808A734: ; 808A734 adds r6, r2, 0 adds r0, r5, 0 adds r1, r6, 0 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 @@ -239057,7 +239095,7 @@ task_overworld_door_add_for_opening_door_at: ; 808A774 adds r6, r2, 0 adds r0, r5, 0 adds r1, r6, 0 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 @@ -239102,7 +239140,7 @@ sub_808A7CC: ; 808A7CC adds r6, r2, 0 adds r0, r5, 0 adds r1, r6, 0 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 @@ -239133,7 +239171,7 @@ cur_mapdata_get_door_x2_at: ; 808A80C adds r4, r0, 0 adds r0, r1, 0 adds r1, r2, 0 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 @@ -239172,7 +239210,7 @@ sub_808A854: ; 808A854 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 bl sub_8088EFC @@ -239195,7 +239233,7 @@ sub_808A880: ; 808A880 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 bl sub_8088EFC @@ -239218,7 +239256,7 @@ sub_808A8AC: ; 808A8AC push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 bl sub_8088EFC @@ -239247,7 +239285,7 @@ task_overworld_door_add_if_role_69_for_opening_door_at: ; 808A8E4 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 bl sub_8088EFC @@ -240198,7 +240236,7 @@ CheckForPlayerAvatarCollision: ; 808AFBC ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r5, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 add r1, sp, 0x4 @@ -240249,7 +240287,7 @@ sub_808B028: ; 808B028 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r5, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 add r1, sp, 0x4 @@ -240352,7 +240390,7 @@ CheckForFieldObjectCollision: ; 808B094 adds r0, r6, 0 adds r1, r5, 0 adds r2, r4, 0 - bl CheckForRotatingDoorPuzzleCollision + bl CheckForRotatingGatePuzzleCollision cmp r0, 0 beq @0808B142 movs r0, 0x8 @@ -240552,7 +240590,7 @@ sub_808B238: ; 808B238 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r5, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 bl sub_8088F58 @@ -240695,9 +240733,9 @@ IsPlayerCollidingWithFarawayIslandMew: ; 808B324 bx r1 thumb_func_end IsPlayerCollidingWithFarawayIslandMew - thumb_func_start SetPlayerAvatarTransition -; void SetPlayerAvatarTransition(u16 stateTransition) -SetPlayerAvatarTransition: ; 808B3CC + thumb_func_start SetPlayerAvatarTransitionFlags +; void SetPlayerAvatarTransitionFlags(u16 transitionFlags) +SetPlayerAvatarTransitionFlags: ; 808B3CC push {lr} lsls r0, 16 lsrs r0, 16 @@ -240709,7 +240747,7 @@ SetPlayerAvatarTransition: ; 808B3CC pop {r0} bx r0 .pool - thumb_func_end SetPlayerAvatarTransition + thumb_func_end SetPlayerAvatarTransitionFlags thumb_func_start DoPlayerAvatarTransition ; void DoPlayerAvatarTransition() @@ -241584,7 +241622,7 @@ PlayCollisionSoundIfNotFacingWarp: ; 808B9EC ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r4, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 bl is_tile_x69_2_warp_door @@ -241602,8 +241640,8 @@ PlayCollisionSoundIfNotFacingWarp: ; 808B9EC .pool 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 + thumb_func_start GetXYCoordsOneStepInFrontOfPlayer +GetXYCoordsOneStepInFrontOfPlayer: ; 808BA68 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 @@ -241633,7 +241671,7 @@ player_get_pos_to_plus_one_step_in_direction_player_is_facing: ; 808BA68 pop {r0} bx r0 .pool - thumb_func_end player_get_pos_to_plus_one_step_in_direction_player_is_facing + thumb_func_end GetXYCoordsOneStepInFrontOfPlayer thumb_func_start PlayerGetDestCoords ; void PlayerGetDestCoords(u16 *x, u16 *y) @@ -241828,6 +241866,7 @@ player_get_direction_upper_nybble: ; 808BC58 thumb_func_end player_get_direction_upper_nybble thumb_func_start PlayerGetZCoord +; u8 PlayerGetZCoord() PlayerGetZCoord: ; 808BC74 ldr r2, =0x02037350 ldr r0, =0x02037590 @@ -242179,7 +242218,7 @@ IsPlayerFacingSurfableFishableWater: ; 808BE74 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r5, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 bl MetatileBehavior_IsSurfableFishableWater @@ -242797,9 +242836,9 @@ sub_808C3A4: ; 808C3A4 .pool 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 + thumb_func_start do_boulder_dust +; int do_boulder_dust(int a1, struct npc_state *a2, struct npc_state *a3) +do_boulder_dust: ; 808C3C4 push {r4-r6,lr} adds r6, r0, 0 adds r5, r1, 0 @@ -242881,7 +242920,7 @@ do_jump_landing_dust: ; 808C3C4 pop {r1} bx r1 .pool - thumb_func_end do_jump_landing_dust + thumb_func_end do_boulder_dust thumb_func_start sub_808C484 sub_808C484: ; 808C484 @@ -243869,7 +243908,7 @@ fish9: ; 808CC64 movs r0, 0 movs r1, 0x1 movs r3, 0x1 - bl text_box_related_one + bl AddTextPrinterParametrized ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] @@ -244026,7 +244065,7 @@ fishB: ; 808CD94 movs r0, 0 movs r1, 0x1 movs r3, 0x1 - bl text_box_related_one + bl AddTextPrinterParametrized movs r0, 0xD strh r0, [r5, 0x8] movs r0, 0x1 @@ -244074,7 +244113,7 @@ fishC: ; 808CE04 movs r0, 0 movs r1, 0x1 movs r3, 0x1 - bl text_box_related_one + bl AddTextPrinterParametrized ldrh r0, [r5, 0x8] adds r0, 0x1 strh r0, [r5, 0x8] @@ -244868,7 +244907,7 @@ sub_808D450: ; 808D450 bl obj_alloc_rotscale_entry adds r0, r4, 0 movs r1, 0 - bl sub_8008258 + bl StartObjectRotScalAnim adds r4, 0x3E ldrb r0, [r4] movs r6, 0x4 @@ -244894,7 +244933,7 @@ sub_808D450: ; 808D450 bl obj_alloc_rotscale_entry adds r0, r4, 0 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim adds r4, 0x3E ldrb r0, [r4] orrs r0, r6 @@ -245279,7 +245318,7 @@ sub_808D77C: ; 808D77C ldr r0, [r4, 0x4] cmp r0, 0 beq @0808D7FE - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 beq @0808D7A8 @@ -245289,7 +245328,7 @@ sub_808D77C: ; 808D77C b @0808D7CA .pool @0808D7A8: - bl sub_81D6074 + bl InTrainerHill cmp r0, 0 beq @0808D7C6 movs r6, 0x2 @@ -246056,8 +246095,9 @@ MakeObjectTemplateFromFieldObjectTemplate: ; 808DD50 bx r0 thumb_func_end MakeObjectTemplateFromFieldObjectTemplate - thumb_func_start sub_808DD68 -sub_808DD68: ; 808DD68 + thumb_func_start AddPseudoFieldObject +; void AddPseudoFieldObject(u8 graphicsId, void ( *callback)(), u16 x, u16 y, u8 subpriority) +AddPseudoFieldObject: ; 808DD68 push {r4-r7,lr} mov r7, r9 mov r6, r8 @@ -246132,7 +246172,7 @@ sub_808DD68: ; 808DD68 pop {r1} bx r1 .pool - thumb_func_end sub_808DD68 + thumb_func_end AddPseudoFieldObject thumb_func_start sprite_new sprite_new: ; 808DE0C @@ -246348,7 +246388,7 @@ SpawnFieldObjectsInView: ; 808DF80 lsls r0, 16 lsrs r0, 16 mov r10, r0 - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 beq @0808DFE0 @@ -246358,7 +246398,7 @@ SpawnFieldObjectsInView: ; 808DF80 b @0808DFF0 .pool @0808DFE0: - bl sub_81D6074 + bl InTrainerHill cmp r0, 0 beq @0808DFEC movs r6, 0x2 @@ -247166,7 +247206,7 @@ get_berry_tree_graphics: ; 808E5F4 orrs r0, r1 strb r0, [r4] ldrb r0, [r5, 0x1D] - bl get_berry_tree_stage + bl GetStageByBerryTreeId lsls r0, 24 lsrs r6, r0, 24 cmp r6, 0 @@ -247182,7 +247222,7 @@ get_berry_tree_graphics: ; 808E5F4 ands r0, r1 strb r0, [r4] ldrb r0, [r5, 0x1D] - bl get_berry_tree_type + bl GetBerryTypeByBerryTreeId subs r0, 0x1 lsls r0, 24 lsrs r4, r0, 24 @@ -249318,8 +249358,9 @@ sub_808F564: ; 808F564 bx r1 thumb_func_end sub_808F564 - thumb_func_start npc_is_trainer_and_within_sight_distance_blocks_of_player -npc_is_trainer_and_within_sight_distance_blocks_of_player: ; 808F58C + thumb_func_start FieldObjectIsTrainerAndCloseToPlayer +; BOOL FieldObjectIsTrainerAndCloseToPlayer(struct npc_state *fieldObject) +FieldObjectIsTrainerAndCloseToPlayer: ; 808F58C push {r4-r7,lr} sub sp, 0x4 adds r5, r0, 0 @@ -249383,7 +249424,7 @@ npc_is_trainer_and_within_sight_distance_blocks_of_player: ; 808F58C pop {r4-r7} pop {r1} bx r1 - thumb_func_end npc_is_trainer_and_within_sight_distance_blocks_of_player + thumb_func_end FieldObjectIsTrainerAndCloseToPlayer thumb_func_start sub_808F608 sub_808F608: ; 808F608 @@ -249781,7 +249822,7 @@ sub_808F8BC: ; 808F8BC adds r4, r0, 0 lsls r1, 24 lsrs r6, r1, 24 - bl npc_is_trainer_and_within_sight_distance_blocks_of_player + bl FieldObjectIsTrainerAndCloseToPlayer lsls r0, 24 cmp r0, 0 bne @0808F8D4 @@ -249967,7 +250008,7 @@ sub_808FA0C: ; 808FA0C cmp r0, 0 bne @0808FA2A adds r0, r4, 0 - bl npc_is_trainer_and_within_sight_distance_blocks_of_player + bl FieldObjectIsTrainerAndCloseToPlayer lsls r0, 24 cmp r0, 0 beq @0808FA32 @@ -250590,6 +250631,7 @@ FieldObjectCB2_BerryTree: ; 808FE70 thumb_func_end FieldObjectCB2_BerryTree thumb_func_start do_berry_tree_growth_sparkle_1 +; BOOL do_berry_tree_growth_sparkle_1(struct npc_state *fieldObject, struct obj *object) do_berry_tree_growth_sparkle_1: ; 808FE90 push {r4-r7,lr} adds r4, r0, 0 @@ -250606,7 +250648,7 @@ do_berry_tree_growth_sparkle_1: ; 808FE90 orrs r0, r1 strb r0, [r6] ldrb r0, [r4, 0x1D] - bl get_berry_tree_stage + bl GetStageByBerryTreeId lsls r0, 24 lsrs r7, r0, 24 cmp r7, 0 @@ -250683,6 +250725,7 @@ do_berry_tree_growth_sparkle_1: ; 808FE90 thumb_func_end do_berry_tree_growth_sparkle_1 thumb_func_start sub_808FF48 +; BOOL sub_808FF48(struct npc_state *fieldObject, struct obj *object) sub_808FF48: ; 808FF48 push {r4,lr} adds r4, r1, 0 @@ -250703,6 +250746,7 @@ sub_808FF48: ; 808FF48 thumb_func_end sub_808FF48 thumb_func_start do_berry_tree_growth_sparkle_2 +; BOOL do_berry_tree_growth_sparkle_2(struct npc_state *fieldObject, struct obj *object) do_berry_tree_growth_sparkle_2: ; 808FF68 push {r4,lr} ldrb r2, [r0] @@ -250743,6 +250787,7 @@ do_berry_tree_growth_sparkle_2: ; 808FF68 thumb_func_end do_berry_tree_growth_sparkle_2 thumb_func_start sub_808FFB4 +; BOOL sub_808FFB4(struct npc_state *fieldObject, struct obj *object) sub_808FFB4: ; 808FFB4 push {r4,lr} adds r3, r0, 0 @@ -250788,6 +250833,7 @@ sub_808FFB4: ; 808FFB4 thumb_func_end sub_808FFB4 thumb_func_start sub_8090004 +; BOOL sub_8090004(struct npc_state *fieldObject, struct obj *object) sub_8090004: ; 8090004 push {r4,lr} adds r4, r1, 0 @@ -250946,7 +250992,7 @@ sub_8090118: ; 8090118 cmp r0, 0 bne @08090136 adds r0, r4, 0 - bl npc_is_trainer_and_within_sight_distance_blocks_of_player + bl FieldObjectIsTrainerAndCloseToPlayer lsls r0, 24 cmp r0, 0 beq @0809013E @@ -251114,7 +251160,7 @@ sub_8090258: ; 8090258 cmp r0, 0 bne @08090276 adds r0, r4, 0 - bl npc_is_trainer_and_within_sight_distance_blocks_of_player + bl FieldObjectIsTrainerAndCloseToPlayer lsls r0, 24 cmp r0, 0 beq @0809027E @@ -251282,7 +251328,7 @@ sub_8090398: ; 8090398 cmp r0, 0 bne @080903B6 adds r0, r4, 0 - bl npc_is_trainer_and_within_sight_distance_blocks_of_player + bl FieldObjectIsTrainerAndCloseToPlayer lsls r0, 24 cmp r0, 0 beq @080903BE @@ -251450,7 +251496,7 @@ sub_80904D8: ; 80904D8 cmp r0, 0 bne @080904F6 adds r0, r4, 0 - bl npc_is_trainer_and_within_sight_distance_blocks_of_player + bl FieldObjectIsTrainerAndCloseToPlayer lsls r0, 24 cmp r0, 0 beq @080904FE @@ -251618,7 +251664,7 @@ sub_8090618: ; 8090618 cmp r0, 0 bne @08090636 adds r0, r4, 0 - bl npc_is_trainer_and_within_sight_distance_blocks_of_player + bl FieldObjectIsTrainerAndCloseToPlayer lsls r0, 24 cmp r0, 0 beq @0809063E @@ -251786,7 +251832,7 @@ sub_8090758: ; 8090758 cmp r0, 0 bne @08090776 adds r0, r4, 0 - bl npc_is_trainer_and_within_sight_distance_blocks_of_player + bl FieldObjectIsTrainerAndCloseToPlayer lsls r0, 24 cmp r0, 0 beq @0809077E @@ -251954,7 +252000,7 @@ sub_8090898: ; 8090898 cmp r0, 0 bne @080908B6 adds r0, r4, 0 - bl npc_is_trainer_and_within_sight_distance_blocks_of_player + bl FieldObjectIsTrainerAndCloseToPlayer lsls r0, 24 cmp r0, 0 beq @080908BE @@ -252122,7 +252168,7 @@ sub_80909D8: ; 80909D8 cmp r0, 0 bne @080909F6 adds r0, r4, 0 - bl npc_is_trainer_and_within_sight_distance_blocks_of_player + bl FieldObjectIsTrainerAndCloseToPlayer lsls r0, 24 cmp r0, 0 beq @080909FE @@ -252290,7 +252336,7 @@ sub_8090B18: ; 8090B18 cmp r0, 0 bne @08090B36 adds r0, r4, 0 - bl npc_is_trainer_and_within_sight_distance_blocks_of_player + bl FieldObjectIsTrainerAndCloseToPlayer lsls r0, 24 cmp r0, 0 beq @08090B3E @@ -252458,7 +252504,7 @@ sub_8090C58: ; 8090C58 cmp r0, 0 bne @08090C76 adds r0, r4, 0 - bl npc_is_trainer_and_within_sight_distance_blocks_of_player + bl FieldObjectIsTrainerAndCloseToPlayer lsls r0, 24 cmp r0, 0 beq @08090C7E @@ -252600,7 +252646,7 @@ sub_8090D64: ; 8090D64 cmp r0, 0 bne @08090D82 adds r0, r4, 0 - bl npc_is_trainer_and_within_sight_distance_blocks_of_player + bl FieldObjectIsTrainerAndCloseToPlayer lsls r0, 24 cmp r0, 0 beq @08090D86 @@ -252740,7 +252786,7 @@ sub_8090E68: ; 8090E68 cmp r0, 0 bne @08090E86 adds r0, r4, 0 - bl npc_is_trainer_and_within_sight_distance_blocks_of_player + bl FieldObjectIsTrainerAndCloseToPlayer lsls r0, 24 cmp r0, 0 beq @08090E8A @@ -255122,7 +255168,7 @@ sub_8091F94: ; 8091F94 ldrsh r0, [r0, r2] movs r2, 0 ldrsh r1, [r6, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 bl _call_via_r8 @@ -255210,7 +255256,7 @@ sub_80920A4: ; 80920A4 ldrsh r0, [r0, r2] movs r2, 0 ldrsh r1, [r5, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 bl _call_via_r8 @@ -255298,7 +255344,7 @@ sub_809215C: ; 809215C ldrsh r0, [r0, r2] movs r2, 0 ldrsh r1, [r5, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 bl _call_via_r8 @@ -255386,7 +255432,7 @@ sub_8092214: ; 8092214 ldrsh r0, [r0, r2] movs r2, 0 ldrsh r1, [r5, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 bl _call_via_r8 @@ -255509,7 +255555,7 @@ sub_8092314: ; 8092314 ldrsh r0, [r0, r2] movs r2, 0 ldrsh r1, [r5, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 bl _call_via_r8 @@ -255604,7 +255650,7 @@ oac_hopping: ; 80923CC ldrsh r0, [r0, r2] movs r2, 0 ldrsh r1, [r5, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 bl _call_via_r8 @@ -256968,7 +257014,7 @@ IsMetatileDirectionallyImpassable: ; 8092DC8 asrs r0, 16 lsls r1, r7, 16 asrs r1, 16 - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 ldr r1, [r4] @@ -262901,7 +262947,7 @@ sub_8095740: ; 8095740 strb r0, [r2] adds r0, r4, 0 movs r1, 0 - bl sub_8008284 + bl StartObjectRotScalAnimIfDifferent adds r0, r5, 0 adds r1, r4, 0 bl sub_8095774 @@ -265152,13 +265198,13 @@ FieldObjectUpdateMetatileBehaviors: ; 8096728 ldrsh r0, [r4, r1] movs r2, 0x16 ldrsh r1, [r4, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt strb r0, [r4, 0x1F] movs r1, 0x10 ldrsh r0, [r4, r1] movs r2, 0x12 ldrsh r1, [r4, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt strb r0, [r4, 0x1E] pop {r4} pop {r0} @@ -265678,7 +265724,7 @@ FieldObjectCheckForReflectiveSurface: ; 8096A8C lsls r4, 16 asrs r6, r4, 16 adds r1, r6 - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 bl GetReflectionTypeByMetatileBehavior @@ -265693,7 +265739,7 @@ FieldObjectCheckForReflectiveSurface: ; 8096A8C ldrsh r1, [r5, r2] add r1, r10 adds r1, r6 - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 bl GetReflectionTypeByMetatileBehavior @@ -265721,7 +265767,7 @@ FieldObjectCheckForReflectiveSurface: ; 8096A8C ldrsh r1, [r5, r2] adds r1, r7 adds r1, r6 - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 bl GetReflectionTypeByMetatileBehavior @@ -265736,7 +265782,7 @@ FieldObjectCheckForReflectiveSurface: ; 8096A8C ldrsh r1, [r5, r2] adds r1, r7 adds r1, r6 - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 bl GetReflectionTypeByMetatileBehavior @@ -265751,7 +265797,7 @@ FieldObjectCheckForReflectiveSurface: ; 8096A8C ldrsh r1, [r5, r2] adds r1, r7 adds r1, r6 - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 bl GetReflectionTypeByMetatileBehavior @@ -265766,7 +265812,7 @@ FieldObjectCheckForReflectiveSurface: ; 8096A8C ldrsh r1, [r5, r2] adds r1, r7 adds r1, r6 - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 bl GetReflectionTypeByMetatileBehavior @@ -265856,7 +265902,7 @@ GetLedgeJumpDirection: ; 8096C0C asrs r0, 16 lsls r1, 16 asrs r1, 16 - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 ldr r2, =gUnknown_0850E614 @@ -269053,7 +269099,7 @@ textbox_fdecode_auto_and_task_add: ; 80982DC lsls r4, 24 lsrs r4, 24 adds r0, r4, 0 - bl get_map_name + bl AddTextPrinterForMessage bl task_add_textbox pop {r4} pop {r0} @@ -269065,7 +269111,7 @@ textbox_fdecode_auto_and_task_add: ; 80982DC textbox_auto_and_task_add: ; 8098304 push {lr} movs r0, 0x1 - bl get_map_name + bl AddTextPrinterForMessage bl task_add_textbox pop {r0} bx r0 @@ -270564,6 +270610,7 @@ script_env_2_enable: ; 8098E54 thumb_func_end script_env_2_enable thumb_func_start script_env_2_disable +; void script_env_2_disable() script_env_2_disable: ; 8098E60 ldr r1, =0x03000f2c movs r0, 0 @@ -274574,8 +274621,8 @@ s6E_yes_no: ; 809ACD4 bx r1 thumb_func_end s6E_yes_no - thumb_func_start sub_809AD00 -sub_809AD00: ; 809AD00 + thumb_func_start s6F_multichoice +s6F_multichoice: ; 809AD00 push {r4,r5,lr} ldr r2, [r0, 0x8] ldrb r5, [r2] @@ -274591,7 +274638,7 @@ sub_809AD00: ; 809AD00 adds r4, 0x1 str r4, [r0, 0x8] adds r0, r5, 0 - bl sub_80E1E08 + bl Multichoice lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -274605,7 +274652,7 @@ sub_809AD00: ; 809AD00 pop {r4,r5} pop {r1} bx r1 - thumb_func_end sub_809AD00 + thumb_func_end s6F_multichoice thumb_func_start sub_809AD3C sub_809AD3C: ; 809AD3C @@ -275670,12 +275717,12 @@ sub_809B578: ; 809B578 ldrb r4, [r1] adds r1, 0x1 str r1, [r0, 0x8] - bl sub_8145C30 + bl GetCoins lsls r0, 16 lsrs r0, 16 adds r1, r5, 0 adds r2, r4, 0 - bl sub_8145BAC + bl ShowCoinsWindow movs r0, 0 pop {r4,r5} pop {r1} @@ -275688,7 +275735,7 @@ sC1_hide_coins: ; 809B5A0 ldr r1, [r0, 0x8] adds r1, 0x2 str r1, [r0, 0x8] - bl sub_8145C14 + bl HideCoinsWindow movs r0, 0 pop {r1} bx r1 @@ -275700,10 +275747,10 @@ sC2_update_coins: ; 809B5B4 ldr r1, [r0, 0x8] adds r1, 0x2 str r1, [r0, 0x8] - bl sub_8145C30 + bl GetCoins lsls r0, 16 lsrs r0, 16 - bl sub_8145B54 + bl PrintCoinsString movs r0, 0 pop {r1} bx r1 @@ -275714,7 +275761,7 @@ s5C_trainer_battle_configure_and_start: ; 809B5D0 push {r4,lr} adds r4, r0, 0 ldr r0, [r4, 0x8] - bl battle_configure_by_script + bl TrainerBattleConfigure str r0, [r4, 0x8] movs r0, 0 pop {r4} @@ -275744,6 +275791,7 @@ sub_809B5F0: ; 809B5F0 thumb_func_end sub_809B5F0 thumb_func_start sub_809B604 +; BOOL sub_809B604(struct script_env *env) sub_809B604: ; 809B604 push {r4,lr} adds r4, r0, 0 @@ -275890,8 +275938,9 @@ s89_open_casino_game1: ; 809B6F4 .pool thumb_func_end s89_open_casino_game1 - thumb_func_start sub_809B71C -sub_809B71C: ; 809B71C + thumb_func_start berry_script_cmd +; BOOL berry_script_cmd(struct script_env *env) +berry_script_cmd: ; 809B71C push {r4,r5,lr} ldr r1, [r0, 0x8] ldrb r5, [r1] @@ -275909,20 +275958,20 @@ sub_809B71C: ; 809B71C movs r1, 0 adds r2, r4, 0 movs r3, 0 - bl sub_80E191C + bl PlantBerryTree b @0809B750 @0809B744: adds r0, r5, 0 adds r1, r3, 0 adds r2, r4, 0 movs r3, 0 - bl sub_80E191C + bl PlantBerryTree @0809B750: movs r0, 0 pop {r4,r5} pop {r1} bx r1 - thumb_func_end sub_809B71C + thumb_func_end berry_script_cmd thumb_func_start sub_809B758 sub_809B758: ; 809B758 @@ -276177,7 +276226,7 @@ sA2_setmaptile: ; 809B8F0 adds r0, r6, 0 adds r1, r5, 0 adds r2, r7, 0 - bl setmaptile_0 + bl MapGridSetMetatileIdAt b @0809B966 @0809B954: movs r1, 0xC0 @@ -276187,7 +276236,7 @@ sA2_setmaptile: ; 809B8F0 orrs r2, r0 adds r0, r6, 0 adds r1, r5, 0 - bl setmaptile_0 + bl MapGridSetMetatileIdAt @0809B966: movs r0, 0 pop {r4-r7} @@ -276403,7 +276452,7 @@ sB3_get_coin_amount: ; 809BB00 lsrs r0, 16 bl GetVarPointer adds r4, r0, 0 - bl sub_8145C30 + bl GetCoins strh r0, [r4] movs r0, 0 pop {r4} @@ -276420,7 +276469,7 @@ sub_809BB20: ; 809BB20 bl VarGet lsls r0, 16 lsrs r0, 16 - bl sub_8145C80 + bl AddCoins lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -276449,7 +276498,7 @@ sub_809BB58: ; 809BB58 bl VarGet lsls r0, 16 lsrs r0, 16 - bl sub_8145CCC + bl SubtractCoins lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -276496,8 +276545,8 @@ sub_809BBB4: ; 809BBB4 bx r1 thumb_func_end sub_809BBB4 - thumb_func_start sub_809BBC0 -sub_809BBC0: ; 809BBC0 + thumb_func_start ScrCmd_MossdeepGymSwitch +ScrCmd_MossdeepGymSwitch: ; 809BBC0 push {lr} bl script_read_halfword lsls r0, 16 @@ -276509,7 +276558,7 @@ sub_809BBC0: ; 809BBC0 movs r0, 0 pop {r1} bx r1 - thumb_func_end sub_809BBC0 + thumb_func_end ScrCmd_MossdeepGymSwitch thumb_func_start sub_809BBDC sub_809BBDC: ; 809BBDC @@ -277081,10 +277130,10 @@ sub_809C014: ; 809C014 ldrsh r0, [r0, r1] movs r2, 0x2 ldrsh r1, [r4, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 16 lsrs r4, r0, 16 - bl unknown__trainer_related + bl CheckForTrainersWantingBattle lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -277157,7 +277206,7 @@ sub_809C014: ; 809C014 ldrsh r0, [r0, r1] movs r2, 0x2 ldrsh r1, [r4, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 16 lsrs r4, r0, 16 ldrb r1, [r5] @@ -277217,7 +277266,7 @@ sub_809C014: ; 809C014 ands r0, r1 cmp r0, 0 beq @0809C170 - bl sub_81AD520 + bl UseRegisteredKeyItemOnField lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -277250,7 +277299,7 @@ player_get_next_pos_and_height: ; 809C194 sub sp, 0x4 adds r5, r0, 0 adds r1, r5, 0x2 - bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + bl GetXYCoordsOneStepInFrontOfPlayer mov r4, sp adds r4, 0x2 mov r0, sp @@ -277289,7 +277338,7 @@ cur_mapdata_block_role_at_player_pos: ; 809C1D0 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r4, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 16 lsrs r0, 16 add sp, 0x4 @@ -277400,7 +277449,7 @@ sub_809C2C8: ; 809C2C8 ldrsh r0, [r4, r1] movs r2, 0x2 ldrsh r1, [r4, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 bl MetatileBehavior_IsCounter @@ -277557,7 +277606,7 @@ TryGetMapObjectScript: ; 809C384 strh r0, [r1] ldr r0, =0x020375f4 strh r7, [r0] - bl sub_81D6074 + bl InTrainerHill cmp r0, 0x1 bne @0809C43C bl sub_81D62AC @@ -277702,7 +277751,7 @@ TryGetMetatileBehaviorScript: ; 809C538 .pool @0809C55C: adds r0, r5, 0 - bl IsMetatileComputer + bl MetatileBehavior_IsPC lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -277873,7 +277922,7 @@ TryGetMetatileBehaviorScript: ; 809C538 .pool @0809C6EC: adds r0, r5, 0 - bl is_tile_x8F + bl MetatileBehavior_IsQuestionnaire lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -277883,7 +277932,7 @@ TryGetMetatileBehaviorScript: ; 809C538 .pool @0809C704: adds r0, r5, 0 - bl sub_8089B44 + bl MetatileBehavior_IsTrainerHillTimer lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -278223,7 +278272,7 @@ sub_809C96C: ; 809C96C ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r4, r2] - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt lsls r0, 16 asrs r0, 16 bl sub_80FA970 @@ -278241,7 +278290,7 @@ per_step_scripts: ; 809C9F4 push {r4,lr} lsls r0, 16 lsrs r4, r0, 16 - bl in_trade_center + bl InUnionRoom cmp r0, 0x1 bne @0809CA04 b @0809CB24 @@ -278824,7 +278873,7 @@ sub_809CEB0: ; 809CEB0 adds r7, r2, 0 lsls r1, 24 lsrs r4, r1, 24 - bl sub_81D609C + bl GetCurrentTrainerHillMapId lsls r0, 24 lsrs r5, r0, 24 adds r6, r5, 0 @@ -279267,7 +279316,7 @@ sub_809D1E8: ; 809D1E8 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r4, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r5, r0, 24 ldr r0, =0x02037318 @@ -279328,8 +279377,9 @@ sub_809D1E8: ; 809D1E8 bx r1 thumb_func_end sub_809D1E8 - thumb_func_start sub_809D280 -sub_809D280: ; 809D280 + thumb_func_start GetFieldObjectScriptPointerForComparison +; u8 *GetFieldObjectScriptPointerForComparison() +GetFieldObjectScriptPointerForComparison: ; 809D280 push {r4,r5,lr} sub sp, 0x8 bl player_get_direction_upper_nybble @@ -279344,7 +279394,7 @@ sub_809D280: ; 809D280 ldrsh r0, [r0, r1] movs r2, 0x2 ldrsh r1, [r5, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -279355,7 +279405,7 @@ sub_809D280: ; 809D280 pop {r4,r5} pop {r1} bx r1 - thumb_func_end sub_809D280 + thumb_func_end GetFieldObjectScriptPointerForComparison thumb_func_start sub_809D2BC sub_809D2BC: ; 809D2BC @@ -279370,7 +279420,7 @@ sub_809D2BC: ; 809D2BC ldrsh r0, [r0, r1] movs r2, 0x2 ldrsh r1, [r4, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt ldr r4, =0x02037318 adds r0, r4, 0 mov r1, sp @@ -280364,7 +280414,7 @@ sub_809DA88: ; 809DA88 asrs r7, r2, 16 adds r0, r6, 0 adds r1, r7, 0 - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 @@ -280381,7 +280431,7 @@ sub_809DA88: ; 809DA88 ldrsb r1, [r4, r1] adds r1, r7, r1 ldrh r2, [r4, 0x2] - bl setmaptile_0 + bl MapGridSetMetatileIdAt mov r0, r8 cmp r0, 0 beq @0809DADE @@ -280391,7 +280441,7 @@ sub_809DA88: ; 809DA88 movs r1, 0x1 ldrsb r1, [r4, r1] adds r1, r7, r1 - bl cur_mapdata_draw_block_at + bl CurrentMapDrawMetatileAt @0809DADE: movs r0, 0x4 ldrsb r0, [r5, r0] @@ -280400,7 +280450,7 @@ sub_809DA88: ; 809DA88 ldrsb r1, [r5, r1] adds r1, r7, r1 ldrh r2, [r5, 0x6] - bl setmaptile_0 + bl MapGridSetMetatileIdAt mov r0, r8 cmp r0, 0 beq @0809DB06 @@ -280410,7 +280460,7 @@ sub_809DA88: ; 809DA88 movs r1, 0x5 ldrsb r1, [r5, r1] adds r1, r7, r1 - bl cur_mapdata_draw_block_at + bl CurrentMapDrawMetatileAt @0809DB06: pop {r3} mov r8, r3 @@ -280499,7 +280549,7 @@ sub_809DB7C: ; 809DB7C asrs r5, r3, 16 adds r0, r6, 0 adds r1, r5, 0 - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 @@ -280581,7 +280631,7 @@ sub_809DC18: ; 809DC18 asrs r5, r1, 16 adds r0, r6, 0 adds r1, r5, 0 - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 @@ -280778,7 +280828,7 @@ sub_809DCB4: ; 809DCB4 ldrsh r0, [r0, r3] movs r5, 0 ldrsh r1, [r6, r5] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 bl MetatileBehavior_IsPacifidlogLog @@ -280848,7 +280898,7 @@ sub_809DE28: ; 809DE28 asrs r5, r0, 16 adds r0, r4, 0 adds r1, r5, 0 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt adds r1, r0, 0 ldr r0, =0x0000024e cmp r1, r0 @@ -280862,14 +280912,14 @@ sub_809DE28: ; 809DE28 ldr r2, =0x0000024f adds r0, r4, 0 adds r1, r5, 0 - bl setmaptile_0 + bl MapGridSetMetatileIdAt b @0809DE82 .pool @0809DE78: ldr r2, =0x00000257 adds r0, r4, 0 adds r1, r5, 0 - bl setmaptile_0 + bl MapGridSetMetatileIdAt @0809DE82: pop {r4,r5} pop {r0} @@ -280897,7 +280947,7 @@ sub_809DE8C: ; 809DE8C asrs r5, r0, 16 adds r0, r4, 0 adds r1, r5, 0 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt adds r1, r0, 0 ldr r0, =0x0000024f cmp r1, r0 @@ -280911,14 +280961,14 @@ sub_809DE8C: ; 809DE8C ldr r2, =0x0000024e adds r0, r4, 0 adds r1, r5, 0 - bl setmaptile_0 + bl MapGridSetMetatileIdAt b @0809DEE6 .pool @0809DEDC: ldr r2, =0x00000256 adds r0, r4, 0 adds r1, r5, 0 - bl setmaptile_0 + bl MapGridSetMetatileIdAt @0809DEE6: pop {r4,r5} pop {r0} @@ -280975,7 +281025,7 @@ sub_809DEF0: ; 809DEF0 ldrsh r0, [r0, r2] movs r3, 0 ldrsh r1, [r1, r3] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 bl MetatileBehavior_IsFortreeBridge @@ -280997,7 +281047,7 @@ sub_809DEF0: ; 809DEF0 mov r2, r9 movs r3, 0 ldrsh r1, [r2, r3] - bl cur_mapdata_draw_block_at + bl CurrentMapDrawMetatileAt b @0809E0F2 @0809DF84: ldrh r0, [r6, 0x6] @@ -281027,7 +281077,7 @@ sub_809DEF0: ; 809DEF0 mov r2, r9 movs r3, 0 ldrsh r1, [r2, r3] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 bl MetatileBehavior_IsFortreeBridge @@ -281038,7 +281088,7 @@ sub_809DEF0: ; 809DEF0 lsls r4, r0, 16 asrs r1, r4, 16 adds r0, r7, 0 - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 bl MetatileBehavior_IsFortreeBridge @@ -281075,7 +281125,7 @@ sub_809DEF0: ; 809DEF0 bl sub_809DE8C adds r0, r4, 0 adds r1, r5, 0 - bl cur_mapdata_draw_block_at + bl CurrentMapDrawMetatileAt mov r0, sp movs r3, 0 ldrsh r0, [r0, r3] @@ -281089,7 +281139,7 @@ sub_809DEF0: ; 809DEF0 mov r2, r9 movs r3, 0 ldrsh r1, [r2, r3] - bl cur_mapdata_draw_block_at + bl CurrentMapDrawMetatileAt @0809E044: mov r0, r10 strh r0, [r6, 0x8] @@ -281146,7 +281196,7 @@ sub_809DEF0: ; 809DEF0 mov r3, r8 lsls r1, r3, 16 asrs r1, 16 - bl cur_mapdata_draw_block_at + bl CurrentMapDrawMetatileAt b @0809E0EA @0809E0C6: mov r0, r10 @@ -281160,7 +281210,7 @@ sub_809DEF0: ; 809DEF0 bl sub_809DE28 adds r0, r5, 0 adds r1, r4, 0 - bl cur_mapdata_draw_block_at + bl CurrentMapDrawMetatileAt adds r0, r5, 0 adds r1, r4, 0 bl sub_809DE8C @@ -281315,7 +281365,7 @@ sub_809E1C8: ; 809E1C8 adds r1, r4, 0x7 adds r0, r5, 0x7 ldr r2, =0x0000020e - bl setmaptile_0 + bl MapGridSetMetatileIdAt @0809E204: adds r4, 0x1 cmp r4, r7 @@ -281405,7 +281455,7 @@ sub_809E224: ; 809E224 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r7, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 @@ -281469,13 +281519,13 @@ sub_809E224: ; 809E224 movs r2, 0 ldrsh r1, [r4, r2] ldr r2, =0x0000020e - bl setmaptile_0 + bl MapGridSetMetatileIdAt mov r0, sp movs r3, 0 ldrsh r0, [r0, r3] movs r2, 0 ldrsh r1, [r4, r2] - bl cur_mapdata_draw_block_at + bl CurrentMapDrawMetatileAt mov r0, sp ldrh r0, [r0] subs r0, 0x7 @@ -281514,13 +281564,13 @@ sub_809E224: ; 809E224 movs r2, 0 ldrsh r1, [r4, r2] ldr r2, =0x00000206 - bl setmaptile_0 + bl MapGridSetMetatileIdAt mov r0, sp movs r3, 0 ldrsh r0, [r0, r3] movs r2, 0 ldrsh r1, [r4, r2] - bl cur_mapdata_draw_block_at + bl CurrentMapDrawMetatileAt @0809E3A2: movs r0, 0x1 strh r0, [r5, 0x2] @@ -281571,7 +281621,7 @@ sub_809E3B4: ; 809E3B4 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r4, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 bl MetatileBehavior_IsAsh @@ -281583,7 +281633,7 @@ sub_809E3B4: ; 809E3B4 ldrsh r0, [r0, r3] movs r2, 0 ldrsh r1, [r4, r2] - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt ldr r1, =0x0000020a cmp r0, r1 bne @0809E444 @@ -281640,7 +281690,7 @@ sub_809E490: ; 809E490 asrs r4, r1, 16 adds r0, r5, 0 adds r1, r4, 0 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt ldr r1, =0x0000022f ldr r2, =0x00000237 cmp r0, r1 @@ -281649,10 +281699,10 @@ sub_809E490: ; 809E490 @0809E4AC: adds r0, r5, 0 adds r1, r4, 0 - bl setmaptile_0 + bl MapGridSetMetatileIdAt adds r0, r5, 0 adds r1, r4, 0 - bl cur_mapdata_draw_block_at + bl CurrentMapDrawMetatileAt pop {r4,r5} pop {r0} bx r0 @@ -281680,7 +281730,7 @@ sub_809E4CC: ; 809E4CC ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r4, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 16 lsrs r6, r0, 16 ldrh r1, [r5, 0x8] @@ -281827,14 +281877,14 @@ sub_809E5DC: ; 809E5DC asrs r4, 16 adds r0, r5, 0 adds r1, r4, 0 - bl setmaptile_0 + bl MapGridSetMetatileIdAt adds r0, r5, 0 adds r1, r4, 0 - bl cur_mapdata_draw_block_at + bl CurrentMapDrawMetatileAt adds r0, r5, 0 adds r1, r4, 0 movs r2, 0xE8 - bl setmaptile_0 + bl MapGridSetMetatileIdAt pop {r4,r5} pop {r0} bx r0 @@ -281927,7 +281977,7 @@ sub_809E638: ; 809E638 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r5, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 bl MetatileBehavior_IsMuddySlope @@ -282135,7 +282185,7 @@ sub_809E858: ; 809E858 beq @0809E8A8 cmp r0, 0 blt @0809E8A8 - bl sub_80E1870 + bl BerryTreeTimeUpdate ldr r2, [r6] adds r2, 0xA0 ldr r0, [r5] @@ -283508,8 +283558,8 @@ sub_809F41C: ; 809F41C .pool thumb_func_end sub_809F41C - thumb_func_start start_menu_compose -start_menu_compose: ; 809F440 + thumb_func_start BuildStartMenuActions +BuildStartMenuActions: ; 809F440 push {lr} ldr r0, =0x0203760f movs r1, 0 @@ -283517,51 +283567,52 @@ start_menu_compose: ; 809F440 bl is_c1_link_related_active cmp r0, 0x1 bne @0809F45C - bl sub_809F568 + bl BuildStartMenuActions_LinkMode b @0809F4AC .pool @0809F45C: - bl in_trade_center + bl InUnionRoom cmp r0, 0x1 bne @0809F46A - bl sub_809F5A4 + bl BuildStartMenuActions_UnionRoom b @0809F4AC @0809F46A: - bl flag_check_is_in_safari_zone + bl GetSafariZoneFlag cmp r0, 0x1 bne @0809F478 - bl sub_809F538 + bl BuildStartMenuActions_SafariZone b @0809F4AC @0809F478: - bl sub_81A80A8 + bl InBattlePike lsls r0, 24 cmp r0, 0 beq @0809F488 - bl sub_809F5E0 + bl BuildStartMenuActions_BattlePike b @0809F4AC @0809F488: - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 beq @0809F498 - bl sub_809F604 + bl BuildStartMenuActions_BattlePyramid b @0809F4AC @0809F498: - bl sub_813994C + bl in_multi_battle_room_with_var_condition lsls r0, 24 cmp r0, 0 beq @0809F4A8 - bl sub_809F634 + bl BuildStartMenuActions_MultiBattleRoom b @0809F4AC @0809F4A8: - bl sub_809F4CC + bl BuildStartMenuActions_Normal @0809F4AC: pop {r0} bx r0 - thumb_func_end start_menu_compose + thumb_func_end BuildStartMenuActions - thumb_func_start sub_809F4B0 -sub_809F4B0: ; 809F4B0 + thumb_func_start AddStartMenuAction +; void AddStartMenuAction(u8 entry) +AddStartMenuAction: ; 809F4B0 push {lr} adds r2, r0, 0 lsls r2, 24 @@ -283572,10 +283623,10 @@ sub_809F4B0: ; 809F4B0 pop {r0} bx r0 .pool - thumb_func_end sub_809F4B0 + thumb_func_end AddStartMenuAction - thumb_func_start sub_809F4CC -sub_809F4CC: ; 809F4CC + thumb_func_start BuildStartMenuActions_Normal +BuildStartMenuActions_Normal: ; 809F4CC push {lr} ldr r0, =0x00000861 bl FlagGet @@ -283584,7 +283635,7 @@ sub_809F4CC: ; 809F4CC cmp r0, 0x1 bne @0809F4E2 movs r0, 0 - bl sub_809F4B0 + bl AddStartMenuAction @0809F4E2: movs r0, 0x86 lsls r0, 4 @@ -283594,10 +283645,10 @@ sub_809F4CC: ; 809F4CC cmp r0, 0x1 bne @0809F4F8 movs r0, 0x1 - bl sub_809F4B0 + bl AddStartMenuAction @0809F4F8: movs r0, 0x2 - bl sub_809F4B0 + bl AddStartMenuAction ldr r0, =0x00000862 bl FlagGet lsls r0, 24 @@ -283605,49 +283656,49 @@ sub_809F4CC: ; 809F4CC cmp r0, 0x1 bne @0809F512 movs r0, 0x3 - bl sub_809F4B0 + bl AddStartMenuAction @0809F512: movs r0, 0x4 - bl sub_809F4B0 + bl AddStartMenuAction movs r0, 0x5 - bl sub_809F4B0 + bl AddStartMenuAction movs r0, 0x6 - bl sub_809F4B0 + bl AddStartMenuAction movs r0, 0x7 - bl sub_809F4B0 + bl AddStartMenuAction pop {r0} bx r0 .pool - thumb_func_end sub_809F4CC + thumb_func_end BuildStartMenuActions_Normal - thumb_func_start sub_809F538 -sub_809F538: ; 809F538 + thumb_func_start BuildStartMenuActions_SafariZone +BuildStartMenuActions_SafariZone: ; 809F538 push {lr} movs r0, 0x8 - bl sub_809F4B0 + bl AddStartMenuAction movs r0, 0 - bl sub_809F4B0 + bl AddStartMenuAction movs r0, 0x1 - bl sub_809F4B0 + bl AddStartMenuAction movs r0, 0x2 - bl sub_809F4B0 + bl AddStartMenuAction movs r0, 0x4 - bl sub_809F4B0 + bl AddStartMenuAction movs r0, 0x6 - bl sub_809F4B0 + bl AddStartMenuAction movs r0, 0x7 - bl sub_809F4B0 + bl AddStartMenuAction pop {r0} bx r0 - thumb_func_end sub_809F538 + thumb_func_end BuildStartMenuActions_SafariZone - thumb_func_start sub_809F568 -sub_809F568: ; 809F568 + thumb_func_start BuildStartMenuActions_LinkMode +BuildStartMenuActions_LinkMode: ; 809F568 push {lr} movs r0, 0x1 - bl sub_809F4B0 + bl AddStartMenuAction movs r0, 0x2 - bl sub_809F4B0 + bl AddStartMenuAction ldr r0, =0x00000862 bl FlagGet lsls r0, 24 @@ -283655,26 +283706,26 @@ sub_809F568: ; 809F568 cmp r0, 0x1 bne @0809F58A movs r0, 0x3 - bl sub_809F4B0 + bl AddStartMenuAction @0809F58A: movs r0, 0x9 - bl sub_809F4B0 + bl AddStartMenuAction movs r0, 0x6 - bl sub_809F4B0 + bl AddStartMenuAction movs r0, 0x7 - bl sub_809F4B0 + bl AddStartMenuAction pop {r0} bx r0 .pool - thumb_func_end sub_809F568 + thumb_func_end BuildStartMenuActions_LinkMode - thumb_func_start sub_809F5A4 -sub_809F5A4: ; 809F5A4 + thumb_func_start BuildStartMenuActions_UnionRoom +BuildStartMenuActions_UnionRoom: ; 809F5A4 push {lr} movs r0, 0x1 - bl sub_809F4B0 + bl AddStartMenuAction movs r0, 0x2 - bl sub_809F4B0 + bl AddStartMenuAction ldr r0, =0x00000862 bl FlagGet lsls r0, 24 @@ -283682,71 +283733,71 @@ sub_809F5A4: ; 809F5A4 cmp r0, 0x1 bne @0809F5C6 movs r0, 0x3 - bl sub_809F4B0 + bl AddStartMenuAction @0809F5C6: movs r0, 0x4 - bl sub_809F4B0 + bl AddStartMenuAction movs r0, 0x6 - bl sub_809F4B0 + bl AddStartMenuAction movs r0, 0x7 - bl sub_809F4B0 + bl AddStartMenuAction pop {r0} bx r0 .pool - thumb_func_end sub_809F5A4 + thumb_func_end BuildStartMenuActions_UnionRoom - thumb_func_start sub_809F5E0 -sub_809F5E0: ; 809F5E0 + thumb_func_start BuildStartMenuActions_BattlePike +BuildStartMenuActions_BattlePike: ; 809F5E0 push {lr} movs r0, 0 - bl sub_809F4B0 + bl AddStartMenuAction movs r0, 0x1 - bl sub_809F4B0 + bl AddStartMenuAction movs r0, 0x4 - bl sub_809F4B0 + bl AddStartMenuAction movs r0, 0x6 - bl sub_809F4B0 + bl AddStartMenuAction movs r0, 0x7 - bl sub_809F4B0 + bl AddStartMenuAction pop {r0} bx r0 - thumb_func_end sub_809F5E0 + thumb_func_end BuildStartMenuActions_BattlePike - thumb_func_start sub_809F604 -sub_809F604: ; 809F604 + thumb_func_start BuildStartMenuActions_BattlePyramid +BuildStartMenuActions_BattlePyramid: ; 809F604 push {lr} movs r0, 0x1 - bl sub_809F4B0 + bl AddStartMenuAction movs r0, 0xC - bl sub_809F4B0 + bl AddStartMenuAction movs r0, 0x4 - bl sub_809F4B0 + bl AddStartMenuAction movs r0, 0xA - bl sub_809F4B0 + bl AddStartMenuAction movs r0, 0xB - bl sub_809F4B0 + bl AddStartMenuAction movs r0, 0x6 - bl sub_809F4B0 + bl AddStartMenuAction movs r0, 0x7 - bl sub_809F4B0 + bl AddStartMenuAction pop {r0} bx r0 - thumb_func_end sub_809F604 + thumb_func_end BuildStartMenuActions_BattlePyramid - thumb_func_start sub_809F634 -sub_809F634: ; 809F634 + thumb_func_start BuildStartMenuActions_MultiBattleRoom +BuildStartMenuActions_MultiBattleRoom: ; 809F634 push {lr} movs r0, 0x1 - bl sub_809F4B0 + bl AddStartMenuAction movs r0, 0x4 - bl sub_809F4B0 + bl AddStartMenuAction movs r0, 0x6 - bl sub_809F4B0 + bl AddStartMenuAction movs r0, 0x7 - bl sub_809F4B0 + bl AddStartMenuAction pop {r0} bx r0 - thumb_func_end sub_809F634 + thumb_func_end BuildStartMenuActions_MultiBattleRoom thumb_func_start sub_809F654 sub_809F654: ; 809F654 @@ -283855,10 +283906,10 @@ sub_809F6C8: ; 809F6C8 .pool thumb_func_end sub_809F6C8 - thumb_func_start sub_809F774 -sub_809F774: ; 809F774 + thumb_func_start RemoveExtraStartMenuWindows +RemoveExtraStartMenuWindows: ; 809F774 push {r4,lr} - bl flag_check_is_in_safari_zone + bl GetSafariZoneFlag cmp r0, 0 beq @0809F796 ldr r4, =0x0203760c @@ -283871,7 +283922,7 @@ sub_809F774: ; 809F774 ldrb r0, [r4] bl RemoveWindow @0809F796: - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 beq @0809F7B0 @@ -283886,10 +283937,10 @@ sub_809F774: ; 809F774 pop {r0} bx r0 .pool - thumb_func_end sub_809F774 + thumb_func_end RemoveExtraStartMenuWindows - thumb_func_start sub_809F7C0 -sub_809F7C0: ; 809F7C0 + thumb_func_start PrintStartMenuActions +PrintStartMenuActions: ; 809F7C0 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -283914,11 +283965,11 @@ sub_809F7C0: ; 809F7C0 adds r0, 0x4 adds r0, r3, r0 ldr r1, [r0] - ldr r0, =sub_809FC8C + ldr r0, =StartMenu_PlayerName adds r7, r2, 0 cmp r1, r0 bne @0809F828 - bl sub_8197A08 + bl get_start_menu_window_id_maybe lsls r0, 24 lsrs r0, 24 ldrb r1, [r5] @@ -283939,7 +283990,7 @@ sub_809F7C0: ; 809F7C0 ldr r1, [r0] mov r0, r10 bl ExpandStringRefs - bl sub_8197A08 + bl get_start_menu_window_id_maybe lsls r0, 24 lsrs r0, 24 lsls r1, r4, 4 @@ -283986,7 +284037,7 @@ sub_809F7C0: ; 809F7C0 pop {r4-r7} pop {r1} bx r1 - thumb_func_end sub_809F7C0 + thumb_func_end PrintStartMenuActions thumb_func_start sub_809F894 sub_809F894: ; 809F894 @@ -284018,7 +284069,7 @@ sub_809F894: ; 809F894 strb r0, [r2] b @0809F98C @0809F8D8: - bl start_menu_compose + bl BuildStartMenuActions ldr r1, =0x02037619 b @0809F940 .pool @@ -284037,12 +284088,12 @@ sub_809F894: ; 809F894 b @0809F940 .pool @0809F90C: - bl flag_check_is_in_safari_zone + bl GetSafariZoneFlag cmp r0, 0 beq @0809F918 bl sub_809F654 @0809F918: - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 beq @0809F926 @@ -284055,7 +284106,7 @@ sub_809F894: ; 809F894 ldr r4, =0x0203761a adds r0, r4, 0 movs r1, 0x2 - bl sub_809F7C0 + bl PrintStartMenuActions cmp r0, 0 beq @0809F98C subs r1, r4, 0x1 @@ -284066,7 +284117,7 @@ sub_809F894: ; 809F894 b @0809F98C .pool @0809F94C: - bl sub_8197A08 + bl get_start_menu_window_id_maybe lsls r0, 24 lsrs r0, 24 movs r1, 0x10 @@ -284082,7 +284133,7 @@ sub_809F894: ; 809F894 movs r3, 0x9 bl sub_81983AC strb r0, [r4] - bl sub_8197A08 + bl get_start_menu_window_id_maybe lsls r0, 24 lsrs r0, 24 movs r1, 0x1 @@ -284202,13 +284253,13 @@ sub_809FA34: ; 809FA34 b @0809FA92 .pool @0809FA58: - bl in_trade_center + bl InUnionRoom cmp r0, 0x1 bne @0809FA64 bl var_800D_set_xB @0809FA64: ldr r1, =0x03005df4 - ldr r0, =sub_809FAC4 + ldr r0, =HandleStartMenuInput str r0, [r1] ldrh r0, [r4, 0x8] adds r0, 0x1 @@ -284250,8 +284301,8 @@ sub_809FA9C: ; 809FA9C .pool thumb_func_end sub_809FA9C - thumb_func_start sub_809FAC4 -sub_809FAC4: ; 809FAC4 + thumb_func_start HandleStartMenuInput +HandleStartMenuInput: ; 809FAC4 push {r4,lr} ldr r4, =0x030022c0 ldrh r1, [r4, 0x2E] @@ -284296,7 +284347,7 @@ sub_809FAC4: ; 809FAC4 adds r1, 0x4 adds r0, r1 ldr r1, [r0] - ldr r0, =sm_pokedex + ldr r0, =StartMenu_Pokedex cmp r1, r0 bne @0809FB34 movs r0, 0 @@ -284317,16 +284368,16 @@ sub_809FAC4: ; 809FAC4 adds r0, r1 ldr r1, [r0] str r1, [r3] - ldr r0, =sub_809FCFC + ldr r0, =StartMenu_Save cmp r1, r0 beq @0809FBA0 - ldr r0, =sub_809FD64 + ldr r0, =StartMenu_Exit cmp r1, r0 beq @0809FBA0 - ldr r0, =sub_809FD74 + ldr r0, =StartMenu_SafariZoneRetire cmp r1, r0 beq @0809FBA0 - ldr r0, =sub_809FDC0 + ldr r0, =StartMenu_BattlePyramidRetire cmp r1, r0 beq @0809FBA0 movs r0, 0x1 @@ -284343,17 +284394,17 @@ sub_809FAC4: ; 809FAC4 movs r0, 0 b @0809FBAE @0809FBA4: - bl sub_809F774 + bl RemoveExtraStartMenuWindows bl sub_80A0934 movs r0, 0x1 @0809FBAE: pop {r4} pop {r1} bx r1 - thumb_func_end sub_809FAC4 + thumb_func_end HandleStartMenuInput - thumb_func_start sm_pokedex -sm_pokedex: ; 809FBB4 + thumb_func_start StartMenu_Pokedex +StartMenu_Pokedex: ; 809FBB4 push {lr} ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] @@ -284368,7 +284419,7 @@ sm_pokedex: ; 809FBB4 movs r0, 0x29 bl sav12_xor_increment bl play_some_sound - bl sub_809F774 + bl RemoveExtraStartMenuWindows bl overworld_free_bg_tilemaps ldr r0, =sub_80BB534 bl SetMainCallback2 @@ -284377,10 +284428,10 @@ sm_pokedex: ; 809FBB4 pop {r1} bx r1 .pool - thumb_func_end sm_pokedex + thumb_func_end StartMenu_Pokedex - thumb_func_start sub_809FBF0 -sub_809FBF0: ; 809FBF0 + thumb_func_start StartMenu_Pokemon +StartMenu_Pokemon: ; 809FBF0 push {lr} ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] @@ -284393,19 +284444,19 @@ sub_809FBF0: ; 809FBF0 .pool @0809FC08: bl play_some_sound - bl sub_809F774 + bl RemoveExtraStartMenuWindows bl overworld_free_bg_tilemaps - ldr r0, =sub_81B7F34 + ldr r0, =CB2_PartyMenuFromStartMenu bl SetMainCallback2 movs r0, 0x1 @0809FC1C: pop {r1} bx r1 .pool - thumb_func_end sub_809FBF0 + thumb_func_end StartMenu_Pokemon - thumb_func_start sub_809FC24 -sub_809FC24: ; 809FC24 + thumb_func_start StartMenu_Bag +StartMenu_Bag: ; 809FC24 push {lr} ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] @@ -284418,7 +284469,7 @@ sub_809FC24: ; 809FC24 .pool @0809FC3C: bl play_some_sound - bl sub_809F774 + bl RemoveExtraStartMenuWindows bl overworld_free_bg_tilemaps ldr r0, =c2_bag bl SetMainCallback2 @@ -284427,10 +284478,10 @@ sub_809FC24: ; 809FC24 pop {r1} bx r1 .pool - thumb_func_end sub_809FC24 + thumb_func_end StartMenu_Bag - thumb_func_start sub_809FC58 -sub_809FC58: ; 809FC58 + thumb_func_start StartMenu_PokeNav +StartMenu_PokeNav: ; 809FC58 push {lr} ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] @@ -284443,19 +284494,19 @@ sub_809FC58: ; 809FC58 .pool @0809FC70: bl play_some_sound - bl sub_809F774 + bl RemoveExtraStartMenuWindows bl overworld_free_bg_tilemaps - ldr r0, =sub_81C7250 + ldr r0, =CB2_PokeNav bl SetMainCallback2 movs r0, 0x1 @0809FC84: pop {r1} bx r1 .pool - thumb_func_end sub_809FC58 + thumb_func_end StartMenu_PokeNav - thumb_func_start sub_809FC8C -sub_809FC8C: ; 809FC8C + thumb_func_start StartMenu_PlayerName +StartMenu_PlayerName: ; 809FC8C push {lr} ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] @@ -284464,12 +284515,12 @@ sub_809FC8C: ; 809FC8C cmp r0, 0 bne @0809FCF4 bl play_some_sound - bl sub_809F774 + bl RemoveExtraStartMenuWindows bl overworld_free_bg_tilemaps bl is_c1_link_related_active cmp r0, 0 bne @0809FCB6 - bl in_trade_center + bl InUnionRoom cmp r0, 0 beq @0809FCC8 @0809FCB6: @@ -284499,16 +284550,16 @@ sub_809FC8C: ; 809FC8C @0809FCF6: pop {r1} bx r1 - thumb_func_end sub_809FC8C + thumb_func_end StartMenu_PlayerName - thumb_func_start sub_809FCFC -sub_809FCFC: ; 809FCFC + thumb_func_start StartMenu_Save +StartMenu_Save: ; 809FCFC push {lr} - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 beq @0809FD0C - bl sub_809F774 + bl RemoveExtraStartMenuWindows @0809FD0C: ldr r1, =0x03005df4 ldr r0, =sub_809FE28 @@ -284517,10 +284568,10 @@ sub_809FCFC: ; 809FCFC pop {r1} bx r1 .pool - thumb_func_end sub_809FCFC + thumb_func_end StartMenu_Save - thumb_func_start sub_809FD20 -sub_809FD20: ; 809FD20 + thumb_func_start StartMenu_Option +StartMenu_Option: ; 809FD20 push {lr} ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] @@ -284533,9 +284584,9 @@ sub_809FD20: ; 809FD20 .pool @0809FD38: bl play_some_sound - bl sub_809F774 + bl RemoveExtraStartMenuWindows bl overworld_free_bg_tilemaps - ldr r0, =c2_options_menu + ldr r0, =CB2_OptionsMenu bl SetMainCallback2 ldr r1, =0x030022c0 ldr r0, =sub_8086194 @@ -284545,31 +284596,31 @@ sub_809FD20: ; 809FD20 pop {r1} bx r1 .pool - thumb_func_end sub_809FD20 + thumb_func_end StartMenu_Option - thumb_func_start sub_809FD64 -sub_809FD64: ; 809FD64 + thumb_func_start StartMenu_Exit +StartMenu_Exit: ; 809FD64 push {lr} - bl sub_809F774 + bl RemoveExtraStartMenuWindows bl sub_80A0934 movs r0, 0x1 pop {r1} bx r1 - thumb_func_end sub_809FD64 + thumb_func_end StartMenu_Exit - thumb_func_start sub_809FD74 -sub_809FD74: ; 809FD74 + thumb_func_start StartMenu_SafariZoneRetire +StartMenu_SafariZoneRetire: ; 809FD74 push {lr} - bl sub_809F774 + bl RemoveExtraStartMenuWindows bl sub_80A0934 bl sub_80FC180 movs r0, 0x1 pop {r1} bx r1 - thumb_func_end sub_809FD74 + thumb_func_end StartMenu_SafariZoneRetire - thumb_func_start sub_809FD88 -sub_809FD88: ; 809FD88 + thumb_func_start StartMenu_LinkModePlayerName +StartMenu_LinkModePlayerName: ; 809FD88 push {lr} ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] @@ -284592,17 +284643,17 @@ sub_809FD88: ; 809FD88 pop {r1} bx r1 .pool - thumb_func_end sub_809FD88 + thumb_func_end StartMenu_LinkModePlayerName - thumb_func_start sub_809FDC0 -sub_809FDC0: ; 809FDC0 + thumb_func_start StartMenu_BattlePyramidRetire +StartMenu_BattlePyramidRetire: ; 809FDC0 ldr r1, =0x03005df4 ldr r0, =sub_809FE9C str r0, [r1] movs r0, 0 bx lr .pool - thumb_func_end sub_809FDC0 + thumb_func_end StartMenu_BattlePyramidRetire thumb_func_start sub_809FDD4 sub_809FDD4: ; 809FDD4 @@ -284619,8 +284670,8 @@ sub_809FDD4: ; 809FDD4 .pool thumb_func_end sub_809FDD4 - thumb_func_start sub_809FDF4 -sub_809FDF4: ; 809FDF4 + thumb_func_start StartMenu_BattlePyramidBag +StartMenu_BattlePyramidBag: ; 809FDF4 push {lr} ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] @@ -284633,7 +284684,7 @@ sub_809FDF4: ; 809FDF4 .pool @0809FE0C: bl play_some_sound - bl sub_809F774 + bl RemoveExtraStartMenuWindows bl overworld_free_bg_tilemaps ldr r0, =sub_81C4EFC bl SetMainCallback2 @@ -284642,7 +284693,7 @@ sub_809FDF4: ; 809FDF4 pop {r1} bx r1 .pool - thumb_func_end sub_809FDF4 + thumb_func_end StartMenu_BattlePyramidBag thumb_func_start sub_809FE28 sub_809FE28: ; 809FE28 @@ -284678,7 +284729,7 @@ sub_809FE44: ; 809FE44 bl sub_8197DF8 bl sub_809F998 ldr r1, =0x03005df4 - ldr r0, =sub_809FAC4 + ldr r0, =HandleStartMenuInput str r0, [r1] b @0809FE94 .pool @@ -284716,7 +284767,7 @@ sub_809FEB8: ; 809FEB8 push {lr} bl sub_809F998 ldr r1, =0x03005df4 - ldr r0, =sub_809FAC4 + ldr r0, =HandleStartMenuInput str r0, [r1] movs r0, 0 pop {r1} @@ -284738,7 +284789,7 @@ sub_809FED4: ; 809FED4 beq @0809FF00 b @0809FF20 @0809FEEC: - bl sub_809F774 + bl RemoveExtraStartMenuWindows ldr r1, =0x03005df4 ldr r0, =sub_809FEB8 str r0, [r1] @@ -284826,7 +284877,7 @@ sub_809FF98: ; 809FF98 movs r1, 0x1 bl sub_819786C movs r0, 0x1 - bl sub_8197310 + bl AddTextPrinterForMessage_2 ldr r1, =0x02037621 movs r0, 0x1 strb r0, [r1] @@ -284960,14 +285011,14 @@ sub_80A0070: ; 80A0070 thumb_func_start sub_80A00A0 sub_80A00A0: ; 80A00A0 push {lr} - bl sub_8197A08 + bl get_start_menu_window_id_maybe lsls r0, 24 lsrs r0, 24 movs r1, 0 bl sub_819746C - bl sub_8197A14 + bl remove_start_menu_window_maybe bl sub_80A06B4 - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 beq @080A00D4 @@ -285291,12 +285342,12 @@ sub_80A0340: ; 80A0340 thumb_func_start sub_80A035C sub_80A035C: ; 80A035C push {lr} - bl sub_8197A08 + bl get_start_menu_window_id_maybe lsls r0, 24 lsrs r0, 24 movs r1, 0 bl sub_819746C - bl sub_8197A14 + bl remove_start_menu_window_maybe ldr r0, =gUnknown_08252CFB ldr r1, =sub_80A0388 bl sub_809FF98 @@ -285577,7 +285628,7 @@ sub_80A0550: ; 80A0550 movs r0, 0 movs r1, 0x1 movs r3, 0xFF - bl text_box_related_one + bl AddTextPrinterParametrized movs r0, 0 movs r1, 0x8 movs r2, 0xE @@ -285598,7 +285649,7 @@ sub_80A0550: ; 80A0550 ldrb r0, [r0] cmp r0, 0 beq @080A0620 - bl in_trade_center + bl InUnionRoom cmp r0, 0 beq @080A0620 bl sub_800A07C @@ -285759,7 +285810,7 @@ sub_80A06B4: ; 80A06B4 movs r0, 0x1 adds r1, r5, 0 movs r2, 0x70 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r2, r0, 0 ldrb r0, [r6] lsls r2, 16 @@ -285784,7 +285835,7 @@ sub_80A06B4: ; 80A06B4 movs r0, 0x1 adds r1, r5, 0 movs r2, 0x70 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r2, r0, 0 ldrb r0, [r6] lsls r3, r2, 24 @@ -285819,7 +285870,7 @@ sub_80A06B4: ; 80A06B4 movs r0, 0x1 adds r1, r5, 0 movs r2, 0x70 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r2, r0, 0 ldrb r0, [r6] lsls r3, r2, 24 @@ -285851,7 +285902,7 @@ sub_80A06B4: ; 80A06B4 movs r0, 0x1 adds r1, r5, 0 movs r2, 0x70 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r2, r0, 0 ldrb r0, [r6] lsls r3, r2, 24 @@ -285947,12 +285998,12 @@ sub_80A08CC: ; 80A08CC thumb_func_start sub_80A0914 sub_80A0914: ; 80A0914 push {lr} - bl sub_8197A08 + bl get_start_menu_window_id_maybe lsls r0, 24 lsrs r0, 24 movs r1, 0x1 bl sub_819746C - bl sub_8197A14 + bl remove_start_menu_window_maybe bl sub_80984F4 bl script_env_2_disable pop {r0} @@ -299678,7 +299729,7 @@ sub_80A8394: ; 80A8394 str r2, [r1] adds r0, r3 movs r1, 0 - bl sub_8008258 + bl StartObjectRotScalAnim @080A85EE: adds r0, r4, 0 add sp, 0x10 @@ -312330,7 +312381,7 @@ sub_80AF334: ; 80AF334 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r4, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 @@ -314403,9 +314454,9 @@ sub_80B0318: ; 80B0318 b @080B052C .pool @080B046C: - bl sub_808A2E4 + bl InstallCameraPanAheadCallback movs r0, 0 - bl sub_808A2C0 + bl SetCameraPanningCallback movs r0, 0 strh r0, [r5, 0xA] movs r0, 0x4 @@ -314432,10 +314483,10 @@ sub_80B0318: ; 80B0318 movs r1, 0x4 @080B04A4: movs r0, 0 - bl sub_808A2CC + bl SetCameraPanning b @080B052C @080B04AC: - bl sub_808A2E4 + bl InstallCameraPanAheadCallback movs r0, 0x8 strh r0, [r5, 0x8] movs r0, 0x7 @@ -314672,7 +314723,7 @@ task_add_01_battle_start: ; 80B065C thumb_func_start sub_80B0698 sub_80B0698: ; 80B0698 push {lr} - bl flag_check_is_in_safari_zone + bl GetSafariZoneFlag cmp r0, 0 beq @080B06A8 bl sub_80B077C @@ -314704,7 +314755,7 @@ sub_80B06BC: ; 80B06BC ldr r4, =0x02022fec movs r0, 0 str r0, [r4] - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 beq @080B06F2 @@ -314834,7 +314885,7 @@ task_add_01_battle_start_with_music_and_stats: ; 80B0804 thumb_func_start sub_80B0828 sub_80B0828: ; 80B0828 push {lr} - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 beq @080B0846 @@ -315157,11 +315208,11 @@ sub_80B0AF8: ; 80B0AF8 bl battle_exit_is_player_defeat cmp r0, 0x1 bne @080B0B4C - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 bne @080B0B4C - bl sub_81A80A8 + bl InBattlePike lsls r0, 24 cmp r0, 0 bne @080B0B4C @@ -315202,7 +315253,7 @@ sub_80B0B6C: ; 80B0B6C bl battle_exit_is_player_defeat cmp r0, 0x1 bne @080B0BC0 - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 beq @080B0BB4 @@ -315239,7 +315290,7 @@ sub_80B0BD0: ; 80B0BD0 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r4, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 16 lsrs r5, r0, 16 lsls r0, r5, 24 @@ -315401,7 +315452,7 @@ sub_80B0D24: ; 80B0D24 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r4, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 16 lsrs r4, r0, 16 bl sav1_get_flash_used_on_map @@ -315633,7 +315684,7 @@ sub_80B0EC8: ; 80B0EC8 lsrs r0, 24 cmp r4, r0 bcs @080B0F10 - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 beq @080B0F04 @@ -315646,7 +315697,7 @@ sub_80B0EC8: ; 80B0EC8 b @080B0F20 .pool @080B0F10: - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 bne @080B0F2C @@ -316031,8 +316082,9 @@ sub_80B1234: ; 80B1234 bx r0 thumb_func_end sub_80B1234 - thumb_func_start battle_load32 -battle_load32: ; 80B1250 + thumb_func_start TrainerBattleLoadArg32 +; u32 TrainerBattleLoadArg32(u8 *arg) +TrainerBattleLoadArg32: ; 80B1250 adds r2, r0, 0 ldrb r0, [r2] ldrb r1, [r2, 0x1] @@ -316045,23 +316097,25 @@ battle_load32: ; 80B1250 lsls r1, 24 orrs r0, r1 bx lr - thumb_func_end battle_load32 + thumb_func_end TrainerBattleLoadArg32 - thumb_func_start battle_load16 -battle_load16: ; 80B1268 + thumb_func_start TrainerBattleLoadArg16 +; u16 TrainerBattleLoadArg16(u8 *arg) +TrainerBattleLoadArg16: ; 80B1268 adds r1, r0, 0 ldrb r0, [r1] ldrb r1, [r1, 0x1] lsls r1, 8 orrs r0, r1 bx lr - thumb_func_end battle_load16 + thumb_func_end TrainerBattleLoadArg16 - thumb_func_start battle_load8 -battle_load8: ; 80B1274 + thumb_func_start TrainerBattleLoadArg8 +; u8 TrainerBattleLoadArg8(u8 *arg) +TrainerBattleLoadArg8: ; 80B1274 ldrb r0, [r0] bx lr - thumb_func_end battle_load8 + thumb_func_end TrainerBattleLoadArg8 thumb_func_start trainerflag_opponent trainerflag_opponent: ; 80B1278 @@ -316122,8 +316176,8 @@ battle_exit_is_player_defeat: ; 80B12A8 bx r1 thumb_func_end battle_exit_is_player_defeat - thumb_func_start sub_80B12E8 -sub_80B12E8: ; 80B12E8 + thumb_func_start ResetTrainerOpponentIds +ResetTrainerOpponentIds: ; 80B12E8 ldr r0, =0x02038bca movs r1, 0 strh r1, [r0] @@ -316131,10 +316185,11 @@ sub_80B12E8: ; 80B12E8 strh r1, [r0] bx lr .pool - thumb_func_end sub_80B12E8 + thumb_func_end ResetTrainerOpponentIds - thumb_func_start sub_80B12FC -sub_80B12FC: ; 80B12FC + thumb_func_start InitTrainerBattleVariables +; void InitTrainerBattleVariables() +InitTrainerBattleVariables: ; 80B12FC push {lr} ldr r0, =0x02038bc8 movs r1, 0 @@ -316172,10 +316227,11 @@ sub_80B12FC: ; 80B12FC pop {r0} bx r0 .pool - thumb_func_end sub_80B12FC + thumb_func_end InitTrainerBattleVariables - thumb_func_start battle_load_arguments -battle_load_arguments: ; 80B1370 + thumb_func_start TrainerBattleLoadArgs +; void TrainerBattleLoadArgs(struct TrainerBattleArgSpec *argSpecs, u8 *args) +TrainerBattleLoadArgs: ; 80B1370 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 @@ -316200,21 +316256,21 @@ battle_load_arguments: ; 80B1370 .4byte @080B13EC @080B13A8: adds r0, r5, 0 - bl battle_load8 + bl TrainerBattleLoadArg8 ldr r1, [r4] strb r0, [r1] adds r5, 0x1 b @080B13E8 @080B13B6: adds r0, r5, 0 - bl battle_load16 + bl TrainerBattleLoadArg16 ldr r1, [r4] strh r0, [r1] adds r5, 0x2 b @080B13E8 @080B13C4: adds r0, r5, 0 - bl battle_load32 + bl TrainerBattleLoadArg32 ldr r1, [r4] str r0, [r1] adds r5, 0x4 @@ -316242,7 +316298,7 @@ battle_load_arguments: ; 80B1370 pop {r4,r5} pop {r0} bx r0 - thumb_func_end battle_load_arguments + thumb_func_end TrainerBattleLoadArgs thumb_func_start battle_80801F0 battle_80801F0: ; 80B13F8 @@ -316268,14 +316324,15 @@ battle_80801F0: ; 80B13F8 .pool thumb_func_end battle_80801F0 - thumb_func_start battle_configure_by_script -battle_configure_by_script: ; 80B1430 + thumb_func_start TrainerBattleConfigure +; u8 *TrainerBattleConfigure(u8 *args) +TrainerBattleConfigure: ; 80B1430 push {r4,r5,lr} adds r5, r0, 0 - bl sub_80B12FC + bl InitTrainerBattleVariables ldr r4, =0x02038bc8 adds r0, r5, 0 - bl battle_load8 + bl TrainerBattleLoadArg8 lsls r0, 24 lsrs r0, 24 strh r0, [r4] @@ -316308,7 +316365,7 @@ battle_configure_by_script: ; 80B1430 @080B1494: ldr r0, =gUnknown_0854FF84 adds r1, r5, 0 - bl battle_load_arguments + bl TrainerBattleLoadArgs ldr r0, =gUnknown_082713C2 b @080B161E .pool @@ -316336,7 +316393,7 @@ battle_configure_by_script: ; 80B1430 ldr r0, =gUnknown_0854FFCC @080B14D6: adds r1, r5, 0 - bl battle_load_arguments + bl TrainerBattleLoadArgs bl battle_80801F0 ldr r0, =gUnknown_0827138A b @080B161E @@ -316344,7 +316401,7 @@ battle_configure_by_script: ; 80B1430 @080B14EC: ldr r0, =gUnknown_0854FF3C adds r1, r5, 0 - bl battle_load_arguments + bl TrainerBattleLoadArgs bl battle_80801F0 ldr r4, =0x02038bca ldrh r0, [r4] @@ -316356,7 +316413,7 @@ battle_configure_by_script: ; 80B1430 @080B1514: ldr r0, =gUnknown_0854FEAC adds r1, r5, 0 - bl battle_load_arguments + bl TrainerBattleLoadArgs bl battle_80801F0 ldr r4, =0x02038bca ldrh r0, [r4] @@ -316372,7 +316429,7 @@ battle_configure_by_script: ; 80B1430 bne @080B156C ldr r0, =gUnknown_0854FEAC adds r1, r5, 0 - bl battle_load_arguments + bl TrainerBattleLoadArgs bl battle_80801F0 ldr r0, =0x020375f2 ldrb r0, [r0] @@ -316383,7 +316440,7 @@ battle_configure_by_script: ; 80B1430 @080B156C: ldr r0, =gUnknown_08550014 adds r1, r5, 0 - bl battle_load_arguments + bl TrainerBattleLoadArgs ldr r0, =0x020375f2 ldrb r0, [r0] bl sub_81A9AA8 @@ -316401,7 +316458,7 @@ battle_configure_by_script: ; 80B1430 ldr r0, =gUnknown_08550014 @080B159A: adds r1, r5, 0 - bl battle_load_arguments + bl TrainerBattleLoadArgs movs r0, 0 b @080B161E .pool @@ -316412,7 +316469,7 @@ battle_configure_by_script: ; 80B1430 bne @080B15D8 ldr r0, =gUnknown_0854FEAC adds r1, r5, 0 - bl battle_load_arguments + bl TrainerBattleLoadArgs bl battle_80801F0 ldr r0, =0x020375f2 ldrb r0, [r0] @@ -316423,7 +316480,7 @@ battle_configure_by_script: ; 80B1430 @080B15D8: ldr r0, =gUnknown_08550014 adds r1, r5, 0 - bl battle_load_arguments + bl TrainerBattleLoadArgs ldr r0, =0x020375f2 ldrb r0, [r0] bl battle_init @@ -316437,7 +316494,7 @@ battle_configure_by_script: ; 80B1430 ldr r0, =gUnknown_0854FEAC @080B15FE: adds r1, r5, 0 - bl battle_load_arguments + bl TrainerBattleLoadArgs bl battle_80801F0 b @080B161C .pool @@ -316445,7 +316502,7 @@ battle_configure_by_script: ; 80B1430 ldr r0, =gUnknown_08550014 @080B1616: adds r1, r5, 0 - bl battle_load_arguments + bl TrainerBattleLoadArgs @080B161C: ldr r0, =gUnknown_08271362 @080B161E: @@ -316453,10 +316510,11 @@ battle_configure_by_script: ; 80B1430 pop {r1} bx r1 .pool - thumb_func_end battle_configure_by_script + thumb_func_end TrainerBattleConfigure - thumb_func_start sub_80B162C -sub_80B162C: ; 80B162C + thumb_func_start SingleTrainerWantsBattle +; void SingleTrainerWantsBattle(u8 trainerFieldObjectId, u8 *trainerScript) +SingleTrainerWantsBattle: ; 80B162C push {r4,lr} lsls r0, 24 lsrs r0, 24 @@ -316472,7 +316530,7 @@ sub_80B162C: ; 80B162C strh r0, [r4] adds r1, 0x1 adds r0, r1, 0 - bl battle_configure_by_script + bl TrainerBattleConfigure ldr r0, =gUnknown_08271354 bl script_env_1_execute_new_script bl script_env_2_enable @@ -316480,10 +316538,11 @@ sub_80B162C: ; 80B162C pop {r0} bx r0 .pool - thumb_func_end sub_80B162C + thumb_func_end SingleTrainerWantsBattle - thumb_func_start sub_80B1670 -sub_80B1670: ; 80B1670 + thumb_func_start TwoTrainersWantBattle +; void TwoTrainersWantBattle(u8 trainerFieldObjectId, u8 *trainerScript) +TwoTrainersWantBattle: ; 80B1670 push {r4,lr} lsls r0, 24 lsrs r0, 24 @@ -316499,15 +316558,16 @@ sub_80B1670: ; 80B1670 strh r0, [r4] adds r1, 0x1 adds r0, r1, 0 - bl battle_configure_by_script + bl TrainerBattleConfigure pop {r4} pop {r0} bx r0 .pool - thumb_func_end sub_80B1670 + thumb_func_end TwoTrainersWantBattle - thumb_func_start sub_80B16A4 -sub_80B16A4: ; 80B16A4 + thumb_func_start TwoTrainersWantBattleExecuteScript +; void TwoTrainersWantBattleExecuteScript() +TwoTrainersWantBattleExecuteScript: ; 80B16A4 push {lr} ldr r0, =gUnknown_08271354 bl script_env_1_execute_new_script @@ -316515,13 +316575,14 @@ sub_80B16A4: ; 80B16A4 pop {r0} bx r0 .pool - thumb_func_end sub_80B16A4 + thumb_func_end TwoTrainersWantBattleExecuteScript - thumb_func_start sub_80B16B8 -sub_80B16B8: ; 80B16B8 + thumb_func_start GetTrainerFlagFromScriptPointer +; u8 GetTrainerFlagFromScriptPointer(u8 *scriptPointer) +GetTrainerFlagFromScriptPointer: ; 80B16B8 push {lr} adds r0, 0x2 - bl battle_load16 + bl TrainerBattleLoadArg16 lsls r0, 16 movs r1, 0xA0 lsls r1, 19 @@ -316532,7 +316593,7 @@ sub_80B16B8: ; 80B16B8 lsrs r0, 24 pop {r1} bx r1 - thumb_func_end sub_80B16B8 + thumb_func_end GetTrainerFlagFromScriptPointer thumb_func_start sub_80B16D8 sub_80B16D8: ; 80B16D8 @@ -316571,17 +316632,17 @@ sub_80B170C: ; 80B170C ; pokescrcmd check_trainer_flag: ; 80B1718 push {lr} - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 beq @080B1734 ldr r0, =0x03005df0 ldrb r0, [r0] - bl sub_81A9AC4 + bl GetBattlePyramidTrainerFlag b @080B1752 .pool @080B1734: - bl sub_81D6074 + bl InTrainerHill cmp r0, 0 bne @080B174A bl trainerflag_opponent @@ -316592,7 +316653,7 @@ check_trainer_flag: ; 80B1718 @080B174A: ldr r0, =0x03005df0 ldrb r0, [r0] - bl sub_81D619C + bl GetTrainerHillTrainerFlag @080B1752: lsls r0, 24 lsrs r0, 24 @@ -316690,7 +316751,7 @@ sub_80B17E0: ; 80B17E0 movs r0, 0x8 @080B1800: str r0, [r1] - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 beq @080B1884 @@ -316775,7 +316836,7 @@ sub_80B17E0: ; 80B17E0 ldr r1, =0x030022c0 ldr r0, =sub_80B1918 str r0, [r1, 0x8] - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 bne @080B18E8 @@ -316810,7 +316871,7 @@ sub_80B1918: ; 80B1918 bl battle_exit_is_player_defeat cmp r0, 0x1 bne @080B1968 - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 bne @080B1946 @@ -316831,7 +316892,7 @@ sub_80B1918: ; 80B1918 @080B1968: ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music bl SetMainCallback2 - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 bne @080B198A @@ -316901,7 +316962,7 @@ sub_80B19EC: ; 80B19EC thumb_func_start sub_80B1A14 sub_80B1A14: ; 80B1A14 push {lr} - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 beq @080B1A7C @@ -317041,17 +317102,18 @@ sub_80B1B10: ; 80B1B10 .pool thumb_func_end sub_80B1B10 - thumb_func_start sub_80B1B60 -sub_80B1B60: ; 80B1B60 + thumb_func_start special_trainer_unable_to_battle +special_trainer_unable_to_battle: ; 80B1B60 push {lr} bl sub_80B1D18 bl box_related_two__2 pop {r0} bx r0 - thumb_func_end sub_80B1B60 + thumb_func_end special_trainer_unable_to_battle - thumb_func_start get_prebattle_song_id -get_prebattle_song_id: ; 80B1B70 + thumb_func_start SetUpTrainerEncounterMusic +; void SetUpTrainerEncounterMusic() +SetUpTrainerEncounterMusic: ; 80B1B70 push {lr} ldr r0, =0x02038bfc ldrb r0, [r0] @@ -317071,7 +317133,7 @@ get_prebattle_song_id: ; 80B1B70 cmp r0, 0x8 beq @080B1C62 adds r0, r1, 0 - bl read_trainer_data_byte2 + bl GetTrainerEncounterMusicId lsls r0, 24 lsrs r0, 24 cmp r0, 0xD @@ -317158,10 +317220,11 @@ get_prebattle_song_id: ; 80B1B70 pop {r0} bx r0 .pool - thumb_func_end get_prebattle_song_id + thumb_func_end SetUpTrainerEncounterMusic - thumb_func_start sub_80B1C6C -sub_80B1C6C: ; 80B1C6C + thumb_func_start ReturnEmptyStringIfNull +; u8 *ReturnEmptyStringIfNull(u8 *str) +ReturnEmptyStringIfNull: ; 80B1C6C push {lr} cmp r0, 0 bne @080B1C74 @@ -317170,7 +317233,7 @@ sub_80B1C6C: ; 80B1C6C pop {r1} bx r1 .pool - thumb_func_end sub_80B1C6C + thumb_func_end ReturnEmptyStringIfNull thumb_func_start sub_80B1C7C sub_80B1C7C: ; 80B1C7C @@ -317186,7 +317249,7 @@ sub_80B1C7C: ; 80B1C7C ldr r0, =0x02038bd4 @080B1C96: ldr r0, [r0] - bl sub_80B1C6C + bl ReturnEmptyStringIfNull pop {r1} bx r1 .pool @@ -317209,7 +317272,7 @@ sub_80B1CA4: ; 80B1CA4 ldr r0, [r0] @080B1CC0: ldr r4, =0x02021fc4 - bl sub_80B1C6C + bl ReturnEmptyStringIfNull adds r1, r0, 0 adds r0, r4, 0 bl ExpandStringRefs @@ -317226,7 +317289,7 @@ sub_80B1CE0: ; 80B1CE0 ldr r4, =0x02021fc4 ldr r0, =0x02038be0 ldr r0, [r0] - bl sub_80B1C6C + bl ReturnEmptyStringIfNull adds r1, r0, 0 adds r0, r4, 0 bl ExpandStringRefs @@ -317242,7 +317305,7 @@ sub_80B1D04: ; 80B1D04 push {lr} ldr r0, =0x02038be4 ldr r0, [r0] - bl sub_80B1C6C + bl ReturnEmptyStringIfNull pop {r1} bx r1 .pool @@ -317253,7 +317316,7 @@ sub_80B1D18: ; 80B1D18 push {lr} ldr r0, =0x02038be8 ldr r0, [r0] - bl sub_80B1C6C + bl ReturnEmptyStringIfNull pop {r1} bx r1 .pool @@ -318047,8 +318110,8 @@ sub_80B22BC: ; 80B22BC .pool thumb_func_end sub_80B22BC - thumb_func_start sub_80B22D8 -sub_80B22D8: ; 80B22D8 + thumb_func_start CheckIfMultipleTrainersWantBattle +CheckIfMultipleTrainersWantBattle: ; 80B22D8 push {lr} ldr r1, =0x02038bf9 ldrb r0, [r1] @@ -318074,7 +318137,7 @@ sub_80B22D8: ; 80B22D8 pop {r0} bx r0 .pool - thumb_func_end sub_80B22D8 + thumb_func_end CheckIfMultipleTrainersWantBattle thumb_func_start sub_80B2318 sub_80B2318: ; 80B2318 @@ -318178,7 +318241,7 @@ sub_80B23B0: ; 80B23B0 movs r0, 0x1 adds r1, r5, 0 movs r2, 0x58 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 @@ -320332,7 +320395,7 @@ sub_80B360C: ; 80B360C movs r0, 0x1 bl sub_801B990 @080B36B2: - bl in_trade_center + bl InUnionRoom cmp r0, 0x1 bne @080B36CC ldr r1, =0x030022c0 @@ -320956,8 +321019,9 @@ sub_80B3BC4: ; 80B3BC4 .pool thumb_func_end sub_80B3BC4 - thumb_func_start unknown__trainer_related -unknown__trainer_related: ; 80B3BE8 + thumb_func_start CheckForTrainersWantingBattle +; BOOL CheckForTrainersWantingBattle() +CheckForTrainersWantingBattle: ; 80B3BE8 push {r4-r7,lr} ldr r0, =0x030060a8 movs r1, 0 @@ -320982,7 +321046,7 @@ unknown__trainer_related: ; 80B3BE8 bne @080B3C38 @080B3C12: adds r0, r4, 0 - bl sub_80B3D00 + bl CheckIfTrainerWantsBattle lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 @@ -320994,7 +321058,7 @@ unknown__trainer_related: ; 80B3BE8 adds r5, r0, 0 cmp r1, 0x1 bhi @080B3C88 - bl sub_806B638 + bl CheckPlayerPartySize lsls r0, 24 cmp r0, 0 bne @080B3C42 @@ -321010,7 +321074,7 @@ unknown__trainer_related: ; 80B3BE8 adds r5, r0, 0 cmp r4, 0x1 bne @080B3C88 - bl sub_80B12E8 + bl ResetTrainerOpponentIds ldr r2, =0x03006090 ldrb r0, [r5] subs r0, 0x1 @@ -321022,7 +321086,7 @@ unknown__trainer_related: ; 80B3BE8 adds r2, 0x4 adds r1, r2 ldr r1, [r1] - bl sub_80B162C + bl SingleTrainerWantsBattle ldr r0, =0x030060ac strb r4, [r0] movs r0, 0x1 @@ -321032,7 +321096,7 @@ unknown__trainer_related: ; 80B3BE8 ldrb r0, [r5] cmp r0, 0x2 bne @080B3CEC - bl sub_80B12E8 + bl ResetTrainerOpponentIds movs r4, 0 ldrb r5, [r5] cmp r4, r5 @@ -321048,7 +321112,7 @@ unknown__trainer_related: ; 80B3BE8 ldrb r0, [r0] adds r1, r7 ldr r1, [r1] - bl sub_80B1670 + bl TwoTrainersWantBattle adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 @@ -321060,7 +321124,7 @@ unknown__trainer_related: ; 80B3BE8 cmp r4, r0 bcc @080B3CA0 @080B3CC6: - bl sub_80B16A4 + bl TwoTrainersWantBattleExecuteScript ldr r1, =0x02038bfc movs r0, 0 strb r0, [r1] @@ -321080,10 +321144,11 @@ unknown__trainer_related: ; 80B3BE8 pop {r1} bx r1 .pool - thumb_func_end unknown__trainer_related + thumb_func_end CheckForTrainersWantingBattle - thumb_func_start sub_80B3D00 -sub_80B3D00: ; 80B3D00 + thumb_func_start CheckIfTrainerWantsBattle +; u8 CheckIfTrainerWantsBattle(u8 trainerFieldObjectId) +CheckIfTrainerWantsBattle: ; 80B3D00 push {r4-r7,lr} mov r7, r9 mov r6, r8 @@ -321092,7 +321157,7 @@ sub_80B3D00: ; 80B3D00 lsrs r5, r0, 24 movs r0, 0x1 mov r9, r0 - bl sub_81D6074 + bl InTrainerHill cmp r0, 0x1 bne @080B3D1E bl sub_81D62AC @@ -321102,12 +321167,12 @@ sub_80B3D00: ; 80B3D00 bl GetFieldObjectScriptPointerByFieldObjectId @080B3D24: adds r7, r0, 0 - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 beq @080B3D3E adds r0, r5, 0 - bl sub_81A9AC4 + bl GetBattlePyramidTrainerFlag @080B3D36: lsls r0, 24 @080B3D38: @@ -321115,15 +321180,15 @@ sub_80B3D00: ; 80B3D00 beq @080B3D56 b @080B3DE0 @080B3D3E: - bl sub_81D6074 + bl InTrainerHill cmp r0, 0x1 bne @080B3D4E adds r0, r5, 0 - bl sub_81D619C + bl GetTrainerHillTrainerFlag b @080B3D36 @080B3D4E: adds r0, r7, 0 - bl sub_80B16B8 + bl GetTrainerFlagFromScriptPointer b @080B3D38 @080B3D56: lsls r4, r5, 3 @@ -321131,7 +321196,7 @@ sub_80B3D00: ; 80B3D00 lsls r0, 2 ldr r1, =0x02037350 adds r0, r1 - bl sub_80B3DF0 + bl CheckIfTrainerCanApproachPlayer lsls r0, 24 lsrs r6, r0, 24 mov r8, r4 @@ -321145,7 +321210,7 @@ sub_80B3D00: ; 80B3D00 cmp r0, 0x6 bne @080B3D8A @080B3D7C: - bl sub_806B638 + bl CheckPlayerPartySize lsls r0, 24 cmp r0, 0 bne @080B3DE0 @@ -321181,7 +321246,7 @@ sub_80B3D00: ; 80B3D00 subs r1, r6, 0x1 lsls r1, 24 lsrs r1, 24 - bl sub_80B406C + bl TrainerApproachPlayer ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] @@ -321197,10 +321262,11 @@ sub_80B3D00: ; 80B3D00 pop {r4-r7} pop {r1} bx r1 - thumb_func_end sub_80B3D00 + thumb_func_end CheckIfTrainerWantsBattle - thumb_func_start sub_80B3DF0 -sub_80B3DF0: ; 80B3DF0 + thumb_func_start CheckIfTrainerCanApproachPlayer +; u8 CheckIfTrainerCanApproachPlayer(struct npc_state *trainerFieldObject) +CheckIfTrainerCanApproachPlayer: ; 80B3DF0 push {r4-r7,lr} mov r7, r8 push {r7} @@ -321237,7 +321303,7 @@ sub_80B3DF0: ; 80B3DF0 lsrs r2, 28 adds r0, r7, 0 adds r1, r6, 0 - bl sub_80B3FB0 + bl CheckPathBetweenTrainerAndPlayer lsls r0, 24 lsrs r0, 24 b @080B3E90 @@ -321269,7 +321335,7 @@ sub_80B3DF0: ; 80B3DF0 adds r0, r7, 0 adds r1, r6, 0 adds r2, r4, 0 - bl sub_80B3FB0 + bl CheckPathBetweenTrainerAndPlayer lsls r0, 24 cmp r0, 0 bne @080B3E4C @@ -321285,10 +321351,11 @@ sub_80B3DF0: ; 80B3DF0 pop {r1} bx r1 .pool - thumb_func_end sub_80B3DF0 + thumb_func_end CheckIfTrainerCanApproachPlayer - thumb_func_start sub_80B3EA0 -sub_80B3EA0: ; 80B3EA0 + thumb_func_start IsTrainerInRangeSouth +; u8 IsTrainerInRangeSouth(struct npc_state *trainerFieldObject, u16 sightRange, u16 playerX, u16 playerY) +IsTrainerInRangeSouth: ; 80B3EA0 push {r4-r6,lr} adds r4, r0, 0 lsls r1, 16 @@ -321324,10 +321391,11 @@ sub_80B3EA0: ; 80B3EA0 pop {r4-r6} pop {r1} bx r1 - thumb_func_end sub_80B3EA0 + thumb_func_end IsTrainerInRangeSouth - thumb_func_start sub_80B3EE4 -sub_80B3EE4: ; 80B3EE4 + thumb_func_start IsTrainerInRangeNorth +; u8 IsTrainerInRangeNorth(struct npc_state *trainerFieldObject, u16 sightRange, u16 playerX, u16 playerY) +IsTrainerInRangeNorth: ; 80B3EE4 push {r4-r6,lr} adds r4, r0, 0 lsls r1, 16 @@ -321363,10 +321431,11 @@ sub_80B3EE4: ; 80B3EE4 pop {r4-r6} pop {r1} bx r1 - thumb_func_end sub_80B3EE4 + thumb_func_end IsTrainerInRangeNorth - thumb_func_start sub_80B3F28 -sub_80B3F28: ; 80B3F28 + thumb_func_start IsTrainerInRangeWest +; u8 IsTrainerInRangeWest(struct npc_state *trainerFieldObject, u16 sightRange, u16 playerX, u16 playerY) +IsTrainerInRangeWest: ; 80B3F28 push {r4-r6,lr} adds r4, r0, 0 lsls r1, 16 @@ -321402,10 +321471,11 @@ sub_80B3F28: ; 80B3F28 pop {r4-r6} pop {r1} bx r1 - thumb_func_end sub_80B3F28 + thumb_func_end IsTrainerInRangeWest - thumb_func_start sub_80B3F6C -sub_80B3F6C: ; 80B3F6C + thumb_func_start IsTrainerInRangeEast +; u8 IsTrainerInRangeEast(struct npc_state *trainerFieldObject, u16 sightRange, u16 playerX, u16 playerY) +IsTrainerInRangeEast: ; 80B3F6C push {r4-r6,lr} adds r4, r0, 0 lsls r1, 16 @@ -321441,10 +321511,11 @@ sub_80B3F6C: ; 80B3F6C pop {r4-r6} pop {r1} bx r1 - thumb_func_end sub_80B3F6C + thumb_func_end IsTrainerInRangeEast - thumb_func_start sub_80B3FB0 -sub_80B3FB0: ; 80B3FB0 + thumb_func_start CheckPathBetweenTrainerAndPlayer +; u8 CheckPathBetweenTrainerAndPlayer(struct npc_state *fieldObject, u8 a2, u8 direction) +CheckPathBetweenTrainerAndPlayer: ; 80B3FB0 push {r4-r7,lr} mov r7, r9 mov r6, r8 @@ -321540,10 +321611,11 @@ sub_80B3FB0: ; 80B3FB0 pop {r4-r7} pop {r1} bx r1 - thumb_func_end sub_80B3FB0 + thumb_func_end CheckPathBetweenTrainerAndPlayer - thumb_func_start sub_80B406C -sub_80B406C: ; 80B406C + thumb_func_start TrainerApproachPlayer +; void TrainerApproachPlayer(struct npc_state *trainerFieldObject, u8 distance) +TrainerApproachPlayer: ; 80B406C push {r4,r5,lr} lsls r5, r1, 24 lsrs r5, 24 @@ -321581,7 +321653,7 @@ sub_80B406C: ; 80B406C pop {r0} bx r0 .pool - thumb_func_end sub_80B406C + thumb_func_end TrainerApproachPlayer thumb_func_start sub_80B40C8 sub_80B40C8: ; 80B40C8 @@ -322644,7 +322716,7 @@ sub_80B48C4: ; 80B48C4 @080B4920: adds r0, r4, 0x7 adds r1, r5, 0x7 - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 bl sub_8089660 @@ -322712,7 +322784,7 @@ sub_80B4984: ; 80B4984 adds r4, 0xE adds r0, r5, 0 adds r1, r4, 0 - bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + bl GetXYCoordsOneStepInFrontOfPlayer ldrh r0, [r5] subs r0, 0x7 strh r0, [r5] @@ -323237,7 +323309,7 @@ get_wild_data_index_for_map: ; 80B4CF8 sub_80B4D78: ; 80B4D78 push {r4-r7,lr} sub sp, 0x1C - bl flag_check_is_in_safari_zone + bl GetSafariZoneFlag cmp r0, 0x1 bne @080B4E0E bl GenerateRandomNumber @@ -324302,7 +324374,7 @@ sub_80B5578: ; 80B5578 ldrsh r0, [r0, r2] movs r2, 0 ldrsh r1, [r5, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 bl sub_808952C @@ -324345,7 +324417,7 @@ sub_80B5578: ; 80B5578 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r5, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 bl sub_8089558 @@ -324579,15 +324651,15 @@ sub_80B582C: ; 80B582C thumb_func_start sub_80B5870 sub_80B5870: ; 80B5870 push {r4,r5,lr} - bl sub_81A80A8 + bl InBattlePike lsls r0, 24 cmp r0, 0 bne @080B58C4 - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 bne @080B58C4 - bl in_trade_center + bl InUnionRoom cmp r0, 0x1 beq @080B58C4 ldr r5, =0x00004021 @@ -327333,7 +327405,7 @@ sub_80B6DBC: ; 80B6DBC strh r1, [r0, 0xA] strh r2, [r0, 0xC] movs r0, 0 - bl sub_808A2C0 + bl SetCameraPanningCallback movs r0, 0x1 pop {r1} bx r1 @@ -327346,7 +327418,7 @@ sub_80B6DD8: ; 80B6DD8 movs r0, 0xA ldrsh r1, [r4, r0] movs r0, 0 - bl sub_808A2CC + bl SetCameraPanning ldrh r0, [r4, 0xA] negs r2, r0 strh r2, [r4, 0xA] @@ -327384,7 +327456,7 @@ sub_80B6E18: ; 80B6E18 bl script_env_2_disable bl CameraObjectReset1 bl sub_809757C - bl sub_808A2E4 + bl InstallCameraPanAheadCallback ldr r0, =sub_80B6B94 bl get_task_id_by_function lsls r0, 24 @@ -327776,7 +327848,7 @@ sub_80B7114: ; 80B7114 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r4, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r1, r0, 24 ldrh r0, [r5, 0x8] @@ -328403,7 +328475,7 @@ sub_80B764C: ; 80B764C bl player_bitmagic bl CameraObjectReset2 movs r0, 0 - bl sub_808A2C0 + bl SetCameraPanningCallback ldr r0, =0x02037590 movs r2, 0x1 strb r2, [r0, 0x6] @@ -328429,7 +328501,7 @@ sub_80B7684: ; 80B7684 movs r0, 0xA ldrsh r1, [r4, r0] movs r0, 0 - bl sub_808A2CC + bl SetCameraPanning ldrh r0, [r4, 0xA] negs r0, r0 strh r0, [r4, 0xA] @@ -328499,7 +328571,7 @@ sub_80B7704: ; 80B7704 movs r0, 0xA ldrsh r1, [r4, r0] movs r0, 0 - bl sub_808A2CC + bl SetCameraPanning ldrh r0, [r4, 0xA] negs r2, r0 strh r2, [r4, 0xA] @@ -331878,7 +331950,7 @@ sub_80B92F8: ; 80B92F8 movs r0, 0x10 strh r0, [r4, 0xC] movs r0, 0x1 - bl SetPlayerAvatarTransition + bl SetPlayerAvatarTransitionFlags ldr r0, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 @@ -332201,7 +332273,7 @@ sub_80B957C: ; 80B957C bl obj_alloc_rotscale_entry adds r0, r4, 0 movs r1, 0 - bl sub_8008258 + bl StartObjectRotScalAnim movs r0, 0x76 strh r0, [r4, 0x20] ldr r0, =0x0000ffd0 @@ -332353,7 +332425,7 @@ sub_80B96B0: ; 80B96B0 bl obj_alloc_rotscale_entry adds r0, r4, 0 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim movs r0, 0x5E strh r0, [r4, 0x20] ldr r0, =0x0000ffe0 @@ -332944,15 +333016,15 @@ sub_80B9B3C: ; 80B9B3C lsls r1, 16 asrs r1, 16 movs r0, 0 - bl sub_808A2CC + bl SetCameraPanning b @080B9BB6 @080B9BAC: movs r0, 0xA ldrsh r1, [r4, r0] movs r0, 0 - bl sub_808A2CC + bl SetCameraPanning @080B9BB6: - bl sub_808A314 + bl UpdateCameraPanning movs r1, 0xA ldrsh r0, [r4, r1] cmp r0, 0 @@ -332991,9 +333063,9 @@ sub_80B9BE8: ; 80B9BE8 lsls r4, 3 ldr r0, =0x03005e08 adds r4, r0 - bl sub_808A2E4 + bl InstallCameraPanAheadCallback movs r0, 0 - bl sub_808A2C0 + bl SetCameraPanningCallback ldr r1, =gUnknown_0855C590 movs r2, 0x2 ldrsh r0, [r4, r2] @@ -333108,7 +333180,7 @@ sub_80B9CDC: ; 80B9CDC lsls r0, 24 cmp r0, 0 bne @080B9D16 - bl sub_808A2E4 + bl InstallCameraPanAheadCallback ldrb r0, [r4, 0xC] ldrb r1, [r4, 0xE] ldrb r2, [r4, 0x10] @@ -334060,8 +334132,8 @@ sub_80BA4C8: ; 80BA4C8 bx r0 thumb_func_end sub_80BA4C8 - thumb_func_start c2_options_menu -c2_options_menu: ; 80BA4DC + thumb_func_start CB2_OptionsMenu +CB2_OptionsMenu: ; 80BA4DC push {r4-r7,lr} mov r7, r8 push {r7} @@ -334412,7 +334484,7 @@ c2_options_menu: ; 80BA4DC pop {r0} bx r0 .pool - thumb_func_end c2_options_menu + thumb_func_end CB2_OptionsMenu thumb_func_start sub_80BA83C sub_80BA83C: ; 80BA83C @@ -334981,7 +335053,7 @@ sub_80BAC38: ; 80BAC38 movs r0, 0x1 adds r1, r6, 0 movs r2, 0xC6 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -335044,7 +335116,7 @@ sub_80BAD08: ; 80BAD08 movs r0, 0x1 adds r1, r4, 0 movs r2, 0xC6 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -335105,7 +335177,7 @@ sub_80BAD84: ; 80BAD84 movs r0, 0x1 adds r1, r4, 0 movs r2, 0xC6 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -335169,7 +335241,7 @@ sub_80BAE08: ; 80BAE08 movs r0, 0x1 adds r1, r4, 0 movs r2, 0xC6 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -335470,7 +335542,7 @@ sub_80BB028: ; 80BB028 movs r0, 0x1 adds r1, r6, 0 movs r2, 0xC6 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -338755,7 +338827,7 @@ sub_80BCE2C: ; 80BCE2C str r4, [sp, 0xC] str r2, [sp, 0x10] mov r2, r8 - bl sub_8199EEC + bl AddTextPrinterParametrized2 add sp, 0x18 pop {r3} mov r8, r3 @@ -341883,7 +341955,7 @@ sub_80BE8DC: ; 80BE8DC movs r0, 0 movs r1, 0x1 adds r2, r5, 0 - bl sub_8199EEC + bl AddTextPrinterParametrized2 add sp, 0x18 pop {r4,r5} pop {r0} @@ -343623,7 +343695,7 @@ sub_80BF82C: ; 80BF82C movs r0, 0x1 add r1, sp, 0x4 movs r2, 0xF0 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -344615,7 +344687,7 @@ sub_80C020C: ; 80C020C movs r0, 0x1 adds r1, r4, 0 movs r2, 0xF0 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -344728,7 +344800,7 @@ sub_80C020C: ; 80C020C movs r0, 0x1 adds r1, r4, 0 movs r2, 0xF0 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -345694,7 +345766,7 @@ sub_80C0A88: ; 80C0A88 str r4, [sp, 0xC] str r1, [sp, 0x10] movs r1, 0x1 - bl sub_8199EEC + bl AddTextPrinterParametrized2 add sp, 0x18 pop {r4-r6} pop {r0} @@ -346742,7 +346814,7 @@ sub_80C1270: ; 80C1270 movs r0, 0 movs r1, 0x1 adds r2, r5, 0 - bl sub_8199EEC + bl AddTextPrinterParametrized2 add sp, 0x18 pop {r4,r5} pop {r0} @@ -349394,7 +349466,7 @@ sub_80C2760: ; 80C2760 ldrb r0, [r0, 0x5] cmp r0, 0 beq @080C2960 - bl in_trade_center + bl InUnionRoom cmp r0, 0x1 beq @080C2A14 @080C2960: @@ -349438,7 +349510,7 @@ sub_80C2760: ; 80C2760 ldrb r0, [r0, 0x5] cmp r0, 0 beq @080C29C0 - bl in_trade_center + bl InUnionRoom cmp r0, 0x1 beq @080C2A14 @080C29C0: @@ -349474,7 +349546,7 @@ sub_80C2760: ; 80C2760 ldrb r0, [r0, 0x5] cmp r0, 0 beq @080C2A20 - bl in_trade_center + bl InUnionRoom cmp r0, 0x1 bne @080C2A20 @080C2A14: @@ -350879,7 +350951,7 @@ sub_80C3608: ; 80C3608 movs r0, 0x1 add r1, sp, 0xC movs r2, 0x50 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r0, 0x84 b @080C365C .pool @@ -350887,7 +350959,7 @@ sub_80C3608: ; 80C3608 movs r0, 0x1 add r1, sp, 0xC movs r2, 0x60 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r0, 0x78 @080C365C: movs r3, 0x9 @@ -350972,7 +351044,7 @@ sub_80C3684: ; 80C3684 movs r0, 0x1 adds r1, r5, 0 movs r2, 0x90 - bl sub_81DB368 + bl GetStringRightAlignXOffset movs r3, 0x38 b @080C3740 .pool @@ -350980,7 +351052,7 @@ sub_80C3684: ; 80C3684 movs r0, 0x1 adds r1, r5, 0 movs r2, 0x80 - bl sub_81DB368 + bl GetStringRightAlignXOffset movs r3, 0x39 @080C3740: lsls r2, r0, 24 @@ -351087,7 +351159,7 @@ sub_80C378C: ; 80C378C movs r0, 0x1 adds r1, r5, 0 movs r2, 0x90 - bl sub_81DB368 + bl GetStringRightAlignXOffset movs r3, 0x48 b @080C3854 .pool @@ -351095,7 +351167,7 @@ sub_80C378C: ; 80C378C movs r0, 0x1 adds r1, r5, 0 movs r2, 0x80 - bl sub_81DB368 + bl GetStringRightAlignXOffset movs r3, 0x49 @080C3854: lsls r2, r0, 24 @@ -351454,7 +351526,7 @@ sub_80C3B50: ; 80C3B50 adds r1, 0x4D movs r0, 0x1 movs r2, 0xD8 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 @@ -351563,7 +351635,7 @@ sub_80C3C34: ; 80C3C34 ldrb r2, [r0] movs r0, 0x1 mov r1, r9 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 @@ -353609,7 +353681,7 @@ sub_80C4DDC: ; 80C4DDC movs r0, 0 @080C4E1E: strh r0, [r1] - bl in_trade_center + bl InUnionRoom adds r3, r0, 0 cmp r3, 0x1 bne @080C4E3C @@ -353826,7 +353898,7 @@ sub_80C4FCC: ; 80C4FCC sub_80C4FF0: ; 80C4FF0 push {r4-r6,lr} sub sp, 0x8 - bl in_trade_center + bl InUnionRoom cmp r0, 0x1 bne @080C5060 ldr r0, =0x03003124 @@ -354843,7 +354915,7 @@ sub_80C58D4: ; 80C58D4 movs r1, 0 movs r2, 0x8 bl memset - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -355434,7 +355506,7 @@ sub_80C5DB8: ; 80C5DB8 movs r0, 0x1 adds r1, r4, 0 movs r2, 0x60 - bl sub_81DB35C + bl GetStringCenterAlignXOffset lsls r2, r0, 24 lsrs r2, 24 ldr r6, =gUnknown_08571448 @@ -355450,7 +355522,7 @@ sub_80C5DB8: ; 80C5DB8 movs r0, 0x1 adds r1, r4, 0 movs r2, 0x60 - bl sub_81DB35C + bl GetStringCenterAlignXOffset lsls r2, r0, 24 lsrs r2, 24 str r6, [sp] @@ -355482,7 +355554,7 @@ sub_80C5DB8: ; 80C5DB8 movs r0, 0x8 adds r1, r4, 0 movs r2, 0x5B - bl sub_81DB368 + bl GetStringRightAlignXOffset lsls r2, r0, 24 lsrs r2, 24 str r6, [sp] @@ -357342,7 +357414,7 @@ sub_80C6D80: ; 80C6D80 str r1, [sp, 0x10] movs r1, 0x1 movs r3, 0x1 - bl sub_8199EEC + bl AddTextPrinterParametrized2 ldr r0, [sp, 0x4C] mov r10, r4 cmp r0, 0x6 @@ -357494,7 +357566,7 @@ sub_80C6EAC: ; 80C6EAC movs r1, 0x1 movs r2, 0 movs r3, 0x2 - bl sub_8199EEC + bl AddTextPrinterParametrized2 lsrs r5, 1 adds r0, r7, 0 ldr r1, [sp, 0x24] @@ -357963,7 +358035,7 @@ c3_0808C39C: ; 80C7268 movs r0, 0 movs r1, 0x1 movs r3, 0xFF - bl text_box_related_one + bl AddTextPrinterParametrized movs r0, 0 movs r1, 0x3 bl CopyWindowToVram @@ -358069,7 +358141,7 @@ c3_0808C39C: ; 80C7268 movs r0, 0 movs r1, 0x1 movs r3, 0 - bl text_box_related_one + bl AddTextPrinterParametrized b @080C756A .pool @080C73D0: @@ -358239,7 +358311,7 @@ c3_0808C39C: ; 80C7268 movs r0, 0 movs r1, 0x1 movs r3, 0 - bl text_box_related_one + bl AddTextPrinterParametrized strh r4, [r5, 0x8] b @080C756A .pool @@ -359110,7 +359182,7 @@ sub_80C7BE4: ; 80C7BE4 movs r0, 0x1 mov r1, r10 movs r2, 0x40 - bl sub_81DB35C + bl GetStringCenterAlignXOffset lsls r2, r0, 24 lsrs r2, 24 ldr r0, =gUnknown_08571734 @@ -359136,7 +359208,7 @@ sub_80C7BE4: ; 80C7BE4 movs r0, 0x1 add r1, sp, 0xC movs r2, 0x40 - bl sub_81DB35C + bl GetStringCenterAlignXOffset lsls r2, r0, 24 lsrs r2, 24 mov r0, r8 @@ -366859,7 +366931,7 @@ sub_80CBF14: ; 80CBF14 ldr r0, [r1] ldr r0, [r0] movs r1, 0 - bl sub_8008258 + bl StartObjectRotScalAnim @080CBFC0: pop {r4} pop {r0} @@ -366965,7 +367037,7 @@ sub_80CC064: ; 80CC064 ldr r0, [r0] ldr r0, [r0] movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim @080CC094: pop {r0} bx r0 @@ -367204,7 +367276,7 @@ sub_80CC230: ; 80CC230 ldm r0!, {r3,r5,r7} stm r2!, {r3,r5,r7} adds r0, r6, 0 - bl sub_80D2E08 + bl mon_icon_convert_unown_species_id mov r10, r0 mov r6, r10 mov r2, sp @@ -376217,10 +376289,10 @@ sub_80D0D8C: ; 80D0D8C cmp r4, 0 beq @080D0E42 adds r0, r4, 0 - bl sub_80D1794 + bl GetItemIconPic adds r6, r0, 0 adds r0, r4, 0 - bl sub_80D17A4 + bl GetItemIconPalette adds r5, r0, 0 bl sub_80D12E8 adds r4, r0, 0 @@ -376365,10 +376437,10 @@ sub_80D0F38: ; 80D0F38 lsls r5, 16 lsrs r5, 16 adds r0, r5, 0 - bl sub_80D1794 + bl GetItemIconPic mov r8, r0 adds r0, r5, 0 - bl sub_80D17A4 + bl GetItemIconPalette adds r6, r0, 0 bl sub_80D12E8 adds r4, r0, 0 @@ -377183,7 +377255,7 @@ sub_80D15D4: ; 80D15D4 adds r0, r1 ldr r0, [r0] adds r1, r3, 0 - bl sub_8008258 + bl StartObjectRotScalAnim @080D15F6: pop {r0} bx r0 @@ -377366,27 +377438,27 @@ sub_80D1740: ; 80D1740 .pool thumb_func_end sub_80D1740 - thumb_func_start sub_80D1794 -sub_80D1794: ; 80D1794 + thumb_func_start GetItemIconPic +GetItemIconPic: ; 80D1794 push {lr} lsls r0, 16 lsrs r0, 16 movs r1, 0 - bl GetItemIconPic + bl GetItemIconPicOrPalette pop {r1} bx r1 - thumb_func_end sub_80D1794 + thumb_func_end GetItemIconPic - thumb_func_start sub_80D17A4 -sub_80D17A4: ; 80D17A4 + thumb_func_start GetItemIconPalette +GetItemIconPalette: ; 80D17A4 push {lr} lsls r0, 16 lsrs r0, 16 movs r1, 0x1 - bl GetItemIconPic + bl GetItemIconPicOrPalette pop {r1} bx r1 - thumb_func_end sub_80D17A4 + thumb_func_end GetItemIconPalette thumb_func_start sub_80D17B4 sub_80D17B4: ; 80D17B4 @@ -380196,6 +380268,7 @@ sub_80D2C1C: ; 80D2C1C thumb_func_end sub_80D2C1C thumb_func_start sub_80D2CC4 +; int sub_80D2CC4(u16 speciesId, int a2, u16 a3, u16 a4, u8 a5, u32 personality, int a7) sub_80D2CC4: ; 80D2CC4 push {r4-r7,lr} mov r7, r9 @@ -380336,15 +380409,16 @@ sub_80D2D78: ; 80D2D78 .pool thumb_func_end sub_80D2D78 - thumb_func_start sub_80D2E08 -sub_80D2E08: ; 80D2E08 + thumb_func_start mon_icon_convert_unown_species_id +; u16 mon_icon_convert_unown_species_id(u16 speciesId, u32 personality) +mon_icon_convert_unown_species_id: ; 80D2E08 push {lr} lsls r0, 16 lsrs r2, r0, 16 cmp r2, 0xC9 bne @080D2E32 adds r0, r1, 0 - bl sub_80D2E48 + bl mon_icon_personality_to_unown_id lsls r0, 16 lsrs r0, 16 cmp r0, 0 @@ -380372,10 +380446,10 @@ sub_80D2E08: ; 80D2E08 adds r0, r1, 0 pop {r1} bx r1 - thumb_func_end sub_80D2E08 + thumb_func_end mon_icon_convert_unown_species_id - thumb_func_start sub_80D2E48 -sub_80D2E48: ; 80D2E48 + thumb_func_start mon_icon_personality_to_unown_id +mon_icon_personality_to_unown_id: ; 80D2E48 push {lr} adds r2, r0, 0 cmp r2, 0 @@ -380407,7 +380481,7 @@ sub_80D2E48: ; 80D2E48 @080D2E80: pop {r1} bx r1 - thumb_func_end sub_80D2E48 + thumb_func_end mon_icon_personality_to_unown_id thumb_func_start sub_80D2E84 sub_80D2E84: ; 80D2E84 @@ -380449,7 +380523,7 @@ sub_80D2E84: ; 80D2E84 @080D2EC6: adds r0, r4, 0 movs r1, 0 - bl sub_80D2E08 + bl mon_icon_convert_unown_species_id lsls r0, 16 lsrs r0, 16 @080D2ED2: @@ -380460,12 +380534,13 @@ sub_80D2E84: ; 80D2E84 thumb_func_end sub_80D2E84 thumb_func_start sub_80D2EDC +; void *sub_80D2EDC(u16 speciesId, u32 personality, BOOL32) sub_80D2EDC: ; 80D2EDC push {r4,lr} adds r4, r2, 0 lsls r0, 16 lsrs r0, 16 - bl sub_80D2E08 + bl mon_icon_convert_unown_species_id lsls r0, 16 lsrs r0, 16 adds r1, r4, 0 @@ -380635,6 +380710,7 @@ sub_80D3014: ; 80D3014 thumb_func_end sub_80D3014 thumb_func_start GetMonIconTiles +; void *GetMonIconTiles(u16 speciesId, BOOL32) GetMonIconTiles: ; 80D3020 push {lr} adds r3, r1, 0 @@ -381695,7 +381771,7 @@ sub_80D3718: ; 80D3718 bne @080D38BC adds r0, r4, 0 mov r1, r10 - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 @@ -381874,7 +381950,7 @@ sub_80D3718: ; 80D3718 lsrs r6, r0, 24 adds r0, r5, 0 adds r1, r4, 0 - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 @@ -382103,7 +382179,7 @@ sub_80D3B00: ; 80D3B00 lsls r1, 16 asrs r1, 16 bl sub_80D3D5C - bl cur_mapdata_full_redraw + bl DrawWholeMapView ldr r4, =0x02039dd0 movs r0, 0x8 bl AllocZeroed @@ -382164,7 +382240,7 @@ sub_80D3C10: ; 80D3C10 asrs r5, r1, 16 adds r0, r4, 0 adds r1, r5, 0 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt adds r1, r0, 0 ldr r0, =0x00000207 cmp r1, r0 @@ -382228,7 +382304,7 @@ sub_80D3C10: ; 80D3C10 lsls r1, r7, 16 asrs r1, 16 movs r2, 0x1 - bl setmaptile_0 + bl MapGridSetMetatileIdAt b @080D3D00 @080D3CAC: movs r2, 0xE7 @@ -382255,7 +382331,7 @@ sub_80D3C10: ; 80D3C10 @080D3CD6: adds r0, r4, 0 adds r1, r5, 0 - bl setmaptile_0 + bl MapGridSetMetatileIdAt b @080D3D00 .pool @080D3CE4: @@ -382265,13 +382341,13 @@ sub_80D3C10: ; 80D3C10 asrs r1, 16 movs r2, 0x86 lsls r2, 2 - bl setmaptile_0 + bl MapGridSetMetatileIdAt b @080D3D00 @080D3CF6: adds r0, r4, 0 adds r1, r5, 0 movs r2, 0xE - bl setmaptile_0 + bl MapGridSetMetatileIdAt @080D3D00: pop {r4-r7} pop {r0} @@ -382285,7 +382361,7 @@ sub_80D3D08: ; 80D3D08 asrs r0, 16 lsls r1, 16 asrs r1, 16 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt lsls r0, 16 lsrs r1, r0, 16 adds r2, r1, 0 @@ -382361,7 +382437,7 @@ sub_80D3D5C: ; 80D3D5C asrs r5, r0, 16 adds r0, r5, 0 adds r1, r7, 0 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt mov r8, r4 cmp r0, 0x15 bne @080D3E12 @@ -382391,27 +382467,27 @@ sub_80D3D5C: ; 80D3D5C adds r1, r4, 0 movs r2, 0x82 lsls r2, 2 - bl setmaptile_0 + bl MapGridSetMetatileIdAt b @080D3E12 @080D3DE8: adds r0, r5, 0 adds r1, r4, 0 ldr r2, =0x00000281 - bl setmaptile_0 + bl MapGridSetMetatileIdAt b @080D3E12 .pool @080D3DF8: adds r0, r5, 0 adds r1, r4, 0 ldr r2, =0x00000282 - bl setmaptile_0 + bl MapGridSetMetatileIdAt b @080D3E12 .pool @080D3E08: adds r0, r5, 0 adds r1, r4, 0 ldr r2, =0x00000283 - bl setmaptile_0 + bl MapGridSetMetatileIdAt @080D3E12: lsls r0, r6, 16 asrs r5, r0, 16 @@ -382420,13 +382496,13 @@ sub_80D3D5C: ; 80D3D5C asrs r4, r0, 16 adds r0, r5, 0 adds r1, r4, 0 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt cmp r0, 0x1 bne @080D3E8C adds r4, 0x1 adds r0, r5, 0 adds r1, r4, 0 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt movs r1, 0x82 lsls r1, 2 cmp r0, r1 @@ -382434,40 +382510,40 @@ sub_80D3D5C: ; 80D3D5C adds r0, r5, 0 adds r1, r4, 0 movs r2, 0x1 - bl setmaptile_0 + bl MapGridSetMetatileIdAt @080D3E44: adds r0, r5, 0 adds r1, r4, 0 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt ldr r1, =0x00000281 cmp r0, r1 bne @080D3E5C adds r0, r5, 0 adds r1, r4, 0 ldr r2, =0x00000279 - bl setmaptile_0 + bl MapGridSetMetatileIdAt @080D3E5C: adds r0, r5, 0 adds r1, r4, 0 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt ldr r1, =0x00000282 cmp r0, r1 bne @080D3E74 adds r0, r5, 0 adds r1, r4, 0 ldr r2, =0x0000027a - bl setmaptile_0 + bl MapGridSetMetatileIdAt @080D3E74: adds r0, r5, 0 adds r1, r4, 0 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt ldr r1, =0x00000283 cmp r0, r1 bne @080D3E8C adds r0, r5, 0 adds r1, r4, 0 ldr r2, =0x0000027b - bl setmaptile_0 + bl MapGridSetMetatileIdAt @080D3E8C: movs r1, 0x80 lsls r1, 9 @@ -382572,7 +382648,7 @@ sub_80D3EF4: ; 80D3EF4 adds r4, r0, 0x3 adds r0, r5, 0 adds r1, r4, 0 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt movs r1, 0x82 lsls r1, 2 cmp r0, r1 @@ -382580,40 +382656,40 @@ sub_80D3EF4: ; 80D3EF4 adds r0, r5, 0 adds r1, r4, 0 movs r2, 0x1 - bl setmaptile_0 + bl MapGridSetMetatileIdAt @080D3F7E: adds r0, r5, 0 adds r1, r4, 0 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt ldr r1, =0x00000281 cmp r0, r1 bne @080D3F96 ldr r2, =0x00000279 adds r0, r5, 0 adds r1, r4, 0 - bl setmaptile_0 + bl MapGridSetMetatileIdAt @080D3F96: adds r0, r5, 0 adds r1, r4, 0 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt ldr r1, =0x00000282 cmp r0, r1 bne @080D3FAE ldr r2, =0x0000027a adds r0, r5, 0 adds r1, r4, 0 - bl setmaptile_0 + bl MapGridSetMetatileIdAt @080D3FAE: adds r0, r5, 0 adds r1, r4, 0 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt ldr r1, =0x00000283 cmp r0, r1 bne @080D3FC6 ldr r2, =0x0000027b adds r0, r5, 0 adds r1, r4, 0 - bl setmaptile_0 + bl MapGridSetMetatileIdAt @080D3FC6: mov r0, sp ldrb r0, [r0, 0x1] @@ -382627,7 +382703,7 @@ sub_80D3EF4: ; 80D3EF4 asrs r7, r4, 16 adds r1, r7, 0x2 adds r0, r6, 0 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt mov r9, r4 cmp r0, 0x15 bne @080D4056 @@ -382665,14 +382741,14 @@ sub_80D3EF4: ; 80D3EF4 @080D403E: adds r0, r6, 0 adds r1, r4, 0 - bl setmaptile_0 + bl MapGridSetMetatileIdAt b @080D4056 .pool @080D404C: ldr r2, =0x00000283 adds r0, r6, 0 adds r1, r4, 0 - bl setmaptile_0 + bl MapGridSetMetatileIdAt @080D4056: asrs r5, 16 mov r1, r9 @@ -382680,7 +382756,7 @@ sub_80D3EF4: ; 80D3EF4 adds r4, r0, 0x4 adds r0, r5, 0 adds r1, r4, 0 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt movs r1, 0x82 lsls r1, 2 cmp r0, r1 @@ -382688,40 +382764,40 @@ sub_80D3EF4: ; 80D3EF4 adds r0, r5, 0 adds r1, r4, 0 movs r2, 0x1 - bl setmaptile_0 + bl MapGridSetMetatileIdAt @080D4078: adds r0, r5, 0 adds r1, r4, 0 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt ldr r1, =0x00000281 cmp r0, r1 bne @080D4090 ldr r2, =0x00000279 adds r0, r5, 0 adds r1, r4, 0 - bl setmaptile_0 + bl MapGridSetMetatileIdAt @080D4090: adds r0, r5, 0 adds r1, r4, 0 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt ldr r1, =0x00000282 cmp r0, r1 bne @080D40A8 ldr r2, =0x0000027a adds r0, r5, 0 adds r1, r4, 0 - bl setmaptile_0 + bl MapGridSetMetatileIdAt @080D40A8: adds r0, r5, 0 adds r1, r4, 0 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt ldr r1, =0x00000283 cmp r0, r1 bne @080D40C0 ldr r2, =0x0000027b adds r0, r5, 0 adds r1, r4, 0 - bl setmaptile_0 + bl MapGridSetMetatileIdAt @080D40C0: mov r0, sp ldrb r0, [r0, 0x2] @@ -382735,7 +382811,7 @@ sub_80D3EF4: ; 80D3EF4 asrs r4, r0, 16 adds r1, r4, 0x3 adds r0, r5, 0 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt cmp r0, 0x15 bne @080D414A adds r4, 0x4 @@ -382772,14 +382848,14 @@ sub_80D3EF4: ; 80D3EF4 @080D4132: adds r0, r5, 0 adds r1, r4, 0 - bl setmaptile_0 + bl MapGridSetMetatileIdAt b @080D414A .pool @080D4140: ldr r2, =0x00000283 adds r0, r5, 0 adds r1, r4, 0 - bl setmaptile_0 + bl MapGridSetMetatileIdAt @080D414A: add sp, 0x4 pop {r3-r5} @@ -382910,10 +382986,10 @@ sub_80D423C: ; 80D423C asrs r4, r1, 16 adds r0, r5, 0 adds r1, r4, 0 - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 - bl sub_8089B1C + bl MetatileBehavior_IsLongGrass2 lsls r0, 24 cmp r0, 0 beq @080D42AE @@ -382950,14 +383026,14 @@ sub_80D423C: ; 80D423C @080D4296: adds r0, r5, 0 adds r1, r4, 0 - bl setmaptile_0 + bl MapGridSetMetatileIdAt b @080D42AE .pool @080D42A4: ldr r2, =0x00000283 adds r0, r5, 0 adds r1, r4, 0 - bl setmaptile_0 + bl MapGridSetMetatileIdAt @080D42AE: pop {r4,r5} pop {r0} @@ -382965,8 +383041,8 @@ sub_80D423C: ; 80D423C .pool thumb_func_end sub_80D423C - thumb_func_start task00_bag_acit_10 -task00_bag_acit_10: ; 80D42B8 + thumb_func_start sub_80D42B8 +sub_80D42B8: ; 80D42B8 push {r4,r5,lr} lsls r0, 16 asrs r4, r0, 16 @@ -382974,22 +383050,22 @@ task00_bag_acit_10: ; 80D42B8 asrs r5, r1, 16 adds r0, r4, 0 adds r1, r5, 0 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt cmp r0, 0x1 bne @080D434A adds r5, 0x1 adds r0, r4, 0 adds r1, r5, 0 - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 - bl sub_8089B30 + bl MetatileBehavior_IsLongGrassSouthEdge lsls r0, 24 cmp r0, 0 beq @080D434A adds r0, r4, 0 adds r1, r5, 0 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt adds r1, r0, 0 ldr r0, =0x00000281 cmp r1, r0 @@ -383014,7 +383090,7 @@ task00_bag_acit_10: ; 80D42B8 adds r0, r4, 0 adds r1, r5, 0 movs r2, 0x1 - bl setmaptile_0 + bl MapGridSetMetatileIdAt b @080D434A @080D4328: ldr r2, =0x00000279 @@ -383025,20 +383101,20 @@ task00_bag_acit_10: ; 80D42B8 @080D4332: adds r0, r4, 0 adds r1, r5, 0 - bl setmaptile_0 + bl MapGridSetMetatileIdAt b @080D434A .pool @080D4340: ldr r2, =0x0000027b adds r0, r4, 0 adds r1, r5, 0 - bl setmaptile_0 + bl MapGridSetMetatileIdAt @080D434A: pop {r4,r5} pop {r0} bx r0 .pool - thumb_func_end task00_bag_acit_10 + thumb_func_end sub_80D42B8 thumb_func_start sub_80D4354 sub_80D4354: ; 80D4354 @@ -383363,7 +383439,7 @@ sub_80D45C8: ; 80D45C8 cmp r0, 0xC9 bne @080D45E0 adds r0, r1, 0 - bl sub_80D2E48 + bl mon_icon_personality_to_unown_id lsls r0, 16 ldr r1, =0x75300000 adds r0, r1 @@ -383637,14 +383713,14 @@ itemid_is_mail: ; 80D47BC sub_80D47D4: ; 80D47D4 push {lr} bl sub_80A0934 - bl sub_80D47E4 + bl AddMapNamePopUpWindowTask movs r0, 0x1 pop {r1} bx r1 thumb_func_end sub_80D47D4 - thumb_func_start sub_80D47E4 -sub_80D47E4: ; 80D47E4 + thumb_func_start AddMapNamePopUpWindowTask +AddMapNamePopUpWindowTask: ; 80D47E4 push {r4,lr} movs r0, 0x80 lsls r0, 7 @@ -383653,7 +383729,7 @@ sub_80D47E4: ; 80D47E4 lsrs r0, 24 cmp r0, 0x1 beq @080D486C - ldr r4, =sub_80D487C + ldr r4, =Task_MapNamePopUpWindow adds r0, r4, 0 bl is_function_an_active_task lsls r0, 24 @@ -383711,10 +383787,10 @@ sub_80D47E4: ; 80D47E4 pop {r0} bx r0 .pool - thumb_func_end sub_80D47E4 + thumb_func_end AddMapNamePopUpWindowTask - thumb_func_start sub_80D487C -sub_80D487C: ; 80D487C + thumb_func_start Task_MapNamePopUpWindow +Task_MapNamePopUpWindow: ; 80D487C push {r4,lr} lsls r0, 24 lsrs r0, 24 @@ -383754,7 +383830,7 @@ sub_80D487C: ; 80D487C ble @080D4966 strh r1, [r4, 0x8] strh r1, [r4, 0x10] - bl sub_80D49B0 + bl ShowMapNamePopUpWindow b @080D4966 @080D48DE: ldrh r0, [r4, 0xC] @@ -383814,7 +383890,7 @@ sub_80D487C: ; 80D487C strh r0, [r4, 0x8] b @080D496E @080D494C: - bl rboxid_upload_textbox_1_no_pal + bl GetMapNamePopUpWindowId lsls r0, 24 lsrs r0, 24 movs r1, 0x1 @@ -383823,7 +383899,7 @@ sub_80D487C: ; 80D487C strh r0, [r4, 0x8] b @080D4966 @080D4960: - bl call_203AE8C + bl HideMapNamePopUpWindow b @080D496E @080D4966: ldrh r1, [r4, 0xC] @@ -383833,22 +383909,22 @@ sub_80D487C: ; 80D487C pop {r4} pop {r0} bx r0 - thumb_func_end sub_80D487C + thumb_func_end Task_MapNamePopUpWindow - thumb_func_start call_203AE8C -call_203AE8C: ; 80D4974 + thumb_func_start HideMapNamePopUpWindow +HideMapNamePopUpWindow: ; 80D4974 push {lr} - ldr r0, =sub_80D487C + ldr r0, =Task_MapNamePopUpWindow bl is_function_an_active_task lsls r0, 24 cmp r0, 0 beq @080D49A4 - bl rboxid_upload_textbox_1_no_pal + bl GetMapNamePopUpWindowId lsls r0, 24 lsrs r0, 24 movs r1, 0x1 bl sub_819746C - bl sub_8197A80 + bl RemoveMapNamePopUpWindow movs r0, 0x12 movs r1, 0 bl SetGpuReg_ScreenOff @@ -383859,13 +383935,13 @@ call_203AE8C: ; 80D4974 pop {r0} bx r0 .pool - thumb_func_end call_203AE8C + thumb_func_end HideMapNamePopUpWindow - thumb_func_start sub_80D49B0 -sub_80D49B0: ; 80D49B0 + thumb_func_start ShowMapNamePopUpWindow +ShowMapNamePopUpWindow: ; 80D49B0 push {r4,r5,lr} sub sp, 0x24 - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 beq @080D4A08 @@ -383907,12 +383983,12 @@ sub_80D49B0: ; 80D49B0 movs r2, 0 bl GetMapName @080D4A18: - bl sub_8197A40 - bl sub_80D4BE0 + bl AddMapNamePopUpWindow + bl LoadMapNamePopUpWindowBg movs r0, 0x7 adds r1, r4, 0 movs r2, 0x50 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 @@ -383924,7 +384000,7 @@ sub_80D49B0: ; 80D49B0 strb r0, [r1, 0x1] adds r0, r1, 0 strb r5, [r0, 0x2] - bl rboxid_upload_textbox_1_no_pal + bl GetMapNamePopUpWindowId lsls r0, 24 lsrs r0, 24 movs r1, 0x3 @@ -383936,7 +384012,7 @@ sub_80D49B0: ; 80D49B0 add r2, sp, 0xC adds r3, r4, 0 bl Print - bl rboxid_upload_textbox_1_no_pal + bl GetMapNamePopUpWindowId lsls r0, 24 lsrs r0, 24 movs r1, 0x3 @@ -383946,7 +384022,7 @@ sub_80D49B0: ; 80D49B0 pop {r0} bx r0 .pool - thumb_func_end sub_80D49B0 + thumb_func_end ShowMapNamePopUpWindow thumb_func_start sub_80D4A78 sub_80D4A78: ; 80D4A78 @@ -384113,11 +384189,11 @@ sub_80D4A78: ; 80D4A78 .pool thumb_func_end sub_80D4A78 - thumb_func_start sub_80D4BE0 -sub_80D4BE0: ; 80D4BE0 + thumb_func_start LoadMapNamePopUpWindowBg +LoadMapNamePopUpWindowBg: ; 80D4BE0 push {r4,r5,lr} sub sp, 0x8 - bl rboxid_upload_textbox_1_no_pal + bl GetMapNamePopUpWindowId lsls r0, 24 lsrs r5, r0, 24 ldr r0, =0x02037318 @@ -384193,10 +384269,11 @@ sub_80D4BE0: ; 80D4BE0 pop {r0} bx r0 .pool - thumb_func_end sub_80D4BE0 + thumb_func_end LoadMapNamePopUpWindowBg - thumb_func_start sub_80D4CA8 -sub_80D4CA8: ; 80D4CA8 + thumb_func_start RemoveBagObject +; void RemoveBagObject(u8 a1) +RemoveBagObject: ; 80D4CA8 push {r4,r5,lr} lsls r0, 24 lsrs r4, r0, 24 @@ -384233,10 +384310,11 @@ sub_80D4CA8: ; 80D4CA8 pop {r0} bx r0 .pool - thumb_func_end sub_80D4CA8 + thumb_func_end RemoveBagObject - thumb_func_start sub_80D4D00 -sub_80D4D00: ; 80D4D00 + thumb_func_start AddBagVisualObject +; void AddBagVisualObject(u8 bagPocketId) +AddBagVisualObject: ; 80D4D00 push {r4,r5,lr} adds r5, r0, 0 lsls r5, 24 @@ -384253,15 +384331,16 @@ sub_80D4D00: ; 80D4D00 strb r0, [r4] adds r0, r5, 0 movs r1, 0 - bl sub_80D4D38 + bl SetBagVisualPocketId pop {r4,r5} pop {r0} bx r0 .pool - thumb_func_end sub_80D4D00 + thumb_func_end AddBagVisualObject - thumb_func_start sub_80D4D38 -sub_80D4D38: ; 80D4D38 + thumb_func_start SetBagVisualPocketId +; void SetBagVisualPocketId(u8 bagPocketId, BOOL isSwitchingPockets) +SetBagVisualPocketId: ; 80D4D38 push {lr} lsls r0, 24 lsrs r3, r0, 24 @@ -384280,7 +384359,7 @@ sub_80D4D38: ; 80D4D38 beq @080D4D84 ldr r0, =0x0000fffb strh r0, [r2, 0x26] - ldr r0, =sub_80D4D94 + ldr r0, =ObjectCB_BagVisualSwitchingPockets str r0, [r2, 0x1C] adds r0, r3, 0x1 strh r0, [r2, 0x2E] @@ -384298,10 +384377,11 @@ sub_80D4D38: ; 80D4D38 @080D4D90: pop {r0} bx r0 - thumb_func_end sub_80D4D38 + thumb_func_end SetBagVisualPocketId - thumb_func_start sub_80D4D94 -sub_80D4D94: ; 80D4D94 + thumb_func_start ObjectCB_BagVisualSwitchingPockets +; void ObjectCB_BagVisualSwitchingPockets(struct obj *object) +ObjectCB_BagVisualSwitchingPockets: ; 80D4D94 push {r4,lr} adds r4, r0, 0 ldrh r1, [r4, 0x26] @@ -384325,10 +384405,11 @@ sub_80D4D94: ; 80D4D94 pop {r0} bx r0 .pool - thumb_func_end sub_80D4D94 + thumb_func_end ObjectCB_BagVisualSwitchingPockets - thumb_func_start sub_80D4DC4 -sub_80D4DC4: ; 80D4DC4 + thumb_func_start ShakeBagVisual +; void ShakeBagVisual() +ShakeBagVisual: ; 80D4DC4 push {r4,lr} ldr r0, =0x0203ce54 ldr r0, [r0] @@ -384349,18 +384430,19 @@ sub_80D4DC4: ; 80D4DC4 beq @080D4DF4 adds r0, r4, 0 movs r1, 0x1 - bl sub_8008258 - ldr r0, =sub_80D4E0C + bl StartObjectRotScalAnim + ldr r0, =ObjectCB_ShakeBagVisual str r0, [r4, 0x1C] @080D4DF4: pop {r4} pop {r0} bx r0 .pool - thumb_func_end sub_80D4DC4 + thumb_func_end ShakeBagVisual - thumb_func_start sub_80D4E0C -sub_80D4E0C: ; 80D4E0C + thumb_func_start ObjectCB_ShakeBagVisual +; void ObjectCB_ShakeBagVisual(struct obj *object) +ObjectCB_ShakeBagVisual: ; 80D4E0C push {r4,lr} adds r4, r0, 0 adds r0, 0x3F @@ -384371,7 +384453,7 @@ sub_80D4E0C: ; 80D4E0C beq @080D4E28 adds r0, r4, 0 movs r1, 0 - bl sub_8008258 + bl StartObjectRotScalAnim ldr r0, =DummyObjectCallback str r0, [r4, 0x1C] @080D4E28: @@ -384379,10 +384461,11 @@ sub_80D4E0C: ; 80D4E0C pop {r0} bx r0 .pool - thumb_func_end sub_80D4E0C + thumb_func_end ObjectCB_ShakeBagVisual - thumb_func_start sub_80D4E34 -sub_80D4E34: ; 80D4E34 + thumb_func_start AddSwitchPocketRotatingBallObject +; void AddSwitchPocketRotatingBallObject(u16 rotationDirection) +AddSwitchPocketRotatingBallObject: ; 80D4E34 push {r4,r5,lr} adds r5, r0, 0 lsls r5, 16 @@ -384412,10 +384495,11 @@ sub_80D4E34: ; 80D4E34 pop {r0} bx r0 .pool - thumb_func_end sub_80D4E34 + thumb_func_end AddSwitchPocketRotatingBallObject - thumb_func_start sub_80D4E8C -sub_80D4E8C: ; 80D4E8C + thumb_func_start update_switch_pocket_rotating_ball_coords +; void update_switch_pocket_rotating_ball_coords(struct obj *object) +update_switch_pocket_rotating_ball_coords: ; 80D4E8C ldrh r2, [r0, 0x30] ldrh r1, [r0, 0x34] adds r1, 0x1 @@ -384433,10 +384517,11 @@ sub_80D4E8C: ; 80D4E8C adds r0, 0x29 strb r2, [r0] bx lr - thumb_func_end sub_80D4E8C + thumb_func_end update_switch_pocket_rotating_ball_coords - thumb_func_start sub_80D4EB0 -sub_80D4EB0: ; 80D4EB0 + thumb_func_start ObjectCB_SwitchPocketRotatingBallInit +; void ObjectCB_SwitchPocketRotatingBallInit(struct obj *object) +ObjectCB_SwitchPocketRotatingBallInit: ; 80D4EB0 push {r4,lr} adds r4, r0, 0 ldrb r1, [r4, 0x1] @@ -384474,38 +384559,40 @@ sub_80D4EB0: ; 80D4EB0 asrs r0, 24 strh r0, [r4, 0x30] adds r0, r4, 0 - bl sub_80D4E8C - ldr r0, =sub_80D4F14 + bl update_switch_pocket_rotating_ball_coords + ldr r0, =ObjectCB_SwitchPocketRotatingBallContinue str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .pool - thumb_func_end sub_80D4EB0 + thumb_func_end ObjectCB_SwitchPocketRotatingBallInit - thumb_func_start sub_80D4F14 -sub_80D4F14: ; 80D4F14 + thumb_func_start ObjectCB_SwitchPocketRotatingBallContinue +; void ObjectCB_SwitchPocketRotatingBallContinue(struct obj *object) +ObjectCB_SwitchPocketRotatingBallContinue: ; 80D4F14 push {r4,lr} adds r4, r0, 0 ldrh r0, [r4, 0x34] adds r0, 0x1 strh r0, [r4, 0x34] adds r0, r4, 0 - bl sub_80D4E8C + bl update_switch_pocket_rotating_ball_coords movs r1, 0x34 ldrsh r0, [r4, r1] cmp r0, 0x10 bne @080D4F32 movs r0, 0x1 - bl sub_80D4CA8 + bl RemoveBagObject @080D4F32: pop {r4} pop {r0} bx r0 - thumb_func_end sub_80D4F14 + thumb_func_end ObjectCB_SwitchPocketRotatingBallContinue - thumb_func_start sub_80D4F38 -sub_80D4F38: ; 80D4F38 + thumb_func_start AddBagItemIconObject +; void AddBagItemIconObject(u16 itemId, u8 a2) +AddBagItemIconObject: ; 80D4F38 push {r4-r6,lr} lsls r0, 16 lsrs r6, r0, 16 @@ -384547,20 +384634,21 @@ sub_80D4F38: ; 80D4F38 pop {r0} bx r0 .pool - thumb_func_end sub_80D4F38 + thumb_func_end AddBagItemIconObject - thumb_func_start sub_80D4F98 -sub_80D4F98: ; 80D4F98 + thumb_func_start RemoveBagItemIconObject +; void RemoveBagItemIconObject(u8 a1) +RemoveBagItemIconObject: ; 80D4F98 push {lr} lsls r0, 24 movs r1, 0x80 lsls r1, 18 adds r0, r1 lsrs r0, 24 - bl sub_80D4CA8 + bl RemoveBagObject pop {r0} bx r0 - thumb_func_end sub_80D4F98 + thumb_func_end RemoveBagItemIconObject thumb_func_start sub_80D4FAC sub_80D4FAC: ; 80D4FAC @@ -384784,7 +384872,7 @@ sub_80D511C: ; 80D511C ldr r1, =0x02020630 adds r0, r1 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim @080D5172: adds r0, r4, 0 pop {r3} @@ -387442,7 +387530,7 @@ sub_80D6660: ; 80D6660 ldr r0, =gUnknown_085897E4 adds r1, r0 adds r0, r4, 0 - bl sub_80D66C4 + bl GetBerryCountString b @080D66BE .pool @080D66B0: @@ -387457,8 +387545,9 @@ sub_80D6660: ; 80D6660 bx r0 thumb_func_end sub_80D6660 - thumb_func_start sub_80D66C4 -sub_80D66C4: ; 80D66C4 + thumb_func_start GetBerryCountString +; void GetBerryCountString(struct berry_info *berryInfo, u8 *dest, u32 berryCount) +GetBerryCountString: ; 80D66C4 push {r4,lr} ldr r4, =gUnknown_085EFCE5 cmp r2, 0x1 @@ -387475,10 +387564,11 @@ sub_80D66C4: ; 80D66C4 pop {r0} bx r0 .pool - thumb_func_end sub_80D66C4 + thumb_func_end GetBerryCountString - thumb_func_start sub_80D66EC -sub_80D66EC: ; 80D66EC + thumb_func_start IsBagPocketNonEmpty +; BOOL IsBagPocketNonEmpty(u8 pocketId) +IsBagPocketNonEmpty: ; 80D66EC push {lr} lsls r0, 24 movs r2, 0 @@ -387510,7 +387600,7 @@ sub_80D66EC: ; 80D66EC @080D6720: pop {r1} bx r1 - thumb_func_end sub_80D66EC + thumb_func_end IsBagPocketNonEmpty thumb_func_start sub_80D6724 sub_80D6724: ; 80D6724 @@ -387524,7 +387614,7 @@ sub_80D6724: ; 80D6724 lsls r0, 24 cmp r0, 0 beq @080D67B6 - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 bne @080D6752 @@ -387644,7 +387734,7 @@ sub_80D6800: ; 80D6800 lsls r0, 24 cmp r0, 0 beq @080D6906 - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 bne @080D6838 @@ -387799,7 +387889,7 @@ bag_add_item: ; 80D6928 movs r0, 0 b @080D6A92 @080D694C: - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 bne @080D6964 @@ -387985,7 +388075,7 @@ sub_80D6AA4: ; 80D6AA4 mov r0, r8 cmp r0, 0 beq @080D6B38 - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 bne @080D6AE0 @@ -388044,7 +388134,7 @@ sub_80D6AA4: ; 80D6AA4 b @080D6C5A .pool @080D6B40: - bl sub_80E9214 + bl CurrentMapIsSecretBase lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -395994,7 +396084,7 @@ sub_80DAF1C: ; 80DAF1C movs r0, 0x7 adds r1, r4, 0 movs r2, 0x60 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r2, r0, 0 cmp r2, 0x37 ble @080DAF5C @@ -396373,7 +396463,7 @@ sub_80DB174: ; 80DB174 ldr r1, =0x02020630 adds r0, r1 movs r1, 0 - bl sub_8008258 + bl StartObjectRotScalAnim adds r0, r7, 0 pop {r3} mov r8, r3 @@ -399636,14 +399726,14 @@ sub_80DCBE8: ; 80DCBE8 lsls r5, 24 lsrs r5, 24 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim lsls r4, r5, 4 adds r4, r5 lsls r4, 2 mov r1, r8 adds r0, r4, r1 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim movs r2, 0x1C add r8, r2 add r6, r8 @@ -402938,7 +403028,7 @@ sub_80DE69C: ; 80DE69C lsls r0, 2 adds r0, r6 mov r1, r8 - bl sub_8008258 + bl StartObjectRotScalAnim mov r0, r8 cmp r0, 0x2 bne @080DE74C @@ -405716,14 +405806,14 @@ sub_80DFCF8: ; 80DFCF8 ldr r1, =gUnknown_085E95C7 ldr r2, =sub_80DFD44 adds r0, r4, 0 - bl sub_81978EC + bl DisplayItemMessageOnField b @080DFD36 .pool @080DFD2C: ldr r1, =gUnknown_085E959B ldr r2, =sub_80DFD44 adds r0, r5, 0 - bl sub_81978EC + bl DisplayItemMessageOnField @080DFD36: pop {r4,r5} pop {r0} @@ -406203,7 +406293,7 @@ PrintShopBuyPrice: ; 80E0114 movs r0, 0x7 adds r1, r4, 0 movs r2, 0x78 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 @@ -406219,7 +406309,7 @@ PrintShopBuyPrice: ; 80E0114 adds r0, r6, 0 movs r1, 0x7 adds r3, r7, 0 - bl sub_8199EEC + bl AddTextPrinterParametrized2 @080E01AC: add sp, 0x14 pop {r4-r7} @@ -406372,7 +406462,7 @@ AddItemIconObjectInShop: ; 80E0284 movs r1, 0x14 movs r2, 0x54 movs r3, 0x1 - bl sub_81295CC + bl AddDecorationIconObject lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x40 @@ -406572,7 +406662,7 @@ sub_80E04A4: ; 80E04A4 str r6, [sp, 0xC] str r1, [sp, 0x10] movs r1, 0x1 - bl sub_8199EEC + bl AddTextPrinterParametrized2 add sp, 0x14 pop {r4-r6} pop {r0} @@ -406601,7 +406691,7 @@ sub_80E04E8: ; 80E04E8 movs r1, 0x5 movs r2, 0xA movs r3, 0xE - bl sub_8121E7C + bl DisplayMessageAndContinueTask movs r0, 0 bl schedule_bg_copy_tilemap_to_vram add sp, 0x10 @@ -406667,7 +406757,7 @@ sub_80E0584: ; 80E0584 adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + bl GetXYCoordsOneStepInFrontOfPlayer mov r1, sp mov r0, sp ldrh r0, [r0] @@ -406694,7 +406784,7 @@ sub_80E0584: ; 80E0584 movs r3, 0 ldrsh r1, [r2, r3] add r1, r8 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt lsls r0, 16 lsrs r6, r0, 16 adds r0, r5, 0 @@ -406712,7 +406802,7 @@ sub_80E0584: ; 80E0584 movs r3, 0 ldrsh r1, [r2, r3] add r1, r8 - bl cur_mapdata_block_get_bgs_at + bl MapGridGetMetatileLayerTypeAt lsls r0, 24 lsrs r5, r0, 24 b @080E060A @@ -406904,7 +406994,7 @@ sub_80E075C: ; 80E075C adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + bl GetXYCoordsOneStepInFrontOfPlayer movs r7, 0 ldr r5, =0x02039f70 ldr r3, =0x00002010 @@ -406986,7 +407076,7 @@ sub_80E075C: ; 80E075C subs r1, r7, 0x2 add r1, r12 str r3, [sp, 0x10] - bl cur_mapdata_block_get_bgs_at + bl MapGridGetMetatileLayerTypeAt mov r1, r9 ldr r2, [r1] ldr r1, =0x00002018 @@ -407155,7 +407245,7 @@ sub_80E08F0: ; 80E08F0 str r0, [sp] adds r0, r4, 0 ldr r1, =DummyObjectCallback - bl sub_808DD68 + bl AddPseudoFieldObject lsls r0, 24 lsrs r4, r0, 24 adds r6, r4, 0 @@ -408257,7 +408347,7 @@ sub_80E12E8: ; 80E12E8 adds r5, r1, r0 adds r0, r5, 0 adds r1, r6, 0 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt movs r2, 0 ldrsh r1, [r7, r2] lsls r0, 16 @@ -408272,7 +408362,7 @@ sub_80E12E8: ; 80E12E8 orrs r2, r0 adds r0, r5, 0 adds r1, r6, 0 - bl setmaptile_0 + bl MapGridSetMetatileIdAt b @080E1390 .pool @080E1380: @@ -408282,7 +408372,7 @@ sub_80E12E8: ; 80E12E8 orrs r2, r0 adds r0, r5, 0 adds r1, r6, 0 - bl setmaptile_0 + bl MapGridSetMetatileIdAt @080E1390: movs r2, 0x80 lsls r2, 9 @@ -408322,7 +408412,7 @@ sub_80E12E8: ; 80E12E8 adds r5, r1, r0 adds r0, r5, 0 adds r1, r6, 0 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt movs r1, 0x2 subs r1, r7 lsls r1, 1 @@ -408344,7 +408434,7 @@ sub_80E12E8: ; 80E12E8 orrs r2, r0 adds r0, r5, 0 adds r1, r6, 0 - bl setmaptile_0 + bl MapGridSetMetatileIdAt b @080E141A @080E140A: mov r1, r9 @@ -408353,7 +408443,7 @@ sub_80E12E8: ; 80E12E8 orrs r2, r0 adds r0, r5, 0 adds r1, r6, 0 - bl setmaptile_0 + bl MapGridSetMetatileIdAt @080E141A: movs r2, 0x80 lsls r2, 9 @@ -408457,7 +408547,7 @@ sub_80E1444: ; 80E1444 adds r5, r0, 0 cmp r5, 0 bne @080E1502 - bl cur_mapdata_full_redraw + bl DrawWholeMapView movs r1, 0x2 ldrsh r0, [r4, r1] adds r0, 0x1 @@ -408656,9 +408746,9 @@ sub_80E162C: ; 80E162C bx r1 thumb_func_end sub_80E162C - thumb_func_start GetRomBerryInfo -; struct berry_info *GetRomBerryInfo(u8 berryId) -GetRomBerryInfo: ; 80E167C + thumb_func_start GetBerryInfo +; struct berry_info *GetBerryInfo(u8 berryType) +GetBerryInfo: ; 80E167C push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 @@ -408690,7 +408780,7 @@ GetRomBerryInfo: ; 80E167C pop {r1} bx r1 .pool - thumb_func_end GetRomBerryInfo + thumb_func_end GetBerryInfo thumb_func_start GetBerryTreeInfo ; struct BerryTreeInfo *GetBerryTreeInfo(u8 berryTreeId) @@ -408707,8 +408797,9 @@ GetBerryTreeInfo: ; 80E16C0 .pool thumb_func_end GetBerryTreeInfo - thumb_func_start SetBerryTreeWateredFlag -SetBerryTreeWateredFlag: ; 80E16DC + thumb_func_start FieldObjectInteractionWaterBerryTree +; BOOL FieldObjectInteractionWaterBerryTree() +FieldObjectInteractionWaterBerryTree: ; 80E16DC push {lr} ldr r0, =0x03005df0 ldrb r0, [r0] @@ -408761,12 +408852,13 @@ SetBerryTreeWateredFlag: ; 80E16DC @080E1734: pop {r1} bx r1 - thumb_func_end SetBerryTreeWateredFlag + thumb_func_end FieldObjectInteractionWaterBerryTree - thumb_func_start sub_80E1738 -sub_80E1738: ; 80E1738 + thumb_func_start IsPlayerFacingPlantedBerryTree +; BOOL IsPlayerFacingPlantedBerryTree() +IsPlayerFacingPlantedBerryTree: ; 80E1738 push {lr} - bl sub_809D280 + bl GetFieldObjectScriptPointerForComparison ldr r1, =gUnknown_082742F9 cmp r0, r1 bne @080E1768 @@ -408775,7 +408867,7 @@ sub_80E1738: ; 80E1738 bl FieldObjectGetBerryTreeId lsls r0, 24 lsrs r0, 24 - bl get_berry_tree_stage + bl GetStageByBerryTreeId lsls r0, 24 cmp r0, 0 bne @080E1768 @@ -408787,16 +408879,17 @@ sub_80E1738: ; 80E1738 @080E176A: pop {r1} bx r1 - thumb_func_end sub_80E1738 + thumb_func_end IsPlayerFacingPlantedBerryTree - thumb_func_start sub_80E1770 -sub_80E1770: ; 80E1770 + thumb_func_start WaterBerryTree +; BOOL WaterBerryTree() +WaterBerryTree: ; 80E1770 push {lr} - bl sub_809D280 + bl GetFieldObjectScriptPointerForComparison ldr r1, =gUnknown_082742F9 cmp r0, r1 bne @080E178C - bl SetBerryTreeWateredFlag + bl FieldObjectInteractionWaterBerryTree lsls r0, 24 lsrs r0, 24 b @080E178E @@ -408806,10 +408899,11 @@ sub_80E1770: ; 80E1770 @080E178E: pop {r1} bx r1 - thumb_func_end sub_80E1770 + thumb_func_end WaterBerryTree - thumb_func_start sub_80E1794 -sub_80E1794: ; 80E1794 + thumb_func_start RemoveAllBerryTrees +; void RemoveAllBerryTrees() +RemoveAllBerryTrees: ; 80E1794 push {r4-r6,lr} movs r2, 0 ldr r6, =0x03005d8c @@ -408831,10 +408925,11 @@ sub_80E1794: ; 80E1794 pop {r0} bx r0 .pool - thumb_func_end sub_80E1794 + thumb_func_end RemoveAllBerryTrees - thumb_func_start sub_80E17C8 -sub_80E17C8: ; 80E17C8 + thumb_func_start BerryTreeGrow +; BOOL BerryTreeGrow(struct BerryTreeInfo *berryTree) +BerryTreeGrow: ; 80E17C8 push {r4,lr} adds r4, r0, 0 ldrb r1, [r4, 0x1] @@ -408866,7 +408961,7 @@ sub_80E17C8: ; 80E17C8 .4byte @080E1828 @080E1808: adds r0, r4, 0 - bl sub_80E1B38 + bl CalcBerryYield strb r0, [r4, 0x4] @080E1810: ldrb r2, [r4, 0x1] @@ -408919,10 +409014,11 @@ sub_80E17C8: ; 80E17C8 pop {r1} bx r1 .pool - thumb_func_end sub_80E17C8 + thumb_func_end BerryTreeGrow - thumb_func_start sub_80E1870 -sub_80E1870: ; 80E1870 + thumb_func_start BerryTreeTimeUpdate +; void BerryTreeTimeUpdate(s32 deltaSeconds) +BerryTreeTimeUpdate: ; 80E1870 push {r4-r7,lr} adds r6, r0, 0 movs r2, 0 @@ -408947,7 +409043,7 @@ sub_80E1870: ; 80E1870 cmp r0, 0 bne @080E1910 ldrb r0, [r4] - bl sub_80E1B7C + bl GetStageDurationByBerryType lsls r0, 16 lsrs r0, 16 lsls r1, r0, 3 @@ -408975,10 +409071,10 @@ sub_80E1870: ; 80E1870 @080E18DC: subs r5, r1 ldrb r0, [r4] - bl sub_80E1B7C + bl GetStageDurationByBerryType strh r0, [r4, 0x2] adds r0, r4, 0 - bl sub_80E17C8 + bl BerryTreeGrow cmp r0, 0 beq @080E1910 ldrb r1, [r4, 0x1] @@ -409006,10 +409102,11 @@ sub_80E1870: ; 80E1870 pop {r4-r7} pop {r0} bx r0 - thumb_func_end sub_80E1870 + thumb_func_end BerryTreeTimeUpdate - thumb_func_start sub_80E191C -sub_80E191C: ; 80E191C + thumb_func_start PlantBerryTree +; void PlantBerryTree(u8 berryTreeId, u8 berryType, u8 stage, u8 a4) +PlantBerryTree: ; 80E191C push {r4-r7,lr} adds r4, r1, 0 adds r5, r2, 0 @@ -409030,7 +409127,7 @@ sub_80E191C: ; 80E191C str r1, [r6, 0x4] strb r4, [r6] adds r0, r4, 0 - bl sub_80E1B7C + bl GetStageDurationByBerryType strh r0, [r6, 0x2] movs r1, 0x7F ands r1, r5 @@ -409043,7 +409140,7 @@ sub_80E191C: ; 80E191C cmp r5, 0x5 bne @080E196E adds r0, r6, 0 - bl sub_80E1B38 + bl CalcBerryYield strb r0, [r6, 0x4] ldrh r0, [r6, 0x2] lsls r0, 2 @@ -409060,10 +409157,11 @@ sub_80E191C: ; 80E191C pop {r0} bx r0 .pool - thumb_func_end sub_80E191C + thumb_func_end PlantBerryTree - thumb_func_start sub_80E1984 -sub_80E1984: ; 80E1984 + thumb_func_start RemoveBerryTree +; void RemoveBerryTree(u8 berryTreeId) +RemoveBerryTree: ; 80E1984 lsls r0, 24 ldr r1, =0x03005d8c ldr r2, [r1] @@ -409078,10 +409176,11 @@ sub_80E1984: ; 80E1984 str r1, [r2, 0x4] bx lr .pool - thumb_func_end sub_80E1984 + thumb_func_end RemoveBerryTree - thumb_func_start get_berry_tree_type -get_berry_tree_type: ; 80E19AC + thumb_func_start GetBerryTypeByBerryTreeId +; u8 GetBerryTypeByBerryTreeId(u8 berryTreeId) +GetBerryTypeByBerryTreeId: ; 80E19AC lsls r0, 24 ldr r1, =0x03005d8c ldr r1, [r1] @@ -409092,10 +409191,11 @@ get_berry_tree_type: ; 80E19AC ldrb r0, [r1] bx lr .pool - thumb_func_end get_berry_tree_type + thumb_func_end GetBerryTypeByBerryTreeId - thumb_func_start get_berry_tree_stage -get_berry_tree_stage: ; 80E19C8 + thumb_func_start GetStageByBerryTreeId +; u8 GetStageByBerryTreeId(u8 berryTreeId) +GetStageByBerryTreeId: ; 80E19C8 lsls r0, 24 ldr r1, =0x03005d8c ldr r1, [r1] @@ -409108,10 +409208,11 @@ get_berry_tree_stage: ; 80E19C8 lsrs r0, 25 bx lr .pool - thumb_func_end get_berry_tree_stage + thumb_func_end GetStageByBerryTreeId - thumb_func_start berryid_from_itemid -berryid_from_itemid: ; 80E19E8 + thumb_func_start ItemIdToBerryType +; u8 ItemIdToBerryType(u16 itemId) +ItemIdToBerryType: ; 80E19E8 push {lr} lsls r0, 16 lsrs r1, r0, 16 @@ -409131,10 +409232,11 @@ berryid_from_itemid: ; 80E19E8 @080E1A0A: pop {r1} bx r1 - thumb_func_end berryid_from_itemid + thumb_func_end ItemIdToBerryType - thumb_func_start sub_80E1A10 -sub_80E1A10: ; 80E1A10 + thumb_func_start BerryTypeToItemId +; u16 BerryTypeToItemId(u16 berryType) +BerryTypeToItemId: ; 80E1A10 push {lr} lsls r0, 16 lsrs r1, r0, 16 @@ -409154,15 +409256,16 @@ sub_80E1A10: ; 80E1A10 @080E1A32: pop {r1} bx r1 - thumb_func_end sub_80E1A10 + thumb_func_end BerryTypeToItemId - thumb_func_start sub_80E1A38 -sub_80E1A38: ; 80E1A38 + thumb_func_start GetBerryNameByBerryType +; void GetBerryNameByBerryType(u8 berryType, u8 *dest) +GetBerryNameByBerryType: ; 80E1A38 push {r4,lr} adds r4, r1, 0 lsls r0, 24 lsrs r0, 24 - bl GetRomBerryInfo + bl GetBerryInfo adds r1, r0, 0 adds r0, r4, 0 movs r2, 0x6 @@ -409172,27 +409275,29 @@ sub_80E1A38: ; 80E1A38 pop {r4} pop {r0} bx r0 - thumb_func_end sub_80E1A38 + thumb_func_end GetBerryNameByBerryType - thumb_func_start sub_80E1A58 -sub_80E1A58: ; 80E1A58 + thumb_func_start GetBerryCountStringByBerryType +; void GetBerryCountStringByBerryType(u8 berryType, u8 *dest, u32 berryCount) +GetBerryCountStringByBerryType: ; 80E1A58 push {r4,r5,lr} adds r4, r1, 0 adds r5, r2, 0 lsls r0, 24 lsrs r0, 24 - bl GetRomBerryInfo + bl GetBerryInfo adds r1, r0, 0 adds r0, r4, 0 adds r2, r5, 0 - bl sub_80D66C4 + bl GetBerryCountString pop {r4,r5} pop {r0} bx r0 - thumb_func_end sub_80E1A58 + thumb_func_end GetBerryCountStringByBerryType - thumb_func_start sub_80E1A78 -sub_80E1A78: ; 80E1A78 + thumb_func_start ResetBerryTreeSparkleFlag +; void ResetBerryTreeSparkleFlag(u8 berryTreeId) +ResetBerryTreeSparkleFlag: ; 80E1A78 push {lr} lsls r0, 24 lsrs r0, 24 @@ -409203,10 +409308,11 @@ sub_80E1A78: ; 80E1A78 strb r1, [r0, 0x1] pop {r0} bx r0 - thumb_func_end sub_80E1A78 + thumb_func_end ResetBerryTreeSparkleFlag - thumb_func_start sub_80E1A90 -sub_80E1A90: ; 80E1A90 + thumb_func_start BerryTreeGetNumStagesWatered +; u8 BerryTreeGetNumStagesWatered(struct BerryTreeInfo *berryTree) +BerryTreeGetNumStagesWatered: ; 80E1A90 push {lr} ldrb r2, [r0, 0x5] movs r0, 0x10 @@ -409240,23 +409346,25 @@ sub_80E1A90: ; 80E1A90 adds r0, r1, 0 pop {r1} bx r1 - thumb_func_end sub_80E1A90 + thumb_func_end BerryTreeGetNumStagesWatered - thumb_func_start sub_80E1ACC -sub_80E1ACC: ; 80E1ACC + thumb_func_start GetNumStagesWateredByBerryTreeId +; u8 GetNumStagesWateredByBerryTreeId(u8 berryTreeId) +GetNumStagesWateredByBerryTreeId: ; 80E1ACC push {lr} lsls r0, 24 lsrs r0, 24 bl GetBerryTreeInfo - bl sub_80E1A90 + bl BerryTreeGetNumStagesWatered lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 - thumb_func_end sub_80E1ACC + thumb_func_end GetNumStagesWateredByBerryTreeId - thumb_func_start sub_80E1AE4 -sub_80E1AE4: ; 80E1AE4 + thumb_func_start CalcBerryYieldInternal +; u8 CalcBerryYieldInternal(u16 max, u16 min, u8 numStagesWatered) +CalcBerryYieldInternal: ; 80E1AE4 push {r4-r6,lr} lsls r0, 16 lsrs r0, 16 @@ -409300,33 +409408,35 @@ sub_80E1AE4: ; 80E1AE4 pop {r4-r6} pop {r1} bx r1 - thumb_func_end sub_80E1AE4 + thumb_func_end CalcBerryYieldInternal - thumb_func_start sub_80E1B38 -sub_80E1B38: ; 80E1B38 + thumb_func_start CalcBerryYield +; u8 CalcBerryYield(struct BerryTreeInfo *berryTree) +CalcBerryYield: ; 80E1B38 push {r4-r6,lr} adds r4, r0, 0 ldrb r0, [r4] - bl GetRomBerryInfo + bl GetBerryInfo ldrb r6, [r0, 0xB] ldrb r5, [r0, 0xA] adds r0, r4, 0 - bl sub_80E1A90 + bl BerryTreeGetNumStagesWatered adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r5, 0 adds r1, r6, 0 - bl sub_80E1AE4 + bl CalcBerryYieldInternal lsls r0, 24 lsrs r0, 24 pop {r4-r6} pop {r1} bx r1 - thumb_func_end sub_80E1B38 + thumb_func_end CalcBerryYield - thumb_func_start sub_80E1B64 -sub_80E1B64: ; 80E1B64 + thumb_func_start GetBerryCountByBerryTreeId +; u8 GetBerryCountByBerryTreeId(u8 berryTreeId) +GetBerryCountByBerryTreeId: ; 80E1B64 lsls r0, 24 ldr r1, =0x03005d8c ldr r1, [r1] @@ -409338,14 +409448,15 @@ sub_80E1B64: ; 80E1B64 ldrb r0, [r1] bx lr .pool - thumb_func_end sub_80E1B64 + thumb_func_end GetBerryCountByBerryTreeId - thumb_func_start sub_80E1B7C -sub_80E1B7C: ; 80E1B7C + thumb_func_start GetStageDurationByBerryType +; u16 GetStageDurationByBerryType(u8 berryType) +GetStageDurationByBerryType: ; 80E1B7C push {lr} lsls r0, 24 lsrs r0, 24 - bl GetRomBerryInfo + bl GetBerryInfo ldrb r1, [r0, 0x14] lsls r0, r1, 4 subs r0, r1 @@ -409353,10 +409464,11 @@ sub_80E1B7C: ; 80E1B7C lsrs r0, 16 pop {r1} bx r1 - thumb_func_end sub_80E1B7C + thumb_func_end GetStageDurationByBerryType - thumb_func_start sub_80E1B94 -sub_80E1B94: ; 80E1B94 + thumb_func_start FieldObjectInteractionGetBerryTreeData +; void FieldObjectInteractionGetBerryTreeData() +FieldObjectInteractionGetBerryTreeData: ; 80E1B94 push {r4-r6,lr} ldr r0, =0x03005df0 ldrb r0, [r0] @@ -409364,11 +409476,11 @@ sub_80E1B94: ; 80E1B94 lsls r0, 24 lsrs r5, r0, 24 adds r0, r5, 0 - bl get_berry_tree_type + bl GetBerryTypeByBerryTreeId lsls r0, 24 lsrs r6, r0, 24 adds r0, r5, 0 - bl sub_80E1A78 + bl ResetBerryTreeSparkleFlag ldr r0, =0x020375f2 ldrb r0, [r0] ldr r1, =0x03005d8c @@ -409387,53 +409499,55 @@ sub_80E1B94: ; 80E1B94 @080E1BE0: ldr r4, =0x020375e0 adds r0, r5, 0 - bl get_berry_tree_stage + bl GetStageByBerryTreeId lsls r0, 24 lsrs r0, 24 strh r0, [r4] @080E1BEE: ldr r4, =0x020375e2 adds r0, r5, 0 - bl sub_80E1ACC + bl GetNumStagesWateredByBerryTreeId lsls r0, 24 lsrs r0, 24 strh r0, [r4] ldr r4, =0x020375e4 adds r0, r5, 0 - bl sub_80E1B64 + bl GetBerryCountByBerryTreeId lsls r0, 24 lsrs r0, 24 strh r0, [r4] ldr r1, =0x02021cc4 ldrh r2, [r4] adds r0, r6, 0 - bl sub_80E1A58 + bl GetBerryCountStringByBerryType pop {r4-r6} pop {r0} bx r0 .pool - thumb_func_end sub_80E1B94 + thumb_func_end FieldObjectInteractionGetBerryTreeData - thumb_func_start sub_80E1C2C -sub_80E1C2C: ; 80E1C2C + thumb_func_start FieldObjectInteractionGetBerryName +; void FieldObjectInteractionGetBerryName() +FieldObjectInteractionGetBerryName: ; 80E1C2C push {lr} ldr r0, =0x03005df0 ldrb r0, [r0] bl FieldObjectGetBerryTreeId lsls r0, 24 lsrs r0, 24 - bl get_berry_tree_type + bl GetBerryTypeByBerryTreeId lsls r0, 24 lsrs r0, 24 ldr r1, =0x02021cc4 - bl sub_80E1A38 + bl GetBerryNameByBerryType pop {r0} bx r0 .pool - thumb_func_end sub_80E1C2C + thumb_func_end FieldObjectInteractionGetBerryName - thumb_func_start sub_80E1C54 -sub_80E1C54: ; 80E1C54 + thumb_func_start FieldObjectInteractionGetBerryCountString +; void FieldObjectInteractionGetBerryCountString() +FieldObjectInteractionGetBerryCountString: ; 80E1C54 push {r4,r5,lr} ldr r0, =0x03005df0 ldrb r0, [r0] @@ -409442,40 +409556,42 @@ sub_80E1C54: ; 80E1C54 lsls r4, 24 lsrs r4, 24 adds r0, r4, 0 - bl get_berry_tree_type + bl GetBerryTypeByBerryTreeId adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 adds r0, r4, 0 - bl sub_80E1B64 + bl GetBerryCountByBerryTreeId adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 ldr r1, =0x02021cc4 adds r0, r5, 0 - bl sub_80E1A58 + bl GetBerryCountStringByBerryType pop {r4,r5} pop {r0} bx r0 .pool - thumb_func_end sub_80E1C54 + thumb_func_end FieldObjectInteractionGetBerryCountString - thumb_func_start sub_80E1C94 -sub_80E1C94: ; 80E1C94 + thumb_func_start ChooseBerry +; void ChooseBerry() +ChooseBerry: ; 80E1C94 push {lr} - ldr r0, =c2_810A554 + ldr r0, =CB2_ChooseBerry bl SetMainCallback2 pop {r0} bx r0 .pool - thumb_func_end sub_80E1C94 + thumb_func_end ChooseBerry - thumb_func_start sub_80E1CA4 -sub_80E1CA4: ; 80E1CA4 + thumb_func_start FieldObjectInteractionPlantBerryTree +; void FieldObjectInteractionPlantBerryTree() +FieldObjectInteractionPlantBerryTree: ; 80E1CA4 push {r4,lr} ldr r0, =0x0203ce7c ldrh r0, [r0] - bl berryid_from_itemid + bl ItemIdToBerryType adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 @@ -409487,16 +409603,17 @@ sub_80E1CA4: ; 80E1CA4 adds r1, r4, 0 movs r2, 0x1 movs r3, 0x1 - bl sub_80E191C - bl sub_80E1B94 + bl PlantBerryTree + bl FieldObjectInteractionGetBerryTreeData pop {r4} pop {r0} bx r0 .pool - thumb_func_end sub_80E1CA4 + thumb_func_end FieldObjectInteractionPlantBerryTree - thumb_func_start sub_80E1CDC -sub_80E1CDC: ; 80E1CDC + thumb_func_start FieldObjectInteractionPickBerryTree +; void FieldObjectInteractionPickBerryTree() +FieldObjectInteractionPickBerryTree: ; 80E1CDC push {r4-r6,lr} ldr r0, =0x03005df0 ldrb r0, [r0] @@ -409505,16 +409622,16 @@ sub_80E1CDC: ; 80E1CDC lsls r5, 24 lsrs r5, 24 adds r0, r5, 0 - bl get_berry_tree_type + bl GetBerryTypeByBerryTreeId lsls r0, 24 lsrs r0, 24 ldr r6, =0x020375e0 - bl sub_80E1A10 + bl BerryTypeToItemId adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 - bl sub_80E1B64 + bl GetBerryCountByBerryTreeId adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -409527,17 +409644,18 @@ sub_80E1CDC: ; 80E1CDC pop {r0} bx r0 .pool - thumb_func_end sub_80E1CDC + thumb_func_end FieldObjectInteractionPickBerryTree - thumb_func_start sub_80E1D28 -sub_80E1D28: ; 80E1D28 + thumb_func_start FieldObjectInteractionRemoveBerryTree +; void FieldObjectInteractionRemoveBerryTree() +FieldObjectInteractionRemoveBerryTree: ; 80E1D28 push {lr} ldr r0, =0x03005df0 ldrb r0, [r0] bl FieldObjectGetBerryTreeId lsls r0, 24 lsrs r0, 24 - bl sub_80E1984 + bl RemoveBerryTree ldr r0, =0x020375f2 ldrb r0, [r0] ldr r1, =0x03005d8c @@ -409548,21 +409666,23 @@ sub_80E1D28: ; 80E1D28 pop {r0} bx r0 .pool - thumb_func_end sub_80E1D28 + thumb_func_end FieldObjectInteractionRemoveBerryTree - thumb_func_start sub_80E1D5C -sub_80E1D5C: ; 80E1D5C + thumb_func_start PlayerHasBerries +; BOOL PlayerHasBerries() +PlayerHasBerries: ; 80E1D5C push {lr} movs r0, 0x4 - bl sub_80D66EC + bl IsBagPocketNonEmpty lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 - thumb_func_end sub_80E1D5C + thumb_func_end PlayerHasBerries - thumb_func_start sub_80E1D6C -sub_80E1D6C: ; 80E1D6C + thumb_func_start ResetBerryTreeSparkleFlags +; void ResetBerryTreeSparkleFlags() +ResetBerryTreeSparkleFlags: ; 80E1D6C push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -409573,7 +409693,7 @@ sub_80E1D6C: ; 80E1D6C adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl sub_8088B80 + bl GetCameraCoords mov r0, sp ldrh r2, [r0] ldrh r1, [r4] @@ -409625,7 +409745,7 @@ sub_80E1D6C: ; 80E1D6C cmp r1, r0 bgt @080E1DEC ldrb r0, [r4, 0x1D] - bl sub_80E1A78 + bl ResetBerryTreeSparkleFlag @080E1DEC: adds r4, 0x24 subs r6, 0x1 @@ -409640,10 +409760,11 @@ sub_80E1D6C: ; 80E1D6C pop {r0} bx r0 .pool - thumb_func_end sub_80E1D6C + thumb_func_end ResetBerryTreeSparkleFlags - thumb_func_start sub_80E1E08 -sub_80E1E08: ; 80E1E08 + thumb_func_start Multichoice +; BOOL Multichoice(u8 x, u8 y, u8 menuId, BOOL noCancelling) +Multichoice: ; 80E1E08 push {r4-r7,lr} sub sp, 0x4 lsls r0, 24 @@ -409669,7 +409790,7 @@ sub_80E1E08: ; 80E1E08 adds r1, r6, 0 adds r2, r5, 0 adds r3, r4, 0 - bl sub_80E1EFC + bl DoMultichoice movs r0, 0x1 b @080E1E4E .pool @@ -409680,7 +409801,7 @@ sub_80E1E08: ; 80E1E08 pop {r4-r7} pop {r1} bx r1 - thumb_func_end sub_80E1E08 + thumb_func_end Multichoice thumb_func_start sub_80E1E58 sub_80E1E58: ; 80E1E58 @@ -409714,7 +409835,7 @@ sub_80E1E58: ; 80E1E58 adds r1, r7, 0 adds r2, r6, 0 adds r3, r5, 0 - bl sub_80E1EFC + bl DoMultichoice movs r0, 0x1 b @080E1EAA .pool @@ -409767,8 +409888,9 @@ sub_80E1EB8: ; 80E1EB8 bx r1 thumb_func_end sub_80E1EB8 - thumb_func_start sub_80E1EFC -sub_80E1EFC: ; 80E1EFC + thumb_func_start DoMultichoice +; void DoMultichoice(u8 x, u8 y, u8 menuId, BOOL noCancelling) +DoMultichoice: ; 80E1EFC push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -409856,7 +409978,7 @@ sub_80E1EFC: ; 80E1EFC pop {r0} bx r0 .pool - thumb_func_end sub_80E1EFC + thumb_func_end DoMultichoice thumb_func_start sub_80E1FBC sub_80E1FBC: ; 80E1FBC @@ -410512,7 +410634,7 @@ sub_80E2514: ; 80E2514 movs r0, 0 movs r1, 0x1 movs r3, 0 - bl text_box_related_one + bl AddTextPrinterParametrized add sp, 0x10 pop {r0} bx r0 @@ -411241,7 +411363,7 @@ sub_80E2A94: ; 80E2A94 movs r0, 0 movs r1, 0x1 movs r3, 0 - bl text_box_related_one + bl AddTextPrinterParametrized b @080E2B70 .pool @080E2B40: @@ -411265,7 +411387,7 @@ sub_80E2A94: ; 80E2A94 movs r0, 0 movs r1, 0x1 movs r3, 0 - bl text_box_related_one + bl AddTextPrinterParametrized @080E2B70: add sp, 0x10 pop {r4} @@ -412429,7 +412551,7 @@ pokemon_transfer_to_pc_with_message: ; 80E34E4 movs r0, 0 movs r1, 0x1 adds r2, r4, 0 - bl text_box_related_one + bl AddTextPrinterParametrized movs r0, 0 movs r1, 0x3 bl CopyWindowToVram @@ -414130,7 +414252,7 @@ sub_80E4384: ; 80E4384 str r2, [sp] movs r2, 0x38 movs r3, 0x25 - bl sub_808DD68 + bl AddPseudoFieldObject adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -414228,7 +414350,7 @@ sub_80E447C: ; 80E447C movs r0, 0x13 movs r2, 0x38 movs r3, 0x25 - bl sub_808DD68 + bl AddPseudoFieldObject adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -423178,13 +423300,13 @@ sub_80E8BF8: ; 80E8BF8 adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + bl GetXYCoordsOneStepInFrontOfPlayer mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r4, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt adds r1, r0, 0 ldr r2, =0x00000fff adds r0, r2, 0 @@ -423364,13 +423486,13 @@ sub_80E8D4C: ; 80E8D4C adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + bl GetXYCoordsOneStepInFrontOfPlayer mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r4, r2] - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt movs r5, 0 mov r12, r4 lsls r0, 16 @@ -423421,12 +423543,12 @@ sub_80E8D4C: ; 80E8D4C lsls r5, 4 adds r2, r5, 0 orrs r2, r3 - bl setmaptile_0 + bl MapGridSetMetatileIdAt movs r1, 0 ldrsh r0, [r4, r1] movs r2, 0 ldrsh r1, [r6, r2] - bl cur_mapdata_draw_block_at + bl CurrentMapDrawMetatileAt b @080E8DE8 @080E8DDE: adds r0, r5, 0x1 @@ -423593,7 +423715,7 @@ sub_80E8EE0: ; 80E8EE0 asrs r0, r5, 16 lsls r4, 16 asrs r1, r4, 16 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt movs r3, 0 lsls r0, 16 asrs r1, r0, 16 @@ -423611,7 +423733,7 @@ sub_80E8EE0: ; 80E8EE0 orrs r2, r0 asrs r0, r5, 16 asrs r1, r4, 16 - bl setmaptile_0 + bl MapGridSetMetatileIdAt b @080E8F82 .pool @080E8F6C: @@ -423813,7 +423935,7 @@ sub_80E9108: ; 80E9108 push {r4,lr} sub sp, 0x4 bl script_env_2_enable - bl call_203AE8C + bl HideMapNamePopUpWindow mov r4, sp adds r4, 0x2 movs r2, 0x88 @@ -423836,13 +423958,13 @@ sub_80E9108: ; 80E9108 ldrsh r1, [r4, r2] movs r2, 0xE2 lsls r2, 4 - bl setmaptile_0 + bl MapGridSetMetatileIdAt mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r4, r2] - bl cur_mapdata_draw_block_at + bl CurrentMapDrawMetatileAt bl pal_fill_black ldr r0, =sub_80E90C8 movs r1, 0 @@ -423925,8 +424047,8 @@ sub_80E91F8: ; 80E91F8 .pool thumb_func_end sub_80E91F8 - thumb_func_start sub_80E9214 -sub_80E9214: ; 80E9214 + thumb_func_start CurrentMapIsSecretBase +CurrentMapIsSecretBase: ; 80E9214 push {lr} ldr r0, =0x03005d8c ldr r1, [r0] @@ -423945,7 +424067,7 @@ sub_80E9214: ; 80E9214 @080E9232: pop {r1} bx r1 - thumb_func_end sub_80E9214 + thumb_func_end CurrentMapIsSecretBase thumb_func_start sub_80E9238 sub_80E9238: ; 80E9238 @@ -423956,7 +424078,7 @@ sub_80E9238: ; 80E9238 lsls r0, 24 lsrs r0, 24 mov r8, r0 - bl sub_80E9214 + bl CurrentMapIsSecretBase lsls r0, 24 cmp r0, 0 beq @080E9328 @@ -424028,7 +424150,7 @@ sub_80E9238: ; 80E9238 ldrh r1, [r4] adds r1, 0x7 ldr r2, =0x00000e21 - bl setmaptile_0 + bl MapGridSetMetatileIdAt b @080E9328 .pool @080E92F4: @@ -424054,7 +424176,7 @@ sub_80E9238: ; 80E9238 ldrh r1, [r4] adds r1, 0x7 ldr r2, =0x00000e0a - bl setmaptile_0 + bl MapGridSetMetatileIdAt @080E9328: add sp, 0x4 pop {r3} @@ -424073,7 +424195,7 @@ sub_80E933C: ; 80E933C mov r5, r8 push {r5-r7} sub sp, 0x18 - bl sub_80E9214 + bl CurrentMapIsSecretBase lsls r0, 24 cmp r0, 0 bne @080E9374 @@ -424192,7 +424314,7 @@ sub_80E933C: ; 80E933C adds r0, 0x7 ldrh r1, [r7] adds r1, 0x7 - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 @@ -424266,7 +424388,7 @@ sub_80E933C: ; 80E933C ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] bl sub_808F254 - bl sub_80E9214 + bl CurrentMapIsSecretBase lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -424620,8 +424742,8 @@ sub_80E9780: ; 80E9780 .pool thumb_func_end sub_80E9780 - thumb_func_start sub_80E97EC -sub_80E97EC: ; 80E97EC + thumb_func_start GetSecretBaseMapName +GetSecretBaseMapName: ; 80E97EC push {r4,lr} adds r4, r0, 0 ldr r0, =0x00004054 @@ -424635,7 +424757,7 @@ sub_80E97EC: ; 80E97EC pop {r1} bx r1 .pool - thumb_func_end sub_80E97EC + thumb_func_end GetSecretBaseMapName thumb_func_start sub_80E980C sub_80E980C: ; 80E980C @@ -424996,7 +425118,7 @@ sub_80E9AD0: ; 80E9AD0 adds r0, 0x7 ldrh r1, [r2, 0x2] adds r1, 0x7 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt movs r1, 0 ldr r5, =gUnknown_0858CFCC lsls r0, 16 @@ -425013,7 +425135,7 @@ sub_80E9AD0: ; 80E9AD0 cmp r1, 0x6 bls @080E9B16 @080E9B2A: - bl cur_mapdata_full_redraw + bl DrawWholeMapView b @080E9B68 .pool @080E9B3C: @@ -425030,7 +425152,7 @@ sub_80E9AD0: ; 80E9AD0 lsls r4, 4 adds r2, r4, 0 orrs r2, r3 - bl setmaptile_0 + bl MapGridSetMetatileIdAt b @080E9B2A @080E9B5C: adds r0, r6, 0x1 @@ -425240,7 +425362,7 @@ sub_80E9C9C: ; 80E9C9C ldr r1, =gUnknown_085EA785 ldr r2, =task_pc_turn_off adds r0, r6, 0 - bl sub_81978EC + bl DisplayItemMessageOnField @080E9D1A: pop {r3} mov r8, r3 @@ -425622,7 +425744,7 @@ sub_80E9FFC: ; 80E9FFC ldr r2, =sub_80EA06C adds r0, r5, 0 adds r1, r4, 0 - bl sub_81978EC + bl DisplayItemMessageOnField pop {r4,r5} pop {r0} bx r0 @@ -425718,7 +425840,7 @@ sub_80EA120: ; 80EA120 lsrs r0, 24 ldr r1, =gUnknown_085EA762 ldr r2, =sub_80EA08C - bl sub_81978EC + bl DisplayItemMessageOnField pop {r0} bx r0 .pool @@ -426121,7 +426243,7 @@ sub_80EA3E4: ; 80EA3E4 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r6, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r5, r0, 24 mov r0, sp @@ -426129,7 +426251,7 @@ sub_80EA3E4: ; 80EA3E4 ldrsh r0, [r0, r3] movs r2, 0 ldrsh r1, [r6, r2] - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt lsls r0, 16 lsrs r4, r0, 16 movs r0, 0x8D @@ -426234,7 +426356,7 @@ sub_80EA3E4: ; 80EA3E4 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r6, r2] - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt ldr r1, =0x0000026a cmp r0, r1 bne @080EA5CC @@ -426351,7 +426473,7 @@ sub_80EA3E4: ; 80EA3E4 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r6, r2] - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt lsls r0, 16 asrs r0, 16 mov r1, sp @@ -426371,7 +426493,7 @@ sub_80EA3E4: ; 80EA3E4 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r6, r2] - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt adds r1, r0, 0 movs r0, 0xCE lsls r0, 2 @@ -427844,7 +427966,7 @@ sub_80EB218: ; 80EB218 ldrb r0, [r6] cmp r0, 0x1 bne @080EB272 - bl sub_80E9214 + bl CurrentMapIsSecretBase lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 @@ -428096,13 +428218,13 @@ sub_80EB498: ; 80EB498 adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + bl GetXYCoordsOneStepInFrontOfPlayer mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r4, r2] - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt ldr r1, =0xfffffce4 adds r0, r1 cmp r0, 0x18 @@ -428174,13 +428296,13 @@ sub_80EB56C: ; 80EB56C adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + bl GetXYCoordsOneStepInFrontOfPlayer mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r4, r2] - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt ldr r1, =0xfffffdd4 adds r0, r1 cmp r0, 0xCF @@ -428508,13 +428630,13 @@ sub_80EB9E0: ; 80EB9E0 adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + bl GetXYCoordsOneStepInFrontOfPlayer mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r4, r2] - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt ldr r1, =0xfffffd6f adds r0, r1 cmp r0, 0x35 @@ -428615,13 +428737,13 @@ sub_80EBB28: ; 80EBB28 adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + bl GetXYCoordsOneStepInFrontOfPlayer mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r4, r2] - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt ldr r1, =0xfffffddb adds r0, r1 cmp r0, 0xA2 @@ -428865,13 +428987,13 @@ sub_80EBE7C: ; 80EBE7C adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + bl GetXYCoordsOneStepInFrontOfPlayer mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r4, r2] - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt adds r1, r0, 0 ldr r0, =0x0000028e cmp r1, r0 @@ -429172,13 +429294,13 @@ sub_80EC0CC: ; 80EC0CC @080EC0FE: adds r0, r4, 0 adds r1, r5, 0 - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt cmp r0, 0x86 bne @080EC114 adds r0, r4, 0 adds r1, r5, 0 lsrs r2, r6, 16 - bl setmaptile_0 + bl MapGridSetMetatileIdAt @080EC114: adds r4, 0x1 cmp r4, r9 @@ -429205,7 +429327,7 @@ sub_80EC130: ; 80EC130 ldr r1, [r1, 0x4] movs r2, 0x2 bl sub_80EC0CC - bl cur_mapdata_full_redraw + bl DrawWholeMapView pop {r0} bx r0 .pool @@ -429219,7 +429341,7 @@ cut: ; 80EC14C ldr r1, [r1, 0x4] movs r2, 0x3 bl sub_80EC0CC - bl cur_mapdata_full_redraw + bl DrawWholeMapView pop {r0} bx r0 .pool @@ -436791,8 +436913,8 @@ sub_80F00A4: ; 80F00A4 .pool thumb_func_end sub_80F00A4 - thumb_func_start start_menu_append_item -start_menu_append_item: ; 80F01B8 + thumb_func_start sub_80F01B8 +sub_80F01B8: ; 80F01B8 push {lr} ldr r0, =0x000040bc movs r1, 0 @@ -436808,7 +436930,7 @@ start_menu_append_item: ; 80F01B8 pop {r0} bx r0 .pool - thumb_func_end start_menu_append_item + thumb_func_end sub_80F01B8 thumb_func_start sub_80F01E8 sub_80F01E8: ; 80F01E8 @@ -447915,7 +448037,7 @@ sub_80F6A9C: ; 80F6A9C adds r0, r1 ldrh r0, [r0] movs r1, 0 - bl sub_80D2E08 + bl mon_icon_convert_unown_species_id lsls r0, 16 lsrs r0, 16 adds r0, r6 @@ -452689,7 +452811,7 @@ sp000_heal_pokemon: ; 80F9180 lsrs r0, 16 adds r1, r7, 0 adds r2, r5, 0 - bl move_get_pp_info + bl CalcPPWithPPUps strb r0, [r6] adds r1, r5, 0 adds r1, 0x11 @@ -452901,11 +453023,11 @@ sub_80F9370: ; 80F9370 cmp r4, 0x1 bne @080F9392 movs r0, 0xAF - bl berryid_from_itemid + bl ItemIdToBerryType lsls r0, 24 lsrs r0, 24 ldr r1, =0x02021cc4 - bl sub_80E1A38 + bl GetBerryNameByBerryType @080F9392: adds r0, r4, 0 pop {r4} @@ -453314,9 +453436,9 @@ sub_80F9654: ; 80F9654 adds r1, r0, 0 cmp r1, 0 beq @080F9714 - bl sub_81A9E40 + bl InBattlePyramid adds r4, r0, 0 - bl sub_81A80A8 + bl InBattlePike orrs r4, r0 lsls r4, 24 cmp r4, 0 @@ -454494,12 +454616,12 @@ sub_80FA004: ; 80FA004 ldr r4, =0x0203ab40 adds r1, r4, 0x2 adds r0, r4, 0 - bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + bl GetXYCoordsOneStepInFrontOfPlayer movs r1, 0 ldrsh r0, [r4, r1] movs r2, 0x2 ldrsh r1, [r4, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 @@ -454748,7 +454870,7 @@ sub_80FA248: ; 80FA248 ldrsh r0, [r1, r2] movs r2, 0x2 ldrsh r1, [r1, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt adds r2, r0, 0 ldr r1, =0x00000fff adds r0, r1, 0 @@ -455009,7 +455131,7 @@ sub_80FA458: ; 80FA458 adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + bl GetXYCoordsOneStepInFrontOfPlayer ldr r0, =sub_80FA4A0 movs r1, 0 bl AddTask @@ -455092,12 +455214,12 @@ sub_80FA4A0: ; 80FA4A0 movs r2, 0x88 lsls r2, 2 @080FA52E: - bl setmaptile_0 + bl MapGridSetMetatileIdAt movs r1, 0 ldrsh r0, [r4, r1] movs r2, 0x2 ldrsh r1, [r4, r2] - bl cur_mapdata_draw_block_at + bl CurrentMapDrawMetatileAt b @080FA56E @080FA540: movs r1, 0 @@ -455106,12 +455228,12 @@ sub_80FA4A0: ; 80FA4A0 ldrsh r1, [r4, r2] movs r2, 0x89 lsls r2, 2 - bl setmaptile_0 + bl MapGridSetMetatileIdAt movs r1, 0 ldrsh r0, [r4, r1] movs r2, 0x2 ldrsh r1, [r4, r2] - bl cur_mapdata_draw_block_at + bl CurrentMapDrawMetatileAt movs r0, 0x3D bl FieldEffectActiveListRemove bl script_env_2_enable_and_set_ctx_running @@ -455136,7 +455258,7 @@ sub_80FA57C: ; 80FA57C adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + bl GetXYCoordsOneStepInFrontOfPlayer movs r0, 0x3 bl audio_play ldr r0, =0x00004054 @@ -455151,7 +455273,7 @@ sub_80FA57C: ; 80FA57C ldrsh r1, [r4, r2] movs r2, 0xE2 lsls r2, 4 - bl setmaptile_0 + bl MapGridSetMetatileIdAt b @080FA5C8 .pool @080FA5B8: @@ -455161,14 +455283,14 @@ sub_80FA57C: ; 80FA57C movs r2, 0 ldrsh r1, [r4, r2] ldr r2, =0x00000e21 - bl setmaptile_0 + bl MapGridSetMetatileIdAt @080FA5C8: mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r4, r2] - bl cur_mapdata_draw_block_at + bl CurrentMapDrawMetatileAt add sp, 0x4 pop {r4} pop {r0} @@ -455254,12 +455376,12 @@ sub_80FA62C: ; 80FA62C adds r2, r3 lsls r2, 16 lsrs r2, 16 - bl setmaptile_0 + bl MapGridSetMetatileIdAt movs r1, 0x2 ldrsh r0, [r4, r1] movs r2, 0x4 ldrsh r1, [r4, r2] - bl cur_mapdata_draw_block_at + bl CurrentMapDrawMetatileAt ldrh r1, [r4, 0x8] movs r3, 0x8 ldrsh r0, [r4, r3] @@ -455352,18 +455474,18 @@ sub_80FA704: ; 80FA704 ldr r2, =0x00000276 adds r0, r5, 0 adds r1, r4, 0 - bl setmaptile_0 + bl MapGridSetMetatileIdAt subs r6, r4, 0x1 ldr r2, =0x0000026e adds r0, r5, 0 adds r1, r6, 0 - bl setmaptile_0 + bl MapGridSetMetatileIdAt adds r0, r5, 0 adds r1, r4, 0 - bl cur_mapdata_draw_block_at + bl CurrentMapDrawMetatileAt adds r0, r5, 0 adds r1, r6, 0 - bl cur_mapdata_draw_block_at + bl CurrentMapDrawMetatileAt pop {r4-r6} pop {r0} bx r0 @@ -455725,7 +455847,7 @@ sub_80FAA7C: ; 80FAA7C adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + bl GetXYCoordsOneStepInFrontOfPlayer ldr r1, =0x02038c08 mov r0, sp movs r2, 0 @@ -455853,7 +455975,7 @@ door_restore_tilemap: ; 80FABA4 ldr r0, [r4, 0x14] ldr r1, [r4, 0x18] subs r1, 0x1 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt ldr r1, =0x00000286 cmp r0, r1 bne @080FABDC @@ -455861,7 +455983,7 @@ door_restore_tilemap: ; 80FABA4 ldr r1, [r4, 0x18] subs r1, 0x1 ldr r2, =0x00000e02 - bl setmaptile_0 + bl MapGridSetMetatileIdAt b @080FABEA .pool @080FABDC: @@ -455870,20 +455992,20 @@ door_restore_tilemap: ; 80FABA4 subs r1, 0x1 movs r2, 0xA1 lsls r2, 2 - bl setmaptile_0 + bl MapGridSetMetatileIdAt @080FABEA: ldr r4, =0x02038c08 ldr r0, [r4, 0x14] ldr r1, [r4, 0x18] ldr r2, =0x0000020a - bl setmaptile_0 + bl MapGridSetMetatileIdAt ldr r0, [r4, 0x14] ldr r1, [r4, 0x18] subs r1, 0x1 - bl cur_mapdata_draw_block_at + bl CurrentMapDrawMetatileAt ldr r0, [r4, 0x14] ldr r1, [r4, 0x18] - bl cur_mapdata_draw_block_at + bl CurrentMapDrawMetatileAt movs r0, 0 strh r0, [r5, 0x2E] ldr r0, =sub_80FAC24 @@ -455911,10 +456033,10 @@ sub_80FAC24: ; 80FAC24 ldr r0, [r4, 0x14] ldr r1, [r4, 0x18] ldr r2, =0x00000e8c - bl setmaptile_0 + bl MapGridSetMetatileIdAt ldr r0, [r4, 0x14] ldr r1, [r4, 0x18] - bl cur_mapdata_draw_block_at + bl CurrentMapDrawMetatileAt movs r0, 0 strh r0, [r5, 0x2E] ldr r0, =sub_80FAC68 @@ -455944,13 +456066,13 @@ sub_80FAC78: ; 80FAC78 adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + bl GetXYCoordsOneStepInFrontOfPlayer mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r4, r2] - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt adds r1, r0, 0 ldr r0, =0x000002f5 cmp r1, r0 @@ -456084,7 +456206,7 @@ sub_80FADE4: ; 80FADE4 adds r6, r4, 0 lsls r1, 24 lsrs r5, r1, 24 - bl sub_80E9214 + bl CurrentMapIsSecretBase lsls r0, 24 cmp r0, 0 beq @080FAE28 @@ -456330,7 +456452,7 @@ sub_80FAFD4: ; 80FAFD4 bl sub_808BCD0 lsls r0, 24 lsrs r0, 24 - bl SetPlayerAvatarTransition + bl SetPlayerAvatarTransitionFlags adds r0, r4, 0 bl remove_task bl script_env_2_enable_and_set_ctx_running @@ -456547,7 +456669,7 @@ sub_80FB0F8: ; 80FB0F8 lsls r1, 16 asrs r1, 16 movs r0, 0 - bl sub_808A2CC + bl SetCameraPanning add sp, 0x4 pop {r4,r5} pop {r0} @@ -456621,7 +456743,7 @@ sub_80FB1AC: ; 80FB1AC lsls r1, 16 asrs r1, 16 adds r0, r5, 0 - bl sub_808A2CC + bl SetCameraPanning movs r4, 0x4 ldrsh r0, [r7, r4] adds r0, 0x1E @@ -456727,7 +456849,7 @@ sub_80FB2C0: ; 80FB2C0 movs r6, 0 ldrsb r6, [r0, r6] adds r0, r6, 0 - bl sub_808A2CC + bl SetCameraPanning ldr r5, =0x03005d8c ldr r0, [r5] ldrb r1, [r0, 0x5] @@ -456807,7 +456929,7 @@ sub_80FB36C: ; 80FB36C b @080FB4D8 @080FB3C0: movs r0, 0 - bl sub_808A2C0 + bl SetCameraPanningCallback movs r0, 0 strh r0, [r4, 0x2] ldr r0, =sub_80FB0F8 @@ -456879,7 +457001,7 @@ sub_80FB36C: ; 80FB36C ldrb r5, [r0, 0x4] cmp r5, 0 bne @080FB4D8 - bl sub_808A2E4 + bl InstallCameraPanAheadCallback strh r5, [r4, 0x2] movs r0, 0x4 strh r0, [r4] @@ -456912,18 +457034,18 @@ sub_80FB36C: ; 80FB36C lsls r2, 2 movs r0, 0xB movs r1, 0x8 - bl setmaptile_0 + bl MapGridSetMetatileIdAt movs r2, 0x84 lsls r2, 2 movs r0, 0xB movs r1, 0x9 - bl setmaptile_0 + bl MapGridSetMetatileIdAt movs r2, 0x86 lsls r2, 2 movs r0, 0xB movs r1, 0xA - bl setmaptile_0 - bl cur_mapdata_full_redraw + bl MapGridSetMetatileIdAt + bl DrawWholeMapView movs r0, 0x34 bl audio_play adds r0, r5, 0 @@ -456942,16 +457064,16 @@ sub_80FB4E0: ; 80FB4E0 ldr r2, =0x0000020d movs r0, 0xB movs r1, 0x8 - bl setmaptile_0 + bl MapGridSetMetatileIdAt ldr r2, =0x00000215 movs r0, 0xB movs r1, 0x9 - bl setmaptile_0 + bl MapGridSetMetatileIdAt ldr r2, =0x0000021d movs r0, 0xB movs r1, 0xA - bl setmaptile_0 - bl cur_mapdata_full_redraw + bl MapGridSetMetatileIdAt + bl DrawWholeMapView bl script_env_2_enable movs r0, 0 str r0, [sp] @@ -457188,7 +457310,7 @@ sub_80FB6EC: ; 80FB6EC movs r0, 0x8C movs r2, 0x70 movs r3, 0x50 - bl sub_808DD68 + bl AddPseudoFieldObject lsls r0, 24 lsrs r0, 24 ldr r2, =0x02020630 @@ -457285,8 +457407,8 @@ sub_80FB7A4: ; 80FB7A4 .pool thumb_func_end sub_80FB7A4 - thumb_func_start GetCurrentMapRotatingDoorPuzzleType -GetCurrentMapRotatingDoorPuzzleType: ; 80FB7E8 + thumb_func_start GetCurrentMapRotatingGatePuzzleType +GetCurrentMapRotatingGatePuzzleType: ; 80FB7E8 push {lr} ldr r0, =0x03005d8c ldr r0, [r0] @@ -457310,7 +457432,7 @@ GetCurrentMapRotatingDoorPuzzleType: ; 80FB7E8 @080FB812: pop {r1} bx r1 - thumb_func_end GetCurrentMapRotatingDoorPuzzleType + thumb_func_end GetCurrentMapRotatingGatePuzzleType thumb_func_start sub_80FB818 sub_80FB818: ; 80FB818 @@ -457417,7 +457539,7 @@ sub_80FB890: ; 80FB890 thumb_func_start sub_80FB8CC sub_80FB8CC: ; 80FB8CC push {lr} - bl GetCurrentMapRotatingDoorPuzzleType + bl GetCurrentMapRotatingGatePuzzleType cmp r0, 0x1 beq @080FB8E0 cmp r0, 0x1 @@ -457657,7 +457779,7 @@ sub_80FB9FC: ; 80FB9FC lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl sub_8008258 + bl StartObjectRotScalAnim adds r0, r5, 0 b @080FBAD6 .pool @@ -457704,7 +457826,7 @@ sub_80FBAE4: ; 80FBAE4 bl audio_play adds r0, r6, 0 adds r1, r4, 0 - bl sub_8008258 + bl StartObjectRotScalAnim b @080FBB58 @080FBB2A: cmp r5, 0x2 @@ -457727,7 +457849,7 @@ sub_80FBAE4: ; 80FBAE4 bl audio_play adds r0, r6, 0 adds r1, r4, 0 - bl sub_8008258 + bl StartObjectRotScalAnim @080FBB58: movs r0, 0 strh r0, [r6, 0x30] @@ -457819,16 +457941,16 @@ sub_80FBB64: ; 80FBB64 .pool thumb_func_end sub_80FBB64 - thumb_func_start overworld_free_bgmaps -; void overworld_free_bgmaps() -overworld_free_bgmaps: ; 80FBC00 + thumb_func_start LoadRotatingGatePics +; void LoadRotatingGatePics() +LoadRotatingGatePics: ; 80FBC00 push {lr} ldr r0, =gUnknown_08591D58 bl LoadObjectPics pop {r0} bx r0 .pool - thumb_func_end overworld_free_bgmaps + thumb_func_end LoadRotatingGatePics thumb_func_start sub_80FBC10 sub_80FBC10: ; 80FBC10 @@ -458162,7 +458284,7 @@ sub_80FBE3C: ; 80FBE3C thumb_func_start sub_80FBE90 sub_80FBE90: ; 80FBE90 push {lr} - bl GetCurrentMapRotatingDoorPuzzleType + bl GetCurrentMapRotatingGatePuzzleType cmp r0, 0 beq @080FBEA2 bl sub_80FB8CC @@ -458172,14 +458294,15 @@ sub_80FBE90: ; 80FBE90 bx r0 thumb_func_end sub_80FBE90 - thumb_func_start sub_80FBEA8 -sub_80FBEA8: ; 80FBEA8 + thumb_func_start RotatingGatePuzzleCameraUpdate +; void RotatingGatePuzzleCameraUpdate(s32 deltaX, s32 deltaY) +RotatingGatePuzzleCameraUpdate: ; 80FBEA8 push {r4,r5,lr} lsls r0, 16 lsrs r4, r0, 16 lsls r1, 16 lsrs r5, r1, 16 - bl GetCurrentMapRotatingDoorPuzzleType + bl GetCurrentMapRotatingGatePuzzleType cmp r0, 0 beq @080FBECA lsls r0, r4, 16 @@ -458192,15 +458315,15 @@ sub_80FBEA8: ; 80FBEA8 pop {r4,r5} pop {r0} bx r0 - thumb_func_end sub_80FBEA8 + thumb_func_end RotatingGatePuzzleCameraUpdate thumb_func_start sub_80FBED0 sub_80FBED0: ; 80FBED0 push {lr} - bl GetCurrentMapRotatingDoorPuzzleType + bl GetCurrentMapRotatingGatePuzzleType cmp r0, 0 beq @080FBEEA - bl overworld_free_bgmaps + bl LoadRotatingGatePics bl sub_80FB8CC movs r0, 0 movs r1, 0 @@ -458210,8 +458333,8 @@ sub_80FBED0: ; 80FBED0 bx r0 thumb_func_end sub_80FBED0 - thumb_func_start CheckForRotatingDoorPuzzleCollision -CheckForRotatingDoorPuzzleCollision: ; 80FBEF0 + thumb_func_start CheckForRotatingGatePuzzleCollision +CheckForRotatingGatePuzzleCollision: ; 80FBEF0 push {r4-r7,lr} mov r7, r9 mov r6, r8 @@ -458224,7 +458347,7 @@ CheckForRotatingDoorPuzzleCollision: ; 80FBEF0 lsls r2, 16 lsrs r2, 16 mov r8, r2 - bl GetCurrentMapRotatingDoorPuzzleType + bl GetCurrentMapRotatingGatePuzzleType cmp r0, 0 bne @080FBF24 b @080FBFC2 @@ -458321,7 +458444,7 @@ CheckForRotatingDoorPuzzleCollision: ; 80FBEF0 pop {r1} bx r1 .pool - thumb_func_end CheckForRotatingDoorPuzzleCollision + thumb_func_end CheckForRotatingGatePuzzleCollision thumb_func_start sub_80FBFD4 sub_80FBFD4: ; 80FBFD4 @@ -458337,7 +458460,7 @@ sub_80FBFD4: ; 80FBFD4 lsls r2, 16 lsrs r2, 16 mov r8, r2 - bl GetCurrentMapRotatingDoorPuzzleType + bl GetCurrentMapRotatingGatePuzzleType cmp r0, 0 bne @080FBFFA b @080FC08A @@ -458428,8 +458551,8 @@ sub_80FBFD4: ; 80FBFD4 .pool thumb_func_end sub_80FBFD4 - thumb_func_start flag_check_is_in_safari_zone -flag_check_is_in_safari_zone: ; 80FC0A0 + thumb_func_start GetSafariZoneFlag +GetSafariZoneFlag: ; 80FC0A0 push {lr} ldr r0, =0x0000088c bl FlagGet @@ -458438,34 +458561,34 @@ flag_check_is_in_safari_zone: ; 80FC0A0 pop {r1} bx r1 .pool - thumb_func_end flag_check_is_in_safari_zone + thumb_func_end GetSafariZoneFlag - thumb_func_start sub_80FC0B4 -sub_80FC0B4: ; 80FC0B4 + thumb_func_start SetSafariZoneFlag +SetSafariZoneFlag: ; 80FC0B4 push {lr} ldr r0, =0x0000088c bl FlagSet pop {r0} bx r0 .pool - thumb_func_end sub_80FC0B4 + thumb_func_end SetSafariZoneFlag - thumb_func_start flag_clear_is_in_safari_zone -flag_clear_is_in_safari_zone: ; 80FC0C4 + thumb_func_start ResetSafariZoneFlag +ResetSafariZoneFlag: ; 80FC0C4 push {lr} ldr r0, =0x0000088c bl FlagReset pop {r0} bx r0 .pool - thumb_func_end flag_clear_is_in_safari_zone + thumb_func_end ResetSafariZoneFlag thumb_func_start sub_80FC0D4 sub_80FC0D4: ; 80FC0D4 push {lr} movs r0, 0x11 bl sav12_xor_increment - bl sub_80FC0B4 + bl SetSafariZoneFlag bl sub_80FC244 ldr r1, =0x0203a04c movs r0, 0x1E @@ -458493,7 +458616,7 @@ sub_80FC114: ; 80FC114 ldr r1, =0x0203a051 ldrb r1, [r1] bl sub_80EE44C - bl flag_clear_is_in_safari_zone + bl ResetSafariZoneFlag bl sub_80FC244 ldr r1, =0x0203a04c movs r0, 0 @@ -458509,7 +458632,7 @@ sub_80FC114: ; 80FC114 thumb_func_start safari_step safari_step: ; 80FC14C push {lr} - bl flag_check_is_in_safari_zone + bl GetSafariZoneFlag cmp r0, 0 beq @080FC168 bl sub_80FC480 @@ -458633,7 +458756,7 @@ sub_80FC258: ; 80FC258 adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + bl GetXYCoordsOneStepInFrontOfPlayer movs r5, 0 @080FC26A: ldr r0, =0x03005d8c @@ -458846,7 +458969,7 @@ sub_80FC3E8: ; 80FC3E8 bne @080FC468 mov r0, sp adds r1, r6, 0 - bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + bl GetXYCoordsOneStepInFrontOfPlayer ldr r0, [r7] ldrb r0, [r0, 0x5] strb r0, [r4, 0x4] @@ -460298,8 +460421,9 @@ sub_80FCFD0: ; 80FCFD0 .pool thumb_func_end sub_80FCFD0 - thumb_func_start sub_80FD060 -sub_80FD060: ; 80FD060 + thumb_func_start SetUpItemUseCallback +; void SetUpItemUseCallback(u8 taskId) +SetUpItemUseCallback: ; 80FD060 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 @@ -460322,7 +460446,7 @@ sub_80FD060: ; 80FD060 subs r0, 0x1 lsls r0, 24 lsrs r4, r0, 24 - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 bne @080FD0B8 @@ -460334,7 +460458,7 @@ sub_80FD060: ; 80FD060 ldr r0, [r0] str r0, [r2] adds r0, r5, 0 - bl task_close_bag_menu_1 + bl sub_81AB8F8 b @080FD0CC .pool @080FD0B8: @@ -460352,10 +460476,11 @@ sub_80FD060: ; 80FD060 pop {r0} bx r0 .pool - thumb_func_end sub_80FD060 + thumb_func_end SetUpItemUseCallback - thumb_func_start run_eventually_start -run_eventually_start: ; 80FD0DC + thumb_func_start SetUpItemUseOnFieldCallback +; void SetUpItemUseOnFieldCallback() +SetUpItemUseOnFieldCallback: ; 80FD0DC push {lr} lsls r0, 24 lsrs r2, r0, 24 @@ -460369,10 +460494,10 @@ run_eventually_start: ; 80FD0DC cmp r0, 0x1 beq @080FD110 ldr r1, =0x03005dac - ldr r0, =sub_80FD124 + ldr r0, =MapPostLoadHook_UseItem str r0, [r1] adds r0, r2, 0 - bl sub_80FD060 + bl SetUpItemUseCallback b @080FD11A .pool @080FD110: @@ -460384,22 +460509,24 @@ run_eventually_start: ; 80FD0DC pop {r0} bx r0 .pool - thumb_func_end run_eventually_start + thumb_func_end SetUpItemUseOnFieldCallback - thumb_func_start sub_80FD124 -sub_80FD124: ; 80FD124 + thumb_func_start MapPostLoadHook_UseItem +; void MapPostLoadHook_UseItem() +MapPostLoadHook_UseItem: ; 80FD124 push {lr} bl pal_fill_black - ldr r0, =sub_80FD13C + ldr r0, =Task_CallItemUseOnFieldCallback movs r1, 0x8 bl AddTask pop {r0} bx r0 .pool - thumb_func_end sub_80FD124 + thumb_func_end MapPostLoadHook_UseItem - thumb_func_start sub_80FD13C -sub_80FD13C: ; 80FD13C + thumb_func_start Task_CallItemUseOnFieldCallback +; void Task_CallItemUseOnFieldCallback(u8 taskId) +Task_CallItemUseOnFieldCallback: ; 80FD13C push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 @@ -460417,10 +460544,11 @@ sub_80FD13C: ; 80FD13C pop {r0} bx r0 .pool - thumb_func_end sub_80FD13C + thumb_func_end Task_CallItemUseOnFieldCallback - thumb_func_start sub_80FD164 -sub_80FD164: ; 80FD164 + thumb_func_start DisplayCannotUseItemMessage +; void DisplayCannotUseItemMessage(u8 taskId, BOOL isUsingRegisteredKeyItemOnField, u8 *str) +DisplayCannotUseItemMessage: ; 80FD164 push {r4-r6,lr} adds r4, r1, 0 adds r1, r2, 0 @@ -460433,7 +460561,7 @@ sub_80FD164: ; 80FD164 bl ExpandStringRefs cmp r4, 0 bne @080FD1B4 - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 bne @080FD1A0 @@ -460441,58 +460569,61 @@ sub_80FD164: ; 80FD164 adds r0, r5, 0 movs r1, 0x1 adds r2, r6, 0 - bl sub_81ABB4C + bl DisplayItemMessage b @080FD1BE .pool @080FD1A0: ldr r1, =gUnknown_085E8F31 ldr r2, =sub_81C6714 adds r0, r5, 0 - bl sub_81C6DD8 + bl DisplayItemMessageInBattlePyramid b @080FD1BE .pool @080FD1B4: - ldr r2, =sub_80FD1F8 + ldr r2, =CleanUpAfterFailingToUseRegisteredKeyItemOnField adds r0, r5, 0 adds r1, r6, 0 - bl sub_81978EC + bl DisplayItemMessageOnField @080FD1BE: pop {r4-r6} pop {r0} bx r0 .pool - thumb_func_end sub_80FD164 + thumb_func_end DisplayCannotUseItemMessage - thumb_func_start display_dads_advice_cannot_use_item_str -display_dads_advice_cannot_use_item_str: ; 80FD1C8 + thumb_func_start DisplayDadsAdviceCannotUseItemMessage +; void DisplayDadsAdviceCannotUseItemMessage(u8 taskId, BOOL isUsingRegisteredKeyItemOnField) +DisplayDadsAdviceCannotUseItemMessage: ; 80FD1C8 push {lr} lsls r0, 24 lsrs r0, 24 lsls r1, 24 lsrs r1, 24 ldr r2, =gUnknown_085E8F31 - bl sub_80FD164 + bl DisplayCannotUseItemMessage pop {r0} bx r0 .pool - thumb_func_end display_dads_advice_cannot_use_item_str + thumb_func_end DisplayDadsAdviceCannotUseItemMessage - thumb_func_start display_cannot_dismount_bike_here_str -display_cannot_dismount_bike_here_str: ; 80FD1E0 + thumb_func_start DisplayCannotDismountBikeMessage +; void DisplayCannotDismountBikeMessage(u8 taskId, BOOL isUsingRegisteredKeyItemOnField) +DisplayCannotDismountBikeMessage: ; 80FD1E0 push {lr} lsls r0, 24 lsrs r0, 24 lsls r1, 24 lsrs r1, 24 ldr r2, =gUnknown_085E8F6E - bl sub_80FD164 + bl DisplayCannotUseItemMessage pop {r0} bx r0 .pool - thumb_func_end display_cannot_dismount_bike_here_str + thumb_func_end DisplayCannotDismountBikeMessage - thumb_func_start sub_80FD1F8 -sub_80FD1F8: ; 80FD1F8 + thumb_func_start CleanUpAfterFailingToUseRegisteredKeyItemOnField +; void CleanUpAfterFailingToUseRegisteredKeyItemOnField(u8 taskId) +CleanUpAfterFailingToUseRegisteredKeyItemOnField: ; 80FD1F8 push {r4,lr} adds r4, r0, 0 lsls r4, 24 @@ -460507,16 +460638,17 @@ sub_80FD1F8: ; 80FD1F8 pop {r4} pop {r0} bx r0 - thumb_func_end sub_80FD1F8 + thumb_func_end CleanUpAfterFailingToUseRegisteredKeyItemOnField - thumb_func_start sub_80FD21C -sub_80FD21C: ; 80FD21C + thumb_func_start CheckIfItemIsTMHMOrEvolutionStone +; u8 CheckIfItemIsTMHMOrEvolutionStone(u16 itemId) +CheckIfItemIsTMHMOrEvolutionStone: ; 80FD21C push {r4,lr} lsls r0, 16 lsrs r4, r0, 16 adds r0, r4, 0 bl itemid_get_overworld_function - ldr r1, =sub_80FDF48 + ldr r1, =ItemUseOutOfBattle_TMHM cmp r0, r1 bne @080FD238 movs r0, 0x1 @@ -460525,7 +460657,7 @@ sub_80FD21C: ; 80FD21C @080FD238: adds r0, r4, 0 bl itemid_get_overworld_function - ldr r1, =sub_80FE378 + ldr r1, =ItemUseOutOfBattle_EvolutionStone cmp r0, r1 beq @080FD24C movs r0, 0 @@ -460537,7 +460669,7 @@ sub_80FD21C: ; 80FD21C pop {r4} pop {r1} bx r1 - thumb_func_end sub_80FD21C + thumb_func_end CheckIfItemIsTMHMOrEvolutionStone thumb_func_start sub_80FD254 sub_80FD254: ; 80FD254 @@ -460557,8 +460689,9 @@ sub_80FD254: ; 80FD254 .pool thumb_func_end sub_80FD254 - thumb_func_start sub_80FD278 -sub_80FD278: ; 80FD278 + thumb_func_start ItemUseOutOfBattle_Mail +; void ItemUseOutOfBattle_Mail(int taskId) +ItemUseOutOfBattle_Mail: ; 80FD278 push {lr} lsls r0, 24 lsrs r0, 24 @@ -460566,15 +460699,15 @@ sub_80FD278: ; 80FD278 ldr r2, [r1] ldr r1, =sub_80FD254 str r1, [r2] - bl task_close_bag_menu_1 + bl sub_81AB8F8 pop {r0} bx r0 .pool - thumb_func_end sub_80FD278 + thumb_func_end ItemUseOutOfBattle_Mail - thumb_func_start item_field_func_bike -; void item_field_func_bike(int task_id) -item_field_func_bike: ; 80FD298 + thumb_func_start ItemUseOutOfBattle_Bike +; void ItemUseOutOfBattle_Bike(int taskId) +ItemUseOutOfBattle_Bike: ; 80FD298 push {r4-r6,lr} sub sp, 0x4 lsls r0, 24 @@ -460594,7 +460727,7 @@ item_field_func_bike: ; 80FD298 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r4, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r4, r0, 24 ldr r0, =0x0000088b @@ -460630,7 +460763,7 @@ item_field_func_bike: ; 80FD298 @080FD30E: ldrb r1, [r6, 0x6] adds r0, r5, 0 - bl display_cannot_dismount_bike_here_str + bl DisplayCannotDismountBikeMessage b @080FD350 .pool @080FD320: @@ -460642,25 +460775,25 @@ item_field_func_bike: ; 80FD298 cmp r0, 0 bne @080FD348 ldr r1, =0x0203a0f4 - ldr r0, =sub_80FD358 + ldr r0, =ItemUseOnFieldCB_Bike str r0, [r1] adds r0, r5, 0 - bl run_eventually_start + bl SetUpItemUseOnFieldCallback b @080FD350 .pool @080FD348: ldrb r1, [r6, 0x6] adds r0, r5, 0 - bl display_dads_advice_cannot_use_item_str + bl DisplayDadsAdviceCannotUseItemMessage @080FD350: add sp, 0x4 pop {r4-r6} pop {r0} bx r0 - thumb_func_end item_field_func_bike + thumb_func_end ItemUseOutOfBattle_Bike - thumb_func_start sub_80FD358 -sub_80FD358: ; 80FD358 + thumb_func_start ItemUseOnFieldCB_Bike +ItemUseOnFieldCB_Bike: ; 80FD358 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 @@ -460671,12 +460804,12 @@ sub_80FD358: ; 80FD358 cmp r0, 0 bne @080FD378 movs r0, 0x2 - bl sub_811A080 + bl GetOnOffBike b @080FD37E .pool @080FD378: movs r0, 0x4 - bl sub_811A080 + bl GetOnOffBike @080FD37E: bl sub_80984F4 bl script_env_2_disable @@ -460685,23 +460818,24 @@ sub_80FD358: ; 80FD358 pop {r4} pop {r0} bx r0 - thumb_func_end sub_80FD358 + thumb_func_end ItemUseOnFieldCB_Bike - thumb_func_start sub_80FD394 -sub_80FD394: ; 80FD394 + thumb_func_start CanFish +; BOOL CanFish() +CanFish: ; 80FD394 push {r4-r6,lr} sub sp, 0x4 mov r4, sp adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + bl GetXYCoordsOneStepInFrontOfPlayer mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r4, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 16 lsrs r6, r0, 16 lsls r0, r6, 24 @@ -460758,21 +460892,21 @@ sub_80FD394: ; 80FD394 pop {r4-r6} pop {r1} bx r1 - thumb_func_end sub_80FD394 + thumb_func_end CanFish - thumb_func_start rod -rod: ; 80FD428 + thumb_func_start ItemUseOutOfBattle_Rod +ItemUseOutOfBattle_Rod: ; 80FD428 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - bl sub_80FD394 + bl CanFish cmp r0, 0x1 bne @080FD44C ldr r1, =0x0203a0f4 - ldr r0, =sub_80FD468 + ldr r0, =ItemUseOnFieldCB_Rod str r0, [r1] adds r0, r4, 0 - bl run_eventually_start + bl SetUpItemUseOnFieldCallback b @080FD45E .pool @080FD44C: @@ -460783,16 +460917,16 @@ rod: ; 80FD428 adds r1, r0 ldrb r1, [r1, 0xE] adds r0, r4, 0 - bl display_dads_advice_cannot_use_item_str + bl DisplayDadsAdviceCannotUseItemMessage @080FD45E: pop {r4} pop {r0} bx r0 .pool - thumb_func_end rod + thumb_func_end ItemUseOutOfBattle_Rod - thumb_func_start sub_80FD468 -sub_80FD468: ; 80FD468 + thumb_func_start ItemUseOnFieldCB_Rod +ItemUseOnFieldCB_Rod: ; 80FD468 push {r4,lr} adds r4, r0, 0 lsls r4, 24 @@ -460809,10 +460943,10 @@ sub_80FD468: ; 80FD468 pop {r0} bx r0 .pool - thumb_func_end sub_80FD468 + thumb_func_end ItemUseOnFieldCB_Rod - thumb_func_start it_itemfinder -it_itemfinder: ; 80FD490 + thumb_func_start ItemUseOutOfBattle_Itemfinder +ItemUseOutOfBattle_Itemfinder: ; 80FD490 push {r4,lr} adds r4, r0, 0 lsls r4, 24 @@ -460820,25 +460954,25 @@ it_itemfinder: ; 80FD490 movs r0, 0x27 bl sav12_xor_increment ldr r1, =0x0203a0f4 - ldr r0, =sub_80FD4B8 + ldr r0, =ItemUseOnFieldCB_Itemfinder str r0, [r1] adds r0, r4, 0 - bl run_eventually_start + bl SetUpItemUseOnFieldCallback pop {r4} pop {r0} bx r0 .pool - thumb_func_end it_itemfinder + thumb_func_end ItemUseOutOfBattle_Itemfinder - thumb_func_start sub_80FD4B8 -sub_80FD4B8: ; 80FD4B8 + thumb_func_start ItemUseOnFieldCB_Itemfinder +ItemUseOnFieldCB_Itemfinder: ; 80FD4B8 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 ldr r0, =0x02037318 ldr r0, [r0, 0x4] adds r1, r4, 0 - bl sub_80FD5F0 + bl ItemfinderCheckForHiddenItems lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -460856,13 +460990,13 @@ sub_80FD4B8: ; 80FD4B8 ldr r1, =gUnknown_085E9002 ldr r2, =sub_80FD5CC adds r0, r4, 0 - bl sub_81978EC + bl DisplayItemMessageOnField @080FD4F6: pop {r4} pop {r0} bx r0 .pool - thumb_func_end sub_80FD4B8 + thumb_func_end ItemUseOnFieldCB_Itemfinder thumb_func_start sub_80FD504 sub_80FD504: ; 80FD504 @@ -460977,8 +461111,9 @@ sub_80FD5CC: ; 80FD5CC bx r0 thumb_func_end sub_80FD5CC - thumb_func_start sub_80FD5F0 -sub_80FD5F0: ; 80FD5F0 + thumb_func_start ItemfinderCheckForHiddenItems +; BOOL ItemfinderCheckForHiddenItems(struct map_events *events, u8 taskId) +ItemfinderCheckForHiddenItems: ; 80FD5F0 push {r4-r7,lr} mov r7, r9 mov r6, r8 @@ -461093,7 +461228,7 @@ sub_80FD5F0: ; 80FD5F0 pop {r4-r7} pop {r1} bx r1 - thumb_func_end sub_80FD5F0 + thumb_func_end ItemfinderCheckForHiddenItems thumb_func_start sub_80FD6D4 sub_80FD6D4: ; 80FD6D4 @@ -461647,7 +461782,7 @@ sub_80FDA94: ; 80FDA94 ldr r1, =gUnknown_085E8F93 ldr r2, =sub_80FD5CC adds r0, r4, 0 - bl sub_81978EC + bl DisplayItemMessageOnField @080FDACA: pop {r4} pop {r0} @@ -461711,7 +461846,7 @@ sub_80FDADC: ; 80FDADC ldr r1, =gUnknown_085E8FDB ldr r2, =sub_80FD5CC adds r0, r5, 0 - bl sub_81978EC + bl DisplayItemMessageOnField @080FDB50: pop {r4,r5} pop {r0} @@ -461719,8 +461854,8 @@ sub_80FDADC: ; 80FDADC .pool thumb_func_end sub_80FDADC - thumb_func_start sub_80FDB6C -sub_80FDB6C: ; 80FDB6C + thumb_func_start ItemUseOutOfBattle_PokeblockCase +ItemUseOutOfBattle_PokeblockCase: ; 80FDB6C push {r4,r5,lr} lsls r0, 24 lsrs r4, r0, 24 @@ -461736,7 +461871,7 @@ sub_80FDB6C: ; 80FDB6C adds r1, r0 ldrb r1, [r1, 0xE] adds r0, r4, 0 - bl display_dads_advice_cannot_use_item_str + bl DisplayDadsAdviceCannotUseItemMessage b @080FDBDA .pool @080FDB98: @@ -461754,7 +461889,7 @@ sub_80FDB6C: ; 80FDB6C ldr r0, =sub_80FDBEC str r0, [r1] adds r0, r4, 0 - bl task_close_bag_menu_1 + bl sub_81AB8F8 b @080FDBDA .pool @080FDBC8: @@ -461771,7 +461906,7 @@ sub_80FDB6C: ; 80FDB6C pop {r0} bx r0 .pool - thumb_func_end sub_80FDB6C + thumb_func_end ItemUseOutOfBattle_PokeblockCase thumb_func_start sub_80FDBEC sub_80FDBEC: ; 80FDBEC @@ -461808,13 +461943,13 @@ sub_80FDC00: ; 80FDC00 .pool thumb_func_end sub_80FDC00 - thumb_func_start sub_80FDC34 -sub_80FDC34: ; 80FDC34 + thumb_func_start ItemUseOutOfBattle_CoinCase +ItemUseOutOfBattle_CoinCase: ; 80FDC34 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 ldr r4, =0x02021cc4 - bl sub_8145C30 + bl GetCoins adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 @@ -461839,23 +461974,23 @@ sub_80FDC34: ; 80FDC34 adds r0, r5, 0 movs r1, 0x1 adds r2, r4, 0 - bl sub_81ABB4C + bl DisplayItemMessage b @080FDC9A .pool @080FDC90: - ldr r2, =sub_80FD1F8 + ldr r2, =CleanUpAfterFailingToUseRegisteredKeyItemOnField adds r0, r5, 0 adds r1, r4, 0 - bl sub_81978EC + bl DisplayItemMessageOnField @080FDC9A: pop {r4,r5} pop {r0} bx r0 .pool - thumb_func_end sub_80FDC34 + thumb_func_end ItemUseOutOfBattle_CoinCase - thumb_func_start sub_80FDCA4 -sub_80FDCA4: ; 80FDCA4 + thumb_func_start ItemUseOutOfBattle_PowderJar +ItemUseOutOfBattle_PowderJar: ; 80FDCA4 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 @@ -461883,27 +462018,27 @@ sub_80FDCA4: ; 80FDCA4 adds r0, r5, 0 movs r1, 0x1 adds r2, r4, 0 - bl sub_81ABB4C + bl DisplayItemMessage b @080FDD06 .pool @080FDCFC: - ldr r2, =sub_80FD1F8 + ldr r2, =CleanUpAfterFailingToUseRegisteredKeyItemOnField adds r0, r5, 0 adds r1, r4, 0 - bl sub_81978EC + bl DisplayItemMessageOnField @080FDD06: pop {r4,r5} pop {r0} bx r0 .pool - thumb_func_end sub_80FDCA4 + thumb_func_end ItemUseOutOfBattle_PowderJar thumb_func_start sub_80FDD10 sub_80FDD10: ; 80FDD10 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - bl sub_80E1738 + bl IsPlayerFacingPlantedBerryTree lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -461912,14 +462047,14 @@ sub_80FDD10: ; 80FDD10 ldr r0, =sub_80FDD74 str r0, [r1] ldr r1, =0x03005dac - ldr r0, =sub_80FD124 + ldr r0, =MapPostLoadHook_UseItem str r0, [r1] ldr r0, =0x0203ce54 ldr r1, [r0] ldr r0, =c2_exit_to_overworld_2_switch str r0, [r1] adds r0, r4, 0 - bl task_close_bag_menu_1 + bl sub_81AB8F8 b @080FDD68 .pool @080FDD58: @@ -461957,8 +462092,8 @@ sub_80FDD74: ; 80FDD74 .pool thumb_func_end sub_80FDD74 - thumb_func_start sub_80FDDA4 -sub_80FDDA4: ; 80FDDA4 + thumb_func_start ItemUseOutOfBattle_WailmerPail +ItemUseOutOfBattle_WailmerPail: ; 80FDDA4 push {r4,r5,lr} lsls r0, 24 lsrs r4, r0, 24 @@ -461973,7 +462108,7 @@ sub_80FDDA4: ; 80FDDA4 b @080FDDD8 .pool @080FDDC8: - bl sub_80E1770 + bl WaterBerryTree lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -461983,7 +462118,7 @@ sub_80FDDA4: ; 80FDDA4 @080FDDD8: str r0, [r1] adds r0, r4, 0 - bl run_eventually_start + bl SetUpItemUseOnFieldCallback b @080FDDFE .pool @080FDDEC: @@ -461994,13 +462129,13 @@ sub_80FDDA4: ; 80FDDA4 adds r1, r0 ldrb r1, [r1, 0xE] adds r0, r5, 0 - bl display_dads_advice_cannot_use_item_str + bl DisplayDadsAdviceCannotUseItemMessage @080FDDFE: pop {r4,r5} pop {r0} bx r0 .pool - thumb_func_end sub_80FDDA4 + thumb_func_end ItemUseOutOfBattle_WailmerPail thumb_func_start sub_80FDE08 sub_80FDE08: ; 80FDE08 @@ -462027,7 +462162,7 @@ sub_80FDE2C: ; 80FDE2C adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + bl GetXYCoordsOneStepInFrontOfPlayer bl PlayerGetZCoord adds r2, r0, 0 lsls r2, 24 @@ -462078,92 +462213,92 @@ sub_80FDE7C: ; 80FDE7C .pool thumb_func_end sub_80FDE7C - thumb_func_start item_field_func_recovery_item -item_field_func_recovery_item: ; 80FDEA0 + thumb_func_start ItemUseOutOfBattle_Medicine +ItemUseOutOfBattle_Medicine: ; 80FDEA0 push {lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x03006328 - ldr r1, =sub_81B6588 + ldr r1, =ItemUseCB_Medicine str r1, [r2] - bl sub_80FD060 + bl SetUpItemUseCallback pop {r0} bx r0 .pool - thumb_func_end item_field_func_recovery_item + thumb_func_end ItemUseOutOfBattle_Medicine - thumb_func_start sub_80FDEBC -sub_80FDEBC: ; 80FDEBC + thumb_func_start ItemUseOutOfBattle_ReduceEV +ItemUseOutOfBattle_ReduceEV: ; 80FDEBC push {lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x03006328 ldr r1, =sub_81B67C8 str r1, [r2] - bl sub_80FD060 + bl SetUpItemUseCallback pop {r0} bx r0 .pool - thumb_func_end sub_80FDEBC + thumb_func_end ItemUseOutOfBattle_ReduceEV - thumb_func_start item_in_battle_func_sacred_ash -item_in_battle_func_sacred_ash: ; 80FDED8 + thumb_func_start ItemUseOutOfBattle_SacredAsh +ItemUseOutOfBattle_SacredAsh: ; 80FDED8 push {lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x03006328 ldr r1, =sub_81B79E8 str r1, [r2] - bl sub_80FD060 + bl SetUpItemUseCallback pop {r0} bx r0 .pool - thumb_func_end item_in_battle_func_sacred_ash + thumb_func_end ItemUseOutOfBattle_SacredAsh - thumb_func_start item_field_func_pp_recovery_item -item_field_func_pp_recovery_item: ; 80FDEF4 + thumb_func_start ItemUseOutOfBattle_PPRecovery +ItemUseOutOfBattle_PPRecovery: ; 80FDEF4 push {lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x03006328 ldr r1, =dp05_ether str r1, [r2] - bl sub_80FD060 + bl SetUpItemUseCallback pop {r0} bx r0 .pool - thumb_func_end item_field_func_pp_recovery_item + thumb_func_end ItemUseOutOfBattle_PPRecovery - thumb_func_start sub_80FDF10 -sub_80FDF10: ; 80FDF10 + thumb_func_start ItemUseOutOfBattle_PPUp +ItemUseOutOfBattle_PPUp: ; 80FDF10 push {lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x03006328 ldr r1, =dp05_pp_up str r1, [r2] - bl sub_80FD060 + bl SetUpItemUseCallback pop {r0} bx r0 .pool - thumb_func_end sub_80FDF10 + thumb_func_end ItemUseOutOfBattle_PPUp - thumb_func_start sub_80FDF2C -sub_80FDF2C: ; 80FDF2C + thumb_func_start ItemUseOutOfBattle_RareCandy +ItemUseOutOfBattle_RareCandy: ; 80FDF2C push {lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x03006328 ldr r1, =dp05_rare_candy str r1, [r2] - bl sub_80FD060 + bl SetUpItemUseCallback pop {r0} bx r0 .pool - thumb_func_end sub_80FDF2C + thumb_func_end ItemUseOutOfBattle_RareCandy - thumb_func_start sub_80FDF48 -sub_80FDF48: ; 80FDF48 + thumb_func_start ItemUseOutOfBattle_TMHM +ItemUseOutOfBattle_TMHM: ; 80FDF48 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 @@ -462177,7 +462312,7 @@ sub_80FDF48: ; 80FDF48 ldr r3, =sub_80FDF90 adds r0, r4, 0 movs r1, 0x1 - bl sub_81ABB4C + bl DisplayItemMessage b @080FDF80 .pool @080FDF74: @@ -462185,13 +462320,13 @@ sub_80FDF48: ; 80FDF48 ldr r3, =sub_80FDF90 adds r0, r4, 0 movs r1, 0x1 - bl sub_81ABB4C + bl DisplayItemMessage @080FDF80: pop {r4} pop {r0} bx r0 .pool - thumb_func_end sub_80FDF48 + thumb_func_end ItemUseOutOfBattle_TMHM thumb_func_start sub_80FDF90 sub_80FDF90: ; 80FDF90 @@ -462245,7 +462380,7 @@ task08_0809AD8C: ; 80FDFBC adds r0, r5, 0 movs r1, 0x1 adds r2, r4, 0 - bl sub_81ABB4C + bl DisplayItemMessage @080FE000: pop {r4,r5} pop {r0} @@ -462274,7 +462409,7 @@ sub_80FE03C: ; 80FE03C ldr r2, =0x03006328 ldr r1, =sub_81B6DC4 str r1, [r2] - bl sub_80FD060 + bl SetUpItemUseCallback pop {r0} bx r0 .pool @@ -462293,7 +462428,7 @@ sub_80FE058: ; 80FE058 ldr r0, =0x02021fc4 ldr r1, =gUnknown_085E9080 bl ExpandStringRefs - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 bne @080FE0AC @@ -462318,8 +462453,8 @@ sub_80FE058: ; 80FE058 bx r0 thumb_func_end sub_80FE058 - thumb_func_start sub_80FE0BC -sub_80FE0BC: ; 80FE0BC + thumb_func_start ItemUseOutOfBattle_Repel +ItemUseOutOfBattle_Repel: ; 80FE0BC push {r4,r5,lr} lsls r0, 24 lsrs r4, r0, 24 @@ -462339,7 +462474,7 @@ sub_80FE0BC: ; 80FE0BC b @080FE116 .pool @080FE0EC: - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 bne @080FE10C @@ -462347,20 +462482,20 @@ sub_80FE0BC: ; 80FE0BC ldr r3, =sub_81ABBBC adds r0, r4, 0 movs r1, 0x1 - bl sub_81ABB4C + bl DisplayItemMessage b @080FE116 .pool @080FE10C: ldr r1, =gUnknown_085E9092 ldr r2, =sub_81C6714 adds r0, r5, 0 - bl sub_81C6DD8 + bl DisplayItemMessageInBattlePyramid @080FE116: pop {r4,r5} pop {r0} bx r0 .pool - thumb_func_end sub_80FE0BC + thumb_func_end ItemUseOutOfBattle_Repel thumb_func_start sub_80FE124 sub_80FE124: ; 80FE124 @@ -462415,7 +462550,7 @@ sub_80FE164: ; 80FE164 adds r0, r4, 0 bl VarSet bl sub_80FE058 - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 bne @080FE1B8 @@ -462423,14 +462558,14 @@ sub_80FE164: ; 80FE164 ldr r3, =sub_81ABBBC adds r0, r5, 0 movs r1, 0x1 - bl sub_81ABB4C + bl DisplayItemMessage b @080FE1C2 .pool @080FE1B8: ldr r1, =0x02021fc4 ldr r2, =sub_81C6714 adds r0, r6, 0 - bl sub_81C6DD8 + bl DisplayItemMessageInBattlePyramid @080FE1C2: pop {r4-r6} pop {r0} @@ -462458,7 +462593,7 @@ sub_80FE1D0: ; 80FE1D0 ble @080FE226 movs r0, 0x75 bl audio_play - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 bne @080FE21C @@ -462466,14 +462601,14 @@ sub_80FE1D0: ; 80FE1D0 ldr r3, =sub_81ABBBC adds r0, r4, 0 movs r1, 0x1 - bl sub_81ABB4C + bl DisplayItemMessage b @080FE226 .pool @080FE21C: ldr r1, =0x02021fc4 ldr r2, =sub_81C6714 adds r0, r5, 0 - bl sub_81C6DD8 + bl DisplayItemMessageInBattlePyramid @080FE226: pop {r4,r5} pop {r0} @@ -462481,8 +462616,8 @@ sub_80FE1D0: ; 80FE1D0 .pool thumb_func_end sub_80FE1D0 - thumb_func_start item_field_func_black_white_flutes -item_field_func_black_white_flutes: ; 80FE234 + thumb_func_start ItemUseOutOfBattle_BlackWhiteFlute +ItemUseOutOfBattle_BlackWhiteFlute: ; 80FE234 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 @@ -462524,7 +462659,7 @@ item_field_func_black_white_flutes: ; 80FE234 pop {r0} bx r0 .pool - thumb_func_end item_field_func_black_white_flutes + thumb_func_end ItemUseOutOfBattle_BlackWhiteFlute thumb_func_start task08_080A1C44 task08_080A1C44: ; 80FE2BC @@ -462559,7 +462694,7 @@ re_escape_rope: ; 80FE2D8 ldr r1, =0x02021fc4 ldr r2, =task08_080A1C44 adds r0, r4, 0 - bl sub_81978EC + bl DisplayItemMessageOnField pop {r4} pop {r0} bx r0 @@ -462585,8 +462720,8 @@ sub_80FE314: ; 80FE314 bx r1 thumb_func_end sub_80FE314 - thumb_func_start sub_80FE334 -sub_80FE334: ; 80FE334 + thumb_func_start ItemUseOutOfBattle_EscapeRope +ItemUseOutOfBattle_EscapeRope: ; 80FE334 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 @@ -462599,7 +462734,7 @@ sub_80FE334: ; 80FE334 ldr r0, =re_escape_rope str r0, [r1] adds r0, r4, 0 - bl run_eventually_start + bl SetUpItemUseOnFieldCallback b @080FE36E .pool @080FE35C: @@ -462610,30 +462745,30 @@ sub_80FE334: ; 80FE334 adds r1, r0 ldrb r1, [r1, 0xE] adds r0, r4, 0 - bl display_dads_advice_cannot_use_item_str + bl DisplayDadsAdviceCannotUseItemMessage @080FE36E: pop {r4} pop {r0} bx r0 .pool - thumb_func_end sub_80FE334 + thumb_func_end ItemUseOutOfBattle_EscapeRope - thumb_func_start sub_80FE378 -sub_80FE378: ; 80FE378 + thumb_func_start ItemUseOutOfBattle_EvolutionStone +ItemUseOutOfBattle_EvolutionStone: ; 80FE378 push {lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x03006328 ldr r1, =sub_81B7C74 str r1, [r2] - bl sub_80FD060 + bl SetUpItemUseCallback pop {r0} bx r0 .pool - thumb_func_end sub_80FE378 + thumb_func_end ItemUseOutOfBattle_EvolutionStone - thumb_func_start item_in_battle_func_pokeball -item_in_battle_func_pokeball: ; 80FE394 + thumb_func_start ItemUseInBattle_PokeBall +ItemUseInBattle_PokeBall: ; 80FE394 push {r4,r5,lr} lsls r0, 24 lsrs r4, r0, 24 @@ -462646,12 +462781,12 @@ item_in_battle_func_pokeball: ; 80FE394 ldrh r0, [r0] movs r1, 0x1 bl sub_80D6AA4 - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 bne @080FE3C8 adds r0, r4, 0 - bl task_close_bag_menu_1 + bl sub_81AB8F8 b @080FE3FA .pool @080FE3C8: @@ -462659,7 +462794,7 @@ item_in_battle_func_pokeball: ; 80FE394 bl sub_81C5B14 b @080FE3FA @080FE3D0: - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 bne @080FE3F0 @@ -462667,20 +462802,20 @@ item_in_battle_func_pokeball: ; 80FE394 ldr r3, =sub_81ABBBC adds r0, r4, 0 movs r1, 0x1 - bl sub_81ABB4C + bl DisplayItemMessage b @080FE3FA .pool @080FE3F0: ldr r1, =gUnknown_085E9125 ldr r2, =sub_81C6714 adds r0, r5, 0 - bl sub_81C6DD8 + bl DisplayItemMessageInBattlePyramid @080FE3FA: pop {r4,r5} pop {r0} bx r0 .pool - thumb_func_end item_in_battle_func_pokeball + thumb_func_end ItemUseInBattle_PokeBall thumb_func_start sub_80FE408 sub_80FE408: ; 80FE408 @@ -462694,12 +462829,12 @@ sub_80FE408: ; 80FE408 ands r0, r1 cmp r0, 0 beq @080FE43A - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 bne @080FE434 adds r0, r4, 0 - bl task_close_bag_menu_1 + bl sub_81AB8F8 b @080FE43A .pool @080FE434: @@ -462735,7 +462870,7 @@ sub_80FE440: ; 80FE440 ldrh r0, [r4] movs r1, 0x1 bl sub_80D6AA4 - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 bne @080FE49C @@ -462745,7 +462880,7 @@ sub_80FE440: ; 80FE440 ldr r3, =sub_80FE408 adds r0, r5, 0 movs r1, 0x1 - bl sub_81ABB4C + bl DisplayItemMessage b @080FE4AC .pool @080FE49C: @@ -462754,7 +462889,7 @@ sub_80FE440: ; 80FE440 adds r1, r0, 0 ldr r2, =sub_80FE408 adds r0, r6, 0 - bl sub_81C6DD8 + bl DisplayItemMessageInBattlePyramid @080FE4AC: pop {r4-r6} pop {r0} @@ -462762,8 +462897,8 @@ sub_80FE440: ; 80FE440 .pool thumb_func_end sub_80FE440 - thumb_func_start status_incr_battle -status_incr_battle: ; 80FE4B8 + thumb_func_start ItemUseInBattle_StatIncrease +ItemUseInBattle_StatIncrease: ; 80FE4B8 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 @@ -462782,12 +462917,12 @@ status_incr_battle: ; 80FE4B8 lsls r2, 24 lsrs r2, 24 movs r3, 0 - bl sub_806BD04 + bl ExecuteTableBasedItemEffect_ lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0 beq @080FE52C - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 bne @080FE518 @@ -462795,14 +462930,14 @@ status_incr_battle: ; 80FE4B8 ldr r3, =sub_81ABBBC adds r0, r4, 0 movs r1, 0x1 - bl sub_81ABB4C + bl DisplayItemMessage b @080FE53C .pool @080FE518: ldr r1, =gUnknown_085E96F6 ldr r2, =sub_81C6714 adds r0, r4, 0 - bl sub_81C6DD8 + bl DisplayItemMessageInBattlePyramid b @080FE53C .pool @080FE52C: @@ -462819,14 +462954,14 @@ status_incr_battle: ; 80FE4B8 pop {r0} bx r0 .pool - thumb_func_end status_incr_battle + thumb_func_end ItemUseInBattle_StatIncrease thumb_func_start sub_80FE54C sub_80FE54C: ; 80FE54C push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 bne @080FE574 @@ -462835,7 +462970,7 @@ sub_80FE54C: ; 80FE54C ldr r0, =sub_81B89F0 str r0, [r1] adds r0, r4, 0 - bl task_close_bag_menu_1 + bl sub_81AB8F8 b @080FE582 .pool @080FE574: @@ -462852,19 +462987,19 @@ sub_80FE54C: ; 80FE54C .pool thumb_func_end sub_80FE54C - thumb_func_start item_in_battle_func_recovery_item -item_in_battle_func_recovery_item: ; 80FE590 + thumb_func_start ItemUseInBattle_Medicine +ItemUseInBattle_Medicine: ; 80FE590 push {lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x03006328 - ldr r1, =sub_81B6588 + ldr r1, =ItemUseCB_Medicine str r1, [r2] bl sub_80FE54C pop {r0} bx r0 .pool - thumb_func_end item_in_battle_func_recovery_item + thumb_func_end ItemUseInBattle_Medicine thumb_func_start sub_80FE5AC sub_80FE5AC: ; 80FE5AC @@ -462880,8 +463015,8 @@ sub_80FE5AC: ; 80FE5AC .pool thumb_func_end sub_80FE5AC - thumb_func_start item_in_battle_func_pp_recovery_item -item_in_battle_func_pp_recovery_item: ; 80FE5C8 + thumb_func_start ItemUseInBattle_PPRecovery +ItemUseInBattle_PPRecovery: ; 80FE5C8 push {lr} lsls r0, 24 lsrs r0, 24 @@ -462892,10 +463027,10 @@ item_in_battle_func_pp_recovery_item: ; 80FE5C8 pop {r0} bx r0 .pool - thumb_func_end item_in_battle_func_pp_recovery_item + thumb_func_end ItemUseInBattle_PPRecovery - thumb_func_start sub_80FE5E4 -sub_80FE5E4: ; 80FE5E4 + thumb_func_start ItemUseInBattle_Escape +ItemUseInBattle_Escape: ; 80FE5E4 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 @@ -462906,22 +463041,22 @@ sub_80FE5E4: ; 80FE5E4 cmp r0, 0 bne @080FE634 bl sub_80FE058 - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 bne @080FE620 ldr r2, =0x02021fc4 - ldr r3, =task_close_bag_menu_1 + ldr r3, =sub_81AB8F8 adds r0, r4, 0 movs r1, 0x1 - bl sub_81ABB4C + bl DisplayItemMessage b @080FE646 .pool @080FE620: ldr r1, =0x02021fc4 ldr r2, =sub_81C5B14 adds r0, r4, 0 - bl sub_81C6DD8 + bl DisplayItemMessageInBattlePyramid b @080FE646 .pool @080FE634: @@ -462932,22 +463067,22 @@ sub_80FE5E4: ; 80FE5E4 adds r1, r0 ldrb r1, [r1, 0xE] adds r0, r4, 0 - bl display_dads_advice_cannot_use_item_str + bl DisplayDadsAdviceCannotUseItemMessage @080FE646: pop {r4} pop {r0} bx r0 .pool - thumb_func_end sub_80FE5E4 + thumb_func_end ItemUseInBattle_Escape - thumb_func_start sub_80FE650 -sub_80FE650: ; 80FE650 + thumb_func_start ItemUseOutOfBattle_EnigmaBerry +ItemUseOutOfBattle_EnigmaBerry: ; 80FE650 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 ldr r0, =0x0203ce7c ldrh r0, [r0] - bl sub_81B7CEC + bl GetItemEffectType lsls r0, 24 lsrs r0, 24 subs r0, 0x1 @@ -462993,7 +463128,7 @@ sub_80FE650: ; 80FE650 movs r0, 0x1 strh r0, [r1, 0x10] adds r0, r4, 0 - bl item_field_func_recovery_item + bl ItemUseOutOfBattle_Medicine b @080FE770 .pool @080FE6EC: @@ -463005,7 +463140,7 @@ sub_80FE650: ; 80FE650 movs r0, 0x1 strh r0, [r1, 0x10] adds r0, r4, 0 - bl item_in_battle_func_sacred_ash + bl ItemUseOutOfBattle_SacredAsh b @080FE770 .pool @080FE708: @@ -463017,7 +463152,7 @@ sub_80FE650: ; 80FE650 movs r0, 0x1 strh r0, [r1, 0x10] adds r0, r4, 0 - bl sub_80FDF2C + bl ItemUseOutOfBattle_RareCandy b @080FE770 .pool @080FE724: @@ -463029,7 +463164,7 @@ sub_80FE650: ; 80FE650 movs r0, 0x1 strh r0, [r1, 0x10] adds r0, r4, 0 - bl sub_80FDF10 + bl ItemUseOutOfBattle_PPUp b @080FE770 .pool @080FE740: @@ -463041,7 +463176,7 @@ sub_80FE650: ; 80FE650 movs r0, 0x1 strh r0, [r1, 0x10] adds r0, r4, 0 - bl item_field_func_pp_recovery_item + bl ItemUseOutOfBattle_PPRecovery b @080FE770 .pool @080FE75C: @@ -463053,22 +463188,22 @@ sub_80FE650: ; 80FE650 movs r0, 0x4 strh r0, [r1, 0x10] adds r0, r4, 0 - bl item_field_func_cannot_use + bl ItemUseOutOfBattle_CannotUse @080FE770: pop {r4} pop {r0} bx r0 .pool - thumb_func_end sub_80FE650 + thumb_func_end ItemUseOutOfBattle_EnigmaBerry - thumb_func_start sub_80FE77C -sub_80FE77C: ; 80FE77C + thumb_func_start ItemUseInBattle_EnigmaBerry +ItemUseInBattle_EnigmaBerry: ; 80FE77C push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 ldr r0, =0x0203ce7c ldrh r0, [r0] - bl sub_81B7CEC + bl GetItemEffectType lsls r0, 24 lsrs r0, 24 cmp r0, 0x15 @@ -463105,27 +463240,27 @@ sub_80FE77C: ; 80FE77C .4byte @080FE80C @080FE7FC: adds r0, r4, 0 - bl status_incr_battle + bl ItemUseInBattle_StatIncrease b @080FE81A @080FE804: adds r0, r4, 0 - bl item_in_battle_func_recovery_item + bl ItemUseInBattle_Medicine b @080FE81A @080FE80C: adds r0, r4, 0 - bl item_in_battle_func_pp_recovery_item + bl ItemUseInBattle_PPRecovery b @080FE81A @080FE814: adds r0, r4, 0 - bl item_field_func_cannot_use + bl ItemUseOutOfBattle_CannotUse @080FE81A: pop {r4} pop {r0} bx r0 - thumb_func_end sub_80FE77C + thumb_func_end ItemUseInBattle_EnigmaBerry - thumb_func_start item_field_func_cannot_use -item_field_func_cannot_use: ; 80FE820 + thumb_func_start ItemUseOutOfBattle_CannotUse +ItemUseOutOfBattle_CannotUse: ; 80FE820 push {lr} lsls r0, 24 lsrs r0, 24 @@ -463135,11 +463270,11 @@ item_field_func_cannot_use: ; 80FE820 lsls r1, 3 adds r1, r2 ldrb r1, [r1, 0xE] - bl display_dads_advice_cannot_use_item_str + bl DisplayDadsAdviceCannotUseItemMessage pop {r0} bx r0 .pool - thumb_func_end item_field_func_cannot_use + thumb_func_end ItemUseOutOfBattle_CannotUse thumb_func_start sub_80FE840 sub_80FE840: ; 80FE840 @@ -464541,7 +464676,7 @@ sub_80FF374: ; 80FF374 ldr r4, =0x0203841e ldrb r1, [r4, 0x4] adds r0, r5, 0 - bl sub_8008258 + bl StartObjectRotScalAnim ldrh r0, [r4, 0x4] strh r0, [r5, 0x3A] ldrh r0, [r4, 0x6] @@ -464632,7 +464767,7 @@ sub_80FF3EC: ; 80FF3EC lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 - bl sub_8008258 + bl StartObjectRotScalAnim b @080FF452 @080FF44C: adds r0, r4, 0 @@ -465410,7 +465545,7 @@ sub_80FFA84: ; 80FFA84 bne @080FFA98 adds r0, r4, 0 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim @080FFA98: ldrh r0, [r4, 0x2E] adds r0, 0x1 @@ -465908,7 +466043,7 @@ sub_80FFE58: ; 80FFE58 strh r0, [r4, 0x34] adds r0, r4, 0 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim b @080FFEBA @080FFE82: movs r1, 0x36 @@ -467463,7 +467598,7 @@ sub_8100A94: ; 8100A94 strh r0, [r4, 0x38] ldrb r1, [r1, 0xC] adds r0, r4, 0 - bl sub_8008258 + bl StartObjectRotScalAnim ldr r1, =move_anim_8074EE0 adds r0, r4, 0 bl oamt_set_x3A_32 @@ -468358,7 +468493,7 @@ sub_8101138: ; 8101138 strh r0, [r4, 0x30] adds r0, r4, 0 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim b @08101272 @081011E8: adds r0, r4, 0 @@ -468780,7 +468915,7 @@ sub_81014F4: ; 81014F4 strh r0, [r4, 0x34] adds r0, r4, 0 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim @0810154A: ldr r0, =sub_8101560 str r0, [r4, 0x1C] @@ -472439,7 +472574,7 @@ sub_8103250: ; 8103250 ble @08103276 adds r0, r4, 0 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim ldr r1, =move_anim_8074EE0 adds r0, r4, 0 bl oamt_set_x3A_32 @@ -476700,7 +476835,7 @@ sub_81054E8: ; 81054E8 @0810550E: adds r0, r4, 0 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim ldr r1, =sub_80A77C8 str r1, [r4, 0x1C] adds r0, r4, 0 @@ -476789,7 +476924,7 @@ sub_810557C: ; 810557C strh r5, [r4, 0x2E] adds r0, r4, 0 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim ldr r0, =sub_81055F4 str r0, [r4, 0x1C] @081055E0: @@ -476812,7 +476947,7 @@ sub_81055F4: ; 81055F4 ble @08105612 adds r0, r4, 0 movs r1, 0x2 - bl sub_8008258 + bl StartObjectRotScalAnim ldr r0, =sub_810561C str r0, [r4, 0x1C] @08105612: @@ -476834,7 +476969,7 @@ sub_810561C: ; 810561C beq @08105682 adds r0, r4, 0 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim movs r0, 0 strh r0, [r4, 0x2E] movs r1, 0x3C @@ -480028,7 +480163,7 @@ sub_8106F60: ; 8106F60 strh r5, [r6, 0x34] adds r0, r6, 0 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim @0810700A: pop {r4-r6} pop {r0} @@ -480148,7 +480283,7 @@ sub_81070AC: ; 81070AC strh r0, [r5, 0x22] adds r0, r5, 0 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim b @08107118 .pool @081070F8: @@ -482985,7 +483120,7 @@ sub_81087C0: ; 81087C0 ldr r4, =0x02020630 adds r0, r4 movs r1, 0x3 - bl sub_8008258 + bl StartObjectRotScalAnim movs r2, 0x30 ldrsh r1, [r5, r2] lsls r0, r1, 4 @@ -487653,7 +487788,7 @@ sub_810AD98: ; 810AD98 push {r4,r5,lr} adds r5, r0, 0 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim ldr r4, =0x02038436 ldrb r0, [r4] movs r1, 0x2 @@ -488275,7 +488410,7 @@ sub_810B23C: ; 810B23C strh r0, [r5, 0x22] adds r0, r5, 0 movs r1, 0x2 - bl sub_8008258 + bl StartObjectRotScalAnim ldrh r0, [r5, 0x2E] adds r0, 0x1 strh r0, [r5, 0x2E] @@ -491302,7 +491437,7 @@ sub_810C9E4: ; 810C9E4 adds r4, r0 adds r0, r4, 0 mov r1, r9 - bl sub_8008258 + bl StartObjectRotScalAnim mov r0, sp ldrh r0, [r0, 0x4] strh r0, [r4, 0x2E] @@ -491500,7 +491635,7 @@ unc_080B06FC: ; 810CC88 movs r1, 0x4 @0810CCA6: adds r0, r5, 0 - bl sub_8008258 + bl StartObjectRotScalAnim adds r0, r5, 0 movs r1, 0x1 bl sub_80A69CC @@ -491957,7 +492092,7 @@ sub_810CF30: ; 810CF30 ldr r4, =0x02020630 adds r0, r4 movs r1, 0 - bl sub_8008258 + bl StartObjectRotScalAnim movs r2, 0x3C ldrsh r1, [r5, r2] lsls r0, r1, 4 @@ -492230,7 +492365,7 @@ sub_810D2B0: ; 810D2B0 push {r4,lr} adds r4, r0, 0 movs r1, 0 - bl sub_8008258 + bl StartObjectRotScalAnim adds r2, r4, 0 adds r2, 0x2C ldrb r0, [r2] @@ -494078,7 +494213,7 @@ sub_810E1C8: ; 810E1C8 strh r0, [r5, 0x22] adds r0, r5, 0 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim b @0810E1FE .pool @0810E1F8: @@ -497610,7 +497745,7 @@ sub_810FD3C: ; 810FD3C movs r1, 0x3 ands r1, r0 adds r0, r4, 0 - bl sub_8008258 + bl StartObjectRotScalAnim @0810FDB4: ldrh r0, [r5, 0xC] adds r0, 0x1 @@ -498334,7 +498469,7 @@ sub_8110368: ; 8110368 beq @08110394 adds r0, r6, 0 movs r1, 0x2 - bl sub_8008258 + bl StartObjectRotScalAnim ldr r0, =0x0203841e ldrh r1, [r0, 0x4] negs r1, r1 @@ -498353,7 +498488,7 @@ sub_8110368: ; 8110368 bne @081103C4 adds r0, r6, 0 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim ldr r1, =0x0203841e ldrh r0, [r1, 0x2] negs r0, r0 @@ -498429,7 +498564,7 @@ sub_8110438: ; 8110438 strh r0, [r1] adds r0, r6, 0 movs r1, 0x2 - bl sub_8008258 + bl StartObjectRotScalAnim b @08110478 .pool @0811045C: @@ -500338,7 +500473,7 @@ sub_8111418: ; 8111418 bne @08111434 adds r0, r4, 0 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim @08111434: adds r0, r4, 0 bl sub_80A7820 @@ -504008,7 +504143,7 @@ sub_8113224: ; 8113224 beq @0811323E adds r0, r4, 0 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim @0811323E: adds r0, r4, 0 bl sub_8113100 @@ -504951,7 +505086,7 @@ sub_81139DC: ; 81139DC strh r0, [r4, 0x22] ldrb r1, [r5, 0x4] adds r0, r4, 0 - bl sub_8008258 + bl StartObjectRotScalAnim ldrh r0, [r5, 0x6] strh r0, [r4, 0x2E] ldrh r0, [r5, 0x8] @@ -505126,7 +505261,7 @@ sub_8113A90: ; 8113A90 strh r0, [r4, 0x22] adds r0, r4, 0 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim movs r6, 0xEC @08113B60: movs r0, 0x20 @@ -510014,7 +510149,7 @@ sub_8116388: ; 8116388 adds r5, r0, 0 ldr r4, =0x0203841e ldrb r1, [r4, 0x6] - bl sub_8008258 + bl StartObjectRotScalAnim movs r1, 0x4 ldrsh r0, [r4, r1] cmp r0, 0 @@ -510046,7 +510181,7 @@ sub_81163D0: ; 81163D0 adds r5, r0, 0 ldr r4, =0x0203841e ldrb r1, [r4, 0x6] - bl sub_8008258 + bl StartObjectRotScalAnim movs r1, 0x4 ldrsh r0, [r4, r1] cmp r0, 0 @@ -510120,7 +510255,7 @@ sub_8116458: ; 8116458 @08116474: ldrb r1, [r5, 0x2] adds r0, r4, 0 - bl sub_8008258 + bl StartObjectRotScalAnim movs r1, 0 ldrsh r0, [r5, r1] cmp r0, 0 @@ -510203,7 +510338,7 @@ sub_81164F0: ; 81164F0 strh r0, [r4, 0x26] ldrb r1, [r5, 0x6] adds r0, r4, 0 - bl sub_8008258 + bl StartObjectRotScalAnim ldr r1, =move_anim_8074EE0 adds r0, r4, 0 bl oamt_set_x3A_32 @@ -510254,7 +510389,7 @@ sub_81165A8: ; 81165A8 adds r5, r0, 0 ldr r4, =0x0203841e ldrb r1, [r4, 0x6] - bl sub_8008258 + bl StartObjectRotScalAnim movs r1, 0x4 ldrsh r0, [r4, r1] cmp r0, 0 @@ -517087,7 +517222,7 @@ sub_8119E38: ; 8119E38 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r5, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 add r1, sp, 0x4 @@ -517321,7 +517456,7 @@ sub_8119FF8: ; 8119FF8 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r4, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 bl IsRunningDisallowedByMetatile @@ -517370,8 +517505,9 @@ player_should_look_direction_be_enforced_upon_movement: ; 811A044 bx r1 thumb_func_end player_should_look_direction_be_enforced_upon_movement - thumb_func_start sub_811A080 -sub_811A080: ; 811A080 + thumb_func_start GetOnOffBike +; void GetOnOffBike(u8 transitionFlags) +GetOnOffBike: ; 811A080 push {r4,lr} lsls r0, 24 lsrs r2, r0, 24 @@ -517385,14 +517521,14 @@ sub_811A080: ; 811A080 cmp r0, 0 beq @0811A0B0 movs r0, 0x1 - bl SetPlayerAvatarTransition + bl SetPlayerAvatarTransitionFlags bl sav1_reset_battle_music_maybe bl sub_8085784 b @0811A0C4 .pool @0811A0B0: adds r0, r2, 0 - bl SetPlayerAvatarTransition + bl SetPlayerAvatarTransitionFlags ldr r4, =0x00000193 adds r0, r4, 0 bl sav1_set_battle_music_maybe @@ -517403,7 +517539,7 @@ sub_811A080: ; 811A080 pop {r0} bx r0 .pool - thumb_func_end sub_811A080 + thumb_func_end GetOnOffBike thumb_func_start sub_811A0D0 sub_811A0D0: ; 811A0D0 @@ -517528,7 +517664,7 @@ sub_811A188: ; 811A188 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r4, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 bl MetatileBehavior_IsBumpySlope @@ -523429,7 +523565,7 @@ sub_811CFCC: ; 811CFCC movs r0, 0x1 adds r1, r5, 0 movs r2, 0x90 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r4, r0, 0 movs r0, 0 movs r1, 0 @@ -526561,7 +526697,7 @@ sub_811E828: ; 811E828 adds r1, r5, 0 movs r2, 0x4C movs r3, 0x28 - bl sub_808DD68 + bl AddPseudoFieldObject lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x40 @@ -526592,7 +526728,7 @@ sub_811E828: ; 811E828 adds r1, r5, 0 movs r2, 0x34 movs r3, 0x28 - bl sub_808DD68 + bl AddPseudoFieldObject lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x40 @@ -533037,7 +533173,7 @@ sub_8121B1C: ; 8121B1C ldrb r2, [r0] movs r0, 0x1 add r1, sp, 0xC - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r2, r0, 0 adds r2, 0x68 ldr r0, [r4] @@ -533326,8 +533462,9 @@ vblank_hblank_handler_set_zero: ; 8121E68 bx r0 thumb_func_end vblank_hblank_handler_set_zero - thumb_func_start sub_8121E7C -sub_8121E7C: ; 8121E7C + thumb_func_start DisplayMessageAndContinueTask +; void DisplayMessageAndContinueTask(u8 taskId, u8 windowId, u16 windowBorderFirstTileNum, u8 windowBorderPalette, u8 fontId, u8 speed, u8 *str, void ( *callback)(u8 taskId)) +DisplayMessageAndContinueTask: ; 8121E7C push {r4-r7,lr} mov r7, r8 push {r7} @@ -533378,7 +533515,7 @@ sub_8121E7C: ; 8121E7C adds r1, r7, 0 adds r2, r4, 0 adds r3, r5, 0 - bl text_box_related_one + bl AddTextPrinterParametrized ldr r1, =0x0300117c ldr r0, [sp, 0x34] str r0, [r1] @@ -533388,7 +533525,7 @@ sub_8121E7C: ; 8121E7C add r0, r8 lsls r0, 3 adds r0, r1 - ldr r1, =task_show_message + ldr r1, =Task_ContinueTaskAfterMessagePrints str r1, [r0] add sp, 0x10 pop {r3} @@ -533397,7 +533534,7 @@ sub_8121E7C: ; 8121E7C pop {r0} bx r0 .pool - thumb_func_end sub_8121E7C + thumb_func_end DisplayMessageAndContinueTask thumb_func_start sub_8121F20 sub_8121F20: ; 8121F20 @@ -533415,8 +533552,9 @@ sub_8121F20: ; 8121F20 bx r1 thumb_func_end sub_8121F20 - thumb_func_start task_show_message -task_show_message: ; 8121F3C + thumb_func_start Task_ContinueTaskAfterMessagePrints +; void Task_ContinueTaskAfterMessagePrints(u8 taskId) +Task_ContinueTaskAfterMessagePrints: ; 8121F3C push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 @@ -533435,7 +533573,7 @@ task_show_message: ; 8121F3C pop {r0} bx r0 .pool - thumb_func_end task_show_message + thumb_func_end Task_ContinueTaskAfterMessagePrints thumb_func_start sub_8121F68 sub_8121F68: ; 8121F68 @@ -533624,8 +533762,8 @@ sub_8122034: ; 8122034 bx r1 thumb_func_end sub_8122034 - thumb_func_start sub_81220D0 -sub_81220D0: ; 81220D0 + thumb_func_start GetLRKeysState +GetLRKeysState: ; 81220D0 push {lr} ldr r0, =0x03005d90 ldr r0, [r0] @@ -533655,7 +533793,7 @@ sub_81220D0: ; 81220D0 @08122108: pop {r1} bx r1 - thumb_func_end sub_81220D0 + thumb_func_end GetLRKeysState thumb_func_start sub_812210C sub_812210C: ; 812210C @@ -533703,7 +533841,7 @@ sub_8122148: ; 8122148 ldr r0, =0x00001919 cmp r1, r0 beq @08122166 - bl in_trade_center + bl InUnionRoom cmp r0, 0x1 bne @08122174 @08122166: @@ -533725,7 +533863,7 @@ itemid_80BF6D8_mail_related: ; 812217C bl is_c1_link_related_active cmp r0, 0x1 beq @08122192 - bl in_trade_center + bl InUnionRoom cmp r0, 0x1 bne @081221A4 @08122192: @@ -534124,6 +534262,7 @@ sub_81223FC: ; 81223FC thumb_func_end sub_81223FC thumb_func_start sub_8122448 +; void sub_8122448(int a1, u8 a2, u16 x, u16 y) sub_8122448: ; 8122448 push {r4-r7,lr} mov r7, r9 @@ -538376,6 +538515,7 @@ sub_812454C: ; 812454C thumb_func_end sub_812454C thumb_func_start GetMapName +; u8 *GetMapName(u8 *dest, u16 regionMapId, u16 padLength) GetMapName: ; 812456C push {r4,r5,lr} adds r5, r0, 0 @@ -538385,7 +538525,7 @@ GetMapName: ; 812456C lsrs r4, r2, 16 cmp r1, 0x56 bne @08124584 - bl sub_80E97EC + bl GetSecretBaseMapName adds r1, r0, 0 b @081245B2 @08124584: @@ -538853,7 +538993,7 @@ sub_8124904: ; 8124904 movs r0, 0x1 adds r1, r4, 0 movs r2, 0x60 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 @@ -543158,7 +543298,7 @@ sub_8126C08: ; 8126C08 movs r0, 0 movs r1, 0x1 movs r3, 0 - bl text_box_related_one + bl AddTextPrinterParametrized add sp, 0x10 pop {r0} bx r0 @@ -543181,7 +543321,7 @@ sub_8126C48: ; 8126C48 ldr r2, =sub_8126DA4 adds r0, r5, 0 adds r1, r4, 0 - bl sub_81978EC + bl DisplayItemMessageOnField b @08126C96 .pool @08126C7C: @@ -543221,7 +543361,7 @@ sub_8126CA4: ; 8126CA4 ldr r2, =sub_8126DA4 adds r0, r5, 0 adds r1, r4, 0 - bl sub_81978EC + bl DisplayItemMessageOnField b @08126D00 .pool @08126CD8: @@ -543265,7 +543405,7 @@ sub_8126D10: ; 8126D10 ldr r2, =sub_8126DA4 adds r0, r5, 0 adds r1, r4, 0 - bl sub_81978EC + bl DisplayItemMessageOnField b @08126D5E .pool @08126D44: @@ -543607,7 +543747,7 @@ sub_8126F68: ; 8126F68 movs r0, 0x1 adds r1, r4, 0 ldr r2, [sp, 0x14] - bl sub_81DB368 + bl GetStringRightAlignXOffset lsls r0, 24 lsrs r7, r0, 24 str r5, [sp] @@ -543754,7 +543894,7 @@ sub_81270E8: ; 81270E8 ldr r2, =sub_8127180 adds r0, r5, 0 adds r1, r4, 0 - bl sub_81978EC + bl DisplayItemMessageOnField @0812716E: pop {r4,r5} pop {r0} @@ -544912,7 +545052,7 @@ sub_8127B04: ; 8127B04 adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 - bl cur_mapdata_full_redraw + bl DrawWholeMapView ldr r0, =0x03005d8c ldr r1, [r0] movs r0, 0x4 @@ -545057,7 +545197,7 @@ sub_8127B90: ; 8127B90 adds r0, r1 lsls r0, 16 lsrs r0, 16 - bl cur_mapdata_get_behaviour_by_blockid + bl GetBehaviorByMetatileId lsls r4, r0, 16 lsls r0, r4, 8 lsrs r0, 24 @@ -545093,7 +545233,7 @@ sub_8127B90: ; 8127B90 beq @08127C8E asrs r0, r7, 16 asrs r1, r2, 16 - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 bl sub_8089328 @@ -545137,7 +545277,7 @@ sub_8127B90: ; 8127B90 orrs r3, r5 lsls r2, r3, 16 lsrs r2, 16 - bl sub_8088338 + bl MapGridSetMetatileEntryAt b @08127D06 .pool @08127CE0: @@ -545158,7 +545298,7 @@ sub_8127B90: ; 8127B90 orrs r3, r2 lsls r2, r3, 16 lsrs r2, 16 - bl setmaptile_0 + bl MapGridSetMetatileIdAt @08127D06: mov r0, r10 adds r0, 0x1 @@ -545482,7 +545622,7 @@ sub_8127F68: ; 8127F68 ldr r2, =sub_8127A5C adds r0, r5, 0 adds r1, r4, 0 - bl sub_81978EC + bl DisplayItemMessageOnField b @0812804C .pool @08127FAC: @@ -545533,7 +545673,7 @@ sub_8127F68: ; 8127F68 ldr r1, =0x02021fc4 ldr r2, =sub_8127A5C adds r0, r5, 0 - bl sub_81978EC + bl DisplayItemMessageOnField b @0812804C .pool @08128038: @@ -545544,7 +545684,7 @@ sub_8127F68: ; 8127F68 ldr r2, =sub_8127A5C adds r0, r5, 0 adds r1, r4, 0 - bl sub_81978EC + bl DisplayItemMessageOnField @0812804C: pop {r4,r5} pop {r0} @@ -545603,12 +545743,12 @@ sub_8128060: ; 8128060 adds r0, r1 ldrb r1, [r0] adds r0, r5, 0 - bl sub_8128118 + bl ConfigureCameraObjectForPlacingDecoration adds r0, r6, 0 bl sub_812826C adds r0, r6, 0 adds r1, r5, 0 - bl sub_81281A8 + bl SetUpPlacingDecorationPlayerAvatar bl pal_fill_black ldrb r1, [r4, 0x8] movs r0, 0x7F @@ -545634,8 +545774,8 @@ sub_8128060: ; 8128060 bx r0 thumb_func_end sub_8128060 - thumb_func_start sub_8128118 -sub_8128118: ; 8128118 + thumb_func_start ConfigureCameraObjectForPlacingDecoration +ConfigureCameraObjectForPlacingDecoration: ; 8128118 push {r4-r6,lr} adds r6, r0, 0 lsls r1, 24 @@ -545698,10 +545838,10 @@ sub_8128118: ; 8128118 pop {r0} bx r0 .pool - thumb_func_end sub_8128118 + thumb_func_end ConfigureCameraObjectForPlacingDecoration - thumb_func_start sub_81281A8 -sub_81281A8: ; 81281A8 + thumb_func_start SetUpPlacingDecorationPlayerAvatar +SetUpPlacingDecorationPlayerAvatar: ; 81281A8 push {r4,lr} sub sp, 0x4 lsls r0, 24 @@ -545754,7 +545894,7 @@ sub_81281A8: ; 81281A8 movs r0, 0xC2 @08128214: movs r3, 0x48 - bl sub_808DD68 + bl AddPseudoFieldObject ldr r1, =0x0203aa39 strb r0, [r1] ldr r3, =0x02020630 @@ -545786,7 +545926,7 @@ sub_81281A8: ; 81281A8 pop {r0} bx r0 .pool - thumb_func_end sub_81281A8 + thumb_func_end SetUpPlacingDecorationPlayerAvatar thumb_func_start sub_812826C sub_812826C: ; 812826C @@ -546014,7 +546154,7 @@ sub_8128414: ; 8128414 ldr r2, =sub_8128B80 adds r0, r4, 0 adds r1, r5, 0 - bl sub_81978EC + bl DisplayItemMessageOnField pop {r4,r5} pop {r0} bx r0 @@ -546215,7 +546355,7 @@ sub_812853C: ; 812853C asrs r6, r0, 16 adds r0, r6, 0 mov r1, r9 - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r4, r0, 24 ldr r3, [sp, 0x4] @@ -546236,7 +546376,7 @@ sub_812853C: ; 812853C adds r0, r1 lsls r0, 16 lsrs r0, 16 - bl cur_mapdata_get_behaviour_by_blockid + bl GetBehaviorByMetatileId movs r3, 0xF0 lsls r3, 8 adds r1, r3, 0 @@ -546331,7 +546471,7 @@ sub_812853C: ; 812853C lsls r1, r2, 16 adds r0, r6, 0 asrs r1, 16 - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r4, r0, 24 ldr r3, [sp, 0x4] @@ -546352,7 +546492,7 @@ sub_812853C: ; 812853C adds r0, r1 lsls r0, 16 lsrs r0, 16 - bl cur_mapdata_get_behaviour_by_blockid + bl GetBehaviorByMetatileId movs r3, 0xF0 lsls r3, 8 adds r1, r3, 0 @@ -546443,7 +546583,7 @@ sub_812853C: ; 812853C lsls r1, r2, 16 adds r0, r6, 0 asrs r1, 16 - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r4, r0, 24 ldr r3, [sp] @@ -546457,7 +546597,7 @@ sub_812853C: ; 812853C adds r0, r1 lsls r0, 16 lsrs r0, 16 - bl cur_mapdata_get_behaviour_by_blockid + bl GetBehaviorByMetatileId movs r3, 0xF0 lsls r3, 8 adds r1, r3, 0 @@ -546543,7 +546683,7 @@ sub_812853C: ; 812853C asrs r4, r0, 16 adds r0, r4, 0 adds r1, r5, 0 - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 bl sub_8089328 @@ -546552,7 +546692,7 @@ sub_812853C: ; 812853C beq @0812890C adds r0, r4, 0 adds r1, r5, 0x1 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt movs r1, 0xA3 lsls r1, 2 cmp r0, r1 @@ -546602,7 +546742,7 @@ sub_812853C: ; 812853C mov r2, r9 lsls r1, r2, 16 asrs r1, 16 - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r4, r0, 24 ldr r3, [sp] @@ -546680,7 +546820,7 @@ sub_8128950: ; 8128950 ldr r2, =sub_81289D0 adds r0, r5, 0 adds r1, r4, 0 - bl sub_81978EC + bl DisplayItemMessageOnField b @081289BE .pool @081289A4: @@ -546693,7 +546833,7 @@ sub_8128950: ; 8128950 ldr r2, =sub_8129020 adds r0, r5, 0 adds r1, r4, 0 - bl sub_81978EC + bl DisplayItemMessageOnField @081289BE: pop {r4,r5} pop {r0} @@ -547955,7 +548095,7 @@ gpu_pal_decompress_alloc_tag_and_upload: ; 8129334 str r2, [sp] movs r2, 0 movs r3, 0 - bl sub_808DD68 + bl AddPseudoFieldObject @081293C6: lsls r0, 24 lsrs r0, 24 @@ -547966,8 +548106,9 @@ gpu_pal_decompress_alloc_tag_and_upload: ; 8129334 .pool thumb_func_end gpu_pal_decompress_alloc_tag_and_upload - thumb_func_start sub_81293D8 -sub_81293D8: ; 81293D8 + thumb_func_start AddDecorationIconObjectFromIconTable +; u8 AddDecorationIconObjectFromIconTable(u16 tilesTag, u16 paletteTag, u8 decorationId) +AddDecorationIconObjectFromIconTable: ; 81293D8 push {r4-r7,lr} sub sp, 0x10 lsls r0, 16 @@ -547976,20 +548117,20 @@ sub_81293D8: ; 81293D8 lsrs r6, r1, 16 lsls r2, 24 lsrs r5, r2, 24 - bl sub_81AFDE4 + bl AllocItemIconTemporaryBuffers lsls r0, 24 cmp r0, 0 beq @08129490 adds r0, r5, 0 movs r1, 0 - bl sub_812949C + bl GetDecorationIconPicOrPalette ldr r4, =0x0203cebc ldr r1, [r4] bl LZDecompressWram ldr r0, [r4] ldr r4, =0x0203cec0 ldr r1, [r4] - bl sub_81AFE44 + bl CopyItemIconPicTo4x4Buffer ldr r0, [r4] str r0, [sp] ldr r4, =0xffff0000 @@ -548007,7 +548148,7 @@ sub_81293D8: ; 81293D8 bl LoadObjectPic adds r0, r5, 0 movs r1, 0x1 - bl sub_812949C + bl GetDecorationIconPicOrPalette str r0, [sp, 0x8] add r0, sp, 0x8 ldr r1, [r0, 0x4] @@ -548034,7 +548175,7 @@ sub_81293D8: ; 81293D8 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - bl sub_81AFE24 + bl FreeItemIconTemporaryBuffers adds r0, r5, 0 bl Free adds r0, r4, 0 @@ -548047,10 +548188,11 @@ sub_81293D8: ; 81293D8 pop {r4-r7} pop {r1} bx r1 - thumb_func_end sub_81293D8 + thumb_func_end AddDecorationIconObjectFromIconTable - thumb_func_start sub_812949C -sub_812949C: ; 812949C + thumb_func_start GetDecorationIconPicOrPalette +; u32 GetDecorationIconPicOrPalette(u16 decorationId, u8 which) +GetDecorationIconPicOrPalette: ; 812949C push {lr} lsls r0, 16 lsrs r3, r0, 16 @@ -548069,10 +548211,11 @@ sub_812949C: ; 812949C pop {r1} bx r1 .pool - thumb_func_end sub_812949C + thumb_func_end GetDecorationIconPicOrPalette - thumb_func_start sub_81294C0 -sub_81294C0: ; 81294C0 + thumb_func_start AddDecorationIconObjectFromFieldObject +; u8 AddDecorationIconObjectFromFieldObject(u16 tilesTag, u16 paletteTag, u8 decorationId) +AddDecorationIconObjectFromFieldObject: ; 81294C0 push {r4-r7,lr} mov r7, r8 push {r7} @@ -548172,7 +548315,7 @@ sub_81294C0: ; 81294C0 str r2, [sp] movs r2, 0 movs r3, 0 - bl sub_808DD68 + bl AddPseudoFieldObject lsls r0, 24 lsrs r5, r0, 24 @081295BA: @@ -548184,10 +548327,11 @@ sub_81294C0: ; 81294C0 pop {r1} bx r1 .pool - thumb_func_end sub_81294C0 + thumb_func_end AddDecorationIconObjectFromFieldObject - thumb_func_start sub_81295CC -sub_81295CC: ; 81295CC + thumb_func_start AddDecorationIconObject +; u8 AddDecorationIconObject(u8 decorationId, u16 x, u16 y, u8 priority, u16 tilesTag, u16 paletteTag) +AddDecorationIconObject: ; 81295CC push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -548220,7 +548364,7 @@ sub_81295CC: ; 81295CC adds r0, r4, 0 adds r1, r5, 0 movs r2, 0 - bl sub_81293D8 + bl AddDecorationIconObjectFromIconTable lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x40 @@ -548248,7 +548392,7 @@ sub_81295CC: ; 81295CC adds r0, r4, 0 adds r1, r5, 0 adds r2, r6, 0 - bl sub_81294C0 + bl AddDecorationIconObjectFromFieldObject lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x40 @@ -548279,7 +548423,7 @@ sub_81295CC: ; 81295CC adds r0, r3, 0 adds r1, r2, 0 mov r2, r12 - bl sub_81293D8 + bl AddDecorationIconObjectFromIconTable lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x40 @@ -548331,7 +548475,7 @@ sub_81295CC: ; 81295CC pop {r1} bx r1 .pool - thumb_func_end sub_81295CC + thumb_func_end AddDecorationIconObject thumb_func_start sub_81296EC sub_81296EC: ; 81296EC @@ -548539,7 +548683,7 @@ sub_81297F8: ; 81297F8 ldr r5, [sp] ldr r3, [sp, 0x8] subs r1, r5, r3 - bl sub_8088338 + bl MapGridSetMetatileEntryAt adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 @@ -548620,7 +548764,7 @@ sub_81298EC: ; 81298EC ands r0, r1 cmp r0, 0 bne @08129994 - bl cur_mapdata_full_redraw + bl DrawWholeMapView ldr r0, =gUnknown_08275D2E bl script_env_1_execute_new_script movs r0, 0 @@ -548651,7 +548795,7 @@ sub_81298EC: ; 81298EC ldr r2, =sub_8129D64 adds r0, r5, 0 adds r1, r4, 0 - bl sub_81978EC + bl DisplayItemMessageOnField ldr r0, =0x02037318 ldrb r0, [r0, 0x14] cmp r0, 0x56 @@ -548694,8 +548838,8 @@ sub_81299AC: ; 81299AC bx r1 thumb_func_end sub_81299AC - thumb_func_start sub_81299DC -sub_81299DC: ; 81299DC + thumb_func_start SetUpPuttingAwayDecorationPlayerAvatar +SetUpPuttingAwayDecorationPlayerAvatar: ; 81299DC push {r4-r6,lr} mov r6, r8 push {r6} @@ -548738,7 +548882,7 @@ sub_81299DC: ; 81299DC @08129A44: movs r2, 0x88 movs r3, 0x48 - bl sub_808DD68 + bl AddPseudoFieldObject ldr r1, =0x0203aa39 strb r0, [r1] ldr r6, =0x02020630 @@ -548785,7 +548929,7 @@ sub_81299DC: ; 81299DC pop {r0} bx r0 .pool - thumb_func_end sub_81299DC + thumb_func_end SetUpPuttingAwayDecorationPlayerAvatar thumb_func_start sub_8129ABC sub_8129ABC: ; 8129ABC @@ -548827,7 +548971,7 @@ sub_8129ABC: ; 8129ABC b @08129B2E .pool @08129B0C: - bl sub_81299DC + bl SetUpPuttingAwayDecorationPlayerAvatar bl pal_fill_black movs r0, 0x2 strh r0, [r4, 0x4] @@ -548978,7 +549122,7 @@ sub_8129BF8: ; 8129BF8 ldr r2, =sub_812A1F0 adds r0, r4, 0 adds r1, r5, 0 - bl sub_81978EC + bl DisplayItemMessageOnField pop {r4,r5} pop {r0} bx r0 @@ -549013,7 +549157,7 @@ sub_8129C74: ; 8129C74 ldrsh r0, [r1, r2] movs r2, 0x2 ldrsh r1, [r1, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 @@ -549058,7 +549202,7 @@ sub_8129C74: ; 8129C74 @08129D14: adds r0, r5, 0 adds r1, r4, 0 - bl sub_81978EC + bl DisplayItemMessageOnField b @08129D50 .pool @08129D3C: @@ -549069,7 +549213,7 @@ sub_8129C74: ; 8129C74 ldr r2, =sub_8129D64 adds r0, r5, 0 adds r1, r4, 0 - bl sub_81978EC + bl DisplayItemMessageOnField @08129D50: pop {r4,r5} pop {r0} @@ -549270,7 +549414,7 @@ sub_8129E74: ; 8129E74 bne @08129ED4 adds r0, r5, 0x7 adds r1, r6, 0x7 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt movs r1, 0xA3 lsls r1, 2 cmp r0, r1 @@ -549928,7 +550072,7 @@ sub_812A3D4: ; 812A3D4 ldr r2, =sub_812A458 adds r0, r5, 0 adds r1, r4, 0 - bl sub_81978EC + bl DisplayItemMessageOnField b @0812A444 .pool @0812A430: @@ -549939,7 +550083,7 @@ sub_812A3D4: ; 812A3D4 ldr r2, =sub_8127A5C adds r0, r5, 0 adds r1, r4, 0 - bl sub_81978EC + bl DisplayItemMessageOnField @0812A444: pop {r4,r5} pop {r0} @@ -549992,7 +550136,7 @@ sub_812A478: ; 812A478 ldr r2, =sub_8127A5C adds r0, r4, 0 adds r1, r5, 0 - bl sub_81978EC + bl DisplayItemMessageOnField pop {r4,r5} pop {r0} bx r0 @@ -550474,7 +550618,7 @@ sub_812A8C4: ; 812A8C4 strb r1, [r0, 0xA] ldr r0, [r5] strb r1, [r0, 0xB] - bl sub_8145C30 + bl GetCoins ldr r2, [r5] strh r0, [r2, 0xC] strh r4, [r2, 0xE] @@ -550547,7 +550691,7 @@ sub_812A8C4: ; 812A8C4 lsrs r7, r0, 24 cmp r7, 0x2 bls @0812A934 - bl sub_8145C30 + bl GetCoins lsls r0, 16 lsrs r0, 16 bl sub_80EDE70 @@ -551734,8 +551878,8 @@ sub_812B2EC: ; 812B2EC ldr r4, =0x0203ab34 ldr r0, [r4] ldrh r0, [r0, 0xC] - bl sub_8145C58 - bl sub_8145C30 + bl SetCoins + bl GetCoins lsls r0, 16 lsrs r0, 16 bl sub_80EDD78 @@ -561634,7 +561778,7 @@ sub_813010C: ; 813010C movs r0, 0x1 adds r1, r4, 0 movs r2, 0xD0 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r3, r0, 0 ldr r0, =0x030011f7 ldrb r0, [r0] @@ -569831,7 +569975,7 @@ sub_81344C8: ; 81344C8 movs r0, 0x7 add r1, sp, 0xC movs r2, 0x68 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r2, r0, 0 ldrb r0, [r4] lsls r2, 24 @@ -569849,7 +569993,7 @@ sub_81344C8: ; 81344C8 movs r0, 0x1 mov r1, r9 movs r2, 0x68 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r2, r0, 0 ldrb r0, [r4] lsls r2, 24 @@ -571642,7 +571786,7 @@ npc_before_player_of_type: ; 8135424 ldr r4, =0x0203ab40 adds r1, r4, 0x2 adds r0, r4, 0 - bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + bl GetXYCoordsOneStepInFrontOfPlayer bl PlayerGetZCoord strb r0, [r4, 0x4] ldrh r0, [r4] @@ -571678,7 +571822,7 @@ oei_task_add: ; 8135478 push {lr} ldr r0, =0x0203ab40 adds r1, r0, 0x2 - bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + bl GetXYCoordsOneStepInFrontOfPlayer ldr r0, =task08_080C9820 movs r1, 0x8 bl AddTask @@ -572037,7 +572181,7 @@ sub_8135780: ; 8135780 cmp r0, 0 bne @081357AC movs r0, 0x1 - bl SetPlayerAvatarTransition + bl SetPlayerAvatarTransitionFlags @081357AC: movs r0, 0 pop {r1} @@ -572670,7 +572814,7 @@ sub_8135D7C: ; 8135D7C str r1, [sp, 0x10] movs r1, 0x1 movs r3, 0x1 - bl sub_8199EEC + bl AddTextPrinterParametrized2 add sp, 0x14 pop {r4} pop {r0} @@ -572687,7 +572831,7 @@ sub_8135DAC: ; 8135DAC movs r0, 0x1 adds r1, r4, 0 movs r2, 0x48 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r2, r0, 0 movs r0, 0 adds r1, r4, 0 @@ -574242,7 +574386,7 @@ sub_8136AB4: ; 8136AB4 movs r1, 0xA movs r2, 0xA movs r3, 0xD - bl sub_8121E7C + bl DisplayMessageAndContinueTask add sp, 0x10 pop {r4,r5} pop {r0} @@ -574298,7 +574442,7 @@ sub_8136B78: ; 8136B78 movs r1, 0xA movs r2, 0xA movs r3, 0xD - bl sub_8121E7C + bl DisplayMessageAndContinueTask add sp, 0x10 pop {r4,r5} pop {r0} @@ -577379,7 +577523,7 @@ sub_81384F0: ; 81384F0 ldrb r0, [r1] ldrb r1, [r1, 0x1] ldr r2, =0x00000206 - bl setmaptile_0 + bl MapGridSetMetatileIdAt b @0813852A .pool @0813851C: @@ -577388,7 +577532,7 @@ sub_81384F0: ; 81384F0 ldrb r0, [r1] ldrb r1, [r1, 0x1] ldr r2, =0x00000205 - bl setmaptile_0 + bl MapGridSetMetatileIdAt @0813852A: adds r0, r4, 0x1 lsls r0, 24 @@ -577411,7 +577555,7 @@ sub_8138540: ; 8138540 @08138548: adds r0, r4, 0 adds r1, r5, 0 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt ldr r1, =0xfffffde6 adds r0, r1 cmp r0, 0x37 @@ -577569,7 +577713,7 @@ sub_8138540: ; 8138540 @081386F2: subs r1, r5, 0x1 adds r0, r4, 0 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt movs r1, 0x90 lsls r1, 2 cmp r0, r1 @@ -577591,13 +577735,13 @@ sub_8138540: ; 8138540 @08138720: adds r0, r4, 0 adds r1, r5, 0 - bl setmaptile_0 + bl MapGridSetMetatileIdAt b @08138734 @0813872A: ldr r2, =0x00000251 adds r0, r4, 0 adds r1, r5, 0 - bl setmaptile_0 + bl MapGridSetMetatileIdAt @08138734: adds r4, 0x1 cmp r4, 0xF @@ -577624,7 +577768,7 @@ sub_8138750: ; 8138750 ldrb r0, [r4] ldrb r1, [r4, 0x1] ldr r2, =0x00000206 - bl setmaptile_0 + bl MapGridSetMetatileIdAt adds r4, 0x4 subs r5, 0x1 cmp r5, 0 @@ -577636,7 +577780,7 @@ sub_8138750: ; 8138750 @0813876E: adds r0, r4, 0 adds r1, r5, 0 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt ldr r1, =0xfffffde0 adds r0, r1 cmp r0, 0x30 @@ -577745,14 +577889,14 @@ sub_8138750: ; 8138750 @081388B2: adds r0, r4, 0 adds r1, r5, 0 - bl setmaptile_0 + bl MapGridSetMetatileIdAt b @081388CA .pool @081388C0: ldr r2, =0x00000251 adds r0, r4, 0 adds r1, r5, 0 - bl setmaptile_0 + bl MapGridSetMetatileIdAt @081388CA: adds r4, 0x1 cmp r4, 0xF @@ -577965,21 +578109,21 @@ sub_8138978: ; 8138978 adds r1, 0x7 mov r3, r9 lsrs r2, r3, 16 - bl setmaptile_0 + bl MapGridSetMetatileIdAt ldrh r0, [r5] adds r0, 0x7 ldrh r1, [r4] adds r1, 0x8 mov r3, r8 lsrs r2, r3, 16 - bl setmaptile_0 + bl MapGridSetMetatileIdAt adds r0, r6, 0x1 lsls r0, 24 lsrs r6, r0, 24 cmp r6, r7 bcc @08138A5E @08138A92: - bl cur_mapdata_full_redraw + bl DrawWholeMapView add sp, 0x10 pop {r3,r4} mov r8, r3 @@ -578347,7 +578491,7 @@ sub_8138D10: ; 8138D10 lsls r2, r5, 24 asrs r2, 24 bl sub_8138D88 - bl cur_mapdata_full_redraw + bl DrawWholeMapView ldrh r0, [r4, 0x10] movs r1, 0x1 eors r0, r1 @@ -578438,7 +578582,7 @@ sub_8138D88: ; 8138D88 adds r2, r4, 0 orrs r3, r2 adds r2, r3, 0 - bl setmaptile_0 + bl MapGridSetMetatileIdAt pop {r4,r5} pop {r0} bx r0 @@ -578522,8 +578666,8 @@ sub_8138E2C: ; 8138E2C adds r2, r3, 0 orrs r4, r2 adds r2, r4, 0 - bl setmaptile_0 - bl cur_mapdata_full_redraw + bl MapGridSetMetatileIdAt + bl DrawWholeMapView pop {r4-r6} pop {r0} bx r0 @@ -578602,25 +578746,25 @@ sub_8138F2C: ; 8138F2C ldr r2, =0x00000e9d movs r0, 0x12 movs r1, 0x8 - bl setmaptile_0 + bl MapGridSetMetatileIdAt ldr r2, =0x00000ea5 movs r0, 0x12 movs r1, 0x9 - bl setmaptile_0 + bl MapGridSetMetatileIdAt b @08138F7A .pool @08138F64: ldr r2, =0x00000e58 movs r0, 0x12 movs r1, 0x8 - bl setmaptile_0 + bl MapGridSetMetatileIdAt movs r2, 0xE6 lsls r2, 4 movs r0, 0x12 movs r1, 0x9 - bl setmaptile_0 + bl MapGridSetMetatileIdAt @08138F7A: - bl cur_mapdata_full_redraw + bl DrawWholeMapView ldrh r0, [r4, 0x10] movs r1, 0x1 eors r0, r1 @@ -578650,12 +578794,12 @@ sub_8138FAC: ; 8138FAC ldr r2, =0x00000e9d movs r0, 0x12 movs r1, 0x8 - bl setmaptile_0 + bl MapGridSetMetatileIdAt ldr r2, =0x00000ea5 movs r0, 0x12 movs r1, 0x9 - bl setmaptile_0 - bl cur_mapdata_full_redraw + bl MapGridSetMetatileIdAt + bl DrawWholeMapView pop {r0} bx r0 .pool @@ -579394,7 +579538,7 @@ sub_8139560: ; 8139560 ldrh r0, [r0] strh r0, [r1, 0x10] movs r0, 0 - bl sub_808A2C0 + bl SetCameraPanningCallback movs r0, 0xD6 bl audio_play pop {r0} @@ -579436,14 +579580,14 @@ sub_81395BC: ; 81395BC ldrsh r0, [r4, r1] movs r2, 0x8 ldrsh r1, [r4, r2] - bl sub_808A2CC + bl SetCameraPanning movs r1, 0x4 ldrsh r0, [r4, r1] cmp r0, 0 bne @08139614 adds r0, r5, 0 bl sub_8139620 - bl sub_808A2E4 + bl InstallCameraPanAheadCallback @08139614: pop {r4,r5} pop {r0} @@ -579864,8 +580008,8 @@ sub_813990C: ; 813990C bx r1 thumb_func_end sub_813990C - thumb_func_start sub_813994C -sub_813994C: ; 813994C + thumb_func_start in_multi_battle_room_with_var_condition +in_multi_battle_room_with_var_condition: ; 813994C push {lr} ldr r0, =0x03005d8c ldr r0, [r0] @@ -579887,16 +580031,16 @@ sub_813994C: ; 813994C @0813997A: pop {r1} bx r1 - thumb_func_end sub_813994C + thumb_func_end in_multi_battle_room_with_var_condition thumb_func_start sub_8139980 sub_8139980: ; 8139980 push {lr} movs r0, 0 - bl sub_808A2C0 + bl SetCameraPanningCallback movs r0, 0x8 movs r1, 0 - bl sub_808A2CC + bl SetCameraPanning pop {r0} bx r0 thumb_func_end sub_8139980 @@ -580062,7 +580206,7 @@ sub_8139A78: ; 8139A78 ldrb r0, [r0] strh r0, [r4, 0xA] movs r0, 0 - bl sub_808A2C0 + bl SetCameraPanningCallback ldrb r1, [r4, 0xC] adds r0, r5, 0 bl sub_8139C2C @@ -580105,7 +580249,7 @@ sub_8139AF4: ; 8139AF4 movs r2, 0x8 ldrsh r1, [r4, r2] movs r0, 0 - bl sub_808A2CC + bl SetCameraPanning movs r0, 0x4 ldrsh r1, [r4, r0] movs r2, 0xA @@ -580117,7 +580261,7 @@ sub_8139AF4: ; 8139AF4 adds r0, r5, 0 bl remove_task bl script_env_2_enable_and_set_ctx_running - bl sub_808A2E4 + bl InstallCameraPanAheadCallback @08139B54: pop {r4,r5} pop {r0} @@ -580143,7 +580287,7 @@ sub_8139B60: ; 8139B60 movs r0, 0x1 adds r1, r4, 0 movs r2, 0x40 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r3, r0, 0 ldrb r0, [r5] lsls r3, 24 @@ -580167,7 +580311,7 @@ sub_8139B60: ; 8139B60 ldr r1, [r0] movs r0, 0x1 movs r2, 0x40 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r3, r0, 0 ldrb r0, [r5] ldrh r1, [r4] @@ -580311,7 +580455,7 @@ sub_8139C80: ; 8139C80 orrs r2, r0 adds r0, r4, 0 adds r1, r7, 0 - bl setmaptile_0 + bl MapGridSetMetatileIdAt adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 @@ -580355,7 +580499,7 @@ sub_8139C80: ; 8139C80 orrs r2, r0 adds r0, r4, 0 adds r1, r7, 0 - bl setmaptile_0 + bl MapGridSetMetatileIdAt adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 @@ -580367,7 +580511,7 @@ sub_8139C80: ; 8139C80 cmp r1, 0x2 bls @08139D16 @08139D62: - bl cur_mapdata_full_redraw + bl DrawWholeMapView movs r0, 0 strh r0, [r6, 0x2] movs r0, 0 @@ -581764,7 +581908,7 @@ sub_813A8FC: ; 813A8FC movs r0, 0x1 add r1, sp, 0xC movs r2, 0x30 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r3, r0, 0 ldr r0, =0x0203ab6d ldrb r0, [r0] @@ -581964,7 +582108,7 @@ sub_813AA60: ; 813AA60 movs r0, 0 movs r1, 0x1 movs r3, 0 - bl text_box_related_one + bl AddTextPrinterParametrized ldr r1, =gUnknown_085B312C lsls r0, r5, 1 adds r1, r0, r1 @@ -581990,7 +582134,7 @@ sub_813AA60: ; 813AA60 movs r0, 0 movs r1, 0x1 movs r3, 0 - bl text_box_related_one + bl AddTextPrinterParametrized ldr r1, =gUnknown_085B3142 lsls r0, r5, 1 adds r1, r0, r1 @@ -582016,7 +582160,7 @@ sub_813AA60: ; 813AA60 movs r1, 0x21 movs r2, 0x58 movs r3, 0 - bl sub_81295CC + bl AddDecorationIconObject ldr r1, =0x0203ab6c strb r0, [r1] b @0813ABC2 @@ -582037,7 +582181,7 @@ sub_813AA60: ; 813AA60 movs r0, 0 movs r1, 0x1 movs r3, 0 - bl text_box_related_one + bl AddTextPrinterParametrized ldr r1, =gUnknown_085B314E lsls r0, r5, 1 adds r0, r1 @@ -582061,7 +582205,7 @@ sub_813AA60: ; 813AA60 movs r0, 0 movs r1, 0x1 movs r3, 0 - bl text_box_related_one + bl AddTextPrinterParametrized ldr r1, =gUnknown_085B315C lsls r0, r5, 1 adds r0, r1 @@ -583633,7 +583777,7 @@ _fwalk: ; 813B8B0 adds r2, r3 lsls r2, 16 lsrs r2, 16 - bl setmaptile_0 + bl MapGridSetMetatileIdAt adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 @@ -583644,7 +583788,7 @@ _fwalk: ; 813B8B0 lsrs r6, r0, 24 cmp r6, 0x3 bls @0813B8EA - bl cur_mapdata_full_redraw + bl DrawWholeMapView ldrh r0, [r5, 0x6] adds r0, 0x1 strh r0, [r5, 0x6] @@ -584820,7 +584964,7 @@ sub_813C2A0: ; 813C2A0 push {r4,lr} sub sp, 0x4 adds r4, r0, 0 - bl in_trade_center + bl InUnionRoom cmp r0, 0x1 beq @0813C2DA adds r0, r4, 0 @@ -584886,7 +585030,7 @@ sub_813C2F4: ; 813C2F4 movs r0, 0x1 adds r1, r4, 0 movs r2, 0xD0 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r3, r0, 0 ldr r0, =0x0203ab74 ldrb r0, [r0] @@ -585070,7 +585214,7 @@ sub_813C4BC: ; 813C4BC movs r0, 0x1 adds r1, r5, 0 movs r2, 0xD0 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r3, r0, 0 ldrb r0, [r6] lsls r3, 24 @@ -592256,7 +592400,7 @@ sub_81405CC: ; 81405CC @081406E0: bl CallObjectCallbacks bl PrepareSpritesForOamLoad - bl sub_8145C30 + bl GetCoins lsls r0, 16 lsrs r0, 16 bl sub_8143514 @@ -592337,9 +592481,9 @@ sub_81405CC: ; 81405CC adds r4, r1 movs r0, 0x6 strh r0, [r4, 0x14] - bl sub_8145C30 + bl GetCoins strh r0, [r4, 0x22] - bl sub_8145C30 + bl GetCoins lsls r0, 16 lsrs r0, 16 bl sub_80EDE84 @@ -594939,8 +595083,8 @@ sub_8141DE4: ; 8141DE4 lsls r0, 3 adds r0, r1 ldrh r0, [r0, 0x22] - bl sub_8145C58 - bl sub_8145C30 + bl SetCoins + bl GetCoins ldr r1, [r4] lsls r0, 16 lsrs r0, 16 @@ -594956,7 +595100,7 @@ sub_8141DE4: ; 8141DE4 movs r0, 0 @08141E3C: strh r0, [r1] - bl sub_8145C30 + bl GetCoins lsls r0, 16 lsrs r0, 16 bl sub_80EDD78 @@ -596285,7 +596429,7 @@ sub_8142918: ; 8142918 movs r0, 0 movs r1, 0x1 bl sub_819746C - bl sub_8145C14 + bl HideCoinsWindow bl FreeAllWindowBuffers movs r0, 0x1 negs r0, r0 @@ -596328,7 +596472,7 @@ sub_814297C: ; 814297C movs r0, 0 movs r1, 0 bl sub_819746C - bl sub_8145C14 + bl HideCoinsWindow bl script_env_2_disable adds r0, r4, 0 bl remove_task @@ -596359,7 +596503,7 @@ sub_81429A0: ; 81429A0 ldr r1, =0x020375e0 movs r0, 0x1 strh r0, [r1] - bl sub_8145C14 + bl HideCoinsWindow movs r0, 0 movs r1, 0x1 bl sub_819746C @@ -596449,7 +596593,7 @@ sub_8142A88: ; 8142A88 adds r6, r0, r1 movs r1, 0x22 ldrsh r0, [r6, r1] - bl sub_8145B54 + bl PrintCoinsString ldr r2, =gUnknown_085B6344 ldr r0, =0x020375e0 mov r8, r0 @@ -596569,19 +596713,19 @@ sub_8142A88: ; 8142A88 sub_8142BC8: ; 8142BC8 push {r4,lr} bl script_env_2_enable - bl sub_8145C30 + bl GetCoins lsls r0, 16 lsrs r0, 16 movs r1, 0x1 movs r2, 0x1 - bl sub_8145BAC + bl ShowCoinsWindow ldr r0, =sub_8142A88 movs r1, 0 bl AddTask adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - bl sub_8145C30 + bl GetCoins ldr r2, =0x03005e00 lsls r1, r4, 2 adds r1, r4 @@ -602303,8 +602447,9 @@ sub_8145B24: ; 8145B24 .pool thumb_func_end sub_8145B24 - thumb_func_start sub_8145B54 -sub_8145B54: ; 8145B54 + thumb_func_start PrintCoinsString +; void PrintCoinsString(s32 coinAmount) +PrintCoinsString: ; 8145B54 push {r4,lr} sub sp, 0xC adds r1, r0, 0 @@ -602319,7 +602464,7 @@ sub_8145B54: ; 8145B54 movs r0, 0x1 adds r1, r4, 0 movs r2, 0x40 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r3, r0, 0 ldr r0, =0x0203ab9c ldrb r0, [r0] @@ -602338,10 +602483,11 @@ sub_8145B54: ; 8145B54 pop {r0} bx r0 .pool - thumb_func_end sub_8145B54 + thumb_func_end PrintCoinsString - thumb_func_start sub_8145BAC -sub_8145BAC: ; 8145BAC + thumb_func_start ShowCoinsWindow +; void ShowCoinsWindow(s32 coinAmount, u8 x, u8 y) +ShowCoinsWindow: ; 8145BAC push {r4,r5,lr} sub sp, 0x18 adds r5, r0, 0 @@ -602379,16 +602525,17 @@ sub_8145BAC: ; 8145BAC movs r3, 0xE bl SetWindowBorderStyle adds r0, r5, 0 - bl sub_8145B54 + bl PrintCoinsString add sp, 0x18 pop {r4,r5} pop {r0} bx r0 .pool - thumb_func_end sub_8145BAC + thumb_func_end ShowCoinsWindow - thumb_func_start sub_8145C14 -sub_8145C14: ; 8145C14 + thumb_func_start HideCoinsWindow +; void HideCoinsWindow() +HideCoinsWindow: ; 8145C14 push {r4,lr} ldr r4, =0x0203ab9c ldrb r0, [r4] @@ -602400,10 +602547,11 @@ sub_8145C14: ; 8145C14 pop {r0} bx r0 .pool - thumb_func_end sub_8145C14 + thumb_func_end HideCoinsWindow - thumb_func_start sub_8145C30 -sub_8145C30: ; 8145C30 + thumb_func_start GetCoins +; u16 GetCoins() +GetCoins: ; 8145C30 ldr r0, =0x03005d8c ldr r1, [r0] ldr r0, =0x00000494 @@ -602418,10 +602566,11 @@ sub_8145C30: ; 8145C30 lsrs r0, 16 bx lr .pool - thumb_func_end sub_8145C30 + thumb_func_end GetCoins - thumb_func_start sub_8145C58 -sub_8145C58: ; 8145C58 + thumb_func_start SetCoins +; void SetCoins(u16 amount) +SetCoins: ; 8145C58 lsls r0, 16 lsrs r0, 16 ldr r1, =0x03005d8c @@ -602436,14 +602585,15 @@ sub_8145C58: ; 8145C58 strh r0, [r2] bx lr .pool - thumb_func_end sub_8145C58 + thumb_func_end SetCoins - thumb_func_start sub_8145C80 -sub_8145C80: ; 8145C80 + thumb_func_start AddCoins +; BOOL AddCoins(u16 amount) +AddCoins: ; 8145C80 push {r4,lr} lsls r0, 16 lsrs r4, r0, 16 - bl sub_8145C30 + bl GetCoins lsls r0, 16 lsrs r1, r0, 16 ldr r0, =0x0000270e @@ -602469,21 +602619,22 @@ sub_8145C80: ; 8145C80 @08145CB8: adds r0, r1, 0 @08145CBA: - bl sub_8145C58 + bl SetCoins movs r0, 0x1 @08145CC0: pop {r4} pop {r1} bx r1 .pool - thumb_func_end sub_8145C80 + thumb_func_end AddCoins - thumb_func_start sub_8145CCC -sub_8145CCC: ; 8145CCC + thumb_func_start SubtractCoins +; BOOL SubtractCoins(u16 amount) +SubtractCoins: ; 8145CCC push {r4,lr} lsls r0, 16 lsrs r4, r0, 16 - bl sub_8145C30 + bl GetCoins lsls r0, 16 lsrs r0, 16 cmp r0, r4 @@ -602494,13 +602645,13 @@ sub_8145CCC: ; 8145CCC subs r0, r4 lsls r0, 16 lsrs r0, 16 - bl sub_8145C58 + bl SetCoins movs r0, 0x1 @08145CEE: pop {r4} pop {r1} bx r1 - thumb_func_end sub_8145CCC + thumb_func_end SubtractCoins thumb_func_start sub_8145CF4 sub_8145CF4: ; 8145CF4 @@ -602690,7 +602841,7 @@ sub_8145E2C: ; 8145E2C ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02021cc4 - bl sub_81B1B44 + bl GetMonNickname movs r0, 0 pop {r1} bx r1 @@ -604959,7 +605110,7 @@ sub_81470D0: ; 81470D0 bl obj_alloc_rotscale_entry ldrb r1, [r5, 0x8] adds r0, r4, 0 - bl sub_8008258 + bl StartObjectRotScalAnim movs r0, 0 pop {r4,r5} pop {r1} @@ -620687,7 +620838,7 @@ sub_814F648: ; 814F648 lsls r0, 8 orrs r1, r0 adds r0, r6, 0 - bl get_pokemon_name + bl GetSpeciesName b @0814F8DE @0814F7E2: adds r4, r5, r7 @@ -621034,7 +621185,7 @@ battle_show_message_maybe: ; 814F9EC ldr r1, [sp] mov r3, sp ldrb r3, [r3, 0xA] - bl sub_81DB374 + bl GetStringCenterAlignXOffsetWithLetterSpacing mov r2, sp mov r1, sp strb r0, [r1, 0x8] @@ -623196,7 +623347,7 @@ sub_8150D28: ; 8150D28 str r2, [sp] movs r2, 0xC8 movs r3, 0x49 - bl sub_808DD68 + bl AddPseudoFieldObject lsls r0, 24 lsrs r6, r0, 24 cmp r6, 0x40 @@ -623302,7 +623453,7 @@ sub_8150D28: ; 8150D28 str r2, [sp] movs r2, 0x80 movs r3, 0x27 - bl sub_808DD68 + bl AddPseudoFieldObject lsls r0, 24 lsrs r6, r0, 24 cmp r6, 0x40 @@ -623435,7 +623586,7 @@ sub_8150D28: ; 8150D28 ldrsh r3, [r3, r4] movs r4, 0x6A str r4, [sp] - bl sub_808DD68 + bl AddPseudoFieldObject lsls r0, 24 lsrs r6, r0, 24 cmp r6, 0x40 @@ -630257,7 +630408,7 @@ unc_grass_normal: ; 8154550 ldrsh r0, [r5, r2] movs r2, 0x32 ldrsh r1, [r5, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r6, r0, 24 mov r0, r8 @@ -630596,7 +630747,7 @@ unc_grass_tall: ; 8154800 ldrsh r0, [r5, r2] movs r2, 0x32 ldrsh r1, [r5, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r4, r0, 24 mov r0, r8 @@ -632146,12 +632297,12 @@ sub_81554AC: ; 81554AC movs r2, 0x32 ldrsh r1, [r4, r2] ldrh r2, [r4, 0x34] - bl setmaptile_0 + bl MapGridSetMetatileIdAt movs r1, 0x30 ldrsh r0, [r4, r1] movs r2, 0x32 ldrsh r1, [r4, r2] - bl cur_mapdata_draw_block_at + bl CurrentMapDrawMetatileAt ldr r2, =0x02037350 ldr r0, =0x02037590 ldrb r1, [r0, 0x5] @@ -642208,7 +642359,7 @@ sub_815A31C: ; 815A31C bl SetGpuReg adds r0, r4, 0 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim movs r0, 0 strh r0, [r4, 0x32] adds r2, r4, 0 @@ -645023,7 +645174,7 @@ sub_815B7D0: ; 815B7D0 lsls r0, 2 adds r0, r3 movs r1, 0 - bl sub_8008258 + bl StartObjectRotScalAnim @0815BA1C: ldr r0, =0x03005e00 mov r1, r9 @@ -648598,7 +648749,7 @@ sub_815D7B4: ; 815D7B4 ldr r0, =0x0203841e ldrb r1, [r0] adds r0, r4, 0 - bl sub_8008258 + bl StartObjectRotScalAnim movs r0, 0x20 ldrsh r1, [r4, r0] movs r0, 0x22 @@ -648689,7 +648840,7 @@ sub_815D870: ; 815D870 strh r0, [r5, 0x2E] ldrb r1, [r6] adds r0, r5, 0 - bl sub_8008258 + bl StartObjectRotScalAnim ldr r0, =0x02038437 ldrb r0, [r0] bl battle_side_get_owner @@ -650326,7 +650477,7 @@ sub_815E47C: ; 815E47C lsls r0, 2 adds r0, r4 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim @0815E596: ldr r0, =sub_815E5CC str r0, [r7] @@ -652018,7 +652169,7 @@ sub_815F20C: ; 815F20C lsls r0, 2 adds r0, r3 movs r1, 0 - bl sub_8008258 + bl StartObjectRotScalAnim @0815F2EE: mov r4, r9 adds r3, r7, 0 @@ -653999,7 +654150,7 @@ sub_8160338: ; 8160338 strh r0, [r4, 0x30] adds r0, r4, 0 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim b @08160396 .pool @0816037C: @@ -655345,7 +655496,7 @@ sub_8160F50: ; 8160F50 ands r0, r1 cmp r0, 0 bne @08160F9C - bl sub_81220D0 + bl GetLRKeysState lsls r0, 24 cmp r0, 0 beq @0816103E @@ -656046,7 +656197,7 @@ sub_8161560: ; 8161560 movs r1, 0x1 bl sub_81B0FCC movs r0, 0x5 - bl sub_81B3054 + bl display_pokemon_menu_message ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 @@ -656080,7 +656231,7 @@ sub_81615A8: ; 81615A8 bls @081615EC movs r0, 0 strb r0, [r1, 0xB] - bl sub_81B3054 + bl display_pokemon_menu_message ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 @@ -656200,7 +656351,7 @@ sub_81616C0: ; 81616C0 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02021cc4 - bl sub_81B1B44 + bl GetMonNickname ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E9C17 adds r0, r4, 0 @@ -656250,7 +656401,7 @@ sub_8161724: ; 8161724 movs r0, 0x6 bl ClearWindowTilemap movs r0, 0 - bl sub_81B3054 + bl display_pokemon_menu_message ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 @@ -656276,7 +656427,7 @@ sub_8161784: ; 8161784 cmp r0, 0x1 beq @081617AA movs r0, 0x5 - bl sub_81B3054 + bl display_pokemon_menu_message ldr r0, =0x03005e00 lsls r1, r4, 2 adds r1, r4 @@ -660801,11 +660952,11 @@ sub_8163AC4: ; 8163AC4 movs r0, 0 strb r0, [r4] ldr r0, =gUnknown_08224158 - bl battle_configure_by_script + bl TrainerBattleConfigure movs r0, 0x1 strb r0, [r4] ldr r0, =gUnknown_08224167 - bl battle_configure_by_script + bl TrainerBattleConfigure ldr r0, =0x02038bce strh r5, [r0] ldr r0, =sub_8163A8C @@ -663289,8 +663440,8 @@ sub_816537C: ; 816537C .pool thumb_func_end sub_816537C - thumb_func_start start_menu_compose_normal -start_menu_compose_normal: ; 81653CC + thumb_func_start sub_81653CC +sub_81653CC: ; 81653CC push {lr} ldr r0, =0x03005d90 ldr r0, [r0] @@ -663299,7 +663450,7 @@ start_menu_compose_normal: ; 81653CC ldrb r0, [r0] cmp r0, 0x1 bne @081653E0 - bl start_menu_append_item + bl sub_80F01B8 @081653E0: movs r0, 0x77 bl FlagGet @@ -663307,14 +663458,14 @@ start_menu_compose_normal: ; 81653CC lsrs r0, 24 cmp r0, 0x1 bne @081653F8 - bl start_menu_append_item + bl sub_80F01B8 movs r0, 0x77 bl FlagReset @081653F8: pop {r0} bx r0 .pool - thumb_func_end start_menu_compose_normal + thumb_func_end sub_81653CC thumb_func_start sub_8165404 sub_8165404: ; 8165404 @@ -673661,7 +673812,7 @@ sub_816AE58: ; 816AE58 lsrs r0, 24 ldr r1, =gUnknown_085E8D80 ldr r2, =sub_816AED8 - bl sub_81978EC + bl DisplayItemMessageOnField pop {r0} bx r0 .pool @@ -673683,7 +673834,7 @@ sub_816AE98: ; 816AE98 lsrs r0, 24 ldr r1, =gUnknown_085E8D80 ldr r2, =sub_816AED8 - bl sub_81978EC + bl DisplayItemMessageOnField pop {r0} bx r0 .pool @@ -673858,7 +674009,7 @@ sub_816B060: ; 816B060 lsrs r0, 24 ldr r1, =gUnknown_085E8D80 ldr r2, =sub_816AED8 - bl sub_81978EC + bl DisplayItemMessageOnField pop {r0} bx r0 .pool @@ -673902,7 +674053,7 @@ sub_816B0A8: ; 816B0A8 ldr r1, =gUnknown_085EAC4B ldr r2, =sub_816B060 adds r0, r4, 0 - bl sub_81978EC + bl DisplayItemMessageOnField b @0816B12A .pool @0816B0D8: @@ -673937,7 +674088,7 @@ sub_816B0A8: ; 816B0A8 ldr r1, =gUnknown_085EAC4B ldr r2, =sub_816B060 adds r0, r6, 0 - bl sub_81978EC + bl DisplayItemMessageOnField @0816B12A: pop {r4-r6} pop {r0} @@ -674254,7 +674405,7 @@ sub_816B398: ; 816B398 ldr r1, =gUnknown_085EABD1 ldr r2, =task_pc_itemstorage adds r0, r5, 0 - bl sub_81978EC + bl DisplayItemMessageOnField @0816B3D4: pop {r4,r5} pop {r0} @@ -674289,7 +674440,7 @@ sub_816B3E4: ; 816B3E4 ldr r1, =gUnknown_085EABD1 ldr r2, =task_pc_itemstorage adds r0, r5, 0 - bl sub_81978EC + bl DisplayItemMessageOnField @0816B420: pop {r4,r5} pop {r0} @@ -674544,7 +674695,7 @@ sub_816B5F8: ; 816B5F8 movs r0, 0x1 adds r1, r6, 0 movs r2, 0x40 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 @@ -674694,7 +674845,7 @@ sub_816B730: ; 816B730 ldr r2, =sub_816B7DC adds r0, r4, 0 adds r1, r5, 0 - bl sub_81978EC + bl DisplayItemMessageOnField pop {r4,r5} pop {r0} bx r0 @@ -674937,7 +675088,7 @@ sub_816B994: ; 816B994 lsrs r0, 24 ldr r1, =gUnknown_085EAC8D ldr r2, =sub_816B9B0 - bl sub_81978EC + bl DisplayItemMessageOnField pop {r0} bx r0 .pool @@ -675025,14 +675176,14 @@ sub_816BA18: ; 816BA18 ldr r1, =gUnknown_085EACB5 ldr r2, =sub_816BBD4 adds r0, r6, 0 - bl sub_81978EC + bl DisplayItemMessageOnField b @0816BA9C .pool @0816BA68: ldr r1, =gUnknown_085EACC8 ldr r2, =sub_816BBD4 adds r0, r6, 0 - bl sub_81978EC + bl DisplayItemMessageOnField adds r0, r5, 0 bl sub_80D439C bl sub_816B54C @@ -675193,7 +675344,7 @@ sub_816BBB8: ; 816BBB8 lsrs r0, 24 ldr r1, =gUnknown_085E8DE9 ldr r2, =sub_816BBD4 - bl sub_81978EC + bl DisplayItemMessageOnField pop {r0} bx r0 .pool @@ -675546,7 +675697,7 @@ fish4_goto_x5_or_x6: ; 816BE44 movs r0, 0x7 adds r1, r4, 0 movs r2, 0x68 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 @@ -675740,7 +675891,7 @@ sub_816BFE0: ; 816BFE0 movs r1, 0x1 movs r2, 0 adds r3, r6, 0 - bl sub_8199EEC + bl AddTextPrinterParametrized2 @0816C050: add sp, 0x14 pop {r4-r6} @@ -675891,7 +676042,7 @@ sub_816C158: ; 816C158 movs r0, 0x1 adds r1, r5, 0 movs r2, 0x68 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r3, r0, 0 ldr r4, =0x0203bcc4 ldr r0, [r4] @@ -676488,7 +676639,7 @@ sub_816C6BC: ; 816C6BC movs r0, 0x1 adds r1, r4, 0 movs r2, 0x30 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 @@ -682604,7 +682755,7 @@ sub_816FB38: ; 816FB38 strb r1, [r2] adds r0, r6, 0 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim b @0816FCE6 @0816FB94: ldr r0, =0x030062a0 @@ -682753,7 +682904,7 @@ sub_816FB38: ; 816FB38 bne @0816FD38 adds r0, r6, 0 movs r1, 0x2 - bl sub_8008258 + bl StartObjectRotScalAnim ldrb r1, [r6, 0x1] movs r0, 0xD negs r0, r0 @@ -682849,7 +683000,7 @@ sub_816FD44: ; 816FD44 bne @0816FDB0 adds r0, r4, 0 movs r1, 0x3 - bl sub_8008258 + bl StartObjectRotScalAnim @0816FD90: ldrh r0, [r4, 0x2E] adds r0, 0x1 @@ -682953,7 +683104,7 @@ sub_816FDB8: ; 816FDB8 bl StartObjectImageAnim adds r0, r4, 0 movs r1, 0 - bl sub_8008258 + bl StartObjectRotScalAnim adds r0, r7, 0x1 lsls r0, 16 lsrs r7, r0, 16 @@ -682993,7 +683144,7 @@ sub_816FDB8: ; 816FDB8 orrs r1, r2 strb r1, [r0, 0x3] movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim adds r0, r6, 0 add sp, 0xC pop {r3-r5} @@ -683497,7 +683648,7 @@ sub_8170290: ; 8170290 movs r0, 0x1 adds r1, r5, 0 movs r2, 0x38 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 @@ -685592,7 +685743,7 @@ sub_81714D4: ; 81714D4 strb r0, [r2] adds r0, r4, 0 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0, 0x8] @@ -685917,20 +686068,20 @@ sub_8171520: ; 8171520 strh r0, [r4, 0x34] adds r0, r4, 0 movs r1, 0x3 - bl sub_8008258 + bl StartObjectRotScalAnim movs r6, 0x36 ldrsh r0, [r4, r6] cmp r0, 0 bge @081717A0 adds r0, r4, 0 movs r1, 0x2 - bl sub_8008258 + bl StartObjectRotScalAnim b @081717A8 .pool @081717A0: adds r0, r4, 0 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim @081717A8: movs r0, 0x17 bl audio_play @@ -686345,7 +686496,7 @@ sub_8171AE4: ; 8171AE4 bl StartObjectImageAnim adds r0, r4, 0 movs r1, 0 - bl sub_8008258 + bl StartObjectRotScalAnim ldr r0, =sub_8171BAC str r0, [r4, 0x1C] ldr r0, =0x02024208 @@ -686399,7 +686550,7 @@ sub_8171AE4: ; 8171AE4 lsls r0, 2 adds r0, r6 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim ldrb r0, [r4] adds r0, r5 ldrb r1, [r0] @@ -686461,7 +686612,7 @@ sub_8171BAC: ; 8171BAC bge @08171C04 adds r0, r1, 0 movs r1, 0 - bl sub_8008258 + bl StartObjectRotScalAnim movs r5, 0x1 b @08171C24 .pool @@ -689970,7 +690121,7 @@ sub_81738BC: ; 81738BC movs r0, 0 movs r1, 0x1 movs r3, 0 - bl text_box_related_one + bl AddTextPrinterParametrized movs r0, 0 movs r1, 0x3 bl CopyWindowToVram @@ -690723,7 +690874,7 @@ sub_8173F84: ; 8173F84 movs r0, 0 movs r1, 0x1 movs r3, 0 - bl text_box_related_one + bl AddTextPrinterParametrized movs r0, 0 movs r1, 0x3 bl CopyWindowToVram @@ -691817,7 +691968,7 @@ sub_81749A0: ; 81749A0 movs r0, 0 movs r1, 0x1 movs r3, 0 - bl text_box_related_one + bl AddTextPrinterParametrized movs r0, 0 movs r1, 0x3 bl CopyWindowToVram @@ -691872,7 +692023,7 @@ sub_8174A38: ; 8174A38 movs r0, 0x1 adds r1, r4, 0 movs r2, 0xD0 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 @@ -691988,7 +692139,7 @@ sub_8174A88: ; 8174A88 movs r0, 0x1 add r1, sp, 0xC movs r2, 0xD0 - bl sub_81DB35C + bl GetStringCenterAlignXOffset lsls r2, r0, 24 lsrs r2, 24 ldr r0, =gUnknown_085E5388 @@ -692011,7 +692162,7 @@ sub_8174A88: ; 8174A88 movs r0, 0x1 add r1, sp, 0xC movs r2, 0x80 - bl sub_81DB368 + bl GetStringRightAlignXOffset lsls r2, r0, 24 lsrs r2, 24 ldr r0, =gUnknown_085E5388 @@ -692164,7 +692315,7 @@ sub_8174C98: ; 8174C98 ldr r1, [r0] movs r0, 0x1 movs r2, 0x70 - bl sub_81DB368 + bl GetStringRightAlignXOffset lsls r2, r0, 24 lsrs r2, 24 mov r1, r8 @@ -692247,7 +692398,7 @@ sub_8174C98: ; 8174C98 strb r0, [r1, 0x5] movs r0, 0x1 movs r2, 0x70 - bl sub_81DB368 + bl GetStringRightAlignXOffset lsls r2, r0, 24 lsrs r2, 24 mov r1, r8 @@ -692338,7 +692489,7 @@ sub_8174C98: ; 8174C98 strb r0, [r1, 0x6] movs r0, 0x1 movs r2, 0x70 - bl sub_81DB368 + bl GetStringRightAlignXOffset lsls r2, r0, 24 lsrs r2, 24 ldr r0, =gUnknown_085E538C @@ -693204,7 +693355,7 @@ sub_81755BC: ; 81755BC adds r1, r4, 0 movs r2, 0xF0 movs r3, 0x1 - bl sub_81DB374 + bl GetStringCenterAlignXOffsetWithLetterSpacing adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 @@ -693221,7 +693372,7 @@ sub_81755BC: ; 81755BC movs r0, 0 movs r1, 0x1 adds r3, r5, 0 - bl sub_8199EEC + bl AddTextPrinterParametrized2 add sp, 0x18 pop {r4,r5} pop {r0} @@ -697716,7 +697867,7 @@ sub_8177BCC: ; 8177BCC movs r1, 0x1 adds r2, r4, 0 adds r3, r5, 0 - bl sub_8199EEC + bl AddTextPrinterParametrized2 add sp, 0x18 pop {r4-r6} pop {r0} @@ -697733,7 +697884,7 @@ sub_8177C14: ; 8177C14 str r0, [r4] ldr r0, =0x0203ce7c ldrh r0, [r0] - bl berryid_from_itemid + bl ItemIdToBerryType ldr r1, [r4] lsls r0, 24 lsrs r0, 24 @@ -698205,7 +698356,7 @@ sub_817804C: ; 817804C str r6, [sp, 0xC] str r1, [sp, 0x10] movs r1, 0x1 - bl sub_8199EEC + bl AddTextPrinterParametrized2 add sp, 0x14 pop {r4-r6} pop {r0} @@ -698234,7 +698385,7 @@ sub_8178090: ; 8178090 movs r0, 0x1 adds r1, r4, 0 movs r2, 0x40 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 @@ -698279,7 +698430,7 @@ sub_8178110: ; 8178110 lsls r4, 5 adds r0, r4 ldrb r0, [r0] - bl GetRomBerryInfo + bl GetBerryInfo adds r6, r0, 0 ldr r0, =0x02021cc4 ldr r1, [r5] @@ -698319,7 +698470,7 @@ sub_8178174: ; 8178174 lsls r1, 5 adds r0, r1 ldrb r0, [r0] - bl GetRomBerryInfo + bl GetBerryInfo adds r4, r0, 0 ldr r2, =gUnknown_085E9225 movs r7, 0x1 @@ -698411,7 +698562,7 @@ itemid_copy_name: ; 8178250 lsls r1, 5 adds r0, r1 ldrb r0, [r0] - bl GetRomBerryInfo + bl GetBerryInfo adds r6, r0, 0 ldr r2, =gUnknown_085E922C movs r5, 0x11 @@ -698469,7 +698620,7 @@ sub_81782D0: ; 81782D0 lsls r1, 5 adds r0, r1 ldrb r0, [r0] - bl GetRomBerryInfo + bl GetBerryInfo ldr r2, [r0, 0xC] movs r0, 0x1 str r0, [sp] @@ -698496,7 +698647,7 @@ sub_8178304: ; 8178304 lsls r1, 5 adds r0, r1 ldrb r0, [r0] - bl GetRomBerryInfo + bl GetBerryInfo ldr r2, [r0, 0x10] movs r0, 0x11 str r0, [sp] @@ -698607,7 +698758,7 @@ sub_8178404: ; 8178404 lsls r1, 5 adds r0, r1 ldrb r0, [r0] - bl GetRomBerryInfo + bl GetBerryInfo adds r5, r0, 0 ldrb r0, [r5, 0x15] cmp r0, 0 @@ -699030,7 +699181,7 @@ sub_8178728: ; 8178728 bl bag_pocket_get_itemid lsls r0, 16 lsrs r0, 16 - bl berryid_from_itemid + bl ItemIdToBerryType ldr r1, =0x0203bcf4 ldr r1, [r1] lsls r0, 24 @@ -699904,7 +700055,7 @@ sub_8178EC4: ; 8178EC4 movs r1, 0x1 adds r2, r6, 0 ldr r3, [sp, 0x18] - bl sub_8199EEC + bl AddTextPrinterParametrized2 add sp, 0x1C pop {r3-r5} mov r8, r3 @@ -699946,7 +700097,7 @@ sub_8178F44: ; 8178F44 str r5, [sp, 0x10] movs r1, 0x1 adds r2, r4, 0 - bl sub_8199EEC + bl AddTextPrinterParametrized2 add sp, 0x18 pop {r4,r5} pop {r0} @@ -700655,29 +700806,29 @@ sub_817963C: ; 817963C ldr r2, =0x0000022a movs r0, 0x10 movs r1, 0x8 - bl setmaptile_0 + bl MapGridSetMetatileIdAt ldr r2, =0x0000022b movs r0, 0x11 movs r1, 0x8 - bl setmaptile_0 + bl MapGridSetMetatileIdAt movs r2, 0x8B lsls r2, 2 movs r0, 0x12 movs r1, 0x8 - bl setmaptile_0 + bl MapGridSetMetatileIdAt ldr r2, =0x00000e32 movs r0, 0x10 movs r1, 0x9 - bl setmaptile_0 + bl MapGridSetMetatileIdAt ldr r2, =0x00000233 movs r0, 0x11 movs r1, 0x9 - bl setmaptile_0 + bl MapGridSetMetatileIdAt ldr r2, =0x00000e34 movs r0, 0x12 movs r1, 0x9 - bl setmaptile_0 - bl cur_mapdata_full_redraw + bl MapGridSetMetatileIdAt + bl DrawWholeMapView movs r0, 0x14 bl audio_play ldr r0, =0x000008af @@ -700753,7 +700904,7 @@ sub_8179700: ; 8179700 movs r0, 0x32 strh r0, [r1, 0x14] movs r0, 0 - bl sub_808A2C0 + bl SetCameraPanningCallback pop {r0} bx r0 .pool @@ -700782,7 +700933,7 @@ sub_817973C: ; 817973C movs r0, 0x2 strh r0, [r1, 0x14] movs r0, 0 - bl sub_808A2C0 + bl SetCameraPanningCallback pop {r0} bx r0 .pool @@ -700818,7 +700969,7 @@ sub_8179778: ; 8179778 movs r0, 0x10 ldrsh r1, [r4, r0] movs r0, 0 - bl sub_808A2CC + bl SetCameraPanning movs r2, 0xC ldrsh r1, [r4, r2] movs r2, 0x14 @@ -700828,7 +700979,7 @@ sub_8179778: ; 8179778 adds r0, r5, 0 bl remove_task bl script_env_2_enable_and_set_ctx_running - bl sub_808A2E4 + bl InstallCameraPanAheadCallback @081797D0: pop {r4,r5} pop {r0} @@ -700907,29 +701058,29 @@ sub_8179860: ; 8179860 ldr r2, =0x0000022a movs r0, 0xE movs r1, 0x1A - bl setmaptile_0 + bl MapGridSetMetatileIdAt ldr r2, =0x0000022b movs r0, 0xF movs r1, 0x1A - bl setmaptile_0 + bl MapGridSetMetatileIdAt movs r2, 0x8B lsls r2, 2 movs r0, 0x10 movs r1, 0x1A - bl setmaptile_0 + bl MapGridSetMetatileIdAt ldr r2, =0x00000e32 movs r0, 0xE movs r1, 0x1B - bl setmaptile_0 + bl MapGridSetMetatileIdAt ldr r2, =0x00000233 movs r0, 0xF movs r1, 0x1B - bl setmaptile_0 + bl MapGridSetMetatileIdAt ldr r2, =0x00000e34 movs r0, 0x10 movs r1, 0x1B - bl setmaptile_0 - bl cur_mapdata_full_redraw + bl MapGridSetMetatileIdAt + bl DrawWholeMapView movs r0, 0x14 bl audio_play movs r0, 0x8B @@ -701003,29 +701154,29 @@ sub_8179944: ; 8179944 ldr r2, =0x0000022a movs r0, 0xE movs r1, 0x1A - bl setmaptile_0 + bl MapGridSetMetatileIdAt ldr r2, =0x0000022b movs r0, 0xF movs r1, 0x1A - bl setmaptile_0 + bl MapGridSetMetatileIdAt movs r2, 0x8B lsls r2, 2 movs r0, 0x10 movs r1, 0x1A - bl setmaptile_0 + bl MapGridSetMetatileIdAt ldr r2, =0x00000e32 movs r0, 0xE movs r1, 0x1B - bl setmaptile_0 + bl MapGridSetMetatileIdAt ldr r2, =0x00000233 movs r0, 0xF movs r1, 0x1B - bl setmaptile_0 + bl MapGridSetMetatileIdAt ldr r2, =0x00000e34 movs r0, 0x10 movs r1, 0x1B - bl setmaptile_0 - bl cur_mapdata_full_redraw + bl MapGridSetMetatileIdAt + bl DrawWholeMapView movs r0, 0x14 bl audio_play ldr r0, =0x000008b2 @@ -701937,7 +702088,7 @@ sub_817A1C4: ; 817A1C4 strh r0, [r6] ldr r1, =0x02021cc4 adds r0, r5, 0 - bl sub_81B1B44 + bl GetMonNickname ldr r1, =0x02021dc4 adds r0, r4, 0 bl sub_8137044 @@ -701983,7 +702134,7 @@ sub_817A1C4: ; 817A1C4 str r0, [sp, 0xC] movs r0, 0 movs r1, 0x1 - bl text_box_related_one + bl AddTextPrinterParametrized ldr r1, =0x03005e00 lsls r0, r7, 2 adds r0, r7 @@ -702596,13 +702747,13 @@ sub_817A634: ; 817A634 adds r1, 0xA lsls r1, 24 lsrs r1, 24 - bl sub_8008258 + bl StartObjectRotScalAnim b @0817A8C8 .pool @0817A898: ldr r0, [r4] ldrb r1, [r2] - bl sub_8008258 + bl StartObjectRotScalAnim b @0817A8C8 @0817A8A2: bl sub_817A9E4 @@ -706453,7 +706604,7 @@ sub_817C8BC: ; 817C8BC thumb_func_start hm_teleport_run_dp02scr hm_teleport_run_dp02scr: ; 817C8FC push {lr} - bl new_game + bl sub_808469C movs r0, 0x3F bl FieldEffectStart bl brm_get_pokemon_selection @@ -706482,7 +706633,7 @@ sub_817C91C: ; 817C91C strh r0, [r1, 0x18] strh r2, [r1, 0x1A] movs r0, 0x1 - bl SetPlayerAvatarTransition + bl SetPlayerAvatarTransitionFlags movs r0, 0 pop {r1} bx r1 @@ -711724,13 +711875,13 @@ sub_817F670: ; 817F670 bne @0817F6A8 adds r0, r4, 0 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim b @0817F6B0 .pool @0817F6A8: adds r0, r4, 0 movs r1, 0 - bl sub_8008258 + bl StartObjectRotScalAnim @0817F6B0: ldrb r3, [r4, 0x1] lsrs r1, r3, 6 @@ -748439,7 +748590,7 @@ sub_81924E0: ; 81924E0 ldrb r3, [r1, 0xA] adds r1, r4, 0 movs r2, 0xD0 - bl sub_81DB374 + bl GetStringCenterAlignXOffsetWithLetterSpacing add r1, sp, 0xC movs r5, 0 strb r0, [r1, 0x8] @@ -750274,7 +750425,7 @@ sub_819314C: ; 819314C add r2, sp, 0xC ldrb r3, [r2, 0xA] movs r2, 0x40 - bl sub_81DB374 + bl GetStringCenterAlignXOffsetWithLetterSpacing add r1, sp, 0xC strb r0, [r1, 0x8] adds r0, r1, 0 @@ -750327,7 +750478,7 @@ sub_819314C: ; 819314C add r2, sp, 0xC ldrb r3, [r2, 0xA] movs r2, 0x40 - bl sub_81DB374 + bl GetStringCenterAlignXOffsetWithLetterSpacing add r1, sp, 0xC strb r0, [r1, 0x8] adds r0, r1, 0 @@ -750360,7 +750511,7 @@ sub_819314C: ; 819314C add r2, sp, 0xC ldrb r3, [r2, 0xA] movs r2, 0xA0 - bl sub_81DB374 + bl GetStringCenterAlignXOffsetWithLetterSpacing add r1, sp, 0xC strb r0, [r1, 0x8] adds r0, r1, 0 @@ -751797,7 +751948,7 @@ sub_8194220: ; 8194220 add r2, sp, 0x4 ldrb r3, [r2, 0xA] movs r2, 0x70 - bl sub_81DB374 + bl GetStringCenterAlignXOffsetWithLetterSpacing add r1, sp, 0x4 strb r0, [r1, 0x8] movs r0, 0x1 @@ -752060,7 +752211,7 @@ sub_8194220: ; 8194220 ldrb r3, [r4, 0xA] ldr r1, =0x02022e2c movs r2, 0x3D - bl sub_81DB384 + bl GetStringWidthDifference b @0819476A .pool @08194768: @@ -752411,7 +752562,7 @@ sub_8194950: ; 8194950 ldrb r3, [r4, 0xA] mov r1, r9 movs r2, 0x3D - bl sub_81DB384 + bl GetStringWidthDifference b @08194A86 .pool @08194A84: @@ -757280,8 +757431,9 @@ sub_8197224: ; 8197224 bx r1 thumb_func_end sub_8197224 - thumb_func_start text_box_related_one -text_box_related_one: ; 8197238 + thumb_func_start AddTextPrinterParametrized +; u16 AddTextPrinterParametrized(u8 windowId, u8 fontId, u8 *str, u8 speed, void ( *callback)(u16, struct TextPrinter *), u8 fgColor, u8 bgColor, u8 shadowColor) +AddTextPrinterParametrized: ; 8197238 push {r4-r7,lr} mov r7, r8 push {r7} @@ -757350,10 +757502,11 @@ text_box_related_one: ; 8197238 pop {r1} bx r1 .pool - thumb_func_end text_box_related_one + thumb_func_end AddTextPrinterParametrized - thumb_func_start get_map_name -get_map_name: ; 81972C4 + thumb_func_start AddTextPrinterForMessage +; void AddTextPrinterForMessage(u8 allowSkippingDelayWithButtonPress) +AddTextPrinterForMessage: ; 81972C4 push {r4,r5,lr} sub sp, 0x10 lsls r0, 24 @@ -757381,16 +757534,17 @@ get_map_name: ; 81972C4 str r0, [sp, 0xC] movs r0, 0 movs r1, 0x1 - bl text_box_related_one + bl AddTextPrinterParametrized add sp, 0x10 pop {r4,r5} pop {r0} bx r0 .pool - thumb_func_end get_map_name + thumb_func_end AddTextPrinterForMessage - thumb_func_start sub_8197310 -sub_8197310: ; 8197310 + thumb_func_start AddTextPrinterForMessage_2 +; void AddTextPrinterForMessage_2(u8 allowSkippingDelayWithButtonPress) +AddTextPrinterForMessage_2: ; 8197310 push {r4,lr} sub sp, 0x10 lsls r0, 24 @@ -757418,16 +757572,17 @@ sub_8197310: ; 8197310 str r0, [sp, 0xC] movs r0, 0 movs r1, 0x1 - bl text_box_related_one + bl AddTextPrinterParametrized add sp, 0x10 pop {r4} pop {r0} bx r0 .pool - thumb_func_end sub_8197310 + thumb_func_end AddTextPrinterForMessage_2 - thumb_func_start sub_819735C -sub_819735C: ; 819735C + thumb_func_start AddTextPrinterWithCustomSpeedForMessage +; void AddTextPrinterWithCustomSpeedForMessage(u8 allowSkippingDelayWithButtonPress, u8 speed) +AddTextPrinterWithCustomSpeedForMessage: ; 819735C push {r4,r5,lr} sub sp, 0x10 adds r3, r1, 0 @@ -757454,13 +757609,13 @@ sub_819735C: ; 819735C str r0, [sp, 0xC] movs r0, 0 movs r1, 0x1 - bl text_box_related_one + bl AddTextPrinterParametrized add sp, 0x10 pop {r4,r5} pop {r0} bx r0 .pool - thumb_func_end sub_819735C + thumb_func_end AddTextPrinterWithCustomSpeedForMessage thumb_func_start sub_81973A4 sub_81973A4: ; 81973A4 @@ -758115,8 +758270,9 @@ sub_81978D0: ; 81978D0 .pool thumb_func_end sub_81978D0 - thumb_func_start sub_81978EC -sub_81978EC: ; 81978EC + thumb_func_start DisplayItemMessageOnField +; void DisplayItemMessageOnField(u8 taskId, u8 *str, void ( *callback)(u8 taskId)) +DisplayItemMessageOnField: ; 81978EC push {r4-r6,lr} sub sp, 0x10 adds r4, r0, 0 @@ -758138,7 +758294,7 @@ sub_81978EC: ; 81978EC adds r0, r4, 0 movs r1, 0 movs r3, 0xF - bl sub_8121E7C + bl DisplayMessageAndContinueTask movs r0, 0 movs r1, 0x3 bl CopyWindowToVram @@ -758146,7 +758302,7 @@ sub_81978EC: ; 81978EC pop {r4-r6} pop {r0} bx r0 - thumb_func_end sub_81978EC + thumb_func_end DisplayItemMessageOnField thumb_func_start sub_8197930 sub_8197930: ; 8197930 @@ -758262,16 +758418,16 @@ sub_81979C4: ; 81979C4 .pool thumb_func_end sub_81979C4 - thumb_func_start sub_8197A08 -sub_8197A08: ; 8197A08 + thumb_func_start get_start_menu_window_id_maybe +get_start_menu_window_id_maybe: ; 8197A08 ldr r0, =0x0203cd8c ldrb r0, [r0] bx lr .pool - thumb_func_end sub_8197A08 + thumb_func_end get_start_menu_window_id_maybe - thumb_func_start sub_8197A14 -sub_8197A14: ; 8197A14 + thumb_func_start remove_start_menu_window_maybe +remove_start_menu_window_maybe: ; 8197A14 push {r4,lr} ldr r4, =0x0203cd8c ldrb r0, [r4] @@ -758285,7 +758441,7 @@ sub_8197A14: ; 8197A14 pop {r0} bx r0 .pool - thumb_func_end sub_8197A14 + thumb_func_end remove_start_menu_window_maybe thumb_func_start sub_8197A30 sub_8197A30: ; 8197A30 @@ -758301,8 +758457,8 @@ sub_8197A38: ; 8197A38 bx lr thumb_func_end sub_8197A38 - thumb_func_start sub_8197A40 -sub_8197A40: ; 8197A40 + thumb_func_start AddMapNamePopUpWindow +AddMapNamePopUpWindow: ; 8197A40 push {r4,lr} sub sp, 0xC ldr r4, =0x0203cd8d @@ -758328,18 +758484,18 @@ sub_8197A40: ; 8197A40 pop {r1} bx r1 .pool - thumb_func_end sub_8197A40 + thumb_func_end AddMapNamePopUpWindow - thumb_func_start rboxid_upload_textbox_1_no_pal -rboxid_upload_textbox_1_no_pal: ; 8197A74 + thumb_func_start GetMapNamePopUpWindowId +GetMapNamePopUpWindowId: ; 8197A74 ldr r0, =0x0203cd8d ldrb r0, [r0] bx lr .pool - thumb_func_end rboxid_upload_textbox_1_no_pal + thumb_func_end GetMapNamePopUpWindowId - thumb_func_start sub_8197A80 -sub_8197A80: ; 8197A80 + thumb_func_start RemoveMapNamePopUpWindow +RemoveMapNamePopUpWindow: ; 8197A80 push {r4,lr} ldr r4, =0x0203cd8d ldrb r0, [r4] @@ -758353,10 +758509,11 @@ sub_8197A80: ; 8197A80 pop {r0} bx r0 .pool - thumb_func_end sub_8197A80 + thumb_func_end RemoveMapNamePopUpWindow - thumb_func_start sub_8197A9C -sub_8197A9C: ; 8197A9C + thumb_func_start AddTextPrinterWithCallbackForMessage +; void AddTextPrinterWithCallbackForMessage(u8 allowSkippingDelayWithButtonPress, void ( *callback)(u16, struct TextPrinter *)) +AddTextPrinterWithCallbackForMessage: ; 8197A9C push {r4,r5,lr} sub sp, 0x10 adds r5, r1, 0 @@ -758384,13 +758541,13 @@ sub_8197A9C: ; 8197A9C str r0, [sp, 0xC] movs r0, 0 movs r1, 0x1 - bl text_box_related_one + bl AddTextPrinterParametrized add sp, 0x10 pop {r4,r5} pop {r0} bx r0 .pool - thumb_func_end sub_8197A9C + thumb_func_end AddTextPrinterWithCallbackForMessage thumb_func_start sub_8197AE8 sub_8197AE8: ; 8197AE8 @@ -759341,7 +759498,7 @@ sub_8198204: ; 8198204 movs r1, 0x1 movs r2, 0x4 movs r3, 0x1 - bl sub_8199EEC + bl AddTextPrinterParametrized2 mov r2, r9 cmp r2, 0 beq @081982C8 @@ -760142,8 +760299,8 @@ sub_8198854: ; 8198854 bx r0 thumb_func_end sub_8198854 - thumb_func_start sub_81988A4 -sub_81988A4: ; 81988A4 + thumb_func_start AddItemMenuActionTextPrinters +AddItemMenuActionTextPrinters: ; 81988A4 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -760276,7 +760433,7 @@ sub_81988A4: ; 81988A4 pop {r4-r7} pop {r0} bx r0 - thumb_func_end sub_81988A4 + thumb_func_end AddItemMenuActionTextPrinters thumb_func_start sub_81989B8 sub_81989B8: ; 81989B8 @@ -760323,7 +760480,7 @@ sub_81989B8: ; 81989B8 adds r1, r4, 0 adds r2, r5, 0 movs r3, 0x1 - bl sub_81988A4 + bl AddItemMenuActionTextPrinters add sp, 0x14 pop {r3,r4} mov r8, r3 @@ -761472,7 +761629,7 @@ sub_8199284: ; 8199284 ands r0, r1 cmp r0, 0 bne @081992F8 - bl sub_81220D0 + bl GetLRKeysState lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -761489,7 +761646,7 @@ sub_8199284: ; 8199284 ands r0, r1 cmp r0, 0 bne @0819931A - bl sub_81220D0 + bl GetLRKeysState lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 @@ -761558,7 +761715,7 @@ sub_8199334: ; 8199334 ands r0, r1 cmp r0, 0 bne @0819939C - bl sub_81220D0 + bl GetLRKeysState lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -761573,7 +761730,7 @@ sub_8199334: ; 8199334 ands r0, r1 cmp r0, 0 bne @081993B8 - bl sub_81220D0 + bl GetLRKeysState lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 @@ -763084,8 +763241,9 @@ box_print: ; 8199E64 bx r0 thumb_func_end box_print - thumb_func_start sub_8199EEC -sub_8199EEC: ; 8199EEC + thumb_func_start AddTextPrinterParametrized2 +; void AddTextPrinterParametrized2(u8 windowId, u8 fontId, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, struct TextColor *color, u8 speed, u8 *str) +AddTextPrinterParametrized2: ; 8199EEC push {r4-r6,lr} mov r6, r9 mov r5, r8 @@ -763153,7 +763311,7 @@ sub_8199EEC: ; 8199EEC pop {r4-r6} pop {r0} bx r0 - thumb_func_end sub_8199EEC + thumb_func_end AddTextPrinterParametrized2 thumb_func_start sub_8199F74 sub_8199F74: ; 8199F74 @@ -766289,7 +766447,7 @@ sub_819B9E8: ; 819B9E8 movs r0, 0x1 adds r1, r4, 0 movs r2, 0x56 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 @@ -766648,7 +766806,7 @@ sub_819BCF8: ; 819BCF8 movs r0, 0x1 add r1, sp, 0xC movs r2, 0x76 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 @@ -766796,7 +766954,7 @@ sub_819BE34: ; 819BE34 mov r8, r1 add r0, r8 movs r1, 0x2 - bl sub_8008258 + bl StartObjectRotScalAnim ldr r2, [r6] ldrb r1, [r2, 0x3] movs r0, 0x6C @@ -767429,7 +767587,7 @@ sub_819C2D4: ; 819C2D4 lsls r0, 2 adds r0, r4 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim mov r1, r8 ldr r0, [r1] add r0, r9 @@ -767439,7 +767597,7 @@ sub_819C2D4: ; 819C2D4 lsls r0, 2 adds r0, r4 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim mov r1, r8 ldr r0, [r1] adds r0, r5 @@ -767449,7 +767607,7 @@ sub_819C2D4: ; 819C2D4 lsls r0, 2 adds r0, r4 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim movs r1, 0x80 lsls r1, 6 movs r0, 0 @@ -772181,7 +772339,7 @@ sub_819EB4C: ; 819EB4C movs r0, 0x1 adds r1, r4, 0 movs r2, 0x56 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 @@ -772329,7 +772487,7 @@ sub_819ECF0: ; 819ECF0 movs r0, 0 adds r1, r6, 0 movs r2, 0x46 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r2, r0, 0 lsls r4, 24 lsrs r4, 24 @@ -772528,7 +772686,7 @@ sub_819EE08: ; 819EE08 movs r0, 0x1 adds r1, r4, 0 movs r2, 0x56 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 @@ -772605,7 +772763,7 @@ sub_819EEF0: ; 819EEF0 movs r0, 0x1 adds r1, r4, 0 movs r2, 0x56 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 @@ -772678,7 +772836,7 @@ sub_819EFA8: ; 819EFA8 movs r0, 0x1 add r1, sp, 0xC movs r2, 0x76 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 @@ -773058,7 +773216,7 @@ sub_819F304: ; 819F304 mov r8, r1 add r0, r8 movs r1, 0x2 - bl sub_8008258 + bl StartObjectRotScalAnim ldr r0, [r6] ldrb r1, [r0, 0x3] movs r0, 0x64 @@ -773637,7 +773795,7 @@ sub_819F7B4: ; 819F7B4 lsls r0, 2 adds r0, r3 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim movs r1, 0x80 lsls r1, 6 movs r0, 0 @@ -776209,7 +776367,7 @@ sub_81A0A70: ; 81A0A70 ldr r0, =0x02021fc4 bl ExpandStringRefs movs r0, 0x1 - bl get_map_name + bl AddTextPrinterForMessage ldr r0, =sub_81A0A34 movs r1, 0x1 bl AddTask @@ -778119,7 +778277,7 @@ sub_81A1C4C: ; 81A1C4C movs r0, 0x1 adds r1, r4, 0 movs r2, 0xE0 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r3, r0, 0 lsls r0, r5, 3 adds r5, r0, 0x1 @@ -780380,7 +780538,7 @@ sub_81A2FF8: ; 81A2FF8 movs r0, 0x1 mov r1, r9 movs r2, 0xD0 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r3, r0, 0 ldrb r0, [r4] lsls r3, 24 @@ -780397,7 +780555,7 @@ sub_81A2FF8: ; 81A2FF8 movs r0, 0x1 adds r1, r7, 0 movs r2, 0x26 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r3, r0, 0 adds r3, 0x32 ldrb r0, [r4] @@ -780415,7 +780573,7 @@ sub_81A2FF8: ; 81A2FF8 movs r0, 0x1 adds r1, r7, 0 movs r2, 0x26 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r3, r0, 0 adds r3, 0x58 ldrb r0, [r4] @@ -780432,7 +780590,7 @@ sub_81A2FF8: ; 81A2FF8 movs r0, 0x1 adds r1, r7, 0 movs r2, 0x26 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r3, r0, 0 adds r3, 0x7E ldrb r0, [r4] @@ -780449,7 +780607,7 @@ sub_81A2FF8: ; 81A2FF8 movs r0, 0x1 adds r1, r7, 0 movs r2, 0x26 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r3, r0, 0 adds r3, 0xA4 ldrb r0, [r4] @@ -782877,7 +783035,7 @@ sub_81A4594: ; 81A4594 movs r0, 0x1 adds r1, r4, 0 movs r2, 0xC8 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 @@ -783033,7 +783191,7 @@ sub_81A4684: ; 81A4684 movs r0, 0x1 adds r1, r4, 0 movs r2, 0xC8 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 @@ -783333,7 +783491,7 @@ sub_81A4998: ; 81A4998 movs r0, 0x1 adds r1, r4, 0 movs r2, 0xD0 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r3, r0, 0 mov r1, r8 ldrb r0, [r1] @@ -788534,7 +788692,7 @@ sub_81A7594: ; 81A7594 lsrs r0, 16 adds r1, r6, 0 adds r2, r4, 0 - bl move_get_pp_info + bl CalcPPWithPPUps mov r1, sp strb r0, [r1] adds r1, r4, 0 @@ -789854,7 +790012,7 @@ sub_81A7F38: ; 81A7F38 lsrs r0, 16 mov r1, r9 adds r2, r4, 0 - bl move_get_pp_info + bl CalcPPWithPPUps lsls r0, 24 lsrs r6, r0, 24 adds r1, r4, 0 @@ -789910,7 +790068,7 @@ sub_81A7F38: ; 81A7F38 sub_81A8090: ; 81A8090 push {r4,lr} ldr r4, =0x020375f0 - bl sub_81A80A8 + bl InBattlePike lsls r0, 24 lsrs r0, 24 strh r0, [r4] @@ -789920,8 +790078,8 @@ sub_81A8090: ; 81A8090 .pool thumb_func_end sub_81A8090 - thumb_func_start sub_81A80A8 -sub_81A80A8: ; 81A80A8 + thumb_func_start InBattlePike +InBattlePike: ; 81A80A8 push {lr} movs r2, 0 ldr r0, =0x02037318 @@ -789946,7 +790104,7 @@ sub_81A80A8: ; 81A80A8 pop {r1} bx r1 .pool - thumb_func_end sub_81A80A8 + thumb_func_end InBattlePike thumb_func_start sub_81A80DC sub_81A80DC: ; 81A80DC @@ -790720,7 +790878,7 @@ sub_81A86C0: ; 81A86C0 lsrs r0, 16 mov r1, r8 adds r2, r6, 0 - bl move_get_pp_info + bl CalcPPWithPPUps lsls r0, 24 lsrs r5, r0, 24 adds r1, r6, 0 @@ -790956,6 +791114,7 @@ sub_81A890C: ; 81A890C thumb_func_end sub_81A890C thumb_func_start sub_81A8934 +; void sub_81A8934(u8) sub_81A8934: ; 81A8934 push {r4,r5,lr} lsls r0, 24 @@ -791042,7 +791201,7 @@ sub_81A89A0: ; 81A89A0 asrs r0, 16 lsls r1, 16 asrs r1, 16 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt lsls r0, 16 lsrs r1, r0, 16 ldr r0, =0x0203ce50 @@ -791235,7 +791394,7 @@ sub_81A8AF8: ; 81A8AF8 asrs r0, 16 lsls r1, 16 asrs r1, 16 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt lsls r0, 16 lsrs r0, 16 mov r3, r10 @@ -791538,7 +791697,7 @@ sub_81A8D94: ; 81A8D94 asrs r0, 16 lsls r1, 16 asrs r1, 16 - bl cur_mapdata_get_blockid_at + bl MapGridGetMetatileIdAt lsls r0, 16 lsrs r2, r0, 16 ldr r0, =0x0203ce50 @@ -792555,7 +792714,7 @@ sub_81A9618: ; 81A9618 sub_81A966C: ; 81A966C push {r4,lr} ldr r4, =0x020375f0 - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 lsrs r0, 24 strh r0, [r4] @@ -793090,8 +793249,8 @@ sub_81A9AA8: ; 81A9AA8 .pool thumb_func_end sub_81A9AA8 - thumb_func_start sub_81A9AC4 -sub_81A9AC4: ; 81A9AC4 + thumb_func_start GetBattlePyramidTrainerFlag +GetBattlePyramidTrainerFlag: ; 81A9AC4 push {r4,lr} lsls r0, 24 lsrs r0, 24 @@ -793116,7 +793275,7 @@ sub_81A9AC4: ; 81A9AC4 pop {r1} bx r1 .pool - thumb_func_end sub_81A9AC4 + thumb_func_end GetBattlePyramidTrainerFlag thumb_func_start sub_81A9B04 sub_81A9B04: ; 81A9B04 @@ -793288,7 +793447,7 @@ sub_81A9C04: ; 81A9C04 adds r0, r6 ldrh r1, [r0] mov r0, sp - bl get_pokemon_name + bl GetSpeciesName adds r0, r4, 0 movs r1, 0x2 mov r2, sp @@ -793485,8 +793644,8 @@ sub_81A9E28: ; 81A9E28 .pool thumb_func_end sub_81A9E28 - thumb_func_start sub_81A9E40 -sub_81A9E40: ; 81A9E40 + thumb_func_start InBattlePyramid +InBattlePyramid: ; 81A9E40 push {lr} ldr r0, =0x02037318 ldrh r1, [r0, 0x12] @@ -793508,7 +793667,7 @@ sub_81A9E40: ; 81A9E40 @081A9E66: pop {r1} bx r1 - thumb_func_end sub_81A9E40 + thumb_func_end InBattlePyramid thumb_func_start sub_81A9E6C sub_81A9E6C: ; 81A9E6C @@ -793534,7 +793693,7 @@ sub_81A9E6C: ; 81A9E6C thumb_func_start sub_81A9E90 sub_81A9E90: ; 81A9E90 push {lr} - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 beq @081A9EB8 @@ -793558,7 +793717,7 @@ sub_81A9E90: ; 81A9E90 thumb_func_start sub_81A9EC8 sub_81A9EC8: ; 81A9EC8 push {lr} - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 beq @081A9ED8 @@ -795213,7 +795372,7 @@ c2_bag: ; 81AAB9C thumb_func_start sub_81AABB0 sub_81AABB0: ; 81AABB0 push {lr} - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 bne @081AABCC @@ -795233,8 +795392,8 @@ sub_81AABB0: ; 81AABB0 .pool thumb_func_end sub_81AABB0 - thumb_func_start c2_810A554 -c2_810A554: ; 81AABDC + thumb_func_start CB2_ChooseBerry +CB2_ChooseBerry: ; 81AABDC push {lr} ldr r2, =sub_80861B0 movs r0, 0x4 @@ -795243,7 +795402,7 @@ c2_810A554: ; 81AABDC pop {r0} bx r0 .pool - thumb_func_end c2_810A554 + thumb_func_end CB2_ChooseBerry thumb_func_start sub_81AABF0 sub_81AABF0: ; 81AABF0 @@ -795658,7 +795817,7 @@ setup_bag_menu: ; 81AADB8 @081AAFA0: ldr r0, =0x0203ce58 ldrb r0, [r0, 0x5] - bl sub_80D4D00 + bl AddBagVisualObject ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 @@ -795916,7 +796075,7 @@ sub_81AB1F0: ; 81AB1F0 b @081AB206 .pool @081AB204: - ldr r0, =sub_81ABD28 + ldr r0, =Task_BagMenu @081AB206: movs r1, 0 bl AddTask @@ -796174,8 +796333,8 @@ get_name: ; 81AB39C .pool thumb_func_end get_name - thumb_func_start sub_81AB450 -sub_81AB450: ; 81AB450 + thumb_func_start bag_menu_change_item_callback +bag_menu_change_item_callback: ; 81AB450 push {r4-r6,lr} adds r6, r0, 0 lsls r1, 24 @@ -796184,7 +796343,7 @@ sub_81AB450: ; 81AB450 beq @081AB466 movs r0, 0x5 bl audio_play - bl sub_80D4DC4 + bl ShakeBagVisual @081AB466: ldr r4, =0x0203ce54 ldr r1, [r4] @@ -796200,7 +796359,7 @@ sub_81AB450: ; 81AB450 lsrs r1, 30 movs r0, 0x1 eors r0, r1 - bl sub_80D4F98 + bl RemoveBagItemIconObject movs r0, 0x2 negs r0, r0 cmp r6, r0 @@ -796221,7 +796380,7 @@ sub_81AB450: ; 81AB450 ldrb r1, [r1] lsls r1, 26 lsrs r1, 30 - bl sub_80D4F38 + bl AddBagItemIconObject b @081AB4DA .pool @081AB4C8: @@ -796232,7 +796391,7 @@ sub_81AB450: ; 81AB450 ldrb r1, [r1] lsls r1, 26 lsrs r1, 30 - bl sub_80D4F38 + bl AddBagItemIconObject @081AB4DA: ldr r5, =0x0203ce54 ldr r2, [r5] @@ -796263,7 +796422,7 @@ sub_81AB450: ; 81AB450 pop {r0} bx r0 .pool - thumb_func_end sub_81AB450 + thumb_func_end bag_menu_change_item_callback thumb_func_start sub_81AB520 ; void sub_81AB520(u8 rbox_id, int item_index_in_pocket, int a3) @@ -796358,7 +796517,7 @@ sub_81AB520: ; 81AB520 movs r0, 0x7 adds r1, r4, 0 movs r2, 0x77 - bl sub_81DB368 + bl GetStringRightAlignXOffset lsls r3, r0, 24 lsrs r3, 24 str r7, [sp] @@ -796391,7 +796550,7 @@ sub_81AB520: ; 81AB520 movs r0, 0x7 adds r1, r4, 0 movs r2, 0x77 - bl sub_81DB368 + bl GetStringRightAlignXOffset lsls r3, r0, 24 lsrs r3, 24 str r7, [sp] @@ -796709,8 +796868,8 @@ free_bag_item_list_buffers: ; 81AB8C8 .pool thumb_func_end free_bag_item_list_buffers - thumb_func_start task_close_bag_menu_1 -task_close_bag_menu_1: ; 81AB8F8 + thumb_func_start sub_81AB8F8 +sub_81AB8F8: ; 81AB8F8 push {r4,lr} sub sp, 0x4 adds r4, r0, 0 @@ -796735,7 +796894,7 @@ task_close_bag_menu_1: ; 81AB8F8 pop {r0} bx r0 .pool - thumb_func_end task_close_bag_menu_1 + thumb_func_end sub_81AB8F8 thumb_func_start task_close_bag_menu_2 task_close_bag_menu_2: ; 81AB930 @@ -797003,8 +797162,9 @@ sub_81ABB2C: ; 81ABB2C .pool thumb_func_end sub_81ABB2C - thumb_func_start sub_81ABB4C -sub_81ABB4C: ; 81ABB4C + thumb_func_start DisplayItemMessage +; void DisplayItemMessage(u8 taskId, u8 fontId, u8 *str, void ( *callback)(u8 taskId)) +DisplayItemMessage: ; 81ABB4C push {r4-r6,lr} mov r6, r9 mov r5, r8 @@ -797024,7 +797184,7 @@ sub_81ABB4C: ; 81ABB4C ldr r0, =0x03005e08 adds r4, r0 movs r0, 0x4 - bl sub_81AE1C4 + bl AddItemMessageWindow lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x14] @@ -797043,7 +797203,7 @@ sub_81ABB4C: ; 81ABB4C adds r0, r5, 0 movs r2, 0xA movs r3, 0xD - bl sub_8121E7C + bl DisplayMessageAndContinueTask movs r0, 0x1 bl schedule_bg_copy_tilemap_to_vram add sp, 0x10 @@ -797054,7 +797214,7 @@ sub_81ABB4C: ; 81ABB4C pop {r0} bx r0 .pool - thumb_func_end sub_81ABB4C + thumb_func_end DisplayItemMessage thumb_func_start sub_81ABBBC sub_81ABBBC: ; 81ABBBC @@ -797152,7 +797312,7 @@ sub_81ABC54: ; 81ABC54 movs r0, 0x1 adds r1, r4, 0 movs r2, 0x28 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 @@ -797218,8 +797378,8 @@ sub_81ABCC0: ; 81ABCC0 .pool thumb_func_end sub_81ABCC0 - thumb_func_start sub_81ABD28 -sub_81ABD28: ; 81ABD28 + thumb_func_start Task_BagMenu +Task_BagMenu: ; 81ABD28 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -797259,7 +797419,7 @@ sub_81ABD28: ; 81ABD28 beq @081ABD74 b @081ABEB2 @081ABD74: - bl sub_81ABF10 + bl GetSwitchBagPocketDirection lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -797294,7 +797454,7 @@ sub_81ABD28: ; 81ABD28 movs r1, 0x1 @081ABDC4: movs r2, 0 - bl sub_81ABFA8 + bl SwitchBagPocket b @081ABEB2 @081ABDCC: ldrb r0, [r6] @@ -797319,7 +797479,7 @@ sub_81ABD28: ; 81ABD28 movs r0, 0x5 bl audio_play mov r0, r9 - bl sub_81AC2E8 + bl bag_menu_swap_items b @081ABEB2 .pool @081ABE10: @@ -797355,7 +797515,7 @@ sub_81ABD28: ; 81ABD28 subs r0, 0x8 ldr r3, [sp] adds r0, r3, r0 - ldr r1, =task_close_bag_menu_1 + ldr r1, =sub_81AB8F8 str r1, [r0] b @081ABEB2 .pool @@ -797401,7 +797561,7 @@ sub_81ABD28: ; 81ABD28 pop {r0} bx r0 .pool - thumb_func_end sub_81ABD28 + thumb_func_end Task_BagMenu thumb_func_start set_callback3_to_bag set_callback3_to_bag: ; 81ABECC @@ -797424,7 +797584,7 @@ set_callback3_to_bag: ; 81ABECC adds r0, r4 lsls r0, 3 adds r0, r1 - ldr r1, =sub_81ABD28 + ldr r1, =Task_BagMenu str r1, [r0] pop {r4} pop {r0} @@ -797432,8 +797592,8 @@ set_callback3_to_bag: ; 81ABECC .pool thumb_func_end set_callback3_to_bag - thumb_func_start sub_81ABF10 -sub_81ABF10: ; 81ABF10 + thumb_func_start GetSwitchBagPocketDirection +GetSwitchBagPocketDirection: ; 81ABF10 push {lr} ldr r0, =0x0203ce54 ldr r0, [r0] @@ -797444,7 +797604,7 @@ sub_81ABF10: ; 81ABF10 ands r0, r1 cmp r0, 0 bne @081ABF6A - bl sub_81220D0 + bl GetLRKeysState lsls r0, 24 lsrs r2, r0, 24 ldr r0, =0x030022c0 @@ -797478,10 +797638,11 @@ sub_81ABF10: ; 81ABF10 @081ABF6C: pop {r1} bx r1 - thumb_func_end sub_81ABF10 + thumb_func_end GetSwitchBagPocketDirection - thumb_func_start sub_81ABF70 -sub_81ABF70: ; 81ABF70 + thumb_func_start ChangeBagPocketId +; void ChangeBagPocketId(u8 *bagPocketId, u8 deltaBagPocketId) +ChangeBagPocketId: ; 81ABF70 push {r4,lr} adds r2, r0, 0 lsls r1, 24 @@ -797513,10 +797674,11 @@ sub_81ABF70: ; 81ABF70 pop {r4} pop {r0} bx r0 - thumb_func_end sub_81ABF70 + thumb_func_end ChangeBagPocketId - thumb_func_start sub_81ABFA8 -sub_81ABFA8: ; 81ABFA8 + thumb_func_start SwitchBagPocket +; void SwitchBagPocket(u8 taskId, u16 deltaBagPocketId, u16 a3) +SwitchBagPocket: ; 81ABFA8 push {r4-r6,lr} sub sp, 0xC lsls r0, 24 @@ -797582,7 +797744,7 @@ sub_81ABFA8: ; 81ABFA8 strb r1, [r0] lsls r1, r5, 24 asrs r1, 24 - bl sub_81ABF70 + bl ChangeBagPocketId lsls r0, r5, 16 asrs r1, r0, 16 adds r5, r0, 0 @@ -797640,11 +797802,11 @@ sub_81ABFA8: ; 81ABFA8 add r0, sp, 0x8 ldrb r0, [r0] movs r1, 0x1 - bl sub_80D4D38 + bl SetBagVisualPocketId movs r0, 0x1 - bl sub_80D4CA8 + bl RemoveBagObject asrs r0, r5, 16 - bl sub_80D4E34 + bl AddSwitchPocketRotatingBallObject ldr r1, =sub_81AC10C ldr r2, =0x03005e00 lsls r0, r6, 2 @@ -797659,7 +797821,7 @@ sub_81ABFA8: ; 81ABFA8 pop {r0} bx r0 .pool - thumb_func_end sub_81ABFA8 + thumb_func_end SwitchBagPocket thumb_func_start sub_81AC10C sub_81AC10C: ; 81AC10C @@ -797679,7 +797841,7 @@ sub_81AC10C: ; 81AC10C lsls r0, 24 cmp r0, 0 bne @081AC184 - bl sub_81ABF10 + bl GetSwitchBagPocketDirection lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -797692,7 +797854,7 @@ sub_81AC10C: ; 81AC10C ldr r0, =0x0203ce5d movs r1, 0x16 ldrsb r1, [r6, r1] - bl sub_81ABF70 + bl ChangeBagPocketId adds r0, r7, 0 bl set_task_function_to_args_14_15 movs r1, 0x1 @@ -797704,14 +797866,14 @@ sub_81AC10C: ; 81AC10C ldr r0, =0x0203ce5d movs r1, 0x16 ldrsb r1, [r6, r1] - bl sub_81ABF70 + bl ChangeBagPocketId adds r0, r7, 0 bl set_task_function_to_args_14_15 adds r0, r7, 0 movs r1, 0x1 @081AC178: movs r2, 0x1 - bl sub_81ABFA8 + bl SwitchBagPocket b @081AC22E .pool @081AC184: @@ -797764,7 +797926,7 @@ sub_81AC10C: ; 81AC10C movs r1, 0x16 ldrsb r1, [r6, r1] adds r0, r4, 0 - bl sub_81ABF70 + bl ChangeBagPocketId subs r5, r4, 0x5 ldrb r0, [r5, 0x5] bl load_bag_item_list_buffers @@ -797889,8 +798051,8 @@ sub_81AC2C0: ; 81AC2C0 bx r1 thumb_func_end sub_81AC2C0 - thumb_func_start sub_81AC2E8 -sub_81AC2E8: ; 81AC2E8 + thumb_func_start bag_menu_swap_items +bag_menu_swap_items: ; 81AC2E8 push {r4-r6,lr} mov r6, r9 mov r5, r8 @@ -797974,9 +798136,10 @@ sub_81AC2E8: ; 81AC2E8 pop {r0} bx r0 .pool - thumb_func_end sub_81AC2E8 + thumb_func_end bag_menu_swap_items thumb_func_start sub_81AC3C0 +; void sub_81AC3C0(u8 taskId) sub_81AC3C0: ; 81AC3C0 push {r4-r7,lr} mov r7, r8 @@ -798168,7 +798331,7 @@ sub_81AC498: ; 81AC498 ldr r0, =0x03005e08 subs r0, 0x8 add r0, r10 - ldr r1, =sub_81ABD28 + ldr r1, =Task_BagMenu str r1, [r0] @081AC566: pop {r3-r5} @@ -798247,7 +798410,7 @@ sub_81AC590: ; 81AC590 mov r0, r10 subs r0, 0x8 add r0, r9 - ldr r1, =sub_81ABD28 + ldr r1, =Task_BagMenu str r1, [r0] pop {r3-r5} mov r8, r3 @@ -798444,7 +798607,7 @@ sub_81AC644: ; 81AC644 lsrs r0, 24 cmp r0, 0x1 beq @081AC840 - bl in_trade_center + bl InUnionRoom cmp r0, 0x1 bne @081AC8A4 @081AC840: @@ -798746,7 +798909,7 @@ sub_81ACAF8: ; 81ACAF8 movs r1, 0x7 movs r2, 0x8 movs r3, 0x1 - bl sub_81988A4 + bl AddItemMenuActionTextPrinters ldr r0, [r6] adds r0, r5 ldrb r1, [r0] @@ -798824,7 +798987,7 @@ sub_81ACBB0: ; 81ACBB0 adds r1, r4 lsls r1, 3 adds r1, r0 - ldr r0, =sub_81ACC04 + ldr r0, =Task_HandleInBattleItemMenuInput b @081ACBF4 .pool @081ACBE8: @@ -798833,7 +798996,7 @@ sub_81ACBB0: ; 81ACBB0 adds r1, r4 lsls r1, 3 adds r1, r0 - ldr r0, =sub_81ACC78 + ldr r0, =Task_HandleOutOfBattleItemMenuInput @081ACBF4: str r0, [r1] pop {r4} @@ -798842,8 +799005,8 @@ sub_81ACBB0: ; 81ACBB0 .pool thumb_func_end sub_81ACBB0 - thumb_func_start sub_81ACC04 -sub_81ACC04: ; 81ACC04 + thumb_func_start Task_HandleInBattleItemMenuInput +Task_HandleInBattleItemMenuInput: ; 81ACC04 push {r4-r6,lr} lsls r0, 24 lsrs r5, r0, 24 @@ -798894,10 +799057,10 @@ sub_81ACC04: ; 81ACC04 pop {r0} bx r0 .pool - thumb_func_end sub_81ACC04 + thumb_func_end Task_HandleInBattleItemMenuInput - thumb_func_start sub_81ACC78 -sub_81ACC78: ; 81ACC78 + thumb_func_start Task_HandleOutOfBattleItemMenuInput +Task_HandleOutOfBattleItemMenuInput: ; 81ACC78 push {r4-r6,lr} lsls r0, 24 lsrs r6, r0, 24 @@ -798976,7 +799139,7 @@ sub_81ACC78: ; 81ACC78 ands r0, r1 cmp r0, 0 bne @081ACD30 - bl sub_81220D0 + bl GetLRKeysState lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -799006,7 +799169,7 @@ sub_81ACC78: ; 81ACC78 ands r0, r1 cmp r0, 0 bne @081ACD6E - bl sub_81220D0 + bl GetLRKeysState lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 @@ -799075,7 +799238,7 @@ sub_81ACC78: ; 81ACC78 pop {r0} bx r0 .pool - thumb_func_end sub_81ACC78 + thumb_func_end Task_HandleOutOfBattleItemMenuInput thumb_func_start sub_81ACDFC sub_81ACDFC: ; 81ACDFC @@ -799143,8 +799306,9 @@ sub_81ACE38: ; 81ACE38 bx r0 thumb_func_end sub_81ACE38 - thumb_func_start sub_81ACE7C -sub_81ACE7C: ; 81ACE7C + thumb_func_start ItemMenu_UseOutOfBattle +; void ItemMenu_UseOutOfBattle(u8 taskId) +ItemMenu_UseOutOfBattle: ; 81ACE7C push {r4,r5,lr} lsls r0, 24 lsrs r4, r0, 24 @@ -799193,10 +799357,10 @@ sub_81ACE7C: ; 81ACE7C pop {r4,r5} pop {r0} bx r0 - thumb_func_end sub_81ACE7C + thumb_func_end ItemMenu_UseOutOfBattle - thumb_func_start sub_81ACEF4 -sub_81ACEF4: ; 81ACEF4 + thumb_func_start ItemMenu_Toss +ItemMenu_Toss: ; 81ACEF4 push {r4-r7,lr} sub sp, 0x14 lsls r0, 24 @@ -799254,7 +799418,7 @@ sub_81ACEF4: ; 81ACEF4 pop {r0} bx r0 .pool - thumb_func_end sub_81ACEF4 + thumb_func_end ItemMenu_Toss thumb_func_start sub_81ACF88 sub_81ACF88: ; 81ACF88 @@ -799510,8 +799674,8 @@ sub_81AD150: ; 81AD150 .pool thumb_func_end sub_81AD150 - thumb_func_start sub_81AD1EC -sub_81AD1EC: ; 81AD1EC + thumb_func_start ItemMenu_Register +ItemMenu_Register: ; 81AD1EC push {r4-r7,lr} lsls r0, 24 lsrs r4, r0, 24 @@ -799561,15 +799725,15 @@ sub_81AD1EC: ; 81AD1EC movs r0, 0 bl schedule_bg_copy_tilemap_to_vram adds r0, r4, 0 - bl sub_81AD398 + bl ItemMenu_Cancel pop {r4-r7} pop {r0} bx r0 .pool - thumb_func_end sub_81AD1EC + thumb_func_end ItemMenu_Register - thumb_func_start sub_81AD278 -sub_81AD278: ; 81AD278 + thumb_func_start ItemMenu_Give +ItemMenu_Give: ; 81AD278 push {r4-r6,lr} lsls r0, 24 lsrs r4, r0, 24 @@ -799585,7 +799749,7 @@ sub_81AD278: ; 81AD278 ldr r3, =sub_81AD350 adds r0, r4, 0 movs r1, 0x1 - bl sub_81ABB4C + bl DisplayItemMessage b @081AD2EA .pool @081AD2AC: @@ -799607,7 +799771,7 @@ sub_81AD278: ; 81AD278 ldr r0, =sub_81B7F60 str r0, [r1] adds r0, r4, 0 - bl task_close_bag_menu_1 + bl sub_81AB8F8 b @081AD2EA .pool @081AD2E4: @@ -799617,7 +799781,7 @@ sub_81AD278: ; 81AD278 pop {r4-r6} pop {r0} bx r0 - thumb_func_end sub_81AD278 + thumb_func_end ItemMenu_Give thumb_func_start sub_81AD2F0 sub_81AD2F0: ; 81AD2F0 @@ -799627,7 +799791,7 @@ sub_81AD2F0: ; 81AD2F0 ldr r2, =gUnknown_085E8DE9 ldr r3, =sub_81AD350 movs r1, 0x1 - bl sub_81ABB4C + bl DisplayItemMessage pop {r0} bx r0 .pool @@ -799651,7 +799815,7 @@ sub_81AD30C: ; 81AD30C adds r0, r4, 0 movs r1, 0x1 adds r2, r5, 0 - bl sub_81ABB4C + bl DisplayItemMessage pop {r4,r5} pop {r0} bx r0 @@ -799680,8 +799844,8 @@ sub_81AD350: ; 81AD350 .pool thumb_func_end sub_81AD350 - thumb_func_start sub_81AD378 -sub_81AD378: ; 81AD378 + thumb_func_start ItemMenu_CheckTag +ItemMenu_CheckTag: ; 81AD378 push {lr} lsls r0, 24 lsrs r0, 24 @@ -799689,14 +799853,14 @@ sub_81AD378: ; 81AD378 ldr r2, [r1] ldr r1, =sub_8177C14 str r1, [r2] - bl task_close_bag_menu_1 + bl sub_81AB8F8 pop {r0} bx r0 .pool - thumb_func_end sub_81AD378 + thumb_func_end ItemMenu_CheckTag - thumb_func_start sub_81AD398 -sub_81AD398: ; 81AD398 + thumb_func_start ItemMenu_Cancel +ItemMenu_Cancel: ; 81AD398 push {r4,r5,lr} adds r5, r0, 0 lsls r5, 24 @@ -799723,10 +799887,10 @@ sub_81AD398: ; 81AD398 pop {r0} bx r0 .pool - thumb_func_end sub_81AD398 + thumb_func_end ItemMenu_Cancel - thumb_func_start brm_run_item_battle_function -brm_run_item_battle_function: ; 81AD3DC + thumb_func_start ItemMenu_UseInBattle +ItemMenu_UseInBattle: ; 81AD3DC push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 @@ -799746,7 +799910,7 @@ brm_run_item_battle_function: ; 81AD3DC pop {r0} bx r0 .pool - thumb_func_end brm_run_item_battle_function + thumb_func_end ItemMenu_UseInBattle thumb_func_start sub_81AD40C sub_81AD40C: ; 81AD40C @@ -799774,7 +799938,7 @@ sub_81AD41C: ; 81AD41C ldr r3, =sub_81AD350 adds r0, r5, 0 movs r1, 0x1 - bl sub_81ABB4C + bl DisplayItemMessage b @081AD4AE .pool @081AD44C: @@ -799794,7 +799958,7 @@ sub_81AD41C: ; 81AD41C adds r0, r5, 0 movs r1, 0x1 adds r2, r4, 0 - bl sub_81ABB4C + bl DisplayItemMessage b @081AD4AE .pool @081AD488: @@ -799808,7 +799972,7 @@ sub_81AD41C: ; 81AD41C cmp r0, 0 bne @081AD4A8 adds r0, r5, 0 - bl task_close_bag_menu_1 + bl sub_81AB8F8 b @081AD4AE .pool @081AD4A8: @@ -799836,7 +800000,7 @@ sub_81AD4B4: ; 81AD4B4 ldr r3, =sub_81AD350 adds r0, r4, 0 movs r1, 0x1 - bl sub_81ABB4C + bl DisplayItemMessage b @081AD51A .pool @081AD4E4: @@ -799854,7 +800018,7 @@ sub_81AD4B4: ; 81AD4B4 adds r1, r4 lsls r1, 3 adds r1, r0 - ldr r0, =task_close_bag_menu_1 + ldr r0, =sub_81AB8F8 str r0, [r1] b @081AD51A .pool @@ -799867,22 +800031,23 @@ sub_81AD4B4: ; 81AD4B4 bx r0 thumb_func_end sub_81AD4B4 - thumb_func_start sub_81AD520 -sub_81AD520: ; 81AD520 + thumb_func_start UseRegisteredKeyItemOnField +; BOOL UseRegisteredKeyItemOnField() +UseRegisteredKeyItemOnField: ; 81AD520 push {r4-r7,lr} - bl in_trade_center + bl InUnionRoom cmp r0, 0x1 beq @081AD54C - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 bne @081AD54C - bl sub_81A80A8 + bl InBattlePike lsls r0, 24 lsrs r7, r0, 24 cmp r7, 0 bne @081AD54C - bl sub_813994C + bl in_multi_battle_room_with_var_condition lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -799891,7 +800056,7 @@ sub_81AD520: ; 81AD520 movs r0, 0 b @081AD5D2 @081AD550: - bl call_203AE8C + bl HideMapNamePopUpWindow movs r0, 0 movs r1, 0 movs r2, 0 @@ -799946,7 +800111,7 @@ sub_81AD520: ; 81AD520 pop {r1} bx r1 .pool - thumb_func_end sub_81AD520 + thumb_func_end UseRegisteredKeyItemOnField thumb_func_start display_sell_item_ask_str ; void display_sell_item_ask_str(int a1) @@ -799977,7 +800142,7 @@ display_sell_item_ask_str: ; 81AD5DC adds r0, r5, 0 movs r1, 0x1 adds r2, r4, 0 - bl sub_81ABB4C + bl DisplayItemMessage b @081AD66A .pool @081AD634: @@ -800003,7 +800168,7 @@ display_sell_item_ask_str: ; 81AD5DC adds r0, r7, 0 movs r1, 0x1 adds r2, r4, 0 - bl sub_81ABB4C + bl DisplayItemMessage @081AD66A: pop {r4-r7} pop {r0} @@ -800043,7 +800208,7 @@ sub_81AD680: ; 81AD680 adds r0, r5, 0 movs r1, 0x1 adds r2, r4, 0 - bl sub_81ABB4C + bl DisplayItemMessage pop {r4-r6} pop {r0} bx r0 @@ -800248,7 +800413,7 @@ sub_81AD84C: ; 81AD84C adds r0, r5, 0 movs r1, 0x1 adds r2, r4, 0 - bl sub_81ABB4C + bl DisplayItemMessage pop {r3} mov r8, r3 pop {r4-r6} @@ -800839,7 +801004,7 @@ sub_81ADD98: ; 81ADD98 adds r0, r5, 0 movs r1, 0x1 movs r2, 0 - bl sub_81ABFA8 + bl SwitchBagPocket b @081ADE2C @081ADDEC: movs r0, 0x5 @@ -800864,7 +801029,7 @@ sub_81ADD98: ; 81ADD98 bl sub_81AE6C8 bl sub_81ADD00 adds r0, r5, 0 - bl task_close_bag_menu_1 + bl sub_81AB8F8 b @081ADE32 @081ADE2C: ldrh r0, [r4, 0x10] @@ -800891,7 +801056,7 @@ sub_81ADE38: ; 81ADE38 strh r0, [r1] bl sub_81ACE38 adds r0, r4, 0 - bl task_close_bag_menu_1 + bl sub_81AB8F8 pop {r4} pop {r0} bx r0 @@ -800926,7 +801091,7 @@ sub_81ADE8C: ; 81ADE8C strh r0, [r1] bl sub_81ACE38 adds r0, r4, 0 - bl task_close_bag_menu_1 + bl sub_81AB8F8 pop {r4} pop {r0} bx r0 @@ -800957,7 +801122,7 @@ sub_81ADEDC: ; 81ADEDC strh r0, [r1] bl sub_81ACE38 adds r0, r4, 0 - bl task_close_bag_menu_1 + bl sub_81AB8F8 pop {r4} pop {r0} bx r0 @@ -801013,7 +801178,7 @@ sub_81ADF20: ; 81ADF20 movs r0, 0x1 adds r1, r4, 0 movs r2, 0x40 - bl sub_81DB35C + bl GetStringCenterAlignXOffset lsls r3, r0, 24 lsrs r3, 24 movs r7, 0x1 @@ -801035,7 +801200,7 @@ sub_81ADF20: ; 81ADF20 movs r0, 0x1 mov r1, r8 movs r2, 0x40 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r3, r0, 0 adds r3, 0x40 lsls r3, 24 @@ -801200,7 +801365,7 @@ sub_81AE0BC: ; 81AE0BC str r4, [sp, 0xC] str r2, [sp, 0x10] mov r2, r9 - bl sub_8199EEC + bl AddTextPrinterParametrized2 add sp, 0x14 pop {r3,r4} mov r8, r3 @@ -801291,8 +801456,9 @@ sub_81AE184: ; 81AE184 .pool thumb_func_end sub_81AE184 - thumb_func_start sub_81AE1C4 -sub_81AE1C4: ; 81AE1C4 + thumb_func_start AddItemMessageWindow +; u8 AddItemMessageWindow(u8 a1) +AddItemMessageWindow: ; 81AE1C4 push {r4,lr} lsls r0, 24 lsrs r2, r0, 24 @@ -801316,7 +801482,7 @@ sub_81AE1C4: ; 81AE1C4 pop {r1} bx r1 .pool - thumb_func_end sub_81AE1C4 + thumb_func_end AddItemMessageWindow thumb_func_start sub_81AE1F8 sub_81AE1F8: ; 81AE1F8 @@ -801824,6 +801990,7 @@ sub_81AE5B0: ; 81AE5B0 thumb_func_end sub_81AE5B0 thumb_func_start sub_81AE604 +; int sub_81AE604(u8 taskId) sub_81AE604: ; 81AE604 push {lr} lsls r0, 24 @@ -801995,7 +802162,7 @@ sub_81AE70C: ; 81AE70C movs r2, 0 bl calls_printshopbuyprice adds r0, r4, 0 - bl sub_81AEB20 + bl DrawListMenuCursor ldrb r0, [r4, 0x10] movs r1, 0x2 bl CopyWindowToVram @@ -802306,7 +802473,7 @@ calls_per_item_funcs_in_list: ; 81AE8D4 movs r2, 0 bl calls_printshopbuyprice adds r0, r7, 0 - bl sub_81AEB20 + bl DrawListMenuCursor adds r0, r7, 0 movs r1, 0x1 bl calls_printshopitemdescription @@ -802320,6 +802487,7 @@ calls_per_item_funcs_in_list: ; 81AE8D4 thumb_func_end calls_per_item_funcs_in_list thumb_func_start sub_81AE9B4 +; int sub_81AE9B4(int a1, u8 *str, u8 x, u8 y) sub_81AE9B4: ; 81AE9B4 push {r4-r7,lr} sub sp, 0x18 @@ -802365,7 +802533,7 @@ sub_81AE9B4: ; 81AE9B4 str r6, [sp, 0x10] adds r2, r7, 0 mov r3, r12 - bl sub_8199EEC + bl AddTextPrinterParametrized2 ldrb r1, [r5, 0x3] movs r0, 0x7F ands r0, r1 @@ -802402,7 +802570,7 @@ sub_81AE9B4: ; 81AE9B4 str r6, [sp, 0x10] adds r2, r7, 0 mov r3, r12 - bl sub_8199EEC + bl AddTextPrinterParametrized2 @081AEA5E: add sp, 0x18 pop {r4-r7} @@ -802508,8 +802676,8 @@ calls_printshopbuyprice: ; 81AEA68 bx r0 thumb_func_end calls_printshopbuyprice - thumb_func_start sub_81AEB20 -sub_81AEB20: ; 81AEB20 + thumb_func_start DrawListMenuCursor +DrawListMenuCursor: ; 81AEB20 push {r4-r7,lr} mov r7, r8 push {r7} @@ -802627,7 +802795,7 @@ sub_81AEB20: ; 81AEB20 pop {r4-r7} pop {r0} bx r0 - thumb_func_end sub_81AEB20 + thumb_func_end DrawListMenuCursor thumb_func_start sub_81AEC18 sub_81AEC18: ; 81AEC18 @@ -802745,8 +802913,9 @@ sub_81AEC78: ; 81AEC78 bx r0 thumb_func_end sub_81AEC78 - thumb_func_start sub_81AED00 -sub_81AED00: ; 81AED00 + thumb_func_start ListMenuUpdateSelectedRowIndexAndScrollOffset +; u8 ListMenuUpdateSelectedRowIndexAndScrollOffset(int, BOOL goingDown) +ListMenuUpdateSelectedRowIndexAndScrollOffset: ; 81AED00 push {r4-r6,lr} adds r4, r0, 0 lsls r1, 24 @@ -802883,7 +803052,7 @@ sub_81AED00: ; 81AED00 pop {r4-r6} pop {r1} bx r1 - thumb_func_end sub_81AED00 + thumb_func_end ListMenuUpdateSelectedRowIndexAndScrollOffset thumb_func_start sub_81AEDF0 sub_81AEDF0: ; 81AEDF0 @@ -803081,7 +803250,7 @@ sub_81AEF28: ; 81AEF28 @081AEF76: adds r0, r4, 0 mov r1, r9 - bl sub_81AED00 + bl ListMenuUpdateSelectedRowIndexAndScrollOffset lsls r0, 24 lsrs r0, 24 orrs r5, r0 @@ -803110,7 +803279,7 @@ sub_81AEF28: ; 81AEF28 mov r1, r10 bl sub_81AEC78 adds r0, r4, 0 - bl sub_81AEB20 + bl DrawListMenuCursor adds r0, r4, 0 movs r1, 0 bl calls_printshopitemdescription @@ -803127,7 +803296,7 @@ sub_81AEF28: ; 81AEF28 mov r2, r9 bl sub_81AEDF0 adds r0, r4, 0 - bl sub_81AEB20 + bl DrawListMenuCursor adds r0, r4, 0 movs r1, 0 bl calls_printshopitemdescription @@ -804003,6 +804172,7 @@ sub_81AF680: ; 81AF680 thumb_func_end sub_81AF680 thumb_func_start sub_81AF69C +; void sub_81AF69C(u8 taskId, u16 x, u16 y, u32 a4) sub_81AF69C: ; 81AF69C push {lr} lsls r0, 24 @@ -804373,6 +804543,7 @@ sub_81AF828: ; 81AF828 thumb_func_end sub_81AF828 thumb_func_start sub_81AF994 +; void sub_81AF994(u8 taskId, u16 x, u16 y) sub_81AF994: ; 81AF994 push {r4,r5,lr} lsls r0, 24 @@ -804592,6 +804763,7 @@ sub_81AFA60: ; 81AFA60 thumb_func_end sub_81AFA60 thumb_func_start sub_81AFB68 +; void sub_81AFB68(u8 taskId, u16 x, u16 y) sub_81AFB68: ; 81AFB68 push {r4,r5,lr} lsls r0, 24 @@ -804945,8 +805117,9 @@ sub_81AFDD0: ; 81AFDD0 .pool thumb_func_end sub_81AFDD0 - thumb_func_start sub_81AFDE4 -sub_81AFDE4: ; 81AFDE4 + thumb_func_start AllocItemIconTemporaryBuffers +; BOOL AllocItemIconTemporaryBuffers() +AllocItemIconTemporaryBuffers: ; 81AFDE4 push {r4,r5,lr} ldr r5, =0x0203cebc movs r0, 0x90 @@ -804974,10 +805147,11 @@ sub_81AFDE4: ; 81AFDE4 pop {r4,r5} pop {r1} bx r1 - thumb_func_end sub_81AFDE4 + thumb_func_end AllocItemIconTemporaryBuffers - thumb_func_start sub_81AFE24 -sub_81AFE24: ; 81AFE24 + thumb_func_start FreeItemIconTemporaryBuffers +; void FreeItemIconTemporaryBuffers() +FreeItemIconTemporaryBuffers: ; 81AFE24 push {lr} ldr r0, =0x0203cebc ldr r0, [r0] @@ -804988,10 +805162,11 @@ sub_81AFE24: ; 81AFE24 pop {r0} bx r0 .pool - thumb_func_end sub_81AFE24 + thumb_func_end FreeItemIconTemporaryBuffers - thumb_func_start sub_81AFE44 -sub_81AFE44: ; 81AFE44 + thumb_func_start CopyItemIconPicTo4x4Buffer +; void CopyItemIconPicTo4x4Buffer(void *src, void *dest) +CopyItemIconPicTo4x4Buffer: ; 81AFE44 push {r4-r6,lr} adds r6, r0, 0 adds r5, r1, 0 @@ -805013,9 +805188,10 @@ sub_81AFE44: ; 81AFE44 pop {r4-r6} pop {r0} bx r0 - thumb_func_end sub_81AFE44 + thumb_func_end CopyItemIconPicTo4x4Buffer thumb_func_start AddItemIconObject +; u8 AddItemIconObject(u16 tilesTag, u16 paletteTag, u16 itemId) AddItemIconObject: ; 81AFE70 push {r4-r7,lr} sub sp, 0x10 @@ -805025,20 +805201,20 @@ AddItemIconObject: ; 81AFE70 lsrs r6, r1, 16 lsls r2, 16 lsrs r5, r2, 16 - bl sub_81AFDE4 + bl AllocItemIconTemporaryBuffers lsls r0, 24 cmp r0, 0 beq @081AFF28 adds r0, r5, 0 movs r1, 0 - bl GetItemIconPic + bl GetItemIconPicOrPalette ldr r4, =0x0203cebc ldr r1, [r4] bl LZDecompressWram ldr r0, [r4] ldr r4, =0x0203cec0 ldr r1, [r4] - bl sub_81AFE44 + bl CopyItemIconPicTo4x4Buffer ldr r0, [r4] str r0, [sp] ldr r4, =0xffff0000 @@ -805056,7 +805232,7 @@ AddItemIconObject: ; 81AFE70 bl LoadObjectPic adds r0, r5, 0 movs r1, 0x1 - bl GetItemIconPic + bl GetItemIconPicOrPalette str r0, [sp, 0x8] add r0, sp, 0x8 ldr r1, [r0, 0x4] @@ -805081,7 +805257,7 @@ AddItemIconObject: ; 81AFE70 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - bl sub_81AFE24 + bl FreeItemIconTemporaryBuffers adds r0, r5, 0 bl Free adds r0, r4, 0 @@ -805096,8 +805272,9 @@ AddItemIconObject: ; 81AFE70 bx r1 thumb_func_end AddItemIconObject - thumb_func_start sub_81AFF34 -sub_81AFF34: ; 81AFF34 + thumb_func_start AddItemIconObjectWithCustomObjectTemplate +; u8 AddItemIconObjectWithCustomObjectTemplate(struct objtemplate *objectTemplate, u16 tilesTag, u16 paletteTag, u16 itemId) +AddItemIconObjectWithCustomObjectTemplate: ; 81AFF34 push {r4-r7,lr} mov r7, r8 push {r7} @@ -805109,20 +805286,20 @@ sub_81AFF34: ; 81AFF34 lsrs r6, r2, 16 lsls r3, 16 lsrs r5, r3, 16 - bl sub_81AFDE4 + bl AllocItemIconTemporaryBuffers lsls r0, 24 cmp r0, 0 beq @081AFFEC adds r0, r5, 0 movs r1, 0 - bl GetItemIconPic + bl GetItemIconPicOrPalette ldr r4, =0x0203cebc ldr r1, [r4] bl LZDecompressWram ldr r0, [r4] ldr r4, =0x0203cec0 ldr r1, [r4] - bl sub_81AFE44 + bl CopyItemIconPicTo4x4Buffer ldr r0, [r4] str r0, [sp] ldr r4, =0xffff0000 @@ -805140,7 +805317,7 @@ sub_81AFF34: ; 81AFF34 bl LoadObjectPic adds r0, r5, 0 movs r1, 0x1 - bl GetItemIconPic + bl GetItemIconPicOrPalette str r0, [sp, 0x8] add r0, sp, 0x8 ldr r1, [r0, 0x4] @@ -805165,7 +805342,7 @@ sub_81AFF34: ; 81AFF34 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - bl sub_81AFE24 + bl FreeItemIconTemporaryBuffers adds r0, r5, 0 bl Free adds r0, r4, 0 @@ -805180,10 +805357,11 @@ sub_81AFF34: ; 81AFF34 pop {r4-r7} pop {r1} bx r1 - thumb_func_end sub_81AFF34 + thumb_func_end AddItemIconObjectWithCustomObjectTemplate - thumb_func_start GetItemIconPic -GetItemIconPic: ; 81AFFFC + thumb_func_start GetItemIconPicOrPalette +; u32 GetItemIconPicOrPalette(u16 itemId, u8 which) +GetItemIconPicOrPalette: ; 81AFFFC push {lr} lsls r0, 16 lsrs r3, r0, 16 @@ -805211,7 +805389,7 @@ GetItemIconPic: ; 81AFFFC pop {r1} bx r1 .pool - thumb_func_end GetItemIconPic + thumb_func_end GetItemIconPicOrPalette thumb_func_start sub_81B0038 sub_81B0038: ; 81B0038 @@ -805621,7 +805799,7 @@ sub_81B020C: ; 81B020C bl sub_80D2F04 b @081B0484 @081B03BE: - bl sub_81B0EF4 + bl party_menu_add_per_mon_objects lsls r0, 24 cmp r0, 0 bne @081B03CA @@ -805681,7 +805859,7 @@ sub_81B020C: ; 81B020C ldr r0, [r4] ldrh r0, [r0, 0xA] lsrs r0, 2 - bl sub_81B3054 + bl display_pokemon_menu_message b @081B0484 .pool @081B044C: @@ -806627,7 +806805,7 @@ sub_81B0BFC: ; 81B0BFC cmp r0, 0x3 bne @081B0C56 adds r0, r4, 0 - bl sub_80FD21C + bl CheckIfItemIsTMHMOrEvolutionStone lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -806836,8 +807014,8 @@ sub_81B0DD4: ; 81B0DD4 .pool thumb_func_end sub_81B0DD4 - thumb_func_start sub_81B0DE8 -sub_81B0DE8: ; 81B0DE8 + thumb_func_start party_menu_add_per_mon_objects_internal +party_menu_add_per_mon_objects_internal: ; 81B0DE8 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -806878,16 +807056,16 @@ sub_81B0DE8: ; 81B0DE8 adds r2, r5 movs r3, 0 str r3, [sp] - bl sub_81B5A2C + bl party_menu_link_mon_icon_anim ldrh r0, [r6] ldrh r1, [r6, 0x2] ldr r2, [r4] adds r2, r5 - bl sub_81B5C48 + bl party_menu_link_mon_held_item_object ldrh r0, [r6] ldr r1, [r4] adds r1, r5 - bl sub_81B5EF4 + bl party_menu_link_mon_pokeball_object ldrh r0, [r6, 0x10] cmp r0, 0 bne @081B0E68 @@ -806912,7 +807090,7 @@ sub_81B0DE8: ; 81B0DE8 ldr r2, [r1] adds r2, r5 adds r1, r3, 0 - bl sub_81B6098 + bl party_menu_link_mon_status_condition_object b @081B0EDC .pool @081B0E98: @@ -806932,19 +807110,19 @@ sub_81B0DE8: ; 81B0DE8 adds r1, r5 adds r0, r6, 0 adds r2, r7, 0 - bl sub_81B59B4 + bl party_menu_icon_anim ldr r1, [r4] adds r1, r5 adds r0, r6, 0 - bl sub_81B5C14 + bl party_menu_held_item_object ldr r1, [r4] adds r1, r5 adds r0, r6, 0 - bl sub_81B5ECC + bl party_menu_pokeball_object ldr r1, [r4] adds r1, r5 adds r0, r6, 0 - bl sub_81B6064 + bl party_menu_status_condition_object @081B0EDC: add sp, 0x4 pop {r3-r5} @@ -806955,10 +807133,10 @@ sub_81B0DE8: ; 81B0DE8 pop {r0} bx r0 .pool - thumb_func_end sub_81B0DE8 + thumb_func_end party_menu_add_per_mon_objects_internal - thumb_func_start sub_81B0EF4 -sub_81B0EF4: ; 81B0EF4 + thumb_func_start party_menu_add_per_mon_objects +party_menu_add_per_mon_objects: ; 81B0EF4 push {r4,r5,lr} ldr r5, =0x0203cec4 ldr r0, [r5] @@ -806966,7 +807144,7 @@ sub_81B0EF4: ; 81B0EF4 lsls r4, 2 adds r0, r4 ldrb r0, [r0] - bl sub_81B0DE8 + bl party_menu_add_per_mon_objects_internal ldr r1, [r5] adds r1, r4 ldrh r0, [r1] @@ -806985,7 +807163,7 @@ sub_81B0EF4: ; 81B0EF4 pop {r4,r5} pop {r1} bx r1 - thumb_func_end sub_81B0EF4 + thumb_func_end party_menu_add_per_mon_objects thumb_func_start sub_81B0F28 sub_81B0F28: ; 81B0F28 @@ -808510,8 +808688,9 @@ sub_81B1B00: ; 81B1B00 bx r1 thumb_func_end sub_81B1B00 - thumb_func_start sub_81B1B44 -sub_81B1B44: ; 81B1B44 + thumb_func_start GetMonNickname +; u8 *GetMonNickname(struct pokemon *mon, u8 *dest) +GetMonNickname: ; 81B1B44 push {r4,lr} adds r4, r1, 0 movs r1, 0x2 @@ -808522,7 +808701,7 @@ sub_81B1B44: ; 81B1B44 pop {r4} pop {r1} bx r1 - thumb_func_end sub_81B1B44 + thumb_func_end GetMonNickname thumb_func_start sub_81B1B5C sub_81B1B5C: ; 81B1B5C @@ -808606,7 +808785,7 @@ sub_81B1BE8: ; 81B1BE8 cmp r0, 0x1 beq @081B1C0E movs r0, 0 - bl sub_81B3054 + bl display_pokemon_menu_message ldr r0, =0x03005e00 lsls r1, r4, 2 adds r1, r4 @@ -808652,7 +808831,7 @@ sub_81B1C1C: ; 81B1C1C .pool @081B1C60: movs r0, 0 - bl sub_81B3054 + bl display_pokemon_menu_message ldr r0, =0x03005e00 lsls r1, r5, 2 adds r1, r5 @@ -808678,7 +808857,7 @@ sub_81B1C84: ; 81B1C84 lsls r5, 24 lsrs r5, 24 ldr r1, =0x02021cc4 - bl sub_81B1B44 + bl GetMonNickname ldr r1, =0x02021dc4 adds r0, r4, 0 bl itemid_get_name @@ -808707,7 +808886,7 @@ sub_81B1CD0: ; 81B1CD0 lsls r5, 24 lsrs r5, 24 ldr r1, =0x02021cc4 - bl sub_81B1B44 + bl GetMonNickname ldr r1, =0x02021dc4 adds r0, r4, 0 bl itemid_get_name @@ -808736,7 +808915,7 @@ sub_81B1D1C: ; 81B1D1C lsls r5, 24 lsrs r5, 24 ldr r1, =0x02021cc4 - bl sub_81B1B44 + bl GetMonNickname ldr r1, =0x02021dc4 adds r0, r4, 0 bl itemid_get_name @@ -809129,6 +809308,7 @@ pokemon_ailments_get_primary: ; 81B2014 thumb_func_end pokemon_ailments_get_primary thumb_func_start sub_81B205C +; u8 sub_81B205C(struct pokemon *mon, int a2, void *a3) sub_81B205C: ; 81B205C push {r4,lr} adds r4, r0, 0 @@ -809645,7 +809825,7 @@ sub_81B2428: ; 81B2428 movs r0, 0 adds r1, r5, 0 movs r2, 0x30 - bl sub_81DB35C + bl GetStringCenterAlignXOffset lsls r0, 24 lsrs r2, r0, 24 movs r0, 0 @@ -809660,7 +809840,7 @@ sub_81B2428: ; 81B2428 adds r0, r4, 0 movs r1, 0 movs r3, 0x1 - bl sub_8199EEC + bl AddTextPrinterParametrized2 adds r0, r4, 0 bl PutWindowTilemap adds r0, r4, 0 @@ -809693,7 +809873,7 @@ sub_81B2428: ; 81B2428 movs r0, 0 adds r1, r4, 0 movs r2, 0x30 - bl sub_81DB35C + bl GetStringCenterAlignXOffset lsls r0, 24 lsrs r2, r0, 24 adds r2, r6 @@ -809716,7 +809896,7 @@ sub_81B2428: ; 81B2428 movs r0, 0 adds r1, r4, 0 movs r2, 0x30 - bl sub_81DB35C + bl GetStringCenterAlignXOffset lsls r0, 24 lsrs r2, r0, 24 adds r2, r6 @@ -810354,7 +810534,7 @@ sub_81B2A70: ; 81B2A70 @081B2AAA: adds r0, r7, 0 add r1, sp, 0x8 - bl sub_81B1B44 + bl GetMonNickname ldrb r0, [r6, 0x8] ldr r3, [r6] adds r3, 0x4 @@ -810491,7 +810671,7 @@ sub_81B2B8C: ; 81B2B8C @081B2BBE: adds r0, r6, 0 add r1, sp, 0x8 - bl sub_81B1B44 + bl GetMonNickname adds r0, r6, 0 bl pokemon_get_gender adds r4, r0, 0 @@ -811042,8 +811222,8 @@ sub_81B302C: ; 81B302C bx r0 thumb_func_end sub_81B302C - thumb_func_start sub_81B3054 -sub_81B3054: ; 81B3054 + thumb_func_start display_pokemon_menu_message +display_pokemon_menu_message: ; 81B3054 push {r4-r6,lr} sub sp, 0xC adds r6, r0, 0 @@ -811153,7 +811333,7 @@ sub_81B3054: ; 81B3054 pop {r0} bx r0 .pool - thumb_func_end sub_81B3054 + thumb_func_end display_pokemon_menu_message thumb_func_start sub_81B314C sub_81B314C: ; 81B314C @@ -811338,7 +811518,7 @@ sub_81B31B0: ; 81B31B0 str r1, [sp, 0x10] movs r1, 0x1 mov r2, r9 - bl sub_8199EEC + bl AddTextPrinterParametrized2 adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 @@ -811399,7 +811579,7 @@ sub_81B3300: ; 81B3300 movs r0, 0x6 movs r1, 0x1 adds r2, r4, 0 - bl text_box_related_one + bl AddTextPrinterParametrized add sp, 0x10 pop {r4} pop {r0} @@ -811581,7 +811761,7 @@ sub_81B3414: ; 81B3414 lsrs r7, r0, 24 cmp r7, 0x3 bls @081B3446 - bl sub_81A80A8 + bl InBattlePike lsls r0, 24 cmp r0, 0 bne @081B3518 @@ -811681,7 +811861,7 @@ sub_81B353C: ; 81B353C .4byte @081B35FE .4byte @081B35FA @081B3594: - bl sub_813994C + bl in_multi_battle_room_with_var_condition lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -811765,7 +811945,7 @@ sub_81B3608: ; 81B3608 adds r5, r0, r7 ldr r1, =0x02021cc4 adds r0, r5, 0 - bl sub_81B1B44 + bl GetMonNickname ldr r0, =0x0203cec4 ldr r0, [r0] adds r0, 0xD @@ -811787,7 +811967,7 @@ sub_81B3608: ; 81B3608 movs r0, 0 bl sub_81B31B0 movs r0, 0x15 - bl sub_81B3054 + bl display_pokemon_menu_message b @081B36EA .pool @081B3674: @@ -811834,7 +812014,7 @@ sub_81B3608: ; 81B3608 adds r0, r6, 0 bl itemid_get_name movs r0, 0x1A - bl sub_81B3054 + bl display_pokemon_menu_message @081B36EA: movs r0, 0x1 @081B36EC: @@ -812076,7 +812256,7 @@ brm_switch: ; 81B38DC adds r0, 0xC bl sub_81B302C movs r0, 0x3 - bl sub_81B3054 + bl display_pokemon_menu_message ldrb r0, [r5, 0x9] movs r1, 0x1 bl sub_81B0FCC @@ -812988,7 +813168,7 @@ sub_81B407C: ; 81B407C movs r1, 0x1 bl sub_81B0FCC movs r0, 0 - bl sub_81B3054 + bl display_pokemon_menu_message ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 @@ -813023,12 +813203,12 @@ brm_cancel_1: ; 81B40D4 cmp r0, 0x6 bne @081B4110 movs r0, 0xF - bl sub_81B3054 + bl display_pokemon_menu_message b @081B4116 .pool @081B4110: movs r0, 0 - bl sub_81B3054 + bl display_pokemon_menu_message @081B4116: ldr r0, =0x03005e00 lsls r1, r5, 2 @@ -813066,7 +813246,7 @@ sub_81B4134: ; 81B4134 movs r0, 0x1 bl sub_81B31B0 movs r0, 0x18 - bl sub_81B3054 + bl display_pokemon_menu_message ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 @@ -813105,7 +813285,7 @@ sub_81B4198: ; 81B4198 thumb_func_start sub_81B41C4 sub_81B41C4: ; 81B41C4 push {lr} - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 bne @081B41E0 @@ -813738,7 +813918,7 @@ sub_81B4724: ; 81B4724 @081B4788: ldr r1, =0x02021cc4 adds r0, r5, 0 - bl sub_81B1B44 + bl GetMonNickname ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E9980 adds r0, r4, 0 @@ -813799,7 +813979,7 @@ sub_81B47E0: ; 81B47E0 bne @081B4864 ldr r1, =0x02021cc4 adds r0, r7, 0 - bl sub_81B1B44 + bl GetMonNickname ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E9980 adds r0, r4, 0 @@ -814015,7 +814195,7 @@ sub_81B4A08: ; 81B4A08 movs r0, 0x2 bl sub_81B31B0 movs r0, 0x19 - bl sub_81B3054 + bl display_pokemon_menu_message ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 @@ -814406,7 +814586,7 @@ sub_81B4D78: ; 81B4D78 movs r0, 0 bl sub_81B31B0 movs r0, 0x15 - bl sub_81B3054 + bl display_pokemon_menu_message b @081B4E02 .pool @081B4DE4: @@ -814420,7 +814600,7 @@ sub_81B4D78: ; 81B4D78 ldr r1, =0x02021dc4 bl itemid_get_name movs r0, 0x1A - bl sub_81B3054 + bl display_pokemon_menu_message @081B4E02: ldr r1, =0x03005e00 mov r2, r8 @@ -814540,7 +814720,7 @@ sub_81B4E8C: ; 81B4E8C bl sub_81B4F88 @081B4F04: movs r0, 0 - bl sub_81B3054 + bl display_pokemon_menu_message ldr r0, =sub_81B1370 mov r1, r8 str r0, [r1] @@ -814705,7 +814885,7 @@ sub_81B4FA8: ; 81B4FA8 blt @081B504E @081B5078: movs r0, 0 - bl sub_81B3054 + bl display_pokemon_menu_message ldr r0, =0x03005e00 mov r2, r8 adds r1, r7, r2 @@ -815013,7 +815193,7 @@ sub_81B52E4: ; 81B52E4 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02021cc4 - bl sub_81B1B44 + bl GetMonNickname ldr r4, =0x02021fc4 ldr r1, =gUnknown_085EA1CD adds r0, r4, 0 @@ -815152,7 +815332,7 @@ sub_81B5470: ; 81B5470 lsrs r0, 24 cmp r0, 0x1 beq @081B54C6 - bl in_trade_center + bl InUnionRoom cmp r0, 0x1 bne @081B54E8 @081B54C6: @@ -815163,7 +815343,7 @@ sub_81B5470: ; 81B5470 cmp r0, 0x1 bhi @081B54E4 movs r0, 0xD - bl sub_81B3054 + bl display_pokemon_menu_message b @081B5656 .pool @081B54E4: @@ -815309,7 +815489,7 @@ sub_81B5470: ; 81B5470 @081B5650: ldrb r0, [r5, 0x4] @081B5652: - bl sub_81B3054 + bl display_pokemon_menu_message @081B5656: ldr r0, =0x03005e00 lsls r1, r6, 2 @@ -815512,12 +815692,12 @@ sub_81B57DC: ; 81B57DC cmp r0, 0x1 bne @081B57F8 movs r0, 0xC - bl sub_81B3054 + bl display_pokemon_menu_message b @081B57FE .pool @081B57F8: movs r0, 0xD - bl sub_81B3054 + bl display_pokemon_menu_message @081B57FE: pop {r0} bx r0 @@ -815576,11 +815756,11 @@ sub_81B5864: ; 81B5864 cmp r0, 0 beq @081B587A movs r0, 0x9 - bl sub_81B3054 + bl display_pokemon_menu_message b @081B5880 @081B587A: movs r0, 0x8 - bl sub_81B3054 + bl display_pokemon_menu_message @081B5880: pop {r0} bx r0 @@ -815650,13 +815830,13 @@ hm_prepare_waterfall: ; 81B58F0 adds r4, 0x2 mov r0, sp adds r1, r4, 0 - bl player_get_pos_to_plus_one_step_in_direction_player_is_facing + bl GetXYCoordsOneStepInFrontOfPlayer mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r4, r2] - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 bl MetatileBehavior_IsWaterfall @@ -815729,8 +815909,9 @@ sub_81B5974: ; 81B5974 .pool thumb_func_end sub_81B5974 - thumb_func_start sub_81B59B4 -sub_81B59B4: ; 81B59B4 + thumb_func_start party_menu_icon_anim +; void party_menu_icon_anim(struct pokemon *mon, int a2, int a3) +party_menu_icon_anim: ; 81B59B4 push {r4-r7,lr} sub sp, 0x4 adds r5, r0, 0 @@ -815772,7 +815953,7 @@ sub_81B59B4: ; 81B59B4 adds r0, r4, 0 adds r2, r7, 0 movs r3, 0x1 - bl sub_81B5A2C + bl party_menu_link_mon_icon_anim ldrb r0, [r7, 0x9] adds r1, r5, 0 bl sub_81B5B38 @@ -815781,10 +815962,11 @@ sub_81B59B4: ; 81B59B4 pop {r0} bx r0 .pool - thumb_func_end sub_81B59B4 + thumb_func_end party_menu_icon_anim - thumb_func_start sub_81B5A2C -sub_81B5A2C: ; 81B5A2C + thumb_func_start party_menu_link_mon_icon_anim +; void party_menu_link_mon_icon_anim(u16 speciesId, u32 personality, int a3, char a4, int a5) +party_menu_link_mon_icon_anim: ; 81B5A2C push {r4-r7,lr} sub sp, 0xC adds r6, r1, 0 @@ -815829,7 +816011,7 @@ sub_81B5A2C: ; 81B5A2C pop {r0} bx r0 .pool - thumb_func_end sub_81B5A2C + thumb_func_end party_menu_link_mon_icon_anim thumb_func_start sub_81B5A8C sub_81B5A8C: ; 81B5A8C @@ -816026,8 +816208,8 @@ sub_81B5C08: ; 81B5C08 bx r0 thumb_func_end sub_81B5C08 - thumb_func_start sub_81B5C14 -sub_81B5C14: ; 81B5C14 + thumb_func_start party_menu_held_item_object +party_menu_held_item_object: ; 81B5C14 push {r4,r5,lr} adds r5, r0, 0 adds r4, r1, 0 @@ -816050,10 +816232,10 @@ sub_81B5C14: ; 81B5C14 pop {r0} bx r0 .pool - thumb_func_end sub_81B5C14 + thumb_func_end party_menu_held_item_object - thumb_func_start sub_81B5C48 -sub_81B5C48: ; 81B5C48 + thumb_func_start party_menu_link_mon_held_item_object +party_menu_link_mon_held_item_object: ; 81B5C48 push {r4,r5,lr} adds r4, r2, 0 lsls r0, 16 @@ -816087,7 +816269,7 @@ sub_81B5C48: ; 81B5C48 pop {r0} bx r0 .pool - thumb_func_end sub_81B5C48 + thumb_func_end party_menu_link_mon_held_item_object thumb_func_start sub_81B5C94 sub_81B5C94: ; 81B5C94 @@ -816373,8 +816555,8 @@ sub_81B5E74: ; 81B5E74 bx r0 thumb_func_end sub_81B5E74 - thumb_func_start sub_81B5ECC -sub_81B5ECC: ; 81B5ECC + thumb_func_start party_menu_pokeball_object +party_menu_pokeball_object: ; 81B5ECC push {r4,lr} adds r4, r1, 0 movs r1, 0xB @@ -816393,10 +816575,10 @@ sub_81B5ECC: ; 81B5ECC pop {r0} bx r0 .pool - thumb_func_end sub_81B5ECC + thumb_func_end party_menu_pokeball_object - thumb_func_start sub_81B5EF4 -sub_81B5EF4: ; 81B5EF4 + thumb_func_start party_menu_link_mon_pokeball_object +party_menu_link_mon_pokeball_object: ; 81B5EF4 push {r4,lr} adds r4, r1, 0 lsls r0, 16 @@ -816425,7 +816607,7 @@ sub_81B5EF4: ; 81B5EF4 pop {r0} bx r0 .pool - thumb_func_end sub_81B5EF4 + thumb_func_end party_menu_link_mon_pokeball_object thumb_func_start sub_81B5F34 sub_81B5F34: ; 81B5F34 @@ -816575,8 +816757,8 @@ sub_81B6040: ; 81B6040 .pool thumb_func_end sub_81B6040 - thumb_func_start sub_81B6064 -sub_81B6064: ; 81B6064 + thumb_func_start party_menu_status_condition_object +party_menu_status_condition_object: ; 81B6064 push {r4,r5,lr} adds r5, r0, 0 adds r4, r1, 0 @@ -816593,16 +816775,16 @@ sub_81B6064: ; 81B6064 strb r0, [r4, 0xC] adds r0, r5, 0 adds r1, r4, 0 - bl sub_81B60E4 + bl party_menu_get_status_condition_and_update_object @081B608C: pop {r4,r5} pop {r0} bx r0 .pool - thumb_func_end sub_81B6064 + thumb_func_end party_menu_status_condition_object - thumb_func_start sub_81B6098 -sub_81B6098: ; 81B6098 + thumb_func_start party_menu_link_mon_status_condition_object +party_menu_link_mon_status_condition_object: ; 81B6098 push {r4,r5,lr} adds r4, r2, 0 lsls r0, 16 @@ -816619,7 +816801,7 @@ sub_81B6098: ; 81B6098 strb r0, [r4, 0xC] adds r0, r5, 0 adds r1, r4, 0 - bl sub_81B60FC + bl party_menu_update_status_condition_object ldr r2, =0x02020630 ldrb r0, [r4, 0xC] lsls r1, r0, 4 @@ -816636,24 +816818,26 @@ sub_81B6098: ; 81B6098 pop {r0} bx r0 .pool - thumb_func_end sub_81B6098 + thumb_func_end party_menu_link_mon_status_condition_object - thumb_func_start sub_81B60E4 -sub_81B60E4: ; 81B60E4 + thumb_func_start party_menu_get_status_condition_and_update_object +; void party_menu_get_status_condition_and_update_object(struct pokemon *mon, void *a2, void *a3) +party_menu_get_status_condition_and_update_object: ; 81B60E4 push {r4,lr} adds r4, r1, 0 bl sub_81B205C lsls r0, 24 lsrs r0, 24 adds r1, r4, 0 - bl sub_81B60FC + bl party_menu_update_status_condition_object pop {r4} pop {r0} bx r0 - thumb_func_end sub_81B60E4 + thumb_func_end party_menu_get_status_condition_and_update_object - thumb_func_start sub_81B60FC -sub_81B60FC: ; 81B60FC + thumb_func_start party_menu_update_status_condition_object +; void party_menu_update_status_condition_object(u8 a1, void *a2) +party_menu_update_status_condition_object: ; 81B60FC push {r4,r5,lr} adds r5, r1, 0 lsls r0, 24 @@ -816702,7 +816886,7 @@ sub_81B60FC: ; 81B60FC pop {r0} bx r0 .pool - thumb_func_end sub_81B60FC + thumb_func_end party_menu_update_status_condition_object thumb_func_start sub_81B6160 sub_81B6160: ; 81B6160 @@ -816749,7 +816933,7 @@ sub_81B617C: ; 81B617C @081B61C0: ldr r4, =0x0203ce7c ldrh r0, [r4] - bl sub_81B7CEC + bl GetItemEffectType lsls r0, 24 lsrs r0, 24 cmp r0, 0xA @@ -816818,7 +817002,7 @@ sub_81B617C: ; 81B617C thumb_func_start c2_815ABFC c2_815ABFC: ; 81B6254 push {lr} - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 cmp r0, 0 bne @081B626C @@ -816871,8 +817055,9 @@ sub_81B6280: ; 81B6280 .pool thumb_func_end sub_81B6280 - thumb_func_start sub_81B62D0 -sub_81B62D0: ; 81B62D0 + thumb_func_start IsHPRecoveryItem +; BOOL IsHPRecoveryItem(u16 itemId) +IsHPRecoveryItem: ; 81B62D0 push {lr} lsls r0, 16 lsrs r0, 16 @@ -816904,14 +817089,15 @@ sub_81B62D0: ; 81B62D0 @081B630A: pop {r1} bx r1 - thumb_func_end sub_81B62D0 + thumb_func_end IsHPRecoveryItem - thumb_func_start sub_81B6310 -sub_81B6310: ; 81B6310 + thumb_func_start GetMedicineItemEffectMessage +; void GetMedicineItemEffectMessage(u16 itemId) +GetMedicineItemEffectMessage: ; 81B6310 push {lr} lsls r0, 16 lsrs r0, 16 - bl sub_81B7CEC + bl GetItemEffectType lsls r0, 24 lsrs r0, 24 subs r0, 0x3 @@ -817049,15 +817235,16 @@ sub_81B6310: ; 81B6310 pop {r0} bx r0 .pool - thumb_func_end sub_81B6310 + thumb_func_end GetMedicineItemEffectMessage - thumb_func_start sub_81B64D0 -sub_81B64D0: ; 81B64D0 + thumb_func_start UsingHPEVItemOnShedinja +; BOOL UsingHPEVItemOnShedinja(struct pokemon *mon, u16 itemId) +UsingHPEVItemOnShedinja: ; 81B64D0 push {r4,lr} adds r4, r0, 0 lsls r0, r1, 16 lsrs r0, 16 - bl sub_81B7CEC + bl GetItemEffectType lsls r0, 24 lsrs r0, 24 cmp r0, 0xD @@ -817077,10 +817264,11 @@ sub_81B64D0: ; 81B64D0 pop {r4} pop {r1} bx r1 - thumb_func_end sub_81B64D0 + thumb_func_end UsingHPEVItemOnShedinja - thumb_func_start sub_81B6504 -sub_81B6504: ; 81B6504 + thumb_func_start IsBlueYellowRedFlute +; BOOL IsBlueYellowRedFlute(u16 itemId) +IsBlueYellowRedFlute: ; 81B6504 push {lr} lsls r0, 16 lsrs r0, 16 @@ -817098,10 +817286,11 @@ sub_81B6504: ; 81B6504 @081B651C: pop {r1} bx r1 - thumb_func_end sub_81B6504 + thumb_func_end IsBlueYellowRedFlute - thumb_func_start sub_81B6520 -sub_81B6520: ; 81B6520 + thumb_func_start ExecuteTableBasedItemEffect__ +; BOOL ExecuteTableBasedItemEffect__(u8 partyMonIndex, u16 itemId, u8 monMoveIndex) +ExecuteTableBasedItemEffect__: ; 81B6520 push {r4-r6,lr} lsls r0, 24 lsrs r3, r0, 24 @@ -817140,17 +817329,17 @@ sub_81B6520: ; 81B6520 adds r1, r5, 0 @081B6572: adds r3, r6, 0 - bl sub_806BD04 + bl ExecuteTableBasedItemEffect_ lsls r0, 24 lsrs r0, 24 pop {r4-r6} pop {r1} bx r1 .pool - thumb_func_end sub_81B6520 + thumb_func_end ExecuteTableBasedItemEffect__ - thumb_func_start sub_81B6588 -sub_81B6588: ; 81B6588 + thumb_func_start ItemUseCB_Medicine +ItemUseCB_Medicine: ; 81B6588 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -817174,12 +817363,12 @@ sub_81B6588: ; 81B6588 ldrh r6, [r0] adds r0, r5, 0 adds r1, r6, 0 - bl sub_81B64D0 + bl UsingHPEVItemOnShedinja lsls r0, 24 cmp r0, 0 beq @081B6600 adds r0, r6, 0 - bl sub_81B62D0 + bl IsHPRecoveryItem lsls r0, 24 lsrs r0, 24 mov r8, r0 @@ -817203,7 +817392,7 @@ sub_81B6588: ; 81B6588 ldrb r0, [r4, 0x9] adds r1, r6, 0 movs r2, 0 - bl sub_81B6520 + bl ExecuteTableBasedItemEffect__ lsls r0, 24 cmp r0, 0 beq @081B6624 @@ -817221,7 +817410,7 @@ sub_81B6588: ; 81B6588 movs r0, 0x1 strb r0, [r1] adds r0, r6, 0 - bl sub_81B6504 + bl IsBlueYellowRedFlute lsls r0, 24 cmp r0, 0 bne @081B6650 @@ -817247,7 +817436,7 @@ sub_81B6588: ; 81B6588 ldr r1, [r4] adds r1, r0 adds r0, r5, 0 - bl sub_81B60E4 + bl party_menu_get_status_condition_and_update_object ldr r2, =0x02020630 movs r0, 0x9 ldrsb r0, [r7, r0] @@ -817302,9 +817491,9 @@ sub_81B6588: ; 81B6588 @081B66E4: ldr r1, =0x02021cc4 adds r0, r5, 0 - bl sub_81B1B44 + bl GetMonNickname adds r0, r6, 0 - bl sub_81B6310 + bl GetMedicineItemEffectMessage ldr r0, =0x02021fc4 @081B66F4: movs r1, 0x1 @@ -817329,7 +817518,7 @@ sub_81B6588: ; 81B6588 pop {r0} bx r0 .pool - thumb_func_end sub_81B6588 + thumb_func_end ItemUseCB_Medicine thumb_func_start sub_81B672C sub_81B672C: ; 81B672C @@ -817345,7 +817534,7 @@ sub_81B672C: ; 81B672C ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02021cc4 - bl sub_81B1B44 + bl GetMonNickname ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E9C17 adds r0, r4, 0 @@ -817418,7 +817607,7 @@ sub_81B67C8: ; 81B67C8 ldr r0, =0x0203ce7c ldrh r6, [r0] adds r0, r6, 0 - bl sub_81B7CEC + bl GetItemEffectType lsls r0, 24 lsrs r7, r0, 24 adds r0, r5, 0 @@ -817436,7 +817625,7 @@ sub_81B67C8: ; 81B67C8 ldrb r0, [r4, 0x9] adds r1, r6, 0 movs r2, 0 - bl sub_81B6520 + bl ExecuteTableBasedItemEffect__ adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 @@ -817480,7 +817669,7 @@ sub_81B67C8: ; 81B67C8 bl sub_80D6AA4 ldr r1, =0x02021cc4 adds r0, r5, 0 - bl sub_81B1B44 + bl GetMonNickname ldr r1, =0x02021dc4 adds r0, r7, 0 bl option_menu_get_string @@ -817734,8 +817923,8 @@ sub_81B6A10: ; 81B6A10 .pool thumb_func_end sub_81B6A10 - thumb_func_start sub_81B6AB4 -sub_81B6AB4: ; 81B6AB4 + thumb_func_start ether_effect_related_3 +ether_effect_related_3: ; 81B6AB4 push {r4,r5,lr} lsls r0, 24 lsrs r4, r0, 24 @@ -817761,13 +817950,13 @@ sub_81B6AB4: ; 81B6AB4 adds r0, 0xD bl sub_81B302C adds r0, r5, 0 - bl sub_81B6B80 + bl ether_effect_related_2 @081B6AF0: pop {r4,r5} pop {r0} bx r0 .pool - thumb_func_end sub_81B6AB4 + thumb_func_end ether_effect_related_3 thumb_func_start dp05_ether dp05_ether: ; 81B6AFC @@ -817801,14 +817990,14 @@ dp05_ether: ; 81B6AFC ldr r0, =0x0203cec8 strh r1, [r0, 0xE] adds r0, r4, 0 - bl sub_81B6BEC + bl ether_effect_related b @081B6B6E .pool @081B6B4C: movs r0, 0x5 bl audio_play movs r0, 0x16 - bl sub_81B3054 + bl display_pokemon_menu_message ldr r0, =0x0203cec8 ldrb r0, [r0, 0x9] bl sub_81B6A10 @@ -817817,7 +818006,7 @@ dp05_ether: ; 81B6AFC adds r0, r4 lsls r0, 3 adds r0, r1 - ldr r1, =sub_81B6AB4 + ldr r1, =ether_effect_related_3 str r1, [r0] @081B6B6E: pop {r4} @@ -817826,8 +818015,8 @@ dp05_ether: ; 81B6AFC .pool thumb_func_end dp05_ether - thumb_func_start sub_81B6B80 -sub_81B6B80: ; 81B6B80 + thumb_func_start ether_effect_related_2 +ether_effect_related_2: ; 81B6B80 push {r4,lr} adds r4, r0, 0 lsls r4, 24 @@ -817842,12 +818031,12 @@ sub_81B6B80: ; 81B6B80 lsrs r0, 24 strh r0, [r1, 0xE] adds r0, r4, 0 - bl sub_81B6BEC + bl ether_effect_related pop {r4} pop {r0} bx r0 .pool - thumb_func_end sub_81B6B80 + thumb_func_end ether_effect_related_2 thumb_func_start sub_81B6BB4 sub_81B6BB4: ; 81B6BB4 @@ -817868,14 +818057,14 @@ sub_81B6BB4: ; 81B6BB4 adds r0, 0xC bl sub_81B302C movs r0, 0x5 - bl sub_81B3054 + bl display_pokemon_menu_message pop {r0} bx r0 .pool thumb_func_end sub_81B6BB4 - thumb_func_start sub_81B6BEC -sub_81B6BEC: ; 81B6BEC + thumb_func_start ether_effect_related +ether_effect_related: ; 81B6BEC push {r4-r7,lr} mov r7, r8 push {r7} @@ -817892,7 +818081,7 @@ sub_81B6BEC: ; 81B6BEC ldrb r0, [r0, 0x9] ldrb r2, [r7] adds r1, r5, 0 - bl sub_81B6520 + bl ExecuteTableBasedItemEffect__ lsls r0, 24 cmp r0, 0 beq @081B6C34 @@ -817934,7 +818123,7 @@ sub_81B6BEC: ; 81B6BEC adds r1, r2 bl CopyString adds r0, r5, 0 - bl sub_81B6310 + bl GetMedicineItemEffectMessage ldr r0, =0x02021fc4 @081B6C7E: movs r1, 0x1 @@ -817954,7 +818143,7 @@ sub_81B6BEC: ; 81B6BEC pop {r0} bx r0 .pool - thumb_func_end sub_81B6BEC + thumb_func_end ether_effect_related thumb_func_start dp05_pp_up dp05_pp_up: ; 81B6CC0 @@ -817965,7 +818154,7 @@ dp05_pp_up: ; 81B6CC0 movs r0, 0x5 bl audio_play movs r0, 0x17 - bl sub_81B3054 + bl display_pokemon_menu_message ldr r0, =0x0203cec8 ldrb r0, [r0, 0x9] bl sub_81B6A10 @@ -817974,7 +818163,7 @@ dp05_pp_up: ; 81B6CC0 adds r0, r4 lsls r0, 3 adds r0, r1 - ldr r1, =sub_81B6AB4 + ldr r1, =ether_effect_related_3 str r1, [r0] pop {r4} pop {r0} @@ -818116,7 +818305,7 @@ sub_81B6DC4: ; 81B6DC4 ldrh r4, [r0] ldr r1, =0x02021cc4 adds r0, r5, 0 - bl sub_81B1B44 + bl GetMonNickname adds r0, r4, 0 bl sub_81B6CFC strh r0, [r7, 0xE] @@ -818220,7 +818409,7 @@ sub_81B6EB4: ; 81B6EB4 @081B6EF0: ldr r1, =0x02021cc4 adds r0, r5, 0 - bl sub_81B1B44 + bl GetMonNickname ldr r0, =0x02021dc4 movs r1, 0 ldrsh r2, [r6, r1] @@ -818518,7 +818707,7 @@ sub_81B7154: ; 81B7154 lsrs r4, 16 ldr r1, =0x02021cc4 adds r0, r5, 0 - bl sub_81B1B44 + bl GetMonNickname ldr r0, =0x02021dc4 movs r1, 0xD muls r1, r4 @@ -818675,7 +818864,7 @@ sub_81B72C8: ; 81B72C8 @081B7306: ldr r1, =0x02021cc4 adds r0, r4, 0 - bl sub_81B1B44 + bl GetMonNickname ldr r0, =0x02021dc4 movs r1, 0xE ldrsh r2, [r7, r1] @@ -818725,7 +818914,7 @@ sub_81B72C8: ; 81B72C8 @081B7392: ldr r1, =0x02021cc4 adds r0, r4, 0 - bl sub_81B1B44 + bl GetMonNickname ldr r0, =0x02021dc4 ldr r1, =0x0203cec8 movs r3, 0xE @@ -818807,7 +818996,7 @@ dp05_rare_candy: ; 81B7404 mov r2, r8 ldrh r1, [r2] movs r2, 0 - bl sub_81B6520 + bl ExecuteTableBasedItemEffect__ lsls r0, 24 lsrs r4, r0, 24 movs r0, 0x89 @@ -818856,7 +819045,7 @@ dp05_rare_candy: ; 81B7404 bl sub_80D6AA4 ldr r1, =0x02021cc4 adds r0, r5, 0 - bl sub_81B1B44 + bl GetMonNickname ldr r4, =0x02021dc4 adds r0, r5, 0 movs r1, 0x38 @@ -818905,7 +819094,7 @@ sub_81B754C: ; 81B754C ldr r1, [r6] adds r1, r4 adds r0, r5, 0 - bl sub_81B60E4 + bl party_menu_get_status_condition_and_update_object ldr r2, =0x02020630 ldr r0, [r6] adds r3, r4, r0 @@ -819288,7 +819477,7 @@ sub_81B787C: ; 81B787C ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02021cc4 - bl sub_81B1B44 + bl GetMonNickname ldr r0, =0x02021dc4 ldr r6, =0x020244e2 ldrh r2, [r6] @@ -819344,7 +819533,7 @@ sub_81B7910: ; 81B7910 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02021cc4 - bl sub_81B1B44 + bl GetMonNickname ldr r0, =0x02021dc4 movs r1, 0xD muls r1, r5 @@ -819470,7 +819659,7 @@ sub_81B7A28: ; 81B7A28 ldr r1, =0x0203ce7c ldrh r1, [r1] movs r2, 0 - bl sub_81B6520 + bl ExecuteTableBasedItemEffect__ lsls r0, 24 cmp r0, 0 beq @081B7A94 @@ -819494,7 +819683,7 @@ sub_81B7A28: ; 81B7A28 ldr r1, [r4] adds r1, r0 adds r0, r5, 0 - bl sub_81B60E4 + bl party_menu_get_status_condition_and_update_object ldr r2, =0x02020630 movs r0, 0x9 ldrsb r0, [r6, r0] @@ -819659,7 +819848,7 @@ sub_81B7C10: ; 81B7C10 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02021cc4 - bl sub_81B1B44 + bl GetMonNickname ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E9C17 adds r0, r4, 0 @@ -819698,7 +819887,7 @@ sub_81B7C74: ; 81B7C74 ldr r4, =0x0203ce7c ldrh r1, [r4] movs r2, 0 - bl sub_81B6520 + bl ExecuteTableBasedItemEffect__ lsls r0, 24 cmp r0, 0 beq @081B7CD8 @@ -819729,8 +819918,9 @@ sub_81B7C74: ; 81B7C74 bx r0 thumb_func_end sub_81B7C74 - thumb_func_start sub_81B7CEC -sub_81B7CEC: ; 81B7CEC + thumb_func_start GetItemEffectType +; u8 GetItemEffectType(u16 itemId) +GetItemEffectType: ; 81B7CEC push {r4,r5,lr} lsls r0, 16 lsrs r1, r0, 16 @@ -819930,7 +820120,7 @@ sub_81B7CEC: ; 81B7CEC pop {r4,r5} pop {r1} bx r1 - thumb_func_end sub_81B7CEC + thumb_func_end GetItemEffectType thumb_func_start sub_81B7E4C sub_81B7E4C: ; 81B7E4C @@ -819957,7 +820147,7 @@ sub_81B7E4C: ; 81B7E4C mov r8, r0 ldr r1, =0x02021cc4 adds r0, r5, 0 - bl sub_81B1B44 + bl GetMonNickname ldr r4, =0x020375e2 ldrb r0, [r4] bl sub_81B2360 @@ -820024,8 +820214,8 @@ sub_81B7E4C: ; 81B7E4C .pool thumb_func_end sub_81B7E4C - thumb_func_start sub_81B7F34 -sub_81B7F34: ; 81B7F34 + thumb_func_start CB2_PartyMenuFromStartMenu +CB2_PartyMenuFromStartMenu: ; 81B7F34 push {lr} sub sp, 0xC movs r0, 0 @@ -820043,13 +820233,13 @@ sub_81B7F34: ; 81B7F34 pop {r0} bx r0 .pool - thumb_func_end sub_81B7F34 + thumb_func_end CB2_PartyMenuFromStartMenu thumb_func_start sub_81B7F60 sub_81B7F60: ; 81B7F60 push {lr} sub sp, 0xC - bl sub_81A9E40 + bl InBattlePyramid lsls r0, 24 ldr r1, =sub_81C4F84 cmp r0, 0 @@ -821017,7 +821207,7 @@ sub_81B879C: ; 81B879C movs r0, 0x20 bl audio_play adds r0, r4, 0 - bl sub_81B3054 + bl display_pokemon_menu_message ldr r0, =0x03005e00 lsls r1, r5, 2 adds r1, r5 @@ -821057,7 +821247,7 @@ sub_81B87E8: ; 81B87E8 movs r0, 0x5 bl audio_play movs r0, 0 - bl sub_81B3054 + bl display_pokemon_menu_message ldr r0, =0x03005e00 lsls r1, r4, 2 adds r1, r4 @@ -821413,7 +821603,7 @@ sub_81B8A7C: ; 81B8A7C bne @081B8AF8 ldr r1, =0x02021cc4 adds r0, r4, 0 - bl sub_81B1B44 + bl GetMonNickname ldr r0, =0x02021fc4 ldr r1, =gUnknown_085E978F b @081B8C42 @@ -821474,7 +821664,7 @@ sub_81B8A7C: ; 81B8A7C bne @081B8B94 ldr r1, =0x02021cc4 adds r0, r6, 0 - bl sub_81B1B44 + bl GetMonNickname ldr r0, =0x02021fc4 ldr r1, =gUnknown_085E976F b @081B8C42 @@ -821524,7 +821714,7 @@ sub_81B8A7C: ; 81B8A7C ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02021cc4 - bl sub_81B1B44 + bl GetMonNickname ldr r0, =0x02021fc4 ldr r1, =gUnknown_085E9754 b @081B8C42 @@ -821542,7 +821732,7 @@ sub_81B8A7C: ; 81B8A7C muls r0, r7 add r0, r8 ldr r1, =0x02021cc4 - bl sub_81B1B44 + bl GetMonNickname ldr r0, =0x02021fc4 ldr r1, =gUnknown_085E9738 @081B8C42: @@ -822924,7 +823114,7 @@ sub_81B9718: ; 81B9718 lsrs r4, 16 ldr r1, =0x02021cc4 adds r0, r5, 0 - bl sub_81B1B44 + bl GetMonNickname ldr r0, =0x02021dc4 movs r1, 0xD muls r1, r4 @@ -831495,7 +831685,7 @@ sp136_strengh_sound: ; 81BE89C mov r0, r8 strh r0, [r1, 0x10] movs r0, 0 - bl sub_808A2C0 + bl SetCameraPanningCallback movs r0, 0xD6 bl audio_play pop {r3} @@ -831540,7 +831730,7 @@ sub_81BE900: ; 81BE900 ldrsh r0, [r4, r1] movs r2, 0x8 ldrsh r1, [r4, r2] - bl sub_808A2CC + bl SetCameraPanning movs r1, 0x4 ldrsh r0, [r4, r1] cmp r0, 0 @@ -831548,7 +831738,7 @@ sub_81BE900: ; 81BE900 bl sub_81BE968 adds r0, r5, 0 bl remove_task - bl sub_808A2E4 + bl InstallCameraPanAheadCallback @081BE95C: pop {r4,r5} pop {r0} @@ -831791,13 +831981,13 @@ sub_81BEB24: ; 81BEB24 ldrb r1, [r2, 0x1] adds r1, 0x7 ldrh r2, [r2, 0x2] - bl setmaptile_0 + bl MapGridSetMetatileIdAt adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x11 bls @081BEB2A - bl cur_mapdata_full_redraw + bl DrawWholeMapView pop {r4,r5} pop {r0} bx r0 @@ -834691,7 +834881,7 @@ sub_81C0510: ; 81C0510 ands r0, r1 cmp r0, 0 bne @081C0576 - bl sub_81220D0 + bl GetLRKeysState lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -834708,7 +834898,7 @@ sub_81C0510: ; 81C0510 ands r0, r1 cmp r0, 0 bne @081C0598 - bl sub_81220D0 + bl GetLRKeysState lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 @@ -836796,7 +836986,7 @@ sub_81C174C: ; 81C174C ands r0, r1 cmp r0, 0 bne @081C17F0 - bl sub_81220D0 + bl GetLRKeysState lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -836813,7 +837003,7 @@ sub_81C174C: ; 81C174C ands r0, r1 cmp r0, 0 bne @081C1812 - bl sub_81220D0 + bl GetLRKeysState lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 @@ -837022,7 +837212,7 @@ sub_81C1940: ; 81C1940 ands r0, r1 cmp r0, 0 bne @081C19F0 - bl sub_81220D0 + bl GetLRKeysState lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -837080,7 +837270,7 @@ sub_81C1940: ; 81C1940 ands r0, r1 cmp r0, 0 bne @081C1A7A - bl sub_81220D0 + bl GetLRKeysState lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 @@ -838464,7 +838654,7 @@ sub_81C25A4: ; 81C25A4 str r6, [sp, 0xC] str r1, [sp, 0x10] movs r1, 0x1 - bl sub_8199EEC + bl AddTextPrinterParametrized2 add sp, 0x14 pop {r4-r6} pop {r0} @@ -838608,7 +838798,7 @@ sub_81C2628: ; 81C2628 bl sub_81C25A4 mov r0, r8 adds r1, r4, 0 - bl sub_81B1B44 + bl GetMonNickname str r6, [sp] str r5, [sp, 0x4] movs r0, 0x12 @@ -838659,7 +838849,7 @@ sub_81C2794: ; 81C2794 adds r0, 0xC ldr r4, =0x02021cc4 adds r1, r4, 0 - bl sub_81B1B44 + bl GetMonNickname movs r0, 0 str r0, [sp] movs r0, 0x1 @@ -838794,7 +838984,7 @@ sub_81C286C: ; 81C286C movs r0, 0x1 adds r1, r7, 0 movs r2, 0x3E - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r4, r0, 0 adds r2, r4, 0 subs r2, 0x10 @@ -838817,7 +839007,7 @@ sub_81C286C: ; 81C286C movs r0, 0x1 adds r1, r7, 0 movs r2, 0x3E - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r4, r0, 0 adds r2, r4, 0 subs r2, 0x10 @@ -838840,7 +839030,7 @@ sub_81C286C: ; 81C286C movs r0, 0x1 adds r1, r7, 0 movs r2, 0x3E - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r4, r0, 0 adds r2, r4, 0 subs r2, 0x10 @@ -838877,7 +839067,7 @@ sub_81C286C: ; 81C286C movs r0, 0x1 adds r1, r4, 0 movs r2, 0x2A - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r0, 0x6 lsls r2, r0, 24 lsrs r2, 24 @@ -838891,7 +839081,7 @@ sub_81C286C: ; 81C286C movs r0, 0x1 adds r1, r4, 0 movs r2, 0x2A - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r0, 0x6 lsls r2, r0, 24 lsrs r2, 24 @@ -838905,7 +839095,7 @@ sub_81C286C: ; 81C286C movs r0, 0x1 adds r1, r4, 0 movs r2, 0x2A - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r0, 0x6 lsls r2, r0, 24 lsrs r2, 24 @@ -838919,7 +839109,7 @@ sub_81C286C: ; 81C286C movs r0, 0x1 adds r1, r4, 0 movs r2, 0x24 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r0, 0x2 lsls r2, r0, 24 lsrs r2, 24 @@ -838933,7 +839123,7 @@ sub_81C286C: ; 81C286C movs r0, 0x1 adds r1, r4, 0 movs r2, 0x24 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r0, 0x2 lsls r2, r0, 24 lsrs r2, 24 @@ -838947,7 +839137,7 @@ sub_81C286C: ; 81C286C movs r0, 0x1 adds r1, r4, 0 movs r2, 0x24 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r0, 0x2 lsls r2, r0, 24 lsrs r2, 24 @@ -839551,7 +839741,7 @@ sub_81C2F5C: ; 81C2F5C movs r0, 0x1 adds r1, r5, 0 movs r2, 0x38 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r4, r0, 0 ldr r0, =gUnknown_0861CCCC movs r1, 0x1 @@ -840047,7 +840237,7 @@ sub_81C33CC: ; 81C33CC movs r0, 0x1 adds r1, r5, 0 movs r2, 0x38 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r4, r0, 0 ldr r0, =gUnknown_0861CCCC movs r1, 0x1 @@ -840323,7 +840513,7 @@ sub_81C35E4: ; 81C35E4 movs r0, 0x1 adds r1, r5, 0 movs r2, 0x48 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r4, r0, 0 adds r4, 0x6 ldr r0, =gUnknown_0861CCEC @@ -840376,7 +840566,7 @@ sub_81C3690: ; 81C3690 movs r0, 0x1 adds r1, r5, 0 movs r2, 0x46 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r4, r0, 0 adds r4, 0x6 ldr r0, =gUnknown_0861CCEC @@ -840598,7 +840788,7 @@ sub_81C38C0: ; 81C38C0 movs r0, 0x1 adds r1, r4, 0 movs r2, 0x2A - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r0, 0x2 lsls r2, r0, 24 lsrs r2, 24 @@ -840644,7 +840834,7 @@ sub_81C38C0: ; 81C38C0 movs r0, 0x1 adds r1, r4, 0 movs r2, 0x2A - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r0, 0x2 lsls r2, r0, 24 lsrs r2, 24 @@ -840867,7 +841057,7 @@ sub_81C3B08: ; 81C3B08 ldrb r1, [r0] adds r0, r5, 0 adds r2, r7, 0 - bl move_get_pp_info + bl CalcPPWithPPUps adds r6, r0, 0 lsls r6, 24 lsrs r6, 24 @@ -840926,7 +841116,7 @@ sub_81C3B08: ; 81C3B08 movs r0, 0x1 adds r1, r7, 0 movs r2, 0x2C - bl sub_81DB368 + bl GetStringRightAlignXOffset mov r4, r9 b @081C3C26 .pool @@ -840947,7 +841137,7 @@ sub_81C3B08: ; 81C3B08 movs r0, 0x1 adds r1, r7, 0 movs r2, 0x2C - bl sub_81DB35C + bl GetStringCenterAlignXOffset @081C3C26: lsls r2, r0, 24 lsrs r2, 24 @@ -841399,7 +841589,7 @@ sub_81C3F44: ; 81C3F44 movs r0, 0x1 adds r1, r4, 0 movs r2, 0x2C - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 @@ -843929,7 +844119,7 @@ sub_81C5518: ; 81C5518 movs r0, 0x7 adds r1, r4, 0 movs r2, 0x77 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 @@ -845006,7 +845196,7 @@ sub_81C5EAC: ; 81C5EAC movs r1, 0x7 movs r2, 0x8 movs r3, 0x1 - bl sub_81988A4 + bl AddItemMenuActionTextPrinters ldr r0, [r6] adds r0, r5 ldrb r1, [r0] @@ -845200,7 +845390,7 @@ sub_81C5FE4: ; 81C5FE4 ands r0, r1 cmp r0, 0 bne @081C6098 - bl sub_81220D0 + bl GetLRKeysState lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -845230,7 +845420,7 @@ sub_81C5FE4: ; 81C5FE4 ands r0, r1 cmp r0, 0 bne @081C60D6 - bl sub_81220D0 + bl GetLRKeysState lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 @@ -845390,7 +845580,7 @@ sub_81C61E0: ; 81C61E0 ldr r1, =gUnknown_085E8F31 ldr r2, =sub_81C6714 adds r0, r5, 0 - bl sub_81C6DD8 + bl DisplayItemMessageInBattlePyramid b @081C6252 .pool @081C6228: @@ -845615,7 +845805,7 @@ sub_81C6404: ; 81C6404 movs r0, 0x1 adds r1, r4, 0 movs r2, 0x28 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 @@ -845653,7 +845843,7 @@ sub_81C645C: ; 81C645C movs r0, 0x1 adds r1, r4, 0 movs r2, 0x28 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 @@ -845854,7 +846044,7 @@ sub_81C6648: ; 81C6648 ldr r1, =gUnknown_085E8DCE ldr r2, =sub_81C66EC adds r0, r4, 0 - bl sub_81C6DD8 + bl DisplayItemMessageInBattlePyramid b @081C66A6 .pool @081C667C: @@ -845897,7 +846087,7 @@ sub_81C66AC: ; 81C66AC ldr r2, =sub_81C66EC adds r0, r4, 0 adds r1, r5, 0 - bl sub_81C6DD8 + bl DisplayItemMessageInBattlePyramid pop {r4,r5} pop {r0} bx r0 @@ -845967,7 +846157,7 @@ sub_81C674C: ; 81C674C ldr r1, =gUnknown_085E8DCE ldr r2, =sub_81C66EC adds r0, r4, 0 - bl sub_81C6DD8 + bl DisplayItemMessageInBattlePyramid b @081C6796 .pool @081C677C: @@ -846535,7 +846725,7 @@ sub_81C6C3C: ; 81C6C3C str r4, [sp, 0xC] str r1, [sp, 0x10] movs r1, 0x1 - bl sub_8199EEC + bl AddTextPrinterParametrized2 add sp, 0x14 pop {r3} mov r8, r3 @@ -846581,7 +846771,7 @@ sub_81C6C94: ; 81C6C94 str r4, [sp, 0xC] str r1, [sp, 0x10] movs r1, 0x7 - bl sub_8199EEC + bl AddTextPrinterParametrized2 add sp, 0x14 pop {r3} mov r8, r3 @@ -846707,8 +846897,9 @@ sub_81C6DAC: ; 81C6DAC .pool thumb_func_end sub_81C6DAC - thumb_func_start sub_81C6DD8 -sub_81C6DD8: ; 81C6DD8 + thumb_func_start DisplayItemMessageInBattlePyramid +; void DisplayItemMessageInBattlePyramid(u8 taskId, u8 *str, void ( *callback)(u8 taskId)) +DisplayItemMessageInBattlePyramid: ; 81C6DD8 push {r4-r6,lr} sub sp, 0x10 adds r4, r0, 0 @@ -846731,14 +846922,14 @@ sub_81C6DD8: ; 81C6DD8 movs r1, 0x2 movs r2, 0xA movs r3, 0xD - bl sub_8121E7C + bl DisplayMessageAndContinueTask movs r0, 0x1 bl schedule_bg_copy_tilemap_to_vram add sp, 0x10 pop {r4-r6} pop {r0} bx r0 - thumb_func_end sub_81C6DD8 + thumb_func_end DisplayItemMessageInBattlePyramid thumb_func_start sub_81C6E1C sub_81C6E1C: ; 81C6E1C @@ -846872,7 +847063,7 @@ sub_81C6F20: ; 81C6F20 beq @081C6F50 adds r0, r4, 0 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim ldr r0, =sub_81C6F68 str r0, [r4, 0x1C] @081C6F50: @@ -846894,7 +847085,7 @@ sub_81C6F68: ; 81C6F68 beq @081C6F84 adds r0, r4, 0 movs r1, 0 - bl sub_8008258 + bl StartObjectRotScalAnim ldr r0, =DummyObjectCallback str r0, [r4, 0x1C] @081C6F84: @@ -847247,8 +847438,8 @@ sub_81C71E4: ; 81C71E4 bx r0 thumb_func_end sub_81C71E4 - thumb_func_start sub_81C7250 -sub_81C7250: ; 81C7250 + thumb_func_start CB2_PokeNav +CB2_PokeNav: ; 81C7250 push {r4,lr} ldr r4, =0x0203cf40 movs r0, 0x5C @@ -847277,7 +847468,7 @@ sub_81C7250: ; 81C7250 pop {r0} bx r0 .pool - thumb_func_end sub_81C7250 + thumb_func_end CB2_PokeNav thumb_func_start sub_81C72A4 sub_81C72A4: ; 81C72A4 @@ -853648,7 +853839,7 @@ sub_81CA3B4: ; 81CA3B4 bl obj_alloc_rotscale_entry ldm r4!, {r0} movs r1, 0 - bl sub_8008258 + bl StartObjectRotScalAnim adds r5, 0x1 cmp r5, 0x3 ble @081CA3C8 @@ -853750,7 +853941,7 @@ sub_81CA4AC: ; 81CA4AC bne @081CA4E2 adds r0, r4, 0 movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim ldrh r0, [r4, 0x30] adds r0, 0x1 strh r0, [r4, 0x30] @@ -857099,7 +857290,7 @@ sub_81CBEB4: ; 81CBEB4 lsrs r5, 16 movs r0, 0x7 movs r2, 0x56 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r3, r0, 0 lsls r4, 4 adds r4, 0x1 @@ -857149,7 +857340,7 @@ sub_81CBEF8: ; 81CBEF8 movs r0, 0x7 add r1, sp, 0xC movs r2, 0x58 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r4, r0, 0 ldrb r0, [r5, 0x10] movs r1, 0x11 @@ -865591,7 +865782,7 @@ sub_81D02B0: ; 81D02B0 movs r0, 0x1 add r1, sp, 0xC movs r2, 0x38 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r3, r0, 0 lsls r4, 24 lsrs r4, 24 @@ -867374,7 +867565,7 @@ sub_81D10D0: ; 81D10D0 movs r0, 0x1 adds r1, r5, 0 movs r2, 0x38 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r3, r0, 0 mov r1, r8 ldrb r0, [r1, 0xC] @@ -867852,7 +868043,7 @@ sub_81D1448: ; 81D1448 strb r1, [r3, 0x5] ldr r0, [r6, 0x14] movs r1, 0x1 - bl sub_8008258 + bl StartObjectRotScalAnim ldr r1, [r6, 0x14] adds r1, 0x3E ldrb r2, [r1] @@ -867883,7 +868074,7 @@ sub_81D1500: ; 81D1500 strh r0, [r1, 0x2E] ldr r0, [r4, 0x14] movs r1, 0x2 - bl sub_8008258 + bl StartObjectRotScalAnim ldr r1, [r4, 0x14] ldr r0, =sub_81D1538 str r0, [r1, 0x1C] @@ -869142,7 +869333,7 @@ sub_81D1D44: ; 81D1D44 movs r1, 0x1 movs r2, 0x8 adds r3, r5, 0 - bl sub_8199EEC + bl AddTextPrinterParametrized2 @081D1DAC: add sp, 0x34 pop {r4,r5} @@ -870658,7 +870849,7 @@ sub_81D28FC: ; 81D28FC movs r0, 0x1 adds r1, r5, 0 movs r2, 0x80 - bl sub_81DB35C + bl GetStringCenterAlignXOffset adds r4, r0, 0 lsls r3, r4, 24 lsrs r3, 24 @@ -870689,7 +870880,7 @@ sub_81D28FC: ; 81D28FC movs r0, 0x1 adds r1, r5, 0 movs r2, 0x6A - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r4, r0, 0 lsls r3, r4, 24 lsrs r3, 24 @@ -870706,7 +870897,7 @@ sub_81D28FC: ; 81D28FC movs r0, 0x1 adds r1, r5, 0 movs r2, 0x6A - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r4, r0, 0 lsls r3, r4, 24 lsrs r3, 24 @@ -870862,7 +871053,7 @@ sub_81D2ACC: ; 81D2ACC movs r0, 0x1 adds r1, r5, 0 movs r2, 0x80 - bl sub_81DB35C + bl GetStringCenterAlignXOffset lsls r3, r0, 24 lsrs r3, 24 movs r0, 0x1 @@ -870878,7 +871069,7 @@ sub_81D2ACC: ; 81D2ACC movs r0, 0x1 adds r1, r5, 0 movs r2, 0x5C - bl sub_81DB368 + bl GetStringRightAlignXOffset lsls r3, r0, 24 lsrs r3, 24 movs r0, 0x19 @@ -870894,7 +871085,7 @@ sub_81D2ACC: ; 81D2ACC movs r0, 0x1 adds r1, r5, 0 movs r2, 0x5C - bl sub_81DB368 + bl GetStringRightAlignXOffset lsls r3, r0, 24 lsrs r3, 24 movs r0, 0x29 @@ -871007,7 +871198,7 @@ sub_81D2BF4: ; 81D2BF4 str r0, [sp, 0xC] movs r1, 0x1 adds r2, r4, 0 - bl text_box_related_one + bl AddTextPrinterParametrized add sp, 0x10 pop {r4} pop {r0} @@ -874595,7 +874786,7 @@ sub_81D4834: ; 81D4834 asrs r0, 16 lsls r1, r4, 16 asrs r1, 16 - bl cur_mapdata_block_get_role_at + bl MapGridGetMetatileBehaviorAt lsls r0, 24 lsrs r0, 24 bl sub_8088E64 @@ -876940,7 +877131,7 @@ sub_81D5C18: ; 81D5C18 ands r0, r1 cmp r0, 0 bne @081D5C42 - bl sub_81D609C + bl GetCurrentTrainerHillMapId lsls r0, 24 cmp r0, 0 bne @081D5C54 @@ -877003,7 +877194,7 @@ sub_81D5C8C: ; 81D5C8C movs r0, 0x1 adds r1, r5, 0 movs r2, 0xD0 - bl sub_81DB35C + bl GetStringCenterAlignXOffset lsls r2, r0, 24 lsrs r2, 24 ldr r6, =gUnknown_0862A5F4 @@ -877091,7 +877282,7 @@ sub_81D5C8C: ; 81D5C8C movs r0, 0x1 mov r1, r9 movs r2, 0xD0 - bl sub_81DB368 + bl GetStringRightAlignXOffset lsls r2, r0, 24 lsrs r2, 24 lsls r3, r7, 24 @@ -877354,7 +877545,7 @@ sub_81D5FB4: ; 81D5FB4 mov r6, r8 push {r6,r7} adds r4, r0, 0 - bl sub_81D609C + bl GetCurrentTrainerHillMapId lsls r0, 24 lsrs r0, 24 mov r9, r0 @@ -877441,8 +877632,8 @@ sub_81D5FB4: ; 81D5FB4 .pool thumb_func_end sub_81D5FB4 - thumb_func_start sub_81D6074 -sub_81D6074: ; 81D6074 + thumb_func_start InTrainerHill +InTrainerHill: ; 81D6074 push {lr} ldr r1, =0x02037318 ldr r2, =0xfffffe61 @@ -877460,10 +877651,11 @@ sub_81D6074: ; 81D6074 pop {r1} bx r1 .pool - thumb_func_end sub_81D6074 + thumb_func_end InTrainerHill - thumb_func_start sub_81D609C -sub_81D609C: ; 81D609C + thumb_func_start GetCurrentTrainerHillMapId +; u8 GetCurrentTrainerHillMapId() +GetCurrentTrainerHillMapId: ; 81D609C push {lr} ldr r0, =0x02037318 ldrh r2, [r0, 0x12] @@ -877512,7 +877704,7 @@ sub_81D609C: ; 81D609C adds r0, r1, 0 pop {r1} bx r1 - thumb_func_end sub_81D609C + thumb_func_end GetCurrentTrainerHillMapId thumb_func_start sub_81D6100 sub_81D6100: ; 81D6100 @@ -877598,8 +877790,9 @@ battle_init: ; 81D6180 .pool thumb_func_end battle_init - thumb_func_start sub_81D619C -sub_81D619C: ; 81D619C + thumb_func_start GetTrainerHillTrainerFlag +; u8 GetTrainerHillTrainerFlag(u8 fieldObjectId) +GetTrainerHillTrainerFlag: ; 81D619C push {r4,lr} adds r4, r0, 0 lsls r4, 24 @@ -877631,7 +877824,7 @@ sub_81D619C: ; 81D619C pop {r1} bx r1 .pool - thumb_func_end sub_81D619C + thumb_func_end GetTrainerHillTrainerFlag thumb_func_start sub_81D61E8 sub_81D61E8: ; 81D61E8 @@ -878059,7 +878252,7 @@ sub_81D6534: ; 81D6534 lsls r0, 24 cmp r0, 0 beq @081D6560 - bl sub_81D609C + bl GetCurrentTrainerHillMapId lsls r0, 24 lsrs r0, 24 cmp r0, 0x6 @@ -887467,37 +887660,41 @@ sub_81DB328: ; 81DB328 .pool thumb_func_end sub_81DB328 - thumb_func_start sub_81DB35C -sub_81DB35C: ; 81DB35C + thumb_func_start GetStringCenterAlignXOffset +; s32 GetStringCenterAlignXOffset(u8 fontId, u8 *str, s32 totalWidth) +GetStringCenterAlignXOffset: ; 81DB35C push {lr} movs r3, 0 - bl sub_81DB374 + bl GetStringCenterAlignXOffsetWithLetterSpacing pop {r1} bx r1 - thumb_func_end sub_81DB35C + thumb_func_end GetStringCenterAlignXOffset - thumb_func_start sub_81DB368 -sub_81DB368: ; 81DB368 + thumb_func_start GetStringRightAlignXOffset +; s32 GetStringRightAlignXOffset(u8 fontId, u8 *str, s32 totalWidth) +GetStringRightAlignXOffset: ; 81DB368 push {lr} movs r3, 0 - bl sub_81DB384 + bl GetStringWidthDifference pop {r1} bx r1 - thumb_func_end sub_81DB368 + thumb_func_end GetStringRightAlignXOffset - thumb_func_start sub_81DB374 -sub_81DB374: ; 81DB374 + thumb_func_start GetStringCenterAlignXOffsetWithLetterSpacing +; s32 GetStringCenterAlignXOffsetWithLetterSpacing(u8 fontId, u8 *str, s32 totalWidth, s16 letterSpacing) +GetStringCenterAlignXOffsetWithLetterSpacing: ; 81DB374 push {lr} - bl sub_81DB384 + bl GetStringWidthDifference lsrs r1, r0, 31 adds r0, r1 asrs r0, 1 pop {r1} bx r1 - thumb_func_end sub_81DB374 + thumb_func_end GetStringCenterAlignXOffsetWithLetterSpacing - thumb_func_start sub_81DB384 -sub_81DB384: ; 81DB384 + thumb_func_start GetStringWidthDifference +; s32 GetStringWidthDifference(u8 fontId, u8 *str, s32 totalWidth, s16 letterSpacing) +GetStringWidthDifference: ; 81DB384 push {r4,lr} adds r4, r2, 0 adds r2, r3, 0 @@ -887516,7 +887713,7 @@ sub_81DB384: ; 81DB384 pop {r4} pop {r1} bx r1 - thumb_func_end sub_81DB384 + thumb_func_end GetStringWidthDifference thumb_func_start GetMaxWidthInMenuTable GetMaxWidthInMenuTable: ; 81DB3A8 diff --git a/asm/gpu_obj.s b/asm/gpu_obj.s index eb8ee03ce..26140cfeb 100644 --- a/asm/gpu_obj.s +++ b/asm/gpu_obj.s @@ -3365,9 +3365,9 @@ SeekObjectImageAnim: ; 80081DC bx r0 thumb_func_end SeekObjectImageAnim - thumb_func_start sub_8008258 -; void sub_8008258(u8 index, u8 a2) -sub_8008258: ; 8008258 + thumb_func_start StartObjectRotScalAnim +; void StartObjectRotScalAnim(struct obj *object, u8 whichAnim) +StartObjectRotScalAnim: ; 8008258 push {r4,r5,lr} adds r5, r0, 0 lsls r4, r1, 24 @@ -3388,11 +3388,11 @@ sub_8008258: ; 8008258 pop {r4,r5} pop {r0} bx r0 - thumb_func_end sub_8008258 + thumb_func_end StartObjectRotScalAnim - thumb_func_start sub_8008284 -; void sub_8008284(u8 index, u8 a2) -sub_8008284: ; 8008284 + thumb_func_start StartObjectRotScalAnimIfDifferent +; void StartObjectRotScalAnimIfDifferent(struct obj *object, u8 whichAnim) +StartObjectRotScalAnimIfDifferent: ; 8008284 push {r4,r5,lr} adds r5, r0, 0 lsls r1, 24 @@ -3410,13 +3410,13 @@ sub_8008284: ; 8008284 beq @080082AC adds r0, r5, 0 adds r1, r4, 0 - bl sub_8008258 + bl StartObjectRotScalAnim @080082AC: pop {r4,r5} pop {r0} bx r0 .pool - thumb_func_end sub_8008284 + thumb_func_end StartObjectRotScalAnimIfDifferent thumb_func_start sub_80082B8 sub_80082B8: ; 80082B8 diff --git a/asm/main_menu.s b/asm/main_menu.s index aa49d06c0..81a76e38d 100644 --- a/asm/main_menu.s +++ b/asm/main_menu.s @@ -1480,7 +1480,7 @@ Task_HandleMainMenuAPressed: ; 803027C ldr r0, =0x030022c0 ldr r1, =CB2_ReinitMainMenu str r1, [r0, 0x8] - ldr r0, =c2_options_menu + ldr r0, =CB2_OptionsMenu b @0803048A .pool @08030478: @@ -2083,7 +2083,7 @@ task_new_game_prof_birch_speech_3: ; 8030928 ldr r1, =gUnknown_082C897B bl ExpandStringRefs movs r0, 0x1 - bl get_map_name + bl AddTextPrinterForMessage ldr r0, =task_new_game_prof_birch_speech_4 str r0, [r4] @080309B6: @@ -2120,7 +2120,7 @@ task_new_game_prof_birch_speech_4: ; 80309CC bl ExpandStringRefs ldr r1, =sub_80323A0 movs r0, 0x1 - bl sub_8197A9C + bl AddTextPrinterWithCallbackForMessage ldr r0, =0x03000dd0 strb r4, [r0] @08030A0A: @@ -2143,7 +2143,7 @@ task_new_game_prof_birch_speech_5: ; 8030A2C ldr r1, =gUnknown_082C8A1F bl ExpandStringRefs movs r0, 0x1 - bl get_map_name + bl AddTextPrinterForMessage ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 @@ -2338,7 +2338,7 @@ task_new_game_prof_birch_speech_6: ; 8030BCC ldr r1, =gUnknown_082C8BD0 bl ExpandStringRefs movs r0, 0x1 - bl get_map_name + bl AddTextPrinterForMessage ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 @@ -2577,7 +2577,7 @@ task_new_game_prof_birch_speech_11: ; 8030DC8 ldr r1, =gUnknown_082C8BDD bl ExpandStringRefs movs r0, 0x1 - bl get_map_name + bl AddTextPrinterForMessage ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 @@ -2828,7 +2828,7 @@ task_new_game_prof_birch_speech_14: ; 8030FD4 ldr r1, =gUnknown_082C8BFF bl ExpandStringRefs movs r0, 0x1 - bl get_map_name + bl AddTextPrinterForMessage ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 @@ -2965,7 +2965,7 @@ task_new_game_prof_birch_speech_part2_2: ; 8031104 ldr r1, =gUnknown_082C8C1C bl ExpandStringRefs movs r0, 0x1 - bl get_map_name + bl AddTextPrinterForMessage ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 @@ -3208,7 +3208,7 @@ task_new_game_prof_birch_speech_part2_6: ; 8031258 ldr r1, =gUnknown_082C8C2A bl ExpandStringRefs movs r0, 0x1 - bl get_map_name + bl AddTextPrinterForMessage ldr r0, =task_new_game_prof_birch_speech_part2_7 str r0, [r7] @08031320: @@ -3393,7 +3393,7 @@ task_new_game_prof_birch_speech_part2_8: ; 80313E4 ldr r1, =gUnknown_082C8C7A bl ExpandStringRefs movs r0, 0x1 - bl get_map_name + bl AddTextPrinterForMessage ldr r0, =task_new_game_prof_birch_speech_part2_9 str r0, [r4] @080314B0: @@ -3459,7 +3459,7 @@ task_new_game_prof_birch_speech_part2_9: ; 80314C4 bl obj_alloc_rotscale_entry adds r0, r5, 0 movs r1, 0 - bl sub_8008258 + bl StartObjectRotScalAnim adds r0, r7, 0 adds r0, 0x1C adds r4, r0 @@ -3582,7 +3582,7 @@ task_new_game_prof_birch_speech_part2_12: ; 8031630 ldrh r0, [r0, 0x1A] bl sub_818D820 bl dp13_810BB8C - ldr r0, =c2_new_game + ldr r0, =CB2_NewGame bl SetMainCallback2 adds r0, r4, 0 bl remove_task @@ -4558,7 +4558,7 @@ fmt_time: ; 8031E94 ldr r1, [r4] movs r0, 0x1 movs r2, 0x64 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 @@ -4614,7 +4614,7 @@ fmt_player: ; 8031EF8 movs r0, 0x1 add r1, sp, 0xC movs r2, 0xD0 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 @@ -4679,7 +4679,7 @@ fmt_pokedex: ; 8031F7C movs r0, 0x1 add r1, sp, 0xC movs r2, 0x64 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 @@ -4743,7 +4743,7 @@ fmt_badges: ; 8032014 movs r0, 0x1 add r1, sp, 0xC movs r2, 0xD0 - bl sub_81DB368 + bl GetStringRightAlignXOffset adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 diff --git a/asm/malloc.s b/asm/malloc.s index c30f5285f..1c3dc135b 100644 --- a/asm/malloc.s +++ b/asm/malloc.s @@ -1,5 +1,5 @@ thumb_func_start PutMemBlockHeader -; void PutMemBlockHeader(struct MemBlock *block, struct MemBlock *prev, struct MemBlock *next, u32 size) +; void PutMemBlockHeader(void *block, struct MemBlock *prev, struct MemBlock *next, u32 size) PutMemBlockHeader: ; 8000988 push {r4,lr} movs r4, 0 @@ -16,7 +16,7 @@ PutMemBlockHeader: ; 8000988 thumb_func_end PutMemBlockHeader thumb_func_start PutFirstMemBlockHeader -; void PutFirstMemBlockHeader(struct MemBlock *block, u32 size) +; void PutFirstMemBlockHeader(void *block, u32 size) PutFirstMemBlockHeader: ; 80009A4 push {lr} adds r2, r0, 0 @@ -91,7 +91,7 @@ AllocInternal: ; 80009B8 thumb_func_end AllocInternal thumb_func_start FreeInternal -; void FreeInternal(struct MemBlock *head, struct MemBlock *node) +; void FreeInternal(void *heapStart, void *pointer) FreeInternal: ; 8000A20 push {r4,r5,lr} cmp r1, 0 @@ -148,7 +148,7 @@ FreeInternal: ; 8000A20 thumb_func_end FreeInternal thumb_func_start AllocZeroedInternal -; void *AllocZeroedInternal(struct MemBlock *head, u32 size) +; void *AllocZeroedInternal(void *heapStart, u32 size) AllocZeroedInternal: ; 8000A84 push {r4,r5,lr} sub sp, 0x4 @@ -289,7 +289,7 @@ Free: ; 8000B60 thumb_func_end Free thumb_func_start CheckMemBlock -; BOOL CheckMemBlock(struct MemBlock *node) +; BOOL CheckMemBlock(void *pointer) CheckMemBlock: ; 8000B74 push {lr} adds r1, r0, 0 diff --git a/asm/text_renderer.s b/asm/text_renderer.s index e94a21895..901b8bcb7 100644 --- a/asm/text_renderer.s +++ b/asm/text_renderer.s @@ -3315,7 +3315,7 @@ GetFontWidthFunc: ; 8005EA8 thumb_func_end GetFontWidthFunc thumb_func_start GetStringWidth -; u32 GetStringWidth(u8 fontId, u8 *str, u16 letterSpacing) +; s32 GetStringWidth(u8 fontId, u8 *str, u16 letterSpacing) GetStringWidth: ; 8005ED8 push {r4-r7,lr} mov r7, r10 diff --git a/asm/window.s b/asm/window.s index 24618de20..08c4db43c 100644 --- a/asm/window.s +++ b/asm/window.s @@ -216,7 +216,7 @@ InitWindows: ; 80031C0 thumb_func_end InitWindows thumb_func_start AddWindow -; u16 AddWindow(struct WindowTemplate *template) +; u8 AddWindow(struct WindowTemplate *template) AddWindow: ; 8003380 push {r4-r7,lr} mov r7, r10 diff --git a/data/event_script_command_function_table.s b/data/event_script_command_function_table.s index 2e5453fa2..3658dfda5 100644 --- a/data/event_script_command_function_table.s +++ b/data/event_script_command_function_table.s @@ -112,7 +112,7 @@ gEventScriptCommandFunctionTable: ; 81DB67C .4byte s6C_release_2 .4byte sub_809ACC0 .4byte s6E_yes_no - .4byte sub_809AD00 + .4byte s6F_multichoice .4byte sub_809AD3C .4byte sub_809AD90 .4byte sub_809AD8C @@ -139,7 +139,7 @@ gEventScriptCommandFunctionTable: ; 81DB67C .4byte s87_pokemartdecor .4byte s88_pokemartbp .4byte s89_open_casino_game1 - .4byte sub_809B71C + .4byte berry_script_cmd .4byte sub_809B784 .4byte sub_809B794 .4byte sub_809B7A4 @@ -214,7 +214,7 @@ gEventScriptCommandFunctionTable: ; 81DB67C .4byte sub_809BD70 .4byte sub_809BB90 .4byte sub_809BBB4 - .4byte sub_809BBC0 + .4byte ScrCmd_MossdeepGymSwitch .4byte sub_809BBDC .4byte sub_809A150 .4byte sub_809BBE8 diff --git a/data/items.s b/data/items.s index 20344691f..cb58d75c1 100644 --- a/data/items.s +++ b/data/items.s @@ -11,7 +11,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -28,7 +28,7 @@ gItems: ; 85839A0 .byte 0 .4byte NULL .4byte 2 - .4byte item_in_battle_func_pokeball + .4byte ItemUseInBattle_PokeBall .4byte 0 .charmapstr "ULTRA BALL$", 14 @@ -43,7 +43,7 @@ gItems: ; 85839A0 .byte 1 .4byte NULL .4byte 2 - .4byte item_in_battle_func_pokeball + .4byte ItemUseInBattle_PokeBall .4byte 1 .charmapstr "GREAT BALL$", 14 @@ -58,7 +58,7 @@ gItems: ; 85839A0 .byte 2 .4byte NULL .4byte 2 - .4byte item_in_battle_func_pokeball + .4byte ItemUseInBattle_PokeBall .4byte 2 .charmapstr "POKé BALL$", 14 @@ -73,7 +73,7 @@ gItems: ; 85839A0 .byte 3 .4byte NULL .4byte 2 - .4byte item_in_battle_func_pokeball + .4byte ItemUseInBattle_PokeBall .4byte 3 .charmapstr "SAFARI BALL$", 14 @@ -88,7 +88,7 @@ gItems: ; 85839A0 .byte 4 .4byte NULL .4byte 2 - .4byte item_in_battle_func_pokeball + .4byte ItemUseInBattle_PokeBall .4byte 4 .charmapstr "NET BALL$", 14 @@ -103,7 +103,7 @@ gItems: ; 85839A0 .byte 5 .4byte NULL .4byte 2 - .4byte item_in_battle_func_pokeball + .4byte ItemUseInBattle_PokeBall .4byte 5 .charmapstr "DIVE BALL$", 14 @@ -118,7 +118,7 @@ gItems: ; 85839A0 .byte 6 .4byte NULL .4byte 2 - .4byte item_in_battle_func_pokeball + .4byte ItemUseInBattle_PokeBall .4byte 6 .charmapstr "NEST BALL$", 14 @@ -133,7 +133,7 @@ gItems: ; 85839A0 .byte 7 .4byte NULL .4byte 2 - .4byte item_in_battle_func_pokeball + .4byte ItemUseInBattle_PokeBall .4byte 7 .charmapstr "REPEAT BALL$", 14 @@ -148,7 +148,7 @@ gItems: ; 85839A0 .byte 8 .4byte NULL .4byte 2 - .4byte item_in_battle_func_pokeball + .4byte ItemUseInBattle_PokeBall .4byte 8 .charmapstr "TIMER BALL$", 14 @@ -163,7 +163,7 @@ gItems: ; 85839A0 .byte 9 .4byte NULL .4byte 2 - .4byte item_in_battle_func_pokeball + .4byte ItemUseInBattle_PokeBall .4byte 9 .charmapstr "LUXURY BALL$", 14 @@ -178,7 +178,7 @@ gItems: ; 85839A0 .byte 10 .4byte NULL .4byte 2 - .4byte item_in_battle_func_pokeball + .4byte ItemUseInBattle_PokeBall .4byte 10 .charmapstr "PREMIER BALL$", 14 @@ -193,7 +193,7 @@ gItems: ; 85839A0 .byte 11 .4byte NULL .4byte 2 - .4byte item_in_battle_func_pokeball + .4byte ItemUseInBattle_PokeBall .4byte 11 .charmapstr "POTION$", 14 @@ -206,9 +206,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte item_field_func_recovery_item + .4byte ItemUseOutOfBattle_Medicine .4byte 1 - .4byte item_in_battle_func_recovery_item + .4byte ItemUseInBattle_Medicine .4byte 0 .charmapstr "ANTIDOTE$", 14 @@ -221,9 +221,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte item_field_func_recovery_item + .4byte ItemUseOutOfBattle_Medicine .4byte 1 - .4byte item_in_battle_func_recovery_item + .4byte ItemUseInBattle_Medicine .4byte 0 .charmapstr "BURN HEAL$", 14 @@ -236,9 +236,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte item_field_func_recovery_item + .4byte ItemUseOutOfBattle_Medicine .4byte 1 - .4byte item_in_battle_func_recovery_item + .4byte ItemUseInBattle_Medicine .4byte 0 .charmapstr "ICE HEAL$", 14 @@ -251,9 +251,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte item_field_func_recovery_item + .4byte ItemUseOutOfBattle_Medicine .4byte 1 - .4byte item_in_battle_func_recovery_item + .4byte ItemUseInBattle_Medicine .4byte 0 .charmapstr "AWAKENING$", 14 @@ -266,9 +266,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte item_field_func_recovery_item + .4byte ItemUseOutOfBattle_Medicine .4byte 1 - .4byte item_in_battle_func_recovery_item + .4byte ItemUseInBattle_Medicine .4byte 0 .charmapstr "PARLYZ HEAL$", 14 @@ -281,9 +281,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte item_field_func_recovery_item + .4byte ItemUseOutOfBattle_Medicine .4byte 1 - .4byte item_in_battle_func_recovery_item + .4byte ItemUseInBattle_Medicine .4byte 0 .charmapstr "FULL RESTORE$", 14 @@ -296,9 +296,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte item_field_func_recovery_item + .4byte ItemUseOutOfBattle_Medicine .4byte 1 - .4byte item_in_battle_func_recovery_item + .4byte ItemUseInBattle_Medicine .4byte 0 .charmapstr "MAX POTION$", 14 @@ -311,9 +311,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte item_field_func_recovery_item + .4byte ItemUseOutOfBattle_Medicine .4byte 1 - .4byte item_in_battle_func_recovery_item + .4byte ItemUseInBattle_Medicine .4byte 0 .charmapstr "HYPER POTION$", 14 @@ -326,9 +326,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte item_field_func_recovery_item + .4byte ItemUseOutOfBattle_Medicine .4byte 1 - .4byte item_in_battle_func_recovery_item + .4byte ItemUseInBattle_Medicine .4byte 0 .charmapstr "SUPER POTION$", 14 @@ -341,9 +341,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte item_field_func_recovery_item + .4byte ItemUseOutOfBattle_Medicine .4byte 1 - .4byte item_in_battle_func_recovery_item + .4byte ItemUseInBattle_Medicine .4byte 0 .charmapstr "FULL HEAL$", 14 @@ -356,9 +356,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte item_field_func_recovery_item + .4byte ItemUseOutOfBattle_Medicine .4byte 1 - .4byte item_in_battle_func_recovery_item + .4byte ItemUseInBattle_Medicine .4byte 0 .charmapstr "REVIVE$", 14 @@ -371,9 +371,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte item_field_func_recovery_item + .4byte ItemUseOutOfBattle_Medicine .4byte 1 - .4byte item_in_battle_func_recovery_item + .4byte ItemUseInBattle_Medicine .4byte 0 .charmapstr "MAX REVIVE$", 14 @@ -386,9 +386,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte item_field_func_recovery_item + .4byte ItemUseOutOfBattle_Medicine .4byte 1 - .4byte item_in_battle_func_recovery_item + .4byte ItemUseInBattle_Medicine .4byte 0 .charmapstr "FRESH WATER$", 14 @@ -401,9 +401,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte item_field_func_recovery_item + .4byte ItemUseOutOfBattle_Medicine .4byte 1 - .4byte item_in_battle_func_recovery_item + .4byte ItemUseInBattle_Medicine .4byte 0 .charmapstr "SODA POP$", 14 @@ -416,9 +416,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte item_field_func_recovery_item + .4byte ItemUseOutOfBattle_Medicine .4byte 1 - .4byte item_in_battle_func_recovery_item + .4byte ItemUseInBattle_Medicine .4byte 0 .charmapstr "LEMONADE$", 14 @@ -431,9 +431,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte item_field_func_recovery_item + .4byte ItemUseOutOfBattle_Medicine .4byte 1 - .4byte item_in_battle_func_recovery_item + .4byte ItemUseInBattle_Medicine .4byte 0 .charmapstr "MOOMOO MILK$", 14 @@ -446,9 +446,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte item_field_func_recovery_item + .4byte ItemUseOutOfBattle_Medicine .4byte 1 - .4byte item_in_battle_func_recovery_item + .4byte ItemUseInBattle_Medicine .4byte 0 .charmapstr "ENERGYPOWDER$", 14 @@ -461,9 +461,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte item_field_func_recovery_item + .4byte ItemUseOutOfBattle_Medicine .4byte 1 - .4byte item_in_battle_func_recovery_item + .4byte ItemUseInBattle_Medicine .4byte 0 .charmapstr "ENERGY ROOT$", 14 @@ -476,9 +476,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte item_field_func_recovery_item + .4byte ItemUseOutOfBattle_Medicine .4byte 1 - .4byte item_in_battle_func_recovery_item + .4byte ItemUseInBattle_Medicine .4byte 0 .charmapstr "HEAL POWDER$", 14 @@ -491,9 +491,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte item_field_func_recovery_item + .4byte ItemUseOutOfBattle_Medicine .4byte 1 - .4byte item_in_battle_func_recovery_item + .4byte ItemUseInBattle_Medicine .4byte 0 .charmapstr "REVIVAL HERB$", 14 @@ -506,9 +506,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte item_field_func_recovery_item + .4byte ItemUseOutOfBattle_Medicine .4byte 1 - .4byte item_in_battle_func_recovery_item + .4byte ItemUseInBattle_Medicine .4byte 0 .charmapstr "ETHER$", 14 @@ -521,9 +521,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte item_field_func_pp_recovery_item + .4byte ItemUseOutOfBattle_PPRecovery .4byte 1 - .4byte item_in_battle_func_pp_recovery_item + .4byte ItemUseInBattle_PPRecovery .4byte 0 .charmapstr "MAX ETHER$", 14 @@ -536,9 +536,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte item_field_func_pp_recovery_item + .4byte ItemUseOutOfBattle_PPRecovery .4byte 1 - .4byte item_in_battle_func_pp_recovery_item + .4byte ItemUseInBattle_PPRecovery .4byte 0 .charmapstr "ELIXIR$", 14 @@ -551,9 +551,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte item_field_func_pp_recovery_item + .4byte ItemUseOutOfBattle_PPRecovery .4byte 1 - .4byte item_in_battle_func_pp_recovery_item + .4byte ItemUseInBattle_PPRecovery .4byte 0 .charmapstr "MAX ELIXIR$", 14 @@ -566,9 +566,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte item_field_func_pp_recovery_item + .4byte ItemUseOutOfBattle_PPRecovery .4byte 1 - .4byte item_in_battle_func_pp_recovery_item + .4byte ItemUseInBattle_PPRecovery .4byte 0 .charmapstr "LAVA COOKIE$", 14 @@ -581,9 +581,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte item_field_func_recovery_item + .4byte ItemUseOutOfBattle_Medicine .4byte 1 - .4byte item_in_battle_func_recovery_item + .4byte ItemUseInBattle_Medicine .4byte 0 .charmapstr "BLUE FLUTE$", 14 @@ -596,9 +596,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte item_field_func_recovery_item + .4byte ItemUseOutOfBattle_Medicine .4byte 1 - .4byte item_in_battle_func_recovery_item + .4byte ItemUseInBattle_Medicine .4byte 0 .charmapstr "YELLOW FLUTE$", 14 @@ -611,9 +611,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 1 - .4byte item_in_battle_func_recovery_item + .4byte ItemUseInBattle_Medicine .4byte 0 .charmapstr "RED FLUTE$", 14 @@ -626,9 +626,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 1 - .4byte item_in_battle_func_recovery_item + .4byte ItemUseInBattle_Medicine .4byte 0 .charmapstr "BLACK FLUTE$", 14 @@ -641,7 +641,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte item_field_func_black_white_flutes + .4byte ItemUseOutOfBattle_BlackWhiteFlute .4byte 0 .4byte NULL .4byte 0 @@ -656,7 +656,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte item_field_func_black_white_flutes + .4byte ItemUseOutOfBattle_BlackWhiteFlute .4byte 0 .4byte NULL .4byte 0 @@ -671,9 +671,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte item_field_func_recovery_item + .4byte ItemUseOutOfBattle_Medicine .4byte 1 - .4byte item_in_battle_func_recovery_item + .4byte ItemUseInBattle_Medicine .4byte 0 .charmapstr "SACRED ASH$", 14 @@ -686,7 +686,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte item_in_battle_func_sacred_ash + .4byte ItemUseOutOfBattle_SacredAsh .4byte 0 .4byte NULL .4byte 0 @@ -701,7 +701,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -716,7 +716,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -731,7 +731,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -746,7 +746,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -761,7 +761,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -776,7 +776,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -791,7 +791,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -806,7 +806,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -821,7 +821,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -836,7 +836,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -851,7 +851,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -866,7 +866,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -881,7 +881,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -896,7 +896,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -911,7 +911,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -926,7 +926,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -941,7 +941,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -956,7 +956,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte item_field_func_recovery_item + .4byte ItemUseOutOfBattle_Medicine .4byte 0 .4byte NULL .4byte 0 @@ -971,7 +971,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte item_field_func_recovery_item + .4byte ItemUseOutOfBattle_Medicine .4byte 0 .4byte NULL .4byte 0 @@ -986,7 +986,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte item_field_func_recovery_item + .4byte ItemUseOutOfBattle_Medicine .4byte 0 .4byte NULL .4byte 0 @@ -1001,7 +1001,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte item_field_func_recovery_item + .4byte ItemUseOutOfBattle_Medicine .4byte 0 .4byte NULL .4byte 0 @@ -1016,7 +1016,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte item_field_func_recovery_item + .4byte ItemUseOutOfBattle_Medicine .4byte 0 .4byte NULL .4byte 0 @@ -1031,7 +1031,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte sub_80FDF2C + .4byte ItemUseOutOfBattle_RareCandy .4byte 0 .4byte NULL .4byte 0 @@ -1046,7 +1046,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte sub_80FDF10 + .4byte ItemUseOutOfBattle_PPUp .4byte 0 .4byte NULL .4byte 0 @@ -1061,7 +1061,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte item_field_func_recovery_item + .4byte ItemUseOutOfBattle_Medicine .4byte 0 .4byte NULL .4byte 0 @@ -1076,7 +1076,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte sub_80FDF10 + .4byte ItemUseOutOfBattle_PPUp .4byte 0 .4byte NULL .4byte 0 @@ -1091,7 +1091,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -1106,9 +1106,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 2 - .4byte status_incr_battle + .4byte ItemUseInBattle_StatIncrease .4byte 0 .charmapstr "DIRE HIT$", 14 @@ -1121,9 +1121,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 2 - .4byte status_incr_battle + .4byte ItemUseInBattle_StatIncrease .4byte 0 .charmapstr "X ATTACK$", 14 @@ -1136,9 +1136,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 2 - .4byte status_incr_battle + .4byte ItemUseInBattle_StatIncrease .4byte 0 .charmapstr "X DEFEND$", 14 @@ -1151,9 +1151,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 2 - .4byte status_incr_battle + .4byte ItemUseInBattle_StatIncrease .4byte 0 .charmapstr "X SPEED$", 14 @@ -1166,9 +1166,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 2 - .4byte status_incr_battle + .4byte ItemUseInBattle_StatIncrease .4byte 0 .charmapstr "X ACCURACY$", 14 @@ -1181,9 +1181,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 2 - .4byte status_incr_battle + .4byte ItemUseInBattle_StatIncrease .4byte 0 .charmapstr "X SPECIAL$", 14 @@ -1196,9 +1196,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 2 - .4byte status_incr_battle + .4byte ItemUseInBattle_StatIncrease .4byte 0 .charmapstr "POKé DOLL$", 14 @@ -1211,9 +1211,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 2 - .4byte sub_80FE5E4 + .4byte ItemUseInBattle_Escape .4byte 0 .charmapstr "FLUFFY TAIL$", 14 @@ -1226,9 +1226,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 2 - .4byte sub_80FE5E4 + .4byte ItemUseInBattle_Escape .4byte 0 .charmapstr "????????$", 14 @@ -1241,7 +1241,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -1256,7 +1256,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte sub_80FE0BC + .4byte ItemUseOutOfBattle_Repel .4byte 0 .4byte NULL .4byte 0 @@ -1271,7 +1271,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte sub_80FE0BC + .4byte ItemUseOutOfBattle_Repel .4byte 0 .4byte NULL .4byte 0 @@ -1286,7 +1286,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 2 - .4byte sub_80FE334 + .4byte ItemUseOutOfBattle_EscapeRope .4byte 0 .4byte NULL .4byte 0 @@ -1301,7 +1301,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte sub_80FE0BC + .4byte ItemUseOutOfBattle_Repel .4byte 0 .4byte NULL .4byte 0 @@ -1316,7 +1316,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -1331,7 +1331,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -1346,7 +1346,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -1361,7 +1361,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -1376,7 +1376,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -1391,7 +1391,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -1406,7 +1406,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte sub_80FE378 + .4byte ItemUseOutOfBattle_EvolutionStone .4byte 0 .4byte NULL .4byte 0 @@ -1421,7 +1421,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte sub_80FE378 + .4byte ItemUseOutOfBattle_EvolutionStone .4byte 0 .4byte NULL .4byte 0 @@ -1436,7 +1436,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte sub_80FE378 + .4byte ItemUseOutOfBattle_EvolutionStone .4byte 0 .4byte NULL .4byte 0 @@ -1451,7 +1451,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte sub_80FE378 + .4byte ItemUseOutOfBattle_EvolutionStone .4byte 0 .4byte NULL .4byte 0 @@ -1466,7 +1466,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte sub_80FE378 + .4byte ItemUseOutOfBattle_EvolutionStone .4byte 0 .4byte NULL .4byte 0 @@ -1481,7 +1481,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 1 - .4byte sub_80FE378 + .4byte ItemUseOutOfBattle_EvolutionStone .4byte 0 .4byte NULL .4byte 0 @@ -1496,7 +1496,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -1511,7 +1511,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -1526,7 +1526,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -1541,7 +1541,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -1556,7 +1556,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -1571,7 +1571,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -1586,7 +1586,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -1601,7 +1601,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -1616,7 +1616,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -1631,7 +1631,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -1646,7 +1646,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -1661,7 +1661,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -1676,7 +1676,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -1691,7 +1691,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -1706,7 +1706,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -1721,7 +1721,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -1736,7 +1736,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -1751,7 +1751,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -1766,7 +1766,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -1781,7 +1781,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -1796,7 +1796,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -1811,7 +1811,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -1826,7 +1826,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 0 - .4byte sub_80FD278 + .4byte ItemUseOutOfBattle_Mail .4byte 0 .4byte NULL .4byte 0 @@ -1841,7 +1841,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 0 - .4byte sub_80FD278 + .4byte ItemUseOutOfBattle_Mail .4byte 0 .4byte NULL .4byte 1 @@ -1856,7 +1856,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 0 - .4byte sub_80FD278 + .4byte ItemUseOutOfBattle_Mail .4byte 0 .4byte NULL .4byte 2 @@ -1871,7 +1871,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 0 - .4byte sub_80FD278 + .4byte ItemUseOutOfBattle_Mail .4byte 0 .4byte NULL .4byte 3 @@ -1886,7 +1886,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 0 - .4byte sub_80FD278 + .4byte ItemUseOutOfBattle_Mail .4byte 0 .4byte NULL .4byte 4 @@ -1901,7 +1901,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 0 - .4byte sub_80FD278 + .4byte ItemUseOutOfBattle_Mail .4byte 0 .4byte NULL .4byte 5 @@ -1916,7 +1916,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 0 - .4byte sub_80FD278 + .4byte ItemUseOutOfBattle_Mail .4byte 0 .4byte NULL .4byte 6 @@ -1931,7 +1931,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 0 - .4byte sub_80FD278 + .4byte ItemUseOutOfBattle_Mail .4byte 0 .4byte NULL .4byte 7 @@ -1946,7 +1946,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 0 - .4byte sub_80FD278 + .4byte ItemUseOutOfBattle_Mail .4byte 0 .4byte NULL .4byte 8 @@ -1961,7 +1961,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 0 - .4byte sub_80FD278 + .4byte ItemUseOutOfBattle_Mail .4byte 0 .4byte NULL .4byte 9 @@ -1976,7 +1976,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 0 - .4byte sub_80FD278 + .4byte ItemUseOutOfBattle_Mail .4byte 0 .4byte NULL .4byte 10 @@ -1991,7 +1991,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 0 - .4byte sub_80FD278 + .4byte ItemUseOutOfBattle_Mail .4byte 0 .4byte NULL .4byte 11 @@ -2006,9 +2006,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 1 - .4byte item_field_func_recovery_item + .4byte ItemUseOutOfBattle_Medicine .4byte 1 - .4byte item_in_battle_func_recovery_item + .4byte ItemUseInBattle_Medicine .4byte 0 .charmapstr "CHESTO BERRY$", 14 @@ -2021,9 +2021,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 1 - .4byte item_field_func_recovery_item + .4byte ItemUseOutOfBattle_Medicine .4byte 1 - .4byte item_in_battle_func_recovery_item + .4byte ItemUseInBattle_Medicine .4byte 0 .charmapstr "PECHA BERRY$", 14 @@ -2036,9 +2036,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 1 - .4byte item_field_func_recovery_item + .4byte ItemUseOutOfBattle_Medicine .4byte 1 - .4byte item_in_battle_func_recovery_item + .4byte ItemUseInBattle_Medicine .4byte 0 .charmapstr "RAWST BERRY$", 14 @@ -2051,9 +2051,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 1 - .4byte item_field_func_recovery_item + .4byte ItemUseOutOfBattle_Medicine .4byte 1 - .4byte item_in_battle_func_recovery_item + .4byte ItemUseInBattle_Medicine .4byte 0 .charmapstr "ASPEAR BERRY$", 14 @@ -2066,9 +2066,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 1 - .4byte item_field_func_recovery_item + .4byte ItemUseOutOfBattle_Medicine .4byte 1 - .4byte item_in_battle_func_recovery_item + .4byte ItemUseInBattle_Medicine .4byte 0 .charmapstr "LEPPA BERRY$", 14 @@ -2081,9 +2081,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 1 - .4byte item_field_func_pp_recovery_item + .4byte ItemUseOutOfBattle_PPRecovery .4byte 1 - .4byte item_in_battle_func_pp_recovery_item + .4byte ItemUseInBattle_PPRecovery .4byte 0 .charmapstr "ORAN BERRY$", 14 @@ -2096,9 +2096,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 1 - .4byte item_field_func_recovery_item + .4byte ItemUseOutOfBattle_Medicine .4byte 1 - .4byte item_in_battle_func_recovery_item + .4byte ItemUseInBattle_Medicine .4byte 0 .charmapstr "PERSIM BERRY$", 14 @@ -2111,9 +2111,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 1 - .4byte item_in_battle_func_recovery_item + .4byte ItemUseInBattle_Medicine .4byte 0 .charmapstr "LUM BERRY$", 14 @@ -2126,9 +2126,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 1 - .4byte item_field_func_recovery_item + .4byte ItemUseOutOfBattle_Medicine .4byte 1 - .4byte item_in_battle_func_recovery_item + .4byte ItemUseInBattle_Medicine .4byte 0 .charmapstr "SITRUS BERRY$", 14 @@ -2141,9 +2141,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 1 - .4byte item_field_func_recovery_item + .4byte ItemUseOutOfBattle_Medicine .4byte 1 - .4byte item_in_battle_func_recovery_item + .4byte ItemUseInBattle_Medicine .4byte 0 .charmapstr "FIGY BERRY$", 14 @@ -2156,7 +2156,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2171,7 +2171,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2186,7 +2186,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2201,7 +2201,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2216,7 +2216,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2231,7 +2231,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2246,7 +2246,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2261,7 +2261,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2276,7 +2276,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2291,7 +2291,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2306,7 +2306,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 1 - .4byte sub_80FDEBC + .4byte ItemUseOutOfBattle_ReduceEV .4byte 0 .4byte NULL .4byte 0 @@ -2321,7 +2321,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 1 - .4byte sub_80FDEBC + .4byte ItemUseOutOfBattle_ReduceEV .4byte 0 .4byte NULL .4byte 0 @@ -2336,7 +2336,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 1 - .4byte sub_80FDEBC + .4byte ItemUseOutOfBattle_ReduceEV .4byte 0 .4byte NULL .4byte 0 @@ -2351,7 +2351,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 1 - .4byte sub_80FDEBC + .4byte ItemUseOutOfBattle_ReduceEV .4byte 0 .4byte NULL .4byte 0 @@ -2366,7 +2366,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 1 - .4byte sub_80FDEBC + .4byte ItemUseOutOfBattle_ReduceEV .4byte 0 .4byte NULL .4byte 0 @@ -2381,7 +2381,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 1 - .4byte sub_80FDEBC + .4byte ItemUseOutOfBattle_ReduceEV .4byte 0 .4byte NULL .4byte 0 @@ -2396,7 +2396,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2411,7 +2411,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2426,7 +2426,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2441,7 +2441,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2456,7 +2456,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2471,7 +2471,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2486,7 +2486,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2501,7 +2501,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2516,7 +2516,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2531,7 +2531,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2546,7 +2546,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2561,7 +2561,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2576,7 +2576,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2591,7 +2591,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2606,7 +2606,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2621,7 +2621,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2636,9 +2636,9 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_BERRIES .byte 4 - .4byte sub_80FE650 + .4byte ItemUseOutOfBattle_EnigmaBerry .4byte 1 - .4byte sub_80FE77C + .4byte ItemUseInBattle_EnigmaBerry .4byte 0 .charmapstr "????????$", 14 @@ -2651,7 +2651,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2666,7 +2666,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2681,7 +2681,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2696,7 +2696,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2711,7 +2711,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2726,7 +2726,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2741,7 +2741,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2756,7 +2756,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2771,7 +2771,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2786,7 +2786,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2801,7 +2801,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2816,7 +2816,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2831,7 +2831,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2846,7 +2846,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2861,7 +2861,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2876,7 +2876,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2891,7 +2891,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2906,7 +2906,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2921,7 +2921,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2936,7 +2936,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2951,7 +2951,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2966,7 +2966,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2981,7 +2981,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -2996,7 +2996,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3011,7 +3011,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3026,7 +3026,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3041,7 +3041,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3056,7 +3056,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3071,7 +3071,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3086,7 +3086,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3101,7 +3101,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3116,7 +3116,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3131,7 +3131,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3146,7 +3146,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3161,7 +3161,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3176,7 +3176,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3191,7 +3191,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3206,7 +3206,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3221,7 +3221,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3236,7 +3236,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3251,7 +3251,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3266,7 +3266,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3281,7 +3281,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3296,7 +3296,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3311,7 +3311,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3326,7 +3326,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3341,7 +3341,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3356,7 +3356,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3371,7 +3371,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3386,7 +3386,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3401,7 +3401,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3416,7 +3416,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3431,7 +3431,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3446,7 +3446,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3461,7 +3461,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3476,7 +3476,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3491,7 +3491,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3506,7 +3506,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3521,7 +3521,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3536,7 +3536,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3551,7 +3551,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3566,7 +3566,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3581,7 +3581,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3596,7 +3596,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3611,7 +3611,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3626,7 +3626,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3641,7 +3641,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3656,7 +3656,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3671,7 +3671,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3686,7 +3686,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3701,7 +3701,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3716,7 +3716,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3731,7 +3731,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3746,7 +3746,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3761,7 +3761,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3776,7 +3776,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3791,7 +3791,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3806,7 +3806,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3821,7 +3821,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3836,7 +3836,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3851,7 +3851,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3866,7 +3866,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3881,7 +3881,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -3896,7 +3896,7 @@ gItems: ; 85839A0 .byte 1 .byte POCKET_KEY_ITEMS .byte 2 - .4byte item_field_func_bike + .4byte ItemUseOutOfBattle_Bike .4byte 0 .4byte NULL .4byte 0 @@ -3911,7 +3911,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_KEY_ITEMS .byte 4 - .4byte sub_80FDC34 + .4byte ItemUseOutOfBattle_CoinCase .4byte 0 .4byte NULL .4byte 0 @@ -3926,7 +3926,7 @@ gItems: ; 85839A0 .byte 1 .byte POCKET_KEY_ITEMS .byte 2 - .4byte it_itemfinder + .4byte ItemUseOutOfBattle_Itemfinder .4byte 0 .4byte NULL .4byte 0 @@ -3941,7 +3941,7 @@ gItems: ; 85839A0 .byte 1 .byte POCKET_KEY_ITEMS .byte 2 - .4byte rod + .4byte ItemUseOutOfBattle_Rod .4byte 0 .4byte NULL .4byte 0 @@ -3956,7 +3956,7 @@ gItems: ; 85839A0 .byte 1 .byte POCKET_KEY_ITEMS .byte 2 - .4byte rod + .4byte ItemUseOutOfBattle_Rod .4byte 0 .4byte NULL .4byte 1 @@ -3971,7 +3971,7 @@ gItems: ; 85839A0 .byte 1 .byte POCKET_KEY_ITEMS .byte 2 - .4byte rod + .4byte ItemUseOutOfBattle_Rod .4byte 0 .4byte NULL .4byte 2 @@ -3986,7 +3986,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -4001,7 +4001,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -4016,7 +4016,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -4031,7 +4031,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_KEY_ITEMS .byte 2 - .4byte sub_80FDDA4 + .4byte ItemUseOutOfBattle_WailmerPail .4byte 0 .4byte NULL .4byte 0 @@ -4046,7 +4046,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -4061,7 +4061,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -4076,7 +4076,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -4091,7 +4091,7 @@ gItems: ; 85839A0 .byte 1 .byte POCKET_KEY_ITEMS .byte 2 - .4byte item_field_func_bike + .4byte ItemUseOutOfBattle_Bike .4byte 0 .4byte NULL .4byte 1 @@ -4106,7 +4106,7 @@ gItems: ; 85839A0 .byte 1 .byte POCKET_KEY_ITEMS .byte 3 - .4byte sub_80FDB6C + .4byte ItemUseOutOfBattle_PokeblockCase .4byte 0 .4byte NULL .4byte 0 @@ -4121,7 +4121,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -4136,7 +4136,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 1 @@ -4151,7 +4151,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -4166,7 +4166,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -4181,7 +4181,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -4196,7 +4196,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -4211,7 +4211,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -4226,7 +4226,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -4241,7 +4241,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -4256,7 +4256,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -4271,7 +4271,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -4286,7 +4286,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -4301,7 +4301,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -4316,7 +4316,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -4331,7 +4331,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -4346,7 +4346,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4361,7 +4361,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4376,7 +4376,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4391,7 +4391,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4406,7 +4406,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4421,7 +4421,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4436,7 +4436,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4451,7 +4451,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4466,7 +4466,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4481,7 +4481,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4496,7 +4496,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4511,7 +4511,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4526,7 +4526,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4541,7 +4541,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4556,7 +4556,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4571,7 +4571,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4586,7 +4586,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4601,7 +4601,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4616,7 +4616,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4631,7 +4631,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4646,7 +4646,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4661,7 +4661,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4676,7 +4676,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4691,7 +4691,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4706,7 +4706,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4721,7 +4721,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4736,7 +4736,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4751,7 +4751,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4766,7 +4766,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4781,7 +4781,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4796,7 +4796,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4811,7 +4811,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4826,7 +4826,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4841,7 +4841,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4856,7 +4856,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4871,7 +4871,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4886,7 +4886,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4901,7 +4901,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4916,7 +4916,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4931,7 +4931,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4946,7 +4946,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4961,7 +4961,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4976,7 +4976,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -4991,7 +4991,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -5006,7 +5006,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -5021,7 +5021,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -5036,7 +5036,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -5051,7 +5051,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -5066,7 +5066,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -5081,7 +5081,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -5096,7 +5096,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -5111,7 +5111,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -5126,7 +5126,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -5141,7 +5141,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -5156,7 +5156,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -5171,7 +5171,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -5186,7 +5186,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -5201,7 +5201,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_TM_HM .byte 1 - .4byte sub_80FDF48 + .4byte ItemUseOutOfBattle_TMHM .4byte 0 .4byte NULL .4byte 0 @@ -5216,7 +5216,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -5231,7 +5231,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -5246,7 +5246,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -5261,7 +5261,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -5276,7 +5276,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -5291,7 +5291,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -5306,7 +5306,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -5321,7 +5321,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -5336,7 +5336,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -5351,7 +5351,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -5366,7 +5366,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -5381,7 +5381,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -5396,7 +5396,7 @@ gItems: ; 85839A0 .byte 0 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -5411,7 +5411,7 @@ gItems: ; 85839A0 .byte 1 .byte POCKET_KEY_ITEMS .byte 2 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -5426,7 +5426,7 @@ gItems: ; 85839A0 .byte 1 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -5441,7 +5441,7 @@ gItems: ; 85839A0 .byte 1 .byte POCKET_KEY_ITEMS .byte 2 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -5456,7 +5456,7 @@ gItems: ; 85839A0 .byte 1 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -5471,7 +5471,7 @@ gItems: ; 85839A0 .byte 1 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -5486,7 +5486,7 @@ gItems: ; 85839A0 .byte 1 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -5501,7 +5501,7 @@ gItems: ; 85839A0 .byte 1 .byte POCKET_KEY_ITEMS .byte 2 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -5516,7 +5516,7 @@ gItems: ; 85839A0 .byte 1 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -5531,7 +5531,7 @@ gItems: ; 85839A0 .byte 1 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -5546,7 +5546,7 @@ gItems: ; 85839A0 .byte 1 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -5561,7 +5561,7 @@ gItems: ; 85839A0 .byte 1 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -5576,7 +5576,7 @@ gItems: ; 85839A0 .byte 1 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -5591,7 +5591,7 @@ gItems: ; 85839A0 .byte 1 .byte POCKET_KEY_ITEMS .byte 4 - .4byte sub_80FDCA4 + .4byte ItemUseOutOfBattle_PowderJar .4byte 0 .4byte NULL .4byte 0 @@ -5606,7 +5606,7 @@ gItems: ; 85839A0 .byte 1 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -5621,7 +5621,7 @@ gItems: ; 85839A0 .byte 1 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -5636,7 +5636,7 @@ gItems: ; 85839A0 .byte 1 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0 @@ -5651,7 +5651,7 @@ gItems: ; 85839A0 .byte 1 .byte POCKET_KEY_ITEMS .byte 4 - .4byte item_field_func_cannot_use + .4byte ItemUseOutOfBattle_CannotUse .4byte 0 .4byte NULL .4byte 0