diff --git a/asm/battle_3.s b/asm/battle_3.s index e540d67bb..9a7a03e6f 100644 --- a/asm/battle_3.s +++ b/asm/battle_3.s @@ -1601,7 +1601,7 @@ _080408F6: bne _080408FE b _0804025E _080408FE: - ldr r0, =gUnknown_03005D04 + ldr r0, =gBattleMainFunc ldr r1, [r0] ldr r0, =sub_803B9BC eors r1, r0 @@ -8138,7 +8138,7 @@ b_call_bc_move_exec: @ 8044458 lsls r0, 24 lsrs r0, 22 adds r2, r0 - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, [r1] str r0, [r2] ldr r0, =bc_move_exec_returning @@ -8168,7 +8168,7 @@ b_push_move_exec: @ 8044498 lsls r0, 24 lsrs r0, 22 adds r2, r0 - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, [r1] str r0, [r2] ldr r0, =sub_803E08C diff --git a/asm/battle_4.s b/asm/battle_4.s index b5d15859a..08de752f0 100644 --- a/asm/battle_4.s +++ b/asm/battle_4.s @@ -10013,7 +10013,7 @@ atk3F_end3: @ 804B6BC subs r0, 0x1 strb r0, [r1] _0804B6D6: - ldr r2, =gUnknown_03005D04 + ldr r2, =gBattleMainFunc ldr r0, [r3] ldr r1, [r0, 0xC] adds r0, r1, 0 diff --git a/asm/battle_controller_opponent.s b/asm/battle_controller_opponent.s index f394feb6a..911b7ad19 100644 --- a/asm/battle_controller_opponent.s +++ b/asm/battle_controller_opponent.s @@ -11,21 +11,21 @@ nullsub_26: @ 805F160 bx lr thumb_func_end nullsub_26 - thumb_func_start sub_805F164 -sub_805F164: @ 805F164 + thumb_func_start SetBankFuncToOpponentBufferRunCommand +SetBankFuncToOpponentBufferRunCommand: @ 805F164 ldr r1, =gBattleBankFunc ldr r0, =gActiveBank ldrb r0, [r0] lsls r0, 2 adds r0, r1 - ldr r1, =bx_exec_buffer_A_ch0_tbl7 + ldr r1, =OpponentBufferRunCommand str r1, [r0] bx lr .pool - thumb_func_end sub_805F164 + thumb_func_end SetBankFuncToOpponentBufferRunCommand - thumb_func_start bx_exec_buffer_A_ch0_tbl7 -bx_exec_buffer_A_ch0_tbl7: @ 805F180 + thumb_func_start OpponentBufferRunCommand +OpponentBufferRunCommand: @ 805F180 push {lr} ldr r2, =gBattleExecBuffer ldr r1, =gBitTable @@ -44,7 +44,7 @@ bx_exec_buffer_A_ch0_tbl7: @ 805F180 ldrb r0, [r1] cmp r0, 0x38 bhi _0805F1C8 - ldr r0, =gUnknown_0831C6C8 + ldr r0, =gOpponentBufferCommands ldrb r1, [r1] lsls r1, 2 adds r1, r0 @@ -53,11 +53,11 @@ bx_exec_buffer_A_ch0_tbl7: @ 805F180 b _0805F1CC .pool _0805F1C8: - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted _0805F1CC: pop {r0} bx r0 - thumb_func_end bx_exec_buffer_A_ch0_tbl7 + thumb_func_end OpponentBufferRunCommand thumb_func_start sub_805F1D0 sub_805F1D0: @ 805F1D0 @@ -77,7 +77,7 @@ sub_805F1D0: @ 805F1D0 ldr r0, =SpriteCallbackDummy cmp r1, r0 bne _0805F1F4 - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted _0805F1F4: pop {r0} bx r0 @@ -102,7 +102,7 @@ sub_805F208: @ 805F208 ldr r0, =SpriteCallbackDummy cmp r1, r0 bne _0805F22C - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted _0805F22C: pop {r0} bx r0 @@ -147,7 +147,7 @@ sub_805F240: @ 805F240 lsls r0, 2 adds r0, r5 bl DestroySprite - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted _0805F292: pop {r4-r6} pop {r0} @@ -183,7 +183,7 @@ sub_805F2A8: @ 805F2A8 adds r0, r2 movs r1, 0 strb r1, [r0, 0x9] - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted _0805F2E0: pop {r4} pop {r0} @@ -1043,7 +1043,7 @@ _0805F9E0: bl FreeSpriteTilesByTag adds r0, r4, 0 bl FreeSpritePaletteByTag - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted _0805FA48: pop {r4,r5} pop {r0} @@ -1083,7 +1083,7 @@ sub_805FA70: @ 805FA70 b _0805FABC .pool _0805FAB8: - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted _0805FABC: pop {r4-r6} pop {r0} @@ -1112,7 +1112,7 @@ sub_805FAC4: @ 805FAC4 adds r0, r3, r0 ldrb r0, [r0] bl sub_8072984 - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted _0805FAF2: pop {r0} bx r0 @@ -1160,7 +1160,7 @@ sub_805FB08: @ 805FB08 adds r0, r1 ldrb r0, [r0] bl sub_8072984 - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted _0805FB62: pop {r4-r6} pop {r0} @@ -1176,7 +1176,7 @@ bx_t7_button_a: @ 805FB7C lsls r0, 16 cmp r0, 0 bne _0805FB8E - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted _0805FB8E: pop {r0} bx r0 @@ -1210,7 +1210,7 @@ bx_blink_t7: @ 805FB94 strb r0, [r2] ldr r0, =gDoingBattleAnim strb r3, [r0] - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted b _0805FC0A .pool _0805FBE0: @@ -1333,7 +1333,7 @@ _0805FCCA: movs r2, 0x80 lsls r2, 1 bl m4aMPlayVolumeControl - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted _0805FCDA: pop {r4} pop {r0} @@ -1538,7 +1538,7 @@ sub_805FEB8: @ 805FEB8 ands r0, r1 cmp r0, 0 bne _0805FEDA - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted _0805FEDA: pop {r0} bx r0 @@ -1562,15 +1562,15 @@ bx_803B0F4: @ 805FEE8 ands r0, r1 cmp r0, 0 bne _0805FF0A - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted _0805FF0A: pop {r0} bx r0 .pool thumb_func_end bx_803B0F4 - thumb_func_start dp01_tbl7_exec_completed -dp01_tbl7_exec_completed: @ 805FF18 + thumb_func_start OpponentBufferExecCompleted +OpponentBufferExecCompleted: @ 805FF18 push {r4,lr} sub sp, 0x4 ldr r1, =gBattleBankFunc @@ -1578,7 +1578,7 @@ dp01_tbl7_exec_completed: @ 805FF18 ldrb r0, [r4] lsls r0, 2 adds r0, r1 - ldr r1, =bx_exec_buffer_A_ch0_tbl7 + ldr r1, =OpponentBufferRunCommand str r1, [r0] ldr r0, =gBattleTypeFlags ldr r0, [r0] @@ -1617,7 +1617,7 @@ _0805FF7E: pop {r0} bx r0 .pool - thumb_func_end dp01_tbl7_exec_completed + thumb_func_end OpponentBufferExecCompleted thumb_func_start dp01t_00_7_getattr dp01t_00_7_getattr: @ 805FF90 @@ -1667,7 +1667,7 @@ _0805FFEA: movs r0, 0x1 mov r2, sp bl dp01_build_cmdbuf_x1D_1D_numargs_varargs - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted add sp, 0x100 pop {r4-r6} pop {r0} @@ -2608,7 +2608,7 @@ _08060806: movs r0, 0x1 adds r2, r4, 0 bl dp01_build_cmdbuf_x1D_1D_numargs_varargs - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted add sp, 0x58 pop {r4-r7} pop {r0} @@ -2653,7 +2653,7 @@ _0806087A: cmp r5, 0x5 bls _0806086C _08060886: - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted pop {r4,r5} pop {r0} bx r0 @@ -3692,7 +3692,7 @@ _080611E6: cmp r3, r0 bcc _080611E6 _08061208: - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted pop {r4-r7} pop {r0} bx r0 @@ -4110,7 +4110,7 @@ _080615B4: adds r0, r1 ldrb r0, [r0] bl sub_8072984 - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted _080615F0: pop {r4-r6} pop {r0} @@ -4818,7 +4818,7 @@ _08061C2C: thumb_func_start sub_8061C48 sub_8061C48: @ 8061C48 push {lr} - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_8061C48 @@ -4826,7 +4826,7 @@ sub_8061C48: @ 8061C48 thumb_func_start sub_8061C54 sub_8061C54: @ 8061C54 push {lr} - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_8061C54 @@ -4834,7 +4834,7 @@ sub_8061C54: @ 8061C54 thumb_func_start sub_8061C60 sub_8061C60: @ 8061C60 push {lr} - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_8061C60 @@ -4842,7 +4842,7 @@ sub_8061C60: @ 8061C60 thumb_func_start sub_8061C6C sub_8061C6C: @ 8061C6C push {lr} - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_8061C6C @@ -4958,7 +4958,7 @@ _08061C8A: lsrs r3, r0, 24 cmp r3, 0 beq _08061D80 - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted b _08061D9E .pool _08061D80: @@ -5157,7 +5157,7 @@ _08061EE8: lsls r0, 2 adds r0, r2 strb r4, [r0, 0x4] - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted _08061F24: pop {r3-r5} mov r8, r3 @@ -5204,7 +5204,7 @@ sub_8061F34: @ 8061F34 thumb_func_start sub_8061F90 sub_8061F90: @ 8061F90 push {lr} - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_8061F90 @@ -5213,7 +5213,7 @@ sub_8061F90: @ 8061F90 sub_8061F9C: @ 8061F9C push {lr} bl sub_8063880 - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_8061F9C @@ -5221,7 +5221,7 @@ sub_8061F9C: @ 8061F9C thumb_func_start sub_8061FAC sub_8061FAC: @ 8061FAC push {lr} - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_8061FAC @@ -5245,7 +5245,7 @@ sub_8061FB8: @ 8061FB8 _08061FD6: bl dp01_build_cmdbuf_x21_a_bb _08061FDA: - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted b _08062156 .pool _08061FE4: @@ -5415,7 +5415,7 @@ _0806213C: movs r1, 0xA bl dp01_build_cmdbuf_x21_a_bb _08062152: - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted _08062156: pop {r4-r6} pop {r0} @@ -5436,7 +5436,7 @@ sub_806215C: @ 806215C ldrb r1, [r0] movs r0, 0x1 bl dp01_build_cmdbuf_x23_aa_0 - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted pop {r0} bx r0 .pool @@ -5551,7 +5551,7 @@ _0806225A: movs r0, 0x1 movs r2, 0 bl dp01_build_cmdbuf_x22_a_three_bytes - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted pop {r4-r7} pop {r0} bx r0 @@ -5561,7 +5561,7 @@ _0806225A: thumb_func_start sub_8062288 sub_8062288: @ 8062288 push {lr} - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_8062288 @@ -5665,7 +5665,7 @@ _0806234E: thumb_func_start sub_8062384 sub_8062384: @ 8062384 push {lr} - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_8062384 @@ -5769,7 +5769,7 @@ _08062458: thumb_func_start sub_8062470 sub_8062470: @ 8062470 push {lr} - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_8062470 @@ -5777,7 +5777,7 @@ sub_8062470: @ 8062470 thumb_func_start sub_806247C sub_806247C: @ 806247C push {lr} - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_806247C @@ -5785,7 +5785,7 @@ sub_806247C: @ 806247C thumb_func_start sub_8062488 sub_8062488: @ 8062488 push {lr} - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_8062488 @@ -5793,7 +5793,7 @@ sub_8062488: @ 8062488 thumb_func_start sub_8062494 sub_8062494: @ 8062494 push {lr} - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_8062494 @@ -5801,7 +5801,7 @@ sub_8062494: @ 8062494 thumb_func_start sub_80624A0 sub_80624A0: @ 80624A0 push {lr} - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_80624A0 @@ -5809,7 +5809,7 @@ sub_80624A0: @ 80624A0 thumb_func_start sub_80624AC sub_80624AC: @ 80624AC push {lr} - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_80624AC @@ -5817,7 +5817,7 @@ sub_80624AC: @ 80624AC thumb_func_start sub_80624B8 sub_80624B8: @ 80624B8 push {lr} - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_80624B8 @@ -5825,7 +5825,7 @@ sub_80624B8: @ 80624B8 thumb_func_start sub_80624C4 sub_80624C4: @ 80624C4 push {lr} - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_80624C4 @@ -5833,7 +5833,7 @@ sub_80624C4: @ 80624C4 thumb_func_start sub_80624D0 sub_80624D0: @ 80624D0 push {lr} - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_80624D0 @@ -5847,7 +5847,7 @@ sub_80624DC: @ 80624DC negs r0, r0 ands r0, r1 strb r0, [r2] - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted pop {r0} bx r0 .pool @@ -5872,7 +5872,7 @@ sub_80624F8: @ 80624F8 ands r0, r2 orrs r0, r1 strb r0, [r3] - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted pop {r0} bx r0 .pool @@ -5886,7 +5886,7 @@ sub_8062530: @ 8062530 movs r0, 0x7F ands r0, r1 strb r0, [r2] - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted pop {r0} bx r0 .pool @@ -5907,7 +5907,7 @@ sub_8062548: @ 8062548 ands r0, r2 orrs r0, r1 strb r0, [r3] - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted pop {r0} bx r0 .pool @@ -5931,7 +5931,7 @@ dp01t_29_7_blink: @ 8062570 lsls r0, 29 cmp r0, 0 bge _080625A4 - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted b _080625CE .pool _080625A4: @@ -5965,7 +5965,7 @@ _080625CE: thumb_func_start sub_80625E0 sub_80625E0: @ 80625E0 push {lr} - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_80625E0 @@ -5996,7 +5996,7 @@ _08062600: lsls r1, r3, 24 asrs r1, 24 bl PlaySE12WithPanning - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted pop {r4} pop {r0} bx r0 @@ -6040,7 +6040,7 @@ _0806266C: orrs r0, r1 bl PlayFanfare _08062680: - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted pop {r4,r5} pop {r0} bx r0 @@ -6066,7 +6066,7 @@ sub_806268C: @ 806268C movs r1, 0x19 movs r2, 0x5 bl PlayCry3 - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted pop {r0} bx r0 .pool @@ -6088,7 +6088,7 @@ dp01t_2E_7_battle_intro: @ 80626C8 movs r1, 0x1 orrs r0, r1 strh r0, [r2] - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted pop {r0} bx r0 .pool @@ -6344,7 +6344,7 @@ dp01t_30_7_0803D67C: @ 8062918 lsls r0, 24 cmp r0, 0 bne _08062948 - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted b _08062A12 .pool _08062948: @@ -6480,7 +6480,7 @@ bx_0803D790_t7: @ 8062A2C adds r0, r2 movs r1, 0 strb r1, [r0, 0x5] - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted _08062A64: pop {r4} pop {r0} @@ -6516,7 +6516,7 @@ sub_8062A74: @ 8062A74 ldr r1, =sub_8073C30 str r1, [r0] _08062AA6: - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted pop {r0} bx r0 .pool @@ -6525,7 +6525,7 @@ _08062AA6: thumb_func_start sub_8062AC4 sub_8062AC4: @ 8062AC4 push {lr} - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_8062AC4 @@ -6566,7 +6566,7 @@ sub_8062AD0: @ 8062AD0 ldrb r0, [r4] bl sub_805E408 _08062B16: - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted pop {r4} pop {r0} bx r0 @@ -6604,7 +6604,7 @@ dp01t_34_7_move_anim_start_t3: @ 8062B30 lsls r0, 24 cmp r0, 0 beq _08062B7C - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted b _08062B88 .pool _08062B7C: @@ -6625,7 +6625,7 @@ _08062B88: thumb_func_start sub_8062B98 sub_8062B98: @ 8062B98 push {lr} - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_8062B98 @@ -6633,7 +6633,7 @@ sub_8062B98: @ 8062B98 thumb_func_start sub_8062BA4 sub_8062BA4: @ 8062BA4 push {lr} - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted pop {r0} bx r0 thumb_func_end sub_8062BA4 @@ -6661,7 +6661,7 @@ sub_8062BB0: @ 8062BB0 ldr r0, [r2, 0x8] bl SetMainCallback2 _08062BDA: - bl dp01_tbl7_exec_completed + bl OpponentBufferExecCompleted pop {r0} bx r0 .pool diff --git a/asm/battle_controller_recorded_opponent.s b/asm/battle_controller_recorded_opponent.s new file mode 100644 index 000000000..dde7617e8 --- /dev/null +++ b/asm/battle_controller_recorded_opponent.s @@ -0,0 +1,5969 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start nullsub_70 +nullsub_70: @ 81864E8 + bx lr + thumb_func_end nullsub_70 + + thumb_func_start SetBankFuncToRecordedOpponentBufferRunCommand +SetBankFuncToRecordedOpponentBufferRunCommand: @ 81864EC + ldr r1, =gBattleBankFunc + ldr r0, =gActiveBank + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =RecordedOpponentBufferRunCommand + str r1, [r0] + bx lr + .pool + thumb_func_end SetBankFuncToRecordedOpponentBufferRunCommand + + thumb_func_start RecordedOpponentBufferRunCommand +RecordedOpponentBufferRunCommand: @ 8186508 + push {lr} + ldr r2, =gBattleExecBuffer + ldr r1, =gBitTable + ldr r0, =gActiveBank + ldrb r3, [r0] + lsls r0, r3, 2 + adds r0, r1 + ldr r1, [r2] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _08186554 + ldr r0, =gBattleBufferA + lsls r1, r3, 9 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x38 + bhi _08186550 + ldr r0, =gRecordedOpponentBufferCommands + ldrb r1, [r1] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + bl _call_via_r0 + b _08186554 + .pool +_08186550: + bl RecordedOpponentBufferExecCompleted +_08186554: + pop {r0} + bx r0 + thumb_func_end RecordedOpponentBufferRunCommand + + thumb_func_start sub_8186558 +sub_8186558: @ 8186558 + push {lr} + ldr r2, =gSprites + ldr r1, =gBankSpriteIds + ldr r0, =gActiveBank + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =SpriteCallbackDummy + cmp r1, r0 + bne _0818657C + bl RecordedOpponentBufferExecCompleted +_0818657C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8186558 + + thumb_func_start sub_8186590 +sub_8186590: @ 8186590 + push {lr} + ldr r2, =gSprites + ldr r1, =gBankSpriteIds + ldr r0, =gActiveBank + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =SpriteCallbackDummy + cmp r1, r0 + bne _081865B4 + bl RecordedOpponentBufferExecCompleted +_081865B4: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8186590 + + thumb_func_start sub_81865C8 +sub_81865C8: @ 81865C8 + push {r4-r6,lr} + ldr r5, =gSprites + ldr r6, =gBankSpriteIds + ldr r4, =gActiveBank + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r2, r0, 2 + adds r0, r5, 0 + adds r0, 0x1C + adds r0, r2, r0 + ldr r1, [r0] + ldr r0, =SpriteCallbackDummy + cmp r1, r0 + bne _0818661A + adds r0, r2, r5 + ldrh r0, [r0, 0x6] + bl sub_805DFE4 + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl FreeSpriteOamMatrix + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl DestroySprite + bl RecordedOpponentBufferExecCompleted +_0818661A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81865C8 + + thumb_func_start sub_8186630 +sub_8186630: @ 8186630 + push {r4,lr} + ldr r4, =gUnknown_020244D0 + ldr r1, [r4] + ldr r3, =gActiveBank + ldrb r0, [r3] + ldr r2, [r1, 0x4] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0x9] + subs r0, 0x1 + strb r0, [r1, 0x9] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _08186668 + ldr r0, [r4] + ldrb r1, [r3] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0 + strb r1, [r0, 0x9] + bl RecordedOpponentBufferExecCompleted +_08186668: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8186630 + + thumb_func_start sub_8186678 +sub_8186678: @ 8186678 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r0, 0 + mov r9, r0 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _081866A4 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _081866F8 + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081866F8 +_081866A4: + ldr r4, =gSprites + ldr r0, =gUnknown_03005D70 + ldr r2, =gActiveBank + ldrb r3, [r2] + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, [r0] + ldr r0, =SpriteCallbackDummy + mov r8, r2 + cmp r1, r0 + bne _08186764 + ldr r0, =gBankSpriteIds + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 27 + cmp r0, 0 + bge _08186764 + b _0818676A + .pool +_081866F8: + ldr r6, =gSprites + ldr r7, =gUnknown_03005D70 + ldr r2, =gActiveBank + ldrb r3, [r2] + adds r0, r3, r7 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r5, r6, 0 + adds r5, 0x1C + adds r0, r5 + ldr r4, [r0] + ldr r0, =SpriteCallbackDummy + mov r8, r2 + cmp r4, r0 + bne _08186764 + movs r0, 0x2 + adds r2, r3, 0 + eors r2, r0 + adds r0, r2, r7 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r0, [r0] + cmp r0, r4 + bne _08186764 + ldr r4, =gBankSpriteIds + adds r0, r3, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 27 + cmp r0, 0 + bge _08186764 + adds r0, r2, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 27 + cmp r0, 0 + bge _08186764 + movs r1, 0x1 + mov r9, r1 +_08186764: + mov r2, r9 + cmp r2, 0 + beq _0818683A +_0818676A: + mov r6, r8 + ldrb r0, [r6] + bl GetBankIdentity + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x1 + bne _08186816 + ldr r0, =gUnknown_020244D0 + mov r12, r0 + ldr r0, [r0] + ldrb r2, [r6] + ldr r5, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r4, r0, r5 + ldrb r1, [r4, 0x1] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _0818683A + movs r7, 0x2 + adds r1, r7, 0 + eors r1, r2 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrb r1, [r0, 0x1] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _0818683A + ldrb r1, [r4] + movs r3, 0x7F + adds r0, r3, 0 + ands r0, r1 + strb r0, [r4] + mov r1, r12 + ldr r0, [r1] + ldrb r2, [r6] + ldr r0, [r0, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x1] + movs r4, 0x2 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + strb r0, [r1, 0x1] + mov r0, r12 + ldr r2, [r0] + ldrb r0, [r6] + adds r1, r7, 0 + eors r1, r0 + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + ands r3, r1 + strb r3, [r0] + mov r1, r12 + ldr r2, [r1] + ldrb r0, [r6] + adds r1, r7, 0 + eors r1, r0 + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x1] + ands r4, r1 + strb r4, [r0, 0x1] + ldr r4, =0x000027f9 + adds r0, r4, 0 + bl FreeSpriteTilesByTag + adds r0, r4, 0 + bl FreeSpritePaletteByTag +_08186816: + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + mov r2, r8 + ldrb r1, [r2] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x3 + strb r1, [r0, 0x9] + ldr r1, =gBattleBankFunc + mov r2, r8 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8186630 + str r1, [r0] +_0818683A: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8186678 + + thumb_func_start sub_818686C +sub_818686C: @ 818686C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r0, 0 + mov r9, r0 + mov r8, r0 + ldr r4, =gUnknown_020244D0 + ldr r0, [r4] + ldr r7, =gActiveBank + ldrb r2, [r7] + ldr r1, [r0, 0x4] + lsls r3, r2, 1 + adds r0, r3, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r5, 0x88 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + bne _081868AC + ldr r0, =gBattlePartyID + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gEnemyParty + adds r1, r0 + adds r0, r2, 0 + bl sub_8172EF0 +_081868AC: + ldr r1, [r4] + ldrb r0, [r7] + movs r6, 0x2 + adds r2, r6, 0 + eors r2, r0 + ldr r1, [r1, 0x4] + lsls r3, r2, 1 + adds r0, r3, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + bne _081868DE + ldr r0, =gBattlePartyID + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gEnemyParty + adds r1, r0 + adds r0, r2, 0 + bl sub_8172EF0 +_081868DE: + ldr r0, [r4] + ldrb r2, [r7] + ldr r3, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r4, r0, r3 + ldrb r1, [r4] + movs r5, 0x8 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + bne _081869AE + adds r1, r6, 0 + eors r1, r2 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r1, [r0] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + bne _081869AE + ldrb r1, [r4, 0x1] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08186994 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08186964 + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08186964 + ldr r4, =gUnknown_03005D70 + ldrb r0, [r7] + adds r1, r6, 0 + eors r1, r0 + adds r0, r1, r4 + ldrb r0, [r0] + ldr r2, =gBattlePartyID + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =gEnemyParty + adds r1, r2 + movs r2, 0 + bl healthbar_draw_field_maybe + ldrb r0, [r7] + eors r0, r6 + bl sub_8076918 + ldrb r0, [r7] + eors r0, r6 + adds r0, r4 + ldrb r0, [r0] + bl sub_80729D0 +_08186964: + ldr r5, =gUnknown_03005D70 + ldr r4, =gActiveBank + ldrb r1, [r4] + adds r0, r1, r5 + ldrb r0, [r0] + ldr r2, =gBattlePartyID + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =gEnemyParty + adds r1, r2 + movs r2, 0 + bl healthbar_draw_field_maybe + ldrb r0, [r4] + bl sub_8076918 + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + bl sub_80729D0 +_08186994: + ldr r0, =gUnknown_020244D0 + ldr r2, [r0] + ldr r0, =gActiveBank + ldrb r1, [r0] + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x1] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0, 0x1] +_081869AE: + ldr r5, =gUnknown_020244D0 + ldr r0, [r5] + ldr r4, =gActiveBank + ldrb r2, [r4] + ldr r3, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r3 + ldrb r1, [r0, 0x1] + movs r0, 0xC0 + ands r0, r1 + cmp r0, 0x80 + bne _08186A6A + movs r1, 0x2 + eors r1, r2 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r1, [r0, 0x1] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08186A6A + bl IsCryPlayingOrClearCrySongs + lsls r0, 24 + cmp r0, 0 + bne _08186A6A + ldr r0, [r5] + ldrb r2, [r4] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x1] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _08186A4C + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x42 + ands r0, r1 + cmp r0, 0x42 + bne _08186A40 + adds r0, r2, 0 + bl GetBankIdentity + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08186A4C + ldr r0, =gMPlay_BGM + bl m4aMPlayContinue + b _08186A4C + .pool +_08186A40: + ldr r0, =gMPlay_BGM + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl m4aMPlayVolumeControl +_08186A4C: + ldr r0, =gUnknown_020244D0 + ldr r2, [r0] + ldr r0, =gActiveBank + ldrb r1, [r0] + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x1] + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0, 0x1] + movs r0, 0x1 + mov r9, r0 +_08186A6A: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + bne _08186AC8 + ldr r2, =gSprites + ldr r0, =gUnknown_03005D7C + ldr r1, =gActiveBank + ldrb r4, [r1] + adds r0, r4, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r3, [r0] + ldr r0, =SpriteCallbackDummy + cmp r3, r0 + bne _08186B26 + ldr r0, =gBankSpriteIds + adds r0, r4, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + cmp r0, r3 + bne _08186B26 + b _08186B22 + .pool +_08186AC8: + ldr r2, =gSprites + ldr r7, =gUnknown_03005D7C + ldr r0, =gActiveBank + ldrb r3, [r0] + adds r0, r3, r7 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r4, [r0] + ldr r0, =SpriteCallbackDummy + cmp r4, r0 + bne _08186B26 + ldr r6, =gBankSpriteIds + adds r0, r3, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r5, [r0] + cmp r5, r4 + bne _08186B26 + movs r0, 0x2 + eors r3, r0 + adds r0, r3, r7 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r4, [r0] + cmp r4, r5 + bne _08186B26 + adds r0, r3, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + cmp r0, r4 + bne _08186B26 +_08186B22: + movs r0, 0x1 + mov r8, r0 +_08186B26: + mov r0, r9 + cmp r0, 0 + beq _08186C10 + mov r0, r8 + cmp r0, 0 + beq _08186C10 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08186B8A + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08186B8A + ldr r1, =gUnknown_03005D7C + ldr r5, =gActiveBank + ldrb r0, [r5] + movs r4, 0x2 + eors r0, r4 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + bl DestroySprite + ldrb r0, [r5] + eors r4, r0 + ldr r1, =gBattlePartyID + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0xB + bl GetMonData + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_805EE54 +_08186B8A: + ldr r1, =gUnknown_03005D7C + ldr r4, =gActiveBank + ldrb r0, [r4] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + bl DestroySprite + ldrb r5, [r4] + ldr r1, =gBattlePartyID + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0xB + bl GetMonData + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r5, 0 + bl sub_805EE54 + ldr r3, =gUnknown_020244D0 + ldr r0, [r3] + ldr r2, [r0, 0x8] + ldrb r1, [r2, 0x9] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x9] + ldr r0, [r3] + ldrb r2, [r4] + ldr r0, [r0, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x1] + movs r0, 0x21 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x1] + ldr r0, [r3] + ldrb r2, [r4] + ldr r0, [r0, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x1] + movs r0, 0x7F + ands r0, r2 + strb r0, [r1, 0x1] + ldr r1, =gBattleBankFunc + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8186678 + str r1, [r0] +_08186C10: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818686C + + thumb_func_start sub_8186C48 +sub_8186C48: @ 8186C48 + push {r4-r7,lr} + ldr r4, =gSprites + ldr r0, =gBankSpriteIds + ldr r7, =gActiveBank + ldrb r3, [r7] + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r2, r0, 2 + adds r0, r4, 0 + adds r0, 0x1C + adds r0, r2, r0 + ldr r1, [r0] + ldr r0, =SpriteCallbackDummy + cmp r1, r0 + bne _08186CFA + adds r0, r2, r4 + movs r1, 0x24 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08186CFA + ldr r6, =gUnknown_020244D0 + ldr r0, [r6] + ldr r1, [r0, 0x4] + lsls r4, r3, 1 + adds r0, r4, r3 + lsls r0, 2 + adds r2, r0, r1 + ldrb r5, [r2] + movs r0, 0x80 + ands r0, r5 + cmp r0, 0 + bne _08186CC0 + ldr r0, =gBattlePartyID + adds r0, r4, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gEnemyParty + adds r1, r0 + adds r0, r3, 0 + bl sub_8172EF0 + b _08186CFA + .pool +_08186CC0: + ldrb r1, [r2, 0x1] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08186CFA + movs r0, 0x7F + ands r0, r5 + strb r0, [r2] + ldr r0, [r6] + ldrb r2, [r7] + ldr r0, [r0, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x1] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x1] + ldr r4, =0x000027f9 + adds r0, r4, 0 + bl FreeSpriteTilesByTag + adds r0, r4, 0 + bl FreeSpritePaletteByTag + bl RecordedOpponentBufferExecCompleted +_08186CFA: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8186C48 + + thumb_func_start sub_8186D04 +sub_8186D04: @ 8186D04 + push {r4-r6,lr} + ldr r6, =gActiveBank + ldrb r0, [r6] + ldr r5, =gUnknown_03005D70 + adds r1, r0, r5 + ldrb r1, [r1] + movs r2, 0 + movs r3, 0 + bl sub_8074AA0 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldrb r0, [r6] + adds r0, r5 + ldrb r0, [r0] + bl sub_80729D0 + lsls r4, 16 + asrs r1, r4, 16 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08186D4C + ldrb r0, [r6] + adds r0, r5 + ldrb r0, [r0] + movs r2, 0 + bl heathbar_draw_hp + b _08186D50 + .pool +_08186D4C: + bl RecordedOpponentBufferExecCompleted +_08186D50: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8186D04 + + thumb_func_start sub_8186D58 +sub_8186D58: @ 8186D58 + push {lr} + ldr r2, =gSprites + ldr r0, =gBankSpriteIds + ldr r1, =gActiveBank + ldrb r3, [r1] + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 31 + cmp r0, 0 + bne _08186D86 + ldr r0, =gUnknown_03005D70 + adds r0, r3, r0 + ldrb r0, [r0] + bl sub_8072984 + bl RecordedOpponentBufferExecCompleted +_08186D86: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8186D58 + + thumb_func_start sub_8186D9C +sub_8186D9C: @ 8186D9C + push {r4-r6,lr} + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldr r6, =gActiveBank + ldrb r2, [r6] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08186DF6 + ldr r5, =gBankSpriteIds + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =gSprites + adds r0, r4 + bl FreeSpriteOamMatrix + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl DestroySprite + ldrb r0, [r6] + bl sub_805EEE0 + ldr r1, =gUnknown_03005D70 + ldrb r0, [r6] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 + bl RecordedOpponentBufferExecCompleted +_08186DF6: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8186D9C + + thumb_func_start sub_8186E10 +sub_8186E10: @ 8186E10 + push {lr} + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + bne _08186E22 + bl RecordedOpponentBufferExecCompleted +_08186E22: + pop {r0} + bx r0 + thumb_func_end sub_8186E10 + + thumb_func_start bx_blink_t2 +bx_blink_t2: @ 8186E28 + push {r4,lr} + ldr r1, =gBankSpriteIds + ldr r0, =gActiveBank + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + ldr r2, =gSprites + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, r0, r2 + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0x20 + bne _08186E74 + movs r3, 0 + movs r0, 0 + strh r0, [r4, 0x30] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + subs r0, 0x5 + ands r0, r1 + strb r0, [r2] + ldr r0, =gDoingBattleAnim + strb r3, [r0] + bl RecordedOpponentBufferExecCompleted + b _08186E9E + .pool +_08186E74: + ldrh r0, [r4, 0x30] + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _08186E98 + adds r3, r4, 0 + adds r3, 0x3E + ldrb r2, [r3] + lsls r0, r2, 29 + lsrs r0, 31 + movs r1, 0x1 + eors r1, r0 + lsls r1, 2 + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] +_08186E98: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] +_08186E9E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end bx_blink_t2 + + thumb_func_start sub_8186EA4 +sub_8186EA4: @ 8186EA4 + push {r4,lr} + ldr r2, =gSprites + ldr r0, =gUnknown_03005D70 + ldr r4, =gActiveBank + ldrb r3, [r4] + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =SpriteCallbackDummy + cmp r1, r0 + bne _08186EF0 + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldr r1, [r0] + lsls r0, r3, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08186EE4 + adds r0, r3, 0 + adds r1, r3, 0 + adds r2, r3, 0 + movs r3, 0x6 + bl move_anim_start_t4 +_08186EE4: + ldr r0, =gBattleBankFunc + ldrb r1, [r4] + lsls r1, 2 + adds r1, r0 + ldr r0, =sub_8186F14 + str r0, [r1] +_08186EF0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8186EA4 + + thumb_func_start sub_8186F14 +sub_8186F14: @ 8186F14 + push {r4,lr} + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldr r4, =gActiveBank + ldrb r1, [r4] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08186F6E + bl IsCryPlayingOrClearCrySongs + lsls r0, 24 + cmp r0, 0 + bne _08186F6E + ldr r2, =gSprites + ldr r1, =gBankSpriteIds + ldrb r0, [r4] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =SpriteCallbackDummy + cmp r1, r0 + beq _08186F5E + ldr r0, =nullsub_18 + cmp r1, r0 + bne _08186F6E +_08186F5E: + ldr r0, =gMPlay_BGM + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl m4aMPlayVolumeControl + bl RecordedOpponentBufferExecCompleted +_08186F6E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8186F14 + + thumb_func_start sub_8186F94 +sub_8186F94: @ 8186F94 + push {r4-r7,lr} + ldr r4, =gUnknown_020244D0 + ldr r0, [r4] + ldr r5, =gActiveBank + ldrb r2, [r5] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r3, r0, r1 + ldrb r1, [r3, 0x1] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08187050 + ldr r7, =gSprites + ldr r6, =gBankSpriteIds + adds r0, r2, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r7, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, [r0] + ldr r0, =SpriteCallbackDummy + cmp r1, r0 + bne _08187050 + ldrb r1, [r3] + movs r0, 0x7F + ands r0, r1 + strb r0, [r3] + ldr r0, [r4] + ldrb r2, [r5] + ldr r0, [r0, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x1] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x1] + ldr r4, =0x000027f9 + adds r0, r4, 0 + bl FreeSpriteTilesByTag + adds r0, r4, 0 + bl FreeSpritePaletteByTag + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + movs r1, 0 + bl StartSpriteAnim + ldr r4, =gUnknown_03005D70 + ldrb r1, [r5] + adds r0, r1, r4 + ldrb r0, [r0] + ldr r2, =gBattlePartyID + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =gEnemyParty + adds r1, r2 + movs r2, 0 + bl healthbar_draw_field_maybe + ldrb r0, [r5] + bl sub_8076918 + ldrb r0, [r5] + adds r0, r4 + ldrb r0, [r0] + bl sub_80729D0 + ldrb r0, [r5] + bl sub_805E408 + ldr r1, =gBattleBankFunc + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8186EA4 + str r1, [r0] +_08187050: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8186F94 + + thumb_func_start sub_8187084 +sub_8187084: @ 8187084 + push {r4-r6,lr} + ldr r6, =gUnknown_020244D0 + ldr r0, [r6] + ldr r5, =gActiveBank + ldrb r2, [r5] + ldr r1, [r0, 0x4] + lsls r3, r2, 1 + adds r0, r3, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x88 + ands r0, r1 + cmp r0, 0 + bne _081870B6 + ldr r0, =gBattlePartyID + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gEnemyParty + adds r1, r0 + adds r0, r2, 0 + bl sub_8172EF0 +_081870B6: + ldr r4, =gSprites + ldr r0, =gUnknown_03005D7C + ldrb r2, [r5] + adds r0, r2, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r3, r0, 2 + adds r0, r4, 0 + adds r0, 0x1C + adds r0, r3, r0 + ldr r1, [r0] + ldr r0, =SpriteCallbackDummy + cmp r1, r0 + bne _08187120 + ldr r0, [r6] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _08187120 + adds r0, r3, r4 + bl DestroySprite + ldrb r4, [r5] + ldr r1, =gBattlePartyID + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0xB + bl GetMonData + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_805EE54 + ldr r1, =gBattleBankFunc + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8186F94 + str r1, [r0] +_08187120: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8187084 + + thumb_func_start sub_818714C +sub_818714C: @ 818714C + push {lr} + ldr r0, =gUnknown_020244D0 + ldr r2, [r0] + ldr r0, =gActiveBank + ldrb r1, [r0] + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _0818716E + bl RecordedOpponentBufferExecCompleted +_0818716E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_818714C + + thumb_func_start sub_818717C +sub_818717C: @ 818717C + push {lr} + ldr r0, =gUnknown_020244D0 + ldr r2, [r0] + ldr r0, =gActiveBank + ldrb r1, [r0] + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _0818719E + bl RecordedOpponentBufferExecCompleted +_0818719E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_818717C + + thumb_func_start RecordedOpponentBufferExecCompleted +RecordedOpponentBufferExecCompleted: @ 81871AC + push {r4,lr} + sub sp, 0x4 + ldr r1, =gBattleBankFunc + ldr r4, =gActiveBank + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =RecordedOpponentBufferRunCommand + str r1, [r0] + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08187200 + bl link_get_multiplayer_id + mov r1, sp + strb r0, [r1] + movs r0, 0x2 + movs r1, 0x4 + mov r2, sp + bl PrepareBufferDataTransferLink + ldr r1, =gBattleBufferA + ldrb r0, [r4] + lsls r0, 9 + adds r0, r1 + movs r1, 0x38 + strb r1, [r0] + b _08187212 + .pool +_08187200: + ldr r2, =gBattleExecBuffer + ldr r1, =gBitTable + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + ldr r0, [r2] + bics r0, r1 + str r0, [r2] +_08187212: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end RecordedOpponentBufferExecCompleted + + thumb_func_start sub_8187224 +sub_8187224: @ 8187224 + push {r4-r6,lr} + sub sp, 0x100 + movs r6, 0 + ldr r1, =gBattleBufferA + ldr r0, =gActiveBank + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _0818725C + ldr r0, =gBattlePartyID + lsls r1, r2, 1 + adds r1, r0 + ldrb r0, [r1] + mov r1, sp + bl sub_8187298 + adds r6, r0, 0 + b _0818727E + .pool +_0818725C: + ldrb r4, [r1] + movs r5, 0 +_08187260: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _08187276 + lsls r0, r5, 24 + lsrs r0, 24 + mov r2, sp + adds r1, r2, r6 + bl sub_8187298 + adds r6, r0 +_08187276: + lsrs r4, 1 + adds r5, 0x1 + cmp r5, 0x5 + ble _08187260 +_0818727E: + lsls r1, r6, 16 + lsrs r1, 16 + movs r0, 0x1 + mov r2, sp + bl dp01_build_cmdbuf_x1D_1D_numargs_varargs + bl RecordedOpponentBufferExecCompleted + add sp, 0x100 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8187224 + + thumb_func_start sub_8187298 +sub_8187298: @ 8187298 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x90 + adds r7, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + movs r6, 0 + ldr r2, =gBattleBufferA + ldr r3, =gActiveBank + ldrb r0, [r3] + lsls r0, 9 + adds r1, r2, 0x1 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3B + bls _081872C2 + bl _08187A2E +_081872C2: + lsls r0, 2 + ldr r1, =_081872D8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081872D8: + .4byte _081873C8 + .4byte _081875EC + .4byte _081875FC + .4byte _0818760C + .4byte _08187674 + .4byte _08187674 + .4byte _08187674 + .4byte _08187674 + .4byte _08187690 + .4byte _081876CC + .4byte _081876CC + .4byte _081876CC + .4byte _081876CC + .4byte _08187A2E + .4byte _08187A2E + .4byte _08187A2E + .4byte _08187A2E + .4byte _081876E8 + .4byte _081876F8 + .4byte _08187728 + .4byte _08187738 + .4byte _08187748 + .4byte _08187758 + .4byte _08187768 + .4byte _08187778 + .4byte _08187788 + .4byte _08187798 + .4byte _081877A8 + .4byte _081877B8 + .4byte _081877C8 + .4byte _081877D8 + .4byte _081877E8 + .4byte _08187838 + .4byte _08187848 + .4byte _08187858 + .4byte _08187868 + .4byte _08187878 + .4byte _08187888 + .4byte _08187898 + .4byte _081878A8 + .4byte _081878B8 + .4byte _081878EC + .4byte _081878FC + .4byte _0818790C + .4byte _0818791C + .4byte _0818792C + .4byte _0818793C + .4byte _0818794C + .4byte _0818795C + .4byte _0818797C + .4byte _0818798C + .4byte _0818799C + .4byte _081879AC + .4byte _081879BC + .4byte _081879CC + .4byte _081879DC + .4byte _081879EC + .4byte _081879FC + .4byte _08187A0C + .4byte _08187A1C +_081873C8: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =gEnemyParty + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB + bl GetMonData + mov r1, sp + strh r0, [r1] + adds r0, r4, 0 + movs r1, 0xC + bl GetMonData + mov r1, sp + strh r0, [r1, 0x2E] + movs r6, 0 + add r0, sp, 0x24 + mov r9, r0 + movs r1, 0x3B + add r1, sp + mov r10, r1 + mov r2, sp + adds r2, 0x2B + str r2, [sp, 0x80] + mov r0, sp + adds r0, 0x2A + str r0, [sp, 0x7C] + mov r1, sp + adds r1, 0x68 + str r1, [sp, 0x8C] + adds r2, 0x5 + str r2, [sp, 0x84] + adds r0, 0x12 + str r0, [sp, 0x88] + mov r8, r4 + add r4, sp, 0xC +_08187414: + adds r1, r6, 0 + adds r1, 0xD + mov r0, r8 + bl GetMonData + strh r0, [r4] + adds r1, r6, 0 + adds r1, 0x11 + mov r0, r8 + bl GetMonData + mov r2, r9 + adds r1, r2, r6 + strb r0, [r1] + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x3 + ble _08187414 + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =gEnemyParty + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x15 + bl GetMonData + mov r1, r10 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x20 + bl GetMonData + ldr r2, [sp, 0x80] + strb r0, [r2] + adds r0, r4, 0 + movs r1, 0x19 + bl GetMonData + str r0, [sp, 0x44] + adds r0, r4, 0 + movs r1, 0x27 + bl GetMonData + mov r3, sp + movs r5, 0x1F + ands r0, r5 + ldrb r2, [r3, 0x14] + movs r1, 0x20 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x14] + adds r0, r4, 0 + movs r1, 0x28 + bl GetMonData + mov r3, sp + movs r6, 0x1F + ands r0, r6 + lsls r0, 5 + ldrh r2, [r3, 0x14] + ldr r1, =0xfffffc1f + ands r1, r2 + orrs r1, r0 + strh r1, [r3, 0x14] + adds r0, r4, 0 + movs r1, 0x29 + bl GetMonData + mov r3, sp + ands r0, r5 + lsls r0, 2 + ldrb r2, [r3, 0x15] + movs r1, 0x7D + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x15] + adds r0, r4, 0 + movs r1, 0x2A + bl GetMonData + movs r1, 0x1F + ands r1, r0 + lsls r1, 15 + ldr r0, [sp, 0x14] + ldr r2, =0xfff07fff + ands r0, r2 + orrs r0, r1 + str r0, [sp, 0x14] + adds r0, r4, 0 + movs r1, 0x2B + bl GetMonData + mov r3, sp + ands r0, r6 + lsls r0, 4 + ldrh r2, [r3, 0x16] + ldr r1, =0xfffffe0f + ands r1, r2 + orrs r1, r0 + strh r1, [r3, 0x16] + adds r0, r4, 0 + movs r1, 0x2C + bl GetMonData + mov r3, sp + ands r0, r5 + lsls r0, 1 + ldrb r2, [r3, 0x17] + movs r1, 0x3F + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x17] + adds r0, r4, 0 + movs r1, 0 + bl GetMonData + str r0, [sp, 0x48] + adds r0, r4, 0 + movs r1, 0x37 + bl GetMonData + str r0, [sp, 0x4C] + adds r0, r4, 0 + movs r1, 0x38 + bl GetMonData + ldr r1, [sp, 0x7C] + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x39 + bl GetMonData + mov r1, sp + strh r0, [r1, 0x28] + adds r0, r4, 0 + movs r1, 0x3A + bl GetMonData + mov r1, sp + strh r0, [r1, 0x2C] + adds r0, r4, 0 + movs r1, 0x3B + bl GetMonData + mov r1, sp + strh r0, [r1, 0x2] + adds r0, r4, 0 + movs r1, 0x3C + bl GetMonData + mov r1, sp + strh r0, [r1, 0x4] + adds r0, r4, 0 + movs r1, 0x3D + bl GetMonData + mov r1, sp + strh r0, [r1, 0x6] + adds r0, r4, 0 + movs r1, 0x3E + bl GetMonData + mov r1, sp + strh r0, [r1, 0x8] + adds r0, r4, 0 + movs r1, 0x3F + bl GetMonData + mov r1, sp + strh r0, [r1, 0xA] + adds r0, r4, 0 + movs r1, 0x2D + bl GetMonData + mov r3, sp + movs r1, 0x1 + ands r0, r1 + lsls r0, 6 + ldrb r2, [r3, 0x17] + movs r1, 0x41 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x17] + adds r0, r4, 0 + movs r1, 0x2E + bl GetMonData + mov r3, sp + lsls r0, 7 + ldrb r2, [r3, 0x17] + movs r1, 0x7F + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x17] + adds r0, r4, 0 + movs r1, 0x1 + bl GetMonData + str r0, [sp, 0x54] + adds r0, r4, 0 + movs r1, 0x2 + ldr r2, [sp, 0x8C] + bl GetMonData + ldr r0, [sp, 0x84] + ldr r1, [sp, 0x8C] + bl StringCopy10 + adds r0, r4, 0 + movs r1, 0x7 + ldr r2, [sp, 0x88] + bl GetMonData + mov r2, sp + movs r6, 0 +_081875CC: + adds r0, r7, r6 + adds r1, r2, r6 + ldrb r1, [r1] + strb r1, [r0] + adds r6, 0x1 + cmp r6, 0x57 + bls _081875CC + b _08187A2E + .pool +_081875EC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0xB + b _08187966 + .pool +_081875FC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0xC + b _08187966 + .pool +_0818760C: + movs r6, 0 + add r2, sp, 0x58 + mov r9, r2 + add r0, sp, 0x60 + mov r10, r0 + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =gEnemyParty + adds r4, r1, r0 + mov r8, r9 +_08187622: + adds r1, r6, 0 + adds r1, 0xD + adds r0, r4, 0 + bl GetMonData + mov r1, r8 + strh r0, [r1] + adds r1, r6, 0 + adds r1, 0x11 + adds r0, r4, 0 + bl GetMonData + mov r2, r10 + adds r1, r2, r6 + strb r0, [r1] + movs r0, 0x2 + add r8, r0 + adds r6, 0x1 + cmp r6, 0x3 + ble _08187622 + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x15 + bl GetMonData + mov r1, r9 + strb r0, [r1, 0xC] + mov r2, r9 + movs r6, 0 +_08187660: + adds r0, r7, r6 + adds r1, r2, r6 + ldrb r1, [r1] + strb r1, [r0] + adds r6, 0x1 + cmp r6, 0xF + bls _08187660 + b _08187A2E + .pool +_08187674: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r1, [r3] + lsls r1, 9 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + adds r1, 0x9 + b _08187966 + .pool +_08187690: + movs r6, 0 + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r2, =gEnemyParty + mov r8, r2 +_0818769C: + adds r1, r6, 0 + adds r1, 0x11 + mov r2, r8 + adds r0, r4, r2 + bl GetMonData + adds r1, r7, r6 + strb r0, [r1] + adds r6, 0x1 + cmp r6, 0x3 + ble _0818769C + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x15 + bl GetMonData + adds r1, r7, r6 + strb r0, [r1] + adds r6, 0x1 + b _08187A2E + .pool +_081876CC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r1, [r3] + lsls r1, 9 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + adds r1, 0x8 + b _08187A26 + .pool +_081876E8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x1 + b _08187702 + .pool +_081876F8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x19 +_08187702: + bl GetMonData + adds r1, r0, 0 + strb r1, [r7] + movs r0, 0xFF + lsls r0, 8 + ands r0, r1 + lsrs r0, 8 + strb r0, [r7, 0x1] + movs r0, 0xFF + lsls r0, 16 + ands r0, r1 + lsrs r0, 16 + strb r0, [r7, 0x2] + movs r6, 0x3 + b _08187A2E + .pool +_08187728: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x1A + b _08187A26 + .pool +_08187738: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x1B + b _08187A26 + .pool +_08187748: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x1C + b _08187A26 + .pool +_08187758: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x1D + b _08187A26 + .pool +_08187768: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x1E + b _08187A26 + .pool +_08187778: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x1F + b _08187A26 + .pool +_08187788: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x20 + b _08187A26 + .pool +_08187798: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x22 + b _08187A26 + .pool +_081877A8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x23 + b _08187A26 + .pool +_081877B8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x24 + b _08187A26 + .pool +_081877C8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x25 + b _08187A26 + .pool +_081877D8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x26 + b _08187A26 + .pool +_081877E8: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =gEnemyParty + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x27 + bl GetMonData + strb r0, [r7] + adds r0, r4, 0 + movs r1, 0x28 + bl GetMonData + strb r0, [r7, 0x1] + adds r0, r4, 0 + movs r1, 0x29 + bl GetMonData + strb r0, [r7, 0x2] + adds r0, r4, 0 + movs r1, 0x2A + bl GetMonData + strb r0, [r7, 0x3] + adds r0, r4, 0 + movs r1, 0x2B + bl GetMonData + strb r0, [r7, 0x4] + adds r0, r4, 0 + movs r1, 0x2C + bl GetMonData + strb r0, [r7, 0x5] + movs r6, 0x6 + b _08187A2E + .pool +_08187838: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x27 + b _08187A26 + .pool +_08187848: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x28 + b _08187A26 + .pool +_08187858: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x29 + b _08187A26 + .pool +_08187868: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x2A + b _08187A26 + .pool +_08187878: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x2B + b _08187A26 + .pool +_08187888: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x2C + b _08187A26 + .pool +_08187898: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0 + b _081878C2 + .pool +_081878A8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x9 + b _08187966 + .pool +_081878B8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x37 +_081878C2: + bl GetMonData + adds r1, r0, 0 + strb r1, [r7] + movs r0, 0xFF + lsls r0, 8 + ands r0, r1 + lsrs r0, 8 + strb r0, [r7, 0x1] + movs r0, 0xFF + lsls r0, 16 + ands r0, r1 + lsrs r0, 16 + strb r0, [r7, 0x2] + lsrs r0, r1, 24 + strb r0, [r7, 0x3] + movs r6, 0x4 + b _08187A2E + .pool +_081878EC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x38 + b _08187A26 + .pool +_081878FC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x39 + b _08187966 + .pool +_0818790C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x3A + b _08187966 + .pool +_0818791C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x3B + b _08187966 + .pool +_0818792C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x3C + b _08187966 + .pool +_0818793C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x3D + b _08187966 + .pool +_0818794C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x3E + b _08187966 + .pool +_0818795C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x3F +_08187966: + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + strb r0, [r7] + lsrs r0, 8 + strb r0, [r7, 0x1] + movs r6, 0x2 + b _08187A2E + .pool +_0818797C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x16 + b _08187A26 + .pool +_0818798C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x17 + b _08187A26 + .pool +_0818799C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x18 + b _08187A26 + .pool +_081879AC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x21 + b _08187A26 + .pool +_081879BC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x2F + b _08187A26 + .pool +_081879CC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x30 + b _08187A26 + .pool +_081879DC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x32 + b _08187A26 + .pool +_081879EC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x33 + b _08187A26 + .pool +_081879FC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x34 + b _08187A26 + .pool +_08187A0C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x35 + b _08187A26 + .pool +_08187A1C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x36 +_08187A26: + bl GetMonData + strb r0, [r7] + movs r6, 0x1 +_08187A2E: + adds r0, r6, 0 + add sp, 0x90 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8187298 + + thumb_func_start sub_8187A44 +sub_8187A44: @ 8187A44 + push {lr} + bl RecordedOpponentBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_8187A44 + + thumb_func_start sub_8187A50 +sub_8187A50: @ 8187A50 + push {r4,r5,lr} + ldr r1, =gBattleBufferA + ldr r0, =gActiveBank + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _08187A80 + ldr r0, =gBattlePartyID + lsls r1, r2, 1 + adds r1, r0 + ldrb r0, [r1] + bl dp01_setattr_for_opponent_pokemon + b _08187A9E + .pool +_08187A80: + ldrb r4, [r1] + movs r5, 0 +_08187A84: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _08187A92 + adds r0, r5, 0 + bl dp01_setattr_for_opponent_pokemon +_08187A92: + lsrs r4, 1 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _08187A84 +_08187A9E: + bl RecordedOpponentBufferExecCompleted + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8187A50 + + thumb_func_start dp01_setattr_for_opponent_pokemon +dp01_setattr_for_opponent_pokemon: @ 8187AA8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x38 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r3, =gActiveBank + ldrb r0, [r3] + lsls r0, 9 + ldr r2, =gUnknown_02023067 + adds r4, r0, r2 + adds r7, r4, 0 + subs r1, r2, 0x2 + adds r0, r1 + ldrb r0, [r0] + adds r6, r3, 0 + adds r3, r2, 0 + cmp r0, 0x3B + bls _08187AD6 + bl _081883B4 +_08187AD6: + lsls r0, 2 + ldr r1, =_08187AEC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08187AEC: + .4byte _08187BDC + .4byte _08187D74 + .4byte _08187D90 + .4byte _08187DAC + .4byte _08187E00 + .4byte _08187E00 + .4byte _08187E00 + .4byte _08187E00 + .4byte _08187E20 + .4byte _08187E88 + .4byte _08187E88 + .4byte _08187E88 + .4byte _08187E88 + .4byte _081883B4 + .4byte _081883B4 + .4byte _081883B4 + .4byte _081883B4 + .4byte _08187EB0 + .4byte _08187ECC + .4byte _08187EE8 + .4byte _08187F04 + .4byte _08187F20 + .4byte _08187F3C + .4byte _08187F58 + .4byte _08187F74 + .4byte _08187F90 + .4byte _08187FAC + .4byte _08187FC8 + .4byte _08187FE4 + .4byte _08188000 + .4byte _0818801C + .4byte _08188038 + .4byte _081880AC + .4byte _081880C8 + .4byte _081880E4 + .4byte _08188100 + .4byte _0818811C + .4byte _08188138 + .4byte _08188154 + .4byte _08188170 + .4byte _0818818C + .4byte _081881A8 + .4byte _081881C4 + .4byte _081881E0 + .4byte _081881FC + .4byte _08188218 + .4byte _08188234 + .4byte _08188250 + .4byte _0818826C + .4byte _08188288 + .4byte _081882A4 + .4byte _081882C0 + .4byte _081882DC + .4byte _081882F8 + .4byte _08188314 + .4byte _08188330 + .4byte _0818834C + .4byte _08188368 + .4byte _08188384 + .4byte _081883A0 +_08187BDC: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =gEnemyParty + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB + adds r2, r7, 0 + bl SetMonData + adds r2, r7, 0 + adds r2, 0x2E + adds r0, r4, 0 + movs r1, 0xC + bl SetMonData + movs r0, 0 + mov r8, r0 + movs r0, 0x3B + adds r0, r7 + mov r10, r0 + adds r0, r7, 0 + adds r0, 0x2B + str r0, [sp, 0x20] + adds r0, 0x19 + str r0, [sp, 0x28] + adds r0, 0x4 + str r0, [sp, 0x2C] + adds r0, 0x4 + str r0, [sp, 0x30] + subs r0, 0x22 + str r0, [sp, 0x1C] + subs r0, 0x2 + str r0, [sp, 0x18] + adds r0, 0x4 + str r0, [sp, 0x24] + adds r0, r7, 0x2 + str r0, [sp, 0x4] + adds r0, r7, 0x4 + str r0, [sp, 0x8] + adds r0, r7, 0x6 + str r0, [sp, 0xC] + adds r0, 0x2 + str r0, [sp, 0x10] + adds r0, 0x2 + str r0, [sp, 0x14] + mov r9, r4 + adds r6, r7, 0 + adds r6, 0x24 + adds r4, r7, 0 + adds r4, 0xC +_08187C42: + mov r1, r8 + adds r1, 0xD + mov r0, r9 + adds r2, r4, 0 + bl SetMonData + mov r1, r8 + adds r1, 0x11 + mov r0, r9 + adds r2, r6, 0 + bl SetMonData + adds r6, 0x1 + adds r4, 0x2 + movs r0, 0x1 + add r8, r0 + mov r0, r8 + cmp r0, 0x3 + ble _08187C42 + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =gEnemyParty + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x15 + mov r2, r10 + bl SetMonData + adds r0, r4, 0 + movs r1, 0x20 + ldr r2, [sp, 0x20] + bl SetMonData + adds r0, r4, 0 + movs r1, 0x19 + ldr r2, [sp, 0x28] + bl SetMonData + ldrb r0, [r7, 0x14] + lsls r0, 27 + lsrs r0, 27 + mov r1, sp + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x27 + mov r2, sp + bl SetMonData + mov r1, sp + ldrh r0, [r7, 0x14] + lsls r0, 22 + lsrs r0, 27 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x28 + mov r2, sp + bl SetMonData + mov r1, sp + ldrb r0, [r7, 0x15] + lsls r0, 25 + lsrs r0, 27 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x29 + mov r2, sp + bl SetMonData + mov r1, sp + ldr r0, [r7, 0x14] + lsls r0, 12 + lsrs r0, 27 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x2A + mov r2, sp + bl SetMonData + mov r1, sp + ldrh r0, [r7, 0x16] + lsls r0, 23 + lsrs r0, 27 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x2B + mov r2, sp + bl SetMonData + mov r1, sp + ldrb r0, [r7, 0x17] + lsls r0, 26 + lsrs r0, 27 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x2C + mov r2, sp + bl SetMonData + adds r0, r4, 0 + movs r1, 0 + ldr r2, [sp, 0x2C] + bl SetMonData + adds r0, r4, 0 + movs r1, 0x37 + ldr r2, [sp, 0x30] + bl SetMonData + adds r0, r4, 0 + movs r1, 0x38 + ldr r2, [sp, 0x1C] + bl SetMonData + adds r0, r4, 0 + movs r1, 0x39 + ldr r2, [sp, 0x18] + bl SetMonData + adds r0, r4, 0 + movs r1, 0x3A + ldr r2, [sp, 0x24] + bl SetMonData + adds r0, r4, 0 + movs r1, 0x3B + ldr r2, [sp, 0x4] + bl SetMonData + adds r0, r4, 0 + movs r1, 0x3C + ldr r2, [sp, 0x8] + bl SetMonData + adds r0, r4, 0 + movs r1, 0x3D + ldr r2, [sp, 0xC] + bl SetMonData + adds r0, r4, 0 + movs r1, 0x3E + ldr r2, [sp, 0x10] + bl SetMonData + adds r0, r4, 0 + movs r1, 0x3F + ldr r2, [sp, 0x14] + bl SetMonData + b _081883B4 + .pool +_08187D74: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0xB + bl SetMonData + b _081883B4 + .pool +_08187D90: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0xC + bl SetMonData + b _081883B4 + .pool +_08187DAC: + movs r0, 0 + mov r8, r0 + movs r0, 0xC + adds r0, r4 + mov r9, r0 + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =gEnemyParty + adds r7, r1, r0 + adds r6, r4, 0 + adds r6, 0x8 +_08187DC4: + mov r1, r8 + adds r1, 0xD + adds r0, r7, 0 + adds r2, r4, 0 + bl SetMonData + mov r1, r8 + adds r1, 0x11 + adds r0, r7, 0 + adds r2, r6, 0 + bl SetMonData + adds r6, 0x1 + adds r4, 0x2 + movs r0, 0x1 + add r8, r0 + mov r0, r8 + cmp r0, 0x3 + ble _08187DC4 + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x15 + mov r2, r9 + bl SetMonData + b _081883B4 + .pool +_08187E00: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldr r3, =gBattleBufferA + ldrb r2, [r6] + lsls r2, 9 + adds r1, r3, 0x1 + adds r1, r2, r1 + ldrb r1, [r1] + adds r1, 0x9 + b _08187E9E + .pool +_08187E20: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =gEnemyParty + adds r4, r0 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + adds r0, r4, 0 + movs r1, 0x11 + str r3, [sp, 0x34] + bl SetMonData + ldrb r2, [r6] + lsls r2, 9 + ldr r3, [sp, 0x34] + adds r0, r3, 0x1 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x12 + bl SetMonData + ldrb r2, [r6] + lsls r2, 9 + ldr r3, [sp, 0x34] + adds r0, r3, 0x2 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x13 + bl SetMonData + ldrb r2, [r6] + lsls r2, 9 + ldr r3, [sp, 0x34] + adds r0, r3, 0x3 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x14 + bl SetMonData + ldrb r2, [r6] + lsls r2, 9 + ldr r3, [sp, 0x34] + adds r0, r3, 0x4 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x15 + bl SetMonData + b _081883B4 + .pool +_08187E88: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldr r3, =gBattleBufferA + ldrb r2, [r6] + lsls r2, 9 + adds r1, r3, 0x1 + adds r1, r2, r1 + ldrb r1, [r1] + adds r1, 0x8 +_08187E9E: + adds r3, 0x3 + adds r2, r3 + bl SetMonData + b _081883B4 + .pool +_08187EB0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1 + bl SetMonData + b _081883B4 + .pool +_08187ECC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x19 + bl SetMonData + b _081883B4 + .pool +_08187EE8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1A + bl SetMonData + b _081883B4 + .pool +_08187F04: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1B + bl SetMonData + b _081883B4 + .pool +_08187F20: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1C + bl SetMonData + b _081883B4 + .pool +_08187F3C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1D + bl SetMonData + b _081883B4 + .pool +_08187F58: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1E + bl SetMonData + b _081883B4 + .pool +_08187F74: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1F + bl SetMonData + b _081883B4 + .pool +_08187F90: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x20 + bl SetMonData + b _081883B4 + .pool +_08187FAC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x22 + bl SetMonData + b _081883B4 + .pool +_08187FC8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x23 + bl SetMonData + b _081883B4 + .pool +_08187FE4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x24 + bl SetMonData + b _081883B4 + .pool +_08188000: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x25 + bl SetMonData + b _081883B4 + .pool +_0818801C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x26 + bl SetMonData + b _081883B4 + .pool +_08188038: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =gEnemyParty + adds r4, r0 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + adds r0, r4, 0 + movs r1, 0x27 + str r3, [sp, 0x34] + bl SetMonData + ldrb r2, [r6] + lsls r2, 9 + ldr r3, [sp, 0x34] + adds r0, r3, 0x1 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x28 + bl SetMonData + ldrb r2, [r6] + lsls r2, 9 + ldr r3, [sp, 0x34] + adds r0, r3, 0x2 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x29 + bl SetMonData + ldrb r2, [r6] + lsls r2, 9 + ldr r3, [sp, 0x34] + adds r0, r3, 0x3 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x2A + bl SetMonData + ldrb r2, [r6] + lsls r2, 9 + ldr r3, [sp, 0x34] + adds r0, r3, 0x4 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x2B + bl SetMonData + ldrb r2, [r6] + lsls r2, 9 + ldr r3, [sp, 0x34] + adds r0, r3, 0x5 + adds r2, r0 + adds r0, r4, 0 + b _08188146 + .pool +_081880AC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x27 + bl SetMonData + b _081883B4 + .pool +_081880C8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x28 + bl SetMonData + b _081883B4 + .pool +_081880E4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x29 + bl SetMonData + b _081883B4 + .pool +_08188100: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x2A + bl SetMonData + b _081883B4 + .pool +_0818811C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x2B + bl SetMonData + b _081883B4 + .pool +_08188138: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 +_08188146: + movs r1, 0x2C + bl SetMonData + b _081883B4 + .pool +_08188154: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0 + bl SetMonData + b _081883B4 + .pool +_08188170: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x9 + bl SetMonData + b _081883B4 + .pool +_0818818C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x37 + bl SetMonData + b _081883B4 + .pool +_081881A8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x38 + bl SetMonData + b _081883B4 + .pool +_081881C4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x39 + bl SetMonData + b _081883B4 + .pool +_081881E0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3A + bl SetMonData + b _081883B4 + .pool +_081881FC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3B + bl SetMonData + b _081883B4 + .pool +_08188218: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3C + bl SetMonData + b _081883B4 + .pool +_08188234: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3D + bl SetMonData + b _081883B4 + .pool +_08188250: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3E + bl SetMonData + b _081883B4 + .pool +_0818826C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3F + bl SetMonData + b _081883B4 + .pool +_08188288: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x16 + bl SetMonData + b _081883B4 + .pool +_081882A4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x17 + bl SetMonData + b _081883B4 + .pool +_081882C0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x18 + bl SetMonData + b _081883B4 + .pool +_081882DC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x21 + bl SetMonData + b _081883B4 + .pool +_081882F8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x2F + bl SetMonData + b _081883B4 + .pool +_08188314: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x30 + bl SetMonData + b _081883B4 + .pool +_08188330: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x32 + bl SetMonData + b _081883B4 + .pool +_0818834C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x33 + bl SetMonData + b _081883B4 + .pool +_08188368: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x34 + bl SetMonData + b _081883B4 + .pool +_08188384: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x35 + bl SetMonData + b _081883B4 + .pool +_081883A0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x36 + bl SetMonData +_081883B4: + add sp, 0x38 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_setattr_for_opponent_pokemon + + thumb_func_start sub_81883C8 +sub_81883C8: @ 81883C8 + push {r4-r7,lr} + ldr r1, =gBattlePartyID + ldr r7, =gActiveBank + ldrb r2, [r7] + lsls r0, r2, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + adds r3, r1, 0 + muls r3, r0 + ldr r4, =gBattleBufferA + lsls r2, 9 + adds r0, r4, 0x1 + adds r0, r2, r0 + ldrb r0, [r0] + ldr r1, =gEnemyParty + adds r0, r1 + adds r5, r3, r0 + movs r3, 0 + adds r0, r4, 0x2 + adds r2, r0 + ldrb r2, [r2] + cmp r3, r2 + bcs _08188420 + adds r6, r4, 0 + adds r2, r7, 0 + adds r4, r0, 0 +_081883FE: + adds r1, r5, r3 + ldrb r0, [r2] + lsls r0, 9 + adds r0, 0x3 + adds r0, r3, r0 + adds r0, r6 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + ldrb r0, [r2] + lsls r0, 9 + adds r0, r4 + ldrb r0, [r0] + cmp r3, r0 + bcc _081883FE +_08188420: + bl RecordedOpponentBufferExecCompleted + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81883C8 + + thumb_func_start sub_818843C +sub_818843C: @ 818843C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r7, =gBattlePartyID + ldr r6, =gActiveBank + ldrb r0, [r6] + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + movs r1, 0x64 + mov r10, r1 + mov r2, r10 + muls r2, r0 + adds r0, r2, 0 + ldr r1, =gEnemyParty + mov r9, r1 + add r0, r9 + movs r1, 0xB + bl GetMonData + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldrb r1, [r6] + lsls r0, r1, 1 + adds r0, r7 + ldrh r0, [r0] + mov r2, r10 + muls r2, r0 + adds r0, r2, 0 + add r0, r9 + bl sub_805DC0C + ldrb r0, [r6] + bl GetBankIdentity + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_806A068 + ldr r0, =gUnknown_0202499C + mov r8, r0 + ldrb r0, [r6] + movs r1, 0x2 + bl sub_80A5C6C + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldrb r0, [r6] + bl sub_80A6138 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldrb r0, [r6] + bl sub_80A82E4 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + mov r0, r8 + adds r1, r5, 0 + adds r2, r4, 0 + bl CreateSprite + ldr r4, =gBankSpriteIds + ldrb r1, [r6] + adds r1, r4 + strb r0, [r1] + ldr r5, =gSprites + ldrb r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =0x0000ff10 + strh r1, [r0, 0x24] + ldrb r2, [r6] + adds r0, r2, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r2, [r0, 0x2E] + ldrb r3, [r6] + adds r0, r3, r4 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + lsls r3, 4 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r3 + strb r0, [r1, 0x5] + ldrb r2, [r6] + adds r4, r2, r4 + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =gUnknown_020244E4 + adds r2, r1 + ldrb r1, [r2] + bl StartSpriteAnim + ldrb r4, [r6] + lsls r0, r4, 1 + adds r0, r7 + ldrh r0, [r0] + mov r1, r10 + muls r1, r0 + adds r0, r1, 0 + add r0, r9 + movs r1, 0xB + bl GetMonData + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_805EE54 + ldr r1, =gBattleBankFunc + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8186C48 + str r1, [r0] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818843C + + thumb_func_start sub_818858C +sub_818858C: @ 818858C + push {r4,lr} + ldr r1, =gBattlePartyID + ldr r4, =gActiveBank + ldrb r0, [r4] + lsls r2, r0, 1 + adds r2, r1 + ldr r3, =gBattleBufferA + lsls r0, 9 + adds r1, r3, 0x1 + adds r0, r1 + ldrb r0, [r0] + strh r0, [r2] + ldrb r0, [r4] + lsls r1, r0, 9 + adds r3, 0x2 + adds r1, r3 + ldrb r1, [r1] + bl sub_81885D8 + ldr r1, =gBattleBankFunc + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8187084 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818858C + + thumb_func_start sub_81885D8 +sub_81885D8: @ 81885D8 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + lsls r1, 24 + lsrs r1, 24 + adds r0, r6, 0 + bl sub_805EF84 + ldr r0, =gBattlePartyID + lsls r4, r6, 1 + adds r4, r0 + ldr r0, =gBattleBufferA + lsls r1, r6, 9 + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + strh r0, [r4] + ldrh r0, [r4] + movs r1, 0x64 + mov r9, r1 + mov r1, r9 + muls r1, r0 + adds r0, r1, 0 + ldr r5, =gEnemyParty + adds r0, r5 + movs r1, 0xB + bl GetMonData + mov r8, r0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r0, =sub_805D714 + bl CreateInvisibleSpriteWithCallback + ldr r1, =gUnknown_03005D7C + mov r10, r1 + add r10, r6 + mov r1, r10 + strb r0, [r1] + ldrh r0, [r4] + mov r1, r9 + muls r1, r0 + adds r0, r1, 0 + adds r0, r5 + adds r1, r6, 0 + bl sub_805DC0C + adds r0, r6, 0 + bl GetBankIdentity + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, r8 + bl sub_806A068 + ldr r0, =gUnknown_0202499C + mov r9, r0 + adds r0, r6, 0 + movs r1, 0x2 + bl sub_80A5C6C + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + adds r0, r6, 0 + bl sub_80A6138 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r6, 0 + bl sub_80A82E4 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + mov r0, r9 + adds r1, r5, 0 + adds r2, r4, 0 + bl CreateSprite + ldr r4, =gBankSpriteIds + adds r4, r6, r4 + strb r0, [r4] + ldr r5, =gSprites + mov r0, r10 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrb r1, [r4] + strh r1, [r0, 0x30] + mov r0, r10 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r6, [r0, 0x32] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r6, [r0, 0x2E] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + mov r1, r8 + strh r1, [r0, 0x32] + ldrb r0, [r4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + lsls r3, r6, 4 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r3 + strb r0, [r1, 0x5] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =gUnknown_020244E4 + adds r6, r1 + ldrb r1, [r6] + bl StartSpriteAnim + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r5, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =SpriteCallbackDummy + str r1, [r0] + movs r0, 0 + movs r1, 0xFE + bl sub_80753E8 + mov r1, r10 + ldrb r2, [r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r5 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1, 0x2E] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81885D8 + + thumb_func_start sub_8188768 +sub_8188768: @ 8188768 + push {r4-r6,lr} + ldr r1, =gBattleBufferA + ldr r6, =gActiveBank + ldrb r2, [r6] + lsls r0, r2, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r3, [r0] + cmp r3, 0 + bne _081887B0 + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + strb r3, [r0, 0x4] + ldr r1, =gBattleBankFunc + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8188800 + str r1, [r0] + b _081887EC + .pool +_081887B0: + ldr r5, =gBankSpriteIds + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =gSprites + adds r0, r4 + bl FreeSpriteOamMatrix + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl DestroySprite + ldrb r0, [r6] + bl sub_805EEE0 + ldr r1, =gUnknown_03005D70 + ldrb r0, [r6] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 + bl RecordedOpponentBufferExecCompleted +_081887EC: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8188768 + + thumb_func_start sub_8188800 +sub_8188800: @ 8188800 + push {r4-r6,lr} + ldr r6, =gUnknown_020244D0 + ldr r4, [r6] + ldr r5, =gActiveBank + ldrb r2, [r5] + ldr r1, [r4, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r3, r0, r1 + ldrb r0, [r3, 0x4] + cmp r0, 0 + beq _08188828 + cmp r0, 0x1 + beq _08188856 + b _0818887E + .pool +_08188828: + ldr r1, [r4] + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08188842 + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x5 + bl move_anim_start_t4 +_08188842: + ldr r0, [r6] + ldrb r1, [r5] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x1 + strb r1, [r0, 0x4] + b _0818887E +_08188856: + ldrb r1, [r3] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _0818887E + strb r0, [r3, 0x4] + ldrb r2, [r5] + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x2 + bl move_anim_start_t4 + ldr r1, =gBattleBankFunc + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8186D9C + str r1, [r0] +_0818887E: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8188800 + + thumb_func_start sub_818888C +sub_818888C: @ 818888C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r5, =gBattleTypeFlags + ldr r0, [r5] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081888F6 + ldr r4, =gActiveBank + ldrb r0, [r4] + bl GetBankIdentity + movs r1, 0x2 + ands r1, r0 + movs r7, 0xC8 + cmp r1, 0 + beq _081888B4 + movs r7, 0x98 +_081888B4: + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 1 + ands r0, r1 + cmp r0, 0 + beq _081888EC + ldrb r0, [r4] + cmp r0, 0x1 + bne _081888D8 + ldr r0, =gUnknown_02038BCA + b _081888DA + .pool +_081888D8: + ldr r0, =gUnknown_02038BCC +_081888DA: + ldrh r0, [r0] + bl sub_8162AA0 + lsls r0, 24 + lsrs r0, 24 + b _0818892C + .pool +_081888EC: + bl sub_8185F40 + lsls r0, 24 + lsrs r0, 24 + b _08188924 +_081888F6: + movs r7, 0xB0 + ldr r0, =gUnknown_02038BCA + ldrh r1, [r0] + movs r0, 0xC0 + lsls r0, 4 + cmp r1, r0 + bne _08188910 + bl sub_8068B48 + b _08188928 + .pool +_08188910: + ldr r2, =gUnknown_020229E8 + ldr r0, =gUnknown_0203C7B4 + ldrb r0, [r0] + movs r1, 0x1 + eors r1, r0 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x13] +_08188924: + bl sub_806F000 +_08188928: + lsls r0, 16 + lsrs r0, 16 +_0818892C: + mov r8, r0 + ldr r5, =gActiveBank + ldrb r1, [r5] + bl sub_805DF38 + ldrb r0, [r5] + bl GetBankIdentity + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, r8 + bl template_build_for_pokemon_or_trainer + ldr r6, =gUnknown_0202499C + mov r9, r7 + ldr r1, =gUnknown_083054E0 + mov r2, r8 + lsls r0, r2, 2 + adds r0, r1 + ldrb r0, [r0] + movs r4, 0x8 + subs r4, r0 + lsls r4, 18 + movs r0, 0xA0 + lsls r0, 14 + adds r4, r0 + asrs r4, 16 + ldrb r0, [r5] + bl sub_80A82E4 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r6, 0 + mov r1, r9 + adds r2, r4, 0 + bl CreateSprite + ldr r6, =gBankSpriteIds + ldrb r1, [r5] + adds r1, r6 + strb r0, [r1] + ldr r4, =gSprites + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =0x0000ff10 + strh r1, [r0, 0x24] + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x2 + strh r1, [r0, 0x2E] + ldr r1, =gTrainerFrontPicPaletteTable + mov r2, r8 + lsls r0, r2, 3 + adds r0, r1 + ldrh r0, [r0, 0x4] + bl IndexOfSpritePaletteTag + ldrb r1, [r5] + adds r1, r6 + ldrb r1, [r1] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + adds r2, r4 + lsls r0, 4 + ldrb r3, [r2, 0x5] + movs r1, 0xF + ands r1, r3 + orrs r1, r0 + strb r1, [r2, 0x5] + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + mov r1, r8 + strh r1, [r0, 0x6] + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, 0x1C + adds r0, r4 + ldr r1, =sub_805D7AC + str r1, [r0] + ldr r1, =gBattleBankFunc + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8186558 + str r1, [r0] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818888C + + thumb_func_start sub_8188A40 +sub_8188A40: @ 8188A40 + push {lr} + bl RecordedOpponentBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_8188A40 + + thumb_func_start sub_8188A4C +sub_8188A4C: @ 8188A4C + push {r4-r6,lr} + ldr r6, =gBankSpriteIds + ldr r4, =gActiveBank + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, =gSprites + adds r0, r5 + bl oamt_add_pos2_onto_pos1 + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x23 + strh r1, [r0, 0x2E] + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x8C + lsls r1, 1 + strh r1, [r0, 0x32] + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrh r1, [r0, 0x22] + strh r1, [r0, 0x36] + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r5, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_80A6EEC + str r1, [r0] + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =SpriteCallbackDummy + bl oamt_set_x3A_32 + ldr r1, =gBattleBankFunc + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_81865C8 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8188A4C + + thumb_func_start sub_8188AF8 +sub_8188AF8: @ 8188AF8 + push {r4-r6,lr} + ldr r6, =gUnknown_020244D0 + ldr r4, [r6] + ldr r5, =gActiveBank + ldrb r2, [r5] + ldr r0, [r4, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r3, r1, r0 + ldrb r0, [r3, 0x4] + cmp r0, 0 + bne _08188B4C + ldr r1, [r4] + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08188B2C + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x5 + bl move_anim_start_t4 +_08188B2C: + ldr r0, [r6] + ldrb r1, [r5] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x4] + adds r1, 0x1 + strb r1, [r0, 0x4] + b _08188B88 + .pool +_08188B4C: + ldrb r1, [r3] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08188B88 + strb r0, [r3, 0x4] + movs r0, 0x10 + movs r1, 0x3F + bl PlaySE12WithPanning + ldr r2, =gSprites + ldr r1, =gBankSpriteIds + ldrb r0, [r5] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, =sub_8039934 + str r1, [r0] + ldr r1, =gBattleBankFunc + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8186D58 + str r1, [r0] +_08188B88: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8188AF8 + + thumb_func_start sub_8188BA4 +sub_8188BA4: @ 8188BA4 + push {lr} + bl RecordedOpponentBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_8188BA4 + + thumb_func_start sub_8188BB0 +sub_8188BB0: @ 8188BB0 + push {lr} + bl RecordedOpponentBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_8188BB0 + + thumb_func_start sub_8188BBC +sub_8188BBC: @ 8188BBC + push {lr} + bl RecordedOpponentBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_8188BBC + + thumb_func_start sub_8188BC8 +sub_8188BC8: @ 8188BC8 + push {lr} + bl RecordedOpponentBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_8188BC8 + + thumb_func_start sub_8188BD4 +sub_8188BD4: @ 8188BD4 + push {r4-r6,lr} + ldr r6, =gActiveBank + ldrb r0, [r6] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + beq _08188BE6 + b _08188CFA +_08188BE6: + ldr r0, =gBattleBufferA + mov r12, r0 + ldrb r2, [r6] + lsls r2, 9 + adds r0, 0x1 + adds r0, r2, r0 + ldrb r0, [r0] + mov r1, r12 + adds r1, 0x2 + adds r1, r2, r1 + ldrb r1, [r1] + lsls r1, 8 + orrs r0, r1 + ldr r5, =gUnknown_02038432 + mov r1, r12 + adds r1, 0x3 + adds r2, r1 + ldrb r1, [r2] + strb r1, [r5] + ldr r4, =gUnknown_02038408 + ldrb r2, [r6] + lsls r2, 9 + mov r1, r12 + adds r1, 0x4 + adds r1, r2, r1 + ldrb r3, [r1] + mov r1, r12 + adds r1, 0x5 + adds r2, r1 + ldrb r1, [r2] + lsls r1, 8 + orrs r3, r1 + strh r3, [r4] + ldr r4, =gUnknown_02038404 + ldrb r2, [r6] + lsls r2, 9 + mov r1, r12 + adds r1, 0x6 + adds r1, r2, r1 + ldrb r3, [r1] + mov r1, r12 + adds r1, 0x7 + adds r1, r2, r1 + ldrb r1, [r1] + lsls r1, 8 + orrs r3, r1 + mov r1, r12 + adds r1, 0x8 + adds r1, r2, r1 + ldrb r1, [r1] + lsls r1, 16 + orrs r3, r1 + mov r1, r12 + adds r1, 0x9 + adds r2, r1 + ldrb r1, [r2] + lsls r1, 24 + orrs r3, r1 + str r3, [r4] + ldr r3, =gUnknown_0203841A + ldrb r1, [r6] + lsls r1, 9 + mov r2, r12 + adds r2, 0xA + adds r1, r2 + ldrb r1, [r1] + strb r1, [r3] + ldr r4, =gUnknown_0203841C + ldrb r2, [r6] + lsls r2, 9 + mov r1, r12 + adds r1, 0xC + adds r1, r2, r1 + ldrb r3, [r1] + mov r1, r12 + adds r1, 0xD + adds r2, r1 + ldrb r1, [r2] + lsls r1, 8 + orrs r3, r1 + strh r3, [r4] + ldr r3, =gUnknown_02038400 + ldrb r2, [r6] + lsls r2, 9 + mov r1, r12 + adds r1, 0x10 + adds r2, r1 + str r2, [r3] + ldr r3, =gUnknown_020244BC + ldrb r1, [r6] + lsls r1, 2 + adds r1, r3 + ldr r2, [r2] + str r2, [r1] + ldrb r1, [r5] + bl sub_805DB8C + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + beq _08188CDC + bl RecordedOpponentBufferExecCompleted + b _08188CFA + .pool +_08188CDC: + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldrb r1, [r6] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strb r3, [r0, 0x4] + ldr r1, =gBattleBankFunc + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8188D0C + str r1, [r0] +_08188CFA: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8188BD4 + + thumb_func_start sub_8188D0C +sub_8188D0C: @ 8188D0C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r2, =gBattleBufferA + ldr r6, =gActiveBank + ldrb r3, [r6] + lsls r1, r3, 9 + adds r0, r2, 0x1 + mov r10, r0 + adds r0, r1, r0 + ldrb r4, [r0] + adds r5, r2, 0x2 + mov r9, r5 + adds r0, r1, r5 + ldrb r0, [r0] + lsls r0, 8 + orrs r4, r0 + adds r2, 0xB + adds r1, r2 + ldrb r1, [r1] + mov r8, r1 + ldr r7, =gUnknown_020244D0 + ldr r5, [r7] + ldr r1, [r5, 0x4] + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r2, [r0, 0x4] + cmp r2, 0x1 + beq _08188DA4 + cmp r2, 0x1 + bgt _08188D64 + cmp r2, 0 + beq _08188D6E + b _08188E80 + .pool +_08188D64: + cmp r2, 0x2 + beq _08188DCE + cmp r2, 0x3 + beq _08188E44 + b _08188E80 +_08188D6E: + ldr r1, [r5] + lsls r0, r3, 2 + adds r1, r0, r1 + ldrb r2, [r1] + movs r0, 0xC + ands r0, r2 + cmp r0, 0x4 + bne _08188D90 + movs r0, 0x8 + orrs r0, r2 + strb r0, [r1] + ldrb r2, [r6] + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x5 + bl move_anim_start_t4 +_08188D90: + ldr r0, [r7] + ldrb r1, [r6] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x1 + strb r1, [r0, 0x4] + b _08188E80 +_08188DA4: + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08188E80 + movs r0, 0 + bl sub_805EB9C + adds r0, r4, 0 + bl move_anim_start_t1 + ldr r0, [r7] + ldrb r1, [r6] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x2 + strb r1, [r0, 0x4] + b _08188E80 +_08188DCE: + ldr r0, =gUnknown_020383F8 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, =gUnknown_020383FD + ldrb r0, [r0] + cmp r0, 0 + bne _08188E80 + movs r0, 0x1 + bl sub_805EB9C + ldr r0, [r7] + ldrb r2, [r6] + ldr r1, [r0] + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08188E1C + mov r0, r8 + cmp r0, 0x1 + bhi _08188E1C + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x6 + bl move_anim_start_t4 + ldr r0, [r7] + ldrb r1, [r6] + ldr r0, [r0] + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + strb r0, [r1] +_08188E1C: + ldr r0, =gUnknown_020244D0 + ldr r2, [r0] + ldr r0, =gActiveBank + ldrb r1, [r0] + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x3 + strb r1, [r0, 0x4] + b _08188E80 + .pool +_08188E44: + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _08188E80 + bl sub_805E394 + ldrb r0, [r6] + lsls r2, r0, 9 + mov r3, r10 + adds r1, r2, r3 + ldrb r1, [r1] + add r2, r9 + ldrb r2, [r2] + lsls r2, 8 + orrs r1, r2 + bl sub_805E94C + ldr r0, [r7] + ldrb r1, [r6] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strb r4, [r0, 0x4] + bl RecordedOpponentBufferExecCompleted +_08188E80: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8188D0C + + thumb_func_start sub_8188E90 +sub_8188E90: @ 8188E90 + push {r4,lr} + ldr r0, =gUnknown_02022E14 + movs r1, 0 + strh r1, [r0] + ldr r0, =gUnknown_02022E16 + strh r1, [r0] + ldr r4, =gActiveBank + ldrb r0, [r4] + lsls r0, 9 + ldr r1, =gUnknown_02023066 + adds r0, r1 + ldrh r0, [r0] + bl battle_pick_message + ldr r0, =gUnknown_02022E2C + movs r1, 0 + bl battle_show_message_maybe + ldr r1, =gBattleBankFunc + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8186E10 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8188E90 + + thumb_func_start sub_8188EE4 +sub_8188EE4: @ 8188EE4 + push {lr} + bl RecordedOpponentBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_8188EE4 + + thumb_func_start sub_8188EF0 +sub_8188EF0: @ 8188EF0 + push {lr} + ldr r0, =gActiveBank + ldrb r0, [r0] + bl sub_8185054 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x1 + movs r2, 0 + bl dp01_build_cmdbuf_x21_a_bb + bl RecordedOpponentBufferExecCompleted + pop {r0} + bx r0 + .pool + thumb_func_end sub_8188EF0 + + thumb_func_start sub_8188F14 +sub_8188F14: @ 8188F14 + push {lr} + bl RecordedOpponentBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_8188F14 + + thumb_func_start sub_8188F20 +sub_8188F20: @ 8188F20 + push {r4,r5,lr} + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 10 + ands r0, r1 + cmp r0, 0 + beq _08188F48 + bl sub_805D19C + adds r2, r0, 0 + lsls r2, 16 + lsrs r2, 16 + movs r0, 0x1 + movs r1, 0xA + bl dp01_build_cmdbuf_x21_a_bb + b _08188F6C + .pool +_08188F48: + ldr r5, =gActiveBank + ldrb r0, [r5] + bl sub_8185054 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldrb r0, [r5] + bl sub_8185054 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 16 + orrs r2, r4 + movs r0, 0x1 + movs r1, 0xA + bl dp01_build_cmdbuf_x21_a_bb +_08188F6C: + bl RecordedOpponentBufferExecCompleted + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8188F20 + + thumb_func_start sub_8188F7C +sub_8188F7C: @ 8188F7C + push {lr} + bl RecordedOpponentBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_8188F7C + + thumb_func_start sub_8188F88 +sub_8188F88: @ 8188F88 + push {r4,lr} + ldr r4, =gActiveBank + ldrb r0, [r4] + bl sub_8185054 + ldrb r1, [r4] + ldr r3, =gBattleStruct + ldr r2, [r3] + adds r1, r2 + adds r1, 0x5C + strb r0, [r1] + ldrb r0, [r4] + ldr r1, [r3] + adds r0, r1 + adds r0, 0x5C + ldrb r1, [r0] + movs r0, 0x1 + movs r2, 0 + bl dp01_build_cmdbuf_x22_a_three_bytes + bl RecordedOpponentBufferExecCompleted + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8188F88 + + thumb_func_start sub_8188FC4 +sub_8188FC4: @ 8188FC4 + push {lr} + bl RecordedOpponentBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_8188FC4 + + thumb_func_start sub_8188FD0 +sub_8188FD0: @ 8188FD0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + movs r0, 0 + bl load_gfxc_health_bar + ldr r3, =gBattleBufferA + ldr r0, =gActiveBank + mov r9, r0 + ldrb r4, [r0] + lsls r2, r4, 9 + adds r0, r3, 0x2 + adds r0, r2, r0 + ldrb r1, [r0] + adds r3, 0x3 + adds r2, r3 + ldrb r0, [r2] + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + asrs r7, r1, 16 + ldr r0, =0x00007fff + cmp r7, r0 + beq _08189060 + ldr r6, =gBattlePartyID + lsls r0, r4, 1 + adds r0, r6 + ldrh r0, [r0] + movs r5, 0x64 + muls r0, r5 + ldr r4, =gEnemyParty + adds r0, r4 + movs r1, 0x3A + bl GetMonData + mov r8, r0 + mov r1, r9 + ldrb r0, [r1] + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + muls r0, r5 + adds r0, r4 + movs r1, 0x39 + bl GetMonData + adds r3, r0, 0 + mov r1, r9 + ldrb r0, [r1] + ldr r1, =gUnknown_03005D70 + adds r1, r0, r1 + ldrb r1, [r1] + str r7, [sp] + mov r2, r8 + bl sub_807294C + b _0818908A + .pool +_08189060: + ldr r1, =gBattlePartyID + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0x3A + bl GetMonData + adds r2, r0, 0 + mov r1, r9 + ldrb r0, [r1] + ldr r1, =gUnknown_03005D70 + adds r1, r0, r1 + ldrb r1, [r1] + str r7, [sp] + movs r3, 0 + bl sub_807294C +_0818908A: + ldr r1, =gBattleBankFunc + ldr r0, =gActiveBank + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8186D04 + str r1, [r0] + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8188FD0 + + thumb_func_start sub_81890C0 +sub_81890C0: @ 81890C0 + push {lr} + bl RecordedOpponentBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_81890C0 + + thumb_func_start sub_81890CC +sub_81890CC: @ 81890CC + push {r4,lr} + ldr r4, =gActiveBank + ldrb r0, [r4] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _08189120 + ldr r0, =gUnknown_03005D70 + ldrb r1, [r4] + adds r0, r1, r0 + ldrb r0, [r0] + ldr r2, =gBattlePartyID + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =gEnemyParty + adds r1, r2 + movs r2, 0x9 + bl healthbar_draw_field_maybe + ldrb r2, [r4] + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldr r0, [r0, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x11 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, =gBattleBankFunc + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_818714C + str r1, [r0] +_08189120: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81890CC + + thumb_func_start sub_8189144 +sub_8189144: @ 8189144 + push {r4,r5,lr} + ldr r5, =gActiveBank + ldrb r0, [r5] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _08189194 + ldr r4, =gBattleBufferA + ldrb r3, [r5] + lsls r3, 9 + adds r0, r4, 0x1 + adds r0, r3, r0 + ldrb r0, [r0] + adds r1, r4, 0x2 + adds r1, r3, r1 + ldrb r1, [r1] + adds r2, r4, 0x3 + adds r2, r3, r2 + ldrb r2, [r2] + lsls r2, 8 + orrs r1, r2 + adds r2, r4, 0x4 + adds r2, r3, r2 + ldrb r2, [r2] + lsls r2, 16 + orrs r1, r2 + adds r4, 0x5 + adds r3, r4 + ldrb r2, [r3] + lsls r2, 24 + orrs r1, r2 + bl move_anim_start_t2_for_situation + ldr r1, =gBattleBankFunc + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_818714C + str r1, [r0] +_08189194: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8189144 + + thumb_func_start sub_81891AC +sub_81891AC: @ 81891AC + push {lr} + bl RecordedOpponentBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_81891AC + + thumb_func_start sub_81891B8 +sub_81891B8: @ 81891B8 + push {lr} + bl RecordedOpponentBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_81891B8 + + thumb_func_start sub_81891C4 +sub_81891C4: @ 81891C4 + push {lr} + bl RecordedOpponentBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_81891C4 + + thumb_func_start sub_81891D0 +sub_81891D0: @ 81891D0 + push {lr} + bl RecordedOpponentBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_81891D0 + + thumb_func_start sub_81891DC +sub_81891DC: @ 81891DC + push {lr} + bl RecordedOpponentBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_81891DC + + thumb_func_start sub_81891E8 +sub_81891E8: @ 81891E8 + push {lr} + bl RecordedOpponentBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_81891E8 + + thumb_func_start sub_81891F4 +sub_81891F4: @ 81891F4 + push {lr} + bl RecordedOpponentBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_81891F4 + + thumb_func_start sub_8189200 +sub_8189200: @ 8189200 + push {lr} + bl RecordedOpponentBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_8189200 + + thumb_func_start sub_818920C +sub_818920C: @ 818920C + push {lr} + bl RecordedOpponentBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_818920C + + thumb_func_start sub_8189218 +sub_8189218: @ 8189218 + push {lr} + ldr r2, =gUnknown_02022D0C + ldrb r1, [r2] + movs r0, 0x80 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + bl RecordedOpponentBufferExecCompleted + pop {r0} + bx r0 + .pool + thumb_func_end sub_8189218 + + thumb_func_start sub_8189234 +sub_8189234: @ 8189234 + push {lr} + ldr r3, =gUnknown_02022D0C + ldr r1, =gBattleBufferA + ldr r0, =gActiveBank + ldrb r0, [r0] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + movs r1, 0x7F + ands r1, r0 + ldrb r2, [r3] + movs r0, 0x80 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + bl RecordedOpponentBufferExecCompleted + pop {r0} + bx r0 + .pool + thumb_func_end sub_8189234 + + thumb_func_start sub_818926C +sub_818926C: @ 818926C + push {lr} + ldr r2, =gUnknown_02022D0C + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + bl RecordedOpponentBufferExecCompleted + pop {r0} + bx r0 + .pool + thumb_func_end sub_818926C + + thumb_func_start sub_8189284 +sub_8189284: @ 8189284 + push {lr} + ldr r3, =gUnknown_02022D0C + ldr r1, [r3] + lsls r1, 24 + lsrs r1, 31 + movs r0, 0x1 + eors r1, r0 + lsls r1, 7 + ldrb r2, [r3] + movs r0, 0x7F + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + bl RecordedOpponentBufferExecCompleted + pop {r0} + bx r0 + .pool + thumb_func_end sub_8189284 + + thumb_func_start sub_81892AC +sub_81892AC: @ 81892AC + push {r4,lr} + ldr r3, =gSprites + ldr r2, =gBankSpriteIds + ldr r4, =gActiveBank + ldrb r0, [r4] + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + bge _081892E0 + bl RecordedOpponentBufferExecCompleted + b _0818930A + .pool +_081892E0: + ldr r1, =gDoingBattleAnim + movs r0, 0x1 + strb r0, [r1] + ldrb r0, [r4] + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0 + strh r1, [r0, 0x30] + ldrb r0, [r4] + bl sub_80769F4 + ldr r1, =gBattleBankFunc + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_blink_t2 + str r1, [r0] +_0818930A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81892AC + + thumb_func_start sub_818931C +sub_818931C: @ 818931C + push {lr} + bl RecordedOpponentBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_818931C + + thumb_func_start sub_8189328 +sub_8189328: @ 8189328 + push {r4,lr} + ldr r4, =gActiveBank + ldrb r0, [r4] + bl GetBankSide + lsls r0, 24 + movs r3, 0x3F + cmp r0, 0 + bne _0818933C + movs r3, 0xC0 +_0818933C: + ldr r2, =gBattleBufferA + ldrb r1, [r4] + lsls r1, 9 + adds r0, r2, 0x1 + adds r0, r1, r0 + ldrb r0, [r0] + adds r2, 0x2 + adds r1, r2 + ldrb r1, [r1] + lsls r1, 8 + orrs r0, r1 + lsls r1, r3, 24 + asrs r1, 24 + bl PlaySE12WithPanning + bl RecordedOpponentBufferExecCompleted + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8189328 + + thumb_func_start sub_818936C +sub_818936C: @ 818936C + push {r4,r5,lr} + ldr r4, =gBattleBufferA + ldr r5, =gActiveBank + ldrb r0, [r5] + lsls r3, r0, 9 + adds r0, r4, 0x3 + adds r0, r3, r0 + ldrb r0, [r0] + cmp r0, 0 + beq _081893A8 + bl sub_805EA60 + ldrb r1, [r5] + lsls r1, 9 + adds r0, r4, 0x1 + adds r0, r1, r0 + ldrb r0, [r0] + adds r2, r4, 0x2 + adds r1, r2 + ldrb r1, [r1] + lsls r1, 8 + orrs r0, r1 + bl PlayBGM + b _081893BC + .pool +_081893A8: + adds r0, r4, 0x1 + adds r0, r3, r0 + ldrb r0, [r0] + adds r1, r4, 0x2 + adds r1, r3, r1 + ldrb r1, [r1] + lsls r1, 8 + orrs r0, r1 + bl PlayFanfare +_081893BC: + bl RecordedOpponentBufferExecCompleted + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_818936C + + thumb_func_start sub_81893C8 +sub_81893C8: @ 81893C8 + push {lr} + ldr r1, =gBattlePartyID + ldr r0, =gActiveBank + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0xB + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x19 + movs r2, 0x5 + bl PlayCry3 + bl RecordedOpponentBufferExecCompleted + pop {r0} + bx r0 + .pool + thumb_func_end sub_81893C8 + + thumb_func_start sub_8189404 +sub_8189404: @ 8189404 + push {lr} + ldr r1, =gBattleBufferA + ldr r0, =gActiveBank + ldrb r0, [r0] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + bl battle_intro_launch + ldr r2, =gUnknown_020243FC + ldrh r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strh r0, [r2] + bl RecordedOpponentBufferExecCompleted + pop {r0} + bx r0 + .pool + thumb_func_end sub_8189404 + + thumb_func_start sub_8189438 +sub_8189438: @ 8189438 + push {r4-r6,lr} + ldr r5, =gBankSpriteIds + ldr r6, =gActiveBank + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =gSprites + adds r0, r4 + bl oamt_add_pos2_onto_pos1 + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x23 + strh r1, [r0, 0x2E] + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x8C + lsls r1, 1 + strh r1, [r0, 0x32] + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x22] + strh r1, [r0, 0x36] + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_80A6EEC + str r1, [r0] + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =sub_818962C + bl oamt_set_x3A_32 + ldr r0, =c3_0803D564 + movs r1, 0x5 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r4, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r4 + ldrb r0, [r6] + strh r0, [r1, 0x8] + ldr r3, =gUnknown_020244D0 + ldr r0, [r3] + ldrb r2, [r6] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081894FA + ldr r0, =gUnknown_020244B4 + adds r0, r2, r0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + ldr r1, =sub_8073C30 + str r1, [r0] +_081894FA: + ldr r0, [r3] + ldr r2, [r0, 0x8] + ldrb r0, [r2, 0x9] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x9] + ldr r1, =gBattleBankFunc + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, =nullsub_70 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8189438 + + thumb_func_start c3_0803D564 +c3_0803D564: @ 8189548 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r7, =gActiveBank + ldrb r0, [r7] + mov r9, r0 + ldr r1, =gTasks + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0, 0x8] + strb r0, [r7] + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08189582 + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081895B4 +_08189582: + ldr r0, =gBattleBufferA + ldrb r1, [r7] + lsls r2, r1, 9 + adds r0, 0x1 + adds r2, r0 + ldr r0, =gBattlePartyID + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + strb r0, [r2] + ldrb r0, [r7] + movs r1, 0 + bl sub_81885D8 + b _081895F4 + .pool +_081895B4: + ldr r4, =gBattleBufferA + ldrb r0, [r7] + lsls r1, r0, 9 + adds r4, 0x1 + adds r1, r4 + ldr r6, =gBattlePartyID + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + strb r0, [r1] + ldrb r0, [r7] + movs r1, 0 + bl sub_81885D8 + ldrb r0, [r7] + movs r5, 0x2 + eors r0, r5 + strb r0, [r7] + ldrb r0, [r7] + lsls r1, r0, 9 + adds r1, r4 + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + strb r0, [r1] + ldrb r0, [r7] + movs r1, 0 + bl sub_81885D8 + ldrb r0, [r7] + eors r0, r5 + strb r0, [r7] +_081895F4: + ldr r1, =gBattleBankFunc + ldr r2, =gActiveBank + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_818686C + str r1, [r0] + mov r0, r9 + strb r0, [r2] + mov r0, r8 + bl DestroyTask + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end c3_0803D564 + + thumb_func_start sub_818962C +sub_818962C: @ 818962C + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x6] + bl sub_805DFE4 + adds r0, r4, 0 + bl FreeSpriteOamMatrix + adds r0, r4, 0 + bl DestroySprite + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_818962C + + thumb_func_start sub_8189648 +sub_8189648: @ 8189648 + push {r4-r7,lr} + ldr r1, =gBattleBufferA + ldr r0, =gActiveBank + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08189678 + adds r0, r2, 0 + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + bne _08189678 + bl RecordedOpponentBufferExecCompleted + b _08189742 + .pool +_08189678: + ldr r4, =gUnknown_020244D0 + ldr r0, [r4] + ldr r3, =gActiveBank + ldrb r1, [r3] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0] + ldr r1, =gBattleBufferA + ldrb r2, [r3] + lsls r0, r2, 9 + adds r1, 0x2 + adds r0, r1 + ldrb r0, [r0] + adds r7, r3, 0 + cmp r0, 0 + beq _081896E4 + ldr r0, [r4] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r3, r0, r1 + ldrb r2, [r3, 0x1] + lsls r1, r2, 27 + lsrs r0, r1, 28 + cmp r0, 0x1 + bhi _081896DC + adds r0, 0x1 + movs r1, 0xF + ands r0, r1 + lsls r0, 1 + movs r1, 0x1F + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x1] + b _08189742 + .pool +_081896DC: + movs r0, 0x1F + negs r0, r0 + ands r0, r2 + strb r0, [r3, 0x1] +_081896E4: + adds r5, r7, 0 + ldrb r0, [r5] + lsls r3, r0, 9 + ldr r4, =gUnknown_02023068 + adds r1, r3, r4 + subs r2, r4, 0x3 + adds r2, r3, r2 + ldrb r2, [r2] + subs r4, 0x2 + adds r3, r4 + ldrb r3, [r3] + bl sub_80735DC + ldr r2, =gUnknown_020244B4 + ldrb r1, [r5] + adds r1, r2 + movs r3, 0 + strb r0, [r1] + ldr r6, =gUnknown_020244D0 + ldr r0, [r6] + ldrb r1, [r5] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strb r3, [r0, 0x5] + ldrb r2, [r5] + lsls r0, r2, 9 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _08189736 + ldr r0, [r6] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + movs r1, 0x5D + strb r1, [r0, 0x5] +_08189736: + ldr r0, =gBattleBankFunc + ldrb r1, [r7] + lsls r1, 2 + adds r1, r0 + ldr r0, =sub_818975C + str r0, [r1] +_08189742: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8189648 + + thumb_func_start sub_818975C +sub_818975C: @ 818975C + push {r4,lr} + ldr r4, =gUnknown_020244D0 + ldr r0, [r4] + ldr r3, =gActiveBank + ldrb r1, [r3] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x5] + adds r2, r1, 0x1 + strb r2, [r0, 0x5] + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x5C + bls _08189794 + ldr r0, [r4] + ldrb r1, [r3] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0 + strb r1, [r0, 0x5] + bl RecordedOpponentBufferExecCompleted +_08189794: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818975C + + thumb_func_start sub_81897A4 +sub_81897A4: @ 81897A4 + push {lr} + ldr r0, =gUnknown_020244D0 + ldr r1, [r0] + ldr r0, =gActiveBank + ldrb r3, [r0] + ldr r1, [r1, 0x4] + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081897D6 + ldr r2, =gTasks + ldr r0, =gUnknown_020244B4 + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldr r1, =sub_8073C30 + str r1, [r0] +_081897D6: + bl RecordedOpponentBufferExecCompleted + pop {r0} + bx r0 + .pool + thumb_func_end sub_81897A4 + + thumb_func_start sub_81897F4 +sub_81897F4: @ 81897F4 + push {lr} + bl RecordedOpponentBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_81897F4 + + thumb_func_start sub_8189800 +sub_8189800: @ 8189800 + push {r4,lr} + ldr r4, =gActiveBank + ldrb r0, [r4] + bl sub_80A6A90 + lsls r0, 24 + cmp r0, 0 + beq _08189846 + ldr r3, =gSprites + ldr r0, =gBankSpriteIds + ldrb r1, [r4] + adds r0, r1, r0 + ldrb r0, [r0] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r3 + ldr r0, =gBattleBufferA + lsls r1, 9 + adds r0, 0x1 + adds r1, r0 + adds r2, 0x3E + movs r0, 0x1 + ldrb r1, [r1] + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldrb r0, [r4] + bl sub_805E408 +_08189846: + bl RecordedOpponentBufferExecCompleted + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8189800 + + thumb_func_start sub_8189860 +sub_8189860: @ 8189860 + push {r4-r6,lr} + sub sp, 0x4 + ldr r6, =gActiveBank + ldrb r0, [r6] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _081898B8 + ldr r5, =gBattleBufferA + ldrb r2, [r6] + lsls r1, r2, 9 + adds r0, r5, 0x1 + adds r0, r1, r0 + ldrb r3, [r0] + adds r0, r5, 0x2 + adds r0, r1, r0 + ldrb r4, [r0] + adds r5, 0x3 + adds r1, r5 + ldrb r0, [r1] + lsls r0, 8 + orrs r4, r0 + str r4, [sp] + adds r0, r2, 0 + adds r1, r2, 0 + bl move_anim_start_t3 + lsls r0, 24 + cmp r0, 0 + beq _081898AC + bl RecordedOpponentBufferExecCompleted + b _081898B8 + .pool +_081898AC: + ldr r0, =gBattleBankFunc + ldrb r1, [r6] + lsls r1, 2 + adds r1, r0 + ldr r0, =sub_818717C + str r0, [r1] +_081898B8: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8189860 + + thumb_func_start sub_81898C8 +sub_81898C8: @ 81898C8 + push {lr} + bl RecordedOpponentBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_81898C8 + + thumb_func_start sub_81898D4 +sub_81898D4: @ 81898D4 + push {lr} + bl RecordedOpponentBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_81898D4 + + thumb_func_start sub_81898E0 +sub_81898E0: @ 81898E0 + push {lr} + ldr r1, =gBattleBufferA + ldr r0, =gActiveBank + ldrb r0, [r0] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r2, [r0] + cmp r2, 0x3 + bne _08189908 + ldr r0, =gBattleOutcome + strb r2, [r0] + b _08189910 + .pool +_08189908: + ldr r0, =gBattleOutcome + movs r1, 0x3 + eors r1, r2 + strb r1, [r0] +_08189910: + movs r0, 0x5 + bl FadeOutMapMusic + movs r0, 0x3 + bl BeginFastPaletteFade + bl RecordedOpponentBufferExecCompleted + ldr r1, =gBattleBankFunc + ldr r0, =gActiveBank + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_80587B0 + str r1, [r0] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81898E0 + + thumb_func_start nullsub_119 +nullsub_119: @ 8189944 + bx lr + thumb_func_end nullsub_119 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/battle_controller_recorded_player.s b/asm/battle_controller_recorded_player.s new file mode 100644 index 000000000..6149bc4fa --- /dev/null +++ b/asm/battle_controller_recorded_player.s @@ -0,0 +1,6144 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + + thumb_func_start nullsub_120 +nullsub_120: @ 8189948 + bx lr + thumb_func_end nullsub_120 + + thumb_func_start SetBankFuncToRecordedPlayerBufferRunCommand +SetBankFuncToRecordedPlayerBufferRunCommand: @ 818994C + ldr r1, =gBattleBankFunc + ldr r0, =gActiveBank + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =RecordedPlayerBufferRunCommand + str r1, [r0] + bx lr + .pool + thumb_func_end SetBankFuncToRecordedPlayerBufferRunCommand + + thumb_func_start RecordedPlayerBufferRunCommand +RecordedPlayerBufferRunCommand: @ 8189968 + push {lr} + ldr r2, =gBattleExecBuffer + ldr r1, =gBitTable + ldr r0, =gActiveBank + ldrb r3, [r0] + lsls r0, r3, 2 + adds r0, r1 + ldr r1, [r2] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _081899B4 + ldr r0, =gBattleBufferA + lsls r1, r3, 9 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x38 + bhi _081899B0 + ldr r0, =gRecordedPlayerBufferCommands + ldrb r1, [r1] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + bl _call_via_r0 + b _081899B4 + .pool +_081899B0: + bl RecordedPlayerBufferExecCompleted +_081899B4: + pop {r0} + bx r0 + thumb_func_end RecordedPlayerBufferRunCommand + + thumb_func_start sub_81899B8 +sub_81899B8: @ 81899B8 + push {lr} + ldr r2, =gSprites + ldr r1, =gBankSpriteIds + ldr r0, =gActiveBank + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =SpriteCallbackDummy + cmp r1, r0 + bne _081899DC + bl RecordedPlayerBufferExecCompleted +_081899DC: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81899B8 + + thumb_func_start sub_81899F0 +sub_81899F0: @ 81899F0 + push {r4-r6,lr} + ldr r6, =gSprites + ldr r5, =gBankSpriteIds + ldr r4, =gActiveBank + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r6, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, [r0] + ldr r0, =SpriteCallbackDummy + cmp r1, r0 + bne _08189A40 + movs r0, 0 + bl nullsub_25 + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + bl FreeSpriteOamMatrix + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + bl DestroySprite + bl RecordedPlayerBufferExecCompleted +_08189A40: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81899F0 + + thumb_func_start sub_8189A58 +sub_8189A58: @ 8189A58 + push {r4,lr} + ldr r4, =gUnknown_020244D0 + ldr r1, [r4] + ldr r3, =gActiveBank + ldrb r0, [r3] + ldr r2, [r1, 0x4] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0x9] + subs r0, 0x1 + strb r0, [r1, 0x9] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _08189A90 + ldr r0, [r4] + ldrb r1, [r3] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0 + strb r1, [r0, 0x9] + bl RecordedPlayerBufferExecCompleted +_08189A90: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8189A58 + + thumb_func_start sub_8189AA0 +sub_8189AA0: @ 8189AA0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r6, 0 + ldr r4, =gActiveBank + ldrb r0, [r4] + bl GetBankIdentity + lsls r0, 24 + cmp r0, 0 + beq _08189ABA + b _08189C60 +_08189ABA: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08189ADA + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08189B0C + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08189B0C +_08189ADA: + ldr r2, =gSprites + ldr r1, =gUnknown_03005D70 + ldrb r0, [r4] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =SpriteCallbackDummy + cmp r1, r0 + bne _08189B42 + b _08189B48 + .pool +_08189B0C: + ldr r2, =gSprites + ldr r5, =gUnknown_03005D70 + ldr r0, =gActiveBank + ldrb r3, [r0] + adds r0, r3, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r4, [r0] + ldr r0, =SpriteCallbackDummy + cmp r4, r0 + bne _08189B42 + movs r0, 0x2 + eors r3, r0 + adds r0, r3, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + cmp r0, r4 + bne _08189B42 + movs r6, 0x1 +_08189B42: + cmp r6, 0 + bne _08189B48 + b _08189D18 +_08189B48: + ldr r0, =gUnknown_020244D0 + mov r9, r0 + ldr r0, [r0] + ldr r5, =gActiveBank + ldrb r2, [r5] + ldr r3, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r4, r0, r3 + ldrb r1, [r4, 0x1] + movs r6, 0x1 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + bne _08189B6A + b _08189D18 +_08189B6A: + movs r1, 0x2 + mov r8, r1 + mov r1, r8 + eors r1, r2 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r1, [r0, 0x1] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + bne _08189B86 + b _08189D18 +_08189B86: + ldrb r1, [r4] + movs r3, 0x7F + adds r0, r3, 0 + ands r0, r1 + strb r0, [r4] + mov r1, r9 + ldr r0, [r1] + ldrb r2, [r5] + ldr r0, [r0, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x1] + movs r4, 0x2 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + strb r0, [r1, 0x1] + mov r0, r9 + ldr r2, [r0] + ldrb r0, [r5] + mov r1, r8 + eors r1, r0 + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + ands r3, r1 + strb r3, [r0] + mov r1, r9 + ldr r2, [r1] + ldrb r0, [r5] + mov r1, r8 + eors r1, r0 + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x1] + ands r4, r1 + strb r4, [r0, 0x1] + ldr r4, =0x000027f9 + adds r0, r4, 0 + bl FreeSpriteTilesByTag + adds r0, r4, 0 + bl FreeSpritePaletteByTag + ldr r7, =gBattlePartyID + ldrb r1, [r5] + lsls r0, r1, 1 + adds r0, r7 + ldrh r0, [r0] + movs r6, 0x64 + muls r0, r6 + ldr r4, =gPlayerParty + adds r0, r4 + bl sub_805E990 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08189C22 + ldrb r0, [r5] + mov r1, r8 + eors r1, r0 + lsls r0, r1, 1 + adds r0, r7 + ldrh r0, [r0] + muls r0, r6 + adds r0, r4 + bl sub_805E990 +_08189C22: + mov r1, r9 + ldr r0, [r1] + ldrb r1, [r5] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x3 + strb r1, [r0, 0x9] + ldr r1, =gBattleBankFunc + ldrb r0, [r5] + b _08189D10 + .pool +_08189C60: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08189C80 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08189CB0 + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08189CB0 +_08189C80: + ldr r2, =gSprites + ldr r1, =gUnknown_03005D70 + ldrb r0, [r4] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =SpriteCallbackDummy + cmp r1, r0 + bne _08189CE6 + b _08189CE4 + .pool +_08189CB0: + ldr r2, =gSprites + ldr r5, =gUnknown_03005D70 + ldr r0, =gActiveBank + ldrb r3, [r0] + adds r0, r3, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r4, [r0] + ldr r0, =SpriteCallbackDummy + cmp r4, r0 + bne _08189CE6 + movs r0, 0x2 + eors r3, r0 + adds r0, r3, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + cmp r0, r4 + bne _08189CE6 +_08189CE4: + movs r6, 0x1 +_08189CE6: + bl IsCryPlayingOrClearCrySongs + lsls r0, 24 + cmp r0, 0 + beq _08189CF2 + movs r6, 0 +_08189CF2: + cmp r6, 0 + beq _08189D18 + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldr r3, =gActiveBank + ldrb r1, [r3] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x3 + strb r1, [r0, 0x9] + ldr r1, =gBattleBankFunc + ldrb r0, [r3] +_08189D10: + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8189A58 + str r1, [r0] +_08189D18: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8189AA0 + + thumb_func_start sub_8189D40 +sub_8189D40: @ 8189D40 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r0, 0 + mov r10, r0 + ldr r4, =gActiveBank + ldrb r0, [r4] + bl GetBankIdentity + lsls r0, 24 + cmp r0, 0 + bne _08189DBE + ldr r5, =gUnknown_020244D0 + ldr r0, [r5] + ldrb r2, [r4] + ldr r1, [r0, 0x4] + lsls r3, r2, 1 + adds r0, r3, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r6, 0x88 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + bne _08189D8C + ldr r0, =gBattlePartyID + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r1, r0 + adds r0, r2, 0 + bl sub_8172EF0 +_08189D8C: + ldr r2, [r5] + ldrb r1, [r4] + movs r0, 0x2 + adds r3, r0, 0 + eors r3, r1 + ldr r1, [r2, 0x4] + lsls r2, r3, 1 + adds r0, r2, r3 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + bne _08189DBE + ldr r0, =gBattlePartyID + adds r0, r2, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r1, r0 + adds r0, r3, 0 + bl sub_8172EF0 +_08189DBE: + ldr r3, =gUnknown_020244D0 + ldr r0, [r3] + ldr r2, =gActiveBank + ldrb r5, [r2] + ldr r4, [r0, 0x4] + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r6, r0, r4 + ldrb r1, [r6] + movs r0, 0x8 + mov r12, r0 + ands r0, r1 + mov r9, r2 + mov r8, r3 + cmp r0, 0 + bne _08189EA2 + movs r7, 0x2 + adds r1, r7, 0 + eors r1, r5 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0] + mov r0, r12 + ands r0, r1 + cmp r0, 0 + bne _08189EA2 + ldrb r1, [r6, 0x1] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08189E84 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08189E54 + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08189E54 + ldr r4, =gUnknown_03005D70 + mov r1, r9 + ldrb r0, [r1] + adds r1, r7, 0 + eors r1, r0 + adds r0, r1, r4 + ldrb r0, [r0] + ldr r2, =gBattlePartyID + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =gPlayerParty + adds r1, r2 + movs r2, 0 + bl healthbar_draw_field_maybe + mov r1, r9 + ldrb r0, [r1] + eors r0, r7 + bl sub_8076918 + mov r1, r9 + ldrb r0, [r1] + eors r0, r7 + adds r0, r4 + ldrb r0, [r0] + bl sub_80729D0 +_08189E54: + ldr r5, =gUnknown_03005D70 + ldr r4, =gActiveBank + ldrb r1, [r4] + adds r0, r1, r5 + ldrb r0, [r0] + ldr r2, =gBattlePartyID + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =gPlayerParty + adds r1, r2 + movs r2, 0 + bl healthbar_draw_field_maybe + ldrb r0, [r4] + bl sub_8076918 + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + bl sub_80729D0 +_08189E84: + ldr r4, =gUnknown_020244D0 + ldr r0, [r4] + ldr r3, =gActiveBank + ldrb r1, [r3] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x1] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0, 0x1] + mov r9, r3 + mov r8, r4 +_08189EA2: + mov r1, r8 + ldr r0, [r1] + mov r1, r9 + ldrb r2, [r1] + ldr r3, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r3 + ldrb r1, [r0, 0x1] + movs r0, 0xC0 + ands r0, r1 + cmp r0, 0x80 + bne _08189F62 + movs r1, 0x2 + eors r1, r2 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r1, [r0, 0x1] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08189F62 + bl IsCryPlayingOrClearCrySongs + lsls r0, 24 + cmp r0, 0 + bne _08189F62 + mov r1, r8 + ldr r0, [r1] + mov r1, r9 + ldrb r2, [r1] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x1] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _08189F44 + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x42 + ands r0, r1 + cmp r0, 0x42 + bne _08189F38 + adds r0, r2, 0 + bl GetBankIdentity + lsls r0, 24 + cmp r0, 0 + bne _08189F44 + ldr r0, =gMPlay_BGM + bl m4aMPlayContinue + b _08189F44 + .pool +_08189F38: + ldr r0, =gMPlay_BGM + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl m4aMPlayVolumeControl +_08189F44: + ldr r0, =gUnknown_020244D0 + ldr r2, [r0] + ldr r0, =gActiveBank + ldrb r1, [r0] + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x1] + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0, 0x1] + movs r0, 0x1 + mov r10, r0 +_08189F62: + mov r1, r10 + cmp r1, 0 + beq _0818A02A + ldr r7, =gSprites + ldr r6, =gUnknown_03005D7C + ldr r5, =gActiveBank + ldrb r3, [r5] + adds r0, r3, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, r7, 0 + adds r4, 0x1C + adds r0, r4 + ldr r2, [r0] + ldr r0, =SpriteCallbackDummy + cmp r2, r0 + bne _0818A02A + ldr r0, =gBankSpriteIds + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + cmp r0, r2 + bne _0818A02A + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08189FC8 + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08189FC8 + ldrb r1, [r5] + movs r0, 0x2 + eors r0, r1 + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + bl DestroySprite +_08189FC8: + ldr r1, =gUnknown_03005D7C + ldr r4, =gActiveBank + ldrb r0, [r4] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + bl DestroySprite + ldr r3, =gUnknown_020244D0 + ldr r0, [r3] + ldr r2, [r0, 0x8] + ldrb r1, [r2, 0x9] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x9] + ldr r0, [r3] + ldrb r2, [r4] + ldr r0, [r0, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x1] + movs r0, 0x21 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x1] + ldr r0, [r3] + ldrb r2, [r4] + ldr r0, [r0, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x1] + movs r0, 0x7F + ands r0, r2 + strb r0, [r1, 0x1] + ldr r1, =gBattleBankFunc + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8189AA0 + str r1, [r0] +_0818A02A: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8189D40 + + thumb_func_start sub_818A064 +sub_818A064: @ 818A064 + push {lr} + ldr r2, =gSprites + ldr r1, =gBankSpriteIds + ldr r0, =gActiveBank + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + adds r0, r1, 0 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 27 + cmp r0, 0 + bge _0818A092 + movs r2, 0x24 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _0818A092 + bl RecordedPlayerBufferExecCompleted +_0818A092: + pop {r0} + bx r0 + .pool + thumb_func_end sub_818A064 + + thumb_func_start sub_818A0A4 +sub_818A0A4: @ 818A0A4 + push {r4-r6,lr} + ldr r5, =gActiveBank + ldrb r0, [r5] + ldr r6, =gUnknown_03005D70 + adds r1, r0, r6 + ldrb r1, [r1] + movs r2, 0 + movs r3, 0 + bl sub_8074AA0 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldrb r0, [r5] + adds r0, r6 + ldrb r0, [r0] + bl sub_80729D0 + lsls r4, 16 + asrs r1, r4, 16 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0818A0EC + ldrb r0, [r5] + adds r0, r6 + ldrb r0, [r0] + movs r2, 0 + bl heathbar_draw_hp + b _0818A106 + .pool +_0818A0EC: + ldr r2, =gBattlePartyID + ldrb r1, [r5] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, =gPlayerParty + adds r0, r2 + bl sub_805E990 + bl RecordedPlayerBufferExecCompleted +_0818A106: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818A0A4 + + thumb_func_start sub_818A114 +sub_818A114: @ 818A114 + push {r4-r6,lr} + ldr r6, =gSprites + ldr r5, =gBankSpriteIds + ldr r4, =gActiveBank + ldrb r2, [r4] + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r3, 0x22 + ldrsh r1, [r0, r3] + movs r3, 0x26 + ldrsh r0, [r0, r3] + adds r1, r0 + cmp r1, 0xA0 + ble _0818A190 + ldr r1, =gBattlePartyID + lsls r0, r2, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xB + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + bl nullsub_24 + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl FreeOamMatrix + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + bl DestroySprite + ldr r1, =gUnknown_03005D70 + ldrb r0, [r4] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 + bl RecordedPlayerBufferExecCompleted +_0818A190: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818A114 + + thumb_func_start sub_818A1B0 +sub_818A1B0: @ 818A1B0 + push {r4-r6,lr} + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldr r6, =gActiveBank + ldrb r2, [r6] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0818A204 + ldr r5, =gBankSpriteIds + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =gSprites + adds r0, r4 + bl FreeSpriteOamMatrix + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl DestroySprite + ldr r1, =gUnknown_03005D70 + ldrb r0, [r6] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 + bl RecordedPlayerBufferExecCompleted +_0818A204: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818A1B0 + + thumb_func_start sub_818A220 +sub_818A220: @ 818A220 + push {lr} + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + bne _0818A232 + bl RecordedPlayerBufferExecCompleted +_0818A232: + pop {r0} + bx r0 + thumb_func_end sub_818A220 + + thumb_func_start sub_818A238 +sub_818A238: @ 818A238 + push {r4,lr} + ldr r1, =gBankSpriteIds + ldr r0, =gActiveBank + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + ldr r2, =gSprites + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, r0, r2 + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0x20 + bne _0818A284 + movs r3, 0 + movs r0, 0 + strh r0, [r4, 0x30] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + subs r0, 0x5 + ands r0, r1 + strb r0, [r2] + ldr r0, =gDoingBattleAnim + strb r3, [r0] + bl RecordedPlayerBufferExecCompleted + b _0818A2AE + .pool +_0818A284: + ldrh r0, [r4, 0x30] + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _0818A2A8 + adds r3, r4, 0 + adds r3, 0x3E + ldrb r2, [r3] + lsls r0, r2, 29 + lsrs r0, 31 + movs r1, 0x1 + eors r1, r0 + lsls r1, 2 + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] +_0818A2A8: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] +_0818A2AE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_818A238 + + thumb_func_start sub_818A2B4 +sub_818A2B4: @ 818A2B4 + push {r4,lr} + ldr r2, =gSprites + ldr r0, =gUnknown_03005D70 + ldr r4, =gActiveBank + ldrb r3, [r4] + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =SpriteCallbackDummy + cmp r1, r0 + bne _0818A306 + adds r0, r3, 0 + bl sub_805E408 + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldrb r2, [r4] + ldr r1, [r0] + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0818A2FA + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x6 + bl move_anim_start_t4 +_0818A2FA: + ldr r0, =gBattleBankFunc + ldrb r1, [r4] + lsls r1, 2 + adds r1, r0 + ldr r0, =sub_818A328 + str r0, [r1] +_0818A306: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818A2B4 + + thumb_func_start sub_818A328 +sub_818A328: @ 818A328 + push {lr} + ldr r0, =gUnknown_020244D0 + ldr r1, [r0] + ldr r0, =gActiveBank + ldrb r3, [r0] + ldr r1, [r1, 0x4] + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0818A364 + ldr r2, =gSprites + ldr r0, =gBankSpriteIds + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =SpriteCallbackDummy + cmp r1, r0 + bne _0818A364 + bl RecordedPlayerBufferExecCompleted +_0818A364: + pop {r0} + bx r0 + .pool + thumb_func_end sub_818A328 + + thumb_func_start sub_818A37C +sub_818A37C: @ 818A37C + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r3, =gUnknown_020244D0 + ldr r0, [r3] + ldr r7, =gActiveBank + ldrb r1, [r7] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r2, r0, r2 + ldrb r1, [r2, 0x1] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0818A438 + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + ldr r0, [r3] + ldrb r2, [r7] + ldr r0, [r0, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x1] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x1] + ldr r4, =0x000027f9 + adds r0, r4, 0 + bl FreeSpriteTilesByTag + adds r0, r4, 0 + bl FreeSpritePaletteByTag + ldr r0, =c3_0802FDF4 + movs r1, 0xA + bl CreateTask + ldr r0, =gBattlePartyID + mov r8, r0 + ldrb r1, [r7] + lsls r0, r1, 1 + add r0, r8 + ldrh r0, [r0] + movs r6, 0x64 + muls r0, r6 + ldr r5, =gPlayerParty + adds r0, r5 + bl sub_805E990 + ldr r1, =gBankSpriteIds + ldrb r0, [r7] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + movs r1, 0 + bl StartSpriteAnim + ldr r4, =gUnknown_03005D70 + ldrb r1, [r7] + adds r0, r1, r4 + ldrb r0, [r0] + lsls r1, 1 + add r1, r8 + ldrh r1, [r1] + muls r1, r6 + adds r1, r5 + movs r2, 0 + bl healthbar_draw_field_maybe + ldrb r0, [r7] + bl sub_8076918 + ldrb r0, [r7] + adds r0, r4 + ldrb r0, [r0] + bl sub_80729D0 + ldr r1, =gBattleBankFunc + ldrb r0, [r7] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_818A2B4 + str r1, [r0] +_0818A438: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818A37C + + thumb_func_start sub_818A470 +sub_818A470: @ 818A470 + push {r4-r6,lr} + ldr r6, =gUnknown_020244D0 + ldr r0, [r6] + ldr r4, =gActiveBank + ldrb r2, [r4] + ldr r1, [r0, 0x4] + lsls r3, r2, 1 + adds r0, r3, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x88 + ands r0, r1 + cmp r0, 0 + bne _0818A4A2 + ldr r0, =gBattlePartyID + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r1, r0 + adds r0, r2, 0 + bl sub_8172EF0 +_0818A4A2: + ldr r5, =gSprites + ldr r0, =gUnknown_03005D7C + ldrb r2, [r4] + adds r0, r2, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r3, r0, 2 + adds r0, r5, 0 + adds r0, 0x1C + adds r0, r3, r0 + ldr r1, [r0] + ldr r0, =SpriteCallbackDummy + cmp r1, r0 + bne _0818A4E8 + ldr r0, [r6] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _0818A4E8 + adds r0, r3, r5 + bl DestroySprite + ldr r1, =gBattleBankFunc + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_818A37C + str r1, [r0] +_0818A4E8: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818A470 + + thumb_func_start RecordedPlayerBufferExecCompleted +RecordedPlayerBufferExecCompleted: @ 818A514 + push {r4,lr} + sub sp, 0x4 + ldr r1, =gBattleBankFunc + ldr r4, =gActiveBank + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =RecordedPlayerBufferRunCommand + str r1, [r0] + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0818A568 + bl link_get_multiplayer_id + mov r1, sp + strb r0, [r1] + movs r0, 0x2 + movs r1, 0x4 + mov r2, sp + bl PrepareBufferDataTransferLink + ldr r1, =gBattleBufferA + ldrb r0, [r4] + lsls r0, 9 + adds r0, r1 + movs r1, 0x38 + strb r1, [r0] + b _0818A57A + .pool +_0818A568: + ldr r2, =gBattleExecBuffer + ldr r1, =gBitTable + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + ldr r0, [r2] + bics r0, r1 + str r0, [r2] +_0818A57A: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end RecordedPlayerBufferExecCompleted + + thumb_func_start sub_818A58C +sub_818A58C: @ 818A58C + push {lr} + ldr r0, =gUnknown_020244D0 + ldr r2, [r0] + ldr r0, =gActiveBank + ldrb r1, [r0] + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _0818A5AE + bl RecordedPlayerBufferExecCompleted +_0818A5AE: + pop {r0} + bx r0 + .pool + thumb_func_end sub_818A58C + + thumb_func_start sub_818A5BC +sub_818A5BC: @ 818A5BC + push {lr} + ldr r0, =gUnknown_020244D0 + ldr r2, [r0] + ldr r0, =gActiveBank + ldrb r1, [r0] + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _0818A5DE + bl RecordedPlayerBufferExecCompleted +_0818A5DE: + pop {r0} + bx r0 + .pool + thumb_func_end sub_818A5BC + + thumb_func_start sub_818A5EC +sub_818A5EC: @ 818A5EC + push {r4-r6,lr} + sub sp, 0x100 + movs r6, 0 + ldr r1, =gBattleBufferA + ldr r0, =gActiveBank + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _0818A624 + ldr r0, =gBattlePartyID + lsls r1, r2, 1 + adds r1, r0 + ldrb r0, [r1] + mov r1, sp + bl sub_818A660 + adds r6, r0, 0 + b _0818A646 + .pool +_0818A624: + ldrb r4, [r1] + movs r5, 0 +_0818A628: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _0818A63E + lsls r0, r5, 24 + lsrs r0, 24 + mov r2, sp + adds r1, r2, r6 + bl sub_818A660 + adds r6, r0 +_0818A63E: + lsrs r4, 1 + adds r5, 0x1 + cmp r5, 0x5 + ble _0818A628 +_0818A646: + lsls r1, r6, 16 + lsrs r1, 16 + movs r0, 0x1 + mov r2, sp + bl dp01_build_cmdbuf_x1D_1D_numargs_varargs + bl RecordedPlayerBufferExecCompleted + add sp, 0x100 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_818A5EC + + thumb_func_start sub_818A660 +sub_818A660: @ 818A660 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x90 + adds r7, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + movs r6, 0 + ldr r2, =gBattleBufferA + ldr r3, =gActiveBank + ldrb r0, [r3] + lsls r0, 9 + adds r1, r2, 0x1 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3B + bls _0818A68A + bl _0818ADF6 +_0818A68A: + lsls r0, 2 + ldr r1, =_0818A6A0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0818A6A0: + .4byte _0818A790 + .4byte _0818A9B4 + .4byte _0818A9C4 + .4byte _0818A9D4 + .4byte _0818AA3C + .4byte _0818AA3C + .4byte _0818AA3C + .4byte _0818AA3C + .4byte _0818AA58 + .4byte _0818AA94 + .4byte _0818AA94 + .4byte _0818AA94 + .4byte _0818AA94 + .4byte _0818ADF6 + .4byte _0818ADF6 + .4byte _0818ADF6 + .4byte _0818ADF6 + .4byte _0818AAB0 + .4byte _0818AAC0 + .4byte _0818AAF0 + .4byte _0818AB00 + .4byte _0818AB10 + .4byte _0818AB20 + .4byte _0818AB30 + .4byte _0818AB40 + .4byte _0818AB50 + .4byte _0818AB60 + .4byte _0818AB70 + .4byte _0818AB80 + .4byte _0818AB90 + .4byte _0818ABA0 + .4byte _0818ABB0 + .4byte _0818AC00 + .4byte _0818AC10 + .4byte _0818AC20 + .4byte _0818AC30 + .4byte _0818AC40 + .4byte _0818AC50 + .4byte _0818AC60 + .4byte _0818AC70 + .4byte _0818AC80 + .4byte _0818ACB4 + .4byte _0818ACC4 + .4byte _0818ACD4 + .4byte _0818ACE4 + .4byte _0818ACF4 + .4byte _0818AD04 + .4byte _0818AD14 + .4byte _0818AD24 + .4byte _0818AD44 + .4byte _0818AD54 + .4byte _0818AD64 + .4byte _0818AD74 + .4byte _0818AD84 + .4byte _0818AD94 + .4byte _0818ADA4 + .4byte _0818ADB4 + .4byte _0818ADC4 + .4byte _0818ADD4 + .4byte _0818ADE4 +_0818A790: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =gPlayerParty + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB + bl GetMonData + mov r1, sp + strh r0, [r1] + adds r0, r4, 0 + movs r1, 0xC + bl GetMonData + mov r1, sp + strh r0, [r1, 0x2E] + movs r6, 0 + add r0, sp, 0x24 + mov r9, r0 + movs r1, 0x3B + add r1, sp + mov r10, r1 + mov r2, sp + adds r2, 0x2B + str r2, [sp, 0x80] + mov r0, sp + adds r0, 0x2A + str r0, [sp, 0x7C] + mov r1, sp + adds r1, 0x68 + str r1, [sp, 0x8C] + adds r2, 0x5 + str r2, [sp, 0x84] + adds r0, 0x12 + str r0, [sp, 0x88] + mov r8, r4 + add r4, sp, 0xC +_0818A7DC: + adds r1, r6, 0 + adds r1, 0xD + mov r0, r8 + bl GetMonData + strh r0, [r4] + adds r1, r6, 0 + adds r1, 0x11 + mov r0, r8 + bl GetMonData + mov r2, r9 + adds r1, r2, r6 + strb r0, [r1] + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x3 + ble _0818A7DC + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =gPlayerParty + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x15 + bl GetMonData + mov r1, r10 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x20 + bl GetMonData + ldr r2, [sp, 0x80] + strb r0, [r2] + adds r0, r4, 0 + movs r1, 0x19 + bl GetMonData + str r0, [sp, 0x44] + adds r0, r4, 0 + movs r1, 0x27 + bl GetMonData + mov r3, sp + movs r5, 0x1F + ands r0, r5 + ldrb r2, [r3, 0x14] + movs r1, 0x20 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x14] + adds r0, r4, 0 + movs r1, 0x28 + bl GetMonData + mov r3, sp + movs r6, 0x1F + ands r0, r6 + lsls r0, 5 + ldrh r2, [r3, 0x14] + ldr r1, =0xfffffc1f + ands r1, r2 + orrs r1, r0 + strh r1, [r3, 0x14] + adds r0, r4, 0 + movs r1, 0x29 + bl GetMonData + mov r3, sp + ands r0, r5 + lsls r0, 2 + ldrb r2, [r3, 0x15] + movs r1, 0x7D + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x15] + adds r0, r4, 0 + movs r1, 0x2A + bl GetMonData + movs r1, 0x1F + ands r1, r0 + lsls r1, 15 + ldr r0, [sp, 0x14] + ldr r2, =0xfff07fff + ands r0, r2 + orrs r0, r1 + str r0, [sp, 0x14] + adds r0, r4, 0 + movs r1, 0x2B + bl GetMonData + mov r3, sp + ands r0, r6 + lsls r0, 4 + ldrh r2, [r3, 0x16] + ldr r1, =0xfffffe0f + ands r1, r2 + orrs r1, r0 + strh r1, [r3, 0x16] + adds r0, r4, 0 + movs r1, 0x2C + bl GetMonData + mov r3, sp + ands r0, r5 + lsls r0, 1 + ldrb r2, [r3, 0x17] + movs r1, 0x3F + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x17] + adds r0, r4, 0 + movs r1, 0 + bl GetMonData + str r0, [sp, 0x48] + adds r0, r4, 0 + movs r1, 0x37 + bl GetMonData + str r0, [sp, 0x4C] + adds r0, r4, 0 + movs r1, 0x38 + bl GetMonData + ldr r1, [sp, 0x7C] + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x39 + bl GetMonData + mov r1, sp + strh r0, [r1, 0x28] + adds r0, r4, 0 + movs r1, 0x3A + bl GetMonData + mov r1, sp + strh r0, [r1, 0x2C] + adds r0, r4, 0 + movs r1, 0x3B + bl GetMonData + mov r1, sp + strh r0, [r1, 0x2] + adds r0, r4, 0 + movs r1, 0x3C + bl GetMonData + mov r1, sp + strh r0, [r1, 0x4] + adds r0, r4, 0 + movs r1, 0x3D + bl GetMonData + mov r1, sp + strh r0, [r1, 0x6] + adds r0, r4, 0 + movs r1, 0x3E + bl GetMonData + mov r1, sp + strh r0, [r1, 0x8] + adds r0, r4, 0 + movs r1, 0x3F + bl GetMonData + mov r1, sp + strh r0, [r1, 0xA] + adds r0, r4, 0 + movs r1, 0x2D + bl GetMonData + mov r3, sp + movs r1, 0x1 + ands r0, r1 + lsls r0, 6 + ldrb r2, [r3, 0x17] + movs r1, 0x41 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x17] + adds r0, r4, 0 + movs r1, 0x2E + bl GetMonData + mov r3, sp + lsls r0, 7 + ldrb r2, [r3, 0x17] + movs r1, 0x7F + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x17] + adds r0, r4, 0 + movs r1, 0x1 + bl GetMonData + str r0, [sp, 0x54] + adds r0, r4, 0 + movs r1, 0x2 + ldr r2, [sp, 0x8C] + bl GetMonData + ldr r0, [sp, 0x84] + ldr r1, [sp, 0x8C] + bl StringCopy10 + adds r0, r4, 0 + movs r1, 0x7 + ldr r2, [sp, 0x88] + bl GetMonData + mov r2, sp + movs r6, 0 +_0818A994: + adds r0, r7, r6 + adds r1, r2, r6 + ldrb r1, [r1] + strb r1, [r0] + adds r6, 0x1 + cmp r6, 0x57 + bls _0818A994 + b _0818ADF6 + .pool +_0818A9B4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xB + b _0818AD2E + .pool +_0818A9C4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xC + b _0818AD2E + .pool +_0818A9D4: + movs r6, 0 + add r2, sp, 0x58 + mov r9, r2 + add r0, sp, 0x60 + mov r10, r0 + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =gPlayerParty + adds r4, r1, r0 + mov r8, r9 +_0818A9EA: + adds r1, r6, 0 + adds r1, 0xD + adds r0, r4, 0 + bl GetMonData + mov r1, r8 + strh r0, [r1] + adds r1, r6, 0 + adds r1, 0x11 + adds r0, r4, 0 + bl GetMonData + mov r2, r10 + adds r1, r2, r6 + strb r0, [r1] + movs r0, 0x2 + add r8, r0 + adds r6, 0x1 + cmp r6, 0x3 + ble _0818A9EA + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x15 + bl GetMonData + mov r1, r9 + strb r0, [r1, 0xC] + mov r2, r9 + movs r6, 0 +_0818AA28: + adds r0, r7, r6 + adds r1, r2, r6 + ldrb r1, [r1] + strb r1, [r0] + adds r6, 0x1 + cmp r6, 0xF + bls _0818AA28 + b _0818ADF6 + .pool +_0818AA3C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldrb r1, [r3] + lsls r1, 9 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + adds r1, 0x9 + b _0818AD2E + .pool +_0818AA58: + movs r6, 0 + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r2, =gPlayerParty + mov r8, r2 +_0818AA64: + adds r1, r6, 0 + adds r1, 0x11 + mov r2, r8 + adds r0, r4, r2 + bl GetMonData + adds r1, r7, r6 + strb r0, [r1] + adds r6, 0x1 + cmp r6, 0x3 + ble _0818AA64 + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x15 + bl GetMonData + adds r1, r7, r6 + strb r0, [r1] + adds r6, 0x1 + b _0818ADF6 + .pool +_0818AA94: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldrb r1, [r3] + lsls r1, 9 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + adds r1, 0x8 + b _0818ADEE + .pool +_0818AAB0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x1 + b _0818AACA + .pool +_0818AAC0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x19 +_0818AACA: + bl GetMonData + adds r1, r0, 0 + strb r1, [r7] + movs r0, 0xFF + lsls r0, 8 + ands r0, r1 + lsrs r0, 8 + strb r0, [r7, 0x1] + movs r0, 0xFF + lsls r0, 16 + ands r0, r1 + lsrs r0, 16 + strb r0, [r7, 0x2] + movs r6, 0x3 + b _0818ADF6 + .pool +_0818AAF0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x1A + b _0818ADEE + .pool +_0818AB00: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x1B + b _0818ADEE + .pool +_0818AB10: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x1C + b _0818ADEE + .pool +_0818AB20: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x1D + b _0818ADEE + .pool +_0818AB30: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x1E + b _0818ADEE + .pool +_0818AB40: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x1F + b _0818ADEE + .pool +_0818AB50: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x20 + b _0818ADEE + .pool +_0818AB60: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x22 + b _0818ADEE + .pool +_0818AB70: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x23 + b _0818ADEE + .pool +_0818AB80: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x24 + b _0818ADEE + .pool +_0818AB90: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x25 + b _0818ADEE + .pool +_0818ABA0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x26 + b _0818ADEE + .pool +_0818ABB0: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =gPlayerParty + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x27 + bl GetMonData + strb r0, [r7] + adds r0, r4, 0 + movs r1, 0x28 + bl GetMonData + strb r0, [r7, 0x1] + adds r0, r4, 0 + movs r1, 0x29 + bl GetMonData + strb r0, [r7, 0x2] + adds r0, r4, 0 + movs r1, 0x2A + bl GetMonData + strb r0, [r7, 0x3] + adds r0, r4, 0 + movs r1, 0x2B + bl GetMonData + strb r0, [r7, 0x4] + adds r0, r4, 0 + movs r1, 0x2C + bl GetMonData + strb r0, [r7, 0x5] + movs r6, 0x6 + b _0818ADF6 + .pool +_0818AC00: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x27 + b _0818ADEE + .pool +_0818AC10: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x28 + b _0818ADEE + .pool +_0818AC20: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x29 + b _0818ADEE + .pool +_0818AC30: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x2A + b _0818ADEE + .pool +_0818AC40: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x2B + b _0818ADEE + .pool +_0818AC50: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x2C + b _0818ADEE + .pool +_0818AC60: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0 + b _0818AC8A + .pool +_0818AC70: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x9 + b _0818AD2E + .pool +_0818AC80: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x37 +_0818AC8A: + bl GetMonData + adds r1, r0, 0 + strb r1, [r7] + movs r0, 0xFF + lsls r0, 8 + ands r0, r1 + lsrs r0, 8 + strb r0, [r7, 0x1] + movs r0, 0xFF + lsls r0, 16 + ands r0, r1 + lsrs r0, 16 + strb r0, [r7, 0x2] + lsrs r0, r1, 24 + strb r0, [r7, 0x3] + movs r6, 0x4 + b _0818ADF6 + .pool +_0818ACB4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x38 + b _0818ADEE + .pool +_0818ACC4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x39 + b _0818AD2E + .pool +_0818ACD4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x3A + b _0818AD2E + .pool +_0818ACE4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x3B + b _0818AD2E + .pool +_0818ACF4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x3C + b _0818AD2E + .pool +_0818AD04: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x3D + b _0818AD2E + .pool +_0818AD14: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x3E + b _0818AD2E + .pool +_0818AD24: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x3F +_0818AD2E: + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + strb r0, [r7] + lsrs r0, 8 + strb r0, [r7, 0x1] + movs r6, 0x2 + b _0818ADF6 + .pool +_0818AD44: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x16 + b _0818ADEE + .pool +_0818AD54: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x17 + b _0818ADEE + .pool +_0818AD64: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x18 + b _0818ADEE + .pool +_0818AD74: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x21 + b _0818ADEE + .pool +_0818AD84: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x2F + b _0818ADEE + .pool +_0818AD94: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x30 + b _0818ADEE + .pool +_0818ADA4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x32 + b _0818ADEE + .pool +_0818ADB4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x33 + b _0818ADEE + .pool +_0818ADC4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x34 + b _0818ADEE + .pool +_0818ADD4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x35 + b _0818ADEE + .pool +_0818ADE4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x36 +_0818ADEE: + bl GetMonData + strb r0, [r7] + movs r6, 0x1 +_0818ADF6: + adds r0, r6, 0 + add sp, 0x90 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_818A660 + + thumb_func_start sub_818AE0C +sub_818AE0C: @ 818AE0C + push {lr} + bl RecordedPlayerBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_818AE0C + + thumb_func_start sub_818AE18 +sub_818AE18: @ 818AE18 + push {r4,r5,lr} + ldr r1, =gBattleBufferA + ldr r0, =gActiveBank + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _0818AE48 + ldr r0, =gBattlePartyID + lsls r1, r2, 1 + adds r1, r0 + ldrb r0, [r1] + bl sub_818AE70 + b _0818AE66 + .pool +_0818AE48: + ldrb r4, [r1] + movs r5, 0 +_0818AE4C: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _0818AE5A + adds r0, r5, 0 + bl sub_818AE70 +_0818AE5A: + lsrs r4, 1 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _0818AE4C +_0818AE66: + bl RecordedPlayerBufferExecCompleted + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_818AE18 + + thumb_func_start sub_818AE70 +sub_818AE70: @ 818AE70 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x34 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gActiveBank + ldrb r0, [r0] + lsls r0, 9 + ldr r2, =gUnknown_02023067 + adds r3, r0, r2 + adds r6, r3, 0 + subs r1, r2, 0x2 + adds r0, r1 + ldrb r0, [r0] + adds r7, r2, 0 + cmp r0, 0x3B + bls _0818AE9C + bl _0818B836 +_0818AE9C: + lsls r0, 2 + ldr r1, =_0818AEB4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0818AEB4: + .4byte _0818AFA4 + .4byte _0818B13C + .4byte _0818B15C + .4byte _0818B17C + .4byte _0818B1D4 + .4byte _0818B1D4 + .4byte _0818B1D4 + .4byte _0818B1D4 + .4byte _0818B1FC + .4byte _0818B260 + .4byte _0818B260 + .4byte _0818B260 + .4byte _0818B260 + .4byte _0818B836 + .4byte _0818B836 + .4byte _0818B836 + .4byte _0818B836 + .4byte _0818B290 + .4byte _0818B2B0 + .4byte _0818B2D0 + .4byte _0818B2F0 + .4byte _0818B310 + .4byte _0818B330 + .4byte _0818B350 + .4byte _0818B370 + .4byte _0818B390 + .4byte _0818B3B0 + .4byte _0818B3D0 + .4byte _0818B3F0 + .4byte _0818B410 + .4byte _0818B430 + .4byte _0818B450 + .4byte _0818B4C0 + .4byte _0818B4E0 + .4byte _0818B500 + .4byte _0818B520 + .4byte _0818B540 + .4byte _0818B560 + .4byte _0818B580 + .4byte _0818B5A0 + .4byte _0818B5C0 + .4byte _0818B5E0 + .4byte _0818B600 + .4byte _0818B620 + .4byte _0818B640 + .4byte _0818B660 + .4byte _0818B680 + .4byte _0818B6A0 + .4byte _0818B6C0 + .4byte _0818B6E0 + .4byte _0818B700 + .4byte _0818B720 + .4byte _0818B740 + .4byte _0818B760 + .4byte _0818B780 + .4byte _0818B7A0 + .4byte _0818B7C0 + .4byte _0818B7E0 + .4byte _0818B800 + .4byte _0818B820 +_0818AFA4: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =gPlayerParty + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB + adds r2, r6, 0 + bl SetMonData + adds r2, r6, 0 + adds r2, 0x2E + adds r0, r4, 0 + movs r1, 0xC + bl SetMonData + movs r0, 0 + mov r8, r0 + movs r0, 0x3B + adds r0, r6 + mov r10, r0 + adds r0, r6, 0 + adds r0, 0x2B + str r0, [sp, 0x20] + adds r0, 0x19 + str r0, [sp, 0x28] + adds r0, 0x4 + str r0, [sp, 0x2C] + adds r0, 0x4 + str r0, [sp, 0x30] + subs r0, 0x22 + str r0, [sp, 0x1C] + subs r0, 0x2 + str r0, [sp, 0x18] + adds r0, 0x4 + str r0, [sp, 0x24] + adds r0, r6, 0x2 + str r0, [sp, 0x4] + adds r0, r6, 0x4 + str r0, [sp, 0x8] + adds r0, r6, 0x6 + str r0, [sp, 0xC] + adds r0, 0x2 + str r0, [sp, 0x10] + adds r0, 0x2 + str r0, [sp, 0x14] + mov r9, r4 + adds r7, r6, 0 + adds r7, 0x24 + adds r4, r6, 0 + adds r4, 0xC +_0818B00A: + mov r1, r8 + adds r1, 0xD + mov r0, r9 + adds r2, r4, 0 + bl SetMonData + mov r1, r8 + adds r1, 0x11 + mov r0, r9 + adds r2, r7, 0 + bl SetMonData + adds r7, 0x1 + adds r4, 0x2 + movs r0, 0x1 + add r8, r0 + mov r0, r8 + cmp r0, 0x3 + ble _0818B00A + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =gPlayerParty + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x15 + mov r2, r10 + bl SetMonData + adds r0, r4, 0 + movs r1, 0x20 + ldr r2, [sp, 0x20] + bl SetMonData + adds r0, r4, 0 + movs r1, 0x19 + ldr r2, [sp, 0x28] + bl SetMonData + ldrb r0, [r6, 0x14] + lsls r0, 27 + lsrs r0, 27 + mov r1, sp + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x27 + mov r2, sp + bl SetMonData + mov r1, sp + ldrh r0, [r6, 0x14] + lsls r0, 22 + lsrs r0, 27 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x28 + mov r2, sp + bl SetMonData + mov r1, sp + ldrb r0, [r6, 0x15] + lsls r0, 25 + lsrs r0, 27 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x29 + mov r2, sp + bl SetMonData + mov r1, sp + ldr r0, [r6, 0x14] + lsls r0, 12 + lsrs r0, 27 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x2A + mov r2, sp + bl SetMonData + mov r1, sp + ldrh r0, [r6, 0x16] + lsls r0, 23 + lsrs r0, 27 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x2B + mov r2, sp + bl SetMonData + mov r1, sp + ldrb r0, [r6, 0x17] + lsls r0, 26 + lsrs r0, 27 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x2C + mov r2, sp + bl SetMonData + adds r0, r4, 0 + movs r1, 0 + ldr r2, [sp, 0x2C] + bl SetMonData + adds r0, r4, 0 + movs r1, 0x37 + ldr r2, [sp, 0x30] + bl SetMonData + adds r0, r4, 0 + movs r1, 0x38 + ldr r2, [sp, 0x1C] + bl SetMonData + adds r0, r4, 0 + movs r1, 0x39 + ldr r2, [sp, 0x18] + bl SetMonData + adds r0, r4, 0 + movs r1, 0x3A + ldr r2, [sp, 0x24] + bl SetMonData + adds r0, r4, 0 + movs r1, 0x3B + ldr r2, [sp, 0x4] + bl SetMonData + adds r0, r4, 0 + movs r1, 0x3C + ldr r2, [sp, 0x8] + bl SetMonData + adds r0, r4, 0 + movs r1, 0x3D + ldr r2, [sp, 0xC] + bl SetMonData + adds r0, r4, 0 + movs r1, 0x3E + ldr r2, [sp, 0x10] + bl SetMonData + adds r0, r4, 0 + movs r1, 0x3F + ldr r2, [sp, 0x14] + bl SetMonData + b _0818B836 + .pool +_0818B13C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0xB + bl SetMonData + b _0818B836 + .pool +_0818B15C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0xC + bl SetMonData + b _0818B836 + .pool +_0818B17C: + movs r0, 0 + mov r8, r0 + movs r0, 0xC + adds r0, r3 + mov r9, r0 + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =gPlayerParty + adds r7, r1, r0 + adds r6, r3, 0 + adds r6, 0x8 + adds r4, r3, 0 +_0818B196: + mov r1, r8 + adds r1, 0xD + adds r0, r7, 0 + adds r2, r4, 0 + bl SetMonData + mov r1, r8 + adds r1, 0x11 + adds r0, r7, 0 + adds r2, r6, 0 + bl SetMonData + adds r6, 0x1 + adds r4, 0x2 + movs r0, 0x1 + add r8, r0 + mov r0, r8 + cmp r0, 0x3 + ble _0818B196 + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x15 + mov r2, r9 + bl SetMonData + b _0818B836 + .pool +_0818B1D4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r3, =gBattleBufferA + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r1, r3, 0x1 + adds r1, r2, r1 + ldrb r1, [r1] + adds r1, 0x9 + b _0818B278 + .pool +_0818B1FC: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =gPlayerParty + adds r4, r0 + ldr r5, =gActiveBank + ldrb r2, [r5] + lsls r2, 9 + adds r2, r7 + adds r0, r4, 0 + movs r1, 0x11 + bl SetMonData + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x1 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x12 + bl SetMonData + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x2 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x13 + bl SetMonData + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x3 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x14 + bl SetMonData + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x4 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x15 + bl SetMonData + b _0818B836 + .pool +_0818B260: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r3, =gBattleBufferA + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r1, r3, 0x1 + adds r1, r2, r1 + ldrb r1, [r1] + adds r1, 0x8 +_0818B278: + adds r3, 0x3 + adds r2, r3 + bl SetMonData + b _0818B836 + .pool +_0818B290: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1 + bl SetMonData + b _0818B836 + .pool +_0818B2B0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x19 + bl SetMonData + b _0818B836 + .pool +_0818B2D0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1A + bl SetMonData + b _0818B836 + .pool +_0818B2F0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1B + bl SetMonData + b _0818B836 + .pool +_0818B310: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1C + bl SetMonData + b _0818B836 + .pool +_0818B330: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1D + bl SetMonData + b _0818B836 + .pool +_0818B350: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1E + bl SetMonData + b _0818B836 + .pool +_0818B370: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1F + bl SetMonData + b _0818B836 + .pool +_0818B390: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x20 + bl SetMonData + b _0818B836 + .pool +_0818B3B0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x22 + bl SetMonData + b _0818B836 + .pool +_0818B3D0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x23 + bl SetMonData + b _0818B836 + .pool +_0818B3F0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x24 + bl SetMonData + b _0818B836 + .pool +_0818B410: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x25 + bl SetMonData + b _0818B836 + .pool +_0818B430: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x26 + bl SetMonData + b _0818B836 + .pool +_0818B450: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =gPlayerParty + adds r4, r0 + ldr r5, =gActiveBank + ldrb r2, [r5] + lsls r2, 9 + adds r2, r7 + adds r0, r4, 0 + movs r1, 0x27 + bl SetMonData + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x1 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x28 + bl SetMonData + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x2 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x29 + bl SetMonData + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x3 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x2A + bl SetMonData + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x4 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x2B + bl SetMonData + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x5 + adds r2, r0 + adds r0, r4, 0 + b _0818B570 + .pool +_0818B4C0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x27 + bl SetMonData + b _0818B836 + .pool +_0818B4E0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x28 + bl SetMonData + b _0818B836 + .pool +_0818B500: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x29 + bl SetMonData + b _0818B836 + .pool +_0818B520: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x2A + bl SetMonData + b _0818B836 + .pool +_0818B540: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x2B + bl SetMonData + b _0818B836 + .pool +_0818B560: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 +_0818B570: + movs r1, 0x2C + bl SetMonData + b _0818B836 + .pool +_0818B580: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0 + bl SetMonData + b _0818B836 + .pool +_0818B5A0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x9 + bl SetMonData + b _0818B836 + .pool +_0818B5C0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x37 + bl SetMonData + b _0818B836 + .pool +_0818B5E0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x38 + bl SetMonData + b _0818B836 + .pool +_0818B600: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x39 + bl SetMonData + b _0818B836 + .pool +_0818B620: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3A + bl SetMonData + b _0818B836 + .pool +_0818B640: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3B + bl SetMonData + b _0818B836 + .pool +_0818B660: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3C + bl SetMonData + b _0818B836 + .pool +_0818B680: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3D + bl SetMonData + b _0818B836 + .pool +_0818B6A0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3E + bl SetMonData + b _0818B836 + .pool +_0818B6C0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3F + bl SetMonData + b _0818B836 + .pool +_0818B6E0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x16 + bl SetMonData + b _0818B836 + .pool +_0818B700: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x17 + bl SetMonData + b _0818B836 + .pool +_0818B720: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x18 + bl SetMonData + b _0818B836 + .pool +_0818B740: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x21 + bl SetMonData + b _0818B836 + .pool +_0818B760: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x2F + bl SetMonData + b _0818B836 + .pool +_0818B780: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x30 + bl SetMonData + b _0818B836 + .pool +_0818B7A0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x32 + bl SetMonData + b _0818B836 + .pool +_0818B7C0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x33 + bl SetMonData + b _0818B836 + .pool +_0818B7E0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x34 + bl SetMonData + b _0818B836 + .pool +_0818B800: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x35 + bl SetMonData + b _0818B836 + .pool +_0818B820: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gActiveBank + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x36 + bl SetMonData +_0818B836: + ldr r2, =gBattlePartyID + ldr r0, =gActiveBank + ldrb r1, [r0] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, =gPlayerParty + adds r0, r2 + bl sub_805E990 + add sp, 0x34 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818AE70 + + thumb_func_start sub_818B86C +sub_818B86C: @ 818B86C + push {r4-r7,lr} + ldr r1, =gBattlePartyID + ldr r7, =gActiveBank + ldrb r2, [r7] + lsls r0, r2, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + adds r3, r1, 0 + muls r3, r0 + ldr r4, =gBattleBufferA + lsls r2, 9 + adds r0, r4, 0x1 + adds r0, r2, r0 + ldrb r0, [r0] + ldr r1, =gPlayerParty + adds r0, r1 + adds r5, r3, r0 + movs r3, 0 + adds r0, r4, 0x2 + adds r2, r0 + ldrb r2, [r2] + cmp r3, r2 + bcs _0818B8C4 + adds r6, r4, 0 + adds r2, r7, 0 + adds r4, r0, 0 +_0818B8A2: + adds r1, r5, r3 + ldrb r0, [r2] + lsls r0, 9 + adds r0, 0x3 + adds r0, r3, r0 + adds r0, r6 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + ldrb r0, [r2] + lsls r0, 9 + adds r0, r4 + ldrb r0, [r0] + cmp r3, r0 + bcc _0818B8A2 +_0818B8C4: + bl RecordedPlayerBufferExecCompleted + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818B86C + + thumb_func_start sub_818B8E0 +sub_818B8E0: @ 818B8E0 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r0, =gBattlePartyID + mov r8, r0 + ldr r6, =gActiveBank + ldrb r1, [r6] + lsls r0, r1, 1 + add r0, r8 + ldrh r0, [r0] + movs r5, 0x64 + muls r0, r5 + ldr r4, =gPlayerParty + adds r0, r4 + bl sub_805DD7C + ldrb r0, [r6] + lsls r0, 1 + add r0, r8 + ldrh r0, [r0] + muls r0, r5 + adds r0, r4 + movs r1, 0xB + bl GetMonData + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldrb r0, [r6] + bl GetBankIdentity + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_806A068 + ldr r0, =gUnknown_0202499C + mov r8, r0 + ldrb r0, [r6] + movs r1, 0x2 + bl sub_80A5C6C + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldrb r0, [r6] + bl sub_80A6138 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldrb r0, [r6] + bl sub_80A82E4 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + mov r0, r8 + adds r1, r5, 0 + adds r2, r4, 0 + bl CreateSprite + ldr r4, =gBankSpriteIds + ldrb r1, [r6] + adds r1, r4 + strb r0, [r1] + ldr r5, =gSprites + ldrb r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =0x0000ff10 + strh r1, [r0, 0x24] + ldrb r2, [r6] + adds r0, r2, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r2, [r0, 0x2E] + ldrb r3, [r6] + adds r0, r3, r4 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + lsls r3, 4 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r3 + strb r0, [r1, 0x5] + ldrb r2, [r6] + adds r4, r2, r4 + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =gUnknown_020244E4 + adds r2, r1 + ldrb r1, [r2] + bl StartSpriteAnim + ldr r1, =gBattleBankFunc + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_818A064 + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818B8E0 + + thumb_func_start sub_818B9FC +sub_818B9FC: @ 818B9FC + push {r4-r6,lr} + ldr r5, =gActiveBank + ldrb r0, [r5] + ldr r4, =gBattleBufferA + lsls r1, r0, 9 + adds r6, r4, 0x2 + adds r1, r6 + ldrb r1, [r1] + bl sub_805EF84 + ldr r2, =gBattlePartyID + ldrb r0, [r5] + lsls r1, r0, 1 + adds r1, r2 + lsls r0, 9 + adds r4, 0x1 + adds r0, r4 + ldrb r0, [r0] + strh r0, [r1] + ldrb r1, [r5] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, =gPlayerParty + adds r0, r2 + bl sub_805DD7C + ldrb r0, [r5] + lsls r1, r0, 9 + adds r1, r6 + ldrb r1, [r1] + bl sub_818BA6C + ldr r1, =gBattleBankFunc + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_818A470 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818B9FC + + thumb_func_start sub_818BA6C +sub_818BA6C: @ 818BA6C + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + lsls r1, 24 + lsrs r1, 24 + adds r0, r6, 0 + bl sub_805EF84 + ldr r0, =gBattlePartyID + lsls r2, r6, 1 + adds r2, r0 + ldr r0, =gBattleBufferA + lsls r1, r6, 9 + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + strh r0, [r2] + ldrh r1, [r2] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xB + bl GetMonData + mov r8, r0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r0, =sub_805D714 + bl CreateInvisibleSpriteWithCallback + ldr r1, =gUnknown_03005D7C + mov r9, r1 + add r9, r6 + mov r1, r9 + strb r0, [r1] + adds r0, r6, 0 + bl GetBankIdentity + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, r8 + bl sub_806A068 + ldr r0, =gUnknown_0202499C + mov r10, r0 + adds r0, r6, 0 + movs r1, 0x2 + bl sub_80A5C6C + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + adds r0, r6, 0 + bl sub_80A6138 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r6, 0 + bl sub_80A82E4 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + mov r0, r10 + adds r1, r5, 0 + adds r2, r4, 0 + bl CreateSprite + ldr r4, =gBankSpriteIds + adds r4, r6, r4 + strb r0, [r4] + ldr r5, =gSprites + mov r0, r9 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrb r1, [r4] + strh r1, [r0, 0x30] + mov r0, r9 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r6, [r0, 0x32] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r6, [r0, 0x2E] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + mov r1, r8 + strh r1, [r0, 0x32] + ldrb r0, [r4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + lsls r3, r6, 4 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r3 + strb r0, [r1, 0x5] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =gUnknown_020244E4 + adds r6, r1 + ldrb r1, [r6] + bl StartSpriteAnim + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r5, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =SpriteCallbackDummy + str r1, [r0] + movs r0, 0 + movs r1, 0xFF + bl sub_80753E8 + mov r1, r9 + ldrb r2, [r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r5 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1, 0x2E] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818BA6C + + thumb_func_start sub_818BBE8 +sub_818BBE8: @ 818BBE8 + push {r4-r6,lr} + ldr r1, =gBattleBufferA + ldr r6, =gActiveBank + ldrb r2, [r6] + lsls r0, r2, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r3, [r0] + cmp r3, 0 + bne _0818BC30 + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + strb r3, [r0, 0x4] + ldr r1, =gBattleBankFunc + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_818BC78 + str r1, [r0] + b _0818BC66 + .pool +_0818BC30: + ldr r5, =gBankSpriteIds + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =gSprites + adds r0, r4 + bl FreeSpriteOamMatrix + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl DestroySprite + ldr r1, =gUnknown_03005D70 + ldrb r0, [r6] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 + bl RecordedPlayerBufferExecCompleted +_0818BC66: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818BBE8 + + thumb_func_start sub_818BC78 +sub_818BC78: @ 818BC78 + push {r4-r6,lr} + ldr r6, =gUnknown_020244D0 + ldr r4, [r6] + ldr r5, =gActiveBank + ldrb r2, [r5] + ldr r1, [r4, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r3, r0, r1 + ldrb r0, [r3, 0x4] + cmp r0, 0 + beq _0818BCA0 + cmp r0, 0x1 + beq _0818BCCE + b _0818BCF6 + .pool +_0818BCA0: + ldr r1, [r4] + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0818BCBA + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x5 + bl move_anim_start_t4 +_0818BCBA: + ldr r0, [r6] + ldrb r1, [r5] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x1 + strb r1, [r0, 0x4] + b _0818BCF6 +_0818BCCE: + ldrb r1, [r3] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _0818BCF6 + strb r0, [r3, 0x4] + ldrb r2, [r5] + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x1 + bl move_anim_start_t4 + ldr r1, =gBattleBankFunc + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_818A1B0 + str r1, [r0] +_0818BCF6: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818BC78 + + thumb_func_start sub_818BD04 +sub_818BD04: @ 818BD04 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r0, =gBattleTypeFlags + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 18 + ands r0, r1 + cmp r0, 0 + beq _0818BD48 + movs r0, 0x40 + ands r1, r0 + cmp r1, 0 + beq _0818BD30 + bl sub_8185F40 + lsls r0, 24 + lsrs r4, r0, 24 + b _0818BD4C + .pool +_0818BD30: + ldr r2, =gUnknown_020229E8 + ldr r0, =gUnknown_0203C7B4 + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + b _0818BD4A + .pool +_0818BD48: + ldr r0, =gUnknown_020229E8 +_0818BD4A: + ldrb r4, [r0, 0x13] +_0818BD4C: + ldr r0, =gBattleTypeFlags + ldr r1, [r0] + movs r2, 0x40 + ands r1, r2 + adds r5, r0, 0 + cmp r1, 0 + beq _0818BD98 + ldr r0, =gActiveBank + ldrb r0, [r0] + bl GetBankIdentity + movs r1, 0x2 + ands r1, r0 + movs r0, 0x20 + mov r9, r0 + cmp r1, 0 + beq _0818BD72 + movs r1, 0x5A + mov r9, r1 +_0818BD72: + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 15 + ands r0, r1 + cmp r0, 0 + beq _0818BD9C + movs r0, 0x5A + mov r9, r0 + ldr r1, =gUnknown_083054E0 + b _0818BD9E + .pool +_0818BD98: + movs r0, 0x50 + mov r9, r0 +_0818BD9C: + ldr r1, =gUnknown_08305D2C +_0818BD9E: + lsls r0, r4, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x8 + subs r0, r1 + lsls r0, 18 + movs r1, 0xA0 + lsls r1, 15 + adds r0, r1 + lsrs r7, r0, 16 + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 15 + ands r0, r1 + cmp r0, 0 + bne _0818BDC0 + b _0818BEDC +_0818BDC0: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldrb r0, [r0, 0x8] + bl sub_806F000 + lsls r0, 16 + lsrs r4, r0, 16 + adds r5, r4, 0 + ldr r6, =gActiveBank + ldrb r1, [r6] + adds r0, r5, 0 + bl sub_805DF38 + ldrb r0, [r6] + bl GetBankIdentity + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl sub_806A1C0 + ldr r0, =gUnknown_0202499C + mov r8, r0 + lsls r4, r7, 16 + asrs r4, 16 + ldrb r0, [r6] + bl sub_80A82E4 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + mov r0, r8 + mov r1, r9 + adds r2, r4, 0 + bl CreateSprite + ldr r4, =gBankSpriteIds + ldrb r1, [r6] + adds r1, r4 + strb r0, [r1] + ldr r0, =gTrainerFrontPicPaletteTable + lsls r5, 3 + adds r5, r0 + ldrh r0, [r5, 0x4] + bl IndexOfSpritePaletteTag + ldr r5, =gSprites + ldrb r1, [r6] + adds r1, r4 + ldrb r1, [r1] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + adds r2, r5 + lsls r0, 4 + ldrb r3, [r2, 0x5] + movs r1, 0xF + ands r1, r3 + orrs r1, r0 + strb r1, [r2, 0x5] + ldrb r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0xF0 + strh r1, [r0, 0x24] + ldrb r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x30 + strh r1, [r0, 0x26] + ldrb r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =0x0000fffe + strh r1, [r0, 0x2E] + ldrb r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r5, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_805D7AC + str r1, [r0] + ldrb r0, [r6] + adds r0, r4 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r2, [r1, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x1] + ldrb r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3F + ldrb r1, [r0] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0] + b _0818BF72 + .pool +_0818BEDC: + ldr r5, =gActiveBank + ldrb r1, [r5] + adds r0, r4, 0 + bl sub_805DF84 + ldrb r0, [r5] + bl GetBankIdentity + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl template_build_for_pokemon_or_trainer + ldr r6, =gUnknown_0202499C + mov r8, r9 + lsls r4, r7, 16 + asrs r4, 16 + ldrb r0, [r5] + bl sub_80A82E4 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r6, 0 + mov r1, r8 + adds r2, r4, 0 + bl CreateSprite + ldr r6, =gBankSpriteIds + ldrb r1, [r5] + adds r1, r6 + strb r0, [r1] + ldr r4, =gSprites + ldrb r3, [r5] + adds r0, r3, r6 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + lsls r3, 4 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r3 + strb r0, [r1, 0x5] + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xF0 + strh r1, [r0, 0x24] + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =0x0000fffe + strh r1, [r0, 0x2E] + ldrb r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, 0x1C + adds r0, r4 + ldr r1, =sub_805D7AC + str r1, [r0] +_0818BF72: + ldr r1, =gBattleBankFunc + ldr r0, =gActiveBank + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_81899B8 + str r1, [r0] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818BD04 + + thumb_func_start sub_818BFAC +sub_818BFAC: @ 818BFAC + push {lr} + bl RecordedPlayerBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_818BFAC + + thumb_func_start sub_818BFB8 +sub_818BFB8: @ 818BFB8 + push {r4-r6,lr} + ldr r6, =gBankSpriteIds + ldr r4, =gActiveBank + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, =gSprites + adds r0, r5 + bl oamt_add_pos2_onto_pos1 + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x23 + strh r1, [r0, 0x2E] + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =0x0000ffd8 + strh r1, [r0, 0x32] + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrh r1, [r0, 0x22] + strh r1, [r0, 0x36] + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r5, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_80A6EEC + str r1, [r0] + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =SpriteCallbackDummy + bl oamt_set_x3A_32 + ldr r1, =gBattleBankFunc + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_81899F0 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818BFB8 + + thumb_func_start sub_818C064 +sub_818C064: @ 818C064 + push {r4-r6,lr} + ldr r6, =gUnknown_020244D0 + ldr r4, [r6] + ldr r5, =gActiveBank + ldrb r2, [r5] + ldr r0, [r4, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r3, r1, r0 + ldrb r0, [r3, 0x4] + cmp r0, 0 + bne _0818C0B8 + ldr r1, [r4] + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0818C098 + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x5 + bl move_anim_start_t4 +_0818C098: + ldr r0, [r6] + ldrb r1, [r5] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x4] + adds r1, 0x1 + strb r1, [r0, 0x4] + b _0818C12E + .pool +_0818C0B8: + ldrb r1, [r3] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0818C12E + strb r4, [r3, 0x4] + ldr r2, =gBattlePartyID + ldrb r1, [r5] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, =gPlayerParty + adds r0, r2 + bl sub_805E990 + movs r1, 0x40 + negs r1, r1 + movs r0, 0x10 + bl PlaySE12WithPanning + ldr r2, =gSprites + ldr r3, =gBankSpriteIds + ldrb r0, [r5] + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r4, [r0, 0x30] + ldrb r0, [r5] + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x5 + strh r1, [r0, 0x32] + ldrb r0, [r5] + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, =sub_8039C00 + str r1, [r0] + ldr r1, =gBattleBankFunc + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_818A114 + str r1, [r0] +_0818C12E: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818C064 + + thumb_func_start sub_818C150 +sub_818C150: @ 818C150 + push {lr} + bl RecordedPlayerBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_818C150 + + thumb_func_start sub_818C15C +sub_818C15C: @ 818C15C + push {lr} + bl RecordedPlayerBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_818C15C + + thumb_func_start sub_818C168 +sub_818C168: @ 818C168 + push {lr} + bl RecordedPlayerBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_818C168 + + thumb_func_start sub_818C174 +sub_818C174: @ 818C174 + push {lr} + bl RecordedPlayerBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_818C174 + + thumb_func_start sub_818C180 +sub_818C180: @ 818C180 + push {r4-r6,lr} + ldr r6, =gActiveBank + ldrb r0, [r6] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + beq _0818C192 + b _0818C2A6 +_0818C192: + ldr r0, =gBattleBufferA + mov r12, r0 + ldrb r2, [r6] + lsls r2, 9 + adds r0, 0x1 + adds r0, r2, r0 + ldrb r0, [r0] + mov r1, r12 + adds r1, 0x2 + adds r1, r2, r1 + ldrb r1, [r1] + lsls r1, 8 + orrs r0, r1 + ldr r5, =gUnknown_02038432 + mov r1, r12 + adds r1, 0x3 + adds r2, r1 + ldrb r1, [r2] + strb r1, [r5] + ldr r4, =gUnknown_02038408 + ldrb r2, [r6] + lsls r2, 9 + mov r1, r12 + adds r1, 0x4 + adds r1, r2, r1 + ldrb r3, [r1] + mov r1, r12 + adds r1, 0x5 + adds r2, r1 + ldrb r1, [r2] + lsls r1, 8 + orrs r3, r1 + strh r3, [r4] + ldr r4, =gUnknown_02038404 + ldrb r2, [r6] + lsls r2, 9 + mov r1, r12 + adds r1, 0x6 + adds r1, r2, r1 + ldrb r3, [r1] + mov r1, r12 + adds r1, 0x7 + adds r1, r2, r1 + ldrb r1, [r1] + lsls r1, 8 + orrs r3, r1 + mov r1, r12 + adds r1, 0x8 + adds r1, r2, r1 + ldrb r1, [r1] + lsls r1, 16 + orrs r3, r1 + mov r1, r12 + adds r1, 0x9 + adds r2, r1 + ldrb r1, [r2] + lsls r1, 24 + orrs r3, r1 + str r3, [r4] + ldr r3, =gUnknown_0203841A + ldrb r1, [r6] + lsls r1, 9 + mov r2, r12 + adds r2, 0xA + adds r1, r2 + ldrb r1, [r1] + strb r1, [r3] + ldr r4, =gUnknown_0203841C + ldrb r2, [r6] + lsls r2, 9 + mov r1, r12 + adds r1, 0xC + adds r1, r2, r1 + ldrb r3, [r1] + mov r1, r12 + adds r1, 0xD + adds r2, r1 + ldrb r1, [r2] + lsls r1, 8 + orrs r3, r1 + strh r3, [r4] + ldr r3, =gUnknown_02038400 + ldrb r2, [r6] + lsls r2, 9 + mov r1, r12 + adds r1, 0x10 + adds r2, r1 + str r2, [r3] + ldr r3, =gUnknown_020244BC + ldrb r1, [r6] + lsls r1, 2 + adds r1, r3 + ldr r2, [r2] + str r2, [r1] + ldrb r1, [r5] + bl sub_805DB8C + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + beq _0818C288 + bl RecordedPlayerBufferExecCompleted + b _0818C2A6 + .pool +_0818C288: + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldrb r1, [r6] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strb r3, [r0, 0x4] + ldr r1, =gBattleBankFunc + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_move_anim_2 + str r1, [r0] +_0818C2A6: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818C180 + + thumb_func_start bx_move_anim_2 +bx_move_anim_2: @ 818C2B8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r2, =gBattleBufferA + ldr r6, =gActiveBank + ldrb r3, [r6] + lsls r1, r3, 9 + adds r0, r2, 0x1 + mov r10, r0 + adds r0, r1, r0 + ldrb r4, [r0] + adds r5, r2, 0x2 + mov r9, r5 + adds r0, r1, r5 + ldrb r0, [r0] + lsls r0, 8 + orrs r4, r0 + adds r2, 0xB + adds r1, r2 + ldrb r1, [r1] + mov r8, r1 + ldr r7, =gUnknown_020244D0 + ldr r5, [r7] + ldr r1, [r5, 0x4] + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r2, [r0, 0x4] + cmp r2, 0x1 + beq _0818C350 + cmp r2, 0x1 + bgt _0818C310 + cmp r2, 0 + beq _0818C31A + b _0818C42C + .pool +_0818C310: + cmp r2, 0x2 + beq _0818C37A + cmp r2, 0x3 + beq _0818C3F0 + b _0818C42C +_0818C31A: + ldr r1, [r5] + lsls r0, r3, 2 + adds r1, r0, r1 + ldrb r2, [r1] + movs r0, 0xC + ands r0, r2 + cmp r0, 0x4 + bne _0818C33C + movs r0, 0x8 + orrs r0, r2 + strb r0, [r1] + ldrb r2, [r6] + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x5 + bl move_anim_start_t4 +_0818C33C: + ldr r0, [r7] + ldrb r1, [r6] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x1 + strb r1, [r0, 0x4] + b _0818C42C +_0818C350: + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0818C42C + movs r0, 0 + bl sub_805EB9C + adds r0, r4, 0 + bl move_anim_start_t1 + ldr r0, [r7] + ldrb r1, [r6] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x2 + strb r1, [r0, 0x4] + b _0818C42C +_0818C37A: + ldr r0, =gUnknown_020383F8 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, =gUnknown_020383FD + ldrb r0, [r0] + cmp r0, 0 + bne _0818C42C + movs r0, 0x1 + bl sub_805EB9C + ldr r0, [r7] + ldrb r2, [r6] + ldr r1, [r0] + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0818C3C8 + mov r0, r8 + cmp r0, 0x1 + bhi _0818C3C8 + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x6 + bl move_anim_start_t4 + ldr r0, [r7] + ldrb r1, [r6] + ldr r0, [r0] + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + strb r0, [r1] +_0818C3C8: + ldr r0, =gUnknown_020244D0 + ldr r2, [r0] + ldr r0, =gActiveBank + ldrb r1, [r0] + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x3 + strb r1, [r0, 0x4] + b _0818C42C + .pool +_0818C3F0: + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0818C42C + bl sub_805E394 + ldrb r0, [r6] + lsls r2, r0, 9 + mov r3, r10 + adds r1, r2, r3 + ldrb r1, [r1] + add r2, r9 + ldrb r2, [r2] + lsls r2, 8 + orrs r1, r2 + bl sub_805E94C + ldr r0, [r7] + ldrb r1, [r6] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strb r4, [r0, 0x4] + bl RecordedPlayerBufferExecCompleted +_0818C42C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end bx_move_anim_2 + + thumb_func_start sub_818C43C +sub_818C43C: @ 818C43C + push {r4,lr} + ldr r0, =gUnknown_02022E14 + movs r1, 0 + strh r1, [r0] + ldr r0, =gUnknown_02022E16 + strh r1, [r0] + ldr r4, =gActiveBank + ldrb r0, [r4] + lsls r0, 9 + ldr r1, =gUnknown_02023066 + adds r0, r1 + ldrh r0, [r0] + bl battle_pick_message + ldr r0, =gUnknown_02022E2C + movs r1, 0 + bl battle_show_message_maybe + ldr r1, =gBattleBankFunc + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_818A220 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818C43C + + thumb_func_start sub_818C490 +sub_818C490: @ 818C490 + push {lr} + bl RecordedPlayerBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_818C490 + + thumb_func_start sub_818C49C +sub_818C49C: @ 818C49C + push {lr} + ldr r1, =gBattleCommunication + ldr r0, =gNoOfAllBanks + ldrb r0, [r0] + ldrb r1, [r1, 0x4] + lsrs r0, 1 + cmp r1, r0 + bcc _0818C4C6 + ldr r0, =gActiveBank + ldrb r0, [r0] + bl sub_8185054 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x1 + movs r2, 0 + bl dp01_build_cmdbuf_x21_a_bb + bl RecordedPlayerBufferExecCompleted +_0818C4C6: + pop {r0} + bx r0 + .pool + thumb_func_end sub_818C49C + + thumb_func_start sub_818C4D8 +sub_818C4D8: @ 818C4D8 + push {lr} + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 10 + ands r0, r1 + cmp r0, 0 + beq _0818C508 + ldr r1, =gBattleBankFunc + ldr r0, =gActiveBank + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_818C49C + str r1, [r0] + b _0818C522 + .pool +_0818C508: + ldr r0, =gActiveBank + ldrb r0, [r0] + bl sub_8185054 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x1 + movs r2, 0 + bl dp01_build_cmdbuf_x21_a_bb + bl RecordedPlayerBufferExecCompleted +_0818C522: + pop {r0} + bx r0 + .pool + thumb_func_end sub_818C4D8 + + thumb_func_start sub_818C52C +sub_818C52C: @ 818C52C + push {lr} + bl RecordedPlayerBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_818C52C + + thumb_func_start sub_818C538 +sub_818C538: @ 818C538 + push {r4,r5,lr} + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 10 + ands r0, r1 + cmp r0, 0 + beq _0818C560 + bl sub_805D19C + adds r2, r0, 0 + lsls r2, 16 + lsrs r2, 16 + movs r0, 0x1 + movs r1, 0xA + bl dp01_build_cmdbuf_x21_a_bb + b _0818C584 + .pool +_0818C560: + ldr r5, =gActiveBank + ldrb r0, [r5] + bl sub_8185054 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldrb r0, [r5] + bl sub_8185054 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 16 + orrs r2, r4 + movs r0, 0x1 + movs r1, 0xA + bl dp01_build_cmdbuf_x21_a_bb +_0818C584: + bl RecordedPlayerBufferExecCompleted + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818C538 + + thumb_func_start sub_818C594 +sub_818C594: @ 818C594 + push {lr} + bl RecordedPlayerBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_818C594 + + thumb_func_start sub_818C5A0 +sub_818C5A0: @ 818C5A0 + push {r4,lr} + ldr r4, =gActiveBank + ldrb r0, [r4] + bl sub_8185054 + ldrb r1, [r4] + ldr r3, =gBattleStruct + ldr r2, [r3] + adds r1, r2 + adds r1, 0x5C + strb r0, [r1] + ldrb r0, [r4] + ldr r1, [r3] + adds r0, r1 + adds r0, 0x5C + ldrb r1, [r0] + movs r0, 0x1 + movs r2, 0 + bl dp01_build_cmdbuf_x22_a_three_bytes + bl RecordedPlayerBufferExecCompleted + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818C5A0 + + thumb_func_start sub_818C5DC +sub_818C5DC: @ 818C5DC + push {lr} + bl RecordedPlayerBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_818C5DC + + thumb_func_start sub_818C5E8 +sub_818C5E8: @ 818C5E8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + movs r0, 0 + bl load_gfxc_health_bar + ldr r3, =gBattleBufferA + ldr r0, =gActiveBank + mov r9, r0 + ldrb r4, [r0] + lsls r2, r4, 9 + adds r0, r3, 0x2 + adds r0, r2, r0 + ldrb r1, [r0] + adds r3, 0x3 + adds r2, r3 + ldrb r0, [r2] + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + asrs r7, r1, 16 + ldr r0, =0x00007fff + cmp r7, r0 + beq _0818C678 + ldr r6, =gBattlePartyID + lsls r0, r4, 1 + adds r0, r6 + ldrh r0, [r0] + movs r5, 0x64 + muls r0, r5 + ldr r4, =gPlayerParty + adds r0, r4 + movs r1, 0x3A + bl GetMonData + mov r8, r0 + mov r1, r9 + ldrb r0, [r1] + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + muls r0, r5 + adds r0, r4 + movs r1, 0x39 + bl GetMonData + adds r3, r0, 0 + mov r1, r9 + ldrb r0, [r1] + ldr r1, =gUnknown_03005D70 + adds r1, r0, r1 + ldrb r1, [r1] + str r7, [sp] + mov r2, r8 + bl sub_807294C + b _0818C6B2 + .pool +_0818C678: + ldr r1, =gBattlePartyID + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x3A + bl GetMonData + adds r2, r0, 0 + mov r1, r9 + ldrb r0, [r1] + ldr r4, =gUnknown_03005D70 + adds r1, r0, r4 + ldrb r1, [r1] + str r7, [sp] + movs r3, 0 + bl sub_807294C + mov r1, r9 + ldrb r0, [r1] + adds r0, r4 + ldrb r0, [r0] + movs r1, 0 + movs r2, 0 + bl heathbar_draw_hp +_0818C6B2: + ldr r1, =gBattleBankFunc + ldr r0, =gActiveBank + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_818A0A4 + str r1, [r0] + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818C5E8 + + thumb_func_start sub_818C6E8 +sub_818C6E8: @ 818C6E8 + push {lr} + bl RecordedPlayerBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_818C6E8 + + thumb_func_start sub_818C6F4 +sub_818C6F4: @ 818C6F4 + push {r4,lr} + ldr r4, =gActiveBank + ldrb r0, [r4] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _0818C748 + ldr r0, =gUnknown_03005D70 + ldrb r1, [r4] + adds r0, r1, r0 + ldrb r0, [r0] + ldr r2, =gBattlePartyID + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =gPlayerParty + adds r1, r2 + movs r2, 0x9 + bl healthbar_draw_field_maybe + ldrb r2, [r4] + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldr r0, [r0, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x11 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, =gBattleBankFunc + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_818A58C + str r1, [r0] +_0818C748: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818C6F4 + + thumb_func_start sub_818C76C +sub_818C76C: @ 818C76C + push {r4,r5,lr} + ldr r5, =gActiveBank + ldrb r0, [r5] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _0818C7BC + ldr r4, =gBattleBufferA + ldrb r3, [r5] + lsls r3, 9 + adds r0, r4, 0x1 + adds r0, r3, r0 + ldrb r0, [r0] + adds r1, r4, 0x2 + adds r1, r3, r1 + ldrb r1, [r1] + adds r2, r4, 0x3 + adds r2, r3, r2 + ldrb r2, [r2] + lsls r2, 8 + orrs r1, r2 + adds r2, r4, 0x4 + adds r2, r3, r2 + ldrb r2, [r2] + lsls r2, 16 + orrs r1, r2 + adds r4, 0x5 + adds r3, r4 + ldrb r2, [r3] + lsls r2, 24 + orrs r1, r2 + bl move_anim_start_t2_for_situation + ldr r1, =gBattleBankFunc + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_818A58C + str r1, [r0] +_0818C7BC: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818C76C + + thumb_func_start sub_818C7D4 +sub_818C7D4: @ 818C7D4 + push {lr} + bl RecordedPlayerBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_818C7D4 + + thumb_func_start sub_818C7E0 +sub_818C7E0: @ 818C7E0 + push {lr} + bl RecordedPlayerBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_818C7E0 + + thumb_func_start sub_818C7EC +sub_818C7EC: @ 818C7EC + push {lr} + bl RecordedPlayerBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_818C7EC + + thumb_func_start sub_818C7F8 +sub_818C7F8: @ 818C7F8 + push {lr} + bl RecordedPlayerBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_818C7F8 + + thumb_func_start sub_818C804 +sub_818C804: @ 818C804 + push {lr} + bl RecordedPlayerBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_818C804 + + thumb_func_start sub_818C810 +sub_818C810: @ 818C810 + push {lr} + bl RecordedPlayerBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_818C810 + + thumb_func_start sub_818C81C +sub_818C81C: @ 818C81C + push {lr} + bl RecordedPlayerBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_818C81C + + thumb_func_start sub_818C828 +sub_818C828: @ 818C828 + push {lr} + bl RecordedPlayerBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_818C828 + + thumb_func_start sub_818C834 +sub_818C834: @ 818C834 + push {lr} + bl RecordedPlayerBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_818C834 + + thumb_func_start sub_818C840 +sub_818C840: @ 818C840 + push {lr} + ldr r2, =gUnknown_02022D0C + ldrb r1, [r2] + movs r0, 0x80 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + bl RecordedPlayerBufferExecCompleted + pop {r0} + bx r0 + .pool + thumb_func_end sub_818C840 + + thumb_func_start sub_818C85C +sub_818C85C: @ 818C85C + push {lr} + ldr r3, =gUnknown_02022D0C + ldr r1, =gBattleBufferA + ldr r0, =gActiveBank + ldrb r0, [r0] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + movs r1, 0x7F + ands r1, r0 + ldrb r2, [r3] + movs r0, 0x80 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + bl RecordedPlayerBufferExecCompleted + pop {r0} + bx r0 + .pool + thumb_func_end sub_818C85C + + thumb_func_start sub_818C894 +sub_818C894: @ 818C894 + push {lr} + ldr r2, =gUnknown_02022D0C + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + bl RecordedPlayerBufferExecCompleted + pop {r0} + bx r0 + .pool + thumb_func_end sub_818C894 + + thumb_func_start sub_818C8AC +sub_818C8AC: @ 818C8AC + push {lr} + ldr r3, =gUnknown_02022D0C + ldr r1, [r3] + lsls r1, 24 + lsrs r1, 31 + movs r0, 0x1 + eors r1, r0 + lsls r1, 7 + ldrb r2, [r3] + movs r0, 0x7F + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + bl RecordedPlayerBufferExecCompleted + pop {r0} + bx r0 + .pool + thumb_func_end sub_818C8AC + + thumb_func_start sub_818C8D4 +sub_818C8D4: @ 818C8D4 + push {r4,lr} + ldr r3, =gSprites + ldr r2, =gBankSpriteIds + ldr r4, =gActiveBank + ldrb r0, [r4] + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + bge _0818C908 + bl RecordedPlayerBufferExecCompleted + b _0818C932 + .pool +_0818C908: + ldr r1, =gDoingBattleAnim + movs r0, 0x1 + strb r0, [r1] + ldrb r0, [r4] + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0 + strh r1, [r0, 0x30] + ldrb r0, [r4] + bl sub_80769F4 + ldr r1, =gBattleBankFunc + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_818A238 + str r1, [r0] +_0818C932: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818C8D4 + + thumb_func_start sub_818C944 +sub_818C944: @ 818C944 + push {lr} + bl RecordedPlayerBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_818C944 + + thumb_func_start sub_818C950 +sub_818C950: @ 818C950 + push {r4,lr} + ldr r4, =gActiveBank + ldrb r0, [r4] + bl GetBankSide + lsls r0, 24 + movs r3, 0x3F + cmp r0, 0 + bne _0818C964 + movs r3, 0xC0 +_0818C964: + ldr r2, =gBattleBufferA + ldrb r1, [r4] + lsls r1, 9 + adds r0, r2, 0x1 + adds r0, r1, r0 + ldrb r0, [r0] + adds r2, 0x2 + adds r1, r2 + ldrb r1, [r1] + lsls r1, 8 + orrs r0, r1 + lsls r1, r3, 24 + asrs r1, 24 + bl PlaySE12WithPanning + bl RecordedPlayerBufferExecCompleted + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818C950 + + thumb_func_start sub_818C994 +sub_818C994: @ 818C994 + push {r4,r5,lr} + ldr r4, =gBattleBufferA + ldr r5, =gActiveBank + ldrb r0, [r5] + lsls r3, r0, 9 + adds r0, r4, 0x3 + adds r0, r3, r0 + ldrb r0, [r0] + cmp r0, 0 + beq _0818C9D0 + bl sub_805EA60 + ldrb r1, [r5] + lsls r1, 9 + adds r0, r4, 0x1 + adds r0, r1, r0 + ldrb r0, [r0] + adds r2, r4, 0x2 + adds r1, r2 + ldrb r1, [r1] + lsls r1, 8 + orrs r0, r1 + bl PlayBGM + b _0818C9E4 + .pool +_0818C9D0: + adds r0, r4, 0x1 + adds r0, r3, r0 + ldrb r0, [r0] + adds r1, r4, 0x2 + adds r1, r3, r1 + ldrb r1, [r1] + lsls r1, 8 + orrs r0, r1 + bl PlayFanfare +_0818C9E4: + bl RecordedPlayerBufferExecCompleted + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_818C994 + + thumb_func_start sub_818C9F0 +sub_818C9F0: @ 818C9F0 + push {lr} + ldr r1, =gBattlePartyID + ldr r0, =gActiveBank + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xB + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x19 + negs r1, r1 + movs r2, 0x5 + bl PlayCry3 + bl RecordedPlayerBufferExecCompleted + pop {r0} + bx r0 + .pool + thumb_func_end sub_818C9F0 + + thumb_func_start dp01t_2E_2_battle_intro +dp01t_2E_2_battle_intro: @ 818CA30 + push {lr} + ldr r1, =gBattleBufferA + ldr r0, =gActiveBank + ldrb r0, [r0] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + bl battle_intro_launch + ldr r2, =gUnknown_020243FC + ldrh r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strh r0, [r2] + bl RecordedPlayerBufferExecCompleted + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_2E_2_battle_intro + + thumb_func_start sub_818CA64 +sub_818CA64: @ 818CA64 + push {r4-r6,lr} + ldr r5, =gBankSpriteIds + ldr r6, =gActiveBank + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =gSprites + adds r0, r4 + bl oamt_add_pos2_onto_pos1 + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x32 + strh r1, [r0, 0x2E] + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =0x0000ffd8 + strh r1, [r0, 0x32] + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x22] + strh r1, [r0, 0x36] + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_80A6EEC + str r1, [r0] + ldrb r2, [r6] + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r2, [r0, 0x38] + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =sub_805CC00 + bl oamt_set_x3A_32 + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x1 + bl StartSpriteAnim + ldr r0, =0x0000d6f9 + bl AllocSpritePalette + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 18 + ands r0, r1 + cmp r0, 0 + beq _0818CB54 + ldr r4, =gUnknown_020229E8 + ldrb r0, [r6] + bl sub_806D864 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r0, [r1, 0x13] + b _0818CB5A + .pool +_0818CB54: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldrb r0, [r0, 0x8] +_0818CB5A: + ldr r1, =gTrainerBackPicPaletteTable + lsls r0, 3 + adds r0, r1 + ldr r0, [r0] + lsls r4, r5, 4 + movs r2, 0x80 + lsls r2, 1 + adds r1, r4, r2 + movs r2, 0x20 + bl LoadCompressedPalette + ldr r2, =gSprites + ldr r1, =gBankSpriteIds + ldr r5, =gActiveBank + ldrb r0, [r5] + adds r0, r1 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r4 + strb r0, [r1, 0x5] + ldr r0, =sub_818CC24 + movs r1, 0x5 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r4, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r4 + ldrb r0, [r5] + strh r0, [r1, 0x8] + ldr r3, =gUnknown_020244D0 + ldr r0, [r3] + ldrb r2, [r5] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0818CBD4 + ldr r0, =gUnknown_020244B4 + adds r0, r2, r0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + ldr r1, =sub_8073C30 + str r1, [r0] +_0818CBD4: + ldr r0, [r3] + ldr r2, [r0, 0x8] + ldrb r0, [r2, 0x9] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x9] + ldr r1, =gBattleBankFunc + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =nullsub_120 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818CA64 + + thumb_func_start sub_818CC24 +sub_818CC24: @ 818CC24 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r1, =gTasks + lsls r0, 2 + add r0, r8 + lsls r0, 3 + adds r1, r0, r1 + ldrh r2, [r1, 0xA] + movs r3, 0xA + ldrsh r0, [r1, r3] + cmp r0, 0x17 + bgt _0818CC50 + adds r0, r2, 0x1 + strh r0, [r1, 0xA] + b _0818CD0C + .pool +_0818CC50: + ldr r7, =gActiveBank + ldrb r0, [r7] + mov r9, r0 + ldrh r0, [r1, 0x8] + strb r0, [r7] + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0818CC70 + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0818CCA0 +_0818CC70: + ldr r0, =gBattleBufferA + ldrb r1, [r7] + lsls r2, r1, 9 + adds r0, 0x1 + adds r2, r0 + ldr r0, =gBattlePartyID + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + strb r0, [r2] + ldrb r0, [r7] + movs r1, 0 + bl sub_818BA6C + b _0818CCF4 + .pool +_0818CCA0: + ldr r4, =gBattleBufferA + ldrb r0, [r7] + lsls r1, r0, 9 + adds r4, 0x1 + adds r1, r4 + ldr r5, =gBattlePartyID + lsls r0, 1 + adds r0, r5 + ldrh r0, [r0] + strb r0, [r1] + ldrb r0, [r7] + movs r1, 0 + bl sub_818BA6C + ldrb r0, [r7] + movs r6, 0x2 + eors r0, r6 + strb r0, [r7] + ldrb r0, [r7] + lsls r1, r0, 9 + adds r1, r4 + lsls r0, 1 + adds r0, r5 + ldrh r0, [r0] + strb r0, [r1] + ldrb r1, [r7] + lsls r0, r1, 1 + adds r0, r5 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, =gPlayerParty + adds r0, r2 + bl sub_805DD7C + ldrb r0, [r7] + movs r1, 0 + bl sub_818BA6C + ldrb r0, [r7] + eors r0, r6 + strb r0, [r7] +_0818CCF4: + ldr r1, =gBattleBankFunc + ldr r2, =gActiveBank + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8189D40 + str r1, [r0] + mov r3, r9 + strb r3, [r2] + mov r0, r8 + bl DestroyTask +_0818CD0C: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818CC24 + + thumb_func_start sub_818CD30 +sub_818CD30: @ 818CD30 + push {r4-r6,lr} + ldr r1, =gBattleBufferA + ldr r0, =gActiveBank + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0818CD60 + adds r0, r2, 0 + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + bne _0818CD60 + bl RecordedPlayerBufferExecCompleted + b _0818CDD4 + .pool +_0818CD60: + ldr r6, =gUnknown_020244D0 + ldr r0, [r6] + ldr r5, =gActiveBank + ldrb r1, [r5] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0] + ldrb r0, [r5] + lsls r3, r0, 9 + ldr r4, =gUnknown_02023068 + adds r1, r3, r4 + subs r2, r4, 0x3 + adds r2, r3, r2 + ldrb r2, [r2] + subs r4, 0x2 + adds r3, r4 + ldrb r3, [r3] + bl sub_80735DC + ldr r2, =gUnknown_020244B4 + ldrb r1, [r5] + adds r1, r2 + movs r3, 0 + strb r0, [r1] + ldr r0, [r6] + ldrb r1, [r5] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strb r3, [r0, 0x5] + ldrb r2, [r5] + lsls r0, r2, 9 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _0818CDC8 + ldr r0, [r6] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + movs r1, 0x5D + strb r1, [r0, 0x5] +_0818CDC8: + ldr r0, =gBattleBankFunc + ldrb r1, [r5] + lsls r1, 2 + adds r1, r0 + ldr r0, =bx_increment_dp11b_field_5_till_x60_then_resume + str r0, [r1] +_0818CDD4: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818CD30 + + thumb_func_start bx_increment_dp11b_field_5_till_x60_then_resume +bx_increment_dp11b_field_5_till_x60_then_resume: @ 818CDF4 + push {r4,lr} + ldr r4, =gUnknown_020244D0 + ldr r0, [r4] + ldr r3, =gActiveBank + ldrb r1, [r3] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x5] + adds r2, r1, 0x1 + strb r2, [r0, 0x5] + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x5C + bls _0818CE2C + ldr r0, [r4] + ldrb r1, [r3] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0 + strb r1, [r0, 0x5] + bl RecordedPlayerBufferExecCompleted +_0818CE2C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end bx_increment_dp11b_field_5_till_x60_then_resume + + thumb_func_start sub_818CE3C +sub_818CE3C: @ 818CE3C + push {lr} + ldr r0, =gUnknown_020244D0 + ldr r1, [r0] + ldr r0, =gActiveBank + ldrb r3, [r0] + ldr r1, [r1, 0x4] + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0818CE6E + ldr r2, =gTasks + ldr r0, =gUnknown_020244B4 + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldr r1, =sub_8073C30 + str r1, [r0] +_0818CE6E: + bl RecordedPlayerBufferExecCompleted + pop {r0} + bx r0 + .pool + thumb_func_end sub_818CE3C + + thumb_func_start sub_818CE8C +sub_818CE8C: @ 818CE8C + push {lr} + bl RecordedPlayerBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_818CE8C + + thumb_func_start sub_818CE98 +sub_818CE98: @ 818CE98 + push {r4,lr} + ldr r4, =gActiveBank + ldrb r0, [r4] + bl sub_80A6A90 + lsls r0, 24 + cmp r0, 0 + beq _0818CEDE + ldr r3, =gSprites + ldr r0, =gBankSpriteIds + ldrb r1, [r4] + adds r0, r1, r0 + ldrb r0, [r0] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r3 + ldr r0, =gBattleBufferA + lsls r1, 9 + adds r0, 0x1 + adds r1, r0 + adds r2, 0x3E + movs r0, 0x1 + ldrb r1, [r1] + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldrb r0, [r4] + bl sub_805E408 +_0818CEDE: + bl RecordedPlayerBufferExecCompleted + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818CE98 + + thumb_func_start sub_818CEF8 +sub_818CEF8: @ 818CEF8 + push {r4-r6,lr} + sub sp, 0x4 + ldr r6, =gActiveBank + ldrb r0, [r6] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _0818CF50 + ldr r5, =gBattleBufferA + ldrb r2, [r6] + lsls r1, r2, 9 + adds r0, r5, 0x1 + adds r0, r1, r0 + ldrb r3, [r0] + adds r0, r5, 0x2 + adds r0, r1, r0 + ldrb r4, [r0] + adds r5, 0x3 + adds r1, r5 + ldrb r0, [r1] + lsls r0, 8 + orrs r4, r0 + str r4, [sp] + adds r0, r2, 0 + adds r1, r2, 0 + bl move_anim_start_t3 + lsls r0, 24 + cmp r0, 0 + beq _0818CF44 + bl RecordedPlayerBufferExecCompleted + b _0818CF50 + .pool +_0818CF44: + ldr r0, =gBattleBankFunc + ldrb r1, [r6] + lsls r1, 2 + adds r1, r0 + ldr r0, =sub_818A5BC + str r0, [r1] +_0818CF50: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818CEF8 + + thumb_func_start sub_818CF60 +sub_818CF60: @ 818CF60 + push {lr} + bl RecordedPlayerBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_818CF60 + + thumb_func_start sub_818CF6C +sub_818CF6C: @ 818CF6C + push {lr} + bl RecordedPlayerBufferExecCompleted + pop {r0} + bx r0 + thumb_func_end sub_818CF6C + + thumb_func_start sub_818CF78 +sub_818CF78: @ 818CF78 + push {r4,lr} + ldr r2, =gBattleOutcome + ldr r1, =gBattleBufferA + ldr r4, =gActiveBank + ldrb r0, [r4] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + movs r0, 0x5 + bl FadeOutMapMusic + movs r0, 0x3 + bl BeginFastPaletteFade + bl RecordedPlayerBufferExecCompleted + ldr r1, =gBattleBankFunc + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_80587B0 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818CF78 + + thumb_func_start nullsub_121 +nullsub_121: @ 818CFC4 + bx lr + thumb_func_end nullsub_121 + + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom3.s b/asm/rom3.s index abb850681..114484544 100644 --- a/asm/rom3.s +++ b/asm/rom3.s @@ -40,7 +40,7 @@ _08032686: sub_803269C: @ 803269C push {r4-r7,lr} sub sp, 0x14 - ldr r0, =gUnknown_03005D04 + ldr r0, =gBattleMainFunc ldr r1, =nullsub_20 str r1, [r0] movs r0, 0 @@ -221,7 +221,7 @@ b_setup_bx: @ 8032824 ands r5, r3 cmp r5, 0 beq _080328E4 - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, =sub_8039ECC str r0, [r1] movs r4, 0x80 @@ -230,7 +230,7 @@ b_setup_bx: @ 8032824 cmp r4, 0 beq _08032874 ldr r2, =gBattleBankFunc - ldr r0, =sub_818994C + ldr r0, =SetBankFuncToRecordedPlayerBufferRunCommand str r0, [r2] ldr r1, =gBanksBySide movs r0, 0 @@ -244,7 +244,7 @@ _08032874: ldr r1, =gBanksBySide strb r4, [r1] _0803287E: - ldr r3, =sub_805F164 + ldr r3, =SetBankFuncToOpponentBufferRunCommand str r3, [r2, 0x4] movs r0, 0x1 strb r0, [r1, 0x1] @@ -285,7 +285,7 @@ _080328E4: beq _080328F0 b _080329E0 _080328F0: - ldr r0, =gUnknown_03005D04 + ldr r0, =gBattleMainFunc ldr r2, =sub_8039ECC str r2, [r0] movs r1, 0x80 @@ -319,7 +319,7 @@ _08032934: mov r1, r9 strb r1, [r4] mov r5, r10 - ldr r2, =sub_805F164 + ldr r2, =SetBankFuncToOpponentBufferRunCommand mov r8, r2 str r2, [r5, 0x4] movs r6, 0x1 @@ -347,30 +347,30 @@ _08032964: cmp r1, 0 beq _080329B4 mov r1, r12 - ldr r0, =gUnknown_03005D04 + ldr r0, =gBattleMainFunc str r1, [r0] - ldr r0, =sub_818994C + ldr r0, =SetBankFuncToRecordedPlayerBufferRunCommand str r0, [r5] mov r1, r9 strb r1, [r4] - ldr r0, =sub_81864EC + ldr r0, =SetBankFuncToRecordedOpponentBufferRunCommand str r0, [r5, 0x4] strb r6, [r4, 0x1] strb r7, [r2] b _08032CB2 .pool _080329B4: - ldr r0, =sub_818994C + ldr r0, =SetBankFuncToRecordedPlayerBufferRunCommand str r0, [r5, 0x4] strb r1, [r4, 0x1] - ldr r0, =sub_81864EC + ldr r0, =SetBankFuncToRecordedOpponentBufferRunCommand str r0, [r5] strb r6, [r4] strb r7, [r2] b _08032CB2 .pool _080329CC: - ldr r0, =sub_818994C + ldr r0, =SetBankFuncToRecordedPlayerBufferRunCommand mov r2, r10 str r0, [r2] strb r1, [r4] @@ -381,14 +381,14 @@ _080329CC: .pool _080329E0: ldr r1, =sub_8039ECC - ldr r2, =gUnknown_03005D04 + ldr r2, =gBattleMainFunc str r1, [r2] ldr r2, =gBattleBankFunc ldr r0, =SetBankFuncToPlayerBufferRunCommand str r0, [r2] ldr r4, =gBanksBySide strb r5, [r4] - ldr r6, =sub_805F164 + ldr r6, =SetBankFuncToOpponentBufferRunCommand str r6, [r2, 0x4] strb r7, [r4, 0x1] str r0, [r2, 0x8] @@ -420,9 +420,9 @@ _08032A20: cmp r0, r1 bne _08032AA0 ldr r0, =sub_8039ECC - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc str r0, [r1] - ldr r0, =sub_818994C + ldr r0, =SetBankFuncToRecordedPlayerBufferRunCommand str r0, [r2] strb r5, [r4] str r6, [r2, 0x4] @@ -513,7 +513,7 @@ _08032B06: lsls r1, 2 ldr r2, =gBattleBankFunc adds r1, r2 - ldr r2, =sub_818994C + ldr r2, =SetBankFuncToRecordedPlayerBufferRunCommand str r2, [r1] ldrh r1, [r3, 0x18] mov r12, r0 @@ -581,7 +581,7 @@ _08032B92: lsls r0, 2 ldr r1, =gBattleBankFunc adds r0, r1 - ldr r1, =sub_818994C + ldr r1, =SetBankFuncToRecordedPlayerBufferRunCommand str r1, [r0] ldrh r1, [r2, 0x18] cmp r1, 0x2 @@ -616,7 +616,7 @@ _08032BD8: lsls r0, 2 ldr r1, =gBattleBankFunc adds r0, r1 - ldr r1, =sub_81864EC + ldr r1, =SetBankFuncToRecordedOpponentBufferRunCommand str r1, [r0] ldrh r0, [r2, 0x18] cmp r0, 0x2 @@ -670,7 +670,7 @@ _08032C3C: ands r1, r3 cmp r1, 0 beq _08032C7C - ldr r0, =sub_818994C + ldr r0, =SetBankFuncToRecordedPlayerBufferRunCommand str r0, [r2] strb r5, [r4] str r0, [r2, 0x8] @@ -681,7 +681,7 @@ _08032C3C: ands r3, r0 cmp r3, 0 beq _08032C70 - ldr r0, =sub_81864EC + ldr r0, =SetBankFuncToRecordedOpponentBufferRunCommand str r0, [r2, 0x4] strb r7, [r4, 0x1] str r0, [r2, 0xC] @@ -697,7 +697,7 @@ _08032C70: strb r2, [r4, 0x3] b _08032CB2 _08032C7C: - ldr r0, =sub_818994C + ldr r0, =SetBankFuncToRecordedPlayerBufferRunCommand str r0, [r2, 0x4] strb r1, [r4, 0x1] str r0, [r2, 0xC] @@ -708,7 +708,7 @@ _08032C7C: ands r3, r0 cmp r3, 0 beq _08032CA8 - ldr r0, =sub_81864EC + ldr r0, =SetBankFuncToRecordedOpponentBufferRunCommand str r0, [r2] strb r7, [r4] str r0, [r2, 0x8] @@ -750,7 +750,7 @@ b_setup_bx_link: @ 8032CC0 ands r4, r1 cmp r4, 0 beq _08032D1C - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, =sub_8039ECC str r0, [r1] ldr r2, =gBattleBankFunc @@ -788,7 +788,7 @@ _08032D48: ands r3, r1 cmp r3, 0 beq _08032D98 - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, =sub_8039ECC str r0, [r1] ldr r2, =gBattleBankFunc @@ -839,7 +839,7 @@ _08032DD0: ands r3, r1 cmp r3, 0 beq _08032E1C - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, =sub_8039ECC str r0, [r1] ldr r2, =gBattleBankFunc @@ -848,7 +848,7 @@ _08032DD0: ldr r1, =gBanksBySide movs r0, 0 strb r0, [r1] - ldr r3, =sub_805F164 + ldr r3, =SetBankFuncToOpponentBufferRunCommand str r3, [r2, 0x4] strb r5, [r1, 0x1] ldr r0, =SetBankFuncToLinkPartnerBufferRunCommand @@ -903,7 +903,7 @@ _08032E8C: ands r0, r1 cmp r0, 0 beq _08032EA4 - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, =sub_8039ECC str r0, [r1] _08032EA4: diff --git a/asm/rom_8034C54.s b/asm/rom_8034C54.s index 561054c22..838ba77a5 100644 --- a/asm/rom_8034C54.s +++ b/asm/rom_8034C54.s @@ -9346,7 +9346,7 @@ sub_8039ECC: @ 8039ECC ldr r1, =gBattleCommunication movs r0, 0 strb r0, [r1, 0x1] - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, =bc_8012FAC str r0, [r1] pop {r0} @@ -9357,7 +9357,7 @@ sub_8039ECC: @ 8039ECC thumb_func_start sub_8039EF0 sub_8039EF0: @ 8039EF0 push {r4,r5,lr} - ldr r0, =gUnknown_03005D04 + ldr r0, =gBattleMainFunc ldr r0, [r0] bl _call_via_r0 ldr r1, =gActiveBank @@ -10884,7 +10884,7 @@ _0803ABF8: ldrb r1, [r1] cmp r0, r1 bne _0803AC2C - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, =bc_load_battlefield str r0, [r1] b _0803AC2E @@ -10914,7 +10914,7 @@ bc_load_battlefield: @ 803AC34 bl dp01_build_cmdbuf_x2E_a ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, =sub_803AC84 str r0, [r1] ldr r0, =gBattleCommunication @@ -11251,7 +11251,7 @@ _0803AF32: bcs _0803AF48 b _0803ACB4 _0803AF48: - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, =bc_801333C str r0, [r1] _0803AF4E: @@ -11391,7 +11391,7 @@ _0803B072: bl dp01_build_cmdbuf_x30_TODO ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, =bc_battle_begin_message b _0803B10A .pool @@ -11438,7 +11438,7 @@ _0803B0FA: adds r7, 0x1 cmp r7, 0x5 ble _0803B0B2 - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, =bc_8013568 _0803B10A: str r0, [r1] @@ -11466,7 +11466,7 @@ bc_battle_begin_message: @ 803B120 ldrb r1, [r1] movs r0, 0 bl b_std_message - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, =sub_803B180 str r0, [r1] _0803B142: @@ -11482,7 +11482,7 @@ bc_8013568: @ 803B158 ldr r0, [r0] cmp r0, 0 bne _0803B170 - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, =sub_803B3CC str r0, [r1] movs r0, 0 @@ -11530,7 +11530,7 @@ _0803B1BA: lsrs r1, 24 movs r0, 0x1 bl b_std_message - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, =sub_803B25C str r0, [r1] _0803B1D0: @@ -11590,7 +11590,7 @@ _0803B228: cmp r0, r1 bcc _0803B20E _0803B23A: - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, =bc_801362C str r0, [r1] pop {r4,r5} @@ -11623,7 +11623,7 @@ sub_803B25C: @ 803B25C b _0803B29A .pool _0803B288: - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, =sub_803B1DC b _0803B2F0 .pool @@ -11671,7 +11671,7 @@ _0803B2D8: cmp r0, r1 bcc _0803B2B2 _0803B2EC: - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, =bc_801362C _0803B2F0: str r0, [r1] @@ -11737,7 +11737,7 @@ _0803B36C: cmp r0, r1 bcc _0803B334 _0803B37E: - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, =sub_803B3CC str r0, [r1] _0803B384: @@ -11754,7 +11754,7 @@ sub_803B3AC: @ 803B3AC ldr r0, [r0] cmp r0, 0 bne _0803B3BC - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, =sub_803B3CC str r0, [r1] _0803B3BC: @@ -11801,7 +11801,7 @@ _0803B3F6: movs r0, 0x1 bl b_std_message _0803B412: - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, =sub_803B4C8 str r0, [r1] _0803B418: @@ -11874,7 +11874,7 @@ _0803B48A: lsls r2, 1 adds r0, r2 strb r1, [r0] - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, =sub_803B628 str r0, [r1] pop {r4,r5} @@ -11904,7 +11904,7 @@ sub_803B4C8: @ 803B4C8 b _0803B500 .pool _0803B4F0: - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, =sub_803B42C b _0803B572 .pool @@ -11965,7 +11965,7 @@ _0803B554: lsls r2, 1 adds r0, r2 strb r1, [r0] - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, =sub_803B628 _0803B572: str r0, [r1] @@ -12030,7 +12030,7 @@ _0803B5E6: lsls r2, 1 adds r0, r2 strb r1, [r0] - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, =sub_803B628 str r0, [r1] _0803B606: @@ -12294,7 +12294,7 @@ _0803B7EA: ldr r0, =gUnknown_085CC23E movs r1, 0 bl battle_show_message_maybe - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, =sub_803BE74 str r0, [r1] bl sub_803F988 @@ -12383,7 +12383,7 @@ bc_8013B1C: @ 803B904 ldr r0, [r0] cmp r0, 0 bne _0803B994 - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, =sub_803B9BC str r0, [r1] ldr r3, =gNoOfAllBanks @@ -12538,7 +12538,7 @@ _0803BA40: ldr r1, =gFightStateTracker movs r0, 0xC strb r0, [r1] - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, =bc_bs_exec str r0, [r1] b _0803BB78 @@ -12603,7 +12603,7 @@ _0803BAE6: mov r0, r9 movs r1, 0 bl battle_show_message_maybe - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, =sub_803BE74 str r0, [r1] bl Random @@ -14556,7 +14556,7 @@ _0803CD1E: bne _0803CD70 movs r0, 0x1 bl sub_818603C - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, =sub_803D2E8 str r0, [r1] ldr r0, =gBattleTypeFlags @@ -15358,7 +15358,7 @@ _0803D3C0: movs r3, 0x1 movs r5, 0 adds r4, r1, 0 - ldr r7, =gUnknown_03005D04 + ldr r7, =gBattleMainFunc mov r10, r7 ldr r0, =bc_80154A0 mov r12, r0 @@ -15529,7 +15529,7 @@ _0803D540: cmp r5, r0 blt _0803D4E8 _0803D54A: - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, =bc_80154A0 str r0, [r1] ldr r0, =gBattleStruct @@ -15822,7 +15822,7 @@ _0803D7AE: ldr r0, =gBattleStruct ldr r0, [r0] strb r2, [r0, 0x13] - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, =bc_bs_exec str r0, [r1] ldr r0, =gBattleCommunication @@ -15875,7 +15875,7 @@ _0803D828: ldr r1, =0xffefffff ands r0, r1 str r0, [r2] - ldr r3, =gUnknown_03005D04 + ldr r3, =gBattleMainFunc ldr r2, =gUnknown_0831BC44 ldrb r1, [r6] movs r0, 0x7F @@ -16069,7 +16069,7 @@ _0803DA9E: ldr r0, =gUnknown_082DA96A str r0, [r1] _0803DAA4: - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, =sub_803DCD8 str r0, [r1] pop {r4} @@ -16148,7 +16148,7 @@ _0803DB7C: ldr r0, =gUnknown_082DA96D str r0, [r1] _0803DB82: - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, =sub_803DCD8 str r0, [r1] pop {r4} @@ -16232,7 +16232,7 @@ _0803DC64: _0803DC68: str r0, [r1] _0803DC6A: - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, =sub_803DCD8 str r0, [r1] pop {r0} @@ -16264,7 +16264,7 @@ bc_80158BC: @ 803DC84 ldr r1, =gBattlescriptCurrInstr ldr r0, =gUnknown_082DAAF7 str r0, [r1] - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, =sub_803DCD8 str r0, [r1] bx lr @@ -16387,7 +16387,7 @@ _0803DDD2: bl BeginFastPaletteFade movs r0, 0x5 bl FadeOutMapMusic - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, =sub_803DE40 str r0, [r1] ldr r1, =gUnknown_030061E8 @@ -16436,13 +16436,13 @@ sub_803DE40: @ 803DE40 cmp r0, 0x1 beq _0803DE80 _0803DE62: - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, =c4_overworld str r0, [r1] b _0803DEA2 .pool _0803DE80: - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, =bc_evolution_cutscene str r0, [r1] _0803DE86: @@ -16497,7 +16497,7 @@ _0803DEC2: cmp r4, 0 beq _0803DF20 bl FreeAllWindowBuffers - ldr r0, =gUnknown_03005D04 + ldr r0, =gBattleMainFunc ldr r1, =sub_803DF48 str r1, [r0] lsls r3, r6, 24 @@ -16517,7 +16517,7 @@ _0803DF20: cmp r0, 0 bne _0803DEC0 _0803DF2E: - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, =c4_overworld str r0, [r1] _0803DF34: @@ -16535,7 +16535,7 @@ sub_803DF48: @ 803DF48 ldr r0, =sub_8038420 cmp r1, r0 bne _0803DF5A - ldr r1, =gUnknown_03005D04 + ldr r1, =gBattleMainFunc ldr r0, =bc_evolution_cutscene str r0, [r1] _0803DF5A: @@ -16634,7 +16634,7 @@ bc_move_exec_returning: @ 803E018 subs r0, 0x1 strb r0, [r1] _0803E03C: - ldr r2, =gUnknown_03005D04 + ldr r2, =gBattleMainFunc ldr r0, [r3] ldr r1, [r0, 0xC] adds r0, r1, 0 diff --git a/asm/rom_8184DA4.s b/asm/rom_8184DA4.s index 3a8ad2d0b..b3f81a6ec 100644 --- a/asm/rom_8184DA4.s +++ b/asm/rom_8184DA4.s @@ -2746,98969 +2746,4 @@ sub_81864E0: @ 81864E0 .pool thumb_func_end sub_81864E0 - thumb_func_start nullsub_70 -nullsub_70: @ 81864E8 - bx lr - thumb_func_end nullsub_70 - - thumb_func_start sub_81864EC -sub_81864EC: @ 81864EC - ldr r1, =gBattleBankFunc - ldr r0, =gActiveBank - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8186508 - str r1, [r0] - bx lr - .pool - thumb_func_end sub_81864EC - - thumb_func_start sub_8186508 -sub_8186508: @ 8186508 - push {lr} - ldr r2, =gBattleExecBuffer - ldr r1, =gBitTable - ldr r0, =gActiveBank - ldrb r3, [r0] - lsls r0, r3, 2 - adds r0, r1 - ldr r1, [r2] - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _08186554 - ldr r0, =gBattleBufferA - lsls r1, r3, 9 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0x38 - bhi _08186550 - ldr r0, =gUnknown_0860AE90 - ldrb r1, [r1] - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - bl _call_via_r0 - b _08186554 - .pool -_08186550: - bl sub_81871AC -_08186554: - pop {r0} - bx r0 - thumb_func_end sub_8186508 - - thumb_func_start sub_8186558 -sub_8186558: @ 8186558 - push {lr} - ldr r2, =gSprites - ldr r1, =gBankSpriteIds - ldr r0, =gActiveBank - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =SpriteCallbackDummy - cmp r1, r0 - bne _0818657C - bl sub_81871AC -_0818657C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8186558 - - thumb_func_start sub_8186590 -sub_8186590: @ 8186590 - push {lr} - ldr r2, =gSprites - ldr r1, =gBankSpriteIds - ldr r0, =gActiveBank - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =SpriteCallbackDummy - cmp r1, r0 - bne _081865B4 - bl sub_81871AC -_081865B4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8186590 - - thumb_func_start sub_81865C8 -sub_81865C8: @ 81865C8 - push {r4-r6,lr} - ldr r5, =gSprites - ldr r6, =gBankSpriteIds - ldr r4, =gActiveBank - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r2, r0, 2 - adds r0, r5, 0 - adds r0, 0x1C - adds r0, r2, r0 - ldr r1, [r0] - ldr r0, =SpriteCallbackDummy - cmp r1, r0 - bne _0818661A - adds r0, r2, r5 - ldrh r0, [r0, 0x6] - bl sub_805DFE4 - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl FreeSpriteOamMatrix - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl DestroySprite - bl sub_81871AC -_0818661A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81865C8 - - thumb_func_start sub_8186630 -sub_8186630: @ 8186630 - push {r4,lr} - ldr r4, =gUnknown_020244D0 - ldr r1, [r4] - ldr r3, =gActiveBank - ldrb r0, [r3] - ldr r2, [r1, 0x4] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r0, [r1, 0x9] - subs r0, 0x1 - strb r0, [r1, 0x9] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _08186668 - ldr r0, [r4] - ldrb r1, [r3] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0 - strb r1, [r0, 0x9] - bl sub_81871AC -_08186668: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8186630 - - thumb_func_start sub_8186678 -sub_8186678: @ 8186678 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r0, 0 - mov r9, r0 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _081866A4 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _081866F8 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081866F8 -_081866A4: - ldr r4, =gSprites - ldr r0, =gUnknown_03005D70 - ldr r2, =gActiveBank - ldrb r3, [r2] - adds r0, r3, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r4, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, [r0] - ldr r0, =SpriteCallbackDummy - mov r8, r2 - cmp r1, r0 - bne _08186764 - ldr r0, =gBankSpriteIds - adds r0, r3, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3F - ldrb r0, [r0] - lsls r0, 27 - cmp r0, 0 - bge _08186764 - b _0818676A - .pool -_081866F8: - ldr r6, =gSprites - ldr r7, =gUnknown_03005D70 - ldr r2, =gActiveBank - ldrb r3, [r2] - adds r0, r3, r7 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r5, r6, 0 - adds r5, 0x1C - adds r0, r5 - ldr r4, [r0] - ldr r0, =SpriteCallbackDummy - mov r8, r2 - cmp r4, r0 - bne _08186764 - movs r0, 0x2 - adds r2, r3, 0 - eors r2, r0 - adds r0, r2, r7 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r0, [r0] - cmp r0, r4 - bne _08186764 - ldr r4, =gBankSpriteIds - adds r0, r3, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x3F - ldrb r0, [r0] - lsls r0, 27 - cmp r0, 0 - bge _08186764 - adds r0, r2, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x3F - ldrb r0, [r0] - lsls r0, 27 - cmp r0, 0 - bge _08186764 - movs r1, 0x1 - mov r9, r1 -_08186764: - mov r2, r9 - cmp r2, 0 - beq _0818683A -_0818676A: - mov r6, r8 - ldrb r0, [r6] - bl GetBankIdentity - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x1 - bne _08186816 - ldr r0, =gUnknown_020244D0 - mov r12, r0 - ldr r0, [r0] - ldrb r2, [r6] - ldr r5, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r4, r0, r5 - ldrb r1, [r4, 0x1] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _0818683A - movs r7, 0x2 - adds r1, r7, 0 - eors r1, r2 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrb r1, [r0, 0x1] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _0818683A - ldrb r1, [r4] - movs r3, 0x7F - adds r0, r3, 0 - ands r0, r1 - strb r0, [r4] - mov r1, r12 - ldr r0, [r1] - ldrb r2, [r6] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x1] - movs r4, 0x2 - negs r4, r4 - adds r0, r4, 0 - ands r0, r2 - strb r0, [r1, 0x1] - mov r0, r12 - ldr r2, [r0] - ldrb r0, [r6] - adds r1, r7, 0 - eors r1, r0 - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - ands r3, r1 - strb r3, [r0] - mov r1, r12 - ldr r2, [r1] - ldrb r0, [r6] - adds r1, r7, 0 - eors r1, r0 - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x1] - ands r4, r1 - strb r4, [r0, 0x1] - ldr r4, =0x000027f9 - adds r0, r4, 0 - bl FreeSpriteTilesByTag - adds r0, r4, 0 - bl FreeSpritePaletteByTag -_08186816: - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - mov r2, r8 - ldrb r1, [r2] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x3 - strb r1, [r0, 0x9] - ldr r1, =gBattleBankFunc - mov r2, r8 - ldrb r0, [r2] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8186630 - str r1, [r0] -_0818683A: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8186678 - - thumb_func_start sub_818686C -sub_818686C: @ 818686C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r0, 0 - mov r9, r0 - mov r8, r0 - ldr r4, =gUnknown_020244D0 - ldr r0, [r4] - ldr r7, =gActiveBank - ldrb r2, [r7] - ldr r1, [r0, 0x4] - lsls r3, r2, 1 - adds r0, r3, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r5, 0x88 - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - bne _081868AC - ldr r0, =gBattlePartyID - adds r0, r3, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gEnemyParty - adds r1, r0 - adds r0, r2, 0 - bl sub_8172EF0 -_081868AC: - ldr r1, [r4] - ldrb r0, [r7] - movs r6, 0x2 - adds r2, r6, 0 - eors r2, r0 - ldr r1, [r1, 0x4] - lsls r3, r2, 1 - adds r0, r3, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - bne _081868DE - ldr r0, =gBattlePartyID - adds r0, r3, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gEnemyParty - adds r1, r0 - adds r0, r2, 0 - bl sub_8172EF0 -_081868DE: - ldr r0, [r4] - ldrb r2, [r7] - ldr r3, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r4, r0, r3 - ldrb r1, [r4] - movs r5, 0x8 - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - bne _081869AE - adds r1, r6, 0 - eors r1, r2 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r1, [r0] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - bne _081869AE - ldrb r1, [r4, 0x1] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08186994 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _08186964 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - bne _08186964 - ldr r4, =gUnknown_03005D70 - ldrb r0, [r7] - adds r1, r6, 0 - eors r1, r0 - adds r0, r1, r4 - ldrb r0, [r0] - ldr r2, =gBattlePartyID - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =gEnemyParty - adds r1, r2 - movs r2, 0 - bl healthbar_draw_field_maybe - ldrb r0, [r7] - eors r0, r6 - bl sub_8076918 - ldrb r0, [r7] - eors r0, r6 - adds r0, r4 - ldrb r0, [r0] - bl sub_80729D0 -_08186964: - ldr r5, =gUnknown_03005D70 - ldr r4, =gActiveBank - ldrb r1, [r4] - adds r0, r1, r5 - ldrb r0, [r0] - ldr r2, =gBattlePartyID - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =gEnemyParty - adds r1, r2 - movs r2, 0 - bl healthbar_draw_field_maybe - ldrb r0, [r4] - bl sub_8076918 - ldrb r0, [r4] - adds r0, r5 - ldrb r0, [r0] - bl sub_80729D0 -_08186994: - ldr r0, =gUnknown_020244D0 - ldr r2, [r0] - ldr r0, =gActiveBank - ldrb r1, [r0] - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x1] - movs r2, 0x80 - orrs r1, r2 - strb r1, [r0, 0x1] -_081869AE: - ldr r5, =gUnknown_020244D0 - ldr r0, [r5] - ldr r4, =gActiveBank - ldrb r2, [r4] - ldr r3, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r3 - ldrb r1, [r0, 0x1] - movs r0, 0xC0 - ands r0, r1 - cmp r0, 0x80 - bne _08186A6A - movs r1, 0x2 - eors r1, r2 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r1, [r0, 0x1] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _08186A6A - bl IsCryPlayingOrClearCrySongs - lsls r0, 24 - cmp r0, 0 - bne _08186A6A - ldr r0, [r5] - ldrb r2, [r4] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x1] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _08186A4C - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x42 - ands r0, r1 - cmp r0, 0x42 - bne _08186A40 - adds r0, r2, 0 - bl GetBankIdentity - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08186A4C - ldr r0, =gMPlay_BGM - bl m4aMPlayContinue - b _08186A4C - .pool -_08186A40: - ldr r0, =gMPlay_BGM - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl m4aMPlayVolumeControl -_08186A4C: - ldr r0, =gUnknown_020244D0 - ldr r2, [r0] - ldr r0, =gActiveBank - ldrb r1, [r0] - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x1] - movs r2, 0x20 - orrs r1, r2 - strb r1, [r0, 0x1] - movs r0, 0x1 - mov r9, r0 -_08186A6A: - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - bne _08186AC8 - ldr r2, =gSprites - ldr r0, =gUnknown_03005D7C - ldr r1, =gActiveBank - ldrb r4, [r1] - adds r0, r4, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r3, [r0] - ldr r0, =SpriteCallbackDummy - cmp r3, r0 - bne _08186B26 - ldr r0, =gBankSpriteIds - adds r0, r4, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - cmp r0, r3 - bne _08186B26 - b _08186B22 - .pool -_08186AC8: - ldr r2, =gSprites - ldr r7, =gUnknown_03005D7C - ldr r0, =gActiveBank - ldrb r3, [r0] - adds r0, r3, r7 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r4, [r0] - ldr r0, =SpriteCallbackDummy - cmp r4, r0 - bne _08186B26 - ldr r6, =gBankSpriteIds - adds r0, r3, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r5, [r0] - cmp r5, r4 - bne _08186B26 - movs r0, 0x2 - eors r3, r0 - adds r0, r3, r7 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r4, [r0] - cmp r4, r5 - bne _08186B26 - adds r0, r3, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - cmp r0, r4 - bne _08186B26 -_08186B22: - movs r0, 0x1 - mov r8, r0 -_08186B26: - mov r0, r9 - cmp r0, 0 - beq _08186C10 - mov r0, r8 - cmp r0, 0 - beq _08186C10 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _08186B8A - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - bne _08186B8A - ldr r1, =gUnknown_03005D7C - ldr r5, =gActiveBank - ldrb r0, [r5] - movs r4, 0x2 - eors r0, r4 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl DestroySprite - ldrb r0, [r5] - eors r4, r0 - ldr r1, =gBattlePartyID - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0xB - bl GetMonData - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl sub_805EE54 -_08186B8A: - ldr r1, =gUnknown_03005D7C - ldr r4, =gActiveBank - ldrb r0, [r4] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl DestroySprite - ldrb r5, [r4] - ldr r1, =gBattlePartyID - lsls r0, r5, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0xB - bl GetMonData - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r5, 0 - bl sub_805EE54 - ldr r3, =gUnknown_020244D0 - ldr r0, [r3] - ldr r2, [r0, 0x8] - ldrb r1, [r2, 0x9] - movs r0, 0x2 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x9] - ldr r0, [r3] - ldrb r2, [r4] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x1] - movs r0, 0x21 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x1] - ldr r0, [r3] - ldrb r2, [r4] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x1] - movs r0, 0x7F - ands r0, r2 - strb r0, [r1, 0x1] - ldr r1, =gBattleBankFunc - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8186678 - str r1, [r0] -_08186C10: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818686C - - thumb_func_start sub_8186C48 -sub_8186C48: @ 8186C48 - push {r4-r7,lr} - ldr r4, =gSprites - ldr r0, =gBankSpriteIds - ldr r7, =gActiveBank - ldrb r3, [r7] - adds r0, r3, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r2, r0, 2 - adds r0, r4, 0 - adds r0, 0x1C - adds r0, r2, r0 - ldr r1, [r0] - ldr r0, =SpriteCallbackDummy - cmp r1, r0 - bne _08186CFA - adds r0, r2, r4 - movs r1, 0x24 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08186CFA - ldr r6, =gUnknown_020244D0 - ldr r0, [r6] - ldr r1, [r0, 0x4] - lsls r4, r3, 1 - adds r0, r4, r3 - lsls r0, 2 - adds r2, r0, r1 - ldrb r5, [r2] - movs r0, 0x80 - ands r0, r5 - cmp r0, 0 - bne _08186CC0 - ldr r0, =gBattlePartyID - adds r0, r4, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gEnemyParty - adds r1, r0 - adds r0, r3, 0 - bl sub_8172EF0 - b _08186CFA - .pool -_08186CC0: - ldrb r1, [r2, 0x1] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08186CFA - movs r0, 0x7F - ands r0, r5 - strb r0, [r2] - ldr r0, [r6] - ldrb r2, [r7] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x1] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x1] - ldr r4, =0x000027f9 - adds r0, r4, 0 - bl FreeSpriteTilesByTag - adds r0, r4, 0 - bl FreeSpritePaletteByTag - bl sub_81871AC -_08186CFA: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8186C48 - - thumb_func_start sub_8186D04 -sub_8186D04: @ 8186D04 - push {r4-r6,lr} - ldr r6, =gActiveBank - ldrb r0, [r6] - ldr r5, =gUnknown_03005D70 - adds r1, r0, r5 - ldrb r1, [r1] - movs r2, 0 - movs r3, 0 - bl sub_8074AA0 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldrb r0, [r6] - adds r0, r5 - ldrb r0, [r0] - bl sub_80729D0 - lsls r4, 16 - asrs r1, r4, 16 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _08186D4C - ldrb r0, [r6] - adds r0, r5 - ldrb r0, [r0] - movs r2, 0 - bl heathbar_draw_hp - b _08186D50 - .pool -_08186D4C: - bl sub_81871AC -_08186D50: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8186D04 - - thumb_func_start sub_8186D58 -sub_8186D58: @ 8186D58 - push {lr} - ldr r2, =gSprites - ldr r0, =gBankSpriteIds - ldr r1, =gActiveBank - ldrb r3, [r1] - adds r0, r3, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 31 - cmp r0, 0 - bne _08186D86 - ldr r0, =gUnknown_03005D70 - adds r0, r3, r0 - ldrb r0, [r0] - bl sub_8072984 - bl sub_81871AC -_08186D86: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8186D58 - - thumb_func_start sub_8186D9C -sub_8186D9C: @ 8186D9C - push {r4-r6,lr} - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldr r6, =gActiveBank - ldrb r2, [r6] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _08186DF6 - ldr r5, =gBankSpriteIds - adds r0, r2, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =gSprites - adds r0, r4 - bl FreeSpriteOamMatrix - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl DestroySprite - ldrb r0, [r6] - bl sub_805EEE0 - ldr r1, =gUnknown_03005D70 - ldrb r0, [r6] - adds r0, r1 - ldrb r0, [r0] - bl sub_8072984 - bl sub_81871AC -_08186DF6: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8186D9C - - thumb_func_start sub_8186E10 -sub_8186E10: @ 8186E10 - push {lr} - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - bne _08186E22 - bl sub_81871AC -_08186E22: - pop {r0} - bx r0 - thumb_func_end sub_8186E10 - - thumb_func_start bx_blink_t2 -bx_blink_t2: @ 8186E28 - push {r4,lr} - ldr r1, =gBankSpriteIds - ldr r0, =gActiveBank - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - ldr r2, =gSprites - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r4, r0, r2 - movs r1, 0x30 - ldrsh r0, [r4, r1] - cmp r0, 0x20 - bne _08186E74 - movs r3, 0 - movs r0, 0 - strh r0, [r4, 0x30] - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - subs r0, 0x5 - ands r0, r1 - strb r0, [r2] - ldr r0, =gDoingBattleAnim - strb r3, [r0] - bl sub_81871AC - b _08186E9E - .pool -_08186E74: - ldrh r0, [r4, 0x30] - movs r1, 0x3 - ands r0, r1 - cmp r0, 0 - bne _08186E98 - adds r3, r4, 0 - adds r3, 0x3E - ldrb r2, [r3] - lsls r0, r2, 29 - lsrs r0, 31 - movs r1, 0x1 - eors r1, r0 - lsls r1, 2 - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] -_08186E98: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] -_08186E9E: - pop {r4} - pop {r0} - bx r0 - thumb_func_end bx_blink_t2 - - thumb_func_start sub_8186EA4 -sub_8186EA4: @ 8186EA4 - push {r4,lr} - ldr r2, =gSprites - ldr r0, =gUnknown_03005D70 - ldr r4, =gActiveBank - ldrb r3, [r4] - adds r0, r3, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =SpriteCallbackDummy - cmp r1, r0 - bne _08186EF0 - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldr r1, [r0] - lsls r0, r3, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08186EE4 - adds r0, r3, 0 - adds r1, r3, 0 - adds r2, r3, 0 - movs r3, 0x6 - bl move_anim_start_t4 -_08186EE4: - ldr r0, =gBattleBankFunc - ldrb r1, [r4] - lsls r1, 2 - adds r1, r0 - ldr r0, =sub_8186F14 - str r0, [r1] -_08186EF0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8186EA4 - - thumb_func_start sub_8186F14 -sub_8186F14: @ 8186F14 - push {r4,lr} - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldr r4, =gActiveBank - ldrb r1, [r4] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _08186F6E - bl IsCryPlayingOrClearCrySongs - lsls r0, 24 - cmp r0, 0 - bne _08186F6E - ldr r2, =gSprites - ldr r1, =gBankSpriteIds - ldrb r0, [r4] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =SpriteCallbackDummy - cmp r1, r0 - beq _08186F5E - ldr r0, =nullsub_18 - cmp r1, r0 - bne _08186F6E -_08186F5E: - ldr r0, =gMPlay_BGM - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl m4aMPlayVolumeControl - bl sub_81871AC -_08186F6E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8186F14 - - thumb_func_start sub_8186F94 -sub_8186F94: @ 8186F94 - push {r4-r7,lr} - ldr r4, =gUnknown_020244D0 - ldr r0, [r4] - ldr r5, =gActiveBank - ldrb r2, [r5] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r3, r0, r1 - ldrb r1, [r3, 0x1] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08187050 - ldr r7, =gSprites - ldr r6, =gBankSpriteIds - adds r0, r2, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r7, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, [r0] - ldr r0, =SpriteCallbackDummy - cmp r1, r0 - bne _08187050 - ldrb r1, [r3] - movs r0, 0x7F - ands r0, r1 - strb r0, [r3] - ldr r0, [r4] - ldrb r2, [r5] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x1] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x1] - ldr r4, =0x000027f9 - adds r0, r4, 0 - bl FreeSpriteTilesByTag - adds r0, r4, 0 - bl FreeSpritePaletteByTag - ldrb r0, [r5] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - movs r1, 0 - bl StartSpriteAnim - ldr r4, =gUnknown_03005D70 - ldrb r1, [r5] - adds r0, r1, r4 - ldrb r0, [r0] - ldr r2, =gBattlePartyID - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =gEnemyParty - adds r1, r2 - movs r2, 0 - bl healthbar_draw_field_maybe - ldrb r0, [r5] - bl sub_8076918 - ldrb r0, [r5] - adds r0, r4 - ldrb r0, [r0] - bl sub_80729D0 - ldrb r0, [r5] - bl sub_805E408 - ldr r1, =gBattleBankFunc - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8186EA4 - str r1, [r0] -_08187050: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8186F94 - - thumb_func_start sub_8187084 -sub_8187084: @ 8187084 - push {r4-r6,lr} - ldr r6, =gUnknown_020244D0 - ldr r0, [r6] - ldr r5, =gActiveBank - ldrb r2, [r5] - ldr r1, [r0, 0x4] - lsls r3, r2, 1 - adds r0, r3, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x88 - ands r0, r1 - cmp r0, 0 - bne _081870B6 - ldr r0, =gBattlePartyID - adds r0, r3, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gEnemyParty - adds r1, r0 - adds r0, r2, 0 - bl sub_8172EF0 -_081870B6: - ldr r4, =gSprites - ldr r0, =gUnknown_03005D7C - ldrb r2, [r5] - adds r0, r2, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r3, r0, 2 - adds r0, r4, 0 - adds r0, 0x1C - adds r0, r3, r0 - ldr r1, [r0] - ldr r0, =SpriteCallbackDummy - cmp r1, r0 - bne _08187120 - ldr r0, [r6] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - bne _08187120 - adds r0, r3, r4 - bl DestroySprite - ldrb r4, [r5] - ldr r1, =gBattlePartyID - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0xB - bl GetMonData - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl sub_805EE54 - ldr r1, =gBattleBankFunc - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8186F94 - str r1, [r0] -_08187120: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8187084 - - thumb_func_start sub_818714C -sub_818714C: @ 818714C - push {lr} - ldr r0, =gUnknown_020244D0 - ldr r2, [r0] - ldr r0, =gActiveBank - ldrb r1, [r0] - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _0818716E - bl sub_81871AC -_0818716E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_818714C - - thumb_func_start sub_818717C -sub_818717C: @ 818717C - push {lr} - ldr r0, =gUnknown_020244D0 - ldr r2, [r0] - ldr r0, =gActiveBank - ldrb r1, [r0] - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _0818719E - bl sub_81871AC -_0818719E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_818717C - - thumb_func_start sub_81871AC -sub_81871AC: @ 81871AC - push {r4,lr} - sub sp, 0x4 - ldr r1, =gBattleBankFunc - ldr r4, =gActiveBank - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8186508 - str r1, [r0] - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08187200 - bl link_get_multiplayer_id - mov r1, sp - strb r0, [r1] - movs r0, 0x2 - movs r1, 0x4 - mov r2, sp - bl PrepareBufferDataTransferLink - ldr r1, =gBattleBufferA - ldrb r0, [r4] - lsls r0, 9 - adds r0, r1 - movs r1, 0x38 - strb r1, [r0] - b _08187212 - .pool -_08187200: - ldr r2, =gBattleExecBuffer - ldr r1, =gBitTable - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - ldr r0, [r2] - bics r0, r1 - str r0, [r2] -_08187212: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81871AC - - thumb_func_start sub_8187224 -sub_8187224: @ 8187224 - push {r4-r6,lr} - sub sp, 0x100 - movs r6, 0 - ldr r1, =gBattleBufferA - ldr r0, =gActiveBank - ldrb r2, [r0] - lsls r0, r2, 9 - adds r1, 0x2 - adds r1, r0, r1 - ldrb r0, [r1] - cmp r0, 0 - bne _0818725C - ldr r0, =gBattlePartyID - lsls r1, r2, 1 - adds r1, r0 - ldrb r0, [r1] - mov r1, sp - bl sub_8187298 - adds r6, r0, 0 - b _0818727E - .pool -_0818725C: - ldrb r4, [r1] - movs r5, 0 -_08187260: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _08187276 - lsls r0, r5, 24 - lsrs r0, 24 - mov r2, sp - adds r1, r2, r6 - bl sub_8187298 - adds r6, r0 -_08187276: - lsrs r4, 1 - adds r5, 0x1 - cmp r5, 0x5 - ble _08187260 -_0818727E: - lsls r1, r6, 16 - lsrs r1, 16 - movs r0, 0x1 - mov r2, sp - bl dp01_build_cmdbuf_x1D_1D_numargs_varargs - bl sub_81871AC - add sp, 0x100 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8187224 - - thumb_func_start sub_8187298 -sub_8187298: @ 8187298 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x90 - adds r7, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - movs r6, 0 - ldr r2, =gBattleBufferA - ldr r3, =gActiveBank - ldrb r0, [r3] - lsls r0, 9 - adds r1, r2, 0x1 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x3B - bls _081872C2 - bl _08187A2E -_081872C2: - lsls r0, 2 - ldr r1, =_081872D8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081872D8: - .4byte _081873C8 - .4byte _081875EC - .4byte _081875FC - .4byte _0818760C - .4byte _08187674 - .4byte _08187674 - .4byte _08187674 - .4byte _08187674 - .4byte _08187690 - .4byte _081876CC - .4byte _081876CC - .4byte _081876CC - .4byte _081876CC - .4byte _08187A2E - .4byte _08187A2E - .4byte _08187A2E - .4byte _08187A2E - .4byte _081876E8 - .4byte _081876F8 - .4byte _08187728 - .4byte _08187738 - .4byte _08187748 - .4byte _08187758 - .4byte _08187768 - .4byte _08187778 - .4byte _08187788 - .4byte _08187798 - .4byte _081877A8 - .4byte _081877B8 - .4byte _081877C8 - .4byte _081877D8 - .4byte _081877E8 - .4byte _08187838 - .4byte _08187848 - .4byte _08187858 - .4byte _08187868 - .4byte _08187878 - .4byte _08187888 - .4byte _08187898 - .4byte _081878A8 - .4byte _081878B8 - .4byte _081878EC - .4byte _081878FC - .4byte _0818790C - .4byte _0818791C - .4byte _0818792C - .4byte _0818793C - .4byte _0818794C - .4byte _0818795C - .4byte _0818797C - .4byte _0818798C - .4byte _0818799C - .4byte _081879AC - .4byte _081879BC - .4byte _081879CC - .4byte _081879DC - .4byte _081879EC - .4byte _081879FC - .4byte _08187A0C - .4byte _08187A1C -_081873C8: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =gEnemyParty - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xB - bl GetMonData - mov r1, sp - strh r0, [r1] - adds r0, r4, 0 - movs r1, 0xC - bl GetMonData - mov r1, sp - strh r0, [r1, 0x2E] - movs r6, 0 - add r0, sp, 0x24 - mov r9, r0 - movs r1, 0x3B - add r1, sp - mov r10, r1 - mov r2, sp - adds r2, 0x2B - str r2, [sp, 0x80] - mov r0, sp - adds r0, 0x2A - str r0, [sp, 0x7C] - mov r1, sp - adds r1, 0x68 - str r1, [sp, 0x8C] - adds r2, 0x5 - str r2, [sp, 0x84] - adds r0, 0x12 - str r0, [sp, 0x88] - mov r8, r4 - add r4, sp, 0xC -_08187414: - adds r1, r6, 0 - adds r1, 0xD - mov r0, r8 - bl GetMonData - strh r0, [r4] - adds r1, r6, 0 - adds r1, 0x11 - mov r0, r8 - bl GetMonData - mov r2, r9 - adds r1, r2, r6 - strb r0, [r1] - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x3 - ble _08187414 - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =gEnemyParty - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x15 - bl GetMonData - mov r1, r10 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x20 - bl GetMonData - ldr r2, [sp, 0x80] - strb r0, [r2] - adds r0, r4, 0 - movs r1, 0x19 - bl GetMonData - str r0, [sp, 0x44] - adds r0, r4, 0 - movs r1, 0x27 - bl GetMonData - mov r3, sp - movs r5, 0x1F - ands r0, r5 - ldrb r2, [r3, 0x14] - movs r1, 0x20 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x14] - adds r0, r4, 0 - movs r1, 0x28 - bl GetMonData - mov r3, sp - movs r6, 0x1F - ands r0, r6 - lsls r0, 5 - ldrh r2, [r3, 0x14] - ldr r1, =0xfffffc1f - ands r1, r2 - orrs r1, r0 - strh r1, [r3, 0x14] - adds r0, r4, 0 - movs r1, 0x29 - bl GetMonData - mov r3, sp - ands r0, r5 - lsls r0, 2 - ldrb r2, [r3, 0x15] - movs r1, 0x7D - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x15] - adds r0, r4, 0 - movs r1, 0x2A - bl GetMonData - movs r1, 0x1F - ands r1, r0 - lsls r1, 15 - ldr r0, [sp, 0x14] - ldr r2, =0xfff07fff - ands r0, r2 - orrs r0, r1 - str r0, [sp, 0x14] - adds r0, r4, 0 - movs r1, 0x2B - bl GetMonData - mov r3, sp - ands r0, r6 - lsls r0, 4 - ldrh r2, [r3, 0x16] - ldr r1, =0xfffffe0f - ands r1, r2 - orrs r1, r0 - strh r1, [r3, 0x16] - adds r0, r4, 0 - movs r1, 0x2C - bl GetMonData - mov r3, sp - ands r0, r5 - lsls r0, 1 - ldrb r2, [r3, 0x17] - movs r1, 0x3F - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x17] - adds r0, r4, 0 - movs r1, 0 - bl GetMonData - str r0, [sp, 0x48] - adds r0, r4, 0 - movs r1, 0x37 - bl GetMonData - str r0, [sp, 0x4C] - adds r0, r4, 0 - movs r1, 0x38 - bl GetMonData - ldr r1, [sp, 0x7C] - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x39 - bl GetMonData - mov r1, sp - strh r0, [r1, 0x28] - adds r0, r4, 0 - movs r1, 0x3A - bl GetMonData - mov r1, sp - strh r0, [r1, 0x2C] - adds r0, r4, 0 - movs r1, 0x3B - bl GetMonData - mov r1, sp - strh r0, [r1, 0x2] - adds r0, r4, 0 - movs r1, 0x3C - bl GetMonData - mov r1, sp - strh r0, [r1, 0x4] - adds r0, r4, 0 - movs r1, 0x3D - bl GetMonData - mov r1, sp - strh r0, [r1, 0x6] - adds r0, r4, 0 - movs r1, 0x3E - bl GetMonData - mov r1, sp - strh r0, [r1, 0x8] - adds r0, r4, 0 - movs r1, 0x3F - bl GetMonData - mov r1, sp - strh r0, [r1, 0xA] - adds r0, r4, 0 - movs r1, 0x2D - bl GetMonData - mov r3, sp - movs r1, 0x1 - ands r0, r1 - lsls r0, 6 - ldrb r2, [r3, 0x17] - movs r1, 0x41 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x17] - adds r0, r4, 0 - movs r1, 0x2E - bl GetMonData - mov r3, sp - lsls r0, 7 - ldrb r2, [r3, 0x17] - movs r1, 0x7F - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x17] - adds r0, r4, 0 - movs r1, 0x1 - bl GetMonData - str r0, [sp, 0x54] - adds r0, r4, 0 - movs r1, 0x2 - ldr r2, [sp, 0x8C] - bl GetMonData - ldr r0, [sp, 0x84] - ldr r1, [sp, 0x8C] - bl StringCopy10 - adds r0, r4, 0 - movs r1, 0x7 - ldr r2, [sp, 0x88] - bl GetMonData - mov r2, sp - movs r6, 0 -_081875CC: - adds r0, r7, r6 - adds r1, r2, r6 - ldrb r1, [r1] - strb r1, [r0] - adds r6, 0x1 - cmp r6, 0x57 - bls _081875CC - b _08187A2E - .pool -_081875EC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0xB - b _08187966 - .pool -_081875FC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0xC - b _08187966 - .pool -_0818760C: - movs r6, 0 - add r2, sp, 0x58 - mov r9, r2 - add r0, sp, 0x60 - mov r10, r0 - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =gEnemyParty - adds r4, r1, r0 - mov r8, r9 -_08187622: - adds r1, r6, 0 - adds r1, 0xD - adds r0, r4, 0 - bl GetMonData - mov r1, r8 - strh r0, [r1] - adds r1, r6, 0 - adds r1, 0x11 - adds r0, r4, 0 - bl GetMonData - mov r2, r10 - adds r1, r2, r6 - strb r0, [r1] - movs r0, 0x2 - add r8, r0 - adds r6, 0x1 - cmp r6, 0x3 - ble _08187622 - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x15 - bl GetMonData - mov r1, r9 - strb r0, [r1, 0xC] - mov r2, r9 - movs r6, 0 -_08187660: - adds r0, r7, r6 - adds r1, r2, r6 - ldrb r1, [r1] - strb r1, [r0] - adds r6, 0x1 - cmp r6, 0xF - bls _08187660 - b _08187A2E - .pool -_08187674: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r1, [r3] - lsls r1, 9 - adds r2, 0x1 - adds r1, r2 - ldrb r1, [r1] - adds r1, 0x9 - b _08187966 - .pool -_08187690: - movs r6, 0 - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r2, =gEnemyParty - mov r8, r2 -_0818769C: - adds r1, r6, 0 - adds r1, 0x11 - mov r2, r8 - adds r0, r4, r2 - bl GetMonData - adds r1, r7, r6 - strb r0, [r1] - adds r6, 0x1 - cmp r6, 0x3 - ble _0818769C - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x15 - bl GetMonData - adds r1, r7, r6 - strb r0, [r1] - adds r6, 0x1 - b _08187A2E - .pool -_081876CC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r1, [r3] - lsls r1, 9 - adds r2, 0x1 - adds r1, r2 - ldrb r1, [r1] - adds r1, 0x8 - b _08187A26 - .pool -_081876E8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x1 - b _08187702 - .pool -_081876F8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x19 -_08187702: - bl GetMonData - adds r1, r0, 0 - strb r1, [r7] - movs r0, 0xFF - lsls r0, 8 - ands r0, r1 - lsrs r0, 8 - strb r0, [r7, 0x1] - movs r0, 0xFF - lsls r0, 16 - ands r0, r1 - lsrs r0, 16 - strb r0, [r7, 0x2] - movs r6, 0x3 - b _08187A2E - .pool -_08187728: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x1A - b _08187A26 - .pool -_08187738: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x1B - b _08187A26 - .pool -_08187748: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x1C - b _08187A26 - .pool -_08187758: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x1D - b _08187A26 - .pool -_08187768: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x1E - b _08187A26 - .pool -_08187778: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x1F - b _08187A26 - .pool -_08187788: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x20 - b _08187A26 - .pool -_08187798: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x22 - b _08187A26 - .pool -_081877A8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x23 - b _08187A26 - .pool -_081877B8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x24 - b _08187A26 - .pool -_081877C8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x25 - b _08187A26 - .pool -_081877D8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x26 - b _08187A26 - .pool -_081877E8: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =gEnemyParty - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x27 - bl GetMonData - strb r0, [r7] - adds r0, r4, 0 - movs r1, 0x28 - bl GetMonData - strb r0, [r7, 0x1] - adds r0, r4, 0 - movs r1, 0x29 - bl GetMonData - strb r0, [r7, 0x2] - adds r0, r4, 0 - movs r1, 0x2A - bl GetMonData - strb r0, [r7, 0x3] - adds r0, r4, 0 - movs r1, 0x2B - bl GetMonData - strb r0, [r7, 0x4] - adds r0, r4, 0 - movs r1, 0x2C - bl GetMonData - strb r0, [r7, 0x5] - movs r6, 0x6 - b _08187A2E - .pool -_08187838: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x27 - b _08187A26 - .pool -_08187848: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x28 - b _08187A26 - .pool -_08187858: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x29 - b _08187A26 - .pool -_08187868: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x2A - b _08187A26 - .pool -_08187878: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x2B - b _08187A26 - .pool -_08187888: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x2C - b _08187A26 - .pool -_08187898: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0 - b _081878C2 - .pool -_081878A8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x9 - b _08187966 - .pool -_081878B8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x37 -_081878C2: - bl GetMonData - adds r1, r0, 0 - strb r1, [r7] - movs r0, 0xFF - lsls r0, 8 - ands r0, r1 - lsrs r0, 8 - strb r0, [r7, 0x1] - movs r0, 0xFF - lsls r0, 16 - ands r0, r1 - lsrs r0, 16 - strb r0, [r7, 0x2] - lsrs r0, r1, 24 - strb r0, [r7, 0x3] - movs r6, 0x4 - b _08187A2E - .pool -_081878EC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x38 - b _08187A26 - .pool -_081878FC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x39 - b _08187966 - .pool -_0818790C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x3A - b _08187966 - .pool -_0818791C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x3B - b _08187966 - .pool -_0818792C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x3C - b _08187966 - .pool -_0818793C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x3D - b _08187966 - .pool -_0818794C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x3E - b _08187966 - .pool -_0818795C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x3F -_08187966: - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - strb r0, [r7] - lsrs r0, 8 - strb r0, [r7, 0x1] - movs r6, 0x2 - b _08187A2E - .pool -_0818797C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x16 - b _08187A26 - .pool -_0818798C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x17 - b _08187A26 - .pool -_0818799C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x18 - b _08187A26 - .pool -_081879AC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x21 - b _08187A26 - .pool -_081879BC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x2F - b _08187A26 - .pool -_081879CC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x30 - b _08187A26 - .pool -_081879DC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x32 - b _08187A26 - .pool -_081879EC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x33 - b _08187A26 - .pool -_081879FC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x34 - b _08187A26 - .pool -_08187A0C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x35 - b _08187A26 - .pool -_08187A1C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x36 -_08187A26: - bl GetMonData - strb r0, [r7] - movs r6, 0x1 -_08187A2E: - adds r0, r6, 0 - add sp, 0x90 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8187298 - - thumb_func_start sub_8187A44 -sub_8187A44: @ 8187A44 - push {lr} - bl sub_81871AC - pop {r0} - bx r0 - thumb_func_end sub_8187A44 - - thumb_func_start sub_8187A50 -sub_8187A50: @ 8187A50 - push {r4,r5,lr} - ldr r1, =gBattleBufferA - ldr r0, =gActiveBank - ldrb r2, [r0] - lsls r0, r2, 9 - adds r1, 0x2 - adds r1, r0, r1 - ldrb r0, [r1] - cmp r0, 0 - bne _08187A80 - ldr r0, =gBattlePartyID - lsls r1, r2, 1 - adds r1, r0 - ldrb r0, [r1] - bl dp01_setattr_for_opponent_pokemon - b _08187A9E - .pool -_08187A80: - ldrb r4, [r1] - movs r5, 0 -_08187A84: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _08187A92 - adds r0, r5, 0 - bl dp01_setattr_for_opponent_pokemon -_08187A92: - lsrs r4, 1 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x5 - bls _08187A84 -_08187A9E: - bl sub_81871AC - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8187A50 - - thumb_func_start dp01_setattr_for_opponent_pokemon -dp01_setattr_for_opponent_pokemon: @ 8187AA8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x38 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r3, =gActiveBank - ldrb r0, [r3] - lsls r0, 9 - ldr r2, =gUnknown_02023067 - adds r4, r0, r2 - adds r7, r4, 0 - subs r1, r2, 0x2 - adds r0, r1 - ldrb r0, [r0] - adds r6, r3, 0 - adds r3, r2, 0 - cmp r0, 0x3B - bls _08187AD6 - bl _081883B4 -_08187AD6: - lsls r0, 2 - ldr r1, =_08187AEC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08187AEC: - .4byte _08187BDC - .4byte _08187D74 - .4byte _08187D90 - .4byte _08187DAC - .4byte _08187E00 - .4byte _08187E00 - .4byte _08187E00 - .4byte _08187E00 - .4byte _08187E20 - .4byte _08187E88 - .4byte _08187E88 - .4byte _08187E88 - .4byte _08187E88 - .4byte _081883B4 - .4byte _081883B4 - .4byte _081883B4 - .4byte _081883B4 - .4byte _08187EB0 - .4byte _08187ECC - .4byte _08187EE8 - .4byte _08187F04 - .4byte _08187F20 - .4byte _08187F3C - .4byte _08187F58 - .4byte _08187F74 - .4byte _08187F90 - .4byte _08187FAC - .4byte _08187FC8 - .4byte _08187FE4 - .4byte _08188000 - .4byte _0818801C - .4byte _08188038 - .4byte _081880AC - .4byte _081880C8 - .4byte _081880E4 - .4byte _08188100 - .4byte _0818811C - .4byte _08188138 - .4byte _08188154 - .4byte _08188170 - .4byte _0818818C - .4byte _081881A8 - .4byte _081881C4 - .4byte _081881E0 - .4byte _081881FC - .4byte _08188218 - .4byte _08188234 - .4byte _08188250 - .4byte _0818826C - .4byte _08188288 - .4byte _081882A4 - .4byte _081882C0 - .4byte _081882DC - .4byte _081882F8 - .4byte _08188314 - .4byte _08188330 - .4byte _0818834C - .4byte _08188368 - .4byte _08188384 - .4byte _081883A0 -_08187BDC: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =gEnemyParty - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xB - adds r2, r7, 0 - bl SetMonData - adds r2, r7, 0 - adds r2, 0x2E - adds r0, r4, 0 - movs r1, 0xC - bl SetMonData - movs r0, 0 - mov r8, r0 - movs r0, 0x3B - adds r0, r7 - mov r10, r0 - adds r0, r7, 0 - adds r0, 0x2B - str r0, [sp, 0x20] - adds r0, 0x19 - str r0, [sp, 0x28] - adds r0, 0x4 - str r0, [sp, 0x2C] - adds r0, 0x4 - str r0, [sp, 0x30] - subs r0, 0x22 - str r0, [sp, 0x1C] - subs r0, 0x2 - str r0, [sp, 0x18] - adds r0, 0x4 - str r0, [sp, 0x24] - adds r0, r7, 0x2 - str r0, [sp, 0x4] - adds r0, r7, 0x4 - str r0, [sp, 0x8] - adds r0, r7, 0x6 - str r0, [sp, 0xC] - adds r0, 0x2 - str r0, [sp, 0x10] - adds r0, 0x2 - str r0, [sp, 0x14] - mov r9, r4 - adds r6, r7, 0 - adds r6, 0x24 - adds r4, r7, 0 - adds r4, 0xC -_08187C42: - mov r1, r8 - adds r1, 0xD - mov r0, r9 - adds r2, r4, 0 - bl SetMonData - mov r1, r8 - adds r1, 0x11 - mov r0, r9 - adds r2, r6, 0 - bl SetMonData - adds r6, 0x1 - adds r4, 0x2 - movs r0, 0x1 - add r8, r0 - mov r0, r8 - cmp r0, 0x3 - ble _08187C42 - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =gEnemyParty - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x15 - mov r2, r10 - bl SetMonData - adds r0, r4, 0 - movs r1, 0x20 - ldr r2, [sp, 0x20] - bl SetMonData - adds r0, r4, 0 - movs r1, 0x19 - ldr r2, [sp, 0x28] - bl SetMonData - ldrb r0, [r7, 0x14] - lsls r0, 27 - lsrs r0, 27 - mov r1, sp - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x27 - mov r2, sp - bl SetMonData - mov r1, sp - ldrh r0, [r7, 0x14] - lsls r0, 22 - lsrs r0, 27 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x28 - mov r2, sp - bl SetMonData - mov r1, sp - ldrb r0, [r7, 0x15] - lsls r0, 25 - lsrs r0, 27 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x29 - mov r2, sp - bl SetMonData - mov r1, sp - ldr r0, [r7, 0x14] - lsls r0, 12 - lsrs r0, 27 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x2A - mov r2, sp - bl SetMonData - mov r1, sp - ldrh r0, [r7, 0x16] - lsls r0, 23 - lsrs r0, 27 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x2B - mov r2, sp - bl SetMonData - mov r1, sp - ldrb r0, [r7, 0x17] - lsls r0, 26 - lsrs r0, 27 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x2C - mov r2, sp - bl SetMonData - adds r0, r4, 0 - movs r1, 0 - ldr r2, [sp, 0x2C] - bl SetMonData - adds r0, r4, 0 - movs r1, 0x37 - ldr r2, [sp, 0x30] - bl SetMonData - adds r0, r4, 0 - movs r1, 0x38 - ldr r2, [sp, 0x1C] - bl SetMonData - adds r0, r4, 0 - movs r1, 0x39 - ldr r2, [sp, 0x18] - bl SetMonData - adds r0, r4, 0 - movs r1, 0x3A - ldr r2, [sp, 0x24] - bl SetMonData - adds r0, r4, 0 - movs r1, 0x3B - ldr r2, [sp, 0x4] - bl SetMonData - adds r0, r4, 0 - movs r1, 0x3C - ldr r2, [sp, 0x8] - bl SetMonData - adds r0, r4, 0 - movs r1, 0x3D - ldr r2, [sp, 0xC] - bl SetMonData - adds r0, r4, 0 - movs r1, 0x3E - ldr r2, [sp, 0x10] - bl SetMonData - adds r0, r4, 0 - movs r1, 0x3F - ldr r2, [sp, 0x14] - bl SetMonData - b _081883B4 - .pool -_08187D74: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0xB - bl SetMonData - b _081883B4 - .pool -_08187D90: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0xC - bl SetMonData - b _081883B4 - .pool -_08187DAC: - movs r0, 0 - mov r8, r0 - movs r0, 0xC - adds r0, r4 - mov r9, r0 - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =gEnemyParty - adds r7, r1, r0 - adds r6, r4, 0 - adds r6, 0x8 -_08187DC4: - mov r1, r8 - adds r1, 0xD - adds r0, r7, 0 - adds r2, r4, 0 - bl SetMonData - mov r1, r8 - adds r1, 0x11 - adds r0, r7, 0 - adds r2, r6, 0 - bl SetMonData - adds r6, 0x1 - adds r4, 0x2 - movs r0, 0x1 - add r8, r0 - mov r0, r8 - cmp r0, 0x3 - ble _08187DC4 - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x15 - mov r2, r9 - bl SetMonData - b _081883B4 - .pool -_08187E00: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldr r3, =gBattleBufferA - ldrb r2, [r6] - lsls r2, 9 - adds r1, r3, 0x1 - adds r1, r2, r1 - ldrb r1, [r1] - adds r1, 0x9 - b _08187E9E - .pool -_08187E20: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =gEnemyParty - adds r4, r0 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - adds r0, r4, 0 - movs r1, 0x11 - str r3, [sp, 0x34] - bl SetMonData - ldrb r2, [r6] - lsls r2, 9 - ldr r3, [sp, 0x34] - adds r0, r3, 0x1 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x12 - bl SetMonData - ldrb r2, [r6] - lsls r2, 9 - ldr r3, [sp, 0x34] - adds r0, r3, 0x2 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x13 - bl SetMonData - ldrb r2, [r6] - lsls r2, 9 - ldr r3, [sp, 0x34] - adds r0, r3, 0x3 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x14 - bl SetMonData - ldrb r2, [r6] - lsls r2, 9 - ldr r3, [sp, 0x34] - adds r0, r3, 0x4 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x15 - bl SetMonData - b _081883B4 - .pool -_08187E88: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldr r3, =gBattleBufferA - ldrb r2, [r6] - lsls r2, 9 - adds r1, r3, 0x1 - adds r1, r2, r1 - ldrb r1, [r1] - adds r1, 0x8 -_08187E9E: - adds r3, 0x3 - adds r2, r3 - bl SetMonData - b _081883B4 - .pool -_08187EB0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1 - bl SetMonData - b _081883B4 - .pool -_08187ECC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x19 - bl SetMonData - b _081883B4 - .pool -_08187EE8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1A - bl SetMonData - b _081883B4 - .pool -_08187F04: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1B - bl SetMonData - b _081883B4 - .pool -_08187F20: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1C - bl SetMonData - b _081883B4 - .pool -_08187F3C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1D - bl SetMonData - b _081883B4 - .pool -_08187F58: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1E - bl SetMonData - b _081883B4 - .pool -_08187F74: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1F - bl SetMonData - b _081883B4 - .pool -_08187F90: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x20 - bl SetMonData - b _081883B4 - .pool -_08187FAC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x22 - bl SetMonData - b _081883B4 - .pool -_08187FC8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x23 - bl SetMonData - b _081883B4 - .pool -_08187FE4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x24 - bl SetMonData - b _081883B4 - .pool -_08188000: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x25 - bl SetMonData - b _081883B4 - .pool -_0818801C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x26 - bl SetMonData - b _081883B4 - .pool -_08188038: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =gEnemyParty - adds r4, r0 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - adds r0, r4, 0 - movs r1, 0x27 - str r3, [sp, 0x34] - bl SetMonData - ldrb r2, [r6] - lsls r2, 9 - ldr r3, [sp, 0x34] - adds r0, r3, 0x1 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x28 - bl SetMonData - ldrb r2, [r6] - lsls r2, 9 - ldr r3, [sp, 0x34] - adds r0, r3, 0x2 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x29 - bl SetMonData - ldrb r2, [r6] - lsls r2, 9 - ldr r3, [sp, 0x34] - adds r0, r3, 0x3 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x2A - bl SetMonData - ldrb r2, [r6] - lsls r2, 9 - ldr r3, [sp, 0x34] - adds r0, r3, 0x4 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x2B - bl SetMonData - ldrb r2, [r6] - lsls r2, 9 - ldr r3, [sp, 0x34] - adds r0, r3, 0x5 - adds r2, r0 - adds r0, r4, 0 - b _08188146 - .pool -_081880AC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x27 - bl SetMonData - b _081883B4 - .pool -_081880C8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x28 - bl SetMonData - b _081883B4 - .pool -_081880E4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x29 - bl SetMonData - b _081883B4 - .pool -_08188100: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x2A - bl SetMonData - b _081883B4 - .pool -_0818811C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x2B - bl SetMonData - b _081883B4 - .pool -_08188138: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 -_08188146: - movs r1, 0x2C - bl SetMonData - b _081883B4 - .pool -_08188154: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0 - bl SetMonData - b _081883B4 - .pool -_08188170: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x9 - bl SetMonData - b _081883B4 - .pool -_0818818C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x37 - bl SetMonData - b _081883B4 - .pool -_081881A8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x38 - bl SetMonData - b _081883B4 - .pool -_081881C4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x39 - bl SetMonData - b _081883B4 - .pool -_081881E0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x3A - bl SetMonData - b _081883B4 - .pool -_081881FC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x3B - bl SetMonData - b _081883B4 - .pool -_08188218: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x3C - bl SetMonData - b _081883B4 - .pool -_08188234: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x3D - bl SetMonData - b _081883B4 - .pool -_08188250: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x3E - bl SetMonData - b _081883B4 - .pool -_0818826C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x3F - bl SetMonData - b _081883B4 - .pool -_08188288: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x16 - bl SetMonData - b _081883B4 - .pool -_081882A4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x17 - bl SetMonData - b _081883B4 - .pool -_081882C0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x18 - bl SetMonData - b _081883B4 - .pool -_081882DC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x21 - bl SetMonData - b _081883B4 - .pool -_081882F8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x2F - bl SetMonData - b _081883B4 - .pool -_08188314: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x30 - bl SetMonData - b _081883B4 - .pool -_08188330: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x32 - bl SetMonData - b _081883B4 - .pool -_0818834C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x33 - bl SetMonData - b _081883B4 - .pool -_08188368: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x34 - bl SetMonData - b _081883B4 - .pool -_08188384: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x35 - bl SetMonData - b _081883B4 - .pool -_081883A0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x36 - bl SetMonData -_081883B4: - add sp, 0x38 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_setattr_for_opponent_pokemon - - thumb_func_start sub_81883C8 -sub_81883C8: @ 81883C8 - push {r4-r7,lr} - ldr r1, =gBattlePartyID - ldr r7, =gActiveBank - ldrb r2, [r7] - lsls r0, r2, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - adds r3, r1, 0 - muls r3, r0 - ldr r4, =gBattleBufferA - lsls r2, 9 - adds r0, r4, 0x1 - adds r0, r2, r0 - ldrb r0, [r0] - ldr r1, =gEnemyParty - adds r0, r1 - adds r5, r3, r0 - movs r3, 0 - adds r0, r4, 0x2 - adds r2, r0 - ldrb r2, [r2] - cmp r3, r2 - bcs _08188420 - adds r6, r4, 0 - adds r2, r7, 0 - adds r4, r0, 0 -_081883FE: - adds r1, r5, r3 - ldrb r0, [r2] - lsls r0, 9 - adds r0, 0x3 - adds r0, r3, r0 - adds r0, r6 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - ldrb r0, [r2] - lsls r0, 9 - adds r0, r4 - ldrb r0, [r0] - cmp r3, r0 - bcc _081883FE -_08188420: - bl sub_81871AC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81883C8 - - thumb_func_start sub_818843C -sub_818843C: @ 818843C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r7, =gBattlePartyID - ldr r6, =gActiveBank - ldrb r0, [r6] - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - movs r1, 0x64 - mov r10, r1 - mov r2, r10 - muls r2, r0 - adds r0, r2, 0 - ldr r1, =gEnemyParty - mov r9, r1 - add r0, r9 - movs r1, 0xB - bl GetMonData - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldrb r1, [r6] - lsls r0, r1, 1 - adds r0, r7 - ldrh r0, [r0] - mov r2, r10 - muls r2, r0 - adds r0, r2, 0 - add r0, r9 - bl sub_805DC0C - ldrb r0, [r6] - bl GetBankIdentity - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_806A068 - ldr r0, =gUnknown_0202499C - mov r8, r0 - ldrb r0, [r6] - movs r1, 0x2 - bl sub_80A5C6C - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldrb r0, [r6] - bl sub_80A6138 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldrb r0, [r6] - bl sub_80A82E4 - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - mov r0, r8 - adds r1, r5, 0 - adds r2, r4, 0 - bl CreateSprite - ldr r4, =gBankSpriteIds - ldrb r1, [r6] - adds r1, r4 - strb r0, [r1] - ldr r5, =gSprites - ldrb r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =0x0000ff10 - strh r1, [r0, 0x24] - ldrb r2, [r6] - adds r0, r2, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r2, [r0, 0x2E] - ldrb r3, [r6] - adds r0, r3, r4 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - lsls r3, 4 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r3 - strb r0, [r1, 0x5] - ldrb r2, [r6] - adds r4, r2, r4 - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =gUnknown_020244E4 - adds r2, r1 - ldrb r1, [r2] - bl StartSpriteAnim - ldrb r4, [r6] - lsls r0, r4, 1 - adds r0, r7 - ldrh r0, [r0] - mov r1, r10 - muls r1, r0 - adds r0, r1, 0 - add r0, r9 - movs r1, 0xB - bl GetMonData - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl sub_805EE54 - ldr r1, =gBattleBankFunc - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8186C48 - str r1, [r0] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818843C - - thumb_func_start sub_818858C -sub_818858C: @ 818858C - push {r4,lr} - ldr r1, =gBattlePartyID - ldr r4, =gActiveBank - ldrb r0, [r4] - lsls r2, r0, 1 - adds r2, r1 - ldr r3, =gBattleBufferA - lsls r0, 9 - adds r1, r3, 0x1 - adds r0, r1 - ldrb r0, [r0] - strh r0, [r2] - ldrb r0, [r4] - lsls r1, r0, 9 - adds r3, 0x2 - adds r1, r3 - ldrb r1, [r1] - bl sub_81885D8 - ldr r1, =gBattleBankFunc - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8187084 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818858C - - thumb_func_start sub_81885D8 -sub_81885D8: @ 81885D8 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - lsls r1, 24 - lsrs r1, 24 - adds r0, r6, 0 - bl sub_805EF84 - ldr r0, =gBattlePartyID - lsls r4, r6, 1 - adds r4, r0 - ldr r0, =gBattleBufferA - lsls r1, r6, 9 - adds r0, 0x1 - adds r1, r0 - ldrb r0, [r1] - strh r0, [r4] - ldrh r0, [r4] - movs r1, 0x64 - mov r9, r1 - mov r1, r9 - muls r1, r0 - adds r0, r1, 0 - ldr r5, =gEnemyParty - adds r0, r5 - movs r1, 0xB - bl GetMonData - mov r8, r0 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - ldr r0, =sub_805D714 - bl CreateInvisibleSpriteWithCallback - ldr r1, =gUnknown_03005D7C - mov r10, r1 - add r10, r6 - mov r1, r10 - strb r0, [r1] - ldrh r0, [r4] - mov r1, r9 - muls r1, r0 - adds r0, r1, 0 - adds r0, r5 - adds r1, r6, 0 - bl sub_805DC0C - adds r0, r6, 0 - bl GetBankIdentity - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, r8 - bl sub_806A068 - ldr r0, =gUnknown_0202499C - mov r9, r0 - adds r0, r6, 0 - movs r1, 0x2 - bl sub_80A5C6C - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - adds r0, r6, 0 - bl sub_80A6138 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r6, 0 - bl sub_80A82E4 - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - mov r0, r9 - adds r1, r5, 0 - adds r2, r4, 0 - bl CreateSprite - ldr r4, =gBankSpriteIds - adds r4, r6, r4 - strb r0, [r4] - ldr r5, =gSprites - mov r0, r10 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrb r1, [r4] - strh r1, [r0, 0x30] - mov r0, r10 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r6, [r0, 0x32] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r6, [r0, 0x2E] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - mov r1, r8 - strh r1, [r0, 0x32] - ldrb r0, [r4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - lsls r3, r6, 4 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r3 - strb r0, [r1, 0x5] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =gUnknown_020244E4 - adds r6, r1 - ldrb r1, [r6] - bl StartSpriteAnim - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r5, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =SpriteCallbackDummy - str r1, [r0] - movs r0, 0 - movs r1, 0xFE - bl sub_80753E8 - mov r1, r10 - ldrb r2, [r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r5 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r1, 0x2E] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81885D8 - - thumb_func_start sub_8188768 -sub_8188768: @ 8188768 - push {r4-r6,lr} - ldr r1, =gBattleBufferA - ldr r6, =gActiveBank - ldrb r2, [r6] - lsls r0, r2, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r3, [r0] - cmp r3, 0 - bne _081887B0 - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - strb r3, [r0, 0x4] - ldr r1, =gBattleBankFunc - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8188800 - str r1, [r0] - b _081887EC - .pool -_081887B0: - ldr r5, =gBankSpriteIds - adds r0, r2, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =gSprites - adds r0, r4 - bl FreeSpriteOamMatrix - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl DestroySprite - ldrb r0, [r6] - bl sub_805EEE0 - ldr r1, =gUnknown_03005D70 - ldrb r0, [r6] - adds r0, r1 - ldrb r0, [r0] - bl sub_8072984 - bl sub_81871AC -_081887EC: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8188768 - - thumb_func_start sub_8188800 -sub_8188800: @ 8188800 - push {r4-r6,lr} - ldr r6, =gUnknown_020244D0 - ldr r4, [r6] - ldr r5, =gActiveBank - ldrb r2, [r5] - ldr r1, [r4, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r3, r0, r1 - ldrb r0, [r3, 0x4] - cmp r0, 0 - beq _08188828 - cmp r0, 0x1 - beq _08188856 - b _0818887E - .pool -_08188828: - ldr r1, [r4] - lsls r0, r2, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08188842 - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x5 - bl move_anim_start_t4 -_08188842: - ldr r0, [r6] - ldrb r1, [r5] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x1 - strb r1, [r0, 0x4] - b _0818887E -_08188856: - ldrb r1, [r3] - movs r0, 0x40 - ands r0, r1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _0818887E - strb r0, [r3, 0x4] - ldrb r2, [r5] - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x2 - bl move_anim_start_t4 - ldr r1, =gBattleBankFunc - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8186D9C - str r1, [r0] -_0818887E: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8188800 - - thumb_func_start sub_818888C -sub_818888C: @ 818888C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r5, =gBattleTypeFlags - ldr r0, [r5] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081888F6 - ldr r4, =gActiveBank - ldrb r0, [r4] - bl GetBankIdentity - movs r1, 0x2 - ands r1, r0 - movs r7, 0xC8 - cmp r1, 0 - beq _081888B4 - movs r7, 0x98 -_081888B4: - ldr r0, [r5] - movs r1, 0x80 - lsls r1, 1 - ands r0, r1 - cmp r0, 0 - beq _081888EC - ldrb r0, [r4] - cmp r0, 0x1 - bne _081888D8 - ldr r0, =gUnknown_02038BCA - b _081888DA - .pool -_081888D8: - ldr r0, =gUnknown_02038BCC -_081888DA: - ldrh r0, [r0] - bl sub_8162AA0 - lsls r0, 24 - lsrs r0, 24 - b _0818892C - .pool -_081888EC: - bl sub_8185F40 - lsls r0, 24 - lsrs r0, 24 - b _08188924 -_081888F6: - movs r7, 0xB0 - ldr r0, =gUnknown_02038BCA - ldrh r1, [r0] - movs r0, 0xC0 - lsls r0, 4 - cmp r1, r0 - bne _08188910 - bl sub_8068B48 - b _08188928 - .pool -_08188910: - ldr r2, =gUnknown_020229E8 - ldr r0, =gUnknown_0203C7B4 - ldrb r0, [r0] - movs r1, 0x1 - eors r1, r0 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x13] -_08188924: - bl sub_806F000 -_08188928: - lsls r0, 16 - lsrs r0, 16 -_0818892C: - mov r8, r0 - ldr r5, =gActiveBank - ldrb r1, [r5] - bl sub_805DF38 - ldrb r0, [r5] - bl GetBankIdentity - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, r8 - bl template_build_for_pokemon_or_trainer - ldr r6, =gUnknown_0202499C - mov r9, r7 - ldr r1, =gUnknown_083054E0 - mov r2, r8 - lsls r0, r2, 2 - adds r0, r1 - ldrb r0, [r0] - movs r4, 0x8 - subs r4, r0 - lsls r4, 18 - movs r0, 0xA0 - lsls r0, 14 - adds r4, r0 - asrs r4, 16 - ldrb r0, [r5] - bl sub_80A82E4 - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - adds r0, r6, 0 - mov r1, r9 - adds r2, r4, 0 - bl CreateSprite - ldr r6, =gBankSpriteIds - ldrb r1, [r5] - adds r1, r6 - strb r0, [r1] - ldr r4, =gSprites - ldrb r0, [r5] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =0x0000ff10 - strh r1, [r0, 0x24] - ldrb r0, [r5] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x2 - strh r1, [r0, 0x2E] - ldr r1, =gTrainerFrontPicPaletteTable - mov r2, r8 - lsls r0, r2, 3 - adds r0, r1 - ldrh r0, [r0, 0x4] - bl IndexOfSpritePaletteTag - ldrb r1, [r5] - adds r1, r6 - ldrb r1, [r1] - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - adds r2, r4 - lsls r0, 4 - ldrb r3, [r2, 0x5] - movs r1, 0xF - ands r1, r3 - orrs r1, r0 - strb r1, [r2, 0x5] - ldrb r0, [r5] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - mov r1, r8 - strh r1, [r0, 0x6] - ldrb r0, [r5] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r4, 0x1C - adds r0, r4 - ldr r1, =sub_805D7AC - str r1, [r0] - ldr r1, =gBattleBankFunc - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8186558 - str r1, [r0] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818888C - - thumb_func_start sub_8188A40 -sub_8188A40: @ 8188A40 - push {lr} - bl sub_81871AC - pop {r0} - bx r0 - thumb_func_end sub_8188A40 - - thumb_func_start sub_8188A4C -sub_8188A4C: @ 8188A4C - push {r4-r6,lr} - ldr r6, =gBankSpriteIds - ldr r4, =gActiveBank - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r5, =gSprites - adds r0, r5 - bl oamt_add_pos2_onto_pos1 - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x23 - strh r1, [r0, 0x2E] - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x8C - lsls r1, 1 - strh r1, [r0, 0x32] - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrh r1, [r0, 0x22] - strh r1, [r0, 0x36] - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r5, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_80A6EEC - str r1, [r0] - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =SpriteCallbackDummy - bl oamt_set_x3A_32 - ldr r1, =gBattleBankFunc - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_81865C8 - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8188A4C - - thumb_func_start sub_8188AF8 -sub_8188AF8: @ 8188AF8 - push {r4-r6,lr} - ldr r6, =gUnknown_020244D0 - ldr r4, [r6] - ldr r5, =gActiveBank - ldrb r2, [r5] - ldr r0, [r4, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r3, r1, r0 - ldrb r0, [r3, 0x4] - cmp r0, 0 - bne _08188B4C - ldr r1, [r4] - lsls r0, r2, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08188B2C - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x5 - bl move_anim_start_t4 -_08188B2C: - ldr r0, [r6] - ldrb r1, [r5] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x4] - adds r1, 0x1 - strb r1, [r0, 0x4] - b _08188B88 - .pool -_08188B4C: - ldrb r1, [r3] - movs r0, 0x40 - ands r0, r1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08188B88 - strb r0, [r3, 0x4] - movs r0, 0x10 - movs r1, 0x3F - bl PlaySE12WithPanning - ldr r2, =gSprites - ldr r1, =gBankSpriteIds - ldrb r0, [r5] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_8039934 - str r1, [r0] - ldr r1, =gBattleBankFunc - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8186D58 - str r1, [r0] -_08188B88: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8188AF8 - - thumb_func_start sub_8188BA4 -sub_8188BA4: @ 8188BA4 - push {lr} - bl sub_81871AC - pop {r0} - bx r0 - thumb_func_end sub_8188BA4 - - thumb_func_start sub_8188BB0 -sub_8188BB0: @ 8188BB0 - push {lr} - bl sub_81871AC - pop {r0} - bx r0 - thumb_func_end sub_8188BB0 - - thumb_func_start sub_8188BBC -sub_8188BBC: @ 8188BBC - push {lr} - bl sub_81871AC - pop {r0} - bx r0 - thumb_func_end sub_8188BBC - - thumb_func_start sub_8188BC8 -sub_8188BC8: @ 8188BC8 - push {lr} - bl sub_81871AC - pop {r0} - bx r0 - thumb_func_end sub_8188BC8 - - thumb_func_start sub_8188BD4 -sub_8188BD4: @ 8188BD4 - push {r4-r6,lr} - ldr r6, =gActiveBank - ldrb r0, [r6] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - beq _08188BE6 - b _08188CFA -_08188BE6: - ldr r0, =gBattleBufferA - mov r12, r0 - ldrb r2, [r6] - lsls r2, 9 - adds r0, 0x1 - adds r0, r2, r0 - ldrb r0, [r0] - mov r1, r12 - adds r1, 0x2 - adds r1, r2, r1 - ldrb r1, [r1] - lsls r1, 8 - orrs r0, r1 - ldr r5, =gUnknown_02038432 - mov r1, r12 - adds r1, 0x3 - adds r2, r1 - ldrb r1, [r2] - strb r1, [r5] - ldr r4, =gUnknown_02038408 - ldrb r2, [r6] - lsls r2, 9 - mov r1, r12 - adds r1, 0x4 - adds r1, r2, r1 - ldrb r3, [r1] - mov r1, r12 - adds r1, 0x5 - adds r2, r1 - ldrb r1, [r2] - lsls r1, 8 - orrs r3, r1 - strh r3, [r4] - ldr r4, =gUnknown_02038404 - ldrb r2, [r6] - lsls r2, 9 - mov r1, r12 - adds r1, 0x6 - adds r1, r2, r1 - ldrb r3, [r1] - mov r1, r12 - adds r1, 0x7 - adds r1, r2, r1 - ldrb r1, [r1] - lsls r1, 8 - orrs r3, r1 - mov r1, r12 - adds r1, 0x8 - adds r1, r2, r1 - ldrb r1, [r1] - lsls r1, 16 - orrs r3, r1 - mov r1, r12 - adds r1, 0x9 - adds r2, r1 - ldrb r1, [r2] - lsls r1, 24 - orrs r3, r1 - str r3, [r4] - ldr r3, =gUnknown_0203841A - ldrb r1, [r6] - lsls r1, 9 - mov r2, r12 - adds r2, 0xA - adds r1, r2 - ldrb r1, [r1] - strb r1, [r3] - ldr r4, =gUnknown_0203841C - ldrb r2, [r6] - lsls r2, 9 - mov r1, r12 - adds r1, 0xC - adds r1, r2, r1 - ldrb r3, [r1] - mov r1, r12 - adds r1, 0xD - adds r2, r1 - ldrb r1, [r2] - lsls r1, 8 - orrs r3, r1 - strh r3, [r4] - ldr r3, =gUnknown_02038400 - ldrb r2, [r6] - lsls r2, 9 - mov r1, r12 - adds r1, 0x10 - adds r2, r1 - str r2, [r3] - ldr r3, =gUnknown_020244BC - ldrb r1, [r6] - lsls r1, 2 - adds r1, r3 - ldr r2, [r2] - str r2, [r1] - ldrb r1, [r5] - bl sub_805DB8C - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - beq _08188CDC - bl sub_81871AC - b _08188CFA - .pool -_08188CDC: - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldrb r1, [r6] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strb r3, [r0, 0x4] - ldr r1, =gBattleBankFunc - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8188D0C - str r1, [r0] -_08188CFA: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8188BD4 - - thumb_func_start sub_8188D0C -sub_8188D0C: @ 8188D0C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r2, =gBattleBufferA - ldr r6, =gActiveBank - ldrb r3, [r6] - lsls r1, r3, 9 - adds r0, r2, 0x1 - mov r10, r0 - adds r0, r1, r0 - ldrb r4, [r0] - adds r5, r2, 0x2 - mov r9, r5 - adds r0, r1, r5 - ldrb r0, [r0] - lsls r0, 8 - orrs r4, r0 - adds r2, 0xB - adds r1, r2 - ldrb r1, [r1] - mov r8, r1 - ldr r7, =gUnknown_020244D0 - ldr r5, [r7] - ldr r1, [r5, 0x4] - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r2, [r0, 0x4] - cmp r2, 0x1 - beq _08188DA4 - cmp r2, 0x1 - bgt _08188D64 - cmp r2, 0 - beq _08188D6E - b _08188E80 - .pool -_08188D64: - cmp r2, 0x2 - beq _08188DCE - cmp r2, 0x3 - beq _08188E44 - b _08188E80 -_08188D6E: - ldr r1, [r5] - lsls r0, r3, 2 - adds r1, r0, r1 - ldrb r2, [r1] - movs r0, 0xC - ands r0, r2 - cmp r0, 0x4 - bne _08188D90 - movs r0, 0x8 - orrs r0, r2 - strb r0, [r1] - ldrb r2, [r6] - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x5 - bl move_anim_start_t4 -_08188D90: - ldr r0, [r7] - ldrb r1, [r6] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x1 - strb r1, [r0, 0x4] - b _08188E80 -_08188DA4: - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _08188E80 - movs r0, 0 - bl sub_805EB9C - adds r0, r4, 0 - bl move_anim_start_t1 - ldr r0, [r7] - ldrb r1, [r6] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x2 - strb r1, [r0, 0x4] - b _08188E80 -_08188DCE: - ldr r0, =gUnknown_020383F8 - ldr r0, [r0] - bl _call_via_r0 - ldr r0, =gUnknown_020383FD - ldrb r0, [r0] - cmp r0, 0 - bne _08188E80 - movs r0, 0x1 - bl sub_805EB9C - ldr r0, [r7] - ldrb r2, [r6] - ldr r1, [r0] - lsls r0, r2, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08188E1C - mov r0, r8 - cmp r0, 0x1 - bhi _08188E1C - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x6 - bl move_anim_start_t4 - ldr r0, [r7] - ldrb r1, [r6] - ldr r0, [r0] - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - strb r0, [r1] -_08188E1C: - ldr r0, =gUnknown_020244D0 - ldr r2, [r0] - ldr r0, =gActiveBank - ldrb r1, [r0] - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x3 - strb r1, [r0, 0x4] - b _08188E80 - .pool -_08188E44: - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _08188E80 - bl sub_805E394 - ldrb r0, [r6] - lsls r2, r0, 9 - mov r3, r10 - adds r1, r2, r3 - ldrb r1, [r1] - add r2, r9 - ldrb r2, [r2] - lsls r2, 8 - orrs r1, r2 - bl sub_805E94C - ldr r0, [r7] - ldrb r1, [r6] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strb r4, [r0, 0x4] - bl sub_81871AC -_08188E80: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8188D0C - - thumb_func_start sub_8188E90 -sub_8188E90: @ 8188E90 - push {r4,lr} - ldr r0, =gUnknown_02022E14 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_02022E16 - strh r1, [r0] - ldr r4, =gActiveBank - ldrb r0, [r4] - lsls r0, 9 - ldr r1, =gUnknown_02023066 - adds r0, r1 - ldrh r0, [r0] - bl battle_pick_message - ldr r0, =gUnknown_02022E2C - movs r1, 0 - bl battle_show_message_maybe - ldr r1, =gBattleBankFunc - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8186E10 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8188E90 - - thumb_func_start sub_8188EE4 -sub_8188EE4: @ 8188EE4 - push {lr} - bl sub_81871AC - pop {r0} - bx r0 - thumb_func_end sub_8188EE4 - - thumb_func_start sub_8188EF0 -sub_8188EF0: @ 8188EF0 - push {lr} - ldr r0, =gActiveBank - ldrb r0, [r0] - bl sub_8185054 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0x1 - movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb - bl sub_81871AC - pop {r0} - bx r0 - .pool - thumb_func_end sub_8188EF0 - - thumb_func_start sub_8188F14 -sub_8188F14: @ 8188F14 - push {lr} - bl sub_81871AC - pop {r0} - bx r0 - thumb_func_end sub_8188F14 - - thumb_func_start sub_8188F20 -sub_8188F20: @ 8188F20 - push {r4,r5,lr} - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 10 - ands r0, r1 - cmp r0, 0 - beq _08188F48 - bl sub_805D19C - adds r2, r0, 0 - lsls r2, 16 - lsrs r2, 16 - movs r0, 0x1 - movs r1, 0xA - bl dp01_build_cmdbuf_x21_a_bb - b _08188F6C - .pool -_08188F48: - ldr r5, =gActiveBank - ldrb r0, [r5] - bl sub_8185054 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldrb r0, [r5] - bl sub_8185054 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 16 - orrs r2, r4 - movs r0, 0x1 - movs r1, 0xA - bl dp01_build_cmdbuf_x21_a_bb -_08188F6C: - bl sub_81871AC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8188F20 - - thumb_func_start sub_8188F7C -sub_8188F7C: @ 8188F7C - push {lr} - bl sub_81871AC - pop {r0} - bx r0 - thumb_func_end sub_8188F7C - - thumb_func_start sub_8188F88 -sub_8188F88: @ 8188F88 - push {r4,lr} - ldr r4, =gActiveBank - ldrb r0, [r4] - bl sub_8185054 - ldrb r1, [r4] - ldr r3, =gBattleStruct - ldr r2, [r3] - adds r1, r2 - adds r1, 0x5C - strb r0, [r1] - ldrb r0, [r4] - ldr r1, [r3] - adds r0, r1 - adds r0, 0x5C - ldrb r1, [r0] - movs r0, 0x1 - movs r2, 0 - bl dp01_build_cmdbuf_x22_a_three_bytes - bl sub_81871AC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8188F88 - - thumb_func_start sub_8188FC4 -sub_8188FC4: @ 8188FC4 - push {lr} - bl sub_81871AC - pop {r0} - bx r0 - thumb_func_end sub_8188FC4 - - thumb_func_start sub_8188FD0 -sub_8188FD0: @ 8188FD0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - movs r0, 0 - bl load_gfxc_health_bar - ldr r3, =gBattleBufferA - ldr r0, =gActiveBank - mov r9, r0 - ldrb r4, [r0] - lsls r2, r4, 9 - adds r0, r3, 0x2 - adds r0, r2, r0 - ldrb r1, [r0] - adds r3, 0x3 - adds r2, r3 - ldrb r0, [r2] - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - asrs r7, r1, 16 - ldr r0, =0x00007fff - cmp r7, r0 - beq _08189060 - ldr r6, =gBattlePartyID - lsls r0, r4, 1 - adds r0, r6 - ldrh r0, [r0] - movs r5, 0x64 - muls r0, r5 - ldr r4, =gEnemyParty - adds r0, r4 - movs r1, 0x3A - bl GetMonData - mov r8, r0 - mov r1, r9 - ldrb r0, [r1] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - muls r0, r5 - adds r0, r4 - movs r1, 0x39 - bl GetMonData - adds r3, r0, 0 - mov r1, r9 - ldrb r0, [r1] - ldr r1, =gUnknown_03005D70 - adds r1, r0, r1 - ldrb r1, [r1] - str r7, [sp] - mov r2, r8 - bl sub_807294C - b _0818908A - .pool -_08189060: - ldr r1, =gBattlePartyID - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x3A - bl GetMonData - adds r2, r0, 0 - mov r1, r9 - ldrb r0, [r1] - ldr r1, =gUnknown_03005D70 - adds r1, r0, r1 - ldrb r1, [r1] - str r7, [sp] - movs r3, 0 - bl sub_807294C -_0818908A: - ldr r1, =gBattleBankFunc - ldr r0, =gActiveBank - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8186D04 - str r1, [r0] - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8188FD0 - - thumb_func_start sub_81890C0 -sub_81890C0: @ 81890C0 - push {lr} - bl sub_81871AC - pop {r0} - bx r0 - thumb_func_end sub_81890C0 - - thumb_func_start sub_81890CC -sub_81890CC: @ 81890CC - push {r4,lr} - ldr r4, =gActiveBank - ldrb r0, [r4] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - bne _08189120 - ldr r0, =gUnknown_03005D70 - ldrb r1, [r4] - adds r0, r1, r0 - ldrb r0, [r0] - ldr r2, =gBattlePartyID - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =gEnemyParty - adds r1, r2 - movs r2, 0x9 - bl healthbar_draw_field_maybe - ldrb r2, [r4] - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x11 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r1, =gBattleBankFunc - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_818714C - str r1, [r0] -_08189120: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81890CC - - thumb_func_start sub_8189144 -sub_8189144: @ 8189144 - push {r4,r5,lr} - ldr r5, =gActiveBank - ldrb r0, [r5] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - bne _08189194 - ldr r4, =gBattleBufferA - ldrb r3, [r5] - lsls r3, 9 - adds r0, r4, 0x1 - adds r0, r3, r0 - ldrb r0, [r0] - adds r1, r4, 0x2 - adds r1, r3, r1 - ldrb r1, [r1] - adds r2, r4, 0x3 - adds r2, r3, r2 - ldrb r2, [r2] - lsls r2, 8 - orrs r1, r2 - adds r2, r4, 0x4 - adds r2, r3, r2 - ldrb r2, [r2] - lsls r2, 16 - orrs r1, r2 - adds r4, 0x5 - adds r3, r4 - ldrb r2, [r3] - lsls r2, 24 - orrs r1, r2 - bl move_anim_start_t2_for_situation - ldr r1, =gBattleBankFunc - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_818714C - str r1, [r0] -_08189194: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8189144 - - thumb_func_start sub_81891AC -sub_81891AC: @ 81891AC - push {lr} - bl sub_81871AC - pop {r0} - bx r0 - thumb_func_end sub_81891AC - - thumb_func_start sub_81891B8 -sub_81891B8: @ 81891B8 - push {lr} - bl sub_81871AC - pop {r0} - bx r0 - thumb_func_end sub_81891B8 - - thumb_func_start sub_81891C4 -sub_81891C4: @ 81891C4 - push {lr} - bl sub_81871AC - pop {r0} - bx r0 - thumb_func_end sub_81891C4 - - thumb_func_start sub_81891D0 -sub_81891D0: @ 81891D0 - push {lr} - bl sub_81871AC - pop {r0} - bx r0 - thumb_func_end sub_81891D0 - - thumb_func_start sub_81891DC -sub_81891DC: @ 81891DC - push {lr} - bl sub_81871AC - pop {r0} - bx r0 - thumb_func_end sub_81891DC - - thumb_func_start sub_81891E8 -sub_81891E8: @ 81891E8 - push {lr} - bl sub_81871AC - pop {r0} - bx r0 - thumb_func_end sub_81891E8 - - thumb_func_start sub_81891F4 -sub_81891F4: @ 81891F4 - push {lr} - bl sub_81871AC - pop {r0} - bx r0 - thumb_func_end sub_81891F4 - - thumb_func_start sub_8189200 -sub_8189200: @ 8189200 - push {lr} - bl sub_81871AC - pop {r0} - bx r0 - thumb_func_end sub_8189200 - - thumb_func_start sub_818920C -sub_818920C: @ 818920C - push {lr} - bl sub_81871AC - pop {r0} - bx r0 - thumb_func_end sub_818920C - - thumb_func_start sub_8189218 -sub_8189218: @ 8189218 - push {lr} - ldr r2, =gUnknown_02022D0C - ldrb r1, [r2] - movs r0, 0x80 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - bl sub_81871AC - pop {r0} - bx r0 - .pool - thumb_func_end sub_8189218 - - thumb_func_start sub_8189234 -sub_8189234: @ 8189234 - push {lr} - ldr r3, =gUnknown_02022D0C - ldr r1, =gBattleBufferA - ldr r0, =gActiveBank - ldrb r0, [r0] - lsls r0, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - movs r1, 0x7F - ands r1, r0 - ldrb r2, [r3] - movs r0, 0x80 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - bl sub_81871AC - pop {r0} - bx r0 - .pool - thumb_func_end sub_8189234 - - thumb_func_start sub_818926C -sub_818926C: @ 818926C - push {lr} - ldr r2, =gUnknown_02022D0C - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - bl sub_81871AC - pop {r0} - bx r0 - .pool - thumb_func_end sub_818926C - - thumb_func_start sub_8189284 -sub_8189284: @ 8189284 - push {lr} - ldr r3, =gUnknown_02022D0C - ldr r1, [r3] - lsls r1, 24 - lsrs r1, 31 - movs r0, 0x1 - eors r1, r0 - lsls r1, 7 - ldrb r2, [r3] - movs r0, 0x7F - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - bl sub_81871AC - pop {r0} - bx r0 - .pool - thumb_func_end sub_8189284 - - thumb_func_start sub_81892AC -sub_81892AC: @ 81892AC - push {r4,lr} - ldr r3, =gSprites - ldr r2, =gBankSpriteIds - ldr r4, =gActiveBank - ldrb r0, [r4] - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - bge _081892E0 - bl sub_81871AC - b _0818930A - .pool -_081892E0: - ldr r1, =gDoingBattleAnim - movs r0, 0x1 - strb r0, [r1] - ldrb r0, [r4] - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r1, 0 - strh r1, [r0, 0x30] - ldrb r0, [r4] - bl sub_80769F4 - ldr r1, =gBattleBankFunc - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_blink_t2 - str r1, [r0] -_0818930A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81892AC - - thumb_func_start sub_818931C -sub_818931C: @ 818931C - push {lr} - bl sub_81871AC - pop {r0} - bx r0 - thumb_func_end sub_818931C - - thumb_func_start sub_8189328 -sub_8189328: @ 8189328 - push {r4,lr} - ldr r4, =gActiveBank - ldrb r0, [r4] - bl GetBankSide - lsls r0, 24 - movs r3, 0x3F - cmp r0, 0 - bne _0818933C - movs r3, 0xC0 -_0818933C: - ldr r2, =gBattleBufferA - ldrb r1, [r4] - lsls r1, 9 - adds r0, r2, 0x1 - adds r0, r1, r0 - ldrb r0, [r0] - adds r2, 0x2 - adds r1, r2 - ldrb r1, [r1] - lsls r1, 8 - orrs r0, r1 - lsls r1, r3, 24 - asrs r1, 24 - bl PlaySE12WithPanning - bl sub_81871AC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8189328 - - thumb_func_start sub_818936C -sub_818936C: @ 818936C - push {r4,r5,lr} - ldr r4, =gBattleBufferA - ldr r5, =gActiveBank - ldrb r0, [r5] - lsls r3, r0, 9 - adds r0, r4, 0x3 - adds r0, r3, r0 - ldrb r0, [r0] - cmp r0, 0 - beq _081893A8 - bl sub_805EA60 - ldrb r1, [r5] - lsls r1, 9 - adds r0, r4, 0x1 - adds r0, r1, r0 - ldrb r0, [r0] - adds r2, r4, 0x2 - adds r1, r2 - ldrb r1, [r1] - lsls r1, 8 - orrs r0, r1 - bl PlayBGM - b _081893BC - .pool -_081893A8: - adds r0, r4, 0x1 - adds r0, r3, r0 - ldrb r0, [r0] - adds r1, r4, 0x2 - adds r1, r3, r1 - ldrb r1, [r1] - lsls r1, 8 - orrs r0, r1 - bl PlayFanfare -_081893BC: - bl sub_81871AC - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_818936C - - thumb_func_start sub_81893C8 -sub_81893C8: @ 81893C8 - push {lr} - ldr r1, =gBattlePartyID - ldr r0, =gActiveBank - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x19 - movs r2, 0x5 - bl PlayCry3 - bl sub_81871AC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81893C8 - - thumb_func_start sub_8189404 -sub_8189404: @ 8189404 - push {lr} - ldr r1, =gBattleBufferA - ldr r0, =gActiveBank - ldrb r0, [r0] - lsls r0, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - bl battle_intro_launch - ldr r2, =gUnknown_020243FC - ldrh r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strh r0, [r2] - bl sub_81871AC - pop {r0} - bx r0 - .pool - thumb_func_end sub_8189404 - - thumb_func_start sub_8189438 -sub_8189438: @ 8189438 - push {r4-r6,lr} - ldr r5, =gBankSpriteIds - ldr r6, =gActiveBank - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =gSprites - adds r0, r4 - bl oamt_add_pos2_onto_pos1 - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x23 - strh r1, [r0, 0x2E] - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x8C - lsls r1, 1 - strh r1, [r0, 0x32] - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x22] - strh r1, [r0, 0x36] - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r4, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_80A6EEC - str r1, [r0] - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =sub_818962C - bl oamt_set_x3A_32 - ldr r0, =c3_0803D564 - movs r1, 0x5 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r4, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r4 - ldrb r0, [r6] - strh r0, [r1, 0x8] - ldr r3, =gUnknown_020244D0 - ldr r0, [r3] - ldrb r2, [r6] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081894FA - ldr r0, =gUnknown_020244B4 - adds r0, r2, r0 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - ldr r1, =sub_8073C30 - str r1, [r0] -_081894FA: - ldr r0, [r3] - ldr r2, [r0, 0x8] - ldrb r0, [r2, 0x9] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x9] - ldr r1, =gBattleBankFunc - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r1, =nullsub_70 - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8189438 - - thumb_func_start c3_0803D564 -c3_0803D564: @ 8189548 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r7, =gActiveBank - ldrb r0, [r7] - mov r9, r0 - ldr r1, =gTasks - mov r2, r8 - lsls r0, r2, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - ldrh r0, [r0, 0x8] - strb r0, [r7] - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _08189582 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081895B4 -_08189582: - ldr r0, =gBattleBufferA - ldrb r1, [r7] - lsls r2, r1, 9 - adds r0, 0x1 - adds r2, r0 - ldr r0, =gBattlePartyID - lsls r1, 1 - adds r1, r0 - ldrh r0, [r1] - strb r0, [r2] - ldrb r0, [r7] - movs r1, 0 - bl sub_81885D8 - b _081895F4 - .pool -_081895B4: - ldr r4, =gBattleBufferA - ldrb r0, [r7] - lsls r1, r0, 9 - adds r4, 0x1 - adds r1, r4 - ldr r6, =gBattlePartyID - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - strb r0, [r1] - ldrb r0, [r7] - movs r1, 0 - bl sub_81885D8 - ldrb r0, [r7] - movs r5, 0x2 - eors r0, r5 - strb r0, [r7] - ldrb r0, [r7] - lsls r1, r0, 9 - adds r1, r4 - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - strb r0, [r1] - ldrb r0, [r7] - movs r1, 0 - bl sub_81885D8 - ldrb r0, [r7] - eors r0, r5 - strb r0, [r7] -_081895F4: - ldr r1, =gBattleBankFunc - ldr r2, =gActiveBank - ldrb r0, [r2] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_818686C - str r1, [r0] - mov r0, r9 - strb r0, [r2] - mov r0, r8 - bl DestroyTask - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end c3_0803D564 - - thumb_func_start sub_818962C -sub_818962C: @ 818962C - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x6] - bl sub_805DFE4 - adds r0, r4, 0 - bl FreeSpriteOamMatrix - adds r0, r4, 0 - bl DestroySprite - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_818962C - - thumb_func_start sub_8189648 -sub_8189648: @ 8189648 - push {r4-r7,lr} - ldr r1, =gBattleBufferA - ldr r0, =gActiveBank - ldrb r2, [r0] - lsls r0, r2, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _08189678 - adds r0, r2, 0 - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _08189678 - bl sub_81871AC - b _08189742 - .pool -_08189678: - ldr r4, =gUnknown_020244D0 - ldr r0, [r4] - ldr r3, =gActiveBank - ldrb r1, [r3] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0] - ldr r1, =gBattleBufferA - ldrb r2, [r3] - lsls r0, r2, 9 - adds r1, 0x2 - adds r0, r1 - ldrb r0, [r0] - adds r7, r3, 0 - cmp r0, 0 - beq _081896E4 - ldr r0, [r4] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r3, r0, r1 - ldrb r2, [r3, 0x1] - lsls r1, r2, 27 - lsrs r0, r1, 28 - cmp r0, 0x1 - bhi _081896DC - adds r0, 0x1 - movs r1, 0xF - ands r0, r1 - lsls r0, 1 - movs r1, 0x1F - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x1] - b _08189742 - .pool -_081896DC: - movs r0, 0x1F - negs r0, r0 - ands r0, r2 - strb r0, [r3, 0x1] -_081896E4: - adds r5, r7, 0 - ldrb r0, [r5] - lsls r3, r0, 9 - ldr r4, =gUnknown_02023068 - adds r1, r3, r4 - subs r2, r4, 0x3 - adds r2, r3, r2 - ldrb r2, [r2] - subs r4, 0x2 - adds r3, r4 - ldrb r3, [r3] - bl sub_80735DC - ldr r2, =gUnknown_020244B4 - ldrb r1, [r5] - adds r1, r2 - movs r3, 0 - strb r0, [r1] - ldr r6, =gUnknown_020244D0 - ldr r0, [r6] - ldrb r1, [r5] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strb r3, [r0, 0x5] - ldrb r2, [r5] - lsls r0, r2, 9 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - beq _08189736 - ldr r0, [r6] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - movs r1, 0x5D - strb r1, [r0, 0x5] -_08189736: - ldr r0, =gBattleBankFunc - ldrb r1, [r7] - lsls r1, 2 - adds r1, r0 - ldr r0, =sub_818975C - str r0, [r1] -_08189742: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8189648 - - thumb_func_start sub_818975C -sub_818975C: @ 818975C - push {r4,lr} - ldr r4, =gUnknown_020244D0 - ldr r0, [r4] - ldr r3, =gActiveBank - ldrb r1, [r3] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x5] - adds r2, r1, 0x1 - strb r2, [r0, 0x5] - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0x5C - bls _08189794 - ldr r0, [r4] - ldrb r1, [r3] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0 - strb r1, [r0, 0x5] - bl sub_81871AC -_08189794: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818975C - - thumb_func_start sub_81897A4 -sub_81897A4: @ 81897A4 - push {lr} - ldr r0, =gUnknown_020244D0 - ldr r1, [r0] - ldr r0, =gActiveBank - ldrb r3, [r0] - ldr r1, [r1, 0x4] - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081897D6 - ldr r2, =gTasks - ldr r0, =gUnknown_020244B4 - adds r0, r3, r0 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldr r1, =sub_8073C30 - str r1, [r0] -_081897D6: - bl sub_81871AC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81897A4 - - thumb_func_start sub_81897F4 -sub_81897F4: @ 81897F4 - push {lr} - bl sub_81871AC - pop {r0} - bx r0 - thumb_func_end sub_81897F4 - - thumb_func_start sub_8189800 -sub_8189800: @ 8189800 - push {r4,lr} - ldr r4, =gActiveBank - ldrb r0, [r4] - bl sub_80A6A90 - lsls r0, 24 - cmp r0, 0 - beq _08189846 - ldr r3, =gSprites - ldr r0, =gBankSpriteIds - ldrb r1, [r4] - adds r0, r1, r0 - ldrb r0, [r0] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r3 - ldr r0, =gBattleBufferA - lsls r1, 9 - adds r0, 0x1 - adds r1, r0 - adds r2, 0x3E - movs r0, 0x1 - ldrb r1, [r1] - ands r1, r0 - lsls r1, 2 - ldrb r3, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - ldrb r0, [r4] - bl sub_805E408 -_08189846: - bl sub_81871AC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8189800 - - thumb_func_start sub_8189860 -sub_8189860: @ 8189860 - push {r4-r6,lr} - sub sp, 0x4 - ldr r6, =gActiveBank - ldrb r0, [r6] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - bne _081898B8 - ldr r5, =gBattleBufferA - ldrb r2, [r6] - lsls r1, r2, 9 - adds r0, r5, 0x1 - adds r0, r1, r0 - ldrb r3, [r0] - adds r0, r5, 0x2 - adds r0, r1, r0 - ldrb r4, [r0] - adds r5, 0x3 - adds r1, r5 - ldrb r0, [r1] - lsls r0, 8 - orrs r4, r0 - str r4, [sp] - adds r0, r2, 0 - adds r1, r2, 0 - bl move_anim_start_t3 - lsls r0, 24 - cmp r0, 0 - beq _081898AC - bl sub_81871AC - b _081898B8 - .pool -_081898AC: - ldr r0, =gBattleBankFunc - ldrb r1, [r6] - lsls r1, 2 - adds r1, r0 - ldr r0, =sub_818717C - str r0, [r1] -_081898B8: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8189860 - - thumb_func_start sub_81898C8 -sub_81898C8: @ 81898C8 - push {lr} - bl sub_81871AC - pop {r0} - bx r0 - thumb_func_end sub_81898C8 - - thumb_func_start sub_81898D4 -sub_81898D4: @ 81898D4 - push {lr} - bl sub_81871AC - pop {r0} - bx r0 - thumb_func_end sub_81898D4 - - thumb_func_start sub_81898E0 -sub_81898E0: @ 81898E0 - push {lr} - ldr r1, =gBattleBufferA - ldr r0, =gActiveBank - ldrb r0, [r0] - lsls r0, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r2, [r0] - cmp r2, 0x3 - bne _08189908 - ldr r0, =gBattleOutcome - strb r2, [r0] - b _08189910 - .pool -_08189908: - ldr r0, =gBattleOutcome - movs r1, 0x3 - eors r1, r2 - strb r1, [r0] -_08189910: - movs r0, 0x5 - bl FadeOutMapMusic - movs r0, 0x3 - bl BeginFastPaletteFade - bl sub_81871AC - ldr r1, =gBattleBankFunc - ldr r0, =gActiveBank - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_80587B0 - str r1, [r0] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81898E0 - - thumb_func_start nullsub_119 -nullsub_119: @ 8189944 - bx lr - thumb_func_end nullsub_119 - - thumb_func_start nullsub_120 -nullsub_120: @ 8189948 - bx lr - thumb_func_end nullsub_120 - - thumb_func_start sub_818994C -sub_818994C: @ 818994C - ldr r1, =gBattleBankFunc - ldr r0, =gActiveBank - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8189968 - str r1, [r0] - bx lr - .pool - thumb_func_end sub_818994C - - thumb_func_start sub_8189968 -sub_8189968: @ 8189968 - push {lr} - ldr r2, =gBattleExecBuffer - ldr r1, =gBitTable - ldr r0, =gActiveBank - ldrb r3, [r0] - lsls r0, r3, 2 - adds r0, r1 - ldr r1, [r2] - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _081899B4 - ldr r0, =gBattleBufferA - lsls r1, r3, 9 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0x38 - bhi _081899B0 - ldr r0, =gUnknown_0860AF74 - ldrb r1, [r1] - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - bl _call_via_r0 - b _081899B4 - .pool -_081899B0: - bl sub_818A514 -_081899B4: - pop {r0} - bx r0 - thumb_func_end sub_8189968 - - thumb_func_start sub_81899B8 -sub_81899B8: @ 81899B8 - push {lr} - ldr r2, =gSprites - ldr r1, =gBankSpriteIds - ldr r0, =gActiveBank - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =SpriteCallbackDummy - cmp r1, r0 - bne _081899DC - bl sub_818A514 -_081899DC: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81899B8 - - thumb_func_start sub_81899F0 -sub_81899F0: @ 81899F0 - push {r4-r6,lr} - ldr r6, =gSprites - ldr r5, =gBankSpriteIds - ldr r4, =gActiveBank - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r6, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, [r0] - ldr r0, =SpriteCallbackDummy - cmp r1, r0 - bne _08189A40 - movs r0, 0 - bl nullsub_25 - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - bl FreeSpriteOamMatrix - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - bl DestroySprite - bl sub_818A514 -_08189A40: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81899F0 - - thumb_func_start sub_8189A58 -sub_8189A58: @ 8189A58 - push {r4,lr} - ldr r4, =gUnknown_020244D0 - ldr r1, [r4] - ldr r3, =gActiveBank - ldrb r0, [r3] - ldr r2, [r1, 0x4] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r0, [r1, 0x9] - subs r0, 0x1 - strb r0, [r1, 0x9] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _08189A90 - ldr r0, [r4] - ldrb r1, [r3] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0 - strb r1, [r0, 0x9] - bl sub_818A514 -_08189A90: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8189A58 - - thumb_func_start sub_8189AA0 -sub_8189AA0: @ 8189AA0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r6, 0 - ldr r4, =gActiveBank - ldrb r0, [r4] - bl GetBankIdentity - lsls r0, 24 - cmp r0, 0 - beq _08189ABA - b _08189C60 -_08189ABA: - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _08189ADA - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _08189B0C - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08189B0C -_08189ADA: - ldr r2, =gSprites - ldr r1, =gUnknown_03005D70 - ldrb r0, [r4] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =SpriteCallbackDummy - cmp r1, r0 - bne _08189B42 - b _08189B48 - .pool -_08189B0C: - ldr r2, =gSprites - ldr r5, =gUnknown_03005D70 - ldr r0, =gActiveBank - ldrb r3, [r0] - adds r0, r3, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r4, [r0] - ldr r0, =SpriteCallbackDummy - cmp r4, r0 - bne _08189B42 - movs r0, 0x2 - eors r3, r0 - adds r0, r3, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - cmp r0, r4 - bne _08189B42 - movs r6, 0x1 -_08189B42: - cmp r6, 0 - bne _08189B48 - b _08189D18 -_08189B48: - ldr r0, =gUnknown_020244D0 - mov r9, r0 - ldr r0, [r0] - ldr r5, =gActiveBank - ldrb r2, [r5] - ldr r3, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r4, r0, r3 - ldrb r1, [r4, 0x1] - movs r6, 0x1 - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - bne _08189B6A - b _08189D18 -_08189B6A: - movs r1, 0x2 - mov r8, r1 - mov r1, r8 - eors r1, r2 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r1, [r0, 0x1] - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - bne _08189B86 - b _08189D18 -_08189B86: - ldrb r1, [r4] - movs r3, 0x7F - adds r0, r3, 0 - ands r0, r1 - strb r0, [r4] - mov r1, r9 - ldr r0, [r1] - ldrb r2, [r5] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x1] - movs r4, 0x2 - negs r4, r4 - adds r0, r4, 0 - ands r0, r2 - strb r0, [r1, 0x1] - mov r0, r9 - ldr r2, [r0] - ldrb r0, [r5] - mov r1, r8 - eors r1, r0 - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - ands r3, r1 - strb r3, [r0] - mov r1, r9 - ldr r2, [r1] - ldrb r0, [r5] - mov r1, r8 - eors r1, r0 - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x1] - ands r4, r1 - strb r4, [r0, 0x1] - ldr r4, =0x000027f9 - adds r0, r4, 0 - bl FreeSpriteTilesByTag - adds r0, r4, 0 - bl FreeSpritePaletteByTag - ldr r7, =gBattlePartyID - ldrb r1, [r5] - lsls r0, r1, 1 - adds r0, r7 - ldrh r0, [r0] - movs r6, 0x64 - muls r0, r6 - ldr r4, =gPlayerParty - adds r0, r4 - bl sub_805E990 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _08189C22 - ldrb r0, [r5] - mov r1, r8 - eors r1, r0 - lsls r0, r1, 1 - adds r0, r7 - ldrh r0, [r0] - muls r0, r6 - adds r0, r4 - bl sub_805E990 -_08189C22: - mov r1, r9 - ldr r0, [r1] - ldrb r1, [r5] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x3 - strb r1, [r0, 0x9] - ldr r1, =gBattleBankFunc - ldrb r0, [r5] - b _08189D10 - .pool -_08189C60: - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _08189C80 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _08189CB0 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08189CB0 -_08189C80: - ldr r2, =gSprites - ldr r1, =gUnknown_03005D70 - ldrb r0, [r4] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =SpriteCallbackDummy - cmp r1, r0 - bne _08189CE6 - b _08189CE4 - .pool -_08189CB0: - ldr r2, =gSprites - ldr r5, =gUnknown_03005D70 - ldr r0, =gActiveBank - ldrb r3, [r0] - adds r0, r3, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r4, [r0] - ldr r0, =SpriteCallbackDummy - cmp r4, r0 - bne _08189CE6 - movs r0, 0x2 - eors r3, r0 - adds r0, r3, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - cmp r0, r4 - bne _08189CE6 -_08189CE4: - movs r6, 0x1 -_08189CE6: - bl IsCryPlayingOrClearCrySongs - lsls r0, 24 - cmp r0, 0 - beq _08189CF2 - movs r6, 0 -_08189CF2: - cmp r6, 0 - beq _08189D18 - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldr r3, =gActiveBank - ldrb r1, [r3] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x3 - strb r1, [r0, 0x9] - ldr r1, =gBattleBankFunc - ldrb r0, [r3] -_08189D10: - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8189A58 - str r1, [r0] -_08189D18: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8189AA0 - - thumb_func_start sub_8189D40 -sub_8189D40: @ 8189D40 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r0, 0 - mov r10, r0 - ldr r4, =gActiveBank - ldrb r0, [r4] - bl GetBankIdentity - lsls r0, 24 - cmp r0, 0 - bne _08189DBE - ldr r5, =gUnknown_020244D0 - ldr r0, [r5] - ldrb r2, [r4] - ldr r1, [r0, 0x4] - lsls r3, r2, 1 - adds r0, r3, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r6, 0x88 - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - bne _08189D8C - ldr r0, =gBattlePartyID - adds r0, r3, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r1, r0 - adds r0, r2, 0 - bl sub_8172EF0 -_08189D8C: - ldr r2, [r5] - ldrb r1, [r4] - movs r0, 0x2 - adds r3, r0, 0 - eors r3, r1 - ldr r1, [r2, 0x4] - lsls r2, r3, 1 - adds r0, r2, r3 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - bne _08189DBE - ldr r0, =gBattlePartyID - adds r0, r2, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r1, r0 - adds r0, r3, 0 - bl sub_8172EF0 -_08189DBE: - ldr r3, =gUnknown_020244D0 - ldr r0, [r3] - ldr r2, =gActiveBank - ldrb r5, [r2] - ldr r4, [r0, 0x4] - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r6, r0, r4 - ldrb r1, [r6] - movs r0, 0x8 - mov r12, r0 - ands r0, r1 - mov r9, r2 - mov r8, r3 - cmp r0, 0 - bne _08189EA2 - movs r7, 0x2 - adds r1, r7, 0 - eors r1, r5 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0] - mov r0, r12 - ands r0, r1 - cmp r0, 0 - bne _08189EA2 - ldrb r1, [r6, 0x1] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08189E84 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _08189E54 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - bne _08189E54 - ldr r4, =gUnknown_03005D70 - mov r1, r9 - ldrb r0, [r1] - adds r1, r7, 0 - eors r1, r0 - adds r0, r1, r4 - ldrb r0, [r0] - ldr r2, =gBattlePartyID - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =gPlayerParty - adds r1, r2 - movs r2, 0 - bl healthbar_draw_field_maybe - mov r1, r9 - ldrb r0, [r1] - eors r0, r7 - bl sub_8076918 - mov r1, r9 - ldrb r0, [r1] - eors r0, r7 - adds r0, r4 - ldrb r0, [r0] - bl sub_80729D0 -_08189E54: - ldr r5, =gUnknown_03005D70 - ldr r4, =gActiveBank - ldrb r1, [r4] - adds r0, r1, r5 - ldrb r0, [r0] - ldr r2, =gBattlePartyID - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =gPlayerParty - adds r1, r2 - movs r2, 0 - bl healthbar_draw_field_maybe - ldrb r0, [r4] - bl sub_8076918 - ldrb r0, [r4] - adds r0, r5 - ldrb r0, [r0] - bl sub_80729D0 -_08189E84: - ldr r4, =gUnknown_020244D0 - ldr r0, [r4] - ldr r3, =gActiveBank - ldrb r1, [r3] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x1] - movs r2, 0x80 - orrs r1, r2 - strb r1, [r0, 0x1] - mov r9, r3 - mov r8, r4 -_08189EA2: - mov r1, r8 - ldr r0, [r1] - mov r1, r9 - ldrb r2, [r1] - ldr r3, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r3 - ldrb r1, [r0, 0x1] - movs r0, 0xC0 - ands r0, r1 - cmp r0, 0x80 - bne _08189F62 - movs r1, 0x2 - eors r1, r2 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r1, [r0, 0x1] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _08189F62 - bl IsCryPlayingOrClearCrySongs - lsls r0, 24 - cmp r0, 0 - bne _08189F62 - mov r1, r8 - ldr r0, [r1] - mov r1, r9 - ldrb r2, [r1] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x1] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _08189F44 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x42 - ands r0, r1 - cmp r0, 0x42 - bne _08189F38 - adds r0, r2, 0 - bl GetBankIdentity - lsls r0, 24 - cmp r0, 0 - bne _08189F44 - ldr r0, =gMPlay_BGM - bl m4aMPlayContinue - b _08189F44 - .pool -_08189F38: - ldr r0, =gMPlay_BGM - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl m4aMPlayVolumeControl -_08189F44: - ldr r0, =gUnknown_020244D0 - ldr r2, [r0] - ldr r0, =gActiveBank - ldrb r1, [r0] - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x1] - movs r2, 0x20 - orrs r1, r2 - strb r1, [r0, 0x1] - movs r0, 0x1 - mov r10, r0 -_08189F62: - mov r1, r10 - cmp r1, 0 - beq _0818A02A - ldr r7, =gSprites - ldr r6, =gUnknown_03005D7C - ldr r5, =gActiveBank - ldrb r3, [r5] - adds r0, r3, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r4, r7, 0 - adds r4, 0x1C - adds r0, r4 - ldr r2, [r0] - ldr r0, =SpriteCallbackDummy - cmp r2, r0 - bne _0818A02A - ldr r0, =gBankSpriteIds - adds r0, r3, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r0, [r0] - cmp r0, r2 - bne _0818A02A - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _08189FC8 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - bne _08189FC8 - ldrb r1, [r5] - movs r0, 0x2 - eors r0, r1 - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - bl DestroySprite -_08189FC8: - ldr r1, =gUnknown_03005D7C - ldr r4, =gActiveBank - ldrb r0, [r4] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl DestroySprite - ldr r3, =gUnknown_020244D0 - ldr r0, [r3] - ldr r2, [r0, 0x8] - ldrb r1, [r2, 0x9] - movs r0, 0x2 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x9] - ldr r0, [r3] - ldrb r2, [r4] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x1] - movs r0, 0x21 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x1] - ldr r0, [r3] - ldrb r2, [r4] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x1] - movs r0, 0x7F - ands r0, r2 - strb r0, [r1, 0x1] - ldr r1, =gBattleBankFunc - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8189AA0 - str r1, [r0] -_0818A02A: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8189D40 - - thumb_func_start sub_818A064 -sub_818A064: @ 818A064 - push {lr} - ldr r2, =gSprites - ldr r1, =gBankSpriteIds - ldr r0, =gActiveBank - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r2 - adds r0, r1, 0 - adds r0, 0x3F - ldrb r0, [r0] - lsls r0, 27 - cmp r0, 0 - bge _0818A092 - movs r2, 0x24 - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _0818A092 - bl sub_818A514 -_0818A092: - pop {r0} - bx r0 - .pool - thumb_func_end sub_818A064 - - thumb_func_start sub_818A0A4 -sub_818A0A4: @ 818A0A4 - push {r4-r6,lr} - ldr r5, =gActiveBank - ldrb r0, [r5] - ldr r6, =gUnknown_03005D70 - adds r1, r0, r6 - ldrb r1, [r1] - movs r2, 0 - movs r3, 0 - bl sub_8074AA0 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldrb r0, [r5] - adds r0, r6 - ldrb r0, [r0] - bl sub_80729D0 - lsls r4, 16 - asrs r1, r4, 16 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _0818A0EC - ldrb r0, [r5] - adds r0, r6 - ldrb r0, [r0] - movs r2, 0 - bl heathbar_draw_hp - b _0818A106 - .pool -_0818A0EC: - ldr r2, =gBattlePartyID - ldrb r1, [r5] - lsls r0, r1, 1 - adds r0, r2 - ldrh r2, [r0] - movs r0, 0x64 - muls r0, r2 - ldr r2, =gPlayerParty - adds r0, r2 - bl sub_805E990 - bl sub_818A514 -_0818A106: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818A0A4 - - thumb_func_start sub_818A114 -sub_818A114: @ 818A114 - push {r4-r6,lr} - ldr r6, =gSprites - ldr r5, =gBankSpriteIds - ldr r4, =gActiveBank - ldrb r2, [r4] - adds r0, r2, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r3, 0x22 - ldrsh r1, [r0, r3] - movs r3, 0x26 - ldrsh r0, [r0, r3] - adds r1, r0 - cmp r1, 0xA0 - ble _0818A190 - ldr r1, =gBattlePartyID - lsls r0, r2, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - bl nullsub_24 - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl FreeOamMatrix - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - bl DestroySprite - ldr r1, =gUnknown_03005D70 - ldrb r0, [r4] - adds r0, r1 - ldrb r0, [r0] - bl sub_8072984 - bl sub_818A514 -_0818A190: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818A114 - - thumb_func_start sub_818A1B0 -sub_818A1B0: @ 818A1B0 - push {r4-r6,lr} - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldr r6, =gActiveBank - ldrb r2, [r6] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0818A204 - ldr r5, =gBankSpriteIds - adds r0, r2, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =gSprites - adds r0, r4 - bl FreeSpriteOamMatrix - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl DestroySprite - ldr r1, =gUnknown_03005D70 - ldrb r0, [r6] - adds r0, r1 - ldrb r0, [r0] - bl sub_8072984 - bl sub_818A514 -_0818A204: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818A1B0 - - thumb_func_start sub_818A220 -sub_818A220: @ 818A220 - push {lr} - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - bne _0818A232 - bl sub_818A514 -_0818A232: - pop {r0} - bx r0 - thumb_func_end sub_818A220 - - thumb_func_start sub_818A238 -sub_818A238: @ 818A238 - push {r4,lr} - ldr r1, =gBankSpriteIds - ldr r0, =gActiveBank - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - ldr r2, =gSprites - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r4, r0, r2 - movs r1, 0x30 - ldrsh r0, [r4, r1] - cmp r0, 0x20 - bne _0818A284 - movs r3, 0 - movs r0, 0 - strh r0, [r4, 0x30] - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - subs r0, 0x5 - ands r0, r1 - strb r0, [r2] - ldr r0, =gDoingBattleAnim - strb r3, [r0] - bl sub_818A514 - b _0818A2AE - .pool -_0818A284: - ldrh r0, [r4, 0x30] - movs r1, 0x3 - ands r0, r1 - cmp r0, 0 - bne _0818A2A8 - adds r3, r4, 0 - adds r3, 0x3E - ldrb r2, [r3] - lsls r0, r2, 29 - lsrs r0, 31 - movs r1, 0x1 - eors r1, r0 - lsls r1, 2 - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] -_0818A2A8: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] -_0818A2AE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_818A238 - - thumb_func_start sub_818A2B4 -sub_818A2B4: @ 818A2B4 - push {r4,lr} - ldr r2, =gSprites - ldr r0, =gUnknown_03005D70 - ldr r4, =gActiveBank - ldrb r3, [r4] - adds r0, r3, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =SpriteCallbackDummy - cmp r1, r0 - bne _0818A306 - adds r0, r3, 0 - bl sub_805E408 - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldrb r2, [r4] - ldr r1, [r0] - lsls r0, r2, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0818A2FA - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x6 - bl move_anim_start_t4 -_0818A2FA: - ldr r0, =gBattleBankFunc - ldrb r1, [r4] - lsls r1, 2 - adds r1, r0 - ldr r0, =sub_818A328 - str r0, [r1] -_0818A306: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818A2B4 - - thumb_func_start sub_818A328 -sub_818A328: @ 818A328 - push {lr} - ldr r0, =gUnknown_020244D0 - ldr r1, [r0] - ldr r0, =gActiveBank - ldrb r3, [r0] - ldr r1, [r1, 0x4] - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0818A364 - ldr r2, =gSprites - ldr r0, =gBankSpriteIds - adds r0, r3, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =SpriteCallbackDummy - cmp r1, r0 - bne _0818A364 - bl sub_818A514 -_0818A364: - pop {r0} - bx r0 - .pool - thumb_func_end sub_818A328 - - thumb_func_start sub_818A37C -sub_818A37C: @ 818A37C - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r3, =gUnknown_020244D0 - ldr r0, [r3] - ldr r7, =gActiveBank - ldrb r1, [r7] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r2, r0, r2 - ldrb r1, [r2, 0x1] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0818A438 - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - ldr r0, [r3] - ldrb r2, [r7] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x1] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x1] - ldr r4, =0x000027f9 - adds r0, r4, 0 - bl FreeSpriteTilesByTag - adds r0, r4, 0 - bl FreeSpritePaletteByTag - ldr r0, =c3_0802FDF4 - movs r1, 0xA - bl CreateTask - ldr r0, =gBattlePartyID - mov r8, r0 - ldrb r1, [r7] - lsls r0, r1, 1 - add r0, r8 - ldrh r0, [r0] - movs r6, 0x64 - muls r0, r6 - ldr r5, =gPlayerParty - adds r0, r5 - bl sub_805E990 - ldr r1, =gBankSpriteIds - ldrb r0, [r7] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - movs r1, 0 - bl StartSpriteAnim - ldr r4, =gUnknown_03005D70 - ldrb r1, [r7] - adds r0, r1, r4 - ldrb r0, [r0] - lsls r1, 1 - add r1, r8 - ldrh r1, [r1] - muls r1, r6 - adds r1, r5 - movs r2, 0 - bl healthbar_draw_field_maybe - ldrb r0, [r7] - bl sub_8076918 - ldrb r0, [r7] - adds r0, r4 - ldrb r0, [r0] - bl sub_80729D0 - ldr r1, =gBattleBankFunc - ldrb r0, [r7] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_818A2B4 - str r1, [r0] -_0818A438: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818A37C - - thumb_func_start sub_818A470 -sub_818A470: @ 818A470 - push {r4-r6,lr} - ldr r6, =gUnknown_020244D0 - ldr r0, [r6] - ldr r4, =gActiveBank - ldrb r2, [r4] - ldr r1, [r0, 0x4] - lsls r3, r2, 1 - adds r0, r3, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x88 - ands r0, r1 - cmp r0, 0 - bne _0818A4A2 - ldr r0, =gBattlePartyID - adds r0, r3, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r1, r0 - adds r0, r2, 0 - bl sub_8172EF0 -_0818A4A2: - ldr r5, =gSprites - ldr r0, =gUnknown_03005D7C - ldrb r2, [r4] - adds r0, r2, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r3, r0, 2 - adds r0, r5, 0 - adds r0, 0x1C - adds r0, r3, r0 - ldr r1, [r0] - ldr r0, =SpriteCallbackDummy - cmp r1, r0 - bne _0818A4E8 - ldr r0, [r6] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - bne _0818A4E8 - adds r0, r3, r5 - bl DestroySprite - ldr r1, =gBattleBankFunc - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_818A37C - str r1, [r0] -_0818A4E8: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818A470 - - thumb_func_start sub_818A514 -sub_818A514: @ 818A514 - push {r4,lr} - sub sp, 0x4 - ldr r1, =gBattleBankFunc - ldr r4, =gActiveBank - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8189968 - str r1, [r0] - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0818A568 - bl link_get_multiplayer_id - mov r1, sp - strb r0, [r1] - movs r0, 0x2 - movs r1, 0x4 - mov r2, sp - bl PrepareBufferDataTransferLink - ldr r1, =gBattleBufferA - ldrb r0, [r4] - lsls r0, 9 - adds r0, r1 - movs r1, 0x38 - strb r1, [r0] - b _0818A57A - .pool -_0818A568: - ldr r2, =gBattleExecBuffer - ldr r1, =gBitTable - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - ldr r0, [r2] - bics r0, r1 - str r0, [r2] -_0818A57A: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818A514 - - thumb_func_start sub_818A58C -sub_818A58C: @ 818A58C - push {lr} - ldr r0, =gUnknown_020244D0 - ldr r2, [r0] - ldr r0, =gActiveBank - ldrb r1, [r0] - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _0818A5AE - bl sub_818A514 -_0818A5AE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_818A58C - - thumb_func_start sub_818A5BC -sub_818A5BC: @ 818A5BC - push {lr} - ldr r0, =gUnknown_020244D0 - ldr r2, [r0] - ldr r0, =gActiveBank - ldrb r1, [r0] - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _0818A5DE - bl sub_818A514 -_0818A5DE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_818A5BC - - thumb_func_start sub_818A5EC -sub_818A5EC: @ 818A5EC - push {r4-r6,lr} - sub sp, 0x100 - movs r6, 0 - ldr r1, =gBattleBufferA - ldr r0, =gActiveBank - ldrb r2, [r0] - lsls r0, r2, 9 - adds r1, 0x2 - adds r1, r0, r1 - ldrb r0, [r1] - cmp r0, 0 - bne _0818A624 - ldr r0, =gBattlePartyID - lsls r1, r2, 1 - adds r1, r0 - ldrb r0, [r1] - mov r1, sp - bl sub_818A660 - adds r6, r0, 0 - b _0818A646 - .pool -_0818A624: - ldrb r4, [r1] - movs r5, 0 -_0818A628: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _0818A63E - lsls r0, r5, 24 - lsrs r0, 24 - mov r2, sp - adds r1, r2, r6 - bl sub_818A660 - adds r6, r0 -_0818A63E: - lsrs r4, 1 - adds r5, 0x1 - cmp r5, 0x5 - ble _0818A628 -_0818A646: - lsls r1, r6, 16 - lsrs r1, 16 - movs r0, 0x1 - mov r2, sp - bl dp01_build_cmdbuf_x1D_1D_numargs_varargs - bl sub_818A514 - add sp, 0x100 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_818A5EC - - thumb_func_start sub_818A660 -sub_818A660: @ 818A660 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x90 - adds r7, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - movs r6, 0 - ldr r2, =gBattleBufferA - ldr r3, =gActiveBank - ldrb r0, [r3] - lsls r0, 9 - adds r1, r2, 0x1 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x3B - bls _0818A68A - bl _0818ADF6 -_0818A68A: - lsls r0, 2 - ldr r1, =_0818A6A0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0818A6A0: - .4byte _0818A790 - .4byte _0818A9B4 - .4byte _0818A9C4 - .4byte _0818A9D4 - .4byte _0818AA3C - .4byte _0818AA3C - .4byte _0818AA3C - .4byte _0818AA3C - .4byte _0818AA58 - .4byte _0818AA94 - .4byte _0818AA94 - .4byte _0818AA94 - .4byte _0818AA94 - .4byte _0818ADF6 - .4byte _0818ADF6 - .4byte _0818ADF6 - .4byte _0818ADF6 - .4byte _0818AAB0 - .4byte _0818AAC0 - .4byte _0818AAF0 - .4byte _0818AB00 - .4byte _0818AB10 - .4byte _0818AB20 - .4byte _0818AB30 - .4byte _0818AB40 - .4byte _0818AB50 - .4byte _0818AB60 - .4byte _0818AB70 - .4byte _0818AB80 - .4byte _0818AB90 - .4byte _0818ABA0 - .4byte _0818ABB0 - .4byte _0818AC00 - .4byte _0818AC10 - .4byte _0818AC20 - .4byte _0818AC30 - .4byte _0818AC40 - .4byte _0818AC50 - .4byte _0818AC60 - .4byte _0818AC70 - .4byte _0818AC80 - .4byte _0818ACB4 - .4byte _0818ACC4 - .4byte _0818ACD4 - .4byte _0818ACE4 - .4byte _0818ACF4 - .4byte _0818AD04 - .4byte _0818AD14 - .4byte _0818AD24 - .4byte _0818AD44 - .4byte _0818AD54 - .4byte _0818AD64 - .4byte _0818AD74 - .4byte _0818AD84 - .4byte _0818AD94 - .4byte _0818ADA4 - .4byte _0818ADB4 - .4byte _0818ADC4 - .4byte _0818ADD4 - .4byte _0818ADE4 -_0818A790: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =gPlayerParty - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xB - bl GetMonData - mov r1, sp - strh r0, [r1] - adds r0, r4, 0 - movs r1, 0xC - bl GetMonData - mov r1, sp - strh r0, [r1, 0x2E] - movs r6, 0 - add r0, sp, 0x24 - mov r9, r0 - movs r1, 0x3B - add r1, sp - mov r10, r1 - mov r2, sp - adds r2, 0x2B - str r2, [sp, 0x80] - mov r0, sp - adds r0, 0x2A - str r0, [sp, 0x7C] - mov r1, sp - adds r1, 0x68 - str r1, [sp, 0x8C] - adds r2, 0x5 - str r2, [sp, 0x84] - adds r0, 0x12 - str r0, [sp, 0x88] - mov r8, r4 - add r4, sp, 0xC -_0818A7DC: - adds r1, r6, 0 - adds r1, 0xD - mov r0, r8 - bl GetMonData - strh r0, [r4] - adds r1, r6, 0 - adds r1, 0x11 - mov r0, r8 - bl GetMonData - mov r2, r9 - adds r1, r2, r6 - strb r0, [r1] - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x3 - ble _0818A7DC - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =gPlayerParty - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x15 - bl GetMonData - mov r1, r10 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x20 - bl GetMonData - ldr r2, [sp, 0x80] - strb r0, [r2] - adds r0, r4, 0 - movs r1, 0x19 - bl GetMonData - str r0, [sp, 0x44] - adds r0, r4, 0 - movs r1, 0x27 - bl GetMonData - mov r3, sp - movs r5, 0x1F - ands r0, r5 - ldrb r2, [r3, 0x14] - movs r1, 0x20 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x14] - adds r0, r4, 0 - movs r1, 0x28 - bl GetMonData - mov r3, sp - movs r6, 0x1F - ands r0, r6 - lsls r0, 5 - ldrh r2, [r3, 0x14] - ldr r1, =0xfffffc1f - ands r1, r2 - orrs r1, r0 - strh r1, [r3, 0x14] - adds r0, r4, 0 - movs r1, 0x29 - bl GetMonData - mov r3, sp - ands r0, r5 - lsls r0, 2 - ldrb r2, [r3, 0x15] - movs r1, 0x7D - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x15] - adds r0, r4, 0 - movs r1, 0x2A - bl GetMonData - movs r1, 0x1F - ands r1, r0 - lsls r1, 15 - ldr r0, [sp, 0x14] - ldr r2, =0xfff07fff - ands r0, r2 - orrs r0, r1 - str r0, [sp, 0x14] - adds r0, r4, 0 - movs r1, 0x2B - bl GetMonData - mov r3, sp - ands r0, r6 - lsls r0, 4 - ldrh r2, [r3, 0x16] - ldr r1, =0xfffffe0f - ands r1, r2 - orrs r1, r0 - strh r1, [r3, 0x16] - adds r0, r4, 0 - movs r1, 0x2C - bl GetMonData - mov r3, sp - ands r0, r5 - lsls r0, 1 - ldrb r2, [r3, 0x17] - movs r1, 0x3F - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x17] - adds r0, r4, 0 - movs r1, 0 - bl GetMonData - str r0, [sp, 0x48] - adds r0, r4, 0 - movs r1, 0x37 - bl GetMonData - str r0, [sp, 0x4C] - adds r0, r4, 0 - movs r1, 0x38 - bl GetMonData - ldr r1, [sp, 0x7C] - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x39 - bl GetMonData - mov r1, sp - strh r0, [r1, 0x28] - adds r0, r4, 0 - movs r1, 0x3A - bl GetMonData - mov r1, sp - strh r0, [r1, 0x2C] - adds r0, r4, 0 - movs r1, 0x3B - bl GetMonData - mov r1, sp - strh r0, [r1, 0x2] - adds r0, r4, 0 - movs r1, 0x3C - bl GetMonData - mov r1, sp - strh r0, [r1, 0x4] - adds r0, r4, 0 - movs r1, 0x3D - bl GetMonData - mov r1, sp - strh r0, [r1, 0x6] - adds r0, r4, 0 - movs r1, 0x3E - bl GetMonData - mov r1, sp - strh r0, [r1, 0x8] - adds r0, r4, 0 - movs r1, 0x3F - bl GetMonData - mov r1, sp - strh r0, [r1, 0xA] - adds r0, r4, 0 - movs r1, 0x2D - bl GetMonData - mov r3, sp - movs r1, 0x1 - ands r0, r1 - lsls r0, 6 - ldrb r2, [r3, 0x17] - movs r1, 0x41 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x17] - adds r0, r4, 0 - movs r1, 0x2E - bl GetMonData - mov r3, sp - lsls r0, 7 - ldrb r2, [r3, 0x17] - movs r1, 0x7F - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x17] - adds r0, r4, 0 - movs r1, 0x1 - bl GetMonData - str r0, [sp, 0x54] - adds r0, r4, 0 - movs r1, 0x2 - ldr r2, [sp, 0x8C] - bl GetMonData - ldr r0, [sp, 0x84] - ldr r1, [sp, 0x8C] - bl StringCopy10 - adds r0, r4, 0 - movs r1, 0x7 - ldr r2, [sp, 0x88] - bl GetMonData - mov r2, sp - movs r6, 0 -_0818A994: - adds r0, r7, r6 - adds r1, r2, r6 - ldrb r1, [r1] - strb r1, [r0] - adds r6, 0x1 - cmp r6, 0x57 - bls _0818A994 - b _0818ADF6 - .pool -_0818A9B4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xB - b _0818AD2E - .pool -_0818A9C4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xC - b _0818AD2E - .pool -_0818A9D4: - movs r6, 0 - add r2, sp, 0x58 - mov r9, r2 - add r0, sp, 0x60 - mov r10, r0 - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =gPlayerParty - adds r4, r1, r0 - mov r8, r9 -_0818A9EA: - adds r1, r6, 0 - adds r1, 0xD - adds r0, r4, 0 - bl GetMonData - mov r1, r8 - strh r0, [r1] - adds r1, r6, 0 - adds r1, 0x11 - adds r0, r4, 0 - bl GetMonData - mov r2, r10 - adds r1, r2, r6 - strb r0, [r1] - movs r0, 0x2 - add r8, r0 - adds r6, 0x1 - cmp r6, 0x3 - ble _0818A9EA - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x15 - bl GetMonData - mov r1, r9 - strb r0, [r1, 0xC] - mov r2, r9 - movs r6, 0 -_0818AA28: - adds r0, r7, r6 - adds r1, r2, r6 - ldrb r1, [r1] - strb r1, [r0] - adds r6, 0x1 - cmp r6, 0xF - bls _0818AA28 - b _0818ADF6 - .pool -_0818AA3C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldrb r1, [r3] - lsls r1, 9 - adds r2, 0x1 - adds r1, r2 - ldrb r1, [r1] - adds r1, 0x9 - b _0818AD2E - .pool -_0818AA58: - movs r6, 0 - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r2, =gPlayerParty - mov r8, r2 -_0818AA64: - adds r1, r6, 0 - adds r1, 0x11 - mov r2, r8 - adds r0, r4, r2 - bl GetMonData - adds r1, r7, r6 - strb r0, [r1] - adds r6, 0x1 - cmp r6, 0x3 - ble _0818AA64 - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x15 - bl GetMonData - adds r1, r7, r6 - strb r0, [r1] - adds r6, 0x1 - b _0818ADF6 - .pool -_0818AA94: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldrb r1, [r3] - lsls r1, 9 - adds r2, 0x1 - adds r1, r2 - ldrb r1, [r1] - adds r1, 0x8 - b _0818ADEE - .pool -_0818AAB0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x1 - b _0818AACA - .pool -_0818AAC0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x19 -_0818AACA: - bl GetMonData - adds r1, r0, 0 - strb r1, [r7] - movs r0, 0xFF - lsls r0, 8 - ands r0, r1 - lsrs r0, 8 - strb r0, [r7, 0x1] - movs r0, 0xFF - lsls r0, 16 - ands r0, r1 - lsrs r0, 16 - strb r0, [r7, 0x2] - movs r6, 0x3 - b _0818ADF6 - .pool -_0818AAF0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x1A - b _0818ADEE - .pool -_0818AB00: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x1B - b _0818ADEE - .pool -_0818AB10: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x1C - b _0818ADEE - .pool -_0818AB20: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x1D - b _0818ADEE - .pool -_0818AB30: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x1E - b _0818ADEE - .pool -_0818AB40: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x1F - b _0818ADEE - .pool -_0818AB50: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x20 - b _0818ADEE - .pool -_0818AB60: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x22 - b _0818ADEE - .pool -_0818AB70: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x23 - b _0818ADEE - .pool -_0818AB80: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x24 - b _0818ADEE - .pool -_0818AB90: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x25 - b _0818ADEE - .pool -_0818ABA0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x26 - b _0818ADEE - .pool -_0818ABB0: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =gPlayerParty - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x27 - bl GetMonData - strb r0, [r7] - adds r0, r4, 0 - movs r1, 0x28 - bl GetMonData - strb r0, [r7, 0x1] - adds r0, r4, 0 - movs r1, 0x29 - bl GetMonData - strb r0, [r7, 0x2] - adds r0, r4, 0 - movs r1, 0x2A - bl GetMonData - strb r0, [r7, 0x3] - adds r0, r4, 0 - movs r1, 0x2B - bl GetMonData - strb r0, [r7, 0x4] - adds r0, r4, 0 - movs r1, 0x2C - bl GetMonData - strb r0, [r7, 0x5] - movs r6, 0x6 - b _0818ADF6 - .pool -_0818AC00: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x27 - b _0818ADEE - .pool -_0818AC10: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x28 - b _0818ADEE - .pool -_0818AC20: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x29 - b _0818ADEE - .pool -_0818AC30: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x2A - b _0818ADEE - .pool -_0818AC40: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x2B - b _0818ADEE - .pool -_0818AC50: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x2C - b _0818ADEE - .pool -_0818AC60: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0 - b _0818AC8A - .pool -_0818AC70: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x9 - b _0818AD2E - .pool -_0818AC80: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x37 -_0818AC8A: - bl GetMonData - adds r1, r0, 0 - strb r1, [r7] - movs r0, 0xFF - lsls r0, 8 - ands r0, r1 - lsrs r0, 8 - strb r0, [r7, 0x1] - movs r0, 0xFF - lsls r0, 16 - ands r0, r1 - lsrs r0, 16 - strb r0, [r7, 0x2] - lsrs r0, r1, 24 - strb r0, [r7, 0x3] - movs r6, 0x4 - b _0818ADF6 - .pool -_0818ACB4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x38 - b _0818ADEE - .pool -_0818ACC4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x39 - b _0818AD2E - .pool -_0818ACD4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x3A - b _0818AD2E - .pool -_0818ACE4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x3B - b _0818AD2E - .pool -_0818ACF4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x3C - b _0818AD2E - .pool -_0818AD04: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x3D - b _0818AD2E - .pool -_0818AD14: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x3E - b _0818AD2E - .pool -_0818AD24: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x3F -_0818AD2E: - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - strb r0, [r7] - lsrs r0, 8 - strb r0, [r7, 0x1] - movs r6, 0x2 - b _0818ADF6 - .pool -_0818AD44: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x16 - b _0818ADEE - .pool -_0818AD54: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x17 - b _0818ADEE - .pool -_0818AD64: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x18 - b _0818ADEE - .pool -_0818AD74: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x21 - b _0818ADEE - .pool -_0818AD84: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x2F - b _0818ADEE - .pool -_0818AD94: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x30 - b _0818ADEE - .pool -_0818ADA4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x32 - b _0818ADEE - .pool -_0818ADB4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x33 - b _0818ADEE - .pool -_0818ADC4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x34 - b _0818ADEE - .pool -_0818ADD4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x35 - b _0818ADEE - .pool -_0818ADE4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x36 -_0818ADEE: - bl GetMonData - strb r0, [r7] - movs r6, 0x1 -_0818ADF6: - adds r0, r6, 0 - add sp, 0x90 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_818A660 - - thumb_func_start sub_818AE0C -sub_818AE0C: @ 818AE0C - push {lr} - bl sub_818A514 - pop {r0} - bx r0 - thumb_func_end sub_818AE0C - - thumb_func_start sub_818AE18 -sub_818AE18: @ 818AE18 - push {r4,r5,lr} - ldr r1, =gBattleBufferA - ldr r0, =gActiveBank - ldrb r2, [r0] - lsls r0, r2, 9 - adds r1, 0x2 - adds r1, r0, r1 - ldrb r0, [r1] - cmp r0, 0 - bne _0818AE48 - ldr r0, =gBattlePartyID - lsls r1, r2, 1 - adds r1, r0 - ldrb r0, [r1] - bl sub_818AE70 - b _0818AE66 - .pool -_0818AE48: - ldrb r4, [r1] - movs r5, 0 -_0818AE4C: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _0818AE5A - adds r0, r5, 0 - bl sub_818AE70 -_0818AE5A: - lsrs r4, 1 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x5 - bls _0818AE4C -_0818AE66: - bl sub_818A514 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_818AE18 - - thumb_func_start sub_818AE70 -sub_818AE70: @ 818AE70 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x34 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gActiveBank - ldrb r0, [r0] - lsls r0, 9 - ldr r2, =gUnknown_02023067 - adds r3, r0, r2 - adds r6, r3, 0 - subs r1, r2, 0x2 - adds r0, r1 - ldrb r0, [r0] - adds r7, r2, 0 - cmp r0, 0x3B - bls _0818AE9C - bl _0818B836 -_0818AE9C: - lsls r0, 2 - ldr r1, =_0818AEB4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0818AEB4: - .4byte _0818AFA4 - .4byte _0818B13C - .4byte _0818B15C - .4byte _0818B17C - .4byte _0818B1D4 - .4byte _0818B1D4 - .4byte _0818B1D4 - .4byte _0818B1D4 - .4byte _0818B1FC - .4byte _0818B260 - .4byte _0818B260 - .4byte _0818B260 - .4byte _0818B260 - .4byte _0818B836 - .4byte _0818B836 - .4byte _0818B836 - .4byte _0818B836 - .4byte _0818B290 - .4byte _0818B2B0 - .4byte _0818B2D0 - .4byte _0818B2F0 - .4byte _0818B310 - .4byte _0818B330 - .4byte _0818B350 - .4byte _0818B370 - .4byte _0818B390 - .4byte _0818B3B0 - .4byte _0818B3D0 - .4byte _0818B3F0 - .4byte _0818B410 - .4byte _0818B430 - .4byte _0818B450 - .4byte _0818B4C0 - .4byte _0818B4E0 - .4byte _0818B500 - .4byte _0818B520 - .4byte _0818B540 - .4byte _0818B560 - .4byte _0818B580 - .4byte _0818B5A0 - .4byte _0818B5C0 - .4byte _0818B5E0 - .4byte _0818B600 - .4byte _0818B620 - .4byte _0818B640 - .4byte _0818B660 - .4byte _0818B680 - .4byte _0818B6A0 - .4byte _0818B6C0 - .4byte _0818B6E0 - .4byte _0818B700 - .4byte _0818B720 - .4byte _0818B740 - .4byte _0818B760 - .4byte _0818B780 - .4byte _0818B7A0 - .4byte _0818B7C0 - .4byte _0818B7E0 - .4byte _0818B800 - .4byte _0818B820 -_0818AFA4: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =gPlayerParty - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xB - adds r2, r6, 0 - bl SetMonData - adds r2, r6, 0 - adds r2, 0x2E - adds r0, r4, 0 - movs r1, 0xC - bl SetMonData - movs r0, 0 - mov r8, r0 - movs r0, 0x3B - adds r0, r6 - mov r10, r0 - adds r0, r6, 0 - adds r0, 0x2B - str r0, [sp, 0x20] - adds r0, 0x19 - str r0, [sp, 0x28] - adds r0, 0x4 - str r0, [sp, 0x2C] - adds r0, 0x4 - str r0, [sp, 0x30] - subs r0, 0x22 - str r0, [sp, 0x1C] - subs r0, 0x2 - str r0, [sp, 0x18] - adds r0, 0x4 - str r0, [sp, 0x24] - adds r0, r6, 0x2 - str r0, [sp, 0x4] - adds r0, r6, 0x4 - str r0, [sp, 0x8] - adds r0, r6, 0x6 - str r0, [sp, 0xC] - adds r0, 0x2 - str r0, [sp, 0x10] - adds r0, 0x2 - str r0, [sp, 0x14] - mov r9, r4 - adds r7, r6, 0 - adds r7, 0x24 - adds r4, r6, 0 - adds r4, 0xC -_0818B00A: - mov r1, r8 - adds r1, 0xD - mov r0, r9 - adds r2, r4, 0 - bl SetMonData - mov r1, r8 - adds r1, 0x11 - mov r0, r9 - adds r2, r7, 0 - bl SetMonData - adds r7, 0x1 - adds r4, 0x2 - movs r0, 0x1 - add r8, r0 - mov r0, r8 - cmp r0, 0x3 - ble _0818B00A - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =gPlayerParty - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x15 - mov r2, r10 - bl SetMonData - adds r0, r4, 0 - movs r1, 0x20 - ldr r2, [sp, 0x20] - bl SetMonData - adds r0, r4, 0 - movs r1, 0x19 - ldr r2, [sp, 0x28] - bl SetMonData - ldrb r0, [r6, 0x14] - lsls r0, 27 - lsrs r0, 27 - mov r1, sp - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x27 - mov r2, sp - bl SetMonData - mov r1, sp - ldrh r0, [r6, 0x14] - lsls r0, 22 - lsrs r0, 27 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x28 - mov r2, sp - bl SetMonData - mov r1, sp - ldrb r0, [r6, 0x15] - lsls r0, 25 - lsrs r0, 27 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x29 - mov r2, sp - bl SetMonData - mov r1, sp - ldr r0, [r6, 0x14] - lsls r0, 12 - lsrs r0, 27 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x2A - mov r2, sp - bl SetMonData - mov r1, sp - ldrh r0, [r6, 0x16] - lsls r0, 23 - lsrs r0, 27 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x2B - mov r2, sp - bl SetMonData - mov r1, sp - ldrb r0, [r6, 0x17] - lsls r0, 26 - lsrs r0, 27 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x2C - mov r2, sp - bl SetMonData - adds r0, r4, 0 - movs r1, 0 - ldr r2, [sp, 0x2C] - bl SetMonData - adds r0, r4, 0 - movs r1, 0x37 - ldr r2, [sp, 0x30] - bl SetMonData - adds r0, r4, 0 - movs r1, 0x38 - ldr r2, [sp, 0x1C] - bl SetMonData - adds r0, r4, 0 - movs r1, 0x39 - ldr r2, [sp, 0x18] - bl SetMonData - adds r0, r4, 0 - movs r1, 0x3A - ldr r2, [sp, 0x24] - bl SetMonData - adds r0, r4, 0 - movs r1, 0x3B - ldr r2, [sp, 0x4] - bl SetMonData - adds r0, r4, 0 - movs r1, 0x3C - ldr r2, [sp, 0x8] - bl SetMonData - adds r0, r4, 0 - movs r1, 0x3D - ldr r2, [sp, 0xC] - bl SetMonData - adds r0, r4, 0 - movs r1, 0x3E - ldr r2, [sp, 0x10] - bl SetMonData - adds r0, r4, 0 - movs r1, 0x3F - ldr r2, [sp, 0x14] - bl SetMonData - b _0818B836 - .pool -_0818B13C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0xB - bl SetMonData - b _0818B836 - .pool -_0818B15C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0xC - bl SetMonData - b _0818B836 - .pool -_0818B17C: - movs r0, 0 - mov r8, r0 - movs r0, 0xC - adds r0, r3 - mov r9, r0 - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =gPlayerParty - adds r7, r1, r0 - adds r6, r3, 0 - adds r6, 0x8 - adds r4, r3, 0 -_0818B196: - mov r1, r8 - adds r1, 0xD - adds r0, r7, 0 - adds r2, r4, 0 - bl SetMonData - mov r1, r8 - adds r1, 0x11 - adds r0, r7, 0 - adds r2, r6, 0 - bl SetMonData - adds r6, 0x1 - adds r4, 0x2 - movs r0, 0x1 - add r8, r0 - mov r0, r8 - cmp r0, 0x3 - ble _0818B196 - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x15 - mov r2, r9 - bl SetMonData - b _0818B836 - .pool -_0818B1D4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r3, =gBattleBufferA - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r1, r3, 0x1 - adds r1, r2, r1 - ldrb r1, [r1] - adds r1, 0x9 - b _0818B278 - .pool -_0818B1FC: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =gPlayerParty - adds r4, r0 - ldr r5, =gActiveBank - ldrb r2, [r5] - lsls r2, 9 - adds r2, r7 - adds r0, r4, 0 - movs r1, 0x11 - bl SetMonData - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x1 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x12 - bl SetMonData - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x2 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x13 - bl SetMonData - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x3 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x14 - bl SetMonData - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x4 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x15 - bl SetMonData - b _0818B836 - .pool -_0818B260: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r3, =gBattleBufferA - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r1, r3, 0x1 - adds r1, r2, r1 - ldrb r1, [r1] - adds r1, 0x8 -_0818B278: - adds r3, 0x3 - adds r2, r3 - bl SetMonData - b _0818B836 - .pool -_0818B290: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1 - bl SetMonData - b _0818B836 - .pool -_0818B2B0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x19 - bl SetMonData - b _0818B836 - .pool -_0818B2D0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1A - bl SetMonData - b _0818B836 - .pool -_0818B2F0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1B - bl SetMonData - b _0818B836 - .pool -_0818B310: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1C - bl SetMonData - b _0818B836 - .pool -_0818B330: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1D - bl SetMonData - b _0818B836 - .pool -_0818B350: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1E - bl SetMonData - b _0818B836 - .pool -_0818B370: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1F - bl SetMonData - b _0818B836 - .pool -_0818B390: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x20 - bl SetMonData - b _0818B836 - .pool -_0818B3B0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x22 - bl SetMonData - b _0818B836 - .pool -_0818B3D0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x23 - bl SetMonData - b _0818B836 - .pool -_0818B3F0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x24 - bl SetMonData - b _0818B836 - .pool -_0818B410: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x25 - bl SetMonData - b _0818B836 - .pool -_0818B430: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x26 - bl SetMonData - b _0818B836 - .pool -_0818B450: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =gPlayerParty - adds r4, r0 - ldr r5, =gActiveBank - ldrb r2, [r5] - lsls r2, 9 - adds r2, r7 - adds r0, r4, 0 - movs r1, 0x27 - bl SetMonData - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x1 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x28 - bl SetMonData - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x2 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x29 - bl SetMonData - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x3 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x2A - bl SetMonData - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x4 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x2B - bl SetMonData - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x5 - adds r2, r0 - adds r0, r4, 0 - b _0818B570 - .pool -_0818B4C0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x27 - bl SetMonData - b _0818B836 - .pool -_0818B4E0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x28 - bl SetMonData - b _0818B836 - .pool -_0818B500: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x29 - bl SetMonData - b _0818B836 - .pool -_0818B520: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x2A - bl SetMonData - b _0818B836 - .pool -_0818B540: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x2B - bl SetMonData - b _0818B836 - .pool -_0818B560: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 -_0818B570: - movs r1, 0x2C - bl SetMonData - b _0818B836 - .pool -_0818B580: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0 - bl SetMonData - b _0818B836 - .pool -_0818B5A0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x9 - bl SetMonData - b _0818B836 - .pool -_0818B5C0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x37 - bl SetMonData - b _0818B836 - .pool -_0818B5E0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x38 - bl SetMonData - b _0818B836 - .pool -_0818B600: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x39 - bl SetMonData - b _0818B836 - .pool -_0818B620: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3A - bl SetMonData - b _0818B836 - .pool -_0818B640: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3B - bl SetMonData - b _0818B836 - .pool -_0818B660: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3C - bl SetMonData - b _0818B836 - .pool -_0818B680: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3D - bl SetMonData - b _0818B836 - .pool -_0818B6A0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3E - bl SetMonData - b _0818B836 - .pool -_0818B6C0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3F - bl SetMonData - b _0818B836 - .pool -_0818B6E0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x16 - bl SetMonData - b _0818B836 - .pool -_0818B700: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x17 - bl SetMonData - b _0818B836 - .pool -_0818B720: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x18 - bl SetMonData - b _0818B836 - .pool -_0818B740: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x21 - bl SetMonData - b _0818B836 - .pool -_0818B760: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x2F - bl SetMonData - b _0818B836 - .pool -_0818B780: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x30 - bl SetMonData - b _0818B836 - .pool -_0818B7A0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x32 - bl SetMonData - b _0818B836 - .pool -_0818B7C0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x33 - bl SetMonData - b _0818B836 - .pool -_0818B7E0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x34 - bl SetMonData - b _0818B836 - .pool -_0818B800: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x35 - bl SetMonData - b _0818B836 - .pool -_0818B820: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gActiveBank - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x36 - bl SetMonData -_0818B836: - ldr r2, =gBattlePartyID - ldr r0, =gActiveBank - ldrb r1, [r0] - lsls r0, r1, 1 - adds r0, r2 - ldrh r2, [r0] - movs r0, 0x64 - muls r0, r2 - ldr r2, =gPlayerParty - adds r0, r2 - bl sub_805E990 - add sp, 0x34 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818AE70 - - thumb_func_start sub_818B86C -sub_818B86C: @ 818B86C - push {r4-r7,lr} - ldr r1, =gBattlePartyID - ldr r7, =gActiveBank - ldrb r2, [r7] - lsls r0, r2, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - adds r3, r1, 0 - muls r3, r0 - ldr r4, =gBattleBufferA - lsls r2, 9 - adds r0, r4, 0x1 - adds r0, r2, r0 - ldrb r0, [r0] - ldr r1, =gPlayerParty - adds r0, r1 - adds r5, r3, r0 - movs r3, 0 - adds r0, r4, 0x2 - adds r2, r0 - ldrb r2, [r2] - cmp r3, r2 - bcs _0818B8C4 - adds r6, r4, 0 - adds r2, r7, 0 - adds r4, r0, 0 -_0818B8A2: - adds r1, r5, r3 - ldrb r0, [r2] - lsls r0, 9 - adds r0, 0x3 - adds r0, r3, r0 - adds r0, r6 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - ldrb r0, [r2] - lsls r0, 9 - adds r0, r4 - ldrb r0, [r0] - cmp r3, r0 - bcc _0818B8A2 -_0818B8C4: - bl sub_818A514 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818B86C - - thumb_func_start sub_818B8E0 -sub_818B8E0: @ 818B8E0 - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r0, =gBattlePartyID - mov r8, r0 - ldr r6, =gActiveBank - ldrb r1, [r6] - lsls r0, r1, 1 - add r0, r8 - ldrh r0, [r0] - movs r5, 0x64 - muls r0, r5 - ldr r4, =gPlayerParty - adds r0, r4 - bl sub_805DD7C - ldrb r0, [r6] - lsls r0, 1 - add r0, r8 - ldrh r0, [r0] - muls r0, r5 - adds r0, r4 - movs r1, 0xB - bl GetMonData - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldrb r0, [r6] - bl GetBankIdentity - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_806A068 - ldr r0, =gUnknown_0202499C - mov r8, r0 - ldrb r0, [r6] - movs r1, 0x2 - bl sub_80A5C6C - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldrb r0, [r6] - bl sub_80A6138 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldrb r0, [r6] - bl sub_80A82E4 - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - mov r0, r8 - adds r1, r5, 0 - adds r2, r4, 0 - bl CreateSprite - ldr r4, =gBankSpriteIds - ldrb r1, [r6] - adds r1, r4 - strb r0, [r1] - ldr r5, =gSprites - ldrb r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =0x0000ff10 - strh r1, [r0, 0x24] - ldrb r2, [r6] - adds r0, r2, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r2, [r0, 0x2E] - ldrb r3, [r6] - adds r0, r3, r4 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - lsls r3, 4 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r3 - strb r0, [r1, 0x5] - ldrb r2, [r6] - adds r4, r2, r4 - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =gUnknown_020244E4 - adds r2, r1 - ldrb r1, [r2] - bl StartSpriteAnim - ldr r1, =gBattleBankFunc - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_818A064 - str r1, [r0] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818B8E0 - - thumb_func_start sub_818B9FC -sub_818B9FC: @ 818B9FC - push {r4-r6,lr} - ldr r5, =gActiveBank - ldrb r0, [r5] - ldr r4, =gBattleBufferA - lsls r1, r0, 9 - adds r6, r4, 0x2 - adds r1, r6 - ldrb r1, [r1] - bl sub_805EF84 - ldr r2, =gBattlePartyID - ldrb r0, [r5] - lsls r1, r0, 1 - adds r1, r2 - lsls r0, 9 - adds r4, 0x1 - adds r0, r4 - ldrb r0, [r0] - strh r0, [r1] - ldrb r1, [r5] - lsls r0, r1, 1 - adds r0, r2 - ldrh r2, [r0] - movs r0, 0x64 - muls r0, r2 - ldr r2, =gPlayerParty - adds r0, r2 - bl sub_805DD7C - ldrb r0, [r5] - lsls r1, r0, 9 - adds r1, r6 - ldrb r1, [r1] - bl sub_818BA6C - ldr r1, =gBattleBankFunc - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_818A470 - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818B9FC - - thumb_func_start sub_818BA6C -sub_818BA6C: @ 818BA6C - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - lsls r1, 24 - lsrs r1, 24 - adds r0, r6, 0 - bl sub_805EF84 - ldr r0, =gBattlePartyID - lsls r2, r6, 1 - adds r2, r0 - ldr r0, =gBattleBufferA - lsls r1, r6, 9 - adds r0, 0x1 - adds r1, r0 - ldrb r0, [r1] - strh r0, [r2] - ldrh r1, [r2] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xB - bl GetMonData - mov r8, r0 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - ldr r0, =sub_805D714 - bl CreateInvisibleSpriteWithCallback - ldr r1, =gUnknown_03005D7C - mov r9, r1 - add r9, r6 - mov r1, r9 - strb r0, [r1] - adds r0, r6, 0 - bl GetBankIdentity - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, r8 - bl sub_806A068 - ldr r0, =gUnknown_0202499C - mov r10, r0 - adds r0, r6, 0 - movs r1, 0x2 - bl sub_80A5C6C - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - adds r0, r6, 0 - bl sub_80A6138 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r6, 0 - bl sub_80A82E4 - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - mov r0, r10 - adds r1, r5, 0 - adds r2, r4, 0 - bl CreateSprite - ldr r4, =gBankSpriteIds - adds r4, r6, r4 - strb r0, [r4] - ldr r5, =gSprites - mov r0, r9 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrb r1, [r4] - strh r1, [r0, 0x30] - mov r0, r9 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r6, [r0, 0x32] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r6, [r0, 0x2E] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - mov r1, r8 - strh r1, [r0, 0x32] - ldrb r0, [r4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - lsls r3, r6, 4 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r3 - strb r0, [r1, 0x5] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =gUnknown_020244E4 - adds r6, r1 - ldrb r1, [r6] - bl StartSpriteAnim - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r5, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =SpriteCallbackDummy - str r1, [r0] - movs r0, 0 - movs r1, 0xFF - bl sub_80753E8 - mov r1, r9 - ldrb r2, [r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r5 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r1, 0x2E] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818BA6C - - thumb_func_start sub_818BBE8 -sub_818BBE8: @ 818BBE8 - push {r4-r6,lr} - ldr r1, =gBattleBufferA - ldr r6, =gActiveBank - ldrb r2, [r6] - lsls r0, r2, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r3, [r0] - cmp r3, 0 - bne _0818BC30 - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - strb r3, [r0, 0x4] - ldr r1, =gBattleBankFunc - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_818BC78 - str r1, [r0] - b _0818BC66 - .pool -_0818BC30: - ldr r5, =gBankSpriteIds - adds r0, r2, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =gSprites - adds r0, r4 - bl FreeSpriteOamMatrix - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl DestroySprite - ldr r1, =gUnknown_03005D70 - ldrb r0, [r6] - adds r0, r1 - ldrb r0, [r0] - bl sub_8072984 - bl sub_818A514 -_0818BC66: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818BBE8 - - thumb_func_start sub_818BC78 -sub_818BC78: @ 818BC78 - push {r4-r6,lr} - ldr r6, =gUnknown_020244D0 - ldr r4, [r6] - ldr r5, =gActiveBank - ldrb r2, [r5] - ldr r1, [r4, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r3, r0, r1 - ldrb r0, [r3, 0x4] - cmp r0, 0 - beq _0818BCA0 - cmp r0, 0x1 - beq _0818BCCE - b _0818BCF6 - .pool -_0818BCA0: - ldr r1, [r4] - lsls r0, r2, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0818BCBA - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x5 - bl move_anim_start_t4 -_0818BCBA: - ldr r0, [r6] - ldrb r1, [r5] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x1 - strb r1, [r0, 0x4] - b _0818BCF6 -_0818BCCE: - ldrb r1, [r3] - movs r0, 0x40 - ands r0, r1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _0818BCF6 - strb r0, [r3, 0x4] - ldrb r2, [r5] - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x1 - bl move_anim_start_t4 - ldr r1, =gBattleBankFunc - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_818A1B0 - str r1, [r0] -_0818BCF6: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818BC78 - - thumb_func_start sub_818BD04 -sub_818BD04: @ 818BD04 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r0, =gBattleTypeFlags - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 18 - ands r0, r1 - cmp r0, 0 - beq _0818BD48 - movs r0, 0x40 - ands r1, r0 - cmp r1, 0 - beq _0818BD30 - bl sub_8185F40 - lsls r0, 24 - lsrs r4, r0, 24 - b _0818BD4C - .pool -_0818BD30: - ldr r2, =gUnknown_020229E8 - ldr r0, =gUnknown_0203C7B4 - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - b _0818BD4A - .pool -_0818BD48: - ldr r0, =gUnknown_020229E8 -_0818BD4A: - ldrb r4, [r0, 0x13] -_0818BD4C: - ldr r0, =gBattleTypeFlags - ldr r1, [r0] - movs r2, 0x40 - ands r1, r2 - adds r5, r0, 0 - cmp r1, 0 - beq _0818BD98 - ldr r0, =gActiveBank - ldrb r0, [r0] - bl GetBankIdentity - movs r1, 0x2 - ands r1, r0 - movs r0, 0x20 - mov r9, r0 - cmp r1, 0 - beq _0818BD72 - movs r1, 0x5A - mov r9, r1 -_0818BD72: - ldr r0, [r5] - movs r1, 0x80 - lsls r1, 15 - ands r0, r1 - cmp r0, 0 - beq _0818BD9C - movs r0, 0x5A - mov r9, r0 - ldr r1, =gUnknown_083054E0 - b _0818BD9E - .pool -_0818BD98: - movs r0, 0x50 - mov r9, r0 -_0818BD9C: - ldr r1, =gUnknown_08305D2C -_0818BD9E: - lsls r0, r4, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x8 - subs r0, r1 - lsls r0, 18 - movs r1, 0xA0 - lsls r1, 15 - adds r0, r1 - lsrs r7, r0, 16 - ldr r0, [r5] - movs r1, 0x80 - lsls r1, 15 - ands r0, r1 - cmp r0, 0 - bne _0818BDC0 - b _0818BEDC -_0818BDC0: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldrb r0, [r0, 0x8] - bl sub_806F000 - lsls r0, 16 - lsrs r4, r0, 16 - adds r5, r4, 0 - ldr r6, =gActiveBank - ldrb r1, [r6] - adds r0, r5, 0 - bl sub_805DF38 - ldrb r0, [r6] - bl GetBankIdentity - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl sub_806A1C0 - ldr r0, =gUnknown_0202499C - mov r8, r0 - lsls r4, r7, 16 - asrs r4, 16 - ldrb r0, [r6] - bl sub_80A82E4 - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - mov r0, r8 - mov r1, r9 - adds r2, r4, 0 - bl CreateSprite - ldr r4, =gBankSpriteIds - ldrb r1, [r6] - adds r1, r4 - strb r0, [r1] - ldr r0, =gTrainerFrontPicPaletteTable - lsls r5, 3 - adds r5, r0 - ldrh r0, [r5, 0x4] - bl IndexOfSpritePaletteTag - ldr r5, =gSprites - ldrb r1, [r6] - adds r1, r4 - ldrb r1, [r1] - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - adds r2, r5 - lsls r0, 4 - ldrb r3, [r2, 0x5] - movs r1, 0xF - ands r1, r3 - orrs r1, r0 - strb r1, [r2, 0x5] - ldrb r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0xF0 - strh r1, [r0, 0x24] - ldrb r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x30 - strh r1, [r0, 0x26] - ldrb r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =0x0000fffe - strh r1, [r0, 0x2E] - ldrb r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r5, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_805D7AC - str r1, [r0] - ldrb r0, [r6] - adds r0, r4 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r2, [r1, 0x1] - movs r0, 0x4 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x1] - ldrb r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3F - ldrb r1, [r0] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0] - b _0818BF72 - .pool -_0818BEDC: - ldr r5, =gActiveBank - ldrb r1, [r5] - adds r0, r4, 0 - bl sub_805DF84 - ldrb r0, [r5] - bl GetBankIdentity - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl template_build_for_pokemon_or_trainer - ldr r6, =gUnknown_0202499C - mov r8, r9 - lsls r4, r7, 16 - asrs r4, 16 - ldrb r0, [r5] - bl sub_80A82E4 - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - adds r0, r6, 0 - mov r1, r8 - adds r2, r4, 0 - bl CreateSprite - ldr r6, =gBankSpriteIds - ldrb r1, [r5] - adds r1, r6 - strb r0, [r1] - ldr r4, =gSprites - ldrb r3, [r5] - adds r0, r3, r6 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - lsls r3, 4 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r3 - strb r0, [r1, 0x5] - ldrb r0, [r5] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xF0 - strh r1, [r0, 0x24] - ldrb r0, [r5] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =0x0000fffe - strh r1, [r0, 0x2E] - ldrb r0, [r5] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r4, 0x1C - adds r0, r4 - ldr r1, =sub_805D7AC - str r1, [r0] -_0818BF72: - ldr r1, =gBattleBankFunc - ldr r0, =gActiveBank - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_81899B8 - str r1, [r0] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818BD04 - - thumb_func_start sub_818BFAC -sub_818BFAC: @ 818BFAC - push {lr} - bl sub_818A514 - pop {r0} - bx r0 - thumb_func_end sub_818BFAC - - thumb_func_start sub_818BFB8 -sub_818BFB8: @ 818BFB8 - push {r4-r6,lr} - ldr r6, =gBankSpriteIds - ldr r4, =gActiveBank - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r5, =gSprites - adds r0, r5 - bl oamt_add_pos2_onto_pos1 - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x23 - strh r1, [r0, 0x2E] - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =0x0000ffd8 - strh r1, [r0, 0x32] - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrh r1, [r0, 0x22] - strh r1, [r0, 0x36] - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r5, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_80A6EEC - str r1, [r0] - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =SpriteCallbackDummy - bl oamt_set_x3A_32 - ldr r1, =gBattleBankFunc - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_81899F0 - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818BFB8 - - thumb_func_start sub_818C064 -sub_818C064: @ 818C064 - push {r4-r6,lr} - ldr r6, =gUnknown_020244D0 - ldr r4, [r6] - ldr r5, =gActiveBank - ldrb r2, [r5] - ldr r0, [r4, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r3, r1, r0 - ldrb r0, [r3, 0x4] - cmp r0, 0 - bne _0818C0B8 - ldr r1, [r4] - lsls r0, r2, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0818C098 - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x5 - bl move_anim_start_t4 -_0818C098: - ldr r0, [r6] - ldrb r1, [r5] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x4] - adds r1, 0x1 - strb r1, [r0, 0x4] - b _0818C12E - .pool -_0818C0B8: - ldrb r1, [r3] - movs r0, 0x40 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _0818C12E - strb r4, [r3, 0x4] - ldr r2, =gBattlePartyID - ldrb r1, [r5] - lsls r0, r1, 1 - adds r0, r2 - ldrh r2, [r0] - movs r0, 0x64 - muls r0, r2 - ldr r2, =gPlayerParty - adds r0, r2 - bl sub_805E990 - movs r1, 0x40 - negs r1, r1 - movs r0, 0x10 - bl PlaySE12WithPanning - ldr r2, =gSprites - ldr r3, =gBankSpriteIds - ldrb r0, [r5] - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r4, [r0, 0x30] - ldrb r0, [r5] - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x5 - strh r1, [r0, 0x32] - ldrb r0, [r5] - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_8039C00 - str r1, [r0] - ldr r1, =gBattleBankFunc - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_818A114 - str r1, [r0] -_0818C12E: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818C064 - - thumb_func_start sub_818C150 -sub_818C150: @ 818C150 - push {lr} - bl sub_818A514 - pop {r0} - bx r0 - thumb_func_end sub_818C150 - - thumb_func_start sub_818C15C -sub_818C15C: @ 818C15C - push {lr} - bl sub_818A514 - pop {r0} - bx r0 - thumb_func_end sub_818C15C - - thumb_func_start sub_818C168 -sub_818C168: @ 818C168 - push {lr} - bl sub_818A514 - pop {r0} - bx r0 - thumb_func_end sub_818C168 - - thumb_func_start sub_818C174 -sub_818C174: @ 818C174 - push {lr} - bl sub_818A514 - pop {r0} - bx r0 - thumb_func_end sub_818C174 - - thumb_func_start sub_818C180 -sub_818C180: @ 818C180 - push {r4-r6,lr} - ldr r6, =gActiveBank - ldrb r0, [r6] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - beq _0818C192 - b _0818C2A6 -_0818C192: - ldr r0, =gBattleBufferA - mov r12, r0 - ldrb r2, [r6] - lsls r2, 9 - adds r0, 0x1 - adds r0, r2, r0 - ldrb r0, [r0] - mov r1, r12 - adds r1, 0x2 - adds r1, r2, r1 - ldrb r1, [r1] - lsls r1, 8 - orrs r0, r1 - ldr r5, =gUnknown_02038432 - mov r1, r12 - adds r1, 0x3 - adds r2, r1 - ldrb r1, [r2] - strb r1, [r5] - ldr r4, =gUnknown_02038408 - ldrb r2, [r6] - lsls r2, 9 - mov r1, r12 - adds r1, 0x4 - adds r1, r2, r1 - ldrb r3, [r1] - mov r1, r12 - adds r1, 0x5 - adds r2, r1 - ldrb r1, [r2] - lsls r1, 8 - orrs r3, r1 - strh r3, [r4] - ldr r4, =gUnknown_02038404 - ldrb r2, [r6] - lsls r2, 9 - mov r1, r12 - adds r1, 0x6 - adds r1, r2, r1 - ldrb r3, [r1] - mov r1, r12 - adds r1, 0x7 - adds r1, r2, r1 - ldrb r1, [r1] - lsls r1, 8 - orrs r3, r1 - mov r1, r12 - adds r1, 0x8 - adds r1, r2, r1 - ldrb r1, [r1] - lsls r1, 16 - orrs r3, r1 - mov r1, r12 - adds r1, 0x9 - adds r2, r1 - ldrb r1, [r2] - lsls r1, 24 - orrs r3, r1 - str r3, [r4] - ldr r3, =gUnknown_0203841A - ldrb r1, [r6] - lsls r1, 9 - mov r2, r12 - adds r2, 0xA - adds r1, r2 - ldrb r1, [r1] - strb r1, [r3] - ldr r4, =gUnknown_0203841C - ldrb r2, [r6] - lsls r2, 9 - mov r1, r12 - adds r1, 0xC - adds r1, r2, r1 - ldrb r3, [r1] - mov r1, r12 - adds r1, 0xD - adds r2, r1 - ldrb r1, [r2] - lsls r1, 8 - orrs r3, r1 - strh r3, [r4] - ldr r3, =gUnknown_02038400 - ldrb r2, [r6] - lsls r2, 9 - mov r1, r12 - adds r1, 0x10 - adds r2, r1 - str r2, [r3] - ldr r3, =gUnknown_020244BC - ldrb r1, [r6] - lsls r1, 2 - adds r1, r3 - ldr r2, [r2] - str r2, [r1] - ldrb r1, [r5] - bl sub_805DB8C - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - beq _0818C288 - bl sub_818A514 - b _0818C2A6 - .pool -_0818C288: - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldrb r1, [r6] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strb r3, [r0, 0x4] - ldr r1, =gBattleBankFunc - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_move_anim_2 - str r1, [r0] -_0818C2A6: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818C180 - - thumb_func_start bx_move_anim_2 -bx_move_anim_2: @ 818C2B8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r2, =gBattleBufferA - ldr r6, =gActiveBank - ldrb r3, [r6] - lsls r1, r3, 9 - adds r0, r2, 0x1 - mov r10, r0 - adds r0, r1, r0 - ldrb r4, [r0] - adds r5, r2, 0x2 - mov r9, r5 - adds r0, r1, r5 - ldrb r0, [r0] - lsls r0, 8 - orrs r4, r0 - adds r2, 0xB - adds r1, r2 - ldrb r1, [r1] - mov r8, r1 - ldr r7, =gUnknown_020244D0 - ldr r5, [r7] - ldr r1, [r5, 0x4] - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r2, [r0, 0x4] - cmp r2, 0x1 - beq _0818C350 - cmp r2, 0x1 - bgt _0818C310 - cmp r2, 0 - beq _0818C31A - b _0818C42C - .pool -_0818C310: - cmp r2, 0x2 - beq _0818C37A - cmp r2, 0x3 - beq _0818C3F0 - b _0818C42C -_0818C31A: - ldr r1, [r5] - lsls r0, r3, 2 - adds r1, r0, r1 - ldrb r2, [r1] - movs r0, 0xC - ands r0, r2 - cmp r0, 0x4 - bne _0818C33C - movs r0, 0x8 - orrs r0, r2 - strb r0, [r1] - ldrb r2, [r6] - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x5 - bl move_anim_start_t4 -_0818C33C: - ldr r0, [r7] - ldrb r1, [r6] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x1 - strb r1, [r0, 0x4] - b _0818C42C -_0818C350: - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0818C42C - movs r0, 0 - bl sub_805EB9C - adds r0, r4, 0 - bl move_anim_start_t1 - ldr r0, [r7] - ldrb r1, [r6] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x2 - strb r1, [r0, 0x4] - b _0818C42C -_0818C37A: - ldr r0, =gUnknown_020383F8 - ldr r0, [r0] - bl _call_via_r0 - ldr r0, =gUnknown_020383FD - ldrb r0, [r0] - cmp r0, 0 - bne _0818C42C - movs r0, 0x1 - bl sub_805EB9C - ldr r0, [r7] - ldrb r2, [r6] - ldr r1, [r0] - lsls r0, r2, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0818C3C8 - mov r0, r8 - cmp r0, 0x1 - bhi _0818C3C8 - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x6 - bl move_anim_start_t4 - ldr r0, [r7] - ldrb r1, [r6] - ldr r0, [r0] - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - strb r0, [r1] -_0818C3C8: - ldr r0, =gUnknown_020244D0 - ldr r2, [r0] - ldr r0, =gActiveBank - ldrb r1, [r0] - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x3 - strb r1, [r0, 0x4] - b _0818C42C - .pool -_0818C3F0: - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _0818C42C - bl sub_805E394 - ldrb r0, [r6] - lsls r2, r0, 9 - mov r3, r10 - adds r1, r2, r3 - ldrb r1, [r1] - add r2, r9 - ldrb r2, [r2] - lsls r2, 8 - orrs r1, r2 - bl sub_805E94C - ldr r0, [r7] - ldrb r1, [r6] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strb r4, [r0, 0x4] - bl sub_818A514 -_0818C42C: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end bx_move_anim_2 - - thumb_func_start sub_818C43C -sub_818C43C: @ 818C43C - push {r4,lr} - ldr r0, =gUnknown_02022E14 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_02022E16 - strh r1, [r0] - ldr r4, =gActiveBank - ldrb r0, [r4] - lsls r0, 9 - ldr r1, =gUnknown_02023066 - adds r0, r1 - ldrh r0, [r0] - bl battle_pick_message - ldr r0, =gUnknown_02022E2C - movs r1, 0 - bl battle_show_message_maybe - ldr r1, =gBattleBankFunc - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_818A220 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818C43C - - thumb_func_start sub_818C490 -sub_818C490: @ 818C490 - push {lr} - bl sub_818A514 - pop {r0} - bx r0 - thumb_func_end sub_818C490 - - thumb_func_start sub_818C49C -sub_818C49C: @ 818C49C - push {lr} - ldr r1, =gBattleCommunication - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - ldrb r1, [r1, 0x4] - lsrs r0, 1 - cmp r1, r0 - bcc _0818C4C6 - ldr r0, =gActiveBank - ldrb r0, [r0] - bl sub_8185054 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0x1 - movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb - bl sub_818A514 -_0818C4C6: - pop {r0} - bx r0 - .pool - thumb_func_end sub_818C49C - - thumb_func_start sub_818C4D8 -sub_818C4D8: @ 818C4D8 - push {lr} - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 10 - ands r0, r1 - cmp r0, 0 - beq _0818C508 - ldr r1, =gBattleBankFunc - ldr r0, =gActiveBank - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_818C49C - str r1, [r0] - b _0818C522 - .pool -_0818C508: - ldr r0, =gActiveBank - ldrb r0, [r0] - bl sub_8185054 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0x1 - movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb - bl sub_818A514 -_0818C522: - pop {r0} - bx r0 - .pool - thumb_func_end sub_818C4D8 - - thumb_func_start sub_818C52C -sub_818C52C: @ 818C52C - push {lr} - bl sub_818A514 - pop {r0} - bx r0 - thumb_func_end sub_818C52C - - thumb_func_start sub_818C538 -sub_818C538: @ 818C538 - push {r4,r5,lr} - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 10 - ands r0, r1 - cmp r0, 0 - beq _0818C560 - bl sub_805D19C - adds r2, r0, 0 - lsls r2, 16 - lsrs r2, 16 - movs r0, 0x1 - movs r1, 0xA - bl dp01_build_cmdbuf_x21_a_bb - b _0818C584 - .pool -_0818C560: - ldr r5, =gActiveBank - ldrb r0, [r5] - bl sub_8185054 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldrb r0, [r5] - bl sub_8185054 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 16 - orrs r2, r4 - movs r0, 0x1 - movs r1, 0xA - bl dp01_build_cmdbuf_x21_a_bb -_0818C584: - bl sub_818A514 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818C538 - - thumb_func_start sub_818C594 -sub_818C594: @ 818C594 - push {lr} - bl sub_818A514 - pop {r0} - bx r0 - thumb_func_end sub_818C594 - - thumb_func_start sub_818C5A0 -sub_818C5A0: @ 818C5A0 - push {r4,lr} - ldr r4, =gActiveBank - ldrb r0, [r4] - bl sub_8185054 - ldrb r1, [r4] - ldr r3, =gBattleStruct - ldr r2, [r3] - adds r1, r2 - adds r1, 0x5C - strb r0, [r1] - ldrb r0, [r4] - ldr r1, [r3] - adds r0, r1 - adds r0, 0x5C - ldrb r1, [r0] - movs r0, 0x1 - movs r2, 0 - bl dp01_build_cmdbuf_x22_a_three_bytes - bl sub_818A514 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818C5A0 - - thumb_func_start sub_818C5DC -sub_818C5DC: @ 818C5DC - push {lr} - bl sub_818A514 - pop {r0} - bx r0 - thumb_func_end sub_818C5DC - - thumb_func_start sub_818C5E8 -sub_818C5E8: @ 818C5E8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - movs r0, 0 - bl load_gfxc_health_bar - ldr r3, =gBattleBufferA - ldr r0, =gActiveBank - mov r9, r0 - ldrb r4, [r0] - lsls r2, r4, 9 - adds r0, r3, 0x2 - adds r0, r2, r0 - ldrb r1, [r0] - adds r3, 0x3 - adds r2, r3 - ldrb r0, [r2] - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - asrs r7, r1, 16 - ldr r0, =0x00007fff - cmp r7, r0 - beq _0818C678 - ldr r6, =gBattlePartyID - lsls r0, r4, 1 - adds r0, r6 - ldrh r0, [r0] - movs r5, 0x64 - muls r0, r5 - ldr r4, =gPlayerParty - adds r0, r4 - movs r1, 0x3A - bl GetMonData - mov r8, r0 - mov r1, r9 - ldrb r0, [r1] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - muls r0, r5 - adds r0, r4 - movs r1, 0x39 - bl GetMonData - adds r3, r0, 0 - mov r1, r9 - ldrb r0, [r1] - ldr r1, =gUnknown_03005D70 - adds r1, r0, r1 - ldrb r1, [r1] - str r7, [sp] - mov r2, r8 - bl sub_807294C - b _0818C6B2 - .pool -_0818C678: - ldr r1, =gBattlePartyID - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x3A - bl GetMonData - adds r2, r0, 0 - mov r1, r9 - ldrb r0, [r1] - ldr r4, =gUnknown_03005D70 - adds r1, r0, r4 - ldrb r1, [r1] - str r7, [sp] - movs r3, 0 - bl sub_807294C - mov r1, r9 - ldrb r0, [r1] - adds r0, r4 - ldrb r0, [r0] - movs r1, 0 - movs r2, 0 - bl heathbar_draw_hp -_0818C6B2: - ldr r1, =gBattleBankFunc - ldr r0, =gActiveBank - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_818A0A4 - str r1, [r0] - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818C5E8 - - thumb_func_start sub_818C6E8 -sub_818C6E8: @ 818C6E8 - push {lr} - bl sub_818A514 - pop {r0} - bx r0 - thumb_func_end sub_818C6E8 - - thumb_func_start sub_818C6F4 -sub_818C6F4: @ 818C6F4 - push {r4,lr} - ldr r4, =gActiveBank - ldrb r0, [r4] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - bne _0818C748 - ldr r0, =gUnknown_03005D70 - ldrb r1, [r4] - adds r0, r1, r0 - ldrb r0, [r0] - ldr r2, =gBattlePartyID - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =gPlayerParty - adds r1, r2 - movs r2, 0x9 - bl healthbar_draw_field_maybe - ldrb r2, [r4] - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x11 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r1, =gBattleBankFunc - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_818A58C - str r1, [r0] -_0818C748: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818C6F4 - - thumb_func_start sub_818C76C -sub_818C76C: @ 818C76C - push {r4,r5,lr} - ldr r5, =gActiveBank - ldrb r0, [r5] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - bne _0818C7BC - ldr r4, =gBattleBufferA - ldrb r3, [r5] - lsls r3, 9 - adds r0, r4, 0x1 - adds r0, r3, r0 - ldrb r0, [r0] - adds r1, r4, 0x2 - adds r1, r3, r1 - ldrb r1, [r1] - adds r2, r4, 0x3 - adds r2, r3, r2 - ldrb r2, [r2] - lsls r2, 8 - orrs r1, r2 - adds r2, r4, 0x4 - adds r2, r3, r2 - ldrb r2, [r2] - lsls r2, 16 - orrs r1, r2 - adds r4, 0x5 - adds r3, r4 - ldrb r2, [r3] - lsls r2, 24 - orrs r1, r2 - bl move_anim_start_t2_for_situation - ldr r1, =gBattleBankFunc - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_818A58C - str r1, [r0] -_0818C7BC: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818C76C - - thumb_func_start sub_818C7D4 -sub_818C7D4: @ 818C7D4 - push {lr} - bl sub_818A514 - pop {r0} - bx r0 - thumb_func_end sub_818C7D4 - - thumb_func_start sub_818C7E0 -sub_818C7E0: @ 818C7E0 - push {lr} - bl sub_818A514 - pop {r0} - bx r0 - thumb_func_end sub_818C7E0 - - thumb_func_start sub_818C7EC -sub_818C7EC: @ 818C7EC - push {lr} - bl sub_818A514 - pop {r0} - bx r0 - thumb_func_end sub_818C7EC - - thumb_func_start sub_818C7F8 -sub_818C7F8: @ 818C7F8 - push {lr} - bl sub_818A514 - pop {r0} - bx r0 - thumb_func_end sub_818C7F8 - - thumb_func_start sub_818C804 -sub_818C804: @ 818C804 - push {lr} - bl sub_818A514 - pop {r0} - bx r0 - thumb_func_end sub_818C804 - - thumb_func_start sub_818C810 -sub_818C810: @ 818C810 - push {lr} - bl sub_818A514 - pop {r0} - bx r0 - thumb_func_end sub_818C810 - - thumb_func_start sub_818C81C -sub_818C81C: @ 818C81C - push {lr} - bl sub_818A514 - pop {r0} - bx r0 - thumb_func_end sub_818C81C - - thumb_func_start sub_818C828 -sub_818C828: @ 818C828 - push {lr} - bl sub_818A514 - pop {r0} - bx r0 - thumb_func_end sub_818C828 - - thumb_func_start sub_818C834 -sub_818C834: @ 818C834 - push {lr} - bl sub_818A514 - pop {r0} - bx r0 - thumb_func_end sub_818C834 - - thumb_func_start sub_818C840 -sub_818C840: @ 818C840 - push {lr} - ldr r2, =gUnknown_02022D0C - ldrb r1, [r2] - movs r0, 0x80 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - bl sub_818A514 - pop {r0} - bx r0 - .pool - thumb_func_end sub_818C840 - - thumb_func_start sub_818C85C -sub_818C85C: @ 818C85C - push {lr} - ldr r3, =gUnknown_02022D0C - ldr r1, =gBattleBufferA - ldr r0, =gActiveBank - ldrb r0, [r0] - lsls r0, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - movs r1, 0x7F - ands r1, r0 - ldrb r2, [r3] - movs r0, 0x80 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - bl sub_818A514 - pop {r0} - bx r0 - .pool - thumb_func_end sub_818C85C - - thumb_func_start sub_818C894 -sub_818C894: @ 818C894 - push {lr} - ldr r2, =gUnknown_02022D0C - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - bl sub_818A514 - pop {r0} - bx r0 - .pool - thumb_func_end sub_818C894 - - thumb_func_start sub_818C8AC -sub_818C8AC: @ 818C8AC - push {lr} - ldr r3, =gUnknown_02022D0C - ldr r1, [r3] - lsls r1, 24 - lsrs r1, 31 - movs r0, 0x1 - eors r1, r0 - lsls r1, 7 - ldrb r2, [r3] - movs r0, 0x7F - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - bl sub_818A514 - pop {r0} - bx r0 - .pool - thumb_func_end sub_818C8AC - - thumb_func_start sub_818C8D4 -sub_818C8D4: @ 818C8D4 - push {r4,lr} - ldr r3, =gSprites - ldr r2, =gBankSpriteIds - ldr r4, =gActiveBank - ldrb r0, [r4] - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - bge _0818C908 - bl sub_818A514 - b _0818C932 - .pool -_0818C908: - ldr r1, =gDoingBattleAnim - movs r0, 0x1 - strb r0, [r1] - ldrb r0, [r4] - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r1, 0 - strh r1, [r0, 0x30] - ldrb r0, [r4] - bl sub_80769F4 - ldr r1, =gBattleBankFunc - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_818A238 - str r1, [r0] -_0818C932: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818C8D4 - - thumb_func_start sub_818C944 -sub_818C944: @ 818C944 - push {lr} - bl sub_818A514 - pop {r0} - bx r0 - thumb_func_end sub_818C944 - - thumb_func_start sub_818C950 -sub_818C950: @ 818C950 - push {r4,lr} - ldr r4, =gActiveBank - ldrb r0, [r4] - bl GetBankSide - lsls r0, 24 - movs r3, 0x3F - cmp r0, 0 - bne _0818C964 - movs r3, 0xC0 -_0818C964: - ldr r2, =gBattleBufferA - ldrb r1, [r4] - lsls r1, 9 - adds r0, r2, 0x1 - adds r0, r1, r0 - ldrb r0, [r0] - adds r2, 0x2 - adds r1, r2 - ldrb r1, [r1] - lsls r1, 8 - orrs r0, r1 - lsls r1, r3, 24 - asrs r1, 24 - bl PlaySE12WithPanning - bl sub_818A514 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818C950 - - thumb_func_start sub_818C994 -sub_818C994: @ 818C994 - push {r4,r5,lr} - ldr r4, =gBattleBufferA - ldr r5, =gActiveBank - ldrb r0, [r5] - lsls r3, r0, 9 - adds r0, r4, 0x3 - adds r0, r3, r0 - ldrb r0, [r0] - cmp r0, 0 - beq _0818C9D0 - bl sub_805EA60 - ldrb r1, [r5] - lsls r1, 9 - adds r0, r4, 0x1 - adds r0, r1, r0 - ldrb r0, [r0] - adds r2, r4, 0x2 - adds r1, r2 - ldrb r1, [r1] - lsls r1, 8 - orrs r0, r1 - bl PlayBGM - b _0818C9E4 - .pool -_0818C9D0: - adds r0, r4, 0x1 - adds r0, r3, r0 - ldrb r0, [r0] - adds r1, r4, 0x2 - adds r1, r3, r1 - ldrb r1, [r1] - lsls r1, 8 - orrs r0, r1 - bl PlayFanfare -_0818C9E4: - bl sub_818A514 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_818C994 - - thumb_func_start sub_818C9F0 -sub_818C9F0: @ 818C9F0 - push {lr} - ldr r1, =gBattlePartyID - ldr r0, =gActiveBank - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x19 - negs r1, r1 - movs r2, 0x5 - bl PlayCry3 - bl sub_818A514 - pop {r0} - bx r0 - .pool - thumb_func_end sub_818C9F0 - - thumb_func_start dp01t_2E_2_battle_intro -dp01t_2E_2_battle_intro: @ 818CA30 - push {lr} - ldr r1, =gBattleBufferA - ldr r0, =gActiveBank - ldrb r0, [r0] - lsls r0, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - bl battle_intro_launch - ldr r2, =gUnknown_020243FC - ldrh r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strh r0, [r2] - bl sub_818A514 - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_2E_2_battle_intro - - thumb_func_start sub_818CA64 -sub_818CA64: @ 818CA64 - push {r4-r6,lr} - ldr r5, =gBankSpriteIds - ldr r6, =gActiveBank - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =gSprites - adds r0, r4 - bl oamt_add_pos2_onto_pos1 - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x32 - strh r1, [r0, 0x2E] - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =0x0000ffd8 - strh r1, [r0, 0x32] - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x22] - strh r1, [r0, 0x36] - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r4, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_80A6EEC - str r1, [r0] - ldrb r2, [r6] - adds r0, r2, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r2, [r0, 0x38] - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =sub_805CC00 - bl oamt_set_x3A_32 - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x1 - bl StartSpriteAnim - ldr r0, =0x0000d6f9 - bl AllocSpritePalette - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 18 - ands r0, r1 - cmp r0, 0 - beq _0818CB54 - ldr r4, =gUnknown_020229E8 - ldrb r0, [r6] - bl sub_806D864 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r0, [r1, 0x13] - b _0818CB5A - .pool -_0818CB54: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldrb r0, [r0, 0x8] -_0818CB5A: - ldr r1, =gTrainerBackPicPaletteTable - lsls r0, 3 - adds r0, r1 - ldr r0, [r0] - lsls r4, r5, 4 - movs r2, 0x80 - lsls r2, 1 - adds r1, r4, r2 - movs r2, 0x20 - bl LoadCompressedPalette - ldr r2, =gSprites - ldr r1, =gBankSpriteIds - ldr r5, =gActiveBank - ldrb r0, [r5] - adds r0, r1 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r4 - strb r0, [r1, 0x5] - ldr r0, =sub_818CC24 - movs r1, 0x5 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r4, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r4 - ldrb r0, [r5] - strh r0, [r1, 0x8] - ldr r3, =gUnknown_020244D0 - ldr r0, [r3] - ldrb r2, [r5] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0818CBD4 - ldr r0, =gUnknown_020244B4 - adds r0, r2, r0 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - ldr r1, =sub_8073C30 - str r1, [r0] -_0818CBD4: - ldr r0, [r3] - ldr r2, [r0, 0x8] - ldrb r0, [r2, 0x9] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x9] - ldr r1, =gBattleBankFunc - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =nullsub_120 - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818CA64 - - thumb_func_start sub_818CC24 -sub_818CC24: @ 818CC24 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r1, =gTasks - lsls r0, 2 - add r0, r8 - lsls r0, 3 - adds r1, r0, r1 - ldrh r2, [r1, 0xA] - movs r3, 0xA - ldrsh r0, [r1, r3] - cmp r0, 0x17 - bgt _0818CC50 - adds r0, r2, 0x1 - strh r0, [r1, 0xA] - b _0818CD0C - .pool -_0818CC50: - ldr r7, =gActiveBank - ldrb r0, [r7] - mov r9, r0 - ldrh r0, [r1, 0x8] - strb r0, [r7] - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _0818CC70 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0818CCA0 -_0818CC70: - ldr r0, =gBattleBufferA - ldrb r1, [r7] - lsls r2, r1, 9 - adds r0, 0x1 - adds r2, r0 - ldr r0, =gBattlePartyID - lsls r1, 1 - adds r1, r0 - ldrh r0, [r1] - strb r0, [r2] - ldrb r0, [r7] - movs r1, 0 - bl sub_818BA6C - b _0818CCF4 - .pool -_0818CCA0: - ldr r4, =gBattleBufferA - ldrb r0, [r7] - lsls r1, r0, 9 - adds r4, 0x1 - adds r1, r4 - ldr r5, =gBattlePartyID - lsls r0, 1 - adds r0, r5 - ldrh r0, [r0] - strb r0, [r1] - ldrb r0, [r7] - movs r1, 0 - bl sub_818BA6C - ldrb r0, [r7] - movs r6, 0x2 - eors r0, r6 - strb r0, [r7] - ldrb r0, [r7] - lsls r1, r0, 9 - adds r1, r4 - lsls r0, 1 - adds r0, r5 - ldrh r0, [r0] - strb r0, [r1] - ldrb r1, [r7] - lsls r0, r1, 1 - adds r0, r5 - ldrh r2, [r0] - movs r0, 0x64 - muls r0, r2 - ldr r2, =gPlayerParty - adds r0, r2 - bl sub_805DD7C - ldrb r0, [r7] - movs r1, 0 - bl sub_818BA6C - ldrb r0, [r7] - eors r0, r6 - strb r0, [r7] -_0818CCF4: - ldr r1, =gBattleBankFunc - ldr r2, =gActiveBank - ldrb r0, [r2] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8189D40 - str r1, [r0] - mov r3, r9 - strb r3, [r2] - mov r0, r8 - bl DestroyTask -_0818CD0C: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818CC24 - - thumb_func_start sub_818CD30 -sub_818CD30: @ 818CD30 - push {r4-r6,lr} - ldr r1, =gBattleBufferA - ldr r0, =gActiveBank - ldrb r2, [r0] - lsls r0, r2, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _0818CD60 - adds r0, r2, 0 - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _0818CD60 - bl sub_818A514 - b _0818CDD4 - .pool -_0818CD60: - ldr r6, =gUnknown_020244D0 - ldr r0, [r6] - ldr r5, =gActiveBank - ldrb r1, [r5] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0] - ldrb r0, [r5] - lsls r3, r0, 9 - ldr r4, =gUnknown_02023068 - adds r1, r3, r4 - subs r2, r4, 0x3 - adds r2, r3, r2 - ldrb r2, [r2] - subs r4, 0x2 - adds r3, r4 - ldrb r3, [r3] - bl sub_80735DC - ldr r2, =gUnknown_020244B4 - ldrb r1, [r5] - adds r1, r2 - movs r3, 0 - strb r0, [r1] - ldr r0, [r6] - ldrb r1, [r5] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strb r3, [r0, 0x5] - ldrb r2, [r5] - lsls r0, r2, 9 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - beq _0818CDC8 - ldr r0, [r6] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - movs r1, 0x5D - strb r1, [r0, 0x5] -_0818CDC8: - ldr r0, =gBattleBankFunc - ldrb r1, [r5] - lsls r1, 2 - adds r1, r0 - ldr r0, =bx_increment_dp11b_field_5_till_x60_then_resume - str r0, [r1] -_0818CDD4: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818CD30 - - thumb_func_start bx_increment_dp11b_field_5_till_x60_then_resume -bx_increment_dp11b_field_5_till_x60_then_resume: @ 818CDF4 - push {r4,lr} - ldr r4, =gUnknown_020244D0 - ldr r0, [r4] - ldr r3, =gActiveBank - ldrb r1, [r3] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x5] - adds r2, r1, 0x1 - strb r2, [r0, 0x5] - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0x5C - bls _0818CE2C - ldr r0, [r4] - ldrb r1, [r3] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0 - strb r1, [r0, 0x5] - bl sub_818A514 -_0818CE2C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end bx_increment_dp11b_field_5_till_x60_then_resume - - thumb_func_start sub_818CE3C -sub_818CE3C: @ 818CE3C - push {lr} - ldr r0, =gUnknown_020244D0 - ldr r1, [r0] - ldr r0, =gActiveBank - ldrb r3, [r0] - ldr r1, [r1, 0x4] - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0818CE6E - ldr r2, =gTasks - ldr r0, =gUnknown_020244B4 - adds r0, r3, r0 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldr r1, =sub_8073C30 - str r1, [r0] -_0818CE6E: - bl sub_818A514 - pop {r0} - bx r0 - .pool - thumb_func_end sub_818CE3C - - thumb_func_start sub_818CE8C -sub_818CE8C: @ 818CE8C - push {lr} - bl sub_818A514 - pop {r0} - bx r0 - thumb_func_end sub_818CE8C - - thumb_func_start sub_818CE98 -sub_818CE98: @ 818CE98 - push {r4,lr} - ldr r4, =gActiveBank - ldrb r0, [r4] - bl sub_80A6A90 - lsls r0, 24 - cmp r0, 0 - beq _0818CEDE - ldr r3, =gSprites - ldr r0, =gBankSpriteIds - ldrb r1, [r4] - adds r0, r1, r0 - ldrb r0, [r0] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r3 - ldr r0, =gBattleBufferA - lsls r1, 9 - adds r0, 0x1 - adds r1, r0 - adds r2, 0x3E - movs r0, 0x1 - ldrb r1, [r1] - ands r1, r0 - lsls r1, 2 - ldrb r3, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - ldrb r0, [r4] - bl sub_805E408 -_0818CEDE: - bl sub_818A514 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818CE98 - - thumb_func_start sub_818CEF8 -sub_818CEF8: @ 818CEF8 - push {r4-r6,lr} - sub sp, 0x4 - ldr r6, =gActiveBank - ldrb r0, [r6] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - bne _0818CF50 - ldr r5, =gBattleBufferA - ldrb r2, [r6] - lsls r1, r2, 9 - adds r0, r5, 0x1 - adds r0, r1, r0 - ldrb r3, [r0] - adds r0, r5, 0x2 - adds r0, r1, r0 - ldrb r4, [r0] - adds r5, 0x3 - adds r1, r5 - ldrb r0, [r1] - lsls r0, 8 - orrs r4, r0 - str r4, [sp] - adds r0, r2, 0 - adds r1, r2, 0 - bl move_anim_start_t3 - lsls r0, 24 - cmp r0, 0 - beq _0818CF44 - bl sub_818A514 - b _0818CF50 - .pool -_0818CF44: - ldr r0, =gBattleBankFunc - ldrb r1, [r6] - lsls r1, 2 - adds r1, r0 - ldr r0, =sub_818A5BC - str r0, [r1] -_0818CF50: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818CEF8 - - thumb_func_start sub_818CF60 -sub_818CF60: @ 818CF60 - push {lr} - bl sub_818A514 - pop {r0} - bx r0 - thumb_func_end sub_818CF60 - - thumb_func_start sub_818CF6C -sub_818CF6C: @ 818CF6C - push {lr} - bl sub_818A514 - pop {r0} - bx r0 - thumb_func_end sub_818CF6C - - thumb_func_start sub_818CF78 -sub_818CF78: @ 818CF78 - push {r4,lr} - ldr r2, =gBattleOutcome - ldr r1, =gBattleBufferA - ldr r4, =gActiveBank - ldrb r0, [r4] - lsls r0, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - movs r0, 0x5 - bl FadeOutMapMusic - movs r0, 0x3 - bl BeginFastPaletteFade - bl sub_818A514 - ldr r1, =gBattleBankFunc - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_80587B0 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818CF78 - - thumb_func_start nullsub_121 -nullsub_121: @ 818CFC4 - bx lr - thumb_func_end nullsub_121 - - thumb_func_start nullsub_122 -nullsub_122: @ 818CFC8 - bx lr - thumb_func_end nullsub_122 - - thumb_func_start dp13_810BB8C -dp13_810BB8C: @ 818CFCC - push {r4-r7,lr} - ldr r4, =gUnknown_0860B058 - ldr r3, =gUnknown_0203CD04 - movs r2, 0x7 -_0818CFD4: - adds r1, r3, 0 - adds r0, r4, 0 - ldm r0!, {r5-r7} - stm r1!, {r5-r7} - adds r3, 0xC - subs r2, 0x1 - cmp r2, 0 - bge _0818CFD4 - movs r0, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end dp13_810BB8C - - thumb_func_start load_pokemon_image_TODO -@ int load_pokemon_image_TODO(int species_num, unsigned int a2, u8 a3, void *a4, int a5, u8 a6) -load_pokemon_image_TODO: @ 818CFF4 - push {r4-r7,lr} - sub sp, 0x4 - adds r6, r1, 0 - adds r5, r3, 0 - ldr r3, [sp, 0x18] - ldr r1, [sp, 0x1C] - lsls r0, 16 - lsrs r4, r0, 16 - adds r7, r4, 0 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsls r1, 24 - lsrs r1, 24 - adds r0, r1, 0 - cmp r3, 0 - bne _0818D068 - cmp r2, 0 - beq _0818D034 - cmp r1, 0 - bne _0818D028 - lsls r0, r4, 3 - ldr r1, =gMonFrontPicTable - b _0818D03C - .pool -_0818D028: - lsls r0, r4, 3 - ldr r1, =gMonFrontPicTable - b _0818D054 - .pool -_0818D034: - cmp r0, 0 - bne _0818D050 - lsls r0, r4, 3 - ldr r1, =gMonBackPicTable -_0818D03C: - adds r0, r1 - str r2, [sp] - adds r1, r5, 0 - adds r2, r4, 0 - adds r3, r6, 0 - bl LoadSpecialPokePic - b _0818D08E - .pool -_0818D050: - lsls r0, r4, 3 - ldr r1, =gMonBackPicTable -_0818D054: - adds r0, r1 - str r2, [sp] - adds r1, r5, 0 - adds r2, r4, 0 - adds r3, r6, 0 - bl LoadSpecialPokePic_DontHandleDeoxys - b _0818D08E - .pool -_0818D068: - cmp r2, 0 - beq _0818D080 - lsls r0, r4, 3 - ldr r1, =gTrainerFrontPicTable - adds r0, r1 - adds r1, r5, 0 - adds r2, r4, 0 - bl DecompressPicFromTable - b _0818D08E - .pool -_0818D080: - lsls r0, r7, 3 - ldr r1, =gTrainerBackPicTable - adds r0, r1 - adds r1, r5, 0 - adds r2, r7, 0 - bl DecompressPicFromTable -_0818D08E: - movs r0, 0 - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end load_pokemon_image_TODO - - thumb_func_start sub_818D09C -sub_818D09C: @ 818D09C - push {r4,lr} - sub sp, 0x8 - ldr r4, [sp, 0x10] - lsls r0, 16 - lsrs r0, 16 - lsls r2, 24 - lsrs r2, 24 - lsls r4, 24 - lsrs r4, 24 - str r4, [sp] - movs r4, 0 - str r4, [sp, 0x4] - bl load_pokemon_image_TODO - lsls r0, 16 - lsrs r0, 16 - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_818D09C - - thumb_func_start sub_818D0C4 -sub_818D0C4: @ 818D0C4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r7, r1, 0 - mov r8, r2 - ldr r1, [sp, 0x18] - ldr r2, [sp, 0x1C] - lsls r0, 16 - lsrs r4, r0, 16 - adds r6, r4, 0 - lsls r3, 24 - lsrs r5, r3, 24 - mov r12, r5 - lsls r1, 16 - lsrs r3, r1, 16 - adds r1, r3, 0 - lsls r2, 24 - cmp r2, 0 - bne _0818D128 - ldr r0, =0x0000ffff - cmp r3, r0 - bne _0818D110 - ldr r2, =gUnknown_0203CCEC - ldrh r1, [r2, 0x2] - adds r0, r3, 0 - orrs r0, r1 - strh r0, [r2, 0x2] - adds r0, r4, 0 - adds r1, r7, 0 - mov r2, r8 - bl species_and_otid_get_pal - lsls r1, r5, 20 - b _0818D144 - .pool -_0818D110: - ldr r0, =gUnknown_0203CCEC - strh r3, [r0, 0x2] - adds r0, r4, 0 - adds r1, r7, 0 - mov r2, r8 - bl sub_806E7CC - bl LoadCompressedObjectPalette - b _0818D16E - .pool -_0818D128: - ldr r0, =0x0000ffff - cmp r3, r0 - bne _0818D160 - ldr r2, =gUnknown_0203CCEC - ldrh r1, [r2, 0x2] - adds r0, r3, 0 - orrs r0, r1 - strh r0, [r2, 0x2] - ldr r1, =gTrainerFrontPicPaletteTable - lsls r0, r4, 3 - adds r0, r1 - ldr r0, [r0] - mov r2, r12 - lsls r1, r2, 20 -_0818D144: - movs r2, 0x80 - lsls r2, 17 - adds r1, r2 - lsrs r1, 16 - movs r2, 0x20 - bl LoadCompressedPalette - b _0818D16E - .pool -_0818D160: - ldr r0, =gUnknown_0203CCEC - strh r1, [r0, 0x2] - lsls r0, r6, 3 - ldr r1, =gTrainerFrontPicPaletteTable - adds r0, r1 - bl LoadCompressedObjectPalette -_0818D16E: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818D0C4 - - thumb_func_start sub_818D180 -sub_818D180: @ 818D180 - push {r4,r5,lr} - adds r5, r1, 0 - ldr r1, [sp, 0xC] - lsls r0, 16 - lsrs r0, 16 - lsls r3, 24 - lsrs r4, r3, 24 - lsls r1, 24 - cmp r1, 0 - bne _0818D1A4 - adds r1, r5, 0 - bl species_and_otid_get_pal - lsls r1, r4, 4 - movs r2, 0x20 - bl LoadCompressedPalette - b _0818D1B4 -_0818D1A4: - ldr r1, =gTrainerFrontPicPaletteTable - lsls r0, 3 - adds r0, r1 - ldr r0, [r0] - lsls r1, r4, 4 - movs r2, 0x20 - bl LoadCompressedPalette -_0818D1B4: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818D180 - - thumb_func_start uns_builder_assign_animtable1 -uns_builder_assign_animtable1: @ 818D1C0 - push {lr} - lsls r0, 24 - cmp r0, 0 - bne _0818D1D8 - ldr r1, =gUnknown_0203CCEC - ldr r0, =gUnknown_082FF70C - str r0, [r1, 0x8] - b _0818D1E0 - .pool -_0818D1D8: - ldr r0, =gUnknown_0203CCEC - ldr r1, =gUnknown_0830536C - ldr r1, [r1] - str r1, [r0, 0x8] -_0818D1E0: - pop {r0} - bx r0 - .pool - thumb_func_end uns_builder_assign_animtable1 - - thumb_func_start oamt_spawn_poke_or_trainer_picture -oamt_spawn_poke_or_trainer_picture: @ 818D1EC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x30 - str r1, [sp, 0xC] - str r2, [sp, 0x10] - ldr r1, [sp, 0x50] - ldr r2, [sp, 0x54] - ldr r4, [sp, 0x58] - ldr r5, [sp, 0x5C] - ldr r6, [sp, 0x60] - ldr r7, [sp, 0x64] - mov r8, r7 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x8] - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x14] - lsls r1, 16 - lsrs r1, 16 - str r1, [sp, 0x18] - lsls r2, 16 - lsrs r2, 16 - str r2, [sp, 0x1C] - lsls r4, 24 - lsrs r4, 24 - str r4, [sp, 0x20] - lsls r5, 16 - lsrs r5, 16 - mov r10, r5 - lsls r6, 24 - lsrs r6, 24 - mov r9, r6 - mov r0, r8 - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - ldr r1, =gUnknown_0203CD04 - ldrb r0, [r1, 0xB] - cmp r0, 0 - beq _0818D25C -_0818D244: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bhi _0818D25C - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0xB] - cmp r0, 0 - bne _0818D244 -_0818D25C: - cmp r4, 0x8 - beq _0818D280 - movs r0, 0x80 - lsls r0, 6 - bl Alloc - adds r7, r0, 0 - cmp r7, 0 - beq _0818D280 - movs r0, 0x20 - bl Alloc - mov r8, r0 - cmp r0, 0 - bne _0818D28C - adds r0, r7, 0 - bl Free -_0818D280: - ldr r0, =0x0000ffff - b _0818D356 - .pool -_0818D28C: - mov r1, r9 - str r1, [sp] - str r5, [sp, 0x4] - ldr r0, [sp, 0x8] - ldr r1, [sp, 0x10] - ldr r2, [sp, 0x14] - adds r3, r7, 0 - bl load_pokemon_image_TODO - lsls r0, 16 - cmp r0, 0 - bne _0818D280 - lsls r2, r4, 1 - str r2, [sp, 0x2C] - ldr r5, =gUnknown_0203CCEC - ldr r0, =gUnknown_0860B064 - mov r12, r0 - ldr r1, [sp, 0x18] - lsls r1, 16 - str r1, [sp, 0x24] - ldr r2, [sp, 0x1C] - lsls r2, 16 - str r2, [sp, 0x28] - movs r3, 0x80 - lsls r3, 4 - mov r0, r8 - adds r1, r7, 0 - adds r6, r3, 0 - movs r2, 0x3 -_0818D2C6: - str r1, [r0] - strh r3, [r0, 0x4] - adds r0, 0x8 - adds r1, r6 - subs r2, 0x1 - cmp r2, 0 - bge _0818D2C6 - ldr r0, =0x0000ffff - strh r0, [r5] - mov r0, r12 - str r0, [r5, 0x4] - mov r0, r9 - bl uns_builder_assign_animtable1 - mov r1, r8 - str r1, [r5, 0xC] - ldr r0, =gDummySpriteAffineAnimTable - str r0, [r5, 0x10] - ldr r0, =nullsub_122 - str r0, [r5, 0x14] - mov r2, r10 - str r2, [sp] - mov r0, r9 - str r0, [sp, 0x4] - ldr r0, [sp, 0x8] - ldr r1, [sp, 0xC] - ldr r2, [sp, 0x10] - ldr r3, [sp, 0x20] - bl sub_818D0C4 - ldr r2, [sp, 0x24] - asrs r1, r2, 16 - ldr r0, [sp, 0x28] - asrs r2, r0, 16 - adds r0, r5, 0 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r2, r0, 24 - adds r6, r2, 0 - ldr r0, =0x0000ffff - cmp r10, r0 - bne _0818D336 - ldr r0, =gSprites - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldr r2, [sp, 0x20] - lsls r3, r2, 4 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r3 - strb r0, [r1, 0x5] -_0818D336: - ldr r1, =gUnknown_0203CD04 - ldr r2, [sp, 0x2C] - adds r0, r2, r4 - lsls r0, 2 - adds r2, r0, r1 - str r7, [r2] - adds r1, 0x4 - adds r0, r1 - mov r7, r8 - str r7, [r0] - mov r0, r10 - strh r0, [r2, 0x8] - strb r6, [r2, 0xA] - movs r0, 0x1 - strb r0, [r2, 0xB] - adds r0, r6, 0 -_0818D356: - add sp, 0x30 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end oamt_spawn_poke_or_trainer_picture - - thumb_func_start sub_818D384 -sub_818D384: @ 818D384 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x18 - ldr r4, [sp, 0x34] - ldr r5, [sp, 0x38] - ldr r6, [sp, 0x3C] - ldr r7, [sp, 0x40] - mov r8, r7 - ldr r7, [sp, 0x44] - mov r9, r7 - lsls r0, 16 - lsrs r0, 16 - lsls r3, 24 - lsrs r3, 24 - lsls r6, 24 - lsrs r6, 24 - mov r7, r8 - lsls r7, 16 - lsrs r7, 16 - mov r8, r7 - mov r7, r9 - lsls r7, 24 - lsrs r7, 24 - lsls r4, 16 - asrs r4, 16 - str r4, [sp] - lsls r5, 16 - asrs r5, 16 - str r5, [sp, 0x4] - str r6, [sp, 0x8] - mov r4, r8 - str r4, [sp, 0xC] - str r7, [sp, 0x10] - movs r4, 0 - str r4, [sp, 0x14] - bl oamt_spawn_poke_or_trainer_picture - lsls r0, 16 - lsrs r0, 16 - add sp, 0x18 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_818D384 - - thumb_func_start sub_818D3E4 -sub_818D3E4: @ 818D3E4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x2C - str r1, [sp, 0x8] - str r2, [sp, 0xC] - ldr r1, [sp, 0x4C] - ldr r2, [sp, 0x50] - ldr r4, [sp, 0x54] - ldr r5, [sp, 0x58] - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - lsls r3, 24 - lsrs r6, r3, 24 - lsls r1, 16 - lsrs r1, 16 - str r1, [sp, 0x10] - lsls r2, 16 - lsrs r2, 16 - str r2, [sp, 0x14] - lsls r4, 24 - lsrs r4, 24 - str r4, [sp, 0x18] - lsls r5, 16 - lsrs r5, 16 - str r5, [sp, 0x1C] - movs r5, 0 - ldr r1, =gUnknown_0203CD04 - ldrb r0, [r1, 0xB] - cmp r0, 0 - beq _0818D440 -_0818D428: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x7 - bhi _0818D440 - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0xB] - cmp r0, 0 - bne _0818D428 -_0818D440: - cmp r5, 0x8 - beq _0818D47C - movs r0, 0x80 - lsls r0, 6 - bl Alloc - adds r7, r0, 0 - cmp r7, 0 - beq _0818D47C - movs r0, 0x80 - ands r0, r6 - cmp r0, 0 - beq _0818D468 - movs r0, 0x7F - ands r6, r0 - movs r0, 0x3 - mov r9, r0 - b _0818D46A - .pool -_0818D468: - mov r9, r6 -_0818D46A: - movs r0, 0x20 - bl Alloc - mov r8, r0 - cmp r0, 0 - bne _0818D484 - adds r0, r7, 0 - bl Free -_0818D47C: - ldr r0, =0x0000ffff - b _0818D588 - .pool -_0818D484: - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - mov r0, r10 - ldr r1, [sp, 0xC] - adds r2, r6, 0 - adds r3, r7, 0 - bl load_pokemon_image_TODO - lsls r0, 16 - cmp r0, 0 - bne _0818D47C - lsls r1, r5, 1 - str r1, [sp, 0x28] - ldr r4, =gUnknown_0203CCEC - mov r2, r10 - lsls r2, 2 - mov r12, r2 - ldr r0, [sp, 0x10] - lsls r0, 16 - str r0, [sp, 0x20] - ldr r1, [sp, 0x14] - lsls r1, 16 - str r1, [sp, 0x24] - movs r3, 0x80 - lsls r3, 4 - mov r0, r8 - adds r1, r7, 0 - adds r6, r3, 0 - movs r2, 0x3 -_0818D4C0: - str r1, [r0] - strh r3, [r0, 0x4] - adds r0, 0x8 - adds r1, r6 - subs r2, 0x1 - cmp r2, 0 - bge _0818D4C0 - ldr r0, =0x0000ffff - strh r0, [r4] - ldr r0, =gUnknown_08309AAC - add r0, r12 - ldr r0, [r0] - str r0, [r4, 0x8] - mov r2, r8 - str r2, [r4, 0xC] - mov r0, r9 - cmp r0, 0x1 - bne _0818D4F8 - ldr r0, =gUnknown_082FF694 - b _0818D500 - .pool -_0818D4F8: - mov r1, r9 - cmp r1, 0 - bne _0818D510 - ldr r0, =gUnknown_082FF618 -_0818D500: - str r0, [r4, 0x10] - ldr r0, =gUnknown_0860B06C - str r0, [r4, 0x4] - b _0818D518 - .pool -_0818D510: - ldr r0, =gUnknown_0860B064 - str r0, [r4, 0x4] - ldr r0, =gDummySpriteAffineAnimTable - str r0, [r4, 0x10] -_0818D518: - ldr r2, =nullsub_122 - str r2, [r4, 0x14] - ldr r0, [sp, 0x1C] - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - mov r0, r10 - ldr r1, [sp, 0x8] - ldr r2, [sp, 0xC] - ldr r3, [sp, 0x18] - bl sub_818D0C4 - ldr r2, [sp, 0x20] - asrs r1, r2, 16 - ldr r0, [sp, 0x24] - asrs r2, r0, 16 - adds r0, r4, 0 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r2, r0, 24 - adds r6, r2, 0 - ldr r0, =0x0000ffff - ldr r1, [sp, 0x1C] - cmp r1, r0 - bne _0818D566 - ldr r0, =gSprites - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldr r2, [sp, 0x18] - lsls r3, r2, 4 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r3 - strb r0, [r1, 0x5] -_0818D566: - ldr r1, =gUnknown_0203CD04 - ldr r2, [sp, 0x28] - adds r0, r2, r5 - lsls r0, 2 - adds r2, r0, r1 - str r7, [r2] - adds r1, 0x4 - adds r0, r1 - mov r1, r8 - str r1, [r0] - mov r0, sp - ldrh r0, [r0, 0x1C] - strh r0, [r2, 0x8] - strb r6, [r2, 0xA] - movs r0, 0x1 - strb r0, [r2, 0xB] - adds r0, r6, 0 -_0818D588: - add sp, 0x2C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_818D3E4 - - thumb_func_start sub_818D5B0 -sub_818D5B0: @ 818D5B0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 16 - lsrs r4, r0, 16 - movs r2, 0 - ldr r0, =gUnknown_0203CD04 - ldrb r1, [r0, 0xA] - adds r3, r0, 0 - cmp r1, r4 - beq _0818D5E0 - adds r1, r3, 0 -_0818D5C8: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x7 - bhi _0818D5E0 - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0xA] - cmp r0, r4 - bne _0818D5C8 -_0818D5E0: - cmp r2, 0x8 - bne _0818D5F0 - ldr r0, =0x0000ffff - b _0818D646 - .pool -_0818D5F0: - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r5, r0, r3 - ldr r1, [r5] - mov r8, r1 - adds r1, r3, 0x4 - adds r0, r1 - ldr r7, [r0] - ldrh r1, [r5, 0x8] - ldr r0, =0x0000ffff - lsls r6, r4, 4 - cmp r1, r0 - beq _0818D624 - ldr r1, =gSprites - adds r0, r6, r4 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x5] - lsrs r0, 4 - bl GetSpritePaletteTagByPaletteNum - lsls r0, 16 - lsrs r0, 16 - bl FreeSpritePaletteByTag -_0818D624: - adds r0, r6, r4 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl DestroySprite - mov r0, r8 - bl Free - adds r0, r7, 0 - bl Free - adds r1, r5, 0 - ldr r0, =gUnknown_0860B058 - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - movs r0, 0 -_0818D646: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_818D5B0 - - thumb_func_start sub_818D65C -sub_818D65C: @ 818D65C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - mov r9, r1 - adds r7, r2, 0 - adds r4, r3, 0 - ldr r1, [sp, 0x20] - ldr r2, [sp, 0x24] - ldr r3, [sp, 0x28] - lsls r0, 16 - lsrs r5, r0, 16 - lsls r4, 24 - lsrs r4, 24 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r6, r3, 24 - adds r0, r2, 0 - movs r1, 0x7 - bl GetWindowAttribute - adds r3, r0, 0 - movs r0, 0 - str r0, [sp] - adds r0, r5, 0 - adds r1, r7, 0 - adds r2, r4, 0 - bl sub_818D09C - lsls r0, 16 - cmp r0, 0 - bne _0818D6B8 - str r6, [sp] - adds r0, r5, 0 - mov r1, r9 - adds r2, r7, 0 - mov r3, r8 - bl sub_818D180 - movs r0, 0 - b _0818D6BA -_0818D6B8: - ldr r0, =0x0000ffff -_0818D6BA: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_818D65C - - thumb_func_start sub_818D6CC -sub_818D6CC: @ 818D6CC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - str r1, [sp, 0x18] - str r2, [sp, 0x1C] - ldr r1, [sp, 0x44] - ldr r2, [sp, 0x48] - ldr r4, [sp, 0x4C] - ldr r5, [sp, 0x50] - ldr r6, [sp, 0x54] - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - lsls r3, 24 - lsrs r7, r3, 24 - lsls r1, 16 - lsrs r1, 16 - mov r10, r1 - lsls r2, 16 - lsrs r2, 16 - mov r8, r2 - lsls r4, 24 - lsrs r4, 24 - str r4, [sp, 0x20] - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - movs r0, 0x80 - lsls r0, 6 - bl Alloc - adds r4, r0, 0 - cmp r4, 0 - beq _0818D762 - str r6, [sp] - mov r0, r9 - ldr r1, [sp, 0x1C] - adds r2, r7, 0 - adds r3, r4, 0 - bl sub_818D09C - lsls r0, 16 - cmp r0, 0 - bne _0818D762 - movs r0, 0x40 - str r0, [sp] - str r0, [sp, 0x4] - mov r1, r10 - str r1, [sp, 0x8] - mov r1, r8 - str r1, [sp, 0xC] - str r0, [sp, 0x10] - str r0, [sp, 0x14] - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0 - bl BlitBitmapRectToWindow - str r6, [sp] - mov r0, r9 - ldr r1, [sp, 0x18] - ldr r2, [sp, 0x1C] - ldr r3, [sp, 0x20] - bl sub_818D180 - adds r0, r4, 0 - bl Free - movs r0, 0 - b _0818D764 -_0818D762: - ldr r0, =0x0000ffff -_0818D764: - add sp, 0x24 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_818D6CC - - thumb_func_start sub_818D778 -sub_818D778: @ 818D778 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x18 - ldr r4, [sp, 0x34] - ldr r5, [sp, 0x38] - ldr r6, [sp, 0x3C] - ldr r7, [sp, 0x40] - mov r8, r7 - ldr r7, [sp, 0x44] - mov r9, r7 - lsls r0, 16 - lsrs r0, 16 - lsls r3, 24 - lsrs r3, 24 - lsls r6, 24 - lsrs r6, 24 - mov r7, r8 - lsls r7, 16 - lsrs r7, 16 - mov r8, r7 - mov r7, r9 - lsls r7, 24 - lsrs r7, 24 - lsls r4, 16 - asrs r4, 16 - str r4, [sp] - lsls r5, 16 - asrs r5, 16 - str r5, [sp, 0x4] - str r6, [sp, 0x8] - mov r4, r8 - str r4, [sp, 0xC] - movs r4, 0 - str r4, [sp, 0x10] - str r7, [sp, 0x14] - bl oamt_spawn_poke_or_trainer_picture - lsls r0, 16 - lsrs r0, 16 - add sp, 0x18 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_818D778 - - thumb_func_start sub_818D7D8 -sub_818D7D8: @ 818D7D8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x14 - ldr r4, [sp, 0x2C] - ldr r5, [sp, 0x30] - ldr r6, [sp, 0x34] - ldr r7, [sp, 0x38] - lsls r0, 16 - lsrs r0, 16 - lsls r3, 24 - lsrs r3, 24 - lsls r6, 24 - lsrs r6, 24 - lsls r7, 16 - lsrs r7, 16 - lsls r4, 16 - asrs r4, 16 - str r4, [sp] - lsls r5, 16 - asrs r5, 16 - str r5, [sp, 0x4] - str r6, [sp, 0x8] - str r7, [sp, 0xC] - movs r4, 0 - str r4, [sp, 0x10] - bl sub_818D778 - lsls r0, 16 - lsrs r0, 16 - add sp, 0x14 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_818D7D8 - - thumb_func_start sub_818D820 -sub_818D820: @ 818D820 - push {lr} - lsls r0, 16 - lsrs r0, 16 - bl sub_818D5B0 - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - thumb_func_end sub_818D820 - - thumb_func_start sub_818D834 -sub_818D834: @ 818D834 - push {r4,r5,lr} - sub sp, 0xC - ldr r4, [sp, 0x18] - ldr r5, [sp, 0x1C] - lsls r0, 16 - lsrs r0, 16 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - str r4, [sp] - str r5, [sp, 0x4] - movs r4, 0 - str r4, [sp, 0x8] - bl sub_818D65C - lsls r0, 16 - lsrs r0, 16 - add sp, 0xC - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_818D834 - - thumb_func_start sub_818D864 -sub_818D864: @ 818D864 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x14 - ldr r4, [sp, 0x2C] - ldr r5, [sp, 0x30] - ldr r6, [sp, 0x34] - ldr r7, [sp, 0x38] - lsls r0, 16 - lsrs r0, 16 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - lsls r6, 24 - lsrs r6, 24 - lsls r7, 24 - lsrs r7, 24 - str r4, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - str r7, [sp, 0xC] - movs r4, 0 - str r4, [sp, 0x10] - bl sub_818D6CC - lsls r0, 16 - lsrs r0, 16 - add sp, 0x14 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_818D864 - - thumb_func_start sub_818D8AC -sub_818D8AC: @ 818D8AC - push {r4,r5,lr} - sub sp, 0x14 - adds r5, r1, 0 - ldr r1, [sp, 0x20] - ldr r4, [sp, 0x24] - lsls r0, 16 - lsrs r0, 16 - lsls r5, 24 - lsrs r5, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r4, 16 - lsrs r4, 16 - lsls r2, 16 - asrs r2, 16 - str r2, [sp] - lsls r3, 16 - asrs r3, 16 - str r3, [sp, 0x4] - str r1, [sp, 0x8] - str r4, [sp, 0xC] - movs r1, 0x1 - str r1, [sp, 0x10] - movs r1, 0 - movs r2, 0 - adds r3, r5, 0 - bl sub_818D384 - lsls r0, 16 - lsrs r0, 16 - add sp, 0x14 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_818D8AC - - thumb_func_start sub_818D8F0 -sub_818D8F0: @ 818D8F0 - push {lr} - lsls r0, 16 - lsrs r0, 16 - bl sub_818D5B0 - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - thumb_func_end sub_818D8F0 - - thumb_func_start sub_818D904 -sub_818D904: @ 818D904 - push {r4,lr} - sub sp, 0xC - adds r4, r1, 0 - lsls r0, 16 - lsrs r0, 16 - lsls r4, 24 - lsrs r4, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - str r2, [sp] - str r3, [sp, 0x4] - movs r1, 0x1 - str r1, [sp, 0x8] - movs r1, 0 - movs r2, 0 - adds r3, r4, 0 - bl sub_818D65C - lsls r0, 16 - lsrs r0, 16 - add sp, 0xC - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_818D904 - - thumb_func_start sub_818D938 -sub_818D938: @ 818D938 - push {r4,r5,lr} - sub sp, 0x14 - adds r5, r1, 0 - ldr r1, [sp, 0x20] - ldr r4, [sp, 0x24] - lsls r0, 16 - lsrs r0, 16 - lsls r5, 24 - lsrs r5, 24 - lsls r2, 16 - lsrs r2, 16 - lsls r3, 16 - lsrs r3, 16 - lsls r1, 24 - lsrs r1, 24 - lsls r4, 24 - lsrs r4, 24 - str r2, [sp] - str r3, [sp, 0x4] - str r1, [sp, 0x8] - str r4, [sp, 0xC] - movs r1, 0x1 - str r1, [sp, 0x10] - movs r1, 0 - movs r2, 0 - adds r3, r5, 0 - bl sub_818D6CC - lsls r0, 16 - lsrs r0, 16 - add sp, 0x14 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_818D938 - - thumb_func_start sub_818D97C -sub_818D97C: @ 818D97C - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0x1 - bne _0818D9A2 - cmp r0, 0 - beq _0818D99C - ldr r0, =gTrainerPicIndices - adds r0, 0x3F - ldrb r0, [r0] - b _0818D9A2 - .pool -_0818D99C: - ldr r0, =gTrainerPicIndices - adds r0, 0x3C - ldrb r0, [r0] -_0818D9A2: - pop {r1} - bx r1 - .pool - thumb_func_end sub_818D97C - - thumb_func_start sub_818D9AC -sub_818D9AC: @ 818D9AC - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003b58 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_818D9AC - - thumb_func_start sub_818D9C0 -sub_818D9C0: @ 818D9C0 - push {r4,r5,lr} - ldr r5, =0x00004010 - ldr r4, =gUnknown_0860B07E - bl sub_818D9AC - lsls r0, 24 - lsrs r0, 23 - adds r0, r4 - ldrh r1, [r0] - adds r0, r5, 0 - bl VarSet - bl sub_818D9AC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _0818DA20 - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - ldr r0, =0x00003b58 - adds r1, r0 - ldr r0, =0x00004011 - ldr r2, =gUnknown_0860B074 - ldrb r1, [r1, 0xD] - lsls r1, 1 - adds r1, r2 - ldrh r1, [r1] - bl VarSet - ldr r1, =gScriptResult - movs r0, 0x1 - b _0818DA24 - .pool -_0818DA20: - ldr r1, =gScriptResult - movs r0, 0 -_0818DA24: - strh r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818D9C0 - - thumb_func_start sub_818DA30 -sub_818DA30: @ 818DA30 - push {lr} - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldrb r1, [r0, 0xB] - lsls r1, 8 - ldrb r0, [r0, 0xA] - orrs r0, r1 - movs r1, 0x6 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 17 - adds r1, r0, 0 - cmp r0, 0x1 - beq _0818DA68 - cmp r0, 0x1 - bgt _0818DA5C - cmp r0, 0 - beq _0818DA62 - b _0818DA72 - .pool -_0818DA5C: - cmp r1, 0x2 - beq _0818DA6E - b _0818DA72 -_0818DA62: - bl sub_818DF68 - b _0818DA72 -_0818DA68: - bl sub_818DB7C - b _0818DA72 -_0818DA6E: - bl sub_818E638 -_0818DA72: - pop {r0} - bx r0 - thumb_func_end sub_818DA30 - - thumb_func_start sub_818DA78 -sub_818DA78: @ 818DA78 - push {lr} - bl sub_818D9AC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0818DA9C - cmp r0, 0x1 - bgt _0818DA90 - cmp r0, 0 - beq _0818DA96 - b _0818DAA6 -_0818DA90: - cmp r0, 0x2 - beq _0818DAA2 - b _0818DAA6 -_0818DA96: - bl sub_818E004 - b _0818DAA6 -_0818DA9C: - bl sub_818DBC4 - b _0818DAA6 -_0818DAA2: - bl sub_818E674 -_0818DAA6: - pop {r0} - bx r0 - thumb_func_end sub_818DA78 - - thumb_func_start sub_818DAAC -sub_818DAAC: @ 818DAAC - push {lr} - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - cmp r0, 0x1 - beq _0818DADC - cmp r0, 0x1 - bgt _0818DAD0 - cmp r0, 0 - beq _0818DAD6 - b _0818DAE6 -_0818DAD0: - cmp r1, 0x2 - beq _0818DAE2 - b _0818DAE6 -_0818DAD6: - bl sub_818DF68 - b _0818DAE6 -_0818DADC: - bl sub_818DB7C - b _0818DAE6 -_0818DAE2: - bl sub_818E638 -_0818DAE6: - pop {r0} - bx r0 - thumb_func_end sub_818DAAC - - thumb_func_start sub_818DAEC -sub_818DAEC: @ 818DAEC - push {r4,lr} - ldr r4, =gScriptResult - bl sub_818D9AC - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818DAEC - - thumb_func_start sub_818DB04 -sub_818DB04: @ 818DB04 - push {lr} - adds r1, r0, 0 - movs r2, 0 - b _0818DB14 -_0818DB0C: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - adds r1, 0x2 -_0818DB14: - ldrh r0, [r1] - cmp r0, 0 - bne _0818DB0C - adds r0, r2, 0 - pop {r1} - bx r1 - thumb_func_end sub_818DB04 - - thumb_func_start sub_818DB20 -sub_818DB20: @ 818DB20 - push {r4-r6,lr} - bl Random - ldr r5, =gUnknown_0203CD64 - ldr r4, [r5] - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x6 - bl __umodsi3 - strb r0, [r4, 0xC] - ldr r6, =gUnknown_0860B2EC - ldr r0, [r5] - ldrb r0, [r0, 0xC] - lsls r0, 2 - adds r0, r6 - ldr r0, [r0] - bl sub_818DB04 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl Random - lsls r0, 16 - lsrs r0, 16 - adds r1, r4, 0 - bl __modsi3 - lsls r0, 24 - ldr r2, [r5] - ldrb r1, [r2, 0xC] - lsls r1, 2 - adds r1, r6 - ldr r1, [r1] - lsrs r0, 23 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r2, 0x10] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818DB20 - - thumb_func_start sub_818DB7C -sub_818DB7C: @ 818DB7C - push {lr} - ldr r2, =gUnknown_0203CD64 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003b58 - adds r0, r1 - str r0, [r2] - movs r3, 0 - movs r1, 0x1 - strb r1, [r0] - ldr r0, [r2] - strb r3, [r0, 0x1] - ldr r1, [r2] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r0, [r2] - strb r3, [r0, 0x2] - ldr r0, [r2] - strb r3, [r0, 0x3] - ldr r1, [r2] - strh r3, [r1, 0xE] - ldr r0, =gGameLanguage - ldrb r0, [r0] - strb r0, [r1, 0x12] - bl sub_818DB20 - pop {r0} - bx r0 - .pool - thumb_func_end sub_818DB7C - - thumb_func_start sub_818DBC4 -sub_818DBC4: @ 818DBC4 - ldr r3, =gUnknown_0203CD64 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003b58 - adds r0, r1 - str r0, [r3] - movs r2, 0 - movs r1, 0x1 - strb r1, [r0] - ldr r0, [r3] - strb r2, [r0, 0x1] - bx lr - .pool - thumb_func_end sub_818DBC4 - - thumb_func_start sub_818DBE8 -sub_818DBE8: @ 818DBE8 - push {lr} - ldr r1, =gUnknown_0203CD64 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =0x00003b58 - adds r0, r2 - str r0, [r1] - ldrb r0, [r0, 0x1] - cmp r0, 0x2 - bne _0818DC0C - movs r0, 0x2 - b _0818DC16 - .pool -_0818DC0C: - cmp r0, 0x1 - beq _0818DC14 - movs r0, 0 - b _0818DC16 -_0818DC14: - movs r0, 0x1 -_0818DC16: - pop {r1} - bx r1 - thumb_func_end sub_818DBE8 - - thumb_func_start sub_818DC1C -sub_818DC1C: @ 818DC1C - lsls r0, 24 - ldr r1, =gUnknown_0860B224 - lsrs r0, 22 - adds r0, r1 - ldr r0, [r0] - bx lr - .pool - thumb_func_end sub_818DC1C - - thumb_func_start sub_818DC2C -sub_818DC2C: @ 818DC2C - push {r4,lr} - ldr r1, =gUnknown_0203CD64 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =0x00003b58 - adds r0, r2 - str r0, [r1] - ldr r4, =gStringVar1 - ldrb r0, [r0, 0xC] - bl sub_818DC1C - adds r1, r0, 0 - adds r0, r4, 0 - bl StringCopy - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818DC2C - - thumb_func_start sub_818DC60 -sub_818DC60: @ 818DC60 - push {r4,r5,lr} - ldr r5, =gUnknown_0203CD64 - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - ldr r2, =0x00003b58 - adds r0, r1, r2 - str r0, [r5] - ldrb r0, [r0, 0x4] - cmp r0, 0xFF - bne _0818DC84 - movs r0, 0 - b _0818DC9C - .pool -_0818DC84: - ldr r4, =gStringVar3 - ldr r0, =0x00003b5c - adds r1, r0 - adds r0, r4, 0 - bl StringCopy7 - ldr r0, [r5] - ldrb r1, [r0, 0x12] - adds r0, r4, 0 - bl ConvertInternationalString - movs r0, 0x1 -_0818DC9C: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_818DC60 - - thumb_func_start sub_818DCAC -sub_818DCAC: @ 818DCAC - push {r4,lr} - adds r4, r0, 0 - lsls r0, r1, 16 - lsrs r0, 16 - bl ItemId_GetItem - adds r1, r0, 0 - adds r0, r4, 0 - bl StringCopy - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_818DCAC - - thumb_func_start sub_818DCC8 -sub_818DCC8: @ 818DCC8 - push {lr} - ldr r2, =gUnknown_0203CD64 - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - ldr r0, =0x00003b58 - adds r1, r0 - str r1, [r2] - ldr r0, =gStringVar2 - ldrh r1, [r1, 0xE] - bl sub_818DCAC - pop {r0} - bx r0 - .pool - thumb_func_end sub_818DCC8 - - thumb_func_start sub_818DCF4 -sub_818DCF4: @ 818DCF4 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - adds r0, r4, 0 - movs r1, 0xFF - movs r2, 0x8 - bl memset - adds r0, r4, 0 - adds r1, r5, 0 - bl StringCopy7 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_818DCF4 - - thumb_func_start sub_818DD14 -sub_818DD14: @ 818DD14 - push {r4,r5,lr} - ldr r5, =gUnknown_0203CD64 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =0x00003b58 - adds r1, r0, r2 - str r1, [r5] - ldr r1, =0x00003b5c - adds r0, r1 - ldr r4, =gStringVar3 - adds r1, r4, 0 - bl sub_818DCF4 - ldr r0, [r5] - ldrb r1, [r0, 0x12] - adds r0, r4, 0 - bl ConvertInternationalString - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818DD14 - - thumb_func_start sub_818DD54 -sub_818DD54: @ 818DD54 - ldr r1, =gUnknown_0203CD64 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =0x00003b58 - adds r0, r2 - str r0, [r1] - ldrb r1, [r0, 0x2] - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - bx lr - .pool - thumb_func_end sub_818DD54 - - thumb_func_start sub_818DD78 -sub_818DD78: @ 818DD78 - push {lr} - bl sub_81AAC50 - pop {r0} - bx r0 - thumb_func_end sub_818DD78 - - thumb_func_start sub_818DD84 -sub_818DD84: @ 818DD84 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 16 - lsrs r5, r0, 16 - ldr r4, =gUnknown_0203CD64 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003b58 - adds r0, r1 - str r0, [r4] - ldr r1, =gUnknown_0860B2EC - mov r8, r1 - ldrb r0, [r0, 0xC] - lsls r0, 2 - add r0, r8 - ldr r0, [r0] - bl sub_818DB04 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, [r4] - movs r0, 0x1 - strb r0, [r1, 0x1] - ldr r0, =gStringVar2 - adds r1, r5, 0 - bl sub_818DCAC - ldr r1, [r4] - strh r5, [r1, 0xE] - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r1, 0x4 - bl sub_818DCF4 - ldr r1, [r4] - ldr r0, =gGameLanguage - ldrb r0, [r0] - strb r0, [r1, 0x12] - movs r7, 0 - movs r3, 0 - cmp r7, r6 - bcs _0818DE36 - mov r12, r8 -_0818DDDC: - ldr r2, [r4] - ldrb r0, [r2, 0xC] - lsls r0, 2 - add r0, r12 - ldr r1, [r0] - lsls r0, r3, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r5 - bne _0818DE28 - movs r7, 0x1 - ldrb r0, [r2, 0x3] - adds r0, 0x1 - strb r0, [r2, 0x3] - ldr r0, [r4] - strb r7, [r0, 0x2] - ldr r1, [r4] - ldrh r0, [r1, 0x10] - cmp r0, r5 - bne _0818DE36 - movs r0, 0x5 - strb r0, [r1, 0x3] - b _0818DE36 - .pool -_0818DE28: - movs r0, 0 - strb r0, [r2, 0x2] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, r6 - bcc _0818DDDC -_0818DE36: - adds r0, r7, 0 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_818DD84 - - thumb_func_start sub_818DE44 -sub_818DE44: @ 818DE44 - push {lr} - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - bl sub_818DD84 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_818DE44 - - thumb_func_start sub_818DE5C -sub_818DE5C: @ 818DE5C - push {lr} - ldr r1, =gUnknown_0203CD64 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =0x00003b58 - adds r0, r2 - str r0, [r1] - ldrb r0, [r0, 0x3] - movs r1, 0 - cmp r0, 0x4 - bls _0818DE74 - movs r1, 0x1 -_0818DE74: - adds r0, r1, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_818DE5C - - thumb_func_start sub_818DE88 -sub_818DE88: @ 818DE88 - push {lr} - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - ldr r0, =gStringVar2 - bl sub_818DCAC - pop {r0} - bx r0 - .pool - thumb_func_end sub_818DE88 - - thumb_func_start sub_818DEA0 -sub_818DEA0: @ 818DEA0 - push {r4,r5,lr} - ldr r5, =gUnknown_0203CD64 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003b58 - adds r0, r1 - str r0, [r5] - ldr r1, =gUnknown_0860B304 - ldrb r0, [r0, 0xC] - lsls r0, 1 - adds r0, r1 - ldrh r4, [r0] - adds r0, r4, 0 - bl sub_818DE88 - ldr r1, [r5] - movs r0, 0x2 - strb r0, [r1, 0x1] - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_818DEA0 - - thumb_func_start sub_818DEDC -sub_818DEDC: @ 818DEDC - push {lr} - bl sub_818DB7C - ldr r0, =gUnknown_0203CD64 - ldr r1, [r0] - movs r0, 0x1 - strb r0, [r1, 0x1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_818DEDC - - thumb_func_start sub_818DEF4 -sub_818DEF4: @ 818DEF4 - push {lr} - bl script_env_2_enable_and_set_ctx_running - pop {r0} - bx r0 - thumb_func_end sub_818DEF4 - - thumb_func_start sub_818DF00 -sub_818DF00: @ 818DF00 - push {r4-r7,lr} - bl Random - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0xF - ands r4, r0 - movs r3, 0 - ldr r5, =gUnknown_0203CD68 - ldr r1, =gUnknown_0860B1A4 - lsls r0, r4, 2 - adds r6, r0, r1 - adds r7, r5, 0 -_0818DF1A: - ldr r2, [r5] - lsls r1, r3, 1 - adds r2, 0x2 - adds r2, r1 - ldr r0, [r6] - adds r1, r0 - ldrh r0, [r1] - strh r0, [r2] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x8 - bls _0818DF1A - ldr r2, [r7] - ldr r0, =gUnknown_0860B1E4 - lsls r1, r4, 1 - adds r0, r1, r0 - ldrh r0, [r0] - strh r0, [r2, 0x14] - ldr r0, =gUnknown_0860B204 - adds r1, r0 - ldrh r0, [r1] - strh r0, [r2, 0x28] - adds r2, 0x2B - strb r4, [r2] - ldr r1, [r7] - movs r0, 0xFF - strb r0, [r1, 0x18] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818DF00 - - thumb_func_start sub_818DF68 -sub_818DF68: @ 818DF68 - push {r4-r6,lr} - ldr r2, =gUnknown_0203CD68 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003b58 - adds r0, r1 - str r0, [r2] - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - strb r1, [r0, 0x1] - movs r3, 0 - adds r4, r2, 0 - ldr r6, =gGameLanguage - adds r5, r4, 0 - ldr r0, =0x0000ffff - adds r2, r0, 0 -_0818DF8A: - ldr r1, [r5] - lsls r0, r3, 1 - adds r1, 0x2 - adds r1, r0 - ldrh r0, [r1] - orrs r0, r2 - strh r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x8 - bls _0818DF8A - ldr r0, [r4] - ldr r1, =0x0000ffff - strh r1, [r0, 0x14] - movs r1, 0x1 - negs r1, r1 - strh r1, [r0, 0x16] - movs r3, 0 - adds r5, r4, 0 - movs r2, 0 -_0818DFB4: - ldr r0, [r5] - lsls r1, r3, 1 - adds r0, 0x20 - adds r0, r1 - strh r2, [r0] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x3 - bls _0818DFB4 - ldr r0, [r4] - movs r2, 0 - movs r1, 0 - strh r1, [r0, 0x28] - adds r0, 0x2A - strb r2, [r0] - ldr r0, [r4] - adds r0, 0x2C - movs r1, 0x10 - strb r1, [r0] - ldr r0, [r4] - ldrb r1, [r6] - adds r0, 0x2D - strb r1, [r0] - bl sub_818DF00 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818DF68 - - thumb_func_start sub_818E004 -sub_818E004: @ 818E004 - ldr r2, =gUnknown_0203CD68 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003b58 - adds r0, r1 - str r0, [r2] - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - strb r1, [r0, 0x1] - ldr r0, [r2] - adds r0, 0x2A - strb r1, [r0] - ldr r1, [r2] - ldr r0, =0x0000ffff - strh r0, [r1, 0x16] - bx lr - .pool - thumb_func_end sub_818E004 - - thumb_func_start sub_818E038 -sub_818E038: @ 818E038 - push {lr} - ldr r1, =gUnknown_0203CD68 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =0x00003b58 - adds r0, r2 - str r0, [r1] - ldrb r0, [r0, 0x1] - cmp r0, 0x2 - bne _0818E05C - movs r0, 0x2 - b _0818E066 - .pool -_0818E05C: - cmp r0, 0x1 - beq _0818E064 - movs r0, 0 - b _0818E066 -_0818E064: - movs r0, 0x1 -_0818E066: - pop {r1} - bx r1 - thumb_func_end sub_818E038 - - thumb_func_start sub_818E06C -sub_818E06C: @ 818E06C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =gSaveBlock1Ptr - ldr r4, [r0] - ldr r0, =0x00003b58 - adds r7, r4, r0 - ldrh r0, [r7, 0x14] - bl sub_811F8D8 - cmp r0, 0 - bne _0818E0EC - ldr r1, =0x00003b83 - adds r0, r4, r1 - ldrb r5, [r0] - ldr r0, =0x00003b5a - adds r0, r4 - mov r8, r0 - adds r1, r4 - mov r10, r1 - ldr r6, =gUnknown_0860B1E4 -_0818E09A: - adds r5, 0x1 - cmp r5, 0xF - ble _0818E0A2 - movs r5, 0 -_0818E0A2: - lsls r4, r5, 1 - adds r0, r4, r6 - ldrh r0, [r0] - bl sub_811F8D8 - cmp r0, 0 - beq _0818E09A - movs r3, 0 - ldr r0, =gUnknown_0860B1E4 - mov r12, r0 - lsls r1, r5, 2 - ldr r0, =gUnknown_0860B204 - mov r9, r0 - ldr r0, =gUnknown_0860B1A4 - adds r6, r1, r0 - mov r2, r8 -_0818E0C2: - lsls r0, r3, 1 - ldr r1, [r6] - adds r0, r1 - ldrh r0, [r0] - strh r0, [r2] - adds r2, 0x2 - adds r3, 0x1 - cmp r3, 0x8 - ble _0818E0C2 - mov r1, r12 - adds r0, r4, r1 - ldrh r0, [r0] - strh r0, [r7, 0x14] - mov r1, r9 - adds r0, r4, r1 - ldrh r0, [r0] - strh r0, [r7, 0x28] - mov r0, r10 - strb r5, [r0] - movs r0, 0xFF - strb r0, [r7, 0x18] -_0818E0EC: - bl sub_818E13C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _0818E118 - movs r0, 0x2 - b _0818E12C - .pool -_0818E118: - cmp r0, 0x2 - beq _0818E126 - bl sub_818E1F4 - lsls r0, 24 - cmp r0, 0 - beq _0818E12A -_0818E126: - movs r0, 0x1 - b _0818E12C -_0818E12A: - movs r0, 0 -_0818E12C: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_818E06C - - thumb_func_start sub_818E13C -sub_818E13C: @ 818E13C - push {r4-r7,lr} - movs r7, 0x1 - ldr r5, =gUnknown_0203CD68 - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - ldr r2, =0x00003b58 - adds r0, r1, r2 - str r0, [r5] - ldrb r0, [r0, 0x18] - cmp r0, 0xFF - bne _0818E174 - ldr r0, =gStringVar1 - ldr r1, =gUnknown_085EEB7E - bl StringCopy7 - movs r7, 0 - b _0818E1DC - .pool -_0818E174: - ldr r4, =gStringVar1 - ldr r0, =0x00003b70 - adds r1, r0 - adds r0, r4, 0 - bl StringCopy7 - ldr r0, [r5] - adds r0, 0x2D - ldrb r1, [r0] - adds r0, r4, 0 - bl ConvertInternationalString - ldr r0, [r5] - adds r0, 0x18 - bl sub_818E258 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r6, =gSaveBlock2Ptr - ldr r0, [r6] - bl sub_818E258 - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bne _0818E1DC - ldr r0, [r5] - movs r2, 0 - cmp r2, r4 - bcs _0818E1DC - ldr r1, [r6] - ldrb r0, [r0, 0x18] - ldrb r1, [r1] - cmp r0, r1 - bne _0818E1DA -_0818E1BA: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, r4 - bcs _0818E1DC - ldr r0, =gUnknown_0203CD68 - ldr r1, [r0] - adds r1, 0x18 - adds r1, r2 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, r2 - ldrb r1, [r1] - ldrb r0, [r0] - cmp r1, r0 - beq _0818E1BA -_0818E1DA: - movs r7, 0x2 -_0818E1DC: - adds r0, r7, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_818E13C - - thumb_func_start sub_818E1F4 -sub_818E1F4: @ 818E1F4 - push {r4-r6,lr} - ldr r3, =gUnknown_0203CD68 - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - ldr r2, =0x00003b58 - adds r0, r1, r2 - str r0, [r3] - movs r5, 0 - movs r4, 0 - ldr r0, =0x00003b78 - adds r1, r0 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldrh r1, [r1] - adds r6, r3, 0 - adds r3, r0, 0 - ldrb r2, [r2, 0xA] - cmp r1, r2 - bne _0818E23A -_0818E21A: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bhi _0818E23C - ldr r1, [r6] - lsls r0, r4, 1 - adds r1, 0x20 - adds r1, r0 - ldr r0, [r3] - adds r0, 0xA - adds r0, r4 - ldrh r1, [r1] - ldrb r0, [r0] - cmp r1, r0 - beq _0818E21A -_0818E23A: - movs r5, 0x1 -_0818E23C: - adds r0, r5, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_818E1F4 - - thumb_func_start sub_818E258 -sub_818E258: @ 818E258 - push {lr} - movs r2, 0 - adds r1, r0, 0 - b _0818E268 -_0818E260: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - adds r1, 0x1 -_0818E268: - ldrb r0, [r1] - cmp r0, 0xFF - bne _0818E260 - adds r0, r2, 0 - pop {r1} - bx r1 - thumb_func_end sub_818E258 - - thumb_func_start sub_818E274 -sub_818E274: @ 818E274 - push {r4,lr} - ldr r4, =gStringVar1 - ldr r0, =gUnknown_0203CD68 - ldr r0, [r0] - ldrh r0, [r0, 0x28] - bl ItemId_GetItem - adds r1, r0, 0 - adds r0, r4, 0 - bl StringCopy - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E274 - - thumb_func_start sub_818E298 -sub_818E298: @ 818E298 - push {r4,lr} - ldr r4, =gUnknown_0203CD68 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003b58 - adds r0, r1 - str r0, [r4] - bl sub_818E13C - lsls r0, 24 - cmp r0, 0 - beq _0818E2C0 - movs r0, 0 - b _0818E2CC - .pool -_0818E2C0: - ldr r0, [r4] - ldr r1, =gGameLanguage - ldrb r1, [r1] - adds r0, 0x2D - strb r1, [r0] - movs r0, 0x1 -_0818E2CC: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_818E298 - - thumb_func_start sub_818E2D8 -sub_818E2D8: @ 818E2D8 - ldr r2, =gUnknown_0203CD68 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r3, =0x00003b58 - adds r1, r0, r3 - str r1, [r2] - ldr r1, =0x00003b82 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_818E2D8 - - thumb_func_start sub_818E2FC -sub_818E2FC: @ 818E2FC - push {lr} - bl easy_chat_input_maybe - pop {r0} - bx r0 - thumb_func_end sub_818E2FC - - thumb_func_start sub_818E308 -sub_818E308: @ 818E308 - push {r4-r6,lr} - ldr r5, =gUnknown_0203CD68 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003b58 - adds r0, r1 - str r0, [r5] - ldr r6, =gStringVar1 - ldrh r1, [r0, 0x14] - adds r0, r6, 0 - bl CopyEasyChatWord - ldr r4, =gStringVar2 - ldr r0, [r5] - ldrh r1, [r0, 0x16] - adds r0, r4, 0 - bl CopyEasyChatWord - adds r0, r6, 0 - adds r1, r4, 0 - bl StringCompare - movs r1, 0 - cmp r0, 0 - bne _0818E33C - movs r1, 0x1 -_0818E33C: - adds r0, r1, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_818E308 - - thumb_func_start sub_818E358 -sub_818E358: @ 818E358 - ldr r1, =gUnknown_0203CD68 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =0x00003b58 - adds r0, r2 - str r0, [r1] - ldr r1, =gSpecialVar_0x8005 - ldrh r0, [r0, 0x28] - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_818E358 - - thumb_func_start sub_818E37C -sub_818E37C: @ 818E37C - ldr r1, =gUnknown_0203CD68 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =0x00003b58 - adds r0, r2 - str r0, [r1] - movs r1, 0x1 - strb r1, [r0, 0x1] - bx lr - .pool - thumb_func_end sub_818E37C - - thumb_func_start sub_818E39C -sub_818E39C: @ 818E39C - ldr r1, =gUnknown_0203CD68 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =0x00003b58 - adds r0, r2 - str r0, [r1] - movs r1, 0x2 - strb r1, [r0, 0x1] - bx lr - .pool - thumb_func_end sub_818E39C - - thumb_func_start sub_818E3BC -sub_818E3BC: @ 818E3BC - ldr r1, =gUnknown_0203CD68 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =0x00003b58 - adds r0, r2 - str r0, [r1] - ldr r1, =0x0000ffff - strh r1, [r0, 0x16] - bx lr - .pool - thumb_func_end sub_818E3BC - - thumb_func_start sub_818E3E0 -sub_818E3E0: @ 818E3E0 - push {lr} - bl sub_81AAC70 - pop {r0} - bx r0 - thumb_func_end sub_818E3E0 - - thumb_func_start sub_818E3EC -sub_818E3EC: @ 818E3EC - push {r4,lr} - ldr r4, =gUnknown_0203CD68 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003b58 - adds r0, r1 - str r0, [r4] - bl sub_818E298 - lsls r0, 24 - cmp r0, 0 - beq _0818E41C - ldr r0, [r4] - adds r1, r0, 0 - adds r1, 0x2B - ldrb r1, [r1] - adds r0, 0x2C - b _0818E422 - .pool -_0818E41C: - ldr r0, [r4] - adds r0, 0x2C - movs r1, 0x10 -_0818E422: - strb r1, [r0] - bl sub_818DF00 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_818E3EC - - thumb_func_start sub_818E430 -sub_818E430: @ 818E430 - push {r4,r5,lr} - ldr r1, =gUnknown_0203CD68 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =0x00003b58 - adds r0, r2 - str r0, [r1] - movs r2, 0 - adds r5, r1, 0 - adds r4, r5, 0 - ldr r0, =0x0000ffff - adds r3, r0, 0 -_0818E448: - ldr r1, [r4] - lsls r0, r2, 1 - adds r1, 0x2 - adds r1, r0 - ldrh r0, [r1] - orrs r0, r3 - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x8 - bls _0818E448 - ldr r1, [r5] - ldr r0, =0x0000ffff - strh r0, [r1, 0x14] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E430 - - thumb_func_start sub_818E47C -sub_818E47C: @ 818E47C - push {lr} - ldr r1, =gSpecialVar_0x8004 - movs r0, 0x11 - strh r0, [r1] - bl easy_chat_input_maybe - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E47C - - thumb_func_start sub_818E490 -sub_818E490: @ 818E490 - push {lr} - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - movs r1, 0x1 - bl RemoveBagItem - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E490 - - thumb_func_start sub_818E4A4 -sub_818E4A4: @ 818E4A4 - push {r4-r6,lr} - ldr r2, =gUnknown_0203CD68 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003b58 - adds r0, r1 - str r0, [r2] - ldr r1, =gUnknown_0203CE7C - ldrh r1, [r1] - strh r1, [r0, 0x28] - movs r3, 0 - adds r4, r2, 0 - ldr r6, =gSaveBlock2Ptr - adds r5, r4, 0 - adds r2, r6, 0 -_0818E4C2: - ldr r1, [r5] - lsls r0, r3, 1 - adds r1, 0x20 - adds r1, r0 - ldr r0, [r2] - adds r0, 0xA - adds r0, r3 - ldrb r0, [r0] - strh r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x3 - bls _0818E4C2 - ldr r0, [r4] - adds r0, 0x18 - ldr r1, [r6] - bl StringCopy7 - ldr r0, [r4] - ldr r1, =gGameLanguage - ldrb r1, [r1] - adds r0, 0x2D - strb r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E4A4 - - thumb_func_start sub_818E510 -sub_818E510: @ 818E510 - ldr r2, =gUnknown_0203CD68 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r3, =0x00003b58 - adds r1, r0, r3 - str r1, [r2] - ldr r1, =0x00003b82 - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] - bx lr - .pool - thumb_func_end sub_818E510 - - thumb_func_start sub_818E538 -sub_818E538: @ 818E538 - push {lr} - ldr r2, =gUnknown_0203CD68 - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - ldr r0, =0x00003b58 - adds r1, r0 - str r1, [r2] - ldr r0, =gStringVar3 - ldrh r1, [r1, 0x14] - bl CopyEasyChatWord - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E538 - - thumb_func_start sub_818E564 -sub_818E564: @ 818E564 - push {lr} - bl script_env_2_enable_and_set_ctx_running - pop {r0} - bx r0 - thumb_func_end sub_818E564 - - thumb_func_start sub_818E570 -sub_818E570: @ 818E570 - push {r4-r7,lr} - ldr r2, =gUnknown_0203CD68 - ldr r1, =gSaveBlock1Ptr - ldr r1, [r1] - ldr r4, =0x00003b58 - adds r3, r1, r4 - str r3, [r2] - adds r6, r0, 0 - adds r6, 0x2C - ldrb r4, [r6] - adds r7, r2, 0 - cmp r4, 0xF - bhi _0818E5EC - ldrb r0, [r3] - cmp r0, 0 - bne _0818E5EC - movs r5, 0 - ldr r2, =0x00003b83 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r4, r0 - bne _0818E5E4 - adds r4, r7, 0 -_0818E59E: - bl Random - ldr r2, [r4] - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xF - ands r0, r1 - adds r2, 0x2B - strb r0, [r2] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bhi _0818E5C6 - ldr r0, [r4] - adds r0, 0x2B - ldrb r1, [r6] - ldrb r0, [r0] - cmp r1, r0 - beq _0818E59E -_0818E5C6: - ldr r0, [r4] - adds r2, r0, 0 - adds r2, 0x2B - ldrb r0, [r6] - ldr r7, =gUnknown_0203CD68 - ldrb r4, [r2] - cmp r0, r4 - bne _0818E5E4 - ldrb r1, [r2] - adds r3, r1, 0x1 - adds r0, r3, 0 - asrs r0, 4 - lsls r0, 4 - subs r0, r3, r0 - strb r0, [r2] -_0818E5E4: - ldr r0, [r7] - ldrb r1, [r6] - adds r0, 0x2C - strb r1, [r0] -_0818E5EC: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E570 - - thumb_func_start sub_818E604 -sub_818E604: @ 818E604 - push {r4,lr} - ldr r4, =gUnknown_0203CD6C - ldr r1, [r4] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r0, [r4] - movs r1, 0 - strb r1, [r0, 0x2] - ldr r0, [r4] - strb r1, [r0, 0x3] - ldr r0, [r4] - strb r1, [r0, 0xC] - bl Random - ldr r4, [r4] - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x5 - bl __umodsi3 - strb r0, [r4, 0xD] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E604 - - thumb_func_start sub_818E638 -sub_818E638: @ 818E638 - push {r4,lr} - ldr r4, =gUnknown_0203CD6C - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003b58 - adds r0, r1 - str r0, [r4] - movs r2, 0 - movs r1, 0x2 - strb r1, [r0] - ldr r0, [r4] - strb r2, [r0, 0x1] - bl sub_818E604 - ldr r1, [r4] - ldr r0, =gGameLanguage - ldrb r0, [r0] - strb r0, [r1, 0xE] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E638 - - thumb_func_start sub_818E674 -sub_818E674: @ 818E674 - push {lr} - ldr r2, =gUnknown_0203CD6C - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003b58 - adds r0, r1 - str r0, [r2] - movs r3, 0 - movs r1, 0x2 - strb r1, [r0] - ldr r0, [r2] - strb r3, [r0, 0x1] - ldr r2, [r2] - ldrb r0, [r2, 0x2] - cmp r0, 0x5 - beq _0818E69A - ldrb r0, [r2, 0x3] - cmp r0, 0x5 - bne _0818E69E -_0818E69A: - bl sub_818E604 -_0818E69E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E674 - - thumb_func_start sub_818E6B0 -sub_818E6B0: @ 818E6B0 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r4, =gUnknown_0203CD6C - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r3, =0x00003b58 - adds r1, r0, r3 - str r1, [r4] - ldrb r0, [r1, 0xC] - cmp r0, r2 - bhi _0818E6EA - strb r2, [r1, 0xC] - ldr r0, [r4] - adds r0, 0x4 - movs r1, 0xFF - movs r2, 0x8 - bl memset - ldr r1, [r4] - ldr r0, =gSaveBlock2Ptr - adds r1, 0x4 - ldr r0, [r0] - ldm r0!, {r2,r3} - stm r1!, {r2,r3} - ldr r1, [r4] - ldr r0, =gGameLanguage - ldrb r0, [r0] - strb r0, [r1, 0xE] -_0818E6EA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E6B0 - - thumb_func_start sub_818E704 -sub_818E704: @ 818E704 - push {r4,r5,lr} - adds r2, r0, 0 - movs r3, 0 - movs r4, 0 - ldr r1, =gUnknown_0203CD6C - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r5, =0x00003b58 - adds r0, r5 - str r0, [r1] - ldrb r0, [r0, 0xD] - adds r5, r1, 0 - cmp r0, 0x4 - bhi _0818E76A - lsls r0, 2 - ldr r1, =_0818E73C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0818E73C: - .4byte _0818E750 - .4byte _0818E754 - .4byte _0818E758 - .4byte _0818E75C - .4byte _0818E760 -_0818E750: - ldrb r0, [r2, 0x1] - b _0818E762 -_0818E754: - ldrb r0, [r2, 0x2] - b _0818E762 -_0818E758: - ldrb r0, [r2, 0x3] - b _0818E762 -_0818E75C: - ldrb r0, [r2, 0x4] - b _0818E762 -_0818E760: - ldrb r0, [r2, 0x5] -_0818E762: - cmp r0, 0 - beq _0818E76A - adds r3, r0, 0 - movs r4, 0x1 -_0818E76A: - cmp r4, 0x1 - bne _0818E784 - adds r0, r3, 0 - bl sub_818E6B0 - ldr r0, =gUnknown_0203CD6C - ldr r1, [r0] - ldrb r0, [r1, 0x2] - adds r0, 0x1 - strb r0, [r1, 0x2] - b _0818E78C - .pool -_0818E784: - ldr r1, [r5] - ldrb r0, [r1, 0x3] - adds r0, 0x1 - strb r0, [r1, 0x3] -_0818E78C: - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_818E704 - - thumb_func_start sub_818E794 -sub_818E794: @ 818E794 - push {r4,r5,lr} - adds r5, r1, 0 - ldr r4, =gUnknown_0203CD6C - ldr r1, =gSaveBlock1Ptr - ldr r1, [r1] - ldr r2, =0x00003b58 - adds r1, r2 - str r1, [r4] - ldr r2, =gUnknown_0860B324 - ldrb r1, [r1, 0xD] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl StringCopy - ldr r1, =gUnknown_0860B310 - ldr r0, [r4] - ldrb r0, [r0, 0xD] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - adds r0, r5, 0 - bl StringCopy10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E794 - - thumb_func_start sub_818E7E0 -sub_818E7E0: @ 818E7E0 - push {r4,lr} - adds r3, r1, 0 - ldr r2, =gUnknown_0203CD6C - ldr r1, =gSaveBlock1Ptr - ldr r1, [r1] - ldr r4, =0x00003b58 - adds r1, r4 - str r1, [r2] - ldrb r2, [r1, 0xD] - strb r2, [r0] - ldr r2, =gUnknown_0860B310 - ldrb r0, [r1, 0xD] - lsls r0, 2 - adds r0, r2 - ldr r1, [r0] - adds r0, r3, 0 - bl StringCopy - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E7E0 - - thumb_func_start sub_818E81C -sub_818E81C: @ 818E81C - push {r4,lr} - ldr r3, =gUnknown_0203CD6C - ldr r1, =gSaveBlock1Ptr - ldr r1, [r1] - ldr r4, =0x00003b58 - adds r2, r1, r4 - str r2, [r3] - ldr r2, =0x00003b5c - adds r1, r2 - bl StringCopy - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E81C - - thumb_func_start sub_818E848 -sub_818E848: @ 818E848 - ldr r2, =gUnknown_0203CD6C - ldr r1, =gSaveBlock1Ptr - ldr r1, [r1] - ldr r3, =0x00003b58 - adds r1, r3 - str r1, [r2] - ldrb r1, [r1, 0xE] - strb r1, [r0] - bx lr - .pool - thumb_func_end sub_818E848 - - thumb_func_start sub_818E868 -sub_818E868: @ 818E868 - push {lr} - lsls r1, 24 - ldr r2, =gUnknown_0860B338 - lsrs r1, 22 - adds r1, r2 - ldr r1, [r1] - bl StringCopy - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E868 - - thumb_func_start sub_818E880 -sub_818E880: @ 818E880 - push {lr} - ldr r1, =gUnknown_0203CD6C - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =0x00003b58 - adds r0, r2 - str r0, [r1] - ldrb r0, [r0, 0x2] - cmp r0, 0x4 - bls _0818E8A4 - movs r0, 0x1 - b _0818E8AE - .pool -_0818E8A4: - cmp r0, 0 - beq _0818E8AC - movs r0, 0 - b _0818E8AE -_0818E8AC: - movs r0, 0x2 -_0818E8AE: - pop {r1} - bx r1 - thumb_func_end sub_818E880 - - thumb_func_start sub_818E8B4 -sub_818E8B4: @ 818E8B4 - push {lr} - ldr r1, =gUnknown_0203CD6C - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =0x00003b58 - adds r0, r2 - str r0, [r1] - ldrb r0, [r0, 0x1] - cmp r0, 0x1 - beq _0818E8D8 - movs r0, 0 - b _0818E8DA - .pool -_0818E8D8: - movs r0, 0x1 -_0818E8DA: - pop {r1} - bx r1 - thumb_func_end sub_818E8B4 - - thumb_func_start sub_818E8E0 -sub_818E8E0: @ 818E8E0 - push {r4,lr} - movs r3, 0 - ldr r1, =gUnknown_0203CD6C - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r4, =0x00003b58 - adds r2, r0, r4 - str r2, [r1] - ldrb r0, [r2, 0x2] - cmp r0, 0x4 - bhi _0818E8FC - ldrb r0, [r2, 0x3] - cmp r0, 0x4 - bls _0818E8FE -_0818E8FC: - movs r3, 0x1 -_0818E8FE: - adds r0, r3, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_818E8E0 - - thumb_func_start sub_818E914 -sub_818E914: @ 818E914 - push {lr} - ldr r0, =gStringVar2 - ldr r1, =gStringVar1 - bl sub_818E794 - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E914 - - thumb_func_start sub_818E92C -sub_818E92C: @ 818E92C - push {lr} - ldr r1, =c2_exit_to_overworld_2_switch - movs r0, 0x3 - bl sub_81357FC - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E92C - - thumb_func_start sub_818E940 -sub_818E940: @ 818E940 - ldr r1, =gUnknown_0203CD6C - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =0x00003b58 - adds r0, r2 - str r0, [r1] - movs r1, 0x1 - strb r1, [r0, 0x1] - bx lr - .pool - thumb_func_end sub_818E940 - - thumb_func_start sub_818E960 -sub_818E960: @ 818E960 - ldr r1, =gUnknown_0203CD6C - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =0x00003b58 - adds r0, r2 - str r0, [r1] - ldr r2, =gSpecialVar_0x8005 - ldr r1, =gUnknown_0860B34C - ldrb r0, [r0, 0xD] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r2] - bx lr - .pool - thumb_func_end sub_818E960 - - thumb_func_start sub_818E990 -sub_818E990: @ 818E990 - ldr r1, =gUnknown_0203CD6C - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =0x00003b58 - adds r0, r2 - str r0, [r1] - ldrb r0, [r0, 0xD] - bx lr - .pool - thumb_func_end sub_818E990 - - thumb_func_start sub_818E9AC -sub_818E9AC: @ 818E9AC - push {lr} - ldr r1, =gUnknown_0860D090 - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E9AC - - thumb_func_start sub_818E9CC -sub_818E9CC: @ 818E9CC - push {r4-r7,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r5, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r7, r0, 16 - ldr r0, [r4] - ldr r2, =0x00000ca8 - adds r0, r2 - movs r6, 0 - strb r6, [r0] - ldr r1, [r4] - adds r2, 0xA - adds r0, r1, r2 - strh r6, [r0] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r4] - ldr r2, =0x00000ca9 - adds r1, r2 - ldrb r2, [r1] - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r4, [r4] - ldr r0, =0x00000cdc - adds r3, r4, r0 - ldr r2, =gUnknown_0860D0EC - lsls r1, r5, 2 - lsls r0, r7, 3 - adds r1, r0 - adds r1, r2 - ldr r0, [r3] - ldr r1, [r1] - ands r0, r1 - cmp r0, 0 - bne _0818EA3E - lsls r0, r5, 1 - lsls r1, r7, 2 - adds r0, r1 - ldr r2, =0x00000d0c - adds r1, r4, r2 - adds r1, r0 - strh r6, [r1] -_0818EA3E: - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0x4 - ldrsb r1, [r0, r1] - movs r2, 0x5 - ldrsb r2, [r0, r2] - movs r3, 0x1 - negs r3, r3 - movs r0, 0 - bl saved_warp2_set - ldr r0, =gUnknown_02038BCA - strh r6, [r0] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E9CC - - thumb_func_start sub_818EA84 -sub_818EA84: @ 818EA84 - push {r4-r6,lr} - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r5, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x9 - bls _0818EAA8 - b _0818ED10 -_0818EAA8: - lsls r0, 2 - ldr r1, =_0818EAC8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0818EAC8: - .4byte _0818EAF0 - .4byte _0818EB14 - .4byte _0818EB48 - .4byte _0818EB64 - .4byte _0818EB80 - .4byte _0818EB98 - .4byte _0818EBB4 - .4byte _0818EC40 - .4byte _0818ECD0 - .4byte _0818ECF4 -_0818EAF0: - ldr r3, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r5, 1 - lsls r2, r6, 2 - adds r1, r2 - ldr r2, =0x00000d0c - adds r0, r2 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r3] - b _0818ED10 - .pool -_0818EB14: - ldr r4, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r3, =0x00000cdc - adds r2, r3 - ldr r3, =gUnknown_0860D0EC - lsls r0, r5, 2 - lsls r1, r6, 3 - adds r0, r1 - adds r0, r3 - ldr r1, [r2] - ldr r0, [r0] - ands r1, r0 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - strh r0, [r4] - b _0818ED10 - .pool -_0818EB48: - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000d08 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 31 - b _0818ECBE - .pool -_0818EB64: - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r3, =0x00000d08 - adds r0, r3 - ldrb r0, [r0] - lsls r0, 30 - b _0818ECBE - .pool -_0818EB80: - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000d08 - adds r0, r2 - b _0818ECBA - .pool -_0818EB98: - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r3, =0x00000d08 - adds r0, r3 - ldrb r0, [r0] - lsls r0, 28 - b _0818ECBE - .pool -_0818EBB4: - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bne _0818EC04 - cmp r5, 0 - beq _0818EBE8 - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000d08 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 26 - b _0818ECBE - .pool -_0818EBE8: - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r3, =0x00000d08 - adds r0, r3 - ldrb r0, [r0] - lsls r0, 27 - b _0818ECBE - .pool -_0818EC04: - cmp r5, 0 - beq _0818EC24 - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000d08 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 30 - b _0818ECBE - .pool -_0818EC24: - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r3, =0x00000d08 - adds r0, r3 - ldrb r0, [r0] - lsls r0, 31 - b _0818ECBE - .pool -_0818EC40: - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bne _0818EC90 - cmp r5, 0 - beq _0818EC74 - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000d08 - adds r0, r2 - ldrb r0, [r0] - lsrs r0, 7 - strh r0, [r1] - b _0818ED10 - .pool -_0818EC74: - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r3, =0x00000d08 - adds r0, r3 - ldrb r0, [r0] - lsls r0, 25 - b _0818ECBE - .pool -_0818EC90: - cmp r5, 0 - beq _0818ECB0 - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000d08 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 28 - b _0818ECBE - .pool -_0818ECB0: - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r3, =0x00000d08 - adds r0, r3 -_0818ECBA: - ldrb r0, [r0] - lsls r0, 29 -_0818ECBE: - lsrs r0, 31 - strh r0, [r1] - b _0818ED10 - .pool -_0818ECD0: - bl sub_81B8558 - ldr r2, =gUnknown_0203CEF8 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - movs r1, 0xCB - lsls r1, 4 - adds r0, r1 - ldrh r1, [r0] - strb r1, [r2] - ldrh r0, [r0] - lsrs r0, 8 - strb r0, [r2, 0x1] - b _0818ED10 - .pool -_0818ECF4: - ldr r2, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r3, =0x00000d0a - adds r0, r1, r3 - ldrb r0, [r0] - lsls r0, 1 - adds r3, 0x1 - adds r1, r3 - ldr r3, =0x0000fffd - adds r0, r3 - ldrb r1, [r1] - adds r0, r1 - strh r0, [r2] -_0818ED10: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818EA84 - - thumb_func_start sub_818ED28 -sub_818ED28: @ 818ED28 - push {r4,r5,lr} - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r4, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x8 - bls _0818ED4C - b _0818F01E -_0818ED4C: - lsls r0, 2 - ldr r1, =_0818ED6C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0818ED6C: - .4byte _0818ED90 - .4byte _0818EDB4 - .4byte _0818EE10 - .4byte _0818EE34 - .4byte _0818EE5C - .4byte _0818EE78 - .4byte _0818EEA0 - .4byte _0818EF50 - .4byte _0818F008 -_0818ED90: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - lsls r0, r4, 1 - lsls r1, r5, 2 - adds r0, r1 - ldr r1, =0x00000d0c - adds r2, r1 - adds r2, r0 - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - strh r0, [r2] - b _0818F01E - .pool -_0818EDB4: - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - cmp r0, 0 - beq _0818EDE8 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r0, =0x00000cdc - adds r2, r0 - ldr r3, =gUnknown_0860D0EC - lsls r1, r4, 2 - lsls r0, r5, 3 - adds r1, r0 - adds r1, r3 - ldr r0, [r2] - ldr r1, [r1] - orrs r0, r1 - str r0, [r2] - b _0818F01E - .pool -_0818EDE8: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r1, =0x00000cdc - adds r2, r1 - ldr r3, =gUnknown_0860D0FC - lsls r1, r4, 2 - lsls r0, r5, 3 - adds r1, r0 - adds r1, r3 - ldr r0, [r2] - ldr r1, [r1] - ands r0, r1 - str r0, [r2] - b _0818F01E - .pool -_0818EE10: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r1, =0x00000d08 - adds r2, r1 - movs r1, 0x1 - ands r1, r0 - ldrb r3, [r2] - movs r0, 0x2 - negs r0, r0 - b _0818EF74 - .pool -_0818EE34: - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r2, =0x00000d08 - adds r3, r2 - movs r1, 0x1 - ands r1, r0 - lsls r1, 1 - ldrb r2, [r3] - movs r0, 0x3 - negs r0, r0 - b _0818EFF4 - .pool -_0818EE5C: - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r1, =0x00000d08 - adds r3, r1 - b _0818EFE8 - .pool -_0818EE78: - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r2, =0x00000d08 - adds r3, r2 - movs r1, 0x1 - ands r1, r0 - lsls r1, 3 - ldrb r2, [r3] - movs r0, 0x9 - negs r0, r0 - b _0818EFF4 - .pool -_0818EEA0: - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x1 - bne _0818EF00 - cmp r4, 0 - beq _0818EEDC - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r2, =0x00000d08 - adds r3, r2 - ands r1, r0 - lsls r1, 5 - ldrb r2, [r3] - movs r0, 0x21 - negs r0, r0 - b _0818EFF4 - .pool -_0818EEDC: - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r2, =0x00000d08 - adds r3, r2 - ands r1, r0 - lsls r1, 4 - ldrb r2, [r3] - movs r0, 0x11 - negs r0, r0 - b _0818EFF4 - .pool -_0818EF00: - cmp r4, 0 - beq _0818EF2C - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r1, =0x00000d08 - adds r3, r1 - movs r1, 0x1 - ands r1, r0 - lsls r1, 1 - ldrb r2, [r3] - movs r0, 0x3 - negs r0, r0 - b _0818EFF4 - .pool -_0818EF2C: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r1, =0x00000d08 - adds r2, r1 - movs r1, 0x1 - ands r1, r0 - ldrb r3, [r2] - movs r0, 0x2 - negs r0, r0 - b _0818EF74 - .pool -_0818EF50: - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x1 - bne _0818EFB0 - cmp r4, 0 - beq _0818EF8C - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r1, [r0] - ldr r0, =0x00000d08 - adds r2, r0 - lsls r1, 7 - ldrb r3, [r2] - movs r0, 0x7F -_0818EF74: - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - b _0818F01E - .pool -_0818EF8C: - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r2, =0x00000d08 - adds r3, r2 - ands r1, r0 - lsls r1, 6 - ldrb r2, [r3] - movs r0, 0x41 - negs r0, r0 - b _0818EFF4 - .pool -_0818EFB0: - cmp r4, 0 - beq _0818EFDC - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r1, =0x00000d08 - adds r3, r1 - movs r1, 0x1 - ands r1, r0 - lsls r1, 3 - ldrb r2, [r3] - movs r0, 0x9 - negs r0, r0 - b _0818EFF4 - .pool -_0818EFDC: - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r2, =0x00000d08 - adds r3, r2 -_0818EFE8: - movs r1, 0x1 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r3] - movs r0, 0x5 - negs r0, r0 -_0818EFF4: - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - b _0818F01E - .pool -_0818F008: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r0, =gUnknown_0203CEF8 - ldrb r1, [r0] - ldrb r0, [r0, 0x1] - lsls r0, 8 - orrs r1, r0 - movs r0, 0xCB - lsls r0, 4 - adds r2, r0 - strh r1, [r2] -_0818F01E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818ED28 - - thumb_func_start sub_818F02C -sub_818F02C: @ 818F02C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x3C - movs r0, 0 - str r0, [sp, 0x8] - str r0, [sp, 0xC] - str r0, [sp, 0x10] - movs r0, 0x20 - bl AllocZeroed - str r0, [sp, 0x18] - movs r0, 0x18 - bl AllocZeroed - str r0, [sp, 0x1C] - ldr r4, =gSaveBlock2Ptr - ldr r1, [r4] - ldr r2, =0x00000ca9 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - adds r0, 0x1 - ldr r3, =0x00000d0a - adds r1, r3 - strb r0, [r1] - ldr r0, =0x000040ce - bl VarGet - ldr r1, [r4] - adds r0, 0x1 - ldr r5, =0x00000d0b - adds r1, r5 - strb r0, [r1] - ldr r2, [r4] - ldr r7, =0x00000d24 - adds r3, r2, r7 - ldrh r0, [r3] - ldr r5, =0x000003ff - adds r1, r5, 0 - orrs r0, r1 - strh r0, [r3] - ldr r3, =0x00000d25 - adds r2, r3 - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - ldr r1, [r4] - adds r1, r3 - ldrb r2, [r1] - movs r0, 0x19 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r4] - adds r1, r3 - ldrb r2, [r1] - movs r0, 0x1F - ands r0, r2 - strb r0, [r1] - movs r7, 0 - mov r10, r7 - mov r8, r4 - ldr r0, =gUnknown_02024488 - mov r9, r0 - movs r4, 0 -_0818F0BA: - mov r1, r8 - ldr r0, [r1] - ldr r2, =0x00000caa - adds r0, r2 - adds r0, r4 - ldrh r0, [r0] - movs r3, 0x64 - muls r0, r3 - add r0, r9 - movs r1, 0xB - movs r2, 0 - bl GetMonData - mov r5, r8 - ldr r1, [r5] - ldr r7, =0x00000d64 - adds r1, r7 - adds r1, r4 - strh r0, [r1] - movs r5, 0 - mov r0, r10 - lsls r7, r0, 4 - adds r6, r7, 0 -_0818F0E8: - mov r1, r8 - ldr r0, [r1] - ldr r2, =0x00000caa - adds r0, r2 - adds r0, r4 - ldrh r0, [r0] - movs r3, 0x64 - muls r0, r3 - add r0, r9 - adds r1, r5, 0 - adds r1, 0xD - movs r2, 0 - bl GetMonData - mov r2, r8 - ldr r1, [r2] - ldr r3, =0x00000efc - adds r1, r3 - adds r1, r6 - strh r0, [r1] - adds r6, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _0818F0E8 - movs r5, 0 - ldr r6, =gSaveBlock2Ptr -_0818F11C: - ldr r0, [r6] - ldr r1, =0x00000caa - adds r0, r1 - adds r0, r4 - ldrh r0, [r0] - movs r2, 0x64 - muls r0, r2 - add r0, r9 - adds r1, r5, 0 - adds r1, 0x1A - movs r2, 0 - bl GetMonData - ldr r1, [r6] - adds r2, r5, r7 - ldr r3, =0x00000f04 - adds r1, r3 - adds r1, r2 - strb r0, [r1] - adds r5, 0x1 - cmp r5, 0x5 - ble _0818F11C - mov r5, r8 - ldr r0, [r5] - ldr r1, =0x00000caa - adds r0, r1 - adds r0, r4 - ldrh r0, [r0] - movs r2, 0x64 - muls r0, r2 - add r0, r9 - bl GetNature - ldr r1, [r5] - adds r1, r7 - ldr r3, =0x00000f0a - adds r1, r3 - strb r0, [r1] - adds r4, 0x2 - movs r5, 0x1 - add r10, r5 - mov r7, r10 - cmp r7, 0x2 - ble _0818F0BA - mov r10, r5 - movs r0, 0x4 - str r0, [sp, 0x34] - movs r1, 0x6 - str r1, [sp, 0x38] -_0818F17E: - mov r2, r10 - cmp r2, 0x5 - ble _0818F22C -_0818F184: - bl sub_81A39C4 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl sub_8162548 - lsls r0, 16 - lsrs r4, r0, 16 - movs r5, 0x1 - cmp r5, r10 - bge _0818F1CA - ldr r3, =gSaveBlock2Ptr - ldr r0, [r3] - ldr r7, =0x00000d28 - adds r0, r7 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - adds r2, r3, 0 - cmp r0, r4 - beq _0818F1CA - ldr r3, =0x00000d24 -_0818F1B2: - adds r5, 0x1 - cmp r5, r10 - bge _0818F1CA - ldr r0, [r2] - lsls r1, r5, 2 - adds r0, r1 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - cmp r0, r4 - bne _0818F1B2 -_0818F1CA: - cmp r5, r10 - bne _0818F184 - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r1, [sp, 0x34] - adds r3, r1 - ldr r2, =0x00000d24 - adds r3, r2 - ldr r5, =0x000003ff - adds r0, r5, 0 - adds r2, r4, 0 - ands r2, r0 - ldrh r0, [r3] - ldr r7, =0xfffffc00 - adds r1, r7, 0 - b _0818F292 - .pool -_0818F22C: - bl sub_81A39C4 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl sub_8162548 - lsls r0, 16 - lsrs r4, r0, 16 - movs r5, 0x1 - cmp r5, r10 - bge _0818F274 - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r2, =0x00000d28 - adds r0, r2 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - adds r2, r1, 0 - cmp r0, r4 - beq _0818F274 - ldr r3, =0x00000d24 -_0818F25C: - adds r5, 0x1 - cmp r5, r10 - bge _0818F274 - ldr r0, [r2] - lsls r1, r5, 2 - adds r0, r1 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - cmp r0, r4 - bne _0818F25C -_0818F274: - cmp r5, r10 - bne _0818F22C - ldr r5, =gSaveBlock2Ptr - ldr r3, [r5] - ldr r7, [sp, 0x34] - adds r3, r7 - ldr r0, =0x00000d24 - adds r3, r0 - ldr r1, =0x000003ff - adds r0, r1, 0 - adds r2, r4, 0 - ands r2, r0 - ldrh r0, [r3] - ldr r5, =0xfffffc00 - adds r1, r5, 0 -_0818F292: - ands r0, r1 - orrs r0, r2 - strh r0, [r3] - movs r5, 0 - lsls r4, 16 - str r4, [sp, 0x2C] - ldr r7, [sp, 0x38] - str r7, [sp, 0x20] -_0818F2A2: - lsls r0, r5, 1 - mov r9, r0 - adds r1, r5, 0x1 - str r1, [sp, 0x24] - lsls r2, r5, 2 - str r2, [sp, 0x28] -_0818F2AE: - ldr r3, [sp, 0x2C] - lsrs r0, r3, 16 - bl sub_8163524 - lsls r0, 16 - lsrs r6, r0, 16 - movs r7, 0 - cmp r7, r5 - bge _0818F300 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, [sp, 0x8] - mov r8, r1 - ldr r2, [sp, 0xC] - mov r12, r2 - ldr r3, =0x00000d64 - adds r0, r3 - ldr r1, [sp, 0x20] - adds r4, r1, r0 -_0818F2D4: - ldrh r3, [r4] - cmp r3, r6 - beq _0818F300 - ldr r2, =gUnknown_0203BC8C - ldr r1, [r2] - lsls r0, r6, 4 - adds r2, r0, r1 - ldrh r0, [r2] - cmp r8, r0 - beq _0818F300 - cmp r12, r0 - beq _0818F300 - lsls r0, r3, 4 - adds r0, r1 - ldrb r0, [r0, 0xA] - ldrb r2, [r2, 0xA] - cmp r0, r2 - beq _0818F300 - adds r4, 0x2 - adds r7, 0x1 - cmp r7, r5 - blt _0818F2D4 -_0818F300: - cmp r7, r5 - bne _0818F2AE - ldr r3, =gSaveBlock2Ptr - ldr r0, [r3] - ldr r1, [sp, 0x38] - add r1, r9 - ldr r5, =0x00000d64 - adds r0, r5 - adds r0, r1 - strh r6, [r0] - ldr r2, [sp, 0x28] - add r2, sp - adds r2, 0x8 - ldr r0, =gUnknown_0203BC8C - ldr r1, [r0] - lsls r0, r6, 4 - adds r0, r1 - ldrh r0, [r0] - str r0, [r2] - ldr r5, [sp, 0x24] - cmp r5, 0x2 - ble _0818F2A2 - ldr r2, [r3] - ldr r7, [sp, 0x34] - adds r2, r7 - ldr r0, =0x00000d25 - adds r2, r0 - ldrb r0, [r2] - movs r3, 0x5 - negs r3, r3 - adds r1, r3, 0 - ands r0, r1 - strb r0, [r2] - ldr r5, =gSaveBlock2Ptr - ldr r2, [r5] - adds r2, r7 - ldr r7, =0x00000d25 - adds r2, r7 - ldrb r0, [r2] - subs r3, 0x14 - adds r1, r3, 0 - ands r0, r1 - strb r0, [r2] - ldr r1, [r5] - ldr r5, [sp, 0x34] - adds r1, r5 - adds r1, r7 - ldrb r2, [r1] - movs r0, 0x1F - ands r0, r2 - strb r0, [r1] - adds r5, 0x4 - str r5, [sp, 0x34] - ldr r7, [sp, 0x38] - adds r7, 0x6 - str r7, [sp, 0x38] - movs r0, 0x1 - add r10, r0 - mov r1, r10 - cmp r1, 0xF - bgt _0818F37C - b _0818F17E -_0818F37C: - movs r7, 0 - ldr r2, [sp, 0x18] - strh r7, [r2] - movs r3, 0 - mov r10, r3 - ldr r6, =gBitTable - ldr r5, =gBaseStats -_0818F38A: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - mov r2, r10 - lsls r1, r2, 1 - ldr r3, =0x00000caa - adds r0, r3 - adds r0, r1 - ldrh r0, [r0] - subs r4, r0, 0x1 - movs r0, 0x64 - muls r4, r0 - ldr r0, =gPlayerParty - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x3B - movs r2, 0 - bl GetMonData - ldr r2, [sp, 0x18] - ldrh r1, [r2] - adds r1, r0 - strh r1, [r2] - adds r0, r4, 0 - movs r1, 0x3C - movs r2, 0 - bl GetMonData - ldr r3, [sp, 0x18] - ldrh r1, [r3] - adds r1, r0 - strh r1, [r3] - adds r0, r4, 0 - movs r1, 0x3E - movs r2, 0 - bl GetMonData - ldr r2, [sp, 0x18] - ldrh r1, [r2] - adds r1, r0 - strh r1, [r2] - adds r0, r4, 0 - movs r1, 0x3F - movs r2, 0 - bl GetMonData - ldr r3, [sp, 0x18] - ldrh r1, [r3] - adds r1, r0 - strh r1, [r3] - adds r0, r4, 0 - movs r1, 0x3D - movs r2, 0 - bl GetMonData - ldr r2, [sp, 0x18] - ldrh r1, [r2] - adds r1, r0 - strh r1, [r2] - adds r0, r4, 0 - movs r1, 0x3A - movs r2, 0 - bl GetMonData - ldr r3, [sp, 0x18] - ldrh r1, [r3] - adds r1, r0 - strh r1, [r3] - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl GetMonData - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r0, [r1, 0x6] - lsls r0, 2 - adds r0, r6 - ldr r0, [r0] - orrs r7, r0 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl GetMonData - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r0, [r1, 0x7] - lsls r0, 2 - adds r0, r6 - ldr r0, [r0] - orrs r7, r0 - movs r0, 0x1 - add r10, r0 - mov r1, r10 - cmp r1, 0x2 - ble _0818F38A - movs r4, 0 - movs r1, 0x1 - movs r5, 0x1F -_0818F458: - adds r0, r7, 0 - ands r0, r1 - cmp r0, 0 - beq _0818F462 - adds r4, 0x1 -_0818F462: - asrs r7, 1 - subs r5, 0x1 - cmp r5, 0 - bge _0818F458 - bl sub_8165C40 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x14] - adds r2, r0, 0 - adds r0, r4, 0 - muls r0, r2 - movs r1, 0x14 - bl __divsi3 - ldr r3, [sp, 0x18] - ldrh r1, [r3] - adds r1, r0 - strh r1, [r3] - movs r5, 0x1 - mov r10, r5 - adds r6, r3, 0 - adds r6, 0x2 - movs r7, 0x2 - str r7, [sp, 0x30] -_0818F494: - movs r7, 0 - strh r7, [r6] - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - mov r2, r10 - lsls r1, r2, 2 - adds r0, r1 - ldr r3, =0x00000d24 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - bl sub_8190168 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r5, 0 - ldr r0, [sp, 0x30] - mov r9, r0 -_0818F4BC: - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - mov r4, r9 - add r4, r10 - adds r4, r5 - lsls r4, 1 - ldr r2, =0x00000d64 - adds r0, r2 - adds r0, r4 - ldrh r1, [r0] - ldr r3, =gUnknown_0203BC8C - ldr r0, [r3] - lsls r1, 4 - adds r1, r0 - ldrh r0, [r1] - ldrb r3, [r1, 0xB] - ldrb r1, [r1, 0xC] - str r1, [sp] - ldr r1, [sp, 0x1C] - str r1, [sp, 0x4] - ldr r1, [sp, 0x14] - mov r2, r8 - bl sub_818F720 - ldr r2, [sp, 0x1C] - ldr r1, [r2, 0x4] - ldrh r0, [r6] - adds r0, r1 - ldr r1, [r2, 0x8] - adds r0, r1 - ldr r1, [r2, 0x10] - adds r0, r1 - ldr r1, [r2, 0x14] - adds r0, r1 - ldr r1, [r2, 0xC] - adds r0, r1 - ldr r1, [r2] - adds r0, r1 - strh r0, [r6] - ldr r3, =gSaveBlock2Ptr - ldr r0, [r3] - ldr r1, =0x00000d64 - adds r0, r1 - adds r0, r4 - ldrh r0, [r0] - ldr r2, =gUnknown_0203BC8C - ldr r1, [r2] - lsls r0, 4 - adds r0, r1 - ldrh r0, [r0] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - ldr r3, =gBaseStats - adds r1, r3 - ldrb r0, [r1, 0x6] - lsls r0, 2 - ldr r2, =gBitTable - adds r0, r2 - ldr r0, [r0] - orrs r7, r0 - ldrb r0, [r1, 0x7] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - orrs r7, r0 - adds r5, 0x1 - cmp r5, 0x2 - ble _0818F4BC - movs r4, 0 - movs r1, 0x1 - movs r5, 0x1F -_0818F54C: - adds r0, r7, 0 - ands r0, r1 - cmp r0, 0 - beq _0818F556 - adds r4, 0x1 -_0818F556: - asrs r7, 1 - subs r5, 0x1 - cmp r5, 0 - bge _0818F54C - ldr r3, [sp, 0x14] - adds r0, r4, 0 - muls r0, r3 - movs r1, 0x14 - bl __divsi3 - ldrh r1, [r6] - adds r1, r0 - strh r1, [r6] - adds r6, 0x2 - ldr r5, [sp, 0x30] - adds r5, 0x2 - str r5, [sp, 0x30] - movs r7, 0x1 - add r10, r7 - mov r0, r10 - cmp r0, 0xF - ble _0818F494 - movs r1, 0 - mov r10, r1 - ldr r2, =0x000003ff - mov r8, r2 -_0818F58A: - mov r5, r10 - adds r5, 0x1 - adds r7, r5, 0 - cmp r5, 0xF - bgt _0818F626 - mov r3, r10 - lsls r0, r3, 1 - ldr r1, [sp, 0x18] - adds r6, r0, r1 - lsls r0, r5, 1 - adds r4, r0, r1 -_0818F5A0: - ldrh r1, [r6] - ldrh r0, [r4] - cmp r1, r0 - bcc _0818F5C2 - cmp r1, r0 - bne _0818F61E - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - lsls r0, r5, 2 - adds r0, r1, r0 - ldr r2, =0x00000d24 - adds r0, r2 - ldrh r0, [r0] - lsls r2, r0, 22 - lsrs r0, r2, 22 - cmp r0, r8 - bne _0818F602 -_0818F5C2: - mov r0, r10 - adds r1, r5, 0 - ldr r2, [sp, 0x18] - bl sub_818F904 - b _0818F600 - .pool -_0818F600: - b _0818F61E -_0818F602: - mov r3, r10 - lsls r0, r3, 2 - adds r0, r1, r0 - ldr r1, =0x00000d24 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 22 - cmp r0, r2 - bls _0818F61E - mov r0, r10 - adds r1, r5, 0 - ldr r2, [sp, 0x18] - bl sub_818F904 -_0818F61E: - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0xF - ble _0818F5A0 -_0818F626: - mov r10, r7 - mov r2, r10 - cmp r2, 0xE - ble _0818F58A - bl sub_81A3610 - lsls r0, 24 - cmp r0, 0 - beq _0818F6EE - movs r3, 0 - mov r10, r3 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r4, =0x00000d24 - adds r1, r4 - ldrh r1, [r1] - lsls r1, 22 - lsrs r1, 22 - ldr r3, =0x000003ff - adds r2, r0, 0 - ldr r6, =gUnknown_0860D3F1 - cmp r1, r3 - beq _0818F674 - adds r5, r2, 0 -_0818F656: - movs r7, 0x1 - add r10, r7 - mov r0, r10 - cmp r0, 0xF - bgt _0818F674 - ldr r0, [r5] - mov r7, r10 - lsls r1, r7, 2 - adds r0, r1 - adds r0, r4 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - cmp r0, r3 - bne _0818F656 -_0818F674: - mov r1, r10 - lsls r0, r1, 1 - adds r0, r6 - ldrb r0, [r0] - cmp r0, 0 - beq _0818F6AC - movs r5, 0 - ldr r2, [r2] - ldr r3, =0x00000d24 - adds r2, r3 - ldrh r1, [r2] - ldr r0, =0xfffffc00 - ands r0, r1 - ldr r7, =0x000003fe - adds r1, r7, 0 - b _0818F6BE - .pool -_0818F6AC: - movs r5, 0x1 - ldr r2, [r2] - ldr r0, =0x00000d28 - adds r2, r0 - ldrh r1, [r2] - ldr r0, =0xfffffc00 - ands r0, r1 - ldr r3, =0x000003fe - adds r1, r3, 0 -_0818F6BE: - orrs r0, r1 - strh r0, [r2] - movs r7, 0 - mov r10, r7 - lsls r0, r5, 1 - adds r0, r5 - lsls r4, r0, 1 -_0818F6CC: - mov r1, r10 - lsls r0, r1, 24 - lsrs r0, 24 - bl sub_81A4FF0 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - ldr r2, =0x00000d64 - adds r1, r2 - adds r1, r4 - strh r0, [r1] - adds r4, 0x2 - movs r3, 0x1 - add r10, r3 - mov r5, r10 - cmp r5, 0x2 - ble _0818F6CC -_0818F6EE: - ldr r0, [sp, 0x18] - bl Free - ldr r0, [sp, 0x1C] - bl Free - add sp, 0x3C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818F02C - - thumb_func_start sub_818F720 -sub_818F720: @ 818F720 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - adds r7, r1, 0 - mov r9, r2 - ldr r1, [sp, 0x3C] - ldr r2, [sp, 0x40] - mov r8, r2 - lsls r0, 16 - lsrs r6, r0, 16 - lsls r3, 24 - lsrs r5, r3, 24 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x18] - movs r1, 0 - adds r4, r5, 0 - movs r3, 0x1 - movs r2, 0x5 -_0818F74C: - adds r0, r4, 0 - ands r0, r3 - cmp r0, 0 - beq _0818F756 - adds r1, 0x1 -_0818F756: - lsrs r4, 1 - subs r2, 0x1 - cmp r2, 0 - bge _0818F74C - movs r0, 0xFF - lsls r0, 1 - bl __divsi3 - lsls r0, 16 - lsrs r3, r0, 16 - lsls r0, r6, 3 - mov r10, r0 - movs r1, 0 - mov r12, r1 - mov r1, sp - movs r2, 0x5 -_0818F776: - mov r0, r12 - str r0, [r1] - adds r0, r5, 0 - ands r0, r4 - cmp r0, 0 - beq _0818F784 - str r3, [r1] -_0818F784: - lsls r0, r4, 25 - lsrs r4, r0, 24 - adds r1, 0x4 - subs r2, 0x1 - cmp r2, 0 - bge _0818F776 - ldr r0, =0x0000012f - cmp r6, r0 - bne _0818F7A0 - movs r0, 0x1 - b _0818F7CA - .pool -_0818F7A0: - mov r2, r10 - subs r0, r2, r6 - lsls r0, 2 - ldr r1, =gBaseStats - adds r0, r1 - ldrb r0, [r0] - lsls r0, 1 - mov r2, r9 - adds r1, r0, r2 - ldr r0, [sp] - cmp r0, 0 - bge _0818F7BA - adds r0, 0x3 -_0818F7BA: - asrs r0, 2 - adds r0, r1, r0 - muls r0, r7 - movs r1, 0x64 - bl __divsi3 - adds r0, r7 - adds r0, 0xA -_0818F7CA: - mov r1, r8 - str r0, [r1] - mov r2, r10 - subs r0, r2, r6 - lsls r0, 2 - ldr r1, =gBaseStats - adds r4, r0, r1 - ldrb r0, [r4, 0x1] - lsls r0, 1 - mov r2, r9 - adds r1, r0, r2 - ldr r0, [sp, 0x4] - cmp r0, 0 - bge _0818F7E8 - adds r0, 0x3 -_0818F7E8: - asrs r0, 2 - adds r0, r1, r0 - muls r0, r7 - movs r1, 0x64 - bl __divsi3 - adds r1, r0, 0 - adds r1, 0x5 - mov r0, r8 - str r1, [r0, 0x4] - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0x18] - movs r2, 0x1 - bl nature_stat_mod - lsls r0, 24 - lsrs r0, 24 - mov r1, r8 - str r0, [r1, 0x4] - ldrb r0, [r4, 0x2] - lsls r0, 1 - mov r2, r9 - adds r1, r0, r2 - ldr r0, [sp, 0x8] - cmp r0, 0 - bge _0818F820 - adds r0, 0x3 -_0818F820: - asrs r0, 2 - adds r0, r1, r0 - muls r0, r7 - movs r1, 0x64 - bl __divsi3 - adds r1, r0, 0 - adds r1, 0x5 - mov r0, r8 - str r1, [r0, 0x8] - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0x18] - movs r2, 0x2 - bl nature_stat_mod - lsls r0, 24 - lsrs r0, 24 - mov r1, r8 - str r0, [r1, 0x8] - ldrb r0, [r4, 0x3] - lsls r0, 1 - mov r2, r9 - adds r1, r0, r2 - ldr r0, [sp, 0xC] - cmp r0, 0 - bge _0818F858 - adds r0, 0x3 -_0818F858: - asrs r0, 2 - adds r0, r1, r0 - muls r0, r7 - movs r1, 0x64 - bl __divsi3 - adds r1, r0, 0 - adds r1, 0x5 - mov r0, r8 - str r1, [r0, 0xC] - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0x18] - movs r2, 0x3 - bl nature_stat_mod - lsls r0, 24 - lsrs r0, 24 - mov r1, r8 - str r0, [r1, 0xC] - ldrb r0, [r4, 0x4] - lsls r0, 1 - mov r2, r9 - adds r1, r0, r2 - ldr r0, [sp, 0x10] - cmp r0, 0 - bge _0818F890 - adds r0, 0x3 -_0818F890: - asrs r0, 2 - adds r0, r1, r0 - muls r0, r7 - movs r1, 0x64 - bl __divsi3 - adds r1, r0, 0 - adds r1, 0x5 - mov r0, r8 - str r1, [r0, 0x10] - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0x18] - movs r2, 0x4 - bl nature_stat_mod - lsls r0, 24 - lsrs r0, 24 - mov r1, r8 - str r0, [r1, 0x10] - ldrb r0, [r4, 0x5] - lsls r0, 1 - mov r1, r9 - adds r2, r0, r1 - ldr r0, [sp, 0x14] - cmp r0, 0 - bge _0818F8C8 - adds r0, 0x3 -_0818F8C8: - asrs r0, 2 - adds r0, r2, r0 - muls r0, r7 - movs r1, 0x64 - bl __divsi3 - adds r1, r0, 0 - adds r1, 0x5 - mov r2, r8 - str r1, [r2, 0x14] - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0x18] - movs r2, 0x5 - bl nature_stat_mod - lsls r0, 24 - lsrs r0, 24 - mov r1, r8 - str r0, [r1, 0x14] - add sp, 0x1C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818F720 - - thumb_func_start sub_818F904 -sub_818F904: @ 818F904 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r3, r0, 1 - mov r12, r3 - adds r4, r3, r2 - ldrh r5, [r4] - lsls r7, r1, 1 - mov r9, r7 - add r2, r9 - ldrh r3, [r2] - strh r3, [r4] - strh r5, [r2] - ldr r2, =gSaveBlock2Ptr - ldr r5, [r2] - lsls r6, r0, 2 - adds r6, r5, r6 - ldr r3, =0x00000d24 - adds r6, r3 - ldrh r7, [r6] - mov r10, r7 - mov r2, r10 - lsls r2, 22 - mov r8, r2 - lsls r2, r1, 2 - adds r5, r2 - adds r5, r3 - ldrh r4, [r5] - lsls r4, 22 - lsrs r4, 22 - ldr r3, =0xfffffc00 - adds r2, r3, 0 - mov r7, r10 - ands r2, r7 - orrs r2, r4 - strh r2, [r6] - mov r2, r8 - lsrs r2, 22 - mov r8, r2 - ldrh r2, [r5] - ands r3, r2 - mov r7, r8 - orrs r3, r7 - strh r3, [r5] - ldr r2, =gSaveBlock2Ptr - mov r8, r2 - add r12, r0 - add r9, r1 - mov r3, r9 - lsls r4, r3, 1 - mov r7, r12 - lsls r3, r7, 1 - ldr r7, =0x00000d64 - movs r6, 0x2 -_0818F974: - mov r1, r8 - ldr r0, [r1] - adds r0, r7 - adds r2, r0, r3 - ldrh r5, [r2] - adds r0, r4 - ldrh r1, [r0] - strh r1, [r2] - strh r5, [r0] - adds r4, 0x2 - adds r3, 0x2 - subs r6, 0x1 - cmp r6, 0 - bge _0818F974 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818F904 - - thumb_func_start sub_818F9B0 -sub_818F9B0: @ 818F9B0 - push {lr} - ldr r0, =gStringVar1 - ldr r2, =gUnknown_085CCD20 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - ldr r3, =0x00000cb2 - adds r1, r3 - ldrh r1, [r1] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl StringCopy - pop {r0} - bx r0 - .pool - thumb_func_end sub_818F9B0 - - thumb_func_start sub_818F9E0 -sub_818F9E0: @ 818F9E0 - push {lr} - ldr r0, =gStringVar1 - ldr r2, =gUnknown_085CCD20 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - ldr r3, =0x00000cb2 - adds r1, r3 - ldrh r1, [r1] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl StringCopy - ldr r0, =gStringVar2 - ldr r1, =gUnknown_02038BCA - ldrh r1, [r1] - bl sub_8195898 - pop {r0} - bx r0 - .pool - thumb_func_end sub_818F9E0 - - thumb_func_start sub_818FA20 -sub_818FA20: @ 818FA20 - push {r4,r5,lr} - ldr r1, =gUnknown_0203CD70 - movs r0, 0 - str r0, [r1] - ldr r4, =gPlayerParty - adds r0, r4, 0 - movs r1, 0x3A - movs r2, 0 - bl GetMonData - ldr r5, =gUnknown_0203CD74 - str r0, [r5] - adds r4, 0x64 - adds r0, r4, 0 - movs r1, 0x3A - movs r2, 0 - bl GetMonData - ldr r1, [r5] - adds r1, r0 - str r1, [r5] - bl calc_player_party_count - ldr r0, =gUnknown_02038BCA - ldrh r0, [r0] - bl sub_8195358 - lsls r0, 16 - lsrs r0, 16 - bl sub_818FBDC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818FA20 - - thumb_func_start sub_818FA74 -sub_818FA74: @ 818FA74 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x30 - adds r5, r2, 0 - str r3, [sp, 0x14] - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x10] - lsls r1, 16 - lsrs r1, 16 - str r1, [sp, 0x28] - lsls r5, 24 - lsrs r5, 24 - add r0, sp, 0xC - movs r1, 0x1 - negs r1, r1 - strb r1, [r0] - ldr r0, [sp, 0x28] - bl sub_8190168 - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - str r6, [sp, 0x2C] - bl sub_8165C40 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0x64 - ldr r4, [sp, 0x10] - adds r3, r4, 0 - muls r3, r0 - str r3, [sp, 0x18] - ldr r6, =gEnemyParty - adds r0, r3, r6 - ldr r7, =gSaveBlock2Ptr - ldr r4, [r7] - lsls r5, 1 - ldr r3, [sp, 0x28] - lsls r1, r3, 1 - adds r1, r3 - lsls r1, 1 - adds r1, r5, r1 - ldr r6, =0x00000d64 - adds r4, r6 - adds r4, r1 - ldrh r3, [r4] - ldr r7, =gUnknown_0203BC8C - ldr r7, [r7] - mov r8, r7 - lsls r3, 4 - add r3, r8 - ldrh r1, [r3] - ldrb r3, [r3, 0xC] - ldr r6, [sp, 0x2C] - str r6, [sp] - ldrh r4, [r4] - lsls r4, 4 - add r4, r8 - ldrb r4, [r4, 0xB] - str r4, [sp, 0x4] - ldr r7, [sp, 0x14] - str r7, [sp, 0x8] - bl sub_8068634 - add r0, sp, 0xC - movs r1, 0x1 - negs r1, r1 - strb r1, [r0] - movs r6, 0 - ldr r2, [sp, 0x18] - str r2, [sp, 0x1C] - mov r10, r5 - ldr r3, =0x00000d64 - mov r9, r3 - ldr r3, =gUnknown_0203BC8C - mov r4, r10 - str r4, [sp, 0x20] -_0818FB18: - ldr r7, =gSaveBlock2Ptr - ldr r1, [r7] - ldr r2, [sp, 0x28] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 1 - mov r8, r0 - mov r5, r10 - add r5, r8 - add r1, r9 - adds r1, r5 - ldrh r0, [r1] - ldr r1, [r3] - lsls r0, 4 - adds r0, r1 - lsls r4, r6, 1 - adds r0, 0x2 - adds r0, r4 - ldrh r1, [r0] - lsls r2, r6, 24 - lsrs r2, 24 - mov r12, r2 - ldr r7, [sp, 0x1C] - ldr r2, =gEnemyParty - adds r0, r7, r2 - mov r2, r12 - str r3, [sp, 0x24] - bl sub_80691F4 - ldr r7, =gSaveBlock2Ptr - ldr r0, [r7] - add r0, r9 - adds r0, r5 - ldrh r0, [r0] - ldr r3, [sp, 0x24] - ldr r1, [r3] - lsls r0, 4 - adds r0, r1 - adds r0, 0x2 - adds r0, r4 - ldrh r0, [r0] - cmp r0, 0xDA - bne _0818FB74 - movs r1, 0 - add r0, sp, 0xC - strb r1, [r0] -_0818FB74: - adds r6, 0x1 - cmp r6, 0x3 - ble _0818FB18 - movs r0, 0x64 - ldr r1, [sp, 0x10] - adds r4, r1, 0 - muls r4, r0 - ldr r0, =gEnemyParty - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x20 - add r2, sp, 0xC - bl SetMonData - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, [sp, 0x20] - add r1, r8 - ldr r2, =0x00000d64 - adds r0, r2 - adds r0, r1 - ldrh r0, [r0] - ldr r1, =gUnknown_0203BC8C - ldr r1, [r1] - lsls r0, 4 - adds r0, r1 - ldrb r2, [r0, 0xA] - lsls r2, 1 - ldr r0, =gBattleFrontierHeldItems - adds r2, r0 - adds r0, r4, 0 - movs r1, 0xC - bl SetMonData - add sp, 0x30 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818FA74 - - thumb_func_start sub_818FBDC -sub_818FBDC: @ 818FBDC - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - movs r6, 0 - bl zero_enemy_party_data - mov r0, r8 - bl sub_818FC78 - adds r5, r0, 0 - bl Random - adds r4, r0, 0 - bl Random - lsls r4, 16 - lsrs r7, r4, 16 - lsls r0, 16 - orrs r7, r0 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x5 - bls _0818FC46 - movs r4, 0 -_0818FC20: - movs r0, 0x1 - ands r0, r5 - cmp r0, 0 - beq _0818FC3C - lsls r2, r4, 24 - lsrs r2, 24 - adds r0, r6, 0 - mov r1, r8 - adds r3, r7, 0 - bl sub_818FA74 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_0818FC3C: - asrs r5, 1 - adds r4, 0x1 - cmp r4, 0x2 - ble _0818FC20 - b _0818FC6C -_0818FC46: - movs r4, 0x2 -_0818FC48: - movs r0, 0x4 - ands r0, r5 - cmp r0, 0 - beq _0818FC64 - lsls r2, r4, 24 - lsrs r2, 24 - adds r0, r6, 0 - mov r1, r8 - adds r3, r7, 0 - bl sub_818FA74 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_0818FC64: - lsls r5, 1 - subs r4, 0x1 - cmp r4, 0 - bge _0818FC48 -_0818FC6C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_818FBDC - - thumb_func_start sub_818FC78 -sub_818FC78: @ 818FC78 - push {r4,r5,lr} - lsls r0, 16 - lsrs r4, r0, 16 - adds r5, r4, 0 - bl Random - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - beq _0818FCA2 - adds r0, r4, 0 - movs r1, 0 - bl sub_818FCBC - cmp r0, 0 - bne _0818FCB6 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_818FDB8 - b _0818FCB6 -_0818FCA2: - adds r0, r5, 0 - movs r1, 0 - bl sub_818FDB8 - cmp r0, 0 - bne _0818FCB6 - adds r0, r5, 0 - movs r1, 0x1 - bl sub_818FCBC -_0818FCB6: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_818FC78 - - thumb_func_start sub_818FCBC -sub_818FCBC: @ 818FCBC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0xC] - movs r0, 0 - mov r9, r0 - mov r1, r8 - lsls r1, 2 - str r1, [sp, 0x18] -_0818FCDE: - mov r2, r9 - lsls r0, r2, 2 - mov r2, sp - adds r1, r2, r0 - movs r0, 0 - str r0, [r1] - movs r7, 0 - mov r0, r9 - adds r0, 0x1 - str r0, [sp, 0x14] - adds r5, r1, 0 - mov r1, r9 - lsls r1, 1 - str r1, [sp, 0x10] -_0818FCFA: - movs r6, 0 - adds r2, r7, 0x1 - mov r10, r2 -_0818FD00: - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r2, [sp, 0x18] - adds r0, r1, r2 - ldr r2, =0x00000d24 - adds r0, r2 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - ldr r2, =0x000003fe - cmp r0, r2 - bne _0818FD3C - mov r1, r9 - lsls r0, r1, 24 - lsls r1, r7, 24 - lsrs r0, 24 - lsrs r1, 24 - bl sub_81A5060 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - b _0818FD60 - .pool -_0818FD3C: - mov r2, r8 - lsls r0, r2, 1 - add r0, r8 - lsls r0, 1 - ldr r2, [sp, 0x10] - adds r0, r2, r0 - ldr r2, =0x00000d64 - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - ldr r1, =gUnknown_0203BC8C - ldr r1, [r1] - lsls r0, 4 - adds r0, r1 - lsls r1, r7, 1 - adds r0, 0x2 - adds r0, r1 - ldrh r4, [r0] -_0818FD60: - movs r0, 0x64 - muls r0, r6 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl GetMonData - adds r1, r0, 0 - adds r0, r4, 0 - movs r2, 0 - bl sub_818FFC0 - ldr r1, [r5] - adds r1, r0 - str r1, [r5] - adds r6, 0x1 - cmp r6, 0x2 - ble _0818FD00 - mov r7, r10 - cmp r7, 0x3 - ble _0818FCFA - ldr r0, [sp, 0x14] - mov r9, r0 - cmp r0, 0x2 - ble _0818FCDE - mov r0, sp - ldr r1, [sp, 0xC] - bl sub_818FEB4 - add sp, 0x1C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_818FCBC - - thumb_func_start sub_818FDB8 -sub_818FDB8: @ 818FDB8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0xC] - movs r0, 0 - mov r9, r0 - mov r1, r8 - lsls r1, 2 - str r1, [sp, 0x18] -_0818FDDA: - mov r2, r9 - lsls r0, r2, 2 - mov r2, sp - adds r1, r2, r0 - movs r0, 0 - str r0, [r1] - movs r7, 0 - mov r0, r9 - adds r0, 0x1 - str r0, [sp, 0x14] - adds r5, r1, 0 - mov r1, r9 - lsls r1, 1 - str r1, [sp, 0x10] -_0818FDF6: - movs r6, 0 - adds r2, r7, 0x1 - mov r10, r2 -_0818FDFC: - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r2, [sp, 0x18] - adds r0, r1, r2 - ldr r2, =0x00000d24 - adds r0, r2 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - ldr r2, =0x000003fe - cmp r0, r2 - bne _0818FE38 - mov r1, r9 - lsls r0, r1, 24 - lsls r1, r7, 24 - lsrs r0, 24 - lsrs r1, 24 - bl sub_81A5060 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - b _0818FE5C - .pool -_0818FE38: - mov r2, r8 - lsls r0, r2, 1 - add r0, r8 - lsls r0, 1 - ldr r2, [sp, 0x10] - adds r0, r2, r0 - ldr r2, =0x00000d64 - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - ldr r1, =gUnknown_0203BC8C - ldr r1, [r1] - lsls r0, 4 - adds r0, r1 - lsls r1, r7, 1 - adds r0, 0x2 - adds r0, r1 - ldrh r4, [r0] -_0818FE5C: - movs r0, 0x64 - muls r0, r6 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl GetMonData - adds r1, r0, 0 - adds r0, r4, 0 - movs r2, 0x1 - bl sub_818FFC0 - ldr r1, [r5] - adds r1, r0 - str r1, [r5] - adds r6, 0x1 - cmp r6, 0x2 - ble _0818FDFC - mov r7, r10 - cmp r7, 0x3 - ble _0818FDF6 - ldr r0, [sp, 0x14] - mov r9, r0 - cmp r0, 0x2 - ble _0818FDDA - mov r0, sp - ldr r1, [sp, 0xC] - bl sub_818FEB4 - add sp, 0x1C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_818FDB8 - - thumb_func_start sub_818FEB4 -sub_818FEB4: @ 818FEB4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - mov r10, r0 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0 - str r0, [sp, 0xC] - movs r3, 0x2 - add r0, sp, 0x8 -_0818FECE: - str r3, [r0] - subs r0, 0x4 - subs r3, 0x1 - cmp r3, 0 - bge _0818FECE - mov r3, r10 - ldr r2, [r3] - ldr r0, [r3, 0x4] - cmp r2, r0 - bne _0818FF20 - ldr r0, [r3, 0x8] - cmp r2, r0 - bne _0818FF20 - cmp r1, 0 - beq _0818FFAA - movs r3, 0 - ldr r4, =gBitTable -_0818FEF0: - str r3, [sp, 0x14] - bl Random - movs r1, 0x3 - ands r1, r0 - ldr r3, [sp, 0x14] - cmp r1, 0x3 - beq _0818FF16 - lsls r0, r1, 2 - adds r0, r4 - ldr r1, [r0] - ldr r0, [sp, 0xC] - ands r0, r1 - cmp r0, 0 - bne _0818FF16 - ldr r0, [sp, 0xC] - orrs r0, r1 - str r0, [sp, 0xC] - adds r3, 0x1 -_0818FF16: - cmp r3, 0x2 - bne _0818FEF0 - b _0818FFAA - .pool -_0818FF20: - movs r3, 0 - mov r9, sp - mov r8, r10 -_0818FF26: - adds r2, r3, 0x1 - cmp r2, 0x2 - bgt _0818FF84 - mov r6, r8 - mov r7, r9 - lsls r0, r2, 2 - mov r1, sp - adds r5, r0, r1 - mov r1, r10 - adds r4, r0, r1 -_0818FF3A: - ldr r0, [r6] - ldr r1, [r4] - cmp r0, r1 - bge _0818FF4E - str r1, [r6] - str r0, [r4] - ldr r1, [r7] - ldr r0, [r5] - str r0, [r7] - str r1, [r5] -_0818FF4E: - ldr r1, [r6] - ldr r0, [r4] - cmp r1, r0 - bne _0818FF7A - str r2, [sp, 0x10] - str r3, [sp, 0x14] - bl Random - movs r1, 0x1 - ands r1, r0 - ldr r2, [sp, 0x10] - ldr r3, [sp, 0x14] - cmp r1, 0 - beq _0818FF7A - ldr r1, [r6] - ldr r0, [r4] - str r0, [r6] - str r1, [r4] - ldr r1, [r7] - ldr r0, [r5] - str r0, [r7] - str r1, [r5] -_0818FF7A: - adds r5, 0x4 - adds r4, 0x4 - adds r2, 0x1 - cmp r2, 0x2 - ble _0818FF3A -_0818FF84: - movs r4, 0x4 - add r9, r4 - add r8, r4 - adds r3, 0x1 - cmp r3, 0x1 - ble _0818FF26 - ldr r2, =gBitTable - mov r1, sp - movs r3, 0x1 -_0818FF96: - ldm r1!, {r0} - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - ldr r4, [sp, 0xC] - orrs r4, r0 - str r4, [sp, 0xC] - subs r3, 0x1 - cmp r3, 0 - bge _0818FF96 -_0818FFAA: - ldr r0, [sp, 0xC] - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_818FEB4 - - thumb_func_start sub_818FFC0 -sub_818FFC0: @ 818FFC0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - adds r3, r0, 0 - adds r4, r1, 0 - str r2, [sp] - movs r6, 0 - movs r2, 0x14 - cmp r3, 0 - beq _0818FFF0 - ldr r0, =0x0000ffff - cmp r3, r0 - beq _0818FFF0 - ldr r0, =gBattleMoves - lsls r1, r3, 1 - adds r1, r3 - lsls r1, 2 - adds r3, r1, r0 - ldrb r0, [r3, 0x1] - cmp r0, 0 - bne _0818FFFC -_0818FFF0: - movs r0, 0 - b _08190156 - .pool -_0818FFFC: - ldr r1, =gBaseStats - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x6] - mov r10, r1 - ldrb r1, [r0, 0x7] - mov r9, r1 - ldrb r0, [r0, 0x16] - mov r8, r0 - ldrb r3, [r3, 0x2] - str r3, [sp, 0x4] - cmp r0, 0x1A - bne _0819002C - cmp r3, 0x4 - bne _0819002C - ldr r0, [sp] - cmp r0, 0x1 - bne _081900AA - movs r2, 0x8 - b _081900A4 - .pool -_0819002C: - ldr r0, =gUnknown_0831ACE8 - adds r1, r6, r0 - ldrb r0, [r1] - ldr r7, =gUnknown_0831ACE8 - cmp r0, 0xFF - beq _081900A4 - adds r4, r1, 0 -_0819003A: - ldrb r0, [r4] - cmp r0, 0xFE - beq _08190096 - ldrb r0, [r4] - ldr r1, [sp, 0x4] - cmp r0, r1 - bne _08190096 - ldrb r0, [r4, 0x1] - adds r5, r6, 0x1 - cmp r0, r10 - bne _0819006C - adds r1, r6, 0x2 - mov r0, r8 - cmp r0, 0x19 - bne _0819005E - ldrb r0, [r4, 0x2] - cmp r0, 0x28 - bne _0819006C -_0819005E: - adds r0, r1, r7 - ldrb r0, [r0] - muls r0, r2 - movs r1, 0xA - bl __divsi3 - adds r2, r0, 0 -_0819006C: - adds r0, r5, r7 - ldrb r0, [r0] - cmp r0, r9 - bne _08190096 - cmp r10, r9 - beq _08190096 - adds r1, r6, 0x2 - mov r0, r8 - cmp r0, 0x19 - bne _08190088 - adds r0, r1, r7 - ldrb r0, [r0] - cmp r0, 0x28 - bne _08190096 -_08190088: - adds r0, r1, r7 - ldrb r0, [r0] - muls r0, r2 - movs r1, 0xA - bl __divsi3 - adds r2, r0, 0 -_08190096: - adds r4, 0x3 - adds r6, 0x3 - ldr r1, =gUnknown_0831ACE8 - adds r0, r6, r1 - ldrb r0, [r0] - cmp r0, 0xFF - bne _0819003A -_081900A4: - ldr r0, [sp] - cmp r0, 0x1 - beq _081900E0 -_081900AA: - ldr r1, [sp] - cmp r1, 0x1 - bgt _081900BC - cmp r1, 0 - beq _081900C4 - b _08190154 - .pool -_081900BC: - ldr r0, [sp] - cmp r0, 0x2 - beq _08190114 - b _08190154 -_081900C4: - cmp r2, 0xA - beq _08190146 - cmp r2, 0xA - ble _08190146 - cmp r2, 0x28 - beq _0819014A - cmp r2, 0x28 - bgt _081900DA - cmp r2, 0x14 - beq _08190104 - b _08190146 -_081900DA: - cmp r2, 0x50 - bne _08190146 - b _08190100 -_081900E0: - cmp r2, 0xA - beq _08190104 - cmp r2, 0xA - bgt _081900F2 - cmp r2, 0 - beq _08190100 - cmp r2, 0x5 - beq _0819014A - b _08190146 -_081900F2: - cmp r2, 0x28 - beq _08190108 - cmp r2, 0x28 - ble _08190146 - cmp r2, 0x50 - beq _0819010E - b _08190146 -_08190100: - movs r2, 0x8 - b _08190154 -_08190104: - movs r2, 0x2 - b _08190154 -_08190108: - movs r2, 0x2 - negs r2, r2 - b _08190154 -_0819010E: - movs r2, 0x4 - negs r2, r2 - b _08190154 -_08190114: - cmp r2, 0xA - beq _08190146 - cmp r2, 0xA - bgt _08190126 - cmp r2, 0 - beq _0819013A - cmp r2, 0x5 - beq _08190140 - b _08190146 -_08190126: - cmp r2, 0x28 - beq _0819014E - cmp r2, 0x28 - bgt _08190134 - cmp r2, 0x14 - beq _0819014A - b _08190146 -_08190134: - cmp r2, 0x50 - beq _08190152 - b _08190146 -_0819013A: - movs r2, 0x10 - negs r2, r2 - b _08190154 -_08190140: - movs r2, 0x8 - negs r2, r2 - b _08190154 -_08190146: - movs r2, 0 - b _08190154 -_0819014A: - movs r2, 0x4 - b _08190154 -_0819014E: - movs r2, 0xC - b _08190154 -_08190152: - movs r2, 0x14 -_08190154: - adds r0, r2, 0 -_08190156: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_818FFC0 - - thumb_func_start sub_8190168 -sub_8190168: @ 8190168 - push {lr} - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - cmp r0, 0x63 - bls _0819019A - movs r1, 0x6 - cmp r0, 0x77 - bls _0819019A - movs r1, 0x9 - cmp r0, 0x8B - bls _0819019A - movs r1, 0xC - cmp r0, 0x9F - bls _0819019A - movs r1, 0xF - cmp r0, 0xB3 - bls _0819019A - movs r1, 0x12 - cmp r0, 0xC7 - bls _0819019A - movs r1, 0x1F - cmp r0, 0xDB - bhi _0819019A - movs r1, 0x15 -_0819019A: - adds r0, r1, 0 - pop {r1} - bx r1 - thumb_func_end sub_8190168 - - thumb_func_start sub_81901A0 -sub_81901A0: @ 81901A0 - push {r4-r7,lr} - adds r3, r0, 0 - adds r2, r1, 0 - movs r5, 0 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r4, =0x00000d24 - adds r1, r4 - ldrh r1, [r1] - lsls r1, 22 - lsrs r1, 22 - mov r12, r0 - ldr r6, =gUnknown_0860D10C - cmp r1, r2 - beq _081901D8 - mov r7, r12 -_081901C0: - adds r5, 0x1 - cmp r5, 0xF - bgt _081901D8 - ldr r0, [r7] - lsls r1, r5, 2 - adds r0, r1 - adds r0, r4 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - cmp r0, r2 - bne _081901C0 -_081901D8: - cmp r3, 0 - beq _0819026C - cmp r3, 0x3 - bne _081901FC - lsls r0, r5, 2 - adds r1, r0, 0x3 - adds r1, r6 - ldrb r1, [r1] - adds r4, r1, 0 - adds r4, 0x8 - b _08190206 - .pool -_081901FC: - lsls r0, r5, 2 - adds r1, r3, r0 - adds r1, r6 - ldrb r1, [r1] - adds r4, r1, 0x4 -_08190206: - adds r0, r3, r0 - adds r0, r6 - ldrb r2, [r0] - cmp r2, r4 - bge _08190256 - ldr r1, =gUnknown_0860D14C - adds r0, r2, r1 - ldrb r3, [r0] - adds r6, r1, 0 - cmp r3, r5 - beq _08190234 - mov r1, r12 - ldr r0, [r1] - lsls r1, r3, 2 - adds r0, r1 - ldr r3, =0x00000d25 - adds r0, r3 - b _0819024E - .pool -_08190234: - adds r2, 0x1 - cmp r2, r4 - bge _08190256 - adds r0, r2, r6 - ldrb r1, [r0] - cmp r1, r5 - beq _08190234 - mov r3, r12 - ldr r0, [r3] - lsls r1, 2 - adds r0, r1 - ldr r1, =0x00000d25 - adds r0, r1 -_0819024E: - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _08190234 -_08190256: - cmp r2, r4 - beq _08190286 - ldr r0, =gUnknown_0860D14C - adds r0, r2, r0 - ldrb r0, [r0] - b _08190292 - .pool -_0819026C: - mov r3, r12 - ldr r1, [r3] - lsls r0, r5, 2 - adds r0, r6 - ldrb r2, [r0] - lsls r0, r2, 2 - adds r1, r0 - ldr r0, =0x00000d25 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 29 - cmp r0, 0 - bge _08190290 -_08190286: - movs r0, 0xFF - b _08190292 - .pool -_08190290: - adds r0, r2, 0 -_08190292: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81901A0 - - thumb_func_start sub_8190298 -sub_8190298: @ 8190298 - push {lr} - bl sub_81902AC - ldr r1, =gUnknown_02038BCA - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8190298 - - thumb_func_start sub_81902AC -sub_81902AC: @ 81902AC - push {r4,lr} - ldr r0, =gSaveBlock2Ptr - ldr r4, [r0] - ldr r1, =0x00000cb2 - adds r0, r4, r1 - ldrh r0, [r0] - ldr r1, =0x000003ff - bl sub_81901A0 - lsls r0, 2 - adds r4, r0 - ldr r0, =0x00000d24 - adds r4, r0 - ldrh r0, [r4] - lsls r0, 22 - lsrs r0, 22 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81902AC - - thumb_func_start sub_81902E4 -sub_81902E4: @ 81902E4 - push {lr} - ldr r0, =gUnknown_02038BCA - ldrh r0, [r0] - movs r1, 0 - bl sub_8162614 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81902E4 - - thumb_func_start sub_81902F8 -sub_81902F8: @ 81902F8 - push {r4,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =gSpecialVar_0x8005 - ldrh r1, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - strb r1, [r0] - movs r0, 0x80 - lsls r0, 7 - movs r1, 0 - bl VarSet - ldr r1, [r4] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - bl sub_81A4C30 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81902F8 - - thumb_func_start sub_819033C -sub_819033C: @ 819033C - push {r4,r5,lr} - ldr r5, =gSaveBlock2Ptr - ldr r0, [r5] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r4, [r0] - lsls r4, 30 - lsrs r4, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 24 - ldr r1, [r5] - lsls r4, 1 - lsrs r0, 22 - adds r4, r0 - ldr r3, =0x00000d0c - adds r1, r3 - adds r1, r4 - ldrh r0, [r1] - ldr r2, =0x000003e6 - cmp r0, r2 - bhi _0819036E - adds r0, 0x1 - strh r0, [r1] -_0819036E: - ldr r0, [r5] - ldr r1, =0x00000d1c - adds r0, r1 - adds r1, r0, r4 - ldrh r0, [r1] - cmp r0, r2 - bhi _08190380 - adds r0, 0x1 - strh r0, [r1] -_08190380: - ldr r0, [r5] - adds r1, r0, r3 - adds r1, r4 - ldr r2, =0x00000d14 - adds r0, r2 - adds r0, r4 - ldrh r1, [r1] - ldrh r2, [r0] - cmp r1, r2 - bls _08190396 - strh r1, [r0] -_08190396: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819033C - - thumb_func_start sub_81903B8 -sub_81903B8: @ 81903B8 - push {r4,r5,lr} - ldr r0, =sub_8190400 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gTasks - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - adds r4, r1 - movs r5, 0 - strh r5, [r4, 0x8] - bl sub_81902AC - lsls r0, 16 - lsrs r0, 16 - bl sub_8195358 - strh r0, [r4, 0xA] - strh r5, [r4, 0xC] - strh r5, [r4, 0xE] - ldr r0, =sub_8194B54 - bl SetMainCallback2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81903B8 - - thumb_func_start sub_8190400 -sub_8190400: @ 8190400 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - ldr r1, =gTasks - lsls r0, 2 - add r0, r10 - lsls r0, 3 - adds r6, r0, r1 - movs r0, 0xA - ldrsh r5, [r6, r0] - movs r2, 0xC - ldrsh r1, [r6, r2] - mov r9, r1 - movs r0, 0xE - ldrsh r7, [r6, r0] - movs r1, 0x8 - ldrsh r4, [r6, r1] - cmp r4, 0x1 - beq _08190508 - cmp r4, 0x1 - bgt _08190440 - cmp r4, 0 - beq _0819044E - b _08190772 - .pool -_08190440: - cmp r4, 0x2 - bne _08190446 - b _08190570 -_08190446: - cmp r4, 0x3 - bne _0819044C - b _08190634 -_0819044C: - b _08190772 -_0819044E: - movs r0, 0 - bl SetHBlankCallback - movs r0, 0 - bl SetVBlankCallback - movs r0, 0x1 - bl EnableInterrupts - str r4, [sp, 0x4] - movs r1, 0xC0 - lsls r1, 19 - ldr r2, =0x05006000 - add r0, sp, 0x4 - bl CpuSet - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_0860CE84 - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - ldr r0, =gUnknown_0860CEB4 - bl InitWindows - bl DeactivateAllTextPrinters - ldr r0, =gUnknown_02022E14 - strh r4, [r0] - ldr r0, =gUnknown_02022E16 - strh r4, [r0] - ldr r0, =gUnknown_02022E18 - strh r4, [r0] - ldr r0, =gUnknown_02022E1A - strh r4, [r0] - ldr r0, =gUnknown_02022E20 - strh r4, [r0] - ldr r0, =gUnknown_02022E22 - strh r4, [r0] - mov r2, r9 - cmp r2, 0x2 - bne _081904DC - ldr r0, =gUnknown_02022E1C - strh r4, [r0] - ldr r0, =gUnknown_02022E1E - strh r4, [r0] - b _081904E6 - .pool -_081904DC: - ldr r0, =gUnknown_02022E1C - strh r4, [r0] - ldr r1, =gUnknown_02022E1E - movs r0, 0xA0 - strh r0, [r1] -_081904E6: - ldr r0, =gTasks - mov r2, r10 - lsls r1, r2, 2 - add r1, r10 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _08190772 - .pool -_08190508: - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - movs r0, 0x4C - movs r1, 0 - bl SetGpuReg - movs r0, 0x40 - movs r1, 0 - bl SetGpuReg - movs r0, 0x44 - movs r1, 0 - bl SetGpuReg - movs r0, 0x42 - movs r1, 0 - bl SetGpuReg - movs r0, 0x46 - movs r1, 0 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0 - bl SetGpuReg - movs r0, 0x4A - movs r1, 0x3F - bl SetGpuReg - bl ResetPaletteFade - bl ResetSpriteData - bl FreeAllSpritePalettes - ldr r1, =gReservedSpritePaletteCount - movs r0, 0x4 - strb r0, [r1] - b _08190602 - .pool -_08190570: - ldr r1, =gUnknown_08D83D50 - movs r5, 0x80 - lsls r5, 6 - movs r7, 0 - str r7, [sp] - movs r0, 0x2 - adds r2, r5, 0 - movs r3, 0 - bl copy_decompressed_tile_data_to_vram_autofree - ldr r1, =gUnknown_08D84970 - movs r4, 0x1 - str r4, [sp] - movs r0, 0x2 - adds r2, r5, 0 - movs r3, 0 - bl copy_decompressed_tile_data_to_vram_autofree - ldr r1, =gUnknown_08D84F00 - movs r2, 0x80 - lsls r2, 4 - str r4, [sp] - movs r0, 0x3 - movs r3, 0 - bl copy_decompressed_tile_data_to_vram_autofree - ldr r0, =gUnknown_0860CF50 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_08D85358 - movs r4, 0x80 - lsls r4, 2 - movs r1, 0 - adds r2, r4, 0 - bl LoadCompressedPalette - ldr r0, =gUnknown_08D85444 - movs r1, 0x80 - lsls r1, 1 - adds r2, r4, 0 - bl LoadCompressedPalette - ldr r0, =gUnknown_08D85600 - movs r1, 0xF0 - movs r2, 0x20 - bl LoadCompressedPalette - mov r0, r9 - cmp r0, 0x2 - bne _081905DE - ldr r0, =gUnknown_08D854C8 - movs r1, 0x50 - movs r2, 0x20 - bl LoadCompressedPalette -_081905DE: - str r7, [sp, 0x8] - add r0, sp, 0x8 - ldr r1, =gPlttBufferFaded - ldr r2, =0x05000100 - bl CpuSet - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg -_08190602: - ldrh r0, [r6, 0x8] - adds r0, 0x1 - strh r0, [r6, 0x8] - b _08190772 - .pool -_08190634: - ldr r0, =sub_8194B70 - bl SetVBlankCallback - ldr r4, =gUnknown_0203CD78 - movs r0, 0x14 - bl AllocZeroed - str r0, [r4] - movs r6, 0 - lsls r5, 24 - movs r2, 0xFF -_0819064A: - ldr r1, [r4] - adds r1, r6 - ldrb r0, [r1] - orrs r0, r2 - strb r0, [r1] - adds r6, 0x1 - cmp r6, 0xF - ble _0819064A - bl sub_80D2F04 - ldr r0, =sub_8190CD4 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x8] - strh r1, [r0, 0xC] - mov r1, r9 - strh r1, [r0, 0xE] - strh r7, [r0, 0x10] - mov r2, r9 - cmp r2, 0x2 - bne _081906A8 - lsrs r1, r5, 24 - movs r0, 0 - bl sub_819314C - ldr r0, =gUnknown_0203CD78 - ldr r1, [r0] - movs r0, 0x1 - strb r0, [r1, 0x10] - b _081906B0 - .pool -_081906A8: - lsrs r1, r5, 24 - movs r0, 0 - bl sub_81924E0 -_081906B0: - movs r1, 0xFA - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - mov r0, r9 - cmp r0, 0 - beq _0819076C - ldr r5, =gUnknown_0860D068 - adds r0, r5, 0 - movs r1, 0x78 - movs r2, 0x4 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r7, r0, 24 - lsls r4, r7, 4 - adds r4, r7 - lsls r4, 2 - ldr r1, =gSprites - mov r8, r1 - add r4, r8 - adds r0, r4, 0 - movs r1, 0 - bl StartSpriteAnim - strh r6, [r4, 0x2E] - adds r0, r5, 0 - movs r1, 0x78 - movs r2, 0x9C - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r7, r0, 24 - lsls r4, r7, 4 - adds r4, r7 - lsls r4, 2 - add r4, r8 - adds r0, r4, 0 - movs r1, 0x1 - bl StartSpriteAnim - strh r6, [r4, 0x2E] - ldr r5, =gUnknown_0860D050 - adds r0, r5, 0 - movs r1, 0x6 - movs r2, 0x50 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r7, r0, 24 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - mov r2, r8 - adds r4, r0, r2 - adds r0, r4, 0 - movs r1, 0 - bl StartSpriteAnim - strh r6, [r4, 0x2E] - movs r0, 0 - strh r0, [r4, 0x30] - mov r1, r9 - cmp r1, 0x1 - bne _08190746 - adds r0, r4, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_08190746: - adds r0, r5, 0 - movs r1, 0xEA - movs r2, 0x50 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r7, r0, 24 - lsls r4, r7, 4 - adds r4, r7 - lsls r4, 2 - add r4, r8 - adds r0, r4, 0 - movs r1, 0x1 - bl StartSpriteAnim - strh r6, [r4, 0x2E] - movs r0, 0x1 - strh r0, [r4, 0x30] -_0819076C: - mov r0, r10 - bl DestroyTask -_08190772: - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8190400 - - thumb_func_start sub_8190790 -sub_8190790: @ 8190790 - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x22] - adds r1, r0, 0x4 - strh r1, [r2, 0x22] - movs r3, 0x2E - ldrsh r0, [r2, r3] - cmp r0, 0 - beq _081907D4 - lsls r0, r1, 16 - asrs r0, 16 - movs r1, 0x20 - negs r1, r1 - cmp r0, r1 - blt _081907BC - adds r3, r2, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r3] -_081907BC: - ldrh r0, [r2, 0x30] - adds r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x28 - bne _081907F0 - ldr r0, =SpriteCallbackDummy - str r0, [r2, 0x1C] - b _081907F0 - .pool -_081907D4: - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0xBF - ble _081907F0 - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - movs r3, 0x32 - ldrsh r1, [r2, r3] - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldrh r0, [r2, 0x34] - bl sub_818D8F0 -_081907F0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8190790 - - thumb_func_start sub_81907F8 -sub_81907F8: @ 81907F8 - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x22] - subs r1, r0, 0x4 - strh r1, [r2, 0x22] - movs r3, 0x2E - ldrsh r0, [r2, r3] - cmp r0, 0 - beq _08190838 - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0xC0 - bgt _08190820 - adds r3, r2, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r3] -_08190820: - ldrh r0, [r2, 0x30] - adds r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x28 - bne _08190858 - ldr r0, =SpriteCallbackDummy - str r0, [r2, 0x1C] - b _08190858 - .pool -_08190838: - lsls r0, r1, 16 - asrs r0, 16 - movs r1, 0x20 - negs r1, r1 - cmp r0, r1 - bgt _08190858 - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - movs r3, 0x32 - ldrsh r1, [r2, r3] - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldrh r0, [r2, 0x34] - bl sub_818D8F0 -_08190858: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81907F8 - - thumb_func_start sub_8190860 -sub_8190860: @ 8190860 - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x20] - adds r1, r0, 0x4 - strh r1, [r2, 0x20] - movs r3, 0x2E - ldrsh r0, [r2, r3] - cmp r0, 0 - beq _081908A4 - lsls r0, r1, 16 - asrs r0, 16 - movs r1, 0x20 - negs r1, r1 - cmp r0, r1 - blt _0819088C - adds r3, r2, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r3] -_0819088C: - ldrh r0, [r2, 0x30] - adds r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x40 - bne _081908C0 - ldr r0, =SpriteCallbackDummy - str r0, [r2, 0x1C] - b _081908C0 - .pool -_081908A4: - lsls r1, 16 - ldr r0, =0x010f0000 - cmp r1, r0 - ble _081908C0 - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - movs r3, 0x32 - ldrsh r1, [r2, r3] - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldrh r0, [r2, 0x34] - bl sub_818D8F0 -_081908C0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8190860 - - thumb_func_start sub_81908CC -sub_81908CC: @ 81908CC - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x20] - subs r1, r0, 0x4 - strh r1, [r2, 0x20] - movs r3, 0x2E - ldrsh r0, [r2, r3] - cmp r0, 0 - beq _08190910 - lsls r1, 16 - movs r0, 0x88 - lsls r0, 17 - cmp r1, r0 - bgt _081908F6 - adds r3, r2, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r3] -_081908F6: - ldrh r0, [r2, 0x30] - adds r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x40 - bne _08190930 - ldr r0, =SpriteCallbackDummy - str r0, [r2, 0x1C] - b _08190930 - .pool -_08190910: - lsls r0, r1, 16 - asrs r0, 16 - movs r1, 0x20 - negs r1, r1 - cmp r0, r1 - bgt _08190930 - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - movs r3, 0x32 - ldrsh r1, [r2, r3] - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldrh r0, [r2, 0x34] - bl sub_818D8F0 -_08190930: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81908CC - - thumb_func_start sub_8190938 -sub_8190938: @ 8190938 - push {lr} - adds r1, r0, 0 - movs r2, 0x34 - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _0819094A - adds r0, r1, 0 - bl sub_80D30DC -_0819094A: - pop {r0} - bx r0 - thumb_func_end sub_8190938 - - thumb_func_start sub_8190950 -sub_8190950: @ 8190950 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08190962 - adds r0, r4, 0 - bl sub_80D30DC -_08190962: - ldrh r0, [r4, 0x22] - adds r1, r0, 0x4 - strh r1, [r4, 0x22] - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _081909A4 - lsls r0, r1, 16 - asrs r0, 16 - movs r1, 0x10 - negs r1, r1 - cmp r0, r1 - blt _0819098A - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_0819098A: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x28 - bne _081909C0 - ldr r0, =sub_8190938 - str r0, [r4, 0x1C] - b _081909C0 - .pool -_081909A4: - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0xAF - ble _081909C0 - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - movs r2, 0x32 - ldrsh r1, [r4, r2] - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - adds r0, r4, 0 - bl sub_80D2EF8 -_081909C0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8190950 - - thumb_func_start sub_81909CC -sub_81909CC: @ 81909CC - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081909DE - adds r0, r4, 0 - bl sub_80D30DC -_081909DE: - ldrh r0, [r4, 0x22] - subs r1, r0, 0x4 - strh r1, [r4, 0x22] - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _08190A1C - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0xB0 - bgt _08190A02 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_08190A02: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x28 - bne _08190A3C - ldr r0, =sub_8190938 - str r0, [r4, 0x1C] - b _08190A3C - .pool -_08190A1C: - lsls r0, r1, 16 - asrs r0, 16 - movs r1, 0x10 - negs r1, r1 - cmp r0, r1 - bgt _08190A3C - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - movs r2, 0x32 - ldrsh r1, [r4, r2] - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - adds r0, r4, 0 - bl sub_80D2EF8 -_08190A3C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81909CC - - thumb_func_start sub_8190A48 -sub_8190A48: @ 8190A48 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08190A5A - adds r0, r4, 0 - bl sub_80D30DC -_08190A5A: - ldrh r0, [r4, 0x20] - adds r1, r0, 0x4 - strh r1, [r4, 0x20] - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _08190A9C - lsls r0, r1, 16 - asrs r0, 16 - movs r1, 0x10 - negs r1, r1 - cmp r0, r1 - blt _08190A82 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_08190A82: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x40 - bne _08190AB8 - ldr r0, =sub_8190938 - str r0, [r4, 0x1C] - b _08190AB8 - .pool -_08190A9C: - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0xFF - ble _08190AB8 - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - movs r2, 0x32 - ldrsh r1, [r4, r2] - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - adds r0, r4, 0 - bl sub_80D2EF8 -_08190AB8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8190A48 - - thumb_func_start sub_8190AC4 -sub_8190AC4: @ 8190AC4 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08190AD6 - adds r0, r4, 0 - bl sub_80D30DC -_08190AD6: - ldrh r0, [r4, 0x20] - subs r1, r0, 0x4 - strh r1, [r4, 0x20] - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _08190B14 - lsls r1, 16 - movs r0, 0x80 - lsls r0, 17 - cmp r1, r0 - bgt _08190AFC - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_08190AFC: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x40 - bne _08190B34 - ldr r0, =sub_8190938 - str r0, [r4, 0x1C] - b _08190B34 - .pool -_08190B14: - lsls r0, r1, 16 - asrs r0, 16 - movs r1, 0x10 - negs r1, r1 - cmp r0, r1 - bgt _08190B34 - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - movs r2, 0x32 - ldrsh r1, [r4, r2] - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - adds r0, r4, 0 - bl sub_80D2EF8 -_08190B34: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8190AC4 - - thumb_func_start sub_8190B40 -sub_8190B40: @ 8190B40 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - adds r3, r0, 0 - movs r0, 0x2E - ldrsh r6, [r3, r0] - ldr r2, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r4, r0, r2 - movs r7, 0x10 - ldrsh r1, [r4, r7] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r1, 0xA - ldrsh r0, [r0, r1] - ldr r1, =gUnknown_0860D080 - adds r0, r1 - ldrb r0, [r0] - mov r10, r0 - ldr r1, =gSaveBlock2Ptr - ldr r5, [r1] - ldr r7, =0x00000cb2 - adds r0, r5, r7 - ldrh r0, [r0] - mov r12, r0 - movs r7, 0xE - ldrsh r0, [r4, r7] - mov r9, r2 - mov r8, r1 - cmp r0, 0x1 - bne _08190C0C - movs r1, 0x30 - ldrsh r0, [r3, r1] - cmp r0, 0 - beq _08190BFC - mov r2, r10 - lsls r0, r2, 2 - adds r1, r5, r0 - ldr r7, =0x00000d25 - adds r1, r7 - ldrb r2, [r1] - lsls r1, r2, 29 - adds r4, r0, 0 - cmp r1, 0 - bge _08190BB6 - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldrb r1, [r0, 0x10] - subs r1, 0x1 - lsls r0, r2, 27 - lsrs r0, 30 - cmp r1, r0 - blt _08190C32 -_08190BB6: - mov r1, r8 - ldr r0, [r1] - adds r0, r4 - ldr r2, =0x00000d25 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _08190BD4 - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - subs r0, 0x1 - cmp r0, r12 - blt _08190C32 -_08190BD4: - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - add r0, r9 - movs r7, 0x8 - ldrsh r0, [r0, r7] - b _08190C4C - .pool -_08190BFC: - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r0, 0 - bne _08190C32 - b _08190C48 - .pool -_08190C0C: - movs r2, 0x30 - ldrsh r0, [r3, r2] - cmp r0, 0 - beq _08190C28 - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r0, 0x1 - bls _08190C32 - movs r7, 0x8 - ldrsh r0, [r4, r7] - b _08190C4C - .pool -_08190C28: - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r0, 0 - beq _08190C48 -_08190C32: - adds r2, r3, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - b _08190C5C - .pool -_08190C48: - movs r1, 0x8 - ldrsh r0, [r4, r1] -_08190C4C: - cmp r0, 0x2 - bne _08190C5C - adds r0, r3, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_08190C5C: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8190B40 - - thumb_func_start sub_8190C6C -sub_8190C6C: @ 8190C6C - push {lr} - adds r3, r0, 0 - movs r0, 0x2E - ldrsh r1, [r3, r0] - ldr r2, =gTasks - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r1, r0, r2 - movs r2, 0xE - ldrsh r0, [r1, r2] - cmp r0, 0x1 - bne _08190C9C - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r0, 0 - bne _08190CA6 - b _08190CC0 - .pool -_08190C9C: - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r0, 0x1 - beq _08190CC0 -_08190CA6: - movs r2, 0x8 - ldrsh r0, [r1, r2] - cmp r0, 0x2 - bne _08190CCE - adds r0, r3, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - b _08190CCE - .pool -_08190CC0: - adds r2, r3, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_08190CCE: - pop {r0} - bx r0 - thumb_func_end sub_8190C6C - - thumb_func_start sub_8190CD4 -sub_8190CD4: @ 8190CD4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r1, =gTasks - lsls r0, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r3, 0xE - ldrsh r2, [r0, r3] - mov r9, r2 - movs r4, 0x10 - ldrsh r7, [r0, r4] - movs r5, 0x8 - ldrsh r0, [r0, r5] - cmp r0, 0x8 - bls _08190D06 - bl _08192202 -_08190D06: - lsls r0, 2 - ldr r1, =_08190D18 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08190D18: - .4byte _08190D3C - .4byte _08190D7C - .4byte _08190DA8 - .4byte _08190E48 - .4byte _08191FF8 - .4byte _08192038 - .4byte _08192078 - .4byte _081920BC - .4byte _08192106 -_08190D3C: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _08190D50 - bl _08192202 -_08190D50: - movs r0, 0x1 - negs r0, r0 - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - ldr r1, =gTasks - mov r6, r8 - lsls r0, r6, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r1, 0x1 - strh r1, [r0, 0x8] - bl _08192202 - .pool -_08190D7C: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08190D8C - bl _08192202 -_08190D8C: - mov r1, r8 - lsls r0, r1, 2 - add r0, r8 - lsls r0, 3 - ldr r2, =gTasks - adds r0, r2 - movs r1, 0x2 - strh r1, [r0, 0x8] - bl _08192202 - .pool -_08190DA8: - mov r0, r8 - bl sub_819221C - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x8 - bgt _08190DBE - cmp r6, 0x1 - bge _08190DF0 - bl _08192202 -_08190DBE: - cmp r6, 0x9 - beq _08190DC6 - bl _08192202 -_08190DC6: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r1, =gTasks - mov r3, r8 - lsls r0, r3, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r1, 0x8 - strh r1, [r0, 0x8] - bl _08192202 - .pool -_08190DF0: - ldr r1, =gTasks - mov r4, r8 - lsls r2, r4, 2 - adds r0, r2, r4 - lsls r0, 3 - adds r0, r1 - strh r6, [r0, 0x12] - movs r5, 0xC - ldrsh r0, [r0, r5] - movs r1, 0 - mov r9, r2 - cmp r0, 0 - beq _08190E0C - movs r1, 0x9 -_08190E0C: - adds r6, r1, 0 - adds r0, r6, 0 - adds r0, 0x9 - cmp r6, r0 - bge _08190E32 - adds r5, r0, 0 -_08190E18: - lsls r4, r6, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0x2 - bl CopyWindowToVram - adds r0, r4, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r6, 0x1 - cmp r6, r5 - blt _08190E18 -_08190E32: - ldr r0, =gTasks - mov r1, r9 - add r1, r8 - lsls r1, 3 - adds r1, r0 - movs r0, 0x3 - strh r0, [r1, 0x8] - bl _08192202 - .pool -_08190E48: - mov r6, r8 - lsls r1, r6, 2 - adds r0, r1, r6 - lsls r0, 3 - ldr r2, =gTasks - adds r0, r2 - movs r3, 0x12 - ldrsh r6, [r0, r3] - subs r0, r6, 0x1 - mov r9, r1 - cmp r0, 0x7 - bls _08190E64 - bl _08192202 -_08190E64: - lsls r0, 2 - ldr r1, =_08190E78 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08190E78: - .4byte _08190E98 - .4byte _08191234 - .4byte _081915CC - .4byte _08191B08 - .4byte _08190E98 - .4byte _08191234 - .4byte _0819187C - .4byte _08191D68 -_08190E98: - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r4, =gTasks - adds r0, r4 - movs r5, 0xC - ldrsh r2, [r0, r5] - cmp r2, 0 - beq _08190ED4 - ldr r0, =gUnknown_02022E14 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_02022E16 - strh r1, [r0] - ldr r0, =gUnknown_02022E18 - strh r1, [r0] - ldr r1, =gUnknown_02022E1A - movs r0, 0xA0 - strh r0, [r1] - b _08190EE6 - .pool -_08190ED4: - ldr r0, =gUnknown_02022E14 - strh r2, [r0] - ldr r1, =gUnknown_02022E16 - movs r0, 0xA0 - strh r0, [r1] - ldr r0, =gUnknown_02022E18 - strh r2, [r0] - ldr r0, =gUnknown_02022E1A - strh r2, [r0] -_08190EE6: - cmp r6, 0x1 - bne _08190F9C - ldr r5, =gUnknown_0203CD78 - ldr r0, [r5] - ldrb r1, [r0, 0x10] - cmp r1, 0 - bne _08190F50 - ldr r0, =gUnknown_02022E1C - strh r1, [r0] - ldr r1, =gUnknown_02022E1E - movs r6, 0xA0 - lsls r6, 1 - adds r0, r6, 0 - strh r0, [r1] - ldr r3, =gUnknown_0860D080 - ldr r2, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r2 - movs r4, 0xA - ldrsh r1, [r0, r4] - adds r1, r3 - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r2 - ldrb r2, [r0, 0xC] - movs r0, 0x10 - orrs r0, r2 - ldrb r1, [r1] - bl sub_81924E0 - b _08191084 - .pool -_08190F50: - ldr r1, =gUnknown_02022E1C - movs r6, 0x80 - lsls r6, 1 - adds r0, r6, 0 - strh r0, [r1] - ldr r0, =gUnknown_02022E1E - movs r4, 0 - strh r4, [r0] - ldr r3, =gUnknown_0860D080 - ldr r2, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r2 - movs r6, 0xA - ldrsh r1, [r0, r6] - adds r1, r3 - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r2 - ldrb r2, [r0, 0xC] - movs r0, 0x10 - orrs r0, r2 - ldrb r1, [r1] - bl sub_81924E0 - ldr r0, [r5] - strb r4, [r0, 0x10] - b _08191084 - .pool -_08190F9C: - ldr r6, =gUnknown_0203CD78 - ldr r1, [r6] - ldrb r5, [r1, 0x10] - cmp r5, 0 - bne _08190FF8 - ldr r4, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r4 - movs r2, 0xA - ldrsh r0, [r0, r2] - adds r2, r0, 0 - subs r2, 0x10 - lsls r0, r2, 24 - lsrs r0, 24 - adds r1, 0x11 - bl sub_8192F08 - ldr r0, =gUnknown_02022E1C - strh r5, [r0] - ldr r1, =gUnknown_02022E1E - movs r3, 0xA0 - lsls r3, 1 - adds r0, r3, 0 - strh r0, [r1] - ldr r2, [r6] - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r4 - ldrb r1, [r0, 0xC] - movs r0, 0x10 - orrs r0, r1 - ldrb r1, [r2, 0x11] - bl sub_81924E0 - b _08191084 - .pool -_08190FF8: - cmp r5, 0x2 - bne _0819104C - ldr r4, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r4 - movs r5, 0xA - ldrsh r0, [r0, r5] - adds r2, r0, 0 - subs r2, 0x10 - lsls r0, r2, 24 - lsrs r0, 24 - adds r1, 0x11 - bl sub_8192F08 - ldr r1, =gUnknown_02022E1C - movs r0, 0 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - movs r2, 0xA0 - lsls r2, 1 - adds r0, r2, 0 - strh r0, [r1] - ldr r2, [r6] - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r4 - ldrb r1, [r0, 0xC] - movs r0, 0x10 - orrs r0, r1 - ldrb r1, [r2, 0x12] - bl sub_81924E0 - b _08191084 - .pool -_0819104C: - ldr r1, =gUnknown_02022E1C - movs r3, 0x80 - lsls r3, 1 - adds r0, r3, 0 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - movs r0, 0xA0 - strh r0, [r1] - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - movs r4, 0xA - ldrsh r0, [r0, r4] - adds r2, r0, 0 - subs r2, 0x10 - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0xC] - movs r0, 0x10 - orrs r0, r1 - lsls r1, r2, 24 - lsrs r1, 24 - bl sub_819314C -_08191084: - movs r6, 0 - ldr r5, =gUnknown_0203CD78 - mov r10, r5 - ldr r3, =gSprites - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r1, =gTasks - adds r5, r0, r1 - mov r12, r6 - adds r4, r3, 0 - adds r4, 0x1C - movs r7, 0x1 -_0819109E: - cmp r6, 0x1 - bgt _0819110C - mov r2, r10 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191150 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =sub_8190790 - str r1, [r0] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrh r0, [r5, 0xC] - eors r0, r7 - strh r0, [r1, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - mov r1, r12 - strh r1, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r1, [r0, 0x34] - b _08191150 - .pool -_0819110C: - mov r2, r10 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191150 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =sub_8190950 - str r1, [r0] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrh r0, [r5, 0xC] - eors r0, r7 - strh r0, [r1, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - mov r1, r12 - strh r1, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] -_08191150: - adds r6, 0x1 - cmp r6, 0x7 - ble _0819109E - movs r6, 0x8 - ldr r2, =gUnknown_0203CD78 - mov r12, r2 - ldr r3, =gSprites - ldr r1, =gTasks - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r5, r0, r1 - movs r4, 0 - adds r7, r3, 0 - adds r7, 0x1C -_0819116E: - cmp r6, 0x9 - bgt _081911D4 - mov r1, r12 - ldr r0, [r1] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191214 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, =sub_8190790 - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r5, 0xC] - strh r1, [r0, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r1, [r0, 0x34] - b _08191214 - .pool -_081911D4: - mov r2, r12 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191214 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, =sub_8190950 - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r5, 0xC] - strh r1, [r0, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] -_08191214: - adds r6, 0x1 - cmp r6, 0xF - ble _0819116E - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r3, =gTasks - adds r0, r3 - movs r2, 0 - movs r1, 0x4 - bl _08191FE8 - .pool -_08191234: - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r4, =gTasks - adds r0, r4 - movs r5, 0xC - ldrsh r2, [r0, r5] - cmp r2, 0 - beq _08191278 - ldr r0, =gUnknown_02022E14 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_02022E16 - strh r1, [r0] - ldr r0, =gUnknown_02022E18 - strh r1, [r0] - ldr r1, =gUnknown_02022E1A - ldr r2, =0x0000ff60 - adds r0, r2, 0 - strh r0, [r1] - b _0819128C - .pool -_08191278: - ldr r0, =gUnknown_02022E14 - strh r2, [r0] - ldr r1, =gUnknown_02022E16 - ldr r3, =0x0000ff60 - adds r0, r3, 0 - strh r0, [r1] - ldr r0, =gUnknown_02022E18 - strh r2, [r0] - ldr r0, =gUnknown_02022E1A - strh r2, [r0] -_0819128C: - cmp r6, 0x2 - bne _0819133C - ldr r5, =gUnknown_0203CD78 - ldr r0, [r5] - ldrb r1, [r0, 0x10] - cmp r1, 0 - bne _081912F4 - ldr r0, =gUnknown_02022E1C - strh r1, [r0] - ldr r1, =gUnknown_02022E1E - movs r0, 0xA0 - strh r0, [r1] - ldr r3, =gUnknown_0860D080 - ldr r2, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r2 - movs r4, 0xA - ldrsh r1, [r0, r4] - adds r1, r3 - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r2 - ldrb r2, [r0, 0xC] - movs r0, 0x4 - orrs r0, r2 - ldrb r1, [r1] - bl sub_81924E0 - b _0819141C - .pool -_081912F4: - ldr r0, =gUnknown_02022E1C - movs r4, 0 - strh r4, [r0] - ldr r0, =gUnknown_02022E1E - strh r4, [r0] - ldr r3, =gUnknown_0860D080 - ldr r2, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r2 - movs r6, 0xA - ldrsh r1, [r0, r6] - adds r1, r3 - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r2 - ldrb r2, [r0, 0xC] - movs r0, 0x4 - orrs r0, r2 - ldrb r1, [r1] - bl sub_81924E0 - ldr r0, [r5] - strb r4, [r0, 0x10] - b _0819141C - .pool -_0819133C: - ldr r6, =gUnknown_0203CD78 - ldr r1, [r6] - ldrb r5, [r1, 0x10] - cmp r5, 0 - bne _08191394 - ldr r4, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r4 - movs r2, 0xA - ldrsh r0, [r0, r2] - adds r2, r0, 0 - subs r2, 0x10 - lsls r0, r2, 24 - lsrs r0, 24 - adds r1, 0x11 - bl sub_8192F08 - ldr r0, =gUnknown_02022E1C - strh r5, [r0] - ldr r1, =gUnknown_02022E1E - movs r0, 0xA0 - strh r0, [r1] - ldr r2, [r6] - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r4 - ldrb r1, [r0, 0xC] - movs r0, 0x4 - orrs r0, r1 - ldrb r1, [r2, 0x11] - bl sub_81924E0 - b _0819141C - .pool -_08191394: - cmp r5, 0x2 - bne _081913E4 - ldr r4, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r4 - movs r3, 0xA - ldrsh r0, [r0, r3] - adds r2, r0, 0 - subs r2, 0x10 - lsls r0, r2, 24 - lsrs r0, 24 - adds r1, 0x11 - bl sub_8192F08 - ldr r1, =gUnknown_02022E1C - movs r0, 0 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - movs r0, 0xA0 - strh r0, [r1] - ldr r2, [r6] - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r4 - ldrb r1, [r0, 0xC] - movs r0, 0x4 - orrs r0, r1 - ldrb r1, [r2, 0x12] - bl sub_81924E0 - b _0819141C - .pool -_081913E4: - ldr r1, =gUnknown_02022E1C - movs r4, 0x80 - lsls r4, 1 - adds r0, r4, 0 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - movs r0, 0 - strh r0, [r1] - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - movs r5, 0xA - ldrsh r0, [r0, r5] - adds r2, r0, 0 - subs r2, 0x10 - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0xC] - movs r0, 0x4 - orrs r0, r1 - lsls r1, r2, 24 - lsrs r1, 24 - bl sub_819314C -_0819141C: - movs r6, 0 - ldr r0, =gUnknown_0203CD78 - mov r10, r0 - ldr r3, =gSprites - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r1, =gTasks - adds r5, r0, r1 - mov r12, r6 - adds r4, r3, 0 - adds r4, 0x1C - movs r7, 0x1 -_08191436: - cmp r6, 0x1 - bgt _081914A4 - mov r2, r10 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _081914E8 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =sub_81907F8 - str r1, [r0] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrh r0, [r5, 0xC] - eors r0, r7 - strh r0, [r1, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - mov r1, r12 - strh r1, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r1, [r0, 0x34] - b _081914E8 - .pool -_081914A4: - mov r2, r10 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _081914E8 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =sub_81909CC - str r1, [r0] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrh r0, [r5, 0xC] - eors r0, r7 - strh r0, [r1, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - mov r1, r12 - strh r1, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] -_081914E8: - adds r6, 0x1 - cmp r6, 0x7 - ble _08191436 - movs r6, 0x8 - ldr r2, =gUnknown_0203CD78 - mov r12, r2 - ldr r3, =gSprites - ldr r1, =gTasks - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r5, r0, r1 - movs r4, 0 - adds r7, r3, 0 - adds r7, 0x1C -_08191506: - cmp r6, 0x9 - bgt _0819156C - mov r1, r12 - ldr r0, [r1] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _081915AC - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, =sub_81907F8 - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r5, 0xC] - strh r1, [r0, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r1, [r0, 0x34] - b _081915AC - .pool -_0819156C: - mov r2, r12 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _081915AC - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, =sub_81909CC - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r5, 0xC] - strh r1, [r0, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] -_081915AC: - adds r6, 0x1 - cmp r6, 0xF - ble _08191506 - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r3, =gTasks - adds r0, r3 - movs r2, 0 - movs r1, 0x5 - bl _08191FE8 - .pool -_081915CC: - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r4, =gTasks - adds r0, r4 - movs r5, 0xC - ldrsh r2, [r0, r5] - cmp r2, 0 - beq _0819160C - ldr r0, =gUnknown_02022E14 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_02022E16 - strh r1, [r0] - ldr r2, =gUnknown_02022E18 - movs r6, 0x80 - lsls r6, 1 - adds r0, r6, 0 - strh r0, [r2] - ldr r0, =gUnknown_02022E1A - strh r1, [r0] - b _08191622 - .pool -_0819160C: - ldr r1, =gUnknown_02022E14 - movs r3, 0x80 - lsls r3, 1 - adds r0, r3, 0 - strh r0, [r1] - ldr r0, =gUnknown_02022E16 - strh r2, [r0] - ldr r0, =gUnknown_02022E18 - strh r2, [r0] - ldr r0, =gUnknown_02022E1A - strh r2, [r0] -_08191622: - ldr r0, =gUnknown_0203CD78 - ldr r4, [r0] - ldrb r0, [r4, 0x10] - cmp r0, 0 - bne _08191688 - ldr r1, =gUnknown_02022E1C - movs r4, 0x80 - lsls r4, 1 - adds r0, r4, 0 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - movs r0, 0xA0 - strh r0, [r1] - ldr r3, =gUnknown_0860D080 - ldr r2, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r2 - movs r5, 0xA - ldrsh r1, [r0, r5] - adds r1, r3 - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r2 - ldrb r2, [r0, 0xC] - movs r0, 0x8 - orrs r0, r2 - ldrb r1, [r1] - bl sub_81924E0 - b _081916C6 - .pool -_08191688: - ldr r1, =gUnknown_02022E1C - movs r6, 0x80 - lsls r6, 1 - adds r0, r6, 0 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - movs r0, 0 - strh r0, [r1] - ldr r3, =gUnknown_0860D15C - ldr r2, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r2 - movs r5, 0xA - ldrsh r1, [r0, r5] - lsls r1, 2 - subs r1, 0x1 - ldrb r4, [r4, 0x10] - adds r1, r4 - adds r1, r3 - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r2 - ldrb r2, [r0, 0xC] - movs r0, 0x8 - orrs r0, r2 - ldrb r1, [r1] - bl sub_819314C -_081916C6: - movs r6, 0 - ldr r0, =gUnknown_0203CD78 - mov r10, r0 - ldr r3, =gSprites - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r1, =gTasks - adds r5, r0, r1 - mov r12, r6 - adds r4, r3, 0 - adds r4, 0x1C - movs r7, 0x1 -_081916E0: - cmp r6, 0x1 - bgt _08191754 - mov r2, r10 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191798 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =sub_8190860 - str r1, [r0] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrh r0, [r5, 0xC] - eors r0, r7 - strh r0, [r1, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - mov r1, r12 - strh r1, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r1, [r0, 0x34] - b _08191798 - .pool -_08191754: - mov r2, r10 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191798 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =sub_8190A48 - str r1, [r0] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrh r0, [r5, 0xC] - eors r0, r7 - strh r0, [r1, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - mov r1, r12 - strh r1, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] -_08191798: - adds r6, 0x1 - cmp r6, 0x7 - ble _081916E0 - movs r6, 0x8 - ldr r2, =gUnknown_0203CD78 - mov r12, r2 - ldr r3, =gSprites - ldr r1, =gTasks - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r5, r0, r1 - movs r4, 0 - adds r7, r3, 0 - adds r7, 0x1C -_081917B6: - cmp r6, 0x9 - bgt _0819181C - mov r1, r12 - ldr r0, [r1] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _0819185C - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, =sub_8190860 - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r5, 0xC] - strh r1, [r0, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r1, [r0, 0x34] - b _0819185C - .pool -_0819181C: - mov r2, r12 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _0819185C - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, =sub_8190A48 - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r5, 0xC] - strh r1, [r0, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] -_0819185C: - adds r6, 0x1 - cmp r6, 0xF - ble _081917B6 - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r3, =gTasks - adds r0, r3 - movs r2, 0 - movs r1, 0x6 - b _08191FE8 - .pool -_0819187C: - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r4, =gTasks - adds r0, r4 - movs r5, 0xC - ldrsh r2, [r0, r5] - cmp r2, 0 - beq _081918BC - ldr r0, =gUnknown_02022E14 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_02022E16 - strh r1, [r0] - ldr r2, =gUnknown_02022E18 - movs r6, 0x80 - lsls r6, 1 - adds r0, r6, 0 - strh r0, [r2] - ldr r0, =gUnknown_02022E1A - strh r1, [r0] - b _081918D2 - .pool -_081918BC: - ldr r1, =gUnknown_02022E14 - movs r3, 0x80 - lsls r3, 1 - adds r0, r3, 0 - strh r0, [r1] - ldr r0, =gUnknown_02022E16 - strh r2, [r0] - ldr r0, =gUnknown_02022E18 - strh r2, [r0] - ldr r0, =gUnknown_02022E1A - strh r2, [r0] -_081918D2: - ldr r0, =gUnknown_0203CD78 - ldr r2, [r0] - ldrb r0, [r2, 0x10] - cmp r0, 0 - bne _08191924 - ldr r1, =gUnknown_02022E1C - movs r4, 0x80 - lsls r4, 1 - adds r0, r4, 0 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - movs r0, 0xA0 - strh r0, [r1] - ldr r1, =gTasks - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0xC] - movs r0, 0x8 - orrs r0, r1 - ldrb r1, [r2, 0x11] - bl sub_81924E0 - b _08191958 - .pool -_08191924: - ldr r1, =gUnknown_02022E1C - movs r0, 0 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - movs r0, 0xA0 - strh r0, [r1] - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - movs r5, 0xA - ldrsh r0, [r0, r5] - adds r2, r0, 0 - subs r2, 0x10 - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0xC] - movs r0, 0x8 - orrs r0, r1 - lsls r1, r2, 24 - lsrs r1, 24 - bl sub_819314C -_08191958: - movs r6, 0 - ldr r0, =gUnknown_0203CD78 - mov r10, r0 - ldr r3, =gSprites - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r1, =gTasks - adds r5, r0, r1 - mov r12, r6 - adds r4, r3, 0 - adds r4, 0x1C - movs r7, 0x1 -_08191972: - cmp r6, 0x1 - bgt _081919E0 - mov r2, r10 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191A24 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =sub_8190860 - str r1, [r0] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrh r0, [r5, 0xC] - eors r0, r7 - strh r0, [r1, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - mov r1, r12 - strh r1, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r1, [r0, 0x34] - b _08191A24 - .pool -_081919E0: - mov r2, r10 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191A24 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =sub_8190A48 - str r1, [r0] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrh r0, [r5, 0xC] - eors r0, r7 - strh r0, [r1, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - mov r1, r12 - strh r1, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] -_08191A24: - adds r6, 0x1 - cmp r6, 0x7 - ble _08191972 - movs r6, 0x8 - ldr r2, =gUnknown_0203CD78 - mov r12, r2 - ldr r3, =gSprites - ldr r1, =gTasks - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r5, r0, r1 - movs r4, 0 - adds r7, r3, 0 - adds r7, 0x1C -_08191A42: - cmp r6, 0x9 - bgt _08191AA8 - mov r1, r12 - ldr r0, [r1] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191AE8 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, =sub_8190860 - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r5, 0xC] - strh r1, [r0, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r1, [r0, 0x34] - b _08191AE8 - .pool -_08191AA8: - mov r2, r12 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191AE8 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, =sub_8190A48 - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r5, 0xC] - strh r1, [r0, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] -_08191AE8: - adds r6, 0x1 - cmp r6, 0xF - ble _08191A42 - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r3, =gTasks - adds r0, r3 - movs r2, 0 - movs r1, 0x6 - b _08191FE8 - .pool -_08191B08: - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r4, =gTasks - adds r0, r4 - movs r5, 0xC - ldrsh r2, [r0, r5] - cmp r2, 0 - beq _08191B48 - ldr r0, =gUnknown_02022E14 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_02022E16 - strh r1, [r0] - ldr r2, =gUnknown_02022E18 - movs r6, 0xFF - lsls r6, 8 - adds r0, r6, 0 - strh r0, [r2] - ldr r0, =gUnknown_02022E1A - strh r1, [r0] - b _08191B5E - .pool -_08191B48: - ldr r1, =gUnknown_02022E14 - movs r3, 0xFF - lsls r3, 8 - adds r0, r3, 0 - strh r0, [r1] - ldr r0, =gUnknown_02022E16 - strh r2, [r0] - ldr r0, =gUnknown_02022E18 - strh r2, [r0] - ldr r0, =gUnknown_02022E1A - strh r2, [r0] -_08191B5E: - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r0, 0x1 - bne _08191B94 - ldr r1, =gUnknown_02022E1C - movs r0, 0 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - movs r0, 0xA0 - strh r0, [r1] - b _08191B9E - .pool -_08191B94: - ldr r0, =gUnknown_02022E1C - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_02022E1E - strh r1, [r0] -_08191B9E: - ldr r4, =gUnknown_0860D15C - ldr r5, =gUnknown_0203CD78 - ldr r3, [r5] - ldr r2, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r2 - movs r6, 0xA - ldrsh r1, [r0, r6] - lsls r1, 2 - subs r1, 0x1 - ldrb r3, [r3, 0x10] - adds r1, r3 - adds r1, r4 - mov r4, r9 - add r4, r8 - lsls r4, 3 - adds r4, r2 - ldrb r2, [r4, 0xC] - movs r0, 0x2 - orrs r0, r2 - ldrb r1, [r1] - bl sub_819314C - movs r6, 0 - ldr r7, =gSprites - mov r12, r6 - mov r10, r5 - adds r5, r7, 0 - adds r5, 0x1C -_08191BDC: - cmp r6, 0x1 - bgt _08191C50 - mov r1, r10 - ldr r0, [r1] - adds r3, r0, r6 - ldrb r0, [r3] - cmp r0, 0xFF - beq _08191C96 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =sub_81908CC - str r1, [r0] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r4, 0xC] - movs r2, 0x1 - eors r1, r2 - strh r1, [r0, 0x2E] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - mov r2, r12 - strh r2, [r0, 0x30] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r6, [r0, 0x32] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r1, [r0, 0x34] - b _08191C96 - .pool -_08191C50: - mov r3, r10 - ldr r0, [r3] - adds r3, r0, r6 - ldrb r0, [r3] - cmp r0, 0xFF - beq _08191C96 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =sub_8190AC4 - str r1, [r0] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r4, 0xC] - movs r2, 0x1 - eors r1, r2 - strh r1, [r0, 0x2E] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - mov r1, r12 - strh r1, [r0, 0x30] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r6, [r0, 0x32] -_08191C96: - adds r6, 0x1 - cmp r6, 0x7 - ble _08191BDC - movs r6, 0x8 - ldr r2, =gUnknown_0203CD78 - mov r12, r2 - ldr r3, =gSprites - ldr r1, =gTasks - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r5, r0, r1 - movs r4, 0 - adds r7, r3, 0 - adds r7, 0x1C -_08191CB4: - cmp r6, 0x9 - bgt _08191D1C - mov r1, r12 - ldr r0, [r1] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191D5C - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, =sub_81908CC - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r5, 0xC] - strh r1, [r0, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r1, [r0, 0x34] - b _08191D5C - .pool -_08191D1C: - mov r2, r12 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191D5C - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, =sub_8190AC4 - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r5, 0xC] - strh r1, [r0, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] -_08191D5C: - adds r6, 0x1 - cmp r6, 0xF - ble _08191CB4 - b _08191FDA - .pool -_08191D68: - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r4, =gTasks - adds r0, r4 - movs r5, 0xC - ldrsh r2, [r0, r5] - cmp r2, 0 - beq _08191DA8 - ldr r0, =gUnknown_02022E14 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_02022E16 - strh r1, [r0] - ldr r2, =gUnknown_02022E18 - movs r6, 0xFF - lsls r6, 8 - adds r0, r6, 0 - strh r0, [r2] - ldr r0, =gUnknown_02022E1A - strh r1, [r0] - b _08191DBE - .pool -_08191DA8: - ldr r1, =gUnknown_02022E14 - movs r3, 0xFF - lsls r3, 8 - adds r0, r3, 0 - strh r0, [r1] - ldr r0, =gUnknown_02022E16 - strh r2, [r0] - ldr r0, =gUnknown_02022E18 - strh r2, [r0] - ldr r0, =gUnknown_02022E1A - strh r2, [r0] -_08191DBE: - ldr r0, =gUnknown_0203CD78 - ldr r2, [r0] - ldrb r0, [r2, 0x10] - cmp r0, 0x2 - bne _08191E10 - ldr r1, =gUnknown_02022E1C - movs r4, 0x80 - lsls r4, 1 - adds r0, r4, 0 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - movs r0, 0xA0 - strh r0, [r1] - ldr r1, =gTasks - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0xC] - movs r0, 0x2 - orrs r0, r1 - ldrb r1, [r2, 0x12] - bl sub_81924E0 - b _08191E44 - .pool -_08191E10: - ldr r1, =gUnknown_02022E1C - movs r0, 0 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - movs r0, 0xA0 - strh r0, [r1] - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - movs r5, 0xA - ldrsh r0, [r0, r5] - adds r2, r0, 0 - subs r2, 0x10 - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0xC] - movs r0, 0x2 - orrs r0, r1 - lsls r1, r2, 24 - lsrs r1, 24 - bl sub_819314C -_08191E44: - movs r6, 0 - ldr r0, =gUnknown_0203CD78 - mov r10, r0 - ldr r3, =gSprites - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r1, =gTasks - adds r5, r0, r1 - mov r12, r6 - adds r4, r3, 0 - adds r4, 0x1C - movs r7, 0x1 -_08191E5E: - cmp r6, 0x1 - bgt _08191ECC - mov r2, r10 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191F10 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =sub_81908CC - str r1, [r0] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrh r0, [r5, 0xC] - eors r0, r7 - strh r0, [r1, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - mov r1, r12 - strh r1, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r1, [r0, 0x34] - b _08191F10 - .pool -_08191ECC: - mov r2, r10 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191F10 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =sub_8190AC4 - str r1, [r0] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrh r0, [r5, 0xC] - eors r0, r7 - strh r0, [r1, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - mov r1, r12 - strh r1, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] -_08191F10: - adds r6, 0x1 - cmp r6, 0x7 - ble _08191E5E - movs r6, 0x8 - ldr r2, =gUnknown_0203CD78 - mov r12, r2 - ldr r3, =gSprites - ldr r1, =gTasks - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r5, r0, r1 - movs r4, 0 - adds r7, r3, 0 - adds r7, 0x1C -_08191F2E: - cmp r6, 0x9 - bgt _08191F94 - mov r1, r12 - ldr r0, [r1] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191FD4 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, =sub_81908CC - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r5, 0xC] - strh r1, [r0, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r1, [r0, 0x34] - b _08191FD4 - .pool -_08191F94: - mov r2, r12 - ldr r0, [r2] - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, 0xFF - beq _08191FD4 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, =sub_8190AC4 - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r5, 0xC] - strh r1, [r0, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r4, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r6, [r0, 0x32] -_08191FD4: - adds r6, 0x1 - cmp r6, 0xF - ble _08191F2E -_08191FDA: - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r3, =gTasks - adds r0, r3 - movs r2, 0 - movs r1, 0x7 -_08191FE8: - strh r1, [r0, 0x8] - strh r2, [r0, 0x12] - b _08192202 - .pool -_08191FF8: - mov r4, r8 - lsls r0, r4, 2 - add r0, r8 - lsls r0, 3 - ldr r5, =gTasks - adds r1, r0, r5 - ldrh r0, [r1, 0x12] - adds r0, 0x1 - strh r0, [r1, 0x12] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x29 - beq _08192100 - ldr r1, =gUnknown_02022E16 - ldrh r0, [r1] - subs r0, 0x4 - strh r0, [r1] - ldr r1, =gUnknown_02022E1A - ldrh r0, [r1] - subs r0, 0x4 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - b _081920A4 - .pool -_08192038: - mov r6, r8 - lsls r0, r6, 2 - add r0, r8 - lsls r0, 3 - ldr r2, =gTasks - adds r1, r0, r2 - ldrh r0, [r1, 0x12] - adds r0, 0x1 - strh r0, [r1, 0x12] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x29 - beq _08192100 - ldr r1, =gUnknown_02022E16 - ldrh r0, [r1] - adds r0, 0x4 - strh r0, [r1] - ldr r1, =gUnknown_02022E1A - ldrh r0, [r1] - adds r0, 0x4 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - b _081920E8 - .pool -_08192078: - mov r3, r8 - lsls r0, r3, 2 - add r0, r8 - lsls r0, 3 - ldr r4, =gTasks - adds r1, r0, r4 - ldrh r0, [r1, 0x12] - adds r0, 0x1 - strh r0, [r1, 0x12] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x41 - beq _08192100 - ldr r1, =gUnknown_02022E14 - ldrh r0, [r1] - subs r0, 0x4 - strh r0, [r1] - ldr r1, =gUnknown_02022E18 - ldrh r0, [r1] - subs r0, 0x4 - strh r0, [r1] - ldr r1, =gUnknown_02022E1C -_081920A4: - ldrh r0, [r1] - subs r0, 0x4 - strh r0, [r1] - b _08192202 - .pool -_081920BC: - mov r5, r8 - lsls r0, r5, 2 - add r0, r8 - lsls r0, 3 - ldr r6, =gTasks - adds r1, r0, r6 - ldrh r0, [r1, 0x12] - adds r0, 0x1 - strh r0, [r1, 0x12] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x41 - beq _08192100 - ldr r1, =gUnknown_02022E14 - ldrh r0, [r1] - adds r0, 0x4 - strh r0, [r1] - ldr r1, =gUnknown_02022E18 - ldrh r0, [r1] - adds r0, 0x4 - strh r0, [r1] - ldr r1, =gUnknown_02022E1C -_081920E8: - ldrh r0, [r1] - adds r0, 0x4 - strh r0, [r1] - b _08192202 - .pool -_08192100: - movs r0, 0x2 - strh r0, [r1, 0x8] - b _08192202 -_08192106: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08192202 - movs r6, 0 - ldr r4, =gUnknown_0203CD78 -_08192116: - cmp r6, 0x1 - bgt _08192134 - ldr r0, [r4] - adds r1, r0, r6 - ldrb r0, [r1] - cmp r0, 0xFF - beq _0819214E - bl sub_818D8F0 - b _0819214E - .pool -_08192134: - ldr r0, [r4] - adds r1, r0, r6 - ldrb r0, [r1] - cmp r0, 0xFF - beq _0819214E - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl sub_80D2EF8 -_0819214E: - adds r6, 0x1 - cmp r6, 0x7 - ble _08192116 - movs r6, 0x8 - ldr r4, =gUnknown_0203CD78 -_08192158: - cmp r6, 0x9 - bgt _08192174 - ldr r0, [r4] - adds r1, r0, r6 - ldrb r0, [r1] - cmp r0, 0xFF - beq _0819218E - bl sub_818D8F0 - b _0819218E - .pool -_08192174: - ldr r0, [r4] - adds r1, r0, r6 - ldrb r0, [r1] - cmp r0, 0xFF - beq _0819218E - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl sub_80D2EF8 -_0819218E: - adds r6, 0x1 - cmp r6, 0xF - ble _08192158 - bl sub_80D2F9C - ldr r4, =gUnknown_0203CD78 - ldr r0, [r4] - bl Free - movs r5, 0 - str r5, [r4] - bl FreeAllWindowBuffers - mov r0, r9 - cmp r0, 0 - bne _081921C4 - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl SetMainCallback2 - b _081921FC - .pool -_081921C4: - ldr r0, =sub_8194220 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r6, r0, 24 - ldr r2, =gTasks - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r2 - strh r5, [r1, 0x8] - strh r5, [r1, 0xA] - movs r0, 0x3 - strh r0, [r1, 0xC] - mov r3, r8 - lsls r0, r3, 2 - add r0, r8 - lsls r0, 3 - adds r0, r2 - ldrh r0, [r0, 0x10] - strh r0, [r1, 0xE] - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r2 - ldrh r0, [r0, 0x14] - strh r0, [r1, 0x10] -_081921FC: - mov r0, r8 - bl DestroyTask -_08192202: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8190CD4 - - thumb_func_start sub_819221C -sub_819221C: @ 819221C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - movs r7, 0 - ldr r2, =gTasks - lsls r0, 2 - add r0, r9 - lsls r0, 3 - adds r0, r2 - mov r12, r0 - movs r1, 0x10 - ldrsh r6, [r0, r1] - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r2 - movs r3, 0xA - ldrsh r5, [r0, r3] - ldr r0, =gUnknown_0860D080 - adds r0, r5, r0 - ldrb r0, [r0] - mov r10, r0 - ldr r3, =gSaveBlock2Ptr - ldr r0, [r3] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r0, [r0] - mov r8, r0 - ldr r1, =gMain - ldrh r4, [r1, 0x2E] - movs r0, 0x3 - ands r0, r4 - adds r2, r1, 0 - cmp r0, 0 - beq _0819226E - movs r7, 0x9 -_0819226E: - mov r3, r12 - movs r1, 0xE - ldrsh r0, [r3, r1] - cmp r0, 0 - bne _0819227A - b _081924CC -_0819227A: - cmp r0, 0x1 - beq _08192280 - b _081923B0 -_08192280: - movs r0, 0x40 - ands r0, r4 - cmp r0, 0 - beq _081922BA - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r0, 0 - bne _081922BA - cmp r5, 0 - bne _081922B4 - movs r5, 0xF - b _081922B6 - .pool -_081922B4: - subs r5, 0x1 -_081922B6: - movs r7, 0x1 - b _08192360 -_081922BA: - ldrh r1, [r2, 0x2E] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081922E2 - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r0, 0 - bne _081922E2 - cmp r5, 0xF - bne _081922DC - movs r5, 0 - b _081922DE - .pool -_081922DC: - adds r5, 0x1 -_081922DE: - movs r7, 0x2 - b _08192360 -_081922E2: - ldrh r1, [r2, 0x2E] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08192304 - ldr r0, =gUnknown_0203CD78 - ldr r1, [r0] - ldrb r0, [r1, 0x10] - cmp r0, 0 - beq _08192304 - subs r0, 0x1 - strb r0, [r1, 0x10] - movs r7, 0x3 - b _08192360 - .pool -_08192304: - ldrh r1, [r2, 0x2E] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08192360 - ldr r2, =gSaveBlock2Ptr - ldr r0, [r2] - mov r3, r10 - lsls r1, r3, 2 - adds r0, r1 - ldr r2, =0x00000d25 - adds r0, r2 - ldrb r3, [r0] - lsls r0, r3, 29 - mov r12, r1 - cmp r0, 0 - bge _0819233C - ldr r0, =gUnknown_0203CD78 - ldr r2, [r0] - ldrb r4, [r2, 0x10] - subs r1, r4, 0x1 - lsls r0, r3, 27 - lsrs r0, 30 - cmp r1, r0 - bge _0819233C - adds r0, r4, 0x1 - strb r0, [r2, 0x10] - movs r7, 0x4 -_0819233C: - ldr r3, =gSaveBlock2Ptr - ldr r0, [r3] - add r0, r12 - ldr r1, =0x00000d25 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _08192360 - ldr r0, =gUnknown_0203CD78 - ldr r3, [r0] - ldrb r1, [r3, 0x10] - subs r0, r1, 0x1 - cmp r0, r8 - bge _08192360 - adds r0, r1, 0x1 - strb r0, [r3, 0x10] - movs r7, 0x4 -_08192360: - cmp r7, 0x9 - beq _08192366 - b _081924A0 -_08192366: - ldr r0, =gUnknown_0203CD78 - ldr r3, [r0] - ldrb r0, [r3, 0x10] - cmp r0, 0 - beq _081923A0 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - ldr r2, =gTasks - adds r1, r2 - ldr r2, =gUnknown_0860D1A0 - lsrs r0, r5, 31 - adds r0, r5, r0 - asrs r0, 1 - lsls r0, 2 - subs r0, 0x1 - ldrb r3, [r3, 0x10] - adds r0, r3 - b _08192482 - .pool -_081923A0: - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r3, =gTasks - adds r0, r3 - b _0819249E - .pool -_081923B0: - movs r0, 0x40 - ands r0, r4 - cmp r0, 0 - beq _081923DE - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r0, 0x1 - bne _081923DE - cmp r5, 0x10 - bne _081923D8 - ldr r0, =gUnknown_0860D19C - add r0, r8 - ldrb r5, [r0] - b _081923DA - .pool -_081923D8: - subs r5, 0x1 -_081923DA: - movs r7, 0x5 - b _08192446 -_081923DE: - ldrh r1, [r2, 0x2E] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0819240E - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r0, 0x1 - bne _0819240E - ldr r0, =gUnknown_0860D19C - add r0, r8 - ldrb r0, [r0] - cmp r5, r0 - bne _08192408 - movs r5, 0x10 - b _0819240A - .pool -_08192408: - adds r5, 0x1 -_0819240A: - movs r7, 0x6 - b _08192446 -_0819240E: - ldrh r1, [r2, 0x2E] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0819242C - ldr r0, =gUnknown_0203CD78 - ldr r1, [r0] - ldrb r0, [r1, 0x10] - cmp r0, 0 - beq _0819242C - movs r7, 0x7 - subs r0, 0x1 - b _08192444 - .pool -_0819242C: - ldrh r1, [r2, 0x2E] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08192446 - ldr r0, =gUnknown_0203CD78 - ldr r1, [r0] - ldrb r0, [r1, 0x10] - cmp r0, 0x1 - bhi _08192446 - movs r7, 0x8 - adds r0, 0x1 -_08192444: - strb r0, [r1, 0x10] -_08192446: - cmp r7, 0x9 - bne _081924A0 - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldrb r1, [r0, 0x10] - cmp r1, 0 - bne _08192470 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - ldr r2, =gTasks - adds r1, r2 - ldr r2, =gUnknown_0860D1C0 - ldrb r0, [r0, 0x11] - b _08192482 - .pool -_08192470: - cmp r1, 0x2 - bne _08192494 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - ldr r3, =gTasks - adds r1, r3 - ldr r2, =gUnknown_0860D1C0 - ldrb r0, [r0, 0x12] -_08192482: - adds r0, r2 - ldrb r0, [r0] - strh r0, [r1, 0xA] - b _081924A0 - .pool -_08192494: - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks - adds r0, r1 -_0819249E: - strh r5, [r0, 0xA] -_081924A0: - cmp r7, 0 - beq _081924CC - cmp r7, 0x9 - beq _081924CC - movs r0, 0x5 - bl PlaySE - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - strh r5, [r0, 0xA] - mov r2, r9 - lsls r0, r2, 2 - add r0, r9 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0xC] - movs r2, 0x1 - eors r1, r2 - strh r1, [r0, 0xC] -_081924CC: - adds r0, r7, 0 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_819221C - - thumb_func_start sub_81924E0 -sub_81924E0: @ 81924E0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x58 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x1C] - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x20] - movs r5, 0 - movs r0, 0 - str r0, [sp, 0x28] - movs r1, 0 - str r1, [sp, 0x2C] - movs r2, 0 - str r2, [sp, 0x30] - movs r4, 0 - movs r0, 0x24 - bl AllocZeroed - mov r8, r0 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r3, [sp, 0x20] - lsls r0, r3, 2 - adds r0, r1, r0 - ldr r2, =0x00000d24 - adds r0, r2 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - str r0, [sp, 0x24] - movs r0, 0x1 - ldr r3, [sp, 0x1C] - ands r0, r3 - cmp r0, 0 - beq _08192538 - movs r5, 0x8 - movs r4, 0x9 - str r4, [sp, 0x28] - movs r4, 0x2 -_08192538: - movs r0, 0x2 - ldr r2, [sp, 0x1C] - ands r0, r2 - cmp r0, 0 - beq _08192548 - movs r3, 0x80 - lsls r3, 1 - str r3, [sp, 0x2C] -_08192548: - movs r0, 0x4 - ldr r2, [sp, 0x1C] - ands r0, r2 - cmp r0, 0 - beq _08192556 - movs r3, 0xA0 - str r3, [sp, 0x30] -_08192556: - movs r0, 0x8 - ldr r2, [sp, 0x1C] - ands r0, r2 - cmp r0, 0 - beq _08192564 - ldr r3, =0xffffff00 - str r3, [sp, 0x2C] -_08192564: - movs r0, 0x10 - ldr r2, [sp, 0x1C] - ands r0, r2 - cmp r0, 0 - beq _08192574 - movs r3, 0xA0 - negs r3, r3 - str r3, [sp, 0x30] -_08192574: - ldr r0, =0x000003ff - ldr r2, [sp, 0x24] - cmp r2, r0 - bne _08192598 - ldrb r0, [r1, 0x8] - bl sub_806F000 - lsls r0, 16 - lsrs r0, 16 - b _081925B6 - .pool -_08192598: - ldr r0, =0x000003fe - ldr r3, [sp, 0x24] - cmp r3, r0 - bne _081925AC - bl sub_8195910 - b _081925B2 - .pool -_081925AC: - ldr r0, [sp, 0x24] - bl sub_8162AA0 -_081925B2: - lsls r0, 24 - lsrs r0, 24 -_081925B6: - ldr r2, [sp, 0x2C] - adds r2, 0x30 - ldr r3, [sp, 0x30] - adds r3, 0x40 - adds r1, r4, 0 - adds r1, 0xC - str r1, [sp] - ldr r1, =0x0000ffff - str r1, [sp, 0x4] - movs r1, 0x1 - bl sub_818D8AC - ldr r1, =gUnknown_0203CD78 - ldr r1, [r1] - adds r1, r5 - strb r0, [r1] - movs r0, 0x1E - ldr r4, [sp, 0x1C] - ands r0, r4 - cmp r0, 0 - beq _081925FC - ldr r2, =gSprites - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_081925FC: - movs r7, 0 - ldr r0, [sp, 0x20] - lsls r0, 1 - str r0, [sp, 0x3C] - adds r1, r5, 0x2 - ldr r2, [sp, 0x28] - lsls r2, 24 - str r2, [sp, 0x44] - ldr r3, [sp, 0x28] - adds r3, 0x4 - str r3, [sp, 0x40] - ldr r4, [sp, 0x20] - adds r0, r4 - ldr r6, =gUnknown_0203CD78 - ldr r2, =gSprites - mov r10, r2 - adds r4, r1, 0 - lsls r5, r0, 1 - movs r3, 0 - mov r9, r3 -_08192624: - ldr r0, =0x000003ff - ldr r1, [sp, 0x24] - cmp r1, r0 - bne _08192660 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000d64 - adds r0, r2 - adds r0, r5 - ldrh r0, [r0] - ldr r1, =gUnknown_0860D340 - adds r1, r7, r1 - ldrb r2, [r1] - ldr r3, [sp, 0x2C] - orrs r2, r3 - b _081926B0 - .pool -_08192660: - ldr r0, =0x000003fe - ldr r3, [sp, 0x24] - cmp r3, r0 - bne _08192690 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000d64 - adds r0, r1 - adds r0, r5 - ldrh r0, [r0] - ldr r1, =gUnknown_0860D340 - adds r1, r7, r1 - ldrb r2, [r1] - ldr r3, [sp, 0x2C] - orrs r2, r3 - b _081926B0 - .pool -_08192690: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r3, =0x00000d64 - adds r0, r3 - adds r0, r5 - ldrh r1, [r0] - ldr r0, =gUnknown_0203BC8C - ldr r0, [r0] - lsls r1, 4 - adds r1, r0 - ldrh r0, [r1] - ldr r1, =gUnknown_0860D340 - adds r1, r7, r1 - ldrb r2, [r1] - ldr r1, [sp, 0x2C] - orrs r2, r1 -_081926B0: - ldr r1, =gUnknown_0860D343 - adds r1, r7, r1 - ldrb r3, [r1] - ldr r1, [sp, 0x30] - adds r3, r1 - mov r1, r9 - str r1, [sp] - str r1, [sp, 0x4] - movs r1, 0x1 - str r1, [sp, 0x8] - ldr r1, =sub_8190938 - bl sub_80D2CC4 - ldr r1, [r6] - adds r1, r4 - strb r0, [r1] - ldr r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r10 - ldrb r1, [r0, 0x5] - movs r2, 0xD - negs r2, r2 - ands r1, r2 - strb r1, [r0, 0x5] - movs r0, 0x1E - ldr r3, [sp, 0x1C] - ands r0, r3 - cmp r0, 0 - beq _0819270A - ldr r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r10 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_0819270A: - adds r4, 0x1 - adds r5, 0x2 - adds r7, 0x1 - cmp r7, 0x2 - ble _08192624 - add r0, sp, 0xC - movs r2, 0 - movs r3, 0x2 - strb r3, [r0, 0x5] - strb r2, [r0, 0x6] - strb r2, [r0, 0x7] - adds r1, r0, 0 - adds r0, r2, 0 - strb r0, [r1, 0x8] - adds r0, r1, 0 - ldrb r0, [r0, 0x7] - strb r0, [r1, 0x9] - adds r0, r1, 0 - strb r3, [r0, 0xA] - strb r2, [r0, 0xB] - adds r3, r0, 0 - ldrb r2, [r3, 0xC] - movs r1, 0x10 - negs r1, r1 - adds r0, r1, 0 - ands r0, r2 - strb r0, [r3, 0xC] - adds r2, r3, 0 - movs r0, 0xE0 - strb r0, [r2, 0xC] - ldrb r0, [r2, 0xD] - ands r1, r0 - strb r1, [r2, 0xD] - adds r1, r2, 0 - movs r0, 0xD0 - strb r0, [r1, 0xD] - movs r7, 0 - ldr r0, =0x000003ff - ldr r4, [sp, 0x24] - cmp r4, r0 - bne _08192784 - ldr r0, =gTrainerClassNameIndices - adds r0, 0x3C - ldrb r5, [r0] - b _081927A2 - .pool -_08192784: - ldr r0, =0x000003fe - ldr r1, [sp, 0x24] - cmp r1, r0 - bne _08192798 - bl sub_8195924 - b _0819279E - .pool -_08192798: - ldr r0, [sp, 0x24] - bl sub_8162BD8 -_0819279E: - lsls r0, 24 - lsrs r5, r0, 24 -_081927A2: - ldr r2, =gTrainerClassNames - movs r0, 0xD - adds r1, r5, 0 - muls r1, r0 - adds r0, r7, r1 - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0xFF - beq _081927CA - ldr r3, =gStringVar1 - adds r0, r1, r2 - adds r2, r7, r0 -_081927BA: - adds r0, r7, r3 - ldrb r1, [r2] - strb r1, [r0] - adds r2, 0x1 - adds r7, 0x1 - ldrb r0, [r2] - cmp r0, 0xFF - bne _081927BA -_081927CA: - ldr r5, =gStringVar1 - adds r1, r7, r5 - movs r0, 0 - strb r0, [r1] - adds r0, r7, 0x1 - adds r0, r5 - movs r1, 0xFF - strb r1, [r0] - ldr r0, =0x000003ff - ldr r2, [sp, 0x24] - cmp r2, r0 - bne _08192800 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - adds r0, r5, 0 - bl StringAppend - b _08192836 - .pool -_08192800: - ldr r0, =0x000003fe - ldr r3, [sp, 0x24] - cmp r3, r0 - bne _08192824 - ldr r4, =gStringVar2 - adds r0, r4, 0 - bl sub_8195938 - adds r0, r5, 0 - adds r1, r4, 0 - bl StringAppend - b _08192836 - .pool -_08192824: - ldr r4, =gStringVar2 - ldr r1, [sp, 0x24] - adds r0, r4, 0 - bl sub_8195898 - adds r0, r5, 0 - adds r1, r4, 0 - bl StringAppend -_08192836: - add r0, sp, 0xC - ldrb r0, [r0, 0x5] - ldr r4, =gStringVar1 - add r1, sp, 0xC - ldrb r3, [r1, 0xA] - adds r1, r4, 0 - movs r2, 0xD0 - bl GetStringCenterAlignXOffsetWithLetterSpacing - add r1, sp, 0xC - movs r5, 0 - strb r0, [r1, 0x8] - str r4, [sp, 0xC] - adds r0, r1, 0 - add r4, sp, 0x28 - ldrb r4, [r4] - strb r4, [r0, 0x4] - ldr r0, [sp, 0x44] - lsrs r4, r0, 24 - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - add r0, sp, 0xC - movs r1, 0 - movs r2, 0 - bl AddTextPrinter - add r0, sp, 0xC - strb r5, [r0, 0xA] - movs r7, 0 - adds r6, r0, 0 - ldr r1, [sp, 0x3C] - ldr r2, [sp, 0x20] - adds r0, r1, r2 - lsls r0, 1 - mov r9, r0 - movs r3, 0xB - mov r10, r3 -_0819288A: - ldr r0, =gUnknown_0860D346 - adds r0, r7, r0 - ldrb r0, [r0] - strb r0, [r6, 0x9] - ldr r0, =0x000003ff - ldr r4, [sp, 0x24] - cmp r4, r0 - bne _081928C0 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - lsls r0, r7, 1 - add r0, r9 - ldr r2, =0x00000d64 - adds r1, r2 - b _081928FA - .pool -_081928C0: - ldr r0, =0x000003fe - ldr r4, [sp, 0x24] - cmp r4, r0 - bne _081928E4 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - lsls r0, r7, 1 - add r0, r9 - ldr r2, =0x00000d64 - adds r1, r2 - b _081928FA - .pool -_081928E4: - ldr r4, =gSaveBlock2Ptr - ldr r1, [r4] - lsls r0, r7, 1 - add r0, r9 - ldr r2, =0x00000d64 - adds r1, r2 - adds r1, r0 - ldrh r1, [r1] - ldr r0, =gUnknown_0203BC8C - ldr r0, [r0] - lsls r1, 4 -_081928FA: - adds r1, r0 - ldrh r0, [r1] - mov r3, r10 - muls r3, r0 - adds r0, r3, 0 - ldr r1, =gSpeciesNames - adds r0, r1 - str r0, [sp, 0xC] - adds r0, r7, 0x1 - ldr r4, [sp, 0x28] - adds r0, r4 - movs r1, 0 - strb r0, [r6, 0x4] - cmp r7, 0x1 - bne _08192930 - movs r0, 0x7 - strb r0, [r6, 0x8] - b _08192932 - .pool -_08192930: - strb r1, [r6, 0x8] -_08192932: - adds r5, r7, 0x1 - ldr r0, [sp, 0x28] - adds r4, r5, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - add r0, sp, 0xC - movs r1, 0 - movs r2, 0 - bl AddTextPrinter - adds r7, r5, 0 - cmp r7, 0x2 - ble _0819288A - ldr r4, [sp, 0x40] - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - ldr r0, =0x000003fe - ldr r1, [sp, 0x24] - cmp r1, r0 - bne _08192980 - ldr r0, =gUnknown_0860D1D0 - ldr r0, [r0, 0x40] - b _0819298A - .pool -_08192980: - ldr r0, =gUnknown_0860D1D0 - ldr r2, [sp, 0x20] - lsls r1, r2, 2 - adds r1, r0 - ldr r0, [r1] -_0819298A: - str r0, [sp, 0xC] - add r1, sp, 0xC - movs r2, 0 - movs r0, 0x1 - strb r0, [r1, 0x5] - adds r0, r1, 0 - add r3, sp, 0x40 - ldrb r3, [r3] - strb r3, [r0, 0x4] - strb r2, [r0, 0x8] - movs r1, 0x4 - strb r1, [r0, 0x7] - strb r1, [r0, 0x9] - movs r1, 0 - bl AddTextPrinter - movs r7, 0 - ldr r3, =gUnknown_0860B358 -_081929AE: - movs r5, 0 - adds r4, r7, 0x1 - str r4, [sp, 0x38] - lsls r0, r7, 1 - str r0, [sp, 0x34] - lsls r2, r7, 4 -_081929BA: - movs r6, 0 - lsls r1, r5, 1 - mov r10, r1 - mov r4, r8 - mov r9, r2 -_081929C4: - ldr r0, =0x000003fe - ldr r1, [sp, 0x24] - cmp r1, r0 - bne _08192A00 - lsls r0, r7, 24 - lsls r1, r5, 24 - lsrs r0, 24 - lsrs r1, 24 - str r2, [sp, 0x48] - str r3, [sp, 0x4C] - bl sub_81A5060 - lsls r0, 16 - lsrs r0, 12 - adds r0, r6, r0 - ldr r3, [sp, 0x4C] - adds r0, r3 - ldrh r1, [r4] - ldrb r0, [r0] - adds r1, r0 - strh r1, [r4] - ldr r2, [sp, 0x48] - b _08192A58 - .pool -_08192A00: - ldr r0, =0x000003ff - ldr r1, [sp, 0x24] - cmp r1, r0 - bne _08192A20 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000efc - adds r0, r1 - add r0, r9 - b _08192A48 - .pool -_08192A20: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - mov r12, r0 - ldr r0, [sp, 0x3C] - ldr r1, [sp, 0x20] - adds r0, r1 - str r0, [sp, 0x50] - lsls r0, 1 - ldr r1, [sp, 0x34] - adds r0, r1, r0 - ldr r1, =0x00000d64 - add r1, r12 - adds r1, r0 - ldrh r0, [r1] - ldr r1, =gUnknown_0203BC8C - ldr r1, [r1] - lsls r0, 4 - adds r0, r1 - adds r0, 0x2 - add r0, r10 -_08192A48: - ldrh r0, [r0] - lsls r0, 4 - adds r0, r6, r0 - adds r0, r3 - ldrh r1, [r4] - ldrb r0, [r0] - adds r1, r0 - strh r1, [r4] -_08192A58: - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0xF - ble _081929C4 - adds r2, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _081929BA - ldr r7, [sp, 0x38] - cmp r7, 0x2 - ble _081929AE - movs r7, 0 - ldr r2, =gUnknown_0860D214 - mov r9, r2 - ldr r3, =gUnknown_0860C988 - mov r10, r3 -_08192A78: - movs r4, 0 - movs r6, 0 - movs r5, 0 - mov r3, r8 - lsls r0, r7, 4 - mov r1, r10 - adds r2, r0, r1 -_08192A86: - ldrb r0, [r2] - cmp r0, 0 - beq _08192A9E - adds r4, 0x1 - movs r1, 0 - ldrsh r0, [r3, r1] - cmp r0, 0 - beq _08192A9E - ldrb r1, [r2] - cmp r0, r1 - blt _08192A9E - adds r6, 0x1 -_08192A9E: - adds r3, 0x2 - adds r2, 0x1 - adds r5, 0x1 - cmp r5, 0xF - ble _08192A86 - cmp r4, r6 - beq _08192AB2 - adds r7, 0x1 - cmp r7, 0x1E - bls _08192A78 -_08192AB2: - lsls r0, r7, 2 - add r0, r9 - ldr r0, [r0] - str r0, [sp, 0xC] - add r0, sp, 0xC - movs r1, 0x14 - strb r1, [r0, 0x7] - strb r1, [r0, 0x9] - movs r1, 0 - movs r2, 0 - bl AddTextPrinter - movs r1, 0 - mov r0, r8 - adds r0, 0x22 -_08192AD0: - strh r1, [r0] - subs r0, 0x2 - cmp r0, r8 - bge _08192AD0 - ldr r2, [sp, 0x24] - ldr r3, =0xfffffc02 - adds r0, r2, r3 - cmp r0, 0x1 - bls _08192AE4 - b _08192C24 -_08192AE4: - movs r7, 0 - movs r4, 0 - mov r9, r4 -_08192AEA: - movs r5, 0 - mov r4, r8 - mov r6, r9 -_08192AF0: - ldr r0, =0x000003fe - ldr r1, [sp, 0x24] - cmp r1, r0 - bne _08192B24 - lsls r1, r5, 24 - lsrs r1, 24 - lsrs r0, r6, 24 - bl sub_81A50F0 - lsls r0, 24 - lsrs r0, 24 - b _08192B34 - .pool -_08192B24: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r7, 4 - adds r1, r5, r1 - ldr r2, =0x00000f04 - adds r0, r2 - adds r0, r1 - ldrb r0, [r0] -_08192B34: - strh r0, [r4] - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x5 - ble _08192AF0 - mov r3, r8 - ldrh r0, [r3] - ldrh r4, [r3, 0xC] - adds r0, r4 - strh r0, [r3, 0xC] - movs r5, 0 - mov r4, r8 -_08192B4C: - ldr r0, =0x000003fe - ldr r1, [sp, 0x24] - cmp r1, r0 - bne _08192B70 - mov r2, r9 - lsrs r0, r2, 24 - bl sub_81A50B0 - lsls r0, 24 - lsrs r2, r0, 24 - b _08192B7E - .pool -_08192B70: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r7, 4 - adds r0, r1 - ldr r3, =0x00000f0a - adds r0, r3 - ldrb r2, [r0] -_08192B7E: - ldr r1, =gNatureStatTable - lsls r0, r2, 2 - adds r0, r2 - adds r0, r5, r0 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - ble _08192BB4 - movs r0, 0x2 - ldrsh r1, [r4, r0] - movs r0, 0x6E - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - ldrh r1, [r4, 0xE] - adds r1, r0 - strh r1, [r4, 0xE] - b _08192BDC - .pool -_08192BB4: - cmp r0, 0 - bge _08192BD4 - movs r2, 0x2 - ldrsh r1, [r4, r2] - movs r0, 0x5A - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - ldrh r1, [r4, 0xE] - adds r1, r0 - strh r1, [r4, 0xE] - ldrh r0, [r4, 0x1A] - adds r0, 0x1 - strh r0, [r4, 0x1A] - b _08192BDC -_08192BD4: - ldrh r0, [r4, 0x2] - ldrh r3, [r4, 0xE] - adds r0, r3 - strh r0, [r4, 0xE] -_08192BDC: - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x4 - ble _08192B4C - movs r4, 0x80 - lsls r4, 17 - add r9, r4 - adds r7, 0x1 - cmp r7, 0x2 - bgt _08192BF2 - b _08192AEA -_08192BF2: - movs r5, 0 - mov r1, r8 - movs r7, 0x5 -_08192BF8: - movs r2, 0xC - ldrsh r0, [r1, r2] - adds r5, r0 - adds r1, 0x2 - subs r7, 0x1 - cmp r7, 0 - bge _08192BF8 - movs r6, 0x64 - mov r4, r8 - movs r7, 0x5 -_08192C0C: - movs r3, 0xC - ldrsh r0, [r4, r3] - muls r0, r6 - adds r1, r5, 0 - bl __divsi3 - strh r0, [r4] - adds r4, 0x2 - subs r7, 0x1 - cmp r7, 0 - bge _08192C0C - b _08192D70 -_08192C24: - ldr r4, =gUnknown_0203BC8C - mov r10, r4 - ldr r1, [sp, 0x3C] - ldr r2, [sp, 0x20] - adds r0, r1, r2 - lsls r0, 1 - mov r9, r0 - movs r7, 0x2 -_08192C34: - ldr r3, =gSaveBlock2Ptr - ldr r0, [r3] - ldr r4, =0x00000d64 - adds r0, r4 - add r0, r9 - ldrh r0, [r0] - mov r2, r10 - ldr r1, [r2] - lsls r0, 4 - adds r0, r1 - ldrb r2, [r0, 0xB] - movs r6, 0 - movs r4, 0 - movs r3, 0x1 - mov r1, r8 - movs r5, 0x5 -_08192C54: - strh r4, [r1] - adds r0, r2, 0 - ands r0, r3 - cmp r0, 0 - beq _08192C60 - adds r6, 0x1 -_08192C60: - asrs r2, 1 - adds r1, 0x2 - subs r5, 0x1 - cmp r5, 0 - bge _08192C54 - movs r0, 0xFF - lsls r0, 1 - adds r1, r6, 0 - bl __divsi3 - adds r6, r0, 0 - ldr r3, =gSaveBlock2Ptr - ldr r0, [r3] - ldr r4, =0x00000d64 - adds r0, r4 - add r0, r9 - ldrh r0, [r0] - mov r2, r10 - ldr r1, [r2] - lsls r0, 4 - adds r0, r1 - ldrb r2, [r0, 0xB] - movs r3, 0x1 - mov r1, r8 - movs r5, 0x5 -_08192C92: - adds r0, r2, 0 - ands r0, r3 - cmp r0, 0 - beq _08192C9C - strh r6, [r1] -_08192C9C: - asrs r2, 1 - adds r1, 0x2 - subs r5, 0x1 - cmp r5, 0 - bge _08192C92 - mov r3, r8 - ldrh r0, [r3] - ldrh r4, [r3, 0xC] - adds r0, r4 - strh r0, [r3, 0xC] - movs r5, 0 - mov r4, r8 -_08192CB4: - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r2, =0x00000d64 - adds r0, r2 - add r0, r9 - ldrh r0, [r0] - mov r3, r10 - ldr r1, [r3] - lsls r0, 4 - adds r0, r1 - ldrb r2, [r0, 0xC] - lsls r0, r2, 2 - adds r0, r2 - adds r0, r5, r0 - ldr r1, =gNatureStatTable - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - ble _08192D04 - movs r2, 0x2 - ldrsh r1, [r4, r2] - movs r0, 0x6E - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - ldrh r1, [r4, 0xE] - adds r1, r0 - strh r1, [r4, 0xE] - b _08192D2C - .pool -_08192D04: - cmp r0, 0 - bge _08192D24 - movs r3, 0x2 - ldrsh r1, [r4, r3] - movs r0, 0x5A - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - ldrh r1, [r4, 0xE] - adds r1, r0 - strh r1, [r4, 0xE] - ldrh r0, [r4, 0x1A] - adds r0, 0x1 - strh r0, [r4, 0x1A] - b _08192D2C -_08192D24: - ldrh r0, [r4, 0x2] - ldrh r1, [r4, 0xE] - adds r0, r1 - strh r0, [r4, 0xE] -_08192D2C: - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x4 - ble _08192CB4 - movs r2, 0x2 - add r9, r2 - subs r7, 0x1 - cmp r7, 0 - blt _08192D40 - b _08192C34 -_08192D40: - movs r5, 0 - mov r1, r8 - movs r7, 0x5 -_08192D46: - movs r3, 0xC - ldrsh r0, [r1, r3] - adds r5, r0 - adds r1, 0x2 - subs r7, 0x1 - cmp r7, 0 - bge _08192D46 - movs r6, 0x64 - mov r4, r8 - movs r7, 0x5 -_08192D5A: - movs r1, 0xC - ldrsh r0, [r4, r1] - muls r0, r6 - adds r1, r5, 0 - bl __divsi3 - strh r0, [r4] - adds r4, 0x2 - subs r7, 0x1 - cmp r7, 0 - bge _08192D5A -_08192D70: - movs r7, 0 - movs r5, 0 - movs r6, 0 - mov r4, r8 - mov r10, r8 - mov r9, r8 -_08192D7C: - movs r2, 0 - ldrsh r1, [r4, r2] - cmp r1, 0x1D - ble _08192DDE - cmp r7, 0x2 - bne _08192DD4 - mov r3, r8 - movs r0, 0xC - ldrsh r3, [r3, r0] - mov r12, r3 - cmp r12, r1 - bge _08192DC6 - mov r2, r8 - ldrh r2, [r2, 0xE] - add r3, sp, 0x54 - strh r2, [r3] - mov r2, r8 - movs r3, 0xE - ldrsh r0, [r2, r3] - cmp r0, r1 - bge _08192DBA - cmp r12, r0 - bge _08192DB4 - add r0, sp, 0x54 - ldrh r0, [r0] - strh r0, [r2, 0xC] - strh r6, [r2, 0xE] - b _08192DDE -_08192DB4: - mov r1, r8 - strh r6, [r1, 0xE] - b _08192DDE -_08192DBA: - add r2, sp, 0x54 - ldrh r3, [r2] - mov r2, r8 - strh r3, [r2, 0xC] - strh r6, [r2, 0xE] - b _08192DDE -_08192DC6: - mov r3, r8 - movs r2, 0xE - ldrsh r0, [r3, r2] - cmp r0, r1 - bge _08192DDE - strh r6, [r3, 0xE] - b _08192DDE -_08192DD4: - mov r3, r9 - strh r6, [r3, 0xC] - movs r0, 0x2 - add r9, r0 - adds r7, 0x1 -_08192DDE: - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08192E64 - cmp r5, 0x2 - bne _08192E5A - movs r2, 0x18 - ldrsh r0, [r4, r2] - cmp r0, 0x1 - bgt _08192E18 - cmp r0, 0x1 - bne _08192E64 - mov r3, r8 - movs r1, 0x10 - ldrsh r0, [r3, r1] - lsls r0, 1 - add r0, r8 - movs r2, 0x18 - ldrsh r0, [r0, r2] - cmp r0, 0 - bne _08192E22 - movs r1, 0x12 - ldrsh r0, [r3, r1] - lsls r0, 1 - add r0, r8 - movs r2, 0x18 - ldrsh r0, [r0, r2] - cmp r0, 0 - bne _08192E22 -_08192E18: - mov r3, r8 - ldrh r0, [r3, 0x12] - strh r0, [r3, 0x10] - strh r6, [r3, 0x12] - b _08192E64 -_08192E22: - movs r1, 0x18 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - bne _08192E64 - mov r2, r8 - movs r3, 0x10 - ldrsh r0, [r2, r3] - lsls r0, 1 - add r0, r8 - movs r1, 0x18 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08192E44 - ldrh r0, [r2, 0x12] - strh r0, [r2, 0x10] - strh r6, [r2, 0x12] - b _08192E64 -_08192E44: - mov r2, r8 - movs r3, 0x12 - ldrsh r0, [r2, r3] - lsls r0, 1 - add r0, r8 - movs r1, 0x18 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08192E64 - strh r6, [r2, 0x12] - b _08192E64 -_08192E5A: - mov r2, r10 - strh r6, [r2, 0x10] - movs r3, 0x2 - add r10, r3 - adds r5, 0x1 -_08192E64: - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x5 - ble _08192D7C - cmp r7, 0x2 - bne _08192E8C - ldr r0, =gUnknown_0860D349 - mov r4, r8 - movs r1, 0xC - ldrsh r2, [r4, r1] - adds r0, r2, r0 - movs r3, 0xE - ldrsh r1, [r4, r3] - subs r1, 0x1 - subs r1, r2 - ldrb r0, [r0] - adds r7, r1, r0 - b _08192ED2 - .pool -_08192E8C: - cmp r7, 0x1 - bne _08192E9C - mov r4, r8 - movs r1, 0xC - ldrsh r0, [r4, r1] - adds r7, r0, 0 - adds r7, 0xF - b _08192ED2 -_08192E9C: - cmp r5, 0x2 - bne _08192EC0 - ldr r0, =gUnknown_0860D349 - mov r3, r8 - movs r4, 0x10 - ldrsh r2, [r3, r4] - adds r0, r2, r0 - movs r4, 0x12 - ldrsh r1, [r3, r4] - subs r1, 0x1 - subs r1, r2 - ldrb r0, [r0] - adds r1, r0 - adds r7, r1, 0 - adds r7, 0x15 - b _08192ED2 - .pool -_08192EC0: - cmp r5, 0x1 - bne _08192ED0 - mov r1, r8 - movs r2, 0x10 - ldrsh r0, [r1, r2] - adds r7, r0, 0 - adds r7, 0x24 - b _08192ED2 -_08192ED0: - movs r7, 0x2A -_08192ED2: - lsls r0, r7, 2 - ldr r3, =gUnknown_0860D294 - adds r0, r3 - ldr r0, [r0] - str r0, [sp, 0xC] - add r0, sp, 0xC - movs r1, 0x24 - strb r1, [r0, 0x7] - strb r1, [r0, 0x9] - movs r1, 0 - movs r2, 0 - bl AddTextPrinter - mov r0, r8 - bl Free - add sp, 0x58 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81924E0 - - thumb_func_start sub_8192F08 -sub_8192F08: @ 8192F08 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - str r1, [sp] - lsls r0, 24 - lsrs r7, r0, 24 - movs r0, 0 - str r0, [sp, 0x4] - mov r8, r0 - ldr r2, =gUnknown_0860D3C4 - lsls r0, r7, 1 - adds r0, r7 - adds r1, r0, r2 - ldrb r6, [r1] - adds r1, r2, 0x1 - adds r0, r1 - ldrb r0, [r0] - adds r0, r6, r0 - adds r3, r2, 0 - cmp r6, r0 - bge _08192FD4 - ldr r5, =gSaveBlock2Ptr - ldr r1, =0x000003ff - mov r10, r1 - ldr r2, =0x000003fe - mov r9, r2 -_08192F42: - ldr r0, =gUnknown_0860D3B4 - adds r0, r6, r0 - ldrb r4, [r0] - ldr r0, [r5] - lsls r1, r4, 2 - adds r0, r1 - ldr r2, =0x00000d25 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _08192FBE - ldr r0, [sp] - add r0, r8 - strb r4, [r0] - ldr r2, [r5] - adds r0, r2, r1 - ldr r1, =0x00000d24 - adds r0, r1 - ldrh r0, [r0] - lsls r1, r0, 22 - lsrs r0, r1, 22 - cmp r0, r10 - bne _08192F9C - ldr r0, =gStringVar1 - adds r1, r2, 0 - bl StringCopy - b _08192FB8 - .pool -_08192F9C: - lsrs r0, r1, 22 - cmp r0, r9 - bne _08192FB0 - ldr r0, =gStringVar1 - bl sub_8195938 - b _08192FB8 - .pool -_08192FB0: - lsrs r1, 22 - ldr r0, =gStringVar1 - bl sub_8195898 -_08192FB8: - movs r2, 0x1 - add r8, r2 - ldr r3, =gUnknown_0860D3C4 -_08192FBE: - adds r6, 0x1 - lsls r1, r7, 1 - adds r1, r7 - adds r0, r1, r3 - ldrb r2, [r0] - adds r0, r3, 0x1 - adds r1, r0 - ldrb r0, [r1] - adds r2, r0 - cmp r6, r2 - blt _08192F42 -_08192FD4: - mov r5, r8 - cmp r5, 0x2 - bne _08192FE8 - movs r0, 0 - b _0819313C - .pool -_08192FE8: - mov r12, r3 - lsls r3, r7, 1 - adds r0, r3, r7 - mov r2, r12 - adds r1, r0, r2 - ldrb r6, [r1] - mov r1, r12 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - adds r0, r6, r0 - str r3, [sp, 0x8] - cmp r6, r0 - blt _08193006 - b _08193126 -_08193006: - ldr r5, =gSaveBlock2Ptr - mov r10, r5 - ldr r0, =0x00000d25 - mov r9, r0 -_0819300E: - ldr r0, =gUnknown_0860D3B4 - adds r0, r6, r0 - ldrb r4, [r0] - mov r1, r10 - ldr r0, [r1] - lsls r2, r4, 2 - str r2, [sp, 0xC] - adds r0, r2 - add r0, r9 - ldrb r2, [r0] - lsls r0, r2, 29 - cmp r0, 0 - bge _08193100 - lsls r2, 27 - adds r1, r3, r7 - mov r0, r12 - adds r0, 0x2 - adds r1, r0 - lsrs r2, 30 - ldrb r1, [r1] - cmp r2, r1 - bcc _08193100 - ldr r0, [sp] - add r0, r8 - strb r4, [r0] - movs r5, 0x1 - add r8, r5 - mov r0, r10 - ldr r3, [r0] - ldr r5, [sp, 0xC] - adds r2, r3, r5 - adds r0, r2, 0 - add r0, r9 - ldrb r5, [r0] - mov r12, r5 - mov r0, r12 - lsls r0, 27 - lsrs r0, 30 - cmp r0, r1 - bne _081930BC - lsls r4, 1 - movs r1, 0xEC - lsls r1, 4 - adds r0, r3, r1 - adds r0, r4 - ldrh r1, [r0] - movs r0, 0xD - muls r1, r0 - ldr r0, =gMoveNames - adds r1, r0 - ldr r0, =gStringVar2 - bl StringCopy - mov r2, r10 - ldr r1, [r2] - ldr r5, [sp, 0xC] - adds r0, r1, r5 - add r0, r9 - ldrb r0, [r0] - lsls r2, r0, 24 - lsrs r0, r2, 29 - lsls r0, 1 - str r0, [sp, 0x4] - movs r0, 0xEC - lsls r0, 4 - adds r1, r0 - adds r1, r4 - ldrh r0, [r1] - cmp r0, 0 - bne _08193100 - lsrs r0, r2, 29 - cmp r0, 0 - bne _08193100 - movs r1, 0x4 - str r1, [sp, 0x4] - b _08193100 - .pool -_081930BC: - ldr r5, =0x00000d24 - adds r0, r2, r5 - ldrh r0, [r0] - lsls r1, r0, 22 - ldr r0, =0xffc00000 - cmp r1, r0 - bne _081930E0 - ldr r0, =gStringVar1 - adds r1, r3, 0 - bl StringCopy - b _08193100 - .pool -_081930E0: - ldr r0, =0xff800000 - cmp r1, r0 - bne _081930F8 - ldr r0, =gStringVar1 - bl sub_8195938 - b _08193100 - .pool -_081930F8: - lsrs r1, 22 - ldr r0, =gStringVar1 - bl sub_8195898 -_08193100: - mov r0, r8 - cmp r0, 0x2 - beq _08193126 - adds r6, 0x1 - ldr r1, =gUnknown_0860D3C4 - mov r12, r1 - ldr r3, [sp, 0x8] - adds r1, r3, r7 - mov r2, r12 - adds r0, r1, r2 - ldrb r2, [r0] - mov r0, r12 - adds r0, 0x1 - adds r1, r0 - ldrb r0, [r1] - adds r2, r0 - cmp r6, r2 - bge _08193126 - b _0819300E -_08193126: - cmp r7, 0xE - beq _08193138 - ldr r0, [sp, 0x4] - adds r0, 0x1 - b _0819313C - .pool -_08193138: - ldr r0, [sp, 0x4] - adds r0, 0x2 -_0819313C: - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8192F08 - - thumb_func_start sub_819314C -sub_819314C: @ 819314C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x80 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x34] - lsls r1, 24 - lsrs r6, r1, 24 - movs r0, 0 - str r0, [sp, 0x3C] - movs r7, 0 - movs r1, 0 - str r1, [sp, 0x40] - movs r2, 0 - str r2, [sp, 0x44] - mov r9, r2 - movs r0, 0x1 - ldr r3, [sp, 0x34] - ands r0, r3 - cmp r0, 0 - beq _08193186 - movs r7, 0x8 - str r7, [sp, 0x3C] - movs r7, 0x9 - movs r0, 0x2 - mov r9, r0 -_08193186: - movs r0, 0x2 - ldr r1, [sp, 0x34] - ands r0, r1 - cmp r0, 0 - beq _08193196 - movs r2, 0x80 - lsls r2, 1 - str r2, [sp, 0x40] -_08193196: - movs r0, 0x4 - ldr r3, [sp, 0x34] - ands r0, r3 - cmp r0, 0 - beq _081931A4 - movs r0, 0xA0 - str r0, [sp, 0x44] -_081931A4: - movs r0, 0x8 - ldr r1, [sp, 0x34] - ands r0, r1 - cmp r0, 0 - beq _081931B2 - ldr r2, =0xffffff00 - str r2, [sp, 0x40] -_081931B2: - movs r0, 0x10 - ldr r3, [sp, 0x34] - ands r0, r3 - cmp r0, 0 - beq _081931C2 - movs r0, 0xA0 - negs r0, r0 - str r0, [sp, 0x44] -_081931C2: - ldr r4, =gUnknown_0203CD78 - ldr r1, [r4] - adds r1, 0x11 - adds r0, r6, 0 - bl sub_8192F08 - str r0, [sp, 0x38] - movs r5, 0 - mov r1, sp - adds r1, 0x1C - str r1, [sp, 0x48] - mov r2, sp - adds r2, 0x24 - str r2, [sp, 0x4C] - lsls r1, r6, 1 - mov r3, sp - adds r3, 0x2C - str r3, [sp, 0x50] - ldr r0, [sp, 0x40] - adds r0, 0x30 - mov r8, r0 - ldr r2, [sp, 0x44] - adds r2, 0x58 - str r2, [sp, 0x78] - movs r3, 0xC - add r3, r9 - mov r10, r3 - ldr r0, [sp, 0x40] - adds r0, 0xC0 - str r0, [sp, 0x7C] - mov r2, r9 - adds r2, 0xD - str r2, [sp, 0x74] - ldr r3, [sp, 0x3C] - adds r3, 0x1 - mov r9, r3 - ldr r0, [sp, 0x3C] - adds r0, 0x2 - str r0, [sp, 0x54] - ldr r2, [sp, 0x3C] - adds r2, 0x5 - str r2, [sp, 0x5C] - adds r3, r7, 0 - adds r3, 0x8 - str r3, [sp, 0x6C] - adds r0, r7, 0x6 - str r0, [sp, 0x64] - adds r2, r7, 0x7 - str r2, [sp, 0x68] - lsls r3, r6, 2 - str r3, [sp, 0x58] - adds r0, r7, 0x5 - str r0, [sp, 0x60] - ldr r0, [r4] - adds r0, 0x11 - mov r12, r0 - ldr r0, =gSaveBlock2Ptr - ldr r4, [r0] - ldr r0, =gUnknown_0860D3C6 - movs r3, 0 - adds r1, r6 - adds r1, r0 - ldrb r6, [r1] -_08193240: - ldr r1, [sp, 0x48] - adds r2, r3, r1 - mov r7, r12 - adds r0, r7, r5 - ldrb r0, [r0] - str r0, [r2] - ldr r7, [sp, 0x4C] - adds r1, r3, r7 - lsls r0, 2 - adds r0, r4, r0 - ldr r7, =0x00000d24 - adds r0, r7 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - str r0, [r1] - ldr r0, [r2] - lsls r0, 2 - adds r0, r4, r0 - ldr r1, =0x00000d25 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 27 - lsrs r0, 30 - cmp r0, r6 - bhi _0819329C - lsls r0, r1, 29 - cmp r0, 0 - bge _0819329C - ldr r2, [sp, 0x50] - adds r1, r3, r2 - movs r0, 0x1 - b _081932A2 - .pool -_0819329C: - ldr r7, [sp, 0x50] - adds r1, r3, r7 - movs r0, 0 -_081932A2: - str r0, [r1] - adds r3, 0x4 - adds r5, 0x1 - cmp r5, 0x1 - ble _08193240 - ldr r1, [sp, 0x24] - ldr r0, =0x000003ff - cmp r1, r0 - bne _081932D4 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldrb r0, [r0, 0x8] - bl sub_806F000 - lsls r0, 16 - lsrs r0, 16 - mov r2, r8 - ldr r3, [sp, 0x78] - mov r1, r10 - str r1, [sp] - b _081932F8 - .pool -_081932D4: - ldr r0, =0x000003fe - cmp r1, r0 - bne _081932E4 - bl sub_8195910 - b _081932EC - .pool -_081932E4: - lsls r0, r1, 16 - lsrs r0, 16 - bl sub_8162AA0 -_081932EC: - lsls r0, 24 - lsrs r0, 24 - mov r2, r8 - ldr r3, [sp, 0x78] - mov r7, r10 - str r7, [sp] -_081932F8: - ldr r1, =0x0000ffff - str r1, [sp, 0x4] - movs r1, 0x1 - bl sub_818D8AC - ldr r1, =gUnknown_0203CD78 - ldr r1, [r1] - ldr r2, [sp, 0x3C] - adds r1, r2 - strb r0, [r1] - movs r0, 0x1E - ldr r3, [sp, 0x34] - ands r0, r3 - cmp r0, 0 - beq _08193334 - ldr r2, =gSprites - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldr r7, [sp, 0x3C] - adds r0, r7 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_08193334: - ldr r0, [sp, 0x2C] - cmp r0, 0 - beq _0819335A - ldr r2, =gSprites - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - ldr r1, [sp, 0x3C] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r2, [r0, 0x5] - movs r1, 0xF - ands r1, r2 - movs r2, 0x30 - orrs r1, r2 - strb r1, [r0, 0x5] -_0819335A: - ldr r2, [sp, 0x4C] - ldr r1, [r2, 0x4] - ldr r0, =0x000003ff - cmp r1, r0 - bne _08193388 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldrb r0, [r0, 0x8] - bl sub_806F000 - lsls r0, 16 - lsrs r0, 16 - b _081933B0 - .pool -_08193388: - ldr r0, =0x000003fe - cmp r1, r0 - bne _081933A4 - bl sub_8195910 - lsls r0, 24 - lsrs r0, 24 - ldr r2, [sp, 0x7C] - ldr r3, [sp, 0x78] - ldr r1, [sp, 0x74] - str r1, [sp] - b _081933B8 - .pool -_081933A4: - lsls r0, r1, 16 - lsrs r0, 16 - bl sub_8162AA0 - lsls r0, 24 - lsrs r0, 24 -_081933B0: - ldr r2, [sp, 0x7C] - ldr r3, [sp, 0x78] - ldr r7, [sp, 0x74] - str r7, [sp] -_081933B8: - ldr r1, =0x0000ffff - str r1, [sp, 0x4] - movs r1, 0x1 - bl sub_818D8AC - ldr r1, =gUnknown_0203CD78 - ldr r1, [r1] - add r1, r9 - strb r0, [r1] - movs r0, 0x1E - ldr r1, [sp, 0x34] - ands r0, r1 - cmp r0, 0 - beq _081933F0 - ldr r2, =gSprites - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - add r0, r9 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_081933F0: - ldr r2, [sp, 0x50] - ldr r0, [r2, 0x4] - cmp r0, 0 - beq _08193416 - ldr r2, =gSprites - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - add r0, r9 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r2, [r0, 0x5] - movs r1, 0xF - ands r1, r2 - movs r2, 0x30 - orrs r1, r2 - strb r1, [r0, 0x5] -_08193416: - movs r5, 0 - ldr r3, [sp, 0x38] - lsls r3, 2 - str r3, [sp, 0x70] - mov r8, r5 - ldr r6, =gUnknown_0203CD78 - ldr r7, =gSprites - ldr r4, [sp, 0x54] - mov r9, r5 - movs r0, 0x1 - mov r10, r0 -_0819342C: - ldr r1, [sp, 0x24] - ldr r0, =0x000003ff - cmp r1, r0 - bne _08193464 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r1, [sp, 0x1C] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 1 - add r0, r9 - ldr r1, =0x00000d64 - adds r2, r1 - adds r2, r0 - ldrh r0, [r2] - b _081934B0 - .pool -_08193464: - ldr r0, =0x000003fe - cmp r1, r0 - bne _08193490 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r1, [sp, 0x1C] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 1 - add r0, r9 - ldr r1, =0x00000d64 - adds r2, r1 - adds r2, r0 - ldrh r0, [r2] - b _081934B0 - .pool -_08193490: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r1, [sp, 0x1C] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 1 - add r0, r9 - ldr r1, =0x00000d64 - adds r2, r1 - adds r2, r0 - ldrh r1, [r2] - ldr r0, =gUnknown_0203BC8C - ldr r0, [r0] - lsls r1, 4 - adds r1, r0 - ldrh r0, [r1] -_081934B0: - ldr r1, =gUnknown_0860D3A8 - adds r1, r5, r1 - ldrb r2, [r1] - ldr r3, [sp, 0x40] - orrs r2, r3 - ldr r1, =gUnknown_0860D3AB - adds r1, r5, r1 - ldrb r3, [r1] - ldr r1, [sp, 0x44] - adds r3, r1 - mov r1, r8 - str r1, [sp] - str r1, [sp, 0x4] - mov r1, r10 - str r1, [sp, 0x8] - ldr r1, =sub_8190938 - bl sub_80D2CC4 - ldr r1, [r6] - adds r1, r4 - strb r0, [r1] - ldr r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrb r1, [r0, 0x5] - movs r3, 0xD - negs r3, r3 - adds r2, r3, 0 - ands r1, r2 - strb r1, [r0, 0x5] - movs r0, 0x1E - ldr r1, [sp, 0x34] - ands r0, r1 - cmp r0, 0 - beq _08193516 - ldr r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_08193516: - ldr r0, [sp, 0x2C] - cmp r0, 0 - beq _08193548 - ldr r0, [r6] - adds r0, r4 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r7 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - movs r2, 0x30 - orrs r0, r2 - strb r0, [r1, 0x5] - ldr r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - mov r2, r10 - strh r2, [r0, 0x34] -_08193548: - adds r4, 0x1 - movs r3, 0x2 - add r9, r3 - adds r5, 0x1 - cmp r5, 0x2 - bgt _08193556 - b _0819342C -_08193556: - movs r5, 0 - ldr r6, =gUnknown_0203CD78 - ldr r7, =gSprites - mov r8, r7 - ldr r4, [sp, 0x5C] - mov r9, r5 - movs r7, 0 -_08193564: - ldr r0, [sp, 0x4C] - ldr r1, [r0, 0x4] - ldr r0, =0x000003ff - cmp r1, r0 - bne _081935AC - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r3, [sp, 0x48] - ldr r1, [r3, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 1 - add r0, r9 - ldr r1, =0x00000d64 - adds r2, r1 - adds r2, r0 - ldrh r0, [r2] - b _081935FA - .pool -_081935AC: - ldr r0, =0x000003fe - cmp r1, r0 - bne _081935D8 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r0, [sp, 0x48] - ldr r1, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 1 - add r0, r9 - ldr r1, =0x00000d64 - adds r2, r1 - adds r2, r0 - ldrh r0, [r2] - b _081935FA - .pool -_081935D8: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r0, [sp, 0x48] - ldr r1, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 1 - add r0, r9 - ldr r1, =0x00000d64 - adds r2, r1 - adds r2, r0 - ldrh r1, [r2] - ldr r0, =gUnknown_0203BC8C - ldr r0, [r0] - lsls r1, 4 - adds r1, r0 - ldrh r0, [r1] -_081935FA: - ldr r1, =gUnknown_0860D3AE - adds r1, r5, r1 - ldrb r2, [r1] - ldr r3, [sp, 0x40] - orrs r2, r3 - ldr r1, =gUnknown_0860D3B1 - adds r1, r5, r1 - ldrb r3, [r1] - ldr r1, [sp, 0x44] - adds r3, r1 - str r7, [sp] - str r7, [sp, 0x4] - movs r1, 0x1 - str r1, [sp, 0x8] - ldr r1, =sub_8190938 - bl sub_80D2CC4 - ldr r1, [r6] - adds r1, r4 - strb r0, [r1] - ldr r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - ldrb r1, [r0, 0x5] - movs r3, 0xD - negs r3, r3 - adds r2, r3, 0 - ands r1, r2 - strb r1, [r0, 0x5] - movs r0, 0x1E - ldr r1, [sp, 0x34] - ands r0, r1 - cmp r0, 0 - beq _0819365E - ldr r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_0819365E: - ldr r2, [sp, 0x50] - ldr r0, [r2, 0x4] - cmp r0, 0 - beq _08193692 - ldr r0, [r6] - adds r0, r4 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r8 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - movs r2, 0x30 - orrs r0, r2 - strb r0, [r1, 0x5] - ldr r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - movs r1, 0x1 - strh r1, [r0, 0x34] -_08193692: - adds r4, 0x1 - movs r3, 0x2 - add r9, r3 - adds r5, 0x1 - cmp r5, 0x2 - bgt _081936A0 - b _08193564 -_081936A0: - add r0, sp, 0xC - movs r5, 0 - strb r5, [r0, 0x6] - adds r1, r0, 0 - movs r0, 0x2 - strb r0, [r1, 0x7] - adds r0, r1, 0 - ldrb r0, [r0, 0x6] - strb r0, [r1, 0x8] - adds r0, r1, 0 - ldrb r0, [r0, 0x7] - strb r0, [r1, 0x9] - adds r0, r1, 0 - strb r5, [r0, 0xA] - strb r5, [r0, 0xB] - adds r3, r0, 0 - ldrb r2, [r3, 0xC] - movs r1, 0x10 - negs r1, r1 - adds r0, r1, 0 - ands r0, r2 - strb r0, [r3, 0xC] - adds r2, r3, 0 - movs r0, 0xE0 - strb r0, [r2, 0xC] - ldrb r0, [r2, 0xD] - ands r1, r0 - strb r1, [r2, 0xD] - adds r1, r2, 0 - movs r0, 0xD0 - strb r0, [r1, 0xD] - ldr r4, =gStringVar4 - ldr r0, =gUnknown_0860D38C - ldr r7, [sp, 0x70] - adds r0, r7, r0 - ldr r1, [r0] - adds r0, r4, 0 - bl StringExpandPlaceholders - str r4, [sp, 0xC] - add r0, sp, 0xC - add r1, sp, 0x6C - ldrb r1, [r1] - strb r1, [r0, 0x4] - adds r1, r0, 0 - movs r0, 0x1 - strb r0, [r1, 0x5] - ldr r4, [sp, 0x6C] - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - add r0, sp, 0xC - strb r5, [r0, 0x8] - adds r1, r0, 0 - strb r5, [r0, 0x7] - strb r5, [r1, 0x9] - movs r1, 0 - movs r2, 0 - bl AddTextPrinter - ldr r1, [sp, 0x24] - ldr r0, =0x000003ff - cmp r1, r0 - bne _0819375C - ldr r0, =gStringVar1 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - bl StringCopy - b _0819377E - .pool -_0819375C: - ldr r0, =0x000003fe - cmp r1, r0 - bne _08193774 - ldr r0, =gStringVar1 - bl sub_8195938 - b _0819377E - .pool -_08193774: - ldr r0, =gStringVar1 - lsls r1, 16 - lsrs r1, 16 - bl sub_8195898 -_0819377E: - add r0, sp, 0xC - movs r4, 0x2 - strb r4, [r0, 0x5] - strb r4, [r0, 0xA] - ldr r5, =gStringVar1 - str r5, [sp, 0xC] - add r2, sp, 0x64 - ldrb r2, [r2] - strb r2, [r0, 0x4] - ldrb r0, [r0, 0x5] - ldr r1, [sp, 0xC] - add r2, sp, 0xC - ldrb r3, [r2, 0xA] - movs r2, 0x40 - bl GetStringCenterAlignXOffsetWithLetterSpacing - add r1, sp, 0xC - strb r0, [r1, 0x8] - adds r0, r1, 0 - strb r4, [r0, 0x7] - strb r4, [r1, 0x9] - ldr r4, [sp, 0x64] - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - add r0, sp, 0xC - movs r1, 0 - movs r2, 0 - bl AddTextPrinter - ldr r3, [sp, 0x4C] - ldr r1, [r3, 0x4] - ldr r0, =0x000003ff - cmp r1, r0 - bne _081937E4 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - adds r0, r5, 0 - bl StringCopy - b _08193802 - .pool -_081937E4: - ldr r0, =0x000003fe - cmp r1, r0 - bne _081937F8 - adds r0, r5, 0 - bl sub_8195938 - b _08193802 - .pool -_081937F8: - lsls r1, 16 - lsrs r1, 16 - adds r0, r5, 0 - bl sub_8195898 -_08193802: - ldr r0, =gStringVar1 - str r0, [sp, 0xC] - add r0, sp, 0xC - movs r6, 0 - add r7, sp, 0x68 - ldrb r7, [r7] - strb r7, [r0, 0x4] - ldrb r0, [r0, 0x5] - ldr r1, [sp, 0xC] - add r2, sp, 0xC - ldrb r3, [r2, 0xA] - movs r2, 0x40 - bl GetStringCenterAlignXOffsetWithLetterSpacing - add r1, sp, 0xC - strb r0, [r1, 0x8] - adds r0, r1, 0 - movs r5, 0x2 - strb r5, [r0, 0x7] - strb r5, [r1, 0x9] - ldr r4, [sp, 0x68] - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - add r0, sp, 0xC - movs r1, 0 - movs r2, 0 - bl AddTextPrinter - add r0, sp, 0xC - strb r6, [r0, 0xA] - ldr r0, =gUnknown_0860D350 - ldr r1, [sp, 0x58] - adds r0, r1, r0 - ldr r0, [r0] - str r0, [sp, 0xC] - add r0, sp, 0xC - add r2, sp, 0x60 - ldrb r2, [r2] - strb r2, [r0, 0x4] - ldrb r0, [r0, 0x5] - ldr r1, [sp, 0xC] - add r2, sp, 0xC - ldrb r3, [r2, 0xA] - movs r2, 0xA0 - bl GetStringCenterAlignXOffsetWithLetterSpacing - add r1, sp, 0xC - strb r0, [r1, 0x8] - adds r0, r1, 0 - strb r5, [r0, 0x7] - strb r5, [r1, 0x9] - ldr r4, [sp, 0x60] - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - add r0, sp, 0xC - movs r1, 0 - movs r2, 0 - bl AddTextPrinter - add sp, 0x80 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819314C - - thumb_func_start sub_81938A4 -sub_81938A4: @ 81938A4 - push {lr} - ldr r0, =sub_8194220 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r2, 0 - strh r2, [r1, 0x8] - strh r2, [r1, 0xA] - movs r0, 0x2 - strh r0, [r1, 0xC] - strh r2, [r1, 0x10] - ldr r0, =sub_8194B54 - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81938A4 - - thumb_func_start sub_81938E0 -sub_81938E0: @ 81938E0 - push {r4,lr} - bl sub_8194D48 - ldr r4, =gSaveBlock2Ptr - ldr r2, [r4] - ldr r1, =0x00000d0a - adds r0, r2, r1 - ldrb r1, [r0] - subs r1, 0x1 - ldr r0, =0x00000ca9 - adds r2, r0 - movs r0, 0x3 - ands r1, r0 - ldrb r3, [r2] - movs r0, 0x4 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - ldr r0, [r4] - ldr r1, =0x00000cb2 - adds r0, r1 - movs r4, 0 - movs r1, 0x3 - strh r1, [r0] - ldr r0, =sub_8194220 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0x8] - strh r4, [r1, 0xA] - movs r0, 0x2 - strh r0, [r1, 0xC] - movs r0, 0x1 - strh r0, [r1, 0x10] - ldr r0, =sub_8194B54 - bl SetMainCallback2 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81938E0 - - thumb_func_start sub_819395C -sub_819395C: @ 819395C - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r2, 0xA - ldrsh r7, [r0, r2] - movs r2, 0x8 - ldrsh r0, [r0, r2] - adds r2, r1, 0 - cmp r0, 0x7 - bls _0819397E - b _08193BC2 -_0819397E: - lsls r0, 2 - ldr r1, =_08193990 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08193990: - .4byte _081939B0 - .4byte _08193A00 - .4byte _08193A20 - .4byte _08193AA8 - .4byte _08193BC2 - .4byte _08193B20 - .4byte _08193BC2 - .4byte _08193B84 -_081939B0: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _081939C2 - b _08193BC2 -_081939C2: - movs r0, 0x1 - negs r0, r0 - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0x1 - strh r1, [r0, 0x8] - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - movs r1, 0x1 - bl StartSpriteAnim - b _08193BC2 - .pool -_08193A00: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08193A0E - b _08193BC2 -_08193A0E: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r2 - movs r1, 0x2 - strh r1, [r0, 0x8] - b _08193BC2 - .pool -_08193A20: - adds r0, r5, 0 - bl sub_8193BDC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08193A30 - b _08193BC2 -_08193A30: - cmp r0, 0x1 - ble _08193A3C - cmp r0, 0x2 - beq _08193A60 - cmp r0, 0x3 - beq _08193A84 -_08193A3C: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0x7 - strh r1, [r0, 0x8] - b _08193BC2 - .pool -_08193A60: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0x3 - strh r1, [r0, 0x8] - b _08193BC2 - .pool -_08193A84: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0x5 - strh r1, [r0, 0x8] - b _08193BC2 - .pool -_08193AA8: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - beq _08193ABA - b _08193BC2 -_08193ABA: - bl FreeAllWindowBuffers - bl remove_some_task - ldr r4, =gUnknown_0203CD7C - ldr r0, [r4] - bl Free - str r6, [r4] - ldr r0, =sub_8190400 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r3, r0, 24 - ldr r2, =gTasks - lsls r1, r3, 2 - adds r1, r3 - lsls r1, 3 - adds r1, r2 - movs r3, 0 - strh r6, [r1, 0x8] - ldr r0, =gUnknown_0860D080 - adds r0, r7, r0 - ldrb r0, [r0] - strh r0, [r1, 0xA] - movs r0, 0x1 - strh r0, [r1, 0xC] - strh r5, [r1, 0xE] - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r2 - movs r1, 0x4 - strh r1, [r0, 0x8] - ldr r0, =gUnknown_0203CD78 - ldr r0, [r0] - strb r3, [r0, 0x10] - b _08193BC2 - .pool -_08193B20: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - bne _08193BC2 - bl FreeAllWindowBuffers - bl remove_some_task - ldr r4, =gUnknown_0203CD7C - ldr r0, [r4] - bl Free - str r6, [r4] - ldr r0, =sub_8190400 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r3, r0, 24 - ldr r2, =gTasks - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 3 - adds r0, r2 - strh r6, [r0, 0x8] - adds r1, r7, 0 - subs r1, 0x10 - strh r1, [r0, 0xA] - movs r1, 0x2 - strh r1, [r0, 0xC] - strh r5, [r0, 0xE] - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r2 - movs r1, 0x6 - strh r1, [r0, 0x8] - b _08193BC2 - .pool -_08193B84: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - bne _08193BC2 - bl FreeAllWindowBuffers - bl remove_some_task - ldr r4, =gUnknown_0203CD7C - ldr r0, [r4] - bl Free - str r6, [r4] - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl SetMainCallback2 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldrb r0, [r0, 0x16] - bl DestroyTask - adds r0, r5, 0 - bl DestroyTask -_08193BC2: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819395C - - thumb_func_start sub_8193BDC -sub_8193BDC: @ 8193BDC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r7, r0, 24 - movs r0, 0x1 - mov r9, r0 - movs r1, 0x4 - mov r8, r1 - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - movs r1, 0xA - ldrsh r5, [r0, r1] - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r6, [r0] - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - adds r2, r1, 0 - adds r3, r0, 0 - cmp r2, 0x2 - beq _08193C20 - mov r0, r9 - ands r0, r1 - cmp r0, 0 - beq _08193C58 - cmp r5, 0x1F - bne _08193C3C -_08193C20: - movs r0, 0x5 - bl PlaySE - movs r0, 0 - mov r9, r0 - b _08193CDE - .pool -_08193C3C: - cmp r5, 0xF - bgt _08193C4C - movs r0, 0x5 - bl PlaySE - movs r1, 0x2 - mov r9, r1 - b _08193CDE -_08193C4C: - movs r0, 0x5 - bl PlaySE - movs r0, 0x3 - mov r9, r0 - b _08193CDE -_08193C58: - cmp r2, 0x40 - bne _08193C78 - ldr r0, =gUnknown_0860CBF1 - lsls r1, r5, 2 - adds r1, r5 - adds r1, r6 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0xFF - beq _08193C78 - movs r1, 0 - mov r8, r1 - b _08193CDE - .pool -_08193C78: - ldrh r0, [r3, 0x2E] - cmp r0, 0x80 - bne _08193C9C - ldr r0, =gUnknown_0860CBF1 - lsls r1, r5, 2 - adds r1, r5 - adds r1, r6 - lsls r1, 2 - adds r0, 0x1 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0xFF - beq _08193C9C - movs r0, 0x1 - b _08193CDC - .pool -_08193C9C: - ldrh r0, [r3, 0x2E] - cmp r0, 0x20 - bne _08193CC0 - ldr r0, =gUnknown_0860CBF1 - lsls r1, r5, 2 - adds r1, r5 - adds r1, r6 - lsls r1, 2 - adds r0, 0x2 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0xFF - beq _08193CC0 - movs r1, 0x2 - mov r8, r1 - b _08193CDE - .pool -_08193CC0: - ldrh r0, [r3, 0x2E] - cmp r0, 0x10 - bne _08193CDE - ldr r0, =gUnknown_0860CBF1 - lsls r1, r5, 2 - adds r1, r5 - adds r1, r6 - lsls r1, 2 - adds r0, 0x3 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0xFF - beq _08193CDE - movs r0, 0x3 -_08193CDC: - mov r8, r0 -_08193CDE: - mov r1, r8 - cmp r1, 0x4 - beq _08193D26 - movs r0, 0x5 - bl PlaySE - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - ldr r4, =gSprites - adds r0, r4 - movs r1, 0 - bl StartSpriteAnim - ldr r2, =gUnknown_0860CBF1 - lsls r1, r6, 2 - add r1, r8 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 2 - adds r1, r0 - adds r1, r2 - ldrb r5, [r1] - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - adds r0, r4 - movs r1, 0x1 - bl StartSpriteAnim - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - strh r5, [r0, 0xA] -_08193D26: - mov r0, r9 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8193BDC - - thumb_func_start sub_8193D40 -sub_8193D40: @ 8193D40 - push {lr} - ldr r0, =sub_8194220 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r2, 0 - strh r2, [r1, 0x8] - movs r0, 0x1 - strh r0, [r1, 0xA] - movs r0, 0x2 - strh r0, [r1, 0xC] - strh r2, [r1, 0x10] - ldr r0, =sub_8194B54 - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8193D40 - - thumb_func_start sub_8193D7C -sub_8193D7C: @ 8193D7C - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r7, =gSpecialVar_0x8005 - ldrh r0, [r7] - cmp r0, 0x1 - bne _08193E10 - ldr r5, =gUnknown_02038BCA - ldrh r0, [r5] - bl sub_8195358 - ldr r4, =gSaveBlock2Ptr - ldr r2, [r4] - lsls r0, 2 - adds r2, r0 - ldr r6, =0x00000d25 - adds r2, r6 - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldrh r0, [r5] - bl sub_8195358 - ldr r1, [r4] - lsls r0, 2 - adds r0, r1, r0 - ldr r2, =0x00000cb2 - mov r8, r2 - add r1, r8 - adds r0, r6 - movs r3, 0x3 - ldrb r2, [r1] - ands r2, r3 - lsls r2, 3 - ldrb r3, [r0] - movs r1, 0x19 - negs r1, r1 - ands r1, r3 - orrs r1, r2 - strb r1, [r0] - ldrh r0, [r5] - bl sub_8195358 - ldr r2, [r4] - lsls r0, 1 - movs r3, 0xEC - lsls r3, 4 - adds r1, r2, r3 - adds r1, r0 - ldr r0, =gUnknown_03005D10 - ldrh r0, [r0, 0x22] - strh r0, [r1] - add r2, r8 - ldrh r0, [r2] - cmp r0, 0x2 - bhi _08193EAE - lsls r0, 24 - lsrs r0, 24 - bl sub_8195438 - b _08193EAE - .pool -_08193E10: - ldr r5, =0x000003ff - adds r0, r5, 0 - bl sub_8195358 - ldr r4, =gSaveBlock2Ptr - ldr r2, [r4] - lsls r0, 2 - adds r2, r0 - ldr r6, =0x00000d25 - adds r2, r6 - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - adds r0, r5, 0 - bl sub_8195358 - ldr r1, [r4] - lsls r0, 2 - adds r0, r1, r0 - ldr r2, =0x00000cb2 - adds r1, r2 - adds r0, r6 - movs r3, 0x3 - ldrb r2, [r1] - ands r2, r3 - lsls r2, 3 - ldrb r3, [r0] - movs r1, 0x19 - negs r1, r1 - ands r1, r3 - orrs r1, r2 - strb r1, [r0] - adds r0, r5, 0 - bl sub_8195358 - ldr r1, [r4] - lsls r0, 1 - movs r3, 0xEC - lsls r3, 4 - adds r1, r3 - adds r1, r0 - ldr r0, =gUnknown_03005D10 - ldrh r0, [r0, 0x24] - strh r0, [r1] - ldr r0, =gBattleOutcome - ldrb r0, [r0] - cmp r0, 0x9 - beq _08193E78 - ldrh r0, [r7] - cmp r0, 0x9 - bne _08193E92 -_08193E78: - adds r0, r5, 0 - bl sub_8195358 - ldr r2, [r4] - lsls r0, 2 - adds r2, r0 - adds r2, r6 - ldrb r1, [r2] - movs r0, 0x1F - ands r0, r1 - movs r1, 0x20 - orrs r0, r1 - strb r0, [r2] -_08193E92: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r4, [r0] - cmp r4, 0x3 - bgt _08193EAE -_08193EA0: - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_8195438 - adds r4, 0x1 - cmp r4, 0x3 - ble _08193EA0 -_08193EAE: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8193D7C - - thumb_func_start sub_8193ED0 -sub_8193ED0: @ 8193ED0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x84 - str r0, [sp, 0x48] - str r1, [sp, 0x4C] - lsls r4, r2, 24 - lsrs r4, 24 - movs r0, 0 - str r0, [sp, 0x54] - movs r1, 0 - str r1, [sp, 0x58] - bl sub_8165C40 - movs r2, 0 - str r2, [sp, 0x50] - add r3, sp, 0x30 - mov r10, r3 - ldr r5, [sp, 0x4C] - lsls r5, 1 - str r5, [sp, 0x70] - subs r4, 0x1 - str r4, [sp, 0x78] -_08193F02: - movs r0, 0 - mov r9, r0 - ldr r1, [sp, 0x50] - lsls r1, 2 - str r1, [sp, 0x74] - ldr r2, [sp, 0x48] - lsls r2, 2 - str r2, [sp, 0x6C] - ldr r3, [sp, 0x50] - adds r3, 0x1 - str r3, [sp, 0x60] -_08193F18: - ldr r4, [sp, 0x74] - add r4, r9 - lsls r0, r4, 2 - mov r5, sp - adds r1, r5, r0 - movs r0, 0 - str r0, [r1] - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r1, [sp, 0x6C] - adds r0, r3, r1 - ldr r2, =0x00000d24 - adds r0, r2 - ldrh r0, [r0] - lsls r0, 22 - ldr r1, =0xff800000 - cmp r0, r1 - bne _08193F60 - ldr r3, [sp, 0x50] - lsls r0, r3, 24 - mov r5, r9 - lsls r1, r5, 24 - lsrs r1, 24 - lsrs r0, 24 - bl sub_81A5060 - lsls r1, r4, 1 - add r1, r10 - strh r0, [r1] - b _08193F8C - .pool -_08193F60: - lsls r2, r4, 1 - add r2, r10 - ldr r1, [sp, 0x48] - lsls r0, r1, 1 - adds r0, r1 - ldr r4, [sp, 0x50] - adds r0, r4 - lsls r0, 1 - ldr r5, =0x00000d64 - adds r1, r3, r5 - adds r1, r0 - ldrh r0, [r1] - ldr r1, =gUnknown_0203BC8C - ldr r1, [r1] - lsls r0, 4 - adds r0, r1 - mov r3, r9 - lsls r1, r3, 1 - adds r0, 0x2 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r2] -_08193F8C: - ldr r0, =gBattleMoves - ldr r1, [sp, 0x74] - add r1, r9 - lsls r1, 1 - add r1, r10 - ldrh r2, [r1] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r6, [r1, 0x1] - cmp r6, 0 - bne _08193FB8 - movs r6, 0x28 - b _08193FD0 - .pool -_08193FB8: - cmp r6, 0x1 - bne _08193FC0 - movs r6, 0x3C - b _08193FD0 -_08193FC0: - adds r1, r2, 0 - cmp r1, 0x78 - beq _08193FCA - cmp r1, 0x99 - bne _08193FD0 -_08193FCA: - lsrs r0, r6, 31 - adds r0, r6, r0 - asrs r6, r0, 1 -_08193FD0: - movs r1, 0 - mov r4, r9 - adds r4, 0x1 - str r4, [sp, 0x64] - ldr r5, [sp, 0x70] - ldr r2, [sp, 0x4C] - adds r0, r5, r2 - lsls r0, 1 - str r0, [sp, 0x5C] -_08193FE2: - lsls r7, r1, 1 - adds r1, 0x1 - str r1, [sp, 0x68] - ldr r3, [sp, 0x5C] - adds r3, r7 - mov r8, r3 -_08193FEE: - bl Random - adds r4, r0, 0 - bl Random - lsls r4, 16 - lsrs r5, r4, 16 - lsls r0, 16 - orrs r5, r0 - ldr r2, =gSaveBlock2Ptr - ldr r0, [r2] - ldr r4, =0x00000d64 - adds r0, r4 - add r0, r8 - ldrh r4, [r0] - ldr r3, =gUnknown_0203BC8C - ldr r0, [r3] - lsls r4, 4 - adds r4, r0 - adds r0, r5, 0 - str r2, [sp, 0x7C] - str r3, [sp, 0x80] - bl GetNatureFromPersonality - ldrb r1, [r4, 0xC] - lsls r0, 24 - lsrs r0, 24 - ldr r2, [sp, 0x7C] - ldr r3, [sp, 0x80] - cmp r1, r0 - bne _08193FEE - ldr r0, [r2] - ldr r2, [sp, 0x5C] - adds r1, r7, r2 - ldr r4, =0x00000d64 - adds r0, r4 - adds r0, r1 - ldrh r0, [r0] - ldr r1, [r3] - lsls r0, 4 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x1 - ands r5, r0 - cmp r5, 0 - beq _08194068 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - ldr r5, =gBaseStats - adds r0, r5 - ldrb r2, [r0, 0x17] - b _08194074 - .pool -_08194068: - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - ldr r2, =gBaseStats - adds r0, r2 - ldrb r2, [r0, 0x16] -_08194074: - ldr r4, [sp, 0x74] - add r4, r9 - lsls r0, r4, 1 - add r0, r10 - ldrh r0, [r0] - bl ai_rate_move - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0x6 - ands r0, r5 - cmp r0, 0x6 - bne _0819409C - lsls r0, r4, 2 - mov r3, sp - adds r1, r3, r0 - b _081940D8 - .pool -_0819409C: - movs r0, 0x29 - ands r0, r5 - cmp r0, 0 - bne _081940DE - movs r0, 0x2 - ands r0, r5 - cmp r0, 0 - beq _081940B6 - lsls r0, r4, 2 - mov r5, sp - adds r2, r5, r0 - lsls r1, r6, 1 - b _081940CA -_081940B6: - movs r0, 0x4 - ands r5, r0 - cmp r5, 0 - beq _081940D2 - lsls r0, r4, 2 - mov r1, sp - adds r2, r1, r0 - lsrs r1, r6, 31 - adds r1, r6, r1 - asrs r1, 1 -_081940CA: - ldr r0, [r2] - adds r0, r1 - str r0, [r2] - b _081940DE -_081940D2: - lsls r0, r4, 2 - mov r2, sp - adds r1, r2, r0 -_081940D8: - ldr r0, [r1] - adds r0, r6 - str r0, [r1] -_081940DE: - ldr r1, [sp, 0x68] - cmp r1, 0x2 - bgt _081940E6 - b _08193FE2 -_081940E6: - ldr r2, [sp, 0x74] - add r2, r9 - lsls r0, r2, 2 - add r0, sp - ldr r1, [r0] - ldr r3, [sp, 0x54] - cmp r3, r1 - bge _08194104 - lsls r0, r2, 16 - lsrs r0, 16 - str r0, [sp, 0x58] - lsls r0, r1, 16 - lsrs r0, 16 - str r0, [sp, 0x54] - b _08194122 -_08194104: - ldr r4, [sp, 0x54] - cmp r4, r1 - bne _08194122 - ldr r5, [sp, 0x58] - lsls r0, r5, 1 - add r0, r10 - lsls r1, r2, 1 - add r1, r10 - ldrh r0, [r0] - ldrh r1, [r1] - cmp r0, r1 - bcs _08194122 - lsls r0, r2, 16 - lsrs r0, 16 - str r0, [sp, 0x58] -_08194122: - ldr r0, [sp, 0x64] - mov r9, r0 - cmp r0, 0x3 - bgt _0819412C - b _08193F18 -_0819412C: - ldr r1, [sp, 0x60] - str r1, [sp, 0x50] - cmp r1, 0x2 - bgt _08194136 - b _08193F02 -_08194136: - ldr r2, [sp, 0x58] - mov r9, r2 - b _08194182 -_0819413C: - movs r3, 0 - mov r9, r3 - movs r1, 0 - mov r4, r10 - mov r3, r10 - mov r2, sp -_08194148: - ldr r0, [r2] - ldr r5, [sp, 0x54] - cmp r5, r0 - bge _0819415A - mov r9, r1 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x54] - b _08194170 -_0819415A: - ldr r5, [sp, 0x54] - cmp r5, r0 - bne _08194170 - mov r5, r9 - lsls r0, r5, 1 - adds r0, r4, r0 - ldrh r0, [r0] - ldrh r5, [r3] - cmp r0, r5 - bcs _08194170 - mov r9, r1 -_08194170: - adds r3, 0x2 - adds r2, 0x4 - adds r1, 0x1 - cmp r1, 0xB - ble _08194148 - ldr r0, [sp, 0x50] - ldr r1, [sp, 0x78] - cmp r0, r1 - beq _081941F4 -_08194182: - movs r2, 0 - str r2, [sp, 0x50] - mov r3, r9 - lsls r7, r3, 2 - ldr r4, [sp, 0x78] - cmp r2, r4 - bge _081941CA - lsls r0, r3, 1 - mov r5, r10 - adds r6, r5, r0 - ldr r0, [sp, 0x48] - lsls r5, r0, 24 -_0819419A: - ldr r0, =gSaveBlock2Ptr - ldr r4, [r0] - ldr r2, [sp, 0x50] - lsls r1, r2, 24 - lsrs r1, 24 - lsrs r0, r5, 24 - bl sub_81953E8 - lsls r0, 24 - lsrs r0, 23 - movs r3, 0xEC - lsls r3, 4 - adds r4, r3 - adds r4, r0 - ldrh r0, [r4] - ldrh r4, [r6] - cmp r0, r4 - beq _081941CA - ldr r0, [sp, 0x50] - adds r0, 0x1 - str r0, [sp, 0x50] - ldr r1, [sp, 0x78] - cmp r0, r1 - blt _0819419A -_081941CA: - ldr r2, [sp, 0x50] - ldr r3, [sp, 0x78] - cmp r2, r3 - beq _081941F4 - mov r4, sp - adds r1, r4, r7 - movs r0, 0 - str r0, [r1] - movs r5, 0 - str r5, [sp, 0x54] - mov r9, r5 - mov r2, sp - movs r1, 0xB -_081941E4: - ldm r2!, {r0} - add r9, r0 - subs r1, 0x1 - cmp r1, 0 - bge _081941E4 - mov r0, r9 - cmp r0, 0 - bne _0819413C -_081941F4: - mov r1, r9 - lsls r0, r1, 2 - add r0, sp - ldr r0, [r0] - cmp r0, 0 - bne _08194204 - ldr r2, [sp, 0x58] - mov r9, r2 -_08194204: - mov r3, r9 - lsls r0, r3, 1 - add r0, r10 - ldrh r0, [r0] - add sp, 0x84 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8193ED0 - - thumb_func_start sub_8194220 -sub_8194220: @ 8194220 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x28 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r1, =gTasks - lsls r0, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r2, 0xA - ldrsh r1, [r0, r2] - mov r10, r1 - movs r3, 0xC - ldrsh r4, [r0, r3] - movs r1, 0x8 - ldrsh r0, [r0, r1] - cmp r0, 0x5 - bls _08194250 - b _081948C2 -_08194250: - lsls r0, 2 - ldr r1, =_08194264 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08194264: - .4byte _0819427C - .4byte _0819431C - .4byte _0819438C - .4byte _0819447C - .4byte _081944FC - .4byte _081947C8 -_0819427C: - movs r0, 0 - bl SetHBlankCallback - movs r0, 0 - bl SetVBlankCallback - movs r0, 0x3 - bl EnableInterrupts - movs r4, 0 - str r4, [sp, 0x14] - add r0, sp, 0x14 - movs r1, 0xC0 - lsls r1, 19 - ldr r2, =0x05006000 - bl CpuSet - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_0860CE74 - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - ldr r0, =gUnknown_0860CE94 - bl InitWindows - bl DeactivateAllTextPrinters - ldr r0, =gUnknown_02022E14 - strh r4, [r0] - ldr r0, =gUnknown_02022E16 - strh r4, [r0] - ldr r0, =gUnknown_02022E18 - strh r4, [r0] - ldr r0, =gUnknown_02022E1A - strh r4, [r0] - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r1, 0xB0 - lsls r1, 4 - movs r0, 0x3 - movs r2, 0 - bl ChangeBgY - ldr r1, =gTasks - mov r2, r8 - lsls r0, r2, 2 - b _0819443C - .pool -_0819431C: - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - movs r0, 0x4C - movs r1, 0 - bl SetGpuReg - ldr r1, =0x00005860 - movs r0, 0x40 - bl SetGpuReg - movs r0, 0x44 - movs r1, 0x9F - bl SetGpuReg - ldr r1, =0x00009098 - movs r0, 0x42 - bl SetGpuReg - movs r0, 0x46 - movs r1, 0x9F - bl SetGpuReg - movs r0, 0x48 - movs r1, 0 - bl SetGpuReg - movs r0, 0x4A - movs r1, 0x3F - bl SetGpuReg - bl ResetPaletteFade - bl ResetSpriteData - bl FreeAllSpritePalettes - ldr r1, =gTasks - mov r3, r8 - lsls r0, r3, 2 - b _0819443C - .pool -_0819438C: - ldr r4, =gUnknown_0203CD7C - movs r0, 0x80 - lsls r0, 4 - bl AllocZeroed - adds r1, r0, 0 - str r1, [r4] - ldr r0, =gUnknown_08D83900 - bl LZDecompressWram - ldr r1, [r4] - movs r0, 0x1 - bl SetBgTilemapBuffer - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - ldr r1, =gUnknown_08D82F10 - movs r5, 0x80 - lsls r5, 6 - movs r6, 0 - str r6, [sp] - movs r0, 0x1 - adds r2, r5, 0 - movs r3, 0 - bl copy_decompressed_tile_data_to_vram_autofree - ldr r1, =gUnknown_08D834FC - str r6, [sp] - movs r0, 0x2 - adds r2, r5, 0 - movs r3, 0 - bl copy_decompressed_tile_data_to_vram_autofree - ldr r1, =gUnknown_08D83B2C - movs r4, 0x1 - str r4, [sp] - movs r0, 0x2 - adds r2, r5, 0 - movs r3, 0 - bl copy_decompressed_tile_data_to_vram_autofree - ldr r1, =gUnknown_08D83C3C - str r4, [sp] - movs r0, 0x3 - adds r2, r5, 0 - movs r3, 0 - bl copy_decompressed_tile_data_to_vram_autofree - ldr r0, =gUnknown_08D85358 - movs r4, 0x80 - lsls r4, 2 - movs r1, 0 - adds r2, r4, 0 - bl LoadCompressedPalette - ldr r0, =gUnknown_08D85444 - movs r1, 0x80 - lsls r1, 1 - adds r2, r4, 0 - bl LoadCompressedPalette - ldr r0, =gUnknown_08D85600 - movs r1, 0xF0 - movs r2, 0x20 - bl LoadCompressedPalette - str r6, [sp, 0x18] - add r0, sp, 0x18 - ldr r1, =gPlttBufferFaded - ldr r2, =0x05000100 - bl CpuSet - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - ldr r1, =gTasks - mov r4, r8 - lsls r0, r4, 2 -_0819443C: - add r0, r8 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x8] - adds r1, 0x1 - strh r1, [r0, 0x8] - b _081948C2 - .pool -_0819447C: - ldr r0, =gUnknown_0860CF50 - bl LoadCompressedObjectPic - mov r0, r8 - lsls r0, 2 - str r0, [sp, 0x1C] - mov r1, r10 - cmp r1, 0 - bne _081944E8 - movs r5, 0 - ldr r4, =gUnknown_0860D411 -_08194492: - ldrb r1, [r4] - ldrb r2, [r4, 0x1] - ldr r0, =gUnknown_0860CFA8 - movs r3, 0 - bl CreateSprite - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x1E - bls _08194492 - ldr r0, =gTasks - ldr r1, [sp, 0x1C] - add r1, r8 - lsls r1, 3 - adds r1, r0 - movs r2, 0x10 - ldrsh r0, [r1, r2] - cmp r0, 0 - beq _081944DC - ldr r0, =gUnknown_0860D008 - movs r1, 0xDA - movs r2, 0xC - movs r3, 0 - bl CreateSprite - b _081944E8 - .pool -_081944DC: - ldr r0, =gUnknown_0860CFD8 - movs r1, 0xDA - movs r2, 0xC - movs r3, 0 - bl CreateSprite -_081944E8: - ldr r1, =0x00007f40 - movs r0, 0 - bl SetGpuReg - b _081947A6 - .pool -_081944FC: - add r0, sp, 0x4 - movs r2, 0 - movs r1, 0x2 - strb r1, [r0, 0x5] - ldr r0, =gUnknown_085CCCEE - str r0, [sp, 0x4] - add r0, sp, 0x4 - strb r1, [r0, 0x4] - strb r2, [r0, 0x6] - strb r2, [r0, 0x7] - strb r1, [r0, 0xA] - strb r2, [r0, 0xB] - ldrb r0, [r0, 0x5] - ldr r1, [sp, 0x4] - add r2, sp, 0x4 - ldrb r3, [r2, 0xA] - movs r2, 0x70 - bl GetStringCenterAlignXOffsetWithLetterSpacing - add r1, sp, 0x4 - strb r0, [r1, 0x8] - movs r0, 0x1 - strb r0, [r1, 0x9] - adds r3, r1, 0 - ldrb r2, [r3, 0xC] - movs r1, 0x10 - negs r1, r1 - adds r0, r1, 0 - ands r0, r2 - strb r0, [r3, 0xC] - adds r2, r3, 0 - movs r0, 0xE0 - strb r0, [r2, 0xC] - ldrb r0, [r2, 0xD] - ands r1, r0 - strb r1, [r2, 0xD] - adds r1, r2, 0 - movs r0, 0xD0 - strb r0, [r1, 0xD] - adds r0, r1, 0 - movs r1, 0 - movs r2, 0 - bl AddTextPrinter - mov r3, r8 - lsls r3, 2 - str r3, [sp, 0x1C] - add r4, sp, 0x4 - movs r0, 0xF - mov r9, r0 - movs r1, 0 - str r1, [sp, 0x20] - movs r2, 0 - str r2, [sp, 0x24] - movs r7, 0 - movs r5, 0xF -_0819456C: - ldr r3, =gSaveBlock2Ptr - ldr r0, [r3] - adds r0, r7 - ldr r1, =0x00000d24 - adds r0, r1 - ldrh r1, [r0] - lsls r1, 22 - lsrs r1, 22 - ldr r0, =gUnknown_02022E2C - bl sub_8195898 - mov r2, r10 - cmp r2, 0x1 - bne _081945C4 - ldr r3, =gSaveBlock2Ptr - ldr r2, [r3] - adds r0, r2, r7 - ldr r1, =0x00000d25 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 29 - cmp r0, 0 - blt _081945DC - ldr r3, =0x00000cb2 - adds r0, r2, r3 - ldrh r1, [r0] - cmp r1, 0x1 - beq _08194634 - ldr r2, [sp, 0x24] - lsrs r0, r2, 24 - subs r1, 0x2 - b _081945EA - .pool -_081945C4: - mov r3, r10 - cmp r3, 0 - bne _08194634 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - adds r0, r2, r7 - ldr r1, =0x00000d25 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 29 - cmp r0, 0 - bge _081945FC -_081945DC: - lsls r1, 27 - lsrs r0, r1, 30 - cmp r0, 0 - beq _08194634 - subs r1, r0, 0x1 - ldr r2, [sp, 0x24] - lsrs r0, r2, 24 -_081945EA: - lsls r1, 24 - lsrs r1, 24 - bl sub_81948EC - b _08194634 - .pool -_081945FC: - ldr r3, =0x00000cb2 - adds r1, r2, r3 - ldrh r0, [r1] - cmp r0, 0 - beq _08194634 - ldr r0, [sp, 0x1C] - add r0, r8 - lsls r0, 3 - ldr r2, =gTasks - adds r0, r2 - movs r3, 0x10 - ldrsh r0, [r0, r3] - cmp r0, 0 - beq _08194624 - ldrh r1, [r1] - b _08194628 - .pool -_08194624: - ldrh r0, [r1] - subs r1, r0, 0x1 -_08194628: - ldr r2, [sp, 0x24] - lsrs r0, r2, 24 - lsls r1, 24 - lsrs r1, 24 - bl sub_81948EC -_08194634: - ldr r0, [sp, 0x1C] - add r0, r8 - lsls r0, 3 - ldr r3, =gTasks - adds r0, r3 - movs r1, 0x10 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _08194660 - ldr r2, =gSaveBlock2Ptr - ldr r0, [r2] - ldr r3, =0x00000cb2 - adds r0, r3 - ldrh r3, [r0] - adds r6, r2, 0 - b _0819466E - .pool -_08194660: - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r2, =0x00000cb2 - adds r0, r2 - ldrh r0, [r0] - subs r3, r0, 0x1 - adds r6, r1, 0 -_0819466E: - mov r0, r10 - cmp r0, 0x1 - bne _0819468E - ldr r2, [r6] - adds r0, r2, r7 - ldr r1, =0x00000d25 - adds r0, r1 - ldrb r1, [r0] - lsls r1, 27 - lsrs r1, 30 - ldr r0, =0x00000cb2 - adds r2, r0 - ldrh r0, [r2] - subs r0, 0x1 - cmp r1, r0 - blt _081946A6 -_0819468E: - mov r1, r10 - cmp r1, 0 - bne _081946FA - ldr r0, [r6] - adds r0, r7 - ldr r2, =0x00000d25 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 27 - lsrs r0, 30 - cmp r0, r3 - bgt _081946FA -_081946A6: - ldr r0, [r6] - adds r1, r0, r7 - ldr r3, =0x00000d25 - adds r0, r1, r3 - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - bge _081946FA - ldr r2, =0x00000d24 - adds r0, r1, r2 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - ldr r3, =0x000003ff - cmp r0, r3 - bne _081946F0 - ldrb r1, [r4, 0xC] - mov r0, r9 - ands r0, r1 - movs r1, 0x30 - orrs r0, r1 - strb r0, [r4, 0xC] - ldrb r1, [r4, 0xD] - mov r0, r9 - ands r0, r1 - movs r1, 0x40 - b _08194740 - .pool -_081946F0: - ldrb r1, [r4, 0xC] - mov r0, r9 - ands r0, r1 - movs r1, 0xB0 - b _08194734 -_081946FA: - ldr r0, [r6] - adds r0, r7 - ldr r1, =0x00000d24 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - ldr r2, =0x000003ff - cmp r0, r2 - bne _0819472C - ldrb r1, [r4, 0xC] - mov r0, r9 - ands r0, r1 - movs r1, 0x30 - orrs r0, r1 - strb r0, [r4, 0xC] - ldrb r1, [r4, 0xD] - mov r0, r9 - ands r0, r1 - movs r1, 0x40 - b _08194740 - .pool -_0819472C: - ldrb r1, [r4, 0xC] - mov r0, r9 - ands r0, r1 - movs r1, 0xE0 -_08194734: - orrs r0, r1 - strb r0, [r4, 0xC] - ldrb r1, [r4, 0xD] - mov r0, r9 - ands r0, r1 - movs r1, 0xD0 -_08194740: - orrs r0, r1 - strb r0, [r4, 0xD] - ldr r0, =gUnknown_0860D3F1 - ldr r3, [sp, 0x20] - adds r0, r3, r0 - ldrb r0, [r0] - cmp r0, 0 - bne _08194768 - ldrb r0, [r4, 0x5] - ldrb r3, [r4, 0xA] - ldr r1, =gUnknown_02022E2C - movs r2, 0x3D - bl GetStringWidthDifference - b _0819476A - .pool -_08194768: - movs r0, 0x3 -_0819476A: - strb r0, [r4, 0x8] - ldr r0, =gUnknown_02022E2C - str r0, [sp, 0x4] - ldr r0, =gUnknown_0860D3F1 - ldr r1, [sp, 0x20] - adds r0, r1, r0 - ldrb r0, [r0] - strb r0, [r4, 0x4] - ldr r2, =gUnknown_0860D3F2 - adds r0, r1, r2 - ldrb r0, [r0] - strb r0, [r4, 0x9] - add r0, sp, 0x4 - movs r1, 0 - movs r2, 0 - bl AddTextPrinter - ldr r3, [sp, 0x20] - adds r3, 0x2 - str r3, [sp, 0x20] - ldr r0, [sp, 0x24] - movs r1, 0x80 - lsls r1, 17 - adds r0, r1 - str r0, [sp, 0x24] - adds r7, 0x4 - subs r5, 0x1 - cmp r5, 0 - blt _081947A6 - b _0819456C -_081947A6: - ldr r0, =gTasks - ldr r1, [sp, 0x1C] - add r1, r8 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _081948C2 - .pool -_081947C8: - movs r0, 0 - bl PutWindowTilemap - movs r0, 0x1 - bl PutWindowTilemap - movs r0, 0x2 - bl PutWindowTilemap - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - movs r0, 0x1 - movs r1, 0x3 - bl CopyWindowToVram - movs r0, 0x2 - movs r1, 0x3 - bl CopyWindowToVram - ldr r0, =sub_8194BEC - bl SetHBlankCallback - ldr r0, =sub_8194CE4 - bl SetVBlankCallback - cmp r4, 0x2 - bne _0819485C - mov r2, r10 - cmp r2, 0 - bne _08194844 - ldr r0, =sub_819395C - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r5, r0, 24 - ldr r2, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r2 - mov r3, r10 - strh r3, [r1, 0x8] - strh r3, [r1, 0xA] - mov r4, r8 - lsls r0, r4, 2 - add r0, r8 - lsls r0, 3 - adds r0, r2 - ldrh r0, [r0, 0x10] - strh r0, [r1, 0x14] - b _08194878 - .pool -_08194844: - ldr r0, =sub_8194950 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - b _0819486C - .pool -_0819485C: - ldr r1, =gTasks - mov r2, r8 - lsls r0, r2, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r3, 0xE - ldrsh r5, [r0, r3] -_0819486C: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x8] -_08194878: - bl dp12_8087EA4 - ldr r0, =gUnknown_02038C28 - ldr r2, =0x00001f0a - movs r4, 0xF0 - lsls r4, 3 - adds r1, r0, r4 - movs r5, 0x5A -_08194888: - strh r2, [r0] - strh r2, [r1] - adds r1, 0x2 - adds r0, 0x2 - subs r5, 0x1 - cmp r5, 0 - bge _08194888 - movs r5, 0x5B - ldr r3, =gUnknown_0860CF44 - ldr r0, =gUnknown_02038C28 - ldr r2, =0x00001f09 - ldr r4, =0x00000836 - adds r1, r0, r4 - adds r0, 0xB6 -_081948A4: - strh r2, [r0] - strh r2, [r1] - adds r1, 0x2 - adds r0, 0x2 - adds r5, 0x1 - cmp r5, 0x9F - ble _081948A4 - ldr r0, [r3] - ldr r1, [r3, 0x4] - ldr r2, [r3, 0x8] - bl sub_80BA038 - mov r0, r8 - bl DestroyTask -_081948C2: - add sp, 0x28 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8194220 - - thumb_func_start sub_81948EC -sub_81948EC: @ 81948EC - push {r4-r7,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r4, =gUnknown_0860DD10 - lsls r2, r1, 2 - lsls r3, r0, 4 - adds r2, r3 - adds r2, r4 - ldr r3, [r2] - ldr r2, =gUnknown_0860DE10 - lsls r0, 2 - adds r1, r0 - adds r1, r2 - ldrb r0, [r1] - cmp r0, 0 - beq _08194938 - movs r7, 0x1 - adds r4, r3, 0 - adds r5, r4, 0x2 - adds r6, r0, 0 -_0819491A: - ldrb r2, [r4] - ldrb r3, [r4, 0x1] - str r7, [sp] - str r7, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x1 - adds r1, r5, 0 - bl CopyToBgTilemapBufferRect_ChangePalette - adds r4, 0x4 - adds r5, 0x4 - subs r6, 0x1 - cmp r6, 0 - bne _0819491A -_08194938: - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81948EC - - thumb_func_start sub_8194950 -sub_8194950: @ 8194950 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x14 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r2, 0x8 - ldrsh r0, [r0, r2] - adds r2, r1, 0 - cmp r0, 0x4 - bls _08194974 - b _08194B3C -_08194974: - lsls r0, 2 - ldr r1, =_08194988 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08194988: - .4byte _0819499C - .4byte _081949C0 - .4byte _08194AD4 - .4byte _08194AEE - .4byte _08194B24 -_0819499C: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0x1 - strh r1, [r0, 0x8] - b _08194B3C - .pool -_081949C0: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081949CE - b _08194B3C -_081949CE: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r2 - movs r2, 0 - movs r3, 0x2 - movs r1, 0x2 - strh r1, [r0, 0x8] - movs r1, 0x40 - strh r1, [r0, 0xE] - add r0, sp, 0x4 - strb r3, [r0, 0x5] - strb r2, [r0, 0x6] - strb r2, [r0, 0x7] - strb r3, [r0, 0xA] - strb r2, [r0, 0xB] - adds r3, r0, 0 - ldrb r2, [r3, 0xC] - subs r1, 0x50 - adds r0, r1, 0 - ands r0, r2 - strb r0, [r3, 0xC] - adds r2, r3, 0 - movs r0, 0xB0 - strb r0, [r2, 0xC] - ldrb r0, [r2, 0xD] - ands r1, r0 - strb r1, [r2, 0xD] - adds r1, r2, 0 - movs r0, 0xD0 - strb r0, [r1, 0xD] - movs r7, 0 - ldr r0, =gUnknown_02022E2C - mov r9, r0 - ldr r1, =gSaveBlock2Ptr - mov r8, r1 - adds r4, r2, 0 - ldr r6, =gUnknown_0860D3F1 - movs r5, 0 -_08194A1C: - mov r2, r8 - ldr r0, [r2] - adds r0, r5 - ldr r1, =0x00000d24 - adds r0, r1 - ldrh r1, [r0] - lsls r1, 22 - lsrs r1, 22 - mov r0, r9 - bl sub_8195898 - mov r0, r8 - ldr r2, [r0] - adds r0, r2, r5 - ldr r1, =0x00000d25 - adds r0, r1 - ldrb r3, [r0] - lsls r1, r3, 27 - lsrs r1, 30 - ldr r0, =0x00000cb2 - adds r2, r0 - ldrh r0, [r2] - subs r0, 0x1 - cmp r1, r0 - bne _08194A9E - lsls r0, r3, 29 - cmp r0, 0 - bge _08194A9E - ldrb r0, [r6] - cmp r0, 0 - bne _08194A84 - ldrb r0, [r4, 0x5] - ldrb r3, [r4, 0xA] - mov r1, r9 - movs r2, 0x3D - bl GetStringWidthDifference - b _08194A86 - .pool -_08194A84: - movs r0, 0x3 -_08194A86: - strb r0, [r4, 0x8] - mov r1, r9 - str r1, [sp, 0x4] - ldrb r0, [r6] - strb r0, [r4, 0x4] - ldrb r0, [r6, 0x1] - strb r0, [r4, 0x9] - add r0, sp, 0x4 - movs r1, 0 - movs r2, 0 - bl AddTextPrinter -_08194A9E: - mov r2, r8 - ldr r1, [r2] - adds r0, r1, r5 - ldr r2, =0x00000d25 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _08194AC4 - subs r2, 0x73 - adds r0, r1, r2 - ldrh r1, [r0] - subs r1, 0x1 - lsls r0, r7, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - bl sub_81948EC -_08194AC4: - adds r6, 0x2 - adds r5, 0x4 - adds r7, 0x1 - cmp r7, 0xF - ble _08194A1C - b _08194B3C - .pool -_08194AD4: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r2 - ldrh r0, [r1, 0xE] - subs r0, 0x1 - strh r0, [r1, 0xE] - lsls r0, 16 - cmp r0, 0 - bne _08194B3C - movs r0, 0x3 - strh r0, [r1, 0x8] - b _08194B3C -_08194AEE: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _08194B3C - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0x4 - strh r1, [r0, 0x8] - b _08194B3C - .pool -_08194B24: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08194B3C - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl SetMainCallback2 - adds r0, r4, 0 - bl DestroyTask -_08194B3C: - add sp, 0x14 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8194950 - - thumb_func_start sub_8194B54 -sub_8194B54: @ 8194B54 - push {lr} - bl AnimateSprites - bl BuildOamBuffer - bl RunTextPrinters - bl UpdatePaletteFade - bl RunTasks - pop {r0} - bx r0 - thumb_func_end sub_8194B54 - - thumb_func_start sub_8194B70 -sub_8194B70: @ 8194B70 - push {lr} - movs r0, 0x3 - movs r1, 0x80 - movs r2, 0x1 - bl ChangeBgX - movs r0, 0x3 - movs r1, 0x80 - movs r2, 0x2 - bl ChangeBgY - ldr r0, =gUnknown_02022E14 - ldrh r1, [r0] - movs r0, 0x10 - bl SetGpuReg - ldr r0, =gUnknown_02022E16 - ldrh r1, [r0] - movs r0, 0x12 - bl SetGpuReg - ldr r0, =gUnknown_02022E18 - ldrh r1, [r0] - movs r0, 0x14 - bl SetGpuReg - ldr r0, =gUnknown_02022E1A - ldrh r1, [r0] - movs r0, 0x16 - bl SetGpuReg - ldr r0, =gUnknown_02022E1C - ldrh r1, [r0] - movs r0, 0x18 - bl SetGpuReg - ldr r0, =gUnknown_02022E1E - ldrh r1, [r0] - movs r0, 0x1A - bl SetGpuReg - bl LoadOam - bl ProcessSpriteCopyRequests - bl TransferPlttBuffer - pop {r0} - bx r0 - .pool - thumb_func_end sub_8194B70 - - thumb_func_start sub_8194BEC -sub_8194BEC: @ 8194BEC - push {lr} - ldr r0, =0x04000006 - ldrh r0, [r0] - adds r1, r0, 0 - cmp r0, 0x29 - bls _08194CC8 - cmp r0, 0x31 - bhi _08194C1C - ldr r1, =0x04000048 - ldr r2, =0x00003b3b - adds r0, r2, 0 - strh r0, [r1] - subs r1, 0x8 - ldr r0, =0x989b5558 - b _08194CD4 - .pool -_08194C1C: - cmp r0, 0x39 - bls _08194CC8 - cmp r0, 0x4A - bhi _08194C40 - ldr r1, =0x04000048 - ldr r2, =0x00003b3b - adds r0, r2, 0 - strh r0, [r1] - subs r1, 0x8 - ldr r0, =0x90985860 - b _08194CD4 - .pool -_08194C40: - cmp r0, 0x51 - bhi _08194C60 - ldr r1, =0x04000048 - ldr r2, =0x00003b3b - adds r0, r2, 0 - strh r0, [r1] - subs r1, 0x8 - ldr r0, =0x989b5558 - b _08194CD4 - .pool -_08194C60: - cmp r0, 0x5E - bls _08194CC8 - cmp r0, 0x66 - bhi _08194C84 - ldr r1, =0x04000048 - ldr r2, =0x00003737 - adds r0, r2, 0 - strh r0, [r1] - subs r1, 0x8 - ldr r0, =0x989b5558 - b _08194CD4 - .pool -_08194C84: - cmp r0, 0x76 - bhi _08194CA4 - ldr r1, =0x04000048 - ldr r2, =0x00003737 - adds r0, r2, 0 - strh r0, [r1] - subs r1, 0x8 - ldr r0, =0x90985860 - b _08194CD4 - .pool -_08194CA4: - cmp r0, 0x7E - bls _08194CC8 - cmp r1, 0x86 - bhi _08194CC8 - ldr r1, =0x04000048 - ldr r2, =0x00003737 - adds r0, r2, 0 - strh r0, [r1] - subs r1, 0x8 - ldr r0, =0x989b5558 - b _08194CD4 - .pool -_08194CC8: - ldr r1, =0x04000048 - ldr r2, =0x00003f3f - adds r0, r2, 0 - strh r0, [r1] - subs r1, 0x8 - movs r0, 0 -_08194CD4: - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8194BEC - - thumb_func_start sub_8194CE4 -sub_8194CE4: @ 8194CE4 - push {lr} - ldr r0, =gUnknown_02022E14 - ldrh r1, [r0] - movs r0, 0x10 - bl SetGpuReg - ldr r0, =gUnknown_02022E16 - ldrh r1, [r0] - movs r0, 0x12 - bl SetGpuReg - ldr r0, =gUnknown_02022E18 - ldrh r1, [r0] - movs r0, 0x14 - bl SetGpuReg - ldr r0, =gUnknown_02022E1A - ldrh r1, [r0] - movs r0, 0x16 - bl SetGpuReg - movs r0, 0x2 - movs r1, 0x80 - movs r2, 0x2 - bl ChangeBgY - movs r0, 0x3 - movs r1, 0x80 - movs r2, 0x1 - bl ChangeBgY - bl LoadOam - bl ProcessSpriteCopyRequests - bl TransferPlttBuffer - bl sub_80BA0A8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8194CE4 - - thumb_func_start sub_8194D48 -sub_8194D48: @ 8194D48 - ldr r1, =gUnknown_0203BC8C - ldr r0, =gBattleFrontierMons - str r0, [r1] - ldr r1, =gUnknown_0203BC88 - ldr r0, =gBattleFrontierTrainers - str r0, [r1] - bx lr - .pool - thumb_func_end sub_8194D48 - - thumb_func_start sub_8194D68 -sub_8194D68: @ 8194D68 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - movs r3, 0 -_08194D76: - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r0, =gUnknown_0203CEF8 - adds r0, r3, r0 - ldrb r0, [r0] - subs r0, 0x1 - lsls r0, 1 - ldr r2, =0x00000caa - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - subs r0, 0x1 - mov r10, r0 - movs r6, 0 - adds r0, r3, 0x1 - str r0, [sp] - movs r1, 0x64 - mov r0, r10 - muls r0, r1 - movs r2, 0x8E - lsls r2, 2 - adds r2, r0 - mov r9, r2 - adds r7, r3, 0 - muls r7, r1 -_08194DA8: - movs r5, 0 - adds r0, r6, 0x1 - mov r8, r0 - b _08194DBE - .pool -_08194DBC: - adds r5, 0x1 -_08194DBE: - cmp r5, 0x3 - bgt _08194DEA - ldr r1, =gSaveBlock1Ptr - ldr r0, [r1] - add r0, r9 - adds r1, r5, 0 - adds r1, 0xD - movs r2, 0 - str r3, [sp, 0x4] - bl GetMonData - adds r4, r0, 0 - adds r1, r6, 0 - adds r1, 0xD - ldr r2, =gPlayerParty - adds r0, r7, r2 - movs r2, 0 - bl GetMonData - ldr r3, [sp, 0x4] - cmp r4, r0 - bne _08194DBC -_08194DEA: - cmp r5, 0x4 - bne _08194E00 - lsls r2, r6, 24 - lsrs r2, 24 - ldr r1, =gPlayerParty - adds r0, r7, r1 - movs r1, 0xA6 - str r3, [sp, 0x4] - bl sub_80691F4 - ldr r3, [sp, 0x4] -_08194E00: - mov r6, r8 - cmp r6, 0x3 - ble _08194DA8 - ldr r2, =gSaveBlock1Ptr - ldr r0, [r2] - movs r2, 0x64 - mov r1, r10 - muls r1, r2 - adds r0, r1 - movs r1, 0x8E - lsls r1, 2 - adds r0, r1 - adds r1, r3, 0 - muls r1, r2 - ldr r2, =gPlayerParty - adds r1, r2 - movs r2, 0x64 - bl memcpy - ldr r3, [sp] - cmp r3, 0x1 - ble _08194D76 - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8194D68 - - thumb_func_start sub_8194E44 -sub_8194E44: @ 8194E44 - push {r4-r7,lr} - sub sp, 0x4 - movs r4, 0 - ldr r7, =gSaveBlock1Ptr - movs r6, 0x64 - movs r5, 0 -_08194E50: - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r0, =gUnknown_0203CEF8 - adds r0, r4, r0 - ldrb r0, [r0] - subs r0, 0x1 - lsls r0, 1 - ldr r2, =0x00000caa - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - subs r0, 0x1 - adds r1, r0, 0 - muls r1, r6 - movs r0, 0x8E - lsls r0, 2 - adds r1, r0 - ldr r0, [r7] - adds r0, r1 - movs r1, 0xC - movs r2, 0 - bl GetMonData - mov r1, sp - strh r0, [r1] - ldr r0, =gPlayerParty - adds r0, r5, r0 - movs r1, 0xC - mov r2, sp - bl SetMonData - adds r5, 0x64 - adds r4, 0x1 - cmp r4, 0x1 - ble _08194E50 - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8194E44 - - thumb_func_start sub_8194EB4 -sub_8194EB4: @ 8194EB4 - push {lr} - bl sub_80F94E8 - pop {r0} - bx r0 - thumb_func_end sub_8194EB4 - - thumb_func_start sub_8194EC0 -sub_8194EC0: @ 8194EC0 - push {r4,lr} - ldr r0, =gUnknown_02038BCA - ldrh r0, [r0] - bl sub_8195358 - adds r4, r0, 0 - ldr r0, =0x000003ff - bl sub_8195358 - cmp r4, r0 - ble _08194EE8 - ldr r1, =gScriptResult - movs r0, 0x1 - b _08194EEC - .pool -_08194EE8: - ldr r1, =gScriptResult - movs r0, 0x2 -_08194EEC: - strh r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8194EC0 - - thumb_func_start sub_8194EF8 -sub_8194EF8: @ 8194EF8 - push {r4,lr} - bl sub_8194D48 - movs r2, 0 - ldr r3, =gSaveBlock2Ptr - ldr r0, [r3] - ldr r1, =0x00000d25 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - bge _08194F2A - adds r4, r3, 0 - adds r3, r1, 0 -_08194F14: - adds r2, 0x1 - cmp r2, 0xF - bgt _08194F2A - ldr r0, [r4] - lsls r1, r2, 2 - adds r0, r1 - adds r0, r3 - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _08194F14 -_08194F2A: - ldr r0, =gStringVar1 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - lsls r2, 2 - adds r1, r2 - ldr r2, =0x00000d24 - adds r1, r2 - ldrh r1, [r1] - lsls r1, 22 - lsrs r1, 22 - bl sub_8195898 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8194EF8 - - thumb_func_start sub_8194F58 -sub_8194F58: @ 8194F58 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x40 - movs r0, 0 - str r0, [sp, 0x8] - str r0, [sp, 0xC] - str r0, [sp, 0x10] - ldr r4, =gSaveBlock2Ptr - ldr r2, [r4] - ldr r5, =0x00000d0a - adds r0, r2, r5 - ldrb r1, [r0] - ldr r6, =0x00000d0b - adds r0, r2, r6 - ldrb r0, [r0] - cmn r1, r0 - beq _08194F8C - ldr r1, =0x00000ca8 - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _08194F8C - b _0819533E -_08194F8C: - movs r0, 0x20 - bl AllocZeroed - str r0, [sp, 0x18] - movs r0, 0x18 - bl AllocZeroed - str r0, [sp, 0x1C] - ldr r1, [r4] - ldr r2, =0x00000ca9 - adds r1, r2 - ldrb r2, [r1] - lsls r0, r2, 30 - lsrs r0, 30 - str r0, [sp, 0x14] - movs r0, 0x4 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r0, [r4] - movs r1, 0x1 - adds r0, r5 - strb r1, [r0] - ldr r0, [r4] - adds r0, r6 - strb r1, [r0] - movs r3, 0 - mov r10, r3 - movs r4, 0 - str r4, [sp, 0x38] - movs r5, 0 - str r5, [sp, 0x3C] -_08194FCC: - mov r0, r10 - cmp r0, 0x4 - bgt _08194FFC - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 16 - lsrs r4, r0, 16 - b _08195030 - .pool -_08194FFC: - mov r1, r10 - cmp r1, 0xE - bgt _0819501A - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x14 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - adds r4, r0, 0 - adds r4, 0xA - b _08195030 -_0819501A: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - adds r4, r0, 0 - adds r4, 0x1E -_08195030: - movs r6, 0 - cmp r6, r10 - bge _08195064 - ldr r2, =gSaveBlock2Ptr - ldr r0, [r2] - ldr r3, =0x00000d24 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - cmp r0, r4 - beq _08195064 - adds r3, r2, 0 - ldr r2, =0x00000d24 -_0819504C: - adds r6, 0x1 - cmp r6, r10 - bge _08195064 - ldr r0, [r3] - lsls r1, r6, 2 - adds r0, r1 - adds r0, r2 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - cmp r0, r4 - bne _0819504C -_08195064: - cmp r6, r10 - bne _08194FCC - ldr r5, =gSaveBlock2Ptr - ldr r3, [r5] - ldr r0, [sp, 0x38] - adds r3, r0 - ldr r1, =0x00000d24 - adds r3, r1 - ldr r2, =0x000003ff - adds r0, r2, 0 - adds r2, r4, 0 - ands r2, r0 - ldrh r0, [r3] - ldr r5, =0xfffffc00 - adds r1, r5, 0 - ands r0, r1 - orrs r0, r2 - strh r0, [r3] - movs r6, 0 - lsls r4, 16 - str r4, [sp, 0x30] - ldr r0, [sp, 0x3C] - str r0, [sp, 0x20] -_08195092: - adds r1, r6, 0x1 - str r1, [sp, 0x24] - lsls r2, r6, 2 - str r2, [sp, 0x2C] - lsls r3, r6, 1 - str r3, [sp, 0x28] -_0819509E: - ldr r4, [sp, 0x30] - lsrs r0, r4, 16 - bl sub_8163524 - lsls r0, 16 - lsrs r5, r0, 16 - movs r7, 0 - cmp r7, r6 - bge _081950F4 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =gUnknown_0203BC8C - mov r9, r1 - ldr r2, [sp, 0x8] - mov r8, r2 - ldr r3, [sp, 0xC] - mov r12, r3 - ldr r4, =0x00000d64 - adds r0, r4 - ldr r1, [sp, 0x20] - adds r4, r1, r0 -_081950C8: - ldrh r3, [r4] - cmp r3, r5 - beq _081950F4 - mov r2, r9 - ldr r1, [r2] - lsls r0, r5, 4 - adds r2, r0, r1 - ldrh r0, [r2] - cmp r8, r0 - beq _081950F4 - cmp r12, r0 - beq _081950F4 - lsls r0, r3, 4 - adds r0, r1 - ldrb r0, [r0, 0xA] - ldrb r2, [r2, 0xA] - cmp r0, r2 - beq _081950F4 - adds r4, 0x2 - adds r7, 0x1 - cmp r7, r6 - blt _081950C8 -_081950F4: - cmp r7, r6 - bne _0819509E - ldr r3, =gSaveBlock2Ptr - ldr r0, [r3] - ldr r4, [sp, 0x28] - ldr r2, [sp, 0x3C] - adds r1, r4, r2 - ldr r3, =0x00000d64 - adds r0, r3 - adds r0, r1 - strh r5, [r0] - ldr r2, [sp, 0x2C] - add r2, sp - adds r2, 0x8 - ldr r3, =gUnknown_0203BC8C - ldr r1, [r3] - lsls r0, r5, 4 - adds r0, r1 - ldrh r0, [r0] - str r0, [r2] - ldr r6, [sp, 0x24] - cmp r6, 0x2 - ble _08195092 - ldr r4, =gSaveBlock2Ptr - ldr r2, [r4] - ldr r5, [sp, 0x38] - adds r2, r5 - ldr r0, =0x00000d25 - adds r2, r0 - ldrb r0, [r2] - movs r4, 0x5 - negs r4, r4 - adds r1, r4, 0 - ands r0, r1 - strb r0, [r2] - ldr r5, =gSaveBlock2Ptr - ldr r2, [r5] - ldr r0, [sp, 0x38] - adds r2, r0 - ldr r1, =0x00000d25 - adds r2, r1 - ldrb r0, [r2] - subs r4, 0x14 - adds r1, r4, 0 - ands r0, r1 - strb r0, [r2] - ldr r1, [r5] - ldr r5, [sp, 0x38] - adds r1, r5 - ldr r0, =0x00000d25 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x1F - ands r0, r2 - strb r0, [r1] - adds r5, 0x4 - str r5, [sp, 0x38] - ldr r1, [sp, 0x3C] - adds r1, 0x6 - str r1, [sp, 0x3C] - movs r2, 0x1 - add r10, r2 - mov r4, r10 - cmp r4, 0xF - bgt _08195178 - b _08194FCC -_08195178: - movs r5, 0 - mov r10, r5 - ldr r5, [sp, 0x18] - movs r0, 0 - str r0, [sp, 0x34] -_08195182: - movs r7, 0 - strh r7, [r5] - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - mov r2, r10 - lsls r1, r2, 2 - adds r0, r1 - ldr r3, =0x00000d24 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - bl sub_8190168 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r6, 0 - ldr r4, [sp, 0x34] - mov r9, r4 -_081951AA: - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - mov r4, r9 - add r4, r10 - adds r4, r6 - lsls r4, 1 - ldr r2, =0x00000d64 - adds r0, r2 - adds r0, r4 - ldrh r1, [r0] - ldr r3, =gUnknown_0203BC8C - ldr r0, [r3] - lsls r1, 4 - adds r1, r0 - ldrh r0, [r1] - ldrb r3, [r1, 0xB] - ldrb r1, [r1, 0xC] - str r1, [sp] - ldr r1, [sp, 0x1C] - str r1, [sp, 0x4] - movs r1, 0x32 - mov r2, r8 - bl sub_818F720 - ldr r2, [sp, 0x1C] - ldr r1, [r2, 0x4] - ldrh r0, [r5] - adds r0, r1 - ldr r1, [r2, 0x8] - adds r0, r1 - ldr r1, [r2, 0x10] - adds r0, r1 - ldr r1, [r2, 0x14] - adds r0, r1 - ldr r1, [r2, 0xC] - adds r0, r1 - ldr r1, [r2] - adds r0, r1 - strh r0, [r5] - ldr r3, =gSaveBlock2Ptr - ldr r0, [r3] - ldr r1, =0x00000d64 - adds r0, r1 - adds r0, r4 - ldrh r0, [r0] - ldr r2, =gUnknown_0203BC8C - ldr r1, [r2] - lsls r0, 4 - adds r0, r1 - ldrh r0, [r0] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - ldr r3, =gBaseStats - adds r1, r3 - ldrb r0, [r1, 0x6] - lsls r0, 2 - ldr r4, =gBitTable - adds r0, r4 - ldr r0, [r0] - orrs r7, r0 - ldrb r0, [r1, 0x7] - lsls r0, 2 - adds r0, r4 - ldr r0, [r0] - orrs r7, r0 - adds r6, 0x1 - cmp r6, 0x2 - ble _081951AA - movs r4, 0 - movs r1, 0x1 - movs r6, 0x1F -_0819523A: - adds r0, r7, 0 - ands r0, r1 - cmp r0, 0 - beq _08195244 - adds r4, 0x1 -_08195244: - asrs r7, 1 - subs r6, 0x1 - cmp r6, 0 - bge _0819523A - movs r1, 0x32 - adds r0, r4, 0 - muls r0, r1 - movs r1, 0x14 - bl __divsi3 - ldrh r1, [r5] - adds r1, r0 - strh r1, [r5] - adds r5, 0x2 - ldr r2, [sp, 0x34] - adds r2, 0x2 - str r2, [sp, 0x34] - movs r3, 0x1 - add r10, r3 - mov r4, r10 - cmp r4, 0xF - ble _08195182 - movs r5, 0 - mov r10, r5 - ldr r7, [sp, 0x18] -_08195276: - mov r6, r10 - adds r6, 0x1 - cmp r6, 0xF - bgt _081952F8 - mov r8, r7 - ldr r5, =0x00000d24 - lsls r0, r6, 1 - ldr r1, [sp, 0x18] - adds r4, r0, r1 -_08195288: - mov r2, r8 - ldrh r1, [r2] - ldrh r0, [r4] - cmp r1, r0 - bcs _081952C4 - mov r0, r10 - adds r1, r6, 0 - ldr r2, [sp, 0x18] - bl sub_818F904 - b _081952F0 - .pool -_081952C4: - cmp r1, r0 - bne _081952F0 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - mov r3, r10 - lsls r0, r3, 2 - adds r0, r1, r0 - adds r0, r5 - ldrh r2, [r0] - lsls r2, 22 - lsls r0, r6, 2 - adds r1, r0 - adds r1, r5 - ldrh r0, [r1] - lsls r0, 22 - cmp r2, r0 - bls _081952F0 - mov r0, r10 - adds r1, r6, 0 - ldr r2, [sp, 0x18] - bl sub_818F904 -_081952F0: - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0xF - ble _08195288 -_081952F8: - adds r7, 0x2 - movs r4, 0x1 - add r10, r4 - mov r5, r10 - cmp r5, 0xE - ble _08195276 - ldr r0, [sp, 0x18] - bl Free - ldr r0, [sp, 0x1C] - bl Free - movs r0, 0 - mov r10, r0 -_08195314: - mov r1, r10 - lsls r0, r1, 24 - lsrs r0, 24 - bl sub_8195438 - movs r2, 0x1 - add r10, r2 - mov r3, r10 - cmp r3, 0x3 - ble _08195314 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r4, =0x00000ca9 - adds r1, r4 - ldrb r2, [r1] - movs r0, 0x4 - negs r0, r0 - ands r0, r2 - ldr r5, [sp, 0x14] - orrs r0, r5 - strb r0, [r1] -_0819533E: - add sp, 0x40 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8194F58 - - thumb_func_start sub_8195358 -sub_8195358: @ 8195358 - push {r4,r5,lr} - lsls r0, 16 - lsrs r3, r0, 16 - movs r2, 0 - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000d24 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - cmp r0, r3 - beq _0819538E - adds r5, r4, 0 - adds r4, r1, 0 -_08195376: - adds r2, 0x1 - cmp r2, 0xF - bgt _0819538E - ldr r0, [r5] - lsls r1, r2, 2 - adds r0, r1 - adds r0, r4 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - cmp r0, r3 - bne _08195376 -_0819538E: - adds r0, r2, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8195358 - - thumb_func_start sub_81953A0 -sub_81953A0: @ 81953A0 - push {r4,r5,lr} - lsls r0, 16 - lsrs r3, r0, 16 - movs r2, 0 - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000d24 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - cmp r0, r3 - beq _081953D6 - adds r5, r4, 0 - adds r4, r1, 0 -_081953BE: - adds r2, 0x1 - cmp r2, 0xF - bgt _081953D6 - ldr r0, [r5] - lsls r1, r2, 2 - adds r0, r1 - adds r0, r4 - ldrh r0, [r0] - lsls r0, 22 - lsrs r0, 22 - cmp r0, r3 - bne _081953BE -_081953D6: - adds r0, r2, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81953A0 - - thumb_func_start sub_81953E8 -sub_81953E8: @ 81953E8 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_0860D1A0 - ldr r0, =gUnknown_0860D1C0 - adds r0, r4, r0 - ldrb r0, [r0] - lsrs r0, 1 - lsls r0, 2 - adds r1, r0 - adds r1, r2 - ldrb r0, [r1] - subs r0, 0x10 - lsls r0, 24 - lsrs r0, 24 - mov r1, sp - bl sub_8192F08 - mov r0, sp - ldrb r0, [r0] - cmp r4, r0 - beq _0819542C - mov r0, sp - ldrb r0, [r0] - b _08195430 - .pool -_0819542C: - mov r0, sp - ldrb r0, [r0, 0x1] -_08195430: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81953E8 - - thumb_func_start sub_8195438 -sub_8195438: @ 8195438 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x40 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0xC] - movs r1, 0 - str r1, [sp, 0x10] - movs r5, 0 - movs r1, 0x3 - ldr r0, [sp] - ands r0, r1 - lsls r0, 3 - str r0, [sp, 0x14] -_0819545E: - ldr r2, =gSaveBlock2Ptr - ldr r0, [r2] - lsls r4, r5, 2 - adds r1, r0, r4 - ldr r3, =0x00000d25 - adds r0, r1, r3 - ldrb r0, [r0] - lsls r0, 29 - adds r2, r5, 0x1 - str r2, [sp, 0x24] - cmp r0, 0 - bge _08195478 - b _08195876 -_08195478: - subs r3, 0x1 - adds r0, r1, r3 - ldrh r0, [r0] - lsls r1, r0, 22 - ldr r0, =0xffc00000 - cmp r1, r0 - bne _08195488 - b _08195876 -_08195488: - str r5, [sp, 0x4] - lsrs r1, 22 - ldr r0, [sp] - bl sub_81901A0 - str r0, [sp, 0x8] - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - adds r0, r3, r4 - ldr r1, =0x00000d24 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 22 - ldr r1, =0xff800000 - cmp r0, r1 - bne _08195504 - ldr r2, [sp, 0x8] - cmp r2, 0xFF - beq _08195504 - lsls r2, 2 - adds r1, r3, r2 - ldr r3, =0x00000d25 - adds r1, r3 - ldrb r0, [r1] - movs r3, 0x4 - orrs r0, r3 - strb r0, [r1] - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - adds r1, r2 - ldr r2, =0x00000d25 - adds r1, r2 - ldrb r0, [r1] - subs r3, 0x1D - ands r0, r3 - ldr r2, [sp, 0x14] - orrs r0, r2 - strb r0, [r1] - adds r0, r5, 0 - ldr r1, [sp, 0x8] - ldr r2, [sp] - bl sub_8193ED0 - ldr r3, =gSaveBlock2Ptr - ldr r1, [r3] - ldr r5, [sp, 0x8] - lsls r2, r5, 1 - movs r3, 0xEC - lsls r3, 4 - adds r1, r3 - adds r1, r2 - b _08195874 - .pool -_08195504: - ldr r4, =gSaveBlock2Ptr - ldr r3, [r4] - ldr r0, [sp, 0x8] - lsls r2, r0, 2 - adds r0, r3, r2 - ldr r1, =0x00000d24 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 22 - ldr r1, =0xff800000 - str r2, [sp, 0x30] - cmp r0, r1 - bne _0819557C - ldr r2, [sp, 0x4] - cmp r2, 0xFF - beq _0819557C - lsls r2, 2 - adds r1, r3, r2 - ldr r3, =0x00000d25 - adds r1, r3 - ldrb r0, [r1] - movs r3, 0x4 - orrs r0, r3 - strb r0, [r1] - ldr r1, [r4] - adds r1, r2 - ldr r0, =0x00000d25 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x19 - negs r2, r2 - ands r0, r2 - ldr r3, [sp, 0x14] - orrs r0, r3 - strb r0, [r1] - ldr r0, [sp, 0x8] - ldr r1, [sp, 0x4] - ldr r2, [sp] - bl sub_8193ED0 - ldr r1, [r4] - ldr r3, [sp, 0x4] - lsls r2, r3, 1 - movs r3, 0xEC - lsls r3, 4 - adds r1, r3 - adds r1, r2 - strh r0, [r1] - adds r5, 0x1 - str r5, [sp, 0x24] - b _08195876 - .pool -_0819557C: - adds r5, 0x1 - str r5, [sp, 0x24] - ldr r5, [sp, 0x8] - cmp r5, 0xFF - bne _08195588 - b _08195876 -_08195588: - movs r0, 0 - mov r10, r0 - lsls r1, r5, 1 - str r1, [sp, 0x2C] - ldr r2, [sp, 0x4] - lsls r2, 1 - str r2, [sp, 0x28] - ldr r3, [sp, 0x4] - adds r0, r2, r3 - lsls r0, 1 - mov r9, r0 - adds r0, r1, r5 - lsls r0, 1 - str r0, [sp, 0x18] -_081955A4: - movs r5, 0 - mov r0, r9 - str r0, [sp, 0x38] -_081955AA: - movs r6, 0 - lsls r7, r5, 1 - ldr r4, [sp, 0x18] -_081955B0: - ldr r2, =gSaveBlock2Ptr - ldr r1, [r2] - ldr r3, =0x00000d64 - adds r1, r3 - ldr r2, [sp, 0x38] - adds r0, r1, r2 - ldrh r0, [r0] - ldr r3, =gUnknown_0203BC8C - mov r8, r3 - ldr r2, [r3] - lsls r0, 4 - adds r0, r2 - adds r0, 0x2 - adds r0, r7 - ldrh r0, [r0] - adds r1, r4 - ldrh r1, [r1] - lsls r1, 4 - adds r1, r2 - ldrh r1, [r1] - movs r2, 0x2 - bl sub_818FFC0 - ldr r1, [sp, 0xC] - adds r1, r0 - str r1, [sp, 0xC] - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x2 - ble _081955B0 - adds r5, 0x1 - cmp r5, 0x3 - ble _081955AA - ldr r2, =gSaveBlock2Ptr - ldr r0, [r2] - ldr r3, =0x00000d64 - adds r0, r3 - add r0, r9 - ldrh r0, [r0] - mov r5, r8 - ldr r1, [r5] - lsls r0, 4 - adds r0, r1 - ldrh r2, [r0] - ldr r0, =gBaseStats - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1] - ldrb r2, [r1, 0x1] - adds r0, r2 - ldrb r2, [r1, 0x2] - adds r0, r2 - ldrb r2, [r1, 0x3] - adds r0, r2 - ldrb r3, [r1, 0x4] - adds r0, r3 - ldrb r1, [r1, 0x5] - adds r0, r1 - movs r1, 0xA - bl __divsi3 - ldr r5, [sp, 0xC] - adds r5, r0 - str r5, [sp, 0xC] - movs r0, 0x2 - add r9, r0 - movs r1, 0x1 - add r10, r1 - mov r2, r10 - cmp r2, 0x2 - ble _081955A4 - bl Random - movs r1, 0x1F - ands r1, r0 - adds r5, r1 - ldr r3, [sp, 0x4] - adds r5, r3 - str r5, [sp, 0xC] - movs r5, 0 - mov r10, r5 - ldr r1, [sp, 0x2C] - ldr r2, [sp, 0x8] - adds r0, r1, r2 - lsls r0, 1 - str r0, [sp, 0x1C] - ldr r5, [sp, 0x28] - adds r0, r5, r3 - lsls r0, 1 - str r0, [sp, 0x20] -_08195668: - movs r5, 0 - mov r0, r10 - lsls r3, r0, 1 - movs r1, 0x1 - add r10, r1 - ldr r2, [sp, 0x1C] - adds r2, r3 - mov r8, r2 -_08195678: - movs r6, 0 - lsls r7, r5, 1 - adds r5, 0x1 - str r5, [sp, 0x3C] - ldr r4, [sp, 0x20] -_08195682: - ldr r5, =gSaveBlock2Ptr - ldr r1, [r5] - ldr r0, =0x00000d64 - adds r1, r0 - mov r2, r8 - adds r0, r1, r2 - ldrh r0, [r0] - ldr r5, =gUnknown_0203BC8C - mov r9, r5 - ldr r2, [r5] - lsls r0, 4 - adds r0, r2 - adds r0, 0x2 - adds r0, r7 - ldrh r0, [r0] - adds r1, r4 - ldrh r1, [r1] - lsls r1, 4 - adds r1, r2 - ldrh r1, [r1] - movs r2, 0x2 - str r3, [sp, 0x34] - bl sub_818FFC0 - ldr r1, [sp, 0x10] - adds r1, r0 - str r1, [sp, 0x10] - adds r4, 0x2 - adds r6, 0x1 - ldr r3, [sp, 0x34] - cmp r6, 0x2 - ble _08195682 - ldr r5, [sp, 0x3C] - cmp r5, 0x3 - ble _08195678 - ldr r2, =gSaveBlock2Ptr - ldr r0, [r2] - ldr r5, [sp, 0x1C] - adds r1, r3, r5 - ldr r2, =0x00000d64 - adds r0, r2 - adds r0, r1 - ldrh r0, [r0] - mov r3, r9 - ldr r1, [r3] - lsls r0, 4 - adds r0, r1 - ldrh r2, [r0] - ldr r0, =gBaseStats - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1] - ldrb r2, [r1, 0x1] - adds r0, r2 - ldrb r5, [r1, 0x2] - adds r0, r5 - ldrb r2, [r1, 0x3] - adds r0, r2 - ldrb r2, [r1, 0x4] - adds r0, r2 - ldrb r1, [r1, 0x5] - adds r0, r1 - movs r1, 0xA - bl __divsi3 - ldr r3, [sp, 0x10] - adds r3, r0 - str r3, [sp, 0x10] - mov r5, r10 - cmp r5, 0x2 - ble _08195668 - bl Random - movs r1, 0x1F - ands r1, r0 - ldr r0, [sp, 0x10] - adds r0, r1 - ldr r1, [sp, 0x8] - adds r0, r1 - str r0, [sp, 0x10] - ldr r2, [sp, 0xC] - cmp r2, r0 - ble _08195784 - ldr r3, =gSaveBlock2Ptr - ldr r1, [r3] - ldr r5, [sp, 0x30] - adds r1, r5 - ldr r0, =0x00000d25 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - ldr r1, [r3] - adds r1, r5 - ldr r3, =0x00000d25 - adds r1, r3 - ldrb r0, [r1] - movs r5, 0x19 - negs r5, r5 - ands r0, r5 - ldr r2, [sp, 0x14] - orrs r0, r2 - strb r0, [r1] - ldr r0, [sp, 0x4] - ldr r1, [sp, 0x8] - ldr r2, [sp] - bl sub_8193ED0 - ldr r3, =gSaveBlock2Ptr - ldr r1, [r3] - movs r5, 0xEC - lsls r5, 4 - adds r1, r5 - ldr r2, [sp, 0x2C] - adds r1, r2 - b _08195874 - .pool -_08195784: - ldr r3, [sp, 0xC] - ldr r5, [sp, 0x10] - cmp r3, r5 - bge _081957DC - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r3, [sp, 0x4] - lsls r2, r3, 2 - adds r1, r2 - ldr r5, =0x00000d25 - adds r1, r5 - ldrb r0, [r1] - movs r3, 0x4 - orrs r0, r3 - strb r0, [r1] - ldr r5, =gSaveBlock2Ptr - ldr r1, [r5] - adds r1, r2 - ldr r0, =0x00000d25 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x19 - negs r2, r2 - ands r0, r2 - ldr r3, [sp, 0x14] - orrs r0, r3 - strb r0, [r1] - ldr r0, [sp, 0x8] - ldr r1, [sp, 0x4] - ldr r2, [sp] - bl sub_8193ED0 - ldr r1, [r5] - movs r5, 0xEC - lsls r5, 4 - adds r1, r5 - ldr r2, [sp, 0x28] - adds r1, r2 - b _08195874 - .pool -_081957DC: - ldr r3, [sp, 0x4] - ldr r5, [sp, 0x8] - cmp r3, r5 - ble _08195830 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r2, [sp, 0x30] - adds r1, r2 - ldr r3, =0x00000d25 - adds r1, r3 - ldrb r0, [r1] - movs r5, 0x4 - orrs r0, r5 - strb r0, [r1] - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - adds r1, r2 - adds r1, r3 - ldrb r0, [r1] - movs r2, 0x19 - negs r2, r2 - ands r0, r2 - ldr r3, [sp, 0x14] - orrs r0, r3 - strb r0, [r1] - ldr r0, [sp, 0x4] - ldr r1, [sp, 0x8] - ldr r2, [sp] - bl sub_8193ED0 - ldr r5, =gSaveBlock2Ptr - ldr r1, [r5] - movs r2, 0xEC - lsls r2, 4 - adds r1, r2 - ldr r3, [sp, 0x2C] - b _08195872 - .pool -_08195830: - ldr r5, =gSaveBlock2Ptr - ldr r1, [r5] - ldr r0, [sp, 0x4] - lsls r2, r0, 2 - adds r1, r2 - ldr r3, =0x00000d25 - adds r1, r3 - ldrb r0, [r1] - movs r5, 0x4 - orrs r0, r5 - strb r0, [r1] - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - adds r1, r2 - adds r1, r3 - ldrb r0, [r1] - movs r2, 0x19 - negs r2, r2 - ands r0, r2 - ldr r3, [sp, 0x14] - orrs r0, r3 - strb r0, [r1] - ldr r0, [sp, 0x8] - ldr r1, [sp, 0x4] - ldr r2, [sp] - bl sub_8193ED0 - ldr r5, =gSaveBlock2Ptr - ldr r1, [r5] - movs r2, 0xEC - lsls r2, 4 - adds r1, r2 - ldr r3, [sp, 0x28] -_08195872: - adds r1, r3 -_08195874: - strh r0, [r1] -_08195876: - ldr r5, [sp, 0x24] - cmp r5, 0xF - bgt _0819587E - b _0819545E -_0819587E: - add sp, 0x40 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195438 - - thumb_func_start sub_8195898 -sub_8195898: @ 8195898 - push {r4-r6,lr} - adds r6, r0, 0 - lsls r1, 16 - lsrs r5, r1, 16 - movs r4, 0 - bl sub_8165C40 - ldr r0, =0x000003fe - cmp r5, r0 - bne _081958B8 - adds r0, r6, 0 - bl sub_8195938 - b _08195902 - .pool -_081958B8: - ldr r0, =0x000003ff - cmp r5, r0 - bne _081958DC - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] -_081958C2: - adds r0, r6, r4 - adds r1, r2, r4 - ldrb r1, [r1] - strb r1, [r0] - adds r4, 0x1 - cmp r4, 0x6 - ble _081958C2 - b _081958FC - .pool -_081958DC: - ldr r0, =0x0000012b - cmp r5, r0 - bhi _081958FC - ldr r0, =gUnknown_0203BC88 - ldr r1, [r0] - movs r0, 0x34 - muls r0, r5 - adds r0, r1 - adds r2, r0, 0x4 -_081958EE: - adds r0, r6, r4 - adds r1, r2, r4 - ldrb r1, [r1] - strb r1, [r0] - adds r4, 0x1 - cmp r4, 0x6 - ble _081958EE -_081958FC: - adds r1, r6, r4 - movs r0, 0xFF - strb r0, [r1] -_08195902: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195898 - - thumb_func_start sub_8195910 -sub_8195910: @ 8195910 - ldr r0, =gTrainers - ldr r1, =0x00007df3 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_8195910 - - thumb_func_start sub_8195924 -sub_8195924: @ 8195924 - ldr r0, =gTrainers - ldr r1, =0x00007df1 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_8195924 - - thumb_func_start sub_8195938 -sub_8195938: @ 8195938 - push {r4,lr} - adds r3, r0, 0 - movs r2, 0 - ldr r4, =gTrainers + TRAINER_TUCKER * 0x28 + 0x4 @ Tucker's name -_08195940: - adds r0, r3, r2 - adds r1, r2, r4 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x6 - ble _08195940 - adds r1, r3, r2 - movs r0, 0xFF - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195938 - - thumb_func_start sub_8195960 -sub_8195960: @ 8195960 - push {lr} - ldr r1, =gUnknown_0860DE50 - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195960 - - thumb_func_start sub_8195980 -sub_8195980: @ 8195980 - push {r4-r7,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r5, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r7, r0, 16 - ldr r0, [r4] - ldr r2, =0x00000ca8 - adds r0, r2 - movs r6, 0 - strb r6, [r0] - ldr r1, [r4] - adds r2, 0xA - adds r0, r1, r2 - strh r6, [r0] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r4] - ldr r2, =0x00000ca9 - adds r1, r2 - ldrb r2, [r1] - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r4, [r4] - ldr r0, =0x00000cdc - adds r3, r4, r0 - ldr r2, =gUnknown_0860DE98 - lsls r1, r5, 2 - lsls r0, r7, 3 - adds r1, r0 - adds r1, r2 - ldr r0, [r3] - ldr r1, [r1] - ands r0, r1 - cmp r0, 0 - bne _081959F2 - lsls r0, r5, 1 - lsls r1, r7, 2 - adds r0, r1 - ldr r2, =0x00000dc8 - adds r1, r4, r2 - adds r1, r0 - strh r6, [r1] -_081959F2: - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0x4 - ldrsb r1, [r0, r1] - movs r2, 0x5 - ldrsb r2, [r0, r2] - movs r3, 0x1 - negs r3, r3 - movs r0, 0 - bl saved_warp2_set - ldr r0, =gUnknown_02038BCA - strh r6, [r0] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195980 - - thumb_func_start sub_8195A38 -sub_8195A38: @ 8195A38 - push {r4-r7,lr} - ldr r5, =gSaveBlock2Ptr - ldr r0, [r5] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r7, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x1 - beq _08195A90 - cmp r0, 0x1 - bgt _08195A74 - cmp r0, 0 - beq _08195A7A - b _08195AD0 - .pool -_08195A74: - cmp r0, 0x2 - beq _08195AB0 - b _08195AD0 -_08195A7A: - ldr r0, =gScriptResult - ldr r1, [r5] - ldr r2, =0x00000dc6 - adds r1, r2 - ldrh r1, [r1] - strh r1, [r0] - b _08195AD0 - .pool -_08195A90: - ldr r3, =gScriptResult - ldr r0, [r5] - lsls r1, r7, 1 - lsls r2, r6, 2 - adds r1, r2 - ldr r2, =0x00000dc8 - adds r0, r2 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r3] - b _08195AD0 - .pool -_08195AB0: - ldr r4, =gScriptResult - ldr r2, [r5] - ldr r0, =0x00000cdc - adds r2, r0 - ldr r3, =gUnknown_0860DE98 - lsls r0, r7, 2 - lsls r1, r6, 3 - adds r0, r1 - adds r0, r3 - ldr r1, [r2] - ldr r0, [r0] - ands r1, r0 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - strh r0, [r4] -_08195AD0: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195A38 - - thumb_func_start sub_8195AE4 -sub_8195AE4: @ 8195AE4 - push {r4-r6,lr} - ldr r6, =gSaveBlock2Ptr - ldr r0, [r6] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r5, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x1 - beq _08195B3C - cmp r0, 0x1 - bgt _08195B20 - cmp r0, 0 - beq _08195B26 - b _08195BA0 - .pool -_08195B20: - cmp r0, 0x2 - beq _08195B5C - b _08195BA0 -_08195B26: - ldr r0, [r6] - ldr r1, =gSpecialVar_0x8006 - ldrh r1, [r1] - ldr r2, =0x00000dc6 - adds r0, r2 - strh r1, [r0] - b _08195BA0 - .pool -_08195B3C: - ldr r2, [r6] - lsls r0, r5, 1 - lsls r1, r4, 2 - adds r0, r1 - ldr r1, =0x00000dc8 - adds r2, r1 - adds r2, r0 - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - strh r0, [r2] - b _08195BA0 - .pool -_08195B5C: - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - cmp r0, 0 - beq _08195B88 - ldr r2, [r6] - ldr r0, =0x00000cdc - adds r2, r0 - ldr r3, =gUnknown_0860DE98 - lsls r1, r5, 2 - lsls r0, r4, 3 - adds r1, r0 - adds r1, r3 - ldr r0, [r2] - ldr r1, [r1] - orrs r0, r1 - b _08195B9E - .pool -_08195B88: - ldr r2, [r6] - ldr r1, =0x00000cdc - adds r2, r1 - ldr r3, =gUnknown_0860DEA8 - lsls r1, r5, 2 - lsls r0, r4, 3 - adds r1, r0 - adds r1, r3 - ldr r0, [r2] - ldr r1, [r1] - ands r0, r1 -_08195B9E: - str r0, [r2] -_08195BA0: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195AE4 - - thumb_func_start sub_8195BB0 -sub_8195BB0: @ 8195BB0 - push {r4,lr} - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - ldr r1, =gSaveBlock2Ptr - ldr r2, [r1] - ldr r3, =0x00000ca9 - adds r1, r2, r3 - ldrb r1, [r1] - lsls r1, 30 - lsrs r1, 29 - lsrs r0, 14 - adds r1, r0 - ldr r0, =0x00000dc8 - adds r2, r0 - adds r2, r1 - ldrh r0, [r2] - cmp r0, 0x31 - bhi _08195C00 - ldr r4, =gScriptResult - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - strh r0, [r4] - b _08195C16 - .pool -_08195C00: - cmp r0, 0x62 - bhi _08195C10 - ldr r1, =gScriptResult - movs r0, 0x3 - b _08195C14 - .pool -_08195C10: - ldr r1, =gScriptResult - movs r0, 0x4 -_08195C14: - strh r0, [r1] -_08195C16: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195BB0 - - thumb_func_start sub_8195C20 -sub_8195C20: @ 8195C20 - push {r4,lr} - ldr r4, =gUnknown_02038BCA - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xFF - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - lsls r1, r0, 2 - adds r1, r0 - lsrs r1, 6 - strh r1, [r4] - ldrh r0, [r4] - movs r1, 0 - bl sub_8162614 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195C20 - - thumb_func_start sub_8195C50 -sub_8195C50: @ 8195C50 - push {lr} - ldr r3, =gUnknown_02038BCA - ldrh r1, [r3] - ldr r0, =0x0000012b - cmp r1, r0 - bhi _08195C6C - ldr r2, =gUnknown_0203BC88 - movs r0, 0x34 - muls r1, r0 - ldr r0, [r2] - adds r0, r1 - adds r0, 0xC - bl ConvertBattleFrontierTrainerSpeechToString -_08195C6C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195C50 - - thumb_func_start sub_8195C7C -sub_8195C7C: @ 8195C7C - push {r4-r7,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r7, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 24 - ldr r4, [r4] - lsls r1, r7, 1 - lsrs r5, r0, 22 - adds r1, r5 - ldr r3, =0x00000dc8 - adds r6, r4, r3 - adds r3, r6, r1 - ldrh r2, [r3] - ldr r0, =0x0000270e - cmp r2, r0 - bhi _08195CCA - adds r2, 0x1 - strh r2, [r3] - movs r3, 0xDD - lsls r3, 4 - adds r0, r4, r3 - adds r1, r0, r1 - adds r0, r5, 0 - ldrh r3, [r1] - cmp r7, r3 - bls _08195CC0 - adds r0, 0x2 -_08195CC0: - adds r0, r6, r0 - ldrh r0, [r0] - cmp r0, 0 - beq _08195CCA - strh r2, [r1] -_08195CCA: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195C7C - - thumb_func_start sub_8195CE4 -sub_8195CE4: @ 8195CE4 - push {r4,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =gSpecialVar_0x8005 - ldrh r1, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - strb r1, [r0] - movs r0, 0x80 - lsls r0, 7 - movs r1, 0 - bl VarSet - ldr r1, [r4] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - bl sub_81A4C30 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195CE4 - - thumb_func_start sub_8195D28 -sub_8195D28: @ 8195D28 - push {r4,r5,lr} - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - ldr r4, =gSaveBlock2Ptr - ldr r2, [r4] - ldr r3, =0x00000ca9 - adds r1, r2, r3 - ldrb r1, [r1] - lsls r1, 30 - lsrs r1, 29 - lsrs r0, 14 - adds r1, r0 - ldr r0, =0x00000dc8 - adds r2, r0 - adds r2, r1 - ldrh r0, [r2] - cmp r0, 0x29 - bls _08195D88 - bl Random - ldr r4, [r4] - ldr r5, =gUnknown_0860DE84 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x9 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 15 - adds r0, r5 - ldrh r0, [r0] - ldr r1, =0x00000dc6 - adds r4, r1 - b _08195DA6 - .pool -_08195D88: - bl Random - ldr r4, [r4] - ldr r5, =gUnknown_0860DE78 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x6 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 15 - adds r0, r5 - ldrh r0, [r0] - ldr r3, =0x00000dc6 - adds r4, r3 -_08195DA6: - strh r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195D28 - - thumb_func_start sub_8195DB8 -sub_8195DB8: @ 8195DB8 - push {r4,r5,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000dc6 - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x1 - bl AddBagItem - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - bne _08195E00 - ldr r0, [r4] - ldr r1, =0x00000dc6 - adds r0, r1 - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r0, [r4] - ldr r1, =0x00000dc6 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - ldr r0, =gScriptResult - strh r5, [r0] - b _08195E06 - .pool -_08195E00: - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] -_08195E06: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195DB8 - - thumb_func_start sub_8195E10 -sub_8195E10: @ 8195E10 - push {lr} - bl RtcCalcLocalTime - ldr r0, =gLocalTime - bl sub_8195E34 - ldr r1, =gUnknown_0203CD80 - adds r0, 0xA - str r0, [r1] - movs r0, 0 - strb r0, [r1, 0x6] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8195E10 - - thumb_func_start sub_8195E34 -sub_8195E34: @ 8195E34 - adds r3, r0, 0 - movs r1, 0 - ldrsh r0, [r3, r1] - lsls r1, r0, 1 - adds r1, r0 - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 5 - movs r2, 0x2 - ldrsb r2, [r3, r2] - lsls r1, r2, 4 - subs r1, r2 - lsls r1, 2 - adds r0, r1 - movs r1, 0x3 - ldrsb r1, [r3, r1] - adds r0, r1 - bx lr - thumb_func_end sub_8195E34 - - thumb_func_start sub_8195E58 -sub_8195E58: @ 8195E58 - push {lr} - bl RtcCalcLocalTime - ldr r0, =gLocalTime - bl sub_8195E34 - adds r1, r0, 0 - ldr r2, =gUnknown_0203CD80 - ldr r0, [r2] - cmp r0, r1 - bhi _08195E74 - subs r0, r1, r0 - cmp r0, 0x9 - bls _08195E84 -_08195E74: - str r1, [r2] - movs r0, 0x1 - b _08195E86 - .pool -_08195E84: - movs r0, 0 -_08195E86: - pop {r1} - bx r1 - thumb_func_end sub_8195E58 - - thumb_func_start sub_8195E8C -sub_8195E8C: @ 8195E8C - push {r4,r5,lr} - movs r5, 0x1 - ldr r4, =gPlayerParty - adds r0, r4, 0 - movs r1, 0x6 - bl GetMonData - cmp r0, 0 - bne _08195EAE - adds r0, r4, 0 - bl GetMonAbility - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1F - bne _08195EAE - movs r5, 0x2 -_08195EAE: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - lsls r1, r5, 1 - adds r1, r5 - cmp r0, r1 - blt _08195ED0 - movs r0, 0 - b _08195ED2 - .pool -_08195ED0: - movs r0, 0x1 -_08195ED2: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8195E8C - - thumb_func_start sub_8195ED8 -sub_8195ED8: @ 8195ED8 - push {r4,lr} - ldr r4, =gUnknown_02037318 - ldrb r0, [r4, 0x17] - bl is_light_level_1_2_3_or_6 - lsls r0, 24 - cmp r0, 0 - beq _08195F30 - ldrb r0, [r4, 0x14] - cmp r0, 0x39 - beq _08195F30 - cmp r0, 0xE - bne _08195F0E - movs r0, 0xF9 - lsls r0, 2 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08195F0E - movs r0, 0xDC - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _08195F30 -_08195F0E: - ldr r0, =gUnknown_02037318 - ldrb r0, [r0, 0x14] - cmp r0, 0x38 - bne _08195F38 - movs r0, 0xCF - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08195F38 - movs r0, 0x8B - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _08195F38 -_08195F30: - movs r0, 0 - b _08195F3A - .pool -_08195F38: - movs r0, 0x1 -_08195F3A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8195ED8 - - thumb_func_start sub_8195F40 -sub_8195F40: @ 8195F40 - push {lr} - ldr r1, =gUnknown_0203CD80 - ldrb r0, [r1, 0x6] - adds r0, 0x1 - strb r0, [r1, 0x6] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x9 - bhi _08195F5C - movs r0, 0 - b _08195F62 - .pool -_08195F5C: - movs r0, 0 - strb r0, [r1, 0x6] - movs r0, 0x1 -_08195F62: - pop {r1} - bx r1 - thumb_func_end sub_8195F40 - - thumb_func_start sub_8195F68 -sub_8195F68: @ 8195F68 - push {r4,lr} - bl sub_8195FCC - adds r4, r0, 0 - cmp r4, 0 - beq _08195FB8 - bl Random - lsls r0, 16 - lsrs r0, 16 - adds r1, r4, 0 - bl __umodsi3 - bl sub_8195FF8 - ldr r2, =gUnknown_0203CD80 - movs r1, 0 - strh r0, [r2, 0x4] - strb r1, [r2, 0x7] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x4E - beq _08195FB8 - ldrh r0, [r2, 0x4] - bl sub_8196844 - adds r4, r0, 0 - bl sub_819672C - ldr r1, =gUnknown_02037318 - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r1, 0x14] - cmp r0, r1 - bne _08195FC4 - adds r0, r4, 0 - bl sub_8196710 - cmp r0, 0 - bne _08195FC4 -_08195FB8: - movs r0, 0 - b _08195FC6 - .pool -_08195FC4: - movs r0, 0x1 -_08195FC6: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8195F68 - - thumb_func_start sub_8195FCC -sub_8195FCC: @ 8195FCC - push {r4,r5,lr} - movs r4, 0 - movs r5, 0 -_08195FD2: - movs r1, 0xAE - lsls r1, 1 - adds r0, r4, r1 - lsls r0, 16 - lsrs r0, 16 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _08195FE8 - adds r5, 0x1 -_08195FE8: - adds r4, 0x1 - cmp r4, 0x3F - bls _08195FD2 - adds r0, r5, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8195FCC - - thumb_func_start sub_8195FF8 -sub_8195FF8: @ 8195FF8 - push {r4-r6,lr} - adds r5, r0, 0 - movs r4, 0 - ldr r6, =gUnknown_085500A4 -_08196000: - movs r1, 0xAE - lsls r1, 1 - adds r0, r4, r1 - lsls r0, 16 - lsrs r0, 16 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _08196022 - cmp r5, 0 - bne _08196020 - ldrh r0, [r6] - b _0819602C - .pool -_08196020: - subs r5, 0x1 -_08196022: - adds r6, 0x10 - adds r4, 0x1 - cmp r4, 0x3F - bls _08196000 - movs r0, 0x4E -_0819602C: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8195FF8 - - thumb_func_start sub_8196034 -sub_8196034: @ 8196034 - push {lr} - ldr r0, =0x0000012f - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _08196078 - bl sub_8195F40 - cmp r0, 0 - beq _08196078 - bl sub_8195E58 - cmp r0, 0 - beq _08196078 - bl sub_8195E8C - cmp r0, 0 - beq _08196078 - bl sub_8195ED8 - cmp r0, 0 - beq _08196078 - bl sub_8195F68 - cmp r0, 0 - beq _08196078 - bl task_prev_quest - movs r0, 0x1 - b _0819607A - .pool -_08196078: - movs r0, 0 -_0819607A: - pop {r1} - bx r1 - thumb_func_end sub_8196034 - - thumb_func_start sub_8196080 -sub_8196080: @ 8196080 - push {lr} - ldr r1, =gUnknown_0203CD80 - movs r0, 0x1 - strb r0, [r1, 0x7] - bl task_prev_quest - pop {r0} - bx r0 - .pool - thumb_func_end sub_8196080 - - thumb_func_start sub_8196094 -sub_8196094: @ 8196094 - push {lr} - ldr r0, =sub_81960E0 - bl FuncIsActiveTask - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8196094 - - thumb_func_start task_prev_quest -task_prev_quest: @ 81960A8 - push {lr} - ldr r0, =gUnknown_0203CD80 - ldrb r0, [r0, 0x7] - cmp r0, 0 - bne _081960C2 - bl script_env_2_enable - bl player_bitmagic - bl sub_808B864 - bl sub_808BCF4 -_081960C2: - ldr r0, =0x00000107 - bl PlaySE - ldr r0, =sub_81960E0 - movs r1, 0x1 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end task_prev_quest - - thumb_func_start sub_81960E0 -sub_81960E0: @ 81960E0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - ldr r1, =gUnknown_0860EF78 - movs r2, 0 - ldrsh r0, [r4, r2] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - adds r0, r5, 0 - bl _call_via_r1 - cmp r0, 0 - beq _0819611E - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - movs r1, 0 - strh r1, [r4, 0x2] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x7 - bls _0819611E - adds r0, r5, 0 - bl DestroyTask -_0819611E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81960E0 - - thumb_func_start sub_819612C -sub_819612C: @ 819612C - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - adds r6, r4, 0 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r5, r0, r1 - ldr r0, =gUnknown_0860EF98 - bl AddWindow - strh r0, [r5, 0x4] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xFF - bne _0819615C - adds r0, r4, 0 - b _081961E0 - .pool -_0819615C: - ldr r1, =gUnknown_0860EA6C - movs r2, 0x80 - lsls r2, 1 - movs r3, 0x9C - lsls r3, 2 - movs r0, 0 - bl LoadBgTiles - lsls r0, 16 - ldr r1, =0xffff0000 - cmp r0, r1 - bne _08196188 - ldrb r0, [r5, 0x4] - bl RemoveWindow - adds r0, r4, 0 - b _081961E0 - .pool -_08196188: - ldr r1, =gUnknown_0860EB8C - ldr r3, =0x00000279 - movs r0, 0 - str r0, [sp] - movs r2, 0 - bl decompress_and_copy_tile_data_to_vram - cmp r0, 0 - beq _081961D8 - ldrb r0, [r5, 0x4] - movs r1, 0x88 - bl FillWindowPixelBuffer - ldr r0, =gUnknown_0860EA4C - movs r1, 0xE0 - movs r2, 0x20 - bl LoadPalette - ldr r0, =gUnknown_0860EB6C - movs r1, 0xF0 - movs r2, 0x20 - bl LoadPalette - ldr r1, =0xffffe000 - movs r0, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x1 - b _081961E6 - .pool -_081961D8: - ldrb r0, [r5, 0x4] - bl RemoveWindow - adds r0, r6, 0 -_081961E0: - bl DestroyTask - movs r0, 0 -_081961E6: - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_819612C - - thumb_func_start sub_81961F0 -sub_81961F0: @ 81961F0 - push {r4,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r4, r1, r0 - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - bne _08196268 - ldrb r0, [r4, 0x4] - bl PutWindowTilemap - movs r1, 0x4 - ldrsh r0, [r4, r1] - movs r1, 0x9C - lsls r1, 2 - movs r2, 0xE - bl sub_819645C - ldr r1, =0x0000f279 - movs r0, 0x4 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x1 - str r0, [sp, 0xC] - movs r0, 0 - movs r2, 0x1 - movs r3, 0xF - bl WriteSequenceToBgTilemapBuffer - ldr r0, =sub_8196694 - movs r1, 0xA - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0xA] - ldrb r0, [r4, 0x4] - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0x1 - b _0819626A - .pool -_08196268: - movs r0, 0 -_0819626A: - add sp, 0x10 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81961F0 - - thumb_func_start sub_8196274 -sub_8196274: @ 8196274 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r4, r1, r0 - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _08196298 - movs r0, 0 - b _081962A4 - .pool -_08196298: - movs r1, 0x4 - ldrsh r0, [r4, r1] - ldr r1, =gUnknown_0860EF70 - bl sub_81965D8 - movs r0, 0x1 -_081962A4: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8196274 - - thumb_func_start sub_81962B0 -sub_81962B0: @ 81962B0 - push {lr} - movs r1, 0xC0 - lsls r1, 3 - movs r0, 0 - movs r2, 0x1 - bl ChangeBgY - cmp r0, 0 - bge _081962C6 - movs r0, 0 - b _081962D2 -_081962C6: - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x1 -_081962D2: - pop {r1} - bx r1 - thumb_func_end sub_81962B0 - - thumb_func_start sub_81962D8 -sub_81962D8: @ 81962D8 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r4, r1, r0 - movs r1, 0x4 - ldrsh r0, [r4, r1] - bl sub_8196648 - cmp r0, 0 - bne _08196328 - ldrb r0, [r4, 0x4] - movs r1, 0x88 - bl FillWindowPixelBuffer - ldr r1, =gUnknown_0203CD80 - ldrb r0, [r1, 0x7] - cmp r0, 0 - bne _0819630C - ldrh r0, [r1, 0x4] - ldr r1, =gStringVar4 - bl sub_81967AC -_0819630C: - movs r1, 0x4 - ldrsh r0, [r4, r1] - ldr r1, =gStringVar4 - bl sub_81965D8 - movs r0, 0x1 - b _0819632A - .pool -_08196328: - movs r0, 0 -_0819632A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81962D8 - - thumb_func_start sub_8196330 -sub_8196330: @ 8196330 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r4, r1, r0 - movs r1, 0x4 - ldrsh r0, [r4, r1] - bl sub_8196648 - cmp r0, 0 - bne _08196388 - bl IsSEPlaying - lsls r0, 24 - cmp r0, 0 - bne _08196388 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _08196388 - ldrb r0, [r4, 0x4] - movs r1, 0x88 - bl FillWindowPixelBuffer - ldrb r0, [r4, 0x4] - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0x84 - lsls r0, 1 - bl PlaySE - movs r0, 0x1 - b _0819638A - .pool -_08196388: - movs r0, 0 -_0819638A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8196330 - - thumb_func_start sub_8196390 -sub_8196390: @ 8196390 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r4, r1, r0 - movs r1, 0xC0 - lsls r1, 3 - movs r0, 0 - movs r2, 0x2 - bl ChangeBgY - ldr r1, =0xffffe000 - cmp r0, r1 - ble _081963C0 - movs r0, 0 - b _081963E8 - .pool -_081963C0: - movs r0, 0x1E - str r0, [sp] - movs r0, 0x6 - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0xE - bl FillBgTilemapBufferRect_Palette0 - ldrb r0, [r4, 0xA] - bl DestroyTask - ldrb r0, [r4, 0x4] - bl RemoveWindow - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0x1 -_081963E8: - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8196390 - - thumb_func_start sub_81963F0 -sub_81963F0: @ 81963F0 - push {lr} - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _08196454 - bl IsSEPlaying - lsls r0, 24 - cmp r0, 0 - bne _08196454 - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - ldr r0, =gUnknown_0203CD80 - ldrb r0, [r0, 0x7] - cmp r0, 0 - bne _08196446 - bl sub_81973A4 - movs r0, 0xFF - movs r1, 0 - movs r2, 0 - bl GetFieldObjectIdByLocalIdAndMap - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - adds r0, r1 - bl FieldObjectClearAnimIfSpecialAnimFinished - bl sub_80D338C - bl sub_809757C - bl script_env_2_disable -_08196446: - movs r0, 0x1 - b _08196456 - .pool -_08196454: - movs r0, 0 -_08196456: - pop {r1} - bx r1 - thumb_func_end sub_81963F0 - - thumb_func_start sub_819645C -sub_819645C: @ 819645C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - adds r4, r0, 0 - adds r5, r1, 0 - adds r7, r2, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0 - bl GetWindowAttribute - mov r9, r0 - adds r0, r4, 0 - movs r1, 0x1 - bl GetWindowAttribute - str r0, [sp, 0x8] - adds r0, r4, 0 - movs r1, 0x2 - bl GetWindowAttribute - str r0, [sp, 0xC] - adds r0, r4, 0 - movs r1, 0x3 - bl GetWindowAttribute - adds r6, r0, 0 - adds r0, r4, 0 - movs r1, 0x4 - bl GetWindowAttribute - str r0, [sp, 0x10] - mov r0, r9 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - movs r1, 0xA - bl GetBgAttribute - lsls r0, 16 - lsrs r0, 16 - adds r5, r0 - lsls r7, 12 - movs r1, 0xF0 - lsls r1, 8 - adds r0, r1, 0 - ands r7, r0 - adds r1, r7, 0 - orrs r1, r5 - lsls r1, 16 - lsrs r1, 16 - ldr r2, [sp, 0x8] - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - mov r10, r2 - ldr r4, [sp, 0xC] - subs r4, 0x1 - lsls r4, 24 - lsrs r4, 24 - movs r3, 0x1 - mov r8, r3 - str r3, [sp] - str r3, [sp, 0x4] - mov r0, r9 - adds r3, r4, 0 - bl FillBgTilemapBufferRect_Palette0 - adds r1, r5, 0x1 - orrs r1, r7 - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0x8] - lsls r2, r0, 24 - lsrs r2, 24 - str r2, [sp, 0x14] - lsls r0, r6, 24 - lsrs r0, 24 - str r0, [sp, 0x18] - str r0, [sp] - mov r2, r8 - str r2, [sp, 0x4] - mov r0, r9 - ldr r2, [sp, 0x14] - adds r3, r4, 0 - bl FillBgTilemapBufferRect_Palette0 - adds r1, r5, 0x2 - orrs r1, r7 - lsls r1, 16 - lsrs r1, 16 - ldr r3, [sp, 0x8] - adds r0, r3, r6 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x1C] - mov r0, r8 - str r0, [sp] - str r0, [sp, 0x4] - mov r0, r9 - ldr r2, [sp, 0x1C] - adds r3, r4, 0 - bl FillBgTilemapBufferRect_Palette0 - adds r1, r5, 0x3 - orrs r1, r7 - lsls r1, 16 - lsrs r1, 16 - ldr r2, [sp, 0xC] - lsls r6, r2, 24 - lsrs r6, 24 - mov r3, r8 - str r3, [sp] - ldr r0, [sp, 0x10] - lsls r4, r0, 24 - lsrs r4, 24 - str r4, [sp, 0x4] - mov r0, r9 - mov r2, r10 - adds r3, r6, 0 - bl FillBgTilemapBufferRect_Palette0 - adds r1, r5, 0x4 - orrs r1, r7 - lsls r1, 16 - lsrs r1, 16 - mov r2, r8 - str r2, [sp] - str r4, [sp, 0x4] - mov r0, r9 - ldr r2, [sp, 0x1C] - adds r3, r6, 0 - bl FillBgTilemapBufferRect_Palette0 - adds r1, r5, 0x5 - orrs r1, r7 - lsls r1, 16 - lsrs r1, 16 - ldr r3, [sp, 0xC] - ldr r2, [sp, 0x10] - adds r0, r3, r2 - lsls r0, 24 - lsrs r4, r0, 24 - mov r3, r8 - str r3, [sp] - str r3, [sp, 0x4] - mov r0, r9 - mov r2, r10 - adds r3, r4, 0 - bl FillBgTilemapBufferRect_Palette0 - adds r1, r5, 0x6 - orrs r1, r7 - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0x18] - str r0, [sp] - mov r2, r8 - str r2, [sp, 0x4] - mov r0, r9 - ldr r2, [sp, 0x14] - adds r3, r4, 0 - bl FillBgTilemapBufferRect_Palette0 - adds r5, 0x7 - orrs r5, r7 - lsls r5, 16 - lsrs r5, 16 - mov r3, r8 - str r3, [sp] - str r3, [sp, 0x4] - mov r0, r9 - adds r1, r5, 0 - ldr r2, [sp, 0x1C] - adds r3, r4, 0 - bl FillBgTilemapBufferRect_Palette0 - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_819645C - - thumb_func_start sub_81965D8 -sub_81965D8: @ 81965D8 - push {lr} - sub sp, 0x10 - str r1, [sp] - mov r1, sp - movs r3, 0 - strb r0, [r1, 0x4] - mov r0, sp - movs r1, 0x1 - strb r1, [r0, 0x5] - movs r2, 0x20 - strb r2, [r0, 0x6] - strb r1, [r0, 0x7] - strb r2, [r0, 0x8] - strb r1, [r0, 0x9] - strb r3, [r0, 0xA] - strb r3, [r0, 0xB] - mov r3, sp - ldrb r2, [r3, 0xC] - subs r1, 0x11 - adds r0, r1, 0 - ands r0, r2 - strb r0, [r3, 0xC] - mov r2, sp - movs r3, 0xF - movs r0, 0xA0 - strb r0, [r2, 0xC] - ldrb r0, [r2, 0xD] - ands r1, r0 - movs r0, 0x8 - orrs r1, r0 - strb r1, [r2, 0xD] - ands r1, r3 - movs r0, 0xE0 - orrs r1, r0 - strb r1, [r2, 0xD] - ldr r2, =gTextFlags - ldrb r1, [r2] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - bl sav2_get_text_speed - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, sp - movs r2, 0 - bl AddTextPrinter - add sp, 0x10 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81965D8 - - thumb_func_start sub_8196648 -sub_8196648: @ 8196648 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gMain - ldrh r1, [r0, 0x2C] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0819666C - ldr r0, =gTextFlags - ldrb r1, [r0] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0] - b _08196678 - .pool -_0819666C: - ldr r2, =gTextFlags - ldrb r1, [r2] - movs r0, 0x2 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_08196678: - bl RunTextPrinters - lsls r0, r4, 24 - lsrs r0, 24 - bl IsTextPrinterActive - lsls r0, 16 - lsrs r0, 16 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8196648 - - thumb_func_start sub_8196694 -sub_8196694: @ 8196694 - push {lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r2, r1, r0 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - ble _081966FC - movs r1, 0 - strh r1, [r2] - ldrh r0, [r2, 0x2] - adds r0, 0x1 - strh r0, [r2, 0x2] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - ble _081966C8 - strh r1, [r2, 0x2] -_081966C8: - movs r0, 0x2 - ldrsh r1, [r2, r0] - lsls r1, 4 - ldr r0, =0x00000279 - adds r1, r0 - strh r1, [r2, 0x4] - ldr r2, =0xfffff000 - adds r0, r2, 0 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x4 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x1 - str r0, [sp, 0xC] - movs r0, 0 - movs r2, 0x1 - movs r3, 0xF - bl WriteSequenceToBgTilemapBuffer - movs r0, 0 - bl CopyBgTilemapBufferToVram -_081966FC: - add sp, 0x10 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8196694 - - thumb_func_start sub_8196710 -sub_8196710: @ 8196710 - ldr r1, =gSaveBlock1Ptr - ldr r1, [r1] - ldr r2, =0x000009ca - adds r1, r2 - adds r1, r0 - ldrb r1, [r1] - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - bx lr - .pool - thumb_func_end sub_8196710 - - thumb_func_start sub_819672C -sub_819672C: @ 819672C - push {lr} - ldr r1, =gUnknown_085500A4 - lsls r0, 4 - adds r0, r1 - ldrh r2, [r0, 0xA] - ldrh r1, [r0, 0xC] - adds r0, r2, 0 - bl get_mapheader_by_bank_and_number - ldrb r0, [r0, 0x14] - pop {r1} - bx r1 - .pool - thumb_func_end sub_819672C - - thumb_func_start sub_8196748 -sub_8196748: @ 8196748 - push {r4-r6,lr} - movs r5, 0 - movs r6, 0 - ldr r4, =gUnknown_085500A4 -_08196750: - ldrh r0, [r4] - bl trainer_flag_check - lsls r0, 24 - cmp r0, 0 - beq _0819675E - adds r6, 0x1 -_0819675E: - adds r4, 0x10 - adds r5, 0x1 - cmp r5, 0x3F - bls _08196750 - adds r0, r6, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8196748 - - thumb_func_start sub_8196774 -sub_8196774: @ 8196774 - push {r4-r7,lr} - adds r7, r0, 0 - movs r4, 0 - movs r6, 0 - ldr r5, =gUnknown_085500A4 -_0819677E: - ldrh r0, [r5] - bl trainer_flag_check - lsls r0, 24 - cmp r0, 0 - beq _0819679A - cmp r6, r7 - bne _08196798 - adds r0, r4, 0 - b _081967A4 - .pool -_08196798: - adds r6, 0x1 -_0819679A: - adds r5, 0x10 - adds r4, 0x1 - cmp r4, 0x4D - bls _0819677E - movs r0, 0x4E -_081967A4: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8196774 - - thumb_func_start sub_81967AC -sub_81967AC: @ 81967AC - push {r4-r7,lr} - adds r6, r1, 0 - movs r7, 0 - bl sub_8196844 - adds r5, r0, 0 - ldr r0, =gUnknown_0203CD88 - strh r7, [r0] - adds r0, r5, 0 - bl sub_8196710 - cmp r0, 0 - beq _081967EC - adds r0, r5, 0 - bl sub_819672C - ldr r1, =gUnknown_02037318 - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r1, 0x14] - cmp r0, r1 - bne _081967EC - adds r0, r5, 0 - adds r1, r6, 0 - bl sub_8196864 - b _08196830 - .pool -_081967EC: - adds r0, r5, 0 - bl sub_8196D74 - cmp r0, 0 - beq _0819680A - adds r0, r5, 0 - adds r1, r6, 0 - bl sub_8196890 - adds r4, r0, 0 - movs r7, 0x1 - adds r0, r5, 0 - bl sub_80B1E94 - b _08196832 -_0819680A: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - beq _08196828 - adds r0, r5, 0 - adds r1, r6, 0 - bl sub_81968BC - b _08196830 -_08196828: - adds r0, r5, 0 - adds r1, r6, 0 - bl sub_8196910 -_08196830: - adds r4, r0, 0 -_08196832: - adds r0, r5, 0 - adds r1, r4, 0 - adds r2, r6, 0 - bl sub_81969E0 - adds r0, r7, 0 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81967AC - - thumb_func_start sub_8196844 -sub_8196844: @ 8196844 - push {lr} - adds r3, r0, 0 - movs r2, 0 - ldr r1, =gUnknown_0860DEB8 -_0819684C: - ldrh r0, [r1] - cmp r0, r3 - beq _0819685C - adds r1, 0x14 - adds r2, 0x1 - b _0819684C - .pool -_0819685C: - adds r0, r2, 0 - pop {r1} - bx r1 - thumb_func_end sub_8196844 - - thumb_func_start sub_8196864 -sub_8196864: @ 8196864 - ldr r2, =gUnknown_0860DEB8 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrh r1, [r1, 0xE] - movs r2, 0xFF - lsrs r0, r1, 8 - subs r0, 0x1 - ands r1, r2 - subs r1, 0x1 - ldr r2, =gUnknown_0860EA2C - lsls r0, 2 - adds r0, r2 - lsls r1, 3 - ldr r0, [r0] - adds r0, r1 - bx lr - .pool - thumb_func_end sub_8196864 - - thumb_func_start sub_8196890 -sub_8196890: @ 8196890 - ldr r2, =gUnknown_0860DEB8 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrh r1, [r1, 0x10] - movs r2, 0xFF - lsrs r0, r1, 8 - subs r0, 0x1 - ands r1, r2 - subs r1, 0x1 - ldr r2, =gUnknown_0860EA2C - lsls r0, 2 - adds r0, r2 - lsls r1, 3 - ldr r0, [r0] - adds r0, r1 - bx lr - .pool - thumb_func_end sub_8196890 - - thumb_func_start sub_81968BC -sub_81968BC: @ 81968BC - push {r4,lr} - adds r4, r0, 0 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 16 - ldr r2, =gUnknown_0860DEB8 - lsrs r0, 15 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 2 - adds r0, r1 - adds r2, 0x4 - adds r0, r2 - ldrh r4, [r0] - cmp r4, 0 - bne _081968EC - movs r0, 0 - bl SpriteCallbackDummy -_081968EC: - movs r1, 0xFF - lsrs r0, r4, 8 - subs r0, 0x1 - ands r4, r1 - subs r1, r4, 0x1 - ldr r2, =gUnknown_0860EA20 - lsls r0, 2 - adds r0, r2 - lsls r1, 3 - ldr r0, [r0] - adds r0, r1 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81968BC - - thumb_func_start sub_8196910 -sub_8196910: @ 8196910 - push {r4-r7,lr} - sub sp, 0x4 - adds r6, r0, 0 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081969AC - movs r5, 0 - movs r4, 0 - lsls r7, r6, 2 -_0819692C: - lsls r0, r4, 16 - lsrs r0, 16 - mov r1, sp - bl sub_8196E04 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bls _08196940 - adds r5, 0x1 -_08196940: - adds r4, 0x1 - cmp r4, 0x6 - ble _0819692C - cmp r5, 0 - beq _081969AC - bl Random - lsls r0, 16 - lsrs r0, 16 - adds r1, r5, 0 - bl __modsi3 - adds r5, r0, 0 - movs r4, 0 - b _08196962 -_0819695E: - subs r5, 0x1 -_08196960: - adds r4, 0x1 -_08196962: - cmp r4, 0x6 - bgt _08196980 - lsls r0, r4, 16 - lsrs r0, 16 - mov r1, sp - bl sub_8196E04 - ldr r1, =gUnknown_0203CD88 - strh r0, [r1, 0x2] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bls _08196960 - cmp r5, 0 - bne _0819695E -_08196980: - ldr r0, =gUnknown_0203CD88 - strh r4, [r0] - ldr r1, =gUnknown_0860DEB8 - adds r0, r7, r6 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0xC] - subs r2, r0, 0x1 - ldr r1, =gUnknown_0860EA34 - ldr r0, [sp] - lsls r0, 2 - adds r0, r1 - lsls r1, r2, 3 - ldr r0, [r0] - adds r0, r1 - b _081969D0 - .pool -_081969AC: - ldr r1, =gUnknown_0860DEB8 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 2 - adds r0, r1 - ldrh r2, [r0, 0xA] - lsrs r1, r2, 8 - subs r1, 0x1 - str r1, [sp] - movs r0, 0xFF - ands r0, r2 - subs r2, r0, 0x1 - ldr r0, =gUnknown_0860EA34 - lsls r1, 2 - adds r1, r0 - lsls r2, 3 - ldr r0, [r1] - adds r0, r2 -_081969D0: - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8196910 - - thumb_func_start sub_81969E0 -sub_81969E0: @ 81969E0 - push {r4,r5,lr} - adds r4, r1, 0 - adds r5, r2, 0 - adds r1, r4, 0x4 - bl sub_81969FC - ldr r1, [r4] - adds r0, r5, 0 - bl StringExpandPlaceholders - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81969E0 - - thumb_func_start sub_81969FC -sub_81969FC: @ 81969FC - push {r4-r7,lr} - adds r7, r0, 0 - adds r6, r1, 0 - movs r4, 0 - ldr r5, =gUnknown_0860EFA0 -_08196A06: - adds r1, r6, r4 - movs r0, 0 - ldrsb r0, [r1, r0] - cmp r0, 0 - blt _08196A1A - adds r1, r0, 0 - ldr r2, [r5] - adds r0, r7, 0 - bl sub_8196A2C -_08196A1A: - adds r5, 0x4 - adds r4, 0x1 - cmp r4, 0x2 - ble _08196A06 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81969FC - - thumb_func_start sub_8196A2C -sub_8196A2C: @ 8196A2C - push {lr} - ldr r3, =gUnknown_0860EFAC - lsls r1, 2 - adds r1, r3 - ldr r3, [r1] - adds r1, r2, 0 - bl _call_via_r3 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8196A2C - - thumb_func_start sub_8196A44 -sub_8196A44: @ 8196A44 - push {r4-r6,lr} - adds r5, r1, 0 - ldr r2, =gUnknown_0860DEB8 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrh r4, [r1] - movs r2, 0 - ldr r3, =gUnknown_0860EFC4 - adds r6, r3, 0 -_08196A5A: - lsls r1, r2, 3 - ldrh r0, [r3] - cmp r0, r4 - bne _08196A78 - adds r0, r6, 0x4 - adds r0, r1, r0 - ldr r1, [r0] - adds r0, r5, 0 - bl StringCopy - b _08196A90 - .pool -_08196A78: - adds r3, 0x8 - adds r2, 0x1 - cmp r2, 0x5 - bls _08196A5A - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - ldr r0, =gTrainers + 0x4 @ name offset - adds r1, r0 - adds r0, r5, 0 - bl StringCopy -_08196A90: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8196A44 - - thumb_func_start sub_8196A9C -sub_8196A9C: @ 8196A9C - push {r4,lr} - adds r4, r1, 0 - bl sub_819672C - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - movs r2, 0 - bl GetMapName - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8196A9C - - thumb_func_start sub_8196AB8 -sub_8196AB8: @ 8196AB8 - push {lr} - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x13 - bgt _08196AD4 - movs r0, 0 - b _08196B4A -_08196AD4: - adds r0, r1, 0 - subs r0, 0x14 - cmp r0, 0x13 - bhi _08196AE0 - movs r0, 0x1 - b _08196B4A -_08196AE0: - adds r0, r1, 0 - subs r0, 0x28 - cmp r0, 0x9 - bhi _08196AEC - movs r0, 0x2 - b _08196B4A -_08196AEC: - adds r0, r1, 0 - subs r0, 0x32 - cmp r0, 0x9 - bhi _08196AF8 - movs r0, 0x3 - b _08196B4A -_08196AF8: - adds r0, r1, 0 - subs r0, 0x3C - cmp r0, 0x9 - bhi _08196B04 - movs r0, 0x4 - b _08196B4A -_08196B04: - adds r0, r1, 0 - subs r0, 0x46 - cmp r0, 0x9 - bhi _08196B10 - movs r0, 0x5 - b _08196B4A -_08196B10: - adds r0, r1, 0 - subs r0, 0x50 - cmp r0, 0x4 - bhi _08196B1C - movs r0, 0x6 - b _08196B4A -_08196B1C: - adds r0, r1, 0 - subs r0, 0x55 - cmp r0, 0x4 - bhi _08196B28 - movs r0, 0x7 - b _08196B4A -_08196B28: - adds r0, r1, 0 - subs r0, 0x5A - cmp r0, 0x3 - bhi _08196B34 - movs r0, 0x8 - b _08196B4A -_08196B34: - adds r0, r1, 0 - subs r0, 0x5E - cmp r0, 0x3 - bhi _08196B40 - movs r0, 0x9 - b _08196B4A -_08196B40: - cmp r1, 0x62 - beq _08196B48 - movs r0, 0xB - b _08196B4A -_08196B48: - movs r0, 0xA -_08196B4A: - pop {r1} - bx r1 - thumb_func_end sub_8196AB8 - - thumb_func_start sub_8196B50 -sub_8196B50: @ 8196B50 - push {lr} - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x3B - bgt _08196B6C - movs r0, 0 - b _08196B92 -_08196B6C: - adds r0, r1, 0 - subs r0, 0x3C - cmp r0, 0x1D - bhi _08196B78 - movs r0, 0x1 - b _08196B92 -_08196B78: - adds r0, r1, 0 - subs r0, 0x5A - cmp r0, 0x4 - bhi _08196B84 - movs r0, 0x2 - b _08196B92 -_08196B84: - adds r0, r1, 0 - subs r0, 0x5F - cmp r0, 0x3 - bls _08196B90 - movs r0, 0x4 - b _08196B92 -_08196B90: - movs r0, 0x3 -_08196B92: - pop {r1} - bx r1 - thumb_func_end sub_8196B50 - - thumb_func_start sub_8196B98 -sub_8196B98: @ 8196B98 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r2, r0, 0 - mov r8, r1 - movs r3, 0 - ldr r0, =gWildMonHeaders - ldrb r1, [r0] - adds r7, r0, 0 - cmp r1, 0xFF - beq _08196C5C - ldr r1, =gUnknown_085500A4 - lsls r0, r2, 4 - adds r2, r0, r1 - ldrh r4, [r2, 0xA] - adds r1, r7, 0 -_08196BBA: - ldrb r0, [r1] - cmp r0, r4 - bne _08196BC8 - ldrb r0, [r1, 0x1] - ldrh r5, [r2, 0xC] - cmp r0, r5 - beq _08196BD2 -_08196BC8: - adds r1, 0x14 - adds r3, 0x1 - ldrb r0, [r1] - cmp r0, 0xFF - bne _08196BBA -_08196BD2: - adds r1, r7, 0 - lsls r0, r3, 2 - adds r0, r3 - lsls r5, r0, 2 - adds r0, r5, r1 - ldrb r0, [r0] - cmp r0, 0xFF - beq _08196C5C - movs r6, 0 - adds r0, r1, 0x4 - adds r0, r5, r0 - ldr r4, [r0] - cmp r4, 0 - beq _08196C02 - bl sub_8196AB8 - lsls r0, 24 - mov r2, sp - ldr r1, [r4, 0x4] - lsrs r0, 22 - adds r0, r1 - ldrh r0, [r0, 0x2] - strh r0, [r2] - movs r6, 0x1 -_08196C02: - adds r0, r7, 0 - adds r0, 0x8 - adds r0, r5, r0 - ldr r4, [r0] - cmp r4, 0 - beq _08196C26 - bl sub_8196B50 - lsls r0, 24 - lsls r1, r6, 1 - mov r3, sp - adds r2, r3, r1 - ldr r1, [r4, 0x4] - lsrs r0, 22 - adds r0, r1 - ldrh r0, [r0, 0x2] - strh r0, [r2] - adds r6, 0x1 -_08196C26: - cmp r6, 0 - beq _08196C5C - bl Random - lsls r0, 16 - lsrs r0, 16 - adds r1, r6, 0 - bl __modsi3 - lsls r0, 1 - add r0, sp - ldrh r1, [r0] - movs r0, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - mov r0, r8 - bl StringCopy - b _08196C62 - .pool -_08196C5C: - movs r0, 0xFF - mov r5, r8 - strb r0, [r5] -_08196C62: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8196B98 - - thumb_func_start sub_8196C70 -sub_8196C70: @ 8196C70 - push {r4-r7,lr} - adds r7, r1, 0 - ldr r2, =gUnknown_0860DEB8 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r1] - bl sub_80B2250 - lsls r0, 16 - lsrs r0, 16 - ldr r5, =gTrainers - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - adds r0, r5, 0 - adds r0, 0x24 - adds r0, r4, r0 - ldr r6, [r0] - bl Random - lsls r0, 16 - lsrs r0, 16 - adds r4, r5 - adds r1, r4, 0 - adds r1, 0x20 - ldrb r1, [r1] - bl __modsi3 - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r4] - cmp r1, 0x1 - beq _08196CD4 - cmp r1, 0x1 - ble _08196CC2 - cmp r1, 0x2 - beq _08196CD0 - cmp r1, 0x3 - beq _08196CD4 -_08196CC2: - lsls r0, 3 - b _08196CD6 - .pool -_08196CD0: - lsls r0, 3 - b _08196CD6 -_08196CD4: - lsls r0, 4 -_08196CD6: - adds r0, r6 - ldrh r1, [r0, 0x4] - movs r0, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - adds r0, r7, 0 - bl StringCopy - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8196C70 - - thumb_func_start sub_8196CF4 -sub_8196CF4: @ 8196CF4 - push {lr} - adds r0, r1, 0 - ldr r2, =gUnknown_0860EFF4 - ldr r1, =gUnknown_0203CD88 - ldrh r1, [r1] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl StringCopy - pop {r0} - bx r0 - .pool - thumb_func_end sub_8196CF4 - - thumb_func_start sub_8196D14 -sub_8196D14: @ 8196D14 - push {r4-r6,lr} - adds r5, r1, 0 - movs r4, 0 - ldr r0, =gUnknown_0203CD88 - ldrh r1, [r0, 0x2] - adds r6, r0, 0 - cmp r1, 0 - beq _08196D34 -_08196D24: - adds r0, r1, 0 - movs r1, 0xA - bl __divsi3 - adds r1, r0, 0 - adds r4, 0x1 - cmp r1, 0 - bne _08196D24 -_08196D34: - ldrh r1, [r6, 0x2] - lsls r3, r4, 24 - lsrs r3, 24 - adds r0, r5, 0 - movs r2, 0 - bl ConvertIntToDecimalStringN - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8196D14 - - thumb_func_start sub_8196D4C -sub_8196D4C: @ 8196D4C - push {r4,r5,lr} - movs r4, 0 - ldr r5, =gUnknown_0860F010 - b _08196D5C - .pool -_08196D58: - adds r5, 0x2 - adds r4, 0x1 -_08196D5C: - cmp r4, 0x7 - bhi _08196D6C - ldrh r0, [r5] - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _08196D58 -_08196D6C: - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8196D4C - - thumb_func_start sub_8196D74 -sub_8196D74: @ 8196D74 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r7, r0, 0 - bl sub_8196D4C - cmp r0, 0x4 - ble _08196DF4 - bl RtcGetLocalDayCount - adds r4, r0, 0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xA - bl sub_80842DC - adds r6, r0, 0 - ldr r0, =0x0000ffff - ands r6, r0 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00002e6a - adds r0, r1 - ldrh r5, [r0] - bl sub_8196748 - mov r9, r0 - movs r0, 0xD - mov r1, r9 - muls r1, r0 - adds r0, r1, 0 - movs r1, 0xA - bl __divsi3 - mov r8, r0 - movs r0, 0x9 - bl GetGameStat - eors r4, r5 - eors r5, r0 - adds r4, r5 - eors r4, r6 - adds r0, r4, 0 - mov r1, r8 - bl __modsi3 - cmp r0, r9 - bge _08196DF4 - bl sub_8196774 - cmp r0, r7 - bne _08196DF4 - movs r0, 0x1 - b _08196DF6 - .pool -_08196DF4: - movs r0, 0 -_08196DF6: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8196D74 - - thumb_func_start sub_8196E04 -sub_8196E04: @ 8196E04 - push {r4-r6,lr} - adds r5, r1, 0 - lsls r0, 16 - lsrs r0, 16 - movs r4, 0 - cmp r0, 0x6 - bls _08196E14 - b _08196F7E -_08196E14: - lsls r0, 2 - ldr r1, =_08196E24 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08196E24: - .4byte _08196E9C - .4byte _08196E40 - .4byte _08196ED0 - .4byte _08196F38 - .4byte _08196E74 - .4byte _08196F04 - .4byte _08196F60 -_08196E40: - movs r3, 0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000d14 - adds r0, r1 -_08196E4A: - lsls r1, r3, 2 - adds r3, 0x1 - adds r1, r0 - movs r2, 0x1 -_08196E52: - ldrh r6, [r1] - cmp r4, r6 - bcs _08196E5A - ldrh r4, [r1] -_08196E5A: - adds r1, 0x2 - subs r2, 0x1 - cmp r2, 0 - bge _08196E52 - cmp r3, 0x1 - ble _08196E4A - movs r0, 0x3 - b _08196F7C - .pool -_08196E74: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000e08 - adds r0, r1 - movs r3, 0x1 -_08196E7E: - ldrh r6, [r0] - cmp r4, r6 - bcs _08196E86 - ldrh r4, [r0] -_08196E86: - adds r0, 0x2 - subs r3, 0x1 - cmp r3, 0 - bge _08196E7E - movs r0, 0x4 - b _08196F7C - .pool -_08196E9C: - movs r3, 0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - movs r1, 0xCF - lsls r1, 4 - adds r0, r1 -_08196EA8: - lsls r1, r3, 2 - adds r3, 0x1 - adds r1, r0 - movs r2, 0x1 -_08196EB0: - ldrh r6, [r1] - cmp r4, r6 - bcs _08196EB8 - ldrh r4, [r1] -_08196EB8: - adds r1, 0x2 - subs r2, 0x1 - cmp r2, 0 - bge _08196EB0 - movs r2, 0x2 - cmp r3, 0x3 - ble _08196EA8 - str r2, [r5] - b _08196F7E - .pool -_08196ED0: - movs r3, 0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - movs r1, 0xDD - lsls r1, 4 - adds r0, r1 -_08196EDC: - lsls r1, r3, 2 - adds r3, 0x1 - adds r1, r0 - movs r2, 0x1 -_08196EE4: - ldrh r6, [r1] - cmp r4, r6 - bcs _08196EEC - ldrh r4, [r1] -_08196EEC: - adds r1, 0x2 - subs r2, 0x1 - cmp r2, 0 - bge _08196EE4 - movs r2, 0x2 - cmp r3, 0x1 - ble _08196EDC - str r2, [r5] - b _08196F7E - .pool -_08196F04: - movs r3, 0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000dea - adds r0, r1 -_08196F0E: - lsls r1, r3, 2 - adds r3, 0x1 - adds r1, r0 - movs r2, 0x1 -_08196F16: - ldrh r6, [r1] - cmp r4, r6 - bcs _08196F1E - ldrh r4, [r1] -_08196F1E: - adds r1, 0x2 - subs r2, 0x1 - cmp r2, 0 - bge _08196F16 - movs r2, 0x2 - cmp r3, 0x1 - ble _08196F0E - str r2, [r5] - b _08196F7E - .pool -_08196F38: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000dde - adds r0, r1 - movs r3, 0x1 -_08196F42: - ldrh r6, [r0] - cmp r4, r6 - bcs _08196F4A - ldrh r4, [r0] -_08196F4A: - adds r0, 0x2 - subs r3, 0x1 - cmp r3, 0 - bge _08196F42 - movs r3, 0x2 - str r3, [r5] - b _08196F7E - .pool -_08196F60: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000e1e - adds r0, r1 - movs r3, 0x1 -_08196F6A: - ldrh r6, [r0] - cmp r4, r6 - bcs _08196F72 - ldrh r4, [r0] -_08196F72: - adds r0, 0x2 - subs r3, 0x1 - cmp r3, 0 - bge _08196F6A - movs r0, 0x5 -_08196F7C: - str r0, [r5] -_08196F7E: - adds r0, r4, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8196E04 - - thumb_func_start sub_8196F90 -sub_8196F90: @ 8196F90 - push {r4,lr} - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x9 - bhi _08196F9E - movs r0, 0 - b _0819707A -_08196F9E: - cmp r4, 0x13 - bhi _08196FA6 - movs r0, 0x1 - b _0819707A -_08196FA6: - cmp r4, 0x1D - bhi _08196FAE - movs r0, 0x2 - b _0819707A -_08196FAE: - cmp r4, 0x27 - bhi _08196FB6 - movs r0, 0x3 - b _0819707A -_08196FB6: - cmp r4, 0x31 - bhi _08196FBE - movs r0, 0x4 - b _0819707A -_08196FBE: - cmp r4, 0x3B - bhi _08196FC6 - movs r0, 0x5 - b _0819707A -_08196FC6: - cmp r4, 0x45 - bhi _08196FCE - movs r0, 0x6 - b _0819707A -_08196FCE: - cmp r4, 0x4F - bhi _08196FD6 - movs r0, 0x7 - b _0819707A -_08196FD6: - cmp r4, 0x59 - bhi _08196FDE - movs r0, 0x8 - b _0819707A -_08196FDE: - cmp r4, 0x63 - bhi _08196FE6 - movs r0, 0x9 - b _0819707A -_08196FE6: - cmp r4, 0x6D - bhi _08196FEE - movs r0, 0xA - b _0819707A -_08196FEE: - cmp r4, 0x77 - bhi _08196FF6 - movs r0, 0xB - b _0819707A -_08196FF6: - cmp r4, 0x81 - bhi _08196FFE - movs r0, 0xC - b _0819707A -_08196FFE: - cmp r4, 0x8B - bhi _08197006 - movs r0, 0xD - b _0819707A -_08197006: - cmp r4, 0x95 - bhi _0819700E - movs r0, 0xE - b _0819707A -_0819700E: - cmp r4, 0x9F - bhi _08197016 - movs r0, 0xF - b _0819707A -_08197016: - cmp r4, 0xA9 - bhi _0819701E - movs r0, 0x10 - b _0819707A -_0819701E: - cmp r4, 0xB3 - bhi _08197026 - movs r0, 0x11 - b _0819707A -_08197026: - cmp r4, 0xBD - bhi _0819702E - movs r0, 0x12 - b _0819707A -_0819702E: - cmp r4, 0xC7 - bls _08197078 - movs r0, 0xCD - lsls r0, 1 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - bl pokedex_flag_operation - lsls r0, 24 - cmp r0, 0 - beq _08197050 - subs r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 -_08197050: - ldr r0, =0x00000199 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - bl pokedex_flag_operation - lsls r0, 24 - cmp r0, 0 - beq _0819706C - subs r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 -_0819706C: - cmp r4, 0xC7 - bls _08197078 - movs r0, 0x14 - b _0819707A - .pool -_08197078: - movs r0, 0x13 -_0819707A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8196F90 - - thumb_func_start sub_8197080 -sub_8197080: @ 8197080 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r8, r0 - movs r0, 0xFA - lsls r0, 2 - bl Alloc - adds r7, r0, 0 - cmp r7, 0 - bne _081970A2 - movs r0, 0xFF - mov r1, r8 - strb r0, [r1] - b _0819715C -_081970A2: - movs r0, 0 - bl sub_80C0844 - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0x1 - bl sub_80C0844 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, =gStringVar1 - mov r10, r0 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r1, =gStringVar2 - mov r9, r1 - mov r0, r9 - adds r1, r6, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - adds r0, r6, 0 - bl sub_8196F90 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =gUnknown_082A5C9C - adds r0, r7, 0 - bl StringCopy - adds r5, r0, 0 - movs r6, 0xFB - strb r6, [r5] - adds r5, 0x1 - ldr r1, =gUnknown_082A5D2C - adds r0, r5, 0 - bl StringCopy - adds r5, r0, 0 - strb r6, [r5] - adds r5, 0x1 - ldr r0, =gUnknown_0860F020 - lsls r4, 2 - adds r4, r0 - ldr r1, [r4] - adds r0, r5, 0 - bl StringCopy - mov r0, r8 - adds r1, r7, 0 - bl StringExpandPlaceholders - adds r5, r0, 0 - bl IsNationalPokedexEnabled - cmp r0, 0 - beq _08197156 - strb r6, [r5] - adds r5, 0x1 - movs r0, 0 - bl pokedex_count - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0x1 - bl pokedex_count - lsls r0, 16 - lsrs r6, r0, 16 - mov r0, r10 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - mov r0, r9 - adds r1, r6, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r1, =gUnknown_082A633D - adds r0, r5, 0 - bl StringExpandPlaceholders -_08197156: - adds r0, r7, 0 - bl Free -_0819715C: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8197080 - - thumb_func_start sub_8197184 -sub_8197184: @ 8197184 - push {r4,r5,lr} - adds r4, r1, 0 - adds r5, r2, 0 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl GetWindowAttribute - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0860EA6C - movs r2, 0x80 - lsls r2, 1 - lsls r4, 16 - lsrs r4, 16 - adds r3, r4, 0 - bl LoadBgTiles - ldr r0, =gUnknown_0860EA4C - lsls r5, 20 - lsrs r5, 16 - adds r1, r5, 0 - movs r2, 0x20 - bl LoadPalette - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8197184 - - thumb_func_start sub_81971C4 -sub_81971C4: @ 81971C4 - push {lr} - bl sub_819645C - pop {r0} - bx r0 - thumb_func_end sub_81971C4 - - thumb_func_start sub_81971D0 -sub_81971D0: @ 81971D0 - push {lr} - ldr r0, =gUnknown_0860F098 - bl InitWindows - ldr r0, =gUnknown_0203CD8C - movs r1, 0xFF - strb r1, [r0] - ldr r0, =gUnknown_0203CD8D - strb r1, [r0] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81971D0 - - thumb_func_start sub_81971F4 -sub_81971F4: @ 81971F4 - push {lr} - bl FreeAllWindowBuffers - pop {r0} - bx r0 - thumb_func_end sub_81971F4 - - thumb_func_start sub_8197200 -sub_8197200: @ 8197200 - push {lr} - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - bl DeactivateAllTextPrinters - bl sub_81973A4 - pop {r0} - bx r0 - thumb_func_end sub_8197200 - - thumb_func_start sub_8197224 -sub_8197224: @ 8197224 - push {lr} - bl RunTextPrinters - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - thumb_func_end sub_8197224 - - 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} - sub sp, 0x10 - ldr r7, [sp, 0x28] - ldr r4, [sp, 0x2C] - mov r8, r4 - ldr r5, [sp, 0x30] - ldr r6, [sp, 0x34] - lsls r3, 24 - lsrs r3, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - str r2, [sp] - mov r2, sp - movs r4, 0 - strb r0, [r2, 0x4] - mov r0, sp - strb r1, [r0, 0x5] - strb r4, [r0, 0x6] - movs r1, 0x1 - strb r1, [r0, 0x7] - strb r4, [r0, 0x8] - strb r1, [r0, 0x9] - strb r4, [r0, 0xA] - strb r4, [r0, 0xB] - mov r4, sp - ldrb r2, [r4, 0xC] - subs r1, 0x11 - adds r0, r1, 0 - ands r0, r2 - strb r0, [r4, 0xC] - mov r0, sp - mov r2, r8 - lsls r2, 4 - movs r4, 0xF - strb r2, [r0, 0xC] - mov r2, sp - ands r5, r4 - ldrb r0, [r2, 0xD] - ands r1, r0 - orrs r1, r5 - strb r1, [r2, 0xD] - mov r0, sp - lsrs r6, 20 - ands r1, r4 - orrs r1, r6 - strb r1, [r0, 0xD] - ldr r2, =gTextFlags - ldrb r1, [r2] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - mov r0, sp - adds r1, r3, 0 - adds r2, r7, 0 - bl AddTextPrinter - lsls r0, 16 - lsrs r0, 16 - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end AddTextPrinterParametrized - - thumb_func_start AddTextPrinterForMessage -@ void AddTextPrinterForMessage(u8 allowSkippingDelayWithButtonPress) -AddTextPrinterForMessage: @ 81972C4 - push {r4,r5,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - movs r5, 0 - ldr r3, =gTextFlags - movs r4, 0x1 - ands r0, r4 - ldrb r2, [r3] - movs r1, 0x2 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3] - bl sav2_get_text_speed - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - ldr r2, =gStringVar4 - str r5, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x3 - str r0, [sp, 0xC] - movs r0, 0 - movs r1, 0x1 - bl AddTextPrinterParametrized - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end AddTextPrinterForMessage - - thumb_func_start AddTextPrinterForMessage_2 -@ void AddTextPrinterForMessage_2(u8 allowSkippingDelayWithButtonPress) -AddTextPrinterForMessage_2: @ 8197310 - push {r4,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - ldr r3, =gTextFlags - movs r4, 0x1 - ands r0, r4 - ldrb r2, [r3] - movs r1, 0x2 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3] - bl sav2_get_text_speed - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - ldr r2, =gStringVar4 - movs r0, 0 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x3 - str r0, [sp, 0xC] - movs r0, 0 - movs r1, 0x1 - bl AddTextPrinterParametrized - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end AddTextPrinterForMessage_2 - - thumb_func_start AddTextPrinterWithCustomSpeedForMessage -@ void AddTextPrinterWithCustomSpeedForMessage(u8 allowSkippingDelayWithButtonPress, u8 speed) -AddTextPrinterWithCustomSpeedForMessage: @ 819735C - push {r4,r5,lr} - sub sp, 0x10 - adds r3, r1, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r3, 24 - lsrs r3, 24 - ldr r4, =gTextFlags - movs r5, 0x1 - ands r0, r5 - ldrb r2, [r4] - movs r1, 0x2 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r4] - ldr r2, =gStringVar4 - movs r0, 0 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x3 - str r0, [sp, 0xC] - movs r0, 0 - movs r1, 0x1 - bl AddTextPrinterParametrized - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end AddTextPrinterWithCustomSpeedForMessage - - thumb_func_start sub_81973A4 -sub_81973A4: @ 81973A4 - push {lr} - movs r1, 0x80 - lsls r1, 2 - movs r0, 0 - movs r2, 0xF0 - bl copy_textbox_border_tile_patterns_to_vram - movs r1, 0x85 - lsls r1, 2 - movs r0, 0 - movs r2, 0xE0 - bl sub_809882C - pop {r0} - bx r0 - thumb_func_end sub_81973A4 - - thumb_func_start sub_81973C4 -sub_81973C4: @ 81973C4 - push {r4,r5,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =sub_81975F4 - adds r0, r5, 0 - bl CallWindowFunction - adds r0, r5, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - adds r0, r5, 0 - bl PutWindowTilemap - cmp r4, 0x1 - bne _081973F2 - adds r0, r5, 0 - movs r1, 0x3 - bl CopyWindowToVram -_081973F2: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81973C4 - - thumb_func_start sub_81973FC -sub_81973FC: @ 81973FC - push {r4,r5,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =sub_81974A4 - adds r0, r5, 0 - bl CallWindowFunction - adds r0, r5, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - adds r0, r5, 0 - bl PutWindowTilemap - cmp r4, 0x1 - bne _0819742A - adds r0, r5, 0 - movs r1, 0x3 - bl CopyWindowToVram -_0819742A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81973FC - - thumb_func_start sub_8197434 -sub_8197434: @ 8197434 - push {r4,r5,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =sub_8197804 - adds r0, r5, 0 - bl CallWindowFunction - adds r0, r5, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - adds r0, r5, 0 - bl ClearWindowTilemap - cmp r4, 0x1 - bne _08197462 - adds r0, r5, 0 - movs r1, 0x3 - bl CopyWindowToVram -_08197462: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8197434 - - thumb_func_start sub_819746C -sub_819746C: @ 819746C - push {r4,r5,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =sub_81977BC - adds r0, r5, 0 - bl CallWindowFunction - adds r0, r5, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - adds r0, r5, 0 - bl ClearWindowTilemap - cmp r4, 0x1 - bne _0819749A - adds r0, r5, 0 - movs r1, 0x3 - bl CopyWindowToVram -_0819749A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819746C - - thumb_func_start sub_81974A4 -sub_81974A4: @ 81974A4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - adds r4, r2, 0 - ldr r2, [sp, 0x3C] - lsls r0, 24 - lsrs r7, r0, 24 - lsls r1, 24 - lsls r4, 24 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x10] - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x14] - movs r3, 0x85 - lsls r3, 2 - lsrs r0, r1, 24 - str r0, [sp, 0xC] - movs r2, 0xFF - lsls r2, 24 - adds r2, r1 - mov r8, r2 - lsrs r2, 24 - lsrs r0, r4, 24 - mov r9, r0 - movs r0, 0xFF - lsls r0, 24 - adds r4, r0 - lsrs r4, 24 - movs r5, 0x1 - str r5, [sp] - str r5, [sp, 0x4] - movs r6, 0xE - str r6, [sp, 0x8] - adds r0, r7, 0 - adds r1, r3, 0 - adds r3, r4, 0 - bl FillBgTilemapBufferRect - ldr r1, =0x00000215 - ldr r2, [sp, 0x10] - str r2, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - adds r0, r7, 0 - ldr r2, [sp, 0xC] - adds r3, r4, 0 - bl FillBgTilemapBufferRect - ldr r1, =0x00000216 - ldr r3, [sp, 0xC] - ldr r2, [sp, 0x10] - adds r0, r3, r2 - lsls r0, 24 - mov r10, r0 - lsrs r2, r0, 24 - str r5, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - adds r0, r7, 0 - adds r3, r4, 0 - bl FillBgTilemapBufferRect - mov r5, r9 - ldr r0, [sp, 0x14] - add r0, r9 - cmp r9, r0 - bge _08197578 - mov r3, r8 - str r3, [sp, 0x18] - movs r6, 0x1 - movs r0, 0xE - mov r8, r0 -_0819753E: - lsls r4, r5, 24 - lsrs r4, 24 - str r6, [sp] - str r6, [sp, 0x4] - mov r2, r8 - str r2, [sp, 0x8] - adds r0, r7, 0 - ldr r1, =0x00000217 - ldr r3, [sp, 0x18] - lsrs r2, r3, 24 - adds r3, r4, 0 - bl FillBgTilemapBufferRect - str r6, [sp] - str r6, [sp, 0x4] - mov r0, r8 - str r0, [sp, 0x8] - adds r0, r7, 0 - ldr r1, =0x00000219 - mov r3, r10 - lsrs r2, r3, 24 - adds r3, r4, 0 - bl FillBgTilemapBufferRect - adds r5, 0x1 - ldr r0, [sp, 0x14] - add r0, r9 - cmp r5, r0 - blt _0819753E -_08197578: - ldr r1, =0x0000021a - ldr r2, [sp, 0xC] - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - ldr r4, [sp, 0x14] - add r4, r9 - lsls r4, 24 - lsrs r4, 24 - movs r5, 0x1 - str r5, [sp] - str r5, [sp, 0x4] - movs r6, 0xE - str r6, [sp, 0x8] - adds r0, r7, 0 - adds r3, r4, 0 - bl FillBgTilemapBufferRect - ldr r1, =0x0000021b - ldr r0, [sp, 0x10] - str r0, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - adds r0, r7, 0 - ldr r2, [sp, 0xC] - adds r3, r4, 0 - bl FillBgTilemapBufferRect - movs r1, 0x87 - lsls r1, 2 - ldr r3, [sp, 0xC] - ldr r0, [sp, 0x10] - adds r2, r3, r0 - lsls r2, 24 - lsrs r2, 24 - str r5, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - adds r0, r7, 0 - adds r3, r4, 0 - bl FillBgTilemapBufferRect - add sp, 0x1C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81974A4 - - thumb_func_start sub_81975F4 -sub_81975F4: @ 81975F4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - adds r6, r0, 0 - adds r5, r2, 0 - mov r8, r3 - ldr r2, [sp, 0x44] - lsls r6, 24 - lsrs r6, 24 - lsls r0, r1, 24 - lsls r5, 24 - mov r1, r8 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - lsls r1, r2, 24 - lsrs r1, 24 - str r1, [sp, 0x10] - ldr r1, =0x00000201 - lsrs r2, r0, 24 - str r2, [sp, 0xC] - movs r3, 0xFE - lsls r3, 24 - adds r2, r0, r3 - lsrs r2, 24 - str r2, [sp, 0x14] - lsrs r0, r5, 24 - mov r10, r0 - movs r2, 0xFF - lsls r2, 24 - adds r5, r2 - lsrs r5, 24 - movs r4, 0x1 - str r4, [sp] - str r4, [sp, 0x4] - movs r3, 0xF - mov r9, r3 - str r3, [sp, 0x8] - adds r0, r6, 0 - ldr r2, [sp, 0x14] - adds r3, r5, 0 - bl FillBgTilemapBufferRect - ldr r1, =0x00000203 - ldr r0, [sp, 0xC] - subs r0, 0x1 - lsls r2, r0, 24 - lsrs r2, 24 - str r2, [sp, 0x18] - str r4, [sp] - str r4, [sp, 0x4] - mov r0, r9 - str r0, [sp, 0x8] - adds r0, r6, 0 - adds r3, r5, 0 - bl FillBgTilemapBufferRect - movs r1, 0x81 - lsls r1, 2 - mov r0, r8 - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x1C] - str r0, [sp] - str r4, [sp, 0x4] - mov r2, r9 - str r2, [sp, 0x8] - adds r0, r6, 0 - ldr r2, [sp, 0xC] - adds r3, r5, 0 - bl FillBgTilemapBufferRect - ldr r1, =0x00000205 - ldr r7, [sp, 0xC] - add r7, r8 - subs r0, r7, 0x1 - lsls r2, r0, 24 - lsrs r2, 24 - str r2, [sp, 0x20] - str r4, [sp] - str r4, [sp, 0x4] - mov r3, r9 - str r3, [sp, 0x8] - adds r0, r6, 0 - adds r3, r5, 0 - bl FillBgTilemapBufferRect - ldr r1, =0x00000206 - lsls r2, r7, 24 - lsrs r7, r2, 24 - str r4, [sp] - str r4, [sp, 0x4] - mov r0, r9 - str r0, [sp, 0x8] - adds r0, r6, 0 - adds r2, r7, 0 - adds r3, r5, 0 - bl FillBgTilemapBufferRect - ldr r1, =0x00000207 - str r4, [sp] - movs r5, 0x5 - str r5, [sp, 0x4] - mov r2, r9 - str r2, [sp, 0x8] - adds r0, r6, 0 - ldr r2, [sp, 0x14] - mov r3, r10 - bl FillBgTilemapBufferRect - ldr r1, =0x00000209 - add r8, r4 - mov r3, r8 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp] - str r5, [sp, 0x4] - mov r0, r9 - str r0, [sp, 0x8] - adds r0, r6, 0 - ldr r2, [sp, 0x18] - mov r3, r10 - bl FillBgTilemapBufferRect - ldr r1, =0x0000020a - str r4, [sp] - str r5, [sp, 0x4] - mov r2, r9 - str r2, [sp, 0x8] - adds r0, r6, 0 - adds r2, r7, 0 - mov r3, r10 - bl FillBgTilemapBufferRect - ldr r1, =0x00000a01 - ldr r3, [sp, 0x10] - add r10, r3 - mov r0, r10 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - str r4, [sp] - str r4, [sp, 0x4] - mov r2, r9 - str r2, [sp, 0x8] - adds r0, r6, 0 - ldr r2, [sp, 0x14] - mov r3, r10 - bl FillBgTilemapBufferRect - ldr r1, =0x00000a03 - str r4, [sp] - str r4, [sp, 0x4] - mov r3, r9 - str r3, [sp, 0x8] - adds r0, r6, 0 - ldr r2, [sp, 0x18] - mov r3, r10 - bl FillBgTilemapBufferRect - ldr r1, =0x00000a04 - ldr r0, [sp, 0x1C] - str r0, [sp] - str r4, [sp, 0x4] - mov r2, r9 - str r2, [sp, 0x8] - adds r0, r6, 0 - ldr r2, [sp, 0xC] - mov r3, r10 - bl FillBgTilemapBufferRect - ldr r1, =0x00000a05 - str r4, [sp] - str r4, [sp, 0x4] - mov r3, r9 - str r3, [sp, 0x8] - adds r0, r6, 0 - ldr r2, [sp, 0x20] - mov r3, r10 - bl FillBgTilemapBufferRect - ldr r1, =0x00000a06 - str r4, [sp] - str r4, [sp, 0x4] - mov r0, r9 - str r0, [sp, 0x8] - adds r0, r6, 0 - adds r2, r7, 0 - mov r3, r10 - bl FillBgTilemapBufferRect - add sp, 0x24 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81975F4 - - thumb_func_start sub_81977BC -sub_81977BC: @ 81977BC - push {r4,r5,lr} - sub sp, 0xC - adds r4, r1, 0 - adds r5, r2, 0 - ldr r1, [sp, 0x18] - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsls r5, 24 - lsls r3, 24 - lsls r1, 24 - movs r2, 0xFF - lsls r2, 24 - adds r4, r2 - lsrs r4, 24 - adds r5, r2 - lsrs r5, 24 - movs r2, 0x80 - lsls r2, 18 - adds r3, r2 - lsrs r3, 24 - str r3, [sp] - adds r1, r2 - lsrs r1, 24 - str r1, [sp, 0x4] - movs r1, 0xE - str r1, [sp, 0x8] - movs r1, 0 - adds r2, r4, 0 - adds r3, r5, 0 - bl FillBgTilemapBufferRect - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81977BC - - thumb_func_start sub_8197804 -sub_8197804: @ 8197804 - push {r4,r5,lr} - sub sp, 0xC - adds r4, r1, 0 - adds r5, r2, 0 - ldr r1, [sp, 0x18] - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsls r5, 24 - lsls r3, 24 - lsls r1, 24 - movs r2, 0xFD - lsls r2, 24 - adds r4, r2 - lsrs r4, 24 - movs r2, 0xFF - lsls r2, 24 - adds r5, r2 - lsrs r5, 24 - movs r2, 0xC0 - lsls r2, 19 - adds r3, r2 - lsrs r3, 24 - str r3, [sp] - movs r2, 0x80 - lsls r2, 18 - adds r1, r2 - lsrs r1, 24 - str r1, [sp, 0x4] - movs r1, 0xE - str r1, [sp, 0x8] - movs r1, 0 - adds r2, r4, 0 - adds r3, r5, 0 - bl FillBgTilemapBufferRect - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8197804 - - thumb_func_start SetStandardWindowBorderStyle -@ void SetStandardWindowBorderStyle(u8 windowId, bool copyToVram) -SetStandardWindowBorderStyle: @ 8197854 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - movs r2, 0x85 - lsls r2, 2 - movs r3, 0xE - bl SetWindowBorderStyle - pop {r0} - bx r0 - thumb_func_end SetStandardWindowBorderStyle - - thumb_func_start sub_819786C -sub_819786C: @ 819786C - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - movs r6, 0x80 - lsls r6, 2 - adds r0, r4, 0 - adds r1, r6, 0 - movs r2, 0xF0 - bl copy_textbox_border_tile_patterns_to_vram - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - movs r3, 0xF - bl sub_8197B1C - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_819786C - - thumb_func_start sub_819789C -sub_819789C: @ 819789C - push {lr} - ldr r0, =gUnknown_0860F074 - movs r1, 0xE0 - movs r2, 0x14 - bl LoadPalette - pop {r0} - bx r0 - .pool - thumb_func_end sub_819789C - - thumb_func_start sub_81978B0 -sub_81978B0: @ 81978B0 - push {lr} - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - ldr r0, =gUnknown_0860F074 - movs r2, 0x14 - bl LoadPalette - pop {r0} - bx r0 - .pool - thumb_func_end sub_81978B0 - - thumb_func_start sub_81978C8 -sub_81978C8: @ 81978C8 - ldr r0, =gUnknown_0860F074 - bx lr - .pool - thumb_func_end sub_81978C8 - - thumb_func_start sub_81978D0 -sub_81978D0: @ 81978D0 - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xF - bls _081978DC - movs r1, 0 -_081978DC: - ldr r0, =gUnknown_0860F074 - lsls r1, 1 - adds r1, r0 - ldrh r0, [r1] - pop {r1} - bx r1 - .pool - thumb_func_end sub_81978D0 - - 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 - adds r5, r1, 0 - adds r6, r2, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_81973A4 - bl sav2_get_text_speed - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x80 - lsls r2, 2 - movs r1, 0x1 - str r1, [sp] - str r0, [sp, 0x4] - str r5, [sp, 0x8] - str r6, [sp, 0xC] - adds r0, r4, 0 - movs r1, 0 - movs r3, 0xF - bl DisplayMessageAndContinueTask - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end DisplayItemMessageOnField - - thumb_func_start sub_8197930 -sub_8197930: @ 8197930 - push {lr} - ldr r0, =gUnknown_0860F0A8 - movs r1, 0x85 - lsls r1, 2 - movs r2, 0xE - movs r3, 0 - bl CreateYesNoMenu - pop {r0} - bx r0 - .pool - thumb_func_end sub_8197930 - - thumb_func_start sub_8197948 -sub_8197948: @ 8197948 - push {lr} - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =gUnknown_0860F0A8 - movs r1, 0x85 - lsls r1, 2 - movs r2, 0xE - bl CreateYesNoMenu - pop {r0} - bx r0 - .pool - thumb_func_end sub_8197948 - - thumb_func_start sub_8197964 -sub_8197964: @ 8197964 - push {lr} - ldr r0, =gTextFlags - ldrb r1, [r0] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - bne _08197988 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldrb r0, [r0, 0x14] - lsls r0, 29 - lsrs r0, 29 - b _0819798A - .pool -_08197988: - movs r0, 0x1 -_0819798A: - pop {r1} - bx r1 - thumb_func_end sub_8197964 - - thumb_func_start sav2_get_text_speed -sav2_get_text_speed: @ 8197990 - push {lr} - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldrb r1, [r2, 0x14] - lsls r0, r1, 29 - lsrs r0, 29 - cmp r0, 0x2 - bls _081979AC - movs r0, 0x8 - negs r0, r0 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x14] -_081979AC: - bl sub_8197964 - ldr r1, =gUnknown_0860F094 - adds r0, r1 - ldrb r0, [r0] - pop {r1} - bx r1 - .pool - thumb_func_end sav2_get_text_speed - - thumb_func_start sub_81979C4 -sub_81979C4: @ 81979C4 - push {r4,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r1, r0, 24 - ldr r4, =gUnknown_0203CD8C - ldrb r0, [r4] - cmp r0, 0xFF - bne _081979F6 - lsls r0, r1, 25 - movs r1, 0x80 - lsls r1, 18 - adds r0, r1 - lsrs r0, 24 - str r0, [sp] - movs r0, 0xF - str r0, [sp, 0x4] - ldr r0, =0x00000139 - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0x16 - movs r2, 0x1 - movs r3, 0x7 - bl sub_8198AA4 - strb r0, [r4] -_081979F6: - ldrb r0, [r4] - add sp, 0xC - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81979C4 - - thumb_func_start get_start_menu_window_id_maybe -get_start_menu_window_id_maybe: @ 8197A08 - ldr r0, =gUnknown_0203CD8C - ldrb r0, [r0] - bx lr - .pool - thumb_func_end get_start_menu_window_id_maybe - - thumb_func_start remove_start_menu_window_maybe -remove_start_menu_window_maybe: @ 8197A14 - push {r4,lr} - ldr r4, =gUnknown_0203CD8C - ldrb r0, [r4] - cmp r0, 0xFF - beq _08197A26 - bl RemoveWindow - movs r0, 0xFF - strb r0, [r4] -_08197A26: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end remove_start_menu_window_maybe - - thumb_func_start sub_8197A30 -sub_8197A30: @ 8197A30 - movs r0, 0x80 - lsls r0, 2 - bx lr - thumb_func_end sub_8197A30 - - thumb_func_start sub_8197A38 -sub_8197A38: @ 8197A38 - movs r0, 0x85 - lsls r0, 2 - bx lr - thumb_func_end sub_8197A38 - - thumb_func_start AddMapNamePopUpWindow -AddMapNamePopUpWindow: @ 8197A40 - push {r4,lr} - sub sp, 0xC - ldr r4, =gUnknown_0203CD8D - ldrb r0, [r4] - cmp r0, 0xFF - bne _08197A66 - movs r0, 0x3 - str r0, [sp] - movs r0, 0xE - str r0, [sp, 0x4] - adds r0, 0xF9 - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r2, 0x1 - movs r3, 0xA - bl sub_8198AA4 - strb r0, [r4] -_08197A66: - ldrb r0, [r4] - add sp, 0xC - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end AddMapNamePopUpWindow - - thumb_func_start GetMapNamePopUpWindowId -GetMapNamePopUpWindowId: @ 8197A74 - ldr r0, =gUnknown_0203CD8D - ldrb r0, [r0] - bx lr - .pool - thumb_func_end GetMapNamePopUpWindowId - - thumb_func_start RemoveMapNamePopUpWindow -RemoveMapNamePopUpWindow: @ 8197A80 - push {r4,lr} - ldr r4, =gUnknown_0203CD8D - ldrb r0, [r4] - cmp r0, 0xFF - beq _08197A92 - bl RemoveWindow - movs r0, 0xFF - strb r0, [r4] -_08197A92: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end RemoveMapNamePopUpWindow - - 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 - lsls r0, 24 - lsrs r0, 24 - ldr r3, =gTextFlags - movs r4, 0x1 - ands r0, r4 - ldrb r2, [r3] - movs r1, 0x2 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3] - bl sav2_get_text_speed - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - ldr r2, =gStringVar4 - str r5, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x3 - str r0, [sp, 0xC] - movs r0, 0 - movs r1, 0x1 - bl AddTextPrinterParametrized - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end AddTextPrinterWithCallbackForMessage - - thumb_func_start sub_8197AE8 -sub_8197AE8: @ 8197AE8 - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x20 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect - cmp r4, 0x1 - bne _08197B12 - movs r0, 0 - bl CopyBgTilemapBufferToVram -_08197B12: - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8197AE8 - - thumb_func_start sub_8197B1C -sub_8197B1C: @ 8197B1C - push {r4,r5,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_0203CD9C - strh r2, [r0] - ldr r0, =gUnknown_0203CD9E - strb r3, [r0] - ldr r1, =sub_8197BB4 - adds r0, r5, 0 - bl CallWindowFunction - adds r0, r5, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - adds r0, r5, 0 - bl PutWindowTilemap - cmp r4, 0x1 - bne _08197B52 - adds r0, r5, 0 - movs r1, 0x3 - bl CopyWindowToVram -_08197B52: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8197B1C - - thumb_func_start sub_8197B64 -sub_8197B64: @ 8197B64 - push {r4-r6,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_0203CD9C - strh r2, [r0] - ldr r5, =gUnknown_0203CD9E - adds r0, r6, 0 - movs r1, 0x5 - bl GetWindowAttribute - strb r0, [r5] - ldr r1, =sub_8197BB4 - adds r0, r6, 0 - bl CallWindowFunction - adds r0, r6, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - adds r0, r6, 0 - bl PutWindowTilemap - cmp r4, 0x1 - bne _08197BA2 - adds r0, r6, 0 - movs r1, 0x3 - bl CopyWindowToVram -_08197BA2: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8197B64 - - thumb_func_start sub_8197BB4 -sub_8197BB4: @ 8197BB4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - mov r8, r0 - adds r5, r2, 0 - adds r6, r3, 0 - ldr r2, [sp, 0x44] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r0, r1, 24 - lsls r5, 24 - lsls r6, 24 - lsrs r6, 24 - lsls r1, r2, 24 - lsrs r1, 24 - str r1, [sp, 0x10] - ldr r2, =gUnknown_0203CD9C - ldrh r1, [r2] - adds r1, 0x1 - lsls r1, 16 - lsrs r1, 16 - lsrs r3, r0, 24 - str r3, [sp, 0xC] - movs r3, 0xFE - lsls r3, 24 - adds r2, r0, r3 - lsrs r2, 24 - str r2, [sp, 0x14] - lsrs r0, r5, 24 - mov r9, r0 - movs r2, 0xFF - lsls r2, 24 - adds r5, r2 - lsrs r5, 24 - movs r4, 0x1 - str r4, [sp] - str r4, [sp, 0x4] - ldr r3, =gUnknown_0203CD9E - mov r10, r3 - ldrb r0, [r3] - str r0, [sp, 0x8] - mov r0, r8 - ldr r2, [sp, 0x14] - adds r3, r5, 0 - bl FillBgTilemapBufferRect - ldr r0, =gUnknown_0203CD9C - ldrh r1, [r0] - adds r1, 0x3 - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0xC] - subs r0, 0x1 - lsls r2, r0, 24 - lsrs r2, 24 - str r2, [sp, 0x18] - str r4, [sp] - str r4, [sp, 0x4] - mov r2, r10 - ldrb r0, [r2] - str r0, [sp, 0x8] - mov r0, r8 - ldr r2, [sp, 0x18] - adds r3, r5, 0 - bl FillBgTilemapBufferRect - ldr r3, =gUnknown_0203CD9C - ldrh r1, [r3] - adds r1, 0x4 - lsls r1, 16 - lsrs r1, 16 - subs r0, r6, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x1C] - str r0, [sp] - str r4, [sp, 0x4] - mov r2, r10 - ldrb r0, [r2] - str r0, [sp, 0x8] - mov r0, r8 - ldr r2, [sp, 0xC] - adds r3, r5, 0 - bl FillBgTilemapBufferRect - ldr r3, =gUnknown_0203CD9C - ldrh r1, [r3] - adds r1, 0x5 - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0xC] - adds r7, r0, r6 - subs r0, r7, 0x1 - lsls r2, r0, 24 - lsrs r2, 24 - str r2, [sp, 0x20] - str r4, [sp] - str r4, [sp, 0x4] - mov r2, r10 - ldrb r0, [r2] - str r0, [sp, 0x8] - mov r0, r8 - ldr r2, [sp, 0x20] - adds r3, r5, 0 - bl FillBgTilemapBufferRect - ldr r3, =gUnknown_0203CD9C - ldrh r1, [r3] - adds r1, 0x6 - lsls r1, 16 - lsrs r1, 16 - lsls r2, r7, 24 - lsrs r7, r2, 24 - str r4, [sp] - str r4, [sp, 0x4] - mov r2, r10 - ldrb r0, [r2] - str r0, [sp, 0x8] - mov r0, r8 - adds r2, r7, 0 - adds r3, r5, 0 - bl FillBgTilemapBufferRect - ldr r3, =gUnknown_0203CD9C - ldrh r1, [r3] - adds r1, 0x7 - lsls r1, 16 - lsrs r1, 16 - str r4, [sp] - movs r5, 0x5 - str r5, [sp, 0x4] - mov r2, r10 - ldrb r0, [r2] - str r0, [sp, 0x8] - mov r0, r8 - ldr r2, [sp, 0x14] - mov r3, r9 - bl FillBgTilemapBufferRect - ldr r3, =gUnknown_0203CD9C - ldrh r1, [r3] - adds r1, 0x9 - lsls r1, 16 - lsrs r1, 16 - adds r6, 0x1 - lsls r6, 24 - lsrs r6, 24 - str r6, [sp] - str r5, [sp, 0x4] - mov r2, r10 - ldrb r0, [r2] - str r0, [sp, 0x8] - mov r0, r8 - ldr r2, [sp, 0x18] - mov r3, r9 - bl FillBgTilemapBufferRect - ldr r3, =gUnknown_0203CD9C - ldrh r1, [r3] - adds r1, 0xA - lsls r1, 16 - lsrs r1, 16 - str r4, [sp] - str r5, [sp, 0x4] - mov r2, r10 - ldrb r0, [r2] - str r0, [sp, 0x8] - mov r0, r8 - adds r2, r7, 0 - mov r3, r9 - bl FillBgTilemapBufferRect - ldr r3, =0x00000801 - adds r1, r3, 0 - ldr r0, =gUnknown_0203CD9C - ldrh r0, [r0] - adds r1, r0 - lsls r1, 16 - lsrs r1, 16 - ldr r2, [sp, 0x10] - add r9, r2 - mov r3, r9 - lsls r3, 24 - lsrs r3, 24 - mov r9, r3 - str r4, [sp] - str r4, [sp, 0x4] - mov r2, r10 - ldrb r0, [r2] - str r0, [sp, 0x8] - mov r0, r8 - ldr r2, [sp, 0x14] - bl FillBgTilemapBufferRect - ldr r3, =0x00000803 - adds r1, r3, 0 - ldr r0, =gUnknown_0203CD9C - ldrh r0, [r0] - adds r1, r0 - lsls r1, 16 - lsrs r1, 16 - str r4, [sp] - str r4, [sp, 0x4] - mov r2, r10 - ldrb r0, [r2] - str r0, [sp, 0x8] - mov r0, r8 - ldr r2, [sp, 0x18] - mov r3, r9 - bl FillBgTilemapBufferRect - ldr r3, =0x00000804 - adds r1, r3, 0 - ldr r0, =gUnknown_0203CD9C - ldrh r0, [r0] - adds r1, r0 - lsls r1, 16 - lsrs r1, 16 - ldr r2, [sp, 0x1C] - str r2, [sp] - str r4, [sp, 0x4] - mov r3, r10 - ldrb r0, [r3] - str r0, [sp, 0x8] - mov r0, r8 - ldr r2, [sp, 0xC] - mov r3, r9 - bl FillBgTilemapBufferRect - ldr r0, =0x00000805 - adds r1, r0, 0 - ldr r2, =gUnknown_0203CD9C - ldrh r2, [r2] - adds r1, r2 - lsls r1, 16 - lsrs r1, 16 - str r4, [sp] - str r4, [sp, 0x4] - mov r3, r10 - ldrb r0, [r3] - str r0, [sp, 0x8] - mov r0, r8 - ldr r2, [sp, 0x20] - mov r3, r9 - bl FillBgTilemapBufferRect - ldr r0, =0x00000806 - adds r1, r0, 0 - ldr r2, =gUnknown_0203CD9C - ldrh r2, [r2] - adds r1, r2 - lsls r1, 16 - lsrs r1, 16 - str r4, [sp] - str r4, [sp, 0x4] - mov r3, r10 - ldrb r0, [r3] - str r0, [sp, 0x8] - mov r0, r8 - adds r2, r7, 0 - mov r3, r9 - bl FillBgTilemapBufferRect - add sp, 0x24 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8197BB4 - - thumb_func_start sub_8197DF8 -sub_8197DF8: @ 8197DF8 - push {r4,r5,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =sub_8197E30 - adds r0, r5, 0 - bl CallWindowFunction - adds r0, r5, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r0, r5, 0 - bl ClearWindowTilemap - cmp r4, 0x1 - bne _08197E26 - adds r0, r5, 0 - movs r1, 0x3 - bl CopyWindowToVram -_08197E26: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8197DF8 - - thumb_func_start sub_8197E30 -sub_8197E30: @ 8197E30 - push {r4,r5,lr} - sub sp, 0xC - adds r4, r1, 0 - adds r5, r2, 0 - ldr r1, [sp, 0x18] - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsls r5, 24 - lsls r3, 24 - lsls r1, 24 - movs r2, 0xFD - lsls r2, 24 - adds r4, r2 - lsrs r4, 24 - movs r2, 0xFF - lsls r2, 24 - adds r5, r2 - lsrs r5, 24 - movs r2, 0xC0 - lsls r2, 19 - adds r3, r2 - lsrs r3, 24 - str r3, [sp] - movs r2, 0x80 - lsls r2, 18 - adds r1, r2 - lsrs r1, 24 - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - adds r2, r4, 0 - adds r3, r5, 0 - bl FillBgTilemapBufferRect - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8197E30 - - thumb_func_start SetWindowBorderStyle -@ void SetWindowBorderStyle(u8 windowId, bool copyToVram, s16 tileStart, s8 palette) -SetWindowBorderStyle: @ 8197E80 - push {r4,r5,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_0203CD9C - strh r2, [r0] - ldr r0, =gUnknown_0203CD9E - strb r3, [r0] - ldr r1, =DrawWindowBorder - adds r0, r5, 0 - bl CallWindowFunction - adds r0, r5, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - adds r0, r5, 0 - bl PutWindowTilemap - cmp r4, 0x1 - bne _08197EB6 - adds r0, r5, 0 - movs r1, 0x3 - bl CopyWindowToVram -_08197EB6: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end SetWindowBorderStyle - - thumb_func_start sub_8197EC8 -sub_8197EC8: @ 8197EC8 - push {r4-r6,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_0203CD9C - strh r2, [r0] - ldr r5, =gUnknown_0203CD9E - adds r0, r6, 0 - movs r1, 0x5 - bl GetWindowAttribute - strb r0, [r5] - ldr r1, =DrawWindowBorder - adds r0, r6, 0 - bl CallWindowFunction - adds r0, r6, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - adds r0, r6, 0 - bl PutWindowTilemap - cmp r4, 0x1 - bne _08197F06 - adds r0, r6, 0 - movs r1, 0x3 - bl CopyWindowToVram -_08197F06: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8197EC8 - - thumb_func_start DrawWindowBorder -DrawWindowBorder: @ 8197F18 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - mov r9, r0 - adds r6, r1, 0 - adds r4, r2, 0 - ldr r0, [sp, 0x38] - mov r1, r9 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - lsls r6, 24 - lsls r4, 24 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x10] - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x14] - ldr r2, =gUnknown_0203CD9C - ldrh r1, [r2] - lsrs r0, r6, 24 - str r0, [sp, 0xC] - movs r2, 0xFF - lsls r2, 24 - adds r6, r2 - lsrs r6, 24 - lsrs r0, r4, 24 - mov r8, r0 - adds r4, r2 - lsrs r4, 24 - movs r5, 0x1 - str r5, [sp] - str r5, [sp, 0x4] - ldr r7, =gUnknown_0203CD9E - ldrb r0, [r7] - str r0, [sp, 0x8] - mov r0, r9 - adds r2, r6, 0 - adds r3, r4, 0 - bl FillBgTilemapBufferRect - ldr r2, =gUnknown_0203CD9C - ldrh r1, [r2] - adds r1, 0x1 - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0x10] - str r0, [sp] - str r5, [sp, 0x4] - ldrb r0, [r7] - str r0, [sp, 0x8] - mov r0, r9 - ldr r2, [sp, 0xC] - adds r3, r4, 0 - bl FillBgTilemapBufferRect - ldr r2, =gUnknown_0203CD9C - ldrh r1, [r2] - adds r1, 0x2 - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0xC] - ldr r2, [sp, 0x10] - adds r0, r2 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - str r5, [sp] - str r5, [sp, 0x4] - ldrb r0, [r7] - str r0, [sp, 0x8] - mov r0, r9 - mov r2, r10 - adds r3, r4, 0 - bl FillBgTilemapBufferRect - ldr r0, =gUnknown_0203CD9C - ldrh r1, [r0] - adds r1, 0x3 - lsls r1, 16 - lsrs r1, 16 - str r5, [sp] - ldr r2, [sp, 0x14] - str r2, [sp, 0x4] - ldrb r0, [r7] - str r0, [sp, 0x8] - mov r0, r9 - adds r2, r6, 0 - mov r3, r8 - bl FillBgTilemapBufferRect - ldr r0, =gUnknown_0203CD9C - ldrh r1, [r0] - adds r1, 0x5 - lsls r1, 16 - lsrs r1, 16 - str r5, [sp] - ldr r2, [sp, 0x14] - str r2, [sp, 0x4] - ldrb r0, [r7] - str r0, [sp, 0x8] - mov r0, r9 - mov r2, r10 - mov r3, r8 - bl FillBgTilemapBufferRect - ldr r0, =gUnknown_0203CD9C - ldrh r1, [r0] - adds r1, 0x6 - lsls r1, 16 - lsrs r1, 16 - ldr r2, [sp, 0x14] - add r8, r2 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - str r5, [sp] - str r5, [sp, 0x4] - ldrb r0, [r7] - str r0, [sp, 0x8] - mov r0, r9 - adds r2, r6, 0 - mov r3, r8 - bl FillBgTilemapBufferRect - ldr r2, =gUnknown_0203CD9C - ldrh r1, [r2] - adds r1, 0x7 - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0x10] - str r0, [sp] - str r5, [sp, 0x4] - ldrb r0, [r7] - str r0, [sp, 0x8] - mov r0, r9 - ldr r2, [sp, 0xC] - mov r3, r8 - bl FillBgTilemapBufferRect - ldr r2, =gUnknown_0203CD9C - ldrh r1, [r2] - adds r1, 0x8 - lsls r1, 16 - lsrs r1, 16 - str r5, [sp] - str r5, [sp, 0x4] - ldrb r0, [r7] - str r0, [sp, 0x8] - mov r0, r9 - mov r2, r10 - mov r3, r8 - bl FillBgTilemapBufferRect - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end DrawWindowBorder - - thumb_func_start sub_8198070 -sub_8198070: @ 8198070 - push {r4,r5,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =sub_81980A8 - adds r0, r5, 0 - bl CallWindowFunction - adds r0, r5, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r0, r5, 0 - bl ClearWindowTilemap - cmp r4, 0x1 - bne _0819809E - adds r0, r5, 0 - movs r1, 0x3 - bl CopyWindowToVram -_0819809E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8198070 - - thumb_func_start sub_81980A8 -sub_81980A8: @ 81980A8 - push {r4,r5,lr} - sub sp, 0xC - adds r4, r1, 0 - adds r5, r2, 0 - ldr r1, [sp, 0x18] - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsls r5, 24 - lsls r3, 24 - lsls r1, 24 - movs r2, 0xFF - lsls r2, 24 - adds r4, r2 - lsrs r4, 24 - adds r5, r2 - lsrs r5, 24 - movs r2, 0x80 - lsls r2, 18 - adds r3, r2 - lsrs r3, 24 - str r3, [sp] - adds r1, r2 - lsrs r1, 24 - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - adds r2, r4, 0 - adds r3, r5, 0 - bl FillBgTilemapBufferRect - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81980A8 - - thumb_func_start sub_81980F0 -sub_81980F0: @ 81980F0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - ldr r4, [sp, 0x20] - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - lsls r3, 24 - lsrs r5, r3, 24 - lsls r4, 16 - lsrs r4, 16 - mov r0, sp - movs r1, 0 - movs r2, 0x8 - bl memset - cmp r6, 0x3 - bls _08198126 - movs r1, 0 - mov r0, sp - strb r1, [r0] - b _0819812A -_08198126: - mov r0, sp - strb r6, [r0] -_0819812A: - mov r1, sp - mov r0, r8 - strb r0, [r1, 0x2] - movs r0, 0x2 - strb r0, [r1, 0x4] - movs r0, 0x1E - subs r0, r7 - strb r0, [r1, 0x1] - strb r7, [r1, 0x3] - strb r5, [r1, 0x5] - strh r4, [r1, 0x6] - ldr r4, =gUnknown_0203CDA0 - mov r0, sp - bl AddWindow - strb r0, [r4] - cmp r5, 0xF - bls _08198158 - movs r5, 0xF0 - b _0819815C - .pool -_08198158: - lsls r0, r5, 28 - lsrs r5, r0, 24 -_0819815C: - ldr r0, =gUnknown_0860F0B0 - adds r1, r5, 0 - movs r2, 0x20 - bl LoadPalette - ldr r0, =gUnknown_0203CDA0 - ldrb r0, [r0] - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81980F0 - - thumb_func_start sub_8198180 -sub_8198180: @ 8198180 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - adds r6, r0, 0 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - ldr r5, =gUnknown_0203CDA0 - ldrb r0, [r5] - cmp r0, 0xFF - beq _081981EE - bl PutWindowTilemap - ldrb r0, [r5] - movs r1, 0xFF - bl FillWindowPixelBuffer - movs r0, 0 - adds r1, r6, 0 - movs r2, 0 - bl GetStringWidth - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldrb r0, [r5] - movs r1, 0x1 - bl GetWindowAttribute - movs r2, 0xEC - subs r2, r7 - lsls r0, 3 - subs r2, r0 - subs r2, r4 - lsls r2, 24 - lsrs r2, 24 - ldrb r0, [r5] - ldr r1, =gUnknown_0860F0D0 - str r1, [sp] - movs r1, 0 - str r1, [sp, 0x4] - str r6, [sp, 0x8] - movs r3, 0x1 - bl box_print - mov r0, r8 - cmp r0, 0 - beq _081981EE - ldrb r0, [r5] - movs r1, 0x3 - bl CopyWindowToVram -_081981EE: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8198180 - - thumb_func_start sub_8198204 -sub_8198204: @ 8198204 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - mov r10, r0 - adds r6, r1, 0 - ldr r0, [sp, 0x38] - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - mov r8, r3 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - movs r4, 0 - ldr r0, =gUnknown_0203CDA0 - ldrb r1, [r0] - adds r7, r0, 0 - cmp r1, 0xFF - beq _081982C8 - cmp r2, 0 - beq _08198244 - add r0, sp, 0x14 - strb r4, [r0] - adds r1, r0, 0 - b _0819824A - .pool -_08198244: - add r1, sp, 0x14 - movs r0, 0xF - strb r0, [r1] -_0819824A: - movs r0, 0x1 - strb r0, [r1, 0x1] - movs r0, 0x2 - strb r0, [r1, 0x2] - adds r5, r7, 0 - ldrb r0, [r5] - bl PutWindowTilemap - ldrb r0, [r5] - movs r1, 0xFF - bl FillWindowPixelBuffer - cmp r6, 0 - beq _0819829E - movs r0, 0 - adds r1, r6, 0 - movs r2, 0 - bl GetStringWidth - lsls r0, 16 - lsrs r4, r0, 16 - ldrb r0, [r5] - movs r1, 0x1 - bl GetWindowAttribute - movs r2, 0xEC - mov r1, r8 - subs r2, r1 - lsls r0, 3 - subs r2, r0 - subs r2, r4 - lsls r2, 24 - lsrs r2, 24 - ldrb r0, [r5] - add r1, sp, 0x14 - str r1, [sp] - movs r1, 0 - str r1, [sp, 0x4] - str r6, [sp, 0x8] - movs r3, 0x1 - bl box_print -_0819829E: - ldrb r0, [r7] - movs r1, 0 - str r1, [sp] - str r1, [sp, 0x4] - add r2, sp, 0x14 - str r2, [sp, 0x8] - str r1, [sp, 0xC] - mov r1, r10 - str r1, [sp, 0x10] - movs r1, 0x1 - movs r2, 0x4 - movs r3, 0x1 - bl AddTextPrinterParametrized2 - mov r2, r9 - cmp r2, 0 - beq _081982C8 - ldrb r0, [r7] - movs r1, 0x3 - bl CopyWindowToVram -_081982C8: - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8198204 - - thumb_func_start sub_81982D8 -sub_81982D8: @ 81982D8 - push {lr} - ldr r1, =gUnknown_0203CDA0 - ldrb r0, [r1] - cmp r0, 0xFF - beq _081982E8 - movs r1, 0x3 - bl CopyWindowToVram -_081982E8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81982D8 - - thumb_func_start sub_81982F0 -sub_81982F0: @ 81982F0 - push {r4,lr} - ldr r4, =gUnknown_0203CDA0 - ldrb r0, [r4] - cmp r0, 0xFF - beq _08198308 - movs r1, 0xFF - bl FillWindowPixelBuffer - ldrb r0, [r4] - movs r1, 0x3 - bl CopyWindowToVram -_08198308: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81982F0 - - thumb_func_start sub_8198314 -sub_8198314: @ 8198314 - push {r4,lr} - ldr r4, =gUnknown_0203CDA0 - ldrb r0, [r4] - cmp r0, 0xFF - beq _0819833C - movs r1, 0 - bl FillWindowPixelBuffer - ldrb r0, [r4] - bl ClearWindowTilemap - ldrb r0, [r4] - movs r1, 0x3 - bl CopyWindowToVram - ldrb r0, [r4] - bl RemoveWindow - movs r0, 0xFF - strb r0, [r4] -_0819833C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8198314 - - thumb_func_start sub_8198348 -sub_8198348: @ 8198348 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r4, [sp, 0x18] - mov r8, r4 - ldr r4, [sp, 0x1C] - ldr r5, [sp, 0x20] - ldr r6, [sp, 0x24] - mov r12, r6 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r7, r5, 24 - ldr r5, =gUnknown_0203CD90 - movs r6, 0 - strb r2, [r5] - strb r3, [r5, 0x1] - strb r6, [r5, 0x3] - subs r4, 0x1 - strb r4, [r5, 0x4] - strb r0, [r5, 0x5] - strb r1, [r5, 0x6] - mov r0, r8 - strb r0, [r5, 0x8] - mov r4, r12 - strb r4, [r5, 0xB] - cmp r7, 0 - blt _08198388 - movs r0, 0x4 - ldrsb r0, [r5, r0] - cmp r7, r0 - ble _08198390 -_08198388: - strb r6, [r5, 0x2] - b _08198392 - .pool -_08198390: - strb r7, [r5, 0x2] -_08198392: - movs r0, 0 - bl MoveMenuCursor - ldr r0, =gUnknown_0203CD90 - ldrb r0, [r0, 0x2] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8198348 - - thumb_func_start sub_81983AC -sub_81983AC: @ 81983AC - push {r4-r6,lr} - sub sp, 0x10 - ldr r4, [sp, 0x20] - ldr r5, [sp, 0x24] - ldr r6, [sp, 0x28] - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - str r4, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - movs r4, 0 - str r4, [sp, 0xC] - bl sub_8198348 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x10 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81983AC - - thumb_func_start sub_81983EC -sub_81983EC: @ 81983EC - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x14 - mov r8, r0 - adds r6, r1, 0 - ldr r4, [sp, 0x28] - ldr r5, [sp, 0x2C] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r6, 24 - lsrs r6, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - adds r0, r6, 0 - movs r1, 0x1 - str r2, [sp, 0xC] - str r3, [sp, 0x10] - bl GetMenuCursorDimensionByFont - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - mov r0, r8 - adds r1, r6, 0 - ldr r2, [sp, 0xC] - ldr r3, [sp, 0x10] - bl sub_81983AC - lsls r0, 24 - lsrs r0, 24 - add sp, 0x14 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81983EC - - thumb_func_start RedrawMenuCursor -@ void RedrawMenuCursor(s8 oldPos, s8 newPos) -RedrawMenuCursor: @ 8198448 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0xC - adds r6, r0, 0 - mov r8, r1 - lsls r6, 24 - lsrs r6, 24 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r5, =gUnknown_0203CD90 - ldrb r0, [r5, 0x6] - movs r1, 0 - bl GetMenuCursorDimensionByFont - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldrb r0, [r5, 0x6] - movs r1, 0x1 - bl GetMenuCursorDimensionByFont - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r5, 0x5] - mov r9, r1 - ldrb r2, [r5] - ldrb r1, [r5, 0x8] - adds r3, r1, 0 - muls r3, r6 - ldrb r6, [r5, 0x1] - adds r3, r6 - lsls r3, 16 - lsrs r3, 16 - str r4, [sp] - str r0, [sp, 0x4] - mov r0, r9 - movs r1, 0x11 - bl FillWindowPixelRect - ldrb r0, [r5, 0x5] - ldrb r1, [r5, 0x6] - ldr r2, =gUnknown_085EE498 - ldrb r3, [r5] - ldrb r4, [r5, 0x8] - mov r6, r8 - muls r6, r4 - adds r4, r6, 0 - ldrb r5, [r5, 0x1] - adds r4, r5 - lsls r4, 24 - lsrs r4, 24 - str r4, [sp] - movs r4, 0 - str r4, [sp, 0x4] - str r4, [sp, 0x8] - bl Print - add sp, 0xC - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end RedrawMenuCursor - - thumb_func_start MoveMenuCursor -@ s8 MoveMenuCursor(s8 cursorDelta) -MoveMenuCursor: @ 81984D8 - push {r4,r5,lr} - ldr r1, =gUnknown_0203CD90 - ldrb r5, [r1, 0x2] - movs r2, 0x2 - ldrsb r2, [r1, r2] - lsls r0, 24 - asrs r3, r0, 24 - adds r2, r3 - movs r0, 0x3 - ldrsb r0, [r1, r0] - adds r4, r1, 0 - cmp r2, r0 - bge _081984FC - ldrb r0, [r4, 0x4] - b _0819850A - .pool -_081984FC: - movs r0, 0x4 - ldrsb r0, [r4, r0] - cmp r2, r0 - ble _08198508 - ldrb r0, [r4, 0x3] - b _0819850A -_08198508: - adds r0, r3, r5 -_0819850A: - strb r0, [r4, 0x2] - ldrb r1, [r4, 0x2] - adds r0, r5, 0 - bl RedrawMenuCursor - ldrb r0, [r4, 0x2] - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end MoveMenuCursor - - thumb_func_start MoveMenuCursorNoWrapAround -@ s8 MoveMenuCursorNoWrapAround(s8 cursorDelta) -MoveMenuCursorNoWrapAround: @ 819851C - push {r4,r5,lr} - ldr r1, =gUnknown_0203CD90 - ldrb r5, [r1, 0x2] - movs r2, 0x2 - ldrsb r2, [r1, r2] - lsls r0, 24 - asrs r3, r0, 24 - adds r2, r3 - movs r0, 0x3 - ldrsb r0, [r1, r0] - adds r4, r1, 0 - cmp r2, r0 - bge _08198540 - ldrb r0, [r4, 0x3] - b _0819854E - .pool -_08198540: - movs r0, 0x4 - ldrsb r0, [r4, r0] - cmp r2, r0 - ble _0819854C - ldrb r0, [r4, 0x4] - b _0819854E -_0819854C: - adds r0, r3, r5 -_0819854E: - strb r0, [r4, 0x2] - ldrb r1, [r4, 0x2] - adds r0, r5, 0 - bl RedrawMenuCursor - ldrb r0, [r4, 0x2] - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end MoveMenuCursorNoWrapAround - - thumb_func_start GetMenuCursorPos -GetMenuCursorPos: @ 8198560 - ldr r0, =gUnknown_0203CD90 - ldrb r0, [r0, 0x2] - bx lr - .pool - thumb_func_end GetMenuCursorPos - - thumb_func_start ProcessMenuInput -ProcessMenuInput: @ 819856C - push {r4,lr} - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08198598 - ldr r4, =gUnknown_0203CD90 - ldrb r0, [r4, 0xB] - cmp r0, 0 - bne _08198588 - movs r0, 0x5 - bl PlaySE -_08198588: - movs r0, 0x2 - ldrsb r0, [r4, r0] - b _081985D2 - .pool -_08198598: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081985A6 - movs r0, 0x1 - negs r0, r0 - b _081985D2 -_081985A6: - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081985BA - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - negs r0, r0 - b _081985CA -_081985BA: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081985CE - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 -_081985CA: - bl MoveMenuCursor -_081985CE: - movs r0, 0x2 - negs r0, r0 -_081985D2: - pop {r4} - pop {r1} - bx r1 - thumb_func_end ProcessMenuInput - - thumb_func_start ProcessMenuInputNoWrapAround -@ int ProcessMenuInputNoWrapAround() -ProcessMenuInputNoWrapAround: @ 81985D8 - push {r4-r6,lr} - ldr r4, =gUnknown_0203CD90 - ldrb r5, [r4, 0x2] - adds r6, r5, 0 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08198608 - ldrb r0, [r4, 0xB] - cmp r0, 0 - bne _081985F8 - movs r0, 0x5 - bl PlaySE -_081985F8: - movs r0, 0x2 - ldrsb r0, [r4, r0] - b _08198650 - .pool -_08198608: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08198616 - movs r0, 0x1 - negs r0, r0 - b _08198650 -_08198616: - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08198630 - movs r0, 0x1 - negs r0, r0 - bl MoveMenuCursorNoWrapAround - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - beq _0819864C - b _08198646 -_08198630: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0819864C - movs r0, 0x1 - bl MoveMenuCursorNoWrapAround - lsls r0, 24 - lsrs r0, 24 - cmp r6, r0 - beq _0819864C -_08198646: - movs r0, 0x5 - bl PlaySE -_0819864C: - movs r0, 0x2 - negs r0, r0 -_08198650: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end ProcessMenuInputNoWrapAround - - thumb_func_start ProcessMenuInput_other -ProcessMenuInput_other: @ 8198658 - push {r4,lr} - ldr r2, =gMain - ldrh r1, [r2, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08198684 - ldr r4, =gUnknown_0203CD90 - ldrb r0, [r4, 0xB] - cmp r0, 0 - bne _08198674 - movs r0, 0x5 - bl PlaySE -_08198674: - movs r0, 0x2 - ldrsb r0, [r4, r0] - b _081986BC - .pool -_08198684: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08198692 - movs r0, 0x1 - negs r0, r0 - b _081986BC -_08198692: - ldrh r0, [r2, 0x30] - movs r1, 0xF0 - ands r1, r0 - cmp r1, 0x40 - bne _081986A8 - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - negs r0, r0 - b _081986B4 -_081986A8: - cmp r1, 0x80 - bne _081986B8 - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 -_081986B4: - bl MoveMenuCursor -_081986B8: - movs r0, 0x2 - negs r0, r0 -_081986BC: - pop {r4} - pop {r1} - bx r1 - thumb_func_end ProcessMenuInput_other - - thumb_func_start ProcessMenuInputNoWrapAround_other -ProcessMenuInputNoWrapAround_other: @ 81986C4 - push {r4-r6,lr} - ldr r4, =gUnknown_0203CD90 - ldrb r5, [r4, 0x2] - adds r6, r5, 0 - ldr r2, =gMain - ldrh r1, [r2, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081986F4 - ldrb r0, [r4, 0xB] - cmp r0, 0 - bne _081986E4 - movs r0, 0x5 - bl PlaySE -_081986E4: - movs r0, 0x2 - ldrsb r0, [r4, r0] - b _0819873A - .pool -_081986F4: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08198702 - movs r0, 0x1 - negs r0, r0 - b _0819873A -_08198702: - ldrh r0, [r2, 0x30] - movs r1, 0xF0 - ands r1, r0 - cmp r1, 0x40 - bne _0819871E - movs r0, 0x1 - negs r0, r0 - bl MoveMenuCursorNoWrapAround - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - beq _08198736 - b _08198730 -_0819871E: - cmp r1, 0x80 - bne _08198736 - movs r0, 0x1 - bl MoveMenuCursorNoWrapAround - lsls r0, 24 - lsrs r0, 24 - cmp r6, r0 - beq _08198736 -_08198730: - movs r0, 0x5 - bl PlaySE -_08198736: - movs r0, 0x2 - negs r0, r0 -_0819873A: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end ProcessMenuInputNoWrapAround_other - - thumb_func_start PrintTextArray -PrintTextArray: @ 8198740 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - ldr r4, [sp, 0x2C] - ldr r5, [sp, 0x30] - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r1, 24 - mov r10, r1 - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - lsls r3, 24 - lsrs r3, 24 - mov r8, r3 - lsls r4, 24 - lsrs r7, r4, 24 - lsls r5, 24 - lsrs r5, 24 - movs r4, 0 - cmp r4, r5 - bcs _081987A4 -_08198774: - lsls r0, r4, 3 - ldr r1, [sp, 0x34] - adds r0, r1 - ldr r2, [r0] - adds r0, r7, 0 - muls r0, r4 - add r0, r8 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - adds r0, r6, 0 - mov r1, r10 - mov r3, r9 - bl Print - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _08198774 -_081987A4: - adds r0, r6, 0 - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end PrintTextArray - - thumb_func_start sub_81987BC -sub_81987BC: @ 81987BC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - ldr r4, [sp, 0x40] - ldr r5, [sp, 0x44] - ldr r6, [sp, 0x4C] - ldr r7, [sp, 0x50] - mov r8, r7 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x14] - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x18] - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x1C] - lsls r4, 24 - lsrs r4, 24 - mov r10, r4 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - mov r9, r6 - mov r0, r8 - lsls r0, 24 - lsrs r6, r0, 24 - movs r4, 0 - cmp r4, r5 - bcs _0819883C -_08198804: - lsls r0, r4, 3 - ldr r1, [sp, 0x48] - adds r0, r1 - ldr r2, [r0] - mov r0, r10 - muls r0, r4 - ldr r1, [sp, 0x1C] - adds r0, r1, r0 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - mov r0, r9 - str r0, [sp, 0xC] - str r6, [sp, 0x10] - adds r0, r7, 0 - ldr r1, [sp, 0x14] - ldr r3, [sp, 0x18] - bl sub_8199F74 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _08198804 -_0819883C: - adds r0, r7, 0 - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81987BC - - thumb_func_start sub_8198854 -sub_8198854: @ 8198854 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - mov r8, r0 - adds r6, r1, 0 - adds r4, r2, 0 - adds r5, r3, 0 - ldr r7, [sp, 0x24] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r6, 24 - lsrs r6, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - adds r0, r6, 0 - movs r1, 0 - bl GetFontAttribute - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - str r4, [sp] - str r5, [sp, 0x4] - str r7, [sp, 0x8] - mov r0, r8 - adds r1, r6, 0 - movs r3, 0x1 - bl PrintTextArray - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8198854 - - thumb_func_start AddItemMenuActionTextPrinters -AddItemMenuActionTextPrinters: @ 81988A4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - adds r6, r1, 0 - mov r8, r2 - ldr r1, [sp, 0x38] - mov r9, r1 - ldr r1, [sp, 0x3C] - ldr r2, [sp, 0x40] - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x10] - lsls r6, 24 - lsrs r6, 24 - mov r4, r8 - lsls r4, 24 - lsrs r4, 24 - mov r8, r4 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x14] - mov r0, r9 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsls r1, 24 - lsrs r1, 24 - mov r10, r1 - lsls r2, 24 - lsrs r7, r2, 24 - mov r0, sp - ldrb r1, [r0, 0x10] - strb r1, [r0, 0x4] - strb r6, [r0, 0x5] - adds r0, r6, 0 - movs r1, 0x5 - bl GetFontAttribute - mov r3, sp - lsls r0, 4 - ldrb r2, [r3, 0xC] - movs r5, 0xF - adds r1, r5, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xC] - adds r0, r6, 0 - movs r1, 0x6 - bl GetFontAttribute - mov r3, sp - adds r1, r5, 0 - ands r1, r0 - ldrb r2, [r3, 0xD] - movs r4, 0x10 - negs r4, r4 - adds r0, r4, 0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0xD] - adds r0, r6, 0 - movs r1, 0x7 - bl GetFontAttribute - mov r3, sp - lsls r0, 4 - ldrb r2, [r3, 0xD] - adds r1, r5, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xD] - adds r0, r6, 0 - movs r1, 0x4 - bl GetFontAttribute - mov r1, sp - ands r5, r0 - ldrb r0, [r1, 0xC] - ands r4, r0 - orrs r4, r5 - strb r4, [r1, 0xC] - mov r0, sp - mov r2, r9 - strb r2, [r0, 0xA] - adds r0, r6, 0 - movs r1, 0x3 - bl GetFontAttribute - mov r1, sp - strb r0, [r1, 0xB] - mov r0, sp - mov r4, r8 - strb r4, [r0, 0x6] - strb r4, [r0, 0x8] - movs r4, 0 - cmp r4, r7 - bcs _0819899E - mov r5, sp -_0819896E: - ldr r1, [sp, 0x48] - adds r0, r1, r4 - ldrb r0, [r0] - lsls r0, 3 - ldr r2, [sp, 0x44] - adds r0, r2 - ldr r0, [r0] - str r0, [sp] - mov r0, r10 - muls r0, r4 - ldr r1, [sp, 0x14] - adds r0, r1, r0 - strb r0, [r5, 0x7] - strb r0, [r5, 0x9] - mov r0, sp - movs r1, 0xFF - movs r2, 0 - bl AddTextPrinter - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r7 - bcc _0819896E -_0819899E: - ldr r0, [sp, 0x10] - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end AddItemMenuActionTextPrinters - - thumb_func_start sub_81989B8 -sub_81989B8: @ 81989B8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x14 - mov r9, r0 - adds r4, r1, 0 - adds r6, r2, 0 - mov r8, r3 - ldr r7, [sp, 0x30] - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsls r4, 24 - lsrs r4, 24 - lsls r6, 24 - lsrs r6, 24 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - adds r0, r4, 0 - movs r1, 0 - bl GetFontAttribute - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - adds r0, r4, 0 - movs r1, 0x2 - bl GetFontAttribute - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - str r6, [sp, 0x4] - mov r0, r8 - str r0, [sp, 0x8] - str r7, [sp, 0xC] - ldr r0, [sp, 0x34] - str r0, [sp, 0x10] - mov r0, r9 - adds r1, r4, 0 - adds r2, r5, 0 - movs r3, 0x1 - bl AddItemMenuActionTextPrinters - add sp, 0x14 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81989B8 - - thumb_func_start rbox_template_set -@ void rbox_template_set(WindowTemplate *template, char bg_id, char x, char y, char w, char h, char a7, s16 a8) -rbox_template_set: @ 8198A24 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r4, [sp, 0x18] - ldr r5, [sp, 0x1C] - ldr r6, [sp, 0x20] - ldr r7, [sp, 0x24] - mov r8, r7 - strb r1, [r0] - strb r2, [r0, 0x1] - strb r3, [r0, 0x2] - strb r4, [r0, 0x3] - strb r5, [r0, 0x4] - strb r6, [r0, 0x5] - mov r1, r8 - strh r1, [r0, 0x6] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end rbox_template_set - - thumb_func_start sub_8198A50 -sub_8198A50: @ 8198A50 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x18 - mov r8, r0 - ldr r0, [sp, 0x2C] - ldr r4, [sp, 0x30] - ldr r5, [sp, 0x34] - ldr r6, [sp, 0x38] - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 16 - lsrs r6, 16 - str r0, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - str r6, [sp, 0xC] - add r0, sp, 0x10 - bl rbox_template_set - ldr r0, [sp, 0x10] - ldr r1, [sp, 0x14] - mov r2, r8 - str r0, [r2] - str r1, [r2, 0x4] - mov r0, r8 - add sp, 0x18 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r2} - bx r2 - thumb_func_end sub_8198A50 - - thumb_func_start sub_8198AA4 -sub_8198AA4: @ 8198AA4 - push {r4-r6,lr} - sub sp, 0x18 - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - ldr r0, [sp, 0x28] - ldr r1, [sp, 0x2C] - ldr r2, [sp, 0x30] - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 16 - lsrs r2, 16 - str r3, [sp] - str r0, [sp, 0x4] - str r1, [sp, 0x8] - str r2, [sp, 0xC] - add r0, sp, 0x10 - adds r1, r4, 0 - adds r2, r5, 0 - adds r3, r6, 0 - bl rbox_template_set - add r0, sp, 0x10 - bl AddWindow - lsls r0, 16 - lsrs r0, 16 - add sp, 0x18 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8198AA4 - - thumb_func_start sub_8198AF8 -sub_8198AF8: @ 8198AF8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - adds r6, r1, 0 - mov r8, r2 - mov r9, r3 - ldr r4, [sp, 0x3C] - ldr r5, [sp, 0x40] - ldr r1, [sp, 0x44] - mov r10, r1 - lsls r6, 24 - lsrs r6, 24 - mov r1, r8 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - mov r1, r9 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 24 - lsrs r5, 24 - mov r1, r10 - lsls r1, 24 - lsrs r1, 24 - mov r10, r1 - ldr r7, =gUnknown_0203CD9F - bl AddWindow - strb r0, [r7] - ldrb r0, [r7] - movs r1, 0x1 - adds r2, r4, 0 - adds r3, r5, 0 - bl SetWindowBorderStyle - ldr r0, =gUnknown_085EE491 - str r0, [sp, 0xC] - add r1, sp, 0xC - ldrb r0, [r7] - strb r0, [r1, 0x4] - adds r0, r1, 0 - strb r6, [r0, 0x5] - adds r0, r6, 0 - movs r1, 0 - bl GetFontAttribute - add r1, sp, 0xC - add r0, r8 - strb r0, [r1, 0x6] - adds r0, r1, 0 - mov r1, r9 - strb r1, [r0, 0x7] - adds r1, r0, 0 - ldrb r0, [r0, 0x6] - strb r0, [r1, 0x8] - adds r0, r1, 0 - ldrb r0, [r0, 0x7] - strb r0, [r1, 0x9] - adds r0, r6, 0 - movs r1, 0x5 - bl GetFontAttribute - add r3, sp, 0xC - lsls r0, 4 - ldrb r2, [r3, 0xC] - movs r5, 0xF - adds r1, r5, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xC] - adds r0, r6, 0 - movs r1, 0x6 - bl GetFontAttribute - add r3, sp, 0xC - adds r1, r5, 0 - ands r1, r0 - ldrb r2, [r3, 0xD] - movs r4, 0x10 - negs r4, r4 - adds r0, r4, 0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0xD] - adds r0, r6, 0 - movs r1, 0x7 - bl GetFontAttribute - add r3, sp, 0xC - lsls r0, 4 - ldrb r2, [r3, 0xD] - adds r1, r5, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xD] - adds r0, r6, 0 - movs r1, 0x4 - bl GetFontAttribute - add r1, sp, 0xC - ands r5, r0 - ldrb r0, [r1, 0xC] - ands r4, r0 - orrs r4, r5 - strb r4, [r1, 0xC] - adds r0, r6, 0 - movs r1, 0x2 - bl GetFontAttribute - add r1, sp, 0xC - strb r0, [r1, 0xA] - adds r0, r6, 0 - movs r1, 0x3 - bl GetFontAttribute - add r1, sp, 0xC - strb r0, [r1, 0xB] - adds r0, r1, 0 - movs r1, 0xFF - movs r2, 0 - bl AddTextPrinter - adds r0, r6, 0 - movs r1, 0x1 - bl GetFontAttribute - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r7] - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - mov r0, r10 - str r0, [sp, 0x8] - adds r0, r1, 0 - adds r1, r6, 0 - mov r2, r8 - mov r3, r9 - bl sub_81983AC - add sp, 0x1C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8198AF8 - - thumb_func_start sub_8198C34 -sub_8198C34: @ 8198C34 - push {lr} - sub sp, 0xC - lsls r1, 24 - lsrs r1, 24 - lsls r2, 16 - lsrs r2, 16 - lsls r3, 24 - lsrs r3, 24 - str r2, [sp] - str r3, [sp, 0x4] - movs r2, 0 - str r2, [sp, 0x8] - movs r3, 0x1 - bl sub_8198AF8 - add sp, 0xC - pop {r0} - bx r0 - thumb_func_end sub_8198C34 - - thumb_func_start sub_8198C58 -sub_8198C58: @ 8198C58 - push {r4,lr} - bl ProcessMenuInputNoWrapAround - lsls r0, 24 - asrs r4, r0, 24 - movs r0, 0x2 - negs r0, r0 - cmp r4, r0 - beq _08198C6E - bl sub_8198C78 -_08198C6E: - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8198C58 - - thumb_func_start sub_8198C78 -sub_8198C78: @ 8198C78 - push {r4,lr} - ldr r4, =gUnknown_0203CD9F - ldrb r0, [r4] - movs r1, 0x1 - bl sub_8198070 - ldrb r0, [r4] - bl RemoveWindow - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8198C78 - - thumb_func_start sub_8198C94 -sub_8198C94: @ 8198C94 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - ldr r4, [sp, 0x40] - ldr r5, [sp, 0x44] - ldr r6, [sp, 0x48] - ldr r7, [sp, 0x4C] - mov r8, r7 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0xC] - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x10] - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x14] - lsls r4, 24 - lsrs r4, 24 - str r4, [sp, 0x18] - lsls r5, 24 - lsrs r5, 24 - str r5, [sp, 0x1C] - lsls r6, 24 - lsrs r6, 24 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - movs r5, 0 - cmp r5, r9 - bcs _08198D3A -_08198CE0: - movs r4, 0 - adds r1, r5, 0x1 - mov r8, r1 - cmp r4, r6 - bcs _08198D30 - ldr r7, [sp, 0x1C] - adds r0, r7, 0 - muls r0, r5 - ldr r1, [sp, 0x14] - adds r0, r1, r0 - lsls r0, 24 - lsrs r7, r0, 24 -_08198CF8: - adds r0, r5, 0 - muls r0, r6 - adds r0, r4 - lsls r0, 3 - ldr r1, [sp, 0x50] - adds r0, r1 - ldr r2, [r0] - ldr r0, [sp, 0x18] - adds r3, r0, 0 - muls r3, r4 - ldr r1, [sp, 0x10] - adds r3, r1, r3 - lsls r3, 24 - lsrs r3, 24 - str r7, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - mov r0, r10 - ldr r1, [sp, 0xC] - bl Print - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r6 - bcc _08198CF8 -_08198D30: - mov r7, r8 - lsls r0, r7, 24 - lsrs r5, r0, 24 - cmp r5, r9 - bcc _08198CE0 -_08198D3A: - mov r0, r10 - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8198C94 - - thumb_func_start sub_8198D54 -sub_8198D54: @ 8198D54 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x18 - mov r9, r0 - mov r8, r1 - adds r4, r2, 0 - adds r5, r3, 0 - ldr r6, [sp, 0x34] - ldr r3, [sp, 0x38] - ldr r7, [sp, 0x3C] - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - lsls r3, 24 - lsrs r3, 24 - movs r1, 0 - str r3, [sp, 0x14] - bl GetFontAttribute - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - str r4, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - ldr r3, [sp, 0x14] - str r3, [sp, 0xC] - str r7, [sp, 0x10] - mov r0, r9 - mov r1, r8 - movs r3, 0 - bl sub_8198C94 - add sp, 0x18 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8198D54 - - thumb_func_start sub_8198DBC -sub_8198DBC: @ 8198DBC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - ldr r4, [sp, 0x40] - ldr r5, [sp, 0x44] - ldr r6, [sp, 0x48] - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x10] - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x14] - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x18] - lsls r4, 24 - lsrs r4, 24 - str r4, [sp, 0x1C] - lsls r5, 24 - lsrs r5, 24 - mov r8, r5 - lsls r6, 24 - lsrs r6, 24 - mov r10, r6 - mov r0, sp - ldrb r1, [r0, 0x10] - strb r1, [r0, 0x4] - strb r7, [r0, 0x5] - adds r0, r7, 0 - movs r1, 0x5 - bl GetFontAttribute - mov r3, sp - lsls r0, 4 - ldrb r2, [r3, 0xC] - movs r5, 0xF - adds r1, r5, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xC] - adds r0, r7, 0 - movs r1, 0x6 - bl GetFontAttribute - mov r3, sp - adds r1, r5, 0 - ands r1, r0 - ldrb r2, [r3, 0xD] - movs r4, 0x10 - negs r4, r4 - adds r0, r4, 0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0xD] - adds r0, r7, 0 - movs r1, 0x7 - bl GetFontAttribute - mov r3, sp - lsls r0, 4 - ldrb r2, [r3, 0xD] - adds r1, r5, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xD] - adds r0, r7, 0 - movs r1, 0x4 - bl GetFontAttribute - mov r1, sp - ands r5, r0 - ldrb r0, [r1, 0xC] - ands r4, r0 - orrs r4, r5 - strb r4, [r1, 0xC] - adds r0, r7, 0 - movs r1, 0x2 - bl GetFontAttribute - mov r1, sp - strb r0, [r1, 0xA] - adds r0, r7, 0 - movs r1, 0x3 - bl GetFontAttribute - mov r1, sp - strb r0, [r1, 0xB] - movs r6, 0 - cmp r6, r10 - bcs _08198EDE -_08198E7A: - movs r5, 0 - adds r2, r6, 0x1 - mov r9, r2 - cmp r5, r8 - bcs _08198ED4 - mov r4, sp -_08198E86: - mov r0, r8 - muls r0, r6 - adds r0, r5 - ldr r1, [sp, 0x50] - adds r0, r1, r0 - ldrb r0, [r0] - lsls r0, 3 - ldr r2, [sp, 0x4C] - adds r0, r2 - ldr r0, [r0] - str r0, [sp] - ldr r1, [sp, 0x1C] - adds r0, r1, 0 - muls r0, r5 - ldr r2, [sp, 0x14] - adds r0, r2, r0 - strb r0, [r4, 0x6] - adds r0, r7, 0 - movs r1, 0x1 - bl GetFontAttribute - adds r1, r6, 0 - muls r1, r0 - ldr r0, [sp, 0x18] - adds r1, r0, r1 - strb r1, [r4, 0x7] - ldrb r0, [r4, 0x6] - strb r0, [r4, 0x8] - strb r1, [r4, 0x9] - mov r0, sp - movs r1, 0xFF - movs r2, 0 - bl AddTextPrinter - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, r8 - bcc _08198E86 -_08198ED4: - mov r1, r9 - lsls r0, r1, 24 - lsrs r6, r0, 24 - cmp r6, r10 - bcc _08198E7A -_08198EDE: - ldr r0, [sp, 0x10] - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8198DBC - - thumb_func_start sub_8198EF8 -sub_8198EF8: @ 8198EF8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x18 - mov r8, r0 - adds r3, r1, 0 - adds r4, r2, 0 - ldr r5, [sp, 0x30] - ldr r6, [sp, 0x34] - ldr r7, [sp, 0x38] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - adds r0, r3, 0 - movs r1, 0 - str r3, [sp, 0x14] - bl GetFontAttribute - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - str r4, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - str r7, [sp, 0xC] - ldr r0, [sp, 0x3C] - str r0, [sp, 0x10] - mov r0, r8 - ldr r3, [sp, 0x14] - adds r1, r3, 0 - movs r3, 0 - bl sub_8198DBC - add sp, 0x18 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8198EF8 - - thumb_func_start sub_8198F58 -sub_8198F58: @ 8198F58 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r4, [sp, 0x20] - mov r12, r4 - ldr r4, [sp, 0x24] - mov r8, r4 - ldr r4, [sp, 0x28] - mov r9, r4 - ldr r4, [sp, 0x2C] - mov r10, r4 - ldr r4, [sp, 0x30] - ldr r5, [sp, 0x34] - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r7, r5, 24 - ldr r5, =gUnknown_0203CD90 - movs r6, 0 - strb r2, [r5] - strb r3, [r5, 0x1] - strb r6, [r5, 0x3] - subs r4, 0x1 - strb r4, [r5, 0x4] - strb r0, [r5, 0x5] - strb r1, [r5, 0x6] - mov r0, r12 - strb r0, [r5, 0x7] - mov r4, r8 - strb r4, [r5, 0x8] - mov r0, r9 - strb r0, [r5, 0x9] - mov r4, r10 - strb r4, [r5, 0xA] - cmp r7, 0 - blt _08198FAC - movs r0, 0x4 - ldrsb r0, [r5, r0] - cmp r7, r0 - ble _08198FB4 -_08198FAC: - strb r6, [r5, 0x2] - b _08198FB6 - .pool -_08198FB4: - strb r7, [r5, 0x2] -_08198FB6: - movs r0, 0 - movs r1, 0 - bl sub_8199134 - ldr r0, =gUnknown_0203CD90 - ldrb r0, [r0, 0x2] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8198F58 - - thumb_func_start sub_8198FD4 -sub_8198FD4: @ 8198FD4 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - sub sp, 0x20 - mov r9, r0 - mov r8, r1 - mov r10, r2 - ldr r6, [sp, 0x3C] - ldr r4, [sp, 0x40] - ldr r5, [sp, 0x44] - ldr r2, [sp, 0x48] - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - mov r0, r10 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - lsls r3, 24 - lsrs r3, 24 - lsls r6, 24 - lsrs r6, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r2, 24 - lsrs r2, 24 - mov r0, r8 - movs r1, 0x1 - str r2, [sp, 0x18] - str r3, [sp, 0x1C] - bl GetMenuCursorDimensionByFont - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - muls r1, r5 - lsls r1, 24 - lsrs r1, 24 - str r6, [sp] - str r0, [sp, 0x4] - str r4, [sp, 0x8] - str r5, [sp, 0xC] - str r1, [sp, 0x10] - ldr r2, [sp, 0x18] - str r2, [sp, 0x14] - mov r0, r9 - mov r1, r8 - mov r2, r10 - ldr r3, [sp, 0x1C] - bl sub_8198F58 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8198FD4 - - thumb_func_start sub_8199060 -sub_8199060: @ 8199060 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - mov r8, r0 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r0, r1, 24 - lsrs r7, r0, 24 - ldr r5, =gUnknown_0203CD90 - ldrb r0, [r5, 0x6] - movs r1, 0 - bl GetMenuCursorDimensionByFont - mov r9, r0 - mov r1, r9 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - ldrb r0, [r5, 0x6] - movs r1, 0x1 - bl GetMenuCursorDimensionByFont - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - ldrb r0, [r5, 0x9] - mov r10, r0 - mov r0, r8 - mov r1, r10 - bl __umodsi3 - ldrb r1, [r5, 0x7] - adds r4, r1, 0 - muls r4, r0 - ldrb r1, [r5] - adds r4, r1 - lsls r4, 24 - lsrs r4, 24 - mov r0, r8 - mov r1, r10 - bl __udivsi3 - ldrb r1, [r5, 0x8] - adds r3, r1, 0 - muls r3, r0 - ldrb r0, [r5, 0x1] - adds r3, r0 - lsls r3, 24 - lsrs r3, 24 - ldrb r0, [r5, 0x5] - mov r1, r9 - str r1, [sp] - str r6, [sp, 0x4] - movs r1, 0x11 - adds r2, r4, 0 - bl FillWindowPixelRect - ldrb r6, [r5, 0x9] - adds r0, r7, 0 - adds r1, r6, 0 - bl __umodsi3 - ldrb r1, [r5, 0x7] - adds r4, r1, 0 - muls r4, r0 - ldrb r0, [r5] - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r7, 0 - adds r1, r6, 0 - bl __udivsi3 - ldrb r1, [r5, 0x8] - adds r3, r1, 0 - muls r3, r0 - ldrb r1, [r5, 0x1] - adds r3, r1 - lsls r3, 24 - lsrs r3, 24 - ldrb r0, [r5, 0x5] - ldrb r1, [r5, 0x6] - ldr r2, =gUnknown_085EE498 - str r3, [sp] - movs r3, 0 - str r3, [sp, 0x4] - str r3, [sp, 0x8] - adds r3, r4, 0 - bl Print - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8199060 - - thumb_func_start sub_8199134 -sub_8199134: @ 8199134 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - ldr r1, =gUnknown_0203CD90 - ldrb r2, [r1, 0x2] - mov r8, r2 - lsls r0, 24 - asrs r6, r0, 24 - adds r5, r1, 0 - cmp r6, 0 - beq _0819918A - movs r7, 0x2 - ldrsb r7, [r5, r7] - ldrb r4, [r5, 0x9] - adds r0, r7, 0 - adds r1, r4, 0 - bl __modsi3 - adds r0, r6 - cmp r0, 0 - bge _08199174 - adds r0, r4, 0 - adds r0, 0xFF - add r0, r8 - b _08199188 - .pool -_08199174: - cmp r0, r4 - blt _08199184 - adds r0, r7, 0 - adds r1, r4, 0 - bl __divsi3 - muls r0, r4 - b _08199188 -_08199184: - mov r1, r8 - adds r0, r6, r1 -_08199188: - strb r0, [r5, 0x2] -_0819918A: - mov r2, r9 - lsls r0, r2, 24 - asrs r6, r0, 24 - cmp r6, 0 - beq _081991CE - movs r0, 0x2 - ldrsb r0, [r5, r0] - ldrb r4, [r5, 0x9] - adds r1, r4, 0 - bl __divsi3 - adds r1, r0, r6 - cmp r1, 0 - bge _081991B2 - ldrb r0, [r5, 0xA] - subs r0, 0x1 - muls r0, r4 - ldrb r1, [r5, 0x2] - adds r0, r1 - b _081991CC -_081991B2: - ldrb r0, [r5, 0xA] - cmp r1, r0 - blt _081991C4 - subs r0, 0x1 - adds r1, r4, 0 - muls r1, r0 - ldrb r0, [r5, 0x2] - subs r0, r1 - b _081991CC -_081991C4: - adds r0, r4, 0 - muls r0, r6 - ldrb r2, [r5, 0x2] - adds r0, r2 -_081991CC: - strb r0, [r5, 0x2] -_081991CE: - movs r1, 0x2 - ldrsb r1, [r5, r1] - movs r0, 0x4 - ldrsb r0, [r5, r0] - cmp r1, r0 - bgt _081991E4 - ldrb r1, [r5, 0x2] - mov r0, r8 - bl sub_8199060 - b _081991E8 -_081991E4: - mov r0, r8 - strb r0, [r5, 0x2] -_081991E8: - ldrb r0, [r5, 0x2] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8199134 - - thumb_func_start sub_81991F8 -sub_81991F8: @ 81991F8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - ldr r1, =gUnknown_0203CD90 - ldrb r7, [r1, 0x2] - lsls r0, 24 - asrs r4, r0, 24 - adds r5, r1, 0 - cmp r4, 0 - beq _0819922C - movs r0, 0x2 - ldrsb r0, [r5, r0] - ldrb r6, [r5, 0x9] - adds r1, r6, 0 - bl __modsi3 - adds r0, r4 - cmp r0, 0 - blt _0819922C - cmp r0, r6 - bge _0819922C - adds r0, r4, r7 - strb r0, [r5, 0x2] -_0819922C: - mov r1, r8 - lsls r0, r1, 24 - asrs r4, r0, 24 - cmp r4, 0 - beq _08199258 - movs r0, 0x2 - ldrsb r0, [r5, r0] - ldrb r6, [r5, 0x9] - adds r1, r6, 0 - bl __divsi3 - adds r0, r4 - cmp r0, 0 - blt _08199258 - ldrb r1, [r5, 0xA] - cmp r0, r1 - bge _08199258 - adds r0, r6, 0 - muls r0, r4 - ldrb r1, [r5, 0x2] - adds r0, r1 - strb r0, [r5, 0x2] -_08199258: - movs r1, 0x2 - ldrsb r1, [r5, r1] - movs r0, 0x4 - ldrsb r0, [r5, r0] - cmp r1, r0 - bgt _08199274 - ldrb r1, [r5, 0x2] - adds r0, r7, 0 - bl sub_8199060 - b _08199276 - .pool -_08199274: - strb r7, [r5, 0x2] -_08199276: - ldrb r0, [r5, 0x2] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81991F8 - - thumb_func_start sub_8199284 -sub_8199284: @ 8199284 - push {r4,lr} - ldr r4, =gMain - ldrh r1, [r4, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081992AC - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_0203CD90 - ldrb r0, [r0, 0x2] - lsls r0, 24 - asrs r0, 24 - b _0819932C - .pool -_081992AC: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081992BA - movs r0, 0x1 - negs r0, r0 - b _0819932C -_081992BA: - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081992D0 - movs r0, 0x5 - bl PlaySE - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - b _08199324 -_081992D0: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081992E4 - movs r0, 0x5 - bl PlaySE - movs r0, 0 - movs r1, 0x1 - b _08199324 -_081992E4: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _081992F8 - bl GetLRKeysState - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08199304 -_081992F8: - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - negs r0, r0 - b _08199322 -_08199304: - ldrh r1, [r4, 0x2E] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _0819931A - bl GetLRKeysState - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _08199328 -_0819931A: - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 -_08199322: - movs r1, 0 -_08199324: - bl sub_8199134 -_08199328: - movs r0, 0x2 - negs r0, r0 -_0819932C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8199284 - - thumb_func_start sub_8199334 -sub_8199334: @ 8199334 - push {r4-r6,lr} - ldr r5, =gUnknown_0203CD90 - ldrb r4, [r5, 0x2] - ldr r6, =gMain - ldrh r1, [r6, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0819935C - movs r0, 0x5 - bl PlaySE - movs r0, 0x2 - ldrsb r0, [r5, r0] - b _081993D2 - .pool -_0819935C: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0819936A - movs r0, 0x1 - negs r0, r0 - b _081993D2 -_0819936A: - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0819937A - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - b _081993BC -_0819937A: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08199388 - movs r0, 0 - movs r1, 0x1 - b _081993BC -_08199388: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _0819939C - bl GetLRKeysState - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081993A2 -_0819939C: - movs r0, 0x1 - negs r0, r0 - b _081993BA -_081993A2: - ldrh r1, [r6, 0x2E] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _081993B8 - bl GetLRKeysState - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _081993CE -_081993B8: - movs r0, 0x1 -_081993BA: - movs r1, 0 -_081993BC: - bl sub_81991F8 - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - beq _081993CE - movs r0, 0x5 - bl PlaySE -_081993CE: - movs r0, 0x2 - negs r0, r0 -_081993D2: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8199334 - - thumb_func_start sub_81993D8 -sub_81993D8: @ 81993D8 - push {r4,r5,lr} - ldr r4, =gMain - ldrh r1, [r4, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08199400 - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_0203CD90 - ldrb r0, [r0, 0x2] - lsls r0, 24 - asrs r0, 24 - b _0819947C - .pool -_08199400: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0819940E - movs r0, 0x1 - negs r0, r0 - b _0819947C -_0819940E: - ldrh r0, [r4, 0x30] - movs r5, 0xF0 - adds r1, r5, 0 - ands r1, r0 - cmp r1, 0x40 - bne _08199428 - movs r0, 0x5 - bl PlaySE - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - b _08199474 -_08199428: - cmp r1, 0x80 - bne _08199438 - movs r0, 0x5 - bl PlaySE - movs r0, 0 - movs r1, 0x1 - b _08199474 -_08199438: - cmp r1, 0x20 - beq _08199448 - bl sub_812210C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08199454 -_08199448: - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - negs r0, r0 - b _08199472 -_08199454: - ldrh r1, [r4, 0x30] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0x10 - beq _0819946A - bl sub_812210C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _08199478 -_0819946A: - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 -_08199472: - movs r1, 0 -_08199474: - bl sub_8199134 -_08199478: - movs r0, 0x2 - negs r0, r0 -_0819947C: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81993D8 - - thumb_func_start sub_8199484 -sub_8199484: @ 8199484 - push {r4-r6,lr} - ldr r6, =gUnknown_0203CD90 - ldrb r4, [r6, 0x2] - ldr r5, =gMain - ldrh r1, [r5, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081994AC - movs r0, 0x5 - bl PlaySE - movs r0, 0x2 - ldrsb r0, [r6, r0] - b _0819951E - .pool -_081994AC: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081994BA - movs r0, 0x1 - negs r0, r0 - b _0819951E -_081994BA: - ldrh r0, [r5, 0x30] - movs r6, 0xF0 - adds r1, r6, 0 - ands r1, r0 - cmp r1, 0x40 - bne _081994CE - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - b _08199508 -_081994CE: - cmp r1, 0x80 - bne _081994D8 - movs r0, 0 - movs r1, 0x1 - b _08199508 -_081994D8: - cmp r1, 0x20 - beq _081994E8 - bl sub_812210C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081994EE -_081994E8: - movs r0, 0x1 - negs r0, r0 - b _08199506 -_081994EE: - ldrh r1, [r5, 0x30] - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0x10 - beq _08199504 - bl sub_812210C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _0819951A -_08199504: - movs r0, 0x1 -_08199506: - movs r1, 0 -_08199508: - bl sub_81991F8 - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - beq _0819951A - movs r0, 0x5 - bl PlaySE -_0819951A: - movs r0, 0x2 - negs r0, r0 -_0819951E: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8199484 - - thumb_func_start InitMenuInUpperLeftCorner -@ int InitMenuInUpperLeftCorner(s8 windowId, s8 numItems, u8 initialCursorPos, bool doNotPlaySoundWhenAPressed) -InitMenuInUpperLeftCorner: @ 8199524 - push {r4-r6,lr} - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r5, r2, 24 - ldr r4, =gUnknown_0203CD90 - movs r6, 0 - strb r6, [r4] - movs r2, 0x1 - strb r2, [r4, 0x1] - strb r6, [r4, 0x3] - subs r1, 0x1 - strb r1, [r4, 0x4] - strb r0, [r4, 0x5] - strb r2, [r4, 0x6] - movs r0, 0x10 - strb r0, [r4, 0x8] - strb r3, [r4, 0xB] - cmp r5, 0 - blt _08199554 - movs r0, 0x4 - ldrsb r0, [r4, r0] - cmp r5, r0 - ble _0819955C -_08199554: - strb r6, [r4, 0x2] - b _0819955E - .pool -_0819955C: - strb r5, [r4, 0x2] -_0819955E: - movs r0, 0 - bl MoveMenuCursor - lsls r0, 24 - lsrs r0, 24 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end InitMenuInUpperLeftCorner - - thumb_func_start InitMenuInUpperLeftCornerPlaySoundWhenAPressed -InitMenuInUpperLeftCornerPlaySoundWhenAPressed: @ 8199570 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - movs r3, 0 - bl InitMenuInUpperLeftCorner - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end InitMenuInUpperLeftCornerPlaySoundWhenAPressed - - thumb_func_start PrintMenuTable -PrintMenuTable: @ 819958C - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r1, 24 - lsrs r7, r1, 24 - movs r5, 0 - cmp r5, r7 - bcs _081995D0 - movs r6, 0x80 - lsls r6, 17 - adds r4, r2, 0 -_081995AA: - ldr r2, [r4] - lsrs r0, r6, 24 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - mov r0, r8 - movs r1, 0x1 - movs r3, 0x8 - bl Print - movs r0, 0x80 - lsls r0, 21 - adds r6, r0 - adds r4, 0x8 - adds r5, 0x1 - cmp r5, r7 - bcc _081995AA -_081995D0: - mov r0, r8 - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end PrintMenuTable - - thumb_func_start sub_81995E4 -sub_81995E4: @ 81995E4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - mov r9, r2 - mov r8, r3 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r7, r1, 24 - mov r0, sp - movs r1, 0 - mov r10, r1 - strb r6, [r0, 0x4] - mov r1, sp - movs r0, 0x1 - strb r0, [r1, 0x5] - movs r1, 0x5 - bl GetFontAttribute - mov r3, sp - lsls r0, 4 - ldrb r2, [r3, 0xC] - movs r5, 0xF - adds r1, r5, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xC] - movs r0, 0x1 - movs r1, 0x6 - bl GetFontAttribute - mov r3, sp - adds r1, r5, 0 - ands r1, r0 - ldrb r2, [r3, 0xD] - movs r4, 0x10 - negs r4, r4 - adds r0, r4, 0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0xD] - movs r0, 0x1 - movs r1, 0x7 - bl GetFontAttribute - mov r3, sp - lsls r0, 4 - ldrb r2, [r3, 0xD] - adds r1, r5, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xD] - movs r0, 0x1 - movs r1, 0x4 - bl GetFontAttribute - mov r1, sp - ands r5, r0 - ldrb r0, [r1, 0xC] - ands r4, r0 - orrs r4, r5 - strb r4, [r1, 0xC] - mov r0, sp - mov r1, r10 - strb r1, [r0, 0xA] - strb r1, [r0, 0xB] - movs r1, 0x8 - strb r1, [r0, 0x6] - strb r1, [r0, 0x8] - movs r4, 0 - cmp r4, r7 - bcs _081996A6 - mov r5, sp -_0819967C: - mov r1, r8 - adds r0, r1, r4 - ldrb r0, [r0] - lsls r0, 3 - add r0, r9 - ldr r0, [r0] - str r0, [sp] - lsls r0, r4, 4 - adds r0, 0x1 - strb r0, [r5, 0x7] - strb r0, [r5, 0x9] - mov r0, sp - movs r1, 0xFF - movs r2, 0 - bl AddTextPrinter - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r7 - bcc _0819967C -_081996A6: - adds r0, r6, 0 - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81995E4 - - thumb_func_start CreateYesNoMenu -@ void CreateYesNoMenu(struct WindowTemplate *windowTemplate, u16 borderFirstTileNum, u8 borderPalette, u8 initialCursorPos) -CreateYesNoMenu: @ 81996C0 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x10 - adds r4, r1, 0 - adds r5, r2, 0 - adds r6, r3, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - ldr r1, =gUnknown_0203CD9F - mov r8, r1 - bl AddWindow - mov r2, r8 - strb r0, [r2] - ldrb r0, [r2] - movs r1, 0x1 - adds r2, r4, 0 - adds r3, r5, 0 - bl SetWindowBorderStyle - ldr r0, =gUnknown_085EE491 - str r0, [sp] - mov r1, sp - mov r2, r8 - ldrb r0, [r2] - movs r2, 0 - mov r9, r2 - strb r0, [r1, 0x4] - mov r0, sp - movs r2, 0x1 - strb r2, [r0, 0x5] - movs r0, 0x8 - strb r0, [r1, 0x6] - mov r0, sp - strb r2, [r0, 0x7] - ldrb r0, [r0, 0x6] - strb r0, [r1, 0x8] - mov r0, sp - ldrb r0, [r0, 0x7] - strb r0, [r1, 0x9] - movs r0, 0x1 - movs r1, 0x5 - bl GetFontAttribute - mov r3, sp - lsls r0, 4 - ldrb r2, [r3, 0xC] - movs r5, 0xF - adds r1, r5, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xC] - movs r0, 0x1 - movs r1, 0x6 - bl GetFontAttribute - mov r3, sp - adds r1, r5, 0 - ands r1, r0 - ldrb r2, [r3, 0xD] - movs r4, 0x10 - negs r4, r4 - adds r0, r4, 0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0xD] - movs r0, 0x1 - movs r1, 0x7 - bl GetFontAttribute - mov r3, sp - lsls r0, 4 - ldrb r2, [r3, 0xD] - adds r1, r5, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xD] - movs r0, 0x1 - movs r1, 0x4 - bl GetFontAttribute - mov r1, sp - ands r5, r0 - ldrb r0, [r1, 0xC] - ands r4, r0 - orrs r4, r5 - strb r4, [r1, 0xC] - mov r0, sp - mov r1, r9 - strb r1, [r0, 0xA] - strb r1, [r0, 0xB] - movs r1, 0xFF - movs r2, 0 - bl AddTextPrinter - mov r2, r8 - ldrb r0, [r2] - movs r1, 0x2 - adds r2, r6, 0 - bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end CreateYesNoMenu - - thumb_func_start sub_81997AC -sub_81997AC: @ 81997AC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0xC] - lsls r2, 24 - lsrs r6, r2, 24 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x10] - movs r7, 0 - cmp r7, r3 - bcs _08199824 -_081997D4: - movs r4, 0 - adds r0, r7, 0x1 - mov r9, r0 - cmp r4, r6 - bcs _0819981C - lsls r0, r7, 4 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r5, 0x80 - lsls r5, 20 -_081997EC: - adds r0, r7, 0 - muls r0, r6 - adds r0, r4 - lsls r0, 3 - ldr r1, [sp, 0x34] - adds r0, r1 - ldr r2, [r0] - lsrs r3, r5, 24 - mov r0, r8 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - mov r0, r10 - movs r1, 0x1 - bl Print - ldr r1, [sp, 0xC] - lsls r0, r1, 24 - adds r5, r0 - adds r4, 0x1 - cmp r4, r6 - bcc _081997EC -_0819981C: - mov r7, r9 - ldr r4, [sp, 0x10] - cmp r7, r4 - bcc _081997D4 -_08199824: - mov r0, r10 - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0x14 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81997AC - - thumb_func_start sub_819983C -sub_819983C: @ 819983C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x10] - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x14] - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - lsls r3, 24 - lsrs r3, 24 - mov r10, r3 - mov r0, sp - movs r6, 0 - ldrb r1, [r0, 0x10] - strb r1, [r0, 0x4] - mov r1, sp - movs r0, 0x1 - strb r0, [r1, 0x5] - movs r1, 0x5 - bl GetFontAttribute - mov r3, sp - lsls r0, 4 - ldrb r2, [r3, 0xC] - movs r5, 0xF - adds r1, r5, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xC] - movs r0, 0x1 - movs r1, 0x6 - bl GetFontAttribute - mov r3, sp - adds r1, r5, 0 - ands r1, r0 - ldrb r2, [r3, 0xD] - movs r4, 0x10 - negs r4, r4 - adds r0, r4, 0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0xD] - movs r0, 0x1 - movs r1, 0x7 - bl GetFontAttribute - mov r3, sp - lsls r0, 4 - ldrb r2, [r3, 0xD] - adds r1, r5, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xD] - movs r0, 0x1 - movs r1, 0x4 - bl GetFontAttribute - mov r1, sp - ands r5, r0 - ldrb r0, [r1, 0xC] - ands r4, r0 - orrs r4, r5 - strb r4, [r1, 0xC] - mov r0, sp - strb r6, [r0, 0xA] - strb r6, [r0, 0xB] - movs r7, 0 - cmp r7, r10 - bcs _0819992A -_081998D6: - movs r5, 0 - adds r2, r7, 0x1 - mov r9, r2 - cmp r5, r8 - bcs _08199920 - mov r4, sp - lsls r0, r7, 4 - adds r6, r0, 0x1 -_081998E6: - mov r0, r8 - muls r0, r7 - adds r0, r5 - ldr r1, [sp, 0x3C] - adds r0, r1, r0 - ldrb r0, [r0] - lsls r0, 3 - ldr r2, [sp, 0x38] - adds r0, r2 - ldr r0, [r0] - str r0, [sp] - ldr r1, [sp, 0x14] - adds r0, r1, 0 - muls r0, r5 - adds r0, 0x8 - strb r0, [r4, 0x6] - strb r6, [r4, 0x7] - strb r0, [r4, 0x8] - strb r6, [r4, 0x9] - mov r0, sp - movs r1, 0xFF - movs r2, 0 - bl AddTextPrinter - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, r8 - bcc _081998E6 -_08199920: - mov r2, r9 - lsls r0, r2, 24 - lsrs r7, r0, 24 - cmp r7, r10 - bcc _081998D6 -_0819992A: - ldr r0, [sp, 0x10] - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_819983C - - thumb_func_start sub_8199944 -sub_8199944: @ 8199944 - push {r4-r7,lr} - ldr r4, [sp, 0x14] - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r7, r4, 24 - ldr r6, =gUnknown_0203CD90 - movs r4, 0 - mov r12, r4 - mov r4, r12 - strb r4, [r6] - movs r5, 0x1 - strb r5, [r6, 0x1] - strb r4, [r6, 0x3] - adds r4, r2, 0 - muls r4, r3 - subs r4, 0x1 - strb r4, [r6, 0x4] - strb r0, [r6, 0x5] - strb r5, [r6, 0x6] - strb r1, [r6, 0x7] - movs r0, 0x10 - strb r0, [r6, 0x8] - strb r2, [r6, 0x9] - strb r3, [r6, 0xA] - cmp r7, 0 - blt _08199986 - movs r0, 0x4 - ldrsb r0, [r6, r0] - cmp r7, r0 - ble _08199990 -_08199986: - mov r0, r12 - strb r0, [r6, 0x2] - b _08199992 - .pool -_08199990: - strb r7, [r6, 0x2] -_08199992: - movs r0, 0 - movs r1, 0 - bl sub_8199134 - ldr r0, =gUnknown_0203CD90 - ldrb r0, [r0, 0x2] - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8199944 - - thumb_func_start clear_scheduled_bg_copies_to_vram -@ void clear_scheduled_bg_copies_to_vram() -clear_scheduled_bg_copies_to_vram: @ 81999A8 - push {lr} - ldr r0, =gUnknown_0203CDA4 - movs r1, 0 - movs r2, 0x4 - bl memset - pop {r0} - bx r0 - .pool - thumb_func_end clear_scheduled_bg_copies_to_vram - - thumb_func_start schedule_bg_copy_tilemap_to_vram -@ void schedule_bg_copy_tilemap_to_vram(u8 bg_id) -schedule_bg_copy_tilemap_to_vram: @ 81999BC - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0203CDA4 - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] - bx lr - .pool - thumb_func_end schedule_bg_copy_tilemap_to_vram - - thumb_func_start do_scheduled_bg_tilemap_copies_to_vram -@ void do_scheduled_bg_tilemap_copies_to_vram() -do_scheduled_bg_tilemap_copies_to_vram: @ 81999D0 - push {r4,lr} - ldr r4, =gUnknown_0203CDA4 - ldrb r0, [r4] - cmp r0, 0x1 - bne _081999E4 - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0 - strb r0, [r4] -_081999E4: - ldrb r0, [r4, 0x1] - cmp r0, 0x1 - bne _081999F4 - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - movs r0, 0 - strb r0, [r4, 0x1] -_081999F4: - ldrb r0, [r4, 0x2] - cmp r0, 0x1 - bne _08199A04 - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - movs r0, 0 - strb r0, [r4, 0x2] -_08199A04: - ldrb r0, [r4, 0x3] - cmp r0, 0x1 - bne _08199A14 - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - movs r0, 0 - strb r0, [r4, 0x3] -_08199A14: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end do_scheduled_bg_tilemap_copies_to_vram - - thumb_func_start reset_temp_tile_data_buffers -@ void reset_temp_tile_data_buffers() -reset_temp_tile_data_buffers: @ 8199A20 - push {lr} - ldr r3, =gUnknown_0203CDA8 - ldr r1, =gUnknown_0203CDAC - movs r2, 0 - adds r0, r1, 0 - adds r0, 0x7C -_08199A2C: - str r2, [r0] - subs r0, 0x4 - cmp r0, r1 - bge _08199A2C - movs r0, 0 - strh r0, [r3] - pop {r0} - bx r0 - .pool - thumb_func_end reset_temp_tile_data_buffers - - thumb_func_start free_temp_tile_data_buffers_if_possible -free_temp_tile_data_buffers_if_possible: @ 8199A44 - push {r4-r6,lr} - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _08199A88 - ldr r1, =gUnknown_0203CDA8 - ldrh r0, [r1] - cmp r0, 0 - beq _08199A7C - movs r4, 0 - ldrh r1, [r1] - cmp r4, r1 - bge _08199A76 - ldr r5, =gUnknown_0203CDAC - movs r6, 0 -_08199A64: - ldr r0, [r5] - bl Free - stm r5!, {r6} - adds r4, 0x1 - ldr r0, =gUnknown_0203CDA8 - ldrh r0, [r0] - cmp r4, r0 - blt _08199A64 -_08199A76: - ldr r1, =gUnknown_0203CDA8 - movs r0, 0 - strh r0, [r1] -_08199A7C: - movs r0, 0 - b _08199A8A - .pool -_08199A88: - movs r0, 0x1 -_08199A8A: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end free_temp_tile_data_buffers_if_possible - - thumb_func_start decompress_and_copy_tile_data_to_vram -@ int decompress_and_copy_tile_data_to_vram(u8 bg_id, int src, int size, u16 offset, u8 mode) -decompress_and_copy_tile_data_to_vram: @ 8199A90 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x8 - adds r4, r1, 0 - adds r5, r2, 0 - ldr r1, [sp, 0x24] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r3, 16 - lsrs r3, 16 - mov r9, r3 - lsls r1, 24 - lsrs r7, r1, 24 - ldr r6, =gUnknown_0203CDA8 - ldrh r0, [r6] - cmp r0, 0x1F - bhi _08199AF8 - adds r0, r4, 0 - add r1, sp, 0x4 - bl malloc_and_decompress - adds r4, r0, 0 - cmp r5, 0 - bne _08199AC8 - ldr r5, [sp, 0x4] -_08199AC8: - cmp r4, 0 - beq _08199AEC - lsls r2, r5, 16 - lsrs r2, 16 - str r7, [sp] - mov r0, r8 - adds r1, r4, 0 - mov r3, r9 - bl copy_decompressed_tile_data_to_vram - ldr r2, =gUnknown_0203CDAC - ldrh r0, [r6] - adds r1, r0, 0x1 - strh r1, [r6] - lsls r0, 16 - lsrs r0, 14 - adds r0, r2 - str r4, [r0] -_08199AEC: - adds r0, r4, 0 - b _08199AFA - .pool -_08199AF8: - movs r0, 0 -_08199AFA: - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end decompress_and_copy_tile_data_to_vram - - thumb_func_start copy_decompressed_tile_data_to_vram_autofree -@ void copy_decompressed_tile_data_to_vram_autofree(u8 bg_id, int src, u16 size, u16 offset, u8 mode) -copy_decompressed_tile_data_to_vram_autofree: @ 8199B08 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x8 - adds r5, r2, 0 - ldr r2, [sp, 0x24] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r3, 16 - lsrs r3, 16 - mov r9, r3 - lsls r2, 24 - lsrs r7, r2, 24 - adds r0, r1, 0 - add r1, sp, 0x4 - bl malloc_and_decompress - adds r6, r0, 0 - cmp r5, 0 - bne _08199B36 - ldr r5, [sp, 0x4] -_08199B36: - cmp r6, 0 - beq _08199B6E - ldr r0, =task_free_buf_after_copying_tile_data_to_vram - movs r1, 0 - bl CreateTask - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r2, r5, 16 - lsrs r2, 16 - str r7, [sp] - mov r0, r8 - adds r1, r6, 0 - mov r3, r9 - bl copy_decompressed_tile_data_to_vram - ldr r2, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r2 - strh r0, [r1, 0x8] - adds r0, r4, 0 - movs r1, 0x1 - adds r2, r6, 0 - bl SetWordTaskArg -_08199B6E: - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end copy_decompressed_tile_data_to_vram_autofree - - thumb_func_start task_free_buf_after_copying_tile_data_to_vram -@ void task_free_buf_after_copying_tile_data_to_vram(int task_id) -task_free_buf_after_copying_tile_data_to_vram: @ 8199B84 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0x8 - ldrsh r0, [r0, r1] - bl CheckForSpaceForDma3Request - lsls r0, 16 - cmp r0, 0 - bne _08199BB4 - adds r0, r4, 0 - movs r1, 0x1 - bl GetWordTaskArg - bl Free - adds r0, r4, 0 - bl DestroyTask -_08199BB4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task_free_buf_after_copying_tile_data_to_vram - - thumb_func_start malloc_and_decompress -@ void *malloc_and_decompress(void *src, int *size) -malloc_and_decompress: @ 8199BC0 - push {r4,r5,lr} - adds r5, r0, 0 - ldrb r0, [r5, 0x1] - strb r0, [r1] - ldrb r0, [r5, 0x2] - strb r0, [r1, 0x1] - ldrb r0, [r5, 0x3] - strb r0, [r1, 0x2] - movs r0, 0 - strb r0, [r1, 0x3] - ldr r0, [r1] - bl Alloc - adds r4, r0, 0 - cmp r4, 0 - beq _08199BE8 - adds r0, r5, 0 - adds r1, r4, 0 - bl LZ77UnCompWram -_08199BE8: - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end malloc_and_decompress - - thumb_func_start copy_decompressed_tile_data_to_vram -@ s16 copy_decompressed_tile_data_to_vram(u8 bg_id, int src, u16 size, u16 offset, u8 mode) -copy_decompressed_tile_data_to_vram: @ 8199BF0 - push {r4,lr} - adds r4, r1, 0 - ldr r1, [sp, 0x8] - lsls r0, 24 - lsrs r0, 24 - lsls r2, 16 - lsrs r2, 16 - lsls r3, 16 - lsrs r3, 16 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0 - beq _08199C18 - cmp r1, 0x1 - beq _08199C20 - ldr r0, =0x0000ffff - b _08199C2A - .pool -_08199C18: - adds r1, r4, 0 - bl LoadBgTiles - b _08199C26 -_08199C20: - adds r1, r4, 0 - bl LoadBgTilemap -_08199C26: - lsls r0, 16 - lsrs r0, 16 -_08199C2A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end copy_decompressed_tile_data_to_vram - - thumb_func_start sub_8199C30 -sub_8199C30: @ 8199C30 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - adds r5, r2, 0 - ldr r4, [sp, 0x28] - ldr r2, [sp, 0x2C] - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp] - lsls r5, 24 - lsrs r5, 24 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x4] - lsls r4, 24 - lsrs r4, 24 - lsls r2, 24 - lsrs r2, 24 - mov r10, r2 - bl GetBgTilemapBuffer - mov r8, r0 - adds r0, r5, r4 - cmp r5, r0 - bge _08199CA8 - mov r9, r0 -_08199C6E: - ldr r3, [sp] - ldr r1, [sp, 0x4] - adds r0, r3, r1 - adds r7, r5, 0x1 - cmp r3, r0 - bge _08199CA0 - lsls r6, r5, 5 - ldr r1, =0x00000fff - mov r12, r1 - mov r1, r10 - lsls r5, r1, 12 - adds r4, r0, 0 -_08199C86: - adds r1, r6, r3 - lsls r1, 1 - add r1, r8 - ldrh r2, [r1] - mov r0, r12 - ands r0, r2 - orrs r0, r5 - strh r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, r4 - blt _08199C86 -_08199CA0: - lsls r0, r7, 24 - lsrs r5, r0, 24 - cmp r5, r9 - blt _08199C6E -_08199CA8: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8199C30 - - thumb_func_start sub_8199CBC -sub_8199CBC: @ 8199CBC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r10, r1 - ldr r1, [sp, 0x24] - ldr r4, [sp, 0x28] - lsls r0, 24 - lsrs r0, 24 - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp] - lsls r1, 24 - lsrs r5, r1, 24 - lsls r4, 24 - lsrs r4, 24 - mov r8, r4 - bl GetBgTilemapBuffer - adds r7, r0, 0 - movs r0, 0 - cmp r0, r8 - bcs _08199D2A -_08199CF4: - movs r2, 0 - adds r6, r0, 0x1 - cmp r2, r5 - bcs _08199D22 - adds r4, r0, 0 - muls r4, r5 - ldr r1, [sp] - adds r0, r1 - lsls r3, r0, 5 -_08199D06: - adds r1, r4, r2 - lsls r1, 1 - add r1, r10 - adds r0, r3, r2 - add r0, r9 - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, r5 - bcc _08199D06 -_08199D22: - lsls r0, r6, 24 - lsrs r0, 24 - cmp r0, r8 - bcc _08199CF4 -_08199D2A: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8199CBC - - thumb_func_start sub_8199D3C -sub_8199D3C: @ 8199D3C - push {r4-r7,lr} - adds r6, r0, 0 - adds r5, r1, 0 - ldr r0, [sp, 0x14] - adds r4, r2, 0 - muls r4, r3 - cmp r0, 0x1 - bne _08199D64 - adds r3, r6, 0 - movs r2, 0 - cmp r2, r4 - bge _08199D8C -_08199D54: - adds r1, r3, r2 - ldrb r0, [r1] - adds r0, r5 - strb r0, [r1] - adds r2, 0x1 - cmp r2, r4 - blt _08199D54 - b _08199D8C -_08199D64: - cmp r4, 0 - ble _08199D8C - movs r0, 0xFC - lsls r0, 8 - mov r12, r0 - ldr r0, =0x000003ff - adds r7, r0, 0 - adds r3, r6, 0 - adds r2, r4, 0 -_08199D76: - ldrh r0, [r3] - mov r1, r12 - ands r1, r0 - adds r0, r5 - ands r0, r7 - orrs r1, r0 - strh r1, [r3] - adds r3, 0x2 - subs r2, 0x1 - cmp r2, 0 - bne _08199D76 -_08199D8C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8199D3C - - thumb_func_start sub_8199D98 -sub_8199D98: @ 8199D98 - push {lr} - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - pop {r0} - bx r0 - thumb_func_end sub_8199D98 - - thumb_func_start sub_8199DF0 -sub_8199DF0: @ 8199DF0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - mov r8, r2 - mov r9, r3 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r5, 0 - movs r1, 0x4 - bl GetBgAttribute - lsls r0, 16 - movs r7, 0x40 - cmp r0, 0 - bne _08199E16 - movs r7, 0x20 -_08199E16: - adds r0, r5, 0 - movs r1, 0x1 - bl GetBgAttribute - adds r4, r0, 0 - adds r0, r5, 0 - movs r1, 0xA - bl GetBgAttribute - lsls r4, 16 - lsrs r4, 2 - lsls r0, 16 - lsrs r0, 16 - add r0, r8 - muls r0, r7 - adds r4, r0 - lsls r0, r6, 24 - lsls r1, r6, 16 - orrs r0, r1 - lsls r1, r6, 8 - orrs r0, r1 - orrs r0, r6 - movs r1, 0xC0 - lsls r1, 19 - adds r4, r1 - mov r2, r9 - muls r2, r7 - lsls r2, 16 - lsrs r2, 16 - adds r1, r4, 0 - movs r3, 0x1 - bl RequestDma3Fill - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8199DF0 - - thumb_func_start box_print -box_print: @ 8199E64 - push {r4-r6,lr} - sub sp, 0x10 - adds r4, r1, 0 - ldr r6, [sp, 0x20] - ldr r5, [sp, 0x24] - ldr r1, [sp, 0x28] - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - str r1, [sp] - mov r1, sp - strb r0, [r1, 0x4] - mov r0, sp - strb r4, [r0, 0x5] - strb r2, [r0, 0x6] - strb r3, [r0, 0x7] - ldrb r0, [r0, 0x6] - strb r0, [r1, 0x8] - mov r0, sp - ldrb r0, [r0, 0x7] - strb r0, [r1, 0x9] - adds r0, r4, 0 - movs r1, 0x2 - bl GetFontAttribute - mov r1, sp - strb r0, [r1, 0xA] - adds r0, r4, 0 - movs r1, 0x3 - bl GetFontAttribute - mov r1, sp - strb r0, [r1, 0xB] - mov r3, sp - ldrb r2, [r3, 0xC] - movs r1, 0x10 - negs r1, r1 - adds r0, r1, 0 - ands r0, r2 - strb r0, [r3, 0xC] - mov r2, sp - ldrb r0, [r6, 0x1] - lsls r0, 4 - movs r4, 0xF - strb r0, [r2, 0xC] - ldrb r2, [r6] - adds r0, r4, 0 - ands r0, r2 - ldrb r2, [r3, 0xD] - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xD] - mov r2, sp - ldrb r0, [r6, 0x2] - lsls r0, 4 - ands r1, r4 - orrs r1, r0 - strb r1, [r2, 0xD] - mov r0, sp - adds r1, r5, 0 - movs r2, 0 - bl AddTextPrinter - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end box_print - - 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 - push {r5,r6} - sub sp, 0x10 - adds r5, r1, 0 - ldr r1, [sp, 0x28] - mov r8, r1 - ldr r1, [sp, 0x2C] - mov r9, r1 - ldr r6, [sp, 0x30] - ldr r1, [sp, 0x34] - ldr r4, [sp, 0x38] - str r4, [sp] - mov r4, sp - strb r0, [r4, 0x4] - mov r0, sp - strb r5, [r0, 0x5] - strb r2, [r0, 0x6] - strb r3, [r0, 0x7] - mov r2, sp - ldrb r0, [r0, 0x6] - strb r0, [r2, 0x8] - mov r0, sp - ldrb r0, [r0, 0x7] - strb r0, [r2, 0x9] - mov r0, sp - mov r2, r8 - strb r2, [r0, 0xA] - mov r2, r9 - strb r2, [r0, 0xB] - ldrb r3, [r4, 0xC] - movs r2, 0x10 - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - strb r0, [r4, 0xC] - mov r3, sp - ldrb r0, [r6, 0x1] - lsls r0, 4 - movs r5, 0xF - strb r0, [r3, 0xC] - ldrb r3, [r6] - adds r0, r5, 0 - ands r0, r3 - ldrb r3, [r4, 0xD] - ands r2, r3 - orrs r2, r0 - strb r2, [r4, 0xD] - mov r3, sp - ldrb r0, [r6, 0x2] - lsls r0, 4 - ands r2, r5 - orrs r2, r0 - strb r2, [r3, 0xD] - lsls r1, 24 - lsrs r1, 24 - mov r0, sp - movs r2, 0 - bl AddTextPrinter - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end AddTextPrinterParametrized2 - - thumb_func_start sub_8199F74 -sub_8199F74: @ 8199F74 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - adds r6, r1, 0 - ldr r4, [sp, 0x2C] - ldr r1, [sp, 0x30] - mov r8, r1 - ldr r7, [sp, 0x34] - ldr r5, [sp, 0x38] - ldr r1, [sp, 0x3C] - mov r9, r1 - lsls r6, 24 - lsrs r6, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - mov r1, r8 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - str r2, [sp] - mov r1, sp - strb r0, [r1, 0x4] - mov r0, sp - strb r6, [r0, 0x5] - strb r3, [r0, 0x6] - strb r4, [r0, 0x7] - strb r3, [r0, 0x8] - strb r4, [r0, 0x9] - strb r5, [r0, 0xA] - mov r1, r9 - strb r1, [r0, 0xB] - mov r2, sp - ldrb r1, [r2, 0xC] - movs r5, 0x10 - negs r5, r5 - adds r0, r5, 0 - ands r0, r1 - strb r0, [r2, 0xC] - adds r0, r6, 0 - movs r1, 0x5 - bl GetFontAttribute - mov r3, sp - lsls r0, 4 - ldrb r2, [r3, 0xC] - movs r4, 0xF - adds r1, r4, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xC] - adds r0, r6, 0 - movs r1, 0x6 - bl GetFontAttribute - mov r2, sp - adds r1, r4, 0 - ands r1, r0 - ldrb r0, [r2, 0xD] - ands r5, r0 - orrs r5, r1 - strb r5, [r2, 0xD] - adds r0, r6, 0 - movs r1, 0x7 - bl GetFontAttribute - mov r2, sp - lsls r0, 4 - ldrb r1, [r2, 0xD] - ands r4, r1 - orrs r4, r0 - strb r4, [r2, 0xD] - mov r0, sp - mov r1, r8 - adds r2, r7, 0 - bl AddTextPrinter - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8199F74 - - thumb_func_start sub_819A024 -sub_819A024: @ 819A024 - push {r4-r7,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r7, r0, 24 - lsls r2, 16 - lsrs r4, r2, 16 - lsls r3, 16 - lsrs r5, r3, 16 - movs r2, 0 - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldrb r0, [r3] - ldr r6, =gStringVar4 - cmp r0, 0xFF - beq _0819A04C -_0819A042: - adds r2, 0x1 - adds r0, r3, r2 - ldrb r0, [r0] - cmp r0, 0xFF - bne _0819A042 -_0819A04C: - adds r0, r6, 0 - bl StringExpandPlaceholders - lsls r3, r4, 24 - lsrs r3, 24 - lsls r0, r5, 24 - lsrs r0, 24 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - adds r0, r7, 0 - movs r1, 0x1 - adds r2, r6, 0 - bl Print - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819A024 - - thumb_func_start sub_819A080 -sub_819A080: @ 819A080 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x28 - str r0, [sp] - str r1, [sp, 0x4] - ldr r0, [sp, 0x48] - ldr r4, [sp, 0x4C] - ldr r1, [sp, 0x50] - ldr r5, [sp, 0x54] - lsls r2, 16 - lsrs r2, 16 - str r2, [sp, 0x8] - lsls r3, 16 - lsrs r3, 16 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0xC] - lsls r4, 16 - lsrs r4, 16 - lsls r1, 16 - lsrs r1, 16 - lsls r5, 16 - lsrs r5, 16 - ldr r2, [sp, 0x4] - ldrh r0, [r2, 0x4] - ldr r2, [sp, 0xC] - subs r0, r2 - ldr r2, [sp, 0x8] - adds r2, r1, r2 - str r2, [sp, 0x10] - cmp r0, r1 - bge _0819A0CC - ldr r1, [sp, 0x8] - adds r0, r1 - str r0, [sp, 0x10] -_0819A0CC: - ldr r2, [sp, 0x4] - ldrh r1, [r2, 0x6] - subs r0, r1, r4 - cmp r0, r5 - bge _0819A0DE - adds r0, r3, r1 - subs r0, r4 - str r0, [sp, 0x14] - b _0819A0E2 -_0819A0DE: - adds r5, r3, r5 - str r5, [sp, 0x14] -_0819A0E2: - ldr r0, [sp] - ldrh r1, [r0, 0x4] - movs r2, 0x7 - adds r0, r1, 0 - ands r0, r2 - adds r1, r0 - asrs r1, 3 - str r1, [sp, 0x18] - ldr r0, [sp, 0x4] - ldrh r1, [r0, 0x4] - adds r0, r1, 0 - ands r0, r2 - adds r1, r0 - asrs r1, 3 - str r1, [sp, 0x1C] - mov r12, r3 - mov r8, r4 - ldr r1, [sp, 0x14] - cmp r12, r1 - blt _0819A10C - b _0819A24A -_0819A10C: - ldr r5, [sp, 0x8] - ldr r6, [sp, 0xC] - mov r2, r12 - adds r2, 0x1 - str r2, [sp, 0x20] - mov r0, r8 - adds r0, 0x1 - str r0, [sp, 0x24] - ldr r1, [sp, 0x10] - cmp r5, r1 - blt _0819A124 - b _0819A23A -_0819A124: - movs r7, 0x1 - movs r2, 0xF0 - mov r10, r2 - movs r0, 0xF - mov r9, r0 -_0819A12E: - asrs r0, r5, 1 - movs r1, 0x3 - ands r0, r1 - ldr r2, [sp] - ldr r1, [r2] - adds r1, r0 - asrs r0, r5, 3 - lsls r0, 5 - adds r1, r0 - mov r2, r12 - asrs r0, r2, 3 - ldr r2, [sp, 0x18] - muls r0, r2 - lsls r0, 5 - adds r1, r0 - mov r2, r12 - lsls r0, r2, 29 - lsrs r0, 27 - adds r3, r1, r0 - asrs r0, r6, 1 - movs r1, 0x3 - ands r0, r1 - ldr r2, [sp, 0x4] - ldr r1, [r2] - adds r1, r0 - asrs r0, r6, 3 - lsls r0, 5 - adds r1, r0 - mov r2, r8 - asrs r0, r2, 3 - ldr r2, [sp, 0x1C] - muls r0, r2 - lsls r0, 5 - adds r1, r0 - mov r2, r8 - lsls r0, r2, 29 - lsrs r0, 27 - adds r4, r1, r0 - adds r0, r4, 0 - ands r0, r7 - cmp r0, 0 - beq _0819A1DA - subs r4, 0x1 - adds r0, r6, 0 - ands r0, r7 - cmp r0, 0 - beq _0819A1B2 - ldrh r0, [r4] - ldr r2, =0x00000fff - ands r2, r0 - adds r0, r5, 0 - ands r0, r7 - cmp r0, 0 - beq _0819A1A8 - ldrb r1, [r3] - mov r0, r10 - ands r0, r1 - lsls r0, 8 - b _0819A22A - .pool -_0819A1A8: - ldrb r1, [r3] - mov r0, r9 - ands r0, r1 - lsls r0, 12 - b _0819A22A -_0819A1B2: - ldrh r0, [r4] - ldr r2, =0x0000f0ff - ands r2, r0 - adds r0, r5, 0 - ands r0, r7 - cmp r0, 0 - beq _0819A1D0 - ldrb r1, [r3] - mov r0, r10 - ands r0, r1 - lsls r0, 4 - b _0819A22A - .pool -_0819A1D0: - ldrb r1, [r3] - mov r0, r9 - ands r0, r1 - lsls r0, 8 - b _0819A22A -_0819A1DA: - adds r0, r6, 0 - ands r0, r7 - cmp r0, 0 - beq _0819A206 - ldrh r0, [r4] - ldr r2, =0x0000ff0f - ands r2, r0 - adds r0, r5, 0 - ands r0, r7 - cmp r0, 0 - beq _0819A1FC - ldrb r1, [r3] - mov r0, r10 - b _0819A228 - .pool -_0819A1FC: - ldrb r1, [r3] - mov r0, r9 - ands r0, r1 - lsls r0, 4 - b _0819A22A -_0819A206: - ldrh r0, [r4] - ldr r2, =0x0000fff0 - ands r2, r0 - adds r0, r5, 0 - ands r0, r7 - cmp r0, 0 - beq _0819A224 - ldrb r1, [r3] - mov r0, r10 - ands r0, r1 - lsrs r0, 4 - b _0819A22A - .pool -_0819A224: - ldrb r1, [r3] - mov r0, r9 -_0819A228: - ands r0, r1 -_0819A22A: - orrs r2, r0 - strh r2, [r4] - adds r5, 0x1 - adds r6, 0x1 - ldr r0, [sp, 0x10] - cmp r5, r0 - bge _0819A23A - b _0819A12E -_0819A23A: - ldr r1, [sp, 0x20] - mov r12, r1 - ldr r2, [sp, 0x24] - mov r8, r2 - ldr r0, [sp, 0x14] - cmp r12, r0 - bge _0819A24A - b _0819A10C -_0819A24A: - add sp, 0x28 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_819A080 - - thumb_func_start sub_819A25C -sub_819A25C: @ 819A25C - push {r4,lr} - adds r4, r0, 0 - adds r0, r1, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r0, 16 - lsrs r0, 16 - bl sub_80D30B0 - adds r1, r4, 0 - movs r2, 0x20 - bl LoadPalette - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_819A25C - - thumb_func_start sub_819A27C -sub_819A27C: @ 819A27C - push {r4-r6,lr} - sub sp, 0x8 - adds r6, r0, 0 - adds r0, r1, 0 - adds r1, r2, 0 - adds r4, r3, 0 - ldr r5, [sp, 0x18] - lsls r6, 24 - lsrs r6, 24 - lsls r0, 16 - lsrs r0, 16 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - movs r2, 0x1 - bl sub_80D2EDC - adds r1, r0, 0 - movs r0, 0x20 - str r0, [sp] - str r0, [sp, 0x4] - adds r0, r6, 0 - adds r2, r4, 0 - adds r3, r5, 0 - bl BlitBitmapToWindow - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_819A27C - - thumb_func_start sub_819A2BC -sub_819A2BC: @ 819A2BC - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0x1 - beq _0819A2DC - cmp r1, 0x1 - ble _0819A2D2 - cmp r1, 0x2 - beq _0819A2E4 -_0819A2D2: - ldr r0, =gUnknown_08DC4318 - b _0819A2E6 - .pool -_0819A2DC: - ldr r0, =gUnknown_08DC4338 - b _0819A2E6 - .pool -_0819A2E4: - ldr r0, =gUnknown_08DC4358 -_0819A2E6: - adds r1, r2, 0 - movs r2, 0x20 - bl LoadPalette - pop {r0} - bx r0 - .pool - thumb_func_end sub_819A2BC - - thumb_func_start blit_move_info_icon -@ void blit_move_info_icon(u8 windowId, u8 a2, u16 x, u16 y) -blit_move_info_icon: @ 819A2F8 - push {r4,r5,lr} - sub sp, 0x18 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsls r2, 16 - lsrs r2, 16 - lsls r3, 16 - lsrs r3, 16 - ldr r4, =gUnknown_0860F0D4 - lsrs r1, 22 - adds r1, r4 - ldrh r5, [r1, 0x2] - lsls r5, 5 - ldr r4, =gUnknown_08DC4378 - adds r5, r4 - movs r4, 0x80 - str r4, [sp] - str r4, [sp, 0x4] - str r2, [sp, 0x8] - str r3, [sp, 0xC] - ldrb r2, [r1] - str r2, [sp, 0x10] - ldrb r1, [r1, 0x1] - str r1, [sp, 0x14] - adds r1, r5, 0 - movs r2, 0 - movs r3, 0 - bl BlitBitmapRectToWindow - add sp, 0x18 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end blit_move_info_icon - - thumb_func_start sub_819A344 -sub_819A344: @ 819A344 - push {r4-r7,lr} - lsls r0, 24 - lsrs r3, r0, 24 - lsls r2, 24 - lsrs r2, 24 - adds r5, r1, 0 - movs r1, 0xFC - strb r1, [r5] - adds r5, 0x1 - movs r0, 0x1 - strb r0, [r5] - adds r5, 0x1 - strb r2, [r5] - adds r5, 0x1 - strb r1, [r5] - adds r5, 0x1 - movs r0, 0x3 - strb r0, [r5] - adds r5, 0x1 - adds r2, 0x1 - strb r2, [r5] - adds r5, 0x1 - cmp r3, 0x4 - bhi _0819A43C - lsls r0, r3, 2 - ldr r1, =_0819A384 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0819A384: - .4byte _0819A398 - .4byte _0819A3A8 - .4byte _0819A3D6 - .4byte _0819A404 - .4byte _0819A414 -_0819A398: - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - adds r0, r5, 0 - bl StringCopy - b _0819A43C - .pool -_0819A3A8: - bl IsNationalPokedexEnabled - cmp r0, 0 - beq _0819A3B8 - movs r0, 0x1 - bl pokedex_count - b _0819A3BE -_0819A3B8: - movs r0, 0x1 - bl sub_80C0844 -_0819A3BE: - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r5, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - adds r5, r0, 0 - movs r0, 0xFF - strb r0, [r5] - b _0819A43C -_0819A3D6: - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldrh r1, [r0, 0xE] - adds r0, r5, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - adds r5, r0, 0 - movs r0, 0xF0 - strb r0, [r5] - adds r5, 0x1 - ldr r0, [r4] - ldrb r1, [r0, 0x10] - adds r0, r5, 0 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - b _0819A43C - .pool -_0819A404: - ldr r0, =gUnknown_02037318 - ldrb r1, [r0, 0x14] - adds r0, r5, 0 - bl sub_81245DC - b _0819A43C - .pool -_0819A414: - ldr r4, =0x00000867 - movs r6, 0 - adds r7, r5, 0x1 -_0819A41A: - lsls r0, r4, 16 - lsrs r0, 16 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _0819A42A - adds r6, 0x1 -_0819A42A: - adds r4, 0x1 - ldr r0, =0x0000086e - cmp r4, r0 - ble _0819A41A - adds r0, r6, 0 - subs r0, 0x5F - strb r0, [r5] - movs r0, 0xFF - strb r0, [r7] -_0819A43C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819A344 - - thumb_func_start sub_819A44C -sub_819A44C: @ 819A44C - push {r4,r5,lr} - adds r5, r0, 0 - ldrb r4, [r5, 0x5] - lsrs r4, 4 - movs r0, 0x65 - bl IndexOfSpritePaletteTag - lsls r0, 24 - lsls r4, 16 - lsrs r4, 16 - lsrs r0, 24 - cmp r4, r0 - bne _0819A4BA - adds r0, r5, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0819A4B0 - ldrh r1, [r5, 0x2E] - movs r2, 0x2E - ldrsh r0, [r5, r2] - cmp r0, 0 - beq _0819A484 - subs r0, r1, 0x1 - strh r0, [r5, 0x2E] - b _0819A4C2 -_0819A484: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x5 - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - bne _0819A4A6 - adds r0, r5, 0 - movs r1, 0 - bl StartSpriteAnim - movs r0, 0x20 - strh r0, [r5, 0x2E] - b _0819A4C2 -_0819A4A6: - adds r0, r5, 0 - movs r1, 0x1 - bl StartSpriteAnim - b _0819A4C2 -_0819A4B0: - adds r0, r5, 0 - movs r1, 0x1 - bl StartSpriteAnimIfDifferent - b _0819A4C2 -_0819A4BA: - adds r0, r5, 0 - movs r1, 0 - bl StartSpriteAnimIfDifferent -_0819A4C2: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_819A44C - - thumb_func_start sub_819A4C8 -sub_819A4C8: @ 819A4C8 - push {lr} - bl AnimateSprites - bl BuildOamBuffer - bl RunTextPrinters - bl UpdatePaletteFade - bl RunTasks - pop {r0} - bx r0 - thumb_func_end sub_819A4C8 - - thumb_func_start sub_819A4E4 -sub_819A4E4: @ 819A4E4 - push {lr} - bl LoadOam - bl ProcessSpriteCopyRequests - bl TransferPlttBuffer - pop {r0} - bx r0 - thumb_func_end sub_819A4E4 - - thumb_func_start sub_819A4F8 -sub_819A4F8: @ 819A4F8 - push {lr} - ldr r0, =gUnknown_0300127C - movs r1, 0 - str r1, [r0] - ldr r0, =sub_819A514 - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_819A4F8 - - thumb_func_start sub_819A514 -sub_819A514: @ 819A514 - push {r4,r5,lr} - sub sp, 0xC - ldr r0, =gMain - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0xA - bls _0819A528 - b _0819A98E -_0819A528: - lsls r0, 2 - ldr r1, =_0819A53C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0819A53C: - .4byte _0819A568 - .4byte _0819A5C0 - .4byte _0819A69C - .4byte _0819A77C - .4byte _0819A7CC - .4byte _0819A868 - .4byte _0819A8A4 - .4byte _0819A8AC - .4byte _0819A8C4 - .4byte _0819A8DC - .4byte _0819A8FC -_0819A568: - ldr r4, =gUnknown_0203CE3C - ldr r0, [r4] - cmp r0, 0 - beq _0819A578 - bl Free - movs r0, 0 - str r0, [r4] -_0819A578: - movs r0, 0 - bl SetHBlankCallback - movs r0, 0 - bl SetVBlankCallback - movs r0, 0 - str r0, [sp, 0x8] - movs r1, 0xC0 - lsls r1, 19 - ldr r2, =0x05006000 - add r0, sp, 0x8 - bl CpuSet - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_08610428 - movs r0, 0 - movs r2, 0x3 - bl InitBgsFromTemplates - ldr r0, =gUnknown_08610434 - bl InitWindows - bl DeactivateAllTextPrinters - b _0819A8E6 - .pool -_0819A5C0: - ldr r5, =gUnknown_0203CE2C - movs r4, 0x88 - lsls r4, 3 - adds r0, r4, 0 - bl Alloc - str r0, [r5] - ldr r5, =gUnknown_0203CE30 - adds r0, r4, 0 - bl AllocZeroed - str r0, [r5] - ldr r5, =gUnknown_0203CE34 - movs r4, 0x80 - lsls r4, 4 - adds r0, r4, 0 - bl Alloc - str r0, [r5] - ldr r5, =gUnknown_0203CE38 - adds r0, r4, 0 - bl AllocZeroed - str r0, [r5] - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - movs r0, 0x4C - movs r1, 0 - bl SetGpuReg - movs r0, 0x40 - movs r1, 0 - bl SetGpuReg - movs r0, 0x44 - movs r1, 0 - bl SetGpuReg - movs r0, 0x42 - movs r1, 0 - bl SetGpuReg - movs r0, 0x46 - movs r1, 0 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0 - bl SetGpuReg - movs r0, 0x4A - movs r1, 0 - bl SetGpuReg - ldr r1, =gMain - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _0819A8EE - .pool -_0819A69C: - bl ResetPaletteFade - bl ResetSpriteData - bl ResetTasks - bl FreeAllSpritePalettes - ldr r0, =gUnknown_08DC0754 - ldr r5, =gUnknown_0203CE2C - ldr r1, [r5] - movs r2, 0x88 - lsls r2, 2 - bl CpuSet - ldr r0, =gUnknown_0861033C - ldr r4, =gUnknown_0203CE30 - ldr r1, [r4] - movs r2, 0x30 - bl CpuSet - ldr r1, [r5] - movs r2, 0x88 - lsls r2, 3 - movs r0, 0x1 - movs r3, 0 - bl LoadBgTiles - ldr r1, [r4] - movs r0, 0x3 - movs r2, 0x60 - movs r3, 0 - bl LoadBgTiles - ldr r0, =gUnknown_08DC0B94 - ldr r4, =gUnknown_0203CE34 - ldr r1, [r4] - movs r2, 0x80 - lsls r2, 3 - bl CpuSet - ldr r1, [r4] - movs r2, 0x80 - lsls r2, 4 - movs r0, 0x1 - movs r3, 0 - bl LoadBgTilemap - ldr r0, =gUnknown_08DC0714 - movs r1, 0 - movs r2, 0x40 - bl LoadPalette - ldr r4, =gUnknown_0861046C - adds r0, r4, 0 - movs r1, 0xF0 - movs r2, 0x8 - bl LoadPalette - adds r0, r4, 0 - movs r1, 0xE0 - movs r2, 0xA - bl LoadPalette - ldr r0, =gUnknown_0300127C - ldr r1, [r0] - ldrb r0, [r1, 0x6] - cmp r0, 0x1 - bne _0819A738 - ldr r0, =gPlttBufferUnfaded - movs r2, 0xA9 - lsls r2, 2 - adds r1, r2 - ldrh r1, [r1] - movs r3, 0xE4 - lsls r3, 1 - adds r0, r3 - strh r1, [r0] -_0819A738: - ldr r0, =gUnknown_0861039C - movs r1, 0x20 - movs r2, 0x4 - bl LoadPalette - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _0819A8EE - .pool -_0819A77C: - ldr r0, =gUnknown_0203CE38 - ldr r1, [r0] - movs r0, 0x3 - bl SetBgTilemapBuffer - ldr r5, =gUnknown_0861023C - movs r4, 0x8 - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0x3 - adds r1, r5, 0 - movs r2, 0xB - movs r3, 0x4 - bl CopyToBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0x3 - adds r1, r5, 0 - movs r2, 0x2 - movs r3, 0x4 - bl CopyToBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0x3 - adds r1, r5, 0 - movs r2, 0x14 - movs r3, 0x4 - bl CopyToBgTilemapBufferRect - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - b _0819A8E6 - .pool -_0819A7CC: - ldr r0, =gUnknown_086103F4 - bl LoadSpritePalettes - ldr r0, =gUnknown_086103BC - bl LoadSpriteSheets - ldr r0, =gUnknown_086103E4 - bl LoadCompressedObjectPic - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - ldr r0, =sub_819A4E4 - bl SetVBlankCallback - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - movs r1, 0x9A - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - ldrb r0, [r0, 0x6] - cmp r0, 0x1 - bne _0819A854 - movs r0, 0x58 - movs r1, 0x98 - movs r2, 0x20 - movs r3, 0x60 - bl sub_819C5D0 - movs r0, 0x3 - bl ShowBg - ldr r1, =0x00001248 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x0000040b - movs r0, 0x52 - bl SetGpuReg - b _0819A85A - .pool -_0819A854: - movs r0, 0x3 - bl HideBg -_0819A85A: - ldr r1, =gMain - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _0819A8EE - .pool -_0819A868: - ldr r4, =gUnknown_0300127C - ldr r1, [r4] - ldrb r0, [r1, 0x6] - cmp r0, 0x1 - bne _0819A878 - ldr r0, =gUnknown_0203CF20 - ldrb r0, [r0] - strb r0, [r1, 0x3] -_0819A878: - bl sub_819A9AC - bl sub_819AA18 - ldr r0, [r4] - ldrb r0, [r0, 0x6] - cmp r0, 0x1 - bne _0819A88C - bl sub_819BE34 -_0819A88C: - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _0819A8EE - .pool -_0819A8A4: - bl sub_819BA64 - movs r0, 0x2 - b _0819A8E2 -_0819A8AC: - bl sub_819BCF8 - movs r0, 0x5 - bl PutWindowTilemap - ldr r1, =gMain - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _0819A8EE - .pool -_0819A8C4: - bl sub_819B9E8 - movs r0, 0x1 - bl PutWindowTilemap - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _0819A8EE - .pool -_0819A8DC: - bl sub_819B9B4 - movs r0, 0 -_0819A8E2: - bl PutWindowTilemap -_0819A8E6: - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 -_0819A8EE: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0819A98E - .pool -_0819A8FC: - ldr r0, =sub_819C69C - movs r1, 0 - bl CreateTask - ldr r2, =gUnknown_0300127C - ldr r1, [r2] - ldr r3, =0x000002a1 - adds r1, r3 - strb r0, [r1] - ldr r3, [r2] - ldrb r5, [r3, 0x6] - cmp r5, 0 - bne _0819A954 - ldr r4, =gTasks - ldr r1, =0x000002a1 - adds r0, r3, r1 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - strh r5, [r0, 0x8] - ldr r0, =sub_819B378 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r1, r0, 24 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - strh r5, [r0, 0x8] - b _0819A988 - .pool -_0819A954: - ldr r4, =gTasks - ldr r2, =0x000002a1 - adds r0, r3, r2 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - movs r2, 0 - movs r1, 0x1 - strh r1, [r0, 0x8] - ldr r1, =0x000002a2 - adds r0, r3, r1 - strb r2, [r0] - ldr r0, =sub_819B124 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r1, r0, 24 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - movs r1, 0xD - strh r1, [r0, 0x8] -_0819A988: - ldr r0, =sub_819A4C8 - bl SetMainCallback2 -_0819A98E: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819A514 - - thumb_func_start sub_819A9AC -sub_819A9AC: @ 819A9AC - push {r4,r5,lr} - ldr r5, =gUnknown_0300127C - ldr r4, [r5] - cmp r4, 0 - bne _0819AA12 - movs r0, 0xAB - lsls r0, 2 - bl AllocZeroed - str r0, [r5] - strb r4, [r0, 0x3] - ldr r1, [r5] - movs r0, 0x1 - strb r0, [r1, 0x5] - ldr r0, [r5] - strb r4, [r0, 0x6] - movs r2, 0 - movs r4, 0x6C - movs r3, 0 -_0819A9D2: - ldr r0, [r5] - adds r1, r2, 0 - muls r1, r4 - adds r0, r1 - strb r3, [r0, 0x10] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x5 - bls _0819A9D2 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x2 - beq _0819AA0C - movs r0, 0 - bl sub_819B484 - b _0819AA12 - .pool -_0819AA0C: - movs r0, 0 - bl sub_819B63C -_0819AA12: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_819A9AC - - thumb_func_start sub_819AA18 -sub_819AA18: @ 819AA18 - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r4, 0 - mov r8, r4 - ldr r7, =gSprites -_0819AA24: - lsls r1, r4, 3 - adds r1, r4 - lsls r1, 2 - subs r1, r4 - adds r1, 0x20 - lsls r1, 16 - asrs r1, 16 - ldr r0, =gUnknown_086105D8 - movs r2, 0x40 - movs r3, 0x1 - bl CreateSprite - ldr r6, =gUnknown_0300127C - ldr r2, [r6] - movs r5, 0x6C - adds r1, r4, 0 - muls r1, r5 - adds r2, r1 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r2, 0xE] - ldrh r1, [r2, 0xE] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - mov r1, r8 - strh r1, [r0, 0x2E] - adds r0, r4, 0 - bl sub_819ADAC - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _0819AA24 - ldr r0, [r6] - ldrb r1, [r0, 0x3] - ldr r4, =gSprites - muls r1, r5 - adds r0, r1 - ldrh r0, [r0, 0xE] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldr r0, =gUnknown_086105F0 - movs r2, 0x20 - ldrsh r1, [r1, r2] - movs r2, 0x58 - movs r3, 0 - bl CreateSprite - ldr r1, [r6] - movs r5, 0 - strb r0, [r1, 0x4] - ldr r0, =gUnknown_08610608 - movs r1, 0xB0 - movs r2, 0x70 - movs r3, 0 - bl CreateSprite - ldr r1, [r6] - strb r0, [r1, 0x1] - ldr r0, =gUnknown_08610620 - movs r1, 0xB0 - movs r2, 0x90 - movs r3, 0 - bl CreateSprite - ldr r1, [r6] - strb r0, [r1, 0x2] - ldr r0, [r6] - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldr r0, [r6] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - ldr r0, [r6] - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x28 - strb r5, [r0] - ldr r0, [r6] - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x29 - strb r5, [r0] - ldr r0, [r6] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x28 - strb r5, [r0] - ldr r0, [r6] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x29 - strb r5, [r0] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819AA18 - - thumb_func_start sub_819AB40 -sub_819AB40: @ 819AB40 - push {r4-r6,lr} - movs r4, 0 -_0819AB44: - ldr r6, =gUnknown_0300127C - ldr r1, [r6] - movs r0, 0x6C - muls r0, r4 - adds r1, r0 - ldrh r1, [r1, 0xE] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r5, =gSprites - adds r0, r5 - bl DestroySprite - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _0819AB44 - ldr r0, [r6] - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl DestroySprite - ldr r0, [r6] - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl DestroySprite - ldr r0, [r6] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl DestroySprite - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819AB40 - - thumb_func_start sub_819ABA8 -sub_819ABA8: @ 819ABA8 - push {r4,lr} - lsls r0, 24 - cmp r0, 0 - ble _0819ABC8 - ldr r0, =gUnknown_0300127C - ldr r1, [r0] - ldrb r3, [r1, 0x3] - adds r2, r0, 0 - cmp r3, 0x5 - beq _0819ABC4 - adds r0, r3, 0x1 - b _0819ABDE - .pool -_0819ABC4: - movs r0, 0 - b _0819ABDE -_0819ABC8: - ldr r0, =gUnknown_0300127C - ldr r1, [r0] - ldrb r3, [r1, 0x3] - adds r2, r0, 0 - cmp r3, 0 - beq _0819ABDC - subs r0, r3, 0x1 - b _0819ABDE - .pool -_0819ABDC: - movs r0, 0x5 -_0819ABDE: - strb r0, [r1, 0x3] - ldr r2, [r2] - ldrb r3, [r2, 0x3] - ldr r4, =gSprites - ldrb r0, [r2, 0x4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - movs r0, 0x6C - muls r0, r3 - adds r2, r0 - ldrh r2, [r2, 0xE] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r4 - ldrh r0, [r0, 0x20] - strh r0, [r1, 0x20] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819ABA8 - - thumb_func_start sub_819AC10 -sub_819AC10: @ 819AC10 - push {lr} - lsls r0, 24 - cmp r0, 0 - ble _0819AC30 - ldr r0, =gUnknown_0300127C - ldr r1, [r0] - ldrb r3, [r1] - adds r2, r0, 0 - cmp r3, 0x2 - beq _0819AC2C - adds r0, r3, 0x1 - b _0819AC46 - .pool -_0819AC2C: - movs r0, 0 - b _0819AC46 -_0819AC30: - ldr r0, =gUnknown_0300127C - ldr r1, [r0] - ldrb r3, [r1] - adds r2, r0, 0 - cmp r3, 0 - beq _0819AC44 - subs r0, r3, 0x1 - b _0819AC46 - .pool -_0819AC44: - movs r0, 0x2 -_0819AC46: - strb r0, [r1] - ldr r3, =gSprites - ldr r2, [r2] - ldrb r0, [r2, 0x1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r0, [r2] - lsls r0, 4 - adds r0, 0x70 - strh r0, [r1, 0x22] - ldrb r0, [r2, 0x2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r0, [r2] - lsls r0, 4 - adds r0, 0x70 - strh r0, [r1, 0x22] - pop {r0} - bx r0 - .pool - thumb_func_end sub_819AC10 - - thumb_func_start sub_819AC78 -sub_819AC78: @ 819AC78 - push {lr} - lsls r0, 24 - cmp r0, 0 - ble _0819AC98 - ldr r0, =gUnknown_0300127C - ldr r1, [r0] - ldrb r3, [r1, 0x7] - adds r2, r0, 0 - cmp r3, 0x1 - beq _0819AC94 - adds r0, r3, 0x1 - b _0819ACAE - .pool -_0819AC94: - movs r0, 0 - b _0819ACAE -_0819AC98: - ldr r0, =gUnknown_0300127C - ldr r1, [r0] - ldrb r3, [r1, 0x7] - adds r2, r0, 0 - cmp r3, 0 - beq _0819ACAC - subs r0, r3, 0x1 - b _0819ACAE - .pool -_0819ACAC: - movs r0, 0x1 -_0819ACAE: - strb r0, [r1, 0x7] - ldr r3, =gSprites - ldr r2, [r2] - ldrb r0, [r2, 0x1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r0, [r2, 0x7] - lsls r0, 4 - adds r0, 0x70 - strh r0, [r1, 0x22] - ldrb r0, [r2, 0x2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r0, [r2, 0x7] - lsls r0, 4 - adds r0, 0x70 - strh r0, [r1, 0x22] - pop {r0} - bx r0 - .pool - thumb_func_end sub_819AC78 - - thumb_func_start sub_819ACE0 -sub_819ACE0: @ 819ACE0 - push {r4-r6,lr} - ldr r5, =gUnknown_0300127C - ldr r0, [r5] - ldrb r6, [r0, 0x3] - movs r1, 0x6C - adds r4, r6, 0 - muls r4, r1 - adds r0, r4 - ldrb r0, [r0, 0x10] - cmp r0, 0 - beq _0819AD60 - movs r0, 0x64 - bl IndexOfSpritePaletteTag - lsls r0, 24 - lsrs r3, r0, 24 - ldr r1, [r5] - ldrb r0, [r1, 0x5] - cmp r0, 0x3 - bne _0819AD44 - adds r0, r1, r4 - ldrb r0, [r0, 0x10] - cmp r0, 0x1 - bne _0819AD44 - movs r2, 0 - ldrb r0, [r1, 0x10] - cmp r0, 0x2 - beq _0819AD32 - movs r4, 0x6C -_0819AD1A: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x5 - bhi _0819AD32 - ldr r0, [r5] - adds r1, r2, 0 - muls r1, r4 - adds r0, r1 - ldrb r0, [r0, 0x10] - cmp r0, 0x2 - bne _0819AD1A -_0819AD32: - cmp r2, 0x6 - beq _0819AD9C - ldr r0, =gUnknown_0300127C - ldr r1, [r0] - movs r0, 0x6C - muls r0, r2 - adds r1, r0 - movs r0, 0x1 - strb r0, [r1, 0x10] -_0819AD44: - ldr r2, =gUnknown_0300127C - ldr r1, [r2] - movs r0, 0x6C - muls r0, r6 - adds r1, r0 - movs r0, 0 - strb r0, [r1, 0x10] - ldr r1, [r2] - ldrb r0, [r1, 0x5] - subs r0, 0x1 - b _0819AD78 - .pool -_0819AD60: - movs r0, 0x65 - bl IndexOfSpritePaletteTag - lsls r0, 24 - lsrs r3, r0, 24 - ldr r0, [r5] - adds r1, r0, r4 - ldrb r0, [r0, 0x5] - strb r0, [r1, 0x10] - ldr r1, [r5] - ldrb r0, [r1, 0x5] - adds r0, 0x1 -_0819AD78: - strb r0, [r1, 0x5] - ldr r2, =gSprites - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - movs r1, 0x6C - muls r1, r6 - adds r0, r1 - ldrh r0, [r0, 0xE] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - lsls r3, 4 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r3 - strb r0, [r1, 0x5] -_0819AD9C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819ACE0 - - thumb_func_start sub_819ADAC -sub_819ADAC: @ 819ADAC - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - movs r1, 0x6C - muls r1, r4 - adds r0, r1 - ldrb r0, [r0, 0x10] - cmp r0, 0 - beq _0819ADCC - movs r0, 0x65 - b _0819ADCE - .pool -_0819ADCC: - movs r0, 0x64 -_0819ADCE: - bl IndexOfSpritePaletteTag - lsls r0, 24 - lsrs r3, r0, 24 - ldr r2, =gSprites - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - movs r1, 0x6C - muls r1, r4 - adds r0, r1 - ldrh r0, [r0, 0xE] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - lsls r3, 4 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r3 - strb r0, [r1, 0x5] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819ADAC - - thumb_func_start sub_819AE08 -sub_819AE08: @ 819AE08 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r6, r0, r1 - movs r1, 0x8 - ldrsh r0, [r6, r1] - cmp r0, 0x7 - beq _0819AE64 - cmp r0, 0x7 - bgt _0819AE30 - cmp r0, 0x6 - beq _0819AE36 - b _0819AF50 - .pool -_0819AE30: - cmp r0, 0x8 - beq _0819AEE8 - b _0819AF50 -_0819AE36: - ldr r1, =gPlttBufferUnfaded - ldr r0, =gPlttBufferFaded - movs r2, 0xE4 - lsls r2, 1 - adds r0, r2 - ldrh r0, [r0] - adds r1, r2 - movs r2, 0 - strh r0, [r1] - movs r0, 0x1 - negs r0, r0 - str r2, [sp] - movs r1, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - movs r0, 0x7 - strh r0, [r6, 0x8] - b _0819AF50 - .pool -_0819AE64: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _0819AF50 - ldr r4, =gUnknown_0300127C - ldr r0, [r4] - ldr r2, =0x000002a1 - adds r0, r2 - ldrb r0, [r0] - bl DestroyTask - ldr r1, [r4] - movs r3, 0xA6 - lsls r3, 2 - adds r0, r1, r3 - ldr r0, [r0] - movs r2, 0xA8 - lsls r2, 2 - adds r1, r2 - bl sub_819F444 - bl sub_819AB40 - ldr r4, =gUnknown_0203CE2C - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203CE30 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203CE34 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203CE38 - ldr r0, [r4] - bl Free - str r5, [r4] - bl FreeAllWindowBuffers - movs r0, 0x8 - strh r0, [r6, 0x8] - b _0819AF50 - .pool -_0819AEE8: - ldr r4, =gUnknown_0300127C - ldr r1, [r4] - ldr r0, =gPlttBufferUnfaded - movs r3, 0xE4 - lsls r3, 1 - adds r0, r3 - ldrh r0, [r0] - adds r3, 0xDC - adds r1, r3 - strh r0, [r1] - adds r0, r2, 0 - bl DestroyTask - ldr r1, [r4] - movs r0, 0x1 - strb r0, [r1, 0x6] - ldr r0, [r4] - ldrb r6, [r0, 0x3] - ldr r4, =gUnknown_0203CE3C - movs r0, 0x96 - lsls r0, 2 - bl AllocZeroed - str r0, [r4] - movs r4, 0 -_0819AF1A: - ldr r5, =gUnknown_0203CE3C - ldr r1, [r5] - movs r0, 0x64 - muls r0, r4 - adds r0, r1 - ldr r1, =gUnknown_0300127C - ldr r1, [r1] - movs r2, 0x6C - muls r2, r4 - adds r1, r2 - adds r1, 0x14 - movs r2, 0x64 - bl memcpy - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _0819AF1A - ldr r1, [r5] - ldr r0, =sub_819A514 - str r0, [sp] - movs r0, 0x1 - adds r2, r6, 0 - movs r3, 0x5 - bl sub_81BF8EC -_0819AF50: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819AE08 - - thumb_func_start bc_exit_to_overworld -bc_exit_to_overworld: @ 819AF68 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r7, =gUnknown_0300127C - ldr r0, [r7] - movs r1, 0xA8 - lsls r1, 2 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0819B00E - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r1, [r4, r0] - cmp r1, 0 - beq _0819AFA0 - cmp r1, 0x1 - beq _0819AFB8 - b _0819B00E - .pool -_0819AFA0: - movs r0, 0x1 - negs r0, r0 - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0819B00E -_0819AFB8: - bl UpdatePaletteFade - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _0819B00E - bl sub_819B764 - ldr r0, [r7] - ldr r1, =0x000002a1 - adds r0, r1 - ldrb r0, [r0] - bl DestroyTask - bl sub_819AB40 - ldr r4, =gUnknown_0203CE2C - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203CE34 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203CE38 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r0, [r7] - bl Free - str r5, [r7] - bl FreeAllWindowBuffers - ldr r0, =sub_80861B0 - bl SetMainCallback2 - adds r0, r6, 0 - bl DestroyTask -_0819B00E: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end bc_exit_to_overworld - - thumb_func_start sub_819B02C -sub_819B02C: @ 819B02C - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r7, =gUnknown_0300127C - ldr r0, [r7] - movs r1, 0xA8 - lsls r1, 2 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0819B11A - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r5, r0, r1 - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0x5 - beq _0819B084 - cmp r0, 0x5 - bgt _0819B06C - cmp r0, 0x4 - beq _0819B07A - b _0819B11A - .pool -_0819B06C: - cmp r0, 0xA - bne _0819B11A - bl sub_819C4B4 - movs r0, 0x4 - strh r0, [r5, 0x8] - b _0819B11A -_0819B07A: - bl sub_819B8D4 - movs r0, 0x5 - strh r0, [r5, 0x8] - b _0819B11A -_0819B084: - ldr r2, =gMain - ldrh r1, [r2, 0x2E] - movs r0, 0x1 - mov r8, r0 - movs r6, 0x1 - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - beq _0819B0B8 - movs r0, 0x5 - bl PlaySE - ldr r0, [r7] - ldrb r4, [r0, 0x7] - cmp r4, 0 - bne _0819B0C6 - bl sub_819C568 - strh r4, [r5, 0x8] - ldr r0, =bc_exit_to_overworld - str r0, [r5] - b _0819B11A - .pool -_0819B0B8: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0819B0EC - movs r0, 0x5 - bl PlaySE -_0819B0C6: - movs r0, 0x4 - bl sub_819B958 - bl sub_819BC9C - ldr r0, [r7] - ldr r1, =0x000002a2 - adds r0, r1 - mov r1, r8 - strb r1, [r0] - strh r6, [r5, 0x8] - ldr r0, =sub_819B378 - str r0, [r5] - b _0819B11A - .pool -_0819B0EC: - ldrh r1, [r2, 0x30] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0819B106 - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - negs r0, r0 - bl sub_819AC78 - b _0819B11A -_0819B106: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0819B11A - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - bl sub_819AC78 -_0819B11A: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_819B02C - - thumb_func_start sub_819B124 -sub_819B124: @ 819B124 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldrh r0, [r0, 0x8] - subs r0, 0x2 - lsls r0, 16 - asrs r0, 16 - adds r6, r1, 0 - cmp r0, 0xB - bls _0819B144 - b _0819B36E -_0819B144: - lsls r0, 2 - ldr r1, =_0819B158 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0819B158: - .4byte _0819B188 - .4byte _0819B1EC - .4byte _0819B36E - .4byte _0819B36E - .4byte _0819B36E - .4byte _0819B36E - .4byte _0819B36E - .4byte _0819B1BC - .4byte _0819B36E - .4byte _0819B36E - .4byte _0819B300 - .4byte _0819B35C -_0819B188: - ldr r0, =gUnknown_0300127C - ldr r1, [r0] - ldrb r0, [r1, 0x6] - cmp r0, 0 - bne _0819B1A2 - ldr r2, =0x00000299 - adds r0, r1, r2 - movs r7, 0xA8 - lsls r7, 2 - adds r1, r7 - movs r2, 0 - bl sub_819F2B4 -_0819B1A2: - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - movs r0, 0x9 - b _0819B36C - .pool -_0819B1BC: - ldr r4, =gUnknown_0300127C - ldr r0, [r4] - movs r1, 0xA8 - lsls r1, 2 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _0819B1CE - b _0819B36E -_0819B1CE: - bl sub_819B844 - ldr r1, [r4] - movs r0, 0 - strb r0, [r1, 0x6] - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - b _0819B344 - .pool -_0819B1EC: - ldr r2, =gMain - ldrh r1, [r2, 0x2E] - movs r7, 0x1 - movs r6, 0x1 - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - beq _0819B27C - movs r0, 0x5 - bl PlaySE - bl sub_819BC04 - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - cmp r0, 0x1 - bne _0819B228 - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - ldr r2, =0x000002a2 - adds r0, r2 - b _0819B2AC - .pool -_0819B228: - cmp r0, 0x2 - bne _0819B248 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0xA - strh r1, [r0, 0x8] - ldr r1, =sub_819B02C - str r1, [r0] - b _0819B36E - .pool -_0819B248: - cmp r1, 0x3 - bne _0819B260 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0xB - strh r1, [r0, 0x8] - b _0819B2BA - .pool -_0819B260: - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0x6 - strh r1, [r0, 0x8] - ldr r1, =sub_819AE08 - str r1, [r0] - b _0819B36E - .pool -_0819B27C: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0819B2D0 - movs r0, 0x5 - bl PlaySE - ldr r4, =gUnknown_0300127C - ldr r1, [r4] - movs r2, 0xA6 - lsls r2, 2 - adds r0, r1, r2 - ldr r0, [r0] - adds r2, 0x8 - adds r1, r2 - movs r2, 0 - bl sub_819F3F8 - movs r0, 0x3 - bl sub_819B958 - ldr r0, [r4] - ldr r1, =0x000002a2 - adds r0, r1 -_0819B2AC: - strb r7, [r0] - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - strh r6, [r0, 0x8] -_0819B2BA: - ldr r1, =sub_819B378 - str r1, [r0] - b _0819B36E - .pool -_0819B2D0: - ldrh r1, [r2, 0x30] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0819B2EA - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - negs r0, r0 - bl sub_819AC10 - b _0819B36E -_0819B2EA: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0819B36E - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - bl sub_819AC10 - b _0819B36E -_0819B300: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - bne _0819B36E - ldr r4, =gUnknown_0300127C - ldr r2, [r4] - ldrb r0, [r2, 0x6] - cmp r0, 0x1 - bne _0819B338 - ldr r1, =gPlttBufferFaded - movs r7, 0xA9 - lsls r7, 2 - adds r0, r2, r7 - ldrh r0, [r0] - movs r2, 0xE4 - lsls r2, 1 - adds r1, r2 - strh r0, [r1] - ldr r0, =gPlttBufferUnfaded - subs r7, 0xBC - adds r1, r0, r7 - ldrh r1, [r1] - adds r0, r2 - strh r1, [r0] -_0819B338: - ldr r0, [r4] - strb r3, [r0, 0x6] - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r6 -_0819B344: - movs r1, 0x3 - strh r1, [r0, 0x8] - b _0819B36E - .pool -_0819B35C: - bl sub_819B844 - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - movs r0, 0xC -_0819B36C: - strh r0, [r1, 0x8] -_0819B36E: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819B124 - - thumb_func_start sub_819B378 -sub_819B378: @ 819B378 - push {r4-r7,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r5, =gUnknown_0300127C - ldr r3, [r5] - movs r7, 0xA8 - lsls r7, 2 - adds r0, r3, r7 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0819B476 - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r1, [r4, r0] - cmp r1, 0x1 - beq _0819B3DC - cmp r1, 0x1 - bgt _0819B3B4 - cmp r1, 0 - beq _0819B3BA - b _0819B476 - .pool -_0819B3B4: - cmp r1, 0xB - beq _0819B440 - b _0819B476 -_0819B3BA: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0819B476 - movs r0, 0x1 - movs r1, 0x1 - strh r1, [r4, 0x8] - ldr r2, =0x000002a2 - adds r1, r3, r2 - strb r0, [r1] - b _0819B476 - .pool -_0819B3DC: - ldr r2, =gMain - ldrh r0, [r2, 0x2E] - ands r1, r0 - cmp r1, 0 - beq _0819B40C - movs r0, 0x5 - bl PlaySE - ldr r0, [r5] - ldr r1, =0x000002a2 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - movs r0, 0x2 - strh r0, [r4, 0x8] - ldr r0, =sub_819B124 - str r0, [r4] - b _0819B476 - .pool -_0819B40C: - ldrh r1, [r2, 0x30] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0819B422 - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - negs r0, r0 - b _0819B432 -_0819B422: - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0819B476 - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 -_0819B432: - bl sub_819ABA8 - bl sub_819BCF8 - bl sub_819B9E8 - b _0819B476 -_0819B440: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r6, 0x1 - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - beq _0819B476 - movs r0, 0x5 - bl PlaySE - ldr r1, [r5] - movs r2, 0xA6 - lsls r2, 2 - adds r0, r1, r2 - ldr r0, [r0] - adds r1, r7 - movs r2, 0 - bl sub_819F3F8 - bl sub_819BA64 - ldr r0, [r5] - ldr r1, =0x000002a2 - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] - strh r6, [r4, 0x8] -_0819B476: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819B378 - - thumb_func_start sub_819B484 -sub_819B484: @ 819B484 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x10] - movs r6, 0 - add r0, sp, 0xC - strb r6, [r0] - ldr r0, =0x000040ce - bl VarGet - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0 - ldr r7, =gSaveBlock2Ptr - ldr r2, [r7] - ldr r0, =0x00000ca9 - adds r4, r2, r0 - ldrb r0, [r4] - lsls r0, 30 - lsrs r0, 30 - adds r5, r0, 0 - lsls r0, r5, 1 - lsls r1, r6, 2 - adds r0, r1 - ldr r1, =0x00000de2 - adds r2, r1 - adds r2, r0 - ldrh r0, [r2] - movs r1, 0x7 - bl __udivsi3 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x18] - ldr r1, =gUnknown_0203BC8C - ldr r0, =gBattleFrontierMons - str r0, [r1] - ldrb r1, [r4] - movs r0, 0x3 - ands r0, r1 - movs r2, 0x32 - str r2, [sp, 0x14] - cmp r0, 0 - beq _0819B4EA - movs r3, 0x64 - str r3, [sp, 0x14] -_0819B4EA: - adds r0, r6, 0 - adds r1, r5, 0 - bl sub_81A6F70 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x1C] - ldr r1, [r7] - ldrb r0, [r1, 0xA] - mov r9, r0 - ldrb r0, [r1, 0xB] - lsls r0, 8 - mov r2, r9 - orrs r2, r0 - ldrb r0, [r1, 0xC] - lsls r0, 16 - orrs r2, r0 - ldrb r0, [r1, 0xD] - lsls r0, 24 - orrs r2, r0 - mov r9, r2 - movs r3, 0 - mov r8, r3 -_0819B518: - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - mov r2, r8 - lsls r0, r2, 1 - add r0, r8 - lsls r0, 2 - adds r1, r0 - movs r3, 0xE7 - lsls r3, 4 - adds r1, r3 - ldrh r5, [r1] - ldr r0, =gUnknown_0300127C - ldr r1, [r0] - ldr r2, [sp, 0x10] - add r2, r8 - movs r3, 0x6C - adds r0, r2, 0 - muls r0, r3 - adds r1, r0 - strh r5, [r1, 0xC] - mov r10, r2 - ldr r0, [sp, 0x1C] - cmp r8, r0 - bcs _0819B570 - ldr r0, [sp, 0x18] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - b _0819B572 - .pool -_0819B570: - ldr r0, [sp, 0x18] -_0819B572: - movs r1, 0 - bl sub_81A6CA8 - lsls r0, 24 - lsrs r6, r0, 24 - movs r1, 0x6C - mov r4, r10 - muls r4, r1 - adds r4, 0xC - ldr r2, =gUnknown_0300127C - ldr r0, [r2] - adds r0, r4 - adds r0, 0x8 - ldr r1, =gUnknown_0203BC8C - ldr r2, [r1] - lsls r5, 4 - adds r2, r5, r2 - ldrh r1, [r2] - ldrb r3, [r2, 0xC] - str r6, [sp] - ldrb r2, [r2, 0xB] - str r2, [sp, 0x4] - mov r2, r9 - str r2, [sp, 0x8] - ldr r2, [sp, 0x14] - bl sub_8068634 - movs r1, 0 - add r0, sp, 0xC - strb r1, [r0] - movs r6, 0 - adds r7, r5, 0 - movs r3, 0x1 - add r8, r3 - ldr r3, =gUnknown_0300127C -_0819B5B8: - ldr r0, [r3] - adds r0, r4 - adds r0, 0x8 - ldr r5, =gUnknown_0203BC8C - ldr r1, [r5] - adds r1, r7, r1 - lsls r2, r6, 1 - adds r1, 0x2 - adds r1, r2 - ldrh r1, [r1] - adds r2, r6, 0 - str r3, [sp, 0x20] - bl sub_81A7024 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r3, [sp, 0x20] - cmp r6, 0x3 - bls _0819B5B8 - movs r0, 0x6C - mov r4, r10 - muls r4, r0 - adds r4, 0xC - ldr r1, =gUnknown_0300127C - ldr r0, [r1] - adds r0, r4 - adds r0, 0x8 - movs r1, 0x20 - add r2, sp, 0xC - bl SetMonData - ldr r2, =gUnknown_0300127C - ldr r0, [r2] - adds r0, r4 - adds r0, 0x8 - ldr r1, [r5] - adds r1, r7, r1 - ldrb r2, [r1, 0xA] - lsls r2, 1 - ldr r1, =gBattleFrontierHeldItems - adds r2, r1 - movs r1, 0xC - bl SetMonData - mov r3, r8 - lsls r0, r3, 24 - lsrs r0, 24 - mov r8, r0 - cmp r0, 0x5 - bhi _0819B620 - b _0819B518 -_0819B620: - add sp, 0x24 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819B484 - - thumb_func_start sub_819B63C -sub_819B63C: @ 819B63C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x10] - add r0, sp, 0xC - movs r1, 0 - strb r1, [r0] - ldr r2, =gUnknown_0203BC8C - ldr r0, =gSlateportBattleTentMons - str r0, [r2] - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldrb r3, [r1, 0xA] - ldrb r0, [r1, 0xB] - lsls r0, 8 - orrs r3, r0 - ldrb r0, [r1, 0xC] - lsls r0, 16 - orrs r3, r0 - ldrb r0, [r1, 0xD] - lsls r0, 24 - orrs r3, r0 - mov r10, r3 - movs r7, 0 - mov r9, r7 -_0819B678: - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - mov r2, r9 - lsls r0, r2, 1 - add r0, r9 - lsls r0, 2 - adds r1, r0 - movs r3, 0xE7 - lsls r3, 4 - adds r1, r3 - ldrh r1, [r1] - mov r8, r1 - ldr r7, =gUnknown_0300127C - ldr r0, [r7] - ldr r6, [sp, 0x10] - add r6, r9 - movs r1, 0x6C - adds r4, r6, 0 - muls r4, r1 - adds r1, r0, r4 - mov r2, r8 - strh r2, [r1, 0xC] - adds r4, 0xC - adds r0, r4 - adds r0, 0x8 - ldr r3, =gUnknown_0203BC8C - ldr r2, [r3] - mov r7, r8 - lsls r5, r7, 4 - adds r2, r5, r2 - ldrh r1, [r2] - ldrb r3, [r2, 0xC] - movs r7, 0 - str r7, [sp] - ldrb r2, [r2, 0xB] - str r2, [sp, 0x4] - mov r2, r10 - str r2, [sp, 0x8] - movs r2, 0x1E - bl sub_8068634 - add r0, sp, 0xC - movs r3, 0 - strb r3, [r0] - movs r0, 0x1 - add r9, r0 -_0819B6D4: - ldr r1, =gUnknown_0300127C - ldr r0, [r1] - adds r0, r4 - adds r0, 0x8 - ldr r3, =gUnknown_0203BC8C - ldr r2, [r3] - mov r3, r8 - lsls r1, r3, 4 - adds r1, r2 - lsls r2, r7, 1 - adds r1, 0x2 - adds r1, r2 - ldrh r1, [r1] - adds r2, r7, 0 - bl sub_81A7024 - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x3 - bls _0819B6D4 - movs r7, 0x6C - adds r4, r6, 0 - muls r4, r7 - adds r4, 0xC - ldr r1, =gUnknown_0300127C - ldr r0, [r1] - adds r0, r4 - adds r0, 0x8 - movs r1, 0x20 - add r2, sp, 0xC - bl SetMonData - ldr r2, =gUnknown_0300127C - ldr r0, [r2] - adds r0, r4 - adds r0, 0x8 - ldr r3, =gUnknown_0203BC8C - ldr r1, [r3] - adds r1, r5, r1 - ldrb r2, [r1, 0xA] - lsls r2, 1 - ldr r1, =gBattleFrontierHeldItems - adds r2, r1 - movs r1, 0xC - bl SetMonData - mov r7, r9 - lsls r0, r7, 24 - lsrs r0, 24 - mov r9, r0 - cmp r0, 0x5 - bls _0819B678 - add sp, 0x14 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819B63C - - thumb_func_start sub_819B764 -sub_819B764: @ 819B764 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r7, 0 - ldr r0, =gUnknown_0300127C - mov r10, r0 - ldr r1, =gSaveBlock2Ptr - mov r8, r1 -_0819B778: - movs r2, 0 - adds r0, r7, 0x1 - mov r9, r0 -_0819B77E: - mov r1, r10 - ldr r0, [r1] - movs r1, 0x6C - adds r6, r2, 0 - muls r6, r1 - adds r1, r0, r6 - ldrb r0, [r1, 0x10] - cmp r0, r9 - bne _0819B81C - movs r0, 0x64 - adds r5, r7, 0 - muls r5, r0 - ldr r2, =gPlayerParty - adds r5, r2 - adds r1, 0x14 - adds r0, r5, 0 - movs r2, 0x64 - bl memcpy - mov r0, r8 - ldr r1, [r0] - lsls r4, r7, 1 - adds r4, r7 - lsls r4, 2 - adds r1, r4 - mov r2, r10 - ldr r0, [r2] - adds r0, r6 - ldrh r0, [r0, 0xC] - movs r2, 0xE7 - lsls r2, 4 - adds r1, r2 - strh r0, [r1] - adds r0, r5, 0 - movs r1, 0 - movs r2, 0 - bl GetMonData - mov r2, r8 - ldr r1, [r2] - ldr r2, =0x00000e74 - adds r1, r2 - adds r1, r4 - str r0, [r1] - adds r0, r5, 0 - movs r1, 0x2E - movs r2, 0 - bl pokemon_getattr_encrypted - mov r2, r8 - ldr r1, [r2] - adds r1, r4 - ldr r2, =0x00000e79 - adds r1, r2 - strb r0, [r1] - adds r0, r5, 0 - movs r1, 0x28 - movs r2, 0 - bl pokemon_getattr_encrypted - mov r2, r8 - ldr r1, [r2] - adds r1, r4 - ldr r2, =0x00000e78 - adds r1, r2 - strb r0, [r1] - b _0819B826 - .pool -_0819B81C: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x5 - bls _0819B77E -_0819B826: - mov r1, r9 - lsls r0, r1, 24 - lsrs r7, r0, 24 - cmp r7, 0x2 - bls _0819B778 - bl calc_player_party_count - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_819B764 - - thumb_func_start sub_819B844 -sub_819B844: @ 819B844 - push {r4,r5,lr} - ldr r5, =gUnknown_0300127C - ldr r1, [r5] - ldrb r0, [r1, 0x6] - cmp r0, 0 - bne _0819B852 - strb r0, [r1] -_0819B852: - ldr r4, =gSprites - ldr r2, [r5] - ldrb r1, [r2, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xB0 - strh r1, [r0, 0x20] - ldrb r0, [r2, 0x1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r0, [r2] - lsls r0, 4 - adds r0, 0x70 - strh r0, [r1, 0x22] - ldrb r1, [r2, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xD0 - strh r1, [r0, 0x20] - ldrb r0, [r2, 0x2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r0, [r2] - lsls r0, 4 - adds r0, 0x70 - strh r0, [r1, 0x22] - ldrb r0, [r2, 0x1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - adds r1, 0x3E - ldrb r3, [r1] - movs r2, 0x5 - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - strb r0, [r1] - ldr r0, [r5] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - ands r2, r1 - strb r2, [r0] - bl sub_819BAFC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819B844 - - thumb_func_start sub_819B8D4 -sub_819B8D4: @ 819B8D4 - push {r4,r5,lr} - ldr r5, =gUnknown_0300127C - ldr r1, [r5] - movs r0, 0 - strb r0, [r1, 0x7] - ldr r4, =gSprites - ldr r2, [r5] - ldrb r1, [r2, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xB0 - strh r1, [r0, 0x20] - ldrb r1, [r2, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r3, 0x70 - strh r3, [r0, 0x22] - ldrb r1, [r2, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xD0 - strh r1, [r0, 0x20] - ldrb r1, [r2, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r3, [r0, 0x22] - ldrb r0, [r2, 0x1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - adds r1, 0x3E - ldrb r3, [r1] - movs r2, 0x5 - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - strb r0, [r1] - ldr r0, [r5] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - ands r2, r1 - strb r2, [r0] - bl sub_819BBA8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819B8D4 - - thumb_func_start sub_819B958 -sub_819B958: @ 819B958 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =gSprites - ldr r3, =gUnknown_0300127C - ldr r0, [r3] - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldr r0, [r3] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - adds r0, r4, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r0, r4, 0 - movs r1, 0x2 - bl CopyWindowToVram - adds r0, r4, 0 - bl ClearWindowTilemap - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819B958 - - thumb_func_start sub_819B9B4 -sub_819B9B4: @ 819B9B4 - push {lr} - sub sp, 0xC - movs r0, 0 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r2, =gUnknown_085EEBB2 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x2 - bl Print - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_819B9B4 - - thumb_func_start sub_819B9E8 -sub_819B9E8: @ 819B9E8 - push {r4,r5,lr} - sub sp, 0xC - ldr r5, =gUnknown_0300127C - ldr r0, [r5] - ldrb r4, [r0, 0x3] - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x6C - muls r0, r4 - ldr r1, [r5] - adds r0, r1 - adds r0, 0x14 - movs r1, 0xB - movs r2, 0 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - ldr r4, =gStringVar4 - movs r1, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - adds r0, r4, 0 - bl StringCopy - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x56 - bl GetStringRightAlignXOffset - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gUnknown_08610479 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r3, 0x1 - bl box_print - movs r0, 0x1 - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819B9E8 - - thumb_func_start sub_819BA64 -sub_819BA64: @ 819BA64 - push {lr} - sub sp, 0xC - movs r0, 0x2 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - ldrb r0, [r0, 0x5] - cmp r0, 0x1 - bne _0819BA88 - ldr r2, =gUnknown_085EEBC1 - b _0819BA9C - .pool -_0819BA88: - cmp r0, 0x2 - bne _0819BA94 - ldr r2, =gUnknown_085EEBDB - b _0819BA9C - .pool -_0819BA94: - ldr r2, =gUnknown_085EEC2D - cmp r0, 0x3 - bne _0819BA9C - ldr r2, =gUnknown_085EEBF6 -_0819BA9C: - movs r0, 0x5 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0x1 - movs r3, 0x2 - bl Print - movs r0, 0x2 - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_819BA64 - - thumb_func_start sub_819BAC8 -sub_819BAC8: @ 819BAC8 - push {lr} - sub sp, 0xC - movs r0, 0x2 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r2, =gUnknown_085EEC50 - movs r0, 0x5 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0x1 - movs r3, 0x2 - bl Print - movs r0, 0x2 - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_819BAC8 - - thumb_func_start sub_819BAFC -sub_819BAFC: @ 819BAFC - push {r4-r6,lr} - sub sp, 0xC - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - ldrb r2, [r0, 0x3] - movs r1, 0x6C - muls r1, r2 - adds r0, r1 - ldrb r5, [r0, 0x10] - movs r0, 0x3 - bl PutWindowTilemap - movs r0, 0x3 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r4, =gUnknown_08610476 - str r4, [sp] - movs r6, 0 - str r6, [sp, 0x4] - ldr r0, =gUnknown_085EEC15 - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0x7 - movs r3, 0x1 - bl box_print - cmp r5, 0 - beq _0819BB60 - str r4, [sp] - str r6, [sp, 0x4] - ldr r0, =gUnknown_085EEC24 - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0x7 - movs r3, 0x11 - bl box_print - b _0819BB74 - .pool -_0819BB60: - str r4, [sp] - str r5, [sp, 0x4] - ldr r0, =gUnknown_085EEC10 - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0x7 - movs r3, 0x11 - bl box_print -_0819BB74: - ldr r0, =gUnknown_08610476 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - ldr r0, =gUnknown_085EEC1D - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0x7 - movs r3, 0x21 - bl box_print - movs r0, 0x3 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819BAFC - - thumb_func_start sub_819BBA8 -sub_819BBA8: @ 819BBA8 - push {r4,r5,lr} - sub sp, 0xC - movs r0, 0x4 - bl PutWindowTilemap - movs r0, 0x4 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r5, =gUnknown_08610476 - str r5, [sp] - movs r4, 0 - str r4, [sp, 0x4] - ldr r0, =gUnknown_085EEC49 - str r0, [sp, 0x8] - movs r0, 0x4 - movs r1, 0x1 - movs r2, 0x7 - movs r3, 0x1 - bl box_print - str r5, [sp] - str r4, [sp, 0x4] - ldr r0, =gUnknown_085EEC4D - str r0, [sp, 0x8] - movs r0, 0x4 - movs r1, 0x1 - movs r2, 0x7 - movs r3, 0x11 - bl box_print - movs r0, 0x4 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819BBA8 - - thumb_func_start sub_819BC04 -sub_819BC04: @ 819BC04 - push {lr} - ldr r2, =gUnknown_030062E8 - ldr r1, =gUnknown_0861041C - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - str r0, [r2] - bl _call_via_r0 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_819BC04 - - thumb_func_start sub_819BC30 -sub_819BC30: @ 819BC30 - push {r4,lr} - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - ldrb r2, [r0, 0x3] - movs r1, 0x6C - muls r1, r2 - adds r0, r1 - ldrb r1, [r0, 0x10] - ldrh r0, [r0, 0xC] - cmp r1, 0 - bne _0819BC60 - bl sub_819C634 - cmp r0, 0 - bne _0819BC60 - bl sub_819BAC8 - movs r0, 0x3 - bl sub_819B958 - movs r0, 0x3 - b _0819BC96 - .pool -_0819BC60: - ldr r4, =gUnknown_0300127C - ldr r1, [r4] - movs r2, 0xA6 - lsls r2, 2 - adds r0, r1, r2 - ldr r0, [r0] - adds r2, 0x8 - adds r1, r2 - movs r2, 0 - bl sub_819F3F8 - bl sub_819ACE0 - bl sub_819BA64 - movs r0, 0x3 - bl sub_819B958 - ldr r0, [r4] - ldrb r0, [r0, 0x5] - cmp r0, 0x3 - bhi _0819BC94 - movs r0, 0x1 - b _0819BC96 - .pool -_0819BC94: - movs r0, 0x2 -_0819BC96: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_819BC30 - - thumb_func_start sub_819BC9C -sub_819BC9C: @ 819BC9C - push {lr} - bl sub_819C568 - bl sub_819ACE0 - bl sub_819BA64 - movs r0, 0x3 - bl sub_819B958 - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - ldrb r0, [r0, 0x5] - cmp r0, 0x3 - bhi _0819BCC4 - movs r0, 0x1 - b _0819BCC6 - .pool -_0819BCC4: - movs r0, 0x2 -_0819BCC6: - pop {r1} - bx r1 - thumb_func_end sub_819BC9C - - thumb_func_start sub_819BCCC -sub_819BCCC: @ 819BCCC - movs r0, 0 - bx lr - thumb_func_end sub_819BCCC - - thumb_func_start sub_819BCD0 -sub_819BCD0: @ 819BCD0 - push {lr} - ldr r0, =gUnknown_0300127C - ldr r1, [r0] - movs r2, 0xA6 - lsls r2, 2 - adds r0, r1, r2 - ldr r0, [r0] - adds r2, 0x8 - adds r1, r2 - movs r2, 0 - bl sub_819F3F8 - movs r0, 0x3 - bl sub_819B958 - movs r0, 0x1 - pop {r1} - bx r1 - .pool - thumb_func_end sub_819BCD0 - - thumb_func_start sub_819BCF8 -sub_819BCF8: @ 819BCF8 - push {r4,r5,lr} - sub sp, 0x2C - ldr r5, =gUnknown_0300127C - ldr r0, [r5] - ldrb r4, [r0, 0x3] - cmp r4, 0x5 - bhi _0819BD64 - movs r0, 0x5 - bl PutWindowTilemap - movs r0, 0x5 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x6C - muls r0, r4 - ldr r1, [r5] - adds r0, r1 - adds r0, 0x14 - movs r1, 0xB - movs r2, 0 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - add r1, sp, 0xC - bl sub_81DB468 - movs r0, 0x1 - add r1, sp, 0xC - movs r2, 0x76 - bl GetStringRightAlignXOffset - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x5 - movs r1, 0x1 - add r2, sp, 0xC - bl Print - movs r0, 0x5 - movs r1, 0x2 - bl CopyWindowToVram -_0819BD64: - add sp, 0x2C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819BCF8 - - thumb_func_start sub_819BD70 -sub_819BD70: @ 819BD70 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x10 - ldr r6, =gUnknown_0300127C - ldr r2, [r6] - ldrb r1, [r2, 0x3] - movs r0, 0x6C - adds r4, r1, 0 - muls r4, r0 - adds r4, r2 - adds r4, 0x14 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl GetMonData - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - bl GetMonData - mov r8, r0 - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0 - bl GetMonData - adds r1, r0, 0 - movs r0, 0x58 - str r0, [sp] - movs r0, 0x20 - str r0, [sp, 0x4] - movs r0, 0xF - str r0, [sp, 0x8] - ldr r0, =0x0000ffff - str r0, [sp, 0xC] - adds r0, r5, 0 - mov r2, r8 - movs r3, 0x1 - bl sub_818D7D8 - ldr r1, [r6] - movs r2, 0xA6 - lsls r2, 2 - adds r1, r2 - movs r3, 0 - strb r0, [r1] - ldr r4, =gSprites - ldr r0, [r6] - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x28 - strb r3, [r0] - ldr r0, [r6] - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x29 - strb r3, [r0] - ldr r0, [r6] - movs r1, 0xA8 - lsls r1, 2 - adds r0, r1 - strb r3, [r0] - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819BD70 - - thumb_func_start sub_819BE20 -sub_819BE20: @ 819BE20 - ldr r1, =gUnknown_0300127C - ldr r1, [r1] - movs r2, 0xA8 - lsls r2, 2 - adds r1, r2 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_819BE20 - - thumb_func_start sub_819BE34 -sub_819BE34: @ 819BE34 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - ldr r0, =gUnknown_08610638 - movs r1, 0x78 - movs r2, 0x40 - movs r3, 0x1 - bl CreateSprite - ldr r6, =gUnknown_0300127C - ldr r1, [r6] - ldr r2, =0x00000299 - mov r10, r2 - add r1, r10 - movs r7, 0 - strb r0, [r1] - ldr r0, [r6] - add r0, r10 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - mov r8, r1 - add r0, r8 - movs r1, 0x2 - bl StartSpriteAffineAnim - ldr r2, [r6] - ldrb r1, [r2, 0x3] - movs r0, 0x6C - adds r4, r1, 0 - muls r4, r0 - adds r4, r2 - adds r4, 0x14 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl GetMonData - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - bl GetMonData - mov r9, r0 - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0 - bl GetMonData - adds r1, r0, 0 - movs r0, 0x58 - str r0, [sp] - movs r0, 0x20 - str r0, [sp, 0x4] - movs r0, 0xF - str r0, [sp, 0x8] - ldr r0, =0x0000ffff - str r0, [sp, 0xC] - adds r0, r5, 0 - mov r2, r9 - movs r3, 0x1 - bl sub_818D7D8 - ldr r1, [r6] - movs r2, 0xA6 - lsls r2, 2 - adds r1, r2 - strb r0, [r1] - ldr r0, [r6] - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - adds r0, 0x28 - strb r7, [r0] - ldr r0, [r6] - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - adds r0, 0x29 - strb r7, [r0] - ldr r0, [r6] - add r0, r10 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819BE34 - - thumb_func_start sub_819BF2C -sub_819BF2C: @ 819BF2C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - movs r7, 0 - ldr r0, =gUnknown_0300127C - mov r9, r0 -_0819BF3E: - movs r2, 0 - adds r1, r7, 0x1 - mov r10, r1 - lsls r0, r7, 2 - mov r8, r0 -_0819BF48: - mov r0, r9 - ldr r1, [r0] - movs r0, 0x6C - adds r4, r2, 0 - muls r4, r0 - adds r0, r1, r4 - ldrb r0, [r0, 0x10] - cmp r0, r10 - bne _0819C008 - adds r4, r1 - adds r4, 0x14 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl GetMonData - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - bl GetMonData - adds r6, r0, 0 - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0 - bl GetMonData - adds r1, r0, 0 - lsls r0, r7, 3 - adds r0, r7 - lsls r0, 19 - movs r2, 0x80 - lsls r2, 13 - adds r0, r2 - asrs r0, 16 - str r0, [sp] - movs r0, 0x20 - str r0, [sp, 0x4] - adds r0, r7, 0 - adds r0, 0xD - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x8] - ldr r0, =0x0000ffff - str r0, [sp, 0xC] - adds r0, r5, 0 - adds r2, r6, 0 - movs r3, 0x1 - bl sub_818D7D8 - mov r2, r9 - ldr r1, [r2] - add r1, r8 - movs r2, 0xA5 - lsls r2, 2 - adds r1, r2 - strb r0, [r1] - mov r1, r9 - ldr r0, [r1] - add r0, r8 - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r2, =gSprites - adds r0, r2 - adds r0, 0x28 - movs r1, 0 - strb r1, [r0] - mov r2, r9 - ldr r0, [r2] - add r0, r8 - movs r1, 0xA5 - lsls r1, 2 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r2, =gSprites - adds r0, r2 - adds r0, 0x29 - movs r1, 0 - strb r1, [r0] - b _0819C012 - .pool -_0819C008: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x5 - bls _0819BF48 -_0819C012: - mov r2, r10 - lsls r0, r2, 24 - lsrs r7, r0, 24 - cmp r7, 0x2 - bls _0819BF3E - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - movs r1, 0xA8 - lsls r1, 2 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819BF2C - - thumb_func_start sub_819C040 -sub_819C040: @ 819C040 - push {r4-r6,lr} - adds r4, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0819C0DC - ldr r3, =gSprites - ldr r6, =gUnknown_0300127C - ldr r2, [r6] - ldr r0, =0x00000295 - adds r5, r2, r0 - ldrb r0, [r5] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - adds r1, 0x3F - ldrb r0, [r1] - lsls r0, 26 - cmp r0, 0 - bge _0819C0DC - ldr r1, =0x0000029d - adds r0, r2, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3F - ldrb r0, [r0] - lsls r0, 26 - cmp r0, 0 - bge _0819C0DC - adds r1, r4, 0 - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - ldrb r1, [r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - ldr r0, [r6] - ldr r1, =0x0000029d - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - ldr r0, =sub_819C1D0 - movs r1, 0x1 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r1, [r1] - bl _call_via_r1 - ldr r0, =SpriteCallbackDummy - str r0, [r4, 0x1C] -_0819C0DC: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819C040 - - thumb_func_start sub_819C100 -sub_819C100: @ 819C100 - push {r4-r7,lr} - adds r5, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0819C1BA - ldr r6, =gSprites - ldr r4, =gUnknown_0300127C - ldr r2, [r4] - ldr r7, =0x00000295 - adds r0, r2, r7 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x3F - ldrb r0, [r0] - lsls r0, 26 - cmp r0, 0 - bge _0819C1BA - ldr r1, =0x0000029d - adds r0, r2, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x3F - ldrb r0, [r0] - lsls r0, 26 - cmp r0, 0 - bge _0819C1BA - ldrb r0, [r5, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl FreeOamMatrix - ldr r0, [r4] - adds r0, r7 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl FreeOamMatrix - ldr r0, [r4] - ldr r1, =0x0000029d - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl FreeOamMatrix - ldr r0, [r4] - movs r1, 0xA8 - lsls r1, 2 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - ldr r0, [r4] - adds r0, r7 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - bl DestroySprite - ldr r0, [r4] - ldr r1, =0x0000029d - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - bl DestroySprite - adds r0, r5, 0 - bl DestroySprite -_0819C1BA: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819C100 - - thumb_func_start sub_819C1D0 -sub_819C1D0: @ 819C1D0 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _0819C24E - cmp r0, 0x1 - bgt _0819C1F8 - cmp r0, 0 - beq _0819C1FE - b _0819C2BA - .pool -_0819C1F8: - cmp r0, 0x2 - beq _0819C270 - b _0819C2BA -_0819C1FE: - movs r0, 0x10 - strh r0, [r4, 0xE] - movs r0, 0xE0 - strh r0, [r4, 0x38] - movs r0, 0x40 - strh r0, [r4, 0x12] - movs r0, 0x41 - strh r0, [r4, 0x18] - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - bl SetGpuRegBits - ldrh r1, [r4, 0xE] - lsls r1, 8 - ldrh r0, [r4, 0x38] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x40 - bl SetGpuReg - ldrh r1, [r4, 0x12] - lsls r1, 8 - ldrh r0, [r4, 0x18] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x44 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0x3F - bl SetGpuReg - movs r0, 0x4A - movs r1, 0x37 - bl SetGpuReg - b _0819C2C6 -_0819C24E: - movs r0, 0x3 - bl ShowBg - ldr r1, =0x00001248 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x0000040b - movs r0, 0x52 - bl SetGpuReg - b _0819C2C6 - .pool -_0819C270: - ldrh r0, [r4, 0x12] - subs r0, 0x4 - strh r0, [r4, 0x12] - ldrh r1, [r4, 0x18] - adds r1, 0x4 - strh r1, [r4, 0x18] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x20 - ble _0819C28C - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0x5F - ble _0819C29E -_0819C28C: - movs r0, 0x20 - strh r0, [r4, 0x12] - movs r0, 0x60 - strh r0, [r4, 0x18] - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - bl ClearGpuRegBits -_0819C29E: - ldrh r1, [r4, 0x12] - lsls r1, 8 - ldrh r0, [r4, 0x18] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x44 - bl SetGpuReg - movs r1, 0x12 - ldrsh r0, [r4, r1] - cmp r0, 0x20 - bne _0819C2CC - b _0819C2C6 -_0819C2BA: - adds r0, r2, 0 - bl DestroyTask - bl sub_819BF2C - b _0819C2CC -_0819C2C6: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_0819C2CC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_819C1D0 - - thumb_func_start sub_819C2D4 -sub_819C2D4: @ 819C2D4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r7, r0, 24 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0819C2F6 - b _0819C410 -_0819C2F6: - cmp r0, 0x1 - bne _0819C2FC - b _0819C460 -_0819C2FC: - movs r0, 0x3 - bl HideBg - ldr r4, =gSprites - ldr r0, =gUnknown_0300127C - mov r8, r0 - ldr r0, [r0] - ldr r1, =0x00000299 - mov r12, r1 - add r0, r12 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - adds r1, 0x3E - ldrb r2, [r1] - movs r3, 0x5 - negs r3, r3 - adds r0, r3, 0 - ands r0, r2 - strb r0, [r1] - mov r0, r8 - ldr r2, [r0] - mov r1, r12 - adds r0, r2, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r6, r4, 0 - adds r6, 0x1C - adds r0, r6 - ldr r1, =sub_819C100 - str r1, [r0] - ldr r0, =0x00000295 - mov r9, r0 - add r2, r9 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r2, [r0] - adds r1, r3, 0 - ands r1, r2 - strb r1, [r0] - mov r1, r8 - ldr r2, [r1] - mov r1, r9 - adds r0, r2, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldr r1, =SpriteCallbackDummy - mov r10, r1 - str r1, [r0] - ldr r5, =0x0000029d - adds r2, r5 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - ands r3, r1 - strb r3, [r0] - mov r0, r8 - ldr r2, [r0] - adds r0, r2, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - mov r1, r10 - str r1, [r0] - add r2, r12 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x1 - bl StartSpriteAffineAnim - mov r1, r8 - ldr r0, [r1] - add r0, r9 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x1 - bl StartSpriteAffineAnim - mov r1, r8 - ldr r0, [r1] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x1 - bl StartSpriteAffineAnim - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - bl ClearGpuRegBits - adds r0, r7, 0 - bl DestroyTask - b _0819C4A4 - .pool -_0819C410: - movs r0, 0x10 - strh r0, [r4, 0xE] - movs r0, 0xE0 - strh r0, [r4, 0x38] - movs r0, 0x20 - strh r0, [r4, 0x12] - movs r0, 0x60 - strh r0, [r4, 0x18] - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - bl SetGpuRegBits - ldrh r1, [r4, 0xE] - lsls r1, 8 - ldrh r0, [r4, 0x38] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x40 - bl SetGpuReg - ldrh r1, [r4, 0x12] - lsls r1, 8 - ldrh r0, [r4, 0x18] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x44 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0x3F - bl SetGpuReg - movs r0, 0x4A - movs r1, 0x37 - bl SetGpuReg - b _0819C49E -_0819C460: - ldrh r0, [r4, 0x12] - adds r0, 0x4 - strh r0, [r4, 0x12] - ldrh r1, [r4, 0x18] - subs r1, 0x4 - strh r1, [r4, 0x18] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3F - bgt _0819C47C - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0x41 - bgt _0819C484 -_0819C47C: - movs r0, 0x40 - strh r0, [r4, 0x12] - movs r0, 0x41 - strh r0, [r4, 0x18] -_0819C484: - ldrh r1, [r4, 0x12] - lsls r1, 8 - ldrh r0, [r4, 0x18] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x44 - bl SetGpuReg - movs r1, 0x12 - ldrsh r0, [r4, r1] - cmp r0, 0x40 - bne _0819C4A4 -_0819C49E: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_0819C4A4: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_819C2D4 - - thumb_func_start sub_819C4B4 -sub_819C4B4: @ 819C4B4 - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r4, =gUnknown_08610638 - adds r0, r4, 0 - movs r1, 0x78 - movs r2, 0x40 - movs r3, 0x1 - bl CreateSprite - ldr r6, =gUnknown_0300127C - ldr r1, [r6] - ldr r2, =0x00000299 - mov r8, r2 - add r1, r8 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x2C - movs r2, 0x40 - movs r3, 0x1 - bl CreateSprite - ldr r1, [r6] - ldr r5, =0x00000295 - adds r1, r5 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0xC4 - movs r2, 0x40 - movs r3, 0x1 - bl CreateSprite - ldr r1, [r6] - ldr r4, =0x0000029d - adds r1, r4 - strb r0, [r1] - ldr r3, =gSprites - ldr r2, [r6] - add r8, r2 - mov r0, r8 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r3, 0x1C - adds r0, r3 - ldr r1, =sub_819C040 - str r1, [r0] - adds r5, r2, r5 - ldrb r1, [r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldr r5, =SpriteCallbackDummy - str r5, [r0] - adds r4, r2, r4 - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - str r5, [r0] - movs r0, 0xA8 - lsls r0, 2 - adds r2, r0 - movs r0, 0x1 - strb r0, [r2] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819C4B4 - - thumb_func_start sub_819C568 -sub_819C568: @ 819C568 - push {r4,lr} - ldr r4, =gUnknown_0300127C - ldr r0, [r4] - movs r1, 0xA5 - lsls r1, 2 - adds r0, r1 - ldrb r0, [r0] - bl sub_818D820 - ldr r0, [r4] - movs r1, 0xA6 - lsls r1, 2 - adds r0, r1 - ldrb r0, [r0] - bl sub_818D820 - ldr r0, [r4] - movs r1, 0xA7 - lsls r1, 2 - adds r0, r1 - ldrb r0, [r0] - bl sub_818D820 - ldr r0, =sub_819C2D4 - movs r1, 0x1 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r1, [r1] - bl _call_via_r1 - ldr r0, [r4] - movs r1, 0xA8 - lsls r1, 2 - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819C568 - - thumb_func_start sub_819C5D0 -sub_819C5D0: @ 819C5D0 - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r4, r0, 0 - adds r6, r1, 0 - adds r5, r2, 0 - mov r8, r3 - lsls r4, 16 - lsrs r4, 16 - lsls r6, 16 - lsrs r6, 16 - lsls r5, 16 - lsrs r5, 16 - mov r0, r8 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - bl SetGpuRegBits - lsls r4, 24 - lsrs r4, 16 - orrs r4, r6 - movs r0, 0x40 - adds r1, r4, 0 - bl SetGpuReg - lsls r5, 24 - lsrs r5, 16 - mov r0, r8 - orrs r5, r0 - movs r0, 0x44 - adds r1, r5, 0 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0x3F - bl SetGpuReg - movs r0, 0x4A - movs r1, 0x37 - bl SetGpuReg - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_819C5D0 - - thumb_func_start sub_819C634 -sub_819C634: @ 819C634 - push {r4-r7,lr} - lsls r0, 16 - ldr r2, =gUnknown_0203BC8C - ldr r1, [r2] - lsrs r0, 12 - adds r0, r1 - ldrh r6, [r0] - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - ldrb r5, [r0, 0x5] - movs r3, 0x1 - cmp r3, r5 - bcs _0819C694 - adds r4, r0, 0 - movs r0, 0x6C - mov r12, r0 - adds r7, r2, 0 -_0819C656: - movs r2, 0 -_0819C658: - mov r0, r12 - muls r0, r2 - adds r1, r4, r0 - ldrb r0, [r1, 0x10] - cmp r0, r3 - bne _0819C680 - ldrh r0, [r1, 0xC] - ldr r1, [r7] - lsls r0, 4 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r6 - bne _0819C68A - movs r0, 0 - b _0819C696 - .pool -_0819C680: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x5 - bls _0819C658 -_0819C68A: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, r5 - bcc _0819C656 -_0819C694: - movs r0, 0x1 -_0819C696: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_819C634 - - thumb_func_start sub_819C69C -sub_819C69C: @ 819C69C - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r5, r0, r1 - movs r0, 0x8 - ldrsh r2, [r5, r0] - cmp r2, 0x1 - beq _0819C6F8 - cmp r2, 0x1 - bgt _0819C6C4 - cmp r2, 0 - beq _0819C6CA - b _0819C7D8 - .pool -_0819C6C4: - cmp r2, 0x2 - beq _0819C7B4 - b _0819C7D8 -_0819C6CA: - ldr r1, =gUnknown_0300127C - ldr r0, [r1] - ldr r3, =0x000002a7 - adds r0, r3 - strb r2, [r0] - ldr r0, [r1] - adds r3, 0x1 - adds r0, r3 - strb r2, [r0] - ldr r0, [r1] - ldr r1, =0x000002a6 - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] - strh r1, [r5, 0x8] - b _0819C7D8 - .pool -_0819C6F8: - ldr r0, =gUnknown_0300127C - ldr r3, [r0] - ldr r2, =0x000002a2 - adds r1, r3, r2 - ldrb r1, [r1] - adds r7, r0, 0 - cmp r1, 0 - beq _0819C7D8 - ldr r1, =0x000002a9 - adds r0, r3, r1 - ldrb r4, [r0] - cmp r4, 0 - beq _0819C724 - movs r0, 0x2 - strh r0, [r5, 0x8] - b _0819C7D8 - .pool -_0819C724: - ldr r2, =0x000002a7 - adds r1, r3, r2 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r7] - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0x6 - bls _0819C764 - strb r4, [r1] - ldr r1, [r7] - subs r2, 0x1 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _0819C758 - movs r3, 0xAA - lsls r3, 2 - adds r1, r3 - ldrb r0, [r1] - subs r0, 0x1 - b _0819C762 - .pool -_0819C758: - movs r0, 0xAA - lsls r0, 2 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 -_0819C762: - strb r0, [r1] -_0819C764: - movs r0, 0x80 - lsls r0, 7 - ldr r1, [r7] - movs r4, 0xAA - lsls r4, 2 - adds r1, r4 - ldrb r1, [r1] - movs r2, 0 - bl BlendPalettes - ldr r2, [r7] - adds r4, r2, r4 - ldrb r0, [r4] - cmp r0, 0x5 - bls _0819C790 - ldr r3, =0x000002a6 - adds r1, r2, r3 - movs r0, 0 - b _0819C7D6 - .pool -_0819C790: - cmp r0, 0 - bne _0819C7D8 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - movs r1, 0x2 - strh r1, [r0, 0x8] - ldr r0, =0x000002a6 - adds r1, r2, r0 - movs r0, 0x1 - b _0819C7D6 - .pool -_0819C7B4: - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - ldr r2, =0x000002a9 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0xE - bls _0819C7D4 - movs r0, 0 - strb r0, [r1] - movs r0, 0x1 - strh r0, [r5, 0x8] - b _0819C7D8 - .pool -_0819C7D4: - adds r0, 0x1 -_0819C7D6: - strb r0, [r1] -_0819C7D8: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_819C69C - - thumb_func_start sub_819C7E0 -sub_819C7E0: @ 819C7E0 - push {lr} - bl AnimateSprites - bl BuildOamBuffer - bl RunTextPrinters - bl UpdatePaletteFade - bl RunTasks - pop {r0} - bx r0 - thumb_func_end sub_819C7E0 - - thumb_func_start sub_819C7FC -sub_819C7FC: @ 819C7FC - push {lr} - bl LoadOam - bl ProcessSpriteCopyRequests - bl TransferPlttBuffer - pop {r0} - bx r0 - thumb_func_end sub_819C7FC - - thumb_func_start sub_819C810 -sub_819C810: @ 819C810 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x4 - ldr r4, =gPlayerParty - ldr r5, =gUnknown_03001284 - ldr r1, [r5] - ldrb r0, [r1, 0x12] - movs r6, 0x64 - muls r0, r6 - adds r0, r4 - ldr r2, =gEnemyParty - mov r9, r2 - ldrb r1, [r1, 0x13] - muls r1, r6 - add r1, r9 - movs r2, 0x64 - bl memcpy - movs r1, 0 - mov r0, sp - strb r1, [r0] - ldr r0, [r5] - ldrb r0, [r0, 0x12] - muls r0, r6 - adds r0, r4 - movs r1, 0x20 - mov r2, sp - bl SetMonData - ldr r3, =gSaveBlock2Ptr - mov r8, r3 - ldr r3, [r3] - ldr r4, [r5] - ldrb r0, [r4, 0x12] - lsls r2, r0, 1 - adds r2, r0 - lsls r2, 2 - adds r2, r3, r2 - ldrb r1, [r4, 0x13] - adds r1, 0x3 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r3, r0 - movs r1, 0xE7 - lsls r1, 4 - adds r0, r1 - ldrh r0, [r0] - adds r2, r1 - strh r0, [r2] - ldrb r0, [r4, 0x12] - lsls r2, r0, 1 - adds r2, r0 - lsls r2, 2 - adds r2, r3, r2 - ldrb r1, [r4, 0x13] - adds r1, 0x3 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r3, r0 - ldr r0, =0x00000e78 - adds r3, r0 - ldrb r1, [r3] - adds r2, r0 - strb r1, [r2] - ldr r0, [r5] - ldrb r0, [r0, 0x13] - muls r0, r6 - add r0, r9 - movs r1, 0 - movs r2, 0 - bl GetMonData - mov r1, r8 - ldr r2, [r1] - ldr r4, [r5] - ldrb r3, [r4, 0x12] - lsls r1, r3, 1 - adds r1, r3 - lsls r1, 2 - ldr r3, =0x00000e74 - adds r2, r3 - adds r2, r1 - str r0, [r2] - ldrb r0, [r4, 0x13] - muls r0, r6 - add r0, r9 - movs r1, 0x2E - movs r2, 0 - bl pokemon_getattr_encrypted - mov r1, r8 - ldr r2, [r1] - ldr r1, [r5] - ldrb r3, [r1, 0x12] - lsls r1, r3, 1 - adds r1, r3 - lsls r1, 2 - adds r2, r1 - ldr r3, =0x00000e79 - adds r2, r3 - strb r0, [r2] - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819C810 - - thumb_func_start sub_819C90C -sub_819C90C: @ 819C90C - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r6, r0, r1 - movs r1, 0x8 - ldrsh r0, [r6, r1] - cmp r0, 0x7 - beq _0819C950 - cmp r0, 0x7 - bgt _0819C934 - cmp r0, 0x6 - beq _0819C93A - b _0819C9F0 - .pool -_0819C934: - cmp r0, 0x8 - beq _0819C9C4 - b _0819C9F0 -_0819C93A: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - movs r0, 0x7 - strh r0, [r6, 0x8] - b _0819C9F0 -_0819C950: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _0819C9F0 - ldr r4, =gUnknown_03001284 - ldr r0, [r4] - adds r0, 0x21 - ldrb r0, [r0] - bl DestroyTask - ldr r1, [r4] - ldr r0, [r1, 0x2C] - adds r1, 0x30 - bl sub_819F444 - bl sub_819E538 - ldr r4, =gUnknown_0203CE40 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203CE44 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203CE48 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203CE4C - ldr r0, [r4] - bl Free - str r5, [r4] - bl FreeAllWindowBuffers - movs r0, 0x8 - strh r0, [r6, 0x8] - b _0819C9F0 - .pool -_0819C9C4: - adds r0, r2, 0 - bl DestroyTask - ldr r2, =gUnknown_03001284 - ldr r1, [r2] - movs r0, 0x1 - strb r0, [r1, 0x15] - ldr r2, [r2] - ldr r0, =gPlttBufferUnfaded - movs r1, 0xF4 - lsls r1, 1 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r2, 0x24] - ldr r1, =gPlayerParty - ldrb r2, [r2, 0x3] - ldr r0, =sub_819DC1C - str r0, [sp] - movs r0, 0 - movs r3, 0x2 - bl sub_81BF8EC -_0819C9F0: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819C90C - - thumb_func_start sub_819CA08 -sub_819CA08: @ 819CA08 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r7, =gUnknown_03001284 - ldr r2, [r7] - adds r0, r2, 0 - adds r0, 0x30 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0819CAFE - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r1, [r4, r0] - cmp r1, 0x1 - beq _0819CA78 - cmp r1, 0x1 - bgt _0819CA44 - cmp r1, 0 - beq _0819CA4E - b _0819CAFE - .pool -_0819CA44: - cmp r1, 0x2 - beq _0819CA8C - cmp r1, 0x3 - beq _0819CAA4 - b _0819CAFE -_0819CA4E: - adds r0, r2, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x1 - bne _0819CA68 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - ldr r0, =gScriptResult - strh r1, [r0] - b _0819CAFE - .pool -_0819CA68: - movs r0, 0x2 - strh r0, [r4, 0x8] - ldr r1, =gScriptResult - movs r0, 0x1 - strh r0, [r1] - b _0819CAFE - .pool -_0819CA78: - adds r0, r2, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x1 - bne _0819CA9C - ldrb r0, [r2, 0x3] - strb r0, [r2, 0x13] - bl sub_819C810 - b _0819CA9C -_0819CA8C: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade -_0819CA9C: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0819CAFE -_0819CAA4: - bl UpdatePaletteFade - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _0819CAFE - ldr r0, [r7] - adds r0, 0x21 - ldrb r0, [r0] - bl DestroyTask - bl sub_819E538 - ldr r4, =gUnknown_0203CE40 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203CE44 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203CE48 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =gUnknown_0203CE4C - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r0, [r7] - bl Free - str r5, [r7] - bl FreeAllWindowBuffers - ldr r0, =sub_80861B0 - bl SetMainCallback2 - adds r0, r6, 0 - bl DestroyTask -_0819CAFE: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819CA08 - - thumb_func_start sub_819CB1C -sub_819CB1C: @ 819CB1C - push {r4-r7,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r7, =gUnknown_03001284 - ldr r0, [r7] - adds r0, 0x30 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0819CBD6 - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x4 - beq _0819CB50 - cmp r0, 0x5 - beq _0819CB5A - b _0819CBD6 - .pool -_0819CB50: - bl sub_819E9E0 - movs r0, 0x5 - strh r0, [r4, 0x8] - b _0819CBD6 -_0819CB5A: - ldr r2, =gMain - ldrh r1, [r2, 0x2E] - movs r6, 0x1 - adds r5, r6, 0 - ands r5, r1 - cmp r5, 0 - beq _0819CB86 - movs r0, 0x5 - bl PlaySE - ldr r0, [r7] - ldrb r0, [r0, 0x16] - cmp r0, 0 - bne _0819CB80 - strh r6, [r4, 0xA] - b _0819CB9C - .pool -_0819CB80: - movs r0, 0 - strh r0, [r4, 0xA] - b _0819CB96 -_0819CB86: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0819CBA8 - movs r0, 0x5 - bl PlaySE - strh r5, [r4, 0xA] -_0819CB96: - movs r0, 0x4 - bl sub_819EA64 -_0819CB9C: - ldrh r0, [r4, 0x14] - ldrh r1, [r4, 0x16] - lsls r0, 16 - orrs r0, r1 - str r0, [r4] - b _0819CBD6 -_0819CBA8: - ldrh r1, [r2, 0x30] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0819CBC2 - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - negs r0, r0 - bl sub_819E758 - b _0819CBD6 -_0819CBC2: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0819CBD6 - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - bl sub_819E758 -_0819CBD6: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_819CB1C - - thumb_func_start sub_819CBDC -sub_819CBDC: @ 819CBDC - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r2, r1, r2 - movs r1, 0xA - ldrsh r0, [r2, r1] - cmp r0, 0x1 - bne _0819CC04 - movs r0, 0 - strh r0, [r2, 0x8] - ldr r0, =sub_819CA08 - b _0819CC16 - .pool -_0819CC04: - movs r0, 0 - strh r0, [r2, 0x8] - ldr r1, =sub_819CE40 - lsrs r0, r1, 16 - strh r0, [r2, 0x14] - strh r1, [r2, 0x16] - movs r0, 0x1 - strh r0, [r2, 0x12] - ldr r0, =sub_819D770 -_0819CC16: - str r0, [r2] - pop {r0} - bx r0 - .pool - thumb_func_end sub_819CBDC - - thumb_func_start sub_819CC24 -sub_819CC24: @ 819CC24 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - movs r0, 0x8 - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _0819CC5A - ldr r0, =gUnknown_085EECBB - bl sub_819EBEC - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r0, 0x20 - strb r5, [r0] - movs r0, 0x4 - strh r0, [r4, 0x8] - ldr r1, =sub_819CBDC - lsrs r0, r1, 16 - strh r0, [r4, 0x14] - strh r1, [r4, 0x16] - ldr r0, =sub_819CB1C - str r0, [r4] -_0819CC5A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819CC24 - - thumb_func_start sub_819CC74 -sub_819CC74: @ 819CC74 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldr r0, [r1, 0x2C] - adds r1, 0x30 - movs r2, 0x1 - bl sub_819F3F8 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r2, r0, r1 - movs r1, 0xA - ldrsh r0, [r2, r1] - cmp r0, 0x1 - bne _0819CCB0 - movs r0, 0 - strh r0, [r2, 0x8] - ldr r0, =sub_819CA08 - b _0819CCC2 - .pool -_0819CCB0: - movs r0, 0 - strh r0, [r2, 0x8] - ldr r1, =sub_819CE40 - lsrs r0, r1, 16 - strh r0, [r2, 0x14] - strh r1, [r2, 0x16] - movs r0, 0x1 - strh r0, [r2, 0x12] - ldr r0, =sub_819D770 -_0819CCC2: - str r0, [r2] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819CC74 - - thumb_func_start sub_819CCD4 -sub_819CCD4: @ 819CCD4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r5, r1, r2 - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0819CD1A - ldr r4, =gUnknown_03001284 - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x2D - adds r1, 0x30 - movs r2, 0x1 - bl sub_819F2B4 - ldr r0, =gUnknown_085EECF0 - bl sub_819EBEC - ldr r0, [r4] - adds r0, 0x20 - movs r1, 0x1 - strb r1, [r0] - movs r0, 0x4 - strh r0, [r5, 0x8] - ldr r1, =sub_819CC74 - lsrs r0, r1, 16 - strh r0, [r5, 0x14] - strh r1, [r5, 0x16] - ldr r0, =sub_819CB1C - str r0, [r5] -_0819CD1A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819CCD4 - - thumb_func_start sub_819CD34 -sub_819CD34: @ 819CD34 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r5, r0, r1 - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0x3 - beq _0819CDA4 - cmp r0, 0x3 - bgt _0819CD60 - cmp r0, 0x2 - beq _0819CD66 - b _0819CE36 - .pool -_0819CD60: - cmp r0, 0x9 - beq _0819CD88 - b _0819CE36 -_0819CD66: - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldrb r0, [r1, 0x15] - cmp r0, 0 - bne _0819CD7C - adds r0, r1, 0 - adds r0, 0x2D - adds r1, 0x30 - movs r2, 0x1 - bl sub_819F2B4 -_0819CD7C: - movs r0, 0x9 - strh r0, [r5, 0x8] - b _0819CE36 - .pool -_0819CD88: - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r0, 0x30 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0819CE36 - bl sub_819E944 - movs r0, 0x3 - strh r0, [r5, 0x8] - b _0819CE36 - .pool -_0819CDA4: - ldr r7, =gUnknown_03001284 - ldr r0, [r7] - adds r0, 0x30 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0819CE36 - ldr r2, =gMain - ldrh r1, [r2, 0x2E] - movs r0, 0x1 - mov r8, r0 - mov r4, r8 - ands r4, r1 - cmp r4, 0 - beq _0819CDD8 - movs r0, 0x5 - bl PlaySE - adds r0, r6, 0 - bl sub_819F0A0 - b _0819CE36 - .pool -_0819CDD8: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0819CE14 - movs r0, 0x5 - bl PlaySE - ldr r1, [r7] - ldr r0, [r1, 0x2C] - adds r1, 0x30 - movs r2, 0x1 - bl sub_819F3F8 - movs r0, 0x3 - bl sub_819EA64 - strh r4, [r5, 0x8] - ldr r1, =sub_819CE40 - lsrs r0, r1, 16 - strh r0, [r5, 0x14] - strh r1, [r5, 0x16] - mov r1, r8 - strh r1, [r5, 0x12] - ldr r0, =sub_819D770 - str r0, [r5] - b _0819CE36 - .pool -_0819CE14: - ldrh r1, [r2, 0x30] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0819CE28 - movs r0, 0x1 - negs r0, r0 - bl sub_819E7C0 - b _0819CE36 -_0819CE28: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0819CE36 - movs r0, 0x1 - bl sub_819E7C0 -_0819CE36: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_819CD34 - - thumb_func_start sub_819CE40 -sub_819CE40: @ 819CE40 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0819CE64 - cmp r0, 0x1 - beq _0819CE88 - b _0819CF4C - .pool -_0819CE64: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0819CF4C - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r0, 0x22 - movs r1, 0x1 - strb r1, [r0] - strh r1, [r4, 0x8] - b _0819CF4C - .pool -_0819CE88: - ldr r2, =gMain - ldrh r1, [r2, 0x2E] - adds r5, r1, 0 - ands r5, r0 - cmp r5, 0 - beq _0819CEBC - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r0, 0x22 - movs r1, 0 - strb r1, [r0] - bl sub_819EE08 - bl sub_819EAC0 - adds r0, r6, 0 - bl sub_819F184 - b _0819CF4C - .pool -_0819CEBC: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0819CEF8 - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r0, 0x22 - strb r5, [r0] - bl sub_819EE08 - bl sub_819EAC0 - ldr r1, =sub_819CC24 - lsrs r0, r1, 16 - strh r0, [r4, 0x14] - strh r1, [r4, 0x16] - strh r5, [r4, 0x8] - strh r5, [r4, 0x12] - ldr r0, =sub_819D588 - str r0, [r4] - b _0819CF4C - .pool -_0819CEF8: - ldrh r1, [r2, 0x30] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0819CF0C - movs r0, 0x1 - negs r0, r0 - bl sub_819E694 - b _0819CF2A -_0819CF0C: - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0819CF1C - movs r0, 0x1 - bl sub_819E694 - b _0819CF2A -_0819CF1C: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0819CF34 - movs r0, 0x1 - bl sub_819E6E8 -_0819CF2A: - bl sub_819EFA8 - bl sub_819EB4C - b _0819CF4C -_0819CF34: - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0819CF4C - movs r0, 0x1 - negs r0, r0 - bl sub_819E6E8 - bl sub_819EFA8 - bl sub_819EB4C -_0819CF4C: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_819CE40 - - thumb_func_start sub_819CF54 -sub_819CF54: @ 819CF54 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r2, [r4, r0] - cmp r2, 0x1 - beq _0819CFA0 - cmp r2, 0x1 - bgt _0819CF7C - cmp r2, 0 - beq _0819CF82 - b _0819D05C - .pool -_0819CF7C: - cmp r2, 0x2 - beq _0819D03C - b _0819D05C -_0819CF82: - ldr r1, =gUnknown_03001284 - ldr r0, [r1] - adds r0, 0x27 - strb r2, [r0] - ldr r0, [r1] - adds r0, 0x28 - strb r2, [r0] - ldr r0, [r1] - adds r0, 0x26 - movs r1, 0x1 - strb r1, [r0] - strh r1, [r4, 0x8] - b _0819D05C - .pool -_0819CFA0: - ldr r1, =gUnknown_03001284 - ldr r2, [r1] - adds r0, r2, 0 - adds r0, 0x22 - ldrb r0, [r0] - adds r6, r1, 0 - cmp r0, 0 - beq _0819D05C - adds r0, r2, 0 - adds r0, 0x29 - ldrb r3, [r0] - cmp r3, 0 - beq _0819CFC4 - movs r0, 0x2 - strh r0, [r4, 0x8] - b _0819D05C - .pool -_0819CFC4: - adds r1, r2, 0 - adds r1, 0x27 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r6] - adds r1, r0, 0 - adds r1, 0x27 - ldrb r0, [r1] - cmp r0, 0x6 - bls _0819CFF8 - strb r3, [r1] - ldr r1, [r6] - adds r0, r1, 0 - adds r0, 0x26 - ldrb r0, [r0] - cmp r0, 0 - bne _0819CFF0 - adds r1, 0x28 - ldrb r0, [r1] - subs r0, 0x1 - b _0819CFF6 -_0819CFF0: - adds r1, 0x28 - ldrb r0, [r1] - adds r0, 0x1 -_0819CFF6: - strb r0, [r1] -_0819CFF8: - movs r0, 0x80 - lsls r0, 7 - ldr r1, [r6] - adds r1, 0x28 - ldrb r1, [r1] - movs r2, 0 - bl BlendPalettes - ldr r2, [r6] - adds r0, r2, 0 - adds r0, 0x28 - ldrb r0, [r0] - cmp r0, 0x5 - bls _0819D01C - adds r1, r2, 0 - adds r1, 0x26 - movs r0, 0 - b _0819D05A -_0819D01C: - cmp r0, 0 - bne _0819D05C - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0x2 - strh r1, [r0, 0x8] - adds r1, r2, 0 - adds r1, 0x26 - movs r0, 0x1 - b _0819D05A - .pool -_0819D03C: - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r1, r0, 0 - adds r1, 0x29 - ldrb r0, [r1] - cmp r0, 0xE - bls _0819D058 - movs r0, 0 - strb r0, [r1] - movs r0, 0x1 - strh r0, [r4, 0x8] - b _0819D05C - .pool -_0819D058: - adds r0, 0x1 -_0819D05A: - strb r0, [r1] -_0819D05C: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_819CF54 - - thumb_func_start sub_819D064 -sub_819D064: @ 819D064 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - movs r0, 0x8 - ldrsh r1, [r4, r0] - cmp r1, 0x1 - beq _0819D0A4 - cmp r1, 0x1 - bgt _0819D08C - cmp r1, 0 - beq _0819D092 - b _0819D118 - .pool -_0819D08C: - cmp r1, 0x2 - beq _0819D0BC - b _0819D118 -_0819D092: - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r0, 0x27 - strb r1, [r0] - strh r1, [r4, 0x10] - b _0819D0AE - .pool -_0819D0A4: - ldr r0, =gPlttBufferUnfaded+ 0x1E0 - movs r1, 0xE0 - movs r2, 0xA - bl LoadPalette -_0819D0AE: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0819D118 - .pool -_0819D0BC: - ldr r2, =gUnknown_03001284 - ldr r0, [r2] - adds r0, 0x28 - ldrb r0, [r0] - cmp r0, 0xF - bls _0819D0D2 - movs r0, 0x1 - strh r0, [r4, 0x10] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_0819D0D2: - ldr r1, [r2] - adds r1, 0x27 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r2] - adds r1, r0, 0 - adds r1, 0x27 - ldrb r0, [r1] - cmp r0, 0x3 - bls _0819D108 - movs r0, 0 - strb r0, [r1] - ldr r1, =gPlttBufferUnfaded - ldr r0, =gPlttBufferFaded - movs r3, 0xE4 - lsls r3, 1 - adds r0, r3 - ldrh r0, [r0] - adds r3, 0x20 - adds r1, r3 - strh r0, [r1] - ldr r1, [r2] - adds r1, 0x28 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_0819D108: - movs r0, 0x80 - lsls r0, 7 - ldr r1, [r2] - adds r1, 0x28 - ldrb r1, [r1] - movs r2, 0 - bl BlendPalettes -_0819D118: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819D064 - - thumb_func_start sub_819D12C -sub_819D12C: @ 819D12C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - ldr r1, =gTasks - lsls r0, 2 - ldr r2, [sp] - adds r0, r2 - lsls r0, 3 - adds r4, r0, r1 - movs r2, 0x8 - ldrsh r3, [r4, r2] - cmp r3, 0 - beq _0819D15C - cmp r3, 0x1 - beq _0819D168 - b _0819D310 - .pool -_0819D15C: - strh r3, [r4, 0xA] - strh r3, [r4, 0xC] - strh r3, [r4, 0xE] - movs r0, 0x1 - strh r0, [r4, 0x8] - b _0819D310 -_0819D168: - movs r3, 0 - str r3, [sp, 0x4] - movs r1, 0x2 - str r0, [sp, 0x8] - ldr r0, =gTasks - str r0, [sp, 0xC] -_0819D174: - lsls r0, r1, 24 - asrs r4, r0, 24 - mov r9, r0 - cmp r4, 0x2 - beq _0819D1F2 - ldr r2, =gSprites - ldr r3, =gUnknown_03001284 - ldr r0, [r3] - adds r0, 0x5 - mov r8, r0 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r6, r0, r2 - ldrh r1, [r6, 0x20] - mov r12, r1 - mov r7, r12 - ldr r1, [sp, 0x4] - subs r0, r1, r7 - lsls r0, 24 - lsrs r5, r0, 24 - mov r10, r2 - cmp r5, 0x10 - beq _0819D1BE - adds r0, r4, 0x2 - lsls r0, 1 - ldr r2, [sp, 0x8] - adds r0, r2 - ldr r1, =gTasks - adds r1, 0x8 - adds r0, r1 - movs r3, 0 - ldrsh r0, [r0, r3] - cmp r0, 0x1 - bne _0819D1D8 -_0819D1BE: - lsls r0, r7, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - mov r0, r12 - adds r0, 0xA - strh r0, [r6, 0x20] - b _0819D210 - .pool -_0819D1D8: - cmp r5, 0x10 - bls _0819D210 - adds r0, r4, 0x1 - add r0, r8 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r10 - ldrh r0, [r0, 0x20] - subs r0, 0x30 - strh r0, [r6, 0x20] - b _0819D210 -_0819D1F2: - ldr r3, =gSprites - ldr r4, =gUnknown_03001284 - ldr r0, [r4] - ldrb r1, [r0, 0x7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r2, [r0, 0x20] - lsls r1, r2, 24 - lsrs r1, 24 - str r1, [sp, 0x4] - adds r2, 0xA - strh r2, [r0, 0x20] - mov r10, r3 -_0819D210: - mov r0, r9 - asrs r2, r0, 24 - adds r0, r2, 0x1 - lsls r0, 1 - ldr r1, [sp, 0x8] - adds r0, r1 - ldr r1, =gTasks - adds r1, 0x8 - adds r0, r1 - movs r3, 0 - ldrsh r0, [r0, r3] - cmp r0, 0x1 - bne _0819D26A - ldr r1, =gUnknown_03001284 - ldr r0, [r1] - adds r0, 0x5 - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - mov r3, r10 - adds r1, r0, r3 - movs r0, 0x20 - ldrsh r3, [r1, r0] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 4 - adds r0, 0x48 - cmp r3, r0 - ble _0819D260 - strh r0, [r1, 0x20] - movs r7, 0x1 - b _0819D26C - .pool -_0819D260: - movs r7, 0 - cmp r3, r0 - bne _0819D26C - movs r7, 0x1 - b _0819D26C -_0819D26A: - movs r7, 0 -_0819D26C: - mov r6, r10 - ldr r5, =gUnknown_03001284 - ldr r2, [r5] - mov r1, r9 - asrs r4, r1, 24 - adds r0, r2, 0x5 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r6 - movs r3, 0x20 - ldrsh r0, [r1, r3] - subs r0, 0x10 - cmp r0, 0xF0 - ble _0819D2F8 - ldrh r0, [r1, 0x20] - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - ldr r0, =0x0000fff0 - strh r0, [r1, 0x20] - ldrb r0, [r2, 0x14] - cmp r0, 0x1 - bne _0819D2C0 - movs r0, 0x65 - bl IndexOfSpritePaletteTag - ldr r1, [r5] - adds r1, 0x5 - adds r1, r4 - ldrb r1, [r1] - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - adds r2, r6 - b _0819D2D8 - .pool -_0819D2C0: - movs r0, 0x64 - bl IndexOfSpritePaletteTag - ldr r2, =gUnknown_03001284 - ldr r1, [r2] - adds r1, 0x5 - adds r1, r4 - ldrb r1, [r1] - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - add r2, r10 -_0819D2D8: - lsls r0, 4 - ldrb r3, [r2, 0x5] - movs r1, 0xF - ands r1, r3 - orrs r1, r0 - strb r1, [r2, 0x5] - mov r3, r9 - asrs r0, r3, 23 - adds r0, 0x2 - ldr r1, [sp, 0x8] - adds r0, r1 - ldr r2, [sp, 0xC] - adds r2, 0x8 - adds r0, r2 - movs r1, 0x1 - strh r1, [r0] -_0819D2F8: - movs r0, 0xFF - lsls r0, 24 - add r0, r9 - lsrs r1, r0, 24 - cmp r0, 0 - blt _0819D306 - b _0819D174 -_0819D306: - cmp r7, 0x1 - bne _0819D310 - ldr r0, [sp] - bl DestroyTask -_0819D310: - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819D12C - - thumb_func_start sub_819D324 -sub_819D324: @ 819D324 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r7, r0, 24 - movs r0, 0 - mov r8, r0 - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r2, r0, r1 - ldrb r4, [r2, 0xE] - movs r0, 0xC - ldrsh r5, [r2, r0] - mov r10, r1 - cmp r5, 0x1 - bne _0819D352 - lsls r0, r4, 24 - negs r0, r0 - lsrs r4, r0, 24 -_0819D352: - movs r1, 0x8 - ldrsh r0, [r2, r1] - cmp r0, 0 - beq _0819D368 - cmp r0, 0x1 - bne _0819D360 - b _0819D480 -_0819D360: - b _0819D570 - .pool -_0819D368: - ldr r3, =gSprites - ldr r2, =gUnknown_03001284 - ldr r0, [r2] - ldrb r1, [r0, 0x8] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r0, [r0, 0x20] - cmp r5, 0 - bne _0819D39C - lsls r0, 16 - asrs r0, 16 - lsls r2, r4, 24 - asrs r1, r2, 24 - adds r0, r1 - movs r1, 0x1 - cmp r0, 0xEF - ble _0819D3B2 - movs r1, 0 - movs r0, 0xF0 - b _0819D3B0 - .pool -_0819D39C: - lsls r0, 16 - asrs r0, 16 - lsls r2, r4, 24 - asrs r1, r2, 24 - adds r0, r1 - movs r1, 0x1 - cmp r0, 0xA0 - bgt _0819D3B2 - movs r1, 0 - movs r0, 0xA0 -_0819D3B0: - mov r8, r0 -_0819D3B2: - cmp r1, 0x1 - bne _0819D3FC - movs r3, 0 - ldr r7, =gSprites - ldr r6, =gUnknown_03001284 - asrs r5, r2, 24 -_0819D3BE: - movs r4, 0 - adds r2, r3, 0x1 -_0819D3C2: - ldr r1, [r6] - lsls r0, r4, 1 - adds r0, r4 - adds r0, r3, r0 - adds r1, 0x8 - adds r1, r0 - ldrb r1, [r1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, r5 - strh r1, [r0, 0x20] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bls _0819D3C2 - lsls r0, r2, 24 - lsrs r3, r0, 24 - cmp r3, 0x2 - bls _0819D3BE - b _0819D570 - .pool -_0819D3FC: - movs r4, 0 - lsls r1, r7, 2 - mov r12, r1 - mov r6, r8 - adds r6, 0x10 - movs r0, 0x30 - add r0, r8 - mov r9, r0 - ldr r5, =gSprites -_0819D40E: - ldr r1, =gUnknown_03001284 - ldr r2, [r1] - lsls r3, r4, 1 - adds r3, r4 - adds r0, r2, 0 - adds r0, 0x8 - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - mov r1, r8 - strh r1, [r0, 0x20] - adds r0, r2, 0 - adds r0, 0x9 - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r6, [r0, 0x20] - adds r2, 0xA - adds r2, r3 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - mov r1, r9 - strh r1, [r0, 0x20] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bls _0819D40E - mov r1, r12 - adds r0, r1, r7 - lsls r0, 3 - add r0, r10 - ldrb r1, [r0, 0xA] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - add r0, r10 - movs r1, 0x1 - strh r1, [r0, 0xE] - adds r0, r7, 0 - bl DestroyTask - b _0819D570 - .pool -_0819D480: - ldr r2, =gSprites - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - ldrb r1, [r0, 0xE] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x20] - cmp r5, 0 - bne _0819D4B4 - lsls r0, 16 - asrs r0, 16 - lsls r2, r4, 24 - asrs r1, r2, 24 - adds r0, r1 - movs r1, 0x1 - cmp r0, 0xEF - ble _0819D4CA - movs r1, 0 - movs r0, 0xF0 - b _0819D4C8 - .pool -_0819D4B4: - lsls r0, 16 - asrs r0, 16 - lsls r2, r4, 24 - asrs r1, r2, 24 - adds r0, r1 - movs r1, 0x1 - cmp r0, 0xC0 - bgt _0819D4CA - movs r1, 0 - movs r0, 0xC0 -_0819D4C8: - mov r8, r0 -_0819D4CA: - cmp r1, 0x1 - bne _0819D510 - movs r3, 0 - ldr r7, =gSprites - ldr r6, =gUnknown_03001284 - asrs r5, r2, 24 -_0819D4D6: - movs r4, 0 - adds r2, r3, 0x1 -_0819D4DA: - ldr r0, [r6] - lsls r1, r4, 1 - adds r1, r3, r1 - adds r0, 0xE - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrh r1, [r0, 0x20] - adds r1, r5 - strh r1, [r0, 0x20] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bls _0819D4DA - lsls r0, r2, 24 - lsrs r3, r0, 24 - cmp r3, 0x1 - bls _0819D4D6 - b _0819D570 - .pool -_0819D510: - movs r4, 0 - lsls r1, r7, 2 - mov r12, r1 - mov r6, r8 - adds r6, 0x10 - ldr r5, =gSprites - ldr r0, =gUnknown_03001284 - mov r9, r0 -_0819D520: - mov r1, r9 - ldr r2, [r1] - lsls r3, r4, 1 - adds r0, r2, 0 - adds r0, 0xE - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - mov r1, r8 - strh r1, [r0, 0x20] - adds r2, 0xF - adds r2, r3 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r6, [r0, 0x20] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bls _0819D520 - mov r1, r12 - adds r0, r1, r7 - lsls r0, 3 - add r0, r10 - ldrb r1, [r0, 0xA] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - add r0, r10 - movs r1, 0x1 - strh r1, [r0, 0x10] - adds r0, r7, 0 - bl DestroyTask -_0819D570: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819D324 - - thumb_func_start sub_819D588 -sub_819D588: @ 819D588 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r2, 0x8 - ldrsh r0, [r0, r2] - mov r8, r1 - cmp r0, 0x5 - bls _0819D5AA - b _0819D762 -_0819D5AA: - lsls r0, 2 - ldr r1, =_0819D5BC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0819D5BC: - .4byte _0819D5D4 - .4byte _0819D5F0 - .4byte _0819D60C - .4byte _0819D63C - .4byte _0819D6F0 - .4byte _0819D73A -_0819D5D4: - ldr r0, =gUnknown_08610918 - movs r1, 0xE0 - movs r2, 0xA - bl LoadPalette - bl sub_819ED34 - movs r0, 0x5 - bl PutWindowTilemap - b _0819D622 - .pool -_0819D5F0: - movs r0, 0x3 - bl sub_819EA64 - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0819D762 - .pool -_0819D60C: - movs r0, 0x80 - lsls r0, 7 - ldr r1, =gUnknown_0860F13C - adds r1, 0x4A - ldrh r1, [r1] - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade -_0819D622: - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x8] - adds r1, 0x1 - strh r1, [r0, 0x8] - b _0819D762 - .pool -_0819D63C: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - beq _0819D64E - b _0819D762 -_0819D64E: - movs r0, 0x5 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x5 - movs r1, 0x2 - bl CopyWindowToVram - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - ldrb r0, [r0, 0x14] - cmp r0, 0x1 - bne _0819D6B0 - ldr r0, =sub_819D324 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gTasks - lsls r2, r5, 2 - adds r2, r5 - lsls r2, 3 - adds r2, r1 - strh r6, [r2, 0xE] - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - strh r5, [r0, 0xA] - strh r6, [r0, 0x8] - strh r6, [r0, 0xC] - movs r1, 0x6 - strh r1, [r0, 0xE] - movs r0, 0x5 - strh r0, [r2, 0xC] - ldrh r0, [r2, 0x8] - adds r0, 0x1 - strh r0, [r2, 0x8] - b _0819D762 - .pool -_0819D6B0: - ldr r0, =sub_819D324 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r4, r0, 24 - ldr r3, =gTasks - lsls r2, r5, 2 - adds r2, r5 - lsls r2, 3 - adds r2, r3 - movs r1, 0x1 - strh r1, [r2, 0xE] - strh r6, [r2, 0x10] - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r3 - strh r5, [r0, 0xA] - strh r1, [r0, 0x8] - strh r6, [r0, 0xC] - movs r1, 0x6 - strh r1, [r0, 0xE] - ldrh r0, [r2, 0x8] - adds r0, 0x2 - strh r0, [r2, 0x8] - b _0819D762 - .pool -_0819D6F0: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - mov r1, r8 - adds r6, r0, r1 - ldrh r0, [r6, 0xC] - movs r2, 0xC - ldrsh r7, [r6, r2] - cmp r7, 0 - bne _0819D734 - ldr r0, =sub_819D324 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r4, r0, 24 - strh r7, [r6, 0x10] - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - add r0, r8 - strh r5, [r0, 0xA] - movs r1, 0x1 - strh r1, [r0, 0x8] - strh r7, [r0, 0xC] - movs r1, 0x6 - strh r1, [r0, 0xE] - ldrh r0, [r6, 0x8] - adds r0, 0x1 - strh r0, [r6, 0x8] - b _0819D762 - .pool -_0819D734: - subs r0, 0x1 - strh r0, [r6, 0xC] - b _0819D762 -_0819D73A: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - mov r1, r8 - adds r2, r0, r1 - movs r1, 0xE - ldrsh r0, [r2, r1] - cmp r0, 0x1 - bne _0819D762 - movs r1, 0x10 - ldrsh r0, [r2, r1] - cmp r0, 0x1 - bne _0819D762 - ldrh r0, [r2, 0x12] - strh r0, [r2, 0x8] - ldrh r0, [r2, 0x14] - ldrh r1, [r2, 0x16] - lsls r0, 16 - orrs r0, r1 - str r0, [r2] -_0819D762: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_819D588 - - thumb_func_start sub_819D770 -sub_819D770: @ 819D770 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =gUnknown_03001284 - ldr r0, [r1] - adds r0, 0x30 - ldrb r0, [r0] - adds r3, r1, 0 - cmp r0, 0x1 - bne _0819D78C - b _0819D9D8 -_0819D78C: - ldr r0, =gTasks - lsls r2, r6, 2 - adds r1, r2, r6 - lsls r1, 3 - adds r1, r0 - movs r4, 0x8 - ldrsh r1, [r1, r4] - mov r8, r0 - adds r5, r2, 0 - cmp r1, 0x8 - bls _0819D7A4 - b _0819D9D8 -_0819D7A4: - lsls r0, r1, 2 - ldr r1, =_0819D7BC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0819D7BC: - .4byte _0819D7E0 - .4byte _0819D868 - .4byte _0819D8AE - .4byte _0819D8F4 - .4byte _0819D910 - .4byte _0819D928 - .4byte _0819D936 - .4byte _0819D948 - .4byte _0819D9B0 -_0819D7E0: - ldr r0, [r3] - ldrb r7, [r0, 0x14] - cmp r7, 0x1 - bne _0819D828 - ldr r0, =sub_819D324 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r4, r0, 24 - ldr r3, =gTasks - adds r2, r5, r6 - lsls r2, 3 - adds r2, r3 - movs r1, 0 - strh r1, [r2, 0xE] - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r3 - strh r6, [r0, 0xA] - strh r1, [r0, 0x8] - strh r7, [r0, 0xC] - movs r1, 0x6 - strh r1, [r0, 0xE] - movs r0, 0xA - strh r0, [r2, 0xC] - ldrh r0, [r2, 0x8] - adds r0, 0x1 - strh r0, [r2, 0x8] - b _0819D9D8 - .pool -_0819D828: - ldr r0, =sub_819D324 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r4, r0, 24 - ldr r3, =gTasks - adds r2, r5, r6 - lsls r2, 3 - adds r2, r3 - movs r0, 0 - movs r1, 0x1 - strh r1, [r2, 0xE] - strh r0, [r2, 0x10] - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r3 - strh r6, [r0, 0xA] - strh r1, [r0, 0x8] - strh r1, [r0, 0xC] - movs r1, 0x6 - strh r1, [r0, 0xE] - ldrh r0, [r2, 0x8] - adds r0, 0x2 - strh r0, [r2, 0x8] - b _0819D9D8 - .pool -_0819D868: - adds r0, r5, r6 - lsls r0, 3 - mov r1, r8 - adds r5, r0, r1 - ldrh r0, [r5, 0xC] - movs r2, 0xC - ldrsh r7, [r5, r2] - cmp r7, 0 - bne _0819D8A8 - ldr r0, =sub_819D324 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r4, r0, 24 - strh r7, [r5, 0x10] - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - add r0, r8 - strh r6, [r0, 0xA] - movs r1, 0x1 - strh r1, [r0, 0x8] - strh r1, [r0, 0xC] - movs r1, 0x6 - strh r1, [r0, 0xE] - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - b _0819D9D8 - .pool -_0819D8A8: - subs r0, 0x1 - strh r0, [r5, 0xC] - b _0819D9D8 -_0819D8AE: - adds r0, r5, r6 - lsls r0, 3 - mov r1, r8 - adds r4, r0, r1 - movs r2, 0xE - ldrsh r0, [r4, r2] - cmp r0, 0x1 - beq _0819D8C0 - b _0819D9D8 -_0819D8C0: - movs r1, 0x10 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _0819D8CA - b _0819D9D8 -_0819D8CA: - ldr r1, =gPlttBufferFaded - ldr r0, =gUnknown_0860F13C - adds r0, 0x4A - ldrh r0, [r0] - movs r2, 0xE2 - lsls r2, 1 - adds r1, r2 - strh r0, [r1] - bl sub_819ED34 - movs r0, 0x5 - bl PutWindowTilemap - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0819D9D8 - .pool -_0819D8F4: - movs r0, 0x80 - lsls r0, 7 - ldr r1, =gUnknown_0860F13C - adds r1, 0x4A - ldrh r1, [r1] - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - b _0819D990 - .pool -_0819D910: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0819D9D8 - movs r0, 0 - bl sub_819EDBC - b _0819D990 - .pool -_0819D928: - movs r0, 0x1 - bl sub_819EDBC - movs r0, 0x3 - bl PutWindowTilemap - b _0819D990 -_0819D936: - movs r0, 0x5 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x5 - movs r1, 0x2 - bl CopyWindowToVram - b _0819D990 -_0819D948: - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - ldrb r0, [r0, 0x14] - cmp r0, 0 - bne _0819D964 - ldr r0, =gUnknown_085EEC73 - bl sub_819EBEC - b _0819D96A - .pool -_0819D964: - ldr r0, =gUnknown_085EEC8B - bl sub_819EBEC -_0819D96A: - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldrb r0, [r1, 0x3] - cmp r0, 0x2 - bhi _0819D98C - ldr r2, =gSprites - ldrb r1, [r1, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] -_0819D98C: - bl sub_819EFA8 -_0819D990: - ldr r0, =gTasks - adds r1, r5, r6 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0819D9D8 - .pool -_0819D9B0: - bl sub_819EEF0 - bl sub_819EADC - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r0, 0x22 - movs r1, 0x1 - strb r1, [r0] - ldr r1, =gTasks - adds r0, r5, r6 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x12] - strh r1, [r0, 0x8] - ldrh r1, [r0, 0x14] - ldrh r2, [r0, 0x16] - lsls r1, 16 - orrs r1, r2 - str r1, [r0] -_0819D9D8: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819D770 - - thumb_func_start sub_819D9EC -sub_819D9EC: @ 819D9EC - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r0, 0x30 - ldrb r0, [r0] - cmp r0, 0x1 - bne _0819DA00 - b _0819DBCA -_0819DA00: - ldr r0, =gTasks - lsls r2, r6, 2 - adds r1, r2, r6 - lsls r1, 3 - adds r1, r0 - movs r3, 0x8 - ldrsh r1, [r1, r3] - adds r3, r0, 0 - adds r7, r2, 0 - cmp r1, 0x4 - bls _0819DA18 - b _0819DBCA -_0819DA18: - lsls r0, r1, 2 - ldr r1, =_0819DA30 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0819DA30: - .4byte _0819DA44 - .4byte _0819DA58 - .4byte _0819DA8C - .4byte _0819DABC - .4byte _0819DBB0 -_0819DA44: - bl sub_819EEF0 - ldr r0, =gTasks - adds r1, r7, r6 - lsls r1, 3 - adds r1, r0 - b _0819DB96 - .pool -_0819DA58: - bl sub_819EADC - ldr r2, =gSprites - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldr r0, =gTasks - adds r1, r7, r6 - lsls r1, 3 - adds r1, r0 - b _0819DB96 - .pool -_0819DA8C: - ldr r0, =sub_819D12C - movs r1, 0 - bl CreateTask - ldr r2, =gTasks - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r0, 0x21 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldr r1, =sub_819D064 - str r1, [r0] - b _0819DB90 - .pool -_0819DABC: - ldr r0, =sub_819D12C - bl FuncIsActiveTask - lsls r0, 24 - cmp r0, 0 - beq _0819DACA - b _0819DBCA -_0819DACA: - ldr r2, =gTasks - ldr r4, =gUnknown_03001284 - ldr r0, [r4] - adds r0, 0x21 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r1, 0x10 - ldrsh r0, [r0, r1] - cmp r0, 0x1 - bne _0819DBCA - bl sub_819EAC0 - ldr r0, [r4] - ldrb r0, [r0, 0x14] - cmp r0, 0 - bne _0819DB04 - movs r0, 0x1 - bl sub_819F048 - b _0819DB32 - .pool -_0819DB04: - movs r0, 0 - bl sub_819F048 - movs r2, 0 - ldr r5, =gSprites - movs r3, 0x4 -_0819DB10: - ldr r0, [r4] - adds r0, 0xB - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r3 - strb r1, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x2 - bls _0819DB10 -_0819DB32: - ldr r5, =gSprites - ldr r4, =gUnknown_03001284 - ldr r3, [r4] - ldrb r0, [r3, 0x4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - adds r0, r3, 0x5 - ldrb r2, [r3, 0x3] - adds r0, r2 - ldrb r2, [r0] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r5 - ldrh r0, [r0, 0x20] - movs r5, 0 - strh r0, [r1, 0x20] - ldr r2, =gTasks - adds r0, r3, 0 - adds r0, 0x21 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldr r1, =sub_819CF54 - str r1, [r0] - adds r3, 0x27 - strb r5, [r3] - ldr r0, [r4] - adds r0, 0x28 - movs r1, 0x6 - strb r1, [r0] - ldr r0, [r4] - adds r0, 0x26 - strb r5, [r0] - ldr r0, [r4] - adds r0, 0x21 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r1, 0x1 - strh r1, [r0, 0x8] -_0819DB90: - adds r1, r7, r6 - lsls r1, 3 - adds r1, r2 -_0819DB96: - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0819DBCA - .pool -_0819DBB0: - adds r0, r7, r6 - lsls r0, 3 - adds r0, r3 - movs r1, 0 - strh r1, [r0, 0x8] - ldr r2, =sub_819CE40 - lsrs r1, r2, 16 - strh r1, [r0, 0x14] - strh r2, [r0, 0x16] - movs r1, 0x1 - strh r1, [r0, 0x12] - ldr r1, =sub_819D770 - str r1, [r0] -_0819DBCA: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819D9EC - - thumb_func_start sub_819DBD8 -sub_819DBD8: @ 819DBD8 - push {r4,r5,lr} - ldr r5, =gUnknown_03001284 - ldr r4, [r5] - cmp r4, 0 - bne _0819DBF6 - movs r0, 0x34 - bl AllocZeroed - str r0, [r5] - strb r4, [r0, 0x3] - ldr r0, [r5] - adds r0, 0x30 - strb r4, [r0] - ldr r0, [r5] - strb r4, [r0, 0x15] -_0819DBF6: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819DBD8 - - thumb_func_start sub_819DC00 -sub_819DC00: @ 819DC00 - push {lr} - ldr r0, =gUnknown_03001284 - movs r1, 0 - str r1, [r0] - ldr r0, =sub_819DC1C - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_819DC00 - - thumb_func_start sub_819DC1C -sub_819DC1C: @ 819DC1C - push {r4-r6,lr} - sub sp, 0xC - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r0, r1, r2 - ldrb r0, [r0] - adds r2, r1, 0 - cmp r0, 0xF - bls _0819DC32 - b _0819E0AA -_0819DC32: - lsls r0, 2 - ldr r1, =_0819DC44 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0819DC44: - .4byte _0819DC84 - .4byte _0819DCD4 - .4byte _0819DDA8 - .4byte _0819DE68 - .4byte _0819DE94 - .4byte _0819DECC - .4byte _0819DEEC - .4byte _0819DF10 - .4byte _0819DF30 - .4byte _0819DF3C - .4byte _0819DF64 - .4byte _0819DF70 - .4byte _0819DF78 - .4byte _0819DF8C - .4byte _0819DFA4 - .4byte _0819E01C -_0819DC84: - movs r0, 0 - bl SetHBlankCallback - movs r0, 0 - bl SetVBlankCallback - movs r0, 0 - str r0, [sp, 0x8] - movs r1, 0xC0 - lsls r1, 19 - ldr r2, =0x05006000 - add r0, sp, 0x8 - bl CpuSet - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_086108B8 - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - ldr r0, =gUnknown_086108C8 - bl InitWindows - bl DeactivateAllTextPrinters - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _0819E00E - .pool -_0819DCD4: - ldr r5, =gUnknown_0203CE40 - movs r4, 0x88 - lsls r4, 3 - adds r0, r4, 0 - bl Alloc - str r0, [r5] - ldr r5, =gUnknown_0203CE44 - adds r0, r4, 0 - bl AllocZeroed - str r0, [r5] - ldr r5, =gUnknown_0203CE48 - movs r4, 0x80 - lsls r4, 4 - adds r0, r4, 0 - bl Alloc - str r0, [r5] - ldr r5, =gUnknown_0203CE4C - adds r0, r4, 0 - bl AllocZeroed - str r0, [r5] - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - movs r0, 0x4C - movs r1, 0 - bl SetGpuReg - movs r0, 0x40 - movs r1, 0 - bl SetGpuReg - movs r0, 0x44 - movs r1, 0 - bl SetGpuReg - movs r0, 0x42 - movs r1, 0 - bl SetGpuReg - movs r0, 0x46 - movs r1, 0 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0 - bl SetGpuReg - movs r0, 0x4A - movs r1, 0 - bl SetGpuReg - b _0819E006 - .pool -_0819DDA8: - bl ResetPaletteFade - bl ResetSpriteData - bl ResetTasks - bl FreeAllSpritePalettes - bl dp13_810BB8C - ldr r0, =gUnknown_08DC0754 - ldr r5, =gUnknown_0203CE40 - ldr r1, [r5] - movs r2, 0x88 - lsls r2, 2 - bl CpuSet - ldr r0, =gUnknown_0861033C - ldr r4, =gUnknown_0203CE44 - ldr r1, [r4] - movs r2, 0x30 - bl CpuSet - ldr r1, [r5] - movs r2, 0x88 - lsls r2, 3 - movs r0, 0x1 - movs r3, 0 - bl LoadBgTiles - ldr r1, [r4] - movs r0, 0x3 - movs r2, 0x60 - movs r3, 0 - bl LoadBgTiles - ldr r0, =gUnknown_08DC0B94 - ldr r4, =gUnknown_0203CE48 - ldr r1, [r4] - movs r2, 0x80 - lsls r2, 3 - bl CpuSet - ldr r1, [r4] - movs r2, 0x80 - lsls r2, 4 - movs r0, 0x1 - movs r3, 0 - bl LoadBgTilemap - ldr r0, =gUnknown_08DC0714 - movs r1, 0 - movs r2, 0x40 - bl LoadPalette - ldr r4, =gUnknown_08610918 - adds r0, r4, 0 - movs r1, 0xF0 - movs r2, 0xA - bl LoadPalette - adds r0, r4, 0 - movs r1, 0xE0 - movs r2, 0xA - bl LoadPalette - ldr r0, =gUnknown_0861039C - movs r1, 0x20 - movs r2, 0x4 - bl LoadPalette - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _0819E00E - .pool -_0819DE68: - ldr r0, =gUnknown_0203CE4C - ldr r1, [r0] - movs r0, 0x3 - bl SetBgTilemapBuffer - ldr r1, =gUnknown_0861023C - movs r0, 0x8 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x3 - movs r2, 0xB - movs r3, 0x4 - bl CopyToBgTilemapBufferRect - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - b _0819E006 - .pool -_0819DE94: - ldr r0, =gUnknown_086106B0 - bl LoadSpritePalettes - ldr r0, =gUnknown_08610650 - bl LoadSpriteSheets - ldr r0, =gUnknown_086106A0 - bl LoadCompressedObjectPic - ldr r0, =sub_819C7FC - bl SetVBlankCallback - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _0819E00E - .pool -_0819DECC: - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldrb r0, [r1, 0x15] - cmp r0, 0x1 - bne _0819DEDC - ldr r0, =gUnknown_0203CF20 - ldrb r0, [r0] - strb r0, [r1, 0x3] -_0819DEDC: - movs r0, 0x87 - lsls r0, 3 - adds r1, r2, r0 - b _0819E00E - .pool -_0819DEEC: - bl sub_819DBD8 - bl sub_819E0C0 - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - ldrb r0, [r0, 0x15] - cmp r0, 0x1 - bne _0819DF02 - bl sub_819F304 -_0819DF02: - movs r0, 0 - bl sub_819F048 - b _0819E006 - .pool -_0819DF10: - ldr r0, =gUnknown_085EEC73 - bl sub_819EBEC - movs r0, 0x2 - bl PutWindowTilemap - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _0819E00E - .pool -_0819DF30: - bl sub_819EFA8 - movs r0, 0x8 - bl PutWindowTilemap - b _0819E006 -_0819DF3C: - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - ldrb r0, [r0, 0x15] - cmp r0, 0 - bne _0819DF4A - bl sub_819EB4C -_0819DF4A: - movs r0, 0x1 - bl PutWindowTilemap - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _0819E00E - .pool -_0819DF64: - bl sub_819EB18 - movs r0, 0 - bl PutWindowTilemap - b _0819E006 -_0819DF70: - movs r0, 0x87 - lsls r0, 3 - adds r1, r2, r0 - b _0819E00E -_0819DF78: - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - ldrb r0, [r0, 0x15] - cmp r0, 0 - beq _0819E006 - bl sub_819EE08 - b _0819E006 - .pool -_0819DF8C: - bl sub_819ED78 - movs r0, 0x3 - bl PutWindowTilemap - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _0819E00E - .pool -_0819DFA4: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - ldrb r0, [r0, 0x15] - cmp r0, 0x1 - bne _0819E000 - movs r0, 0x3 - bl ShowBg - ldr r1, =0x00001248 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x0000040b - movs r0, 0x52 - bl SetGpuReg - b _0819E006 - .pool -_0819E000: - movs r0, 0x3 - bl HideBg -_0819E006: - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 -_0819E00E: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0819E0AA - .pool -_0819E01C: - ldr r0, =sub_819CF54 - movs r1, 0 - bl CreateTask - ldr r6, =gUnknown_03001284 - ldr r1, [r6] - adds r1, 0x21 - strb r0, [r1] - ldr r0, [r6] - ldrb r5, [r0, 0x15] - cmp r5, 0 - bne _0819E06C - ldr r4, =gTasks - adds r0, 0x21 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - strh r5, [r0, 0x8] - ldr r0, =sub_819CE40 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r1, r0, 24 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - strh r5, [r0, 0x8] - b _0819E0A4 - .pool -_0819E06C: - bl sub_819EAF8 - ldr r4, =gTasks - ldr r2, [r6] - adds r0, r2, 0 - adds r0, 0x21 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - movs r3, 0 - movs r1, 0x1 - strh r1, [r0, 0x8] - adds r2, 0x22 - strb r3, [r2] - ldr r0, =sub_819CD34 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r1, r0, 24 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - movs r1, 0x2 - strh r1, [r0, 0x8] -_0819E0A4: - ldr r0, =sub_819C7E0 - bl SetMainCallback2 -_0819E0AA: - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819DC1C - - thumb_func_start sub_819E0C0 -sub_819E0C0: @ 819E0C0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - mov r1, sp - ldr r0, =gUnknown_08610834 - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2,r5,r6} - stm r1!, {r2,r5,r6} - mov r1, sp - movs r0, 0x65 - strh r0, [r1, 0x2] - movs r6, 0 - ldr r4, =gUnknown_03001284 - movs r7, 0 - ldr r5, =gSprites -_0819E0E6: - lsls r1, r6, 1 - adds r1, r6 - lsls r1, 20 - movs r3, 0x90 - lsls r3, 15 - adds r1, r3 - asrs r1, 16 - mov r0, sp - movs r2, 0x40 - movs r3, 0x1 - bl CreateSprite - ldr r1, [r4] - adds r1, 0x5 - adds r1, r6 - strb r0, [r1] - ldr r0, [r4] - adds r0, 0x5 - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r7, [r0, 0x2E] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x2 - bls _0819E0E6 - ldr r7, =gUnknown_03001284 - ldr r1, [r7] - adds r0, r1, 0x5 - ldrb r1, [r1, 0x3] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =gSprites - adds r0, r4 - movs r5, 0x20 - ldrsh r1, [r0, r5] - ldr r0, =gUnknown_0861084C - movs r2, 0x58 - movs r3, 0 - bl CreateSprite - ldr r1, [r7] - movs r4, 0 - strb r0, [r1, 0x4] - ldr r0, =gUnknown_08610864 - movs r1, 0xB0 - movs r2, 0x70 - movs r3, 0 - bl CreateSprite - ldr r1, [r7] - strb r0, [r1, 0x1] - ldr r0, =gUnknown_0861087C - movs r1, 0xB0 - movs r2, 0x90 - movs r3, 0 - bl CreateSprite - ldr r1, [r7] - strb r0, [r1, 0x2] - ldr r0, [r7] - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r6, =gSprites - adds r0, r6 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldr r0, [r7] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - ldr r0, [r7] - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x28 - strb r4, [r0] - ldr r0, [r7] - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x29 - strb r4, [r0] - ldr r0, [r7] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x28 - strb r4, [r0] - ldr r0, [r7] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x29 - strb r4, [r0] - ldr r0, [r7] - ldrb r0, [r0, 0x15] - movs r1, 0xC0 - str r1, [sp, 0x18] - cmp r0, 0x1 - bne _0819E1E8 - movs r2, 0xF0 - str r2, [sp, 0x18] -_0819E1E8: - mov r1, sp - ldr r0, =gUnknown_0861084C - ldm r0!, {r3-r5} - stm r1!, {r3-r5} - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - mov r0, sp - movs r4, 0x68 - mov r10, r4 - mov r5, r10 - strh r5, [r0] - movs r1, 0xF0 - movs r2, 0x78 - movs r3, 0xA - bl CreateSprite - ldr r1, [r7] - strb r0, [r1, 0x8] - mov r1, sp - ldr r0, =gUnknown_08610864 - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - ldm r0!, {r4-r6} - stm r1!, {r4-r6} - mov r0, sp - movs r1, 0x69 - mov r9, r1 - mov r2, r9 - strh r2, [r0] - movs r4, 0x80 - lsls r4, 1 - adds r1, r4, 0 - movs r2, 0x78 - movs r3, 0xA - bl CreateSprite - ldr r1, [r7] - strb r0, [r1, 0x9] - movs r5, 0x90 - lsls r5, 1 - mov r0, sp - adds r1, r5, 0 - movs r2, 0x78 - movs r3, 0xA - bl CreateSprite - ldr r1, [r7] - strb r0, [r1, 0xA] - mov r1, sp - ldr r0, =gUnknown_0861084C - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - mov r0, sp - movs r3, 0x6A - mov r8, r3 - mov r6, r8 - strh r6, [r0] - movs r1, 0xF0 - movs r2, 0x78 - movs r3, 0x1 - bl CreateSprite - ldr r1, [r7] - strb r0, [r1, 0xB] - mov r1, sp - ldr r0, =gUnknown_08610864 - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - mov r1, sp - movs r0, 0x6B - strh r0, [r1] - mov r0, sp - adds r1, r4, 0 - movs r2, 0x78 - movs r3, 0x1 - bl CreateSprite - ldr r1, [r7] - strb r0, [r1, 0xC] - mov r0, sp - movs r6, 0x6C - strh r6, [r0] - adds r1, r5, 0 - movs r2, 0x78 - movs r3, 0x1 - bl CreateSprite - ldr r1, [r7] - strb r0, [r1, 0xD] - mov r1, sp - ldr r0, =gUnknown_0861084C - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - mov r0, sp - mov r4, r10 - strh r4, [r0] - ldr r1, [sp, 0x18] - movs r2, 0x90 - movs r3, 0xA - bl CreateSprite - ldr r1, [r7] - strb r0, [r1, 0xE] - mov r1, sp - ldr r0, =gUnknown_08610864 - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - ldm r0!, {r2,r4,r5} - stm r1!, {r2,r4,r5} - mov r0, sp - mov r3, r9 - strh r3, [r0] - ldr r4, [sp, 0x18] - adds r4, 0x10 - adds r1, r4, 0 - movs r2, 0x90 - movs r3, 0xA - bl CreateSprite - ldr r1, [r7] - strb r0, [r1, 0xF] - mov r1, sp - ldr r0, =gUnknown_0861084C - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - mov r0, sp - mov r5, r8 - strh r5, [r0] - ldr r1, [sp, 0x18] - movs r2, 0x90 - movs r3, 0x1 - bl CreateSprite - ldr r1, [r7] - strb r0, [r1, 0x10] - mov r1, sp - ldr r0, =gUnknown_08610864 - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - mov r0, sp - strh r6, [r0] - adds r1, r4, 0 - movs r2, 0x90 - movs r3, 0x1 - bl CreateSprite - ldr r1, [r7] - strb r0, [r1, 0x11] - movs r6, 0 - ldr r5, =gSprites - adds r4, r7, 0 - movs r7, 0 - movs r0, 0x4 - mov r10, r0 -_0819E330: - ldr r0, [r4] - lsls r3, r6, 1 - adds r2, r3, r6 - adds r0, 0x8 - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x28 - strb r7, [r0] - ldr r0, [r4] - adds r0, 0x8 - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x29 - strb r7, [r0] - ldr r0, [r4] - adds r0, 0x9 - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x28 - strb r7, [r0] - ldr r0, [r4] - adds r0, 0x9 - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x29 - strb r7, [r0] - ldr r0, [r4] - adds r0, 0xA - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x28 - strb r7, [r0] - ldr r0, [r4] - adds r0, 0xA - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x29 - strb r7, [r0] - ldr r0, [r4] - adds r0, 0xE - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x28 - strb r7, [r0] - ldr r0, [r4] - adds r0, 0xE - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x29 - strb r7, [r0] - ldr r0, [r4] - adds r0, 0xF - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x28 - strb r7, [r0] - ldr r0, [r4] - adds r0, 0xF - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x29 - strb r7, [r0] - ldr r0, [r4] - adds r0, 0x8 - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - mov r8, r0 - ldrb r1, [r0] - mov r0, r10 - orrs r1, r0 - mov r0, r8 - strb r1, [r0] - ldr r0, [r4] - adds r0, 0x9 - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - mov r8, r0 - ldrb r1, [r0] - mov r0, r10 - orrs r1, r0 - mov r0, r8 - strb r1, [r0] - ldr r0, [r4] - adds r0, 0xA - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - mov r2, r10 - orrs r1, r2 - strb r1, [r0] - ldr r0, [r4] - adds r0, 0xE - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - ldr r0, [r4] - adds r0, 0xF - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r3, =gUnknown_03001284 - mov r8, r3 - ldr r0, =gSprites - mov r9, r0 - cmp r6, 0x1 - bhi _0819E496 - b _0819E330 -_0819E496: - ldr r0, [r3] - ldrb r0, [r0, 0xE] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r9 - adds r1, 0x3E - ldrb r2, [r1] - movs r3, 0x5 - negs r3, r3 - adds r0, r3, 0 - b _0819E4C8 - .pool -_0819E4C8: - ands r0, r2 - strb r0, [r1] - mov r1, r8 - ldr r0, [r1] - ldrb r1, [r0, 0xF] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r9 - adds r0, 0x3E - ldrb r2, [r0] - adds r1, r3, 0 - ands r1, r2 - strb r1, [r0] - mov r2, r8 - ldr r0, [r2] - ldrb r1, [r0, 0x8] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r9 - adds r0, 0x3E - ldrb r2, [r0] - adds r1, r3, 0 - ands r1, r2 - strb r1, [r0] - mov r4, r8 - ldr r0, [r4] - ldrb r1, [r0, 0x9] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r9 - adds r0, 0x3E - ldrb r2, [r0] - adds r1, r3, 0 - ands r1, r2 - strb r1, [r0] - ldr r0, [r4] - ldrb r1, [r0, 0xA] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r9 - adds r0, 0x3E - ldrb r1, [r0] - ands r3, r1 - strb r3, [r0] - add sp, 0x1C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_819E0C0 - - thumb_func_start sub_819E538 -sub_819E538: @ 819E538 - push {r4-r7,lr} - movs r5, 0 -_0819E53C: - ldr r6, =gUnknown_03001284 - ldr r0, [r6] - adds r0, 0x5 - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =gSprites - adds r0, r4 - bl DestroySprite - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bls _0819E53C - ldr r0, [r6] - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl DestroySprite - ldr r0, [r6] - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl DestroySprite - ldr r0, [r6] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl DestroySprite - movs r5, 0 -_0819E590: - movs r4, 0 - lsls r6, r5, 1 -_0819E594: - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r1, r6, r5 - adds r1, r4, r1 - adds r0, 0x8 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl DestroySprite - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _0819E594 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - bls _0819E590 - movs r5, 0 -_0819E5C6: - movs r4, 0 - adds r7, r5, 0x1 - lsls r6, r5, 1 -_0819E5CC: - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r1, r4, r6 - adds r0, 0xE - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl DestroySprite - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bls _0819E5CC - lsls r0, r7, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - bls _0819E5C6 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819E538 - - thumb_func_start sub_819E608 -sub_819E608: @ 819E608 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x2 - bhi _0819E65C - ldr r4, =gSprites - ldr r5, =gUnknown_03001284 - ldr r0, [r5] - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - bl sub_819E8EC - ldr r0, [r5] - ldrb r2, [r0, 0x4] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - adds r0, 0x5 - adds r0, r6 - ldrb r2, [r0] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r4 - ldrh r0, [r0, 0x20] - strh r0, [r1, 0x20] - b _0819E684 - .pool -_0819E65C: - ldr r2, =gSprites - ldr r3, =gUnknown_03001284 - ldr r0, [r3] - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldr r0, [r3] - ldr r1, [r0, 0x18] - lsls r0, r6, 3 - adds r0, r1 - ldrb r0, [r0] - bl sub_819E838 -_0819E684: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819E608 - - thumb_func_start sub_819E694 -sub_819E694: @ 819E694 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x5 - bl PlaySE - lsls r4, 24 - cmp r4, 0 - ble _0819E6C0 - ldr r1, =gUnknown_03001284 - ldr r2, [r1] - ldrb r0, [r2, 0x3] - adds r0, 0x1 - ldrb r3, [r2, 0x17] - cmp r0, r3 - bne _0819E6D8 - movs r0, 0 - b _0819E6D8 - .pool -_0819E6C0: - ldr r0, =gUnknown_03001284 - ldr r2, [r0] - ldrb r3, [r2, 0x3] - adds r1, r0, 0 - cmp r3, 0 - beq _0819E6D4 - subs r0, r3, 0x1 - b _0819E6D8 - .pool -_0819E6D4: - ldrb r0, [r2, 0x17] - subs r0, 0x1 -_0819E6D8: - strb r0, [r2, 0x3] - ldr r0, [r1] - ldrb r0, [r0, 0x3] - bl sub_819E608 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_819E694 - - thumb_func_start sub_819E6E8 -sub_819E6E8: @ 819E6E8 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x5 - bl PlaySE - lsls r4, 24 - cmp r4, 0 - ble _0819E728 - ldr r0, =gUnknown_03001284 - ldr r2, [r0] - ldrb r1, [r2, 0x3] - adds r4, r0, 0 - cmp r1, 0x2 - bhi _0819E714 - movs r0, 0x3 - strb r0, [r2, 0x3] - b _0819E74A - .pool -_0819E714: - ldrb r0, [r2, 0x3] - adds r0, 0x1 - ldrb r1, [r2, 0x17] - cmp r0, r1 - beq _0819E722 - strb r0, [r2, 0x3] - b _0819E74A -_0819E722: - movs r0, 0 - strb r0, [r2, 0x3] - b _0819E74A -_0819E728: - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldrb r3, [r1, 0x3] - adds r2, r3, 0 - adds r4, r0, 0 - cmp r2, 0x2 - bls _0819E744 - cmp r2, 0 - beq _0819E744 - subs r0, r3, 0x1 - b _0819E748 - .pool -_0819E744: - ldrb r0, [r1, 0x17] - subs r0, 0x1 -_0819E748: - strb r0, [r1, 0x3] -_0819E74A: - ldr r0, [r4] - ldrb r0, [r0, 0x3] - bl sub_819E608 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_819E6E8 - - thumb_func_start sub_819E758 -sub_819E758: @ 819E758 - push {lr} - lsls r0, 24 - cmp r0, 0 - ble _0819E778 - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldrb r3, [r1, 0x16] - adds r2, r0, 0 - cmp r3, 0x1 - beq _0819E774 - adds r0, r3, 0x1 - b _0819E78E - .pool -_0819E774: - movs r0, 0 - b _0819E78E -_0819E778: - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldrb r3, [r1, 0x16] - adds r2, r0, 0 - cmp r3, 0 - beq _0819E78C - subs r0, r3, 0x1 - b _0819E78E - .pool -_0819E78C: - movs r0, 0x1 -_0819E78E: - strb r0, [r1, 0x16] - ldr r3, =gSprites - ldr r2, [r2] - ldrb r0, [r2, 0x1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r0, [r2, 0x16] - lsls r0, 4 - adds r0, 0x70 - strh r0, [r1, 0x22] - ldrb r0, [r2, 0x2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r0, [r2, 0x16] - lsls r0, 4 - adds r0, 0x70 - strh r0, [r1, 0x22] - pop {r0} - bx r0 - .pool - thumb_func_end sub_819E758 - - thumb_func_start sub_819E7C0 -sub_819E7C0: @ 819E7C0 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x5 - bl PlaySE - lsls r4, 24 - cmp r4, 0 - ble _0819E7EC - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldrb r3, [r1] - adds r2, r0, 0 - cmp r3, 0x2 - beq _0819E7E8 - adds r0, r3, 0x1 - b _0819E802 - .pool -_0819E7E8: - movs r0, 0 - b _0819E802 -_0819E7EC: - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldrb r3, [r1] - adds r2, r0, 0 - cmp r3, 0 - beq _0819E800 - subs r0, r3, 0x1 - b _0819E802 - .pool -_0819E800: - movs r0, 0x2 -_0819E802: - strb r0, [r1] - ldr r3, =gSprites - ldr r2, [r2] - ldrb r0, [r2, 0x1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r0, [r2] - lsls r0, 4 - adds r0, 0x70 - strh r0, [r1, 0x22] - ldrb r0, [r2, 0x2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r0, [r2] - lsls r0, 4 - adds r0, 0x70 - strh r0, [r1, 0x22] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819E7C0 - - thumb_func_start sub_819E838 -sub_819E838: @ 819E838 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r6, r0, 24 - movs r4, 0 - movs r0, 0x5 - negs r0, r0 - mov r9, r0 - movs r2, 0x4 - mov r8, r2 - ldr r0, =gSprites - mov r12, r0 - ldr r7, =gUnknown_03001284 -_0819E856: - cmp r6, 0x2 - bne _0819E898 - ldr r5, =gSprites - ldr r3, =gUnknown_03001284 - ldr r0, [r3] - adds r0, 0xB - adds r0, r4 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - adds r1, 0x3E - ldrb r2, [r1] - mov r0, r9 - ands r0, r2 - strb r0, [r1] - cmp r4, 0x1 - bhi _0819E8D4 - ldr r0, [r3] - adds r0, 0x10 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - b _0819E8CA - .pool -_0819E898: - cmp r6, 0x3 - bne _0819E8D4 - cmp r4, 0x1 - bhi _0819E8BA - ldr r0, [r7] - adds r0, 0x10 - adds r0, r4 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r12 - adds r1, 0x3E - ldrb r2, [r1] - mov r0, r9 - ands r0, r2 - strb r0, [r1] -_0819E8BA: - ldr r0, [r7] - adds r0, 0xB - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r12 -_0819E8CA: - adds r0, 0x3E - ldrb r1, [r0] - mov r2, r8 - orrs r1, r2 - strb r1, [r0] -_0819E8D4: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _0819E856 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_819E838 - - thumb_func_start sub_819E8EC -sub_819E8EC: @ 819E8EC - push {r4-r6,lr} - movs r2, 0 - ldr r5, =gSprites - ldr r4, =gUnknown_03001284 - adds r6, r5, 0 - movs r3, 0x4 -_0819E8F8: - ldr r0, [r4] - adds r0, 0xB - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r3 - strb r1, [r0] - cmp r2, 0x1 - bhi _0819E92C - ldr r0, [r4] - adds r0, 0x10 - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r3 - strb r1, [r0] -_0819E92C: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x2 - bls _0819E8F8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819E8EC - - thumb_func_start sub_819E944 -sub_819E944: @ 819E944 - push {r4,r5,lr} - ldr r0, =gUnknown_03001284 - ldr r3, [r0] - ldrb r1, [r3, 0x15] - adds r5, r0, 0 - cmp r1, 0x1 - bne _0819E95C - movs r0, 0 - strb r0, [r3, 0x15] - b _0819E960 - .pool -_0819E95C: - movs r0, 0 - strb r0, [r3] -_0819E960: - ldr r4, =gSprites - ldr r2, [r5] - ldrb r1, [r2, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xB0 - strh r1, [r0, 0x20] - ldrb r0, [r2, 0x1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r0, [r2] - lsls r0, 4 - adds r0, 0x70 - strh r0, [r1, 0x22] - ldrb r1, [r2, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xD0 - strh r1, [r0, 0x20] - ldrb r0, [r2, 0x2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r0, [r2] - lsls r0, 4 - adds r0, 0x70 - strh r0, [r1, 0x22] - ldrb r0, [r2, 0x1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - adds r1, 0x3E - ldrb r3, [r1] - movs r2, 0x5 - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - strb r0, [r1] - ldr r0, [r5] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - ands r2, r1 - strb r2, [r0] - bl sub_819EC20 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819E944 - - thumb_func_start sub_819E9E0 -sub_819E9E0: @ 819E9E0 - push {r4,r5,lr} - ldr r5, =gUnknown_03001284 - ldr r1, [r5] - movs r0, 0 - strb r0, [r1, 0x16] - ldr r4, =gSprites - ldr r2, [r5] - ldrb r1, [r2, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xB0 - strh r1, [r0, 0x20] - ldrb r1, [r2, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r3, 0x70 - strh r3, [r0, 0x22] - ldrb r1, [r2, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xD0 - strh r1, [r0, 0x20] - ldrb r1, [r2, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r3, [r0, 0x22] - ldrb r0, [r2, 0x1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - adds r1, 0x3E - ldrb r3, [r1] - movs r2, 0x5 - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - strb r0, [r1] - ldr r0, [r5] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - ands r2, r1 - strb r2, [r0] - bl sub_819EC94 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819E9E0 - - thumb_func_start sub_819EA64 -sub_819EA64: @ 819EA64 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =gSprites - ldr r3, =gUnknown_03001284 - ldr r0, [r3] - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldr r0, [r3] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - adds r0, r4, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r0, r4, 0 - movs r1, 0x2 - bl CopyWindowToVram - adds r0, r4, 0 - bl ClearWindowTilemap - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819EA64 - - thumb_func_start sub_819EAC0 -sub_819EAC0: @ 819EAC0 - push {lr} - movs r0, 0x1 - bl PutWindowTilemap - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x1 - movs r1, 0x2 - bl CopyWindowToVram - pop {r0} - bx r0 - thumb_func_end sub_819EAC0 - - thumb_func_start sub_819EADC -sub_819EADC: @ 819EADC - push {lr} - movs r0, 0x7 - bl PutWindowTilemap - movs r0, 0x7 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x7 - movs r1, 0x2 - bl CopyWindowToVram - pop {r0} - bx r0 - thumb_func_end sub_819EADC - - thumb_func_start sub_819EAF8 -sub_819EAF8: @ 819EAF8 - push {lr} - bl sub_819EAC0 - movs r0, 0x5 - bl PutWindowTilemap - movs r0, 0x5 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x5 - movs r1, 0x2 - bl CopyWindowToVram - pop {r0} - bx r0 - thumb_func_end sub_819EAF8 - - thumb_func_start sub_819EB18 -sub_819EB18: @ 819EB18 - push {lr} - sub sp, 0xC - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r2, =gUnknown_085EEC66 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x2 - bl Print - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_819EB18 - - thumb_func_start sub_819EB4C -sub_819EB4C: @ 819EB4C - push {r4,lr} - sub sp, 0xC - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldrb r0, [r1, 0x3] - cmp r0, 0x2 - bls _0819EB70 - movs r0, 0x1 - movs r1, 0x2 - bl CopyWindowToVram - b _0819EBD4 - .pool -_0819EB70: - ldrb r2, [r1, 0x3] - ldrb r0, [r1, 0x14] - cmp r0, 0 - bne _0819EB84 - movs r0, 0x64 - muls r0, r2 - ldr r1, =gPlayerParty - b _0819EB8A - .pool -_0819EB84: - movs r0, 0x64 - muls r0, r2 - ldr r1, =gEnemyParty -_0819EB8A: - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl GetMonData - lsls r0, 16 - lsrs r1, r0, 16 - ldr r4, =gStringVar4 - movs r0, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - adds r0, r4, 0 - bl StringCopy - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x56 - bl GetStringRightAlignXOffset - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gUnknown_08610925 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r3, 0x1 - bl box_print - movs r0, 0x1 - movs r1, 0x3 - bl CopyWindowToVram -_0819EBD4: - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819EB4C - - thumb_func_start sub_819EBEC -sub_819EBEC: @ 819EBEC - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - movs r0, 0x2 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x5 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0x2 - bl Print - movs r0, 0x2 - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_819EBEC - - thumb_func_start sub_819EC20 -sub_819EC20: @ 819EC20 - push {r4,r5,lr} - sub sp, 0xC - movs r0, 0x3 - bl PutWindowTilemap - movs r0, 0x3 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r5, =gUnknown_08610922 - str r5, [sp] - movs r4, 0 - str r4, [sp, 0x4] - ldr r0, =gUnknown_085EECAA - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0xF - movs r3, 0x1 - bl box_print - str r5, [sp] - str r4, [sp, 0x4] - ldr r0, =gUnknown_085EECA5 - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0xF - movs r3, 0x11 - bl box_print - str r5, [sp] - str r4, [sp, 0x4] - ldr r0, =gUnknown_085EECB2 - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0xF - movs r3, 0x21 - bl box_print - movs r0, 0x3 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819EC20 - - thumb_func_start sub_819EC94 -sub_819EC94: @ 819EC94 - push {r4,r5,lr} - sub sp, 0xC - movs r0, 0x4 - bl PutWindowTilemap - movs r0, 0x4 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r5, =gUnknown_08610922 - str r5, [sp] - movs r4, 0 - str r4, [sp, 0x4] - ldr r0, =gUnknown_085EECCA - str r0, [sp, 0x8] - movs r0, 0x4 - movs r1, 0x1 - movs r2, 0x7 - movs r3, 0x1 - bl box_print - str r5, [sp] - str r4, [sp, 0x4] - ldr r0, =gUnknown_085EECCE - str r0, [sp, 0x8] - movs r0, 0x4 - movs r1, 0x1 - movs r2, 0x7 - movs r3, 0x11 - bl box_print - movs r0, 0x4 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819EC94 - - thumb_func_start sub_819ECF0 -sub_819ECF0: @ 819ECF0 - push {r4-r6,lr} - sub sp, 0xC - adds r6, r0, 0 - adds r5, r1, 0 - adds r4, r2, 0 - movs r0, 0 - adds r1, r6, 0 - movs r2, 0x46 - bl GetStringRightAlignXOffset - adds r2, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_08610922 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r6, [sp, 0x8] - adds r0, r4, 0 - movs r1, 0 - adds r3, r5, 0 - bl box_print - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819ECF0 - - thumb_func_start sub_819ED34 -sub_819ED34: @ 819ED34 - push {lr} - movs r0, 0x5 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - ldrb r0, [r0, 0x14] - cmp r0, 0 - beq _0819ED56 - cmp r0, 0x1 - bne _0819ED60 - ldr r0, =gUnknown_085EECD1 - movs r1, 0 - movs r2, 0x5 - bl sub_819ECF0 -_0819ED56: - ldr r0, =gUnknown_085EECDD - movs r1, 0x18 - movs r2, 0x5 - bl sub_819ECF0 -_0819ED60: - movs r0, 0x5 - movs r1, 0x3 - bl CopyWindowToVram - pop {r0} - bx r0 - .pool - thumb_func_end sub_819ED34 - - thumb_func_start sub_819ED78 -sub_819ED78: @ 819ED78 - push {lr} - movs r0, 0x3 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - ldrb r0, [r0, 0x14] - cmp r0, 0 - beq _0819ED9A - cmp r0, 0x1 - bne _0819EDA4 - ldr r0, =gUnknown_085EECD1 - movs r1, 0x8 - movs r2, 0x3 - bl sub_819ECF0 -_0819ED9A: - ldr r0, =gUnknown_085EECDD - movs r1, 0x20 - movs r2, 0x3 - bl sub_819ECF0 -_0819EDA4: - movs r0, 0x3 - movs r1, 0x3 - bl CopyWindowToVram - pop {r0} - bx r0 - .pool - thumb_func_end sub_819ED78 - - thumb_func_start sub_819EDBC -sub_819EDBC: @ 819EDBC - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _0819EDCC - cmp r0, 0x1 - beq _0819EDEC - b _0819EDF6 -_0819EDCC: - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - ldrb r0, [r0, 0x14] - cmp r0, 0x1 - bne _0819EDF6 - ldr r0, =gUnknown_085EECD1 - movs r1, 0x8 - movs r2, 0x3 - bl sub_819ECF0 - b _0819EDF6 - .pool -_0819EDEC: - ldr r0, =gUnknown_085EECDD - movs r1, 0x20 - movs r2, 0x3 - bl sub_819ECF0 -_0819EDF6: - movs r0, 0x3 - movs r1, 0x3 - bl CopyWindowToVram - pop {r0} - bx r0 - .pool - thumb_func_end sub_819EDBC - - thumb_func_start sub_819EE08 -sub_819EE08: @ 819EE08 - push {r4,lr} - sub sp, 0x18 - ldr r0, =gUnknown_08610918 - add r1, sp, 0xC - movs r2, 0x4 - bl CpuSet - ldr r0, =gUnknown_03001284 - ldr r2, [r0] - ldrb r0, [r2, 0x15] - cmp r0, 0 - bne _0819EE3C - add r0, sp, 0xC - ldr r1, =gPlttBufferFaded - movs r2, 0xE4 - lsls r2, 1 - adds r1, r2 - ldrh r1, [r1] - strh r1, [r0, 0x8] - b _0819EE42 - .pool -_0819EE3C: - add r1, sp, 0xC - ldrh r0, [r2, 0x24] - strh r0, [r1, 0x8] -_0819EE42: - add r0, sp, 0xC - movs r1, 0xF0 - movs r2, 0xA - bl LoadPalette - movs r0, 0x7 - bl PutWindowTilemap - movs r0, 0x7 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldrb r0, [r1, 0x3] - cmp r0, 0x2 - bls _0819EE74 - movs r0, 0x7 - movs r1, 0x3 - bl CopyWindowToVram - b _0819EED8 - .pool -_0819EE74: - ldrb r2, [r1, 0x3] - ldrb r0, [r1, 0x14] - cmp r0, 0 - bne _0819EE88 - movs r0, 0x64 - muls r0, r2 - ldr r1, =gPlayerParty - b _0819EE8E - .pool -_0819EE88: - movs r0, 0x64 - muls r0, r2 - ldr r1, =gEnemyParty -_0819EE8E: - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl GetMonData - lsls r0, 16 - lsrs r1, r0, 16 - ldr r4, =gStringVar4 - movs r0, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - adds r0, r4, 0 - bl StringCopy - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x56 - bl GetStringRightAlignXOffset - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gUnknown_08610925 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x7 - movs r1, 0x1 - movs r3, 0x1 - bl box_print - movs r0, 0x7 - movs r1, 0x3 - bl CopyWindowToVram -_0819EED8: - add sp, 0x18 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819EE08 - - thumb_func_start sub_819EEF0 -sub_819EEF0: @ 819EEF0 - push {r4,lr} - sub sp, 0xC - ldr r0, =gUnknown_08610918 - movs r1, 0xE0 - movs r2, 0xA - bl LoadPalette - ldr r0, =gPlttBufferUnfaded+ 0x1E0 - ldr r1, =gPlttBufferFaded + 0x1C0 - movs r2, 0x5 - bl CpuSet - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldrb r0, [r1, 0x3] - cmp r0, 0x2 - bls _0819EF2C - movs r0, 0x1 - movs r1, 0x2 - bl CopyWindowToVram - b _0819EF90 - .pool -_0819EF2C: - ldrb r2, [r1, 0x3] - ldrb r0, [r1, 0x14] - cmp r0, 0 - bne _0819EF40 - movs r0, 0x64 - muls r0, r2 - ldr r1, =gPlayerParty - b _0819EF46 - .pool -_0819EF40: - movs r0, 0x64 - muls r0, r2 - ldr r1, =gEnemyParty -_0819EF46: - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl GetMonData - lsls r0, 16 - lsrs r1, r0, 16 - ldr r4, =gStringVar4 - movs r0, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - adds r0, r4, 0 - bl StringCopy - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x56 - bl GetStringRightAlignXOffset - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gUnknown_08610925 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r3, 0x1 - bl box_print - movs r0, 0x1 - movs r1, 0x3 - bl CopyWindowToVram -_0819EF90: - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819EEF0 - - thumb_func_start sub_819EFA8 -sub_819EFA8: @ 819EFA8 - push {r4-r6,lr} - sub sp, 0x2C - ldr r6, =gUnknown_03001284 - ldr r0, [r6] - ldrb r4, [r0, 0x3] - adds r5, r4, 0 - movs r0, 0x8 - movs r1, 0 - bl FillWindowPixelBuffer - cmp r4, 0x2 - bls _0819EFD0 - movs r0, 0x8 - movs r1, 0x2 - bl CopyWindowToVram - b _0819F03A - .pool -_0819EFD0: - movs r0, 0x8 - bl PutWindowTilemap - ldr r0, [r6] - ldrb r0, [r0, 0x14] - cmp r0, 0 - bne _0819EFEC - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - b _0819EFF2 - .pool -_0819EFEC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty -_0819EFF2: - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - add r1, sp, 0xC - bl sub_81DB468 - movs r0, 0x1 - add r1, sp, 0xC - movs r2, 0x76 - bl GetStringRightAlignXOffset - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x8 - movs r1, 0x1 - add r2, sp, 0xC - bl Print - movs r0, 0x8 - movs r1, 0x2 - bl CopyWindowToVram -_0819F03A: - add sp, 0x2C - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819EFA8 - - thumb_func_start sub_819F048 -sub_819F048: @ 819F048 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r4, =gUnknown_03001284 - ldr r3, [r4] - ldrb r0, [r3, 0x15] - cmp r0, 0x1 - beq _0819F094 - cmp r2, 0 - beq _0819F068 - cmp r2, 0x1 - beq _0819F080 - b _0819F094 - .pool -_0819F068: - strb r2, [r3, 0x14] - ldr r0, [r4] - strb r2, [r0, 0x3] - ldr r1, [r4] - movs r0, 0x4 - strb r0, [r1, 0x17] - ldr r1, [r4] - ldr r0, =gUnknown_08610928 - b _0819F092 - .pool -_0819F080: - movs r1, 0 - strb r2, [r3, 0x14] - ldr r0, [r4] - strb r1, [r0, 0x3] - ldr r1, [r4] - movs r0, 0x5 - strb r0, [r1, 0x17] - ldr r1, [r4] - ldr r0, =gUnknown_08610948 -_0819F092: - str r0, [r1, 0x18] -_0819F094: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F048 - - thumb_func_start sub_819F0A0 -sub_819F0A0: @ 819F0A0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r3, =gUnknown_03001280 - ldr r2, =gUnknown_086108AC - ldr r1, =gUnknown_03001284 - ldr r1, [r1] - ldrb r1, [r1] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - str r1, [r3] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F0A0 - - thumb_func_start sub_819F0CC -sub_819F0CC: @ 819F0CC - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =gUnknown_03001284 - ldr r1, [r5] - ldr r0, [r1, 0x2C] - adds r1, 0x30 - movs r2, 0x1 - bl sub_819F3F8 - ldr r0, [r5] - ldrb r1, [r0, 0x3] - movs r5, 0 - strb r1, [r0, 0x12] - movs r0, 0x3 - bl sub_819EA64 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - strh r5, [r0, 0x8] - ldr r1, =sub_819D9EC - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F0CC - - thumb_func_start sub_819F114 -sub_819F114: @ 819F114 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0x6 - strh r0, [r1, 0x8] - ldr r0, =sub_819C90C - str r0, [r1] - bx lr - .pool - thumb_func_end sub_819F114 - - thumb_func_start sub_819F134 -sub_819F134: @ 819F134 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldr r0, [r1, 0x2C] - adds r1, 0x30 - movs r2, 0x1 - bl sub_819F3F8 - movs r0, 0x3 - bl sub_819EA64 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x8] - ldr r2, =sub_819CE40 - lsrs r1, r2, 16 - strh r1, [r0, 0x14] - strh r2, [r0, 0x16] - movs r1, 0x1 - strh r1, [r0, 0x12] - ldr r1, =sub_819D770 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F134 - - thumb_func_start sub_819F184 -sub_819F184: @ 819F184 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r3, =gUnknown_03001280 - ldr r1, =gUnknown_03001284 - ldr r2, [r1] - ldrb r1, [r2, 0x3] - ldr r2, [r2, 0x18] - lsls r1, 3 - adds r1, r2 - ldr r1, [r1, 0x4] - str r1, [r3] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F184 - - thumb_func_start sub_819F1AC -sub_819F1AC: @ 819F1AC - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r2, =sub_819CC24 - lsrs r0, r2, 16 - movs r3, 0 - strh r0, [r1, 0x14] - strh r2, [r1, 0x16] - strh r3, [r1, 0x8] - strh r3, [r1, 0x12] - ldr r0, =sub_819D588 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_819F1AC - - thumb_func_start sub_819F1DC -sub_819F1DC: @ 819F1DC - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r2, =sub_819D9EC - lsrs r0, r2, 16 - movs r3, 0 - strh r0, [r1, 0x14] - strh r2, [r1, 0x16] - strh r3, [r1, 0x12] - strh r3, [r1, 0x8] - ldr r0, =sub_819D588 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_819F1DC - - thumb_func_start sub_819F20C -sub_819F20C: @ 819F20C - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r5, =gUnknown_03001284 - ldr r1, [r5] - ldrb r0, [r1, 0x14] - cmp r0, 0 - bne _0819F240 - ldr r3, =gTasks - lsls r4, r6, 2 - adds r0, r4, r6 - lsls r0, 3 - adds r0, r3 - ldr r2, =sub_819CD34 - lsrs r1, r2, 16 - strh r1, [r0, 0x14] - strh r2, [r0, 0x16] - movs r1, 0x2 - strh r1, [r0, 0x12] - b _0819F292 - .pool -_0819F240: - ldrb r0, [r1, 0x3] - bl sub_819F59C - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bne _0819F278 - ldr r1, [r5] - adds r0, r1, 0 - adds r0, 0x2D - adds r1, 0x30 - movs r2, 0x1 - bl sub_819F2B4 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x8] - strh r4, [r0, 0x12] - ldr r1, =sub_819F488 - b _0819F29E - .pool -_0819F278: - ldr r4, =gTasks - lsls r5, r6, 2 - adds r0, r5, r6 - lsls r0, 3 - adds r0, r4 - ldr r2, =sub_819CCD4 - lsrs r1, r2, 16 - movs r3, 0 - strh r1, [r0, 0x14] - strh r2, [r0, 0x16] - strh r3, [r0, 0x12] - adds r3, r4, 0 - adds r4, r5, 0 -_0819F292: - adds r0, r4, r6 - lsls r0, 3 - adds r0, r3 - movs r1, 0 - strh r1, [r0, 0x8] - ldr r1, =sub_819D588 -_0819F29E: - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F20C - - thumb_func_start sub_819F2B4 -sub_819F2B4: @ 819F2B4 - push {r4-r6,lr} - adds r4, r0, 0 - adds r6, r1, 0 - lsls r5, r2, 24 - lsrs r5, 24 - ldr r0, =gUnknown_08610894 - movs r1, 0x78 - movs r2, 0x40 - movs r3, 0x1 - bl CreateSprite - strb r0, [r4] - ldr r2, =gSprites - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r2, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_819F600 - str r1, [r0] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r5, [r0, 0x3C] - movs r0, 0x1 - strb r0, [r6] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F2B4 - - thumb_func_start sub_819F304 -sub_819F304: @ 819F304 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - sub sp, 0x10 - ldr r0, =gUnknown_08610894 - movs r1, 0x78 - movs r2, 0x40 - movs r3, 0x1 - bl CreateSprite - ldr r6, =gUnknown_03001284 - ldr r1, [r6] - adds r1, 0x2D - movs r2, 0 - mov r10, r2 - strb r0, [r1] - ldr r0, [r6] - adds r0, 0x2D - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - mov r8, r1 - add r0, r8 - movs r1, 0x2 - bl StartSpriteAffineAnim - ldr r0, [r6] - ldrb r1, [r0, 0x3] - movs r0, 0x64 - adds r4, r1, 0 - muls r4, r0 - ldr r0, =gPlayerParty - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl GetMonData - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - bl GetMonData - mov r9, r0 - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0 - bl GetMonData - adds r2, r0, 0 - movs r0, 0x58 - str r0, [sp] - movs r0, 0x20 - str r0, [sp, 0x4] - movs r0, 0xF - str r0, [sp, 0x8] - ldr r0, =0x0000ffff - str r0, [sp, 0xC] - adds r0, r5, 0 - mov r1, r9 - movs r3, 0x1 - bl sub_818D7D8 - ldr r1, [r6] - adds r1, 0x2C - strb r0, [r1] - ldr r0, [r6] - adds r0, 0x2C - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - adds r0, 0x28 - mov r2, r10 - strb r2, [r0] - ldr r0, [r6] - adds r0, 0x2C - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - adds r0, 0x29 - strb r2, [r0] - ldr r0, [r6] - adds r0, 0x2D - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F304 - - thumb_func_start sub_819F3F8 -sub_819F3F8: @ 819F3F8 - push {r4-r6,lr} - adds r4, r0, 0 - adds r6, r1, 0 - lsls r5, r2, 24 - lsrs r5, 24 - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_818D820 - ldr r0, =sub_819F7B4 - movs r1, 0x1 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r5, [r1, 0x16] - lsrs r4, 8 - lsls r4, 24 - lsrs r4, 24 - strh r4, [r1, 0x14] - ldr r1, [r1] - bl _call_via_r1 - movs r0, 0x1 - strb r0, [r6] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F3F8 - - thumb_func_start sub_819F444 -sub_819F444: @ 819F444 - push {r4-r6,lr} - adds r4, r0, 0 - adds r6, r1, 0 - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_818D820 - ldr r5, =gSprites - lsls r4, 16 - lsrs r1, r4, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrb r0, [r0, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl FreeOamMatrix - lsrs r4, 24 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r5 - bl DestroySprite - movs r0, 0 - strb r0, [r6] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F444 - - thumb_func_start sub_819F488 -sub_819F488: @ 819F488 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_03001284 - ldr r0, [r1] - adds r0, 0x30 - ldrb r0, [r0] - adds r3, r1, 0 - cmp r0, 0x1 - beq _0819F58A - ldr r2, =gTasks - lsls r1, r4, 2 - adds r0, r1, r4 - lsls r0, 3 - adds r0, r2 - movs r2, 0x8 - ldrsh r0, [r0, r2] - adds r5, r1, 0 - cmp r0, 0x4 - bhi _0819F58A - lsls r0, 2 - ldr r1, =_0819F4C8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0819F4C8: - .4byte _0819F4DC - .4byte _0819F4F8 - .4byte _0819F52C - .4byte _0819F548 - .4byte _0819F568 -_0819F4DC: - ldr r0, =gUnknown_085EED0A - bl sub_819EBEC - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r0, 0x20 - movs r1, 0 - strb r1, [r0] - b _0819F54E - .pool -_0819F4F8: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0819F50C - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0819F58A -_0819F50C: - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldr r0, [r1, 0x2C] - adds r1, 0x30 - movs r2, 0x1 - bl sub_819F3F8 - b _0819F54E - .pool -_0819F52C: - ldr r0, [r3] - adds r0, 0x30 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0819F58A - movs r0, 0x5 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x5 - movs r1, 0x2 - bl CopyWindowToVram - b _0819F54E -_0819F548: - ldr r0, =gUnknown_085EEC8B - bl sub_819EBEC -_0819F54E: - ldr r0, =gTasks - adds r1, r5, r4 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0819F58A - .pool -_0819F568: - bl sub_819EEF0 - bl sub_819EADC - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r0, 0x22 - movs r1, 0x1 - strb r1, [r0] - ldr r1, =gTasks - adds r0, r5, r4 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x12] - strh r1, [r0, 0x8] - ldr r1, =sub_819CE40 - str r1, [r0] -_0819F58A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F488 - - thumb_func_start sub_819F59C -sub_819F59C: @ 819F59C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r0, r1 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl GetMonData - lsls r0, 16 - lsrs r5, r0, 16 - movs r4, 0 -_0819F5B8: - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - ldrb r0, [r0, 0x12] - cmp r4, r0 - beq _0819F5EC - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - cmp r0, r5 - bne _0819F5EC - movs r0, 0x1 - b _0819F5F8 - .pool -_0819F5EC: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _0819F5B8 - movs r0, 0 -_0819F5F8: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_819F59C - - thumb_func_start sub_819F600 -sub_819F600: @ 819F600 - push {r4,lr} - adds r4, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0819F640 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_819F69C - movs r1, 0x1 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldrh r2, [r4, 0x3C] - strh r2, [r1, 0x16] - ldr r1, [r1] - bl _call_via_r1 - ldr r0, =SpriteCallbackDummy - str r0, [r4, 0x1C] -_0819F640: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F600 - - thumb_func_start sub_819F654 -sub_819F654: @ 819F654 - push {r4,lr} - adds r4, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0819F694 - ldrb r0, [r4, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl FreeOamMatrix - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0x1 - bne _0819F688 - ldr r0, =gUnknown_03001284 - ldr r0, [r0] - adds r0, 0x30 - movs r1, 0 - strb r1, [r0] - b _0819F68E - .pool -_0819F688: - movs r0, 0 - bl sub_819BE20 -_0819F68E: - adds r0, r4, 0 - bl DestroySprite -_0819F694: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_819F654 - - thumb_func_start sub_819F69C -sub_819F69C: @ 819F69C - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _0819F71A - cmp r0, 0x1 - bgt _0819F6C4 - cmp r0, 0 - beq _0819F6CA - b _0819F77C - .pool -_0819F6C4: - cmp r0, 0x2 - beq _0819F73C - b _0819F77C -_0819F6CA: - movs r0, 0x58 - strh r0, [r4, 0xE] - movs r0, 0x98 - strh r0, [r4, 0x38] - movs r0, 0x40 - strh r0, [r4, 0x12] - movs r0, 0x41 - strh r0, [r4, 0x18] - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - bl SetGpuRegBits - ldrh r1, [r4, 0xE] - lsls r1, 8 - ldrh r0, [r4, 0x38] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x40 - bl SetGpuReg - ldrh r1, [r4, 0x12] - lsls r1, 8 - ldrh r0, [r4, 0x18] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x44 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0x3F - bl SetGpuReg - movs r0, 0x4A - movs r1, 0x37 - bl SetGpuReg - b _0819F7A6 -_0819F71A: - movs r0, 0x3 - bl ShowBg - ldr r1, =0x00001248 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x0000040b - movs r0, 0x52 - bl SetGpuReg - b _0819F7A6 - .pool -_0819F73C: - ldrh r0, [r4, 0x12] - subs r0, 0x4 - strh r0, [r4, 0x12] - ldrh r1, [r4, 0x18] - adds r1, 0x4 - strh r1, [r4, 0x18] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x20 - ble _0819F758 - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0x5F - ble _0819F760 -_0819F758: - movs r0, 0x20 - strh r0, [r4, 0x12] - movs r0, 0x60 - strh r0, [r4, 0x18] -_0819F760: - ldrh r1, [r4, 0x12] - lsls r1, 8 - ldrh r0, [r4, 0x18] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x44 - bl SetGpuReg - movs r2, 0x12 - ldrsh r0, [r4, r2] - cmp r0, 0x20 - bne _0819F7AC - b _0819F7A6 -_0819F77C: - adds r0, r5, 0 - bl DestroyTask - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - movs r2, 0x16 - ldrsh r0, [r1, r2] - cmp r0, 0x1 - bne _0819F7A0 - bl sub_819F8E0 - b _0819F7AC - .pool -_0819F7A0: - bl sub_819BD70 - b _0819F7AC -_0819F7A6: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_0819F7AC: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_819F69C - - thumb_func_start sub_819F7B4 -sub_819F7B4: @ 819F7B4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0819F844 - cmp r0, 0x1 - beq _0819F894 - movs r0, 0x3 - bl HideBg - ldr r3, =gSprites - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r4, 0x16] - strh r1, [r0, 0x3C] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r3, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_819F654 - str r1, [r0] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r1, 0x1 - bl StartSpriteAffineAnim - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - bl ClearGpuRegBits - adds r0, r5, 0 - bl DestroyTask - b _0819F8D8 - .pool -_0819F844: - movs r0, 0x58 - strh r0, [r4, 0xE] - movs r0, 0x98 - strh r0, [r4, 0x38] - movs r0, 0x20 - strh r0, [r4, 0x12] - movs r0, 0x60 - strh r0, [r4, 0x18] - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - bl SetGpuRegBits - ldrh r1, [r4, 0xE] - lsls r1, 8 - ldrh r0, [r4, 0x38] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x40 - bl SetGpuReg - ldrh r1, [r4, 0x12] - lsls r1, 8 - ldrh r0, [r4, 0x18] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x44 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0x3F - bl SetGpuReg - movs r0, 0x4A - movs r1, 0x37 - bl SetGpuReg - b _0819F8D2 -_0819F894: - ldrh r0, [r4, 0x12] - adds r0, 0x4 - strh r0, [r4, 0x12] - ldrh r1, [r4, 0x18] - subs r1, 0x4 - strh r1, [r4, 0x18] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3F - bgt _0819F8B0 - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0x41 - bgt _0819F8B8 -_0819F8B0: - movs r0, 0x40 - strh r0, [r4, 0x12] - movs r0, 0x41 - strh r0, [r4, 0x18] -_0819F8B8: - ldrh r1, [r4, 0x12] - lsls r1, 8 - ldrh r0, [r4, 0x18] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x44 - bl SetGpuReg - movs r1, 0x12 - ldrsh r0, [r4, r1] - cmp r0, 0x40 - bne _0819F8D8 -_0819F8D2: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_0819F8D8: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_819F7B4 - - thumb_func_start sub_819F8E0 -sub_819F8E0: @ 819F8E0 - push {r4-r6,lr} - sub sp, 0x10 - ldr r0, =gUnknown_03001284 - ldr r1, [r0] - ldrb r0, [r1, 0x14] - cmp r0, 0 - bne _0819F900 - ldrb r1, [r1, 0x3] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - b _0819F908 - .pool -_0819F900: - ldrb r1, [r1, 0x3] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gEnemyParty -_0819F908: - adds r6, r1, r0 - adds r0, r6, 0 - movs r1, 0xB - movs r2, 0 - bl GetMonData - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r6, 0 - movs r1, 0 - movs r2, 0 - bl GetMonData - adds r5, r0, 0 - adds r0, r6, 0 - movs r1, 0x1 - movs r2, 0 - bl GetMonData - adds r1, r0, 0 - movs r0, 0x58 - str r0, [sp] - movs r0, 0x20 - str r0, [sp, 0x4] - movs r0, 0xF - str r0, [sp, 0x8] - ldr r0, =0x0000ffff - str r0, [sp, 0xC] - adds r0, r4, 0 - adds r2, r5, 0 - movs r3, 0x1 - bl sub_818D7D8 - ldr r2, =gUnknown_03001284 - ldr r1, [r2] - adds r1, 0x2C - movs r3, 0 - strb r0, [r1] - ldr r4, =gSprites - ldr r0, [r2] - adds r0, 0x2C - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x28 - strb r3, [r0] - ldr r0, [r2] - adds r0, 0x2C - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x29 - strb r3, [r0] - ldr r0, [r2] - adds r0, 0x30 - strb r3, [r0] - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F8E0 - - thumb_func_start sub_819F99C -sub_819F99C: @ 819F99C - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r2, =gSaveBlock2Ptr - ldr r1, [r2] - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - adds r1, r0 - adds r1, 0xDE - ldrb r1, [r1] - movs r6, 0 - adds r7, r2, 0 - ldr r0, =gStringVar1 - mov r8, r0 - cmp r1, 0 - beq _0819F9DC -_0819F9C2: - adds r0, r1, 0 - movs r1, 0xA - bl __udivsi3 - lsls r0, 24 - lsrs r1, r0, 24 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r1, 0 - beq _0819F9DC - cmp r6, 0x3 - bls _0819F9C2 -_0819F9DC: - lsls r4, r5, 4 - adds r4, r5 - lsls r4, 2 - ldr r1, [r7] - adds r1, r4, r1 - movs r0, 0x8A - lsls r0, 1 - adds r1, r0 - mov r0, r8 - bl StringCopy7 - ldr r0, [r7] - adds r0, r4 - ldr r1, =0x0000011b - adds r0, r1 - ldrb r1, [r0] - mov r0, r8 - bl ConvertInternationalString - ldr r0, =gStringVar2 - ldr r1, [r7] - adds r1, r4 - adds r1, 0xDE - ldrb r1, [r1] - movs r2, 0x1 - adds r3, r6, 0 - bl ConvertIntToDecimalStringN - ldr r1, =gUnknown_08611330 - ldr r0, [r7] - adds r0, r4 - adds r0, 0xDC - ldrb r0, [r0] - lsls r0, 27 - lsrs r0, 25 - adds r0, r1 - ldr r1, [r0] - ldr r0, =gStringVar4 - bl StringExpandPlaceholders - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819F99C - - thumb_func_start sub_819FA50 -sub_819FA50: @ 819FA50 - push {lr} - bl script_env_2_enable_and_set_ctx_running - pop {r0} - bx r0 - thumb_func_end sub_819FA50 - - thumb_func_start sub_819FA5C -sub_819FA5C: @ 819FA5C - push {r4,r5,lr} - adds r3, r0, 0 - movs r2, 0 - adds r4, r3, 0 - adds r4, 0x28 - ldr r0, =0x0000ffff - adds r5, r0, 0 -_0819FA6A: - lsls r0, r2, 1 - adds r0, r4, r0 - ldrh r1, [r0] - orrs r1, r5 - strh r1, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x5 - bls _0819FA6A - adds r1, r3, 0 - adds r1, 0x38 - movs r0, 0xFF - strb r0, [r1] - ldrb r1, [r3] - movs r0, 0x20 - negs r0, r0 - ands r0, r1 - movs r1, 0x10 - orrs r0, r1 - strb r0, [r3] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819FA5C - - thumb_func_start sub_819FAA0 -sub_819FAA0: @ 819FAA0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r3, =gSaveBlock2Ptr - ldr r1, [r3] - adds r1, 0xB2 - ldrb r2, [r1] - movs r0, 0x19 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - movs r0, 0 - mov r12, r0 - adds r5, r3, 0 - mov r8, r0 - ldr r1, =0x0000ffff - mov r10, r1 -_0819FAC6: - movs r2, 0 - mov r3, r12 - lsls r7, r3, 4 - movs r4, 0x1 - add r4, r12 - mov r9, r4 - adds r0, r7, r3 - lsls r3, r0, 2 -_0819FAD6: - ldr r1, [r5] - lsls r0, r2, 1 - adds r0, r3 - movs r4, 0x82 - lsls r4, 1 - adds r1, r4 - adds r1, r0 - ldrh r0, [r1] - mov r4, r10 - orrs r0, r4 - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x5 - bls _0819FAD6 - ldr r2, [r5] - mov r0, r12 - adds r3, r7, r0 - lsls r3, 2 - adds r2, r3 - adds r2, 0xDC - ldrb r1, [r2] - movs r0, 0x20 - negs r0, r0 - ands r0, r1 - movs r1, 0x10 - orrs r0, r1 - strb r0, [r2] - ldr r0, [r5] - adds r0, r3 - movs r1, 0x8A - lsls r1, 1 - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldr r1, [r5] - adds r1, r3 - adds r1, 0xDC - ldrb r2, [r1] - movs r0, 0x61 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r0, [r5] - adds r0, r3 - adds r0, 0xDE - mov r4, r8 - strb r4, [r0] - ldr r0, [r5] - adds r0, r3 - adds r0, 0xDD - strb r4, [r0] - movs r2, 0 - ldr r6, =gSaveBlock2Ptr - movs r4, 0x88 - lsls r4, 1 -_0819FB48: - ldr r0, [r6] - adds r1, r2, r3 - adds r0, r4 - adds r0, r1 - mov r1, r8 - strb r1, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x3 - bls _0819FB48 - ldr r0, [r5] - mov r3, r12 - adds r2, r7, r3 - lsls r2, 2 - adds r0, r2 - ldr r4, =gGameLanguage - ldrb r1, [r4] - ldr r3, =0x0000011b - adds r0, r3 - strb r1, [r0] - ldr r0, [r5] - movs r4, 0x8E - lsls r4, 1 - adds r0, r4 - adds r0, r2 - mov r1, r8 - str r1, [r0] - mov r3, r9 - lsls r0, r3, 24 - lsrs r0, 24 - mov r12, r0 - cmp r0, 0x3 - bls _0819FAC6 - bl sub_81A087C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819FAA0 - - thumb_func_start sub_819FBB0 -sub_819FBB0: @ 819FBB0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB1 - ldrb r0, [r0] - movs r1, 0x3 - ands r1, r0 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - bx lr - .pool - thumb_func_end sub_819FBB0 - - thumb_func_start sub_819FBC8 -sub_819FBC8: @ 819FBC8 - push {r4,r5,lr} - ldr r2, =gSaveBlock2Ptr - ldr r0, [r2] - adds r0, 0xDE - ldrb r0, [r0] - cmp r0, 0 - bne _0819FC10 - adds r4, r2, 0 - ldr r5, =gUnknown_08611548 -_0819FBDA: - bl Random - ldr r2, [r4] - lsls r0, 16 - movs r1, 0xE0 - lsls r1, 11 - ands r1, r0 - lsrs r1, 16 - adds r1, r5 - ldrb r0, [r1] - adds r2, 0xB0 - strb r0, [r2] - ldr r0, [r4] - adds r1, r0, 0 - adds r1, 0xB0 - adds r0, 0xDC - ldrb r0, [r0] - lsls r0, 27 - ldrb r1, [r1] - lsrs r0, 27 - cmp r1, r0 - beq _0819FBDA - b _0819FC38 - .pool -_0819FC10: - adds r4, r2, 0 -_0819FC12: - bl Random - ldr r2, [r4] - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xF - ands r0, r1 - adds r2, 0xB0 - strb r0, [r2] - ldr r0, [r4] - adds r1, r0, 0 - adds r1, 0xB0 - adds r0, 0xDC - ldrb r0, [r0] - lsls r0, 27 - ldrb r1, [r1] - lsrs r0, 27 - cmp r1, r0 - beq _0819FC12 -_0819FC38: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_819FBC8 - - thumb_func_start sub_819FC40 -sub_819FC40: @ 819FC40 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gSaveBlock2Ptr - ldr r2, [r1] - adds r2, 0xB1 - movs r1, 0x3 - ands r0, r1 - ldrb r3, [r2] - subs r1, 0x7 - ands r1, r3 - orrs r1, r0 - strb r1, [r2] - bx lr - .pool - thumb_func_end sub_819FC40 - - thumb_func_start sub_819FC60 -sub_819FC60: @ 819FC60 - push {r4-r7,lr} - sub sp, 0xC - movs r5, 0 -_0819FC66: - mov r1, sp - adds r0, r1, r5 - strb r5, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x9 - bls _0819FC66 - movs r5, 0 -_0819FC78: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - mov r7, sp - adds r2, r7, r4 - ldrb r3, [r2] - adds r1, r7, r0 - ldrb r0, [r1] - strb r0, [r2] - strb r3, [r1] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x31 - bls _0819FC78 - movs r5, 0 - ldr r6, =gSaveBlock2Ptr - movs r4, 0xF -_0819FCBC: - ldr r3, [r6] - adds r3, 0xB4 - adds r3, r5 - lsls r2, r5, 1 - mov r1, sp - adds r0, r1, r2 - ldrb r0, [r0] - adds r1, r4, 0 - ands r1, r0 - lsls r1, 4 - adds r2, 0x1 - mov r7, sp - adds r0, r7, r2 - ldrb r2, [r0] - adds r0, r4, 0 - ands r0, r2 - orrs r1, r0 - strb r1, [r3] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bls _0819FCBC - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819FC60 - - thumb_func_start sub_819FCF8 -sub_819FCF8: @ 819FCF8 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - movs r5, 0 - cmp r0, 0x2 - bne _0819FD4C - ldr r6, =gUnknown_030062EC -_0819FD06: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 24 - lsrs r5, r0, 24 - movs r3, 0 - movs r2, 0 - ldr r1, [r6] - lsls r0, r5, 2 - adds r0, r5 - lsls r4, r0, 1 - adds r1, 0x2 -_0819FD26: - lsls r0, r2, 1 - adds r0, r4 - adds r0, r1, r0 - ldrh r0, [r0] - cmp r0, 0 - beq _0819FD38 - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 -_0819FD38: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x4 - bls _0819FD26 - cmp r3, 0x3 - bhi _0819FD06 - b _0819FD5A - .pool -_0819FD4C: - cmp r0, 0x1 - bne _0819FD5A - ldrb r0, [r2] - adds r1, r0 - ldrb r5, [r1] - adds r0, 0x1 - strb r0, [r2] -_0819FD5A: - adds r0, r5, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_819FCF8 - - thumb_func_start sub_819FD64 -sub_819FD64: @ 819FD64 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - movs r5, 0 - mov r0, sp - adds r0, 0xC - str r0, [sp, 0x14] - mov r1, sp - adds r1, 0x10 - str r1, [sp, 0x18] - adds r1, r0, 0 -_0819FD80: - adds r0, r1, r5 - strb r5, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bls _0819FD80 - movs r5, 0 - ldr r6, [sp, 0x14] -_0819FD92: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 24 - lsrs r4, r0, 24 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - adds r2, r6, r4 - ldrb r3, [r2] - adds r1, r6, r0 - ldrb r0, [r1] - strb r0, [r2] - strb r3, [r1] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x9 - bls _0819FD92 - movs r5, 0 - ldr r2, =gUnknown_086114D3 -_0819FDD0: - mov r4, sp - adds r1, r4, r5 - adds r0, r5, r2 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x9 - bls _0819FDD0 - movs r5, 0 -_0819FDE6: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 24 - lsrs r4, r0, 24 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - mov r6, sp - adds r2, r6, r4 - ldrb r3, [r2] - adds r1, r6, r0 - ldrb r0, [r1] - strb r0, [r2] - strb r3, [r1] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x31 - bls _0819FDE6 - ldr r4, =gUnknown_030062EC - movs r0, 0x30 - bl AllocZeroed - str r0, [r4] - movs r1, 0 - strb r1, [r0] - movs r5, 0 - movs r2, 0x4 -_0819FE34: - movs r3, 0 -_0819FE36: - ldr r0, [r4] - lsls r1, r3, 2 - adds r1, r3 - adds r1, r5, r1 - adds r0, 0x20 - adds r0, r1 - strb r2, [r0] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x2 - bls _0819FE36 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x4 - bls _0819FE34 - movs r0, 0 - ldr r7, [sp, 0x18] - strb r0, [r7] - movs r5, 0 -_0819FE60: - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - lsls r4, r5, 2 - adds r3, r4 - mov r1, sp - adds r6, r1, r5 - ldrb r0, [r6] - adds r3, 0xB8 - movs r2, 0x3 - ands r2, r0 - ldrb r0, [r3] - movs r7, 0x4 - negs r7, r7 - adds r1, r7, 0 - ands r0, r1 - orrs r0, r2 - strb r0, [r3] - ldrb r0, [r6] - adds r5, 0x1 - str r5, [sp, 0x1C] - mov r8, r4 - cmp r0, 0x3 - beq _0819FF62 - ldrb r0, [r6] - ldr r1, [sp, 0x14] - ldr r2, [sp, 0x18] - bl sub_819FCF8 - ldr r1, =gSaveBlock2Ptr - ldr r3, [r1] - add r3, r8 - adds r3, 0xB8 - movs r2, 0x3 - ands r2, r0 - lsls r2, 2 - ldrb r0, [r3] - movs r4, 0xD - negs r4, r4 - adds r1, r4, 0 - ands r0, r1 - orrs r0, r2 - strb r0, [r3] - ldr r7, =gSaveBlock2Ptr - ldr r0, [r7] - add r0, r8 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 28 - lsrs r7, r0, 30 - ldrb r0, [r6] - cmp r0, 0x2 - bne _0819FF62 - lsls r0, r7, 2 - adds r0, r7 - mov r10, r0 - ldr r0, =gUnknown_030062EC - mov r9, r0 -_0819FED2: - bl Random - lsls r0, 16 - lsrs r4, r0, 16 - movs r1, 0x3 - ands r4, r1 - movs r3, 0 - mov r6, r9 - ldr r2, [r6] - ldrb r0, [r2] - adds r1, r0, 0x1 - lsls r5, r7, 2 - cmp r3, r1 - bge _0819FF12 - adds r2, 0x20 - mov r6, r10 - adds r0, r2, r6 - ldrb r0, [r0] - cmp r0, r4 - beq _0819FF12 - adds r6, r1, 0 - adds r1, r5, r7 -_0819FEFE: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, r6 - bge _0819FF12 - adds r0, r3, r1 - adds r0, r2, r0 - ldrb r0, [r0] - cmp r0, r4 - bne _0819FEFE -_0819FF12: - mov r1, r9 - ldr r0, [r1] - ldrb r0, [r0] - adds r0, 0x1 - ldr r1, =gUnknown_030062EC - cmp r3, r0 - bne _0819FED2 - ldr r0, [r1] - orrs r5, r7 - ldrb r2, [r0] - adds r1, r5, r2 - adds r0, 0x20 - adds r0, r1 - strb r4, [r0] - ldr r6, =gSaveBlock2Ptr - ldr r2, [r6] - add r2, r8 - adds r2, 0xB8 - movs r7, 0x3 - ands r4, r7 - lsls r3, r4, 4 - ldrb r0, [r2] - movs r4, 0x31 - negs r4, r4 - adds r1, r4, 0 - ands r0, r1 - orrs r0, r3 - strb r0, [r2] - ldr r0, [r6] - add r0, r8 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 28 - lsrs r0, 30 - bl sub_819FF98 - ldr r1, [r6] - add r1, r8 - adds r1, 0xBA - strh r0, [r1] -_0819FF62: - ldr r6, [sp, 0x1C] - lsls r0, r6, 24 - lsrs r5, r0, 24 - cmp r5, 0x8 - bhi _0819FF6E - b _0819FE60 -_0819FF6E: - ldr r4, =gUnknown_030062EC - ldr r0, [r4] - bl Free - movs r0, 0 - str r0, [r4] - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819FD64 - - thumb_func_start sub_819FF98 -sub_819FF98: @ 819FF98 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0xC] - movs r7, 0 - ldr r1, [sp] - cmp r1, 0x2 - bhi _0819FFE0 - ldr r2, =gSaveBlock2Ptr - ldr r1, [r2] - adds r0, r1, 0 - adds r0, 0xB4 - ldr r3, [sp] - adds r0, r3 - ldrb r4, [r0] - adds r1, 0xB2 - ldrb r0, [r1] - lsls r0, 29 - lsrs r0, 29 - asrs r0, r3 - movs r1, 0x1 - ands r0, r1 - lsls r0, 2 - asrs r4, r0 - movs r0, 0xF - ands r4, r0 - b _0819FFE4 - .pool -_0819FFE0: - movs r4, 0 - ldr r2, =gSaveBlock2Ptr -_0819FFE4: - ldr r3, =gUnknown_08610970 - lsls r1, r4, 1 - ldr r4, [r2] - adds r0, r4, 0 - adds r0, 0xB0 - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r1, r0 - adds r3, 0x34 - adds r1, r3 - ldrh r1, [r1] - str r1, [sp, 0x8] - ldr r1, =gLevelUpLearnsetPointers - ldr r2, [sp, 0x8] - lsls r0, r2, 2 - adds r0, r1 - ldr r6, [r0] - movs r3, 0 - adds r4, 0xB1 - ldrb r1, [r4] - movs r0, 0x3 - ands r0, r1 - movs r5, 0x3C - cmp r0, 0x1 - bne _081A001A - movs r5, 0x32 -_081A001A: - ldrh r1, [r6] - ldr r4, =0x0000ffff - cmp r1, r4 - beq _081A004C - movs r2, 0xFE - lsls r2, 8 - adds r0, r2, 0 - ands r0, r1 - lsls r1, r5, 9 - cmp r0, r1 - bgt _081A004C - adds r5, r2, 0 - adds r2, r1, 0 -_081A0034: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - lsls r0, r3, 1 - adds r0, r6 - ldrh r1, [r0] - cmp r1, r4 - beq _081A004C - adds r0, r5, 0 - ands r0, r1 - cmp r0, r2 - ble _081A0034 -_081A004C: - adds r5, r3, 0 - movs r3, 0 - str r3, [sp, 0x4] -_081A0052: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081A0068 - ldr r0, [sp, 0xC] - cmp r0, 0x1 - bne _081A00E0 -_081A0068: - ldr r1, =0x000001ff - mov r8, r1 -_081A006C: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3A - bl __umodsi3 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, [sp, 0x8] - adds r1, r4, 0 - bl sub_806E064 - adds r2, r0, 0 - cmp r2, 0 - beq _081A006C - ldr r2, =0x00000121 - adds r0, r4, r2 - bl ItemIdToBattleMoveId - lsls r0, 16 - lsrs r7, r0, 16 - movs r2, 0x1 - cmp r5, 0x4 - bhi _081A00BC - movs r3, 0 - b _081A00C6 - .pool -_081A00BC: - subs r0, r5, 0x4 - b _081A00C2 -_081A00C0: - adds r0, r3, 0x1 -_081A00C2: - lsls r0, 24 - lsrs r3, r0, 24 -_081A00C6: - cmp r3, r5 - bcs _081A00DA - lsls r0, r3, 1 - adds r0, r6 - ldrh r0, [r0] - mov r1, r8 - ands r0, r1 - cmp r0, r7 - bne _081A00C0 - movs r2, 0 -_081A00DA: - cmp r2, 0x1 - bne _081A006C - b _081A0146 -_081A00E0: - cmp r5, 0x4 - bhi _081A00EA - movs r2, 0x1 - str r2, [sp, 0xC] - b _081A0168 -_081A00EA: - subs r4, r5, 0x4 - ldr r3, =0x000001ff - mov r10, r3 - mov r8, r3 - lsls r0, r4, 24 - mov r9, r0 -_081A00F6: - bl Random - lsls r0, 16 - lsrs r0, 16 - adds r1, r4, 0 - bl __modsi3 - lsls r0, 24 - lsrs r0, 23 - adds r0, r6 - ldrh r0, [r0] - mov r7, r8 - ands r7, r0 - movs r2, 0x1 - mov r1, r9 - lsrs r3, r1, 24 - cmp r3, r5 - bcs _081A0142 - lsls r0, r3, 1 - adds r0, r6 - ldrh r1, [r0] - mov r0, r8 - b _081A013A - .pool -_081A0128: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, r5 - bcs _081A0142 - lsls r0, r3, 1 - adds r0, r6 - ldrh r0, [r0] - mov r1, r10 -_081A013A: - ands r0, r1 - cmp r0, r7 - bne _081A0128 - movs r2, 0 -_081A0142: - cmp r2, 0x1 - bne _081A00F6 -_081A0146: - ldr r0, [sp] - adds r1, r7, 0 - bl sub_81A0194 - lsls r0, 24 - cmp r0, 0 - beq _081A0168 - ldr r0, =gUnknown_08611370 - adds r0, r7, r0 - ldrb r0, [r0] - cmp r0, 0 - bne _081A0170 - ldr r0, [sp, 0x4] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] -_081A0168: - ldr r2, [sp, 0x4] - cmp r2, 0x4 - bhi _081A0170 - b _081A0052 -_081A0170: - ldr r0, =gUnknown_030062EC - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - adds r0, r7, 0 - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_819FF98 - - thumb_func_start sub_81A0194 -sub_81A0194: @ 81A0194 - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 16 - lsrs r5, r1, 16 - movs r3, 0 - ldr r0, =gUnknown_030062EC - mov r12, r0 - ldr r2, [r0] - lsls r1, r4, 2 - adds r0, r1, r4 - lsls r6, r0, 1 - adds r2, 0x2 - adds r7, r1, 0 -_081A01B0: - lsls r0, r3, 1 - adds r0, r6 - adds r0, r2, r0 - ldrh r0, [r0] - cmp r0, r5 - bne _081A01C4 - movs r0, 0 - b _081A01E2 - .pool -_081A01C4: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x4 - bls _081A01B0 - mov r2, r12 - ldr r1, [r2] - adds r0, r7, r4 - ldrb r2, [r1] - adds r0, r2 - lsls r0, 1 - adds r1, 0x2 - adds r1, r0 - strh r5, [r1] - movs r0, 0x1 -_081A01E2: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81A0194 - - thumb_func_start sub_81A01E8 -sub_81A01E8: @ 81A01E8 - push {r4-r7,lr} - mov r12, r1 - lsls r0, 16 - lsrs r2, r0, 16 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB1 - ldrb r1, [r0] - movs r0, 0x3 - ands r0, r1 - movs r4, 0x3C - cmp r0, 0x1 - bne _081A0204 - movs r4, 0x32 -_081A0204: - ldr r1, =gLevelUpLearnsetPointers - lsls r0, r2, 2 - adds r0, r1 - ldr r6, [r0] - movs r5, 0 - ldrh r1, [r6] - ldr r3, =0x0000ffff - cmp r1, r3 - beq _081A0240 - movs r2, 0xFE - lsls r2, 8 - adds r0, r2, 0 - ands r0, r1 - lsls r1, r4, 9 - cmp r0, r1 - bgt _081A0240 - adds r4, r2, 0 - adds r2, r1, 0 -_081A0228: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 1 - adds r0, r6 - ldrh r1, [r0] - cmp r1, r3 - beq _081A0240 - adds r0, r4, 0 - ands r0, r1 - cmp r0, r2 - ble _081A0228 -_081A0240: - adds r4, r5, 0 - cmp r4, 0x4 - bls _081A0248 - movs r4, 0x4 -_081A0248: - movs r2, 0 - cmp r2, r4 - bcs _081A026C - ldr r7, =0x000001ff -_081A0250: - lsls r3, r2, 1 - add r3, r12 - adds r2, 0x1 - subs r0, r5, r2 - lsls r0, 1 - adds r0, r6 - ldrh r1, [r0] - adds r0, r7, 0 - ands r0, r1 - strh r0, [r3] - lsls r2, 24 - lsrs r2, 24 - cmp r2, r4 - bcc _081A0250 -_081A026C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A01E8 - - thumb_func_start sub_81A0284 -sub_81A0284: @ 81A0284 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 24 - lsrs r5, r2, 24 - ldr r1, =gSaveBlock2Ptr - ldr r2, [r1] - adds r0, r2, 0 - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - adds r7, r1, 0 - cmp r0, 0x2 - bhi _081A02B8 - movs r0, 0 - b _081A037C - .pool -_081A02B8: - movs r4, 0 - movs r3, 0 - adds r0, r2, 0 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 30 - ldr r1, =gUnknown_08610970 - mov r12, r1 - lsls r6, 1 - lsls r5, 1 - mov r9, r5 - cmp r0, 0 - beq _081A02F4 - adds r2, r7, 0 -_081A02D4: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x8 - bhi _081A02F4 - ldr r0, [r2] - lsls r1, r3, 2 - adds r0, r1 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 30 - cmp r0, 0 - bne _081A02D4 -_081A02F4: - ldr r0, [r7] - adds r0, 0xB0 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r6, r0 - mov r1, r12 - adds r1, 0x34 - adds r0, r1 - ldrh r0, [r0] - mov r1, sp - bl sub_81A01E8 - movs r3, 0 - cmp r3, r4 - bcs _081A0376 - ldr r1, [r7] - adds r0, r1, 0 - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - subs r0, 0x3 - cmp r3, r0 - bge _081A0376 - adds r6, r7, 0 - adds r5, r1, 0 -_081A032A: - lsls r0, r3, 2 - adds r2, r5, r0 - adds r0, r2, 0 - adds r0, 0xB8 - ldrb r1, [r0] - lsls r0, r1, 30 - lsrs r0, 30 - cmp r0, 0x2 - bne _081A035C - lsls r0, r1, 28 - lsrs r0, 30 - cmp r0, r8 - bne _081A035C - lsrs r0, r1, 6 - cmp r0, 0 - beq _081A035C - lsls r0, r1, 26 - lsrs r0, 30 - lsls r0, 1 - mov r7, sp - adds r1, r7, r0 - adds r0, r2, 0 - adds r0, 0xBA - ldrh r0, [r0] - strh r0, [r1] -_081A035C: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, r4 - bcs _081A0376 - ldr r0, [r6] - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - subs r0, 0x3 - cmp r3, r0 - blt _081A032A -_081A0376: - mov r0, sp - add r0, r9 - ldrh r0, [r0] -_081A037C: - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A0284 - - thumb_func_start sub_81A0390 -sub_81A0390: @ 81A0390 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r5, 0 - ldr r7, =gSaveBlock2Ptr - adds r6, r7, 0 - movs r4, 0 -_081A03A6: - ldr r0, [r6] - lsls r2, r5, 1 - adds r2, r5 - lsls r2, 2 - adds r0, r2 - adds r1, r0, 0 - adds r1, 0xE0 - strh r4, [r1] - adds r0, 0xEA - strh r4, [r0] - movs r3, 0 -_081A03BC: - ldr r0, [r6] - lsls r1, r3, 1 - adds r1, r2 - adds r0, 0xE2 - adds r0, r1 - strh r4, [r0] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x3 - bls _081A03BC - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bls _081A03A6 - ldr r0, [r7] - adds r0, 0xB1 - ldrb r0, [r0] - lsrs r3, r0, 6 - movs r5, 0 -_081A03E6: - lsls r0, r3, 2 - mov r1, sp - adds r2, r1, r0 - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r0, 0xE0 - ldr r1, [r7] - adds r1, r0 - str r1, [r2] - adds r0, r3, 0x1 - movs r1, 0x3 - bl __modsi3 - lsls r0, 24 - lsrs r3, r0, 24 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bls _081A03E6 - movs r5, 0 - ldr r7, =gSaveBlock2Ptr - ldr r6, =gUnknown_086109A4 -_081A0416: - ldr r0, [r7] - mov r12, r0 - adds r0, 0xB4 - adds r0, r5 - ldrb r2, [r0] - mov r0, r12 - adds r0, 0xB2 - ldrb r0, [r0] - lsls r0, 29 - lsrs r0, 29 - asrs r0, r5 - movs r1, 0x1 - ands r0, r1 - lsls r0, 2 - asrs r2, r0 - movs r0, 0xF - ands r2, r0 - lsls r0, r5, 2 - mov r1, sp - adds r3, r1, r0 - ldr r4, [r3] - lsls r2, 1 - mov r0, r12 - adds r0, 0xB0 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r2, r0 - adds r2, r6 - ldrh r0, [r2] - strh r0, [r4] - ldr r1, [r3] - ldrh r0, [r1] - adds r1, 0x2 - bl sub_81A01E8 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bls _081A0416 - movs r5, 0 - cmp r5, r8 - bcs _081A04D6 - ldr r7, =gSaveBlock2Ptr -_081A0470: - ldr r1, [r7] - lsls r0, r5, 2 - adds r4, r1, r0 - adds r0, r4, 0 - adds r0, 0xB8 - ldrb r2, [r0] - lsls r0, r2, 30 - lsrs r1, r0, 30 - lsls r0, r2, 28 - lsrs r3, r0, 30 - adds r6, r3, 0 - cmp r1, 0x1 - bne _081A04A8 - lsrs r0, r2, 6 - cmp r0, 0 - beq _081A04CC - lsls r0, r3, 2 - add r0, sp - ldr r1, [r0] - adds r0, r4, 0 - adds r0, 0xBA - ldrh r0, [r0] - strh r0, [r1, 0xA] - b _081A04CC - .pool -_081A04A8: - cmp r1, 0x2 - bne _081A04CC - lsls r0, r2, 24 - lsrs r0, 30 - cmp r0, 0 - beq _081A04CC - lsls r2, 26 - lsrs r2, 30 - lsls r0, r6, 2 - add r0, sp - ldr r1, [r0] - lsls r2, 1 - adds r1, 0x2 - adds r1, r2 - adds r0, r4, 0 - adds r0, 0xBA - ldrh r0, [r0] - strh r0, [r1] -_081A04CC: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, r8 - bcc _081A0470 -_081A04D6: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81A0390 - - thumb_func_start sub_81A04E4 -sub_81A04E4: @ 81A04E4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - lsls r0, 24 - lsrs r0, 24 - movs r7, 0x2 - cmp r0, 0x6 - bls _081A04FC - b _081A064C -_081A04FC: - lsls r0, 2 - ldr r1, =_081A050C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A050C: - .4byte _081A0528 - .4byte _081A0540 - .4byte _081A05B4 - .4byte _081A05F4 - .4byte _081A061C - .4byte _081A064C - .4byte _081A0634 -_081A0528: - movs r0, 0x12 - mov r10, r0 - movs r6, 0x8 - ldr r0, =gUnknown_085EAEB1 - str r0, [sp, 0xC] - ldr r0, =gUnknown_085EAEB8 - str r0, [sp, 0x10] - b _081A0652 - .pool -_081A0540: - movs r7, 0x3 - movs r1, 0x12 - mov r10, r1 - movs r6, 0x6 - movs r4, 0 - ldr r0, =gSpeciesNames - mov r9, r0 - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - movs r1, 0xB2 - adds r1, r3 - mov r12, r1 - adds r5, r3, 0 - adds r5, 0xB0 - ldr r0, =gUnknown_086109A4 - mov r8, r0 -_081A0560: - adds r0, r3, 0 - adds r0, 0xB4 - adds r0, r4 - ldrb r2, [r0] - mov r1, r12 - ldrb r0, [r1] - lsls r0, 29 - lsrs r0, 29 - asrs r0, r4 - movs r1, 0x1 - ands r0, r1 - lsls r0, 2 - asrs r2, r0 - movs r0, 0xF - ands r2, r0 - lsls r2, 1 - ldrb r1, [r5] - movs r0, 0x58 - muls r0, r1 - adds r2, r0 - add r2, r8 - ldrh r1, [r2] - lsls r0, r4, 2 - mov r2, sp - adds r2, r0 - adds r2, 0xC - movs r0, 0xB - muls r0, r1 - add r0, r9 - str r0, [r2] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _081A0560 - b _081A0652 - .pool -_081A05B4: - movs r0, 0x12 - mov r10, r0 - movs r6, 0x8 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - cmp r0, 0x2 - bls _081A05CC - b _081A06FA -_081A05CC: - ldr r0, =gUnknown_030062F0 - ldr r3, [r0] - ldrh r0, [r3, 0x2] - movs r2, 0xB - muls r0, r2 - ldr r1, =gSpeciesNames - adds r0, r1 - str r0, [sp, 0x10] - ldrh r0, [r3] - muls r0, r2 - adds r0, r1 - str r0, [sp, 0xC] - b _081A0652 - .pool -_081A05F4: - movs r1, 0x11 - mov r10, r1 - movs r6, 0x8 - ldr r0, =gUnknown_030062F0 - ldr r3, [r0] - ldrh r0, [r3, 0x4] - movs r2, 0xD - muls r0, r2 - ldr r1, =gMoveNames - adds r0, r1 - str r0, [sp, 0xC] - ldrh r0, [r3, 0x6] - muls r0, r2 - adds r0, r1 - str r0, [sp, 0x10] - b _081A0652 - .pool -_081A061C: - movs r0, 0x12 - mov r10, r0 - movs r6, 0x8 - ldr r0, =gUnknown_085ED193 - str r0, [sp, 0xC] - ldr r0, =gUnknown_085ED198 - str r0, [sp, 0x10] - b _081A0652 - .pool -_081A0634: - movs r1, 0x14 - mov r10, r1 - movs r6, 0x8 - ldr r0, =gUnknown_085EAE62 - str r0, [sp, 0xC] - ldr r0, =gUnknown_085EAE66 - str r0, [sp, 0x10] - b _081A0652 - .pool -_081A064C: - movs r0, 0 - mov r10, r0 - movs r6, 0 -_081A0652: - movs r5, 0 - movs r4, 0 - lsls r1, r7, 25 - mov r8, r1 - cmp r4, r7 - bcs _081A067E -_081A065E: - lsls r0, r4, 2 - add r0, sp - adds r0, 0xC - ldr r1, [r0] - movs r0, 0x1 - movs r2, 0 - bl GetStringWidth - cmp r0, r5 - ble _081A0674 - adds r5, r0, 0 -_081A0674: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r7 - bcc _081A065E -_081A067E: - adds r0, r5, 0 - bl convert_pixel_width_to_tile_width - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - mov r0, r10 - adds r1, r4, 0 - bl sub_80E2D5C - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - mov r0, r8 - lsrs r3, r0, 24 - mov r0, r10 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_81A0784 - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r5, 0 - movs r1, 0 - bl SetStandardWindowBorderStyle - movs r4, 0 - cmp r4, r7 - bcs _081A06E6 -_081A06B8: - lsls r0, r4, 2 - add r0, sp - adds r0, 0xC - ldr r2, [r0] - lsls r0, r4, 4 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - adds r0, r5, 0 - movs r1, 0x1 - movs r3, 0x8 - bl Print - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r7 - bcc _081A06B8 -_081A06E6: - adds r0, r5, 0 - adds r1, r7, 0 - movs r2, 0 - bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed - movs r0, 0x1 - adds r1, r7, 0 - adds r2, r5, 0 - bl sub_81A0804 -_081A06FA: - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81A04E4 - - thumb_func_start sub_81A070C -sub_81A070C: @ 81A070C - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081A0730 - bl ProcessMenuInputNoWrapAround - b _081A0734 - .pool -_081A0730: - bl ProcessMenuInput -_081A0734: - lsls r0, 24 - lsrs r0, 24 - lsls r0, 24 - asrs r1, r0, 24 - movs r0, 0x2 - negs r0, r0 - cmp r1, r0 - beq _081A0778 - adds r0, 0x1 - cmp r1, r0 - bne _081A0764 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081A0778 - movs r0, 0x5 - bl PlaySE - ldr r1, =gScriptResult - movs r0, 0x7F - strh r0, [r1] - b _081A0768 - .pool -_081A0764: - ldr r0, =gScriptResult - strh r1, [r0] -_081A0768: - ldrb r0, [r4, 0xC] - bl sub_81A07E8 - adds r0, r5, 0 - bl DestroyTask - bl script_env_2_enable_and_set_ctx_running -_081A0778: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A070C - - thumb_func_start sub_81A0784 -sub_81A0784: @ 81A0784 - push {r4,r5,lr} - sub sp, 0x20 - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 24 - lsls r5, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x80 - lsls r0, 17 - adds r4, r0 - lsrs r4, 24 - adds r5, r0 - lsrs r5, 24 - str r2, [sp] - str r3, [sp, 0x4] - movs r0, 0xF - str r0, [sp, 0x8] - movs r0, 0x64 - str r0, [sp, 0xC] - add r0, sp, 0x10 - movs r1, 0 - adds r2, r4, 0 - adds r3, r5, 0 - bl sub_8198A50 - ldr r0, [sp, 0x10] - ldr r1, [sp, 0x14] - str r0, [sp, 0x18] - str r1, [sp, 0x1C] - add r0, sp, 0x18 - bl AddWindow - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - adds r0, r4, 0 - add sp, 0x20 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81A0784 - - thumb_func_start sub_81A07E8 -sub_81A07E8: @ 81A07E8 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_8198070 - adds r0, r4, 0 - bl RemoveWindow - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81A07E8 - - thumb_func_start sub_81A0804 -sub_81A0804: @ 81A0804 - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r2, 24 - lsrs r6, r2, 24 - ldr r0, =sub_81A070C - movs r1, 0x50 - bl CreateTask - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0, r1 - strh r4, [r1, 0x10] - cmp r5, 0x3 - bls _081A0840 - movs r0, 0x1 - b _081A0842 - .pool -_081A0840: - movs r0, 0 -_081A0842: - strh r0, [r1, 0x12] - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - strh r6, [r0, 0x14] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A0804 - - thumb_func_start sub_81A085C -sub_81A085C: @ 81A085C - push {lr} - ldr r1, =gUnknown_086114E0 - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A085C - - thumb_func_start sub_81A087C -sub_81A087C: @ 81A087C - push {r4-r7,lr} - bl sub_819FBC8 - ldr r3, =gSaveBlock2Ptr - ldr r1, [r3] - adds r1, 0xB1 - ldrb r2, [r1] - movs r0, 0x4 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r3] - adds r1, 0xB1 - ldrb r2, [r1] - movs r0, 0x3D - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r3] - adds r1, 0xB1 - ldrb r2, [r1] - movs r0, 0x3F - ands r0, r2 - strb r0, [r1] - ldr r1, [r3] - adds r1, 0xB2 - ldrb r2, [r1] - movs r0, 0x8 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - movs r4, 0 - movs r1, 0 -_081A08BE: - ldr r0, [r3] - adds r0, 0xB4 - adds r0, r4 - strb r1, [r0] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _081A08BE - movs r4, 0 - ldr r5, =gSaveBlock2Ptr - movs r0, 0x4 - negs r0, r0 - mov r12, r0 - movs r7, 0xD - negs r7, r7 - movs r6, 0x31 - negs r6, r6 -_081A08E2: - ldr r1, [r5] - lsls r3, r4, 2 - adds r1, r3 - adds r1, 0xB8 - ldrb r2, [r1] - mov r0, r12 - ands r0, r2 - strb r0, [r1] - ldr r1, [r5] - adds r1, r3 - adds r1, 0xB8 - ldrb r2, [r1] - adds r0, r7, 0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r5] - adds r1, r3 - adds r1, 0xB8 - ldrb r2, [r1] - adds r0, r6, 0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r5] - adds r1, r3 - adds r1, 0xB8 - ldrb r2, [r1] - movs r0, 0x3F - ands r0, r2 - strb r0, [r1] - ldr r0, [r5] - adds r0, r3 - adds r0, 0xBA - movs r1, 0 - strh r1, [r0] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x8 - bls _081A08E2 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A087C - - thumb_func_start sub_81A093C -sub_81A093C: @ 81A093C - push {lr} - bl sub_819FBB0 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _081A0954 - ldr r0, =gScriptResult - strh r1, [r0] - b _081A095A - .pool -_081A0954: - ldr r1, =gScriptResult - movs r0, 0x1 - strh r0, [r1] -_081A095A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A093C - - thumb_func_start sub_81A0964 -sub_81A0964: @ 81A0964 - push {lr} - ldr r0, =gSpecialVar_0x8005 - ldrb r0, [r0] - bl sub_819FC40 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A0964 - - thumb_func_start sub_81A0978 -sub_81A0978: @ 81A0978 - push {lr} - bl sub_819FBC8 - pop {r0} - bx r0 - thumb_func_end sub_81A0978 - - thumb_func_start sub_81A0984 -sub_81A0984: @ 81A0984 - push {lr} - bl sub_819FD64 - pop {r0} - bx r0 - thumb_func_end sub_81A0984 - - thumb_func_start sub_81A0990 -sub_81A0990: @ 81A0990 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - adds r2, 0xB1 - ldrb r3, [r2] - lsls r1, r3, 26 - lsrs r1, 28 - adds r1, 0x1 - movs r0, 0xF - ands r1, r0 - lsls r1, 2 - movs r0, 0x3D - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - bx lr - .pool - thumb_func_end sub_81A0990 - - thumb_func_start sub_81A09B4 -sub_81A09B4: @ 81A09B4 - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_81A09B4 - - thumb_func_start sub_81A09D0 -sub_81A09D0: @ 81A09D0 - push {lr} - ldr r3, =gSaveBlock2Ptr - ldr r0, [r3] - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - subs r1, r0, 0x3 - cmp r1, 0 - bge _081A09F4 - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - b _081A0A1C - .pool -_081A09F4: - ldr r2, =gScriptResult - cmp r1, 0x8 - ble _081A09FE - movs r0, 0x1 - strh r0, [r2] -_081A09FE: - ldr r0, [r3] - lsls r1, 2 - adds r0, r1 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 30 - cmp r0, 0 - bne _081A0A18 - movs r0, 0x1 - b _081A0A1A - .pool -_081A0A18: - movs r0, 0 -_081A0A1A: - strh r0, [r2] -_081A0A1C: - pop {r0} - bx r0 - thumb_func_end sub_81A09D0 - - thumb_func_start sub_81A0A20 -sub_81A0A20: @ 81A0A20 - push {lr} - ldr r0, =gSpecialVar_0x8005 - ldrb r0, [r0] - bl sub_81A04E4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A0A20 - - thumb_func_start sub_81A0A34 -sub_81A0A34: @ 81A0A34 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_8197224 - lsls r0, 16 - cmp r0, 0 - bne _081A0A68 - adds r0, r4, 0 - bl DestroyTask - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0 - beq _081A0A64 - ldr r0, =script_env_2_enable_and_set_ctx_running - bl sub_81A172C - b _081A0A68 - .pool -_081A0A64: - bl script_env_2_enable_and_set_ctx_running -_081A0A68: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81A0A34 - - thumb_func_start sub_81A0A70 -sub_81A0A70: @ 81A0A70 - push {lr} - ldr r1, =gSpecialVar_0x8006 - ldrh r0, [r1] - cmp r0, 0x6 - bne _081A0A94 - ldr r1, =gUnknown_08610FF0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 3 - b _081A0C66 - .pool -_081A0A94: - cmp r0, 0x7 - bne _081A0AB0 - ldr r1, =gUnknown_08610FF0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 3 - adds r1, 0x4 - b _081A0C66 - .pool -_081A0AB0: - cmp r0, 0x8 - bne _081A0ACC - ldr r1, =gUnknown_086111B0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 3 - b _081A0C66 - .pool -_081A0ACC: - cmp r0, 0x9 - bne _081A0AE8 - ldr r1, =gUnknown_086111B0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 3 - adds r1, 0x4 - b _081A0C66 - .pool -_081A0AE8: - cmp r0, 0x4 - bne _081A0B04 - ldr r1, =gUnknown_08611230 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 3 - b _081A0C66 - .pool -_081A0B04: - cmp r0, 0x5 - bne _081A0B20 - ldr r1, =gUnknown_08611230 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 3 - adds r1, 0x4 - b _081A0C66 - .pool -_081A0B20: - cmp r0, 0xA - bne _081A0B40 - ldr r2, =gUnknown_08611070 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - b _081A0BD6 - .pool -_081A0B40: - cmp r0, 0xB - bne _081A0B5C - ldr r1, =gUnknown_086112B0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 3 - b _081A0C66 - .pool -_081A0B5C: - cmp r0, 0xC - bne _081A0B7C - ldr r2, =gUnknown_08611070 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r2, 0xC - b _081A0BD6 - .pool -_081A0B7C: - cmp r0, 0xD - bne _081A0B9C - ldr r2, =gUnknown_08611070 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r2, 0x4 - b _081A0BD6 - .pool -_081A0B9C: - ldrh r0, [r1] - cmp r0, 0x10 - bne _081A0BC0 - ldr r2, =gUnknown_08611070 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r2, 0x10 - b _081A0BD6 - .pool -_081A0BC0: - cmp r0, 0xE - bne _081A0BE4 - ldr r2, =gUnknown_08611070 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r2, 0x8 -_081A0BD6: - adds r0, r2 - ldr r1, [r0] - b _081A0C7A - .pool -_081A0BE4: - cmp r0, 0xF - bne _081A0C00 - ldr r1, =gUnknown_086112B0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 3 - adds r1, 0x4 - b _081A0C66 - .pool -_081A0C00: - cmp r0, 0 - bne _081A0C1C - ldr r1, =gUnknown_08610EF0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 4 - b _081A0C66 - .pool -_081A0C1C: - cmp r0, 0x1 - bne _081A0C38 - ldr r1, =gUnknown_08610EF0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 4 - adds r1, 0x4 - b _081A0C66 - .pool -_081A0C38: - cmp r0, 0x2 - bne _081A0C54 - ldr r1, =gUnknown_08610EF0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 4 - adds r1, 0x8 - b _081A0C66 - .pool -_081A0C54: - cmp r0, 0x3 - bne _081A0C74 - ldr r1, =gUnknown_08610EF0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 4 - adds r1, 0xC -_081A0C66: - adds r0, r1 - ldr r1, [r0] - b _081A0C7A - .pool -_081A0C74: - bl script_env_2_enable_and_set_ctx_running - b _081A0C8E -_081A0C7A: - ldr r0, =gStringVar4 - bl StringExpandPlaceholders - movs r0, 0x1 - bl AddTextPrinterForMessage - ldr r0, =sub_81A0A34 - movs r1, 0x1 - bl CreateTask -_081A0C8E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A0A70 - - thumb_func_start sub_81A0C9C -sub_81A0C9C: @ 81A0C9C - push {lr} - bl script_env_2_enable - bl player_bitmagic - bl sub_808B864 - bl sub_808BCF4 - movs r0, 0 - movs r1, 0x1 - bl sub_81973C4 - bl sub_81A0A70 - pop {r0} - bx r0 - thumb_func_end sub_81A0C9C - - thumb_func_start sub_81A0CC0 -sub_81A0CC0: @ 81A0CC0 - push {lr} - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - adds r0, r2, 0 - adds r0, 0xB1 - ldrb r0, [r0] - lsls r1, r0, 26 - lsrs r0, r1, 28 - cmp r0, 0x2 - bhi _081A0CE4 - ldr r1, =gScriptResult - movs r0, 0x2 - b _081A0D34 - .pool -_081A0CE4: - lsrs r0, r1, 28 - cmp r0, 0xB - bhi _081A0D30 - lsrs r0, r1, 28 - subs r0, 0x3 - lsls r0, 2 - adds r0, r2, r0 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - cmp r0, 0x2 - beq _081A0D18 - cmp r0, 0x2 - bgt _081A0D08 - cmp r0, 0x1 - beq _081A0D0E - b _081A0D30 -_081A0D08: - cmp r0, 0x3 - beq _081A0D24 - b _081A0D30 -_081A0D0E: - ldr r1, =gScriptResult - movs r0, 0x4 - b _081A0D34 - .pool -_081A0D18: - ldr r1, =gScriptResult - movs r0, 0x3 - b _081A0D34 - .pool -_081A0D24: - ldr r1, =gScriptResult - movs r0, 0x1 - b _081A0D34 - .pool -_081A0D30: - ldr r1, =gScriptResult - movs r0, 0x5 -_081A0D34: - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A0CC0 - - thumb_func_start sub_81A0D40 -sub_81A0D40: @ 81A0D40 - push {r4,lr} - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0 - beq _081A0D6E - ldr r4, =gSpecialVar_0x8006 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - adds r2, 0xB2 - ldrb r3, [r2] - lsls r0, r3, 29 - lsrs r0, 29 - movs r1, 0x1 - ldrb r4, [r4] - lsls r1, r4 - orrs r1, r0 - movs r0, 0x7 - ands r1, r0 - movs r0, 0x8 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] -_081A0D6E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A0D40 - - thumb_func_start sub_81A0D80 -sub_81A0D80: @ 81A0D80 - push {lr} - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - adds r0, r3, 0 - adds r0, 0xB1 - ldrb r0, [r0] - lsls r1, r0, 26 - lsrs r0, r1, 28 - cmp r0, 0x2 - bls _081A0DCE - subs r0, 0x3 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0 - beq _081A0DC0 - lsls r2, 2 - adds r2, r3, r2 - adds r2, 0xB8 - ldrb r1, [r2] - movs r0, 0x3F - ands r0, r1 - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2] - b _081A0DCE - .pool -_081A0DC0: - lsls r0, r2, 2 - adds r0, r3, r0 - adds r0, 0xB8 - ldrb r2, [r0] - movs r1, 0x3F - ands r1, r2 - strb r1, [r0] -_081A0DCE: - pop {r0} - bx r0 - thumb_func_end sub_81A0D80 - - thumb_func_start sub_81A0DD4 -sub_81A0DD4: @ 81A0DD4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r6, 0 - movs r2, 0 - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 30 - ldr r3, =gUnknown_030062F0 - mov r9, r3 - cmp r0, 0 - beq _081A0E14 - adds r3, r1, 0 -_081A0DF4: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x8 - bhi _081A0E14 - ldr r0, [r3] - lsls r1, r2, 2 - adds r0, r1 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 30 - cmp r0, 0 - bne _081A0DF4 -_081A0E14: - mov r4, r9 - movs r0, 0x8 - bl AllocZeroed - adds r7, r0, 0 - str r7, [r4] - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x2 - bne _081A0E88 - ldr r0, =gSaveBlock2Ptr - ldr r5, [r0] - adds r6, r5, 0 - adds r6, 0xB1 - ldrb r0, [r6] - lsls r1, r0, 26 - lsrs r0, r1, 28 - cmp r0, 0x2 - bls _081A0E3C - b _081A0FCE -_081A0E3C: - adds r2, r5, 0 - adds r2, 0xB4 - adds r0, r2, r0 - ldrb r0, [r0] - lsrs r4, r0, 4 - ldr r3, =gUnknown_08610970 - lsls r1, r4, 1 - adds r5, 0xB0 - ldrb r0, [r5] - movs r4, 0x58 - muls r0, r4 - adds r1, r0 - adds r3, 0x34 - adds r1, r3 - ldrh r0, [r1] - strh r0, [r7, 0x2] - ldrb r0, [r6] - lsls r0, 26 - lsrs r0, 28 - adds r2, r0 - ldrb r1, [r2] - movs r0, 0xF - ands r0, r1 - lsls r0, 1 - ldrb r1, [r5] - muls r1, r4 - adds r0, r1 - adds r0, r3 - b _081A0FCA - .pool -_081A0E88: - cmp r0, 0x3 - bne _081A0F54 - ldr r0, =gSaveBlock2Ptr - mov r8, r0 - ldr r5, [r0] - movs r1, 0xB1 - adds r1, r5 - mov r12, r1 - ldrb r0, [r1] - lsls r2, r0, 26 - lsrs r0, r2, 28 - cmp r0, 0x2 - bhi _081A0EA4 - b _081A0FCE -_081A0EA4: - adds r1, r0, 0 - adds r0, r6, 0x3 - cmp r1, r0 - blt _081A0EAE - b _081A0FCE -_081A0EAE: - adds r0, r1, 0 - subs r0, 0x3 - lsls r0, 2 - adds r0, r5, r0 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - cmp r0, 0x2 - beq _081A0EC4 - b _081A0FCE -_081A0EC4: - adds r0, r1, 0 - subs r0, 0x3 - lsls r0, 2 - adds r0, r5, r0 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 28 - lsrs r6, r0, 30 - adds r0, r5, 0 - adds r0, 0xB2 - ldrb r1, [r0] - lsls r1, 29 - lsrs r1, 29 - asrs r1, r6 - movs r0, 0x1 - ands r1, r0 - adds r0, r5, 0 - adds r0, 0xB4 - adds r0, r6 - ldrb r4, [r0] - lsls r1, 2 - asrs r4, r1 - movs r0, 0xF - ands r4, r0 - ldr r2, =gUnknown_08610970 - lsls r1, r4, 1 - adds r0, r5, 0 - adds r0, 0xB0 - ldrb r3, [r0] - movs r0, 0x58 - muls r0, r3 - adds r1, r0 - adds r2, 0x34 - adds r1, r2 - ldrh r0, [r1] - strh r0, [r7] - mov r3, r12 - ldrb r0, [r3] - lsls r0, 26 - lsrs r0, 28 - subs r0, 0x3 - lsls r0, 2 - adds r0, r5, r0 - adds r0, 0xB8 - ldrb r2, [r0] - lsls r2, 26 - lsrs r2, 30 - adds r0, r6, 0 - adds r1, r4, 0 - bl sub_81A0284 - mov r1, r9 - ldr r2, [r1] - strh r0, [r2, 0x4] - mov r3, r8 - ldr r1, [r3] - adds r0, r1, 0 - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - subs r0, 0x3 - lsls r0, 2 - adds r1, r0 - adds r1, 0xBA - ldrh r0, [r1] - strh r0, [r2, 0x6] - b _081A0FCE - .pool -_081A0F54: - cmp r0, 0x4 - bne _081A0FCE - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - adds r0, r3, 0 - adds r0, 0xB1 - ldrb r0, [r0] - lsls r2, r0, 26 - lsrs r0, r2, 28 - cmp r0, 0x2 - bls _081A0FCE - adds r1, r0, 0 - adds r0, r6, 0x3 - cmp r1, r0 - bge _081A0FCE - adds r0, r1, 0 - subs r0, 0x3 - lsls r0, 2 - adds r0, r3, r0 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - cmp r0, 0x1 - bne _081A0FCE - adds r0, r1, 0 - subs r0, 0x3 - lsls r0, 2 - adds r0, r3, r0 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 28 - lsrs r6, r0, 30 - adds r0, r3, 0 - adds r0, 0xB2 - ldrb r1, [r0] - lsls r1, 29 - lsrs r1, 29 - asrs r1, r6 - movs r0, 0x1 - ands r1, r0 - adds r0, r3, 0 - adds r0, 0xB4 - adds r0, r6 - ldrb r0, [r0] - lsls r1, 2 - asrs r0, r1 - movs r1, 0xF - ands r0, r1 - ldr r2, =gUnknown_08610970 - lsls r0, 1 - adds r1, r3, 0 - adds r1, 0xB0 - ldrb r3, [r1] - movs r1, 0x58 - muls r1, r3 - adds r0, r1 - adds r2, 0x34 - adds r0, r2 -_081A0FCA: - ldrh r0, [r0] - strh r0, [r7] -_081A0FCE: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A0DD4 - - thumb_func_start sub_81A0FE4 -sub_81A0FE4: @ 81A0FE4 - push {r4,lr} - ldr r4, =gUnknown_030062F0 - ldr r0, [r4] - bl Free - movs r0, 0 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A0FE4 - - thumb_func_start sub_81A0FFC -sub_81A0FFC: @ 81A0FFC - push {r4-r6,lr} - sub sp, 0x10 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x1 - beq _081A1028 - cmp r0, 0x1 - bgt _081A1018 - cmp r0, 0 - beq _081A101E - b _081A11E6 - .pool -_081A1018: - cmp r0, 0x2 - beq _081A1030 - b _081A11E6 -_081A101E: - ldr r5, =gStringVar1 - b _081A1032 - .pool -_081A1028: - ldr r5, =gStringVar2 - b _081A1032 - .pool -_081A1030: - ldr r5, =gStringVar3 -_081A1032: - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - cmp r0, 0x9 - bls _081A103C - b _081A11E6 -_081A103C: - lsls r0, 2 - ldr r1, =_081A1054 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A1054: - .4byte _081A107C - .4byte _081A1094 - .4byte _081A10AC - .4byte _081A10C4 - .4byte _081A10DC - .4byte _081A10F4 - .4byte _081A1118 - .4byte _081A1164 - .4byte _081A1140 - .4byte _081A1184 -_081A107C: - ldr r0, =gUnknown_030062F0 - ldr r0, [r0] - ldrh r1, [r0] - movs r0, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - b _081A1174 - .pool -_081A1094: - ldr r0, =gUnknown_030062F0 - ldr r0, [r0] - ldrh r1, [r0, 0x2] - movs r0, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - b _081A1174 - .pool -_081A10AC: - ldr r0, =gUnknown_030062F0 - ldr r0, [r0] - ldrh r1, [r0] - movs r0, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - b _081A1174 - .pool -_081A10C4: - ldr r0, =gUnknown_030062F0 - ldr r0, [r0] - ldrh r1, [r0, 0x4] - movs r0, 0xD - muls r1, r0 - ldr r0, =gMoveNames - adds r1, r0 - b _081A1174 - .pool -_081A10DC: - ldr r0, =gUnknown_030062F0 - ldr r0, [r0] - ldrh r1, [r0, 0x6] - movs r0, 0xD - muls r1, r0 - ldr r0, =gMoveNames - adds r1, r0 - b _081A1174 - .pool -_081A10F4: - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - subs r0, 0x3 - lsls r0, 2 - adds r1, r0 - adds r1, 0xBA - ldrh r0, [r1] - bl ItemId_GetItem - adds r1, r0, 0 - b _081A1174 - .pool -_081A1118: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - movs r1, 0x2 - bl sub_81A1650 - adds r1, r0, 0 - mov r0, sp - movs r2, 0x2 - bl sub_81DB5E8 - adds r0, r5, 0 - mov r1, sp - bl StringCopy - b _081A11E6 - .pool -_081A1140: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB1 - ldrb r1, [r0] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x1 - bne _081A115C - ldr r1, =gUnknown_085EAEB1 - b _081A1174 - .pool -_081A115C: - ldr r1, =gUnknown_085EAEB8 - b _081A1174 - .pool -_081A1164: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - movs r1, 0x82 - lsls r1, 1 - adds r0, r1 - bl ConvertBattleFrontierTrainerSpeechToString - ldr r1, =gStringVar4 -_081A1174: - adds r0, r5, 0 - bl StringCopy - b _081A11E6 - .pool -_081A1184: - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - adds r1, r3, 0 - adds r1, 0xB1 - ldrb r1, [r1] - lsls r4, r1, 24 - lsrs r1, r4, 30 - adds r6, r0, 0 - cmp r1, 0x2 - bhi _081A11C0 - adds r0, r3, 0 - adds r0, 0xB4 - adds r0, r1 - ldrb r2, [r0] - adds r0, r3, 0 - adds r0, 0xB2 - ldrb r0, [r0] - lsls r0, 29 - lsrs r0, 29 - asrs r0, r1 - movs r1, 0x1 - ands r0, r1 - lsls r0, 2 - asrs r2, r0 - movs r0, 0xF - ands r2, r0 - b _081A11C2 - .pool -_081A11C0: - movs r2, 0 -_081A11C2: - ldr r3, =gUnknown_08610970 - lsls r1, r2, 1 - ldr r0, [r6] - adds r0, 0xB0 - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r1, r0 - adds r3, 0x34 - adds r1, r3 - ldrh r1, [r1] - movs r0, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - adds r0, r5, 0 - bl StringCopy -_081A11E6: - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A0FFC - - thumb_func_start sub_81A11F8 -sub_81A11F8: @ 81A11F8 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r0, =gSpecialVar_0x8005 - ldrb r1, [r0] - adds r2, 0xB1 - lsls r1, 6 - ldrb r3, [r2] - movs r0, 0x3F - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - bx lr - .pool - thumb_func_end sub_81A11F8 - - thumb_func_start sub_81A1218 -sub_81A1218: @ 81A1218 - push {lr} - bl sub_81AAC28 - pop {r0} - bx r0 - thumb_func_end sub_81A1218 - - thumb_func_start sub_81A1224 -sub_81A1224: @ 81A1224 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r1, =gSaveBlock2Ptr - ldr r3, [r1] - adds r0, r3, 0 - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - adds r7, r1, 0 - cmp r0, 0x2 - bhi _081A1242 - b _081A1362 -_081A1242: - movs r5, 0 - movs r2, 0 - adds r0, r3, 0 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 30 - ldr r1, =gSpecialVar_0x8005 - mov r12, r1 - ldr r1, =gScriptResult - mov r8, r1 - cmp r0, 0 - beq _081A127C - adds r3, r7, 0 -_081A125C: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x8 - bhi _081A127C - ldr r0, [r3] - lsls r1, r2, 2 - adds r0, r1 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 30 - cmp r0, 0 - bne _081A125C -_081A127C: - movs r4, 0 - cmp r4, r5 - bcs _081A1322 - ldr r0, [r7] - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - subs r0, 0x3 - cmp r4, r0 - bge _081A1322 - adds r6, r7, 0 - mov r9, r4 -_081A1296: - ldr r3, [r6] - lsls r0, r4, 2 - adds r2, r3, r0 - adds r0, r2, 0 - adds r0, 0xB8 - ldrb r1, [r0] - lsls r0, r1, 30 - lsrs r0, 30 - cmp r0, 0x1 - bne _081A1308 - lsrs r0, r1, 6 - cmp r0, 0 - beq _081A1308 - adds r0, r2, 0 - adds r0, 0xBA - ldrh r0, [r0] - mov r2, r12 - ldrh r2, [r2] - cmp r0, r2 - bne _081A1308 - adds r0, r3, 0 - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - subs r0, 0x3 - lsls r0, 2 - adds r0, r3, r0 - adds r0, 0xB8 - ldrb r2, [r0] - movs r1, 0x3F - ands r1, r2 - strb r1, [r0] - ldr r1, [r6] - adds r0, r1, 0 - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - subs r0, 0x3 - lsls r0, 2 - adds r1, r0 - mov r2, r12 - ldrh r0, [r2] - adds r1, 0xBA - strh r0, [r1] - mov r1, r9 - mov r0, r8 - strh r1, [r0] - b _081A1362 - .pool -_081A1308: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcs _081A1322 - ldr r0, [r6] - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - subs r0, 0x3 - cmp r4, r0 - blt _081A1296 -_081A1322: - ldr r2, [r7] - adds r0, r2, 0 - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - subs r0, 0x3 - lsls r0, 2 - adds r2, r0 - adds r2, 0xB8 - ldrb r1, [r2] - movs r0, 0x3F - ands r0, r1 - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2] - ldr r1, [r7] - adds r0, r1, 0 - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - subs r0, 0x3 - lsls r0, 2 - adds r1, r0 - mov r2, r12 - ldrh r0, [r2] - adds r1, 0xBA - strh r0, [r1] - movs r0, 0x1 - mov r1, r8 - strh r0, [r1] -_081A1362: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81A1224 - - thumb_func_start sub_81A1370 -sub_81A1370: @ 81A1370 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - movs r2, 0x8A - lsls r2, 1 - adds r1, r2 - ldrb r1, [r1] - adds r4, r0, 0 - cmp r1, 0xFF - beq _081A1422 - movs r5, 0 -_081A138E: - ldr r1, [r4] - adds r2, r5, 0x1 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r3, r1, r0 - movs r5, 0x8A - lsls r5, 1 - adds r0, r3, r5 - ldrb r0, [r0] - cmp r0, 0xFF - bne _081A13B8 - adds r0, r3, 0 - adds r0, 0xDC - adds r1, 0xDC - movs r2, 0x44 - bl memcpy - b _081A1422 - .pool -_081A13B8: - adds r5, r2, 0 - cmp r5, 0x2 - ble _081A138E - ldr r0, =0x0000ffff - mov r10, r0 - movs r2, 0x1 - negs r2, r2 - mov r9, r2 - movs r5, 0x1 - ldr r7, =gSaveBlock2Ptr - movs r0, 0x90 - lsls r0, 1 - mov r8, r0 - movs r6, 0x44 -_081A13D4: - ldr r0, [r7] - add r0, r8 - adds r0, 0x34 - bl sub_80842DC - adds r4, r0, 0 - ldr r0, [r7] - adds r0, 0xA - bl sub_80842DC - cmp r4, r0 - bne _081A13FC - ldr r0, [r7] - adds r0, r6 - adds r0, 0xDE - ldrb r0, [r0] - cmp r0, r10 - bge _081A13FC - mov r10, r0 - mov r9, r5 -_081A13FC: - movs r2, 0x44 - add r8, r2 - adds r6, 0x44 - adds r5, 0x1 - cmp r5, 0x3 - ble _081A13D4 - mov r5, r9 - cmp r5, 0 - ble _081A1422 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - lsls r0, r5, 4 - add r0, r9 - lsls r0, 2 - adds r0, r1, r0 - adds r0, 0xDC - adds r1, 0xDC - bl memcpy -_081A1422: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A1370 - - thumb_func_start sub_81A1438 -sub_81A1438: @ 81A1438 - push {r4,r5,lr} - ldr r4, =gSaveBlock2Ptr - ldr r2, [r4] - adds r0, r2, 0 - adds r0, 0xB0 - ldrb r0, [r0] - adds r2, 0xDC - movs r1, 0x1F - ands r1, r0 - ldrb r3, [r2] - movs r0, 0x20 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - ldr r2, [r4] - adds r0, r2, 0 - adds r0, 0xB1 - ldrb r1, [r0] - lsls r1, 30 - adds r2, 0xDC - lsrs r1, 25 - ldrb r3, [r2] - movs r0, 0x61 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - movs r2, 0 - ldr r0, [r4] - b _081A148C - .pool -_081A147C: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x8 - bhi _081A1496 - ldr r0, [r4] - lsls r1, r2, 2 - adds r0, r1 -_081A148C: - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 30 - cmp r0, 0 - bne _081A147C -_081A1496: - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - adds r0, 0xDD - strb r2, [r0] - ldr r0, [r4] - adds r1, r0, 0 - adds r1, 0xDE - ldrb r0, [r1] - cmp r0, 0xFE - bhi _081A14AE - adds r0, 0x1 - strb r0, [r1] -_081A14AE: - ldr r0, [r4] - adds r0, 0xDD - ldrb r0, [r0] - bl sub_81A0390 - movs r2, 0 - adds r3, r4, 0 - movs r4, 0x88 - lsls r4, 1 - adds r5, r3, 0 -_081A14C2: - ldr r0, [r3] - adds r1, r0, r4 - adds r1, r2 - adds r0, 0xA - adds r0, r2 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x3 - bls _081A14C2 - ldr r1, [r5] - movs r2, 0x8A - lsls r2, 1 - adds r0, r1, r2 - bl StringCopy - ldr r1, [r5] - ldr r0, =gGameLanguage - ldrb r0, [r0] - ldr r2, =0x0000011b - adds r1, r2 - strb r0, [r1] - ldr r0, [r5] - adds r0, 0xDC - bl sub_8165AE8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A1438 - - thumb_func_start sub_81A150C -sub_81A150C: @ 81A150C - push {lr} - ldr r2, =gUnknown_08610970 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xDC - ldrb r0, [r0] - lsls r0, 27 - lsrs r0, 27 - movs r1, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x32 - ldrb r2, [r0] - movs r1, 0 - ldr r3, =gUnknown_085DCEDC - ldrb r0, [r3] - cmp r0, r2 - beq _081A1542 -_081A1530: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x1D - bhi _081A1542 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _081A1530 -_081A1542: - cmp r1, 0x1E - beq _081A1568 - ldr r0, =gUnknown_085DCF0E - adds r0, r1, r0 - ldrb r1, [r0] - ldr r0, =0x00004010 - bl VarSet - b _081A1594 - .pool -_081A1568: - movs r1, 0 - ldr r3, =gUnknown_085DCEFA - ldrb r0, [r3] - cmp r0, r2 - beq _081A1584 -_081A1572: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x13 - bhi _081A1584 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _081A1572 -_081A1584: - cmp r1, 0x14 - beq _081A1594 - ldr r0, =gUnknown_085DCF2C - adds r0, r1, r0 - ldrb r1, [r0] - ldr r0, =0x00004010 - bl VarSet -_081A1594: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A150C - - thumb_func_start sub_81A15A4 -sub_81A15A4: @ 81A15A4 - push {lr} - ldr r2, =gUnknown_08610970 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x32 - ldrb r2, [r0] - movs r1, 0 - ldr r3, =gUnknown_085DCEDC - ldrb r0, [r3] - cmp r0, r2 - beq _081A15D6 -_081A15C4: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x1D - bhi _081A15D6 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _081A15C4 -_081A15D6: - cmp r1, 0x1E - beq _081A15FC - ldr r0, =gUnknown_085DCF0E - adds r0, r1, r0 - ldrb r1, [r0] - ldr r0, =0x00004010 - bl VarSet - b _081A1628 - .pool -_081A15FC: - movs r1, 0 - ldr r3, =gUnknown_085DCEFA - ldrb r0, [r3] - cmp r0, r2 - beq _081A1618 -_081A1606: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x13 - bhi _081A1618 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _081A1606 -_081A1618: - cmp r1, 0x14 - beq _081A1628 - ldr r0, =gUnknown_085DCF2C - adds r0, r1, r0 - ldrb r1, [r0] - ldr r0, =0x00004010 - bl VarSet -_081A1628: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A15A4 - - thumb_func_start sub_81A1638 -sub_81A1638: @ 81A1638 - ldr r1, =gSpecialVar_0x8004 - movs r0, 0x1 - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_81A1638 - - thumb_func_start sub_81A1644 -sub_81A1644: @ 81A1644 - ldr r1, =gSpecialVar_0x8004 - movs r0, 0x1 - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_81A1644 - - thumb_func_start sub_81A1650 -sub_81A1650: @ 81A1650 - push {lr} - movs r2, 0x58 - muls r2, r0 - ldr r0, =gUnknown_08610970 - adds r2, r0 - subs r0, r1, 0x1 - cmp r0, 0x6 - bhi _081A16AC - lsls r0, 2 - ldr r1, =_081A1674 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A1674: - .4byte _081A1690 - .4byte _081A1694 - .4byte _081A169A - .4byte _081A16A0 - .4byte _081A16A6 - .4byte _081A16AC - .4byte _081A16AC -_081A1690: - adds r0, r2, 0 - b _081A16B0 -_081A1694: - adds r0, r2, 0 - adds r0, 0x8 - b _081A16B0 -_081A169A: - adds r0, r2, 0 - adds r0, 0x10 - b _081A16B0 -_081A16A0: - adds r0, r2, 0 - adds r0, 0x18 - b _081A16B0 -_081A16A6: - adds r0, r2, 0 - adds r0, 0x20 - b _081A16B0 -_081A16AC: - adds r0, r2, 0 - adds r0, 0x28 -_081A16B0: - pop {r1} - bx r1 - thumb_func_end sub_81A1650 - - thumb_func_start sub_81A16B4 -sub_81A16B4: @ 81A16B4 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081A16CE - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081A16D4 -_081A16CE: - adds r0, r2, 0 - bl SwitchTaskToFollowupFunc -_081A16D4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A16B4 - - thumb_func_start sub_81A16DC -sub_81A16DC: @ 81A16DC - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081A16F6 - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081A1718 -_081A16F6: - ldr r2, =gUnknown_030062F4 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x8] - movs r3, 0xA - ldrsh r0, [r0, r3] - lsls r0, 16 - orrs r1, r0 - str r1, [r2] - bl _call_via_r1 - adds r0, r4, 0 - bl DestroyTask -_081A1718: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A16DC - - thumb_func_start sub_81A172C -sub_81A172C: @ 81A172C - push {r4,lr} - adds r4, r0, 0 - ldr r0, =sub_81A16DC - movs r1, 0x1 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0x8] - lsrs r4, 16 - strh r4, [r1, 0xA] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A172C - - thumb_func_start sub_81A175C -sub_81A175C: @ 81A175C - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =sub_81A16B4 - adds r0, r4, 0 - movs r1, 0x1 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - adds r2, r5, 0 - bl SetTaskFuncWithFollowupFunc - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A175C - - thumb_func_start sub_81A1780 -sub_81A1780: @ 81A1780 - push {lr} - ldr r1, =gUnknown_08611C18 - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A1780 - - thumb_func_start sub_81A17A0 -sub_81A17A0: @ 81A17A0 - push {lr} - movs r0, 0x80 - lsls r0, 7 - movs r1, 0xFF - bl VarSet - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca8 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x4 - bhi _081A1822 - lsls r0, 2 - ldr r1, =_081A17D0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A17D0: - .4byte _081A1822 - .4byte _081A17E4 - .4byte _081A1810 - .4byte _081A17EC - .4byte _081A17E8 -_081A17E4: - movs r0, 0 - b _081A17EE -_081A17E8: - movs r0, 0 - b _081A17EE -_081A17EC: - movs r0, 0x1 -_081A17EE: - bl sub_813A878 - movs r0, 0x80 - lsls r0, 7 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - ldr r2, =0x00000ca8 - adds r1, r2 - ldrb r1, [r1] - bl VarSet - b _081A1822 - .pool -_081A1810: - movs r0, 0x80 - lsls r0, 7 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - ldr r2, =0x00000ca8 - adds r1, r2 - ldrb r1, [r1] - bl VarSet -_081A1822: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A17A0 - - thumb_func_start sub_81A1830 -sub_81A1830: @ 81A1830 - push {r4-r6,lr} - ldr r0, =0x000040cf - bl VarGet - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r6, 0 - bl sub_81A3B30 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bne _081A184C - movs r5, 0x1 -_081A184C: - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x7 - bls _081A1856 - b _081A1956 -_081A1856: - lsls r0, 2 - ldr r1, =_081A186C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A186C: - .4byte _081A188C - .4byte _081A18A8 - .4byte _081A18C8 - .4byte _081A18E4 - .4byte _081A1956 - .4byte _081A1900 - .4byte _081A1918 - .4byte _081A1938 -_081A188C: - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000ca8 - adds r0, r2 - ldrb r0, [r0] - strh r0, [r1] - b _081A1956 - .pool -_081A18A8: - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000ca9 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - strh r0, [r1] - b _081A1956 - .pool -_081A18C8: - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000cb2 - adds r0, r2 - ldrh r0, [r0] - strh r0, [r1] - b _081A1956 - .pool -_081A18E4: - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000ca9 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 29 - b _081A1926 - .pool -_081A1900: - ldr r2, =gScriptResult - ldr r1, =gBattleOutcome - ldrb r0, [r1] - strh r0, [r2] - movs r0, 0 - strb r0, [r1] - b _081A1956 - .pool -_081A1918: - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000ca9 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 28 -_081A1926: - lsrs r0, 31 - strh r0, [r1] - b _081A1956 - .pool -_081A1938: - ldr r4, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - movs r0, 0xD0 - lsls r0, 4 - adds r2, r0 - ldr r3, =gUnknown_08611BFC - lsls r0, r5, 1 - lsls r1, r6, 2 - adds r0, r1 - adds r0, r3 - ldrh r1, [r2] - ldrh r0, [r0] - ands r0, r1 - strh r0, [r4] -_081A1956: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A1830 - - thumb_func_start sub_81A1968 -sub_81A1968: @ 81A1968 - push {r4,r5,lr} - ldr r0, =0x000040cf - bl VarGet - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r5, 0 - bl sub_81A3B30 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bne _081A1984 - movs r4, 0x1 -_081A1984: - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x7 - bls _081A198E - b _081A1AC4 -_081A198E: - lsls r0, 2 - ldr r1, =_081A19A4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A19A4: - .4byte _081A19C4 - .4byte _081A19E0 - .4byte _081A1A0C - .4byte _081A1A28 - .4byte _081A1A50 - .4byte _081A1AC4 - .4byte _081A1A7C - .4byte _081A1AA8 -_081A19C4: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =gSpecialVar_0x8006 - ldrh r1, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - strb r1, [r0] - b _081A1AC4 - .pool -_081A19E0: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r1, =0x00000ca9 - adds r2, r1 - movs r1, 0x3 - ands r1, r0 - ldrb r3, [r2] - movs r0, 0x4 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - b _081A1AC4 - .pool -_081A1A0C: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =gSpecialVar_0x8006 - ldrh r1, [r1] - ldr r2, =0x00000cb2 - adds r0, r2 - strh r1, [r0] - b _081A1AC4 - .pool -_081A1A28: - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r1, =0x00000ca9 - adds r3, r1 - movs r1, 0x1 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r3] - movs r0, 0x5 - negs r0, r0 - b _081A1A94 - .pool -_081A1A50: - movs r2, 0 - ldr r5, =gSaveBlock2Ptr - ldr r4, =0x00000caa - ldr r3, =gUnknown_0203CEF8 -_081A1A58: - ldr r1, [r5] - lsls r0, r2, 1 - adds r1, r4 - adds r1, r0 - adds r0, r2, r3 - ldrb r0, [r0] - strh r0, [r1] - adds r2, 0x1 - cmp r2, 0x3 - ble _081A1A58 - b _081A1AC4 - .pool -_081A1A7C: - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r0, =gSpecialVar_0x8006 - ldrb r0, [r0] - ldr r2, =0x00000ca9 - adds r3, r2 - movs r1, 0x1 - ands r1, r0 - lsls r1, 3 - ldrb r2, [r3] - movs r0, 0x9 - negs r0, r0 -_081A1A94: - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - b _081A1AC4 - .pool -_081A1AA8: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - movs r0, 0xD0 - lsls r0, 4 - adds r2, r0 - ldr r3, =gUnknown_08611BFC - lsls r1, r4, 1 - lsls r0, r5, 2 - adds r1, r0 - adds r1, r3 - ldrh r0, [r2] - ldrh r1, [r1] - orrs r0, r1 - strh r0, [r2] -_081A1AC4: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A1968 - - thumb_func_start sub_81A1AD4 -sub_81A1AD4: @ 81A1AD4 - push {r4-r7,lr} - bl sub_81B8558 - movs r3, 0 - ldr r4, =gSpecialVar_0x8005 - ldrh r0, [r4] - cmp r3, r0 - bge _081A1B00 - ldr r7, =gUnknown_0203CEF8 - ldr r6, =gSaveBlock2Ptr - ldr r5, =0x00000caa -_081A1AEA: - adds r2, r3, r7 - ldr r0, [r6] - lsls r1, r3, 1 - adds r0, r5 - adds r0, r1 - ldrh r0, [r0] - strb r0, [r2] - adds r3, 0x1 - ldrh r0, [r4] - cmp r3, r0 - blt _081A1AEA -_081A1B00: - bl sub_80F94E8 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A1AD4 - - thumb_func_start sub_81A1B1C -sub_81A1B1C: @ 81A1B1C - push {lr} - bl DoSoftReset - pop {r0} - bx r0 - thumb_func_end sub_81A1B1C - - thumb_func_start sub_81A1B28 -sub_81A1B28: @ 81A1B28 - ldr r1, =gUnknown_0203BC88 - ldr r0, =gBattleFrontierTrainers - str r0, [r1] - bx lr - .pool - thumb_func_end sub_81A1B28 - - thumb_func_start sub_81A1B38 -sub_81A1B38: @ 81A1B38 - push {r4,r5,lr} - movs r4, 0 - movs r5, 0x64 -_081A1B3E: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - ldr r2, =0x00000caa - adds r0, r2 - adds r1, r0, r1 - ldrh r0, [r1] - subs r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x5 - bhi _081A1B76 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldrh r1, [r1] - subs r1, 0x1 - muls r1, r5 - adds r0, r1 - movs r1, 0x8E - lsls r1, 2 - adds r0, r1 - ldr r2, =gPlayerParty - adds r1, r4, 0 - muls r1, r5 - adds r1, r2 - movs r2, 0x64 - bl memcpy -_081A1B76: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _081A1B3E - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A1B38 - - thumb_func_start sub_81A1B98 -sub_81A1B98: @ 81A1B98 - push {lr} - ldr r0, =gSpecialVar_0x8006 - ldrh r1, [r0] - adds r2, r0, 0 - cmp r1, 0x3 - bls _081A1BA8 - movs r0, 0 - strh r0, [r2] -_081A1BA8: - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x7 - bhi _081A1C1E - lsls r0, 2 - ldr r1, =_081A1BC8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A1BC8: - .4byte _081A1BE8 - .4byte _081A1BF0 - .4byte _081A1BF8 - .4byte _081A1C0E - .4byte _081A1C06 - .4byte _081A1C00 - .4byte _081A1C14 - .4byte _081A1C1A -_081A1BE8: - ldrb r0, [r2] - bl sub_81A1EA8 - b _081A1C1E -_081A1BF0: - ldrb r0, [r2] - bl sub_81A2134 - b _081A1C1E -_081A1BF8: - ldrb r0, [r2] - bl sub_81A2460 - b _081A1C1E -_081A1C00: - bl sub_81A2698 - b _081A1C1E -_081A1C06: - ldrb r0, [r2] - bl sub_81A2C94 - b _081A1C1E -_081A1C0E: - bl sub_81A2968 - b _081A1C1E -_081A1C14: - bl sub_81A2F38 - b _081A1C1E -_081A1C1A: - bl sub_81A2FF8 -_081A1C1E: - pop {r0} - bx r0 - thumb_func_end sub_81A1B98 - - thumb_func_start sub_81A1C24 -sub_81A1C24: @ 81A1C24 - push {lr} - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - ldr r2, =0x00000cdc - adds r1, r2 - ldr r1, [r1] - ands r1, r0 - cmp r1, 0 - bne _081A1C44 - movs r0, 0 - b _081A1C46 - .pool -_081A1C44: - movs r0, 0x1 -_081A1C46: - pop {r1} - bx r1 - thumb_func_end sub_81A1C24 - - thumb_func_start sub_81A1C4C -sub_81A1C4C: @ 81A1C4C - push {r4,r5,lr} - sub sp, 0xC - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0xE0 - bl GetStringCenterAlignXOffset - adds r3, r0, 0 - lsls r0, r5, 3 - adds r5, r0, 0x1 - ldr r0, =gUnknown_0203AB74 - ldrb r0, [r0] - lsls r3, 24 - lsrs r3, 24 - lsls r1, r5, 24 - lsrs r1, 24 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - bl Print - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A1C4C - - thumb_func_start sub_81A1C90 -sub_81A1C90: @ 81A1C90 - push {r4,lr} - sub sp, 0x34 - adds r2, r0, 0 - ldr r3, =gUnknown_0203AB74 - movs r1, 0xAE - mov r0, sp - adds r0, 0x2F -_081A1C9E: - strb r1, [r0] - subs r0, 0x1 - add r4, sp, 0xC - cmp r0, r4 - bge _081A1C9E - add r1, sp, 0x30 - movs r0, 0xFF - strb r0, [r1] - lsls r0, r2, 3 - adds r2, r0, 0x1 - ldrb r0, [r3] - lsls r1, r2, 24 - lsrs r1, 24 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0x4 - bl Print - add sp, 0x34 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A1C90 - - thumb_func_start sub_81A1CD8 -sub_81A1CD8: @ 81A1CD8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - adds r5, r0, 0 - adds r4, r2, 0 - ldr r0, [sp, 0x30] - lsls r1, 16 - lsrs r6, r1, 16 - lsls r4, 24 - lsrs r4, 24 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0xC] - lsls r0, 24 - lsrs r0, 24 - adds r7, r0, 0 - ldr r0, =gUnknown_0203AB74 - mov r10, r0 - ldrb r0, [r0] - str r7, [sp] - movs r1, 0xFF - mov r9, r1 - str r1, [sp, 0x4] - movs r1, 0 - mov r8, r1 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - adds r3, r4, 0 - bl Print - ldr r0, =0x0000270f - cmp r6, r0 - bls _081A1D24 - adds r6, r0, 0 -_081A1D24: - ldr r0, =gStringVar1 - adds r1, r6, 0 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EE302 - adds r0, r4, 0 - bl StringExpandPlaceholders - mov r1, r10 - ldrb r0, [r1] - str r7, [sp] - mov r1, r9 - str r1, [sp, 0x4] - mov r1, r8 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - ldr r3, [sp, 0xC] - bl Print - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A1CD8 - - thumb_func_start sub_81A1D78 -sub_81A1D78: @ 81A1D78 - push {r4,r5,lr} - sub sp, 0x4 - ldr r5, [sp, 0x10] - lsls r0, 24 - lsls r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r5, 24 - lsrs r5, 24 - ldr r4, =gSaveBlock2Ptr - ldr r4, [r4] - lsrs r1, 23 - lsrs r0, 22 - adds r1, r0 - movs r0, 0xCF - lsls r0, 4 - adds r4, r0 - adds r4, r1 - ldrh r1, [r4] - ldr r0, =gUnknown_085EE319 - str r5, [sp] - bl sub_81A1CD8 - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A1D78 - - thumb_func_start sub_81A1DBC -sub_81A1DBC: @ 81A1DBC - push {lr} - lsls r0, 24 - lsls r1, 24 - ldr r2, =gSaveBlock2Ptr - ldr r2, [r2] - lsrs r1, 23 - lsrs r0, 22 - adds r1, r0 - movs r0, 0xCE - lsls r0, 4 - adds r2, r0 - adds r2, r1 - ldrh r0, [r2] - ldr r1, =0x0000270f - cmp r0, r1 - bls _081A1DDE - adds r0, r1, 0 -_081A1DDE: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A1DBC - - thumb_func_start sub_81A1DEC -sub_81A1DEC: @ 81A1DEC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - ldr r4, [sp, 0x20] - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - lsls r3, 24 - lsrs r3, 24 - mov r9, r3 - lsls r4, 24 - lsrs r7, r4, 24 - adds r0, r5, 0 - adds r1, r6, 0 - bl sub_81A1DBC - lsls r0, 16 - lsrs r4, r0, 16 - cmp r5, 0x1 - beq _081A1E38 - cmp r5, 0x1 - ble _081A1E2C - cmp r5, 0x2 - beq _081A1E48 - cmp r5, 0x3 - beq _081A1E58 -_081A1E2C: - cmp r6, 0 - beq _081A1E34 - movs r0, 0x2 - b _081A1E66 -_081A1E34: - movs r0, 0x1 - b _081A1E66 -_081A1E38: - cmp r6, 0 - beq _081A1E42 - movs r0, 0x80 - lsls r0, 8 - b _081A1E66 -_081A1E42: - movs r0, 0x80 - lsls r0, 7 - b _081A1E66 -_081A1E48: - cmp r6, 0 - beq _081A1E52 - movs r0, 0x80 - lsls r0, 10 - b _081A1E66 -_081A1E52: - movs r0, 0x80 - lsls r0, 9 - b _081A1E66 -_081A1E58: - cmp r6, 0 - beq _081A1E62 - movs r0, 0x80 - lsls r0, 12 - b _081A1E66 -_081A1E62: - movs r0, 0x80 - lsls r0, 11 -_081A1E66: - bl sub_81A1C24 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081A1E88 - ldr r0, =gUnknown_085EE311 - str r7, [sp] - adds r1, r4, 0 - mov r2, r8 - mov r3, r9 - bl sub_81A1CD8 - b _081A1E96 - .pool -_081A1E88: - ldr r0, =gUnknown_085EE320 - str r7, [sp] - adds r1, r4, 0 - mov r2, r8 - mov r3, r9 - bl sub_81A1CD8 -_081A1E96: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A1DEC - - thumb_func_start sub_81A1EA8 -sub_81A1EA8: @ 81A1EA8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0xC - lsls r0, 24 - lsrs r7, r0, 24 - ldr r4, =gUnknown_0203AB74 - ldr r0, =gUnknown_08611C74 - bl AddWindow - strb r0, [r4] - ldrb r0, [r4] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r4] - movs r1, 0x11 - bl FillWindowPixelBuffer - cmp r7, 0 - bne _081A1EF0 - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EE158 - bl StringExpandPlaceholders - b _081A1F28 - .pool -_081A1EF0: - cmp r7, 0x1 - bne _081A1F08 - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EE178 - bl StringExpandPlaceholders - b _081A1F28 - .pool -_081A1F08: - cmp r7, 0x2 - bne _081A1F20 - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EE198 - bl StringExpandPlaceholders - b _081A1F28 - .pool -_081A1F20: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EE1B7 - bl StringExpandPlaceholders -_081A1F28: - ldr r0, =gStringVar4 - movs r1, 0x2 - bl sub_81A1C4C - ldr r6, =gUnknown_0203AB74 - ldrb r0, [r6] - ldr r2, =gUnknown_085EE2F2 - movs r1, 0x31 - mov r8, r1 - str r1, [sp] - movs r5, 0xFF - str r5, [sp, 0x4] - movs r4, 0 - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x10 - bl Print - ldrb r0, [r6] - ldr r2, =gUnknown_085EE2F9 - movs r1, 0x61 - mov r9, r1 - str r1, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x10 - bl Print - movs r0, 0xA - bl sub_81A1C90 - mov r0, r8 - str r0, [sp] - adds r0, r7, 0 - movs r1, 0 - movs r2, 0x48 - movs r3, 0x84 - bl sub_81A1DEC - movs r0, 0x41 - str r0, [sp] - adds r0, r7, 0 - movs r1, 0 - movs r2, 0x48 - movs r3, 0x84 - bl sub_81A1D78 - mov r1, r9 - str r1, [sp] - adds r0, r7, 0 - movs r1, 0x1 - movs r2, 0x48 - movs r3, 0x84 - bl sub_81A1DEC - movs r0, 0x71 - str r0, [sp] - adds r0, r7, 0 - movs r1, 0x1 - movs r2, 0x48 - movs r3, 0x84 - bl sub_81A1D78 - ldrb r0, [r6] - bl PutWindowTilemap - ldrb r0, [r6] - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A1EA8 - - thumb_func_start sub_81A1FD8 -sub_81A1FD8: @ 81A1FD8 - push {lr} - lsls r0, 24 - lsls r1, 24 - ldr r2, =gSaveBlock2Ptr - ldr r2, [r2] - lsrs r1, 23 - lsrs r0, 22 - adds r1, r0 - ldr r0, =0x00000d0c - adds r2, r0 - adds r2, r1 - ldrh r0, [r2] - ldr r1, =0x0000270f - cmp r0, r1 - bls _081A1FF8 - adds r0, r1, 0 -_081A1FF8: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A1FD8 - - thumb_func_start sub_81A2008 -sub_81A2008: @ 81A2008 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - mov r12, r0 - adds r7, r1, 0 - adds r4, r2, 0 - ldr r6, [sp, 0x2C] - ldr r5, [sp, 0x30] - lsls r4, 16 - lsrs r4, 16 - lsls r3, 24 - lsrs r3, 24 - lsls r6, 24 - lsrs r6, 24 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_0203AB74 - mov r10, r0 - ldrb r0, [r0] - str r5, [sp] - movs r1, 0xFF - mov r9, r1 - str r1, [sp, 0x4] - movs r1, 0 - mov r8, r1 - str r1, [sp, 0x8] - movs r1, 0x1 - mov r2, r12 - bl Print - ldr r0, =gStringVar1 - adds r1, r4, 0 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - adds r0, r4, 0 - adds r1, r7, 0 - bl StringExpandPlaceholders - mov r1, r10 - ldrb r0, [r1] - str r5, [sp] - mov r1, r9 - str r1, [sp, 0x4] - mov r1, r8 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - adds r3, r6, 0 - bl Print - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2008 - - thumb_func_start sub_81A2094 -sub_81A2094: @ 81A2094 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x8 - ldr r4, [sp, 0x24] - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - lsls r3, 24 - lsrs r7, r3, 24 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - adds r1, r6, 0 - bl sub_81A1FD8 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - cmp r5, 0 - beq _081A20CC - cmp r5, 0x1 - beq _081A20D8 -_081A20CC: - cmp r6, 0 - beq _081A20D4 - movs r0, 0x8 - b _081A20E6 -_081A20D4: - movs r0, 0x4 - b _081A20E6 -_081A20D8: - cmp r6, 0 - beq _081A20E2 - movs r0, 0x80 - lsls r0, 14 - b _081A20E6 -_081A20E2: - movs r0, 0x80 - lsls r0, 13 -_081A20E6: - bl sub_81A1C24 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081A210C - ldr r0, =gUnknown_085EE311 - ldr r1, =gUnknown_085EE338 - str r7, [sp] - str r4, [sp, 0x4] - mov r2, r8 - mov r3, r9 - bl sub_81A2008 - b _081A211C - .pool -_081A210C: - ldr r0, =gUnknown_085EE320 - ldr r1, =gUnknown_085EE338 - str r7, [sp] - str r4, [sp, 0x4] - mov r2, r8 - mov r3, r9 - bl sub_81A2008 -_081A211C: - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2094 - - thumb_func_start sub_81A2134 -sub_81A2134: @ 81A2134 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - lsls r0, 24 - lsrs r7, r0, 24 - ldr r4, =gUnknown_0203AB74 - ldr r0, =gUnknown_08611C74 - bl AddWindow - strb r0, [r4] - ldrb r0, [r4] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r4] - movs r1, 0x11 - bl FillWindowPixelBuffer - cmp r7, 0 - bne _081A217C - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EE1DB - bl StringExpandPlaceholders - b _081A2184 - .pool -_081A217C: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EE1FE - bl StringExpandPlaceholders -_081A2184: - ldr r0, =gStringVar4 - movs r1, 0 - bl sub_81A1C4C - ldr r1, =gUnknown_0203AB74 - ldrb r0, [r1] - ldr r2, =gUnknown_085EE2F2 - movs r6, 0x21 - str r6, [sp] - movs r5, 0xFF - str r5, [sp, 0x4] - movs r4, 0 - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl Print - ldr r1, =gUnknown_0203AB74 - ldrb r0, [r1] - ldr r2, =gUnknown_085EE2F9 - movs r1, 0x61 - str r1, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl Print - movs r0, 0xA - bl sub_81A1C90 - str r6, [sp] - adds r0, r7, 0 - movs r1, 0 - movs r2, 0x40 - movs r3, 0x79 - bl sub_81A2094 - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - lsls r5, r7, 2 - ldr r1, =0x00000d14 - adds r0, r1 - adds r0, r5 - ldrh r2, [r0] - movs r0, 0x79 - mov r9, r0 - str r0, [sp] - movs r0, 0x31 - str r0, [sp, 0x4] - ldr r0, =gUnknown_085EE319 - ldr r1, =gUnknown_085EE338 - movs r3, 0x40 - bl sub_81A2008 - ldr r1, =gUnknown_085EE332 - mov r10, r1 - ldr r0, =gUnknown_085EE349 - mov r8, r0 - ldr r0, [r4] - ldr r1, =0x00000d1c - adds r0, r1 - adds r0, r5 - ldrh r2, [r0] - movs r6, 0x70 - str r6, [sp] - movs r0, 0x41 - str r0, [sp, 0x4] - mov r0, r10 - mov r1, r8 - movs r3, 0x40 - bl sub_81A2008 - movs r0, 0x61 - str r0, [sp] - adds r0, r7, 0 - movs r1, 0x1 - movs r2, 0x40 - movs r3, 0x79 - bl sub_81A2094 - ldr r0, [r4] - ldr r1, =0x00000d16 - adds r0, r1 - adds r0, r5 - ldrh r2, [r0] - mov r0, r9 - str r0, [sp] - movs r0, 0x71 - str r0, [sp, 0x4] - ldr r0, =gUnknown_085EE319 - ldr r1, =gUnknown_085EE338 - movs r3, 0x40 - bl sub_81A2008 - ldr r0, [r4] - ldr r1, =0x00000d1e - adds r0, r1 - adds r0, r5 - ldrh r2, [r0] - str r6, [sp] - movs r0, 0x81 - str r0, [sp, 0x4] - mov r0, r10 - mov r1, r8 - movs r3, 0x40 - bl sub_81A2008 - ldr r1, =gUnknown_0203AB74 - ldrb r0, [r1] - bl PutWindowTilemap - ldr r1, =gUnknown_0203AB74 - ldrb r0, [r1] - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2134 - - thumb_func_start sub_81A22B8 -sub_81A22B8: @ 81A22B8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - adds r5, r0, 0 - adds r4, r2, 0 - ldr r0, [sp, 0x30] - lsls r1, 16 - lsrs r6, r1, 16 - lsls r4, 24 - lsrs r4, 24 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0xC] - lsls r0, 24 - lsrs r0, 24 - adds r7, r0, 0 - ldr r0, =gUnknown_0203AB74 - mov r10, r0 - ldrb r0, [r0] - str r7, [sp] - movs r1, 0xFF - mov r9, r1 - str r1, [sp, 0x4] - movs r1, 0 - mov r8, r1 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - adds r3, r4, 0 - bl Print - ldr r0, =0x0000270f - cmp r6, r0 - bls _081A2304 - adds r6, r0, 0 -_081A2304: - ldr r0, =gStringVar1 - adds r1, r6, 0 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EE302 - adds r0, r4, 0 - bl StringExpandPlaceholders - mov r1, r10 - ldrb r0, [r1] - str r7, [sp] - mov r1, r9 - str r1, [sp, 0x4] - mov r1, r8 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - ldr r3, [sp, 0xC] - bl Print - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A22B8 - - thumb_func_start sub_81A2358 -sub_81A2358: @ 81A2358 - push {r4,r5,lr} - sub sp, 0x4 - ldr r5, [sp, 0x10] - lsls r0, 24 - lsls r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r5, 24 - lsrs r5, 24 - ldr r4, =gSaveBlock2Ptr - ldr r4, [r4] - lsrs r1, 23 - lsrs r0, 22 - adds r1, r0 - movs r0, 0xDD - lsls r0, 4 - adds r4, r0 - adds r4, r1 - ldrh r1, [r4] - ldr r0, =gUnknown_085EE319 - str r5, [sp] - bl sub_81A22B8 - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2358 - - thumb_func_start sub_81A239C -sub_81A239C: @ 81A239C - push {lr} - lsls r0, 24 - lsls r1, 24 - ldr r2, =gSaveBlock2Ptr - ldr r2, [r2] - lsrs r1, 23 - lsrs r0, 22 - adds r1, r0 - ldr r0, =0x00000dc8 - adds r2, r0 - adds r2, r1 - ldrh r0, [r2] - ldr r1, =0x0000270f - cmp r0, r1 - bls _081A23BC - adds r0, r1, 0 -_081A23BC: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A239C - - thumb_func_start sub_81A23CC -sub_81A23CC: @ 81A23CC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - ldr r4, [sp, 0x20] - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - lsls r3, 24 - lsrs r3, 24 - mov r9, r3 - lsls r4, 24 - lsrs r7, r4, 24 - adds r0, r5, 0 - adds r1, r6, 0 - bl sub_81A239C - lsls r0, 16 - lsrs r4, r0, 16 - cmp r5, 0 - beq _081A2404 - cmp r5, 0x1 - beq _081A2410 -_081A2404: - cmp r6, 0 - beq _081A240C - movs r0, 0x20 - b _081A241E -_081A240C: - movs r0, 0x10 - b _081A241E -_081A2410: - cmp r6, 0 - beq _081A241A - movs r0, 0x80 - lsls r0, 16 - b _081A241E -_081A241A: - movs r0, 0x80 - lsls r0, 15 -_081A241E: - bl sub_81A1C24 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081A2440 - ldr r0, =gUnknown_085EE311 - str r7, [sp] - adds r1, r4, 0 - mov r2, r8 - mov r3, r9 - bl sub_81A22B8 - b _081A244E - .pool -_081A2440: - ldr r0, =gUnknown_085EE320 - str r7, [sp] - adds r1, r4, 0 - mov r2, r8 - mov r3, r9 - bl sub_81A22B8 -_081A244E: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A23CC - - thumb_func_start sub_81A2460 -sub_81A2460: @ 81A2460 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0xC - lsls r0, 24 - lsrs r7, r0, 24 - ldr r4, =gUnknown_0203AB74 - ldr r0, =gUnknown_08611C74 - bl AddWindow - strb r0, [r4] - ldrb r0, [r4] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r4] - movs r1, 0x11 - bl FillWindowPixelBuffer - cmp r7, 0 - bne _081A24A8 - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EE221 - bl StringExpandPlaceholders - b _081A24B0 - .pool -_081A24A8: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EE241 - bl StringExpandPlaceholders -_081A24B0: - ldr r0, =gStringVar4 - movs r1, 0x2 - bl sub_81A1C4C - ldr r6, =gUnknown_0203AB74 - ldrb r0, [r6] - ldr r2, =gUnknown_085EE2F2 - movs r1, 0x31 - mov r8, r1 - str r1, [sp] - movs r5, 0xFF - str r5, [sp, 0x4] - movs r4, 0 - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x10 - bl Print - ldrb r0, [r6] - ldr r2, =gUnknown_085EE2F9 - movs r1, 0x61 - mov r9, r1 - str r1, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x10 - bl Print - movs r0, 0xA - bl sub_81A1C90 - mov r0, r8 - str r0, [sp] - adds r0, r7, 0 - movs r1, 0 - movs r2, 0x48 - movs r3, 0x83 - bl sub_81A23CC - movs r0, 0x41 - str r0, [sp] - adds r0, r7, 0 - movs r1, 0 - movs r2, 0x48 - movs r3, 0x83 - bl sub_81A2358 - mov r1, r9 - str r1, [sp] - adds r0, r7, 0 - movs r1, 0x1 - movs r2, 0x48 - movs r3, 0x83 - bl sub_81A23CC - movs r0, 0x71 - str r0, [sp] - adds r0, r7, 0 - movs r1, 0x1 - movs r2, 0x48 - movs r3, 0x83 - bl sub_81A2358 - ldrb r0, [r6] - bl PutWindowTilemap - ldrb r0, [r6] - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2460 - - thumb_func_start sub_81A2560 -sub_81A2560: @ 81A2560 - push {lr} - lsls r0, 24 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - lsrs r0, 23 - ldr r2, =0x00000e04 - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - ldr r1, =0x0000270f - cmp r0, r1 - bls _081A257A - adds r0, r1, 0 -_081A257A: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A2560 - - thumb_func_start sub_81A258C -sub_81A258C: @ 81A258C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - mov r12, r0 - adds r7, r1, 0 - adds r4, r2, 0 - ldr r6, [sp, 0x2C] - ldr r5, [sp, 0x30] - lsls r4, 16 - lsrs r4, 16 - lsls r3, 24 - lsrs r3, 24 - lsls r6, 24 - lsrs r6, 24 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_0203AB74 - mov r10, r0 - ldrb r0, [r0] - str r5, [sp] - movs r1, 0xFF - mov r9, r1 - str r1, [sp, 0x4] - movs r1, 0 - mov r8, r1 - str r1, [sp, 0x8] - movs r1, 0x1 - mov r2, r12 - bl Print - ldr r0, =gStringVar1 - adds r1, r4, 0 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - adds r0, r4, 0 - adds r1, r7, 0 - bl StringExpandPlaceholders - mov r1, r10 - ldrb r0, [r1] - str r5, [sp] - mov r1, r9 - str r1, [sp, 0x4] - mov r1, r8 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - adds r3, r6, 0 - bl Print - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A258C - - thumb_func_start sub_81A2618 -sub_81A2618: @ 81A2618 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - lsls r2, 24 - lsrs r5, r2, 24 - lsls r3, 24 - lsrs r6, r3, 24 - adds r0, r4, 0 - bl sub_81A2560 - lsls r0, 16 - lsrs r7, r0, 16 - cmp r4, 0 - beq _081A2648 - movs r0, 0x80 - lsls r0, 4 - b _081A264C -_081A2648: - movs r0, 0x80 - lsls r0, 3 -_081A264C: - bl sub_81A1C24 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081A2674 - ldr r0, =gUnknown_085EE311 - ldr r1, =gUnknown_085EE35B - str r5, [sp] - str r6, [sp, 0x4] - adds r2, r7, 0 - mov r3, r8 - bl sub_81A2008 - b _081A2684 - .pool -_081A2674: - ldr r0, =gUnknown_085EE320 - ldr r1, =gUnknown_085EE35B - str r5, [sp] - str r6, [sp, 0x4] - adds r2, r7, 0 - mov r3, r8 - bl sub_81A2008 -_081A2684: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2618 - - thumb_func_start sub_81A2698 -sub_81A2698: @ 81A2698 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - ldr r6, =gUnknown_0203AB74 - ldr r0, =gUnknown_08611C74 - bl AddWindow - strb r0, [r6] - ldrb r0, [r6] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r6] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EE261 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0 - bl sub_81A1C4C - ldrb r0, [r6] - ldr r2, =gUnknown_085EE2F2 - movs r1, 0x21 - str r1, [sp] - movs r5, 0xFF - str r5, [sp, 0x4] - movs r4, 0 - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl Print - ldrb r0, [r6] - ldr r2, =gUnknown_085EE2F9 - movs r1, 0x61 - str r1, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl Print - movs r0, 0xA - bl sub_81A1C90 - movs r0, 0 - movs r1, 0x40 - movs r2, 0x72 - movs r3, 0x21 - bl sub_81A2618 - ldr r0, =gUnknown_085EE319 - mov r10, r0 - ldr r7, =gUnknown_085EE35B - ldr r5, =gSaveBlock2Ptr - ldr r0, [r5] - ldr r1, =0x00000e08 - adds r0, r1 - ldrh r2, [r0] - movs r4, 0x72 - str r4, [sp] - movs r0, 0x31 - str r0, [sp, 0x4] - mov r0, r10 - adds r1, r7, 0 - movs r3, 0x40 - bl sub_81A258C - ldr r0, =gUnknown_085EE332 - mov r8, r0 - ldr r1, =gUnknown_085EE36D - mov r9, r1 - ldr r0, [r5] - ldr r1, =0x00000e0c - adds r0, r1 - ldrh r2, [r0] - str r4, [sp] - movs r0, 0x41 - str r0, [sp, 0x4] - mov r0, r8 - mov r1, r9 - movs r3, 0x40 - bl sub_81A258C - movs r0, 0x1 - movs r1, 0x40 - movs r2, 0x72 - movs r3, 0x61 - bl sub_81A2618 - ldr r0, [r5] - ldr r1, =0x00000e0a - adds r0, r1 - ldrh r2, [r0] - str r4, [sp] - movs r0, 0x71 - str r0, [sp, 0x4] - mov r0, r10 - adds r1, r7, 0 - movs r3, 0x40 - bl sub_81A258C - ldr r0, [r5] - ldr r1, =0x00000e0e - adds r0, r1 - ldrh r2, [r0] - str r4, [sp] - movs r0, 0x81 - str r0, [sp, 0x4] - mov r0, r8 - mov r1, r9 - movs r3, 0x40 - bl sub_81A258C - ldrb r0, [r6] - bl PutWindowTilemap - ldrb r0, [r6] - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2698 - - thumb_func_start sub_81A27E8 -sub_81A27E8: @ 81A27E8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - adds r5, r0, 0 - adds r4, r2, 0 - ldr r0, [sp, 0x30] - lsls r1, 16 - lsrs r6, r1, 16 - lsls r4, 24 - lsrs r4, 24 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0xC] - lsls r0, 24 - lsrs r0, 24 - adds r7, r0, 0 - ldr r0, =gUnknown_0203AB74 - mov r10, r0 - ldrb r0, [r0] - str r7, [sp] - movs r1, 0xFF - mov r9, r1 - str r1, [sp, 0x4] - movs r1, 0 - mov r8, r1 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - adds r3, r4, 0 - bl Print - ldr r0, =0x0000270f - cmp r6, r0 - bls _081A2834 - adds r6, r0, 0 -_081A2834: - ldr r0, =gStringVar1 - adds r1, r6, 0 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EE381 - adds r0, r4, 0 - bl StringExpandPlaceholders - mov r1, r10 - ldrb r0, [r1] - str r7, [sp] - mov r1, r9 - str r1, [sp, 0x4] - mov r1, r8 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - ldr r3, [sp, 0xC] - bl Print - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A27E8 - - thumb_func_start sub_81A2888 -sub_81A2888: @ 81A2888 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r1, 0 - adds r5, r2, 0 - lsls r0, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r3, 24 - lsrs r3, 24 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - lsrs r0, 23 - ldr r2, =0x00000dde - adds r1, r2 - adds r1, r0 - ldrh r1, [r1] - ldr r0, =gUnknown_085EE319 - str r3, [sp] - adds r2, r4, 0 - adds r3, r5, 0 - bl sub_81A27E8 - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2888 - - thumb_func_start sub_81A28CC -sub_81A28CC: @ 81A28CC - push {lr} - lsls r0, 24 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - lsrs r0, 23 - ldr r2, =0x00000dda - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - ldr r1, =0x0000270f - cmp r0, r1 - bls _081A28E6 - adds r0, r1, 0 -_081A28E6: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A28CC - - thumb_func_start sub_81A28F8 -sub_81A28F8: @ 81A28F8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - lsls r3, 24 - lsrs r6, r3, 24 - adds r0, r4, 0 - bl sub_81A28CC - lsls r0, 16 - lsrs r5, r0, 16 - cmp r4, 0 - beq _081A2926 - movs r0, 0x80 - b _081A2928 -_081A2926: - movs r0, 0x40 -_081A2928: - bl sub_81A1C24 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081A2948 - ldr r0, =gUnknown_085EE311 - str r6, [sp] - adds r1, r5, 0 - adds r2, r7, 0 - mov r3, r8 - bl sub_81A27E8 - b _081A2956 - .pool -_081A2948: - ldr r0, =gUnknown_085EE320 - str r6, [sp] - adds r1, r5, 0 - adds r2, r7, 0 - mov r3, r8 - bl sub_81A27E8 -_081A2956: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A28F8 - - thumb_func_start sub_81A2968 -sub_81A2968: @ 81A2968 - push {r4-r6,lr} - sub sp, 0xC - ldr r5, =gUnknown_0203AB74 - ldr r0, =gUnknown_08611C74 - bl AddWindow - strb r0, [r5] - ldrb r0, [r5] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r5] - movs r1, 0x11 - bl FillWindowPixelBuffer - movs r0, 0xA - bl sub_81A1C90 - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EE27C - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x2 - bl sub_81A1C4C - ldrb r0, [r5] - ldr r2, =gUnknown_085EE2F2 - movs r1, 0x31 - str r1, [sp] - movs r6, 0xFF - str r6, [sp, 0x4] - movs r4, 0 - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x10 - bl Print - ldrb r0, [r5] - ldr r2, =gUnknown_085EE2F9 - movs r1, 0x61 - str r1, [sp] - str r6, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x10 - bl Print - movs r0, 0 - movs r1, 0x48 - movs r2, 0x7E - movs r3, 0x31 - bl sub_81A28F8 - movs r0, 0 - movs r1, 0x48 - movs r2, 0x7E - movs r3, 0x41 - bl sub_81A2888 - movs r0, 0x1 - movs r1, 0x48 - movs r2, 0x7E - movs r3, 0x61 - bl sub_81A28F8 - movs r0, 0x1 - movs r1, 0x48 - movs r2, 0x7E - movs r3, 0x71 - bl sub_81A2888 - ldrb r0, [r5] - bl PutWindowTilemap - ldrb r0, [r5] - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2968 - - thumb_func_start sub_81A2A28 -sub_81A2A28: @ 81A2A28 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - mov r12, r0 - ldr r4, [sp, 0x38] - ldr r5, [sp, 0x3C] - ldr r0, [sp, 0x40] - lsls r1, 16 - lsrs r7, r1, 16 - lsls r2, 16 - lsrs r2, 16 - str r2, [sp, 0xC] - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - str r4, [sp, 0x10] - lsls r5, 24 - lsrs r5, 24 - str r5, [sp, 0x14] - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0 - ldr r0, =gUnknown_0203AB74 - mov r10, r0 - ldrb r0, [r0] - str r6, [sp] - movs r1, 0xFF - mov r9, r1 - str r1, [sp, 0x4] - movs r1, 0 - mov r8, r1 - str r1, [sp, 0x8] - movs r1, 0x1 - mov r2, r12 - bl Print - ldr r0, =0x0000270f - cmp r7, r0 - bls _081A2A80 - adds r7, r0, 0 -_081A2A80: - ldr r5, =gStringVar1 - adds r0, r5, 0 - adds r1, r7, 0 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EE302 - adds r0, r4, 0 - bl StringExpandPlaceholders - mov r1, r10 - ldrb r0, [r1] - str r6, [sp] - mov r1, r9 - str r1, [sp, 0x4] - mov r1, r8 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - ldr r3, [sp, 0x10] - bl Print - adds r0, r5, 0 - ldr r1, [sp, 0xC] - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r1, =gUnknown_085EE392 - adds r0, r4, 0 - bl StringExpandPlaceholders - mov r1, r10 - ldrb r0, [r1] - str r6, [sp] - mov r1, r9 - str r1, [sp, 0x4] - mov r1, r8 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - ldr r3, [sp, 0x14] - bl Print - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2A28 - - thumb_func_start sub_81A2B04 -sub_81A2B04: @ 81A2B04 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - adds r6, r2, 0 - ldr r4, [sp, 0x24] - ldr r5, [sp, 0x28] - lsls r0, 24 - lsls r1, 24 - lsls r6, 24 - lsrs r6, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - ldr r2, =gSaveBlock2Ptr - ldr r2, [r2] - lsrs r1, 23 - lsrs r0, 22 - adds r1, r0 - ldr r7, =0x00000dea - adds r0, r2, r7 - adds r0, r1 - ldrh r0, [r0] - mov r8, r0 - ldr r0, =0x00000dfa - adds r2, r0 - adds r2, r1 - ldrh r2, [r2] - ldr r0, =gUnknown_085EE319 - str r3, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - mov r1, r8 - adds r3, r6, 0 - bl sub_81A2A28 - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2B04 - - thumb_func_start sub_81A2B70 -sub_81A2B70: @ 81A2B70 - push {lr} - lsls r0, 24 - lsls r1, 24 - ldr r2, =gSaveBlock2Ptr - ldr r2, [r2] - lsrs r1, 23 - lsrs r0, 22 - adds r1, r0 - ldr r0, =0x00000de2 - adds r2, r0 - adds r2, r1 - ldrh r0, [r2] - ldr r1, =0x0000270f - cmp r0, r1 - bls _081A2B90 - adds r0, r1, 0 -_081A2B90: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A2B70 - - thumb_func_start sub_81A2BA0 -sub_81A2BA0: @ 81A2BA0 - push {lr} - lsls r0, 24 - lsls r1, 24 - ldr r2, =gSaveBlock2Ptr - ldr r2, [r2] - lsrs r1, 23 - lsrs r0, 22 - adds r1, r0 - ldr r0, =0x00000df2 - adds r2, r0 - adds r2, r1 - ldrh r0, [r2] - ldr r1, =0x0000270f - cmp r0, r1 - bls _081A2BC0 - adds r0, r1, 0 -_081A2BC0: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A2BA0 - - thumb_func_start sub_81A2BD0 -sub_81A2BD0: @ 81A2BD0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - ldr r4, [sp, 0x30] - ldr r5, [sp, 0x34] - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0xC] - lsls r3, 24 - lsrs r3, 24 - mov r8, r3 - lsls r4, 24 - lsrs r4, 24 - mov r9, r4 - lsls r5, 24 - lsrs r5, 24 - mov r10, r5 - adds r0, r6, 0 - adds r1, r7, 0 - bl sub_81A2B70 - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r6, 0 - adds r1, r7, 0 - bl sub_81A2BA0 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r6, 0 - beq _081A2C20 - cmp r6, 0x1 - beq _081A2C30 -_081A2C20: - cmp r7, 0 - beq _081A2C2A - movs r0, 0x80 - lsls r0, 2 - b _081A2C3E -_081A2C2A: - movs r0, 0x80 - lsls r0, 1 - b _081A2C3E -_081A2C30: - cmp r7, 0 - beq _081A2C3A - movs r0, 0x80 - lsls r0, 18 - b _081A2C3E -_081A2C3A: - movs r0, 0x80 - lsls r0, 17 -_081A2C3E: - bl sub_81A1C24 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081A2C68 - ldr r0, =gUnknown_085EE311 - mov r1, r8 - str r1, [sp] - mov r1, r9 - str r1, [sp, 0x4] - mov r1, r10 - str r1, [sp, 0x8] - adds r1, r5, 0 - adds r2, r4, 0 - ldr r3, [sp, 0xC] - bl sub_81A2A28 - b _081A2C80 - .pool -_081A2C68: - ldr r0, =gUnknown_085EE320 - mov r1, r8 - str r1, [sp] - mov r1, r9 - str r1, [sp, 0x4] - mov r1, r10 - str r1, [sp, 0x8] - adds r1, r5, 0 - adds r2, r4, 0 - ldr r3, [sp, 0xC] - bl sub_81A2A28 -_081A2C80: - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2BD0 - - thumb_func_start sub_81A2C94 -sub_81A2C94: @ 81A2C94 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - lsls r0, 24 - lsrs r7, r0, 24 - ldr r4, =gUnknown_0203AB74 - ldr r0, =gUnknown_08611C74 - bl AddWindow - strb r0, [r4] - ldrb r0, [r4] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r4] - movs r1, 0x11 - bl FillWindowPixelBuffer - cmp r7, 0 - bne _081A2CD8 - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EE298 - bl StringExpandPlaceholders - b _081A2CE0 - .pool -_081A2CD8: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EE2B8 - bl StringExpandPlaceholders -_081A2CE0: - ldr r0, =gStringVar4 - movs r1, 0 - bl sub_81A1C4C - ldr r0, =gUnknown_0203AB74 - mov r8, r0 - ldrb r0, [r0] - ldr r2, =gUnknown_085EE2F2 - movs r6, 0x21 - str r6, [sp] - movs r5, 0xFF - str r5, [sp, 0x4] - movs r4, 0 - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl Print - mov r1, r8 - ldrb r0, [r1] - ldr r2, =gUnknown_085EE326 - str r6, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x98 - bl Print - mov r1, r8 - ldrb r0, [r1] - ldr r2, =gUnknown_085EE2F9 - movs r1, 0x61 - str r1, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl Print - movs r0, 0xA - bl sub_81A1C90 - movs r4, 0x9E - str r4, [sp] - movs r0, 0x31 - str r0, [sp, 0x4] - adds r0, r7, 0 - movs r1, 0 - movs r2, 0x8 - movs r3, 0x40 - bl sub_81A2BD0 - str r4, [sp] - movs r0, 0x41 - str r0, [sp, 0x4] - adds r0, r7, 0 - movs r1, 0 - movs r2, 0x8 - movs r3, 0x40 - bl sub_81A2B04 - str r4, [sp] - movs r0, 0x71 - str r0, [sp, 0x4] - adds r0, r7, 0 - movs r1, 0x1 - movs r2, 0x8 - movs r3, 0x40 - bl sub_81A2BD0 - str r4, [sp] - movs r0, 0x81 - str r0, [sp, 0x4] - adds r0, r7, 0 - movs r1, 0x1 - movs r2, 0x8 - movs r3, 0x40 - bl sub_81A2B04 - mov r1, r8 - ldrb r0, [r1] - bl PutWindowTilemap - mov r1, r8 - ldrb r0, [r1] - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2C94 - - thumb_func_start sub_81A2DB4 -sub_81A2DB4: @ 81A2DB4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - adds r5, r0, 0 - adds r4, r2, 0 - ldr r0, [sp, 0x30] - lsls r1, 16 - lsrs r6, r1, 16 - lsls r4, 24 - lsrs r4, 24 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0xC] - lsls r0, 24 - lsrs r0, 24 - adds r7, r0, 0 - ldr r0, =gUnknown_0203AB74 - mov r10, r0 - ldrb r0, [r0] - str r7, [sp] - movs r1, 0xFF - mov r9, r1 - str r1, [sp, 0x4] - movs r1, 0 - mov r8, r1 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - adds r3, r4, 0 - bl Print - ldr r0, =0x0000270f - cmp r6, r0 - bls _081A2E00 - adds r6, r0, 0 -_081A2E00: - ldr r0, =gStringVar1 - adds r1, r6, 0 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EE39C - adds r0, r4, 0 - bl StringExpandPlaceholders - mov r1, r10 - ldrb r0, [r1] - str r7, [sp] - mov r1, r9 - str r1, [sp, 0x4] - mov r1, r8 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - ldr r3, [sp, 0xC] - bl Print - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2DB4 - - thumb_func_start sub_81A2E54 -sub_81A2E54: @ 81A2E54 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r1, 0 - adds r5, r2, 0 - lsls r0, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r3, 24 - lsrs r3, 24 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - lsrs r0, 23 - ldr r2, =0x00000e1e - adds r1, r2 - adds r1, r0 - ldrh r1, [r1] - ldr r0, =gUnknown_085EE319 - str r3, [sp] - adds r2, r4, 0 - adds r3, r5, 0 - bl sub_81A2DB4 - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2E54 - - thumb_func_start sub_81A2E98 -sub_81A2E98: @ 81A2E98 - push {lr} - lsls r0, 24 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - lsrs r0, 23 - ldr r2, =0x00000e1a - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - ldr r1, =0x0000270f - cmp r0, r1 - bls _081A2EB2 - adds r0, r1, 0 -_081A2EB2: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A2E98 - - thumb_func_start sub_81A2EC4 -sub_81A2EC4: @ 81A2EC4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - lsls r3, 24 - lsrs r6, r3, 24 - adds r0, r4, 0 - bl sub_81A2E98 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r4, 0 - beq _081A2EF4 - movs r0, 0x80 - lsls r0, 6 - b _081A2EF8 -_081A2EF4: - movs r0, 0x80 - lsls r0, 5 -_081A2EF8: - bl sub_81A1C24 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081A2F18 - ldr r0, =gUnknown_085EE311 - str r6, [sp] - adds r1, r5, 0 - adds r2, r7, 0 - mov r3, r8 - bl sub_81A2DB4 - b _081A2F26 - .pool -_081A2F18: - ldr r0, =gUnknown_085EE320 - str r6, [sp] - adds r1, r5, 0 - adds r2, r7, 0 - mov r3, r8 - bl sub_81A2DB4 -_081A2F26: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2EC4 - - thumb_func_start sub_81A2F38 -sub_81A2F38: @ 81A2F38 - push {r4-r6,lr} - sub sp, 0xC - ldr r5, =gUnknown_0203AB74 - ldr r0, =gUnknown_08611C74 - bl AddWindow - strb r0, [r5] - ldrb r0, [r5] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r5] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EE2D8 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x2 - bl sub_81A1C4C - ldrb r0, [r5] - ldr r2, =gUnknown_085EE2F2 - movs r1, 0x31 - str r1, [sp] - movs r6, 0xFF - str r6, [sp, 0x4] - movs r4, 0 - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl Print - ldrb r0, [r5] - ldr r2, =gUnknown_085EE2F9 - movs r1, 0x61 - str r1, [sp] - str r6, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl Print - movs r0, 0xA - bl sub_81A1C90 - movs r0, 0 - movs r1, 0x40 - movs r2, 0x6F - movs r3, 0x31 - bl sub_81A2EC4 - movs r0, 0 - movs r1, 0x40 - movs r2, 0x6F - movs r3, 0x41 - bl sub_81A2E54 - movs r0, 0x1 - movs r1, 0x40 - movs r2, 0x6F - movs r3, 0x61 - bl sub_81A2EC4 - movs r0, 0x1 - movs r1, 0x40 - movs r2, 0x6F - movs r3, 0x71 - bl sub_81A2E54 - ldrb r0, [r5] - bl PutWindowTilemap - ldrb r0, [r5] - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2F38 - - thumb_func_start sub_81A2FF8 -sub_81A2FF8: @ 81A2FF8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0xC - ldr r4, =gUnknown_0203AB74 - ldr r0, =gUnknown_08611C7C - bl AddWindow - strb r0, [r4] - ldrb r0, [r4] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r4] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, =gStringVar4 - mov r9, r0 - ldr r1, =gUnknown_085EDF86 - bl StringExpandPlaceholders - movs r0, 0x1 - mov r1, r9 - movs r2, 0xD0 - bl GetStringCenterAlignXOffset - adds r3, r0, 0 - ldrb r0, [r4] - lsls r3, 24 - lsrs r3, 24 - movs r1, 0x1 - str r1, [sp] - movs r6, 0xFF - str r6, [sp, 0x4] - movs r5, 0 - str r5, [sp, 0x8] - mov r2, r9 - bl Print - ldr r7, =gUnknown_085EDFA0 - movs r0, 0x1 - adds r1, r7, 0 - movs r2, 0x26 - bl GetStringRightAlignXOffset - adds r3, r0, 0 - adds r3, 0x32 - ldrb r0, [r4] - lsls r3, 24 - lsrs r3, 24 - movs r1, 0x19 - mov r8, r1 - str r1, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x1 - adds r2, r7, 0 - bl Print - ldr r7, =gUnknown_085EDFA4 - movs r0, 0x1 - adds r1, r7, 0 - movs r2, 0x26 - bl GetStringRightAlignXOffset - adds r3, r0, 0 - adds r3, 0x58 - ldrb r0, [r4] - lsls r3, 24 - lsrs r3, 24 - mov r2, r8 - str r2, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x1 - adds r2, r7, 0 - bl Print - ldr r7, =gUnknown_085EDFA8 - movs r0, 0x1 - adds r1, r7, 0 - movs r2, 0x26 - bl GetStringRightAlignXOffset - adds r3, r0, 0 - adds r3, 0x7E - ldrb r0, [r4] - lsls r3, 24 - lsrs r3, 24 - mov r1, r8 - str r1, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x1 - adds r2, r7, 0 - bl Print - ldr r7, =gUnknown_085EDFAC - movs r0, 0x1 - adds r1, r7, 0 - movs r2, 0x26 - bl GetStringRightAlignXOffset - adds r3, r0, 0 - adds r3, 0xA4 - ldrb r0, [r4] - lsls r3, 24 - lsrs r3, 24 - mov r2, r8 - str r2, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x1 - adds r2, r7, 0 - bl Print - ldrb r0, [r4] - ldr r2, =gUnknown_085EB0E8 - movs r1, 0x29 - str r1, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x6 - bl Print - ldrb r0, [r4] - ldr r2, =gUnknown_085EB0ED - movs r1, 0x39 - str r1, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x6 - bl Print - ldrb r0, [r4] - ldr r2, =gUnknown_085EB0F4 - movs r1, 0x49 - str r1, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x6 - bl Print - ldrb r0, [r4] - ldr r2, =gUnknown_085EB0F9 - movs r1, 0x59 - str r1, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x6 - bl Print - ldrb r0, [r4] - ldr r2, =gUnknown_085EB0FF - movs r1, 0x69 - str r1, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x6 - bl Print - movs r1, 0 -_081A314A: - movs r5, 0 - adds r0, r1, 0x1 - mov r8, r0 - lsls r0, r1, 28 - movs r2, 0xA4 - lsls r2, 22 - adds r0, r2 - lsrs r7, r0, 24 - lsls r4, r1, 3 -_081A315C: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000624 - adds r0, r1 - adds r0, r4 - ldrh r1, [r0] - mov r0, r9 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r6, =gUnknown_0203AB74 - ldrb r0, [r6] - movs r1, 0x26 - adds r3, r5, 0 - muls r3, r1 - adds r3, 0x40 - lsls r3, 24 - lsrs r3, 24 - str r7, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - mov r2, r9 - bl Print - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _081A315C - mov r1, r8 - cmp r1, 0x4 - ble _081A314A - ldrb r0, [r6] - bl PutWindowTilemap - ldrb r0, [r6] - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A2FF8 - - thumb_func_start sub_81A31FC -sub_81A31FC: @ 81A31FC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r7, r0, 30 - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - cmp r4, 0x6 - bls _081A3232 - b _081A35CE -_081A3232: - lsls r0, r4, 2 - ldr r1, =_081A3250 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A3250: - .4byte _081A326C - .4byte _081A33A8 - .4byte _081A3414 - .4byte _081A347C - .4byte _081A34CC - .4byte _081A354C - .4byte _081A3594 -_081A326C: - ldr r2, =gSaveBlock2Ptr - mov r9, r2 - ldr r0, [r2] - lsls r3, r7, 1 - mov r10, r3 - mov r2, r8 - lsls r1, r2, 2 - add r1, r10 - str r1, [sp, 0x20] - movs r3, 0xCE - lsls r3, 4 - adds r1, r0, r3 - ldr r2, [sp, 0x20] - adds r1, r2 - adds r3, 0x10 - adds r0, r3 - adds r0, r2 - ldrh r1, [r1] - ldrh r2, [r0] - cmp r1, r2 - bhi _081A3298 - b _081A35CE -_081A3298: - strh r1, [r0] - mov r3, r8 - cmp r3, 0x3 - bne _081A32F2 - ldr r6, =gBattleScripting - adds r6, 0x25 - ldrb r0, [r6] - movs r4, 0x1 - eors r0, r4 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - ldr r5, =gUnknown_020229F0 - adds r1, r5 - mov r0, sp - bl StringCopy - mov r0, sp - bl StripExtCtrlCodes - lsls r1, r7, 3 - ldr r0, =0x00000ee1 - adds r1, r0 - mov r2, r9 - ldr r0, [r2] - adds r0, r1 - mov r1, sp - bl StringCopy - ldrb r0, [r6] - eors r4, r0 - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - subs r5, 0x4 - adds r0, r5 - ldr r0, [r0] - lsls r2, r7, 2 - ldr r1, =0x00000ef1 - adds r2, r1 - mov r3, r9 - ldr r1, [r3] - adds r1, r2 - bl write_word_to_mem -_081A32F2: - mov r7, r9 - ldr r0, [r7] - movs r1, 0xCE - lsls r1, 4 - adds r0, r1 - ldr r2, [sp, 0x20] - adds r0, r2 - ldrh r0, [r0] - cmp r0, 0x1 - bhi _081A3308 - b _081A35CE -_081A3308: - bl sub_80EE818 - lsls r0, 24 - cmp r0, 0 - bne _081A3314 - b _081A35CE -_081A3314: - mov r3, r8 - cmp r3, 0x1 - beq _081A335A - cmp r3, 0x1 - bgt _081A3338 - cmp r3, 0 - beq _081A3344 - b _081A35CE - .pool -_081A3338: - mov r7, r8 - cmp r7, 0x2 - beq _081A3374 - cmp r7, 0x3 - beq _081A338E - b _081A35CE -_081A3344: - mov r1, r9 - ldr r0, [r1] - movs r2, 0xCE - lsls r2, 4 - adds r0, r2 - add r0, r10 - ldrh r0, [r0] - movs r1, 0x1 - bl sub_80EE8C8 - b _081A35CE -_081A335A: - mov r3, r9 - ldr r0, [r3] - mov r1, r10 - adds r1, 0x4 - movs r7, 0xCE - lsls r7, 4 - adds r0, r7 - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x2 - bl sub_80EE8C8 - b _081A35CE -_081A3374: - mov r1, r9 - ldr r0, [r1] - mov r1, r10 - adds r1, 0x8 - movs r2, 0xCE - lsls r2, 4 - adds r0, r2 - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x3 - bl sub_80EE8C8 - b _081A35CE -_081A338E: - mov r3, r9 - ldr r0, [r3] - mov r1, r10 - adds r1, 0xC - movs r7, 0xCE - lsls r7, 4 - adds r0, r7 - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x4 - bl sub_80EE8C8 - b _081A35CE -_081A33A8: - ldr r6, =gSaveBlock2Ptr - ldr r0, [r6] - lsls r7, 1 - mov r2, r8 - lsls r1, r2, 2 - adds r4, r7, r1 - ldr r5, =0x00000d0c - adds r1, r0, r5 - adds r1, r4 - ldr r3, =0x00000d14 - adds r0, r3 - adds r0, r4 - ldrh r2, [r1] - ldrh r3, [r0] - cmp r2, r3 - bhi _081A33CA - b _081A35CE -_081A33CA: - strh r2, [r0] - ldrh r0, [r1] - cmp r0, 0x1 - bhi _081A33D4 - b _081A35CE -_081A33D4: - bl sub_80EE818 - lsls r0, 24 - cmp r0, 0 - bne _081A33E0 - b _081A35CE -_081A33E0: - mov r0, r8 - cmp r0, 0 - bne _081A3404 - ldr r0, [r6] - adds r0, r5 - adds r0, r7 - ldrh r0, [r0] - movs r1, 0x5 - bl sub_80EE8C8 - b _081A35CE - .pool -_081A3404: - ldr r0, [r6] - adds r0, r5 - adds r0, r4 - ldrh r0, [r0] - movs r1, 0x6 - bl sub_80EE8C8 - b _081A35CE -_081A3414: - ldr r6, =gSaveBlock2Ptr - ldr r0, [r6] - lsls r7, 1 - mov r2, r8 - lsls r1, r2, 2 - adds r4, r7, r1 - ldr r5, =0x00000dc8 - adds r1, r0, r5 - adds r1, r4 - movs r3, 0xDD - lsls r3, 4 - adds r0, r3 - adds r0, r4 - ldrh r2, [r1] - ldrh r3, [r0] - cmp r2, r3 - bhi _081A3438 - b _081A35CE -_081A3438: - strh r2, [r0] - ldrh r0, [r1] - cmp r0, 0x1 - bhi _081A3442 - b _081A35CE -_081A3442: - bl sub_80EE818 - lsls r0, 24 - cmp r0, 0 - bne _081A344E - b _081A35CE -_081A344E: - mov r0, r8 - cmp r0, 0 - bne _081A346C - ldr r0, [r6] - adds r0, r5 - adds r0, r7 - ldrh r0, [r0] - movs r1, 0xB - bl sub_80EE8C8 - b _081A35CE - .pool -_081A346C: - ldr r0, [r6] - adds r0, r5 - adds r0, r4 - ldrh r0, [r0] - movs r1, 0xC - bl sub_80EE8C8 - b _081A35CE -_081A347C: - ldr r6, =gSaveBlock2Ptr - ldr r1, [r6] - lsls r4, r7, 1 - ldr r5, =0x00000dda - adds r0, r1, r5 - adds r0, r4 - ldr r2, =0x00000dde - adds r1, r2 - adds r1, r4 - ldrh r2, [r0] - ldrh r3, [r1] - cmp r2, r3 - bhi _081A3498 - b _081A35CE -_081A3498: - strh r2, [r1] - ldrh r0, [r0] - cmp r0, 0x1 - bhi _081A34A2 - b _081A35CE -_081A34A2: - bl sub_80EE818 - lsls r0, 24 - cmp r0, 0 - bne _081A34AE - b _081A35CE -_081A34AE: - ldr r0, [r6] - adds r0, r5 - adds r0, r4 - ldrh r0, [r0] - movs r1, 0xA - bl sub_80EE8C8 - b _081A35CE - .pool -_081A34CC: - ldr r6, =gSaveBlock2Ptr - ldr r2, [r6] - lsls r7, 1 - mov r9, r7 - mov r7, r8 - lsls r0, r7, 2 - mov r1, r9 - adds r4, r1, r0 - ldr r5, =0x00000de2 - adds r0, r2, r5 - adds r3, r0, r4 - ldr r7, =0x00000dea - adds r0, r2, r7 - adds r0, r4 - ldrh r1, [r3] - ldrh r7, [r0] - cmp r1, r7 - bls _081A35CE - strh r1, [r0] - ldr r0, =0x00000dfa - adds r1, r2, r0 - adds r1, r4 - ldr r7, =0x00000df2 - adds r0, r2, r7 - adds r0, r4 - ldrh r0, [r0] - strh r0, [r1] - ldrh r0, [r3] - cmp r0, 0x1 - bls _081A35CE - bl sub_80EE818 - lsls r0, 24 - cmp r0, 0 - beq _081A35CE - mov r0, r8 - cmp r0, 0 - bne _081A353C - ldr r0, [r6] - adds r0, r5 - add r0, r9 - ldrh r0, [r0] - movs r1, 0x7 - bl sub_80EE8C8 - b _081A35CE - .pool -_081A353C: - ldr r0, [r6] - adds r0, r5 - adds r0, r4 - ldrh r0, [r0] - movs r1, 0x8 - bl sub_80EE8C8 - b _081A35CE -_081A354C: - ldr r6, =gSaveBlock2Ptr - ldr r1, [r6] - lsls r4, r7, 1 - ldr r5, =0x00000e04 - adds r0, r1, r5 - adds r0, r4 - ldr r2, =0x00000e08 - adds r1, r2 - adds r1, r4 - ldrh r2, [r0] - ldrh r3, [r1] - cmp r2, r3 - bls _081A35CE - strh r2, [r1] - ldrh r0, [r0] - cmp r0, 0x1 - bls _081A35CE - bl sub_80EE818 - lsls r0, 24 - cmp r0, 0 - beq _081A35CE - ldr r0, [r6] - adds r0, r5 - adds r0, r4 - ldrh r0, [r0] - movs r1, 0x9 - bl sub_80EE8C8 - b _081A35CE - .pool -_081A3594: - ldr r6, =gSaveBlock2Ptr - ldr r1, [r6] - lsls r4, r7, 1 - ldr r5, =0x00000e1a - adds r0, r1, r5 - adds r0, r4 - ldr r7, =0x00000e1e - adds r1, r7 - adds r1, r4 - ldrh r2, [r0] - ldrh r3, [r1] - cmp r2, r3 - bls _081A35CE - strh r2, [r1] - ldrh r0, [r0] - cmp r0, 0x1 - bls _081A35CE - bl sub_80EE818 - lsls r0, 24 - cmp r0, 0 - beq _081A35CE - ldr r0, [r6] - adds r0, r5 - adds r0, r4 - ldrh r0, [r0] - movs r1, 0xD - bl sub_80EE8C8 -_081A35CE: - add sp, 0x24 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A31FC - - thumb_func_start sub_81A35EC -sub_81A35EC: @ 81A35EC - push {r4,lr} - ldr r0, =0x000040cf - bl VarGet - ldr r4, =gScriptResult - bl sub_81A3610 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A35EC - - thumb_func_start sub_81A3610 -sub_81A3610: @ 81A3610 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r0, 0 - mov r8, r0 - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, =0x000040ce - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - bl sub_81A39C4 - lsls r0, 16 - ldr r1, =gUnknown_08611550 - mov r9, r1 - lsls r7, r6, 2 - adds r1, 0x3 - adds r1, r7, r1 - lsrs r0, 16 - ldrb r1, [r1] - adds r5, r0, r1 - cmp r4, 0 - beq _081A365C - movs r0, 0 - b _081A36C2 - .pool -_081A365C: - lsls r0, r6, 24 - lsrs r0, 24 - bl sub_81A3B30 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - blt _081A3680 - cmp r1, 0x1 - bgt _081A3680 - adds r0, r1, r7 - add r0, r9 - ldrb r0, [r0] - cmp r5, r0 - bne _081A36BC - adds r1, 0x1 - mov r8, r1 - b _081A36BC -_081A3680: - ldr r1, =gUnknown_08611550 - lsls r2, r6, 2 - adds r0, r2, r1 - ldrb r0, [r0] - cmp r5, r0 - bne _081A3694 - movs r0, 0x3 - b _081A36BA - .pool -_081A3694: - adds r0, r1, 0x1 - adds r0, r2, r0 - ldrb r0, [r0] - cmp r5, r0 - bne _081A36A4 - movs r1, 0x4 - mov r8, r1 - b _081A36BC -_081A36A4: - cmp r5, r0 - ble _081A36BC - subs r0, r5, r0 - adds r1, 0x2 - adds r1, r2, r1 - ldrb r1, [r1] - bl __modsi3 - cmp r0, 0 - bne _081A36BC - movs r0, 0x4 -_081A36BA: - mov r8, r0 -_081A36BC: - mov r1, r8 - lsls r0, r1, 24 - lsrs r0, 24 -_081A36C2: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81A3610 - - thumb_func_start sub_81A36D0 -sub_81A36D0: @ 81A36D0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - adds r2, r0, 0 - lsls r1, 16 - lsrs r3, r1, 16 - cmp r0, 0x1 - beq _081A3766 - cmp r0, 0x1 - bgt _081A36EA - cmp r0, 0 - beq _081A36F2 - b _081A38F8 -_081A36EA: - cmp r2, 0x2 - bne _081A36F0 - b _081A3818 -_081A36F0: - b _081A38F8 -_081A36F2: - movs r0, 0xFA - lsls r0, 1 - cmp r3, r0 - bne _081A370C - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000bfc - b _081A38C4 - .pool -_081A370C: - ldr r0, =0x000003fe - cmp r3, r0 - beq _081A3786 - ldr r0, =0x0000012b - cmp r3, r0 - bhi _081A3738 - ldr r2, =gUnknown_0203BC88 - movs r0, 0x34 - adds r1, r3, 0 - muls r1, r0 - ldr r0, [r2] - adds r0, r1 - adds r0, 0xC - bl ConvertBattleFrontierTrainerSpeechToString - b _081A38F8 - .pool -_081A3738: - ldr r0, =0x0000018f - cmp r3, r0 - bhi _081A3758 - ldr r1, =gSaveBlock2Ptr - movs r0, 0xEC - muls r0, r3 - ldr r1, [r1] - adds r0, r1 - ldr r1, =0xfffef2b8 - b _081A38C4 - .pool -_081A3758: - adds r0, r3, 0 - adds r0, 0x70 - lsls r0, 24 - lsrs r0, 24 - bl sub_819F99C - b _081A38F8 -_081A3766: - movs r0, 0xFA - lsls r0, 1 - cmp r3, r0 - bne _081A3780 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000c08 - b _081A38C4 - .pool -_081A3780: - ldr r0, =0x000003fe - cmp r3, r0 - bne _081A3794 -_081A3786: - movs r0, 0 - bl sub_81A51A8 - b _081A38F8 - .pool -_081A3794: - ldr r0, =0x0000012b - cmp r3, r0 - bhi _081A37B8 - ldr r2, =gUnknown_0203BC88 - movs r0, 0x34 - adds r1, r3, 0 - muls r1, r0 - ldr r0, [r2] - adds r0, r1 - adds r0, 0x18 - bl ConvertBattleFrontierTrainerSpeechToString - b _081A38F8 - .pool -_081A37B8: - ldr r0, =0x0000018f - cmp r3, r0 - bhi _081A37EC - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - bne _081A387C - ldr r1, =gSaveBlock2Ptr - movs r0, 0xEC - muls r0, r3 - ldr r1, [r1] - adds r0, r1 - ldr r1, =0xfffef2c4 - b _081A38C4 - .pool -_081A37EC: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - bne _081A387C - ldr r1, =gSaveBlock2Ptr - lsls r0, r3, 4 - adds r0, r3 - lsls r0, 2 - ldr r1, [r1] - adds r0, r1 - ldr r1, =0xffff96c4 - b _081A38C4 - .pool -_081A3818: - movs r0, 0xFA - lsls r0, 1 - cmp r3, r0 - bne _081A3830 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000c14 - b _081A38C4 - .pool -_081A3830: - ldr r0, =0x000003fe - cmp r3, r0 - bne _081A3844 - movs r0, 0x1 - bl sub_81A51A8 - b _081A38F8 - .pool -_081A3844: - ldr r0, =0x0000012b - cmp r3, r0 - bhi _081A3868 - ldr r2, =gUnknown_0203BC88 - movs r0, 0x34 - adds r1, r3, 0 - muls r1, r0 - ldr r0, [r2] - adds r0, r1 - adds r0, 0x24 - bl ConvertBattleFrontierTrainerSpeechToString - b _081A38F8 - .pool -_081A3868: - ldr r0, =0x0000018f - cmp r3, r0 - bhi _081A38A8 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _081A3890 -_081A387C: - bl sub_81864E0 - bl ConvertBattleFrontierTrainerSpeechToString - b _081A38F8 - .pool -_081A3890: - ldr r1, =gSaveBlock2Ptr - movs r0, 0xEC - muls r0, r3 - ldr r1, [r1] - adds r0, r1 - ldr r1, =0xfffef2d0 - b _081A38C4 - .pool -_081A38A8: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _081A38D4 - bl sub_81864A8 - lsls r0, 24 - lsrs r3, r0, 24 - movs r0, 0x58 - muls r0, r3 - ldr r1, =gUnknown_086109BA -_081A38C4: - adds r0, r1 - bl ConvertBattleFrontierTrainerSpeechToString - b _081A38F8 - .pool -_081A38D4: - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r0, =0xfffffe70 - adds r2, r3, r0 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r1, r0 - adds r1, 0xDC - ldrb r0, [r1] - lsls r0, 27 - lsrs r3, r0, 27 - movs r0, 0x58 - muls r0, r3 - ldr r1, =gUnknown_086109BA - adds r0, r1 - bl ConvertBattleFrontierTrainerSpeechToString -_081A38F8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A36D0 - - thumb_func_start sub_81A3908 -sub_81A3908: @ 81A3908 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r2, =0x00000cdc - adds r1, r2 - movs r2, 0 - str r2, [r1] - movs r4, 0 - mov r9, r0 - mov r8, r9 - movs r6, 0 -_081A3926: - movs r5, 0 - lsls r7, r4, 2 - mov r10, r7 - adds r0, r4, 0x1 - mov r12, r0 -_081A3930: - mov r1, r8 - ldr r2, [r1] - lsls r3, r5, 1 - mov r7, r10 - adds r1, r3, r7 - movs r7, 0xCE - lsls r7, 4 - adds r0, r2, r7 - adds r0, r1 - strh r6, [r0] - cmp r4, 0x1 - bgt _081A3960 - adds r7, 0x2C - adds r0, r2, r7 - adds r0, r1 - strh r6, [r0] - adds r7, 0xBC - adds r0, r2, r7 - adds r0, r1 - strh r6, [r0] - adds r7, 0x1A - adds r0, r2, r7 - adds r0, r1 - strh r6, [r0] -_081A3960: - cmp r4, 0 - bne _081A3980 - mov r1, r8 - ldr r0, [r1] - ldr r2, =0x00000dda - adds r1, r0, r2 - adds r1, r3 - strh r4, [r1] - ldr r7, =0x00000e04 - adds r1, r0, r7 - adds r1, r3 - strh r4, [r1] - ldr r1, =0x00000e1a - adds r0, r1 - adds r0, r3 - strh r4, [r0] -_081A3980: - adds r5, 0x1 - cmp r5, 0x1 - ble _081A3930 - mov r4, r12 - cmp r4, 0x3 - ble _081A3926 - mov r2, r9 - ldr r0, [r2] - ldr r7, =0x00000ca8 - adds r1, r0, r7 - ldrb r0, [r1] - cmp r0, 0 - beq _081A399E - movs r0, 0x1 - strb r0, [r1] -_081A399E: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A3908 - - thumb_func_start sub_81A39C4 -sub_81A39C4: @ 81A39C4 - push {r4,r5,lr} - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r4, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x6 - bhi _081A3AC4 - lsls r0, 2 - ldr r1, =_081A3A0C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A3A0C: - .4byte _081A3A28 - .4byte _081A3A3C - .4byte _081A3A54 - .4byte _081A3A6C - .4byte _081A3A80 - .4byte _081A3A98 - .4byte _081A3AAC -_081A3A28: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - lsls r2, r5, 2 - adds r1, r2 - movs r2, 0xCE - lsls r2, 4 - b _081A3AB4 - .pool -_081A3A3C: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - lsls r2, r5, 2 - adds r1, r2 - ldr r2, =0x00000d0c - b _081A3AB4 - .pool -_081A3A54: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - lsls r2, r5, 2 - adds r1, r2 - ldr r2, =0x00000dc8 - b _081A3AB4 - .pool -_081A3A6C: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - ldr r2, =0x00000dda - b _081A3AB4 - .pool -_081A3A80: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - lsls r2, r5, 2 - adds r1, r2 - ldr r2, =0x00000de2 - b _081A3AB4 - .pool -_081A3A98: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - ldr r2, =0x00000e04 - b _081A3AB4 - .pool -_081A3AAC: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - ldr r2, =0x00000e1a -_081A3AB4: - adds r0, r2 - adds r0, r1 - ldrh r0, [r0] - b _081A3AC6 - .pool -_081A3AC4: - movs r0, 0 -_081A3AC6: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81A39C4 - - thumb_func_start sub_81A3ACC -sub_81A3ACC: @ 81A3ACC - push {r4,r5,lr} - movs r2, 0 - ldr r5, =gSaveBlock2Ptr - ldr r4, =0x00000cb4 - ldr r0, =0x0000ffff - adds r3, r0, 0 -_081A3AD8: - ldr r0, [r5] - lsls r1, r2, 1 - adds r0, r4 - adds r0, r1 - ldrh r1, [r0] - orrs r1, r3 - strh r1, [r0] - adds r2, 0x1 - cmp r2, 0x13 - ble _081A3AD8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A3ACC - - thumb_func_start sub_81A3B00 -sub_81A3B00: @ 81A3B00 - push {lr} - ldr r0, =gUnknown_02038BCA - ldrh r1, [r0] - ldr r0, =0x000003fe - cmp r1, r0 - bne _081A3B20 - ldr r1, =gScriptResult - movs r0, 0x1 - b _081A3B24 - .pool -_081A3B20: - ldr r1, =gScriptResult - movs r0, 0 -_081A3B24: - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A3B00 - - thumb_func_start sub_81A3B30 -sub_81A3B30: @ 81A3B30 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 23 - ldr r1, =0x000008c4 - adds r0, r4, r1 - bl FlagGet - adds r5, r0, 0 - ldr r0, =0x000008c5 - adds r4, r0 - adds r0, r4, 0 - bl FlagGet - adds r5, r0 - lsls r5, 24 - lsrs r5, 24 - adds r0, r5, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A3B30 - - thumb_func_start sub_81A3B64 -sub_81A3B64: @ 81A3B64 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r5, 0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r4, r0, 30 - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r7, r0, 16 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r6, r0, 16 - cmp r7, 0x6 - bhi _081A3C78 - lsls r0, r7, 2 - ldr r1, =_081A3BB4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A3BB4: - .4byte _081A3BD0 - .4byte _081A3BE4 - .4byte _081A3C00 - .4byte _081A3C18 - .4byte _081A3C2C - .4byte _081A3C44 - .4byte _081A3C60 -_081A3BD0: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - lsls r2, r6, 2 - adds r1, r2 - movs r2, 0xCE - lsls r2, 4 - b _081A3C68 - .pool -_081A3BE4: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - lsls r2, r6, 2 - adds r1, r2 - ldr r2, =0x00000d0c - adds r0, r2 - adds r0, r1 - ldrh r5, [r0] - b _081A3C78 - .pool -_081A3C00: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - lsls r2, r6, 2 - adds r1, r2 - ldr r2, =0x00000dc8 - b _081A3C68 - .pool -_081A3C18: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - ldr r2, =0x00000dda - b _081A3C68 - .pool -_081A3C2C: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - lsls r2, r6, 2 - adds r1, r2 - ldr r2, =0x00000de2 - b _081A3C68 - .pool -_081A3C44: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - ldr r2, =0x00000e04 - adds r0, r2 - adds r0, r1 - ldrh r0, [r0] - movs r1, 0xE - b _081A3C70 - .pool -_081A3C60: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - ldr r2, =0x00000e1a -_081A3C68: - adds r0, r2 - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x7 -_081A3C70: - bl __udivsi3 - lsls r0, 16 - lsrs r5, r0, 16 -_081A3C78: - cmp r5, 0 - beq _081A3C7E - subs r5, 0x1 -_081A3C7E: - cmp r5, 0x1D - bls _081A3C84 - movs r5, 0x1D -_081A3C84: - ldr r2, =gUnknown_086118B4 - lsls r1, r7, 2 - adds r1, r6, r1 - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - adds r1, r0 - adds r7, r1, r2 - ldrb r5, [r7] - ldr r0, =gUnknown_02038BCA - mov r9, r0 - ldrh r0, [r0] - ldr r1, =0x000003fe - mov r8, r1 - cmp r0, r8 - bne _081A3CA6 - adds r5, 0xA -_081A3CA6: - ldr r6, =gSaveBlock2Ptr - ldr r1, [r6] - ldr r4, =0x00000eb8 - adds r1, r4 - ldrh r0, [r1] - adds r0, r5 - strh r0, [r1] - ldr r0, =gStringVar1 - adds r1, r5, 0 - movs r2, 0 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - ldr r0, [r6] - adds r2, r0, r4 - ldrh r0, [r2] - ldr r1, =0x0000270f - cmp r0, r1 - bls _081A3CCE - strh r1, [r2] -_081A3CCE: - ldr r0, [r6] - ldr r4, =0x00000eba - adds r0, r4 - ldrh r5, [r0] - ldrb r0, [r7] - adds r5, r0 - bl sub_80EED60 - mov r2, r9 - ldrh r0, [r2] - cmp r0, r8 - bne _081A3CEE - adds r5, 0xA - movs r0, 0xA - bl sub_80EED60 -_081A3CEE: - ldr r0, =0x0000ffff - cmp r5, r0 - ble _081A3CF6 - adds r5, r0, 0 -_081A3CF6: - ldr r0, [r6] - adds r0, r4 - strh r5, [r0] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A3B64 - - thumb_func_start sub_81A3D30 -sub_81A3D30: @ 81A3D30 - push {r4,lr} - ldr r0, =0x000040cf - bl VarGet - ldr r4, =gScriptResult - lsls r0, 24 - lsrs r0, 24 - bl sub_81A3B30 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A3D30 - - thumb_func_start sub_81A3D58 -sub_81A3D58: @ 81A3D58 - push {r4,lr} - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r4, r0, 16 - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_81A3B30 - lsls r0, 24 - cmp r0, 0 - bne _081A3D88 - lsls r0, r4, 17 - ldr r1, =0x8C4 << 16 - adds r0, r1 - lsrs r0, 16 - bl FlagSet - b _081A3D94 - .pool -_081A3D88: - lsls r0, r4, 17 - ldr r1, =0x8C5 << 16 - adds r0, r1 - lsrs r0, 16 - bl FlagSet -_081A3D94: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A3D58 - - thumb_func_start sub_81A3DA0 -sub_81A3DA0: @ 81A3DA0 - push {lr} - ldr r0, =gBattleTypeFlags - ldr r1, =gSpecialVar_0x8005 - ldrh r1, [r1] - ldr r2, [r0] - ands r2, r1 - cmp r2, 0 - beq _081A3DC4 - ldr r1, =gScriptResult - movs r0, 0x1 - strh r0, [r1] - b _081A3DC8 - .pool -_081A3DC4: - ldr r0, =gScriptResult - strh r2, [r0] -_081A3DC8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A3DA0 - - thumb_func_start sub_81A3DD0 -sub_81A3DD0: @ 81A3DD0 - push {r4-r6,lr} - adds r5, r2, 0 - lsls r0, 16 - lsrs r6, r0, 16 - lsls r1, 24 - lsrs r4, r1, 24 - adds r0, r6, 0 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - bl pokedex_flag_operation - lsls r0, 24 - cmp r0, 0 - beq _081A3ED6 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - subs r0, r4, 0x1 - cmp r0, 0xA - bhi _081A3EA0 - lsls r0, 2 - ldr r1, =_081A3E0C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A3E0C: - .4byte _081A3E38 - .4byte _081A3E68 - .4byte _081A3E38 - .4byte _081A3EA0 - .4byte _081A3E38 - .4byte _081A3EA0 - .4byte _081A3E38 - .4byte _081A3EA0 - .4byte _081A3E38 - .4byte _081A3EA0 - .4byte _081A3E38 -_081A3E38: - cmp r5, r4 - bne _081A3E50 - ldr r0, =gStringVar1 - ldr r1, =gUnknown_085CCB79 - bl StringAppend - b _081A3EC8 - .pool -_081A3E50: - cmp r5, r4 - ble _081A3EC8 - ldr r0, =gStringVar1 - ldr r1, =gUnknown_085CCB7F - bl StringAppend - b _081A3EC8 - .pool -_081A3E68: - cmp r4, r5 - bne _081A3E80 - ldr r0, =gStringVar1 - ldr r1, =gUnknown_085CCB79 - bl StringAppend - b _081A3E88 - .pool -_081A3E80: - ldr r0, =gStringVar1 - ldr r1, =gUnknown_085CCB7F - bl StringAppend -_081A3E88: - ldr r0, =gStringVar1 - ldr r1, =gUnknown_085CCB86 - bl StringAppend - b _081A3EC8 - .pool -_081A3EA0: - cmp r4, r5 - bne _081A3EB8 - ldr r0, =gStringVar1 - ldr r1, =gUnknown_085CCB79 - bl StringAppend - b _081A3EC0 - .pool -_081A3EB8: - ldr r0, =gStringVar1 - ldr r1, =gUnknown_085CCB7F - bl StringAppend -_081A3EC0: - ldr r0, =gStringVar1 - ldr r1, =gUnknown_085CCB84 - bl StringAppend -_081A3EC8: - ldr r0, =gStringVar1 - movs r1, 0xB - muls r1, r6 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringAppend -_081A3ED6: - adds r0, r4, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A3DD0 - - thumb_func_start sub_81A3EF0 -sub_81A3EF0: @ 81A3EF0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r2, [sp, 0x20] - ldr r4, [sp, 0x24] - mov r9, r4 - ldr r4, [sp, 0x28] - mov r10, r4 - ldr r7, [sp, 0x2C] - lsls r0, 16 - lsrs r4, r0, 16 - lsls r1, 16 - lsrs r6, r1, 16 - lsls r3, 24 - lsrs r3, 24 - mov r12, r3 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - movs r2, 0 - movs r0, 0xCE - lsls r0, 1 - cmp r4, r0 - beq _081A3FBE - cmp r4, 0 - beq _081A3FBE - ldr r0, =gUnknown_08611C9A - ldrh r1, [r0] - ldr r5, =0x0000ffff - adds r3, r0, 0 - cmp r1, r5 - beq _081A3F54 - cmp r1, r4 - beq _081A3F48 - adds r1, r3, 0 -_081A3F3A: - adds r1, 0x2 - adds r2, 0x1 - ldrh r0, [r1] - cmp r0, r5 - beq _081A3F54 - cmp r0, r4 - bne _081A3F3A -_081A3F48: - lsls r0, r2, 1 - adds r0, r3 - ldrh r1, [r0] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _081A3FBE -_081A3F54: - mov r0, r12 - cmp r0, 0 - bne _081A3F60 - mov r1, r8 - cmp r1, 0x32 - bhi _081A3FBE -_081A3F60: - movs r2, 0 - ldrb r3, [r7] - cmp r2, r3 - bge _081A3F80 - mov r1, r9 - ldrh r0, [r1] - cmp r0, r4 - beq _081A3F80 - adds r5, r3, 0 -_081A3F72: - adds r1, 0x2 - adds r2, 0x1 - cmp r2, r5 - bge _081A3F80 - ldrh r0, [r1] - cmp r0, r4 - bne _081A3F72 -_081A3F80: - cmp r2, r3 - bne _081A3FBE - cmp r6, 0 - beq _081A3FAA - movs r2, 0 - cmp r2, r3 - bge _081A3FA6 - mov r1, r10 - ldrh r0, [r1] - cmp r0, r6 - beq _081A3FA6 - adds r5, r3, 0 -_081A3F98: - adds r1, 0x2 - adds r2, 0x1 - cmp r2, r5 - bge _081A3FA6 - ldrh r0, [r1] - cmp r0, r6 - bne _081A3F98 -_081A3FA6: - cmp r2, r3 - bne _081A3FBE -_081A3FAA: - lsls r0, r3, 1 - add r0, r9 - strh r4, [r0] - ldrb r0, [r7] - lsls r0, 1 - add r0, r10 - strh r6, [r0] - ldrb r0, [r7] - adds r0, 0x1 - strb r0, [r7] -_081A3FBE: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A3EF0 - - thumb_func_start sub_81A3FD4 -sub_81A3FD4: @ 81A3FD4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x34 - movs r0, 0 - str r0, [sp, 0x2C] - add r4, sp, 0x28 - strb r0, [r4] - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r0, 16 - mov r10, r4 - cmp r0, 0x1 - beq _081A4016 - cmp r0, 0x1 - bgt _081A4008 - cmp r0, 0 - beq _081A4010 - b _081A402A - .pool -_081A4008: - cmp r0, 0x3 - bgt _081A402A - movs r0, 0x2 - b _081A4028 -_081A4010: - movs r1, 0x3 - str r1, [sp, 0x2C] - b _081A402A -_081A4016: - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - movs r1, 0x3 - str r1, [sp, 0x2C] - cmp r0, 0 - bne _081A402A - movs r0, 0x4 -_081A4028: - str r0, [sp, 0x2C] -_081A402A: - movs r1, 0 - mov r9, r1 - b _081A4040 - .pool -_081A4034: - mov r1, r10 - ldrb r0, [r1] - ldr r1, [sp, 0x2C] - cmp r0, r1 - blt _081A4040 - b _081A41E0 -_081A4040: - mov r5, r9 - movs r0, 0 - mov r1, r10 - strb r0, [r1] - mov r0, r9 - adds r0, 0x1 - str r0, [sp, 0x30] -_081A404E: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =gPlayerParty - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x41 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - adds r0, r4, 0 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r7, r0, 16 - adds r0, r4, 0 - movs r1, 0x38 - bl GetMonData - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r4, 0 - movs r1, 0x39 - bl GetMonData - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x6 - bne _081A40C8 - cmp r7, 0 - bne _081A40E4 - ldr r0, =gScriptResult - ldrb r3, [r0] - str r6, [sp] - add r1, sp, 0x10 - str r1, [sp, 0x4] - add r0, sp, 0x1C - str r0, [sp, 0x8] - mov r0, r10 - str r0, [sp, 0xC] - mov r0, r8 - movs r1, 0 - adds r2, r4, 0 - bl sub_81A3EF0 - b _081A40E4 - .pool -_081A40C8: - ldr r0, =gScriptResult - ldrb r3, [r0] - str r6, [sp] - add r1, sp, 0x10 - str r1, [sp, 0x4] - add r0, sp, 0x1C - str r0, [sp, 0x8] - mov r0, r10 - str r0, [sp, 0xC] - mov r0, r8 - adds r1, r7, 0 - adds r2, r4, 0 - bl sub_81A3EF0 -_081A40E4: - adds r5, 0x1 - cmp r5, 0x5 - ble _081A40EC - movs r5, 0 -_081A40EC: - cmp r5, r9 - bne _081A404E - ldr r1, [sp, 0x30] - mov r9, r1 - cmp r1, 0x5 - ble _081A4034 - mov r1, r10 - ldrb r0, [r1] - ldr r1, [sp, 0x2C] - cmp r0, r1 - bge _081A41E0 - movs r6, 0 - ldr r0, =gUnknown_08611C9A - ldrh r2, [r0] - ldr r1, =0x0000ffff - mov r8, r0 - cmp r2, r1 - beq _081A4134 - mov r4, r8 -_081A4112: - adds r0, r2, 0 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - bl pokedex_flag_operation - lsls r0, 24 - cmp r0, 0 - beq _081A412A - adds r6, 0x1 -_081A412A: - adds r4, 0x2 - ldrh r2, [r4] - ldr r0, =0x0000ffff - cmp r2, r0 - bne _081A4112 -_081A4134: - ldr r1, =gStringVar1 - movs r0, 0xFF - strb r0, [r1] - ldr r1, =gSpecialVar_0x8004 - movs r0, 0x1 - strh r0, [r1] - movs r0, 0 - mov r1, r10 - strb r0, [r1] - mov r1, r8 - ldrh r0, [r1] - ldr r1, =0x0000ffff - cmp r0, r1 - beq _081A416A - mov r5, r10 - adds r7, r1, 0 - mov r4, r8 -_081A4156: - ldrh r0, [r4] - ldrb r1, [r5] - adds r2, r6, 0 - bl sub_81A3DD0 - strb r0, [r5] - adds r4, 0x2 - ldrh r0, [r4] - cmp r0, r7 - bne _081A4156 -_081A416A: - mov r0, r10 - ldrb r4, [r0] - cmp r4, 0 - bne _081A41A4 - ldr r4, =gStringVar1 - ldr r1, =gUnknown_085CCB82 - adds r0, r4, 0 - bl StringAppend - ldr r1, =gUnknown_085CCB88 - adds r0, r4, 0 - bl StringAppend - b _081A4202 - .pool -_081A41A4: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _081A41C0 - ldr r0, =gStringVar1 - ldr r1, =gUnknown_085CCB84 - bl StringAppend - b _081A41C8 - .pool -_081A41C0: - ldr r0, =gStringVar1 - ldr r1, =gUnknown_085CCB82 - bl StringAppend -_081A41C8: - ldr r0, =gStringVar1 - ldr r1, =gUnknown_085CCB8C - bl StringAppend - b _081A4202 - .pool -_081A41E0: - ldr r1, =gSpecialVar_0x8004 - movs r0, 0 - strh r0, [r1] - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r0, =gScriptResult - ldrb r0, [r0] - ldr r1, =0x00000ca9 - adds r2, r1 - movs r1, 0x3 - ands r1, r0 - ldrb r3, [r2] - movs r0, 0x4 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] -_081A4202: - add sp, 0x34 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A3FD4 - - thumb_func_start sub_81A4224 -sub_81A4224: @ 81A4224 - push {lr} - bl sub_81652B4 - pop {r0} - bx r0 - thumb_func_end sub_81A4224 - - thumb_func_start sub_81A4230 -sub_81A4230: @ 81A4230 - push {r4-r7,lr} - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r4, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x6 - bls _081A425A - b _081A4394 -_081A425A: - lsls r0, 2 - ldr r1, =_081A4278 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A4278: - .4byte _081A4294 - .4byte _081A42DC - .4byte _081A431C - .4byte _081A4338 - .4byte _081A434C - .4byte _081A4368 - .4byte _081A437C -_081A4294: - ldr r7, =gSaveBlock2Ptr - ldr r0, [r7] - lsls r4, 1 - lsls r1, r5, 2 - adds r1, r4, r1 - movs r6, 0xCE - lsls r6, 4 - adds r3, r0, r6 - adds r2, r3, r1 - ldrh r1, [r2] - ldr r0, =0x0000270e - cmp r1, r0 - bhi _081A4394 - adds r0, r1, 0x1 - strh r0, [r2] - cmp r5, 0 - bne _081A4394 - adds r0, r3, r4 - ldrh r1, [r0] - movs r0, 0x20 - bl sav12_xor_set - ldr r1, [r7] - adds r0, r1, r6 - adds r0, r4 - ldrh r0, [r0] - ldr r2, =0x00000d02 - adds r1, r2 - b _081A4392 - .pool -_081A42DC: - ldr r6, =gSaveBlock2Ptr - ldr r0, [r6] - lsls r2, r4, 1 - lsls r1, r5, 2 - adds r1, r2, r1 - ldr r3, =0x00000d0c - adds r0, r3 - adds r3, r0, r1 - ldrh r0, [r3] - ldr r2, =0x0000270e - cmp r0, r2 - bhi _081A42F8 - adds r0, 0x1 - strh r0, [r3] -_081A42F8: - ldr r0, [r6] - ldr r3, =0x00000d1c - adds r0, r3 - adds r1, r0, r1 - ldrh r0, [r1] - cmp r0, r2 - bhi _081A4394 - adds r0, 0x1 - b _081A4392 - .pool -_081A431C: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - lsls r0, r4, 1 - lsls r1, r5, 2 - adds r0, r1 - ldr r1, =0x00000dc8 - adds r2, r1 - adds r1, r2, r0 - b _081A4388 - .pool -_081A4338: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - ldr r2, =0x00000dda - adds r0, r2 - b _081A4386 - .pool -_081A434C: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - lsls r0, r4, 1 - lsls r1, r5, 2 - adds r0, r1 - ldr r3, =0x00000de2 - adds r2, r3 - adds r1, r2, r0 - b _081A4388 - .pool -_081A4368: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - ldr r2, =0x00000e04 - adds r0, r2 - b _081A4386 - .pool -_081A437C: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - ldr r3, =0x00000e1a - adds r0, r3 -_081A4386: - adds r1, r0, r1 -_081A4388: - ldrh r3, [r1] - ldr r0, =0x0000270e - cmp r3, r0 - bhi _081A4394 - adds r0, r3, 0x1 -_081A4392: - strh r0, [r1] -_081A4394: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A4230 - - thumb_func_start sub_81A43A8 -sub_81A43A8: @ 81A43A8 - push {r4-r6,lr} - sub sp, 0x4 - movs r4, 0 - ldr r6, =gSaveBlock1Ptr - movs r5, 0x64 -_081A43B2: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - ldr r2, =0x00000caa - adds r0, r2 - adds r1, r0, r1 - ldrh r0, [r1] - cmp r0, 0 - beq _081A43EE - adds r1, r0, 0 - muls r1, r5 - movs r0, 0xEA - lsls r0, 1 - adds r1, r0 - ldr r0, [r6] - adds r0, r1 - movs r1, 0xC - movs r2, 0 - bl GetMonData - mov r1, sp - strh r0, [r1] - adds r0, r4, 0 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xC - mov r2, sp - bl SetMonData -_081A43EE: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _081A43B2 - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A43A8 - - thumb_func_start sub_81A4410 -sub_81A4410: @ 81A4410 - push {r4,lr} - ldr r4, =gScriptResult - bl sub_8185338 - strh r0, [r4] - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x8 - orrs r0, r2 - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A4410 - - thumb_func_start sub_81A443C -sub_81A443C: @ 81A443C - push {lr} - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0 - beq _081A4450 - cmp r0, 0x1 - beq _081A4464 - b _081A446E - .pool -_081A4450: - ldr r0, =gStringVar1 - ldr r1, =gUnknown_02038BCA - ldrh r1, [r1] - bl sub_8162E20 - b _081A446E - .pool -_081A4464: - ldr r0, =gStringVar2 - ldr r1, =gUnknown_02038BCA - ldrh r1, [r1] - bl sub_8162E20 -_081A446E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A443C - - thumb_func_start sub_81A447C -sub_81A447C: @ 81A447C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - movs r0, 0 - str r0, [sp] -_081A448C: - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r2, [sp] - lsls r1, r2, 1 - ldr r4, =0x00000caa - adds r0, r4 - adds r0, r1 - ldrh r0, [r0] - subs r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - mov r9, r1 - adds r2, 0x1 - str r2, [sp, 0x4] - cmp r0, 0x5 - bhi _081A454E - movs r6, 0 - ldr r0, [sp] - movs r2, 0x64 - adds r1, r0, 0 - muls r1, r2 - ldr r0, =gPlayerParty - adds r7, r1, r0 -_081A44BA: - movs r5, 0 - movs r4, 0xD - adds r4, r6 - mov r8, r4 - adds r0, r6, 0x1 - mov r10, r0 -_081A44C6: - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r2, =0x00000caa - adds r0, r2 - add r0, r9 - ldrh r0, [r0] - movs r4, 0x64 - adds r1, r0, 0 - muls r1, r4 - movs r0, 0xEA - lsls r0, 1 - adds r1, r0 - ldr r2, =gSaveBlock1Ptr - ldr r0, [r2] - adds r0, r1 - adds r1, r5, 0 - adds r1, 0xD - movs r2, 0 - bl GetMonData - adds r4, r0, 0 - adds r0, r7, 0 - mov r1, r8 - movs r2, 0 - bl GetMonData - cmp r4, r0 - beq _081A4508 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _081A44C6 -_081A4508: - cmp r5, 0x4 - bne _081A4516 - adds r0, r7, 0 - movs r1, 0xA6 - adds r2, r6, 0 - bl sub_80691F4 -_081A4516: - mov r4, r10 - lsls r0, r4, 24 - lsrs r6, r0, 24 - cmp r6, 0x3 - bls _081A44BA - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =gSaveBlock2Ptr - ldr r1, [r2] - ldr r4, =0x00000caa - adds r1, r4 - add r1, r9 - ldrh r1, [r1] - subs r1, 0x1 - movs r3, 0x64 - muls r1, r3 - adds r0, r1 - movs r1, 0x8E - lsls r1, 2 - adds r0, r1 - ldr r2, =gPlayerParty - ldr r4, [sp] - adds r1, r4, 0 - muls r1, r3 - adds r1, r2 - movs r2, 0x64 - bl memcpy -_081A454E: - ldr r1, [sp, 0x4] - lsls r0, r1, 24 - lsrs r0, 24 - str r0, [sp] - cmp r0, 0x3 - bls _081A448C - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A447C - - thumb_func_start sub_81A457C -sub_81A457C: @ 81A457C - push {lr} - ldr r0, =0x000040cf - bl VarGet - lsls r0, 24 - lsrs r0, 24 - bl sub_81A5030 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A457C - - thumb_func_start sub_81A4594 -sub_81A4594: @ 81A4594 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x2C - mov r8, r1 - adds r6, r3, 0 - ldr r1, =gUnknown_0203AB74 - ldrb r5, [r1] - lsls r4, r0, 1 - adds r4, r0 - ldr r1, =gUnknown_085EE424 - adds r4, r1 - mov r1, r8 - lsls r3, r1, 27 - lsrs r3, 24 - lsls r1, r0, 2 - adds r1, r0 - adds r2, r1 - lsls r2, 3 - adds r2, 0x1 - lsls r2, 24 - lsrs r7, r2, 24 - str r7, [sp] - movs r0, 0xFF - mov r10, r0 - str r0, [sp, 0x4] - movs r1, 0 - mov r9, r1 - str r1, [sp, 0x8] - adds r0, r5, 0 - movs r1, 0x1 - adds r2, r4, 0 - bl Print - movs r0, 0xFF - strb r0, [r6, 0xD] - ldrh r0, [r6, 0x4] - cmp r0, 0 - beq _081A465C - adds r1, r6, 0x6 - ldrb r2, [r6, 0xE] - add r0, sp, 0xC - bl sub_81DB5E8 - ldr r1, =gUnknown_0203AB74 - ldrb r0, [r1] - mov r3, r8 - adds r3, 0x2 - lsls r3, 27 - lsrs r3, 24 - str r7, [sp] - mov r1, r10 - str r1, [sp, 0x4] - mov r1, r9 - str r1, [sp, 0x8] - movs r1, 0x1 - add r2, sp, 0xC - bl Print - ldrh r1, [r6, 0x4] - ldr r0, =0x0000270f - cmp r1, r0 - bls _081A4618 - adds r1, r0, 0 -_081A4618: - ldr r0, =gStringVar2 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r5, =gStringVar4 - ldr r1, =gUnknown_08611D08 - ldr r0, [sp, 0x4C] - lsls r0, 2 - adds r0, r1 - ldr r4, [r0] - adds r0, r5, 0 - adds r1, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0xC8 - bl GetStringRightAlignXOffset - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - ldr r1, =gUnknown_0203AB74 - ldrb r0, [r1] - str r7, [sp] - mov r1, r10 - str r1, [sp, 0x4] - mov r1, r9 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - bl Print -_081A465C: - add sp, 0x2C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A4594 - - thumb_func_start sub_81A4684 -sub_81A4684: @ 81A4684 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x2C - adds r6, r0, 0 - adds r7, r1, 0 - mov r10, r2 - adds r5, r3, 0 - ldr r1, =gUnknown_0203AB74 - ldrb r0, [r1] - lsls r2, r6, 1 - adds r2, r6 - ldr r1, =gUnknown_085EE424 - adds r2, r1 - lsls r3, r7, 27 - lsrs r3, 24 - mov r12, r3 - lsls r1, r6, 2 - adds r1, r6 - mov r3, r10 - adds r4, r3, r1 - lsls r1, r4, 3 - adds r1, 0x1 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp] - movs r1, 0xFF - mov r9, r1 - str r1, [sp, 0x4] - movs r3, 0 - mov r8, r3 - str r3, [sp, 0x8] - movs r1, 0x1 - mov r3, r12 - bl Print - ldrh r0, [r5, 0x8] - cmp r0, 0 - beq _081A47BC - movs r0, 0xFF - strb r0, [r5, 0x11] - movs r0, 0x1 - negs r0, r0 - strb r0, [r5, 0x19] - adds r1, r5, 0 - adds r1, 0xA - ldrb r2, [r5, 0x1A] - add r0, sp, 0xC - bl sub_81DB5E8 - ldr r1, =gUnknown_0203AB74 - ldrb r0, [r1] - adds r3, r7, 0x2 - lsls r3, 27 - lsrs r3, 24 - subs r1, r4, 0x1 - lsls r1, 3 - adds r1, 0x1 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp] - mov r2, r9 - str r2, [sp, 0x4] - mov r1, r8 - str r1, [sp, 0x8] - movs r1, 0x1 - add r2, sp, 0xC - bl Print - adds r4, r5, 0 - adds r4, 0x12 - adds r0, r4, 0 - bl sub_8009228 - cmp r0, 0 - beq _081A4734 - add r0, sp, 0xC - adds r1, r4, 0 - movs r2, 0x1 - bl sub_81DB5E8 - b _081A473C - .pool -_081A4734: - add r0, sp, 0xC - adds r1, r4, 0 - bl StringCopy -_081A473C: - ldr r2, =gUnknown_0203AB74 - mov r9, r2 - ldrb r0, [r2] - adds r3, r7, 0x4 - lsls r3, 27 - lsrs r3, 24 - lsls r1, r6, 2 - adds r1, r6 - mov r2, r10 - adds r6, r2, r1 - adds r1, r6, 0x1 - lsls r1, 3 - adds r1, 0x1 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp] - movs r1, 0xFF - mov r8, r1 - str r1, [sp, 0x4] - movs r7, 0 - str r7, [sp, 0x8] - movs r1, 0x1 - add r2, sp, 0xC - bl Print - ldrh r1, [r5, 0x8] - ldr r0, =0x0000270f - cmp r1, r0 - bls _081A4778 - adds r1, r0, 0 -_081A4778: - ldr r0, =gStringVar2 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r5, =gStringVar4 - ldr r0, =gUnknown_08611D08 - ldr r4, [r0, 0x24] - adds r0, r5, 0 - adds r1, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0xC8 - bl GetStringRightAlignXOffset - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - mov r2, r9 - ldrb r0, [r2] - lsls r1, r6, 3 - adds r1, 0x1 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp] - mov r1, r8 - str r1, [sp, 0x4] - str r7, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - bl Print -_081A47BC: - add sp, 0x2C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A4684 - - thumb_func_start sub_81A47E0 -sub_81A47E0: @ 81A47E0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x44 - mov r9, r0 - mov r10, r1 - str r2, [sp, 0x40] - movs r0, 0xAC - lsls r0, 1 - bl AllocZeroed - mov r8, r0 - bl sub_80E8260 - add r0, sp, 0x30 - mov r12, r0 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r3, [sp, 0x40] - lsls r1, r3, 1 - adds r1, r3 - lsls r1, 4 - mov r4, r10 - lsls r0, r4, 1 - add r0, r10 - lsls r0, 5 - adds r1, r0 - adds r4, r1, r2 - mov r3, sp - movs r2, 0x2 -_081A4820: - adds r0, r3, 0 - movs r5, 0x87 - lsls r5, 2 - adds r1, r4, r5 - ldm r1!, {r5-r7} - stm r0!, {r5-r7} - ldr r1, [r1] - str r1, [r0] - adds r4, 0x10 - adds r3, 0x10 - subs r2, 0x1 - cmp r2, 0 - bge _081A4820 - ldr r6, [sp, 0x40] - lsls r0, r6, 4 - mov r7, r10 - lsls r1, r7, 5 - adds r0, r1 - mov r1, r12 - add r0, r8 - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldr r0, [r0] - str r0, [r1] - movs r2, 0 -_081A4852: - movs r1, 0 - movs r4, 0 - movs r3, 0 - lsls r5, r2, 4 - adds r6, r2, 0x1 - mov r2, sp -_081A485E: - ldrh r0, [r2, 0x4] - cmp r0, r1 - ble _081A4868 - adds r4, r3, 0 - adds r1, r0, 0 -_081A4868: - adds r2, 0x10 - adds r3, 0x1 - cmp r3, 0x3 - ble _081A485E - mov r0, sp - ldrh r0, [r0, 0x34] - cmp r0, r1 - blt _081A487A - movs r4, 0x3 -_081A487A: - lsls r0, r4, 4 - mov r7, sp - adds r2, r7, r0 - mov r0, r9 - adds r1, r5, r0 - adds r0, r2, 0 - ldm r0!, {r3-r5} - stm r1!, {r3-r5} - ldr r0, [r0] - str r0, [r1] - movs r0, 0 - strh r0, [r2, 0x4] - adds r2, r6, 0 - cmp r2, 0x2 - ble _081A4852 - mov r0, r8 - bl Free - add sp, 0x44 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A47E0 - - thumb_func_start sub_81A48B4 -sub_81A48B4: @ 81A48B4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x74 - mov r9, r0 - mov r10, r1 - movs r0, 0xAC - lsls r0, 1 - bl AllocZeroed - mov r8, r0 - bl sub_80E8260 - mov r0, sp - adds r0, 0x54 - str r0, [sp, 0x70] - add r1, sp, 0x5C - mov r12, r1 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - movs r0, 0x54 - mov r2, r10 - muls r2, r0 - adds r0, r2, 0 - adds r3, r0, r1 - mov r2, sp - movs r4, 0x2 -_081A48EE: - adds r0, r2, 0 - ldr r5, =0x0000057c - adds r1, r3, r5 - ldm r1!, {r5-r7} - stm r0!, {r5-r7} - ldm r1!, {r5-r7} - stm r0!, {r5-r7} - ldr r1, [r1] - str r1, [r0] - adds r3, 0x1C - adds r2, 0x1C - subs r4, 0x1 - cmp r4, 0 - bge _081A48EE - mov r6, r10 - lsls r0, r6, 3 - subs r0, r6 - lsls r0, 2 - add r0, r8 - ldr r1, [sp, 0x70] - movs r7, 0x90 - lsls r7, 1 - adds r0, r7 - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r5-r7} - stm r1!, {r5-r7} - ldr r0, [r0] - str r0, [r1] - movs r4, 0 -_081A492A: - movs r1, 0 - movs r5, 0 - movs r3, 0 - lsls r6, r4, 3 - adds r7, r4, 0x1 - mov r2, sp -_081A4936: - ldrh r0, [r2, 0x8] - cmp r0, r1 - ble _081A4940 - adds r5, r3, 0 - adds r1, r0, 0 -_081A4940: - adds r2, 0x1C - adds r3, 0x1 - cmp r3, 0x2 - ble _081A4936 - mov r2, r12 - ldrh r0, [r2] - cmp r0, r1 - blt _081A4952 - movs r5, 0x3 -_081A4952: - subs r1, r6, r4 - lsls r1, 2 - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - mov r3, sp - adds r2, r3, r0 - add r1, r9 - adds r0, r2, 0 - ldm r0!, {r4-r6} - stm r1!, {r4-r6} - ldm r0!, {r3-r5} - stm r1!, {r3-r5} - ldr r0, [r0] - str r0, [r1] - movs r0, 0 - strh r0, [r2, 0x8] - adds r4, r7, 0 - cmp r4, 0x2 - ble _081A492A - mov r0, r8 - bl Free - add sp, 0x74 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A48B4 - - thumb_func_start sub_81A4998 -sub_81A4998: @ 81A4998 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x94 - adds r7, r0, 0 - str r1, [sp, 0x90] - ldr r0, =gStringVar1 - ldr r4, =gUnknown_08611CB0 - lsls r5, r7, 3 - adds r1, r5, r4 - ldr r1, [r1] - bl StringCopy - ldr r6, =gStringVar4 - adds r4, 0x4 - adds r5, r4 - ldr r1, [r5] - adds r0, r6, 0 - bl StringExpandPlaceholders - ldr r0, =gUnknown_0203AB74 - mov r8, r0 - ldrb r0, [r0] - movs r1, 0x1 - mov r10, r1 - str r1, [sp] - movs r2, 0xFF - mov r9, r2 - str r2, [sp, 0x4] - movs r5, 0 - str r5, [sp, 0x8] - adds r2, r6, 0 - movs r3, 0 - bl Print - ldr r1, =gUnknown_08611D00 - ldr r2, [sp, 0x90] - lsls r0, r2, 2 - adds r0, r1 - ldr r4, [r0] - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0xD0 - bl GetStringRightAlignXOffset - adds r3, r0, 0 - mov r1, r8 - ldrb r0, [r1] - lsls r3, 24 - lsrs r3, 24 - mov r2, r10 - str r2, [sp] - mov r1, r9 - str r1, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - bl Print - cmp r7, 0x9 - bne _081A4A6C - ldr r2, =gSaveBlock2Ptr - ldr r0, [r2] - ldr r1, =0x00000ee8 - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldr r0, [r2] - movs r2, 0xEF - lsls r2, 4 - adds r0, r2 - movs r1, 0x1 - negs r1, r1 - strb r1, [r0] - add r4, sp, 0x3C - adds r0, r4, 0 - ldr r1, [sp, 0x90] - bl sub_81A48B4 -_081A4A3A: - adds r0, r5, 0 - movs r1, 0x1 - movs r2, 0x4 - adds r3, r4, 0 - bl sub_81A4684 - adds r4, 0x1C - adds r5, 0x1 - cmp r5, 0x2 - ble _081A4A3A - b _081A4A90 - .pool -_081A4A6C: - add r0, sp, 0xC - adds r1, r7, 0 - ldr r2, [sp, 0x90] - bl sub_81A47E0 - movs r5, 0 - add r4, sp, 0xC -_081A4A7A: - str r7, [sp] - adds r0, r5, 0 - movs r1, 0x1 - movs r2, 0x4 - adds r3, r4, 0 - bl sub_81A4594 - adds r4, 0x10 - adds r5, 0x1 - cmp r5, 0x2 - ble _081A4A7A -_081A4A90: - add sp, 0x94 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81A4998 - - thumb_func_start sub_81A4AA0 -sub_81A4AA0: @ 81A4AA0 - push {r4,lr} - ldr r4, =gUnknown_0203AB74 - ldr r0, =gUnknown_08611C84 - bl AddWindow - strb r0, [r4] - ldrb r0, [r4] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r4] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - movs r1, 0 - bl sub_81A4998 - ldrb r0, [r4] - bl PutWindowTilemap - ldrb r0, [r4] - movs r1, 0x3 - bl CopyWindowToVram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A4AA0 - - thumb_func_start sub_81A4AE8 -sub_81A4AE8: @ 81A4AE8 - push {r4,lr} - ldr r4, =gUnknown_0203AB74 - ldrb r0, [r4] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - movs r1, 0x1 - bl sub_81A4998 - ldrb r0, [r4] - movs r1, 0x2 - bl CopyWindowToVram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A4AE8 - - thumb_func_start sub_81A4B14 -sub_81A4B14: @ 81A4B14 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - movs r1, 0 - ldr r3, =gSaveBlock2Ptr -_081A4B24: - movs r6, 0 - lsls r0, r1, 1 - adds r2, r1, 0x1 - mov r10, r2 - adds r0, r1 - lsls r0, 5 - mov r8, r0 - movs r7, 0 - movs r0, 0x87 - lsls r0, 2 - add r0, r8 - mov r9, r0 -_081A4B3C: - movs r5, 0 - adds r2, r7, 0 - mov r1, r8 - adds r4, r7, r1 -_081A4B44: - ldr r0, [r3] - add r0, r9 - adds r0, r2 - lsls r1, r5, 4 - adds r0, r1 - movs r1, 0 - str r2, [sp] - str r3, [sp, 0x4] - bl sub_80842F4 - ldr r3, [sp, 0x4] - ldr r0, [r3] - adds r0, r4 - ldr r1, =0x00000222 - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldr r0, [r3] - adds r0, r4 - movs r1, 0x88 - lsls r1, 2 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - adds r4, 0x10 - adds r5, 0x1 - ldr r2, [sp] - cmp r5, 0x2 - ble _081A4B44 - adds r7, 0x30 - adds r6, 0x1 - cmp r6, 0x1 - ble _081A4B3C - mov r1, r10 - cmp r1, 0x8 - ble _081A4B24 - movs r6, 0 - ldr r7, =gSaveBlock2Ptr - movs r2, 0x54 - mov r10, r2 - movs r3, 0xFF - mov r9, r3 -_081A4B98: - adds r0, r6, 0x1 - mov r8, r0 - mov r1, r10 - muls r1, r6 - movs r0, 0x54 - adds r4, r6, 0 - muls r4, r0 - movs r2, 0 - ldr r3, =0x0000057c - adds r6, r1, r3 - movs r5, 0x2 -_081A4BAE: - ldr r0, [r7] - adds r0, r6 - adds r0, r2 - movs r1, 0 - str r2, [sp] - bl sub_80842F4 - ldr r0, [r7] - adds r0, r6 - ldr r2, [sp] - adds r0, r2 - adds r0, 0x4 - movs r1, 0 - bl sub_80842F4 - ldr r1, [r7] - adds r1, r4 - ldr r0, =0x00000586 - adds r1, r0 - ldrb r0, [r1] - mov r3, r9 - orrs r0, r3 - strb r0, [r1] - ldr r1, [r7] - adds r1, r4 - ldr r0, =0x0000058e - adds r1, r0 - ldrb r0, [r1] - orrs r0, r3 - strb r0, [r1] - ldr r0, [r7] - adds r0, r4 - ldr r1, =0x00000584 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - adds r4, 0x1C - ldr r2, [sp] - adds r2, 0x1C - subs r5, 0x1 - cmp r5, 0 - bge _081A4BAE - mov r6, r8 - cmp r6, 0x1 - ble _081A4B98 - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A4B14 - - thumb_func_start sub_81A4C30 -sub_81A4C30: @ 81A4C30 - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r0, 0x96 - lsls r0, 2 - bl AllocZeroed - adds r7, r0, 0 - adds r4, r7, 0 - movs r5, 0 - movs r0, 0xFA - lsls r0, 1 - adds r6, r7, r0 - ldr r0, =gPlayerParty - mov r8, r0 -_081A4C4E: - mov r0, r8 - adds r1, r5, r0 - adds r0, r4, 0 - movs r2, 0x64 - bl memcpy - adds r4, 0x64 - adds r5, 0x64 - cmp r4, r6 - ble _081A4C4E - ldr r4, =gUnknown_020244E9 - ldrb r5, [r4] - bl copy_player_party_from_sav1 - bl sub_8076D5C - movs r0, 0x1 - bl TrySavingData - bl sav2_gender2_inplace_and_xFE - strb r5, [r4] - adds r4, r7, 0 - ldr r5, =gPlayerParty - movs r0, 0xFA - lsls r0, 1 - adds r6, r7, r0 -_081A4C84: - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0x64 - bl memcpy - adds r4, 0x64 - adds r5, 0x64 - cmp r4, r6 - ble _081A4C84 - adds r0, r7, 0 - bl Free - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A4C30 - - thumb_func_start sub_81A4CB0 -sub_81A4CB0: @ 81A4CB0 - push {lr} - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _081A4CD0 - bl sub_8185EA0 - lsls r0, 24 - lsrs r0, 24 - b _081A4CDA - .pool -_081A4CD0: - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r0, 16 -_081A4CDA: - ldr r2, =gTrainers - ldr r1, =gUnknown_08611D30 - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0, 0x3] - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A4CB0 - - thumb_func_start sub_81A4D00 -sub_81A4D00: @ 81A4D00 - push {lr} - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _081A4D20 - bl sub_8185EA0 - lsls r0, 24 - lsrs r0, 24 - b _081A4D2A - .pool -_081A4D20: - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r0, 16 -_081A4D2A: - ldr r2, =gTrainers - ldr r1, =gUnknown_08611D30 - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0, 0x1] - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A4D00 - - thumb_func_start sub_81A4D50 -sub_81A4D50: @ 81A4D50 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _081A4D70 - bl sub_8185EA0 - lsls r0, 24 - lsrs r0, 24 - b _081A4D7A - .pool -_081A4D70: - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r0, 16 -_081A4D7A: - movs r3, 0 - lsls r0, 1 - ldr r2, =gTrainers - ldr r1, =gUnknown_08611D30 - adds r0, r1 - ldrh r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r2, 0x4 - adds r2, r0, r2 -_081A4D90: - adds r1, r4, r3 - ldrb r0, [r2] - strb r0, [r1] - adds r2, 0x1 - adds r3, 0x1 - cmp r3, 0x6 - ble _081A4D90 - adds r1, r4, r3 - movs r0, 0xFF - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A4D50 - - thumb_func_start sub_81A4DB8 -sub_81A4DB8: @ 81A4DB8 - push {lr} - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - ldr r1, =gUnknown_08611C8C - lsrs r0, 15 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A4DB8 - - thumb_func_start sub_81A4DD8 -sub_81A4DD8: @ 81A4DD8 - push {lr} - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - ldr r2, =0x00004010 - ldr r1, =gUnknown_08611C8C - lsrs r0, 15 - adds r0, r1 - ldrb r1, [r0] - adds r0, r2, 0 - bl VarSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A4DD8 - - thumb_func_start sub_81A4E04 -sub_81A4E04: @ 81A4E04 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x44 - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x20] - bl sub_81A513C - str r0, [sp, 0x24] - ldr r0, [sp, 0x20] - cmp r0, 0x1 - bne _081A4E44 - ldr r0, =0x000003fe - bl sub_81953A0 - lsls r0, 16 - lsrs r0, 16 - bl sub_818FC78 - adds r4, r0, 0 - b _081A4E46 - .pool -_081A4E44: - movs r4, 0x7 -_081A4E46: - bl zero_enemy_party_data - movs r1, 0 - str r1, [sp, 0x18] - bl sub_8165C40 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x1C] - movs r2, 0 - str r2, [sp, 0x14] -_081A4E5C: - movs r0, 0x1 - ands r0, r4 - asrs r4, 1 - str r4, [sp, 0x30] - ldr r3, [sp, 0x14] - adds r3, 0x1 - str r3, [sp, 0x28] - cmp r0, 0 - bne _081A4E70 - b _081A4FC4 -_081A4E70: - ldr r4, [sp, 0x14] - lsls r4, 2 - mov r9, r4 - ldr r0, [sp, 0x24] - lsls r0, 4 - str r0, [sp, 0x38] - ldr r1, [sp, 0x20] - lsls r1, 4 - str r1, [sp, 0x34] - ldr r2, [sp, 0x1C] - lsls r2, 24 - str r2, [sp, 0x3C] - ldr r3, [sp, 0x18] - adds r3, 0x1 - str r3, [sp, 0x2C] - ldr r0, [sp, 0x14] - add r0, r9 - lsls r0, 2 - mov r8, r0 -_081A4E96: - bl Random - adds r4, r0, 0 - bl Random - lsls r4, 16 - lsrs r7, r4, 16 - lsls r0, 16 - orrs r7, r0 - ldr r0, =0x0000ef2a - adds r1, r7, 0 - bl sub_806EBD0 - lsls r0, 24 - cmp r0, 0 - bne _081A4E96 - ldr r4, [sp, 0x38] - ldr r1, [sp, 0x24] - subs r0, r4, r1 - lsls r5, r0, 2 - mov r2, r8 - adds r4, r2, r5 - ldr r3, [sp, 0x34] - ldr r1, [sp, 0x20] - subs r0, r3, r1 - lsls r6, r0, 3 - adds r4, r6 - ldr r2, =gUnknown_0861156C - adds r4, r2 - adds r0, r7, 0 - bl GetNatureFromPersonality - ldrb r1, [r4, 0x5] - lsls r0, 24 - lsrs r0, 24 - cmp r1, r0 - bne _081A4E96 - ldr r4, [sp, 0x18] - movs r0, 0x64 - adds r3, r4, 0 - muls r3, r0 - mov r8, r3 - ldr r1, =gEnemyParty - add r1, r8 - mov r10, r1 - ldr r4, [sp, 0x14] - add r4, r9 - lsls r4, 2 - adds r0, r4, r5 - adds r0, r6 - ldr r2, =gUnknown_0861156C - adds r0, r2 - ldrh r1, [r0] - ldr r3, [sp, 0x3C] - lsrs r2, r3, 24 - ldrb r3, [r0, 0x4] - movs r0, 0x1 - str r0, [sp] - str r7, [sp, 0x4] - str r0, [sp, 0x8] - ldr r0, =0x0000ef2a - str r0, [sp, 0xC] - mov r0, r10 - bl create_pokemon_set_level - ldr r0, =gUnknown_0861156C - adds r5, r0 - adds r5, r6, r5 - adds r4, r5, r4 - adds r4, 0x2 - mov r0, r10 - movs r1, 0xC - adds r2, r4, 0 - bl SetMonData - movs r7, 0 - mov r6, r8 - ldr r3, =gEnemyParty -_081A4F32: - adds r1, r7, 0 - adds r1, 0x1A - ldr r0, [sp, 0x14] - add r0, r9 - lsls r4, r0, 2 - adds r2, r5, r4 - adds r0, r7, 0x6 - adds r2, r0 - adds r0, r6, r3 - str r3, [sp, 0x40] - bl SetMonData - adds r7, 0x1 - ldr r3, [sp, 0x40] - cmp r7, 0x5 - ble _081A4F32 - movs r1, 0xFF - add r0, sp, 0x10 - strb r1, [r0] - movs r7, 0 - ldr r1, [sp, 0x18] - movs r2, 0x64 - adds r6, r1, 0 - muls r6, r2 - ldr r3, =gUnknown_08611578 - mov r8, r3 - ldr r3, =gEnemyParty - adds r5, r4, 0 -_081A4F6A: - ldr r4, [sp, 0x38] - ldr r0, [sp, 0x24] - subs r1, r4, r0 - lsls r1, 2 - adds r1, r5, r1 - ldr r2, [sp, 0x34] - ldr r4, [sp, 0x20] - subs r0, r2, r4 - lsls r0, 3 - adds r1, r0 - add r1, r8 - ldrh r4, [r1] - lsls r2, r7, 24 - lsrs r2, 24 - adds r0, r6, r3 - adds r1, r4, 0 - str r3, [sp, 0x40] - bl sub_80691F4 - ldr r3, [sp, 0x40] - cmp r4, 0xDA - bne _081A4F9C - movs r1, 0 - add r0, sp, 0x10 - strb r1, [r0] -_081A4F9C: - adds r5, 0x2 - adds r7, 0x1 - cmp r7, 0x3 - ble _081A4F6A - ldr r0, [sp, 0x18] - movs r1, 0x64 - adds r4, r0, 0 - muls r4, r1 - ldr r0, =gEnemyParty - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x20 - add r2, sp, 0x10 - bl SetMonData - adds r0, r4, 0 - bl pokemon_calc_effective_stats - ldr r2, [sp, 0x2C] - str r2, [sp, 0x18] -_081A4FC4: - ldr r4, [sp, 0x30] - ldr r3, [sp, 0x28] - str r3, [sp, 0x14] - cmp r3, 0x2 - bgt _081A4FD0 - b _081A4E5C -_081A4FD0: - add sp, 0x44 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A4E04 - - thumb_func_start sub_81A4FF0 -sub_81A4FF0: @ 81A4FF0 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x000040cf - bl VarGet - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - bl sub_81A513C - ldr r3, =gUnknown_0861156C - lsls r2, r4, 2 - adds r2, r4 - lsls r1, r0, 4 - subs r1, r0 - adds r1, r2 - lsls r1, 2 - lsls r0, r5, 4 - subs r0, r5 - lsls r0, 3 - adds r1, r0 - adds r1, r3 - ldrh r0, [r1] - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A4FF0 - - thumb_func_start sub_81A5030 -sub_81A5030: @ 81A5030 - push {lr} - lsls r0, 24 - ldr r2, =gUnknown_02038BCA - ldr r3, =0x000003fe - adds r1, r3, 0 - strh r1, [r2] - ldr r2, =0x00004010 - ldr r1, =gUnknown_08611C8C - lsrs r0, 23 - adds r0, r1 - ldrb r1, [r0] - adds r0, r2, 0 - bl VarSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5030 - - thumb_func_start sub_81A5060 -sub_81A5060: @ 81A5060 - push {r4-r6,lr} - adds r6, r0, 0 - adds r4, r1, 0 - lsls r6, 24 - lsrs r6, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x000040cf - bl VarGet - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - bl sub_81A513C - ldr r2, =gUnknown_0861156C - lsls r4, 1 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 2 - adds r4, r1 - lsls r1, r0, 4 - subs r1, r0 - lsls r1, 2 - adds r4, r1 - lsls r0, r5, 4 - subs r0, r5 - lsls r0, 3 - adds r4, r0 - adds r2, 0xC - adds r4, r2 - ldrh r0, [r4] - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A5060 - - thumb_func_start sub_81A50B0 -sub_81A50B0: @ 81A50B0 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x000040cf - bl VarGet - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - bl sub_81A513C - ldr r3, =gUnknown_0861156C - lsls r2, r4, 2 - adds r2, r4 - lsls r1, r0, 4 - subs r1, r0 - adds r1, r2 - lsls r1, 2 - lsls r0, r5, 4 - subs r0, r5 - lsls r0, 3 - adds r1, r0 - adds r1, r3 - ldrb r0, [r1, 0x5] - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A50B0 - - thumb_func_start sub_81A50F0 -sub_81A50F0: @ 81A50F0 - push {r4-r6,lr} - adds r6, r0, 0 - adds r4, r1, 0 - lsls r6, 24 - lsrs r6, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x000040cf - bl VarGet - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - bl sub_81A513C - ldr r2, =gUnknown_0861156C - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 2 - adds r4, r1 - lsls r1, r0, 4 - subs r1, r0 - lsls r1, 2 - adds r4, r1 - lsls r0, r5, 4 - subs r0, r5 - lsls r0, 3 - adds r4, r0 - adds r2, 0x6 - adds r4, r2 - ldrb r0, [r4] - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A50F0 - - thumb_func_start sub_81A513C -sub_81A513C: @ 81A513C - push {r4,r5,lr} - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r5, r0, 16 - lsls r0, r5, 24 - lsrs r0, 24 - bl sub_81A3B30 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bne _081A51A0 - bl sub_81A39C4 - lsls r0, 16 - ldr r3, =gUnknown_08611550 - lsls r2, r5, 2 - adds r1, r3, 0x3 - adds r1, r2, r1 - lsrs r0, 16 - ldrb r1, [r1] - adds r1, r0, r1 - adds r0, r2, r3 - ldrb r0, [r0] - cmp r1, r0 - bne _081A5180 - movs r4, 0 - b _081A51A0 - .pool -_081A5180: - adds r0, r3, 0x1 - adds r0, r2, r0 - ldrb r0, [r0] - cmp r1, r0 - beq _081A519E - cmp r1, r0 - ble _081A51A0 - subs r0, r1, r0 - adds r1, r3, 0x2 - adds r1, r2, r1 - ldrb r1, [r1] - bl __modsi3 - cmp r0, 0 - bne _081A51A0 -_081A519E: - movs r4, 0x1 -_081A51A0: - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81A513C - - thumb_func_start sub_81A51A8 -sub_81A51A8: @ 81A51A8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _081A51D4 - bl sub_8185EA0 - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_8185EAC - lsls r0, 24 - lsrs r1, r0, 24 - b _081A51E4 - .pool -_081A51D4: - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r4, r0, 16 - bl sub_81A513C - adds r1, r0, 0 -_081A51E4: - cmp r5, 0 - beq _081A51F4 - cmp r5, 0x1 - beq _081A5214 - b _081A5228 - .pool -_081A51F4: - ldr r0, =gStringVar4 - ldr r2, =gUnknown_08611DB0 - lsls r1, 2 - adds r1, r2 - ldr r2, [r1] - lsls r1, r4, 2 - adds r1, r2 - ldr r1, [r1] - bl StringCopy - b _081A5228 - .pool -_081A5214: - ldr r0, =gStringVar4 - ldr r2, =gUnknown_08611DB8 - lsls r1, 2 - adds r1, r2 - ldr r2, [r1] - lsls r1, r4, 2 - adds r1, r2 - ldr r1, [r1] - bl StringCopy -_081A5228: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A51A8 - - thumb_func_start sub_81A5238 -sub_81A5238: @ 81A5238 - push {lr} - ldr r1, =gUnknown_08611F84 - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5238 - - thumb_func_start sub_81A5258 -sub_81A5258: @ 81A5258 - push {r4-r6,lr} - sub sp, 0x4 - adds r5, r0, 0 - movs r6, 0 - ldrb r0, [r5] - cmp r0, 0xA - bls _081A5268 - b _081A5544 -_081A5268: - lsls r0, 2 - ldr r1, =_081A5278 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A5278: - .4byte _081A52A4 - .4byte _081A52F4 - .4byte _081A531C - .4byte _081A53B4 - .4byte _081A540C - .4byte _081A542C - .4byte _081A544C - .4byte _081A5490 - .4byte _081A553E - .4byte _081A54D4 - .4byte _081A5520 -_081A52A4: - ldr r0, =0x7fffff1c - movs r1, 0 - str r1, [sp] - movs r1, 0x4 - movs r2, 0 - movs r3, 0x8 - bl BeginNormalPaletteFade - ldr r1, =0x00003f3e - movs r0, 0x48 - bl SetGpuReg - ldr r0, =gUnknown_08611F74 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_08D855E8 - movs r1, 0xF8 - lsls r1, 1 - movs r2, 0x20 - bl LoadCompressedPalette - ldr r1, =gUnknown_02022E24 - movs r0, 0xFF - strh r0, [r1] - ldr r1, =gUnknown_02022E26 - movs r0, 0x70 - strh r0, [r1] - b _081A553E - .pool -_081A52F4: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _081A5306 - b _081A5544 -_081A5306: - str r0, [sp] - movs r0, 0x5 - movs r1, 0 - movs r2, 0x18 - movs r3, 0xD - bl sub_8056A3C - b _081A553E - .pool -_081A531C: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _081A5328 - b _081A5544 -_081A5328: - ldr r1, =gBattleTextBuff1 - movs r2, 0xA1 - strb r2, [r1] - movs r0, 0xFF - strb r0, [r1, 0x1] - ldr r1, =gBattleTextBuff2 - strb r2, [r1] - movs r0, 0x1 - negs r0, r0 - strb r0, [r1, 0x1] - ldr r0, =gUnknown_085CCDB2 - bl get_battle_strings_ - ldr r4, =gUnknown_02022E2C - adds r0, r4, 0 - movs r1, 0xF - bl battle_show_message_maybe - ldr r0, =gUnknown_085CCDB5 - movs r1, 0x10 - bl battle_show_message_maybe - ldr r0, =gUnknown_085CCDB8 - bl get_battle_strings_ - adds r0, r4, 0 - movs r1, 0x11 - bl battle_show_message_maybe - ldr r0, =gUnknown_085CCDBB - movs r1, 0x12 - bl battle_show_message_maybe - ldr r0, =gUnknown_085CCDC0 - movs r1, 0x13 - bl battle_show_message_maybe - ldr r0, =gUnknown_085CCDC6 - movs r1, 0x14 - bl battle_show_message_maybe - ldr r0, =gUnknown_085CCDCB - bl get_battle_strings_ - adds r0, r4, 0 - movs r1, 0x15 - bl battle_show_message_maybe - b _081A553E - .pool -_081A53B4: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _081A53C0 - b _081A5544 -_081A53C0: - ldr r1, =0x00003f3f - movs r0, 0x48 - bl SetGpuReg - movs r6, 0x80 - lsls r6, 15 - movs r4, 0x7 -_081A53CE: - asrs r1, r6, 16 - ldr r0, =gUnknown_08611F5C - movs r2, 0x54 - movs r3, 0 - bl CreateSprite - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - movs r1, 0x3 - bl StartSpriteAnim - movs r0, 0x80 - lsls r0, 13 - adds r6, r0 - subs r4, 0x1 - cmp r4, 0 - bge _081A53CE - b _081A553C - .pool -_081A540C: - ldr r0, =0x00000109 - bl PlaySE - movs r0, 0x50 - movs r1, 0x28 - movs r2, 0 - movs r3, 0 - bl sub_81A5558 - movs r0, 0xA0 - movs r1, 0x28 - movs r2, 0 - b _081A5464 - .pool -_081A542C: - ldr r0, =0x00000109 - bl PlaySE - movs r0, 0x50 - movs r1, 0x38 - movs r2, 0x1 - movs r3, 0 - bl sub_81A5558 - movs r0, 0xA0 - movs r1, 0x38 - movs r2, 0x1 - b _081A5464 - .pool -_081A544C: - ldr r0, =0x00000109 - bl PlaySE - movs r0, 0x50 - movs r1, 0x48 - movs r2, 0x2 - movs r3, 0 - bl sub_81A5558 - movs r0, 0xA0 - movs r1, 0x48 - movs r2, 0x2 -_081A5464: - movs r3, 0x1 - bl sub_81A5558 - ldr r0, =gUnknown_085CCDCB - bl get_battle_strings_ - ldr r0, =gUnknown_02022E2C - movs r1, 0x15 - bl battle_show_message_maybe - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - movs r6, 0x1 - b _081A5544 - .pool -_081A5490: - movs r0, 0x85 - lsls r0, 1 - bl PlaySE - ldr r0, =gBattleTextBuff1 - ldr r1, =gBattleTextBuff2 - ldrb r2, [r0] - ldrb r0, [r1] - cmp r2, r0 - bls _081A54BC - movs r6, 0x2 - ldr r1, =gBattleScripting - movs r0, 0 - strb r0, [r1, 0x17] - b _081A553E - .pool -_081A54BC: - cmp r2, r0 - bcs _081A54D0 - movs r6, 0x3 - ldr r1, =gBattleScripting - movs r0, 0x1 - strb r0, [r1, 0x17] - b _081A553E - .pool -_081A54D0: - movs r6, 0x4 - b _081A553E -_081A54D4: - ldr r1, =0x00003f3e - movs r0, 0x48 - bl SetGpuReg - movs r0, 0x1 - str r0, [sp] - movs r0, 0x5 - movs r1, 0 - movs r2, 0x18 - movs r3, 0xD - bl sub_8056A3C - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldr r0, =gMPlay_BGM - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl m4aMPlayVolumeControl - ldr r0, =0x7fffff1c - movs r1, 0 - str r1, [sp] - movs r1, 0x4 - movs r2, 0x8 - movs r3, 0 - bl BeginNormalPaletteFade - b _081A553E - .pool -_081A5520: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081A5544 - ldr r1, =0x00003f3f - movs r0, 0x48 - bl SetGpuReg - movs r0, 0xFA - lsls r0, 2 - bl FreeSpriteTilesByTag -_081A553C: - movs r6, 0x1 -_081A553E: - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] -_081A5544: - adds r0, r6, 0 - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A5258 - - thumb_func_start sub_81A5558 -sub_81A5558: @ 81A5558 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - lsls r1, 24 - lsrs r1, 24 - mov r10, r1 - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - lsls r3, 24 - lsrs r7, r3, 24 - movs r6, 0 - movs r1, 0 - ldr r0, =gBattleStruct - ldr r0, [r0] - movs r3, 0xA6 - lsls r3, 2 - adds r4, r0, r3 - ldr r5, =0x0000029a - adds r3, r0, r5 - adds r5, 0x2 - adds r5, r0 - mov r8, r5 - cmp r2, 0x1 - beq _081A55C4 - cmp r2, 0x1 - bgt _081A55A8 - cmp r2, 0 - beq _081A55B0 - b _081A5612 - .pool -_081A55A8: - mov r0, r9 - cmp r0, 0x2 - beq _081A55D8 - b _081A5612 -_081A55B0: - adds r0, r4, r7 - movs r6, 0 - ldrsb r6, [r0, r6] - movs r1, 0x1 - adds r0, r7, 0 - eors r0, r1 - adds r0, r4, r0 - movs r1, 0 - ldrsb r1, [r0, r1] - b _081A5612 -_081A55C4: - adds r0, r3, r7 - movs r6, 0 - ldrsb r6, [r0, r6] - movs r1, 0x1 - adds r0, r7, 0 - eors r0, r1 - adds r0, r3, r0 - movs r1, 0 - ldrsb r1, [r0, r1] - b _081A5612 -_081A55D8: - ldr r3, =gBattleMons - mov r9, r3 - movs r5, 0x58 - adds r0, r7, 0 - muls r0, r5 - add r0, r9 - ldrh r0, [r0, 0x28] - movs r4, 0x64 - muls r0, r4 - lsls r1, r7, 1 - add r1, r8 - ldrh r1, [r1] - bl __divsi3 - adds r6, r0, 0 - movs r0, 0x1 - adds r1, r7, 0 - eors r1, r0 - adds r0, r1, 0 - muls r0, r5 - add r0, r9 - ldrh r0, [r0, 0x28] - muls r0, r4 - lsls r1, 1 - add r1, r8 - ldrh r1, [r1] - bl __divsi3 - adds r1, r0, 0 -_081A5612: - cmp r6, r1 - ble _081A5638 - movs r4, 0x2 - cmp r7, 0 - beq _081A5628 - ldr r1, =gBattleTextBuff2 - b _081A562A - .pool -_081A5628: - ldr r1, =gBattleTextBuff1 -_081A562A: - ldrb r0, [r1] - adds r0, 0x2 - strb r0, [r1] - b _081A565E - .pool -_081A5638: - cmp r6, r1 - bne _081A565C - movs r4, 0x1 - cmp r7, 0 - beq _081A564C - ldr r1, =gBattleTextBuff2 - b _081A564E - .pool -_081A564C: - ldr r1, =gBattleTextBuff1 -_081A564E: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _081A565E - .pool -_081A565C: - movs r4, 0 -_081A565E: - ldr r0, =gUnknown_08611F5C - ldr r1, [sp] - mov r2, r10 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - adds r1, r4, 0 - bl StartSpriteAnim - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5558 - - thumb_func_start sub_81A5698 -sub_81A5698: @ 81A5698 - push {lr} - adds r1, r0, 0 - ldr r0, =gBattleCommunication - ldrb r0, [r0] - cmp r0, 0x8 - bls _081A56AA - adds r0, r1, 0 - bl DestroySprite -_081A56AA: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5698 - - thumb_func_start sub_81A56B4 -sub_81A56B4: @ 81A56B4 - ldr r0, =gBattleStruct - ldr r2, [r0] - movs r0, 0xA6 - lsls r0, 2 - adds r1, r2, r0 - adds r0, 0x2 - adds r3, r2, r0 - adds r0, 0x2 - adds r2, r0 - movs r0, 0 - strb r0, [r1] - strb r0, [r1, 0x1] - strb r0, [r3] - strb r0, [r3, 0x1] - ldr r0, =gBattleMons - ldrh r1, [r0, 0x28] - strh r1, [r2] - adds r0, 0x80 - ldrh r0, [r0] - strh r0, [r2, 0x2] - bx lr - .pool - thumb_func_end sub_81A56B4 - - thumb_func_start sub_81A56E8 -sub_81A56E8: @ 81A56E8 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gBattleStruct - ldr r1, [r1] - movs r2, 0xA6 - lsls r2, 2 - adds r1, r2 - adds r1, r0 - ldr r2, =gBattleArenaMoveMindRatings - ldr r0, =gCurrentMove - ldrh r0, [r0] - adds r0, r2 - ldrb r0, [r0] - ldrb r2, [r1] - adds r0, r2 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_81A56E8 - - thumb_func_start sub_81A5718 -sub_81A5718: @ 81A5718 - push {r4-r6,lr} - lsls r0, 24 - lsrs r3, r0, 24 - adds r6, r3, 0 - ldr r0, =gBattleStruct - ldr r2, [r0] - ldr r0, =0x0000029a - adds r5, r2, r0 - ldr r0, =gHitMarker - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 18 - ands r0, r1 - cmp r0, 0 - beq _081A57DA - ldr r0, =0x000002a2 - adds r4, r2, r0 - ldrb r2, [r4] - ldr r0, =gBitTable - lsls r1, r3, 2 - adds r1, r0 - ldr r1, [r1] - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _081A576C - bics r2, r1 - strb r2, [r4] - adds r1, r5, r3 - ldrb r0, [r1] - subs r0, 0x2 - b _081A57D8 - .pool -_081A576C: - ldr r0, =gBattleMoveFlags - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - beq _081A5798 - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081A5788 - ldr r0, =gBattleCommunication - ldrb r0, [r0, 0x6] - cmp r0, 0x1 - beq _081A57DA -_081A5788: - adds r1, r5, r3 - ldrb r0, [r1] - subs r0, 0x2 - b _081A57D8 - .pool -_081A5798: - movs r0, 0x6 - ands r0, r1 - cmp r0, 0x6 - bne _081A57A4 - adds r1, r5, r3 - b _081A57D4 -_081A57A4: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081A57B4 - adds r1, r5, r3 - ldrb r0, [r1] - adds r0, 0x2 - b _081A57D8 -_081A57B4: - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _081A57C4 - adds r1, r5, r3 - ldrb r0, [r1] - subs r0, 0x1 - b _081A57D8 -_081A57C4: - ldr r0, =gProtectStructs - lsls r1, r6, 4 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 31 - cmp r0, 0 - bne _081A57DA - adds r1, r5, r6 -_081A57D4: - ldrb r0, [r1] - adds r0, 0x1 -_081A57D8: - strb r0, [r1] -_081A57DA: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5718 - - thumb_func_start sub_81A57E4 -sub_81A57E4: @ 81A57E4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 16 - lsrs r1, 16 - adds r2, r1, 0 - ldr r0, =gBattleStruct - ldr r0, [r0] - ldr r5, =0x0000029a - adds r3, r0, r5 - movs r0, 0x99 - lsls r0, 1 - cmp r1, r0 - bgt _081A582A - subs r0, 0x1 - cmp r1, r0 - bge _081A585C - cmp r1, 0xC5 - bgt _081A581C - cmp r1, 0xC3 - bge _081A585C - cmp r1, 0x77 - beq _081A585C - b _081A5864 - .pool -_081A581C: - cmp r1, 0xC7 - blt _081A5864 - cmp r1, 0xCC - ble _081A585C - cmp r1, 0xCE - beq _081A585C - b _081A5864 -_081A582A: - ldr r0, =0x00000147 - cmp r1, r0 - beq _081A585C - cmp r1, r0 - bgt _081A5848 - subs r0, 0x12 - cmp r1, r0 - beq _081A585C - adds r0, 0x2 - cmp r1, r0 - beq _081A585C - b _081A5864 - .pool -_081A5848: - movs r0, 0xAD - lsls r0, 1 - cmp r2, r0 - blt _081A5864 - adds r0, 0x1 - cmp r2, r0 - ble _081A585C - adds r0, 0x3 - cmp r2, r0 - bne _081A5864 -_081A585C: - adds r1, r3, r4 - ldrb r0, [r1] - subs r0, 0x3 - strb r0, [r1] -_081A5864: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81A57E4 - - thumb_func_start sub_81A586C -sub_81A586C: @ 81A586C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gBattleStruct - ldr r3, [r1] - movs r1, 0xA7 - lsls r1, 2 - adds r3, r1 - lsls r2, r0, 1 - adds r2, r3 - ldr r5, =gBattleMons - movs r4, 0x58 - adds r1, r0, 0 - muls r1, r4 - adds r1, r5 - ldrh r1, [r1, 0x28] - strh r1, [r2] - movs r1, 0x1 - eors r0, r1 - lsls r1, r0, 1 - adds r1, r3 - muls r0, r4 - adds r0, r5 - ldrh r2, [r0, 0x28] - ldrh r0, [r1] - cmp r0, r2 - bls _081A58A4 - strh r2, [r1] -_081A58A4: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A586C - - thumb_func_start sub_81A58B4 -sub_81A58B4: @ 81A58B4 - push {r4-r6,lr} - ldr r4, =gSaveBlock2Ptr - ldr r1, [r4] - ldr r3, =0x00000ca9 - adds r0, r1, r3 - ldrb r0, [r0] - lsls r0, 30 - lsrs r5, r0, 30 - ldr r0, =0x00000ca8 - adds r1, r0 - movs r2, 0 - strb r2, [r1] - ldr r1, [r4] - ldr r6, =0x00000cb2 - adds r0, r1, r6 - strh r2, [r0] - adds r1, r3 - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r4] - adds r1, r3 - ldrb r2, [r1] - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - cmp r5, 0 - beq _081A5914 - ldr r0, [r4] - ldr r1, =0x00000cdc - adds r0, r1 - ldr r2, [r0] - movs r0, 0x80 - b _081A591E - .pool -_081A5914: - ldr r0, [r4] - ldr r3, =0x00000cdc - adds r0, r3 - ldr r2, [r0] - movs r0, 0x40 -_081A591E: - ands r2, r0 - cmp r2, 0 - bne _081A5930 - ldr r0, [r4] - lsls r1, r5, 1 - ldr r6, =0x00000dda - adds r0, r6 - adds r0, r1 - strh r2, [r0] -_081A5930: - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0x4 - ldrsb r1, [r0, r1] - movs r2, 0x5 - ldrsb r2, [r0, r2] - movs r3, 0x1 - negs r3, r3 - movs r0, 0 - bl saved_warp2_set - ldr r1, =gUnknown_02038BCA - movs r0, 0 - strh r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A58B4 - - thumb_func_start sub_81A5964 -sub_81A5964: @ 81A5964 - push {r4,lr} - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - ldr r1, =0x00000ca9 - adds r0, r3, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r1, r0, 30 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x1 - beq _081A59B0 - cmp r0, 0x1 - bgt _081A5994 - cmp r0, 0 - beq _081A599A - b _081A59EE - .pool -_081A5994: - cmp r0, 0x2 - beq _081A59C8 - b _081A59EE -_081A599A: - ldr r0, =gScriptResult - ldr r2, =0x00000dd8 - adds r1, r3, r2 - ldrh r1, [r1] - strh r1, [r0] - b _081A59EE - .pool -_081A59B0: - ldr r2, =gScriptResult - lsls r1, 1 - ldr r4, =0x00000dda - adds r0, r3, r4 - adds r0, r1 - ldrh r0, [r0] - b _081A59EC - .pool -_081A59C8: - cmp r1, 0 - beq _081A59E0 - ldr r2, =gScriptResult - ldr r1, =0x00000cdc - adds r0, r3, r1 - ldr r0, [r0] - movs r1, 0x80 - b _081A59EA - .pool -_081A59E0: - ldr r2, =gScriptResult - ldr r4, =0x00000cdc - adds r0, r3, r4 - ldr r0, [r0] - movs r1, 0x40 -_081A59EA: - ands r0, r1 -_081A59EC: - strh r0, [r2] -_081A59EE: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5964 - - thumb_func_start sub_81A59FC -sub_81A59FC: @ 81A59FC - push {lr} - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r1, =0x00000ca9 - adds r0, r2, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r1, r0, 30 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x1 - beq _081A5A48 - cmp r0, 0x1 - bgt _081A5A2C - cmp r0, 0 - beq _081A5A32 - b _081A5ABA - .pool -_081A5A2C: - cmp r0, 0x2 - beq _081A5A60 - b _081A5ABA -_081A5A32: - ldr r0, =gSpecialVar_0x8006 - ldrh r1, [r0] - ldr r3, =0x00000dd8 - adds r0, r2, r3 - strh r1, [r0] - b _081A5ABA - .pool -_081A5A48: - lsls r1, 1 - ldr r3, =0x00000dda - adds r0, r2, r3 - adds r0, r1 - ldr r1, =gSpecialVar_0x8006 - ldrh r1, [r1] - strh r1, [r0] - b _081A5ABA - .pool -_081A5A60: - cmp r1, 0 - beq _081A5A90 - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - cmp r0, 0 - beq _081A5A80 - ldr r1, =0x00000cdc - adds r0, r2, r1 - ldr r1, [r0] - movs r2, 0x80 - orrs r1, r2 - b _081A5AB8 - .pool -_081A5A80: - ldr r3, =0x00000cdc - adds r0, r2, r3 - ldr r1, [r0] - movs r2, 0x81 - negs r2, r2 - b _081A5AB6 - .pool -_081A5A90: - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - cmp r0, 0 - beq _081A5AAC - ldr r1, =0x00000cdc - adds r0, r2, r1 - ldr r1, [r0] - movs r2, 0x40 - orrs r1, r2 - b _081A5AB8 - .pool -_081A5AAC: - ldr r3, =0x00000cdc - adds r0, r2, r3 - ldr r1, [r0] - movs r2, 0x41 - negs r2, r2 -_081A5AB6: - ands r1, r2 -_081A5AB8: - str r1, [r0] -_081A5ABA: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A59FC - - thumb_func_start sub_81A5AC4 -sub_81A5AC4: @ 81A5AC4 - push {r4,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =gSpecialVar_0x8005 - ldrh r1, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - strb r1, [r0] - movs r0, 0x80 - lsls r0, 7 - movs r1, 0 - bl VarSet - ldr r1, [r4] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - bl sub_81A4C30 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5AC4 - - thumb_func_start sub_81A5B08 -sub_81A5B08: @ 81A5B08 - push {r4,r5,lr} - ldr r4, =gSaveBlock2Ptr - ldr r1, [r4] - ldr r2, =0x00000ca9 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 29 - ldr r2, =0x00000dda - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0x29 - bls _081A5B58 - bl Random - ldr r4, [r4] - ldr r5, =gUnknown_08611FAC - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x9 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 15 - adds r0, r5 - ldrh r0, [r0] - ldr r1, =0x00000dd8 - adds r4, r1 - b _081A5B76 - .pool -_081A5B58: - bl Random - ldr r4, [r4] - ldr r5, =gUnknown_08611FA0 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x6 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 15 - adds r0, r5 - ldrh r0, [r0] - ldr r2, =0x00000dd8 - adds r4, r2 -_081A5B76: - strh r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5B08 - - thumb_func_start sub_81A5B88 -sub_81A5B88: @ 81A5B88 - push {r4,r5,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000dd8 - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x1 - bl AddBagItem - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - bne _081A5BD0 - ldr r0, [r4] - ldr r1, =0x00000dd8 - adds r0, r1 - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r0, [r4] - ldr r1, =0x00000dd8 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - ldr r0, =gScriptResult - strh r5, [r0] - b _081A5BD6 - .pool -_081A5BD0: - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] -_081A5BD6: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5B88 - - thumb_func_start sub_81A5BE0 -sub_81A5BE0: @ 81A5BE0 - push {lr} - ldr r0, =gStringVar1 - ldr r1, =gUnknown_02038BCA - ldrh r1, [r1] - bl sub_8162E20 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5BE0 - - thumb_func_start sub_81A5BF8 -sub_81A5BF8: @ 81A5BF8 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0xC - movs r0, 0x1B - mov r8, r0 - movs r5, 0x7 - movs r4, 0x1 - str r4, [sp] - movs r6, 0x6 - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0xFE - movs r3, 0xE - bl FillBgTilemapBufferRect - str r4, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0x20 - movs r3, 0xE - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x31 - movs r2, 0 - movs r3, 0xE - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x33 - movs r2, 0x1 - movs r3, 0xE - bl FillBgTilemapBufferRect - mov r0, r8 - str r0, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x34 - movs r2, 0x2 - movs r3, 0xE - bl FillBgTilemapBufferRect - movs r0, 0x1C - mov r8, r0 - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x35 - movs r2, 0x1C - movs r3, 0xE - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x36 - movs r2, 0x1D - movs r3, 0xE - bl FillBgTilemapBufferRect - str r4, [sp] - movs r6, 0x5 - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x37 - movs r2, 0 - movs r3, 0xF - bl FillBgTilemapBufferRect - mov r0, r8 - str r0, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x39 - movs r2, 0x1 - movs r3, 0xF - bl FillBgTilemapBufferRect - str r4, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x3A - movs r2, 0x1D - movs r3, 0xF - bl FillBgTilemapBufferRect - ldr r1, =0x00000831 - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r2, 0 - movs r3, 0x13 - bl FillBgTilemapBufferRect - ldr r1, =0x00000833 - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r2, 0x1 - movs r3, 0x13 - bl FillBgTilemapBufferRect - ldr r1, =0x00000834 - movs r0, 0x1A - str r0, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r2, 0x2 - movs r3, 0x13 - bl FillBgTilemapBufferRect - ldr r1, =0x00000835 - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r2, 0x1C - movs r3, 0x13 - bl FillBgTilemapBufferRect - ldr r1, =0x00000836 - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r2, 0x1D - movs r3, 0x13 - bl FillBgTilemapBufferRect - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5BF8 - - thumb_func_start sub_81A5D44 -sub_81A5D44: @ 81A5D44 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0xC - movs r5, 0 - movs r4, 0x1 - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x3 - movs r2, 0 - movs r3, 0xE - bl FillBgTilemapBufferRect - movs r6, 0x4 - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x4 - movs r2, 0x1 - movs r3, 0xE - bl FillBgTilemapBufferRect - movs r0, 0x1B - mov r8, r0 - str r0, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x5 - movs r2, 0x2 - movs r3, 0xE - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x6 - movs r2, 0x1C - movs r3, 0xE - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x7 - movs r2, 0x1D - movs r3, 0xE - bl FillBgTilemapBufferRect - str r4, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x8 - movs r2, 0 - movs r3, 0xF - bl FillBgTilemapBufferRect - str r4, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x9 - movs r2, 0x1 - movs r3, 0xF - bl FillBgTilemapBufferRect - mov r0, r8 - str r0, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0xA - movs r2, 0x2 - movs r3, 0xF - bl FillBgTilemapBufferRect - str r4, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0xB - movs r2, 0x1C - movs r3, 0xF - bl FillBgTilemapBufferRect - str r4, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0xC - movs r2, 0x1D - movs r3, 0xF - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0xD - movs r2, 0 - movs r3, 0x13 - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0xE - movs r2, 0x1 - movs r3, 0x13 - bl FillBgTilemapBufferRect - mov r0, r8 - str r0, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0xF - movs r2, 0x2 - movs r3, 0x13 - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x10 - movs r2, 0x1C - movs r3, 0x13 - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x11 - movs r2, 0x1D - movs r3, 0x13 - bl FillBgTilemapBufferRect - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81A5D44 - - thumb_func_start sub_81A5E74 -sub_81A5E74: @ 81A5E74 - push {lr} - ldr r1, =gUnknown_08612120 - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5E74 - - thumb_func_start sub_81A5E94 -sub_81A5E94: @ 81A5E94 - push {r4-r7,lr} - ldr r5, =gSaveBlock2Ptr - ldr r0, [r5] - ldr r4, =0x00000ca9 - adds r0, r4 - ldrb r0, [r0] - lsls r0, 30 - lsrs r7, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, [r5] - ldr r1, =0x00000ca8 - adds r0, r1 - movs r2, 0 - strb r2, [r0] - ldr r1, [r5] - ldr r3, =0x00000cb2 - adds r0, r1, r3 - strh r2, [r0] - adds r1, r4 - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r5] - adds r1, r4 - ldrb r2, [r1] - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r4, [r5] - ldr r0, =0x00000cdc - adds r3, r4, r0 - ldr r2, =gUnknown_08612164 - lsls r0, r7, 2 - lsls r1, r6, 3 - adds r0, r1 - adds r0, r2 - ldr r3, [r3] - ldr r0, [r0] - ands r3, r0 - cmp r3, 0 - bne _081A5F0A - lsls r1, r7, 1 - lsls r0, r6, 2 - adds r1, r0 - ldr r2, =0x00000de2 - adds r0, r4, r2 - adds r0, r1 - strh r3, [r0] - adds r2, 0x10 - adds r0, r4, r2 - adds r0, r1 - strh r3, [r0] -_081A5F0A: - ldr r1, =gUnknown_03001288 - movs r0, 0 - strb r0, [r1] - movs r2, 0 - ldr r6, =gSaveBlock1Ptr - movs r4, 0xE7 - lsls r4, 4 - ldr r0, =0x0000ffff - adds r3, r0, 0 -_081A5F1C: - ldr r1, [r5] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r1, r0 - adds r1, r4 - ldrh r0, [r1] - orrs r0, r3 - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x5 - bls _081A5F1C - movs r2, 0 - ldr r4, =gUnknown_03006298 - ldr r1, =0x0000ffff - adds r3, r1, 0 -_081A5F40: - lsls r0, r2, 1 - adds r0, r4 - ldrh r1, [r0] - orrs r1, r3 - strh r1, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x2 - bls _081A5F40 - ldr r0, [r6] - movs r1, 0x4 - ldrsb r1, [r0, r1] - movs r2, 0x5 - ldrsb r2, [r0, r2] - movs r3, 0x1 - negs r3, r3 - movs r0, 0 - bl saved_warp2_set - ldr r1, =gUnknown_02038BCA - movs r0, 0 - strh r0, [r1] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5E94 - - thumb_func_start sub_81A5FA8 -sub_81A5FA8: @ 81A5FA8 - push {r4-r7,lr} - ldr r7, =gSaveBlock2Ptr - ldr r0, [r7] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r6, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x2 - beq _081A6000 - cmp r0, 0x2 - bgt _081A5FE4 - cmp r0, 0x1 - beq _081A5FEA - b _081A6044 - .pool -_081A5FE4: - cmp r0, 0x3 - beq _081A6030 - b _081A6044 -_081A5FEA: - ldr r3, =gScriptResult - ldr r0, [r7] - lsls r1, r6, 1 - lsls r2, r5, 2 - adds r1, r2 - ldr r2, =0x00000de2 - b _081A603C - .pool -_081A6000: - ldr r4, =gScriptResult - ldr r2, [r7] - ldr r0, =0x00000cdc - adds r2, r0 - ldr r3, =gUnknown_08612164 - lsls r0, r6, 2 - lsls r1, r5, 3 - adds r0, r1 - adds r0, r3 - ldr r1, [r2] - ldr r0, [r0] - ands r1, r0 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - strh r0, [r4] - b _081A6044 - .pool -_081A6030: - ldr r3, =gScriptResult - ldr r0, [r7] - lsls r1, r6, 1 - lsls r2, r5, 2 - adds r1, r2 - ldr r2, =0x00000df2 -_081A603C: - adds r0, r2 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r3] -_081A6044: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5FA8 - - thumb_func_start sub_81A6054 -sub_81A6054: @ 81A6054 - push {r4-r6,lr} - ldr r6, =gSaveBlock2Ptr - ldr r0, [r6] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r5, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x2 - beq _081A60B4 - cmp r0, 0x2 - bgt _081A6090 - cmp r0, 0x1 - beq _081A6096 - b _081A6128 - .pool -_081A6090: - cmp r0, 0x3 - beq _081A6108 - b _081A6128 -_081A6096: - ldr r2, [r6] - lsls r0, r5, 1 - lsls r1, r4, 2 - adds r0, r1 - ldr r1, =0x00000de2 - adds r2, r1 - adds r2, r0 - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - strh r0, [r2] - b _081A6128 - .pool -_081A60B4: - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - cmp r0, 0 - beq _081A60E4 - ldr r2, [r6] - ldr r0, =0x00000cdc - adds r2, r0 - ldr r3, =gUnknown_08612164 - lsls r1, r5, 2 - lsls r0, r4, 3 - adds r1, r0 - adds r1, r3 - ldr r0, [r2] - ldr r1, [r1] - orrs r0, r1 - str r0, [r2] - b _081A6128 - .pool -_081A60E4: - ldr r2, [r6] - ldr r1, =0x00000cdc - adds r2, r1 - ldr r3, =gUnknown_08612174 - lsls r1, r5, 2 - lsls r0, r4, 3 - adds r1, r0 - adds r1, r3 - ldr r0, [r2] - ldr r1, [r1] - ands r0, r1 - str r0, [r2] - b _081A6128 - .pool -_081A6108: - ldr r3, =gUnknown_03001288 - ldrb r0, [r3] - cmp r0, 0x1 - bne _081A6128 - ldr r2, [r6] - lsls r0, r5, 1 - lsls r1, r4, 2 - adds r0, r1 - ldr r1, =0x00000df2 - adds r2, r1 - adds r2, r0 - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - movs r1, 0 - strh r0, [r2] - strb r1, [r3] -_081A6128: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A6054 - - thumb_func_start sub_81A613C -sub_81A613C: @ 81A613C - push {r4,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =gSpecialVar_0x8005 - ldrh r1, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - strb r1, [r0] - movs r0, 0x80 - lsls r0, 7 - movs r1, 0 - bl VarSet - ldr r1, [r4] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - bl sub_81A4C30 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A613C - - thumb_func_start nullsub_75 -nullsub_75: @ 81A6180 - bx lr - thumb_func_end nullsub_75 - - thumb_func_start nullsub_123 -nullsub_123: @ 81A6184 - bx lr - thumb_func_end nullsub_123 - - thumb_func_start sub_81A6188 -sub_81A6188: @ 81A6188 - push {lr} - bl zero_player_party_data - bl sub_819A4F8 - pop {r0} - bx r0 - thumb_func_end sub_81A6188 - - thumb_func_start sub_81A6198 -sub_81A6198: @ 81A6198 - push {lr} - bl sub_819DC00 - pop {r0} - bx r0 - thumb_func_end sub_81A6198 - - thumb_func_start sub_81A61A4 -sub_81A61A4: @ 81A61A4 - ldr r1, =gUnknown_03001288 - movs r0, 0x1 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_81A61A4 - - thumb_func_start sub_81A61B0 -sub_81A61B0: @ 81A61B0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x28 - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - str r0, [sp, 0x10] - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - ldr r1, [r4] - ldr r3, [sp, 0x10] - lsls r2, r3, 1 - lsrs r0, 14 - adds r2, r0 - ldr r6, =0x00000de2 - adds r1, r6 - adds r1, r2 - ldrh r0, [r1] - movs r1, 0x7 - bl __udivsi3 - ldr r2, =gUnknown_0203BC88 - ldr r1, =gBattleFrontierTrainers - str r1, [r2] - ldr r5, =0x00000cb2 - lsls r0, 24 - str r0, [sp, 0x20] - mov r8, r0 -_081A61FA: - ldr r0, [r4] - adds r0, r5 - ldrb r1, [r0] - mov r2, r8 - lsrs r0, r2, 24 - bl sub_8162548 - lsls r0, 16 - lsrs r3, r0, 16 - movs r7, 0 - ldr r1, [r4] - adds r0, r1, r5 - ldr r6, [sp, 0x10] - lsls r6, 24 - str r6, [sp, 0x1C] - ldrh r0, [r0] - cmp r7, r0 - bge _081A6244 - ldr r2, =0x00000cb4 - adds r0, r1, r2 - ldrh r0, [r0] - ldr r6, =gSaveBlock2Ptr - cmp r0, r3 - beq _081A6244 - ldr r1, [r6] - ldr r6, =0x00000cb2 - adds r0, r1, r6 - ldrh r2, [r0] - ldr r0, =0x00000cb4 - adds r1, r0 -_081A6236: - adds r1, 0x2 - adds r7, 0x1 - cmp r7, r2 - bge _081A6244 - ldrh r0, [r1] - cmp r0, r3 - bne _081A6236 -_081A6244: - ldr r0, [r4] - ldr r1, =0x00000cb2 - adds r0, r1 - ldr r6, =gSaveBlock2Ptr - ldrh r0, [r0] - cmp r7, r0 - bne _081A61FA - ldr r0, =gUnknown_02038BCA - strh r3, [r0] - ldr r2, [r6] - adds r1, r2, r1 - ldrh r0, [r1] - cmp r0, 0x5 - bhi _081A626C - adds r1, r0, 0 - lsls r1, 1 - ldr r4, =0x00000cb4 - adds r0, r2, r4 - adds r0, r1 - strh r3, [r0] -_081A626C: - movs r7, 0 - mov r10, sp - movs r6, 0 - lsls r6, 1 - str r6, [sp, 0x14] - add r6, sp - str r6, [sp, 0x18] -_081A627A: - ldr r1, [sp, 0x1C] - lsrs r0, r1, 24 - ldr r2, [sp, 0x20] - lsrs r1, r2, 24 - movs r2, 0 - bl sub_81A6EF0 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - ldr r4, =gUnknown_0203BC8C - ldr r2, [r4] - lsls r1, r0, 4 - adds r0, r1, r2 - ldrh r0, [r0] - cmp r0, 0xC9 - beq _081A636E - movs r3, 0 - ldr r6, =gSaveBlock2Ptr - mov r8, r1 - adds r5, r0, 0 - ldr r1, [r6] -_081A62A6: - movs r4, 0xE7 - lsls r4, 4 - adds r0, r1, r4 - ldrh r0, [r0] - lsls r0, 4 - adds r0, r2 - ldrh r0, [r0] - cmp r5, r0 - beq _081A62C0 - adds r1, 0xC - adds r3, 0x1 - cmp r3, 0x5 - ble _081A62A6 -_081A62C0: - cmp r3, 0x6 - bne _081A636E - ldr r6, [sp, 0x10] - cmp r6, 0 - bne _081A62D0 - ldr r0, =0x00000351 - cmp r9, r0 - bhi _081A636E -_081A62D0: - movs r2, 0 - adds r4, r2, r7 - cmp r2, r4 - bge _081A6302 - ldr r1, [sp, 0x18] - ldrh r0, [r1] - cmp r0, r5 - beq _081A6302 - adds r6, r4, 0 - ldr r3, =gUnknown_0203BC8C - mov r12, r3 - mov r5, r8 - ldr r3, [sp, 0x14] - add r3, sp -_081A62EC: - adds r3, 0x2 - adds r2, 0x1 - cmp r2, r6 - bge _081A6302 - mov r1, r12 - ldr r0, [r1] - adds r0, r5, r0 - ldrh r1, [r3] - ldrh r0, [r0] - cmp r1, r0 - bne _081A62EC -_081A6302: - cmp r2, r4 - bne _081A636E - movs r2, 0 - cmp r2, r4 - bge _081A633E - ldr r3, =gBattleFrontierHeldItems - mov r12, r3 - add r0, sp, 0x8 - ldr r6, [sp, 0x14] - adds r3, r0, r6 - mov r0, r8 - str r0, [sp, 0x24] - adds r5, r4, 0 -_081A631C: - ldrh r1, [r3] - cmp r1, 0 - beq _081A6336 - ldr r6, =gUnknown_0203BC8C - ldr r0, [r6] - ldr r6, [sp, 0x24] - adds r0, r6, r0 - ldrb r0, [r0, 0xA] - lsls r0, 1 - add r0, r12 - ldrh r0, [r0] - cmp r1, r0 - beq _081A633E -_081A6336: - adds r3, 0x2 - adds r2, 0x1 - cmp r2, r5 - blt _081A631C -_081A633E: - cmp r2, r4 - bne _081A636E - lsls r4, r7, 1 - ldr r0, =gUnknown_0203BC8C - ldr r1, [r0] - add r1, r8 - ldrh r0, [r1] - mov r2, r10 - strh r0, [r2] - add r2, sp, 0x8 - adds r2, r4 - ldr r3, =gBattleFrontierHeldItems - ldrb r0, [r1, 0xA] - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - strh r0, [r2] - ldr r0, =gUnknown_03006298 - adds r4, r0 - mov r3, r9 - strh r3, [r4] - movs r4, 0x2 - add r10, r4 - adds r7, 0x1 -_081A636E: - cmp r7, 0x3 - bne _081A627A - add sp, 0x28 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A61B0 - - thumb_func_start sub_81A63B8 -sub_81A63B8: @ 81A63B8 - push {lr} - ldr r0, =gUnknown_02038BCA - ldrh r0, [r0] - movs r1, 0 - bl sub_8162614 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A63B8 - - thumb_func_start sub_81A63CC -sub_81A63CC: @ 81A63CC - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x2 - beq _081A63FC - ldr r1, =gUnknown_0203BC8C - ldr r0, =gBattleFrontierMons - b _081A6400 - .pool -_081A63FC: - ldr r1, =gUnknown_0203BC8C - ldr r0, =gSlateportBattleTentMons -_081A6400: - str r0, [r1] - movs r7, 0 - ldr r2, =gSaveBlock2Ptr - mov r8, r2 -_081A6408: - mov r0, r8 - ldr r1, [r0] - adds r0, r7, 0x3 - lsls r4, r0, 1 - adds r4, r0 - lsls r4, 2 - adds r1, r4 - ldr r0, =gUnknown_03006298 - lsls r6, r7, 1 - adds r6, r0 - ldrh r0, [r6] - movs r2, 0xE7 - lsls r2, 4 - adds r1, r2 - strh r0, [r1] - movs r0, 0x64 - adds r5, r7, 0 - muls r5, r0 - ldr r0, =gEnemyParty - adds r5, r0 - adds r0, r5, 0 - movs r1, 0x28 - movs r2, 0 - bl pokemon_getattr_encrypted - mov r2, r8 - ldr r1, [r2] - adds r1, r4 - ldr r2, =0x00000e78 - adds r1, r2 - strb r0, [r1] - adds r0, r5, 0 - movs r1, 0 - movs r2, 0 - bl GetMonData - mov r2, r8 - ldr r1, [r2] - ldr r2, =0x00000e74 - adds r1, r2 - adds r1, r4 - str r0, [r1] - adds r0, r5, 0 - movs r1, 0x2E - movs r2, 0 - bl pokemon_getattr_encrypted - mov r2, r8 - ldr r1, [r2] - adds r1, r4 - ldr r2, =0x00000e79 - adds r1, r2 - strb r0, [r1] - ldrh r1, [r6] - ldr r0, =gUnknown_0203BC8C - ldr r0, [r0] - lsls r1, 4 - adds r1, r0 - ldrb r2, [r1, 0xA] - lsls r2, 1 - ldr r0, =gBattleFrontierHeldItems - adds r2, r0 - adds r0, r5, 0 - movs r1, 0xC - bl SetMonData - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x2 - bls _081A6408 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A63CC - - thumb_func_start sub_81A64C4 -sub_81A64C4: @ 81A64C4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r2, r0, r1 - ldrb r1, [r2] - movs r3, 0x3 - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0x2 - bne _081A6500 - ldr r1, =gUnknown_0203BC8C - ldr r0, =gSlateportBattleTentMons - str r0, [r1] - movs r2, 0x1E - str r2, [sp, 0x14] - b _081A6518 - .pool -_081A6500: - ldr r1, =gUnknown_0203BC8C - ldr r0, =gBattleFrontierMons - str r0, [r1] - ldrb r1, [r2] - adds r0, r3, 0 - ands r0, r1 - movs r4, 0x32 - str r4, [sp, 0x14] - cmp r0, 0 - beq _081A6518 - movs r5, 0x64 - str r5, [sp, 0x14] -_081A6518: - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x1 - bls _081A6522 - b _081A666C -_081A6522: - bl zero_player_party_data - movs r0, 0 - mov r8, r0 - mov r1, sp - adds r1, 0x12 - str r1, [sp, 0x1C] - ldr r2, =gUnknown_0203BC8C - mov r9, r2 -_081A6534: - ldr r4, =gSaveBlock2Ptr - ldr r2, [r4] - mov r5, r8 - lsls r5, 1 - mov r10, r5 - mov r3, r10 - add r3, r8 - lsls r3, 2 - adds r1, r2, r3 - movs r4, 0xE7 - lsls r4, 4 - adds r0, r1, r4 - ldrh r7, [r0] - ldr r5, =0x00000e78 - adds r1, r5 - ldrb r6, [r1] - movs r1, 0x64 - mov r0, r8 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - mov r4, r9 - ldr r1, [r4] - lsls r4, r7, 4 - adds r1, r4, r1 - ldrh r1, [r1] - movs r5, 0x1 - str r5, [sp] - ldr r5, =0x00000e74 - adds r2, r5 - adds r2, r3 - ldr r2, [r2] - str r2, [sp, 0x4] - movs r2, 0 - str r2, [sp, 0x8] - str r2, [sp, 0xC] - ldr r2, [sp, 0x14] - adds r3, r6, 0 - bl create_pokemon_set_level - movs r1, 0 - mov r2, r9 - ldr r0, [r2] - adds r4, r0 - ldrb r4, [r4, 0xB] - mov r5, r8 - adds r5, 0x1 - str r5, [sp, 0x18] - movs r5, 0x5 -_081A6596: - adds r0, r4, 0 - movs r2, 0x1 - ands r0, r2 - cmp r0, 0 - beq _081A65A2 - adds r1, 0x1 -_081A65A2: - lsrs r4, 1 - subs r5, 0x1 - cmp r5, 0 - bge _081A6596 - movs r0, 0xFF - lsls r0, 1 - bl __divsi3 - add r1, sp, 0x10 - strh r0, [r1] - movs r4, 0x1 - movs r5, 0 - lsls r7, 4 - movs r0, 0x64 - mov r6, r8 - muls r6, r0 - ldr r3, =gPlayerParty -_081A65C4: - mov r1, r9 - ldr r0, [r1] - adds r0, r7, r0 - ldrb r0, [r0, 0xB] - ands r0, r4 - cmp r0, 0 - beq _081A65E2 - adds r1, r5, 0 - adds r1, 0x1A - adds r0, r6, r3 - add r2, sp, 0x10 - str r3, [sp, 0x20] - bl SetMonData - ldr r3, [sp, 0x20] -_081A65E2: - lsls r0, r4, 25 - lsrs r4, r0, 24 - adds r5, 0x1 - cmp r5, 0x5 - ble _081A65C4 - movs r2, 0x64 - mov r4, r8 - muls r4, r2 - ldr r5, =gPlayerParty - adds r0, r4, r5 - bl pokemon_calc_effective_stats - movs r0, 0 - ldr r1, [sp, 0x1C] - strb r0, [r1] - movs r6, 0 -_081A6602: - mov r2, r9 - ldr r0, [r2] - adds r0, r7, r0 - lsls r1, r6, 1 - adds r0, 0x2 - adds r0, r1 - ldrh r1, [r0] - lsls r2, r6, 24 - lsrs r2, 24 - adds r0, r4, r5 - bl sub_81A7024 - adds r6, 0x1 - cmp r6, 0x3 - ble _081A6602 - movs r5, 0x64 - mov r4, r8 - muls r4, r5 - ldr r0, =gPlayerParty - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x20 - ldr r2, [sp, 0x1C] - bl SetMonData - mov r1, r9 - ldr r0, [r1] - adds r0, r7, r0 - ldrb r2, [r0, 0xA] - lsls r2, 1 - ldr r0, =gBattleFrontierHeldItems - adds r2, r0 - adds r0, r4, 0 - movs r1, 0xC - bl SetMonData - mov r2, r10 - add r2, r8 - lsls r2, 2 - ldr r5, =gSaveBlock2Ptr - ldr r0, [r5] - adds r2, r0 - ldr r0, =0x00000e79 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x2E - bl SetMonData - ldr r1, [sp, 0x18] - mov r8, r1 - cmp r1, 0x2 - bgt _081A666C - b _081A6534 -_081A666C: - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0 - beq _081A667A - cmp r0, 0x2 - beq _081A667A - b _081A67AE -_081A667A: - movs r2, 0 - mov r8, r2 - ldr r4, =gUnknown_0203BC8C - mov r9, r4 -_081A6682: - ldr r5, =gSaveBlock2Ptr - ldr r3, [r5] - mov r0, r8 - adds r0, 0x3 - lsls r2, r0, 1 - adds r2, r0 - lsls r2, 2 - adds r1, r3, r2 - movs r4, 0xE7 - lsls r4, 4 - adds r0, r1, r4 - ldrh r7, [r0] - ldr r5, =0x00000e78 - adds r1, r5 - ldrb r6, [r1] - movs r1, 0x64 - mov r0, r8 - muls r0, r1 - ldr r1, =gEnemyParty - adds r0, r1 - mov r4, r9 - ldr r1, [r4] - lsls r4, r7, 4 - adds r1, r4, r1 - ldrh r1, [r1] - movs r5, 0x1 - str r5, [sp] - ldr r5, =0x00000e74 - adds r3, r5 - adds r3, r2 - ldr r2, [r3] - str r2, [sp, 0x4] - movs r2, 0 - str r2, [sp, 0x8] - str r2, [sp, 0xC] - ldr r2, [sp, 0x14] - adds r3, r6, 0 - bl create_pokemon_set_level - movs r1, 0 - mov r2, r9 - ldr r0, [r2] - adds r4, r0 - ldrb r4, [r4, 0xB] - mov r5, r8 - lsls r5, 1 - mov r10, r5 - mov r0, r8 - adds r0, 0x1 - str r0, [sp, 0x18] - movs r5, 0x5 -_081A66E8: - adds r0, r4, 0 - movs r2, 0x1 - ands r0, r2 - cmp r0, 0 - beq _081A66F4 - adds r1, 0x1 -_081A66F4: - lsrs r4, 1 - subs r5, 0x1 - cmp r5, 0 - bge _081A66E8 - add r4, sp, 0x10 - movs r0, 0xFF - lsls r0, 1 - bl __divsi3 - strh r0, [r4] - movs r4, 0x1 - movs r5, 0 - lsls r7, 4 - movs r0, 0x64 - mov r6, r8 - muls r6, r0 - ldr r3, =gEnemyParty -_081A6716: - mov r1, r9 - ldr r0, [r1] - adds r0, r7, r0 - ldrb r0, [r0, 0xB] - ands r0, r4 - cmp r0, 0 - beq _081A6734 - adds r1, r5, 0 - adds r1, 0x1A - adds r0, r6, r3 - add r2, sp, 0x10 - str r3, [sp, 0x20] - bl SetMonData - ldr r3, [sp, 0x20] -_081A6734: - lsls r0, r4, 25 - lsrs r4, r0, 24 - adds r5, 0x1 - cmp r5, 0x5 - ble _081A6716 - movs r2, 0x64 - mov r4, r8 - muls r4, r2 - ldr r5, =gEnemyParty - adds r0, r4, r5 - bl pokemon_calc_effective_stats - movs r6, 0 -_081A674E: - mov r1, r9 - ldr r0, [r1] - adds r0, r7, r0 - lsls r1, r6, 1 - adds r0, 0x2 - adds r0, r1 - ldrh r1, [r0] - lsls r2, r6, 24 - lsrs r2, 24 - adds r0, r4, r5 - bl sub_81A7024 - adds r6, 0x1 - cmp r6, 0x3 - ble _081A674E - movs r2, 0x64 - mov r4, r8 - muls r4, r2 - ldr r0, =gEnemyParty - adds r4, r0 - mov r5, r9 - ldr r0, [r5] - adds r0, r7, r0 - ldrb r2, [r0, 0xA] - lsls r2, 1 - ldr r0, =gBattleFrontierHeldItems - adds r2, r0 - adds r0, r4, 0 - movs r1, 0xC - bl SetMonData - mov r2, r10 - add r2, r8 - lsls r2, 2 - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - adds r2, r0 - ldr r5, =0x00000e9d - adds r2, r5 - adds r0, r4, 0 - movs r1, 0x2E - bl SetMonData - ldr r0, [sp, 0x18] - mov r8, r0 - cmp r0, 0x2 - bgt _081A67AE - b _081A6682 -_081A67AE: - add sp, 0x24 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A64C4 - - thumb_func_start sub_81A67EC -sub_81A67EC: @ 81A67EC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4C - ldr r1, =gUnknown_0203BC88 - ldr r0, =gBattleFrontierTrainers - str r0, [r1] - mov r0, sp - adds r0, 0xC - str r0, [sp, 0x38] - mov r1, sp - adds r1, 0x18 - str r1, [sp, 0x3C] - ldr r2, =gSaveBlock2Ptr - mov r9, r2 - movs r2, 0 - adds r3, r1, 0 - adds r1, r0, 0 - mov r0, sp - movs r4, 0x5 - mov r8, r4 -_081A681A: - strh r2, [r0] - strh r2, [r1] - strh r2, [r3] - adds r3, 0x2 - adds r1, 0x2 - adds r0, 0x2 - movs r5, 0x1 - negs r5, r5 - add r8, r5 - mov r4, r8 - cmp r4, 0 - bge _081A681A - mov r5, r9 - ldr r0, [r5] - ldr r7, =0x00000ca9 - adds r0, r7 - ldrb r4, [r0] - lsls r4, 30 - lsrs r4, 30 - ldr r6, =0x000040ce - adds r0, r6, 0 - bl VarGet - lsls r0, 24 - ldr r1, [r5] - lsls r4, 1 - lsrs r0, 22 - adds r4, r0 - ldr r5, =0x00000de2 - adds r1, r5 - adds r1, r4 - ldrh r0, [r1] - movs r1, 0x7 - bl __udivsi3 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x24] - adds r0, r6, 0 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - movs r2, 0 - cmp r0, 0x1 - bne _081A6878 - movs r2, 0x1 -_081A6878: - ldr r1, =gUnknown_0203BC8C - ldr r0, =gBattleFrontierMons - str r0, [r1] - mov r1, r9 - ldr r0, [r1] - adds r0, r7 - ldrb r1, [r0] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _081A68B4 - movs r4, 0x1 - str r4, [sp, 0x28] - b _081A68B8 - .pool -_081A68B4: - movs r5, 0 - str r5, [sp, 0x28] -_081A68B8: - adds r0, r2, 0 - ldr r1, [sp, 0x28] - bl sub_81A6F70 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x2C] - movs r0, 0 - mov r10, r0 - mov r8, r0 - ldr r1, [sp, 0x3C] - str r1, [sp, 0x40] - mov r2, sp - str r2, [sp, 0x44] - lsls r4, r0, 1 - str r4, [sp, 0x30] - ldr r5, [sp, 0x38] - adds r5, r4 - str r5, [sp, 0x34] -_081A68DE: - ldr r0, [sp, 0x2C] - cmp r8, r0 - bge _081A68EC - ldr r0, [sp, 0x28] - ldr r1, [sp, 0x24] - movs r2, 0x1 - b _081A68F2 -_081A68EC: - ldr r0, [sp, 0x28] - ldr r1, [sp, 0x24] - movs r2, 0 -_081A68F2: - bl sub_81A6EF0 - lsls r0, 16 - lsrs r7, r0, 16 - ldr r0, =gUnknown_0203BC8C - ldr r1, [r0] - lsls r2, r7, 4 - adds r4, r2, r1 - ldrh r1, [r4] - mov r9, r2 - cmp r1, 0xC9 - beq _081A69E2 - movs r3, 0 - mov r2, r8 - adds r6, r3, r2 - cmp r3, r6 - bge _081A6950 - ldr r5, [sp, 0x34] - ldrh r0, [r5] - cmp r0, r7 - beq _081A6950 - mov r12, r4 - adds r2, r1, 0 - lsls r4, r3, 1 - ldr r1, [sp, 0x30] - add r1, sp - str r6, [sp, 0x48] -_081A6928: - ldrh r0, [r1] - cmp r0, r2 - bne _081A693A - mov r0, r10 - cmp r0, 0 - bne _081A6950 - mov r5, r12 - ldrh r5, [r5] - mov r10, r5 -_081A693A: - adds r4, 0x2 - adds r1, 0x2 - adds r3, 0x1 - ldr r0, [sp, 0x48] - cmp r3, r0 - bge _081A6950 - ldr r5, [sp, 0x38] - adds r0, r5, r4 - ldrh r0, [r0] - cmp r0, r7 - bne _081A6928 -_081A6950: - cmp r3, r6 - bne _081A69E2 - movs r3, 0 - cmp r3, r6 - bge _081A699C - ldr r0, =gBattleFrontierHeldItems - mov r12, r0 - ldr r1, [sp, 0x30] - ldr r2, [sp, 0x3C] - adds r5, r1, r2 -_081A6964: - ldrh r4, [r5] - cmp r4, 0 - beq _081A6994 - ldr r1, =gUnknown_0203BC8C - ldr r0, [r1] - mov r2, r9 - adds r1, r2, r0 - ldrb r0, [r1, 0xA] - lsls r0, 1 - add r0, r12 - ldrh r0, [r0] - cmp r4, r0 - bne _081A6994 - ldrh r0, [r1] - cmp r0, r10 - bne _081A699C - movs r4, 0 - mov r10, r4 - b _081A699C - .pool -_081A6994: - adds r5, 0x2 - adds r3, 0x1 - cmp r3, r6 - blt _081A6964 -_081A699C: - cmp r3, r6 - bne _081A69E2 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - mov r5, r8 - lsls r3, r5, 1 - adds r0, r3, r5 - lsls r0, 2 - adds r1, r0 - movs r0, 0xE7 - lsls r0, 4 - adds r1, r0 - strh r7, [r1] - ldr r2, =gUnknown_0203BC8C - ldr r1, [r2] - add r1, r9 - ldrh r0, [r1] - ldr r4, [sp, 0x44] - strh r0, [r4] - ldr r2, =gBattleFrontierHeldItems - ldrb r0, [r1, 0xA] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - ldr r5, [sp, 0x40] - strh r0, [r5] - ldr r0, [sp, 0x38] - adds r3, r0, r3 - strh r7, [r3] - adds r5, 0x2 - str r5, [sp, 0x40] - adds r4, 0x2 - str r4, [sp, 0x44] - movs r1, 0x1 - add r8, r1 -_081A69E2: - mov r2, r8 - cmp r2, 0x6 - beq _081A69EA - b _081A68DE -_081A69EA: - add sp, 0x4C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A67EC - - thumb_func_start sub_81A6A08 -sub_81A6A08: @ 81A6A08 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x18 - ldr r1, =gUnknown_0203BC8C - ldr r0, =gBattleFrontierMons - str r0, [r1] - movs r4, 0 - add r5, sp, 0x14 - ldr r7, =gScriptResult - movs r1, 0 -_081A6A1E: - mov r2, sp - adds r0, r2, r4 - strb r1, [r0] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x11 - bls _081A6A1E - movs r4, 0 - ldr r0, =gUnknown_03006298 - mov r8, r0 - ldr r0, =gUnknown_0203BC8C - ldr r6, [r0] - ldr r1, =gBaseStats - mov r12, r1 -_081A6A3C: - lsls r0, r4, 1 - add r0, r8 - ldrh r0, [r0] - lsls r0, 4 - adds r0, r6 - ldrh r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - mov r2, r12 - adds r3, r0, r2 - ldrb r2, [r3, 0x6] - mov r0, sp - adds r1, r0, r2 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldrb r1, [r3, 0x7] - cmp r2, r1 - beq _081A6A70 - ldrb r0, [r3, 0x7] - mov r2, sp - adds r1, r2, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_081A6A70: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _081A6A3C - movs r0, 0 - strb r0, [r5] - strb r0, [r5, 0x1] - movs r4, 0x1 - adds r3, r5, 0 -_081A6A84: - ldrb r0, [r3] - add r0, sp - mov r2, sp - adds r1, r2, r4 - ldrb r2, [r0] - ldrb r0, [r1] - cmp r2, r0 - bcs _081A6AAC - strb r4, [r5] - b _081A6AB2 - .pool -_081A6AAC: - cmp r2, r0 - bne _081A6AB2 - strb r4, [r3, 0x1] -_081A6AB2: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x11 - bls _081A6A84 - ldrb r1, [r5] - mov r4, sp - adds r0, r4, r1 - ldrb r2, [r0] - cmp r2, 0 - beq _081A6ADA - ldrb r3, [r5, 0x1] - adds r0, r4, r3 - ldrb r0, [r0] - cmp r2, r0 - bhi _081A6AD6 - cmp r1, r3 - bne _081A6ADA -_081A6AD6: - strh r1, [r7] - b _081A6ADE -_081A6ADA: - movs r0, 0x12 - strh r0, [r7] -_081A6ADE: - add sp, 0x18 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81A6A08 - - thumb_func_start sub_81A6AEC -sub_81A6AEC: @ 81A6AEC - push {r4-r7,lr} - sub sp, 0x8 - movs r7, 0 - ldr r1, =gUnknown_0203BC8C - ldr r0, =gBattleFrontierMons - str r0, [r1] - movs r4, 0 - movs r1, 0 -_081A6AFC: - mov r2, sp - adds r0, r2, r4 - strb r1, [r0] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _081A6AFC - movs r4, 0 -_081A6B0E: - ldr r1, =gUnknown_03006298 - lsls r0, r4, 1 - adds r0, r1 - ldrh r6, [r0] - movs r5, 0 -_081A6B18: - ldr r0, =gUnknown_0203BC8C - ldr r1, [r0] - lsls r0, r6, 4 - adds r0, r1 - lsls r1, r5, 1 - adds r0, 0x2 - adds r0, r1 - ldrh r0, [r0] - bl sub_81A6BA4 - lsls r0, 24 - lsrs r0, 24 - mov r2, sp - adds r1, r2, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _081A6B18 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _081A6B0E - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - movs r4, 0x1 - adds r5, r1, 0 - ldr r3, =gBattleFactoryStyleRequiredMoveCounts - adds r2, r5, 0 -_081A6B5C: - mov r1, sp - adds r0, r1, r4 - subs r1, r4, 0x1 - adds r1, r3 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bcc _081A6B74 - strh r4, [r2] - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 -_081A6B74: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _081A6B5C - cmp r7, 0x2 - bls _081A6B86 - movs r0, 0x8 - strh r0, [r5] -_081A6B86: - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A6AEC - - thumb_func_start sub_81A6BA4 -sub_81A6BA4: @ 81A6BA4 - push {r4-r6,lr} - lsls r0, 16 - lsrs r5, r0, 16 - movs r2, 0 - ldr r6, =gBattleFactoryStyleMoveListPointers -_081A6BAE: - movs r3, 0 - lsls r0, r2, 2 - adds r0, r6 - ldr r1, [r0] - ldrh r0, [r1] - adds r4, r2, 0x1 - cmp r0, 0 - beq _081A6BE4 - lsls r0, r4, 24 - lsrs r2, r0, 24 -_081A6BC2: - lsls r0, r3, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r5 - bne _081A6BD4 - adds r0, r2, 0 - b _081A6BEE - .pool -_081A6BD4: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - lsls r0, r3, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0 - bne _081A6BC2 -_081A6BE4: - lsls r0, r4, 24 - lsrs r2, r0, 24 - cmp r2, 0x6 - bls _081A6BAE - movs r0, 0 -_081A6BEE: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81A6BA4 - - thumb_func_start sub_81A6BF4 -sub_81A6BF4: @ 81A6BF4 - push {lr} - movs r2, 0 - ldr r1, =gUnknown_02037318 - ldr r3, =0xfffffea5 - adds r0, r3, 0 - ldrh r1, [r1, 0x12] - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bhi _081A6C0C - movs r2, 0x1 -_081A6C0C: - adds r0, r2, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A6BF4 - - thumb_func_start sub_81A6C1C -sub_81A6C1C: @ 81A6C1C - push {r4,lr} - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x2 - beq _081A6C48 - ldr r1, =gUnknown_0203BC8C - ldr r0, =gBattleFrontierMons - b _081A6C4C - .pool -_081A6C48: - ldr r1, =gUnknown_0203BC8C - ldr r0, =gSlateportBattleTentMons -_081A6C4C: - str r0, [r1] - movs r4, 0 -_081A6C50: - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gSaveBlock2Ptr - ldr r2, [r1] - lsls r1, r4, 1 - adds r1, r4 - lsls r1, 2 - adds r2, r1 - movs r1, 0xE7 - lsls r1, 4 - adds r2, r1 - ldrh r2, [r2] - ldr r1, =gUnknown_0203BC8C - ldr r1, [r1] - lsls r2, 4 - adds r2, r1 - ldrb r2, [r2, 0xA] - lsls r2, 1 - ldr r1, =gBattleFrontierHeldItems - adds r2, r1 - movs r1, 0xC - bl SetMonData - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _081A6C50 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A6C1C - - thumb_func_start sub_81A6CA8 -sub_81A6CA8: @ 81A6CA8 - push {lr} - lsls r0, 24 - lsls r1, 24 - lsrs r1, 24 - negs r2, r1 - orrs r2, r1 - lsrs r2, 31 - lsrs r1, r0, 24 - cmp r1, 0x8 - bls _081A6CBE - movs r1, 0x7 -_081A6CBE: - ldr r0, =gUnknown_08612184 - lsls r1, 1 - adds r1, r2, r1 - adds r1, r0 - ldrb r0, [r1] - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A6CA8 - - thumb_func_start sub_81A6CD0 -sub_81A6CD0: @ 81A6CD0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x34 - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - str r0, [sp, 0x2C] - ldr r0, =0x000040ce - bl VarGet - lsls r0, 24 - ldr r1, [r4] - ldr r3, [sp, 0x2C] - lsls r2, r3, 1 - lsrs r0, 22 - adds r2, r0 - ldr r7, =0x00000de2 - adds r1, r7 - adds r1, r2 - ldrh r0, [r1] - movs r1, 0x7 - bl __udivsi3 - lsls r0, 24 - lsrs r1, r0, 24 - str r1, [sp, 0x30] - movs r2, 0x80 - lsls r2, 18 - adds r0, r2 - lsrs r0, 24 - movs r1, 0 - bl sub_81A6CA8 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x24] - bl sub_8165C40 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x20] - movs r3, 0 - mov r9, r3 - ldr r1, [r4] - ldrb r4, [r1, 0xA] - ldrb r0, [r1, 0xB] - lsls r0, 8 - orrs r4, r0 - ldrb r0, [r1, 0xC] - lsls r0, 16 - orrs r4, r0 - ldrb r0, [r1, 0xD] - lsls r0, 24 - orrs r4, r0 - str r4, [sp, 0x28] -_081A6D4C: - ldr r0, [sp, 0x2C] - ldr r1, [sp, 0x30] - movs r2, 0 - bl sub_81A6EF0 - lsls r0, 16 - lsrs r5, r0, 16 - ldr r7, =gUnknown_0203BC8C - ldr r1, [r7] - lsls r0, r5, 4 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0xC9 - bne _081A6D6A - b _081A6EB8 -_081A6D6A: - ldr r0, [sp, 0x20] - cmp r0, 0x32 - bne _081A6D78 - ldr r0, =0x00000351 - cmp r5, r0 - bls _081A6D78 - b _081A6EB8 -_081A6D78: - movs r2, 0 - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - movs r3, 0xE7 - lsls r3, 4 - adds r0, r3 - ldrh r0, [r0] - cmp r5, r0 - beq _081A6DA2 - adds r4, r1, 0 - movs r1, 0 -_081A6D8E: - adds r1, 0xC - adds r2, 0x1 - cmp r2, 0x5 - bgt _081A6DA2 - ldr r0, [r4] - adds r0, r1 - adds r0, r3 - ldrh r0, [r0] - cmp r5, r0 - bne _081A6D8E -_081A6DA2: - cmp r2, 0x6 - beq _081A6DA8 - b _081A6EB8 -_081A6DA8: - movs r4, 0 - cmp r4, r9 - bge _081A6DDC - add r2, sp, 0xC - ldr r7, =gUnknown_0203BC8C - ldr r0, [r7] - lsls r1, r5, 4 - adds r0, r1, r0 - ldrh r2, [r2] - adds r7, r1, 0 - ldrh r0, [r0] - cmp r2, r0 - beq _081A6DDC - ldr r6, =gUnknown_0203BC8C - adds r3, r7, 0 - add r2, sp, 0xC -_081A6DC8: - adds r2, 0x2 - adds r4, 0x1 - cmp r4, r9 - bge _081A6DDC - ldr r0, [r6] - adds r0, r3, r0 - ldrh r1, [r2] - ldrh r0, [r0] - cmp r1, r0 - bne _081A6DC8 -_081A6DDC: - cmp r4, r9 - bne _081A6EB8 - movs r4, 0 - cmp r4, r9 - bge _081A6E0C - ldr r7, =gBattleFrontierHeldItems - ldr r6, =gUnknown_0203BC8C - add r2, sp, 0x14 - lsls r3, r5, 4 -_081A6DEE: - ldrh r1, [r2] - cmp r1, 0 - beq _081A6E04 - ldr r0, [r6] - adds r0, r3, r0 - ldrb r0, [r0, 0xA] - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - cmp r1, r0 - beq _081A6E0C -_081A6E04: - adds r2, 0x2 - adds r4, 0x1 - cmp r4, r9 - blt _081A6DEE -_081A6E0C: - cmp r4, r9 - bne _081A6EB8 - mov r0, r9 - lsls r2, r0, 1 - mov r1, sp - adds r1, r2 - adds r1, 0xC - ldr r3, =gUnknown_0203BC8C - ldr r4, [r3] - lsls r5, 4 - mov r8, r5 - add r4, r8 - ldrh r0, [r4] - strh r0, [r1] - add r1, sp, 0x14 - adds r1, r2 - ldr r2, =gBattleFrontierHeldItems - ldrb r0, [r4, 0xA] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - strh r0, [r1] - movs r0, 0x64 - mov r5, r9 - muls r5, r0 - ldr r6, =gEnemyParty - adds r0, r5, r6 - ldrh r1, [r4] - ldr r7, [sp, 0x20] - lsls r2, r7, 24 - ldrb r3, [r4, 0xC] - ldr r7, [sp, 0x24] - str r7, [sp] - ldrb r4, [r4, 0xB] - str r4, [sp, 0x4] - ldr r4, [sp, 0x28] - str r4, [sp, 0x8] - lsrs r2, 24 - bl sub_8068634 - add r0, sp, 0x1C - movs r7, 0 - strb r7, [r0] - movs r4, 0 - mov r7, r8 - mov r10, r0 - movs r0, 0x1 - add r0, r9 - mov r8, r0 -_081A6E6E: - ldr r1, =gUnknown_0203BC8C - ldr r0, [r1] - adds r0, r7, r0 - lsls r1, r4, 1 - adds r0, 0x2 - adds r0, r1 - ldrh r1, [r0] - lsls r2, r4, 24 - lsrs r2, 24 - adds r0, r5, r6 - bl sub_81A7024 - adds r4, 0x1 - cmp r4, 0x3 - ble _081A6E6E - movs r0, 0x64 - mov r4, r9 - muls r4, r0 - ldr r0, =gEnemyParty - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x20 - mov r2, r10 - bl SetMonData - ldr r2, =gUnknown_0203BC8C - ldr r0, [r2] - adds r0, r7, r0 - ldrb r2, [r0, 0xA] - lsls r2, 1 - ldr r0, =gBattleFrontierHeldItems - adds r2, r0 - adds r0, r4, 0 - movs r1, 0xC - bl SetMonData - mov r9, r8 -_081A6EB8: - mov r3, r9 - cmp r3, 0x3 - beq _081A6EC0 - b _081A6D4C -_081A6EC0: - add sp, 0x34 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A6CD0 - - thumb_func_start sub_81A6EF0 -sub_81A6EF0: @ 81A6EF0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r3, r1, 24 - lsls r2, 24 - lsrs r2, 24 - movs r4, 0x8 - negs r1, r0 - orrs r1, r0 - asrs r1, 31 - ands r1, r4 - adds r4, r1, 0 - cmp r3, 0x6 - bhi _081A6F2C - cmp r2, 0 - beq _081A6F20 - ldr r2, =gUnknown_08612194 - adds r1, r3 - adds r1, 0x1 - b _081A6F38 - .pool -_081A6F20: - ldr r2, =gUnknown_08612194 - adds r1, r3 - b _081A6F38 - .pool -_081A6F2C: - adds r1, r3, 0 - cmp r1, 0x7 - beq _081A6F34 - movs r1, 0x7 -_081A6F34: - ldr r2, =gUnknown_08612194 - adds r1, r4, r1 -_081A6F38: - lsls r1, 2 - adds r0, r2, 0x2 - adds r0, r1, r0 - adds r1, r2 - ldrh r0, [r0] - ldrh r4, [r1] - subs r0, r4 - adds r0, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - bl Random - lsls r0, 16 - lsrs r0, 16 - adds r1, r5, 0 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - adds r4, r0, r4 - lsls r4, 16 - lsrs r0, r4, 16 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A6EF0 - - thumb_func_start sub_81A6F70 -sub_81A6F70: @ 81A6F70 - push {lr} - lsls r0, 24 - lsls r1, 24 - ldr r2, =gSaveBlock2Ptr - ldr r2, [r2] - lsrs r1, 23 - lsrs r0, 22 - adds r1, r0 - ldr r0, =0x00000df2 - adds r2, r0 - adds r2, r1 - ldrb r1, [r2] - movs r0, 0 - cmp r1, 0xE - bls _081A6FA8 - movs r0, 0x1 - cmp r1, 0x15 - bls _081A6FA8 - movs r0, 0x2 - cmp r1, 0x1C - bls _081A6FA8 - movs r0, 0x3 - cmp r1, 0x23 - bls _081A6FA8 - movs r0, 0x5 - cmp r1, 0x2A - bhi _081A6FA8 - movs r0, 0x4 -_081A6FA8: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A6F70 - - thumb_func_start sub_81A6FB4 -sub_81A6FB4: @ 81A6FB4 - push {r4,r5,lr} - ldr r5, =gSaveBlock2Ptr - ldr r0, [r5] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r4, r0, 30 - cmp r4, 0x2 - beq _081A6FF8 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - ldr r1, [r5] - lsls r2, r4, 1 - lsrs r0, 14 - adds r2, r0 - ldr r0, =0x00000de2 - adds r1, r0 - adds r1, r2 - ldrh r0, [r1] - movs r1, 0x7 - bl __udivsi3 - lsls r0, 16 - lsrs r2, r0, 16 - ldr r0, =gUnknown_02038BCA - ldrh r1, [r0] - ldr r0, =0x000003fe - cmp r1, r0 - beq _081A7018 - cmp r2, 0x1 - bgt _081A7014 -_081A6FF8: - movs r0, 0 - b _081A701E - .pool -_081A7014: - cmp r2, 0x3 - ble _081A701C -_081A7018: - movs r0, 0x7 - b _081A701E -_081A701C: - movs r0, 0x1 -_081A701E: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81A6FB4 - - thumb_func_start sub_81A7024 -sub_81A7024: @ 81A7024 - push {lr} - lsls r1, 16 - lsls r2, 24 - lsrs r2, 24 - lsrs r1, 16 - cmp r1, 0xD8 - bne _081A7034 - movs r1, 0xDA -_081A7034: - bl sub_80691F4 - pop {r0} - bx r0 - thumb_func_end sub_81A7024 - - thumb_func_start sub_81A703C -sub_81A703C: @ 81A703C - push {lr} - ldr r1, =gUnknown_086125F8 - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A703C - - thumb_func_start sub_81A705C -sub_81A705C: @ 81A705C - push {lr} - bl sub_81A79EC - ldr r1, =gUnknown_0300128C - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A705C - - thumb_func_start sub_81A7070 -sub_81A7070: @ 81A7070 - push {r4-r7,lr} - ldr r0, =0x00004010 - movs r1, 0x1C - bl VarSet - ldr r0, =0x00004011 - movs r1, 0xE2 - bl VarSet - movs r4, 0x1 - movs r6, 0 - movs r5, 0 - movs r7, 0 - ldr r0, =gUnknown_0300128C - ldrb r0, [r0] - cmp r0, 0x8 - bhi _081A7132 - lsls r0, 2 - ldr r1, =_081A70AC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A70AC: - .4byte _081A70D0 - .4byte _081A70DA - .4byte _081A70DE - .4byte _081A70E8 - .4byte _081A70FC - .4byte _081A70D6 - .4byte _081A7100 - .4byte _081A7108 - .4byte _081A710E -_081A70D0: - movs r0, 0 - bl sub_81A82A4 -_081A70D6: - movs r4, 0 - b _081A711A -_081A70DA: - movs r5, 0x1C - b _081A711A -_081A70DE: - bl sub_81A7B58 - lsls r0, 24 - lsrs r5, r0, 24 - b _081A711A -_081A70E8: - movs r5, 0x30 - ldr r0, =gUnknown_0300128D - ldrb r0, [r0] - movs r7, 0xE1 - cmp r0, 0x1 - bne _081A7118 - movs r7, 0xE2 - b _081A7118 - .pool -_081A70FC: - movs r5, 0x30 - b _081A711A -_081A7100: - movs r0, 0x1 - bl sub_81A82A4 - b _081A7114 -_081A7108: - bl sub_81A8374 - b _081A70D6 -_081A710E: - movs r0, 0x5 - bl sub_81A5030 -_081A7114: - movs r7, 0x1C - movs r4, 0 -_081A7118: - movs r6, 0x1 -_081A711A: - cmp r4, 0x1 - bne _081A7126 - ldr r0, =0x00004010 - adds r1, r5, 0 - bl VarSet -_081A7126: - cmp r6, 0x1 - bne _081A7132 - ldr r0, =0x00004011 - adds r1, r7, 0 - bl VarSet -_081A7132: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A7070 - - thumb_func_start sub_81A7140 -sub_81A7140: @ 81A7140 - push {lr} - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r2, =0x00000ca9 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r2, r0, 30 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - adds r3, r1, 0 - cmp r0, 0x4 - bhi _081A723A - lsls r0, 2 - ldr r1, =_081A7174 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A7174: - .4byte _081A7188 - .4byte _081A71A0 - .4byte _081A71C4 - .4byte _081A71E8 - .4byte _081A720C -_081A7188: - ldr r0, =gScriptResult - ldr r1, [r3] - ldr r3, =0x00000e02 - adds r1, r3 - ldrh r1, [r1] - strh r1, [r0] - b _081A723A - .pool -_081A71A0: - ldr r2, =gScriptResult - ldr r1, [r3] - ldr r3, =0x00000ca9 - adds r0, r1, r3 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 29 - ldr r3, =0x00000e04 - adds r1, r3 - adds r1, r0 - ldrh r0, [r1] - b _081A7238 - .pool -_081A71C4: - ldr r2, =gScriptResult - ldr r1, [r3] - ldr r3, =0x00000ca9 - adds r0, r1, r3 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 29 - ldr r3, =0x00000e08 - adds r1, r3 - adds r1, r0 - ldrh r0, [r1] - b _081A7238 - .pool -_081A71E8: - ldr r2, =gScriptResult - ldr r1, [r3] - ldr r3, =0x00000ca9 - adds r0, r1, r3 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 29 - ldr r3, =0x00000e0c - adds r1, r3 - adds r1, r0 - ldrh r0, [r1] - b _081A7238 - .pool -_081A720C: - cmp r2, 0 - beq _081A7228 - ldr r2, =gScriptResult - ldr r0, [r3] - ldr r1, =0x00000cdc - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 4 - b _081A7236 - .pool -_081A7228: - ldr r2, =gScriptResult - ldr r0, [r3] - ldr r3, =0x00000cdc - adds r0, r3 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 3 -_081A7236: - ands r0, r1 -_081A7238: - strh r0, [r2] -_081A723A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A7140 - - thumb_func_start sub_81A7248 -sub_81A7248: @ 81A7248 - push {r4,r5,lr} - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r2, =0x00000ca9 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r3, r0, 30 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - adds r2, r1, 0 - cmp r0, 0x4 - bls _081A7264 - b _081A73AA -_081A7264: - lsls r0, 2 - ldr r1, =_081A7280 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A7280: - .4byte _081A7294 - .4byte _081A72AC - .4byte _081A72D8 - .4byte _081A7314 - .4byte _081A7344 -_081A7294: - ldr r0, [r2] - ldr r1, =gSpecialVar_0x8006 - ldrh r1, [r1] - ldr r5, =0x00000e02 - adds r0, r5 - strh r1, [r0] - b _081A73AA - .pool -_081A72AC: - ldr r0, =gSpecialVar_0x8006 - ldrh r3, [r0] - ldr r0, =0x0000270f - cmp r3, r0 - bls _081A72B8 - b _081A73AA -_081A72B8: - ldr r0, [r2] - ldr r2, =0x00000ca9 - adds r1, r0, r2 - ldrb r1, [r1] - lsls r1, 30 - lsrs r1, 29 - ldr r5, =0x00000e04 - b _081A732C - .pool -_081A72D8: - ldr r0, =gSpecialVar_0x8006 - ldrh r4, [r0] - adds r3, r4, 0 - ldr r0, =0x0000270f - cmp r3, r0 - bhi _081A73AA - ldr r1, [r2] - ldr r2, =0x00000ca9 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r2, r0, 30 - lsrs r0, r2, 29 - ldr r5, =0x00000e08 - adds r1, r5 - adds r0, r1, r0 - ldrh r0, [r0] - cmp r0, r3 - bcs _081A73AA - lsrs r0, r2, 29 - adds r0, r1, r0 - strh r4, [r0] - b _081A73AA - .pool -_081A7314: - ldr r0, =gSpecialVar_0x8006 - ldrh r3, [r0] - ldr r0, =0x0000270f - cmp r3, r0 - bhi _081A73AA - ldr r0, [r2] - ldr r2, =0x00000ca9 - adds r1, r0, r2 - ldrb r1, [r1] - lsls r1, 30 - lsrs r1, 29 - ldr r5, =0x00000e0c -_081A732C: - adds r0, r5 - adds r0, r1 - strh r3, [r0] - b _081A73AA - .pool -_081A7344: - cmp r3, 0 - beq _081A737C - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - cmp r0, 0 - beq _081A7368 - ldr r0, [r2] - ldr r1, =0x00000cdc - adds r0, r1 - ldr r1, [r0] - movs r2, 0x80 - lsls r2, 4 - orrs r1, r2 - b _081A73A8 - .pool -_081A7368: - ldr r0, [r2] - ldr r2, =0x00000cdc - adds r0, r2 - ldr r1, [r0] - ldr r2, =0xfffff7ff - b _081A73A6 - .pool -_081A737C: - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - cmp r0, 0 - beq _081A739C - ldr r0, [r2] - ldr r5, =0x00000cdc - adds r0, r5 - ldr r1, [r0] - movs r2, 0x80 - lsls r2, 3 - orrs r1, r2 - b _081A73A8 - .pool -_081A739C: - ldr r0, [r2] - ldr r1, =0x00000cdc - adds r0, r1 - ldr r1, [r0] - ldr r2, =0xfffffbff -_081A73A6: - ands r1, r2 -_081A73A8: - str r1, [r0] -_081A73AA: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A7248 - - thumb_func_start sub_81A73B8 -sub_81A73B8: @ 81A73B8 - push {lr} - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0xE - bls _081A73DC - ldr r1, =gScriptResult - movs r0, 0x1 - b _081A73E0 - .pool -_081A73DC: - ldr r1, =gScriptResult - movs r0, 0 -_081A73E0: - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A73B8 - - thumb_func_start sub_81A73EC -sub_81A73EC: @ 81A73EC - ldr r0, =gScriptResult - ldr r1, =gUnknown_0300128C - ldrb r1, [r1] - strh r1, [r0] - bx lr - .pool - thumb_func_end sub_81A73EC - - thumb_func_start sub_81A7400 -sub_81A7400: @ 81A7400 - ldr r1, =gUnknown_0300128E - movs r0, 0x1 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_81A7400 - - thumb_func_start sub_81A740C -sub_81A740C: @ 81A740C - ldr r1, =gUnknown_0300128E - movs r0, 0 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_81A740C - - thumb_func_start sub_81A7418 -sub_81A7418: @ 81A7418 - push {r4,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =gSpecialVar_0x8005 - ldrh r1, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - strb r1, [r0] - movs r0, 0x80 - lsls r0, 7 - movs r1, 0 - bl VarSet - ldr r1, [r4] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - bl save_serialize_map - movs r0, 0x1 - bl TrySavingData - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A7418 - - thumb_func_start nullsub_76 -nullsub_76: @ 81A7460 - bx lr - thumb_func_end nullsub_76 - - thumb_func_start nullsub_124 -nullsub_124: @ 81A7464 - bx lr - thumb_func_end nullsub_124 - - thumb_func_start sub_81A7468 -sub_81A7468: @ 81A7468 - push {lr} - ldr r0, =gUnknown_03001290 - ldr r0, [r0] - cmp r0, 0x20 - beq _081A748E - cmp r0, 0x20 - bhi _081A7484 - cmp r0, 0x7 - beq _081A74BC - cmp r0, 0x10 - beq _081A7498 - b _081A74C2 - .pool -_081A7484: - cmp r0, 0x40 - beq _081A74B0 - cmp r0, 0x80 - beq _081A74A4 - b _081A74C2 -_081A748E: - ldr r1, =gScriptResult - movs r0, 0 - b _081A74C0 - .pool -_081A7498: - ldr r1, =gScriptResult - movs r0, 0x1 - b _081A74C0 - .pool -_081A74A4: - ldr r1, =gScriptResult - movs r0, 0x2 - b _081A74C0 - .pool -_081A74B0: - ldr r1, =gScriptResult - movs r0, 0x3 - b _081A74C0 - .pool -_081A74BC: - ldr r1, =gScriptResult - movs r0, 0x4 -_081A74C0: - strh r0, [r1] -_081A74C2: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A7468 - - thumb_func_start sub_81A74CC -sub_81A74CC: @ 81A74CC - ldr r0, =gScriptResult - ldr r1, =gUnknown_0300128D - ldrb r1, [r1] - strh r1, [r0] - bx lr - .pool - thumb_func_end sub_81A74CC - - thumb_func_start sub_81A74E0 -sub_81A74E0: @ 81A74E0 - push {r4,lr} - bl Random - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - movs r0, 0x1 - ands r4, r0 - adds r4, 0x1 - adds r0, r4, 0 - bl sub_81A7F38 - ldr r0, =gScriptResult - strh r4, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A74E0 - - thumb_func_start sub_81A7508 -sub_81A7508: @ 81A7508 - push {lr} - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0x4 - bhi _081A7538 - ldr r1, =gUnknown_0861231C - ldr r0, =gUnknown_03001294 - ldrb r0, [r0] - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0x2] - b _081A7560 - .pool -_081A7538: - cmp r0, 0xA - bhi _081A7554 - ldr r1, =gUnknown_0861231C - ldr r0, =gUnknown_03001294 - ldrb r0, [r0] - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0x3] - b _081A7560 - .pool -_081A7554: - ldr r1, =gUnknown_0861231C - ldr r0, =gUnknown_03001294 - ldrb r0, [r0] - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0x4] -_081A7560: - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_086123E4 - adds r0, r1 - bl ConvertBattleFrontierTrainerSpeechToString - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A7508 - - thumb_func_start sub_81A7580 -sub_81A7580: @ 81A7580 - push {lr} - ldr r0, =sub_81A7EE4 - movs r1, 0x2 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A7580 - - thumb_func_start sub_81A7594 -sub_81A7594: @ 81A7594 - push {r4-r6,lr} - sub sp, 0x4 - adds r5, r0, 0 - movs r4, 0 - movs r1, 0 -_081A759E: - mov r2, sp - adds r0, r2, r4 - strb r1, [r0] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _081A759E - adds r0, r5, 0 - movs r1, 0x3A - bl GetMonData - lsls r2, r0, 16 - mov r1, sp - strb r0, [r1] - mov r0, sp - lsrs r2, 24 - strb r2, [r0, 0x1] - adds r0, r5, 0 - movs r1, 0x39 - mov r2, sp - bl SetMonData - adds r0, r5, 0 - movs r1, 0x15 - bl GetMonData - lsls r0, 24 - lsrs r6, r0, 24 - movs r4, 0 -_081A75DA: - adds r1, r4, 0 - adds r1, 0xD - adds r0, r5, 0 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - adds r1, r6, 0 - adds r2, r4, 0 - bl CalcPPWithPPUps - mov r1, sp - strb r0, [r1] - adds r1, r4, 0 - adds r1, 0x11 - adds r0, r5, 0 - mov r2, sp - bl SetMonData - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _081A75DA - mov r0, sp - movs r1, 0 - strb r1, [r0] - strb r1, [r0, 0x1] - strb r1, [r0, 0x2] - strb r1, [r0, 0x3] - adds r0, r5, 0 - movs r1, 0x37 - mov r2, sp - bl SetMonData - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81A7594 - - thumb_func_start sub_81A7628 -sub_81A7628: @ 81A7628 - push {r4,lr} - adds r4, r1, 0 - bl GetMonAbility - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - cmp r4, 0x20 - beq _081A7652 - cmp r4, 0x20 - bhi _081A7648 - cmp r4, 0x7 - beq _081A7664 - cmp r4, 0x10 - beq _081A7658 - b _081A7674 -_081A7648: - cmp r4, 0x40 - beq _081A765E - cmp r4, 0x80 - beq _081A766E - b _081A7674 -_081A7652: - cmp r0, 0x28 - bne _081A7674 - b _081A7672 -_081A7658: - cmp r0, 0x29 - bne _081A7674 - b _081A7672 -_081A765E: - cmp r0, 0x7 - bne _081A7674 - b _081A7672 -_081A7664: - cmp r0, 0xF - beq _081A7672 - cmp r0, 0x48 - bne _081A7674 - b _081A7672 -_081A766E: - cmp r0, 0x11 - bne _081A7674 -_081A7672: - movs r1, 0x1 -_081A7674: - adds r0, r1, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81A7628 - - thumb_func_start sub_81A767C -sub_81A767C: @ 81A767C - push {lr} - lsls r0, 16 - lsrs r2, r0, 16 - movs r3, 0 - cmp r1, 0x20 - beq _081A76C4 - cmp r1, 0x20 - bhi _081A7696 - cmp r1, 0x7 - beq _081A771C - cmp r1, 0x10 - beq _081A7704 - b _081A771C -_081A7696: - cmp r1, 0x40 - beq _081A76E0 - cmp r1, 0x80 - bne _081A771C - ldr r1, =gBaseStats - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r2, [r0, 0x6] - cmp r2, 0x8 - beq _081A771A - cmp r2, 0x3 - beq _081A771A - ldrb r0, [r0, 0x7] - cmp r0, 0x8 - beq _081A771A - cmp r0, 0x3 - bne _081A771C - b _081A771A - .pool -_081A76C4: - ldr r0, =gBaseStats - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x6] - cmp r0, 0xF - beq _081A771A - ldrb r0, [r1, 0x7] - cmp r0, 0xF - bne _081A771C - b _081A771A - .pool -_081A76E0: - ldr r1, =gBaseStats - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r2, [r0, 0x6] - cmp r2, 0x4 - beq _081A771A - cmp r2, 0xD - beq _081A771A - ldrb r0, [r0, 0x7] - cmp r0, 0x4 - beq _081A771A - cmp r0, 0xD - bne _081A771C - b _081A771A - .pool -_081A7704: - ldr r0, =gBaseStats - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x6] - cmp r0, 0xA - beq _081A771A - ldrb r0, [r1, 0x7] - cmp r0, 0xA - bne _081A771C -_081A771A: - movs r3, 0x1 -_081A771C: - adds r0, r3, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A767C - - thumb_func_start sub_81A7728 -sub_81A7728: @ 81A7728 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - movs r6, 0 -_081A7736: - mov r1, sp - adds r0, r1, r6 - strb r6, [r0] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x2 - bls _081A7736 - movs r4, 0 - mov r8, r4 -_081A774A: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 24 - lsrs r6, r0, 24 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - mov r1, sp - adds r2, r1, r6 - ldrb r3, [r2] - adds r1, r0 - ldrb r0, [r1] - strb r0, [r2] - strb r3, [r1] - mov r0, r8 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - cmp r0, 0x9 - bls _081A774A - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r4, =0x00000cb2 - adds r0, r4 - ldrh r0, [r0] - movs r1, 0x1 - mov r10, r1 - cmp r0, 0x4 - bls _081A77A8 - movs r4, 0x3 - mov r10, r4 - cmp r0, 0x9 - bhi _081A77A8 - movs r0, 0x2 - mov r10, r0 -_081A77A8: - movs r1, 0 - str r1, [sp, 0x4] - ldr r7, =gUnknown_03001290 -_081A77AE: - movs r4, 0 - mov r9, r4 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - cmp r0, 0x22 - bhi _081A77DC - movs r0, 0x80 - b _081A77FC - .pool -_081A77DC: - cmp r0, 0x3B - bhi _081A77E4 - movs r0, 0x20 - b _081A77FC -_081A77E4: - cmp r0, 0x4F - bhi _081A77EC - movs r0, 0x40 - b _081A77FC -_081A77EC: - cmp r1, 0x59 - bhi _081A77FA - movs r0, 0x7 - b _081A77FC -_081A77F4: - movs r0, 0x1 - mov r9, r0 - b _081A786E -_081A77FA: - movs r0, 0x10 -_081A77FC: - str r0, [r7] - ldr r0, =gUnknown_03001290 - ldr r0, [r0] - ldr r1, [sp, 0x4] - cmp r1, r0 - beq _081A7874 - str r0, [sp, 0x4] - movs r4, 0 - mov r8, r4 - movs r6, 0 -_081A7810: - mov r1, sp - adds r0, r1, r6 - ldrb r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0x37 - bl GetMonData - bl pokemon_ailments_get_primary - lsls r0, 24 - cmp r0, 0 - bne _081A7860 - adds r0, r5, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - beq _081A7860 - mov r0, r8 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - adds r0, r5, 0 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r4, r0, 16 - ldr r1, [r7] - adds r0, r4, 0 - bl sub_81A767C - lsls r0, 24 - cmp r0, 0 - beq _081A77F4 -_081A7860: - cmp r8, r10 - beq _081A786E - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x2 - bls _081A7810 -_081A786E: - mov r4, r8 - cmp r4, 0 - beq _081A78CC -_081A7874: - mov r0, r9 - cmp r0, 0 - beq _081A77AE - ldr r0, =gUnknown_03001290 - ldr r0, [r0] - cmp r0, 0x20 - beq _081A7898 - cmp r0, 0x20 - bhi _081A78D0 - cmp r0, 0x7 - beq _081A78D0 - cmp r0, 0x10 - beq _081A78A4 - b _081A78D0 - .pool -_081A7898: - ldr r1, =gUnknown_0300128D - movs r0, 0x1 - b _081A78D4 - .pool -_081A78A4: - bl Random - lsls r0, 16 - lsrs r1, r0, 16 - movs r2, 0x1 - ands r1, r2 - cmp r1, 0 - beq _081A78C0 - ldr r0, =gUnknown_0300128D - strb r2, [r0] - b _081A78D6 - .pool -_081A78C0: - ldr r0, =gUnknown_0300128D - strb r1, [r0] - b _081A78D6 - .pool -_081A78CC: - movs r0, 0 - b _081A7956 -_081A78D0: - ldr r1, =gUnknown_0300128D - movs r0, 0 -_081A78D4: - strb r0, [r1] -_081A78D6: - movs r1, 0 - mov r8, r1 - movs r6, 0 -_081A78DC: - mov r4, sp - adds r0, r4, r6 - ldrb r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0x37 - bl GetMonData - bl pokemon_ailments_get_primary - lsls r0, 24 - cmp r0, 0 - bne _081A7946 - adds r0, r5, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - beq _081A7946 - mov r0, r8 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - adds r0, r5, 0 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r4, r0, 16 - ldr r7, =gUnknown_03001290 - ldr r1, [r7] - adds r0, r5, 0 - bl sub_81A7628 - lsls r0, 24 - cmp r0, 0 - bne _081A7946 - ldr r1, [r7] - adds r0, r4, 0 - bl sub_81A767C - lsls r0, 24 - cmp r0, 0 - bne _081A7946 - adds r0, r5, 0 - movs r1, 0x37 - adds r2, r7, 0 - bl SetMonData -_081A7946: - cmp r8, r10 - beq _081A7954 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x2 - bls _081A78DC -_081A7954: - movs r0, 0x1 -_081A7956: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A7728 - - thumb_func_start sub_81A7974 -sub_81A7974: @ 81A7974 - push {r4-r7,lr} - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r0, [r0] - movs r7, 0x1 - cmp r0, 0x4 - bls _081A798E - movs r7, 0x3 - cmp r0, 0x9 - bhi _081A798E - movs r7, 0x2 -_081A798E: - movs r6, 0 - movs r5, 0 - b _081A79A2 - .pool -_081A799C: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_081A79A2: - cmp r5, 0x2 - bhi _081A79D8 - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =gPlayerParty - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x37 - bl GetMonData - bl pokemon_ailments_get_primary - lsls r0, 24 - cmp r0, 0 - bne _081A79D4 - adds r0, r4, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - beq _081A79D4 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_081A79D4: - cmp r6, r7 - bne _081A799C -_081A79D8: - cmp r6, 0 - beq _081A79E4 - movs r0, 0x1 - b _081A79E6 - .pool -_081A79E4: - movs r0, 0 -_081A79E6: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81A7974 - - thumb_func_start sub_81A79EC -sub_81A79EC: @ 81A79EC - push {r4-r6,lr} - sub sp, 0x8 - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - movs r4, 0xE1 - lsls r4, 4 - adds r0, r4 - ldrb r2, [r0] - movs r3, 0x78 - ands r3, r2 - adds r5, r1, 0 - cmp r3, 0x40 - bne _081A7A10 - lsls r0, r2, 25 - lsrs r0, 28 - b _081A7B48 - .pool -_081A7A10: - ldr r0, =gSpecialVar_0x8007 - lsls r1, r2, 29 - ldrh r0, [r0] - lsrs r1, 29 - cmp r0, r1 - bne _081A7A34 - cmp r3, 0x18 - bne _081A7A24 - bl sub_81A7728 -_081A7A24: - ldr r0, [r5] - adds r0, r4 - ldrb r0, [r0] - lsls r0, 25 - lsrs r0, 28 - b _081A7B48 - .pool -_081A7A34: - movs r2, 0 - ldr r3, =gUnknown_0861266C - movs r1, 0 -_081A7A3A: - mov r4, sp - adds r0, r4, r2 - strb r1, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x7 - bls _081A7A3A - movs r4, 0x8 - ldr r0, [r5] - movs r6, 0xE1 - lsls r6, 4 - adds r0, r6 - ldrb r0, [r0] - lsls r0, 25 - lsrs r0, 28 - adds r0, r3 - ldrb r1, [r0] - movs r2, 0 - adds r5, r3, 0 - movs r3, 0x1 -_081A7A64: - adds r0, r2, r5 - ldrb r0, [r0] - cmp r0, r1 - bne _081A7A78 - mov r6, sp - adds r0, r6, r2 - strb r3, [r0] - subs r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_081A7A78: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x7 - bls _081A7A64 - mov r0, sp - ldrb r0, [r0, 0x7] - cmp r0, 0x1 - beq _081A7AA0 - bl sub_81A8554 - lsls r0, 24 - cmp r0, 0 - bne _081A7AA0 - mov r1, sp - movs r0, 0x1 - strb r0, [r1, 0x7] - subs r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_081A7AA0: - mov r0, sp - ldrb r0, [r0, 0x3] - cmp r0, 0x1 - beq _081A7ABE - bl sub_81A7974 - lsls r0, 24 - cmp r0, 0 - bne _081A7ABE - mov r1, sp - movs r0, 0x1 - strb r0, [r1, 0x3] - subs r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_081A7ABE: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - movs r1, 0xE1 - lsls r1, 4 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081A7AFA - mov r0, sp - ldrb r0, [r0, 0x1] - cmp r0, 0x1 - beq _081A7AE6 - mov r1, sp - movs r0, 0x1 - strb r0, [r1, 0x1] - subs r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_081A7AE6: - mov r0, sp - ldrb r0, [r0, 0x4] - cmp r0, 0x1 - beq _081A7AFA - mov r1, sp - movs r0, 0x1 - strb r0, [r1, 0x4] - subs r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_081A7AFA: - adds r0, r4, 0 - bl AllocZeroed - adds r5, r0, 0 - movs r3, 0 - movs r2, 0 -_081A7B06: - mov r6, sp - adds r0, r6, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _081A7B1C - adds r1, r3, 0 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - adds r1, r5, r1 - strb r2, [r1] -_081A7B1C: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x7 - bls _081A7B06 - bl Random - lsls r0, 16 - lsrs r0, 16 - adds r1, r4, 0 - bl __modsi3 - adds r0, r5, r0 - ldrb r4, [r0] - adds r0, r5, 0 - bl Free - cmp r4, 0x3 - bne _081A7B46 - bl sub_81A7728 -_081A7B46: - adds r0, r4, 0 -_081A7B48: - add sp, 0x8 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A79EC - - thumb_func_start sub_81A7B58 -sub_81A7B58: @ 81A7B58 - push {r4,lr} - ldr r4, =gUnknown_03001294 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x19 - bl __umodsi3 - strb r0, [r4] - ldr r1, =gUnknown_0861231C - ldrb r0, [r4] - lsls r0, 3 - adds r0, r1 - ldrh r0, [r0] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A7B58 - - thumb_func_start sub_81A7B84 -sub_81A7B84: @ 81A7B84 - ldr r0, =gUnknown_0300128E - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_81A7B84 - - thumb_func_start sub_81A7B90 -sub_81A7B90: @ 81A7B90 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - bl sub_81A7D00 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r7, =gSaveBlock2Ptr - ldr r0, [r7] - ldr r4, =0x00000ca9 - adds r0, r4 - ldrb r0, [r0] - lsls r0, 30 - ldr r1, =gUnknown_08612314 - lsrs r0, 28 - adds r0, r1 - ldr r0, [r0] - str r0, [sp, 0x4] - ldr r0, =gEnemyParty - movs r1, 0xB - movs r2, 0 - bl GetMonData - adds r5, r0, 0 - lsls r0, r5, 16 - lsrs r0, 16 - bl sub_81A890C - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, [r7] - adds r0, r4 - ldrb r1, [r0] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _081A7C1C - bl sub_8165CB4 - adds r7, r0, 0 - cmp r7, 0x3B - ble _081A7C08 - lsls r0, r6, 2 - ldr r1, [sp, 0x4] - adds r0, r1 - ldr r1, [r0] - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x2] - subs r7, r0 - cmp r7, 0x3B - bgt _081A7C32 -_081A7C08: - movs r7, 0x3C - b _081A7C32 - .pool -_081A7C1C: - lsls r0, r6, 2 - ldr r2, [sp, 0x4] - adds r0, r2 - ldr r1, [r0] - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x2] - movs r0, 0x32 - subs r7, r0, r1 -_081A7C32: - mov r0, r8 - cmp r0, 0x1 - bne _081A7C4A - lsls r0, r7, 24 - lsrs r0, 24 - bl sub_81A88B0 - lsls r0, 24 - cmp r0, 0 - bne _081A7C4A - movs r0, 0 - b _081A7CE2 -_081A7C4A: - ldr r0, =gEnemyParty - ldr r1, =gBaseStats - mov r8, r1 - lsls r6, 2 - mov r9, r6 - ldr r2, [sp, 0x4] - add r2, r9 - mov r10, r2 - ldr r1, [r2] - lsls r6, r5, 1 - adds r4, r6, r5 - lsls r4, 2 - adds r1, r4, r1 - ldrh r2, [r1] - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - add r1, r8 - ldrb r2, [r1, 0x13] - movs r1, 0xCA - lsls r1, 1 - muls r2, r1 - lsls r1, r7, 2 - ldr r3, =gExperienceTables - adds r1, r3 - adds r2, r1 - movs r1, 0x19 - bl SetMonData - mov r1, r10 - ldr r0, [r1] - adds r4, r0 - ldrh r1, [r4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r8 - ldrb r0, [r0, 0x17] - mov r7, r9 - cmp r0, 0 - beq _081A7CA8 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - ands r0, r1 -_081A7CA8: - str r0, [sp] - ldr r0, =gEnemyParty - movs r1, 0x2E - mov r2, sp - bl SetMonData - movs r4, 0 - adds r0, r6, r5 - lsls r6, r0, 2 -_081A7CBA: - ldr r2, [sp, 0x4] - adds r0, r7, r2 - ldr r0, [r0] - adds r0, r6, r0 - lsls r1, r4, 1 - adds r0, 0x4 - adds r0, r1 - ldrh r1, [r0] - lsls r2, r4, 24 - lsrs r2, 24 - ldr r0, =gEnemyParty - bl sub_80691F4 - adds r4, 0x1 - cmp r4, 0x3 - ble _081A7CBA - ldr r0, =gEnemyParty - bl pokemon_calc_effective_stats - movs r0, 0x1 -_081A7CE2: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A7B90 - - thumb_func_start sub_81A7D00 -sub_81A7D00: @ 81A7D00 - push {lr} - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r2, =0x00000ca9 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 29 - ldr r2, =0x00000e04 - adds r1, r2 - adds r1, r0 - ldrh r1, [r1] - adds r2, r1, 0 - movs r0, 0x8C - lsls r0, 1 - cmp r1, r0 - bhi _081A7D34 - movs r1, 0 - b _081A7D4C - .pool -_081A7D34: - movs r0, 0x8C - lsls r0, 2 - cmp r1, r0 - bhi _081A7D40 - movs r1, 0x1 - b _081A7D4C -_081A7D40: - movs r0, 0xD2 - lsls r0, 2 - movs r1, 0x3 - cmp r2, r0 - bhi _081A7D4C - movs r1, 0x2 -_081A7D4C: - adds r0, r1, 0 - pop {r1} - bx r1 - thumb_func_end sub_81A7D00 - - thumb_func_start sub_81A7D54 -sub_81A7D54: @ 81A7D54 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_08612688 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_081A7D66: - movs r1, 0x8 - ldrsh r0, [r4, r1] - lsls r0, 2 - adds r0, r5 - ldr r1, [r0] - adds r0, r4, 0 - bl _call_via_r1 - lsls r0, 24 - cmp r0, 0 - bne _081A7D66 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A7D54 - - thumb_func_start sub_81A7D8C -sub_81A7D8C: @ 81A7D8C - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x14] - movs r2, 0x14 - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _081A7DA4 - subs r0, r1, 0x1 - strh r0, [r4, 0x14] - lsls r0, 16 - cmp r0, 0 - bne _081A7DC8 -_081A7DA4: - ldrh r0, [r4, 0xA] - strh r0, [r4, 0x14] - ldrh r0, [r4, 0x10] - ldrh r1, [r4, 0x16] - adds r0, r1 - strh r0, [r4, 0x16] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x10 - ble _081A7DBC - movs r0, 0x10 - strh r0, [r4, 0x16] -_081A7DBC: - movs r0, 0x1 - negs r0, r0 - ldrb r1, [r4, 0x16] - ldr r2, =0x00002d6b - bl BlendPalettes -_081A7DC8: - movs r2, 0x16 - ldrsh r0, [r4, r2] - cmp r0, 0xF - ble _081A7DDA - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - ldrh r0, [r4, 0xC] - strh r0, [r4, 0x14] -_081A7DDA: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A7D8C - - thumb_func_start sub_81A7DE8 -sub_81A7DE8: @ 81A7DE8 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x14] - movs r2, 0x14 - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _081A7E00 - subs r0, r1, 0x1 - strh r0, [r4, 0x14] - lsls r0, 16 - cmp r0, 0 - bne _081A7E22 -_081A7E00: - ldrh r0, [r4, 0xC] - strh r0, [r4, 0x14] - ldrh r0, [r4, 0x16] - ldrh r1, [r4, 0x12] - subs r0, r1 - strh r0, [r4, 0x16] - lsls r0, 16 - cmp r0, 0 - bge _081A7E16 - movs r0, 0 - strh r0, [r4, 0x16] -_081A7E16: - movs r0, 0x1 - negs r0, r0 - ldrb r1, [r4, 0x16] - ldr r2, =0x00002d6b - bl BlendPalettes -_081A7E22: - movs r0, 0x16 - ldrsh r1, [r4, r0] - cmp r1, 0 - bne _081A7E56 - ldrh r0, [r4, 0xE] - subs r0, 0x1 - strh r0, [r4, 0xE] - lsls r0, 16 - cmp r0, 0 - bne _081A7E50 - ldr r0, =sub_81A7D54 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - b _081A7E56 - .pool -_081A7E50: - ldrh r0, [r4, 0xA] - strh r0, [r4, 0x14] - strh r1, [r4, 0x8] -_081A7E56: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81A7DE8 - - thumb_func_start sub_81A7E60 -sub_81A7E60: @ 81A7E60 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x4 - mov r8, r0 - adds r4, r1, 0 - adds r5, r2, 0 - adds r6, r3, 0 - ldr r3, [sp, 0x18] - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - lsls r6, 16 - lsrs r6, 16 - lsls r3, 16 - lsrs r3, 16 - ldr r0, =sub_81A7D54 - movs r1, 0x3 - str r3, [sp] - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - mov r0, r8 - strh r0, [r1, 0xA] - strh r4, [r1, 0xC] - strh r5, [r1, 0xE] - strh r6, [r1, 0x10] - ldr r3, [sp] - strh r3, [r1, 0x12] - strh r0, [r1, 0x14] - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A7E60 - - thumb_func_start sub_81A7EC4 -sub_81A7EC4: @ 81A7EC4 - push {lr} - ldr r0, =sub_81A7D54 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _081A7EDC - movs r0, 0 - b _081A7EDE - .pool -_081A7EDC: - movs r0, 0x1 -_081A7EDE: - pop {r1} - bx r1 - thumb_func_end sub_81A7EC4 - - thumb_func_start sub_81A7EE4 -sub_81A7EE4: @ 81A7EE4 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r1 - ldrh r2, [r1, 0x8] - movs r3, 0x8 - ldrsh r0, [r1, r3] - cmp r0, 0 - bne _081A7F1C - adds r0, r2, 0x1 - strh r0, [r1, 0x8] - movs r0, 0x2 - str r0, [sp] - movs r0, 0 - movs r1, 0 - movs r2, 0x3 - movs r3, 0x2 - bl sub_81A7E60 - b _081A7F30 - .pool -_081A7F1C: - bl sub_81A7EC4 - lsls r0, 24 - cmp r0, 0 - beq _081A7F30 - bl script_env_2_enable_and_set_ctx_running - adds r0, r4, 0 - bl DestroyTask -_081A7F30: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81A7EE4 - - thumb_func_start sub_81A7F38 -sub_81A7F38: @ 81A7F38 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - cmp r0, 0 - bne _081A7F50 - b _081A807A -_081A7F50: - movs r0, 0 - mov r8, r0 -_081A7F54: - mov r0, sp - add r0, r8 - mov r1, r8 - strb r1, [r0] - mov r0, r8 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - cmp r0, 0x2 - bls _081A7F54 - movs r5, 0 -_081A7F6C: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 24 - lsrs r4, r0, 24 - mov r2, sp - add r2, r8 - ldrb r3, [r2] - mov r0, sp - adds r1, r0, r4 - ldrb r0, [r1] - strb r0, [r2] - strb r3, [r1] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x9 - bls _081A7F6C - movs r1, 0 - mov r8, r1 -_081A7FB0: - movs r0, 0 - mov r10, r0 - mov r4, sp - add r4, r8 - ldrb r1, [r4] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r7, r1, r0 - adds r0, r7, 0 - movs r1, 0x39 - bl GetMonData - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r7, 0 - movs r1, 0x3A - bl GetMonData - lsls r0, 16 - lsrs r6, r0, 16 - str r4, [sp, 0x8] - cmp r5, r6 - bcc _081A8044 - adds r0, r7, 0 - movs r1, 0x37 - bl GetMonData - bl pokemon_ailments_get_primary - lsls r0, 24 - cmp r0, 0 - beq _081A7FFC - movs r0, 0x1 - mov r10, r0 - b _081A8048 - .pool -_081A7FFC: - adds r0, r7, 0 - movs r1, 0x15 - bl GetMonData - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - movs r4, 0 - b _081A8014 -_081A800E: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_081A8014: - cmp r4, 0x3 - bhi _081A8048 - adds r1, r4, 0 - adds r1, 0xD - adds r0, r7, 0 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - mov r1, r9 - adds r2, r4, 0 - bl CalcPPWithPPUps - lsls r0, 24 - lsrs r6, r0, 24 - adds r1, r4, 0 - adds r1, 0x11 - adds r0, r7, 0 - bl GetMonData - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, r6 - bcs _081A800E -_081A8044: - movs r1, 0x1 - mov r10, r1 -_081A8048: - mov r0, r10 - cmp r0, 0x1 - bne _081A806C - ldr r0, [sp, 0x8] - ldrb r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - bl sub_81A7594 - ldr r0, [sp, 0x4] - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - cmp r0, 0 - beq _081A807A -_081A806C: - mov r0, r8 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - cmp r0, 0x2 - bls _081A7FB0 -_081A807A: - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A7F38 - - thumb_func_start sub_81A8090 -sub_81A8090: @ 81A8090 - push {r4,lr} - ldr r4, =gScriptResult - bl InBattlePike - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A8090 - - thumb_func_start InBattlePike -InBattlePike: @ 81A80A8 - push {lr} - movs r2, 0 - ldr r0, =gUnknown_02037318 - ldrh r1, [r0, 0x12] - ldr r3, =0xfffffea1 - adds r0, r1, r3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bls _081A80CA - movs r0, 0xB3 - lsls r0, 1 - cmp r1, r0 - beq _081A80CA - adds r0, 0x1 - cmp r1, r0 - bne _081A80CC -_081A80CA: - movs r2, 0x1 -_081A80CC: - adds r0, r2, 0 - pop {r1} - bx r1 - .pool - thumb_func_end InBattlePike - - thumb_func_start sub_81A80DC -sub_81A80DC: @ 81A80DC - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r4, =gScriptResult - movs r0, 0 - strh r0, [r4] - movs r0, 0x1 - bl sub_81A8590 - lsls r0, 24 - cmp r0, 0 - beq _081A8138 - movs r0, 0x1 - strh r0, [r4] - bl Random - ldr r5, =gSaveBlock2Ptr - ldr r4, [r5] - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x6 - bl __umodsi3 - movs r3, 0xE1 - lsls r3, 4 - adds r4, r3 - movs r1, 0x7 - ands r1, r0 - ldrb r2, [r4] - movs r0, 0x8 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4] - ldr r2, [r5] - adds r2, r3 - ldrb r1, [r2] - movs r0, 0x79 - negs r0, r0 - ands r0, r1 - movs r1, 0x40 - b _081A8248 - .pool -_081A8138: - bl Random - ldr r7, =gSaveBlock2Ptr - ldr r4, [r7] - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - movs r3, 0xE1 - lsls r3, 4 - adds r4, r3 - movs r1, 0x7 - ands r1, r0 - ldrb r2, [r4] - movs r0, 0x8 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4] - ldr r0, [r7] - adds r0, r3 - ldrb r1, [r0] - movs r0, 0x80 - ands r0, r1 - movs r6, 0x8 - cmp r0, 0 - beq _081A8172 - movs r6, 0x6 -_081A8172: - adds r0, r6, 0 - bl AllocZeroed - adds r5, r0, 0 - movs r2, 0 - movs r3, 0 - cmp r2, r6 - bcs _081A81BE - adds r4, r7, 0 -_081A8184: - ldr r0, [r4] - movs r1, 0xE1 - lsls r1, 4 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081A81B0 - cmp r2, 0x1 - beq _081A81B4 - cmp r2, 0x4 - beq _081A81B4 - adds r1, r3, 0 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - adds r1, r5, r1 - strb r2, [r1] - b _081A81B4 - .pool -_081A81B0: - adds r0, r5, r2 - strb r2, [r0] -_081A81B4: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, r6 - bcc _081A8184 -_081A81BE: - bl Random - ldr r7, =gSaveBlock2Ptr - ldr r4, [r7] - lsls r0, 16 - lsrs r0, 16 - adds r1, r6, 0 - bl __modsi3 - adds r0, r5, r0 - ldrb r0, [r0] - movs r6, 0xE1 - lsls r6, 4 - adds r4, r6 - movs r1, 0xF - ands r1, r0 - lsls r1, 3 - ldrb r2, [r4] - movs r0, 0x79 - negs r0, r0 - mov r8, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4] - adds r0, r5, 0 - bl Free - ldr r0, [r7] - adds r0, r6 - ldrb r1, [r0] - movs r0, 0x78 - ands r0, r1 - cmp r0, 0x18 - bne _081A821C - bl sub_81A7974 - lsls r0, 24 - cmp r0, 0 - bne _081A821C - ldr r2, [r7] - adds r2, r6 - ldrb r1, [r2] - mov r0, r8 - ands r0, r1 - movs r1, 0x10 - orrs r0, r1 - strb r0, [r2] -_081A821C: - ldr r5, =gSaveBlock2Ptr - ldr r0, [r5] - movs r4, 0xE1 - lsls r4, 4 - adds r0, r4 - ldrb r1, [r0] - movs r0, 0x78 - ands r0, r1 - cmp r0, 0x38 - bne _081A824C - bl sub_81A8554 - lsls r0, 24 - cmp r0, 0 - bne _081A824C - ldr r2, [r5] - adds r2, r4 - ldrb r1, [r2] - movs r0, 0x79 - negs r0, r0 - ands r0, r1 - movs r1, 0x10 -_081A8248: - orrs r0, r1 - strb r0, [r2] -_081A824C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A80DC - - thumb_func_start sub_81A825C -sub_81A825C: @ 81A825C - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - movs r2, 0xE1 - lsls r2, 4 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 29 - lsrs r0, 29 - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_81A825C - - thumb_func_start sub_81A827C -sub_81A827C: @ 81A827C - ldr r2, =gScriptResult - ldr r1, =gUnknown_0861266C - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - movs r3, 0xE1 - lsls r3, 4 - adds r0, r3 - ldrb r0, [r0] - lsls r0, 25 - lsrs r0, 28 - adds r0, r1 - ldrb r0, [r0] - strh r0, [r2] - bx lr - .pool - thumb_func_end sub_81A827C - - thumb_func_start sub_81A82A4 -sub_81A82A4: @ 81A82A4 - push {r4-r7,lr} - lsls r0, 24 - movs r7, 0x6 - cmp r0, 0 - bne _081A82B0 - movs r7, 0x1 -_081A82B0: - ldr r4, =gSaveBlock2Ptr - ldr r1, [r4] - ldr r2, =0x00000ca9 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 29 - ldr r2, =0x00000e04 - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - movs r1, 0xE - bl __udivsi3 - lsls r0, 16 - lsrs r6, r0, 16 - adds r5, r4, 0 -_081A82D2: - lsls r0, r6, 24 - lsrs r0, 24 - adds r1, r7, 0 - bl sub_8162548 - lsls r0, 16 - lsrs r4, r0, 16 - movs r3, 0 - ldr r1, [r5] - ldr r2, =0x00000cb2 - adds r0, r1, r2 - ldrh r0, [r0] - subs r2, r0, 0x1 - cmp r3, r2 - bge _081A831A - ldr r0, =0x00000cb4 - adds r1, r0 - b _081A8314 - .pool -_081A830C: - adds r1, 0x2 - adds r3, 0x1 - cmp r3, r2 - bge _081A831A -_081A8314: - ldrh r0, [r1] - cmp r0, r4 - bne _081A830C -_081A831A: - ldr r0, [r5] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r0, [r0] - subs r0, 0x1 - cmp r3, r0 - bne _081A82D2 - ldr r5, =gUnknown_02038BCA - strh r4, [r5] - ldr r1, =gUnknown_0203BC88 - ldr r0, =gBattleFrontierTrainers - str r0, [r1] - ldrh r0, [r5] - movs r1, 0 - bl sub_8162614 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r0, =0x00000cb2 - adds r2, r1, r0 - ldrh r0, [r2] - cmp r0, 0xD - bhi _081A8356 - subs r0, 0x1 - lsls r0, 1 - ldr r2, =0x00000cb4 - adds r1, r2 - adds r1, r0 - ldrh r0, [r5] - strh r0, [r1] -_081A8356: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A82A4 - - thumb_func_start sub_81A8374 -sub_81A8374: @ 81A8374 - push {r4-r7,lr} - ldr r4, =gSaveBlock2Ptr - ldr r1, [r4] - ldr r2, =0x00000ca9 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 29 - ldr r2, =0x00000e04 - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - movs r1, 0xE - bl __udivsi3 - lsls r0, 16 - lsrs r5, r0, 16 - ldr r1, =gUnknown_0203BC88 - ldr r0, =gBattleFrontierTrainers - str r0, [r1] - lsls r7, r5, 24 - adds r6, r4, 0 -_081A83A0: - lsls r0, r5, 24 - lsrs r0, 24 - movs r1, 0x1 - bl sub_8162548 - lsls r0, 16 - lsrs r4, r0, 16 - movs r3, 0 - ldr r1, [r6] - ldr r2, =0x00000cb2 - adds r0, r1, r2 - ldrh r0, [r0] - subs r2, r0, 0x1 - cmp r3, r2 - bge _081A83EE - ldr r0, =0x00000cb4 - adds r1, r0 - b _081A83E8 - .pool -_081A83E0: - adds r1, 0x2 - adds r3, 0x1 - cmp r3, r2 - bge _081A83EE -_081A83E8: - ldrh r0, [r1] - cmp r0, r4 - bne _081A83E0 -_081A83EE: - ldr r0, [r6] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r0, [r0] - subs r0, 0x1 - cmp r3, r0 - bne _081A83A0 - ldr r5, =gUnknown_02038BCA - strh r4, [r5] - ldrh r0, [r5] - movs r1, 0 - bl sub_8162614 - ldr r3, =gSaveBlock2Ptr - ldr r1, [r3] - ldr r0, =0x00000cb2 - adds r2, r1, r0 - ldrh r0, [r2] - cmp r0, 0xE - bhi _081A8424 - subs r0, 0x1 - lsls r0, 1 - ldr r2, =0x00000cb4 - adds r1, r2 - adds r1, r0 - ldrh r0, [r5] - strh r0, [r1] -_081A8424: - adds r5, r3, 0 -_081A8426: - lsrs r0, r7, 24 - movs r1, 0x1 - bl sub_8162548 - lsls r0, 16 - lsrs r4, r0, 16 - movs r3, 0 - ldr r1, [r5] - ldr r2, =0x00000cb2 - adds r0, r1, r2 - ldrh r0, [r0] - cmp r3, r0 - bge _081A8466 - adds r2, 0x2 - adds r0, r1, r2 - ldrh r0, [r0] - cmp r0, r4 - beq _081A8466 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - subs r2, 0x2 - adds r0, r1, r2 - ldrh r2, [r0] - ldr r0, =0x00000cb4 - adds r1, r0 -_081A8458: - adds r1, 0x2 - adds r3, 0x1 - cmp r3, r2 - bge _081A8466 - ldrh r0, [r1] - cmp r0, r4 - bne _081A8458 -_081A8466: - ldr r0, [r5] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r0, [r0] - cmp r3, r0 - bne _081A8426 - ldr r5, =gUnknown_02038BCC - strh r4, [r5] - ldrh r0, [r5] - movs r1, 0x1 - bl sub_8162614 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r0, =0x00000cb2 - adds r2, r1, r0 - ldrh r0, [r2] - cmp r0, 0xD - bhi _081A849A - subs r0, 0x2 - lsls r0, 1 - ldr r2, =0x00000cb4 - adds r1, r2 - adds r1, r0 - ldrh r0, [r5] - strh r0, [r1] -_081A849A: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A8374 - - thumb_func_start sub_81A84B4 -sub_81A84B4: @ 81A84B4 - push {r4,r5,lr} - movs r2, 0 - ldr r5, =gSaveBlock2Ptr - ldr r4, =0x00000cb4 - ldr r0, =0x0000ffff - adds r3, r0, 0 -_081A84C0: - ldr r1, [r5] - lsls r0, r2, 1 - adds r1, r4 - adds r1, r0 - ldrh r0, [r1] - orrs r0, r3 - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xD - bls _081A84C0 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A84B4 - - thumb_func_start sub_81A84EC -sub_81A84EC: @ 81A84EC - push {lr} - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0 - bne _081A8524 - ldr r3, =gUnknown_02038BCA - ldrh r1, [r3] - ldr r0, =0x0000012b - cmp r1, r0 - bhi _081A8542 - ldr r2, =gUnknown_0203BC88 - movs r0, 0x34 - muls r1, r0 - ldr r0, [r2] - adds r0, r1 - adds r0, 0xC - bl ConvertBattleFrontierTrainerSpeechToString - b _081A8542 - .pool -_081A8524: - cmp r0, 0x1 - bne _081A8542 - ldr r3, =gUnknown_02038BCC - ldrh r1, [r3] - ldr r0, =0x0000012b - cmp r1, r0 - bhi _081A8542 - ldr r2, =gUnknown_0203BC88 - movs r0, 0x34 - muls r1, r0 - ldr r0, [r2] - adds r0, r1 - adds r0, 0xC - bl ConvertBattleFrontierTrainerSpeechToString -_081A8542: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A84EC - - thumb_func_start sub_81A8554 -sub_81A8554: @ 81A8554 - push {r4-r6,lr} - ldr r5, =gPlayerParty - movs r6, 0 - movs r4, 0 -_081A855C: - adds r0, r5, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - bne _081A856E - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_081A856E: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, 0x64 - cmp r4, 0x2 - bls _081A855C - cmp r6, 0x1 - bhi _081A8588 - movs r0, 0x1 - b _081A858A - .pool -_081A8588: - movs r0, 0 -_081A858A: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81A8554 - - thumb_func_start sub_81A8590 -sub_81A8590: @ 81A8590 - push {r4-r6,lr} - lsls r0, 24 - movs r6, 0 - ldr r1, =gSaveBlock2Ptr - ldr r2, [r1] - ldr r3, =0x00000ca9 - adds r1, r2, r3 - ldrb r1, [r1] - lsls r1, 30 - lsrs r1, 29 - ldr r3, =0x00000e04 - adds r2, r3 - adds r2, r1 - lsrs r4, r0, 24 - ldrh r2, [r2] - adds r0, r4, r2 - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0x5 - bl sub_81A3B30 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - blt _081A85F0 - cmp r2, 0x1 - bgt _081A85F0 - ldr r1, =gUnknown_086125DC - adds r0, r2, 0 - adds r0, 0x14 - adds r0, r1 - ldrb r0, [r0] - ldrb r1, [r1, 0x17] - subs r0, r1 - cmp r4, r0 - bne _081A8634 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - b _081A8634 - .pool -_081A85F0: - ldr r5, =gUnknown_086125DC - movs r0, 0x5 - lsls r3, r0, 2 - adds r0, r3, r5 - ldrb r1, [r0] - adds r0, r5, 0x3 - adds r0, r3, r0 - ldrb r2, [r0] - subs r1, r2 - cmp r4, r1 - bne _081A8610 - movs r6, 0x3 - b _081A8634 - .pool -_081A8610: - adds r0, r5, 0x1 - adds r0, r3, r0 - ldrb r1, [r0] - subs r0, r1, r2 - cmp r4, r0 - beq _081A8632 - cmp r4, r1 - bls _081A8634 - subs r0, r4, r1 - adds r0, r2 - adds r1, r5, 0x2 - adds r1, r3, r1 - ldrb r1, [r1] - bl __modsi3 - cmp r0, 0 - bne _081A8634 -_081A8632: - movs r6, 0x4 -_081A8634: - adds r0, r6, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81A8590 - - thumb_func_start sub_81A863C -sub_81A863C: @ 81A863C - push {r4,lr} - ldr r4, =gScriptResult - movs r0, 0 - bl sub_81A8590 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A863C - - thumb_func_start sub_81A8658 -sub_81A8658: @ 81A8658 - push {r4,lr} - ldr r3, =gUnknown_08612675 - ldr r2, =gSpecialVar_0x8007 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - movs r1, 0xE1 - lsls r1, 4 - adds r0, r1 - ldrb r1, [r0] - lsls r1, 29 - lsrs r1, 29 - lsls r0, r1, 1 - adds r0, r1 - ldrh r2, [r2] - adds r0, r2 - adds r0, r3 - ldrb r4, [r0] - adds r0, r4, 0 - bl sub_81A7F38 - ldr r0, =gScriptResult - strh r4, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A8658 - - thumb_func_start sub_81A869C -sub_81A869C: @ 81A869C - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r0, =gSpecialVar_0x8005 - ldrb r1, [r0] - movs r0, 0xE1 - lsls r0, 4 - adds r2, r0 - lsls r1, 7 - ldrb r3, [r2] - movs r0, 0x7F - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - bx lr - .pool - thumb_func_end sub_81A869C - - thumb_func_start sub_81A86C0 -sub_81A86C0: @ 81A86C0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r1, =gScriptResult - movs r0, 0x1 - strh r0, [r1] - movs r0, 0 - mov r10, r0 -_081A86D4: - movs r0, 0 - mov r9, r0 - movs r0, 0x64 - mov r1, r10 - muls r1, r0 - ldr r0, =gPlayerParty - adds r7, r1, r0 - adds r0, r7, 0 - movs r1, 0x39 - bl GetMonData - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r7, 0 - movs r1, 0x3A - bl GetMonData - lsls r0, 16 - lsrs r5, r0, 16 - cmp r4, r5 - bcc _081A8762 - adds r0, r7, 0 - movs r1, 0x37 - bl GetMonData - bl pokemon_ailments_get_primary - lsls r0, 24 - cmp r0, 0 - bne _081A8762 - adds r0, r7, 0 - movs r1, 0x15 - bl GetMonData - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r6, 0 - b _081A8732 - .pool -_081A872C: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_081A8732: - cmp r6, 0x3 - bhi _081A8766 - adds r1, r6, 0 - adds r1, 0xD - adds r0, r7, 0 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - mov r1, r8 - adds r2, r6, 0 - bl CalcPPWithPPUps - lsls r0, 24 - lsrs r5, r0, 24 - adds r1, r6, 0 - adds r1, 0x11 - adds r0, r7, 0 - bl GetMonData - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, r5 - bcs _081A872C -_081A8762: - movs r0, 0x1 - mov r9, r0 -_081A8766: - mov r0, r9 - cmp r0, 0x1 - bne _081A8778 - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - b _081A8786 - .pool -_081A8778: - mov r0, r10 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - cmp r0, 0x2 - bls _081A86D4 -_081A8786: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81A86C0 - - thumb_func_start sub_81A8794 -sub_81A8794: @ 81A8794 - push {r4-r7,lr} - movs r5, 0 - ldr r7, =gSaveBlock1Ptr - ldr r6, =gSaveBlock2Ptr -_081A879C: - ldr r0, [r6] - lsls r4, r5, 1 - ldr r1, =0x00000caa - adds r0, r1 - adds r0, r4 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - movs r2, 0xEA - lsls r2, 1 - adds r1, r2 - ldr r0, [r7] - adds r0, r1 - movs r1, 0xC - bl GetMonData - ldr r1, [r6] - ldr r2, =0x00000e12 - adds r1, r2 - adds r1, r4 - strh r0, [r1] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bls _081A879C - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A8794 - - thumb_func_start sub_81A87E8 -sub_81A87E8: @ 81A87E8 - push {r4,lr} - movs r4, 0 -_081A87EC: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - lsls r3, r4, 1 - ldr r1, =0x00000caa - adds r0, r2, r1 - adds r0, r3 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gUnknown_02024488 - adds r0, r1 - ldr r1, =0x00000e12 - adds r3, r1 - adds r2, r3 - movs r1, 0xC - bl SetMonData - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _081A87EC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A87E8 - - thumb_func_start sub_81A8830 -sub_81A8830: @ 81A8830 - push {r4-r6,lr} - ldr r3, =gSaveBlock2Ptr - ldr r1, [r3] - ldr r2, =0x00000ca9 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r5, r0, 30 - ldr r0, =0x00000ca8 - adds r1, r0 - movs r4, 0 - strb r4, [r1] - ldr r1, [r3] - ldr r6, =0x00000cb2 - adds r0, r1, r6 - strh r4, [r0] - adds r1, r2 - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r3, [r3] - ldr r0, =0x00000cdc - adds r2, r3, r0 - ldr r1, =gUnknown_08612690 - lsls r0, r5, 2 - adds r0, r1 - ldr r1, [r2] - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _081A887C - lsls r1, r5, 1 - ldr r2, =0x00000e04 - adds r0, r3, r2 - adds r0, r1 - strh r4, [r0] -_081A887C: - ldr r0, =gUnknown_02038BCA - strh r4, [r0] - ldr r1, =gBattleOutcome - movs r0, 0 - strb r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A8830 - - thumb_func_start sub_81A88B0 -sub_81A88B0: @ 81A88B0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =gPlayerParty - adds r0, r4, 0 - movs r1, 0x6 - bl GetMonData - cmp r0, 0 - bne _081A8904 - adds r0, r4, 0 - bl GetMonAbility - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x33 - beq _081A88D6 - cmp r0, 0x16 - bne _081A8904 -_081A88D6: - adds r0, r4, 0 - movs r1, 0x38 - bl GetMonData - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x5 - bls _081A8904 - subs r0, 0x5 - cmp r5, r0 - bgt _081A8904 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081A8904 - movs r0, 0 - b _081A8906 - .pool -_081A8904: - movs r0, 0x1 -_081A8906: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81A88B0 - - thumb_func_start sub_81A890C -sub_81A890C: @ 81A890C - push {lr} - lsls r0, 16 - lsrs r2, r0, 16 - ldr r0, =0x0000017b - cmp r2, r0 - bne _081A8920 - movs r1, 0 - b _081A892A - .pool -_081A8920: - ldr r0, =0x00000149 - movs r1, 0x2 - cmp r2, r0 - bne _081A892A - movs r1, 0x1 -_081A892A: - adds r0, r1, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A890C - - thumb_func_start sub_81A8934 -@ void sub_81A8934(u8) -sub_81A8934: @ 81A8934 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =gUnknown_0203CE50 - ldr r0, [r4] - cmp r0, 0 - bne _081A894A - movs r0, 0x44 - bl AllocZeroed - str r0, [r4] -_081A894A: - ldr r0, [r4] - adds r0, 0x41 - strb r5, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A8934 - - thumb_func_start sub_81A895C -sub_81A895C: @ 81A895C - push {r4,lr} - ldr r4, =gUnknown_0203CE50 - ldr r0, [r4] - cmp r0, 0 - beq _081A896E - bl Free - movs r0, 0 - str r0, [r4] -_081A896E: - movs r0, 0xFF - movs r1, 0 - movs r2, 0 - bl GetFieldObjectIdByLocalIdAndMap - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - adds r0, r1 - bl FieldObjectClearAnimIfSpecialAnimFinished - bl sub_80D338C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A895C - - thumb_func_start sub_81A89A0 -sub_81A89A0: @ 81A89A0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0xC7 - lsls r1, 4 - adds r1, r0 - mov r9, r1 - movs r3, 0 - mov r10, r3 - mov r8, r3 -_081A89C4: - mov r0, r8 - lsls r4, r0, 1 - adds r1, r4, r0 - lsls r1, 3 - add r1, r9 - ldrh r0, [r1, 0x4] - adds r0, 0x7 - ldrh r1, [r1, 0x6] - adds r1, 0x7 - lsls r0, 16 - asrs r0, 16 - lsls r1, 16 - asrs r1, 16 - bl MapGridGetMetatileIdAt - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, =gUnknown_0203CE50 - ldr r0, [r0] - adds r0, 0x41 - ldrb r0, [r0] - movs r2, 0xA6 - lsls r2, 2 - cmp r0, 0 - bne _081A89F8 - subs r2, 0x48 -_081A89F8: - ldr r0, =0x0000024f - cmp r1, r0 - bls _081A8AD4 - subs r1, r2 - adds r0, r1, 0 - cmp r1, 0 - bge _081A8A08 - adds r0, r1, 0x7 -_081A8A08: - asrs r2, r0, 3 - lsls r0, r2, 24 - lsrs r0, 24 - cmp r0, 0x4 - bhi _081A8AD4 - ldr r3, [sp] - cmp r0, r3 - bne _081A8AD4 - lsls r0, r2, 3 - subs r0, r1, r0 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bhi _081A8AD4 - movs r1, 0 - movs r2, 0 - cmp r5, 0x1 - beq _081A8A58 - cmp r5, 0x1 - bgt _081A8A44 - cmp r5, 0 - beq _081A8A4E - b _081A8AD4 - .pool -_081A8A44: - cmp r5, 0x2 - beq _081A8A64 - cmp r5, 0x3 - beq _081A8A70 - b _081A8AD4 -_081A8A4E: - ldr r7, =gUnknown_08612698 - movs r1, 0x1 - b _081A8A74 - .pool -_081A8A58: - ldr r7, =gUnknown_0861269C - movs r2, 0x1 - b _081A8A74 - .pool -_081A8A64: - ldr r7, =gUnknown_086126A0 - movs r1, 0xFF - b _081A8A74 - .pool -_081A8A70: - ldr r7, =gUnknown_086126A4 - movs r2, 0xFF -_081A8A74: - mov r3, r8 - adds r0, r4, r3 - lsls r0, 3 - mov r3, r9 - adds r4, r0, r3 - lsls r0, r1, 24 - asrs r0, 24 - ldrh r1, [r4, 0x4] - adds r0, r1 - strh r0, [r4, 0x4] - lsls r0, r2, 24 - asrs r0, 24 - ldrh r3, [r4, 0x6] - adds r0, r3 - strh r0, [r4, 0x6] - ldrb r0, [r4] - ldr r6, =gSaveBlock1Ptr - ldr r2, [r6] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - bl GetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x10 - beq _081A8ACC - mov r0, r8 - adds r1, r5, 0 - bl sub_81A8D60 - ldrb r4, [r4] - mov r10, r4 - mov r0, r10 - ldr r2, [r6] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - adds r3, r7, 0 - bl exec_movement - b _081A8AD4 - .pool -_081A8ACC: - mov r0, r8 - adds r1, r5, 0 - bl sub_81A8D94 -_081A8AD4: - mov r0, r8 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - cmp r0, 0x3F - bhi _081A8AE4 - b _081A89C4 -_081A8AE4: - mov r0, r10 - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81A89A0 - - thumb_func_start sub_81A8AF8 -sub_81A8AF8: @ 81A8AF8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r1, =gUnknown_0203CE50 - ldr r2, [r1] - cmp r2, 0 - bne _081A8B0C - b _081A8D4A -_081A8B0C: - adds r0, r2, 0 - adds r0, 0x41 - ldrb r0, [r0] - movs r3, 0xA6 - lsls r3, 2 - mov r10, r3 - cmp r0, 0 - bne _081A8B22 - movs r0, 0x94 - lsls r0, 2 - mov r10, r0 -_081A8B22: - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r3, 0xC7 - lsls r3, 4 - adds r7, r0, r3 - movs r0, 0 - mov r9, r0 - adds r0, r2, 0 - adds r0, 0x40 - ldrb r0, [r0] - cmp r9, r0 - bcc _081A8B3C - b _081A8D4A -_081A8B3C: - mov r8, r1 -_081A8B3E: - mov r1, r8 - ldr r0, [r1] - mov r2, r9 - lsls r4, r2, 2 - adds r0, r4 - ldrb r0, [r0, 0x1] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 3 - adds r1, r7 - ldrh r0, [r1, 0x4] - adds r0, 0x7 - ldrh r1, [r1, 0x6] - adds r1, 0x7 - lsls r0, 16 - asrs r0, 16 - lsls r1, 16 - asrs r1, 16 - bl MapGridGetMetatileIdAt - lsls r0, 16 - lsrs r0, 16 - mov r3, r10 - subs r1, r0, r3 - adds r0, r1, 0 - cmp r1, 0 - bge _081A8B76 - adds r0, r1, 0x7 -_081A8B76: - asrs r0, 3 - lsls r0, 3 - subs r0, r1, r0 - lsls r0, 24 - lsrs r0, 24 - mov r2, r8 - ldr r1, [r2] - adds r1, r4 - ldrb r1, [r1] - subs r0, r1 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - blt _081A8B96 - cmp r1, 0x3 - bne _081A8BAC -_081A8B96: - movs r0, 0x3 - negs r0, r0 - movs r6, 0 - cmp r1, r0 - bne _081A8BB4 - b _081A8BB2 - .pool -_081A8BAC: - movs r6, 0x2 - cmp r1, 0 - ble _081A8BB4 -_081A8BB2: - movs r6, 0x1 -_081A8BB4: - ldr r5, =gUnknown_0203CE50 - ldr r0, [r5] - adds r0, r4 - ldrb r1, [r0, 0x1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r7 - ldrb r0, [r0] - ldr r1, =gSaveBlock1Ptr - ldr r2, [r1] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - bl GetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x10 - bne _081A8BDC - b _081A8D32 -_081A8BDC: - ldr r0, =gUnknown_02037350 - lsls r1, r2, 3 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x18] - lsls r0, 28 - lsrs r0, 28 - adds r1, r0, 0 - cmp r6, 0 - bne _081A8C9C - cmp r0, 0x2 - beq _081A8C60 - cmp r0, 0x2 - bgt _081A8C0C - cmp r0, 0x1 - beq _081A8C30 - b _081A8D32 - .pool -_081A8C0C: - cmp r0, 0x3 - beq _081A8C48 - cmp r0, 0x4 - beq _081A8C16 - b _081A8D32 -_081A8C16: - ldr r3, =gUnknown_086126AE - ldr r0, [r5] - adds r0, r4 - ldrb r1, [r0, 0x1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r7 - movs r1, 0x7 - b _081A8C72 - .pool -_081A8C30: - ldr r3, =gUnknown_086126A8 - ldr r0, [r5] - adds r0, r4 - ldrb r1, [r0, 0x1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r7 - movs r1, 0xA - b _081A8C72 - .pool -_081A8C48: - ldr r3, =gUnknown_086126AA - ldr r0, [r5] - adds r0, r4 - ldrb r1, [r0, 0x1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r7 - movs r1, 0x8 - b _081A8C72 - .pool -_081A8C60: - ldr r3, =gUnknown_086126AC - ldr r0, [r5] - adds r0, r4 - ldrb r1, [r0, 0x1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r7 - movs r1, 0x9 -_081A8C72: - strb r1, [r0, 0x9] - mov r1, r8 - ldr r0, [r1] - adds r0, r4 - ldrb r1, [r0, 0x1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r7 - ldrb r0, [r0] - ldr r1, =gSaveBlock1Ptr - ldr r2, [r1] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - bl exec_movement - b _081A8D32 - .pool -_081A8C9C: - cmp r6, 0x1 - bne _081A8D32 - cmp r0, 0x2 - beq _081A8D00 - cmp r0, 0x2 - bgt _081A8CAE - cmp r0, 0x1 - beq _081A8CD0 - b _081A8D32 -_081A8CAE: - cmp r1, 0x3 - beq _081A8CE8 - cmp r1, 0x4 - bne _081A8D32 - ldr r3, =gUnknown_086126AA - ldr r0, [r5] - adds r0, r4 - ldrb r1, [r0, 0x1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r7 - movs r1, 0x8 - b _081A8D12 - .pool -_081A8CD0: - ldr r3, =gUnknown_086126AC - ldr r0, [r5] - adds r0, r4 - ldrb r1, [r0, 0x1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r7 - movs r1, 0x9 - b _081A8D12 - .pool -_081A8CE8: - ldr r3, =gUnknown_086126AE - ldr r0, [r5] - adds r0, r4 - ldrb r1, [r0, 0x1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r7 - movs r1, 0x7 - b _081A8D12 - .pool -_081A8D00: - ldr r3, =gUnknown_086126A8 - ldr r0, [r5] - adds r0, r4 - ldrb r1, [r0, 0x1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r7 - movs r1, 0xA -_081A8D12: - strb r1, [r0, 0x9] - mov r2, r8 - ldr r0, [r2] - adds r0, r4 - ldrb r1, [r0, 0x1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r7 - ldrb r0, [r0] - ldr r1, =gSaveBlock1Ptr - ldr r2, [r1] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - bl exec_movement -_081A8D32: - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - mov r3, r8 - ldr r0, [r3] - adds r0, 0x40 - ldrb r0, [r0] - cmp r9, r0 - bcs _081A8D4A - b _081A8B3E -_081A8D4A: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A8AF8 - - thumb_func_start sub_81A8D60 -sub_81A8D60: @ 81A8D60 - push {r4,lr} - ldr r4, =gUnknown_0203CE50 - ldr r3, [r4] - adds r2, r3, 0 - adds r2, 0x40 - ldrb r2, [r2] - lsls r2, 2 - adds r3, r2 - strb r0, [r3, 0x1] - ldr r2, [r4] - adds r0, r2, 0 - adds r0, 0x40 - ldrb r0, [r0] - lsls r0, 2 - adds r2, r0 - strb r1, [r2] - ldr r1, [r4] - adds r1, 0x40 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A8D60 - - thumb_func_start sub_81A8D94 -sub_81A8D94: @ 81A8D94 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r6, r1, 24 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0xC7 - lsls r1, 4 - adds r5, r0, r1 - lsls r1, r4, 1 - adds r1, r4 - lsls r1, 3 - adds r1, r5 - ldrh r0, [r1, 0x4] - adds r0, 0x7 - ldrh r1, [r1, 0x6] - adds r1, 0x7 - lsls r0, 16 - asrs r0, 16 - lsls r1, 16 - asrs r1, 16 - bl MapGridGetMetatileIdAt - lsls r0, 16 - lsrs r2, r0, 16 - ldr r0, =gUnknown_0203CE50 - ldr r0, [r0] - adds r0, 0x41 - ldrb r0, [r0] - movs r1, 0xA6 - lsls r1, 2 - cmp r0, 0 - bne _081A8DDA - subs r1, 0x48 -_081A8DDA: - subs r1, r2, r1 - adds r0, r1, 0 - cmp r1, 0 - bge _081A8DE4 - adds r0, r1, 0x7 -_081A8DE4: - asrs r0, 3 - lsls r0, 3 - subs r0, r1, r0 - lsls r0, 24 - lsrs r0, 24 - subs r0, r6 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - blt _081A8DFC - cmp r1, 0x3 - bne _081A8E08 -_081A8DFC: - movs r2, 0 - b _081A8E1A - .pool -_081A8E08: - cmp r1, 0 - bgt _081A8E14 - movs r0, 0x3 - negs r0, r0 - cmp r1, r0 - bne _081A8E18 -_081A8E14: - movs r2, 0x1 - b _081A8E1A -_081A8E18: - movs r2, 0x2 -_081A8E1A: - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r5 - ldrb r0, [r1, 0x9] - adds r3, r0, 0 - cmp r2, 0 - bne _081A8E4C - cmp r0, 0x8 - beq _081A8E72 - cmp r0, 0x8 - bgt _081A8E38 - cmp r0, 0x7 - beq _081A8E48 - b _081A8E76 -_081A8E38: - cmp r0, 0x9 - beq _081A8E44 - cmp r0, 0xA - bne _081A8E76 - movs r0, 0x7 - b _081A8E74 -_081A8E44: - movs r0, 0x8 - b _081A8E74 -_081A8E48: - movs r0, 0x9 - b _081A8E74 -_081A8E4C: - cmp r2, 0x1 - bne _081A8E76 - cmp r0, 0x8 - beq _081A8E6A - cmp r0, 0x8 - bgt _081A8E5E - cmp r0, 0x7 - beq _081A8E72 - b _081A8E76 -_081A8E5E: - cmp r3, 0x9 - beq _081A8E6E - cmp r3, 0xA - bne _081A8E76 - movs r0, 0x8 - b _081A8E74 -_081A8E6A: - movs r0, 0x9 - b _081A8E74 -_081A8E6E: - movs r0, 0x7 - b _081A8E74 -_081A8E72: - movs r0, 0xA -_081A8E74: - strb r0, [r1, 0x9] -_081A8E76: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81A8D94 - - thumb_func_start sub_81A8E7C -sub_81A8E7C: @ 81A8E7C - push {lr} - ldr r1, =gUnknown_08613EE0 - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A8E7C - - thumb_func_start sub_81A8E9C -sub_81A8E9C: @ 81A8E9C - push {r4-r6,lr} - ldr r3, =gSaveBlock2Ptr - ldr r1, [r3] - ldr r4, =0x00000ca9 - adds r0, r1, r4 - ldrb r0, [r0] - lsls r0, 30 - lsrs r5, r0, 30 - ldr r0, =0x00000ca8 - adds r1, r0 - movs r2, 0 - strb r2, [r1] - ldr r1, [r3] - ldr r6, =0x00000cb2 - adds r0, r1, r6 - strh r2, [r0] - adds r1, r4 - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - cmp r5, 0 - beq _081A8EF0 - ldr r0, [r3] - ldr r1, =0x00000cdc - adds r0, r1 - ldr r2, [r0] - movs r0, 0x80 - lsls r0, 6 - b _081A8EFC - .pool -_081A8EF0: - ldr r0, [r3] - ldr r6, =0x00000cdc - adds r0, r6 - ldr r2, [r0] - movs r0, 0x80 - lsls r0, 5 -_081A8EFC: - ands r2, r0 - cmp r2, 0 - bne _081A8F14 - ldr r0, [r3] - lsls r1, r5, 1 - ldr r3, =0x00000e1a - adds r0, r3 - adds r0, r1 - strh r2, [r0] - adds r0, r5, 0 - bl sub_81AAA7C -_081A8F14: - bl sub_81C4EEC - ldr r0, =gUnknown_02038BCA - movs r1, 0 - strh r1, [r0] - ldr r0, =gBattleOutcome - strb r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A8E9C - - thumb_func_start sub_81A8F38 -sub_81A8F38: @ 81A8F38 - push {r4,lr} - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r2, =0x00000ca9 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r4, r0, 30 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - adds r3, r1, 0 - cmp r0, 0x6 - bls _081A8F54 - b _081A903A -_081A8F54: - lsls r0, 2 - ldr r1, =_081A8F70 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A8F70: - .4byte _081A8F8C - .4byte _081A8F9C - .4byte _081A8FB4 - .4byte _081A8FE4 - .4byte _081A8FF8 - .4byte _081A9010 - .4byte _081A9028 -_081A8F8C: - ldr r0, =gScriptResult - ldr r1, [r3] - ldr r3, =0x00000e18 - b _081A8FFE - .pool -_081A8F9C: - ldr r2, =gScriptResult - ldr r0, [r3] - lsls r1, r4, 1 - ldr r3, =0x00000e1a - adds r0, r3 - adds r0, r1 - ldrh r0, [r0] - b _081A9038 - .pool -_081A8FB4: - cmp r4, 0 - beq _081A8FCC - ldr r2, =gScriptResult - ldr r0, [r3] - ldr r1, =0x00000cdc - adds r0, r1 - b _081A9030 - .pool -_081A8FCC: - ldr r2, =gScriptResult - ldr r0, [r3] - ldr r3, =0x00000cdc - adds r0, r3 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 5 - b _081A9036 - .pool -_081A8FE4: - ldr r0, =gScriptResult - ldr r1, [r3] - ldr r2, =0x00000e1a - adds r1, r2 - b _081A9000 - .pool -_081A8FF8: - ldr r0, =gScriptResult - ldr r1, [r3] - ldr r3, =0x00000e1c -_081A8FFE: - adds r1, r3 -_081A9000: - ldrh r1, [r1] - strh r1, [r0] - b _081A903A - .pool -_081A9010: - ldr r2, =gScriptResult - ldr r0, [r3] - ldr r1, =0x00000cdc - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 5 - b _081A9036 - .pool -_081A9028: - ldr r2, =gScriptResult - ldr r0, [r3] - ldr r3, =0x00000cdc - adds r0, r3 -_081A9030: - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 6 -_081A9036: - ands r0, r1 -_081A9038: - strh r0, [r2] -_081A903A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A8F38 - - thumb_func_start sub_81A9048 -sub_81A9048: @ 81A9048 - push {lr} - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r1, =0x00000ca9 - adds r0, r2, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r1, r0, 30 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x1 - beq _081A9098 - cmp r0, 0x1 - bgt _081A9078 - cmp r0, 0 - beq _081A9082 - b _081A9126 - .pool -_081A9078: - cmp r0, 0x2 - beq _081A90B0 - cmp r0, 0x7 - beq _081A911C - b _081A9126 -_081A9082: - ldr r0, =gSpecialVar_0x8006 - ldrh r1, [r0] - ldr r3, =0x00000e18 - adds r0, r2, r3 - strh r1, [r0] - b _081A9126 - .pool -_081A9098: - lsls r1, 1 - ldr r3, =0x00000e1a - adds r0, r2, r3 - adds r0, r1 - ldr r1, =gSpecialVar_0x8006 - ldrh r1, [r1] - strh r1, [r0] - b _081A9126 - .pool -_081A90B0: - cmp r1, 0 - beq _081A90E4 - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - cmp r0, 0 - beq _081A90D0 - ldr r1, =0x00000cdc - adds r0, r2, r1 - ldr r1, [r0] - movs r2, 0x80 - lsls r2, 6 - b _081A90F6 - .pool -_081A90D0: - ldr r3, =0x00000cdc - adds r0, r2, r3 - ldr r1, [r0] - ldr r2, =0xffffdfff - b _081A910C - .pool -_081A90E4: - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - cmp r0, 0 - beq _081A9104 - ldr r1, =0x00000cdc - adds r0, r2, r1 - ldr r1, [r0] - movs r2, 0x80 - lsls r2, 5 -_081A90F6: - orrs r1, r2 - str r1, [r0] - b _081A9126 - .pool -_081A9104: - ldr r3, =0x00000cdc - adds r0, r2, r3 - ldr r1, [r0] - ldr r2, =0xffffefff -_081A910C: - ands r1, r2 - str r1, [r0] - b _081A9126 - .pool -_081A911C: - ldr r0, =gSpecialVar_0x8006 - ldrh r1, [r0] - ldr r3, =0x00000e2a - adds r0, r2, r3 - strb r1, [r0] -_081A9126: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9048 - - thumb_func_start sub_81A9134 -sub_81A9134: @ 81A9134 - push {r4,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =gSpecialVar_0x8005 - ldrh r1, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - strb r1, [r0] - movs r0, 0x80 - lsls r0, 7 - movs r1, 0 - bl VarSet - ldr r1, [r4] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - bl save_serialize_map - movs r0, 0x1 - bl TrySavingData - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9134 - - thumb_func_start sub_81A917C -sub_81A917C: @ 81A917C - push {r4,r5,lr} - ldr r4, =gSaveBlock2Ptr - ldr r1, [r4] - ldr r2, =0x00000ca9 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 29 - ldr r2, =0x00000e1a - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0x29 - bls _081A91CC - bl Random - ldr r4, [r4] - ldr r5, =gUnknown_08613F34 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x9 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 15 - adds r0, r5 - ldrh r0, [r0] - ldr r1, =0x00000e18 - adds r4, r1 - b _081A91EA - .pool -_081A91CC: - bl Random - ldr r4, [r4] - ldr r5, =gUnknown_08613F28 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x6 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 15 - adds r0, r5 - ldrh r0, [r0] - ldr r2, =0x00000e18 - adds r4, r2 -_081A91EA: - strh r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A917C - - thumb_func_start sub_81A91FC -sub_81A91FC: @ 81A91FC - push {r4,r5,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000e18 - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x1 - bl AddBagItem - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - bne _081A9244 - ldr r0, [r4] - ldr r1, =0x00000e18 - adds r0, r1 - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r0, [r4] - ldr r1, =0x00000e18 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - ldr r0, =gScriptResult - strh r5, [r0] - b _081A924A - .pool -_081A9244: - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] -_081A924A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A91FC - - thumb_func_start sub_81A9254 -sub_81A9254: @ 81A9254 - push {r4,r5,lr} - movs r4, 0 - ldr r5, =gSaveBlock2Ptr -_081A925A: - bl Random - ldr r1, [r5] - lsls r2, r4, 1 - ldr r3, =0x00000e22 - adds r1, r3 - adds r1, r2 - strh r0, [r1] - adds r4, 0x1 - cmp r4, 0x3 - ble _081A925A - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000e2a - adds r0, r1 - movs r1, 0 - strb r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9254 - - thumb_func_start CalculateBattlePyramidItemBallItemId -CalculateBattlePyramidItemBallItemId: @ 81A9290 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - ldr r5, =gSaveBlock2Ptr - ldr r1, [r5] - ldr r2, =0x00000ca9 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - mov r10, r0 - adds r2, 0x9 - adds r0, r1, r2 - ldrh r0, [r0] - str r0, [sp] - mov r2, r10 - lsls r0, r2, 1 - ldr r2, =0x00000e1a - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - movs r1, 0x7 - bl __udivsi3 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x14 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - cmp r0, 0x13 - bls _081A92DE - movs r0, 0x13 - mov r8, r0 -_081A92DE: - bl sub_81AA9E4 - lsls r0, 24 - ldr r1, =gScriptLastTalked - ldrh r4, [r1] - ldr r1, =gUnknown_08613650 - lsrs r0, 20 - adds r0, r1 - ldrb r0, [r0, 0x1] - subs r4, r0 - subs r7, r4, 0x1 - ldr r1, [r5] - lsrs r0, r7, 31 - adds r0, r7, r0 - asrs r0, 1 - lsls r0, 1 - ldr r2, =0x00000e22 - adds r1, r2 - adds r1, r0 - ldrh r6, [r1] - adds r0, r6, 0 - bl SeedRng2 - movs r5, 0 - mov r0, r8 - lsls r0, 2 - mov r9, r0 - cmp r5, r4 - bge _081A9332 -_081A9318: - bl Random2 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r6, r0, 16 - adds r5, 0x1 - adds r0, r7, 0x1 - cmp r5, r0 - blt _081A9318 -_081A9332: - ldr r0, =gUnknown_08613B3A - ldr r1, [sp] - adds r0, r1, r0 - ldrb r5, [r0] - ldr r1, =gUnknown_08613ABC - ldr r3, =gSpecialVar_0x8000 - ldr r4, =gSpecialVar_0x8001 - cmp r5, 0x3E - bhi _081A935E - lsls r2, r5, 1 - adds r0, r2, r1 - ldrb r0, [r0] - cmp r6, r0 - blt _081A935E - adds r0, r2, r1 -_081A9350: - adds r0, 0x2 - adds r5, 0x1 - cmp r5, 0x3E - bhi _081A935E - ldrb r2, [r0] - cmp r6, r2 - bge _081A9350 -_081A935E: - mov r0, r10 - cmp r0, 0 - beq _081A9394 - ldr r2, =gUnknown_0861392C - b _081A9396 - .pool -_081A9394: - ldr r2, =gUnknown_0861379C -_081A9396: - lsls r0, r5, 1 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 1 - mov r1, r9 - add r1, r8 - lsls r1, 2 - adds r0, r1 - adds r0, r2 - ldrh r0, [r0] - strh r0, [r3] - movs r0, 0x1 - strh r0, [r4] - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end CalculateBattlePyramidItemBallItemId - - thumb_func_start sub_81A93C8 -sub_81A93C8: @ 81A93C8 - push {r4,r5,lr} - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0xC7 - lsls r1, 4 - adds r3, r0, r1 - movs r2, 0 - ldr r4, =gScriptLastTalked - b _081A93F4 - .pool -_081A93E4: - adds r2, 0x1 - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 3 - adds r0, r3 - ldrb r0, [r0] - cmp r0, 0 - beq _081A940A -_081A93F4: - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 3 - adds r1, r0, r3 - ldrb r0, [r1] - ldrh r5, [r4] - cmp r0, r5 - bne _081A93E4 - ldr r0, =0x00007fff - strh r0, [r1, 0x4] - strh r0, [r1, 0x6] -_081A940A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A93C8 - - thumb_func_start sub_81A9414 -sub_81A9414: @ 81A9414 - ldr r1, =gUnknown_0203BC88 - ldr r0, =gBattleFrontierTrainers - str r0, [r1] - bx lr - .pool - thumb_func_end sub_81A9414 - - thumb_func_start sub_81A9424 -sub_81A9424: @ 81A9424 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x8 - movs r0, 0 - mov r9, r0 - movs r7, 0 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0xC7 - lsls r1, 4 - adds r1, r0 - mov r8, r1 - ldr r2, =gUnknown_02037350 - ldr r0, =gUnknown_03005DF0 - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x8] - bl sub_81A9AA8 - lsls r0, 16 - lsrs r5, r0, 16 - movs r6, 0 - ldr r2, =gUnknown_08613C1C - ldr r0, =gUnknown_0203BC88 - ldr r1, [r0] - movs r0, 0x34 - muls r0, r5 - adds r0, r1 - ldrb r1, [r2] - ldrb r0, [r0] - cmp r1, r0 - bne _081A9488 - ldrb r2, [r2, 0x1] - mov r9, r2 - b _081A94AE - .pool -_081A9488: - adds r6, 0x1 - cmp r6, 0x31 - bhi _081A94AE - ldr r4, =gUnknown_08613C1C - lsls r3, r6, 1 - adds r2, r3, r4 - ldr r0, =gUnknown_0203BC88 - ldr r1, [r0] - movs r0, 0x34 - muls r0, r5 - adds r0, r1 - ldrb r1, [r2] - ldrb r0, [r0] - cmp r1, r0 - bne _081A9488 - adds r0, r4, 0x1 - adds r0, r3, r0 - ldrb r0, [r0] - mov r9, r0 -_081A94AE: - ldr r3, =gUnknown_08613ED8 - ldr r2, =gUnknown_02037350 - ldr r0, =gUnknown_03005DF0 - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x8] - subs r0, 0x1 - adds r0, r3 - ldrb r0, [r0] - str r0, [sp] - movs r6, 0 - mov r3, r9 - lsls r3, 2 - mov r9, r3 -_081A94D0: - ldr r0, [sp] - cmp r0, 0x8 - bls _081A94D8 - b _081A95E8 -_081A94D8: - lsls r0, 2 - ldr r1, =_081A94FC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081A94FC: - .4byte _081A9520 - .4byte _081A9530 - .4byte _081A9572 - .4byte _081A95B4 - .4byte _081A95BA - .4byte _081A95C0 - .4byte _081A95C6 - .4byte _081A95D2 - .4byte _081A95DE -_081A9520: - mov r0, sp - movs r1, 0x8 - movs r2, 0 - bl sub_81A9998 - lsls r0, 24 - lsrs r7, r0, 24 - b _081A95EE -_081A9530: - movs r6, 0 - ldr r2, =0x7fff0000 - mov r4, r8 - adds r4, 0x4 - mov r5, r8 - b _081A9560 - .pool -_081A9540: - ldrb r0, [r5, 0x1] - cmp r0, 0x3B - bne _081A955A - movs r1, 0 - ldrsh r0, [r4, r1] - asrs r1, r2, 16 - cmp r0, r1 - beq _081A955A - movs r3, 0x2 - ldrsh r0, [r4, r3] - cmp r0, r1 - beq _081A955A - adds r7, 0x1 -_081A955A: - adds r4, 0x18 - adds r5, 0x18 - adds r6, 0x1 -_081A9560: - str r2, [sp, 0x4] - bl sub_81AAA40 - lsls r0, 24 - lsrs r0, 24 - ldr r2, [sp, 0x4] - cmp r6, r0 - blt _081A9540 - b _081A95EE -_081A9572: - bl sub_81AA9E4 - lsls r0, 24 - ldr r1, =gUnknown_08613650 - lsrs r0, 20 - adds r0, r1 - ldrb r7, [r0, 0x1] - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000e2a - adds r0, r1 - ldrb r2, [r0] - ldr r1, =gBitTable - movs r6, 0x7 -_081A958E: - ldr r0, [r1] - ands r0, r2 - cmp r0, 0 - beq _081A9598 - subs r7, 0x1 -_081A9598: - adds r1, 0x4 - subs r6, 0x1 - cmp r6, 0 - bge _081A958E - b _081A95EE - .pool -_081A95B4: - mov r0, sp - movs r1, 0x8 - b _081A95D6 -_081A95BA: - mov r0, sp - movs r1, 0x8 - b _081A95CA -_081A95C0: - mov r0, sp - movs r1, 0x10 - b _081A95D6 -_081A95C6: - mov r0, sp - movs r1, 0x10 -_081A95CA: - movs r2, 0x1 - bl sub_81A9998 - b _081A95E8 -_081A95D2: - mov r0, sp - movs r1, 0x18 -_081A95D6: - movs r2, 0x2 - bl sub_81A9998 - b _081A95E8 -_081A95DE: - mov r0, sp - movs r1, 0x18 - movs r2, 0x1 - bl sub_81A9998 -_081A95E8: - cmp r6, 0 - bne _081A95EE - b _081A94D0 -_081A95EE: - ldr r1, =gUnknown_08613EC0 - add r1, r9 - ldr r0, [sp] - ldr r1, [r1] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - lsls r0, r7, 2 - adds r0, r1 - ldr r0, [r0] - bl box_related_two__2 - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9424 - - thumb_func_start sub_81A9618 -sub_81A9618: @ 81A9618 - push {r4,r5,lr} - ldr r5, =gSaveBlock2Ptr - ldr r1, [r5] - ldr r2, =0x00000ca9 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r2, r0, 29 - ldr r4, =0x00000e1a - adds r1, r4 - adds r1, r2 - ldrh r3, [r1] - ldr r0, =0x000003e6 - cmp r3, r0 - bhi _081A963A - adds r0, r3, 0x1 - strh r0, [r1] -_081A963A: - ldr r0, [r5] - adds r1, r0, r4 - adds r1, r2 - ldr r3, =0x00000e1e - adds r0, r3 - adds r0, r2 - ldrh r1, [r1] - ldrh r2, [r0] - cmp r1, r2 - bls _081A9650 - strh r1, [r0] -_081A9650: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9618 - - thumb_func_start sub_81A966C -sub_81A966C: @ 81A966C - push {r4,lr} - ldr r4, =gScriptResult - bl InBattlePyramid - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A966C - - thumb_func_start sub_81A9684 -sub_81A9684: @ 81A9684 - push {r4,lr} - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - cmp r0, 0 - beq _081A9698 - cmp r0, 0x1 - beq _081A96B4 - b _081A9754 - .pool -_081A9698: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =gSpecialVar_0x8005 - ldrh r1, [r1] - ldr r2, =0x00000e68 - adds r0, r2 - strb r1, [r0] - b _081A9754 - .pool -_081A96B4: - ldr r4, =gScriptResult - ldrh r0, [r4] - cmp r0, 0x1 - beq _081A9710 - cmp r0, 0x1 - bgt _081A9754 - cmp r0, 0 - bne _081A9754 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081A9754 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000e68 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0x77 - bls _081A96F4 - movs r0, 0x78 - strb r0, [r1] - b _081A96FC - .pool -_081A96F4: - ldr r0, =gSpecialVar_0x8007 - ldrh r0, [r0] - bl PlaySE -_081A96FC: - ldr r1, =gScriptResult - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _081A9754 - .pool -_081A9710: - ldr r1, =gSpecialVar_0x8005 - ldrh r0, [r1] - cmp r0, 0 - beq _081A9750 - subs r0, 0x1 - strh r0, [r1] - ldr r3, =gSaveBlock2Ptr - ldr r1, [r3] - ldr r2, =0x00000e68 - adds r1, r2 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r3] - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0x78 - bls _081A973E - movs r0, 0x78 - strb r0, [r1] - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] -_081A973E: - bl door_upload_tiles - b _081A9754 - .pool -_081A9750: - movs r0, 0x2 - strh r0, [r4] -_081A9754: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81A9684 - - thumb_func_start sub_81A975C -sub_81A975C: @ 81A975C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - movs r1, 0 - mov r0, sp - strh r1, [r0] - movs r5, 0 - movs r0, 0x64 - mov r9, r0 - ldr r1, =gPlayerParty - mov r8, r1 -_081A9776: - movs r4, 0 - adds r7, r5, 0x1 - mov r6, r9 - muls r6, r5 -_081A977E: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - lsls r1, r4, 1 - ldr r2, =0x00000caa - adds r0, r2 - adds r1, r0, r1 - ldrh r0, [r1] - cmp r0, 0 - beq _081A97A2 - subs r0, 0x1 - cmp r0, r5 - bne _081A97A2 - mov r1, r8 - adds r0, r6, r1 - movs r1, 0xC - mov r2, sp - bl SetMonData -_081A97A2: - adds r4, 0x1 - cmp r4, 0x3 - ble _081A977E - adds r5, r7, 0 - cmp r5, 0x5 - ble _081A9776 - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A975C - - thumb_func_start sub_81A97C8 -sub_81A97C8: @ 81A97C8 - push {lr} - ldr r0, =sub_81A97DC - movs r1, 0 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A97C8 - - thumb_func_start sub_81A97DC -sub_81A97DC: @ 81A97DC - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081A980C - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 5 - ldr r1, =gUnknown_08D856C8 - adds r0, r1 - ldr r1, =gPlttBufferUnfaded + 0xC0 - movs r2, 0x10 - bl CpuSet - adds r0, r4, 0 - bl DestroyTask -_081A980C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A97DC - - thumb_func_start sub_81A9828 -sub_81A9828: @ 81A9828 - push {lr} - bl sub_809FDD4 - pop {r0} - bx r0 - thumb_func_end sub_81A9828 - - thumb_func_start sub_81A9834 -sub_81A9834: @ 81A9834 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - movs r0, 0 - str r0, [sp] -_081A9844: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, [sp] - lsls r1, r2, 1 - ldr r5, =0x00000caa - adds r0, r5 - adds r0, r1 - ldrh r0, [r0] - subs r5, r0, 0x1 - movs r0, 0 - str r0, [sp, 0x4] - movs r2, 0x64 - adds r1, r5, 0 - muls r1, r2 - str r1, [sp, 0x8] - movs r0, 0x8E - lsls r0, 2 - adds r6, r1, r0 - movs r1, 0 - str r1, [sp, 0x10] -_081A986C: - ldr r2, =gSaveBlock1Ptr - ldr r0, [r2] - adds r0, r6 - movs r1, 0xB - movs r2, 0 - bl GetMonData - adds r4, r0, 0 - ldr r3, =gPlayerParty - ldr r1, [sp, 0x10] - adds r0, r1, r3 - movs r1, 0xB - movs r2, 0 - str r3, [sp, 0x14] - bl GetMonData - ldr r3, [sp, 0x14] - cmp r4, r0 - bne _081A993C - movs r6, 0 - adds r2, r5, 0x1 - str r2, [sp, 0xC] - movs r1, 0x64 - adds r0, r5, 0 - muls r0, r1 - movs r5, 0x8E - lsls r5, 2 - adds r5, r0 - mov r9, r5 - ldr r7, [sp, 0x4] - muls r7, r1 - mov r10, r3 -_081A98AC: - movs r5, 0 - adds r0, r6, 0x1 - mov r8, r0 - b _081A98C6 - .pool -_081A98C4: - adds r5, 0x1 -_081A98C6: - cmp r5, 0x3 - bgt _081A98EE - ldr r1, =gSaveBlock1Ptr - ldr r0, [r1] - add r0, r9 - adds r1, r5, 0 - adds r1, 0xD - movs r2, 0 - bl GetMonData - adds r4, r0, 0 - adds r1, r6, 0 - adds r1, 0xD - mov r2, r10 - adds r0, r7, r2 - movs r2, 0 - bl GetMonData - cmp r4, r0 - bne _081A98C4 -_081A98EE: - cmp r5, 0x4 - bne _081A9900 - lsls r2, r6, 24 - lsrs r2, 24 - mov r5, r10 - adds r0, r7, r5 - movs r1, 0xA6 - bl sub_80691F4 -_081A9900: - mov r6, r8 - cmp r6, 0x3 - ble _081A98AC - ldr r1, =gSaveBlock1Ptr - ldr r0, [r1] - ldr r2, [sp, 0x8] - adds r0, r2 - movs r5, 0x8E - lsls r5, 2 - adds r0, r5 - ldr r1, =gPlayerParty - ldr r2, [sp, 0x10] - adds r1, r2, r1 - movs r2, 0x64 - bl memcpy - ldr r0, =gUnknown_0203CEF8 - ldr r5, [sp, 0x4] - adds r0, r5, r0 - mov r1, sp - ldrb r1, [r1, 0xC] - strb r1, [r0] - b _081A994C - .pool -_081A993C: - ldr r2, [sp, 0x10] - adds r2, 0x64 - str r2, [sp, 0x10] - ldr r0, [sp, 0x4] - adds r0, 0x1 - str r0, [sp, 0x4] - cmp r0, 0x2 - ble _081A986C -_081A994C: - ldr r1, [sp] - adds r1, 0x1 - str r1, [sp] - cmp r1, 0x2 - bgt _081A9958 - b _081A9844 -_081A9958: - movs r2, 0 - str r2, [sp] - ldr r4, =gSaveBlock2Ptr - ldr r3, =0x00000caa - ldr r2, =gUnknown_0203CEF8 -_081A9962: - ldr r1, [r4] - ldr r5, [sp] - lsls r0, r5, 1 - adds r1, r3 - adds r1, r0 - adds r0, r5, r2 - ldrb r0, [r0] - strh r0, [r1] - adds r5, 0x1 - str r5, [sp] - cmp r5, 0x2 - ble _081A9962 - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9834 - - thumb_func_start sub_81A9998 -sub_81A9998: @ 81A9998 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r10, r0 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 24 - lsrs r7, r2, 24 - movs r4, 0 - ldr r0, =gUnknown_03005DC0 - ldr r5, [r0, 0x8] - ldr r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 1 - adds r0, 0xE - adds r5, r0 - movs r3, 0 - ldr r0, =0x000003ff - mov r8, r0 - ldr r1, =0x0000028e - mov r12, r1 - ldr r0, =gUnknown_02037350 - mov r9, r0 -_081A99CC: - movs r2, 0 -_081A99CE: - lsls r0, r2, 1 - adds r0, r5 - ldrh r1, [r0] - mov r0, r8 - ands r0, r1 - cmp r0, r12 - bne _081A9A8A - adds r2, 0x7 - ldr r0, =gUnknown_03005DF0 - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - add r0, r9 - movs r5, 0xC - ldrsh r1, [r0, r5] - subs r2, r1 - adds r1, r3, 0x7 - movs r3, 0xE - ldrsh r0, [r0, r3] - subs r3, r1, r0 - cmp r2, r6 - bge _081A9A0E - negs r0, r6 - cmp r2, r0 - ble _081A9A0E - cmp r3, r6 - bge _081A9A0E - cmp r3, r0 - ble _081A9A0E - cmp r7, 0 - bne _081A9A84 -_081A9A0E: - cmp r2, 0 - ble _081A9A34 - cmp r3, 0 - ble _081A9A34 - movs r4, 0x3 - cmp r2, r3 - blt _081A9A7C - movs r4, 0x2 - b _081A9A7C - .pool -_081A9A34: - cmp r2, 0 - bge _081A9A46 - cmp r3, 0 - bge _081A9A46 - movs r4, 0x1 - cmp r2, r3 - ble _081A9A7C - movs r4, 0 - b _081A9A7C -_081A9A46: - cmp r2, 0 - bne _081A9A54 - movs r4, 0 - cmp r3, 0 - ble _081A9A7C - movs r4, 0x3 - b _081A9A7C -_081A9A54: - cmp r3, 0 - bne _081A9A62 - movs r4, 0x1 - cmp r2, 0 - ble _081A9A7C - movs r4, 0x2 - b _081A9A7C -_081A9A62: - cmp r2, 0 - bge _081A9A72 - adds r0, r2, r3 - movs r4, 0x1 - cmp r0, 0 - ble _081A9A7C - movs r4, 0x3 - b _081A9A7C -_081A9A72: - adds r0, r2, r3 - mvns r0, r0 - asrs r4, r0, 31 - movs r0, 0x2 - ands r4, r0 -_081A9A7C: - movs r0, 0 - mov r5, r10 - str r0, [r5] - b _081A9A98 -_081A9A84: - mov r0, r10 - str r7, [r0] - b _081A9A98 -_081A9A8A: - adds r2, 0x1 - cmp r2, 0x1F - ble _081A99CE - adds r5, 0x5E - adds r3, 0x1 - cmp r3, 0x1F - ble _081A99CC -_081A9A98: - adds r0, r4, 0 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81A9998 - - thumb_func_start sub_81A9AA8 -sub_81A9AA8: @ 81A9AA8 - lsls r0, 24 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - lsrs r0, 23 - adds r1, r0 - ldr r0, =0x00000cb2 - adds r1, r0 - ldrh r0, [r1] - bx lr - .pool - thumb_func_end sub_81A9AA8 - - thumb_func_start GetBattlePyramidTrainerFlag -GetBattlePyramidTrainerFlag: @ 81A9AC4 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gSaveBlock2Ptr - ldr r2, [r1] - ldr r1, =0x00000e2a - adds r2, r1 - ldr r4, =gBitTable - ldr r3, =gUnknown_02037350 - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r0, [r1, 0x8] - subs r0, 0x1 - lsls r0, 2 - adds r0, r4 - ldr r0, [r0] - ldrb r1, [r2] - ands r0, r1 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end GetBattlePyramidTrainerFlag - - thumb_func_start sub_81A9B04 -sub_81A9B04: @ 81A9B04 - push {lr} - ldr r0, =gUnknown_02038BCA - ldrh r0, [r0] - bl sub_81A9B44 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _081A9B2E - movs r0, 0x1 - bl sub_80B47E0 - ldr r1, =gUnknown_03005DF0 - strb r0, [r1] - ldr r0, =gUnknown_02038BCC - ldrh r0, [r0] - bl sub_81A9B44 -_081A9B2E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9B04 - - thumb_func_start sub_81A9B44 -sub_81A9B44: @ 81A9B44 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 16 - lsrs r5, r0, 16 - movs r3, 0 - ldr r0, =gUnknown_02037350 - mov r12, r0 - ldr r6, =gUnknown_03005DF0 - ldr r1, =gSaveBlock1Ptr - mov r10, r1 - ldr r7, =gSaveBlock2Ptr - mov r9, r7 - ldr r0, =0x00000cb4 - mov r8, r0 - ldr r4, =gBitTable -_081A9B68: - mov r1, r9 - ldr r2, [r1] - lsls r0, r3, 1 - mov r7, r8 - adds r1, r2, r7 - adds r1, r0 - ldrh r0, [r1] - cmp r0, r5 - bne _081A9B86 - ldr r1, =0x00000e2a - adds r0, r2, r1 - ldr r1, [r4] - ldrb r2, [r0] - orrs r1, r2 - strb r1, [r0] -_081A9B86: - adds r4, 0x4 - adds r3, 0x1 - cmp r3, 0x7 - ble _081A9B68 - ldrb r1, [r6] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - add r0, r12 - movs r3, 0x2 - strb r3, [r0, 0x6] - mov r7, r10 - ldr r2, [r7] - ldr r0, =gScriptLastTalked - ldrh r1, [r0] - subs r1, 0x1 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r2, r0 - ldr r1, =0x00000c79 - adds r2, r1 - strb r3, [r2] - ldrb r1, [r6] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - add r0, r12 - ldrh r1, [r0, 0x10] - strh r1, [r0, 0xC] - ldrb r1, [r6] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - add r0, r12 - ldrh r1, [r0, 0x12] - strh r1, [r0, 0xE] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9B44 - - thumb_func_start sub_81A9C04 -sub_81A9C04: @ 81A9C04 - push {r4-r6,lr} - sub sp, 0x14 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r2, =0x00000ca9 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r5, r0, 30 - lsls r0, r5, 1 - ldr r2, =0x00000e1a - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - movs r1, 0x7 - bl __udivsi3 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x14 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x13 - bls _081A9C3A - movs r0, 0x13 -_081A9C3A: - cmp r5, 0 - beq _081A9C54 - ldr r1, =gBattlePyramidOpenLevelWildMonPointers - b _081A9C56 - .pool -_081A9C54: - ldr r1, =gBattlePyramidLevel50WildMonPointers -_081A9C56: - lsls r0, 2 - adds r0, r1 - ldr r6, [r0] - ldr r4, =gEnemyParty - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl GetMonData - subs r0, 0x1 - str r0, [sp, 0x10] - lsls r2, r0, 1 - adds r2, r0 - lsls r2, 2 - adds r2, r6, r2 - adds r0, r4, 0 - movs r1, 0xB - bl SetMonData - ldr r1, [sp, 0x10] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrh r1, [r0] - mov r0, sp - bl GetSpeciesName - adds r0, r4, 0 - movs r1, 0x2 - mov r2, sp - bl SetMonData - cmp r5, 0 - beq _081A9CD4 - bl sub_8165C40 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, [sp, 0x10] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0, 0x2] - subs r5, r0 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xB - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - subs r0, 0x5 - adds r5, r0 - b _081A9CF6 - .pool -_081A9CD4: - bl Random - ldr r2, [sp, 0x10] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r6 - ldrb r4, [r1, 0x2] - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xB - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - subs r0, 0x5 - adds r5, r4, r0 -_081A9CF6: - ldr r4, =gEnemyParty - ldr r2, =gBaseStats - ldr r1, [sp, 0x10] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrh r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x13] - movs r0, 0xCA - lsls r0, 1 - adds r2, r1, 0 - muls r2, r0 - lsls r0, r5, 2 - ldr r1, =gExperienceTables - adds r0, r1 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x19 - bl SetMonData - ldr r1, [sp, 0x10] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r1, [r0, 0x3] - cmp r1, 0 - blt _081A9D4C - cmp r1, 0x1 - bgt _081A9D4C - adds r2, r0, 0x3 - b _081A9D7C - .pool -_081A9D4C: - ldr r2, =gBaseStats - ldr r1, [sp, 0x10] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrh r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x17] - cmp r0, 0 - beq _081A9D90 - ldr r4, =gEnemyParty - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - bl GetMonData - movs r1, 0x1 - ands r1, r0 - str r1, [sp, 0xC] - add r2, sp, 0xC -_081A9D7C: - adds r0, r4, 0 - movs r1, 0x2E - bl SetMonData - b _081A9D9C - .pool -_081A9D90: - str r0, [sp, 0xC] - ldr r0, =gEnemyParty - add r2, sp, 0xC - movs r1, 0x2E - bl SetMonData -_081A9D9C: - movs r0, 0 - str r0, [sp, 0xC] - movs r2, 0 - lsls r4, r5, 1 -_081A9DA4: - ldr r1, [sp, 0x10] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - lsls r1, r2, 1 - adds r0, 0x4 - adds r0, r1 - ldrh r1, [r0] - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gEnemyParty - bl sub_80691F4 - ldr r0, [sp, 0xC] - adds r0, 0x1 - str r0, [sp, 0xC] - adds r2, r0, 0 - cmp r2, 0x3 - ble _081A9DA4 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000e1a - adds r0, r1 - adds r0, r4 - ldrh r0, [r0] - cmp r0, 0x8B - bls _081A9E0C - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x11 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - adds r0, 0xF - str r0, [sp, 0x10] - movs r0, 0 - str r0, [sp, 0xC] -_081A9DF6: - adds r1, r0, 0 - adds r1, 0x27 - ldr r0, =gEnemyParty - add r2, sp, 0x10 - bl SetMonData - ldr r0, [sp, 0xC] - adds r0, 0x1 - str r0, [sp, 0xC] - cmp r0, 0x5 - ble _081A9DF6 -_081A9E0C: - ldr r0, =gEnemyParty - bl pokemon_calc_effective_stats - add sp, 0x14 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9C04 - - thumb_func_start sub_81A9E28 -sub_81A9E28: @ 81A9E28 - push {lr} - bl sub_81AA9E4 - lsls r0, 24 - ldr r1, =gUnknown_08613650 - lsrs r0, 20 - adds r0, r1 - ldrb r0, [r0, 0x4] - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A9E28 - - thumb_func_start InBattlePyramid -InBattlePyramid: @ 81A9E40 - push {lr} - ldr r0, =gUnknown_02037318 - ldrh r1, [r0, 0x12] - ldr r0, =0x00000169 - cmp r1, r0 - bne _081A9E58 - movs r0, 0x1 - b _081A9E66 - .pool -_081A9E58: - movs r0, 0xBD - lsls r0, 1 - cmp r1, r0 - beq _081A9E64 - movs r0, 0 - b _081A9E66 -_081A9E64: - movs r0, 0x2 -_081A9E66: - pop {r1} - bx r1 - thumb_func_end InBattlePyramid - - thumb_func_start sub_81A9E6C -sub_81A9E6C: @ 81A9E6C - push {lr} - movs r2, 0 - ldr r0, =gUnknown_02037318 - ldrh r1, [r0, 0x12] - ldr r0, =0x00000169 - cmp r1, r0 - beq _081A9E80 - adds r0, 0x11 - cmp r1, r0 - bne _081A9E82 -_081A9E80: - movs r2, 0x1 -_081A9E82: - adds r0, r2, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A9E6C - - thumb_func_start sub_81A9E90 -sub_81A9E90: @ 81A9E90 - push {lr} - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _081A9EB8 - bl sub_81A9834 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000ca8 - adds r0, r1 - movs r1, 0x2 - strb r1, [r0] - ldr r0, =0x0000400e - movs r1, 0 - bl VarSet - bl copy_player_party_from_sav1 -_081A9EB8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9E90 - - thumb_func_start sub_81A9EC8 -sub_81A9EC8: @ 81A9EC8 - push {lr} - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _081A9ED8 - bl DoSoftReset -_081A9ED8: - pop {r0} - bx r0 - thumb_func_end sub_81A9EC8 - - thumb_func_start sub_81A9EDC -sub_81A9EDC: @ 81A9EDC - push {lr} - lsls r0, 16 - lsrs r0, 16 - ldr r2, =gUnknown_0203BC88 - movs r1, 0x34 - muls r1, r0 - ldr r0, [r2] - adds r0, r1 - adds r0, 0xC - bl ConvertBattleFrontierTrainerSpeechToString - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9EDC - - thumb_func_start sub_81A9EFC -sub_81A9EFC: @ 81A9EFC - push {lr} - lsls r0, 16 - lsrs r0, 16 - ldr r2, =gUnknown_0203BC88 - movs r1, 0x34 - muls r1, r0 - ldr r0, [r2] - adds r0, r1 - adds r0, 0x18 - bl ConvertBattleFrontierTrainerSpeechToString - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9EFC - - thumb_func_start sub_81A9F1C -sub_81A9F1C: @ 81A9F1C - push {lr} - lsls r0, 16 - lsrs r0, 16 - ldr r2, =gUnknown_0203BC88 - movs r1, 0x34 - muls r1, r0 - ldr r0, [r2] - adds r0, r1 - adds r0, 0x24 - bl ConvertBattleFrontierTrainerSpeechToString - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9F1C - - thumb_func_start sub_81A9F3C -sub_81A9F3C: @ 81A9F3C - push {r4,lr} - lsls r0, 16 - lsrs r0, 16 - movs r4, 0 - ldr r3, =gTrainerClassNameIndices - ldr r1, =gUnknown_0203BC88 - ldr r2, [r1] - movs r1, 0x34 - muls r0, r1 - adds r0, r2 - ldrb r0, [r0] - adds r0, r3 - ldrb r2, [r0] - ldr r1, =gUnknown_08613B44 -_081A9F58: - ldrb r0, [r1] - cmp r0, r2 - bne _081A9F70 - ldrb r0, [r1, 0x1] - b _081A9F7A - .pool -_081A9F70: - adds r1, 0x4 - adds r4, 0x1 - cmp r4, 0x35 - bls _081A9F58 - movs r0, 0 -_081A9F7A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81A9F3C - - thumb_func_start sub_81A9F80 -sub_81A9F80: @ 81A9F80 - push {lr} - ldr r0, =gUnknown_08252C88 - bl script_env_1_execute_new_script - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A9F80 - - thumb_func_start sub_81A9F90 -sub_81A9F90: @ 81A9F90 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gSaveBlock2Ptr - ldr r4, [r0] - ldr r1, =0x00000ca9 - adds r0, r4, r1 - ldrb r1, [r0] - lsls r1, 30 - lsrs r1, 29 - ldr r2, =0x00000e1a - adds r0, r4, r2 - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x7 - bl __udivsi3 - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x00000cb2 - adds r4, r1 - ldrh r1, [r4] - cmp r1, 0x7 - bne _081AA020 - adds r0, 0x1 - lsls r7, r0, 24 - lsls r1, 24 - mov r8, r1 -_081A9FCC: - lsrs r0, r7, 24 - mov r2, r8 - lsrs r1, r2, 24 - bl sub_8162548 - lsls r0, 16 - lsrs r3, r0, 16 - movs r2, 0 - cmp r2, r5 - bge _081AA004 - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r4, =0x00000cb4 - adds r0, r4 - ldrh r0, [r0] - cmp r0, r3 - beq _081AA004 - adds r6, r1, 0 -_081A9FF0: - adds r2, 0x1 - cmp r2, r5 - bge _081AA004 - ldr r0, [r6] - lsls r1, r2, 1 - adds r0, r4 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r3 - bne _081A9FF0 -_081AA004: - cmp r2, r5 - bne _081A9FCC - b _081AA062 - .pool -_081AA020: - lsls r1, 24 - mov r8, r1 - lsls r7, r0, 24 -_081AA026: - lsrs r0, r7, 24 - mov r2, r8 - lsrs r1, r2, 24 - bl sub_8162548 - lsls r0, 16 - lsrs r3, r0, 16 - movs r2, 0 - cmp r2, r5 - bge _081AA05E - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r4, =0x00000cb4 - adds r0, r4 - ldrh r0, [r0] - cmp r0, r3 - beq _081AA05E - adds r6, r1, 0 -_081AA04A: - adds r2, 0x1 - cmp r2, r5 - bge _081AA05E - ldr r0, [r6] - lsls r1, r2, 1 - adds r0, r4 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r3 - bne _081AA04A -_081AA05E: - cmp r2, r5 - bne _081AA026 -_081AA062: - adds r0, r3, 0 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81A9F90 - - thumb_func_start sub_81AA078 -sub_81AA078: @ 81AA078 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - str r0, [sp, 0x4] - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x8] - movs r0, 0x10 - bl AllocZeroed - str r0, [sp, 0xC] - bl sub_81AA96C - mov r4, sp - adds r4, 0x1 - mov r0, sp - adds r1, r4, 0 - bl sub_81AA33C - movs r7, 0 -_081AA0A6: - ldr r1, [sp, 0xC] - adds r0, r1, r7 - ldrb r0, [r0] - ldr r2, =0x00000169 - adds r0, r2 - lsls r0, 2 - ldr r1, =gUnknown_08481DD4 - adds r0, r1 - ldr r6, [r0] - ldr r2, [r6, 0xC] - mov r10, r2 - ldr r0, [sp, 0x4] - ldr r1, =gUnknown_03005DC0 - str r0, [r1, 0x8] - ldr r0, [r6] - lsls r0, 2 - adds r2, r0, 0 - adds r2, 0xF - str r2, [r1] - ldr r0, [r6, 0x4] - lsls r0, 2 - adds r0, 0xE - str r0, [r1, 0x4] - ldr r0, [sp, 0x4] - mov r9, r0 - adds r1, r7, 0 - cmp r7, 0 - bge _081AA0E0 - adds r1, r7, 0x3 -_081AA0E0: - asrs r1, 2 - ldr r4, [r6, 0x4] - adds r0, r1, 0 - muls r0, r4 - adds r0, 0x7 - muls r2, r0 - lsls r1, 2 - subs r1, r7, r1 - ldr r3, [r6] - adds r0, r1, 0 - muls r0, r3 - adds r0, 0x7 - adds r2, r0 - lsls r2, 1 - add r9, r2 - movs r1, 0 - mov r8, r1 - adds r2, r7, 0x1 - str r2, [sp, 0x10] - cmp r8, r4 - bge _081AA1B6 -_081AA10A: - movs r0, 0 - mov r12, r0 - mov r1, r8 - adds r1, 0x1 - str r1, [sp, 0x14] - cmp r12, r3 - bge _081AA1A2 - ldr r2, =gSaveBlock1Ptr - str r2, [sp, 0x18] - mov r4, r9 - mov r5, r10 -_081AA120: - ldrh r1, [r5] - ldr r0, =0x000003ff - ands r0, r1 - ldr r2, =0x0000028e - cmp r0, r2 - bne _081AA194 - mov r0, sp - ldrb r0, [r0, 0x1] - cmp r7, r0 - beq _081AA194 - mov r0, sp - ldrb r0, [r0] - cmp r7, r0 - bne _081AA164 - ldr r1, [sp, 0x8] - cmp r1, 0 - bne _081AA164 - ldr r2, [sp, 0x18] - ldr r3, [r2] - adds r2, r7, 0 - cmp r7, 0 - bge _081AA14E - adds r2, r7, 0x3 -_081AA14E: - asrs r2, 2 - lsls r1, r2, 2 - subs r1, r7, r1 - ldr r0, [r6] - muls r0, r1 - add r0, r12 - strh r0, [r3] - ldr r0, [r6, 0x4] - muls r0, r2 - add r0, r8 - strh r0, [r3, 0x2] -_081AA164: - ldrh r0, [r5] - movs r1, 0xFC - lsls r1, 8 - ands r1, r0 - ldr r2, =0x0000028d - adds r0, r2, 0 - orrs r1, r0 - strh r1, [r4] - ldr r3, [r6] - b _081AA196 - .pool -_081AA194: - strh r1, [r4] -_081AA196: - adds r4, 0x2 - adds r5, 0x2 - movs r0, 0x1 - add r12, r0 - cmp r12, r3 - blt _081AA120 -_081AA1A2: - lsls r0, r3, 3 - adds r0, 0x1E - add r9, r0 - lsls r0, r3, 1 - add r10, r0 - ldr r1, [sp, 0x14] - mov r8, r1 - ldr r0, [r6, 0x4] - cmp r8, r0 - blt _081AA10A -_081AA1B6: - ldr r7, [sp, 0x10] - cmp r7, 0xF - bgt _081AA1BE - b _081AA0A6 -_081AA1BE: - bl mapheader_run_script_with_tag_x1 - ldr r0, [sp, 0xC] - bl Free - add sp, 0x1C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81AA078 - - thumb_func_start sub_81AA1D8 -sub_81AA1D8: @ 81AA1D8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - movs r5, 0 - mov r6, sp - adds r6, 0x1 - add r0, sp, 0x4 - mov r8, r0 - ldr r4, =gSaveBlock2Ptr - ldr r3, =0x00000cb4 - ldr r0, =0x0000ffff - adds r2, r0, 0 -_081AA1F2: - ldr r0, [r4] - lsls r1, r5, 1 - adds r0, r3 - adds r0, r1 - ldrh r1, [r0] - orrs r1, r2 - strh r1, [r0] - adds r5, 0x1 - cmp r5, 0x7 - ble _081AA1F2 - bl sub_81AA9E4 - lsls r0, 24 - lsrs r7, r0, 24 - mov r0, sp - adds r1, r6, 0 - bl sub_81AA33C - movs r0, 0 - str r0, [sp, 0x4] - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - movs r0, 0xC7 - lsls r0, 4 - adds r1, r0 - ldr r2, =0x05000180 - mov r0, r8 - bl CpuSet - movs r5, 0 -_081AA22E: - cmp r5, 0 - bne _081AA254 - ldr r1, =gUnknown_08613650 - lsls r0, r7, 4 - adds r0, r1 - ldrb r0, [r0, 0x3] - b _081AA25C - .pool -_081AA254: - ldr r1, =gUnknown_08613650 - lsls r0, r7, 4 - adds r0, r1 - ldrb r0, [r0, 0x2] -_081AA25C: - cmp r0, 0x4 - bhi _081AA2E4 - lsls r0, 2 - ldr r1, =_081AA274 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081AA274: - .4byte _081AA288 - .4byte _081AA292 - .4byte _081AA2A2 - .4byte _081AA2B0 - .4byte _081AA2CC -_081AA288: - lsls r0, r5, 24 - lsrs r0, 24 - bl sub_81AA398 - b _081AA2E4 -_081AA292: - lsls r0, r5, 24 - lsrs r4, r0, 24 - mov r0, sp - ldrb r1, [r0] - adds r0, r4, 0 - bl sub_81AA4D8 - b _081AA2BE -_081AA2A2: - lsls r0, r5, 24 - lsrs r4, r0, 24 - ldrb r1, [r6] - adds r0, r4, 0 - bl sub_81AA4D8 - b _081AA2BE -_081AA2B0: - lsls r0, r5, 24 - lsrs r4, r0, 24 - mov r0, sp - ldrb r1, [r0] - adds r0, r4, 0 - bl sub_81AA648 -_081AA2BE: - lsls r0, 24 - cmp r0, 0 - beq _081AA2E4 - adds r0, r4, 0 - bl sub_81AA398 - b _081AA2E4 -_081AA2CC: - lsls r0, r5, 24 - lsrs r4, r0, 24 - ldrb r1, [r6] - adds r0, r4, 0 - bl sub_81AA648 - lsls r0, 24 - cmp r0, 0 - beq _081AA2E4 - adds r0, r4, 0 - bl sub_81AA398 -_081AA2E4: - adds r5, 0x1 - cmp r5, 0x1 - ble _081AA22E - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81AA1D8 - - thumb_func_start sub_81AA2F8 -sub_81AA2F8: @ 81AA2F8 - push {r4,r5,lr} - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r5, =gUnknown_08252C4F - ldr r4, =gUnknown_08252C6A - movs r2, 0xC8 - lsls r2, 4 - adds r1, r0, r2 - movs r3, 0xC7 - lsls r3, 4 - adds r2, r0, r3 - movs r3, 0x3F -_081AA310: - ldrb r0, [r2, 0x1] - cmp r0, 0x3B - beq _081AA328 - str r5, [r1] - b _081AA32A - .pool -_081AA328: - str r4, [r1] -_081AA32A: - adds r1, 0x18 - adds r2, 0x18 - subs r3, 0x1 - cmp r3, 0 - bge _081AA310 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81AA2F8 - - thumb_func_start sub_81AA33C -sub_81AA33C: @ 81AA33C - push {r4-r7,lr} - adds r4, r0, 0 - adds r6, r1, 0 - ldr r5, =gSaveBlock2Ptr - ldr r1, [r5] - ldr r2, =0x00000e28 - adds r0, r1, r2 - ldrh r2, [r0] - movs r3, 0xF - ands r2, r3 - strb r2, [r4] - ldr r7, =0x00000e22 - adds r1, r7 - ldrh r0, [r1] - ands r0, r3 - strb r0, [r6] - cmp r2, r0 - bne _081AA386 - ldr r1, [r5] - ldr r2, =0x00000e28 - adds r0, r1, r2 - ldrh r2, [r0] - adds r3, r2, 0x1 - adds r0, r3, 0 - asrs r0, 4 - lsls r0, 4 - subs r0, r3, r0 - strb r0, [r4] - adds r0, r1, r7 - ldrh r1, [r0] - adds r2, r1, 0 - adds r2, 0xF - adds r0, r2, 0 - asrs r0, 4 - lsls r0, 4 - subs r0, r2, r0 - strb r0, [r6] -_081AA386: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AA33C - - thumb_func_start sub_81AA398 -sub_81AA398: @ 81AA398 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - movs r5, 0 - bl sub_81AA9E4 - lsls r0, 24 - lsrs r6, r0, 24 - movs r0, 0x10 - bl AllocZeroed - str r0, [sp, 0x8] - bl sub_81AA96C - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000e26 - adds r0, r1 - ldrh r4, [r0] - movs r0, 0xF - ands r4, r0 - ldr r0, [sp] - cmp r0, 0 - bne _081AA3F0 - ldr r1, =gUnknown_08613650 - lsls r0, r6, 4 - adds r0, r1 - ldrb r0, [r0, 0x1] - mov r10, r0 - movs r1, 0 - str r1, [sp, 0x4] - b _081AA3FE - .pool -_081AA3F0: - ldr r1, =gUnknown_08613650 - lsls r0, r6, 4 - adds r0, r1 - ldrb r1, [r0] - mov r10, r1 - ldrb r0, [r0, 0x1] - str r0, [sp, 0x4] -_081AA3FE: - movs r0, 0 - mov r8, r0 - cmp r8, r10 - bge _081AA4C0 -_081AA406: - movs r1, 0x1 - add r1, r8 - mov r9, r1 - b _081AA42E - .pool -_081AA414: - lsls r2, r4, 24 - lsrs r2, 24 - ldr r3, [sp, 0x4] - add r3, r8 - lsls r3, 24 - lsrs r3, 24 - ldr r0, [sp] - ldr r1, [sp, 0x8] - bl sub_81AA760 - lsls r0, 24 - cmp r0, 0 - beq _081AA4B6 -_081AA42E: - ldr r0, =gBitTable - mov r12, r0 - ldr r6, =gSaveBlock2Ptr - ldr r7, =0x00000e28 - movs r3, 0x2 - lsls r0, r4, 2 - mov r1, r12 - adds r2, r0, r1 -_081AA43E: - movs r0, 0x1 - ands r0, r5 - cmp r0, 0 - beq _081AA464 - ldr r0, [r6] - adds r0, r7 - ldrh r1, [r0] - ldr r0, [r2] - ands r0, r1 - cmp r0, 0 - bne _081AA474 - b _081AA472 - .pool -_081AA464: - ldr r0, [r6] - adds r0, r7 - ldrh r1, [r0] - ldr r0, [r2] - ands r0, r1 - cmp r0, 0 - beq _081AA474 -_081AA472: - orrs r5, r3 -_081AA474: - adds r2, 0x4 - adds r4, 0x1 - cmp r4, 0xF - ble _081AA480 - mov r2, r12 - movs r4, 0 -_081AA480: - ldr r0, [r6] - ldr r1, =0x00000e26 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0xF - ands r1, r0 - cmp r4, r1 - bne _081AA4A6 - movs r1, 0x1 - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _081AA4A4 - movs r0, 0x6 - orrs r5, r0 - b _081AA4A6 - .pool -_081AA4A4: - orrs r5, r1 -_081AA4A6: - adds r0, r5, 0 - ands r0, r3 - cmp r0, 0 - beq _081AA43E - movs r0, 0x4 - ands r0, r5 - cmp r0, 0 - beq _081AA414 -_081AA4B6: - movs r0, 0x1 - ands r5, r0 - mov r8, r9 - cmp r8, r10 - blt _081AA406 -_081AA4C0: - ldr r0, [sp, 0x8] - bl Free - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81AA398 - - thumb_func_start sub_81AA4D8 -sub_81AA4D8: @ 81AA4D8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x4] - movs r6, 0 - movs r7, 0 - movs r0, 0 - str r0, [sp, 0xC] - bl sub_81AA9E4 - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x10 - bl AllocZeroed - str r0, [sp, 0x14] - bl sub_81AA96C - ldr r1, [sp] - cmp r1, 0 - bne _081AA524 - ldr r1, =gUnknown_08613650 - lsls r0, r4, 4 - adds r0, r1 - ldrb r0, [r0, 0x1] - str r0, [sp, 0x10] - movs r0, 0 - b _081AA530 - .pool -_081AA524: - ldr r1, =gUnknown_08613650 - lsls r0, r4, 4 - adds r0, r1 - ldrb r2, [r0] - str r2, [sp, 0x10] - ldrb r0, [r0, 0x1] -_081AA530: - movs r3, 0 - str r3, [sp, 0x8] - ldr r1, [sp, 0x10] - asrs r1, 31 - str r1, [sp, 0x18] - ldr r2, [sp, 0x10] - cmp r3, r2 - bge _081AA622 - str r0, [sp, 0x1C] - adds r3, r0, 0 - lsls r3, 24 - mov r9, r3 -_081AA548: - cmp r7, 0 - bne _081AA56E - mov r0, r9 - lsrs r3, r0, 24 - ldr r0, [sp] - ldr r1, [sp, 0x14] - ldr r2, [sp, 0x4] - bl sub_81AA760 - lsls r0, 24 - cmp r0, 0 - beq _081AA568 - movs r7, 0x1 - b _081AA56E - .pool -_081AA568: - ldr r1, [sp, 0xC] - adds r1, 0x1 - str r1, [sp, 0xC] -_081AA56E: - movs r0, 0x1 - ands r0, r7 - cmp r0, 0 - beq _081AA600 - ldr r2, =gUnknown_08613F46 - mov r8, r2 - ldr r3, [sp, 0x4] - lsls r4, r3, 2 - adds r0, r6, r4 - add r0, r8 - ldrb r2, [r0] - mov r0, r9 - lsrs r3, r0, 24 - ldr r0, [sp] - ldr r1, [sp, 0x14] - bl sub_81AA760 - lsls r0, 24 - ldr r1, [sp, 0x1C] - mov r10, r1 - adds r5, r4, 0 - cmp r0, 0 - beq _081AA5E8 - ldr r4, [sp, 0xC] - adds r4, 0x1 - b _081AA5C2 - .pool -_081AA5A8: - adds r0, r6, r5 - adds r0, r2 - ldrb r2, [r0] - mov r0, r10 - lsls r3, r0, 24 - lsrs r3, 24 - ldr r0, [sp] - ldr r1, [sp, 0x14] - bl sub_81AA760 - lsls r0, 24 - cmp r0, 0 - beq _081AA5E0 -_081AA5C2: - adds r6, 0x1 - ldr r0, =gUnknown_08613F46 - adds r1, r6, r5 - adds r1, r0 - ldrb r1, [r1] - adds r2, r0, 0 - cmp r1, 0xFF - beq _081AA5D6 - cmp r6, 0x3 - ble _081AA5D8 -_081AA5D6: - movs r6, 0 -_081AA5D8: - adds r7, 0x2 - asrs r0, r7, 1 - cmp r0, 0x4 - bne _081AA5A8 -_081AA5E0: - str r4, [sp, 0xC] - b _081AA600 - .pool -_081AA5E8: - adds r6, 0x1 - adds r0, r6, r4 - add r0, r8 - ldrb r0, [r0] - cmp r0, 0xFF - beq _081AA5F8 - cmp r6, 0x3 - ble _081AA5FA -_081AA5F8: - movs r6, 0 -_081AA5FA: - ldr r1, [sp, 0xC] - adds r1, 0x1 - str r1, [sp, 0xC] -_081AA600: - asrs r0, r7, 1 - cmp r0, 0x4 - beq _081AA622 - movs r0, 0x1 - ands r7, r0 - ldr r2, [sp, 0x1C] - adds r2, 0x1 - str r2, [sp, 0x1C] - movs r3, 0x80 - lsls r3, 17 - add r9, r3 - ldr r0, [sp, 0x8] - adds r0, 0x1 - str r0, [sp, 0x8] - ldr r1, [sp, 0x10] - cmp r0, r1 - blt _081AA548 -_081AA622: - movs r1, 0 - ldr r2, [sp, 0x10] - ldr r3, [sp, 0x18] - subs r0, r2, r3 - asrs r0, 1 - ldr r2, [sp, 0xC] - cmp r0, r2 - ble _081AA634 - movs r1, 0x1 -_081AA634: - adds r0, r1, 0 - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81AA4D8 - - thumb_func_start sub_81AA648 -sub_81AA648: @ 81AA648 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - lsls r1, 24 - lsrs r6, r1, 24 - movs r4, 0 - movs r7, 0 - movs r0, 0 - mov r8, r0 - bl sub_81AA9E4 - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0x10 - bl AllocZeroed - str r0, [sp, 0x8] - bl sub_81AA96C - ldr r1, [sp] - cmp r1, 0 - bne _081AA694 - ldr r1, =gUnknown_08613650 - lsls r0, r5, 4 - adds r0, r1 - ldrb r0, [r0, 0x1] - mov r10, r0 - movs r0, 0 - b _081AA6A0 - .pool -_081AA694: - ldr r1, =gUnknown_08613650 - lsls r0, r5, 4 - adds r0, r1 - ldrb r2, [r0] - mov r10, r2 - ldrb r0, [r0, 0x1] -_081AA6A0: - movs r3, 0 - str r3, [sp, 0x4] - mov r1, r10 - asrs r1, 31 - str r1, [sp, 0xC] - cmp r3, r10 - bge _081AA73E - ldr r2, =gUnknown_08613F46 - mov r9, r2 - lsls r5, r6, 2 - lsls r6, r0, 24 -_081AA6B6: - adds r0, r4, r5 - add r0, r9 - ldrb r2, [r0] - lsrs r3, r6, 24 - ldr r0, [sp] - ldr r1, [sp, 0x8] - bl sub_81AA760 - lsls r0, 24 - cmp r0, 0 - beq _081AA714 - adds r7, 0x1 - b _081AA6EE - .pool -_081AA6D8: - adds r0, r4, r5 - adds r0, r1 - ldrb r2, [r0] - lsrs r3, r6, 24 - ldr r0, [sp] - ldr r1, [sp, 0x8] - bl sub_81AA760 - lsls r0, 24 - cmp r0, 0 - beq _081AA728 -_081AA6EE: - adds r4, 0x1 - adds r0, r4, r5 - add r0, r9 - ldrb r0, [r0] - ldr r1, =gUnknown_08613F46 - cmp r0, 0xFF - beq _081AA700 - cmp r4, 0x3 - ble _081AA702 -_081AA700: - movs r4, 0 -_081AA702: - movs r3, 0x1 - add r8, r3 - mov r0, r8 - cmp r0, 0x4 - bne _081AA6D8 - b _081AA728 - .pool -_081AA714: - adds r4, 0x1 - adds r0, r4, r5 - add r0, r9 - ldrb r0, [r0] - cmp r0, 0xFF - beq _081AA724 - cmp r4, 0x3 - ble _081AA726 -_081AA724: - movs r4, 0 -_081AA726: - adds r7, 0x1 -_081AA728: - mov r1, r8 - cmp r1, 0x4 - beq _081AA73E - movs r2, 0x80 - lsls r2, 17 - adds r6, r2 - ldr r3, [sp, 0x4] - adds r3, 0x1 - str r3, [sp, 0x4] - cmp r3, r10 - blt _081AA6B6 -_081AA73E: - movs r1, 0 - mov r2, r10 - ldr r3, [sp, 0xC] - subs r0, r2, r3 - asrs r0, 1 - cmp r0, r7 - ble _081AA74E - movs r1, 0x1 -_081AA74E: - adds r0, r1, 0 - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81AA648 - - thumb_func_start sub_81AA760 -sub_81AA760: @ 81AA760 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - mov r10, r1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - lsls r3, 24 - lsrs r7, r3, 24 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000e22 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081AA7D0 - movs r6, 0x7 -_081AA792: - movs r4, 0x7 - lsls r5, r6, 24 -_081AA796: - lsls r1, r4, 24 - lsrs r1, 24 - mov r0, r8 - str r0, [sp] - str r7, [sp, 0x4] - mov r0, r9 - lsrs r2, r5, 24 - mov r3, r10 - bl sub_81AA810 - lsls r0, 24 - cmp r0, 0 - beq _081AA7CC - subs r4, 0x1 - cmp r4, 0 - bge _081AA796 - subs r6, 0x1 - movs r1, 0x1 - negs r1, r1 - cmp r6, r1 - bgt _081AA792 - b _081AA7FC - .pool -_081AA7CC: - movs r0, 0 - b _081AA7FE -_081AA7D0: - movs r6, 0 -_081AA7D2: - movs r4, 0 - lsls r5, r6, 24 -_081AA7D6: - lsls r1, r4, 24 - lsrs r1, 24 - mov r0, r8 - str r0, [sp] - str r7, [sp, 0x4] - mov r0, r9 - lsrs r2, r5, 24 - mov r3, r10 - bl sub_81AA810 - lsls r0, 24 - cmp r0, 0 - beq _081AA7CC - adds r4, 0x1 - cmp r4, 0x7 - ble _081AA7D6 - adds r6, 0x1 - cmp r6, 0x7 - ble _081AA7D2 -_081AA7FC: - movs r0, 0x1 -_081AA7FE: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81AA760 - - thumb_func_start sub_81AA810 -sub_81AA810: @ 81AA810 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - ldr r4, [sp, 0x34] - ldr r5, [sp, 0x38] - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x4] - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - lsls r4, 24 - lsrs r4, 24 - mov r10, r4 - lsls r5, 24 - lsrs r6, r5, 24 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0xC7 - lsls r1, 4 - adds r1, r0, r1 - str r1, [sp, 0x8] - add r3, r10 - ldrb r1, [r3] - adds r1, 0x2C - movs r0, 0x19 - bl get_mapheader_by_bank_and_number - adds r5, r0, 0 - movs r7, 0 - ldr r1, [r5, 0x4] - ldrb r2, [r1] - cmp r7, r2 - bge _081AA95A - movs r0, 0x3 - ands r0, r4 - lsls r0, 3 - str r0, [sp, 0xC] -_081AA868: - ldr r1, [r1, 0x4] - lsls r2, r7, 1 - adds r0, r2, r7 - lsls r0, 3 - adds r3, r0, r1 - movs r4, 0x4 - ldrsh r0, [r3, r4] - ldr r1, [r5, 0x4] - mov r12, r1 - mov r9, r2 - ldr r2, [sp, 0x4] - cmp r0, r2 - bne _081AA950 - movs r4, 0x6 - ldrsh r0, [r3, r4] - cmp r0, r8 - bne _081AA950 - ldr r0, [sp] - cmp r0, 0 - bne _081AA896 - ldrb r0, [r3, 0x1] - cmp r0, 0x3B - bne _081AA8A2 -_081AA896: - ldr r1, [sp] - cmp r1, 0x1 - bne _081AA950 - ldrb r0, [r3, 0x1] - cmp r0, 0x3B - bne _081AA950 -_081AA8A2: - movs r3, 0 - ldr r2, [r5, 0x4] - mov r12, r2 - cmp r3, r6 - bge _081AA8DC - ldr r4, [sp, 0x4] - ldr r0, [sp, 0xC] - adds r4, r0 - str r4, [sp, 0x10] - mov r1, r10 - lsrs r0, r1, 2 - lsls r0, 3 - mov r2, r8 - adds r1, r2, r0 - ldr r2, [sp, 0x8] - adds r2, 0x4 -_081AA8C2: - movs r4, 0 - ldrsh r0, [r2, r4] - ldr r4, [sp, 0x10] - cmp r0, r4 - bne _081AA8D4 - movs r4, 0x2 - ldrsh r0, [r2, r4] - cmp r0, r1 - beq _081AA8DC -_081AA8D4: - adds r2, 0x18 - adds r3, 0x1 - cmp r3, r6 - blt _081AA8C2 -_081AA8DC: - cmp r3, r6 - bne _081AA950 - lsls r0, r6, 1 - mov r8, r0 - adds r0, r6 - lsls r0, 3 - ldr r1, [sp, 0x8] - adds r5, r0, r1 - mov r3, r12 - ldr r2, [r3, 0x4] - mov r4, r9 - adds r1, r4, r7 - lsls r1, 3 - adds r0, r5, 0 - adds r1, r2 - ldm r1!, {r2-r4} - stm r0!, {r2-r4} - ldm r1!, {r2-r4} - stm r0!, {r2-r4} - ldrh r0, [r5, 0x4] - ldr r1, [sp, 0xC] - adds r0, r1 - strh r0, [r5, 0x4] - mov r2, r10 - lsrs r0, r2, 2 - lsls r0, 3 - ldrh r3, [r5, 0x6] - adds r0, r3 - strh r0, [r5, 0x6] - adds r0, r6, 0x1 - strb r0, [r5] - ldrb r0, [r5, 0x1] - cmp r0, 0x3B - beq _081AA940 - adds r0, r6, 0 - bl sub_81A9F90 - lsls r0, 16 - lsrs r7, r0, 16 - adds r4, r7, 0 - adds r0, r4, 0 - bl sub_81627A4 - strb r0, [r5, 0x1] - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =0x00000cb4 - adds r0, r1 - add r0, r8 - strh r4, [r0] -_081AA940: - movs r0, 0 - b _081AA95C - .pool -_081AA950: - adds r7, 0x1 - mov r1, r12 - ldrb r2, [r1] - cmp r7, r2 - blt _081AA868 -_081AA95A: - movs r0, 0x1 -_081AA95C: - add sp, 0x14 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81AA810 - - thumb_func_start sub_81AA96C -sub_81AA96C: @ 81AA96C - push {r4-r7,lr} - adds r6, r0, 0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000e22 - adds r1, r0, r2 - ldrh r4, [r1] - ldr r1, =0x00000e24 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 16 - orrs r4, r0 - bl sub_81AA9E4 - lsls r0, 24 - lsrs r5, r0, 24 - movs r3, 0 - ldr r2, =gUnknown_08613655 - mov r12, r2 - movs r7, 0x7 -_081AA994: - adds r2, r6, r3 - adds r0, r4, 0 - ands r0, r7 - lsls r1, r5, 4 - adds r0, r1 - add r0, r12 - ldrb r0, [r0] - strb r0, [r2] - asrs r4, 3 - cmp r3, 0x7 - bne _081AA9C0 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r2, =0x00000e26 - adds r0, r1, r2 - ldrh r4, [r0] - ldr r0, =0x00000e28 - adds r1, r0 - ldrh r0, [r1] - lsls r0, 16 - orrs r4, r0 - asrs r4, 8 -_081AA9C0: - adds r3, 0x1 - cmp r3, 0xF - ble _081AA994 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AA96C - - thumb_func_start sub_81AA9E4 -sub_81AA9E4: @ 81AA9E4 - push {r4,lr} - ldr r0, =gSaveBlock2Ptr - ldr r4, [r0] - ldr r1, =0x00000e28 - adds r0, r4, r1 - ldrh r0, [r0] - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r3, r0, 16 - ldr r0, =0x00000cb2 - adds r4, r0 - ldrh r0, [r4] - ldr r1, =gUnknown_08613794 - adds r0, r1 - ldrb r2, [r0] - cmp r2, 0x21 - bhi _081AAA38 - ldr r1, =gUnknown_08613750 - lsls r0, r2, 1 - adds r0, r1 -_081AAA10: - ldrb r1, [r0] - cmp r3, r1 - bge _081AAA30 - ldrb r0, [r0, 0x1] - b _081AAA3A - .pool -_081AAA30: - adds r0, 0x2 - adds r2, 0x1 - cmp r2, 0x21 - bls _081AAA10 -_081AAA38: - movs r0, 0 -_081AAA3A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81AA9E4 - - thumb_func_start sub_81AAA40 -sub_81AAA40: @ 81AAA40 - push {lr} - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0xC7 - lsls r1, 4 - adds r2, r0, r1 - movs r1, 0 - movs r3, 0xC7 - lsls r3, 4 - adds r0, r3 - b _081AAA6E - .pool -_081AAA5C: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xF - bhi _081AAA74 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r2 -_081AAA6E: - ldrb r0, [r0] - cmp r0, 0 - bne _081AAA5C -_081AAA74: - adds r0, r1, 0 - pop {r1} - bx r1 - thumb_func_end sub_81AAA40 - - thumb_func_start sub_81AAA7C -sub_81AAA7C: @ 81AAA7C - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - movs r3, 0 - ldr r1, =gSaveBlock2Ptr - mov r8, r1 - lsls r1, r0, 2 - adds r1, r0 - movs r0, 0 - mov r12, r0 - lsls r4, r1, 1 - ldr r7, =0x00000e2c - movs r6, 0 - ldr r5, =0x00000e54 - lsls r2, r1, 2 -_081AAA9E: - mov r1, r8 - ldr r0, [r1] - adds r1, r0, r7 - adds r1, r2 - strh r6, [r1] - adds r1, r3, r4 - adds r0, r5 - adds r0, r1 - mov r1, r12 - strb r1, [r0] - adds r2, 0x2 - adds r3, 0x1 - cmp r3, 0x9 - ble _081AAA9E - movs r0, 0x15 - movs r1, 0x1 - bl AddPyramidBagItem - movs r0, 0x22 - movs r1, 0x1 - bl AddPyramidBagItem - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AAA7C - - thumb_func_start CalculateBattlePyramidPickupItemId -CalculateBattlePyramidPickupItemId: @ 81AAAE0 - push {r4-r6,lr} - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r2, =0x00000ca9 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r6, r0, 30 - lsls r0, r6, 1 - ldr r2, =0x00000e1a - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - movs r1, 0x7 - bl __udivsi3 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x13 - ble _081AAB0A - movs r4, 0x13 -_081AAB0A: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r2, r0, 16 - movs r1, 0 - ldr r3, =gUnknown_08613F86 - ldrb r0, [r3] - lsls r5, r4, 2 - cmp r0, r2 - bgt _081AAB36 -_081AAB28: - adds r1, 0x1 - cmp r1, 0x9 - bhi _081AAB3A - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - ble _081AAB28 -_081AAB36: - cmp r1, 0x9 - bls _081AAB3C -_081AAB3A: - movs r1, 0x9 -_081AAB3C: - cmp r6, 0 - bne _081AAB58 - ldr r2, =gUnknown_0861379C - b _081AAB5A - .pool -_081AAB58: - ldr r2, =gUnknown_0861392C -_081AAB5A: - lsls r1, 1 - adds r0, r5, r4 - lsls r0, 2 - adds r1, r0 - adds r1, r2 - ldrh r0, [r1] - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end CalculateBattlePyramidPickupItemId - - thumb_func_start sub_81AAB70 -sub_81AAB70: @ 81AAB70 - push {r4,lr} - ldr r4, =gUnknown_0203CE58 - movs r0, 0 - strb r0, [r4, 0x5] - adds r0, r4, 0 - adds r0, 0x8 - movs r1, 0 - movs r2, 0xA - bl memset - adds r4, 0x12 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0xA - bl memset - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AAB70 - - thumb_func_start CB2_BagMenuFromStartMenu -@ void CB2_BagMenuFromStartMenu() -CB2_BagMenuFromStartMenu: @ 81AAB9C - push {lr} - ldr r2, =sub_8086194 - movs r0, 0 - movs r1, 0x5 - bl GoToBagMenu - pop {r0} - bx r0 - .pool - thumb_func_end CB2_BagMenuFromStartMenu - - thumb_func_start sub_81AABB0 -sub_81AABB0: @ 81AABB0 - push {lr} - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - bne _081AABCC - ldr r2, =sub_8059D50 - movs r0, 0x1 - movs r1, 0x5 - bl GoToBagMenu - b _081AABD4 - .pool -_081AABCC: - ldr r1, =sub_8059D50 - movs r0, 0x1 - bl sub_81C4F98 -_081AABD4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AABB0 - - thumb_func_start CB2_ChooseBerry -CB2_ChooseBerry: @ 81AABDC - push {lr} - ldr r2, =sub_80861B0 - movs r0, 0x4 - movs r1, 0x3 - bl GoToBagMenu - pop {r0} - bx r0 - .pool - thumb_func_end CB2_ChooseBerry - - thumb_func_start sub_81AABF0 -sub_81AABF0: @ 81AABF0 - push {lr} - adds r2, r0, 0 - movs r0, 0x5 - movs r1, 0x3 - bl GoToBagMenu - pop {r0} - bx r0 - thumb_func_end sub_81AABF0 - - thumb_func_start CB2_GoToSellMenu -@ void CB2_GoToSellMenu() -CB2_GoToSellMenu: @ 81AAC00 - push {lr} - ldr r2, =CB2_ExitSellMenu - movs r0, 0x3 - movs r1, 0x5 - bl GoToBagMenu - pop {r0} - bx r0 - .pool - thumb_func_end CB2_GoToSellMenu - - thumb_func_start sub_81AAC14 -sub_81AAC14: @ 81AAC14 - push {lr} - ldr r2, =sub_816B31C - movs r0, 0x6 - movs r1, 0x5 - bl GoToBagMenu - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AAC14 - - thumb_func_start sub_81AAC28 -sub_81AAC28: @ 81AAC28 - push {lr} - ldr r2, =bag_menu_leave_maybe_3 - movs r0, 0x9 - movs r1, 0x5 - bl GoToBagMenu - ldr r0, =gSpecialVar_0x8005 - movs r1, 0 - strh r1, [r0] - ldr r0, =gScriptResult - strh r1, [r0] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AAC28 - - thumb_func_start sub_81AAC50 -sub_81AAC50: @ 81AAC50 - push {lr} - ldr r2, =bag_menu_leave_maybe_2 - movs r0, 0x7 - movs r1, 0x5 - bl GoToBagMenu - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AAC50 - - thumb_func_start sub_81AAC70 -sub_81AAC70: @ 81AAC70 - push {lr} - ldr r2, =bag_menu_leave_maybe - movs r0, 0x8 - movs r1, 0x5 - bl GoToBagMenu - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AAC70 - - thumb_func_start GoToBagMenu -@ void GoToBagMenu(u8 bagMenuType, u8 pocketId, void ( *postExitMenuMainCallback2)()) -GoToBagMenu: @ 81AAC90 - push {r4-r7,lr} - adds r4, r2, 0 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r7, r1, 24 - ldr r6, =gUnknown_0203CE54 - ldr r0, =0x00000c48 - bl AllocZeroed - str r0, [r6] - cmp r0, 0 - bne _081AACBC - adds r0, r4, 0 - bl SetMainCallback2 - b _081AAD3A - .pool -_081AACBC: - ldr r0, =gUnknown_0203CE58 - cmp r5, 0xC - beq _081AACC4 - strb r5, [r0, 0x4] -_081AACC4: - cmp r4, 0 - beq _081AACCA - str r4, [r0] -_081AACCA: - cmp r7, 0x4 - bhi _081AACD0 - strb r7, [r0, 0x5] -_081AACD0: - ldrb r0, [r0, 0x4] - subs r0, 0x4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _081AACF0 - ldr r2, [r6] - ldr r0, =0x0000081b - adds r2, r0 - ldrb r1, [r2] - movs r0, 0x10 - negs r0, r0 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] -_081AACF0: - ldr r0, [r6] - movs r1, 0 - str r1, [r0] - ldr r1, =0x0000081a - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldr r0, [r6] - ldr r1, =0x0000081e - adds r0, r1 - movs r1, 0x1 - negs r1, r1 - strb r1, [r0] - ldr r0, [r6] - ldr r1, =0x0000081f - adds r0, r1 - movs r1, 0x1 - negs r1, r1 - strb r1, [r0] - ldr r0, [r6] - ldr r1, =0x00000804 - adds r0, r1 - movs r1, 0xFF - movs r2, 0xC - bl memset - ldr r0, [r6] - movs r1, 0x81 - lsls r1, 4 - adds r0, r1 - movs r1, 0xFF - movs r2, 0xA - bl memset - ldr r0, =CB2_Bag - bl SetMainCallback2 -_081AAD3A: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end GoToBagMenu - - thumb_func_start c2_bag_3 -c2_bag_3: @ 81AAD5C - push {lr} - bl RunTasks - bl AnimateSprites - bl BuildOamBuffer - bl do_scheduled_bg_tilemap_copies_to_vram - bl UpdatePaletteFade - pop {r0} - bx r0 - thumb_func_end c2_bag_3 - - thumb_func_start vblank_cb_bag_menu -vblank_cb_bag_menu: @ 81AAD78 - push {lr} - bl LoadOam - bl ProcessSpriteCopyRequests - bl TransferPlttBuffer - pop {r0} - bx r0 - thumb_func_end vblank_cb_bag_menu - - thumb_func_start CB2_Bag -CB2_Bag: @ 81AAD8C - push {lr} -_081AAD8E: - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081AADB2 - bl setup_bag_menu - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081AADB2 - bl sub_81221AC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081AAD8E -_081AADB2: - pop {r0} - bx r0 - thumb_func_end CB2_Bag - - thumb_func_start setup_bag_menu -setup_bag_menu: @ 81AADB8 - push {r4,r5,lr} - sub sp, 0x4 - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r0, r1, r2 - ldrb r0, [r0] - adds r2, r1, 0 - cmp r0, 0x14 - bls _081AADCE - b _081AB02C -_081AADCE: - lsls r0, 2 - ldr r1, =_081AADE0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081AADE0: - .4byte _081AAE34 - .4byte _081AAE3E - .4byte _081AAE50 - .4byte _081AAE56 - .4byte _081AAE78 - .4byte _081AAE7E - .4byte _081AAE86 - .4byte _081AAEA4 - .4byte _081AAECC - .4byte _081AAEDA - .4byte _081AAEEC - .4byte _081AAEFA - .4byte _081AAF0C - .4byte _081AAF1C - .4byte _081AAF54 - .4byte _081AAFA0 - .4byte _081AAFBC - .4byte _081AAFC2 - .4byte _081AAFD8 - .4byte _081AAFDE - .4byte _081AAFF8 -_081AAE34: - bl SetVBlankHBlankCallbacksToNull - bl clear_scheduled_bg_copies_to_vram - b _081AB012 -_081AAE3E: - bl remove_some_task - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _081AB01A - .pool -_081AAE50: - bl FreeAllSpritePalettes - b _081AB012 -_081AAE56: - bl ResetPaletteFade - ldr r2, =gPaletteFade - ldrb r0, [r2, 0x8] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2, 0x8] - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _081AB01A - .pool -_081AAE78: - bl ResetSpriteData - b _081AB012 -_081AAE7E: - movs r0, 0x87 - lsls r0, 3 - adds r1, r2, r0 - b _081AB01A -_081AAE86: - bl sub_81221AC - lsls r0, 24 - cmp r0, 0 - bne _081AAE94 - bl ResetTasks -_081AAE94: - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _081AB01A - .pool -_081AAEA4: - bl bag_menu_init_bgs - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r1, =0x00000834 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _081AB01A - .pool -_081AAECC: - bl load_bag_menu_graphics - lsls r0, 24 - cmp r0, 0 - bne _081AAED8 - b _081AB044 -_081AAED8: - b _081AB012 -_081AAEDA: - bl setup_bag_menu_textboxes - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _081AB01A - .pool -_081AAEEC: - bl sub_81ABA6C - bl sub_81ABAC4 - bl sub_81ABAE0 - b _081AB012 -_081AAEFA: - bl allocate_bag_item_list_buffers - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _081AB01A - .pool -_081AAF0C: - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - bl load_bag_item_list_buffers - b _081AB012 - .pool -_081AAF1C: - ldr r1, =gUnknown_085E91FC - ldr r4, =gUnknown_0203CE58 - ldrb r0, [r4, 0x5] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0 - bl bag_menu_print_pocket_names - movs r0, 0 - bl bag_menu_copy_pocket_name_to_window - ldrb r0, [r4, 0x5] - movs r1, 0x1 - bl bag_menu_draw_pocket_indicator_square - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _081AB01A - .pool -_081AAF54: - ldr r4, =gUnknown_0203CE58 - ldrb r0, [r4, 0x4] - bl sub_81AB1F0 - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_03006310 - ldrb r2, [r4, 0x5] - lsls r2, 1 - adds r1, r4, 0 - adds r1, 0x12 - adds r1, r2, r1 - ldrh r1, [r1] - adds r4, 0x8 - adds r2, r4 - ldrh r2, [r2] - bl ListMenuInit - ldr r2, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r2 - lsls r0, 24 - lsrs r0, 24 - movs r2, 0 - strh r0, [r1, 0x8] - strh r2, [r1, 0xE] - strh r2, [r1, 0x18] - b _081AB012 - .pool -_081AAFA0: - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - bl AddBagVisualObject - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _081AB01A - .pool -_081AAFBC: - bl sub_80D4FAC - b _081AB012 -_081AAFC2: - bl bag_menu_add_pocket_scroll_arrow_indicators_maybe - bl bag_menu_add_list_scroll_arrow_indicators_maybe - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _081AB01A - .pool -_081AAFD8: - bl bag_menu_prepare_tmhm_move_window - b _081AB012 -_081AAFDE: - movs r0, 0x1 - negs r0, r0 - movs r1, 0x10 - movs r2, 0 - bl BlendPalettes - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _081AB01A - .pool -_081AAFF8: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - ldr r2, =gPaletteFade - ldrb r1, [r2, 0x8] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2, 0x8] -_081AB012: - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 -_081AB01A: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _081AB044 - .pool -_081AB02C: - ldr r0, =vblank_cb_bag_menu - bl SetVBlankCallback - ldr r0, =c2_bag_3 - bl SetMainCallback2 - movs r0, 0x1 - b _081AB046 - .pool -_081AB044: - movs r0, 0 -_081AB046: - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end setup_bag_menu - - thumb_func_start bag_menu_init_bgs -bag_menu_init_bgs: @ 81AB050 - push {r4,lr} - bl sub_8121DA0 - ldr r4, =gUnknown_0203CE54 - ldr r0, [r4] - adds r0, 0x4 - movs r2, 0x80 - lsls r2, 4 - movs r1, 0 - bl memset - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_08613F90 - movs r0, 0 - movs r2, 0x3 - bl InitBgsFromTemplates - ldr r1, [r4] - adds r1, 0x4 - movs r0, 0x2 - bl SetBgTilemapBuffer - bl sub_8121E10 - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_init_bgs - - thumb_func_start load_bag_menu_graphics -load_bag_menu_graphics: @ 81AB0BC - push {r4,lr} - sub sp, 0x4 - ldr r4, =gUnknown_0203CE54 - ldr r0, [r4] - ldr r1, =0x00000834 - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0x4 - bls _081AB0D2 - b _081AB1CC -_081AB0D2: - lsls r0, 2 - ldr r1, =_081AB0E8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081AB0E8: - .4byte _081AB0FC - .4byte _081AB118 - .4byte _081AB13C - .4byte _081AB174 - .4byte _081AB1A8 -_081AB0FC: - bl reset_temp_tile_data_buffers - ldr r1, =gUnknown_08D9A620 - movs r0, 0 - str r0, [sp] - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - b _081AB1AE - .pool -_081AB118: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081AB1E4 - ldr r0, =gUnknown_08D9A88C - ldr r4, =gUnknown_0203CE54 - ldr r1, [r4] - adds r1, 0x4 - bl LZDecompressWram - ldr r1, [r4] - b _081AB1B2 - .pool -_081AB13C: - bl IsWallysBag - lsls r0, 24 - cmp r0, 0 - bne _081AB164 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldrb r0, [r0, 0x8] - cmp r0, 0 - beq _081AB164 - ldr r0, =gUnknown_08D9A5D4 - movs r1, 0 - movs r2, 0x40 - bl LoadCompressedPalette - b _081AB1AE - .pool -_081AB164: - ldr r0, =gUnknown_08D9A588 - movs r1, 0 - movs r2, 0x40 - bl LoadCompressedPalette - b _081AB1AE - .pool -_081AB174: - bl IsWallysBag - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081AB18A - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldrb r0, [r0, 0x8] - cmp r0, 0 - bne _081AB19C -_081AB18A: - ldr r0, =gUnknown_0857FB34 - bl LoadCompressedObjectPic - b _081AB1AE - .pool -_081AB19C: - ldr r0, =gUnknown_0857FB3C - bl LoadCompressedObjectPic - b _081AB1AE - .pool -_081AB1A8: - ldr r0, =gUnknown_0857FB44 - bl LoadCompressedObjectPalette -_081AB1AE: - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] -_081AB1B2: - ldr r0, =0x00000834 - adds r1, r0 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _081AB1E4 - .pool -_081AB1CC: - bl sub_8122328 - ldr r0, [r4] - ldr r1, =0x00000834 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - movs r0, 0x1 - b _081AB1E6 - .pool -_081AB1E4: - movs r0, 0 -_081AB1E6: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end load_bag_menu_graphics - - thumb_func_start sub_81AB1F0 -sub_81AB1F0: @ 81AB1F0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xA - bne _081AB204 - ldr r0, =Task_WallyTutorialBagMenu - b _081AB206 - .pool -_081AB204: - ldr r0, =Task_BagMenu -_081AB206: - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81AB1F0 - - thumb_func_start allocate_bag_item_list_buffers -allocate_bag_item_list_buffers: @ 81AB218 - push {r4,lr} - ldr r4, =gUnknown_0203CE74 - movs r0, 0x82 - lsls r0, 2 - bl Alloc - str r0, [r4] - ldr r4, =gUnknown_0203CE78 - movs r0, 0xC3 - lsls r0, 3 - bl Alloc - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end allocate_bag_item_list_buffers - - thumb_func_start load_bag_item_list_buffers -@ void load_bag_item_list_buffers(int pocket_id) -load_bag_item_list_buffers: @ 81AB240 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r7, r0, 24 - lsls r1, r7, 3 - ldr r0, =gBagPockets - adds r1, r0 - mov r8, r1 - ldr r0, =gUnknown_0203CE54 - ldr r2, [r0] - ldr r1, =0x0000081b - adds r0, r2, r1 - ldrb r1, [r0] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081AB2FC - movs r6, 0 - ldr r3, =0x00000829 - adds r0, r2, r3 - adds r0, r7 - ldrb r0, [r0] - subs r0, 0x1 - cmp r6, r0 - bge _081AB2B6 - ldr r5, =gUnknown_0203CE78 -_081AB276: - lsls r4, r6, 1 - adds r4, r6 - lsls r4, 3 - ldr r0, [r5] - adds r0, r4 - mov r1, r8 - ldr r2, [r1] - lsls r1, r6, 2 - adds r1, r2 - ldrh r1, [r1] - bl get_name - ldr r0, =gUnknown_0203CE74 - ldr r0, [r0] - lsls r1, r6, 3 - adds r1, r0 - ldr r0, [r5] - adds r0, r4 - str r0, [r1] - str r6, [r1, 0x4] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r3, =0x00000829 - adds r0, r3 - adds r0, r7 - ldrb r0, [r0] - subs r0, 0x1 - cmp r6, r0 - blt _081AB276 -_081AB2B6: - ldr r5, =gUnknown_0203CE78 - lsls r4, r6, 1 - adds r4, r6 - lsls r4, 3 - ldr r0, [r5] - adds r0, r4 - ldr r1, =gUnknown_085E8DB4 - bl StringCopy - ldr r0, =gUnknown_0203CE74 - ldr r0, [r0] - lsls r1, r6, 3 - adds r1, r0 - ldr r0, [r5] - adds r0, r4 - str r0, [r1] - movs r0, 0x2 - negs r0, r0 - str r0, [r1, 0x4] - b _081AB34A - .pool -_081AB2FC: - movs r6, 0 - ldr r4, =0x00000829 - adds r0, r2, r4 - adds r0, r7 - ldrb r0, [r0] - cmp r6, r0 - bcs _081AB34A - ldr r5, =gUnknown_0203CE78 -_081AB30C: - lsls r4, r6, 1 - adds r4, r6 - lsls r4, 3 - ldr r0, [r5] - adds r0, r4 - mov r1, r8 - ldr r2, [r1] - lsls r1, r6, 2 - adds r1, r2 - ldrh r1, [r1] - bl get_name - ldr r0, =gUnknown_0203CE74 - ldr r0, [r0] - lsls r1, r6, 3 - adds r1, r0 - ldr r0, [r5] - adds r0, r4 - str r0, [r1] - str r6, [r1, 0x4] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r3, =0x00000829 - adds r0, r3 - adds r0, r7 - ldrb r0, [r0] - cmp r6, r0 - bcc _081AB30C -_081AB34A: - ldr r2, =gUnknown_03006310 - adds r1, r2, 0 - ldr r0, =gUnknown_08613F9C - ldm r0!, {r3-r5} - stm r1!, {r3-r5} - ldm r0!, {r3-r5} - stm r1!, {r3-r5} - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - ldr r4, =0x00000829 - adds r0, r1, r4 - adds r0, r7 - ldrb r0, [r0] - strh r0, [r2, 0xC] - ldr r0, =gUnknown_0203CE74 - ldr r0, [r0] - str r0, [r2] - ldr r5, =0x0000082e - adds r1, r5 - adds r1, r7 - ldrb r0, [r1] - strh r0, [r2, 0xE] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end load_bag_item_list_buffers - - thumb_func_start get_name -@ void get_name(char *dest, int name_id) -get_name: @ 81AB39C - push {r4-r6,lr} - adds r6, r0, 0 - lsls r1, 16 - lsrs r5, r1, 16 - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - cmp r0, 0x2 - beq _081AB3C0 - cmp r0, 0x3 - beq _081AB420 - adds r0, r5, 0 - adds r1, r6, 0 - bl CopyItemName - b _081AB43E - .pool -_081AB3C0: - ldr r4, =gStringVar2 - adds r0, r5, 0 - bl ItemIdToBattleMoveId - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xD - muls r1, r0 - ldr r0, =gMoveNames - adds r1, r0 - adds r0, r4, 0 - bl StringCopy - movs r0, 0xA9 - lsls r0, 1 - cmp r5, r0 - bls _081AB408 - ldr r0, =gStringVar1 - ldr r2, =0xfffffeae - adds r1, r5, r2 - movs r2, 0x2 - movs r3, 0x1 - bl ConvertIntToDecimalStringN - ldr r1, =gUnknown_085E921A - b _081AB438 - .pool -_081AB408: - ldr r0, =gStringVar1 - ldr r2, =0xfffffee0 - adds r1, r5, r2 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - b _081AB436 - .pool -_081AB420: - ldr r0, =gStringVar1 - adds r1, r5, 0 - subs r1, 0x84 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - ldr r1, =gStringVar2 - adds r0, r5, 0 - bl CopyItemName -_081AB436: - ldr r1, =gUnknown_085E9210 -_081AB438: - adds r0, r6, 0 - bl StringExpandPlaceholders -_081AB43E: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end get_name - - 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 - lsrs r1, 24 - cmp r1, 0x1 - beq _081AB466 - movs r0, 0x5 - bl PlaySE - bl ShakeBagVisual -_081AB466: - ldr r4, =gUnknown_0203CE54 - ldr r1, [r4] - ldr r2, =0x0000081a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0xFF - bne _081AB50C - adds r2, 0x1 - adds r0, r1, r2 - ldrb r1, [r0] - lsls r1, 26 - lsrs r1, 30 - movs r0, 0x1 - eors r0, r1 - bl RemoveBagItemIconObject - movs r0, 0x2 - negs r0, r0 - cmp r6, r0 - beq _081AB4C8 - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r6, 16 - lsrs r1, 16 - bl BagGetItemIdByPocketPosition - lsls r0, 16 - lsrs r0, 16 - ldr r1, [r4] - ldr r2, =0x0000081b - adds r1, r2 - ldrb r1, [r1] - lsls r1, 26 - lsrs r1, 30 - bl AddBagItemIconObject - b _081AB4DA - .pool -_081AB4C8: - ldr r0, =0x0000ffff - ldr r1, [r4] - ldr r2, =0x0000081b - adds r1, r2 - ldrb r1, [r1] - lsls r1, 26 - lsrs r1, 30 - bl AddBagItemIconObject -_081AB4DA: - ldr r5, =gUnknown_0203CE54 - ldr r2, [r5] - ldr r4, =0x0000081b - adds r2, r4 - ldrb r3, [r2] - lsls r0, r3, 26 - lsrs r0, 30 - movs r1, 0x1 - eors r1, r0 - lsls r1, 4 - movs r0, 0x31 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - ldr r0, [r5] - adds r0, r4 - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _081AB50C - adds r0, r6, 0 - bl bag_menu_print_description_box_text -_081AB50C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - 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) -sub_81AB520: @ 81AB520 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x14 - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r2, 24 - lsrs r7, r2, 24 - movs r0, 0x2 - negs r0, r0 - cmp r4, r0 - bne _081AB540 - b _081AB696 -_081AB540: - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r1, =0x0000081a - adds r0, r1 - ldrb r1, [r0] - cmp r1, 0xFF - beq _081AB570 - lsls r0, r4, 24 - lsrs r0, 24 - cmp r1, r0 - bne _081AB568 - adds r0, r7, 0 - movs r1, 0x2 - bl bag_menu_print_cursor - b _081AB570 - .pool -_081AB568: - adds r0, r7, 0 - movs r1, 0xFF - bl bag_menu_print_cursor -_081AB570: - ldr r5, =gUnknown_0203CE58 - ldrb r0, [r5, 0x5] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - lsls r4, 16 - lsrs r4, 16 - adds r1, r4, 0 - bl BagGetItemIdByPocketPosition - lsls r0, 16 - lsrs r6, r0, 16 - ldrb r0, [r5, 0x5] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - bl BagGetQuantityByPocketPosition - lsls r0, 16 - lsrs r4, r0, 16 - mov r9, r4 - ldr r1, =0xfffffead - adds r0, r6, r1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x7 - bhi _081AB5BE - ldr r1, =gUnknown_08DC6378 - subs r3, r7, 0x1 - lsls r3, 16 - lsrs r3, 16 - movs r0, 0x10 - str r0, [sp] - str r0, [sp, 0x4] - mov r0, r8 - movs r2, 0x8 - bl BlitBitmapToWindow -_081AB5BE: - ldrb r0, [r5, 0x5] - cmp r0, 0x3 - bne _081AB610 - ldr r0, =gStringVar1 - adds r1, r4, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E8DA0 - adds r0, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x7 - adds r1, r4, 0 - movs r2, 0x77 - bl GetStringRightAlignXOffset - lsls r3, r0, 24 - lsrs r3, 24 - str r7, [sp] - movs r1, 0 - str r1, [sp, 0x4] - str r1, [sp, 0x8] - movs r0, 0xFF - str r0, [sp, 0xC] - str r1, [sp, 0x10] - b _081AB652 - .pool -_081AB610: - cmp r0, 0x4 - beq _081AB66C - adds r0, r6, 0 - bl itemid_is_unique - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _081AB66C - ldr r0, =gStringVar1 - mov r1, r9 - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E8DA0 - adds r0, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x7 - adds r1, r4, 0 - movs r2, 0x77 - bl GetStringRightAlignXOffset - lsls r3, r0, 24 - lsrs r3, 24 - str r7, [sp] - str r5, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0xFF - str r0, [sp, 0xC] - str r5, [sp, 0x10] -_081AB652: - mov r0, r8 - movs r1, 0x7 - adds r2, r4, 0 - bl bag_menu_print - b _081AB696 - .pool -_081AB66C: - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00000496 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0 - beq _081AB696 - cmp r0, r6 - bne _081AB696 - ldr r1, =gUnknown_086140A4 - subs r3, r7, 0x1 - lsls r3, 16 - lsrs r3, 16 - movs r0, 0x18 - str r0, [sp] - movs r0, 0x10 - str r0, [sp, 0x4] - mov r0, r8 - movs r2, 0x60 - bl BlitBitmapToWindow -_081AB696: - add sp, 0x14 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AB520 - - thumb_func_start bag_menu_print_description_box_text -@ void bag_menu_print_description_box_text(int a1) -bag_menu_print_description_box_text: @ 81AB6B0 - push {r4,lr} - sub sp, 0x14 - adds r1, r0, 0 - movs r0, 0x2 - negs r0, r0 - cmp r1, r0 - beq _081AB6E0 - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r1, 16 - bl BagGetItemIdByPocketPosition - lsls r0, 16 - lsrs r0, 16 - bl ItemId_GetDescription - adds r4, r0, 0 - b _081AB6FC - .pool -_081AB6E0: - ldr r0, =gStringVar1 - ldr r2, =gUnknown_085E9180 - ldr r1, =gUnknown_0203CE58 - ldrb r1, [r1, 0x4] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl StringCopy - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E91C0 - adds r0, r4, 0 - bl StringExpandPlaceholders -_081AB6FC: - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - str r0, [sp, 0xC] - str r0, [sp, 0x10] - movs r0, 0x1 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0x3 - bl bag_menu_print - add sp, 0x14 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_print_description_box_text - - thumb_func_start bag_menu_print_cursor_ -bag_menu_print_cursor_: @ 81AB73C - push {r4,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsrs r4, 24 - bl ListMenuGetYCoordForPrintingArrowCursor - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - bl bag_menu_print_cursor - pop {r4} - pop {r0} - bx r0 - thumb_func_end bag_menu_print_cursor_ - - thumb_func_start bag_menu_print_cursor -bag_menu_print_cursor: @ 81AB75C - push {r4,r5,lr} - sub sp, 0x14 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0xFF - bne _081AB798 - movs r0, 0x1 - movs r1, 0 - bl GetMenuCursorDimensionByFont - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - movs r1, 0x1 - bl GetMenuCursorDimensionByFont - lsls r0, 24 - lsrs r0, 24 - str r4, [sp] - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - adds r3, r5, 0 - bl FillWindowPixelRect - b _081AB7AE -_081AB798: - ldr r2, =gUnknown_085E8D60 - str r5, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - str r0, [sp, 0xC] - str r1, [sp, 0x10] - movs r1, 0x1 - movs r3, 0 - bl bag_menu_print -_081AB7AE: - add sp, 0x14 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_print_cursor - - thumb_func_start bag_menu_add_pocket_scroll_arrow_indicators_maybe -bag_menu_add_pocket_scroll_arrow_indicators_maybe: @ 81AB7BC - push {r4-r6,lr} - sub sp, 0x10 - ldr r5, =gUnknown_0203CE54 - ldr r4, [r5] - ldr r1, =0x0000081e - adds r0, r4, r1 - ldrb r0, [r0] - cmp r0, 0xFF - bne _081AB80A - ldr r2, =gUnknown_0203CE58 - ldrb r3, [r2, 0x5] - ldr r6, =0x00000829 - adds r0, r4, r6 - adds r0, r3 - ldrb r1, [r0] - adds r6, 0x5 - adds r0, r4, r6 - adds r0, r3 - ldrb r0, [r0] - subs r1, r0 - str r1, [sp] - movs r0, 0x6E - str r0, [sp, 0x4] - str r0, [sp, 0x8] - ldrb r0, [r2, 0x5] - lsls r0, 1 - adds r2, 0x12 - adds r0, r2 - str r0, [sp, 0xC] - movs r0, 0x2 - movs r1, 0xAC - movs r2, 0xC - movs r3, 0x94 - bl AddScrollIndicatorArrowPairParametrized - ldr r1, [r5] - ldr r2, =0x0000081e - adds r1, r2 - strb r0, [r1] -_081AB80A: - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_add_pocket_scroll_arrow_indicators_maybe - - thumb_func_start sub_81AB824 -sub_81AB824: @ 81AB824 - push {r4,lr} - ldr r4, =gUnknown_0203CE54 - ldr r0, [r4] - ldr r2, =0x0000081e - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0xFF - beq _081AB842 - bl RemoveScrollIndicatorArrowPair - ldr r0, [r4] - ldr r1, =0x0000081e - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] -_081AB842: - bl sub_81AB89C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AB824 - - thumb_func_start bag_menu_add_list_scroll_arrow_indicators_maybe -bag_menu_add_list_scroll_arrow_indicators_maybe: @ 81AB854 - push {r4,lr} - ldr r4, =gUnknown_0203CE54 - ldr r2, [r4] - ldr r1, =0x0000081b - adds r0, r2, r1 - ldrb r1, [r0] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x1 - beq _081AB882 - ldr r1, =0x0000081f - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0xFF - bne _081AB882 - ldr r0, =gUnknown_08614094 - ldr r1, =gUnknown_0203CE5E - bl AddScrollIndicatorArrowPair - ldr r1, [r4] - ldr r2, =0x0000081f - adds r1, r2 - strb r0, [r1] -_081AB882: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_add_list_scroll_arrow_indicators_maybe - - thumb_func_start sub_81AB89C -sub_81AB89C: @ 81AB89C - push {r4,lr} - ldr r4, =gUnknown_0203CE54 - ldr r0, [r4] - ldr r2, =0x0000081f - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0xFF - beq _081AB8BA - bl RemoveScrollIndicatorArrowPair - ldr r0, [r4] - ldr r1, =0x0000081f - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] -_081AB8BA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AB89C - - thumb_func_start free_bag_item_list_buffers -free_bag_item_list_buffers: @ 81AB8C8 - push {lr} - ldr r0, =gUnknown_0203CE78 - ldr r0, [r0] - bl Free - ldr r0, =gUnknown_0203CE74 - ldr r0, [r0] - bl Free - bl FreeAllWindowBuffers - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - bl Free - pop {r0} - bx r0 - .pool - thumb_func_end free_bag_item_list_buffers - - thumb_func_start unknown_ItemMenu_Confirm -unknown_ItemMenu_Confirm: @ 81AB8F8 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =task_close_bag_menu_2 - str r1, [r0] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end unknown_ItemMenu_Confirm - - thumb_func_start task_close_bag_menu_2 -task_close_bag_menu_2: @ 81AB930 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r2, r0, r1 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081AB9A0 - ldrb r0, [r2] - ldr r4, =gUnknown_0203CE58 - ldrb r2, [r4, 0x5] - lsls r2, 1 - adds r1, r4, 0 - adds r1, 0x12 - adds r1, r2, r1 - adds r3, r4, 0 - adds r3, 0x8 - adds r2, r3 - bl sub_81AE6C8 - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r0, [r0] - cmp r0, 0 - beq _081AB984 - bl SetMainCallback2 - b _081AB98A - .pool -_081AB984: - ldr r0, [r4] - bl SetMainCallback2 -_081AB98A: - bl sub_81AB824 - bl ResetSpriteData - bl FreeAllSpritePalettes - bl free_bag_item_list_buffers - adds r0, r5, 0 - bl DestroyTask -_081AB9A0: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end task_close_bag_menu_2 - - thumb_func_start sub_81AB9A8 -sub_81AB9A8: @ 81AB9A8 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, r5, 3 - ldr r0, =gBagPockets - adds r4, r1, r0 - cmp r5, 0x3 - bgt _081AB9C8 - cmp r5, 0x2 - blt _081AB9C8 - adds r0, r4, 0 - bl sub_80D6FB4 - b _081AB9CE - .pool -_081AB9C8: - adds r0, r4, 0 - bl sub_80D6F64 -_081AB9CE: - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - ldr r6, =0x00000829 - adds r1, r6 - adds r1, r5 - movs r2, 0 - strb r2, [r1] - adds r3, r0, 0 - ldrb r0, [r4, 0x4] - cmp r2, r0 - bcs _081ABA12 - ldr r0, [r4] - ldrh r0, [r0] - cmp r0, 0 - beq _081ABA12 - adds r7, r3, 0 -_081AB9EE: - ldr r0, [r7] - adds r0, r6 - adds r0, r5 - ldrb r1, [r0] - adds r1, 0x1 - strb r1, [r0] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - ldrb r1, [r4, 0x4] - cmp r2, r1 - bcs _081ABA12 - ldr r0, [r4] - lsls r1, r2, 2 - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0 - bne _081AB9EE -_081ABA12: - ldr r2, [r3] - ldr r1, =0x0000081b - adds r0, r2, r1 - ldrb r1, [r0] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081ABA2E - ldr r0, =0x00000829 - adds r1, r2, r0 - adds r1, r5 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_081ABA2E: - ldr r1, [r3] - ldr r2, =0x00000829 - adds r0, r1, r2 - adds r0, r5 - ldrb r2, [r0] - cmp r2, 0x8 - bls _081ABA58 - ldr r3, =0x0000082e - adds r0, r1, r3 - adds r0, r5 - movs r1, 0x8 - strb r1, [r0] - b _081ABA60 - .pool -_081ABA58: - ldr r3, =0x0000082e - adds r0, r1, r3 - adds r0, r5 - strb r2, [r0] -_081ABA60: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AB9A8 - - thumb_func_start sub_81ABA6C -sub_81ABA6C: @ 81ABA6C - push {r4,lr} - movs r4, 0 -_081ABA70: - adds r0, r4, 0 - bl sub_81AB9A8 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x4 - bls _081ABA70 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81ABA6C - - thumb_func_start sub_81ABA88 -sub_81ABA88: @ 81ABA88 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 1 - ldr r2, =gUnknown_0203CE6A - adds r4, r1, r2 - subs r2, 0xA - adds r1, r2 - ldr r2, =gUnknown_0203CE54 - ldr r3, [r2] - ldr r5, =0x0000082e - adds r2, r3, r5 - adds r2, r0 - ldrb r2, [r2] - subs r5, 0x5 - adds r3, r5 - adds r3, r0 - ldrb r3, [r3] - adds r0, r4, 0 - bl sub_812225C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81ABA88 - - thumb_func_start sub_81ABAC4 -sub_81ABAC4: @ 81ABAC4 - push {r4,lr} - movs r4, 0 -_081ABAC8: - adds r0, r4, 0 - bl sub_81ABA88 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x4 - bls _081ABAC8 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81ABAC4 - - thumb_func_start sub_81ABAE0 -sub_81ABAE0: @ 81ABAE0 - push {r4-r7,lr} - sub sp, 0x4 - movs r5, 0 - ldr r6, =gUnknown_0203CE6A - adds r7, r6, 0 - subs r7, 0xA -_081ABAEC: - lsls r1, r5, 1 - adds r0, r1, r6 - adds r1, r7 - ldr r2, =gUnknown_0203CE54 - ldr r3, [r2] - ldr r4, =0x0000082e - adds r2, r3, r4 - adds r2, r5 - ldrb r2, [r2] - subs r4, 0x5 - adds r3, r4 - adds r3, r5 - ldrb r3, [r3] - movs r4, 0x8 - str r4, [sp] - bl sub_8122298 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x4 - bls _081ABAEC - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81ABAE0 - - thumb_func_start sub_81ABB2C -sub_81ABB2C: @ 81ABB2C - lsls r0, 24 - ldr r1, =gUnknown_0203CE58 - lsrs r0, 23 - adds r2, r1, 0 - adds r2, 0x12 - adds r2, r0, r2 - adds r1, 0x8 - adds r0, r1 - ldrb r0, [r0] - ldrb r2, [r2] - adds r0, r2 - lsls r0, 24 - lsrs r0, 24 - bx lr - .pool - thumb_func_end sub_81ABB2C - - 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 - push {r5,r6} - sub sp, 0x10 - adds r5, r0, 0 - adds r6, r1, 0 - mov r8, r2 - mov r9, r3 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - movs r0, 0x4 - bl AddItemMessageWindow - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x14] - movs r1, 0x11 - bl FillWindowPixelBuffer - bl sav2_get_text_speed - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r4, 0x14] - str r6, [sp] - str r0, [sp, 0x4] - mov r0, r8 - str r0, [sp, 0x8] - mov r0, r9 - str r0, [sp, 0xC] - adds r0, r5, 0 - movs r2, 0xA - movs r3, 0xD - bl DisplayMessageAndContinueTask - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end DisplayItemMessage - - thumb_func_start bag_menu_inits_lists_menu -bag_menu_inits_lists_menu: @ 81ABBBC - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - lsls r5, r6, 2 - adds r5, r6 - lsls r5, 3 - ldr r0, =gTasks + 0x8 - adds r5, r0 - ldr r7, =gUnknown_0203CE58 - ldrb r4, [r7, 0x5] - lsls r4, 1 - movs r0, 0x12 - adds r0, r7 - mov r8, r0 - add r8, r4 - adds r0, r7, 0 - adds r0, 0x8 - adds r4, r0 - movs r0, 0x4 - bl bag_menu_RemoveBagItem_message_window - ldrb r0, [r5] - mov r1, r8 - adds r2, r4, 0 - bl sub_81AE6C8 - ldrb r0, [r7, 0x5] - bl sub_81AB9A8 - ldrb r0, [r7, 0x5] - bl sub_81ABA88 - ldrb r0, [r7, 0x5] - bl load_bag_item_list_buffers - ldr r0, =gUnknown_03006310 - mov r2, r8 - ldrh r1, [r2] - ldrh r2, [r4] - bl ListMenuInit - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5] - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - adds r0, r6, 0 - bl set_callback3_to_bag - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_inits_lists_menu - - thumb_func_start sub_81ABC3C -sub_81ABC3C: @ 81ABC3C - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl bag_menu_add_window - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl sub_81ABC54 - pop {r0} - bx r0 - thumb_func_end sub_81ABC3C - - thumb_func_start sub_81ABC54 -sub_81ABC54: @ 81ABC54 - push {r4,r5,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 16 - lsrs r1, 16 - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - movs r3, 0x2 - cmp r0, 0x3 - bne _081ABC6C - movs r3, 0x3 -_081ABC6C: - ldr r0, =gStringVar1 - lsls r1, 16 - asrs r1, 16 - movs r2, 0x2 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E8DA0 - adds r0, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x28 - bl GetStringCenterAlignXOffset - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x2 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - adds r0, r5, 0 - movs r1, 0x1 - adds r2, r4, 0 - bl Print - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81ABC54 - - thumb_func_start sub_81ABCC0 -sub_81ABCC0: @ 81ABCC0 - push {r4-r7,lr} - sub sp, 0xC - adds r4, r0, 0 - adds r7, r2, 0 - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - movs r3, 0x2 - cmp r0, 0x3 - bne _081ABCD4 - movs r3, 0x3 -_081ABCD4: - ldr r0, =gStringVar1 - movs r2, 0x2 - bl ConvertIntToDecimalStringN - ldr r6, =gStringVar4 - ldr r1, =gUnknown_085E8DA0 - adds r0, r6, 0 - bl StringExpandPlaceholders - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r5, 0 - str r5, [sp, 0x8] - adds r0, r4, 0 - movs r1, 0x1 - adds r2, r6, 0 - movs r3, 0 - bl Print - str r5, [sp] - adds r0, r4, 0 - movs r1, 0x26 - movs r2, 0x1 - adds r3, r7, 0 - bl PrintMoneyAmount - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81ABCC0 - - thumb_func_start Task_BagMenu -Task_BagMenu: @ 81ABD28 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsls r0, 2 - add r0, r9 - lsls r0, 3 - str r0, [sp] - ldr r1, =gTasks + 0x8 - adds r6, r0, r1 - ldr r5, =gUnknown_0203CE58 - ldrb r0, [r5, 0x5] - lsls r0, 1 - adds r1, r5, 0 - adds r1, 0x12 - adds r7, r0, r1 - subs r1, 0xA - adds r0, r1 - mov r8, r0 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081ABD66 - b _081ABEB2 -_081ABD66: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081ABD74 - b _081ABEB2 -_081ABD74: - bl GetSwitchBagPocketDirection - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081ABDB8 - cmp r0, 0x2 - beq _081ABDC0 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x4 - ands r0, r1 - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - cmp r0, 0 - beq _081ABE10 - bl sub_81AC2C0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081ABDA4 - b _081ABEB2 -_081ABDA4: - b _081ABDCC - .pool -_081ABDB8: - movs r1, 0x1 - negs r1, r1 - mov r0, r9 - b _081ABDC4 -_081ABDC0: - mov r0, r9 - movs r1, 0x1 -_081ABDC4: - movs r2, 0 - bl SwitchBagPocket - b _081ABEB2 -_081ABDCC: - ldrb r0, [r6] - adds r1, r7, 0 - mov r2, r8 - bl get_coro_args_x18_x1A - ldrh r2, [r7] - mov r3, r8 - ldrh r0, [r3] - adds r2, r0 - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r1, =gUnknown_0203CE58 - ldr r3, =0x00000829 - adds r0, r3 - ldrb r1, [r1, 0x5] - adds r0, r1 - ldrb r0, [r0] - subs r0, 0x1 - cmp r2, r0 - beq _081ABEB2 - movs r0, 0x5 - bl PlaySE - mov r0, r9 - bl bag_menu_swap_items - b _081ABEB2 - .pool -_081ABE10: - ldrb r0, [r6] - bl ListMenuHandleInput - adds r4, r0, 0 - ldrb r0, [r6] - adds r1, r7, 0 - mov r2, r8 - bl get_coro_args_x18_x1A - movs r0, 0x2 - negs r0, r0 - cmp r4, r0 - beq _081ABE32 - adds r0, 0x1 - cmp r4, r0 - bne _081ABE68 - b _081ABEB2 -_081ABE32: - ldrb r0, [r5, 0x4] - cmp r0, 0x5 - bne _081ABE40 - movs r0, 0x20 - bl PlaySE - b _081ABEB2 -_081ABE40: - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_0203CE7C - mov r1, r10 - strh r1, [r0] - ldr r0, =gTasks + 0x8 - subs r0, 0x8 - ldr r3, [sp] - adds r0, r3, r0 - ldr r1, =unknown_ItemMenu_Confirm - str r1, [r0] - b _081ABEB2 - .pool -_081ABE68: - movs r0, 0x5 - bl PlaySE - bl sub_81AB824 - ldrb r0, [r6] - movs r1, 0x2 - bl bag_menu_print_cursor_ - strh r4, [r6, 0x2] - ldrb r0, [r5, 0x5] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - lsls r4, 16 - lsrs r4, 16 - adds r1, r4, 0 - bl BagGetQuantityByPocketPosition - strh r0, [r6, 0x4] - ldrb r0, [r5, 0x5] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - bl BagGetItemIdByPocketPosition - ldr r1, =gUnknown_0203CE7C - strh r0, [r1] - ldr r1, =gUnknown_08614054 - ldrb r0, [r5, 0x4] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - mov r0, r9 - bl _call_via_r1 -_081ABEB2: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end Task_BagMenu - - thumb_func_start set_callback3_to_bag -set_callback3_to_bag: @ 81ABECC - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl bag_menu_add_pocket_scroll_arrow_indicators_maybe - bl bag_menu_add_list_scroll_arrow_indicators_maybe - movs r0, 0x3 - bl ClearWindowTilemap - movs r0, 0x4 - bl ClearWindowTilemap - movs r0, 0x1 - bl PutWindowTilemap - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =Task_BagMenu - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end set_callback3_to_bag - - thumb_func_start GetSwitchBagPocketDirection -GetSwitchBagPocketDirection: @ 81ABF10 - push {lr} - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r1, =0x0000081b - adds r0, r1 - ldrb r1, [r0] - movs r0, 0xF - ands r0, r1 - cmp r0, 0 - bne _081ABF6A - bl GetLRKeysState - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _081ABF3C - cmp r2, 0x1 - bne _081ABF54 -_081ABF3C: - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - b _081ABF6C - .pool -_081ABF54: - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _081ABF60 - cmp r2, 0x2 - bne _081ABF6A -_081ABF60: - movs r0, 0x5 - bl PlaySE - movs r0, 0x2 - b _081ABF6C -_081ABF6A: - movs r0, 0 -_081ABF6C: - pop {r1} - bx r1 - thumb_func_end GetSwitchBagPocketDirection - - thumb_func_start ChangeBagPocketId -@ void ChangeBagPocketId(u8 *bagPocketId, u8 deltaBagPocketId) -ChangeBagPocketId: @ 81ABF70 - push {r4,lr} - adds r2, r0, 0 - lsls r1, 24 - lsrs r4, r1, 24 - asrs r1, 24 - cmp r1, 0x1 - bne _081ABF88 - ldrb r0, [r2] - cmp r0, 0x4 - bne _081ABF88 - movs r0, 0 - b _081ABFA0 -_081ABF88: - lsls r0, r4, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - ldrb r3, [r2] - cmp r0, r1 - bne _081ABF9E - cmp r3, 0 - bne _081ABF9E - movs r0, 0x4 - b _081ABFA0 -_081ABF9E: - adds r0, r3, r4 -_081ABFA0: - strb r0, [r2] - pop {r4} - pop {r0} - bx r0 - thumb_func_end ChangeBagPocketId - - thumb_func_start SwitchBagPocket -@ void SwitchBagPocket(u8 taskId, u16 deltaBagPocketId, u16 a3) -SwitchBagPocket: @ 81ABFA8 - push {r4-r6,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 16 - lsrs r5, r1, 16 - lsls r2, 16 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - movs r0, 0 - strh r0, [r4, 0x1A] - strh r0, [r4, 0x18] - strh r5, [r4, 0x16] - cmp r2, 0 - bne _081AC026 - movs r0, 0 - bl ClearWindowTilemap - movs r0, 0x1 - bl ClearWindowTilemap - ldrb r0, [r4] - ldr r3, =gUnknown_0203CE58 - ldrb r2, [r3, 0x5] - lsls r2, 1 - adds r1, r3, 0 - adds r1, 0x12 - adds r1, r2, r1 - adds r3, 0x8 - adds r2, r3 - bl sub_81AE6C8 - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldr r3, =gSprites - ldr r0, =gUnknown_0203CE54 - ldr r2, [r0] - ldr r1, =0x0000081b - adds r0, r2, r1 - ldrb r1, [r0] - lsls r1, 26 - lsrs r1, 30 - movs r0, 0x1 - eors r0, r1 - adds r2, r0 - ldr r0, =0x00000806 - adds r2, r0 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - bl sub_81AB824 -_081AC026: - ldr r4, =gUnknown_0203CE58 - ldrb r1, [r4, 0x5] - add r0, sp, 0x8 - strb r1, [r0] - lsls r1, r5, 24 - asrs r1, 24 - bl ChangeBagPocketId - lsls r0, r5, 16 - asrs r1, r0, 16 - adds r5, r0, 0 - cmp r1, 0x1 - bne _081AC07C - ldr r2, =gUnknown_085E91FC - ldrb r0, [r4, 0x5] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - add r1, sp, 0x8 - ldrb r1, [r1] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl bag_menu_print_pocket_names - movs r0, 0 - bl bag_menu_copy_pocket_name_to_window - b _081AC09A - .pool -_081AC07C: - ldr r2, =gUnknown_085E91FC - add r0, sp, 0x8 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - ldrb r1, [r4, 0x5] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl bag_menu_print_pocket_names - movs r0, 0x8 - bl bag_menu_copy_pocket_name_to_window -_081AC09A: - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - movs r1, 0 - bl bag_menu_draw_pocket_indicator_square - add r0, sp, 0x8 - ldrb r0, [r0] - movs r1, 0x1 - bl bag_menu_draw_pocket_indicator_square - movs r0, 0xF - str r0, [sp] - movs r0, 0x10 - str r0, [sp, 0x4] - movs r0, 0x2 - movs r1, 0xB - movs r2, 0xE - movs r3, 0x2 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - add r0, sp, 0x8 - ldrb r0, [r0] - movs r1, 0x1 - bl SetBagVisualPocketId - movs r0, 0x1 - bl RemoveBagObject - asrs r0, r5, 16 - bl AddSwitchPocketRotatingBallObject - ldr r1, =sub_81AC10C - ldr r2, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r2 - ldr r2, [r0] - adds r0, r6, 0 - bl SetTaskFuncWithFollowupFunc - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end SwitchBagPocket - - thumb_func_start sub_81AC10C -sub_81AC10C: @ 81AC10C - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r6, r0, r1 - bl sub_81221AC - lsls r0, 24 - cmp r0, 0 - bne _081AC184 - bl IsWallysBag - lsls r0, 24 - cmp r0, 0 - bne _081AC184 - bl GetSwitchBagPocketDirection - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081AC148 - cmp r0, 0x2 - beq _081AC164 - b _081AC184 - .pool -_081AC148: - ldr r0, =gUnknown_0203CE5D - movs r1, 0x16 - ldrsb r1, [r6, r1] - bl ChangeBagPocketId - adds r0, r7, 0 - bl SwitchTaskToFollowupFunc - movs r1, 0x1 - negs r1, r1 - adds r0, r7, 0 - b _081AC178 - .pool -_081AC164: - ldr r0, =gUnknown_0203CE5D - movs r1, 0x16 - ldrsb r1, [r6, r1] - bl ChangeBagPocketId - adds r0, r7, 0 - bl SwitchTaskToFollowupFunc - adds r0, r7, 0 - movs r1, 0x1 -_081AC178: - movs r2, 0x1 - bl SwitchBagPocket - b _081AC22E - .pool -_081AC184: - movs r1, 0x1A - ldrsh r0, [r6, r1] - cmp r0, 0 - beq _081AC192 - cmp r0, 0x1 - beq _081AC1DC - b _081AC22E -_081AC192: - ldrb r0, [r6, 0x18] - bl sub_81AC23C - ldrh r0, [r6, 0x18] - adds r1, r0, 0x1 - strh r1, [r6, 0x18] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081AC1CC - movs r2, 0x16 - ldrsh r0, [r6, r2] - cmp r0, 0x1 - bne _081AC1BC - lsls r0, r1, 16 - asrs r0, 17 - lsls r0, 24 - lsrs r0, 24 - bl bag_menu_copy_pocket_name_to_window - b _081AC1CC -_081AC1BC: - lsls r1, 16 - asrs r1, 17 - movs r0, 0x8 - subs r0, r1 - lsls r0, 24 - lsrs r0, 24 - bl bag_menu_copy_pocket_name_to_window -_081AC1CC: - movs r1, 0x18 - ldrsh r0, [r6, r1] - cmp r0, 0x10 - bne _081AC22E - ldrh r0, [r6, 0x1A] - adds r0, 0x1 - strh r0, [r6, 0x1A] - b _081AC22E -_081AC1DC: - ldr r4, =gUnknown_0203CE5D - movs r1, 0x16 - ldrsb r1, [r6, r1] - adds r0, r4, 0 - bl ChangeBagPocketId - subs r5, r4, 0x5 - ldrb r0, [r5, 0x5] - bl load_bag_item_list_buffers - ldr r0, =gUnknown_03006310 - ldrb r2, [r5, 0x5] - lsls r2, 1 - adds r1, r4, 0 - adds r1, 0xD - adds r1, r2, r1 - ldrh r1, [r1] - adds r4, 0x3 - adds r2, r4 - ldrh r2, [r2] - bl ListMenuInit - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6] - movs r0, 0x1 - bl PutWindowTilemap - movs r0, 0x2 - bl PutWindowTilemap - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - bl bag_menu_add_pocket_scroll_arrow_indicators_maybe - bl bag_menu_add_list_scroll_arrow_indicators_maybe - adds r0, r7, 0 - bl SwitchTaskToFollowupFunc -_081AC22E: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AC10C - - thumb_func_start sub_81AC23C -sub_81AC23C: @ 81AC23C - push {lr} - sub sp, 0x8 - adds r3, r0, 0 - lsls r3, 24 - movs r0, 0x80 - lsls r0, 18 - adds r3, r0 - lsrs r3, 24 - movs r0, 0xF - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - movs r0, 0x2 - movs r1, 0x11 - movs r2, 0xE - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0x8 - pop {r0} - bx r0 - thumb_func_end sub_81AC23C - - thumb_func_start bag_menu_draw_pocket_indicator_square -@ void bag_menu_draw_pocket_indicator_square(char x, int is_current_bag) -bag_menu_draw_pocket_indicator_square: @ 81AC26C - push {lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - cmp r1, 0 - bne _081AC298 - ldr r1, =0x00001017 - adds r2, r0, 0x5 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0x1 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x2 - movs r3, 0x3 - bl FillBgTilemapBufferRect_Palette0 - b _081AC2AE - .pool -_081AC298: - ldr r1, =0x0000102b - adds r2, r0, 0x5 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0x1 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x2 - movs r3, 0x3 - bl FillBgTilemapBufferRect_Palette0 -_081AC2AE: - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0x8 - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_draw_pocket_indicator_square - - thumb_func_start sub_81AC2C0 -sub_81AC2C0: @ 81AC2C0 - push {lr} - ldr r1, =gUnknown_0203CE58 - ldrb r0, [r1, 0x4] - cmp r0, 0x1 - bhi _081AC2E0 - ldrb r0, [r1, 0x5] - subs r0, 0x2 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bls _081AC2E0 - movs r0, 0x1 - b _081AC2E2 - .pool -_081AC2E0: - movs r0, 0 -_081AC2E2: - pop {r1} - bx r1 - thumb_func_end sub_81AC2C0 - - thumb_func_start bag_menu_swap_items -bag_menu_swap_items: @ 81AC2E8 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x14 - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - mov r9, r0 - adds r6, r4, r0 - ldrb r0, [r6] - movs r1, 0x10 - movs r2, 0x1 - bl sub_81AF15C - ldr r3, =gUnknown_0203CE58 - ldrb r0, [r3, 0x5] - lsls r0, 1 - adds r2, r3, 0 - adds r2, 0x12 - adds r2, r0, r2 - adds r1, r3, 0 - adds r1, 0x8 - adds r0, r1 - ldrh r1, [r0] - ldrh r2, [r2] - adds r1, r2 - strh r1, [r6, 0x2] - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r2, =0x0000081a - adds r0, r2 - movs r5, 0 - strb r1, [r0] - ldrb r0, [r3, 0x5] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r6, 0x2] - bl BagGetItemIdByPocketPosition - lsls r0, 16 - lsrs r0, 16 - ldr r1, =gStringVar1 - bl CopyItemName - ldr r0, =gStringVar4 - mov r8, r0 - ldr r1, =gUnknown_085E8DFE - bl StringExpandPlaceholders - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x1 - str r0, [sp] - str r5, [sp, 0x4] - str r5, [sp, 0x8] - str r5, [sp, 0xC] - str r5, [sp, 0x10] - movs r1, 0x1 - mov r2, r8 - movs r3, 0x3 - bl bag_menu_print - ldrb r0, [r6, 0x2] - bl sub_80D4FEC - bl sub_81AB89C - ldrb r0, [r6] - movs r1, 0x2 - bl bag_menu_print_cursor_ - movs r2, 0x8 - negs r2, r2 - add r9, r2 - add r4, r9 - ldr r0, =sub_81AC3C0 - str r0, [r4] - add sp, 0x14 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - 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 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081AC48E - ldr r0, =gMain - mov r8, r0 - ldrh r1, [r0, 0x2E] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _081AC418 - movs r0, 0x5 - bl PlaySE - ldrb r0, [r4] - ldr r3, =gUnknown_0203CE58 - ldrb r2, [r3, 0x5] - lsls r2, 1 - adds r1, r3, 0 - adds r1, 0x12 - adds r1, r2, r1 - adds r3, 0x8 - adds r2, r3 - bl get_coro_args_x18_x1A - b _081AC472 - .pool -_081AC418: - ldrb r0, [r4] - bl ListMenuHandleInput - adds r7, r0, 0 - ldrb r0, [r4] - ldr r5, =gUnknown_0203CE58 - ldrb r2, [r5, 0x5] - lsls r2, 1 - adds r1, r5, 0 - adds r1, 0x12 - adds r1, r2, r1 - adds r4, r5, 0 - adds r4, 0x8 - adds r2, r4 - bl get_coro_args_x18_x1A - movs r0, 0 - bl sub_80D4FC8 - ldrb r0, [r5, 0x5] - lsls r0, 1 - adds r0, r4 - ldrb r0, [r0] - bl sub_80D4FEC - movs r0, 0x2 - negs r0, r0 - cmp r7, r0 - beq _081AC460 - adds r0, 0x1 - cmp r7, r0 - bne _081AC482 - b _081AC48E - .pool -_081AC460: - movs r0, 0x5 - bl PlaySE - mov r0, r8 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081AC47A -_081AC472: - adds r0, r6, 0 - bl sub_81AC498 - b _081AC48E -_081AC47A: - adds r0, r6, 0 - bl sub_81AC590 - b _081AC48E -_081AC482: - movs r0, 0x5 - bl PlaySE - adds r0, r6, 0 - bl sub_81AC498 -_081AC48E: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81AC3C0 - - thumb_func_start sub_81AC498 -sub_81AC498: @ 81AC498 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r3, r0, 24 - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 3 - mov r10, r0 - ldr r0, =gTasks + 0x8 - add r0, r10 - mov r9, r0 - ldr r5, =gUnknown_0203CE58 - ldrb r6, [r5, 0x5] - lsls r1, r6, 1 - adds r0, r5, 0 - adds r0, 0x12 - adds r0, r1 - mov r8, r0 - ldr r2, =gUnknown_0203CE60 - adds r7, r1, r2 - ldrh r0, [r7] - mov r1, r8 - ldrh r1, [r1] - adds r0, r1 - lsls r0, 16 - lsrs r4, r0, 16 - mov r0, r9 - movs r1, 0x2 - ldrsh r2, [r0, r1] - cmp r2, r4 - beq _081AC4E2 - subs r0, r4, 0x1 - cmp r2, r0 - bne _081AC4F8 -_081AC4E2: - adds r0, r3, 0 - bl sub_81AC590 - b _081AC566 - .pool -_081AC4F8: - ldr r1, =gBagPockets - lsls r0, r6, 3 - adds r0, r1 - ldr r0, [r0] - adds r1, r2, 0 - adds r2, r4, 0 - bl sub_80D702C - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r2, =0x0000081a - adds r0, r2 - movs r1, 0xFF - strb r1, [r0] - mov r1, r9 - ldrb r0, [r1] - mov r1, r8 - adds r2, r7, 0 - bl sub_81AE6C8 - mov r2, r9 - movs r1, 0x2 - ldrsh r0, [r2, r1] - cmp r0, r4 - bge _081AC538 - ldrb r1, [r5, 0x5] - lsls r1, 1 - ldr r2, =gUnknown_0203CE60 - adds r1, r2 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] -_081AC538: - ldrb r0, [r5, 0x5] - bl load_bag_item_list_buffers - ldr r0, =gUnknown_03006310 - mov r2, r8 - ldrh r1, [r2] - ldrh r2, [r7] - bl ListMenuInit - lsls r0, 24 - lsrs r0, 24 - mov r1, r9 - strh r0, [r1] - movs r0, 0x1 - bl sub_80D4FC8 - bl bag_menu_add_list_scroll_arrow_indicators_maybe - ldr r0, =gTasks + 0x8 - subs r0, 0x8 - add r0, r10 - ldr r1, =Task_BagMenu - str r1, [r0] -_081AC566: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AC498 - - thumb_func_start sub_81AC590 -sub_81AC590: @ 81AC590 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - mov r9, r1 - ldr r0, =gTasks + 0x8 - mov r10, r0 - mov r7, r9 - add r7, r10 - ldr r4, =gUnknown_0203CE58 - ldrb r0, [r4, 0x5] - lsls r0, 1 - adds r1, r4, 0 - adds r1, 0x12 - adds r6, r0, r1 - movs r1, 0x8 - adds r1, r4 - mov r8, r1 - adds r5, r0, r1 - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r1, =0x0000081a - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldrb r0, [r7] - adds r1, r6, 0 - adds r2, r5, 0 - bl sub_81AE6C8 - movs r0, 0x2 - ldrsh r2, [r7, r0] - ldrh r0, [r6] - ldrh r1, [r5] - adds r0, r1 - cmp r2, r0 - bge _081AC5F2 - ldrb r1, [r4, 0x5] - lsls r1, 1 - add r1, r8 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] -_081AC5F2: - ldrb r0, [r4, 0x5] - bl load_bag_item_list_buffers - ldr r0, =gUnknown_03006310 - ldrh r1, [r6] - ldrh r2, [r5] - bl ListMenuInit - lsls r0, 24 - lsrs r0, 24 - strh r0, [r7] - movs r0, 0x1 - bl sub_80D4FC8 - bl bag_menu_add_list_scroll_arrow_indicators_maybe - mov r0, r10 - subs r0, 0x8 - add r0, r9 - ldr r1, =Task_BagMenu - str r1, [r0] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AC590 - - thumb_func_start sub_81AC644 -sub_81AC644: @ 81AC644 - push {r4,r5,lr} - sub sp, 0x14 - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x4] - subs r0, 0x1 - cmp r0, 0x9 - bls _081AC654 - b _081AC82C -_081AC654: - lsls r0, 2 - ldr r1, =_081AC668 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081AC668: - .4byte _081AC690 - .4byte _081AC82C - .4byte _081AC82C - .4byte _081AC82C - .4byte _081AC6E8 - .4byte _081AC82C - .4byte _081AC76C - .4byte _081AC7CC - .4byte _081AC70C - .4byte _081AC690 -_081AC690: - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - bl ItemId_GetBattleUsage - lsls r0, 24 - cmp r0, 0 - beq _081AC6C4 - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_08614042 - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x2 - b _081ACA10 - .pool -_081AC6C4: - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_08614046 - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x1 - b _081ACA10 - .pool -_081AC6E8: - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_08614047 - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x4 - b _081ACA10 - .pool -_081AC70C: - ldr r4, =gUnknown_0203CE7C - ldrh r0, [r4] - bl itemid_is_unique - lsls r0, 24 - cmp r0, 0 - bne _081AC748 - ldrh r0, [r4] - cmp r0, 0xAF - beq _081AC748 - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_0861404B - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x2 - b _081ACA10 - .pool -_081AC748: - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_08614046 - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x1 - b _081ACA10 - .pool -_081AC76C: - ldr r4, =gUnknown_0203CE7C - ldrh r0, [r4] - bl itemid_is_unique - lsls r0, 24 - cmp r0, 0 - bne _081AC7A8 - ldrh r0, [r4] - cmp r0, 0xAF - beq _081AC7A8 - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_0861404D - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x2 - b _081ACA10 - .pool -_081AC7A8: - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_08614046 - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x1 - b _081ACA10 - .pool -_081AC7CC: - ldr r4, =gUnknown_0203CE7C - ldrh r0, [r4] - bl itemid_is_unique - lsls r0, 24 - cmp r0, 0 - bne _081AC808 - ldrh r0, [r4] - cmp r0, 0xAF - beq _081AC808 - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_0861404F - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x2 - b _081ACA10 - .pool -_081AC808: - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_08614046 - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x1 - b _081ACA10 - .pool -_081AC82C: - bl sub_81221AC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081AC840 - bl InUnionRoom - cmp r0, 0x1 - bne _081AC8A4 -_081AC840: - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - cmp r0, 0x4 - beq _081AC856 - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - bl sub_8122148 - lsls r0, 24 - cmp r0, 0 - bne _081AC880 -_081AC856: - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_08614046 - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x1 - b _081ACA10 - .pool -_081AC880: - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_08614044 - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x2 - b _081ACA10 - .pool -_081AC8A4: - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - cmp r0, 0x4 - bls _081AC8AE - b _081ACA12 -_081AC8AE: - lsls r0, 2 - ldr r1, =_081AC8C0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081AC8C0: - .4byte _081AC8D4 - .4byte _081AC9B4 - .4byte _081AC9D8 - .4byte _081AC9FC - .4byte _081AC92C -_081AC8D4: - ldr r4, =gUnknown_0203CE54 - ldr r1, [r4] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r3, =0x00000824 - adds r0, r1, r3 - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x4 - strb r0, [r1] - ldr r0, [r4] - adds r0, r3 - ldr r1, =gUnknown_0861402C - movs r2, 0x4 - bl memcpy - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - bl itemid_is_mail - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081AC90A - b _081ACA12 -_081AC90A: - ldr r0, [r4] - ldr r1, =0x00000824 - adds r0, r1 - movs r1, 0x6 - strb r1, [r0] - b _081ACA12 - .pool -_081AC92C: - ldr r4, =gUnknown_0203CE54 - ldr r1, [r4] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r5, =0x00000824 - adds r0, r1, r5 - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x4 - strb r0, [r1] - ldr r0, [r4] - adds r0, r5 - ldr r1, =gUnknown_08614030 - movs r2, 0x4 - bl memcpy - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00000496 - adds r0, r1 - ldr r2, =gUnknown_0203CE7C - ldrh r0, [r0] - ldrh r1, [r2] - cmp r0, r1 - bne _081AC96C - ldr r0, [r4] - ldr r1, =0x00000825 - adds r0, r1 - movs r1, 0x8 - strb r1, [r0] -_081AC96C: - ldrh r1, [r2] - ldr r0, =0x00000103 - cmp r1, r0 - beq _081AC97A - adds r0, 0xD - cmp r1, r0 - bne _081ACA12 -_081AC97A: - movs r0, 0x6 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - beq _081ACA12 - ldr r0, [r4] - adds r0, r5 - movs r1, 0x7 - strb r1, [r0] - b _081ACA12 - .pool -_081AC9B4: - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_08614034 - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x4 - b _081ACA10 - .pool -_081AC9D8: - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_08614038 - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x4 - b _081ACA10 - .pool -_081AC9FC: - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - movs r0, 0x82 - lsls r0, 4 - adds r2, r1, r0 - ldr r0, =gUnknown_0861403C - str r0, [r2] - ldr r0, =0x00000828 - adds r1, r0 - movs r0, 0x6 -_081ACA10: - strb r0, [r1] -_081ACA12: - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - cmp r0, 0x2 - bne _081ACA50 - movs r0, 0x1 - bl ClearWindowTilemap - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - bl PrintTMHMMoveData - movs r0, 0x3 - bl PutWindowTilemap - movs r0, 0x4 - bl PutWindowTilemap - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - b _081ACA86 - .pool -_081ACA50: - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E8DBE - adds r0, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - str r0, [sp, 0xC] - str r0, [sp, 0x10] - movs r0, 0x1 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0x3 - bl bag_menu_print -_081ACA86: - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r1, =0x00000828 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _081ACAB0 - movs r0, 0 - b _081ACAB6 - .pool -_081ACAB0: - cmp r0, 0x2 - bne _081ACAC4 - movs r0, 0x1 -_081ACAB6: - bl bag_menu_add_window - lsls r0, 24 - lsrs r0, 24 - bl sub_81ACAF8 - b _081ACAEE -_081ACAC4: - cmp r0, 0x4 - bne _081ACADC - movs r0, 0x2 - bl bag_menu_add_window - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - movs r2, 0x2 - bl sub_81ACB54 - b _081ACAEE -_081ACADC: - movs r0, 0x3 - bl bag_menu_add_window - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - movs r2, 0x3 - bl sub_81ACB54 -_081ACAEE: - add sp, 0x14 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81AC644 - - thumb_func_start sub_81ACAF8 -sub_81ACAF8: @ 81ACAF8 - push {r4-r6,lr} - sub sp, 0x14 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - str r0, [sp] - movs r0, 0x10 - str r0, [sp, 0x4] - ldr r6, =gUnknown_0203CE54 - ldr r1, [r6] - ldr r5, =0x00000828 - adds r0, r1, r5 - ldrb r0, [r0] - str r0, [sp, 0x8] - ldr r0, =gUnknown_08613FB4 - str r0, [sp, 0xC] - movs r0, 0x82 - lsls r0, 4 - adds r1, r0 - ldr r0, [r1] - str r0, [sp, 0x10] - adds r0, r4, 0 - movs r1, 0x7 - movs r2, 0x8 - movs r3, 0x1 - bl AddItemMenuActionTextPrinters - ldr r0, [r6] - adds r0, r5 - ldrb r1, [r0] - adds r0, r4, 0 - movs r2, 0 - bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed - add sp, 0x14 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81ACAF8 - - thumb_func_start sub_81ACB54 -sub_81ACB54: @ 81ACB54 - push {r4-r6,lr} - sub sp, 0x14 - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - movs r0, 0x38 - str r0, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - ldr r0, =gUnknown_08613FB4 - str r0, [sp, 0xC] - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - movs r1, 0x82 - lsls r1, 4 - adds r0, r1 - ldr r0, [r0] - str r0, [sp, 0x10] - adds r0, r4, 0 - movs r1, 0x7 - movs r2, 0x8 - movs r3, 0x1 - bl sub_8198DBC - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r1, 0x38 - adds r2, r5, 0 - adds r3, r6, 0 - bl sub_8199944 - add sp, 0x14 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81ACB54 - - thumb_func_start unknown_item_menu_type -unknown_item_menu_type: @ 81ACBB0 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_81AC644 - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r1, =0x00000828 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x2 - bhi _081ACBE8 - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =Task_HandleInBattleItemMenuInput - b _081ACBF4 - .pool -_081ACBE8: - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =Task_HandleOutOfBattleItemMenuInput -_081ACBF4: - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end unknown_item_menu_type - - thumb_func_start Task_HandleInBattleItemMenuInput -Task_HandleInBattleItemMenuInput: @ 81ACC04 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r6, r5, 0 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081ACC6A - bl ProcessMenuInputNoWrapAround - lsls r0, 24 - asrs r4, r0, 24 - movs r0, 0x2 - negs r0, r0 - cmp r4, r0 - beq _081ACC6A - adds r0, 0x1 - cmp r4, r0 - bne _081ACC44 - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_08613FB4 - ldr r1, [r0, 0x24] - adds r0, r5, 0 - bl _call_via_r1 - b _081ACC6A - .pool -_081ACC44: - movs r0, 0x5 - bl PlaySE - ldr r1, =gUnknown_08613FB4 - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - movs r2, 0x82 - lsls r2, 4 - adds r0, r2 - ldr r0, [r0] - adds r0, r4 - ldrb r0, [r0] - lsls r0, 3 - adds r1, 0x4 - adds r0, r1 - ldr r1, [r0] - adds r0, r6, 0 - bl _call_via_r1 -_081ACC6A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end Task_HandleInBattleItemMenuInput - - thumb_func_start Task_HandleOutOfBattleItemMenuInput -Task_HandleOutOfBattleItemMenuInput: @ 81ACC78 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081ACC8C - b _081ACDF0 -_081ACC8C: - bl GetMenuCursorPos - lsls r0, 24 - lsrs r4, r0, 24 - ldr r5, =gMain - ldrh r1, [r5, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081ACCD4 - lsls r0, r4, 24 - asrs r0, 24 - cmp r0, 0 - bgt _081ACCAA - b _081ACDF0 -_081ACCAA: - subs r0, 0x2 - lsls r0, 24 - asrs r0, 24 - bl sub_81ACDFC - lsls r0, 24 - cmp r0, 0 - bne _081ACCBC - b _081ACDF0 -_081ACCBC: - movs r0, 0x5 - bl PlaySE - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - bl sub_8199134 - b _081ACDF0 - .pool -_081ACCD4: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081ACD1C - lsls r0, r4, 24 - asrs r1, r0, 24 - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r2, =0x00000828 - adds r0, r2 - ldrb r0, [r0] - subs r0, 0x2 - cmp r1, r0 - blt _081ACCF2 - b _081ACDF0 -_081ACCF2: - adds r0, r1, 0x2 - lsls r0, 24 - asrs r0, 24 - bl sub_81ACDFC - lsls r0, 24 - cmp r0, 0 - beq _081ACDF0 - movs r0, 0x5 - bl PlaySE - movs r0, 0 - movs r1, 0x1 - bl sub_8199134 - b _081ACDF0 - .pool -_081ACD1C: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _081ACD30 - bl GetLRKeysState - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081ACD58 -_081ACD30: - lsls r0, r4, 24 - asrs r1, r0, 24 - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081ACDF0 - subs r0, r1, 0x1 - lsls r0, 24 - asrs r0, 24 - bl sub_81ACDFC - lsls r0, 24 - cmp r0, 0 - beq _081ACDF0 - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - negs r0, r0 - b _081ACD92 -_081ACD58: - ldrh r1, [r5, 0x2E] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _081ACD6E - bl GetLRKeysState - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _081ACD9A -_081ACD6E: - lsls r0, r4, 24 - asrs r1, r0, 24 - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081ACDF0 - adds r0, r1, 0x1 - lsls r0, 24 - asrs r0, 24 - bl sub_81ACDFC - lsls r0, 24 - cmp r0, 0 - beq _081ACDF0 - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 -_081ACD92: - movs r1, 0 - bl sub_8199134 - b _081ACDF0 -_081ACD9A: - ldrh r1, [r5, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081ACDD8 - movs r0, 0x5 - bl PlaySE - ldr r2, =gUnknown_08613FB4 - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - lsls r1, r4, 24 - asrs r1, 24 - movs r3, 0x82 - lsls r3, 4 - adds r0, r3 - ldr r0, [r0] - adds r0, r1 - ldrb r0, [r0] - lsls r0, 3 - adds r2, 0x4 - adds r0, r2 - ldr r1, [r0] - adds r0, r6, 0 - bl _call_via_r1 - b _081ACDF0 - .pool -_081ACDD8: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081ACDF0 - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_08613FB4 - ldr r1, [r0, 0x24] - adds r0, r6, 0 - bl _call_via_r1 -_081ACDF0: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end Task_HandleOutOfBattleItemMenuInput - - thumb_func_start sub_81ACDFC -sub_81ACDFC: @ 81ACDFC - push {lr} - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - blt _081ACE30 - ldr r0, =gUnknown_0203CE54 - ldr r2, [r0] - ldr r3, =0x00000828 - adds r0, r2, r3 - ldrb r0, [r0] - cmp r1, r0 - bgt _081ACE30 - movs r3, 0x82 - lsls r3, 4 - adds r0, r2, r3 - ldr r0, [r0] - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0xE - beq _081ACE30 - movs r0, 0x1 - b _081ACE32 - .pool -_081ACE30: - movs r0, 0 -_081ACE32: - pop {r1} - bx r1 - thumb_func_end sub_81ACDFC - - thumb_func_start bag_menu_remove_some_window -bag_menu_remove_some_window: @ 81ACE38 - push {lr} - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r1, =0x00000828 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _081ACE58 - movs r0, 0 - bl bag_menu_remove_window - b _081ACE76 - .pool -_081ACE58: - cmp r0, 0x2 - bne _081ACE64 - movs r0, 0x1 - bl bag_menu_remove_window - b _081ACE76 -_081ACE64: - cmp r0, 0x4 - bne _081ACE70 - movs r0, 0x2 - bl bag_menu_remove_window - b _081ACE76 -_081ACE70: - movs r0, 0x3 - bl bag_menu_remove_window -_081ACE76: - pop {r0} - bx r0 - thumb_func_end bag_menu_remove_some_window - - thumb_func_start ItemMenu_UseOutOfBattle -@ void ItemMenu_UseOutOfBattle(u8 taskId) -ItemMenu_UseOutOfBattle: @ 81ACE7C - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r5, =gUnknown_0203CE7C - ldrh r0, [r5] - bl ItemId_GetFieldFunc - cmp r0, 0 - beq _081ACEEE - bl bag_menu_remove_some_window - bl calc_player_party_count - lsls r0, 24 - cmp r0, 0 - bne _081ACEB8 - ldrh r0, [r5] - bl ItemId_GetType - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081ACEB8 - adds r0, r4, 0 - bl bag_menu_print_there_is_no_pokemon - b _081ACEEE - .pool -_081ACEB8: - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - cmp r0, 0x3 - beq _081ACEE8 - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - bl ItemId_GetFieldFunc - adds r1, r0, 0 - adds r0, r4, 0 - bl _call_via_r1 - b _081ACEEE - .pool -_081ACEE8: - adds r0, r4, 0 - bl sub_80FDD10 -_081ACEEE: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end ItemMenu_UseOutOfBattle - - thumb_func_start ItemMenu_Toss -ItemMenu_Toss: @ 81ACEF4 - push {r4-r7,lr} - sub sp, 0x14 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r6, r0, 3 - ldr r7, =gTasks + 0x8 - adds r4, r6, r7 - bl bag_menu_remove_some_window - movs r0, 0x1 - strh r0, [r4, 0x10] - movs r1, 0x4 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - bne _081ACF24 - adds r0, r5, 0 - bl BagMenuConfirmToss - b _081ACF6A - .pool -_081ACF24: - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E8EE0 - adds r0, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - str r0, [sp, 0xC] - str r0, [sp, 0x10] - movs r0, 0x1 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0x3 - bl bag_menu_print - movs r0, 0x7 - bl sub_81ABC3C - adds r0, r7, 0 - subs r0, 0x8 - adds r0, r6, r0 - ldr r1, =Task_ChooseHowManyToToss - str r1, [r0] -_081ACF6A: - add sp, 0x14 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end ItemMenu_Toss - - thumb_func_start BagMenuConfirmToss -BagMenuConfirmToss: @ 81ACF88 - push {r4,r5,lr} - sub sp, 0x14 - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r0, =gStringVar2 - movs r2, 0x10 - ldrsh r1, [r4, r2] - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E8F0E - adds r0, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - str r0, [sp, 0xC] - str r0, [sp, 0x10] - movs r0, 0x1 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0x3 - bl bag_menu_print - ldr r2, =gUnknown_08614084 - adds r0, r5, 0 - movs r1, 0x5 - bl bag_menu_yes_no - add sp, 0x14 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end BagMenuConfirmToss - - thumb_func_start BagMenuCancelToss -BagMenuCancelToss: @ 81AD010 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - movs r1, 0x2 - ldrsh r0, [r4, r1] - bl bag_menu_print_description_box_text - ldrb r0, [r4] - movs r1, 0 - bl bag_menu_print_cursor_ - adds r0, r5, 0 - bl set_callback3_to_bag - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end BagMenuCancelToss - - thumb_func_start Task_ChooseHowManyToToss -Task_ChooseHowManyToToss: @ 81AD044 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r6, r5, 0 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - adds r0, r4, 0 - adds r0, 0x10 - ldrh r1, [r4, 0x4] - bl AdjustQuantityAccordingToDPadInput - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081AD088 - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r1, =0x00000817 - adds r0, r1 - ldrb r0, [r0] - movs r2, 0x10 - ldrsh r1, [r4, r2] - bl sub_81ABC54 - b _081AD0C6 - .pool -_081AD088: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081AD0AC - movs r0, 0x5 - bl PlaySE - movs r0, 0x7 - bl bag_menu_remove_window - adds r0, r5, 0 - bl BagMenuConfirmToss - b _081AD0C6 - .pool -_081AD0AC: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081AD0C6 - movs r0, 0x5 - bl PlaySE - movs r0, 0x7 - bl bag_menu_remove_window - adds r0, r6, 0 - bl BagMenuCancelToss -_081AD0C6: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end Task_ChooseHowManyToToss - - thumb_func_start BagMenuActuallyToss -BagMenuActuallyToss: @ 81AD0CC - push {r4-r6,lr} - sub sp, 0x14 - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r5, =gTasks + 0x8 - adds r6, r4, r5 - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r0, =gStringVar2 - movs r2, 0x10 - ldrsh r1, [r6, r2] - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r6, =gStringVar4 - ldr r1, =gUnknown_085E8EF9 - adds r0, r6, 0 - bl StringExpandPlaceholders - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - str r0, [sp, 0xC] - str r0, [sp, 0x10] - movs r0, 0x1 - movs r1, 0x1 - adds r2, r6, 0 - movs r3, 0x3 - bl bag_menu_print - subs r5, 0x8 - adds r4, r5 - ldr r0, =Task_ActuallyToss - str r0, [r4] - add sp, 0x14 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end BagMenuActuallyToss - - thumb_func_start Task_ActuallyToss -Task_ActuallyToss: @ 81AD150 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r5, r0, r1 - ldr r4, =gUnknown_0203CE58 - ldrb r0, [r4, 0x5] - lsls r0, 1 - adds r1, r4, 0 - adds r1, 0x12 - adds r1, r0 - mov r8, r1 - adds r1, r4, 0 - adds r1, 0x8 - adds r7, r0, r1 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _081AD1CE - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - ldrh r1, [r5, 0x10] - bl RemoveBagItem - ldrb r0, [r5] - mov r1, r8 - adds r2, r7, 0 - bl sub_81AE6C8 - ldrb r0, [r4, 0x5] - bl sub_81AB9A8 - ldrb r0, [r4, 0x5] - bl sub_81ABA88 - ldrb r0, [r4, 0x5] - bl load_bag_item_list_buffers - ldr r0, =gUnknown_03006310 - mov r2, r8 - ldrh r1, [r2] - ldrh r2, [r7] - bl ListMenuInit - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5] - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - adds r0, r6, 0 - bl set_callback3_to_bag -_081AD1CE: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end Task_ActuallyToss - - thumb_func_start ItemMenu_Register -ItemMenu_Register: @ 81AD1EC - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r7, r0, r1 - ldr r0, =gUnknown_0203CE58 - ldrb r1, [r0, 0x5] - lsls r1, 1 - adds r2, r0, 0 - adds r2, 0x12 - adds r6, r1, r2 - adds r0, 0x8 - adds r5, r1, r0 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =0x00000496 - adds r1, r0, r2 - ldr r0, =gUnknown_0203CE7C - ldrh r2, [r0] - ldrh r0, [r1] - cmp r0, r2 - bne _081AD238 - movs r0, 0 - strh r0, [r1] - b _081AD23A - .pool -_081AD238: - strh r2, [r1] -_081AD23A: - ldrb r0, [r7] - adds r1, r6, 0 - adds r2, r5, 0 - bl sub_81AE6C8 - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - bl load_bag_item_list_buffers - ldr r0, =gUnknown_03006310 - ldrh r1, [r6] - ldrh r2, [r5] - bl ListMenuInit - lsls r0, 24 - lsrs r0, 24 - strh r0, [r7] - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - adds r0, r4, 0 - bl ItemMenu_Cancel - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end ItemMenu_Register - - thumb_func_start ItemMenu_Give -ItemMenu_Give: @ 81AD278 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r6, r4, 0 - bl bag_menu_remove_some_window - ldr r5, =gUnknown_0203CE7C - ldrh r0, [r5] - bl itemid_80BF6D8_mail_related - lsls r0, 24 - cmp r0, 0 - bne _081AD2AC - ldr r2, =gUnknown_085E8DCE - ldr r3, =sub_81AD350 - adds r0, r4, 0 - movs r1, 0x1 - bl DisplayItemMessage - b _081AD2EA - .pool -_081AD2AC: - ldrh r0, [r5] - bl itemid_is_unique - lsls r0, 24 - cmp r0, 0 - bne _081AD2E4 - bl calc_player_party_count - lsls r0, 24 - cmp r0, 0 - bne _081AD2CA - adds r0, r4, 0 - bl bag_menu_print_there_is_no_pokemon - b _081AD2EA -_081AD2CA: - ldr r0, =gUnknown_0203CE54 - ldr r1, [r0] - ldr r0, =sub_81B7F60 - str r0, [r1] - adds r0, r4, 0 - bl unknown_ItemMenu_Confirm - b _081AD2EA - .pool -_081AD2E4: - adds r0, r6, 0 - bl bag_menu_print_cant_be_held_msg -_081AD2EA: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end ItemMenu_Give - - thumb_func_start bag_menu_print_there_is_no_pokemon -bag_menu_print_there_is_no_pokemon: @ 81AD2F0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gUnknown_085E8DE9 - ldr r3, =sub_81AD350 - movs r1, 0x1 - bl DisplayItemMessage - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_print_there_is_no_pokemon - - thumb_func_start bag_menu_print_cant_be_held_msg -bag_menu_print_cant_be_held_msg: @ 81AD30C - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r5, =gStringVar4 - ldr r1, =gUnknown_085E8E11 - adds r0, r5, 0 - bl StringExpandPlaceholders - ldr r3, =sub_81AD350 - adds r0, r4, 0 - movs r1, 0x1 - adds r2, r5, 0 - bl DisplayItemMessage - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_print_cant_be_held_msg - - thumb_func_start sub_81AD350 -sub_81AD350: @ 81AD350 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081AD36E - movs r0, 0x5 - bl PlaySE - adds r0, r4, 0 - bl bag_menu_inits_lists_menu -_081AD36E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AD350 - - thumb_func_start ItemMenu_CheckTag -ItemMenu_CheckTag: @ 81AD378 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0203CE54 - ldr r2, [r1] - ldr r1, =sub_8177C14 - str r1, [r2] - bl unknown_ItemMenu_Confirm - pop {r0} - bx r0 - .pool - thumb_func_end ItemMenu_CheckTag - - thumb_func_start ItemMenu_Cancel -ItemMenu_Cancel: @ 81AD398 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - bl bag_menu_remove_some_window - movs r1, 0x2 - ldrsh r0, [r4, r1] - bl bag_menu_print_description_box_text - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - ldrb r0, [r4] - movs r1, 0 - bl bag_menu_print_cursor_ - adds r0, r5, 0 - bl set_callback3_to_bag - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ItemMenu_Cancel - - thumb_func_start ItemMenu_UseInBattle -ItemMenu_UseInBattle: @ 81AD3DC - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =gUnknown_0203CE7C - ldrh r0, [r4] - bl ItemId_GetBattleFunc - cmp r0, 0 - beq _081AD400 - bl bag_menu_remove_some_window - ldrh r0, [r4] - bl ItemId_GetBattleFunc - adds r1, r0, 0 - adds r0, r5, 0 - bl _call_via_r1 -_081AD400: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ItemMenu_UseInBattle - - thumb_func_start bag_menu_mail_related -bag_menu_mail_related: @ 81AD40C - push {lr} - movs r0, 0xC - movs r1, 0x5 - movs r2, 0 - bl GoToBagMenu - pop {r0} - bx r0 - thumb_func_end bag_menu_mail_related - - thumb_func_start item_menu_type_2 -item_menu_type_2: @ 81AD41C - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =gUnknown_0203CE7C - ldrh r0, [r4] - bl itemid_80BF6D8_mail_related - lsls r0, 24 - cmp r0, 0 - bne _081AD44C - ldr r2, =gUnknown_085E8DCE - ldr r3, =sub_81AD350 - adds r0, r5, 0 - movs r1, 0x1 - bl DisplayItemMessage - b _081AD4AE - .pool -_081AD44C: - ldrh r0, [r4] - bl sub_8122148 - lsls r0, 24 - cmp r0, 0 - bne _081AD488 - ldrh r0, [r4] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E8E27 - adds r0, r4, 0 - bl StringExpandPlaceholders - ldr r3, =sub_81AD350 - adds r0, r5, 0 - movs r1, 0x1 - adds r2, r4, 0 - bl DisplayItemMessage - b _081AD4AE - .pool -_081AD488: - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - cmp r0, 0x4 - beq _081AD4A8 - ldrh r0, [r4] - bl itemid_is_unique - lsls r0, 24 - cmp r0, 0 - bne _081AD4A8 - adds r0, r5, 0 - bl unknown_ItemMenu_Confirm - b _081AD4AE - .pool -_081AD4A8: - adds r0, r5, 0 - bl bag_menu_print_cant_be_held_msg -_081AD4AE: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end item_menu_type_2 - - thumb_func_start item_menu_type_b -item_menu_type_b: @ 81AD4B4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r5, =gUnknown_0203CE7C - ldrh r0, [r5] - bl itemid_is_mail - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081AD4E4 - ldr r2, =gUnknown_085E8DCE - ldr r3, =sub_81AD350 - adds r0, r4, 0 - movs r1, 0x1 - bl DisplayItemMessage - b _081AD51A - .pool -_081AD4E4: - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x5] - cmp r0, 0x4 - beq _081AD514 - ldrh r0, [r5] - bl itemid_is_unique - lsls r0, 24 - cmp r0, 0 - bne _081AD514 - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =unknown_ItemMenu_Confirm - str r0, [r1] - b _081AD51A - .pool -_081AD514: - adds r0, r4, 0 - bl bag_menu_print_cant_be_held_msg -_081AD51A: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end item_menu_type_b - - thumb_func_start UseRegisteredKeyItemOnField -@ bool8 UseRegisteredKeyItemOnField() -UseRegisteredKeyItemOnField: @ 81AD520 - push {r4-r7,lr} - bl InUnionRoom - cmp r0, 0x1 - beq _081AD54C - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - bne _081AD54C - bl InBattlePike - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0 - bne _081AD54C - bl in_multi_battle_room_with_var_condition - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081AD550 -_081AD54C: - movs r0, 0 - b _081AD5D2 -_081AD550: - bl HideMapNamePopUpWindow - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY_ScreenOff - ldr r4, =gSaveBlock1Ptr - ldr r0, [r4] - ldr r5, =0x00000496 - adds r1, r0, r5 - ldrh r0, [r1] - cmp r0, 0 - beq _081AD5CA - movs r1, 0x1 - bl CheckBagHasItem - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x1 - bne _081AD5C4 - bl script_env_2_enable - bl player_bitmagic - bl sub_808B864 - bl sub_808BCF4 - ldr r2, =gUnknown_0203CE7C - ldr r0, [r4] - adds r0, r5 - ldrh r1, [r0] - strh r1, [r2] - ldrh r0, [r0] - bl ItemId_GetFieldFunc - movs r1, 0x8 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r6, [r1, 0xE] - b _081AD5D0 - .pool -_081AD5C4: - ldr r0, [r4] - adds r0, r5 - strh r7, [r0] -_081AD5CA: - ldr r0, =gUnknown_082736B3 - bl script_env_1_execute_new_script -_081AD5D0: - movs r0, 0x1 -_081AD5D2: - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end UseRegisteredKeyItemOnField - - thumb_func_start display_sell_item_ask_str -@ void display_sell_item_ask_str(int a1) -display_sell_item_ask_str: @ 81AD5DC - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r7, r5, 0 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - ldr r6, =gUnknown_0203CE7C - ldrh r0, [r6] - bl itemid_get_market_price - lsls r0, 16 - cmp r0, 0 - bne _081AD634 - ldrh r0, [r6] - ldr r1, =gStringVar2 - bl CopyItemName - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E960F - adds r0, r4, 0 - bl StringExpandPlaceholders - ldr r3, =bag_menu_inits_lists_menu - adds r0, r5, 0 - movs r1, 0x1 - adds r2, r4, 0 - bl DisplayItemMessage - b _081AD66A - .pool -_081AD634: - movs r0, 0x1 - strh r0, [r4, 0x10] - movs r1, 0x4 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - bne _081AD64C - bl bag_menu_add_money_window - adds r0, r5, 0 - bl sub_81AD680 - b _081AD66A -_081AD64C: - ldrh r0, [r6] - ldr r1, =gStringVar2 - bl CopyItemName - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E962F - adds r0, r4, 0 - bl StringExpandPlaceholders - ldr r3, =sub_81AD730 - adds r0, r7, 0 - movs r1, 0x1 - adds r2, r4, 0 - bl DisplayItemMessage -_081AD66A: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end display_sell_item_ask_str - - thumb_func_start sub_81AD680 -sub_81AD680: @ 81AD680 - push {r4-r6,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - ldr r6, =gStringVar1 - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - bl itemid_get_market_price - lsls r0, 16 - lsrs r0, 17 - movs r2, 0x10 - ldrsh r1, [r4, r2] - muls r1, r0 - adds r0, r6, 0 - movs r2, 0 - movs r3, 0x6 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9654 - adds r0, r4, 0 - bl StringExpandPlaceholders - ldr r3, =sub_81AD6E4 - adds r0, r5, 0 - movs r1, 0x1 - adds r2, r4, 0 - bl DisplayItemMessage - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AD680 - - thumb_func_start sub_81AD6E4 -sub_81AD6E4: @ 81AD6E4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gUnknown_0861408C - movs r1, 0x6 - bl bag_menu_yes_no - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AD6E4 - - thumb_func_start sub_81AD6FC -sub_81AD6FC: @ 81AD6FC - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - bl bag_menu_remove_money_window - movs r0, 0x4 - bl bag_menu_RemoveBagItem_message_window - ldrb r0, [r4] - movs r1, 0 - bl bag_menu_print_cursor_ - adds r0, r5, 0 - bl set_callback3_to_bag - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AD6FC - - thumb_func_start sub_81AD730 -sub_81AD730: @ 81AD730 - push {r4-r6,lr} - mov r6, r8 - push {r6} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r6, =gTasks + 0x8 - adds r0, r4, r6 - mov r8, r0 - movs r0, 0x8 - bl bag_menu_add_window - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - bl itemid_get_market_price - lsls r0, 16 - lsrs r0, 17 - mov r2, r8 - movs r3, 0x10 - ldrsh r1, [r2, r3] - adds r2, r0, 0 - muls r2, r1 - adds r0, r5, 0 - movs r1, 0x1 - bl sub_81ABCC0 - bl bag_menu_add_money_window - subs r6, 0x8 - adds r4, r6 - ldr r0, =sub_81AD794 - str r0, [r4] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AD730 - - thumb_func_start sub_81AD794 -sub_81AD794: @ 81AD794 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r6, r0, r1 - adds r0, r6, 0 - adds r0, 0x10 - ldrh r1, [r6, 0x4] - bl AdjustQuantityAccordingToDPadInput - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081AD7F4 - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r1, =0x00000818 - adds r0, r1 - ldrb r4, [r0] - movs r2, 0x10 - ldrsh r5, [r6, r2] - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - bl itemid_get_market_price - lsls r0, 16 - lsrs r0, 17 - movs r2, 0x10 - ldrsh r1, [r6, r2] - adds r2, r0, 0 - muls r2, r1 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_81ABCC0 - b _081AD844 - .pool -_081AD7F4: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081AD818 - movs r0, 0x5 - bl PlaySE - movs r0, 0x8 - bl bag_menu_remove_window - adds r0, r4, 0 - bl sub_81AD680 - b _081AD844 - .pool -_081AD818: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081AD844 - movs r0, 0x5 - bl PlaySE - ldrb r0, [r6] - movs r1, 0 - bl bag_menu_print_cursor_ - bl bag_menu_remove_money_window - movs r0, 0x8 - bl bag_menu_remove_window - movs r0, 0x4 - bl bag_menu_RemoveBagItem_message_window - adds r0, r5, 0 - bl set_callback3_to_bag -_081AD844: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81AD794 - - thumb_func_start sub_81AD84C -sub_81AD84C: @ 81AD84C - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - ldr r6, =gUnknown_0203CE7C - ldrh r0, [r6] - ldr r1, =gStringVar2 - bl CopyItemName - ldr r0, =gStringVar1 - mov r8, r0 - ldrh r0, [r6] - bl itemid_get_market_price - lsls r0, 16 - lsrs r0, 17 - movs r2, 0x10 - ldrsh r1, [r4, r2] - muls r1, r0 - mov r0, r8 - movs r2, 0 - movs r3, 0x6 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9677 - adds r0, r4, 0 - bl StringExpandPlaceholders - ldr r3, =sub_81AD8C8 - adds r0, r5, 0 - movs r1, 0x1 - adds r2, r4, 0 - bl DisplayItemMessage - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AD84C - - thumb_func_start sub_81AD8C8 -sub_81AD8C8: @ 81AD8C8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - lsls r6, r0, 2 - adds r6, r0 - lsls r6, 3 - ldr r0, =gTasks + 0x8 - adds r0, r6 - mov r10, r0 - ldr r7, =gUnknown_0203CE58 - ldrb r5, [r7, 0x5] - lsls r5, 1 - movs r1, 0x12 - adds r1, r7 - mov r9, r1 - add r9, r5 - adds r0, r7, 0 - adds r0, 0x8 - adds r5, r0 - movs r0, 0x5F - bl PlaySE - ldr r2, =gUnknown_0203CE7C - mov r8, r2 - ldrh r0, [r2] - mov r3, r10 - ldrh r1, [r3, 0x10] - bl RemoveBagItem - ldr r0, =gSaveBlock1Ptr - ldr r4, [r0] - movs r1, 0x92 - lsls r1, 3 - adds r4, r1 - mov r2, r8 - ldrh r0, [r2] - bl itemid_get_market_price - lsls r0, 16 - lsrs r0, 17 - mov r3, r10 - movs r2, 0x10 - ldrsh r1, [r3, r2] - muls r1, r0 - adds r0, r4, 0 - bl add_money - mov r3, r10 - ldrb r0, [r3] - mov r1, r9 - adds r2, r5, 0 - bl sub_81AE6C8 - ldrb r0, [r7, 0x5] - bl sub_81AB9A8 - ldrb r0, [r7, 0x5] - bl sub_81ABA88 - ldrb r0, [r7, 0x5] - bl load_bag_item_list_buffers - ldr r0, =gUnknown_03006310 - mov r2, r9 - ldrh r1, [r2] - ldrh r2, [r5] - bl ListMenuInit - lsls r0, 24 - lsrs r0, 24 - mov r3, r10 - strh r0, [r3] - movs r1, 0x2 - bl bag_menu_print_cursor_ - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r1, =0x00000819 - adds r0, r1 - ldrb r4, [r0] - ldr r2, =gSaveBlock1Ptr - ldr r0, [r2] - movs r3, 0x92 - lsls r3, 3 - adds r0, r3 - bl DecryptMoney - adds r1, r0, 0 - adds r0, r4, 0 - movs r2, 0 - bl PrintMoneyAmountInMoneyBox - ldr r0, =gTasks + 0x8 - subs r0, 0x8 - adds r6, r0 - ldr r0, =sub_81AD9C0 - str r0, [r6] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AD8C8 - - thumb_func_start sub_81AD9C0 -sub_81AD9C0: @ 81AD9C0 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _081AD9E2 - movs r0, 0x5 - bl PlaySE - bl bag_menu_remove_money_window - adds r0, r4, 0 - bl bag_menu_inits_lists_menu -_081AD9E2: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AD9C0 - - thumb_func_start display_deposit_item_ask_str -display_deposit_item_ask_str: @ 81AD9EC - push {r4-r6,lr} - sub sp, 0x14 - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r5, r0, 3 - ldr r6, =gTasks + 0x8 - adds r1, r5, r6 - movs r0, 0x1 - strh r0, [r1, 0x10] - movs r3, 0x4 - ldrsh r0, [r1, r3] - cmp r0, 0x1 - bne _081ADA18 - adds r0, r2, 0 - bl sub_81ADB14 - b _081ADA5E - .pool -_081ADA18: - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E8E42 - adds r0, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - str r0, [sp, 0xC] - str r0, [sp, 0x10] - movs r0, 0x1 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0x3 - bl bag_menu_print - movs r0, 0x7 - bl sub_81ABC3C - adds r0, r6, 0 - subs r0, 0x8 - adds r0, r5, r0 - ldr r1, =sub_81ADA7C - str r1, [r0] -_081ADA5E: - add sp, 0x14 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end display_deposit_item_ask_str - - thumb_func_start sub_81ADA7C -sub_81ADA7C: @ 81ADA7C - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r6, r4, 0 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r5, r0, r1 - adds r0, r5, 0 - adds r0, 0x10 - ldrh r1, [r5, 0x4] - bl AdjustQuantityAccordingToDPadInput - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081ADAC0 - ldr r0, =gUnknown_0203CE54 - ldr r0, [r0] - ldr r1, =0x00000817 - adds r0, r1 - ldrb r0, [r0] - movs r2, 0x10 - ldrsh r1, [r5, r2] - bl sub_81ABC54 - b _081ADB0E - .pool -_081ADAC0: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081ADAE4 - movs r0, 0x5 - bl PlaySE - movs r0, 0x7 - bl bag_menu_remove_window - adds r0, r4, 0 - bl sub_81ADB14 - b _081ADB0E - .pool -_081ADAE4: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081ADB0E - movs r0, 0x5 - bl PlaySE - movs r1, 0x2 - ldrsh r0, [r5, r1] - bl bag_menu_print_description_box_text - ldrb r0, [r5] - movs r1, 0 - bl bag_menu_print_cursor_ - movs r0, 0x7 - bl bag_menu_remove_window - adds r0, r6, 0 - bl set_callback3_to_bag -_081ADB0E: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81ADA7C - - thumb_func_start sub_81ADB14 -sub_81ADB14: @ 81ADB14 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x14 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r7, r1, 3 - ldr r0, =gTasks + 0x8 - mov r9, r0 - adds r2, r7, 0 - add r2, r9 - mov r8, r2 - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r4, =gUnknown_0203CE7C - ldrh r0, [r4] - bl itemid_is_unique - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - beq _081ADB6C - ldr r2, =gUnknown_085E8E8E - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - str r0, [sp, 0xC] - str r0, [sp, 0x10] - movs r0, 0x1 - b _081ADBE2 - .pool -_081ADB6C: - ldrh r0, [r4] - mov r3, r8 - ldrh r1, [r3, 0x10] - bl sub_80D6D70 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x1 - bne _081ADBD4 - ldrh r0, [r4] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r0, =gStringVar2 - mov r2, r8 - movs r3, 0x10 - ldrsh r1, [r2, r3] - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E8E5A - adds r0, r4, 0 - bl StringExpandPlaceholders - str r6, [sp] - str r5, [sp, 0x4] - str r5, [sp, 0x8] - str r5, [sp, 0xC] - str r5, [sp, 0x10] - movs r0, 0x1 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0x3 - bl bag_menu_print - mov r0, r9 - subs r0, 0x8 - adds r0, r7, r0 - ldr r1, =Task_ActuallyToss - b _081ADBF2 - .pool -_081ADBD4: - ldr r2, =gUnknown_085E8E6E - movs r0, 0x1 - str r0, [sp] - str r5, [sp, 0x4] - str r5, [sp, 0x8] - str r5, [sp, 0xC] - str r5, [sp, 0x10] -_081ADBE2: - movs r1, 0x1 - movs r3, 0x3 - bl bag_menu_print - mov r0, r9 - subs r0, 0x8 - adds r0, r7, r0 - ldr r1, =sub_81ADC0C -_081ADBF2: - str r1, [r0] - add sp, 0x14 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81ADB14 - - thumb_func_start sub_81ADC0C -sub_81ADC0C: @ 81ADC0C - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r5, r0, r1 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _081ADC44 - movs r0, 0x5 - bl PlaySE - movs r1, 0x2 - ldrsh r0, [r5, r1] - bl bag_menu_print_description_box_text - ldrb r0, [r5] - movs r1, 0 - bl bag_menu_print_cursor_ - adds r0, r4, 0 - bl set_callback3_to_bag -_081ADC44: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81ADC0C - - thumb_func_start IsWallysBag -@ bool8 IsWallysBag() -IsWallysBag: @ 81ADC54 - push {lr} - ldr r0, =gUnknown_0203CE58 - ldrb r0, [r0, 0x4] - cmp r0, 0xA - beq _081ADC68 - movs r0, 0 - b _081ADC6A - .pool -_081ADC68: - movs r0, 0x1 -_081ADC6A: - pop {r1} - bx r1 - thumb_func_end IsWallysBag - - thumb_func_start PrepareBagForWallyTutorial -@ void PrepareBagForWallyTutorial() -PrepareBagForWallyTutorial: @ 81ADC70 - push {r4-r6,lr} - ldr r4, =gUnknown_0203CE80 - movs r0, 0xD0 - bl AllocZeroed - str r0, [r4] - ldr r5, =gSaveBlock1Ptr - ldr r1, [r5] - movs r2, 0xAC - lsls r2, 3 - adds r1, r2 - movs r2, 0x78 - bl memcpy - ldr r0, [r4] - ldr r1, [r5] - movs r2, 0xCA - lsls r2, 3 - adds r1, r2 - adds r0, 0x78 - movs r2, 0x40 - bl memcpy - ldr r0, [r4] - ldr r2, =gUnknown_0203CE58 - ldrb r1, [r2, 0x5] - adds r0, 0xCE - strh r1, [r0] - movs r6, 0 - adds r5, r2, 0 - adds r5, 0x8 -_081ADCAE: - ldr r2, [r4] - lsls r3, r6, 1 - adds r0, r2, 0 - adds r0, 0xB8 - adds r0, r3 - ldrh r1, [r5] - strh r1, [r0] - adds r2, 0xC2 - adds r2, r3 - ldrh r0, [r5, 0xA] - strh r0, [r2] - adds r5, 0x2 - adds r6, 0x1 - cmp r6, 0x4 - bls _081ADCAE - ldr r4, =gSaveBlock1Ptr - ldr r0, [r4] - movs r1, 0xAC - lsls r1, 3 - adds r0, r1 - movs r1, 0x1E - bl ClearItemSlots - ldr r0, [r4] - movs r2, 0xCA - lsls r2, 3 - adds r0, r2 - movs r1, 0x10 - bl ClearItemSlots - bl sub_81AAB70 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end PrepareBagForWallyTutorial - - thumb_func_start RestoreBagAfterWallyTutorial -@ void RestoreBagAfterWallyTutorial() -RestoreBagAfterWallyTutorial: @ 81ADD00 - push {r4-r6,lr} - ldr r5, =gSaveBlock1Ptr - ldr r0, [r5] - movs r1, 0xAC - lsls r1, 3 - adds r0, r1 - ldr r4, =gUnknown_0203CE80 - ldr r1, [r4] - movs r2, 0x78 - bl memcpy - ldr r0, [r5] - movs r1, 0xCA - lsls r1, 3 - adds r0, r1 - ldr r1, [r4] - adds r1, 0x78 - movs r2, 0x40 - bl memcpy - ldr r1, =gUnknown_0203CE58 - ldr r0, [r4] - adds r0, 0xCE - ldrh r0, [r0] - strb r0, [r1, 0x5] - movs r5, 0 - adds r6, r4, 0 - adds r3, r1, 0 - adds r3, 0x8 -_081ADD3A: - lsls r2, r5, 1 - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0xB8 - adds r0, r2 - ldrh r0, [r0] - strh r0, [r3] - adds r1, 0xC2 - adds r1, r2 - ldrh r0, [r1] - strh r0, [r3, 0xA] - adds r3, 0x2 - adds r5, 0x1 - cmp r5, 0x4 - bls _081ADD3A - ldr r0, [r6] - bl Free - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end RestoreBagAfterWallyTutorial - - thumb_func_start DoWallyTutorialBagMenu -@ void DoWallyTutorialBagMenu() -DoWallyTutorialBagMenu: @ 81ADD70 - push {lr} - bl PrepareBagForWallyTutorial - movs r0, 0xD - movs r1, 0x1 - bl AddBagItem - movs r0, 0x4 - movs r1, 0x1 - bl AddBagItem - ldr r2, =sub_8059D50 - movs r0, 0xA - movs r1, 0 - bl GoToBagMenu - pop {r0} - bx r0 - .pool - thumb_func_end DoWallyTutorialBagMenu - - thumb_func_start Task_WallyTutorialBagMenu -@ void Task_WallyTutorialBagMenu(u8 taskId) -Task_WallyTutorialBagMenu: @ 81ADD98 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081ADE32 - movs r0, 0x10 - ldrsh r1, [r4, r0] - cmp r1, 0xCC - beq _081ADDEC - cmp r1, 0xCC - bgt _081ADDD0 - cmp r1, 0x66 - beq _081ADDDA - b _081ADE2C - .pool -_081ADDD0: - movs r0, 0x99 - lsls r0, 1 - cmp r1, r0 - beq _081ADE0C - b _081ADE2C -_081ADDDA: - movs r0, 0x5 - bl PlaySE - adds r0, r5, 0 - movs r1, 0x1 - movs r2, 0 - bl SwitchBagPocket - b _081ADE2C -_081ADDEC: - movs r0, 0x5 - bl PlaySE - ldrb r0, [r4] - movs r1, 0x2 - bl bag_menu_print_cursor_ - ldr r1, =gUnknown_0203CE7C - movs r0, 0x4 - strh r0, [r1] - adds r0, r5, 0 - bl sub_81AC644 - b _081ADE2C - .pool -_081ADE0C: - movs r0, 0x5 - bl PlaySE - bl bag_menu_remove_some_window - ldrb r0, [r4] - movs r1, 0 - movs r2, 0 - bl sub_81AE6C8 - bl RestoreBagAfterWallyTutorial - adds r0, r5, 0 - bl unknown_ItemMenu_Confirm - b _081ADE32 -_081ADE2C: - ldrh r0, [r4, 0x10] - adds r0, 0x1 - strh r0, [r4, 0x10] -_081ADE32: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end Task_WallyTutorialBagMenu - - thumb_func_start unknown_ItemMenu_Show -unknown_ItemMenu_Show: @ 81ADE38 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =gSpecialVar_0x8005 - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - strh r0, [r1] - ldr r1, =gScriptResult - movs r0, 0x1 - strh r0, [r1] - bl bag_menu_remove_some_window - adds r0, r4, 0 - bl unknown_ItemMenu_Confirm - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end unknown_ItemMenu_Show - - thumb_func_start bag_menu_leave_maybe_3 -bag_menu_leave_maybe_3: @ 81ADE6C - push {lr} - ldr r0, =gUnknown_03005DAC - ldr r1, =sub_819FA50 - str r1, [r0] - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_leave_maybe_3 - - thumb_func_start unknown_ItemMenu_Give2 -unknown_ItemMenu_Give2: @ 81ADE8C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - movs r1, 0x1 - bl RemoveBagItem - ldr r1, =gScriptResult - movs r0, 0x1 - strh r0, [r1] - bl bag_menu_remove_some_window - adds r0, r4, 0 - bl unknown_ItemMenu_Confirm - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end unknown_ItemMenu_Give2 - - thumb_func_start bag_menu_leave_maybe_2 -bag_menu_leave_maybe_2: @ 81ADEBC - push {lr} - ldr r0, =gUnknown_03005DAC - ldr r1, =sub_818DEF4 - str r1, [r0] - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_leave_maybe_2 - - thumb_func_start unknown_ItemMenu_Confirm2 -unknown_ItemMenu_Confirm2: @ 81ADEDC - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =gScriptResult - movs r0, 0x1 - strh r0, [r1] - bl bag_menu_remove_some_window - adds r0, r4, 0 - bl unknown_ItemMenu_Confirm - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end unknown_ItemMenu_Confirm2 - - thumb_func_start bag_menu_leave_maybe -bag_menu_leave_maybe: @ 81ADF00 - push {lr} - ldr r0, =gUnknown_03005DAC - ldr r1, =sub_818E564 - str r1, [r0] - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_leave_maybe - - thumb_func_start bag_menu_print_pocket_names -bag_menu_print_pocket_names: @ 81ADF20 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x1C - adds r4, r0, 0 - mov r8, r1 - movs r0, 0 - movs r1, 0 - str r0, [sp, 0x14] - str r1, [sp, 0x18] - ldr r1, =0x00ffffff - ldr r0, [sp, 0x14] - ands r0, r1 - movs r1, 0x80 - lsls r1, 21 - orrs r0, r1 - str r0, [sp, 0x14] - ldr r1, =0xffffff00 - ldr r0, [sp, 0x18] - ands r0, r1 - movs r1, 0x2 - orrs r0, r1 - str r0, [sp, 0x18] - add r0, sp, 0x14 - bl AddWindow - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r6, 0 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x40 - bl GetStringCenterAlignXOffset - lsls r3, r0, 24 - lsrs r3, 24 - movs r7, 0x1 - str r7, [sp] - movs r5, 0 - str r5, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0xFF - mov r9, r0 - str r0, [sp, 0xC] - str r7, [sp, 0x10] - adds r0, r6, 0 - movs r1, 0x1 - adds r2, r4, 0 - bl bag_menu_print - mov r2, r8 - cmp r2, 0 - beq _081ADFBA - movs r0, 0x1 - mov r1, r8 - movs r2, 0x40 - bl GetStringCenterAlignXOffset - adds r3, r0, 0 - adds r3, 0x40 - lsls r3, 24 - lsrs r3, 24 - str r7, [sp] - str r5, [sp, 0x4] - str r5, [sp, 0x8] - mov r0, r9 - str r0, [sp, 0xC] - str r7, [sp, 0x10] - adds r0, r6, 0 - movs r1, 0x1 - mov r2, r8 - bl bag_menu_print -_081ADFBA: - adds r0, r6, 0 - movs r1, 0x7 - bl GetWindowAttribute - ldr r1, =gUnknown_0203CE54 - ldr r1, [r1] - ldr r2, =0x00000844 - adds r1, r2 - ldr r2, =0x04000100 - bl CpuSet - adds r0, r6, 0 - bl RemoveWindow - add sp, 0x1C - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_print_pocket_names - - thumb_func_start bag_menu_copy_pocket_name_to_window -bag_menu_copy_pocket_name_to_window: @ 81ADFF8 - push {r4-r7,lr} - adds r7, r0, 0 - cmp r7, 0x8 - bls _081AE002 - movs r7, 0x8 -_081AE002: - ldr r0, =gUnknown_0203CE54 - ldr r4, [r0] - ldr r0, =0x00000844 - adds r4, r0 - movs r0, 0x2 - movs r1, 0x7 - bl GetWindowAttribute - adds r5, r0, 0 - lsls r0, r7, 5 - adds r0, r4, r0 - ldr r6, =0x04000040 - adds r1, r5, 0 - adds r2, r6, 0 - bl CpuSet - adds r0, r7, 0 - adds r0, 0x10 - lsls r0, 5 - adds r4, r0 - movs r0, 0x80 - lsls r0, 1 - adds r5, r0 - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - bl CpuSet - movs r0, 0x2 - movs r1, 0x2 - bl CopyWindowToVram - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_copy_pocket_name_to_window - - thumb_func_start setup_bag_menu_textboxes -setup_bag_menu_textboxes: @ 81AE054 - push {r4,lr} - ldr r0, =gUnknown_08614174 - bl InitWindows - bl DeactivateAllTextPrinters - movs r0, 0 - movs r1, 0x1 - movs r2, 0xE0 - bl sub_809882C - movs r0, 0 - movs r1, 0xA - movs r2, 0xD0 - bl copy_textbox_border_tile_patterns_to_vram - movs r0, 0xC0 - movs r1, 0x1 - bl sub_819A2BC - ldr r0, =gUnknown_0860F074 - movs r1, 0xF0 - movs r2, 0x20 - bl LoadPalette - movs r4, 0 -_081AE088: - adds r0, r4, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _081AE088 - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end setup_bag_menu_textboxes - - thumb_func_start bag_menu_print -bag_menu_print: @ 81AE0BC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x14 - mov r9, r3 - ldr r3, [sp, 0x30] - ldr r4, [sp, 0x34] - ldr r6, [sp, 0x38] - ldr r5, [sp, 0x3C] - mov r8, r5 - ldr r5, [sp, 0x40] - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - mov r7, r9 - lsls r7, 24 - lsrs r7, 24 - mov r9, r7 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r6, 24 - lsrs r6, 24 - lsls r5, 24 - lsrs r5, 24 - str r4, [sp] - str r6, [sp, 0x4] - lsls r4, r5, 1 - adds r4, r5 - ldr r5, =gUnknown_08614164 - adds r4, r5 - str r4, [sp, 0x8] - mov r4, r8 - lsls r4, 24 - asrs r4, 24 - str r4, [sp, 0xC] - str r2, [sp, 0x10] - mov r2, r9 - bl AddTextPrinterParametrized2 - add sp, 0x14 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_print - - thumb_func_start sub_81AE124 -sub_81AE124: @ 81AE124 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0203CE54 - ldr r1, [r1] - movs r2, 0x81 - lsls r2, 4 - adds r1, r2 - adds r1, r0 - ldrb r0, [r1] - bx lr - .pool - thumb_func_end sub_81AE124 - - thumb_func_start bag_menu_add_window -bag_menu_add_window: @ 81AE13C - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gUnknown_0203CE54 - movs r3, 0x81 - lsls r3, 4 - adds r1, r2, r3 - ldr r0, [r0] - adds r4, r0, r1 - ldrb r0, [r4] - cmp r0, 0xFF - bne _081AE172 - lsls r0, r2, 3 - ldr r1, =gUnknown_086141AC - adds r0, r1 - bl AddWindow - strb r0, [r4] - ldrb r0, [r4] - movs r1, 0 - movs r2, 0x1 - movs r3, 0xE - bl SetWindowBorderStyle - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram -_081AE172: - ldrb r0, [r4] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end bag_menu_add_window - - thumb_func_start bag_menu_remove_window -bag_menu_remove_window: @ 81AE184 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0203CE54 - movs r2, 0x81 - lsls r2, 4 - adds r0, r2 - ldr r1, [r1] - adds r4, r1, r0 - ldrb r0, [r4] - cmp r0, 0xFF - beq _081AE1B8 - movs r1, 0 - bl sub_8198070 - ldrb r0, [r4] - bl ClearWindowTilemap - ldrb r0, [r4] - bl RemoveWindow - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0xFF - strb r0, [r4] -_081AE1B8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_remove_window - - thumb_func_start AddItemMessageWindow -@ u8 AddItemMessageWindow(u8 a1) -AddItemMessageWindow: @ 81AE1C4 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gUnknown_0203CE54 - movs r3, 0x81 - lsls r3, 4 - adds r1, r2, r3 - ldr r0, [r0] - adds r4, r0, r1 - ldrb r0, [r4] - cmp r0, 0xFF - bne _081AE1E8 - lsls r0, r2, 3 - ldr r1, =gUnknown_086141AC - adds r0, r1 - bl AddWindow - strb r0, [r4] -_081AE1E8: - ldrb r0, [r4] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end AddItemMessageWindow - - thumb_func_start bag_menu_RemoveBagItem_message_window -bag_menu_RemoveBagItem_message_window: @ 81AE1F8 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0203CE54 - movs r2, 0x81 - lsls r2, 4 - adds r0, r2 - ldr r1, [r1] - adds r4, r1, r0 - ldrb r0, [r4] - cmp r0, 0xFF - beq _081AE22C - movs r1, 0 - bl sub_8197DF8 - ldrb r0, [r4] - bl ClearWindowTilemap - ldrb r0, [r4] - bl RemoveWindow - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0xFF - strb r0, [r4] -_081AE22C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_RemoveBagItem_message_window - - thumb_func_start bag_menu_yes_no -bag_menu_yes_no: @ 81AE238 - push {lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 21 - ldr r3, =gUnknown_086141AC - adds r1, r3 - movs r3, 0x2 - str r3, [sp] - movs r3, 0x1 - str r3, [sp, 0x4] - movs r3, 0xE - str r3, [sp, 0x8] - str r2, [sp, 0xC] - movs r2, 0x1 - movs r3, 0 - bl CreateYesNoMenuWithCallbacks - add sp, 0x10 - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_yes_no - - thumb_func_start bag_menu_add_money_window -bag_menu_add_money_window: @ 81AE268 - push {r4,lr} - movs r0, 0x9 - bl bag_menu_add_window - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0x92 - lsls r1, 3 - adds r0, r1 - bl DecryptMoney - adds r3, r0, 0 - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0xE - bl set_window_border_style_and_print_money_box - movs r0, 0x13 - movs r1, 0xB - bl AddMoneyLabelObject - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end bag_menu_add_money_window - - thumb_func_start bag_menu_remove_money_window -bag_menu_remove_money_window: @ 81AE2A4 - push {lr} - movs r0, 0x9 - bl bag_menu_remove_window - bl RemoveMoneyLabelObject - pop {r0} - bx r0 - thumb_func_end bag_menu_remove_money_window - - thumb_func_start bag_menu_prepare_tmhm_move_window -bag_menu_prepare_tmhm_move_window: @ 81AE2B4 - push {lr} - movs r0, 0x3 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x3 - movs r1, 0x13 - movs r2, 0 - movs r3, 0 - bl blit_move_info_icon - movs r0, 0x3 - movs r1, 0x14 - movs r2, 0 - movs r3, 0xC - bl blit_move_info_icon - movs r0, 0x3 - movs r1, 0x15 - movs r2, 0 - movs r3, 0x18 - bl blit_move_info_icon - movs r0, 0x3 - movs r1, 0x16 - movs r2, 0 - movs r3, 0x24 - bl blit_move_info_icon - movs r0, 0x3 - movs r1, 0x2 - bl CopyWindowToVram - pop {r0} - bx r0 - thumb_func_end bag_menu_prepare_tmhm_move_window - - thumb_func_start PrintTMHMMoveData -PrintTMHMMoveData: @ 81AE2FC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x14 - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0x4 - movs r1, 0 - bl FillWindowPixelBuffer - cmp r4, 0 - bne _081AE354 - movs r4, 0 - movs r5, 0 -_081AE31A: - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 26 - lsrs r0, 24 - str r0, [sp] - str r5, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0xFF - str r0, [sp, 0xC] - movs r0, 0x4 - str r0, [sp, 0x10] - movs r1, 0x1 - ldr r2, =gUnknown_085E8D45 - movs r3, 0x7 - bl bag_menu_print - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _081AE31A - movs r0, 0x4 - movs r1, 0x2 - bl CopyWindowToVram - b _081AE440 - .pool -_081AE354: - adds r0, r4, 0 - bl ItemIdToBattleMoveId - lsls r0, 16 - lsrs r7, r0, 16 - ldr r1, =gBattleMoves - lsls r0, r7, 1 - adds r0, r7 - lsls r0, 2 - adds r5, r0, r1 - ldrb r1, [r5, 0x2] - adds r1, 0x1 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0x4 - movs r2, 0 - movs r3, 0 - bl blit_move_info_icon - ldrb r0, [r5, 0x1] - cmp r0, 0x1 - bhi _081AE38C - ldr r2, =gUnknown_085E8D45 - b _081AE39C - .pool -_081AE38C: - ldr r4, =gStringVar1 - ldrb r1, [r5, 0x1] - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - adds r2, r4, 0 -_081AE39C: - movs r0, 0xC - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0xFF - str r0, [sp, 0xC] - movs r0, 0x4 - str r0, [sp, 0x10] - movs r1, 0x1 - movs r3, 0x7 - bl bag_menu_print - ldr r2, =gBattleMoves - lsls r1, r7, 1 - adds r0, r1, r7 - lsls r0, 2 - adds r2, r0, r2 - ldrb r0, [r2, 0x3] - adds r6, r1, 0 - cmp r0, 0 - bne _081AE3D8 - ldr r2, =gUnknown_085E8D45 - b _081AE3E8 - .pool -_081AE3D8: - ldr r4, =gStringVar1 - ldrb r1, [r2, 0x3] - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - adds r2, r4, 0 -_081AE3E8: - movs r0, 0x18 - str r0, [sp] - movs r4, 0 - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0xFF - mov r8, r0 - str r0, [sp, 0xC] - movs r0, 0x4 - mov r9, r0 - str r0, [sp, 0x10] - movs r1, 0x1 - movs r3, 0x7 - bl bag_menu_print - ldr r5, =gStringVar1 - ldr r1, =gBattleMoves - adds r0, r6, r7 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x4] - adds r0, r5, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - movs r0, 0x24 - str r0, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - mov r0, r8 - str r0, [sp, 0xC] - mov r0, r9 - str r0, [sp, 0x10] - movs r0, 0x4 - movs r1, 0x1 - adds r2, r5, 0 - movs r3, 0x7 - bl bag_menu_print - movs r0, 0x4 - movs r1, 0x2 - bl CopyWindowToVram -_081AE440: - add sp, 0x14 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end PrintTMHMMoveData - - thumb_func_start ListMenuDummyTask -@ void ListMenuDummyTask(u8 taskId) -ListMenuDummyTask: @ 81AE458 - bx lr - thumb_func_end ListMenuDummyTask - - thumb_func_start DoMysteryGiftListMenu -@ int DoMysteryGiftListMenu(struct WindowTemplate *windowTemplate, struct ListMenuTemplate *listMenuTemplate, int a3, int a4, int a5) -DoMysteryGiftListMenu: @ 81AE45C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - mov r12, r0 - str r1, [sp] - ldr r0, [sp, 0x28] - lsls r2, 24 - lsrs r6, r2, 24 - mov r10, r6 - lsls r3, 16 - lsrs r7, r3, 16 - str r7, [sp, 0x4] - lsls r0, 16 - mov r8, r0 - lsrs r0, 16 - mov r9, r0 - ldr r5, =gUnknown_0203CE84 - ldrb r4, [r5, 0x4] - cmp r4, 0x1 - beq _081AE4F4 - cmp r4, 0x1 - ble _081AE492 - cmp r4, 0x2 - beq _081AE558 -_081AE492: - mov r0, r12 - bl AddWindow - strb r0, [r5, 0x5] - cmp r6, 0x1 - beq _081AE4B0 - cmp r6, 0x2 - bne _081AE4C0 - ldrb r0, [r5, 0x5] - mov r1, r9 - lsls r2, r1, 24 - lsrs r2, 24 - adds r1, r7, 0 - bl sub_809882C -_081AE4B0: - ldrb r0, [r5, 0x5] - mov r3, r8 - lsrs r2, r3, 20 - lsls r2, 24 - lsrs r2, 24 - ldr r1, [sp, 0x4] - bl sub_8098858 -_081AE4C0: - ldr r0, =gUnknown_03006310 - adds r2, r0, 0 - ldr r1, [sp] - ldm r1!, {r3-r5} - stm r2!, {r3-r5} - ldm r1!, {r3-r5} - stm r2!, {r3-r5} - ldr r4, =gUnknown_0203CE84 - ldrb r1, [r4, 0x5] - strb r1, [r0, 0x10] - movs r1, 0 - movs r2, 0 - bl ListMenuInit - strb r0, [r4, 0x6] - ldrb r0, [r4, 0x5] - movs r1, 0x1 - bl CopyWindowToVram - movs r0, 0x1 - strb r0, [r4, 0x4] - b _081AE570 - .pool -_081AE4F4: - ldrb r0, [r5, 0x6] - bl ListMenuHandleInput - str r0, [r5] - ldr r1, =gMain - ldrh r0, [r1, 0x2E] - ands r4, r0 - cmp r4, 0 - beq _081AE50A - movs r0, 0x2 - strb r0, [r5, 0x4] -_081AE50A: - ldrh r1, [r1, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081AE51E - movs r0, 0x2 - negs r0, r0 - str r0, [r5] - movs r0, 0x2 - strb r0, [r5, 0x4] -_081AE51E: - ldrb r0, [r5, 0x4] - cmp r0, 0x2 - bne _081AE570 - cmp r6, 0 - bne _081AE534 - ldrb r0, [r5, 0x5] - bl ClearWindowTilemap - b _081AE546 - .pool -_081AE534: - mov r4, r10 - cmp r4, 0 - blt _081AE546 - cmp r4, 0x2 - bgt _081AE546 - ldrb r0, [r5, 0x5] - movs r1, 0 - bl sub_819746C -_081AE546: - ldr r0, =gUnknown_0203CE84 - ldrb r0, [r0, 0x5] - movs r1, 0x1 - bl CopyWindowToVram - b _081AE570 - .pool -_081AE558: - ldrb r0, [r5, 0x6] - movs r1, 0 - movs r2, 0 - bl sub_81AE6C8 - ldrb r0, [r5, 0x5] - bl RemoveWindow - movs r0, 0 - strb r0, [r5, 0x4] - ldr r0, [r5] - b _081AE574 -_081AE570: - movs r0, 0x1 - negs r0, r0 -_081AE574: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end DoMysteryGiftListMenu - - thumb_func_start ListMenuInit -@ u8 ListMenuInit(struct ListMenuTemplate *listMenuTemplate, u16 scrollOffset, u16 selectedRow) -ListMenuInit: @ 81AE584 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 16 - lsrs r2, 16 - bl ListMenuInitInternal - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldrb r0, [r5, 0x10] - bl PutWindowTilemap - ldrb r0, [r5, 0x10] - movs r1, 0x2 - bl CopyWindowToVram - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end ListMenuInit - - thumb_func_start Unused_ListMenuInit2 -@ u8 Unused_ListMenuInit2(struct ListMenuTemplate *listMenuTemplate, int a2, u16 scrollOffset, u16 selectedRow) -Unused_ListMenuInit2: @ 81AE5B0 - push {r4-r7,lr} - sub sp, 0x8 - adds r6, r0, 0 - adds r4, r1, 0 - adds r1, r2, 0 - adds r2, r3, 0 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 16 - lsrs r2, 16 - bl ListMenuInitInternal - lsls r0, 24 - lsrs r7, r0, 24 - ldrb r0, [r4, 0x4] - cmp r0, 0xFF - beq _081AE5F0 - adds r5, r4, 0 -_081AE5D4: - ldrb r0, [r6, 0x10] - ldrb r1, [r5] - ldrb r2, [r5, 0x1] - ldrb r3, [r5, 0x2] - ldrb r4, [r5, 0x3] - str r4, [sp] - ldrb r4, [r5, 0x4] - str r4, [sp, 0x4] - bl PutWindowRectTilemapOverridePalette - adds r5, 0x8 - ldrb r0, [r5, 0x4] - cmp r0, 0xFF - bne _081AE5D4 -_081AE5F0: - ldrb r0, [r6, 0x10] - movs r1, 0x2 - bl CopyWindowToVram - adds r0, r7, 0 - add sp, 0x8 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end Unused_ListMenuInit2 - - thumb_func_start ListMenuHandleInput -@ int ListMenuHandleInput(u8 taskId) -ListMenuHandleInput: @ 81AE604 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r3, r1, r0 - ldr r2, =gMain - ldrh r1, [r2, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081AE638 - ldrh r0, [r3, 0x18] - ldrh r1, [r3, 0x1A] - adds r0, r1 - ldr r1, [r3] - lsls r0, 3 - adds r0, r1 - ldr r0, [r0, 0x4] - b _081AE6C2 - .pool -_081AE638: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081AE646 - movs r0, 0x2 - negs r0, r0 - b _081AE6C2 -_081AE646: - ldrh r1, [r2, 0x30] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081AE65A - adds r0, r3, 0 - movs r1, 0x1 - movs r2, 0x1 - movs r3, 0 - b _081AE6BA -_081AE65A: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081AE66A - adds r0, r3, 0 - movs r1, 0x1 - movs r2, 0x1 - b _081AE6B8 -_081AE66A: - ldrb r0, [r3, 0x16] - lsrs r0, 6 - cmp r0, 0x1 - beq _081AE680 - cmp r0, 0x1 - ble _081AE67A - cmp r0, 0x2 - beq _081AE68C -_081AE67A: - movs r2, 0 - movs r0, 0 - b _081AE6A0 -_081AE680: - movs r0, 0x20 - ands r0, r1 - lsls r0, 16 - lsrs r2, r0, 16 - movs r0, 0x10 - b _081AE69A -_081AE68C: - movs r0, 0x80 - lsls r0, 2 - ands r0, r1 - lsls r0, 16 - lsrs r2, r0, 16 - movs r0, 0x80 - lsls r0, 1 -_081AE69A: - ands r0, r1 - lsls r0, 16 - lsrs r0, 16 -_081AE6A0: - cmp r2, 0 - beq _081AE6AE - ldrb r2, [r3, 0xE] - adds r0, r3, 0 - movs r1, 0x1 - movs r3, 0 - b _081AE6BA -_081AE6AE: - cmp r0, 0 - beq _081AE6BE - ldrb r2, [r3, 0xE] - adds r0, r3, 0 - movs r1, 0x1 -_081AE6B8: - movs r3, 0x1 -_081AE6BA: - bl ListMenuChangeSelection -_081AE6BE: - movs r0, 0x1 - negs r0, r0 -_081AE6C2: - pop {r1} - bx r1 - thumb_func_end ListMenuHandleInput - - thumb_func_start sub_81AE6C8 -sub_81AE6C8: @ 81AE6C8 - push {r4,lr} - adds r3, r1, 0 - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r1, r0, r1 - cmp r3, 0 - beq _081AE6E4 - ldrh r0, [r1, 0x18] - strh r0, [r3] -_081AE6E4: - cmp r2, 0 - beq _081AE6EC - ldrh r0, [r1, 0x1A] - strh r0, [r2] -_081AE6EC: - ldrb r0, [r1, 0x1E] - cmp r0, 0xFF - beq _081AE6FC - ldrb r1, [r1, 0x17] - lsrs r1, 6 - subs r1, 0x2 - bl ListMenuRemoveCursorObject -_081AE6FC: - adds r0, r4, 0 - bl DestroyTask - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AE6C8 - - thumb_func_start sub_81AE70C -sub_81AE70C: @ 81AE70C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - ldrb r0, [r4, 0x10] - ldrb r2, [r4, 0x15] - lsls r2, 28 - lsrs r1, r2, 4 - orrs r1, r2 - lsrs r1, 24 - bl FillWindowPixelBuffer - ldrh r1, [r4, 0x18] - ldrh r3, [r4, 0xE] - adds r0, r4, 0 - movs r2, 0 - bl ListMenuPrintEntries - adds r0, r4, 0 - bl ListMenuDrawCursor - ldrb r0, [r4, 0x10] - movs r1, 0x2 - bl CopyWindowToVram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AE70C - - thumb_func_start sub_81AE750 -sub_81AE750: @ 81AE750 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - lsrs r1, 20 - ldrb r6, [r4, 0x14] - movs r5, 0xF - adds r0, r5, 0 - ands r0, r6 - orrs r0, r1 - strb r0, [r4, 0x14] - ands r2, r5 - ldrb r1, [r4, 0x15] - movs r0, 0x10 - negs r0, r0 - ands r0, r1 - orrs r0, r2 - lsrs r3, 20 - ands r0, r5 - orrs r0, r3 - strb r0, [r4, 0x15] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AE750 - - thumb_func_start sub_81AE794 -sub_81AE794: @ 81AE794 - push {r4,r5,lr} - adds r3, r1, 0 - adds r5, r2, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - ldrb r0, [r4, 0x10] - movs r1, 0x1 - adds r2, r3, 0 - bl SetWindowAttribute - ldrb r0, [r4, 0x10] - movs r1, 0x2 - adds r2, r5, 0 - bl SetWindowAttribute - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AE794 - - thumb_func_start sub_81AE7D0 -sub_81AE7D0: @ 81AE7D0 - push {r4-r7,lr} - sub sp, 0x20 - mov r12, r2 - ldr r5, [sp, 0x34] - lsls r3, 16 - lsrs r3, 16 - adds r4, r3, 0 - mov r3, sp - ldm r0!, {r2,r6,r7} - stm r3!, {r2,r6,r7} - ldm r0!, {r2,r6,r7} - stm r3!, {r2,r6,r7} - mov r0, sp - movs r3, 0 - strh r1, [r0, 0x18] - mov r1, r12 - strh r1, [r0, 0x1A] - strb r3, [r0, 0x1C] - strb r3, [r0, 0x1D] - cmp r4, 0x40 - bne _081AE804 - movs r1, 0 - movs r2, 0x1 - movs r3, 0 - bl ListMenuChangeSelection -_081AE804: - cmp r4, 0x80 - bne _081AE814 - mov r0, sp - movs r1, 0 - movs r2, 0x1 - movs r3, 0x1 - bl ListMenuChangeSelection -_081AE814: - cmp r5, 0 - beq _081AE81E - mov r0, sp - ldrh r0, [r0, 0x18] - strh r0, [r5] -_081AE81E: - ldr r2, [sp, 0x38] - cmp r2, 0 - beq _081AE82A - mov r0, sp - ldrh r0, [r0, 0x1A] - strh r0, [r2] -_081AE82A: - movs r0, 0x1 - negs r0, r0 - add sp, 0x20 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81AE7D0 - - thumb_func_start sub_81AE838 -sub_81AE838: @ 81AE838 - push {lr} - adds r2, r1, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r1, r0 - cmp r2, 0 - beq _081AE856 - ldrh r0, [r1, 0x1A] - ldrh r1, [r1, 0x18] - adds r0, r1 - strh r0, [r2] -_081AE856: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AE838 - - thumb_func_start get_coro_args_x18_x1A -get_coro_args_x18_x1A: @ 81AE860 - push {lr} - adds r3, r1, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r1, r0 - cmp r3, 0 - beq _081AE87A - ldrh r0, [r1, 0x18] - strh r0, [r3] -_081AE87A: - cmp r2, 0 - beq _081AE882 - ldrh r0, [r1, 0x1A] - strh r0, [r2] -_081AE882: - pop {r0} - bx r0 - .pool - thumb_func_end get_coro_args_x18_x1A - - thumb_func_start ListMenuGetYCoordForPrintingArrowCursor -@ u8 ListMenuGetYCoordForPrintingArrowCursor(u8 taskId) -ListMenuGetYCoordForPrintingArrowCursor: @ 81AE88C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - ldrb r0, [r4, 0x17] - lsls r0, 26 - lsrs r0, 26 - movs r1, 0x1 - bl GetFontAttribute - ldrb r1, [r4, 0x16] - lsls r1, 26 - lsrs r1, 29 - adds r0, r1 - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x1A] - adds r2, r1, 0 - muls r2, r0 - adds r1, r2, 0 - ldrb r0, [r4, 0x14] - lsls r0, 28 - lsrs r0, 28 - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end ListMenuGetYCoordForPrintingArrowCursor - - thumb_func_start ListMenuInitInternal -@ u8 ListMenuInitInternal(struct ListMenuTemplate *listMenuTemplate, u16 scrollOffset, u16 selectedRow) -ListMenuInitInternal: @ 81AE8D4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - lsls r5, 16 - lsrs r5, 16 - lsls r6, 16 - lsrs r6, 16 - ldr r0, =ListMenuDummyTask - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r0, 2 - add r0, r8 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r7, r0, r1 - adds r0, r7, 0 - ldm r4!, {r1-r3} - stm r0!, {r1-r3} - ldm r4!, {r1-r3} - stm r0!, {r1-r3} - movs r1, 0 - strh r5, [r7, 0x18] - strh r6, [r7, 0x1A] - strb r1, [r7, 0x1C] - strb r1, [r7, 0x1D] - movs r0, 0xFF - strb r0, [r7, 0x1E] - strb r1, [r7, 0x1F] - ldr r3, =gUnknown_03006300 - ldrb r1, [r7, 0x14] - movs r5, 0xF - lsrs r1, 4 - ldrb r4, [r3] - movs r2, 0x10 - negs r2, r2 - adds r0, r2, 0 - ands r0, r4 - orrs r0, r1 - strb r0, [r3] - ldrb r1, [r7, 0x15] - lsls r1, 28 - lsrs r1, 24 - ands r0, r5 - orrs r0, r1 - strb r0, [r3] - ldrb r0, [r7, 0x15] - lsrs r0, 4 - ands r5, r0 - ldrb r0, [r3, 0x1] - ands r2, r0 - orrs r2, r5 - strb r2, [r3, 0x1] - ldrb r1, [r7, 0x16] - lsls r1, 29 - lsrs r1, 17 - ldr r0, [r3] - ldr r2, =0xfffc0fff - ands r0, r2 - orrs r0, r1 - str r0, [r3] - ldrb r0, [r7, 0x17] - lsls r0, 26 - lsrs r0, 26 - strb r0, [r3, 0x3] - ldrh r0, [r7, 0xC] - ldrh r1, [r7, 0xE] - cmp r0, r1 - bcs _081AE96C - strh r0, [r7, 0xE] -_081AE96C: - ldrb r0, [r7, 0x10] - ldrb r2, [r7, 0x15] - lsls r2, 28 - lsrs r1, r2, 4 - orrs r1, r2 - lsrs r1, 24 - bl FillWindowPixelBuffer - ldrh r1, [r7, 0x18] - ldrh r3, [r7, 0xE] - adds r0, r7, 0 - movs r2, 0 - bl ListMenuPrintEntries - adds r0, r7, 0 - bl ListMenuDrawCursor - adds r0, r7, 0 - movs r1, 0x1 - bl ListMenuCallSelectionChangedCallback - mov r0, r8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end ListMenuInitInternal - - thumb_func_start ListMenuPrint -@ void ListMenuPrint(struct ListMenu *listMenu, u8 *str, u8 x, u8 y) -ListMenuPrint: @ 81AE9B4 - push {r4-r7,lr} - sub sp, 0x18 - adds r4, r0, 0 - adds r6, r1, 0 - lsls r2, 24 - lsrs r7, r2, 24 - lsls r3, 24 - lsrs r3, 24 - mov r12, r3 - ldr r5, =gUnknown_03006300 - ldrb r1, [r5, 0x3] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - beq _081AEA20 - add r1, sp, 0x14 - ldr r2, [r5] - lsls r0, r2, 24 - lsrs r0, 28 - movs r3, 0 - strb r0, [r1] - lsls r0, r2, 28 - lsrs r0, 28 - strb r0, [r1, 0x1] - lsls r0, r2, 20 - lsrs r0, 28 - strb r0, [r1, 0x2] - ldrb r0, [r4, 0x10] - lsls r1, r2, 1 - lsrs r1, 25 - lsls r2, 14 - lsrs r2, 26 - str r2, [sp] - str r3, [sp, 0x4] - add r2, sp, 0x14 - str r2, [sp, 0x8] - movs r2, 0x1 - negs r2, r2 - str r2, [sp, 0xC] - str r6, [sp, 0x10] - adds r2, r7, 0 - mov r3, r12 - bl AddTextPrinterParametrized2 - ldrb r1, [r5, 0x3] - movs r0, 0x7F - ands r0, r1 - strb r0, [r5, 0x3] - b _081AEA5E - .pool -_081AEA20: - add r2, sp, 0x14 - ldrb r1, [r4, 0x15] - lsls r0, r1, 28 - lsrs r0, 28 - strb r0, [r2] - ldrb r0, [r4, 0x14] - lsrs r0, 4 - strb r0, [r2, 0x1] - adds r0, r2, 0 - lsls r1, 24 - lsrs r1, 28 - strb r1, [r0, 0x2] - ldrb r0, [r4, 0x10] - ldrb r1, [r4, 0x17] - lsls r1, 26 - lsrs r1, 26 - ldrb r2, [r4, 0x16] - lsls r2, 29 - lsrs r2, 29 - str r2, [sp] - str r3, [sp, 0x4] - add r2, sp, 0x14 - str r2, [sp, 0x8] - movs r2, 0x1 - negs r2, r2 - str r2, [sp, 0xC] - str r6, [sp, 0x10] - adds r2, r7, 0 - mov r3, r12 - bl AddTextPrinterParametrized2 -_081AEA5E: - add sp, 0x18 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end ListMenuPrint - - thumb_func_start ListMenuPrintEntries -@ void ListMenuPrintEntries(struct ListMenu *listMenu, u16 startIndex, u16 yOffset, u16 count) -ListMenuPrintEntries: @ 81AEA68 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - adds r4, r0, 0 - lsls r1, 16 - lsrs r1, 16 - mov r9, r1 - lsls r2, 16 - lsrs r2, 16 - str r2, [sp] - lsls r3, 16 - lsrs r3, 16 - mov r10, r3 - ldrb r0, [r4, 0x17] - lsls r0, 26 - lsrs r0, 26 - movs r1, 0x1 - bl GetFontAttribute - ldrb r1, [r4, 0x16] - lsls r1, 26 - lsrs r1, 29 - adds r0, r1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - movs r0, 0 - mov r8, r0 - cmp r8, r10 - bge _081AEB10 -_081AEAAA: - ldr r0, [r4] - mov r2, r9 - lsls r1, r2, 3 - adds r0, r1, r0 - ldr r2, [r0, 0x4] - movs r0, 0x3 - negs r0, r0 - adds r5, r1, 0 - cmp r2, r0 - beq _081AEAC2 - ldrb r6, [r4, 0x12] - b _081AEAC4 -_081AEAC2: - ldrb r6, [r4, 0x11] -_081AEAC4: - ldr r0, [sp] - add r0, r8 - ldr r2, [sp, 0x4] - adds r1, r0, 0 - muls r1, r2 - ldrb r0, [r4, 0x14] - lsls r0, 28 - lsrs r0, 28 - adds r0, r1 - lsls r0, 24 - lsrs r2, r0, 24 - adds r7, r2, 0 - ldr r3, [r4, 0x8] - cmp r3, 0 - beq _081AEAEE - ldrb r0, [r4, 0x10] - ldr r1, [r4] - adds r1, r5, r1 - ldr r1, [r1, 0x4] - bl _call_via_r3 -_081AEAEE: - ldr r0, [r4] - adds r0, r5, r0 - ldr r1, [r0] - adds r0, r4, 0 - adds r2, r6, 0 - adds r3, r7, 0 - bl ListMenuPrint - mov r0, r9 - adds r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - movs r0, 0x1 - add r8, r0 - cmp r8, r10 - blt _081AEAAA -_081AEB10: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end ListMenuPrintEntries - - thumb_func_start ListMenuDrawCursor -@ void ListMenuDrawCursor(struct ListMenu *listMenu) -ListMenuDrawCursor: @ 81AEB20 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - ldrb r0, [r6, 0x17] - lsls r0, 26 - lsrs r0, 26 - movs r1, 0x1 - bl GetFontAttribute - ldrb r1, [r6, 0x16] - lsls r1, 26 - lsrs r1, 29 - adds r0, r1 - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r6, 0x13] - mov r8, r1 - ldrh r1, [r6, 0x1A] - muls r1, r0 - ldrb r0, [r6, 0x14] - lsls r0, 28 - lsrs r0, 28 - adds r0, r1 - lsls r0, 24 - lsrs r7, r0, 24 - ldrb r0, [r6, 0x17] - lsrs r0, 6 - cmp r0, 0x1 - beq _081AEC0C - cmp r0, 0x1 - bgt _081AEB66 - cmp r0, 0 - beq _081AEB70 - b _081AEC0C -_081AEB66: - cmp r0, 0x2 - beq _081AEB84 - cmp r0, 0x3 - beq _081AEBCC - b _081AEC0C -_081AEB70: - ldr r1, =gUnknown_085E8D60 - adds r0, r6, 0 - mov r2, r8 - adds r3, r7, 0 - bl ListMenuPrint - b _081AEC0C - .pool -_081AEB84: - ldrb r0, [r6, 0x1E] - cmp r0, 0xFF - bne _081AEB94 - adds r0, r6, 0 - movs r1, 0 - bl ListMenuAddCursorObject - strb r0, [r6, 0x1E] -_081AEB94: - ldrb r5, [r6, 0x1E] - ldrb r0, [r6, 0x10] - movs r1, 0x1 - bl GetWindowAttribute - adds r4, r0, 0 - lsls r4, 19 - ldr r0, =0xffff0000 - adds r4, r0 - lsrs r4, 16 - ldrb r0, [r6, 0x10] - movs r1, 0x2 - bl GetWindowAttribute - adds r2, r0, 0 - lsls r2, 3 - adds r2, r7 - subs r2, 0x1 - lsls r2, 16 - lsrs r2, 16 - adds r0, r5, 0 - adds r1, r4, 0 - movs r3, 0 - bl ListMenuUpdateCursorObject - b _081AEC0C - .pool -_081AEBCC: - ldrb r0, [r6, 0x1E] - cmp r0, 0xFF - bne _081AEBDC - adds r0, r6, 0 - movs r1, 0x1 - bl ListMenuAddCursorObject - strb r0, [r6, 0x1E] -_081AEBDC: - ldrb r5, [r6, 0x1E] - ldrb r0, [r6, 0x10] - movs r1, 0x1 - bl GetWindowAttribute - adds r4, r0, 0 - lsls r4, 3 - add r4, r8 - lsls r4, 16 - lsrs r4, 16 - ldrb r0, [r6, 0x10] - movs r1, 0x2 - bl GetWindowAttribute - adds r2, r0, 0 - lsls r2, 3 - adds r2, r7 - lsls r2, 16 - lsrs r2, 16 - adds r0, r5, 0 - adds r1, r4, 0 - movs r3, 0x1 - bl ListMenuUpdateCursorObject -_081AEC0C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end ListMenuDrawCursor - - thumb_func_start ListMenuAddCursorObject -ListMenuAddCursorObject: @ 81AEC18 - push {r4,r5,lr} - sub sp, 0xC - adds r4, r0, 0 - adds r5, r1, 0 - mov r1, sp - movs r0, 0 - strb r0, [r1] - movs r0, 0xA0 - strb r0, [r1, 0x1] - ldrb r0, [r4, 0x10] - movs r1, 0x3 - bl GetWindowAttribute - mov r1, sp - lsls r0, 3 - adds r0, 0x2 - strh r0, [r1, 0x2] - ldrb r0, [r4, 0x17] - lsls r0, 26 - lsrs r0, 26 - movs r1, 0x1 - bl GetFontAttribute - mov r1, sp - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x2 - strh r0, [r1, 0x4] - movs r0, 0x80 - lsls r0, 7 - strh r0, [r1, 0x6] - ldr r0, =0x0000ffff - strh r0, [r1, 0x8] - movs r0, 0xF - strb r0, [r1, 0xA] - mov r0, sp - adds r1, r5, 0 - bl ListMenuAddCursorObjectInternal - lsls r0, 24 - lsrs r0, 24 - add sp, 0xC - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end ListMenuAddCursorObject - - thumb_func_start ListMenuErasePrintedCursor -ListMenuErasePrintedCursor: @ 81AEC78 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - adds r7, r0, 0 - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - ldrb r1, [r7, 0x17] - lsrs r0, r1, 6 - cmp r0, 0 - bne _081AECF4 - lsls r0, r1, 26 - lsrs r0, 26 - movs r1, 0x1 - bl GetFontAttribute - adds r4, r0, 0 - ldrb r0, [r7, 0x16] - lsls r0, 26 - lsrs r0, 29 - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - ldrb r0, [r7, 0x17] - lsls r0, 26 - lsrs r0, 26 - movs r1, 0 - bl GetMenuCursorDimensionByFont - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldrb r0, [r7, 0x17] - lsls r0, 26 - lsrs r0, 26 - movs r1, 0x1 - bl GetMenuCursorDimensionByFont - lsls r0, 24 - lsrs r0, 24 - ldrb r6, [r7, 0x10] - ldrb r2, [r7, 0x15] - lsls r2, 28 - lsrs r1, r2, 4 - orrs r1, r2 - lsrs r1, 24 - ldrb r2, [r7, 0x13] - mov r3, r8 - muls r3, r4 - adds r4, r3, 0 - ldrb r3, [r7, 0x14] - lsls r3, 28 - lsrs r3, 28 - adds r3, r4 - lsls r3, 16 - lsrs r3, 16 - str r5, [sp] - str r0, [sp, 0x4] - adds r0, r6, 0 - bl FillWindowPixelRect -_081AECF4: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end ListMenuErasePrintedCursor - - thumb_func_start ListMenuUpdateSelectedRowIndexAndScrollOffset -@ u8 ListMenuUpdateSelectedRowIndexAndScrollOffset(int, bool8 movingDown) -ListMenuUpdateSelectedRowIndexAndScrollOffset: @ 81AED00 - push {r4-r6,lr} - adds r4, r0, 0 - lsls r1, 24 - ldrh r3, [r4, 0x1A] - ldrh r5, [r4, 0x18] - cmp r1, 0 - bne _081AED74 - ldrh r0, [r4, 0xE] - cmp r0, 0x1 - bne _081AED18 - movs r2, 0 - b _081AED2A -_081AED18: - ldrh r0, [r4, 0xE] - lsrs r2, r0, 1 - movs r1, 0x1 - ands r1, r0 - adds r2, r1 - subs r0, r2 - subs r0, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 -_081AED2A: - cmp r5, 0 - bne _081AED50 - cmp r3, 0 - beq _081AEDB6 - ldr r1, [r4] - movs r2, 0x3 - negs r2, r2 -_081AED38: - subs r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - adds r0, r5, r3 - lsls r0, 3 - adds r0, r1 - ldr r0, [r0, 0x4] - cmp r0, r2 - bne _081AEDBA - cmp r3, 0 - bne _081AED38 - b _081AEDB6 -_081AED50: - cmp r3, r2 - bls _081AED70 - ldr r1, [r4] - movs r6, 0x3 - negs r6, r6 -_081AED5A: - subs r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - adds r0, r5, r3 - lsls r0, 3 - adds r0, r1 - ldr r0, [r0, 0x4] - cmp r0, r6 - bne _081AEDBA - cmp r3, r2 - bhi _081AED5A -_081AED70: - subs r0, r5, 0x1 - b _081AEDE2 -_081AED74: - ldrh r0, [r4, 0xE] - cmp r0, 0x1 - bne _081AED7E - movs r2, 0 - b _081AED88 -_081AED7E: - ldrh r0, [r4, 0xE] - lsrs r2, r0, 1 - movs r1, 0x1 - ands r1, r0 - adds r2, r1 -_081AED88: - adds r1, r0, 0 - ldrh r0, [r4, 0xC] - subs r0, r1 - cmp r5, r0 - bne _081AEDC0 - subs r0, r1, 0x1 - cmp r3, r0 - bge _081AEDB6 - ldr r2, [r4] - movs r6, 0x3 - negs r6, r6 - adds r1, r0, 0 -_081AEDA0: - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - adds r0, r5, r3 - lsls r0, 3 - adds r0, r2 - ldr r0, [r0, 0x4] - cmp r0, r6 - bne _081AEDBA - cmp r3, r1 - blt _081AEDA0 -_081AEDB6: - movs r0, 0 - b _081AEDE8 -_081AEDBA: - strh r3, [r4, 0x1A] - movs r0, 0x1 - b _081AEDE8 -_081AEDC0: - cmp r3, r2 - bcs _081AEDE0 - ldr r1, [r4] - movs r6, 0x3 - negs r6, r6 -_081AEDCA: - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - adds r0, r5, r3 - lsls r0, 3 - adds r0, r1 - ldr r0, [r0, 0x4] - cmp r0, r6 - bne _081AEDBA - cmp r3, r2 - bcc _081AEDCA -_081AEDE0: - adds r0, r5, 0x1 -_081AEDE2: - strh r2, [r4, 0x1A] - strh r0, [r4, 0x18] - movs r0, 0x2 -_081AEDE8: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end ListMenuUpdateSelectedRowIndexAndScrollOffset - - thumb_func_start ListMenuScroll -@ void ListMenuScroll(struct ListMenu *listMenu, int a2, bool8 movingDown) -ListMenuScroll: @ 81AEDF0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - adds r6, r0, 0 - lsls r1, 24 - lsrs r5, r1, 24 - adds r7, r5, 0 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - ldrh r0, [r6, 0xE] - cmp r5, r0 - bcc _081AEE2A - ldrb r0, [r6, 0x10] - ldrb r2, [r6, 0x15] - lsls r2, 28 - lsrs r1, r2, 4 - orrs r1, r2 - lsrs r1, 24 - bl FillWindowPixelBuffer - ldrh r1, [r6, 0x18] - ldrh r3, [r6, 0xE] - adds r0, r6, 0 - movs r2, 0 - bl ListMenuPrintEntries - b _081AEF1A -_081AEE2A: - ldrb r0, [r6, 0x17] - lsls r0, 26 - lsrs r0, 26 - movs r1, 0x1 - bl GetFontAttribute - ldrb r1, [r6, 0x16] - lsls r1, 26 - lsrs r1, 29 - adds r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - mov r1, r8 - cmp r1, 0 - bne _081AEEBC - ldrb r0, [r6, 0x10] - adds r2, r5, 0 - muls r2, r4 - lsls r2, 24 - lsrs r2, 24 - ldrb r1, [r6, 0x15] - lsls r1, 28 - lsrs r3, r1, 4 - orrs r3, r1 - lsrs r3, 24 - movs r1, 0x1 - bl ScrollWindow - ldrh r1, [r6, 0x18] - adds r0, r6, 0 - movs r2, 0 - adds r3, r5, 0 - bl ListMenuPrintEntries - ldrh r0, [r6, 0xE] - adds r1, r0, 0 - muls r1, r4 - adds r0, r1, 0 - ldrb r4, [r6, 0x14] - lsls r4, 28 - lsrs r4, 28 - adds r4, r0 - lsls r4, 16 - lsrs r4, 16 - ldrb r0, [r6, 0x10] - movs r1, 0x3 - bl GetWindowAttribute - adds r5, r0, 0 - lsls r5, 19 - lsrs r5, 16 - ldrb r0, [r6, 0x10] - movs r1, 0x4 - bl GetWindowAttribute - lsls r0, 3 - subs r0, r4 - lsls r0, 16 - lsrs r0, 16 - ldrb r3, [r6, 0x10] - ldrb r2, [r6, 0x15] - lsls r2, 28 - lsrs r1, r2, 4 - orrs r1, r2 - lsrs r1, 24 - str r5, [sp] - str r0, [sp, 0x4] - adds r0, r3, 0 - movs r2, 0 - adds r3, r4, 0 - bl FillWindowPixelRect - b _081AEF1A -_081AEEBC: - ldrb r0, [r6, 0x10] - adds r2, r7, 0 - muls r2, r4 - lsls r2, 24 - lsrs r2, 24 - ldrb r1, [r6, 0x15] - lsls r1, 28 - lsrs r3, r1, 4 - orrs r3, r1 - lsrs r3, 24 - movs r1, 0 - bl ScrollWindow - ldrh r2, [r6, 0xE] - subs r2, r7 - ldrh r1, [r6, 0x18] - adds r1, r2 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 16 - lsrs r2, 16 - adds r0, r6, 0 - adds r3, r7, 0 - bl ListMenuPrintEntries - ldrb r0, [r6, 0x10] - movs r1, 0x3 - bl GetWindowAttribute - lsls r0, 19 - lsrs r0, 16 - ldrb r3, [r6, 0x10] - ldrb r2, [r6, 0x15] - lsls r2, 28 - lsrs r1, r2, 4 - orrs r1, r2 - lsrs r1, 24 - str r0, [sp] - ldrb r0, [r6, 0x14] - lsls r0, 28 - lsrs r0, 28 - str r0, [sp, 0x4] - adds r0, r3, 0 - movs r2, 0 - movs r3, 0 - bl FillWindowPixelRect -_081AEF1A: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end ListMenuScroll - - thumb_func_start ListMenuChangeSelection -@ bool8 ListMenuChangeSelection(struct ListMenu *listMenu, bool8 updateCursorAndCallCallback, u8 count, bool8 movingDown) -ListMenuChangeSelection: @ 81AEF28 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r4, r0, 0 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp] - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - lsls r3, 24 - lsrs r3, 24 - mov r9, r3 - ldrh r0, [r4, 0x1A] - mov r10, r0 - movs r7, 0 - movs r5, 0 - movs r0, 0 - cmp r7, r8 - bcs _081AEF90 -_081AEF56: - adds r6, r0, 0x1 - b _081AEF76 -_081AEF5A: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - ldrh r0, [r4, 0x18] - ldrh r1, [r4, 0x1A] - adds r0, r1 - ldr r1, [r4] - lsls r0, 3 - adds r0, r1 - ldr r1, [r0, 0x4] - movs r0, 0x3 - negs r0, r0 - cmp r1, r0 - bne _081AEF88 -_081AEF76: - adds r0, r4, 0 - mov r1, r9 - bl ListMenuUpdateSelectedRowIndexAndScrollOffset - lsls r0, 24 - lsrs r0, 24 - orrs r5, r0 - cmp r0, 0x2 - beq _081AEF5A -_081AEF88: - lsls r0, r6, 24 - lsrs r0, 24 - cmp r0, r8 - bcc _081AEF56 -_081AEF90: - ldr r0, [sp] - cmp r0, 0 - beq _081AEFEE - cmp r5, 0x1 - beq _081AEFA6 - cmp r5, 0x1 - ble _081AEFA2 - cmp r5, 0x3 - ble _081AEFC6 -_081AEFA2: - movs r0, 0x1 - b _081AEFF0 -_081AEFA6: - adds r0, r4, 0 - mov r1, r10 - bl ListMenuErasePrintedCursor - adds r0, r4, 0 - bl ListMenuDrawCursor - adds r0, r4, 0 - movs r1, 0 - bl ListMenuCallSelectionChangedCallback - ldrb r0, [r4, 0x10] - movs r1, 0x2 - bl CopyWindowToVram - b _081AEFEE -_081AEFC6: - adds r0, r4, 0 - mov r1, r10 - bl ListMenuErasePrintedCursor - adds r0, r4, 0 - adds r1, r7, 0 - mov r2, r9 - bl ListMenuScroll - adds r0, r4, 0 - bl ListMenuDrawCursor - adds r0, r4, 0 - movs r1, 0 - bl ListMenuCallSelectionChangedCallback - ldrb r0, [r4, 0x10] - movs r1, 0x2 - bl CopyWindowToVram -_081AEFEE: - movs r0, 0 -_081AEFF0: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end ListMenuChangeSelection - - thumb_func_start ListMenuCallSelectionChangedCallback -@ void ListMenuCallSelectionChangedCallback(struct ListMenu *listMenu, u8 a2) -ListMenuCallSelectionChangedCallback: @ 81AF000 - push {r4,lr} - adds r2, r0, 0 - lsls r1, 24 - lsrs r4, r1, 24 - ldr r3, [r2, 0x4] - cmp r3, 0 - beq _081AF022 - ldrh r0, [r2, 0x18] - ldrh r1, [r2, 0x1A] - adds r0, r1 - ldr r1, [r2] - lsls r0, 3 - adds r0, r1 - ldr r0, [r0, 0x4] - adds r1, r4, 0 - bl _call_via_r3 -_081AF022: - pop {r4} - pop {r0} - bx r0 - thumb_func_end ListMenuCallSelectionChangedCallback - - thumb_func_start sub_81AF028 -sub_81AF028: @ 81AF028 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsls r2, 24 - lsrs r2, 24 - ldr r6, =gUnknown_03006300 - movs r5, 0xF - ands r0, r5 - ldrb r3, [r6] - mov r8, r3 - movs r4, 0x10 - negs r4, r4 - adds r3, r4, 0 - mov r7, r8 - ands r3, r7 - orrs r3, r0 - lsrs r1, 20 - ands r3, r5 - orrs r3, r1 - strb r3, [r6] - ands r2, r5 - ldrb r0, [r6, 0x1] - ands r4, r0 - orrs r4, r2 - strb r4, [r6, 0x1] - ldrb r0, [r6, 0x3] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r6, 0x3] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AF028 - - thumb_func_start sub_81AF078 -sub_81AF078: @ 81AF078 - push {lr} - lsls r1, 24 - cmp r1, 0 - bne _081AF086 - movs r0, 0x5 - bl PlaySE -_081AF086: - pop {r0} - bx r0 - thumb_func_end sub_81AF078 - - thumb_func_start sub_81AF08C -sub_81AF08C: @ 81AF08C - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r3, r1, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r2, r1, r0 - cmp r3, 0x10 - bhi _081AF154 - lsls r0, r3, 2 - ldr r1, =_081AF0B8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081AF0B8: - .4byte _081AF0FC - .4byte _081AF0FC - .4byte _081AF100 - .4byte _081AF104 - .4byte _081AF108 - .4byte _081AF10C - .4byte _081AF110 - .4byte _081AF114 - .4byte _081AF118 - .4byte _081AF11C - .4byte _081AF122 - .4byte _081AF12A - .4byte _081AF130 - .4byte _081AF138 - .4byte _081AF140 - .4byte _081AF146 - .4byte _081AF14E -_081AF0FC: - ldr r0, [r2, 0x4] - b _081AF158 -_081AF100: - ldrh r0, [r2, 0xC] - b _081AF158 -_081AF104: - ldrh r0, [r2, 0xE] - b _081AF158 -_081AF108: - ldrb r0, [r2, 0x10] - b _081AF158 -_081AF10C: - ldrb r0, [r2, 0x11] - b _081AF158 -_081AF110: - ldrb r0, [r2, 0x12] - b _081AF158 -_081AF114: - ldrb r0, [r2, 0x13] - b _081AF158 -_081AF118: - ldrb r0, [r2, 0x14] - b _081AF124 -_081AF11C: - ldrb r0, [r2, 0x14] - lsrs r0, 4 - b _081AF158 -_081AF122: - ldrb r0, [r2, 0x15] -_081AF124: - lsls r0, 28 - lsrs r0, 28 - b _081AF158 -_081AF12A: - ldrb r0, [r2, 0x15] - lsrs r0, 4 - b _081AF158 -_081AF130: - ldrb r0, [r2, 0x16] - lsls r0, 29 - lsrs r0, 29 - b _081AF158 -_081AF138: - ldrb r0, [r2, 0x16] - lsls r0, 26 - lsrs r0, 29 - b _081AF158 -_081AF140: - ldrb r0, [r2, 0x16] - lsrs r0, 6 - b _081AF158 -_081AF146: - ldrb r0, [r2, 0x17] - lsls r0, 26 - lsrs r0, 26 - b _081AF158 -_081AF14E: - ldrb r0, [r2, 0x17] - lsrs r0, 6 - b _081AF158 -_081AF154: - movs r0, 0x1 - negs r0, r0 -_081AF158: - pop {r1} - bx r1 - thumb_func_end sub_81AF08C - - thumb_func_start sub_81AF15C -sub_81AF15C: @ 81AF15C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r3, r1, r0 - cmp r4, 0x10 - bhi _081AF25C - lsls r0, r4, 2 - ldr r1, =_081AF188 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081AF188: - .4byte _081AF1CC - .4byte _081AF1CC - .4byte _081AF1D0 - .4byte _081AF1D4 - .4byte _081AF1D8 - .4byte _081AF1DC - .4byte _081AF1E0 - .4byte _081AF1E4 - .4byte _081AF1E8 - .4byte _081AF1F4 - .4byte _081AF202 - .4byte _081AF20E - .4byte _081AF21C - .4byte _081AF228 - .4byte _081AF236 - .4byte _081AF244 - .4byte _081AF250 -_081AF1CC: - str r2, [r3, 0x4] - b _081AF25C -_081AF1D0: - strh r2, [r3, 0xC] - b _081AF25C -_081AF1D4: - strh r2, [r3, 0xE] - b _081AF25C -_081AF1D8: - strb r2, [r3, 0x10] - b _081AF25C -_081AF1DC: - strb r2, [r3, 0x11] - b _081AF25C -_081AF1E0: - strb r2, [r3, 0x12] - b _081AF25C -_081AF1E4: - strb r2, [r3, 0x13] - b _081AF25C -_081AF1E8: - movs r0, 0xF - ands r2, r0 - ldrb r1, [r3, 0x14] - movs r0, 0x10 - negs r0, r0 - b _081AF1FA -_081AF1F4: - lsls r2, 4 - ldrb r1, [r3, 0x14] - movs r0, 0xF -_081AF1FA: - ands r0, r1 - orrs r0, r2 - strb r0, [r3, 0x14] - b _081AF25C -_081AF202: - movs r0, 0xF - ands r2, r0 - ldrb r1, [r3, 0x15] - movs r0, 0x10 - negs r0, r0 - b _081AF214 -_081AF20E: - lsls r2, 4 - ldrb r1, [r3, 0x15] - movs r0, 0xF -_081AF214: - ands r0, r1 - orrs r0, r2 - strb r0, [r3, 0x15] - b _081AF25C -_081AF21C: - movs r0, 0x7 - ands r2, r0 - ldrb r1, [r3, 0x16] - movs r0, 0x8 - negs r0, r0 - b _081AF23C -_081AF228: - movs r0, 0x7 - ands r2, r0 - lsls r2, 3 - ldrb r1, [r3, 0x16] - movs r0, 0x39 - negs r0, r0 - b _081AF23C -_081AF236: - lsls r2, 6 - ldrb r1, [r3, 0x16] - movs r0, 0x3F -_081AF23C: - ands r0, r1 - orrs r0, r2 - strb r0, [r3, 0x16] - b _081AF25C -_081AF244: - movs r0, 0x3F - ands r2, r0 - ldrb r1, [r3, 0x17] - movs r0, 0x40 - negs r0, r0 - b _081AF256 -_081AF250: - lsls r2, 6 - ldrb r1, [r3, 0x17] - movs r0, 0x3F -_081AF256: - ands r0, r1 - orrs r0, r2 - strb r0, [r3, 0x17] -_081AF25C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81AF15C - - thumb_func_start sub_81AF264 -sub_81AF264: @ 81AF264 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _081AF276 - cmp r0, 0x1 - beq _081AF28A - b _081AF2E4 -_081AF276: - ldrh r1, [r4, 0x30] - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartSpriteAnim - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _081AF2E4 -_081AF28A: - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _081AF29A - cmp r0, 0x1 - beq _081AF2C0 - ldrh r2, [r4, 0x38] - b _081AF2DE -_081AF29A: - movs r0, 0x34 - ldrsh r3, [r4, r0] - ldr r1, =gSineTable - ldrh r2, [r4, 0x38] - lsls r0, r2, 24 - lsrs r0, 23 - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - muls r0, r3 - cmp r0, 0 - bge _081AF2B4 - adds r0, 0xFF -_081AF2B4: - asrs r0, 8 - strh r0, [r4, 0x24] - b _081AF2DE - .pool -_081AF2C0: - movs r0, 0x34 - ldrsh r3, [r4, r0] - ldr r1, =gSineTable - ldrh r2, [r4, 0x38] - lsls r0, r2, 24 - lsrs r0, 23 - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - muls r0, r3 - cmp r0, 0 - bge _081AF2DA - adds r0, 0xFF -_081AF2DA: - asrs r0, 8 - strh r0, [r4, 0x26] -_081AF2DE: - ldrh r0, [r4, 0x36] - adds r0, r2, r0 - strh r0, [r4, 0x38] -_081AF2E4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AF264 - - thumb_func_start AddScrollIndicatorArrowObject -AddScrollIndicatorArrowObject: @ 81AF2F0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x18 - adds r6, r0, 0 - ldr r5, [sp, 0x30] - lsls r6, 24 - lsrs r6, 24 - mov r8, r6 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r5, 16 - lsrs r5, 16 - mov r12, r5 - mov r4, sp - ldr r0, =gUnknown_08614244 - ldm r0!, {r5-r7} - stm r4!, {r5-r7} - ldm r0!, {r5-r7} - stm r4!, {r5-r7} - mov r0, sp - movs r4, 0 - strh r3, [r0] - mov r3, r12 - strh r3, [r0, 0x2] - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gSprites - lsls r3, r0, 4 - adds r3, r0 - lsls r3, 2 - adds r3, r1 - adds r5, r3, 0 - adds r5, 0x3E - ldrb r1, [r5] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r5] - strh r4, [r3, 0x2E] - ldr r1, =gUnknown_086141FC - mov r5, r8 - lsls r6, r5, 2 - adds r6, r1 - ldrb r2, [r6] - lsls r1, r2, 28 - lsrs r1, 28 - strh r1, [r3, 0x30] - lsrs r2, 4 - strh r2, [r3, 0x32] - ldrb r1, [r6, 0x1] - strh r1, [r3, 0x34] - ldrh r1, [r6, 0x2] - strh r1, [r3, 0x36] - strh r4, [r3, 0x38] - add sp, 0x18 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end AddScrollIndicatorArrowObject - - thumb_func_start AddScrollIndicatorArrowPair -AddScrollIndicatorArrowPair: @ 81AF380 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x14 - adds r6, r0, 0 - mov r9, r1 - ldr r0, =gUnknown_086142C8 - str r0, [sp, 0x4] - ldr r5, =0xffff0000 - ldr r0, [sp, 0x8] - ands r0, r5 - movs r1, 0x80 - lsls r1, 1 - orrs r0, r1 - ldrh r1, [r6, 0xA] - lsls r1, 16 - ldr r4, =0x0000ffff - ands r0, r4 - orrs r0, r1 - str r0, [sp, 0x8] - add r0, sp, 0x4 - bl LoadCompressedObjectPic - ldrh r2, [r6, 0xC] - cmp r2, r4 - bne _081AF3DC - ldr r0, =gUnknown_086142A8 - ldrb r1, [r6, 0xE] - lsls r1, 20 - movs r2, 0x80 - lsls r2, 17 - adds r1, r2 - lsrs r1, 16 - movs r2, 0x20 - bl LoadPalette - b _081AF3EE - .pool -_081AF3DC: - ldr r0, =gUnknown_086142A8 - str r0, [sp, 0xC] - add r0, sp, 0xC - ldr r1, [r0, 0x4] - ands r1, r5 - orrs r1, r2 - str r1, [r0, 0x4] - bl LoadSpritePalette -_081AF3EE: - ldr r0, =Task_ScrollIndicatorArrowPair - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r0, 2 - add r0, r8 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r7, r0, r1 - movs r0, 0 - strb r0, [r7] - mov r0, r9 - str r0, [r7, 0x4] - ldrh r0, [r6, 0x6] - strh r0, [r7, 0x8] - ldrh r0, [r6, 0x8] - strh r0, [r7, 0xA] - ldrh r0, [r6, 0xA] - strh r0, [r7, 0xE] - ldrh r0, [r6, 0xC] - strh r0, [r7, 0x10] - ldrb r0, [r6] - ldrb r1, [r6, 0x1] - ldrb r2, [r6, 0x2] - ldrh r3, [r6, 0xA] - ldrh r4, [r6, 0xC] - str r4, [sp] - bl AddScrollIndicatorArrowObject - strb r0, [r7, 0xC] - ldrb r0, [r6, 0x3] - ldrb r1, [r6, 0x4] - ldrb r2, [r6, 0x5] - ldrh r3, [r6, 0xA] - ldrh r4, [r6, 0xC] - str r4, [sp] - bl AddScrollIndicatorArrowObject - strb r0, [r7, 0xD] - ldrh r1, [r6, 0xC] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _081AF47C - ldr r5, =gSprites - ldrb r0, [r7, 0xC] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r3, [r6, 0xE] - lsls r3, 4 - ldrb r4, [r1, 0x5] - movs r2, 0xF - adds r0, r2, 0 - ands r0, r4 - orrs r0, r3 - strb r0, [r1, 0x5] - ldrb r1, [r7, 0xD] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrb r1, [r6, 0xE] - lsls r1, 4 - ldrb r3, [r0, 0x5] - ands r2, r3 - orrs r2, r1 - strb r2, [r0, 0x5] -_081AF47C: - mov r0, r8 - add sp, 0x14 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end AddScrollIndicatorArrowPair - - thumb_func_start AddScrollIndicatorArrowPairParametrized -AddScrollIndicatorArrowPairParametrized: @ 81AF4A0 - push {r4,lr} - adds r4, r1, 0 - subs r0, 0x2 - cmp r0, 0x1 - bhi _081AF4C4 - ldr r0, =gUnknown_0203CE8C - movs r1, 0x2 - strb r1, [r0] - strb r4, [r0, 0x1] - strb r2, [r0, 0x2] - movs r1, 0x3 - strb r1, [r0, 0x3] - strb r4, [r0, 0x4] - strb r3, [r0, 0x5] - b _081AF4D6 - .pool -_081AF4C4: - ldr r0, =gUnknown_0203CE8C - movs r1, 0 - strb r1, [r0] - strb r2, [r0, 0x1] - strb r4, [r0, 0x2] - movs r1, 0x1 - strb r1, [r0, 0x3] - strb r3, [r0, 0x4] - strb r4, [r0, 0x5] -_081AF4D6: - adds r2, r0, 0 - movs r1, 0 - movs r0, 0 - strh r0, [r2, 0x6] - ldr r0, [sp, 0x8] - strh r0, [r2, 0x8] - ldr r0, [sp, 0xC] - strh r0, [r2, 0xA] - ldr r0, [sp, 0x10] - strh r0, [r2, 0xC] - strb r1, [r2, 0xE] - adds r0, r2, 0 - ldr r1, [sp, 0x14] - bl AddScrollIndicatorArrowPair - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end AddScrollIndicatorArrowPairParametrized - - thumb_func_start Task_ScrollIndicatorArrowPair -Task_ScrollIndicatorArrowPair: @ 81AF504 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r4, r1, r0 - ldr r0, [r4, 0x4] - ldrh r5, [r0] - ldrh r0, [r4, 0x8] - cmp r5, r0 - bne _081AF548 - ldr r0, =0x0000ffff - cmp r5, r0 - beq _081AF548 - ldr r3, =gSprites - ldrb r1, [r4, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - b _081AF55E - .pool -_081AF548: - ldr r3, =gSprites - ldrb r1, [r4, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 -_081AF55E: - strb r1, [r0] - ldrh r0, [r4, 0xA] - cmp r5, r0 - bne _081AF580 - ldrb r1, [r4, 0xD] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - b _081AF594 - .pool -_081AF580: - ldrb r1, [r4, 0xD] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 -_081AF594: - strb r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end Task_ScrollIndicatorArrowPair - - thumb_func_start Task_ScrollIndicatorArrowPairOnMainMenu -Task_ScrollIndicatorArrowPairOnMainMenu: @ 81AF59C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r4, r1, r0 - movs r1, 0x1E - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _081AF5E8 - ldr r3, =gSprites - ldrb r1, [r4, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - ldrb r1, [r4, 0xD] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - b _081AF612 - .pool -_081AF5E8: - ldr r3, =gSprites - ldrb r1, [r4, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldrb r1, [r4, 0xD] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 -_081AF612: - strb r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end Task_ScrollIndicatorArrowPairOnMainMenu - - thumb_func_start RemoveScrollIndicatorArrowPair -RemoveScrollIndicatorArrowPair: @ 81AF620 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r5, r0, r1 - ldrh r0, [r5, 0xE] - ldr r4, =0x0000ffff - cmp r0, r4 - beq _081AF63E - bl FreeSpriteTilesByTag -_081AF63E: - ldrh r0, [r5, 0x10] - cmp r0, r4 - beq _081AF648 - bl FreeSpritePaletteByTag -_081AF648: - ldrb r1, [r5, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =gSprites - adds r0, r4 - bl DestroySprite - ldrb r1, [r5, 0xD] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl DestroySprite - adds r0, r6, 0 - bl DestroyTask - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end RemoveScrollIndicatorArrowPair - - thumb_func_start ListMenuAddCursorObjectInternal -ListMenuAddCursorObjectInternal: @ 81AF680 - push {lr} - cmp r1, 0 - beq _081AF68A - cmp r1, 0x1 - beq _081AF690 -_081AF68A: - bl ListMenuAddRedOutlineCursorObject - b _081AF694 -_081AF690: - bl ListMenuAddRedArrowCursorObject -_081AF694: - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end ListMenuAddCursorObjectInternal - - thumb_func_start ListMenuUpdateCursorObject -@ void ListMenuUpdateCursorObject(u8 taskId, u16 x, u16 y, u32 a4) -ListMenuUpdateCursorObject: @ 81AF69C - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 16 - lsrs r2, 16 - cmp r3, 0 - beq _081AF6B4 - cmp r3, 0x1 - beq _081AF6BA - b _081AF6BE -_081AF6B4: - bl ListMenuUpdateRedOutlineCursorObject - b _081AF6BE -_081AF6BA: - bl ListMenuUpdateRedArrowCursorObject -_081AF6BE: - pop {r0} - bx r0 - thumb_func_end ListMenuUpdateCursorObject - - thumb_func_start ListMenuRemoveCursorObject -ListMenuRemoveCursorObject: @ 81AF6C4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r1, 0 - beq _081AF6D4 - cmp r1, 0x1 - beq _081AF6DA - b _081AF6DE -_081AF6D4: - bl ListMenuRemoveRedOutlineCursorObject - b _081AF6DE -_081AF6DA: - bl ListMenuRemoveRedArrowCursorObject -_081AF6DE: - pop {r0} - bx r0 - thumb_func_end ListMenuRemoveCursorObject - - thumb_func_start Task_RedOutlineCursor -Task_RedOutlineCursor: @ 81AF6E4 - bx lr - thumb_func_end Task_RedOutlineCursor - - thumb_func_start ListMenuGetRedOutlineCursorSpriteCount -ListMenuGetRedOutlineCursorSpriteCount: @ 81AF6E8 - push {lr} - lsls r0, 16 - lsrs r0, 16 - lsls r1, 16 - lsrs r1, 16 - movs r3, 0x4 - cmp r0, 0x10 - bls _081AF708 - movs r2, 0x8 - subs r0, 0x8 - cmp r2, r0 - bge _081AF708 -_081AF700: - adds r3, 0x2 - adds r2, 0x8 - cmp r2, r0 - blt _081AF700 -_081AF708: - cmp r1, 0x10 - bls _081AF71C - movs r2, 0x8 - subs r1, 0x8 - cmp r2, r1 - bge _081AF71C -_081AF714: - adds r3, 0x2 - adds r2, 0x8 - cmp r2, r1 - blt _081AF714 -_081AF71C: - lsls r0, r3, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end ListMenuGetRedOutlineCursorSpriteCount - - thumb_func_start ListMenuSetUpRedOutlineCursorSpriteOamTable -ListMenuSetUpRedOutlineCursorSpriteOamTable: @ 81AF724 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r3, r2, 0 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - lsls r1, 16 - lsrs r1, 16 - mov r9, r1 - ldr r0, =gUnknown_0861425C - ldr r0, [r0] - str r0, [r3] - movs r1, 0x88 - strb r1, [r3] - strb r1, [r3, 0x1] - ldr r0, =gUnknown_08614260 - ldr r0, [r0] - str r0, [r3, 0x4] - mov r2, r8 - adds r2, 0x80 - strb r2, [r3, 0x4] - strb r1, [r3, 0x5] - ldr r0, =gUnknown_08614274 - ldr r0, [r0] - str r0, [r3, 0x8] - strb r1, [r3, 0x8] - mov r4, r9 - adds r4, 0x80 - strb r4, [r3, 0x9] - ldr r0, =gUnknown_08614278 - ldr r0, [r0] - str r0, [r3, 0xC] - strb r2, [r3, 0xC] - strb r4, [r3, 0xD] - movs r0, 0x4 - mov r12, r0 - mov r2, r8 - cmp r2, 0x10 - bls _081AF7B8 - movs r2, 0x8 - mov r5, r8 - subs r5, 0x8 - cmp r2, r5 - bge _081AF7B8 - ldr r0, =gUnknown_08614264 - ldr r0, [r0] - str r0, [sp] - ldr r0, =gUnknown_08614270 - ldr r6, [r0] - adds r1, r3, 0 - adds r1, 0x10 - movs r7, 0x88 - mov r10, r7 -_081AF796: - ldr r0, [sp] - str r0, [r1] - adds r0, r2, 0 - subs r0, 0x78 - strb r0, [r1] - mov r7, r10 - strb r7, [r1, 0x1] - adds r1, 0x4 - str r6, [r1] - strb r0, [r1] - strb r4, [r1, 0x1] - adds r1, 0x4 - movs r0, 0x2 - add r12, r0 - adds r2, 0x8 - cmp r2, r5 - blt _081AF796 -_081AF7B8: - mov r2, r9 - cmp r2, 0x10 - bls _081AF7F6 - movs r1, 0x8 - mov r4, r9 - subs r4, 0x8 - cmp r1, r4 - bge _081AF7F6 - ldr r0, =gUnknown_08614268 - ldr r6, [r0] - ldr r0, =gUnknown_0861426C - ldr r5, [r0] - mov r7, r12 - lsls r0, r7, 2 - adds r2, r0, r3 - movs r7, 0x88 - mov r3, r8 - adds r3, 0x80 -_081AF7DC: - str r6, [r2] - strb r7, [r2] - adds r0, r1, 0 - subs r0, 0x78 - strb r0, [r2, 0x1] - adds r2, 0x4 - str r5, [r2] - strb r3, [r2] - strb r0, [r2, 0x1] - adds r2, 0x4 - adds r1, 0x8 - cmp r1, r4 - blt _081AF7DC -_081AF7F6: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end ListMenuSetUpRedOutlineCursorSpriteOamTable - - thumb_func_start ListMenuAddRedOutlineCursorObject -ListMenuAddRedOutlineCursorObject: @ 81AF828 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x28 - adds r6, r0, 0 - ldr r0, =gUnknown_08614338 - str r0, [sp, 0x18] - ldr r5, =0xffff0000 - add r0, sp, 0x18 - ldr r1, [r0, 0x4] - ands r1, r5 - movs r2, 0x80 - lsls r2, 1 - orrs r1, r2 - ldrh r2, [r6, 0x6] - lsls r2, 16 - ldr r3, =0x0000ffff - ands r1, r3 - orrs r1, r2 - str r1, [r0, 0x4] - bl LoadCompressedObjectPic - ldrh r2, [r6, 0x8] - ldr r7, =0x0000ffff - cmp r2, r7 - bne _081AF884 - ldr r0, =gUnknown_086142A8 - ldrb r1, [r6, 0xA] - lsls r1, 20 - movs r2, 0x80 - lsls r2, 17 - adds r1, r2 - lsrs r1, 16 - movs r2, 0x20 - bl LoadPalette - b _081AF896 - .pool -_081AF884: - ldr r0, =gUnknown_086142A8 - str r0, [sp, 0x20] - add r0, sp, 0x20 - ldr r1, [r0, 0x4] - ands r1, r5 - orrs r1, r2 - str r1, [r0, 0x4] - bl LoadSpritePalette -_081AF896: - ldr r0, =Task_RedOutlineCursor - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r5, r0, r1 - ldrh r0, [r6, 0x6] - movs r3, 0 - mov r8, r3 - strh r0, [r5, 0xE] - ldrh r0, [r6, 0x8] - strh r0, [r5, 0x10] - ldrh r0, [r6, 0x2] - ldrh r1, [r6, 0x4] - bl ListMenuGetRedOutlineCursorSpriteCount - strb r0, [r5] - ldrb r0, [r5] - lsls r0, 2 - bl Alloc - adds r2, r0, 0 - str r2, [r5, 0x8] - str r2, [r5, 0x4] - ldrh r0, [r6, 0x2] - ldrh r1, [r6, 0x4] - bl ListMenuSetUpRedOutlineCursorSpriteOamTable - mov r1, sp - ldr r0, =gDummySpriteTemplate - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - mov r1, sp - ldrh r0, [r6, 0x6] - strh r0, [r1] - ldrh r0, [r6, 0x8] - strh r0, [r1, 0x2] - ldrb r1, [r6] - adds r1, 0x78 - ldrb r2, [r6, 0x1] - adds r2, 0x78 - mov r0, sp - movs r3, 0 - bl CreateSprite - strb r0, [r5, 0xC] - ldrb r1, [r5, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r7, =gSprites - adds r0, r7 - adds r1, r5, 0 - bl SetSubspriteTables - ldrb r0, [r5, 0xC] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r7 - ldrb r2, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x5] - ldrb r1, [r5, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - adds r0, 0x43 - mov r1, r8 - strb r1, [r0] - ldrb r1, [r5, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - adds r0, 0x42 - ldrb r2, [r0] - movs r1, 0x40 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - ldrh r1, [r6, 0x8] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _081AF96E - ldrb r0, [r5, 0xC] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r7 - ldrb r2, [r6, 0xA] - lsls r2, 4 - ldrb r3, [r1, 0x5] - movs r0, 0xF - ands r0, r3 - orrs r0, r2 - strb r0, [r1, 0x5] -_081AF96E: - adds r0, r4, 0 - add sp, 0x28 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end ListMenuAddRedOutlineCursorObject - - thumb_func_start ListMenuUpdateRedOutlineCursorObject -@ void ListMenuUpdateRedOutlineCursorObject(u8 taskId, u16 x, u16 y) -ListMenuUpdateRedOutlineCursorObject: @ 81AF994 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 16 - lsrs r2, 16 - lsls r3, r0, 2 - adds r3, r0 - lsls r3, 3 - ldr r0, =gTasks + 0x8 - adds r3, r0 - ldr r5, =gSprites - ldrb r4, [r3, 0xC] - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r5 - adds r1, 0x78 - strh r1, [r0, 0x20] - ldrb r1, [r3, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r2, 0x78 - strh r2, [r0, 0x22] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ListMenuUpdateRedOutlineCursorObject - - thumb_func_start ListMenuRemoveRedOutlineCursorObject -ListMenuRemoveRedOutlineCursorObject: @ 81AF9D8 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - ldr r0, [r4, 0x8] - bl Free - ldrh r0, [r4, 0xE] - ldr r6, =0x0000ffff - cmp r0, r6 - beq _081AF9FC - bl FreeSpriteTilesByTag -_081AF9FC: - ldrh r0, [r4, 0x10] - cmp r0, r6 - beq _081AFA06 - bl FreeSpritePaletteByTag -_081AFA06: - ldrb r1, [r4, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl DestroySprite - adds r0, r5, 0 - bl DestroyTask - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end ListMenuRemoveRedOutlineCursorObject - - thumb_func_start ObjectCB_RedArrowCursor -ObjectCB_RedArrowCursor: @ 81AFA30 - push {lr} - adds r2, r0, 0 - ldr r1, =gSineTable - ldrh r3, [r2, 0x2E] - lsls r0, r3, 24 - lsrs r0, 23 - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bge _081AFA48 - adds r0, 0x3F -_081AFA48: - asrs r0, 6 - strh r0, [r2, 0x24] - adds r0, r3, 0 - adds r0, 0x8 - strh r0, [r2, 0x2E] - pop {r0} - bx r0 - .pool - thumb_func_end ObjectCB_RedArrowCursor - - thumb_func_start Task_RedArrowCursor -Task_RedArrowCursor: @ 81AFA5C - bx lr - thumb_func_end Task_RedArrowCursor - - thumb_func_start ListMenuAddRedArrowCursorObject -ListMenuAddRedArrowCursorObject: @ 81AFA60 - push {r4-r7,lr} - sub sp, 0x28 - adds r5, r0, 0 - ldr r0, =gUnknown_08614378 - str r0, [sp, 0x18] - ldr r6, =0xffff0000 - add r0, sp, 0x18 - ldr r1, [r0, 0x4] - ands r1, r6 - movs r2, 0x80 - orrs r1, r2 - ldrh r2, [r5, 0x6] - lsls r2, 16 - ldr r4, =0x0000ffff - ands r1, r4 - orrs r1, r2 - str r1, [r0, 0x4] - bl LoadCompressedObjectPic - ldrh r2, [r5, 0x8] - cmp r2, r4 - bne _081AFAB4 - ldr r0, =gUnknown_086142A8 - ldrb r1, [r5, 0xA] - lsls r1, 20 - movs r2, 0x80 - lsls r2, 17 - adds r1, r2 - lsrs r1, 16 - movs r2, 0x20 - bl LoadPalette - b _081AFAC6 - .pool -_081AFAB4: - ldr r0, =gUnknown_086142A8 - str r0, [sp, 0x20] - add r0, sp, 0x20 - ldr r1, [r0, 0x4] - ands r1, r6 - orrs r1, r2 - str r1, [r0, 0x4] - bl LoadSpritePalette -_081AFAC6: - ldr r0, =Task_RedArrowCursor - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - ldrh r0, [r5, 0x6] - strh r0, [r4, 0x2] - ldrh r0, [r5, 0x8] - strh r0, [r4, 0x4] - mov r1, sp - ldr r0, =gUnknown_08614290 - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - mov r1, sp - ldrh r0, [r5, 0x6] - strh r0, [r1] - ldrh r0, [r5, 0x8] - strh r0, [r1, 0x2] - ldrb r1, [r5] - ldrb r2, [r5, 0x1] - mov r0, sp - movs r3, 0 - bl CreateSprite - strb r0, [r4] - ldr r3, =gSprites - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r2, 0x8 - strh r2, [r0, 0x24] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r2, [r0, 0x26] - ldrh r1, [r5, 0x8] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _081AFB46 - ldrb r0, [r4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r2, [r5, 0xA] - lsls r2, 4 - ldrb r3, [r1, 0x5] - movs r0, 0xF - ands r0, r3 - orrs r0, r2 - strb r0, [r1, 0x5] -_081AFB46: - adds r0, r6, 0 - add sp, 0x28 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end ListMenuAddRedArrowCursorObject - - thumb_func_start ListMenuUpdateRedArrowCursorObject -@ void ListMenuUpdateRedArrowCursorObject(u8 taskId, u16 x, u16 y) -ListMenuUpdateRedArrowCursorObject: @ 81AFB68 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r3, r0, 2 - adds r3, r0 - lsls r3, 3 - ldr r0, =gTasks + 0x8 - adds r3, r0 - ldr r5, =gSprites - ldrb r4, [r3] - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r5 - strh r1, [r0, 0x20] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r2, [r0, 0x22] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ListMenuUpdateRedArrowCursorObject - - thumb_func_start ListMenuRemoveRedArrowCursorObject -ListMenuRemoveRedArrowCursorObject: @ 81AFBA0 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - ldrh r0, [r4, 0x2] - ldr r6, =0x0000ffff - cmp r0, r6 - beq _081AFBBE - bl FreeSpriteTilesByTag -_081AFBBE: - ldrh r0, [r4, 0x4] - cmp r0, r6 - beq _081AFBC8 - bl FreeSpritePaletteByTag -_081AFBC8: - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl DestroySprite - adds r0, r5, 0 - bl DestroyTask - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end ListMenuRemoveRedArrowCursorObject - - thumb_func_start sub_81AFBF0 -sub_81AFBF0: @ 81AFBF0 - push {lr} - ldr r1, =gUnknown_0203CE9C - movs r2, 0 - adds r0, r1, 0 - adds r0, 0x1C -_081AFBFA: - str r2, [r0] - subs r0, 0x4 - cmp r0, r1 - bge _081AFBFA - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AFBF0 - - thumb_func_start sub_81AFC0C -sub_81AFC0C: @ 81AFC0C - push {lr} - adds r2, r1, 0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x7 - bhi _081AFC20 - ldr r1, =gUnknown_0203CE9C - lsls r0, 2 - adds r0, r1 - str r2, [r0] -_081AFC20: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AFC0C - - thumb_func_start sub_81AFC28 -sub_81AFC28: @ 81AFC28 - push {r4,r5,lr} - adds r2, r0, 0 - adds r4, r1, 0 - ldrb r1, [r4] - adds r0, r1, 0 - cmp r0, 0xFF - beq _081AFC68 - ldr r5, =gUnknown_0203CE9C -_081AFC38: - cmp r1, 0xF7 - beq _081AFC48 - strb r1, [r2] - adds r4, 0x1 - adds r2, 0x1 - b _081AFC60 - .pool -_081AFC48: - adds r4, 0x1 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r5 - ldr r1, [r0] - cmp r1, 0 - beq _081AFC5E - adds r0, r2, 0 - bl StringCopy - adds r2, r0, 0 -_081AFC5E: - adds r4, 0x1 -_081AFC60: - ldrb r1, [r4] - adds r0, r1, 0 - cmp r0, 0xFF - bne _081AFC38 -_081AFC68: - movs r0, 0xFF - strb r0, [r2] - adds r0, r2, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81AFC28 - - thumb_func_start sub_81AFC74 -sub_81AFC74: @ 81AFC74 - lsls r0, 24 - ldr r1, =gUnknown_0203CE9C - lsrs r0, 22 - adds r0, r1 - ldr r0, [r0] - bx lr - .pool - thumb_func_end sub_81AFC74 - - thumb_func_start sav1_are_mapnumbers_in_given_list -sav1_are_mapnumbers_in_given_list: @ 81AFC84 - push {r4,lr} - adds r2, r0, 0 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0x4 - ldrsb r1, [r0, r1] - lsls r1, 8 - ldrb r0, [r0, 0x5] - lsls r0, 24 - asrs r0, 24 - adds r0, r1 - lsls r0, 16 - lsrs r3, r0, 16 - ldrh r0, [r2] - ldr r1, =0x0000ffff - cmp r0, r1 - beq _081AFCC4 - adds r4, r1, 0 - adds r1, r2, 0 -_081AFCAA: - ldrh r0, [r1] - cmp r0, r3 - bne _081AFCBC - movs r0, 0x1 - b _081AFCC6 - .pool -_081AFCBC: - adds r1, 0x2 - ldrh r0, [r1] - cmp r0, r4 - bne _081AFCAA -_081AFCC4: - movs r0, 0 -_081AFCC6: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sav1_are_mapnumbers_in_given_list - - thumb_func_start sav1_is_in_pokecenter -sav1_is_in_pokecenter: @ 81AFCCC - push {lr} - ldr r0, =gUnknown_086143BC - bl sav1_are_mapnumbers_in_given_list - pop {r1} - bx r1 - .pool - thumb_func_end sav1_is_in_pokecenter - - thumb_func_start sub_81AFCDC -sub_81AFCDC: @ 81AFCDC - push {lr} - ldr r0, =gUnknown_0861440A - bl sav1_are_mapnumbers_in_given_list - pop {r1} - bx r1 - .pool - thumb_func_end sub_81AFCDC - - thumb_func_start sub_81AFCEC -sub_81AFCEC: @ 81AFCEC - push {lr} - ldr r0, =gUnknown_0861440E - bl sav1_are_mapnumbers_in_given_list - pop {r1} - bx r1 - .pool - thumb_func_end sub_81AFCEC - - thumb_func_start sav2_set_x9_bit3_when_sav1_in_pokecenter -sav2_set_x9_bit3_when_sav1_in_pokecenter: @ 81AFCFC - push {lr} - bl sav1_is_in_pokecenter - cmp r0, 0 - bne _081AFD18 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldrb r1, [r2, 0x9] - movs r0, 0xFD - ands r0, r1 - b _081AFD22 - .pool -_081AFD18: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldrb r1, [r2, 0x9] - movs r0, 0x2 - orrs r0, r1 -_081AFD22: - strb r0, [r2, 0x9] - pop {r0} - bx r0 - .pool - thumb_func_end sav2_set_x9_bit3_when_sav1_in_pokecenter - - thumb_func_start sub_81AFD2C -sub_81AFD2C: @ 81AFD2C - push {lr} - bl sub_81AFCDC - cmp r0, 0 - bne _081AFD48 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldrb r1, [r2, 0x9] - movs r0, 0xFB - ands r0, r1 - b _081AFD52 - .pool -_081AFD48: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldrb r1, [r2, 0x9] - movs r0, 0x4 - orrs r0, r1 -_081AFD52: - strb r0, [r2, 0x9] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AFD2C - - thumb_func_start sub_81AFD5C -sub_81AFD5C: @ 81AFD5C - push {lr} - bl sub_81AFCEC - cmp r0, 0 - bne _081AFD78 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldrb r1, [r2, 0x9] - movs r0, 0xF7 - ands r0, r1 - b _081AFD82 - .pool -_081AFD78: - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldrb r1, [r2, 0x9] - movs r0, 0x8 - orrs r0, r1 -_081AFD82: - strb r0, [r2, 0x9] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81AFD5C - - thumb_func_start sav2_set_x9_depending_on_sav1_map -sav2_set_x9_depending_on_sav1_map: @ 81AFD8C - push {lr} - bl sav2_set_x9_bit3_when_sav1_in_pokecenter - bl sub_81AFD2C - bl sub_81AFD5C - pop {r0} - bx r0 - thumb_func_end sav2_set_x9_depending_on_sav1_map - - thumb_func_start sub_81AFDA0 -sub_81AFDA0: @ 81AFDA0 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - adds r2, 0xA8 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 8 - orrs r0, r1 - movs r1, 0x1 - orrs r0, r1 - movs r1, 0x2 - orrs r0, r1 - movs r1, 0x4 - orrs r0, r1 - movs r1, 0x10 - orrs r0, r1 - movs r1, 0x20 - orrs r0, r1 - movs r1, 0x8 - orrs r0, r1 - str r0, [r2] - bx lr - .pool - thumb_func_end sub_81AFDA0 - - thumb_func_start sub_81AFDD0 -sub_81AFDD0: @ 81AFDD0 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldrb r1, [r2, 0x9] - movs r0, 0x80 - orrs r0, r1 - strb r0, [r2, 0x9] - bx lr - .pool - thumb_func_end sub_81AFDD0 - - thumb_func_start AllocItemIconTemporaryBuffers -@ bool8 AllocItemIconTemporaryBuffers() -AllocItemIconTemporaryBuffers: @ 81AFDE4 - push {r4,r5,lr} - ldr r5, =gUnknown_0203CEBC - movs r0, 0x90 - lsls r0, 1 - bl Alloc - str r0, [r5] - cmp r0, 0 - beq _081AFE1A - ldr r4, =gUnknown_0203CEC0 - movs r0, 0x80 - lsls r0, 2 - bl AllocZeroed - str r0, [r4] - cmp r0, 0 - beq _081AFE14 - movs r0, 0x1 - b _081AFE1C - .pool -_081AFE14: - ldr r0, [r5] - bl Free -_081AFE1A: - movs r0, 0 -_081AFE1C: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end AllocItemIconTemporaryBuffers - - thumb_func_start FreeItemIconTemporaryBuffers -@ void FreeItemIconTemporaryBuffers() -FreeItemIconTemporaryBuffers: @ 81AFE24 - push {lr} - ldr r0, =gUnknown_0203CEBC - ldr r0, [r0] - bl Free - ldr r0, =gUnknown_0203CEC0 - ldr r0, [r0] - bl Free - pop {r0} - bx r0 - .pool - thumb_func_end FreeItemIconTemporaryBuffers - - thumb_func_start CopyItemIconPicTo4x4Buffer -@ void CopyItemIconPicTo4x4Buffer(void *src, void *dest) -CopyItemIconPicTo4x4Buffer: @ 81AFE44 - push {r4-r6,lr} - adds r6, r0, 0 - adds r5, r1, 0 - movs r4, 0 -_081AFE4C: - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 5 - adds r0, r6, r0 - lsls r1, r4, 7 - adds r1, r5, r1 - movs r2, 0x30 - bl CpuSet - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _081AFE4C - pop {r4-r6} - pop {r0} - bx r0 - 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 - lsls r0, 16 - lsrs r7, r0, 16 - lsls r1, 16 - lsrs r6, r1, 16 - lsls r2, 16 - lsrs r5, r2, 16 - bl AllocItemIconTemporaryBuffers - lsls r0, 24 - cmp r0, 0 - beq _081AFF28 - adds r0, r5, 0 - movs r1, 0 - bl GetItemIconPicOrPalette - ldr r4, =gUnknown_0203CEBC - ldr r1, [r4] - bl LZDecompressWram - ldr r0, [r4] - ldr r4, =gUnknown_0203CEC0 - ldr r1, [r4] - bl CopyItemIconPicTo4x4Buffer - ldr r0, [r4] - str r0, [sp] - ldr r4, =0xffff0000 - ldr r0, [sp, 0x4] - ands r0, r4 - movs r1, 0x80 - lsls r1, 2 - orrs r0, r1 - lsls r2, r7, 16 - ldr r1, =0x0000ffff - ands r0, r1 - orrs r0, r2 - str r0, [sp, 0x4] - mov r0, sp - bl LoadSpriteSheet - adds r0, r5, 0 - movs r1, 0x1 - bl GetItemIconPicOrPalette - str r0, [sp, 0x8] - add r0, sp, 0x8 - ldr r1, [r0, 0x4] - ands r1, r4 - orrs r1, r6 - str r1, [r0, 0x4] - bl LoadCompressedObjectPalette - movs r0, 0x18 - bl Alloc - adds r5, r0, 0 - ldr r0, =gUnknown_08614FF4 - adds r1, r5, 0 - movs r2, 0xC - bl CpuSet - strh r7, [r5] - strh r6, [r5, 0x2] - adds r0, r5, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl CreateSprite - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl FreeItemIconTemporaryBuffers - adds r0, r5, 0 - bl Free - adds r0, r4, 0 - b _081AFF2A - .pool -_081AFF28: - movs r0, 0x40 -_081AFF2A: - add sp, 0x10 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end AddItemIconObject - - 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} - sub sp, 0x10 - mov r8, r0 - lsls r1, 16 - lsrs r7, r1, 16 - lsls r2, 16 - lsrs r6, r2, 16 - lsls r3, 16 - lsrs r5, r3, 16 - bl AllocItemIconTemporaryBuffers - lsls r0, 24 - cmp r0, 0 - beq _081AFFEC - adds r0, r5, 0 - movs r1, 0 - bl GetItemIconPicOrPalette - ldr r4, =gUnknown_0203CEBC - ldr r1, [r4] - bl LZDecompressWram - ldr r0, [r4] - ldr r4, =gUnknown_0203CEC0 - ldr r1, [r4] - bl CopyItemIconPicTo4x4Buffer - ldr r0, [r4] - str r0, [sp] - ldr r4, =0xffff0000 - ldr r0, [sp, 0x4] - ands r0, r4 - movs r1, 0x80 - lsls r1, 2 - orrs r0, r1 - lsls r2, r7, 16 - ldr r1, =0x0000ffff - ands r0, r1 - orrs r0, r2 - str r0, [sp, 0x4] - mov r0, sp - bl LoadSpriteSheet - adds r0, r5, 0 - movs r1, 0x1 - bl GetItemIconPicOrPalette - str r0, [sp, 0x8] - add r0, sp, 0x8 - ldr r1, [r0, 0x4] - ands r1, r4 - orrs r1, r6 - str r1, [r0, 0x4] - bl LoadCompressedObjectPalette - movs r0, 0x18 - bl Alloc - adds r5, r0, 0 - mov r0, r8 - adds r1, r5, 0 - movs r2, 0xC - bl CpuSet - strh r7, [r5] - strh r6, [r5, 0x2] - adds r0, r5, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl CreateSprite - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl FreeItemIconTemporaryBuffers - adds r0, r5, 0 - bl Free - adds r0, r4, 0 - b _081AFFEE - .pool -_081AFFEC: - movs r0, 0x40 -_081AFFEE: - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end AddItemIconObjectWithCustomObjectTemplate - - thumb_func_start GetItemIconPicOrPalette -@ u32 GetItemIconPicOrPalette(u16 itemId, u8 which) -GetItemIconPicOrPalette: @ 81AFFFC - push {lr} - lsls r0, 16 - lsrs r3, r0, 16 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =0x0000ffff - cmp r3, r0 - bne _081B0018 - ldr r3, =0x00000179 - b _081B0022 - .pool -_081B0018: - movs r0, 0xBC - lsls r0, 1 - cmp r3, r0 - bls _081B0022 - movs r3, 0 -_081B0022: - ldr r2, =gItemIconTable - lsls r0, r1, 2 - lsls r1, r3, 3 - adds r0, r1 - adds r0, r2 - ldr r0, [r0] - pop {r1} - bx r1 - .pool - thumb_func_end GetItemIconPicOrPalette - - thumb_func_start sub_81B0038 -sub_81B0038: @ 81B0038 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - ldr r4, [sp, 0x24] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - lsls r2, 24 - lsrs r7, r2, 24 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp] - lsls r4, 24 - lsrs r6, r4, 24 - bl reset_brm - ldr r0, =gUnknown_0203CEC4 - mov r10, r0 - movs r0, 0x8E - lsls r0, 2 - bl Alloc - adds r5, r0, 0 - mov r1, r10 - str r5, [r1] - cmp r5, 0 - bne _081B0088 - ldr r0, [sp, 0x2C] - bl SetMainCallback2 - b _081B0194 - .pool -_081B0088: - ldr r3, =gUnknown_0203CEC8 - movs r1, 0xF - mov r4, r8 - ands r1, r4 - ldrb r2, [r3, 0x8] - movs r0, 0x10 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x8] - ldr r0, [sp, 0x2C] - str r0, [r3] - movs r4, 0 - strb r7, [r3, 0xB] - lsls r2, r6, 2 - ldrh r1, [r5, 0xA] - movs r0, 0x3 - ands r0, r1 - orrs r0, r2 - strh r0, [r5, 0xA] - ldr r0, [sp, 0x28] - str r0, [r5] - str r4, [r5, 0x4] - ldrb r1, [r5, 0x8] - movs r0, 0xF - negs r0, r0 - ands r0, r1 - strb r0, [r5, 0x8] - mov r1, r10 - ldr r2, [r1] - ldrh r0, [r2, 0x8] - movs r4, 0xFE - lsls r4, 3 - adds r1, r4, 0 - orrs r0, r1 - strh r0, [r2, 0x8] - ldr r0, [r2, 0x8] - movs r1, 0xFE - lsls r1, 10 - orrs r0, r1 - str r0, [r2, 0x8] - adds r6, r3, 0 - mov r5, r8 - cmp r5, 0x4 - bne _081B00F0 - ldrb r0, [r2, 0x8] - movs r1, 0x1 - orrs r0, r1 - b _081B00F8 - .pool -_081B00F0: - ldrb r1, [r2, 0x8] - movs r0, 0x2 - negs r0, r0 - ands r0, r1 -_081B00F8: - strb r0, [r2, 0x8] - mov r0, r9 - cmp r0, 0xFF - beq _081B0114 - movs r0, 0x3 - mov r1, r9 - ands r0, r1 - lsls r0, 4 - ldrb r2, [r6, 0x8] - movs r1, 0x31 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r6, 0x8] -_081B0114: - movs r2, 0 - ldr r5, =gUnknown_0203CEC4 - movs r4, 0x86 - lsls r4, 2 - movs r3, 0 -_081B011E: - ldr r0, [r5] - lsls r1, r2, 1 - adds r0, r4 - adds r0, r1 - strh r3, [r0] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0xF - bls _081B011E - movs r2, 0 - ldr r4, =gUnknown_0203CEC4 - movs r3, 0xFF -_081B0138: - ldr r0, [r4] - adds r0, 0xC - adds r0, r2 - ldrb r1, [r0] - orrs r1, r3 - strb r1, [r0] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0x2 - bls _081B0138 - ldr r4, [sp] - cmp r4, 0 - bne _081B015C - strb r4, [r6, 0x9] - b _081B017E - .pool -_081B015C: - adds r1, r6, 0 - movs r0, 0x9 - ldrsb r0, [r1, r0] - cmp r0, 0x5 - bgt _081B017A - adds r1, r0, 0 - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - bne _081B017E -_081B017A: - movs r0, 0 - strb r0, [r6, 0x9] -_081B017E: - ldr r2, =gTextFlags - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - bl calc_player_party_count - ldr r0, =c2_811EBD0 - bl SetMainCallback2 -_081B0194: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B0038 - - thumb_func_start sub_81B01B0 -sub_81B01B0: @ 81B01B0 - push {lr} - bl RunTasks - bl AnimateSprites - bl BuildOamBuffer - bl do_scheduled_bg_tilemap_copies_to_vram - bl UpdatePaletteFade - pop {r0} - bx r0 - thumb_func_end sub_81B01B0 - - thumb_func_start sub_81B01CC -sub_81B01CC: @ 81B01CC - push {lr} - bl LoadOam - bl ProcessSpriteCopyRequests - bl TransferPlttBuffer - pop {r0} - bx r0 - thumb_func_end sub_81B01CC - - thumb_func_start c2_811EBD0 -c2_811EBD0: @ 81B01E0 - push {lr} -_081B01E2: - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B0206 - bl sub_81B020C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B0206 - bl sub_81221AC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B01E2 -_081B0206: - pop {r0} - bx r0 - thumb_func_end c2_811EBD0 - - thumb_func_start sub_81B020C -sub_81B020C: @ 81B020C - push {r4,lr} - sub sp, 0x4 - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r0, r1, r2 - ldrb r0, [r0] - adds r2, r1, 0 - cmp r0, 0x16 - bls _081B0222 - b _081B0498 -_081B0222: - lsls r0, 2 - ldr r1, =_081B0234 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081B0234: - .4byte _081B0290 - .4byte _081B02AC - .4byte _081B02B2 - .4byte _081B02D4 - .4byte _081B02DA - .4byte _081B02EC - .4byte _081B02FE - .4byte _081B0310 - .4byte _081B0338 - .4byte _081B0354 - .4byte _081B0368 - .4byte _081B038C - .4byte _081B03A0 - .4byte _081B03A6 - .4byte _081B03B8 - .4byte _081B03BE - .4byte _081B03E0 - .4byte _081B0400 - .4byte _081B0414 - .4byte _081B0428 - .4byte _081B0430 - .4byte _081B044C - .4byte _081B0474 -_081B0290: - bl SetVBlankHBlankCallbacksToNull - bl sub_8121DA0 - bl clear_scheduled_bg_copies_to_vram - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081B048C - .pool -_081B02AC: - bl remove_some_task - b _081B0484 -_081B02B2: - bl ResetPaletteFade - ldr r2, =gPaletteFade - ldrb r0, [r2, 0x8] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2, 0x8] - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081B048C - .pool -_081B02D4: - bl ResetSpriteData - b _081B0484 -_081B02DA: - bl FreeAllSpritePalettes - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081B048C - .pool -_081B02EC: - bl sub_81221AC - lsls r0, 24 - cmp r0, 0 - beq _081B02F8 - b _081B0484 -_081B02F8: - bl ResetTasks - b _081B0484 -_081B02FE: - bl sub_81B209C - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081B048C - .pool -_081B0310: - bl sub_81B0550 - lsls r0, 24 - cmp r0, 0 - bne _081B0322 - bl sub_81B04BC - movs r0, 0x1 - b _081B04B2 -_081B0322: - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - movs r1, 0x86 - lsls r1, 2 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - b _081B0484 - .pool -_081B0338: - bl sub_81B05C8 - lsls r0, 24 - cmp r0, 0 - bne _081B0344 - b _081B04B0 -_081B0344: - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081B048C - .pool -_081B0354: - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0x8] - lsls r0, 26 - lsrs r0, 30 - bl sub_81B239C - b _081B0484 - .pool -_081B0368: - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0x8] - lsls r0, 26 - lsrs r0, 30 - bl sub_81B0740 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - movs r1, 0x86 - lsls r1, 2 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - b _081B0484 - .pool -_081B038C: - bl sub_81B5D30 - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081B048C - .pool -_081B03A0: - bl sub_81B6040 - b _081B0484 -_081B03A6: - bl sub_81B6160 - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081B048C - .pool -_081B03B8: - bl sub_80D2F04 - b _081B0484 -_081B03BE: - bl party_menu_add_per_mon_objects - lsls r0, 24 - cmp r0, 0 - bne _081B03CA - b _081B04B0 -_081B03CA: - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - movs r1, 0x86 - lsls r1, 2 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - b _081B0484 - .pool -_081B03E0: - bl sub_81B0DA0 - lsls r0, 24 - cmp r0, 0 - beq _081B04B0 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - movs r1, 0x86 - lsls r1, 2 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - b _081B0484 - .pool -_081B0400: - bl sub_81B0F28 - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081B048C - .pool -_081B0414: - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - lsls r0, 31 - lsrs r0, 31 - bl sub_81B2428 - b _081B0484 - .pool -_081B0428: - movs r0, 0x87 - lsls r0, 3 - adds r1, r2, r0 - b _081B048C -_081B0430: - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - ldr r0, [r0] - movs r1, 0 - bl CreateTask - ldr r0, [r4] - ldrh r0, [r0, 0xA] - lsrs r0, 2 - bl display_pokemon_menu_message - b _081B0484 - .pool -_081B044C: - movs r0, 0x1 - negs r0, r0 - movs r1, 0x10 - movs r2, 0 - bl BlendPalettes - ldr r2, =gPaletteFade - ldrb r1, [r2, 0x8] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2, 0x8] - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081B048C - .pool -_081B0474: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade -_081B0484: - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 -_081B048C: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _081B04B0 - .pool -_081B0498: - ldr r0, =sub_81B01CC - bl SetVBlankCallback - ldr r0, =sub_81B01B0 - bl SetMainCallback2 - movs r0, 0x1 - b _081B04B2 - .pool -_081B04B0: - movs r0, 0 -_081B04B2: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81B020C - - thumb_func_start sub_81B04BC -sub_81B04BC: @ 81B04BC - push {lr} - sub sp, 0x4 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r0, =sub_81B04F8 - movs r1, 0 - bl CreateTask - ldr r0, =sub_81B01CC - bl SetVBlankCallback - ldr r0, =sub_81B01B0 - bl SetMainCallback2 - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B04BC - - thumb_func_start sub_81B04F8 -sub_81B04F8: @ 81B04F8 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B051C - ldr r0, =gUnknown_0203CEC8 - ldr r0, [r0] - bl SetMainCallback2 - bl sub_81B06F4 - adds r0, r4, 0 - bl DestroyTask -_081B051C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B04F8 - - thumb_func_start reset_brm -reset_brm: @ 81B052C - ldr r0, =gUnknown_0203CEC4 - movs r1, 0 - str r1, [r0] - ldr r0, =gUnknown_0203CEE4 - str r1, [r0] - ldr r0, =gUnknown_0203CEDC - str r1, [r0] - ldr r0, =gUnknown_0203CEE0 - str r1, [r0] - bx lr - .pool - thumb_func_end reset_brm - - thumb_func_start sub_81B0550 -sub_81B0550: @ 81B0550 - push {r4,r5,lr} - ldr r5, =gUnknown_0203CEE4 - movs r4, 0x80 - lsls r4, 4 - adds r0, r4, 0 - bl Alloc - str r0, [r5] - cmp r0, 0 - beq _081B05C0 - movs r1, 0 - adds r2, r4, 0 - bl memset - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_086156B8 - movs r0, 0 - movs r2, 0x3 - bl InitBgsFromTemplates - ldr r1, [r5] - movs r0, 0x1 - bl SetBgTilemapBuffer - bl sub_8121E10 - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x1 - b _081B05C2 - .pool -_081B05C0: - movs r0, 0 -_081B05C2: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81B0550 - - thumb_func_start sub_81B05C8 -sub_81B05C8: @ 81B05C8 - push {r4,lr} - sub sp, 0x4 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - movs r1, 0x86 - lsls r1, 2 - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0x7 - bhi _081B06B0 - lsls r0, 2 - ldr r1, =_081B05F0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081B05F0: - .4byte _081B0610 - .4byte _081B0638 - .4byte _081B0658 - .4byte _081B0684 - .4byte _081B0688 - .4byte _081B068C - .4byte _081B0690 - .4byte _081B0694 -_081B0610: - ldr r4, =gUnknown_0203CEE0 - ldr r0, =gUnknown_08D967EC - mov r1, sp - bl malloc_and_decompress - adds r1, r0, 0 - str r1, [r4] - ldr r2, [sp] - lsls r2, 16 - lsrs r2, 16 - movs r0, 0x1 - movs r3, 0 - bl LoadBgTiles - b _081B069A - .pool -_081B0638: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _081B06B4 - ldr r0, =gUnknown_08D96BA0 - ldr r1, =gUnknown_0203CEE4 - ldr r1, [r1] - bl LZDecompressWram - b _081B069A - .pool -_081B0658: - ldr r0, =gUnknown_08D96AB4 - movs r2, 0xB0 - lsls r2, 1 - movs r1, 0 - bl LoadCompressedPalette - ldr r0, =gPlttBufferUnfaded - ldr r4, =gUnknown_0203CEC4 - ldr r1, [r4] - adds r1, 0x18 - movs r2, 0xB0 - bl CpuSet - ldr r1, [r4] - b _081B069E - .pool -_081B0684: - movs r0, 0x4 - b _081B0696 -_081B0688: - movs r0, 0x5 - b _081B0696 -_081B068C: - movs r0, 0x6 - b _081B0696 -_081B0690: - movs r0, 0x7 - b _081B0696 -_081B0694: - movs r0, 0x8 -_081B0696: - bl sub_81B06C0 -_081B069A: - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] -_081B069E: - movs r0, 0x86 - lsls r0, 2 - adds r1, r0 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _081B06B4 - .pool -_081B06B0: - movs r0, 0x1 - b _081B06B6 -_081B06B4: - movs r0, 0 -_081B06B6: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81B05C8 - - thumb_func_start sub_81B06C0 -sub_81B06C0: @ 81B06C0 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 28 - ldr r5, =gPlttBufferUnfaded + 0x60 - lsrs r4, 23 - adds r1, r5, 0 - subs r1, 0x60 - adds r1, r4, r1 - adds r0, r5, 0 - movs r2, 0x10 - bl CpuSet - ldr r0, =gPlttBufferFaded - adds r4, r0 - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0x10 - bl CpuSet - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B06C0 - - thumb_func_start sub_81B06F4 -sub_81B06F4: @ 81B06F4 - push {lr} - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - cmp r0, 0 - beq _081B0702 - bl Free -_081B0702: - ldr r0, =gUnknown_0203CEE4 - ldr r0, [r0] - cmp r0, 0 - beq _081B070E - bl Free -_081B070E: - ldr r0, =gUnknown_0203CEE0 - ldr r0, [r0] - cmp r0, 0 - beq _081B071A - bl Free -_081B071A: - ldr r0, =gUnknown_0203CEDC - ldr r0, [r0] - cmp r0, 0 - beq _081B0726 - bl Free -_081B0726: - bl FreeAllWindowBuffers - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B06F4 - - thumb_func_start sub_81B0740 -sub_81B0740: @ 81B0740 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r4, =gUnknown_0203CEDC - movs r0, 0x60 - bl Alloc - str r0, [r4] - movs r5, 0 - lsls r0, r7, 1 - adds r0, r7 - lsls r0, 4 - mov r8, r0 - movs r6, 0xFF - mov r9, r4 -_081B0764: - ldr r2, [r4] - lsls r3, r5, 4 - adds r2, r3, r2 - ldr r0, =gUnknown_086156E4 - mov r12, r0 - str r0, [r2] - lsls r0, r5, 3 - ldr r1, =gUnknown_08615704 - adds r0, r1 - add r0, r8 - str r0, [r2, 0x4] - strb r5, [r2, 0x8] - ldr r1, [r4] - adds r1, r3, r1 - ldrb r0, [r1, 0x9] - orrs r0, r6 - strb r0, [r1, 0x9] - ldr r1, [r4] - adds r1, r3, r1 - ldrb r0, [r1, 0xA] - orrs r0, r6 - strb r0, [r1, 0xA] - ldr r1, [r4] - adds r1, r3, r1 - ldrb r0, [r1, 0xB] - orrs r0, r6 - strb r0, [r1, 0xB] - ldr r0, [r4] - adds r3, r0 - ldrb r0, [r3, 0xC] - orrs r0, r6 - strb r0, [r3, 0xC] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x5 - bls _081B0764 - mov r1, r9 - ldr r0, [r1] - mov r1, r12 - subs r1, 0x20 - str r1, [r0] - cmp r7, 0x3 - bne _081B07CC - str r1, [r0, 0x30] - b _081B07D2 - .pool -_081B07CC: - cmp r7, 0 - beq _081B07D2 - str r1, [r0, 0x10] -_081B07D2: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81B0740 - - thumb_func_start sub_81B07E0 -sub_81B07E0: @ 81B07E0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gUnknown_0203CEC8 - ldrb r1, [r0, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x5 - bne _081B085C - cmp r5, 0x2 - bls _081B085C - adds r0, r5, 0 - bl sub_81B0CEC - ldr r0, =gUnknown_02022FF8 - subs r1, r5, 0x3 - lsls r1, 5 - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0 - bne _081B0828 - ldr r0, =gUnknown_0203CEDC - lsls r4, r5, 4 - ldr r0, [r0] - adds r0, r4 - movs r1, 0x40 - bl sub_81B2748 - b _081B0836 - .pool -_081B0828: - ldr r0, =gUnknown_0203CEDC - lsls r4, r5, 4 - ldr r0, [r0] - adds r0, r4 - movs r1, 0x8 - bl sub_81B2748 -_081B0836: - adds r5, r4, 0 - ldr r4, =gUnknown_0203CEDC - ldr r0, [r4] - adds r0, r5, r0 - ldrb r0, [r0, 0x8] - movs r1, 0x2 - bl CopyWindowToVram - ldr r0, [r4] - adds r0, r5, r0 - ldrb r0, [r0, 0x8] - bl PutWindowTilemap - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - b _081B093E - .pool -_081B085C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - bne _081B089C - ldr r4, =gUnknown_0203CEDC - ldr r0, [r4] - lsls r5, 4 - adds r0, r5, r0 - ldrb r0, [r0, 0x8] - bl sub_81B2720 - ldr r0, [r4] - adds r0, r5 - movs r1, 0x40 - bl sub_81B2748 - ldr r0, [r4] - adds r0, r5, r0 - ldrb r0, [r0, 0x8] - movs r1, 0x2 - bl CopyWindowToVram - b _081B092C - .pool -_081B089C: - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0x8] - movs r1, 0xF - ands r1, r0 - cmp r1, 0x7 - bne _081B08B4 - adds r0, r5, 0 - bl sub_81B0B60 - b _081B08F6 - .pool -_081B08B4: - cmp r1, 0x2 - bne _081B08C0 - adds r0, r5, 0 - bl sub_81B0B08 - b _081B08F6 -_081B08C0: - cmp r1, 0x4 - bne _081B08CC - adds r0, r5, 0 - bl sub_81B0A9C - b _081B08F6 -_081B08CC: - cmp r1, 0xB - bne _081B08D8 - adds r0, r5, 0 - bl sub_81B0B98 - b _081B08F6 -_081B08D8: - cmp r1, 0xC - bne _081B08E4 - adds r0, r5, 0 - bl sub_81B0BC4 - b _081B08F6 -_081B08E4: - adds r0, r5, 0 - bl sub_81B0BFC - lsls r0, 24 - cmp r0, 0 - bne _081B08F6 - adds r0, r5, 0 - bl sub_81B0948 -_081B08F6: - ldr r2, =gUnknown_0203CEC8 - ldrb r1, [r2, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x5 - bne _081B0910 - adds r0, r5, 0 - movs r1, 0 - bl sub_81B0FCC - b _081B092A - .pool -_081B0910: - movs r0, 0x9 - ldrsb r0, [r2, r0] - cmp r0, r5 - bne _081B0922 - adds r0, r5, 0 - movs r1, 0x1 - bl sub_81B0FCC - b _081B092A -_081B0922: - adds r0, r5, 0 - movs r1, 0 - bl sub_81B0FCC -_081B092A: - lsls r5, 4 -_081B092C: - ldr r0, =gUnknown_0203CEDC - ldr r0, [r0] - adds r0, r5, r0 - ldrb r0, [r0, 0x8] - bl PutWindowTilemap - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram -_081B093E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B07E0 - - thumb_func_start sub_81B0948 -sub_81B0948: @ 81B0948 - push {r4-r7,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x64 - adds r1, r4, 0 - muls r1, r0 - ldr r0, =gPlayerParty - adds r7, r1, r0 - adds r0, r7, 0 - movs r1, 0x2D - bl GetMonData - adds r2, r0, 0 - cmp r2, 0 - beq _081B09A0 - ldr r6, =gUnknown_0203CEDC - ldr r0, [r6] - lsls r5, r4, 4 - adds r0, r5, r0 - ldr r2, [r0] - ldrb r0, [r0, 0x8] - movs r1, 0 - str r1, [sp] - movs r1, 0x1 - str r1, [sp, 0x4] - ldr r4, [r2] - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl _call_via_r4 - ldr r1, [r6] - adds r1, r5 - adds r0, r7, 0 - movs r2, 0 - bl sub_81B2A70 - b _081B0A02 - .pool -_081B09A0: - ldr r5, =gUnknown_0203CEDC - ldr r0, [r5] - lsls r4, 4 - adds r0, r4, r0 - ldr r1, [r0] - ldrb r0, [r0, 0x8] - str r2, [sp] - str r2, [sp, 0x4] - ldr r6, [r1] - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl _call_via_r6 - ldr r1, [r5] - adds r1, r4 - adds r0, r7, 0 - movs r2, 0 - bl sub_81B2A70 - ldr r1, [r5] - adds r1, r4 - adds r0, r7, 0 - movs r2, 0 - bl sub_81B2AC8 - ldr r1, [r5] - adds r1, r4 - adds r0, r7, 0 - movs r2, 0 - bl sub_81B2B8C - ldr r1, [r5] - adds r1, r4 - adds r0, r7, 0 - movs r2, 0 - bl sub_81B2CD4 - ldr r1, [r5] - adds r1, r4 - adds r0, r7, 0 - movs r2, 0 - bl sub_81B2D74 - ldr r1, [r5] - adds r1, r4 - adds r0, r7, 0 - bl sub_81B2E28 -_081B0A02: - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B0948 - - thumb_func_start sub_81B0A10 -sub_81B0A10: @ 81B0A10 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - movs r1, 0x64 - adds r2, r0, 0 - muls r2, r1 - ldr r1, =gPlayerParty - adds r6, r2, r1 - ldr r7, =gUnknown_0203CEDC - ldr r1, [r7] - lsls r5, r0, 4 - adds r1, r5, r1 - ldr r2, [r1] - ldrb r0, [r1, 0x8] - movs r1, 0 - str r1, [sp] - movs r1, 0x1 - str r1, [sp, 0x4] - ldr r4, [r2] - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl _call_via_r4 - ldr r1, [r7] - adds r1, r5 - adds r0, r6, 0 - movs r2, 0 - bl sub_81B2A70 - adds r0, r6, 0 - movs r1, 0x2D - bl GetMonData - cmp r0, 0 - bne _081B0A7C - ldr r1, [r7] - adds r1, r5 - adds r0, r6, 0 - movs r2, 0 - bl sub_81B2AC8 - ldr r1, [r7] - adds r1, r5 - adds r0, r6, 0 - movs r2, 0 - bl sub_81B2B8C -_081B0A7C: - ldr r1, [r7] - adds r1, r5 - mov r0, r8 - movs r2, 0 - bl sub_81B2FA8 - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B0A10 - - thumb_func_start sub_81B0A9C -sub_81B0A9C: @ 81B0A9C - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r6, =gUnknown_0203CEF8 - bl sub_81B85AC - lsls r0, 24 - cmp r0, 0 - bne _081B0AD6 - adds r0, r5, 0 - movs r1, 0x7 - bl sub_81B0A10 - b _081B0B02 - .pool -_081B0AC8: - adds r1, r4, 0x2 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl sub_81B0A10 - b _081B0B02 -_081B0AD6: - movs r4, 0 - b _081B0AEE -_081B0ADA: - adds r1, r6, r4 - ldrb r0, [r1] - cmp r0, 0 - beq _081B0AE8 - subs r0, 0x1 - cmp r0, r5 - beq _081B0AC8 -_081B0AE8: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_081B0AEE: - bl sub_81B8830 - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bcc _081B0ADA - adds r0, r5, 0 - movs r1, 0x1 - bl sub_81B0A10 -_081B0B02: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81B0A9C - - thumb_func_start sub_81B0B08 -sub_81B0B08: @ 81B0B08 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - adds r0, r1 - bl sub_80DAE0C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bhi _081B0B5A - lsls r0, 2 - ldr r1, =_081B0B34 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081B0B34: - .4byte _081B0B48 - .4byte _081B0B52 - .4byte _081B0B52 - .4byte _081B0B48 - .4byte _081B0B48 -_081B0B48: - adds r0, r4, 0 - movs r1, 0x7 - bl sub_81B0A10 - b _081B0B5A -_081B0B52: - adds r0, r4, 0 - movs r1, 0x6 - bl sub_81B0A10 -_081B0B5A: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B0B08 - - thumb_func_start sub_81B0B60 -sub_81B0B60: @ 81B0B60 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - adds r0, r1 - bl sub_806E25C - lsls r0, 24 - cmp r0, 0 - bne _081B0B88 - adds r0, r4, 0 - movs r1, 0x9 - bl sub_81B0A10 - b _081B0B90 - .pool -_081B0B88: - adds r0, r4, 0 - movs r1, 0x8 - bl sub_81B0A10 -_081B0B90: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B0B60 - - thumb_func_start sub_81B0B98 -sub_81B0B98: @ 81B0B98 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_81B218C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B0BB6 - adds r0, r4, 0 - movs r1, 0x6 - bl sub_81B0A10 - b _081B0BBE -_081B0BB6: - adds r0, r4, 0 - movs r1, 0x7 - bl sub_81B0A10 -_081B0BBE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B0B98 - - thumb_func_start sub_81B0BC4 -sub_81B0BC4: @ 81B0BC4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xC - bl GetMonData - cmp r0, 0 - beq _081B0BEC - adds r0, r4, 0 - movs r1, 0xB - bl sub_81B0A10 - b _081B0BF4 - .pool -_081B0BEC: - adds r0, r4, 0 - movs r1, 0xC - bl sub_81B0A10 -_081B0BF4: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B0BC4 - - thumb_func_start sub_81B0BFC -sub_81B0BFC: @ 81B0BFC - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =gPlayerParty - adds r6, r1, r0 - ldr r0, =gUnknown_0203CE7C - ldrh r4, [r0] - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0xB] - cmp r0, 0xC - bne _081B0C40 - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - ldr r0, =gSpecialVar_0x8005 - ldrb r2, [r0] - adds r0, r5, 0 - movs r1, 0 - bl sub_81B0C94 - b _081B0C8A - .pool -_081B0C40: - cmp r0, 0x3 - bne _081B0C56 - adds r0, r4, 0 - bl CheckIfItemIsTMHMOrEvolutionStone - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B0C5A - cmp r0, 0x2 - beq _081B0C66 -_081B0C56: - movs r0, 0 - b _081B0C8C -_081B0C5A: - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0 - bl sub_81B0C94 - b _081B0C8A -_081B0C66: - adds r0, r6, 0 - movs r1, 0x2D - bl GetMonData - cmp r0, 0 - bne _081B0C82 - adds r0, r6, 0 - movs r1, 0x3 - adds r2, r4, 0 - bl GetEvolutionTargetSpecies - lsls r0, 16 - cmp r0, 0 - bne _081B0C56 -_081B0C82: - adds r0, r5, 0 - movs r1, 0 - bl sub_81B0A10 -_081B0C8A: - movs r0, 0x1 -_081B0C8C: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81B0BFC - - thumb_func_start sub_81B0C94 -sub_81B0C94: @ 81B0C94 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0x64 - muls r0, r4 - ldr r3, =gPlayerParty - adds r0, r3 - bl sub_81B22D8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - beq _081B0CD2 - cmp r0, 0x2 - bgt _081B0CC4 - cmp r0, 0x1 - beq _081B0CC8 - b _081B0CDC - .pool -_081B0CC4: - cmp r0, 0x3 - bne _081B0CDC -_081B0CC8: - adds r0, r4, 0 - movs r1, 0x9 - bl sub_81B0A10 - b _081B0CE4 -_081B0CD2: - adds r0, r4, 0 - movs r1, 0xA - bl sub_81B0A10 - b _081B0CE4 -_081B0CDC: - adds r0, r4, 0 - movs r1, 0x8 - bl sub_81B0A10 -_081B0CE4: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B0C94 - - thumb_func_start sub_81B0CEC -sub_81B0CEC: @ 81B0CEC - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0203CEDC - lsls r2, r0, 4 - ldr r1, [r1] - adds r6, r1, r2 - subs r0, 0x3 - lsls r0, 24 - ldr r5, =gUnknown_02022FF8 - lsrs r0, 19 - mov r8, r0 - adds r7, r0, r5 - ldrh r0, [r7] - cmp r0, 0 - bne _081B0D24 - ldrb r0, [r6, 0x8] - bl sub_81B2720 - b _081B0D8E - .pool -_081B0D24: - ldr r2, [r6] - ldrb r0, [r6, 0x8] - movs r1, 0 - str r1, [sp] - str r1, [sp, 0x4] - ldr r4, [r2] - movs r2, 0 - movs r3, 0 - bl _call_via_r4 - ldr r4, =gStringVar1 - adds r5, 0x4 - add r5, r8 - adds r0, r4, 0 - adds r1, r5, 0 - bl StringCopy - adds r0, r4, 0 - bl StringGetEnd10 - adds r0, r4, 0 - bl sub_81DB52C - ldrb r0, [r6, 0x8] - ldr r3, [r6] - adds r3, 0x4 - adds r1, r4, 0 - movs r2, 0 - bl sub_81B2A3C - ldrb r0, [r7, 0xF] - adds r1, r6, 0 - bl sub_81B2B40 - ldrb r0, [r7, 0x1C] - ldrh r1, [r7] - adds r2, r5, 0 - adds r3, r6, 0 - bl sub_81B2BF4 - ldrh r0, [r7, 0x10] - adds r1, r6, 0 - bl sub_81B2D3C - ldrh r0, [r7, 0x12] - adds r1, r6, 0 - bl sub_81B2DDC - ldrh r0, [r7, 0x10] - ldrh r1, [r7, 0x12] - adds r2, r6, 0 - bl sub_81B2E64 -_081B0D8E: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B0CEC - - thumb_func_start sub_81B0DA0 -sub_81B0DA0: @ 81B0DA0 - push {r4,r5,lr} - ldr r5, =gUnknown_0203CEC4 - ldr r0, [r5] - movs r4, 0x86 - lsls r4, 2 - adds r0, r4 - ldrb r0, [r0] - bl sub_81B07E0 - ldr r1, [r5] - adds r1, r4 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - beq _081B0DCC - movs r0, 0 - b _081B0DCE - .pool -_081B0DCC: - movs r0, 0x1 -_081B0DCE: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81B0DA0 - - thumb_func_start sub_81B0DD4 -sub_81B0DD4: @ 81B0DD4 - lsls r0, 16 - ldr r1, =gUnknown_0203CEE0 - lsrs r0, 11 - ldr r1, [r1] - adds r1, r0 - adds r0, r1, 0 - bx lr - .pool - thumb_func_end sub_81B0DD4 - - 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 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =gUnknown_0203CEC8 - ldrb r1, [r0, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x5 - bne _081B0E98 - cmp r7, 0x2 - bls _081B0E98 - subs r0, r7, 0x3 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - ldr r0, =gUnknown_02022FF8 - mov r9, r0 - mov r2, r10 - lsls r2, 5 - mov r8, r2 - mov r6, r8 - add r6, r9 - ldrh r0, [r6] - cmp r0, 0 - beq _081B0EDC - mov r1, r9 - adds r1, 0x18 - add r1, r8 - ldr r1, [r1] - ldr r4, =gUnknown_0203CEDC - lsls r5, r7, 4 - ldr r2, [r4] - adds r2, r5 - movs r3, 0 - str r3, [sp] - bl party_menu_link_mon_icon_anim - ldrh r0, [r6] - ldrh r1, [r6, 0x2] - ldr r2, [r4] - adds r2, r5 - bl party_menu_link_mon_held_item_object - ldrh r0, [r6] - ldr r1, [r4] - adds r1, r5 - bl party_menu_link_mon_pokeball_object - ldrh r0, [r6, 0x10] - cmp r0, 0 - bne _081B0E68 - movs r3, 0x7 - b _081B0E78 - .pool -_081B0E68: - mov r0, r9 - adds r0, 0x14 - add r0, r8 - ldr r0, [r0] - bl pokemon_ailments_get_primary - lsls r0, 24 - lsrs r3, r0, 24 -_081B0E78: - ldr r1, =gUnknown_02022FF8 - mov r2, r10 - lsls r0, r2, 5 - adds r0, r1 - ldrh r0, [r0] - ldr r1, =gUnknown_0203CEDC - ldr r2, [r1] - adds r2, r5 - adds r1, r3, 0 - bl party_menu_link_mon_status_condition_object - b _081B0EDC - .pool -_081B0E98: - movs r0, 0x64 - adds r1, r7, 0 - muls r1, r0 - ldr r0, =gPlayerParty - adds r6, r1, r0 - adds r0, r6, 0 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B0EDC - ldr r4, =gUnknown_0203CEDC - lsls r5, r7, 4 - ldr r1, [r4] - adds r1, r5 - adds r0, r6, 0 - adds r2, r7, 0 - bl party_menu_icon_anim - ldr r1, [r4] - adds r1, r5 - adds r0, r6, 0 - bl party_menu_held_item_object - ldr r1, [r4] - adds r1, r5 - adds r0, r6, 0 - bl party_menu_pokeball_object - ldr r1, [r4] - adds r1, r5 - adds r0, r6, 0 - bl party_menu_status_condition_object -_081B0EDC: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end party_menu_add_per_mon_objects_internal - - thumb_func_start party_menu_add_per_mon_objects -party_menu_add_per_mon_objects: @ 81B0EF4 - push {r4,r5,lr} - ldr r5, =gUnknown_0203CEC4 - ldr r0, [r5] - movs r4, 0x86 - lsls r4, 2 - adds r0, r4 - ldrb r0, [r0] - bl party_menu_add_per_mon_objects_internal - ldr r1, [r5] - adds r1, r4 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - beq _081B0F20 - movs r0, 0 - b _081B0F22 - .pool -_081B0F20: - movs r0, 0x1 -_081B0F22: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end party_menu_add_per_mon_objects - - thumb_func_start sub_81B0F28 -sub_81B0F28: @ 81B0F28 - push {r4,lr} - sub sp, 0xC - ldr r0, =gUnknown_0203CEC8 - ldrb r1, [r0, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x5 - bne _081B0F54 - movs r0, 0x7 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x1 - str r0, [sp, 0x8] - movs r1, 0xE - movs r2, 0x17 - movs r3, 0x11 - bl FillBgTilemapBufferRect - b _081B0FBC - .pool -_081B0F54: - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - ldrb r0, [r0, 0x8] - lsls r0, 31 - cmp r0, 0 - beq _081B0F94 - movs r0, 0xBF - movs r1, 0x88 - bl sub_81B5F74 - ldr r3, [r4] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x7F - ands r0, r1 - lsls r0, 4 - ldrh r2, [r3, 0x8] - ldr r1, =0xfffff80f - ands r1, r2 - orrs r1, r0 - strh r1, [r3, 0x8] - bl sub_81B120C - movs r0, 0xBF - movs r1, 0x98 - bl sub_81B5F74 - b _081B0F9C - .pool -_081B0F94: - movs r0, 0xC6 - movs r1, 0x94 - bl sub_81B5F34 -_081B0F9C: - ldr r3, [r4] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x7F - ands r0, r1 - lsls r0, 11 - ldr r1, [r3, 0x8] - ldr r2, =0xfffc07ff - ands r1, r2 - orrs r1, r0 - str r1, [r3, 0x8] - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0x9] - movs r1, 0x1 - bl sub_81B0FCC -_081B0FBC: - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B0F28 - - thumb_func_start sub_81B0FCC -sub_81B0FCC: @ 81B0FCC - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - cmp r7, 0x6 - beq _081B1038 - cmp r7, 0x7 - beq _081B1074 - movs r0, 0x64 - muls r0, r7 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B10E8 - ldr r6, =gUnknown_0203CEDC - lsls r5, r7, 4 - ldr r4, [r6] - adds r4, r5 - adds r0, r7, 0 - mov r1, r8 - bl sub_81B10F8 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_81B2748 - ldr r0, [r6] - adds r0, r5, r0 - ldrb r0, [r0, 0x9] - mov r1, r8 - bl sub_81B5B6C - ldr r0, [r6] - adds r5, r0 - ldrb r0, [r5, 0xB] - mov r1, r8 - bl sub_81B5F98 - b _081B10E8 - .pool -_081B1038: - mov r0, r8 - cmp r0, 0 - bne _081B1052 - movs r0, 0x2 - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - movs r1, 0x17 - movs r2, 0x10 - movs r3, 0x7 - bl sub_8199C30 - b _081B1064 -_081B1052: - movs r0, 0x2 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x1 - movs r1, 0x17 - movs r2, 0x10 - movs r3, 0x7 - bl sub_8199C30 -_081B1064: - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldrh r0, [r0, 0x8] - lsls r0, 21 - b _081B10DA - .pool -_081B1074: - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - lsls r0, 31 - cmp r0, 0 - bne _081B10A6 - mov r0, r8 - cmp r0, 0 - bne _081B1098 - movs r0, 0x2 - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - movs r1, 0x17 - movs r2, 0x11 - b _081B10B8 - .pool -_081B1098: - movs r0, 0x2 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x1 - movs r1, 0x17 - movs r2, 0x11 - b _081B10B8 -_081B10A6: - mov r0, r8 - cmp r0, 0 - bne _081B10C0 - movs r0, 0x2 - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - movs r1, 0x17 - movs r2, 0x12 -_081B10B8: - movs r3, 0x7 - bl sub_8199C30 - b _081B10D2 -_081B10C0: - movs r0, 0x2 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x1 - movs r1, 0x17 - movs r2, 0x12 - movs r3, 0x7 - bl sub_8199C30 -_081B10D2: - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldr r0, [r0, 0x8] - lsls r0, 14 -_081B10DA: - lsrs r0, 25 - mov r1, r8 - bl sub_81B5F98 - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram -_081B10E8: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B0FCC - - thumb_func_start sub_81B10F8 -sub_81B10F8: @ 81B10F8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r1, 24 - movs r4, 0 - cmp r1, 0x1 - bne _081B110A - movs r4, 0x1 -_081B110A: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - bne _081B1120 - movs r0, 0x2 - orrs r4, r0 -_081B1120: - adds r0, r5, 0 - bl sub_81B118C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B1136 - movs r0, 0x8 - orrs r4, r0 - lsls r0, r4, 24 - lsrs r4, r0, 24 -_081B1136: - ldr r0, =gUnknown_0203CEC8 - ldrb r1, [r0, 0xB] - adds r2, r0, 0 - cmp r1, 0x9 - bne _081B1148 - movs r0, 0x10 - orrs r4, r0 - lsls r0, r4, 24 - lsrs r4, r0, 24 -_081B1148: - cmp r1, 0x8 - bne _081B1164 - movs r0, 0x9 - ldrsb r0, [r2, r0] - cmp r5, r0 - beq _081B115C - movs r0, 0xA - ldrsb r0, [r2, r0] - cmp r5, r0 - bne _081B1164 -_081B115C: - movs r0, 0x4 - orrs r4, r0 - lsls r0, r4, 24 - lsrs r4, r0, 24 -_081B1164: - ldrb r0, [r2, 0xB] - cmp r0, 0xA - bne _081B117A - movs r0, 0x9 - ldrsb r0, [r2, r0] - cmp r5, r0 - bne _081B117A - movs r0, 0x20 - orrs r4, r0 - lsls r0, r4, 24 - lsrs r4, r0, 24 -_081B117A: - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B10F8 - - thumb_func_start sub_81B118C -sub_81B118C: @ 81B118C - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gUnknown_0203CEC8 - ldrb r1, [r0, 0x8] - movs r0, 0x30 - ands r0, r1 - cmp r0, 0x20 - bne _081B11B4 - cmp r2, 0x1 - beq _081B11AA - cmp r2, 0x4 - beq _081B11AA - cmp r2, 0x5 - bne _081B11B4 -_081B11AA: - movs r0, 0x1 - b _081B11F8 - .pool -_081B11B4: - cmp r2, 0x2 - bhi _081B11F6 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - beq _081B11F6 - ldr r0, =gMain - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081B11F6 - adds r0, r2, 0 - bl sub_81B8F38 - ldr r1, =gBattleStruct - ldr r1, [r1] - movs r2, 0xA8 - lsls r2, 2 - adds r1, r2 - ldrb r1, [r1] - lsls r0, 24 - lsrs r0, 24 - asrs r1, r0 - movs r0, 0x1 - ands r1, r0 - cmp r1, 0 - bne _081B11F8 -_081B11F6: - movs r0, 0 -_081B11F8: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B118C - - thumb_func_start sub_81B120C -sub_81B120C: @ 81B120C - push {r4-r6,lr} - sub sp, 0xC - ldr r1, =gUnknown_086157C4 - movs r6, 0x7 - str r6, [sp] - movs r5, 0x2 - str r5, [sp, 0x4] - movs r4, 0x11 - str r4, [sp, 0x8] - movs r0, 0x1 - movs r2, 0x17 - movs r3, 0x10 - bl CopyToBgTilemapBufferRect_ChangePalette - ldr r1, =gUnknown_086157E0 - str r6, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x1 - movs r2, 0x17 - movs r3, 0x12 - bl CopyToBgTilemapBufferRect_ChangePalette - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B120C - - thumb_func_start sub_81B1250 -sub_81B1250: @ 81B1250 - push {lr} - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x49 - ands r0, r1 - cmp r0, 0x49 - bne _081B1280 - ldr r0, =gMain - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081B1280 - movs r0, 0x1 - b _081B1282 - .pool -_081B1280: - movs r0, 0 -_081B1282: - pop {r1} - bx r1 - thumb_func_end sub_81B1250 - - thumb_func_start sub_81B1288 -sub_81B1288: @ 81B1288 - push {r4-r6,lr} - adds r4, r0, 0 - adds r6, r1, 0 - movs r0, 0x64 - bl Alloc - adds r5, r0, 0 - adds r1, r4, 0 - movs r2, 0x64 - bl memcpy - adds r0, r4, 0 - adds r1, r6, 0 - movs r2, 0x64 - bl memcpy - adds r0, r6, 0 - adds r1, r5, 0 - movs r2, 0x64 - bl memcpy - adds r0, r5, 0 - bl Free - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81B1288 - - thumb_func_start sub_81B12C0 -sub_81B12C0: @ 81B12C0 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =c3_0811FAB4 - str r1, [r0] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B12C0 - - thumb_func_start c3_0811FAB4 -c3_0811FAB4: @ 81B12F8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B134C - ldr r4, =gUnknown_0203CEC8 - ldrb r1, [r4, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x1 - bne _081B131A - bl sub_81B9080 -_081B131A: - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldr r0, [r0, 0x4] - cmp r0, 0 - beq _081B1338 - bl SetMainCallback2 - b _081B133E - .pool -_081B1338: - ldr r0, [r4] - bl SetMainCallback2 -_081B133E: - bl ResetSpriteData - bl sub_81B06F4 - adds r0, r5, 0 - bl DestroyTask -_081B134C: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end c3_0811FAB4 - - thumb_func_start brm_get_pokemon_selection -brm_get_pokemon_selection: @ 81B1354 - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0x9] - bx lr - .pool - thumb_func_end brm_get_pokemon_selection - - thumb_func_start sub_81B1360 -sub_81B1360: @ 81B1360 - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0x8] - lsls r0, 28 - lsrs r0, 28 - bx lr - .pool - thumb_func_end sub_81B1360 - - thumb_func_start sub_81B1370 -sub_81B1370: @ 81B1370 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r6, r5, 0 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B13E0 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B13E0 - bl sub_81B13EC - adds r4, r0, 0 - bl sub_81B1760 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - beq _081B13C0 - cmp r0, 0x2 - bgt _081B13B0 - cmp r0, 0x1 - beq _081B13B6 - b _081B13E0 - .pool -_081B13B0: - cmp r0, 0x8 - beq _081B13CA - b _081B13E0 -_081B13B6: - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_81B140C - b _081B13E0 -_081B13C0: - adds r0, r6, 0 - adds r1, r4, 0 - bl sub_81B15D0 - b _081B13E0 -_081B13CA: - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - lsls r0, 31 - cmp r0, 0 - beq _081B13E0 - movs r0, 0x5 - bl PlaySE - bl sub_81B4F88 -_081B13E0: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B1370 - - thumb_func_start sub_81B13EC -sub_81B13EC: @ 81B13EC - push {lr} - ldr r0, =gUnknown_0203CEC8 - ldrb r1, [r0, 0xB] - cmp r1, 0x8 - beq _081B13FA - cmp r1, 0xA - bne _081B1404 -_081B13FA: - adds r0, 0xA - b _081B1406 - .pool -_081B1404: - adds r0, 0x9 -_081B1406: - pop {r1} - bx r1 - thumb_func_end sub_81B13EC - - thumb_func_start sub_81B140C -sub_81B140C: @ 81B140C - push {r4,r5,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0 - ldrsb r0, [r4, r0] - cmp r0, 0x6 - bne _081B142C - ldr r0, =gUnknown_0203CEC8 - ldr r1, [r0, 0x4] - adds r0, r5, 0 - bl _call_via_r1 - b _081B159E - .pool -_081B142C: - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0xB] - subs r0, 0x3 - cmp r0, 0xA - bls _081B1438 - b _081B1592 -_081B1438: - lsls r0, 2 - ldr r1, =_081B144C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081B144C: - .4byte _081B149C - .4byte _081B1592 - .4byte _081B1538 - .4byte _081B1538 - .4byte _081B1510 - .4byte _081B1560 - .4byte _081B1592 - .4byte _081B1478 - .4byte _081B156E - .4byte _081B14E8 - .4byte _081B157C -_081B1478: - adds r0, r4, 0 - bl sub_81B15A4 - lsls r0, 24 - cmp r0, 0 - bne _081B1486 - b _081B159E -_081B1486: - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - adds r0, 0xD - bl sub_81B302C - adds r0, r5, 0 - bl sub_81615A8 - b _081B159E - .pool -_081B149C: - adds r0, r4, 0 - bl sub_81B15A4 - lsls r0, 24 - cmp r0, 0 - bne _081B14AA - b _081B159E -_081B14AA: - ldr r0, =gUnknown_0203CEC8 - ldrb r1, [r0, 0x8] - movs r0, 0xF - ands r0, r1 - ldr r2, =gUnknown_0203CEC4 - cmp r0, 0x1 - bne _081B14BE - ldr r1, [r2] - ldr r0, =sub_81B9140 - str r0, [r1, 0x4] -_081B14BE: - ldr r0, [r2] - adds r0, 0xD - bl sub_81B302C - ldr r0, =gUnknown_03006328 - ldr r1, =sub_81B6794 - ldr r2, [r0] - adds r0, r5, 0 - bl _call_via_r2 - b _081B159E - .pool -_081B14E8: - adds r0, r4, 0 - bl sub_81B15A4 - lsls r0, 24 - cmp r0, 0 - beq _081B159E - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - adds r0, 0xD - bl sub_81B302C - adds r0, r5, 0 - bl sub_81B7E4C - b _081B159E - .pool -_081B1510: - adds r0, r4, 0 - bl sub_81B15A4 - lsls r0, 24 - cmp r0, 0 - beq _081B159E - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - adds r0, 0xD - bl sub_81B302C - adds r0, r5, 0 - bl sub_81B8474 - b _081B159E - .pool -_081B1538: - adds r0, r4, 0 - bl sub_81B15A4 - lsls r0, 24 - cmp r0, 0 - beq _081B159E - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - adds r0, 0xD - bl sub_81B302C - adds r0, r5, 0 - bl sub_81B7FAC - b _081B159E - .pool -_081B1560: - movs r0, 0x5 - bl PlaySE - adds r0, r5, 0 - bl sub_81B3938 - b _081B159E -_081B156E: - movs r0, 0x5 - bl PlaySE - adds r0, r5, 0 - bl sub_81B12C0 - b _081B159E -_081B157C: - adds r0, r4, 0 - bl sub_81B15A4 - lsls r0, 24 - cmp r0, 0 - beq _081B159E - ldrb r1, [r4] - adds r0, r5, 0 - bl sub_81B21AC - b _081B159E -_081B1592: - movs r0, 0x5 - bl PlaySE - adds r0, r5, 0 - bl sub_81B36FC -_081B159E: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81B140C - - thumb_func_start sub_81B15A4 -sub_81B15A4: @ 81B15A4 - push {lr} - ldrb r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x2D - bl GetMonData - cmp r0, 0x1 - beq _081B15C4 - movs r0, 0x1 - b _081B15CC - .pool -_081B15C4: - movs r0, 0x20 - bl PlaySE - movs r0, 0 -_081B15CC: - pop {r1} - bx r1 - thumb_func_end sub_81B15A4 - - thumb_func_start sub_81B15D0 -sub_81B15D0: @ 81B15D0 - push {r4,r5,lr} - adds r5, r1, 0 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0xB] - cmp r0, 0x8 - beq _081B1602 - cmp r0, 0x8 - bgt _081B15F0 - cmp r0, 0x1 - beq _081B15FA - b _081B161E - .pool -_081B15F0: - cmp r0, 0xA - beq _081B1602 - cmp r0, 0xD - beq _081B1610 - b _081B161E -_081B15FA: - movs r0, 0x20 - bl PlaySE - b _081B1652 -_081B1602: - movs r0, 0x5 - bl PlaySE - adds r0, r4, 0 - bl sub_81B407C - b _081B1652 -_081B1610: - movs r0, 0x5 - bl PlaySE - adds r0, r4, 0 - bl sub_81B2210 - b _081B1652 -_081B161E: - movs r0, 0x5 - bl PlaySE - adds r0, r4, 0 - bl sub_81B1660 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B1652 - bl sub_81221AC - lsls r0, 24 - cmp r0, 0 - bne _081B1642 - ldr r1, =gSpecialVar_0x8004 - movs r0, 0x7 - strh r0, [r1] -_081B1642: - ldr r0, =gUnknown_0203CEE8 - movs r1, 0 - strb r1, [r0] - movs r0, 0x7 - strb r0, [r5] - adds r0, r4, 0 - bl sub_81B12C0 -_081B1652: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B15D0 - - thumb_func_start sub_81B1660 -sub_81B1660: @ 81B1660 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - movs r5, 0 - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0x8] - movs r1, 0xF - ands r1, r0 - cmp r1, 0x2 - bne _081B1680 - ldr r5, =gUnknown_085EA110 - b _081B168A - .pool -_081B1680: - cmp r1, 0x4 - bne _081B168A - bl sub_81B88BC - adds r5, r0, 0 -_081B168A: - cmp r5, 0 - beq _081B16CC - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - adds r0, 0xD - bl sub_81B302C - ldr r4, =gStringVar4 - adds r0, r4, 0 - adds r1, r5, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B16D4 - str r1, [r0] - movs r0, 0x1 - b _081B16CE - .pool -_081B16CC: - movs r0, 0 -_081B16CE: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81B1660 - - thumb_func_start sub_81B16D4 -sub_81B16D4: @ 81B16D4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B16F8 - bl sub_81B334C - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B1708 - str r0, [r1] -_081B16F8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B16D4 - - thumb_func_start sub_81B1708 -sub_81B1708: @ 81B1708 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _081B172E - cmp r1, 0 - bgt _081B1728 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _081B174C - b _081B1758 -_081B1728: - cmp r1, 0x1 - beq _081B1752 - b _081B1758 -_081B172E: - ldr r0, =gUnknown_0203CEE8 - strb r1, [r0] - ldr r1, =gUnknown_0203CEC8 - movs r0, 0x7 - strb r0, [r1, 0x9] - bl sub_81B8558 - adds r0, r4, 0 - bl sub_81B12C0 - b _081B1758 - .pool -_081B174C: - movs r0, 0x5 - bl PlaySE -_081B1752: - adds r0, r4, 0 - bl sub_81B1C1C -_081B1758: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B1708 - - thumb_func_start sub_81B1760 -sub_81B1760: @ 81B1760 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gMain - ldrh r1, [r0, 0x30] - adds r3, r0, 0 - cmp r1, 0x20 - beq _081B178E - cmp r1, 0x20 - bgt _081B177C - cmp r1, 0x10 - beq _081B1792 - b _081B1796 - .pool -_081B177C: - cmp r1, 0x40 - beq _081B1786 - cmp r1, 0x80 - beq _081B178A - b _081B1796 -_081B1786: - movs r1, 0xFF - b _081B17B2 -_081B178A: - movs r1, 0x1 - b _081B17B2 -_081B178E: - movs r1, 0xFE - b _081B17B2 -_081B1792: - movs r1, 0x2 - b _081B17B2 -_081B1796: - bl sub_812210C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B17AA - cmp r0, 0x2 - beq _081B17AE - movs r1, 0 - b _081B17B0 -_081B17AA: - movs r1, 0xFF - b _081B17B0 -_081B17AE: - movs r1, 0x1 -_081B17B0: - ldr r3, =gMain -_081B17B2: - ldrh r2, [r3, 0x2E] - movs r0, 0x8 - ands r0, r2 - cmp r0, 0 - beq _081B17C4 - movs r0, 0x8 - b _081B17F0 - .pool -_081B17C4: - lsls r0, r1, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _081B17D6 - adds r0, r4, 0 - bl sub_81B17F8 - movs r0, 0 - b _081B17F0 -_081B17D6: - movs r0, 0x1 - ands r0, r2 - cmp r0, 0 - beq _081B17EA - movs r0, 0 - ldrsb r0, [r4, r0] - cmp r0, 0x7 - bne _081B17EA - movs r0, 0x2 - b _081B17F0 -_081B17EA: - ldrh r1, [r3, 0x2E] - movs r0, 0x3 - ands r0, r1 -_081B17F0: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81B1760 - - thumb_func_start sub_81B17F8 -sub_81B17F8: @ 81B17F8 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldrb r4, [r5] - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0x8] - lsls r0, 26 - lsrs r0, 30 - cmp r0, 0 - bne _081B1820 - lsls r1, 24 - asrs r1, 24 - adds r0, r5, 0 - bl sub_81B1854 - b _081B182A - .pool -_081B1820: - lsls r1, 24 - asrs r1, 24 - adds r0, r5, 0 - bl sub_81B195C -_081B182A: - movs r1, 0 - ldrsb r1, [r5, r1] - lsls r4, 24 - asrs r0, r4, 24 - cmp r1, r0 - beq _081B184C - movs r0, 0x5 - bl PlaySE - lsrs r0, r4, 24 - movs r1, 0 - bl sub_81B0FCC - ldrb r0, [r5] - movs r1, 0x1 - bl sub_81B0FCC -_081B184C: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81B17F8 - - thumb_func_start sub_81B1854 -sub_81B1854: @ 81B1854 - push {r4,lr} - adds r4, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _081B187A - cmp r1, r0 - bgt _081B1870 - subs r0, 0x1 - cmp r1, r0 - beq _081B1924 - b _081B1952 -_081B1870: - cmp r1, 0x1 - beq _081B18C0 - cmp r1, 0x2 - beq _081B18F8 - b _081B1952 -_081B187A: - ldrb r0, [r4] - movs r1, 0 - ldrsb r1, [r4, r1] - cmp r1, 0 - bne _081B1888 - movs r0, 0x7 - b _081B1950 -_081B1888: - cmp r1, 0x6 - bne _081B1898 - ldr r0, =gUnknown_020244E9 - ldrb r0, [r0] - subs r0, 0x1 - b _081B1950 - .pool -_081B1898: - cmp r1, 0x7 - bne _081B18BC - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - lsls r0, 31 - cmp r0, 0 - beq _081B18B0 - movs r0, 0x6 - b _081B1950 - .pool -_081B18B0: - ldr r0, =gUnknown_020244E9 - ldrb r0, [r0] - subs r0, 0x1 - b _081B1950 - .pool -_081B18BC: - subs r0, 0x1 - b _081B1950 -_081B18C0: - ldrb r2, [r4] - movs r0, 0 - ldrsb r0, [r4, r0] - cmp r0, 0x7 - beq _081B194E - movs r1, 0 - ldrsb r1, [r4, r1] - ldr r0, =gUnknown_020244E9 - ldrb r0, [r0] - subs r0, 0x1 - cmp r1, r0 - bne _081B18F4 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - lsls r0, 31 - cmp r0, 0 - beq _081B18F0 - movs r0, 0x6 - b _081B1950 - .pool -_081B18F0: - movs r0, 0x7 - b _081B1950 -_081B18F4: - adds r0, r2, 0x1 - b _081B1950 -_081B18F8: - ldr r0, =gUnknown_020244E9 - ldrb r0, [r0] - cmp r0, 0x1 - beq _081B1952 - movs r0, 0 - ldrsb r0, [r4, r0] - cmp r0, 0 - bne _081B1952 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - lsls r0, 28 - lsrs r0, 29 - cmp r0, 0 - bne _081B1950 - movs r0, 0x1 - b _081B1950 - .pool -_081B1924: - movs r0, 0 - ldrsb r0, [r4, r0] - cmp r0, 0 - beq _081B1952 - cmp r0, 0x6 - beq _081B1952 - cmp r0, 0x7 - beq _081B1952 - ldr r0, =gUnknown_0203CEC4 - ldr r3, [r0] - movs r1, 0 - ldrsb r1, [r4, r1] - movs r0, 0x7 - ands r1, r0 - lsls r1, 1 - ldrb r2, [r3, 0x8] - movs r0, 0xF - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x8] -_081B194E: - movs r0, 0 -_081B1950: - strb r0, [r4] -_081B1952: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B1854 - - thumb_func_start sub_81B195C -sub_81B195C: @ 81B195C - push {r4-r6,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r2, r1, 24 - asrs r5, r1, 24 - movs r6, 0x1 - negs r6, r6 - cmp r5, r6 - beq _081B1988 - cmp r5, r6 - bgt _081B197E - movs r0, 0x2 - negs r0, r0 - cmp r5, r0 - bne _081B197C - b _081B1A9C -_081B197C: - b _081B1AF4 -_081B197E: - cmp r5, 0x1 - beq _081B19E4 - cmp r5, 0x2 - beq _081B1A24 - b _081B1AF4 -_081B1988: - ldrb r1, [r4] - movs r0, 0 - ldrsb r0, [r4, r0] - cmp r0, 0 - bne _081B1996 - movs r0, 0x7 - b _081B1AF2 -_081B1996: - cmp r0, 0x6 - bne _081B19A8 - ldr r0, =gUnknown_020244E9 - ldrb r0, [r0] - subs r0, 0x1 - b _081B1AF2 - .pool -_081B19A8: - cmp r0, 0x7 - bne _081B19C4 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - lsls r0, 31 - cmp r0, 0 - beq _081B19C0 - movs r0, 0x6 - b _081B1AF2 - .pool -_081B19C0: - subs r0, r1, 0x1 - strb r0, [r4] -_081B19C4: - movs r0, 0 - ldrsb r0, [r4, r0] - lsls r1, r2, 24 - asrs r1, 24 - bl sub_81B1B00 - lsls r0, 24 - lsrs r2, r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _081B19E0 - b _081B1AF4 -_081B19E0: - strb r2, [r4] - b _081B1AF4 -_081B19E4: - movs r0, 0 - ldrsb r0, [r4, r0] - cmp r0, 0x6 - bne _081B19F0 - movs r0, 0x7 - b _081B1AF2 -_081B19F0: - cmp r0, 0x7 - bne _081B19F8 - movs r0, 0 - b _081B1AF2 -_081B19F8: - movs r0, 0 - ldrsb r0, [r4, r0] - movs r1, 0x1 - bl sub_81B1B00 - lsls r0, 24 - lsrs r2, r0, 24 - asrs r0, 24 - cmp r0, r6 - bne _081B19E0 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - lsls r0, 31 - cmp r0, 0 - beq _081B1A20 - movs r0, 0x6 - b _081B1AF2 - .pool -_081B1A20: - movs r0, 0x7 - b _081B1AF2 -_081B1A24: - movs r0, 0 - ldrsb r0, [r4, r0] - cmp r0, 0 - bne _081B1A5C - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - lsls r0, 28 - lsrs r6, r0, 29 - cmp r6, 0x3 - bne _081B1A54 - ldr r0, =gUnknown_02024618 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B1AF4 - strb r6, [r4] - b _081B1AF4 - .pool -_081B1A54: - ldr r0, =gUnknown_020245B4 - b _081B1A70 - .pool -_081B1A5C: - cmp r0, 0x1 - bne _081B1AF4 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - lsls r0, 28 - lsrs r5, r0, 29 - cmp r5, 0x5 - bne _081B1A88 - ldr r0, =gUnknown_020246E0 -_081B1A70: - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B1AF4 - strb r5, [r4] - b _081B1AF4 - .pool -_081B1A88: - ldr r0, =gUnknown_0202467C - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B1AF4 - movs r0, 0x4 - b _081B1AF2 - .pool -_081B1A9C: - ldrb r1, [r4] - subs r0, r1, 0x2 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _081B1ACC - ldr r0, =gUnknown_0203CEC4 - ldr r3, [r0] - movs r1, 0 - ldrsb r1, [r4, r1] - movs r0, 0x7 - ands r1, r0 - lsls r1, 1 - ldrb r2, [r3, 0x8] - movs r0, 0xF - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x8] - movs r0, 0 - b _081B1AF2 - .pool -_081B1ACC: - subs r0, r1, 0x4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _081B1AF4 - ldr r0, =gUnknown_0203CEC4 - ldr r3, [r0] - movs r1, 0 - ldrsb r1, [r4, r1] - movs r0, 0x7 - ands r1, r0 - lsls r1, 1 - ldrb r2, [r3, 0x8] - movs r0, 0xF - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x8] - movs r0, 0x1 -_081B1AF2: - strb r0, [r4] -_081B1AF4: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B195C - - thumb_func_start sub_81B1B00 -sub_81B1B00: @ 81B1B00 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - asrs r6, r1, 24 -_081B1B0A: - lsls r0, r5, 24 - asrs r0, 24 - adds r0, r6 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, r5, 24 - lsrs r0, r1, 24 - cmp r0, 0x5 - bhi _081B1B38 - asrs r4, r1, 24 - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B1B0A - adds r0, r4, 0 - b _081B1B3C - .pool -_081B1B38: - movs r0, 0x1 - negs r0, r0 -_081B1B3C: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81B1B00 - - thumb_func_start GetMonNickname -@ u8 *GetMonNickname(struct pokemon *mon, u8 *dest) -GetMonNickname: @ 81B1B44 - push {r4,lr} - adds r4, r1, 0 - movs r1, 0x2 - adds r2, r4, 0 - bl GetMonData - adds r0, r4, 0 - bl StringGetEnd10 - pop {r4} - pop {r1} - bx r1 - thumb_func_end GetMonNickname - - thumb_func_start sub_81B1B5C -sub_81B1B5C: @ 81B1B5C - push {r4,lr} - lsls r4, r1, 24 - lsrs r4, 24 - bl sub_81B3300 - ldr r0, =sub_81B1B8C - movs r1, 0x1 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0x8] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B1B5C - - thumb_func_start sub_81B1B8C -sub_81B1B8C: @ 81B1B8C - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - movs r0, 0x6 - bl sub_8121F20 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - beq _081B1BC8 - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - movs r2, 0x8 - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _081B1BC2 - movs r0, 0x6 - movs r1, 0 - bl sub_8198070 - movs r0, 0x6 - bl ClearWindowTilemap -_081B1BC2: - adds r0, r5, 0 - bl DestroyTask -_081B1BC8: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B1B8C - - thumb_func_start sub_81B1BD4 -sub_81B1BD4: @ 81B1BD4 - push {lr} - ldr r0, =sub_81B1B8C - bl FuncIsActiveTask - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B1BD4 - - thumb_func_start sub_81B1BE8 -sub_81B1BE8: @ 81B1BE8 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B1C0E - movs r0, 0 - bl display_pokemon_menu_message - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B1370 - str r0, [r1] -_081B1C0E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B1BE8 - - thumb_func_start sub_81B1C1C -sub_81B1C1C: @ 81B1C1C - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B1C74 - movs r0, 0x6 - movs r1, 0 - bl sub_8198070 - movs r0, 0x6 - bl ClearWindowTilemap - bl sub_81221AC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B1C60 - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B1BE8 - b _081B1C72 - .pool -_081B1C60: - movs r0, 0 - bl display_pokemon_menu_message - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B1370 -_081B1C72: - str r0, [r1] -_081B1C74: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B1C1C - - thumb_func_start sub_81B1C84 -sub_81B1C84: @ 81B1C84 - push {r4,r5,lr} - adds r4, r1, 0 - adds r5, r2, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 24 - lsrs r5, 24 - ldr r1, =gStringVar1 - bl GetMonNickname - ldr r1, =gStringVar2 - adds r0, r4, 0 - bl CopyItemName - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E991B - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B1C84 - - thumb_func_start sub_81B1CD0 -sub_81B1CD0: @ 81B1CD0 - push {r4,r5,lr} - adds r4, r1, 0 - adds r5, r2, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 24 - lsrs r5, 24 - ldr r1, =gStringVar1 - bl GetMonNickname - ldr r1, =gStringVar2 - adds r0, r4, 0 - bl CopyItemName - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E999D - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B1CD0 - - thumb_func_start sub_81B1D1C -sub_81B1D1C: @ 81B1D1C - push {r4,r5,lr} - adds r4, r1, 0 - adds r5, r2, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 24 - lsrs r5, 24 - ldr r1, =gStringVar1 - bl GetMonNickname - ldr r1, =gStringVar2 - adds r0, r4, 0 - bl CopyItemName - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E993A - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B1D1C - - thumb_func_start sub_81B1D68 -sub_81B1D68: @ 81B1D68 - push {r4,r5,lr} - adds r4, r1, 0 - adds r5, r2, 0 - lsls r0, 16 - lsrs r0, 16 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 24 - lsrs r5, 24 - ldr r1, =gStringVar1 - bl CopyItemName - ldr r1, =gStringVar2 - adds r0, r4, 0 - bl CopyItemName - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E99DB - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B1D68 - - thumb_func_start sub_81B1DB8 -sub_81B1DB8: @ 81B1DB8 - push {r4-r7,lr} - sub sp, 0x4 - adds r6, r0, 0 - lsls r5, r1, 16 - lsrs r4, r5, 16 - adds r7, r4, 0 - adds r0, r4, 0 - bl itemid_is_mail - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B1DE2 - adds r0, r6, 0 - adds r1, r4, 0 - bl sub_80D4420 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _081B1DF6 -_081B1DE2: - mov r0, sp - strb r7, [r0] - mov r1, sp - lsrs r0, r5, 24 - strb r0, [r1, 0x1] - adds r0, r6, 0 - movs r1, 0xC - mov r2, sp - bl SetMonData -_081B1DF6: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81B1DB8 - - thumb_func_start sub_81B1E00 -sub_81B1E00: @ 81B1E00 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - mov r1, sp - strh r0, [r1] - cmp r0, 0 - bne _081B1E1C - movs r0, 0 - b _081B1E3E -_081B1E1C: - movs r1, 0x1 - bl AddBagItem - lsls r0, 24 - cmp r0, 0 - beq _081B1E3C - movs r1, 0 - mov r0, sp - strh r1, [r0] - adds r0, r4, 0 - movs r1, 0xC - mov r2, sp - bl SetMonData - movs r0, 0x2 - b _081B1E3E -_081B1E3C: - movs r0, 0x1 -_081B1E3E: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81B1E00 - - thumb_func_start pokemon_item_not_removed -pokemon_item_not_removed: @ 81B1E48 - push {lr} - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9A69 - bl StringExpandPlaceholders - pop {r0} - bx r0 - .pool - thumb_func_end pokemon_item_not_removed - - thumb_func_start sub_81B1E60 -sub_81B1E60: @ 81B1E60 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r0, 2 - add r0, r8 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r7, r0, r1 - ldrh r0, [r7, 0x4] - ldrh r1, [r7] - adds r0, r1 - strh r0, [r7] - ldrh r0, [r7, 0x6] - subs r0, 0x1 - strh r0, [r7, 0x6] - movs r2, 0x8 - ldrsh r0, [r7, r2] - movs r5, 0x64 - muls r0, r5 - ldr r4, =gPlayerParty - adds r0, r4 - movs r1, 0x39 - adds r2, r7, 0 - bl SetMonData - movs r3, 0x8 - ldrsh r2, [r7, r3] - adds r0, r2, 0 - muls r0, r5 - adds r0, r4 - ldr r6, =gUnknown_0203CEDC - lsls r2, 4 - ldr r1, [r6] - adds r1, r2 - movs r2, 0x1 - bl sub_81B2CD4 - movs r0, 0x8 - ldrsh r2, [r7, r0] - adds r0, r2, 0 - muls r0, r5 - adds r0, r4 - lsls r2, 4 - ldr r1, [r6] - adds r1, r2 - bl sub_81B2E28 - movs r1, 0x6 - ldrsh r0, [r7, r1] - cmp r0, 0 - beq _081B1EDC - movs r2, 0 - ldrsh r1, [r7, r2] - cmp r1, 0 - beq _081B1EDC - movs r3, 0x2 - ldrsh r0, [r7, r3] - cmp r1, r0 - bne _081B1EFE -_081B1EDC: - movs r0, 0 - ldrsh r1, [r7, r0] - movs r2, 0xA - ldrsh r0, [r7, r2] - cmp r1, r0 - ble _081B1EF8 - ldr r0, =gStringVar2 - movs r3, 0xA - ldrsh r2, [r7, r3] - subs r1, r2 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN -_081B1EF8: - mov r0, r8 - bl SwitchTaskToFollowupFunc -_081B1EFE: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B1E60 - - thumb_func_start sub_81B1F18 -sub_81B1F18: @ 81B1F18 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r8, r0 - mov r9, r1 - adds r5, r2, 0 - mov r10, r3 - ldr r7, [sp, 0x20] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - mov r0, r9 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsls r5, 24 - lsrs r5, 24 - mov r0, r10 - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - movs r0, 0x64 - mov r6, r9 - muls r6, r0 - ldr r0, =gPlayerParty - adds r6, r0 - mov r0, r8 - lsls r4, r0, 2 - add r4, r8 - lsls r4, 3 - ldr r0, =gTasks + 0x8 - adds r4, r0 - adds r0, r6, 0 - movs r1, 0x39 - bl GetMonData - strh r0, [r4] - adds r0, r6, 0 - movs r1, 0x3A - bl GetMonData - strh r0, [r4, 0x2] - lsls r5, 24 - asrs r5, 24 - strh r5, [r4, 0x4] - mov r0, r10 - strh r0, [r4, 0x6] - mov r0, r9 - strh r0, [r4, 0x8] - ldrh r0, [r4] - strh r0, [r4, 0xA] - ldr r1, =sub_81B1E60 - mov r0, r8 - adds r2, r7, 0 - bl SetTaskFuncWithFollowupFunc - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B1F18 - - thumb_func_start sub_81B1FA8 -sub_81B1FA8: @ 81B1FA8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r3, r0, r1 - cmp r5, 0x5 - bhi _081B200A - lsls r0, r5, 2 - ldr r1, =_081B1FD4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081B1FD4: - .4byte _081B1FEC - .4byte _081B1FF2 - .4byte _081B1FF6 - .4byte _081B1FFA - .4byte _081B1FFE - .4byte _081B2002 -_081B1FEC: - strh r2, [r3] - strh r2, [r3, 0xA] - b _081B200A -_081B1FF2: - strh r2, [r3, 0x2] - b _081B200A -_081B1FF6: - strh r2, [r3, 0x4] - b _081B200A -_081B1FFA: - strh r2, [r3, 0x6] - b _081B200A -_081B1FFE: - strh r2, [r3, 0x8] - b _081B200A -_081B2002: - ldr r1, =sub_81B1E60 - adds r0, r4, 0 - bl SetTaskFuncWithFollowupFunc -_081B200A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B1FA8 - - thumb_func_start pokemon_ailments_get_primary -pokemon_ailments_get_primary: @ 81B2014 - push {lr} - adds r1, r0, 0 - movs r0, 0x88 - ands r0, r1 - cmp r0, 0 - beq _081B2024 - movs r0, 0x1 - b _081B2056 -_081B2024: - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081B2030 - movs r0, 0x2 - b _081B2056 -_081B2030: - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - beq _081B203C - movs r0, 0x3 - b _081B2056 -_081B203C: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _081B2048 - movs r0, 0x4 - b _081B2056 -_081B2048: - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _081B2054 - movs r0, 0 - b _081B2056 -_081B2054: - movs r0, 0x5 -_081B2056: - pop {r1} - bx r1 - 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 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - bne _081B206E - movs r0, 0x7 - b _081B2096 -_081B206E: - adds r0, r4, 0 - movs r1, 0x37 - bl GetMonData - bl pokemon_ailments_get_primary - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _081B2096 - adds r0, r4, 0 - movs r1, 0 - bl sub_806DD7C - lsls r0, 24 - cmp r0, 0 - bne _081B2094 - movs r0, 0 - b _081B2096 -_081B2094: - movs r0, 0x6 -_081B2096: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81B205C - - thumb_func_start sub_81B209C -sub_81B209C: @ 81B209C - push {r4,r5,lr} - ldr r2, =gUnknown_0203CEC8 - ldrb r1, [r2, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0xB - bne _081B2126 - adds r5, r2, 0 - adds r5, 0xE - movs r0, 0 - strh r0, [r2, 0xE] - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0 - bne _081B20FC - movs r4, 0 - ldr r0, =gUnknown_020244E9 - ldrb r0, [r0] - cmp r4, r0 - bcs _081B2126 -_081B20C4: - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - adds r0, r1 - bl sub_81B2134 - lsls r0, 16 - lsrs r0, 16 - lsls r0, r4 - ldrh r1, [r5] - adds r0, r1 - strh r0, [r5] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gUnknown_020244E9 - ldrb r0, [r0] - cmp r4, r0 - bcc _081B20C4 - b _081B2126 - .pool -_081B20FC: - movs r4, 0 - b _081B211E -_081B2100: - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - adds r0, r1 - bl sub_81B2164 - lsls r0, 16 - lsrs r0, 16 - lsls r0, r4 - ldrh r1, [r5] - adds r0, r1 - strh r0, [r5] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_081B211E: - ldr r0, =gUnknown_020244E9 - ldrb r0, [r0] - cmp r4, r0 - bcc _081B2100 -_081B2126: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B209C - - thumb_func_start sub_81B2134 -sub_81B2134: @ 81B2134 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2D - bl GetMonData - cmp r0, 0x1 - beq _081B215A - adds r0, r4, 0 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - bl sub_802C908 - cmp r0, 0 - beq _081B215A - movs r0, 0x1 - b _081B215C -_081B215A: - movs r0, 0 -_081B215C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81B2134 - - thumb_func_start sub_81B2164 -sub_81B2164: @ 81B2164 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2D - bl GetMonData - cmp r0, 0x1 - beq _081B2182 - adds r0, r4, 0 - movs r1, 0xB - bl GetMonData - cmp r0, 0x55 - bne _081B2182 - movs r0, 0x1 - b _081B2184 -_081B2182: - movs r0, 0 -_081B2184: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81B2164 - - thumb_func_start sub_81B218C -sub_81B218C: @ 81B218C - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0203CEC8 - movs r2, 0xE - ldrsh r1, [r1, r2] - asrs r1, r0 - movs r0, 0x1 - ands r1, r0 - cmp r1, 0 - bne _081B21A4 - movs r0, 0 -_081B21A4: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B218C - - thumb_func_start sub_81B21AC -sub_81B21AC: @ 81B21AC - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - adds r0, r5, 0 - bl sub_81B218C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B21DC - movs r0, 0x5 - bl PlaySE - ldr r0, =gSpecialVar_0x8004 - strh r5, [r0] - adds r0, r4, 0 - bl sub_81B12C0 - b _081B21FE - .pool -_081B21DC: - movs r0, 0x20 - bl PlaySE - ldr r0, =gUnknown_085EA0EE - movs r1, 0 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1C1C - str r1, [r0] -_081B21FE: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B21AC - - thumb_func_start sub_81B2210 -sub_81B2210: @ 81B2210 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_085EA110 - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B2248 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B2210 - - thumb_func_start sub_81B2248 -sub_81B2248: @ 81B2248 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B226C - bl sub_81B334C - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B227C - str r0, [r1] -_081B226C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B2248 - - thumb_func_start sub_81B227C -sub_81B227C: @ 81B227C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _081B22A2 - cmp r1, 0 - bgt _081B229C - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _081B22B4 - b _081B22C8 -_081B229C: - cmp r1, 0x1 - beq _081B22BA - b _081B22C8 -_081B22A2: - ldr r1, =gSpecialVar_0x8004 - movs r0, 0x7 - strh r0, [r1] - adds r0, r4, 0 - bl sub_81B12C0 - b _081B22C8 - .pool -_081B22B4: - movs r0, 0x5 - bl PlaySE -_081B22BA: - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B1C1C - str r0, [r1] -_081B22C8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B227C - - thumb_func_start sub_81B22D8 -sub_81B22D8: @ 81B22D8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r0, 0 - lsls r1, 16 - lsrs r4, r1, 16 - adds r7, r4, 0 - lsls r2, 24 - lsrs r6, r2, 24 - mov r8, r6 - movs r1, 0x2D - bl GetMonData - cmp r0, 0 - beq _081B22FA - movs r0, 0x3 - b _081B2356 -_081B22FA: - movs r0, 0x90 - lsls r0, 1 - cmp r4, r0 - bls _081B231C - adds r1, r4, 0 - subs r1, 0x21 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl sub_806E00C - cmp r0, 0 - beq _081B2334 - adds r0, r7, 0 - bl ItemIdToBattleMoveId - b _081B233E -_081B231C: - adds r0, r5, 0 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - adds r1, r6, 0 - bl sub_81B2370 - lsls r0, 24 - cmp r0, 0 - bne _081B2338 -_081B2334: - movs r0, 0x1 - b _081B2356 -_081B2338: - mov r0, r8 - bl sub_81B2360 -_081B233E: - lsls r0, 16 - lsrs r1, r0, 16 - adds r0, r5, 0 - bl pokemon_has_move - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B2354 - movs r0, 0 - b _081B2356 -_081B2354: - movs r0, 0x2 -_081B2356: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81B22D8 - - thumb_func_start sub_81B2360 -sub_81B2360: @ 81B2360 - lsls r0, 24 - ldr r1, =gUnknown_0861500C - lsrs r0, 23 - adds r0, r1 - ldrh r0, [r0] - bx lr - .pool - thumb_func_end sub_81B2360 - - thumb_func_start sub_81B2370 -sub_81B2370: @ 81B2370 - push {lr} - lsls r0, 16 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_08615048 - lsrs r0, 14 - adds r0, r2 - movs r2, 0x1 - lsls r2, r1 - ldr r0, [r0] - ands r0, r2 - cmp r0, 0 - bne _081B2394 - movs r0, 0 - b _081B2396 - .pool -_081B2394: - movs r0, 0x1 -_081B2396: - pop {r1} - bx r1 - thumb_func_end sub_81B2370 - - thumb_func_start sub_81B239C -sub_81B239C: @ 81B239C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - cmp r0, 0x1 - beq _081B23C4 - cmp r0, 0x1 - bgt _081B23B2 - cmp r0, 0 - beq _081B23B8 - b _081B23DC -_081B23B2: - cmp r1, 0x2 - beq _081B23D0 - b _081B23DC -_081B23B8: - ldr r0, =gUnknown_08615810 - bl InitWindows - b _081B23E2 - .pool -_081B23C4: - ldr r0, =gUnknown_08615850 - bl InitWindows - b _081B23E2 - .pool -_081B23D0: - ldr r0, =gUnknown_08615890 - bl InitWindows - b _081B23E2 - .pool -_081B23DC: - ldr r0, =gUnknown_086158D0 - bl InitWindows -_081B23E2: - bl DeactivateAllTextPrinters - movs r4, 0 -_081B23E8: - adds r0, r4, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _081B23E8 - movs r0, 0 - movs r1, 0x4F - movs r2, 0xD0 - bl sub_809882C - bl sub_8098C64 - movs r1, 0xE0 - movs r2, 0x20 - bl LoadPalette - ldr r0, =gUnknown_0860F074 - movs r1, 0xF0 - movs r2, 0x20 - bl LoadPalette - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B239C - - thumb_func_start sub_81B2428 -sub_81B2428: @ 81B2428 - push {r4-r6,lr} - sub sp, 0x14 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gUnknown_0203CEC8 - ldrb r1, [r0, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x5 - bne _081B243E - b _081B2554 -_081B243E: - cmp r2, 0x1 - bne _081B24B4 - ldr r0, =gUnknown_08615918 - bl AddWindow - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r5, =gUnknown_085E8CE3 - movs r0, 0 - adds r1, r5, 0 - movs r2, 0x30 - bl GetStringCenterAlignXOffset - lsls r0, 24 - lsrs r2, r0, 24 - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - ldr r0, =gUnknown_086157FC - str r0, [sp, 0x8] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0xC] - str r5, [sp, 0x10] - adds r0, r4, 0 - movs r1, 0 - movs r3, 0x1 - bl AddTextPrinterParametrized2 - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x2 - bl CopyWindowToVram - ldr r0, =gUnknown_08615910 - bl AddWindow - lsls r0, 24 - lsrs r5, r0, 24 - movs r6, 0 - b _081B24C0 - .pool -_081B24B4: - ldr r0, =gUnknown_08615908 - bl AddWindow - lsls r0, 24 - lsrs r5, r0, 24 - movs r6, 0x3 -_081B24C0: - adds r0, r5, 0 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r0, =gUnknown_0203CEC8 - ldrb r1, [r0, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0xA - beq _081B2514 - ldr r4, =gUnknown_085E8CF0 - movs r0, 0 - adds r1, r4, 0 - movs r2, 0x30 - bl GetStringCenterAlignXOffset - lsls r0, 24 - lsrs r2, r0, 24 - adds r2, r6 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gUnknown_086157FC - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - adds r0, r5, 0 - movs r1, 0 - movs r3, 0x1 - bl box_print - b _081B2540 - .pool -_081B2514: - ldr r4, =gUnknown_085E8CF7 - movs r0, 0 - adds r1, r4, 0 - movs r2, 0x30 - bl GetStringCenterAlignXOffset - lsls r0, 24 - lsrs r2, r0, 24 - adds r2, r6 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gUnknown_086157FC - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - adds r0, r5, 0 - movs r1, 0 - movs r3, 0x1 - bl box_print -_081B2540: - adds r0, r5, 0 - bl PutWindowTilemap - adds r0, r5, 0 - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram -_081B2554: - add sp, 0x14 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B2428 - - thumb_func_start sub_81B2564 -sub_81B2564: @ 81B2564 - lsls r0, 24 - ldr r1, =gUnknown_0203CEC4 - lsrs r0, 23 - adds r0, 0x18 - ldr r1, [r1] - adds r1, r0 - adds r0, r1, 0 - bx lr - .pool - thumb_func_end sub_81B2564 - - thumb_func_start sub_81B2578 -sub_81B2578: @ 81B2578 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x2C - str r1, [sp, 0xC] - ldr r1, [sp, 0x4C] - ldr r4, [sp, 0x50] - ldr r5, [sp, 0x54] - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x8] - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x10] - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x14] - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x18] - lsls r4, 24 - lsrs r6, r4, 24 - lsls r5, 24 - lsrs r5, 24 - mov r10, r5 - mov r0, r10 - muls r0, r6 - lsls r0, 5 - bl AllocZeroed - mov r9, r0 - cmp r0, 0 - beq _081B2646 - movs r5, 0 - ldr r0, [sp, 0x14] - lsls r0, 19 - str r0, [sp, 0x1C] - ldr r1, [sp, 0x18] - lsls r1, 19 - str r1, [sp, 0x20] - lsls r2, r6, 19 - str r2, [sp, 0x24] - mov r0, r10 - lsls r0, 19 - str r0, [sp, 0x28] - cmp r5, r10 - bcs _081B2624 -_081B25DA: - movs r4, 0 - adds r1, r5, 0x1 - mov r8, r1 - cmp r4, r6 - bcs _081B261A - ldr r2, [sp, 0x18] - adds r0, r2, r5 - ldr r2, [sp, 0x10] - adds r1, r0, 0 - muls r1, r2 - adds r7, r1, 0 -_081B25F0: - ldr r1, [sp, 0x14] - adds r0, r1, r4 - adds r0, r7 - ldr r2, [sp, 0xC] - adds r0, r2, r0 - ldrb r0, [r0] - bl sub_81B0DD4 - adds r1, r5, 0 - muls r1, r6 - adds r1, r4 - lsls r1, 5 - add r1, r9 - movs r2, 0x10 - bl CpuSet - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r6 - bcc _081B25F0 -_081B261A: - mov r1, r8 - lsls r0, r1, 24 - lsrs r5, r0, 24 - cmp r5, r10 - bcc _081B25DA -_081B2624: - ldr r0, [sp, 0x1C] - lsrs r2, r0, 16 - ldr r1, [sp, 0x20] - lsrs r3, r1, 16 - ldr r1, [sp, 0x24] - lsrs r0, r1, 16 - str r0, [sp] - ldr r1, [sp, 0x28] - lsrs r0, r1, 16 - str r0, [sp, 0x4] - ldr r0, [sp, 0x8] - mov r1, r9 - bl BlitBitmapToWindow - mov r0, r9 - bl Free -_081B2646: - add sp, 0x2C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81B2578 - - thumb_func_start sub_81B2658 -sub_81B2658: @ 81B2658 - push {r4-r6,lr} - sub sp, 0xC - ldr r4, [sp, 0x1C] - ldr r5, [sp, 0x20] - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - cmp r3, 0 - bne _081B2684 - cmp r4, 0 - bne _081B2684 - movs r3, 0xA - movs r4, 0x7 -_081B2684: - cmp r5, 0 - bne _081B26A0 - ldr r1, =gUnknown_08615988 - str r2, [sp] - str r3, [sp, 0x4] - str r4, [sp, 0x8] - movs r2, 0xA - adds r3, r6, 0 - bl sub_81B2578 - b _081B26B0 - .pool -_081B26A0: - ldr r1, =gUnknown_086159CE - str r2, [sp] - str r3, [sp, 0x4] - str r4, [sp, 0x8] - movs r2, 0xA - adds r3, r6, 0 - bl sub_81B2578 -_081B26B0: - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B2658 - - thumb_func_start sub_81B26BC -sub_81B26BC: @ 81B26BC - push {r4-r6,lr} - sub sp, 0xC - ldr r4, [sp, 0x1C] - ldr r5, [sp, 0x20] - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - cmp r3, 0 - bne _081B26E8 - cmp r4, 0 - bne _081B26E8 - movs r3, 0x12 - movs r4, 0x3 -_081B26E8: - cmp r5, 0 - bne _081B2704 - ldr r1, =gUnknown_08615A14 - str r2, [sp] - str r3, [sp, 0x4] - str r4, [sp, 0x8] - movs r2, 0x12 - adds r3, r6, 0 - bl sub_81B2578 - b _081B2714 - .pool -_081B2704: - ldr r1, =gUnknown_08615A4A - str r2, [sp] - str r3, [sp, 0x4] - str r4, [sp, 0x8] - movs r2, 0x12 - adds r3, r6, 0 - bl sub_81B2578 -_081B2714: - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B26BC - - thumb_func_start sub_81B2720 -sub_81B2720: @ 81B2720 - push {lr} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_08615A80 - movs r2, 0 - str r2, [sp] - movs r2, 0x12 - str r2, [sp, 0x4] - movs r2, 0x3 - str r2, [sp, 0x8] - movs r2, 0x12 - movs r3, 0 - bl sub_81B2578 - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B2720 - - thumb_func_start sub_81B2748 -sub_81B2748: @ 81B2748 - push {r4-r7,lr} - lsls r1, 24 - lsrs r4, r1, 24 - adds r5, r4, 0 - ldrb r0, [r0, 0x8] - movs r1, 0x5 - bl GetWindowAttribute - lsls r0, 28 - lsrs r6, r0, 24 - adds r7, r6, 0 - movs r0, 0x40 - ands r0, r4 - cmp r0, 0 - beq _081B277C - ldr r5, =gUnknown_08615AF1 - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615AC0 - b _081B297E - .pool -_081B277C: - movs r0, 0x20 - ands r0, r4 - cmp r0, 0 - beq _081B27D8 - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _081B2794 - ldr r5, =gUnknown_08615ADF - b _081B2942 - .pool -_081B2794: - ldr r5, =gUnknown_08615ADF - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615ABA - ldrb r1, [r4] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x2] - bl sub_81B2564 - ldrb r1, [r4, 0x2] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldr r5, =gUnknown_08615AEE - b _081B2976 - .pool -_081B27D8: - movs r0, 0x10 - ands r0, r4 - cmp r0, 0 - beq _081B2824 - ldr r5, =gUnknown_08615ADF - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615ABA - ldrb r1, [r4] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x2] - bl sub_81B2564 - ldrb r1, [r4, 0x2] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldr r5, =gUnknown_08615AEE - b _081B2976 - .pool -_081B2824: - movs r0, 0x4 - ands r0, r4 - cmp r0, 0 - beq _081B2880 - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _081B283C - ldr r5, =gUnknown_08615ADF - b _081B2942 - .pool -_081B283C: - ldr r5, =gUnknown_08615ADF - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615ABA - ldrb r1, [r4] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x2] - bl sub_81B2564 - ldrb r1, [r4, 0x2] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldr r5, =gUnknown_08615AEE - b _081B2976 - .pool -_081B2880: - movs r0, 0x2 - ands r0, r4 - cmp r0, 0 - beq _081B28DC - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _081B2898 - ldr r5, =gUnknown_08615ADC - b _081B2942 - .pool -_081B2898: - ldr r5, =gUnknown_08615AD3 - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615ABA - ldrb r1, [r4] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x2] - bl sub_81B2564 - ldrb r1, [r4, 0x2] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldr r5, =gUnknown_08615AE8 - b _081B2976 - .pool -_081B28DC: - movs r0, 0x8 - ands r0, r4 - cmp r0, 0 - beq _081B2938 - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _081B28F4 - ldr r5, =gUnknown_08615AD9 - b _081B2942 - .pool -_081B28F4: - ldr r5, =gUnknown_08615AD0 - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615ABA - ldrb r1, [r4] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x2] - bl sub_81B2564 - ldrb r1, [r4, 0x2] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldr r5, =gUnknown_08615AE5 - b _081B2976 - .pool -_081B2938: - movs r0, 0x1 - ands r5, r0 - cmp r5, 0 - beq _081B29BC - ldr r5, =gUnknown_08615AD6 -_081B2942: - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615ABA - ldrb r1, [r4] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x2] - bl sub_81B2564 - ldrb r1, [r4, 0x2] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldr r5, =gUnknown_08615AEB -_081B2976: - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615ABD -_081B297E: - ldrb r1, [r4] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x2] - bl sub_81B2564 - ldrb r1, [r4, 0x2] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - b _081B2A24 - .pool -_081B29BC: - ldr r5, =gUnknown_08615ACD - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615ABA - ldrb r1, [r4] - adds r1, r7 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r7 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x2] - bl sub_81B2564 - ldrb r1, [r4, 0x2] - adds r1, r7 - movs r2, 0x2 - bl LoadPalette - ldr r5, =gUnknown_08615AE2 - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615ABD - ldrb r1, [r4] - adds r1, r7 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r7 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x2] - bl sub_81B2564 - ldrb r1, [r4, 0x2] - adds r1, r7 - movs r2, 0x2 - bl LoadPalette -_081B2A24: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B2748 - - thumb_func_start sub_81B2A3C -sub_81B2A3C: @ 81B2A3C - push {r4,r5,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - lsls r2, 24 - lsrs r2, 24 - ldrb r5, [r3] - ldrb r3, [r3, 0x1] - lsls r4, r2, 1 - adds r4, r2 - ldr r2, =gUnknown_086157FC - adds r4, r2 - str r4, [sp] - movs r2, 0 - str r2, [sp, 0x4] - str r1, [sp, 0x8] - movs r1, 0 - adds r2, r5, 0 - bl box_print - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B2A3C - - thumb_func_start sub_81B2A70 -sub_81B2A70: @ 81B2A70 - push {r4-r7,lr} - sub sp, 0x14 - adds r7, r0, 0 - adds r6, r1, 0 - lsls r2, 24 - lsrs r4, r2, 24 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B2AC0 - cmp r4, 0x1 - bne _081B2AAA - ldr r5, [r6] - ldrb r0, [r6, 0x8] - ldrb r1, [r5, 0x4] - lsrs r1, 3 - ldrb r2, [r5, 0x5] - lsrs r2, 3 - ldrb r3, [r5, 0x6] - lsrs r3, 3 - ldrb r4, [r5, 0x7] - lsrs r4, 3 - str r4, [sp] - movs r4, 0 - str r4, [sp, 0x4] - ldr r4, [r5] - bl _call_via_r4 -_081B2AAA: - adds r0, r7, 0 - add r1, sp, 0x8 - bl GetMonNickname - ldrb r0, [r6, 0x8] - ldr r3, [r6] - adds r3, 0x4 - add r1, sp, 0x8 - movs r2, 0 - bl sub_81B2A3C -_081B2AC0: - add sp, 0x14 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81B2A70 - - thumb_func_start sub_81B2AC8 -sub_81B2AC8: @ 81B2AC8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - adds r6, r0, 0 - adds r7, r1, 0 - lsls r2, 24 - lsrs r4, r2, 24 - mov r8, r4 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B2B34 - adds r0, r6, 0 - bl sub_81B205C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _081B2AF6 - cmp r0, 0x6 - bne _081B2B34 -_081B2AF6: - cmp r4, 0 - beq _081B2B1C - ldr r5, [r7] - ldrb r0, [r7, 0x8] - ldrb r1, [r5, 0x8] - lsrs r1, 3 - ldrb r2, [r5, 0x9] - lsrs r2, 3 - adds r2, 0x1 - ldrb r3, [r5, 0xA] - lsrs r3, 3 - ldrb r4, [r5, 0xB] - lsrs r4, 3 - str r4, [sp] - movs r4, 0 - str r4, [sp, 0x4] - ldr r4, [r5] - bl _call_via_r4 -_081B2B1C: - mov r0, r8 - cmp r0, 0x2 - beq _081B2B34 - adds r0, r6, 0 - movs r1, 0x38 - bl GetMonData - lsls r0, 24 - lsrs r0, 24 - adds r1, r7, 0 - bl sub_81B2B40 -_081B2B34: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81B2AC8 - - thumb_func_start sub_81B2B40 -sub_81B2B40: @ 81B2B40 - push {r4-r6,lr} - adds r2, r0, 0 - adds r6, r1, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r5, =gStringVar2 - adds r0, r5, 0 - adds r1, r2, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar1 - ldr r1, =gUnknown_085E8D4D - adds r0, r4, 0 - bl StringCopy - adds r0, r4, 0 - adds r1, r5, 0 - bl StringAppend - ldrb r0, [r6, 0x8] - ldr r3, [r6] - adds r3, 0x8 - adds r1, r4, 0 - movs r2, 0 - bl sub_81B2A3C - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B2B40 - - thumb_func_start sub_81B2B8C -sub_81B2B8C: @ 81B2B8C - push {r4-r7,lr} - sub sp, 0x14 - adds r6, r0, 0 - adds r7, r1, 0 - lsls r2, 24 - lsrs r2, 24 - cmp r2, 0x1 - bne _081B2BBE - ldr r5, [r7] - ldrb r0, [r7, 0x8] - ldrb r1, [r5, 0xC] - lsrs r1, 3 - ldrb r2, [r5, 0xD] - lsrs r2, 3 - adds r2, 0x1 - ldrb r3, [r5, 0xE] - lsrs r3, 3 - ldrb r4, [r5, 0xF] - lsrs r4, 3 - str r4, [sp] - movs r4, 0 - str r4, [sp, 0x4] - ldr r4, [r5] - bl _call_via_r4 -_081B2BBE: - adds r0, r6, 0 - add r1, sp, 0x8 - bl GetMonNickname - adds r0, r6, 0 - bl pokemon_get_gender - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r6, 0 - movs r1, 0xB - bl GetMonData - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - add r2, sp, 0x8 - adds r3, r7, 0 - bl sub_81B2BF4 - add sp, 0x14 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81B2B8C - - thumb_func_start sub_81B2BF4 -sub_81B2BF4: @ 81B2BF4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - mov r9, r2 - adds r7, r3, 0 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r1, 16 - lsrs r4, r1, 16 - adds r5, r4, 0 - ldrb r0, [r7, 0x8] - movs r1, 0x5 - bl GetWindowAttribute - lsls r0, 28 - lsrs r6, r0, 24 - cmp r4, 0 - beq _081B2CBA - cmp r4, 0x20 - beq _081B2C24 - cmp r4, 0x1D - bne _081B2C38 -_081B2C24: - movs r0, 0xB - adds r1, r5, 0 - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - mov r0, r9 - bl StringCompare - cmp r0, 0 - beq _081B2CBA -_081B2C38: - mov r0, r8 - cmp r0, 0 - beq _081B2C48 - cmp r0, 0xFE - beq _081B2C88 - b _081B2CBA - .pool -_081B2C48: - ldr r5, =gUnknown_08615AC3 - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615AB6 - ldrb r1, [r4] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r7, 0x8] - ldr r1, =gUnknown_085E8D49 - ldr r3, [r7] - adds r3, 0xC - movs r2, 0x2 - bl sub_81B2A3C - b _081B2CBA - .pool -_081B2C88: - ldr r5, =gUnknown_08615AC5 - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615AB6 - ldrb r1, [r4] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r6 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r7, 0x8] - ldr r1, =gUnknown_085E8D4B - ldr r3, [r7] - adds r3, 0xC - movs r2, 0x2 - bl sub_81B2A3C -_081B2CBA: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B2BF4 - - thumb_func_start sub_81B2CD4 -sub_81B2CD4: @ 81B2CD4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - adds r7, r0, 0 - adds r6, r1, 0 - lsls r2, 24 - lsrs r4, r2, 24 - mov r8, r4 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B2D2E - cmp r4, 0 - beq _081B2D16 - ldr r5, [r6] - ldrb r0, [r6, 0x8] - ldrb r1, [r5, 0x10] - lsrs r1, 3 - ldrb r2, [r5, 0x11] - lsrs r2, 3 - adds r2, 0x1 - ldrb r3, [r5, 0x12] - lsrs r3, 3 - ldrb r4, [r5, 0x13] - lsrs r4, 3 - str r4, [sp] - movs r4, 0 - str r4, [sp, 0x4] - ldr r4, [r5] - bl _call_via_r4 -_081B2D16: - mov r0, r8 - cmp r0, 0x2 - beq _081B2D2E - adds r0, r7, 0 - movs r1, 0x39 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - adds r1, r6, 0 - bl sub_81B2D3C -_081B2D2E: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81B2CD4 - - thumb_func_start sub_81B2D3C -sub_81B2D3C: @ 81B2D3C - push {r4,r5,lr} - adds r2, r0, 0 - adds r4, r1, 0 - lsls r2, 16 - lsrs r2, 16 - ldr r5, =gStringVar1 - adds r0, r5, 0 - adds r1, r2, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - movs r1, 0xBA - strb r1, [r0] - movs r1, 0xFF - strb r1, [r0, 0x1] - ldrb r0, [r4, 0x8] - ldr r3, [r4] - adds r3, 0x10 - adds r1, r5, 0 - movs r2, 0 - bl sub_81B2A3C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B2D3C - - thumb_func_start sub_81B2D74 -sub_81B2D74: @ 81B2D74 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - adds r7, r0, 0 - adds r6, r1, 0 - lsls r2, 24 - lsrs r4, r2, 24 - mov r8, r4 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B2DD0 - cmp r4, 0 - beq _081B2DB8 - ldr r5, [r6] - ldrb r0, [r6, 0x8] - ldrb r1, [r5, 0x14] - lsrs r1, 3 - adds r1, 0x1 - ldrb r2, [r5, 0x15] - lsrs r2, 3 - adds r2, 0x1 - ldrb r3, [r5, 0x16] - lsrs r3, 3 - ldrb r4, [r5, 0x17] - lsrs r4, 3 - str r4, [sp] - movs r4, 0 - str r4, [sp, 0x4] - ldr r4, [r5] - bl _call_via_r4 -_081B2DB8: - mov r0, r8 - cmp r0, 0x2 - beq _081B2DD0 - adds r0, r7, 0 - movs r1, 0x3A - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - adds r1, r6, 0 - bl sub_81B2DDC -_081B2DD0: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81B2D74 - - thumb_func_start sub_81B2DDC -sub_81B2DDC: @ 81B2DDC - push {r4-r6,lr} - adds r2, r0, 0 - adds r6, r1, 0 - lsls r2, 16 - lsrs r2, 16 - ldr r5, =gStringVar2 - adds r0, r5, 0 - adds r1, r2, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar1 - ldr r1, =gUnknown_085E8D3E - adds r0, r4, 0 - bl StringCopy - adds r0, r4, 0 - adds r1, r5, 0 - bl StringAppend - ldrb r0, [r6, 0x8] - ldr r3, [r6] - adds r3, 0x14 - adds r1, r4, 0 - movs r2, 0 - bl sub_81B2A3C - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B2DDC - - thumb_func_start sub_81B2E28 -sub_81B2E28: @ 81B2E28 - push {r4-r6,lr} - adds r5, r0, 0 - adds r6, r1, 0 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B2E5C - adds r0, r5, 0 - movs r1, 0x39 - bl GetMonData - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0x3A - bl GetMonData - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - adds r2, r6, 0 - bl sub_81B2E64 -_081B2E5C: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81B2E28 - - thumb_func_start sub_81B2E64 -sub_81B2E64: @ 81B2E64 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x8 - adds r6, r2, 0 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - lsls r1, 16 - lsrs r1, 16 - mov r9, r1 - ldrb r0, [r6, 0x8] - movs r1, 0x5 - bl GetWindowAttribute - lsls r0, 28 - lsrs r7, r0, 24 - mov r1, r8 - lsls r0, r1, 16 - asrs r0, 16 - mov r2, r9 - lsls r1, r2, 16 - asrs r1, 16 - bl sub_8075060 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - beq _081B2EB0 - cmp r0, 0x2 - blt _081B2EE0 - cmp r0, 0x4 - bgt _081B2EE0 - ldr r5, =gUnknown_08615AC7 - b _081B2EB2 - .pool -_081B2EB0: - ldr r5, =gUnknown_08615AC9 -_081B2EB2: - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615AB8 - ldrb r1, [r4] - adds r1, r7 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r7 - movs r2, 0x2 - bl LoadPalette - b _081B2F04 - .pool -_081B2EE0: - ldr r5, =gUnknown_08615ACB - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615AB8 - ldrb r1, [r4] - adds r1, r7 - movs r2, 0x2 - bl LoadPalette - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r7 - movs r2, 0x2 - bl LoadPalette -_081B2F04: - mov r1, r8 - lsls r0, r1, 16 - asrs r0, 16 - mov r2, r9 - lsls r1, r2, 16 - asrs r1, 16 - ldr r2, [r6] - ldrb r2, [r2, 0x1A] - bl sub_8075034 - lsls r0, 24 - lsrs r5, r0, 24 - ldrb r0, [r6, 0x8] - ldr r4, =gUnknown_08615AB8 - ldrb r1, [r4, 0x1] - ldr r3, [r6] - ldrb r2, [r3, 0x18] - ldrb r3, [r3, 0x19] - str r5, [sp] - movs r7, 0x1 - str r7, [sp, 0x4] - bl FillWindowPixelRect - ldrb r0, [r6, 0x8] - ldrb r1, [r4] - ldr r3, [r6] - ldrb r2, [r3, 0x18] - ldrb r3, [r3, 0x19] - adds r3, 0x1 - str r5, [sp] - movs r4, 0x2 - str r4, [sp, 0x4] - bl FillWindowPixelRect - ldr r1, [r6] - ldrb r0, [r1, 0x1A] - cmp r5, r0 - beq _081B2F88 - ldrb r0, [r6, 0x8] - ldrb r2, [r1, 0x18] - adds r2, r5 - ldrb r3, [r1, 0x19] - ldrb r1, [r1, 0x1A] - subs r1, r5 - lsls r1, 16 - lsrs r1, 16 - str r1, [sp] - str r7, [sp, 0x4] - movs r1, 0xD - bl FillWindowPixelRect - ldrb r0, [r6, 0x8] - ldr r1, [r6] - ldrb r2, [r1, 0x18] - adds r2, r5 - ldrb r3, [r1, 0x19] - adds r3, 0x1 - ldrb r1, [r1, 0x1A] - subs r1, r5 - lsls r1, 16 - lsrs r1, 16 - str r1, [sp] - str r4, [sp, 0x4] - movs r1, 0x2 - bl FillWindowPixelRect -_081B2F88: - ldrb r0, [r6, 0x8] - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B2E64 - - thumb_func_start sub_81B2FA8 -sub_81B2FA8: @ 81B2FA8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - adds r6, r1, 0 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r2, 24 - lsrs r7, r2, 24 - cmp r7, 0 - beq _081B2FF2 - ldr r5, [r6] - ldrb r1, [r5, 0x1C] - movs r4, 0x7 - adds r0, r1, 0 - ands r0, r4 - ldrb r2, [r5, 0x1E] - adds r0, r2 - adds r3, r0, 0x7 - asrs r3, 3 - ldrb r2, [r5, 0x1D] - adds r0, r2, 0 - ands r0, r4 - ldrb r4, [r5, 0x1F] - adds r0, r4 - adds r4, r0, 0x7 - ldrb r0, [r6, 0x8] - lsrs r1, 3 - lsrs r2, 3 - lsrs r4, 3 - str r4, [sp] - movs r4, 0x1 - str r4, [sp, 0x4] - ldr r4, [r5] - bl _call_via_r4 -_081B2FF2: - cmp r7, 0x2 - beq _081B3018 - ldrb r0, [r6, 0x8] - ldr r1, [r6] - ldrb r2, [r1, 0x1C] - ldrb r3, [r1, 0x1D] - ldr r1, =gUnknown_086157FC - str r1, [sp] - movs r1, 0 - str r1, [sp, 0x4] - ldr r4, =gUnknown_08615B60 - mov r5, r8 - lsls r1, r5, 2 - adds r1, r4 - ldr r1, [r1] - str r1, [sp, 0x8] - movs r1, 0x1 - bl box_print -_081B3018: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B2FA8 - - thumb_func_start sub_81B302C -sub_81B302C: @ 81B302C - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4] - cmp r0, 0xFF - beq _081B304C - movs r1, 0 - bl sub_8198070 - ldrb r0, [r4] - bl RemoveWindow - movs r0, 0xFF - strb r0, [r4] - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram -_081B304C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B302C - - thumb_func_start display_pokemon_menu_message -display_pokemon_menu_message: @ 81B3054 - push {r4-r6,lr} - sub sp, 0xC - adds r6, r0, 0 - ldr r0, =gUnknown_0203CEC4 - ldr r4, [r0] - adds r5, r4, 0 - adds r5, 0xD - ldrb r0, [r4, 0xD] - cmp r0, 0xFF - beq _081B306E - adds r0, r5, 0 - bl sub_81B302C -_081B306E: - cmp r6, 0x7F - beq _081B313C - adds r0, r6, 0 - subs r0, 0x15 - cmp r0, 0x5 - bhi _081B30D4 - lsls r0, 2 - ldr r1, =_081B308C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081B308C: - .4byte _081B30A4 - .4byte _081B30BC - .4byte _081B30BC - .4byte _081B30AC - .4byte _081B30B4 - .4byte _081B30C4 -_081B30A4: - ldr r0, =gUnknown_08615928 - b _081B30C6 - .pool -_081B30AC: - ldr r0, =gUnknown_08615930 - b _081B30C6 - .pool -_081B30B4: - ldr r0, =gUnknown_08615938 - b _081B30C6 - .pool -_081B30BC: - ldr r0, =gUnknown_08615940 - b _081B30C6 - .pool -_081B30C4: - ldr r0, =gUnknown_08615948 -_081B30C6: - bl AddWindow - strb r0, [r5] - b _081B30DC - .pool -_081B30D4: - ldr r0, =gUnknown_08615920 - bl AddWindow - strb r0, [r4, 0xD] -_081B30DC: - cmp r6, 0 - bne _081B3104 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - lsls r0, 31 - cmp r0, 0 - beq _081B30F8 - movs r6, 0x2 - b _081B3104 - .pool -_081B30F8: - bl sub_81B314C - lsls r0, 24 - cmp r0, 0 - bne _081B3104 - movs r6, 0x1 -_081B3104: - ldrb r0, [r5] - movs r1, 0 - movs r2, 0x4F - movs r3, 0xD - bl SetWindowBorderStyle - ldr r4, =gStringVar4 - ldr r1, =gUnknown_08615AF4 - lsls r0, r6, 2 - adds r0, r1 - ldr r1, [r0] - adds r0, r4, 0 - bl StringExpandPlaceholders - ldrb r0, [r5] - movs r1, 0x1 - str r1, [sp] - movs r1, 0 - str r1, [sp, 0x4] - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0 - bl Print - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram -_081B313C: - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end display_pokemon_menu_message - - thumb_func_start sub_81B314C -sub_81B314C: @ 81B314C - push {r4-r7,lr} - ldr r7, =gPlayerParty - movs r6, 0 - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0xB] - cmp r0, 0x1 - bne _081B3168 -_081B315A: - movs r0, 0x1 - b _081B31AA - .pool -_081B3168: - movs r5, 0 -_081B316A: - movs r0, 0x64 - muls r0, r5 - adds r4, r7, r0 - adds r0, r4, 0 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B319A - adds r0, r4, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - bne _081B3194 - adds r0, r4, 0 - movs r1, 0x2D - bl GetMonData - cmp r0, 0 - beq _081B319A -_081B3194: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_081B319A: - cmp r6, 0x1 - bhi _081B315A - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x5 - bls _081B316A - movs r0, 0 -_081B31AA: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81B314C - - thumb_func_start sub_81B31B0 -sub_81B31B0: @ 81B31B0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x1C - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - beq _081B320C - cmp r4, 0x1 - bgt _081B31CC - cmp r4, 0 - beq _081B31D2 - b _081B321C -_081B31CC: - cmp r4, 0x2 - beq _081B3214 - b _081B321C -_081B31D2: - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - ldrb r0, [r1, 0x17] - lsls r0, 1 - movs r3, 0x13 - subs r3, r0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0xA - str r0, [sp] - ldrb r0, [r1, 0x17] - lsls r0, 25 - lsrs r0, 24 - str r0, [sp, 0x4] - movs r0, 0xE - str r0, [sp, 0x8] - ldr r0, =0x000002e9 - str r0, [sp, 0xC] - add r0, sp, 0x14 - movs r1, 0x2 - movs r2, 0x13 - bl rbox_template_set - b _081B3226 - .pool -_081B320C: - ldr r0, =gUnknown_08615950 - b _081B321E - .pool -_081B3214: - ldr r0, =gUnknown_08615958 - b _081B321E - .pool -_081B321C: - ldr r0, =gUnknown_08615960 -_081B321E: - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp, 0x14] - str r1, [sp, 0x18] -_081B3226: - add r0, sp, 0x14 - bl AddWindow - ldr r6, =gUnknown_0203CEC4 - ldr r1, [r6] - strb r0, [r1, 0xC] - ldr r0, [r6] - ldrb r0, [r0, 0xC] - movs r1, 0 - movs r2, 0x4F - movs r3, 0xD - bl SetWindowBorderStyle - cmp r4, 0x3 - bne _081B3250 - ldr r0, [r6] - b _081B32E2 - .pool -_081B3250: - movs r0, 0x1 - movs r1, 0 - bl GetMenuCursorDimensionByFont - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - movs r0, 0x1 - movs r1, 0x2 - bl GetFontAttribute - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r5, 0 - ldr r0, [r6] - ldrb r0, [r0, 0x17] - cmp r5, r0 - bcs _081B32CA - adds r7, r6, 0 - movs r6, 0 -_081B327A: - ldr r1, [r7] - adds r0, r1, 0 - adds r0, 0xF - adds r4, r0, r5 - ldrb r0, [r4] - movs r2, 0x3 - cmp r0, 0x12 - bls _081B328C - movs r2, 0x4 -_081B328C: - ldrb r0, [r1, 0xC] - lsls r3, r5, 4 - adds r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - mov r1, r8 - str r1, [sp] - str r6, [sp, 0x4] - lsls r1, r2, 1 - adds r1, r2 - ldr r2, =gUnknown_086157FC - adds r1, r2 - str r1, [sp, 0x8] - str r6, [sp, 0xC] - ldr r2, =gUnknown_08615C08 - ldrb r1, [r4] - lsls r1, 3 - adds r1, r2 - ldr r1, [r1] - str r1, [sp, 0x10] - movs r1, 0x1 - mov r2, r9 - bl AddTextPrinterParametrized2 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, [r7] - ldrb r0, [r0, 0x17] - cmp r5, r0 - bcc _081B327A -_081B32CA: - ldr r4, =gUnknown_0203CEC4 - ldr r1, [r4] - ldrb r0, [r1, 0xC] - ldrb r1, [r1, 0x17] - movs r2, 0 - movs r3, 0x1 - bl InitMenuInUpperLeftCorner - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r0, [r4] -_081B32E2: - ldrb r0, [r0, 0xC] - add sp, 0x1C - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B31B0 - - thumb_func_start sub_81B3300 -sub_81B3300: @ 81B3300 - push {r4,lr} - sub sp, 0x10 - adds r4, r0, 0 - movs r0, 0x6 - movs r1, 0 - movs r2, 0x4F - movs r3, 0xD - bl SetWindowBorderStyle - ldr r2, =gTextFlags - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - bl sav2_get_text_speed - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x1 - str r0, [sp, 0x8] - movs r0, 0x3 - str r0, [sp, 0xC] - movs r0, 0x6 - movs r1, 0x1 - adds r2, r4, 0 - bl AddTextPrinterParametrized - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B3300 - - thumb_func_start sub_81B334C -sub_81B334C: @ 81B334C - push {lr} - ldr r0, =gUnknown_08615968 - movs r1, 0x4F - movs r2, 0xD - movs r3, 0 - bl CreateYesNoMenu - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B334C - - thumb_func_start sub_81B3364 -sub_81B3364: @ 81B3364 - push {r4,lr} - ldr r0, =gUnknown_08615970 - bl AddWindow - ldr r4, =gUnknown_0203CEC4 - ldr r1, [r4] - strb r0, [r1, 0xC] - ldr r0, [r4] - ldrb r0, [r0, 0xC] - movs r1, 0 - movs r2, 0x4F - movs r3, 0xD - bl SetWindowBorderStyle - ldr r0, [r4] - ldrb r0, [r0, 0xC] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B3364 - - thumb_func_start sub_81B3394 -sub_81B3394: @ 81B3394 - push {r4,lr} - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - ldrb r0, [r0, 0xC] - bl ClearWindowTilemap - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B3394 - - thumb_func_start sub_81B33B4 -sub_81B33B4: @ 81B33B4 - push {r4,lr} - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - cmp r2, 0 - bne _081B33C8 - bl sub_81B3414 - b _081B3400 -_081B33C8: - ldr r4, =gUnknown_0203CEC4 - ldr r1, [r4] - ldr r0, =gUnknown_08615D70 - adds r0, r2, r0 - ldrb r0, [r0] - strb r0, [r1, 0x17] - movs r3, 0 - ldr r0, [r4] - ldrb r0, [r0, 0x17] - cmp r3, r0 - bcs _081B3400 - ldr r1, =gUnknown_08615D38 - lsls r0, r2, 2 - adds r2, r0, r1 -_081B33E4: - ldr r1, [r4] - adds r1, 0xF - adds r1, r3 - ldr r0, [r2] - adds r0, r3 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - ldr r0, [r4] - ldrb r0, [r0, 0x17] - cmp r3, r0 - bcc _081B33E4 -_081B3400: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B33B4 - - thumb_func_start sub_81B3414 -sub_81B3414: @ 81B3414 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r9, r0 - lsls r1, 24 - lsrs r1, 24 - mov r10, r1 - ldr r2, =gUnknown_0203CEC4 - ldr r1, [r2] - movs r0, 0 - strb r0, [r1, 0x17] - ldr r1, [r2] - adds r0, r1, 0 - adds r0, 0xF - adds r1, 0x17 - movs r2, 0 - bl append_byte - movs r7, 0 - ldr r0, =gUnknown_08615D7E - ldrh r0, [r0] - str r0, [sp] -_081B3446: - movs r4, 0 - adds r0, r7, 0x1 - mov r8, r0 - ldr r1, [sp] - cmp r1, 0xE - beq _081B34A0 - movs r0, 0x64 - mov r6, r10 - muls r6, r0 - ldr r5, =gUnknown_08615D7E -_081B345A: - mov r1, r9 - adds r0, r1, r6 - adds r1, r7, 0 - adds r1, 0xD - bl GetMonData - lsls r1, r4, 1 - adds r1, r5 - ldrh r1, [r1] - cmp r0, r1 - bne _081B3490 - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0xF - adds r1, 0x17 - adds r2, r4, 0 - adds r2, 0x13 - lsls r2, 24 - lsrs r2, 24 - bl append_byte - b _081B34A0 - .pool -_081B3490: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 1 - adds r0, r5 - ldrh r0, [r0] - cmp r0, 0xE - bne _081B345A -_081B34A0: - mov r1, r8 - lsls r0, r1, 24 - lsrs r7, r0, 24 - cmp r7, 0x3 - bls _081B3446 - bl InBattlePike - lsls r0, 24 - cmp r0, 0 - bne _081B3518 - mov r0, r9 - adds r0, 0x64 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B34D2 - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0xF - adds r1, 0x17 - movs r2, 0x1 - bl append_byte -_081B34D2: - movs r0, 0x64 - mov r1, r10 - muls r1, r0 - adds r0, r1, 0 - add r0, r9 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - bl itemid_is_mail - lsls r0, 24 - cmp r0, 0 - beq _081B3508 - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0xF - adds r1, 0x17 - movs r2, 0x6 - bl append_byte - b _081B3518 - .pool -_081B3508: - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0xF - adds r1, 0x17 - movs r2, 0x3 - bl append_byte -_081B3518: - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0xF - adds r1, 0x17 - movs r2, 0x2 - bl append_byte - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B3414 - - thumb_func_start sub_81B353C -sub_81B353C: @ 81B353C - push {r4,lr} - adds r4, r0, 0 - ldr r1, =gUnknown_0203CEC8 - ldrb r0, [r1, 0x8] - lsls r0, 28 - lsrs r0, 28 - adds r2, r1, 0 - cmp r0, 0xC - bhi _081B35FE - lsls r0, 2 - ldr r1, =_081B3560 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081B3560: - .4byte _081B3594 - .4byte _081B35B0 - .4byte _081B35FE - .4byte _081B35FE - .4byte _081B35BC - .4byte _081B35FE - .4byte _081B35DC - .4byte _081B35FE - .4byte _081B35EE - .4byte _081B35F2 - .4byte _081B35F6 - .4byte _081B35FE - .4byte _081B35FA -_081B3594: - bl in_multi_battle_room_with_var_condition - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B35AC - adds r0, r4, 0 - movs r1, 0x2D - bl GetMonData - cmp r0, 0 - beq _081B35FE -_081B35AC: - movs r1, 0x1 - b _081B3600 -_081B35B0: - adds r0, r4, 0 - bl sub_81B8A2C - lsls r0, 24 - lsrs r1, r0, 24 - b _081B3600 -_081B35BC: - movs r0, 0x9 - ldrsb r0, [r2, r0] - bl sub_81B856C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _081B35D4 - cmp r0, 0x1 - beq _081B35D8 - movs r1, 0x7 - b _081B3600 -_081B35D4: - movs r1, 0x4 - b _081B3600 -_081B35D8: - movs r1, 0x5 - b _081B3600 -_081B35DC: - adds r0, r4, 0 - movs r1, 0x2D - bl GetMonData - movs r1, 0x6 - cmp r0, 0 - beq _081B3600 - movs r1, 0x7 - b _081B3600 -_081B35EE: - movs r1, 0xA - b _081B3600 -_081B35F2: - movs r1, 0xB - b _081B3600 -_081B35F6: - movs r1, 0xC - b _081B3600 -_081B35FA: - movs r1, 0xD - b _081B3600 -_081B35FE: - movs r1, 0 -_081B3600: - adds r0, r1, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81B353C - - thumb_func_start sub_81B3608 -sub_81B3608: @ 81B3608 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r4, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r4, r1] - movs r0, 0x64 - muls r0, r1 - ldr r7, =gPlayerParty - adds r5, r0, r7 - ldr r1, =gStringVar1 - adds r0, r5, 0 - bl GetMonNickname - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - adds r0, 0xD - bl sub_81B302C - ldrb r1, [r4, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0xC - beq _081B3674 - ldrb r4, [r4, 0x9] - adds r0, r5, 0 - bl sub_81B353C - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r7, 0 - adds r1, r4, 0 - bl sub_81B33B4 - movs r0, 0 - bl sub_81B31B0 - movs r0, 0x15 - bl display_pokemon_menu_message - b _081B36EA - .pool -_081B3674: - adds r0, r5, 0 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0 - bne _081B36C0 - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9980 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =gTasks - mov r2, r8 - lsls r0, r2, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B469C - str r1, [r0] - movs r0, 0 - b _081B36EC - .pool -_081B36C0: - ldrb r4, [r4, 0x9] - adds r0, r5, 0 - bl sub_81B353C - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r7, 0 - adds r1, r4, 0 - bl sub_81B33B4 - movs r0, 0x1 - bl sub_81B31B0 - ldr r1, =gStringVar2 - adds r0, r6, 0 - bl CopyItemName - movs r0, 0x1A - bl display_pokemon_menu_message -_081B36EA: - movs r0, 0x1 -_081B36EC: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B3608 - - thumb_func_start sub_81B36FC -sub_81B36FC: @ 81B36FC - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_81B3608 - lsls r0, 24 - cmp r0, 0 - beq _081B3720 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0xFF - strh r1, [r0, 0x8] - ldr r1, =sub_81B3730 - str r1, [r0] -_081B3720: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B36FC - - thumb_func_start sub_81B3730 -sub_81B3730: @ 81B3730 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B37EE - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B37EE - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r5, r0, r1 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - ldrb r0, [r0, 0x17] - cmp r0, 0x3 - bhi _081B3774 - bl ProcessMenuInputNoWrapAround_other - b _081B3778 - .pool -_081B3774: - bl ProcessMenuInput_other -_081B3778: - lsls r0, 24 - lsrs r4, r0, 24 - bl GetMenuCursorPos - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5] - lsls r0, r4, 24 - asrs r5, r0, 24 - movs r0, 0x2 - negs r0, r0 - cmp r5, r0 - beq _081B37EE - adds r0, 0x1 - cmp r5, r0 - bne _081B37CC - movs r0, 0x5 - bl PlaySE - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xE - bl sub_81B302C - ldr r2, =gUnknown_08615C08 - ldr r0, [r4] - ldrb r1, [r0, 0x17] - adds r0, r1 - ldrb r0, [r0, 0xE] - lsls r0, 3 - adds r2, 0x4 - adds r0, r2 - ldr r1, [r0] - adds r0, r6, 0 - bl _call_via_r1 - b _081B37EE - .pool -_081B37CC: - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xE - bl sub_81B302C - ldr r1, =gUnknown_08615C08 - ldr r0, [r4] - adds r0, 0xF - adds r0, r5 - ldrb r0, [r0] - lsls r0, 3 - adds r1, 0x4 - adds r0, r1 - ldr r1, [r0] - adds r0, r6, 0 - bl _call_via_r1 -_081B37EE: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B3730 - - thumb_func_start sub_81B37FC -sub_81B37FC: @ 81B37FC - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - ldr r0, =sub_81B3828 - str r0, [r1, 0x4] - adds r0, r4, 0 - bl sub_81B12C0 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B37FC - - thumb_func_start sub_81B3828 -sub_81B3828: @ 81B3828 - push {r4,lr} - sub sp, 0x4 - ldr r4, =gUnknown_0203CEC8 - ldrb r1, [r4, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x1 - bne _081B3868 - bl pokemon_change_order - ldr r1, =gPlayerParty - ldrb r2, [r4, 0x9] - ldr r0, =gUnknown_020244E9 - ldrb r3, [r0] - subs r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =sub_81B3894 - str r0, [sp] - movs r0, 0x1 - bl sub_81BF8EC - b _081B3880 - .pool -_081B3868: - ldr r1, =gPlayerParty - ldrb r2, [r4, 0x9] - ldr r0, =gUnknown_020244E9 - ldrb r3, [r0] - subs r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =sub_81B3894 - str r0, [sp] - movs r0, 0 - bl sub_81BF8EC -_081B3880: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B3828 - - thumb_func_start sub_81B3894 -sub_81B3894: @ 81B3894 - push {lr} - sub sp, 0xC - ldr r2, =gPaletteFade - ldrb r0, [r2, 0x8] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2, 0x8] - ldr r3, =gUnknown_0203CEC8 - ldr r0, =gUnknown_0203CF20 - ldrb r0, [r0] - strb r0, [r3, 0x9] - ldrb r0, [r3, 0x8] - lsls r0, 28 - lsrs r0, 28 - ldrb r2, [r3, 0xB] - movs r1, 0x15 - str r1, [sp] - ldr r1, =sub_81B36FC - str r1, [sp, 0x4] - ldr r1, [r3] - str r1, [sp, 0x8] - movs r1, 0xFF - movs r3, 0x1 - bl sub_81B0038 - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B3894 - - thumb_func_start brm_switch -brm_switch: @ 81B38DC - push {r4-r6,lr} - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - movs r0, 0x5 - bl PlaySE - ldr r5, =gUnknown_0203CEC8 - movs r0, 0x8 - strb r0, [r5, 0xB] - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - movs r0, 0x3 - bl display_pokemon_menu_message - ldrb r0, [r5, 0x9] - movs r1, 0x1 - bl sub_81B0FCC - ldrb r0, [r5, 0x9] - strb r0, [r5, 0xA] - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1370 - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end brm_switch - - thumb_func_start sub_81B3938 -sub_81B3938: @ 81B3938 - push {r4-r7,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r7, r0, 24 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r6, r0, r1 - ldr r3, =gUnknown_0203CEC8 - movs r1, 0xA - ldrsb r1, [r3, r1] - movs r0, 0x9 - ldrsb r0, [r3, r0] - cmp r1, r0 - bne _081B3968 - adds r0, r7, 0 - bl sub_81B407C - b _081B3ABA - .pool -_081B3968: - add r2, sp, 0x8 - movs r0, 0x9 - ldrsb r0, [r3, r0] - ldr r1, =gUnknown_0203CEDC - ldr r1, [r1] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x8] - movs r4, 0 - strb r0, [r2] - adds r0, r2, 0 - ldrb r0, [r0] - movs r1, 0x1 - bl GetWindowAttribute - strh r0, [r6] - add r0, sp, 0x8 - ldrb r0, [r0] - movs r1, 0x2 - bl GetWindowAttribute - strh r0, [r6, 0x2] - add r0, sp, 0x8 - ldrb r0, [r0] - movs r1, 0x3 - bl GetWindowAttribute - strh r0, [r6, 0x4] - add r0, sp, 0x8 - ldrb r0, [r0] - movs r1, 0x4 - bl GetWindowAttribute - strh r0, [r6, 0x6] - strh r4, [r6, 0x10] - movs r1, 0x4 - ldrsh r0, [r6, r1] - cmp r0, 0xA - bne _081B39C4 - movs r2, 0x1 - negs r2, r2 - adds r0, r2, 0 - b _081B39C6 - .pool -_081B39C4: - movs r0, 0x1 -_081B39C6: - strh r0, [r6, 0x14] - add r2, sp, 0x8 - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0xA] - lsls r0, 24 - asrs r0, 24 - ldr r1, =gUnknown_0203CEDC - ldr r1, [r1] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x8] - movs r4, 0 - strb r0, [r2, 0x1] - adds r0, r2, 0 - ldrb r0, [r0, 0x1] - movs r1, 0x1 - bl GetWindowAttribute - strh r0, [r6, 0x8] - add r0, sp, 0x8 - ldrb r0, [r0, 0x1] - movs r1, 0x2 - bl GetWindowAttribute - strh r0, [r6, 0xA] - add r0, sp, 0x8 - ldrb r0, [r0, 0x1] - movs r1, 0x3 - bl GetWindowAttribute - strh r0, [r6, 0xC] - add r0, sp, 0x8 - ldrb r0, [r0, 0x1] - movs r1, 0x4 - bl GetWindowAttribute - strh r0, [r6, 0xE] - strh r4, [r6, 0x12] - movs r1, 0xC - ldrsh r0, [r6, r1] - cmp r0, 0xA - bne _081B3A2C - movs r2, 0x1 - negs r2, r2 - adds r0, r2, 0 - b _081B3A2E - .pool -_081B3A2C: - movs r0, 0x1 -_081B3A2E: - strh r0, [r6, 0x16] - ldr r4, =gUnknown_0203CEF0 - movs r0, 0x4 - ldrsh r1, [r6, r0] - movs r2, 0x6 - ldrsh r0, [r6, r2] - lsls r0, 1 - muls r0, r1 - bl Alloc - str r0, [r4] - ldr r5, =gUnknown_0203CEF4 - movs r0, 0xC - ldrsh r1, [r6, r0] - movs r2, 0xE - ldrsh r0, [r6, r2] - lsls r0, 1 - muls r0, r1 - bl Alloc - str r0, [r5] - ldr r1, [r4] - ldrb r2, [r6] - ldrb r3, [r6, 0x2] - ldrb r0, [r6, 0x4] - str r0, [sp] - ldrb r0, [r6, 0x6] - str r0, [sp, 0x4] - movs r0, 0 - bl sub_8199CBC - ldr r1, [r5] - ldrb r2, [r6, 0x8] - ldrb r3, [r6, 0xA] - ldrb r0, [r6, 0xC] - str r0, [sp] - ldrb r0, [r6, 0xE] - str r0, [sp, 0x4] - movs r0, 0 - bl sub_8199CBC - add r0, sp, 0x8 - ldrb r0, [r0] - bl ClearWindowTilemap - add r0, sp, 0x8 - ldrb r0, [r0, 0x1] - bl ClearWindowTilemap - ldr r4, =gUnknown_0203CEC8 - movs r0, 0x9 - strb r0, [r4, 0xB] - ldrb r0, [r4, 0x9] - movs r1, 0x1 - bl sub_81B0FCC - ldrb r0, [r4, 0xA] - movs r1, 0x1 - bl sub_81B0FCC - adds r0, r7, 0 - bl sub_81B3CC0 - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B3D48 - str r1, [r0] -_081B3ABA: - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B3938 - - thumb_func_start sub_81B3AD8 -sub_81B3AD8: @ 81B3AD8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r2, 0 - mov r12, r3 - ldr r7, [sp, 0x18] - lsls r0, 16 - lsrs r3, r0, 16 - adds r5, r3, 0 - lsls r1, 16 - lsrs r2, r1, 16 - mov r8, r2 - lsls r0, r3, 16 - asrs r1, r0, 16 - lsls r0, r2, 16 - asrs r0, 16 - adds r4, r1, r0 - cmp r4, 0 - blt _081B3B02 - cmp r1, 0x1F - ble _081B3B06 -_081B3B02: - movs r0, 0 - b _081B3B34 -_081B3B06: - cmp r1, 0 - bge _081B3B1A - negs r0, r1 - strb r0, [r6] - movs r0, 0 - mov r1, r12 - strb r0, [r1] - adds r0, r2, r3 - strb r0, [r7] - b _081B3B32 -_081B3B1A: - movs r0, 0 - strb r0, [r6] - mov r0, r12 - strb r5, [r0] - cmp r4, 0x1F - ble _081B3B2E - movs r0, 0x20 - subs r0, r5 - strb r0, [r7] - b _081B3B32 -_081B3B2E: - mov r1, r8 - strb r1, [r7] -_081B3B32: - movs r0, 0x1 -_081B3B34: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81B3AD8 - - thumb_func_start sub_81B3B40 -sub_81B3B40: @ 81B3B40 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x34 - str r0, [sp, 0x28] - ldr r0, [sp, 0x54] - ldr r4, [sp, 0x58] - lsls r2, 16 - lsrs r2, 16 - mov r9, r2 - lsls r3, 16 - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - lsls r4, 16 - lsrs r4, 16 - str r4, [sp, 0x30] - lsls r1, 16 - asrs r7, r1, 16 - lsrs r0, r3, 16 - str r0, [sp, 0x2C] - asrs r3, 16 - mov r8, r3 - mov r5, sp - adds r5, 0x25 - mov r6, sp - adds r6, 0x26 - str r6, [sp] - adds r0, r7, 0 - mov r1, r8 - add r2, sp, 0x24 - adds r3, r5, 0 - bl sub_81B3AD8 - lsls r0, 24 - cmp r0, 0 - beq _081B3BFA - ldrb r2, [r5] - mov r1, r9 - lsls r0, r1, 24 - lsrs r0, 24 - mov r9, r0 - ldrb r0, [r6] - str r0, [sp] - mov r1, r10 - lsls r0, r1, 24 - lsrs r4, r0, 24 - str r4, [sp, 0x4] - movs r0, 0 - movs r1, 0 - mov r3, r9 - bl FillBgTilemapBufferRect_Palette0 - ldr r1, [sp, 0x30] - lsls r0, r1, 16 - asrs r0, 16 - adds r0, r7, r0 - lsls r0, 16 - asrs r0, 16 - str r6, [sp] - mov r1, r8 - add r2, sp, 0x24 - adds r3, r5, 0 - bl sub_81B3AD8 - lsls r0, 24 - cmp r0, 0 - beq _081B3BFA - add r0, sp, 0x24 - ldrb r2, [r0] - ldr r1, [sp, 0x2C] - lsls r0, r1, 24 - lsrs r0, 24 - str r0, [sp] - str r4, [sp, 0x4] - ldrb r0, [r5] - str r0, [sp, 0x8] - mov r0, r9 - str r0, [sp, 0xC] - ldrb r0, [r6] - str r0, [sp, 0x10] - str r4, [sp, 0x14] - movs r0, 0x11 - str r0, [sp, 0x18] - movs r0, 0 - str r0, [sp, 0x1C] - str r0, [sp, 0x20] - ldr r1, [sp, 0x28] - movs r3, 0 - bl CopyRectToBgTilemapBufferRect -_081B3BFA: - add sp, 0x34 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81B3B40 - - thumb_func_start sub_81B3C0C -sub_81B3C0C: @ 81B3C0C - push {r4,lr} - ldr r4, =gSprites - ldrb r2, [r0, 0xB] - lsls r3, r2, 4 - adds r3, r2 - lsls r3, 2 - adds r3, r4 - lsls r1, 16 - asrs r1, 13 - ldrh r2, [r3, 0x24] - adds r2, r1 - strh r2, [r3, 0x24] - ldrb r3, [r0, 0xA] - lsls r2, r3, 4 - adds r2, r3 - lsls r2, 2 - adds r2, r4 - ldrh r3, [r2, 0x24] - adds r3, r1 - strh r3, [r2, 0x24] - ldrb r3, [r0, 0x9] - lsls r2, r3, 4 - adds r2, r3 - lsls r2, 2 - adds r2, r4 - ldrh r3, [r2, 0x24] - adds r3, r1 - strh r3, [r2, 0x24] - ldrb r2, [r0, 0xC] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r4 - ldrh r2, [r0, 0x24] - adds r2, r1 - strh r2, [r0, 0x24] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B3C0C - - thumb_func_start sub_81B3C60 -sub_81B3C60: @ 81B3C60 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r4, r1, r0 - movs r1, 0x14 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _081B3C8E - ldr r2, =gUnknown_0203CEDC - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - lsls r1, 4 - ldr r0, [r2] - adds r0, r1 - movs r2, 0x14 - ldrsh r1, [r4, r2] - bl sub_81B3C0C -_081B3C8E: - movs r1, 0x16 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _081B3CAC - ldr r2, =gUnknown_0203CEDC - ldr r0, =gUnknown_0203CEC8 - movs r1, 0xA - ldrsb r1, [r0, r1] - lsls r1, 4 - ldr r0, [r2] - adds r0, r1 - movs r2, 0x16 - ldrsh r1, [r4, r2] - bl sub_81B3C0C -_081B3CAC: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B3C60 - - thumb_func_start sub_81B3CC0 -sub_81B3CC0: @ 81B3CC0 - push {r4-r6,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r5, r1, r0 - movs r1, 0x14 - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _081B3D00 - ldr r0, =gUnknown_0203CEF0 - ldr r0, [r0] - ldrh r1, [r5, 0x10] - ldrh r2, [r5] - adds r1, r2 - lsls r1, 16 - asrs r1, 16 - movs r3, 0x2 - ldrsh r2, [r5, r3] - movs r4, 0x4 - ldrsh r3, [r5, r4] - movs r6, 0x6 - ldrsh r4, [r5, r6] - str r4, [sp] - movs r6, 0x14 - ldrsh r4, [r5, r6] - str r4, [sp, 0x4] - bl sub_81B3B40 -_081B3D00: - movs r1, 0x16 - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _081B3D2E - ldr r0, =gUnknown_0203CEF4 - ldr r0, [r0] - ldrh r1, [r5, 0x12] - ldrh r2, [r5, 0x8] - adds r1, r2 - lsls r1, 16 - asrs r1, 16 - movs r3, 0xA - ldrsh r2, [r5, r3] - movs r4, 0xC - ldrsh r3, [r5, r4] - movs r6, 0xE - ldrsh r4, [r5, r6] - str r4, [sp] - movs r6, 0x16 - ldrsh r4, [r5, r6] - str r4, [sp, 0x4] - bl sub_81B3B40 -_081B3D2E: - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B3CC0 - - thumb_func_start sub_81B3D48 -sub_81B3D48: @ 81B3D48 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r7, r0, 3 - ldr r0, =gTasks + 0x8 - mov r8, r0 - adds r6, r7, r0 - adds r0, r4, 0 - bl sub_81B3CC0 - adds r0, r4, 0 - bl sub_81B3C60 - ldrh r1, [r6, 0x14] - ldrh r2, [r6, 0x10] - adds r1, r2 - strh r1, [r6, 0x10] - ldrh r0, [r6, 0x16] - ldrh r3, [r6, 0x12] - adds r0, r3 - strh r0, [r6, 0x12] - add r2, sp, 0x8 - ldrh r0, [r6] - adds r0, r1 - strh r0, [r2] - adds r1, r2, 0 - ldrh r0, [r6, 0x12] - ldrh r3, [r6, 0x8] - adds r2, r0, r3 - strh r2, [r1, 0x2] - adds r0, r1, 0 - ldrh r0, [r0] - cmp r0, 0x21 - bls _081B3E3A - lsls r0, r2, 16 - lsrs r0, 16 - cmp r0, 0x21 - bls _081B3E3A - movs r1, 0x14 - ldrsh r0, [r6, r1] - negs r0, r0 - strh r0, [r6, 0x14] - movs r2, 0x16 - ldrsh r0, [r6, r2] - negs r0, r0 - strh r0, [r6, 0x16] - bl swap_pokemon_and_oams - ldr r4, =gUnknown_0203CEC8 - ldrb r0, [r4, 0x9] - bl sub_81B0948 - ldrb r0, [r4, 0xA] - bl sub_81B0948 - movs r0, 0x9 - ldrsb r0, [r4, r0] - ldr r5, =gUnknown_0203CEDC - ldr r1, [r5] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x8] - bl PutWindowTilemap - movs r0, 0xA - ldrsb r0, [r4, r0] - ldr r1, [r5] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x8] - bl PutWindowTilemap - ldr r0, =gUnknown_0203CEF0 - ldr r1, [r0] - ldrb r2, [r6] - ldrb r3, [r6, 0x2] - ldrb r0, [r6, 0x4] - str r0, [sp] - ldrb r0, [r6, 0x6] - str r0, [sp, 0x4] - movs r0, 0 - bl sub_8199CBC - ldr r0, =gUnknown_0203CEF4 - ldr r1, [r0] - ldrb r2, [r6, 0x8] - ldrb r3, [r6, 0xA] - ldrb r0, [r6, 0xC] - str r0, [sp] - ldrb r0, [r6, 0xE] - str r0, [sp, 0x4] - movs r0, 0 - bl sub_8199CBC - movs r0, 0x9 - ldrsb r0, [r4, r0] - ldr r1, [r5] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x8] - bl ClearWindowTilemap - movs r0, 0xA - ldrsb r0, [r4, r0] - ldr r1, [r5] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x8] - bl ClearWindowTilemap - mov r0, r8 - subs r0, 0x8 - adds r0, r7, r0 - ldr r1, =sub_81B3E60 - str r1, [r0] -_081B3E3A: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B3D48 - - thumb_func_start sub_81B3E60 -sub_81B3E60: @ 81B3E60 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - adds r0, r6, 0 - bl sub_81B3CC0 - adds r0, r6, 0 - bl sub_81B3C60 - movs r1, 0x14 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081B3EE4 - movs r2, 0x16 - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _081B3EE4 - ldr r5, =gUnknown_0203CEC8 - movs r0, 0x9 - ldrsb r0, [r5, r0] - ldr r4, =gUnknown_0203CEDC - ldr r1, [r4] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x8] - bl PutWindowTilemap - movs r0, 0xA - ldrsb r0, [r5, r0] - ldr r1, [r4] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x8] - bl PutWindowTilemap - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldr r0, =gUnknown_0203CEF0 - ldr r0, [r0] - bl Free - ldr r0, =gUnknown_0203CEF4 - ldr r0, [r0] - bl Free - adds r0, r6, 0 - bl sub_81B407C - b _081B3F08 - .pool -_081B3EE4: - ldrh r1, [r4, 0x14] - ldrh r0, [r4, 0x10] - adds r1, r0 - strh r1, [r4, 0x10] - ldrh r0, [r4, 0x16] - ldrh r2, [r4, 0x12] - adds r0, r2 - strh r0, [r4, 0x12] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0 - bne _081B3EFE - strh r1, [r4, 0x14] -_081B3EFE: - movs r1, 0x12 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081B3F08 - strh r0, [r4, 0x16] -_081B3F08: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81B3E60 - - thumb_func_start oamt_swap_pos -oamt_swap_pos: @ 81B3F10 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - ldrb r3, [r0] - ldrb r2, [r1] - strb r2, [r0] - strb r3, [r1] - ldr r5, =gSprites - ldrb r2, [r0] - lsls r3, r2, 4 - adds r3, r2 - lsls r3, 2 - adds r3, r5 - ldrh r6, [r3, 0x20] - ldrh r2, [r3, 0x22] - mov r8, r2 - ldrh r2, [r3, 0x24] - mov r9, r2 - ldrh r2, [r3, 0x26] - mov r10, r2 - ldrb r4, [r1] - lsls r2, r4, 4 - adds r2, r4 - lsls r2, 2 - adds r2, r5 - ldrh r2, [r2, 0x20] - strh r2, [r3, 0x20] - ldrb r2, [r0] - lsls r3, r2, 4 - adds r3, r2 - lsls r3, 2 - adds r3, r5 - ldrb r4, [r1] - lsls r2, r4, 4 - adds r2, r4 - lsls r2, 2 - adds r2, r5 - ldrh r2, [r2, 0x22] - strh r2, [r3, 0x22] - ldrb r2, [r0] - lsls r3, r2, 4 - adds r3, r2 - lsls r3, 2 - adds r3, r5 - ldrb r4, [r1] - lsls r2, r4, 4 - adds r2, r4 - lsls r2, 2 - adds r2, r5 - ldrh r2, [r2, 0x24] - strh r2, [r3, 0x24] - ldrb r0, [r0] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r5 - ldrb r3, [r1] - lsls r0, r3, 4 - adds r0, r3 - lsls r0, 2 - adds r0, r5 - ldrh r0, [r0, 0x26] - strh r0, [r2, 0x26] - ldrb r2, [r1] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r5 - strh r6, [r0, 0x20] - ldrb r2, [r1] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r5 - mov r2, r8 - strh r2, [r0, 0x22] - ldrb r2, [r1] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r5 - mov r2, r9 - strh r2, [r0, 0x24] - ldrb r1, [r1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - mov r1, r10 - strh r1, [r0, 0x26] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end oamt_swap_pos - - thumb_func_start swap_pokemon_and_oams -swap_pokemon_and_oams: @ 81B3FDC - push {r4-r6,lr} - sub sp, 0x8 - ldr r1, =gUnknown_0203CEDC - ldr r2, =gUnknown_0203CEC8 - movs r3, 0x9 - ldrsb r3, [r2, r3] - lsls r0, r3, 4 - ldr r1, [r1] - adds r0, r1, r0 - str r0, [sp] - ldrb r2, [r2, 0xA] - lsls r2, 24 - asrs r2, 24 - lsls r0, r2, 4 - adds r0, r1, r0 - str r0, [sp, 0x4] - movs r1, 0x64 - adds r4, r3, 0 - muls r4, r1 - ldr r0, =gPlayerParty - adds r4, r0 - adds r5, r2, 0 - muls r5, r1 - adds r5, r0 - movs r0, 0x64 - bl Alloc - adds r6, r0, 0 - adds r1, r4, 0 - movs r2, 0x64 - bl memcpy - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x64 - bl memcpy - adds r0, r5, 0 - adds r1, r6, 0 - movs r2, 0x64 - bl memcpy - adds r0, r6, 0 - bl Free - ldr r0, [sp] - adds r0, 0xB - ldr r1, [sp, 0x4] - adds r1, 0xB - bl oamt_swap_pos - ldr r0, [sp] - adds r0, 0xA - ldr r1, [sp, 0x4] - adds r1, 0xA - bl oamt_swap_pos - ldr r0, [sp] - adds r0, 0x9 - ldr r1, [sp, 0x4] - adds r1, 0x9 - bl oamt_swap_pos - ldr r0, [sp] - adds r0, 0xC - ldr r1, [sp, 0x4] - adds r1, 0xC - bl oamt_swap_pos - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end swap_pokemon_and_oams - - thumb_func_start sub_81B407C -sub_81B407C: @ 81B407C - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - adds r0, 0xD - bl sub_81B302C - ldr r4, =gUnknown_0203CEC8 - movs r0, 0 - strb r0, [r4, 0xB] - ldrb r0, [r4, 0x9] - movs r1, 0 - bl sub_81B0FCC - ldrb r0, [r4, 0xA] - strb r0, [r4, 0x9] - ldrb r0, [r4, 0xA] - movs r1, 0x1 - bl sub_81B0FCC - movs r0, 0 - bl display_pokemon_menu_message - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1370 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B407C - - thumb_func_start brm_cancel_1 -brm_cancel_1: @ 81B40D4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0x5 - bl PlaySE - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - ldr r0, =gUnknown_0203CEC8 - ldrb r1, [r0, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x6 - bne _081B4110 - movs r0, 0xF - bl display_pokemon_menu_message - b _081B4116 - .pool -_081B4110: - movs r0, 0 - bl display_pokemon_menu_message -_081B4116: - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B1370 - str r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end brm_cancel_1 - - thumb_func_start sub_81B4134 -sub_81B4134: @ 81B4134 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - movs r0, 0x5 - bl PlaySE - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - ldr r0, =gPlayerParty - ldr r1, =gUnknown_0203CEC8 - ldrb r1, [r1, 0x9] - movs r2, 0x8 - bl sub_81B33B4 - movs r0, 0x1 - bl sub_81B31B0 - movs r0, 0x18 - bl display_pokemon_menu_message - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0xFF - strh r1, [r0, 0x8] - ldr r1, =sub_81B3730 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4134 - - thumb_func_start sub_81B4198 -sub_81B4198: @ 81B4198 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - ldr r0, =sub_81B41C4 - str r0, [r1, 0x4] - adds r0, r4, 0 - bl sub_81B12C0 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4198 - - thumb_func_start sub_81B41C4 -sub_81B41C4: @ 81B41C4 - push {lr} - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - bne _081B41E0 - ldr r2, =c2_8123744 - movs r0, 0x2 - movs r1, 0x5 - bl GoToBagMenu - b _081B41E8 - .pool -_081B41E0: - ldr r1, =c2_8123744 - movs r0, 0x2 - bl sub_81C4F98 -_081B41E8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B41C4 - - thumb_func_start c2_8123744 -c2_8123744: @ 81B41F0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - ldr r6, =gUnknown_0203CE7C - ldrh r0, [r6] - cmp r0, 0 - bne _081B4224 - ldr r3, =gUnknown_0203CEC8 - ldrb r0, [r3, 0x8] - lsls r0, 28 - lsrs r0, 28 - ldrb r2, [r3, 0xB] - movs r1, 0x7F - str r1, [sp] - ldr r1, =sub_81B36FC - str r1, [sp, 0x4] - ldr r1, [r3] - b _081B425A - .pool -_081B4224: - ldr r4, =gUnknown_0203CEFC - ldr r5, =gUnknown_0203CEC8 - movs r0, 0x9 - ldrsb r0, [r5, r0] - movs r1, 0x64 - mov r8, r1 - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - ldr r7, =gPlayerParty - adds r0, r7 - movs r1, 0xC - bl GetMonData - strh r0, [r4] - lsls r0, 16 - cmp r0, 0 - beq _081B4278 - ldrb r0, [r5, 0x8] - lsls r0, 28 - lsrs r0, 28 - ldrb r2, [r5, 0xB] - movs r1, 0x7F - str r1, [sp] - ldr r1, =sub_81B4350 - str r1, [sp, 0x4] - ldr r1, [r5] -_081B425A: - str r1, [sp, 0x8] - movs r1, 0xFF - movs r3, 0x1 - bl sub_81B0038 - b _081B42C0 - .pool -_081B4278: - ldrh r0, [r6] - bl itemid_is_mail - lsls r0, 24 - cmp r0, 0 - beq _081B42A4 - ldrh r0, [r6] - movs r1, 0x1 - bl RemoveBagItem - movs r0, 0x9 - ldrsb r0, [r5, r0] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r7 - ldrh r1, [r6] - bl sub_81B1DB8 - bl sub_81B452C - b _081B42C0 -_081B42A4: - ldrb r0, [r5, 0x8] - lsls r0, 28 - lsrs r0, 28 - ldrb r2, [r5, 0xB] - movs r1, 0x7F - str r1, [sp] - ldr r1, =sub_81B42D0 - str r1, [sp, 0x4] - ldr r1, [r5] - str r1, [sp, 0x8] - movs r1, 0xFF - movs r3, 0x1 - bl sub_81B0038 -_081B42C0: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end c2_8123744 - - thumb_func_start sub_81B42D0 -sub_81B42D0: @ 81B42D0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B432C - ldr r0, =gUnknown_0203CE7C - ldrh r4, [r0] - ldr r0, =gUnknown_0203CEC8 - mov r8, r0 - ldrb r0, [r0, 0x9] - lsls r0, 24 - asrs r0, 24 - movs r6, 0x64 - muls r0, r6 - ldr r5, =gPlayerParty - adds r0, r5 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0 - bl sub_81B1C84 - mov r1, r8 - movs r0, 0x9 - ldrsb r0, [r1, r0] - muls r0, r6 - adds r0, r5 - adds r1, r4, 0 - bl sub_81B1DB8 - adds r0, r4, 0 - movs r1, 0x1 - bl RemoveBagItem - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B469C - str r1, [r0] -_081B432C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B42D0 - - thumb_func_start sub_81B4350 -sub_81B4350: @ 81B4350 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B4388 - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gUnknown_0203CEFC - ldrh r1, [r1] - movs r2, 0x1 - bl sub_81B1D1C - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B43A8 - str r1, [r0] -_081B4388: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4350 - - thumb_func_start sub_81B43A8 -sub_81B43A8: @ 81B43A8 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B43CC - bl sub_81B334C - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B43DC - str r0, [r1] -_081B43CC: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B43A8 - - thumb_func_start sub_81B43DC -sub_81B43DC: @ 81B43DC - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _081B4402 - cmp r1, 0 - bgt _081B43FC - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _081B44D8 - b _081B44EC -_081B43FC: - cmp r1, 0x1 - beq _081B44DE - b _081B44EC -_081B4402: - ldr r5, =gUnknown_0203CE7C - ldrh r0, [r5] - movs r1, 0x1 - bl RemoveBagItem - ldr r6, =gUnknown_0203CEFC - ldrh r0, [r6] - movs r1, 0x1 - bl AddBagItem - lsls r0, 24 - cmp r0, 0 - bne _081B4458 - ldrh r0, [r5] - movs r1, 0x1 - bl AddBagItem - ldrh r0, [r6] - bl pokemon_item_not_removed - ldr r0, =gStringVar4 - movs r1, 0 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1C1C - str r1, [r0] - b _081B44EC - .pool -_081B4458: - ldrh r0, [r5] - bl itemid_is_mail - lsls r0, 24 - cmp r0, 0 - beq _081B4498 - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - ldrh r1, [r5] - bl sub_81B1DB8 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B44FC - str r1, [r0] - b _081B44EC - .pool -_081B4498: - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - ldrh r1, [r5] - bl sub_81B1DB8 - ldrh r0, [r5] - ldrh r1, [r6] - movs r2, 0x1 - bl sub_81B1D68 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B469C - str r1, [r0] - b _081B44EC - .pool -_081B44D8: - movs r0, 0x5 - bl PlaySE -_081B44DE: - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B1C1C - str r0, [r1] -_081B44EC: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B43DC - - thumb_func_start sub_81B44FC -sub_81B44FC: @ 81B44FC - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B451C - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - ldr r0, =sub_81B452C - str r0, [r1, 0x4] - adds r0, r4, 0 - bl sub_81B12C0 -_081B451C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B44FC - - thumb_func_start sub_81B452C -sub_81B452C: @ 81B452C - push {lr} - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x40 - bl GetMonData - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gSaveBlock1Ptr - lsls r2, r0, 3 - adds r2, r0 - lsls r2, 2 - ldr r0, =0x00002be0 - adds r2, r0 - ldr r1, [r1] - adds r1, r2 - ldr r2, =sub_81B4578 - movs r0, 0x4 - movs r3, 0x3 - bl sub_811A20C - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B452C - - thumb_func_start sub_81B4578 -sub_81B4578: @ 81B4578 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - ldr r6, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r6, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - ldr r0, =gScriptResult - ldrh r7, [r0] - cmp r7, 0 - bne _081B45F8 - adds r0, r5, 0 - bl sub_80D4680 - ldr r4, =gUnknown_0203CEFC - adds r0, r5, 0 - movs r1, 0xC - adds r2, r4, 0 - bl SetMonData - ldrh r0, [r4] - movs r1, 0x1 - bl RemoveBagItem - mov r0, r8 - movs r1, 0x1 - bl AddBagItem - ldrb r0, [r6, 0x8] - lsls r0, 28 - lsrs r0, 28 - ldrb r2, [r6, 0xB] - str r7, [sp] - ldr r1, =sub_81B36FC - str r1, [sp, 0x4] - ldr r1, [r6] - str r1, [sp, 0x8] - movs r1, 0xFF - movs r3, 0x1 - bl sub_81B0038 - b _081B4614 - .pool -_081B45F8: - ldrb r0, [r6, 0x8] - lsls r0, 28 - lsrs r0, 28 - ldrb r2, [r6, 0xB] - movs r1, 0x7F - str r1, [sp] - ldr r1, =sub_81B4624 - str r1, [sp, 0x4] - ldr r1, [r6] - str r1, [sp, 0x8] - movs r1, 0xFF - movs r3, 0x1 - bl sub_81B0038 -_081B4614: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4578 - - thumb_func_start sub_81B4624 -sub_81B4624: @ 81B4624 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B468A - ldr r1, =gUnknown_0203CEFC - ldrh r0, [r1] - cmp r0, 0 - bne _081B4670 - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gUnknown_0203CE7C - ldrh r1, [r1] - movs r2, 0 - movs r3, 0 - bl sub_81B1C84 - b _081B467C - .pool -_081B4670: - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - ldrh r1, [r1] - movs r2, 0 - bl sub_81B1D68 -_081B467C: - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B469C - str r0, [r1] -_081B468A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4624 - - thumb_func_start sub_81B469C -sub_81B469C: @ 81B469C - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r4, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r4, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r6, r1, r0 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B471C - ldr r5, =gUnknown_0203CEDC - movs r0, 0x9 - ldrsb r0, [r4, r0] - lsls r0, 4 - ldr r1, [r5] - adds r1, r0 - adds r0, r6, 0 - bl sub_81B5C94 - ldrb r1, [r4, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0xC - bne _081B4716 - adds r0, r6, 0 - movs r1, 0xC - bl GetMonData - cmp r0, 0 - beq _081B4704 - movs r0, 0x9 - ldrsb r0, [r4, r0] - lsls r0, 4 - ldr r1, [r5] - adds r1, r0 - movs r0, 0xB - movs r2, 0x1 - bl sub_81B2FA8 - b _081B4716 - .pool -_081B4704: - movs r0, 0x9 - ldrsb r0, [r4, r0] - lsls r0, 4 - ldr r1, [r5] - adds r1, r0 - movs r0, 0xC - movs r2, 0x1 - bl sub_81B2FA8 -_081B4716: - adds r0, r7, 0 - bl sub_81B1C1C -_081B471C: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81B469C - - thumb_func_start sub_81B4724 -sub_81B4724: @ 81B4724 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r6, r0, 16 - movs r0, 0x5 - bl PlaySE - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - adds r0, r5, 0 - bl sub_81B1E00 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _081B4788 - cmp r0, 0x1 - beq _081B47AC - adds r0, r5, 0 - adds r1, r6, 0 - movs r2, 0x1 - bl sub_81B1CD0 - b _081B47BA - .pool -_081B4788: - ldr r1, =gStringVar1 - adds r0, r5, 0 - bl GetMonNickname - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9980 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - b _081B47B4 - .pool -_081B47AC: - adds r0, r6, 0 - bl pokemon_item_not_removed - ldr r0, =gStringVar4 -_081B47B4: - movs r1, 0x1 - bl sub_81B1B5C -_081B47BA: - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r0, =gTasks - lsls r1, r7, 2 - adds r1, r7 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B469C - str r0, [r1] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4724 - - thumb_func_start sub_81B47E0 -sub_81B47E0: @ 81B47E0 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r7, r1, r0 - adds r0, r7, 0 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r5, r0, 16 - movs r0, 0x5 - bl PlaySE - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - cmp r5, 0 - bne _081B4864 - ldr r1, =gStringVar1 - adds r0, r7, 0 - bl GetMonNickname - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9980 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B469C - b _081B488A - .pool -_081B4864: - ldr r1, =gStringVar1 - adds r0, r5, 0 - bl CopyItemName - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9E00 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B48A8 -_081B488A: - str r1, [r0] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B47E0 - - thumb_func_start sub_81B48A8 -sub_81B48A8: @ 81B48A8 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B48CC - bl sub_81B334C - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B48DC - str r0, [r1] -_081B48CC: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B48A8 - - thumb_func_start sub_81B48DC -sub_81B48DC: @ 81B48DC - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r4, r1, r0 - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _081B491A - cmp r1, 0 - bgt _081B4914 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _081B4964 - b _081B4978 - .pool -_081B4914: - cmp r1, 0x1 - beq _081B496A - b _081B4978 -_081B491A: - adds r0, r4, 0 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - ldr r1, =gStringVar1 - bl CopyItemName - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9E14 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B4988 - str r1, [r0] - b _081B4978 - .pool -_081B4964: - movs r0, 0x5 - bl PlaySE -_081B496A: - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B1C1C - str r0, [r1] -_081B4978: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B48DC - - thumb_func_start sub_81B4988 -sub_81B4988: @ 81B4988 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r6, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r6, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B49EC - movs r1, 0 - mov r0, sp - strh r1, [r0] - adds r0, r5, 0 - movs r1, 0xC - mov r2, sp - bl SetMonData - ldr r4, =gUnknown_0203CEDC - movs r0, 0x9 - ldrsb r0, [r6, r0] - lsls r0, 4 - ldr r1, [r4] - adds r1, r0 - adds r0, r5, 0 - bl sub_81B5C94 - movs r0, 0x9 - ldrsb r0, [r6, r0] - lsls r0, 4 - ldr r1, [r4] - adds r1, r0 - movs r0, 0xC - movs r2, 0x1 - bl sub_81B2FA8 - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1C1C - str r1, [r0] -_081B49EC: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4988 - - thumb_func_start sub_81B4A08 -sub_81B4A08: @ 81B4A08 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - movs r0, 0x5 - bl PlaySE - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - ldr r0, =gPlayerParty - ldr r1, =gUnknown_0203CEC8 - ldrb r1, [r1, 0x9] - movs r2, 0x9 - bl sub_81B33B4 - movs r0, 0x2 - bl sub_81B31B0 - movs r0, 0x19 - bl display_pokemon_menu_message - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0xFF - strh r1, [r0, 0x8] - ldr r1, =sub_81B3730 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4A08 - - thumb_func_start sub_81B4A6C -sub_81B4A6C: @ 81B4A6C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - ldr r0, =sub_81B4A98 - str r0, [r1, 0x4] - adds r0, r4, 0 - bl sub_81B12C0 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4A6C - - thumb_func_start sub_81B4A98 -sub_81B4A98: @ 81B4A98 - push {lr} - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x40 - bl GetMonData - ldr r2, =gSaveBlock1Ptr - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x00002be0 - adds r1, r0 - ldr r0, [r2] - adds r0, r1 - ldr r1, =sub_81B4AE0 - movs r2, 0x1 - bl sub_8121478 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4A98 - - thumb_func_start sub_81B4AE0 -sub_81B4AE0: @ 81B4AE0 - push {lr} - sub sp, 0xC - ldr r2, =gPaletteFade - ldrb r0, [r2, 0x8] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2, 0x8] - ldr r3, =gUnknown_0203CEC8 - ldrb r0, [r3, 0x8] - lsls r0, 28 - lsrs r0, 28 - ldrb r2, [r3, 0xB] - movs r1, 0x15 - str r1, [sp] - ldr r1, =sub_81B36FC - str r1, [sp, 0x4] - ldr r1, [r3] - str r1, [sp, 0x8] - movs r1, 0xFF - movs r3, 0x1 - bl sub_81B0038 - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4AE0 - - thumb_func_start brm_take_2 -brm_take_2: @ 81B4B20 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x5 - bl PlaySE - ldr r5, =gUnknown_0203CEC4 - ldr r0, [r5] - adds r0, 0xD - bl sub_81B302C - ldr r0, [r5] - adds r0, 0xC - bl sub_81B302C - ldr r0, =gUnknown_085E9855 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B4B6C - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end brm_take_2 - - thumb_func_start sub_81B4B6C -sub_81B4B6C: @ 81B4B6C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B4B90 - bl sub_81B334C - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B4BA0 - str r0, [r1] -_081B4B90: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4B6C - - thumb_func_start sub_81B4BA0 -sub_81B4BA0: @ 81B4BA0 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _081B4BC6 - cmp r1, 0 - bgt _081B4BC0 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _081B4C30 - b _081B4C4C -_081B4BC0: - cmp r1, 0x1 - beq _081B4C36 - b _081B4C4C -_081B4BC6: - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - bl sub_80D4700 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _081B4C0C - ldr r0, =gUnknown_085E9877 - movs r1, 0 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B469C - b _081B4C4A - .pool -_081B4C0C: - ldr r0, =gUnknown_085E9897 - movs r1, 0 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1C1C - b _081B4C4A - .pool -_081B4C30: - movs r0, 0x5 - bl PlaySE -_081B4C36: - ldr r0, =gUnknown_085E98B4 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B4C60 -_081B4C4A: - str r1, [r0] -_081B4C4C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4BA0 - - thumb_func_start sub_81B4C60 -sub_81B4C60: @ 81B4C60 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B4C84 - bl sub_81B334C - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B4C94 - str r0, [r1] -_081B4C84: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4C60 - - thumb_func_start sub_81B4C94 -sub_81B4C94: @ 81B4C94 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _081B4CBE - cmp r1, 0 - bgt _081B4CB8 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _081B4D50 - b _081B4D64 -_081B4CB8: - cmp r1, 0x1 - beq _081B4D56 - b _081B4D64 -_081B4CBE: - ldr r0, =gUnknown_0203CEC8 - mov r8, r0 - ldrb r0, [r0, 0x9] - lsls r0, 24 - asrs r0, 24 - movs r7, 0x64 - muls r0, r7 - ldr r6, =gPlayerParty - adds r0, r6 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 - movs r1, 0x1 - bl AddBagItem - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B4D24 - mov r1, r8 - movs r0, 0x9 - ldrsb r0, [r1, r0] - muls r0, r7 - adds r0, r6 - bl sub_80D4680 - ldr r0, =gUnknown_085E99B8 - movs r1, 0 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B469C - str r1, [r0] - b _081B4D64 - .pool -_081B4D24: - adds r0, r4, 0 - bl pokemon_item_not_removed - ldr r0, =gStringVar4 - movs r1, 0 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1C1C - str r1, [r0] - b _081B4D64 - .pool -_081B4D50: - movs r0, 0x5 - bl PlaySE -_081B4D56: - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B1C1C - str r0, [r1] -_081B4D64: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4C94 - - thumb_func_start sub_81B4D78 -sub_81B4D78: @ 81B4D78 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r5, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r5, r1] - movs r0, 0x64 - muls r0, r1 - ldr r6, =gPlayerParty - adds r7, r0, r6 - movs r0, 0x5 - bl PlaySE - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - ldrb r4, [r5, 0x9] - adds r0, r7, 0 - bl sub_81B353C - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r6, 0 - adds r1, r4, 0 - bl sub_81B33B4 - ldrb r1, [r5, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0xC - beq _081B4DE4 - movs r0, 0 - bl sub_81B31B0 - movs r0, 0x15 - bl display_pokemon_menu_message - b _081B4E02 - .pool -_081B4DE4: - movs r0, 0x1 - bl sub_81B31B0 - adds r0, r7, 0 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - ldr r1, =gStringVar2 - bl CopyItemName - movs r0, 0x1A - bl display_pokemon_menu_message -_081B4E02: - ldr r1, =gTasks - mov r2, r8 - lsls r0, r2, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r1, 0xFF - strh r1, [r0, 0x8] - ldr r1, =sub_81B3730 - str r1, [r0] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4D78 - - thumb_func_start brm_shift_sendout -brm_shift_sendout: @ 81B4E2C - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x5 - bl PlaySE - ldr r5, =gUnknown_0203CEC4 - ldr r0, [r5] - adds r0, 0xC - bl sub_81B302C - bl sub_81B8A7C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B4E5C - adds r0, r4, 0 - bl sub_81B12C0 - b _081B4E7A - .pool -_081B4E5C: - ldr r0, [r5] - adds r0, 0xD - bl sub_81B302C - ldr r0, =gStringVar4 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1C1C - str r1, [r0] -_081B4E7A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end brm_shift_sendout - - thumb_func_start sub_81B4E8C -sub_81B4E8C: @ 81B4E8C - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - bl sub_81B8830 - lsls r0, 24 - lsrs r6, r0, 24 - movs r5, 0 - cmp r5, r6 - bcs _081B4F36 - ldr r2, =gUnknown_0203CEC8 - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - mov r8, r0 -_081B4EC6: - ldr r0, =gUnknown_0203CEF8 - adds r4, r5, r0 - ldrb r0, [r4] - cmp r0, 0 - bne _081B4F2C - movs r0, 0x5 - str r2, [sp] - bl PlaySE - ldr r2, [sp] - ldrb r0, [r2, 0x9] - adds r0, 0x1 - strb r0, [r4] - adds r0, r5, 0x2 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0203CEDC - ldrb r2, [r2, 0x9] - lsls r2, 24 - asrs r2, 24 - lsls r2, 4 - ldr r1, [r1] - adds r1, r2 - movs r2, 0x1 - bl sub_81B2FA8 - subs r0, r6, 0x1 - cmp r5, r0 - bne _081B4F04 - bl sub_81B4F88 -_081B4F04: - movs r0, 0 - bl display_pokemon_menu_message - ldr r0, =sub_81B1370 - mov r1, r8 - str r0, [r1] - b _081B4F68 - .pool -_081B4F2C: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, r6 - bcc _081B4EC6 -_081B4F36: - ldr r0, =gStringVar1 - adds r1, r6, 0 - movs r2, 0 - movs r3, 0x1 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9830 - adds r0, r4, 0 - bl StringExpandPlaceholders - movs r0, 0x20 - bl PlaySE - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1C1C - str r1, [r0] -_081B4F68: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4E8C - - thumb_func_start sub_81B4F88 -sub_81B4F88: @ 81B4F88 - push {r4,lr} - ldr r4, =gUnknown_0203CEC8 - ldrb r0, [r4, 0x9] - movs r1, 0 - bl sub_81B0FCC - movs r0, 0x6 - strb r0, [r4, 0x9] - movs r1, 0x1 - bl sub_81B0FCC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4F88 - - thumb_func_start sub_81B4FA8 -sub_81B4FA8: @ 81B4FA8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r0, 0x5 - bl PlaySE - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - bl sub_81B8830 - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - cmp r4, r5 - bcs _081B502A - ldr r6, =gUnknown_0203CEF8 - subs r2, r5, 0x1 - adds r7, r6, 0 - ldr r3, =gUnknown_0203CEC8 -_081B4FE2: - adds r0, r4, r6 - ldrb r1, [r0] - movs r0, 0x9 - ldrsb r0, [r3, r0] - adds r0, 0x1 - cmp r1, r0 - bne _081B5020 - adds r0, r4, 0 - adds r4, r2, 0 - cmp r0, r4 - bge _081B500C - adds r3, r7, 0 -_081B4FFA: - adds r2, r0, r3 - adds r1, r0, 0x1 - adds r0, r1, r3 - ldrb r0, [r0] - strb r0, [r2] - lsls r1, 24 - lsrs r0, r1, 24 - cmp r0, r4 - blt _081B4FFA -_081B500C: - adds r1, r0, r6 - movs r0, 0 - strb r0, [r1] - b _081B502A - .pool -_081B5020: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _081B4FE2 -_081B502A: - ldr r6, =gUnknown_0203CEDC - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0x9] - lsls r0, 24 - asrs r0, 24 - lsls r0, 4 - ldr r1, [r6] - adds r1, r0 - movs r0, 0x1 - movs r2, 0x1 - bl sub_81B2FA8 - movs r4, 0 - subs r5, 0x1 - mov r0, r8 - lsls r7, r0, 2 - cmp r4, r5 - bge _081B5078 -_081B504E: - ldr r0, =gUnknown_0203CEF8 - adds r1, r4, r0 - ldrb r0, [r1] - cmp r0, 0 - beq _081B506E - adds r0, r4, 0x2 - lsls r0, 24 - lsrs r0, 24 - ldrb r2, [r1] - lsls r2, 4 - subs r2, 0x10 - ldr r1, [r6] - adds r1, r2 - movs r2, 0x1 - bl sub_81B2FA8 -_081B506E: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - blt _081B504E -_081B5078: - movs r0, 0 - bl display_pokemon_menu_message - ldr r0, =gTasks - mov r2, r8 - adds r1, r7, r2 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B1370 - str r0, [r1] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B4FA8 - - thumb_func_start sub_81B50AC -sub_81B50AC: @ 81B50AC - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x5 - bl PlaySE - adds r0, r4, 0 - bl sub_81B12C0 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B50AC - - thumb_func_start sub_81B50C8 -sub_81B50C8: @ 81B50C8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =gUnknown_0203CEC8 - mov r9, r0 - ldrb r0, [r0, 0x9] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x64 - mov r8, r1 - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - ldr r4, =gPlayerParty - adds r0, r4 - movs r1, 0x41 - bl GetMonData - adds r6, r0, 0 - lsls r6, 16 - lsrs r6, 16 - mov r1, r9 - movs r0, 0x9 - ldrsb r0, [r1, r0] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r4 - movs r1, 0xB - bl GetMonData - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - mov r1, r9 - movs r0, 0x9 - ldrsb r0, [r1, r0] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r4 - movs r1, 0x50 - bl GetMonData - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_800F7DC - ldr r0, [r0] - adds r1, r6, 0 - adds r2, r5, 0 - adds r3, r4, 0 - bl sub_807A8D0 - cmp r0, 0x1 - beq _081B515C - cmp r0, 0x2 - beq _081B5170 - movs r0, 0x5 - bl PlaySE - adds r0, r7, 0 - bl sub_81B12C0 - b _081B51B0 - .pool -_081B515C: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EA210 - bl StringExpandPlaceholders - b _081B5178 - .pool -_081B5170: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EA234 - bl StringExpandPlaceholders -_081B5178: - movs r0, 0x20 - bl PlaySE - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EA1CA - adds r0, r4, 0 - bl StringAppend - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1C1C - str r1, [r0] -_081B51B0: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B50C8 - - thumb_func_start brm_trade_1 -brm_trade_1: @ 81B51D4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0xC - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =gUnknown_0203CEC8 - mov r8, r0 - ldrb r0, [r0, 0x9] - lsls r0, 24 - asrs r0, 24 - movs r6, 0x64 - muls r0, r6 - ldr r4, =gPlayerParty - adds r0, r4 - movs r1, 0x41 - bl GetMonData - mov r9, r0 - mov r1, r9 - lsls r1, 16 - lsrs r1, 16 - mov r9, r1 - mov r1, r8 - movs r0, 0x9 - ldrsb r0, [r1, r0] - muls r0, r6 - adds r0, r4 - movs r1, 0xB - bl GetMonData - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - mov r1, r8 - movs r0, 0x9 - ldrsb r0, [r1, r0] - muls r0, r6 - adds r0, r4 - movs r1, 0x50 - bl GetMonData - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_800F7DC - ldr r0, [r0] - ldr r1, =gUnknown_02022C38 - ldr r1, [r1] - ldr r2, =gUnknown_02022C3C - ldrh r3, [r2] - ldr r2, =gUnknown_02022C3E - ldrb r2, [r2] - str r2, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - mov r2, r9 - bl sub_807A7E0 - cmp r0, 0 - beq _081B52C8 - ldr r5, =gStringVar4 - ldr r1, =gUnknown_08615E0C - subs r0, 0x1 - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - adds r0, r5, 0 - bl StringExpandPlaceholders - movs r0, 0x20 - bl PlaySE - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - ldr r1, =gUnknown_085EA1CA - adds r0, r5, 0 - bl StringAppend - adds r0, r5, 0 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1C1C - str r1, [r0] - b _081B52D4 - .pool -_081B52C8: - movs r0, 0x5 - bl PlaySE - adds r0, r7, 0 - bl sub_81B12C0 -_081B52D4: - add sp, 0xC - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end brm_trade_1 - - thumb_func_start sub_81B52E4 -sub_81B52E4: @ 81B52E4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - ldr r0, =gPlayerParty - ldr r1, =gUnknown_0203CEC8 - ldrb r1, [r1, 0x9] - lsls r1, 24 - asrs r1, 24 - lsls r1, 16 - lsrs r1, 16 - bl sub_807A918 - cmp r0, 0x2 - beq _081B5340 - cmp r0, 0x2 - bgt _081B5328 - cmp r0, 0x1 - beq _081B532E - b _081B5368 - .pool -_081B5328: - cmp r0, 0x3 - beq _081B5354 - b _081B5368 -_081B532E: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EA1E8 - bl StringExpandPlaceholders - b _081B53C0 - .pool -_081B5340: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EA210 - bl StringExpandPlaceholders - b _081B53C0 - .pool -_081B5354: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EA234 - bl StringExpandPlaceholders - b _081B53C0 - .pool -_081B5368: - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gStringVar1 - bl GetMonNickname - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EA1CD - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B53FC - b _081B53E4 - .pool -_081B53C0: - movs r0, 0x20 - bl PlaySE - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085EA1CA - adds r0, r4, 0 - bl StringAppend - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1C1C -_081B53E4: - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B52E4 - - thumb_func_start sub_81B53FC -sub_81B53FC: @ 81B53FC - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B5420 - bl sub_81B334C - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B5430 - str r0, [r1] -_081B5420: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B53FC - - thumb_func_start sub_81B5430 -sub_81B5430: @ 81B5430 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _081B5456 - cmp r1, 0 - bgt _081B5450 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _081B545E - b _081B546A -_081B5450: - cmp r1, 0x1 - beq _081B5464 - b _081B546A -_081B5456: - adds r0, r4, 0 - bl sub_81B12C0 - b _081B546A -_081B545E: - movs r0, 0x5 - bl PlaySE -_081B5464: - adds r0, r4, 0 - bl sub_81B1C1C -_081B546A: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B5430 - - thumb_func_start sub_81B5470 -sub_81B5470: @ 81B5470 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - bl GetMenuCursorPos - ldr r5, =gUnknown_0203CEC4 - ldr r1, [r5] - lsls r0, 24 - lsrs r0, 24 - adds r1, 0xF - adds r1, r0 - ldrb r0, [r1] - subs r0, 0x13 - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x5 - bl PlaySE - ldr r1, =gUnknown_08615D9C - lsls r0, r4, 3 - adds r7, r0, r1 - ldr r0, [r7] - cmp r0, 0 - bne _081B54A2 - b _081B5664 -_081B54A2: - ldr r0, [r5] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r5] - adds r0, 0xD - bl sub_81B302C - bl sub_81221AC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B54C6 - bl InUnionRoom - cmp r0, 0x1 - bne _081B54E8 -_081B54C6: - adds r0, r4, 0 - subs r0, 0xB - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _081B54E4 - movs r0, 0xD - bl display_pokemon_menu_message - b _081B5656 - .pool -_081B54E4: - ldrb r0, [r7, 0x4] - b _081B5652 -_081B54E8: - cmp r4, 0x7 - bhi _081B5524 - ldr r1, =0x00000867 - adds r0, r4, r1 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B5524 - ldr r0, =gUnknown_085E97FC - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1C1C - str r1, [r0] - b _081B5664 - .pool -_081B5524: - ldr r1, =gUnknown_08615D9C - lsls r0, r4, 3 - adds r5, r0, r1 - ldr r0, [r5] - bl _call_via_r0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B553A - b _081B563C -_081B553A: - subs r0, r4, 0x5 - cmp r0, 0x7 - bhi _081B5624 - lsls r0, 2 - ldr r1, =_081B5554 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081B5554: - .4byte _081B5614 - .4byte _081B5624 - .4byte _081B5624 - .4byte _081B557C - .4byte _081B55B8 - .4byte _081B5624 - .4byte _081B5574 - .4byte _081B5574 -_081B5574: - adds r0, r6, 0 - bl sub_8161560 - b _081B5664 -_081B557C: - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - movs r0, 0x1C - ldrsb r0, [r1, r0] - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r1, 0x1D] - lsls r1, 24 - asrs r1, 24 - lsls r1, 16 - lsrs r1, 16 - bl get_mapheader_by_bank_and_number - adds r1, r0, 0 - ldr r0, =gStringVar1 - ldrb r1, [r1, 0x14] - bl sub_81245DC - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EA196 - b _081B55E8 - .pool -_081B55B8: - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x24 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - lsls r0, 16 - lsrs r0, 16 - adds r1, 0x25 - ldrb r1, [r1] - lsls r1, 24 - asrs r1, 24 - lsls r1, 16 - lsrs r1, 16 - bl get_mapheader_by_bank_and_number - adds r1, r0, 0 - ldr r0, =gStringVar1 - ldrb r1, [r1, 0x14] - bl sub_81245DC - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085EA16B -_081B55E8: - bl StringExpandPlaceholders - adds r0, r6, 0 - bl sub_81B5674 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - movs r1, 0x86 - lsls r1, 2 - adds r0, r1 - strh r4, [r0] - b _081B5664 - .pool -_081B5614: - ldr r1, =gUnknown_0203CEC8 - ldr r0, =sub_8124690 - b _081B5628 - .pool -_081B5624: - ldr r1, =gUnknown_0203CEC8 - ldr r0, =c2_exit_to_overworld_2_switch -_081B5628: - str r0, [r1] - adds r0, r6, 0 - bl sub_81B12C0 - b _081B5664 - .pool -_081B563C: - cmp r4, 0x1 - beq _081B564A - cmp r4, 0x4 - bne _081B5650 - bl sub_81B5864 - b _081B5656 -_081B564A: - bl sub_81B57DC - b _081B5656 -_081B5650: - ldrb r0, [r5, 0x4] -_081B5652: - bl display_pokemon_menu_message -_081B5656: - ldr r0, =gTasks - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =task_brm_cancel_1_on_keypad_a_or_b - str r0, [r1] -_081B5664: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B5470 - - thumb_func_start sub_81B5674 -sub_81B5674: @ 81B5674 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gStringVar4 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B56A4 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B5674 - - thumb_func_start sub_81B56A4 -sub_81B56A4: @ 81B56A4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B56C8 - bl sub_81B334C - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B56D8 - str r0, [r1] -_081B56C8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B56A4 - - thumb_func_start sub_81B56D8 -sub_81B56D8: @ 81B56D8 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _081B56FE - cmp r1, 0 - bgt _081B56F8 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _081B5714 - b _081B572A -_081B56F8: - cmp r1, 0x1 - beq _081B571A - b _081B572A -_081B56FE: - ldr r1, =gUnknown_0203CEC8 - ldr r0, =c2_exit_to_overworld_2_switch - str r0, [r1] - adds r0, r4, 0 - bl sub_81B12C0 - b _081B572A - .pool -_081B5714: - movs r0, 0x5 - bl PlaySE -_081B571A: - ldr r0, =gUnknown_03005DB0 - movs r1, 0 - str r1, [r0] - ldr r0, =gUnknown_0203CEEC - str r1, [r0] - adds r0, r4, 0 - bl sub_81B1C1C -_081B572A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B56D8 - - thumb_func_start hm_add_c3_launch_phase_2 -hm_add_c3_launch_phase_2: @ 81B5738 - push {lr} - bl pal_fill_black - ldr r0, =task_launch_hm_phase_2 - movs r1, 0x8 - bl CreateTask - movs r0, 0x1 - pop {r1} - bx r1 - .pool - thumb_func_end hm_add_c3_launch_phase_2 - - thumb_func_start task_launch_hm_phase_2 -task_launch_hm_phase_2: @ 81B5750 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80ABDFC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B577C - bl brm_get_selected_species - ldr r1, =gUnknown_02038C08 - lsls r0, 16 - lsrs r0, 16 - str r0, [r1] - ldr r0, =gUnknown_0203CEEC - ldr r0, [r0] - bl _call_via_r0 - adds r0, r4, 0 - bl DestroyTask -_081B577C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task_launch_hm_phase_2 - - thumb_func_start brm_get_selected_species -brm_get_selected_species: @ 81B578C - push {lr} - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - .pool - thumb_func_end brm_get_selected_species - - thumb_func_start task_brm_cancel_1_on_keypad_a_or_b -task_brm_cancel_1_on_keypad_a_or_b: @ 81B57B4 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081B57CE - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081B57D4 -_081B57CE: - adds r0, r2, 0 - bl brm_cancel_1 -_081B57D4: - pop {r0} - bx r0 - .pool - thumb_func_end task_brm_cancel_1_on_keypad_a_or_b - - thumb_func_start sub_81B57DC -sub_81B57DC: @ 81B57DC - push {lr} - ldr r0, =0x00000888 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B57F8 - movs r0, 0xC - bl display_pokemon_menu_message - b _081B57FE - .pool -_081B57F8: - movs r0, 0xD - bl display_pokemon_menu_message -_081B57FE: - pop {r0} - bx r0 - thumb_func_end sub_81B57DC - - thumb_func_start hm_surf_run_dp02scr -hm_surf_run_dp02scr: @ 81B5804 - push {lr} - bl brm_get_pokemon_selection - ldr r1, =gUnknown_02038C08 - lsls r0, 24 - lsrs r0, 24 - str r0, [r1] - movs r0, 0x9 - bl FieldEffectStart - pop {r0} - bx r0 - .pool - thumb_func_end hm_surf_run_dp02scr - - thumb_func_start sub_81B5820 -sub_81B5820: @ 81B5820 - push {lr} - bl PartyHasMonWithSurf - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B585C - bl IsPlayerFacingSurfableFishableWater - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B585C - ldr r1, =gUnknown_03005DB0 - ldr r0, =hm_add_c3_launch_phase_2 - str r0, [r1] - ldr r1, =gUnknown_0203CEEC - ldr r0, =hm_surf_run_dp02scr - str r0, [r1] - movs r0, 0x1 - b _081B585E - .pool -_081B585C: - movs r0, 0 -_081B585E: - pop {r1} - bx r1 - thumb_func_end sub_81B5820 - - thumb_func_start sub_81B5864 -sub_81B5864: @ 81B5864 - push {lr} - movs r0, 0x8 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - beq _081B587A - movs r0, 0x9 - bl display_pokemon_menu_message - b _081B5880 -_081B587A: - movs r0, 0x8 - bl display_pokemon_menu_message -_081B5880: - pop {r0} - bx r0 - thumb_func_end sub_81B5864 - - thumb_func_start sub_81B5884 -sub_81B5884: @ 81B5884 - push {lr} - ldr r0, =gUnknown_02037318 - ldrb r0, [r0, 0x17] - bl is_light_level_1_2_3_or_6 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B58A0 - movs r0, 0 - b _081B58A2 - .pool -_081B58A0: - movs r0, 0x1 -_081B58A2: - pop {r1} - bx r1 - thumb_func_end sub_81B5884 - - thumb_func_start sub_81B58A8 -sub_81B58A8: @ 81B58A8 - push {lr} - sub sp, 0xC - movs r0, 0 - str r0, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - ldr r0, =sub_8086194 - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_81B0038 - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B58A8 - - thumb_func_start hm2_waterfall -hm2_waterfall: @ 81B58D4 - push {lr} - bl brm_get_pokemon_selection - ldr r1, =gUnknown_02038C08 - lsls r0, 24 - lsrs r0, 24 - str r0, [r1] - movs r0, 0x2B - bl FieldEffectStart - pop {r0} - bx r0 - .pool - thumb_func_end hm2_waterfall - - thumb_func_start hm_prepare_waterfall -hm_prepare_waterfall: @ 81B58F0 - push {r4,lr} - sub sp, 0x4 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl GetXYCoordsOneStepInFrontOfPlayer - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r4, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl MetatileBehavior_IsWaterfall - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B594C - bl IsPlayerSurfingNorth - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B594C - ldr r1, =gUnknown_03005DB0 - ldr r0, =hm_add_c3_launch_phase_2 - str r0, [r1] - ldr r1, =gUnknown_0203CEEC - ldr r0, =hm2_waterfall - str r0, [r1] - movs r0, 0x1 - b _081B594E - .pool -_081B594C: - movs r0, 0 -_081B594E: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end hm_prepare_waterfall - - thumb_func_start sub_81B5958 -sub_81B5958: @ 81B5958 - push {lr} - bl brm_get_pokemon_selection - ldr r1, =gUnknown_02038C08 - lsls r0, 24 - lsrs r0, 24 - str r0, [r1] - movs r0, 0x2C - bl FieldEffectStart - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B5958 - - thumb_func_start sub_81B5974 -sub_81B5974: @ 81B5974 - push {lr} - bl sub_809D1E8 - ldr r1, =gUnknown_02038C08 - lsls r0, 24 - lsrs r0, 24 - str r0, [r1, 0x4] - cmp r0, 0 - bne _081B5990 - movs r0, 0 - b _081B599E - .pool -_081B5990: - ldr r1, =gUnknown_03005DB0 - ldr r0, =hm_add_c3_launch_phase_2 - str r0, [r1] - ldr r1, =gUnknown_0203CEEC - ldr r0, =sub_81B5958 - str r0, [r1] - movs r0, 0x1 -_081B599E: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B5974 - - 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 - adds r7, r1, 0 - adds r4, r2, 0 - movs r6, 0x1 - bl sub_81B1250 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B59EA - ldr r0, =gMain - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081B59EA - ldr r0, =gUnknown_08616020 - adds r0, r4, r0 - ldrb r1, [r0] - eors r1, r6 - negs r0, r1 - orrs r0, r1 - lsrs r6, r0, 31 -_081B59EA: - adds r0, r5, 0 - movs r1, 0x41 - bl GetMonData - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0 - bl GetMonData - adds r1, r0, 0 - str r6, [sp] - adds r0, r4, 0 - adds r2, r7, 0 - movs r3, 0x1 - bl party_menu_link_mon_icon_anim - ldrb r0, [r7, 0x9] - adds r1, r5, 0 - bl sub_81B5B38 - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end party_menu_icon_anim - - 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 - adds r4, r2, 0 - lsls r0, 16 - lsrs r5, r0, 16 - lsls r3, 24 - lsrs r7, r3, 24 - cmp r5, 0 - beq _081B5A7A - ldr r1, =sub_80D3014 - ldr r0, [r4, 0x4] - ldrb r2, [r0] - ldrb r3, [r0, 0x1] - movs r0, 0x4 - str r0, [sp] - str r6, [sp, 0x4] - ldr r0, [sp, 0x20] - str r0, [sp, 0x8] - adds r0, r5, 0 - bl sub_80D2CC4 - strb r0, [r4, 0x9] - ldr r2, =gSprites - ldrb r0, [r4, 0x9] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x3 - adds r2, r7, 0 - ands r2, r0 - lsls r2, 2 - ldrb r3, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r3 - orrs r0, r2 - strb r0, [r1, 0x5] -_081B5A7A: - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end party_menu_link_mon_icon_anim - - thumb_func_start sub_81B5A8C -sub_81B5A8C: @ 81B5A8C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 16 - asrs r1, 16 - lsls r2, 16 - asrs r2, 16 - adds r0, r1, 0 - adds r1, r2, 0 - bl sub_8075060 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - beq _081B5AEC - cmp r0, 0x2 - bgt _081B5AB4 - cmp r0, 0x1 - beq _081B5B04 - b _081B5B1C -_081B5AB4: - cmp r0, 0x3 - beq _081B5AD4 - cmp r0, 0x4 - bne _081B5B1C - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - movs r1, 0 - bl sub_80D32C8 - b _081B5B2C - .pool -_081B5AD4: - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - movs r1, 0x1 - bl sub_80D32C8 - b _081B5B2C - .pool -_081B5AEC: - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - movs r1, 0x2 - bl sub_80D32C8 - b _081B5B2C - .pool -_081B5B04: - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - movs r1, 0x3 - bl sub_80D32C8 - b _081B5B2C - .pool -_081B5B1C: - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - movs r1, 0x4 - bl sub_80D32C8 -_081B5B2C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B5A8C - - thumb_func_start sub_81B5B38 -sub_81B5B38: @ 81B5B38 - push {r4-r6,lr} - adds r5, r0, 0 - adds r6, r1, 0 - lsls r5, 24 - lsrs r5, 24 - adds r0, r6, 0 - movs r1, 0x39 - bl GetMonData - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r6, 0 - movs r1, 0x3A - bl GetMonData - adds r2, r0, 0 - lsls r2, 16 - lsrs r2, 16 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_81B5A8C - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81B5B38 - - thumb_func_start sub_81B5B6C -sub_81B5B6C: @ 81B5B6C - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - ldr r5, =gSprites - lsls r0, r4, 4 - adds r0, r4 - lsls r6, r0, 2 - adds r2, r6, r5 - movs r7, 0 - movs r3, 0 - strh r3, [r2, 0x2E] - mov r12, r5 - cmp r1, 0 - bne _081B5BC4 - movs r1, 0x20 - ldrsh r0, [r2, r1] - cmp r0, 0x10 - bne _081B5BA4 - strh r3, [r2, 0x24] - ldr r0, =0x0000fffc - strh r0, [r2, 0x26] - b _081B5BAA - .pool -_081B5BA4: - ldr r0, =0x0000fffc - strh r0, [r2, 0x24] - strh r3, [r2, 0x26] -_081B5BAA: - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - mov r1, r12 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_81B5C08 - b _081B5BD0 - .pool -_081B5BC4: - strh r3, [r2, 0x24] - strh r3, [r2, 0x26] - adds r0, r5, 0 - adds r0, 0x1C - adds r0, r6, r0 - ldr r1, =sub_81B5BDC -_081B5BD0: - str r1, [r0] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B5B6C - - thumb_func_start sub_81B5BDC -sub_81B5BDC: @ 81B5BDC - push {r4,lr} - adds r4, r0, 0 - bl sub_80D30DC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _081B5C02 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081B5C00 - ldr r0, =0x0000fffd - strh r0, [r4, 0x26] - b _081B5C02 - .pool -_081B5C00: - strh r1, [r4, 0x26] -_081B5C02: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B5BDC - - thumb_func_start sub_81B5C08 -sub_81B5C08: @ 81B5C08 - push {lr} - bl sub_80D30DC - pop {r0} - bx r0 - thumb_func_end sub_81B5C08 - - 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 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B5C3C - ldr r0, =gUnknown_08615EC0 - ldr r2, [r4, 0x4] - ldrb r1, [r2, 0x2] - ldrb r2, [r2, 0x3] - movs r3, 0 - bl CreateSprite - strb r0, [r4, 0xA] - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_81B5C94 -_081B5C3C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end party_menu_held_item_object - - 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 - lsls r1, 16 - lsrs r5, r1, 16 - cmp r0, 0 - beq _081B5C84 - ldr r0, =gUnknown_08615EC0 - ldr r2, [r4, 0x4] - ldrb r1, [r2, 0x2] - ldrb r2, [r2, 0x3] - movs r3, 0 - bl CreateSprite - strb r0, [r4, 0xA] - ldr r2, =gSprites - ldrb r0, [r4, 0xA] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r2, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x5] - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_81B5CB0 -_081B5C84: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end party_menu_link_mon_held_item_object - - thumb_func_start sub_81B5C94 -sub_81B5C94: @ 81B5C94 - push {r4,lr} - adds r4, r1, 0 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - adds r1, r4, 0 - bl sub_81B5CB0 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B5C94 - - thumb_func_start sub_81B5CB0 -sub_81B5CB0: @ 81B5CB0 - push {r4,lr} - adds r4, r1, 0 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - bne _081B5CD8 - ldr r2, =gSprites - ldrb r1, [r4, 0xA] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - b _081B5D24 - .pool -_081B5CD8: - bl itemid_is_mail - lsls r0, 24 - cmp r0, 0 - beq _081B5CFC - ldrb r1, [r4, 0xA] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - movs r1, 0x1 - bl StartSpriteAnim - b _081B5D0E - .pool -_081B5CFC: - ldrb r1, [r4, 0xA] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - movs r1, 0 - bl StartSpriteAnim -_081B5D0E: - ldr r2, =gSprites - ldrb r1, [r4, 0xA] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 -_081B5D24: - strb r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B5CB0 - - thumb_func_start sub_81B5D30 -sub_81B5D30: @ 81B5D30 - push {lr} - ldr r0, =gUnknown_08615EB0 - bl LoadSpriteSheet - ldr r0, =gUnknown_08615EB8 - bl LoadSpritePalette - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B5D30 - - thumb_func_start sub_81B5D4C -sub_81B5D4C: @ 81B5D4C - push {r4-r7,lr} - adds r6, r0, 0 - adds r7, r1, 0 - lsls r2, 24 - lsrs r2, 24 - cmp r2, 0 - beq _081B5D60 - cmp r2, 0x1 - beq _081B5DA8 - b _081B5DE4 -_081B5D60: - movs r5, 0 - ldrb r0, [r6] - cmp r5, r0 - bcs _081B5DE4 -_081B5D68: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - beq _081B5D94 - adds r0, r7, r5 - ldrb r4, [r0] - adds r0, r1, 0 - bl itemid_is_mail - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_81B5DF0 -_081B5D94: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - ldrb r0, [r6] - cmp r5, r0 - bcc _081B5D68 - b _081B5DE4 - .pool -_081B5DA8: - movs r5, 0 - b _081B5DDE -_081B5DAC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - beq _081B5DD8 - adds r0, r5, r7 - ldrb r4, [r0, 0x6] - adds r0, r1, 0 - bl itemid_is_mail - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_81B5DF0 -_081B5DD8: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 -_081B5DDE: - ldrb r0, [r6, 0x1] - cmp r5, r0 - bcc _081B5DAC -_081B5DE4: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B5D4C - - thumb_func_start sub_81B5DF0 -sub_81B5DF0: @ 81B5DF0 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - adds r6, r0, 0 - mov r9, r1 - lsls r6, 24 - lsrs r6, 24 - mov r0, r9 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - ldr r0, =gSprites - mov r8, r0 - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - add r0, r8 - adds r0, 0x43 - ldrb r3, [r0] - ldr r0, =gUnknown_08615EC0 - subs r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - movs r1, 0xFA - movs r2, 0xAA - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - mov r0, r8 - adds r5, r4, r0 - movs r0, 0x4 - strh r0, [r5, 0x24] - movs r0, 0xA - strh r0, [r5, 0x26] - movs r0, 0x1C - add r8, r0 - add r4, r8 - ldr r0, =sub_81B5E74 - str r0, [r4] - strh r6, [r5, 0x3C] - adds r0, r5, 0 - mov r1, r9 - bl StartSpriteAnim - ldr r1, [r4] - adds r0, r5, 0 - bl _call_via_r1 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B5DF0 - - thumb_func_start sub_81B5E74 -sub_81B5E74: @ 81B5E74 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x3C] - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gSprites - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, r0, r2 - adds r0, r2, 0 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - bge _081B5EA8 - adds r0, r4, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - b _081B5EC6 - .pool -_081B5EA8: - adds r3, r4, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r3] - ldrh r0, [r2, 0x24] - ldrh r1, [r2, 0x20] - adds r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r2, 0x26] - ldrh r2, [r2, 0x22] - adds r0, r2 - strh r0, [r4, 0x22] -_081B5EC6: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B5E74 - - thumb_func_start party_menu_pokeball_object -party_menu_pokeball_object: @ 81B5ECC - push {r4,lr} - adds r4, r1, 0 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B5EEA - ldr r0, =gUnknown_08615F08 - ldr r2, [r4, 0x4] - ldrb r1, [r2, 0x6] - ldrb r2, [r2, 0x7] - movs r3, 0x8 - bl CreateSprite - strb r0, [r4, 0xB] -_081B5EEA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end party_menu_pokeball_object - - 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 - cmp r0, 0 - beq _081B5F24 - ldr r0, =gUnknown_08615F08 - ldr r2, [r4, 0x4] - ldrb r1, [r2, 0x6] - ldrb r2, [r2, 0x7] - movs r3, 0x8 - bl CreateSprite - strb r0, [r4, 0xB] - ldr r2, =gSprites - ldrb r0, [r4, 0xB] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r2, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x5] -_081B5F24: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end party_menu_link_mon_pokeball_object - - thumb_func_start sub_81B5F34 -sub_81B5F34: @ 81B5F34 - push {lr} - adds r3, r0, 0 - adds r2, r1, 0 - lsls r3, 24 - lsrs r3, 24 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gUnknown_08615F08 - adds r1, r3, 0 - movs r3, 0x8 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gSprites - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r3, [r1, 0x5] - movs r2, 0xD - negs r2, r2 - ands r2, r3 - movs r3, 0x8 - orrs r2, r3 - strb r2, [r1, 0x5] - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B5F34 - - thumb_func_start sub_81B5F74 -sub_81B5F74: @ 81B5F74 - push {lr} - adds r3, r0, 0 - adds r2, r1, 0 - lsls r3, 24 - lsrs r3, 24 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gUnknown_08615F78 - adds r1, r3, 0 - movs r3, 0x8 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B5F74 - - thumb_func_start sub_81B5F98 -sub_81B5F98: @ 81B5F98 - push {lr} - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - ldr r2, =gSprites - adds r0, r2 - bl StartSpriteAnim - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B5F98 - - thumb_func_start sub_81B5FBC -sub_81B5FBC: @ 81B5FBC - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r6, r2, 24 - cmp r6, 0 - bne _081B6000 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =gSprites - mov r8, r0 - add r4, r8 - adds r0, r4, 0 - movs r1, 0x2 - bl StartSpriteAnim - lsls r5, r7, 4 - adds r5, r7 - lsls r5, 2 - add r5, r8 - adds r0, r5, 0 - movs r1, 0x4 - bl StartSpriteAnim - strh r6, [r4, 0x26] - strh r6, [r5, 0x26] - b _081B602C - .pool -_081B6000: - lsls r5, r0, 4 - adds r5, r0 - lsls r5, 2 - ldr r0, =gSprites - mov r8, r0 - add r5, r8 - adds r0, r5, 0 - movs r1, 0x3 - bl StartSpriteAnim - lsls r4, r7, 4 - adds r4, r7 - lsls r4, 2 - add r4, r8 - adds r0, r4, 0 - movs r1, 0x5 - bl StartSpriteAnim - ldr r0, =0x0000fffc - strh r0, [r5, 0x26] - movs r0, 0x4 - strh r0, [r4, 0x26] -_081B602C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B5FBC - - thumb_func_start sub_81B6040 -sub_81B6040: @ 81B6040 - push {lr} - ldr r0, =gUnknown_08615EF8 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_08615F70 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_08615F00 - bl LoadCompressedObjectPalette - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B6040 - - 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 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B608C - ldr r0, =gUnknown_08616008 - ldr r2, [r4, 0x4] - ldrb r1, [r2, 0x4] - ldrb r2, [r2, 0x5] - movs r3, 0 - bl CreateSprite - strb r0, [r4, 0xC] - adds r0, r5, 0 - adds r1, r4, 0 - bl party_menu_get_status_condition_and_update_object -_081B608C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end party_menu_status_condition_object - - 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 - lsls r1, 24 - lsrs r5, r1, 24 - cmp r0, 0 - beq _081B60D4 - ldr r0, =gUnknown_08616008 - ldr r2, [r4, 0x4] - ldrb r1, [r2, 0x4] - ldrb r2, [r2, 0x5] - movs r3, 0 - bl CreateSprite - strb r0, [r4, 0xC] - adds r0, r5, 0 - adds r1, r4, 0 - bl party_menu_update_status_condition_object - ldr r2, =gSprites - ldrb r0, [r4, 0xC] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r2, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x5] -_081B60D4: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end party_menu_link_mon_status_condition_object - - 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 party_menu_update_status_condition_object - pop {r4} - pop {r0} - bx r0 - thumb_func_end party_menu_get_status_condition_and_update_object - - 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 - lsrs r2, r0, 24 - cmp r2, 0 - beq _081B610C - cmp r2, 0x6 - bne _081B6128 -_081B610C: - ldr r2, =gSprites - ldrb r1, [r5, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - b _081B6152 - .pool -_081B6128: - ldrb r1, [r5, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =gSprites - adds r0, r4 - subs r1, r2, 0x1 - lsls r1, 24 - lsrs r1, 24 - bl StartSpriteAnim - ldrb r1, [r5, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 -_081B6152: - strb r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end party_menu_update_status_condition_object - - thumb_func_start sub_81B6160 -sub_81B6160: @ 81B6160 - push {lr} - ldr r0, =gUnknown_08615FF8 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_08616000 - bl LoadCompressedObjectPalette - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B6160 - - thumb_func_start sub_81B617C -sub_81B617C: @ 81B617C - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - ldr r0, =c2_815ABFC - mov r8, r0 - ldr r0, =gMain - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081B61BC - movs r7, 0x1 - bl sub_81B8984 - lsls r0, 24 - lsrs r6, r0, 24 - b _081B61C0 - .pool -_081B61B0: - ldr r0, =gUnknown_0203CEC8 - strb r5, [r0, 0x9] - b _081B6204 - .pool -_081B61BC: - movs r7, 0 - movs r6, 0 -_081B61C0: - ldr r4, =gUnknown_0203CE7C - ldrh r0, [r4] - bl GetItemEffectType - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xA - bne _081B621C - ldr r1, =gUnknown_0203CEC8 - movs r0, 0 - strb r0, [r1, 0x9] - movs r5, 0 -_081B61D8: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =gPlayerParty - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B61FA - adds r0, r4, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - beq _081B61B0 -_081B61FA: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x5 - bls _081B61D8 -_081B6204: - ldr r0, =sub_81B6280 - movs r1, 0x7F - b _081B6230 - .pool -_081B621C: - ldrh r0, [r4] - bl GetPocketByItemId - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x5 - cmp r0, 0x3 - bne _081B622E - movs r1, 0x4 -_081B622E: - ldr r0, =sub_81B1370 -_081B6230: - str r1, [sp] - str r0, [sp, 0x4] - mov r0, r8 - str r0, [sp, 0x8] - adds r0, r7, 0 - adds r1, r6, 0 - movs r2, 0x3 - movs r3, 0x1 - bl sub_81B0038 - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B617C - - thumb_func_start c2_815ABFC -c2_815ABFC: @ 81B6254 - push {lr} - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - bne _081B626C - movs r0, 0xC - movs r1, 0x5 - movs r2, 0 - bl GoToBagMenu - b _081B6276 -_081B626C: - ldr r0, =gUnknown_0203CF30 - ldr r1, [r0] - movs r0, 0x4 - bl sub_81C4F98 -_081B6276: - pop {r0} - bx r0 - .pool - thumb_func_end c2_815ABFC - - thumb_func_start sub_81B6280 -sub_81B6280: @ 81B6280 - push {lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B62B2 - ldr r0, =gUnknown_0203CEC8 - ldrb r1, [r0, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x1 - bne _081B62A6 - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - ldr r0, =sub_81B9140 - str r0, [r1, 0x4] -_081B62A6: - ldr r0, =gUnknown_03006328 - ldr r1, =sub_81B6794 - ldr r2, [r0] - adds r0, r3, 0 - bl _call_via_r2 -_081B62B2: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B6280 - - thumb_func_start IsHPRecoveryItem -@ bool8 IsHPRecoveryItem(u16 itemId) -IsHPRecoveryItem: @ 81B62D0 - push {lr} - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xAF - bne _081B62EC - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003214 - adds r0, r1 - b _081B62F6 - .pool -_081B62EC: - ldr r1, =gItemEffectInfoPointers - subs r0, 0xD - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] -_081B62F6: - ldrb r1, [r0, 0x4] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - bne _081B6308 - movs r0, 0 - b _081B630A - .pool -_081B6308: - movs r0, 0x1 -_081B630A: - pop {r1} - bx r1 - thumb_func_end IsHPRecoveryItem - - thumb_func_start GetMedicineItemEffectMessage -@ void GetMedicineItemEffectMessage(u16 itemId) -GetMedicineItemEffectMessage: @ 81B6310 - push {lr} - lsls r0, 16 - lsrs r0, 16 - bl GetItemEffectType - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x3 - cmp r0, 0x12 - bls _081B6326 - b _081B64BC -_081B6326: - lsls r0, 2 - ldr r1, =_081B6334 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081B6334: - .4byte _081B6380 - .4byte _081B6394 - .4byte _081B63A8 - .4byte _081B63BC - .4byte _081B63D0 - .4byte _081B63E4 - .4byte _081B63F8 - .4byte _081B64BC - .4byte _081B640C - .4byte _081B6430 - .4byte _081B6420 - .4byte _081B6460 - .4byte _081B6470 - .4byte _081B6450 - .4byte _081B6440 - .4byte _081B64BC - .4byte _081B6494 - .4byte _081B6494 - .4byte _081B64A8 -_081B6380: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9C3E - bl StringExpandPlaceholders - b _081B64C4 - .pool -_081B6394: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9C7C - bl StringExpandPlaceholders - b _081B64C4 - .pool -_081B63A8: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9C8A - bl StringExpandPlaceholders - b _081B64C4 - .pool -_081B63BC: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9CA2 - bl StringExpandPlaceholders - b _081B64C4 - .pool -_081B63D0: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9C5F - bl StringExpandPlaceholders - b _081B64C4 - .pool -_081B63E4: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9DBE - bl StringExpandPlaceholders - b _081B64C4 - .pool -_081B63F8: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9DE1 - bl StringExpandPlaceholders - b _081B64C4 - .pool -_081B640C: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9CE0 - bl StringExpandPlaceholders - b _081B64C4 - .pool -_081B6420: - ldr r0, =gStringVar2 - ldr r1, =gUnknown_085E96E3 - b _081B6474 - .pool -_081B6430: - ldr r0, =gStringVar2 - ldr r1, =gUnknown_085EA33C - b _081B6474 - .pool -_081B6440: - ldr r0, =gStringVar2 - ldr r1, =gUnknown_085EA343 - b _081B6474 - .pool -_081B6450: - ldr r0, =gStringVar2 - ldr r1, =gUnknown_085EA35B - b _081B6474 - .pool -_081B6460: - ldr r0, =gStringVar2 - ldr r1, =gUnknown_085E96E6 - b _081B6474 - .pool -_081B6470: - ldr r0, =gStringVar2 - ldr r1, =gUnknown_085E96EE -_081B6474: - bl StringCopy - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9D25 - bl StringExpandPlaceholders - b _081B64C4 - .pool -_081B6494: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9CF5 - bl StringExpandPlaceholders - b _081B64C4 - .pool -_081B64A8: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9CB7 - bl StringExpandPlaceholders - b _081B64C4 - .pool -_081B64BC: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E96F6 - bl StringExpandPlaceholders -_081B64C4: - pop {r0} - bx r0 - .pool - thumb_func_end GetMedicineItemEffectMessage - - thumb_func_start UsingHPEVItemOnShedinja -@ bool8 UsingHPEVItemOnShedinja(struct pokemon *mon, u16 itemId) -UsingHPEVItemOnShedinja: @ 81B64D0 - push {r4,lr} - adds r4, r0, 0 - lsls r0, r1, 16 - lsrs r0, 16 - bl GetItemEffectType - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xD - bne _081B64FC - adds r0, r4, 0 - movs r1, 0xB - bl GetMonData - ldr r1, =0x0000012f - cmp r0, r1 - bne _081B64FC - movs r0, 0 - b _081B64FE - .pool -_081B64FC: - movs r0, 0x1 -_081B64FE: - pop {r4} - pop {r1} - bx r1 - thumb_func_end UsingHPEVItemOnShedinja - - thumb_func_start IsBlueYellowRedFlute -@ bool8 IsBlueYellowRedFlute(u16 itemId) -IsBlueYellowRedFlute: @ 81B6504 - push {lr} - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x27 - beq _081B6516 - cmp r0, 0x29 - beq _081B6516 - cmp r0, 0x28 - bne _081B651A -_081B6516: - movs r0, 0x1 - b _081B651C -_081B651A: - movs r0, 0 -_081B651C: - pop {r1} - bx r1 - thumb_func_end IsBlueYellowRedFlute - - thumb_func_start ExecuteTableBasedItemEffect__ -@ bool8 ExecuteTableBasedItemEffect__(u8 partyMonIndex, u16 itemId, u8 monMoveIndex) -ExecuteTableBasedItemEffect__: @ 81B6520 - push {r4-r6,lr} - lsls r0, 24 - lsrs r3, r0, 24 - lsls r1, 16 - lsrs r5, r1, 16 - lsls r2, 24 - lsrs r6, r2, 24 - ldr r0, =gMain - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _081B6558 - movs r0, 0x64 - muls r0, r3 - ldr r1, =gPlayerParty - adds r0, r1 - adds r1, r5, 0 - adds r2, r3, 0 - b _081B6572 - .pool -_081B6558: - movs r0, 0x64 - adds r4, r3, 0 - muls r4, r0 - ldr r0, =gPlayerParty - adds r4, r0 - adds r0, r3, 0 - bl sub_81B8F38 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 -_081B6572: - adds r3, r6, 0 - bl ExecuteTableBasedItemEffect_ - lsls r0, 24 - lsrs r0, 24 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end ExecuteTableBasedItemEffect__ - - thumb_func_start ItemUseCB_Medicine -ItemUseCB_Medicine: @ 81B6588 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - str r1, [sp, 0x4] - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - movs r0, 0 - mov r10, r0 - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - ldr r0, =gUnknown_0203CE7C - ldrh r6, [r0] - adds r0, r5, 0 - adds r1, r6, 0 - bl UsingHPEVItemOnShedinja - lsls r0, 24 - cmp r0, 0 - beq _081B6600 - adds r0, r6, 0 - bl IsHPRecoveryItem - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - cmp r0, 0x1 - bne _081B65EE - adds r0, r5, 0 - movs r1, 0x39 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - adds r0, r5, 0 - movs r1, 0x3A - bl GetMonData - cmp r10, r0 - bne _081B65EE - movs r1, 0 - mov r8, r1 -_081B65EE: - ldr r4, =gUnknown_0203CEC8 - ldrb r0, [r4, 0x9] - adds r1, r6, 0 - movs r2, 0 - bl ExecuteTableBasedItemEffect__ - lsls r0, 24 - cmp r0, 0 - beq _081B6624 -_081B6600: - ldr r1, =gUnknown_0203CEE8 - movs r0, 0 - strb r0, [r1] - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_085E96F6 - b _081B66F4 - .pool -_081B6624: - ldr r1, =gUnknown_0203CEE8 - movs r0, 0x1 - strb r0, [r1] - adds r0, r6, 0 - bl IsBlueYellowRedFlute - lsls r0, 24 - cmp r0, 0 - bne _081B6650 - movs r0, 0x1 - bl PlaySE - ldrb r0, [r4, 0xB] - cmp r0, 0xE - beq _081B6656 - adds r0, r6, 0 - movs r1, 0x1 - bl RemoveBagItem - b _081B6656 - .pool -_081B6650: - movs r0, 0x75 - bl PlaySE -_081B6656: - ldr r4, =gUnknown_0203CEDC - ldr r7, =gUnknown_0203CEC8 - movs r0, 0x9 - ldrsb r0, [r7, r0] - lsls r0, 4 - ldr r1, [r4] - adds r1, r0 - adds r0, r5, 0 - bl party_menu_get_status_condition_and_update_object - ldr r2, =gSprites - movs r0, 0x9 - ldrsb r0, [r7, r0] - ldr r1, [r4] - lsls r0, 4 - adds r3, r0, r1 - ldrb r1, [r3, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - bge _081B6694 - adds r0, r5, 0 - adds r1, r3, 0 - movs r2, 0x1 - bl sub_81B2AC8 -_081B6694: - mov r2, r8 - cmp r2, 0x1 - bne _081B66E4 - mov r0, r10 - cmp r0, 0 - bne _081B66A8 - ldrb r0, [r7, 0x9] - movs r1, 0x1 - bl sub_81B0FCC -_081B66A8: - adds r0, r5, 0 - movs r1, 0x39 - bl GetMonData - adds r3, r0, 0 - mov r1, r10 - subs r3, r1 - lsls r3, 16 - asrs r3, 16 - ldrb r1, [r7, 0x9] - ldr r0, =sub_81B672C - str r0, [sp] - mov r0, r9 - movs r2, 0x1 - bl sub_81B1F18 - mov r0, r9 - movs r1, 0 - mov r2, r10 - bl sub_81B1FA8 - b _081B6710 - .pool -_081B66E4: - ldr r1, =gStringVar1 - adds r0, r5, 0 - bl GetMonNickname - adds r0, r6, 0 - bl GetMedicineItemEffectMessage - ldr r0, =gStringVar4 -_081B66F4: - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =gTasks - mov r2, r9 - lsls r0, r2, 2 - add r0, r9 - lsls r0, 3 - adds r0, r1 - ldr r1, [sp, 0x4] - str r1, [r0] -_081B6710: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end ItemUseCB_Medicine - - thumb_func_start sub_81B672C -sub_81B672C: @ 81B672C - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gStringVar1 - bl GetMonNickname - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9C17 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - bl sub_805EAE8 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B6794 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B672C - - thumb_func_start sub_81B6794 -sub_81B6794: @ 81B6794 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B67BA - ldr r0, =gUnknown_0203CEE8 - ldrb r1, [r0] - cmp r1, 0 - bne _081B67B4 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - str r1, [r0, 0x4] -_081B67B4: - adds r0, r4, 0 - bl sub_81B12C0 -_081B67BA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B6794 - - thumb_func_start sub_81B67C8 -sub_81B67C8: @ 81B67C8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - str r1, [sp] - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - ldr r4, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r4, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - ldr r0, =gUnknown_0203CE7C - ldrh r6, [r0] - adds r0, r6, 0 - bl GetItemEffectType - lsls r0, 24 - lsrs r7, r0, 24 - adds r0, r5, 0 - movs r1, 0x20 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x4] - adds r0, r5, 0 - adds r1, r7, 0 - bl sub_81B691C - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x8] - ldrb r0, [r4, 0x9] - adds r1, r6, 0 - movs r2, 0 - bl ExecuteTableBasedItemEffect__ - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x20 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - adds r0, r5, 0 - adds r1, r7, 0 - bl sub_81B691C - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - cmp r4, 0 - bne _081B6850 - ldr r0, [sp, 0x4] - cmp r0, r9 - bne _081B6874 - ldr r1, [sp, 0x8] - cmp r1, r8 - bne _081B6874 -_081B6850: - ldr r1, =gUnknown_0203CEE8 - movs r0, 0 - strb r0, [r1] - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_085E96F6 - b _081B68E2 - .pool -_081B6874: - ldr r1, =gUnknown_0203CEE8 - movs r0, 0x1 - strb r0, [r1] - movs r0, 0x1 - bl PlaySE - adds r0, r6, 0 - movs r1, 0x1 - bl RemoveBagItem - ldr r1, =gStringVar1 - adds r0, r5, 0 - bl GetMonNickname - ldr r1, =gStringVar2 - adds r0, r7, 0 - bl option_menu_get_string - ldr r2, [sp, 0x4] - cmp r2, r9 - beq _081B68D8 - ldr r0, [sp, 0x8] - cmp r0, r8 - beq _081B68C4 - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9D45 - bl StringExpandPlaceholders - b _081B68E0 - .pool -_081B68C4: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9D90 - bl StringExpandPlaceholders - b _081B68E0 - .pool -_081B68D8: - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9D6D - bl StringExpandPlaceholders -_081B68E0: - ldr r0, =gStringVar4 -_081B68E2: - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =gTasks - mov r2, r10 - lsls r0, r2, 2 - add r0, r10 - lsls r0, 3 - adds r0, r1 - ldr r1, [sp] - str r1, [r0] - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B67C8 - - thumb_func_start sub_81B691C -sub_81B691C: @ 81B691C - push {r4,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r1, 0 - subs r0, 0xC - cmp r0, 0x5 - bhi _081B6992 - lsls r0, 2 - ldr r1, =_081B693C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081B693C: - .4byte _081B696C - .4byte _081B6954 - .4byte _081B697E - .4byte _081B6984 - .4byte _081B6978 - .4byte _081B6972 -_081B6954: - adds r0, r4, 0 - movs r1, 0xB - bl GetMonData - ldr r1, =0x0000012f - cmp r0, r1 - beq _081B6992 - adds r0, r4, 0 - movs r1, 0x1A - b _081B6988 - .pool -_081B696C: - adds r0, r4, 0 - movs r1, 0x1B - b _081B6988 -_081B6972: - adds r0, r4, 0 - movs r1, 0x1C - b _081B6988 -_081B6978: - adds r0, r4, 0 - movs r1, 0x1D - b _081B6988 -_081B697E: - adds r0, r4, 0 - movs r1, 0x1E - b _081B6988 -_081B6984: - adds r0, r4, 0 - movs r1, 0x1F -_081B6988: - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - b _081B6994 -_081B6992: - movs r0, 0 -_081B6994: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81B691C - - thumb_func_start option_menu_get_string -option_menu_get_string: @ 81B699C - push {lr} - adds r2, r1, 0 - lsls r0, 24 - lsrs r0, 24 - subs r0, 0xC - cmp r0, 0x5 - bhi _081B6A08 - lsls r0, 2 - ldr r1, =_081B69B8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081B69B8: - .4byte _081B69D8 - .4byte _081B69D0 - .4byte _081B69F0 - .4byte _081B6A00 - .4byte _081B69E8 - .4byte _081B69E0 -_081B69D0: - ldr r1, =gUnknown_085E96E3 - b _081B69F2 - .pool -_081B69D8: - ldr r1, =gUnknown_085EA33C - b _081B69F2 - .pool -_081B69E0: - ldr r1, =gUnknown_085EA343 - b _081B69F2 - .pool -_081B69E8: - ldr r1, =gUnknown_085EA35B - b _081B69F2 - .pool -_081B69F0: - ldr r1, =gUnknown_085E96E6 -_081B69F2: - adds r0, r2, 0 - bl StringCopy - b _081B6A08 - .pool -_081B6A00: - ldr r1, =gUnknown_085E96EE - adds r0, r2, 0 - bl StringCopy -_081B6A08: - pop {r0} - bx r0 - .pool - thumb_func_end option_menu_get_string - - thumb_func_start sub_81B6A10 -sub_81B6A10: @ 81B6A10 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r7, 0 - movs r0, 0x1 - mov r10, r0 - movs r0, 0x3 - bl sub_81B31B0 - lsls r0, 24 - lsrs r6, r0, 24 - movs r5, 0 - movs r0, 0x64 - adds r1, r4, 0 - muls r1, r0 - mov r8, r1 - ldr r0, =gPlayerParty - mov r9, r0 -_081B6A40: - adds r1, r5, 0 - adds r1, 0xD - mov r0, r8 - add r0, r9 - bl GetMonData - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - movs r0, 0xD - adds r2, r4, 0 - muls r2, r0 - ldr r0, =gMoveNames - adds r2, r0 - lsls r0, r5, 4 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - adds r0, r6, 0 - mov r1, r10 - movs r3, 0x8 - bl Print - cmp r4, 0 - beq _081B6A82 - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 -_081B6A82: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _081B6A40 - adds r0, r6, 0 - adds r1, r7, 0 - movs r2, 0 - bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B6A10 - - thumb_func_start ether_effect_related_3 -ether_effect_related_3: @ 81B6AB4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - bl ProcessMenuInput - lsls r0, 24 - asrs r1, r0, 24 - movs r0, 0x2 - negs r0, r0 - cmp r1, r0 - beq _081B6AF0 - adds r0, 0x1 - cmp r1, r0 - bne _081B6AE0 - movs r0, 0x5 - bl PlaySE - adds r0, r4, 0 - bl sub_81B6BB4 - b _081B6AF0 -_081B6AE0: - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - adds r0, 0xD - bl sub_81B302C - adds r0, r5, 0 - bl ether_effect_related_2 -_081B6AF0: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ether_effect_related_3 - - thumb_func_start dp05_ether -dp05_ether: @ 81B6AFC - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - cmp r0, 0xAF - bne _081B6B20 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003214 - adds r0, r1 - b _081B6B2A - .pool -_081B6B20: - ldr r1, =gItemEffectInfoPointers - subs r0, 0xD - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] -_081B6B2A: - ldrb r1, [r0, 0x4] - movs r0, 0x10 - ands r0, r1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _081B6B4C - ldr r0, =gUnknown_0203CEC8 - strh r1, [r0, 0xE] - adds r0, r4, 0 - bl ether_effect_related - b _081B6B6E - .pool -_081B6B4C: - movs r0, 0x5 - bl PlaySE - movs r0, 0x16 - bl display_pokemon_menu_message - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0x9] - bl sub_81B6A10 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =ether_effect_related_3 - str r1, [r0] -_081B6B6E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp05_ether - - thumb_func_start ether_effect_related_2 -ether_effect_related_2: @ 81B6B80 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - adds r0, 0xC - bl sub_81B302C - bl GetMenuCursorPos - ldr r1, =gUnknown_0203CEC8 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r1, 0xE] - adds r0, r4, 0 - bl ether_effect_related - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ether_effect_related_2 - - thumb_func_start sub_81B6BB4 -sub_81B6BB4: @ 81B6BB4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r0, =sub_81B1370 - str r0, [r1] - ldr r0, =gUnknown_0203CEC4 - ldr r0, [r0] - movs r1, 0 - str r1, [r0, 0x4] - adds r0, 0xC - bl sub_81B302C - movs r0, 0x5 - bl display_pokemon_menu_message - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B6BB4 - - thumb_func_start ether_effect_related -ether_effect_related: @ 81B6BEC - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - movs r4, 0 - ldr r7, =gUnknown_0203CED6 - ldr r0, =gUnknown_0203CE7C - ldrh r5, [r0] - movs r0, 0xE - negs r0, r0 - adds r0, r7 - mov r8, r0 - ldrb r0, [r0, 0x9] - ldrb r2, [r7] - adds r1, r5, 0 - bl ExecuteTableBasedItemEffect__ - lsls r0, 24 - cmp r0, 0 - beq _081B6C34 - ldr r0, =gUnknown_0203CEE8 - strb r4, [r0] - movs r0, 0x5 - bl PlaySE - ldr r0, =gUnknown_085E96F6 - b _081B6C7E - .pool -_081B6C34: - ldr r1, =gUnknown_0203CEE8 - movs r0, 0x1 - strb r0, [r1] - mov r0, r8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - adds r4, r1, 0 - muls r4, r0 - ldr r0, =gPlayerParty - adds r4, r0 - movs r0, 0x1 - bl PlaySE - adds r0, r5, 0 - movs r1, 0x1 - bl RemoveBagItem - movs r0, 0 - ldrsh r1, [r7, r0] - adds r1, 0xD - adds r0, r4, 0 - bl GetMonData - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =gStringVar1 - movs r1, 0xD - muls r1, r4 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - adds r0, r5, 0 - bl GetMedicineItemEffectMessage - ldr r0, =gStringVar4 -_081B6C7E: - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B6794 - str r1, [r0] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end ether_effect_related - - thumb_func_start dp05_pp_up -dp05_pp_up: @ 81B6CC0 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x5 - bl PlaySE - movs r0, 0x17 - bl display_pokemon_menu_message - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0x9] - bl sub_81B6A10 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =ether_effect_related_3 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp05_pp_up - - thumb_func_start ItemIdToBattleMoveId -ItemIdToBattleMoveId: @ 81B6CFC - lsls r0, 16 - ldr r1, =0xfedf0000 - adds r0, r1 - ldr r1, =gUnknown_08616040 - lsrs r0, 15 - adds r0, r1 - ldrh r0, [r0] - bx lr - .pool - thumb_func_end ItemIdToBattleMoveId - - thumb_func_start sub_81B6D14 -sub_81B6D14: @ 81B6D14 - push {lr} - lsls r0, 16 - lsrs r2, r0, 16 - movs r1, 0 - ldr r3, =gUnknown_08616040 -_081B6D1E: - adds r0, r1, 0 - adds r0, 0x32 - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - cmp r0, r2 - bne _081B6D34 - movs r0, 0x1 - b _081B6D40 - .pool -_081B6D34: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x7 - bls _081B6D1E - movs r0, 0 -_081B6D40: - pop {r1} - bx r1 - thumb_func_end sub_81B6D14 - - thumb_func_start pokemon_has_move -pokemon_has_move: @ 81B6D44 - push {r4-r6,lr} - adds r6, r0, 0 - lsls r1, 16 - lsrs r5, r1, 16 - movs r4, 0 -_081B6D4E: - adds r1, r4, 0 - adds r1, 0xD - adds r0, r6, 0 - bl GetMonData - cmp r0, r5 - bne _081B6D60 - movs r0, 0x1 - b _081B6D6C -_081B6D60: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _081B6D4E - movs r0, 0 -_081B6D6C: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end pokemon_has_move - - thumb_func_start sub_81B6D74 -sub_81B6D74: @ 81B6D74 - push {r4,lr} - adds r1, r0, 0 - ldr r4, =gStringVar4 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B6D74 - - thumb_func_start sub_81B6D98 -sub_81B6D98: @ 81B6D98 - push {r4,lr} - adds r4, r0, 0 - adds r0, r1, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_81B6D74 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B6794 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B6D98 - - thumb_func_start sub_81B6DC4 -sub_81B6DC4: @ 81B6DC4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - movs r0, 0x5 - bl PlaySE - ldr r7, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r7, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - movs r0, 0xE - adds r0, r7 - mov r8, r0 - ldr r0, =gUnknown_0203CE7C - ldrh r4, [r0] - ldr r1, =gStringVar1 - adds r0, r5, 0 - bl GetMonNickname - adds r0, r4, 0 - bl ItemIdToBattleMoveId - strh r0, [r7, 0xE] - ldr r0, =gStringVar2 - movs r1, 0xE - ldrsh r2, [r7, r1] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - movs r0, 0 - mov r1, r8 - strh r0, [r1, 0x2] - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0 - bl sub_81B22D8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B6E70 - cmp r0, 0x2 - beq _081B6E78 - ldrh r1, [r7, 0xE] - adds r0, r5, 0 - bl pokemon_moveset_pad_ - lsls r0, 16 - ldr r1, =0xffff0000 - cmp r0, r1 - beq _081B6E88 - ldr r0, =gTasks - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B6EB4 - str r0, [r1] - b _081B6E9C - .pool -_081B6E70: - ldr r1, =gUnknown_085E9AB4 - b _081B6E7A - .pool -_081B6E78: - ldr r1, =gUnknown_085E9C00 -_081B6E7A: - adds r0, r6, 0 - bl sub_81B6D98 - b _081B6E9C - .pool -_081B6E88: - ldr r0, =gUnknown_085E9AE9 - bl sub_81B6D74 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B6FF4 - str r1, [r0] -_081B6E9C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B6DC4 - - thumb_func_start sub_81B6EB4 -sub_81B6EB4: @ 81B6EB4 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r2, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r2, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - adds r6, r2, 0 - adds r6, 0xE - ldr r0, =gUnknown_0203CE7C - ldrh r4, [r0] - movs r1, 0x2 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _081B6EF0 - adds r0, r5, 0 - movs r1, 0x4 - bl happiness_algorithm - movs r0, 0xA9 - lsls r0, 1 - cmp r4, r0 - bhi _081B6EF0 - adds r0, r4, 0 - movs r1, 0x1 - bl RemoveBagItem -_081B6EF0: - ldr r1, =gStringVar1 - adds r0, r5, 0 - bl GetMonNickname - ldr r0, =gStringVar2 - movs r1, 0 - ldrsh r2, [r6, r1] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9AA5 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B6F60 - str r1, [r0] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B6EB4 - - thumb_func_start sub_81B6F60 -sub_81B6F60: @ 81B6F60 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B6F86 - ldr r0, =0x0000016f - bl PlayFanfare - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B6F98 - str r1, [r0] -_081B6F86: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B6F60 - - thumb_func_start sub_81B6F98 -sub_81B6F98: @ 81B6F98 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - bl IsFanfareTaskInactive - lsls r0, 24 - cmp r0, 0 - beq _081B6FEA - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r2, 0x1 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - bne _081B6FC0 - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081B6FEA -_081B6FC0: - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x10 - ldrsh r0, [r0, r1] - cmp r0, 0x1 - bne _081B6FDC - adds r0, r4, 0 - bl sub_81B77AC - b _081B6FEA - .pool -_081B6FDC: - cmp r0, 0x2 - bne _081B6FE4 - ldr r0, =gScriptResult - strh r2, [r0] -_081B6FE4: - adds r0, r5, 0 - bl sub_81B12C0 -_081B6FEA: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B6F98 - - thumb_func_start sub_81B6FF4 -sub_81B6FF4: @ 81B6FF4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B7018 - bl sub_81B334C - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B7028 - str r0, [r1] -_081B7018: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B6FF4 - - thumb_func_start sub_81B7028 -sub_81B7028: @ 81B7028 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _081B704E - cmp r1, 0 - bgt _081B7048 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _081B7074 - b _081B7080 -_081B7048: - cmp r1, 0x1 - beq _081B707A - b _081B7080 -_081B704E: - ldr r0, =gUnknown_085E9B96 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B7088 - str r1, [r0] - b _081B7080 - .pool -_081B7074: - movs r0, 0x5 - bl PlaySE -_081B707A: - adds r0, r4, 0 - bl sub_81B7230 -_081B7080: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B7028 - - thumb_func_start sub_81B7088 -sub_81B7088: @ 81B7088 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B70A8 - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - ldr r0, =sub_81B70B8 - str r0, [r1, 0x4] - adds r0, r4, 0 - bl sub_81B12C0 -_081B70A8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B7088 - - thumb_func_start sub_81B70B8 -sub_81B70B8: @ 81B70B8 - push {r4,lr} - sub sp, 0x4 - ldr r0, =gPlayerParty - ldr r4, =gUnknown_0203CEC8 - ldrb r1, [r4, 0x9] - ldr r2, =gUnknown_020244E9 - ldrb r2, [r2] - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - ldr r3, =sub_81B70F0 - ldrh r4, [r4, 0xE] - str r4, [sp] - bl sub_81BFA38 - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B70B8 - - thumb_func_start sub_81B70F0 -sub_81B70F0: @ 81B70F0 - push {lr} - sub sp, 0xC - movs r0, 0x7F - str r0, [sp] - ldr r0, =sub_81B711C - str r0, [sp, 0x4] - ldr r0, =gUnknown_0203CEC8 - ldr r0, [r0] - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_81B0038 - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B70F0 - - thumb_func_start sub_81B711C -sub_81B711C: @ 81B711C - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B714E - bl sub_81C1B94 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - beq _081B7148 - adds r0, r4, 0 - bl sub_81B7154 - b _081B714E - .pool -_081B7148: - adds r0, r5, 0 - bl sub_81B7230 -_081B714E: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81B711C - - thumb_func_start sub_81B7154 -sub_81B7154: @ 81B7154 - push {r4-r6,lr} - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - adds r5, r1, 0 - muls r5, r0 - ldr r0, =gPlayerParty - adds r5, r0 - bl sub_81C1B94 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r1, 0xD - adds r0, r5, 0 - bl GetMonData - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r1, =gStringVar1 - adds r0, r5, 0 - bl GetMonNickname - ldr r0, =gStringVar2 - movs r1, 0xD - muls r1, r4 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - ldr r0, =gUnknown_085E9BB8 - bl sub_81B6D74 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B71D4 - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B7154 - - thumb_func_start sub_81B71D4 -sub_81B71D4: @ 81B71D4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B7220 - ldr r5, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r5, r1] - movs r0, 0x64 - adds r4, r1, 0 - muls r4, r0 - ldr r0, =gPlayerParty - adds r4, r0 - bl sub_81C1B94 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_806B9A8 - ldrh r5, [r5, 0xE] - bl sub_81C1B94 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80691F4 - adds r0, r6, 0 - bl sub_81B6EB4 -_081B7220: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B71D4 - - thumb_func_start sub_81B7230 -sub_81B7230: @ 81B7230 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gStringVar2 - ldr r1, =gUnknown_0203CEC8 - movs r3, 0xE - ldrsh r2, [r1, r3] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9B5D - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B7294 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B7230 - - thumb_func_start sub_81B7294 -sub_81B7294: @ 81B7294 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B72B8 - bl sub_81B334C - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B72C8 - str r0, [r1] -_081B72B8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B7294 - - thumb_func_start sub_81B72C8 -sub_81B72C8: @ 81B72C8 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r7, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r7, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r4, r1, r0 - bl sub_8198C58 - lsls r0, 24 - asrs r5, r0, 24 - cmp r5, 0 - beq _081B7306 - cmp r5, 0 - bgt _081B7300 - movs r0, 0x1 - negs r0, r0 - cmp r5, r0 - beq _081B738C - b _081B73C2 - .pool -_081B7300: - cmp r5, 0x1 - beq _081B7392 - b _081B73C2 -_081B7306: - ldr r1, =gStringVar1 - adds r0, r4, 0 - bl GetMonNickname - ldr r0, =gStringVar2 - movs r1, 0xE - ldrsh r2, [r7, r1] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9B76 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - movs r3, 0x10 - ldrsh r0, [r7, r3] - cmp r0, 0x1 - bne _081B7368 - ldr r0, =gTasks - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B73E4 - str r0, [r1] - b _081B73C2 - .pool -_081B7368: - cmp r0, 0x2 - bne _081B7370 - ldr r0, =gScriptResult - strh r5, [r0] -_081B7370: - ldr r0, =gTasks - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B6794 - str r0, [r1] - b _081B73C2 - .pool -_081B738C: - movs r0, 0x5 - bl PlaySE -_081B7392: - ldr r1, =gStringVar1 - adds r0, r4, 0 - bl GetMonNickname - ldr r0, =gStringVar2 - ldr r1, =gUnknown_0203CEC8 - movs r3, 0xE - ldrsh r2, [r1, r3] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - ldr r0, =gUnknown_085E9AE9 - bl sub_81B6D74 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B6FF4 - str r1, [r0] -_081B73C2: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B72C8 - - thumb_func_start sub_81B73E4 -sub_81B73E4: @ 81B73E4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B73FC - adds r0, r4, 0 - bl sub_81B77AC -_081B73FC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B73E4 - - thumb_func_start dp05_rare_candy -dp05_rare_candy: @ 81B7404 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r10, r1 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =gUnknown_0203CEC8 - mov r9, r0 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - ldr r0, =gUnknown_0203CEC4 - ldr r6, [r0] - movs r1, 0x86 - lsls r1, 2 - adds r4, r6, r1 - ldr r2, =gUnknown_0203CE7C - mov r8, r2 - adds r0, r5, 0 - movs r1, 0x38 - bl GetMonData - cmp r0, 0x64 - beq _081B7478 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_81B79A0 - mov r1, r9 - ldrb r0, [r1, 0x9] - mov r2, r8 - ldrh r1, [r2] - movs r2, 0 - bl ExecuteTableBasedItemEffect__ - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x89 - lsls r0, 2 - adds r1, r6, r0 - adds r0, r5, 0 - bl sub_81B79A0 - b _081B747A - .pool -_081B7478: - movs r4, 0x1 -_081B747A: - movs r0, 0x5 - bl PlaySE - cmp r4, 0 - beq _081B74B4 - ldr r1, =gUnknown_0203CEE8 - movs r0, 0 - strb r0, [r1] - ldr r0, =gUnknown_085E96F6 - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - mov r1, r10 - b _081B7516 - .pool -_081B74B4: - ldr r1, =gUnknown_0203CEE8 - movs r0, 0x1 - strb r0, [r1] - movs r0, 0 - bl PlayFanfareByFanfareNum - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0x9] - adds r1, r5, 0 - bl sub_81B754C - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - movs r1, 0x1 - bl RemoveBagItem - ldr r1, =gStringVar1 - adds r0, r5, 0 - bl GetMonNickname - ldr r4, =gStringVar2 - adds r0, r5, 0 - movs r1, 0x38 - bl GetMonData - adds r1, r0, 0 - adds r0, r4, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9D0A - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B75D4 -_081B7516: - str r1, [r0] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end dp05_rare_candy - - thumb_func_start sub_81B754C -sub_81B754C: @ 81B754C - push {r4-r7,lr} - adds r5, r1, 0 - lsls r0, 24 - lsrs r0, 24 - adds r7, r0, 0 - ldr r6, =gUnknown_0203CEDC - lsls r4, r7, 4 - ldr r1, [r6] - adds r1, r4 - adds r0, r5, 0 - bl party_menu_get_status_condition_and_update_object - ldr r2, =gSprites - ldr r0, [r6] - adds r3, r4, r0 - ldrb r1, [r3, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - bge _081B7588 - adds r0, r5, 0 - adds r1, r3, 0 - movs r2, 0x1 - bl sub_81B2AC8 -_081B7588: - ldr r1, [r6] - adds r1, r4 - adds r0, r5, 0 - movs r2, 0x1 - bl sub_81B2CD4 - ldr r1, [r6] - adds r1, r4 - adds r0, r5, 0 - movs r2, 0x1 - bl sub_81B2D74 - ldr r1, [r6] - adds r1, r4 - adds r0, r5, 0 - bl sub_81B2E28 - ldr r0, [r6] - adds r0, r4, r0 - ldrb r0, [r0, 0x9] - adds r1, r5, 0 - bl sub_81B5B38 - adds r0, r7, 0 - movs r1, 0x1 - bl sub_81B0FCC - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B754C - - thumb_func_start sub_81B75D4 -sub_81B75D4: @ 81B75D4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0 - bl WaitFanfare - lsls r0, 24 - cmp r0, 0 - beq _081B7620 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B7620 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081B7606 - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081B7620 -_081B7606: - movs r0, 0x5 - bl PlaySE - adds r0, r4, 0 - bl sub_81B767C - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B7634 - str r0, [r1] -_081B7620: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B75D4 - - thumb_func_start sub_81B7634 -sub_81B7634: @ 81B7634 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081B764E - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081B7668 -_081B764E: - movs r0, 0x5 - bl PlaySE - adds r0, r4, 0 - bl sub_81B76C8 - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B7704 - str r0, [r1] -_081B7668: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B7634 - - thumb_func_start sub_81B767C -sub_81B767C: @ 81B767C - push {r4,r5,lr} - sub sp, 0x8 - ldr r0, =gUnknown_0203CEC4 - ldr r5, [r0] - movs r0, 0x86 - lsls r0, 2 - adds r4, r5, r0 - bl sub_81B3364 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x18] - ldrh r0, [r4, 0x18] - movs r1, 0x89 - lsls r1, 2 - adds r2, r5, r1 - movs r1, 0x2 - str r1, [sp] - movs r1, 0x3 - str r1, [sp, 0x4] - adds r1, r4, 0 - movs r3, 0x1 - bl sub_81D3640 - ldrb r0, [r4, 0x18] - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B767C - - thumb_func_start sub_81B76C8 -sub_81B76C8: @ 81B76C8 - push {r4,lr} - sub sp, 0x4 - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - movs r0, 0x86 - lsls r0, 2 - adds r4, r1, r0 - ldrh r0, [r4, 0x18] - movs r2, 0x89 - lsls r2, 2 - adds r1, r2 - movs r2, 0x3 - str r2, [sp] - movs r2, 0x1 - movs r3, 0x2 - bl sub_81D3784 - ldrb r0, [r4, 0x18] - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B76C8 - - thumb_func_start sub_81B7704 -sub_81B7704: @ 81B7704 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0 - bl WaitFanfare - lsls r0, 24 - cmp r0, 0 - beq _081B77A6 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r6, 0x1 - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - bne _081B772C - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081B77A6 -_081B772C: - bl sub_81B3394 - ldr r4, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r4, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x1 - bl sub_8069318 - lsls r0, 16 - lsrs r1, r0, 16 - strh r6, [r4, 0x10] - ldr r0, =0x0000fffe - cmp r1, r0 - beq _081B7788 - cmp r1, r0 - bgt _081B776C - cmp r1, 0 - beq _081B7778 - b _081B77A0 - .pool -_081B776C: - ldr r0, =0x0000ffff - cmp r1, r0 - beq _081B7780 - b _081B77A0 - .pool -_081B7778: - adds r0, r5, 0 - bl sub_81B7810 - b _081B77A6 -_081B7780: - adds r0, r5, 0 - bl sub_81B787C - b _081B77A6 -_081B7788: - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B77AC - str r0, [r1] - b _081B77A6 - .pool -_081B77A0: - adds r0, r5, 0 - bl sub_81B7910 -_081B77A6: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81B7704 - - thumb_func_start sub_81B77AC -sub_81B77AC: @ 81B77AC - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0 - bl sub_8069318 - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, =0x0000fffe - cmp r1, r0 - beq _081B780A - cmp r1, r0 - bgt _081B77E8 - cmp r1, 0 - beq _081B77F4 - b _081B7804 - .pool -_081B77E8: - ldr r0, =0x0000ffff - cmp r1, r0 - beq _081B77FC - b _081B7804 - .pool -_081B77F4: - adds r0, r4, 0 - bl sub_81B7810 - b _081B780A -_081B77FC: - adds r0, r4, 0 - bl sub_81B787C - b _081B780A -_081B7804: - adds r0, r4, 0 - bl sub_81B7910 -_081B780A: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81B77AC - - thumb_func_start sub_81B7810 -sub_81B7810: @ 81B7810 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r6, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r6, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r7, r1, r0 - adds r0, r7, 0 - movs r1, 0 - movs r2, 0 - bl GetEvolutionTargetSpecies - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0 - beq _081B7860 - bl sub_81B06F4 - ldr r0, =gUnknown_030061E8 - ldr r1, [r6] - str r1, [r0] - ldrb r3, [r6, 0x9] - adds r0, r7, 0 - adds r1, r4, 0 - movs r2, 0x1 - bl sub_813DA40 - adds r0, r5, 0 - bl DestroyTask - b _081B786E - .pool -_081B7860: - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B6794 - str r0, [r1] -_081B786E: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B7810 - - thumb_func_start sub_81B787C -sub_81B787C: @ 81B787C - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_0203CEC8 - mov r8, r0 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gStringVar1 - bl GetMonNickname - ldr r0, =gStringVar2 - ldr r6, =gUnknown_020244E2 - ldrh r2, [r6] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9AE9 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldrh r0, [r6] - mov r1, r8 - strh r0, [r1, 0xE] - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B6FF4 - str r1, [r0] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B787C - - thumb_func_start sub_81B7910 -sub_81B7910: @ 81B7910 - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r6, r0, 0 - adds r5, r1, 0 - lsls r6, 24 - lsrs r6, 24 - lsls r5, 16 - lsrs r5, 16 - ldr r0, =gUnknown_0203CEC8 - mov r8, r0 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gStringVar1 - bl GetMonNickname - ldr r0, =gStringVar2 - movs r1, 0xD - muls r1, r5 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9AA5 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - mov r0, r8 - strh r5, [r0, 0xE] - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B6F60 - str r1, [r0] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B7910 - - thumb_func_start sub_81B79A0 -sub_81B79A0: @ 81B79A0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r1, 0x3A - bl GetMonData - strh r0, [r5] - adds r0, r4, 0 - movs r1, 0x3B - bl GetMonData - strh r0, [r5, 0x2] - adds r0, r4, 0 - movs r1, 0x3C - bl GetMonData - strh r0, [r5, 0x4] - adds r0, r4, 0 - movs r1, 0x3E - bl GetMonData - strh r0, [r5, 0x8] - adds r0, r4, 0 - movs r1, 0x3F - bl GetMonData - strh r0, [r5, 0xA] - adds r0, r4, 0 - movs r1, 0x3D - bl GetMonData - strh r0, [r5, 0x6] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81B79A0 - - thumb_func_start sub_81B79E8 -sub_81B79E8: @ 81B79E8 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0203CEC4 - ldr r2, [r1] - movs r3, 0x86 - lsls r3, 2 - adds r1, r2, r3 - movs r3, 0 - strh r3, [r1] - ldr r4, =0x0000021a - adds r1, r2, r4 - strh r3, [r1] - ldr r1, =gUnknown_0203CEC8 - ldrb r1, [r1, 0x9] - lsls r1, 24 - asrs r1, 24 - movs r3, 0x87 - lsls r3, 2 - adds r2, r3 - strh r1, [r2] - bl sub_81B7A28 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B79E8 - - thumb_func_start sub_81B7A28 -sub_81B7A28: @ 81B7A28 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - mov r8, r4 - ldr r6, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r6, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B7A6E - adds r0, r5, 0 - movs r1, 0x39 - bl GetMonData - lsls r0, 16 - lsrs r7, r0, 16 - ldrb r0, [r6, 0x9] - ldr r1, =gUnknown_0203CE7C - ldrh r1, [r1] - movs r2, 0 - bl ExecuteTableBasedItemEffect__ - lsls r0, 24 - cmp r0, 0 - beq _081B7A94 -_081B7A6E: - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =task_intro_gamefreak - str r0, [r1] - b _081B7B2A - .pool -_081B7A94: - movs r0, 0x1 - bl PlaySE - ldr r4, =gUnknown_0203CEDC - movs r0, 0x9 - ldrsb r0, [r6, r0] - lsls r0, 4 - ldr r1, [r4] - adds r1, r0 - adds r0, r5, 0 - bl party_menu_get_status_condition_and_update_object - ldr r2, =gSprites - movs r0, 0x9 - ldrsb r0, [r6, r0] - ldr r1, [r4] - lsls r0, 4 - adds r3, r0, r1 - ldrb r1, [r3, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - bge _081B7AD6 - adds r0, r5, 0 - adds r1, r3, 0 - movs r2, 0x1 - bl sub_81B2AC8 -_081B7AD6: - ldr r4, =gUnknown_0203CEC4 - ldr r0, [r4] - movs r1, 0x87 - lsls r1, 2 - adds r0, r1 - ldrb r0, [r0] - movs r1, 0 - bl sub_81B0FCC - ldrb r0, [r6, 0x9] - movs r1, 0x1 - bl sub_81B0FCC - adds r0, r5, 0 - movs r1, 0x39 - bl GetMonData - adds r3, r0, 0 - subs r3, r7 - lsls r3, 16 - asrs r3, 16 - ldrb r1, [r6, 0x9] - ldr r0, =sub_81B7C10 - str r0, [sp] - mov r0, r8 - movs r2, 0x1 - bl sub_81B1F18 - mov r0, r8 - movs r1, 0 - adds r2, r7, 0 - bl sub_81B1FA8 - ldr r0, [r4] - movs r2, 0x86 - lsls r2, 2 - adds r1, r0, r2 - movs r2, 0x1 - strh r2, [r1] - ldr r1, =0x0000021a - adds r0, r1 - strh r2, [r0] -_081B7B2A: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B7A28 - - thumb_func_start task_intro_gamefreak -task_intro_gamefreak: @ 81B7B4C - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B7C0A - ldr r5, =gUnknown_0203CEC4 - ldr r2, [r5] - movs r0, 0x86 - lsls r0, 2 - adds r1, r2, r0 - movs r3, 0 - ldrsh r0, [r1, r3] - ldr r3, =gUnknown_0203CEC8 - cmp r0, 0x1 - bne _081B7B82 - movs r0, 0 - strh r0, [r1] - movs r1, 0x9 - ldrsb r1, [r3, r1] - movs r6, 0x87 - lsls r6, 2 - adds r0, r2, r6 - strh r1, [r0] -_081B7B82: - ldrb r0, [r3, 0x9] - adds r0, 0x1 - strb r0, [r3, 0x9] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0x6 - bne _081B7C04 - ldr r0, [r5] - ldr r1, =0x0000021a - adds r0, r1 - movs r2, 0 - ldrsh r1, [r0, r2] - cmp r1, 0 - bne _081B7BC8 - ldr r0, =gUnknown_0203CEE8 - strb r1, [r0] - ldr r0, =gUnknown_085E96F6 - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - b _081B7BD8 - .pool -_081B7BC8: - ldr r1, =gUnknown_0203CEE8 - movs r0, 0x1 - strb r0, [r1] - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - movs r1, 0x1 - bl RemoveBagItem -_081B7BD8: - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B6794 - str r1, [r0] - ldr r1, =gUnknown_0203CEC8 - movs r0, 0 - strb r0, [r1, 0x9] - b _081B7C0A - .pool -_081B7C04: - adds r0, r4, 0 - bl sub_81B7A28 -_081B7C0A: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end task_intro_gamefreak - - thumb_func_start sub_81B7C10 -sub_81B7C10: @ 81B7C10 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gStringVar1 - bl GetMonNickname - ldr r4, =gStringVar4 - ldr r1, =gUnknown_085E9C17 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r4, 0 - movs r1, 0 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =task_intro_gamefreak - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B7C10 - - thumb_func_start sub_81B7C74 -sub_81B7C74: @ 81B7C74 - push {r4-r6,lr} - adds r6, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0x5 - bl PlaySE - ldr r2, =gUnknown_030061E8 - ldr r1, =gUnknown_0203CEC8 - ldr r0, [r1] - str r0, [r2] - ldrb r0, [r1, 0x9] - ldr r4, =gUnknown_0203CE7C - ldrh r1, [r4] - movs r2, 0 - bl ExecuteTableBasedItemEffect__ - lsls r0, 24 - cmp r0, 0 - beq _081B7CD8 - ldr r1, =gUnknown_0203CEE8 - movs r0, 0 - strb r0, [r1] - ldr r0, =gUnknown_085E96F6 - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - str r6, [r0] - b _081B7CE4 - .pool -_081B7CD8: - ldrh r0, [r4] - movs r1, 0x1 - bl RemoveBagItem - bl sub_81B06F4 -_081B7CE4: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81B7C74 - - thumb_func_start GetItemEffectType -@ u8 GetItemEffectType(u16 itemId) -GetItemEffectType: @ 81B7CEC - push {r4,r5,lr} - lsls r0, 16 - lsrs r1, r0, 16 - adds r2, r1, 0 - subs r2, 0xD - lsls r0, r2, 16 - lsrs r0, 16 - cmp r0, 0xA5 - bls _081B7D00 - b _081B7E40 -_081B7D00: - cmp r1, 0xAF - bne _081B7D18 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003214 - adds r4, r0, r1 - b _081B7D20 - .pool -_081B7D18: - ldr r1, =gItemEffectInfoPointers - lsls r0, r2, 2 - adds r0, r1 - ldr r4, [r0] -_081B7D20: - ldrb r1, [r4] - movs r5, 0x3F - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - bne _081B7D42 - ldrb r0, [r4, 0x1] - cmp r0, 0 - bne _081B7D42 - ldrb r0, [r4, 0x2] - cmp r0, 0 - bne _081B7D42 - ldrb r3, [r4, 0x3] - movs r0, 0x80 - ands r0, r3 - cmp r0, 0 - beq _081B7D4C -_081B7D42: - movs r0, 0 - b _081B7E46 - .pool -_081B7D4C: - movs r2, 0x40 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _081B7D5A - movs r0, 0xA - b _081B7E46 -_081B7D5A: - adds r0, r2, 0 - ands r0, r3 - cmp r0, 0 - beq _081B7D66 - movs r0, 0x1 - b _081B7E46 -_081B7D66: - adds r2, r5, 0 - ands r2, r3 - cmp r2, 0 - bne _081B7D74 - lsrs r0, r1, 7 - cmp r0, 0 - beq _081B7DB6 -_081B7D74: - cmp r2, 0x20 - bne _081B7D7C - movs r0, 0x4 - b _081B7E46 -_081B7D7C: - cmp r2, 0x10 - bne _081B7D84 - movs r0, 0x3 - b _081B7E46 -_081B7D84: - cmp r2, 0x8 - bne _081B7D8C - movs r0, 0x5 - b _081B7E46 -_081B7D8C: - cmp r2, 0x4 - bne _081B7D94 - movs r0, 0x6 - b _081B7E46 -_081B7D94: - cmp r2, 0x2 - bne _081B7D9C - movs r0, 0x7 - b _081B7E46 -_081B7D9C: - cmp r2, 0x1 - bne _081B7DA4 - movs r0, 0x8 - b _081B7E46 -_081B7DA4: - lsrs r0, r1, 7 - cmp r0, 0 - beq _081B7DB2 - cmp r2, 0 - bne _081B7DB2 - movs r0, 0x9 - b _081B7E46 -_081B7DB2: - movs r0, 0xB - b _081B7E46 -_081B7DB6: - ldrb r1, [r4, 0x4] - movs r0, 0x44 - ands r0, r1 - adds r2, r1, 0 - cmp r0, 0 - beq _081B7DC6 - movs r0, 0x2 - b _081B7E46 -_081B7DC6: - movs r5, 0x2 - adds r0, r5, 0 - ands r0, r2 - cmp r0, 0 - beq _081B7DD4 - movs r0, 0xC - b _081B7E46 -_081B7DD4: - movs r3, 0x1 - adds r0, r3, 0 - ands r0, r2 - cmp r0, 0 - beq _081B7DE2 - movs r0, 0xD - b _081B7E46 -_081B7DE2: - ldrb r1, [r4, 0x5] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _081B7DF0 - movs r0, 0xE - b _081B7E46 -_081B7DF0: - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _081B7DFC - movs r0, 0xF - b _081B7E46 -_081B7DFC: - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _081B7E08 - movs r0, 0x10 - b _081B7E46 -_081B7E08: - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _081B7E14 - movs r0, 0x11 - b _081B7E46 -_081B7E14: - movs r0, 0x80 - ands r0, r2 - cmp r0, 0 - beq _081B7E20 - movs r0, 0x12 - b _081B7E46 -_081B7E20: - movs r0, 0x20 - ands r0, r2 - cmp r0, 0 - beq _081B7E2C - movs r0, 0x13 - b _081B7E46 -_081B7E2C: - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _081B7E38 - movs r0, 0x14 - b _081B7E46 -_081B7E38: - movs r0, 0x18 - ands r0, r2 - cmp r0, 0 - bne _081B7E44 -_081B7E40: - movs r0, 0x16 - b _081B7E46 -_081B7E44: - movs r0, 0x15 -_081B7E46: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end GetItemEffectType - - thumb_func_start sub_81B7E4C -sub_81B7E4C: @ 81B7E4C - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B7F1C - ldr r7, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r7, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - movs r0, 0xE - adds r0, r7 - mov r8, r0 - ldr r1, =gStringVar1 - adds r0, r5, 0 - bl GetMonNickname - ldr r4, =gSpecialVar_0x8005 - ldrb r0, [r4] - bl sub_81B2360 - strh r0, [r7, 0xE] - ldr r0, =gStringVar2 - movs r1, 0xE - ldrsh r2, [r7, r1] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - movs r0, 0x2 - mov r1, r8 - strh r0, [r1, 0x2] - ldrb r2, [r4] - adds r0, r5, 0 - movs r1, 0 - bl sub_81B22D8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B7EF0 - cmp r0, 0x2 - beq _081B7EF8 - ldrh r1, [r7, 0xE] - adds r0, r5, 0 - bl pokemon_moveset_pad_ - lsls r0, 16 - ldr r1, =0xffff0000 - cmp r0, r1 - beq _081B7F08 - adds r0, r6, 0 - bl sub_81B6EB4 - b _081B7F1C - .pool -_081B7EF0: - ldr r1, =gUnknown_085E9AB4 - b _081B7EFA - .pool -_081B7EF8: - ldr r1, =gUnknown_085E9C00 -_081B7EFA: - adds r0, r6, 0 - bl sub_81B6D98 - b _081B7F1C - .pool -_081B7F08: - ldr r0, =gUnknown_085E9AE9 - bl sub_81B6D74 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B6FF4 - str r1, [r0] -_081B7F1C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B7E4C - - thumb_func_start CB2_PartyMenuFromStartMenu -CB2_PartyMenuFromStartMenu: @ 81B7F34 - push {lr} - sub sp, 0xC - movs r0, 0 - str r0, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - ldr r0, =sub_8086194 - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl sub_81B0038 - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end CB2_PartyMenuFromStartMenu - - thumb_func_start sub_81B7F60 -sub_81B7F60: @ 81B7F60 - push {lr} - sub sp, 0xC - bl InBattlePyramid - lsls r0, 24 - ldr r1, =sub_81C4F84 - cmp r0, 0 - bne _081B7F72 - ldr r1, =c2_815ABFC -_081B7F72: - movs r0, 0x6 - str r0, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - str r1, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0x5 - movs r3, 0 - bl sub_81B0038 - ldr r1, =gUnknown_0203CEC8 - ldr r0, =gUnknown_0203CE7C - ldrh r0, [r0] - strh r0, [r1, 0xC] - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B7F60 - - thumb_func_start sub_81B7FAC -sub_81B7FAC: @ 81B7FAC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r4, r0, 24 - adds r6, r4, 0 - ldr r5, =gUnknown_0203CEFC - ldr r0, =gUnknown_0203CEC8 - mov r9, r0 - ldrb r0, [r0, 0x9] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x64 - mov r8, r1 - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - ldr r7, =gPlayerParty - adds r0, r7 - movs r1, 0xC - bl GetMonData - strh r0, [r5] - lsls r0, 16 - cmp r0, 0 - bne _081B7FF8 - adds r0, r4, 0 - bl sub_81B8044 - b _081B8030 - .pool -_081B7FF8: - ldrh r0, [r5] - bl itemid_is_mail - lsls r0, 24 - cmp r0, 0 - beq _081B800C - adds r0, r4, 0 - bl sub_81B83B8 - b _081B8030 -_081B800C: - mov r1, r9 - movs r0, 0x9 - ldrsb r0, [r1, r0] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r7 - ldrh r1, [r5] - movs r2, 0x1 - bl sub_81B1D1C - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B82A0 - str r1, [r0] -_081B8030: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B7FAC - - thumb_func_start sub_81B8044 -sub_81B8044: @ 81B8044 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r5, =gUnknown_0203CEC8 - ldrh r0, [r5, 0xC] - bl itemid_is_mail - lsls r0, 24 - cmp r0, 0 - beq _081B807C - ldrh r0, [r5, 0xC] - bl sub_81B83F0 - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - ldr r0, =sub_81B814C - str r0, [r1, 0x4] - adds r0, r4, 0 - bl sub_81B12C0 - b _081B8082 - .pool -_081B807C: - adds r0, r4, 0 - bl sub_81B8088 -_081B8082: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81B8044 - - thumb_func_start sub_81B8088 -sub_81B8088: @ 81B8088 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B80E4 - ldr r4, =gUnknown_0203CEC8 - ldrh r5, [r4, 0xC] - movs r0, 0x9 - ldrsb r0, [r4, r0] - movs r1, 0x64 - mov r8, r1 - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - ldr r6, =gPlayerParty - adds r0, r6 - adds r1, r5, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_81B1C84 - movs r0, 0x9 - ldrsb r0, [r4, r0] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r6 - adds r1, r5, 0 - bl sub_81B1DB8 - adds r0, r5, 0 - bl sub_81B83F0 - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B8104 - str r1, [r0] -_081B80E4: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8088 - - thumb_func_start sub_81B8104 -sub_81B8104: @ 81B8104 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gUnknown_0203CEC8 - ldrb r4, [r0, 0x9] - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B8138 - lsls r2, r4, 24 - asrs r2, 24 - movs r0, 0x64 - muls r0, r2 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gUnknown_0203CEDC - lsls r2, 4 - ldr r1, [r1] - adds r1, r2 - bl sub_81B5C94 - adds r0, r5, 0 - bl sub_81B12C0 -_081B8138: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8104 - - thumb_func_start sub_81B814C -sub_81B814C: @ 81B814C - push {r4-r6,lr} - ldr r4, =gUnknown_0203CEC8 - movs r0, 0x9 - ldrsb r0, [r4, r0] - movs r6, 0x64 - muls r0, r6 - ldr r5, =gPlayerParty - adds r0, r5 - ldrh r1, [r4, 0xC] - bl sub_81B1DB8 - movs r0, 0x9 - ldrsb r0, [r4, r0] - muls r0, r6 - adds r0, r5 - movs r1, 0x40 - bl GetMonData - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gSaveBlock1Ptr - lsls r2, r0, 3 - adds r2, r0 - lsls r2, 2 - ldr r0, =0x00002be0 - adds r2, r0 - ldr r1, [r1] - adds r1, r2 - ldr r2, =sub_81B81A8 - movs r0, 0x4 - movs r3, 0x3 - bl sub_811A20C - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B814C - - thumb_func_start sub_81B81A8 -sub_81B81A8: @ 81B81A8 - push {r4-r7,lr} - sub sp, 0xC - ldr r6, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r6, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r7, r0, 16 - ldr r0, =gScriptResult - ldrh r0, [r0] - cmp r0, 0 - bne _081B8208 - adds r0, r5, 0 - bl sub_80D4680 - ldr r4, =gUnknown_0203CEFC - adds r0, r5, 0 - movs r1, 0xC - adds r2, r4, 0 - bl SetMonData - ldrh r0, [r4] - movs r1, 0x1 - bl RemoveBagItem - adds r0, r7, 0 - bl sub_81B841C - ldr r0, [r6] - bl SetMainCallback2 - b _081B8224 - .pool -_081B8208: - ldrb r0, [r6, 0x8] - lsls r0, 28 - lsrs r0, 28 - ldrb r2, [r6, 0xB] - movs r1, 0x7F - str r1, [sp] - ldr r1, =sub_81B8230 - str r1, [sp, 0x4] - ldr r1, [r6] - str r1, [sp, 0x8] - movs r1, 0xFF - movs r3, 0x1 - bl sub_81B0038 -_081B8224: - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B81A8 - - thumb_func_start sub_81B8230 -sub_81B8230: @ 81B8230 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B828A - ldr r1, =gUnknown_0203CEFC - ldrh r0, [r1] - cmp r0, 0 - beq _081B8264 - ldr r0, =gUnknown_0203CEC8 - ldrh r0, [r0, 0xC] - ldrh r1, [r1] - movs r2, 0 - bl sub_81B1D68 - b _081B827C - .pool -_081B8264: - ldr r2, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r2, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - ldrh r1, [r2, 0xC] - movs r2, 0 - movs r3, 0x1 - bl sub_81B1C84 -_081B827C: - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B8104 - str r0, [r1] -_081B828A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8230 - - thumb_func_start sub_81B82A0 -sub_81B82A0: @ 81B82A0 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B82C4 - bl sub_81B334C - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B82D4 - str r0, [r1] -_081B82C4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B82A0 - - thumb_func_start sub_81B82D4 -sub_81B82D4: @ 81B82D4 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _081B82FA - cmp r1, 0 - bgt _081B82F4 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _081B8394 - b _081B83A8 -_081B82F4: - cmp r1, 0x1 - beq _081B839A - b _081B83A8 -_081B82FA: - ldr r7, =gUnknown_0203CEC8 - ldrh r4, [r7, 0xC] - adds r0, r4, 0 - bl sub_81B83F0 - ldr r6, =gUnknown_0203CEFC - ldrh r0, [r6] - movs r1, 0x1 - bl AddBagItem - lsls r0, 24 - cmp r0, 0 - bne _081B8338 - adds r0, r4, 0 - bl sub_81B841C - ldrh r0, [r6] - bl pokemon_item_not_removed - ldr r0, =gStringVar4 - movs r1, 0 - bl sub_81B1B5C - b _081B8378 - .pool -_081B8338: - adds r0, r4, 0 - bl itemid_is_mail - lsls r0, 24 - cmp r0, 0 - beq _081B835C - ldr r0, =gUnknown_0203CEC4 - ldr r1, [r0] - ldr r0, =sub_81B814C - str r0, [r1, 0x4] - adds r0, r5, 0 - bl sub_81B12C0 - b _081B83A8 - .pool -_081B835C: - movs r1, 0x9 - ldrsb r1, [r7, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - adds r1, r4, 0 - bl sub_81B1DB8 - ldrh r1, [r6] - adds r0, r4, 0 - movs r2, 0x1 - bl sub_81B1D68 -_081B8378: - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B8104 - str r1, [r0] - b _081B83A8 - .pool -_081B8394: - movs r0, 0x5 - bl PlaySE -_081B839A: - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B8104 - str r0, [r1] -_081B83A8: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B82D4 - - thumb_func_start sub_81B83B8 -sub_81B83B8: @ 81B83B8 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_085E98EC - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B8104 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B83B8 - - thumb_func_start sub_81B83F0 -sub_81B83F0: @ 81B83F0 - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0xB] - cmp r0, 0x6 - bne _081B8410 - lsls r0, r1, 24 - lsrs r0, 24 - movs r1, 0x1 - bl sub_80D6E48 - b _081B8418 - .pool -_081B8410: - adds r0, r1, 0 - movs r1, 0x1 - bl RemoveBagItem -_081B8418: - pop {r0} - bx r0 - thumb_func_end sub_81B83F0 - - thumb_func_start sub_81B841C -sub_81B841C: @ 81B841C - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0xB] - cmp r0, 0x5 - beq _081B8438 - adds r0, r1, 0 - movs r1, 0x1 - bl sub_80D6D70 - b _081B8440 - .pool -_081B8438: - adds r0, r1, 0 - movs r1, 0x1 - bl AddBagItem -_081B8440: - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_81B841C - - thumb_func_start sub_81B8448 -sub_81B8448: @ 81B8448 - push {lr} - sub sp, 0xC - movs r0, 0x6 - str r0, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - ldr r0, =sub_816BB28 - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0x7 - movs r3, 0 - bl sub_81B0038 - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8448 - - thumb_func_start sub_81B8474 -sub_81B8474: @ 81B8474 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =gUnknown_0203CEC8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - ldr r1, =gUnknown_0203CEE8 - movs r0, 0 - strb r0, [r1] - ldr r2, =gSaveBlock1Ptr - ldr r0, =gUnknown_0203BCB8 - ldrh r1, [r0] - adds r1, 0x6 - ldrh r0, [r0, 0x2] - adds r1, r0 - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x00002be0 - adds r0, r1 - ldr r1, [r2] - adds r4, r1, r0 - adds r0, r5, 0 - movs r1, 0xC - bl GetMonData - cmp r0, 0 - beq _081B84DC - ldr r0, =gUnknown_085E9A08 - movs r1, 0x1 - bl sub_81B1B5C - b _081B84F2 - .pool -_081B84DC: - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_80D460C - adds r0, r4, 0 - bl sub_80D439C - ldr r0, =gUnknown_085E9A40 - movs r1, 0x1 - bl sub_81B1B5C -_081B84F2: - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r0, =gTasks - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B8104 - str r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8474 - - thumb_func_start sub_81B8518 -sub_81B8518: @ 81B8518 - push {lr} - sub sp, 0xC - bl sub_81B8558 - movs r0, 0 - str r0, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - ldr r0, =gMain - ldr r0, [r0, 0x8] - str r0, [sp, 0x8] - movs r0, 0x4 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl sub_81B0038 - ldr r1, =gUnknown_0203CEC8 - ldr r0, =sub_81B879C - str r0, [r1, 0x4] - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8518 - - thumb_func_start sub_81B8558 -sub_81B8558: @ 81B8558 - push {lr} - ldr r0, =gUnknown_0203CEF8 - movs r1, 0 - movs r2, 0x4 - bl memset - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8558 - - thumb_func_start sub_81B856C -sub_81B856C: @ 81B856C - push {r4,lr} - lsls r0, 24 - asrs r4, r0, 24 - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - adds r0, r1 - bl sub_81B85AC - lsls r0, 24 - cmp r0, 0 - bne _081B858C - movs r0, 0x2 - b _081B85A4 - .pool -_081B858C: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r0, 24 - bl sub_81B8770 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B85A2 - movs r0, 0 - b _081B85A4 -_081B85A2: - movs r0, 0x1 -_081B85A4: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81B856C - - thumb_func_start sub_81B85AC -sub_81B85AC: @ 81B85AC - push {r4-r6,lr} - adds r5, r0, 0 - movs r6, 0 - movs r1, 0x2D - bl GetMonData - cmp r0, 0 - bne _081B8608 - adds r0, r5, 0 - movs r1, 0x38 - bl GetMonData - adds r4, r0, 0 - bl sub_81B8888 - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bhi _081B8608 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldrh r1, [r0, 0x4] - ldr r0, =0x0000191a - cmp r1, r0 - bne _081B85EA - adds r0, r5, 0 - movs r1, 0xC - bl GetMonData - cmp r0, 0 - bne _081B8608 -_081B85EA: - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x8 - beq _081B864A - cmp r0, 0x9 - bne _081B8618 - adds r0, r5, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - bne _081B864A -_081B8608: - movs r0, 0 - b _081B864C - .pool -_081B8618: - adds r0, r5, 0 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r4, r0, 16 - ldr r3, =gUnknown_08611C9A - lsls r1, r6, 1 - adds r0, r1, r3 - ldrh r0, [r0] - ldr r2, =0x0000ffff - cmp r0, r2 - beq _081B864A -_081B8632: - adds r0, r1, r3 - ldrh r0, [r0] - cmp r0, r4 - beq _081B8608 - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - lsls r1, r6, 1 - adds r0, r1, r3 - ldrh r0, [r0] - cmp r0, r2 - bne _081B8632 -_081B864A: - movs r0, 0x1 -_081B864C: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B85AC - - thumb_func_start sub_81B865C -sub_81B865C: @ 81B865C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - bl sub_81B885C - lsls r0, 24 - lsrs r2, r0, 24 - adds r1, r2, 0 - ldr r3, =gUnknown_0203CEF8 - adds r0, r2, r3 - subs r0, 0x1 - ldrb r0, [r0] - cmp r0, 0 - bne _081B869C - cmp r2, 0x1 - bne _081B8688 - movs r0, 0xE - b _081B8758 - .pool -_081B8688: - ldr r0, =gStringVar1 - movs r2, 0 - movs r3, 0x1 - bl ConvertIntToDecimalStringN - movs r0, 0x11 - b _081B8758 - .pool -_081B869C: - ldr r0, =0x000040cf - bl VarGet - lsls r0, 24 - movs r1, 0xF8 - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x1 - bhi _081B86C0 - b _081B8756 - .pool -_081B86B8: - movs r0, 0x12 - b _081B8758 -_081B86BC: - movs r0, 0x13 - b _081B8758 -_081B86C0: - bl sub_81B8830 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r5, 0 - b _081B8750 -_081B86CE: - ldr r3, =gUnknown_0203CEF8 - adds r4, r3, r5 - ldrb r0, [r4] - movs r1, 0x64 - muls r0, r1 - subs r0, 0x64 - ldr r3, =gPlayerParty - adds r0, r3, r0 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - ldrb r0, [r4] - movs r1, 0x64 - muls r0, r1 - subs r0, 0x64 - ldr r3, =gPlayerParty - adds r0, r3, r0 - movs r1, 0xC - bl GetMonData - lsls r0, 16 - lsrs r6, r0, 16 - adds r1, r5, 0x1 - lsls r0, r1, 24 - lsrs r4, r0, 24 - mov r9, r1 - cmp r4, r8 - bcs _081B8748 - movs r7, 0x64 -_081B870E: - ldr r0, =gUnknown_0203CEF8 - adds r5, r0, r4 - ldrb r0, [r5] - muls r0, r7 - subs r0, 0x64 - ldr r1, =gPlayerParty - adds r0, r1, r0 - movs r1, 0xB - bl GetMonData - cmp r10, r0 - beq _081B86B8 - cmp r6, 0 - beq _081B873E - ldrb r0, [r5] - muls r0, r7 - subs r0, 0x64 - ldr r3, =gPlayerParty - adds r0, r3, r0 - movs r1, 0xC - bl GetMonData - cmp r6, r0 - beq _081B86BC -_081B873E: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r8 - bcc _081B870E -_081B8748: - mov r1, r9 - lsls r0, r1, 24 - lsrs r5, r0, 24 - mov r0, r8 -_081B8750: - subs r0, 0x1 - cmp r5, r0 - blt _081B86CE -_081B8756: - movs r0, 0xFF -_081B8758: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B865C - - thumb_func_start sub_81B8770 -sub_81B8770: @ 81B8770 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - movs r1, 0 - ldr r3, =gUnknown_0203CEF8 -_081B877A: - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _081B878C - movs r0, 0x1 - b _081B8798 - .pool -_081B878C: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x3 - bls _081B877A - movs r0, 0 -_081B8798: - pop {r1} - bx r1 - thumb_func_end sub_81B8770 - - thumb_func_start sub_81B879C -sub_81B879C: @ 81B879C - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_81B865C - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xFF - beq _081B87D4 - movs r0, 0x20 - bl PlaySE - adds r0, r4, 0 - bl display_pokemon_menu_message - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B87E8 - str r0, [r1] - b _081B87E0 - .pool -_081B87D4: - movs r0, 0x5 - bl PlaySE - adds r0, r5, 0 - bl sub_81B12C0 -_081B87E0: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81B879C - - thumb_func_start sub_81B87E8 -sub_81B87E8: @ 81B87E8 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081B8802 - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081B881C -_081B8802: - movs r0, 0x5 - bl PlaySE - movs r0, 0 - bl display_pokemon_menu_message - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B1370 - str r0, [r1] -_081B881C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B87E8 - - thumb_func_start sub_81B8830 -sub_81B8830: @ 81B8830 - push {lr} - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x8 - beq _081B884C - cmp r0, 0x9 - bne _081B8850 - movs r0, 0x3 - b _081B8854 - .pool -_081B884C: - movs r0, 0x2 - b _081B8854 -_081B8850: - ldr r0, =gSpecialVar_0x8005 - ldrb r0, [r0] -_081B8854: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B8830 - - thumb_func_start sub_81B885C -sub_81B885C: @ 81B885C - push {lr} - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x8 - beq _081B8878 - cmp r0, 0x9 - bne _081B887C - movs r0, 0x1 - b _081B8880 - .pool -_081B8878: - movs r0, 0x2 - b _081B8880 -_081B887C: - ldr r0, =gSpecialVar_0x8005 - ldrb r0, [r0] -_081B8880: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B885C - - thumb_func_start sub_81B8888 -sub_81B8888: @ 81B8888 - push {lr} - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x8 - beq _081B88A4 - cmp r0, 0x9 - bne _081B88A8 -_081B889C: - movs r0, 0x64 - b _081B88B2 - .pool -_081B88A4: - movs r0, 0x1E - b _081B88B2 -_081B88A8: - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - cmp r0, 0 - bne _081B889C - movs r0, 0x32 -_081B88B2: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B8888 - - thumb_func_start sub_81B88BC -sub_81B88BC: @ 81B88BC - push {lr} - ldr r0, =0x000040cf - bl VarGet - lsls r0, 24 - lsrs r1, r0, 24 - movs r2, 0xF8 - lsls r2, 24 - adds r0, r2 - lsrs r0, 24 - cmp r0, 0x1 - bhi _081B88E0 - ldr r0, =gUnknown_085EA126 - b _081B88FA - .pool -_081B88E0: - cmp r1, 0x1 - bne _081B88F8 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x2 - bne _081B88F8 - ldr r0, =gUnknown_085EA139 - b _081B88FA - .pool -_081B88F8: - ldr r0, =gUnknown_085EA155 -_081B88FA: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B88BC - - thumb_func_start sub_81B8904 -sub_81B8904: @ 81B8904 - push {lr} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - movs r2, 0 - str r2, [sp] - ldr r2, =sub_81B1370 - str r2, [sp, 0x4] - str r1, [sp, 0x8] - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl sub_81B0038 - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8904 - - thumb_func_start sub_81B892C -sub_81B892C: @ 81B892C - push {lr} - sub sp, 0xC - movs r0, 0x4 - str r0, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0xC - movs r3, 0 - bl sub_81B0038 - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B892C - - thumb_func_start sub_81B8958 -sub_81B8958: @ 81B8958 - push {lr} - sub sp, 0xC - movs r0, 0x1 - str r0, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - str r0, [sp, 0x8] - movs r0, 0xB - movs r1, 0 - movs r2, 0xD - movs r3, 0 - bl sub_81B0038 - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8958 - - thumb_func_start sub_81B8984 -sub_81B8984: @ 81B8984 - push {lr} - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - bne _081B8994 - movs r0, 0 - b _081B89A6 -_081B8994: - bl sub_81B1250 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B89A4 - movs r0, 0x1 - b _081B89A6 -_081B89A4: - movs r0, 0x2 -_081B89A6: - pop {r1} - bx r1 - thumb_func_end sub_81B8984 - - thumb_func_start sub_81B89AC -sub_81B89AC: @ 81B89AC - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_81B8984 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0 - str r0, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - ldr r0, =sub_8059D40 - str r0, [sp, 0x8] - movs r0, 0x1 - adds r2, r4, 0 - movs r3, 0 - bl sub_81B0038 - bl nullsub_35 - bl pokemon_change_order - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B89AC - - thumb_func_start sub_81B89F0 -sub_81B89F0: @ 81B89F0 - push {lr} - sub sp, 0xC - bl sub_81B8984 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0x5 - str r0, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - ldr r0, =c2_815ABFC - str r0, [sp, 0x8] - movs r0, 0x1 - movs r2, 0x3 - movs r3, 0 - bl sub_81B0038 - bl nullsub_35 - bl pokemon_change_order - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B89F0 - - thumb_func_start sub_81B8A2C -sub_81B8A2C: @ 81B8A2C - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gUnknown_02024550 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B8A74 - adds r0, r4, 0 - movs r1, 0x2D - bl GetMonData - cmp r0, 0 - bne _081B8A74 - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0xB] - cmp r0, 0x1 - bne _081B8A5C - movs r0, 0x3 - b _081B8A76 - .pool -_081B8A5C: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - bne _081B8A74 - movs r0, 0x2 - b _081B8A76 - .pool -_081B8A74: - movs r0, 0x7 -_081B8A76: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81B8A2C - - thumb_func_start sub_81B8A7C -sub_81B8A7C: @ 81B8A7C - push {r4-r7,lr} - mov r7, r8 - push {r7} - bl brm_get_pokemon_selection - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_81B1250 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B8AC4 - cmp r5, 0x1 - beq _081B8AA2 - cmp r5, 0x4 - beq _081B8AA2 - cmp r5, 0x5 - bne _081B8AC4 -_081B8AA2: - ldr r4, =gStringVar1 - bl sub_806EBF8 - adds r1, r0, 0 - adds r0, r4, 0 - bl StringCopy - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E97B2 - b _081B8C42 - .pool -_081B8AC4: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =gPlayerParty - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - bne _081B8AF8 - ldr r1, =gStringVar1 - adds r0, r4, 0 - bl GetMonNickname - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E978F - b _081B8C42 - .pool -_081B8AF8: - movs r4, 0 - b _081B8B24 -_081B8AFC: - adds r0, r4, 0 - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _081B8B1E - adds r0, r5, 0 - bl sub_81B8F38 - lsls r0, 24 - ldr r2, =gBattlePartyID - lsls r1, r4, 1 - adds r1, r2 - lsrs r0, 24 - ldrh r1, [r1] - cmp r0, r1 - beq _081B8BFC -_081B8B1E: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_081B8B24: - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r4, r0 - bcc _081B8AFC - movs r7, 0x64 - adds r0, r5, 0 - muls r0, r7 - ldr r1, =gPlayerParty - mov r8, r1 - adds r6, r0, r1 - adds r0, r6, 0 - movs r1, 0x2D - bl GetMonData - cmp r0, 0 - beq _081B8B60 - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E97E5 - b _081B8C42 - .pool -_081B8B60: - adds r0, r5, 0 - bl sub_81B8F38 - ldr r1, =gBattleStruct - ldr r1, [r1] - adds r1, 0x8B - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bne _081B8B94 - ldr r1, =gStringVar1 - adds r0, r6, 0 - bl GetMonNickname - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E976F - b _081B8C42 - .pool -_081B8B94: - ldr r0, =gUnknown_0203CEC8 - ldrb r0, [r0, 0xB] - cmp r0, 0x4 - bne _081B8BA8 - bl sub_806E994 - b _081B8C46 - .pool -_081B8BA8: - cmp r0, 0x2 - beq _081B8C20 - adds r0, r5, 0 - bl sub_81B8F38 - ldr r1, =gUnknown_0203CEE9 - strb r0, [r1] - ldr r1, =gUnknown_0203CEE8 - movs r0, 0x1 - strb r0, [r1] - ldr r1, =gBattlePartyID - ldr r0, =gUnknown_020244B8 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrb r0, [r0] - bl pokemon_order_func - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_81B8FB0 - adds r0, r4, 0 - muls r0, r7 - add r0, r8 - adds r1, r6, 0 - bl sub_81B1288 - movs r0, 0x1 - b _081B8C48 - .pool -_081B8BFC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gStringVar1 - bl GetMonNickname - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9754 - b _081B8C42 - .pool -_081B8C20: - ldr r0, =gUnknown_020244B8 - ldrb r0, [r0] - ldr r1, =gBattlePartyID - lsls r0, 1 - adds r0, r1 - ldrb r0, [r0] - bl pokemon_order_func - lsls r0, 24 - lsrs r0, 24 - muls r0, r7 - add r0, r8 - ldr r1, =gStringVar1 - bl GetMonNickname - ldr r0, =gStringVar4 - ldr r1, =gUnknown_085E9738 -_081B8C42: - bl StringExpandPlaceholders -_081B8C46: - movs r0, 0 -_081B8C48: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B8A7C - - thumb_func_start sub_81B8C68 -sub_81B8C68: @ 81B8C68 - push {r4,lr} - ldr r4, =gUnknown_0203CF00 - bl sub_806D7EC - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_81B8C88 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8C68 - - thumb_func_start sub_81B8C88 -sub_81B8C88: @ 81B8C88 - push {r4-r6,lr} - sub sp, 0x8 - adds r6, r0, 0 - lsls r1, 24 - lsrs r4, r1, 24 - bl sub_81B1250 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B8CBE - cmp r4, 0 - beq _081B8CB0 - movs r0, 0x30 - strb r0, [r6] - movs r0, 0x45 - strb r0, [r6, 0x1] - movs r0, 0x12 - strb r0, [r6, 0x2] - b _081B8D58 -_081B8CB0: - movs r0, 0x3 - strb r0, [r6] - movs r0, 0x12 - strb r0, [r6, 0x1] - movs r0, 0x45 - strb r0, [r6, 0x2] - b _081B8D58 -_081B8CBE: - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - bne _081B8CFC - movs r5, 0x1 - movs r0, 0 - bl GetBankByPlayerAI - mov r2, sp - ldr r1, =gBattlePartyID - lsls r0, 24 - lsrs r0, 23 - adds r0, r1 - ldrh r0, [r0] - strb r0, [r2] - movs r4, 0 - mov r1, sp -_081B8CE2: - ldrb r0, [r1] - cmp r4, r0 - beq _081B8CF0 - mov r2, sp - adds r0, r2, r5 - strb r4, [r0] - adds r5, 0x1 -_081B8CF0: - adds r4, 0x1 - cmp r4, 0x5 - ble _081B8CE2 - b _081B8D40 - .pool -_081B8CFC: - movs r5, 0x2 - movs r0, 0 - bl GetBankByPlayerAI - mov r1, sp - ldr r4, =gBattlePartyID - lsls r0, 24 - lsrs r0, 23 - adds r0, r4 - ldrh r0, [r0] - strb r0, [r1] - movs r0, 0x2 - bl GetBankByPlayerAI - mov r1, sp - lsls r0, 24 - lsrs r0, 23 - adds r0, r4 - ldrh r0, [r0] - strb r0, [r1, 0x1] - movs r4, 0 -_081B8D26: - ldrb r0, [r1] - cmp r4, r0 - beq _081B8D3A - ldrb r0, [r1, 0x1] - cmp r4, r0 - beq _081B8D3A - mov r2, sp - adds r0, r2, r5 - strb r4, [r0] - adds r5, 0x1 -_081B8D3A: - adds r4, 0x1 - cmp r4, 0x5 - ble _081B8D26 -_081B8D40: - movs r4, 0 - mov r3, sp -_081B8D44: - adds r0, r6, r4 - ldrb r1, [r3] - lsls r1, 4 - ldrb r2, [r3, 0x1] - orrs r1, r2 - strb r1, [r0] - adds r3, 0x2 - adds r4, 0x1 - cmp r4, 0x2 - ble _081B8D44 -_081B8D58: - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8C88 - - thumb_func_start sub_81B8D64 -sub_81B8D64: @ 81B8D64 - push {lr} - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =gBattleStruct - lsls r3, r2, 1 - adds r3, r2 - adds r3, 0x60 - ldr r0, [r0] - adds r0, r3 - bl sub_81B8D88 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8D64 - - thumb_func_start sub_81B8D88 -sub_81B8D88: @ 81B8D88 - push {r4-r7,lr} - sub sp, 0x8 - adds r5, r0, 0 - adds r0, r2, 0 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r0, 24 - lsrs r0, 24 - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _081B8DB0 - movs r0, 0 - bl GetBankByPlayerAI - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x2 - b _081B8DBC -_081B8DB0: - movs r0, 0x1 - bl GetBankByPlayerAI - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x3 -_081B8DBC: - bl GetBankByPlayerAI - lsls r0, 24 - lsrs r6, r0, 24 - bl sub_81B1250 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081B8DF0 - cmp r7, 0 - beq _081B8DE2 - movs r0, 0x30 - strb r0, [r5] - movs r0, 0x45 - strb r0, [r5, 0x1] - movs r0, 0x12 - strb r0, [r5, 0x2] - b _081B8E72 -_081B8DE2: - movs r0, 0x3 - strb r0, [r5] - movs r0, 0x12 - strb r0, [r5, 0x1] - movs r0, 0x45 - strb r0, [r5, 0x2] - b _081B8E72 -_081B8DF0: - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - bne _081B8E28 - movs r3, 0x1 - mov r2, sp - ldr r1, =gBattlePartyID - lsls r0, r4, 1 - adds r0, r1 - ldrh r0, [r0] - strb r0, [r2] - movs r4, 0 - mov r1, sp -_081B8E0C: - ldrb r0, [r1] - cmp r4, r0 - beq _081B8E1A - mov r2, sp - adds r0, r2, r3 - strb r4, [r0] - adds r3, 0x1 -_081B8E1A: - adds r4, 0x1 - cmp r4, 0x5 - ble _081B8E0C - b _081B8E5A - .pool -_081B8E28: - movs r3, 0x2 - mov r1, sp - ldr r2, =gBattlePartyID - lsls r0, r4, 1 - adds r0, r2 - ldrh r0, [r0] - strb r0, [r1] - lsls r0, r6, 1 - adds r0, r2 - ldrh r0, [r0] - strb r0, [r1, 0x1] - movs r4, 0 -_081B8E40: - ldrb r0, [r1] - cmp r4, r0 - beq _081B8E54 - ldrb r0, [r1, 0x1] - cmp r4, r0 - beq _081B8E54 - mov r2, sp - adds r0, r2, r3 - strb r4, [r0] - adds r3, 0x1 -_081B8E54: - adds r4, 0x1 - cmp r4, 0x5 - ble _081B8E40 -_081B8E5A: - movs r4, 0 - mov r3, sp -_081B8E5E: - adds r0, r5, r4 - ldrb r1, [r3] - lsls r1, 4 - ldrb r2, [r3, 0x1] - orrs r1, r2 - strb r1, [r0] - adds r3, 0x2 - adds r4, 0x1 - cmp r4, 0x2 - ble _081B8E5E -_081B8E72: - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8D88 - - thumb_func_start sub_81B8E80 -sub_81B8E80: @ 81B8E80 - push {r4-r7,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - lsls r2, 24 - lsrs r6, r2, 24 - movs r7, 0 - bl sub_81B1250 - lsls r0, 24 - cmp r0, 0 - beq _081B8F2E - ldr r0, =gBattleStruct - lsls r1, r4, 1 - adds r1, r4 - adds r1, 0x60 - ldr r0, [r0] - adds r4, r0, r1 - movs r2, 0 - add r6, sp - mov r12, r6 - movs r6, 0xF - mov r3, sp -_081B8EB2: - adds r1, r4, r2 - ldrb r0, [r1] - lsrs r0, 4 - strb r0, [r3] - adds r3, 0x1 - ldrb r1, [r1] - adds r0, r6, 0 - ands r0, r1 - strb r0, [r3] - adds r3, 0x1 - adds r2, 0x1 - cmp r2, 0x2 - ble _081B8EB2 - mov r0, r12 - ldrb r3, [r0] - movs r2, 0 - mov r0, sp - ldrb r0, [r0] - cmp r0, r5 - bne _081B8EE8 - mov r0, sp - ldrb r7, [r0] - strb r3, [r0] - b _081B8EFC - .pool -_081B8EE8: - adds r2, 0x1 - cmp r2, 0x5 - bgt _081B8EFC - mov r0, sp - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, r5 - bne _081B8EE8 - adds r7, r0, 0 - strb r3, [r1] -_081B8EFC: - cmp r2, 0x6 - beq _081B8F2E - mov r0, r12 - strb r7, [r0] - mov r0, sp - ldrb r0, [r0] - lsls r0, 4 - mov r1, sp - ldrb r1, [r1, 0x1] - orrs r0, r1 - strb r0, [r4] - mov r0, sp - ldrb r0, [r0, 0x2] - lsls r0, 4 - mov r1, sp - ldrb r1, [r1, 0x3] - orrs r0, r1 - strb r0, [r4, 0x1] - mov r0, sp - ldrb r0, [r0, 0x4] - lsls r0, 4 - mov r1, sp - ldrb r1, [r1, 0x5] - orrs r0, r1 - strb r0, [r4, 0x2] -_081B8F2E: - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81B8E80 - - thumb_func_start sub_81B8F38 -sub_81B8F38: @ 81B8F38 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - movs r1, 0x1 - ands r1, r2 - lsrs r2, r0, 25 - cmp r1, 0 - beq _081B8F58 - ldr r0, =gUnknown_0203CF00 - adds r0, r2, r0 - ldrb r0, [r0] - movs r1, 0xF - ands r1, r0 - b _081B8F60 - .pool -_081B8F58: - ldr r0, =gUnknown_0203CF00 - adds r0, r2, r0 - ldrb r0, [r0] - lsrs r1, r0, 4 -_081B8F60: - adds r0, r1, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B8F38 - - thumb_func_start sub_81B8F6C -sub_81B8F6C: @ 81B8F6C - push {r4,lr} - lsls r0, 24 - lsrs r3, r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - movs r1, 0x1 - ands r1, r3 - lsrs r3, r0, 25 - cmp r1, 0 - beq _081B8F94 - ldr r0, =gUnknown_0203CF00 - adds r0, r3, r0 - ldrb r2, [r0] - movs r1, 0xF0 - ands r1, r2 - orrs r1, r4 - strb r1, [r0] - b _081B8FA4 - .pool -_081B8F94: - ldr r2, =gUnknown_0203CF00 - adds r2, r3, r2 - ldrb r1, [r2] - movs r0, 0xF - ands r0, r1 - lsls r1, r4, 4 - orrs r0, r1 - strb r0, [r2] -_081B8FA4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B8F6C - - thumb_func_start sub_81B8FB0 -sub_81B8FB0: @ 81B8FB0 - push {r4-r6,lr} - adds r5, r0, 0 - adds r6, r1, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - adds r0, r5, 0 - bl sub_81B8F38 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r6, 0 - bl sub_81B8F38 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl sub_81B8F6C - adds r0, r6, 0 - adds r1, r4, 0 - bl sub_81B8F6C - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81B8FB0 - - thumb_func_start pokemon_order_func -pokemon_order_func: @ 81B8FEC - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r3, 0 - movs r2, 0 - ldr r5, =gUnknown_0203CF00 -_081B8FF8: - adds r0, r3, r5 - ldrb r1, [r0] - lsrs r0, r1, 4 - cmp r0, r4 - beq _081B9010 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - movs r0, 0xF - ands r0, r1 - cmp r0, r4 - bne _081B9018 -_081B9010: - adds r0, r2, 0 - b _081B902A - .pool -_081B9018: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x2 - bls _081B8FF8 - movs r0, 0 -_081B902A: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end pokemon_order_func - - thumb_func_start pokemon_change_order -pokemon_change_order: @ 81B9030 - push {r4-r6,lr} - movs r4, 0x96 - lsls r4, 2 - adds r0, r4, 0 - bl Alloc - adds r5, r0, 0 - ldr r1, =gPlayerParty - adds r2, r4, 0 - bl memcpy - movs r4, 0 - movs r6, 0x64 -_081B904A: - adds r0, r4, 0 - bl pokemon_order_func - lsls r0, 24 - lsrs r0, 24 - muls r0, r6 - ldr r1, =gPlayerParty - adds r0, r1 - adds r1, r4, 0 - muls r1, r6 - adds r1, r5 - movs r2, 0x64 - bl memcpy - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _081B904A - adds r0, r5, 0 - bl Free - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end pokemon_change_order - - thumb_func_start sub_81B9080 -sub_81B9080: @ 81B9080 - push {r4-r6,lr} - movs r4, 0x96 - lsls r4, 2 - adds r0, r4, 0 - bl Alloc - adds r5, r0, 0 - ldr r1, =gPlayerParty - adds r2, r4, 0 - bl memcpy - movs r4, 0 - movs r6, 0x64 -_081B909A: - adds r0, r4, 0 - bl sub_81B8F38 - lsls r0, 24 - lsrs r0, 24 - muls r0, r6 - ldr r1, =gPlayerParty - adds r0, r1 - adds r1, r4, 0 - muls r1, r6 - adds r1, r5 - movs r2, 0x64 - bl memcpy - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _081B909A - adds r0, r5, 0 - bl Free - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9080 - - thumb_func_start sub_81B90D0 -sub_81B90D0: @ 81B90D0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r6, 0x1 - movs r7, 0x64 - ldr r0, =gPlayerParty - mov r8, r0 -_081B90DE: - adds r0, r6, 0 - bl sub_81B8F38 - lsls r0, 24 - lsrs r0, 24 - muls r0, r7 - mov r1, r8 - adds r5, r0, r1 - adds r0, r5, 0 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _081B912C - adds r0, r5, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - beq _081B912C - movs r0, 0 - bl sub_81B8F38 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - adds r1, r6, 0 - bl sub_81B8FB0 - adds r0, r4, 0 - muls r0, r7 - add r0, r8 - adds r1, r5, 0 - bl sub_81B1288 - b _081B9136 - .pool -_081B912C: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x5 - bls _081B90DE -_081B9136: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81B90D0 - - thumb_func_start sub_81B9140 -sub_81B9140: @ 81B9140 - push {lr} - ldr r0, =sub_8059D40 - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9140 - - thumb_func_start sub_81B9150 -sub_81B9150: @ 81B9150 - push {lr} - sub sp, 0xC - movs r0, 0x7F - str r0, [sp] - ldr r0, =sub_81B917C - str r0, [sp, 0x4] - ldr r0, =gMain - ldr r0, [r0, 0x8] - str r0, [sp, 0x8] - movs r0, 0x5 - movs r1, 0x3 - movs r2, 0 - movs r3, 0 - bl sub_81B0038 - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9150 - - thumb_func_start sub_81B917C -sub_81B917C: @ 81B917C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gTasks - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - adds r4, r1 - movs r1, 0x80 - lsls r1, 1 - strh r1, [r4, 0x8] - bl sub_81B9294 - movs r1, 0x80 - lsls r1, 9 - movs r0, 0x2 - movs r2, 0 - bl ChangeBgX - ldr r0, =sub_81B91B4 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B917C - - thumb_func_start sub_81B91B4 -sub_81B91B4: @ 81B91B4 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r6, r5, 2 - adds r0, r6, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B9220 - ldrh r0, [r4] - subs r0, 0x8 - strh r0, [r4] - adds r0, r5, 0 - bl sub_81B9294 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081B9220 - movs r4, 0x3 - ldr r7, =gUnknown_02022FF8 -_081B91E8: - subs r0, r4, 0x3 - lsls r0, 5 - adds r0, r7 - ldrh r0, [r0] - cmp r0, 0 - beq _081B9204 - ldr r0, =gUnknown_0203CEDC - ldr r1, [r0] - lsls r0, r4, 4 - adds r0, r1 - ldrb r0, [r0, 0x9] - movs r1, 0 - bl sub_81B5B6C -_081B9204: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _081B91E8 - movs r0, 0x78 - bl PlaySE - ldr r0, =gTasks - adds r1, r6, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B9240 - str r0, [r1] -_081B9220: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B91B4 - - thumb_func_start sub_81B9240 -sub_81B9240: @ 81B9240 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r0, r1 - ldrh r1, [r0] - adds r1, 0x1 - strh r1, [r0] - lsls r1, 16 - movs r0, 0x80 - lsls r0, 17 - cmp r1, r0 - bne _081B9266 - adds r0, r2, 0 - bl sub_81B12C0 -_081B9266: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9240 - - thumb_func_start sub_81B9270 -sub_81B9270: @ 81B9270 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r1, 16 - lsrs r3, r1, 16 - cmp r1, 0 - blt _081B928A - ldr r1, =gSprites - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - strh r3, [r0, 0x24] -_081B928A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9270 - - thumb_func_start sub_81B9294 -sub_81B9294: @ 81B9294 - push {r4-r7,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r5, r1, r0 - movs r6, 0x3 - ldr r7, =gUnknown_0203CEDC -_081B92A8: - ldr r0, =gUnknown_02022FF8 - subs r1, r6, 0x3 - lsls r1, 5 - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0 - beq _081B9300 - ldr r0, [r7] - lsls r4, r6, 4 - adds r0, r4, r0 - ldrb r0, [r0, 0x9] - ldrh r1, [r5] - subs r1, 0x8 - lsls r1, 16 - asrs r1, 16 - bl sub_81B9270 - ldr r0, [r7] - adds r0, r4, r0 - ldrb r0, [r0, 0xA] - ldrh r1, [r5] - subs r1, 0x8 - lsls r1, 16 - asrs r1, 16 - bl sub_81B9270 - ldr r0, [r7] - adds r0, r4, r0 - ldrb r0, [r0, 0xB] - ldrh r1, [r5] - subs r1, 0x8 - lsls r1, 16 - asrs r1, 16 - bl sub_81B9270 - ldr r0, [r7] - adds r4, r0 - ldrb r0, [r4, 0xC] - ldrh r1, [r5] - subs r1, 0x8 - lsls r1, 16 - asrs r1, 16 - bl sub_81B9270 -_081B9300: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x5 - bls _081B92A8 - movs r1, 0x80 - lsls r1, 4 - movs r0, 0x2 - movs r2, 0x1 - bl ChangeBgX - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9294 - - thumb_func_start sub_81B9328 -sub_81B9328: @ 81B9328 - push {lr} - sub sp, 0xC - movs r0, 0xF - str r0, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - ldr r0, =sub_81B9390 - str r0, [sp, 0x8] - movs r0, 0x6 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl sub_81B0038 - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9328 - - thumb_func_start sub_81B9354 -sub_81B9354: @ 81B9354 - push {lr} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gUnknown_03005DB0 - ldr r1, =hm_add_c3_without_phase_2 - str r1, [r2] - movs r1, 0 - str r1, [sp] - ldr r1, =sub_81B1370 - str r1, [sp, 0x4] - ldr r1, =c2_exit_to_overworld_2_switch - str r1, [sp, 0x8] - movs r1, 0 - movs r2, 0xB - movs r3, 0 - bl sub_81B0038 - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9354 - - thumb_func_start sub_81B9390 -sub_81B9390: @ 81B9390 - push {r4,lr} - ldr r4, =gSpecialVar_0x8004 - bl brm_get_pokemon_selection - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - cmp r0, 0x5 - bls _081B93A6 - movs r0, 0xFF - strh r0, [r4] -_081B93A6: - ldr r0, =gUnknown_03005DB0 - ldr r1, =hm_add_c3_without_phase_2 - str r1, [r0] - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9390 - - thumb_func_start hm_add_c3_without_phase_2 -hm_add_c3_without_phase_2: @ 81B93C8 - push {lr} - bl pal_fill_black - ldr r0, =task_hm_without_phase_2 - movs r1, 0xA - bl CreateTask - movs r0, 0x1 - pop {r1} - bx r1 - .pool - thumb_func_end hm_add_c3_without_phase_2 - - thumb_func_start task_hm_without_phase_2 -task_hm_without_phase_2: @ 81B93E0 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80ABDFC - lsls r0, 24 - cmp r0, 0 - beq _081B93FE - adds r0, r4, 0 - bl DestroyTask - bl script_env_2_disable - bl script_env_2_enable_and_set_ctx_running -_081B93FE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end task_hm_without_phase_2 - - thumb_func_start sub_81B9404 -sub_81B9404: @ 81B9404 - push {lr} - bl script_env_2_enable - movs r0, 0x1 - movs r1, 0 - bl fade_screen - ldr r0, =sub_81B9424 - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9404 - - thumb_func_start sub_81B9424 -sub_81B9424: @ 81B9424 - push {r4,r5,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _081B945C - bl overworld_free_bg_tilemaps - str r4, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - ldr r0, =sub_81B9470 - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0 - movs r2, 0xB - movs r3, 0 - bl sub_81B0038 - adds r0, r5, 0 - bl DestroyTask -_081B945C: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9424 - - thumb_func_start sub_81B9470 -sub_81B9470: @ 81B9470 - push {lr} - bl brm_get_pokemon_selection - ldr r2, =gUnknown_02039F24 - strb r0, [r2] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x5 - bls _081B9486 - movs r0, 0xFF - strb r0, [r2] -_081B9486: - ldr r1, =gSpecialVar_0x8004 - ldrb r0, [r2] - strh r0, [r1] - ldr r1, =gUnknown_03005DB0 - ldr r0, =hm_add_c3_without_phase_2 - str r0, [r1] - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9470 - - thumb_func_start sub_81B94B0 -sub_81B94B0: @ 81B94B0 - push {lr} - bl script_env_2_enable - movs r0, 0x1 - movs r1, 0 - bl fade_screen - ldr r0, =sub_81B94D0 - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B94B0 - - thumb_func_start sub_81B94D0 -sub_81B94D0: @ 81B94D0 - push {r4,r5,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _081B9508 - bl overworld_free_bg_tilemaps - str r4, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - ldr r0, =sub_81B9390 - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0 - movs r2, 0xB - movs r3, 0 - bl sub_81B0038 - adds r0, r5, 0 - bl DestroyTask -_081B9508: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B94D0 - - thumb_func_start sub_81B951C -sub_81B951C: @ 81B951C - push {lr} - bl script_env_2_enable - movs r0, 0x1 - movs r1, 0 - bl fade_screen - ldr r0, =sub_81B953C - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B951C - - thumb_func_start sub_81B953C -sub_81B953C: @ 81B953C - push {r4,r5,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _081B9574 - bl overworld_free_bg_tilemaps - str r4, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - ldr r0, =sub_81B9588 - str r0, [sp, 0x8] - movs r0, 0x7 - movs r1, 0 - movs r2, 0xB - movs r3, 0 - bl sub_81B0038 - adds r0, r5, 0 - bl DestroyTask -_081B9574: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B953C - - thumb_func_start sub_81B9588 -sub_81B9588: @ 81B9588 - push {r4,r5,lr} - ldr r5, =gSpecialVar_0x8004 - bl brm_get_pokemon_selection - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5] - cmp r0, 0x5 - bls _081B95A4 - movs r0, 0xFF - strh r0, [r5] - b _081B95BA - .pool -_081B95A4: - ldr r4, =gSpecialVar_0x8005 - ldrh r1, [r5] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - bl sub_806E25C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] -_081B95BA: - ldr r0, =gUnknown_03005DB0 - ldr r1, =hm_add_c3_without_phase_2 - str r1, [r0] - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9588 - - thumb_func_start sub_81B95E0 -sub_81B95E0: @ 81B95E0 - push {r4,r5,lr} - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - movs r4, 0 - adds r5, r1, 0 - b _081B95FA - .pool -_081B95F4: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_081B95FA: - cmp r4, 0x2 - bhi _081B9614 - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xC - bl GetMonData - cmp r0, 0 - beq _081B95F4 - movs r0, 0x1 - strh r0, [r5] -_081B9614: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B95E0 - - thumb_func_start sub_81B9620 -sub_81B9620: @ 81B9620 - push {lr} - bl script_env_2_enable - movs r0, 0x1 - movs r1, 0 - bl fade_screen - ldr r0, =sub_81B9640 - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9620 - - thumb_func_start sub_81B9640 -sub_81B9640: @ 81B9640 - push {r4,r5,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _081B9678 - bl overworld_free_bg_tilemaps - str r4, [sp] - ldr r0, =sub_81B1370 - str r0, [sp, 0x4] - ldr r0, =sub_81B9390 - str r0, [sp, 0x8] - movs r0, 0xC - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl sub_81B0038 - adds r0, r5, 0 - bl DestroyTask -_081B9678: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9640 - - thumb_func_start sub_81B968C -sub_81B968C: @ 81B968C - push {lr} - sub sp, 0x4 - ldr r1, =gPlayerParty - ldr r0, =gSpecialVar_0x8004 - ldrb r2, [r0] - ldr r0, =gUnknown_020244E9 - ldrb r3, [r0] - subs r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =c2_exit_to_overworld_2_switch - str r0, [sp] - movs r0, 0x3 - bl sub_81BF8EC - ldr r1, =gUnknown_03005DAC - ldr r0, =sub_80AF168 - str r0, [r1] - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B968C - - thumb_func_start sub_81B96D0 -sub_81B96D0: @ 81B96D0 - push {r4,r5,lr} - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - movs r4, 0 - adds r5, r1, 0 -_081B96DC: - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - adds r1, r4, 0 - adds r1, 0xD - bl GetMonData - cmp r0, 0 - beq _081B96FA - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] -_081B96FA: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _081B96DC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B96D0 - - thumb_func_start sub_81B9718 -sub_81B9718: @ 81B9718 - push {r4,r5,lr} - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - movs r0, 0x64 - adds r5, r1, 0 - muls r5, r0 - ldr r0, =gPlayerParty - adds r5, r0 - ldr r0, =gSpecialVar_0x8005 - ldrh r1, [r0] - adds r1, 0xD - adds r0, r5, 0 - bl GetMonData - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r1, =gStringVar1 - adds r0, r5, 0 - bl GetMonNickname - ldr r0, =gStringVar2 - movs r1, 0xD - muls r1, r4 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9718 - - thumb_func_start sub_81B9770 -sub_81B9770: @ 81B9770 - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r0, =gSpecialVar_0x8004 - mov r8, r0 - ldrh r0, [r0] - movs r6, 0x64 - muls r0, r6 - ldr r5, =gPlayerParty - adds r0, r5 - ldr r4, =gSpecialVar_0x8005 - ldrb r2, [r4] - movs r1, 0 - bl sub_80691F4 - mov r1, r8 - ldrh r0, [r1] - muls r0, r6 - adds r0, r5 - ldrb r1, [r4] - bl sub_806B9A8 - ldrh r4, [r4] - cmp r4, 0x2 - bhi _081B97C4 -_081B97A2: - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - lsls r1, r4, 24 - lsrs r1, 24 - adds r4, 0x1 - lsls r2, r4, 24 - lsrs r2, 24 - bl sub_81B97DC - lsls r4, 16 - lsrs r4, 16 - cmp r4, 0x2 - bls _081B97A2 -_081B97C4: - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9770 - - thumb_func_start sub_81B97DC -sub_81B97DC: @ 81B97DC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - mov r8, r0 - adds r5, r1, 0 - adds r4, r2, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - adds r0, 0xD - str r0, [sp, 0x8] - mov r0, r8 - ldr r1, [sp, 0x8] - bl GetMonData - mov r1, sp - adds r1, 0x2 - str r1, [sp, 0x14] - strh r0, [r1] - adds r3, r4, 0 - adds r3, 0xD - str r3, [sp, 0xC] - mov r0, r8 - adds r1, r3, 0 - bl GetMonData - mov r1, sp - strh r0, [r1] - adds r7, r5, 0 - adds r7, 0x11 - str r7, [sp, 0x10] - mov r0, r8 - adds r1, r7, 0 - bl GetMonData - mov r1, sp - adds r1, 0x5 - str r1, [sp, 0x18] - strb r0, [r1] - adds r3, r4, 0 - adds r3, 0x11 - str r3, [sp, 0x1C] - mov r0, r8 - adds r1, r3, 0 - bl GetMonData - add r7, sp, 0x4 - mov r10, r7 - strb r0, [r7] - mov r0, r8 - movs r1, 0x15 - bl GetMonData - mov r6, sp - adds r6, 0x6 - strb r0, [r6] - ldr r1, =gUnknown_08329D22 - adds r0, r5, r1 - ldrb r0, [r0] - mov r9, r0 - ldrb r0, [r6] - adds r2, r0, 0 - mov r3, r9 - ands r2, r3 - lsls r5, 1 - asrs r2, r5 - lsls r2, 24 - lsrs r2, 24 - adds r1, r4, r1 - ldrb r3, [r1] - adds r1, r0, 0 - ands r1, r3 - lsls r4, 1 - asrs r1, r4 - lsls r1, 24 - lsrs r1, 24 - mov r7, r9 - bics r0, r7 - strb r0, [r6] - ldrb r0, [r6] - bics r0, r3 - strb r0, [r6] - lsls r2, r4 - lsls r1, r5 - adds r2, r1 - ldrb r0, [r6] - orrs r0, r2 - strb r0, [r6] - mov r0, r8 - ldr r1, [sp, 0x8] - mov r2, sp - bl SetMonData - mov r0, r8 - ldr r1, [sp, 0xC] - ldr r2, [sp, 0x14] - bl SetMonData - mov r0, r8 - ldr r1, [sp, 0x10] - mov r2, r10 - bl SetMonData - mov r0, r8 - ldr r1, [sp, 0x1C] - ldr r2, [sp, 0x18] - bl SetMonData - mov r0, r8 - movs r1, 0x15 - adds r2, r6, 0 - bl SetMonData - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B97DC - - thumb_func_start sub_81B98DC -sub_81B98DC: @ 81B98DC - push {lr} - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x2D - bl GetMonData - adds r1, r0, 0 - cmp r1, 0 - beq _081B990C - ldr r1, =gScriptResult - movs r0, 0x1 - strh r0, [r1] - b _081B9910 - .pool -_081B990C: - ldr r0, =gScriptResult - strh r1, [r0] -_081B9910: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B98DC - - thumb_func_start sub_81B9918 -sub_81B9918: @ 81B9918 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gSpecialVar_0x8005 - ldrh r1, [r1] - adds r1, 0xD - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - cmp r0, 0x39 - bne _081B999C - movs r6, 0 - b _081B9980 - .pool -_081B9958: - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - cmp r6, r0 - beq _081B997E - movs r4, 0 - movs r0, 0x64 - adds r5, r6, 0 - muls r5, r0 - ldr r7, =gPlayerParty -_081B996A: - adds r1, r4, 0 - adds r1, 0xD - adds r0, r5, r7 - bl GetMonData - cmp r0, 0x39 - beq _081B999C - adds r4, 0x1 - cmp r4, 0x3 - bls _081B996A -_081B997E: - adds r6, 0x1 -_081B9980: - bl calc_player_party_count - lsls r0, 24 - lsrs r0, 24 - cmp r6, r0 - bcc _081B9958 - mov r0, r8 - bl sub_80D23A8 - cmp r0, 0x1 - beq _081B999C - ldr r1, =gScriptResult - movs r0, 0x1 - strh r0, [r1] -_081B999C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9918 - - thumb_func_start sub_81B99B4 -sub_81B99B4: @ 81B99B4 - push {lr} - ldr r1, =gUnknown_086160B4 - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B99B4 - - thumb_func_start sub_81B99D4 -sub_81B99D4: @ 81B99D4 - push {lr} - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - movs r2, 0 - strb r2, [r0] - ldr r1, [r1] - ldr r3, =0x00000cb2 - adds r0, r1, r3 - strh r2, [r0] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0x4 - ldrsb r1, [r0, r1] - movs r2, 0x5 - ldrsb r2, [r0, r2] - movs r3, 0x1 - negs r3, r3 - movs r0, 0 - bl saved_warp2_set - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B99D4 - - thumb_func_start sub_81B9A28 -sub_81B9A28: @ 81B9A28 - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000e6a - adds r0, r2 - ldrh r0, [r0] - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_81B9A28 - - thumb_func_start sub_81B9A44 -sub_81B9A44: @ 81B9A44 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =gSpecialVar_0x8006 - ldrh r1, [r1] - ldr r2, =0x00000e6a - adds r0, r2 - strh r1, [r0] - bx lr - .pool - thumb_func_end sub_81B9A44 - - thumb_func_start sub_81B9A60 -sub_81B9A60: @ 81B9A60 - push {r4,lr} - ldr r4, =gUnknown_02038BCA - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xFF - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - lsls r1, r0, 2 - adds r1, r0 - lsrs r1, 6 - strh r1, [r4] - ldrh r0, [r4] - movs r1, 0 - bl sub_8162614 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9A60 - - thumb_func_start sub_81B9A90 -sub_81B9A90: @ 81B9A90 - push {lr} - ldr r3, =gUnknown_02038BCA - ldrh r1, [r3] - ldr r0, =0x0000012b - cmp r1, r0 - bhi _081B9AAC - ldr r2, =gUnknown_0203BC88 - movs r0, 0x34 - muls r1, r0 - ldr r0, [r2] - adds r0, r1 - adds r0, 0xC - bl ConvertBattleFrontierTrainerSpeechToString -_081B9AAC: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9A90 - - thumb_func_start sub_81B9ABC -sub_81B9ABC: @ 81B9ABC - push {r4,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =gSpecialVar_0x8005 - ldrh r1, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - strb r1, [r0] - movs r0, 0x80 - lsls r0, 7 - movs r1, 0 - bl VarSet - ldr r1, [r4] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - bl sub_81A4C30 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9ABC - - thumb_func_start sub_81B9B00 -sub_81B9B00: @ 81B9B00 - push {r4,r5,lr} - ldr r0, =gSaveBlock2Ptr - ldr r4, [r0] - ldr r5, =gUnknown_086160D4 - bl Random - ldrh r0, [r5] - ldr r1, =0x00000e6a - adds r4, r1 - strh r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9B00 - - thumb_func_start sub_81B9B28 -sub_81B9B28: @ 81B9B28 - push {r4,r5,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000e6a - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x1 - bl AddBagItem - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - bne _081B9B70 - ldr r0, [r4] - ldr r1, =0x00000e6a - adds r0, r1 - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r0, [r4] - ldr r1, =0x00000e6a - adds r0, r1 - movs r1, 0 - strh r1, [r0] - ldr r0, =gScriptResult - strh r5, [r0] - b _081B9B76 - .pool -_081B9B70: - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] -_081B9B76: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9B28 - - thumb_func_start sub_81B9B80 -sub_81B9B80: @ 81B9B80 - push {lr} - ldr r1, =gUnknown_086160D8 - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9B80 - - thumb_func_start sub_81B9BA0 -sub_81B9BA0: @ 81B9BA0 - push {lr} - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - movs r2, 0 - strb r2, [r0] - ldr r1, [r1] - ldr r3, =0x00000cb2 - adds r0, r1, r3 - strh r2, [r0] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0x4 - ldrsb r1, [r0, r1] - movs r2, 0x5 - ldrsb r2, [r0, r2] - movs r3, 0x1 - negs r3, r3 - movs r0, 0 - bl saved_warp2_set - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9BA0 - - thumb_func_start sub_81B9BF4 -sub_81B9BF4: @ 81B9BF4 - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000e6c - adds r0, r2 - ldrh r0, [r0] - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_81B9BF4 - - thumb_func_start sub_81B9C10 -sub_81B9C10: @ 81B9C10 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =gSpecialVar_0x8006 - ldrh r1, [r1] - ldr r2, =0x00000e6c - adds r0, r2 - strh r1, [r0] - bx lr - .pool - thumb_func_end sub_81B9C10 - - thumb_func_start sub_81B9C2C -sub_81B9C2C: @ 81B9C2C - push {r4,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =gSpecialVar_0x8005 - ldrh r1, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - strb r1, [r0] - movs r0, 0x80 - lsls r0, 7 - movs r1, 0 - bl VarSet - ldr r1, [r4] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - bl sub_81A4C30 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9C2C - - thumb_func_start sub_81B9C70 -sub_81B9C70: @ 81B9C70 - push {r4,r5,lr} - ldr r0, =gSaveBlock2Ptr - ldr r4, [r0] - ldr r5, =gUnknown_086160F4 - bl Random - ldrh r0, [r5] - ldr r1, =0x00000e6c - adds r4, r1 - strh r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9C70 - - thumb_func_start sub_81B9C98 -sub_81B9C98: @ 81B9C98 - push {r4,r5,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000e6c - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x1 - bl AddBagItem - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - bne _081B9CE0 - ldr r0, [r4] - ldr r1, =0x00000e6c - adds r0, r1 - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r0, [r4] - ldr r1, =0x00000e6c - adds r0, r1 - movs r1, 0 - strh r1, [r0] - ldr r0, =gScriptResult - strh r5, [r0] - b _081B9CE6 - .pool -_081B9CE0: - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] -_081B9CE6: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9C98 - - thumb_func_start sub_81B9CF0 -sub_81B9CF0: @ 81B9CF0 - push {lr} - ldr r0, =gStringVar1 - ldr r1, =gUnknown_02038BCA - ldrh r1, [r1] - bl sub_8162E20 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9CF0 - - thumb_func_start sub_81B9D08 -sub_81B9D08: @ 81B9D08 - push {lr} - ldr r1, =gUnknown_086160F8 - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9D08 - - thumb_func_start sub_81B9D28 -sub_81B9D28: @ 81B9D28 - push {lr} - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - movs r2, 0 - strb r2, [r0] - ldr r1, [r1] - ldr r3, =0x00000cb2 - adds r0, r1, r3 - strh r2, [r0] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - movs r1, 0x4 - ldrsb r1, [r0, r1] - movs r2, 0x5 - ldrsb r2, [r0, r2] - movs r3, 0x1 - negs r3, r3 - movs r0, 0 - bl saved_warp2_set - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9D28 - - thumb_func_start sub_81B9D7C -sub_81B9D7C: @ 81B9D7C - ldr r1, =gScriptResult - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000e6e - adds r0, r2 - ldrh r0, [r0] - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_81B9D7C - - thumb_func_start sub_81B9D98 -sub_81B9D98: @ 81B9D98 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r1, =gSpecialVar_0x8006 - ldrh r1, [r1] - ldr r2, =0x00000e6e - adds r0, r2 - strh r1, [r0] - bx lr - .pool - thumb_func_end sub_81B9D98 - - thumb_func_start sub_81B9DB4 -sub_81B9DB4: @ 81B9DB4 - push {r4,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =gSpecialVar_0x8005 - ldrh r1, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - strb r1, [r0] - movs r0, 0x80 - lsls r0, 7 - movs r1, 0 - bl VarSet - ldr r1, [r4] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - bl sub_81A4C30 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9DB4 - - thumb_func_start sub_81B9DF8 -sub_81B9DF8: @ 81B9DF8 - push {r4,r5,lr} - ldr r0, =gSaveBlock2Ptr - ldr r4, [r0] - ldr r5, =gUnknown_08616120 - bl Random - ldrh r0, [r5] - ldr r1, =0x00000e6e - adds r4, r1 - strh r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9DF8 - - thumb_func_start sub_81B9E20 -sub_81B9E20: @ 81B9E20 - push {r4,r5,lr} - ldr r4, =gSaveBlock2Ptr - ldr r0, [r4] - ldr r1, =0x00000e6e - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x1 - bl AddBagItem - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - bne _081B9E68 - ldr r0, [r4] - ldr r1, =0x00000e6e - adds r0, r1 - ldrh r0, [r0] - ldr r1, =gStringVar1 - bl CopyItemName - ldr r0, [r4] - ldr r1, =0x00000e6e - adds r0, r1 - movs r1, 0 - strh r1, [r0] - ldr r0, =gScriptResult - strh r5, [r0] - b _081B9E6E - .pool -_081B9E68: - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] -_081B9E6E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9E20 - - thumb_func_start sub_81B9E78 -sub_81B9E78: @ 81B9E78 - push {lr} - bl zero_player_party_data - bl sub_819A4F8 - pop {r0} - bx r0 - thumb_func_end sub_81B9E78 - - thumb_func_start sub_81B9E88 -sub_81B9E88: @ 81B9E88 - push {lr} - bl sub_819DC00 - pop {r0} - bx r0 - thumb_func_end sub_81B9E88 - - thumb_func_start sub_81B9E94 -sub_81B9E94: @ 81B9E94 - push {lr} - movs r2, 0 - ldr r1, =gUnknown_02037318 - ldrb r0, [r1, 0x14] - cmp r0, 0x8 - bne _081B9EB2 - ldr r3, =0xfffffe7f - adds r0, r3, 0 - ldrh r1, [r1, 0x12] - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bhi _081B9EB2 - movs r2, 0x1 -_081B9EB2: - adds r0, r2, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81B9E94 - - thumb_func_start sub_81B9EC0 -sub_81B9EC0: @ 81B9EC0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x3C - ldr r1, =gUnknown_0203BC88 - ldr r0, =gSlateportBattleTentTrainers - str r0, [r1] - add r0, sp, 0xC - mov r9, r0 - mov r1, sp - adds r1, 0x18 - str r1, [sp, 0x2C] - ldr r5, =gUnknown_0203BC8C - ldr r4, =gSlateportBattleTentMons - movs r2, 0 - adds r3, r1, 0 - mov r1, r9 - mov r0, sp - movs r6, 0x5 - mov r8, r6 -_081B9EEC: - strh r2, [r0] - strh r2, [r1] - strh r2, [r3] - adds r3, 0x2 - adds r1, 0x2 - adds r0, 0x2 - movs r7, 0x1 - negs r7, r7 - add r8, r7 - mov r6, r8 - cmp r6, 0 - bge _081B9EEC - str r4, [r5] - movs r7, 0 - mov r10, r7 - movs r0, 0 - mov r8, r0 - ldr r1, [sp, 0x2C] - str r1, [sp, 0x30] - mov r2, sp - str r2, [sp, 0x34] - lsls r6, r0, 1 - str r6, [sp, 0x24] - add r6, r9 - str r6, [sp, 0x28] -_081B9F1E: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x46 - bl __umodsi3 - lsls r0, 16 - lsrs r5, r0, 16 - movs r2, 0 - mov r7, r8 - adds r6, r2, r7 - cmp r2, r6 - bge _081B9F7C - ldr r1, [sp, 0x28] - ldrh r0, [r1] - cmp r0, r5 - beq _081B9F7C - ldr r0, =gUnknown_0203BC8C - ldr r1, [r0] - lsls r0, r5, 4 - adds r4, r0, r1 - ldrh r7, [r4] - mov r12, r7 - lsls r3, r2, 1 - ldr r1, [sp, 0x24] - add r1, sp - str r6, [sp, 0x38] -_081B9F56: - ldrh r0, [r1] - cmp r0, r12 - bne _081B9F66 - mov r0, r10 - cmp r0, 0 - bne _081B9F7C - ldrh r7, [r4] - mov r10, r7 -_081B9F66: - adds r3, 0x2 - adds r1, 0x2 - adds r2, 0x1 - ldr r0, [sp, 0x38] - cmp r2, r0 - bge _081B9F7C - mov r7, r9 - adds r0, r7, r3 - ldrh r0, [r0] - cmp r0, r5 - bne _081B9F56 -_081B9F7C: - cmp r2, r6 - bne _081BA01C - movs r2, 0 - cmp r2, r6 - bge _081B9FD4 - ldr r0, =gBattleFrontierHeldItems - mov r12, r0 - ldr r7, =gUnknown_0203BC8C - ldr r1, [sp, 0x24] - ldr r0, [sp, 0x2C] - adds r4, r1, r0 -_081B9F92: - ldrh r3, [r4] - cmp r3, 0 - beq _081B9FCC - ldr r1, [r7] - lsls r0, r5, 4 - adds r1, r0, r1 - ldrb r0, [r1, 0xA] - lsls r0, 1 - add r0, r12 - ldrh r0, [r0] - cmp r3, r0 - bne _081B9FCC - ldrh r0, [r1] - cmp r0, r10 - bne _081B9FD4 - movs r1, 0 - mov r10, r1 - b _081B9FD4 - .pool -_081B9FCC: - adds r4, 0x2 - adds r2, 0x1 - cmp r2, r6 - blt _081B9F92 -_081B9FD4: - cmp r2, r6 - bne _081BA01C - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - mov r2, r8 - lsls r3, r2, 1 - adds r0, r3, r2 - lsls r0, 2 - adds r1, r0 - movs r6, 0xE7 - lsls r6, 4 - adds r1, r6 - strh r5, [r1] - ldr r0, =gUnknown_0203BC8C - ldr r0, [r0] - lsls r1, r5, 4 - adds r1, r0 - ldrh r0, [r1] - ldr r7, [sp, 0x34] - strh r0, [r7] - ldr r2, =gBattleFrontierHeldItems - ldrb r0, [r1, 0xA] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - ldr r1, [sp, 0x30] - strh r0, [r1] - add r3, r9 - strh r5, [r3] - adds r1, 0x2 - str r1, [sp, 0x30] - adds r2, r7, 0 - adds r2, 0x2 - str r2, [sp, 0x34] - movs r6, 0x1 - add r8, r6 -_081BA01C: - mov r7, r8 - cmp r7, 0x6 - beq _081BA024 - b _081B9F1E -_081BA024: - add sp, 0x3C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81B9EC0 - - thumb_func_start sub_81BA040 -sub_81BA040: @ 81BA040 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - movs r0, 0 - mov r10, r0 - ldr r1, =gUnknown_0203BC88 - ldr r0, =gSlateportBattleTentTrainers - str r0, [r1] - ldr r1, =gUnknown_0203BC8C - ldr r0, =gSlateportBattleTentMons - str r0, [r1] - ldr r7, =gSaveBlock2Ptr - ldr r1, =0x0000ffff - mov r8, r1 -_081BA062: - mov r2, r10 - lsls r6, r2, 1 -_081BA066: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1E - bl __umodsi3 - lsls r0, 16 - lsrs r3, r0, 16 - movs r5, 0 - ldr r1, [r7] - ldr r4, =0x00000cb2 - adds r0, r1, r4 - ldrh r0, [r0] - cmp r5, r0 - bge _081BA0AA - ldr r2, =0x00000cb4 - adds r0, r1, r2 - ldrh r0, [r0] - cmp r0, r3 - beq _081BA0AA - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - adds r0, r1, r4 - ldrh r2, [r0] - adds r4, 0x2 - adds r1, r4 -_081BA09C: - adds r1, 0x2 - adds r5, 0x1 - cmp r5, r2 - bge _081BA0AA - ldrh r0, [r1] - cmp r0, r3 - bne _081BA09C -_081BA0AA: - ldr r0, [r7] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r0, [r0] - cmp r5, r0 - bne _081BA066 - ldr r2, =gUnknown_02038BCA - strh r3, [r2] - ldrh r3, [r2] - ldr r4, =gUnknown_0203BC88 - ldr r1, [r4] - movs r0, 0x34 - muls r0, r3 - adds r0, r1 - ldr r0, [r0, 0x30] - adds r1, r6, r0 - ldrh r0, [r1] - cmp r0, r8 - beq _081BA0DE - ldr r3, =0x0000ffff -_081BA0D2: - adds r1, 0x2 - movs r6, 0x1 - add r10, r6 - ldrh r0, [r1] - cmp r0, r3 - bne _081BA0D2 -_081BA0DE: - mov r0, r10 - cmp r0, 0x8 - bgt _081BA110 - movs r1, 0 - mov r10, r1 - b _081BA062 - .pool -_081BA110: - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r6, =0x00000cb2 - adds r3, r1, r6 - ldrh r0, [r3] - cmp r0, 0x1 - bhi _081BA12A - lsls r0, 1 - ldr r3, =0x00000cb4 - adds r1, r3 - adds r1, r0 - ldrh r0, [r2] - strh r0, [r1] -_081BA12A: - ldrh r1, [r2] - ldr r2, [r4] - movs r0, 0x34 - muls r0, r1 - adds r0, r2 - ldr r0, [r0, 0x30] - mov r9, r0 - movs r5, 0 - ldr r7, =gUnknown_03001298 - mov r8, sp -_081BA13E: - bl Random - lsls r0, 16 - lsrs r0, 16 - mov r1, r10 - bl __modsi3 - lsls r0, 1 - add r0, r9 - ldrh r0, [r0] - strh r0, [r7] - movs r2, 0 - ldrh r0, [r7] - ldr r4, =gUnknown_0203BC8C - ldr r3, [r4] - lsls r0, 4 - adds r0, r3 - ldr r1, =gSaveBlock2Ptr - ldrh r6, [r0] - ldr r1, [r1] -_081BA166: - movs r4, 0xE7 - lsls r4, 4 - adds r0, r1, r4 - ldrh r0, [r0] - lsls r0, 4 - adds r0, r3 - ldrh r0, [r0] - cmp r6, r0 - beq _081BA180 - adds r1, 0xC - adds r2, 0x1 - cmp r2, 0x5 - ble _081BA166 -_081BA180: - cmp r2, 0x6 - bne _081BA220 - movs r4, 0 - cmp r4, r5 - bge _081BA1B0 - mov r0, sp - ldrh r0, [r0] - cmp r0, r6 - beq _081BA1B0 - ldr r6, =gUnknown_03001298 - ldr r3, =gUnknown_0203BC8C - mov r2, sp -_081BA198: - adds r2, 0x2 - adds r4, 0x1 - cmp r4, r5 - bge _081BA1B0 - ldrh r0, [r6] - ldr r1, [r3] - lsls r0, 4 - adds r0, r1 - ldrh r1, [r2] - ldrh r0, [r0] - cmp r1, r0 - bne _081BA198 -_081BA1B0: - cmp r4, r5 - bne _081BA220 - movs r4, 0 - cmp r4, r5 - bge _081BA1E6 - ldr r6, =gBattleFrontierHeldItems - mov r12, r6 - add r3, sp, 0x8 -_081BA1C0: - ldrh r2, [r3] - cmp r2, 0 - beq _081BA1DE - ldr r1, =gUnknown_03001298 - ldrh r0, [r1] - ldr r6, =gUnknown_0203BC8C - ldr r1, [r6] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0xA] - lsls r0, 1 - add r0, r12 - ldrh r0, [r0] - cmp r2, r0 - beq _081BA1E6 -_081BA1DE: - adds r3, 0x2 - adds r4, 0x1 - cmp r4, r5 - blt _081BA1C0 -_081BA1E6: - cmp r4, r5 - bne _081BA220 - lsls r2, r5, 1 - ldrh r0, [r7] - ldr r1, =gUnknown_0203BC8C - ldr r4, [r1] - lsls r0, 4 - adds r0, r4 - ldrh r0, [r0] - mov r3, r8 - strh r0, [r3] - add r1, sp, 0x8 - adds r1, r2 - ldr r3, =gBattleFrontierHeldItems - ldrh r0, [r7] - lsls r0, 4 - adds r0, r4 - ldrb r0, [r0, 0xA] - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - strh r0, [r1] - ldr r0, =gUnknown_03006298 - adds r2, r0 - ldrh r0, [r7] - strh r0, [r2] - movs r4, 0x2 - add r8, r4 - adds r5, 0x1 -_081BA220: - cmp r5, 0x3 - bne _081BA13E - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81BA040 - - thumb_func_start Font6Func -@ int Font6Func(struct TextPrinter *x) -Font6Func: @ 81BA250 - push {r4-r6,lr} - adds r6, r0, 0 - adds r4, r6, 0 - adds r4, 0x14 - ldrb r0, [r6, 0x1C] - cmp r0, 0x6 - bls _081BA260 - b _081BA660 -_081BA260: - lsls r0, 2 - ldr r1, =_081BA270 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081BA270: - .4byte _081BA28C - .4byte _081BA554 - .4byte _081BA566 - .4byte _081BA590 - .4byte _081BA5C8 - .4byte _081BA63C - .4byte _081BA64E -_081BA28C: - ldr r2, =gMain - ldrh r1, [r2, 0x2C] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _081BA2A6 - ldrb r1, [r4] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _081BA2A6 - movs r0, 0 - strb r0, [r6, 0x1E] -_081BA2A6: - ldrb r1, [r6, 0x1E] - cmp r1, 0 - beq _081BA2E8 - ldrb r0, [r6, 0x1D] - cmp r0, 0 - beq _081BA2E8 - subs r0, r1, 0x1 - strb r0, [r6, 0x1E] - ldr r0, =gTextFlags - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081BA2C4 - b _081BA50E -_081BA2C4: - ldrh r1, [r2, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - bne _081BA2D0 - b _081BA50E -_081BA2D0: - ldrb r0, [r4] - movs r1, 0x10 - orrs r0, r1 - strb r0, [r4] - movs r0, 0 - strb r0, [r6, 0x1E] - b _081BA50E - .pool -_081BA2E8: - ldr r2, =gTextFlags - ldrb r1, [r2] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _081BA2FC - movs r0, 0x3 - b _081BA2FE - .pool -_081BA2FC: - ldrb r0, [r6, 0x1D] -_081BA2FE: - strb r0, [r6, 0x1E] - ldr r0, [r6] - ldrb r3, [r0] - adds r0, 0x1 - str r0, [r6] - adds r0, r3, 0 - subs r0, 0xF8 - cmp r0, 0x7 - bls _081BA312 - b _081BA52E -_081BA312: - lsls r0, 2 - ldr r1, =_081BA320 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081BA320: - .4byte _081BA524 - .4byte _081BA512 - .4byte _081BA504 - .4byte _081BA500 - .4byte _081BA36E - .4byte _081BA368 - .4byte _081BA340 - .4byte _081BA660 -_081BA340: - ldrb r0, [r6, 0x6] - strb r0, [r6, 0x8] - ldrb r1, [r6, 0x5] - ldr r0, =gFonts - ldr r2, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r6, 0xB] - ldrb r0, [r0, 0x5] - adds r1, r0 - ldrb r0, [r6, 0x9] - adds r0, r1 - strb r0, [r6, 0x9] -_081BA35E: - movs r0, 0x2 - b _081BA662 - .pool -_081BA368: - ldr r0, [r6] - adds r0, 0x1 - b _081BA4C4 -_081BA36E: - ldr r0, [r6] - ldrb r3, [r0] - adds r0, 0x1 - str r0, [r6] - subs r0, r3, 0x1 - cmp r0, 0xF - bls _081BA37E - b _081BA52E -_081BA37E: - lsls r0, 2 - ldr r1, =_081BA38C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081BA38C: - .4byte _081BA3CC - .4byte _081BA3EE - .4byte _081BA412 - .4byte _081BA42C - .4byte _081BA478 - .4byte _081BA47E - .4byte _081BA35E - .4byte _081BA498 - .4byte _081BA4A8 - .4byte _081BA4BC - .4byte _081BA4C0 - .4byte _081BA4C8 - .4byte _081BA4D2 - .4byte _081BA4DE - .4byte _081BA4EE - .4byte _081BA4C0 -_081BA3CC: - ldr r2, [r6] - ldrb r1, [r2] - lsls r1, 4 - ldrb r3, [r6, 0xC] - movs r0, 0xF - ands r0, r3 - orrs r0, r1 - strb r0, [r6, 0xC] - adds r2, 0x1 - str r2, [r6] - lsls r0, 24 - lsrs r0, 28 - ldrb r2, [r6, 0xD] - lsls r1, r2, 28 - lsrs r1, 28 - lsrs r2, 4 - b _081BA472 -_081BA3EE: - ldr r1, [r6] - ldrb r2, [r1] - movs r0, 0xF - ands r0, r2 - ldrb r3, [r6, 0xD] - movs r2, 0x10 - negs r2, r2 - ands r2, r3 - orrs r2, r0 - strb r2, [r6, 0xD] - adds r1, 0x1 - str r1, [r6] - ldrb r0, [r6, 0xC] - lsrs r0, 4 - lsls r1, r2, 28 - lsrs r1, 28 - lsrs r2, 4 - b _081BA472 -_081BA412: - ldr r1, [r6] - ldrb r0, [r1] - lsls r0, 4 - ldrb r3, [r6, 0xD] - movs r2, 0xF - ands r2, r3 - orrs r2, r0 - strb r2, [r6, 0xD] - adds r1, 0x1 - str r1, [r6] - ldrb r0, [r6, 0xC] - lsrs r0, 4 - b _081BA46A -_081BA42C: - ldr r3, [r6] - ldrb r1, [r3] - lsls r1, 4 - ldrb r4, [r6, 0xC] - movs r2, 0xF - adds r0, r2, 0 - ands r0, r4 - orrs r0, r1 - strb r0, [r6, 0xC] - adds r5, r3, 0x1 - str r5, [r6] - ldrb r3, [r3, 0x1] - adds r1, r2, 0 - ands r1, r3 - ldrb r4, [r6, 0xD] - movs r3, 0x10 - negs r3, r3 - ands r3, r4 - orrs r3, r1 - strb r3, [r6, 0xD] - adds r4, r5, 0x1 - str r4, [r6] - ldrb r1, [r5, 0x1] - lsls r1, 4 - ands r2, r3 - orrs r2, r1 - strb r2, [r6, 0xD] - adds r4, 0x1 - str r4, [r6] - lsls r0, 24 - lsrs r0, 28 -_081BA46A: - lsls r1, r2, 28 - lsrs r1, 28 - lsls r2, 24 - lsrs r2, 28 -_081BA472: - bl GenerateFontHalfRowLookupTable - b _081BA35E -_081BA478: - ldr r0, [r6] - adds r0, 0x1 - b _081BA4C4 -_081BA47E: - ldr r0, [r6] - ldrb r0, [r0] - movs r1, 0xF - ands r1, r0 - ldrb r2, [r4] - movs r0, 0x10 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4] - ldr r0, [r6] - adds r0, 0x1 - b _081BA4C4 -_081BA498: - ldr r0, [r6] - ldrb r1, [r0] - strb r1, [r6, 0x1E] - adds r0, 0x1 - str r0, [r6] - movs r0, 0x6 - strb r0, [r6, 0x1C] - b _081BA35E -_081BA4A8: - movs r0, 0x1 - strb r0, [r6, 0x1C] - ldrb r1, [r2] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _081BA50E - movs r0, 0 - strb r0, [r4, 0x2] - b _081BA50E -_081BA4BC: - movs r0, 0x5 - b _081BA64A -_081BA4C0: - ldr r0, [r6] - adds r0, 0x2 -_081BA4C4: - str r0, [r6] - b _081BA35E -_081BA4C8: - ldr r1, [r6] - adds r0, r1, 0x1 - str r0, [r6] - ldrb r3, [r1, 0x1] - b _081BA52E -_081BA4D2: - ldr r1, [r6] - ldrb r0, [r1] - ldrb r2, [r6, 0x6] - adds r0, r2 - strb r0, [r6, 0x8] - b _081BA4E8 -_081BA4DE: - ldr r1, [r6] - ldrb r0, [r1] - ldrb r2, [r6, 0x7] - adds r0, r2 - strb r0, [r6, 0x9] -_081BA4E8: - adds r1, 0x1 - str r1, [r6] - b _081BA35E -_081BA4EE: - ldrb r0, [r6, 0x4] - ldrb r2, [r6, 0xD] - lsls r2, 28 - lsrs r1, r2, 4 - orrs r1, r2 - lsrs r1, 24 - bl FillWindowPixelBuffer - b _081BA35E -_081BA500: - movs r0, 0x2 - b _081BA506 -_081BA504: - movs r0, 0x3 -_081BA506: - strb r0, [r6, 0x1C] - adds r0, r6, 0 - bl TextPrinterInitDownArrowCounters -_081BA50E: - movs r0, 0x3 - b _081BA662 -_081BA512: - ldr r0, [r6] - ldrb r3, [r0] - movs r2, 0x80 - lsls r2, 1 - adds r1, r2, 0 - orrs r3, r1 - adds r0, 0x1 - str r0, [r6] - b _081BA52E -_081BA524: - ldr r0, [r6] - adds r0, 0x1 - str r0, [r6] - movs r0, 0 - b _081BA662 -_081BA52E: - adds r0, r3, 0 - bl DecompressGlyphFont6 - adds r0, r6, 0 - bl CopyGlyphToWindow - ldr r0, =gUnknown_03002F90 - adds r0, 0x80 - ldrb r1, [r6, 0xA] - ldrb r0, [r0] - adds r1, r0 - ldrb r0, [r6, 0x8] - adds r0, r1 - strb r0, [r6, 0x8] - movs r0, 0 - b _081BA662 - .pool -_081BA554: - adds r0, r6, 0 - bl TextPrinterWait - lsls r0, 16 - cmp r0, 0 - beq _081BA50E - movs r0, 0 - strb r0, [r6, 0x1C] - b _081BA50E -_081BA566: - adds r0, r6, 0 - bl TextPrinterWaitWithDownArrow - lsls r0, 16 - cmp r0, 0 - beq _081BA50E - ldrb r0, [r6, 0x4] - ldrb r2, [r6, 0xD] - lsls r2, 28 - lsrs r1, r2, 4 - orrs r1, r2 - lsrs r1, 24 - bl FillWindowPixelBuffer - ldrb r0, [r6, 0x6] - movs r1, 0 - strb r0, [r6, 0x8] - ldrb r0, [r6, 0x7] - strb r0, [r6, 0x9] - strb r1, [r6, 0x1C] - b _081BA50E -_081BA590: - adds r0, r6, 0 - bl TextPrinterWaitWithDownArrow - lsls r0, 16 - cmp r0, 0 - beq _081BA50E - adds r0, r6, 0 - bl TextPrinterClearDownArrow - ldrb r1, [r6, 0x5] - ldr r0, =gFonts - ldr r2, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r6, 0xB] - ldrb r0, [r0, 0x5] - adds r1, r0 - strb r1, [r6, 0x1F] - ldrb r0, [r6, 0x6] - strb r0, [r6, 0x8] - movs r0, 0x4 - strb r0, [r6, 0x1C] - b _081BA50E - .pool -_081BA5C8: - ldrb r2, [r6, 0x1F] - cmp r2, 0 - beq _081BA638 - ldr r4, =gUnknown_08616124 - ldr r5, =gSaveBlock2Ptr - ldr r0, [r5] - ldrb r0, [r0, 0x14] - lsls r1, r0, 29 - lsrs r0, r1, 29 - adds r0, r4 - ldrb r0, [r0] - cmp r2, r0 - bcs _081BA604 - ldrb r0, [r6, 0x4] - ldrb r1, [r6, 0xD] - lsls r1, 28 - lsrs r3, r1, 4 - orrs r3, r1 - lsrs r3, 24 - movs r1, 0 - bl ScrollWindow - movs r0, 0 - strb r0, [r6, 0x1F] - b _081BA62E - .pool -_081BA604: - ldrb r0, [r6, 0x4] - lsrs r1, 29 - adds r1, r4 - ldrb r2, [r1] - ldrb r1, [r6, 0xD] - lsls r1, 28 - lsrs r3, r1, 4 - orrs r3, r1 - lsrs r3, 24 - movs r1, 0 - bl ScrollWindow - ldr r0, [r5] - ldrb r0, [r0, 0x14] - lsls r0, 29 - lsrs r0, 29 - adds r0, r4 - ldrb r1, [r6, 0x1F] - ldrb r0, [r0] - subs r1, r0 - strb r1, [r6, 0x1F] -_081BA62E: - ldrb r0, [r6, 0x4] - movs r1, 0x2 - bl CopyWindowToVram - b _081BA50E -_081BA638: - strb r2, [r6, 0x1C] - b _081BA50E -_081BA63C: - bl IsSEPlaying - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _081BA64A - b _081BA50E -_081BA64A: - strb r0, [r6, 0x1C] - b _081BA50E -_081BA64E: - ldrb r0, [r6, 0x1E] - adds r1, r0, 0 - cmp r1, 0 - beq _081BA65C - subs r0, 0x1 - strb r0, [r6, 0x1E] - b _081BA50E -_081BA65C: - strb r1, [r6, 0x1C] - b _081BA50E -_081BA660: - movs r0, 0x1 -_081BA662: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end Font6Func - - thumb_func_start DecompressGlyphFont6 -DecompressGlyphFont6: @ 81BA668 - push {r4,r5,lr} - lsls r0, 16 - lsrs r2, r0, 19 - lsls r2, 9 - movs r1, 0xE0 - lsls r1, 11 - ands r1, r0 - lsrs r1, 11 - ldr r0, =gFont6BrailleGlyphs - adds r1, r0 - adds r5, r2, r1 - ldr r4, =gUnknown_03002F90 - adds r0, r5, 0 - adds r1, r4, 0 - bl DecompressGlyphTile - adds r0, r5, 0 - adds r0, 0x10 - adds r1, r4, 0 - adds r1, 0x20 - bl DecompressGlyphTile - movs r1, 0x80 - lsls r1, 1 - adds r0, r5, r1 - adds r1, r4, 0 - adds r1, 0x40 - bl DecompressGlyphTile - movs r1, 0x88 - lsls r1, 1 - adds r0, r5, r1 - adds r1, r4, 0 - adds r1, 0x60 - bl DecompressGlyphTile - adds r0, r4, 0 - adds r0, 0x80 - movs r1, 0x10 - strb r1, [r0] - adds r0, 0x1 - strb r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DecompressGlyphFont6 - - thumb_func_start GetGlyphWidthFont6 -GetGlyphWidthFont6: @ 81BA6CC - movs r0, 0x10 - bx lr - thumb_func_end GetGlyphWidthFont6 - .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_818CFC8.s b/asm/rom_818CFC8.s new file mode 100644 index 000000000..f9a5aa0b5 --- /dev/null +++ b/asm/rom_818CFC8.s @@ -0,0 +1,86880 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + + thumb_func_start nullsub_122 +nullsub_122: @ 818CFC8 + bx lr + thumb_func_end nullsub_122 + + thumb_func_start dp13_810BB8C +dp13_810BB8C: @ 818CFCC + push {r4-r7,lr} + ldr r4, =gUnknown_0860B058 + ldr r3, =gUnknown_0203CD04 + movs r2, 0x7 +_0818CFD4: + adds r1, r3, 0 + adds r0, r4, 0 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + adds r3, 0xC + subs r2, 0x1 + cmp r2, 0 + bge _0818CFD4 + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end dp13_810BB8C + + thumb_func_start load_pokemon_image_TODO +@ int load_pokemon_image_TODO(int species_num, unsigned int a2, u8 a3, void *a4, int a5, u8 a6) +load_pokemon_image_TODO: @ 818CFF4 + push {r4-r7,lr} + sub sp, 0x4 + adds r6, r1, 0 + adds r5, r3, 0 + ldr r3, [sp, 0x18] + ldr r1, [sp, 0x1C] + lsls r0, 16 + lsrs r4, r0, 16 + adds r7, r4, 0 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsls r1, 24 + lsrs r1, 24 + adds r0, r1, 0 + cmp r3, 0 + bne _0818D068 + cmp r2, 0 + beq _0818D034 + cmp r1, 0 + bne _0818D028 + lsls r0, r4, 3 + ldr r1, =gMonFrontPicTable + b _0818D03C + .pool +_0818D028: + lsls r0, r4, 3 + ldr r1, =gMonFrontPicTable + b _0818D054 + .pool +_0818D034: + cmp r0, 0 + bne _0818D050 + lsls r0, r4, 3 + ldr r1, =gMonBackPicTable +_0818D03C: + adds r0, r1 + str r2, [sp] + adds r1, r5, 0 + adds r2, r4, 0 + adds r3, r6, 0 + bl LoadSpecialPokePic + b _0818D08E + .pool +_0818D050: + lsls r0, r4, 3 + ldr r1, =gMonBackPicTable +_0818D054: + adds r0, r1 + str r2, [sp] + adds r1, r5, 0 + adds r2, r4, 0 + adds r3, r6, 0 + bl LoadSpecialPokePic_DontHandleDeoxys + b _0818D08E + .pool +_0818D068: + cmp r2, 0 + beq _0818D080 + lsls r0, r4, 3 + ldr r1, =gTrainerFrontPicTable + adds r0, r1 + adds r1, r5, 0 + adds r2, r4, 0 + bl DecompressPicFromTable + b _0818D08E + .pool +_0818D080: + lsls r0, r7, 3 + ldr r1, =gTrainerBackPicTable + adds r0, r1 + adds r1, r5, 0 + adds r2, r7, 0 + bl DecompressPicFromTable +_0818D08E: + movs r0, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end load_pokemon_image_TODO + + thumb_func_start sub_818D09C +sub_818D09C: @ 818D09C + push {r4,lr} + sub sp, 0x8 + ldr r4, [sp, 0x10] + lsls r0, 16 + lsrs r0, 16 + lsls r2, 24 + lsrs r2, 24 + lsls r4, 24 + lsrs r4, 24 + str r4, [sp] + movs r4, 0 + str r4, [sp, 0x4] + bl load_pokemon_image_TODO + lsls r0, 16 + lsrs r0, 16 + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_818D09C + + thumb_func_start sub_818D0C4 +sub_818D0C4: @ 818D0C4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r1, 0 + mov r8, r2 + ldr r1, [sp, 0x18] + ldr r2, [sp, 0x1C] + lsls r0, 16 + lsrs r4, r0, 16 + adds r6, r4, 0 + lsls r3, 24 + lsrs r5, r3, 24 + mov r12, r5 + lsls r1, 16 + lsrs r3, r1, 16 + adds r1, r3, 0 + lsls r2, 24 + cmp r2, 0 + bne _0818D128 + ldr r0, =0x0000ffff + cmp r3, r0 + bne _0818D110 + ldr r2, =gUnknown_0203CCEC + ldrh r1, [r2, 0x2] + adds r0, r3, 0 + orrs r0, r1 + strh r0, [r2, 0x2] + adds r0, r4, 0 + adds r1, r7, 0 + mov r2, r8 + bl species_and_otid_get_pal + lsls r1, r5, 20 + b _0818D144 + .pool +_0818D110: + ldr r0, =gUnknown_0203CCEC + strh r3, [r0, 0x2] + adds r0, r4, 0 + adds r1, r7, 0 + mov r2, r8 + bl sub_806E7CC + bl LoadCompressedObjectPalette + b _0818D16E + .pool +_0818D128: + ldr r0, =0x0000ffff + cmp r3, r0 + bne _0818D160 + ldr r2, =gUnknown_0203CCEC + ldrh r1, [r2, 0x2] + adds r0, r3, 0 + orrs r0, r1 + strh r0, [r2, 0x2] + ldr r1, =gTrainerFrontPicPaletteTable + lsls r0, r4, 3 + adds r0, r1 + ldr r0, [r0] + mov r2, r12 + lsls r1, r2, 20 +_0818D144: + movs r2, 0x80 + lsls r2, 17 + adds r1, r2 + lsrs r1, 16 + movs r2, 0x20 + bl LoadCompressedPalette + b _0818D16E + .pool +_0818D160: + ldr r0, =gUnknown_0203CCEC + strh r1, [r0, 0x2] + lsls r0, r6, 3 + ldr r1, =gTrainerFrontPicPaletteTable + adds r0, r1 + bl LoadCompressedObjectPalette +_0818D16E: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818D0C4 + + thumb_func_start sub_818D180 +sub_818D180: @ 818D180 + push {r4,r5,lr} + adds r5, r1, 0 + ldr r1, [sp, 0xC] + lsls r0, 16 + lsrs r0, 16 + lsls r3, 24 + lsrs r4, r3, 24 + lsls r1, 24 + cmp r1, 0 + bne _0818D1A4 + adds r1, r5, 0 + bl species_and_otid_get_pal + lsls r1, r4, 4 + movs r2, 0x20 + bl LoadCompressedPalette + b _0818D1B4 +_0818D1A4: + ldr r1, =gTrainerFrontPicPaletteTable + lsls r0, 3 + adds r0, r1 + ldr r0, [r0] + lsls r1, r4, 4 + movs r2, 0x20 + bl LoadCompressedPalette +_0818D1B4: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818D180 + + thumb_func_start uns_builder_assign_animtable1 +uns_builder_assign_animtable1: @ 818D1C0 + push {lr} + lsls r0, 24 + cmp r0, 0 + bne _0818D1D8 + ldr r1, =gUnknown_0203CCEC + ldr r0, =gUnknown_082FF70C + str r0, [r1, 0x8] + b _0818D1E0 + .pool +_0818D1D8: + ldr r0, =gUnknown_0203CCEC + ldr r1, =gUnknown_0830536C + ldr r1, [r1] + str r1, [r0, 0x8] +_0818D1E0: + pop {r0} + bx r0 + .pool + thumb_func_end uns_builder_assign_animtable1 + + thumb_func_start oamt_spawn_poke_or_trainer_picture +oamt_spawn_poke_or_trainer_picture: @ 818D1EC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x30 + str r1, [sp, 0xC] + str r2, [sp, 0x10] + ldr r1, [sp, 0x50] + ldr r2, [sp, 0x54] + ldr r4, [sp, 0x58] + ldr r5, [sp, 0x5C] + ldr r6, [sp, 0x60] + ldr r7, [sp, 0x64] + mov r8, r7 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x8] + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x14] + lsls r1, 16 + lsrs r1, 16 + str r1, [sp, 0x18] + lsls r2, 16 + lsrs r2, 16 + str r2, [sp, 0x1C] + lsls r4, 24 + lsrs r4, 24 + str r4, [sp, 0x20] + lsls r5, 16 + lsrs r5, 16 + mov r10, r5 + lsls r6, 24 + lsrs r6, 24 + mov r9, r6 + mov r0, r8 + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + ldr r1, =gUnknown_0203CD04 + ldrb r0, [r1, 0xB] + cmp r0, 0 + beq _0818D25C +_0818D244: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bhi _0818D25C + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0xB] + cmp r0, 0 + bne _0818D244 +_0818D25C: + cmp r4, 0x8 + beq _0818D280 + movs r0, 0x80 + lsls r0, 6 + bl Alloc + adds r7, r0, 0 + cmp r7, 0 + beq _0818D280 + movs r0, 0x20 + bl Alloc + mov r8, r0 + cmp r0, 0 + bne _0818D28C + adds r0, r7, 0 + bl Free +_0818D280: + ldr r0, =0x0000ffff + b _0818D356 + .pool +_0818D28C: + mov r1, r9 + str r1, [sp] + str r5, [sp, 0x4] + ldr r0, [sp, 0x8] + ldr r1, [sp, 0x10] + ldr r2, [sp, 0x14] + adds r3, r7, 0 + bl load_pokemon_image_TODO + lsls r0, 16 + cmp r0, 0 + bne _0818D280 + lsls r2, r4, 1 + str r2, [sp, 0x2C] + ldr r5, =gUnknown_0203CCEC + ldr r0, =gUnknown_0860B064 + mov r12, r0 + ldr r1, [sp, 0x18] + lsls r1, 16 + str r1, [sp, 0x24] + ldr r2, [sp, 0x1C] + lsls r2, 16 + str r2, [sp, 0x28] + movs r3, 0x80 + lsls r3, 4 + mov r0, r8 + adds r1, r7, 0 + adds r6, r3, 0 + movs r2, 0x3 +_0818D2C6: + str r1, [r0] + strh r3, [r0, 0x4] + adds r0, 0x8 + adds r1, r6 + subs r2, 0x1 + cmp r2, 0 + bge _0818D2C6 + ldr r0, =0x0000ffff + strh r0, [r5] + mov r0, r12 + str r0, [r5, 0x4] + mov r0, r9 + bl uns_builder_assign_animtable1 + mov r1, r8 + str r1, [r5, 0xC] + ldr r0, =gDummySpriteAffineAnimTable + str r0, [r5, 0x10] + ldr r0, =nullsub_122 + str r0, [r5, 0x14] + mov r2, r10 + str r2, [sp] + mov r0, r9 + str r0, [sp, 0x4] + ldr r0, [sp, 0x8] + ldr r1, [sp, 0xC] + ldr r2, [sp, 0x10] + ldr r3, [sp, 0x20] + bl sub_818D0C4 + ldr r2, [sp, 0x24] + asrs r1, r2, 16 + ldr r0, [sp, 0x28] + asrs r2, r0, 16 + adds r0, r5, 0 + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r2, r0, 24 + adds r6, r2, 0 + ldr r0, =0x0000ffff + cmp r10, r0 + bne _0818D336 + ldr r0, =gSprites + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldr r2, [sp, 0x20] + lsls r3, r2, 4 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r3 + strb r0, [r1, 0x5] +_0818D336: + ldr r1, =gUnknown_0203CD04 + ldr r2, [sp, 0x2C] + adds r0, r2, r4 + lsls r0, 2 + adds r2, r0, r1 + str r7, [r2] + adds r1, 0x4 + adds r0, r1 + mov r7, r8 + str r7, [r0] + mov r0, r10 + strh r0, [r2, 0x8] + strb r6, [r2, 0xA] + movs r0, 0x1 + strb r0, [r2, 0xB] + adds r0, r6, 0 +_0818D356: + add sp, 0x30 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end oamt_spawn_poke_or_trainer_picture + + thumb_func_start sub_818D384 +sub_818D384: @ 818D384 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x18 + ldr r4, [sp, 0x34] + ldr r5, [sp, 0x38] + ldr r6, [sp, 0x3C] + ldr r7, [sp, 0x40] + mov r8, r7 + ldr r7, [sp, 0x44] + mov r9, r7 + lsls r0, 16 + lsrs r0, 16 + lsls r3, 24 + lsrs r3, 24 + lsls r6, 24 + lsrs r6, 24 + mov r7, r8 + lsls r7, 16 + lsrs r7, 16 + mov r8, r7 + mov r7, r9 + lsls r7, 24 + lsrs r7, 24 + lsls r4, 16 + asrs r4, 16 + str r4, [sp] + lsls r5, 16 + asrs r5, 16 + str r5, [sp, 0x4] + str r6, [sp, 0x8] + mov r4, r8 + str r4, [sp, 0xC] + str r7, [sp, 0x10] + movs r4, 0 + str r4, [sp, 0x14] + bl oamt_spawn_poke_or_trainer_picture + lsls r0, 16 + lsrs r0, 16 + add sp, 0x18 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_818D384 + + thumb_func_start sub_818D3E4 +sub_818D3E4: @ 818D3E4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x2C + str r1, [sp, 0x8] + str r2, [sp, 0xC] + ldr r1, [sp, 0x4C] + ldr r2, [sp, 0x50] + ldr r4, [sp, 0x54] + ldr r5, [sp, 0x58] + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + lsls r3, 24 + lsrs r6, r3, 24 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp, 0x10] + lsls r2, 16 + lsrs r2, 16 + str r2, [sp, 0x14] + lsls r4, 24 + lsrs r4, 24 + str r4, [sp, 0x18] + lsls r5, 16 + lsrs r5, 16 + str r5, [sp, 0x1C] + movs r5, 0 + ldr r1, =gUnknown_0203CD04 + ldrb r0, [r1, 0xB] + cmp r0, 0 + beq _0818D440 +_0818D428: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x7 + bhi _0818D440 + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0xB] + cmp r0, 0 + bne _0818D428 +_0818D440: + cmp r5, 0x8 + beq _0818D47C + movs r0, 0x80 + lsls r0, 6 + bl Alloc + adds r7, r0, 0 + cmp r7, 0 + beq _0818D47C + movs r0, 0x80 + ands r0, r6 + cmp r0, 0 + beq _0818D468 + movs r0, 0x7F + ands r6, r0 + movs r0, 0x3 + mov r9, r0 + b _0818D46A + .pool +_0818D468: + mov r9, r6 +_0818D46A: + movs r0, 0x20 + bl Alloc + mov r8, r0 + cmp r0, 0 + bne _0818D484 + adds r0, r7, 0 + bl Free +_0818D47C: + ldr r0, =0x0000ffff + b _0818D588 + .pool +_0818D484: + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + mov r0, r10 + ldr r1, [sp, 0xC] + adds r2, r6, 0 + adds r3, r7, 0 + bl load_pokemon_image_TODO + lsls r0, 16 + cmp r0, 0 + bne _0818D47C + lsls r1, r5, 1 + str r1, [sp, 0x28] + ldr r4, =gUnknown_0203CCEC + mov r2, r10 + lsls r2, 2 + mov r12, r2 + ldr r0, [sp, 0x10] + lsls r0, 16 + str r0, [sp, 0x20] + ldr r1, [sp, 0x14] + lsls r1, 16 + str r1, [sp, 0x24] + movs r3, 0x80 + lsls r3, 4 + mov r0, r8 + adds r1, r7, 0 + adds r6, r3, 0 + movs r2, 0x3 +_0818D4C0: + str r1, [r0] + strh r3, [r0, 0x4] + adds r0, 0x8 + adds r1, r6 + subs r2, 0x1 + cmp r2, 0 + bge _0818D4C0 + ldr r0, =0x0000ffff + strh r0, [r4] + ldr r0, =gUnknown_08309AAC + add r0, r12 + ldr r0, [r0] + str r0, [r4, 0x8] + mov r2, r8 + str r2, [r4, 0xC] + mov r0, r9 + cmp r0, 0x1 + bne _0818D4F8 + ldr r0, =gUnknown_082FF694 + b _0818D500 + .pool +_0818D4F8: + mov r1, r9 + cmp r1, 0 + bne _0818D510 + ldr r0, =gUnknown_082FF618 +_0818D500: + str r0, [r4, 0x10] + ldr r0, =gUnknown_0860B06C + str r0, [r4, 0x4] + b _0818D518 + .pool +_0818D510: + ldr r0, =gUnknown_0860B064 + str r0, [r4, 0x4] + ldr r0, =gDummySpriteAffineAnimTable + str r0, [r4, 0x10] +_0818D518: + ldr r2, =nullsub_122 + str r2, [r4, 0x14] + ldr r0, [sp, 0x1C] + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + mov r0, r10 + ldr r1, [sp, 0x8] + ldr r2, [sp, 0xC] + ldr r3, [sp, 0x18] + bl sub_818D0C4 + ldr r2, [sp, 0x20] + asrs r1, r2, 16 + ldr r0, [sp, 0x24] + asrs r2, r0, 16 + adds r0, r4, 0 + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r2, r0, 24 + adds r6, r2, 0 + ldr r0, =0x0000ffff + ldr r1, [sp, 0x1C] + cmp r1, r0 + bne _0818D566 + ldr r0, =gSprites + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldr r2, [sp, 0x18] + lsls r3, r2, 4 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r3 + strb r0, [r1, 0x5] +_0818D566: + ldr r1, =gUnknown_0203CD04 + ldr r2, [sp, 0x28] + adds r0, r2, r5 + lsls r0, 2 + adds r2, r0, r1 + str r7, [r2] + adds r1, 0x4 + adds r0, r1 + mov r1, r8 + str r1, [r0] + mov r0, sp + ldrh r0, [r0, 0x1C] + strh r0, [r2, 0x8] + strb r6, [r2, 0xA] + movs r0, 0x1 + strb r0, [r2, 0xB] + adds r0, r6, 0 +_0818D588: + add sp, 0x2C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_818D3E4 + + thumb_func_start sub_818D5B0 +sub_818D5B0: @ 818D5B0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + lsrs r4, r0, 16 + movs r2, 0 + ldr r0, =gUnknown_0203CD04 + ldrb r1, [r0, 0xA] + adds r3, r0, 0 + cmp r1, r4 + beq _0818D5E0 + adds r1, r3, 0 +_0818D5C8: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x7 + bhi _0818D5E0 + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0xA] + cmp r0, r4 + bne _0818D5C8 +_0818D5E0: + cmp r2, 0x8 + bne _0818D5F0 + ldr r0, =0x0000ffff + b _0818D646 + .pool +_0818D5F0: + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r5, r0, r3 + ldr r1, [r5] + mov r8, r1 + adds r1, r3, 0x4 + adds r0, r1 + ldr r7, [r0] + ldrh r1, [r5, 0x8] + ldr r0, =0x0000ffff + lsls r6, r4, 4 + cmp r1, r0 + beq _0818D624 + ldr r1, =gSprites + adds r0, r6, r4 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x5] + lsrs r0, 4 + bl GetSpritePaletteTagByPaletteNum + lsls r0, 16 + lsrs r0, 16 + bl FreeSpritePaletteByTag +_0818D624: + adds r0, r6, r4 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + bl DestroySprite + mov r0, r8 + bl Free + adds r0, r7, 0 + bl Free + adds r1, r5, 0 + ldr r0, =gUnknown_0860B058 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + movs r0, 0 +_0818D646: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_818D5B0 + + thumb_func_start sub_818D65C +sub_818D65C: @ 818D65C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + mov r9, r1 + adds r7, r2, 0 + adds r4, r3, 0 + ldr r1, [sp, 0x20] + ldr r2, [sp, 0x24] + ldr r3, [sp, 0x28] + lsls r0, 16 + lsrs r5, r0, 16 + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r6, r3, 24 + adds r0, r2, 0 + movs r1, 0x7 + bl GetWindowAttribute + adds r3, r0, 0 + movs r0, 0 + str r0, [sp] + adds r0, r5, 0 + adds r1, r7, 0 + adds r2, r4, 0 + bl sub_818D09C + lsls r0, 16 + cmp r0, 0 + bne _0818D6B8 + str r6, [sp] + adds r0, r5, 0 + mov r1, r9 + adds r2, r7, 0 + mov r3, r8 + bl sub_818D180 + movs r0, 0 + b _0818D6BA +_0818D6B8: + ldr r0, =0x0000ffff +_0818D6BA: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_818D65C + + thumb_func_start sub_818D6CC +sub_818D6CC: @ 818D6CC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + str r1, [sp, 0x18] + str r2, [sp, 0x1C] + ldr r1, [sp, 0x44] + ldr r2, [sp, 0x48] + ldr r4, [sp, 0x4C] + ldr r5, [sp, 0x50] + ldr r6, [sp, 0x54] + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + lsls r3, 24 + lsrs r7, r3, 24 + lsls r1, 16 + lsrs r1, 16 + mov r10, r1 + lsls r2, 16 + lsrs r2, 16 + mov r8, r2 + lsls r4, 24 + lsrs r4, 24 + str r4, [sp, 0x20] + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + movs r0, 0x80 + lsls r0, 6 + bl Alloc + adds r4, r0, 0 + cmp r4, 0 + beq _0818D762 + str r6, [sp] + mov r0, r9 + ldr r1, [sp, 0x1C] + adds r2, r7, 0 + adds r3, r4, 0 + bl sub_818D09C + lsls r0, 16 + cmp r0, 0 + bne _0818D762 + movs r0, 0x40 + str r0, [sp] + str r0, [sp, 0x4] + mov r1, r10 + str r1, [sp, 0x8] + mov r1, r8 + str r1, [sp, 0xC] + str r0, [sp, 0x10] + str r0, [sp, 0x14] + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl BlitBitmapRectToWindow + str r6, [sp] + mov r0, r9 + ldr r1, [sp, 0x18] + ldr r2, [sp, 0x1C] + ldr r3, [sp, 0x20] + bl sub_818D180 + adds r0, r4, 0 + bl Free + movs r0, 0 + b _0818D764 +_0818D762: + ldr r0, =0x0000ffff +_0818D764: + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_818D6CC + + thumb_func_start sub_818D778 +sub_818D778: @ 818D778 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x18 + ldr r4, [sp, 0x34] + ldr r5, [sp, 0x38] + ldr r6, [sp, 0x3C] + ldr r7, [sp, 0x40] + mov r8, r7 + ldr r7, [sp, 0x44] + mov r9, r7 + lsls r0, 16 + lsrs r0, 16 + lsls r3, 24 + lsrs r3, 24 + lsls r6, 24 + lsrs r6, 24 + mov r7, r8 + lsls r7, 16 + lsrs r7, 16 + mov r8, r7 + mov r7, r9 + lsls r7, 24 + lsrs r7, 24 + lsls r4, 16 + asrs r4, 16 + str r4, [sp] + lsls r5, 16 + asrs r5, 16 + str r5, [sp, 0x4] + str r6, [sp, 0x8] + mov r4, r8 + str r4, [sp, 0xC] + movs r4, 0 + str r4, [sp, 0x10] + str r7, [sp, 0x14] + bl oamt_spawn_poke_or_trainer_picture + lsls r0, 16 + lsrs r0, 16 + add sp, 0x18 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_818D778 + + thumb_func_start sub_818D7D8 +sub_818D7D8: @ 818D7D8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x14 + ldr r4, [sp, 0x2C] + ldr r5, [sp, 0x30] + ldr r6, [sp, 0x34] + ldr r7, [sp, 0x38] + lsls r0, 16 + lsrs r0, 16 + lsls r3, 24 + lsrs r3, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r7, 16 + lsrs r7, 16 + lsls r4, 16 + asrs r4, 16 + str r4, [sp] + lsls r5, 16 + asrs r5, 16 + str r5, [sp, 0x4] + str r6, [sp, 0x8] + str r7, [sp, 0xC] + movs r4, 0 + str r4, [sp, 0x10] + bl sub_818D778 + lsls r0, 16 + lsrs r0, 16 + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_818D7D8 + + thumb_func_start sub_818D820 +sub_818D820: @ 818D820 + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl sub_818D5B0 + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_818D820 + + thumb_func_start sub_818D834 +sub_818D834: @ 818D834 + push {r4,r5,lr} + sub sp, 0xC + ldr r4, [sp, 0x18] + ldr r5, [sp, 0x1C] + lsls r0, 16 + lsrs r0, 16 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + str r4, [sp] + str r5, [sp, 0x4] + movs r4, 0 + str r4, [sp, 0x8] + bl sub_818D65C + lsls r0, 16 + lsrs r0, 16 + add sp, 0xC + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_818D834 + + thumb_func_start sub_818D864 +sub_818D864: @ 818D864 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x14 + ldr r4, [sp, 0x2C] + ldr r5, [sp, 0x30] + ldr r6, [sp, 0x34] + ldr r7, [sp, 0x38] + lsls r0, 16 + lsrs r0, 16 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 24 + lsrs r6, 24 + lsls r7, 24 + lsrs r7, 24 + str r4, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + str r7, [sp, 0xC] + movs r4, 0 + str r4, [sp, 0x10] + bl sub_818D6CC + lsls r0, 16 + lsrs r0, 16 + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_818D864 + + thumb_func_start sub_818D8AC +sub_818D8AC: @ 818D8AC + push {r4,r5,lr} + sub sp, 0x14 + adds r5, r1, 0 + ldr r1, [sp, 0x20] + ldr r4, [sp, 0x24] + lsls r0, 16 + lsrs r0, 16 + lsls r5, 24 + lsrs r5, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r4, 16 + lsrs r4, 16 + lsls r2, 16 + asrs r2, 16 + str r2, [sp] + lsls r3, 16 + asrs r3, 16 + str r3, [sp, 0x4] + str r1, [sp, 0x8] + str r4, [sp, 0xC] + movs r1, 0x1 + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0 + adds r3, r5, 0 + bl sub_818D384 + lsls r0, 16 + lsrs r0, 16 + add sp, 0x14 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_818D8AC + + thumb_func_start sub_818D8F0 +sub_818D8F0: @ 818D8F0 + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl sub_818D5B0 + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_818D8F0 + + thumb_func_start sub_818D904 +sub_818D904: @ 818D904 + push {r4,lr} + sub sp, 0xC + adds r4, r1, 0 + lsls r0, 16 + lsrs r0, 16 + lsls r4, 24 + lsrs r4, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + str r2, [sp] + str r3, [sp, 0x4] + movs r1, 0x1 + str r1, [sp, 0x8] + movs r1, 0 + movs r2, 0 + adds r3, r4, 0 + bl sub_818D65C + lsls r0, 16 + lsrs r0, 16 + add sp, 0xC + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_818D904 + + thumb_func_start sub_818D938 +sub_818D938: @ 818D938 + push {r4,r5,lr} + sub sp, 0x14 + adds r5, r1, 0 + ldr r1, [sp, 0x20] + ldr r4, [sp, 0x24] + lsls r0, 16 + lsrs r0, 16 + lsls r5, 24 + lsrs r5, 24 + lsls r2, 16 + lsrs r2, 16 + lsls r3, 16 + lsrs r3, 16 + lsls r1, 24 + lsrs r1, 24 + lsls r4, 24 + lsrs r4, 24 + str r2, [sp] + str r3, [sp, 0x4] + str r1, [sp, 0x8] + str r4, [sp, 0xC] + movs r1, 0x1 + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0 + adds r3, r5, 0 + bl sub_818D6CC + lsls r0, 16 + lsrs r0, 16 + add sp, 0x14 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_818D938 + + thumb_func_start sub_818D97C +sub_818D97C: @ 818D97C + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x1 + bne _0818D9A2 + cmp r0, 0 + beq _0818D99C + ldr r0, =gTrainerPicIndices + adds r0, 0x3F + ldrb r0, [r0] + b _0818D9A2 + .pool +_0818D99C: + ldr r0, =gTrainerPicIndices + adds r0, 0x3C + ldrb r0, [r0] +_0818D9A2: + pop {r1} + bx r1 + .pool + thumb_func_end sub_818D97C + + thumb_func_start sub_818D9AC +sub_818D9AC: @ 818D9AC + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00003b58 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_818D9AC + + thumb_func_start sub_818D9C0 +sub_818D9C0: @ 818D9C0 + push {r4,r5,lr} + ldr r5, =0x00004010 + ldr r4, =gUnknown_0860B07E + bl sub_818D9AC + lsls r0, 24 + lsrs r0, 23 + adds r0, r4 + ldrh r1, [r0] + adds r0, r5, 0 + bl VarSet + bl sub_818D9AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _0818DA20 + ldr r0, =gSaveBlock1Ptr + ldr r1, [r0] + ldr r0, =0x00003b58 + adds r1, r0 + ldr r0, =0x00004011 + ldr r2, =gUnknown_0860B074 + ldrb r1, [r1, 0xD] + lsls r1, 1 + adds r1, r2 + ldrh r1, [r1] + bl VarSet + ldr r1, =gScriptResult + movs r0, 0x1 + b _0818DA24 + .pool +_0818DA20: + ldr r1, =gScriptResult + movs r0, 0 +_0818DA24: + strh r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818D9C0 + + thumb_func_start sub_818DA30 +sub_818DA30: @ 818DA30 + push {lr} + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldrb r1, [r0, 0xB] + lsls r1, 8 + ldrb r0, [r0, 0xA] + orrs r0, r1 + movs r1, 0x6 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 17 + adds r1, r0, 0 + cmp r0, 0x1 + beq _0818DA68 + cmp r0, 0x1 + bgt _0818DA5C + cmp r0, 0 + beq _0818DA62 + b _0818DA72 + .pool +_0818DA5C: + cmp r1, 0x2 + beq _0818DA6E + b _0818DA72 +_0818DA62: + bl sub_818DF68 + b _0818DA72 +_0818DA68: + bl sub_818DB7C + b _0818DA72 +_0818DA6E: + bl sub_818E638 +_0818DA72: + pop {r0} + bx r0 + thumb_func_end sub_818DA30 + + thumb_func_start sub_818DA78 +sub_818DA78: @ 818DA78 + push {lr} + bl sub_818D9AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0818DA9C + cmp r0, 0x1 + bgt _0818DA90 + cmp r0, 0 + beq _0818DA96 + b _0818DAA6 +_0818DA90: + cmp r0, 0x2 + beq _0818DAA2 + b _0818DAA6 +_0818DA96: + bl sub_818E004 + b _0818DAA6 +_0818DA9C: + bl sub_818DBC4 + b _0818DAA6 +_0818DAA2: + bl sub_818E674 +_0818DAA6: + pop {r0} + bx r0 + thumb_func_end sub_818DA78 + + thumb_func_start sub_818DAAC +sub_818DAAC: @ 818DAAC + push {lr} + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x1 + beq _0818DADC + cmp r0, 0x1 + bgt _0818DAD0 + cmp r0, 0 + beq _0818DAD6 + b _0818DAE6 +_0818DAD0: + cmp r1, 0x2 + beq _0818DAE2 + b _0818DAE6 +_0818DAD6: + bl sub_818DF68 + b _0818DAE6 +_0818DADC: + bl sub_818DB7C + b _0818DAE6 +_0818DAE2: + bl sub_818E638 +_0818DAE6: + pop {r0} + bx r0 + thumb_func_end sub_818DAAC + + thumb_func_start sub_818DAEC +sub_818DAEC: @ 818DAEC + push {r4,lr} + ldr r4, =gScriptResult + bl sub_818D9AC + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818DAEC + + thumb_func_start sub_818DB04 +sub_818DB04: @ 818DB04 + push {lr} + adds r1, r0, 0 + movs r2, 0 + b _0818DB14 +_0818DB0C: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + adds r1, 0x2 +_0818DB14: + ldrh r0, [r1] + cmp r0, 0 + bne _0818DB0C + adds r0, r2, 0 + pop {r1} + bx r1 + thumb_func_end sub_818DB04 + + thumb_func_start sub_818DB20 +sub_818DB20: @ 818DB20 + push {r4-r6,lr} + bl Random + ldr r5, =gUnknown_0203CD64 + ldr r4, [r5] + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x6 + bl __umodsi3 + strb r0, [r4, 0xC] + ldr r6, =gUnknown_0860B2EC + ldr r0, [r5] + ldrb r0, [r0, 0xC] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + bl sub_818DB04 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl Random + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl __modsi3 + lsls r0, 24 + ldr r2, [r5] + ldrb r1, [r2, 0xC] + lsls r1, 2 + adds r1, r6 + ldr r1, [r1] + lsrs r0, 23 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2, 0x10] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818DB20 + + thumb_func_start sub_818DB7C +sub_818DB7C: @ 818DB7C + push {lr} + ldr r2, =gUnknown_0203CD64 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00003b58 + adds r0, r1 + str r0, [r2] + movs r3, 0 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r2] + strb r3, [r0, 0x1] + ldr r1, [r2] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r0, [r2] + strb r3, [r0, 0x2] + ldr r0, [r2] + strb r3, [r0, 0x3] + ldr r1, [r2] + strh r3, [r1, 0xE] + ldr r0, =gGameLanguage + ldrb r0, [r0] + strb r0, [r1, 0x12] + bl sub_818DB20 + pop {r0} + bx r0 + .pool + thumb_func_end sub_818DB7C + + thumb_func_start sub_818DBC4 +sub_818DBC4: @ 818DBC4 + ldr r3, =gUnknown_0203CD64 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00003b58 + adds r0, r1 + str r0, [r3] + movs r2, 0 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r3] + strb r2, [r0, 0x1] + bx lr + .pool + thumb_func_end sub_818DBC4 + + thumb_func_start sub_818DBE8 +sub_818DBE8: @ 818DBE8 + push {lr} + ldr r1, =gUnknown_0203CD64 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r2, =0x00003b58 + adds r0, r2 + str r0, [r1] + ldrb r0, [r0, 0x1] + cmp r0, 0x2 + bne _0818DC0C + movs r0, 0x2 + b _0818DC16 + .pool +_0818DC0C: + cmp r0, 0x1 + beq _0818DC14 + movs r0, 0 + b _0818DC16 +_0818DC14: + movs r0, 0x1 +_0818DC16: + pop {r1} + bx r1 + thumb_func_end sub_818DBE8 + + thumb_func_start sub_818DC1C +sub_818DC1C: @ 818DC1C + lsls r0, 24 + ldr r1, =gUnknown_0860B224 + lsrs r0, 22 + adds r0, r1 + ldr r0, [r0] + bx lr + .pool + thumb_func_end sub_818DC1C + + thumb_func_start sub_818DC2C +sub_818DC2C: @ 818DC2C + push {r4,lr} + ldr r1, =gUnknown_0203CD64 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r2, =0x00003b58 + adds r0, r2 + str r0, [r1] + ldr r4, =gStringVar1 + ldrb r0, [r0, 0xC] + bl sub_818DC1C + adds r1, r0, 0 + adds r0, r4, 0 + bl StringCopy + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818DC2C + + thumb_func_start sub_818DC60 +sub_818DC60: @ 818DC60 + push {r4,r5,lr} + ldr r5, =gUnknown_0203CD64 + ldr r0, =gSaveBlock1Ptr + ldr r1, [r0] + ldr r2, =0x00003b58 + adds r0, r1, r2 + str r0, [r5] + ldrb r0, [r0, 0x4] + cmp r0, 0xFF + bne _0818DC84 + movs r0, 0 + b _0818DC9C + .pool +_0818DC84: + ldr r4, =gStringVar3 + ldr r0, =0x00003b5c + adds r1, r0 + adds r0, r4, 0 + bl StringCopy7 + ldr r0, [r5] + ldrb r1, [r0, 0x12] + adds r0, r4, 0 + bl ConvertInternationalString + movs r0, 0x1 +_0818DC9C: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_818DC60 + + thumb_func_start sub_818DCAC +sub_818DCAC: @ 818DCAC + push {r4,lr} + adds r4, r0, 0 + lsls r0, r1, 16 + lsrs r0, 16 + bl ItemId_GetItem + adds r1, r0, 0 + adds r0, r4, 0 + bl StringCopy + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_818DCAC + + thumb_func_start sub_818DCC8 +sub_818DCC8: @ 818DCC8 + push {lr} + ldr r2, =gUnknown_0203CD64 + ldr r0, =gSaveBlock1Ptr + ldr r1, [r0] + ldr r0, =0x00003b58 + adds r1, r0 + str r1, [r2] + ldr r0, =gStringVar2 + ldrh r1, [r1, 0xE] + bl sub_818DCAC + pop {r0} + bx r0 + .pool + thumb_func_end sub_818DCC8 + + thumb_func_start sub_818DCF4 +sub_818DCF4: @ 818DCF4 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + movs r1, 0xFF + movs r2, 0x8 + bl memset + adds r0, r4, 0 + adds r1, r5, 0 + bl StringCopy7 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_818DCF4 + + thumb_func_start sub_818DD14 +sub_818DD14: @ 818DD14 + push {r4,r5,lr} + ldr r5, =gUnknown_0203CD64 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r2, =0x00003b58 + adds r1, r0, r2 + str r1, [r5] + ldr r1, =0x00003b5c + adds r0, r1 + ldr r4, =gStringVar3 + adds r1, r4, 0 + bl sub_818DCF4 + ldr r0, [r5] + ldrb r1, [r0, 0x12] + adds r0, r4, 0 + bl ConvertInternationalString + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818DD14 + + thumb_func_start sub_818DD54 +sub_818DD54: @ 818DD54 + ldr r1, =gUnknown_0203CD64 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r2, =0x00003b58 + adds r0, r2 + str r0, [r1] + ldrb r1, [r0, 0x2] + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + bx lr + .pool + thumb_func_end sub_818DD54 + + thumb_func_start sub_818DD78 +sub_818DD78: @ 818DD78 + push {lr} + bl sub_81AAC50 + pop {r0} + bx r0 + thumb_func_end sub_818DD78 + + thumb_func_start sub_818DD84 +sub_818DD84: @ 818DD84 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + lsrs r5, r0, 16 + ldr r4, =gUnknown_0203CD64 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00003b58 + adds r0, r1 + str r0, [r4] + ldr r1, =gUnknown_0860B2EC + mov r8, r1 + ldrb r0, [r0, 0xC] + lsls r0, 2 + add r0, r8 + ldr r0, [r0] + bl sub_818DB04 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, [r4] + movs r0, 0x1 + strb r0, [r1, 0x1] + ldr r0, =gStringVar2 + adds r1, r5, 0 + bl sub_818DCAC + ldr r1, [r4] + strh r5, [r1, 0xE] + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r1, 0x4 + bl sub_818DCF4 + ldr r1, [r4] + ldr r0, =gGameLanguage + ldrb r0, [r0] + strb r0, [r1, 0x12] + movs r7, 0 + movs r3, 0 + cmp r7, r6 + bcs _0818DE36 + mov r12, r8 +_0818DDDC: + ldr r2, [r4] + ldrb r0, [r2, 0xC] + lsls r0, 2 + add r0, r12 + ldr r1, [r0] + lsls r0, r3, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r5 + bne _0818DE28 + movs r7, 0x1 + ldrb r0, [r2, 0x3] + adds r0, 0x1 + strb r0, [r2, 0x3] + ldr r0, [r4] + strb r7, [r0, 0x2] + ldr r1, [r4] + ldrh r0, [r1, 0x10] + cmp r0, r5 + bne _0818DE36 + movs r0, 0x5 + strb r0, [r1, 0x3] + b _0818DE36 + .pool +_0818DE28: + movs r0, 0 + strb r0, [r2, 0x2] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r6 + bcc _0818DDDC +_0818DE36: + adds r0, r7, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_818DD84 + + thumb_func_start sub_818DE44 +sub_818DE44: @ 818DE44 + push {lr} + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + bl sub_818DD84 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_818DE44 + + thumb_func_start sub_818DE5C +sub_818DE5C: @ 818DE5C + push {lr} + ldr r1, =gUnknown_0203CD64 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r2, =0x00003b58 + adds r0, r2 + str r0, [r1] + ldrb r0, [r0, 0x3] + movs r1, 0 + cmp r0, 0x4 + bls _0818DE74 + movs r1, 0x1 +_0818DE74: + adds r0, r1, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_818DE5C + + thumb_func_start sub_818DE88 +sub_818DE88: @ 818DE88 + push {lr} + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r0, =gStringVar2 + bl sub_818DCAC + pop {r0} + bx r0 + .pool + thumb_func_end sub_818DE88 + + thumb_func_start sub_818DEA0 +sub_818DEA0: @ 818DEA0 + push {r4,r5,lr} + ldr r5, =gUnknown_0203CD64 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00003b58 + adds r0, r1 + str r0, [r5] + ldr r1, =gUnknown_0860B304 + ldrb r0, [r0, 0xC] + lsls r0, 1 + adds r0, r1 + ldrh r4, [r0] + adds r0, r4, 0 + bl sub_818DE88 + ldr r1, [r5] + movs r0, 0x2 + strb r0, [r1, 0x1] + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_818DEA0 + + thumb_func_start sub_818DEDC +sub_818DEDC: @ 818DEDC + push {lr} + bl sub_818DB7C + ldr r0, =gUnknown_0203CD64 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_818DEDC + + thumb_func_start sub_818DEF4 +sub_818DEF4: @ 818DEF4 + push {lr} + bl script_env_2_enable_and_set_ctx_running + pop {r0} + bx r0 + thumb_func_end sub_818DEF4 + + thumb_func_start sub_818DF00 +sub_818DF00: @ 818DF00 + push {r4-r7,lr} + bl Random + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0xF + ands r4, r0 + movs r3, 0 + ldr r5, =gUnknown_0203CD68 + ldr r1, =gUnknown_0860B1A4 + lsls r0, r4, 2 + adds r6, r0, r1 + adds r7, r5, 0 +_0818DF1A: + ldr r2, [r5] + lsls r1, r3, 1 + adds r2, 0x2 + adds r2, r1 + ldr r0, [r6] + adds r1, r0 + ldrh r0, [r1] + strh r0, [r2] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x8 + bls _0818DF1A + ldr r2, [r7] + ldr r0, =gUnknown_0860B1E4 + lsls r1, r4, 1 + adds r0, r1, r0 + ldrh r0, [r0] + strh r0, [r2, 0x14] + ldr r0, =gUnknown_0860B204 + adds r1, r0 + ldrh r0, [r1] + strh r0, [r2, 0x28] + adds r2, 0x2B + strb r4, [r2] + ldr r1, [r7] + movs r0, 0xFF + strb r0, [r1, 0x18] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818DF00 + + thumb_func_start sub_818DF68 +sub_818DF68: @ 818DF68 + push {r4-r6,lr} + ldr r2, =gUnknown_0203CD68 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00003b58 + adds r0, r1 + str r0, [r2] + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + strb r1, [r0, 0x1] + movs r3, 0 + adds r4, r2, 0 + ldr r6, =gGameLanguage + adds r5, r4, 0 + ldr r0, =0x0000ffff + adds r2, r0, 0 +_0818DF8A: + ldr r1, [r5] + lsls r0, r3, 1 + adds r1, 0x2 + adds r1, r0 + ldrh r0, [r1] + orrs r0, r2 + strh r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x8 + bls _0818DF8A + ldr r0, [r4] + ldr r1, =0x0000ffff + strh r1, [r0, 0x14] + movs r1, 0x1 + negs r1, r1 + strh r1, [r0, 0x16] + movs r3, 0 + adds r5, r4, 0 + movs r2, 0 +_0818DFB4: + ldr r0, [r5] + lsls r1, r3, 1 + adds r0, 0x20 + adds r0, r1 + strh r2, [r0] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x3 + bls _0818DFB4 + ldr r0, [r4] + movs r2, 0 + movs r1, 0 + strh r1, [r0, 0x28] + adds r0, 0x2A + strb r2, [r0] + ldr r0, [r4] + adds r0, 0x2C + movs r1, 0x10 + strb r1, [r0] + ldr r0, [r4] + ldrb r1, [r6] + adds r0, 0x2D + strb r1, [r0] + bl sub_818DF00 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818DF68 + + thumb_func_start sub_818E004 +sub_818E004: @ 818E004 + ldr r2, =gUnknown_0203CD68 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00003b58 + adds r0, r1 + str r0, [r2] + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + strb r1, [r0, 0x1] + ldr r0, [r2] + adds r0, 0x2A + strb r1, [r0] + ldr r1, [r2] + ldr r0, =0x0000ffff + strh r0, [r1, 0x16] + bx lr + .pool + thumb_func_end sub_818E004 + + thumb_func_start sub_818E038 +sub_818E038: @ 818E038 + push {lr} + ldr r1, =gUnknown_0203CD68 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r2, =0x00003b58 + adds r0, r2 + str r0, [r1] + ldrb r0, [r0, 0x1] + cmp r0, 0x2 + bne _0818E05C + movs r0, 0x2 + b _0818E066 + .pool +_0818E05C: + cmp r0, 0x1 + beq _0818E064 + movs r0, 0 + b _0818E066 +_0818E064: + movs r0, 0x1 +_0818E066: + pop {r1} + bx r1 + thumb_func_end sub_818E038 + + thumb_func_start sub_818E06C +sub_818E06C: @ 818E06C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =gSaveBlock1Ptr + ldr r4, [r0] + ldr r0, =0x00003b58 + adds r7, r4, r0 + ldrh r0, [r7, 0x14] + bl sub_811F8D8 + cmp r0, 0 + bne _0818E0EC + ldr r1, =0x00003b83 + adds r0, r4, r1 + ldrb r5, [r0] + ldr r0, =0x00003b5a + adds r0, r4 + mov r8, r0 + adds r1, r4 + mov r10, r1 + ldr r6, =gUnknown_0860B1E4 +_0818E09A: + adds r5, 0x1 + cmp r5, 0xF + ble _0818E0A2 + movs r5, 0 +_0818E0A2: + lsls r4, r5, 1 + adds r0, r4, r6 + ldrh r0, [r0] + bl sub_811F8D8 + cmp r0, 0 + beq _0818E09A + movs r3, 0 + ldr r0, =gUnknown_0860B1E4 + mov r12, r0 + lsls r1, r5, 2 + ldr r0, =gUnknown_0860B204 + mov r9, r0 + ldr r0, =gUnknown_0860B1A4 + adds r6, r1, r0 + mov r2, r8 +_0818E0C2: + lsls r0, r3, 1 + ldr r1, [r6] + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2] + adds r2, 0x2 + adds r3, 0x1 + cmp r3, 0x8 + ble _0818E0C2 + mov r1, r12 + adds r0, r4, r1 + ldrh r0, [r0] + strh r0, [r7, 0x14] + mov r1, r9 + adds r0, r4, r1 + ldrh r0, [r0] + strh r0, [r7, 0x28] + mov r0, r10 + strb r5, [r0] + movs r0, 0xFF + strb r0, [r7, 0x18] +_0818E0EC: + bl sub_818E13C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _0818E118 + movs r0, 0x2 + b _0818E12C + .pool +_0818E118: + cmp r0, 0x2 + beq _0818E126 + bl sub_818E1F4 + lsls r0, 24 + cmp r0, 0 + beq _0818E12A +_0818E126: + movs r0, 0x1 + b _0818E12C +_0818E12A: + movs r0, 0 +_0818E12C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_818E06C + + thumb_func_start sub_818E13C +sub_818E13C: @ 818E13C + push {r4-r7,lr} + movs r7, 0x1 + ldr r5, =gUnknown_0203CD68 + ldr r0, =gSaveBlock1Ptr + ldr r1, [r0] + ldr r2, =0x00003b58 + adds r0, r1, r2 + str r0, [r5] + ldrb r0, [r0, 0x18] + cmp r0, 0xFF + bne _0818E174 + ldr r0, =gStringVar1 + ldr r1, =gUnknown_085EEB7E + bl StringCopy7 + movs r7, 0 + b _0818E1DC + .pool +_0818E174: + ldr r4, =gStringVar1 + ldr r0, =0x00003b70 + adds r1, r0 + adds r0, r4, 0 + bl StringCopy7 + ldr r0, [r5] + adds r0, 0x2D + ldrb r1, [r0] + adds r0, r4, 0 + bl ConvertInternationalString + ldr r0, [r5] + adds r0, 0x18 + bl sub_818E258 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r6, =gSaveBlock2Ptr + ldr r0, [r6] + bl sub_818E258 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bne _0818E1DC + ldr r0, [r5] + movs r2, 0 + cmp r2, r4 + bcs _0818E1DC + ldr r1, [r6] + ldrb r0, [r0, 0x18] + ldrb r1, [r1] + cmp r0, r1 + bne _0818E1DA +_0818E1BA: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, r4 + bcs _0818E1DC + ldr r0, =gUnknown_0203CD68 + ldr r1, [r0] + adds r1, 0x18 + adds r1, r2 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, r2 + ldrb r1, [r1] + ldrb r0, [r0] + cmp r1, r0 + beq _0818E1BA +_0818E1DA: + movs r7, 0x2 +_0818E1DC: + adds r0, r7, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_818E13C + + thumb_func_start sub_818E1F4 +sub_818E1F4: @ 818E1F4 + push {r4-r6,lr} + ldr r3, =gUnknown_0203CD68 + ldr r0, =gSaveBlock1Ptr + ldr r1, [r0] + ldr r2, =0x00003b58 + adds r0, r1, r2 + str r0, [r3] + movs r5, 0 + movs r4, 0 + ldr r0, =0x00003b78 + adds r1, r0 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldrh r1, [r1] + adds r6, r3, 0 + adds r3, r0, 0 + ldrb r2, [r2, 0xA] + cmp r1, r2 + bne _0818E23A +_0818E21A: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bhi _0818E23C + ldr r1, [r6] + lsls r0, r4, 1 + adds r1, 0x20 + adds r1, r0 + ldr r0, [r3] + adds r0, 0xA + adds r0, r4 + ldrh r1, [r1] + ldrb r0, [r0] + cmp r1, r0 + beq _0818E21A +_0818E23A: + movs r5, 0x1 +_0818E23C: + adds r0, r5, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_818E1F4 + + thumb_func_start sub_818E258 +sub_818E258: @ 818E258 + push {lr} + movs r2, 0 + adds r1, r0, 0 + b _0818E268 +_0818E260: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + adds r1, 0x1 +_0818E268: + ldrb r0, [r1] + cmp r0, 0xFF + bne _0818E260 + adds r0, r2, 0 + pop {r1} + bx r1 + thumb_func_end sub_818E258 + + thumb_func_start sub_818E274 +sub_818E274: @ 818E274 + push {r4,lr} + ldr r4, =gStringVar1 + ldr r0, =gUnknown_0203CD68 + ldr r0, [r0] + ldrh r0, [r0, 0x28] + bl ItemId_GetItem + adds r1, r0, 0 + adds r0, r4, 0 + bl StringCopy + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E274 + + thumb_func_start sub_818E298 +sub_818E298: @ 818E298 + push {r4,lr} + ldr r4, =gUnknown_0203CD68 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00003b58 + adds r0, r1 + str r0, [r4] + bl sub_818E13C + lsls r0, 24 + cmp r0, 0 + beq _0818E2C0 + movs r0, 0 + b _0818E2CC + .pool +_0818E2C0: + ldr r0, [r4] + ldr r1, =gGameLanguage + ldrb r1, [r1] + adds r0, 0x2D + strb r1, [r0] + movs r0, 0x1 +_0818E2CC: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_818E298 + + thumb_func_start sub_818E2D8 +sub_818E2D8: @ 818E2D8 + ldr r2, =gUnknown_0203CD68 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r3, =0x00003b58 + adds r1, r0, r3 + str r1, [r2] + ldr r1, =0x00003b82 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_818E2D8 + + thumb_func_start sub_818E2FC +sub_818E2FC: @ 818E2FC + push {lr} + bl easy_chat_input_maybe + pop {r0} + bx r0 + thumb_func_end sub_818E2FC + + thumb_func_start sub_818E308 +sub_818E308: @ 818E308 + push {r4-r6,lr} + ldr r5, =gUnknown_0203CD68 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00003b58 + adds r0, r1 + str r0, [r5] + ldr r6, =gStringVar1 + ldrh r1, [r0, 0x14] + adds r0, r6, 0 + bl CopyEasyChatWord + ldr r4, =gStringVar2 + ldr r0, [r5] + ldrh r1, [r0, 0x16] + adds r0, r4, 0 + bl CopyEasyChatWord + adds r0, r6, 0 + adds r1, r4, 0 + bl StringCompare + movs r1, 0 + cmp r0, 0 + bne _0818E33C + movs r1, 0x1 +_0818E33C: + adds r0, r1, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_818E308 + + thumb_func_start sub_818E358 +sub_818E358: @ 818E358 + ldr r1, =gUnknown_0203CD68 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r2, =0x00003b58 + adds r0, r2 + str r0, [r1] + ldr r1, =gSpecialVar_0x8005 + ldrh r0, [r0, 0x28] + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_818E358 + + thumb_func_start sub_818E37C +sub_818E37C: @ 818E37C + ldr r1, =gUnknown_0203CD68 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r2, =0x00003b58 + adds r0, r2 + str r0, [r1] + movs r1, 0x1 + strb r1, [r0, 0x1] + bx lr + .pool + thumb_func_end sub_818E37C + + thumb_func_start sub_818E39C +sub_818E39C: @ 818E39C + ldr r1, =gUnknown_0203CD68 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r2, =0x00003b58 + adds r0, r2 + str r0, [r1] + movs r1, 0x2 + strb r1, [r0, 0x1] + bx lr + .pool + thumb_func_end sub_818E39C + + thumb_func_start sub_818E3BC +sub_818E3BC: @ 818E3BC + ldr r1, =gUnknown_0203CD68 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r2, =0x00003b58 + adds r0, r2 + str r0, [r1] + ldr r1, =0x0000ffff + strh r1, [r0, 0x16] + bx lr + .pool + thumb_func_end sub_818E3BC + + thumb_func_start sub_818E3E0 +sub_818E3E0: @ 818E3E0 + push {lr} + bl sub_81AAC70 + pop {r0} + bx r0 + thumb_func_end sub_818E3E0 + + thumb_func_start sub_818E3EC +sub_818E3EC: @ 818E3EC + push {r4,lr} + ldr r4, =gUnknown_0203CD68 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00003b58 + adds r0, r1 + str r0, [r4] + bl sub_818E298 + lsls r0, 24 + cmp r0, 0 + beq _0818E41C + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0x2B + ldrb r1, [r1] + adds r0, 0x2C + b _0818E422 + .pool +_0818E41C: + ldr r0, [r4] + adds r0, 0x2C + movs r1, 0x10 +_0818E422: + strb r1, [r0] + bl sub_818DF00 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_818E3EC + + thumb_func_start sub_818E430 +sub_818E430: @ 818E430 + push {r4,r5,lr} + ldr r1, =gUnknown_0203CD68 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r2, =0x00003b58 + adds r0, r2 + str r0, [r1] + movs r2, 0 + adds r5, r1, 0 + adds r4, r5, 0 + ldr r0, =0x0000ffff + adds r3, r0, 0 +_0818E448: + ldr r1, [r4] + lsls r0, r2, 1 + adds r1, 0x2 + adds r1, r0 + ldrh r0, [r1] + orrs r0, r3 + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x8 + bls _0818E448 + ldr r1, [r5] + ldr r0, =0x0000ffff + strh r0, [r1, 0x14] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E430 + + thumb_func_start sub_818E47C +sub_818E47C: @ 818E47C + push {lr} + ldr r1, =gSpecialVar_0x8004 + movs r0, 0x11 + strh r0, [r1] + bl easy_chat_input_maybe + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E47C + + thumb_func_start sub_818E490 +sub_818E490: @ 818E490 + push {lr} + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + movs r1, 0x1 + bl RemoveBagItem + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E490 + + thumb_func_start sub_818E4A4 +sub_818E4A4: @ 818E4A4 + push {r4-r6,lr} + ldr r2, =gUnknown_0203CD68 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00003b58 + adds r0, r1 + str r0, [r2] + ldr r1, =gUnknown_0203CE7C + ldrh r1, [r1] + strh r1, [r0, 0x28] + movs r3, 0 + adds r4, r2, 0 + ldr r6, =gSaveBlock2Ptr + adds r5, r4, 0 + adds r2, r6, 0 +_0818E4C2: + ldr r1, [r5] + lsls r0, r3, 1 + adds r1, 0x20 + adds r1, r0 + ldr r0, [r2] + adds r0, 0xA + adds r0, r3 + ldrb r0, [r0] + strh r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x3 + bls _0818E4C2 + ldr r0, [r4] + adds r0, 0x18 + ldr r1, [r6] + bl StringCopy7 + ldr r0, [r4] + ldr r1, =gGameLanguage + ldrb r1, [r1] + adds r0, 0x2D + strb r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E4A4 + + thumb_func_start sub_818E510 +sub_818E510: @ 818E510 + ldr r2, =gUnknown_0203CD68 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r3, =0x00003b58 + adds r1, r0, r3 + str r1, [r2] + ldr r1, =0x00003b82 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + bx lr + .pool + thumb_func_end sub_818E510 + + thumb_func_start sub_818E538 +sub_818E538: @ 818E538 + push {lr} + ldr r2, =gUnknown_0203CD68 + ldr r0, =gSaveBlock1Ptr + ldr r1, [r0] + ldr r0, =0x00003b58 + adds r1, r0 + str r1, [r2] + ldr r0, =gStringVar3 + ldrh r1, [r1, 0x14] + bl CopyEasyChatWord + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E538 + + thumb_func_start sub_818E564 +sub_818E564: @ 818E564 + push {lr} + bl script_env_2_enable_and_set_ctx_running + pop {r0} + bx r0 + thumb_func_end sub_818E564 + + thumb_func_start sub_818E570 +sub_818E570: @ 818E570 + push {r4-r7,lr} + ldr r2, =gUnknown_0203CD68 + ldr r1, =gSaveBlock1Ptr + ldr r1, [r1] + ldr r4, =0x00003b58 + adds r3, r1, r4 + str r3, [r2] + adds r6, r0, 0 + adds r6, 0x2C + ldrb r4, [r6] + adds r7, r2, 0 + cmp r4, 0xF + bhi _0818E5EC + ldrb r0, [r3] + cmp r0, 0 + bne _0818E5EC + movs r5, 0 + ldr r2, =0x00003b83 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r4, r0 + bne _0818E5E4 + adds r4, r7, 0 +_0818E59E: + bl Random + ldr r2, [r4] + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xF + ands r0, r1 + adds r2, 0x2B + strb r0, [r2] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bhi _0818E5C6 + ldr r0, [r4] + adds r0, 0x2B + ldrb r1, [r6] + ldrb r0, [r0] + cmp r1, r0 + beq _0818E59E +_0818E5C6: + ldr r0, [r4] + adds r2, r0, 0 + adds r2, 0x2B + ldrb r0, [r6] + ldr r7, =gUnknown_0203CD68 + ldrb r4, [r2] + cmp r0, r4 + bne _0818E5E4 + ldrb r1, [r2] + adds r3, r1, 0x1 + adds r0, r3, 0 + asrs r0, 4 + lsls r0, 4 + subs r0, r3, r0 + strb r0, [r2] +_0818E5E4: + ldr r0, [r7] + ldrb r1, [r6] + adds r0, 0x2C + strb r1, [r0] +_0818E5EC: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E570 + + thumb_func_start sub_818E604 +sub_818E604: @ 818E604 + push {r4,lr} + ldr r4, =gUnknown_0203CD6C + ldr r1, [r4] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r0, [r4] + movs r1, 0 + strb r1, [r0, 0x2] + ldr r0, [r4] + strb r1, [r0, 0x3] + ldr r0, [r4] + strb r1, [r0, 0xC] + bl Random + ldr r4, [r4] + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x5 + bl __umodsi3 + strb r0, [r4, 0xD] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E604 + + thumb_func_start sub_818E638 +sub_818E638: @ 818E638 + push {r4,lr} + ldr r4, =gUnknown_0203CD6C + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00003b58 + adds r0, r1 + str r0, [r4] + movs r2, 0 + movs r1, 0x2 + strb r1, [r0] + ldr r0, [r4] + strb r2, [r0, 0x1] + bl sub_818E604 + ldr r1, [r4] + ldr r0, =gGameLanguage + ldrb r0, [r0] + strb r0, [r1, 0xE] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E638 + + thumb_func_start sub_818E674 +sub_818E674: @ 818E674 + push {lr} + ldr r2, =gUnknown_0203CD6C + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00003b58 + adds r0, r1 + str r0, [r2] + movs r3, 0 + movs r1, 0x2 + strb r1, [r0] + ldr r0, [r2] + strb r3, [r0, 0x1] + ldr r2, [r2] + ldrb r0, [r2, 0x2] + cmp r0, 0x5 + beq _0818E69A + ldrb r0, [r2, 0x3] + cmp r0, 0x5 + bne _0818E69E +_0818E69A: + bl sub_818E604 +_0818E69E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E674 + + thumb_func_start sub_818E6B0 +sub_818E6B0: @ 818E6B0 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r4, =gUnknown_0203CD6C + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r3, =0x00003b58 + adds r1, r0, r3 + str r1, [r4] + ldrb r0, [r1, 0xC] + cmp r0, r2 + bhi _0818E6EA + strb r2, [r1, 0xC] + ldr r0, [r4] + adds r0, 0x4 + movs r1, 0xFF + movs r2, 0x8 + bl memset + ldr r1, [r4] + ldr r0, =gSaveBlock2Ptr + adds r1, 0x4 + ldr r0, [r0] + ldm r0!, {r2,r3} + stm r1!, {r2,r3} + ldr r1, [r4] + ldr r0, =gGameLanguage + ldrb r0, [r0] + strb r0, [r1, 0xE] +_0818E6EA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E6B0 + + thumb_func_start sub_818E704 +sub_818E704: @ 818E704 + push {r4,r5,lr} + adds r2, r0, 0 + movs r3, 0 + movs r4, 0 + ldr r1, =gUnknown_0203CD6C + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r5, =0x00003b58 + adds r0, r5 + str r0, [r1] + ldrb r0, [r0, 0xD] + adds r5, r1, 0 + cmp r0, 0x4 + bhi _0818E76A + lsls r0, 2 + ldr r1, =_0818E73C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0818E73C: + .4byte _0818E750 + .4byte _0818E754 + .4byte _0818E758 + .4byte _0818E75C + .4byte _0818E760 +_0818E750: + ldrb r0, [r2, 0x1] + b _0818E762 +_0818E754: + ldrb r0, [r2, 0x2] + b _0818E762 +_0818E758: + ldrb r0, [r2, 0x3] + b _0818E762 +_0818E75C: + ldrb r0, [r2, 0x4] + b _0818E762 +_0818E760: + ldrb r0, [r2, 0x5] +_0818E762: + cmp r0, 0 + beq _0818E76A + adds r3, r0, 0 + movs r4, 0x1 +_0818E76A: + cmp r4, 0x1 + bne _0818E784 + adds r0, r3, 0 + bl sub_818E6B0 + ldr r0, =gUnknown_0203CD6C + ldr r1, [r0] + ldrb r0, [r1, 0x2] + adds r0, 0x1 + strb r0, [r1, 0x2] + b _0818E78C + .pool +_0818E784: + ldr r1, [r5] + ldrb r0, [r1, 0x3] + adds r0, 0x1 + strb r0, [r1, 0x3] +_0818E78C: + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_818E704 + + thumb_func_start sub_818E794 +sub_818E794: @ 818E794 + push {r4,r5,lr} + adds r5, r1, 0 + ldr r4, =gUnknown_0203CD6C + ldr r1, =gSaveBlock1Ptr + ldr r1, [r1] + ldr r2, =0x00003b58 + adds r1, r2 + str r1, [r4] + ldr r2, =gUnknown_0860B324 + ldrb r1, [r1, 0xD] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl StringCopy + ldr r1, =gUnknown_0860B310 + ldr r0, [r4] + ldrb r0, [r0, 0xD] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r5, 0 + bl StringCopy10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E794 + + thumb_func_start sub_818E7E0 +sub_818E7E0: @ 818E7E0 + push {r4,lr} + adds r3, r1, 0 + ldr r2, =gUnknown_0203CD6C + ldr r1, =gSaveBlock1Ptr + ldr r1, [r1] + ldr r4, =0x00003b58 + adds r1, r4 + str r1, [r2] + ldrb r2, [r1, 0xD] + strb r2, [r0] + ldr r2, =gUnknown_0860B310 + ldrb r0, [r1, 0xD] + lsls r0, 2 + adds r0, r2 + ldr r1, [r0] + adds r0, r3, 0 + bl StringCopy + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E7E0 + + thumb_func_start sub_818E81C +sub_818E81C: @ 818E81C + push {r4,lr} + ldr r3, =gUnknown_0203CD6C + ldr r1, =gSaveBlock1Ptr + ldr r1, [r1] + ldr r4, =0x00003b58 + adds r2, r1, r4 + str r2, [r3] + ldr r2, =0x00003b5c + adds r1, r2 + bl StringCopy + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E81C + + thumb_func_start sub_818E848 +sub_818E848: @ 818E848 + ldr r2, =gUnknown_0203CD6C + ldr r1, =gSaveBlock1Ptr + ldr r1, [r1] + ldr r3, =0x00003b58 + adds r1, r3 + str r1, [r2] + ldrb r1, [r1, 0xE] + strb r1, [r0] + bx lr + .pool + thumb_func_end sub_818E848 + + thumb_func_start sub_818E868 +sub_818E868: @ 818E868 + push {lr} + lsls r1, 24 + ldr r2, =gUnknown_0860B338 + lsrs r1, 22 + adds r1, r2 + ldr r1, [r1] + bl StringCopy + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E868 + + thumb_func_start sub_818E880 +sub_818E880: @ 818E880 + push {lr} + ldr r1, =gUnknown_0203CD6C + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r2, =0x00003b58 + adds r0, r2 + str r0, [r1] + ldrb r0, [r0, 0x2] + cmp r0, 0x4 + bls _0818E8A4 + movs r0, 0x1 + b _0818E8AE + .pool +_0818E8A4: + cmp r0, 0 + beq _0818E8AC + movs r0, 0 + b _0818E8AE +_0818E8AC: + movs r0, 0x2 +_0818E8AE: + pop {r1} + bx r1 + thumb_func_end sub_818E880 + + thumb_func_start sub_818E8B4 +sub_818E8B4: @ 818E8B4 + push {lr} + ldr r1, =gUnknown_0203CD6C + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r2, =0x00003b58 + adds r0, r2 + str r0, [r1] + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + beq _0818E8D8 + movs r0, 0 + b _0818E8DA + .pool +_0818E8D8: + movs r0, 0x1 +_0818E8DA: + pop {r1} + bx r1 + thumb_func_end sub_818E8B4 + + thumb_func_start sub_818E8E0 +sub_818E8E0: @ 818E8E0 + push {r4,lr} + movs r3, 0 + ldr r1, =gUnknown_0203CD6C + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r4, =0x00003b58 + adds r2, r0, r4 + str r2, [r1] + ldrb r0, [r2, 0x2] + cmp r0, 0x4 + bhi _0818E8FC + ldrb r0, [r2, 0x3] + cmp r0, 0x4 + bls _0818E8FE +_0818E8FC: + movs r3, 0x1 +_0818E8FE: + adds r0, r3, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_818E8E0 + + thumb_func_start sub_818E914 +sub_818E914: @ 818E914 + push {lr} + ldr r0, =gStringVar2 + ldr r1, =gStringVar1 + bl sub_818E794 + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E914 + + thumb_func_start sub_818E92C +sub_818E92C: @ 818E92C + push {lr} + ldr r1, =c2_exit_to_overworld_2_switch + movs r0, 0x3 + bl sub_81357FC + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E92C + + thumb_func_start sub_818E940 +sub_818E940: @ 818E940 + ldr r1, =gUnknown_0203CD6C + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r2, =0x00003b58 + adds r0, r2 + str r0, [r1] + movs r1, 0x1 + strb r1, [r0, 0x1] + bx lr + .pool + thumb_func_end sub_818E940 + + thumb_func_start sub_818E960 +sub_818E960: @ 818E960 + ldr r1, =gUnknown_0203CD6C + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r2, =0x00003b58 + adds r0, r2 + str r0, [r1] + ldr r2, =gSpecialVar_0x8005 + ldr r1, =gUnknown_0860B34C + ldrb r0, [r0, 0xD] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2] + bx lr + .pool + thumb_func_end sub_818E960 + + thumb_func_start sub_818E990 +sub_818E990: @ 818E990 + ldr r1, =gUnknown_0203CD6C + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r2, =0x00003b58 + adds r0, r2 + str r0, [r1] + ldrb r0, [r0, 0xD] + bx lr + .pool + thumb_func_end sub_818E990 + + thumb_func_start sub_818E9AC +sub_818E9AC: @ 818E9AC + push {lr} + ldr r1, =gUnknown_0860D090 + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E9AC + + thumb_func_start sub_818E9CC +sub_818E9CC: @ 818E9CC + push {r4-r7,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r7, r0, 16 + ldr r0, [r4] + ldr r2, =0x00000ca8 + adds r0, r2 + movs r6, 0 + strb r6, [r0] + ldr r1, [r4] + adds r2, 0xA + adds r0, r1, r2 + strh r6, [r0] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r4] + ldr r2, =0x00000ca9 + adds r1, r2 + ldrb r2, [r1] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r4, [r4] + ldr r0, =0x00000cdc + adds r3, r4, r0 + ldr r2, =gUnknown_0860D0EC + lsls r1, r5, 2 + lsls r0, r7, 3 + adds r1, r0 + adds r1, r2 + ldr r0, [r3] + ldr r1, [r1] + ands r0, r1 + cmp r0, 0 + bne _0818EA3E + lsls r0, r5, 1 + lsls r1, r7, 2 + adds r0, r1 + ldr r2, =0x00000d0c + adds r1, r4, r2 + adds r1, r0 + strh r6, [r1] +_0818EA3E: + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0x4 + ldrsb r1, [r0, r1] + movs r2, 0x5 + ldrsb r2, [r0, r2] + movs r3, 0x1 + negs r3, r3 + movs r0, 0 + bl saved_warp2_set + ldr r0, =gUnknown_02038BCA + strh r6, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E9CC + + thumb_func_start sub_818EA84 +sub_818EA84: @ 818EA84 + push {r4-r6,lr} + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x9 + bls _0818EAA8 + b _0818ED10 +_0818EAA8: + lsls r0, 2 + ldr r1, =_0818EAC8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0818EAC8: + .4byte _0818EAF0 + .4byte _0818EB14 + .4byte _0818EB48 + .4byte _0818EB64 + .4byte _0818EB80 + .4byte _0818EB98 + .4byte _0818EBB4 + .4byte _0818EC40 + .4byte _0818ECD0 + .4byte _0818ECF4 +_0818EAF0: + ldr r3, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r5, 1 + lsls r2, r6, 2 + adds r1, r2 + ldr r2, =0x00000d0c + adds r0, r2 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r3] + b _0818ED10 + .pool +_0818EB14: + ldr r4, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r3, =0x00000cdc + adds r2, r3 + ldr r3, =gUnknown_0860D0EC + lsls r0, r5, 2 + lsls r1, r6, 3 + adds r0, r1 + adds r0, r3 + ldr r1, [r2] + ldr r0, [r0] + ands r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + strh r0, [r4] + b _0818ED10 + .pool +_0818EB48: + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000d08 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 31 + b _0818ECBE + .pool +_0818EB64: + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r3, =0x00000d08 + adds r0, r3 + ldrb r0, [r0] + lsls r0, 30 + b _0818ECBE + .pool +_0818EB80: + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000d08 + adds r0, r2 + b _0818ECBA + .pool +_0818EB98: + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r3, =0x00000d08 + adds r0, r3 + ldrb r0, [r0] + lsls r0, 28 + b _0818ECBE + .pool +_0818EBB4: + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bne _0818EC04 + cmp r5, 0 + beq _0818EBE8 + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000d08 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 26 + b _0818ECBE + .pool +_0818EBE8: + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r3, =0x00000d08 + adds r0, r3 + ldrb r0, [r0] + lsls r0, 27 + b _0818ECBE + .pool +_0818EC04: + cmp r5, 0 + beq _0818EC24 + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000d08 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 30 + b _0818ECBE + .pool +_0818EC24: + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r3, =0x00000d08 + adds r0, r3 + ldrb r0, [r0] + lsls r0, 31 + b _0818ECBE + .pool +_0818EC40: + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bne _0818EC90 + cmp r5, 0 + beq _0818EC74 + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000d08 + adds r0, r2 + ldrb r0, [r0] + lsrs r0, 7 + strh r0, [r1] + b _0818ED10 + .pool +_0818EC74: + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r3, =0x00000d08 + adds r0, r3 + ldrb r0, [r0] + lsls r0, 25 + b _0818ECBE + .pool +_0818EC90: + cmp r5, 0 + beq _0818ECB0 + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000d08 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 28 + b _0818ECBE + .pool +_0818ECB0: + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r3, =0x00000d08 + adds r0, r3 +_0818ECBA: + ldrb r0, [r0] + lsls r0, 29 +_0818ECBE: + lsrs r0, 31 + strh r0, [r1] + b _0818ED10 + .pool +_0818ECD0: + bl sub_81B8558 + ldr r2, =gUnknown_0203CEF8 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + movs r1, 0xCB + lsls r1, 4 + adds r0, r1 + ldrh r1, [r0] + strb r1, [r2] + ldrh r0, [r0] + lsrs r0, 8 + strb r0, [r2, 0x1] + b _0818ED10 + .pool +_0818ECF4: + ldr r2, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r3, =0x00000d0a + adds r0, r1, r3 + ldrb r0, [r0] + lsls r0, 1 + adds r3, 0x1 + adds r1, r3 + ldr r3, =0x0000fffd + adds r0, r3 + ldrb r1, [r1] + adds r0, r1 + strh r0, [r2] +_0818ED10: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818EA84 + + thumb_func_start sub_818ED28 +sub_818ED28: @ 818ED28 + push {r4,r5,lr} + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r4, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x8 + bls _0818ED4C + b _0818F01E +_0818ED4C: + lsls r0, 2 + ldr r1, =_0818ED6C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0818ED6C: + .4byte _0818ED90 + .4byte _0818EDB4 + .4byte _0818EE10 + .4byte _0818EE34 + .4byte _0818EE5C + .4byte _0818EE78 + .4byte _0818EEA0 + .4byte _0818EF50 + .4byte _0818F008 +_0818ED90: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + lsls r0, r4, 1 + lsls r1, r5, 2 + adds r0, r1 + ldr r1, =0x00000d0c + adds r2, r1 + adds r2, r0 + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + strh r0, [r2] + b _0818F01E + .pool +_0818EDB4: + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + cmp r0, 0 + beq _0818EDE8 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r0, =0x00000cdc + adds r2, r0 + ldr r3, =gUnknown_0860D0EC + lsls r1, r4, 2 + lsls r0, r5, 3 + adds r1, r0 + adds r1, r3 + ldr r0, [r2] + ldr r1, [r1] + orrs r0, r1 + str r0, [r2] + b _0818F01E + .pool +_0818EDE8: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r1, =0x00000cdc + adds r2, r1 + ldr r3, =gUnknown_0860D0FC + lsls r1, r4, 2 + lsls r0, r5, 3 + adds r1, r0 + adds r1, r3 + ldr r0, [r2] + ldr r1, [r1] + ands r0, r1 + str r0, [r2] + b _0818F01E + .pool +_0818EE10: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r1, =0x00000d08 + adds r2, r1 + movs r1, 0x1 + ands r1, r0 + ldrb r3, [r2] + movs r0, 0x2 + negs r0, r0 + b _0818EF74 + .pool +_0818EE34: + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r2, =0x00000d08 + adds r3, r2 + movs r1, 0x1 + ands r1, r0 + lsls r1, 1 + ldrb r2, [r3] + movs r0, 0x3 + negs r0, r0 + b _0818EFF4 + .pool +_0818EE5C: + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r1, =0x00000d08 + adds r3, r1 + b _0818EFE8 + .pool +_0818EE78: + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r2, =0x00000d08 + adds r3, r2 + movs r1, 0x1 + ands r1, r0 + lsls r1, 3 + ldrb r2, [r3] + movs r0, 0x9 + negs r0, r0 + b _0818EFF4 + .pool +_0818EEA0: + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x1 + bne _0818EF00 + cmp r4, 0 + beq _0818EEDC + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r2, =0x00000d08 + adds r3, r2 + ands r1, r0 + lsls r1, 5 + ldrb r2, [r3] + movs r0, 0x21 + negs r0, r0 + b _0818EFF4 + .pool +_0818EEDC: + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r2, =0x00000d08 + adds r3, r2 + ands r1, r0 + lsls r1, 4 + ldrb r2, [r3] + movs r0, 0x11 + negs r0, r0 + b _0818EFF4 + .pool +_0818EF00: + cmp r4, 0 + beq _0818EF2C + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r1, =0x00000d08 + adds r3, r1 + movs r1, 0x1 + ands r1, r0 + lsls r1, 1 + ldrb r2, [r3] + movs r0, 0x3 + negs r0, r0 + b _0818EFF4 + .pool +_0818EF2C: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r1, =0x00000d08 + adds r2, r1 + movs r1, 0x1 + ands r1, r0 + ldrb r3, [r2] + movs r0, 0x2 + negs r0, r0 + b _0818EF74 + .pool +_0818EF50: + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x1 + bne _0818EFB0 + cmp r4, 0 + beq _0818EF8C + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r1, [r0] + ldr r0, =0x00000d08 + adds r2, r0 + lsls r1, 7 + ldrb r3, [r2] + movs r0, 0x7F +_0818EF74: + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + b _0818F01E + .pool +_0818EF8C: + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r2, =0x00000d08 + adds r3, r2 + ands r1, r0 + lsls r1, 6 + ldrb r2, [r3] + movs r0, 0x41 + negs r0, r0 + b _0818EFF4 + .pool +_0818EFB0: + cmp r4, 0 + beq _0818EFDC + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r1, =0x00000d08 + adds r3, r1 + movs r1, 0x1 + ands r1, r0 + lsls r1, 3 + ldrb r2, [r3] + movs r0, 0x9 + negs r0, r0 + b _0818EFF4 + .pool +_0818EFDC: + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r2, =0x00000d08 + adds r3, r2 +_0818EFE8: + movs r1, 0x1 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r3] + movs r0, 0x5 + negs r0, r0 +_0818EFF4: + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + b _0818F01E + .pool +_0818F008: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r0, =gUnknown_0203CEF8 + ldrb r1, [r0] + ldrb r0, [r0, 0x1] + lsls r0, 8 + orrs r1, r0 + movs r0, 0xCB + lsls r0, 4 + adds r2, r0 + strh r1, [r2] +_0818F01E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818ED28 + + thumb_func_start sub_818F02C +sub_818F02C: @ 818F02C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x3C + movs r0, 0 + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r0, [sp, 0x10] + movs r0, 0x20 + bl AllocZeroed + str r0, [sp, 0x18] + movs r0, 0x18 + bl AllocZeroed + str r0, [sp, 0x1C] + ldr r4, =gSaveBlock2Ptr + ldr r1, [r4] + ldr r2, =0x00000ca9 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + adds r0, 0x1 + ldr r3, =0x00000d0a + adds r1, r3 + strb r0, [r1] + ldr r0, =0x000040ce + bl VarGet + ldr r1, [r4] + adds r0, 0x1 + ldr r5, =0x00000d0b + adds r1, r5 + strb r0, [r1] + ldr r2, [r4] + ldr r7, =0x00000d24 + adds r3, r2, r7 + ldrh r0, [r3] + ldr r5, =0x000003ff + adds r1, r5, 0 + orrs r0, r1 + strh r0, [r3] + ldr r3, =0x00000d25 + adds r2, r3 + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldr r1, [r4] + adds r1, r3 + ldrb r2, [r1] + movs r0, 0x19 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r4] + adds r1, r3 + ldrb r2, [r1] + movs r0, 0x1F + ands r0, r2 + strb r0, [r1] + movs r7, 0 + mov r10, r7 + mov r8, r4 + ldr r0, =gUnknown_02024488 + mov r9, r0 + movs r4, 0 +_0818F0BA: + mov r1, r8 + ldr r0, [r1] + ldr r2, =0x00000caa + adds r0, r2 + adds r0, r4 + ldrh r0, [r0] + movs r3, 0x64 + muls r0, r3 + add r0, r9 + movs r1, 0xB + movs r2, 0 + bl GetMonData + mov r5, r8 + ldr r1, [r5] + ldr r7, =0x00000d64 + adds r1, r7 + adds r1, r4 + strh r0, [r1] + movs r5, 0 + mov r0, r10 + lsls r7, r0, 4 + adds r6, r7, 0 +_0818F0E8: + mov r1, r8 + ldr r0, [r1] + ldr r2, =0x00000caa + adds r0, r2 + adds r0, r4 + ldrh r0, [r0] + movs r3, 0x64 + muls r0, r3 + add r0, r9 + adds r1, r5, 0 + adds r1, 0xD + movs r2, 0 + bl GetMonData + mov r2, r8 + ldr r1, [r2] + ldr r3, =0x00000efc + adds r1, r3 + adds r1, r6 + strh r0, [r1] + adds r6, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _0818F0E8 + movs r5, 0 + ldr r6, =gSaveBlock2Ptr +_0818F11C: + ldr r0, [r6] + ldr r1, =0x00000caa + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + movs r2, 0x64 + muls r0, r2 + add r0, r9 + adds r1, r5, 0 + adds r1, 0x1A + movs r2, 0 + bl GetMonData + ldr r1, [r6] + adds r2, r5, r7 + ldr r3, =0x00000f04 + adds r1, r3 + adds r1, r2 + strb r0, [r1] + adds r5, 0x1 + cmp r5, 0x5 + ble _0818F11C + mov r5, r8 + ldr r0, [r5] + ldr r1, =0x00000caa + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + movs r2, 0x64 + muls r0, r2 + add r0, r9 + bl GetNature + ldr r1, [r5] + adds r1, r7 + ldr r3, =0x00000f0a + adds r1, r3 + strb r0, [r1] + adds r4, 0x2 + movs r5, 0x1 + add r10, r5 + mov r7, r10 + cmp r7, 0x2 + ble _0818F0BA + mov r10, r5 + movs r0, 0x4 + str r0, [sp, 0x34] + movs r1, 0x6 + str r1, [sp, 0x38] +_0818F17E: + mov r2, r10 + cmp r2, 0x5 + ble _0818F22C +_0818F184: + bl sub_81A39C4 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_8162548 + lsls r0, 16 + lsrs r4, r0, 16 + movs r5, 0x1 + cmp r5, r10 + bge _0818F1CA + ldr r3, =gSaveBlock2Ptr + ldr r0, [r3] + ldr r7, =0x00000d28 + adds r0, r7 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + adds r2, r3, 0 + cmp r0, r4 + beq _0818F1CA + ldr r3, =0x00000d24 +_0818F1B2: + adds r5, 0x1 + cmp r5, r10 + bge _0818F1CA + ldr r0, [r2] + lsls r1, r5, 2 + adds r0, r1 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + cmp r0, r4 + bne _0818F1B2 +_0818F1CA: + cmp r5, r10 + bne _0818F184 + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r1, [sp, 0x34] + adds r3, r1 + ldr r2, =0x00000d24 + adds r3, r2 + ldr r5, =0x000003ff + adds r0, r5, 0 + adds r2, r4, 0 + ands r2, r0 + ldrh r0, [r3] + ldr r7, =0xfffffc00 + adds r1, r7, 0 + b _0818F292 + .pool +_0818F22C: + bl sub_81A39C4 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_8162548 + lsls r0, 16 + lsrs r4, r0, 16 + movs r5, 0x1 + cmp r5, r10 + bge _0818F274 + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r2, =0x00000d28 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + adds r2, r1, 0 + cmp r0, r4 + beq _0818F274 + ldr r3, =0x00000d24 +_0818F25C: + adds r5, 0x1 + cmp r5, r10 + bge _0818F274 + ldr r0, [r2] + lsls r1, r5, 2 + adds r0, r1 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + cmp r0, r4 + bne _0818F25C +_0818F274: + cmp r5, r10 + bne _0818F22C + ldr r5, =gSaveBlock2Ptr + ldr r3, [r5] + ldr r7, [sp, 0x34] + adds r3, r7 + ldr r0, =0x00000d24 + adds r3, r0 + ldr r1, =0x000003ff + adds r0, r1, 0 + adds r2, r4, 0 + ands r2, r0 + ldrh r0, [r3] + ldr r5, =0xfffffc00 + adds r1, r5, 0 +_0818F292: + ands r0, r1 + orrs r0, r2 + strh r0, [r3] + movs r5, 0 + lsls r4, 16 + str r4, [sp, 0x2C] + ldr r7, [sp, 0x38] + str r7, [sp, 0x20] +_0818F2A2: + lsls r0, r5, 1 + mov r9, r0 + adds r1, r5, 0x1 + str r1, [sp, 0x24] + lsls r2, r5, 2 + str r2, [sp, 0x28] +_0818F2AE: + ldr r3, [sp, 0x2C] + lsrs r0, r3, 16 + bl sub_8163524 + lsls r0, 16 + lsrs r6, r0, 16 + movs r7, 0 + cmp r7, r5 + bge _0818F300 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, [sp, 0x8] + mov r8, r1 + ldr r2, [sp, 0xC] + mov r12, r2 + ldr r3, =0x00000d64 + adds r0, r3 + ldr r1, [sp, 0x20] + adds r4, r1, r0 +_0818F2D4: + ldrh r3, [r4] + cmp r3, r6 + beq _0818F300 + ldr r2, =gUnknown_0203BC8C + ldr r1, [r2] + lsls r0, r6, 4 + adds r2, r0, r1 + ldrh r0, [r2] + cmp r8, r0 + beq _0818F300 + cmp r12, r0 + beq _0818F300 + lsls r0, r3, 4 + adds r0, r1 + ldrb r0, [r0, 0xA] + ldrb r2, [r2, 0xA] + cmp r0, r2 + beq _0818F300 + adds r4, 0x2 + adds r7, 0x1 + cmp r7, r5 + blt _0818F2D4 +_0818F300: + cmp r7, r5 + bne _0818F2AE + ldr r3, =gSaveBlock2Ptr + ldr r0, [r3] + ldr r1, [sp, 0x38] + add r1, r9 + ldr r5, =0x00000d64 + adds r0, r5 + adds r0, r1 + strh r6, [r0] + ldr r2, [sp, 0x28] + add r2, sp + adds r2, 0x8 + ldr r0, =gUnknown_0203BC8C + ldr r1, [r0] + lsls r0, r6, 4 + adds r0, r1 + ldrh r0, [r0] + str r0, [r2] + ldr r5, [sp, 0x24] + cmp r5, 0x2 + ble _0818F2A2 + ldr r2, [r3] + ldr r7, [sp, 0x34] + adds r2, r7 + ldr r0, =0x00000d25 + adds r2, r0 + ldrb r0, [r2] + movs r3, 0x5 + negs r3, r3 + adds r1, r3, 0 + ands r0, r1 + strb r0, [r2] + ldr r5, =gSaveBlock2Ptr + ldr r2, [r5] + adds r2, r7 + ldr r7, =0x00000d25 + adds r2, r7 + ldrb r0, [r2] + subs r3, 0x14 + adds r1, r3, 0 + ands r0, r1 + strb r0, [r2] + ldr r1, [r5] + ldr r5, [sp, 0x34] + adds r1, r5 + adds r1, r7 + ldrb r2, [r1] + movs r0, 0x1F + ands r0, r2 + strb r0, [r1] + adds r5, 0x4 + str r5, [sp, 0x34] + ldr r7, [sp, 0x38] + adds r7, 0x6 + str r7, [sp, 0x38] + movs r0, 0x1 + add r10, r0 + mov r1, r10 + cmp r1, 0xF + bgt _0818F37C + b _0818F17E +_0818F37C: + movs r7, 0 + ldr r2, [sp, 0x18] + strh r7, [r2] + movs r3, 0 + mov r10, r3 + ldr r6, =gBitTable + ldr r5, =gBaseStats +_0818F38A: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + mov r2, r10 + lsls r1, r2, 1 + ldr r3, =0x00000caa + adds r0, r3 + adds r0, r1 + ldrh r0, [r0] + subs r4, r0, 0x1 + movs r0, 0x64 + muls r4, r0 + ldr r0, =gPlayerParty + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x3B + movs r2, 0 + bl GetMonData + ldr r2, [sp, 0x18] + ldrh r1, [r2] + adds r1, r0 + strh r1, [r2] + adds r0, r4, 0 + movs r1, 0x3C + movs r2, 0 + bl GetMonData + ldr r3, [sp, 0x18] + ldrh r1, [r3] + adds r1, r0 + strh r1, [r3] + adds r0, r4, 0 + movs r1, 0x3E + movs r2, 0 + bl GetMonData + ldr r2, [sp, 0x18] + ldrh r1, [r2] + adds r1, r0 + strh r1, [r2] + adds r0, r4, 0 + movs r1, 0x3F + movs r2, 0 + bl GetMonData + ldr r3, [sp, 0x18] + ldrh r1, [r3] + adds r1, r0 + strh r1, [r3] + adds r0, r4, 0 + movs r1, 0x3D + movs r2, 0 + bl GetMonData + ldr r2, [sp, 0x18] + ldrh r1, [r2] + adds r1, r0 + strh r1, [r2] + adds r0, r4, 0 + movs r1, 0x3A + movs r2, 0 + bl GetMonData + ldr r3, [sp, 0x18] + ldrh r1, [r3] + adds r1, r0 + strh r1, [r3] + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl GetMonData + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r0, [r1, 0x6] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + orrs r7, r0 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl GetMonData + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r0, [r1, 0x7] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + orrs r7, r0 + movs r0, 0x1 + add r10, r0 + mov r1, r10 + cmp r1, 0x2 + ble _0818F38A + movs r4, 0 + movs r1, 0x1 + movs r5, 0x1F +_0818F458: + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _0818F462 + adds r4, 0x1 +_0818F462: + asrs r7, 1 + subs r5, 0x1 + cmp r5, 0 + bge _0818F458 + bl sub_8165C40 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x14] + adds r2, r0, 0 + adds r0, r4, 0 + muls r0, r2 + movs r1, 0x14 + bl __divsi3 + ldr r3, [sp, 0x18] + ldrh r1, [r3] + adds r1, r0 + strh r1, [r3] + movs r5, 0x1 + mov r10, r5 + adds r6, r3, 0 + adds r6, 0x2 + movs r7, 0x2 + str r7, [sp, 0x30] +_0818F494: + movs r7, 0 + strh r7, [r6] + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + mov r2, r10 + lsls r1, r2, 2 + adds r0, r1 + ldr r3, =0x00000d24 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + bl sub_8190168 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r5, 0 + ldr r0, [sp, 0x30] + mov r9, r0 +_0818F4BC: + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + mov r4, r9 + add r4, r10 + adds r4, r5 + lsls r4, 1 + ldr r2, =0x00000d64 + adds r0, r2 + adds r0, r4 + ldrh r1, [r0] + ldr r3, =gUnknown_0203BC8C + ldr r0, [r3] + lsls r1, 4 + adds r1, r0 + ldrh r0, [r1] + ldrb r3, [r1, 0xB] + ldrb r1, [r1, 0xC] + str r1, [sp] + ldr r1, [sp, 0x1C] + str r1, [sp, 0x4] + ldr r1, [sp, 0x14] + mov r2, r8 + bl sub_818F720 + ldr r2, [sp, 0x1C] + ldr r1, [r2, 0x4] + ldrh r0, [r6] + adds r0, r1 + ldr r1, [r2, 0x8] + adds r0, r1 + ldr r1, [r2, 0x10] + adds r0, r1 + ldr r1, [r2, 0x14] + adds r0, r1 + ldr r1, [r2, 0xC] + adds r0, r1 + ldr r1, [r2] + adds r0, r1 + strh r0, [r6] + ldr r3, =gSaveBlock2Ptr + ldr r0, [r3] + ldr r1, =0x00000d64 + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + ldr r2, =gUnknown_0203BC8C + ldr r1, [r2] + lsls r0, 4 + adds r0, r1 + ldrh r0, [r0] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r3, =gBaseStats + adds r1, r3 + ldrb r0, [r1, 0x6] + lsls r0, 2 + ldr r2, =gBitTable + adds r0, r2 + ldr r0, [r0] + orrs r7, r0 + ldrb r0, [r1, 0x7] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + orrs r7, r0 + adds r5, 0x1 + cmp r5, 0x2 + ble _0818F4BC + movs r4, 0 + movs r1, 0x1 + movs r5, 0x1F +_0818F54C: + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _0818F556 + adds r4, 0x1 +_0818F556: + asrs r7, 1 + subs r5, 0x1 + cmp r5, 0 + bge _0818F54C + ldr r3, [sp, 0x14] + adds r0, r4, 0 + muls r0, r3 + movs r1, 0x14 + bl __divsi3 + ldrh r1, [r6] + adds r1, r0 + strh r1, [r6] + adds r6, 0x2 + ldr r5, [sp, 0x30] + adds r5, 0x2 + str r5, [sp, 0x30] + movs r7, 0x1 + add r10, r7 + mov r0, r10 + cmp r0, 0xF + ble _0818F494 + movs r1, 0 + mov r10, r1 + ldr r2, =0x000003ff + mov r8, r2 +_0818F58A: + mov r5, r10 + adds r5, 0x1 + adds r7, r5, 0 + cmp r5, 0xF + bgt _0818F626 + mov r3, r10 + lsls r0, r3, 1 + ldr r1, [sp, 0x18] + adds r6, r0, r1 + lsls r0, r5, 1 + adds r4, r0, r1 +_0818F5A0: + ldrh r1, [r6] + ldrh r0, [r4] + cmp r1, r0 + bcc _0818F5C2 + cmp r1, r0 + bne _0818F61E + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + lsls r0, r5, 2 + adds r0, r1, r0 + ldr r2, =0x00000d24 + adds r0, r2 + ldrh r0, [r0] + lsls r2, r0, 22 + lsrs r0, r2, 22 + cmp r0, r8 + bne _0818F602 +_0818F5C2: + mov r0, r10 + adds r1, r5, 0 + ldr r2, [sp, 0x18] + bl sub_818F904 + b _0818F600 + .pool +_0818F600: + b _0818F61E +_0818F602: + mov r3, r10 + lsls r0, r3, 2 + adds r0, r1, r0 + ldr r1, =0x00000d24 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 22 + cmp r0, r2 + bls _0818F61E + mov r0, r10 + adds r1, r5, 0 + ldr r2, [sp, 0x18] + bl sub_818F904 +_0818F61E: + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0xF + ble _0818F5A0 +_0818F626: + mov r10, r7 + mov r2, r10 + cmp r2, 0xE + ble _0818F58A + bl sub_81A3610 + lsls r0, 24 + cmp r0, 0 + beq _0818F6EE + movs r3, 0 + mov r10, r3 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r4, =0x00000d24 + adds r1, r4 + ldrh r1, [r1] + lsls r1, 22 + lsrs r1, 22 + ldr r3, =0x000003ff + adds r2, r0, 0 + ldr r6, =gUnknown_0860D3F1 + cmp r1, r3 + beq _0818F674 + adds r5, r2, 0 +_0818F656: + movs r7, 0x1 + add r10, r7 + mov r0, r10 + cmp r0, 0xF + bgt _0818F674 + ldr r0, [r5] + mov r7, r10 + lsls r1, r7, 2 + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + cmp r0, r3 + bne _0818F656 +_0818F674: + mov r1, r10 + lsls r0, r1, 1 + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0 + beq _0818F6AC + movs r5, 0 + ldr r2, [r2] + ldr r3, =0x00000d24 + adds r2, r3 + ldrh r1, [r2] + ldr r0, =0xfffffc00 + ands r0, r1 + ldr r7, =0x000003fe + adds r1, r7, 0 + b _0818F6BE + .pool +_0818F6AC: + movs r5, 0x1 + ldr r2, [r2] + ldr r0, =0x00000d28 + adds r2, r0 + ldrh r1, [r2] + ldr r0, =0xfffffc00 + ands r0, r1 + ldr r3, =0x000003fe + adds r1, r3, 0 +_0818F6BE: + orrs r0, r1 + strh r0, [r2] + movs r7, 0 + mov r10, r7 + lsls r0, r5, 1 + adds r0, r5 + lsls r4, r0, 1 +_0818F6CC: + mov r1, r10 + lsls r0, r1, 24 + lsrs r0, 24 + bl sub_81A4FF0 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + ldr r2, =0x00000d64 + adds r1, r2 + adds r1, r4 + strh r0, [r1] + adds r4, 0x2 + movs r3, 0x1 + add r10, r3 + mov r5, r10 + cmp r5, 0x2 + ble _0818F6CC +_0818F6EE: + ldr r0, [sp, 0x18] + bl Free + ldr r0, [sp, 0x1C] + bl Free + add sp, 0x3C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818F02C + + thumb_func_start sub_818F720 +sub_818F720: @ 818F720 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + adds r7, r1, 0 + mov r9, r2 + ldr r1, [sp, 0x3C] + ldr r2, [sp, 0x40] + mov r8, r2 + lsls r0, 16 + lsrs r6, r0, 16 + lsls r3, 24 + lsrs r5, r3, 24 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x18] + movs r1, 0 + adds r4, r5, 0 + movs r3, 0x1 + movs r2, 0x5 +_0818F74C: + adds r0, r4, 0 + ands r0, r3 + cmp r0, 0 + beq _0818F756 + adds r1, 0x1 +_0818F756: + lsrs r4, 1 + subs r2, 0x1 + cmp r2, 0 + bge _0818F74C + movs r0, 0xFF + lsls r0, 1 + bl __divsi3 + lsls r0, 16 + lsrs r3, r0, 16 + lsls r0, r6, 3 + mov r10, r0 + movs r1, 0 + mov r12, r1 + mov r1, sp + movs r2, 0x5 +_0818F776: + mov r0, r12 + str r0, [r1] + adds r0, r5, 0 + ands r0, r4 + cmp r0, 0 + beq _0818F784 + str r3, [r1] +_0818F784: + lsls r0, r4, 25 + lsrs r4, r0, 24 + adds r1, 0x4 + subs r2, 0x1 + cmp r2, 0 + bge _0818F776 + ldr r0, =0x0000012f + cmp r6, r0 + bne _0818F7A0 + movs r0, 0x1 + b _0818F7CA + .pool +_0818F7A0: + mov r2, r10 + subs r0, r2, r6 + lsls r0, 2 + ldr r1, =gBaseStats + adds r0, r1 + ldrb r0, [r0] + lsls r0, 1 + mov r2, r9 + adds r1, r0, r2 + ldr r0, [sp] + cmp r0, 0 + bge _0818F7BA + adds r0, 0x3 +_0818F7BA: + asrs r0, 2 + adds r0, r1, r0 + muls r0, r7 + movs r1, 0x64 + bl __divsi3 + adds r0, r7 + adds r0, 0xA +_0818F7CA: + mov r1, r8 + str r0, [r1] + mov r2, r10 + subs r0, r2, r6 + lsls r0, 2 + ldr r1, =gBaseStats + adds r4, r0, r1 + ldrb r0, [r4, 0x1] + lsls r0, 1 + mov r2, r9 + adds r1, r0, r2 + ldr r0, [sp, 0x4] + cmp r0, 0 + bge _0818F7E8 + adds r0, 0x3 +_0818F7E8: + asrs r0, 2 + adds r0, r1, r0 + muls r0, r7 + movs r1, 0x64 + bl __divsi3 + adds r1, r0, 0 + adds r1, 0x5 + mov r0, r8 + str r1, [r0, 0x4] + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x18] + movs r2, 0x1 + bl nature_stat_mod + lsls r0, 24 + lsrs r0, 24 + mov r1, r8 + str r0, [r1, 0x4] + ldrb r0, [r4, 0x2] + lsls r0, 1 + mov r2, r9 + adds r1, r0, r2 + ldr r0, [sp, 0x8] + cmp r0, 0 + bge _0818F820 + adds r0, 0x3 +_0818F820: + asrs r0, 2 + adds r0, r1, r0 + muls r0, r7 + movs r1, 0x64 + bl __divsi3 + adds r1, r0, 0 + adds r1, 0x5 + mov r0, r8 + str r1, [r0, 0x8] + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x18] + movs r2, 0x2 + bl nature_stat_mod + lsls r0, 24 + lsrs r0, 24 + mov r1, r8 + str r0, [r1, 0x8] + ldrb r0, [r4, 0x3] + lsls r0, 1 + mov r2, r9 + adds r1, r0, r2 + ldr r0, [sp, 0xC] + cmp r0, 0 + bge _0818F858 + adds r0, 0x3 +_0818F858: + asrs r0, 2 + adds r0, r1, r0 + muls r0, r7 + movs r1, 0x64 + bl __divsi3 + adds r1, r0, 0 + adds r1, 0x5 + mov r0, r8 + str r1, [r0, 0xC] + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x18] + movs r2, 0x3 + bl nature_stat_mod + lsls r0, 24 + lsrs r0, 24 + mov r1, r8 + str r0, [r1, 0xC] + ldrb r0, [r4, 0x4] + lsls r0, 1 + mov r2, r9 + adds r1, r0, r2 + ldr r0, [sp, 0x10] + cmp r0, 0 + bge _0818F890 + adds r0, 0x3 +_0818F890: + asrs r0, 2 + adds r0, r1, r0 + muls r0, r7 + movs r1, 0x64 + bl __divsi3 + adds r1, r0, 0 + adds r1, 0x5 + mov r0, r8 + str r1, [r0, 0x10] + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x18] + movs r2, 0x4 + bl nature_stat_mod + lsls r0, 24 + lsrs r0, 24 + mov r1, r8 + str r0, [r1, 0x10] + ldrb r0, [r4, 0x5] + lsls r0, 1 + mov r1, r9 + adds r2, r0, r1 + ldr r0, [sp, 0x14] + cmp r0, 0 + bge _0818F8C8 + adds r0, 0x3 +_0818F8C8: + asrs r0, 2 + adds r0, r2, r0 + muls r0, r7 + movs r1, 0x64 + bl __divsi3 + adds r1, r0, 0 + adds r1, 0x5 + mov r2, r8 + str r1, [r2, 0x14] + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x18] + movs r2, 0x5 + bl nature_stat_mod + lsls r0, 24 + lsrs r0, 24 + mov r1, r8 + str r0, [r1, 0x14] + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818F720 + + thumb_func_start sub_818F904 +sub_818F904: @ 818F904 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r3, r0, 1 + mov r12, r3 + adds r4, r3, r2 + ldrh r5, [r4] + lsls r7, r1, 1 + mov r9, r7 + add r2, r9 + ldrh r3, [r2] + strh r3, [r4] + strh r5, [r2] + ldr r2, =gSaveBlock2Ptr + ldr r5, [r2] + lsls r6, r0, 2 + adds r6, r5, r6 + ldr r3, =0x00000d24 + adds r6, r3 + ldrh r7, [r6] + mov r10, r7 + mov r2, r10 + lsls r2, 22 + mov r8, r2 + lsls r2, r1, 2 + adds r5, r2 + adds r5, r3 + ldrh r4, [r5] + lsls r4, 22 + lsrs r4, 22 + ldr r3, =0xfffffc00 + adds r2, r3, 0 + mov r7, r10 + ands r2, r7 + orrs r2, r4 + strh r2, [r6] + mov r2, r8 + lsrs r2, 22 + mov r8, r2 + ldrh r2, [r5] + ands r3, r2 + mov r7, r8 + orrs r3, r7 + strh r3, [r5] + ldr r2, =gSaveBlock2Ptr + mov r8, r2 + add r12, r0 + add r9, r1 + mov r3, r9 + lsls r4, r3, 1 + mov r7, r12 + lsls r3, r7, 1 + ldr r7, =0x00000d64 + movs r6, 0x2 +_0818F974: + mov r1, r8 + ldr r0, [r1] + adds r0, r7 + adds r2, r0, r3 + ldrh r5, [r2] + adds r0, r4 + ldrh r1, [r0] + strh r1, [r2] + strh r5, [r0] + adds r4, 0x2 + adds r3, 0x2 + subs r6, 0x1 + cmp r6, 0 + bge _0818F974 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818F904 + + thumb_func_start sub_818F9B0 +sub_818F9B0: @ 818F9B0 + push {lr} + ldr r0, =gStringVar1 + ldr r2, =gUnknown_085CCD20 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + ldr r3, =0x00000cb2 + adds r1, r3 + ldrh r1, [r1] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl StringCopy + pop {r0} + bx r0 + .pool + thumb_func_end sub_818F9B0 + + thumb_func_start sub_818F9E0 +sub_818F9E0: @ 818F9E0 + push {lr} + ldr r0, =gStringVar1 + ldr r2, =gUnknown_085CCD20 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + ldr r3, =0x00000cb2 + adds r1, r3 + ldrh r1, [r1] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl StringCopy + ldr r0, =gStringVar2 + ldr r1, =gUnknown_02038BCA + ldrh r1, [r1] + bl sub_8195898 + pop {r0} + bx r0 + .pool + thumb_func_end sub_818F9E0 + + thumb_func_start sub_818FA20 +sub_818FA20: @ 818FA20 + push {r4,r5,lr} + ldr r1, =gUnknown_0203CD70 + movs r0, 0 + str r0, [r1] + ldr r4, =gPlayerParty + adds r0, r4, 0 + movs r1, 0x3A + movs r2, 0 + bl GetMonData + ldr r5, =gUnknown_0203CD74 + str r0, [r5] + adds r4, 0x64 + adds r0, r4, 0 + movs r1, 0x3A + movs r2, 0 + bl GetMonData + ldr r1, [r5] + adds r1, r0 + str r1, [r5] + bl calc_player_party_count + ldr r0, =gUnknown_02038BCA + ldrh r0, [r0] + bl sub_8195358 + lsls r0, 16 + lsrs r0, 16 + bl sub_818FBDC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818FA20 + + thumb_func_start sub_818FA74 +sub_818FA74: @ 818FA74 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x30 + adds r5, r2, 0 + str r3, [sp, 0x14] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x10] + lsls r1, 16 + lsrs r1, 16 + str r1, [sp, 0x28] + lsls r5, 24 + lsrs r5, 24 + add r0, sp, 0xC + movs r1, 0x1 + negs r1, r1 + strb r1, [r0] + ldr r0, [sp, 0x28] + bl sub_8190168 + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + str r6, [sp, 0x2C] + bl sub_8165C40 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x64 + ldr r4, [sp, 0x10] + adds r3, r4, 0 + muls r3, r0 + str r3, [sp, 0x18] + ldr r6, =gEnemyParty + adds r0, r3, r6 + ldr r7, =gSaveBlock2Ptr + ldr r4, [r7] + lsls r5, 1 + ldr r3, [sp, 0x28] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 1 + adds r1, r5, r1 + ldr r6, =0x00000d64 + adds r4, r6 + adds r4, r1 + ldrh r3, [r4] + ldr r7, =gUnknown_0203BC8C + ldr r7, [r7] + mov r8, r7 + lsls r3, 4 + add r3, r8 + ldrh r1, [r3] + ldrb r3, [r3, 0xC] + ldr r6, [sp, 0x2C] + str r6, [sp] + ldrh r4, [r4] + lsls r4, 4 + add r4, r8 + ldrb r4, [r4, 0xB] + str r4, [sp, 0x4] + ldr r7, [sp, 0x14] + str r7, [sp, 0x8] + bl sub_8068634 + add r0, sp, 0xC + movs r1, 0x1 + negs r1, r1 + strb r1, [r0] + movs r6, 0 + ldr r2, [sp, 0x18] + str r2, [sp, 0x1C] + mov r10, r5 + ldr r3, =0x00000d64 + mov r9, r3 + ldr r3, =gUnknown_0203BC8C + mov r4, r10 + str r4, [sp, 0x20] +_0818FB18: + ldr r7, =gSaveBlock2Ptr + ldr r1, [r7] + ldr r2, [sp, 0x28] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 1 + mov r8, r0 + mov r5, r10 + add r5, r8 + add r1, r9 + adds r1, r5 + ldrh r0, [r1] + ldr r1, [r3] + lsls r0, 4 + adds r0, r1 + lsls r4, r6, 1 + adds r0, 0x2 + adds r0, r4 + ldrh r1, [r0] + lsls r2, r6, 24 + lsrs r2, 24 + mov r12, r2 + ldr r7, [sp, 0x1C] + ldr r2, =gEnemyParty + adds r0, r7, r2 + mov r2, r12 + str r3, [sp, 0x24] + bl sub_80691F4 + ldr r7, =gSaveBlock2Ptr + ldr r0, [r7] + add r0, r9 + adds r0, r5 + ldrh r0, [r0] + ldr r3, [sp, 0x24] + ldr r1, [r3] + lsls r0, 4 + adds r0, r1 + adds r0, 0x2 + adds r0, r4 + ldrh r0, [r0] + cmp r0, 0xDA + bne _0818FB74 + movs r1, 0 + add r0, sp, 0xC + strb r1, [r0] +_0818FB74: + adds r6, 0x1 + cmp r6, 0x3 + ble _0818FB18 + movs r0, 0x64 + ldr r1, [sp, 0x10] + adds r4, r1, 0 + muls r4, r0 + ldr r0, =gEnemyParty + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x20 + add r2, sp, 0xC + bl SetMonData + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, [sp, 0x20] + add r1, r8 + ldr r2, =0x00000d64 + adds r0, r2 + adds r0, r1 + ldrh r0, [r0] + ldr r1, =gUnknown_0203BC8C + ldr r1, [r1] + lsls r0, 4 + adds r0, r1 + ldrb r2, [r0, 0xA] + lsls r2, 1 + ldr r0, =gBattleFrontierHeldItems + adds r2, r0 + adds r0, r4, 0 + movs r1, 0xC + bl SetMonData + add sp, 0x30 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818FA74 + + thumb_func_start sub_818FBDC +sub_818FBDC: @ 818FBDC + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + movs r6, 0 + bl zero_enemy_party_data + mov r0, r8 + bl sub_818FC78 + adds r5, r0, 0 + bl Random + adds r4, r0, 0 + bl Random + lsls r4, 16 + lsrs r7, r4, 16 + lsls r0, 16 + orrs r7, r0 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x5 + bls _0818FC46 + movs r4, 0 +_0818FC20: + movs r0, 0x1 + ands r0, r5 + cmp r0, 0 + beq _0818FC3C + lsls r2, r4, 24 + lsrs r2, 24 + adds r0, r6, 0 + mov r1, r8 + adds r3, r7, 0 + bl sub_818FA74 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_0818FC3C: + asrs r5, 1 + adds r4, 0x1 + cmp r4, 0x2 + ble _0818FC20 + b _0818FC6C +_0818FC46: + movs r4, 0x2 +_0818FC48: + movs r0, 0x4 + ands r0, r5 + cmp r0, 0 + beq _0818FC64 + lsls r2, r4, 24 + lsrs r2, 24 + adds r0, r6, 0 + mov r1, r8 + adds r3, r7, 0 + bl sub_818FA74 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_0818FC64: + lsls r5, 1 + subs r4, 0x1 + cmp r4, 0 + bge _0818FC48 +_0818FC6C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_818FBDC + + thumb_func_start sub_818FC78 +sub_818FC78: @ 818FC78 + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r5, r4, 0 + bl Random + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0818FCA2 + adds r0, r4, 0 + movs r1, 0 + bl sub_818FCBC + cmp r0, 0 + bne _0818FCB6 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_818FDB8 + b _0818FCB6 +_0818FCA2: + adds r0, r5, 0 + movs r1, 0 + bl sub_818FDB8 + cmp r0, 0 + bne _0818FCB6 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_818FCBC +_0818FCB6: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_818FC78 + + thumb_func_start sub_818FCBC +sub_818FCBC: @ 818FCBC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0xC] + movs r0, 0 + mov r9, r0 + mov r1, r8 + lsls r1, 2 + str r1, [sp, 0x18] +_0818FCDE: + mov r2, r9 + lsls r0, r2, 2 + mov r2, sp + adds r1, r2, r0 + movs r0, 0 + str r0, [r1] + movs r7, 0 + mov r0, r9 + adds r0, 0x1 + str r0, [sp, 0x14] + adds r5, r1, 0 + mov r1, r9 + lsls r1, 1 + str r1, [sp, 0x10] +_0818FCFA: + movs r6, 0 + adds r2, r7, 0x1 + mov r10, r2 +_0818FD00: + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r2, [sp, 0x18] + adds r0, r1, r2 + ldr r2, =0x00000d24 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + ldr r2, =0x000003fe + cmp r0, r2 + bne _0818FD3C + mov r1, r9 + lsls r0, r1, 24 + lsls r1, r7, 24 + lsrs r0, 24 + lsrs r1, 24 + bl sub_81A5060 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + b _0818FD60 + .pool +_0818FD3C: + mov r2, r8 + lsls r0, r2, 1 + add r0, r8 + lsls r0, 1 + ldr r2, [sp, 0x10] + adds r0, r2, r0 + ldr r2, =0x00000d64 + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + ldr r1, =gUnknown_0203BC8C + ldr r1, [r1] + lsls r0, 4 + adds r0, r1 + lsls r1, r7, 1 + adds r0, 0x2 + adds r0, r1 + ldrh r4, [r0] +_0818FD60: + movs r0, 0x64 + muls r0, r6 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl GetMonData + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0 + bl sub_818FFC0 + ldr r1, [r5] + adds r1, r0 + str r1, [r5] + adds r6, 0x1 + cmp r6, 0x2 + ble _0818FD00 + mov r7, r10 + cmp r7, 0x3 + ble _0818FCFA + ldr r0, [sp, 0x14] + mov r9, r0 + cmp r0, 0x2 + ble _0818FCDE + mov r0, sp + ldr r1, [sp, 0xC] + bl sub_818FEB4 + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_818FCBC + + thumb_func_start sub_818FDB8 +sub_818FDB8: @ 818FDB8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0xC] + movs r0, 0 + mov r9, r0 + mov r1, r8 + lsls r1, 2 + str r1, [sp, 0x18] +_0818FDDA: + mov r2, r9 + lsls r0, r2, 2 + mov r2, sp + adds r1, r2, r0 + movs r0, 0 + str r0, [r1] + movs r7, 0 + mov r0, r9 + adds r0, 0x1 + str r0, [sp, 0x14] + adds r5, r1, 0 + mov r1, r9 + lsls r1, 1 + str r1, [sp, 0x10] +_0818FDF6: + movs r6, 0 + adds r2, r7, 0x1 + mov r10, r2 +_0818FDFC: + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r2, [sp, 0x18] + adds r0, r1, r2 + ldr r2, =0x00000d24 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + ldr r2, =0x000003fe + cmp r0, r2 + bne _0818FE38 + mov r1, r9 + lsls r0, r1, 24 + lsls r1, r7, 24 + lsrs r0, 24 + lsrs r1, 24 + bl sub_81A5060 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + b _0818FE5C + .pool +_0818FE38: + mov r2, r8 + lsls r0, r2, 1 + add r0, r8 + lsls r0, 1 + ldr r2, [sp, 0x10] + adds r0, r2, r0 + ldr r2, =0x00000d64 + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + ldr r1, =gUnknown_0203BC8C + ldr r1, [r1] + lsls r0, 4 + adds r0, r1 + lsls r1, r7, 1 + adds r0, 0x2 + adds r0, r1 + ldrh r4, [r0] +_0818FE5C: + movs r0, 0x64 + muls r0, r6 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl GetMonData + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0x1 + bl sub_818FFC0 + ldr r1, [r5] + adds r1, r0 + str r1, [r5] + adds r6, 0x1 + cmp r6, 0x2 + ble _0818FDFC + mov r7, r10 + cmp r7, 0x3 + ble _0818FDF6 + ldr r0, [sp, 0x14] + mov r9, r0 + cmp r0, 0x2 + ble _0818FDDA + mov r0, sp + ldr r1, [sp, 0xC] + bl sub_818FEB4 + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_818FDB8 + + thumb_func_start sub_818FEB4 +sub_818FEB4: @ 818FEB4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + mov r10, r0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0 + str r0, [sp, 0xC] + movs r3, 0x2 + add r0, sp, 0x8 +_0818FECE: + str r3, [r0] + subs r0, 0x4 + subs r3, 0x1 + cmp r3, 0 + bge _0818FECE + mov r3, r10 + ldr r2, [r3] + ldr r0, [r3, 0x4] + cmp r2, r0 + bne _0818FF20 + ldr r0, [r3, 0x8] + cmp r2, r0 + bne _0818FF20 + cmp r1, 0 + beq _0818FFAA + movs r3, 0 + ldr r4, =gBitTable +_0818FEF0: + str r3, [sp, 0x14] + bl Random + movs r1, 0x3 + ands r1, r0 + ldr r3, [sp, 0x14] + cmp r1, 0x3 + beq _0818FF16 + lsls r0, r1, 2 + adds r0, r4 + ldr r1, [r0] + ldr r0, [sp, 0xC] + ands r0, r1 + cmp r0, 0 + bne _0818FF16 + ldr r0, [sp, 0xC] + orrs r0, r1 + str r0, [sp, 0xC] + adds r3, 0x1 +_0818FF16: + cmp r3, 0x2 + bne _0818FEF0 + b _0818FFAA + .pool +_0818FF20: + movs r3, 0 + mov r9, sp + mov r8, r10 +_0818FF26: + adds r2, r3, 0x1 + cmp r2, 0x2 + bgt _0818FF84 + mov r6, r8 + mov r7, r9 + lsls r0, r2, 2 + mov r1, sp + adds r5, r0, r1 + mov r1, r10 + adds r4, r0, r1 +_0818FF3A: + ldr r0, [r6] + ldr r1, [r4] + cmp r0, r1 + bge _0818FF4E + str r1, [r6] + str r0, [r4] + ldr r1, [r7] + ldr r0, [r5] + str r0, [r7] + str r1, [r5] +_0818FF4E: + ldr r1, [r6] + ldr r0, [r4] + cmp r1, r0 + bne _0818FF7A + str r2, [sp, 0x10] + str r3, [sp, 0x14] + bl Random + movs r1, 0x1 + ands r1, r0 + ldr r2, [sp, 0x10] + ldr r3, [sp, 0x14] + cmp r1, 0 + beq _0818FF7A + ldr r1, [r6] + ldr r0, [r4] + str r0, [r6] + str r1, [r4] + ldr r1, [r7] + ldr r0, [r5] + str r0, [r7] + str r1, [r5] +_0818FF7A: + adds r5, 0x4 + adds r4, 0x4 + adds r2, 0x1 + cmp r2, 0x2 + ble _0818FF3A +_0818FF84: + movs r4, 0x4 + add r9, r4 + add r8, r4 + adds r3, 0x1 + cmp r3, 0x1 + ble _0818FF26 + ldr r2, =gBitTable + mov r1, sp + movs r3, 0x1 +_0818FF96: + ldm r1!, {r0} + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ldr r4, [sp, 0xC] + orrs r4, r0 + str r4, [sp, 0xC] + subs r3, 0x1 + cmp r3, 0 + bge _0818FF96 +_0818FFAA: + ldr r0, [sp, 0xC] + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_818FEB4 + + thumb_func_start sub_818FFC0 +sub_818FFC0: @ 818FFC0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r3, r0, 0 + adds r4, r1, 0 + str r2, [sp] + movs r6, 0 + movs r2, 0x14 + cmp r3, 0 + beq _0818FFF0 + ldr r0, =0x0000ffff + cmp r3, r0 + beq _0818FFF0 + ldr r0, =gBattleMoves + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 2 + adds r3, r1, r0 + ldrb r0, [r3, 0x1] + cmp r0, 0 + bne _0818FFFC +_0818FFF0: + movs r0, 0 + b _08190156 + .pool +_0818FFFC: + ldr r1, =gBaseStats + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x6] + mov r10, r1 + ldrb r1, [r0, 0x7] + mov r9, r1 + ldrb r0, [r0, 0x16] + mov r8, r0 + ldrb r3, [r3, 0x2] + str r3, [sp, 0x4] + cmp r0, 0x1A + bne _0819002C + cmp r3, 0x4 + bne _0819002C + ldr r0, [sp] + cmp r0, 0x1 + bne _081900AA + movs r2, 0x8 + b _081900A4 + .pool +_0819002C: + ldr r0, =gUnknown_0831ACE8 + adds r1, r6, r0 + ldrb r0, [r1] + ldr r7, =gUnknown_0831ACE8 + cmp r0, 0xFF + beq _081900A4 + adds r4, r1, 0 +_0819003A: + ldrb r0, [r4] + cmp r0, 0xFE + beq _08190096 + ldrb r0, [r4] + ldr r1, [sp, 0x4] + cmp r0, r1 + bne _08190096 + ldrb r0, [r4, 0x1] + adds r5, r6, 0x1 + cmp r0, r10 + bne _0819006C + adds r1, r6, 0x2 + mov r0, r8 + cmp r0, 0x19 + bne _0819005E + ldrb r0, [r4, 0x2] + cmp r0, 0x28 + bne _0819006C +_0819005E: + adds r0, r1, r7 + ldrb r0, [r0] + muls r0, r2 + movs r1, 0xA + bl __divsi3 + adds r2, r0, 0 +_0819006C: + adds r0, r5, r7 + ldrb r0, [r0] + cmp r0, r9 + bne _08190096 + cmp r10, r9 + beq _08190096 + adds r1, r6, 0x2 + mov r0, r8 + cmp r0, 0x19 + bne _08190088 + adds r0, r1, r7 + ldrb r0, [r0] + cmp r0, 0x28 + bne _08190096 +_08190088: + adds r0, r1, r7 + ldrb r0, [r0] + muls r0, r2 + movs r1, 0xA + bl __divsi3 + adds r2, r0, 0 +_08190096: + adds r4, 0x3 + adds r6, 0x3 + ldr r1, =gUnknown_0831ACE8 + adds r0, r6, r1 + ldrb r0, [r0] + cmp r0, 0xFF + bne _0819003A +_081900A4: + ldr r0, [sp] + cmp r0, 0x1 + beq _081900E0 +_081900AA: + ldr r1, [sp] + cmp r1, 0x1 + bgt _081900BC + cmp r1, 0 + beq _081900C4 + b _08190154 + .pool +_081900BC: + ldr r0, [sp] + cmp r0, 0x2 + beq _08190114 + b _08190154 +_081900C4: + cmp r2, 0xA + beq _08190146 + cmp r2, 0xA + ble _08190146 + cmp r2, 0x28 + beq _0819014A + cmp r2, 0x28 + bgt _081900DA + cmp r2, 0x14 + beq _08190104 + b _08190146 +_081900DA: + cmp r2, 0x50 + bne _08190146 + b _08190100 +_081900E0: + cmp r2, 0xA + beq _08190104 + cmp r2, 0xA + bgt _081900F2 + cmp r2, 0 + beq _08190100 + cmp r2, 0x5 + beq _0819014A + b _08190146 +_081900F2: + cmp r2, 0x28 + beq _08190108 + cmp r2, 0x28 + ble _08190146 + cmp r2, 0x50 + beq _0819010E + b _08190146 +_08190100: + movs r2, 0x8 + b _08190154 +_08190104: + movs r2, 0x2 + b _08190154 +_08190108: + movs r2, 0x2 + negs r2, r2 + b _08190154 +_0819010E: + movs r2, 0x4 + negs r2, r2 + b _08190154 +_08190114: + cmp r2, 0xA + beq _08190146 + cmp r2, 0xA + bgt _08190126 + cmp r2, 0 + beq _0819013A + cmp r2, 0x5 + beq _08190140 + b _08190146 +_08190126: + cmp r2, 0x28 + beq _0819014E + cmp r2, 0x28 + bgt _08190134 + cmp r2, 0x14 + beq _0819014A + b _08190146 +_08190134: + cmp r2, 0x50 + beq _08190152 + b _08190146 +_0819013A: + movs r2, 0x10 + negs r2, r2 + b _08190154 +_08190140: + movs r2, 0x8 + negs r2, r2 + b _08190154 +_08190146: + movs r2, 0 + b _08190154 +_0819014A: + movs r2, 0x4 + b _08190154 +_0819014E: + movs r2, 0xC + b _08190154 +_08190152: + movs r2, 0x14 +_08190154: + adds r0, r2, 0 +_08190156: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_818FFC0 + + thumb_func_start sub_8190168 +sub_8190168: @ 8190168 + push {lr} + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + cmp r0, 0x63 + bls _0819019A + movs r1, 0x6 + cmp r0, 0x77 + bls _0819019A + movs r1, 0x9 + cmp r0, 0x8B + bls _0819019A + movs r1, 0xC + cmp r0, 0x9F + bls _0819019A + movs r1, 0xF + cmp r0, 0xB3 + bls _0819019A + movs r1, 0x12 + cmp r0, 0xC7 + bls _0819019A + movs r1, 0x1F + cmp r0, 0xDB + bhi _0819019A + movs r1, 0x15 +_0819019A: + adds r0, r1, 0 + pop {r1} + bx r1 + thumb_func_end sub_8190168 + + thumb_func_start sub_81901A0 +sub_81901A0: @ 81901A0 + push {r4-r7,lr} + adds r3, r0, 0 + adds r2, r1, 0 + movs r5, 0 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r4, =0x00000d24 + adds r1, r4 + ldrh r1, [r1] + lsls r1, 22 + lsrs r1, 22 + mov r12, r0 + ldr r6, =gUnknown_0860D10C + cmp r1, r2 + beq _081901D8 + mov r7, r12 +_081901C0: + adds r5, 0x1 + cmp r5, 0xF + bgt _081901D8 + ldr r0, [r7] + lsls r1, r5, 2 + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + cmp r0, r2 + bne _081901C0 +_081901D8: + cmp r3, 0 + beq _0819026C + cmp r3, 0x3 + bne _081901FC + lsls r0, r5, 2 + adds r1, r0, 0x3 + adds r1, r6 + ldrb r1, [r1] + adds r4, r1, 0 + adds r4, 0x8 + b _08190206 + .pool +_081901FC: + lsls r0, r5, 2 + adds r1, r3, r0 + adds r1, r6 + ldrb r1, [r1] + adds r4, r1, 0x4 +_08190206: + adds r0, r3, r0 + adds r0, r6 + ldrb r2, [r0] + cmp r2, r4 + bge _08190256 + ldr r1, =gUnknown_0860D14C + adds r0, r2, r1 + ldrb r3, [r0] + adds r6, r1, 0 + cmp r3, r5 + beq _08190234 + mov r1, r12 + ldr r0, [r1] + lsls r1, r3, 2 + adds r0, r1 + ldr r3, =0x00000d25 + adds r0, r3 + b _0819024E + .pool +_08190234: + adds r2, 0x1 + cmp r2, r4 + bge _08190256 + adds r0, r2, r6 + ldrb r1, [r0] + cmp r1, r5 + beq _08190234 + mov r3, r12 + ldr r0, [r3] + lsls r1, 2 + adds r0, r1 + ldr r1, =0x00000d25 + adds r0, r1 +_0819024E: + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _08190234 +_08190256: + cmp r2, r4 + beq _08190286 + ldr r0, =gUnknown_0860D14C + adds r0, r2, r0 + ldrb r0, [r0] + b _08190292 + .pool +_0819026C: + mov r3, r12 + ldr r1, [r3] + lsls r0, r5, 2 + adds r0, r6 + ldrb r2, [r0] + lsls r0, r2, 2 + adds r1, r0 + ldr r0, =0x00000d25 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 29 + cmp r0, 0 + bge _08190290 +_08190286: + movs r0, 0xFF + b _08190292 + .pool +_08190290: + adds r0, r2, 0 +_08190292: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81901A0 + + thumb_func_start sub_8190298 +sub_8190298: @ 8190298 + push {lr} + bl sub_81902AC + ldr r1, =gUnknown_02038BCA + strh r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8190298 + + thumb_func_start sub_81902AC +sub_81902AC: @ 81902AC + push {r4,lr} + ldr r0, =gSaveBlock2Ptr + ldr r4, [r0] + ldr r1, =0x00000cb2 + adds r0, r4, r1 + ldrh r0, [r0] + ldr r1, =0x000003ff + bl sub_81901A0 + lsls r0, 2 + adds r4, r0 + ldr r0, =0x00000d24 + adds r4, r0 + ldrh r0, [r4] + lsls r0, 22 + lsrs r0, 22 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81902AC + + thumb_func_start sub_81902E4 +sub_81902E4: @ 81902E4 + push {lr} + ldr r0, =gUnknown_02038BCA + ldrh r0, [r0] + movs r1, 0 + bl sub_8162614 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81902E4 + + thumb_func_start sub_81902F8 +sub_81902F8: @ 81902F8 + push {r4,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =gSpecialVar_0x8005 + ldrh r1, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + strb r1, [r0] + movs r0, 0x80 + lsls r0, 7 + movs r1, 0 + bl VarSet + ldr r1, [r4] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl sub_81A4C30 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81902F8 + + thumb_func_start sub_819033C +sub_819033C: @ 819033C + push {r4,r5,lr} + ldr r5, =gSaveBlock2Ptr + ldr r0, [r5] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r4, [r0] + lsls r4, 30 + lsrs r4, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 24 + ldr r1, [r5] + lsls r4, 1 + lsrs r0, 22 + adds r4, r0 + ldr r3, =0x00000d0c + adds r1, r3 + adds r1, r4 + ldrh r0, [r1] + ldr r2, =0x000003e6 + cmp r0, r2 + bhi _0819036E + adds r0, 0x1 + strh r0, [r1] +_0819036E: + ldr r0, [r5] + ldr r1, =0x00000d1c + adds r0, r1 + adds r1, r0, r4 + ldrh r0, [r1] + cmp r0, r2 + bhi _08190380 + adds r0, 0x1 + strh r0, [r1] +_08190380: + ldr r0, [r5] + adds r1, r0, r3 + adds r1, r4 + ldr r2, =0x00000d14 + adds r0, r2 + adds r0, r4 + ldrh r1, [r1] + ldrh r2, [r0] + cmp r1, r2 + bls _08190396 + strh r1, [r0] +_08190396: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819033C + + thumb_func_start sub_81903B8 +sub_81903B8: @ 81903B8 + push {r4,r5,lr} + ldr r0, =sub_8190400 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gTasks + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + movs r5, 0 + strh r5, [r4, 0x8] + bl sub_81902AC + lsls r0, 16 + lsrs r0, 16 + bl sub_8195358 + strh r0, [r4, 0xA] + strh r5, [r4, 0xC] + strh r5, [r4, 0xE] + ldr r0, =sub_8194B54 + bl SetMainCallback2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81903B8 + + thumb_func_start sub_8190400 +sub_8190400: @ 8190400 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldr r1, =gTasks + lsls r0, 2 + add r0, r10 + lsls r0, 3 + adds r6, r0, r1 + movs r0, 0xA + ldrsh r5, [r6, r0] + movs r2, 0xC + ldrsh r1, [r6, r2] + mov r9, r1 + movs r0, 0xE + ldrsh r7, [r6, r0] + movs r1, 0x8 + ldrsh r4, [r6, r1] + cmp r4, 0x1 + beq _08190508 + cmp r4, 0x1 + bgt _08190440 + cmp r4, 0 + beq _0819044E + b _08190772 + .pool +_08190440: + cmp r4, 0x2 + bne _08190446 + b _08190570 +_08190446: + cmp r4, 0x3 + bne _0819044C + b _08190634 +_0819044C: + b _08190772 +_0819044E: + movs r0, 0 + bl SetHBlankCallback + movs r0, 0 + bl SetVBlankCallback + movs r0, 0x1 + bl EnableInterrupts + str r4, [sp, 0x4] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, =0x05006000 + add r0, sp, 0x4 + bl CpuSet + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_0860CE84 + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + ldr r0, =gUnknown_0860CEB4 + bl InitWindows + bl DeactivateAllTextPrinters + ldr r0, =gUnknown_02022E14 + strh r4, [r0] + ldr r0, =gUnknown_02022E16 + strh r4, [r0] + ldr r0, =gUnknown_02022E18 + strh r4, [r0] + ldr r0, =gUnknown_02022E1A + strh r4, [r0] + ldr r0, =gUnknown_02022E20 + strh r4, [r0] + ldr r0, =gUnknown_02022E22 + strh r4, [r0] + mov r2, r9 + cmp r2, 0x2 + bne _081904DC + ldr r0, =gUnknown_02022E1C + strh r4, [r0] + ldr r0, =gUnknown_02022E1E + strh r4, [r0] + b _081904E6 + .pool +_081904DC: + ldr r0, =gUnknown_02022E1C + strh r4, [r0] + ldr r1, =gUnknown_02022E1E + movs r0, 0xA0 + strh r0, [r1] +_081904E6: + ldr r0, =gTasks + mov r2, r10 + lsls r1, r2, 2 + add r1, r10 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _08190772 + .pool +_08190508: + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + movs r0, 0x4C + movs r1, 0 + bl SetGpuReg + movs r0, 0x40 + movs r1, 0 + bl SetGpuReg + movs r0, 0x44 + movs r1, 0 + bl SetGpuReg + movs r0, 0x42 + movs r1, 0 + bl SetGpuReg + movs r0, 0x46 + movs r1, 0 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0 + bl SetGpuReg + movs r0, 0x4A + movs r1, 0x3F + bl SetGpuReg + bl ResetPaletteFade + bl ResetSpriteData + bl FreeAllSpritePalettes + ldr r1, =gReservedSpritePaletteCount + movs r0, 0x4 + strb r0, [r1] + b _08190602 + .pool +_08190570: + ldr r1, =gUnknown_08D83D50 + movs r5, 0x80 + lsls r5, 6 + movs r7, 0 + str r7, [sp] + movs r0, 0x2 + adds r2, r5, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r1, =gUnknown_08D84970 + movs r4, 0x1 + str r4, [sp] + movs r0, 0x2 + adds r2, r5, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r1, =gUnknown_08D84F00 + movs r2, 0x80 + lsls r2, 4 + str r4, [sp] + movs r0, 0x3 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r0, =gUnknown_0860CF50 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_08D85358 + movs r4, 0x80 + lsls r4, 2 + movs r1, 0 + adds r2, r4, 0 + bl LoadCompressedPalette + ldr r0, =gUnknown_08D85444 + movs r1, 0x80 + lsls r1, 1 + adds r2, r4, 0 + bl LoadCompressedPalette + ldr r0, =gUnknown_08D85600 + movs r1, 0xF0 + movs r2, 0x20 + bl LoadCompressedPalette + mov r0, r9 + cmp r0, 0x2 + bne _081905DE + ldr r0, =gUnknown_08D854C8 + movs r1, 0x50 + movs r2, 0x20 + bl LoadCompressedPalette +_081905DE: + str r7, [sp, 0x8] + add r0, sp, 0x8 + ldr r1, =gPlttBufferFaded + ldr r2, =0x05000100 + bl CpuSet + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg +_08190602: + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] + b _08190772 + .pool +_08190634: + ldr r0, =sub_8194B70 + bl SetVBlankCallback + ldr r4, =gUnknown_0203CD78 + movs r0, 0x14 + bl AllocZeroed + str r0, [r4] + movs r6, 0 + lsls r5, 24 + movs r2, 0xFF +_0819064A: + ldr r1, [r4] + adds r1, r6 + ldrb r0, [r1] + orrs r0, r2 + strb r0, [r1] + adds r6, 0x1 + cmp r6, 0xF + ble _0819064A + bl sub_80D2F04 + ldr r0, =sub_8190CD4 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x8] + strh r1, [r0, 0xC] + mov r1, r9 + strh r1, [r0, 0xE] + strh r7, [r0, 0x10] + mov r2, r9 + cmp r2, 0x2 + bne _081906A8 + lsrs r1, r5, 24 + movs r0, 0 + bl sub_819314C + ldr r0, =gUnknown_0203CD78 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x10] + b _081906B0 + .pool +_081906A8: + lsrs r1, r5, 24 + movs r0, 0 + bl sub_81924E0 +_081906B0: + movs r1, 0xFA + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + mov r0, r9 + cmp r0, 0 + beq _0819076C + ldr r5, =gUnknown_0860D068 + adds r0, r5, 0 + movs r1, 0x78 + movs r2, 0x4 + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r7, r0, 24 + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + ldr r1, =gSprites + mov r8, r1 + add r4, r8 + adds r0, r4, 0 + movs r1, 0 + bl StartSpriteAnim + strh r6, [r4, 0x2E] + adds r0, r5, 0 + movs r1, 0x78 + movs r2, 0x9C + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r7, r0, 24 + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + add r4, r8 + adds r0, r4, 0 + movs r1, 0x1 + bl StartSpriteAnim + strh r6, [r4, 0x2E] + ldr r5, =gUnknown_0860D050 + adds r0, r5, 0 + movs r1, 0x6 + movs r2, 0x50 + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + mov r2, r8 + adds r4, r0, r2 + adds r0, r4, 0 + movs r1, 0 + bl StartSpriteAnim + strh r6, [r4, 0x2E] + movs r0, 0 + strh r0, [r4, 0x30] + mov r1, r9 + cmp r1, 0x1 + bne _08190746 + adds r0, r4, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_08190746: + adds r0, r5, 0 + movs r1, 0xEA + movs r2, 0x50 + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r7, r0, 24 + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + add r4, r8 + adds r0, r4, 0 + movs r1, 0x1 + bl StartSpriteAnim + strh r6, [r4, 0x2E] + movs r0, 0x1 + strh r0, [r4, 0x30] +_0819076C: + mov r0, r10 + bl DestroyTask +_08190772: + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8190400 + + thumb_func_start sub_8190790 +sub_8190790: @ 8190790 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x22] + adds r1, r0, 0x4 + strh r1, [r2, 0x22] + movs r3, 0x2E + ldrsh r0, [r2, r3] + cmp r0, 0 + beq _081907D4 + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x20 + negs r1, r1 + cmp r0, r1 + blt _081907BC + adds r3, r2, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r3] +_081907BC: + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x28 + bne _081907F0 + ldr r0, =SpriteCallbackDummy + str r0, [r2, 0x1C] + b _081907F0 + .pool +_081907D4: + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xBF + ble _081907F0 + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + movs r3, 0x32 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldrh r0, [r2, 0x34] + bl sub_818D8F0 +_081907F0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8190790 + + thumb_func_start sub_81907F8 +sub_81907F8: @ 81907F8 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x22] + subs r1, r0, 0x4 + strh r1, [r2, 0x22] + movs r3, 0x2E + ldrsh r0, [r2, r3] + cmp r0, 0 + beq _08190838 + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xC0 + bgt _08190820 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r3] +_08190820: + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x28 + bne _08190858 + ldr r0, =SpriteCallbackDummy + str r0, [r2, 0x1C] + b _08190858 + .pool +_08190838: + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x20 + negs r1, r1 + cmp r0, r1 + bgt _08190858 + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + movs r3, 0x32 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldrh r0, [r2, 0x34] + bl sub_818D8F0 +_08190858: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81907F8 + + thumb_func_start sub_8190860 +sub_8190860: @ 8190860 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x20] + adds r1, r0, 0x4 + strh r1, [r2, 0x20] + movs r3, 0x2E + ldrsh r0, [r2, r3] + cmp r0, 0 + beq _081908A4 + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x20 + negs r1, r1 + cmp r0, r1 + blt _0819088C + adds r3, r2, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r3] +_0819088C: + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x40 + bne _081908C0 + ldr r0, =SpriteCallbackDummy + str r0, [r2, 0x1C] + b _081908C0 + .pool +_081908A4: + lsls r1, 16 + ldr r0, =0x010f0000 + cmp r1, r0 + ble _081908C0 + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + movs r3, 0x32 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldrh r0, [r2, 0x34] + bl sub_818D8F0 +_081908C0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8190860 + + thumb_func_start sub_81908CC +sub_81908CC: @ 81908CC + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x20] + subs r1, r0, 0x4 + strh r1, [r2, 0x20] + movs r3, 0x2E + ldrsh r0, [r2, r3] + cmp r0, 0 + beq _08190910 + lsls r1, 16 + movs r0, 0x88 + lsls r0, 17 + cmp r1, r0 + bgt _081908F6 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r3] +_081908F6: + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x40 + bne _08190930 + ldr r0, =SpriteCallbackDummy + str r0, [r2, 0x1C] + b _08190930 + .pool +_08190910: + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x20 + negs r1, r1 + cmp r0, r1 + bgt _08190930 + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + movs r3, 0x32 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldrh r0, [r2, 0x34] + bl sub_818D8F0 +_08190930: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81908CC + + thumb_func_start sub_8190938 +sub_8190938: @ 8190938 + push {lr} + adds r1, r0, 0 + movs r2, 0x34 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _0819094A + adds r0, r1, 0 + bl sub_80D30DC +_0819094A: + pop {r0} + bx r0 + thumb_func_end sub_8190938 + + thumb_func_start sub_8190950 +sub_8190950: @ 8190950 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08190962 + adds r0, r4, 0 + bl sub_80D30DC +_08190962: + ldrh r0, [r4, 0x22] + adds r1, r0, 0x4 + strh r1, [r4, 0x22] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _081909A4 + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + blt _0819098A + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_0819098A: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x28 + bne _081909C0 + ldr r0, =sub_8190938 + str r0, [r4, 0x1C] + b _081909C0 + .pool +_081909A4: + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xAF + ble _081909C0 + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + movs r2, 0x32 + ldrsh r1, [r4, r2] + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + adds r0, r4, 0 + bl sub_80D2EF8 +_081909C0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8190950 + + thumb_func_start sub_81909CC +sub_81909CC: @ 81909CC + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081909DE + adds r0, r4, 0 + bl sub_80D30DC +_081909DE: + ldrh r0, [r4, 0x22] + subs r1, r0, 0x4 + strh r1, [r4, 0x22] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08190A1C + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xB0 + bgt _08190A02 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_08190A02: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x28 + bne _08190A3C + ldr r0, =sub_8190938 + str r0, [r4, 0x1C] + b _08190A3C + .pool +_08190A1C: + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + bgt _08190A3C + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + movs r2, 0x32 + ldrsh r1, [r4, r2] + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + adds r0, r4, 0 + bl sub_80D2EF8 +_08190A3C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81909CC + + thumb_func_start sub_8190A48 +sub_8190A48: @ 8190A48 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08190A5A + adds r0, r4, 0 + bl sub_80D30DC +_08190A5A: + ldrh r0, [r4, 0x20] + adds r1, r0, 0x4 + strh r1, [r4, 0x20] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08190A9C + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + blt _08190A82 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_08190A82: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x40 + bne _08190AB8 + ldr r0, =sub_8190938 + str r0, [r4, 0x1C] + b _08190AB8 + .pool +_08190A9C: + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _08190AB8 + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + movs r2, 0x32 + ldrsh r1, [r4, r2] + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + adds r0, r4, 0 + bl sub_80D2EF8 +_08190AB8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8190A48 + + thumb_func_start sub_8190AC4 +sub_8190AC4: @ 8190AC4 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08190AD6 + adds r0, r4, 0 + bl sub_80D30DC +_08190AD6: + ldrh r0, [r4, 0x20] + subs r1, r0, 0x4 + strh r1, [r4, 0x20] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08190B14 + lsls r1, 16 + movs r0, 0x80 + lsls r0, 17 + cmp r1, r0 + bgt _08190AFC + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_08190AFC: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x40 + bne _08190B34 + ldr r0, =sub_8190938 + str r0, [r4, 0x1C] + b _08190B34 + .pool +_08190B14: + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + bgt _08190B34 + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + movs r2, 0x32 + ldrsh r1, [r4, r2] + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + adds r0, r4, 0 + bl sub_80D2EF8 +_08190B34: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8190AC4 + + thumb_func_start sub_8190B40 +sub_8190B40: @ 8190B40 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r3, r0, 0 + movs r0, 0x2E + ldrsh r6, [r3, r0] + ldr r2, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r2 + movs r7, 0x10 + ldrsh r1, [r4, r7] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0xA + ldrsh r0, [r0, r1] + ldr r1, =gUnknown_0860D080 + adds r0, r1 + ldrb r0, [r0] + mov r10, r0 + ldr r1, =gSaveBlock2Ptr + ldr r5, [r1] + ldr r7, =0x00000cb2 + adds r0, r5, r7 + ldrh r0, [r0] + mov r12, r0 + movs r7, 0xE + ldrsh r0, [r4, r7] + mov r9, r2 + mov r8, r1 + cmp r0, 0x1 + bne _08190C0C + movs r1, 0x30 + ldrsh r0, [r3, r1] + cmp r0, 0 + beq _08190BFC + mov r2, r10 + lsls r0, r2, 2 + adds r1, r5, r0 + ldr r7, =0x00000d25 + adds r1, r7 + ldrb r2, [r1] + lsls r1, r2, 29 + adds r4, r0, 0 + cmp r1, 0 + bge _08190BB6 + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldrb r1, [r0, 0x10] + subs r1, 0x1 + lsls r0, r2, 27 + lsrs r0, 30 + cmp r1, r0 + blt _08190C32 +_08190BB6: + mov r1, r8 + ldr r0, [r1] + adds r0, r4 + ldr r2, =0x00000d25 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _08190BD4 + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + subs r0, 0x1 + cmp r0, r12 + blt _08190C32 +_08190BD4: + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + add r0, r9 + movs r7, 0x8 + ldrsh r0, [r0, r7] + b _08190C4C + .pool +_08190BFC: + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0 + bne _08190C32 + b _08190C48 + .pool +_08190C0C: + movs r2, 0x30 + ldrsh r0, [r3, r2] + cmp r0, 0 + beq _08190C28 + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0x1 + bls _08190C32 + movs r7, 0x8 + ldrsh r0, [r4, r7] + b _08190C4C + .pool +_08190C28: + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0 + beq _08190C48 +_08190C32: + adds r2, r3, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + b _08190C5C + .pool +_08190C48: + movs r1, 0x8 + ldrsh r0, [r4, r1] +_08190C4C: + cmp r0, 0x2 + bne _08190C5C + adds r0, r3, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_08190C5C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8190B40 + + thumb_func_start sub_8190C6C +sub_8190C6C: @ 8190C6C + push {lr} + adds r3, r0, 0 + movs r0, 0x2E + ldrsh r1, [r3, r0] + ldr r2, =gTasks + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r1, r0, r2 + movs r2, 0xE + ldrsh r0, [r1, r2] + cmp r0, 0x1 + bne _08190C9C + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0 + bne _08190CA6 + b _08190CC0 + .pool +_08190C9C: + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0x1 + beq _08190CC0 +_08190CA6: + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0x2 + bne _08190CCE + adds r0, r3, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + b _08190CCE + .pool +_08190CC0: + adds r2, r3, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_08190CCE: + pop {r0} + bx r0 + thumb_func_end sub_8190C6C + + thumb_func_start sub_8190CD4 +sub_8190CD4: @ 8190CD4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r1, =gTasks + lsls r0, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r3, 0xE + ldrsh r2, [r0, r3] + mov r9, r2 + movs r4, 0x10 + ldrsh r7, [r0, r4] + movs r5, 0x8 + ldrsh r0, [r0, r5] + cmp r0, 0x8 + bls _08190D06 + bl _08192202 +_08190D06: + lsls r0, 2 + ldr r1, =_08190D18 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08190D18: + .4byte _08190D3C + .4byte _08190D7C + .4byte _08190DA8 + .4byte _08190E48 + .4byte _08191FF8 + .4byte _08192038 + .4byte _08192078 + .4byte _081920BC + .4byte _08192106 +_08190D3C: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _08190D50 + bl _08192202 +_08190D50: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade + ldr r1, =gTasks + mov r6, r8 + lsls r0, r6, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0x1 + strh r1, [r0, 0x8] + bl _08192202 + .pool +_08190D7C: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08190D8C + bl _08192202 +_08190D8C: + mov r1, r8 + lsls r0, r1, 2 + add r0, r8 + lsls r0, 3 + ldr r2, =gTasks + adds r0, r2 + movs r1, 0x2 + strh r1, [r0, 0x8] + bl _08192202 + .pool +_08190DA8: + mov r0, r8 + bl sub_819221C + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x8 + bgt _08190DBE + cmp r6, 0x1 + bge _08190DF0 + bl _08192202 +_08190DBE: + cmp r6, 0x9 + beq _08190DC6 + bl _08192202 +_08190DC6: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + ldr r1, =gTasks + mov r3, r8 + lsls r0, r3, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0x8 + strh r1, [r0, 0x8] + bl _08192202 + .pool +_08190DF0: + ldr r1, =gTasks + mov r4, r8 + lsls r2, r4, 2 + adds r0, r2, r4 + lsls r0, 3 + adds r0, r1 + strh r6, [r0, 0x12] + movs r5, 0xC + ldrsh r0, [r0, r5] + movs r1, 0 + mov r9, r2 + cmp r0, 0 + beq _08190E0C + movs r1, 0x9 +_08190E0C: + adds r6, r1, 0 + adds r0, r6, 0 + adds r0, 0x9 + cmp r6, r0 + bge _08190E32 + adds r5, r0, 0 +_08190E18: + lsls r4, r6, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0x2 + bl CopyWindowToVram + adds r0, r4, 0 + movs r1, 0 + bl FillWindowPixelBuffer + adds r6, 0x1 + cmp r6, r5 + blt _08190E18 +_08190E32: + ldr r0, =gTasks + mov r1, r9 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0x3 + strh r0, [r1, 0x8] + bl _08192202 + .pool +_08190E48: + mov r6, r8 + lsls r1, r6, 2 + adds r0, r1, r6 + lsls r0, 3 + ldr r2, =gTasks + adds r0, r2 + movs r3, 0x12 + ldrsh r6, [r0, r3] + subs r0, r6, 0x1 + mov r9, r1 + cmp r0, 0x7 + bls _08190E64 + bl _08192202 +_08190E64: + lsls r0, 2 + ldr r1, =_08190E78 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08190E78: + .4byte _08190E98 + .4byte _08191234 + .4byte _081915CC + .4byte _08191B08 + .4byte _08190E98 + .4byte _08191234 + .4byte _0819187C + .4byte _08191D68 +_08190E98: + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r4, =gTasks + adds r0, r4 + movs r5, 0xC + ldrsh r2, [r0, r5] + cmp r2, 0 + beq _08190ED4 + ldr r0, =gUnknown_02022E14 + movs r1, 0 + strh r1, [r0] + ldr r0, =gUnknown_02022E16 + strh r1, [r0] + ldr r0, =gUnknown_02022E18 + strh r1, [r0] + ldr r1, =gUnknown_02022E1A + movs r0, 0xA0 + strh r0, [r1] + b _08190EE6 + .pool +_08190ED4: + ldr r0, =gUnknown_02022E14 + strh r2, [r0] + ldr r1, =gUnknown_02022E16 + movs r0, 0xA0 + strh r0, [r1] + ldr r0, =gUnknown_02022E18 + strh r2, [r0] + ldr r0, =gUnknown_02022E1A + strh r2, [r0] +_08190EE6: + cmp r6, 0x1 + bne _08190F9C + ldr r5, =gUnknown_0203CD78 + ldr r0, [r5] + ldrb r1, [r0, 0x10] + cmp r1, 0 + bne _08190F50 + ldr r0, =gUnknown_02022E1C + strh r1, [r0] + ldr r1, =gUnknown_02022E1E + movs r6, 0xA0 + lsls r6, 1 + adds r0, r6, 0 + strh r0, [r1] + ldr r3, =gUnknown_0860D080 + ldr r2, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r2 + movs r4, 0xA + ldrsh r1, [r0, r4] + adds r1, r3 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r2 + ldrb r2, [r0, 0xC] + movs r0, 0x10 + orrs r0, r2 + ldrb r1, [r1] + bl sub_81924E0 + b _08191084 + .pool +_08190F50: + ldr r1, =gUnknown_02022E1C + movs r6, 0x80 + lsls r6, 1 + adds r0, r6, 0 + strh r0, [r1] + ldr r0, =gUnknown_02022E1E + movs r4, 0 + strh r4, [r0] + ldr r3, =gUnknown_0860D080 + ldr r2, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r2 + movs r6, 0xA + ldrsh r1, [r0, r6] + adds r1, r3 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r2 + ldrb r2, [r0, 0xC] + movs r0, 0x10 + orrs r0, r2 + ldrb r1, [r1] + bl sub_81924E0 + ldr r0, [r5] + strb r4, [r0, 0x10] + b _08191084 + .pool +_08190F9C: + ldr r6, =gUnknown_0203CD78 + ldr r1, [r6] + ldrb r5, [r1, 0x10] + cmp r5, 0 + bne _08190FF8 + ldr r4, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r4 + movs r2, 0xA + ldrsh r0, [r0, r2] + adds r2, r0, 0 + subs r2, 0x10 + lsls r0, r2, 24 + lsrs r0, 24 + adds r1, 0x11 + bl sub_8192F08 + ldr r0, =gUnknown_02022E1C + strh r5, [r0] + ldr r1, =gUnknown_02022E1E + movs r3, 0xA0 + lsls r3, 1 + adds r0, r3, 0 + strh r0, [r1] + ldr r2, [r6] + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r4 + ldrb r1, [r0, 0xC] + movs r0, 0x10 + orrs r0, r1 + ldrb r1, [r2, 0x11] + bl sub_81924E0 + b _08191084 + .pool +_08190FF8: + cmp r5, 0x2 + bne _0819104C + ldr r4, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r4 + movs r5, 0xA + ldrsh r0, [r0, r5] + adds r2, r0, 0 + subs r2, 0x10 + lsls r0, r2, 24 + lsrs r0, 24 + adds r1, 0x11 + bl sub_8192F08 + ldr r1, =gUnknown_02022E1C + movs r0, 0 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + movs r2, 0xA0 + lsls r2, 1 + adds r0, r2, 0 + strh r0, [r1] + ldr r2, [r6] + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r4 + ldrb r1, [r0, 0xC] + movs r0, 0x10 + orrs r0, r1 + ldrb r1, [r2, 0x12] + bl sub_81924E0 + b _08191084 + .pool +_0819104C: + ldr r1, =gUnknown_02022E1C + movs r3, 0x80 + lsls r3, 1 + adds r0, r3, 0 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + movs r0, 0xA0 + strh r0, [r1] + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + movs r4, 0xA + ldrsh r0, [r0, r4] + adds r2, r0, 0 + subs r2, 0x10 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0xC] + movs r0, 0x10 + orrs r0, r1 + lsls r1, r2, 24 + lsrs r1, 24 + bl sub_819314C +_08191084: + movs r6, 0 + ldr r5, =gUnknown_0203CD78 + mov r10, r5 + ldr r3, =gSprites + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r1, =gTasks + adds r5, r0, r1 + mov r12, r6 + adds r4, r3, 0 + adds r4, 0x1C + movs r7, 0x1 +_0819109E: + cmp r6, 0x1 + bgt _0819110C + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191150 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =sub_8190790 + str r1, [r0] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r5, 0xC] + eors r0, r7 + strh r0, [r1, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _08191150 + .pool +_0819110C: + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191150 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =sub_8190950 + str r1, [r0] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r5, 0xC] + eors r0, r7 + strh r0, [r1, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_08191150: + adds r6, 0x1 + cmp r6, 0x7 + ble _0819109E + movs r6, 0x8 + ldr r2, =gUnknown_0203CD78 + mov r12, r2 + ldr r3, =gSprites + ldr r1, =gTasks + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r5, r0, r1 + movs r4, 0 + adds r7, r3, 0 + adds r7, 0x1C +_0819116E: + cmp r6, 0x9 + bgt _081911D4 + mov r1, r12 + ldr r0, [r1] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191214 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, =sub_8190790 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _08191214 + .pool +_081911D4: + mov r2, r12 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191214 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, =sub_8190950 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_08191214: + adds r6, 0x1 + cmp r6, 0xF + ble _0819116E + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r3, =gTasks + adds r0, r3 + movs r2, 0 + movs r1, 0x4 + bl _08191FE8 + .pool +_08191234: + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r4, =gTasks + adds r0, r4 + movs r5, 0xC + ldrsh r2, [r0, r5] + cmp r2, 0 + beq _08191278 + ldr r0, =gUnknown_02022E14 + movs r1, 0 + strh r1, [r0] + ldr r0, =gUnknown_02022E16 + strh r1, [r0] + ldr r0, =gUnknown_02022E18 + strh r1, [r0] + ldr r1, =gUnknown_02022E1A + ldr r2, =0x0000ff60 + adds r0, r2, 0 + strh r0, [r1] + b _0819128C + .pool +_08191278: + ldr r0, =gUnknown_02022E14 + strh r2, [r0] + ldr r1, =gUnknown_02022E16 + ldr r3, =0x0000ff60 + adds r0, r3, 0 + strh r0, [r1] + ldr r0, =gUnknown_02022E18 + strh r2, [r0] + ldr r0, =gUnknown_02022E1A + strh r2, [r0] +_0819128C: + cmp r6, 0x2 + bne _0819133C + ldr r5, =gUnknown_0203CD78 + ldr r0, [r5] + ldrb r1, [r0, 0x10] + cmp r1, 0 + bne _081912F4 + ldr r0, =gUnknown_02022E1C + strh r1, [r0] + ldr r1, =gUnknown_02022E1E + movs r0, 0xA0 + strh r0, [r1] + ldr r3, =gUnknown_0860D080 + ldr r2, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r2 + movs r4, 0xA + ldrsh r1, [r0, r4] + adds r1, r3 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r2 + ldrb r2, [r0, 0xC] + movs r0, 0x4 + orrs r0, r2 + ldrb r1, [r1] + bl sub_81924E0 + b _0819141C + .pool +_081912F4: + ldr r0, =gUnknown_02022E1C + movs r4, 0 + strh r4, [r0] + ldr r0, =gUnknown_02022E1E + strh r4, [r0] + ldr r3, =gUnknown_0860D080 + ldr r2, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r2 + movs r6, 0xA + ldrsh r1, [r0, r6] + adds r1, r3 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r2 + ldrb r2, [r0, 0xC] + movs r0, 0x4 + orrs r0, r2 + ldrb r1, [r1] + bl sub_81924E0 + ldr r0, [r5] + strb r4, [r0, 0x10] + b _0819141C + .pool +_0819133C: + ldr r6, =gUnknown_0203CD78 + ldr r1, [r6] + ldrb r5, [r1, 0x10] + cmp r5, 0 + bne _08191394 + ldr r4, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r4 + movs r2, 0xA + ldrsh r0, [r0, r2] + adds r2, r0, 0 + subs r2, 0x10 + lsls r0, r2, 24 + lsrs r0, 24 + adds r1, 0x11 + bl sub_8192F08 + ldr r0, =gUnknown_02022E1C + strh r5, [r0] + ldr r1, =gUnknown_02022E1E + movs r0, 0xA0 + strh r0, [r1] + ldr r2, [r6] + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r4 + ldrb r1, [r0, 0xC] + movs r0, 0x4 + orrs r0, r1 + ldrb r1, [r2, 0x11] + bl sub_81924E0 + b _0819141C + .pool +_08191394: + cmp r5, 0x2 + bne _081913E4 + ldr r4, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r4 + movs r3, 0xA + ldrsh r0, [r0, r3] + adds r2, r0, 0 + subs r2, 0x10 + lsls r0, r2, 24 + lsrs r0, 24 + adds r1, 0x11 + bl sub_8192F08 + ldr r1, =gUnknown_02022E1C + movs r0, 0 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + movs r0, 0xA0 + strh r0, [r1] + ldr r2, [r6] + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r4 + ldrb r1, [r0, 0xC] + movs r0, 0x4 + orrs r0, r1 + ldrb r1, [r2, 0x12] + bl sub_81924E0 + b _0819141C + .pool +_081913E4: + ldr r1, =gUnknown_02022E1C + movs r4, 0x80 + lsls r4, 1 + adds r0, r4, 0 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + movs r0, 0 + strh r0, [r1] + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + movs r5, 0xA + ldrsh r0, [r0, r5] + adds r2, r0, 0 + subs r2, 0x10 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0xC] + movs r0, 0x4 + orrs r0, r1 + lsls r1, r2, 24 + lsrs r1, 24 + bl sub_819314C +_0819141C: + movs r6, 0 + ldr r0, =gUnknown_0203CD78 + mov r10, r0 + ldr r3, =gSprites + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r1, =gTasks + adds r5, r0, r1 + mov r12, r6 + adds r4, r3, 0 + adds r4, 0x1C + movs r7, 0x1 +_08191436: + cmp r6, 0x1 + bgt _081914A4 + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _081914E8 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =sub_81907F8 + str r1, [r0] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r5, 0xC] + eors r0, r7 + strh r0, [r1, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _081914E8 + .pool +_081914A4: + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _081914E8 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =sub_81909CC + str r1, [r0] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r5, 0xC] + eors r0, r7 + strh r0, [r1, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_081914E8: + adds r6, 0x1 + cmp r6, 0x7 + ble _08191436 + movs r6, 0x8 + ldr r2, =gUnknown_0203CD78 + mov r12, r2 + ldr r3, =gSprites + ldr r1, =gTasks + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r5, r0, r1 + movs r4, 0 + adds r7, r3, 0 + adds r7, 0x1C +_08191506: + cmp r6, 0x9 + bgt _0819156C + mov r1, r12 + ldr r0, [r1] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _081915AC + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, =sub_81907F8 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _081915AC + .pool +_0819156C: + mov r2, r12 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _081915AC + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, =sub_81909CC + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_081915AC: + adds r6, 0x1 + cmp r6, 0xF + ble _08191506 + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r3, =gTasks + adds r0, r3 + movs r2, 0 + movs r1, 0x5 + bl _08191FE8 + .pool +_081915CC: + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r4, =gTasks + adds r0, r4 + movs r5, 0xC + ldrsh r2, [r0, r5] + cmp r2, 0 + beq _0819160C + ldr r0, =gUnknown_02022E14 + movs r1, 0 + strh r1, [r0] + ldr r0, =gUnknown_02022E16 + strh r1, [r0] + ldr r2, =gUnknown_02022E18 + movs r6, 0x80 + lsls r6, 1 + adds r0, r6, 0 + strh r0, [r2] + ldr r0, =gUnknown_02022E1A + strh r1, [r0] + b _08191622 + .pool +_0819160C: + ldr r1, =gUnknown_02022E14 + movs r3, 0x80 + lsls r3, 1 + adds r0, r3, 0 + strh r0, [r1] + ldr r0, =gUnknown_02022E16 + strh r2, [r0] + ldr r0, =gUnknown_02022E18 + strh r2, [r0] + ldr r0, =gUnknown_02022E1A + strh r2, [r0] +_08191622: + ldr r0, =gUnknown_0203CD78 + ldr r4, [r0] + ldrb r0, [r4, 0x10] + cmp r0, 0 + bne _08191688 + ldr r1, =gUnknown_02022E1C + movs r4, 0x80 + lsls r4, 1 + adds r0, r4, 0 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + movs r0, 0xA0 + strh r0, [r1] + ldr r3, =gUnknown_0860D080 + ldr r2, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r2 + movs r5, 0xA + ldrsh r1, [r0, r5] + adds r1, r3 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r2 + ldrb r2, [r0, 0xC] + movs r0, 0x8 + orrs r0, r2 + ldrb r1, [r1] + bl sub_81924E0 + b _081916C6 + .pool +_08191688: + ldr r1, =gUnknown_02022E1C + movs r6, 0x80 + lsls r6, 1 + adds r0, r6, 0 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + movs r0, 0 + strh r0, [r1] + ldr r3, =gUnknown_0860D15C + ldr r2, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r2 + movs r5, 0xA + ldrsh r1, [r0, r5] + lsls r1, 2 + subs r1, 0x1 + ldrb r4, [r4, 0x10] + adds r1, r4 + adds r1, r3 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r2 + ldrb r2, [r0, 0xC] + movs r0, 0x8 + orrs r0, r2 + ldrb r1, [r1] + bl sub_819314C +_081916C6: + movs r6, 0 + ldr r0, =gUnknown_0203CD78 + mov r10, r0 + ldr r3, =gSprites + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r1, =gTasks + adds r5, r0, r1 + mov r12, r6 + adds r4, r3, 0 + adds r4, 0x1C + movs r7, 0x1 +_081916E0: + cmp r6, 0x1 + bgt _08191754 + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191798 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =sub_8190860 + str r1, [r0] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r5, 0xC] + eors r0, r7 + strh r0, [r1, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _08191798 + .pool +_08191754: + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191798 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =sub_8190A48 + str r1, [r0] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r5, 0xC] + eors r0, r7 + strh r0, [r1, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_08191798: + adds r6, 0x1 + cmp r6, 0x7 + ble _081916E0 + movs r6, 0x8 + ldr r2, =gUnknown_0203CD78 + mov r12, r2 + ldr r3, =gSprites + ldr r1, =gTasks + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r5, r0, r1 + movs r4, 0 + adds r7, r3, 0 + adds r7, 0x1C +_081917B6: + cmp r6, 0x9 + bgt _0819181C + mov r1, r12 + ldr r0, [r1] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _0819185C + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, =sub_8190860 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _0819185C + .pool +_0819181C: + mov r2, r12 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _0819185C + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, =sub_8190A48 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_0819185C: + adds r6, 0x1 + cmp r6, 0xF + ble _081917B6 + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r3, =gTasks + adds r0, r3 + movs r2, 0 + movs r1, 0x6 + b _08191FE8 + .pool +_0819187C: + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r4, =gTasks + adds r0, r4 + movs r5, 0xC + ldrsh r2, [r0, r5] + cmp r2, 0 + beq _081918BC + ldr r0, =gUnknown_02022E14 + movs r1, 0 + strh r1, [r0] + ldr r0, =gUnknown_02022E16 + strh r1, [r0] + ldr r2, =gUnknown_02022E18 + movs r6, 0x80 + lsls r6, 1 + adds r0, r6, 0 + strh r0, [r2] + ldr r0, =gUnknown_02022E1A + strh r1, [r0] + b _081918D2 + .pool +_081918BC: + ldr r1, =gUnknown_02022E14 + movs r3, 0x80 + lsls r3, 1 + adds r0, r3, 0 + strh r0, [r1] + ldr r0, =gUnknown_02022E16 + strh r2, [r0] + ldr r0, =gUnknown_02022E18 + strh r2, [r0] + ldr r0, =gUnknown_02022E1A + strh r2, [r0] +_081918D2: + ldr r0, =gUnknown_0203CD78 + ldr r2, [r0] + ldrb r0, [r2, 0x10] + cmp r0, 0 + bne _08191924 + ldr r1, =gUnknown_02022E1C + movs r4, 0x80 + lsls r4, 1 + adds r0, r4, 0 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + movs r0, 0xA0 + strh r0, [r1] + ldr r1, =gTasks + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0xC] + movs r0, 0x8 + orrs r0, r1 + ldrb r1, [r2, 0x11] + bl sub_81924E0 + b _08191958 + .pool +_08191924: + ldr r1, =gUnknown_02022E1C + movs r0, 0 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + movs r0, 0xA0 + strh r0, [r1] + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + movs r5, 0xA + ldrsh r0, [r0, r5] + adds r2, r0, 0 + subs r2, 0x10 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0xC] + movs r0, 0x8 + orrs r0, r1 + lsls r1, r2, 24 + lsrs r1, 24 + bl sub_819314C +_08191958: + movs r6, 0 + ldr r0, =gUnknown_0203CD78 + mov r10, r0 + ldr r3, =gSprites + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r1, =gTasks + adds r5, r0, r1 + mov r12, r6 + adds r4, r3, 0 + adds r4, 0x1C + movs r7, 0x1 +_08191972: + cmp r6, 0x1 + bgt _081919E0 + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191A24 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =sub_8190860 + str r1, [r0] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r5, 0xC] + eors r0, r7 + strh r0, [r1, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _08191A24 + .pool +_081919E0: + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191A24 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =sub_8190A48 + str r1, [r0] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r5, 0xC] + eors r0, r7 + strh r0, [r1, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_08191A24: + adds r6, 0x1 + cmp r6, 0x7 + ble _08191972 + movs r6, 0x8 + ldr r2, =gUnknown_0203CD78 + mov r12, r2 + ldr r3, =gSprites + ldr r1, =gTasks + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r5, r0, r1 + movs r4, 0 + adds r7, r3, 0 + adds r7, 0x1C +_08191A42: + cmp r6, 0x9 + bgt _08191AA8 + mov r1, r12 + ldr r0, [r1] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191AE8 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, =sub_8190860 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _08191AE8 + .pool +_08191AA8: + mov r2, r12 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191AE8 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, =sub_8190A48 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_08191AE8: + adds r6, 0x1 + cmp r6, 0xF + ble _08191A42 + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r3, =gTasks + adds r0, r3 + movs r2, 0 + movs r1, 0x6 + b _08191FE8 + .pool +_08191B08: + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r4, =gTasks + adds r0, r4 + movs r5, 0xC + ldrsh r2, [r0, r5] + cmp r2, 0 + beq _08191B48 + ldr r0, =gUnknown_02022E14 + movs r1, 0 + strh r1, [r0] + ldr r0, =gUnknown_02022E16 + strh r1, [r0] + ldr r2, =gUnknown_02022E18 + movs r6, 0xFF + lsls r6, 8 + adds r0, r6, 0 + strh r0, [r2] + ldr r0, =gUnknown_02022E1A + strh r1, [r0] + b _08191B5E + .pool +_08191B48: + ldr r1, =gUnknown_02022E14 + movs r3, 0xFF + lsls r3, 8 + adds r0, r3, 0 + strh r0, [r1] + ldr r0, =gUnknown_02022E16 + strh r2, [r0] + ldr r0, =gUnknown_02022E18 + strh r2, [r0] + ldr r0, =gUnknown_02022E1A + strh r2, [r0] +_08191B5E: + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0x1 + bne _08191B94 + ldr r1, =gUnknown_02022E1C + movs r0, 0 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + movs r0, 0xA0 + strh r0, [r1] + b _08191B9E + .pool +_08191B94: + ldr r0, =gUnknown_02022E1C + movs r1, 0 + strh r1, [r0] + ldr r0, =gUnknown_02022E1E + strh r1, [r0] +_08191B9E: + ldr r4, =gUnknown_0860D15C + ldr r5, =gUnknown_0203CD78 + ldr r3, [r5] + ldr r2, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r2 + movs r6, 0xA + ldrsh r1, [r0, r6] + lsls r1, 2 + subs r1, 0x1 + ldrb r3, [r3, 0x10] + adds r1, r3 + adds r1, r4 + mov r4, r9 + add r4, r8 + lsls r4, 3 + adds r4, r2 + ldrb r2, [r4, 0xC] + movs r0, 0x2 + orrs r0, r2 + ldrb r1, [r1] + bl sub_819314C + movs r6, 0 + ldr r7, =gSprites + mov r12, r6 + mov r10, r5 + adds r5, r7, 0 + adds r5, 0x1C +_08191BDC: + cmp r6, 0x1 + bgt _08191C50 + mov r1, r10 + ldr r0, [r1] + adds r3, r0, r6 + ldrb r0, [r3] + cmp r0, 0xFF + beq _08191C96 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =sub_81908CC + str r1, [r0] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r4, 0xC] + movs r2, 0x1 + eors r1, r2 + strh r1, [r0, 0x2E] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + mov r2, r12 + strh r2, [r0, 0x30] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r6, [r0, 0x32] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r1, [r0, 0x34] + b _08191C96 + .pool +_08191C50: + mov r3, r10 + ldr r0, [r3] + adds r3, r0, r6 + ldrb r0, [r3] + cmp r0, 0xFF + beq _08191C96 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =sub_8190AC4 + str r1, [r0] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r4, 0xC] + movs r2, 0x1 + eors r1, r2 + strh r1, [r0, 0x2E] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r6, [r0, 0x32] +_08191C96: + adds r6, 0x1 + cmp r6, 0x7 + ble _08191BDC + movs r6, 0x8 + ldr r2, =gUnknown_0203CD78 + mov r12, r2 + ldr r3, =gSprites + ldr r1, =gTasks + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r5, r0, r1 + movs r4, 0 + adds r7, r3, 0 + adds r7, 0x1C +_08191CB4: + cmp r6, 0x9 + bgt _08191D1C + mov r1, r12 + ldr r0, [r1] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191D5C + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, =sub_81908CC + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _08191D5C + .pool +_08191D1C: + mov r2, r12 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191D5C + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, =sub_8190AC4 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_08191D5C: + adds r6, 0x1 + cmp r6, 0xF + ble _08191CB4 + b _08191FDA + .pool +_08191D68: + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r4, =gTasks + adds r0, r4 + movs r5, 0xC + ldrsh r2, [r0, r5] + cmp r2, 0 + beq _08191DA8 + ldr r0, =gUnknown_02022E14 + movs r1, 0 + strh r1, [r0] + ldr r0, =gUnknown_02022E16 + strh r1, [r0] + ldr r2, =gUnknown_02022E18 + movs r6, 0xFF + lsls r6, 8 + adds r0, r6, 0 + strh r0, [r2] + ldr r0, =gUnknown_02022E1A + strh r1, [r0] + b _08191DBE + .pool +_08191DA8: + ldr r1, =gUnknown_02022E14 + movs r3, 0xFF + lsls r3, 8 + adds r0, r3, 0 + strh r0, [r1] + ldr r0, =gUnknown_02022E16 + strh r2, [r0] + ldr r0, =gUnknown_02022E18 + strh r2, [r0] + ldr r0, =gUnknown_02022E1A + strh r2, [r0] +_08191DBE: + ldr r0, =gUnknown_0203CD78 + ldr r2, [r0] + ldrb r0, [r2, 0x10] + cmp r0, 0x2 + bne _08191E10 + ldr r1, =gUnknown_02022E1C + movs r4, 0x80 + lsls r4, 1 + adds r0, r4, 0 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + movs r0, 0xA0 + strh r0, [r1] + ldr r1, =gTasks + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0xC] + movs r0, 0x2 + orrs r0, r1 + ldrb r1, [r2, 0x12] + bl sub_81924E0 + b _08191E44 + .pool +_08191E10: + ldr r1, =gUnknown_02022E1C + movs r0, 0 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + movs r0, 0xA0 + strh r0, [r1] + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + movs r5, 0xA + ldrsh r0, [r0, r5] + adds r2, r0, 0 + subs r2, 0x10 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0xC] + movs r0, 0x2 + orrs r0, r1 + lsls r1, r2, 24 + lsrs r1, 24 + bl sub_819314C +_08191E44: + movs r6, 0 + ldr r0, =gUnknown_0203CD78 + mov r10, r0 + ldr r3, =gSprites + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r1, =gTasks + adds r5, r0, r1 + mov r12, r6 + adds r4, r3, 0 + adds r4, 0x1C + movs r7, 0x1 +_08191E5E: + cmp r6, 0x1 + bgt _08191ECC + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191F10 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =sub_81908CC + str r1, [r0] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r5, 0xC] + eors r0, r7 + strh r0, [r1, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _08191F10 + .pool +_08191ECC: + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191F10 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =sub_8190AC4 + str r1, [r0] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r5, 0xC] + eors r0, r7 + strh r0, [r1, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + mov r1, r12 + strh r1, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_08191F10: + adds r6, 0x1 + cmp r6, 0x7 + ble _08191E5E + movs r6, 0x8 + ldr r2, =gUnknown_0203CD78 + mov r12, r2 + ldr r3, =gSprites + ldr r1, =gTasks + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r5, r0, r1 + movs r4, 0 + adds r7, r3, 0 + adds r7, 0x1C +_08191F2E: + cmp r6, 0x9 + bgt _08191F94 + mov r1, r12 + ldr r0, [r1] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191FD4 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, =sub_81908CC + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r1, [r0, 0x34] + b _08191FD4 + .pool +_08191F94: + mov r2, r12 + ldr r0, [r2] + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, 0xFF + beq _08191FD4 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, =sub_8190AC4 + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r5, 0xC] + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r4, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r6, [r0, 0x32] +_08191FD4: + adds r6, 0x1 + cmp r6, 0xF + ble _08191F2E +_08191FDA: + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r3, =gTasks + adds r0, r3 + movs r2, 0 + movs r1, 0x7 +_08191FE8: + strh r1, [r0, 0x8] + strh r2, [r0, 0x12] + b _08192202 + .pool +_08191FF8: + mov r4, r8 + lsls r0, r4, 2 + add r0, r8 + lsls r0, 3 + ldr r5, =gTasks + adds r1, r0, r5 + ldrh r0, [r1, 0x12] + adds r0, 0x1 + strh r0, [r1, 0x12] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x29 + beq _08192100 + ldr r1, =gUnknown_02022E16 + ldrh r0, [r1] + subs r0, 0x4 + strh r0, [r1] + ldr r1, =gUnknown_02022E1A + ldrh r0, [r1] + subs r0, 0x4 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + b _081920A4 + .pool +_08192038: + mov r6, r8 + lsls r0, r6, 2 + add r0, r8 + lsls r0, 3 + ldr r2, =gTasks + adds r1, r0, r2 + ldrh r0, [r1, 0x12] + adds r0, 0x1 + strh r0, [r1, 0x12] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x29 + beq _08192100 + ldr r1, =gUnknown_02022E16 + ldrh r0, [r1] + adds r0, 0x4 + strh r0, [r1] + ldr r1, =gUnknown_02022E1A + ldrh r0, [r1] + adds r0, 0x4 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + b _081920E8 + .pool +_08192078: + mov r3, r8 + lsls r0, r3, 2 + add r0, r8 + lsls r0, 3 + ldr r4, =gTasks + adds r1, r0, r4 + ldrh r0, [r1, 0x12] + adds r0, 0x1 + strh r0, [r1, 0x12] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x41 + beq _08192100 + ldr r1, =gUnknown_02022E14 + ldrh r0, [r1] + subs r0, 0x4 + strh r0, [r1] + ldr r1, =gUnknown_02022E18 + ldrh r0, [r1] + subs r0, 0x4 + strh r0, [r1] + ldr r1, =gUnknown_02022E1C +_081920A4: + ldrh r0, [r1] + subs r0, 0x4 + strh r0, [r1] + b _08192202 + .pool +_081920BC: + mov r5, r8 + lsls r0, r5, 2 + add r0, r8 + lsls r0, 3 + ldr r6, =gTasks + adds r1, r0, r6 + ldrh r0, [r1, 0x12] + adds r0, 0x1 + strh r0, [r1, 0x12] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x41 + beq _08192100 + ldr r1, =gUnknown_02022E14 + ldrh r0, [r1] + adds r0, 0x4 + strh r0, [r1] + ldr r1, =gUnknown_02022E18 + ldrh r0, [r1] + adds r0, 0x4 + strh r0, [r1] + ldr r1, =gUnknown_02022E1C +_081920E8: + ldrh r0, [r1] + adds r0, 0x4 + strh r0, [r1] + b _08192202 + .pool +_08192100: + movs r0, 0x2 + strh r0, [r1, 0x8] + b _08192202 +_08192106: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08192202 + movs r6, 0 + ldr r4, =gUnknown_0203CD78 +_08192116: + cmp r6, 0x1 + bgt _08192134 + ldr r0, [r4] + adds r1, r0, r6 + ldrb r0, [r1] + cmp r0, 0xFF + beq _0819214E + bl sub_818D8F0 + b _0819214E + .pool +_08192134: + ldr r0, [r4] + adds r1, r0, r6 + ldrb r0, [r1] + cmp r0, 0xFF + beq _0819214E + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + bl sub_80D2EF8 +_0819214E: + adds r6, 0x1 + cmp r6, 0x7 + ble _08192116 + movs r6, 0x8 + ldr r4, =gUnknown_0203CD78 +_08192158: + cmp r6, 0x9 + bgt _08192174 + ldr r0, [r4] + adds r1, r0, r6 + ldrb r0, [r1] + cmp r0, 0xFF + beq _0819218E + bl sub_818D8F0 + b _0819218E + .pool +_08192174: + ldr r0, [r4] + adds r1, r0, r6 + ldrb r0, [r1] + cmp r0, 0xFF + beq _0819218E + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + bl sub_80D2EF8 +_0819218E: + adds r6, 0x1 + cmp r6, 0xF + ble _08192158 + bl sub_80D2F9C + ldr r4, =gUnknown_0203CD78 + ldr r0, [r4] + bl Free + movs r5, 0 + str r5, [r4] + bl FreeAllWindowBuffers + mov r0, r9 + cmp r0, 0 + bne _081921C4 + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + bl SetMainCallback2 + b _081921FC + .pool +_081921C4: + ldr r0, =sub_8194220 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r6, r0, 24 + ldr r2, =gTasks + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r2 + strh r5, [r1, 0x8] + strh r5, [r1, 0xA] + movs r0, 0x3 + strh r0, [r1, 0xC] + mov r3, r8 + lsls r0, r3, 2 + add r0, r8 + lsls r0, 3 + adds r0, r2 + ldrh r0, [r0, 0x10] + strh r0, [r1, 0xE] + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r2 + ldrh r0, [r0, 0x14] + strh r0, [r1, 0x10] +_081921FC: + mov r0, r8 + bl DestroyTask +_08192202: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8190CD4 + + thumb_func_start sub_819221C +sub_819221C: @ 819221C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r7, 0 + ldr r2, =gTasks + lsls r0, 2 + add r0, r9 + lsls r0, 3 + adds r0, r2 + mov r12, r0 + movs r1, 0x10 + ldrsh r6, [r0, r1] + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r2 + movs r3, 0xA + ldrsh r5, [r0, r3] + ldr r0, =gUnknown_0860D080 + adds r0, r5, r0 + ldrb r0, [r0] + mov r10, r0 + ldr r3, =gSaveBlock2Ptr + ldr r0, [r3] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r0, [r0] + mov r8, r0 + ldr r1, =gMain + ldrh r4, [r1, 0x2E] + movs r0, 0x3 + ands r0, r4 + adds r2, r1, 0 + cmp r0, 0 + beq _0819226E + movs r7, 0x9 +_0819226E: + mov r3, r12 + movs r1, 0xE + ldrsh r0, [r3, r1] + cmp r0, 0 + bne _0819227A + b _081924CC +_0819227A: + cmp r0, 0x1 + beq _08192280 + b _081923B0 +_08192280: + movs r0, 0x40 + ands r0, r4 + cmp r0, 0 + beq _081922BA + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0 + bne _081922BA + cmp r5, 0 + bne _081922B4 + movs r5, 0xF + b _081922B6 + .pool +_081922B4: + subs r5, 0x1 +_081922B6: + movs r7, 0x1 + b _08192360 +_081922BA: + ldrh r1, [r2, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081922E2 + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0 + bne _081922E2 + cmp r5, 0xF + bne _081922DC + movs r5, 0 + b _081922DE + .pool +_081922DC: + adds r5, 0x1 +_081922DE: + movs r7, 0x2 + b _08192360 +_081922E2: + ldrh r1, [r2, 0x2E] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08192304 + ldr r0, =gUnknown_0203CD78 + ldr r1, [r0] + ldrb r0, [r1, 0x10] + cmp r0, 0 + beq _08192304 + subs r0, 0x1 + strb r0, [r1, 0x10] + movs r7, 0x3 + b _08192360 + .pool +_08192304: + ldrh r1, [r2, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08192360 + ldr r2, =gSaveBlock2Ptr + ldr r0, [r2] + mov r3, r10 + lsls r1, r3, 2 + adds r0, r1 + ldr r2, =0x00000d25 + adds r0, r2 + ldrb r3, [r0] + lsls r0, r3, 29 + mov r12, r1 + cmp r0, 0 + bge _0819233C + ldr r0, =gUnknown_0203CD78 + ldr r2, [r0] + ldrb r4, [r2, 0x10] + subs r1, r4, 0x1 + lsls r0, r3, 27 + lsrs r0, 30 + cmp r1, r0 + bge _0819233C + adds r0, r4, 0x1 + strb r0, [r2, 0x10] + movs r7, 0x4 +_0819233C: + ldr r3, =gSaveBlock2Ptr + ldr r0, [r3] + add r0, r12 + ldr r1, =0x00000d25 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _08192360 + ldr r0, =gUnknown_0203CD78 + ldr r3, [r0] + ldrb r1, [r3, 0x10] + subs r0, r1, 0x1 + cmp r0, r8 + bge _08192360 + adds r0, r1, 0x1 + strb r0, [r3, 0x10] + movs r7, 0x4 +_08192360: + cmp r7, 0x9 + beq _08192366 + b _081924A0 +_08192366: + ldr r0, =gUnknown_0203CD78 + ldr r3, [r0] + ldrb r0, [r3, 0x10] + cmp r0, 0 + beq _081923A0 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + ldr r2, =gTasks + adds r1, r2 + ldr r2, =gUnknown_0860D1A0 + lsrs r0, r5, 31 + adds r0, r5, r0 + asrs r0, 1 + lsls r0, 2 + subs r0, 0x1 + ldrb r3, [r3, 0x10] + adds r0, r3 + b _08192482 + .pool +_081923A0: + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r3, =gTasks + adds r0, r3 + b _0819249E + .pool +_081923B0: + movs r0, 0x40 + ands r0, r4 + cmp r0, 0 + beq _081923DE + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0x1 + bne _081923DE + cmp r5, 0x10 + bne _081923D8 + ldr r0, =gUnknown_0860D19C + add r0, r8 + ldrb r5, [r0] + b _081923DA + .pool +_081923D8: + subs r5, 0x1 +_081923DA: + movs r7, 0x5 + b _08192446 +_081923DE: + ldrh r1, [r2, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0819240E + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0x1 + bne _0819240E + ldr r0, =gUnknown_0860D19C + add r0, r8 + ldrb r0, [r0] + cmp r5, r0 + bne _08192408 + movs r5, 0x10 + b _0819240A + .pool +_08192408: + adds r5, 0x1 +_0819240A: + movs r7, 0x6 + b _08192446 +_0819240E: + ldrh r1, [r2, 0x2E] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0819242C + ldr r0, =gUnknown_0203CD78 + ldr r1, [r0] + ldrb r0, [r1, 0x10] + cmp r0, 0 + beq _0819242C + movs r7, 0x7 + subs r0, 0x1 + b _08192444 + .pool +_0819242C: + ldrh r1, [r2, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08192446 + ldr r0, =gUnknown_0203CD78 + ldr r1, [r0] + ldrb r0, [r1, 0x10] + cmp r0, 0x1 + bhi _08192446 + movs r7, 0x8 + adds r0, 0x1 +_08192444: + strb r0, [r1, 0x10] +_08192446: + cmp r7, 0x9 + bne _081924A0 + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldrb r1, [r0, 0x10] + cmp r1, 0 + bne _08192470 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + ldr r2, =gTasks + adds r1, r2 + ldr r2, =gUnknown_0860D1C0 + ldrb r0, [r0, 0x11] + b _08192482 + .pool +_08192470: + cmp r1, 0x2 + bne _08192494 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + ldr r3, =gTasks + adds r1, r3 + ldr r2, =gUnknown_0860D1C0 + ldrb r0, [r0, 0x12] +_08192482: + adds r0, r2 + ldrb r0, [r0] + strh r0, [r1, 0xA] + b _081924A0 + .pool +_08192494: + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =gTasks + adds r0, r1 +_0819249E: + strh r5, [r0, 0xA] +_081924A0: + cmp r7, 0 + beq _081924CC + cmp r7, 0x9 + beq _081924CC + movs r0, 0x5 + bl PlaySE + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + strh r5, [r0, 0xA] + mov r2, r9 + lsls r0, r2, 2 + add r0, r9 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0xC] + movs r2, 0x1 + eors r1, r2 + strh r1, [r0, 0xC] +_081924CC: + adds r0, r7, 0 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_819221C + + thumb_func_start sub_81924E0 +sub_81924E0: @ 81924E0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x58 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x1C] + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x20] + movs r5, 0 + movs r0, 0 + str r0, [sp, 0x28] + movs r1, 0 + str r1, [sp, 0x2C] + movs r2, 0 + str r2, [sp, 0x30] + movs r4, 0 + movs r0, 0x24 + bl AllocZeroed + mov r8, r0 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r3, [sp, 0x20] + lsls r0, r3, 2 + adds r0, r1, r0 + ldr r2, =0x00000d24 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + str r0, [sp, 0x24] + movs r0, 0x1 + ldr r3, [sp, 0x1C] + ands r0, r3 + cmp r0, 0 + beq _08192538 + movs r5, 0x8 + movs r4, 0x9 + str r4, [sp, 0x28] + movs r4, 0x2 +_08192538: + movs r0, 0x2 + ldr r2, [sp, 0x1C] + ands r0, r2 + cmp r0, 0 + beq _08192548 + movs r3, 0x80 + lsls r3, 1 + str r3, [sp, 0x2C] +_08192548: + movs r0, 0x4 + ldr r2, [sp, 0x1C] + ands r0, r2 + cmp r0, 0 + beq _08192556 + movs r3, 0xA0 + str r3, [sp, 0x30] +_08192556: + movs r0, 0x8 + ldr r2, [sp, 0x1C] + ands r0, r2 + cmp r0, 0 + beq _08192564 + ldr r3, =0xffffff00 + str r3, [sp, 0x2C] +_08192564: + movs r0, 0x10 + ldr r2, [sp, 0x1C] + ands r0, r2 + cmp r0, 0 + beq _08192574 + movs r3, 0xA0 + negs r3, r3 + str r3, [sp, 0x30] +_08192574: + ldr r0, =0x000003ff + ldr r2, [sp, 0x24] + cmp r2, r0 + bne _08192598 + ldrb r0, [r1, 0x8] + bl sub_806F000 + lsls r0, 16 + lsrs r0, 16 + b _081925B6 + .pool +_08192598: + ldr r0, =0x000003fe + ldr r3, [sp, 0x24] + cmp r3, r0 + bne _081925AC + bl sub_8195910 + b _081925B2 + .pool +_081925AC: + ldr r0, [sp, 0x24] + bl sub_8162AA0 +_081925B2: + lsls r0, 24 + lsrs r0, 24 +_081925B6: + ldr r2, [sp, 0x2C] + adds r2, 0x30 + ldr r3, [sp, 0x30] + adds r3, 0x40 + adds r1, r4, 0 + adds r1, 0xC + str r1, [sp] + ldr r1, =0x0000ffff + str r1, [sp, 0x4] + movs r1, 0x1 + bl sub_818D8AC + ldr r1, =gUnknown_0203CD78 + ldr r1, [r1] + adds r1, r5 + strb r0, [r1] + movs r0, 0x1E + ldr r4, [sp, 0x1C] + ands r0, r4 + cmp r0, 0 + beq _081925FC + ldr r2, =gSprites + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_081925FC: + movs r7, 0 + ldr r0, [sp, 0x20] + lsls r0, 1 + str r0, [sp, 0x3C] + adds r1, r5, 0x2 + ldr r2, [sp, 0x28] + lsls r2, 24 + str r2, [sp, 0x44] + ldr r3, [sp, 0x28] + adds r3, 0x4 + str r3, [sp, 0x40] + ldr r4, [sp, 0x20] + adds r0, r4 + ldr r6, =gUnknown_0203CD78 + ldr r2, =gSprites + mov r10, r2 + adds r4, r1, 0 + lsls r5, r0, 1 + movs r3, 0 + mov r9, r3 +_08192624: + ldr r0, =0x000003ff + ldr r1, [sp, 0x24] + cmp r1, r0 + bne _08192660 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000d64 + adds r0, r2 + adds r0, r5 + ldrh r0, [r0] + ldr r1, =gUnknown_0860D340 + adds r1, r7, r1 + ldrb r2, [r1] + ldr r3, [sp, 0x2C] + orrs r2, r3 + b _081926B0 + .pool +_08192660: + ldr r0, =0x000003fe + ldr r3, [sp, 0x24] + cmp r3, r0 + bne _08192690 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000d64 + adds r0, r1 + adds r0, r5 + ldrh r0, [r0] + ldr r1, =gUnknown_0860D340 + adds r1, r7, r1 + ldrb r2, [r1] + ldr r3, [sp, 0x2C] + orrs r2, r3 + b _081926B0 + .pool +_08192690: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r3, =0x00000d64 + adds r0, r3 + adds r0, r5 + ldrh r1, [r0] + ldr r0, =gUnknown_0203BC8C + ldr r0, [r0] + lsls r1, 4 + adds r1, r0 + ldrh r0, [r1] + ldr r1, =gUnknown_0860D340 + adds r1, r7, r1 + ldrb r2, [r1] + ldr r1, [sp, 0x2C] + orrs r2, r1 +_081926B0: + ldr r1, =gUnknown_0860D343 + adds r1, r7, r1 + ldrb r3, [r1] + ldr r1, [sp, 0x30] + adds r3, r1 + mov r1, r9 + str r1, [sp] + str r1, [sp, 0x4] + movs r1, 0x1 + str r1, [sp, 0x8] + ldr r1, =sub_8190938 + bl sub_80D2CC4 + ldr r1, [r6] + adds r1, r4 + strb r0, [r1] + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r10 + ldrb r1, [r0, 0x5] + movs r2, 0xD + negs r2, r2 + ands r1, r2 + strb r1, [r0, 0x5] + movs r0, 0x1E + ldr r3, [sp, 0x1C] + ands r0, r3 + cmp r0, 0 + beq _0819270A + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r10 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_0819270A: + adds r4, 0x1 + adds r5, 0x2 + adds r7, 0x1 + cmp r7, 0x2 + ble _08192624 + add r0, sp, 0xC + movs r2, 0 + movs r3, 0x2 + strb r3, [r0, 0x5] + strb r2, [r0, 0x6] + strb r2, [r0, 0x7] + adds r1, r0, 0 + adds r0, r2, 0 + strb r0, [r1, 0x8] + adds r0, r1, 0 + ldrb r0, [r0, 0x7] + strb r0, [r1, 0x9] + adds r0, r1, 0 + strb r3, [r0, 0xA] + strb r2, [r0, 0xB] + adds r3, r0, 0 + ldrb r2, [r3, 0xC] + movs r1, 0x10 + negs r1, r1 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3, 0xC] + adds r2, r3, 0 + movs r0, 0xE0 + strb r0, [r2, 0xC] + ldrb r0, [r2, 0xD] + ands r1, r0 + strb r1, [r2, 0xD] + adds r1, r2, 0 + movs r0, 0xD0 + strb r0, [r1, 0xD] + movs r7, 0 + ldr r0, =0x000003ff + ldr r4, [sp, 0x24] + cmp r4, r0 + bne _08192784 + ldr r0, =gTrainerClassNameIndices + adds r0, 0x3C + ldrb r5, [r0] + b _081927A2 + .pool +_08192784: + ldr r0, =0x000003fe + ldr r1, [sp, 0x24] + cmp r1, r0 + bne _08192798 + bl sub_8195924 + b _0819279E + .pool +_08192798: + ldr r0, [sp, 0x24] + bl sub_8162BD8 +_0819279E: + lsls r0, 24 + lsrs r5, r0, 24 +_081927A2: + ldr r2, =gTrainerClassNames + movs r0, 0xD + adds r1, r5, 0 + muls r1, r0 + adds r0, r7, r1 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0xFF + beq _081927CA + ldr r3, =gStringVar1 + adds r0, r1, r2 + adds r2, r7, r0 +_081927BA: + adds r0, r7, r3 + ldrb r1, [r2] + strb r1, [r0] + adds r2, 0x1 + adds r7, 0x1 + ldrb r0, [r2] + cmp r0, 0xFF + bne _081927BA +_081927CA: + ldr r5, =gStringVar1 + adds r1, r7, r5 + movs r0, 0 + strb r0, [r1] + adds r0, r7, 0x1 + adds r0, r5 + movs r1, 0xFF + strb r1, [r0] + ldr r0, =0x000003ff + ldr r2, [sp, 0x24] + cmp r2, r0 + bne _08192800 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + adds r0, r5, 0 + bl StringAppend + b _08192836 + .pool +_08192800: + ldr r0, =0x000003fe + ldr r3, [sp, 0x24] + cmp r3, r0 + bne _08192824 + ldr r4, =gStringVar2 + adds r0, r4, 0 + bl sub_8195938 + adds r0, r5, 0 + adds r1, r4, 0 + bl StringAppend + b _08192836 + .pool +_08192824: + ldr r4, =gStringVar2 + ldr r1, [sp, 0x24] + adds r0, r4, 0 + bl sub_8195898 + adds r0, r5, 0 + adds r1, r4, 0 + bl StringAppend +_08192836: + add r0, sp, 0xC + ldrb r0, [r0, 0x5] + ldr r4, =gStringVar1 + add r1, sp, 0xC + ldrb r3, [r1, 0xA] + adds r1, r4, 0 + movs r2, 0xD0 + bl GetStringCenterAlignXOffsetWithLetterSpacing + add r1, sp, 0xC + movs r5, 0 + strb r0, [r1, 0x8] + str r4, [sp, 0xC] + adds r0, r1, 0 + add r4, sp, 0x28 + ldrb r4, [r4] + strb r4, [r0, 0x4] + ldr r0, [sp, 0x44] + lsrs r4, r0, 24 + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram + add r0, sp, 0xC + movs r1, 0 + movs r2, 0 + bl AddTextPrinter + add r0, sp, 0xC + strb r5, [r0, 0xA] + movs r7, 0 + adds r6, r0, 0 + ldr r1, [sp, 0x3C] + ldr r2, [sp, 0x20] + adds r0, r1, r2 + lsls r0, 1 + mov r9, r0 + movs r3, 0xB + mov r10, r3 +_0819288A: + ldr r0, =gUnknown_0860D346 + adds r0, r7, r0 + ldrb r0, [r0] + strb r0, [r6, 0x9] + ldr r0, =0x000003ff + ldr r4, [sp, 0x24] + cmp r4, r0 + bne _081928C0 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + lsls r0, r7, 1 + add r0, r9 + ldr r2, =0x00000d64 + adds r1, r2 + b _081928FA + .pool +_081928C0: + ldr r0, =0x000003fe + ldr r4, [sp, 0x24] + cmp r4, r0 + bne _081928E4 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + lsls r0, r7, 1 + add r0, r9 + ldr r2, =0x00000d64 + adds r1, r2 + b _081928FA + .pool +_081928E4: + ldr r4, =gSaveBlock2Ptr + ldr r1, [r4] + lsls r0, r7, 1 + add r0, r9 + ldr r2, =0x00000d64 + adds r1, r2 + adds r1, r0 + ldrh r1, [r1] + ldr r0, =gUnknown_0203BC8C + ldr r0, [r0] + lsls r1, 4 +_081928FA: + adds r1, r0 + ldrh r0, [r1] + mov r3, r10 + muls r3, r0 + adds r0, r3, 0 + ldr r1, =gSpeciesNames + adds r0, r1 + str r0, [sp, 0xC] + adds r0, r7, 0x1 + ldr r4, [sp, 0x28] + adds r0, r4 + movs r1, 0 + strb r0, [r6, 0x4] + cmp r7, 0x1 + bne _08192930 + movs r0, 0x7 + strb r0, [r6, 0x8] + b _08192932 + .pool +_08192930: + strb r1, [r6, 0x8] +_08192932: + adds r5, r7, 0x1 + ldr r0, [sp, 0x28] + adds r4, r5, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram + add r0, sp, 0xC + movs r1, 0 + movs r2, 0 + bl AddTextPrinter + adds r7, r5, 0 + cmp r7, 0x2 + ble _0819288A + ldr r4, [sp, 0x40] + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram + ldr r0, =0x000003fe + ldr r1, [sp, 0x24] + cmp r1, r0 + bne _08192980 + ldr r0, =gUnknown_0860D1D0 + ldr r0, [r0, 0x40] + b _0819298A + .pool +_08192980: + ldr r0, =gUnknown_0860D1D0 + ldr r2, [sp, 0x20] + lsls r1, r2, 2 + adds r1, r0 + ldr r0, [r1] +_0819298A: + str r0, [sp, 0xC] + add r1, sp, 0xC + movs r2, 0 + movs r0, 0x1 + strb r0, [r1, 0x5] + adds r0, r1, 0 + add r3, sp, 0x40 + ldrb r3, [r3] + strb r3, [r0, 0x4] + strb r2, [r0, 0x8] + movs r1, 0x4 + strb r1, [r0, 0x7] + strb r1, [r0, 0x9] + movs r1, 0 + bl AddTextPrinter + movs r7, 0 + ldr r3, =gUnknown_0860B358 +_081929AE: + movs r5, 0 + adds r4, r7, 0x1 + str r4, [sp, 0x38] + lsls r0, r7, 1 + str r0, [sp, 0x34] + lsls r2, r7, 4 +_081929BA: + movs r6, 0 + lsls r1, r5, 1 + mov r10, r1 + mov r4, r8 + mov r9, r2 +_081929C4: + ldr r0, =0x000003fe + ldr r1, [sp, 0x24] + cmp r1, r0 + bne _08192A00 + lsls r0, r7, 24 + lsls r1, r5, 24 + lsrs r0, 24 + lsrs r1, 24 + str r2, [sp, 0x48] + str r3, [sp, 0x4C] + bl sub_81A5060 + lsls r0, 16 + lsrs r0, 12 + adds r0, r6, r0 + ldr r3, [sp, 0x4C] + adds r0, r3 + ldrh r1, [r4] + ldrb r0, [r0] + adds r1, r0 + strh r1, [r4] + ldr r2, [sp, 0x48] + b _08192A58 + .pool +_08192A00: + ldr r0, =0x000003ff + ldr r1, [sp, 0x24] + cmp r1, r0 + bne _08192A20 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000efc + adds r0, r1 + add r0, r9 + b _08192A48 + .pool +_08192A20: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + mov r12, r0 + ldr r0, [sp, 0x3C] + ldr r1, [sp, 0x20] + adds r0, r1 + str r0, [sp, 0x50] + lsls r0, 1 + ldr r1, [sp, 0x34] + adds r0, r1, r0 + ldr r1, =0x00000d64 + add r1, r12 + adds r1, r0 + ldrh r0, [r1] + ldr r1, =gUnknown_0203BC8C + ldr r1, [r1] + lsls r0, 4 + adds r0, r1 + adds r0, 0x2 + add r0, r10 +_08192A48: + ldrh r0, [r0] + lsls r0, 4 + adds r0, r6, r0 + adds r0, r3 + ldrh r1, [r4] + ldrb r0, [r0] + adds r1, r0 + strh r1, [r4] +_08192A58: + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0xF + ble _081929C4 + adds r2, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _081929BA + ldr r7, [sp, 0x38] + cmp r7, 0x2 + ble _081929AE + movs r7, 0 + ldr r2, =gUnknown_0860D214 + mov r9, r2 + ldr r3, =gUnknown_0860C988 + mov r10, r3 +_08192A78: + movs r4, 0 + movs r6, 0 + movs r5, 0 + mov r3, r8 + lsls r0, r7, 4 + mov r1, r10 + adds r2, r0, r1 +_08192A86: + ldrb r0, [r2] + cmp r0, 0 + beq _08192A9E + adds r4, 0x1 + movs r1, 0 + ldrsh r0, [r3, r1] + cmp r0, 0 + beq _08192A9E + ldrb r1, [r2] + cmp r0, r1 + blt _08192A9E + adds r6, 0x1 +_08192A9E: + adds r3, 0x2 + adds r2, 0x1 + adds r5, 0x1 + cmp r5, 0xF + ble _08192A86 + cmp r4, r6 + beq _08192AB2 + adds r7, 0x1 + cmp r7, 0x1E + bls _08192A78 +_08192AB2: + lsls r0, r7, 2 + add r0, r9 + ldr r0, [r0] + str r0, [sp, 0xC] + add r0, sp, 0xC + movs r1, 0x14 + strb r1, [r0, 0x7] + strb r1, [r0, 0x9] + movs r1, 0 + movs r2, 0 + bl AddTextPrinter + movs r1, 0 + mov r0, r8 + adds r0, 0x22 +_08192AD0: + strh r1, [r0] + subs r0, 0x2 + cmp r0, r8 + bge _08192AD0 + ldr r2, [sp, 0x24] + ldr r3, =0xfffffc02 + adds r0, r2, r3 + cmp r0, 0x1 + bls _08192AE4 + b _08192C24 +_08192AE4: + movs r7, 0 + movs r4, 0 + mov r9, r4 +_08192AEA: + movs r5, 0 + mov r4, r8 + mov r6, r9 +_08192AF0: + ldr r0, =0x000003fe + ldr r1, [sp, 0x24] + cmp r1, r0 + bne _08192B24 + lsls r1, r5, 24 + lsrs r1, 24 + lsrs r0, r6, 24 + bl sub_81A50F0 + lsls r0, 24 + lsrs r0, 24 + b _08192B34 + .pool +_08192B24: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r7, 4 + adds r1, r5, r1 + ldr r2, =0x00000f04 + adds r0, r2 + adds r0, r1 + ldrb r0, [r0] +_08192B34: + strh r0, [r4] + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x5 + ble _08192AF0 + mov r3, r8 + ldrh r0, [r3] + ldrh r4, [r3, 0xC] + adds r0, r4 + strh r0, [r3, 0xC] + movs r5, 0 + mov r4, r8 +_08192B4C: + ldr r0, =0x000003fe + ldr r1, [sp, 0x24] + cmp r1, r0 + bne _08192B70 + mov r2, r9 + lsrs r0, r2, 24 + bl sub_81A50B0 + lsls r0, 24 + lsrs r2, r0, 24 + b _08192B7E + .pool +_08192B70: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r7, 4 + adds r0, r1 + ldr r3, =0x00000f0a + adds r0, r3 + ldrb r2, [r0] +_08192B7E: + ldr r1, =gNatureStatTable + lsls r0, r2, 2 + adds r0, r2 + adds r0, r5, r0 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + ble _08192BB4 + movs r0, 0x2 + ldrsh r1, [r4, r0] + movs r0, 0x6E + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + ldrh r1, [r4, 0xE] + adds r1, r0 + strh r1, [r4, 0xE] + b _08192BDC + .pool +_08192BB4: + cmp r0, 0 + bge _08192BD4 + movs r2, 0x2 + ldrsh r1, [r4, r2] + movs r0, 0x5A + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + ldrh r1, [r4, 0xE] + adds r1, r0 + strh r1, [r4, 0xE] + ldrh r0, [r4, 0x1A] + adds r0, 0x1 + strh r0, [r4, 0x1A] + b _08192BDC +_08192BD4: + ldrh r0, [r4, 0x2] + ldrh r3, [r4, 0xE] + adds r0, r3 + strh r0, [r4, 0xE] +_08192BDC: + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x4 + ble _08192B4C + movs r4, 0x80 + lsls r4, 17 + add r9, r4 + adds r7, 0x1 + cmp r7, 0x2 + bgt _08192BF2 + b _08192AEA +_08192BF2: + movs r5, 0 + mov r1, r8 + movs r7, 0x5 +_08192BF8: + movs r2, 0xC + ldrsh r0, [r1, r2] + adds r5, r0 + adds r1, 0x2 + subs r7, 0x1 + cmp r7, 0 + bge _08192BF8 + movs r6, 0x64 + mov r4, r8 + movs r7, 0x5 +_08192C0C: + movs r3, 0xC + ldrsh r0, [r4, r3] + muls r0, r6 + adds r1, r5, 0 + bl __divsi3 + strh r0, [r4] + adds r4, 0x2 + subs r7, 0x1 + cmp r7, 0 + bge _08192C0C + b _08192D70 +_08192C24: + ldr r4, =gUnknown_0203BC8C + mov r10, r4 + ldr r1, [sp, 0x3C] + ldr r2, [sp, 0x20] + adds r0, r1, r2 + lsls r0, 1 + mov r9, r0 + movs r7, 0x2 +_08192C34: + ldr r3, =gSaveBlock2Ptr + ldr r0, [r3] + ldr r4, =0x00000d64 + adds r0, r4 + add r0, r9 + ldrh r0, [r0] + mov r2, r10 + ldr r1, [r2] + lsls r0, 4 + adds r0, r1 + ldrb r2, [r0, 0xB] + movs r6, 0 + movs r4, 0 + movs r3, 0x1 + mov r1, r8 + movs r5, 0x5 +_08192C54: + strh r4, [r1] + adds r0, r2, 0 + ands r0, r3 + cmp r0, 0 + beq _08192C60 + adds r6, 0x1 +_08192C60: + asrs r2, 1 + adds r1, 0x2 + subs r5, 0x1 + cmp r5, 0 + bge _08192C54 + movs r0, 0xFF + lsls r0, 1 + adds r1, r6, 0 + bl __divsi3 + adds r6, r0, 0 + ldr r3, =gSaveBlock2Ptr + ldr r0, [r3] + ldr r4, =0x00000d64 + adds r0, r4 + add r0, r9 + ldrh r0, [r0] + mov r2, r10 + ldr r1, [r2] + lsls r0, 4 + adds r0, r1 + ldrb r2, [r0, 0xB] + movs r3, 0x1 + mov r1, r8 + movs r5, 0x5 +_08192C92: + adds r0, r2, 0 + ands r0, r3 + cmp r0, 0 + beq _08192C9C + strh r6, [r1] +_08192C9C: + asrs r2, 1 + adds r1, 0x2 + subs r5, 0x1 + cmp r5, 0 + bge _08192C92 + mov r3, r8 + ldrh r0, [r3] + ldrh r4, [r3, 0xC] + adds r0, r4 + strh r0, [r3, 0xC] + movs r5, 0 + mov r4, r8 +_08192CB4: + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r2, =0x00000d64 + adds r0, r2 + add r0, r9 + ldrh r0, [r0] + mov r3, r10 + ldr r1, [r3] + lsls r0, 4 + adds r0, r1 + ldrb r2, [r0, 0xC] + lsls r0, r2, 2 + adds r0, r2 + adds r0, r5, r0 + ldr r1, =gNatureStatTable + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + ble _08192D04 + movs r2, 0x2 + ldrsh r1, [r4, r2] + movs r0, 0x6E + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + ldrh r1, [r4, 0xE] + adds r1, r0 + strh r1, [r4, 0xE] + b _08192D2C + .pool +_08192D04: + cmp r0, 0 + bge _08192D24 + movs r3, 0x2 + ldrsh r1, [r4, r3] + movs r0, 0x5A + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + ldrh r1, [r4, 0xE] + adds r1, r0 + strh r1, [r4, 0xE] + ldrh r0, [r4, 0x1A] + adds r0, 0x1 + strh r0, [r4, 0x1A] + b _08192D2C +_08192D24: + ldrh r0, [r4, 0x2] + ldrh r1, [r4, 0xE] + adds r0, r1 + strh r0, [r4, 0xE] +_08192D2C: + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x4 + ble _08192CB4 + movs r2, 0x2 + add r9, r2 + subs r7, 0x1 + cmp r7, 0 + blt _08192D40 + b _08192C34 +_08192D40: + movs r5, 0 + mov r1, r8 + movs r7, 0x5 +_08192D46: + movs r3, 0xC + ldrsh r0, [r1, r3] + adds r5, r0 + adds r1, 0x2 + subs r7, 0x1 + cmp r7, 0 + bge _08192D46 + movs r6, 0x64 + mov r4, r8 + movs r7, 0x5 +_08192D5A: + movs r1, 0xC + ldrsh r0, [r4, r1] + muls r0, r6 + adds r1, r5, 0 + bl __divsi3 + strh r0, [r4] + adds r4, 0x2 + subs r7, 0x1 + cmp r7, 0 + bge _08192D5A +_08192D70: + movs r7, 0 + movs r5, 0 + movs r6, 0 + mov r4, r8 + mov r10, r8 + mov r9, r8 +_08192D7C: + movs r2, 0 + ldrsh r1, [r4, r2] + cmp r1, 0x1D + ble _08192DDE + cmp r7, 0x2 + bne _08192DD4 + mov r3, r8 + movs r0, 0xC + ldrsh r3, [r3, r0] + mov r12, r3 + cmp r12, r1 + bge _08192DC6 + mov r2, r8 + ldrh r2, [r2, 0xE] + add r3, sp, 0x54 + strh r2, [r3] + mov r2, r8 + movs r3, 0xE + ldrsh r0, [r2, r3] + cmp r0, r1 + bge _08192DBA + cmp r12, r0 + bge _08192DB4 + add r0, sp, 0x54 + ldrh r0, [r0] + strh r0, [r2, 0xC] + strh r6, [r2, 0xE] + b _08192DDE +_08192DB4: + mov r1, r8 + strh r6, [r1, 0xE] + b _08192DDE +_08192DBA: + add r2, sp, 0x54 + ldrh r3, [r2] + mov r2, r8 + strh r3, [r2, 0xC] + strh r6, [r2, 0xE] + b _08192DDE +_08192DC6: + mov r3, r8 + movs r2, 0xE + ldrsh r0, [r3, r2] + cmp r0, r1 + bge _08192DDE + strh r6, [r3, 0xE] + b _08192DDE +_08192DD4: + mov r3, r9 + strh r6, [r3, 0xC] + movs r0, 0x2 + add r9, r0 + adds r7, 0x1 +_08192DDE: + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08192E64 + cmp r5, 0x2 + bne _08192E5A + movs r2, 0x18 + ldrsh r0, [r4, r2] + cmp r0, 0x1 + bgt _08192E18 + cmp r0, 0x1 + bne _08192E64 + mov r3, r8 + movs r1, 0x10 + ldrsh r0, [r3, r1] + lsls r0, 1 + add r0, r8 + movs r2, 0x18 + ldrsh r0, [r0, r2] + cmp r0, 0 + bne _08192E22 + movs r1, 0x12 + ldrsh r0, [r3, r1] + lsls r0, 1 + add r0, r8 + movs r2, 0x18 + ldrsh r0, [r0, r2] + cmp r0, 0 + bne _08192E22 +_08192E18: + mov r3, r8 + ldrh r0, [r3, 0x12] + strh r0, [r3, 0x10] + strh r6, [r3, 0x12] + b _08192E64 +_08192E22: + movs r1, 0x18 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _08192E64 + mov r2, r8 + movs r3, 0x10 + ldrsh r0, [r2, r3] + lsls r0, 1 + add r0, r8 + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08192E44 + ldrh r0, [r2, 0x12] + strh r0, [r2, 0x10] + strh r6, [r2, 0x12] + b _08192E64 +_08192E44: + mov r2, r8 + movs r3, 0x12 + ldrsh r0, [r2, r3] + lsls r0, 1 + add r0, r8 + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08192E64 + strh r6, [r2, 0x12] + b _08192E64 +_08192E5A: + mov r2, r10 + strh r6, [r2, 0x10] + movs r3, 0x2 + add r10, r3 + adds r5, 0x1 +_08192E64: + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x5 + ble _08192D7C + cmp r7, 0x2 + bne _08192E8C + ldr r0, =gUnknown_0860D349 + mov r4, r8 + movs r1, 0xC + ldrsh r2, [r4, r1] + adds r0, r2, r0 + movs r3, 0xE + ldrsh r1, [r4, r3] + subs r1, 0x1 + subs r1, r2 + ldrb r0, [r0] + adds r7, r1, r0 + b _08192ED2 + .pool +_08192E8C: + cmp r7, 0x1 + bne _08192E9C + mov r4, r8 + movs r1, 0xC + ldrsh r0, [r4, r1] + adds r7, r0, 0 + adds r7, 0xF + b _08192ED2 +_08192E9C: + cmp r5, 0x2 + bne _08192EC0 + ldr r0, =gUnknown_0860D349 + mov r3, r8 + movs r4, 0x10 + ldrsh r2, [r3, r4] + adds r0, r2, r0 + movs r4, 0x12 + ldrsh r1, [r3, r4] + subs r1, 0x1 + subs r1, r2 + ldrb r0, [r0] + adds r1, r0 + adds r7, r1, 0 + adds r7, 0x15 + b _08192ED2 + .pool +_08192EC0: + cmp r5, 0x1 + bne _08192ED0 + mov r1, r8 + movs r2, 0x10 + ldrsh r0, [r1, r2] + adds r7, r0, 0 + adds r7, 0x24 + b _08192ED2 +_08192ED0: + movs r7, 0x2A +_08192ED2: + lsls r0, r7, 2 + ldr r3, =gUnknown_0860D294 + adds r0, r3 + ldr r0, [r0] + str r0, [sp, 0xC] + add r0, sp, 0xC + movs r1, 0x24 + strb r1, [r0, 0x7] + strb r1, [r0, 0x9] + movs r1, 0 + movs r2, 0 + bl AddTextPrinter + mov r0, r8 + bl Free + add sp, 0x58 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81924E0 + + thumb_func_start sub_8192F08 +sub_8192F08: @ 8192F08 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + str r1, [sp] + lsls r0, 24 + lsrs r7, r0, 24 + movs r0, 0 + str r0, [sp, 0x4] + mov r8, r0 + ldr r2, =gUnknown_0860D3C4 + lsls r0, r7, 1 + adds r0, r7 + adds r1, r0, r2 + ldrb r6, [r1] + adds r1, r2, 0x1 + adds r0, r1 + ldrb r0, [r0] + adds r0, r6, r0 + adds r3, r2, 0 + cmp r6, r0 + bge _08192FD4 + ldr r5, =gSaveBlock2Ptr + ldr r1, =0x000003ff + mov r10, r1 + ldr r2, =0x000003fe + mov r9, r2 +_08192F42: + ldr r0, =gUnknown_0860D3B4 + adds r0, r6, r0 + ldrb r4, [r0] + ldr r0, [r5] + lsls r1, r4, 2 + adds r0, r1 + ldr r2, =0x00000d25 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _08192FBE + ldr r0, [sp] + add r0, r8 + strb r4, [r0] + ldr r2, [r5] + adds r0, r2, r1 + ldr r1, =0x00000d24 + adds r0, r1 + ldrh r0, [r0] + lsls r1, r0, 22 + lsrs r0, r1, 22 + cmp r0, r10 + bne _08192F9C + ldr r0, =gStringVar1 + adds r1, r2, 0 + bl StringCopy + b _08192FB8 + .pool +_08192F9C: + lsrs r0, r1, 22 + cmp r0, r9 + bne _08192FB0 + ldr r0, =gStringVar1 + bl sub_8195938 + b _08192FB8 + .pool +_08192FB0: + lsrs r1, 22 + ldr r0, =gStringVar1 + bl sub_8195898 +_08192FB8: + movs r2, 0x1 + add r8, r2 + ldr r3, =gUnknown_0860D3C4 +_08192FBE: + adds r6, 0x1 + lsls r1, r7, 1 + adds r1, r7 + adds r0, r1, r3 + ldrb r2, [r0] + adds r0, r3, 0x1 + adds r1, r0 + ldrb r0, [r1] + adds r2, r0 + cmp r6, r2 + blt _08192F42 +_08192FD4: + mov r5, r8 + cmp r5, 0x2 + bne _08192FE8 + movs r0, 0 + b _0819313C + .pool +_08192FE8: + mov r12, r3 + lsls r3, r7, 1 + adds r0, r3, r7 + mov r2, r12 + adds r1, r0, r2 + ldrb r6, [r1] + mov r1, r12 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + adds r0, r6, r0 + str r3, [sp, 0x8] + cmp r6, r0 + blt _08193006 + b _08193126 +_08193006: + ldr r5, =gSaveBlock2Ptr + mov r10, r5 + ldr r0, =0x00000d25 + mov r9, r0 +_0819300E: + ldr r0, =gUnknown_0860D3B4 + adds r0, r6, r0 + ldrb r4, [r0] + mov r1, r10 + ldr r0, [r1] + lsls r2, r4, 2 + str r2, [sp, 0xC] + adds r0, r2 + add r0, r9 + ldrb r2, [r0] + lsls r0, r2, 29 + cmp r0, 0 + bge _08193100 + lsls r2, 27 + adds r1, r3, r7 + mov r0, r12 + adds r0, 0x2 + adds r1, r0 + lsrs r2, 30 + ldrb r1, [r1] + cmp r2, r1 + bcc _08193100 + ldr r0, [sp] + add r0, r8 + strb r4, [r0] + movs r5, 0x1 + add r8, r5 + mov r0, r10 + ldr r3, [r0] + ldr r5, [sp, 0xC] + adds r2, r3, r5 + adds r0, r2, 0 + add r0, r9 + ldrb r5, [r0] + mov r12, r5 + mov r0, r12 + lsls r0, 27 + lsrs r0, 30 + cmp r0, r1 + bne _081930BC + lsls r4, 1 + movs r1, 0xEC + lsls r1, 4 + adds r0, r3, r1 + adds r0, r4 + ldrh r1, [r0] + movs r0, 0xD + muls r1, r0 + ldr r0, =gMoveNames + adds r1, r0 + ldr r0, =gStringVar2 + bl StringCopy + mov r2, r10 + ldr r1, [r2] + ldr r5, [sp, 0xC] + adds r0, r1, r5 + add r0, r9 + ldrb r0, [r0] + lsls r2, r0, 24 + lsrs r0, r2, 29 + lsls r0, 1 + str r0, [sp, 0x4] + movs r0, 0xEC + lsls r0, 4 + adds r1, r0 + adds r1, r4 + ldrh r0, [r1] + cmp r0, 0 + bne _08193100 + lsrs r0, r2, 29 + cmp r0, 0 + bne _08193100 + movs r1, 0x4 + str r1, [sp, 0x4] + b _08193100 + .pool +_081930BC: + ldr r5, =0x00000d24 + adds r0, r2, r5 + ldrh r0, [r0] + lsls r1, r0, 22 + ldr r0, =0xffc00000 + cmp r1, r0 + bne _081930E0 + ldr r0, =gStringVar1 + adds r1, r3, 0 + bl StringCopy + b _08193100 + .pool +_081930E0: + ldr r0, =0xff800000 + cmp r1, r0 + bne _081930F8 + ldr r0, =gStringVar1 + bl sub_8195938 + b _08193100 + .pool +_081930F8: + lsrs r1, 22 + ldr r0, =gStringVar1 + bl sub_8195898 +_08193100: + mov r0, r8 + cmp r0, 0x2 + beq _08193126 + adds r6, 0x1 + ldr r1, =gUnknown_0860D3C4 + mov r12, r1 + ldr r3, [sp, 0x8] + adds r1, r3, r7 + mov r2, r12 + adds r0, r1, r2 + ldrb r2, [r0] + mov r0, r12 + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + adds r2, r0 + cmp r6, r2 + bge _08193126 + b _0819300E +_08193126: + cmp r7, 0xE + beq _08193138 + ldr r0, [sp, 0x4] + adds r0, 0x1 + b _0819313C + .pool +_08193138: + ldr r0, [sp, 0x4] + adds r0, 0x2 +_0819313C: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8192F08 + + thumb_func_start sub_819314C +sub_819314C: @ 819314C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x80 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x34] + lsls r1, 24 + lsrs r6, r1, 24 + movs r0, 0 + str r0, [sp, 0x3C] + movs r7, 0 + movs r1, 0 + str r1, [sp, 0x40] + movs r2, 0 + str r2, [sp, 0x44] + mov r9, r2 + movs r0, 0x1 + ldr r3, [sp, 0x34] + ands r0, r3 + cmp r0, 0 + beq _08193186 + movs r7, 0x8 + str r7, [sp, 0x3C] + movs r7, 0x9 + movs r0, 0x2 + mov r9, r0 +_08193186: + movs r0, 0x2 + ldr r1, [sp, 0x34] + ands r0, r1 + cmp r0, 0 + beq _08193196 + movs r2, 0x80 + lsls r2, 1 + str r2, [sp, 0x40] +_08193196: + movs r0, 0x4 + ldr r3, [sp, 0x34] + ands r0, r3 + cmp r0, 0 + beq _081931A4 + movs r0, 0xA0 + str r0, [sp, 0x44] +_081931A4: + movs r0, 0x8 + ldr r1, [sp, 0x34] + ands r0, r1 + cmp r0, 0 + beq _081931B2 + ldr r2, =0xffffff00 + str r2, [sp, 0x40] +_081931B2: + movs r0, 0x10 + ldr r3, [sp, 0x34] + ands r0, r3 + cmp r0, 0 + beq _081931C2 + movs r0, 0xA0 + negs r0, r0 + str r0, [sp, 0x44] +_081931C2: + ldr r4, =gUnknown_0203CD78 + ldr r1, [r4] + adds r1, 0x11 + adds r0, r6, 0 + bl sub_8192F08 + str r0, [sp, 0x38] + movs r5, 0 + mov r1, sp + adds r1, 0x1C + str r1, [sp, 0x48] + mov r2, sp + adds r2, 0x24 + str r2, [sp, 0x4C] + lsls r1, r6, 1 + mov r3, sp + adds r3, 0x2C + str r3, [sp, 0x50] + ldr r0, [sp, 0x40] + adds r0, 0x30 + mov r8, r0 + ldr r2, [sp, 0x44] + adds r2, 0x58 + str r2, [sp, 0x78] + movs r3, 0xC + add r3, r9 + mov r10, r3 + ldr r0, [sp, 0x40] + adds r0, 0xC0 + str r0, [sp, 0x7C] + mov r2, r9 + adds r2, 0xD + str r2, [sp, 0x74] + ldr r3, [sp, 0x3C] + adds r3, 0x1 + mov r9, r3 + ldr r0, [sp, 0x3C] + adds r0, 0x2 + str r0, [sp, 0x54] + ldr r2, [sp, 0x3C] + adds r2, 0x5 + str r2, [sp, 0x5C] + adds r3, r7, 0 + adds r3, 0x8 + str r3, [sp, 0x6C] + adds r0, r7, 0x6 + str r0, [sp, 0x64] + adds r2, r7, 0x7 + str r2, [sp, 0x68] + lsls r3, r6, 2 + str r3, [sp, 0x58] + adds r0, r7, 0x5 + str r0, [sp, 0x60] + ldr r0, [r4] + adds r0, 0x11 + mov r12, r0 + ldr r0, =gSaveBlock2Ptr + ldr r4, [r0] + ldr r0, =gUnknown_0860D3C6 + movs r3, 0 + adds r1, r6 + adds r1, r0 + ldrb r6, [r1] +_08193240: + ldr r1, [sp, 0x48] + adds r2, r3, r1 + mov r7, r12 + adds r0, r7, r5 + ldrb r0, [r0] + str r0, [r2] + ldr r7, [sp, 0x4C] + adds r1, r3, r7 + lsls r0, 2 + adds r0, r4, r0 + ldr r7, =0x00000d24 + adds r0, r7 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + str r0, [r1] + ldr r0, [r2] + lsls r0, 2 + adds r0, r4, r0 + ldr r1, =0x00000d25 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 27 + lsrs r0, 30 + cmp r0, r6 + bhi _0819329C + lsls r0, r1, 29 + cmp r0, 0 + bge _0819329C + ldr r2, [sp, 0x50] + adds r1, r3, r2 + movs r0, 0x1 + b _081932A2 + .pool +_0819329C: + ldr r7, [sp, 0x50] + adds r1, r3, r7 + movs r0, 0 +_081932A2: + str r0, [r1] + adds r3, 0x4 + adds r5, 0x1 + cmp r5, 0x1 + ble _08193240 + ldr r1, [sp, 0x24] + ldr r0, =0x000003ff + cmp r1, r0 + bne _081932D4 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldrb r0, [r0, 0x8] + bl sub_806F000 + lsls r0, 16 + lsrs r0, 16 + mov r2, r8 + ldr r3, [sp, 0x78] + mov r1, r10 + str r1, [sp] + b _081932F8 + .pool +_081932D4: + ldr r0, =0x000003fe + cmp r1, r0 + bne _081932E4 + bl sub_8195910 + b _081932EC + .pool +_081932E4: + lsls r0, r1, 16 + lsrs r0, 16 + bl sub_8162AA0 +_081932EC: + lsls r0, 24 + lsrs r0, 24 + mov r2, r8 + ldr r3, [sp, 0x78] + mov r7, r10 + str r7, [sp] +_081932F8: + ldr r1, =0x0000ffff + str r1, [sp, 0x4] + movs r1, 0x1 + bl sub_818D8AC + ldr r1, =gUnknown_0203CD78 + ldr r1, [r1] + ldr r2, [sp, 0x3C] + adds r1, r2 + strb r0, [r1] + movs r0, 0x1E + ldr r3, [sp, 0x34] + ands r0, r3 + cmp r0, 0 + beq _08193334 + ldr r2, =gSprites + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldr r7, [sp, 0x3C] + adds r0, r7 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_08193334: + ldr r0, [sp, 0x2C] + cmp r0, 0 + beq _0819335A + ldr r2, =gSprites + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + ldr r1, [sp, 0x3C] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r2, [r0, 0x5] + movs r1, 0xF + ands r1, r2 + movs r2, 0x30 + orrs r1, r2 + strb r1, [r0, 0x5] +_0819335A: + ldr r2, [sp, 0x4C] + ldr r1, [r2, 0x4] + ldr r0, =0x000003ff + cmp r1, r0 + bne _08193388 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldrb r0, [r0, 0x8] + bl sub_806F000 + lsls r0, 16 + lsrs r0, 16 + b _081933B0 + .pool +_08193388: + ldr r0, =0x000003fe + cmp r1, r0 + bne _081933A4 + bl sub_8195910 + lsls r0, 24 + lsrs r0, 24 + ldr r2, [sp, 0x7C] + ldr r3, [sp, 0x78] + ldr r1, [sp, 0x74] + str r1, [sp] + b _081933B8 + .pool +_081933A4: + lsls r0, r1, 16 + lsrs r0, 16 + bl sub_8162AA0 + lsls r0, 24 + lsrs r0, 24 +_081933B0: + ldr r2, [sp, 0x7C] + ldr r3, [sp, 0x78] + ldr r7, [sp, 0x74] + str r7, [sp] +_081933B8: + ldr r1, =0x0000ffff + str r1, [sp, 0x4] + movs r1, 0x1 + bl sub_818D8AC + ldr r1, =gUnknown_0203CD78 + ldr r1, [r1] + add r1, r9 + strb r0, [r1] + movs r0, 0x1E + ldr r1, [sp, 0x34] + ands r0, r1 + cmp r0, 0 + beq _081933F0 + ldr r2, =gSprites + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + add r0, r9 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_081933F0: + ldr r2, [sp, 0x50] + ldr r0, [r2, 0x4] + cmp r0, 0 + beq _08193416 + ldr r2, =gSprites + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + add r0, r9 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r2, [r0, 0x5] + movs r1, 0xF + ands r1, r2 + movs r2, 0x30 + orrs r1, r2 + strb r1, [r0, 0x5] +_08193416: + movs r5, 0 + ldr r3, [sp, 0x38] + lsls r3, 2 + str r3, [sp, 0x70] + mov r8, r5 + ldr r6, =gUnknown_0203CD78 + ldr r7, =gSprites + ldr r4, [sp, 0x54] + mov r9, r5 + movs r0, 0x1 + mov r10, r0 +_0819342C: + ldr r1, [sp, 0x24] + ldr r0, =0x000003ff + cmp r1, r0 + bne _08193464 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r1, [sp, 0x1C] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + add r0, r9 + ldr r1, =0x00000d64 + adds r2, r1 + adds r2, r0 + ldrh r0, [r2] + b _081934B0 + .pool +_08193464: + ldr r0, =0x000003fe + cmp r1, r0 + bne _08193490 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r1, [sp, 0x1C] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + add r0, r9 + ldr r1, =0x00000d64 + adds r2, r1 + adds r2, r0 + ldrh r0, [r2] + b _081934B0 + .pool +_08193490: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r1, [sp, 0x1C] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + add r0, r9 + ldr r1, =0x00000d64 + adds r2, r1 + adds r2, r0 + ldrh r1, [r2] + ldr r0, =gUnknown_0203BC8C + ldr r0, [r0] + lsls r1, 4 + adds r1, r0 + ldrh r0, [r1] +_081934B0: + ldr r1, =gUnknown_0860D3A8 + adds r1, r5, r1 + ldrb r2, [r1] + ldr r3, [sp, 0x40] + orrs r2, r3 + ldr r1, =gUnknown_0860D3AB + adds r1, r5, r1 + ldrb r3, [r1] + ldr r1, [sp, 0x44] + adds r3, r1 + mov r1, r8 + str r1, [sp] + str r1, [sp, 0x4] + mov r1, r10 + str r1, [sp, 0x8] + ldr r1, =sub_8190938 + bl sub_80D2CC4 + ldr r1, [r6] + adds r1, r4 + strb r0, [r1] + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrb r1, [r0, 0x5] + movs r3, 0xD + negs r3, r3 + adds r2, r3, 0 + ands r1, r2 + strb r1, [r0, 0x5] + movs r0, 0x1E + ldr r1, [sp, 0x34] + ands r0, r1 + cmp r0, 0 + beq _08193516 + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_08193516: + ldr r0, [sp, 0x2C] + cmp r0, 0 + beq _08193548 + ldr r0, [r6] + adds r0, r4 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r7 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + movs r2, 0x30 + orrs r0, r2 + strb r0, [r1, 0x5] + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + mov r2, r10 + strh r2, [r0, 0x34] +_08193548: + adds r4, 0x1 + movs r3, 0x2 + add r9, r3 + adds r5, 0x1 + cmp r5, 0x2 + bgt _08193556 + b _0819342C +_08193556: + movs r5, 0 + ldr r6, =gUnknown_0203CD78 + ldr r7, =gSprites + mov r8, r7 + ldr r4, [sp, 0x5C] + mov r9, r5 + movs r7, 0 +_08193564: + ldr r0, [sp, 0x4C] + ldr r1, [r0, 0x4] + ldr r0, =0x000003ff + cmp r1, r0 + bne _081935AC + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r3, [sp, 0x48] + ldr r1, [r3, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + add r0, r9 + ldr r1, =0x00000d64 + adds r2, r1 + adds r2, r0 + ldrh r0, [r2] + b _081935FA + .pool +_081935AC: + ldr r0, =0x000003fe + cmp r1, r0 + bne _081935D8 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r0, [sp, 0x48] + ldr r1, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + add r0, r9 + ldr r1, =0x00000d64 + adds r2, r1 + adds r2, r0 + ldrh r0, [r2] + b _081935FA + .pool +_081935D8: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r0, [sp, 0x48] + ldr r1, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + add r0, r9 + ldr r1, =0x00000d64 + adds r2, r1 + adds r2, r0 + ldrh r1, [r2] + ldr r0, =gUnknown_0203BC8C + ldr r0, [r0] + lsls r1, 4 + adds r1, r0 + ldrh r0, [r1] +_081935FA: + ldr r1, =gUnknown_0860D3AE + adds r1, r5, r1 + ldrb r2, [r1] + ldr r3, [sp, 0x40] + orrs r2, r3 + ldr r1, =gUnknown_0860D3B1 + adds r1, r5, r1 + ldrb r3, [r1] + ldr r1, [sp, 0x44] + adds r3, r1 + str r7, [sp] + str r7, [sp, 0x4] + movs r1, 0x1 + str r1, [sp, 0x8] + ldr r1, =sub_8190938 + bl sub_80D2CC4 + ldr r1, [r6] + adds r1, r4 + strb r0, [r1] + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + ldrb r1, [r0, 0x5] + movs r3, 0xD + negs r3, r3 + adds r2, r3, 0 + ands r1, r2 + strb r1, [r0, 0x5] + movs r0, 0x1E + ldr r1, [sp, 0x34] + ands r0, r1 + cmp r0, 0 + beq _0819365E + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_0819365E: + ldr r2, [sp, 0x50] + ldr r0, [r2, 0x4] + cmp r0, 0 + beq _08193692 + ldr r0, [r6] + adds r0, r4 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r8 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + movs r2, 0x30 + orrs r0, r2 + strb r0, [r1, 0x5] + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + movs r1, 0x1 + strh r1, [r0, 0x34] +_08193692: + adds r4, 0x1 + movs r3, 0x2 + add r9, r3 + adds r5, 0x1 + cmp r5, 0x2 + bgt _081936A0 + b _08193564 +_081936A0: + add r0, sp, 0xC + movs r5, 0 + strb r5, [r0, 0x6] + adds r1, r0, 0 + movs r0, 0x2 + strb r0, [r1, 0x7] + adds r0, r1, 0 + ldrb r0, [r0, 0x6] + strb r0, [r1, 0x8] + adds r0, r1, 0 + ldrb r0, [r0, 0x7] + strb r0, [r1, 0x9] + adds r0, r1, 0 + strb r5, [r0, 0xA] + strb r5, [r0, 0xB] + adds r3, r0, 0 + ldrb r2, [r3, 0xC] + movs r1, 0x10 + negs r1, r1 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3, 0xC] + adds r2, r3, 0 + movs r0, 0xE0 + strb r0, [r2, 0xC] + ldrb r0, [r2, 0xD] + ands r1, r0 + strb r1, [r2, 0xD] + adds r1, r2, 0 + movs r0, 0xD0 + strb r0, [r1, 0xD] + ldr r4, =gStringVar4 + ldr r0, =gUnknown_0860D38C + ldr r7, [sp, 0x70] + adds r0, r7, r0 + ldr r1, [r0] + adds r0, r4, 0 + bl StringExpandPlaceholders + str r4, [sp, 0xC] + add r0, sp, 0xC + add r1, sp, 0x6C + ldrb r1, [r1] + strb r1, [r0, 0x4] + adds r1, r0, 0 + movs r0, 0x1 + strb r0, [r1, 0x5] + ldr r4, [sp, 0x6C] + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram + add r0, sp, 0xC + strb r5, [r0, 0x8] + adds r1, r0, 0 + strb r5, [r0, 0x7] + strb r5, [r1, 0x9] + movs r1, 0 + movs r2, 0 + bl AddTextPrinter + ldr r1, [sp, 0x24] + ldr r0, =0x000003ff + cmp r1, r0 + bne _0819375C + ldr r0, =gStringVar1 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + bl StringCopy + b _0819377E + .pool +_0819375C: + ldr r0, =0x000003fe + cmp r1, r0 + bne _08193774 + ldr r0, =gStringVar1 + bl sub_8195938 + b _0819377E + .pool +_08193774: + ldr r0, =gStringVar1 + lsls r1, 16 + lsrs r1, 16 + bl sub_8195898 +_0819377E: + add r0, sp, 0xC + movs r4, 0x2 + strb r4, [r0, 0x5] + strb r4, [r0, 0xA] + ldr r5, =gStringVar1 + str r5, [sp, 0xC] + add r2, sp, 0x64 + ldrb r2, [r2] + strb r2, [r0, 0x4] + ldrb r0, [r0, 0x5] + ldr r1, [sp, 0xC] + add r2, sp, 0xC + ldrb r3, [r2, 0xA] + movs r2, 0x40 + bl GetStringCenterAlignXOffsetWithLetterSpacing + add r1, sp, 0xC + strb r0, [r1, 0x8] + adds r0, r1, 0 + strb r4, [r0, 0x7] + strb r4, [r1, 0x9] + ldr r4, [sp, 0x64] + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram + add r0, sp, 0xC + movs r1, 0 + movs r2, 0 + bl AddTextPrinter + ldr r3, [sp, 0x4C] + ldr r1, [r3, 0x4] + ldr r0, =0x000003ff + cmp r1, r0 + bne _081937E4 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + adds r0, r5, 0 + bl StringCopy + b _08193802 + .pool +_081937E4: + ldr r0, =0x000003fe + cmp r1, r0 + bne _081937F8 + adds r0, r5, 0 + bl sub_8195938 + b _08193802 + .pool +_081937F8: + lsls r1, 16 + lsrs r1, 16 + adds r0, r5, 0 + bl sub_8195898 +_08193802: + ldr r0, =gStringVar1 + str r0, [sp, 0xC] + add r0, sp, 0xC + movs r6, 0 + add r7, sp, 0x68 + ldrb r7, [r7] + strb r7, [r0, 0x4] + ldrb r0, [r0, 0x5] + ldr r1, [sp, 0xC] + add r2, sp, 0xC + ldrb r3, [r2, 0xA] + movs r2, 0x40 + bl GetStringCenterAlignXOffsetWithLetterSpacing + add r1, sp, 0xC + strb r0, [r1, 0x8] + adds r0, r1, 0 + movs r5, 0x2 + strb r5, [r0, 0x7] + strb r5, [r1, 0x9] + ldr r4, [sp, 0x68] + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram + add r0, sp, 0xC + movs r1, 0 + movs r2, 0 + bl AddTextPrinter + add r0, sp, 0xC + strb r6, [r0, 0xA] + ldr r0, =gUnknown_0860D350 + ldr r1, [sp, 0x58] + adds r0, r1, r0 + ldr r0, [r0] + str r0, [sp, 0xC] + add r0, sp, 0xC + add r2, sp, 0x60 + ldrb r2, [r2] + strb r2, [r0, 0x4] + ldrb r0, [r0, 0x5] + ldr r1, [sp, 0xC] + add r2, sp, 0xC + ldrb r3, [r2, 0xA] + movs r2, 0xA0 + bl GetStringCenterAlignXOffsetWithLetterSpacing + add r1, sp, 0xC + strb r0, [r1, 0x8] + adds r0, r1, 0 + strb r5, [r0, 0x7] + strb r5, [r1, 0x9] + ldr r4, [sp, 0x60] + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram + add r0, sp, 0xC + movs r1, 0 + movs r2, 0 + bl AddTextPrinter + add sp, 0x80 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819314C + + thumb_func_start sub_81938A4 +sub_81938A4: @ 81938A4 + push {lr} + ldr r0, =sub_8194220 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0 + strh r2, [r1, 0x8] + strh r2, [r1, 0xA] + movs r0, 0x2 + strh r0, [r1, 0xC] + strh r2, [r1, 0x10] + ldr r0, =sub_8194B54 + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81938A4 + + thumb_func_start sub_81938E0 +sub_81938E0: @ 81938E0 + push {r4,lr} + bl sub_8194D48 + ldr r4, =gSaveBlock2Ptr + ldr r2, [r4] + ldr r1, =0x00000d0a + adds r0, r2, r1 + ldrb r1, [r0] + subs r1, 0x1 + ldr r0, =0x00000ca9 + adds r2, r0 + movs r0, 0x3 + ands r1, r0 + ldrb r3, [r2] + movs r0, 0x4 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldr r0, [r4] + ldr r1, =0x00000cb2 + adds r0, r1 + movs r4, 0 + movs r1, 0x3 + strh r1, [r0] + ldr r0, =sub_8194220 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + strh r4, [r1, 0xA] + movs r0, 0x2 + strh r0, [r1, 0xC] + movs r0, 0x1 + strh r0, [r1, 0x10] + ldr r0, =sub_8194B54 + bl SetMainCallback2 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81938E0 + + thumb_func_start sub_819395C +sub_819395C: @ 819395C + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r2, 0xA + ldrsh r7, [r0, r2] + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r2, r1, 0 + cmp r0, 0x7 + bls _0819397E + b _08193BC2 +_0819397E: + lsls r0, 2 + ldr r1, =_08193990 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08193990: + .4byte _081939B0 + .4byte _08193A00 + .4byte _08193A20 + .4byte _08193AA8 + .4byte _08193BC2 + .4byte _08193B20 + .4byte _08193BC2 + .4byte _08193B84 +_081939B0: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _081939C2 + b _08193BC2 +_081939C2: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x1 + strh r1, [r0, 0x8] + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + movs r1, 0x1 + bl StartSpriteAnim + b _08193BC2 + .pool +_08193A00: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08193A0E + b _08193BC2 +_08193A0E: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r2 + movs r1, 0x2 + strh r1, [r0, 0x8] + b _08193BC2 + .pool +_08193A20: + adds r0, r5, 0 + bl sub_8193BDC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08193A30 + b _08193BC2 +_08193A30: + cmp r0, 0x1 + ble _08193A3C + cmp r0, 0x2 + beq _08193A60 + cmp r0, 0x3 + beq _08193A84 +_08193A3C: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x7 + strh r1, [r0, 0x8] + b _08193BC2 + .pool +_08193A60: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x3 + strh r1, [r0, 0x8] + b _08193BC2 + .pool +_08193A84: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x5 + strh r1, [r0, 0x8] + b _08193BC2 + .pool +_08193AA8: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + beq _08193ABA + b _08193BC2 +_08193ABA: + bl FreeAllWindowBuffers + bl remove_some_task + ldr r4, =gUnknown_0203CD7C + ldr r0, [r4] + bl Free + str r6, [r4] + ldr r0, =sub_8190400 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, =gTasks + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 3 + adds r1, r2 + movs r3, 0 + strh r6, [r1, 0x8] + ldr r0, =gUnknown_0860D080 + adds r0, r7, r0 + ldrb r0, [r0] + strh r0, [r1, 0xA] + movs r0, 0x1 + strh r0, [r1, 0xC] + strh r5, [r1, 0xE] + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r2 + movs r1, 0x4 + strh r1, [r0, 0x8] + ldr r0, =gUnknown_0203CD78 + ldr r0, [r0] + strb r3, [r0, 0x10] + b _08193BC2 + .pool +_08193B20: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + bne _08193BC2 + bl FreeAllWindowBuffers + bl remove_some_task + ldr r4, =gUnknown_0203CD7C + ldr r0, [r4] + bl Free + str r6, [r4] + ldr r0, =sub_8190400 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, =gTasks + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + adds r0, r2 + strh r6, [r0, 0x8] + adds r1, r7, 0 + subs r1, 0x10 + strh r1, [r0, 0xA] + movs r1, 0x2 + strh r1, [r0, 0xC] + strh r5, [r0, 0xE] + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r2 + movs r1, 0x6 + strh r1, [r0, 0x8] + b _08193BC2 + .pool +_08193B84: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + bne _08193BC2 + bl FreeAllWindowBuffers + bl remove_some_task + ldr r4, =gUnknown_0203CD7C + ldr r0, [r4] + bl Free + str r6, [r4] + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + bl SetMainCallback2 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldrb r0, [r0, 0x16] + bl DestroyTask + adds r0, r5, 0 + bl DestroyTask +_08193BC2: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819395C + + thumb_func_start sub_8193BDC +sub_8193BDC: @ 8193BDC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r7, r0, 24 + movs r0, 0x1 + mov r9, r0 + movs r1, 0x4 + mov r8, r1 + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + movs r1, 0xA + ldrsh r5, [r0, r1] + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r6, [r0] + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + adds r2, r1, 0 + adds r3, r0, 0 + cmp r2, 0x2 + beq _08193C20 + mov r0, r9 + ands r0, r1 + cmp r0, 0 + beq _08193C58 + cmp r5, 0x1F + bne _08193C3C +_08193C20: + movs r0, 0x5 + bl PlaySE + movs r0, 0 + mov r9, r0 + b _08193CDE + .pool +_08193C3C: + cmp r5, 0xF + bgt _08193C4C + movs r0, 0x5 + bl PlaySE + movs r1, 0x2 + mov r9, r1 + b _08193CDE +_08193C4C: + movs r0, 0x5 + bl PlaySE + movs r0, 0x3 + mov r9, r0 + b _08193CDE +_08193C58: + cmp r2, 0x40 + bne _08193C78 + ldr r0, =gUnknown_0860CBF1 + lsls r1, r5, 2 + adds r1, r5 + adds r1, r6 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0xFF + beq _08193C78 + movs r1, 0 + mov r8, r1 + b _08193CDE + .pool +_08193C78: + ldrh r0, [r3, 0x2E] + cmp r0, 0x80 + bne _08193C9C + ldr r0, =gUnknown_0860CBF1 + lsls r1, r5, 2 + adds r1, r5 + adds r1, r6 + lsls r1, 2 + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0xFF + beq _08193C9C + movs r0, 0x1 + b _08193CDC + .pool +_08193C9C: + ldrh r0, [r3, 0x2E] + cmp r0, 0x20 + bne _08193CC0 + ldr r0, =gUnknown_0860CBF1 + lsls r1, r5, 2 + adds r1, r5 + adds r1, r6 + lsls r1, 2 + adds r0, 0x2 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0xFF + beq _08193CC0 + movs r1, 0x2 + mov r8, r1 + b _08193CDE + .pool +_08193CC0: + ldrh r0, [r3, 0x2E] + cmp r0, 0x10 + bne _08193CDE + ldr r0, =gUnknown_0860CBF1 + lsls r1, r5, 2 + adds r1, r5 + adds r1, r6 + lsls r1, 2 + adds r0, 0x3 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0xFF + beq _08193CDE + movs r0, 0x3 +_08193CDC: + mov r8, r0 +_08193CDE: + mov r1, r8 + cmp r1, 0x4 + beq _08193D26 + movs r0, 0x5 + bl PlaySE + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + ldr r4, =gSprites + adds r0, r4 + movs r1, 0 + bl StartSpriteAnim + ldr r2, =gUnknown_0860CBF1 + lsls r1, r6, 2 + add r1, r8 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 2 + adds r1, r0 + adds r1, r2 + ldrb r5, [r1] + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r0, r4 + movs r1, 0x1 + bl StartSpriteAnim + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + strh r5, [r0, 0xA] +_08193D26: + mov r0, r9 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8193BDC + + thumb_func_start sub_8193D40 +sub_8193D40: @ 8193D40 + push {lr} + ldr r0, =sub_8194220 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0 + strh r2, [r1, 0x8] + movs r0, 0x1 + strh r0, [r1, 0xA] + movs r0, 0x2 + strh r0, [r1, 0xC] + strh r2, [r1, 0x10] + ldr r0, =sub_8194B54 + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8193D40 + + thumb_func_start sub_8193D7C +sub_8193D7C: @ 8193D7C + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r7, =gSpecialVar_0x8005 + ldrh r0, [r7] + cmp r0, 0x1 + bne _08193E10 + ldr r5, =gUnknown_02038BCA + ldrh r0, [r5] + bl sub_8195358 + ldr r4, =gSaveBlock2Ptr + ldr r2, [r4] + lsls r0, 2 + adds r2, r0 + ldr r6, =0x00000d25 + adds r2, r6 + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldrh r0, [r5] + bl sub_8195358 + ldr r1, [r4] + lsls r0, 2 + adds r0, r1, r0 + ldr r2, =0x00000cb2 + mov r8, r2 + add r1, r8 + adds r0, r6 + movs r3, 0x3 + ldrb r2, [r1] + ands r2, r3 + lsls r2, 3 + ldrb r3, [r0] + movs r1, 0x19 + negs r1, r1 + ands r1, r3 + orrs r1, r2 + strb r1, [r0] + ldrh r0, [r5] + bl sub_8195358 + ldr r2, [r4] + lsls r0, 1 + movs r3, 0xEC + lsls r3, 4 + adds r1, r2, r3 + adds r1, r0 + ldr r0, =gUnknown_03005D10 + ldrh r0, [r0, 0x22] + strh r0, [r1] + add r2, r8 + ldrh r0, [r2] + cmp r0, 0x2 + bhi _08193EAE + lsls r0, 24 + lsrs r0, 24 + bl sub_8195438 + b _08193EAE + .pool +_08193E10: + ldr r5, =0x000003ff + adds r0, r5, 0 + bl sub_8195358 + ldr r4, =gSaveBlock2Ptr + ldr r2, [r4] + lsls r0, 2 + adds r2, r0 + ldr r6, =0x00000d25 + adds r2, r6 + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + adds r0, r5, 0 + bl sub_8195358 + ldr r1, [r4] + lsls r0, 2 + adds r0, r1, r0 + ldr r2, =0x00000cb2 + adds r1, r2 + adds r0, r6 + movs r3, 0x3 + ldrb r2, [r1] + ands r2, r3 + lsls r2, 3 + ldrb r3, [r0] + movs r1, 0x19 + negs r1, r1 + ands r1, r3 + orrs r1, r2 + strb r1, [r0] + adds r0, r5, 0 + bl sub_8195358 + ldr r1, [r4] + lsls r0, 1 + movs r3, 0xEC + lsls r3, 4 + adds r1, r3 + adds r1, r0 + ldr r0, =gUnknown_03005D10 + ldrh r0, [r0, 0x24] + strh r0, [r1] + ldr r0, =gBattleOutcome + ldrb r0, [r0] + cmp r0, 0x9 + beq _08193E78 + ldrh r0, [r7] + cmp r0, 0x9 + bne _08193E92 +_08193E78: + adds r0, r5, 0 + bl sub_8195358 + ldr r2, [r4] + lsls r0, 2 + adds r2, r0 + adds r2, r6 + ldrb r1, [r2] + movs r0, 0x1F + ands r0, r1 + movs r1, 0x20 + orrs r0, r1 + strb r0, [r2] +_08193E92: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r4, [r0] + cmp r4, 0x3 + bgt _08193EAE +_08193EA0: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8195438 + adds r4, 0x1 + cmp r4, 0x3 + ble _08193EA0 +_08193EAE: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8193D7C + + thumb_func_start sub_8193ED0 +sub_8193ED0: @ 8193ED0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x84 + str r0, [sp, 0x48] + str r1, [sp, 0x4C] + lsls r4, r2, 24 + lsrs r4, 24 + movs r0, 0 + str r0, [sp, 0x54] + movs r1, 0 + str r1, [sp, 0x58] + bl sub_8165C40 + movs r2, 0 + str r2, [sp, 0x50] + add r3, sp, 0x30 + mov r10, r3 + ldr r5, [sp, 0x4C] + lsls r5, 1 + str r5, [sp, 0x70] + subs r4, 0x1 + str r4, [sp, 0x78] +_08193F02: + movs r0, 0 + mov r9, r0 + ldr r1, [sp, 0x50] + lsls r1, 2 + str r1, [sp, 0x74] + ldr r2, [sp, 0x48] + lsls r2, 2 + str r2, [sp, 0x6C] + ldr r3, [sp, 0x50] + adds r3, 0x1 + str r3, [sp, 0x60] +_08193F18: + ldr r4, [sp, 0x74] + add r4, r9 + lsls r0, r4, 2 + mov r5, sp + adds r1, r5, r0 + movs r0, 0 + str r0, [r1] + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r1, [sp, 0x6C] + adds r0, r3, r1 + ldr r2, =0x00000d24 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 22 + ldr r1, =0xff800000 + cmp r0, r1 + bne _08193F60 + ldr r3, [sp, 0x50] + lsls r0, r3, 24 + mov r5, r9 + lsls r1, r5, 24 + lsrs r1, 24 + lsrs r0, 24 + bl sub_81A5060 + lsls r1, r4, 1 + add r1, r10 + strh r0, [r1] + b _08193F8C + .pool +_08193F60: + lsls r2, r4, 1 + add r2, r10 + ldr r1, [sp, 0x48] + lsls r0, r1, 1 + adds r0, r1 + ldr r4, [sp, 0x50] + adds r0, r4 + lsls r0, 1 + ldr r5, =0x00000d64 + adds r1, r3, r5 + adds r1, r0 + ldrh r0, [r1] + ldr r1, =gUnknown_0203BC8C + ldr r1, [r1] + lsls r0, 4 + adds r0, r1 + mov r3, r9 + lsls r1, r3, 1 + adds r0, 0x2 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2] +_08193F8C: + ldr r0, =gBattleMoves + ldr r1, [sp, 0x74] + add r1, r9 + lsls r1, 1 + add r1, r10 + ldrh r2, [r1] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r6, [r1, 0x1] + cmp r6, 0 + bne _08193FB8 + movs r6, 0x28 + b _08193FD0 + .pool +_08193FB8: + cmp r6, 0x1 + bne _08193FC0 + movs r6, 0x3C + b _08193FD0 +_08193FC0: + adds r1, r2, 0 + cmp r1, 0x78 + beq _08193FCA + cmp r1, 0x99 + bne _08193FD0 +_08193FCA: + lsrs r0, r6, 31 + adds r0, r6, r0 + asrs r6, r0, 1 +_08193FD0: + movs r1, 0 + mov r4, r9 + adds r4, 0x1 + str r4, [sp, 0x64] + ldr r5, [sp, 0x70] + ldr r2, [sp, 0x4C] + adds r0, r5, r2 + lsls r0, 1 + str r0, [sp, 0x5C] +_08193FE2: + lsls r7, r1, 1 + adds r1, 0x1 + str r1, [sp, 0x68] + ldr r3, [sp, 0x5C] + adds r3, r7 + mov r8, r3 +_08193FEE: + bl Random + adds r4, r0, 0 + bl Random + lsls r4, 16 + lsrs r5, r4, 16 + lsls r0, 16 + orrs r5, r0 + ldr r2, =gSaveBlock2Ptr + ldr r0, [r2] + ldr r4, =0x00000d64 + adds r0, r4 + add r0, r8 + ldrh r4, [r0] + ldr r3, =gUnknown_0203BC8C + ldr r0, [r3] + lsls r4, 4 + adds r4, r0 + adds r0, r5, 0 + str r2, [sp, 0x7C] + str r3, [sp, 0x80] + bl GetNatureFromPersonality + ldrb r1, [r4, 0xC] + lsls r0, 24 + lsrs r0, 24 + ldr r2, [sp, 0x7C] + ldr r3, [sp, 0x80] + cmp r1, r0 + bne _08193FEE + ldr r0, [r2] + ldr r2, [sp, 0x5C] + adds r1, r7, r2 + ldr r4, =0x00000d64 + adds r0, r4 + adds r0, r1 + ldrh r0, [r0] + ldr r1, [r3] + lsls r0, 4 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x1 + ands r5, r0 + cmp r5, 0 + beq _08194068 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + ldr r5, =gBaseStats + adds r0, r5 + ldrb r2, [r0, 0x17] + b _08194074 + .pool +_08194068: + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + ldr r2, =gBaseStats + adds r0, r2 + ldrb r2, [r0, 0x16] +_08194074: + ldr r4, [sp, 0x74] + add r4, r9 + lsls r0, r4, 1 + add r0, r10 + ldrh r0, [r0] + bl ai_rate_move + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x6 + ands r0, r5 + cmp r0, 0x6 + bne _0819409C + lsls r0, r4, 2 + mov r3, sp + adds r1, r3, r0 + b _081940D8 + .pool +_0819409C: + movs r0, 0x29 + ands r0, r5 + cmp r0, 0 + bne _081940DE + movs r0, 0x2 + ands r0, r5 + cmp r0, 0 + beq _081940B6 + lsls r0, r4, 2 + mov r5, sp + adds r2, r5, r0 + lsls r1, r6, 1 + b _081940CA +_081940B6: + movs r0, 0x4 + ands r5, r0 + cmp r5, 0 + beq _081940D2 + lsls r0, r4, 2 + mov r1, sp + adds r2, r1, r0 + lsrs r1, r6, 31 + adds r1, r6, r1 + asrs r1, 1 +_081940CA: + ldr r0, [r2] + adds r0, r1 + str r0, [r2] + b _081940DE +_081940D2: + lsls r0, r4, 2 + mov r2, sp + adds r1, r2, r0 +_081940D8: + ldr r0, [r1] + adds r0, r6 + str r0, [r1] +_081940DE: + ldr r1, [sp, 0x68] + cmp r1, 0x2 + bgt _081940E6 + b _08193FE2 +_081940E6: + ldr r2, [sp, 0x74] + add r2, r9 + lsls r0, r2, 2 + add r0, sp + ldr r1, [r0] + ldr r3, [sp, 0x54] + cmp r3, r1 + bge _08194104 + lsls r0, r2, 16 + lsrs r0, 16 + str r0, [sp, 0x58] + lsls r0, r1, 16 + lsrs r0, 16 + str r0, [sp, 0x54] + b _08194122 +_08194104: + ldr r4, [sp, 0x54] + cmp r4, r1 + bne _08194122 + ldr r5, [sp, 0x58] + lsls r0, r5, 1 + add r0, r10 + lsls r1, r2, 1 + add r1, r10 + ldrh r0, [r0] + ldrh r1, [r1] + cmp r0, r1 + bcs _08194122 + lsls r0, r2, 16 + lsrs r0, 16 + str r0, [sp, 0x58] +_08194122: + ldr r0, [sp, 0x64] + mov r9, r0 + cmp r0, 0x3 + bgt _0819412C + b _08193F18 +_0819412C: + ldr r1, [sp, 0x60] + str r1, [sp, 0x50] + cmp r1, 0x2 + bgt _08194136 + b _08193F02 +_08194136: + ldr r2, [sp, 0x58] + mov r9, r2 + b _08194182 +_0819413C: + movs r3, 0 + mov r9, r3 + movs r1, 0 + mov r4, r10 + mov r3, r10 + mov r2, sp +_08194148: + ldr r0, [r2] + ldr r5, [sp, 0x54] + cmp r5, r0 + bge _0819415A + mov r9, r1 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x54] + b _08194170 +_0819415A: + ldr r5, [sp, 0x54] + cmp r5, r0 + bne _08194170 + mov r5, r9 + lsls r0, r5, 1 + adds r0, r4, r0 + ldrh r0, [r0] + ldrh r5, [r3] + cmp r0, r5 + bcs _08194170 + mov r9, r1 +_08194170: + adds r3, 0x2 + adds r2, 0x4 + adds r1, 0x1 + cmp r1, 0xB + ble _08194148 + ldr r0, [sp, 0x50] + ldr r1, [sp, 0x78] + cmp r0, r1 + beq _081941F4 +_08194182: + movs r2, 0 + str r2, [sp, 0x50] + mov r3, r9 + lsls r7, r3, 2 + ldr r4, [sp, 0x78] + cmp r2, r4 + bge _081941CA + lsls r0, r3, 1 + mov r5, r10 + adds r6, r5, r0 + ldr r0, [sp, 0x48] + lsls r5, r0, 24 +_0819419A: + ldr r0, =gSaveBlock2Ptr + ldr r4, [r0] + ldr r2, [sp, 0x50] + lsls r1, r2, 24 + lsrs r1, 24 + lsrs r0, r5, 24 + bl sub_81953E8 + lsls r0, 24 + lsrs r0, 23 + movs r3, 0xEC + lsls r3, 4 + adds r4, r3 + adds r4, r0 + ldrh r0, [r4] + ldrh r4, [r6] + cmp r0, r4 + beq _081941CA + ldr r0, [sp, 0x50] + adds r0, 0x1 + str r0, [sp, 0x50] + ldr r1, [sp, 0x78] + cmp r0, r1 + blt _0819419A +_081941CA: + ldr r2, [sp, 0x50] + ldr r3, [sp, 0x78] + cmp r2, r3 + beq _081941F4 + mov r4, sp + adds r1, r4, r7 + movs r0, 0 + str r0, [r1] + movs r5, 0 + str r5, [sp, 0x54] + mov r9, r5 + mov r2, sp + movs r1, 0xB +_081941E4: + ldm r2!, {r0} + add r9, r0 + subs r1, 0x1 + cmp r1, 0 + bge _081941E4 + mov r0, r9 + cmp r0, 0 + bne _0819413C +_081941F4: + mov r1, r9 + lsls r0, r1, 2 + add r0, sp + ldr r0, [r0] + cmp r0, 0 + bne _08194204 + ldr r2, [sp, 0x58] + mov r9, r2 +_08194204: + mov r3, r9 + lsls r0, r3, 1 + add r0, r10 + ldrh r0, [r0] + add sp, 0x84 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8193ED0 + + thumb_func_start sub_8194220 +sub_8194220: @ 8194220 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r1, =gTasks + lsls r0, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r2, 0xA + ldrsh r1, [r0, r2] + mov r10, r1 + movs r3, 0xC + ldrsh r4, [r0, r3] + movs r1, 0x8 + ldrsh r0, [r0, r1] + cmp r0, 0x5 + bls _08194250 + b _081948C2 +_08194250: + lsls r0, 2 + ldr r1, =_08194264 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08194264: + .4byte _0819427C + .4byte _0819431C + .4byte _0819438C + .4byte _0819447C + .4byte _081944FC + .4byte _081947C8 +_0819427C: + movs r0, 0 + bl SetHBlankCallback + movs r0, 0 + bl SetVBlankCallback + movs r0, 0x3 + bl EnableInterrupts + movs r4, 0 + str r4, [sp, 0x14] + add r0, sp, 0x14 + movs r1, 0xC0 + lsls r1, 19 + ldr r2, =0x05006000 + bl CpuSet + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_0860CE74 + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + ldr r0, =gUnknown_0860CE94 + bl InitWindows + bl DeactivateAllTextPrinters + ldr r0, =gUnknown_02022E14 + strh r4, [r0] + ldr r0, =gUnknown_02022E16 + strh r4, [r0] + ldr r0, =gUnknown_02022E18 + strh r4, [r0] + ldr r0, =gUnknown_02022E1A + strh r4, [r0] + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r1, 0xB0 + lsls r1, 4 + movs r0, 0x3 + movs r2, 0 + bl ChangeBgY + ldr r1, =gTasks + mov r2, r8 + lsls r0, r2, 2 + b _0819443C + .pool +_0819431C: + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + movs r0, 0x4C + movs r1, 0 + bl SetGpuReg + ldr r1, =0x00005860 + movs r0, 0x40 + bl SetGpuReg + movs r0, 0x44 + movs r1, 0x9F + bl SetGpuReg + ldr r1, =0x00009098 + movs r0, 0x42 + bl SetGpuReg + movs r0, 0x46 + movs r1, 0x9F + bl SetGpuReg + movs r0, 0x48 + movs r1, 0 + bl SetGpuReg + movs r0, 0x4A + movs r1, 0x3F + bl SetGpuReg + bl ResetPaletteFade + bl ResetSpriteData + bl FreeAllSpritePalettes + ldr r1, =gTasks + mov r3, r8 + lsls r0, r3, 2 + b _0819443C + .pool +_0819438C: + ldr r4, =gUnknown_0203CD7C + movs r0, 0x80 + lsls r0, 4 + bl AllocZeroed + adds r1, r0, 0 + str r1, [r4] + ldr r0, =gUnknown_08D83900 + bl LZDecompressWram + ldr r1, [r4] + movs r0, 0x1 + bl SetBgTilemapBuffer + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + ldr r1, =gUnknown_08D82F10 + movs r5, 0x80 + lsls r5, 6 + movs r6, 0 + str r6, [sp] + movs r0, 0x1 + adds r2, r5, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r1, =gUnknown_08D834FC + str r6, [sp] + movs r0, 0x2 + adds r2, r5, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r1, =gUnknown_08D83B2C + movs r4, 0x1 + str r4, [sp] + movs r0, 0x2 + adds r2, r5, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r1, =gUnknown_08D83C3C + str r4, [sp] + movs r0, 0x3 + adds r2, r5, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r0, =gUnknown_08D85358 + movs r4, 0x80 + lsls r4, 2 + movs r1, 0 + adds r2, r4, 0 + bl LoadCompressedPalette + ldr r0, =gUnknown_08D85444 + movs r1, 0x80 + lsls r1, 1 + adds r2, r4, 0 + bl LoadCompressedPalette + ldr r0, =gUnknown_08D85600 + movs r1, 0xF0 + movs r2, 0x20 + bl LoadCompressedPalette + str r6, [sp, 0x18] + add r0, sp, 0x18 + ldr r1, =gPlttBufferFaded + ldr r2, =0x05000100 + bl CpuSet + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg + ldr r1, =gTasks + mov r4, r8 + lsls r0, r4, 2 +_0819443C: + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + b _081948C2 + .pool +_0819447C: + ldr r0, =gUnknown_0860CF50 + bl LoadCompressedObjectPic + mov r0, r8 + lsls r0, 2 + str r0, [sp, 0x1C] + mov r1, r10 + cmp r1, 0 + bne _081944E8 + movs r5, 0 + ldr r4, =gUnknown_0860D411 +_08194492: + ldrb r1, [r4] + ldrb r2, [r4, 0x1] + ldr r0, =gUnknown_0860CFA8 + movs r3, 0 + bl CreateSprite + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x1E + bls _08194492 + ldr r0, =gTasks + ldr r1, [sp, 0x1C] + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r2, 0x10 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _081944DC + ldr r0, =gUnknown_0860D008 + movs r1, 0xDA + movs r2, 0xC + movs r3, 0 + bl CreateSprite + b _081944E8 + .pool +_081944DC: + ldr r0, =gUnknown_0860CFD8 + movs r1, 0xDA + movs r2, 0xC + movs r3, 0 + bl CreateSprite +_081944E8: + ldr r1, =0x00007f40 + movs r0, 0 + bl SetGpuReg + b _081947A6 + .pool +_081944FC: + add r0, sp, 0x4 + movs r2, 0 + movs r1, 0x2 + strb r1, [r0, 0x5] + ldr r0, =gUnknown_085CCCEE + str r0, [sp, 0x4] + add r0, sp, 0x4 + strb r1, [r0, 0x4] + strb r2, [r0, 0x6] + strb r2, [r0, 0x7] + strb r1, [r0, 0xA] + strb r2, [r0, 0xB] + ldrb r0, [r0, 0x5] + ldr r1, [sp, 0x4] + add r2, sp, 0x4 + ldrb r3, [r2, 0xA] + movs r2, 0x70 + bl GetStringCenterAlignXOffsetWithLetterSpacing + add r1, sp, 0x4 + strb r0, [r1, 0x8] + movs r0, 0x1 + strb r0, [r1, 0x9] + adds r3, r1, 0 + ldrb r2, [r3, 0xC] + movs r1, 0x10 + negs r1, r1 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3, 0xC] + adds r2, r3, 0 + movs r0, 0xE0 + strb r0, [r2, 0xC] + ldrb r0, [r2, 0xD] + ands r1, r0 + strb r1, [r2, 0xD] + adds r1, r2, 0 + movs r0, 0xD0 + strb r0, [r1, 0xD] + adds r0, r1, 0 + movs r1, 0 + movs r2, 0 + bl AddTextPrinter + mov r3, r8 + lsls r3, 2 + str r3, [sp, 0x1C] + add r4, sp, 0x4 + movs r0, 0xF + mov r9, r0 + movs r1, 0 + str r1, [sp, 0x20] + movs r2, 0 + str r2, [sp, 0x24] + movs r7, 0 + movs r5, 0xF +_0819456C: + ldr r3, =gSaveBlock2Ptr + ldr r0, [r3] + adds r0, r7 + ldr r1, =0x00000d24 + adds r0, r1 + ldrh r1, [r0] + lsls r1, 22 + lsrs r1, 22 + ldr r0, =gUnknown_02022E2C + bl sub_8195898 + mov r2, r10 + cmp r2, 0x1 + bne _081945C4 + ldr r3, =gSaveBlock2Ptr + ldr r2, [r3] + adds r0, r2, r7 + ldr r1, =0x00000d25 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 29 + cmp r0, 0 + blt _081945DC + ldr r3, =0x00000cb2 + adds r0, r2, r3 + ldrh r1, [r0] + cmp r1, 0x1 + beq _08194634 + ldr r2, [sp, 0x24] + lsrs r0, r2, 24 + subs r1, 0x2 + b _081945EA + .pool +_081945C4: + mov r3, r10 + cmp r3, 0 + bne _08194634 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + adds r0, r2, r7 + ldr r1, =0x00000d25 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 29 + cmp r0, 0 + bge _081945FC +_081945DC: + lsls r1, 27 + lsrs r0, r1, 30 + cmp r0, 0 + beq _08194634 + subs r1, r0, 0x1 + ldr r2, [sp, 0x24] + lsrs r0, r2, 24 +_081945EA: + lsls r1, 24 + lsrs r1, 24 + bl sub_81948EC + b _08194634 + .pool +_081945FC: + ldr r3, =0x00000cb2 + adds r1, r2, r3 + ldrh r0, [r1] + cmp r0, 0 + beq _08194634 + ldr r0, [sp, 0x1C] + add r0, r8 + lsls r0, 3 + ldr r2, =gTasks + adds r0, r2 + movs r3, 0x10 + ldrsh r0, [r0, r3] + cmp r0, 0 + beq _08194624 + ldrh r1, [r1] + b _08194628 + .pool +_08194624: + ldrh r0, [r1] + subs r1, r0, 0x1 +_08194628: + ldr r2, [sp, 0x24] + lsrs r0, r2, 24 + lsls r1, 24 + lsrs r1, 24 + bl sub_81948EC +_08194634: + ldr r0, [sp, 0x1C] + add r0, r8 + lsls r0, 3 + ldr r3, =gTasks + adds r0, r3 + movs r1, 0x10 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _08194660 + ldr r2, =gSaveBlock2Ptr + ldr r0, [r2] + ldr r3, =0x00000cb2 + adds r0, r3 + ldrh r3, [r0] + adds r6, r2, 0 + b _0819466E + .pool +_08194660: + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r2, =0x00000cb2 + adds r0, r2 + ldrh r0, [r0] + subs r3, r0, 0x1 + adds r6, r1, 0 +_0819466E: + mov r0, r10 + cmp r0, 0x1 + bne _0819468E + ldr r2, [r6] + adds r0, r2, r7 + ldr r1, =0x00000d25 + adds r0, r1 + ldrb r1, [r0] + lsls r1, 27 + lsrs r1, 30 + ldr r0, =0x00000cb2 + adds r2, r0 + ldrh r0, [r2] + subs r0, 0x1 + cmp r1, r0 + blt _081946A6 +_0819468E: + mov r1, r10 + cmp r1, 0 + bne _081946FA + ldr r0, [r6] + adds r0, r7 + ldr r2, =0x00000d25 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 27 + lsrs r0, 30 + cmp r0, r3 + bgt _081946FA +_081946A6: + ldr r0, [r6] + adds r1, r0, r7 + ldr r3, =0x00000d25 + adds r0, r1, r3 + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + bge _081946FA + ldr r2, =0x00000d24 + adds r0, r1, r2 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + ldr r3, =0x000003ff + cmp r0, r3 + bne _081946F0 + ldrb r1, [r4, 0xC] + mov r0, r9 + ands r0, r1 + movs r1, 0x30 + orrs r0, r1 + strb r0, [r4, 0xC] + ldrb r1, [r4, 0xD] + mov r0, r9 + ands r0, r1 + movs r1, 0x40 + b _08194740 + .pool +_081946F0: + ldrb r1, [r4, 0xC] + mov r0, r9 + ands r0, r1 + movs r1, 0xB0 + b _08194734 +_081946FA: + ldr r0, [r6] + adds r0, r7 + ldr r1, =0x00000d24 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + ldr r2, =0x000003ff + cmp r0, r2 + bne _0819472C + ldrb r1, [r4, 0xC] + mov r0, r9 + ands r0, r1 + movs r1, 0x30 + orrs r0, r1 + strb r0, [r4, 0xC] + ldrb r1, [r4, 0xD] + mov r0, r9 + ands r0, r1 + movs r1, 0x40 + b _08194740 + .pool +_0819472C: + ldrb r1, [r4, 0xC] + mov r0, r9 + ands r0, r1 + movs r1, 0xE0 +_08194734: + orrs r0, r1 + strb r0, [r4, 0xC] + ldrb r1, [r4, 0xD] + mov r0, r9 + ands r0, r1 + movs r1, 0xD0 +_08194740: + orrs r0, r1 + strb r0, [r4, 0xD] + ldr r0, =gUnknown_0860D3F1 + ldr r3, [sp, 0x20] + adds r0, r3, r0 + ldrb r0, [r0] + cmp r0, 0 + bne _08194768 + ldrb r0, [r4, 0x5] + ldrb r3, [r4, 0xA] + ldr r1, =gUnknown_02022E2C + movs r2, 0x3D + bl GetStringWidthDifference + b _0819476A + .pool +_08194768: + movs r0, 0x3 +_0819476A: + strb r0, [r4, 0x8] + ldr r0, =gUnknown_02022E2C + str r0, [sp, 0x4] + ldr r0, =gUnknown_0860D3F1 + ldr r1, [sp, 0x20] + adds r0, r1, r0 + ldrb r0, [r0] + strb r0, [r4, 0x4] + ldr r2, =gUnknown_0860D3F2 + adds r0, r1, r2 + ldrb r0, [r0] + strb r0, [r4, 0x9] + add r0, sp, 0x4 + movs r1, 0 + movs r2, 0 + bl AddTextPrinter + ldr r3, [sp, 0x20] + adds r3, 0x2 + str r3, [sp, 0x20] + ldr r0, [sp, 0x24] + movs r1, 0x80 + lsls r1, 17 + adds r0, r1 + str r0, [sp, 0x24] + adds r7, 0x4 + subs r5, 0x1 + cmp r5, 0 + blt _081947A6 + b _0819456C +_081947A6: + ldr r0, =gTasks + ldr r1, [sp, 0x1C] + add r1, r8 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _081948C2 + .pool +_081947C8: + movs r0, 0 + bl PutWindowTilemap + movs r0, 0x1 + bl PutWindowTilemap + movs r0, 0x2 + bl PutWindowTilemap + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + movs r0, 0x1 + movs r1, 0x3 + bl CopyWindowToVram + movs r0, 0x2 + movs r1, 0x3 + bl CopyWindowToVram + ldr r0, =sub_8194BEC + bl SetHBlankCallback + ldr r0, =sub_8194CE4 + bl SetVBlankCallback + cmp r4, 0x2 + bne _0819485C + mov r2, r10 + cmp r2, 0 + bne _08194844 + ldr r0, =sub_819395C + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r5, r0, 24 + ldr r2, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r2 + mov r3, r10 + strh r3, [r1, 0x8] + strh r3, [r1, 0xA] + mov r4, r8 + lsls r0, r4, 2 + add r0, r8 + lsls r0, 3 + adds r0, r2 + ldrh r0, [r0, 0x10] + strh r0, [r1, 0x14] + b _08194878 + .pool +_08194844: + ldr r0, =sub_8194950 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =gTasks + b _0819486C + .pool +_0819485C: + ldr r1, =gTasks + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r3, 0xE + ldrsh r5, [r0, r3] +_0819486C: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x8] +_08194878: + bl dp12_8087EA4 + ldr r0, =gUnknown_02038C28 + ldr r2, =0x00001f0a + movs r4, 0xF0 + lsls r4, 3 + adds r1, r0, r4 + movs r5, 0x5A +_08194888: + strh r2, [r0] + strh r2, [r1] + adds r1, 0x2 + adds r0, 0x2 + subs r5, 0x1 + cmp r5, 0 + bge _08194888 + movs r5, 0x5B + ldr r3, =gUnknown_0860CF44 + ldr r0, =gUnknown_02038C28 + ldr r2, =0x00001f09 + ldr r4, =0x00000836 + adds r1, r0, r4 + adds r0, 0xB6 +_081948A4: + strh r2, [r0] + strh r2, [r1] + adds r1, 0x2 + adds r0, 0x2 + adds r5, 0x1 + cmp r5, 0x9F + ble _081948A4 + ldr r0, [r3] + ldr r1, [r3, 0x4] + ldr r2, [r3, 0x8] + bl sub_80BA038 + mov r0, r8 + bl DestroyTask +_081948C2: + add sp, 0x28 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8194220 + + thumb_func_start sub_81948EC +sub_81948EC: @ 81948EC + push {r4-r7,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r4, =gUnknown_0860DD10 + lsls r2, r1, 2 + lsls r3, r0, 4 + adds r2, r3 + adds r2, r4 + ldr r3, [r2] + ldr r2, =gUnknown_0860DE10 + lsls r0, 2 + adds r1, r0 + adds r1, r2 + ldrb r0, [r1] + cmp r0, 0 + beq _08194938 + movs r7, 0x1 + adds r4, r3, 0 + adds r5, r4, 0x2 + adds r6, r0, 0 +_0819491A: + ldrb r2, [r4] + ldrb r3, [r4, 0x1] + str r7, [sp] + str r7, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x1 + adds r1, r5, 0 + bl CopyToBgTilemapBufferRect_ChangePalette + adds r4, 0x4 + adds r5, 0x4 + subs r6, 0x1 + cmp r6, 0 + bne _0819491A +_08194938: + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81948EC + + thumb_func_start sub_8194950 +sub_8194950: @ 8194950 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r2, r1, 0 + cmp r0, 0x4 + bls _08194974 + b _08194B3C +_08194974: + lsls r0, 2 + ldr r1, =_08194988 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08194988: + .4byte _0819499C + .4byte _081949C0 + .4byte _08194AD4 + .4byte _08194AEE + .4byte _08194B24 +_0819499C: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0x1 + strh r1, [r0, 0x8] + b _08194B3C + .pool +_081949C0: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081949CE + b _08194B3C +_081949CE: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r2 + movs r2, 0 + movs r3, 0x2 + movs r1, 0x2 + strh r1, [r0, 0x8] + movs r1, 0x40 + strh r1, [r0, 0xE] + add r0, sp, 0x4 + strb r3, [r0, 0x5] + strb r2, [r0, 0x6] + strb r2, [r0, 0x7] + strb r3, [r0, 0xA] + strb r2, [r0, 0xB] + adds r3, r0, 0 + ldrb r2, [r3, 0xC] + subs r1, 0x50 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3, 0xC] + adds r2, r3, 0 + movs r0, 0xB0 + strb r0, [r2, 0xC] + ldrb r0, [r2, 0xD] + ands r1, r0 + strb r1, [r2, 0xD] + adds r1, r2, 0 + movs r0, 0xD0 + strb r0, [r1, 0xD] + movs r7, 0 + ldr r0, =gUnknown_02022E2C + mov r9, r0 + ldr r1, =gSaveBlock2Ptr + mov r8, r1 + adds r4, r2, 0 + ldr r6, =gUnknown_0860D3F1 + movs r5, 0 +_08194A1C: + mov r2, r8 + ldr r0, [r2] + adds r0, r5 + ldr r1, =0x00000d24 + adds r0, r1 + ldrh r1, [r0] + lsls r1, 22 + lsrs r1, 22 + mov r0, r9 + bl sub_8195898 + mov r0, r8 + ldr r2, [r0] + adds r0, r2, r5 + ldr r1, =0x00000d25 + adds r0, r1 + ldrb r3, [r0] + lsls r1, r3, 27 + lsrs r1, 30 + ldr r0, =0x00000cb2 + adds r2, r0 + ldrh r0, [r2] + subs r0, 0x1 + cmp r1, r0 + bne _08194A9E + lsls r0, r3, 29 + cmp r0, 0 + bge _08194A9E + ldrb r0, [r6] + cmp r0, 0 + bne _08194A84 + ldrb r0, [r4, 0x5] + ldrb r3, [r4, 0xA] + mov r1, r9 + movs r2, 0x3D + bl GetStringWidthDifference + b _08194A86 + .pool +_08194A84: + movs r0, 0x3 +_08194A86: + strb r0, [r4, 0x8] + mov r1, r9 + str r1, [sp, 0x4] + ldrb r0, [r6] + strb r0, [r4, 0x4] + ldrb r0, [r6, 0x1] + strb r0, [r4, 0x9] + add r0, sp, 0x4 + movs r1, 0 + movs r2, 0 + bl AddTextPrinter +_08194A9E: + mov r2, r8 + ldr r1, [r2] + adds r0, r1, r5 + ldr r2, =0x00000d25 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _08194AC4 + subs r2, 0x73 + adds r0, r1, r2 + ldrh r1, [r0] + subs r1, 0x1 + lsls r0, r7, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + bl sub_81948EC +_08194AC4: + adds r6, 0x2 + adds r5, 0x4 + adds r7, 0x1 + cmp r7, 0xF + ble _08194A1C + b _08194B3C + .pool +_08194AD4: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r2 + ldrh r0, [r1, 0xE] + subs r0, 0x1 + strh r0, [r1, 0xE] + lsls r0, 16 + cmp r0, 0 + bne _08194B3C + movs r0, 0x3 + strh r0, [r1, 0x8] + b _08194B3C +_08194AEE: + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _08194B3C + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0x4 + strh r1, [r0, 0x8] + b _08194B3C + .pool +_08194B24: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08194B3C + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + bl SetMainCallback2 + adds r0, r4, 0 + bl DestroyTask +_08194B3C: + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8194950 + + thumb_func_start sub_8194B54 +sub_8194B54: @ 8194B54 + push {lr} + bl AnimateSprites + bl BuildOamBuffer + bl RunTextPrinters + bl UpdatePaletteFade + bl RunTasks + pop {r0} + bx r0 + thumb_func_end sub_8194B54 + + thumb_func_start sub_8194B70 +sub_8194B70: @ 8194B70 + push {lr} + movs r0, 0x3 + movs r1, 0x80 + movs r2, 0x1 + bl ChangeBgX + movs r0, 0x3 + movs r1, 0x80 + movs r2, 0x2 + bl ChangeBgY + ldr r0, =gUnknown_02022E14 + ldrh r1, [r0] + movs r0, 0x10 + bl SetGpuReg + ldr r0, =gUnknown_02022E16 + ldrh r1, [r0] + movs r0, 0x12 + bl SetGpuReg + ldr r0, =gUnknown_02022E18 + ldrh r1, [r0] + movs r0, 0x14 + bl SetGpuReg + ldr r0, =gUnknown_02022E1A + ldrh r1, [r0] + movs r0, 0x16 + bl SetGpuReg + ldr r0, =gUnknown_02022E1C + ldrh r1, [r0] + movs r0, 0x18 + bl SetGpuReg + ldr r0, =gUnknown_02022E1E + ldrh r1, [r0] + movs r0, 0x1A + bl SetGpuReg + bl LoadOam + bl ProcessSpriteCopyRequests + bl TransferPlttBuffer + pop {r0} + bx r0 + .pool + thumb_func_end sub_8194B70 + + thumb_func_start sub_8194BEC +sub_8194BEC: @ 8194BEC + push {lr} + ldr r0, =0x04000006 + ldrh r0, [r0] + adds r1, r0, 0 + cmp r0, 0x29 + bls _08194CC8 + cmp r0, 0x31 + bhi _08194C1C + ldr r1, =0x04000048 + ldr r2, =0x00003b3b + adds r0, r2, 0 + strh r0, [r1] + subs r1, 0x8 + ldr r0, =0x989b5558 + b _08194CD4 + .pool +_08194C1C: + cmp r0, 0x39 + bls _08194CC8 + cmp r0, 0x4A + bhi _08194C40 + ldr r1, =0x04000048 + ldr r2, =0x00003b3b + adds r0, r2, 0 + strh r0, [r1] + subs r1, 0x8 + ldr r0, =0x90985860 + b _08194CD4 + .pool +_08194C40: + cmp r0, 0x51 + bhi _08194C60 + ldr r1, =0x04000048 + ldr r2, =0x00003b3b + adds r0, r2, 0 + strh r0, [r1] + subs r1, 0x8 + ldr r0, =0x989b5558 + b _08194CD4 + .pool +_08194C60: + cmp r0, 0x5E + bls _08194CC8 + cmp r0, 0x66 + bhi _08194C84 + ldr r1, =0x04000048 + ldr r2, =0x00003737 + adds r0, r2, 0 + strh r0, [r1] + subs r1, 0x8 + ldr r0, =0x989b5558 + b _08194CD4 + .pool +_08194C84: + cmp r0, 0x76 + bhi _08194CA4 + ldr r1, =0x04000048 + ldr r2, =0x00003737 + adds r0, r2, 0 + strh r0, [r1] + subs r1, 0x8 + ldr r0, =0x90985860 + b _08194CD4 + .pool +_08194CA4: + cmp r0, 0x7E + bls _08194CC8 + cmp r1, 0x86 + bhi _08194CC8 + ldr r1, =0x04000048 + ldr r2, =0x00003737 + adds r0, r2, 0 + strh r0, [r1] + subs r1, 0x8 + ldr r0, =0x989b5558 + b _08194CD4 + .pool +_08194CC8: + ldr r1, =0x04000048 + ldr r2, =0x00003f3f + adds r0, r2, 0 + strh r0, [r1] + subs r1, 0x8 + movs r0, 0 +_08194CD4: + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8194BEC + + thumb_func_start sub_8194CE4 +sub_8194CE4: @ 8194CE4 + push {lr} + ldr r0, =gUnknown_02022E14 + ldrh r1, [r0] + movs r0, 0x10 + bl SetGpuReg + ldr r0, =gUnknown_02022E16 + ldrh r1, [r0] + movs r0, 0x12 + bl SetGpuReg + ldr r0, =gUnknown_02022E18 + ldrh r1, [r0] + movs r0, 0x14 + bl SetGpuReg + ldr r0, =gUnknown_02022E1A + ldrh r1, [r0] + movs r0, 0x16 + bl SetGpuReg + movs r0, 0x2 + movs r1, 0x80 + movs r2, 0x2 + bl ChangeBgY + movs r0, 0x3 + movs r1, 0x80 + movs r2, 0x1 + bl ChangeBgY + bl LoadOam + bl ProcessSpriteCopyRequests + bl TransferPlttBuffer + bl sub_80BA0A8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8194CE4 + + thumb_func_start sub_8194D48 +sub_8194D48: @ 8194D48 + ldr r1, =gUnknown_0203BC8C + ldr r0, =gBattleFrontierMons + str r0, [r1] + ldr r1, =gUnknown_0203BC88 + ldr r0, =gBattleFrontierTrainers + str r0, [r1] + bx lr + .pool + thumb_func_end sub_8194D48 + + thumb_func_start sub_8194D68 +sub_8194D68: @ 8194D68 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + movs r3, 0 +_08194D76: + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r0, =gUnknown_0203CEF8 + adds r0, r3, r0 + ldrb r0, [r0] + subs r0, 0x1 + lsls r0, 1 + ldr r2, =0x00000caa + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + subs r0, 0x1 + mov r10, r0 + movs r6, 0 + adds r0, r3, 0x1 + str r0, [sp] + movs r1, 0x64 + mov r0, r10 + muls r0, r1 + movs r2, 0x8E + lsls r2, 2 + adds r2, r0 + mov r9, r2 + adds r7, r3, 0 + muls r7, r1 +_08194DA8: + movs r5, 0 + adds r0, r6, 0x1 + mov r8, r0 + b _08194DBE + .pool +_08194DBC: + adds r5, 0x1 +_08194DBE: + cmp r5, 0x3 + bgt _08194DEA + ldr r1, =gSaveBlock1Ptr + ldr r0, [r1] + add r0, r9 + adds r1, r5, 0 + adds r1, 0xD + movs r2, 0 + str r3, [sp, 0x4] + bl GetMonData + adds r4, r0, 0 + adds r1, r6, 0 + adds r1, 0xD + ldr r2, =gPlayerParty + adds r0, r7, r2 + movs r2, 0 + bl GetMonData + ldr r3, [sp, 0x4] + cmp r4, r0 + bne _08194DBC +_08194DEA: + cmp r5, 0x4 + bne _08194E00 + lsls r2, r6, 24 + lsrs r2, 24 + ldr r1, =gPlayerParty + adds r0, r7, r1 + movs r1, 0xA6 + str r3, [sp, 0x4] + bl sub_80691F4 + ldr r3, [sp, 0x4] +_08194E00: + mov r6, r8 + cmp r6, 0x3 + ble _08194DA8 + ldr r2, =gSaveBlock1Ptr + ldr r0, [r2] + movs r2, 0x64 + mov r1, r10 + muls r1, r2 + adds r0, r1 + movs r1, 0x8E + lsls r1, 2 + adds r0, r1 + adds r1, r3, 0 + muls r1, r2 + ldr r2, =gPlayerParty + adds r1, r2 + movs r2, 0x64 + bl memcpy + ldr r3, [sp] + cmp r3, 0x1 + ble _08194D76 + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8194D68 + + thumb_func_start sub_8194E44 +sub_8194E44: @ 8194E44 + push {r4-r7,lr} + sub sp, 0x4 + movs r4, 0 + ldr r7, =gSaveBlock1Ptr + movs r6, 0x64 + movs r5, 0 +_08194E50: + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r0, =gUnknown_0203CEF8 + adds r0, r4, r0 + ldrb r0, [r0] + subs r0, 0x1 + lsls r0, 1 + ldr r2, =0x00000caa + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + subs r0, 0x1 + adds r1, r0, 0 + muls r1, r6 + movs r0, 0x8E + lsls r0, 2 + adds r1, r0 + ldr r0, [r7] + adds r0, r1 + movs r1, 0xC + movs r2, 0 + bl GetMonData + mov r1, sp + strh r0, [r1] + ldr r0, =gPlayerParty + adds r0, r5, r0 + movs r1, 0xC + mov r2, sp + bl SetMonData + adds r5, 0x64 + adds r4, 0x1 + cmp r4, 0x1 + ble _08194E50 + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8194E44 + + thumb_func_start sub_8194EB4 +sub_8194EB4: @ 8194EB4 + push {lr} + bl sub_80F94E8 + pop {r0} + bx r0 + thumb_func_end sub_8194EB4 + + thumb_func_start sub_8194EC0 +sub_8194EC0: @ 8194EC0 + push {r4,lr} + ldr r0, =gUnknown_02038BCA + ldrh r0, [r0] + bl sub_8195358 + adds r4, r0, 0 + ldr r0, =0x000003ff + bl sub_8195358 + cmp r4, r0 + ble _08194EE8 + ldr r1, =gScriptResult + movs r0, 0x1 + b _08194EEC + .pool +_08194EE8: + ldr r1, =gScriptResult + movs r0, 0x2 +_08194EEC: + strh r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8194EC0 + + thumb_func_start sub_8194EF8 +sub_8194EF8: @ 8194EF8 + push {r4,lr} + bl sub_8194D48 + movs r2, 0 + ldr r3, =gSaveBlock2Ptr + ldr r0, [r3] + ldr r1, =0x00000d25 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + bge _08194F2A + adds r4, r3, 0 + adds r3, r1, 0 +_08194F14: + adds r2, 0x1 + cmp r2, 0xF + bgt _08194F2A + ldr r0, [r4] + lsls r1, r2, 2 + adds r0, r1 + adds r0, r3 + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _08194F14 +_08194F2A: + ldr r0, =gStringVar1 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + lsls r2, 2 + adds r1, r2 + ldr r2, =0x00000d24 + adds r1, r2 + ldrh r1, [r1] + lsls r1, 22 + lsrs r1, 22 + bl sub_8195898 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8194EF8 + + thumb_func_start sub_8194F58 +sub_8194F58: @ 8194F58 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x40 + movs r0, 0 + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r0, [sp, 0x10] + ldr r4, =gSaveBlock2Ptr + ldr r2, [r4] + ldr r5, =0x00000d0a + adds r0, r2, r5 + ldrb r1, [r0] + ldr r6, =0x00000d0b + adds r0, r2, r6 + ldrb r0, [r0] + cmn r1, r0 + beq _08194F8C + ldr r1, =0x00000ca8 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08194F8C + b _0819533E +_08194F8C: + movs r0, 0x20 + bl AllocZeroed + str r0, [sp, 0x18] + movs r0, 0x18 + bl AllocZeroed + str r0, [sp, 0x1C] + ldr r1, [r4] + ldr r2, =0x00000ca9 + adds r1, r2 + ldrb r2, [r1] + lsls r0, r2, 30 + lsrs r0, 30 + str r0, [sp, 0x14] + movs r0, 0x4 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r0, [r4] + movs r1, 0x1 + adds r0, r5 + strb r1, [r0] + ldr r0, [r4] + adds r0, r6 + strb r1, [r0] + movs r3, 0 + mov r10, r3 + movs r4, 0 + str r4, [sp, 0x38] + movs r5, 0 + str r5, [sp, 0x3C] +_08194FCC: + mov r0, r10 + cmp r0, 0x4 + bgt _08194FFC + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 16 + lsrs r4, r0, 16 + b _08195030 + .pool +_08194FFC: + mov r1, r10 + cmp r1, 0xE + bgt _0819501A + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x14 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + adds r4, r0, 0 + adds r4, 0xA + b _08195030 +_0819501A: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + adds r4, r0, 0 + adds r4, 0x1E +_08195030: + movs r6, 0 + cmp r6, r10 + bge _08195064 + ldr r2, =gSaveBlock2Ptr + ldr r0, [r2] + ldr r3, =0x00000d24 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + cmp r0, r4 + beq _08195064 + adds r3, r2, 0 + ldr r2, =0x00000d24 +_0819504C: + adds r6, 0x1 + cmp r6, r10 + bge _08195064 + ldr r0, [r3] + lsls r1, r6, 2 + adds r0, r1 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + cmp r0, r4 + bne _0819504C +_08195064: + cmp r6, r10 + bne _08194FCC + ldr r5, =gSaveBlock2Ptr + ldr r3, [r5] + ldr r0, [sp, 0x38] + adds r3, r0 + ldr r1, =0x00000d24 + adds r3, r1 + ldr r2, =0x000003ff + adds r0, r2, 0 + adds r2, r4, 0 + ands r2, r0 + ldrh r0, [r3] + ldr r5, =0xfffffc00 + adds r1, r5, 0 + ands r0, r1 + orrs r0, r2 + strh r0, [r3] + movs r6, 0 + lsls r4, 16 + str r4, [sp, 0x30] + ldr r0, [sp, 0x3C] + str r0, [sp, 0x20] +_08195092: + adds r1, r6, 0x1 + str r1, [sp, 0x24] + lsls r2, r6, 2 + str r2, [sp, 0x2C] + lsls r3, r6, 1 + str r3, [sp, 0x28] +_0819509E: + ldr r4, [sp, 0x30] + lsrs r0, r4, 16 + bl sub_8163524 + lsls r0, 16 + lsrs r5, r0, 16 + movs r7, 0 + cmp r7, r6 + bge _081950F4 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =gUnknown_0203BC8C + mov r9, r1 + ldr r2, [sp, 0x8] + mov r8, r2 + ldr r3, [sp, 0xC] + mov r12, r3 + ldr r4, =0x00000d64 + adds r0, r4 + ldr r1, [sp, 0x20] + adds r4, r1, r0 +_081950C8: + ldrh r3, [r4] + cmp r3, r5 + beq _081950F4 + mov r2, r9 + ldr r1, [r2] + lsls r0, r5, 4 + adds r2, r0, r1 + ldrh r0, [r2] + cmp r8, r0 + beq _081950F4 + cmp r12, r0 + beq _081950F4 + lsls r0, r3, 4 + adds r0, r1 + ldrb r0, [r0, 0xA] + ldrb r2, [r2, 0xA] + cmp r0, r2 + beq _081950F4 + adds r4, 0x2 + adds r7, 0x1 + cmp r7, r6 + blt _081950C8 +_081950F4: + cmp r7, r6 + bne _0819509E + ldr r3, =gSaveBlock2Ptr + ldr r0, [r3] + ldr r4, [sp, 0x28] + ldr r2, [sp, 0x3C] + adds r1, r4, r2 + ldr r3, =0x00000d64 + adds r0, r3 + adds r0, r1 + strh r5, [r0] + ldr r2, [sp, 0x2C] + add r2, sp + adds r2, 0x8 + ldr r3, =gUnknown_0203BC8C + ldr r1, [r3] + lsls r0, r5, 4 + adds r0, r1 + ldrh r0, [r0] + str r0, [r2] + ldr r6, [sp, 0x24] + cmp r6, 0x2 + ble _08195092 + ldr r4, =gSaveBlock2Ptr + ldr r2, [r4] + ldr r5, [sp, 0x38] + adds r2, r5 + ldr r0, =0x00000d25 + adds r2, r0 + ldrb r0, [r2] + movs r4, 0x5 + negs r4, r4 + adds r1, r4, 0 + ands r0, r1 + strb r0, [r2] + ldr r5, =gSaveBlock2Ptr + ldr r2, [r5] + ldr r0, [sp, 0x38] + adds r2, r0 + ldr r1, =0x00000d25 + adds r2, r1 + ldrb r0, [r2] + subs r4, 0x14 + adds r1, r4, 0 + ands r0, r1 + strb r0, [r2] + ldr r1, [r5] + ldr r5, [sp, 0x38] + adds r1, r5 + ldr r0, =0x00000d25 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x1F + ands r0, r2 + strb r0, [r1] + adds r5, 0x4 + str r5, [sp, 0x38] + ldr r1, [sp, 0x3C] + adds r1, 0x6 + str r1, [sp, 0x3C] + movs r2, 0x1 + add r10, r2 + mov r4, r10 + cmp r4, 0xF + bgt _08195178 + b _08194FCC +_08195178: + movs r5, 0 + mov r10, r5 + ldr r5, [sp, 0x18] + movs r0, 0 + str r0, [sp, 0x34] +_08195182: + movs r7, 0 + strh r7, [r5] + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + mov r2, r10 + lsls r1, r2, 2 + adds r0, r1 + ldr r3, =0x00000d24 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + bl sub_8190168 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r6, 0 + ldr r4, [sp, 0x34] + mov r9, r4 +_081951AA: + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + mov r4, r9 + add r4, r10 + adds r4, r6 + lsls r4, 1 + ldr r2, =0x00000d64 + adds r0, r2 + adds r0, r4 + ldrh r1, [r0] + ldr r3, =gUnknown_0203BC8C + ldr r0, [r3] + lsls r1, 4 + adds r1, r0 + ldrh r0, [r1] + ldrb r3, [r1, 0xB] + ldrb r1, [r1, 0xC] + str r1, [sp] + ldr r1, [sp, 0x1C] + str r1, [sp, 0x4] + movs r1, 0x32 + mov r2, r8 + bl sub_818F720 + ldr r2, [sp, 0x1C] + ldr r1, [r2, 0x4] + ldrh r0, [r5] + adds r0, r1 + ldr r1, [r2, 0x8] + adds r0, r1 + ldr r1, [r2, 0x10] + adds r0, r1 + ldr r1, [r2, 0x14] + adds r0, r1 + ldr r1, [r2, 0xC] + adds r0, r1 + ldr r1, [r2] + adds r0, r1 + strh r0, [r5] + ldr r3, =gSaveBlock2Ptr + ldr r0, [r3] + ldr r1, =0x00000d64 + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + ldr r2, =gUnknown_0203BC8C + ldr r1, [r2] + lsls r0, 4 + adds r0, r1 + ldrh r0, [r0] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r3, =gBaseStats + adds r1, r3 + ldrb r0, [r1, 0x6] + lsls r0, 2 + ldr r4, =gBitTable + adds r0, r4 + ldr r0, [r0] + orrs r7, r0 + ldrb r0, [r1, 0x7] + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + orrs r7, r0 + adds r6, 0x1 + cmp r6, 0x2 + ble _081951AA + movs r4, 0 + movs r1, 0x1 + movs r6, 0x1F +_0819523A: + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _08195244 + adds r4, 0x1 +_08195244: + asrs r7, 1 + subs r6, 0x1 + cmp r6, 0 + bge _0819523A + movs r1, 0x32 + adds r0, r4, 0 + muls r0, r1 + movs r1, 0x14 + bl __divsi3 + ldrh r1, [r5] + adds r1, r0 + strh r1, [r5] + adds r5, 0x2 + ldr r2, [sp, 0x34] + adds r2, 0x2 + str r2, [sp, 0x34] + movs r3, 0x1 + add r10, r3 + mov r4, r10 + cmp r4, 0xF + ble _08195182 + movs r5, 0 + mov r10, r5 + ldr r7, [sp, 0x18] +_08195276: + mov r6, r10 + adds r6, 0x1 + cmp r6, 0xF + bgt _081952F8 + mov r8, r7 + ldr r5, =0x00000d24 + lsls r0, r6, 1 + ldr r1, [sp, 0x18] + adds r4, r0, r1 +_08195288: + mov r2, r8 + ldrh r1, [r2] + ldrh r0, [r4] + cmp r1, r0 + bcs _081952C4 + mov r0, r10 + adds r1, r6, 0 + ldr r2, [sp, 0x18] + bl sub_818F904 + b _081952F0 + .pool +_081952C4: + cmp r1, r0 + bne _081952F0 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + mov r3, r10 + lsls r0, r3, 2 + adds r0, r1, r0 + adds r0, r5 + ldrh r2, [r0] + lsls r2, 22 + lsls r0, r6, 2 + adds r1, r0 + adds r1, r5 + ldrh r0, [r1] + lsls r0, 22 + cmp r2, r0 + bls _081952F0 + mov r0, r10 + adds r1, r6, 0 + ldr r2, [sp, 0x18] + bl sub_818F904 +_081952F0: + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0xF + ble _08195288 +_081952F8: + adds r7, 0x2 + movs r4, 0x1 + add r10, r4 + mov r5, r10 + cmp r5, 0xE + ble _08195276 + ldr r0, [sp, 0x18] + bl Free + ldr r0, [sp, 0x1C] + bl Free + movs r0, 0 + mov r10, r0 +_08195314: + mov r1, r10 + lsls r0, r1, 24 + lsrs r0, 24 + bl sub_8195438 + movs r2, 0x1 + add r10, r2 + mov r3, r10 + cmp r3, 0x3 + ble _08195314 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r4, =0x00000ca9 + adds r1, r4 + ldrb r2, [r1] + movs r0, 0x4 + negs r0, r0 + ands r0, r2 + ldr r5, [sp, 0x14] + orrs r0, r5 + strb r0, [r1] +_0819533E: + add sp, 0x40 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8194F58 + + thumb_func_start sub_8195358 +sub_8195358: @ 8195358 + push {r4,r5,lr} + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0 + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000d24 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + cmp r0, r3 + beq _0819538E + adds r5, r4, 0 + adds r4, r1, 0 +_08195376: + adds r2, 0x1 + cmp r2, 0xF + bgt _0819538E + ldr r0, [r5] + lsls r1, r2, 2 + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + cmp r0, r3 + bne _08195376 +_0819538E: + adds r0, r2, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8195358 + + thumb_func_start sub_81953A0 +sub_81953A0: @ 81953A0 + push {r4,r5,lr} + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0 + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000d24 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + cmp r0, r3 + beq _081953D6 + adds r5, r4, 0 + adds r4, r1, 0 +_081953BE: + adds r2, 0x1 + cmp r2, 0xF + bgt _081953D6 + ldr r0, [r5] + lsls r1, r2, 2 + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + lsls r0, 22 + lsrs r0, 22 + cmp r0, r3 + bne _081953BE +_081953D6: + adds r0, r2, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81953A0 + + thumb_func_start sub_81953E8 +sub_81953E8: @ 81953E8 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gUnknown_0860D1A0 + ldr r0, =gUnknown_0860D1C0 + adds r0, r4, r0 + ldrb r0, [r0] + lsrs r0, 1 + lsls r0, 2 + adds r1, r0 + adds r1, r2 + ldrb r0, [r1] + subs r0, 0x10 + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + bl sub_8192F08 + mov r0, sp + ldrb r0, [r0] + cmp r4, r0 + beq _0819542C + mov r0, sp + ldrb r0, [r0] + b _08195430 + .pool +_0819542C: + mov r0, sp + ldrb r0, [r0, 0x1] +_08195430: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81953E8 + + thumb_func_start sub_8195438 +sub_8195438: @ 8195438 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x40 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0xC] + movs r1, 0 + str r1, [sp, 0x10] + movs r5, 0 + movs r1, 0x3 + ldr r0, [sp] + ands r0, r1 + lsls r0, 3 + str r0, [sp, 0x14] +_0819545E: + ldr r2, =gSaveBlock2Ptr + ldr r0, [r2] + lsls r4, r5, 2 + adds r1, r0, r4 + ldr r3, =0x00000d25 + adds r0, r1, r3 + ldrb r0, [r0] + lsls r0, 29 + adds r2, r5, 0x1 + str r2, [sp, 0x24] + cmp r0, 0 + bge _08195478 + b _08195876 +_08195478: + subs r3, 0x1 + adds r0, r1, r3 + ldrh r0, [r0] + lsls r1, r0, 22 + ldr r0, =0xffc00000 + cmp r1, r0 + bne _08195488 + b _08195876 +_08195488: + str r5, [sp, 0x4] + lsrs r1, 22 + ldr r0, [sp] + bl sub_81901A0 + str r0, [sp, 0x8] + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + adds r0, r3, r4 + ldr r1, =0x00000d24 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 22 + ldr r1, =0xff800000 + cmp r0, r1 + bne _08195504 + ldr r2, [sp, 0x8] + cmp r2, 0xFF + beq _08195504 + lsls r2, 2 + adds r1, r3, r2 + ldr r3, =0x00000d25 + adds r1, r3 + ldrb r0, [r1] + movs r3, 0x4 + orrs r0, r3 + strb r0, [r1] + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + adds r1, r2 + ldr r2, =0x00000d25 + adds r1, r2 + ldrb r0, [r1] + subs r3, 0x1D + ands r0, r3 + ldr r2, [sp, 0x14] + orrs r0, r2 + strb r0, [r1] + adds r0, r5, 0 + ldr r1, [sp, 0x8] + ldr r2, [sp] + bl sub_8193ED0 + ldr r3, =gSaveBlock2Ptr + ldr r1, [r3] + ldr r5, [sp, 0x8] + lsls r2, r5, 1 + movs r3, 0xEC + lsls r3, 4 + adds r1, r3 + adds r1, r2 + b _08195874 + .pool +_08195504: + ldr r4, =gSaveBlock2Ptr + ldr r3, [r4] + ldr r0, [sp, 0x8] + lsls r2, r0, 2 + adds r0, r3, r2 + ldr r1, =0x00000d24 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 22 + ldr r1, =0xff800000 + str r2, [sp, 0x30] + cmp r0, r1 + bne _0819557C + ldr r2, [sp, 0x4] + cmp r2, 0xFF + beq _0819557C + lsls r2, 2 + adds r1, r3, r2 + ldr r3, =0x00000d25 + adds r1, r3 + ldrb r0, [r1] + movs r3, 0x4 + orrs r0, r3 + strb r0, [r1] + ldr r1, [r4] + adds r1, r2 + ldr r0, =0x00000d25 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x19 + negs r2, r2 + ands r0, r2 + ldr r3, [sp, 0x14] + orrs r0, r3 + strb r0, [r1] + ldr r0, [sp, 0x8] + ldr r1, [sp, 0x4] + ldr r2, [sp] + bl sub_8193ED0 + ldr r1, [r4] + ldr r3, [sp, 0x4] + lsls r2, r3, 1 + movs r3, 0xEC + lsls r3, 4 + adds r1, r3 + adds r1, r2 + strh r0, [r1] + adds r5, 0x1 + str r5, [sp, 0x24] + b _08195876 + .pool +_0819557C: + adds r5, 0x1 + str r5, [sp, 0x24] + ldr r5, [sp, 0x8] + cmp r5, 0xFF + bne _08195588 + b _08195876 +_08195588: + movs r0, 0 + mov r10, r0 + lsls r1, r5, 1 + str r1, [sp, 0x2C] + ldr r2, [sp, 0x4] + lsls r2, 1 + str r2, [sp, 0x28] + ldr r3, [sp, 0x4] + adds r0, r2, r3 + lsls r0, 1 + mov r9, r0 + adds r0, r1, r5 + lsls r0, 1 + str r0, [sp, 0x18] +_081955A4: + movs r5, 0 + mov r0, r9 + str r0, [sp, 0x38] +_081955AA: + movs r6, 0 + lsls r7, r5, 1 + ldr r4, [sp, 0x18] +_081955B0: + ldr r2, =gSaveBlock2Ptr + ldr r1, [r2] + ldr r3, =0x00000d64 + adds r1, r3 + ldr r2, [sp, 0x38] + adds r0, r1, r2 + ldrh r0, [r0] + ldr r3, =gUnknown_0203BC8C + mov r8, r3 + ldr r2, [r3] + lsls r0, 4 + adds r0, r2 + adds r0, 0x2 + adds r0, r7 + ldrh r0, [r0] + adds r1, r4 + ldrh r1, [r1] + lsls r1, 4 + adds r1, r2 + ldrh r1, [r1] + movs r2, 0x2 + bl sub_818FFC0 + ldr r1, [sp, 0xC] + adds r1, r0 + str r1, [sp, 0xC] + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x2 + ble _081955B0 + adds r5, 0x1 + cmp r5, 0x3 + ble _081955AA + ldr r2, =gSaveBlock2Ptr + ldr r0, [r2] + ldr r3, =0x00000d64 + adds r0, r3 + add r0, r9 + ldrh r0, [r0] + mov r5, r8 + ldr r1, [r5] + lsls r0, 4 + adds r0, r1 + ldrh r2, [r0] + ldr r0, =gBaseStats + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1] + ldrb r2, [r1, 0x1] + adds r0, r2 + ldrb r2, [r1, 0x2] + adds r0, r2 + ldrb r2, [r1, 0x3] + adds r0, r2 + ldrb r3, [r1, 0x4] + adds r0, r3 + ldrb r1, [r1, 0x5] + adds r0, r1 + movs r1, 0xA + bl __divsi3 + ldr r5, [sp, 0xC] + adds r5, r0 + str r5, [sp, 0xC] + movs r0, 0x2 + add r9, r0 + movs r1, 0x1 + add r10, r1 + mov r2, r10 + cmp r2, 0x2 + ble _081955A4 + bl Random + movs r1, 0x1F + ands r1, r0 + adds r5, r1 + ldr r3, [sp, 0x4] + adds r5, r3 + str r5, [sp, 0xC] + movs r5, 0 + mov r10, r5 + ldr r1, [sp, 0x2C] + ldr r2, [sp, 0x8] + adds r0, r1, r2 + lsls r0, 1 + str r0, [sp, 0x1C] + ldr r5, [sp, 0x28] + adds r0, r5, r3 + lsls r0, 1 + str r0, [sp, 0x20] +_08195668: + movs r5, 0 + mov r0, r10 + lsls r3, r0, 1 + movs r1, 0x1 + add r10, r1 + ldr r2, [sp, 0x1C] + adds r2, r3 + mov r8, r2 +_08195678: + movs r6, 0 + lsls r7, r5, 1 + adds r5, 0x1 + str r5, [sp, 0x3C] + ldr r4, [sp, 0x20] +_08195682: + ldr r5, =gSaveBlock2Ptr + ldr r1, [r5] + ldr r0, =0x00000d64 + adds r1, r0 + mov r2, r8 + adds r0, r1, r2 + ldrh r0, [r0] + ldr r5, =gUnknown_0203BC8C + mov r9, r5 + ldr r2, [r5] + lsls r0, 4 + adds r0, r2 + adds r0, 0x2 + adds r0, r7 + ldrh r0, [r0] + adds r1, r4 + ldrh r1, [r1] + lsls r1, 4 + adds r1, r2 + ldrh r1, [r1] + movs r2, 0x2 + str r3, [sp, 0x34] + bl sub_818FFC0 + ldr r1, [sp, 0x10] + adds r1, r0 + str r1, [sp, 0x10] + adds r4, 0x2 + adds r6, 0x1 + ldr r3, [sp, 0x34] + cmp r6, 0x2 + ble _08195682 + ldr r5, [sp, 0x3C] + cmp r5, 0x3 + ble _08195678 + ldr r2, =gSaveBlock2Ptr + ldr r0, [r2] + ldr r5, [sp, 0x1C] + adds r1, r3, r5 + ldr r2, =0x00000d64 + adds r0, r2 + adds r0, r1 + ldrh r0, [r0] + mov r3, r9 + ldr r1, [r3] + lsls r0, 4 + adds r0, r1 + ldrh r2, [r0] + ldr r0, =gBaseStats + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1] + ldrb r2, [r1, 0x1] + adds r0, r2 + ldrb r5, [r1, 0x2] + adds r0, r5 + ldrb r2, [r1, 0x3] + adds r0, r2 + ldrb r2, [r1, 0x4] + adds r0, r2 + ldrb r1, [r1, 0x5] + adds r0, r1 + movs r1, 0xA + bl __divsi3 + ldr r3, [sp, 0x10] + adds r3, r0 + str r3, [sp, 0x10] + mov r5, r10 + cmp r5, 0x2 + ble _08195668 + bl Random + movs r1, 0x1F + ands r1, r0 + ldr r0, [sp, 0x10] + adds r0, r1 + ldr r1, [sp, 0x8] + adds r0, r1 + str r0, [sp, 0x10] + ldr r2, [sp, 0xC] + cmp r2, r0 + ble _08195784 + ldr r3, =gSaveBlock2Ptr + ldr r1, [r3] + ldr r5, [sp, 0x30] + adds r1, r5 + ldr r0, =0x00000d25 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + ldr r1, [r3] + adds r1, r5 + ldr r3, =0x00000d25 + adds r1, r3 + ldrb r0, [r1] + movs r5, 0x19 + negs r5, r5 + ands r0, r5 + ldr r2, [sp, 0x14] + orrs r0, r2 + strb r0, [r1] + ldr r0, [sp, 0x4] + ldr r1, [sp, 0x8] + ldr r2, [sp] + bl sub_8193ED0 + ldr r3, =gSaveBlock2Ptr + ldr r1, [r3] + movs r5, 0xEC + lsls r5, 4 + adds r1, r5 + ldr r2, [sp, 0x2C] + adds r1, r2 + b _08195874 + .pool +_08195784: + ldr r3, [sp, 0xC] + ldr r5, [sp, 0x10] + cmp r3, r5 + bge _081957DC + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r3, [sp, 0x4] + lsls r2, r3, 2 + adds r1, r2 + ldr r5, =0x00000d25 + adds r1, r5 + ldrb r0, [r1] + movs r3, 0x4 + orrs r0, r3 + strb r0, [r1] + ldr r5, =gSaveBlock2Ptr + ldr r1, [r5] + adds r1, r2 + ldr r0, =0x00000d25 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x19 + negs r2, r2 + ands r0, r2 + ldr r3, [sp, 0x14] + orrs r0, r3 + strb r0, [r1] + ldr r0, [sp, 0x8] + ldr r1, [sp, 0x4] + ldr r2, [sp] + bl sub_8193ED0 + ldr r1, [r5] + movs r5, 0xEC + lsls r5, 4 + adds r1, r5 + ldr r2, [sp, 0x28] + adds r1, r2 + b _08195874 + .pool +_081957DC: + ldr r3, [sp, 0x4] + ldr r5, [sp, 0x8] + cmp r3, r5 + ble _08195830 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r2, [sp, 0x30] + adds r1, r2 + ldr r3, =0x00000d25 + adds r1, r3 + ldrb r0, [r1] + movs r5, 0x4 + orrs r0, r5 + strb r0, [r1] + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + adds r1, r2 + adds r1, r3 + ldrb r0, [r1] + movs r2, 0x19 + negs r2, r2 + ands r0, r2 + ldr r3, [sp, 0x14] + orrs r0, r3 + strb r0, [r1] + ldr r0, [sp, 0x4] + ldr r1, [sp, 0x8] + ldr r2, [sp] + bl sub_8193ED0 + ldr r5, =gSaveBlock2Ptr + ldr r1, [r5] + movs r2, 0xEC + lsls r2, 4 + adds r1, r2 + ldr r3, [sp, 0x2C] + b _08195872 + .pool +_08195830: + ldr r5, =gSaveBlock2Ptr + ldr r1, [r5] + ldr r0, [sp, 0x4] + lsls r2, r0, 2 + adds r1, r2 + ldr r3, =0x00000d25 + adds r1, r3 + ldrb r0, [r1] + movs r5, 0x4 + orrs r0, r5 + strb r0, [r1] + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + adds r1, r2 + adds r1, r3 + ldrb r0, [r1] + movs r2, 0x19 + negs r2, r2 + ands r0, r2 + ldr r3, [sp, 0x14] + orrs r0, r3 + strb r0, [r1] + ldr r0, [sp, 0x8] + ldr r1, [sp, 0x4] + ldr r2, [sp] + bl sub_8193ED0 + ldr r5, =gSaveBlock2Ptr + ldr r1, [r5] + movs r2, 0xEC + lsls r2, 4 + adds r1, r2 + ldr r3, [sp, 0x28] +_08195872: + adds r1, r3 +_08195874: + strh r0, [r1] +_08195876: + ldr r5, [sp, 0x24] + cmp r5, 0xF + bgt _0819587E + b _0819545E +_0819587E: + add sp, 0x40 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195438 + + thumb_func_start sub_8195898 +sub_8195898: @ 8195898 + push {r4-r6,lr} + adds r6, r0, 0 + lsls r1, 16 + lsrs r5, r1, 16 + movs r4, 0 + bl sub_8165C40 + ldr r0, =0x000003fe + cmp r5, r0 + bne _081958B8 + adds r0, r6, 0 + bl sub_8195938 + b _08195902 + .pool +_081958B8: + ldr r0, =0x000003ff + cmp r5, r0 + bne _081958DC + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] +_081958C2: + adds r0, r6, r4 + adds r1, r2, r4 + ldrb r1, [r1] + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0x6 + ble _081958C2 + b _081958FC + .pool +_081958DC: + ldr r0, =0x0000012b + cmp r5, r0 + bhi _081958FC + ldr r0, =gUnknown_0203BC88 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r5 + adds r0, r1 + adds r2, r0, 0x4 +_081958EE: + adds r0, r6, r4 + adds r1, r2, r4 + ldrb r1, [r1] + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0x6 + ble _081958EE +_081958FC: + adds r1, r6, r4 + movs r0, 0xFF + strb r0, [r1] +_08195902: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195898 + + thumb_func_start sub_8195910 +sub_8195910: @ 8195910 + ldr r0, =gTrainers + ldr r1, =0x00007df3 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_8195910 + + thumb_func_start sub_8195924 +sub_8195924: @ 8195924 + ldr r0, =gTrainers + ldr r1, =0x00007df1 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_8195924 + + thumb_func_start sub_8195938 +sub_8195938: @ 8195938 + push {r4,lr} + adds r3, r0, 0 + movs r2, 0 + ldr r4, =gTrainers + TRAINER_TUCKER * 0x28 + 0x4 @ Tucker's name +_08195940: + adds r0, r3, r2 + adds r1, r2, r4 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x6 + ble _08195940 + adds r1, r3, r2 + movs r0, 0xFF + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195938 + + thumb_func_start sub_8195960 +sub_8195960: @ 8195960 + push {lr} + ldr r1, =gUnknown_0860DE50 + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195960 + + thumb_func_start sub_8195980 +sub_8195980: @ 8195980 + push {r4-r7,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r7, r0, 16 + ldr r0, [r4] + ldr r2, =0x00000ca8 + adds r0, r2 + movs r6, 0 + strb r6, [r0] + ldr r1, [r4] + adds r2, 0xA + adds r0, r1, r2 + strh r6, [r0] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r4] + ldr r2, =0x00000ca9 + adds r1, r2 + ldrb r2, [r1] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r4, [r4] + ldr r0, =0x00000cdc + adds r3, r4, r0 + ldr r2, =gUnknown_0860DE98 + lsls r1, r5, 2 + lsls r0, r7, 3 + adds r1, r0 + adds r1, r2 + ldr r0, [r3] + ldr r1, [r1] + ands r0, r1 + cmp r0, 0 + bne _081959F2 + lsls r0, r5, 1 + lsls r1, r7, 2 + adds r0, r1 + ldr r2, =0x00000dc8 + adds r1, r4, r2 + adds r1, r0 + strh r6, [r1] +_081959F2: + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0x4 + ldrsb r1, [r0, r1] + movs r2, 0x5 + ldrsb r2, [r0, r2] + movs r3, 0x1 + negs r3, r3 + movs r0, 0 + bl saved_warp2_set + ldr r0, =gUnknown_02038BCA + strh r6, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195980 + + thumb_func_start sub_8195A38 +sub_8195A38: @ 8195A38 + push {r4-r7,lr} + ldr r5, =gSaveBlock2Ptr + ldr r0, [r5] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r7, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x1 + beq _08195A90 + cmp r0, 0x1 + bgt _08195A74 + cmp r0, 0 + beq _08195A7A + b _08195AD0 + .pool +_08195A74: + cmp r0, 0x2 + beq _08195AB0 + b _08195AD0 +_08195A7A: + ldr r0, =gScriptResult + ldr r1, [r5] + ldr r2, =0x00000dc6 + adds r1, r2 + ldrh r1, [r1] + strh r1, [r0] + b _08195AD0 + .pool +_08195A90: + ldr r3, =gScriptResult + ldr r0, [r5] + lsls r1, r7, 1 + lsls r2, r6, 2 + adds r1, r2 + ldr r2, =0x00000dc8 + adds r0, r2 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r3] + b _08195AD0 + .pool +_08195AB0: + ldr r4, =gScriptResult + ldr r2, [r5] + ldr r0, =0x00000cdc + adds r2, r0 + ldr r3, =gUnknown_0860DE98 + lsls r0, r7, 2 + lsls r1, r6, 3 + adds r0, r1 + adds r0, r3 + ldr r1, [r2] + ldr r0, [r0] + ands r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + strh r0, [r4] +_08195AD0: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195A38 + + thumb_func_start sub_8195AE4 +sub_8195AE4: @ 8195AE4 + push {r4-r6,lr} + ldr r6, =gSaveBlock2Ptr + ldr r0, [r6] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x1 + beq _08195B3C + cmp r0, 0x1 + bgt _08195B20 + cmp r0, 0 + beq _08195B26 + b _08195BA0 + .pool +_08195B20: + cmp r0, 0x2 + beq _08195B5C + b _08195BA0 +_08195B26: + ldr r0, [r6] + ldr r1, =gSpecialVar_0x8006 + ldrh r1, [r1] + ldr r2, =0x00000dc6 + adds r0, r2 + strh r1, [r0] + b _08195BA0 + .pool +_08195B3C: + ldr r2, [r6] + lsls r0, r5, 1 + lsls r1, r4, 2 + adds r0, r1 + ldr r1, =0x00000dc8 + adds r2, r1 + adds r2, r0 + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + strh r0, [r2] + b _08195BA0 + .pool +_08195B5C: + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + cmp r0, 0 + beq _08195B88 + ldr r2, [r6] + ldr r0, =0x00000cdc + adds r2, r0 + ldr r3, =gUnknown_0860DE98 + lsls r1, r5, 2 + lsls r0, r4, 3 + adds r1, r0 + adds r1, r3 + ldr r0, [r2] + ldr r1, [r1] + orrs r0, r1 + b _08195B9E + .pool +_08195B88: + ldr r2, [r6] + ldr r1, =0x00000cdc + adds r2, r1 + ldr r3, =gUnknown_0860DEA8 + lsls r1, r5, 2 + lsls r0, r4, 3 + adds r1, r0 + adds r1, r3 + ldr r0, [r2] + ldr r1, [r1] + ands r0, r1 +_08195B9E: + str r0, [r2] +_08195BA0: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195AE4 + + thumb_func_start sub_8195BB0 +sub_8195BB0: @ 8195BB0 + push {r4,lr} + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + ldr r1, =gSaveBlock2Ptr + ldr r2, [r1] + ldr r3, =0x00000ca9 + adds r1, r2, r3 + ldrb r1, [r1] + lsls r1, 30 + lsrs r1, 29 + lsrs r0, 14 + adds r1, r0 + ldr r0, =0x00000dc8 + adds r2, r0 + adds r2, r1 + ldrh r0, [r2] + cmp r0, 0x31 + bhi _08195C00 + ldr r4, =gScriptResult + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + strh r0, [r4] + b _08195C16 + .pool +_08195C00: + cmp r0, 0x62 + bhi _08195C10 + ldr r1, =gScriptResult + movs r0, 0x3 + b _08195C14 + .pool +_08195C10: + ldr r1, =gScriptResult + movs r0, 0x4 +_08195C14: + strh r0, [r1] +_08195C16: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195BB0 + + thumb_func_start sub_8195C20 +sub_8195C20: @ 8195C20 + push {r4,lr} + ldr r4, =gUnknown_02038BCA + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xFF + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + lsls r1, r0, 2 + adds r1, r0 + lsrs r1, 6 + strh r1, [r4] + ldrh r0, [r4] + movs r1, 0 + bl sub_8162614 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195C20 + + thumb_func_start sub_8195C50 +sub_8195C50: @ 8195C50 + push {lr} + ldr r3, =gUnknown_02038BCA + ldrh r1, [r3] + ldr r0, =0x0000012b + cmp r1, r0 + bhi _08195C6C + ldr r2, =gUnknown_0203BC88 + movs r0, 0x34 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0xC + bl ConvertBattleFrontierTrainerSpeechToString +_08195C6C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195C50 + + thumb_func_start sub_8195C7C +sub_8195C7C: @ 8195C7C + push {r4-r7,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r7, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 24 + ldr r4, [r4] + lsls r1, r7, 1 + lsrs r5, r0, 22 + adds r1, r5 + ldr r3, =0x00000dc8 + adds r6, r4, r3 + adds r3, r6, r1 + ldrh r2, [r3] + ldr r0, =0x0000270e + cmp r2, r0 + bhi _08195CCA + adds r2, 0x1 + strh r2, [r3] + movs r3, 0xDD + lsls r3, 4 + adds r0, r4, r3 + adds r1, r0, r1 + adds r0, r5, 0 + ldrh r3, [r1] + cmp r7, r3 + bls _08195CC0 + adds r0, 0x2 +_08195CC0: + adds r0, r6, r0 + ldrh r0, [r0] + cmp r0, 0 + beq _08195CCA + strh r2, [r1] +_08195CCA: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195C7C + + thumb_func_start sub_8195CE4 +sub_8195CE4: @ 8195CE4 + push {r4,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =gSpecialVar_0x8005 + ldrh r1, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + strb r1, [r0] + movs r0, 0x80 + lsls r0, 7 + movs r1, 0 + bl VarSet + ldr r1, [r4] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl sub_81A4C30 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195CE4 + + thumb_func_start sub_8195D28 +sub_8195D28: @ 8195D28 + push {r4,r5,lr} + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + ldr r4, =gSaveBlock2Ptr + ldr r2, [r4] + ldr r3, =0x00000ca9 + adds r1, r2, r3 + ldrb r1, [r1] + lsls r1, 30 + lsrs r1, 29 + lsrs r0, 14 + adds r1, r0 + ldr r0, =0x00000dc8 + adds r2, r0 + adds r2, r1 + ldrh r0, [r2] + cmp r0, 0x29 + bls _08195D88 + bl Random + ldr r4, [r4] + ldr r5, =gUnknown_0860DE84 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x9 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 15 + adds r0, r5 + ldrh r0, [r0] + ldr r1, =0x00000dc6 + adds r4, r1 + b _08195DA6 + .pool +_08195D88: + bl Random + ldr r4, [r4] + ldr r5, =gUnknown_0860DE78 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x6 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 15 + adds r0, r5 + ldrh r0, [r0] + ldr r3, =0x00000dc6 + adds r4, r3 +_08195DA6: + strh r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195D28 + + thumb_func_start sub_8195DB8 +sub_8195DB8: @ 8195DB8 + push {r4,r5,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000dc6 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x1 + bl AddBagItem + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bne _08195E00 + ldr r0, [r4] + ldr r1, =0x00000dc6 + adds r0, r1 + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r0, [r4] + ldr r1, =0x00000dc6 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + ldr r0, =gScriptResult + strh r5, [r0] + b _08195E06 + .pool +_08195E00: + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] +_08195E06: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195DB8 + + thumb_func_start sub_8195E10 +sub_8195E10: @ 8195E10 + push {lr} + bl RtcCalcLocalTime + ldr r0, =gLocalTime + bl sub_8195E34 + ldr r1, =gUnknown_0203CD80 + adds r0, 0xA + str r0, [r1] + movs r0, 0 + strb r0, [r1, 0x6] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8195E10 + + thumb_func_start sub_8195E34 +sub_8195E34: @ 8195E34 + adds r3, r0, 0 + movs r1, 0 + ldrsh r0, [r3, r1] + lsls r1, r0, 1 + adds r1, r0 + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 5 + movs r2, 0x2 + ldrsb r2, [r3, r2] + lsls r1, r2, 4 + subs r1, r2 + lsls r1, 2 + adds r0, r1 + movs r1, 0x3 + ldrsb r1, [r3, r1] + adds r0, r1 + bx lr + thumb_func_end sub_8195E34 + + thumb_func_start sub_8195E58 +sub_8195E58: @ 8195E58 + push {lr} + bl RtcCalcLocalTime + ldr r0, =gLocalTime + bl sub_8195E34 + adds r1, r0, 0 + ldr r2, =gUnknown_0203CD80 + ldr r0, [r2] + cmp r0, r1 + bhi _08195E74 + subs r0, r1, r0 + cmp r0, 0x9 + bls _08195E84 +_08195E74: + str r1, [r2] + movs r0, 0x1 + b _08195E86 + .pool +_08195E84: + movs r0, 0 +_08195E86: + pop {r1} + bx r1 + thumb_func_end sub_8195E58 + + thumb_func_start sub_8195E8C +sub_8195E8C: @ 8195E8C + push {r4,r5,lr} + movs r5, 0x1 + ldr r4, =gPlayerParty + adds r0, r4, 0 + movs r1, 0x6 + bl GetMonData + cmp r0, 0 + bne _08195EAE + adds r0, r4, 0 + bl GetMonAbility + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1F + bne _08195EAE + movs r5, 0x2 +_08195EAE: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + lsls r1, r5, 1 + adds r1, r5 + cmp r0, r1 + blt _08195ED0 + movs r0, 0 + b _08195ED2 + .pool +_08195ED0: + movs r0, 0x1 +_08195ED2: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8195E8C + + thumb_func_start sub_8195ED8 +sub_8195ED8: @ 8195ED8 + push {r4,lr} + ldr r4, =gUnknown_02037318 + ldrb r0, [r4, 0x17] + bl is_light_level_1_2_3_or_6 + lsls r0, 24 + cmp r0, 0 + beq _08195F30 + ldrb r0, [r4, 0x14] + cmp r0, 0x39 + beq _08195F30 + cmp r0, 0xE + bne _08195F0E + movs r0, 0xF9 + lsls r0, 2 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08195F0E + movs r0, 0xDC + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _08195F30 +_08195F0E: + ldr r0, =gUnknown_02037318 + ldrb r0, [r0, 0x14] + cmp r0, 0x38 + bne _08195F38 + movs r0, 0xCF + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08195F38 + movs r0, 0x8B + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _08195F38 +_08195F30: + movs r0, 0 + b _08195F3A + .pool +_08195F38: + movs r0, 0x1 +_08195F3A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8195ED8 + + thumb_func_start sub_8195F40 +sub_8195F40: @ 8195F40 + push {lr} + ldr r1, =gUnknown_0203CD80 + ldrb r0, [r1, 0x6] + adds r0, 0x1 + strb r0, [r1, 0x6] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x9 + bhi _08195F5C + movs r0, 0 + b _08195F62 + .pool +_08195F5C: + movs r0, 0 + strb r0, [r1, 0x6] + movs r0, 0x1 +_08195F62: + pop {r1} + bx r1 + thumb_func_end sub_8195F40 + + thumb_func_start sub_8195F68 +sub_8195F68: @ 8195F68 + push {r4,lr} + bl sub_8195FCC + adds r4, r0, 0 + cmp r4, 0 + beq _08195FB8 + bl Random + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl __umodsi3 + bl sub_8195FF8 + ldr r2, =gUnknown_0203CD80 + movs r1, 0 + strh r0, [r2, 0x4] + strb r1, [r2, 0x7] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x4E + beq _08195FB8 + ldrh r0, [r2, 0x4] + bl sub_8196844 + adds r4, r0, 0 + bl sub_819672C + ldr r1, =gUnknown_02037318 + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r1, 0x14] + cmp r0, r1 + bne _08195FC4 + adds r0, r4, 0 + bl sub_8196710 + cmp r0, 0 + bne _08195FC4 +_08195FB8: + movs r0, 0 + b _08195FC6 + .pool +_08195FC4: + movs r0, 0x1 +_08195FC6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8195F68 + + thumb_func_start sub_8195FCC +sub_8195FCC: @ 8195FCC + push {r4,r5,lr} + movs r4, 0 + movs r5, 0 +_08195FD2: + movs r1, 0xAE + lsls r1, 1 + adds r0, r4, r1 + lsls r0, 16 + lsrs r0, 16 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _08195FE8 + adds r5, 0x1 +_08195FE8: + adds r4, 0x1 + cmp r4, 0x3F + bls _08195FD2 + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8195FCC + + thumb_func_start sub_8195FF8 +sub_8195FF8: @ 8195FF8 + push {r4-r6,lr} + adds r5, r0, 0 + movs r4, 0 + ldr r6, =gUnknown_085500A4 +_08196000: + movs r1, 0xAE + lsls r1, 1 + adds r0, r4, r1 + lsls r0, 16 + lsrs r0, 16 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _08196022 + cmp r5, 0 + bne _08196020 + ldrh r0, [r6] + b _0819602C + .pool +_08196020: + subs r5, 0x1 +_08196022: + adds r6, 0x10 + adds r4, 0x1 + cmp r4, 0x3F + bls _08196000 + movs r0, 0x4E +_0819602C: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8195FF8 + + thumb_func_start sub_8196034 +sub_8196034: @ 8196034 + push {lr} + ldr r0, =0x0000012f + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _08196078 + bl sub_8195F40 + cmp r0, 0 + beq _08196078 + bl sub_8195E58 + cmp r0, 0 + beq _08196078 + bl sub_8195E8C + cmp r0, 0 + beq _08196078 + bl sub_8195ED8 + cmp r0, 0 + beq _08196078 + bl sub_8195F68 + cmp r0, 0 + beq _08196078 + bl task_prev_quest + movs r0, 0x1 + b _0819607A + .pool +_08196078: + movs r0, 0 +_0819607A: + pop {r1} + bx r1 + thumb_func_end sub_8196034 + + thumb_func_start sub_8196080 +sub_8196080: @ 8196080 + push {lr} + ldr r1, =gUnknown_0203CD80 + movs r0, 0x1 + strb r0, [r1, 0x7] + bl task_prev_quest + pop {r0} + bx r0 + .pool + thumb_func_end sub_8196080 + + thumb_func_start sub_8196094 +sub_8196094: @ 8196094 + push {lr} + ldr r0, =sub_81960E0 + bl FuncIsActiveTask + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8196094 + + thumb_func_start task_prev_quest +task_prev_quest: @ 81960A8 + push {lr} + ldr r0, =gUnknown_0203CD80 + ldrb r0, [r0, 0x7] + cmp r0, 0 + bne _081960C2 + bl script_env_2_enable + bl player_bitmagic + bl sub_808B864 + bl sub_808BCF4 +_081960C2: + ldr r0, =0x00000107 + bl PlaySE + ldr r0, =sub_81960E0 + movs r1, 0x1 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end task_prev_quest + + thumb_func_start sub_81960E0 +sub_81960E0: @ 81960E0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + ldr r1, =gUnknown_0860EF78 + movs r2, 0 + ldrsh r0, [r4, r2] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r5, 0 + bl _call_via_r1 + cmp r0, 0 + beq _0819611E + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + movs r1, 0 + strh r1, [r4, 0x2] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x7 + bls _0819611E + adds r0, r5, 0 + bl DestroyTask +_0819611E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81960E0 + + thumb_func_start sub_819612C +sub_819612C: @ 819612C + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r5, r0, r1 + ldr r0, =gUnknown_0860EF98 + bl AddWindow + strh r0, [r5, 0x4] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xFF + bne _0819615C + adds r0, r4, 0 + b _081961E0 + .pool +_0819615C: + ldr r1, =gUnknown_0860EA6C + movs r2, 0x80 + lsls r2, 1 + movs r3, 0x9C + lsls r3, 2 + movs r0, 0 + bl LoadBgTiles + lsls r0, 16 + ldr r1, =0xffff0000 + cmp r0, r1 + bne _08196188 + ldrb r0, [r5, 0x4] + bl RemoveWindow + adds r0, r4, 0 + b _081961E0 + .pool +_08196188: + ldr r1, =gUnknown_0860EB8C + ldr r3, =0x00000279 + movs r0, 0 + str r0, [sp] + movs r2, 0 + bl decompress_and_copy_tile_data_to_vram + cmp r0, 0 + beq _081961D8 + ldrb r0, [r5, 0x4] + movs r1, 0x88 + bl FillWindowPixelBuffer + ldr r0, =gUnknown_0860EA4C + movs r1, 0xE0 + movs r2, 0x20 + bl LoadPalette + ldr r0, =gUnknown_0860EB6C + movs r1, 0xF0 + movs r2, 0x20 + bl LoadPalette + ldr r1, =0xffffe000 + movs r0, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x1 + b _081961E6 + .pool +_081961D8: + ldrb r0, [r5, 0x4] + bl RemoveWindow + adds r0, r6, 0 +_081961E0: + bl DestroyTask + movs r0, 0 +_081961E6: + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_819612C + + thumb_func_start sub_81961F0 +sub_81961F0: @ 81961F0 + push {r4,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r4, r1, r0 + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + bne _08196268 + ldrb r0, [r4, 0x4] + bl PutWindowTilemap + movs r1, 0x4 + ldrsh r0, [r4, r1] + movs r1, 0x9C + lsls r1, 2 + movs r2, 0xE + bl sub_819645C + ldr r1, =0x0000f279 + movs r0, 0x4 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x1 + str r0, [sp, 0xC] + movs r0, 0 + movs r2, 0x1 + movs r3, 0xF + bl WriteSequenceToBgTilemapBuffer + ldr r0, =sub_8196694 + movs r1, 0xA + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0xA] + ldrb r0, [r4, 0x4] + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0 + bl CopyBgTilemapBufferToVram + movs r0, 0x1 + b _0819626A + .pool +_08196268: + movs r0, 0 +_0819626A: + add sp, 0x10 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81961F0 + + thumb_func_start sub_8196274 +sub_8196274: @ 8196274 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r4, r1, r0 + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + beq _08196298 + movs r0, 0 + b _081962A4 + .pool +_08196298: + movs r1, 0x4 + ldrsh r0, [r4, r1] + ldr r1, =gUnknown_0860EF70 + bl sub_81965D8 + movs r0, 0x1 +_081962A4: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8196274 + + thumb_func_start sub_81962B0 +sub_81962B0: @ 81962B0 + push {lr} + movs r1, 0xC0 + lsls r1, 3 + movs r0, 0 + movs r2, 0x1 + bl ChangeBgY + cmp r0, 0 + bge _081962C6 + movs r0, 0 + b _081962D2 +_081962C6: + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x1 +_081962D2: + pop {r1} + bx r1 + thumb_func_end sub_81962B0 + + thumb_func_start sub_81962D8 +sub_81962D8: @ 81962D8 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r4, r1, r0 + movs r1, 0x4 + ldrsh r0, [r4, r1] + bl sub_8196648 + cmp r0, 0 + bne _08196328 + ldrb r0, [r4, 0x4] + movs r1, 0x88 + bl FillWindowPixelBuffer + ldr r1, =gUnknown_0203CD80 + ldrb r0, [r1, 0x7] + cmp r0, 0 + bne _0819630C + ldrh r0, [r1, 0x4] + ldr r1, =gStringVar4 + bl sub_81967AC +_0819630C: + movs r1, 0x4 + ldrsh r0, [r4, r1] + ldr r1, =gStringVar4 + bl sub_81965D8 + movs r0, 0x1 + b _0819632A + .pool +_08196328: + movs r0, 0 +_0819632A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81962D8 + + thumb_func_start sub_8196330 +sub_8196330: @ 8196330 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r4, r1, r0 + movs r1, 0x4 + ldrsh r0, [r4, r1] + bl sub_8196648 + cmp r0, 0 + bne _08196388 + bl IsSEPlaying + lsls r0, 24 + cmp r0, 0 + bne _08196388 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _08196388 + ldrb r0, [r4, 0x4] + movs r1, 0x88 + bl FillWindowPixelBuffer + ldrb r0, [r4, 0x4] + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0x84 + lsls r0, 1 + bl PlaySE + movs r0, 0x1 + b _0819638A + .pool +_08196388: + movs r0, 0 +_0819638A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8196330 + + thumb_func_start sub_8196390 +sub_8196390: @ 8196390 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r4, r1, r0 + movs r1, 0xC0 + lsls r1, 3 + movs r0, 0 + movs r2, 0x2 + bl ChangeBgY + ldr r1, =0xffffe000 + cmp r0, r1 + ble _081963C0 + movs r0, 0 + b _081963E8 + .pool +_081963C0: + movs r0, 0x1E + str r0, [sp] + movs r0, 0x6 + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0xE + bl FillBgTilemapBufferRect_Palette0 + ldrb r0, [r4, 0xA] + bl DestroyTask + ldrb r0, [r4, 0x4] + bl RemoveWindow + movs r0, 0 + bl CopyBgTilemapBufferToVram + movs r0, 0x1 +_081963E8: + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8196390 + + thumb_func_start sub_81963F0 +sub_81963F0: @ 81963F0 + push {lr} + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _08196454 + bl IsSEPlaying + lsls r0, 24 + cmp r0, 0 + bne _08196454 + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + ldr r0, =gUnknown_0203CD80 + ldrb r0, [r0, 0x7] + cmp r0, 0 + bne _08196446 + bl sub_81973A4 + movs r0, 0xFF + movs r1, 0 + movs r2, 0 + bl GetFieldObjectIdByLocalIdAndMap + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + adds r0, r1 + bl FieldObjectClearAnimIfSpecialAnimFinished + bl sub_80D338C + bl sub_809757C + bl script_env_2_disable +_08196446: + movs r0, 0x1 + b _08196456 + .pool +_08196454: + movs r0, 0 +_08196456: + pop {r1} + bx r1 + thumb_func_end sub_81963F0 + + thumb_func_start sub_819645C +sub_819645C: @ 819645C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + adds r4, r0, 0 + adds r5, r1, 0 + adds r7, r2, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0 + bl GetWindowAttribute + mov r9, r0 + adds r0, r4, 0 + movs r1, 0x1 + bl GetWindowAttribute + str r0, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x2 + bl GetWindowAttribute + str r0, [sp, 0xC] + adds r0, r4, 0 + movs r1, 0x3 + bl GetWindowAttribute + adds r6, r0, 0 + adds r0, r4, 0 + movs r1, 0x4 + bl GetWindowAttribute + str r0, [sp, 0x10] + mov r0, r9 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r1, 0xA + bl GetBgAttribute + lsls r0, 16 + lsrs r0, 16 + adds r5, r0 + lsls r7, 12 + movs r1, 0xF0 + lsls r1, 8 + adds r0, r1, 0 + ands r7, r0 + adds r1, r7, 0 + orrs r1, r5 + lsls r1, 16 + lsrs r1, 16 + ldr r2, [sp, 0x8] + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + mov r10, r2 + ldr r4, [sp, 0xC] + subs r4, 0x1 + lsls r4, 24 + lsrs r4, 24 + movs r3, 0x1 + mov r8, r3 + str r3, [sp] + str r3, [sp, 0x4] + mov r0, r9 + adds r3, r4, 0 + bl FillBgTilemapBufferRect_Palette0 + adds r1, r5, 0x1 + orrs r1, r7 + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x8] + lsls r2, r0, 24 + lsrs r2, 24 + str r2, [sp, 0x14] + lsls r0, r6, 24 + lsrs r0, 24 + str r0, [sp, 0x18] + str r0, [sp] + mov r2, r8 + str r2, [sp, 0x4] + mov r0, r9 + ldr r2, [sp, 0x14] + adds r3, r4, 0 + bl FillBgTilemapBufferRect_Palette0 + adds r1, r5, 0x2 + orrs r1, r7 + lsls r1, 16 + lsrs r1, 16 + ldr r3, [sp, 0x8] + adds r0, r3, r6 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x1C] + mov r0, r8 + str r0, [sp] + str r0, [sp, 0x4] + mov r0, r9 + ldr r2, [sp, 0x1C] + adds r3, r4, 0 + bl FillBgTilemapBufferRect_Palette0 + adds r1, r5, 0x3 + orrs r1, r7 + lsls r1, 16 + lsrs r1, 16 + ldr r2, [sp, 0xC] + lsls r6, r2, 24 + lsrs r6, 24 + mov r3, r8 + str r3, [sp] + ldr r0, [sp, 0x10] + lsls r4, r0, 24 + lsrs r4, 24 + str r4, [sp, 0x4] + mov r0, r9 + mov r2, r10 + adds r3, r6, 0 + bl FillBgTilemapBufferRect_Palette0 + adds r1, r5, 0x4 + orrs r1, r7 + lsls r1, 16 + lsrs r1, 16 + mov r2, r8 + str r2, [sp] + str r4, [sp, 0x4] + mov r0, r9 + ldr r2, [sp, 0x1C] + adds r3, r6, 0 + bl FillBgTilemapBufferRect_Palette0 + adds r1, r5, 0x5 + orrs r1, r7 + lsls r1, 16 + lsrs r1, 16 + ldr r3, [sp, 0xC] + ldr r2, [sp, 0x10] + adds r0, r3, r2 + lsls r0, 24 + lsrs r4, r0, 24 + mov r3, r8 + str r3, [sp] + str r3, [sp, 0x4] + mov r0, r9 + mov r2, r10 + adds r3, r4, 0 + bl FillBgTilemapBufferRect_Palette0 + adds r1, r5, 0x6 + orrs r1, r7 + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x18] + str r0, [sp] + mov r2, r8 + str r2, [sp, 0x4] + mov r0, r9 + ldr r2, [sp, 0x14] + adds r3, r4, 0 + bl FillBgTilemapBufferRect_Palette0 + adds r5, 0x7 + orrs r5, r7 + lsls r5, 16 + lsrs r5, 16 + mov r3, r8 + str r3, [sp] + str r3, [sp, 0x4] + mov r0, r9 + adds r1, r5, 0 + ldr r2, [sp, 0x1C] + adds r3, r4, 0 + bl FillBgTilemapBufferRect_Palette0 + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819645C + + thumb_func_start sub_81965D8 +sub_81965D8: @ 81965D8 + push {lr} + sub sp, 0x10 + str r1, [sp] + mov r1, sp + movs r3, 0 + strb r0, [r1, 0x4] + mov r0, sp + movs r1, 0x1 + strb r1, [r0, 0x5] + movs r2, 0x20 + strb r2, [r0, 0x6] + strb r1, [r0, 0x7] + strb r2, [r0, 0x8] + strb r1, [r0, 0x9] + strb r3, [r0, 0xA] + strb r3, [r0, 0xB] + mov r3, sp + ldrb r2, [r3, 0xC] + subs r1, 0x11 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3, 0xC] + mov r2, sp + movs r3, 0xF + movs r0, 0xA0 + strb r0, [r2, 0xC] + ldrb r0, [r2, 0xD] + ands r1, r0 + movs r0, 0x8 + orrs r1, r0 + strb r1, [r2, 0xD] + ands r1, r3 + movs r0, 0xE0 + orrs r1, r0 + strb r1, [r2, 0xD] + ldr r2, =gTextFlags + ldrb r1, [r2] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + bl sav2_get_text_speed + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, sp + movs r2, 0 + bl AddTextPrinter + add sp, 0x10 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81965D8 + + thumb_func_start sub_8196648 +sub_8196648: @ 8196648 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =gMain + ldrh r1, [r0, 0x2C] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0819666C + ldr r0, =gTextFlags + ldrb r1, [r0] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0] + b _08196678 + .pool +_0819666C: + ldr r2, =gTextFlags + ldrb r1, [r2] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_08196678: + bl RunTextPrinters + lsls r0, r4, 24 + lsrs r0, 24 + bl IsTextPrinterActive + lsls r0, 16 + lsrs r0, 16 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8196648 + + thumb_func_start sub_8196694 +sub_8196694: @ 8196694 + push {lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r2, r1, r0 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + ble _081966FC + movs r1, 0 + strh r1, [r2] + ldrh r0, [r2, 0x2] + adds r0, 0x1 + strh r0, [r2, 0x2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _081966C8 + strh r1, [r2, 0x2] +_081966C8: + movs r0, 0x2 + ldrsh r1, [r2, r0] + lsls r1, 4 + ldr r0, =0x00000279 + adds r1, r0 + strh r1, [r2, 0x4] + ldr r2, =0xfffff000 + adds r0, r2, 0 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x4 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x1 + str r0, [sp, 0xC] + movs r0, 0 + movs r2, 0x1 + movs r3, 0xF + bl WriteSequenceToBgTilemapBuffer + movs r0, 0 + bl CopyBgTilemapBufferToVram +_081966FC: + add sp, 0x10 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8196694 + + thumb_func_start sub_8196710 +sub_8196710: @ 8196710 + ldr r1, =gSaveBlock1Ptr + ldr r1, [r1] + ldr r2, =0x000009ca + adds r1, r2 + adds r1, r0 + ldrb r1, [r1] + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + bx lr + .pool + thumb_func_end sub_8196710 + + thumb_func_start sub_819672C +sub_819672C: @ 819672C + push {lr} + ldr r1, =gUnknown_085500A4 + lsls r0, 4 + adds r0, r1 + ldrh r2, [r0, 0xA] + ldrh r1, [r0, 0xC] + adds r0, r2, 0 + bl get_mapheader_by_bank_and_number + ldrb r0, [r0, 0x14] + pop {r1} + bx r1 + .pool + thumb_func_end sub_819672C + + thumb_func_start sub_8196748 +sub_8196748: @ 8196748 + push {r4-r6,lr} + movs r5, 0 + movs r6, 0 + ldr r4, =gUnknown_085500A4 +_08196750: + ldrh r0, [r4] + bl trainer_flag_check + lsls r0, 24 + cmp r0, 0 + beq _0819675E + adds r6, 0x1 +_0819675E: + adds r4, 0x10 + adds r5, 0x1 + cmp r5, 0x3F + bls _08196750 + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8196748 + + thumb_func_start sub_8196774 +sub_8196774: @ 8196774 + push {r4-r7,lr} + adds r7, r0, 0 + movs r4, 0 + movs r6, 0 + ldr r5, =gUnknown_085500A4 +_0819677E: + ldrh r0, [r5] + bl trainer_flag_check + lsls r0, 24 + cmp r0, 0 + beq _0819679A + cmp r6, r7 + bne _08196798 + adds r0, r4, 0 + b _081967A4 + .pool +_08196798: + adds r6, 0x1 +_0819679A: + adds r5, 0x10 + adds r4, 0x1 + cmp r4, 0x4D + bls _0819677E + movs r0, 0x4E +_081967A4: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8196774 + + thumb_func_start sub_81967AC +sub_81967AC: @ 81967AC + push {r4-r7,lr} + adds r6, r1, 0 + movs r7, 0 + bl sub_8196844 + adds r5, r0, 0 + ldr r0, =gUnknown_0203CD88 + strh r7, [r0] + adds r0, r5, 0 + bl sub_8196710 + cmp r0, 0 + beq _081967EC + adds r0, r5, 0 + bl sub_819672C + ldr r1, =gUnknown_02037318 + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r1, 0x14] + cmp r0, r1 + bne _081967EC + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_8196864 + b _08196830 + .pool +_081967EC: + adds r0, r5, 0 + bl sub_8196D74 + cmp r0, 0 + beq _0819680A + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_8196890 + adds r4, r0, 0 + movs r7, 0x1 + adds r0, r5, 0 + bl sub_80B1E94 + b _08196832 +_0819680A: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + beq _08196828 + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_81968BC + b _08196830 +_08196828: + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_8196910 +_08196830: + adds r4, r0, 0 +_08196832: + adds r0, r5, 0 + adds r1, r4, 0 + adds r2, r6, 0 + bl sub_81969E0 + adds r0, r7, 0 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81967AC + + thumb_func_start sub_8196844 +sub_8196844: @ 8196844 + push {lr} + adds r3, r0, 0 + movs r2, 0 + ldr r1, =gUnknown_0860DEB8 +_0819684C: + ldrh r0, [r1] + cmp r0, r3 + beq _0819685C + adds r1, 0x14 + adds r2, 0x1 + b _0819684C + .pool +_0819685C: + adds r0, r2, 0 + pop {r1} + bx r1 + thumb_func_end sub_8196844 + + thumb_func_start sub_8196864 +sub_8196864: @ 8196864 + ldr r2, =gUnknown_0860DEB8 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrh r1, [r1, 0xE] + movs r2, 0xFF + lsrs r0, r1, 8 + subs r0, 0x1 + ands r1, r2 + subs r1, 0x1 + ldr r2, =gUnknown_0860EA2C + lsls r0, 2 + adds r0, r2 + lsls r1, 3 + ldr r0, [r0] + adds r0, r1 + bx lr + .pool + thumb_func_end sub_8196864 + + thumb_func_start sub_8196890 +sub_8196890: @ 8196890 + ldr r2, =gUnknown_0860DEB8 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrh r1, [r1, 0x10] + movs r2, 0xFF + lsrs r0, r1, 8 + subs r0, 0x1 + ands r1, r2 + subs r1, 0x1 + ldr r2, =gUnknown_0860EA2C + lsls r0, 2 + adds r0, r2 + lsls r1, 3 + ldr r0, [r0] + adds r0, r1 + bx lr + .pool + thumb_func_end sub_8196890 + + thumb_func_start sub_81968BC +sub_81968BC: @ 81968BC + push {r4,lr} + adds r4, r0, 0 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 16 + ldr r2, =gUnknown_0860DEB8 + lsrs r0, 15 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 2 + adds r0, r1 + adds r2, 0x4 + adds r0, r2 + ldrh r4, [r0] + cmp r4, 0 + bne _081968EC + movs r0, 0 + bl SpriteCallbackDummy +_081968EC: + movs r1, 0xFF + lsrs r0, r4, 8 + subs r0, 0x1 + ands r4, r1 + subs r1, r4, 0x1 + ldr r2, =gUnknown_0860EA20 + lsls r0, 2 + adds r0, r2 + lsls r1, 3 + ldr r0, [r0] + adds r0, r1 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81968BC + + thumb_func_start sub_8196910 +sub_8196910: @ 8196910 + push {r4-r7,lr} + sub sp, 0x4 + adds r6, r0, 0 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081969AC + movs r5, 0 + movs r4, 0 + lsls r7, r6, 2 +_0819692C: + lsls r0, r4, 16 + lsrs r0, 16 + mov r1, sp + bl sub_8196E04 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bls _08196940 + adds r5, 0x1 +_08196940: + adds r4, 0x1 + cmp r4, 0x6 + ble _0819692C + cmp r5, 0 + beq _081969AC + bl Random + lsls r0, 16 + lsrs r0, 16 + adds r1, r5, 0 + bl __modsi3 + adds r5, r0, 0 + movs r4, 0 + b _08196962 +_0819695E: + subs r5, 0x1 +_08196960: + adds r4, 0x1 +_08196962: + cmp r4, 0x6 + bgt _08196980 + lsls r0, r4, 16 + lsrs r0, 16 + mov r1, sp + bl sub_8196E04 + ldr r1, =gUnknown_0203CD88 + strh r0, [r1, 0x2] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bls _08196960 + cmp r5, 0 + bne _0819695E +_08196980: + ldr r0, =gUnknown_0203CD88 + strh r4, [r0] + ldr r1, =gUnknown_0860DEB8 + adds r0, r7, r6 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0xC] + subs r2, r0, 0x1 + ldr r1, =gUnknown_0860EA34 + ldr r0, [sp] + lsls r0, 2 + adds r0, r1 + lsls r1, r2, 3 + ldr r0, [r0] + adds r0, r1 + b _081969D0 + .pool +_081969AC: + ldr r1, =gUnknown_0860DEB8 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 2 + adds r0, r1 + ldrh r2, [r0, 0xA] + lsrs r1, r2, 8 + subs r1, 0x1 + str r1, [sp] + movs r0, 0xFF + ands r0, r2 + subs r2, r0, 0x1 + ldr r0, =gUnknown_0860EA34 + lsls r1, 2 + adds r1, r0 + lsls r2, 3 + ldr r0, [r1] + adds r0, r2 +_081969D0: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8196910 + + thumb_func_start sub_81969E0 +sub_81969E0: @ 81969E0 + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + adds r1, r4, 0x4 + bl sub_81969FC + ldr r1, [r4] + adds r0, r5, 0 + bl StringExpandPlaceholders + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81969E0 + + thumb_func_start sub_81969FC +sub_81969FC: @ 81969FC + push {r4-r7,lr} + adds r7, r0, 0 + adds r6, r1, 0 + movs r4, 0 + ldr r5, =gUnknown_0860EFA0 +_08196A06: + adds r1, r6, r4 + movs r0, 0 + ldrsb r0, [r1, r0] + cmp r0, 0 + blt _08196A1A + adds r1, r0, 0 + ldr r2, [r5] + adds r0, r7, 0 + bl sub_8196A2C +_08196A1A: + adds r5, 0x4 + adds r4, 0x1 + cmp r4, 0x2 + ble _08196A06 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81969FC + + thumb_func_start sub_8196A2C +sub_8196A2C: @ 8196A2C + push {lr} + ldr r3, =gUnknown_0860EFAC + lsls r1, 2 + adds r1, r3 + ldr r3, [r1] + adds r1, r2, 0 + bl _call_via_r3 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8196A2C + + thumb_func_start sub_8196A44 +sub_8196A44: @ 8196A44 + push {r4-r6,lr} + adds r5, r1, 0 + ldr r2, =gUnknown_0860DEB8 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrh r4, [r1] + movs r2, 0 + ldr r3, =gUnknown_0860EFC4 + adds r6, r3, 0 +_08196A5A: + lsls r1, r2, 3 + ldrh r0, [r3] + cmp r0, r4 + bne _08196A78 + adds r0, r6, 0x4 + adds r0, r1, r0 + ldr r1, [r0] + adds r0, r5, 0 + bl StringCopy + b _08196A90 + .pool +_08196A78: + adds r3, 0x8 + adds r2, 0x1 + cmp r2, 0x5 + bls _08196A5A + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + ldr r0, =gTrainers + 0x4 @ name offset + adds r1, r0 + adds r0, r5, 0 + bl StringCopy +_08196A90: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8196A44 + + thumb_func_start sub_8196A9C +sub_8196A9C: @ 8196A9C + push {r4,lr} + adds r4, r1, 0 + bl sub_819672C + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + movs r2, 0 + bl GetMapName + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8196A9C + + thumb_func_start sub_8196AB8 +sub_8196AB8: @ 8196AB8 + push {lr} + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x13 + bgt _08196AD4 + movs r0, 0 + b _08196B4A +_08196AD4: + adds r0, r1, 0 + subs r0, 0x14 + cmp r0, 0x13 + bhi _08196AE0 + movs r0, 0x1 + b _08196B4A +_08196AE0: + adds r0, r1, 0 + subs r0, 0x28 + cmp r0, 0x9 + bhi _08196AEC + movs r0, 0x2 + b _08196B4A +_08196AEC: + adds r0, r1, 0 + subs r0, 0x32 + cmp r0, 0x9 + bhi _08196AF8 + movs r0, 0x3 + b _08196B4A +_08196AF8: + adds r0, r1, 0 + subs r0, 0x3C + cmp r0, 0x9 + bhi _08196B04 + movs r0, 0x4 + b _08196B4A +_08196B04: + adds r0, r1, 0 + subs r0, 0x46 + cmp r0, 0x9 + bhi _08196B10 + movs r0, 0x5 + b _08196B4A +_08196B10: + adds r0, r1, 0 + subs r0, 0x50 + cmp r0, 0x4 + bhi _08196B1C + movs r0, 0x6 + b _08196B4A +_08196B1C: + adds r0, r1, 0 + subs r0, 0x55 + cmp r0, 0x4 + bhi _08196B28 + movs r0, 0x7 + b _08196B4A +_08196B28: + adds r0, r1, 0 + subs r0, 0x5A + cmp r0, 0x3 + bhi _08196B34 + movs r0, 0x8 + b _08196B4A +_08196B34: + adds r0, r1, 0 + subs r0, 0x5E + cmp r0, 0x3 + bhi _08196B40 + movs r0, 0x9 + b _08196B4A +_08196B40: + cmp r1, 0x62 + beq _08196B48 + movs r0, 0xB + b _08196B4A +_08196B48: + movs r0, 0xA +_08196B4A: + pop {r1} + bx r1 + thumb_func_end sub_8196AB8 + + thumb_func_start sub_8196B50 +sub_8196B50: @ 8196B50 + push {lr} + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x3B + bgt _08196B6C + movs r0, 0 + b _08196B92 +_08196B6C: + adds r0, r1, 0 + subs r0, 0x3C + cmp r0, 0x1D + bhi _08196B78 + movs r0, 0x1 + b _08196B92 +_08196B78: + adds r0, r1, 0 + subs r0, 0x5A + cmp r0, 0x4 + bhi _08196B84 + movs r0, 0x2 + b _08196B92 +_08196B84: + adds r0, r1, 0 + subs r0, 0x5F + cmp r0, 0x3 + bls _08196B90 + movs r0, 0x4 + b _08196B92 +_08196B90: + movs r0, 0x3 +_08196B92: + pop {r1} + bx r1 + thumb_func_end sub_8196B50 + + thumb_func_start sub_8196B98 +sub_8196B98: @ 8196B98 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r2, r0, 0 + mov r8, r1 + movs r3, 0 + ldr r0, =gWildMonHeaders + ldrb r1, [r0] + adds r7, r0, 0 + cmp r1, 0xFF + beq _08196C5C + ldr r1, =gUnknown_085500A4 + lsls r0, r2, 4 + adds r2, r0, r1 + ldrh r4, [r2, 0xA] + adds r1, r7, 0 +_08196BBA: + ldrb r0, [r1] + cmp r0, r4 + bne _08196BC8 + ldrb r0, [r1, 0x1] + ldrh r5, [r2, 0xC] + cmp r0, r5 + beq _08196BD2 +_08196BC8: + adds r1, 0x14 + adds r3, 0x1 + ldrb r0, [r1] + cmp r0, 0xFF + bne _08196BBA +_08196BD2: + adds r1, r7, 0 + lsls r0, r3, 2 + adds r0, r3 + lsls r5, r0, 2 + adds r0, r5, r1 + ldrb r0, [r0] + cmp r0, 0xFF + beq _08196C5C + movs r6, 0 + adds r0, r1, 0x4 + adds r0, r5, r0 + ldr r4, [r0] + cmp r4, 0 + beq _08196C02 + bl sub_8196AB8 + lsls r0, 24 + mov r2, sp + ldr r1, [r4, 0x4] + lsrs r0, 22 + adds r0, r1 + ldrh r0, [r0, 0x2] + strh r0, [r2] + movs r6, 0x1 +_08196C02: + adds r0, r7, 0 + adds r0, 0x8 + adds r0, r5, r0 + ldr r4, [r0] + cmp r4, 0 + beq _08196C26 + bl sub_8196B50 + lsls r0, 24 + lsls r1, r6, 1 + mov r3, sp + adds r2, r3, r1 + ldr r1, [r4, 0x4] + lsrs r0, 22 + adds r0, r1 + ldrh r0, [r0, 0x2] + strh r0, [r2] + adds r6, 0x1 +_08196C26: + cmp r6, 0 + beq _08196C5C + bl Random + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl __modsi3 + lsls r0, 1 + add r0, sp + ldrh r1, [r0] + movs r0, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + mov r0, r8 + bl StringCopy + b _08196C62 + .pool +_08196C5C: + movs r0, 0xFF + mov r5, r8 + strb r0, [r5] +_08196C62: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8196B98 + + thumb_func_start sub_8196C70 +sub_8196C70: @ 8196C70 + push {r4-r7,lr} + adds r7, r1, 0 + ldr r2, =gUnknown_0860DEB8 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r1] + bl sub_80B2250 + lsls r0, 16 + lsrs r0, 16 + ldr r5, =gTrainers + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r0, r5, 0 + adds r0, 0x24 + adds r0, r4, r0 + ldr r6, [r0] + bl Random + lsls r0, 16 + lsrs r0, 16 + adds r4, r5 + adds r1, r4, 0 + adds r1, 0x20 + ldrb r1, [r1] + bl __modsi3 + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r4] + cmp r1, 0x1 + beq _08196CD4 + cmp r1, 0x1 + ble _08196CC2 + cmp r1, 0x2 + beq _08196CD0 + cmp r1, 0x3 + beq _08196CD4 +_08196CC2: + lsls r0, 3 + b _08196CD6 + .pool +_08196CD0: + lsls r0, 3 + b _08196CD6 +_08196CD4: + lsls r0, 4 +_08196CD6: + adds r0, r6 + ldrh r1, [r0, 0x4] + movs r0, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + adds r0, r7, 0 + bl StringCopy + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8196C70 + + thumb_func_start sub_8196CF4 +sub_8196CF4: @ 8196CF4 + push {lr} + adds r0, r1, 0 + ldr r2, =gUnknown_0860EFF4 + ldr r1, =gUnknown_0203CD88 + ldrh r1, [r1] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl StringCopy + pop {r0} + bx r0 + .pool + thumb_func_end sub_8196CF4 + + thumb_func_start sub_8196D14 +sub_8196D14: @ 8196D14 + push {r4-r6,lr} + adds r5, r1, 0 + movs r4, 0 + ldr r0, =gUnknown_0203CD88 + ldrh r1, [r0, 0x2] + adds r6, r0, 0 + cmp r1, 0 + beq _08196D34 +_08196D24: + adds r0, r1, 0 + movs r1, 0xA + bl __divsi3 + adds r1, r0, 0 + adds r4, 0x1 + cmp r1, 0 + bne _08196D24 +_08196D34: + ldrh r1, [r6, 0x2] + lsls r3, r4, 24 + lsrs r3, 24 + adds r0, r5, 0 + movs r2, 0 + bl ConvertIntToDecimalStringN + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8196D14 + + thumb_func_start sub_8196D4C +sub_8196D4C: @ 8196D4C + push {r4,r5,lr} + movs r4, 0 + ldr r5, =gUnknown_0860F010 + b _08196D5C + .pool +_08196D58: + adds r5, 0x2 + adds r4, 0x1 +_08196D5C: + cmp r4, 0x7 + bhi _08196D6C + ldrh r0, [r5] + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _08196D58 +_08196D6C: + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8196D4C + + thumb_func_start sub_8196D74 +sub_8196D74: @ 8196D74 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r7, r0, 0 + bl sub_8196D4C + cmp r0, 0x4 + ble _08196DF4 + bl RtcGetLocalDayCount + adds r4, r0, 0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xA + bl sub_80842DC + adds r6, r0, 0 + ldr r0, =0x0000ffff + ands r6, r0 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00002e6a + adds r0, r1 + ldrh r5, [r0] + bl sub_8196748 + mov r9, r0 + movs r0, 0xD + mov r1, r9 + muls r1, r0 + adds r0, r1, 0 + movs r1, 0xA + bl __divsi3 + mov r8, r0 + movs r0, 0x9 + bl GetGameStat + eors r4, r5 + eors r5, r0 + adds r4, r5 + eors r4, r6 + adds r0, r4, 0 + mov r1, r8 + bl __modsi3 + cmp r0, r9 + bge _08196DF4 + bl sub_8196774 + cmp r0, r7 + bne _08196DF4 + movs r0, 0x1 + b _08196DF6 + .pool +_08196DF4: + movs r0, 0 +_08196DF6: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8196D74 + + thumb_func_start sub_8196E04 +sub_8196E04: @ 8196E04 + push {r4-r6,lr} + adds r5, r1, 0 + lsls r0, 16 + lsrs r0, 16 + movs r4, 0 + cmp r0, 0x6 + bls _08196E14 + b _08196F7E +_08196E14: + lsls r0, 2 + ldr r1, =_08196E24 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08196E24: + .4byte _08196E9C + .4byte _08196E40 + .4byte _08196ED0 + .4byte _08196F38 + .4byte _08196E74 + .4byte _08196F04 + .4byte _08196F60 +_08196E40: + movs r3, 0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000d14 + adds r0, r1 +_08196E4A: + lsls r1, r3, 2 + adds r3, 0x1 + adds r1, r0 + movs r2, 0x1 +_08196E52: + ldrh r6, [r1] + cmp r4, r6 + bcs _08196E5A + ldrh r4, [r1] +_08196E5A: + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _08196E52 + cmp r3, 0x1 + ble _08196E4A + movs r0, 0x3 + b _08196F7C + .pool +_08196E74: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000e08 + adds r0, r1 + movs r3, 0x1 +_08196E7E: + ldrh r6, [r0] + cmp r4, r6 + bcs _08196E86 + ldrh r4, [r0] +_08196E86: + adds r0, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _08196E7E + movs r0, 0x4 + b _08196F7C + .pool +_08196E9C: + movs r3, 0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + movs r1, 0xCF + lsls r1, 4 + adds r0, r1 +_08196EA8: + lsls r1, r3, 2 + adds r3, 0x1 + adds r1, r0 + movs r2, 0x1 +_08196EB0: + ldrh r6, [r1] + cmp r4, r6 + bcs _08196EB8 + ldrh r4, [r1] +_08196EB8: + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _08196EB0 + movs r2, 0x2 + cmp r3, 0x3 + ble _08196EA8 + str r2, [r5] + b _08196F7E + .pool +_08196ED0: + movs r3, 0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + movs r1, 0xDD + lsls r1, 4 + adds r0, r1 +_08196EDC: + lsls r1, r3, 2 + adds r3, 0x1 + adds r1, r0 + movs r2, 0x1 +_08196EE4: + ldrh r6, [r1] + cmp r4, r6 + bcs _08196EEC + ldrh r4, [r1] +_08196EEC: + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _08196EE4 + movs r2, 0x2 + cmp r3, 0x1 + ble _08196EDC + str r2, [r5] + b _08196F7E + .pool +_08196F04: + movs r3, 0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000dea + adds r0, r1 +_08196F0E: + lsls r1, r3, 2 + adds r3, 0x1 + adds r1, r0 + movs r2, 0x1 +_08196F16: + ldrh r6, [r1] + cmp r4, r6 + bcs _08196F1E + ldrh r4, [r1] +_08196F1E: + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _08196F16 + movs r2, 0x2 + cmp r3, 0x1 + ble _08196F0E + str r2, [r5] + b _08196F7E + .pool +_08196F38: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000dde + adds r0, r1 + movs r3, 0x1 +_08196F42: + ldrh r6, [r0] + cmp r4, r6 + bcs _08196F4A + ldrh r4, [r0] +_08196F4A: + adds r0, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _08196F42 + movs r3, 0x2 + str r3, [r5] + b _08196F7E + .pool +_08196F60: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000e1e + adds r0, r1 + movs r3, 0x1 +_08196F6A: + ldrh r6, [r0] + cmp r4, r6 + bcs _08196F72 + ldrh r4, [r0] +_08196F72: + adds r0, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _08196F6A + movs r0, 0x5 +_08196F7C: + str r0, [r5] +_08196F7E: + adds r0, r4, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8196E04 + + thumb_func_start sub_8196F90 +sub_8196F90: @ 8196F90 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x9 + bhi _08196F9E + movs r0, 0 + b _0819707A +_08196F9E: + cmp r4, 0x13 + bhi _08196FA6 + movs r0, 0x1 + b _0819707A +_08196FA6: + cmp r4, 0x1D + bhi _08196FAE + movs r0, 0x2 + b _0819707A +_08196FAE: + cmp r4, 0x27 + bhi _08196FB6 + movs r0, 0x3 + b _0819707A +_08196FB6: + cmp r4, 0x31 + bhi _08196FBE + movs r0, 0x4 + b _0819707A +_08196FBE: + cmp r4, 0x3B + bhi _08196FC6 + movs r0, 0x5 + b _0819707A +_08196FC6: + cmp r4, 0x45 + bhi _08196FCE + movs r0, 0x6 + b _0819707A +_08196FCE: + cmp r4, 0x4F + bhi _08196FD6 + movs r0, 0x7 + b _0819707A +_08196FD6: + cmp r4, 0x59 + bhi _08196FDE + movs r0, 0x8 + b _0819707A +_08196FDE: + cmp r4, 0x63 + bhi _08196FE6 + movs r0, 0x9 + b _0819707A +_08196FE6: + cmp r4, 0x6D + bhi _08196FEE + movs r0, 0xA + b _0819707A +_08196FEE: + cmp r4, 0x77 + bhi _08196FF6 + movs r0, 0xB + b _0819707A +_08196FF6: + cmp r4, 0x81 + bhi _08196FFE + movs r0, 0xC + b _0819707A +_08196FFE: + cmp r4, 0x8B + bhi _08197006 + movs r0, 0xD + b _0819707A +_08197006: + cmp r4, 0x95 + bhi _0819700E + movs r0, 0xE + b _0819707A +_0819700E: + cmp r4, 0x9F + bhi _08197016 + movs r0, 0xF + b _0819707A +_08197016: + cmp r4, 0xA9 + bhi _0819701E + movs r0, 0x10 + b _0819707A +_0819701E: + cmp r4, 0xB3 + bhi _08197026 + movs r0, 0x11 + b _0819707A +_08197026: + cmp r4, 0xBD + bhi _0819702E + movs r0, 0x12 + b _0819707A +_0819702E: + cmp r4, 0xC7 + bls _08197078 + movs r0, 0xCD + lsls r0, 1 + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _08197050 + subs r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 +_08197050: + ldr r0, =0x00000199 + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _0819706C + subs r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 +_0819706C: + cmp r4, 0xC7 + bls _08197078 + movs r0, 0x14 + b _0819707A + .pool +_08197078: + movs r0, 0x13 +_0819707A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8196F90 + + thumb_func_start sub_8197080 +sub_8197080: @ 8197080 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r8, r0 + movs r0, 0xFA + lsls r0, 2 + bl Alloc + adds r7, r0, 0 + cmp r7, 0 + bne _081970A2 + movs r0, 0xFF + mov r1, r8 + strb r0, [r1] + b _0819715C +_081970A2: + movs r0, 0 + bl sub_80C0844 + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x1 + bl sub_80C0844 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, =gStringVar1 + mov r10, r0 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + ldr r1, =gStringVar2 + mov r9, r1 + mov r0, r9 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + adds r0, r6, 0 + bl sub_8196F90 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =gUnknown_082A5C9C + adds r0, r7, 0 + bl StringCopy + adds r5, r0, 0 + movs r6, 0xFB + strb r6, [r5] + adds r5, 0x1 + ldr r1, =gUnknown_082A5D2C + adds r0, r5, 0 + bl StringCopy + adds r5, r0, 0 + strb r6, [r5] + adds r5, 0x1 + ldr r0, =gUnknown_0860F020 + lsls r4, 2 + adds r4, r0 + ldr r1, [r4] + adds r0, r5, 0 + bl StringCopy + mov r0, r8 + adds r1, r7, 0 + bl StringExpandPlaceholders + adds r5, r0, 0 + bl IsNationalPokedexEnabled + cmp r0, 0 + beq _08197156 + strb r6, [r5] + adds r5, 0x1 + movs r0, 0 + bl pokedex_count + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x1 + bl pokedex_count + lsls r0, 16 + lsrs r6, r0, 16 + mov r0, r10 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + mov r0, r9 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + ldr r1, =gUnknown_082A633D + adds r0, r5, 0 + bl StringExpandPlaceholders +_08197156: + adds r0, r7, 0 + bl Free +_0819715C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8197080 + + thumb_func_start sub_8197184 +sub_8197184: @ 8197184 + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl GetWindowAttribute + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0860EA6C + movs r2, 0x80 + lsls r2, 1 + lsls r4, 16 + lsrs r4, 16 + adds r3, r4, 0 + bl LoadBgTiles + ldr r0, =gUnknown_0860EA4C + lsls r5, 20 + lsrs r5, 16 + adds r1, r5, 0 + movs r2, 0x20 + bl LoadPalette + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8197184 + + thumb_func_start sub_81971C4 +sub_81971C4: @ 81971C4 + push {lr} + bl sub_819645C + pop {r0} + bx r0 + thumb_func_end sub_81971C4 + + thumb_func_start sub_81971D0 +sub_81971D0: @ 81971D0 + push {lr} + ldr r0, =gUnknown_0860F098 + bl InitWindows + ldr r0, =gUnknown_0203CD8C + movs r1, 0xFF + strb r1, [r0] + ldr r0, =gUnknown_0203CD8D + strb r1, [r0] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81971D0 + + thumb_func_start sub_81971F4 +sub_81971F4: @ 81971F4 + push {lr} + bl FreeAllWindowBuffers + pop {r0} + bx r0 + thumb_func_end sub_81971F4 + + thumb_func_start sub_8197200 +sub_8197200: @ 8197200 + push {lr} + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + bl DeactivateAllTextPrinters + bl sub_81973A4 + pop {r0} + bx r0 + thumb_func_end sub_8197200 + + thumb_func_start sub_8197224 +sub_8197224: @ 8197224 + push {lr} + bl RunTextPrinters + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_8197224 + + 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} + sub sp, 0x10 + ldr r7, [sp, 0x28] + ldr r4, [sp, 0x2C] + mov r8, r4 + ldr r5, [sp, 0x30] + ldr r6, [sp, 0x34] + lsls r3, 24 + lsrs r3, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + str r2, [sp] + mov r2, sp + movs r4, 0 + strb r0, [r2, 0x4] + mov r0, sp + strb r1, [r0, 0x5] + strb r4, [r0, 0x6] + movs r1, 0x1 + strb r1, [r0, 0x7] + strb r4, [r0, 0x8] + strb r1, [r0, 0x9] + strb r4, [r0, 0xA] + strb r4, [r0, 0xB] + mov r4, sp + ldrb r2, [r4, 0xC] + subs r1, 0x11 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r4, 0xC] + mov r0, sp + mov r2, r8 + lsls r2, 4 + movs r4, 0xF + strb r2, [r0, 0xC] + mov r2, sp + ands r5, r4 + ldrb r0, [r2, 0xD] + ands r1, r0 + orrs r1, r5 + strb r1, [r2, 0xD] + mov r0, sp + lsrs r6, 20 + ands r1, r4 + orrs r1, r6 + strb r1, [r0, 0xD] + ldr r2, =gTextFlags + ldrb r1, [r2] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + mov r0, sp + adds r1, r3, 0 + adds r2, r7, 0 + bl AddTextPrinter + lsls r0, 16 + lsrs r0, 16 + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end AddTextPrinterParametrized + + thumb_func_start AddTextPrinterForMessage +@ void AddTextPrinterForMessage(u8 allowSkippingDelayWithButtonPress) +AddTextPrinterForMessage: @ 81972C4 + push {r4,r5,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + movs r5, 0 + ldr r3, =gTextFlags + movs r4, 0x1 + ands r0, r4 + ldrb r2, [r3] + movs r1, 0x2 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3] + bl sav2_get_text_speed + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + ldr r2, =gStringVar4 + str r5, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x3 + str r0, [sp, 0xC] + movs r0, 0 + movs r1, 0x1 + bl AddTextPrinterParametrized + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end AddTextPrinterForMessage + + thumb_func_start AddTextPrinterForMessage_2 +@ void AddTextPrinterForMessage_2(u8 allowSkippingDelayWithButtonPress) +AddTextPrinterForMessage_2: @ 8197310 + push {r4,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + ldr r3, =gTextFlags + movs r4, 0x1 + ands r0, r4 + ldrb r2, [r3] + movs r1, 0x2 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3] + bl sav2_get_text_speed + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + ldr r2, =gStringVar4 + movs r0, 0 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x3 + str r0, [sp, 0xC] + movs r0, 0 + movs r1, 0x1 + bl AddTextPrinterParametrized + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end AddTextPrinterForMessage_2 + + thumb_func_start AddTextPrinterWithCustomSpeedForMessage +@ void AddTextPrinterWithCustomSpeedForMessage(u8 allowSkippingDelayWithButtonPress, u8 speed) +AddTextPrinterWithCustomSpeedForMessage: @ 819735C + push {r4,r5,lr} + sub sp, 0x10 + adds r3, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r3, 24 + lsrs r3, 24 + ldr r4, =gTextFlags + movs r5, 0x1 + ands r0, r5 + ldrb r2, [r4] + movs r1, 0x2 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r4] + ldr r2, =gStringVar4 + movs r0, 0 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x3 + str r0, [sp, 0xC] + movs r0, 0 + movs r1, 0x1 + bl AddTextPrinterParametrized + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end AddTextPrinterWithCustomSpeedForMessage + + thumb_func_start sub_81973A4 +sub_81973A4: @ 81973A4 + push {lr} + movs r1, 0x80 + lsls r1, 2 + movs r0, 0 + movs r2, 0xF0 + bl copy_textbox_border_tile_patterns_to_vram + movs r1, 0x85 + lsls r1, 2 + movs r0, 0 + movs r2, 0xE0 + bl sub_809882C + pop {r0} + bx r0 + thumb_func_end sub_81973A4 + + thumb_func_start sub_81973C4 +sub_81973C4: @ 81973C4 + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =sub_81975F4 + adds r0, r5, 0 + bl CallWindowFunction + adds r0, r5, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + adds r0, r5, 0 + bl PutWindowTilemap + cmp r4, 0x1 + bne _081973F2 + adds r0, r5, 0 + movs r1, 0x3 + bl CopyWindowToVram +_081973F2: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81973C4 + + thumb_func_start sub_81973FC +sub_81973FC: @ 81973FC + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =sub_81974A4 + adds r0, r5, 0 + bl CallWindowFunction + adds r0, r5, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + adds r0, r5, 0 + bl PutWindowTilemap + cmp r4, 0x1 + bne _0819742A + adds r0, r5, 0 + movs r1, 0x3 + bl CopyWindowToVram +_0819742A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81973FC + + thumb_func_start sub_8197434 +sub_8197434: @ 8197434 + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =sub_8197804 + adds r0, r5, 0 + bl CallWindowFunction + adds r0, r5, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + adds r0, r5, 0 + bl ClearWindowTilemap + cmp r4, 0x1 + bne _08197462 + adds r0, r5, 0 + movs r1, 0x3 + bl CopyWindowToVram +_08197462: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8197434 + + thumb_func_start sub_819746C +sub_819746C: @ 819746C + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =sub_81977BC + adds r0, r5, 0 + bl CallWindowFunction + adds r0, r5, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + adds r0, r5, 0 + bl ClearWindowTilemap + cmp r4, 0x1 + bne _0819749A + adds r0, r5, 0 + movs r1, 0x3 + bl CopyWindowToVram +_0819749A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819746C + + thumb_func_start sub_81974A4 +sub_81974A4: @ 81974A4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + adds r4, r2, 0 + ldr r2, [sp, 0x3C] + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsls r4, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x10] + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x14] + movs r3, 0x85 + lsls r3, 2 + lsrs r0, r1, 24 + str r0, [sp, 0xC] + movs r2, 0xFF + lsls r2, 24 + adds r2, r1 + mov r8, r2 + lsrs r2, 24 + lsrs r0, r4, 24 + mov r9, r0 + movs r0, 0xFF + lsls r0, 24 + adds r4, r0 + lsrs r4, 24 + movs r5, 0x1 + str r5, [sp] + str r5, [sp, 0x4] + movs r6, 0xE + str r6, [sp, 0x8] + adds r0, r7, 0 + adds r1, r3, 0 + adds r3, r4, 0 + bl FillBgTilemapBufferRect + ldr r1, =0x00000215 + ldr r2, [sp, 0x10] + str r2, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + adds r0, r7, 0 + ldr r2, [sp, 0xC] + adds r3, r4, 0 + bl FillBgTilemapBufferRect + ldr r1, =0x00000216 + ldr r3, [sp, 0xC] + ldr r2, [sp, 0x10] + adds r0, r3, r2 + lsls r0, 24 + mov r10, r0 + lsrs r2, r0, 24 + str r5, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + adds r0, r7, 0 + adds r3, r4, 0 + bl FillBgTilemapBufferRect + mov r5, r9 + ldr r0, [sp, 0x14] + add r0, r9 + cmp r9, r0 + bge _08197578 + mov r3, r8 + str r3, [sp, 0x18] + movs r6, 0x1 + movs r0, 0xE + mov r8, r0 +_0819753E: + lsls r4, r5, 24 + lsrs r4, 24 + str r6, [sp] + str r6, [sp, 0x4] + mov r2, r8 + str r2, [sp, 0x8] + adds r0, r7, 0 + ldr r1, =0x00000217 + ldr r3, [sp, 0x18] + lsrs r2, r3, 24 + adds r3, r4, 0 + bl FillBgTilemapBufferRect + str r6, [sp] + str r6, [sp, 0x4] + mov r0, r8 + str r0, [sp, 0x8] + adds r0, r7, 0 + ldr r1, =0x00000219 + mov r3, r10 + lsrs r2, r3, 24 + adds r3, r4, 0 + bl FillBgTilemapBufferRect + adds r5, 0x1 + ldr r0, [sp, 0x14] + add r0, r9 + cmp r5, r0 + blt _0819753E +_08197578: + ldr r1, =0x0000021a + ldr r2, [sp, 0xC] + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldr r4, [sp, 0x14] + add r4, r9 + lsls r4, 24 + lsrs r4, 24 + movs r5, 0x1 + str r5, [sp] + str r5, [sp, 0x4] + movs r6, 0xE + str r6, [sp, 0x8] + adds r0, r7, 0 + adds r3, r4, 0 + bl FillBgTilemapBufferRect + ldr r1, =0x0000021b + ldr r0, [sp, 0x10] + str r0, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + adds r0, r7, 0 + ldr r2, [sp, 0xC] + adds r3, r4, 0 + bl FillBgTilemapBufferRect + movs r1, 0x87 + lsls r1, 2 + ldr r3, [sp, 0xC] + ldr r0, [sp, 0x10] + adds r2, r3, r0 + lsls r2, 24 + lsrs r2, 24 + str r5, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + adds r0, r7, 0 + adds r3, r4, 0 + bl FillBgTilemapBufferRect + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81974A4 + + thumb_func_start sub_81975F4 +sub_81975F4: @ 81975F4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + adds r6, r0, 0 + adds r5, r2, 0 + mov r8, r3 + ldr r2, [sp, 0x44] + lsls r6, 24 + lsrs r6, 24 + lsls r0, r1, 24 + lsls r5, 24 + mov r1, r8 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + lsls r1, r2, 24 + lsrs r1, 24 + str r1, [sp, 0x10] + ldr r1, =0x00000201 + lsrs r2, r0, 24 + str r2, [sp, 0xC] + movs r3, 0xFE + lsls r3, 24 + adds r2, r0, r3 + lsrs r2, 24 + str r2, [sp, 0x14] + lsrs r0, r5, 24 + mov r10, r0 + movs r2, 0xFF + lsls r2, 24 + adds r5, r2 + lsrs r5, 24 + movs r4, 0x1 + str r4, [sp] + str r4, [sp, 0x4] + movs r3, 0xF + mov r9, r3 + str r3, [sp, 0x8] + adds r0, r6, 0 + ldr r2, [sp, 0x14] + adds r3, r5, 0 + bl FillBgTilemapBufferRect + ldr r1, =0x00000203 + ldr r0, [sp, 0xC] + subs r0, 0x1 + lsls r2, r0, 24 + lsrs r2, 24 + str r2, [sp, 0x18] + str r4, [sp] + str r4, [sp, 0x4] + mov r0, r9 + str r0, [sp, 0x8] + adds r0, r6, 0 + adds r3, r5, 0 + bl FillBgTilemapBufferRect + movs r1, 0x81 + lsls r1, 2 + mov r0, r8 + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x1C] + str r0, [sp] + str r4, [sp, 0x4] + mov r2, r9 + str r2, [sp, 0x8] + adds r0, r6, 0 + ldr r2, [sp, 0xC] + adds r3, r5, 0 + bl FillBgTilemapBufferRect + ldr r1, =0x00000205 + ldr r7, [sp, 0xC] + add r7, r8 + subs r0, r7, 0x1 + lsls r2, r0, 24 + lsrs r2, 24 + str r2, [sp, 0x20] + str r4, [sp] + str r4, [sp, 0x4] + mov r3, r9 + str r3, [sp, 0x8] + adds r0, r6, 0 + adds r3, r5, 0 + bl FillBgTilemapBufferRect + ldr r1, =0x00000206 + lsls r2, r7, 24 + lsrs r7, r2, 24 + str r4, [sp] + str r4, [sp, 0x4] + mov r0, r9 + str r0, [sp, 0x8] + adds r0, r6, 0 + adds r2, r7, 0 + adds r3, r5, 0 + bl FillBgTilemapBufferRect + ldr r1, =0x00000207 + str r4, [sp] + movs r5, 0x5 + str r5, [sp, 0x4] + mov r2, r9 + str r2, [sp, 0x8] + adds r0, r6, 0 + ldr r2, [sp, 0x14] + mov r3, r10 + bl FillBgTilemapBufferRect + ldr r1, =0x00000209 + add r8, r4 + mov r3, r8 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp] + str r5, [sp, 0x4] + mov r0, r9 + str r0, [sp, 0x8] + adds r0, r6, 0 + ldr r2, [sp, 0x18] + mov r3, r10 + bl FillBgTilemapBufferRect + ldr r1, =0x0000020a + str r4, [sp] + str r5, [sp, 0x4] + mov r2, r9 + str r2, [sp, 0x8] + adds r0, r6, 0 + adds r2, r7, 0 + mov r3, r10 + bl FillBgTilemapBufferRect + ldr r1, =0x00000a01 + ldr r3, [sp, 0x10] + add r10, r3 + mov r0, r10 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + str r4, [sp] + str r4, [sp, 0x4] + mov r2, r9 + str r2, [sp, 0x8] + adds r0, r6, 0 + ldr r2, [sp, 0x14] + mov r3, r10 + bl FillBgTilemapBufferRect + ldr r1, =0x00000a03 + str r4, [sp] + str r4, [sp, 0x4] + mov r3, r9 + str r3, [sp, 0x8] + adds r0, r6, 0 + ldr r2, [sp, 0x18] + mov r3, r10 + bl FillBgTilemapBufferRect + ldr r1, =0x00000a04 + ldr r0, [sp, 0x1C] + str r0, [sp] + str r4, [sp, 0x4] + mov r2, r9 + str r2, [sp, 0x8] + adds r0, r6, 0 + ldr r2, [sp, 0xC] + mov r3, r10 + bl FillBgTilemapBufferRect + ldr r1, =0x00000a05 + str r4, [sp] + str r4, [sp, 0x4] + mov r3, r9 + str r3, [sp, 0x8] + adds r0, r6, 0 + ldr r2, [sp, 0x20] + mov r3, r10 + bl FillBgTilemapBufferRect + ldr r1, =0x00000a06 + str r4, [sp] + str r4, [sp, 0x4] + mov r0, r9 + str r0, [sp, 0x8] + adds r0, r6, 0 + adds r2, r7, 0 + mov r3, r10 + bl FillBgTilemapBufferRect + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81975F4 + + thumb_func_start sub_81977BC +sub_81977BC: @ 81977BC + push {r4,r5,lr} + sub sp, 0xC + adds r4, r1, 0 + adds r5, r2, 0 + ldr r1, [sp, 0x18] + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsls r5, 24 + lsls r3, 24 + lsls r1, 24 + movs r2, 0xFF + lsls r2, 24 + adds r4, r2 + lsrs r4, 24 + adds r5, r2 + lsrs r5, 24 + movs r2, 0x80 + lsls r2, 18 + adds r3, r2 + lsrs r3, 24 + str r3, [sp] + adds r1, r2 + lsrs r1, 24 + str r1, [sp, 0x4] + movs r1, 0xE + str r1, [sp, 0x8] + movs r1, 0 + adds r2, r4, 0 + adds r3, r5, 0 + bl FillBgTilemapBufferRect + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81977BC + + thumb_func_start sub_8197804 +sub_8197804: @ 8197804 + push {r4,r5,lr} + sub sp, 0xC + adds r4, r1, 0 + adds r5, r2, 0 + ldr r1, [sp, 0x18] + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsls r5, 24 + lsls r3, 24 + lsls r1, 24 + movs r2, 0xFD + lsls r2, 24 + adds r4, r2 + lsrs r4, 24 + movs r2, 0xFF + lsls r2, 24 + adds r5, r2 + lsrs r5, 24 + movs r2, 0xC0 + lsls r2, 19 + adds r3, r2 + lsrs r3, 24 + str r3, [sp] + movs r2, 0x80 + lsls r2, 18 + adds r1, r2 + lsrs r1, 24 + str r1, [sp, 0x4] + movs r1, 0xE + str r1, [sp, 0x8] + movs r1, 0 + adds r2, r4, 0 + adds r3, r5, 0 + bl FillBgTilemapBufferRect + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8197804 + + thumb_func_start SetStandardWindowBorderStyle +@ void SetStandardWindowBorderStyle(u8 windowId, bool copyToVram) +SetStandardWindowBorderStyle: @ 8197854 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + movs r2, 0x85 + lsls r2, 2 + movs r3, 0xE + bl SetWindowBorderStyle + pop {r0} + bx r0 + thumb_func_end SetStandardWindowBorderStyle + + thumb_func_start sub_819786C +sub_819786C: @ 819786C + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + movs r6, 0x80 + lsls r6, 2 + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0xF0 + bl copy_textbox_border_tile_patterns_to_vram + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + movs r3, 0xF + bl sub_8197B1C + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_819786C + + thumb_func_start sub_819789C +sub_819789C: @ 819789C + push {lr} + ldr r0, =gUnknown_0860F074 + movs r1, 0xE0 + movs r2, 0x14 + bl LoadPalette + pop {r0} + bx r0 + .pool + thumb_func_end sub_819789C + + thumb_func_start sub_81978B0 +sub_81978B0: @ 81978B0 + push {lr} + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r0, =gUnknown_0860F074 + movs r2, 0x14 + bl LoadPalette + pop {r0} + bx r0 + .pool + thumb_func_end sub_81978B0 + + thumb_func_start sub_81978C8 +sub_81978C8: @ 81978C8 + ldr r0, =gUnknown_0860F074 + bx lr + .pool + thumb_func_end sub_81978C8 + + thumb_func_start sub_81978D0 +sub_81978D0: @ 81978D0 + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xF + bls _081978DC + movs r1, 0 +_081978DC: + ldr r0, =gUnknown_0860F074 + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + pop {r1} + bx r1 + .pool + thumb_func_end sub_81978D0 + + 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 + adds r5, r1, 0 + adds r6, r2, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_81973A4 + bl sav2_get_text_speed + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x80 + lsls r2, 2 + movs r1, 0x1 + str r1, [sp] + str r0, [sp, 0x4] + str r5, [sp, 0x8] + str r6, [sp, 0xC] + adds r0, r4, 0 + movs r1, 0 + movs r3, 0xF + bl DisplayMessageAndContinueTask + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end DisplayItemMessageOnField + + thumb_func_start sub_8197930 +sub_8197930: @ 8197930 + push {lr} + ldr r0, =gUnknown_0860F0A8 + movs r1, 0x85 + lsls r1, 2 + movs r2, 0xE + movs r3, 0 + bl CreateYesNoMenu + pop {r0} + bx r0 + .pool + thumb_func_end sub_8197930 + + thumb_func_start sub_8197948 +sub_8197948: @ 8197948 + push {lr} + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + ldr r0, =gUnknown_0860F0A8 + movs r1, 0x85 + lsls r1, 2 + movs r2, 0xE + bl CreateYesNoMenu + pop {r0} + bx r0 + .pool + thumb_func_end sub_8197948 + + thumb_func_start sub_8197964 +sub_8197964: @ 8197964 + push {lr} + ldr r0, =gTextFlags + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _08197988 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldrb r0, [r0, 0x14] + lsls r0, 29 + lsrs r0, 29 + b _0819798A + .pool +_08197988: + movs r0, 0x1 +_0819798A: + pop {r1} + bx r1 + thumb_func_end sub_8197964 + + thumb_func_start sav2_get_text_speed +sav2_get_text_speed: @ 8197990 + push {lr} + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldrb r1, [r2, 0x14] + lsls r0, r1, 29 + lsrs r0, 29 + cmp r0, 0x2 + bls _081979AC + movs r0, 0x8 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x14] +_081979AC: + bl sub_8197964 + ldr r1, =gUnknown_0860F094 + adds r0, r1 + ldrb r0, [r0] + pop {r1} + bx r1 + .pool + thumb_func_end sav2_get_text_speed + + thumb_func_start sub_81979C4 +sub_81979C4: @ 81979C4 + push {r4,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r1, r0, 24 + ldr r4, =gUnknown_0203CD8C + ldrb r0, [r4] + cmp r0, 0xFF + bne _081979F6 + lsls r0, r1, 25 + movs r1, 0x80 + lsls r1, 18 + adds r0, r1 + lsrs r0, 24 + str r0, [sp] + movs r0, 0xF + str r0, [sp, 0x4] + ldr r0, =0x00000139 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x16 + movs r2, 0x1 + movs r3, 0x7 + bl sub_8198AA4 + strb r0, [r4] +_081979F6: + ldrb r0, [r4] + add sp, 0xC + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81979C4 + + thumb_func_start get_start_menu_window_id_maybe +get_start_menu_window_id_maybe: @ 8197A08 + ldr r0, =gUnknown_0203CD8C + ldrb r0, [r0] + bx lr + .pool + thumb_func_end get_start_menu_window_id_maybe + + thumb_func_start remove_start_menu_window_maybe +remove_start_menu_window_maybe: @ 8197A14 + push {r4,lr} + ldr r4, =gUnknown_0203CD8C + ldrb r0, [r4] + cmp r0, 0xFF + beq _08197A26 + bl RemoveWindow + movs r0, 0xFF + strb r0, [r4] +_08197A26: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end remove_start_menu_window_maybe + + thumb_func_start sub_8197A30 +sub_8197A30: @ 8197A30 + movs r0, 0x80 + lsls r0, 2 + bx lr + thumb_func_end sub_8197A30 + + thumb_func_start sub_8197A38 +sub_8197A38: @ 8197A38 + movs r0, 0x85 + lsls r0, 2 + bx lr + thumb_func_end sub_8197A38 + + thumb_func_start AddMapNamePopUpWindow +AddMapNamePopUpWindow: @ 8197A40 + push {r4,lr} + sub sp, 0xC + ldr r4, =gUnknown_0203CD8D + ldrb r0, [r4] + cmp r0, 0xFF + bne _08197A66 + movs r0, 0x3 + str r0, [sp] + movs r0, 0xE + str r0, [sp, 0x4] + adds r0, 0xF9 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + movs r3, 0xA + bl sub_8198AA4 + strb r0, [r4] +_08197A66: + ldrb r0, [r4] + add sp, 0xC + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end AddMapNamePopUpWindow + + thumb_func_start GetMapNamePopUpWindowId +GetMapNamePopUpWindowId: @ 8197A74 + ldr r0, =gUnknown_0203CD8D + ldrb r0, [r0] + bx lr + .pool + thumb_func_end GetMapNamePopUpWindowId + + thumb_func_start RemoveMapNamePopUpWindow +RemoveMapNamePopUpWindow: @ 8197A80 + push {r4,lr} + ldr r4, =gUnknown_0203CD8D + ldrb r0, [r4] + cmp r0, 0xFF + beq _08197A92 + bl RemoveWindow + movs r0, 0xFF + strb r0, [r4] +_08197A92: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end RemoveMapNamePopUpWindow + + 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 + lsls r0, 24 + lsrs r0, 24 + ldr r3, =gTextFlags + movs r4, 0x1 + ands r0, r4 + ldrb r2, [r3] + movs r1, 0x2 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3] + bl sav2_get_text_speed + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + ldr r2, =gStringVar4 + str r5, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x3 + str r0, [sp, 0xC] + movs r0, 0 + movs r1, 0x1 + bl AddTextPrinterParametrized + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end AddTextPrinterWithCallbackForMessage + + thumb_func_start sub_8197AE8 +sub_8197AE8: @ 8197AE8 + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x20 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect + cmp r4, 0x1 + bne _08197B12 + movs r0, 0 + bl CopyBgTilemapBufferToVram +_08197B12: + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8197AE8 + + thumb_func_start sub_8197B1C +sub_8197B1C: @ 8197B1C + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_0203CD9C + strh r2, [r0] + ldr r0, =gUnknown_0203CD9E + strb r3, [r0] + ldr r1, =sub_8197BB4 + adds r0, r5, 0 + bl CallWindowFunction + adds r0, r5, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + adds r0, r5, 0 + bl PutWindowTilemap + cmp r4, 0x1 + bne _08197B52 + adds r0, r5, 0 + movs r1, 0x3 + bl CopyWindowToVram +_08197B52: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8197B1C + + thumb_func_start sub_8197B64 +sub_8197B64: @ 8197B64 + push {r4-r6,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_0203CD9C + strh r2, [r0] + ldr r5, =gUnknown_0203CD9E + adds r0, r6, 0 + movs r1, 0x5 + bl GetWindowAttribute + strb r0, [r5] + ldr r1, =sub_8197BB4 + adds r0, r6, 0 + bl CallWindowFunction + adds r0, r6, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + adds r0, r6, 0 + bl PutWindowTilemap + cmp r4, 0x1 + bne _08197BA2 + adds r0, r6, 0 + movs r1, 0x3 + bl CopyWindowToVram +_08197BA2: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8197B64 + + thumb_func_start sub_8197BB4 +sub_8197BB4: @ 8197BB4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + mov r8, r0 + adds r5, r2, 0 + adds r6, r3, 0 + ldr r2, [sp, 0x44] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r0, r1, 24 + lsls r5, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r1, r2, 24 + lsrs r1, 24 + str r1, [sp, 0x10] + ldr r2, =gUnknown_0203CD9C + ldrh r1, [r2] + adds r1, 0x1 + lsls r1, 16 + lsrs r1, 16 + lsrs r3, r0, 24 + str r3, [sp, 0xC] + movs r3, 0xFE + lsls r3, 24 + adds r2, r0, r3 + lsrs r2, 24 + str r2, [sp, 0x14] + lsrs r0, r5, 24 + mov r9, r0 + movs r2, 0xFF + lsls r2, 24 + adds r5, r2 + lsrs r5, 24 + movs r4, 0x1 + str r4, [sp] + str r4, [sp, 0x4] + ldr r3, =gUnknown_0203CD9E + mov r10, r3 + ldrb r0, [r3] + str r0, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0x14] + adds r3, r5, 0 + bl FillBgTilemapBufferRect + ldr r0, =gUnknown_0203CD9C + ldrh r1, [r0] + adds r1, 0x3 + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0xC] + subs r0, 0x1 + lsls r2, r0, 24 + lsrs r2, 24 + str r2, [sp, 0x18] + str r4, [sp] + str r4, [sp, 0x4] + mov r2, r10 + ldrb r0, [r2] + str r0, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0x18] + adds r3, r5, 0 + bl FillBgTilemapBufferRect + ldr r3, =gUnknown_0203CD9C + ldrh r1, [r3] + adds r1, 0x4 + lsls r1, 16 + lsrs r1, 16 + subs r0, r6, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x1C] + str r0, [sp] + str r4, [sp, 0x4] + mov r2, r10 + ldrb r0, [r2] + str r0, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0xC] + adds r3, r5, 0 + bl FillBgTilemapBufferRect + ldr r3, =gUnknown_0203CD9C + ldrh r1, [r3] + adds r1, 0x5 + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0xC] + adds r7, r0, r6 + subs r0, r7, 0x1 + lsls r2, r0, 24 + lsrs r2, 24 + str r2, [sp, 0x20] + str r4, [sp] + str r4, [sp, 0x4] + mov r2, r10 + ldrb r0, [r2] + str r0, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0x20] + adds r3, r5, 0 + bl FillBgTilemapBufferRect + ldr r3, =gUnknown_0203CD9C + ldrh r1, [r3] + adds r1, 0x6 + lsls r1, 16 + lsrs r1, 16 + lsls r2, r7, 24 + lsrs r7, r2, 24 + str r4, [sp] + str r4, [sp, 0x4] + mov r2, r10 + ldrb r0, [r2] + str r0, [sp, 0x8] + mov r0, r8 + adds r2, r7, 0 + adds r3, r5, 0 + bl FillBgTilemapBufferRect + ldr r3, =gUnknown_0203CD9C + ldrh r1, [r3] + adds r1, 0x7 + lsls r1, 16 + lsrs r1, 16 + str r4, [sp] + movs r5, 0x5 + str r5, [sp, 0x4] + mov r2, r10 + ldrb r0, [r2] + str r0, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0x14] + mov r3, r9 + bl FillBgTilemapBufferRect + ldr r3, =gUnknown_0203CD9C + ldrh r1, [r3] + adds r1, 0x9 + lsls r1, 16 + lsrs r1, 16 + adds r6, 0x1 + lsls r6, 24 + lsrs r6, 24 + str r6, [sp] + str r5, [sp, 0x4] + mov r2, r10 + ldrb r0, [r2] + str r0, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0x18] + mov r3, r9 + bl FillBgTilemapBufferRect + ldr r3, =gUnknown_0203CD9C + ldrh r1, [r3] + adds r1, 0xA + lsls r1, 16 + lsrs r1, 16 + str r4, [sp] + str r5, [sp, 0x4] + mov r2, r10 + ldrb r0, [r2] + str r0, [sp, 0x8] + mov r0, r8 + adds r2, r7, 0 + mov r3, r9 + bl FillBgTilemapBufferRect + ldr r3, =0x00000801 + adds r1, r3, 0 + ldr r0, =gUnknown_0203CD9C + ldrh r0, [r0] + adds r1, r0 + lsls r1, 16 + lsrs r1, 16 + ldr r2, [sp, 0x10] + add r9, r2 + mov r3, r9 + lsls r3, 24 + lsrs r3, 24 + mov r9, r3 + str r4, [sp] + str r4, [sp, 0x4] + mov r2, r10 + ldrb r0, [r2] + str r0, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0x14] + bl FillBgTilemapBufferRect + ldr r3, =0x00000803 + adds r1, r3, 0 + ldr r0, =gUnknown_0203CD9C + ldrh r0, [r0] + adds r1, r0 + lsls r1, 16 + lsrs r1, 16 + str r4, [sp] + str r4, [sp, 0x4] + mov r2, r10 + ldrb r0, [r2] + str r0, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0x18] + mov r3, r9 + bl FillBgTilemapBufferRect + ldr r3, =0x00000804 + adds r1, r3, 0 + ldr r0, =gUnknown_0203CD9C + ldrh r0, [r0] + adds r1, r0 + lsls r1, 16 + lsrs r1, 16 + ldr r2, [sp, 0x1C] + str r2, [sp] + str r4, [sp, 0x4] + mov r3, r10 + ldrb r0, [r3] + str r0, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0xC] + mov r3, r9 + bl FillBgTilemapBufferRect + ldr r0, =0x00000805 + adds r1, r0, 0 + ldr r2, =gUnknown_0203CD9C + ldrh r2, [r2] + adds r1, r2 + lsls r1, 16 + lsrs r1, 16 + str r4, [sp] + str r4, [sp, 0x4] + mov r3, r10 + ldrb r0, [r3] + str r0, [sp, 0x8] + mov r0, r8 + ldr r2, [sp, 0x20] + mov r3, r9 + bl FillBgTilemapBufferRect + ldr r0, =0x00000806 + adds r1, r0, 0 + ldr r2, =gUnknown_0203CD9C + ldrh r2, [r2] + adds r1, r2 + lsls r1, 16 + lsrs r1, 16 + str r4, [sp] + str r4, [sp, 0x4] + mov r3, r10 + ldrb r0, [r3] + str r0, [sp, 0x8] + mov r0, r8 + adds r2, r7, 0 + mov r3, r9 + bl FillBgTilemapBufferRect + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8197BB4 + + thumb_func_start sub_8197DF8 +sub_8197DF8: @ 8197DF8 + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =sub_8197E30 + adds r0, r5, 0 + bl CallWindowFunction + adds r0, r5, 0 + movs r1, 0 + bl FillWindowPixelBuffer + adds r0, r5, 0 + bl ClearWindowTilemap + cmp r4, 0x1 + bne _08197E26 + adds r0, r5, 0 + movs r1, 0x3 + bl CopyWindowToVram +_08197E26: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8197DF8 + + thumb_func_start sub_8197E30 +sub_8197E30: @ 8197E30 + push {r4,r5,lr} + sub sp, 0xC + adds r4, r1, 0 + adds r5, r2, 0 + ldr r1, [sp, 0x18] + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsls r5, 24 + lsls r3, 24 + lsls r1, 24 + movs r2, 0xFD + lsls r2, 24 + adds r4, r2 + lsrs r4, 24 + movs r2, 0xFF + lsls r2, 24 + adds r5, r2 + lsrs r5, 24 + movs r2, 0xC0 + lsls r2, 19 + adds r3, r2 + lsrs r3, 24 + str r3, [sp] + movs r2, 0x80 + lsls r2, 18 + adds r1, r2 + lsrs r1, 24 + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + adds r2, r4, 0 + adds r3, r5, 0 + bl FillBgTilemapBufferRect + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8197E30 + + thumb_func_start SetWindowBorderStyle +@ void SetWindowBorderStyle(u8 windowId, bool copyToVram, s16 tileStart, s8 palette) +SetWindowBorderStyle: @ 8197E80 + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_0203CD9C + strh r2, [r0] + ldr r0, =gUnknown_0203CD9E + strb r3, [r0] + ldr r1, =DrawWindowBorder + adds r0, r5, 0 + bl CallWindowFunction + adds r0, r5, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + adds r0, r5, 0 + bl PutWindowTilemap + cmp r4, 0x1 + bne _08197EB6 + adds r0, r5, 0 + movs r1, 0x3 + bl CopyWindowToVram +_08197EB6: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end SetWindowBorderStyle + + thumb_func_start sub_8197EC8 +sub_8197EC8: @ 8197EC8 + push {r4-r6,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_0203CD9C + strh r2, [r0] + ldr r5, =gUnknown_0203CD9E + adds r0, r6, 0 + movs r1, 0x5 + bl GetWindowAttribute + strb r0, [r5] + ldr r1, =DrawWindowBorder + adds r0, r6, 0 + bl CallWindowFunction + adds r0, r6, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + adds r0, r6, 0 + bl PutWindowTilemap + cmp r4, 0x1 + bne _08197F06 + adds r0, r6, 0 + movs r1, 0x3 + bl CopyWindowToVram +_08197F06: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8197EC8 + + thumb_func_start DrawWindowBorder +DrawWindowBorder: @ 8197F18 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + mov r9, r0 + adds r6, r1, 0 + adds r4, r2, 0 + ldr r0, [sp, 0x38] + mov r1, r9 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + lsls r6, 24 + lsls r4, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x10] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x14] + ldr r2, =gUnknown_0203CD9C + ldrh r1, [r2] + lsrs r0, r6, 24 + str r0, [sp, 0xC] + movs r2, 0xFF + lsls r2, 24 + adds r6, r2 + lsrs r6, 24 + lsrs r0, r4, 24 + mov r8, r0 + adds r4, r2 + lsrs r4, 24 + movs r5, 0x1 + str r5, [sp] + str r5, [sp, 0x4] + ldr r7, =gUnknown_0203CD9E + ldrb r0, [r7] + str r0, [sp, 0x8] + mov r0, r9 + adds r2, r6, 0 + adds r3, r4, 0 + bl FillBgTilemapBufferRect + ldr r2, =gUnknown_0203CD9C + ldrh r1, [r2] + adds r1, 0x1 + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x10] + str r0, [sp] + str r5, [sp, 0x4] + ldrb r0, [r7] + str r0, [sp, 0x8] + mov r0, r9 + ldr r2, [sp, 0xC] + adds r3, r4, 0 + bl FillBgTilemapBufferRect + ldr r2, =gUnknown_0203CD9C + ldrh r1, [r2] + adds r1, 0x2 + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0xC] + ldr r2, [sp, 0x10] + adds r0, r2 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + str r5, [sp] + str r5, [sp, 0x4] + ldrb r0, [r7] + str r0, [sp, 0x8] + mov r0, r9 + mov r2, r10 + adds r3, r4, 0 + bl FillBgTilemapBufferRect + ldr r0, =gUnknown_0203CD9C + ldrh r1, [r0] + adds r1, 0x3 + lsls r1, 16 + lsrs r1, 16 + str r5, [sp] + ldr r2, [sp, 0x14] + str r2, [sp, 0x4] + ldrb r0, [r7] + str r0, [sp, 0x8] + mov r0, r9 + adds r2, r6, 0 + mov r3, r8 + bl FillBgTilemapBufferRect + ldr r0, =gUnknown_0203CD9C + ldrh r1, [r0] + adds r1, 0x5 + lsls r1, 16 + lsrs r1, 16 + str r5, [sp] + ldr r2, [sp, 0x14] + str r2, [sp, 0x4] + ldrb r0, [r7] + str r0, [sp, 0x8] + mov r0, r9 + mov r2, r10 + mov r3, r8 + bl FillBgTilemapBufferRect + ldr r0, =gUnknown_0203CD9C + ldrh r1, [r0] + adds r1, 0x6 + lsls r1, 16 + lsrs r1, 16 + ldr r2, [sp, 0x14] + add r8, r2 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + str r5, [sp] + str r5, [sp, 0x4] + ldrb r0, [r7] + str r0, [sp, 0x8] + mov r0, r9 + adds r2, r6, 0 + mov r3, r8 + bl FillBgTilemapBufferRect + ldr r2, =gUnknown_0203CD9C + ldrh r1, [r2] + adds r1, 0x7 + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x10] + str r0, [sp] + str r5, [sp, 0x4] + ldrb r0, [r7] + str r0, [sp, 0x8] + mov r0, r9 + ldr r2, [sp, 0xC] + mov r3, r8 + bl FillBgTilemapBufferRect + ldr r2, =gUnknown_0203CD9C + ldrh r1, [r2] + adds r1, 0x8 + lsls r1, 16 + lsrs r1, 16 + str r5, [sp] + str r5, [sp, 0x4] + ldrb r0, [r7] + str r0, [sp, 0x8] + mov r0, r9 + mov r2, r10 + mov r3, r8 + bl FillBgTilemapBufferRect + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end DrawWindowBorder + + thumb_func_start sub_8198070 +sub_8198070: @ 8198070 + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =sub_81980A8 + adds r0, r5, 0 + bl CallWindowFunction + adds r0, r5, 0 + movs r1, 0 + bl FillWindowPixelBuffer + adds r0, r5, 0 + bl ClearWindowTilemap + cmp r4, 0x1 + bne _0819809E + adds r0, r5, 0 + movs r1, 0x3 + bl CopyWindowToVram +_0819809E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8198070 + + thumb_func_start sub_81980A8 +sub_81980A8: @ 81980A8 + push {r4,r5,lr} + sub sp, 0xC + adds r4, r1, 0 + adds r5, r2, 0 + ldr r1, [sp, 0x18] + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsls r5, 24 + lsls r3, 24 + lsls r1, 24 + movs r2, 0xFF + lsls r2, 24 + adds r4, r2 + lsrs r4, 24 + adds r5, r2 + lsrs r5, 24 + movs r2, 0x80 + lsls r2, 18 + adds r3, r2 + lsrs r3, 24 + str r3, [sp] + adds r1, r2 + lsrs r1, 24 + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + adds r2, r4, 0 + adds r3, r5, 0 + bl FillBgTilemapBufferRect + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81980A8 + + thumb_func_start sub_81980F0 +sub_81980F0: @ 81980F0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + ldr r4, [sp, 0x20] + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 24 + lsrs r5, r3, 24 + lsls r4, 16 + lsrs r4, 16 + mov r0, sp + movs r1, 0 + movs r2, 0x8 + bl memset + cmp r6, 0x3 + bls _08198126 + movs r1, 0 + mov r0, sp + strb r1, [r0] + b _0819812A +_08198126: + mov r0, sp + strb r6, [r0] +_0819812A: + mov r1, sp + mov r0, r8 + strb r0, [r1, 0x2] + movs r0, 0x2 + strb r0, [r1, 0x4] + movs r0, 0x1E + subs r0, r7 + strb r0, [r1, 0x1] + strb r7, [r1, 0x3] + strb r5, [r1, 0x5] + strh r4, [r1, 0x6] + ldr r4, =gUnknown_0203CDA0 + mov r0, sp + bl AddWindow + strb r0, [r4] + cmp r5, 0xF + bls _08198158 + movs r5, 0xF0 + b _0819815C + .pool +_08198158: + lsls r0, r5, 28 + lsrs r5, r0, 24 +_0819815C: + ldr r0, =gUnknown_0860F0B0 + adds r1, r5, 0 + movs r2, 0x20 + bl LoadPalette + ldr r0, =gUnknown_0203CDA0 + ldrb r0, [r0] + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81980F0 + + thumb_func_start sub_8198180 +sub_8198180: @ 8198180 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + adds r6, r0, 0 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + ldr r5, =gUnknown_0203CDA0 + ldrb r0, [r5] + cmp r0, 0xFF + beq _081981EE + bl PutWindowTilemap + ldrb r0, [r5] + movs r1, 0xFF + bl FillWindowPixelBuffer + movs r0, 0 + adds r1, r6, 0 + movs r2, 0 + bl GetStringWidth + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldrb r0, [r5] + movs r1, 0x1 + bl GetWindowAttribute + movs r2, 0xEC + subs r2, r7 + lsls r0, 3 + subs r2, r0 + subs r2, r4 + lsls r2, 24 + lsrs r2, 24 + ldrb r0, [r5] + ldr r1, =gUnknown_0860F0D0 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r6, [sp, 0x8] + movs r3, 0x1 + bl box_print + mov r0, r8 + cmp r0, 0 + beq _081981EE + ldrb r0, [r5] + movs r1, 0x3 + bl CopyWindowToVram +_081981EE: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8198180 + + thumb_func_start sub_8198204 +sub_8198204: @ 8198204 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + mov r10, r0 + adds r6, r1, 0 + ldr r0, [sp, 0x38] + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + mov r8, r3 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r4, 0 + ldr r0, =gUnknown_0203CDA0 + ldrb r1, [r0] + adds r7, r0, 0 + cmp r1, 0xFF + beq _081982C8 + cmp r2, 0 + beq _08198244 + add r0, sp, 0x14 + strb r4, [r0] + adds r1, r0, 0 + b _0819824A + .pool +_08198244: + add r1, sp, 0x14 + movs r0, 0xF + strb r0, [r1] +_0819824A: + movs r0, 0x1 + strb r0, [r1, 0x1] + movs r0, 0x2 + strb r0, [r1, 0x2] + adds r5, r7, 0 + ldrb r0, [r5] + bl PutWindowTilemap + ldrb r0, [r5] + movs r1, 0xFF + bl FillWindowPixelBuffer + cmp r6, 0 + beq _0819829E + movs r0, 0 + adds r1, r6, 0 + movs r2, 0 + bl GetStringWidth + lsls r0, 16 + lsrs r4, r0, 16 + ldrb r0, [r5] + movs r1, 0x1 + bl GetWindowAttribute + movs r2, 0xEC + mov r1, r8 + subs r2, r1 + lsls r0, 3 + subs r2, r0 + subs r2, r4 + lsls r2, 24 + lsrs r2, 24 + ldrb r0, [r5] + add r1, sp, 0x14 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r6, [sp, 0x8] + movs r3, 0x1 + bl box_print +_0819829E: + ldrb r0, [r7] + movs r1, 0 + str r1, [sp] + str r1, [sp, 0x4] + add r2, sp, 0x14 + str r2, [sp, 0x8] + str r1, [sp, 0xC] + mov r1, r10 + str r1, [sp, 0x10] + movs r1, 0x1 + movs r2, 0x4 + movs r3, 0x1 + bl AddTextPrinterParametrized2 + mov r2, r9 + cmp r2, 0 + beq _081982C8 + ldrb r0, [r7] + movs r1, 0x3 + bl CopyWindowToVram +_081982C8: + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8198204 + + thumb_func_start sub_81982D8 +sub_81982D8: @ 81982D8 + push {lr} + ldr r1, =gUnknown_0203CDA0 + ldrb r0, [r1] + cmp r0, 0xFF + beq _081982E8 + movs r1, 0x3 + bl CopyWindowToVram +_081982E8: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81982D8 + + thumb_func_start sub_81982F0 +sub_81982F0: @ 81982F0 + push {r4,lr} + ldr r4, =gUnknown_0203CDA0 + ldrb r0, [r4] + cmp r0, 0xFF + beq _08198308 + movs r1, 0xFF + bl FillWindowPixelBuffer + ldrb r0, [r4] + movs r1, 0x3 + bl CopyWindowToVram +_08198308: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81982F0 + + thumb_func_start sub_8198314 +sub_8198314: @ 8198314 + push {r4,lr} + ldr r4, =gUnknown_0203CDA0 + ldrb r0, [r4] + cmp r0, 0xFF + beq _0819833C + movs r1, 0 + bl FillWindowPixelBuffer + ldrb r0, [r4] + bl ClearWindowTilemap + ldrb r0, [r4] + movs r1, 0x3 + bl CopyWindowToVram + ldrb r0, [r4] + bl RemoveWindow + movs r0, 0xFF + strb r0, [r4] +_0819833C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8198314 + + thumb_func_start sub_8198348 +sub_8198348: @ 8198348 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, [sp, 0x18] + mov r8, r4 + ldr r4, [sp, 0x1C] + ldr r5, [sp, 0x20] + ldr r6, [sp, 0x24] + mov r12, r6 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r7, r5, 24 + ldr r5, =gUnknown_0203CD90 + movs r6, 0 + strb r2, [r5] + strb r3, [r5, 0x1] + strb r6, [r5, 0x3] + subs r4, 0x1 + strb r4, [r5, 0x4] + strb r0, [r5, 0x5] + strb r1, [r5, 0x6] + mov r0, r8 + strb r0, [r5, 0x8] + mov r4, r12 + strb r4, [r5, 0xB] + cmp r7, 0 + blt _08198388 + movs r0, 0x4 + ldrsb r0, [r5, r0] + cmp r7, r0 + ble _08198390 +_08198388: + strb r6, [r5, 0x2] + b _08198392 + .pool +_08198390: + strb r7, [r5, 0x2] +_08198392: + movs r0, 0 + bl MoveMenuCursor + ldr r0, =gUnknown_0203CD90 + ldrb r0, [r0, 0x2] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8198348 + + thumb_func_start sub_81983AC +sub_81983AC: @ 81983AC + push {r4-r6,lr} + sub sp, 0x10 + ldr r4, [sp, 0x20] + ldr r5, [sp, 0x24] + ldr r6, [sp, 0x28] + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + str r4, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + movs r4, 0 + str r4, [sp, 0xC] + bl sub_8198348 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x10 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81983AC + + thumb_func_start sub_81983EC +sub_81983EC: @ 81983EC + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x14 + mov r8, r0 + adds r6, r1, 0 + ldr r4, [sp, 0x28] + ldr r5, [sp, 0x2C] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r6, 24 + lsrs r6, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + adds r0, r6, 0 + movs r1, 0x1 + str r2, [sp, 0xC] + str r3, [sp, 0x10] + bl GetMenuCursorDimensionByFont + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + mov r0, r8 + adds r1, r6, 0 + ldr r2, [sp, 0xC] + ldr r3, [sp, 0x10] + bl sub_81983AC + lsls r0, 24 + lsrs r0, 24 + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81983EC + + thumb_func_start RedrawMenuCursor +@ void RedrawMenuCursor(s8 oldPos, s8 newPos) +RedrawMenuCursor: @ 8198448 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0xC + adds r6, r0, 0 + mov r8, r1 + lsls r6, 24 + lsrs r6, 24 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r5, =gUnknown_0203CD90 + ldrb r0, [r5, 0x6] + movs r1, 0 + bl GetMenuCursorDimensionByFont + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldrb r0, [r5, 0x6] + movs r1, 0x1 + bl GetMenuCursorDimensionByFont + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r5, 0x5] + mov r9, r1 + ldrb r2, [r5] + ldrb r1, [r5, 0x8] + adds r3, r1, 0 + muls r3, r6 + ldrb r6, [r5, 0x1] + adds r3, r6 + lsls r3, 16 + lsrs r3, 16 + str r4, [sp] + str r0, [sp, 0x4] + mov r0, r9 + movs r1, 0x11 + bl FillWindowPixelRect + ldrb r0, [r5, 0x5] + ldrb r1, [r5, 0x6] + ldr r2, =gUnknown_085EE498 + ldrb r3, [r5] + ldrb r4, [r5, 0x8] + mov r6, r8 + muls r6, r4 + adds r4, r6, 0 + ldrb r5, [r5, 0x1] + adds r4, r5 + lsls r4, 24 + lsrs r4, 24 + str r4, [sp] + movs r4, 0 + str r4, [sp, 0x4] + str r4, [sp, 0x8] + bl Print + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end RedrawMenuCursor + + thumb_func_start MoveMenuCursor +@ s8 MoveMenuCursor(s8 cursorDelta) +MoveMenuCursor: @ 81984D8 + push {r4,r5,lr} + ldr r1, =gUnknown_0203CD90 + ldrb r5, [r1, 0x2] + movs r2, 0x2 + ldrsb r2, [r1, r2] + lsls r0, 24 + asrs r3, r0, 24 + adds r2, r3 + movs r0, 0x3 + ldrsb r0, [r1, r0] + adds r4, r1, 0 + cmp r2, r0 + bge _081984FC + ldrb r0, [r4, 0x4] + b _0819850A + .pool +_081984FC: + movs r0, 0x4 + ldrsb r0, [r4, r0] + cmp r2, r0 + ble _08198508 + ldrb r0, [r4, 0x3] + b _0819850A +_08198508: + adds r0, r3, r5 +_0819850A: + strb r0, [r4, 0x2] + ldrb r1, [r4, 0x2] + adds r0, r5, 0 + bl RedrawMenuCursor + ldrb r0, [r4, 0x2] + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end MoveMenuCursor + + thumb_func_start MoveMenuCursorNoWrapAround +@ s8 MoveMenuCursorNoWrapAround(s8 cursorDelta) +MoveMenuCursorNoWrapAround: @ 819851C + push {r4,r5,lr} + ldr r1, =gUnknown_0203CD90 + ldrb r5, [r1, 0x2] + movs r2, 0x2 + ldrsb r2, [r1, r2] + lsls r0, 24 + asrs r3, r0, 24 + adds r2, r3 + movs r0, 0x3 + ldrsb r0, [r1, r0] + adds r4, r1, 0 + cmp r2, r0 + bge _08198540 + ldrb r0, [r4, 0x3] + b _0819854E + .pool +_08198540: + movs r0, 0x4 + ldrsb r0, [r4, r0] + cmp r2, r0 + ble _0819854C + ldrb r0, [r4, 0x4] + b _0819854E +_0819854C: + adds r0, r3, r5 +_0819854E: + strb r0, [r4, 0x2] + ldrb r1, [r4, 0x2] + adds r0, r5, 0 + bl RedrawMenuCursor + ldrb r0, [r4, 0x2] + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end MoveMenuCursorNoWrapAround + + thumb_func_start GetMenuCursorPos +GetMenuCursorPos: @ 8198560 + ldr r0, =gUnknown_0203CD90 + ldrb r0, [r0, 0x2] + bx lr + .pool + thumb_func_end GetMenuCursorPos + + thumb_func_start ProcessMenuInput +ProcessMenuInput: @ 819856C + push {r4,lr} + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08198598 + ldr r4, =gUnknown_0203CD90 + ldrb r0, [r4, 0xB] + cmp r0, 0 + bne _08198588 + movs r0, 0x5 + bl PlaySE +_08198588: + movs r0, 0x2 + ldrsb r0, [r4, r0] + b _081985D2 + .pool +_08198598: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081985A6 + movs r0, 0x1 + negs r0, r0 + b _081985D2 +_081985A6: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081985BA + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + negs r0, r0 + b _081985CA +_081985BA: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081985CE + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 +_081985CA: + bl MoveMenuCursor +_081985CE: + movs r0, 0x2 + negs r0, r0 +_081985D2: + pop {r4} + pop {r1} + bx r1 + thumb_func_end ProcessMenuInput + + thumb_func_start ProcessMenuInputNoWrapAround +@ int ProcessMenuInputNoWrapAround() +ProcessMenuInputNoWrapAround: @ 81985D8 + push {r4-r6,lr} + ldr r4, =gUnknown_0203CD90 + ldrb r5, [r4, 0x2] + adds r6, r5, 0 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08198608 + ldrb r0, [r4, 0xB] + cmp r0, 0 + bne _081985F8 + movs r0, 0x5 + bl PlaySE +_081985F8: + movs r0, 0x2 + ldrsb r0, [r4, r0] + b _08198650 + .pool +_08198608: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08198616 + movs r0, 0x1 + negs r0, r0 + b _08198650 +_08198616: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08198630 + movs r0, 0x1 + negs r0, r0 + bl MoveMenuCursorNoWrapAround + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + beq _0819864C + b _08198646 +_08198630: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0819864C + movs r0, 0x1 + bl MoveMenuCursorNoWrapAround + lsls r0, 24 + lsrs r0, 24 + cmp r6, r0 + beq _0819864C +_08198646: + movs r0, 0x5 + bl PlaySE +_0819864C: + movs r0, 0x2 + negs r0, r0 +_08198650: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end ProcessMenuInputNoWrapAround + + thumb_func_start ProcessMenuInput_other +ProcessMenuInput_other: @ 8198658 + push {r4,lr} + ldr r2, =gMain + ldrh r1, [r2, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08198684 + ldr r4, =gUnknown_0203CD90 + ldrb r0, [r4, 0xB] + cmp r0, 0 + bne _08198674 + movs r0, 0x5 + bl PlaySE +_08198674: + movs r0, 0x2 + ldrsb r0, [r4, r0] + b _081986BC + .pool +_08198684: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08198692 + movs r0, 0x1 + negs r0, r0 + b _081986BC +_08198692: + ldrh r0, [r2, 0x30] + movs r1, 0xF0 + ands r1, r0 + cmp r1, 0x40 + bne _081986A8 + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + negs r0, r0 + b _081986B4 +_081986A8: + cmp r1, 0x80 + bne _081986B8 + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 +_081986B4: + bl MoveMenuCursor +_081986B8: + movs r0, 0x2 + negs r0, r0 +_081986BC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end ProcessMenuInput_other + + thumb_func_start ProcessMenuInputNoWrapAround_other +ProcessMenuInputNoWrapAround_other: @ 81986C4 + push {r4-r6,lr} + ldr r4, =gUnknown_0203CD90 + ldrb r5, [r4, 0x2] + adds r6, r5, 0 + ldr r2, =gMain + ldrh r1, [r2, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081986F4 + ldrb r0, [r4, 0xB] + cmp r0, 0 + bne _081986E4 + movs r0, 0x5 + bl PlaySE +_081986E4: + movs r0, 0x2 + ldrsb r0, [r4, r0] + b _0819873A + .pool +_081986F4: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08198702 + movs r0, 0x1 + negs r0, r0 + b _0819873A +_08198702: + ldrh r0, [r2, 0x30] + movs r1, 0xF0 + ands r1, r0 + cmp r1, 0x40 + bne _0819871E + movs r0, 0x1 + negs r0, r0 + bl MoveMenuCursorNoWrapAround + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + beq _08198736 + b _08198730 +_0819871E: + cmp r1, 0x80 + bne _08198736 + movs r0, 0x1 + bl MoveMenuCursorNoWrapAround + lsls r0, 24 + lsrs r0, 24 + cmp r6, r0 + beq _08198736 +_08198730: + movs r0, 0x5 + bl PlaySE +_08198736: + movs r0, 0x2 + negs r0, r0 +_0819873A: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end ProcessMenuInputNoWrapAround_other + + thumb_func_start PrintTextArray +PrintTextArray: @ 8198740 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + ldr r4, [sp, 0x2C] + ldr r5, [sp, 0x30] + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + lsls r3, 24 + lsrs r3, 24 + mov r8, r3 + lsls r4, 24 + lsrs r7, r4, 24 + lsls r5, 24 + lsrs r5, 24 + movs r4, 0 + cmp r4, r5 + bcs _081987A4 +_08198774: + lsls r0, r4, 3 + ldr r1, [sp, 0x34] + adds r0, r1 + ldr r2, [r0] + adds r0, r7, 0 + muls r0, r4 + add r0, r8 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + adds r0, r6, 0 + mov r1, r10 + mov r3, r9 + bl Print + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcc _08198774 +_081987A4: + adds r0, r6, 0 + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end PrintTextArray + + thumb_func_start sub_81987BC +sub_81987BC: @ 81987BC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + ldr r4, [sp, 0x40] + ldr r5, [sp, 0x44] + ldr r6, [sp, 0x4C] + ldr r7, [sp, 0x50] + mov r8, r7 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x14] + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x18] + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x1C] + lsls r4, 24 + lsrs r4, 24 + mov r10, r4 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + mov r9, r6 + mov r0, r8 + lsls r0, 24 + lsrs r6, r0, 24 + movs r4, 0 + cmp r4, r5 + bcs _0819883C +_08198804: + lsls r0, r4, 3 + ldr r1, [sp, 0x48] + adds r0, r1 + ldr r2, [r0] + mov r0, r10 + muls r0, r4 + ldr r1, [sp, 0x1C] + adds r0, r1, r0 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + mov r0, r9 + str r0, [sp, 0xC] + str r6, [sp, 0x10] + adds r0, r7, 0 + ldr r1, [sp, 0x14] + ldr r3, [sp, 0x18] + bl sub_8199F74 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcc _08198804 +_0819883C: + adds r0, r7, 0 + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81987BC + + thumb_func_start sub_8198854 +sub_8198854: @ 8198854 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + mov r8, r0 + adds r6, r1, 0 + adds r4, r2, 0 + adds r5, r3, 0 + ldr r7, [sp, 0x24] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r6, 24 + lsrs r6, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + adds r0, r6, 0 + movs r1, 0 + bl GetFontAttribute + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + str r4, [sp] + str r5, [sp, 0x4] + str r7, [sp, 0x8] + mov r0, r8 + adds r1, r6, 0 + movs r3, 0x1 + bl PrintTextArray + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8198854 + + thumb_func_start AddItemMenuActionTextPrinters +AddItemMenuActionTextPrinters: @ 81988A4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + adds r6, r1, 0 + mov r8, r2 + ldr r1, [sp, 0x38] + mov r9, r1 + ldr r1, [sp, 0x3C] + ldr r2, [sp, 0x40] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x10] + lsls r6, 24 + lsrs r6, 24 + mov r4, r8 + lsls r4, 24 + lsrs r4, 24 + mov r8, r4 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x14] + mov r0, r9 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r2, 24 + lsrs r7, r2, 24 + mov r0, sp + ldrb r1, [r0, 0x10] + strb r1, [r0, 0x4] + strb r6, [r0, 0x5] + adds r0, r6, 0 + movs r1, 0x5 + bl GetFontAttribute + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xC] + movs r5, 0xF + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xC] + adds r0, r6, 0 + movs r1, 0x6 + bl GetFontAttribute + mov r3, sp + adds r1, r5, 0 + ands r1, r0 + ldrb r2, [r3, 0xD] + movs r4, 0x10 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0xD] + adds r0, r6, 0 + movs r1, 0x7 + bl GetFontAttribute + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xD] + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xD] + adds r0, r6, 0 + movs r1, 0x4 + bl GetFontAttribute + mov r1, sp + ands r5, r0 + ldrb r0, [r1, 0xC] + ands r4, r0 + orrs r4, r5 + strb r4, [r1, 0xC] + mov r0, sp + mov r2, r9 + strb r2, [r0, 0xA] + adds r0, r6, 0 + movs r1, 0x3 + bl GetFontAttribute + mov r1, sp + strb r0, [r1, 0xB] + mov r0, sp + mov r4, r8 + strb r4, [r0, 0x6] + strb r4, [r0, 0x8] + movs r4, 0 + cmp r4, r7 + bcs _0819899E + mov r5, sp +_0819896E: + ldr r1, [sp, 0x48] + adds r0, r1, r4 + ldrb r0, [r0] + lsls r0, 3 + ldr r2, [sp, 0x44] + adds r0, r2 + ldr r0, [r0] + str r0, [sp] + mov r0, r10 + muls r0, r4 + ldr r1, [sp, 0x14] + adds r0, r1, r0 + strb r0, [r5, 0x7] + strb r0, [r5, 0x9] + mov r0, sp + movs r1, 0xFF + movs r2, 0 + bl AddTextPrinter + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r7 + bcc _0819896E +_0819899E: + ldr r0, [sp, 0x10] + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end AddItemMenuActionTextPrinters + + thumb_func_start sub_81989B8 +sub_81989B8: @ 81989B8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + mov r9, r0 + adds r4, r1, 0 + adds r6, r2, 0 + mov r8, r3 + ldr r7, [sp, 0x30] + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r4, 24 + lsrs r4, 24 + lsls r6, 24 + lsrs r6, 24 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + adds r0, r4, 0 + movs r1, 0 + bl GetFontAttribute + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + adds r0, r4, 0 + movs r1, 0x2 + bl GetFontAttribute + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + str r6, [sp, 0x4] + mov r0, r8 + str r0, [sp, 0x8] + str r7, [sp, 0xC] + ldr r0, [sp, 0x34] + str r0, [sp, 0x10] + mov r0, r9 + adds r1, r4, 0 + adds r2, r5, 0 + movs r3, 0x1 + bl AddItemMenuActionTextPrinters + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81989B8 + + thumb_func_start rbox_template_set +@ void rbox_template_set(WindowTemplate *template, char bg_id, char x, char y, char w, char h, char a7, s16 a8) +rbox_template_set: @ 8198A24 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, [sp, 0x18] + ldr r5, [sp, 0x1C] + ldr r6, [sp, 0x20] + ldr r7, [sp, 0x24] + mov r8, r7 + strb r1, [r0] + strb r2, [r0, 0x1] + strb r3, [r0, 0x2] + strb r4, [r0, 0x3] + strb r5, [r0, 0x4] + strb r6, [r0, 0x5] + mov r1, r8 + strh r1, [r0, 0x6] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end rbox_template_set + + thumb_func_start sub_8198A50 +sub_8198A50: @ 8198A50 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x18 + mov r8, r0 + ldr r0, [sp, 0x2C] + ldr r4, [sp, 0x30] + ldr r5, [sp, 0x34] + ldr r6, [sp, 0x38] + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 16 + lsrs r6, 16 + str r0, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + str r6, [sp, 0xC] + add r0, sp, 0x10 + bl rbox_template_set + ldr r0, [sp, 0x10] + ldr r1, [sp, 0x14] + mov r2, r8 + str r0, [r2] + str r1, [r2, 0x4] + mov r0, r8 + add sp, 0x18 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r2} + bx r2 + thumb_func_end sub_8198A50 + + thumb_func_start sub_8198AA4 +sub_8198AA4: @ 8198AA4 + push {r4-r6,lr} + sub sp, 0x18 + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + ldr r0, [sp, 0x28] + ldr r1, [sp, 0x2C] + ldr r2, [sp, 0x30] + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 16 + lsrs r2, 16 + str r3, [sp] + str r0, [sp, 0x4] + str r1, [sp, 0x8] + str r2, [sp, 0xC] + add r0, sp, 0x10 + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl rbox_template_set + add r0, sp, 0x10 + bl AddWindow + lsls r0, 16 + lsrs r0, 16 + add sp, 0x18 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8198AA4 + + thumb_func_start sub_8198AF8 +sub_8198AF8: @ 8198AF8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + adds r6, r1, 0 + mov r8, r2 + mov r9, r3 + ldr r4, [sp, 0x3C] + ldr r5, [sp, 0x40] + ldr r1, [sp, 0x44] + mov r10, r1 + lsls r6, 24 + lsrs r6, 24 + mov r1, r8 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + mov r1, r9 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 24 + lsrs r5, 24 + mov r1, r10 + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + ldr r7, =gUnknown_0203CD9F + bl AddWindow + strb r0, [r7] + ldrb r0, [r7] + movs r1, 0x1 + adds r2, r4, 0 + adds r3, r5, 0 + bl SetWindowBorderStyle + ldr r0, =gUnknown_085EE491 + str r0, [sp, 0xC] + add r1, sp, 0xC + ldrb r0, [r7] + strb r0, [r1, 0x4] + adds r0, r1, 0 + strb r6, [r0, 0x5] + adds r0, r6, 0 + movs r1, 0 + bl GetFontAttribute + add r1, sp, 0xC + add r0, r8 + strb r0, [r1, 0x6] + adds r0, r1, 0 + mov r1, r9 + strb r1, [r0, 0x7] + adds r1, r0, 0 + ldrb r0, [r0, 0x6] + strb r0, [r1, 0x8] + adds r0, r1, 0 + ldrb r0, [r0, 0x7] + strb r0, [r1, 0x9] + adds r0, r6, 0 + movs r1, 0x5 + bl GetFontAttribute + add r3, sp, 0xC + lsls r0, 4 + ldrb r2, [r3, 0xC] + movs r5, 0xF + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xC] + adds r0, r6, 0 + movs r1, 0x6 + bl GetFontAttribute + add r3, sp, 0xC + adds r1, r5, 0 + ands r1, r0 + ldrb r2, [r3, 0xD] + movs r4, 0x10 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0xD] + adds r0, r6, 0 + movs r1, 0x7 + bl GetFontAttribute + add r3, sp, 0xC + lsls r0, 4 + ldrb r2, [r3, 0xD] + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xD] + adds r0, r6, 0 + movs r1, 0x4 + bl GetFontAttribute + add r1, sp, 0xC + ands r5, r0 + ldrb r0, [r1, 0xC] + ands r4, r0 + orrs r4, r5 + strb r4, [r1, 0xC] + adds r0, r6, 0 + movs r1, 0x2 + bl GetFontAttribute + add r1, sp, 0xC + strb r0, [r1, 0xA] + adds r0, r6, 0 + movs r1, 0x3 + bl GetFontAttribute + add r1, sp, 0xC + strb r0, [r1, 0xB] + adds r0, r1, 0 + movs r1, 0xFF + movs r2, 0 + bl AddTextPrinter + adds r0, r6, 0 + movs r1, 0x1 + bl GetFontAttribute + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r7] + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + mov r0, r10 + str r0, [sp, 0x8] + adds r0, r1, 0 + adds r1, r6, 0 + mov r2, r8 + mov r3, r9 + bl sub_81983AC + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8198AF8 + + thumb_func_start sub_8198C34 +sub_8198C34: @ 8198C34 + push {lr} + sub sp, 0xC + lsls r1, 24 + lsrs r1, 24 + lsls r2, 16 + lsrs r2, 16 + lsls r3, 24 + lsrs r3, 24 + str r2, [sp] + str r3, [sp, 0x4] + movs r2, 0 + str r2, [sp, 0x8] + movs r3, 0x1 + bl sub_8198AF8 + add sp, 0xC + pop {r0} + bx r0 + thumb_func_end sub_8198C34 + + thumb_func_start sub_8198C58 +sub_8198C58: @ 8198C58 + push {r4,lr} + bl ProcessMenuInputNoWrapAround + lsls r0, 24 + asrs r4, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _08198C6E + bl sub_8198C78 +_08198C6E: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8198C58 + + thumb_func_start sub_8198C78 +sub_8198C78: @ 8198C78 + push {r4,lr} + ldr r4, =gUnknown_0203CD9F + ldrb r0, [r4] + movs r1, 0x1 + bl sub_8198070 + ldrb r0, [r4] + bl RemoveWindow + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8198C78 + + thumb_func_start sub_8198C94 +sub_8198C94: @ 8198C94 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + ldr r4, [sp, 0x40] + ldr r5, [sp, 0x44] + ldr r6, [sp, 0x48] + ldr r7, [sp, 0x4C] + mov r8, r7 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0xC] + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x10] + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x14] + lsls r4, 24 + lsrs r4, 24 + str r4, [sp, 0x18] + lsls r5, 24 + lsrs r5, 24 + str r5, [sp, 0x1C] + lsls r6, 24 + lsrs r6, 24 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r5, 0 + cmp r5, r9 + bcs _08198D3A +_08198CE0: + movs r4, 0 + adds r1, r5, 0x1 + mov r8, r1 + cmp r4, r6 + bcs _08198D30 + ldr r7, [sp, 0x1C] + adds r0, r7, 0 + muls r0, r5 + ldr r1, [sp, 0x14] + adds r0, r1, r0 + lsls r0, 24 + lsrs r7, r0, 24 +_08198CF8: + adds r0, r5, 0 + muls r0, r6 + adds r0, r4 + lsls r0, 3 + ldr r1, [sp, 0x50] + adds r0, r1 + ldr r2, [r0] + ldr r0, [sp, 0x18] + adds r3, r0, 0 + muls r3, r4 + ldr r1, [sp, 0x10] + adds r3, r1, r3 + lsls r3, 24 + lsrs r3, 24 + str r7, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + mov r0, r10 + ldr r1, [sp, 0xC] + bl Print + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r6 + bcc _08198CF8 +_08198D30: + mov r7, r8 + lsls r0, r7, 24 + lsrs r5, r0, 24 + cmp r5, r9 + bcc _08198CE0 +_08198D3A: + mov r0, r10 + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8198C94 + + thumb_func_start sub_8198D54 +sub_8198D54: @ 8198D54 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x18 + mov r9, r0 + mov r8, r1 + adds r4, r2, 0 + adds r5, r3, 0 + ldr r6, [sp, 0x34] + ldr r3, [sp, 0x38] + ldr r7, [sp, 0x3C] + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r3, 24 + lsrs r3, 24 + movs r1, 0 + str r3, [sp, 0x14] + bl GetFontAttribute + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + str r4, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + ldr r3, [sp, 0x14] + str r3, [sp, 0xC] + str r7, [sp, 0x10] + mov r0, r9 + mov r1, r8 + movs r3, 0 + bl sub_8198C94 + add sp, 0x18 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8198D54 + + thumb_func_start sub_8198DBC +sub_8198DBC: @ 8198DBC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + ldr r4, [sp, 0x40] + ldr r5, [sp, 0x44] + ldr r6, [sp, 0x48] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x10] + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x14] + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x18] + lsls r4, 24 + lsrs r4, 24 + str r4, [sp, 0x1C] + lsls r5, 24 + lsrs r5, 24 + mov r8, r5 + lsls r6, 24 + lsrs r6, 24 + mov r10, r6 + mov r0, sp + ldrb r1, [r0, 0x10] + strb r1, [r0, 0x4] + strb r7, [r0, 0x5] + adds r0, r7, 0 + movs r1, 0x5 + bl GetFontAttribute + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xC] + movs r5, 0xF + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xC] + adds r0, r7, 0 + movs r1, 0x6 + bl GetFontAttribute + mov r3, sp + adds r1, r5, 0 + ands r1, r0 + ldrb r2, [r3, 0xD] + movs r4, 0x10 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0xD] + adds r0, r7, 0 + movs r1, 0x7 + bl GetFontAttribute + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xD] + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xD] + adds r0, r7, 0 + movs r1, 0x4 + bl GetFontAttribute + mov r1, sp + ands r5, r0 + ldrb r0, [r1, 0xC] + ands r4, r0 + orrs r4, r5 + strb r4, [r1, 0xC] + adds r0, r7, 0 + movs r1, 0x2 + bl GetFontAttribute + mov r1, sp + strb r0, [r1, 0xA] + adds r0, r7, 0 + movs r1, 0x3 + bl GetFontAttribute + mov r1, sp + strb r0, [r1, 0xB] + movs r6, 0 + cmp r6, r10 + bcs _08198EDE +_08198E7A: + movs r5, 0 + adds r2, r6, 0x1 + mov r9, r2 + cmp r5, r8 + bcs _08198ED4 + mov r4, sp +_08198E86: + mov r0, r8 + muls r0, r6 + adds r0, r5 + ldr r1, [sp, 0x50] + adds r0, r1, r0 + ldrb r0, [r0] + lsls r0, 3 + ldr r2, [sp, 0x4C] + adds r0, r2 + ldr r0, [r0] + str r0, [sp] + ldr r1, [sp, 0x1C] + adds r0, r1, 0 + muls r0, r5 + ldr r2, [sp, 0x14] + adds r0, r2, r0 + strb r0, [r4, 0x6] + adds r0, r7, 0 + movs r1, 0x1 + bl GetFontAttribute + adds r1, r6, 0 + muls r1, r0 + ldr r0, [sp, 0x18] + adds r1, r0, r1 + strb r1, [r4, 0x7] + ldrb r0, [r4, 0x6] + strb r0, [r4, 0x8] + strb r1, [r4, 0x9] + mov r0, sp + movs r1, 0xFF + movs r2, 0 + bl AddTextPrinter + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, r8 + bcc _08198E86 +_08198ED4: + mov r1, r9 + lsls r0, r1, 24 + lsrs r6, r0, 24 + cmp r6, r10 + bcc _08198E7A +_08198EDE: + ldr r0, [sp, 0x10] + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8198DBC + + thumb_func_start sub_8198EF8 +sub_8198EF8: @ 8198EF8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x18 + mov r8, r0 + adds r3, r1, 0 + adds r4, r2, 0 + ldr r5, [sp, 0x30] + ldr r6, [sp, 0x34] + ldr r7, [sp, 0x38] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + adds r0, r3, 0 + movs r1, 0 + str r3, [sp, 0x14] + bl GetFontAttribute + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + str r4, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + str r7, [sp, 0xC] + ldr r0, [sp, 0x3C] + str r0, [sp, 0x10] + mov r0, r8 + ldr r3, [sp, 0x14] + adds r1, r3, 0 + movs r3, 0 + bl sub_8198DBC + add sp, 0x18 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8198EF8 + + thumb_func_start sub_8198F58 +sub_8198F58: @ 8198F58 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, [sp, 0x20] + mov r12, r4 + ldr r4, [sp, 0x24] + mov r8, r4 + ldr r4, [sp, 0x28] + mov r9, r4 + ldr r4, [sp, 0x2C] + mov r10, r4 + ldr r4, [sp, 0x30] + ldr r5, [sp, 0x34] + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r7, r5, 24 + ldr r5, =gUnknown_0203CD90 + movs r6, 0 + strb r2, [r5] + strb r3, [r5, 0x1] + strb r6, [r5, 0x3] + subs r4, 0x1 + strb r4, [r5, 0x4] + strb r0, [r5, 0x5] + strb r1, [r5, 0x6] + mov r0, r12 + strb r0, [r5, 0x7] + mov r4, r8 + strb r4, [r5, 0x8] + mov r0, r9 + strb r0, [r5, 0x9] + mov r4, r10 + strb r4, [r5, 0xA] + cmp r7, 0 + blt _08198FAC + movs r0, 0x4 + ldrsb r0, [r5, r0] + cmp r7, r0 + ble _08198FB4 +_08198FAC: + strb r6, [r5, 0x2] + b _08198FB6 + .pool +_08198FB4: + strb r7, [r5, 0x2] +_08198FB6: + movs r0, 0 + movs r1, 0 + bl sub_8199134 + ldr r0, =gUnknown_0203CD90 + ldrb r0, [r0, 0x2] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8198F58 + + thumb_func_start sub_8198FD4 +sub_8198FD4: @ 8198FD4 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0x20 + mov r9, r0 + mov r8, r1 + mov r10, r2 + ldr r6, [sp, 0x3C] + ldr r4, [sp, 0x40] + ldr r5, [sp, 0x44] + ldr r2, [sp, 0x48] + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + mov r0, r10 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + lsls r3, 24 + lsrs r3, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r2, 24 + lsrs r2, 24 + mov r0, r8 + movs r1, 0x1 + str r2, [sp, 0x18] + str r3, [sp, 0x1C] + bl GetMenuCursorDimensionByFont + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + muls r1, r5 + lsls r1, 24 + lsrs r1, 24 + str r6, [sp] + str r0, [sp, 0x4] + str r4, [sp, 0x8] + str r5, [sp, 0xC] + str r1, [sp, 0x10] + ldr r2, [sp, 0x18] + str r2, [sp, 0x14] + mov r0, r9 + mov r1, r8 + mov r2, r10 + ldr r3, [sp, 0x1C] + bl sub_8198F58 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8198FD4 + + thumb_func_start sub_8199060 +sub_8199060: @ 8199060 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + mov r8, r0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r0, r1, 24 + lsrs r7, r0, 24 + ldr r5, =gUnknown_0203CD90 + ldrb r0, [r5, 0x6] + movs r1, 0 + bl GetMenuCursorDimensionByFont + mov r9, r0 + mov r1, r9 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + ldrb r0, [r5, 0x6] + movs r1, 0x1 + bl GetMenuCursorDimensionByFont + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + ldrb r0, [r5, 0x9] + mov r10, r0 + mov r0, r8 + mov r1, r10 + bl __umodsi3 + ldrb r1, [r5, 0x7] + adds r4, r1, 0 + muls r4, r0 + ldrb r1, [r5] + adds r4, r1 + lsls r4, 24 + lsrs r4, 24 + mov r0, r8 + mov r1, r10 + bl __udivsi3 + ldrb r1, [r5, 0x8] + adds r3, r1, 0 + muls r3, r0 + ldrb r0, [r5, 0x1] + adds r3, r0 + lsls r3, 24 + lsrs r3, 24 + ldrb r0, [r5, 0x5] + mov r1, r9 + str r1, [sp] + str r6, [sp, 0x4] + movs r1, 0x11 + adds r2, r4, 0 + bl FillWindowPixelRect + ldrb r6, [r5, 0x9] + adds r0, r7, 0 + adds r1, r6, 0 + bl __umodsi3 + ldrb r1, [r5, 0x7] + adds r4, r1, 0 + muls r4, r0 + ldrb r0, [r5] + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r7, 0 + adds r1, r6, 0 + bl __udivsi3 + ldrb r1, [r5, 0x8] + adds r3, r1, 0 + muls r3, r0 + ldrb r1, [r5, 0x1] + adds r3, r1 + lsls r3, 24 + lsrs r3, 24 + ldrb r0, [r5, 0x5] + ldrb r1, [r5, 0x6] + ldr r2, =gUnknown_085EE498 + str r3, [sp] + movs r3, 0 + str r3, [sp, 0x4] + str r3, [sp, 0x8] + adds r3, r4, 0 + bl Print + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8199060 + + thumb_func_start sub_8199134 +sub_8199134: @ 8199134 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + ldr r1, =gUnknown_0203CD90 + ldrb r2, [r1, 0x2] + mov r8, r2 + lsls r0, 24 + asrs r6, r0, 24 + adds r5, r1, 0 + cmp r6, 0 + beq _0819918A + movs r7, 0x2 + ldrsb r7, [r5, r7] + ldrb r4, [r5, 0x9] + adds r0, r7, 0 + adds r1, r4, 0 + bl __modsi3 + adds r0, r6 + cmp r0, 0 + bge _08199174 + adds r0, r4, 0 + adds r0, 0xFF + add r0, r8 + b _08199188 + .pool +_08199174: + cmp r0, r4 + blt _08199184 + adds r0, r7, 0 + adds r1, r4, 0 + bl __divsi3 + muls r0, r4 + b _08199188 +_08199184: + mov r1, r8 + adds r0, r6, r1 +_08199188: + strb r0, [r5, 0x2] +_0819918A: + mov r2, r9 + lsls r0, r2, 24 + asrs r6, r0, 24 + cmp r6, 0 + beq _081991CE + movs r0, 0x2 + ldrsb r0, [r5, r0] + ldrb r4, [r5, 0x9] + adds r1, r4, 0 + bl __divsi3 + adds r1, r0, r6 + cmp r1, 0 + bge _081991B2 + ldrb r0, [r5, 0xA] + subs r0, 0x1 + muls r0, r4 + ldrb r1, [r5, 0x2] + adds r0, r1 + b _081991CC +_081991B2: + ldrb r0, [r5, 0xA] + cmp r1, r0 + blt _081991C4 + subs r0, 0x1 + adds r1, r4, 0 + muls r1, r0 + ldrb r0, [r5, 0x2] + subs r0, r1 + b _081991CC +_081991C4: + adds r0, r4, 0 + muls r0, r6 + ldrb r2, [r5, 0x2] + adds r0, r2 +_081991CC: + strb r0, [r5, 0x2] +_081991CE: + movs r1, 0x2 + ldrsb r1, [r5, r1] + movs r0, 0x4 + ldrsb r0, [r5, r0] + cmp r1, r0 + bgt _081991E4 + ldrb r1, [r5, 0x2] + mov r0, r8 + bl sub_8199060 + b _081991E8 +_081991E4: + mov r0, r8 + strb r0, [r5, 0x2] +_081991E8: + ldrb r0, [r5, 0x2] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8199134 + + thumb_func_start sub_81991F8 +sub_81991F8: @ 81991F8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + ldr r1, =gUnknown_0203CD90 + ldrb r7, [r1, 0x2] + lsls r0, 24 + asrs r4, r0, 24 + adds r5, r1, 0 + cmp r4, 0 + beq _0819922C + movs r0, 0x2 + ldrsb r0, [r5, r0] + ldrb r6, [r5, 0x9] + adds r1, r6, 0 + bl __modsi3 + adds r0, r4 + cmp r0, 0 + blt _0819922C + cmp r0, r6 + bge _0819922C + adds r0, r4, r7 + strb r0, [r5, 0x2] +_0819922C: + mov r1, r8 + lsls r0, r1, 24 + asrs r4, r0, 24 + cmp r4, 0 + beq _08199258 + movs r0, 0x2 + ldrsb r0, [r5, r0] + ldrb r6, [r5, 0x9] + adds r1, r6, 0 + bl __divsi3 + adds r0, r4 + cmp r0, 0 + blt _08199258 + ldrb r1, [r5, 0xA] + cmp r0, r1 + bge _08199258 + adds r0, r6, 0 + muls r0, r4 + ldrb r1, [r5, 0x2] + adds r0, r1 + strb r0, [r5, 0x2] +_08199258: + movs r1, 0x2 + ldrsb r1, [r5, r1] + movs r0, 0x4 + ldrsb r0, [r5, r0] + cmp r1, r0 + bgt _08199274 + ldrb r1, [r5, 0x2] + adds r0, r7, 0 + bl sub_8199060 + b _08199276 + .pool +_08199274: + strb r7, [r5, 0x2] +_08199276: + ldrb r0, [r5, 0x2] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81991F8 + + thumb_func_start sub_8199284 +sub_8199284: @ 8199284 + push {r4,lr} + ldr r4, =gMain + ldrh r1, [r4, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081992AC + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_0203CD90 + ldrb r0, [r0, 0x2] + lsls r0, 24 + asrs r0, 24 + b _0819932C + .pool +_081992AC: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081992BA + movs r0, 0x1 + negs r0, r0 + b _0819932C +_081992BA: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081992D0 + movs r0, 0x5 + bl PlaySE + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + b _08199324 +_081992D0: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081992E4 + movs r0, 0x5 + bl PlaySE + movs r0, 0 + movs r1, 0x1 + b _08199324 +_081992E4: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _081992F8 + bl GetLRKeysState + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08199304 +_081992F8: + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + negs r0, r0 + b _08199322 +_08199304: + ldrh r1, [r4, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _0819931A + bl GetLRKeysState + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08199328 +_0819931A: + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 +_08199322: + movs r1, 0 +_08199324: + bl sub_8199134 +_08199328: + movs r0, 0x2 + negs r0, r0 +_0819932C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8199284 + + thumb_func_start sub_8199334 +sub_8199334: @ 8199334 + push {r4-r6,lr} + ldr r5, =gUnknown_0203CD90 + ldrb r4, [r5, 0x2] + ldr r6, =gMain + ldrh r1, [r6, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0819935C + movs r0, 0x5 + bl PlaySE + movs r0, 0x2 + ldrsb r0, [r5, r0] + b _081993D2 + .pool +_0819935C: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0819936A + movs r0, 0x1 + negs r0, r0 + b _081993D2 +_0819936A: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0819937A + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + b _081993BC +_0819937A: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08199388 + movs r0, 0 + movs r1, 0x1 + b _081993BC +_08199388: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _0819939C + bl GetLRKeysState + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081993A2 +_0819939C: + movs r0, 0x1 + negs r0, r0 + b _081993BA +_081993A2: + ldrh r1, [r6, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _081993B8 + bl GetLRKeysState + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _081993CE +_081993B8: + movs r0, 0x1 +_081993BA: + movs r1, 0 +_081993BC: + bl sub_81991F8 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + beq _081993CE + movs r0, 0x5 + bl PlaySE +_081993CE: + movs r0, 0x2 + negs r0, r0 +_081993D2: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8199334 + + thumb_func_start sub_81993D8 +sub_81993D8: @ 81993D8 + push {r4,r5,lr} + ldr r4, =gMain + ldrh r1, [r4, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08199400 + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_0203CD90 + ldrb r0, [r0, 0x2] + lsls r0, 24 + asrs r0, 24 + b _0819947C + .pool +_08199400: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0819940E + movs r0, 0x1 + negs r0, r0 + b _0819947C +_0819940E: + ldrh r0, [r4, 0x30] + movs r5, 0xF0 + adds r1, r5, 0 + ands r1, r0 + cmp r1, 0x40 + bne _08199428 + movs r0, 0x5 + bl PlaySE + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + b _08199474 +_08199428: + cmp r1, 0x80 + bne _08199438 + movs r0, 0x5 + bl PlaySE + movs r0, 0 + movs r1, 0x1 + b _08199474 +_08199438: + cmp r1, 0x20 + beq _08199448 + bl sub_812210C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08199454 +_08199448: + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + negs r0, r0 + b _08199472 +_08199454: + ldrh r1, [r4, 0x30] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0x10 + beq _0819946A + bl sub_812210C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08199478 +_0819946A: + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 +_08199472: + movs r1, 0 +_08199474: + bl sub_8199134 +_08199478: + movs r0, 0x2 + negs r0, r0 +_0819947C: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81993D8 + + thumb_func_start sub_8199484 +sub_8199484: @ 8199484 + push {r4-r6,lr} + ldr r6, =gUnknown_0203CD90 + ldrb r4, [r6, 0x2] + ldr r5, =gMain + ldrh r1, [r5, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081994AC + movs r0, 0x5 + bl PlaySE + movs r0, 0x2 + ldrsb r0, [r6, r0] + b _0819951E + .pool +_081994AC: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081994BA + movs r0, 0x1 + negs r0, r0 + b _0819951E +_081994BA: + ldrh r0, [r5, 0x30] + movs r6, 0xF0 + adds r1, r6, 0 + ands r1, r0 + cmp r1, 0x40 + bne _081994CE + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + b _08199508 +_081994CE: + cmp r1, 0x80 + bne _081994D8 + movs r0, 0 + movs r1, 0x1 + b _08199508 +_081994D8: + cmp r1, 0x20 + beq _081994E8 + bl sub_812210C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081994EE +_081994E8: + movs r0, 0x1 + negs r0, r0 + b _08199506 +_081994EE: + ldrh r1, [r5, 0x30] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0x10 + beq _08199504 + bl sub_812210C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _0819951A +_08199504: + movs r0, 0x1 +_08199506: + movs r1, 0 +_08199508: + bl sub_81991F8 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + beq _0819951A + movs r0, 0x5 + bl PlaySE +_0819951A: + movs r0, 0x2 + negs r0, r0 +_0819951E: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8199484 + + thumb_func_start InitMenuInUpperLeftCorner +@ int InitMenuInUpperLeftCorner(s8 windowId, s8 numItems, u8 initialCursorPos, bool doNotPlaySoundWhenAPressed) +InitMenuInUpperLeftCorner: @ 8199524 + push {r4-r6,lr} + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r5, r2, 24 + ldr r4, =gUnknown_0203CD90 + movs r6, 0 + strb r6, [r4] + movs r2, 0x1 + strb r2, [r4, 0x1] + strb r6, [r4, 0x3] + subs r1, 0x1 + strb r1, [r4, 0x4] + strb r0, [r4, 0x5] + strb r2, [r4, 0x6] + movs r0, 0x10 + strb r0, [r4, 0x8] + strb r3, [r4, 0xB] + cmp r5, 0 + blt _08199554 + movs r0, 0x4 + ldrsb r0, [r4, r0] + cmp r5, r0 + ble _0819955C +_08199554: + strb r6, [r4, 0x2] + b _0819955E + .pool +_0819955C: + strb r5, [r4, 0x2] +_0819955E: + movs r0, 0 + bl MoveMenuCursor + lsls r0, 24 + lsrs r0, 24 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end InitMenuInUpperLeftCorner + + thumb_func_start InitMenuInUpperLeftCornerPlaySoundWhenAPressed +InitMenuInUpperLeftCornerPlaySoundWhenAPressed: @ 8199570 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + movs r3, 0 + bl InitMenuInUpperLeftCorner + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end InitMenuInUpperLeftCornerPlaySoundWhenAPressed + + thumb_func_start PrintMenuTable +PrintMenuTable: @ 819958C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 24 + lsrs r7, r1, 24 + movs r5, 0 + cmp r5, r7 + bcs _081995D0 + movs r6, 0x80 + lsls r6, 17 + adds r4, r2, 0 +_081995AA: + ldr r2, [r4] + lsrs r0, r6, 24 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + mov r0, r8 + movs r1, 0x1 + movs r3, 0x8 + bl Print + movs r0, 0x80 + lsls r0, 21 + adds r6, r0 + adds r4, 0x8 + adds r5, 0x1 + cmp r5, r7 + bcc _081995AA +_081995D0: + mov r0, r8 + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end PrintMenuTable + + thumb_func_start sub_81995E4 +sub_81995E4: @ 81995E4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + mov r9, r2 + mov r8, r3 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + mov r0, sp + movs r1, 0 + mov r10, r1 + strb r6, [r0, 0x4] + mov r1, sp + movs r0, 0x1 + strb r0, [r1, 0x5] + movs r1, 0x5 + bl GetFontAttribute + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xC] + movs r5, 0xF + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xC] + movs r0, 0x1 + movs r1, 0x6 + bl GetFontAttribute + mov r3, sp + adds r1, r5, 0 + ands r1, r0 + ldrb r2, [r3, 0xD] + movs r4, 0x10 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0xD] + movs r0, 0x1 + movs r1, 0x7 + bl GetFontAttribute + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xD] + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xD] + movs r0, 0x1 + movs r1, 0x4 + bl GetFontAttribute + mov r1, sp + ands r5, r0 + ldrb r0, [r1, 0xC] + ands r4, r0 + orrs r4, r5 + strb r4, [r1, 0xC] + mov r0, sp + mov r1, r10 + strb r1, [r0, 0xA] + strb r1, [r0, 0xB] + movs r1, 0x8 + strb r1, [r0, 0x6] + strb r1, [r0, 0x8] + movs r4, 0 + cmp r4, r7 + bcs _081996A6 + mov r5, sp +_0819967C: + mov r1, r8 + adds r0, r1, r4 + ldrb r0, [r0] + lsls r0, 3 + add r0, r9 + ldr r0, [r0] + str r0, [sp] + lsls r0, r4, 4 + adds r0, 0x1 + strb r0, [r5, 0x7] + strb r0, [r5, 0x9] + mov r0, sp + movs r1, 0xFF + movs r2, 0 + bl AddTextPrinter + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r7 + bcc _0819967C +_081996A6: + adds r0, r6, 0 + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81995E4 + + thumb_func_start CreateYesNoMenu +@ void CreateYesNoMenu(struct WindowTemplate *windowTemplate, u16 borderFirstTileNum, u8 borderPalette, u8 initialCursorPos) +CreateYesNoMenu: @ 81996C0 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x10 + adds r4, r1, 0 + adds r5, r2, 0 + adds r6, r3, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + ldr r1, =gUnknown_0203CD9F + mov r8, r1 + bl AddWindow + mov r2, r8 + strb r0, [r2] + ldrb r0, [r2] + movs r1, 0x1 + adds r2, r4, 0 + adds r3, r5, 0 + bl SetWindowBorderStyle + ldr r0, =gUnknown_085EE491 + str r0, [sp] + mov r1, sp + mov r2, r8 + ldrb r0, [r2] + movs r2, 0 + mov r9, r2 + strb r0, [r1, 0x4] + mov r0, sp + movs r2, 0x1 + strb r2, [r0, 0x5] + movs r0, 0x8 + strb r0, [r1, 0x6] + mov r0, sp + strb r2, [r0, 0x7] + ldrb r0, [r0, 0x6] + strb r0, [r1, 0x8] + mov r0, sp + ldrb r0, [r0, 0x7] + strb r0, [r1, 0x9] + movs r0, 0x1 + movs r1, 0x5 + bl GetFontAttribute + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xC] + movs r5, 0xF + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xC] + movs r0, 0x1 + movs r1, 0x6 + bl GetFontAttribute + mov r3, sp + adds r1, r5, 0 + ands r1, r0 + ldrb r2, [r3, 0xD] + movs r4, 0x10 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0xD] + movs r0, 0x1 + movs r1, 0x7 + bl GetFontAttribute + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xD] + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xD] + movs r0, 0x1 + movs r1, 0x4 + bl GetFontAttribute + mov r1, sp + ands r5, r0 + ldrb r0, [r1, 0xC] + ands r4, r0 + orrs r4, r5 + strb r4, [r1, 0xC] + mov r0, sp + mov r1, r9 + strb r1, [r0, 0xA] + strb r1, [r0, 0xB] + movs r1, 0xFF + movs r2, 0 + bl AddTextPrinter + mov r2, r8 + ldrb r0, [r2] + movs r1, 0x2 + adds r2, r6, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end CreateYesNoMenu + + thumb_func_start sub_81997AC +sub_81997AC: @ 81997AC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0xC] + lsls r2, 24 + lsrs r6, r2, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x10] + movs r7, 0 + cmp r7, r3 + bcs _08199824 +_081997D4: + movs r4, 0 + adds r0, r7, 0x1 + mov r9, r0 + cmp r4, r6 + bcs _0819981C + lsls r0, r7, 4 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r5, 0x80 + lsls r5, 20 +_081997EC: + adds r0, r7, 0 + muls r0, r6 + adds r0, r4 + lsls r0, 3 + ldr r1, [sp, 0x34] + adds r0, r1 + ldr r2, [r0] + lsrs r3, r5, 24 + mov r0, r8 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + mov r0, r10 + movs r1, 0x1 + bl Print + ldr r1, [sp, 0xC] + lsls r0, r1, 24 + adds r5, r0 + adds r4, 0x1 + cmp r4, r6 + bcc _081997EC +_0819981C: + mov r7, r9 + ldr r4, [sp, 0x10] + cmp r7, r4 + bcc _081997D4 +_08199824: + mov r0, r10 + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81997AC + + thumb_func_start sub_819983C +sub_819983C: @ 819983C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x10] + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x14] + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 24 + lsrs r3, 24 + mov r10, r3 + mov r0, sp + movs r6, 0 + ldrb r1, [r0, 0x10] + strb r1, [r0, 0x4] + mov r1, sp + movs r0, 0x1 + strb r0, [r1, 0x5] + movs r1, 0x5 + bl GetFontAttribute + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xC] + movs r5, 0xF + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xC] + movs r0, 0x1 + movs r1, 0x6 + bl GetFontAttribute + mov r3, sp + adds r1, r5, 0 + ands r1, r0 + ldrb r2, [r3, 0xD] + movs r4, 0x10 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0xD] + movs r0, 0x1 + movs r1, 0x7 + bl GetFontAttribute + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xD] + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xD] + movs r0, 0x1 + movs r1, 0x4 + bl GetFontAttribute + mov r1, sp + ands r5, r0 + ldrb r0, [r1, 0xC] + ands r4, r0 + orrs r4, r5 + strb r4, [r1, 0xC] + mov r0, sp + strb r6, [r0, 0xA] + strb r6, [r0, 0xB] + movs r7, 0 + cmp r7, r10 + bcs _0819992A +_081998D6: + movs r5, 0 + adds r2, r7, 0x1 + mov r9, r2 + cmp r5, r8 + bcs _08199920 + mov r4, sp + lsls r0, r7, 4 + adds r6, r0, 0x1 +_081998E6: + mov r0, r8 + muls r0, r7 + adds r0, r5 + ldr r1, [sp, 0x3C] + adds r0, r1, r0 + ldrb r0, [r0] + lsls r0, 3 + ldr r2, [sp, 0x38] + adds r0, r2 + ldr r0, [r0] + str r0, [sp] + ldr r1, [sp, 0x14] + adds r0, r1, 0 + muls r0, r5 + adds r0, 0x8 + strb r0, [r4, 0x6] + strb r6, [r4, 0x7] + strb r0, [r4, 0x8] + strb r6, [r4, 0x9] + mov r0, sp + movs r1, 0xFF + movs r2, 0 + bl AddTextPrinter + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, r8 + bcc _081998E6 +_08199920: + mov r2, r9 + lsls r0, r2, 24 + lsrs r7, r0, 24 + cmp r7, r10 + bcc _081998D6 +_0819992A: + ldr r0, [sp, 0x10] + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819983C + + thumb_func_start sub_8199944 +sub_8199944: @ 8199944 + push {r4-r7,lr} + ldr r4, [sp, 0x14] + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r7, r4, 24 + ldr r6, =gUnknown_0203CD90 + movs r4, 0 + mov r12, r4 + mov r4, r12 + strb r4, [r6] + movs r5, 0x1 + strb r5, [r6, 0x1] + strb r4, [r6, 0x3] + adds r4, r2, 0 + muls r4, r3 + subs r4, 0x1 + strb r4, [r6, 0x4] + strb r0, [r6, 0x5] + strb r5, [r6, 0x6] + strb r1, [r6, 0x7] + movs r0, 0x10 + strb r0, [r6, 0x8] + strb r2, [r6, 0x9] + strb r3, [r6, 0xA] + cmp r7, 0 + blt _08199986 + movs r0, 0x4 + ldrsb r0, [r6, r0] + cmp r7, r0 + ble _08199990 +_08199986: + mov r0, r12 + strb r0, [r6, 0x2] + b _08199992 + .pool +_08199990: + strb r7, [r6, 0x2] +_08199992: + movs r0, 0 + movs r1, 0 + bl sub_8199134 + ldr r0, =gUnknown_0203CD90 + ldrb r0, [r0, 0x2] + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8199944 + + thumb_func_start clear_scheduled_bg_copies_to_vram +@ void clear_scheduled_bg_copies_to_vram() +clear_scheduled_bg_copies_to_vram: @ 81999A8 + push {lr} + ldr r0, =gUnknown_0203CDA4 + movs r1, 0 + movs r2, 0x4 + bl memset + pop {r0} + bx r0 + .pool + thumb_func_end clear_scheduled_bg_copies_to_vram + + thumb_func_start schedule_bg_copy_tilemap_to_vram +@ void schedule_bg_copy_tilemap_to_vram(u8 bg_id) +schedule_bg_copy_tilemap_to_vram: @ 81999BC + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0203CDA4 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + bx lr + .pool + thumb_func_end schedule_bg_copy_tilemap_to_vram + + thumb_func_start do_scheduled_bg_tilemap_copies_to_vram +@ void do_scheduled_bg_tilemap_copies_to_vram() +do_scheduled_bg_tilemap_copies_to_vram: @ 81999D0 + push {r4,lr} + ldr r4, =gUnknown_0203CDA4 + ldrb r0, [r4] + cmp r0, 0x1 + bne _081999E4 + movs r0, 0 + bl CopyBgTilemapBufferToVram + movs r0, 0 + strb r0, [r4] +_081999E4: + ldrb r0, [r4, 0x1] + cmp r0, 0x1 + bne _081999F4 + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + movs r0, 0 + strb r0, [r4, 0x1] +_081999F4: + ldrb r0, [r4, 0x2] + cmp r0, 0x1 + bne _08199A04 + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + movs r0, 0 + strb r0, [r4, 0x2] +_08199A04: + ldrb r0, [r4, 0x3] + cmp r0, 0x1 + bne _08199A14 + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + movs r0, 0 + strb r0, [r4, 0x3] +_08199A14: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end do_scheduled_bg_tilemap_copies_to_vram + + thumb_func_start reset_temp_tile_data_buffers +@ void reset_temp_tile_data_buffers() +reset_temp_tile_data_buffers: @ 8199A20 + push {lr} + ldr r3, =gUnknown_0203CDA8 + ldr r1, =gUnknown_0203CDAC + movs r2, 0 + adds r0, r1, 0 + adds r0, 0x7C +_08199A2C: + str r2, [r0] + subs r0, 0x4 + cmp r0, r1 + bge _08199A2C + movs r0, 0 + strh r0, [r3] + pop {r0} + bx r0 + .pool + thumb_func_end reset_temp_tile_data_buffers + + thumb_func_start free_temp_tile_data_buffers_if_possible +free_temp_tile_data_buffers_if_possible: @ 8199A44 + push {r4-r6,lr} + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _08199A88 + ldr r1, =gUnknown_0203CDA8 + ldrh r0, [r1] + cmp r0, 0 + beq _08199A7C + movs r4, 0 + ldrh r1, [r1] + cmp r4, r1 + bge _08199A76 + ldr r5, =gUnknown_0203CDAC + movs r6, 0 +_08199A64: + ldr r0, [r5] + bl Free + stm r5!, {r6} + adds r4, 0x1 + ldr r0, =gUnknown_0203CDA8 + ldrh r0, [r0] + cmp r4, r0 + blt _08199A64 +_08199A76: + ldr r1, =gUnknown_0203CDA8 + movs r0, 0 + strh r0, [r1] +_08199A7C: + movs r0, 0 + b _08199A8A + .pool +_08199A88: + movs r0, 0x1 +_08199A8A: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end free_temp_tile_data_buffers_if_possible + + thumb_func_start decompress_and_copy_tile_data_to_vram +@ int decompress_and_copy_tile_data_to_vram(u8 bg_id, int src, int size, u16 offset, u8 mode) +decompress_and_copy_tile_data_to_vram: @ 8199A90 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + adds r4, r1, 0 + adds r5, r2, 0 + ldr r1, [sp, 0x24] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r3, 16 + lsrs r3, 16 + mov r9, r3 + lsls r1, 24 + lsrs r7, r1, 24 + ldr r6, =gUnknown_0203CDA8 + ldrh r0, [r6] + cmp r0, 0x1F + bhi _08199AF8 + adds r0, r4, 0 + add r1, sp, 0x4 + bl malloc_and_decompress + adds r4, r0, 0 + cmp r5, 0 + bne _08199AC8 + ldr r5, [sp, 0x4] +_08199AC8: + cmp r4, 0 + beq _08199AEC + lsls r2, r5, 16 + lsrs r2, 16 + str r7, [sp] + mov r0, r8 + adds r1, r4, 0 + mov r3, r9 + bl copy_decompressed_tile_data_to_vram + ldr r2, =gUnknown_0203CDAC + ldrh r0, [r6] + adds r1, r0, 0x1 + strh r1, [r6] + lsls r0, 16 + lsrs r0, 14 + adds r0, r2 + str r4, [r0] +_08199AEC: + adds r0, r4, 0 + b _08199AFA + .pool +_08199AF8: + movs r0, 0 +_08199AFA: + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end decompress_and_copy_tile_data_to_vram + + thumb_func_start copy_decompressed_tile_data_to_vram_autofree +@ void copy_decompressed_tile_data_to_vram_autofree(u8 bg_id, int src, u16 size, u16 offset, u8 mode) +copy_decompressed_tile_data_to_vram_autofree: @ 8199B08 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + adds r5, r2, 0 + ldr r2, [sp, 0x24] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r3, 16 + lsrs r3, 16 + mov r9, r3 + lsls r2, 24 + lsrs r7, r2, 24 + adds r0, r1, 0 + add r1, sp, 0x4 + bl malloc_and_decompress + adds r6, r0, 0 + cmp r5, 0 + bne _08199B36 + ldr r5, [sp, 0x4] +_08199B36: + cmp r6, 0 + beq _08199B6E + ldr r0, =task_free_buf_after_copying_tile_data_to_vram + movs r1, 0 + bl CreateTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r2, r5, 16 + lsrs r2, 16 + str r7, [sp] + mov r0, r8 + adds r1, r6, 0 + mov r3, r9 + bl copy_decompressed_tile_data_to_vram + ldr r2, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r2 + strh r0, [r1, 0x8] + adds r0, r4, 0 + movs r1, 0x1 + adds r2, r6, 0 + bl SetWordTaskArg +_08199B6E: + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end copy_decompressed_tile_data_to_vram_autofree + + thumb_func_start task_free_buf_after_copying_tile_data_to_vram +@ void task_free_buf_after_copying_tile_data_to_vram(int task_id) +task_free_buf_after_copying_tile_data_to_vram: @ 8199B84 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0x8 + ldrsh r0, [r0, r1] + bl CheckForSpaceForDma3Request + lsls r0, 16 + cmp r0, 0 + bne _08199BB4 + adds r0, r4, 0 + movs r1, 0x1 + bl GetWordTaskArg + bl Free + adds r0, r4, 0 + bl DestroyTask +_08199BB4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end task_free_buf_after_copying_tile_data_to_vram + + thumb_func_start malloc_and_decompress +@ void *malloc_and_decompress(void *src, int *size) +malloc_and_decompress: @ 8199BC0 + push {r4,r5,lr} + adds r5, r0, 0 + ldrb r0, [r5, 0x1] + strb r0, [r1] + ldrb r0, [r5, 0x2] + strb r0, [r1, 0x1] + ldrb r0, [r5, 0x3] + strb r0, [r1, 0x2] + movs r0, 0 + strb r0, [r1, 0x3] + ldr r0, [r1] + bl Alloc + adds r4, r0, 0 + cmp r4, 0 + beq _08199BE8 + adds r0, r5, 0 + adds r1, r4, 0 + bl LZ77UnCompWram +_08199BE8: + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end malloc_and_decompress + + thumb_func_start copy_decompressed_tile_data_to_vram +@ s16 copy_decompressed_tile_data_to_vram(u8 bg_id, int src, u16 size, u16 offset, u8 mode) +copy_decompressed_tile_data_to_vram: @ 8199BF0 + push {r4,lr} + adds r4, r1, 0 + ldr r1, [sp, 0x8] + lsls r0, 24 + lsrs r0, 24 + lsls r2, 16 + lsrs r2, 16 + lsls r3, 16 + lsrs r3, 16 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0 + beq _08199C18 + cmp r1, 0x1 + beq _08199C20 + ldr r0, =0x0000ffff + b _08199C2A + .pool +_08199C18: + adds r1, r4, 0 + bl LoadBgTiles + b _08199C26 +_08199C20: + adds r1, r4, 0 + bl LoadBgTilemap +_08199C26: + lsls r0, 16 + lsrs r0, 16 +_08199C2A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end copy_decompressed_tile_data_to_vram + + thumb_func_start sub_8199C30 +sub_8199C30: @ 8199C30 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r5, r2, 0 + ldr r4, [sp, 0x28] + ldr r2, [sp, 0x2C] + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + lsls r5, 24 + lsrs r5, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x4] + lsls r4, 24 + lsrs r4, 24 + lsls r2, 24 + lsrs r2, 24 + mov r10, r2 + bl GetBgTilemapBuffer + mov r8, r0 + adds r0, r5, r4 + cmp r5, r0 + bge _08199CA8 + mov r9, r0 +_08199C6E: + ldr r3, [sp] + ldr r1, [sp, 0x4] + adds r0, r3, r1 + adds r7, r5, 0x1 + cmp r3, r0 + bge _08199CA0 + lsls r6, r5, 5 + ldr r1, =0x00000fff + mov r12, r1 + mov r1, r10 + lsls r5, r1, 12 + adds r4, r0, 0 +_08199C86: + adds r1, r6, r3 + lsls r1, 1 + add r1, r8 + ldrh r2, [r1] + mov r0, r12 + ands r0, r2 + orrs r0, r5 + strh r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r4 + blt _08199C86 +_08199CA0: + lsls r0, r7, 24 + lsrs r5, r0, 24 + cmp r5, r9 + blt _08199C6E +_08199CA8: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8199C30 + + thumb_func_start sub_8199CBC +sub_8199CBC: @ 8199CBC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r10, r1 + ldr r1, [sp, 0x24] + ldr r4, [sp, 0x28] + lsls r0, 24 + lsrs r0, 24 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp] + lsls r1, 24 + lsrs r5, r1, 24 + lsls r4, 24 + lsrs r4, 24 + mov r8, r4 + bl GetBgTilemapBuffer + adds r7, r0, 0 + movs r0, 0 + cmp r0, r8 + bcs _08199D2A +_08199CF4: + movs r2, 0 + adds r6, r0, 0x1 + cmp r2, r5 + bcs _08199D22 + adds r4, r0, 0 + muls r4, r5 + ldr r1, [sp] + adds r0, r1 + lsls r3, r0, 5 +_08199D06: + adds r1, r4, r2 + lsls r1, 1 + add r1, r10 + adds r0, r3, r2 + add r0, r9 + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, r5 + bcc _08199D06 +_08199D22: + lsls r0, r6, 24 + lsrs r0, 24 + cmp r0, r8 + bcc _08199CF4 +_08199D2A: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8199CBC + + thumb_func_start sub_8199D3C +sub_8199D3C: @ 8199D3C + push {r4-r7,lr} + adds r6, r0, 0 + adds r5, r1, 0 + ldr r0, [sp, 0x14] + adds r4, r2, 0 + muls r4, r3 + cmp r0, 0x1 + bne _08199D64 + adds r3, r6, 0 + movs r2, 0 + cmp r2, r4 + bge _08199D8C +_08199D54: + adds r1, r3, r2 + ldrb r0, [r1] + adds r0, r5 + strb r0, [r1] + adds r2, 0x1 + cmp r2, r4 + blt _08199D54 + b _08199D8C +_08199D64: + cmp r4, 0 + ble _08199D8C + movs r0, 0xFC + lsls r0, 8 + mov r12, r0 + ldr r0, =0x000003ff + adds r7, r0, 0 + adds r3, r6, 0 + adds r2, r4, 0 +_08199D76: + ldrh r0, [r3] + mov r1, r12 + ands r1, r0 + adds r0, r5 + ands r0, r7 + orrs r1, r0 + strh r1, [r3] + adds r3, 0x2 + subs r2, 0x1 + cmp r2, 0 + bne _08199D76 +_08199D8C: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8199D3C + + thumb_func_start sub_8199D98 +sub_8199D98: @ 8199D98 + push {lr} + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + pop {r0} + bx r0 + thumb_func_end sub_8199D98 + + thumb_func_start sub_8199DF0 +sub_8199DF0: @ 8199DF0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r8, r2 + mov r9, r3 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + movs r1, 0x4 + bl GetBgAttribute + lsls r0, 16 + movs r7, 0x40 + cmp r0, 0 + bne _08199E16 + movs r7, 0x20 +_08199E16: + adds r0, r5, 0 + movs r1, 0x1 + bl GetBgAttribute + adds r4, r0, 0 + adds r0, r5, 0 + movs r1, 0xA + bl GetBgAttribute + lsls r4, 16 + lsrs r4, 2 + lsls r0, 16 + lsrs r0, 16 + add r0, r8 + muls r0, r7 + adds r4, r0 + lsls r0, r6, 24 + lsls r1, r6, 16 + orrs r0, r1 + lsls r1, r6, 8 + orrs r0, r1 + orrs r0, r6 + movs r1, 0xC0 + lsls r1, 19 + adds r4, r1 + mov r2, r9 + muls r2, r7 + lsls r2, 16 + lsrs r2, 16 + adds r1, r4, 0 + movs r3, 0x1 + bl RequestDma3Fill + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8199DF0 + + thumb_func_start box_print +box_print: @ 8199E64 + push {r4-r6,lr} + sub sp, 0x10 + adds r4, r1, 0 + ldr r6, [sp, 0x20] + ldr r5, [sp, 0x24] + ldr r1, [sp, 0x28] + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + str r1, [sp] + mov r1, sp + strb r0, [r1, 0x4] + mov r0, sp + strb r4, [r0, 0x5] + strb r2, [r0, 0x6] + strb r3, [r0, 0x7] + ldrb r0, [r0, 0x6] + strb r0, [r1, 0x8] + mov r0, sp + ldrb r0, [r0, 0x7] + strb r0, [r1, 0x9] + adds r0, r4, 0 + movs r1, 0x2 + bl GetFontAttribute + mov r1, sp + strb r0, [r1, 0xA] + adds r0, r4, 0 + movs r1, 0x3 + bl GetFontAttribute + mov r1, sp + strb r0, [r1, 0xB] + mov r3, sp + ldrb r2, [r3, 0xC] + movs r1, 0x10 + negs r1, r1 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3, 0xC] + mov r2, sp + ldrb r0, [r6, 0x1] + lsls r0, 4 + movs r4, 0xF + strb r0, [r2, 0xC] + ldrb r2, [r6] + adds r0, r4, 0 + ands r0, r2 + ldrb r2, [r3, 0xD] + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xD] + mov r2, sp + ldrb r0, [r6, 0x2] + lsls r0, 4 + ands r1, r4 + orrs r1, r0 + strb r1, [r2, 0xD] + mov r0, sp + adds r1, r5, 0 + movs r2, 0 + bl AddTextPrinter + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end box_print + + 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 + push {r5,r6} + sub sp, 0x10 + adds r5, r1, 0 + ldr r1, [sp, 0x28] + mov r8, r1 + ldr r1, [sp, 0x2C] + mov r9, r1 + ldr r6, [sp, 0x30] + ldr r1, [sp, 0x34] + ldr r4, [sp, 0x38] + str r4, [sp] + mov r4, sp + strb r0, [r4, 0x4] + mov r0, sp + strb r5, [r0, 0x5] + strb r2, [r0, 0x6] + strb r3, [r0, 0x7] + mov r2, sp + ldrb r0, [r0, 0x6] + strb r0, [r2, 0x8] + mov r0, sp + ldrb r0, [r0, 0x7] + strb r0, [r2, 0x9] + mov r0, sp + mov r2, r8 + strb r2, [r0, 0xA] + mov r2, r9 + strb r2, [r0, 0xB] + ldrb r3, [r4, 0xC] + movs r2, 0x10 + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + strb r0, [r4, 0xC] + mov r3, sp + ldrb r0, [r6, 0x1] + lsls r0, 4 + movs r5, 0xF + strb r0, [r3, 0xC] + ldrb r3, [r6] + adds r0, r5, 0 + ands r0, r3 + ldrb r3, [r4, 0xD] + ands r2, r3 + orrs r2, r0 + strb r2, [r4, 0xD] + mov r3, sp + ldrb r0, [r6, 0x2] + lsls r0, 4 + ands r2, r5 + orrs r2, r0 + strb r2, [r3, 0xD] + lsls r1, 24 + lsrs r1, 24 + mov r0, sp + movs r2, 0 + bl AddTextPrinter + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end AddTextPrinterParametrized2 + + thumb_func_start sub_8199F74 +sub_8199F74: @ 8199F74 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + adds r6, r1, 0 + ldr r4, [sp, 0x2C] + ldr r1, [sp, 0x30] + mov r8, r1 + ldr r7, [sp, 0x34] + ldr r5, [sp, 0x38] + ldr r1, [sp, 0x3C] + mov r9, r1 + lsls r6, 24 + lsrs r6, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + mov r1, r8 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + str r2, [sp] + mov r1, sp + strb r0, [r1, 0x4] + mov r0, sp + strb r6, [r0, 0x5] + strb r3, [r0, 0x6] + strb r4, [r0, 0x7] + strb r3, [r0, 0x8] + strb r4, [r0, 0x9] + strb r5, [r0, 0xA] + mov r1, r9 + strb r1, [r0, 0xB] + mov r2, sp + ldrb r1, [r2, 0xC] + movs r5, 0x10 + negs r5, r5 + adds r0, r5, 0 + ands r0, r1 + strb r0, [r2, 0xC] + adds r0, r6, 0 + movs r1, 0x5 + bl GetFontAttribute + mov r3, sp + lsls r0, 4 + ldrb r2, [r3, 0xC] + movs r4, 0xF + adds r1, r4, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xC] + adds r0, r6, 0 + movs r1, 0x6 + bl GetFontAttribute + mov r2, sp + adds r1, r4, 0 + ands r1, r0 + ldrb r0, [r2, 0xD] + ands r5, r0 + orrs r5, r1 + strb r5, [r2, 0xD] + adds r0, r6, 0 + movs r1, 0x7 + bl GetFontAttribute + mov r2, sp + lsls r0, 4 + ldrb r1, [r2, 0xD] + ands r4, r1 + orrs r4, r0 + strb r4, [r2, 0xD] + mov r0, sp + mov r1, r8 + adds r2, r7, 0 + bl AddTextPrinter + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8199F74 + + thumb_func_start sub_819A024 +sub_819A024: @ 819A024 + push {r4-r7,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r7, r0, 24 + lsls r2, 16 + lsrs r4, r2, 16 + lsls r3, 16 + lsrs r5, r3, 16 + movs r2, 0 + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldrb r0, [r3] + ldr r6, =gStringVar4 + cmp r0, 0xFF + beq _0819A04C +_0819A042: + adds r2, 0x1 + adds r0, r3, r2 + ldrb r0, [r0] + cmp r0, 0xFF + bne _0819A042 +_0819A04C: + adds r0, r6, 0 + bl StringExpandPlaceholders + lsls r3, r4, 24 + lsrs r3, 24 + lsls r0, r5, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + adds r0, r7, 0 + movs r1, 0x1 + adds r2, r6, 0 + bl Print + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819A024 + + thumb_func_start sub_819A080 +sub_819A080: @ 819A080 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + str r0, [sp] + str r1, [sp, 0x4] + ldr r0, [sp, 0x48] + ldr r4, [sp, 0x4C] + ldr r1, [sp, 0x50] + ldr r5, [sp, 0x54] + lsls r2, 16 + lsrs r2, 16 + str r2, [sp, 0x8] + lsls r3, 16 + lsrs r3, 16 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0xC] + lsls r4, 16 + lsrs r4, 16 + lsls r1, 16 + lsrs r1, 16 + lsls r5, 16 + lsrs r5, 16 + ldr r2, [sp, 0x4] + ldrh r0, [r2, 0x4] + ldr r2, [sp, 0xC] + subs r0, r2 + ldr r2, [sp, 0x8] + adds r2, r1, r2 + str r2, [sp, 0x10] + cmp r0, r1 + bge _0819A0CC + ldr r1, [sp, 0x8] + adds r0, r1 + str r0, [sp, 0x10] +_0819A0CC: + ldr r2, [sp, 0x4] + ldrh r1, [r2, 0x6] + subs r0, r1, r4 + cmp r0, r5 + bge _0819A0DE + adds r0, r3, r1 + subs r0, r4 + str r0, [sp, 0x14] + b _0819A0E2 +_0819A0DE: + adds r5, r3, r5 + str r5, [sp, 0x14] +_0819A0E2: + ldr r0, [sp] + ldrh r1, [r0, 0x4] + movs r2, 0x7 + adds r0, r1, 0 + ands r0, r2 + adds r1, r0 + asrs r1, 3 + str r1, [sp, 0x18] + ldr r0, [sp, 0x4] + ldrh r1, [r0, 0x4] + adds r0, r1, 0 + ands r0, r2 + adds r1, r0 + asrs r1, 3 + str r1, [sp, 0x1C] + mov r12, r3 + mov r8, r4 + ldr r1, [sp, 0x14] + cmp r12, r1 + blt _0819A10C + b _0819A24A +_0819A10C: + ldr r5, [sp, 0x8] + ldr r6, [sp, 0xC] + mov r2, r12 + adds r2, 0x1 + str r2, [sp, 0x20] + mov r0, r8 + adds r0, 0x1 + str r0, [sp, 0x24] + ldr r1, [sp, 0x10] + cmp r5, r1 + blt _0819A124 + b _0819A23A +_0819A124: + movs r7, 0x1 + movs r2, 0xF0 + mov r10, r2 + movs r0, 0xF + mov r9, r0 +_0819A12E: + asrs r0, r5, 1 + movs r1, 0x3 + ands r0, r1 + ldr r2, [sp] + ldr r1, [r2] + adds r1, r0 + asrs r0, r5, 3 + lsls r0, 5 + adds r1, r0 + mov r2, r12 + asrs r0, r2, 3 + ldr r2, [sp, 0x18] + muls r0, r2 + lsls r0, 5 + adds r1, r0 + mov r2, r12 + lsls r0, r2, 29 + lsrs r0, 27 + adds r3, r1, r0 + asrs r0, r6, 1 + movs r1, 0x3 + ands r0, r1 + ldr r2, [sp, 0x4] + ldr r1, [r2] + adds r1, r0 + asrs r0, r6, 3 + lsls r0, 5 + adds r1, r0 + mov r2, r8 + asrs r0, r2, 3 + ldr r2, [sp, 0x1C] + muls r0, r2 + lsls r0, 5 + adds r1, r0 + mov r2, r8 + lsls r0, r2, 29 + lsrs r0, 27 + adds r4, r1, r0 + adds r0, r4, 0 + ands r0, r7 + cmp r0, 0 + beq _0819A1DA + subs r4, 0x1 + adds r0, r6, 0 + ands r0, r7 + cmp r0, 0 + beq _0819A1B2 + ldrh r0, [r4] + ldr r2, =0x00000fff + ands r2, r0 + adds r0, r5, 0 + ands r0, r7 + cmp r0, 0 + beq _0819A1A8 + ldrb r1, [r3] + mov r0, r10 + ands r0, r1 + lsls r0, 8 + b _0819A22A + .pool +_0819A1A8: + ldrb r1, [r3] + mov r0, r9 + ands r0, r1 + lsls r0, 12 + b _0819A22A +_0819A1B2: + ldrh r0, [r4] + ldr r2, =0x0000f0ff + ands r2, r0 + adds r0, r5, 0 + ands r0, r7 + cmp r0, 0 + beq _0819A1D0 + ldrb r1, [r3] + mov r0, r10 + ands r0, r1 + lsls r0, 4 + b _0819A22A + .pool +_0819A1D0: + ldrb r1, [r3] + mov r0, r9 + ands r0, r1 + lsls r0, 8 + b _0819A22A +_0819A1DA: + adds r0, r6, 0 + ands r0, r7 + cmp r0, 0 + beq _0819A206 + ldrh r0, [r4] + ldr r2, =0x0000ff0f + ands r2, r0 + adds r0, r5, 0 + ands r0, r7 + cmp r0, 0 + beq _0819A1FC + ldrb r1, [r3] + mov r0, r10 + b _0819A228 + .pool +_0819A1FC: + ldrb r1, [r3] + mov r0, r9 + ands r0, r1 + lsls r0, 4 + b _0819A22A +_0819A206: + ldrh r0, [r4] + ldr r2, =0x0000fff0 + ands r2, r0 + adds r0, r5, 0 + ands r0, r7 + cmp r0, 0 + beq _0819A224 + ldrb r1, [r3] + mov r0, r10 + ands r0, r1 + lsrs r0, 4 + b _0819A22A + .pool +_0819A224: + ldrb r1, [r3] + mov r0, r9 +_0819A228: + ands r0, r1 +_0819A22A: + orrs r2, r0 + strh r2, [r4] + adds r5, 0x1 + adds r6, 0x1 + ldr r0, [sp, 0x10] + cmp r5, r0 + bge _0819A23A + b _0819A12E +_0819A23A: + ldr r1, [sp, 0x20] + mov r12, r1 + ldr r2, [sp, 0x24] + mov r8, r2 + ldr r0, [sp, 0x14] + cmp r12, r0 + bge _0819A24A + b _0819A10C +_0819A24A: + add sp, 0x28 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819A080 + + thumb_func_start sub_819A25C +sub_819A25C: @ 819A25C + push {r4,lr} + adds r4, r0, 0 + adds r0, r1, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, 16 + lsrs r0, 16 + bl sub_80D30B0 + adds r1, r4, 0 + movs r2, 0x20 + bl LoadPalette + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_819A25C + + thumb_func_start sub_819A27C +sub_819A27C: @ 819A27C + push {r4-r6,lr} + sub sp, 0x8 + adds r6, r0, 0 + adds r0, r1, 0 + adds r1, r2, 0 + adds r4, r3, 0 + ldr r5, [sp, 0x18] + lsls r6, 24 + lsrs r6, 24 + lsls r0, 16 + lsrs r0, 16 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + movs r2, 0x1 + bl sub_80D2EDC + adds r1, r0, 0 + movs r0, 0x20 + str r0, [sp] + str r0, [sp, 0x4] + adds r0, r6, 0 + adds r2, r4, 0 + adds r3, r5, 0 + bl BlitBitmapToWindow + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_819A27C + + thumb_func_start sub_819A2BC +sub_819A2BC: @ 819A2BC + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x1 + beq _0819A2DC + cmp r1, 0x1 + ble _0819A2D2 + cmp r1, 0x2 + beq _0819A2E4 +_0819A2D2: + ldr r0, =gUnknown_08DC4318 + b _0819A2E6 + .pool +_0819A2DC: + ldr r0, =gUnknown_08DC4338 + b _0819A2E6 + .pool +_0819A2E4: + ldr r0, =gUnknown_08DC4358 +_0819A2E6: + adds r1, r2, 0 + movs r2, 0x20 + bl LoadPalette + pop {r0} + bx r0 + .pool + thumb_func_end sub_819A2BC + + thumb_func_start blit_move_info_icon +@ void blit_move_info_icon(u8 windowId, u8 a2, u16 x, u16 y) +blit_move_info_icon: @ 819A2F8 + push {r4,r5,lr} + sub sp, 0x18 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsls r2, 16 + lsrs r2, 16 + lsls r3, 16 + lsrs r3, 16 + ldr r4, =gUnknown_0860F0D4 + lsrs r1, 22 + adds r1, r4 + ldrh r5, [r1, 0x2] + lsls r5, 5 + ldr r4, =gUnknown_08DC4378 + adds r5, r4 + movs r4, 0x80 + str r4, [sp] + str r4, [sp, 0x4] + str r2, [sp, 0x8] + str r3, [sp, 0xC] + ldrb r2, [r1] + str r2, [sp, 0x10] + ldrb r1, [r1, 0x1] + str r1, [sp, 0x14] + adds r1, r5, 0 + movs r2, 0 + movs r3, 0 + bl BlitBitmapRectToWindow + add sp, 0x18 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end blit_move_info_icon + + thumb_func_start sub_819A344 +sub_819A344: @ 819A344 + push {r4-r7,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r2, 24 + lsrs r2, 24 + adds r5, r1, 0 + movs r1, 0xFC + strb r1, [r5] + adds r5, 0x1 + movs r0, 0x1 + strb r0, [r5] + adds r5, 0x1 + strb r2, [r5] + adds r5, 0x1 + strb r1, [r5] + adds r5, 0x1 + movs r0, 0x3 + strb r0, [r5] + adds r5, 0x1 + adds r2, 0x1 + strb r2, [r5] + adds r5, 0x1 + cmp r3, 0x4 + bhi _0819A43C + lsls r0, r3, 2 + ldr r1, =_0819A384 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0819A384: + .4byte _0819A398 + .4byte _0819A3A8 + .4byte _0819A3D6 + .4byte _0819A404 + .4byte _0819A414 +_0819A398: + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + adds r0, r5, 0 + bl StringCopy + b _0819A43C + .pool +_0819A3A8: + bl IsNationalPokedexEnabled + cmp r0, 0 + beq _0819A3B8 + movs r0, 0x1 + bl pokedex_count + b _0819A3BE +_0819A3B8: + movs r0, 0x1 + bl sub_80C0844 +_0819A3BE: + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r5, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + adds r5, r0, 0 + movs r0, 0xFF + strb r0, [r5] + b _0819A43C +_0819A3D6: + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldrh r1, [r0, 0xE] + adds r0, r5, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + adds r5, r0, 0 + movs r0, 0xF0 + strb r0, [r5] + adds r5, 0x1 + ldr r0, [r4] + ldrb r1, [r0, 0x10] + adds r0, r5, 0 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalStringN + b _0819A43C + .pool +_0819A404: + ldr r0, =gUnknown_02037318 + ldrb r1, [r0, 0x14] + adds r0, r5, 0 + bl sub_81245DC + b _0819A43C + .pool +_0819A414: + ldr r4, =0x00000867 + movs r6, 0 + adds r7, r5, 0x1 +_0819A41A: + lsls r0, r4, 16 + lsrs r0, 16 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _0819A42A + adds r6, 0x1 +_0819A42A: + adds r4, 0x1 + ldr r0, =0x0000086e + cmp r4, r0 + ble _0819A41A + adds r0, r6, 0 + subs r0, 0x5F + strb r0, [r5] + movs r0, 0xFF + strb r0, [r7] +_0819A43C: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819A344 + + thumb_func_start sub_819A44C +sub_819A44C: @ 819A44C + push {r4,r5,lr} + adds r5, r0, 0 + ldrb r4, [r5, 0x5] + lsrs r4, 4 + movs r0, 0x65 + bl IndexOfSpritePaletteTag + lsls r0, 24 + lsls r4, 16 + lsrs r4, 16 + lsrs r0, 24 + cmp r4, r0 + bne _0819A4BA + adds r0, r5, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0819A4B0 + ldrh r1, [r5, 0x2E] + movs r2, 0x2E + ldrsh r0, [r5, r2] + cmp r0, 0 + beq _0819A484 + subs r0, r1, 0x1 + strh r0, [r5, 0x2E] + b _0819A4C2 +_0819A484: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x5 + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + bne _0819A4A6 + adds r0, r5, 0 + movs r1, 0 + bl StartSpriteAnim + movs r0, 0x20 + strh r0, [r5, 0x2E] + b _0819A4C2 +_0819A4A6: + adds r0, r5, 0 + movs r1, 0x1 + bl StartSpriteAnim + b _0819A4C2 +_0819A4B0: + adds r0, r5, 0 + movs r1, 0x1 + bl StartSpriteAnimIfDifferent + b _0819A4C2 +_0819A4BA: + adds r0, r5, 0 + movs r1, 0 + bl StartSpriteAnimIfDifferent +_0819A4C2: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_819A44C + + thumb_func_start sub_819A4C8 +sub_819A4C8: @ 819A4C8 + push {lr} + bl AnimateSprites + bl BuildOamBuffer + bl RunTextPrinters + bl UpdatePaletteFade + bl RunTasks + pop {r0} + bx r0 + thumb_func_end sub_819A4C8 + + thumb_func_start sub_819A4E4 +sub_819A4E4: @ 819A4E4 + push {lr} + bl LoadOam + bl ProcessSpriteCopyRequests + bl TransferPlttBuffer + pop {r0} + bx r0 + thumb_func_end sub_819A4E4 + + thumb_func_start sub_819A4F8 +sub_819A4F8: @ 819A4F8 + push {lr} + ldr r0, =gUnknown_0300127C + movs r1, 0 + str r1, [r0] + ldr r0, =sub_819A514 + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_819A4F8 + + thumb_func_start sub_819A514 +sub_819A514: @ 819A514 + push {r4,r5,lr} + sub sp, 0xC + ldr r0, =gMain + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0xA + bls _0819A528 + b _0819A98E +_0819A528: + lsls r0, 2 + ldr r1, =_0819A53C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0819A53C: + .4byte _0819A568 + .4byte _0819A5C0 + .4byte _0819A69C + .4byte _0819A77C + .4byte _0819A7CC + .4byte _0819A868 + .4byte _0819A8A4 + .4byte _0819A8AC + .4byte _0819A8C4 + .4byte _0819A8DC + .4byte _0819A8FC +_0819A568: + ldr r4, =gUnknown_0203CE3C + ldr r0, [r4] + cmp r0, 0 + beq _0819A578 + bl Free + movs r0, 0 + str r0, [r4] +_0819A578: + movs r0, 0 + bl SetHBlankCallback + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + str r0, [sp, 0x8] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, =0x05006000 + add r0, sp, 0x8 + bl CpuSet + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_08610428 + movs r0, 0 + movs r2, 0x3 + bl InitBgsFromTemplates + ldr r0, =gUnknown_08610434 + bl InitWindows + bl DeactivateAllTextPrinters + b _0819A8E6 + .pool +_0819A5C0: + ldr r5, =gUnknown_0203CE2C + movs r4, 0x88 + lsls r4, 3 + adds r0, r4, 0 + bl Alloc + str r0, [r5] + ldr r5, =gUnknown_0203CE30 + adds r0, r4, 0 + bl AllocZeroed + str r0, [r5] + ldr r5, =gUnknown_0203CE34 + movs r4, 0x80 + lsls r4, 4 + adds r0, r4, 0 + bl Alloc + str r0, [r5] + ldr r5, =gUnknown_0203CE38 + adds r0, r4, 0 + bl AllocZeroed + str r0, [r5] + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + movs r0, 0x4C + movs r1, 0 + bl SetGpuReg + movs r0, 0x40 + movs r1, 0 + bl SetGpuReg + movs r0, 0x44 + movs r1, 0 + bl SetGpuReg + movs r0, 0x42 + movs r1, 0 + bl SetGpuReg + movs r0, 0x46 + movs r1, 0 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0 + bl SetGpuReg + movs r0, 0x4A + movs r1, 0 + bl SetGpuReg + ldr r1, =gMain + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _0819A8EE + .pool +_0819A69C: + bl ResetPaletteFade + bl ResetSpriteData + bl ResetTasks + bl FreeAllSpritePalettes + ldr r0, =gUnknown_08DC0754 + ldr r5, =gUnknown_0203CE2C + ldr r1, [r5] + movs r2, 0x88 + lsls r2, 2 + bl CpuSet + ldr r0, =gUnknown_0861033C + ldr r4, =gUnknown_0203CE30 + ldr r1, [r4] + movs r2, 0x30 + bl CpuSet + ldr r1, [r5] + movs r2, 0x88 + lsls r2, 3 + movs r0, 0x1 + movs r3, 0 + bl LoadBgTiles + ldr r1, [r4] + movs r0, 0x3 + movs r2, 0x60 + movs r3, 0 + bl LoadBgTiles + ldr r0, =gUnknown_08DC0B94 + ldr r4, =gUnknown_0203CE34 + ldr r1, [r4] + movs r2, 0x80 + lsls r2, 3 + bl CpuSet + ldr r1, [r4] + movs r2, 0x80 + lsls r2, 4 + movs r0, 0x1 + movs r3, 0 + bl LoadBgTilemap + ldr r0, =gUnknown_08DC0714 + movs r1, 0 + movs r2, 0x40 + bl LoadPalette + ldr r4, =gUnknown_0861046C + adds r0, r4, 0 + movs r1, 0xF0 + movs r2, 0x8 + bl LoadPalette + adds r0, r4, 0 + movs r1, 0xE0 + movs r2, 0xA + bl LoadPalette + ldr r0, =gUnknown_0300127C + ldr r1, [r0] + ldrb r0, [r1, 0x6] + cmp r0, 0x1 + bne _0819A738 + ldr r0, =gPlttBufferUnfaded + movs r2, 0xA9 + lsls r2, 2 + adds r1, r2 + ldrh r1, [r1] + movs r3, 0xE4 + lsls r3, 1 + adds r0, r3 + strh r1, [r0] +_0819A738: + ldr r0, =gUnknown_0861039C + movs r1, 0x20 + movs r2, 0x4 + bl LoadPalette + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0819A8EE + .pool +_0819A77C: + ldr r0, =gUnknown_0203CE38 + ldr r1, [r0] + movs r0, 0x3 + bl SetBgTilemapBuffer + ldr r5, =gUnknown_0861023C + movs r4, 0x8 + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x3 + adds r1, r5, 0 + movs r2, 0xB + movs r3, 0x4 + bl CopyToBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x3 + adds r1, r5, 0 + movs r2, 0x2 + movs r3, 0x4 + bl CopyToBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x3 + adds r1, r5, 0 + movs r2, 0x14 + movs r3, 0x4 + bl CopyToBgTilemapBufferRect + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + b _0819A8E6 + .pool +_0819A7CC: + ldr r0, =gUnknown_086103F4 + bl LoadSpritePalettes + ldr r0, =gUnknown_086103BC + bl LoadSpriteSheets + ldr r0, =gUnknown_086103E4 + bl LoadCompressedObjectPic + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + ldr r0, =sub_819A4E4 + bl SetVBlankCallback + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade + movs r1, 0x9A + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + ldr r0, =gUnknown_0300127C + ldr r0, [r0] + ldrb r0, [r0, 0x6] + cmp r0, 0x1 + bne _0819A854 + movs r0, 0x58 + movs r1, 0x98 + movs r2, 0x20 + movs r3, 0x60 + bl sub_819C5D0 + movs r0, 0x3 + bl ShowBg + ldr r1, =0x00001248 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x0000040b + movs r0, 0x52 + bl SetGpuReg + b _0819A85A + .pool +_0819A854: + movs r0, 0x3 + bl HideBg +_0819A85A: + ldr r1, =gMain + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _0819A8EE + .pool +_0819A868: + ldr r4, =gUnknown_0300127C + ldr r1, [r4] + ldrb r0, [r1, 0x6] + cmp r0, 0x1 + bne _0819A878 + ldr r0, =gUnknown_0203CF20 + ldrb r0, [r0] + strb r0, [r1, 0x3] +_0819A878: + bl sub_819A9AC + bl sub_819AA18 + ldr r0, [r4] + ldrb r0, [r0, 0x6] + cmp r0, 0x1 + bne _0819A88C + bl sub_819BE34 +_0819A88C: + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0819A8EE + .pool +_0819A8A4: + bl sub_819BA64 + movs r0, 0x2 + b _0819A8E2 +_0819A8AC: + bl sub_819BCF8 + movs r0, 0x5 + bl PutWindowTilemap + ldr r1, =gMain + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _0819A8EE + .pool +_0819A8C4: + bl sub_819B9E8 + movs r0, 0x1 + bl PutWindowTilemap + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0819A8EE + .pool +_0819A8DC: + bl sub_819B9B4 + movs r0, 0 +_0819A8E2: + bl PutWindowTilemap +_0819A8E6: + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 +_0819A8EE: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0819A98E + .pool +_0819A8FC: + ldr r0, =sub_819C69C + movs r1, 0 + bl CreateTask + ldr r2, =gUnknown_0300127C + ldr r1, [r2] + ldr r3, =0x000002a1 + adds r1, r3 + strb r0, [r1] + ldr r3, [r2] + ldrb r5, [r3, 0x6] + cmp r5, 0 + bne _0819A954 + ldr r4, =gTasks + ldr r1, =0x000002a1 + adds r0, r3, r1 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + strh r5, [r0, 0x8] + ldr r0, =sub_819B378 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + strh r5, [r0, 0x8] + b _0819A988 + .pool +_0819A954: + ldr r4, =gTasks + ldr r2, =0x000002a1 + adds r0, r3, r2 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + movs r2, 0 + movs r1, 0x1 + strh r1, [r0, 0x8] + ldr r1, =0x000002a2 + adds r0, r3, r1 + strb r2, [r0] + ldr r0, =sub_819B124 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + movs r1, 0xD + strh r1, [r0, 0x8] +_0819A988: + ldr r0, =sub_819A4C8 + bl SetMainCallback2 +_0819A98E: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819A514 + + thumb_func_start sub_819A9AC +sub_819A9AC: @ 819A9AC + push {r4,r5,lr} + ldr r5, =gUnknown_0300127C + ldr r4, [r5] + cmp r4, 0 + bne _0819AA12 + movs r0, 0xAB + lsls r0, 2 + bl AllocZeroed + str r0, [r5] + strb r4, [r0, 0x3] + ldr r1, [r5] + movs r0, 0x1 + strb r0, [r1, 0x5] + ldr r0, [r5] + strb r4, [r0, 0x6] + movs r2, 0 + movs r4, 0x6C + movs r3, 0 +_0819A9D2: + ldr r0, [r5] + adds r1, r2, 0 + muls r1, r4 + adds r0, r1 + strb r3, [r0, 0x10] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x5 + bls _0819A9D2 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + beq _0819AA0C + movs r0, 0 + bl sub_819B484 + b _0819AA12 + .pool +_0819AA0C: + movs r0, 0 + bl sub_819B63C +_0819AA12: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_819A9AC + + thumb_func_start sub_819AA18 +sub_819AA18: @ 819AA18 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r4, 0 + mov r8, r4 + ldr r7, =gSprites +_0819AA24: + lsls r1, r4, 3 + adds r1, r4 + lsls r1, 2 + subs r1, r4 + adds r1, 0x20 + lsls r1, 16 + asrs r1, 16 + ldr r0, =gUnknown_086105D8 + movs r2, 0x40 + movs r3, 0x1 + bl CreateSprite + ldr r6, =gUnknown_0300127C + ldr r2, [r6] + movs r5, 0x6C + adds r1, r4, 0 + muls r1, r5 + adds r2, r1 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r2, 0xE] + ldrh r1, [r2, 0xE] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + mov r1, r8 + strh r1, [r0, 0x2E] + adds r0, r4, 0 + bl sub_819ADAC + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _0819AA24 + ldr r0, [r6] + ldrb r1, [r0, 0x3] + ldr r4, =gSprites + muls r1, r5 + adds r0, r1 + ldrh r0, [r0, 0xE] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldr r0, =gUnknown_086105F0 + movs r2, 0x20 + ldrsh r1, [r1, r2] + movs r2, 0x58 + movs r3, 0 + bl CreateSprite + ldr r1, [r6] + movs r5, 0 + strb r0, [r1, 0x4] + ldr r0, =gUnknown_08610608 + movs r1, 0xB0 + movs r2, 0x70 + movs r3, 0 + bl CreateSprite + ldr r1, [r6] + strb r0, [r1, 0x1] + ldr r0, =gUnknown_08610620 + movs r1, 0xB0 + movs r2, 0x90 + movs r3, 0 + bl CreateSprite + ldr r1, [r6] + strb r0, [r1, 0x2] + ldr r0, [r6] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldr r0, [r6] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + ldr r0, [r6] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x28 + strb r5, [r0] + ldr r0, [r6] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x29 + strb r5, [r0] + ldr r0, [r6] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x28 + strb r5, [r0] + ldr r0, [r6] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x29 + strb r5, [r0] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819AA18 + + thumb_func_start sub_819AB40 +sub_819AB40: @ 819AB40 + push {r4-r6,lr} + movs r4, 0 +_0819AB44: + ldr r6, =gUnknown_0300127C + ldr r1, [r6] + movs r0, 0x6C + muls r0, r4 + adds r1, r0 + ldrh r1, [r1, 0xE] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, =gSprites + adds r0, r5 + bl DestroySprite + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _0819AB44 + ldr r0, [r6] + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl DestroySprite + ldr r0, [r6] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl DestroySprite + ldr r0, [r6] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl DestroySprite + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819AB40 + + thumb_func_start sub_819ABA8 +sub_819ABA8: @ 819ABA8 + push {r4,lr} + lsls r0, 24 + cmp r0, 0 + ble _0819ABC8 + ldr r0, =gUnknown_0300127C + ldr r1, [r0] + ldrb r3, [r1, 0x3] + adds r2, r0, 0 + cmp r3, 0x5 + beq _0819ABC4 + adds r0, r3, 0x1 + b _0819ABDE + .pool +_0819ABC4: + movs r0, 0 + b _0819ABDE +_0819ABC8: + ldr r0, =gUnknown_0300127C + ldr r1, [r0] + ldrb r3, [r1, 0x3] + adds r2, r0, 0 + cmp r3, 0 + beq _0819ABDC + subs r0, r3, 0x1 + b _0819ABDE + .pool +_0819ABDC: + movs r0, 0x5 +_0819ABDE: + strb r0, [r1, 0x3] + ldr r2, [r2] + ldrb r3, [r2, 0x3] + ldr r4, =gSprites + ldrb r0, [r2, 0x4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + movs r0, 0x6C + muls r0, r3 + adds r2, r0 + ldrh r2, [r2, 0xE] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0, 0x20] + strh r0, [r1, 0x20] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819ABA8 + + thumb_func_start sub_819AC10 +sub_819AC10: @ 819AC10 + push {lr} + lsls r0, 24 + cmp r0, 0 + ble _0819AC30 + ldr r0, =gUnknown_0300127C + ldr r1, [r0] + ldrb r3, [r1] + adds r2, r0, 0 + cmp r3, 0x2 + beq _0819AC2C + adds r0, r3, 0x1 + b _0819AC46 + .pool +_0819AC2C: + movs r0, 0 + b _0819AC46 +_0819AC30: + ldr r0, =gUnknown_0300127C + ldr r1, [r0] + ldrb r3, [r1] + adds r2, r0, 0 + cmp r3, 0 + beq _0819AC44 + subs r0, r3, 0x1 + b _0819AC46 + .pool +_0819AC44: + movs r0, 0x2 +_0819AC46: + strb r0, [r1] + ldr r3, =gSprites + ldr r2, [r2] + ldrb r0, [r2, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r0, [r2] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + ldrb r0, [r2, 0x2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r0, [r2] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + pop {r0} + bx r0 + .pool + thumb_func_end sub_819AC10 + + thumb_func_start sub_819AC78 +sub_819AC78: @ 819AC78 + push {lr} + lsls r0, 24 + cmp r0, 0 + ble _0819AC98 + ldr r0, =gUnknown_0300127C + ldr r1, [r0] + ldrb r3, [r1, 0x7] + adds r2, r0, 0 + cmp r3, 0x1 + beq _0819AC94 + adds r0, r3, 0x1 + b _0819ACAE + .pool +_0819AC94: + movs r0, 0 + b _0819ACAE +_0819AC98: + ldr r0, =gUnknown_0300127C + ldr r1, [r0] + ldrb r3, [r1, 0x7] + adds r2, r0, 0 + cmp r3, 0 + beq _0819ACAC + subs r0, r3, 0x1 + b _0819ACAE + .pool +_0819ACAC: + movs r0, 0x1 +_0819ACAE: + strb r0, [r1, 0x7] + ldr r3, =gSprites + ldr r2, [r2] + ldrb r0, [r2, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r0, [r2, 0x7] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + ldrb r0, [r2, 0x2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r0, [r2, 0x7] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + pop {r0} + bx r0 + .pool + thumb_func_end sub_819AC78 + + thumb_func_start sub_819ACE0 +sub_819ACE0: @ 819ACE0 + push {r4-r6,lr} + ldr r5, =gUnknown_0300127C + ldr r0, [r5] + ldrb r6, [r0, 0x3] + movs r1, 0x6C + adds r4, r6, 0 + muls r4, r1 + adds r0, r4 + ldrb r0, [r0, 0x10] + cmp r0, 0 + beq _0819AD60 + movs r0, 0x64 + bl IndexOfSpritePaletteTag + lsls r0, 24 + lsrs r3, r0, 24 + ldr r1, [r5] + ldrb r0, [r1, 0x5] + cmp r0, 0x3 + bne _0819AD44 + adds r0, r1, r4 + ldrb r0, [r0, 0x10] + cmp r0, 0x1 + bne _0819AD44 + movs r2, 0 + ldrb r0, [r1, 0x10] + cmp r0, 0x2 + beq _0819AD32 + movs r4, 0x6C +_0819AD1A: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x5 + bhi _0819AD32 + ldr r0, [r5] + adds r1, r2, 0 + muls r1, r4 + adds r0, r1 + ldrb r0, [r0, 0x10] + cmp r0, 0x2 + bne _0819AD1A +_0819AD32: + cmp r2, 0x6 + beq _0819AD9C + ldr r0, =gUnknown_0300127C + ldr r1, [r0] + movs r0, 0x6C + muls r0, r2 + adds r1, r0 + movs r0, 0x1 + strb r0, [r1, 0x10] +_0819AD44: + ldr r2, =gUnknown_0300127C + ldr r1, [r2] + movs r0, 0x6C + muls r0, r6 + adds r1, r0 + movs r0, 0 + strb r0, [r1, 0x10] + ldr r1, [r2] + ldrb r0, [r1, 0x5] + subs r0, 0x1 + b _0819AD78 + .pool +_0819AD60: + movs r0, 0x65 + bl IndexOfSpritePaletteTag + lsls r0, 24 + lsrs r3, r0, 24 + ldr r0, [r5] + adds r1, r0, r4 + ldrb r0, [r0, 0x5] + strb r0, [r1, 0x10] + ldr r1, [r5] + ldrb r0, [r1, 0x5] + adds r0, 0x1 +_0819AD78: + strb r0, [r1, 0x5] + ldr r2, =gSprites + ldr r0, =gUnknown_0300127C + ldr r0, [r0] + movs r1, 0x6C + muls r1, r6 + adds r0, r1 + ldrh r0, [r0, 0xE] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + lsls r3, 4 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r3 + strb r0, [r1, 0x5] +_0819AD9C: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819ACE0 + + thumb_func_start sub_819ADAC +sub_819ADAC: @ 819ADAC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gUnknown_0300127C + ldr r0, [r0] + movs r1, 0x6C + muls r1, r4 + adds r0, r1 + ldrb r0, [r0, 0x10] + cmp r0, 0 + beq _0819ADCC + movs r0, 0x65 + b _0819ADCE + .pool +_0819ADCC: + movs r0, 0x64 +_0819ADCE: + bl IndexOfSpritePaletteTag + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, =gSprites + ldr r0, =gUnknown_0300127C + ldr r0, [r0] + movs r1, 0x6C + muls r1, r4 + adds r0, r1 + ldrh r0, [r0, 0xE] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + lsls r3, 4 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r3 + strb r0, [r1, 0x5] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819ADAC + + thumb_func_start sub_819AE08 +sub_819AE08: @ 819AE08 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =gTasks + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r6, r0, r1 + movs r1, 0x8 + ldrsh r0, [r6, r1] + cmp r0, 0x7 + beq _0819AE64 + cmp r0, 0x7 + bgt _0819AE30 + cmp r0, 0x6 + beq _0819AE36 + b _0819AF50 + .pool +_0819AE30: + cmp r0, 0x8 + beq _0819AEE8 + b _0819AF50 +_0819AE36: + ldr r1, =gPlttBufferUnfaded + ldr r0, =gPlttBufferFaded + movs r2, 0xE4 + lsls r2, 1 + adds r0, r2 + ldrh r0, [r0] + adds r1, r2 + movs r2, 0 + strh r0, [r1] + movs r0, 0x1 + negs r0, r0 + str r2, [sp] + movs r1, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + movs r0, 0x7 + strh r0, [r6, 0x8] + b _0819AF50 + .pool +_0819AE64: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _0819AF50 + ldr r4, =gUnknown_0300127C + ldr r0, [r4] + ldr r2, =0x000002a1 + adds r0, r2 + ldrb r0, [r0] + bl DestroyTask + ldr r1, [r4] + movs r3, 0xA6 + lsls r3, 2 + adds r0, r1, r3 + ldr r0, [r0] + movs r2, 0xA8 + lsls r2, 2 + adds r1, r2 + bl sub_819F444 + bl sub_819AB40 + ldr r4, =gUnknown_0203CE2C + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203CE30 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203CE34 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203CE38 + ldr r0, [r4] + bl Free + str r5, [r4] + bl FreeAllWindowBuffers + movs r0, 0x8 + strh r0, [r6, 0x8] + b _0819AF50 + .pool +_0819AEE8: + ldr r4, =gUnknown_0300127C + ldr r1, [r4] + ldr r0, =gPlttBufferUnfaded + movs r3, 0xE4 + lsls r3, 1 + adds r0, r3 + ldrh r0, [r0] + adds r3, 0xDC + adds r1, r3 + strh r0, [r1] + adds r0, r2, 0 + bl DestroyTask + ldr r1, [r4] + movs r0, 0x1 + strb r0, [r1, 0x6] + ldr r0, [r4] + ldrb r6, [r0, 0x3] + ldr r4, =gUnknown_0203CE3C + movs r0, 0x96 + lsls r0, 2 + bl AllocZeroed + str r0, [r4] + movs r4, 0 +_0819AF1A: + ldr r5, =gUnknown_0203CE3C + ldr r1, [r5] + movs r0, 0x64 + muls r0, r4 + adds r0, r1 + ldr r1, =gUnknown_0300127C + ldr r1, [r1] + movs r2, 0x6C + muls r2, r4 + adds r1, r2 + adds r1, 0x14 + movs r2, 0x64 + bl memcpy + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _0819AF1A + ldr r1, [r5] + ldr r0, =sub_819A514 + str r0, [sp] + movs r0, 0x1 + adds r2, r6, 0 + movs r3, 0x5 + bl sub_81BF8EC +_0819AF50: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819AE08 + + thumb_func_start bc_exit_to_overworld +bc_exit_to_overworld: @ 819AF68 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r7, =gUnknown_0300127C + ldr r0, [r7] + movs r1, 0xA8 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0819B00E + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r1, [r4, r0] + cmp r1, 0 + beq _0819AFA0 + cmp r1, 0x1 + beq _0819AFB8 + b _0819B00E + .pool +_0819AFA0: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0819B00E +_0819AFB8: + bl UpdatePaletteFade + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _0819B00E + bl sub_819B764 + ldr r0, [r7] + ldr r1, =0x000002a1 + adds r0, r1 + ldrb r0, [r0] + bl DestroyTask + bl sub_819AB40 + ldr r4, =gUnknown_0203CE2C + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203CE34 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203CE38 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r0, [r7] + bl Free + str r5, [r7] + bl FreeAllWindowBuffers + ldr r0, =sub_80861B0 + bl SetMainCallback2 + adds r0, r6, 0 + bl DestroyTask +_0819B00E: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end bc_exit_to_overworld + + thumb_func_start sub_819B02C +sub_819B02C: @ 819B02C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r7, =gUnknown_0300127C + ldr r0, [r7] + movs r1, 0xA8 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0819B11A + ldr r1, =gTasks + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r5, r0, r1 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x5 + beq _0819B084 + cmp r0, 0x5 + bgt _0819B06C + cmp r0, 0x4 + beq _0819B07A + b _0819B11A + .pool +_0819B06C: + cmp r0, 0xA + bne _0819B11A + bl sub_819C4B4 + movs r0, 0x4 + strh r0, [r5, 0x8] + b _0819B11A +_0819B07A: + bl sub_819B8D4 + movs r0, 0x5 + strh r0, [r5, 0x8] + b _0819B11A +_0819B084: + ldr r2, =gMain + ldrh r1, [r2, 0x2E] + movs r0, 0x1 + mov r8, r0 + movs r6, 0x1 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _0819B0B8 + movs r0, 0x5 + bl PlaySE + ldr r0, [r7] + ldrb r4, [r0, 0x7] + cmp r4, 0 + bne _0819B0C6 + bl sub_819C568 + strh r4, [r5, 0x8] + ldr r0, =bc_exit_to_overworld + str r0, [r5] + b _0819B11A + .pool +_0819B0B8: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0819B0EC + movs r0, 0x5 + bl PlaySE +_0819B0C6: + movs r0, 0x4 + bl sub_819B958 + bl sub_819BC9C + ldr r0, [r7] + ldr r1, =0x000002a2 + adds r0, r1 + mov r1, r8 + strb r1, [r0] + strh r6, [r5, 0x8] + ldr r0, =sub_819B378 + str r0, [r5] + b _0819B11A + .pool +_0819B0EC: + ldrh r1, [r2, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0819B106 + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + negs r0, r0 + bl sub_819AC78 + b _0819B11A +_0819B106: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0819B11A + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + bl sub_819AC78 +_0819B11A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819B02C + + thumb_func_start sub_819B124 +sub_819B124: @ 819B124 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0, 0x8] + subs r0, 0x2 + lsls r0, 16 + asrs r0, 16 + adds r6, r1, 0 + cmp r0, 0xB + bls _0819B144 + b _0819B36E +_0819B144: + lsls r0, 2 + ldr r1, =_0819B158 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0819B158: + .4byte _0819B188 + .4byte _0819B1EC + .4byte _0819B36E + .4byte _0819B36E + .4byte _0819B36E + .4byte _0819B36E + .4byte _0819B36E + .4byte _0819B1BC + .4byte _0819B36E + .4byte _0819B36E + .4byte _0819B300 + .4byte _0819B35C +_0819B188: + ldr r0, =gUnknown_0300127C + ldr r1, [r0] + ldrb r0, [r1, 0x6] + cmp r0, 0 + bne _0819B1A2 + ldr r2, =0x00000299 + adds r0, r1, r2 + movs r7, 0xA8 + lsls r7, 2 + adds r1, r7 + movs r2, 0 + bl sub_819F2B4 +_0819B1A2: + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + movs r0, 0x9 + b _0819B36C + .pool +_0819B1BC: + ldr r4, =gUnknown_0300127C + ldr r0, [r4] + movs r1, 0xA8 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0819B1CE + b _0819B36E +_0819B1CE: + bl sub_819B844 + ldr r1, [r4] + movs r0, 0 + strb r0, [r1, 0x6] + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + b _0819B344 + .pool +_0819B1EC: + ldr r2, =gMain + ldrh r1, [r2, 0x2E] + movs r7, 0x1 + movs r6, 0x1 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _0819B27C + movs r0, 0x5 + bl PlaySE + bl sub_819BC04 + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x1 + bne _0819B228 + ldr r0, =gUnknown_0300127C + ldr r0, [r0] + ldr r2, =0x000002a2 + adds r0, r2 + b _0819B2AC + .pool +_0819B228: + cmp r0, 0x2 + bne _0819B248 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0xA + strh r1, [r0, 0x8] + ldr r1, =sub_819B02C + str r1, [r0] + b _0819B36E + .pool +_0819B248: + cmp r1, 0x3 + bne _0819B260 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0xB + strh r1, [r0, 0x8] + b _0819B2BA + .pool +_0819B260: + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x6 + strh r1, [r0, 0x8] + ldr r1, =sub_819AE08 + str r1, [r0] + b _0819B36E + .pool +_0819B27C: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0819B2D0 + movs r0, 0x5 + bl PlaySE + ldr r4, =gUnknown_0300127C + ldr r1, [r4] + movs r2, 0xA6 + lsls r2, 2 + adds r0, r1, r2 + ldr r0, [r0] + adds r2, 0x8 + adds r1, r2 + movs r2, 0 + bl sub_819F3F8 + movs r0, 0x3 + bl sub_819B958 + ldr r0, [r4] + ldr r1, =0x000002a2 + adds r0, r1 +_0819B2AC: + strb r7, [r0] + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + strh r6, [r0, 0x8] +_0819B2BA: + ldr r1, =sub_819B378 + str r1, [r0] + b _0819B36E + .pool +_0819B2D0: + ldrh r1, [r2, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0819B2EA + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + negs r0, r0 + bl sub_819AC10 + b _0819B36E +_0819B2EA: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0819B36E + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + bl sub_819AC10 + b _0819B36E +_0819B300: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + bne _0819B36E + ldr r4, =gUnknown_0300127C + ldr r2, [r4] + ldrb r0, [r2, 0x6] + cmp r0, 0x1 + bne _0819B338 + ldr r1, =gPlttBufferFaded + movs r7, 0xA9 + lsls r7, 2 + adds r0, r2, r7 + ldrh r0, [r0] + movs r2, 0xE4 + lsls r2, 1 + adds r1, r2 + strh r0, [r1] + ldr r0, =gPlttBufferUnfaded + subs r7, 0xBC + adds r1, r0, r7 + ldrh r1, [r1] + adds r0, r2 + strh r1, [r0] +_0819B338: + ldr r0, [r4] + strb r3, [r0, 0x6] + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r6 +_0819B344: + movs r1, 0x3 + strh r1, [r0, 0x8] + b _0819B36E + .pool +_0819B35C: + bl sub_819B844 + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + movs r0, 0xC +_0819B36C: + strh r0, [r1, 0x8] +_0819B36E: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819B124 + + thumb_func_start sub_819B378 +sub_819B378: @ 819B378 + push {r4-r7,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r5, =gUnknown_0300127C + ldr r3, [r5] + movs r7, 0xA8 + lsls r7, 2 + adds r0, r3, r7 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0819B476 + ldr r1, =gTasks + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r1, [r4, r0] + cmp r1, 0x1 + beq _0819B3DC + cmp r1, 0x1 + bgt _0819B3B4 + cmp r1, 0 + beq _0819B3BA + b _0819B476 + .pool +_0819B3B4: + cmp r1, 0xB + beq _0819B440 + b _0819B476 +_0819B3BA: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0819B476 + movs r0, 0x1 + movs r1, 0x1 + strh r1, [r4, 0x8] + ldr r2, =0x000002a2 + adds r1, r3, r2 + strb r0, [r1] + b _0819B476 + .pool +_0819B3DC: + ldr r2, =gMain + ldrh r0, [r2, 0x2E] + ands r1, r0 + cmp r1, 0 + beq _0819B40C + movs r0, 0x5 + bl PlaySE + ldr r0, [r5] + ldr r1, =0x000002a2 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + movs r0, 0x2 + strh r0, [r4, 0x8] + ldr r0, =sub_819B124 + str r0, [r4] + b _0819B476 + .pool +_0819B40C: + ldrh r1, [r2, 0x30] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0819B422 + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + negs r0, r0 + b _0819B432 +_0819B422: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0819B476 + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 +_0819B432: + bl sub_819ABA8 + bl sub_819BCF8 + bl sub_819B9E8 + b _0819B476 +_0819B440: + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r6, 0x1 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _0819B476 + movs r0, 0x5 + bl PlaySE + ldr r1, [r5] + movs r2, 0xA6 + lsls r2, 2 + adds r0, r1, r2 + ldr r0, [r0] + adds r1, r7 + movs r2, 0 + bl sub_819F3F8 + bl sub_819BA64 + ldr r0, [r5] + ldr r1, =0x000002a2 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + strh r6, [r4, 0x8] +_0819B476: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819B378 + + thumb_func_start sub_819B484 +sub_819B484: @ 819B484 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x10] + movs r6, 0 + add r0, sp, 0xC + strb r6, [r0] + ldr r0, =0x000040ce + bl VarGet + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + ldr r7, =gSaveBlock2Ptr + ldr r2, [r7] + ldr r0, =0x00000ca9 + adds r4, r2, r0 + ldrb r0, [r4] + lsls r0, 30 + lsrs r0, 30 + adds r5, r0, 0 + lsls r0, r5, 1 + lsls r1, r6, 2 + adds r0, r1 + ldr r1, =0x00000de2 + adds r2, r1 + adds r2, r0 + ldrh r0, [r2] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x18] + ldr r1, =gUnknown_0203BC8C + ldr r0, =gBattleFrontierMons + str r0, [r1] + ldrb r1, [r4] + movs r0, 0x3 + ands r0, r1 + movs r2, 0x32 + str r2, [sp, 0x14] + cmp r0, 0 + beq _0819B4EA + movs r3, 0x64 + str r3, [sp, 0x14] +_0819B4EA: + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_81A6F70 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x1C] + ldr r1, [r7] + ldrb r0, [r1, 0xA] + mov r9, r0 + ldrb r0, [r1, 0xB] + lsls r0, 8 + mov r2, r9 + orrs r2, r0 + ldrb r0, [r1, 0xC] + lsls r0, 16 + orrs r2, r0 + ldrb r0, [r1, 0xD] + lsls r0, 24 + orrs r2, r0 + mov r9, r2 + movs r3, 0 + mov r8, r3 +_0819B518: + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + mov r2, r8 + lsls r0, r2, 1 + add r0, r8 + lsls r0, 2 + adds r1, r0 + movs r3, 0xE7 + lsls r3, 4 + adds r1, r3 + ldrh r5, [r1] + ldr r0, =gUnknown_0300127C + ldr r1, [r0] + ldr r2, [sp, 0x10] + add r2, r8 + movs r3, 0x6C + adds r0, r2, 0 + muls r0, r3 + adds r1, r0 + strh r5, [r1, 0xC] + mov r10, r2 + ldr r0, [sp, 0x1C] + cmp r8, r0 + bcs _0819B570 + ldr r0, [sp, 0x18] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + b _0819B572 + .pool +_0819B570: + ldr r0, [sp, 0x18] +_0819B572: + movs r1, 0 + bl sub_81A6CA8 + lsls r0, 24 + lsrs r6, r0, 24 + movs r1, 0x6C + mov r4, r10 + muls r4, r1 + adds r4, 0xC + ldr r2, =gUnknown_0300127C + ldr r0, [r2] + adds r0, r4 + adds r0, 0x8 + ldr r1, =gUnknown_0203BC8C + ldr r2, [r1] + lsls r5, 4 + adds r2, r5, r2 + ldrh r1, [r2] + ldrb r3, [r2, 0xC] + str r6, [sp] + ldrb r2, [r2, 0xB] + str r2, [sp, 0x4] + mov r2, r9 + str r2, [sp, 0x8] + ldr r2, [sp, 0x14] + bl sub_8068634 + movs r1, 0 + add r0, sp, 0xC + strb r1, [r0] + movs r6, 0 + adds r7, r5, 0 + movs r3, 0x1 + add r8, r3 + ldr r3, =gUnknown_0300127C +_0819B5B8: + ldr r0, [r3] + adds r0, r4 + adds r0, 0x8 + ldr r5, =gUnknown_0203BC8C + ldr r1, [r5] + adds r1, r7, r1 + lsls r2, r6, 1 + adds r1, 0x2 + adds r1, r2 + ldrh r1, [r1] + adds r2, r6, 0 + str r3, [sp, 0x20] + bl sub_81A7024 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r3, [sp, 0x20] + cmp r6, 0x3 + bls _0819B5B8 + movs r0, 0x6C + mov r4, r10 + muls r4, r0 + adds r4, 0xC + ldr r1, =gUnknown_0300127C + ldr r0, [r1] + adds r0, r4 + adds r0, 0x8 + movs r1, 0x20 + add r2, sp, 0xC + bl SetMonData + ldr r2, =gUnknown_0300127C + ldr r0, [r2] + adds r0, r4 + adds r0, 0x8 + ldr r1, [r5] + adds r1, r7, r1 + ldrb r2, [r1, 0xA] + lsls r2, 1 + ldr r1, =gBattleFrontierHeldItems + adds r2, r1 + movs r1, 0xC + bl SetMonData + mov r3, r8 + lsls r0, r3, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x5 + bhi _0819B620 + b _0819B518 +_0819B620: + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819B484 + + thumb_func_start sub_819B63C +sub_819B63C: @ 819B63C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x10] + add r0, sp, 0xC + movs r1, 0 + strb r1, [r0] + ldr r2, =gUnknown_0203BC8C + ldr r0, =gSlateportBattleTentMons + str r0, [r2] + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldrb r3, [r1, 0xA] + ldrb r0, [r1, 0xB] + lsls r0, 8 + orrs r3, r0 + ldrb r0, [r1, 0xC] + lsls r0, 16 + orrs r3, r0 + ldrb r0, [r1, 0xD] + lsls r0, 24 + orrs r3, r0 + mov r10, r3 + movs r7, 0 + mov r9, r7 +_0819B678: + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + mov r2, r9 + lsls r0, r2, 1 + add r0, r9 + lsls r0, 2 + adds r1, r0 + movs r3, 0xE7 + lsls r3, 4 + adds r1, r3 + ldrh r1, [r1] + mov r8, r1 + ldr r7, =gUnknown_0300127C + ldr r0, [r7] + ldr r6, [sp, 0x10] + add r6, r9 + movs r1, 0x6C + adds r4, r6, 0 + muls r4, r1 + adds r1, r0, r4 + mov r2, r8 + strh r2, [r1, 0xC] + adds r4, 0xC + adds r0, r4 + adds r0, 0x8 + ldr r3, =gUnknown_0203BC8C + ldr r2, [r3] + mov r7, r8 + lsls r5, r7, 4 + adds r2, r5, r2 + ldrh r1, [r2] + ldrb r3, [r2, 0xC] + movs r7, 0 + str r7, [sp] + ldrb r2, [r2, 0xB] + str r2, [sp, 0x4] + mov r2, r10 + str r2, [sp, 0x8] + movs r2, 0x1E + bl sub_8068634 + add r0, sp, 0xC + movs r3, 0 + strb r3, [r0] + movs r0, 0x1 + add r9, r0 +_0819B6D4: + ldr r1, =gUnknown_0300127C + ldr r0, [r1] + adds r0, r4 + adds r0, 0x8 + ldr r3, =gUnknown_0203BC8C + ldr r2, [r3] + mov r3, r8 + lsls r1, r3, 4 + adds r1, r2 + lsls r2, r7, 1 + adds r1, 0x2 + adds r1, r2 + ldrh r1, [r1] + adds r2, r7, 0 + bl sub_81A7024 + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x3 + bls _0819B6D4 + movs r7, 0x6C + adds r4, r6, 0 + muls r4, r7 + adds r4, 0xC + ldr r1, =gUnknown_0300127C + ldr r0, [r1] + adds r0, r4 + adds r0, 0x8 + movs r1, 0x20 + add r2, sp, 0xC + bl SetMonData + ldr r2, =gUnknown_0300127C + ldr r0, [r2] + adds r0, r4 + adds r0, 0x8 + ldr r3, =gUnknown_0203BC8C + ldr r1, [r3] + adds r1, r5, r1 + ldrb r2, [r1, 0xA] + lsls r2, 1 + ldr r1, =gBattleFrontierHeldItems + adds r2, r1 + movs r1, 0xC + bl SetMonData + mov r7, r9 + lsls r0, r7, 24 + lsrs r0, 24 + mov r9, r0 + cmp r0, 0x5 + bls _0819B678 + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819B63C + + thumb_func_start sub_819B764 +sub_819B764: @ 819B764 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r7, 0 + ldr r0, =gUnknown_0300127C + mov r10, r0 + ldr r1, =gSaveBlock2Ptr + mov r8, r1 +_0819B778: + movs r2, 0 + adds r0, r7, 0x1 + mov r9, r0 +_0819B77E: + mov r1, r10 + ldr r0, [r1] + movs r1, 0x6C + adds r6, r2, 0 + muls r6, r1 + adds r1, r0, r6 + ldrb r0, [r1, 0x10] + cmp r0, r9 + bne _0819B81C + movs r0, 0x64 + adds r5, r7, 0 + muls r5, r0 + ldr r2, =gPlayerParty + adds r5, r2 + adds r1, 0x14 + adds r0, r5, 0 + movs r2, 0x64 + bl memcpy + mov r0, r8 + ldr r1, [r0] + lsls r4, r7, 1 + adds r4, r7 + lsls r4, 2 + adds r1, r4 + mov r2, r10 + ldr r0, [r2] + adds r0, r6 + ldrh r0, [r0, 0xC] + movs r2, 0xE7 + lsls r2, 4 + adds r1, r2 + strh r0, [r1] + adds r0, r5, 0 + movs r1, 0 + movs r2, 0 + bl GetMonData + mov r2, r8 + ldr r1, [r2] + ldr r2, =0x00000e74 + adds r1, r2 + adds r1, r4 + str r0, [r1] + adds r0, r5, 0 + movs r1, 0x2E + movs r2, 0 + bl pokemon_getattr_encrypted + mov r2, r8 + ldr r1, [r2] + adds r1, r4 + ldr r2, =0x00000e79 + adds r1, r2 + strb r0, [r1] + adds r0, r5, 0 + movs r1, 0x28 + movs r2, 0 + bl pokemon_getattr_encrypted + mov r2, r8 + ldr r1, [r2] + adds r1, r4 + ldr r2, =0x00000e78 + adds r1, r2 + strb r0, [r1] + b _0819B826 + .pool +_0819B81C: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x5 + bls _0819B77E +_0819B826: + mov r1, r9 + lsls r0, r1, 24 + lsrs r7, r0, 24 + cmp r7, 0x2 + bls _0819B778 + bl calc_player_party_count + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819B764 + + thumb_func_start sub_819B844 +sub_819B844: @ 819B844 + push {r4,r5,lr} + ldr r5, =gUnknown_0300127C + ldr r1, [r5] + ldrb r0, [r1, 0x6] + cmp r0, 0 + bne _0819B852 + strb r0, [r1] +_0819B852: + ldr r4, =gSprites + ldr r2, [r5] + ldrb r1, [r2, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xB0 + strh r1, [r0, 0x20] + ldrb r0, [r2, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r0, [r2] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + ldrb r1, [r2, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xD0 + strh r1, [r0, 0x20] + ldrb r0, [r2, 0x2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r0, [r2] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + ldrb r0, [r2, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + adds r1, 0x3E + ldrb r3, [r1] + movs r2, 0x5 + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + strb r0, [r1] + ldr r0, [r5] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + ands r2, r1 + strb r2, [r0] + bl sub_819BAFC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819B844 + + thumb_func_start sub_819B8D4 +sub_819B8D4: @ 819B8D4 + push {r4,r5,lr} + ldr r5, =gUnknown_0300127C + ldr r1, [r5] + movs r0, 0 + strb r0, [r1, 0x7] + ldr r4, =gSprites + ldr r2, [r5] + ldrb r1, [r2, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xB0 + strh r1, [r0, 0x20] + ldrb r1, [r2, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r3, 0x70 + strh r3, [r0, 0x22] + ldrb r1, [r2, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xD0 + strh r1, [r0, 0x20] + ldrb r1, [r2, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r3, [r0, 0x22] + ldrb r0, [r2, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + adds r1, 0x3E + ldrb r3, [r1] + movs r2, 0x5 + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + strb r0, [r1] + ldr r0, [r5] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + ands r2, r1 + strb r2, [r0] + bl sub_819BBA8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819B8D4 + + thumb_func_start sub_819B958 +sub_819B958: @ 819B958 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =gSprites + ldr r3, =gUnknown_0300127C + ldr r0, [r3] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldr r0, [r3] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + adds r0, r4, 0 + movs r1, 0 + bl FillWindowPixelBuffer + adds r0, r4, 0 + movs r1, 0x2 + bl CopyWindowToVram + adds r0, r4, 0 + bl ClearWindowTilemap + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819B958 + + thumb_func_start sub_819B9B4 +sub_819B9B4: @ 819B9B4 + push {lr} + sub sp, 0xC + movs r0, 0 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r2, =gUnknown_085EEBB2 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x2 + bl Print + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_819B9B4 + + thumb_func_start sub_819B9E8 +sub_819B9E8: @ 819B9E8 + push {r4,r5,lr} + sub sp, 0xC + ldr r5, =gUnknown_0300127C + ldr r0, [r5] + ldrb r4, [r0, 0x3] + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x6C + muls r0, r4 + ldr r1, [r5] + adds r0, r1 + adds r0, 0x14 + movs r1, 0xB + movs r2, 0 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + ldr r4, =gStringVar4 + movs r1, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + adds r0, r4, 0 + bl StringCopy + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x56 + bl GetStringRightAlignXOffset + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =gUnknown_08610479 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0x1 + bl box_print + movs r0, 0x1 + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819B9E8 + + thumb_func_start sub_819BA64 +sub_819BA64: @ 819BA64 + push {lr} + sub sp, 0xC + movs r0, 0x2 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r0, =gUnknown_0300127C + ldr r0, [r0] + ldrb r0, [r0, 0x5] + cmp r0, 0x1 + bne _0819BA88 + ldr r2, =gUnknown_085EEBC1 + b _0819BA9C + .pool +_0819BA88: + cmp r0, 0x2 + bne _0819BA94 + ldr r2, =gUnknown_085EEBDB + b _0819BA9C + .pool +_0819BA94: + ldr r2, =gUnknown_085EEC2D + cmp r0, 0x3 + bne _0819BA9C + ldr r2, =gUnknown_085EEBF6 +_0819BA9C: + movs r0, 0x5 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + movs r3, 0x2 + bl Print + movs r0, 0x2 + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_819BA64 + + thumb_func_start sub_819BAC8 +sub_819BAC8: @ 819BAC8 + push {lr} + sub sp, 0xC + movs r0, 0x2 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r2, =gUnknown_085EEC50 + movs r0, 0x5 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + movs r3, 0x2 + bl Print + movs r0, 0x2 + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_819BAC8 + + thumb_func_start sub_819BAFC +sub_819BAFC: @ 819BAFC + push {r4-r6,lr} + sub sp, 0xC + ldr r0, =gUnknown_0300127C + ldr r0, [r0] + ldrb r2, [r0, 0x3] + movs r1, 0x6C + muls r1, r2 + adds r0, r1 + ldrb r5, [r0, 0x10] + movs r0, 0x3 + bl PutWindowTilemap + movs r0, 0x3 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r4, =gUnknown_08610476 + str r4, [sp] + movs r6, 0 + str r6, [sp, 0x4] + ldr r0, =gUnknown_085EEC15 + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0x7 + movs r3, 0x1 + bl box_print + cmp r5, 0 + beq _0819BB60 + str r4, [sp] + str r6, [sp, 0x4] + ldr r0, =gUnknown_085EEC24 + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0x7 + movs r3, 0x11 + bl box_print + b _0819BB74 + .pool +_0819BB60: + str r4, [sp] + str r5, [sp, 0x4] + ldr r0, =gUnknown_085EEC10 + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0x7 + movs r3, 0x11 + bl box_print +_0819BB74: + ldr r0, =gUnknown_08610476 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + ldr r0, =gUnknown_085EEC1D + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0x7 + movs r3, 0x21 + bl box_print + movs r0, 0x3 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819BAFC + + thumb_func_start sub_819BBA8 +sub_819BBA8: @ 819BBA8 + push {r4,r5,lr} + sub sp, 0xC + movs r0, 0x4 + bl PutWindowTilemap + movs r0, 0x4 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r5, =gUnknown_08610476 + str r5, [sp] + movs r4, 0 + str r4, [sp, 0x4] + ldr r0, =gUnknown_085EEC49 + str r0, [sp, 0x8] + movs r0, 0x4 + movs r1, 0x1 + movs r2, 0x7 + movs r3, 0x1 + bl box_print + str r5, [sp] + str r4, [sp, 0x4] + ldr r0, =gUnknown_085EEC4D + str r0, [sp, 0x8] + movs r0, 0x4 + movs r1, 0x1 + movs r2, 0x7 + movs r3, 0x11 + bl box_print + movs r0, 0x4 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819BBA8 + + thumb_func_start sub_819BC04 +sub_819BC04: @ 819BC04 + push {lr} + ldr r2, =gUnknown_030062E8 + ldr r1, =gUnknown_0861041C + ldr r0, =gUnknown_0300127C + ldr r0, [r0] + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [r2] + bl _call_via_r0 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_819BC04 + + thumb_func_start sub_819BC30 +sub_819BC30: @ 819BC30 + push {r4,lr} + ldr r0, =gUnknown_0300127C + ldr r0, [r0] + ldrb r2, [r0, 0x3] + movs r1, 0x6C + muls r1, r2 + adds r0, r1 + ldrb r1, [r0, 0x10] + ldrh r0, [r0, 0xC] + cmp r1, 0 + bne _0819BC60 + bl sub_819C634 + cmp r0, 0 + bne _0819BC60 + bl sub_819BAC8 + movs r0, 0x3 + bl sub_819B958 + movs r0, 0x3 + b _0819BC96 + .pool +_0819BC60: + ldr r4, =gUnknown_0300127C + ldr r1, [r4] + movs r2, 0xA6 + lsls r2, 2 + adds r0, r1, r2 + ldr r0, [r0] + adds r2, 0x8 + adds r1, r2 + movs r2, 0 + bl sub_819F3F8 + bl sub_819ACE0 + bl sub_819BA64 + movs r0, 0x3 + bl sub_819B958 + ldr r0, [r4] + ldrb r0, [r0, 0x5] + cmp r0, 0x3 + bhi _0819BC94 + movs r0, 0x1 + b _0819BC96 + .pool +_0819BC94: + movs r0, 0x2 +_0819BC96: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_819BC30 + + thumb_func_start sub_819BC9C +sub_819BC9C: @ 819BC9C + push {lr} + bl sub_819C568 + bl sub_819ACE0 + bl sub_819BA64 + movs r0, 0x3 + bl sub_819B958 + ldr r0, =gUnknown_0300127C + ldr r0, [r0] + ldrb r0, [r0, 0x5] + cmp r0, 0x3 + bhi _0819BCC4 + movs r0, 0x1 + b _0819BCC6 + .pool +_0819BCC4: + movs r0, 0x2 +_0819BCC6: + pop {r1} + bx r1 + thumb_func_end sub_819BC9C + + thumb_func_start sub_819BCCC +sub_819BCCC: @ 819BCCC + movs r0, 0 + bx lr + thumb_func_end sub_819BCCC + + thumb_func_start sub_819BCD0 +sub_819BCD0: @ 819BCD0 + push {lr} + ldr r0, =gUnknown_0300127C + ldr r1, [r0] + movs r2, 0xA6 + lsls r2, 2 + adds r0, r1, r2 + ldr r0, [r0] + adds r2, 0x8 + adds r1, r2 + movs r2, 0 + bl sub_819F3F8 + movs r0, 0x3 + bl sub_819B958 + movs r0, 0x1 + pop {r1} + bx r1 + .pool + thumb_func_end sub_819BCD0 + + thumb_func_start sub_819BCF8 +sub_819BCF8: @ 819BCF8 + push {r4,r5,lr} + sub sp, 0x2C + ldr r5, =gUnknown_0300127C + ldr r0, [r5] + ldrb r4, [r0, 0x3] + cmp r4, 0x5 + bhi _0819BD64 + movs r0, 0x5 + bl PutWindowTilemap + movs r0, 0x5 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x6C + muls r0, r4 + ldr r1, [r5] + adds r0, r1 + adds r0, 0x14 + movs r1, 0xB + movs r2, 0 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + add r1, sp, 0xC + bl sub_81DB468 + movs r0, 0x1 + add r1, sp, 0xC + movs r2, 0x76 + bl GetStringRightAlignXOffset + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x5 + movs r1, 0x1 + add r2, sp, 0xC + bl Print + movs r0, 0x5 + movs r1, 0x2 + bl CopyWindowToVram +_0819BD64: + add sp, 0x2C + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819BCF8 + + thumb_func_start sub_819BD70 +sub_819BD70: @ 819BD70 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x10 + ldr r6, =gUnknown_0300127C + ldr r2, [r6] + ldrb r1, [r2, 0x3] + movs r0, 0x6C + adds r4, r1, 0 + muls r4, r0 + adds r4, r2 + adds r4, 0x14 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl GetMonData + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl GetMonData + mov r8, r0 + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + bl GetMonData + adds r1, r0, 0 + movs r0, 0x58 + str r0, [sp] + movs r0, 0x20 + str r0, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + ldr r0, =0x0000ffff + str r0, [sp, 0xC] + adds r0, r5, 0 + mov r2, r8 + movs r3, 0x1 + bl sub_818D7D8 + ldr r1, [r6] + movs r2, 0xA6 + lsls r2, 2 + adds r1, r2 + movs r3, 0 + strb r0, [r1] + ldr r4, =gSprites + ldr r0, [r6] + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x28 + strb r3, [r0] + ldr r0, [r6] + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x29 + strb r3, [r0] + ldr r0, [r6] + movs r1, 0xA8 + lsls r1, 2 + adds r0, r1 + strb r3, [r0] + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819BD70 + + thumb_func_start sub_819BE20 +sub_819BE20: @ 819BE20 + ldr r1, =gUnknown_0300127C + ldr r1, [r1] + movs r2, 0xA8 + lsls r2, 2 + adds r1, r2 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_819BE20 + + thumb_func_start sub_819BE34 +sub_819BE34: @ 819BE34 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + ldr r0, =gUnknown_08610638 + movs r1, 0x78 + movs r2, 0x40 + movs r3, 0x1 + bl CreateSprite + ldr r6, =gUnknown_0300127C + ldr r1, [r6] + ldr r2, =0x00000299 + mov r10, r2 + add r1, r10 + movs r7, 0 + strb r0, [r1] + ldr r0, [r6] + add r0, r10 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + mov r8, r1 + add r0, r8 + movs r1, 0x2 + bl StartSpriteAffineAnim + ldr r2, [r6] + ldrb r1, [r2, 0x3] + movs r0, 0x6C + adds r4, r1, 0 + muls r4, r0 + adds r4, r2 + adds r4, 0x14 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl GetMonData + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl GetMonData + mov r9, r0 + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + bl GetMonData + adds r1, r0, 0 + movs r0, 0x58 + str r0, [sp] + movs r0, 0x20 + str r0, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + ldr r0, =0x0000ffff + str r0, [sp, 0xC] + adds r0, r5, 0 + mov r2, r9 + movs r3, 0x1 + bl sub_818D7D8 + ldr r1, [r6] + movs r2, 0xA6 + lsls r2, 2 + adds r1, r2 + strb r0, [r1] + ldr r0, [r6] + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + adds r0, 0x28 + strb r7, [r0] + ldr r0, [r6] + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + adds r0, 0x29 + strb r7, [r0] + ldr r0, [r6] + add r0, r10 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819BE34 + + thumb_func_start sub_819BF2C +sub_819BF2C: @ 819BF2C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + movs r7, 0 + ldr r0, =gUnknown_0300127C + mov r9, r0 +_0819BF3E: + movs r2, 0 + adds r1, r7, 0x1 + mov r10, r1 + lsls r0, r7, 2 + mov r8, r0 +_0819BF48: + mov r0, r9 + ldr r1, [r0] + movs r0, 0x6C + adds r4, r2, 0 + muls r4, r0 + adds r0, r1, r4 + ldrb r0, [r0, 0x10] + cmp r0, r10 + bne _0819C008 + adds r4, r1 + adds r4, 0x14 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl GetMonData + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl GetMonData + adds r6, r0, 0 + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + bl GetMonData + adds r1, r0, 0 + lsls r0, r7, 3 + adds r0, r7 + lsls r0, 19 + movs r2, 0x80 + lsls r2, 13 + adds r0, r2 + asrs r0, 16 + str r0, [sp] + movs r0, 0x20 + str r0, [sp, 0x4] + adds r0, r7, 0 + adds r0, 0xD + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x8] + ldr r0, =0x0000ffff + str r0, [sp, 0xC] + adds r0, r5, 0 + adds r2, r6, 0 + movs r3, 0x1 + bl sub_818D7D8 + mov r2, r9 + ldr r1, [r2] + add r1, r8 + movs r2, 0xA5 + lsls r2, 2 + adds r1, r2 + strb r0, [r1] + mov r1, r9 + ldr r0, [r1] + add r0, r8 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r2, =gSprites + adds r0, r2 + adds r0, 0x28 + movs r1, 0 + strb r1, [r0] + mov r2, r9 + ldr r0, [r2] + add r0, r8 + movs r1, 0xA5 + lsls r1, 2 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r2, =gSprites + adds r0, r2 + adds r0, 0x29 + movs r1, 0 + strb r1, [r0] + b _0819C012 + .pool +_0819C008: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x5 + bls _0819BF48 +_0819C012: + mov r2, r10 + lsls r0, r2, 24 + lsrs r7, r0, 24 + cmp r7, 0x2 + bls _0819BF3E + ldr r0, =gUnknown_0300127C + ldr r0, [r0] + movs r1, 0xA8 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819BF2C + + thumb_func_start sub_819C040 +sub_819C040: @ 819C040 + push {r4-r6,lr} + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0819C0DC + ldr r3, =gSprites + ldr r6, =gUnknown_0300127C + ldr r2, [r6] + ldr r0, =0x00000295 + adds r5, r2, r0 + ldrb r0, [r5] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + adds r1, 0x3F + ldrb r0, [r1] + lsls r0, 26 + cmp r0, 0 + bge _0819C0DC + ldr r1, =0x0000029d + adds r0, r2, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 26 + cmp r0, 0 + bge _0819C0DC + adds r1, r4, 0 + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + ldrb r1, [r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + ldr r0, [r6] + ldr r1, =0x0000029d + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + ldr r0, =sub_819C1D0 + movs r1, 0x1 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r1, [r1] + bl _call_via_r1 + ldr r0, =SpriteCallbackDummy + str r0, [r4, 0x1C] +_0819C0DC: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819C040 + + thumb_func_start sub_819C100 +sub_819C100: @ 819C100 + push {r4-r7,lr} + adds r5, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0819C1BA + ldr r6, =gSprites + ldr r4, =gUnknown_0300127C + ldr r2, [r4] + ldr r7, =0x00000295 + adds r0, r2, r7 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 26 + cmp r0, 0 + bge _0819C1BA + ldr r1, =0x0000029d + adds r0, r2, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 26 + cmp r0, 0 + bge _0819C1BA + ldrb r0, [r5, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl FreeOamMatrix + ldr r0, [r4] + adds r0, r7 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl FreeOamMatrix + ldr r0, [r4] + ldr r1, =0x0000029d + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl FreeOamMatrix + ldr r0, [r4] + movs r1, 0xA8 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r4] + adds r0, r7 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + bl DestroySprite + ldr r0, [r4] + ldr r1, =0x0000029d + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + bl DestroySprite + adds r0, r5, 0 + bl DestroySprite +_0819C1BA: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819C100 + + thumb_func_start sub_819C1D0 +sub_819C1D0: @ 819C1D0 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =gTasks + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0819C24E + cmp r0, 0x1 + bgt _0819C1F8 + cmp r0, 0 + beq _0819C1FE + b _0819C2BA + .pool +_0819C1F8: + cmp r0, 0x2 + beq _0819C270 + b _0819C2BA +_0819C1FE: + movs r0, 0x10 + strh r0, [r4, 0xE] + movs r0, 0xE0 + strh r0, [r4, 0x38] + movs r0, 0x40 + strh r0, [r4, 0x12] + movs r0, 0x41 + strh r0, [r4, 0x18] + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl SetGpuRegBits + ldrh r1, [r4, 0xE] + lsls r1, 8 + ldrh r0, [r4, 0x38] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x40 + bl SetGpuReg + ldrh r1, [r4, 0x12] + lsls r1, 8 + ldrh r0, [r4, 0x18] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0x3F + bl SetGpuReg + movs r0, 0x4A + movs r1, 0x37 + bl SetGpuReg + b _0819C2C6 +_0819C24E: + movs r0, 0x3 + bl ShowBg + ldr r1, =0x00001248 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x0000040b + movs r0, 0x52 + bl SetGpuReg + b _0819C2C6 + .pool +_0819C270: + ldrh r0, [r4, 0x12] + subs r0, 0x4 + strh r0, [r4, 0x12] + ldrh r1, [r4, 0x18] + adds r1, 0x4 + strh r1, [r4, 0x18] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x20 + ble _0819C28C + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x5F + ble _0819C29E +_0819C28C: + movs r0, 0x20 + strh r0, [r4, 0x12] + movs r0, 0x60 + strh r0, [r4, 0x18] + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl ClearGpuRegBits +_0819C29E: + ldrh r1, [r4, 0x12] + lsls r1, 8 + ldrh r0, [r4, 0x18] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl SetGpuReg + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0x20 + bne _0819C2CC + b _0819C2C6 +_0819C2BA: + adds r0, r2, 0 + bl DestroyTask + bl sub_819BF2C + b _0819C2CC +_0819C2C6: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0819C2CC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_819C1D0 + + thumb_func_start sub_819C2D4 +sub_819C2D4: @ 819C2D4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, =gTasks + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0819C2F6 + b _0819C410 +_0819C2F6: + cmp r0, 0x1 + bne _0819C2FC + b _0819C460 +_0819C2FC: + movs r0, 0x3 + bl HideBg + ldr r4, =gSprites + ldr r0, =gUnknown_0300127C + mov r8, r0 + ldr r0, [r0] + ldr r1, =0x00000299 + mov r12, r1 + add r0, r12 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + adds r1, 0x3E + ldrb r2, [r1] + movs r3, 0x5 + negs r3, r3 + adds r0, r3, 0 + ands r0, r2 + strb r0, [r1] + mov r0, r8 + ldr r2, [r0] + mov r1, r12 + adds r0, r2, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r6, r4, 0 + adds r6, 0x1C + adds r0, r6 + ldr r1, =sub_819C100 + str r1, [r0] + ldr r0, =0x00000295 + mov r9, r0 + add r2, r9 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r2, [r0] + adds r1, r3, 0 + ands r1, r2 + strb r1, [r0] + mov r1, r8 + ldr r2, [r1] + mov r1, r9 + adds r0, r2, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldr r1, =SpriteCallbackDummy + mov r10, r1 + str r1, [r0] + ldr r5, =0x0000029d + adds r2, r5 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + ands r3, r1 + strb r3, [r0] + mov r0, r8 + ldr r2, [r0] + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + mov r1, r10 + str r1, [r0] + add r2, r12 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x1 + bl StartSpriteAffineAnim + mov r1, r8 + ldr r0, [r1] + add r0, r9 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x1 + bl StartSpriteAffineAnim + mov r1, r8 + ldr r0, [r1] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x1 + bl StartSpriteAffineAnim + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl ClearGpuRegBits + adds r0, r7, 0 + bl DestroyTask + b _0819C4A4 + .pool +_0819C410: + movs r0, 0x10 + strh r0, [r4, 0xE] + movs r0, 0xE0 + strh r0, [r4, 0x38] + movs r0, 0x20 + strh r0, [r4, 0x12] + movs r0, 0x60 + strh r0, [r4, 0x18] + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl SetGpuRegBits + ldrh r1, [r4, 0xE] + lsls r1, 8 + ldrh r0, [r4, 0x38] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x40 + bl SetGpuReg + ldrh r1, [r4, 0x12] + lsls r1, 8 + ldrh r0, [r4, 0x18] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0x3F + bl SetGpuReg + movs r0, 0x4A + movs r1, 0x37 + bl SetGpuReg + b _0819C49E +_0819C460: + ldrh r0, [r4, 0x12] + adds r0, 0x4 + strh r0, [r4, 0x12] + ldrh r1, [r4, 0x18] + subs r1, 0x4 + strh r1, [r4, 0x18] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3F + bgt _0819C47C + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x41 + bgt _0819C484 +_0819C47C: + movs r0, 0x40 + strh r0, [r4, 0x12] + movs r0, 0x41 + strh r0, [r4, 0x18] +_0819C484: + ldrh r1, [r4, 0x12] + lsls r1, 8 + ldrh r0, [r4, 0x18] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl SetGpuReg + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0x40 + bne _0819C4A4 +_0819C49E: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0819C4A4: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819C2D4 + + thumb_func_start sub_819C4B4 +sub_819C4B4: @ 819C4B4 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r4, =gUnknown_08610638 + adds r0, r4, 0 + movs r1, 0x78 + movs r2, 0x40 + movs r3, 0x1 + bl CreateSprite + ldr r6, =gUnknown_0300127C + ldr r1, [r6] + ldr r2, =0x00000299 + mov r8, r2 + add r1, r8 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x2C + movs r2, 0x40 + movs r3, 0x1 + bl CreateSprite + ldr r1, [r6] + ldr r5, =0x00000295 + adds r1, r5 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0xC4 + movs r2, 0x40 + movs r3, 0x1 + bl CreateSprite + ldr r1, [r6] + ldr r4, =0x0000029d + adds r1, r4 + strb r0, [r1] + ldr r3, =gSprites + ldr r2, [r6] + add r8, r2 + mov r0, r8 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r3, 0x1C + adds r0, r3 + ldr r1, =sub_819C040 + str r1, [r0] + adds r5, r2, r5 + ldrb r1, [r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldr r5, =SpriteCallbackDummy + str r5, [r0] + adds r4, r2, r4 + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + str r5, [r0] + movs r0, 0xA8 + lsls r0, 2 + adds r2, r0 + movs r0, 0x1 + strb r0, [r2] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819C4B4 + + thumb_func_start sub_819C568 +sub_819C568: @ 819C568 + push {r4,lr} + ldr r4, =gUnknown_0300127C + ldr r0, [r4] + movs r1, 0xA5 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + bl sub_818D820 + ldr r0, [r4] + movs r1, 0xA6 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + bl sub_818D820 + ldr r0, [r4] + movs r1, 0xA7 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + bl sub_818D820 + ldr r0, =sub_819C2D4 + movs r1, 0x1 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r1, [r1] + bl _call_via_r1 + ldr r0, [r4] + movs r1, 0xA8 + lsls r1, 2 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819C568 + + thumb_func_start sub_819C5D0 +sub_819C5D0: @ 819C5D0 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r4, r0, 0 + adds r6, r1, 0 + adds r5, r2, 0 + mov r8, r3 + lsls r4, 16 + lsrs r4, 16 + lsls r6, 16 + lsrs r6, 16 + lsls r5, 16 + lsrs r5, 16 + mov r0, r8 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl SetGpuRegBits + lsls r4, 24 + lsrs r4, 16 + orrs r4, r6 + movs r0, 0x40 + adds r1, r4, 0 + bl SetGpuReg + lsls r5, 24 + lsrs r5, 16 + mov r0, r8 + orrs r5, r0 + movs r0, 0x44 + adds r1, r5, 0 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0x3F + bl SetGpuReg + movs r0, 0x4A + movs r1, 0x37 + bl SetGpuReg + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_819C5D0 + + thumb_func_start sub_819C634 +sub_819C634: @ 819C634 + push {r4-r7,lr} + lsls r0, 16 + ldr r2, =gUnknown_0203BC8C + ldr r1, [r2] + lsrs r0, 12 + adds r0, r1 + ldrh r6, [r0] + ldr r0, =gUnknown_0300127C + ldr r0, [r0] + ldrb r5, [r0, 0x5] + movs r3, 0x1 + cmp r3, r5 + bcs _0819C694 + adds r4, r0, 0 + movs r0, 0x6C + mov r12, r0 + adds r7, r2, 0 +_0819C656: + movs r2, 0 +_0819C658: + mov r0, r12 + muls r0, r2 + adds r1, r4, r0 + ldrb r0, [r1, 0x10] + cmp r0, r3 + bne _0819C680 + ldrh r0, [r1, 0xC] + ldr r1, [r7] + lsls r0, 4 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r6 + bne _0819C68A + movs r0, 0 + b _0819C696 + .pool +_0819C680: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x5 + bls _0819C658 +_0819C68A: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r5 + bcc _0819C656 +_0819C694: + movs r0, 0x1 +_0819C696: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_819C634 + + thumb_func_start sub_819C69C +sub_819C69C: @ 819C69C + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r5, r0, r1 + movs r0, 0x8 + ldrsh r2, [r5, r0] + cmp r2, 0x1 + beq _0819C6F8 + cmp r2, 0x1 + bgt _0819C6C4 + cmp r2, 0 + beq _0819C6CA + b _0819C7D8 + .pool +_0819C6C4: + cmp r2, 0x2 + beq _0819C7B4 + b _0819C7D8 +_0819C6CA: + ldr r1, =gUnknown_0300127C + ldr r0, [r1] + ldr r3, =0x000002a7 + adds r0, r3 + strb r2, [r0] + ldr r0, [r1] + adds r3, 0x1 + adds r0, r3 + strb r2, [r0] + ldr r0, [r1] + ldr r1, =0x000002a6 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + strh r1, [r5, 0x8] + b _0819C7D8 + .pool +_0819C6F8: + ldr r0, =gUnknown_0300127C + ldr r3, [r0] + ldr r2, =0x000002a2 + adds r1, r3, r2 + ldrb r1, [r1] + adds r7, r0, 0 + cmp r1, 0 + beq _0819C7D8 + ldr r1, =0x000002a9 + adds r0, r3, r1 + ldrb r4, [r0] + cmp r4, 0 + beq _0819C724 + movs r0, 0x2 + strh r0, [r5, 0x8] + b _0819C7D8 + .pool +_0819C724: + ldr r2, =0x000002a7 + adds r1, r3, r2 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r7] + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0x6 + bls _0819C764 + strb r4, [r1] + ldr r1, [r7] + subs r2, 0x1 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _0819C758 + movs r3, 0xAA + lsls r3, 2 + adds r1, r3 + ldrb r0, [r1] + subs r0, 0x1 + b _0819C762 + .pool +_0819C758: + movs r0, 0xAA + lsls r0, 2 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 +_0819C762: + strb r0, [r1] +_0819C764: + movs r0, 0x80 + lsls r0, 7 + ldr r1, [r7] + movs r4, 0xAA + lsls r4, 2 + adds r1, r4 + ldrb r1, [r1] + movs r2, 0 + bl BlendPalettes + ldr r2, [r7] + adds r4, r2, r4 + ldrb r0, [r4] + cmp r0, 0x5 + bls _0819C790 + ldr r3, =0x000002a6 + adds r1, r2, r3 + movs r0, 0 + b _0819C7D6 + .pool +_0819C790: + cmp r0, 0 + bne _0819C7D8 + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + movs r1, 0x2 + strh r1, [r0, 0x8] + ldr r0, =0x000002a6 + adds r1, r2, r0 + movs r0, 0x1 + b _0819C7D6 + .pool +_0819C7B4: + ldr r0, =gUnknown_0300127C + ldr r0, [r0] + ldr r2, =0x000002a9 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xE + bls _0819C7D4 + movs r0, 0 + strb r0, [r1] + movs r0, 0x1 + strh r0, [r5, 0x8] + b _0819C7D8 + .pool +_0819C7D4: + adds r0, 0x1 +_0819C7D6: + strb r0, [r1] +_0819C7D8: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819C69C + + thumb_func_start sub_819C7E0 +sub_819C7E0: @ 819C7E0 + push {lr} + bl AnimateSprites + bl BuildOamBuffer + bl RunTextPrinters + bl UpdatePaletteFade + bl RunTasks + pop {r0} + bx r0 + thumb_func_end sub_819C7E0 + + thumb_func_start sub_819C7FC +sub_819C7FC: @ 819C7FC + push {lr} + bl LoadOam + bl ProcessSpriteCopyRequests + bl TransferPlttBuffer + pop {r0} + bx r0 + thumb_func_end sub_819C7FC + + thumb_func_start sub_819C810 +sub_819C810: @ 819C810 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + ldr r4, =gPlayerParty + ldr r5, =gUnknown_03001284 + ldr r1, [r5] + ldrb r0, [r1, 0x12] + movs r6, 0x64 + muls r0, r6 + adds r0, r4 + ldr r2, =gEnemyParty + mov r9, r2 + ldrb r1, [r1, 0x13] + muls r1, r6 + add r1, r9 + movs r2, 0x64 + bl memcpy + movs r1, 0 + mov r0, sp + strb r1, [r0] + ldr r0, [r5] + ldrb r0, [r0, 0x12] + muls r0, r6 + adds r0, r4 + movs r1, 0x20 + mov r2, sp + bl SetMonData + ldr r3, =gSaveBlock2Ptr + mov r8, r3 + ldr r3, [r3] + ldr r4, [r5] + ldrb r0, [r4, 0x12] + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 2 + adds r2, r3, r2 + ldrb r1, [r4, 0x13] + adds r1, 0x3 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r3, r0 + movs r1, 0xE7 + lsls r1, 4 + adds r0, r1 + ldrh r0, [r0] + adds r2, r1 + strh r0, [r2] + ldrb r0, [r4, 0x12] + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 2 + adds r2, r3, r2 + ldrb r1, [r4, 0x13] + adds r1, 0x3 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r3, r0 + ldr r0, =0x00000e78 + adds r3, r0 + ldrb r1, [r3] + adds r2, r0 + strb r1, [r2] + ldr r0, [r5] + ldrb r0, [r0, 0x13] + muls r0, r6 + add r0, r9 + movs r1, 0 + movs r2, 0 + bl GetMonData + mov r1, r8 + ldr r2, [r1] + ldr r4, [r5] + ldrb r3, [r4, 0x12] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 2 + ldr r3, =0x00000e74 + adds r2, r3 + adds r2, r1 + str r0, [r2] + ldrb r0, [r4, 0x13] + muls r0, r6 + add r0, r9 + movs r1, 0x2E + movs r2, 0 + bl pokemon_getattr_encrypted + mov r1, r8 + ldr r2, [r1] + ldr r1, [r5] + ldrb r3, [r1, 0x12] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 2 + adds r2, r1 + ldr r3, =0x00000e79 + adds r2, r3 + strb r0, [r2] + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819C810 + + thumb_func_start sub_819C90C +sub_819C90C: @ 819C90C + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =gTasks + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r6, r0, r1 + movs r1, 0x8 + ldrsh r0, [r6, r1] + cmp r0, 0x7 + beq _0819C950 + cmp r0, 0x7 + bgt _0819C934 + cmp r0, 0x6 + beq _0819C93A + b _0819C9F0 + .pool +_0819C934: + cmp r0, 0x8 + beq _0819C9C4 + b _0819C9F0 +_0819C93A: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + movs r0, 0x7 + strh r0, [r6, 0x8] + b _0819C9F0 +_0819C950: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _0819C9F0 + ldr r4, =gUnknown_03001284 + ldr r0, [r4] + adds r0, 0x21 + ldrb r0, [r0] + bl DestroyTask + ldr r1, [r4] + ldr r0, [r1, 0x2C] + adds r1, 0x30 + bl sub_819F444 + bl sub_819E538 + ldr r4, =gUnknown_0203CE40 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203CE44 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203CE48 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203CE4C + ldr r0, [r4] + bl Free + str r5, [r4] + bl FreeAllWindowBuffers + movs r0, 0x8 + strh r0, [r6, 0x8] + b _0819C9F0 + .pool +_0819C9C4: + adds r0, r2, 0 + bl DestroyTask + ldr r2, =gUnknown_03001284 + ldr r1, [r2] + movs r0, 0x1 + strb r0, [r1, 0x15] + ldr r2, [r2] + ldr r0, =gPlttBufferUnfaded + movs r1, 0xF4 + lsls r1, 1 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2, 0x24] + ldr r1, =gPlayerParty + ldrb r2, [r2, 0x3] + ldr r0, =sub_819DC1C + str r0, [sp] + movs r0, 0 + movs r3, 0x2 + bl sub_81BF8EC +_0819C9F0: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819C90C + + thumb_func_start sub_819CA08 +sub_819CA08: @ 819CA08 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r7, =gUnknown_03001284 + ldr r2, [r7] + adds r0, r2, 0 + adds r0, 0x30 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0819CAFE + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r1, [r4, r0] + cmp r1, 0x1 + beq _0819CA78 + cmp r1, 0x1 + bgt _0819CA44 + cmp r1, 0 + beq _0819CA4E + b _0819CAFE + .pool +_0819CA44: + cmp r1, 0x2 + beq _0819CA8C + cmp r1, 0x3 + beq _0819CAA4 + b _0819CAFE +_0819CA4E: + adds r0, r2, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0819CA68 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + ldr r0, =gScriptResult + strh r1, [r0] + b _0819CAFE + .pool +_0819CA68: + movs r0, 0x2 + strh r0, [r4, 0x8] + ldr r1, =gScriptResult + movs r0, 0x1 + strh r0, [r1] + b _0819CAFE + .pool +_0819CA78: + adds r0, r2, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0819CA9C + ldrb r0, [r2, 0x3] + strb r0, [r2, 0x13] + bl sub_819C810 + b _0819CA9C +_0819CA8C: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade +_0819CA9C: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0819CAFE +_0819CAA4: + bl UpdatePaletteFade + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _0819CAFE + ldr r0, [r7] + adds r0, 0x21 + ldrb r0, [r0] + bl DestroyTask + bl sub_819E538 + ldr r4, =gUnknown_0203CE40 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203CE44 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203CE48 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =gUnknown_0203CE4C + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r0, [r7] + bl Free + str r5, [r7] + bl FreeAllWindowBuffers + ldr r0, =sub_80861B0 + bl SetMainCallback2 + adds r0, r6, 0 + bl DestroyTask +_0819CAFE: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819CA08 + + thumb_func_start sub_819CB1C +sub_819CB1C: @ 819CB1C + push {r4-r7,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r7, =gUnknown_03001284 + ldr r0, [r7] + adds r0, 0x30 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0819CBD6 + ldr r1, =gTasks + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x4 + beq _0819CB50 + cmp r0, 0x5 + beq _0819CB5A + b _0819CBD6 + .pool +_0819CB50: + bl sub_819E9E0 + movs r0, 0x5 + strh r0, [r4, 0x8] + b _0819CBD6 +_0819CB5A: + ldr r2, =gMain + ldrh r1, [r2, 0x2E] + movs r6, 0x1 + adds r5, r6, 0 + ands r5, r1 + cmp r5, 0 + beq _0819CB86 + movs r0, 0x5 + bl PlaySE + ldr r0, [r7] + ldrb r0, [r0, 0x16] + cmp r0, 0 + bne _0819CB80 + strh r6, [r4, 0xA] + b _0819CB9C + .pool +_0819CB80: + movs r0, 0 + strh r0, [r4, 0xA] + b _0819CB96 +_0819CB86: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0819CBA8 + movs r0, 0x5 + bl PlaySE + strh r5, [r4, 0xA] +_0819CB96: + movs r0, 0x4 + bl sub_819EA64 +_0819CB9C: + ldrh r0, [r4, 0x14] + ldrh r1, [r4, 0x16] + lsls r0, 16 + orrs r0, r1 + str r0, [r4] + b _0819CBD6 +_0819CBA8: + ldrh r1, [r2, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0819CBC2 + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + negs r0, r0 + bl sub_819E758 + b _0819CBD6 +_0819CBC2: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0819CBD6 + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + bl sub_819E758 +_0819CBD6: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819CB1C + + thumb_func_start sub_819CBDC +sub_819CBDC: @ 819CBDC + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r2, r1, r2 + movs r1, 0xA + ldrsh r0, [r2, r1] + cmp r0, 0x1 + bne _0819CC04 + movs r0, 0 + strh r0, [r2, 0x8] + ldr r0, =sub_819CA08 + b _0819CC16 + .pool +_0819CC04: + movs r0, 0 + strh r0, [r2, 0x8] + ldr r1, =sub_819CE40 + lsrs r0, r1, 16 + strh r0, [r2, 0x14] + strh r1, [r2, 0x16] + movs r0, 0x1 + strh r0, [r2, 0x12] + ldr r0, =sub_819D770 +_0819CC16: + str r0, [r2] + pop {r0} + bx r0 + .pool + thumb_func_end sub_819CBDC + + thumb_func_start sub_819CC24 +sub_819CC24: @ 819CC24 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + movs r0, 0x8 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _0819CC5A + ldr r0, =gUnknown_085EECBB + bl sub_819EBEC + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r0, 0x20 + strb r5, [r0] + movs r0, 0x4 + strh r0, [r4, 0x8] + ldr r1, =sub_819CBDC + lsrs r0, r1, 16 + strh r0, [r4, 0x14] + strh r1, [r4, 0x16] + ldr r0, =sub_819CB1C + str r0, [r4] +_0819CC5A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819CC24 + + thumb_func_start sub_819CC74 +sub_819CC74: @ 819CC74 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldr r0, [r1, 0x2C] + adds r1, 0x30 + movs r2, 0x1 + bl sub_819F3F8 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r1 + movs r1, 0xA + ldrsh r0, [r2, r1] + cmp r0, 0x1 + bne _0819CCB0 + movs r0, 0 + strh r0, [r2, 0x8] + ldr r0, =sub_819CA08 + b _0819CCC2 + .pool +_0819CCB0: + movs r0, 0 + strh r0, [r2, 0x8] + ldr r1, =sub_819CE40 + lsrs r0, r1, 16 + strh r0, [r2, 0x14] + strh r1, [r2, 0x16] + movs r0, 0x1 + strh r0, [r2, 0x12] + ldr r0, =sub_819D770 +_0819CCC2: + str r0, [r2] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819CC74 + + thumb_func_start sub_819CCD4 +sub_819CCD4: @ 819CCD4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r5, r1, r2 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0819CD1A + ldr r4, =gUnknown_03001284 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x2D + adds r1, 0x30 + movs r2, 0x1 + bl sub_819F2B4 + ldr r0, =gUnknown_085EECF0 + bl sub_819EBEC + ldr r0, [r4] + adds r0, 0x20 + movs r1, 0x1 + strb r1, [r0] + movs r0, 0x4 + strh r0, [r5, 0x8] + ldr r1, =sub_819CC74 + lsrs r0, r1, 16 + strh r0, [r5, 0x14] + strh r1, [r5, 0x16] + ldr r0, =sub_819CB1C + str r0, [r5] +_0819CD1A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819CCD4 + + thumb_func_start sub_819CD34 +sub_819CD34: @ 819CD34 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r5, r0, r1 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x3 + beq _0819CDA4 + cmp r0, 0x3 + bgt _0819CD60 + cmp r0, 0x2 + beq _0819CD66 + b _0819CE36 + .pool +_0819CD60: + cmp r0, 0x9 + beq _0819CD88 + b _0819CE36 +_0819CD66: + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldrb r0, [r1, 0x15] + cmp r0, 0 + bne _0819CD7C + adds r0, r1, 0 + adds r0, 0x2D + adds r1, 0x30 + movs r2, 0x1 + bl sub_819F2B4 +_0819CD7C: + movs r0, 0x9 + strh r0, [r5, 0x8] + b _0819CE36 + .pool +_0819CD88: + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r0, 0x30 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0819CE36 + bl sub_819E944 + movs r0, 0x3 + strh r0, [r5, 0x8] + b _0819CE36 + .pool +_0819CDA4: + ldr r7, =gUnknown_03001284 + ldr r0, [r7] + adds r0, 0x30 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0819CE36 + ldr r2, =gMain + ldrh r1, [r2, 0x2E] + movs r0, 0x1 + mov r8, r0 + mov r4, r8 + ands r4, r1 + cmp r4, 0 + beq _0819CDD8 + movs r0, 0x5 + bl PlaySE + adds r0, r6, 0 + bl sub_819F0A0 + b _0819CE36 + .pool +_0819CDD8: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0819CE14 + movs r0, 0x5 + bl PlaySE + ldr r1, [r7] + ldr r0, [r1, 0x2C] + adds r1, 0x30 + movs r2, 0x1 + bl sub_819F3F8 + movs r0, 0x3 + bl sub_819EA64 + strh r4, [r5, 0x8] + ldr r1, =sub_819CE40 + lsrs r0, r1, 16 + strh r0, [r5, 0x14] + strh r1, [r5, 0x16] + mov r1, r8 + strh r1, [r5, 0x12] + ldr r0, =sub_819D770 + str r0, [r5] + b _0819CE36 + .pool +_0819CE14: + ldrh r1, [r2, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0819CE28 + movs r0, 0x1 + negs r0, r0 + bl sub_819E7C0 + b _0819CE36 +_0819CE28: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0819CE36 + movs r0, 0x1 + bl sub_819E7C0 +_0819CE36: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819CD34 + + thumb_func_start sub_819CE40 +sub_819CE40: @ 819CE40 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0819CE64 + cmp r0, 0x1 + beq _0819CE88 + b _0819CF4C + .pool +_0819CE64: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0819CF4C + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r0, 0x22 + movs r1, 0x1 + strb r1, [r0] + strh r1, [r4, 0x8] + b _0819CF4C + .pool +_0819CE88: + ldr r2, =gMain + ldrh r1, [r2, 0x2E] + adds r5, r1, 0 + ands r5, r0 + cmp r5, 0 + beq _0819CEBC + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r0, 0x22 + movs r1, 0 + strb r1, [r0] + bl sub_819EE08 + bl sub_819EAC0 + adds r0, r6, 0 + bl sub_819F184 + b _0819CF4C + .pool +_0819CEBC: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0819CEF8 + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r0, 0x22 + strb r5, [r0] + bl sub_819EE08 + bl sub_819EAC0 + ldr r1, =sub_819CC24 + lsrs r0, r1, 16 + strh r0, [r4, 0x14] + strh r1, [r4, 0x16] + strh r5, [r4, 0x8] + strh r5, [r4, 0x12] + ldr r0, =sub_819D588 + str r0, [r4] + b _0819CF4C + .pool +_0819CEF8: + ldrh r1, [r2, 0x30] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0819CF0C + movs r0, 0x1 + negs r0, r0 + bl sub_819E694 + b _0819CF2A +_0819CF0C: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0819CF1C + movs r0, 0x1 + bl sub_819E694 + b _0819CF2A +_0819CF1C: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0819CF34 + movs r0, 0x1 + bl sub_819E6E8 +_0819CF2A: + bl sub_819EFA8 + bl sub_819EB4C + b _0819CF4C +_0819CF34: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0819CF4C + movs r0, 0x1 + negs r0, r0 + bl sub_819E6E8 + bl sub_819EFA8 + bl sub_819EB4C +_0819CF4C: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_819CE40 + + thumb_func_start sub_819CF54 +sub_819CF54: @ 819CF54 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r2, [r4, r0] + cmp r2, 0x1 + beq _0819CFA0 + cmp r2, 0x1 + bgt _0819CF7C + cmp r2, 0 + beq _0819CF82 + b _0819D05C + .pool +_0819CF7C: + cmp r2, 0x2 + beq _0819D03C + b _0819D05C +_0819CF82: + ldr r1, =gUnknown_03001284 + ldr r0, [r1] + adds r0, 0x27 + strb r2, [r0] + ldr r0, [r1] + adds r0, 0x28 + strb r2, [r0] + ldr r0, [r1] + adds r0, 0x26 + movs r1, 0x1 + strb r1, [r0] + strh r1, [r4, 0x8] + b _0819D05C + .pool +_0819CFA0: + ldr r1, =gUnknown_03001284 + ldr r2, [r1] + adds r0, r2, 0 + adds r0, 0x22 + ldrb r0, [r0] + adds r6, r1, 0 + cmp r0, 0 + beq _0819D05C + adds r0, r2, 0 + adds r0, 0x29 + ldrb r3, [r0] + cmp r3, 0 + beq _0819CFC4 + movs r0, 0x2 + strh r0, [r4, 0x8] + b _0819D05C + .pool +_0819CFC4: + adds r1, r2, 0 + adds r1, 0x27 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r6] + adds r1, r0, 0 + adds r1, 0x27 + ldrb r0, [r1] + cmp r0, 0x6 + bls _0819CFF8 + strb r3, [r1] + ldr r1, [r6] + adds r0, r1, 0 + adds r0, 0x26 + ldrb r0, [r0] + cmp r0, 0 + bne _0819CFF0 + adds r1, 0x28 + ldrb r0, [r1] + subs r0, 0x1 + b _0819CFF6 +_0819CFF0: + adds r1, 0x28 + ldrb r0, [r1] + adds r0, 0x1 +_0819CFF6: + strb r0, [r1] +_0819CFF8: + movs r0, 0x80 + lsls r0, 7 + ldr r1, [r6] + adds r1, 0x28 + ldrb r1, [r1] + movs r2, 0 + bl BlendPalettes + ldr r2, [r6] + adds r0, r2, 0 + adds r0, 0x28 + ldrb r0, [r0] + cmp r0, 0x5 + bls _0819D01C + adds r1, r2, 0 + adds r1, 0x26 + movs r0, 0 + b _0819D05A +_0819D01C: + cmp r0, 0 + bne _0819D05C + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x2 + strh r1, [r0, 0x8] + adds r1, r2, 0 + adds r1, 0x26 + movs r0, 0x1 + b _0819D05A + .pool +_0819D03C: + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0x29 + ldrb r0, [r1] + cmp r0, 0xE + bls _0819D058 + movs r0, 0 + strb r0, [r1] + movs r0, 0x1 + strh r0, [r4, 0x8] + b _0819D05C + .pool +_0819D058: + adds r0, 0x1 +_0819D05A: + strb r0, [r1] +_0819D05C: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_819CF54 + + thumb_func_start sub_819D064 +sub_819D064: @ 819D064 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + movs r0, 0x8 + ldrsh r1, [r4, r0] + cmp r1, 0x1 + beq _0819D0A4 + cmp r1, 0x1 + bgt _0819D08C + cmp r1, 0 + beq _0819D092 + b _0819D118 + .pool +_0819D08C: + cmp r1, 0x2 + beq _0819D0BC + b _0819D118 +_0819D092: + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r0, 0x27 + strb r1, [r0] + strh r1, [r4, 0x10] + b _0819D0AE + .pool +_0819D0A4: + ldr r0, =gPlttBufferUnfaded+ 0x1E0 + movs r1, 0xE0 + movs r2, 0xA + bl LoadPalette +_0819D0AE: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0819D118 + .pool +_0819D0BC: + ldr r2, =gUnknown_03001284 + ldr r0, [r2] + adds r0, 0x28 + ldrb r0, [r0] + cmp r0, 0xF + bls _0819D0D2 + movs r0, 0x1 + strh r0, [r4, 0x10] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0819D0D2: + ldr r1, [r2] + adds r1, 0x27 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r2] + adds r1, r0, 0 + adds r1, 0x27 + ldrb r0, [r1] + cmp r0, 0x3 + bls _0819D108 + movs r0, 0 + strb r0, [r1] + ldr r1, =gPlttBufferUnfaded + ldr r0, =gPlttBufferFaded + movs r3, 0xE4 + lsls r3, 1 + adds r0, r3 + ldrh r0, [r0] + adds r3, 0x20 + adds r1, r3 + strh r0, [r1] + ldr r1, [r2] + adds r1, 0x28 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_0819D108: + movs r0, 0x80 + lsls r0, 7 + ldr r1, [r2] + adds r1, 0x28 + ldrb r1, [r1] + movs r2, 0 + bl BlendPalettes +_0819D118: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819D064 + + thumb_func_start sub_819D12C +sub_819D12C: @ 819D12C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + ldr r1, =gTasks + lsls r0, 2 + ldr r2, [sp] + adds r0, r2 + lsls r0, 3 + adds r4, r0, r1 + movs r2, 0x8 + ldrsh r3, [r4, r2] + cmp r3, 0 + beq _0819D15C + cmp r3, 0x1 + beq _0819D168 + b _0819D310 + .pool +_0819D15C: + strh r3, [r4, 0xA] + strh r3, [r4, 0xC] + strh r3, [r4, 0xE] + movs r0, 0x1 + strh r0, [r4, 0x8] + b _0819D310 +_0819D168: + movs r3, 0 + str r3, [sp, 0x4] + movs r1, 0x2 + str r0, [sp, 0x8] + ldr r0, =gTasks + str r0, [sp, 0xC] +_0819D174: + lsls r0, r1, 24 + asrs r4, r0, 24 + mov r9, r0 + cmp r4, 0x2 + beq _0819D1F2 + ldr r2, =gSprites + ldr r3, =gUnknown_03001284 + ldr r0, [r3] + adds r0, 0x5 + mov r8, r0 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r6, r0, r2 + ldrh r1, [r6, 0x20] + mov r12, r1 + mov r7, r12 + ldr r1, [sp, 0x4] + subs r0, r1, r7 + lsls r0, 24 + lsrs r5, r0, 24 + mov r10, r2 + cmp r5, 0x10 + beq _0819D1BE + adds r0, r4, 0x2 + lsls r0, 1 + ldr r2, [sp, 0x8] + adds r0, r2 + ldr r1, =gTasks + adds r1, 0x8 + adds r0, r1 + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r0, 0x1 + bne _0819D1D8 +_0819D1BE: + lsls r0, r7, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + mov r0, r12 + adds r0, 0xA + strh r0, [r6, 0x20] + b _0819D210 + .pool +_0819D1D8: + cmp r5, 0x10 + bls _0819D210 + adds r0, r4, 0x1 + add r0, r8 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r10 + ldrh r0, [r0, 0x20] + subs r0, 0x30 + strh r0, [r6, 0x20] + b _0819D210 +_0819D1F2: + ldr r3, =gSprites + ldr r4, =gUnknown_03001284 + ldr r0, [r4] + ldrb r1, [r0, 0x7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r2, [r0, 0x20] + lsls r1, r2, 24 + lsrs r1, 24 + str r1, [sp, 0x4] + adds r2, 0xA + strh r2, [r0, 0x20] + mov r10, r3 +_0819D210: + mov r0, r9 + asrs r2, r0, 24 + adds r0, r2, 0x1 + lsls r0, 1 + ldr r1, [sp, 0x8] + adds r0, r1 + ldr r1, =gTasks + adds r1, 0x8 + adds r0, r1 + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r0, 0x1 + bne _0819D26A + ldr r1, =gUnknown_03001284 + ldr r0, [r1] + adds r0, 0x5 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + mov r3, r10 + adds r1, r0, r3 + movs r0, 0x20 + ldrsh r3, [r1, r0] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 4 + adds r0, 0x48 + cmp r3, r0 + ble _0819D260 + strh r0, [r1, 0x20] + movs r7, 0x1 + b _0819D26C + .pool +_0819D260: + movs r7, 0 + cmp r3, r0 + bne _0819D26C + movs r7, 0x1 + b _0819D26C +_0819D26A: + movs r7, 0 +_0819D26C: + mov r6, r10 + ldr r5, =gUnknown_03001284 + ldr r2, [r5] + mov r1, r9 + asrs r4, r1, 24 + adds r0, r2, 0x5 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r6 + movs r3, 0x20 + ldrsh r0, [r1, r3] + subs r0, 0x10 + cmp r0, 0xF0 + ble _0819D2F8 + ldrh r0, [r1, 0x20] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + ldr r0, =0x0000fff0 + strh r0, [r1, 0x20] + ldrb r0, [r2, 0x14] + cmp r0, 0x1 + bne _0819D2C0 + movs r0, 0x65 + bl IndexOfSpritePaletteTag + ldr r1, [r5] + adds r1, 0x5 + adds r1, r4 + ldrb r1, [r1] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + adds r2, r6 + b _0819D2D8 + .pool +_0819D2C0: + movs r0, 0x64 + bl IndexOfSpritePaletteTag + ldr r2, =gUnknown_03001284 + ldr r1, [r2] + adds r1, 0x5 + adds r1, r4 + ldrb r1, [r1] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + add r2, r10 +_0819D2D8: + lsls r0, 4 + ldrb r3, [r2, 0x5] + movs r1, 0xF + ands r1, r3 + orrs r1, r0 + strb r1, [r2, 0x5] + mov r3, r9 + asrs r0, r3, 23 + adds r0, 0x2 + ldr r1, [sp, 0x8] + adds r0, r1 + ldr r2, [sp, 0xC] + adds r2, 0x8 + adds r0, r2 + movs r1, 0x1 + strh r1, [r0] +_0819D2F8: + movs r0, 0xFF + lsls r0, 24 + add r0, r9 + lsrs r1, r0, 24 + cmp r0, 0 + blt _0819D306 + b _0819D174 +_0819D306: + cmp r7, 0x1 + bne _0819D310 + ldr r0, [sp] + bl DestroyTask +_0819D310: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819D12C + + thumb_func_start sub_819D324 +sub_819D324: @ 819D324 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r7, r0, 24 + movs r0, 0 + mov r8, r0 + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r2, r0, r1 + ldrb r4, [r2, 0xE] + movs r0, 0xC + ldrsh r5, [r2, r0] + mov r10, r1 + cmp r5, 0x1 + bne _0819D352 + lsls r0, r4, 24 + negs r0, r0 + lsrs r4, r0, 24 +_0819D352: + movs r1, 0x8 + ldrsh r0, [r2, r1] + cmp r0, 0 + beq _0819D368 + cmp r0, 0x1 + bne _0819D360 + b _0819D480 +_0819D360: + b _0819D570 + .pool +_0819D368: + ldr r3, =gSprites + ldr r2, =gUnknown_03001284 + ldr r0, [r2] + ldrb r1, [r0, 0x8] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r0, [r0, 0x20] + cmp r5, 0 + bne _0819D39C + lsls r0, 16 + asrs r0, 16 + lsls r2, r4, 24 + asrs r1, r2, 24 + adds r0, r1 + movs r1, 0x1 + cmp r0, 0xEF + ble _0819D3B2 + movs r1, 0 + movs r0, 0xF0 + b _0819D3B0 + .pool +_0819D39C: + lsls r0, 16 + asrs r0, 16 + lsls r2, r4, 24 + asrs r1, r2, 24 + adds r0, r1 + movs r1, 0x1 + cmp r0, 0xA0 + bgt _0819D3B2 + movs r1, 0 + movs r0, 0xA0 +_0819D3B0: + mov r8, r0 +_0819D3B2: + cmp r1, 0x1 + bne _0819D3FC + movs r3, 0 + ldr r7, =gSprites + ldr r6, =gUnknown_03001284 + asrs r5, r2, 24 +_0819D3BE: + movs r4, 0 + adds r2, r3, 0x1 +_0819D3C2: + ldr r1, [r6] + lsls r0, r4, 1 + adds r0, r4 + adds r0, r3, r0 + adds r1, 0x8 + adds r1, r0 + ldrb r1, [r1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, r5 + strh r1, [r0, 0x20] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _0819D3C2 + lsls r0, r2, 24 + lsrs r3, r0, 24 + cmp r3, 0x2 + bls _0819D3BE + b _0819D570 + .pool +_0819D3FC: + movs r4, 0 + lsls r1, r7, 2 + mov r12, r1 + mov r6, r8 + adds r6, 0x10 + movs r0, 0x30 + add r0, r8 + mov r9, r0 + ldr r5, =gSprites +_0819D40E: + ldr r1, =gUnknown_03001284 + ldr r2, [r1] + lsls r3, r4, 1 + adds r3, r4 + adds r0, r2, 0 + adds r0, 0x8 + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + mov r1, r8 + strh r1, [r0, 0x20] + adds r0, r2, 0 + adds r0, 0x9 + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r6, [r0, 0x20] + adds r2, 0xA + adds r2, r3 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + mov r1, r9 + strh r1, [r0, 0x20] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _0819D40E + mov r1, r12 + adds r0, r1, r7 + lsls r0, 3 + add r0, r10 + ldrb r1, [r0, 0xA] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + add r0, r10 + movs r1, 0x1 + strh r1, [r0, 0xE] + adds r0, r7, 0 + bl DestroyTask + b _0819D570 + .pool +_0819D480: + ldr r2, =gSprites + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + ldrb r1, [r0, 0xE] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x20] + cmp r5, 0 + bne _0819D4B4 + lsls r0, 16 + asrs r0, 16 + lsls r2, r4, 24 + asrs r1, r2, 24 + adds r0, r1 + movs r1, 0x1 + cmp r0, 0xEF + ble _0819D4CA + movs r1, 0 + movs r0, 0xF0 + b _0819D4C8 + .pool +_0819D4B4: + lsls r0, 16 + asrs r0, 16 + lsls r2, r4, 24 + asrs r1, r2, 24 + adds r0, r1 + movs r1, 0x1 + cmp r0, 0xC0 + bgt _0819D4CA + movs r1, 0 + movs r0, 0xC0 +_0819D4C8: + mov r8, r0 +_0819D4CA: + cmp r1, 0x1 + bne _0819D510 + movs r3, 0 + ldr r7, =gSprites + ldr r6, =gUnknown_03001284 + asrs r5, r2, 24 +_0819D4D6: + movs r4, 0 + adds r2, r3, 0x1 +_0819D4DA: + ldr r0, [r6] + lsls r1, r4, 1 + adds r1, r3, r1 + adds r0, 0xE + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrh r1, [r0, 0x20] + adds r1, r5 + strh r1, [r0, 0x20] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _0819D4DA + lsls r0, r2, 24 + lsrs r3, r0, 24 + cmp r3, 0x1 + bls _0819D4D6 + b _0819D570 + .pool +_0819D510: + movs r4, 0 + lsls r1, r7, 2 + mov r12, r1 + mov r6, r8 + adds r6, 0x10 + ldr r5, =gSprites + ldr r0, =gUnknown_03001284 + mov r9, r0 +_0819D520: + mov r1, r9 + ldr r2, [r1] + lsls r3, r4, 1 + adds r0, r2, 0 + adds r0, 0xE + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + mov r1, r8 + strh r1, [r0, 0x20] + adds r2, 0xF + adds r2, r3 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r6, [r0, 0x20] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _0819D520 + mov r1, r12 + adds r0, r1, r7 + lsls r0, 3 + add r0, r10 + ldrb r1, [r0, 0xA] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + add r0, r10 + movs r1, 0x1 + strh r1, [r0, 0x10] + adds r0, r7, 0 + bl DestroyTask +_0819D570: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819D324 + + thumb_func_start sub_819D588 +sub_819D588: @ 819D588 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r2, 0x8 + ldrsh r0, [r0, r2] + mov r8, r1 + cmp r0, 0x5 + bls _0819D5AA + b _0819D762 +_0819D5AA: + lsls r0, 2 + ldr r1, =_0819D5BC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0819D5BC: + .4byte _0819D5D4 + .4byte _0819D5F0 + .4byte _0819D60C + .4byte _0819D63C + .4byte _0819D6F0 + .4byte _0819D73A +_0819D5D4: + ldr r0, =gUnknown_08610918 + movs r1, 0xE0 + movs r2, 0xA + bl LoadPalette + bl sub_819ED34 + movs r0, 0x5 + bl PutWindowTilemap + b _0819D622 + .pool +_0819D5F0: + movs r0, 0x3 + bl sub_819EA64 + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0819D762 + .pool +_0819D60C: + movs r0, 0x80 + lsls r0, 7 + ldr r1, =gUnknown_0860F13C + adds r1, 0x4A + ldrh r1, [r1] + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade +_0819D622: + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + b _0819D762 + .pool +_0819D63C: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + beq _0819D64E + b _0819D762 +_0819D64E: + movs r0, 0x5 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x5 + movs r1, 0x2 + bl CopyWindowToVram + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + ldrb r0, [r0, 0x14] + cmp r0, 0x1 + bne _0819D6B0 + ldr r0, =sub_819D324 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gTasks + lsls r2, r5, 2 + adds r2, r5 + lsls r2, 3 + adds r2, r1 + strh r6, [r2, 0xE] + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + strh r5, [r0, 0xA] + strh r6, [r0, 0x8] + strh r6, [r0, 0xC] + movs r1, 0x6 + strh r1, [r0, 0xE] + movs r0, 0x5 + strh r0, [r2, 0xC] + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] + b _0819D762 + .pool +_0819D6B0: + ldr r0, =sub_819D324 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r4, r0, 24 + ldr r3, =gTasks + lsls r2, r5, 2 + adds r2, r5 + lsls r2, 3 + adds r2, r3 + movs r1, 0x1 + strh r1, [r2, 0xE] + strh r6, [r2, 0x10] + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r3 + strh r5, [r0, 0xA] + strh r1, [r0, 0x8] + strh r6, [r0, 0xC] + movs r1, 0x6 + strh r1, [r0, 0xE] + ldrh r0, [r2, 0x8] + adds r0, 0x2 + strh r0, [r2, 0x8] + b _0819D762 + .pool +_0819D6F0: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + mov r1, r8 + adds r6, r0, r1 + ldrh r0, [r6, 0xC] + movs r2, 0xC + ldrsh r7, [r6, r2] + cmp r7, 0 + bne _0819D734 + ldr r0, =sub_819D324 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r4, r0, 24 + strh r7, [r6, 0x10] + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + add r0, r8 + strh r5, [r0, 0xA] + movs r1, 0x1 + strh r1, [r0, 0x8] + strh r7, [r0, 0xC] + movs r1, 0x6 + strh r1, [r0, 0xE] + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] + b _0819D762 + .pool +_0819D734: + subs r0, 0x1 + strh r0, [r6, 0xC] + b _0819D762 +_0819D73A: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + mov r1, r8 + adds r2, r0, r1 + movs r1, 0xE + ldrsh r0, [r2, r1] + cmp r0, 0x1 + bne _0819D762 + movs r1, 0x10 + ldrsh r0, [r2, r1] + cmp r0, 0x1 + bne _0819D762 + ldrh r0, [r2, 0x12] + strh r0, [r2, 0x8] + ldrh r0, [r2, 0x14] + ldrh r1, [r2, 0x16] + lsls r0, 16 + orrs r0, r1 + str r0, [r2] +_0819D762: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819D588 + + thumb_func_start sub_819D770 +sub_819D770: @ 819D770 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =gUnknown_03001284 + ldr r0, [r1] + adds r0, 0x30 + ldrb r0, [r0] + adds r3, r1, 0 + cmp r0, 0x1 + bne _0819D78C + b _0819D9D8 +_0819D78C: + ldr r0, =gTasks + lsls r2, r6, 2 + adds r1, r2, r6 + lsls r1, 3 + adds r1, r0 + movs r4, 0x8 + ldrsh r1, [r1, r4] + mov r8, r0 + adds r5, r2, 0 + cmp r1, 0x8 + bls _0819D7A4 + b _0819D9D8 +_0819D7A4: + lsls r0, r1, 2 + ldr r1, =_0819D7BC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0819D7BC: + .4byte _0819D7E0 + .4byte _0819D868 + .4byte _0819D8AE + .4byte _0819D8F4 + .4byte _0819D910 + .4byte _0819D928 + .4byte _0819D936 + .4byte _0819D948 + .4byte _0819D9B0 +_0819D7E0: + ldr r0, [r3] + ldrb r7, [r0, 0x14] + cmp r7, 0x1 + bne _0819D828 + ldr r0, =sub_819D324 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r4, r0, 24 + ldr r3, =gTasks + adds r2, r5, r6 + lsls r2, 3 + adds r2, r3 + movs r1, 0 + strh r1, [r2, 0xE] + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r3 + strh r6, [r0, 0xA] + strh r1, [r0, 0x8] + strh r7, [r0, 0xC] + movs r1, 0x6 + strh r1, [r0, 0xE] + movs r0, 0xA + strh r0, [r2, 0xC] + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] + b _0819D9D8 + .pool +_0819D828: + ldr r0, =sub_819D324 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r4, r0, 24 + ldr r3, =gTasks + adds r2, r5, r6 + lsls r2, 3 + adds r2, r3 + movs r0, 0 + movs r1, 0x1 + strh r1, [r2, 0xE] + strh r0, [r2, 0x10] + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r3 + strh r6, [r0, 0xA] + strh r1, [r0, 0x8] + strh r1, [r0, 0xC] + movs r1, 0x6 + strh r1, [r0, 0xE] + ldrh r0, [r2, 0x8] + adds r0, 0x2 + strh r0, [r2, 0x8] + b _0819D9D8 + .pool +_0819D868: + adds r0, r5, r6 + lsls r0, 3 + mov r1, r8 + adds r5, r0, r1 + ldrh r0, [r5, 0xC] + movs r2, 0xC + ldrsh r7, [r5, r2] + cmp r7, 0 + bne _0819D8A8 + ldr r0, =sub_819D324 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r4, r0, 24 + strh r7, [r5, 0x10] + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + add r0, r8 + strh r6, [r0, 0xA] + movs r1, 0x1 + strh r1, [r0, 0x8] + strh r1, [r0, 0xC] + movs r1, 0x6 + strh r1, [r0, 0xE] + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + b _0819D9D8 + .pool +_0819D8A8: + subs r0, 0x1 + strh r0, [r5, 0xC] + b _0819D9D8 +_0819D8AE: + adds r0, r5, r6 + lsls r0, 3 + mov r1, r8 + adds r4, r0, r1 + movs r2, 0xE + ldrsh r0, [r4, r2] + cmp r0, 0x1 + beq _0819D8C0 + b _0819D9D8 +_0819D8C0: + movs r1, 0x10 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0819D8CA + b _0819D9D8 +_0819D8CA: + ldr r1, =gPlttBufferFaded + ldr r0, =gUnknown_0860F13C + adds r0, 0x4A + ldrh r0, [r0] + movs r2, 0xE2 + lsls r2, 1 + adds r1, r2 + strh r0, [r1] + bl sub_819ED34 + movs r0, 0x5 + bl PutWindowTilemap + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0819D9D8 + .pool +_0819D8F4: + movs r0, 0x80 + lsls r0, 7 + ldr r1, =gUnknown_0860F13C + adds r1, 0x4A + ldrh r1, [r1] + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade + b _0819D990 + .pool +_0819D910: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0819D9D8 + movs r0, 0 + bl sub_819EDBC + b _0819D990 + .pool +_0819D928: + movs r0, 0x1 + bl sub_819EDBC + movs r0, 0x3 + bl PutWindowTilemap + b _0819D990 +_0819D936: + movs r0, 0x5 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x5 + movs r1, 0x2 + bl CopyWindowToVram + b _0819D990 +_0819D948: + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + ldrb r0, [r0, 0x14] + cmp r0, 0 + bne _0819D964 + ldr r0, =gUnknown_085EEC73 + bl sub_819EBEC + b _0819D96A + .pool +_0819D964: + ldr r0, =gUnknown_085EEC8B + bl sub_819EBEC +_0819D96A: + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldrb r0, [r1, 0x3] + cmp r0, 0x2 + bhi _0819D98C + ldr r2, =gSprites + ldrb r1, [r1, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r0] +_0819D98C: + bl sub_819EFA8 +_0819D990: + ldr r0, =gTasks + adds r1, r5, r6 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0819D9D8 + .pool +_0819D9B0: + bl sub_819EEF0 + bl sub_819EADC + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r0, 0x22 + movs r1, 0x1 + strb r1, [r0] + ldr r1, =gTasks + adds r0, r5, r6 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x12] + strh r1, [r0, 0x8] + ldrh r1, [r0, 0x14] + ldrh r2, [r0, 0x16] + lsls r1, 16 + orrs r1, r2 + str r1, [r0] +_0819D9D8: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819D770 + + thumb_func_start sub_819D9EC +sub_819D9EC: @ 819D9EC + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r0, 0x30 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0819DA00 + b _0819DBCA +_0819DA00: + ldr r0, =gTasks + lsls r2, r6, 2 + adds r1, r2, r6 + lsls r1, 3 + adds r1, r0 + movs r3, 0x8 + ldrsh r1, [r1, r3] + adds r3, r0, 0 + adds r7, r2, 0 + cmp r1, 0x4 + bls _0819DA18 + b _0819DBCA +_0819DA18: + lsls r0, r1, 2 + ldr r1, =_0819DA30 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0819DA30: + .4byte _0819DA44 + .4byte _0819DA58 + .4byte _0819DA8C + .4byte _0819DABC + .4byte _0819DBB0 +_0819DA44: + bl sub_819EEF0 + ldr r0, =gTasks + adds r1, r7, r6 + lsls r1, 3 + adds r1, r0 + b _0819DB96 + .pool +_0819DA58: + bl sub_819EADC + ldr r2, =gSprites + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldr r0, =gTasks + adds r1, r7, r6 + lsls r1, 3 + adds r1, r0 + b _0819DB96 + .pool +_0819DA8C: + ldr r0, =sub_819D12C + movs r1, 0 + bl CreateTask + ldr r2, =gTasks + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r0, 0x21 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldr r1, =sub_819D064 + str r1, [r0] + b _0819DB90 + .pool +_0819DABC: + ldr r0, =sub_819D12C + bl FuncIsActiveTask + lsls r0, 24 + cmp r0, 0 + beq _0819DACA + b _0819DBCA +_0819DACA: + ldr r2, =gTasks + ldr r4, =gUnknown_03001284 + ldr r0, [r4] + adds r0, 0x21 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0x10 + ldrsh r0, [r0, r1] + cmp r0, 0x1 + bne _0819DBCA + bl sub_819EAC0 + ldr r0, [r4] + ldrb r0, [r0, 0x14] + cmp r0, 0 + bne _0819DB04 + movs r0, 0x1 + bl sub_819F048 + b _0819DB32 + .pool +_0819DB04: + movs r0, 0 + bl sub_819F048 + movs r2, 0 + ldr r5, =gSprites + movs r3, 0x4 +_0819DB10: + ldr r0, [r4] + adds r0, 0xB + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r3 + strb r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x2 + bls _0819DB10 +_0819DB32: + ldr r5, =gSprites + ldr r4, =gUnknown_03001284 + ldr r3, [r4] + ldrb r0, [r3, 0x4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + adds r0, r3, 0x5 + ldrb r2, [r3, 0x3] + adds r0, r2 + ldrb r2, [r0] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r5 + ldrh r0, [r0, 0x20] + movs r5, 0 + strh r0, [r1, 0x20] + ldr r2, =gTasks + adds r0, r3, 0 + adds r0, 0x21 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldr r1, =sub_819CF54 + str r1, [r0] + adds r3, 0x27 + strb r5, [r3] + ldr r0, [r4] + adds r0, 0x28 + movs r1, 0x6 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0x26 + strb r5, [r0] + ldr r0, [r4] + adds r0, 0x21 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0x1 + strh r1, [r0, 0x8] +_0819DB90: + adds r1, r7, r6 + lsls r1, 3 + adds r1, r2 +_0819DB96: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0819DBCA + .pool +_0819DBB0: + adds r0, r7, r6 + lsls r0, 3 + adds r0, r3 + movs r1, 0 + strh r1, [r0, 0x8] + ldr r2, =sub_819CE40 + lsrs r1, r2, 16 + strh r1, [r0, 0x14] + strh r2, [r0, 0x16] + movs r1, 0x1 + strh r1, [r0, 0x12] + ldr r1, =sub_819D770 + str r1, [r0] +_0819DBCA: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819D9EC + + thumb_func_start sub_819DBD8 +sub_819DBD8: @ 819DBD8 + push {r4,r5,lr} + ldr r5, =gUnknown_03001284 + ldr r4, [r5] + cmp r4, 0 + bne _0819DBF6 + movs r0, 0x34 + bl AllocZeroed + str r0, [r5] + strb r4, [r0, 0x3] + ldr r0, [r5] + adds r0, 0x30 + strb r4, [r0] + ldr r0, [r5] + strb r4, [r0, 0x15] +_0819DBF6: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819DBD8 + + thumb_func_start sub_819DC00 +sub_819DC00: @ 819DC00 + push {lr} + ldr r0, =gUnknown_03001284 + movs r1, 0 + str r1, [r0] + ldr r0, =sub_819DC1C + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_819DC00 + + thumb_func_start sub_819DC1C +sub_819DC1C: @ 819DC1C + push {r4-r6,lr} + sub sp, 0xC + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0xF + bls _0819DC32 + b _0819E0AA +_0819DC32: + lsls r0, 2 + ldr r1, =_0819DC44 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0819DC44: + .4byte _0819DC84 + .4byte _0819DCD4 + .4byte _0819DDA8 + .4byte _0819DE68 + .4byte _0819DE94 + .4byte _0819DECC + .4byte _0819DEEC + .4byte _0819DF10 + .4byte _0819DF30 + .4byte _0819DF3C + .4byte _0819DF64 + .4byte _0819DF70 + .4byte _0819DF78 + .4byte _0819DF8C + .4byte _0819DFA4 + .4byte _0819E01C +_0819DC84: + movs r0, 0 + bl SetHBlankCallback + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + str r0, [sp, 0x8] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, =0x05006000 + add r0, sp, 0x8 + bl CpuSet + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_086108B8 + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + ldr r0, =gUnknown_086108C8 + bl InitWindows + bl DeactivateAllTextPrinters + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0819E00E + .pool +_0819DCD4: + ldr r5, =gUnknown_0203CE40 + movs r4, 0x88 + lsls r4, 3 + adds r0, r4, 0 + bl Alloc + str r0, [r5] + ldr r5, =gUnknown_0203CE44 + adds r0, r4, 0 + bl AllocZeroed + str r0, [r5] + ldr r5, =gUnknown_0203CE48 + movs r4, 0x80 + lsls r4, 4 + adds r0, r4, 0 + bl Alloc + str r0, [r5] + ldr r5, =gUnknown_0203CE4C + adds r0, r4, 0 + bl AllocZeroed + str r0, [r5] + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + movs r0, 0x4C + movs r1, 0 + bl SetGpuReg + movs r0, 0x40 + movs r1, 0 + bl SetGpuReg + movs r0, 0x44 + movs r1, 0 + bl SetGpuReg + movs r0, 0x42 + movs r1, 0 + bl SetGpuReg + movs r0, 0x46 + movs r1, 0 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0 + bl SetGpuReg + movs r0, 0x4A + movs r1, 0 + bl SetGpuReg + b _0819E006 + .pool +_0819DDA8: + bl ResetPaletteFade + bl ResetSpriteData + bl ResetTasks + bl FreeAllSpritePalettes + bl dp13_810BB8C + ldr r0, =gUnknown_08DC0754 + ldr r5, =gUnknown_0203CE40 + ldr r1, [r5] + movs r2, 0x88 + lsls r2, 2 + bl CpuSet + ldr r0, =gUnknown_0861033C + ldr r4, =gUnknown_0203CE44 + ldr r1, [r4] + movs r2, 0x30 + bl CpuSet + ldr r1, [r5] + movs r2, 0x88 + lsls r2, 3 + movs r0, 0x1 + movs r3, 0 + bl LoadBgTiles + ldr r1, [r4] + movs r0, 0x3 + movs r2, 0x60 + movs r3, 0 + bl LoadBgTiles + ldr r0, =gUnknown_08DC0B94 + ldr r4, =gUnknown_0203CE48 + ldr r1, [r4] + movs r2, 0x80 + lsls r2, 3 + bl CpuSet + ldr r1, [r4] + movs r2, 0x80 + lsls r2, 4 + movs r0, 0x1 + movs r3, 0 + bl LoadBgTilemap + ldr r0, =gUnknown_08DC0714 + movs r1, 0 + movs r2, 0x40 + bl LoadPalette + ldr r4, =gUnknown_08610918 + adds r0, r4, 0 + movs r1, 0xF0 + movs r2, 0xA + bl LoadPalette + adds r0, r4, 0 + movs r1, 0xE0 + movs r2, 0xA + bl LoadPalette + ldr r0, =gUnknown_0861039C + movs r1, 0x20 + movs r2, 0x4 + bl LoadPalette + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0819E00E + .pool +_0819DE68: + ldr r0, =gUnknown_0203CE4C + ldr r1, [r0] + movs r0, 0x3 + bl SetBgTilemapBuffer + ldr r1, =gUnknown_0861023C + movs r0, 0x8 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x3 + movs r2, 0xB + movs r3, 0x4 + bl CopyToBgTilemapBufferRect + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + b _0819E006 + .pool +_0819DE94: + ldr r0, =gUnknown_086106B0 + bl LoadSpritePalettes + ldr r0, =gUnknown_08610650 + bl LoadSpriteSheets + ldr r0, =gUnknown_086106A0 + bl LoadCompressedObjectPic + ldr r0, =sub_819C7FC + bl SetVBlankCallback + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0819E00E + .pool +_0819DECC: + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldrb r0, [r1, 0x15] + cmp r0, 0x1 + bne _0819DEDC + ldr r0, =gUnknown_0203CF20 + ldrb r0, [r0] + strb r0, [r1, 0x3] +_0819DEDC: + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 + b _0819E00E + .pool +_0819DEEC: + bl sub_819DBD8 + bl sub_819E0C0 + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + ldrb r0, [r0, 0x15] + cmp r0, 0x1 + bne _0819DF02 + bl sub_819F304 +_0819DF02: + movs r0, 0 + bl sub_819F048 + b _0819E006 + .pool +_0819DF10: + ldr r0, =gUnknown_085EEC73 + bl sub_819EBEC + movs r0, 0x2 + bl PutWindowTilemap + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0819E00E + .pool +_0819DF30: + bl sub_819EFA8 + movs r0, 0x8 + bl PutWindowTilemap + b _0819E006 +_0819DF3C: + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + ldrb r0, [r0, 0x15] + cmp r0, 0 + bne _0819DF4A + bl sub_819EB4C +_0819DF4A: + movs r0, 0x1 + bl PutWindowTilemap + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0819E00E + .pool +_0819DF64: + bl sub_819EB18 + movs r0, 0 + bl PutWindowTilemap + b _0819E006 +_0819DF70: + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 + b _0819E00E +_0819DF78: + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + ldrb r0, [r0, 0x15] + cmp r0, 0 + beq _0819E006 + bl sub_819EE08 + b _0819E006 + .pool +_0819DF8C: + bl sub_819ED78 + movs r0, 0x3 + bl PutWindowTilemap + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0819E00E + .pool +_0819DFA4: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + ldrb r0, [r0, 0x15] + cmp r0, 0x1 + bne _0819E000 + movs r0, 0x3 + bl ShowBg + ldr r1, =0x00001248 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x0000040b + movs r0, 0x52 + bl SetGpuReg + b _0819E006 + .pool +_0819E000: + movs r0, 0x3 + bl HideBg +_0819E006: + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 +_0819E00E: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0819E0AA + .pool +_0819E01C: + ldr r0, =sub_819CF54 + movs r1, 0 + bl CreateTask + ldr r6, =gUnknown_03001284 + ldr r1, [r6] + adds r1, 0x21 + strb r0, [r1] + ldr r0, [r6] + ldrb r5, [r0, 0x15] + cmp r5, 0 + bne _0819E06C + ldr r4, =gTasks + adds r0, 0x21 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + strh r5, [r0, 0x8] + ldr r0, =sub_819CE40 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + strh r5, [r0, 0x8] + b _0819E0A4 + .pool +_0819E06C: + bl sub_819EAF8 + ldr r4, =gTasks + ldr r2, [r6] + adds r0, r2, 0 + adds r0, 0x21 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + movs r3, 0 + movs r1, 0x1 + strh r1, [r0, 0x8] + adds r2, 0x22 + strb r3, [r2] + ldr r0, =sub_819CD34 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + movs r1, 0x2 + strh r1, [r0, 0x8] +_0819E0A4: + ldr r0, =sub_819C7E0 + bl SetMainCallback2 +_0819E0AA: + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819DC1C + + thumb_func_start sub_819E0C0 +sub_819E0C0: @ 819E0C0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + mov r1, sp + ldr r0, =gUnknown_08610834 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2,r5,r6} + stm r1!, {r2,r5,r6} + mov r1, sp + movs r0, 0x65 + strh r0, [r1, 0x2] + movs r6, 0 + ldr r4, =gUnknown_03001284 + movs r7, 0 + ldr r5, =gSprites +_0819E0E6: + lsls r1, r6, 1 + adds r1, r6 + lsls r1, 20 + movs r3, 0x90 + lsls r3, 15 + adds r1, r3 + asrs r1, 16 + mov r0, sp + movs r2, 0x40 + movs r3, 0x1 + bl CreateSprite + ldr r1, [r4] + adds r1, 0x5 + adds r1, r6 + strb r0, [r1] + ldr r0, [r4] + adds r0, 0x5 + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r7, [r0, 0x2E] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x2 + bls _0819E0E6 + ldr r7, =gUnknown_03001284 + ldr r1, [r7] + adds r0, r1, 0x5 + ldrb r1, [r1, 0x3] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =gSprites + adds r0, r4 + movs r5, 0x20 + ldrsh r1, [r0, r5] + ldr r0, =gUnknown_0861084C + movs r2, 0x58 + movs r3, 0 + bl CreateSprite + ldr r1, [r7] + movs r4, 0 + strb r0, [r1, 0x4] + ldr r0, =gUnknown_08610864 + movs r1, 0xB0 + movs r2, 0x70 + movs r3, 0 + bl CreateSprite + ldr r1, [r7] + strb r0, [r1, 0x1] + ldr r0, =gUnknown_0861087C + movs r1, 0xB0 + movs r2, 0x90 + movs r3, 0 + bl CreateSprite + ldr r1, [r7] + strb r0, [r1, 0x2] + ldr r0, [r7] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r6, =gSprites + adds r0, r6 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldr r0, [r7] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + ldr r0, [r7] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x28 + strb r4, [r0] + ldr r0, [r7] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x29 + strb r4, [r0] + ldr r0, [r7] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x28 + strb r4, [r0] + ldr r0, [r7] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x29 + strb r4, [r0] + ldr r0, [r7] + ldrb r0, [r0, 0x15] + movs r1, 0xC0 + str r1, [sp, 0x18] + cmp r0, 0x1 + bne _0819E1E8 + movs r2, 0xF0 + str r2, [sp, 0x18] +_0819E1E8: + mov r1, sp + ldr r0, =gUnknown_0861084C + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + mov r0, sp + movs r4, 0x68 + mov r10, r4 + mov r5, r10 + strh r5, [r0] + movs r1, 0xF0 + movs r2, 0x78 + movs r3, 0xA + bl CreateSprite + ldr r1, [r7] + strb r0, [r1, 0x8] + mov r1, sp + ldr r0, =gUnknown_08610864 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + mov r0, sp + movs r1, 0x69 + mov r9, r1 + mov r2, r9 + strh r2, [r0] + movs r4, 0x80 + lsls r4, 1 + adds r1, r4, 0 + movs r2, 0x78 + movs r3, 0xA + bl CreateSprite + ldr r1, [r7] + strb r0, [r1, 0x9] + movs r5, 0x90 + lsls r5, 1 + mov r0, sp + adds r1, r5, 0 + movs r2, 0x78 + movs r3, 0xA + bl CreateSprite + ldr r1, [r7] + strb r0, [r1, 0xA] + mov r1, sp + ldr r0, =gUnknown_0861084C + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + mov r0, sp + movs r3, 0x6A + mov r8, r3 + mov r6, r8 + strh r6, [r0] + movs r1, 0xF0 + movs r2, 0x78 + movs r3, 0x1 + bl CreateSprite + ldr r1, [r7] + strb r0, [r1, 0xB] + mov r1, sp + ldr r0, =gUnknown_08610864 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + mov r1, sp + movs r0, 0x6B + strh r0, [r1] + mov r0, sp + adds r1, r4, 0 + movs r2, 0x78 + movs r3, 0x1 + bl CreateSprite + ldr r1, [r7] + strb r0, [r1, 0xC] + mov r0, sp + movs r6, 0x6C + strh r6, [r0] + adds r1, r5, 0 + movs r2, 0x78 + movs r3, 0x1 + bl CreateSprite + ldr r1, [r7] + strb r0, [r1, 0xD] + mov r1, sp + ldr r0, =gUnknown_0861084C + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + mov r0, sp + mov r4, r10 + strh r4, [r0] + ldr r1, [sp, 0x18] + movs r2, 0x90 + movs r3, 0xA + bl CreateSprite + ldr r1, [r7] + strb r0, [r1, 0xE] + mov r1, sp + ldr r0, =gUnknown_08610864 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r4,r5} + stm r1!, {r2,r4,r5} + mov r0, sp + mov r3, r9 + strh r3, [r0] + ldr r4, [sp, 0x18] + adds r4, 0x10 + adds r1, r4, 0 + movs r2, 0x90 + movs r3, 0xA + bl CreateSprite + ldr r1, [r7] + strb r0, [r1, 0xF] + mov r1, sp + ldr r0, =gUnknown_0861084C + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + mov r0, sp + mov r5, r8 + strh r5, [r0] + ldr r1, [sp, 0x18] + movs r2, 0x90 + movs r3, 0x1 + bl CreateSprite + ldr r1, [r7] + strb r0, [r1, 0x10] + mov r1, sp + ldr r0, =gUnknown_08610864 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + mov r0, sp + strh r6, [r0] + adds r1, r4, 0 + movs r2, 0x90 + movs r3, 0x1 + bl CreateSprite + ldr r1, [r7] + strb r0, [r1, 0x11] + movs r6, 0 + ldr r5, =gSprites + adds r4, r7, 0 + movs r7, 0 + movs r0, 0x4 + mov r10, r0 +_0819E330: + ldr r0, [r4] + lsls r3, r6, 1 + adds r2, r3, r6 + adds r0, 0x8 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x28 + strb r7, [r0] + ldr r0, [r4] + adds r0, 0x8 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x29 + strb r7, [r0] + ldr r0, [r4] + adds r0, 0x9 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x28 + strb r7, [r0] + ldr r0, [r4] + adds r0, 0x9 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x29 + strb r7, [r0] + ldr r0, [r4] + adds r0, 0xA + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x28 + strb r7, [r0] + ldr r0, [r4] + adds r0, 0xA + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x29 + strb r7, [r0] + ldr r0, [r4] + adds r0, 0xE + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x28 + strb r7, [r0] + ldr r0, [r4] + adds r0, 0xE + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x29 + strb r7, [r0] + ldr r0, [r4] + adds r0, 0xF + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x28 + strb r7, [r0] + ldr r0, [r4] + adds r0, 0xF + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x29 + strb r7, [r0] + ldr r0, [r4] + adds r0, 0x8 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + mov r8, r0 + ldrb r1, [r0] + mov r0, r10 + orrs r1, r0 + mov r0, r8 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0x9 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + mov r8, r0 + ldrb r1, [r0] + mov r0, r10 + orrs r1, r0 + mov r0, r8 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0xA + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + mov r2, r10 + orrs r1, r2 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0xE + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0xF + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r3, =gUnknown_03001284 + mov r8, r3 + ldr r0, =gSprites + mov r9, r0 + cmp r6, 0x1 + bhi _0819E496 + b _0819E330 +_0819E496: + ldr r0, [r3] + ldrb r0, [r0, 0xE] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r9 + adds r1, 0x3E + ldrb r2, [r1] + movs r3, 0x5 + negs r3, r3 + adds r0, r3, 0 + b _0819E4C8 + .pool +_0819E4C8: + ands r0, r2 + strb r0, [r1] + mov r1, r8 + ldr r0, [r1] + ldrb r1, [r0, 0xF] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r9 + adds r0, 0x3E + ldrb r2, [r0] + adds r1, r3, 0 + ands r1, r2 + strb r1, [r0] + mov r2, r8 + ldr r0, [r2] + ldrb r1, [r0, 0x8] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r9 + adds r0, 0x3E + ldrb r2, [r0] + adds r1, r3, 0 + ands r1, r2 + strb r1, [r0] + mov r4, r8 + ldr r0, [r4] + ldrb r1, [r0, 0x9] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r9 + adds r0, 0x3E + ldrb r2, [r0] + adds r1, r3, 0 + ands r1, r2 + strb r1, [r0] + ldr r0, [r4] + ldrb r1, [r0, 0xA] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r9 + adds r0, 0x3E + ldrb r1, [r0] + ands r3, r1 + strb r3, [r0] + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819E0C0 + + thumb_func_start sub_819E538 +sub_819E538: @ 819E538 + push {r4-r7,lr} + movs r5, 0 +_0819E53C: + ldr r6, =gUnknown_03001284 + ldr r0, [r6] + adds r0, 0x5 + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =gSprites + adds r0, r4 + bl DestroySprite + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _0819E53C + ldr r0, [r6] + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl DestroySprite + ldr r0, [r6] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl DestroySprite + ldr r0, [r6] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl DestroySprite + movs r5, 0 +_0819E590: + movs r4, 0 + lsls r6, r5, 1 +_0819E594: + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r1, r6, r5 + adds r1, r4, r1 + adds r0, 0x8 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + bl DestroySprite + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _0819E594 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bls _0819E590 + movs r5, 0 +_0819E5C6: + movs r4, 0 + adds r7, r5, 0x1 + lsls r6, r5, 1 +_0819E5CC: + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r1, r4, r6 + adds r0, 0xE + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + bl DestroySprite + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _0819E5CC + lsls r0, r7, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bls _0819E5C6 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819E538 + + thumb_func_start sub_819E608 +sub_819E608: @ 819E608 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x2 + bhi _0819E65C + ldr r4, =gSprites + ldr r5, =gUnknown_03001284 + ldr r0, [r5] + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + bl sub_819E8EC + ldr r0, [r5] + ldrb r2, [r0, 0x4] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + adds r0, 0x5 + adds r0, r6 + ldrb r2, [r0] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0, 0x20] + strh r0, [r1, 0x20] + b _0819E684 + .pool +_0819E65C: + ldr r2, =gSprites + ldr r3, =gUnknown_03001284 + ldr r0, [r3] + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldr r0, [r3] + ldr r1, [r0, 0x18] + lsls r0, r6, 3 + adds r0, r1 + ldrb r0, [r0] + bl sub_819E838 +_0819E684: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819E608 + + thumb_func_start sub_819E694 +sub_819E694: @ 819E694 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl PlaySE + lsls r4, 24 + cmp r4, 0 + ble _0819E6C0 + ldr r1, =gUnknown_03001284 + ldr r2, [r1] + ldrb r0, [r2, 0x3] + adds r0, 0x1 + ldrb r3, [r2, 0x17] + cmp r0, r3 + bne _0819E6D8 + movs r0, 0 + b _0819E6D8 + .pool +_0819E6C0: + ldr r0, =gUnknown_03001284 + ldr r2, [r0] + ldrb r3, [r2, 0x3] + adds r1, r0, 0 + cmp r3, 0 + beq _0819E6D4 + subs r0, r3, 0x1 + b _0819E6D8 + .pool +_0819E6D4: + ldrb r0, [r2, 0x17] + subs r0, 0x1 +_0819E6D8: + strb r0, [r2, 0x3] + ldr r0, [r1] + ldrb r0, [r0, 0x3] + bl sub_819E608 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_819E694 + + thumb_func_start sub_819E6E8 +sub_819E6E8: @ 819E6E8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl PlaySE + lsls r4, 24 + cmp r4, 0 + ble _0819E728 + ldr r0, =gUnknown_03001284 + ldr r2, [r0] + ldrb r1, [r2, 0x3] + adds r4, r0, 0 + cmp r1, 0x2 + bhi _0819E714 + movs r0, 0x3 + strb r0, [r2, 0x3] + b _0819E74A + .pool +_0819E714: + ldrb r0, [r2, 0x3] + adds r0, 0x1 + ldrb r1, [r2, 0x17] + cmp r0, r1 + beq _0819E722 + strb r0, [r2, 0x3] + b _0819E74A +_0819E722: + movs r0, 0 + strb r0, [r2, 0x3] + b _0819E74A +_0819E728: + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldrb r3, [r1, 0x3] + adds r2, r3, 0 + adds r4, r0, 0 + cmp r2, 0x2 + bls _0819E744 + cmp r2, 0 + beq _0819E744 + subs r0, r3, 0x1 + b _0819E748 + .pool +_0819E744: + ldrb r0, [r1, 0x17] + subs r0, 0x1 +_0819E748: + strb r0, [r1, 0x3] +_0819E74A: + ldr r0, [r4] + ldrb r0, [r0, 0x3] + bl sub_819E608 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_819E6E8 + + thumb_func_start sub_819E758 +sub_819E758: @ 819E758 + push {lr} + lsls r0, 24 + cmp r0, 0 + ble _0819E778 + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldrb r3, [r1, 0x16] + adds r2, r0, 0 + cmp r3, 0x1 + beq _0819E774 + adds r0, r3, 0x1 + b _0819E78E + .pool +_0819E774: + movs r0, 0 + b _0819E78E +_0819E778: + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldrb r3, [r1, 0x16] + adds r2, r0, 0 + cmp r3, 0 + beq _0819E78C + subs r0, r3, 0x1 + b _0819E78E + .pool +_0819E78C: + movs r0, 0x1 +_0819E78E: + strb r0, [r1, 0x16] + ldr r3, =gSprites + ldr r2, [r2] + ldrb r0, [r2, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r0, [r2, 0x16] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + ldrb r0, [r2, 0x2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r0, [r2, 0x16] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + pop {r0} + bx r0 + .pool + thumb_func_end sub_819E758 + + thumb_func_start sub_819E7C0 +sub_819E7C0: @ 819E7C0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl PlaySE + lsls r4, 24 + cmp r4, 0 + ble _0819E7EC + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldrb r3, [r1] + adds r2, r0, 0 + cmp r3, 0x2 + beq _0819E7E8 + adds r0, r3, 0x1 + b _0819E802 + .pool +_0819E7E8: + movs r0, 0 + b _0819E802 +_0819E7EC: + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldrb r3, [r1] + adds r2, r0, 0 + cmp r3, 0 + beq _0819E800 + subs r0, r3, 0x1 + b _0819E802 + .pool +_0819E800: + movs r0, 0x2 +_0819E802: + strb r0, [r1] + ldr r3, =gSprites + ldr r2, [r2] + ldrb r0, [r2, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r0, [r2] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + ldrb r0, [r2, 0x2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r0, [r2] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819E7C0 + + thumb_func_start sub_819E838 +sub_819E838: @ 819E838 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r6, r0, 24 + movs r4, 0 + movs r0, 0x5 + negs r0, r0 + mov r9, r0 + movs r2, 0x4 + mov r8, r2 + ldr r0, =gSprites + mov r12, r0 + ldr r7, =gUnknown_03001284 +_0819E856: + cmp r6, 0x2 + bne _0819E898 + ldr r5, =gSprites + ldr r3, =gUnknown_03001284 + ldr r0, [r3] + adds r0, 0xB + adds r0, r4 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + adds r1, 0x3E + ldrb r2, [r1] + mov r0, r9 + ands r0, r2 + strb r0, [r1] + cmp r4, 0x1 + bhi _0819E8D4 + ldr r0, [r3] + adds r0, 0x10 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + b _0819E8CA + .pool +_0819E898: + cmp r6, 0x3 + bne _0819E8D4 + cmp r4, 0x1 + bhi _0819E8BA + ldr r0, [r7] + adds r0, 0x10 + adds r0, r4 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r12 + adds r1, 0x3E + ldrb r2, [r1] + mov r0, r9 + ands r0, r2 + strb r0, [r1] +_0819E8BA: + ldr r0, [r7] + adds r0, 0xB + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r12 +_0819E8CA: + adds r0, 0x3E + ldrb r1, [r0] + mov r2, r8 + orrs r1, r2 + strb r1, [r0] +_0819E8D4: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _0819E856 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_819E838 + + thumb_func_start sub_819E8EC +sub_819E8EC: @ 819E8EC + push {r4-r6,lr} + movs r2, 0 + ldr r5, =gSprites + ldr r4, =gUnknown_03001284 + adds r6, r5, 0 + movs r3, 0x4 +_0819E8F8: + ldr r0, [r4] + adds r0, 0xB + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r3 + strb r1, [r0] + cmp r2, 0x1 + bhi _0819E92C + ldr r0, [r4] + adds r0, 0x10 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r3 + strb r1, [r0] +_0819E92C: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x2 + bls _0819E8F8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819E8EC + + thumb_func_start sub_819E944 +sub_819E944: @ 819E944 + push {r4,r5,lr} + ldr r0, =gUnknown_03001284 + ldr r3, [r0] + ldrb r1, [r3, 0x15] + adds r5, r0, 0 + cmp r1, 0x1 + bne _0819E95C + movs r0, 0 + strb r0, [r3, 0x15] + b _0819E960 + .pool +_0819E95C: + movs r0, 0 + strb r0, [r3] +_0819E960: + ldr r4, =gSprites + ldr r2, [r5] + ldrb r1, [r2, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xB0 + strh r1, [r0, 0x20] + ldrb r0, [r2, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r0, [r2] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + ldrb r1, [r2, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xD0 + strh r1, [r0, 0x20] + ldrb r0, [r2, 0x2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r0, [r2] + lsls r0, 4 + adds r0, 0x70 + strh r0, [r1, 0x22] + ldrb r0, [r2, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + adds r1, 0x3E + ldrb r3, [r1] + movs r2, 0x5 + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + strb r0, [r1] + ldr r0, [r5] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + ands r2, r1 + strb r2, [r0] + bl sub_819EC20 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819E944 + + thumb_func_start sub_819E9E0 +sub_819E9E0: @ 819E9E0 + push {r4,r5,lr} + ldr r5, =gUnknown_03001284 + ldr r1, [r5] + movs r0, 0 + strb r0, [r1, 0x16] + ldr r4, =gSprites + ldr r2, [r5] + ldrb r1, [r2, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xB0 + strh r1, [r0, 0x20] + ldrb r1, [r2, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r3, 0x70 + strh r3, [r0, 0x22] + ldrb r1, [r2, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xD0 + strh r1, [r0, 0x20] + ldrb r1, [r2, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r3, [r0, 0x22] + ldrb r0, [r2, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + adds r1, 0x3E + ldrb r3, [r1] + movs r2, 0x5 + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + strb r0, [r1] + ldr r0, [r5] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + ands r2, r1 + strb r2, [r0] + bl sub_819EC94 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819E9E0 + + thumb_func_start sub_819EA64 +sub_819EA64: @ 819EA64 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =gSprites + ldr r3, =gUnknown_03001284 + ldr r0, [r3] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldr r0, [r3] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + adds r0, r4, 0 + movs r1, 0 + bl FillWindowPixelBuffer + adds r0, r4, 0 + movs r1, 0x2 + bl CopyWindowToVram + adds r0, r4, 0 + bl ClearWindowTilemap + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819EA64 + + thumb_func_start sub_819EAC0 +sub_819EAC0: @ 819EAC0 + push {lr} + movs r0, 0x1 + bl PutWindowTilemap + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x1 + movs r1, 0x2 + bl CopyWindowToVram + pop {r0} + bx r0 + thumb_func_end sub_819EAC0 + + thumb_func_start sub_819EADC +sub_819EADC: @ 819EADC + push {lr} + movs r0, 0x7 + bl PutWindowTilemap + movs r0, 0x7 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x7 + movs r1, 0x2 + bl CopyWindowToVram + pop {r0} + bx r0 + thumb_func_end sub_819EADC + + thumb_func_start sub_819EAF8 +sub_819EAF8: @ 819EAF8 + push {lr} + bl sub_819EAC0 + movs r0, 0x5 + bl PutWindowTilemap + movs r0, 0x5 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x5 + movs r1, 0x2 + bl CopyWindowToVram + pop {r0} + bx r0 + thumb_func_end sub_819EAF8 + + thumb_func_start sub_819EB18 +sub_819EB18: @ 819EB18 + push {lr} + sub sp, 0xC + movs r0, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r2, =gUnknown_085EEC66 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x2 + bl Print + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_819EB18 + + thumb_func_start sub_819EB4C +sub_819EB4C: @ 819EB4C + push {r4,lr} + sub sp, 0xC + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldrb r0, [r1, 0x3] + cmp r0, 0x2 + bls _0819EB70 + movs r0, 0x1 + movs r1, 0x2 + bl CopyWindowToVram + b _0819EBD4 + .pool +_0819EB70: + ldrb r2, [r1, 0x3] + ldrb r0, [r1, 0x14] + cmp r0, 0 + bne _0819EB84 + movs r0, 0x64 + muls r0, r2 + ldr r1, =gPlayerParty + b _0819EB8A + .pool +_0819EB84: + movs r0, 0x64 + muls r0, r2 + ldr r1, =gEnemyParty +_0819EB8A: + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl GetMonData + lsls r0, 16 + lsrs r1, r0, 16 + ldr r4, =gStringVar4 + movs r0, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + adds r0, r4, 0 + bl StringCopy + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x56 + bl GetStringRightAlignXOffset + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =gUnknown_08610925 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0x1 + bl box_print + movs r0, 0x1 + movs r1, 0x3 + bl CopyWindowToVram +_0819EBD4: + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819EB4C + + thumb_func_start sub_819EBEC +sub_819EBEC: @ 819EBEC + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + movs r0, 0x2 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x5 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x2 + bl Print + movs r0, 0x2 + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_819EBEC + + thumb_func_start sub_819EC20 +sub_819EC20: @ 819EC20 + push {r4,r5,lr} + sub sp, 0xC + movs r0, 0x3 + bl PutWindowTilemap + movs r0, 0x3 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r5, =gUnknown_08610922 + str r5, [sp] + movs r4, 0 + str r4, [sp, 0x4] + ldr r0, =gUnknown_085EECAA + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0xF + movs r3, 0x1 + bl box_print + str r5, [sp] + str r4, [sp, 0x4] + ldr r0, =gUnknown_085EECA5 + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0xF + movs r3, 0x11 + bl box_print + str r5, [sp] + str r4, [sp, 0x4] + ldr r0, =gUnknown_085EECB2 + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0xF + movs r3, 0x21 + bl box_print + movs r0, 0x3 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819EC20 + + thumb_func_start sub_819EC94 +sub_819EC94: @ 819EC94 + push {r4,r5,lr} + sub sp, 0xC + movs r0, 0x4 + bl PutWindowTilemap + movs r0, 0x4 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r5, =gUnknown_08610922 + str r5, [sp] + movs r4, 0 + str r4, [sp, 0x4] + ldr r0, =gUnknown_085EECCA + str r0, [sp, 0x8] + movs r0, 0x4 + movs r1, 0x1 + movs r2, 0x7 + movs r3, 0x1 + bl box_print + str r5, [sp] + str r4, [sp, 0x4] + ldr r0, =gUnknown_085EECCE + str r0, [sp, 0x8] + movs r0, 0x4 + movs r1, 0x1 + movs r2, 0x7 + movs r3, 0x11 + bl box_print + movs r0, 0x4 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819EC94 + + thumb_func_start sub_819ECF0 +sub_819ECF0: @ 819ECF0 + push {r4-r6,lr} + sub sp, 0xC + adds r6, r0, 0 + adds r5, r1, 0 + adds r4, r2, 0 + movs r0, 0 + adds r1, r6, 0 + movs r2, 0x46 + bl GetStringRightAlignXOffset + adds r2, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gUnknown_08610922 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r6, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0 + adds r3, r5, 0 + bl box_print + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819ECF0 + + thumb_func_start sub_819ED34 +sub_819ED34: @ 819ED34 + push {lr} + movs r0, 0x5 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + ldrb r0, [r0, 0x14] + cmp r0, 0 + beq _0819ED56 + cmp r0, 0x1 + bne _0819ED60 + ldr r0, =gUnknown_085EECD1 + movs r1, 0 + movs r2, 0x5 + bl sub_819ECF0 +_0819ED56: + ldr r0, =gUnknown_085EECDD + movs r1, 0x18 + movs r2, 0x5 + bl sub_819ECF0 +_0819ED60: + movs r0, 0x5 + movs r1, 0x3 + bl CopyWindowToVram + pop {r0} + bx r0 + .pool + thumb_func_end sub_819ED34 + + thumb_func_start sub_819ED78 +sub_819ED78: @ 819ED78 + push {lr} + movs r0, 0x3 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + ldrb r0, [r0, 0x14] + cmp r0, 0 + beq _0819ED9A + cmp r0, 0x1 + bne _0819EDA4 + ldr r0, =gUnknown_085EECD1 + movs r1, 0x8 + movs r2, 0x3 + bl sub_819ECF0 +_0819ED9A: + ldr r0, =gUnknown_085EECDD + movs r1, 0x20 + movs r2, 0x3 + bl sub_819ECF0 +_0819EDA4: + movs r0, 0x3 + movs r1, 0x3 + bl CopyWindowToVram + pop {r0} + bx r0 + .pool + thumb_func_end sub_819ED78 + + thumb_func_start sub_819EDBC +sub_819EDBC: @ 819EDBC + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _0819EDCC + cmp r0, 0x1 + beq _0819EDEC + b _0819EDF6 +_0819EDCC: + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + ldrb r0, [r0, 0x14] + cmp r0, 0x1 + bne _0819EDF6 + ldr r0, =gUnknown_085EECD1 + movs r1, 0x8 + movs r2, 0x3 + bl sub_819ECF0 + b _0819EDF6 + .pool +_0819EDEC: + ldr r0, =gUnknown_085EECDD + movs r1, 0x20 + movs r2, 0x3 + bl sub_819ECF0 +_0819EDF6: + movs r0, 0x3 + movs r1, 0x3 + bl CopyWindowToVram + pop {r0} + bx r0 + .pool + thumb_func_end sub_819EDBC + + thumb_func_start sub_819EE08 +sub_819EE08: @ 819EE08 + push {r4,lr} + sub sp, 0x18 + ldr r0, =gUnknown_08610918 + add r1, sp, 0xC + movs r2, 0x4 + bl CpuSet + ldr r0, =gUnknown_03001284 + ldr r2, [r0] + ldrb r0, [r2, 0x15] + cmp r0, 0 + bne _0819EE3C + add r0, sp, 0xC + ldr r1, =gPlttBufferFaded + movs r2, 0xE4 + lsls r2, 1 + adds r1, r2 + ldrh r1, [r1] + strh r1, [r0, 0x8] + b _0819EE42 + .pool +_0819EE3C: + add r1, sp, 0xC + ldrh r0, [r2, 0x24] + strh r0, [r1, 0x8] +_0819EE42: + add r0, sp, 0xC + movs r1, 0xF0 + movs r2, 0xA + bl LoadPalette + movs r0, 0x7 + bl PutWindowTilemap + movs r0, 0x7 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldrb r0, [r1, 0x3] + cmp r0, 0x2 + bls _0819EE74 + movs r0, 0x7 + movs r1, 0x3 + bl CopyWindowToVram + b _0819EED8 + .pool +_0819EE74: + ldrb r2, [r1, 0x3] + ldrb r0, [r1, 0x14] + cmp r0, 0 + bne _0819EE88 + movs r0, 0x64 + muls r0, r2 + ldr r1, =gPlayerParty + b _0819EE8E + .pool +_0819EE88: + movs r0, 0x64 + muls r0, r2 + ldr r1, =gEnemyParty +_0819EE8E: + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl GetMonData + lsls r0, 16 + lsrs r1, r0, 16 + ldr r4, =gStringVar4 + movs r0, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + adds r0, r4, 0 + bl StringCopy + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x56 + bl GetStringRightAlignXOffset + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =gUnknown_08610925 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x7 + movs r1, 0x1 + movs r3, 0x1 + bl box_print + movs r0, 0x7 + movs r1, 0x3 + bl CopyWindowToVram +_0819EED8: + add sp, 0x18 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819EE08 + + thumb_func_start sub_819EEF0 +sub_819EEF0: @ 819EEF0 + push {r4,lr} + sub sp, 0xC + ldr r0, =gUnknown_08610918 + movs r1, 0xE0 + movs r2, 0xA + bl LoadPalette + ldr r0, =gPlttBufferUnfaded+ 0x1E0 + ldr r1, =gPlttBufferFaded + 0x1C0 + movs r2, 0x5 + bl CpuSet + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldrb r0, [r1, 0x3] + cmp r0, 0x2 + bls _0819EF2C + movs r0, 0x1 + movs r1, 0x2 + bl CopyWindowToVram + b _0819EF90 + .pool +_0819EF2C: + ldrb r2, [r1, 0x3] + ldrb r0, [r1, 0x14] + cmp r0, 0 + bne _0819EF40 + movs r0, 0x64 + muls r0, r2 + ldr r1, =gPlayerParty + b _0819EF46 + .pool +_0819EF40: + movs r0, 0x64 + muls r0, r2 + ldr r1, =gEnemyParty +_0819EF46: + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl GetMonData + lsls r0, 16 + lsrs r1, r0, 16 + ldr r4, =gStringVar4 + movs r0, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + adds r0, r4, 0 + bl StringCopy + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x56 + bl GetStringRightAlignXOffset + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =gUnknown_08610925 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0x1 + bl box_print + movs r0, 0x1 + movs r1, 0x3 + bl CopyWindowToVram +_0819EF90: + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819EEF0 + + thumb_func_start sub_819EFA8 +sub_819EFA8: @ 819EFA8 + push {r4-r6,lr} + sub sp, 0x2C + ldr r6, =gUnknown_03001284 + ldr r0, [r6] + ldrb r4, [r0, 0x3] + adds r5, r4, 0 + movs r0, 0x8 + movs r1, 0 + bl FillWindowPixelBuffer + cmp r4, 0x2 + bls _0819EFD0 + movs r0, 0x8 + movs r1, 0x2 + bl CopyWindowToVram + b _0819F03A + .pool +_0819EFD0: + movs r0, 0x8 + bl PutWindowTilemap + ldr r0, [r6] + ldrb r0, [r0, 0x14] + cmp r0, 0 + bne _0819EFEC + movs r0, 0x64 + muls r0, r4 + ldr r1, =gPlayerParty + b _0819EFF2 + .pool +_0819EFEC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty +_0819EFF2: + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + add r1, sp, 0xC + bl sub_81DB468 + movs r0, 0x1 + add r1, sp, 0xC + movs r2, 0x76 + bl GetStringRightAlignXOffset + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x8 + movs r1, 0x1 + add r2, sp, 0xC + bl Print + movs r0, 0x8 + movs r1, 0x2 + bl CopyWindowToVram +_0819F03A: + add sp, 0x2C + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819EFA8 + + thumb_func_start sub_819F048 +sub_819F048: @ 819F048 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r4, =gUnknown_03001284 + ldr r3, [r4] + ldrb r0, [r3, 0x15] + cmp r0, 0x1 + beq _0819F094 + cmp r2, 0 + beq _0819F068 + cmp r2, 0x1 + beq _0819F080 + b _0819F094 + .pool +_0819F068: + strb r2, [r3, 0x14] + ldr r0, [r4] + strb r2, [r0, 0x3] + ldr r1, [r4] + movs r0, 0x4 + strb r0, [r1, 0x17] + ldr r1, [r4] + ldr r0, =gUnknown_08610928 + b _0819F092 + .pool +_0819F080: + movs r1, 0 + strb r2, [r3, 0x14] + ldr r0, [r4] + strb r1, [r0, 0x3] + ldr r1, [r4] + movs r0, 0x5 + strb r0, [r1, 0x17] + ldr r1, [r4] + ldr r0, =gUnknown_08610948 +_0819F092: + str r0, [r1, 0x18] +_0819F094: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F048 + + thumb_func_start sub_819F0A0 +sub_819F0A0: @ 819F0A0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r3, =gUnknown_03001280 + ldr r2, =gUnknown_086108AC + ldr r1, =gUnknown_03001284 + ldr r1, [r1] + ldrb r1, [r1] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + str r1, [r3] + bl _call_via_r1 + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F0A0 + + thumb_func_start sub_819F0CC +sub_819F0CC: @ 819F0CC + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =gUnknown_03001284 + ldr r1, [r5] + ldr r0, [r1, 0x2C] + adds r1, 0x30 + movs r2, 0x1 + bl sub_819F3F8 + ldr r0, [r5] + ldrb r1, [r0, 0x3] + movs r5, 0 + strb r1, [r0, 0x12] + movs r0, 0x3 + bl sub_819EA64 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + strh r5, [r0, 0x8] + ldr r1, =sub_819D9EC + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F0CC + + thumb_func_start sub_819F114 +sub_819F114: @ 819F114 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0x6 + strh r0, [r1, 0x8] + ldr r0, =sub_819C90C + str r0, [r1] + bx lr + .pool + thumb_func_end sub_819F114 + + thumb_func_start sub_819F134 +sub_819F134: @ 819F134 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldr r0, [r1, 0x2C] + adds r1, 0x30 + movs r2, 0x1 + bl sub_819F3F8 + movs r0, 0x3 + bl sub_819EA64 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x8] + ldr r2, =sub_819CE40 + lsrs r1, r2, 16 + strh r1, [r0, 0x14] + strh r2, [r0, 0x16] + movs r1, 0x1 + strh r1, [r0, 0x12] + ldr r1, =sub_819D770 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F134 + + thumb_func_start sub_819F184 +sub_819F184: @ 819F184 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r3, =gUnknown_03001280 + ldr r1, =gUnknown_03001284 + ldr r2, [r1] + ldrb r1, [r2, 0x3] + ldr r2, [r2, 0x18] + lsls r1, 3 + adds r1, r2 + ldr r1, [r1, 0x4] + str r1, [r3] + bl _call_via_r1 + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F184 + + thumb_func_start sub_819F1AC +sub_819F1AC: @ 819F1AC + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r2, =sub_819CC24 + lsrs r0, r2, 16 + movs r3, 0 + strh r0, [r1, 0x14] + strh r2, [r1, 0x16] + strh r3, [r1, 0x8] + strh r3, [r1, 0x12] + ldr r0, =sub_819D588 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_819F1AC + + thumb_func_start sub_819F1DC +sub_819F1DC: @ 819F1DC + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r2, =sub_819D9EC + lsrs r0, r2, 16 + movs r3, 0 + strh r0, [r1, 0x14] + strh r2, [r1, 0x16] + strh r3, [r1, 0x12] + strh r3, [r1, 0x8] + ldr r0, =sub_819D588 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_819F1DC + + thumb_func_start sub_819F20C +sub_819F20C: @ 819F20C + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r5, =gUnknown_03001284 + ldr r1, [r5] + ldrb r0, [r1, 0x14] + cmp r0, 0 + bne _0819F240 + ldr r3, =gTasks + lsls r4, r6, 2 + adds r0, r4, r6 + lsls r0, 3 + adds r0, r3 + ldr r2, =sub_819CD34 + lsrs r1, r2, 16 + strh r1, [r0, 0x14] + strh r2, [r0, 0x16] + movs r1, 0x2 + strh r1, [r0, 0x12] + b _0819F292 + .pool +_0819F240: + ldrb r0, [r1, 0x3] + bl sub_819F59C + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bne _0819F278 + ldr r1, [r5] + adds r0, r1, 0 + adds r0, 0x2D + adds r1, 0x30 + movs r2, 0x1 + bl sub_819F2B4 + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x8] + strh r4, [r0, 0x12] + ldr r1, =sub_819F488 + b _0819F29E + .pool +_0819F278: + ldr r4, =gTasks + lsls r5, r6, 2 + adds r0, r5, r6 + lsls r0, 3 + adds r0, r4 + ldr r2, =sub_819CCD4 + lsrs r1, r2, 16 + movs r3, 0 + strh r1, [r0, 0x14] + strh r2, [r0, 0x16] + strh r3, [r0, 0x12] + adds r3, r4, 0 + adds r4, r5, 0 +_0819F292: + adds r0, r4, r6 + lsls r0, 3 + adds r0, r3 + movs r1, 0 + strh r1, [r0, 0x8] + ldr r1, =sub_819D588 +_0819F29E: + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F20C + + thumb_func_start sub_819F2B4 +sub_819F2B4: @ 819F2B4 + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r1, 0 + lsls r5, r2, 24 + lsrs r5, 24 + ldr r0, =gUnknown_08610894 + movs r1, 0x78 + movs r2, 0x40 + movs r3, 0x1 + bl CreateSprite + strb r0, [r4] + ldr r2, =gSprites + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r2, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_819F600 + str r1, [r0] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r5, [r0, 0x3C] + movs r0, 0x1 + strb r0, [r6] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F2B4 + + thumb_func_start sub_819F304 +sub_819F304: @ 819F304 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0x10 + ldr r0, =gUnknown_08610894 + movs r1, 0x78 + movs r2, 0x40 + movs r3, 0x1 + bl CreateSprite + ldr r6, =gUnknown_03001284 + ldr r1, [r6] + adds r1, 0x2D + movs r2, 0 + mov r10, r2 + strb r0, [r1] + ldr r0, [r6] + adds r0, 0x2D + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + mov r8, r1 + add r0, r8 + movs r1, 0x2 + bl StartSpriteAffineAnim + ldr r0, [r6] + ldrb r1, [r0, 0x3] + movs r0, 0x64 + adds r4, r1, 0 + muls r4, r0 + ldr r0, =gPlayerParty + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl GetMonData + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl GetMonData + mov r9, r0 + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + bl GetMonData + adds r2, r0, 0 + movs r0, 0x58 + str r0, [sp] + movs r0, 0x20 + str r0, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + ldr r0, =0x0000ffff + str r0, [sp, 0xC] + adds r0, r5, 0 + mov r1, r9 + movs r3, 0x1 + bl sub_818D7D8 + ldr r1, [r6] + adds r1, 0x2C + strb r0, [r1] + ldr r0, [r6] + adds r0, 0x2C + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + adds r0, 0x28 + mov r2, r10 + strb r2, [r0] + ldr r0, [r6] + adds r0, 0x2C + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + adds r0, 0x29 + strb r2, [r0] + ldr r0, [r6] + adds r0, 0x2D + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F304 + + thumb_func_start sub_819F3F8 +sub_819F3F8: @ 819F3F8 + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r1, 0 + lsls r5, r2, 24 + lsrs r5, 24 + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_818D820 + ldr r0, =sub_819F7B4 + movs r1, 0x1 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r5, [r1, 0x16] + lsrs r4, 8 + lsls r4, 24 + lsrs r4, 24 + strh r4, [r1, 0x14] + ldr r1, [r1] + bl _call_via_r1 + movs r0, 0x1 + strb r0, [r6] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F3F8 + + thumb_func_start sub_819F444 +sub_819F444: @ 819F444 + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r1, 0 + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_818D820 + ldr r5, =gSprites + lsls r4, 16 + lsrs r1, r4, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrb r0, [r0, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl FreeOamMatrix + lsrs r4, 24 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r5 + bl DestroySprite + movs r0, 0 + strb r0, [r6] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F444 + + thumb_func_start sub_819F488 +sub_819F488: @ 819F488 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_03001284 + ldr r0, [r1] + adds r0, 0x30 + ldrb r0, [r0] + adds r3, r1, 0 + cmp r0, 0x1 + beq _0819F58A + ldr r2, =gTasks + lsls r1, r4, 2 + adds r0, r1, r4 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r5, r1, 0 + cmp r0, 0x4 + bhi _0819F58A + lsls r0, 2 + ldr r1, =_0819F4C8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0819F4C8: + .4byte _0819F4DC + .4byte _0819F4F8 + .4byte _0819F52C + .4byte _0819F548 + .4byte _0819F568 +_0819F4DC: + ldr r0, =gUnknown_085EED0A + bl sub_819EBEC + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r0, 0x20 + movs r1, 0 + strb r1, [r0] + b _0819F54E + .pool +_0819F4F8: + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0819F50C + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0819F58A +_0819F50C: + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldr r0, [r1, 0x2C] + adds r1, 0x30 + movs r2, 0x1 + bl sub_819F3F8 + b _0819F54E + .pool +_0819F52C: + ldr r0, [r3] + adds r0, 0x30 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0819F58A + movs r0, 0x5 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x5 + movs r1, 0x2 + bl CopyWindowToVram + b _0819F54E +_0819F548: + ldr r0, =gUnknown_085EEC8B + bl sub_819EBEC +_0819F54E: + ldr r0, =gTasks + adds r1, r5, r4 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0819F58A + .pool +_0819F568: + bl sub_819EEF0 + bl sub_819EADC + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r0, 0x22 + movs r1, 0x1 + strb r1, [r0] + ldr r1, =gTasks + adds r0, r5, r4 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x12] + strh r1, [r0, 0x8] + ldr r1, =sub_819CE40 + str r1, [r0] +_0819F58A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F488 + + thumb_func_start sub_819F59C +sub_819F59C: @ 819F59C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl GetMonData + lsls r0, 16 + lsrs r5, r0, 16 + movs r4, 0 +_0819F5B8: + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + ldrb r0, [r0, 0x12] + cmp r4, r0 + beq _0819F5EC + movs r0, 0x64 + muls r0, r4 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + cmp r0, r5 + bne _0819F5EC + movs r0, 0x1 + b _0819F5F8 + .pool +_0819F5EC: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _0819F5B8 + movs r0, 0 +_0819F5F8: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_819F59C + + thumb_func_start sub_819F600 +sub_819F600: @ 819F600 + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0819F640 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, =sub_819F69C + movs r1, 0x1 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrh r2, [r4, 0x3C] + strh r2, [r1, 0x16] + ldr r1, [r1] + bl _call_via_r1 + ldr r0, =SpriteCallbackDummy + str r0, [r4, 0x1C] +_0819F640: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F600 + + thumb_func_start sub_819F654 +sub_819F654: @ 819F654 + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0819F694 + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl FreeOamMatrix + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _0819F688 + ldr r0, =gUnknown_03001284 + ldr r0, [r0] + adds r0, 0x30 + movs r1, 0 + strb r1, [r0] + b _0819F68E + .pool +_0819F688: + movs r0, 0 + bl sub_819BE20 +_0819F68E: + adds r0, r4, 0 + bl DestroySprite +_0819F694: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_819F654 + + thumb_func_start sub_819F69C +sub_819F69C: @ 819F69C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =gTasks + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0819F71A + cmp r0, 0x1 + bgt _0819F6C4 + cmp r0, 0 + beq _0819F6CA + b _0819F77C + .pool +_0819F6C4: + cmp r0, 0x2 + beq _0819F73C + b _0819F77C +_0819F6CA: + movs r0, 0x58 + strh r0, [r4, 0xE] + movs r0, 0x98 + strh r0, [r4, 0x38] + movs r0, 0x40 + strh r0, [r4, 0x12] + movs r0, 0x41 + strh r0, [r4, 0x18] + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl SetGpuRegBits + ldrh r1, [r4, 0xE] + lsls r1, 8 + ldrh r0, [r4, 0x38] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x40 + bl SetGpuReg + ldrh r1, [r4, 0x12] + lsls r1, 8 + ldrh r0, [r4, 0x18] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0x3F + bl SetGpuReg + movs r0, 0x4A + movs r1, 0x37 + bl SetGpuReg + b _0819F7A6 +_0819F71A: + movs r0, 0x3 + bl ShowBg + ldr r1, =0x00001248 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x0000040b + movs r0, 0x52 + bl SetGpuReg + b _0819F7A6 + .pool +_0819F73C: + ldrh r0, [r4, 0x12] + subs r0, 0x4 + strh r0, [r4, 0x12] + ldrh r1, [r4, 0x18] + adds r1, 0x4 + strh r1, [r4, 0x18] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x20 + ble _0819F758 + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x5F + ble _0819F760 +_0819F758: + movs r0, 0x20 + strh r0, [r4, 0x12] + movs r0, 0x60 + strh r0, [r4, 0x18] +_0819F760: + ldrh r1, [r4, 0x12] + lsls r1, 8 + ldrh r0, [r4, 0x18] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl SetGpuReg + movs r2, 0x12 + ldrsh r0, [r4, r2] + cmp r0, 0x20 + bne _0819F7AC + b _0819F7A6 +_0819F77C: + adds r0, r5, 0 + bl DestroyTask + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + movs r2, 0x16 + ldrsh r0, [r1, r2] + cmp r0, 0x1 + bne _0819F7A0 + bl sub_819F8E0 + b _0819F7AC + .pool +_0819F7A0: + bl sub_819BD70 + b _0819F7AC +_0819F7A6: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0819F7AC: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_819F69C + + thumb_func_start sub_819F7B4 +sub_819F7B4: @ 819F7B4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =gTasks + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0819F844 + cmp r0, 0x1 + beq _0819F894 + movs r0, 0x3 + bl HideBg + ldr r3, =gSprites + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r4, 0x16] + strh r1, [r0, 0x3C] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r3, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_819F654 + str r1, [r0] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0x1 + bl StartSpriteAffineAnim + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl ClearGpuRegBits + adds r0, r5, 0 + bl DestroyTask + b _0819F8D8 + .pool +_0819F844: + movs r0, 0x58 + strh r0, [r4, 0xE] + movs r0, 0x98 + strh r0, [r4, 0x38] + movs r0, 0x20 + strh r0, [r4, 0x12] + movs r0, 0x60 + strh r0, [r4, 0x18] + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl SetGpuRegBits + ldrh r1, [r4, 0xE] + lsls r1, 8 + ldrh r0, [r4, 0x38] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x40 + bl SetGpuReg + ldrh r1, [r4, 0x12] + lsls r1, 8 + ldrh r0, [r4, 0x18] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0x3F + bl SetGpuReg + movs r0, 0x4A + movs r1, 0x37 + bl SetGpuReg + b _0819F8D2 +_0819F894: + ldrh r0, [r4, 0x12] + adds r0, 0x4 + strh r0, [r4, 0x12] + ldrh r1, [r4, 0x18] + subs r1, 0x4 + strh r1, [r4, 0x18] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3F + bgt _0819F8B0 + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x41 + bgt _0819F8B8 +_0819F8B0: + movs r0, 0x40 + strh r0, [r4, 0x12] + movs r0, 0x41 + strh r0, [r4, 0x18] +_0819F8B8: + ldrh r1, [r4, 0x12] + lsls r1, 8 + ldrh r0, [r4, 0x18] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl SetGpuReg + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0x40 + bne _0819F8D8 +_0819F8D2: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0819F8D8: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_819F7B4 + + thumb_func_start sub_819F8E0 +sub_819F8E0: @ 819F8E0 + push {r4-r6,lr} + sub sp, 0x10 + ldr r0, =gUnknown_03001284 + ldr r1, [r0] + ldrb r0, [r1, 0x14] + cmp r0, 0 + bne _0819F900 + ldrb r1, [r1, 0x3] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + b _0819F908 + .pool +_0819F900: + ldrb r1, [r1, 0x3] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gEnemyParty +_0819F908: + adds r6, r1, r0 + adds r0, r6, 0 + movs r1, 0xB + movs r2, 0 + bl GetMonData + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r6, 0 + movs r1, 0 + movs r2, 0 + bl GetMonData + adds r5, r0, 0 + adds r0, r6, 0 + movs r1, 0x1 + movs r2, 0 + bl GetMonData + adds r1, r0, 0 + movs r0, 0x58 + str r0, [sp] + movs r0, 0x20 + str r0, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + ldr r0, =0x0000ffff + str r0, [sp, 0xC] + adds r0, r4, 0 + adds r2, r5, 0 + movs r3, 0x1 + bl sub_818D7D8 + ldr r2, =gUnknown_03001284 + ldr r1, [r2] + adds r1, 0x2C + movs r3, 0 + strb r0, [r1] + ldr r4, =gSprites + ldr r0, [r2] + adds r0, 0x2C + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x28 + strb r3, [r0] + ldr r0, [r2] + adds r0, 0x2C + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x29 + strb r3, [r0] + ldr r0, [r2] + adds r0, 0x30 + strb r3, [r0] + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F8E0 + + thumb_func_start sub_819F99C +sub_819F99C: @ 819F99C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r2, =gSaveBlock2Ptr + ldr r1, [r2] + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r1, r0 + adds r1, 0xDE + ldrb r1, [r1] + movs r6, 0 + adds r7, r2, 0 + ldr r0, =gStringVar1 + mov r8, r0 + cmp r1, 0 + beq _0819F9DC +_0819F9C2: + adds r0, r1, 0 + movs r1, 0xA + bl __udivsi3 + lsls r0, 24 + lsrs r1, r0, 24 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r1, 0 + beq _0819F9DC + cmp r6, 0x3 + bls _0819F9C2 +_0819F9DC: + lsls r4, r5, 4 + adds r4, r5 + lsls r4, 2 + ldr r1, [r7] + adds r1, r4, r1 + movs r0, 0x8A + lsls r0, 1 + adds r1, r0 + mov r0, r8 + bl StringCopy7 + ldr r0, [r7] + adds r0, r4 + ldr r1, =0x0000011b + adds r0, r1 + ldrb r1, [r0] + mov r0, r8 + bl ConvertInternationalString + ldr r0, =gStringVar2 + ldr r1, [r7] + adds r1, r4 + adds r1, 0xDE + ldrb r1, [r1] + movs r2, 0x1 + adds r3, r6, 0 + bl ConvertIntToDecimalStringN + ldr r1, =gUnknown_08611330 + ldr r0, [r7] + adds r0, r4 + adds r0, 0xDC + ldrb r0, [r0] + lsls r0, 27 + lsrs r0, 25 + adds r0, r1 + ldr r1, [r0] + ldr r0, =gStringVar4 + bl StringExpandPlaceholders + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819F99C + + thumb_func_start sub_819FA50 +sub_819FA50: @ 819FA50 + push {lr} + bl script_env_2_enable_and_set_ctx_running + pop {r0} + bx r0 + thumb_func_end sub_819FA50 + + thumb_func_start sub_819FA5C +sub_819FA5C: @ 819FA5C + push {r4,r5,lr} + adds r3, r0, 0 + movs r2, 0 + adds r4, r3, 0 + adds r4, 0x28 + ldr r0, =0x0000ffff + adds r5, r0, 0 +_0819FA6A: + lsls r0, r2, 1 + adds r0, r4, r0 + ldrh r1, [r0] + orrs r1, r5 + strh r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x5 + bls _0819FA6A + adds r1, r3, 0 + adds r1, 0x38 + movs r0, 0xFF + strb r0, [r1] + ldrb r1, [r3] + movs r0, 0x20 + negs r0, r0 + ands r0, r1 + movs r1, 0x10 + orrs r0, r1 + strb r0, [r3] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819FA5C + + thumb_func_start sub_819FAA0 +sub_819FAA0: @ 819FAA0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r3, =gSaveBlock2Ptr + ldr r1, [r3] + adds r1, 0xB2 + ldrb r2, [r1] + movs r0, 0x19 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + movs r0, 0 + mov r12, r0 + adds r5, r3, 0 + mov r8, r0 + ldr r1, =0x0000ffff + mov r10, r1 +_0819FAC6: + movs r2, 0 + mov r3, r12 + lsls r7, r3, 4 + movs r4, 0x1 + add r4, r12 + mov r9, r4 + adds r0, r7, r3 + lsls r3, r0, 2 +_0819FAD6: + ldr r1, [r5] + lsls r0, r2, 1 + adds r0, r3 + movs r4, 0x82 + lsls r4, 1 + adds r1, r4 + adds r1, r0 + ldrh r0, [r1] + mov r4, r10 + orrs r0, r4 + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x5 + bls _0819FAD6 + ldr r2, [r5] + mov r0, r12 + adds r3, r7, r0 + lsls r3, 2 + adds r2, r3 + adds r2, 0xDC + ldrb r1, [r2] + movs r0, 0x20 + negs r0, r0 + ands r0, r1 + movs r1, 0x10 + orrs r0, r1 + strb r0, [r2] + ldr r0, [r5] + adds r0, r3 + movs r1, 0x8A + lsls r1, 1 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldr r1, [r5] + adds r1, r3 + adds r1, 0xDC + ldrb r2, [r1] + movs r0, 0x61 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r0, [r5] + adds r0, r3 + adds r0, 0xDE + mov r4, r8 + strb r4, [r0] + ldr r0, [r5] + adds r0, r3 + adds r0, 0xDD + strb r4, [r0] + movs r2, 0 + ldr r6, =gSaveBlock2Ptr + movs r4, 0x88 + lsls r4, 1 +_0819FB48: + ldr r0, [r6] + adds r1, r2, r3 + adds r0, r4 + adds r0, r1 + mov r1, r8 + strb r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bls _0819FB48 + ldr r0, [r5] + mov r3, r12 + adds r2, r7, r3 + lsls r2, 2 + adds r0, r2 + ldr r4, =gGameLanguage + ldrb r1, [r4] + ldr r3, =0x0000011b + adds r0, r3 + strb r1, [r0] + ldr r0, [r5] + movs r4, 0x8E + lsls r4, 1 + adds r0, r4 + adds r0, r2 + mov r1, r8 + str r1, [r0] + mov r3, r9 + lsls r0, r3, 24 + lsrs r0, 24 + mov r12, r0 + cmp r0, 0x3 + bls _0819FAC6 + bl sub_81A087C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819FAA0 + + thumb_func_start sub_819FBB0 +sub_819FBB0: @ 819FBB0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB1 + ldrb r0, [r0] + movs r1, 0x3 + ands r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + bx lr + .pool + thumb_func_end sub_819FBB0 + + thumb_func_start sub_819FBC8 +sub_819FBC8: @ 819FBC8 + push {r4,r5,lr} + ldr r2, =gSaveBlock2Ptr + ldr r0, [r2] + adds r0, 0xDE + ldrb r0, [r0] + cmp r0, 0 + bne _0819FC10 + adds r4, r2, 0 + ldr r5, =gUnknown_08611548 +_0819FBDA: + bl Random + ldr r2, [r4] + lsls r0, 16 + movs r1, 0xE0 + lsls r1, 11 + ands r1, r0 + lsrs r1, 16 + adds r1, r5 + ldrb r0, [r1] + adds r2, 0xB0 + strb r0, [r2] + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0xB0 + adds r0, 0xDC + ldrb r0, [r0] + lsls r0, 27 + ldrb r1, [r1] + lsrs r0, 27 + cmp r1, r0 + beq _0819FBDA + b _0819FC38 + .pool +_0819FC10: + adds r4, r2, 0 +_0819FC12: + bl Random + ldr r2, [r4] + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xF + ands r0, r1 + adds r2, 0xB0 + strb r0, [r2] + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0xB0 + adds r0, 0xDC + ldrb r0, [r0] + lsls r0, 27 + ldrb r1, [r1] + lsrs r0, 27 + cmp r1, r0 + beq _0819FC12 +_0819FC38: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_819FBC8 + + thumb_func_start sub_819FC40 +sub_819FC40: @ 819FC40 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gSaveBlock2Ptr + ldr r2, [r1] + adds r2, 0xB1 + movs r1, 0x3 + ands r0, r1 + ldrb r3, [r2] + subs r1, 0x7 + ands r1, r3 + orrs r1, r0 + strb r1, [r2] + bx lr + .pool + thumb_func_end sub_819FC40 + + thumb_func_start sub_819FC60 +sub_819FC60: @ 819FC60 + push {r4-r7,lr} + sub sp, 0xC + movs r5, 0 +_0819FC66: + mov r1, sp + adds r0, r1, r5 + strb r5, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x9 + bls _0819FC66 + movs r5, 0 +_0819FC78: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + mov r7, sp + adds r2, r7, r4 + ldrb r3, [r2] + adds r1, r7, r0 + ldrb r0, [r1] + strb r0, [r2] + strb r3, [r1] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x31 + bls _0819FC78 + movs r5, 0 + ldr r6, =gSaveBlock2Ptr + movs r4, 0xF +_0819FCBC: + ldr r3, [r6] + adds r3, 0xB4 + adds r3, r5 + lsls r2, r5, 1 + mov r1, sp + adds r0, r1, r2 + ldrb r0, [r0] + adds r1, r4, 0 + ands r1, r0 + lsls r1, 4 + adds r2, 0x1 + mov r7, sp + adds r0, r7, r2 + ldrb r2, [r0] + adds r0, r4, 0 + ands r0, r2 + orrs r1, r0 + strb r1, [r3] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _0819FCBC + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819FC60 + + thumb_func_start sub_819FCF8 +sub_819FCF8: @ 819FCF8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + movs r5, 0 + cmp r0, 0x2 + bne _0819FD4C + ldr r6, =gUnknown_030062EC +_0819FD06: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r5, r0, 24 + movs r3, 0 + movs r2, 0 + ldr r1, [r6] + lsls r0, r5, 2 + adds r0, r5 + lsls r4, r0, 1 + adds r1, 0x2 +_0819FD26: + lsls r0, r2, 1 + adds r0, r4 + adds r0, r1, r0 + ldrh r0, [r0] + cmp r0, 0 + beq _0819FD38 + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 +_0819FD38: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x4 + bls _0819FD26 + cmp r3, 0x3 + bhi _0819FD06 + b _0819FD5A + .pool +_0819FD4C: + cmp r0, 0x1 + bne _0819FD5A + ldrb r0, [r2] + adds r1, r0 + ldrb r5, [r1] + adds r0, 0x1 + strb r0, [r2] +_0819FD5A: + adds r0, r5, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_819FCF8 + + thumb_func_start sub_819FD64 +sub_819FD64: @ 819FD64 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + movs r5, 0 + mov r0, sp + adds r0, 0xC + str r0, [sp, 0x14] + mov r1, sp + adds r1, 0x10 + str r1, [sp, 0x18] + adds r1, r0, 0 +_0819FD80: + adds r0, r1, r5 + strb r5, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _0819FD80 + movs r5, 0 + ldr r6, [sp, 0x14] +_0819FD92: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r4, r0, 24 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + adds r2, r6, r4 + ldrb r3, [r2] + adds r1, r6, r0 + ldrb r0, [r1] + strb r0, [r2] + strb r3, [r1] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x9 + bls _0819FD92 + movs r5, 0 + ldr r2, =gUnknown_086114D3 +_0819FDD0: + mov r4, sp + adds r1, r4, r5 + adds r0, r5, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x9 + bls _0819FDD0 + movs r5, 0 +_0819FDE6: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 24 + lsrs r4, r0, 24 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + mov r6, sp + adds r2, r6, r4 + ldrb r3, [r2] + adds r1, r6, r0 + ldrb r0, [r1] + strb r0, [r2] + strb r3, [r1] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x31 + bls _0819FDE6 + ldr r4, =gUnknown_030062EC + movs r0, 0x30 + bl AllocZeroed + str r0, [r4] + movs r1, 0 + strb r1, [r0] + movs r5, 0 + movs r2, 0x4 +_0819FE34: + movs r3, 0 +_0819FE36: + ldr r0, [r4] + lsls r1, r3, 2 + adds r1, r3 + adds r1, r5, r1 + adds r0, 0x20 + adds r0, r1 + strb r2, [r0] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x2 + bls _0819FE36 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x4 + bls _0819FE34 + movs r0, 0 + ldr r7, [sp, 0x18] + strb r0, [r7] + movs r5, 0 +_0819FE60: + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + lsls r4, r5, 2 + adds r3, r4 + mov r1, sp + adds r6, r1, r5 + ldrb r0, [r6] + adds r3, 0xB8 + movs r2, 0x3 + ands r2, r0 + ldrb r0, [r3] + movs r7, 0x4 + negs r7, r7 + adds r1, r7, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r3] + ldrb r0, [r6] + adds r5, 0x1 + str r5, [sp, 0x1C] + mov r8, r4 + cmp r0, 0x3 + beq _0819FF62 + ldrb r0, [r6] + ldr r1, [sp, 0x14] + ldr r2, [sp, 0x18] + bl sub_819FCF8 + ldr r1, =gSaveBlock2Ptr + ldr r3, [r1] + add r3, r8 + adds r3, 0xB8 + movs r2, 0x3 + ands r2, r0 + lsls r2, 2 + ldrb r0, [r3] + movs r4, 0xD + negs r4, r4 + adds r1, r4, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r3] + ldr r7, =gSaveBlock2Ptr + ldr r0, [r7] + add r0, r8 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 28 + lsrs r7, r0, 30 + ldrb r0, [r6] + cmp r0, 0x2 + bne _0819FF62 + lsls r0, r7, 2 + adds r0, r7 + mov r10, r0 + ldr r0, =gUnknown_030062EC + mov r9, r0 +_0819FED2: + bl Random + lsls r0, 16 + lsrs r4, r0, 16 + movs r1, 0x3 + ands r4, r1 + movs r3, 0 + mov r6, r9 + ldr r2, [r6] + ldrb r0, [r2] + adds r1, r0, 0x1 + lsls r5, r7, 2 + cmp r3, r1 + bge _0819FF12 + adds r2, 0x20 + mov r6, r10 + adds r0, r2, r6 + ldrb r0, [r0] + cmp r0, r4 + beq _0819FF12 + adds r6, r1, 0 + adds r1, r5, r7 +_0819FEFE: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r6 + bge _0819FF12 + adds r0, r3, r1 + adds r0, r2, r0 + ldrb r0, [r0] + cmp r0, r4 + bne _0819FEFE +_0819FF12: + mov r1, r9 + ldr r0, [r1] + ldrb r0, [r0] + adds r0, 0x1 + ldr r1, =gUnknown_030062EC + cmp r3, r0 + bne _0819FED2 + ldr r0, [r1] + orrs r5, r7 + ldrb r2, [r0] + adds r1, r5, r2 + adds r0, 0x20 + adds r0, r1 + strb r4, [r0] + ldr r6, =gSaveBlock2Ptr + ldr r2, [r6] + add r2, r8 + adds r2, 0xB8 + movs r7, 0x3 + ands r4, r7 + lsls r3, r4, 4 + ldrb r0, [r2] + movs r4, 0x31 + negs r4, r4 + adds r1, r4, 0 + ands r0, r1 + orrs r0, r3 + strb r0, [r2] + ldr r0, [r6] + add r0, r8 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 28 + lsrs r0, 30 + bl sub_819FF98 + ldr r1, [r6] + add r1, r8 + adds r1, 0xBA + strh r0, [r1] +_0819FF62: + ldr r6, [sp, 0x1C] + lsls r0, r6, 24 + lsrs r5, r0, 24 + cmp r5, 0x8 + bhi _0819FF6E + b _0819FE60 +_0819FF6E: + ldr r4, =gUnknown_030062EC + ldr r0, [r4] + bl Free + movs r0, 0 + str r0, [r4] + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_819FD64 + + thumb_func_start sub_819FF98 +sub_819FF98: @ 819FF98 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0xC] + movs r7, 0 + ldr r1, [sp] + cmp r1, 0x2 + bhi _0819FFE0 + ldr r2, =gSaveBlock2Ptr + ldr r1, [r2] + adds r0, r1, 0 + adds r0, 0xB4 + ldr r3, [sp] + adds r0, r3 + ldrb r4, [r0] + adds r1, 0xB2 + ldrb r0, [r1] + lsls r0, 29 + lsrs r0, 29 + asrs r0, r3 + movs r1, 0x1 + ands r0, r1 + lsls r0, 2 + asrs r4, r0 + movs r0, 0xF + ands r4, r0 + b _0819FFE4 + .pool +_0819FFE0: + movs r4, 0 + ldr r2, =gSaveBlock2Ptr +_0819FFE4: + ldr r3, =gUnknown_08610970 + lsls r1, r4, 1 + ldr r4, [r2] + adds r0, r4, 0 + adds r0, 0xB0 + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, r0 + adds r3, 0x34 + adds r1, r3 + ldrh r1, [r1] + str r1, [sp, 0x8] + ldr r1, =gLevelUpLearnsetPointers + ldr r2, [sp, 0x8] + lsls r0, r2, 2 + adds r0, r1 + ldr r6, [r0] + movs r3, 0 + adds r4, 0xB1 + ldrb r1, [r4] + movs r0, 0x3 + ands r0, r1 + movs r5, 0x3C + cmp r0, 0x1 + bne _081A001A + movs r5, 0x32 +_081A001A: + ldrh r1, [r6] + ldr r4, =0x0000ffff + cmp r1, r4 + beq _081A004C + movs r2, 0xFE + lsls r2, 8 + adds r0, r2, 0 + ands r0, r1 + lsls r1, r5, 9 + cmp r0, r1 + bgt _081A004C + adds r5, r2, 0 + adds r2, r1, 0 +_081A0034: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + lsls r0, r3, 1 + adds r0, r6 + ldrh r1, [r0] + cmp r1, r4 + beq _081A004C + adds r0, r5, 0 + ands r0, r1 + cmp r0, r2 + ble _081A0034 +_081A004C: + adds r5, r3, 0 + movs r3, 0 + str r3, [sp, 0x4] +_081A0052: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081A0068 + ldr r0, [sp, 0xC] + cmp r0, 0x1 + bne _081A00E0 +_081A0068: + ldr r1, =0x000001ff + mov r8, r1 +_081A006C: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3A + bl __umodsi3 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, [sp, 0x8] + adds r1, r4, 0 + bl sub_806E064 + adds r2, r0, 0 + cmp r2, 0 + beq _081A006C + ldr r2, =0x00000121 + adds r0, r4, r2 + bl ItemIdToBattleMoveId + lsls r0, 16 + lsrs r7, r0, 16 + movs r2, 0x1 + cmp r5, 0x4 + bhi _081A00BC + movs r3, 0 + b _081A00C6 + .pool +_081A00BC: + subs r0, r5, 0x4 + b _081A00C2 +_081A00C0: + adds r0, r3, 0x1 +_081A00C2: + lsls r0, 24 + lsrs r3, r0, 24 +_081A00C6: + cmp r3, r5 + bcs _081A00DA + lsls r0, r3, 1 + adds r0, r6 + ldrh r0, [r0] + mov r1, r8 + ands r0, r1 + cmp r0, r7 + bne _081A00C0 + movs r2, 0 +_081A00DA: + cmp r2, 0x1 + bne _081A006C + b _081A0146 +_081A00E0: + cmp r5, 0x4 + bhi _081A00EA + movs r2, 0x1 + str r2, [sp, 0xC] + b _081A0168 +_081A00EA: + subs r4, r5, 0x4 + ldr r3, =0x000001ff + mov r10, r3 + mov r8, r3 + lsls r0, r4, 24 + mov r9, r0 +_081A00F6: + bl Random + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl __modsi3 + lsls r0, 24 + lsrs r0, 23 + adds r0, r6 + ldrh r0, [r0] + mov r7, r8 + ands r7, r0 + movs r2, 0x1 + mov r1, r9 + lsrs r3, r1, 24 + cmp r3, r5 + bcs _081A0142 + lsls r0, r3, 1 + adds r0, r6 + ldrh r1, [r0] + mov r0, r8 + b _081A013A + .pool +_081A0128: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r5 + bcs _081A0142 + lsls r0, r3, 1 + adds r0, r6 + ldrh r0, [r0] + mov r1, r10 +_081A013A: + ands r0, r1 + cmp r0, r7 + bne _081A0128 + movs r2, 0 +_081A0142: + cmp r2, 0x1 + bne _081A00F6 +_081A0146: + ldr r0, [sp] + adds r1, r7, 0 + bl sub_81A0194 + lsls r0, 24 + cmp r0, 0 + beq _081A0168 + ldr r0, =gUnknown_08611370 + adds r0, r7, r0 + ldrb r0, [r0] + cmp r0, 0 + bne _081A0170 + ldr r0, [sp, 0x4] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] +_081A0168: + ldr r2, [sp, 0x4] + cmp r2, 0x4 + bhi _081A0170 + b _081A0052 +_081A0170: + ldr r0, =gUnknown_030062EC + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + adds r0, r7, 0 + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_819FF98 + + thumb_func_start sub_81A0194 +sub_81A0194: @ 81A0194 + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 16 + lsrs r5, r1, 16 + movs r3, 0 + ldr r0, =gUnknown_030062EC + mov r12, r0 + ldr r2, [r0] + lsls r1, r4, 2 + adds r0, r1, r4 + lsls r6, r0, 1 + adds r2, 0x2 + adds r7, r1, 0 +_081A01B0: + lsls r0, r3, 1 + adds r0, r6 + adds r0, r2, r0 + ldrh r0, [r0] + cmp r0, r5 + bne _081A01C4 + movs r0, 0 + b _081A01E2 + .pool +_081A01C4: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x4 + bls _081A01B0 + mov r2, r12 + ldr r1, [r2] + adds r0, r7, r4 + ldrb r2, [r1] + adds r0, r2 + lsls r0, 1 + adds r1, 0x2 + adds r1, r0 + strh r5, [r1] + movs r0, 0x1 +_081A01E2: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81A0194 + + thumb_func_start sub_81A01E8 +sub_81A01E8: @ 81A01E8 + push {r4-r7,lr} + mov r12, r1 + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB1 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + movs r4, 0x3C + cmp r0, 0x1 + bne _081A0204 + movs r4, 0x32 +_081A0204: + ldr r1, =gLevelUpLearnsetPointers + lsls r0, r2, 2 + adds r0, r1 + ldr r6, [r0] + movs r5, 0 + ldrh r1, [r6] + ldr r3, =0x0000ffff + cmp r1, r3 + beq _081A0240 + movs r2, 0xFE + lsls r2, 8 + adds r0, r2, 0 + ands r0, r1 + lsls r1, r4, 9 + cmp r0, r1 + bgt _081A0240 + adds r4, r2, 0 + adds r2, r1, 0 +_081A0228: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 1 + adds r0, r6 + ldrh r1, [r0] + cmp r1, r3 + beq _081A0240 + adds r0, r4, 0 + ands r0, r1 + cmp r0, r2 + ble _081A0228 +_081A0240: + adds r4, r5, 0 + cmp r4, 0x4 + bls _081A0248 + movs r4, 0x4 +_081A0248: + movs r2, 0 + cmp r2, r4 + bcs _081A026C + ldr r7, =0x000001ff +_081A0250: + lsls r3, r2, 1 + add r3, r12 + adds r2, 0x1 + subs r0, r5, r2 + lsls r0, 1 + adds r0, r6 + ldrh r1, [r0] + adds r0, r7, 0 + ands r0, r1 + strh r0, [r3] + lsls r2, 24 + lsrs r2, 24 + cmp r2, r4 + bcc _081A0250 +_081A026C: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A01E8 + + thumb_func_start sub_81A0284 +sub_81A0284: @ 81A0284 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r5, r2, 24 + ldr r1, =gSaveBlock2Ptr + ldr r2, [r1] + adds r0, r2, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + adds r7, r1, 0 + cmp r0, 0x2 + bhi _081A02B8 + movs r0, 0 + b _081A037C + .pool +_081A02B8: + movs r4, 0 + movs r3, 0 + adds r0, r2, 0 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + ldr r1, =gUnknown_08610970 + mov r12, r1 + lsls r6, 1 + lsls r5, 1 + mov r9, r5 + cmp r0, 0 + beq _081A02F4 + adds r2, r7, 0 +_081A02D4: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x8 + bhi _081A02F4 + ldr r0, [r2] + lsls r1, r3, 2 + adds r0, r1 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + cmp r0, 0 + bne _081A02D4 +_081A02F4: + ldr r0, [r7] + adds r0, 0xB0 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r6, r0 + mov r1, r12 + adds r1, 0x34 + adds r0, r1 + ldrh r0, [r0] + mov r1, sp + bl sub_81A01E8 + movs r3, 0 + cmp r3, r4 + bcs _081A0376 + ldr r1, [r7] + adds r0, r1, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + cmp r3, r0 + bge _081A0376 + adds r6, r7, 0 + adds r5, r1, 0 +_081A032A: + lsls r0, r3, 2 + adds r2, r5, r0 + adds r0, r2, 0 + adds r0, 0xB8 + ldrb r1, [r0] + lsls r0, r1, 30 + lsrs r0, 30 + cmp r0, 0x2 + bne _081A035C + lsls r0, r1, 28 + lsrs r0, 30 + cmp r0, r8 + bne _081A035C + lsrs r0, r1, 6 + cmp r0, 0 + beq _081A035C + lsls r0, r1, 26 + lsrs r0, 30 + lsls r0, 1 + mov r7, sp + adds r1, r7, r0 + adds r0, r2, 0 + adds r0, 0xBA + ldrh r0, [r0] + strh r0, [r1] +_081A035C: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r4 + bcs _081A0376 + ldr r0, [r6] + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + cmp r3, r0 + blt _081A032A +_081A0376: + mov r0, sp + add r0, r9 + ldrh r0, [r0] +_081A037C: + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A0284 + + thumb_func_start sub_81A0390 +sub_81A0390: @ 81A0390 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r5, 0 + ldr r7, =gSaveBlock2Ptr + adds r6, r7, 0 + movs r4, 0 +_081A03A6: + ldr r0, [r6] + lsls r2, r5, 1 + adds r2, r5 + lsls r2, 2 + adds r0, r2 + adds r1, r0, 0 + adds r1, 0xE0 + strh r4, [r1] + adds r0, 0xEA + strh r4, [r0] + movs r3, 0 +_081A03BC: + ldr r0, [r6] + lsls r1, r3, 1 + adds r1, r2 + adds r0, 0xE2 + adds r0, r1 + strh r4, [r0] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x3 + bls _081A03BC + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _081A03A6 + ldr r0, [r7] + adds r0, 0xB1 + ldrb r0, [r0] + lsrs r3, r0, 6 + movs r5, 0 +_081A03E6: + lsls r0, r3, 2 + mov r1, sp + adds r2, r1, r0 + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r0, 0xE0 + ldr r1, [r7] + adds r1, r0 + str r1, [r2] + adds r0, r3, 0x1 + movs r1, 0x3 + bl __modsi3 + lsls r0, 24 + lsrs r3, r0, 24 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _081A03E6 + movs r5, 0 + ldr r7, =gSaveBlock2Ptr + ldr r6, =gUnknown_086109A4 +_081A0416: + ldr r0, [r7] + mov r12, r0 + adds r0, 0xB4 + adds r0, r5 + ldrb r2, [r0] + mov r0, r12 + adds r0, 0xB2 + ldrb r0, [r0] + lsls r0, 29 + lsrs r0, 29 + asrs r0, r5 + movs r1, 0x1 + ands r0, r1 + lsls r0, 2 + asrs r2, r0 + movs r0, 0xF + ands r2, r0 + lsls r0, r5, 2 + mov r1, sp + adds r3, r1, r0 + ldr r4, [r3] + lsls r2, 1 + mov r0, r12 + adds r0, 0xB0 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r2, r0 + adds r2, r6 + ldrh r0, [r2] + strh r0, [r4] + ldr r1, [r3] + ldrh r0, [r1] + adds r1, 0x2 + bl sub_81A01E8 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _081A0416 + movs r5, 0 + cmp r5, r8 + bcs _081A04D6 + ldr r7, =gSaveBlock2Ptr +_081A0470: + ldr r1, [r7] + lsls r0, r5, 2 + adds r4, r1, r0 + adds r0, r4, 0 + adds r0, 0xB8 + ldrb r2, [r0] + lsls r0, r2, 30 + lsrs r1, r0, 30 + lsls r0, r2, 28 + lsrs r3, r0, 30 + adds r6, r3, 0 + cmp r1, 0x1 + bne _081A04A8 + lsrs r0, r2, 6 + cmp r0, 0 + beq _081A04CC + lsls r0, r3, 2 + add r0, sp + ldr r1, [r0] + adds r0, r4, 0 + adds r0, 0xBA + ldrh r0, [r0] + strh r0, [r1, 0xA] + b _081A04CC + .pool +_081A04A8: + cmp r1, 0x2 + bne _081A04CC + lsls r0, r2, 24 + lsrs r0, 30 + cmp r0, 0 + beq _081A04CC + lsls r2, 26 + lsrs r2, 30 + lsls r0, r6, 2 + add r0, sp + ldr r1, [r0] + lsls r2, 1 + adds r1, 0x2 + adds r1, r2 + adds r0, r4, 0 + adds r0, 0xBA + ldrh r0, [r0] + strh r0, [r1] +_081A04CC: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, r8 + bcc _081A0470 +_081A04D6: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81A0390 + + thumb_func_start sub_81A04E4 +sub_81A04E4: @ 81A04E4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + lsls r0, 24 + lsrs r0, 24 + movs r7, 0x2 + cmp r0, 0x6 + bls _081A04FC + b _081A064C +_081A04FC: + lsls r0, 2 + ldr r1, =_081A050C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A050C: + .4byte _081A0528 + .4byte _081A0540 + .4byte _081A05B4 + .4byte _081A05F4 + .4byte _081A061C + .4byte _081A064C + .4byte _081A0634 +_081A0528: + movs r0, 0x12 + mov r10, r0 + movs r6, 0x8 + ldr r0, =gUnknown_085EAEB1 + str r0, [sp, 0xC] + ldr r0, =gUnknown_085EAEB8 + str r0, [sp, 0x10] + b _081A0652 + .pool +_081A0540: + movs r7, 0x3 + movs r1, 0x12 + mov r10, r1 + movs r6, 0x6 + movs r4, 0 + ldr r0, =gSpeciesNames + mov r9, r0 + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + movs r1, 0xB2 + adds r1, r3 + mov r12, r1 + adds r5, r3, 0 + adds r5, 0xB0 + ldr r0, =gUnknown_086109A4 + mov r8, r0 +_081A0560: + adds r0, r3, 0 + adds r0, 0xB4 + adds r0, r4 + ldrb r2, [r0] + mov r1, r12 + ldrb r0, [r1] + lsls r0, 29 + lsrs r0, 29 + asrs r0, r4 + movs r1, 0x1 + ands r0, r1 + lsls r0, 2 + asrs r2, r0 + movs r0, 0xF + ands r2, r0 + lsls r2, 1 + ldrb r1, [r5] + movs r0, 0x58 + muls r0, r1 + adds r2, r0 + add r2, r8 + ldrh r1, [r2] + lsls r0, r4, 2 + mov r2, sp + adds r2, r0 + adds r2, 0xC + movs r0, 0xB + muls r0, r1 + add r0, r9 + str r0, [r2] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _081A0560 + b _081A0652 + .pool +_081A05B4: + movs r0, 0x12 + mov r10, r0 + movs r6, 0x8 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + cmp r0, 0x2 + bls _081A05CC + b _081A06FA +_081A05CC: + ldr r0, =gUnknown_030062F0 + ldr r3, [r0] + ldrh r0, [r3, 0x2] + movs r2, 0xB + muls r0, r2 + ldr r1, =gSpeciesNames + adds r0, r1 + str r0, [sp, 0x10] + ldrh r0, [r3] + muls r0, r2 + adds r0, r1 + str r0, [sp, 0xC] + b _081A0652 + .pool +_081A05F4: + movs r1, 0x11 + mov r10, r1 + movs r6, 0x8 + ldr r0, =gUnknown_030062F0 + ldr r3, [r0] + ldrh r0, [r3, 0x4] + movs r2, 0xD + muls r0, r2 + ldr r1, =gMoveNames + adds r0, r1 + str r0, [sp, 0xC] + ldrh r0, [r3, 0x6] + muls r0, r2 + adds r0, r1 + str r0, [sp, 0x10] + b _081A0652 + .pool +_081A061C: + movs r0, 0x12 + mov r10, r0 + movs r6, 0x8 + ldr r0, =gUnknown_085ED193 + str r0, [sp, 0xC] + ldr r0, =gUnknown_085ED198 + str r0, [sp, 0x10] + b _081A0652 + .pool +_081A0634: + movs r1, 0x14 + mov r10, r1 + movs r6, 0x8 + ldr r0, =gUnknown_085EAE62 + str r0, [sp, 0xC] + ldr r0, =gUnknown_085EAE66 + str r0, [sp, 0x10] + b _081A0652 + .pool +_081A064C: + movs r0, 0 + mov r10, r0 + movs r6, 0 +_081A0652: + movs r5, 0 + movs r4, 0 + lsls r1, r7, 25 + mov r8, r1 + cmp r4, r7 + bcs _081A067E +_081A065E: + lsls r0, r4, 2 + add r0, sp + adds r0, 0xC + ldr r1, [r0] + movs r0, 0x1 + movs r2, 0 + bl GetStringWidth + cmp r0, r5 + ble _081A0674 + adds r5, r0, 0 +_081A0674: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r7 + bcc _081A065E +_081A067E: + adds r0, r5, 0 + bl convert_pixel_width_to_tile_width + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + mov r0, r10 + adds r1, r4, 0 + bl sub_80E2D5C + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + mov r0, r8 + lsrs r3, r0, 24 + mov r0, r10 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_81A0784 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + movs r1, 0 + bl SetStandardWindowBorderStyle + movs r4, 0 + cmp r4, r7 + bcs _081A06E6 +_081A06B8: + lsls r0, r4, 2 + add r0, sp + adds r0, 0xC + ldr r2, [r0] + lsls r0, r4, 4 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + adds r0, r5, 0 + movs r1, 0x1 + movs r3, 0x8 + bl Print + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r7 + bcc _081A06B8 +_081A06E6: + adds r0, r5, 0 + adds r1, r7, 0 + movs r2, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + movs r0, 0x1 + adds r1, r7, 0 + adds r2, r5, 0 + bl sub_81A0804 +_081A06FA: + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81A04E4 + + thumb_func_start sub_81A070C +sub_81A070C: @ 81A070C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081A0730 + bl ProcessMenuInputNoWrapAround + b _081A0734 + .pool +_081A0730: + bl ProcessMenuInput +_081A0734: + lsls r0, 24 + lsrs r0, 24 + lsls r0, 24 + asrs r1, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r1, r0 + beq _081A0778 + adds r0, 0x1 + cmp r1, r0 + bne _081A0764 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081A0778 + movs r0, 0x5 + bl PlaySE + ldr r1, =gScriptResult + movs r0, 0x7F + strh r0, [r1] + b _081A0768 + .pool +_081A0764: + ldr r0, =gScriptResult + strh r1, [r0] +_081A0768: + ldrb r0, [r4, 0xC] + bl sub_81A07E8 + adds r0, r5, 0 + bl DestroyTask + bl script_env_2_enable_and_set_ctx_running +_081A0778: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A070C + + thumb_func_start sub_81A0784 +sub_81A0784: @ 81A0784 + push {r4,r5,lr} + sub sp, 0x20 + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsls r5, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x80 + lsls r0, 17 + adds r4, r0 + lsrs r4, 24 + adds r5, r0 + lsrs r5, 24 + str r2, [sp] + str r3, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + movs r0, 0x64 + str r0, [sp, 0xC] + add r0, sp, 0x10 + movs r1, 0 + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_8198A50 + ldr r0, [sp, 0x10] + ldr r1, [sp, 0x14] + str r0, [sp, 0x18] + str r1, [sp, 0x1C] + add r0, sp, 0x18 + bl AddWindow + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram + adds r0, r4, 0 + add sp, 0x20 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81A0784 + + thumb_func_start sub_81A07E8 +sub_81A07E8: @ 81A07E8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8198070 + adds r0, r4, 0 + bl RemoveWindow + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81A07E8 + + thumb_func_start sub_81A0804 +sub_81A0804: @ 81A0804 + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r2, 24 + lsrs r6, r2, 24 + ldr r0, =sub_81A070C + movs r1, 0x50 + bl CreateTask + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =gTasks + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0, r1 + strh r4, [r1, 0x10] + cmp r5, 0x3 + bls _081A0840 + movs r0, 0x1 + b _081A0842 + .pool +_081A0840: + movs r0, 0 +_081A0842: + strh r0, [r1, 0x12] + ldr r1, =gTasks + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + strh r6, [r0, 0x14] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A0804 + + thumb_func_start sub_81A085C +sub_81A085C: @ 81A085C + push {lr} + ldr r1, =gUnknown_086114E0 + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A085C + + thumb_func_start sub_81A087C +sub_81A087C: @ 81A087C + push {r4-r7,lr} + bl sub_819FBC8 + ldr r3, =gSaveBlock2Ptr + ldr r1, [r3] + adds r1, 0xB1 + ldrb r2, [r1] + movs r0, 0x4 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r3] + adds r1, 0xB1 + ldrb r2, [r1] + movs r0, 0x3D + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r3] + adds r1, 0xB1 + ldrb r2, [r1] + movs r0, 0x3F + ands r0, r2 + strb r0, [r1] + ldr r1, [r3] + adds r1, 0xB2 + ldrb r2, [r1] + movs r0, 0x8 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + movs r4, 0 + movs r1, 0 +_081A08BE: + ldr r0, [r3] + adds r0, 0xB4 + adds r0, r4 + strb r1, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _081A08BE + movs r4, 0 + ldr r5, =gSaveBlock2Ptr + movs r0, 0x4 + negs r0, r0 + mov r12, r0 + movs r7, 0xD + negs r7, r7 + movs r6, 0x31 + negs r6, r6 +_081A08E2: + ldr r1, [r5] + lsls r3, r4, 2 + adds r1, r3 + adds r1, 0xB8 + ldrb r2, [r1] + mov r0, r12 + ands r0, r2 + strb r0, [r1] + ldr r1, [r5] + adds r1, r3 + adds r1, 0xB8 + ldrb r2, [r1] + adds r0, r7, 0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r5] + adds r1, r3 + adds r1, 0xB8 + ldrb r2, [r1] + adds r0, r6, 0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r5] + adds r1, r3 + adds r1, 0xB8 + ldrb r2, [r1] + movs r0, 0x3F + ands r0, r2 + strb r0, [r1] + ldr r0, [r5] + adds r0, r3 + adds r0, 0xBA + movs r1, 0 + strh r1, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x8 + bls _081A08E2 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A087C + + thumb_func_start sub_81A093C +sub_81A093C: @ 81A093C + push {lr} + bl sub_819FBB0 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _081A0954 + ldr r0, =gScriptResult + strh r1, [r0] + b _081A095A + .pool +_081A0954: + ldr r1, =gScriptResult + movs r0, 0x1 + strh r0, [r1] +_081A095A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A093C + + thumb_func_start sub_81A0964 +sub_81A0964: @ 81A0964 + push {lr} + ldr r0, =gSpecialVar_0x8005 + ldrb r0, [r0] + bl sub_819FC40 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A0964 + + thumb_func_start sub_81A0978 +sub_81A0978: @ 81A0978 + push {lr} + bl sub_819FBC8 + pop {r0} + bx r0 + thumb_func_end sub_81A0978 + + thumb_func_start sub_81A0984 +sub_81A0984: @ 81A0984 + push {lr} + bl sub_819FD64 + pop {r0} + bx r0 + thumb_func_end sub_81A0984 + + thumb_func_start sub_81A0990 +sub_81A0990: @ 81A0990 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + adds r2, 0xB1 + ldrb r3, [r2] + lsls r1, r3, 26 + lsrs r1, 28 + adds r1, 0x1 + movs r0, 0xF + ands r1, r0 + lsls r1, 2 + movs r0, 0x3D + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + bx lr + .pool + thumb_func_end sub_81A0990 + + thumb_func_start sub_81A09B4 +sub_81A09B4: @ 81A09B4 + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_81A09B4 + + thumb_func_start sub_81A09D0 +sub_81A09D0: @ 81A09D0 + push {lr} + ldr r3, =gSaveBlock2Ptr + ldr r0, [r3] + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r1, r0, 0x3 + cmp r1, 0 + bge _081A09F4 + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] + b _081A0A1C + .pool +_081A09F4: + ldr r2, =gScriptResult + cmp r1, 0x8 + ble _081A09FE + movs r0, 0x1 + strh r0, [r2] +_081A09FE: + ldr r0, [r3] + lsls r1, 2 + adds r0, r1 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + cmp r0, 0 + bne _081A0A18 + movs r0, 0x1 + b _081A0A1A + .pool +_081A0A18: + movs r0, 0 +_081A0A1A: + strh r0, [r2] +_081A0A1C: + pop {r0} + bx r0 + thumb_func_end sub_81A09D0 + + thumb_func_start sub_81A0A20 +sub_81A0A20: @ 81A0A20 + push {lr} + ldr r0, =gSpecialVar_0x8005 + ldrb r0, [r0] + bl sub_81A04E4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A0A20 + + thumb_func_start sub_81A0A34 +sub_81A0A34: @ 81A0A34 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8197224 + lsls r0, 16 + cmp r0, 0 + bne _081A0A68 + adds r0, r4, 0 + bl DestroyTask + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0 + beq _081A0A64 + ldr r0, =script_env_2_enable_and_set_ctx_running + bl sub_81A172C + b _081A0A68 + .pool +_081A0A64: + bl script_env_2_enable_and_set_ctx_running +_081A0A68: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81A0A34 + + thumb_func_start sub_81A0A70 +sub_81A0A70: @ 81A0A70 + push {lr} + ldr r1, =gSpecialVar_0x8006 + ldrh r0, [r1] + cmp r0, 0x6 + bne _081A0A94 + ldr r1, =gUnknown_08610FF0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 3 + b _081A0C66 + .pool +_081A0A94: + cmp r0, 0x7 + bne _081A0AB0 + ldr r1, =gUnknown_08610FF0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 3 + adds r1, 0x4 + b _081A0C66 + .pool +_081A0AB0: + cmp r0, 0x8 + bne _081A0ACC + ldr r1, =gUnknown_086111B0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 3 + b _081A0C66 + .pool +_081A0ACC: + cmp r0, 0x9 + bne _081A0AE8 + ldr r1, =gUnknown_086111B0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 3 + adds r1, 0x4 + b _081A0C66 + .pool +_081A0AE8: + cmp r0, 0x4 + bne _081A0B04 + ldr r1, =gUnknown_08611230 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 3 + b _081A0C66 + .pool +_081A0B04: + cmp r0, 0x5 + bne _081A0B20 + ldr r1, =gUnknown_08611230 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 3 + adds r1, 0x4 + b _081A0C66 + .pool +_081A0B20: + cmp r0, 0xA + bne _081A0B40 + ldr r2, =gUnknown_08611070 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + b _081A0BD6 + .pool +_081A0B40: + cmp r0, 0xB + bne _081A0B5C + ldr r1, =gUnknown_086112B0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 3 + b _081A0C66 + .pool +_081A0B5C: + cmp r0, 0xC + bne _081A0B7C + ldr r2, =gUnknown_08611070 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, 0xC + b _081A0BD6 + .pool +_081A0B7C: + cmp r0, 0xD + bne _081A0B9C + ldr r2, =gUnknown_08611070 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, 0x4 + b _081A0BD6 + .pool +_081A0B9C: + ldrh r0, [r1] + cmp r0, 0x10 + bne _081A0BC0 + ldr r2, =gUnknown_08611070 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, 0x10 + b _081A0BD6 + .pool +_081A0BC0: + cmp r0, 0xE + bne _081A0BE4 + ldr r2, =gUnknown_08611070 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, 0x8 +_081A0BD6: + adds r0, r2 + ldr r1, [r0] + b _081A0C7A + .pool +_081A0BE4: + cmp r0, 0xF + bne _081A0C00 + ldr r1, =gUnknown_086112B0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 3 + adds r1, 0x4 + b _081A0C66 + .pool +_081A0C00: + cmp r0, 0 + bne _081A0C1C + ldr r1, =gUnknown_08610EF0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 4 + b _081A0C66 + .pool +_081A0C1C: + cmp r0, 0x1 + bne _081A0C38 + ldr r1, =gUnknown_08610EF0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 4 + adds r1, 0x4 + b _081A0C66 + .pool +_081A0C38: + cmp r0, 0x2 + bne _081A0C54 + ldr r1, =gUnknown_08610EF0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 4 + adds r1, 0x8 + b _081A0C66 + .pool +_081A0C54: + cmp r0, 0x3 + bne _081A0C74 + ldr r1, =gUnknown_08610EF0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 4 + adds r1, 0xC +_081A0C66: + adds r0, r1 + ldr r1, [r0] + b _081A0C7A + .pool +_081A0C74: + bl script_env_2_enable_and_set_ctx_running + b _081A0C8E +_081A0C7A: + ldr r0, =gStringVar4 + bl StringExpandPlaceholders + movs r0, 0x1 + bl AddTextPrinterForMessage + ldr r0, =sub_81A0A34 + movs r1, 0x1 + bl CreateTask +_081A0C8E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A0A70 + + thumb_func_start sub_81A0C9C +sub_81A0C9C: @ 81A0C9C + push {lr} + bl script_env_2_enable + bl player_bitmagic + bl sub_808B864 + bl sub_808BCF4 + movs r0, 0 + movs r1, 0x1 + bl sub_81973C4 + bl sub_81A0A70 + pop {r0} + bx r0 + thumb_func_end sub_81A0C9C + + thumb_func_start sub_81A0CC0 +sub_81A0CC0: @ 81A0CC0 + push {lr} + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r1, r0, 26 + lsrs r0, r1, 28 + cmp r0, 0x2 + bhi _081A0CE4 + ldr r1, =gScriptResult + movs r0, 0x2 + b _081A0D34 + .pool +_081A0CE4: + lsrs r0, r1, 28 + cmp r0, 0xB + bhi _081A0D30 + lsrs r0, r1, 28 + subs r0, 0x3 + lsls r0, 2 + adds r0, r2, r0 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + cmp r0, 0x2 + beq _081A0D18 + cmp r0, 0x2 + bgt _081A0D08 + cmp r0, 0x1 + beq _081A0D0E + b _081A0D30 +_081A0D08: + cmp r0, 0x3 + beq _081A0D24 + b _081A0D30 +_081A0D0E: + ldr r1, =gScriptResult + movs r0, 0x4 + b _081A0D34 + .pool +_081A0D18: + ldr r1, =gScriptResult + movs r0, 0x3 + b _081A0D34 + .pool +_081A0D24: + ldr r1, =gScriptResult + movs r0, 0x1 + b _081A0D34 + .pool +_081A0D30: + ldr r1, =gScriptResult + movs r0, 0x5 +_081A0D34: + strh r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A0CC0 + + thumb_func_start sub_81A0D40 +sub_81A0D40: @ 81A0D40 + push {r4,lr} + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0 + beq _081A0D6E + ldr r4, =gSpecialVar_0x8006 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + adds r2, 0xB2 + ldrb r3, [r2] + lsls r0, r3, 29 + lsrs r0, 29 + movs r1, 0x1 + ldrb r4, [r4] + lsls r1, r4 + orrs r1, r0 + movs r0, 0x7 + ands r1, r0 + movs r0, 0x8 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] +_081A0D6E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A0D40 + + thumb_func_start sub_81A0D80 +sub_81A0D80: @ 81A0D80 + push {lr} + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + adds r0, r3, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r1, r0, 26 + lsrs r0, r1, 28 + cmp r0, 0x2 + bls _081A0DCE + subs r0, 0x3 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0 + beq _081A0DC0 + lsls r2, 2 + adds r2, r3, r2 + adds r2, 0xB8 + ldrb r1, [r2] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + b _081A0DCE + .pool +_081A0DC0: + lsls r0, r2, 2 + adds r0, r3, r0 + adds r0, 0xB8 + ldrb r2, [r0] + movs r1, 0x3F + ands r1, r2 + strb r1, [r0] +_081A0DCE: + pop {r0} + bx r0 + thumb_func_end sub_81A0D80 + + thumb_func_start sub_81A0DD4 +sub_81A0DD4: @ 81A0DD4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r6, 0 + movs r2, 0 + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + ldr r3, =gUnknown_030062F0 + mov r9, r3 + cmp r0, 0 + beq _081A0E14 + adds r3, r1, 0 +_081A0DF4: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x8 + bhi _081A0E14 + ldr r0, [r3] + lsls r1, r2, 2 + adds r0, r1 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + cmp r0, 0 + bne _081A0DF4 +_081A0E14: + mov r4, r9 + movs r0, 0x8 + bl AllocZeroed + adds r7, r0, 0 + str r7, [r4] + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x2 + bne _081A0E88 + ldr r0, =gSaveBlock2Ptr + ldr r5, [r0] + adds r6, r5, 0 + adds r6, 0xB1 + ldrb r0, [r6] + lsls r1, r0, 26 + lsrs r0, r1, 28 + cmp r0, 0x2 + bls _081A0E3C + b _081A0FCE +_081A0E3C: + adds r2, r5, 0 + adds r2, 0xB4 + adds r0, r2, r0 + ldrb r0, [r0] + lsrs r4, r0, 4 + ldr r3, =gUnknown_08610970 + lsls r1, r4, 1 + adds r5, 0xB0 + ldrb r0, [r5] + movs r4, 0x58 + muls r0, r4 + adds r1, r0 + adds r3, 0x34 + adds r1, r3 + ldrh r0, [r1] + strh r0, [r7, 0x2] + ldrb r0, [r6] + lsls r0, 26 + lsrs r0, 28 + adds r2, r0 + ldrb r1, [r2] + movs r0, 0xF + ands r0, r1 + lsls r0, 1 + ldrb r1, [r5] + muls r1, r4 + adds r0, r1 + adds r0, r3 + b _081A0FCA + .pool +_081A0E88: + cmp r0, 0x3 + bne _081A0F54 + ldr r0, =gSaveBlock2Ptr + mov r8, r0 + ldr r5, [r0] + movs r1, 0xB1 + adds r1, r5 + mov r12, r1 + ldrb r0, [r1] + lsls r2, r0, 26 + lsrs r0, r2, 28 + cmp r0, 0x2 + bhi _081A0EA4 + b _081A0FCE +_081A0EA4: + adds r1, r0, 0 + adds r0, r6, 0x3 + cmp r1, r0 + blt _081A0EAE + b _081A0FCE +_081A0EAE: + adds r0, r1, 0 + subs r0, 0x3 + lsls r0, 2 + adds r0, r5, r0 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + cmp r0, 0x2 + beq _081A0EC4 + b _081A0FCE +_081A0EC4: + adds r0, r1, 0 + subs r0, 0x3 + lsls r0, 2 + adds r0, r5, r0 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 28 + lsrs r6, r0, 30 + adds r0, r5, 0 + adds r0, 0xB2 + ldrb r1, [r0] + lsls r1, 29 + lsrs r1, 29 + asrs r1, r6 + movs r0, 0x1 + ands r1, r0 + adds r0, r5, 0 + adds r0, 0xB4 + adds r0, r6 + ldrb r4, [r0] + lsls r1, 2 + asrs r4, r1 + movs r0, 0xF + ands r4, r0 + ldr r2, =gUnknown_08610970 + lsls r1, r4, 1 + adds r0, r5, 0 + adds r0, 0xB0 + ldrb r3, [r0] + movs r0, 0x58 + muls r0, r3 + adds r1, r0 + adds r2, 0x34 + adds r1, r2 + ldrh r0, [r1] + strh r0, [r7] + mov r3, r12 + ldrb r0, [r3] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + lsls r0, 2 + adds r0, r5, r0 + adds r0, 0xB8 + ldrb r2, [r0] + lsls r2, 26 + lsrs r2, 30 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_81A0284 + mov r1, r9 + ldr r2, [r1] + strh r0, [r2, 0x4] + mov r3, r8 + ldr r1, [r3] + adds r0, r1, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + lsls r0, 2 + adds r1, r0 + adds r1, 0xBA + ldrh r0, [r1] + strh r0, [r2, 0x6] + b _081A0FCE + .pool +_081A0F54: + cmp r0, 0x4 + bne _081A0FCE + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + adds r0, r3, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r2, r0, 26 + lsrs r0, r2, 28 + cmp r0, 0x2 + bls _081A0FCE + adds r1, r0, 0 + adds r0, r6, 0x3 + cmp r1, r0 + bge _081A0FCE + adds r0, r1, 0 + subs r0, 0x3 + lsls r0, 2 + adds r0, r3, r0 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + cmp r0, 0x1 + bne _081A0FCE + adds r0, r1, 0 + subs r0, 0x3 + lsls r0, 2 + adds r0, r3, r0 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 28 + lsrs r6, r0, 30 + adds r0, r3, 0 + adds r0, 0xB2 + ldrb r1, [r0] + lsls r1, 29 + lsrs r1, 29 + asrs r1, r6 + movs r0, 0x1 + ands r1, r0 + adds r0, r3, 0 + adds r0, 0xB4 + adds r0, r6 + ldrb r0, [r0] + lsls r1, 2 + asrs r0, r1 + movs r1, 0xF + ands r0, r1 + ldr r2, =gUnknown_08610970 + lsls r0, 1 + adds r1, r3, 0 + adds r1, 0xB0 + ldrb r3, [r1] + movs r1, 0x58 + muls r1, r3 + adds r0, r1 + adds r2, 0x34 + adds r0, r2 +_081A0FCA: + ldrh r0, [r0] + strh r0, [r7] +_081A0FCE: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A0DD4 + + thumb_func_start sub_81A0FE4 +sub_81A0FE4: @ 81A0FE4 + push {r4,lr} + ldr r4, =gUnknown_030062F0 + ldr r0, [r4] + bl Free + movs r0, 0 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A0FE4 + + thumb_func_start sub_81A0FFC +sub_81A0FFC: @ 81A0FFC + push {r4-r6,lr} + sub sp, 0x10 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x1 + beq _081A1028 + cmp r0, 0x1 + bgt _081A1018 + cmp r0, 0 + beq _081A101E + b _081A11E6 + .pool +_081A1018: + cmp r0, 0x2 + beq _081A1030 + b _081A11E6 +_081A101E: + ldr r5, =gStringVar1 + b _081A1032 + .pool +_081A1028: + ldr r5, =gStringVar2 + b _081A1032 + .pool +_081A1030: + ldr r5, =gStringVar3 +_081A1032: + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + cmp r0, 0x9 + bls _081A103C + b _081A11E6 +_081A103C: + lsls r0, 2 + ldr r1, =_081A1054 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A1054: + .4byte _081A107C + .4byte _081A1094 + .4byte _081A10AC + .4byte _081A10C4 + .4byte _081A10DC + .4byte _081A10F4 + .4byte _081A1118 + .4byte _081A1164 + .4byte _081A1140 + .4byte _081A1184 +_081A107C: + ldr r0, =gUnknown_030062F0 + ldr r0, [r0] + ldrh r1, [r0] + movs r0, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + b _081A1174 + .pool +_081A1094: + ldr r0, =gUnknown_030062F0 + ldr r0, [r0] + ldrh r1, [r0, 0x2] + movs r0, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + b _081A1174 + .pool +_081A10AC: + ldr r0, =gUnknown_030062F0 + ldr r0, [r0] + ldrh r1, [r0] + movs r0, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + b _081A1174 + .pool +_081A10C4: + ldr r0, =gUnknown_030062F0 + ldr r0, [r0] + ldrh r1, [r0, 0x4] + movs r0, 0xD + muls r1, r0 + ldr r0, =gMoveNames + adds r1, r0 + b _081A1174 + .pool +_081A10DC: + ldr r0, =gUnknown_030062F0 + ldr r0, [r0] + ldrh r1, [r0, 0x6] + movs r0, 0xD + muls r1, r0 + ldr r0, =gMoveNames + adds r1, r0 + b _081A1174 + .pool +_081A10F4: + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + lsls r0, 2 + adds r1, r0 + adds r1, 0xBA + ldrh r0, [r1] + bl ItemId_GetItem + adds r1, r0, 0 + b _081A1174 + .pool +_081A1118: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r0, [r0] + movs r1, 0x2 + bl sub_81A1650 + adds r1, r0, 0 + mov r0, sp + movs r2, 0x2 + bl sub_81DB5E8 + adds r0, r5, 0 + mov r1, sp + bl StringCopy + b _081A11E6 + .pool +_081A1140: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB1 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + bne _081A115C + ldr r1, =gUnknown_085EAEB1 + b _081A1174 + .pool +_081A115C: + ldr r1, =gUnknown_085EAEB8 + b _081A1174 + .pool +_081A1164: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + movs r1, 0x82 + lsls r1, 1 + adds r0, r1 + bl ConvertBattleFrontierTrainerSpeechToString + ldr r1, =gStringVar4 +_081A1174: + adds r0, r5, 0 + bl StringCopy + b _081A11E6 + .pool +_081A1184: + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + adds r1, r3, 0 + adds r1, 0xB1 + ldrb r1, [r1] + lsls r4, r1, 24 + lsrs r1, r4, 30 + adds r6, r0, 0 + cmp r1, 0x2 + bhi _081A11C0 + adds r0, r3, 0 + adds r0, 0xB4 + adds r0, r1 + ldrb r2, [r0] + adds r0, r3, 0 + adds r0, 0xB2 + ldrb r0, [r0] + lsls r0, 29 + lsrs r0, 29 + asrs r0, r1 + movs r1, 0x1 + ands r0, r1 + lsls r0, 2 + asrs r2, r0 + movs r0, 0xF + ands r2, r0 + b _081A11C2 + .pool +_081A11C0: + movs r2, 0 +_081A11C2: + ldr r3, =gUnknown_08610970 + lsls r1, r2, 1 + ldr r0, [r6] + adds r0, 0xB0 + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, r0 + adds r3, 0x34 + adds r1, r3 + ldrh r1, [r1] + movs r0, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + adds r0, r5, 0 + bl StringCopy +_081A11E6: + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A0FFC + + thumb_func_start sub_81A11F8 +sub_81A11F8: @ 81A11F8 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r0, =gSpecialVar_0x8005 + ldrb r1, [r0] + adds r2, 0xB1 + lsls r1, 6 + ldrb r3, [r2] + movs r0, 0x3F + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + bx lr + .pool + thumb_func_end sub_81A11F8 + + thumb_func_start sub_81A1218 +sub_81A1218: @ 81A1218 + push {lr} + bl sub_81AAC28 + pop {r0} + bx r0 + thumb_func_end sub_81A1218 + + thumb_func_start sub_81A1224 +sub_81A1224: @ 81A1224 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r1, =gSaveBlock2Ptr + ldr r3, [r1] + adds r0, r3, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + adds r7, r1, 0 + cmp r0, 0x2 + bhi _081A1242 + b _081A1362 +_081A1242: + movs r5, 0 + movs r2, 0 + adds r0, r3, 0 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + ldr r1, =gSpecialVar_0x8005 + mov r12, r1 + ldr r1, =gScriptResult + mov r8, r1 + cmp r0, 0 + beq _081A127C + adds r3, r7, 0 +_081A125C: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x8 + bhi _081A127C + ldr r0, [r3] + lsls r1, r2, 2 + adds r0, r1 + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + cmp r0, 0 + bne _081A125C +_081A127C: + movs r4, 0 + cmp r4, r5 + bcs _081A1322 + ldr r0, [r7] + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + cmp r4, r0 + bge _081A1322 + adds r6, r7, 0 + mov r9, r4 +_081A1296: + ldr r3, [r6] + lsls r0, r4, 2 + adds r2, r3, r0 + adds r0, r2, 0 + adds r0, 0xB8 + ldrb r1, [r0] + lsls r0, r1, 30 + lsrs r0, 30 + cmp r0, 0x1 + bne _081A1308 + lsrs r0, r1, 6 + cmp r0, 0 + beq _081A1308 + adds r0, r2, 0 + adds r0, 0xBA + ldrh r0, [r0] + mov r2, r12 + ldrh r2, [r2] + cmp r0, r2 + bne _081A1308 + adds r0, r3, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + lsls r0, 2 + adds r0, r3, r0 + adds r0, 0xB8 + ldrb r2, [r0] + movs r1, 0x3F + ands r1, r2 + strb r1, [r0] + ldr r1, [r6] + adds r0, r1, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + lsls r0, 2 + adds r1, r0 + mov r2, r12 + ldrh r0, [r2] + adds r1, 0xBA + strh r0, [r1] + mov r1, r9 + mov r0, r8 + strh r1, [r0] + b _081A1362 + .pool +_081A1308: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcs _081A1322 + ldr r0, [r6] + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + cmp r4, r0 + blt _081A1296 +_081A1322: + ldr r2, [r7] + adds r0, r2, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + lsls r0, 2 + adds r2, r0 + adds r2, 0xB8 + ldrb r1, [r2] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + ldr r1, [r7] + adds r0, r1, 0 + adds r0, 0xB1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 28 + subs r0, 0x3 + lsls r0, 2 + adds r1, r0 + mov r2, r12 + ldrh r0, [r2] + adds r1, 0xBA + strh r0, [r1] + movs r0, 0x1 + mov r1, r8 + strh r0, [r1] +_081A1362: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81A1224 + + thumb_func_start sub_81A1370 +sub_81A1370: @ 81A1370 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + movs r2, 0x8A + lsls r2, 1 + adds r1, r2 + ldrb r1, [r1] + adds r4, r0, 0 + cmp r1, 0xFF + beq _081A1422 + movs r5, 0 +_081A138E: + ldr r1, [r4] + adds r2, r5, 0x1 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r3, r1, r0 + movs r5, 0x8A + lsls r5, 1 + adds r0, r3, r5 + ldrb r0, [r0] + cmp r0, 0xFF + bne _081A13B8 + adds r0, r3, 0 + adds r0, 0xDC + adds r1, 0xDC + movs r2, 0x44 + bl memcpy + b _081A1422 + .pool +_081A13B8: + adds r5, r2, 0 + cmp r5, 0x2 + ble _081A138E + ldr r0, =0x0000ffff + mov r10, r0 + movs r2, 0x1 + negs r2, r2 + mov r9, r2 + movs r5, 0x1 + ldr r7, =gSaveBlock2Ptr + movs r0, 0x90 + lsls r0, 1 + mov r8, r0 + movs r6, 0x44 +_081A13D4: + ldr r0, [r7] + add r0, r8 + adds r0, 0x34 + bl sub_80842DC + adds r4, r0, 0 + ldr r0, [r7] + adds r0, 0xA + bl sub_80842DC + cmp r4, r0 + bne _081A13FC + ldr r0, [r7] + adds r0, r6 + adds r0, 0xDE + ldrb r0, [r0] + cmp r0, r10 + bge _081A13FC + mov r10, r0 + mov r9, r5 +_081A13FC: + movs r2, 0x44 + add r8, r2 + adds r6, 0x44 + adds r5, 0x1 + cmp r5, 0x3 + ble _081A13D4 + mov r5, r9 + cmp r5, 0 + ble _081A1422 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + lsls r0, r5, 4 + add r0, r9 + lsls r0, 2 + adds r0, r1, r0 + adds r0, 0xDC + adds r1, 0xDC + bl memcpy +_081A1422: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A1370 + + thumb_func_start sub_81A1438 +sub_81A1438: @ 81A1438 + push {r4,r5,lr} + ldr r4, =gSaveBlock2Ptr + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0xB0 + ldrb r0, [r0] + adds r2, 0xDC + movs r1, 0x1F + ands r1, r0 + ldrb r3, [r2] + movs r0, 0x20 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0xB1 + ldrb r1, [r0] + lsls r1, 30 + adds r2, 0xDC + lsrs r1, 25 + ldrb r3, [r2] + movs r0, 0x61 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + movs r2, 0 + ldr r0, [r4] + b _081A148C + .pool +_081A147C: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x8 + bhi _081A1496 + ldr r0, [r4] + lsls r1, r2, 2 + adds r0, r1 +_081A148C: + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + cmp r0, 0 + bne _081A147C +_081A1496: + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + adds r0, 0xDD + strb r2, [r0] + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0xDE + ldrb r0, [r1] + cmp r0, 0xFE + bhi _081A14AE + adds r0, 0x1 + strb r0, [r1] +_081A14AE: + ldr r0, [r4] + adds r0, 0xDD + ldrb r0, [r0] + bl sub_81A0390 + movs r2, 0 + adds r3, r4, 0 + movs r4, 0x88 + lsls r4, 1 + adds r5, r3, 0 +_081A14C2: + ldr r0, [r3] + adds r1, r0, r4 + adds r1, r2 + adds r0, 0xA + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bls _081A14C2 + ldr r1, [r5] + movs r2, 0x8A + lsls r2, 1 + adds r0, r1, r2 + bl StringCopy + ldr r1, [r5] + ldr r0, =gGameLanguage + ldrb r0, [r0] + ldr r2, =0x0000011b + adds r1, r2 + strb r0, [r1] + ldr r0, [r5] + adds r0, 0xDC + bl sub_8165AE8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A1438 + + thumb_func_start sub_81A150C +sub_81A150C: @ 81A150C + push {lr} + ldr r2, =gUnknown_08610970 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xDC + ldrb r0, [r0] + lsls r0, 27 + lsrs r0, 27 + movs r1, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x32 + ldrb r2, [r0] + movs r1, 0 + ldr r3, =gUnknown_085DCEDC + ldrb r0, [r3] + cmp r0, r2 + beq _081A1542 +_081A1530: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1D + bhi _081A1542 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _081A1530 +_081A1542: + cmp r1, 0x1E + beq _081A1568 + ldr r0, =gUnknown_085DCF0E + adds r0, r1, r0 + ldrb r1, [r0] + ldr r0, =0x00004010 + bl VarSet + b _081A1594 + .pool +_081A1568: + movs r1, 0 + ldr r3, =gUnknown_085DCEFA + ldrb r0, [r3] + cmp r0, r2 + beq _081A1584 +_081A1572: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x13 + bhi _081A1584 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _081A1572 +_081A1584: + cmp r1, 0x14 + beq _081A1594 + ldr r0, =gUnknown_085DCF2C + adds r0, r1, r0 + ldrb r1, [r0] + ldr r0, =0x00004010 + bl VarSet +_081A1594: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A150C + + thumb_func_start sub_81A15A4 +sub_81A15A4: @ 81A15A4 + push {lr} + ldr r2, =gUnknown_08610970 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + adds r0, 0xB0 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x32 + ldrb r2, [r0] + movs r1, 0 + ldr r3, =gUnknown_085DCEDC + ldrb r0, [r3] + cmp r0, r2 + beq _081A15D6 +_081A15C4: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1D + bhi _081A15D6 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _081A15C4 +_081A15D6: + cmp r1, 0x1E + beq _081A15FC + ldr r0, =gUnknown_085DCF0E + adds r0, r1, r0 + ldrb r1, [r0] + ldr r0, =0x00004010 + bl VarSet + b _081A1628 + .pool +_081A15FC: + movs r1, 0 + ldr r3, =gUnknown_085DCEFA + ldrb r0, [r3] + cmp r0, r2 + beq _081A1618 +_081A1606: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x13 + bhi _081A1618 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _081A1606 +_081A1618: + cmp r1, 0x14 + beq _081A1628 + ldr r0, =gUnknown_085DCF2C + adds r0, r1, r0 + ldrb r1, [r0] + ldr r0, =0x00004010 + bl VarSet +_081A1628: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A15A4 + + thumb_func_start sub_81A1638 +sub_81A1638: @ 81A1638 + ldr r1, =gSpecialVar_0x8004 + movs r0, 0x1 + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_81A1638 + + thumb_func_start sub_81A1644 +sub_81A1644: @ 81A1644 + ldr r1, =gSpecialVar_0x8004 + movs r0, 0x1 + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_81A1644 + + thumb_func_start sub_81A1650 +sub_81A1650: @ 81A1650 + push {lr} + movs r2, 0x58 + muls r2, r0 + ldr r0, =gUnknown_08610970 + adds r2, r0 + subs r0, r1, 0x1 + cmp r0, 0x6 + bhi _081A16AC + lsls r0, 2 + ldr r1, =_081A1674 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A1674: + .4byte _081A1690 + .4byte _081A1694 + .4byte _081A169A + .4byte _081A16A0 + .4byte _081A16A6 + .4byte _081A16AC + .4byte _081A16AC +_081A1690: + adds r0, r2, 0 + b _081A16B0 +_081A1694: + adds r0, r2, 0 + adds r0, 0x8 + b _081A16B0 +_081A169A: + adds r0, r2, 0 + adds r0, 0x10 + b _081A16B0 +_081A16A0: + adds r0, r2, 0 + adds r0, 0x18 + b _081A16B0 +_081A16A6: + adds r0, r2, 0 + adds r0, 0x20 + b _081A16B0 +_081A16AC: + adds r0, r2, 0 + adds r0, 0x28 +_081A16B0: + pop {r1} + bx r1 + thumb_func_end sub_81A1650 + + thumb_func_start sub_81A16B4 +sub_81A16B4: @ 81A16B4 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081A16CE + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081A16D4 +_081A16CE: + adds r0, r2, 0 + bl SwitchTaskToFollowupFunc +_081A16D4: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A16B4 + + thumb_func_start sub_81A16DC +sub_81A16DC: @ 81A16DC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081A16F6 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081A1718 +_081A16F6: + ldr r2, =gUnknown_030062F4 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x8] + movs r3, 0xA + ldrsh r0, [r0, r3] + lsls r0, 16 + orrs r1, r0 + str r1, [r2] + bl _call_via_r1 + adds r0, r4, 0 + bl DestroyTask +_081A1718: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A16DC + + thumb_func_start sub_81A172C +sub_81A172C: @ 81A172C + push {r4,lr} + adds r4, r0, 0 + ldr r0, =sub_81A16DC + movs r1, 0x1 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + lsrs r4, 16 + strh r4, [r1, 0xA] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A172C + + thumb_func_start sub_81A175C +sub_81A175C: @ 81A175C + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =sub_81A16B4 + adds r0, r4, 0 + movs r1, 0x1 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + adds r2, r5, 0 + bl SetTaskFuncWithFollowupFunc + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A175C + + thumb_func_start sub_81A1780 +sub_81A1780: @ 81A1780 + push {lr} + ldr r1, =gUnknown_08611C18 + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A1780 + + thumb_func_start sub_81A17A0 +sub_81A17A0: @ 81A17A0 + push {lr} + movs r0, 0x80 + lsls r0, 7 + movs r1, 0xFF + bl VarSet + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca8 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x4 + bhi _081A1822 + lsls r0, 2 + ldr r1, =_081A17D0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A17D0: + .4byte _081A1822 + .4byte _081A17E4 + .4byte _081A1810 + .4byte _081A17EC + .4byte _081A17E8 +_081A17E4: + movs r0, 0 + b _081A17EE +_081A17E8: + movs r0, 0 + b _081A17EE +_081A17EC: + movs r0, 0x1 +_081A17EE: + bl sub_813A878 + movs r0, 0x80 + lsls r0, 7 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + ldr r2, =0x00000ca8 + adds r1, r2 + ldrb r1, [r1] + bl VarSet + b _081A1822 + .pool +_081A1810: + movs r0, 0x80 + lsls r0, 7 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + ldr r2, =0x00000ca8 + adds r1, r2 + ldrb r1, [r1] + bl VarSet +_081A1822: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A17A0 + + thumb_func_start sub_81A1830 +sub_81A1830: @ 81A1830 + push {r4-r6,lr} + ldr r0, =0x000040cf + bl VarGet + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r6, 0 + bl sub_81A3B30 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bne _081A184C + movs r5, 0x1 +_081A184C: + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x7 + bls _081A1856 + b _081A1956 +_081A1856: + lsls r0, 2 + ldr r1, =_081A186C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A186C: + .4byte _081A188C + .4byte _081A18A8 + .4byte _081A18C8 + .4byte _081A18E4 + .4byte _081A1956 + .4byte _081A1900 + .4byte _081A1918 + .4byte _081A1938 +_081A188C: + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000ca8 + adds r0, r2 + ldrb r0, [r0] + strh r0, [r1] + b _081A1956 + .pool +_081A18A8: + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000ca9 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + strh r0, [r1] + b _081A1956 + .pool +_081A18C8: + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000cb2 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + b _081A1956 + .pool +_081A18E4: + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000ca9 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 29 + b _081A1926 + .pool +_081A1900: + ldr r2, =gScriptResult + ldr r1, =gBattleOutcome + ldrb r0, [r1] + strh r0, [r2] + movs r0, 0 + strb r0, [r1] + b _081A1956 + .pool +_081A1918: + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000ca9 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 28 +_081A1926: + lsrs r0, 31 + strh r0, [r1] + b _081A1956 + .pool +_081A1938: + ldr r4, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + movs r0, 0xD0 + lsls r0, 4 + adds r2, r0 + ldr r3, =gUnknown_08611BFC + lsls r0, r5, 1 + lsls r1, r6, 2 + adds r0, r1 + adds r0, r3 + ldrh r1, [r2] + ldrh r0, [r0] + ands r0, r1 + strh r0, [r4] +_081A1956: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A1830 + + thumb_func_start sub_81A1968 +sub_81A1968: @ 81A1968 + push {r4,r5,lr} + ldr r0, =0x000040cf + bl VarGet + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + bl sub_81A3B30 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bne _081A1984 + movs r4, 0x1 +_081A1984: + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x7 + bls _081A198E + b _081A1AC4 +_081A198E: + lsls r0, 2 + ldr r1, =_081A19A4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A19A4: + .4byte _081A19C4 + .4byte _081A19E0 + .4byte _081A1A0C + .4byte _081A1A28 + .4byte _081A1A50 + .4byte _081A1AC4 + .4byte _081A1A7C + .4byte _081A1AA8 +_081A19C4: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =gSpecialVar_0x8006 + ldrh r1, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + strb r1, [r0] + b _081A1AC4 + .pool +_081A19E0: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r1, =0x00000ca9 + adds r2, r1 + movs r1, 0x3 + ands r1, r0 + ldrb r3, [r2] + movs r0, 0x4 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + b _081A1AC4 + .pool +_081A1A0C: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =gSpecialVar_0x8006 + ldrh r1, [r1] + ldr r2, =0x00000cb2 + adds r0, r2 + strh r1, [r0] + b _081A1AC4 + .pool +_081A1A28: + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r1, =0x00000ca9 + adds r3, r1 + movs r1, 0x1 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r3] + movs r0, 0x5 + negs r0, r0 + b _081A1A94 + .pool +_081A1A50: + movs r2, 0 + ldr r5, =gSaveBlock2Ptr + ldr r4, =0x00000caa + ldr r3, =gUnknown_0203CEF8 +_081A1A58: + ldr r1, [r5] + lsls r0, r2, 1 + adds r1, r4 + adds r1, r0 + adds r0, r2, r3 + ldrb r0, [r0] + strh r0, [r1] + adds r2, 0x1 + cmp r2, 0x3 + ble _081A1A58 + b _081A1AC4 + .pool +_081A1A7C: + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r0, =gSpecialVar_0x8006 + ldrb r0, [r0] + ldr r2, =0x00000ca9 + adds r3, r2 + movs r1, 0x1 + ands r1, r0 + lsls r1, 3 + ldrb r2, [r3] + movs r0, 0x9 + negs r0, r0 +_081A1A94: + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + b _081A1AC4 + .pool +_081A1AA8: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + movs r0, 0xD0 + lsls r0, 4 + adds r2, r0 + ldr r3, =gUnknown_08611BFC + lsls r1, r4, 1 + lsls r0, r5, 2 + adds r1, r0 + adds r1, r3 + ldrh r0, [r2] + ldrh r1, [r1] + orrs r0, r1 + strh r0, [r2] +_081A1AC4: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A1968 + + thumb_func_start sub_81A1AD4 +sub_81A1AD4: @ 81A1AD4 + push {r4-r7,lr} + bl sub_81B8558 + movs r3, 0 + ldr r4, =gSpecialVar_0x8005 + ldrh r0, [r4] + cmp r3, r0 + bge _081A1B00 + ldr r7, =gUnknown_0203CEF8 + ldr r6, =gSaveBlock2Ptr + ldr r5, =0x00000caa +_081A1AEA: + adds r2, r3, r7 + ldr r0, [r6] + lsls r1, r3, 1 + adds r0, r5 + adds r0, r1 + ldrh r0, [r0] + strb r0, [r2] + adds r3, 0x1 + ldrh r0, [r4] + cmp r3, r0 + blt _081A1AEA +_081A1B00: + bl sub_80F94E8 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A1AD4 + + thumb_func_start sub_81A1B1C +sub_81A1B1C: @ 81A1B1C + push {lr} + bl DoSoftReset + pop {r0} + bx r0 + thumb_func_end sub_81A1B1C + + thumb_func_start sub_81A1B28 +sub_81A1B28: @ 81A1B28 + ldr r1, =gUnknown_0203BC88 + ldr r0, =gBattleFrontierTrainers + str r0, [r1] + bx lr + .pool + thumb_func_end sub_81A1B28 + + thumb_func_start sub_81A1B38 +sub_81A1B38: @ 81A1B38 + push {r4,r5,lr} + movs r4, 0 + movs r5, 0x64 +_081A1B3E: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, =0x00000caa + adds r0, r2 + adds r1, r0, r1 + ldrh r0, [r1] + subs r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x5 + bhi _081A1B76 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldrh r1, [r1] + subs r1, 0x1 + muls r1, r5 + adds r0, r1 + movs r1, 0x8E + lsls r1, 2 + adds r0, r1 + ldr r2, =gPlayerParty + adds r1, r4, 0 + muls r1, r5 + adds r1, r2 + movs r2, 0x64 + bl memcpy +_081A1B76: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _081A1B3E + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A1B38 + + thumb_func_start sub_81A1B98 +sub_81A1B98: @ 81A1B98 + push {lr} + ldr r0, =gSpecialVar_0x8006 + ldrh r1, [r0] + adds r2, r0, 0 + cmp r1, 0x3 + bls _081A1BA8 + movs r0, 0 + strh r0, [r2] +_081A1BA8: + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x7 + bhi _081A1C1E + lsls r0, 2 + ldr r1, =_081A1BC8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A1BC8: + .4byte _081A1BE8 + .4byte _081A1BF0 + .4byte _081A1BF8 + .4byte _081A1C0E + .4byte _081A1C06 + .4byte _081A1C00 + .4byte _081A1C14 + .4byte _081A1C1A +_081A1BE8: + ldrb r0, [r2] + bl sub_81A1EA8 + b _081A1C1E +_081A1BF0: + ldrb r0, [r2] + bl sub_81A2134 + b _081A1C1E +_081A1BF8: + ldrb r0, [r2] + bl sub_81A2460 + b _081A1C1E +_081A1C00: + bl sub_81A2698 + b _081A1C1E +_081A1C06: + ldrb r0, [r2] + bl sub_81A2C94 + b _081A1C1E +_081A1C0E: + bl sub_81A2968 + b _081A1C1E +_081A1C14: + bl sub_81A2F38 + b _081A1C1E +_081A1C1A: + bl sub_81A2FF8 +_081A1C1E: + pop {r0} + bx r0 + thumb_func_end sub_81A1B98 + + thumb_func_start sub_81A1C24 +sub_81A1C24: @ 81A1C24 + push {lr} + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + ldr r2, =0x00000cdc + adds r1, r2 + ldr r1, [r1] + ands r1, r0 + cmp r1, 0 + bne _081A1C44 + movs r0, 0 + b _081A1C46 + .pool +_081A1C44: + movs r0, 0x1 +_081A1C46: + pop {r1} + bx r1 + thumb_func_end sub_81A1C24 + + thumb_func_start sub_81A1C4C +sub_81A1C4C: @ 81A1C4C + push {r4,r5,lr} + sub sp, 0xC + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xE0 + bl GetStringCenterAlignXOffset + adds r3, r0, 0 + lsls r0, r5, 3 + adds r5, r0, 0x1 + ldr r0, =gUnknown_0203AB74 + ldrb r0, [r0] + lsls r3, 24 + lsrs r3, 24 + lsls r1, r5, 24 + lsrs r1, 24 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + bl Print + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A1C4C + + thumb_func_start sub_81A1C90 +sub_81A1C90: @ 81A1C90 + push {r4,lr} + sub sp, 0x34 + adds r2, r0, 0 + ldr r3, =gUnknown_0203AB74 + movs r1, 0xAE + mov r0, sp + adds r0, 0x2F +_081A1C9E: + strb r1, [r0] + subs r0, 0x1 + add r4, sp, 0xC + cmp r0, r4 + bge _081A1C9E + add r1, sp, 0x30 + movs r0, 0xFF + strb r0, [r1] + lsls r0, r2, 3 + adds r2, r0, 0x1 + ldrb r0, [r3] + lsls r1, r2, 24 + lsrs r1, 24 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x4 + bl Print + add sp, 0x34 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A1C90 + + thumb_func_start sub_81A1CD8 +sub_81A1CD8: @ 81A1CD8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + adds r5, r0, 0 + adds r4, r2, 0 + ldr r0, [sp, 0x30] + lsls r1, 16 + lsrs r6, r1, 16 + lsls r4, 24 + lsrs r4, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0xC] + lsls r0, 24 + lsrs r0, 24 + adds r7, r0, 0 + ldr r0, =gUnknown_0203AB74 + mov r10, r0 + ldrb r0, [r0] + str r7, [sp] + movs r1, 0xFF + mov r9, r1 + str r1, [sp, 0x4] + movs r1, 0 + mov r8, r1 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + adds r3, r4, 0 + bl Print + ldr r0, =0x0000270f + cmp r6, r0 + bls _081A1D24 + adds r6, r0, 0 +_081A1D24: + ldr r0, =gStringVar1 + adds r1, r6, 0 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EE302 + adds r0, r4, 0 + bl StringExpandPlaceholders + mov r1, r10 + ldrb r0, [r1] + str r7, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + ldr r3, [sp, 0xC] + bl Print + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A1CD8 + + thumb_func_start sub_81A1D78 +sub_81A1D78: @ 81A1D78 + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, [sp, 0x10] + lsls r0, 24 + lsls r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r4, =gSaveBlock2Ptr + ldr r4, [r4] + lsrs r1, 23 + lsrs r0, 22 + adds r1, r0 + movs r0, 0xCF + lsls r0, 4 + adds r4, r0 + adds r4, r1 + ldrh r1, [r4] + ldr r0, =gUnknown_085EE319 + str r5, [sp] + bl sub_81A1CD8 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A1D78 + + thumb_func_start sub_81A1DBC +sub_81A1DBC: @ 81A1DBC + push {lr} + lsls r0, 24 + lsls r1, 24 + ldr r2, =gSaveBlock2Ptr + ldr r2, [r2] + lsrs r1, 23 + lsrs r0, 22 + adds r1, r0 + movs r0, 0xCE + lsls r0, 4 + adds r2, r0 + adds r2, r1 + ldrh r0, [r2] + ldr r1, =0x0000270f + cmp r0, r1 + bls _081A1DDE + adds r0, r1, 0 +_081A1DDE: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A1DBC + + thumb_func_start sub_81A1DEC +sub_81A1DEC: @ 81A1DEC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + ldr r4, [sp, 0x20] + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 24 + lsrs r3, 24 + mov r9, r3 + lsls r4, 24 + lsrs r7, r4, 24 + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_81A1DBC + lsls r0, 16 + lsrs r4, r0, 16 + cmp r5, 0x1 + beq _081A1E38 + cmp r5, 0x1 + ble _081A1E2C + cmp r5, 0x2 + beq _081A1E48 + cmp r5, 0x3 + beq _081A1E58 +_081A1E2C: + cmp r6, 0 + beq _081A1E34 + movs r0, 0x2 + b _081A1E66 +_081A1E34: + movs r0, 0x1 + b _081A1E66 +_081A1E38: + cmp r6, 0 + beq _081A1E42 + movs r0, 0x80 + lsls r0, 8 + b _081A1E66 +_081A1E42: + movs r0, 0x80 + lsls r0, 7 + b _081A1E66 +_081A1E48: + cmp r6, 0 + beq _081A1E52 + movs r0, 0x80 + lsls r0, 10 + b _081A1E66 +_081A1E52: + movs r0, 0x80 + lsls r0, 9 + b _081A1E66 +_081A1E58: + cmp r6, 0 + beq _081A1E62 + movs r0, 0x80 + lsls r0, 12 + b _081A1E66 +_081A1E62: + movs r0, 0x80 + lsls r0, 11 +_081A1E66: + bl sub_81A1C24 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081A1E88 + ldr r0, =gUnknown_085EE311 + str r7, [sp] + adds r1, r4, 0 + mov r2, r8 + mov r3, r9 + bl sub_81A1CD8 + b _081A1E96 + .pool +_081A1E88: + ldr r0, =gUnknown_085EE320 + str r7, [sp] + adds r1, r4, 0 + mov r2, r8 + mov r3, r9 + bl sub_81A1CD8 +_081A1E96: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A1DEC + + thumb_func_start sub_81A1EA8 +sub_81A1EA8: @ 81A1EA8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, =gUnknown_0203AB74 + ldr r0, =gUnknown_08611C74 + bl AddWindow + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r4] + movs r1, 0x11 + bl FillWindowPixelBuffer + cmp r7, 0 + bne _081A1EF0 + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EE158 + bl StringExpandPlaceholders + b _081A1F28 + .pool +_081A1EF0: + cmp r7, 0x1 + bne _081A1F08 + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EE178 + bl StringExpandPlaceholders + b _081A1F28 + .pool +_081A1F08: + cmp r7, 0x2 + bne _081A1F20 + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EE198 + bl StringExpandPlaceholders + b _081A1F28 + .pool +_081A1F20: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EE1B7 + bl StringExpandPlaceholders +_081A1F28: + ldr r0, =gStringVar4 + movs r1, 0x2 + bl sub_81A1C4C + ldr r6, =gUnknown_0203AB74 + ldrb r0, [r6] + ldr r2, =gUnknown_085EE2F2 + movs r1, 0x31 + mov r8, r1 + str r1, [sp] + movs r5, 0xFF + str r5, [sp, 0x4] + movs r4, 0 + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x10 + bl Print + ldrb r0, [r6] + ldr r2, =gUnknown_085EE2F9 + movs r1, 0x61 + mov r9, r1 + str r1, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x10 + bl Print + movs r0, 0xA + bl sub_81A1C90 + mov r0, r8 + str r0, [sp] + adds r0, r7, 0 + movs r1, 0 + movs r2, 0x48 + movs r3, 0x84 + bl sub_81A1DEC + movs r0, 0x41 + str r0, [sp] + adds r0, r7, 0 + movs r1, 0 + movs r2, 0x48 + movs r3, 0x84 + bl sub_81A1D78 + mov r1, r9 + str r1, [sp] + adds r0, r7, 0 + movs r1, 0x1 + movs r2, 0x48 + movs r3, 0x84 + bl sub_81A1DEC + movs r0, 0x71 + str r0, [sp] + adds r0, r7, 0 + movs r1, 0x1 + movs r2, 0x48 + movs r3, 0x84 + bl sub_81A1D78 + ldrb r0, [r6] + bl PutWindowTilemap + ldrb r0, [r6] + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A1EA8 + + thumb_func_start sub_81A1FD8 +sub_81A1FD8: @ 81A1FD8 + push {lr} + lsls r0, 24 + lsls r1, 24 + ldr r2, =gSaveBlock2Ptr + ldr r2, [r2] + lsrs r1, 23 + lsrs r0, 22 + adds r1, r0 + ldr r0, =0x00000d0c + adds r2, r0 + adds r2, r1 + ldrh r0, [r2] + ldr r1, =0x0000270f + cmp r0, r1 + bls _081A1FF8 + adds r0, r1, 0 +_081A1FF8: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A1FD8 + + thumb_func_start sub_81A2008 +sub_81A2008: @ 81A2008 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + mov r12, r0 + adds r7, r1, 0 + adds r4, r2, 0 + ldr r6, [sp, 0x2C] + ldr r5, [sp, 0x30] + lsls r4, 16 + lsrs r4, 16 + lsls r3, 24 + lsrs r3, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gUnknown_0203AB74 + mov r10, r0 + ldrb r0, [r0] + str r5, [sp] + movs r1, 0xFF + mov r9, r1 + str r1, [sp, 0x4] + movs r1, 0 + mov r8, r1 + str r1, [sp, 0x8] + movs r1, 0x1 + mov r2, r12 + bl Print + ldr r0, =gStringVar1 + adds r1, r4, 0 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + adds r0, r4, 0 + adds r1, r7, 0 + bl StringExpandPlaceholders + mov r1, r10 + ldrb r0, [r1] + str r5, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + adds r3, r6, 0 + bl Print + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2008 + + thumb_func_start sub_81A2094 +sub_81A2094: @ 81A2094 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + ldr r4, [sp, 0x24] + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + lsls r3, 24 + lsrs r7, r3, 24 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_81A1FD8 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + cmp r5, 0 + beq _081A20CC + cmp r5, 0x1 + beq _081A20D8 +_081A20CC: + cmp r6, 0 + beq _081A20D4 + movs r0, 0x8 + b _081A20E6 +_081A20D4: + movs r0, 0x4 + b _081A20E6 +_081A20D8: + cmp r6, 0 + beq _081A20E2 + movs r0, 0x80 + lsls r0, 14 + b _081A20E6 +_081A20E2: + movs r0, 0x80 + lsls r0, 13 +_081A20E6: + bl sub_81A1C24 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081A210C + ldr r0, =gUnknown_085EE311 + ldr r1, =gUnknown_085EE338 + str r7, [sp] + str r4, [sp, 0x4] + mov r2, r8 + mov r3, r9 + bl sub_81A2008 + b _081A211C + .pool +_081A210C: + ldr r0, =gUnknown_085EE320 + ldr r1, =gUnknown_085EE338 + str r7, [sp] + str r4, [sp, 0x4] + mov r2, r8 + mov r3, r9 + bl sub_81A2008 +_081A211C: + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2094 + + thumb_func_start sub_81A2134 +sub_81A2134: @ 81A2134 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, =gUnknown_0203AB74 + ldr r0, =gUnknown_08611C74 + bl AddWindow + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r4] + movs r1, 0x11 + bl FillWindowPixelBuffer + cmp r7, 0 + bne _081A217C + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EE1DB + bl StringExpandPlaceholders + b _081A2184 + .pool +_081A217C: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EE1FE + bl StringExpandPlaceholders +_081A2184: + ldr r0, =gStringVar4 + movs r1, 0 + bl sub_81A1C4C + ldr r1, =gUnknown_0203AB74 + ldrb r0, [r1] + ldr r2, =gUnknown_085EE2F2 + movs r6, 0x21 + str r6, [sp] + movs r5, 0xFF + str r5, [sp, 0x4] + movs r4, 0 + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl Print + ldr r1, =gUnknown_0203AB74 + ldrb r0, [r1] + ldr r2, =gUnknown_085EE2F9 + movs r1, 0x61 + str r1, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl Print + movs r0, 0xA + bl sub_81A1C90 + str r6, [sp] + adds r0, r7, 0 + movs r1, 0 + movs r2, 0x40 + movs r3, 0x79 + bl sub_81A2094 + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + lsls r5, r7, 2 + ldr r1, =0x00000d14 + adds r0, r1 + adds r0, r5 + ldrh r2, [r0] + movs r0, 0x79 + mov r9, r0 + str r0, [sp] + movs r0, 0x31 + str r0, [sp, 0x4] + ldr r0, =gUnknown_085EE319 + ldr r1, =gUnknown_085EE338 + movs r3, 0x40 + bl sub_81A2008 + ldr r1, =gUnknown_085EE332 + mov r10, r1 + ldr r0, =gUnknown_085EE349 + mov r8, r0 + ldr r0, [r4] + ldr r1, =0x00000d1c + adds r0, r1 + adds r0, r5 + ldrh r2, [r0] + movs r6, 0x70 + str r6, [sp] + movs r0, 0x41 + str r0, [sp, 0x4] + mov r0, r10 + mov r1, r8 + movs r3, 0x40 + bl sub_81A2008 + movs r0, 0x61 + str r0, [sp] + adds r0, r7, 0 + movs r1, 0x1 + movs r2, 0x40 + movs r3, 0x79 + bl sub_81A2094 + ldr r0, [r4] + ldr r1, =0x00000d16 + adds r0, r1 + adds r0, r5 + ldrh r2, [r0] + mov r0, r9 + str r0, [sp] + movs r0, 0x71 + str r0, [sp, 0x4] + ldr r0, =gUnknown_085EE319 + ldr r1, =gUnknown_085EE338 + movs r3, 0x40 + bl sub_81A2008 + ldr r0, [r4] + ldr r1, =0x00000d1e + adds r0, r1 + adds r0, r5 + ldrh r2, [r0] + str r6, [sp] + movs r0, 0x81 + str r0, [sp, 0x4] + mov r0, r10 + mov r1, r8 + movs r3, 0x40 + bl sub_81A2008 + ldr r1, =gUnknown_0203AB74 + ldrb r0, [r1] + bl PutWindowTilemap + ldr r1, =gUnknown_0203AB74 + ldrb r0, [r1] + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2134 + + thumb_func_start sub_81A22B8 +sub_81A22B8: @ 81A22B8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + adds r5, r0, 0 + adds r4, r2, 0 + ldr r0, [sp, 0x30] + lsls r1, 16 + lsrs r6, r1, 16 + lsls r4, 24 + lsrs r4, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0xC] + lsls r0, 24 + lsrs r0, 24 + adds r7, r0, 0 + ldr r0, =gUnknown_0203AB74 + mov r10, r0 + ldrb r0, [r0] + str r7, [sp] + movs r1, 0xFF + mov r9, r1 + str r1, [sp, 0x4] + movs r1, 0 + mov r8, r1 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + adds r3, r4, 0 + bl Print + ldr r0, =0x0000270f + cmp r6, r0 + bls _081A2304 + adds r6, r0, 0 +_081A2304: + ldr r0, =gStringVar1 + adds r1, r6, 0 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EE302 + adds r0, r4, 0 + bl StringExpandPlaceholders + mov r1, r10 + ldrb r0, [r1] + str r7, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + ldr r3, [sp, 0xC] + bl Print + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A22B8 + + thumb_func_start sub_81A2358 +sub_81A2358: @ 81A2358 + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, [sp, 0x10] + lsls r0, 24 + lsls r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r4, =gSaveBlock2Ptr + ldr r4, [r4] + lsrs r1, 23 + lsrs r0, 22 + adds r1, r0 + movs r0, 0xDD + lsls r0, 4 + adds r4, r0 + adds r4, r1 + ldrh r1, [r4] + ldr r0, =gUnknown_085EE319 + str r5, [sp] + bl sub_81A22B8 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2358 + + thumb_func_start sub_81A239C +sub_81A239C: @ 81A239C + push {lr} + lsls r0, 24 + lsls r1, 24 + ldr r2, =gSaveBlock2Ptr + ldr r2, [r2] + lsrs r1, 23 + lsrs r0, 22 + adds r1, r0 + ldr r0, =0x00000dc8 + adds r2, r0 + adds r2, r1 + ldrh r0, [r2] + ldr r1, =0x0000270f + cmp r0, r1 + bls _081A23BC + adds r0, r1, 0 +_081A23BC: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A239C + + thumb_func_start sub_81A23CC +sub_81A23CC: @ 81A23CC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + ldr r4, [sp, 0x20] + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 24 + lsrs r3, 24 + mov r9, r3 + lsls r4, 24 + lsrs r7, r4, 24 + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_81A239C + lsls r0, 16 + lsrs r4, r0, 16 + cmp r5, 0 + beq _081A2404 + cmp r5, 0x1 + beq _081A2410 +_081A2404: + cmp r6, 0 + beq _081A240C + movs r0, 0x20 + b _081A241E +_081A240C: + movs r0, 0x10 + b _081A241E +_081A2410: + cmp r6, 0 + beq _081A241A + movs r0, 0x80 + lsls r0, 16 + b _081A241E +_081A241A: + movs r0, 0x80 + lsls r0, 15 +_081A241E: + bl sub_81A1C24 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081A2440 + ldr r0, =gUnknown_085EE311 + str r7, [sp] + adds r1, r4, 0 + mov r2, r8 + mov r3, r9 + bl sub_81A22B8 + b _081A244E + .pool +_081A2440: + ldr r0, =gUnknown_085EE320 + str r7, [sp] + adds r1, r4, 0 + mov r2, r8 + mov r3, r9 + bl sub_81A22B8 +_081A244E: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A23CC + + thumb_func_start sub_81A2460 +sub_81A2460: @ 81A2460 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, =gUnknown_0203AB74 + ldr r0, =gUnknown_08611C74 + bl AddWindow + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r4] + movs r1, 0x11 + bl FillWindowPixelBuffer + cmp r7, 0 + bne _081A24A8 + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EE221 + bl StringExpandPlaceholders + b _081A24B0 + .pool +_081A24A8: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EE241 + bl StringExpandPlaceholders +_081A24B0: + ldr r0, =gStringVar4 + movs r1, 0x2 + bl sub_81A1C4C + ldr r6, =gUnknown_0203AB74 + ldrb r0, [r6] + ldr r2, =gUnknown_085EE2F2 + movs r1, 0x31 + mov r8, r1 + str r1, [sp] + movs r5, 0xFF + str r5, [sp, 0x4] + movs r4, 0 + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x10 + bl Print + ldrb r0, [r6] + ldr r2, =gUnknown_085EE2F9 + movs r1, 0x61 + mov r9, r1 + str r1, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x10 + bl Print + movs r0, 0xA + bl sub_81A1C90 + mov r0, r8 + str r0, [sp] + adds r0, r7, 0 + movs r1, 0 + movs r2, 0x48 + movs r3, 0x83 + bl sub_81A23CC + movs r0, 0x41 + str r0, [sp] + adds r0, r7, 0 + movs r1, 0 + movs r2, 0x48 + movs r3, 0x83 + bl sub_81A2358 + mov r1, r9 + str r1, [sp] + adds r0, r7, 0 + movs r1, 0x1 + movs r2, 0x48 + movs r3, 0x83 + bl sub_81A23CC + movs r0, 0x71 + str r0, [sp] + adds r0, r7, 0 + movs r1, 0x1 + movs r2, 0x48 + movs r3, 0x83 + bl sub_81A2358 + ldrb r0, [r6] + bl PutWindowTilemap + ldrb r0, [r6] + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2460 + + thumb_func_start sub_81A2560 +sub_81A2560: @ 81A2560 + push {lr} + lsls r0, 24 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + lsrs r0, 23 + ldr r2, =0x00000e04 + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + ldr r1, =0x0000270f + cmp r0, r1 + bls _081A257A + adds r0, r1, 0 +_081A257A: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A2560 + + thumb_func_start sub_81A258C +sub_81A258C: @ 81A258C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + mov r12, r0 + adds r7, r1, 0 + adds r4, r2, 0 + ldr r6, [sp, 0x2C] + ldr r5, [sp, 0x30] + lsls r4, 16 + lsrs r4, 16 + lsls r3, 24 + lsrs r3, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gUnknown_0203AB74 + mov r10, r0 + ldrb r0, [r0] + str r5, [sp] + movs r1, 0xFF + mov r9, r1 + str r1, [sp, 0x4] + movs r1, 0 + mov r8, r1 + str r1, [sp, 0x8] + movs r1, 0x1 + mov r2, r12 + bl Print + ldr r0, =gStringVar1 + adds r1, r4, 0 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + adds r0, r4, 0 + adds r1, r7, 0 + bl StringExpandPlaceholders + mov r1, r10 + ldrb r0, [r1] + str r5, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + adds r3, r6, 0 + bl Print + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A258C + + thumb_func_start sub_81A2618 +sub_81A2618: @ 81A2618 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + lsls r2, 24 + lsrs r5, r2, 24 + lsls r3, 24 + lsrs r6, r3, 24 + adds r0, r4, 0 + bl sub_81A2560 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r4, 0 + beq _081A2648 + movs r0, 0x80 + lsls r0, 4 + b _081A264C +_081A2648: + movs r0, 0x80 + lsls r0, 3 +_081A264C: + bl sub_81A1C24 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081A2674 + ldr r0, =gUnknown_085EE311 + ldr r1, =gUnknown_085EE35B + str r5, [sp] + str r6, [sp, 0x4] + adds r2, r7, 0 + mov r3, r8 + bl sub_81A2008 + b _081A2684 + .pool +_081A2674: + ldr r0, =gUnknown_085EE320 + ldr r1, =gUnknown_085EE35B + str r5, [sp] + str r6, [sp, 0x4] + adds r2, r7, 0 + mov r3, r8 + bl sub_81A2008 +_081A2684: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2618 + + thumb_func_start sub_81A2698 +sub_81A2698: @ 81A2698 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + ldr r6, =gUnknown_0203AB74 + ldr r0, =gUnknown_08611C74 + bl AddWindow + strb r0, [r6] + ldrb r0, [r6] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r6] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EE261 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0 + bl sub_81A1C4C + ldrb r0, [r6] + ldr r2, =gUnknown_085EE2F2 + movs r1, 0x21 + str r1, [sp] + movs r5, 0xFF + str r5, [sp, 0x4] + movs r4, 0 + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl Print + ldrb r0, [r6] + ldr r2, =gUnknown_085EE2F9 + movs r1, 0x61 + str r1, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl Print + movs r0, 0xA + bl sub_81A1C90 + movs r0, 0 + movs r1, 0x40 + movs r2, 0x72 + movs r3, 0x21 + bl sub_81A2618 + ldr r0, =gUnknown_085EE319 + mov r10, r0 + ldr r7, =gUnknown_085EE35B + ldr r5, =gSaveBlock2Ptr + ldr r0, [r5] + ldr r1, =0x00000e08 + adds r0, r1 + ldrh r2, [r0] + movs r4, 0x72 + str r4, [sp] + movs r0, 0x31 + str r0, [sp, 0x4] + mov r0, r10 + adds r1, r7, 0 + movs r3, 0x40 + bl sub_81A258C + ldr r0, =gUnknown_085EE332 + mov r8, r0 + ldr r1, =gUnknown_085EE36D + mov r9, r1 + ldr r0, [r5] + ldr r1, =0x00000e0c + adds r0, r1 + ldrh r2, [r0] + str r4, [sp] + movs r0, 0x41 + str r0, [sp, 0x4] + mov r0, r8 + mov r1, r9 + movs r3, 0x40 + bl sub_81A258C + movs r0, 0x1 + movs r1, 0x40 + movs r2, 0x72 + movs r3, 0x61 + bl sub_81A2618 + ldr r0, [r5] + ldr r1, =0x00000e0a + adds r0, r1 + ldrh r2, [r0] + str r4, [sp] + movs r0, 0x71 + str r0, [sp, 0x4] + mov r0, r10 + adds r1, r7, 0 + movs r3, 0x40 + bl sub_81A258C + ldr r0, [r5] + ldr r1, =0x00000e0e + adds r0, r1 + ldrh r2, [r0] + str r4, [sp] + movs r0, 0x81 + str r0, [sp, 0x4] + mov r0, r8 + mov r1, r9 + movs r3, 0x40 + bl sub_81A258C + ldrb r0, [r6] + bl PutWindowTilemap + ldrb r0, [r6] + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2698 + + thumb_func_start sub_81A27E8 +sub_81A27E8: @ 81A27E8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + adds r5, r0, 0 + adds r4, r2, 0 + ldr r0, [sp, 0x30] + lsls r1, 16 + lsrs r6, r1, 16 + lsls r4, 24 + lsrs r4, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0xC] + lsls r0, 24 + lsrs r0, 24 + adds r7, r0, 0 + ldr r0, =gUnknown_0203AB74 + mov r10, r0 + ldrb r0, [r0] + str r7, [sp] + movs r1, 0xFF + mov r9, r1 + str r1, [sp, 0x4] + movs r1, 0 + mov r8, r1 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + adds r3, r4, 0 + bl Print + ldr r0, =0x0000270f + cmp r6, r0 + bls _081A2834 + adds r6, r0, 0 +_081A2834: + ldr r0, =gStringVar1 + adds r1, r6, 0 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EE381 + adds r0, r4, 0 + bl StringExpandPlaceholders + mov r1, r10 + ldrb r0, [r1] + str r7, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + ldr r3, [sp, 0xC] + bl Print + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A27E8 + + thumb_func_start sub_81A2888 +sub_81A2888: @ 81A2888 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r1, 0 + adds r5, r2, 0 + lsls r0, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r3, 24 + lsrs r3, 24 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + lsrs r0, 23 + ldr r2, =0x00000dde + adds r1, r2 + adds r1, r0 + ldrh r1, [r1] + ldr r0, =gUnknown_085EE319 + str r3, [sp] + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_81A27E8 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2888 + + thumb_func_start sub_81A28CC +sub_81A28CC: @ 81A28CC + push {lr} + lsls r0, 24 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + lsrs r0, 23 + ldr r2, =0x00000dda + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + ldr r1, =0x0000270f + cmp r0, r1 + bls _081A28E6 + adds r0, r1, 0 +_081A28E6: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A28CC + + thumb_func_start sub_81A28F8 +sub_81A28F8: @ 81A28F8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 24 + lsrs r6, r3, 24 + adds r0, r4, 0 + bl sub_81A28CC + lsls r0, 16 + lsrs r5, r0, 16 + cmp r4, 0 + beq _081A2926 + movs r0, 0x80 + b _081A2928 +_081A2926: + movs r0, 0x40 +_081A2928: + bl sub_81A1C24 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081A2948 + ldr r0, =gUnknown_085EE311 + str r6, [sp] + adds r1, r5, 0 + adds r2, r7, 0 + mov r3, r8 + bl sub_81A27E8 + b _081A2956 + .pool +_081A2948: + ldr r0, =gUnknown_085EE320 + str r6, [sp] + adds r1, r5, 0 + adds r2, r7, 0 + mov r3, r8 + bl sub_81A27E8 +_081A2956: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A28F8 + + thumb_func_start sub_81A2968 +sub_81A2968: @ 81A2968 + push {r4-r6,lr} + sub sp, 0xC + ldr r5, =gUnknown_0203AB74 + ldr r0, =gUnknown_08611C74 + bl AddWindow + strb r0, [r5] + ldrb r0, [r5] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r5] + movs r1, 0x11 + bl FillWindowPixelBuffer + movs r0, 0xA + bl sub_81A1C90 + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EE27C + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x2 + bl sub_81A1C4C + ldrb r0, [r5] + ldr r2, =gUnknown_085EE2F2 + movs r1, 0x31 + str r1, [sp] + movs r6, 0xFF + str r6, [sp, 0x4] + movs r4, 0 + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x10 + bl Print + ldrb r0, [r5] + ldr r2, =gUnknown_085EE2F9 + movs r1, 0x61 + str r1, [sp] + str r6, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x10 + bl Print + movs r0, 0 + movs r1, 0x48 + movs r2, 0x7E + movs r3, 0x31 + bl sub_81A28F8 + movs r0, 0 + movs r1, 0x48 + movs r2, 0x7E + movs r3, 0x41 + bl sub_81A2888 + movs r0, 0x1 + movs r1, 0x48 + movs r2, 0x7E + movs r3, 0x61 + bl sub_81A28F8 + movs r0, 0x1 + movs r1, 0x48 + movs r2, 0x7E + movs r3, 0x71 + bl sub_81A2888 + ldrb r0, [r5] + bl PutWindowTilemap + ldrb r0, [r5] + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2968 + + thumb_func_start sub_81A2A28 +sub_81A2A28: @ 81A2A28 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + mov r12, r0 + ldr r4, [sp, 0x38] + ldr r5, [sp, 0x3C] + ldr r0, [sp, 0x40] + lsls r1, 16 + lsrs r7, r1, 16 + lsls r2, 16 + lsrs r2, 16 + str r2, [sp, 0xC] + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + str r4, [sp, 0x10] + lsls r5, 24 + lsrs r5, 24 + str r5, [sp, 0x14] + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + ldr r0, =gUnknown_0203AB74 + mov r10, r0 + ldrb r0, [r0] + str r6, [sp] + movs r1, 0xFF + mov r9, r1 + str r1, [sp, 0x4] + movs r1, 0 + mov r8, r1 + str r1, [sp, 0x8] + movs r1, 0x1 + mov r2, r12 + bl Print + ldr r0, =0x0000270f + cmp r7, r0 + bls _081A2A80 + adds r7, r0, 0 +_081A2A80: + ldr r5, =gStringVar1 + adds r0, r5, 0 + adds r1, r7, 0 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EE302 + adds r0, r4, 0 + bl StringExpandPlaceholders + mov r1, r10 + ldrb r0, [r1] + str r6, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + ldr r3, [sp, 0x10] + bl Print + adds r0, r5, 0 + ldr r1, [sp, 0xC] + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalStringN + ldr r1, =gUnknown_085EE392 + adds r0, r4, 0 + bl StringExpandPlaceholders + mov r1, r10 + ldrb r0, [r1] + str r6, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + ldr r3, [sp, 0x14] + bl Print + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2A28 + + thumb_func_start sub_81A2B04 +sub_81A2B04: @ 81A2B04 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + adds r6, r2, 0 + ldr r4, [sp, 0x24] + ldr r5, [sp, 0x28] + lsls r0, 24 + lsls r1, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r2, =gSaveBlock2Ptr + ldr r2, [r2] + lsrs r1, 23 + lsrs r0, 22 + adds r1, r0 + ldr r7, =0x00000dea + adds r0, r2, r7 + adds r0, r1 + ldrh r0, [r0] + mov r8, r0 + ldr r0, =0x00000dfa + adds r2, r0 + adds r2, r1 + ldrh r2, [r2] + ldr r0, =gUnknown_085EE319 + str r3, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + mov r1, r8 + adds r3, r6, 0 + bl sub_81A2A28 + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2B04 + + thumb_func_start sub_81A2B70 +sub_81A2B70: @ 81A2B70 + push {lr} + lsls r0, 24 + lsls r1, 24 + ldr r2, =gSaveBlock2Ptr + ldr r2, [r2] + lsrs r1, 23 + lsrs r0, 22 + adds r1, r0 + ldr r0, =0x00000de2 + adds r2, r0 + adds r2, r1 + ldrh r0, [r2] + ldr r1, =0x0000270f + cmp r0, r1 + bls _081A2B90 + adds r0, r1, 0 +_081A2B90: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A2B70 + + thumb_func_start sub_81A2BA0 +sub_81A2BA0: @ 81A2BA0 + push {lr} + lsls r0, 24 + lsls r1, 24 + ldr r2, =gSaveBlock2Ptr + ldr r2, [r2] + lsrs r1, 23 + lsrs r0, 22 + adds r1, r0 + ldr r0, =0x00000df2 + adds r2, r0 + adds r2, r1 + ldrh r0, [r2] + ldr r1, =0x0000270f + cmp r0, r1 + bls _081A2BC0 + adds r0, r1, 0 +_081A2BC0: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A2BA0 + + thumb_func_start sub_81A2BD0 +sub_81A2BD0: @ 81A2BD0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + ldr r4, [sp, 0x30] + ldr r5, [sp, 0x34] + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0xC] + lsls r3, 24 + lsrs r3, 24 + mov r8, r3 + lsls r4, 24 + lsrs r4, 24 + mov r9, r4 + lsls r5, 24 + lsrs r5, 24 + mov r10, r5 + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_81A2B70 + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_81A2BA0 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r6, 0 + beq _081A2C20 + cmp r6, 0x1 + beq _081A2C30 +_081A2C20: + cmp r7, 0 + beq _081A2C2A + movs r0, 0x80 + lsls r0, 2 + b _081A2C3E +_081A2C2A: + movs r0, 0x80 + lsls r0, 1 + b _081A2C3E +_081A2C30: + cmp r7, 0 + beq _081A2C3A + movs r0, 0x80 + lsls r0, 18 + b _081A2C3E +_081A2C3A: + movs r0, 0x80 + lsls r0, 17 +_081A2C3E: + bl sub_81A1C24 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081A2C68 + ldr r0, =gUnknown_085EE311 + mov r1, r8 + str r1, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r10 + str r1, [sp, 0x8] + adds r1, r5, 0 + adds r2, r4, 0 + ldr r3, [sp, 0xC] + bl sub_81A2A28 + b _081A2C80 + .pool +_081A2C68: + ldr r0, =gUnknown_085EE320 + mov r1, r8 + str r1, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r10 + str r1, [sp, 0x8] + adds r1, r5, 0 + adds r2, r4, 0 + ldr r3, [sp, 0xC] + bl sub_81A2A28 +_081A2C80: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2BD0 + + thumb_func_start sub_81A2C94 +sub_81A2C94: @ 81A2C94 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, =gUnknown_0203AB74 + ldr r0, =gUnknown_08611C74 + bl AddWindow + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r4] + movs r1, 0x11 + bl FillWindowPixelBuffer + cmp r7, 0 + bne _081A2CD8 + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EE298 + bl StringExpandPlaceholders + b _081A2CE0 + .pool +_081A2CD8: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EE2B8 + bl StringExpandPlaceholders +_081A2CE0: + ldr r0, =gStringVar4 + movs r1, 0 + bl sub_81A1C4C + ldr r0, =gUnknown_0203AB74 + mov r8, r0 + ldrb r0, [r0] + ldr r2, =gUnknown_085EE2F2 + movs r6, 0x21 + str r6, [sp] + movs r5, 0xFF + str r5, [sp, 0x4] + movs r4, 0 + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl Print + mov r1, r8 + ldrb r0, [r1] + ldr r2, =gUnknown_085EE326 + str r6, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x98 + bl Print + mov r1, r8 + ldrb r0, [r1] + ldr r2, =gUnknown_085EE2F9 + movs r1, 0x61 + str r1, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl Print + movs r0, 0xA + bl sub_81A1C90 + movs r4, 0x9E + str r4, [sp] + movs r0, 0x31 + str r0, [sp, 0x4] + adds r0, r7, 0 + movs r1, 0 + movs r2, 0x8 + movs r3, 0x40 + bl sub_81A2BD0 + str r4, [sp] + movs r0, 0x41 + str r0, [sp, 0x4] + adds r0, r7, 0 + movs r1, 0 + movs r2, 0x8 + movs r3, 0x40 + bl sub_81A2B04 + str r4, [sp] + movs r0, 0x71 + str r0, [sp, 0x4] + adds r0, r7, 0 + movs r1, 0x1 + movs r2, 0x8 + movs r3, 0x40 + bl sub_81A2BD0 + str r4, [sp] + movs r0, 0x81 + str r0, [sp, 0x4] + adds r0, r7, 0 + movs r1, 0x1 + movs r2, 0x8 + movs r3, 0x40 + bl sub_81A2B04 + mov r1, r8 + ldrb r0, [r1] + bl PutWindowTilemap + mov r1, r8 + ldrb r0, [r1] + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2C94 + + thumb_func_start sub_81A2DB4 +sub_81A2DB4: @ 81A2DB4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + adds r5, r0, 0 + adds r4, r2, 0 + ldr r0, [sp, 0x30] + lsls r1, 16 + lsrs r6, r1, 16 + lsls r4, 24 + lsrs r4, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0xC] + lsls r0, 24 + lsrs r0, 24 + adds r7, r0, 0 + ldr r0, =gUnknown_0203AB74 + mov r10, r0 + ldrb r0, [r0] + str r7, [sp] + movs r1, 0xFF + mov r9, r1 + str r1, [sp, 0x4] + movs r1, 0 + mov r8, r1 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + adds r3, r4, 0 + bl Print + ldr r0, =0x0000270f + cmp r6, r0 + bls _081A2E00 + adds r6, r0, 0 +_081A2E00: + ldr r0, =gStringVar1 + adds r1, r6, 0 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EE39C + adds r0, r4, 0 + bl StringExpandPlaceholders + mov r1, r10 + ldrb r0, [r1] + str r7, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + ldr r3, [sp, 0xC] + bl Print + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2DB4 + + thumb_func_start sub_81A2E54 +sub_81A2E54: @ 81A2E54 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r1, 0 + adds r5, r2, 0 + lsls r0, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r3, 24 + lsrs r3, 24 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + lsrs r0, 23 + ldr r2, =0x00000e1e + adds r1, r2 + adds r1, r0 + ldrh r1, [r1] + ldr r0, =gUnknown_085EE319 + str r3, [sp] + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_81A2DB4 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2E54 + + thumb_func_start sub_81A2E98 +sub_81A2E98: @ 81A2E98 + push {lr} + lsls r0, 24 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + lsrs r0, 23 + ldr r2, =0x00000e1a + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + ldr r1, =0x0000270f + cmp r0, r1 + bls _081A2EB2 + adds r0, r1, 0 +_081A2EB2: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A2E98 + + thumb_func_start sub_81A2EC4 +sub_81A2EC4: @ 81A2EC4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 24 + lsrs r6, r3, 24 + adds r0, r4, 0 + bl sub_81A2E98 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r4, 0 + beq _081A2EF4 + movs r0, 0x80 + lsls r0, 6 + b _081A2EF8 +_081A2EF4: + movs r0, 0x80 + lsls r0, 5 +_081A2EF8: + bl sub_81A1C24 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081A2F18 + ldr r0, =gUnknown_085EE311 + str r6, [sp] + adds r1, r5, 0 + adds r2, r7, 0 + mov r3, r8 + bl sub_81A2DB4 + b _081A2F26 + .pool +_081A2F18: + ldr r0, =gUnknown_085EE320 + str r6, [sp] + adds r1, r5, 0 + adds r2, r7, 0 + mov r3, r8 + bl sub_81A2DB4 +_081A2F26: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2EC4 + + thumb_func_start sub_81A2F38 +sub_81A2F38: @ 81A2F38 + push {r4-r6,lr} + sub sp, 0xC + ldr r5, =gUnknown_0203AB74 + ldr r0, =gUnknown_08611C74 + bl AddWindow + strb r0, [r5] + ldrb r0, [r5] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r5] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EE2D8 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x2 + bl sub_81A1C4C + ldrb r0, [r5] + ldr r2, =gUnknown_085EE2F2 + movs r1, 0x31 + str r1, [sp] + movs r6, 0xFF + str r6, [sp, 0x4] + movs r4, 0 + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl Print + ldrb r0, [r5] + ldr r2, =gUnknown_085EE2F9 + movs r1, 0x61 + str r1, [sp] + str r6, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl Print + movs r0, 0xA + bl sub_81A1C90 + movs r0, 0 + movs r1, 0x40 + movs r2, 0x6F + movs r3, 0x31 + bl sub_81A2EC4 + movs r0, 0 + movs r1, 0x40 + movs r2, 0x6F + movs r3, 0x41 + bl sub_81A2E54 + movs r0, 0x1 + movs r1, 0x40 + movs r2, 0x6F + movs r3, 0x61 + bl sub_81A2EC4 + movs r0, 0x1 + movs r1, 0x40 + movs r2, 0x6F + movs r3, 0x71 + bl sub_81A2E54 + ldrb r0, [r5] + bl PutWindowTilemap + ldrb r0, [r5] + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2F38 + + thumb_func_start sub_81A2FF8 +sub_81A2FF8: @ 81A2FF8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + ldr r4, =gUnknown_0203AB74 + ldr r0, =gUnknown_08611C7C + bl AddWindow + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r4] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r0, =gStringVar4 + mov r9, r0 + ldr r1, =gUnknown_085EDF86 + bl StringExpandPlaceholders + movs r0, 0x1 + mov r1, r9 + movs r2, 0xD0 + bl GetStringCenterAlignXOffset + adds r3, r0, 0 + ldrb r0, [r4] + lsls r3, 24 + lsrs r3, 24 + movs r1, 0x1 + str r1, [sp] + movs r6, 0xFF + str r6, [sp, 0x4] + movs r5, 0 + str r5, [sp, 0x8] + mov r2, r9 + bl Print + ldr r7, =gUnknown_085EDFA0 + movs r0, 0x1 + adds r1, r7, 0 + movs r2, 0x26 + bl GetStringRightAlignXOffset + adds r3, r0, 0 + adds r3, 0x32 + ldrb r0, [r4] + lsls r3, 24 + lsrs r3, 24 + movs r1, 0x19 + mov r8, r1 + str r1, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + adds r2, r7, 0 + bl Print + ldr r7, =gUnknown_085EDFA4 + movs r0, 0x1 + adds r1, r7, 0 + movs r2, 0x26 + bl GetStringRightAlignXOffset + adds r3, r0, 0 + adds r3, 0x58 + ldrb r0, [r4] + lsls r3, 24 + lsrs r3, 24 + mov r2, r8 + str r2, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + adds r2, r7, 0 + bl Print + ldr r7, =gUnknown_085EDFA8 + movs r0, 0x1 + adds r1, r7, 0 + movs r2, 0x26 + bl GetStringRightAlignXOffset + adds r3, r0, 0 + adds r3, 0x7E + ldrb r0, [r4] + lsls r3, 24 + lsrs r3, 24 + mov r1, r8 + str r1, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + adds r2, r7, 0 + bl Print + ldr r7, =gUnknown_085EDFAC + movs r0, 0x1 + adds r1, r7, 0 + movs r2, 0x26 + bl GetStringRightAlignXOffset + adds r3, r0, 0 + adds r3, 0xA4 + ldrb r0, [r4] + lsls r3, 24 + lsrs r3, 24 + mov r2, r8 + str r2, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + adds r2, r7, 0 + bl Print + ldrb r0, [r4] + ldr r2, =gUnknown_085EB0E8 + movs r1, 0x29 + str r1, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x6 + bl Print + ldrb r0, [r4] + ldr r2, =gUnknown_085EB0ED + movs r1, 0x39 + str r1, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x6 + bl Print + ldrb r0, [r4] + ldr r2, =gUnknown_085EB0F4 + movs r1, 0x49 + str r1, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x6 + bl Print + ldrb r0, [r4] + ldr r2, =gUnknown_085EB0F9 + movs r1, 0x59 + str r1, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x6 + bl Print + ldrb r0, [r4] + ldr r2, =gUnknown_085EB0FF + movs r1, 0x69 + str r1, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x6 + bl Print + movs r1, 0 +_081A314A: + movs r5, 0 + adds r0, r1, 0x1 + mov r8, r0 + lsls r0, r1, 28 + movs r2, 0xA4 + lsls r2, 22 + adds r0, r2 + lsrs r7, r0, 24 + lsls r4, r1, 3 +_081A315C: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000624 + adds r0, r1 + adds r0, r4 + ldrh r1, [r0] + mov r0, r9 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalStringN + ldr r6, =gUnknown_0203AB74 + ldrb r0, [r6] + movs r1, 0x26 + adds r3, r5, 0 + muls r3, r1 + adds r3, 0x40 + lsls r3, 24 + lsrs r3, 24 + str r7, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + mov r2, r9 + bl Print + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _081A315C + mov r1, r8 + cmp r1, 0x4 + ble _081A314A + ldrb r0, [r6] + bl PutWindowTilemap + ldrb r0, [r6] + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A2FF8 + + thumb_func_start sub_81A31FC +sub_81A31FC: @ 81A31FC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r7, r0, 30 + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + cmp r4, 0x6 + bls _081A3232 + b _081A35CE +_081A3232: + lsls r0, r4, 2 + ldr r1, =_081A3250 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A3250: + .4byte _081A326C + .4byte _081A33A8 + .4byte _081A3414 + .4byte _081A347C + .4byte _081A34CC + .4byte _081A354C + .4byte _081A3594 +_081A326C: + ldr r2, =gSaveBlock2Ptr + mov r9, r2 + ldr r0, [r2] + lsls r3, r7, 1 + mov r10, r3 + mov r2, r8 + lsls r1, r2, 2 + add r1, r10 + str r1, [sp, 0x20] + movs r3, 0xCE + lsls r3, 4 + adds r1, r0, r3 + ldr r2, [sp, 0x20] + adds r1, r2 + adds r3, 0x10 + adds r0, r3 + adds r0, r2 + ldrh r1, [r1] + ldrh r2, [r0] + cmp r1, r2 + bhi _081A3298 + b _081A35CE +_081A3298: + strh r1, [r0] + mov r3, r8 + cmp r3, 0x3 + bne _081A32F2 + ldr r6, =gBattleScripting + adds r6, 0x25 + ldrb r0, [r6] + movs r4, 0x1 + eors r0, r4 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r5, =gUnknown_020229F0 + adds r1, r5 + mov r0, sp + bl StringCopy + mov r0, sp + bl StripExtCtrlCodes + lsls r1, r7, 3 + ldr r0, =0x00000ee1 + adds r1, r0 + mov r2, r9 + ldr r0, [r2] + adds r0, r1 + mov r1, sp + bl StringCopy + ldrb r0, [r6] + eors r4, r0 + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + subs r5, 0x4 + adds r0, r5 + ldr r0, [r0] + lsls r2, r7, 2 + ldr r1, =0x00000ef1 + adds r2, r1 + mov r3, r9 + ldr r1, [r3] + adds r1, r2 + bl write_word_to_mem +_081A32F2: + mov r7, r9 + ldr r0, [r7] + movs r1, 0xCE + lsls r1, 4 + adds r0, r1 + ldr r2, [sp, 0x20] + adds r0, r2 + ldrh r0, [r0] + cmp r0, 0x1 + bhi _081A3308 + b _081A35CE +_081A3308: + bl sub_80EE818 + lsls r0, 24 + cmp r0, 0 + bne _081A3314 + b _081A35CE +_081A3314: + mov r3, r8 + cmp r3, 0x1 + beq _081A335A + cmp r3, 0x1 + bgt _081A3338 + cmp r3, 0 + beq _081A3344 + b _081A35CE + .pool +_081A3338: + mov r7, r8 + cmp r7, 0x2 + beq _081A3374 + cmp r7, 0x3 + beq _081A338E + b _081A35CE +_081A3344: + mov r1, r9 + ldr r0, [r1] + movs r2, 0xCE + lsls r2, 4 + adds r0, r2 + add r0, r10 + ldrh r0, [r0] + movs r1, 0x1 + bl sub_80EE8C8 + b _081A35CE +_081A335A: + mov r3, r9 + ldr r0, [r3] + mov r1, r10 + adds r1, 0x4 + movs r7, 0xCE + lsls r7, 4 + adds r0, r7 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x2 + bl sub_80EE8C8 + b _081A35CE +_081A3374: + mov r1, r9 + ldr r0, [r1] + mov r1, r10 + adds r1, 0x8 + movs r2, 0xCE + lsls r2, 4 + adds r0, r2 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x3 + bl sub_80EE8C8 + b _081A35CE +_081A338E: + mov r3, r9 + ldr r0, [r3] + mov r1, r10 + adds r1, 0xC + movs r7, 0xCE + lsls r7, 4 + adds r0, r7 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x4 + bl sub_80EE8C8 + b _081A35CE +_081A33A8: + ldr r6, =gSaveBlock2Ptr + ldr r0, [r6] + lsls r7, 1 + mov r2, r8 + lsls r1, r2, 2 + adds r4, r7, r1 + ldr r5, =0x00000d0c + adds r1, r0, r5 + adds r1, r4 + ldr r3, =0x00000d14 + adds r0, r3 + adds r0, r4 + ldrh r2, [r1] + ldrh r3, [r0] + cmp r2, r3 + bhi _081A33CA + b _081A35CE +_081A33CA: + strh r2, [r0] + ldrh r0, [r1] + cmp r0, 0x1 + bhi _081A33D4 + b _081A35CE +_081A33D4: + bl sub_80EE818 + lsls r0, 24 + cmp r0, 0 + bne _081A33E0 + b _081A35CE +_081A33E0: + mov r0, r8 + cmp r0, 0 + bne _081A3404 + ldr r0, [r6] + adds r0, r5 + adds r0, r7 + ldrh r0, [r0] + movs r1, 0x5 + bl sub_80EE8C8 + b _081A35CE + .pool +_081A3404: + ldr r0, [r6] + adds r0, r5 + adds r0, r4 + ldrh r0, [r0] + movs r1, 0x6 + bl sub_80EE8C8 + b _081A35CE +_081A3414: + ldr r6, =gSaveBlock2Ptr + ldr r0, [r6] + lsls r7, 1 + mov r2, r8 + lsls r1, r2, 2 + adds r4, r7, r1 + ldr r5, =0x00000dc8 + adds r1, r0, r5 + adds r1, r4 + movs r3, 0xDD + lsls r3, 4 + adds r0, r3 + adds r0, r4 + ldrh r2, [r1] + ldrh r3, [r0] + cmp r2, r3 + bhi _081A3438 + b _081A35CE +_081A3438: + strh r2, [r0] + ldrh r0, [r1] + cmp r0, 0x1 + bhi _081A3442 + b _081A35CE +_081A3442: + bl sub_80EE818 + lsls r0, 24 + cmp r0, 0 + bne _081A344E + b _081A35CE +_081A344E: + mov r0, r8 + cmp r0, 0 + bne _081A346C + ldr r0, [r6] + adds r0, r5 + adds r0, r7 + ldrh r0, [r0] + movs r1, 0xB + bl sub_80EE8C8 + b _081A35CE + .pool +_081A346C: + ldr r0, [r6] + adds r0, r5 + adds r0, r4 + ldrh r0, [r0] + movs r1, 0xC + bl sub_80EE8C8 + b _081A35CE +_081A347C: + ldr r6, =gSaveBlock2Ptr + ldr r1, [r6] + lsls r4, r7, 1 + ldr r5, =0x00000dda + adds r0, r1, r5 + adds r0, r4 + ldr r2, =0x00000dde + adds r1, r2 + adds r1, r4 + ldrh r2, [r0] + ldrh r3, [r1] + cmp r2, r3 + bhi _081A3498 + b _081A35CE +_081A3498: + strh r2, [r1] + ldrh r0, [r0] + cmp r0, 0x1 + bhi _081A34A2 + b _081A35CE +_081A34A2: + bl sub_80EE818 + lsls r0, 24 + cmp r0, 0 + bne _081A34AE + b _081A35CE +_081A34AE: + ldr r0, [r6] + adds r0, r5 + adds r0, r4 + ldrh r0, [r0] + movs r1, 0xA + bl sub_80EE8C8 + b _081A35CE + .pool +_081A34CC: + ldr r6, =gSaveBlock2Ptr + ldr r2, [r6] + lsls r7, 1 + mov r9, r7 + mov r7, r8 + lsls r0, r7, 2 + mov r1, r9 + adds r4, r1, r0 + ldr r5, =0x00000de2 + adds r0, r2, r5 + adds r3, r0, r4 + ldr r7, =0x00000dea + adds r0, r2, r7 + adds r0, r4 + ldrh r1, [r3] + ldrh r7, [r0] + cmp r1, r7 + bls _081A35CE + strh r1, [r0] + ldr r0, =0x00000dfa + adds r1, r2, r0 + adds r1, r4 + ldr r7, =0x00000df2 + adds r0, r2, r7 + adds r0, r4 + ldrh r0, [r0] + strh r0, [r1] + ldrh r0, [r3] + cmp r0, 0x1 + bls _081A35CE + bl sub_80EE818 + lsls r0, 24 + cmp r0, 0 + beq _081A35CE + mov r0, r8 + cmp r0, 0 + bne _081A353C + ldr r0, [r6] + adds r0, r5 + add r0, r9 + ldrh r0, [r0] + movs r1, 0x7 + bl sub_80EE8C8 + b _081A35CE + .pool +_081A353C: + ldr r0, [r6] + adds r0, r5 + adds r0, r4 + ldrh r0, [r0] + movs r1, 0x8 + bl sub_80EE8C8 + b _081A35CE +_081A354C: + ldr r6, =gSaveBlock2Ptr + ldr r1, [r6] + lsls r4, r7, 1 + ldr r5, =0x00000e04 + adds r0, r1, r5 + adds r0, r4 + ldr r2, =0x00000e08 + adds r1, r2 + adds r1, r4 + ldrh r2, [r0] + ldrh r3, [r1] + cmp r2, r3 + bls _081A35CE + strh r2, [r1] + ldrh r0, [r0] + cmp r0, 0x1 + bls _081A35CE + bl sub_80EE818 + lsls r0, 24 + cmp r0, 0 + beq _081A35CE + ldr r0, [r6] + adds r0, r5 + adds r0, r4 + ldrh r0, [r0] + movs r1, 0x9 + bl sub_80EE8C8 + b _081A35CE + .pool +_081A3594: + ldr r6, =gSaveBlock2Ptr + ldr r1, [r6] + lsls r4, r7, 1 + ldr r5, =0x00000e1a + adds r0, r1, r5 + adds r0, r4 + ldr r7, =0x00000e1e + adds r1, r7 + adds r1, r4 + ldrh r2, [r0] + ldrh r3, [r1] + cmp r2, r3 + bls _081A35CE + strh r2, [r1] + ldrh r0, [r0] + cmp r0, 0x1 + bls _081A35CE + bl sub_80EE818 + lsls r0, 24 + cmp r0, 0 + beq _081A35CE + ldr r0, [r6] + adds r0, r5 + adds r0, r4 + ldrh r0, [r0] + movs r1, 0xD + bl sub_80EE8C8 +_081A35CE: + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A31FC + + thumb_func_start sub_81A35EC +sub_81A35EC: @ 81A35EC + push {r4,lr} + ldr r0, =0x000040cf + bl VarGet + ldr r4, =gScriptResult + bl sub_81A3610 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A35EC + + thumb_func_start sub_81A3610 +sub_81A3610: @ 81A3610 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r0, 0 + mov r8, r0 + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, =0x000040ce + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl sub_81A39C4 + lsls r0, 16 + ldr r1, =gUnknown_08611550 + mov r9, r1 + lsls r7, r6, 2 + adds r1, 0x3 + adds r1, r7, r1 + lsrs r0, 16 + ldrb r1, [r1] + adds r5, r0, r1 + cmp r4, 0 + beq _081A365C + movs r0, 0 + b _081A36C2 + .pool +_081A365C: + lsls r0, r6, 24 + lsrs r0, 24 + bl sub_81A3B30 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + blt _081A3680 + cmp r1, 0x1 + bgt _081A3680 + adds r0, r1, r7 + add r0, r9 + ldrb r0, [r0] + cmp r5, r0 + bne _081A36BC + adds r1, 0x1 + mov r8, r1 + b _081A36BC +_081A3680: + ldr r1, =gUnknown_08611550 + lsls r2, r6, 2 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r5, r0 + bne _081A3694 + movs r0, 0x3 + b _081A36BA + .pool +_081A3694: + adds r0, r1, 0x1 + adds r0, r2, r0 + ldrb r0, [r0] + cmp r5, r0 + bne _081A36A4 + movs r1, 0x4 + mov r8, r1 + b _081A36BC +_081A36A4: + cmp r5, r0 + ble _081A36BC + subs r0, r5, r0 + adds r1, 0x2 + adds r1, r2, r1 + ldrb r1, [r1] + bl __modsi3 + cmp r0, 0 + bne _081A36BC + movs r0, 0x4 +_081A36BA: + mov r8, r0 +_081A36BC: + mov r1, r8 + lsls r0, r1, 24 + lsrs r0, 24 +_081A36C2: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81A3610 + + thumb_func_start sub_81A36D0 +sub_81A36D0: @ 81A36D0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + adds r2, r0, 0 + lsls r1, 16 + lsrs r3, r1, 16 + cmp r0, 0x1 + beq _081A3766 + cmp r0, 0x1 + bgt _081A36EA + cmp r0, 0 + beq _081A36F2 + b _081A38F8 +_081A36EA: + cmp r2, 0x2 + bne _081A36F0 + b _081A3818 +_081A36F0: + b _081A38F8 +_081A36F2: + movs r0, 0xFA + lsls r0, 1 + cmp r3, r0 + bne _081A370C + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000bfc + b _081A38C4 + .pool +_081A370C: + ldr r0, =0x000003fe + cmp r3, r0 + beq _081A3786 + ldr r0, =0x0000012b + cmp r3, r0 + bhi _081A3738 + ldr r2, =gUnknown_0203BC88 + movs r0, 0x34 + adds r1, r3, 0 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0xC + bl ConvertBattleFrontierTrainerSpeechToString + b _081A38F8 + .pool +_081A3738: + ldr r0, =0x0000018f + cmp r3, r0 + bhi _081A3758 + ldr r1, =gSaveBlock2Ptr + movs r0, 0xEC + muls r0, r3 + ldr r1, [r1] + adds r0, r1 + ldr r1, =0xfffef2b8 + b _081A38C4 + .pool +_081A3758: + adds r0, r3, 0 + adds r0, 0x70 + lsls r0, 24 + lsrs r0, 24 + bl sub_819F99C + b _081A38F8 +_081A3766: + movs r0, 0xFA + lsls r0, 1 + cmp r3, r0 + bne _081A3780 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000c08 + b _081A38C4 + .pool +_081A3780: + ldr r0, =0x000003fe + cmp r3, r0 + bne _081A3794 +_081A3786: + movs r0, 0 + bl sub_81A51A8 + b _081A38F8 + .pool +_081A3794: + ldr r0, =0x0000012b + cmp r3, r0 + bhi _081A37B8 + ldr r2, =gUnknown_0203BC88 + movs r0, 0x34 + adds r1, r3, 0 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0x18 + bl ConvertBattleFrontierTrainerSpeechToString + b _081A38F8 + .pool +_081A37B8: + ldr r0, =0x0000018f + cmp r3, r0 + bhi _081A37EC + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + bne _081A387C + ldr r1, =gSaveBlock2Ptr + movs r0, 0xEC + muls r0, r3 + ldr r1, [r1] + adds r0, r1 + ldr r1, =0xfffef2c4 + b _081A38C4 + .pool +_081A37EC: + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + bne _081A387C + ldr r1, =gSaveBlock2Ptr + lsls r0, r3, 4 + adds r0, r3 + lsls r0, 2 + ldr r1, [r1] + adds r0, r1 + ldr r1, =0xffff96c4 + b _081A38C4 + .pool +_081A3818: + movs r0, 0xFA + lsls r0, 1 + cmp r3, r0 + bne _081A3830 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000c14 + b _081A38C4 + .pool +_081A3830: + ldr r0, =0x000003fe + cmp r3, r0 + bne _081A3844 + movs r0, 0x1 + bl sub_81A51A8 + b _081A38F8 + .pool +_081A3844: + ldr r0, =0x0000012b + cmp r3, r0 + bhi _081A3868 + ldr r2, =gUnknown_0203BC88 + movs r0, 0x34 + adds r1, r3, 0 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0x24 + bl ConvertBattleFrontierTrainerSpeechToString + b _081A38F8 + .pool +_081A3868: + ldr r0, =0x0000018f + cmp r3, r0 + bhi _081A38A8 + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _081A3890 +_081A387C: + bl sub_81864E0 + bl ConvertBattleFrontierTrainerSpeechToString + b _081A38F8 + .pool +_081A3890: + ldr r1, =gSaveBlock2Ptr + movs r0, 0xEC + muls r0, r3 + ldr r1, [r1] + adds r0, r1 + ldr r1, =0xfffef2d0 + b _081A38C4 + .pool +_081A38A8: + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _081A38D4 + bl sub_81864A8 + lsls r0, 24 + lsrs r3, r0, 24 + movs r0, 0x58 + muls r0, r3 + ldr r1, =gUnknown_086109BA +_081A38C4: + adds r0, r1 + bl ConvertBattleFrontierTrainerSpeechToString + b _081A38F8 + .pool +_081A38D4: + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r0, =0xfffffe70 + adds r2, r3, r0 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0 + adds r1, 0xDC + ldrb r0, [r1] + lsls r0, 27 + lsrs r3, r0, 27 + movs r0, 0x58 + muls r0, r3 + ldr r1, =gUnknown_086109BA + adds r0, r1 + bl ConvertBattleFrontierTrainerSpeechToString +_081A38F8: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A36D0 + + thumb_func_start sub_81A3908 +sub_81A3908: @ 81A3908 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r2, =0x00000cdc + adds r1, r2 + movs r2, 0 + str r2, [r1] + movs r4, 0 + mov r9, r0 + mov r8, r9 + movs r6, 0 +_081A3926: + movs r5, 0 + lsls r7, r4, 2 + mov r10, r7 + adds r0, r4, 0x1 + mov r12, r0 +_081A3930: + mov r1, r8 + ldr r2, [r1] + lsls r3, r5, 1 + mov r7, r10 + adds r1, r3, r7 + movs r7, 0xCE + lsls r7, 4 + adds r0, r2, r7 + adds r0, r1 + strh r6, [r0] + cmp r4, 0x1 + bgt _081A3960 + adds r7, 0x2C + adds r0, r2, r7 + adds r0, r1 + strh r6, [r0] + adds r7, 0xBC + adds r0, r2, r7 + adds r0, r1 + strh r6, [r0] + adds r7, 0x1A + adds r0, r2, r7 + adds r0, r1 + strh r6, [r0] +_081A3960: + cmp r4, 0 + bne _081A3980 + mov r1, r8 + ldr r0, [r1] + ldr r2, =0x00000dda + adds r1, r0, r2 + adds r1, r3 + strh r4, [r1] + ldr r7, =0x00000e04 + adds r1, r0, r7 + adds r1, r3 + strh r4, [r1] + ldr r1, =0x00000e1a + adds r0, r1 + adds r0, r3 + strh r4, [r0] +_081A3980: + adds r5, 0x1 + cmp r5, 0x1 + ble _081A3930 + mov r4, r12 + cmp r4, 0x3 + ble _081A3926 + mov r2, r9 + ldr r0, [r2] + ldr r7, =0x00000ca8 + adds r1, r0, r7 + ldrb r0, [r1] + cmp r0, 0 + beq _081A399E + movs r0, 0x1 + strb r0, [r1] +_081A399E: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A3908 + + thumb_func_start sub_81A39C4 +sub_81A39C4: @ 81A39C4 + push {r4,r5,lr} + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r4, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x6 + bhi _081A3AC4 + lsls r0, 2 + ldr r1, =_081A3A0C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A3A0C: + .4byte _081A3A28 + .4byte _081A3A3C + .4byte _081A3A54 + .4byte _081A3A6C + .4byte _081A3A80 + .4byte _081A3A98 + .4byte _081A3AAC +_081A3A28: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + lsls r2, r5, 2 + adds r1, r2 + movs r2, 0xCE + lsls r2, 4 + b _081A3AB4 + .pool +_081A3A3C: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + lsls r2, r5, 2 + adds r1, r2 + ldr r2, =0x00000d0c + b _081A3AB4 + .pool +_081A3A54: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + lsls r2, r5, 2 + adds r1, r2 + ldr r2, =0x00000dc8 + b _081A3AB4 + .pool +_081A3A6C: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, =0x00000dda + b _081A3AB4 + .pool +_081A3A80: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + lsls r2, r5, 2 + adds r1, r2 + ldr r2, =0x00000de2 + b _081A3AB4 + .pool +_081A3A98: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, =0x00000e04 + b _081A3AB4 + .pool +_081A3AAC: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, =0x00000e1a +_081A3AB4: + adds r0, r2 + adds r0, r1 + ldrh r0, [r0] + b _081A3AC6 + .pool +_081A3AC4: + movs r0, 0 +_081A3AC6: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81A39C4 + + thumb_func_start sub_81A3ACC +sub_81A3ACC: @ 81A3ACC + push {r4,r5,lr} + movs r2, 0 + ldr r5, =gSaveBlock2Ptr + ldr r4, =0x00000cb4 + ldr r0, =0x0000ffff + adds r3, r0, 0 +_081A3AD8: + ldr r0, [r5] + lsls r1, r2, 1 + adds r0, r4 + adds r0, r1 + ldrh r1, [r0] + orrs r1, r3 + strh r1, [r0] + adds r2, 0x1 + cmp r2, 0x13 + ble _081A3AD8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A3ACC + + thumb_func_start sub_81A3B00 +sub_81A3B00: @ 81A3B00 + push {lr} + ldr r0, =gUnknown_02038BCA + ldrh r1, [r0] + ldr r0, =0x000003fe + cmp r1, r0 + bne _081A3B20 + ldr r1, =gScriptResult + movs r0, 0x1 + b _081A3B24 + .pool +_081A3B20: + ldr r1, =gScriptResult + movs r0, 0 +_081A3B24: + strh r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A3B00 + + thumb_func_start sub_81A3B30 +sub_81A3B30: @ 81A3B30 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 23 + ldr r1, =0x000008c4 + adds r0, r4, r1 + bl FlagGet + adds r5, r0, 0 + ldr r0, =0x000008c5 + adds r4, r0 + adds r0, r4, 0 + bl FlagGet + adds r5, r0 + lsls r5, 24 + lsrs r5, 24 + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A3B30 + + thumb_func_start sub_81A3B64 +sub_81A3B64: @ 81A3B64 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r5, 0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r4, r0, 30 + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r7, r0, 16 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r6, r0, 16 + cmp r7, 0x6 + bhi _081A3C78 + lsls r0, r7, 2 + ldr r1, =_081A3BB4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A3BB4: + .4byte _081A3BD0 + .4byte _081A3BE4 + .4byte _081A3C00 + .4byte _081A3C18 + .4byte _081A3C2C + .4byte _081A3C44 + .4byte _081A3C60 +_081A3BD0: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + lsls r2, r6, 2 + adds r1, r2 + movs r2, 0xCE + lsls r2, 4 + b _081A3C68 + .pool +_081A3BE4: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + lsls r2, r6, 2 + adds r1, r2 + ldr r2, =0x00000d0c + adds r0, r2 + adds r0, r1 + ldrh r5, [r0] + b _081A3C78 + .pool +_081A3C00: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + lsls r2, r6, 2 + adds r1, r2 + ldr r2, =0x00000dc8 + b _081A3C68 + .pool +_081A3C18: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, =0x00000dda + b _081A3C68 + .pool +_081A3C2C: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + lsls r2, r6, 2 + adds r1, r2 + ldr r2, =0x00000de2 + b _081A3C68 + .pool +_081A3C44: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, =0x00000e04 + adds r0, r2 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0xE + b _081A3C70 + .pool +_081A3C60: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, =0x00000e1a +_081A3C68: + adds r0, r2 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x7 +_081A3C70: + bl __udivsi3 + lsls r0, 16 + lsrs r5, r0, 16 +_081A3C78: + cmp r5, 0 + beq _081A3C7E + subs r5, 0x1 +_081A3C7E: + cmp r5, 0x1D + bls _081A3C84 + movs r5, 0x1D +_081A3C84: + ldr r2, =gUnknown_086118B4 + lsls r1, r7, 2 + adds r1, r6, r1 + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + adds r1, r0 + adds r7, r1, r2 + ldrb r5, [r7] + ldr r0, =gUnknown_02038BCA + mov r9, r0 + ldrh r0, [r0] + ldr r1, =0x000003fe + mov r8, r1 + cmp r0, r8 + bne _081A3CA6 + adds r5, 0xA +_081A3CA6: + ldr r6, =gSaveBlock2Ptr + ldr r1, [r6] + ldr r4, =0x00000eb8 + adds r1, r4 + ldrh r0, [r1] + adds r0, r5 + strh r0, [r1] + ldr r0, =gStringVar1 + adds r1, r5, 0 + movs r2, 0 + movs r3, 0x2 + bl ConvertIntToDecimalStringN + ldr r0, [r6] + adds r2, r0, r4 + ldrh r0, [r2] + ldr r1, =0x0000270f + cmp r0, r1 + bls _081A3CCE + strh r1, [r2] +_081A3CCE: + ldr r0, [r6] + ldr r4, =0x00000eba + adds r0, r4 + ldrh r5, [r0] + ldrb r0, [r7] + adds r5, r0 + bl sub_80EED60 + mov r2, r9 + ldrh r0, [r2] + cmp r0, r8 + bne _081A3CEE + adds r5, 0xA + movs r0, 0xA + bl sub_80EED60 +_081A3CEE: + ldr r0, =0x0000ffff + cmp r5, r0 + ble _081A3CF6 + adds r5, r0, 0 +_081A3CF6: + ldr r0, [r6] + adds r0, r4 + strh r5, [r0] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A3B64 + + thumb_func_start sub_81A3D30 +sub_81A3D30: @ 81A3D30 + push {r4,lr} + ldr r0, =0x000040cf + bl VarGet + ldr r4, =gScriptResult + lsls r0, 24 + lsrs r0, 24 + bl sub_81A3B30 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A3D30 + + thumb_func_start sub_81A3D58 +sub_81A3D58: @ 81A3D58 + push {r4,lr} + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r4, r0, 16 + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_81A3B30 + lsls r0, 24 + cmp r0, 0 + bne _081A3D88 + lsls r0, r4, 17 + ldr r1, =0x8C4 << 16 + adds r0, r1 + lsrs r0, 16 + bl FlagSet + b _081A3D94 + .pool +_081A3D88: + lsls r0, r4, 17 + ldr r1, =0x8C5 << 16 + adds r0, r1 + lsrs r0, 16 + bl FlagSet +_081A3D94: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A3D58 + + thumb_func_start sub_81A3DA0 +sub_81A3DA0: @ 81A3DA0 + push {lr} + ldr r0, =gBattleTypeFlags + ldr r1, =gSpecialVar_0x8005 + ldrh r1, [r1] + ldr r2, [r0] + ands r2, r1 + cmp r2, 0 + beq _081A3DC4 + ldr r1, =gScriptResult + movs r0, 0x1 + strh r0, [r1] + b _081A3DC8 + .pool +_081A3DC4: + ldr r0, =gScriptResult + strh r2, [r0] +_081A3DC8: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A3DA0 + + thumb_func_start sub_81A3DD0 +sub_81A3DD0: @ 81A3DD0 + push {r4-r6,lr} + adds r5, r2, 0 + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, 24 + lsrs r4, r1, 24 + adds r0, r6, 0 + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _081A3ED6 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + subs r0, r4, 0x1 + cmp r0, 0xA + bhi _081A3EA0 + lsls r0, 2 + ldr r1, =_081A3E0C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A3E0C: + .4byte _081A3E38 + .4byte _081A3E68 + .4byte _081A3E38 + .4byte _081A3EA0 + .4byte _081A3E38 + .4byte _081A3EA0 + .4byte _081A3E38 + .4byte _081A3EA0 + .4byte _081A3E38 + .4byte _081A3EA0 + .4byte _081A3E38 +_081A3E38: + cmp r5, r4 + bne _081A3E50 + ldr r0, =gStringVar1 + ldr r1, =gUnknown_085CCB79 + bl StringAppend + b _081A3EC8 + .pool +_081A3E50: + cmp r5, r4 + ble _081A3EC8 + ldr r0, =gStringVar1 + ldr r1, =gUnknown_085CCB7F + bl StringAppend + b _081A3EC8 + .pool +_081A3E68: + cmp r4, r5 + bne _081A3E80 + ldr r0, =gStringVar1 + ldr r1, =gUnknown_085CCB79 + bl StringAppend + b _081A3E88 + .pool +_081A3E80: + ldr r0, =gStringVar1 + ldr r1, =gUnknown_085CCB7F + bl StringAppend +_081A3E88: + ldr r0, =gStringVar1 + ldr r1, =gUnknown_085CCB86 + bl StringAppend + b _081A3EC8 + .pool +_081A3EA0: + cmp r4, r5 + bne _081A3EB8 + ldr r0, =gStringVar1 + ldr r1, =gUnknown_085CCB79 + bl StringAppend + b _081A3EC0 + .pool +_081A3EB8: + ldr r0, =gStringVar1 + ldr r1, =gUnknown_085CCB7F + bl StringAppend +_081A3EC0: + ldr r0, =gStringVar1 + ldr r1, =gUnknown_085CCB84 + bl StringAppend +_081A3EC8: + ldr r0, =gStringVar1 + movs r1, 0xB + muls r1, r6 + ldr r2, =gSpeciesNames + adds r1, r2 + bl StringAppend +_081A3ED6: + adds r0, r4, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A3DD0 + + thumb_func_start sub_81A3EF0 +sub_81A3EF0: @ 81A3EF0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r2, [sp, 0x20] + ldr r4, [sp, 0x24] + mov r9, r4 + ldr r4, [sp, 0x28] + mov r10, r4 + ldr r7, [sp, 0x2C] + lsls r0, 16 + lsrs r4, r0, 16 + lsls r1, 16 + lsrs r6, r1, 16 + lsls r3, 24 + lsrs r3, 24 + mov r12, r3 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + movs r2, 0 + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + beq _081A3FBE + cmp r4, 0 + beq _081A3FBE + ldr r0, =gUnknown_08611C9A + ldrh r1, [r0] + ldr r5, =0x0000ffff + adds r3, r0, 0 + cmp r1, r5 + beq _081A3F54 + cmp r1, r4 + beq _081A3F48 + adds r1, r3, 0 +_081A3F3A: + adds r1, 0x2 + adds r2, 0x1 + ldrh r0, [r1] + cmp r0, r5 + beq _081A3F54 + cmp r0, r4 + bne _081A3F3A +_081A3F48: + lsls r0, r2, 1 + adds r0, r3 + ldrh r1, [r0] + ldr r0, =0x0000ffff + cmp r1, r0 + bne _081A3FBE +_081A3F54: + mov r0, r12 + cmp r0, 0 + bne _081A3F60 + mov r1, r8 + cmp r1, 0x32 + bhi _081A3FBE +_081A3F60: + movs r2, 0 + ldrb r3, [r7] + cmp r2, r3 + bge _081A3F80 + mov r1, r9 + ldrh r0, [r1] + cmp r0, r4 + beq _081A3F80 + adds r5, r3, 0 +_081A3F72: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, r5 + bge _081A3F80 + ldrh r0, [r1] + cmp r0, r4 + bne _081A3F72 +_081A3F80: + cmp r2, r3 + bne _081A3FBE + cmp r6, 0 + beq _081A3FAA + movs r2, 0 + cmp r2, r3 + bge _081A3FA6 + mov r1, r10 + ldrh r0, [r1] + cmp r0, r6 + beq _081A3FA6 + adds r5, r3, 0 +_081A3F98: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, r5 + bge _081A3FA6 + ldrh r0, [r1] + cmp r0, r6 + bne _081A3F98 +_081A3FA6: + cmp r2, r3 + bne _081A3FBE +_081A3FAA: + lsls r0, r3, 1 + add r0, r9 + strh r4, [r0] + ldrb r0, [r7] + lsls r0, 1 + add r0, r10 + strh r6, [r0] + ldrb r0, [r7] + adds r0, 0x1 + strb r0, [r7] +_081A3FBE: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A3EF0 + + thumb_func_start sub_81A3FD4 +sub_81A3FD4: @ 81A3FD4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x34 + movs r0, 0 + str r0, [sp, 0x2C] + add r4, sp, 0x28 + strb r0, [r4] + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r0, 16 + mov r10, r4 + cmp r0, 0x1 + beq _081A4016 + cmp r0, 0x1 + bgt _081A4008 + cmp r0, 0 + beq _081A4010 + b _081A402A + .pool +_081A4008: + cmp r0, 0x3 + bgt _081A402A + movs r0, 0x2 + b _081A4028 +_081A4010: + movs r1, 0x3 + str r1, [sp, 0x2C] + b _081A402A +_081A4016: + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + movs r1, 0x3 + str r1, [sp, 0x2C] + cmp r0, 0 + bne _081A402A + movs r0, 0x4 +_081A4028: + str r0, [sp, 0x2C] +_081A402A: + movs r1, 0 + mov r9, r1 + b _081A4040 + .pool +_081A4034: + mov r1, r10 + ldrb r0, [r1] + ldr r1, [sp, 0x2C] + cmp r0, r1 + blt _081A4040 + b _081A41E0 +_081A4040: + mov r5, r9 + movs r0, 0 + mov r1, r10 + strb r0, [r1] + mov r0, r9 + adds r0, 0x1 + str r0, [sp, 0x30] +_081A404E: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =gPlayerParty + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x41 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + adds r0, r4, 0 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r7, r0, 16 + adds r0, r4, 0 + movs r1, 0x38 + bl GetMonData + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r4, 0 + movs r1, 0x39 + bl GetMonData + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x6 + bne _081A40C8 + cmp r7, 0 + bne _081A40E4 + ldr r0, =gScriptResult + ldrb r3, [r0] + str r6, [sp] + add r1, sp, 0x10 + str r1, [sp, 0x4] + add r0, sp, 0x1C + str r0, [sp, 0x8] + mov r0, r10 + str r0, [sp, 0xC] + mov r0, r8 + movs r1, 0 + adds r2, r4, 0 + bl sub_81A3EF0 + b _081A40E4 + .pool +_081A40C8: + ldr r0, =gScriptResult + ldrb r3, [r0] + str r6, [sp] + add r1, sp, 0x10 + str r1, [sp, 0x4] + add r0, sp, 0x1C + str r0, [sp, 0x8] + mov r0, r10 + str r0, [sp, 0xC] + mov r0, r8 + adds r1, r7, 0 + adds r2, r4, 0 + bl sub_81A3EF0 +_081A40E4: + adds r5, 0x1 + cmp r5, 0x5 + ble _081A40EC + movs r5, 0 +_081A40EC: + cmp r5, r9 + bne _081A404E + ldr r1, [sp, 0x30] + mov r9, r1 + cmp r1, 0x5 + ble _081A4034 + mov r1, r10 + ldrb r0, [r1] + ldr r1, [sp, 0x2C] + cmp r0, r1 + bge _081A41E0 + movs r6, 0 + ldr r0, =gUnknown_08611C9A + ldrh r2, [r0] + ldr r1, =0x0000ffff + mov r8, r0 + cmp r2, r1 + beq _081A4134 + mov r4, r8 +_081A4112: + adds r0, r2, 0 + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _081A412A + adds r6, 0x1 +_081A412A: + adds r4, 0x2 + ldrh r2, [r4] + ldr r0, =0x0000ffff + cmp r2, r0 + bne _081A4112 +_081A4134: + ldr r1, =gStringVar1 + movs r0, 0xFF + strb r0, [r1] + ldr r1, =gSpecialVar_0x8004 + movs r0, 0x1 + strh r0, [r1] + movs r0, 0 + mov r1, r10 + strb r0, [r1] + mov r1, r8 + ldrh r0, [r1] + ldr r1, =0x0000ffff + cmp r0, r1 + beq _081A416A + mov r5, r10 + adds r7, r1, 0 + mov r4, r8 +_081A4156: + ldrh r0, [r4] + ldrb r1, [r5] + adds r2, r6, 0 + bl sub_81A3DD0 + strb r0, [r5] + adds r4, 0x2 + ldrh r0, [r4] + cmp r0, r7 + bne _081A4156 +_081A416A: + mov r0, r10 + ldrb r4, [r0] + cmp r4, 0 + bne _081A41A4 + ldr r4, =gStringVar1 + ldr r1, =gUnknown_085CCB82 + adds r0, r4, 0 + bl StringAppend + ldr r1, =gUnknown_085CCB88 + adds r0, r4, 0 + bl StringAppend + b _081A4202 + .pool +_081A41A4: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _081A41C0 + ldr r0, =gStringVar1 + ldr r1, =gUnknown_085CCB84 + bl StringAppend + b _081A41C8 + .pool +_081A41C0: + ldr r0, =gStringVar1 + ldr r1, =gUnknown_085CCB82 + bl StringAppend +_081A41C8: + ldr r0, =gStringVar1 + ldr r1, =gUnknown_085CCB8C + bl StringAppend + b _081A4202 + .pool +_081A41E0: + ldr r1, =gSpecialVar_0x8004 + movs r0, 0 + strh r0, [r1] + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r0, =gScriptResult + ldrb r0, [r0] + ldr r1, =0x00000ca9 + adds r2, r1 + movs r1, 0x3 + ands r1, r0 + ldrb r3, [r2] + movs r0, 0x4 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] +_081A4202: + add sp, 0x34 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A3FD4 + + thumb_func_start sub_81A4224 +sub_81A4224: @ 81A4224 + push {lr} + bl sub_81652B4 + pop {r0} + bx r0 + thumb_func_end sub_81A4224 + + thumb_func_start sub_81A4230 +sub_81A4230: @ 81A4230 + push {r4-r7,lr} + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r4, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x6 + bls _081A425A + b _081A4394 +_081A425A: + lsls r0, 2 + ldr r1, =_081A4278 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A4278: + .4byte _081A4294 + .4byte _081A42DC + .4byte _081A431C + .4byte _081A4338 + .4byte _081A434C + .4byte _081A4368 + .4byte _081A437C +_081A4294: + ldr r7, =gSaveBlock2Ptr + ldr r0, [r7] + lsls r4, 1 + lsls r1, r5, 2 + adds r1, r4, r1 + movs r6, 0xCE + lsls r6, 4 + adds r3, r0, r6 + adds r2, r3, r1 + ldrh r1, [r2] + ldr r0, =0x0000270e + cmp r1, r0 + bhi _081A4394 + adds r0, r1, 0x1 + strh r0, [r2] + cmp r5, 0 + bne _081A4394 + adds r0, r3, r4 + ldrh r1, [r0] + movs r0, 0x20 + bl sav12_xor_set + ldr r1, [r7] + adds r0, r1, r6 + adds r0, r4 + ldrh r0, [r0] + ldr r2, =0x00000d02 + adds r1, r2 + b _081A4392 + .pool +_081A42DC: + ldr r6, =gSaveBlock2Ptr + ldr r0, [r6] + lsls r2, r4, 1 + lsls r1, r5, 2 + adds r1, r2, r1 + ldr r3, =0x00000d0c + adds r0, r3 + adds r3, r0, r1 + ldrh r0, [r3] + ldr r2, =0x0000270e + cmp r0, r2 + bhi _081A42F8 + adds r0, 0x1 + strh r0, [r3] +_081A42F8: + ldr r0, [r6] + ldr r3, =0x00000d1c + adds r0, r3 + adds r1, r0, r1 + ldrh r0, [r1] + cmp r0, r2 + bhi _081A4394 + adds r0, 0x1 + b _081A4392 + .pool +_081A431C: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + lsls r0, r4, 1 + lsls r1, r5, 2 + adds r0, r1 + ldr r1, =0x00000dc8 + adds r2, r1 + adds r1, r2, r0 + b _081A4388 + .pool +_081A4338: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, =0x00000dda + adds r0, r2 + b _081A4386 + .pool +_081A434C: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + lsls r0, r4, 1 + lsls r1, r5, 2 + adds r0, r1 + ldr r3, =0x00000de2 + adds r2, r3 + adds r1, r2, r0 + b _081A4388 + .pool +_081A4368: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, =0x00000e04 + adds r0, r2 + b _081A4386 + .pool +_081A437C: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + ldr r3, =0x00000e1a + adds r0, r3 +_081A4386: + adds r1, r0, r1 +_081A4388: + ldrh r3, [r1] + ldr r0, =0x0000270e + cmp r3, r0 + bhi _081A4394 + adds r0, r3, 0x1 +_081A4392: + strh r0, [r1] +_081A4394: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A4230 + + thumb_func_start sub_81A43A8 +sub_81A43A8: @ 81A43A8 + push {r4-r6,lr} + sub sp, 0x4 + movs r4, 0 + ldr r6, =gSaveBlock1Ptr + movs r5, 0x64 +_081A43B2: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, =0x00000caa + adds r0, r2 + adds r1, r0, r1 + ldrh r0, [r1] + cmp r0, 0 + beq _081A43EE + adds r1, r0, 0 + muls r1, r5 + movs r0, 0xEA + lsls r0, 1 + adds r1, r0 + ldr r0, [r6] + adds r0, r1 + movs r1, 0xC + movs r2, 0 + bl GetMonData + mov r1, sp + strh r0, [r1] + adds r0, r4, 0 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xC + mov r2, sp + bl SetMonData +_081A43EE: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _081A43B2 + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A43A8 + + thumb_func_start sub_81A4410 +sub_81A4410: @ 81A4410 + push {r4,lr} + ldr r4, =gScriptResult + bl sub_8185338 + strh r0, [r4] + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x8 + orrs r0, r2 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A4410 + + thumb_func_start sub_81A443C +sub_81A443C: @ 81A443C + push {lr} + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0 + beq _081A4450 + cmp r0, 0x1 + beq _081A4464 + b _081A446E + .pool +_081A4450: + ldr r0, =gStringVar1 + ldr r1, =gUnknown_02038BCA + ldrh r1, [r1] + bl sub_8162E20 + b _081A446E + .pool +_081A4464: + ldr r0, =gStringVar2 + ldr r1, =gUnknown_02038BCA + ldrh r1, [r1] + bl sub_8162E20 +_081A446E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A443C + + thumb_func_start sub_81A447C +sub_81A447C: @ 81A447C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + movs r0, 0 + str r0, [sp] +_081A448C: + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r2, [sp] + lsls r1, r2, 1 + ldr r4, =0x00000caa + adds r0, r4 + adds r0, r1 + ldrh r0, [r0] + subs r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r9, r1 + adds r2, 0x1 + str r2, [sp, 0x4] + cmp r0, 0x5 + bhi _081A454E + movs r6, 0 + ldr r0, [sp] + movs r2, 0x64 + adds r1, r0, 0 + muls r1, r2 + ldr r0, =gPlayerParty + adds r7, r1, r0 +_081A44BA: + movs r5, 0 + movs r4, 0xD + adds r4, r6 + mov r8, r4 + adds r0, r6, 0x1 + mov r10, r0 +_081A44C6: + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r2, =0x00000caa + adds r0, r2 + add r0, r9 + ldrh r0, [r0] + movs r4, 0x64 + adds r1, r0, 0 + muls r1, r4 + movs r0, 0xEA + lsls r0, 1 + adds r1, r0 + ldr r2, =gSaveBlock1Ptr + ldr r0, [r2] + adds r0, r1 + adds r1, r5, 0 + adds r1, 0xD + movs r2, 0 + bl GetMonData + adds r4, r0, 0 + adds r0, r7, 0 + mov r1, r8 + movs r2, 0 + bl GetMonData + cmp r4, r0 + beq _081A4508 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _081A44C6 +_081A4508: + cmp r5, 0x4 + bne _081A4516 + adds r0, r7, 0 + movs r1, 0xA6 + adds r2, r6, 0 + bl sub_80691F4 +_081A4516: + mov r4, r10 + lsls r0, r4, 24 + lsrs r6, r0, 24 + cmp r6, 0x3 + bls _081A44BA + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r2, =gSaveBlock2Ptr + ldr r1, [r2] + ldr r4, =0x00000caa + adds r1, r4 + add r1, r9 + ldrh r1, [r1] + subs r1, 0x1 + movs r3, 0x64 + muls r1, r3 + adds r0, r1 + movs r1, 0x8E + lsls r1, 2 + adds r0, r1 + ldr r2, =gPlayerParty + ldr r4, [sp] + adds r1, r4, 0 + muls r1, r3 + adds r1, r2 + movs r2, 0x64 + bl memcpy +_081A454E: + ldr r1, [sp, 0x4] + lsls r0, r1, 24 + lsrs r0, 24 + str r0, [sp] + cmp r0, 0x3 + bls _081A448C + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A447C + + thumb_func_start sub_81A457C +sub_81A457C: @ 81A457C + push {lr} + ldr r0, =0x000040cf + bl VarGet + lsls r0, 24 + lsrs r0, 24 + bl sub_81A5030 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A457C + + thumb_func_start sub_81A4594 +sub_81A4594: @ 81A4594 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x2C + mov r8, r1 + adds r6, r3, 0 + ldr r1, =gUnknown_0203AB74 + ldrb r5, [r1] + lsls r4, r0, 1 + adds r4, r0 + ldr r1, =gUnknown_085EE424 + adds r4, r1 + mov r1, r8 + lsls r3, r1, 27 + lsrs r3, 24 + lsls r1, r0, 2 + adds r1, r0 + adds r2, r1 + lsls r2, 3 + adds r2, 0x1 + lsls r2, 24 + lsrs r7, r2, 24 + str r7, [sp] + movs r0, 0xFF + mov r10, r0 + str r0, [sp, 0x4] + movs r1, 0 + mov r9, r1 + str r1, [sp, 0x8] + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl Print + movs r0, 0xFF + strb r0, [r6, 0xD] + ldrh r0, [r6, 0x4] + cmp r0, 0 + beq _081A465C + adds r1, r6, 0x6 + ldrb r2, [r6, 0xE] + add r0, sp, 0xC + bl sub_81DB5E8 + ldr r1, =gUnknown_0203AB74 + ldrb r0, [r1] + mov r3, r8 + adds r3, 0x2 + lsls r3, 27 + lsrs r3, 24 + str r7, [sp] + mov r1, r10 + str r1, [sp, 0x4] + mov r1, r9 + str r1, [sp, 0x8] + movs r1, 0x1 + add r2, sp, 0xC + bl Print + ldrh r1, [r6, 0x4] + ldr r0, =0x0000270f + cmp r1, r0 + bls _081A4618 + adds r1, r0, 0 +_081A4618: + ldr r0, =gStringVar2 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalStringN + ldr r5, =gStringVar4 + ldr r1, =gUnknown_08611D08 + ldr r0, [sp, 0x4C] + lsls r0, 2 + adds r0, r1 + ldr r4, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl StringExpandPlaceholders + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xC8 + bl GetStringRightAlignXOffset + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + ldr r1, =gUnknown_0203AB74 + ldrb r0, [r1] + str r7, [sp] + mov r1, r10 + str r1, [sp, 0x4] + mov r1, r9 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + bl Print +_081A465C: + add sp, 0x2C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A4594 + + thumb_func_start sub_81A4684 +sub_81A4684: @ 81A4684 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x2C + adds r6, r0, 0 + adds r7, r1, 0 + mov r10, r2 + adds r5, r3, 0 + ldr r1, =gUnknown_0203AB74 + ldrb r0, [r1] + lsls r2, r6, 1 + adds r2, r6 + ldr r1, =gUnknown_085EE424 + adds r2, r1 + lsls r3, r7, 27 + lsrs r3, 24 + mov r12, r3 + lsls r1, r6, 2 + adds r1, r6 + mov r3, r10 + adds r4, r3, r1 + lsls r1, r4, 3 + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + movs r1, 0xFF + mov r9, r1 + str r1, [sp, 0x4] + movs r3, 0 + mov r8, r3 + str r3, [sp, 0x8] + movs r1, 0x1 + mov r3, r12 + bl Print + ldrh r0, [r5, 0x8] + cmp r0, 0 + beq _081A47BC + movs r0, 0xFF + strb r0, [r5, 0x11] + movs r0, 0x1 + negs r0, r0 + strb r0, [r5, 0x19] + adds r1, r5, 0 + adds r1, 0xA + ldrb r2, [r5, 0x1A] + add r0, sp, 0xC + bl sub_81DB5E8 + ldr r1, =gUnknown_0203AB74 + ldrb r0, [r1] + adds r3, r7, 0x2 + lsls r3, 27 + lsrs r3, 24 + subs r1, r4, 0x1 + lsls r1, 3 + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + mov r2, r9 + str r2, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + movs r1, 0x1 + add r2, sp, 0xC + bl Print + adds r4, r5, 0 + adds r4, 0x12 + adds r0, r4, 0 + bl sub_8009228 + cmp r0, 0 + beq _081A4734 + add r0, sp, 0xC + adds r1, r4, 0 + movs r2, 0x1 + bl sub_81DB5E8 + b _081A473C + .pool +_081A4734: + add r0, sp, 0xC + adds r1, r4, 0 + bl StringCopy +_081A473C: + ldr r2, =gUnknown_0203AB74 + mov r9, r2 + ldrb r0, [r2] + adds r3, r7, 0x4 + lsls r3, 27 + lsrs r3, 24 + lsls r1, r6, 2 + adds r1, r6 + mov r2, r10 + adds r6, r2, r1 + adds r1, r6, 0x1 + lsls r1, 3 + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + movs r1, 0xFF + mov r8, r1 + str r1, [sp, 0x4] + movs r7, 0 + str r7, [sp, 0x8] + movs r1, 0x1 + add r2, sp, 0xC + bl Print + ldrh r1, [r5, 0x8] + ldr r0, =0x0000270f + cmp r1, r0 + bls _081A4778 + adds r1, r0, 0 +_081A4778: + ldr r0, =gStringVar2 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalStringN + ldr r5, =gStringVar4 + ldr r0, =gUnknown_08611D08 + ldr r4, [r0, 0x24] + adds r0, r5, 0 + adds r1, r4, 0 + bl StringExpandPlaceholders + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xC8 + bl GetStringRightAlignXOffset + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + mov r2, r9 + ldrb r0, [r2] + lsls r1, r6, 3 + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + mov r1, r8 + str r1, [sp, 0x4] + str r7, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + bl Print +_081A47BC: + add sp, 0x2C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A4684 + + thumb_func_start sub_81A47E0 +sub_81A47E0: @ 81A47E0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x44 + mov r9, r0 + mov r10, r1 + str r2, [sp, 0x40] + movs r0, 0xAC + lsls r0, 1 + bl AllocZeroed + mov r8, r0 + bl sub_80E8260 + add r0, sp, 0x30 + mov r12, r0 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r3, [sp, 0x40] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 4 + mov r4, r10 + lsls r0, r4, 1 + add r0, r10 + lsls r0, 5 + adds r1, r0 + adds r4, r1, r2 + mov r3, sp + movs r2, 0x2 +_081A4820: + adds r0, r3, 0 + movs r5, 0x87 + lsls r5, 2 + adds r1, r4, r5 + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldr r1, [r1] + str r1, [r0] + adds r4, 0x10 + adds r3, 0x10 + subs r2, 0x1 + cmp r2, 0 + bge _081A4820 + ldr r6, [sp, 0x40] + lsls r0, r6, 4 + mov r7, r10 + lsls r1, r7, 5 + adds r0, r1 + mov r1, r12 + add r0, r8 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldr r0, [r0] + str r0, [r1] + movs r2, 0 +_081A4852: + movs r1, 0 + movs r4, 0 + movs r3, 0 + lsls r5, r2, 4 + adds r6, r2, 0x1 + mov r2, sp +_081A485E: + ldrh r0, [r2, 0x4] + cmp r0, r1 + ble _081A4868 + adds r4, r3, 0 + adds r1, r0, 0 +_081A4868: + adds r2, 0x10 + adds r3, 0x1 + cmp r3, 0x3 + ble _081A485E + mov r0, sp + ldrh r0, [r0, 0x34] + cmp r0, r1 + blt _081A487A + movs r4, 0x3 +_081A487A: + lsls r0, r4, 4 + mov r7, sp + adds r2, r7, r0 + mov r0, r9 + adds r1, r5, r0 + adds r0, r2, 0 + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldr r0, [r0] + str r0, [r1] + movs r0, 0 + strh r0, [r2, 0x4] + adds r2, r6, 0 + cmp r2, 0x2 + ble _081A4852 + mov r0, r8 + bl Free + add sp, 0x44 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A47E0 + + thumb_func_start sub_81A48B4 +sub_81A48B4: @ 81A48B4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x74 + mov r9, r0 + mov r10, r1 + movs r0, 0xAC + lsls r0, 1 + bl AllocZeroed + mov r8, r0 + bl sub_80E8260 + mov r0, sp + adds r0, 0x54 + str r0, [sp, 0x70] + add r1, sp, 0x5C + mov r12, r1 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + movs r0, 0x54 + mov r2, r10 + muls r2, r0 + adds r0, r2, 0 + adds r3, r0, r1 + mov r2, sp + movs r4, 0x2 +_081A48EE: + adds r0, r2, 0 + ldr r5, =0x0000057c + adds r1, r3, r5 + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldr r1, [r1] + str r1, [r0] + adds r3, 0x1C + adds r2, 0x1C + subs r4, 0x1 + cmp r4, 0 + bge _081A48EE + mov r6, r10 + lsls r0, r6, 3 + subs r0, r6 + lsls r0, 2 + add r0, r8 + ldr r1, [sp, 0x70] + movs r7, 0x90 + lsls r7, 1 + adds r0, r7 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldr r0, [r0] + str r0, [r1] + movs r4, 0 +_081A492A: + movs r1, 0 + movs r5, 0 + movs r3, 0 + lsls r6, r4, 3 + adds r7, r4, 0x1 + mov r2, sp +_081A4936: + ldrh r0, [r2, 0x8] + cmp r0, r1 + ble _081A4940 + adds r5, r3, 0 + adds r1, r0, 0 +_081A4940: + adds r2, 0x1C + adds r3, 0x1 + cmp r3, 0x2 + ble _081A4936 + mov r2, r12 + ldrh r0, [r2] + cmp r0, r1 + blt _081A4952 + movs r5, 0x3 +_081A4952: + subs r1, r6, r4 + lsls r1, 2 + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + mov r3, sp + adds r2, r3, r0 + add r1, r9 + adds r0, r2, 0 + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldr r0, [r0] + str r0, [r1] + movs r0, 0 + strh r0, [r2, 0x8] + adds r4, r7, 0 + cmp r4, 0x2 + ble _081A492A + mov r0, r8 + bl Free + add sp, 0x74 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A48B4 + + thumb_func_start sub_81A4998 +sub_81A4998: @ 81A4998 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x94 + adds r7, r0, 0 + str r1, [sp, 0x90] + ldr r0, =gStringVar1 + ldr r4, =gUnknown_08611CB0 + lsls r5, r7, 3 + adds r1, r5, r4 + ldr r1, [r1] + bl StringCopy + ldr r6, =gStringVar4 + adds r4, 0x4 + adds r5, r4 + ldr r1, [r5] + adds r0, r6, 0 + bl StringExpandPlaceholders + ldr r0, =gUnknown_0203AB74 + mov r8, r0 + ldrb r0, [r0] + movs r1, 0x1 + mov r10, r1 + str r1, [sp] + movs r2, 0xFF + mov r9, r2 + str r2, [sp, 0x4] + movs r5, 0 + str r5, [sp, 0x8] + adds r2, r6, 0 + movs r3, 0 + bl Print + ldr r1, =gUnknown_08611D00 + ldr r2, [sp, 0x90] + lsls r0, r2, 2 + adds r0, r1 + ldr r4, [r0] + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xD0 + bl GetStringRightAlignXOffset + adds r3, r0, 0 + mov r1, r8 + ldrb r0, [r1] + lsls r3, 24 + lsrs r3, 24 + mov r2, r10 + str r2, [sp] + mov r1, r9 + str r1, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + bl Print + cmp r7, 0x9 + bne _081A4A6C + ldr r2, =gSaveBlock2Ptr + ldr r0, [r2] + ldr r1, =0x00000ee8 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldr r0, [r2] + movs r2, 0xEF + lsls r2, 4 + adds r0, r2 + movs r1, 0x1 + negs r1, r1 + strb r1, [r0] + add r4, sp, 0x3C + adds r0, r4, 0 + ldr r1, [sp, 0x90] + bl sub_81A48B4 +_081A4A3A: + adds r0, r5, 0 + movs r1, 0x1 + movs r2, 0x4 + adds r3, r4, 0 + bl sub_81A4684 + adds r4, 0x1C + adds r5, 0x1 + cmp r5, 0x2 + ble _081A4A3A + b _081A4A90 + .pool +_081A4A6C: + add r0, sp, 0xC + adds r1, r7, 0 + ldr r2, [sp, 0x90] + bl sub_81A47E0 + movs r5, 0 + add r4, sp, 0xC +_081A4A7A: + str r7, [sp] + adds r0, r5, 0 + movs r1, 0x1 + movs r2, 0x4 + adds r3, r4, 0 + bl sub_81A4594 + adds r4, 0x10 + adds r5, 0x1 + cmp r5, 0x2 + ble _081A4A7A +_081A4A90: + add sp, 0x94 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81A4998 + + thumb_func_start sub_81A4AA0 +sub_81A4AA0: @ 81A4AA0 + push {r4,lr} + ldr r4, =gUnknown_0203AB74 + ldr r0, =gUnknown_08611C84 + bl AddWindow + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r4] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + movs r1, 0 + bl sub_81A4998 + ldrb r0, [r4] + bl PutWindowTilemap + ldrb r0, [r4] + movs r1, 0x3 + bl CopyWindowToVram + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A4AA0 + + thumb_func_start sub_81A4AE8 +sub_81A4AE8: @ 81A4AE8 + push {r4,lr} + ldr r4, =gUnknown_0203AB74 + ldrb r0, [r4] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + movs r1, 0x1 + bl sub_81A4998 + ldrb r0, [r4] + movs r1, 0x2 + bl CopyWindowToVram + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A4AE8 + + thumb_func_start sub_81A4B14 +sub_81A4B14: @ 81A4B14 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + movs r1, 0 + ldr r3, =gSaveBlock2Ptr +_081A4B24: + movs r6, 0 + lsls r0, r1, 1 + adds r2, r1, 0x1 + mov r10, r2 + adds r0, r1 + lsls r0, 5 + mov r8, r0 + movs r7, 0 + movs r0, 0x87 + lsls r0, 2 + add r0, r8 + mov r9, r0 +_081A4B3C: + movs r5, 0 + adds r2, r7, 0 + mov r1, r8 + adds r4, r7, r1 +_081A4B44: + ldr r0, [r3] + add r0, r9 + adds r0, r2 + lsls r1, r5, 4 + adds r0, r1 + movs r1, 0 + str r2, [sp] + str r3, [sp, 0x4] + bl sub_80842F4 + ldr r3, [sp, 0x4] + ldr r0, [r3] + adds r0, r4 + ldr r1, =0x00000222 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldr r0, [r3] + adds r0, r4 + movs r1, 0x88 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + adds r4, 0x10 + adds r5, 0x1 + ldr r2, [sp] + cmp r5, 0x2 + ble _081A4B44 + adds r7, 0x30 + adds r6, 0x1 + cmp r6, 0x1 + ble _081A4B3C + mov r1, r10 + cmp r1, 0x8 + ble _081A4B24 + movs r6, 0 + ldr r7, =gSaveBlock2Ptr + movs r2, 0x54 + mov r10, r2 + movs r3, 0xFF + mov r9, r3 +_081A4B98: + adds r0, r6, 0x1 + mov r8, r0 + mov r1, r10 + muls r1, r6 + movs r0, 0x54 + adds r4, r6, 0 + muls r4, r0 + movs r2, 0 + ldr r3, =0x0000057c + adds r6, r1, r3 + movs r5, 0x2 +_081A4BAE: + ldr r0, [r7] + adds r0, r6 + adds r0, r2 + movs r1, 0 + str r2, [sp] + bl sub_80842F4 + ldr r0, [r7] + adds r0, r6 + ldr r2, [sp] + adds r0, r2 + adds r0, 0x4 + movs r1, 0 + bl sub_80842F4 + ldr r1, [r7] + adds r1, r4 + ldr r0, =0x00000586 + adds r1, r0 + ldrb r0, [r1] + mov r3, r9 + orrs r0, r3 + strb r0, [r1] + ldr r1, [r7] + adds r1, r4 + ldr r0, =0x0000058e + adds r1, r0 + ldrb r0, [r1] + orrs r0, r3 + strb r0, [r1] + ldr r0, [r7] + adds r0, r4 + ldr r1, =0x00000584 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + adds r4, 0x1C + ldr r2, [sp] + adds r2, 0x1C + subs r5, 0x1 + cmp r5, 0 + bge _081A4BAE + mov r6, r8 + cmp r6, 0x1 + ble _081A4B98 + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A4B14 + + thumb_func_start sub_81A4C30 +sub_81A4C30: @ 81A4C30 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r0, 0x96 + lsls r0, 2 + bl AllocZeroed + adds r7, r0, 0 + adds r4, r7, 0 + movs r5, 0 + movs r0, 0xFA + lsls r0, 1 + adds r6, r7, r0 + ldr r0, =gPlayerParty + mov r8, r0 +_081A4C4E: + mov r0, r8 + adds r1, r5, r0 + adds r0, r4, 0 + movs r2, 0x64 + bl memcpy + adds r4, 0x64 + adds r5, 0x64 + cmp r4, r6 + ble _081A4C4E + ldr r4, =gUnknown_020244E9 + ldrb r5, [r4] + bl copy_player_party_from_sav1 + bl sub_8076D5C + movs r0, 0x1 + bl TrySavingData + bl sav2_gender2_inplace_and_xFE + strb r5, [r4] + adds r4, r7, 0 + ldr r5, =gPlayerParty + movs r0, 0xFA + lsls r0, 1 + adds r6, r7, r0 +_081A4C84: + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x64 + bl memcpy + adds r4, 0x64 + adds r5, 0x64 + cmp r4, r6 + ble _081A4C84 + adds r0, r7, 0 + bl Free + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A4C30 + + thumb_func_start sub_81A4CB0 +sub_81A4CB0: @ 81A4CB0 + push {lr} + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _081A4CD0 + bl sub_8185EA0 + lsls r0, 24 + lsrs r0, 24 + b _081A4CDA + .pool +_081A4CD0: + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r0, 16 +_081A4CDA: + ldr r2, =gTrainers + ldr r1, =gUnknown_08611D30 + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x3] + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A4CB0 + + thumb_func_start sub_81A4D00 +sub_81A4D00: @ 81A4D00 + push {lr} + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _081A4D20 + bl sub_8185EA0 + lsls r0, 24 + lsrs r0, 24 + b _081A4D2A + .pool +_081A4D20: + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r0, 16 +_081A4D2A: + ldr r2, =gTrainers + ldr r1, =gUnknown_08611D30 + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x1] + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A4D00 + + thumb_func_start sub_81A4D50 +sub_81A4D50: @ 81A4D50 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _081A4D70 + bl sub_8185EA0 + lsls r0, 24 + lsrs r0, 24 + b _081A4D7A + .pool +_081A4D70: + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r0, 16 +_081A4D7A: + movs r3, 0 + lsls r0, 1 + ldr r2, =gTrainers + ldr r1, =gUnknown_08611D30 + adds r0, r1 + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r2, 0x4 + adds r2, r0, r2 +_081A4D90: + adds r1, r4, r3 + ldrb r0, [r2] + strb r0, [r1] + adds r2, 0x1 + adds r3, 0x1 + cmp r3, 0x6 + ble _081A4D90 + adds r1, r4, r3 + movs r0, 0xFF + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A4D50 + + thumb_func_start sub_81A4DB8 +sub_81A4DB8: @ 81A4DB8 + push {lr} + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + ldr r1, =gUnknown_08611C8C + lsrs r0, 15 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A4DB8 + + thumb_func_start sub_81A4DD8 +sub_81A4DD8: @ 81A4DD8 + push {lr} + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + ldr r2, =0x00004010 + ldr r1, =gUnknown_08611C8C + lsrs r0, 15 + adds r0, r1 + ldrb r1, [r0] + adds r0, r2, 0 + bl VarSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A4DD8 + + thumb_func_start sub_81A4E04 +sub_81A4E04: @ 81A4E04 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x44 + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x20] + bl sub_81A513C + str r0, [sp, 0x24] + ldr r0, [sp, 0x20] + cmp r0, 0x1 + bne _081A4E44 + ldr r0, =0x000003fe + bl sub_81953A0 + lsls r0, 16 + lsrs r0, 16 + bl sub_818FC78 + adds r4, r0, 0 + b _081A4E46 + .pool +_081A4E44: + movs r4, 0x7 +_081A4E46: + bl zero_enemy_party_data + movs r1, 0 + str r1, [sp, 0x18] + bl sub_8165C40 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x1C] + movs r2, 0 + str r2, [sp, 0x14] +_081A4E5C: + movs r0, 0x1 + ands r0, r4 + asrs r4, 1 + str r4, [sp, 0x30] + ldr r3, [sp, 0x14] + adds r3, 0x1 + str r3, [sp, 0x28] + cmp r0, 0 + bne _081A4E70 + b _081A4FC4 +_081A4E70: + ldr r4, [sp, 0x14] + lsls r4, 2 + mov r9, r4 + ldr r0, [sp, 0x24] + lsls r0, 4 + str r0, [sp, 0x38] + ldr r1, [sp, 0x20] + lsls r1, 4 + str r1, [sp, 0x34] + ldr r2, [sp, 0x1C] + lsls r2, 24 + str r2, [sp, 0x3C] + ldr r3, [sp, 0x18] + adds r3, 0x1 + str r3, [sp, 0x2C] + ldr r0, [sp, 0x14] + add r0, r9 + lsls r0, 2 + mov r8, r0 +_081A4E96: + bl Random + adds r4, r0, 0 + bl Random + lsls r4, 16 + lsrs r7, r4, 16 + lsls r0, 16 + orrs r7, r0 + ldr r0, =0x0000ef2a + adds r1, r7, 0 + bl sub_806EBD0 + lsls r0, 24 + cmp r0, 0 + bne _081A4E96 + ldr r4, [sp, 0x38] + ldr r1, [sp, 0x24] + subs r0, r4, r1 + lsls r5, r0, 2 + mov r2, r8 + adds r4, r2, r5 + ldr r3, [sp, 0x34] + ldr r1, [sp, 0x20] + subs r0, r3, r1 + lsls r6, r0, 3 + adds r4, r6 + ldr r2, =gUnknown_0861156C + adds r4, r2 + adds r0, r7, 0 + bl GetNatureFromPersonality + ldrb r1, [r4, 0x5] + lsls r0, 24 + lsrs r0, 24 + cmp r1, r0 + bne _081A4E96 + ldr r4, [sp, 0x18] + movs r0, 0x64 + adds r3, r4, 0 + muls r3, r0 + mov r8, r3 + ldr r1, =gEnemyParty + add r1, r8 + mov r10, r1 + ldr r4, [sp, 0x14] + add r4, r9 + lsls r4, 2 + adds r0, r4, r5 + adds r0, r6 + ldr r2, =gUnknown_0861156C + adds r0, r2 + ldrh r1, [r0] + ldr r3, [sp, 0x3C] + lsrs r2, r3, 24 + ldrb r3, [r0, 0x4] + movs r0, 0x1 + str r0, [sp] + str r7, [sp, 0x4] + str r0, [sp, 0x8] + ldr r0, =0x0000ef2a + str r0, [sp, 0xC] + mov r0, r10 + bl create_pokemon_set_level + ldr r0, =gUnknown_0861156C + adds r5, r0 + adds r5, r6, r5 + adds r4, r5, r4 + adds r4, 0x2 + mov r0, r10 + movs r1, 0xC + adds r2, r4, 0 + bl SetMonData + movs r7, 0 + mov r6, r8 + ldr r3, =gEnemyParty +_081A4F32: + adds r1, r7, 0 + adds r1, 0x1A + ldr r0, [sp, 0x14] + add r0, r9 + lsls r4, r0, 2 + adds r2, r5, r4 + adds r0, r7, 0x6 + adds r2, r0 + adds r0, r6, r3 + str r3, [sp, 0x40] + bl SetMonData + adds r7, 0x1 + ldr r3, [sp, 0x40] + cmp r7, 0x5 + ble _081A4F32 + movs r1, 0xFF + add r0, sp, 0x10 + strb r1, [r0] + movs r7, 0 + ldr r1, [sp, 0x18] + movs r2, 0x64 + adds r6, r1, 0 + muls r6, r2 + ldr r3, =gUnknown_08611578 + mov r8, r3 + ldr r3, =gEnemyParty + adds r5, r4, 0 +_081A4F6A: + ldr r4, [sp, 0x38] + ldr r0, [sp, 0x24] + subs r1, r4, r0 + lsls r1, 2 + adds r1, r5, r1 + ldr r2, [sp, 0x34] + ldr r4, [sp, 0x20] + subs r0, r2, r4 + lsls r0, 3 + adds r1, r0 + add r1, r8 + ldrh r4, [r1] + lsls r2, r7, 24 + lsrs r2, 24 + adds r0, r6, r3 + adds r1, r4, 0 + str r3, [sp, 0x40] + bl sub_80691F4 + ldr r3, [sp, 0x40] + cmp r4, 0xDA + bne _081A4F9C + movs r1, 0 + add r0, sp, 0x10 + strb r1, [r0] +_081A4F9C: + adds r5, 0x2 + adds r7, 0x1 + cmp r7, 0x3 + ble _081A4F6A + ldr r0, [sp, 0x18] + movs r1, 0x64 + adds r4, r0, 0 + muls r4, r1 + ldr r0, =gEnemyParty + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x20 + add r2, sp, 0x10 + bl SetMonData + adds r0, r4, 0 + bl pokemon_calc_effective_stats + ldr r2, [sp, 0x2C] + str r2, [sp, 0x18] +_081A4FC4: + ldr r4, [sp, 0x30] + ldr r3, [sp, 0x28] + str r3, [sp, 0x14] + cmp r3, 0x2 + bgt _081A4FD0 + b _081A4E5C +_081A4FD0: + add sp, 0x44 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A4E04 + + thumb_func_start sub_81A4FF0 +sub_81A4FF0: @ 81A4FF0 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x000040cf + bl VarGet + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + bl sub_81A513C + ldr r3, =gUnknown_0861156C + lsls r2, r4, 2 + adds r2, r4 + lsls r1, r0, 4 + subs r1, r0 + adds r1, r2 + lsls r1, 2 + lsls r0, r5, 4 + subs r0, r5 + lsls r0, 3 + adds r1, r0 + adds r1, r3 + ldrh r0, [r1] + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A4FF0 + + thumb_func_start sub_81A5030 +sub_81A5030: @ 81A5030 + push {lr} + lsls r0, 24 + ldr r2, =gUnknown_02038BCA + ldr r3, =0x000003fe + adds r1, r3, 0 + strh r1, [r2] + ldr r2, =0x00004010 + ldr r1, =gUnknown_08611C8C + lsrs r0, 23 + adds r0, r1 + ldrb r1, [r0] + adds r0, r2, 0 + bl VarSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5030 + + thumb_func_start sub_81A5060 +sub_81A5060: @ 81A5060 + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + lsls r6, 24 + lsrs r6, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x000040cf + bl VarGet + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + bl sub_81A513C + ldr r2, =gUnknown_0861156C + lsls r4, 1 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 2 + adds r4, r1 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 2 + adds r4, r1 + lsls r0, r5, 4 + subs r0, r5 + lsls r0, 3 + adds r4, r0 + adds r2, 0xC + adds r4, r2 + ldrh r0, [r4] + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A5060 + + thumb_func_start sub_81A50B0 +sub_81A50B0: @ 81A50B0 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x000040cf + bl VarGet + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + bl sub_81A513C + ldr r3, =gUnknown_0861156C + lsls r2, r4, 2 + adds r2, r4 + lsls r1, r0, 4 + subs r1, r0 + adds r1, r2 + lsls r1, 2 + lsls r0, r5, 4 + subs r0, r5 + lsls r0, 3 + adds r1, r0 + adds r1, r3 + ldrb r0, [r1, 0x5] + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A50B0 + + thumb_func_start sub_81A50F0 +sub_81A50F0: @ 81A50F0 + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + lsls r6, 24 + lsrs r6, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x000040cf + bl VarGet + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + bl sub_81A513C + ldr r2, =gUnknown_0861156C + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 2 + adds r4, r1 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 2 + adds r4, r1 + lsls r0, r5, 4 + subs r0, r5 + lsls r0, 3 + adds r4, r0 + adds r2, 0x6 + adds r4, r2 + ldrb r0, [r4] + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A50F0 + + thumb_func_start sub_81A513C +sub_81A513C: @ 81A513C + push {r4,r5,lr} + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r5, r0, 16 + lsls r0, r5, 24 + lsrs r0, 24 + bl sub_81A3B30 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bne _081A51A0 + bl sub_81A39C4 + lsls r0, 16 + ldr r3, =gUnknown_08611550 + lsls r2, r5, 2 + adds r1, r3, 0x3 + adds r1, r2, r1 + lsrs r0, 16 + ldrb r1, [r1] + adds r1, r0, r1 + adds r0, r2, r3 + ldrb r0, [r0] + cmp r1, r0 + bne _081A5180 + movs r4, 0 + b _081A51A0 + .pool +_081A5180: + adds r0, r3, 0x1 + adds r0, r2, r0 + ldrb r0, [r0] + cmp r1, r0 + beq _081A519E + cmp r1, r0 + ble _081A51A0 + subs r0, r1, r0 + adds r1, r3, 0x2 + adds r1, r2, r1 + ldrb r1, [r1] + bl __modsi3 + cmp r0, 0 + bne _081A51A0 +_081A519E: + movs r4, 0x1 +_081A51A0: + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81A513C + + thumb_func_start sub_81A51A8 +sub_81A51A8: @ 81A51A8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _081A51D4 + bl sub_8185EA0 + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8185EAC + lsls r0, 24 + lsrs r1, r0, 24 + b _081A51E4 + .pool +_081A51D4: + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r4, r0, 16 + bl sub_81A513C + adds r1, r0, 0 +_081A51E4: + cmp r5, 0 + beq _081A51F4 + cmp r5, 0x1 + beq _081A5214 + b _081A5228 + .pool +_081A51F4: + ldr r0, =gStringVar4 + ldr r2, =gUnknown_08611DB0 + lsls r1, 2 + adds r1, r2 + ldr r2, [r1] + lsls r1, r4, 2 + adds r1, r2 + ldr r1, [r1] + bl StringCopy + b _081A5228 + .pool +_081A5214: + ldr r0, =gStringVar4 + ldr r2, =gUnknown_08611DB8 + lsls r1, 2 + adds r1, r2 + ldr r2, [r1] + lsls r1, r4, 2 + adds r1, r2 + ldr r1, [r1] + bl StringCopy +_081A5228: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A51A8 + + thumb_func_start sub_81A5238 +sub_81A5238: @ 81A5238 + push {lr} + ldr r1, =gUnknown_08611F84 + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5238 + + thumb_func_start sub_81A5258 +sub_81A5258: @ 81A5258 + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + movs r6, 0 + ldrb r0, [r5] + cmp r0, 0xA + bls _081A5268 + b _081A5544 +_081A5268: + lsls r0, 2 + ldr r1, =_081A5278 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A5278: + .4byte _081A52A4 + .4byte _081A52F4 + .4byte _081A531C + .4byte _081A53B4 + .4byte _081A540C + .4byte _081A542C + .4byte _081A544C + .4byte _081A5490 + .4byte _081A553E + .4byte _081A54D4 + .4byte _081A5520 +_081A52A4: + ldr r0, =0x7fffff1c + movs r1, 0 + str r1, [sp] + movs r1, 0x4 + movs r2, 0 + movs r3, 0x8 + bl BeginNormalPaletteFade + ldr r1, =0x00003f3e + movs r0, 0x48 + bl SetGpuReg + ldr r0, =gUnknown_08611F74 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_08D855E8 + movs r1, 0xF8 + lsls r1, 1 + movs r2, 0x20 + bl LoadCompressedPalette + ldr r1, =gUnknown_02022E24 + movs r0, 0xFF + strh r0, [r1] + ldr r1, =gUnknown_02022E26 + movs r0, 0x70 + strh r0, [r1] + b _081A553E + .pool +_081A52F4: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _081A5306 + b _081A5544 +_081A5306: + str r0, [sp] + movs r0, 0x5 + movs r1, 0 + movs r2, 0x18 + movs r3, 0xD + bl sub_8056A3C + b _081A553E + .pool +_081A531C: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + beq _081A5328 + b _081A5544 +_081A5328: + ldr r1, =gBattleTextBuff1 + movs r2, 0xA1 + strb r2, [r1] + movs r0, 0xFF + strb r0, [r1, 0x1] + ldr r1, =gBattleTextBuff2 + strb r2, [r1] + movs r0, 0x1 + negs r0, r0 + strb r0, [r1, 0x1] + ldr r0, =gUnknown_085CCDB2 + bl get_battle_strings_ + ldr r4, =gUnknown_02022E2C + adds r0, r4, 0 + movs r1, 0xF + bl battle_show_message_maybe + ldr r0, =gUnknown_085CCDB5 + movs r1, 0x10 + bl battle_show_message_maybe + ldr r0, =gUnknown_085CCDB8 + bl get_battle_strings_ + adds r0, r4, 0 + movs r1, 0x11 + bl battle_show_message_maybe + ldr r0, =gUnknown_085CCDBB + movs r1, 0x12 + bl battle_show_message_maybe + ldr r0, =gUnknown_085CCDC0 + movs r1, 0x13 + bl battle_show_message_maybe + ldr r0, =gUnknown_085CCDC6 + movs r1, 0x14 + bl battle_show_message_maybe + ldr r0, =gUnknown_085CCDCB + bl get_battle_strings_ + adds r0, r4, 0 + movs r1, 0x15 + bl battle_show_message_maybe + b _081A553E + .pool +_081A53B4: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + beq _081A53C0 + b _081A5544 +_081A53C0: + ldr r1, =0x00003f3f + movs r0, 0x48 + bl SetGpuReg + movs r6, 0x80 + lsls r6, 15 + movs r4, 0x7 +_081A53CE: + asrs r1, r6, 16 + ldr r0, =gUnknown_08611F5C + movs r2, 0x54 + movs r3, 0 + bl CreateSprite + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + movs r1, 0x3 + bl StartSpriteAnim + movs r0, 0x80 + lsls r0, 13 + adds r6, r0 + subs r4, 0x1 + cmp r4, 0 + bge _081A53CE + b _081A553C + .pool +_081A540C: + ldr r0, =0x00000109 + bl PlaySE + movs r0, 0x50 + movs r1, 0x28 + movs r2, 0 + movs r3, 0 + bl sub_81A5558 + movs r0, 0xA0 + movs r1, 0x28 + movs r2, 0 + b _081A5464 + .pool +_081A542C: + ldr r0, =0x00000109 + bl PlaySE + movs r0, 0x50 + movs r1, 0x38 + movs r2, 0x1 + movs r3, 0 + bl sub_81A5558 + movs r0, 0xA0 + movs r1, 0x38 + movs r2, 0x1 + b _081A5464 + .pool +_081A544C: + ldr r0, =0x00000109 + bl PlaySE + movs r0, 0x50 + movs r1, 0x48 + movs r2, 0x2 + movs r3, 0 + bl sub_81A5558 + movs r0, 0xA0 + movs r1, 0x48 + movs r2, 0x2 +_081A5464: + movs r3, 0x1 + bl sub_81A5558 + ldr r0, =gUnknown_085CCDCB + bl get_battle_strings_ + ldr r0, =gUnknown_02022E2C + movs r1, 0x15 + bl battle_show_message_maybe + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + movs r6, 0x1 + b _081A5544 + .pool +_081A5490: + movs r0, 0x85 + lsls r0, 1 + bl PlaySE + ldr r0, =gBattleTextBuff1 + ldr r1, =gBattleTextBuff2 + ldrb r2, [r0] + ldrb r0, [r1] + cmp r2, r0 + bls _081A54BC + movs r6, 0x2 + ldr r1, =gBattleScripting + movs r0, 0 + strb r0, [r1, 0x17] + b _081A553E + .pool +_081A54BC: + cmp r2, r0 + bcs _081A54D0 + movs r6, 0x3 + ldr r1, =gBattleScripting + movs r0, 0x1 + strb r0, [r1, 0x17] + b _081A553E + .pool +_081A54D0: + movs r6, 0x4 + b _081A553E +_081A54D4: + ldr r1, =0x00003f3e + movs r0, 0x48 + bl SetGpuReg + movs r0, 0x1 + str r0, [sp] + movs r0, 0x5 + movs r1, 0 + movs r2, 0x18 + movs r3, 0xD + bl sub_8056A3C + movs r0, 0 + bl CopyBgTilemapBufferToVram + ldr r0, =gMPlay_BGM + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl m4aMPlayVolumeControl + ldr r0, =0x7fffff1c + movs r1, 0 + str r1, [sp] + movs r1, 0x4 + movs r2, 0x8 + movs r3, 0 + bl BeginNormalPaletteFade + b _081A553E + .pool +_081A5520: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081A5544 + ldr r1, =0x00003f3f + movs r0, 0x48 + bl SetGpuReg + movs r0, 0xFA + lsls r0, 2 + bl FreeSpriteTilesByTag +_081A553C: + movs r6, 0x1 +_081A553E: + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] +_081A5544: + adds r0, r6, 0 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A5258 + + thumb_func_start sub_81A5558 +sub_81A5558: @ 81A5558 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + lsls r3, 24 + lsrs r7, r3, 24 + movs r6, 0 + movs r1, 0 + ldr r0, =gBattleStruct + ldr r0, [r0] + movs r3, 0xA6 + lsls r3, 2 + adds r4, r0, r3 + ldr r5, =0x0000029a + adds r3, r0, r5 + adds r5, 0x2 + adds r5, r0 + mov r8, r5 + cmp r2, 0x1 + beq _081A55C4 + cmp r2, 0x1 + bgt _081A55A8 + cmp r2, 0 + beq _081A55B0 + b _081A5612 + .pool +_081A55A8: + mov r0, r9 + cmp r0, 0x2 + beq _081A55D8 + b _081A5612 +_081A55B0: + adds r0, r4, r7 + movs r6, 0 + ldrsb r6, [r0, r6] + movs r1, 0x1 + adds r0, r7, 0 + eors r0, r1 + adds r0, r4, r0 + movs r1, 0 + ldrsb r1, [r0, r1] + b _081A5612 +_081A55C4: + adds r0, r3, r7 + movs r6, 0 + ldrsb r6, [r0, r6] + movs r1, 0x1 + adds r0, r7, 0 + eors r0, r1 + adds r0, r3, r0 + movs r1, 0 + ldrsb r1, [r0, r1] + b _081A5612 +_081A55D8: + ldr r3, =gBattleMons + mov r9, r3 + movs r5, 0x58 + adds r0, r7, 0 + muls r0, r5 + add r0, r9 + ldrh r0, [r0, 0x28] + movs r4, 0x64 + muls r0, r4 + lsls r1, r7, 1 + add r1, r8 + ldrh r1, [r1] + bl __divsi3 + adds r6, r0, 0 + movs r0, 0x1 + adds r1, r7, 0 + eors r1, r0 + adds r0, r1, 0 + muls r0, r5 + add r0, r9 + ldrh r0, [r0, 0x28] + muls r0, r4 + lsls r1, 1 + add r1, r8 + ldrh r1, [r1] + bl __divsi3 + adds r1, r0, 0 +_081A5612: + cmp r6, r1 + ble _081A5638 + movs r4, 0x2 + cmp r7, 0 + beq _081A5628 + ldr r1, =gBattleTextBuff2 + b _081A562A + .pool +_081A5628: + ldr r1, =gBattleTextBuff1 +_081A562A: + ldrb r0, [r1] + adds r0, 0x2 + strb r0, [r1] + b _081A565E + .pool +_081A5638: + cmp r6, r1 + bne _081A565C + movs r4, 0x1 + cmp r7, 0 + beq _081A564C + ldr r1, =gBattleTextBuff2 + b _081A564E + .pool +_081A564C: + ldr r1, =gBattleTextBuff1 +_081A564E: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _081A565E + .pool +_081A565C: + movs r4, 0 +_081A565E: + ldr r0, =gUnknown_08611F5C + ldr r1, [sp] + mov r2, r10 + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + adds r1, r4, 0 + bl StartSpriteAnim + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5558 + + thumb_func_start sub_81A5698 +sub_81A5698: @ 81A5698 + push {lr} + adds r1, r0, 0 + ldr r0, =gBattleCommunication + ldrb r0, [r0] + cmp r0, 0x8 + bls _081A56AA + adds r0, r1, 0 + bl DestroySprite +_081A56AA: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5698 + + thumb_func_start sub_81A56B4 +sub_81A56B4: @ 81A56B4 + ldr r0, =gBattleStruct + ldr r2, [r0] + movs r0, 0xA6 + lsls r0, 2 + adds r1, r2, r0 + adds r0, 0x2 + adds r3, r2, r0 + adds r0, 0x2 + adds r2, r0 + movs r0, 0 + strb r0, [r1] + strb r0, [r1, 0x1] + strb r0, [r3] + strb r0, [r3, 0x1] + ldr r0, =gBattleMons + ldrh r1, [r0, 0x28] + strh r1, [r2] + adds r0, 0x80 + ldrh r0, [r0] + strh r0, [r2, 0x2] + bx lr + .pool + thumb_func_end sub_81A56B4 + + thumb_func_start sub_81A56E8 +sub_81A56E8: @ 81A56E8 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gBattleStruct + ldr r1, [r1] + movs r2, 0xA6 + lsls r2, 2 + adds r1, r2 + adds r1, r0 + ldr r2, =gBattleArenaMoveMindRatings + ldr r0, =gCurrentMove + ldrh r0, [r0] + adds r0, r2 + ldrb r0, [r0] + ldrb r2, [r1] + adds r0, r2 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_81A56E8 + + thumb_func_start sub_81A5718 +sub_81A5718: @ 81A5718 + push {r4-r6,lr} + lsls r0, 24 + lsrs r3, r0, 24 + adds r6, r3, 0 + ldr r0, =gBattleStruct + ldr r2, [r0] + ldr r0, =0x0000029a + adds r5, r2, r0 + ldr r0, =gHitMarker + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 18 + ands r0, r1 + cmp r0, 0 + beq _081A57DA + ldr r0, =0x000002a2 + adds r4, r2, r0 + ldrb r2, [r4] + ldr r0, =gBitTable + lsls r1, r3, 2 + adds r1, r0 + ldr r1, [r1] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _081A576C + bics r2, r1 + strb r2, [r4] + adds r1, r5, r3 + ldrb r0, [r1] + subs r0, 0x2 + b _081A57D8 + .pool +_081A576C: + ldr r0, =gBattleMoveFlags + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _081A5798 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081A5788 + ldr r0, =gBattleCommunication + ldrb r0, [r0, 0x6] + cmp r0, 0x1 + beq _081A57DA +_081A5788: + adds r1, r5, r3 + ldrb r0, [r1] + subs r0, 0x2 + b _081A57D8 + .pool +_081A5798: + movs r0, 0x6 + ands r0, r1 + cmp r0, 0x6 + bne _081A57A4 + adds r1, r5, r3 + b _081A57D4 +_081A57A4: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081A57B4 + adds r1, r5, r3 + ldrb r0, [r1] + adds r0, 0x2 + b _081A57D8 +_081A57B4: + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _081A57C4 + adds r1, r5, r3 + ldrb r0, [r1] + subs r0, 0x1 + b _081A57D8 +_081A57C4: + ldr r0, =gProtectStructs + lsls r1, r6, 4 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 31 + cmp r0, 0 + bne _081A57DA + adds r1, r5, r6 +_081A57D4: + ldrb r0, [r1] + adds r0, 0x1 +_081A57D8: + strb r0, [r1] +_081A57DA: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5718 + + thumb_func_start sub_81A57E4 +sub_81A57E4: @ 81A57E4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 16 + lsrs r1, 16 + adds r2, r1, 0 + ldr r0, =gBattleStruct + ldr r0, [r0] + ldr r5, =0x0000029a + adds r3, r0, r5 + movs r0, 0x99 + lsls r0, 1 + cmp r1, r0 + bgt _081A582A + subs r0, 0x1 + cmp r1, r0 + bge _081A585C + cmp r1, 0xC5 + bgt _081A581C + cmp r1, 0xC3 + bge _081A585C + cmp r1, 0x77 + beq _081A585C + b _081A5864 + .pool +_081A581C: + cmp r1, 0xC7 + blt _081A5864 + cmp r1, 0xCC + ble _081A585C + cmp r1, 0xCE + beq _081A585C + b _081A5864 +_081A582A: + ldr r0, =0x00000147 + cmp r1, r0 + beq _081A585C + cmp r1, r0 + bgt _081A5848 + subs r0, 0x12 + cmp r1, r0 + beq _081A585C + adds r0, 0x2 + cmp r1, r0 + beq _081A585C + b _081A5864 + .pool +_081A5848: + movs r0, 0xAD + lsls r0, 1 + cmp r2, r0 + blt _081A5864 + adds r0, 0x1 + cmp r2, r0 + ble _081A585C + adds r0, 0x3 + cmp r2, r0 + bne _081A5864 +_081A585C: + adds r1, r3, r4 + ldrb r0, [r1] + subs r0, 0x3 + strb r0, [r1] +_081A5864: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81A57E4 + + thumb_func_start sub_81A586C +sub_81A586C: @ 81A586C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gBattleStruct + ldr r3, [r1] + movs r1, 0xA7 + lsls r1, 2 + adds r3, r1 + lsls r2, r0, 1 + adds r2, r3 + ldr r5, =gBattleMons + movs r4, 0x58 + adds r1, r0, 0 + muls r1, r4 + adds r1, r5 + ldrh r1, [r1, 0x28] + strh r1, [r2] + movs r1, 0x1 + eors r0, r1 + lsls r1, r0, 1 + adds r1, r3 + muls r0, r4 + adds r0, r5 + ldrh r2, [r0, 0x28] + ldrh r0, [r1] + cmp r0, r2 + bls _081A58A4 + strh r2, [r1] +_081A58A4: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A586C + + thumb_func_start sub_81A58B4 +sub_81A58B4: @ 81A58B4 + push {r4-r6,lr} + ldr r4, =gSaveBlock2Ptr + ldr r1, [r4] + ldr r3, =0x00000ca9 + adds r0, r1, r3 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + ldr r0, =0x00000ca8 + adds r1, r0 + movs r2, 0 + strb r2, [r1] + ldr r1, [r4] + ldr r6, =0x00000cb2 + adds r0, r1, r6 + strh r2, [r0] + adds r1, r3 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r4] + adds r1, r3 + ldrb r2, [r1] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + cmp r5, 0 + beq _081A5914 + ldr r0, [r4] + ldr r1, =0x00000cdc + adds r0, r1 + ldr r2, [r0] + movs r0, 0x80 + b _081A591E + .pool +_081A5914: + ldr r0, [r4] + ldr r3, =0x00000cdc + adds r0, r3 + ldr r2, [r0] + movs r0, 0x40 +_081A591E: + ands r2, r0 + cmp r2, 0 + bne _081A5930 + ldr r0, [r4] + lsls r1, r5, 1 + ldr r6, =0x00000dda + adds r0, r6 + adds r0, r1 + strh r2, [r0] +_081A5930: + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0x4 + ldrsb r1, [r0, r1] + movs r2, 0x5 + ldrsb r2, [r0, r2] + movs r3, 0x1 + negs r3, r3 + movs r0, 0 + bl saved_warp2_set + ldr r1, =gUnknown_02038BCA + movs r0, 0 + strh r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A58B4 + + thumb_func_start sub_81A5964 +sub_81A5964: @ 81A5964 + push {r4,lr} + ldr r0, =gSaveBlock2Ptr + ldr r3, [r0] + ldr r1, =0x00000ca9 + adds r0, r3, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r1, r0, 30 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x1 + beq _081A59B0 + cmp r0, 0x1 + bgt _081A5994 + cmp r0, 0 + beq _081A599A + b _081A59EE + .pool +_081A5994: + cmp r0, 0x2 + beq _081A59C8 + b _081A59EE +_081A599A: + ldr r0, =gScriptResult + ldr r2, =0x00000dd8 + adds r1, r3, r2 + ldrh r1, [r1] + strh r1, [r0] + b _081A59EE + .pool +_081A59B0: + ldr r2, =gScriptResult + lsls r1, 1 + ldr r4, =0x00000dda + adds r0, r3, r4 + adds r0, r1 + ldrh r0, [r0] + b _081A59EC + .pool +_081A59C8: + cmp r1, 0 + beq _081A59E0 + ldr r2, =gScriptResult + ldr r1, =0x00000cdc + adds r0, r3, r1 + ldr r0, [r0] + movs r1, 0x80 + b _081A59EA + .pool +_081A59E0: + ldr r2, =gScriptResult + ldr r4, =0x00000cdc + adds r0, r3, r4 + ldr r0, [r0] + movs r1, 0x40 +_081A59EA: + ands r0, r1 +_081A59EC: + strh r0, [r2] +_081A59EE: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5964 + + thumb_func_start sub_81A59FC +sub_81A59FC: @ 81A59FC + push {lr} + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r1, =0x00000ca9 + adds r0, r2, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r1, r0, 30 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x1 + beq _081A5A48 + cmp r0, 0x1 + bgt _081A5A2C + cmp r0, 0 + beq _081A5A32 + b _081A5ABA + .pool +_081A5A2C: + cmp r0, 0x2 + beq _081A5A60 + b _081A5ABA +_081A5A32: + ldr r0, =gSpecialVar_0x8006 + ldrh r1, [r0] + ldr r3, =0x00000dd8 + adds r0, r2, r3 + strh r1, [r0] + b _081A5ABA + .pool +_081A5A48: + lsls r1, 1 + ldr r3, =0x00000dda + adds r0, r2, r3 + adds r0, r1 + ldr r1, =gSpecialVar_0x8006 + ldrh r1, [r1] + strh r1, [r0] + b _081A5ABA + .pool +_081A5A60: + cmp r1, 0 + beq _081A5A90 + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + cmp r0, 0 + beq _081A5A80 + ldr r1, =0x00000cdc + adds r0, r2, r1 + ldr r1, [r0] + movs r2, 0x80 + orrs r1, r2 + b _081A5AB8 + .pool +_081A5A80: + ldr r3, =0x00000cdc + adds r0, r2, r3 + ldr r1, [r0] + movs r2, 0x81 + negs r2, r2 + b _081A5AB6 + .pool +_081A5A90: + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + cmp r0, 0 + beq _081A5AAC + ldr r1, =0x00000cdc + adds r0, r2, r1 + ldr r1, [r0] + movs r2, 0x40 + orrs r1, r2 + b _081A5AB8 + .pool +_081A5AAC: + ldr r3, =0x00000cdc + adds r0, r2, r3 + ldr r1, [r0] + movs r2, 0x41 + negs r2, r2 +_081A5AB6: + ands r1, r2 +_081A5AB8: + str r1, [r0] +_081A5ABA: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A59FC + + thumb_func_start sub_81A5AC4 +sub_81A5AC4: @ 81A5AC4 + push {r4,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =gSpecialVar_0x8005 + ldrh r1, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + strb r1, [r0] + movs r0, 0x80 + lsls r0, 7 + movs r1, 0 + bl VarSet + ldr r1, [r4] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl sub_81A4C30 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5AC4 + + thumb_func_start sub_81A5B08 +sub_81A5B08: @ 81A5B08 + push {r4,r5,lr} + ldr r4, =gSaveBlock2Ptr + ldr r1, [r4] + ldr r2, =0x00000ca9 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 29 + ldr r2, =0x00000dda + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0x29 + bls _081A5B58 + bl Random + ldr r4, [r4] + ldr r5, =gUnknown_08611FAC + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x9 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 15 + adds r0, r5 + ldrh r0, [r0] + ldr r1, =0x00000dd8 + adds r4, r1 + b _081A5B76 + .pool +_081A5B58: + bl Random + ldr r4, [r4] + ldr r5, =gUnknown_08611FA0 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x6 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 15 + adds r0, r5 + ldrh r0, [r0] + ldr r2, =0x00000dd8 + adds r4, r2 +_081A5B76: + strh r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5B08 + + thumb_func_start sub_81A5B88 +sub_81A5B88: @ 81A5B88 + push {r4,r5,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000dd8 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x1 + bl AddBagItem + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bne _081A5BD0 + ldr r0, [r4] + ldr r1, =0x00000dd8 + adds r0, r1 + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r0, [r4] + ldr r1, =0x00000dd8 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + ldr r0, =gScriptResult + strh r5, [r0] + b _081A5BD6 + .pool +_081A5BD0: + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] +_081A5BD6: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5B88 + + thumb_func_start sub_81A5BE0 +sub_81A5BE0: @ 81A5BE0 + push {lr} + ldr r0, =gStringVar1 + ldr r1, =gUnknown_02038BCA + ldrh r1, [r1] + bl sub_8162E20 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5BE0 + + thumb_func_start sub_81A5BF8 +sub_81A5BF8: @ 81A5BF8 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0xC + movs r0, 0x1B + mov r8, r0 + movs r5, 0x7 + movs r4, 0x1 + str r4, [sp] + movs r6, 0x6 + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0xFE + movs r3, 0xE + bl FillBgTilemapBufferRect + str r4, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0x20 + movs r3, 0xE + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x31 + movs r2, 0 + movs r3, 0xE + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x33 + movs r2, 0x1 + movs r3, 0xE + bl FillBgTilemapBufferRect + mov r0, r8 + str r0, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x34 + movs r2, 0x2 + movs r3, 0xE + bl FillBgTilemapBufferRect + movs r0, 0x1C + mov r8, r0 + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x35 + movs r2, 0x1C + movs r3, 0xE + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x36 + movs r2, 0x1D + movs r3, 0xE + bl FillBgTilemapBufferRect + str r4, [sp] + movs r6, 0x5 + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x37 + movs r2, 0 + movs r3, 0xF + bl FillBgTilemapBufferRect + mov r0, r8 + str r0, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x39 + movs r2, 0x1 + movs r3, 0xF + bl FillBgTilemapBufferRect + str r4, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x3A + movs r2, 0x1D + movs r3, 0xF + bl FillBgTilemapBufferRect + ldr r1, =0x00000831 + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r2, 0 + movs r3, 0x13 + bl FillBgTilemapBufferRect + ldr r1, =0x00000833 + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r2, 0x1 + movs r3, 0x13 + bl FillBgTilemapBufferRect + ldr r1, =0x00000834 + movs r0, 0x1A + str r0, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r2, 0x2 + movs r3, 0x13 + bl FillBgTilemapBufferRect + ldr r1, =0x00000835 + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r2, 0x1C + movs r3, 0x13 + bl FillBgTilemapBufferRect + ldr r1, =0x00000836 + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r2, 0x1D + movs r3, 0x13 + bl FillBgTilemapBufferRect + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5BF8 + + thumb_func_start sub_81A5D44 +sub_81A5D44: @ 81A5D44 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0xC + movs r5, 0 + movs r4, 0x1 + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x3 + movs r2, 0 + movs r3, 0xE + bl FillBgTilemapBufferRect + movs r6, 0x4 + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x4 + movs r2, 0x1 + movs r3, 0xE + bl FillBgTilemapBufferRect + movs r0, 0x1B + mov r8, r0 + str r0, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x5 + movs r2, 0x2 + movs r3, 0xE + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x6 + movs r2, 0x1C + movs r3, 0xE + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x7 + movs r2, 0x1D + movs r3, 0xE + bl FillBgTilemapBufferRect + str r4, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x8 + movs r2, 0 + movs r3, 0xF + bl FillBgTilemapBufferRect + str r4, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x9 + movs r2, 0x1 + movs r3, 0xF + bl FillBgTilemapBufferRect + mov r0, r8 + str r0, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0xA + movs r2, 0x2 + movs r3, 0xF + bl FillBgTilemapBufferRect + str r4, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0xB + movs r2, 0x1C + movs r3, 0xF + bl FillBgTilemapBufferRect + str r4, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0xC + movs r2, 0x1D + movs r3, 0xF + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0xD + movs r2, 0 + movs r3, 0x13 + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0xE + movs r2, 0x1 + movs r3, 0x13 + bl FillBgTilemapBufferRect + mov r0, r8 + str r0, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0xF + movs r2, 0x2 + movs r3, 0x13 + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x10 + movs r2, 0x1C + movs r3, 0x13 + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x11 + movs r2, 0x1D + movs r3, 0x13 + bl FillBgTilemapBufferRect + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81A5D44 + + thumb_func_start sub_81A5E74 +sub_81A5E74: @ 81A5E74 + push {lr} + ldr r1, =gUnknown_08612120 + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5E74 + + thumb_func_start sub_81A5E94 +sub_81A5E94: @ 81A5E94 + push {r4-r7,lr} + ldr r5, =gSaveBlock2Ptr + ldr r0, [r5] + ldr r4, =0x00000ca9 + adds r0, r4 + ldrb r0, [r0] + lsls r0, 30 + lsrs r7, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, [r5] + ldr r1, =0x00000ca8 + adds r0, r1 + movs r2, 0 + strb r2, [r0] + ldr r1, [r5] + ldr r3, =0x00000cb2 + adds r0, r1, r3 + strh r2, [r0] + adds r1, r4 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r5] + adds r1, r4 + ldrb r2, [r1] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r4, [r5] + ldr r0, =0x00000cdc + adds r3, r4, r0 + ldr r2, =gUnknown_08612164 + lsls r0, r7, 2 + lsls r1, r6, 3 + adds r0, r1 + adds r0, r2 + ldr r3, [r3] + ldr r0, [r0] + ands r3, r0 + cmp r3, 0 + bne _081A5F0A + lsls r1, r7, 1 + lsls r0, r6, 2 + adds r1, r0 + ldr r2, =0x00000de2 + adds r0, r4, r2 + adds r0, r1 + strh r3, [r0] + adds r2, 0x10 + adds r0, r4, r2 + adds r0, r1 + strh r3, [r0] +_081A5F0A: + ldr r1, =gUnknown_03001288 + movs r0, 0 + strb r0, [r1] + movs r2, 0 + ldr r6, =gSaveBlock1Ptr + movs r4, 0xE7 + lsls r4, 4 + ldr r0, =0x0000ffff + adds r3, r0, 0 +_081A5F1C: + ldr r1, [r5] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r1, r0 + adds r1, r4 + ldrh r0, [r1] + orrs r0, r3 + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x5 + bls _081A5F1C + movs r2, 0 + ldr r4, =gUnknown_03006298 + ldr r1, =0x0000ffff + adds r3, r1, 0 +_081A5F40: + lsls r0, r2, 1 + adds r0, r4 + ldrh r1, [r0] + orrs r1, r3 + strh r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x2 + bls _081A5F40 + ldr r0, [r6] + movs r1, 0x4 + ldrsb r1, [r0, r1] + movs r2, 0x5 + ldrsb r2, [r0, r2] + movs r3, 0x1 + negs r3, r3 + movs r0, 0 + bl saved_warp2_set + ldr r1, =gUnknown_02038BCA + movs r0, 0 + strh r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5E94 + + thumb_func_start sub_81A5FA8 +sub_81A5FA8: @ 81A5FA8 + push {r4-r7,lr} + ldr r7, =gSaveBlock2Ptr + ldr r0, [r7] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r6, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x2 + beq _081A6000 + cmp r0, 0x2 + bgt _081A5FE4 + cmp r0, 0x1 + beq _081A5FEA + b _081A6044 + .pool +_081A5FE4: + cmp r0, 0x3 + beq _081A6030 + b _081A6044 +_081A5FEA: + ldr r3, =gScriptResult + ldr r0, [r7] + lsls r1, r6, 1 + lsls r2, r5, 2 + adds r1, r2 + ldr r2, =0x00000de2 + b _081A603C + .pool +_081A6000: + ldr r4, =gScriptResult + ldr r2, [r7] + ldr r0, =0x00000cdc + adds r2, r0 + ldr r3, =gUnknown_08612164 + lsls r0, r6, 2 + lsls r1, r5, 3 + adds r0, r1 + adds r0, r3 + ldr r1, [r2] + ldr r0, [r0] + ands r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + strh r0, [r4] + b _081A6044 + .pool +_081A6030: + ldr r3, =gScriptResult + ldr r0, [r7] + lsls r1, r6, 1 + lsls r2, r5, 2 + adds r1, r2 + ldr r2, =0x00000df2 +_081A603C: + adds r0, r2 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r3] +_081A6044: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5FA8 + + thumb_func_start sub_81A6054 +sub_81A6054: @ 81A6054 + push {r4-r6,lr} + ldr r6, =gSaveBlock2Ptr + ldr r0, [r6] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x2 + beq _081A60B4 + cmp r0, 0x2 + bgt _081A6090 + cmp r0, 0x1 + beq _081A6096 + b _081A6128 + .pool +_081A6090: + cmp r0, 0x3 + beq _081A6108 + b _081A6128 +_081A6096: + ldr r2, [r6] + lsls r0, r5, 1 + lsls r1, r4, 2 + adds r0, r1 + ldr r1, =0x00000de2 + adds r2, r1 + adds r2, r0 + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + strh r0, [r2] + b _081A6128 + .pool +_081A60B4: + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + cmp r0, 0 + beq _081A60E4 + ldr r2, [r6] + ldr r0, =0x00000cdc + adds r2, r0 + ldr r3, =gUnknown_08612164 + lsls r1, r5, 2 + lsls r0, r4, 3 + adds r1, r0 + adds r1, r3 + ldr r0, [r2] + ldr r1, [r1] + orrs r0, r1 + str r0, [r2] + b _081A6128 + .pool +_081A60E4: + ldr r2, [r6] + ldr r1, =0x00000cdc + adds r2, r1 + ldr r3, =gUnknown_08612174 + lsls r1, r5, 2 + lsls r0, r4, 3 + adds r1, r0 + adds r1, r3 + ldr r0, [r2] + ldr r1, [r1] + ands r0, r1 + str r0, [r2] + b _081A6128 + .pool +_081A6108: + ldr r3, =gUnknown_03001288 + ldrb r0, [r3] + cmp r0, 0x1 + bne _081A6128 + ldr r2, [r6] + lsls r0, r5, 1 + lsls r1, r4, 2 + adds r0, r1 + ldr r1, =0x00000df2 + adds r2, r1 + adds r2, r0 + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + movs r1, 0 + strh r0, [r2] + strb r1, [r3] +_081A6128: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A6054 + + thumb_func_start sub_81A613C +sub_81A613C: @ 81A613C + push {r4,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =gSpecialVar_0x8005 + ldrh r1, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + strb r1, [r0] + movs r0, 0x80 + lsls r0, 7 + movs r1, 0 + bl VarSet + ldr r1, [r4] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl sub_81A4C30 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A613C + + thumb_func_start nullsub_75 +nullsub_75: @ 81A6180 + bx lr + thumb_func_end nullsub_75 + + thumb_func_start nullsub_123 +nullsub_123: @ 81A6184 + bx lr + thumb_func_end nullsub_123 + + thumb_func_start sub_81A6188 +sub_81A6188: @ 81A6188 + push {lr} + bl zero_player_party_data + bl sub_819A4F8 + pop {r0} + bx r0 + thumb_func_end sub_81A6188 + + thumb_func_start sub_81A6198 +sub_81A6198: @ 81A6198 + push {lr} + bl sub_819DC00 + pop {r0} + bx r0 + thumb_func_end sub_81A6198 + + thumb_func_start sub_81A61A4 +sub_81A61A4: @ 81A61A4 + ldr r1, =gUnknown_03001288 + movs r0, 0x1 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_81A61A4 + + thumb_func_start sub_81A61B0 +sub_81A61B0: @ 81A61B0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + str r0, [sp, 0x10] + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + ldr r1, [r4] + ldr r3, [sp, 0x10] + lsls r2, r3, 1 + lsrs r0, 14 + adds r2, r0 + ldr r6, =0x00000de2 + adds r1, r6 + adds r1, r2 + ldrh r0, [r1] + movs r1, 0x7 + bl __udivsi3 + ldr r2, =gUnknown_0203BC88 + ldr r1, =gBattleFrontierTrainers + str r1, [r2] + ldr r5, =0x00000cb2 + lsls r0, 24 + str r0, [sp, 0x20] + mov r8, r0 +_081A61FA: + ldr r0, [r4] + adds r0, r5 + ldrb r1, [r0] + mov r2, r8 + lsrs r0, r2, 24 + bl sub_8162548 + lsls r0, 16 + lsrs r3, r0, 16 + movs r7, 0 + ldr r1, [r4] + adds r0, r1, r5 + ldr r6, [sp, 0x10] + lsls r6, 24 + str r6, [sp, 0x1C] + ldrh r0, [r0] + cmp r7, r0 + bge _081A6244 + ldr r2, =0x00000cb4 + adds r0, r1, r2 + ldrh r0, [r0] + ldr r6, =gSaveBlock2Ptr + cmp r0, r3 + beq _081A6244 + ldr r1, [r6] + ldr r6, =0x00000cb2 + adds r0, r1, r6 + ldrh r2, [r0] + ldr r0, =0x00000cb4 + adds r1, r0 +_081A6236: + adds r1, 0x2 + adds r7, 0x1 + cmp r7, r2 + bge _081A6244 + ldrh r0, [r1] + cmp r0, r3 + bne _081A6236 +_081A6244: + ldr r0, [r4] + ldr r1, =0x00000cb2 + adds r0, r1 + ldr r6, =gSaveBlock2Ptr + ldrh r0, [r0] + cmp r7, r0 + bne _081A61FA + ldr r0, =gUnknown_02038BCA + strh r3, [r0] + ldr r2, [r6] + adds r1, r2, r1 + ldrh r0, [r1] + cmp r0, 0x5 + bhi _081A626C + adds r1, r0, 0 + lsls r1, 1 + ldr r4, =0x00000cb4 + adds r0, r2, r4 + adds r0, r1 + strh r3, [r0] +_081A626C: + movs r7, 0 + mov r10, sp + movs r6, 0 + lsls r6, 1 + str r6, [sp, 0x14] + add r6, sp + str r6, [sp, 0x18] +_081A627A: + ldr r1, [sp, 0x1C] + lsrs r0, r1, 24 + ldr r2, [sp, 0x20] + lsrs r1, r2, 24 + movs r2, 0 + bl sub_81A6EF0 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + ldr r4, =gUnknown_0203BC8C + ldr r2, [r4] + lsls r1, r0, 4 + adds r0, r1, r2 + ldrh r0, [r0] + cmp r0, 0xC9 + beq _081A636E + movs r3, 0 + ldr r6, =gSaveBlock2Ptr + mov r8, r1 + adds r5, r0, 0 + ldr r1, [r6] +_081A62A6: + movs r4, 0xE7 + lsls r4, 4 + adds r0, r1, r4 + ldrh r0, [r0] + lsls r0, 4 + adds r0, r2 + ldrh r0, [r0] + cmp r5, r0 + beq _081A62C0 + adds r1, 0xC + adds r3, 0x1 + cmp r3, 0x5 + ble _081A62A6 +_081A62C0: + cmp r3, 0x6 + bne _081A636E + ldr r6, [sp, 0x10] + cmp r6, 0 + bne _081A62D0 + ldr r0, =0x00000351 + cmp r9, r0 + bhi _081A636E +_081A62D0: + movs r2, 0 + adds r4, r2, r7 + cmp r2, r4 + bge _081A6302 + ldr r1, [sp, 0x18] + ldrh r0, [r1] + cmp r0, r5 + beq _081A6302 + adds r6, r4, 0 + ldr r3, =gUnknown_0203BC8C + mov r12, r3 + mov r5, r8 + ldr r3, [sp, 0x14] + add r3, sp +_081A62EC: + adds r3, 0x2 + adds r2, 0x1 + cmp r2, r6 + bge _081A6302 + mov r1, r12 + ldr r0, [r1] + adds r0, r5, r0 + ldrh r1, [r3] + ldrh r0, [r0] + cmp r1, r0 + bne _081A62EC +_081A6302: + cmp r2, r4 + bne _081A636E + movs r2, 0 + cmp r2, r4 + bge _081A633E + ldr r3, =gBattleFrontierHeldItems + mov r12, r3 + add r0, sp, 0x8 + ldr r6, [sp, 0x14] + adds r3, r0, r6 + mov r0, r8 + str r0, [sp, 0x24] + adds r5, r4, 0 +_081A631C: + ldrh r1, [r3] + cmp r1, 0 + beq _081A6336 + ldr r6, =gUnknown_0203BC8C + ldr r0, [r6] + ldr r6, [sp, 0x24] + adds r0, r6, r0 + ldrb r0, [r0, 0xA] + lsls r0, 1 + add r0, r12 + ldrh r0, [r0] + cmp r1, r0 + beq _081A633E +_081A6336: + adds r3, 0x2 + adds r2, 0x1 + cmp r2, r5 + blt _081A631C +_081A633E: + cmp r2, r4 + bne _081A636E + lsls r4, r7, 1 + ldr r0, =gUnknown_0203BC8C + ldr r1, [r0] + add r1, r8 + ldrh r0, [r1] + mov r2, r10 + strh r0, [r2] + add r2, sp, 0x8 + adds r2, r4 + ldr r3, =gBattleFrontierHeldItems + ldrb r0, [r1, 0xA] + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + strh r0, [r2] + ldr r0, =gUnknown_03006298 + adds r4, r0 + mov r3, r9 + strh r3, [r4] + movs r4, 0x2 + add r10, r4 + adds r7, 0x1 +_081A636E: + cmp r7, 0x3 + bne _081A627A + add sp, 0x28 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A61B0 + + thumb_func_start sub_81A63B8 +sub_81A63B8: @ 81A63B8 + push {lr} + ldr r0, =gUnknown_02038BCA + ldrh r0, [r0] + movs r1, 0 + bl sub_8162614 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A63B8 + + thumb_func_start sub_81A63CC +sub_81A63CC: @ 81A63CC + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + beq _081A63FC + ldr r1, =gUnknown_0203BC8C + ldr r0, =gBattleFrontierMons + b _081A6400 + .pool +_081A63FC: + ldr r1, =gUnknown_0203BC8C + ldr r0, =gSlateportBattleTentMons +_081A6400: + str r0, [r1] + movs r7, 0 + ldr r2, =gSaveBlock2Ptr + mov r8, r2 +_081A6408: + mov r0, r8 + ldr r1, [r0] + adds r0, r7, 0x3 + lsls r4, r0, 1 + adds r4, r0 + lsls r4, 2 + adds r1, r4 + ldr r0, =gUnknown_03006298 + lsls r6, r7, 1 + adds r6, r0 + ldrh r0, [r6] + movs r2, 0xE7 + lsls r2, 4 + adds r1, r2 + strh r0, [r1] + movs r0, 0x64 + adds r5, r7, 0 + muls r5, r0 + ldr r0, =gEnemyParty + adds r5, r0 + adds r0, r5, 0 + movs r1, 0x28 + movs r2, 0 + bl pokemon_getattr_encrypted + mov r2, r8 + ldr r1, [r2] + adds r1, r4 + ldr r2, =0x00000e78 + adds r1, r2 + strb r0, [r1] + adds r0, r5, 0 + movs r1, 0 + movs r2, 0 + bl GetMonData + mov r2, r8 + ldr r1, [r2] + ldr r2, =0x00000e74 + adds r1, r2 + adds r1, r4 + str r0, [r1] + adds r0, r5, 0 + movs r1, 0x2E + movs r2, 0 + bl pokemon_getattr_encrypted + mov r2, r8 + ldr r1, [r2] + adds r1, r4 + ldr r2, =0x00000e79 + adds r1, r2 + strb r0, [r1] + ldrh r1, [r6] + ldr r0, =gUnknown_0203BC8C + ldr r0, [r0] + lsls r1, 4 + adds r1, r0 + ldrb r2, [r1, 0xA] + lsls r2, 1 + ldr r0, =gBattleFrontierHeldItems + adds r2, r0 + adds r0, r5, 0 + movs r1, 0xC + bl SetMonData + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x2 + bls _081A6408 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A63CC + + thumb_func_start sub_81A64C4 +sub_81A64C4: @ 81A64C4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r2, r0, r1 + ldrb r1, [r2] + movs r3, 0x3 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0x2 + bne _081A6500 + ldr r1, =gUnknown_0203BC8C + ldr r0, =gSlateportBattleTentMons + str r0, [r1] + movs r2, 0x1E + str r2, [sp, 0x14] + b _081A6518 + .pool +_081A6500: + ldr r1, =gUnknown_0203BC8C + ldr r0, =gBattleFrontierMons + str r0, [r1] + ldrb r1, [r2] + adds r0, r3, 0 + ands r0, r1 + movs r4, 0x32 + str r4, [sp, 0x14] + cmp r0, 0 + beq _081A6518 + movs r5, 0x64 + str r5, [sp, 0x14] +_081A6518: + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x1 + bls _081A6522 + b _081A666C +_081A6522: + bl zero_player_party_data + movs r0, 0 + mov r8, r0 + mov r1, sp + adds r1, 0x12 + str r1, [sp, 0x1C] + ldr r2, =gUnknown_0203BC8C + mov r9, r2 +_081A6534: + ldr r4, =gSaveBlock2Ptr + ldr r2, [r4] + mov r5, r8 + lsls r5, 1 + mov r10, r5 + mov r3, r10 + add r3, r8 + lsls r3, 2 + adds r1, r2, r3 + movs r4, 0xE7 + lsls r4, 4 + adds r0, r1, r4 + ldrh r7, [r0] + ldr r5, =0x00000e78 + adds r1, r5 + ldrb r6, [r1] + movs r1, 0x64 + mov r0, r8 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + mov r4, r9 + ldr r1, [r4] + lsls r4, r7, 4 + adds r1, r4, r1 + ldrh r1, [r1] + movs r5, 0x1 + str r5, [sp] + ldr r5, =0x00000e74 + adds r2, r5 + adds r2, r3 + ldr r2, [r2] + str r2, [sp, 0x4] + movs r2, 0 + str r2, [sp, 0x8] + str r2, [sp, 0xC] + ldr r2, [sp, 0x14] + adds r3, r6, 0 + bl create_pokemon_set_level + movs r1, 0 + mov r2, r9 + ldr r0, [r2] + adds r4, r0 + ldrb r4, [r4, 0xB] + mov r5, r8 + adds r5, 0x1 + str r5, [sp, 0x18] + movs r5, 0x5 +_081A6596: + adds r0, r4, 0 + movs r2, 0x1 + ands r0, r2 + cmp r0, 0 + beq _081A65A2 + adds r1, 0x1 +_081A65A2: + lsrs r4, 1 + subs r5, 0x1 + cmp r5, 0 + bge _081A6596 + movs r0, 0xFF + lsls r0, 1 + bl __divsi3 + add r1, sp, 0x10 + strh r0, [r1] + movs r4, 0x1 + movs r5, 0 + lsls r7, 4 + movs r0, 0x64 + mov r6, r8 + muls r6, r0 + ldr r3, =gPlayerParty +_081A65C4: + mov r1, r9 + ldr r0, [r1] + adds r0, r7, r0 + ldrb r0, [r0, 0xB] + ands r0, r4 + cmp r0, 0 + beq _081A65E2 + adds r1, r5, 0 + adds r1, 0x1A + adds r0, r6, r3 + add r2, sp, 0x10 + str r3, [sp, 0x20] + bl SetMonData + ldr r3, [sp, 0x20] +_081A65E2: + lsls r0, r4, 25 + lsrs r4, r0, 24 + adds r5, 0x1 + cmp r5, 0x5 + ble _081A65C4 + movs r2, 0x64 + mov r4, r8 + muls r4, r2 + ldr r5, =gPlayerParty + adds r0, r4, r5 + bl pokemon_calc_effective_stats + movs r0, 0 + ldr r1, [sp, 0x1C] + strb r0, [r1] + movs r6, 0 +_081A6602: + mov r2, r9 + ldr r0, [r2] + adds r0, r7, r0 + lsls r1, r6, 1 + adds r0, 0x2 + adds r0, r1 + ldrh r1, [r0] + lsls r2, r6, 24 + lsrs r2, 24 + adds r0, r4, r5 + bl sub_81A7024 + adds r6, 0x1 + cmp r6, 0x3 + ble _081A6602 + movs r5, 0x64 + mov r4, r8 + muls r4, r5 + ldr r0, =gPlayerParty + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x20 + ldr r2, [sp, 0x1C] + bl SetMonData + mov r1, r9 + ldr r0, [r1] + adds r0, r7, r0 + ldrb r2, [r0, 0xA] + lsls r2, 1 + ldr r0, =gBattleFrontierHeldItems + adds r2, r0 + adds r0, r4, 0 + movs r1, 0xC + bl SetMonData + mov r2, r10 + add r2, r8 + lsls r2, 2 + ldr r5, =gSaveBlock2Ptr + ldr r0, [r5] + adds r2, r0 + ldr r0, =0x00000e79 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x2E + bl SetMonData + ldr r1, [sp, 0x18] + mov r8, r1 + cmp r1, 0x2 + bgt _081A666C + b _081A6534 +_081A666C: + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0 + beq _081A667A + cmp r0, 0x2 + beq _081A667A + b _081A67AE +_081A667A: + movs r2, 0 + mov r8, r2 + ldr r4, =gUnknown_0203BC8C + mov r9, r4 +_081A6682: + ldr r5, =gSaveBlock2Ptr + ldr r3, [r5] + mov r0, r8 + adds r0, 0x3 + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 2 + adds r1, r3, r2 + movs r4, 0xE7 + lsls r4, 4 + adds r0, r1, r4 + ldrh r7, [r0] + ldr r5, =0x00000e78 + adds r1, r5 + ldrb r6, [r1] + movs r1, 0x64 + mov r0, r8 + muls r0, r1 + ldr r1, =gEnemyParty + adds r0, r1 + mov r4, r9 + ldr r1, [r4] + lsls r4, r7, 4 + adds r1, r4, r1 + ldrh r1, [r1] + movs r5, 0x1 + str r5, [sp] + ldr r5, =0x00000e74 + adds r3, r5 + adds r3, r2 + ldr r2, [r3] + str r2, [sp, 0x4] + movs r2, 0 + str r2, [sp, 0x8] + str r2, [sp, 0xC] + ldr r2, [sp, 0x14] + adds r3, r6, 0 + bl create_pokemon_set_level + movs r1, 0 + mov r2, r9 + ldr r0, [r2] + adds r4, r0 + ldrb r4, [r4, 0xB] + mov r5, r8 + lsls r5, 1 + mov r10, r5 + mov r0, r8 + adds r0, 0x1 + str r0, [sp, 0x18] + movs r5, 0x5 +_081A66E8: + adds r0, r4, 0 + movs r2, 0x1 + ands r0, r2 + cmp r0, 0 + beq _081A66F4 + adds r1, 0x1 +_081A66F4: + lsrs r4, 1 + subs r5, 0x1 + cmp r5, 0 + bge _081A66E8 + add r4, sp, 0x10 + movs r0, 0xFF + lsls r0, 1 + bl __divsi3 + strh r0, [r4] + movs r4, 0x1 + movs r5, 0 + lsls r7, 4 + movs r0, 0x64 + mov r6, r8 + muls r6, r0 + ldr r3, =gEnemyParty +_081A6716: + mov r1, r9 + ldr r0, [r1] + adds r0, r7, r0 + ldrb r0, [r0, 0xB] + ands r0, r4 + cmp r0, 0 + beq _081A6734 + adds r1, r5, 0 + adds r1, 0x1A + adds r0, r6, r3 + add r2, sp, 0x10 + str r3, [sp, 0x20] + bl SetMonData + ldr r3, [sp, 0x20] +_081A6734: + lsls r0, r4, 25 + lsrs r4, r0, 24 + adds r5, 0x1 + cmp r5, 0x5 + ble _081A6716 + movs r2, 0x64 + mov r4, r8 + muls r4, r2 + ldr r5, =gEnemyParty + adds r0, r4, r5 + bl pokemon_calc_effective_stats + movs r6, 0 +_081A674E: + mov r1, r9 + ldr r0, [r1] + adds r0, r7, r0 + lsls r1, r6, 1 + adds r0, 0x2 + adds r0, r1 + ldrh r1, [r0] + lsls r2, r6, 24 + lsrs r2, 24 + adds r0, r4, r5 + bl sub_81A7024 + adds r6, 0x1 + cmp r6, 0x3 + ble _081A674E + movs r2, 0x64 + mov r4, r8 + muls r4, r2 + ldr r0, =gEnemyParty + adds r4, r0 + mov r5, r9 + ldr r0, [r5] + adds r0, r7, r0 + ldrb r2, [r0, 0xA] + lsls r2, 1 + ldr r0, =gBattleFrontierHeldItems + adds r2, r0 + adds r0, r4, 0 + movs r1, 0xC + bl SetMonData + mov r2, r10 + add r2, r8 + lsls r2, 2 + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + adds r2, r0 + ldr r5, =0x00000e9d + adds r2, r5 + adds r0, r4, 0 + movs r1, 0x2E + bl SetMonData + ldr r0, [sp, 0x18] + mov r8, r0 + cmp r0, 0x2 + bgt _081A67AE + b _081A6682 +_081A67AE: + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A64C4 + + thumb_func_start sub_81A67EC +sub_81A67EC: @ 81A67EC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4C + ldr r1, =gUnknown_0203BC88 + ldr r0, =gBattleFrontierTrainers + str r0, [r1] + mov r0, sp + adds r0, 0xC + str r0, [sp, 0x38] + mov r1, sp + adds r1, 0x18 + str r1, [sp, 0x3C] + ldr r2, =gSaveBlock2Ptr + mov r9, r2 + movs r2, 0 + adds r3, r1, 0 + adds r1, r0, 0 + mov r0, sp + movs r4, 0x5 + mov r8, r4 +_081A681A: + strh r2, [r0] + strh r2, [r1] + strh r2, [r3] + adds r3, 0x2 + adds r1, 0x2 + adds r0, 0x2 + movs r5, 0x1 + negs r5, r5 + add r8, r5 + mov r4, r8 + cmp r4, 0 + bge _081A681A + mov r5, r9 + ldr r0, [r5] + ldr r7, =0x00000ca9 + adds r0, r7 + ldrb r4, [r0] + lsls r4, 30 + lsrs r4, 30 + ldr r6, =0x000040ce + adds r0, r6, 0 + bl VarGet + lsls r0, 24 + ldr r1, [r5] + lsls r4, 1 + lsrs r0, 22 + adds r4, r0 + ldr r5, =0x00000de2 + adds r1, r5 + adds r1, r4 + ldrh r0, [r1] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x24] + adds r0, r6, 0 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + movs r2, 0 + cmp r0, 0x1 + bne _081A6878 + movs r2, 0x1 +_081A6878: + ldr r1, =gUnknown_0203BC8C + ldr r0, =gBattleFrontierMons + str r0, [r1] + mov r1, r9 + ldr r0, [r1] + adds r0, r7 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _081A68B4 + movs r4, 0x1 + str r4, [sp, 0x28] + b _081A68B8 + .pool +_081A68B4: + movs r5, 0 + str r5, [sp, 0x28] +_081A68B8: + adds r0, r2, 0 + ldr r1, [sp, 0x28] + bl sub_81A6F70 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x2C] + movs r0, 0 + mov r10, r0 + mov r8, r0 + ldr r1, [sp, 0x3C] + str r1, [sp, 0x40] + mov r2, sp + str r2, [sp, 0x44] + lsls r4, r0, 1 + str r4, [sp, 0x30] + ldr r5, [sp, 0x38] + adds r5, r4 + str r5, [sp, 0x34] +_081A68DE: + ldr r0, [sp, 0x2C] + cmp r8, r0 + bge _081A68EC + ldr r0, [sp, 0x28] + ldr r1, [sp, 0x24] + movs r2, 0x1 + b _081A68F2 +_081A68EC: + ldr r0, [sp, 0x28] + ldr r1, [sp, 0x24] + movs r2, 0 +_081A68F2: + bl sub_81A6EF0 + lsls r0, 16 + lsrs r7, r0, 16 + ldr r0, =gUnknown_0203BC8C + ldr r1, [r0] + lsls r2, r7, 4 + adds r4, r2, r1 + ldrh r1, [r4] + mov r9, r2 + cmp r1, 0xC9 + beq _081A69E2 + movs r3, 0 + mov r2, r8 + adds r6, r3, r2 + cmp r3, r6 + bge _081A6950 + ldr r5, [sp, 0x34] + ldrh r0, [r5] + cmp r0, r7 + beq _081A6950 + mov r12, r4 + adds r2, r1, 0 + lsls r4, r3, 1 + ldr r1, [sp, 0x30] + add r1, sp + str r6, [sp, 0x48] +_081A6928: + ldrh r0, [r1] + cmp r0, r2 + bne _081A693A + mov r0, r10 + cmp r0, 0 + bne _081A6950 + mov r5, r12 + ldrh r5, [r5] + mov r10, r5 +_081A693A: + adds r4, 0x2 + adds r1, 0x2 + adds r3, 0x1 + ldr r0, [sp, 0x48] + cmp r3, r0 + bge _081A6950 + ldr r5, [sp, 0x38] + adds r0, r5, r4 + ldrh r0, [r0] + cmp r0, r7 + bne _081A6928 +_081A6950: + cmp r3, r6 + bne _081A69E2 + movs r3, 0 + cmp r3, r6 + bge _081A699C + ldr r0, =gBattleFrontierHeldItems + mov r12, r0 + ldr r1, [sp, 0x30] + ldr r2, [sp, 0x3C] + adds r5, r1, r2 +_081A6964: + ldrh r4, [r5] + cmp r4, 0 + beq _081A6994 + ldr r1, =gUnknown_0203BC8C + ldr r0, [r1] + mov r2, r9 + adds r1, r2, r0 + ldrb r0, [r1, 0xA] + lsls r0, 1 + add r0, r12 + ldrh r0, [r0] + cmp r4, r0 + bne _081A6994 + ldrh r0, [r1] + cmp r0, r10 + bne _081A699C + movs r4, 0 + mov r10, r4 + b _081A699C + .pool +_081A6994: + adds r5, 0x2 + adds r3, 0x1 + cmp r3, r6 + blt _081A6964 +_081A699C: + cmp r3, r6 + bne _081A69E2 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + mov r5, r8 + lsls r3, r5, 1 + adds r0, r3, r5 + lsls r0, 2 + adds r1, r0 + movs r0, 0xE7 + lsls r0, 4 + adds r1, r0 + strh r7, [r1] + ldr r2, =gUnknown_0203BC8C + ldr r1, [r2] + add r1, r9 + ldrh r0, [r1] + ldr r4, [sp, 0x44] + strh r0, [r4] + ldr r2, =gBattleFrontierHeldItems + ldrb r0, [r1, 0xA] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + ldr r5, [sp, 0x40] + strh r0, [r5] + ldr r0, [sp, 0x38] + adds r3, r0, r3 + strh r7, [r3] + adds r5, 0x2 + str r5, [sp, 0x40] + adds r4, 0x2 + str r4, [sp, 0x44] + movs r1, 0x1 + add r8, r1 +_081A69E2: + mov r2, r8 + cmp r2, 0x6 + beq _081A69EA + b _081A68DE +_081A69EA: + add sp, 0x4C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A67EC + + thumb_func_start sub_81A6A08 +sub_81A6A08: @ 81A6A08 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x18 + ldr r1, =gUnknown_0203BC8C + ldr r0, =gBattleFrontierMons + str r0, [r1] + movs r4, 0 + add r5, sp, 0x14 + ldr r7, =gScriptResult + movs r1, 0 +_081A6A1E: + mov r2, sp + adds r0, r2, r4 + strb r1, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x11 + bls _081A6A1E + movs r4, 0 + ldr r0, =gUnknown_03006298 + mov r8, r0 + ldr r0, =gUnknown_0203BC8C + ldr r6, [r0] + ldr r1, =gBaseStats + mov r12, r1 +_081A6A3C: + lsls r0, r4, 1 + add r0, r8 + ldrh r0, [r0] + lsls r0, 4 + adds r0, r6 + ldrh r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + mov r2, r12 + adds r3, r0, r2 + ldrb r2, [r3, 0x6] + mov r0, sp + adds r1, r0, r2 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldrb r1, [r3, 0x7] + cmp r2, r1 + beq _081A6A70 + ldrb r0, [r3, 0x7] + mov r2, sp + adds r1, r2, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_081A6A70: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _081A6A3C + movs r0, 0 + strb r0, [r5] + strb r0, [r5, 0x1] + movs r4, 0x1 + adds r3, r5, 0 +_081A6A84: + ldrb r0, [r3] + add r0, sp + mov r2, sp + adds r1, r2, r4 + ldrb r2, [r0] + ldrb r0, [r1] + cmp r2, r0 + bcs _081A6AAC + strb r4, [r5] + b _081A6AB2 + .pool +_081A6AAC: + cmp r2, r0 + bne _081A6AB2 + strb r4, [r3, 0x1] +_081A6AB2: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x11 + bls _081A6A84 + ldrb r1, [r5] + mov r4, sp + adds r0, r4, r1 + ldrb r2, [r0] + cmp r2, 0 + beq _081A6ADA + ldrb r3, [r5, 0x1] + adds r0, r4, r3 + ldrb r0, [r0] + cmp r2, r0 + bhi _081A6AD6 + cmp r1, r3 + bne _081A6ADA +_081A6AD6: + strh r1, [r7] + b _081A6ADE +_081A6ADA: + movs r0, 0x12 + strh r0, [r7] +_081A6ADE: + add sp, 0x18 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81A6A08 + + thumb_func_start sub_81A6AEC +sub_81A6AEC: @ 81A6AEC + push {r4-r7,lr} + sub sp, 0x8 + movs r7, 0 + ldr r1, =gUnknown_0203BC8C + ldr r0, =gBattleFrontierMons + str r0, [r1] + movs r4, 0 + movs r1, 0 +_081A6AFC: + mov r2, sp + adds r0, r2, r4 + strb r1, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _081A6AFC + movs r4, 0 +_081A6B0E: + ldr r1, =gUnknown_03006298 + lsls r0, r4, 1 + adds r0, r1 + ldrh r6, [r0] + movs r5, 0 +_081A6B18: + ldr r0, =gUnknown_0203BC8C + ldr r1, [r0] + lsls r0, r6, 4 + adds r0, r1 + lsls r1, r5, 1 + adds r0, 0x2 + adds r0, r1 + ldrh r0, [r0] + bl sub_81A6BA4 + lsls r0, 24 + lsrs r0, 24 + mov r2, sp + adds r1, r2, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _081A6B18 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _081A6B0E + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] + movs r4, 0x1 + adds r5, r1, 0 + ldr r3, =gBattleFactoryStyleRequiredMoveCounts + adds r2, r5, 0 +_081A6B5C: + mov r1, sp + adds r0, r1, r4 + subs r1, r4, 0x1 + adds r1, r3 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bcc _081A6B74 + strh r4, [r2] + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 +_081A6B74: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _081A6B5C + cmp r7, 0x2 + bls _081A6B86 + movs r0, 0x8 + strh r0, [r5] +_081A6B86: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A6AEC + + thumb_func_start sub_81A6BA4 +sub_81A6BA4: @ 81A6BA4 + push {r4-r6,lr} + lsls r0, 16 + lsrs r5, r0, 16 + movs r2, 0 + ldr r6, =gBattleFactoryStyleMoveListPointers +_081A6BAE: + movs r3, 0 + lsls r0, r2, 2 + adds r0, r6 + ldr r1, [r0] + ldrh r0, [r1] + adds r4, r2, 0x1 + cmp r0, 0 + beq _081A6BE4 + lsls r0, r4, 24 + lsrs r2, r0, 24 +_081A6BC2: + lsls r0, r3, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r5 + bne _081A6BD4 + adds r0, r2, 0 + b _081A6BEE + .pool +_081A6BD4: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + lsls r0, r3, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + bne _081A6BC2 +_081A6BE4: + lsls r0, r4, 24 + lsrs r2, r0, 24 + cmp r2, 0x6 + bls _081A6BAE + movs r0, 0 +_081A6BEE: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81A6BA4 + + thumb_func_start sub_81A6BF4 +sub_81A6BF4: @ 81A6BF4 + push {lr} + movs r2, 0 + ldr r1, =gUnknown_02037318 + ldr r3, =0xfffffea5 + adds r0, r3, 0 + ldrh r1, [r1, 0x12] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _081A6C0C + movs r2, 0x1 +_081A6C0C: + adds r0, r2, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A6BF4 + + thumb_func_start sub_81A6C1C +sub_81A6C1C: @ 81A6C1C + push {r4,lr} + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + beq _081A6C48 + ldr r1, =gUnknown_0203BC8C + ldr r0, =gBattleFrontierMons + b _081A6C4C + .pool +_081A6C48: + ldr r1, =gUnknown_0203BC8C + ldr r0, =gSlateportBattleTentMons +_081A6C4C: + str r0, [r1] + movs r4, 0 +_081A6C50: + movs r0, 0x64 + muls r0, r4 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gSaveBlock2Ptr + ldr r2, [r1] + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 2 + adds r2, r1 + movs r1, 0xE7 + lsls r1, 4 + adds r2, r1 + ldrh r2, [r2] + ldr r1, =gUnknown_0203BC8C + ldr r1, [r1] + lsls r2, 4 + adds r2, r1 + ldrb r2, [r2, 0xA] + lsls r2, 1 + ldr r1, =gBattleFrontierHeldItems + adds r2, r1 + movs r1, 0xC + bl SetMonData + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _081A6C50 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A6C1C + + thumb_func_start sub_81A6CA8 +sub_81A6CA8: @ 81A6CA8 + push {lr} + lsls r0, 24 + lsls r1, 24 + lsrs r1, 24 + negs r2, r1 + orrs r2, r1 + lsrs r2, 31 + lsrs r1, r0, 24 + cmp r1, 0x8 + bls _081A6CBE + movs r1, 0x7 +_081A6CBE: + ldr r0, =gUnknown_08612184 + lsls r1, 1 + adds r1, r2, r1 + adds r1, r0 + ldrb r0, [r1] + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A6CA8 + + thumb_func_start sub_81A6CD0 +sub_81A6CD0: @ 81A6CD0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x34 + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + str r0, [sp, 0x2C] + ldr r0, =0x000040ce + bl VarGet + lsls r0, 24 + ldr r1, [r4] + ldr r3, [sp, 0x2C] + lsls r2, r3, 1 + lsrs r0, 22 + adds r2, r0 + ldr r7, =0x00000de2 + adds r1, r7 + adds r1, r2 + ldrh r0, [r1] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 24 + lsrs r1, r0, 24 + str r1, [sp, 0x30] + movs r2, 0x80 + lsls r2, 18 + adds r0, r2 + lsrs r0, 24 + movs r1, 0 + bl sub_81A6CA8 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x24] + bl sub_8165C40 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x20] + movs r3, 0 + mov r9, r3 + ldr r1, [r4] + ldrb r4, [r1, 0xA] + ldrb r0, [r1, 0xB] + lsls r0, 8 + orrs r4, r0 + ldrb r0, [r1, 0xC] + lsls r0, 16 + orrs r4, r0 + ldrb r0, [r1, 0xD] + lsls r0, 24 + orrs r4, r0 + str r4, [sp, 0x28] +_081A6D4C: + ldr r0, [sp, 0x2C] + ldr r1, [sp, 0x30] + movs r2, 0 + bl sub_81A6EF0 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r7, =gUnknown_0203BC8C + ldr r1, [r7] + lsls r0, r5, 4 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0xC9 + bne _081A6D6A + b _081A6EB8 +_081A6D6A: + ldr r0, [sp, 0x20] + cmp r0, 0x32 + bne _081A6D78 + ldr r0, =0x00000351 + cmp r5, r0 + bls _081A6D78 + b _081A6EB8 +_081A6D78: + movs r2, 0 + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + movs r3, 0xE7 + lsls r3, 4 + adds r0, r3 + ldrh r0, [r0] + cmp r5, r0 + beq _081A6DA2 + adds r4, r1, 0 + movs r1, 0 +_081A6D8E: + adds r1, 0xC + adds r2, 0x1 + cmp r2, 0x5 + bgt _081A6DA2 + ldr r0, [r4] + adds r0, r1 + adds r0, r3 + ldrh r0, [r0] + cmp r5, r0 + bne _081A6D8E +_081A6DA2: + cmp r2, 0x6 + beq _081A6DA8 + b _081A6EB8 +_081A6DA8: + movs r4, 0 + cmp r4, r9 + bge _081A6DDC + add r2, sp, 0xC + ldr r7, =gUnknown_0203BC8C + ldr r0, [r7] + lsls r1, r5, 4 + adds r0, r1, r0 + ldrh r2, [r2] + adds r7, r1, 0 + ldrh r0, [r0] + cmp r2, r0 + beq _081A6DDC + ldr r6, =gUnknown_0203BC8C + adds r3, r7, 0 + add r2, sp, 0xC +_081A6DC8: + adds r2, 0x2 + adds r4, 0x1 + cmp r4, r9 + bge _081A6DDC + ldr r0, [r6] + adds r0, r3, r0 + ldrh r1, [r2] + ldrh r0, [r0] + cmp r1, r0 + bne _081A6DC8 +_081A6DDC: + cmp r4, r9 + bne _081A6EB8 + movs r4, 0 + cmp r4, r9 + bge _081A6E0C + ldr r7, =gBattleFrontierHeldItems + ldr r6, =gUnknown_0203BC8C + add r2, sp, 0x14 + lsls r3, r5, 4 +_081A6DEE: + ldrh r1, [r2] + cmp r1, 0 + beq _081A6E04 + ldr r0, [r6] + adds r0, r3, r0 + ldrb r0, [r0, 0xA] + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + cmp r1, r0 + beq _081A6E0C +_081A6E04: + adds r2, 0x2 + adds r4, 0x1 + cmp r4, r9 + blt _081A6DEE +_081A6E0C: + cmp r4, r9 + bne _081A6EB8 + mov r0, r9 + lsls r2, r0, 1 + mov r1, sp + adds r1, r2 + adds r1, 0xC + ldr r3, =gUnknown_0203BC8C + ldr r4, [r3] + lsls r5, 4 + mov r8, r5 + add r4, r8 + ldrh r0, [r4] + strh r0, [r1] + add r1, sp, 0x14 + adds r1, r2 + ldr r2, =gBattleFrontierHeldItems + ldrb r0, [r4, 0xA] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + movs r0, 0x64 + mov r5, r9 + muls r5, r0 + ldr r6, =gEnemyParty + adds r0, r5, r6 + ldrh r1, [r4] + ldr r7, [sp, 0x20] + lsls r2, r7, 24 + ldrb r3, [r4, 0xC] + ldr r7, [sp, 0x24] + str r7, [sp] + ldrb r4, [r4, 0xB] + str r4, [sp, 0x4] + ldr r4, [sp, 0x28] + str r4, [sp, 0x8] + lsrs r2, 24 + bl sub_8068634 + add r0, sp, 0x1C + movs r7, 0 + strb r7, [r0] + movs r4, 0 + mov r7, r8 + mov r10, r0 + movs r0, 0x1 + add r0, r9 + mov r8, r0 +_081A6E6E: + ldr r1, =gUnknown_0203BC8C + ldr r0, [r1] + adds r0, r7, r0 + lsls r1, r4, 1 + adds r0, 0x2 + adds r0, r1 + ldrh r1, [r0] + lsls r2, r4, 24 + lsrs r2, 24 + adds r0, r5, r6 + bl sub_81A7024 + adds r4, 0x1 + cmp r4, 0x3 + ble _081A6E6E + movs r0, 0x64 + mov r4, r9 + muls r4, r0 + ldr r0, =gEnemyParty + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x20 + mov r2, r10 + bl SetMonData + ldr r2, =gUnknown_0203BC8C + ldr r0, [r2] + adds r0, r7, r0 + ldrb r2, [r0, 0xA] + lsls r2, 1 + ldr r0, =gBattleFrontierHeldItems + adds r2, r0 + adds r0, r4, 0 + movs r1, 0xC + bl SetMonData + mov r9, r8 +_081A6EB8: + mov r3, r9 + cmp r3, 0x3 + beq _081A6EC0 + b _081A6D4C +_081A6EC0: + add sp, 0x34 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A6CD0 + + thumb_func_start sub_81A6EF0 +sub_81A6EF0: @ 81A6EF0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r3, r1, 24 + lsls r2, 24 + lsrs r2, 24 + movs r4, 0x8 + negs r1, r0 + orrs r1, r0 + asrs r1, 31 + ands r1, r4 + adds r4, r1, 0 + cmp r3, 0x6 + bhi _081A6F2C + cmp r2, 0 + beq _081A6F20 + ldr r2, =gUnknown_08612194 + adds r1, r3 + adds r1, 0x1 + b _081A6F38 + .pool +_081A6F20: + ldr r2, =gUnknown_08612194 + adds r1, r3 + b _081A6F38 + .pool +_081A6F2C: + adds r1, r3, 0 + cmp r1, 0x7 + beq _081A6F34 + movs r1, 0x7 +_081A6F34: + ldr r2, =gUnknown_08612194 + adds r1, r4, r1 +_081A6F38: + lsls r1, 2 + adds r0, r2, 0x2 + adds r0, r1, r0 + adds r1, r2 + ldrh r0, [r0] + ldrh r4, [r1] + subs r0, r4 + adds r0, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + bl Random + lsls r0, 16 + lsrs r0, 16 + adds r1, r5, 0 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + adds r4, r0, r4 + lsls r4, 16 + lsrs r0, r4, 16 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A6EF0 + + thumb_func_start sub_81A6F70 +sub_81A6F70: @ 81A6F70 + push {lr} + lsls r0, 24 + lsls r1, 24 + ldr r2, =gSaveBlock2Ptr + ldr r2, [r2] + lsrs r1, 23 + lsrs r0, 22 + adds r1, r0 + ldr r0, =0x00000df2 + adds r2, r0 + adds r2, r1 + ldrb r1, [r2] + movs r0, 0 + cmp r1, 0xE + bls _081A6FA8 + movs r0, 0x1 + cmp r1, 0x15 + bls _081A6FA8 + movs r0, 0x2 + cmp r1, 0x1C + bls _081A6FA8 + movs r0, 0x3 + cmp r1, 0x23 + bls _081A6FA8 + movs r0, 0x5 + cmp r1, 0x2A + bhi _081A6FA8 + movs r0, 0x4 +_081A6FA8: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A6F70 + + thumb_func_start sub_81A6FB4 +sub_81A6FB4: @ 81A6FB4 + push {r4,r5,lr} + ldr r5, =gSaveBlock2Ptr + ldr r0, [r5] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r4, r0, 30 + cmp r4, 0x2 + beq _081A6FF8 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + ldr r1, [r5] + lsls r2, r4, 1 + lsrs r0, 14 + adds r2, r0 + ldr r0, =0x00000de2 + adds r1, r0 + adds r1, r2 + ldrh r0, [r1] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, =gUnknown_02038BCA + ldrh r1, [r0] + ldr r0, =0x000003fe + cmp r1, r0 + beq _081A7018 + cmp r2, 0x1 + bgt _081A7014 +_081A6FF8: + movs r0, 0 + b _081A701E + .pool +_081A7014: + cmp r2, 0x3 + ble _081A701C +_081A7018: + movs r0, 0x7 + b _081A701E +_081A701C: + movs r0, 0x1 +_081A701E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81A6FB4 + + thumb_func_start sub_81A7024 +sub_81A7024: @ 81A7024 + push {lr} + lsls r1, 16 + lsls r2, 24 + lsrs r2, 24 + lsrs r1, 16 + cmp r1, 0xD8 + bne _081A7034 + movs r1, 0xDA +_081A7034: + bl sub_80691F4 + pop {r0} + bx r0 + thumb_func_end sub_81A7024 + + thumb_func_start sub_81A703C +sub_81A703C: @ 81A703C + push {lr} + ldr r1, =gUnknown_086125F8 + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A703C + + thumb_func_start sub_81A705C +sub_81A705C: @ 81A705C + push {lr} + bl sub_81A79EC + ldr r1, =gUnknown_0300128C + strb r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A705C + + thumb_func_start sub_81A7070 +sub_81A7070: @ 81A7070 + push {r4-r7,lr} + ldr r0, =0x00004010 + movs r1, 0x1C + bl VarSet + ldr r0, =0x00004011 + movs r1, 0xE2 + bl VarSet + movs r4, 0x1 + movs r6, 0 + movs r5, 0 + movs r7, 0 + ldr r0, =gUnknown_0300128C + ldrb r0, [r0] + cmp r0, 0x8 + bhi _081A7132 + lsls r0, 2 + ldr r1, =_081A70AC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A70AC: + .4byte _081A70D0 + .4byte _081A70DA + .4byte _081A70DE + .4byte _081A70E8 + .4byte _081A70FC + .4byte _081A70D6 + .4byte _081A7100 + .4byte _081A7108 + .4byte _081A710E +_081A70D0: + movs r0, 0 + bl sub_81A82A4 +_081A70D6: + movs r4, 0 + b _081A711A +_081A70DA: + movs r5, 0x1C + b _081A711A +_081A70DE: + bl sub_81A7B58 + lsls r0, 24 + lsrs r5, r0, 24 + b _081A711A +_081A70E8: + movs r5, 0x30 + ldr r0, =gUnknown_0300128D + ldrb r0, [r0] + movs r7, 0xE1 + cmp r0, 0x1 + bne _081A7118 + movs r7, 0xE2 + b _081A7118 + .pool +_081A70FC: + movs r5, 0x30 + b _081A711A +_081A7100: + movs r0, 0x1 + bl sub_81A82A4 + b _081A7114 +_081A7108: + bl sub_81A8374 + b _081A70D6 +_081A710E: + movs r0, 0x5 + bl sub_81A5030 +_081A7114: + movs r7, 0x1C + movs r4, 0 +_081A7118: + movs r6, 0x1 +_081A711A: + cmp r4, 0x1 + bne _081A7126 + ldr r0, =0x00004010 + adds r1, r5, 0 + bl VarSet +_081A7126: + cmp r6, 0x1 + bne _081A7132 + ldr r0, =0x00004011 + adds r1, r7, 0 + bl VarSet +_081A7132: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A7070 + + thumb_func_start sub_81A7140 +sub_81A7140: @ 81A7140 + push {lr} + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r2, =0x00000ca9 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r2, r0, 30 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + adds r3, r1, 0 + cmp r0, 0x4 + bhi _081A723A + lsls r0, 2 + ldr r1, =_081A7174 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A7174: + .4byte _081A7188 + .4byte _081A71A0 + .4byte _081A71C4 + .4byte _081A71E8 + .4byte _081A720C +_081A7188: + ldr r0, =gScriptResult + ldr r1, [r3] + ldr r3, =0x00000e02 + adds r1, r3 + ldrh r1, [r1] + strh r1, [r0] + b _081A723A + .pool +_081A71A0: + ldr r2, =gScriptResult + ldr r1, [r3] + ldr r3, =0x00000ca9 + adds r0, r1, r3 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 29 + ldr r3, =0x00000e04 + adds r1, r3 + adds r1, r0 + ldrh r0, [r1] + b _081A7238 + .pool +_081A71C4: + ldr r2, =gScriptResult + ldr r1, [r3] + ldr r3, =0x00000ca9 + adds r0, r1, r3 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 29 + ldr r3, =0x00000e08 + adds r1, r3 + adds r1, r0 + ldrh r0, [r1] + b _081A7238 + .pool +_081A71E8: + ldr r2, =gScriptResult + ldr r1, [r3] + ldr r3, =0x00000ca9 + adds r0, r1, r3 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 29 + ldr r3, =0x00000e0c + adds r1, r3 + adds r1, r0 + ldrh r0, [r1] + b _081A7238 + .pool +_081A720C: + cmp r2, 0 + beq _081A7228 + ldr r2, =gScriptResult + ldr r0, [r3] + ldr r1, =0x00000cdc + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 4 + b _081A7236 + .pool +_081A7228: + ldr r2, =gScriptResult + ldr r0, [r3] + ldr r3, =0x00000cdc + adds r0, r3 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 3 +_081A7236: + ands r0, r1 +_081A7238: + strh r0, [r2] +_081A723A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A7140 + + thumb_func_start sub_81A7248 +sub_81A7248: @ 81A7248 + push {r4,r5,lr} + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r2, =0x00000ca9 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r3, r0, 30 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + adds r2, r1, 0 + cmp r0, 0x4 + bls _081A7264 + b _081A73AA +_081A7264: + lsls r0, 2 + ldr r1, =_081A7280 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A7280: + .4byte _081A7294 + .4byte _081A72AC + .4byte _081A72D8 + .4byte _081A7314 + .4byte _081A7344 +_081A7294: + ldr r0, [r2] + ldr r1, =gSpecialVar_0x8006 + ldrh r1, [r1] + ldr r5, =0x00000e02 + adds r0, r5 + strh r1, [r0] + b _081A73AA + .pool +_081A72AC: + ldr r0, =gSpecialVar_0x8006 + ldrh r3, [r0] + ldr r0, =0x0000270f + cmp r3, r0 + bls _081A72B8 + b _081A73AA +_081A72B8: + ldr r0, [r2] + ldr r2, =0x00000ca9 + adds r1, r0, r2 + ldrb r1, [r1] + lsls r1, 30 + lsrs r1, 29 + ldr r5, =0x00000e04 + b _081A732C + .pool +_081A72D8: + ldr r0, =gSpecialVar_0x8006 + ldrh r4, [r0] + adds r3, r4, 0 + ldr r0, =0x0000270f + cmp r3, r0 + bhi _081A73AA + ldr r1, [r2] + ldr r2, =0x00000ca9 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r2, r0, 30 + lsrs r0, r2, 29 + ldr r5, =0x00000e08 + adds r1, r5 + adds r0, r1, r0 + ldrh r0, [r0] + cmp r0, r3 + bcs _081A73AA + lsrs r0, r2, 29 + adds r0, r1, r0 + strh r4, [r0] + b _081A73AA + .pool +_081A7314: + ldr r0, =gSpecialVar_0x8006 + ldrh r3, [r0] + ldr r0, =0x0000270f + cmp r3, r0 + bhi _081A73AA + ldr r0, [r2] + ldr r2, =0x00000ca9 + adds r1, r0, r2 + ldrb r1, [r1] + lsls r1, 30 + lsrs r1, 29 + ldr r5, =0x00000e0c +_081A732C: + adds r0, r5 + adds r0, r1 + strh r3, [r0] + b _081A73AA + .pool +_081A7344: + cmp r3, 0 + beq _081A737C + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + cmp r0, 0 + beq _081A7368 + ldr r0, [r2] + ldr r1, =0x00000cdc + adds r0, r1 + ldr r1, [r0] + movs r2, 0x80 + lsls r2, 4 + orrs r1, r2 + b _081A73A8 + .pool +_081A7368: + ldr r0, [r2] + ldr r2, =0x00000cdc + adds r0, r2 + ldr r1, [r0] + ldr r2, =0xfffff7ff + b _081A73A6 + .pool +_081A737C: + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + cmp r0, 0 + beq _081A739C + ldr r0, [r2] + ldr r5, =0x00000cdc + adds r0, r5 + ldr r1, [r0] + movs r2, 0x80 + lsls r2, 3 + orrs r1, r2 + b _081A73A8 + .pool +_081A739C: + ldr r0, [r2] + ldr r1, =0x00000cdc + adds r0, r1 + ldr r1, [r0] + ldr r2, =0xfffffbff +_081A73A6: + ands r1, r2 +_081A73A8: + str r1, [r0] +_081A73AA: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A7248 + + thumb_func_start sub_81A73B8 +sub_81A73B8: @ 81A73B8 + push {lr} + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0xE + bls _081A73DC + ldr r1, =gScriptResult + movs r0, 0x1 + b _081A73E0 + .pool +_081A73DC: + ldr r1, =gScriptResult + movs r0, 0 +_081A73E0: + strh r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A73B8 + + thumb_func_start sub_81A73EC +sub_81A73EC: @ 81A73EC + ldr r0, =gScriptResult + ldr r1, =gUnknown_0300128C + ldrb r1, [r1] + strh r1, [r0] + bx lr + .pool + thumb_func_end sub_81A73EC + + thumb_func_start sub_81A7400 +sub_81A7400: @ 81A7400 + ldr r1, =gUnknown_0300128E + movs r0, 0x1 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_81A7400 + + thumb_func_start sub_81A740C +sub_81A740C: @ 81A740C + ldr r1, =gUnknown_0300128E + movs r0, 0 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_81A740C + + thumb_func_start sub_81A7418 +sub_81A7418: @ 81A7418 + push {r4,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =gSpecialVar_0x8005 + ldrh r1, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + strb r1, [r0] + movs r0, 0x80 + lsls r0, 7 + movs r1, 0 + bl VarSet + ldr r1, [r4] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl save_serialize_map + movs r0, 0x1 + bl TrySavingData + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A7418 + + thumb_func_start nullsub_76 +nullsub_76: @ 81A7460 + bx lr + thumb_func_end nullsub_76 + + thumb_func_start nullsub_124 +nullsub_124: @ 81A7464 + bx lr + thumb_func_end nullsub_124 + + thumb_func_start sub_81A7468 +sub_81A7468: @ 81A7468 + push {lr} + ldr r0, =gUnknown_03001290 + ldr r0, [r0] + cmp r0, 0x20 + beq _081A748E + cmp r0, 0x20 + bhi _081A7484 + cmp r0, 0x7 + beq _081A74BC + cmp r0, 0x10 + beq _081A7498 + b _081A74C2 + .pool +_081A7484: + cmp r0, 0x40 + beq _081A74B0 + cmp r0, 0x80 + beq _081A74A4 + b _081A74C2 +_081A748E: + ldr r1, =gScriptResult + movs r0, 0 + b _081A74C0 + .pool +_081A7498: + ldr r1, =gScriptResult + movs r0, 0x1 + b _081A74C0 + .pool +_081A74A4: + ldr r1, =gScriptResult + movs r0, 0x2 + b _081A74C0 + .pool +_081A74B0: + ldr r1, =gScriptResult + movs r0, 0x3 + b _081A74C0 + .pool +_081A74BC: + ldr r1, =gScriptResult + movs r0, 0x4 +_081A74C0: + strh r0, [r1] +_081A74C2: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A7468 + + thumb_func_start sub_81A74CC +sub_81A74CC: @ 81A74CC + ldr r0, =gScriptResult + ldr r1, =gUnknown_0300128D + ldrb r1, [r1] + strh r1, [r0] + bx lr + .pool + thumb_func_end sub_81A74CC + + thumb_func_start sub_81A74E0 +sub_81A74E0: @ 81A74E0 + push {r4,lr} + bl Random + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + movs r0, 0x1 + ands r4, r0 + adds r4, 0x1 + adds r0, r4, 0 + bl sub_81A7F38 + ldr r0, =gScriptResult + strh r4, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A74E0 + + thumb_func_start sub_81A7508 +sub_81A7508: @ 81A7508 + push {lr} + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0x4 + bhi _081A7538 + ldr r1, =gUnknown_0861231C + ldr r0, =gUnknown_03001294 + ldrb r0, [r0] + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0x2] + b _081A7560 + .pool +_081A7538: + cmp r0, 0xA + bhi _081A7554 + ldr r1, =gUnknown_0861231C + ldr r0, =gUnknown_03001294 + ldrb r0, [r0] + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0x3] + b _081A7560 + .pool +_081A7554: + ldr r1, =gUnknown_0861231C + ldr r0, =gUnknown_03001294 + ldrb r0, [r0] + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0x4] +_081A7560: + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_086123E4 + adds r0, r1 + bl ConvertBattleFrontierTrainerSpeechToString + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A7508 + + thumb_func_start sub_81A7580 +sub_81A7580: @ 81A7580 + push {lr} + ldr r0, =sub_81A7EE4 + movs r1, 0x2 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A7580 + + thumb_func_start sub_81A7594 +sub_81A7594: @ 81A7594 + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + movs r4, 0 + movs r1, 0 +_081A759E: + mov r2, sp + adds r0, r2, r4 + strb r1, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _081A759E + adds r0, r5, 0 + movs r1, 0x3A + bl GetMonData + lsls r2, r0, 16 + mov r1, sp + strb r0, [r1] + mov r0, sp + lsrs r2, 24 + strb r2, [r0, 0x1] + adds r0, r5, 0 + movs r1, 0x39 + mov r2, sp + bl SetMonData + adds r0, r5, 0 + movs r1, 0x15 + bl GetMonData + lsls r0, 24 + lsrs r6, r0, 24 + movs r4, 0 +_081A75DA: + adds r1, r4, 0 + adds r1, 0xD + adds r0, r5, 0 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + adds r2, r4, 0 + bl CalcPPWithPPUps + mov r1, sp + strb r0, [r1] + adds r1, r4, 0 + adds r1, 0x11 + adds r0, r5, 0 + mov r2, sp + bl SetMonData + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _081A75DA + mov r0, sp + movs r1, 0 + strb r1, [r0] + strb r1, [r0, 0x1] + strb r1, [r0, 0x2] + strb r1, [r0, 0x3] + adds r0, r5, 0 + movs r1, 0x37 + mov r2, sp + bl SetMonData + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81A7594 + + thumb_func_start sub_81A7628 +sub_81A7628: @ 81A7628 + push {r4,lr} + adds r4, r1, 0 + bl GetMonAbility + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + cmp r4, 0x20 + beq _081A7652 + cmp r4, 0x20 + bhi _081A7648 + cmp r4, 0x7 + beq _081A7664 + cmp r4, 0x10 + beq _081A7658 + b _081A7674 +_081A7648: + cmp r4, 0x40 + beq _081A765E + cmp r4, 0x80 + beq _081A766E + b _081A7674 +_081A7652: + cmp r0, 0x28 + bne _081A7674 + b _081A7672 +_081A7658: + cmp r0, 0x29 + bne _081A7674 + b _081A7672 +_081A765E: + cmp r0, 0x7 + bne _081A7674 + b _081A7672 +_081A7664: + cmp r0, 0xF + beq _081A7672 + cmp r0, 0x48 + bne _081A7674 + b _081A7672 +_081A766E: + cmp r0, 0x11 + bne _081A7674 +_081A7672: + movs r1, 0x1 +_081A7674: + adds r0, r1, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81A7628 + + thumb_func_start sub_81A767C +sub_81A767C: @ 81A767C + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + movs r3, 0 + cmp r1, 0x20 + beq _081A76C4 + cmp r1, 0x20 + bhi _081A7696 + cmp r1, 0x7 + beq _081A771C + cmp r1, 0x10 + beq _081A7704 + b _081A771C +_081A7696: + cmp r1, 0x40 + beq _081A76E0 + cmp r1, 0x80 + bne _081A771C + ldr r1, =gBaseStats + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r2, [r0, 0x6] + cmp r2, 0x8 + beq _081A771A + cmp r2, 0x3 + beq _081A771A + ldrb r0, [r0, 0x7] + cmp r0, 0x8 + beq _081A771A + cmp r0, 0x3 + bne _081A771C + b _081A771A + .pool +_081A76C4: + ldr r0, =gBaseStats + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x6] + cmp r0, 0xF + beq _081A771A + ldrb r0, [r1, 0x7] + cmp r0, 0xF + bne _081A771C + b _081A771A + .pool +_081A76E0: + ldr r1, =gBaseStats + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r2, [r0, 0x6] + cmp r2, 0x4 + beq _081A771A + cmp r2, 0xD + beq _081A771A + ldrb r0, [r0, 0x7] + cmp r0, 0x4 + beq _081A771A + cmp r0, 0xD + bne _081A771C + b _081A771A + .pool +_081A7704: + ldr r0, =gBaseStats + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x6] + cmp r0, 0xA + beq _081A771A + ldrb r0, [r1, 0x7] + cmp r0, 0xA + bne _081A771C +_081A771A: + movs r3, 0x1 +_081A771C: + adds r0, r3, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A767C + + thumb_func_start sub_81A7728 +sub_81A7728: @ 81A7728 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + movs r6, 0 +_081A7736: + mov r1, sp + adds r0, r1, r6 + strb r6, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x2 + bls _081A7736 + movs r4, 0 + mov r8, r4 +_081A774A: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r6, r0, 24 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + adds r2, r1, r6 + ldrb r3, [r2] + adds r1, r0 + ldrb r0, [r1] + strb r0, [r2] + strb r3, [r1] + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x9 + bls _081A774A + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r4, =0x00000cb2 + adds r0, r4 + ldrh r0, [r0] + movs r1, 0x1 + mov r10, r1 + cmp r0, 0x4 + bls _081A77A8 + movs r4, 0x3 + mov r10, r4 + cmp r0, 0x9 + bhi _081A77A8 + movs r0, 0x2 + mov r10, r0 +_081A77A8: + movs r1, 0 + str r1, [sp, 0x4] + ldr r7, =gUnknown_03001290 +_081A77AE: + movs r4, 0 + mov r9, r4 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x22 + bhi _081A77DC + movs r0, 0x80 + b _081A77FC + .pool +_081A77DC: + cmp r0, 0x3B + bhi _081A77E4 + movs r0, 0x20 + b _081A77FC +_081A77E4: + cmp r0, 0x4F + bhi _081A77EC + movs r0, 0x40 + b _081A77FC +_081A77EC: + cmp r1, 0x59 + bhi _081A77FA + movs r0, 0x7 + b _081A77FC +_081A77F4: + movs r0, 0x1 + mov r9, r0 + b _081A786E +_081A77FA: + movs r0, 0x10 +_081A77FC: + str r0, [r7] + ldr r0, =gUnknown_03001290 + ldr r0, [r0] + ldr r1, [sp, 0x4] + cmp r1, r0 + beq _081A7874 + str r0, [sp, 0x4] + movs r4, 0 + mov r8, r4 + movs r6, 0 +_081A7810: + mov r1, sp + adds r0, r1, r6 + ldrb r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0x37 + bl GetMonData + bl pokemon_ailments_get_primary + lsls r0, 24 + cmp r0, 0 + bne _081A7860 + adds r0, r5, 0 + movs r1, 0x39 + bl GetMonData + cmp r0, 0 + beq _081A7860 + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + adds r0, r5, 0 + movs r1, 0xB + bl GetMonData + lsls r0, 16 + lsrs r4, r0, 16 + ldr r1, [r7] + adds r0, r4, 0 + bl sub_81A767C + lsls r0, 24 + cmp r0, 0 + beq _081A77F4 +_081A7860: + cmp r8, r10 + beq _081A786E + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x2 + bls _081A7810 +_081A786E: + mov r4, r8 + cmp r4, 0 + beq _081A78CC +_081A7874: + mov r0, r9 + cmp r0, 0 + beq _081A77AE + ldr r0, =gUnknown_03001290 + ldr r0, [r0] + cmp r0, 0x20 + beq _081A7898 + cmp r0, 0x20 + bhi _081A78D0 + cmp r0, 0x7 + beq _081A78D0 + cmp r0, 0x10 + beq _081A78A4 + b _081A78D0 + .pool +_081A7898: + ldr r1, =gUnknown_0300128D + movs r0, 0x1 + b _081A78D4 + .pool +_081A78A4: + bl Random + lsls r0, 16 + lsrs r1, r0, 16 + movs r2, 0x1 + ands r1, r2 + cmp r1, 0 + beq _081A78C0 + ldr r0, =gUnknown_0300128D + strb r2, [r0] + b _081A78D6 + .pool +_081A78C0: + ldr r0, =gUnknown_0300128D + strb r1, [r0] + b _081A78D6 + .pool +_081A78CC: + movs r0, 0 + b _081A7956 +_081A78D0: + ldr r1, =gUnknown_0300128D + movs r0, 0 +_081A78D4: + strb r0, [r1] +_081A78D6: + movs r1, 0 + mov r8, r1 + movs r6, 0 +_081A78DC: + mov r4, sp + adds r0, r4, r6 + ldrb r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0x37 + bl GetMonData + bl pokemon_ailments_get_primary + lsls r0, 24 + cmp r0, 0 + bne _081A7946 + adds r0, r5, 0 + movs r1, 0x39 + bl GetMonData + cmp r0, 0 + beq _081A7946 + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + adds r0, r5, 0 + movs r1, 0xB + bl GetMonData + lsls r0, 16 + lsrs r4, r0, 16 + ldr r7, =gUnknown_03001290 + ldr r1, [r7] + adds r0, r5, 0 + bl sub_81A7628 + lsls r0, 24 + cmp r0, 0 + bne _081A7946 + ldr r1, [r7] + adds r0, r4, 0 + bl sub_81A767C + lsls r0, 24 + cmp r0, 0 + bne _081A7946 + adds r0, r5, 0 + movs r1, 0x37 + adds r2, r7, 0 + bl SetMonData +_081A7946: + cmp r8, r10 + beq _081A7954 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x2 + bls _081A78DC +_081A7954: + movs r0, 0x1 +_081A7956: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A7728 + + thumb_func_start sub_81A7974 +sub_81A7974: @ 81A7974 + push {r4-r7,lr} + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r0, [r0] + movs r7, 0x1 + cmp r0, 0x4 + bls _081A798E + movs r7, 0x3 + cmp r0, 0x9 + bhi _081A798E + movs r7, 0x2 +_081A798E: + movs r6, 0 + movs r5, 0 + b _081A79A2 + .pool +_081A799C: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_081A79A2: + cmp r5, 0x2 + bhi _081A79D8 + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =gPlayerParty + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x37 + bl GetMonData + bl pokemon_ailments_get_primary + lsls r0, 24 + cmp r0, 0 + bne _081A79D4 + adds r0, r4, 0 + movs r1, 0x39 + bl GetMonData + cmp r0, 0 + beq _081A79D4 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_081A79D4: + cmp r6, r7 + bne _081A799C +_081A79D8: + cmp r6, 0 + beq _081A79E4 + movs r0, 0x1 + b _081A79E6 + .pool +_081A79E4: + movs r0, 0 +_081A79E6: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81A7974 + + thumb_func_start sub_81A79EC +sub_81A79EC: @ 81A79EC + push {r4-r6,lr} + sub sp, 0x8 + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + movs r4, 0xE1 + lsls r4, 4 + adds r0, r4 + ldrb r2, [r0] + movs r3, 0x78 + ands r3, r2 + adds r5, r1, 0 + cmp r3, 0x40 + bne _081A7A10 + lsls r0, r2, 25 + lsrs r0, 28 + b _081A7B48 + .pool +_081A7A10: + ldr r0, =gSpecialVar_0x8007 + lsls r1, r2, 29 + ldrh r0, [r0] + lsrs r1, 29 + cmp r0, r1 + bne _081A7A34 + cmp r3, 0x18 + bne _081A7A24 + bl sub_81A7728 +_081A7A24: + ldr r0, [r5] + adds r0, r4 + ldrb r0, [r0] + lsls r0, 25 + lsrs r0, 28 + b _081A7B48 + .pool +_081A7A34: + movs r2, 0 + ldr r3, =gUnknown_0861266C + movs r1, 0 +_081A7A3A: + mov r4, sp + adds r0, r4, r2 + strb r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x7 + bls _081A7A3A + movs r4, 0x8 + ldr r0, [r5] + movs r6, 0xE1 + lsls r6, 4 + adds r0, r6 + ldrb r0, [r0] + lsls r0, 25 + lsrs r0, 28 + adds r0, r3 + ldrb r1, [r0] + movs r2, 0 + adds r5, r3, 0 + movs r3, 0x1 +_081A7A64: + adds r0, r2, r5 + ldrb r0, [r0] + cmp r0, r1 + bne _081A7A78 + mov r6, sp + adds r0, r6, r2 + strb r3, [r0] + subs r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081A7A78: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x7 + bls _081A7A64 + mov r0, sp + ldrb r0, [r0, 0x7] + cmp r0, 0x1 + beq _081A7AA0 + bl sub_81A8554 + lsls r0, 24 + cmp r0, 0 + bne _081A7AA0 + mov r1, sp + movs r0, 0x1 + strb r0, [r1, 0x7] + subs r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081A7AA0: + mov r0, sp + ldrb r0, [r0, 0x3] + cmp r0, 0x1 + beq _081A7ABE + bl sub_81A7974 + lsls r0, 24 + cmp r0, 0 + bne _081A7ABE + mov r1, sp + movs r0, 0x1 + strb r0, [r1, 0x3] + subs r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081A7ABE: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + movs r1, 0xE1 + lsls r1, 4 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081A7AFA + mov r0, sp + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + beq _081A7AE6 + mov r1, sp + movs r0, 0x1 + strb r0, [r1, 0x1] + subs r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081A7AE6: + mov r0, sp + ldrb r0, [r0, 0x4] + cmp r0, 0x1 + beq _081A7AFA + mov r1, sp + movs r0, 0x1 + strb r0, [r1, 0x4] + subs r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081A7AFA: + adds r0, r4, 0 + bl AllocZeroed + adds r5, r0, 0 + movs r3, 0 + movs r2, 0 +_081A7B06: + mov r6, sp + adds r0, r6, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _081A7B1C + adds r1, r3, 0 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + adds r1, r5, r1 + strb r2, [r1] +_081A7B1C: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x7 + bls _081A7B06 + bl Random + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl __modsi3 + adds r0, r5, r0 + ldrb r4, [r0] + adds r0, r5, 0 + bl Free + cmp r4, 0x3 + bne _081A7B46 + bl sub_81A7728 +_081A7B46: + adds r0, r4, 0 +_081A7B48: + add sp, 0x8 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A79EC + + thumb_func_start sub_81A7B58 +sub_81A7B58: @ 81A7B58 + push {r4,lr} + ldr r4, =gUnknown_03001294 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x19 + bl __umodsi3 + strb r0, [r4] + ldr r1, =gUnknown_0861231C + ldrb r0, [r4] + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A7B58 + + thumb_func_start sub_81A7B84 +sub_81A7B84: @ 81A7B84 + ldr r0, =gUnknown_0300128E + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_81A7B84 + + thumb_func_start sub_81A7B90 +sub_81A7B90: @ 81A7B90 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + bl sub_81A7D00 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r7, =gSaveBlock2Ptr + ldr r0, [r7] + ldr r4, =0x00000ca9 + adds r0, r4 + ldrb r0, [r0] + lsls r0, 30 + ldr r1, =gUnknown_08612314 + lsrs r0, 28 + adds r0, r1 + ldr r0, [r0] + str r0, [sp, 0x4] + ldr r0, =gEnemyParty + movs r1, 0xB + movs r2, 0 + bl GetMonData + adds r5, r0, 0 + lsls r0, r5, 16 + lsrs r0, 16 + bl sub_81A890C + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, [r7] + adds r0, r4 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _081A7C1C + bl sub_8165CB4 + adds r7, r0, 0 + cmp r7, 0x3B + ble _081A7C08 + lsls r0, r6, 2 + ldr r1, [sp, 0x4] + adds r0, r1 + ldr r1, [r0] + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x2] + subs r7, r0 + cmp r7, 0x3B + bgt _081A7C32 +_081A7C08: + movs r7, 0x3C + b _081A7C32 + .pool +_081A7C1C: + lsls r0, r6, 2 + ldr r2, [sp, 0x4] + adds r0, r2 + ldr r1, [r0] + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x2] + movs r0, 0x32 + subs r7, r0, r1 +_081A7C32: + mov r0, r8 + cmp r0, 0x1 + bne _081A7C4A + lsls r0, r7, 24 + lsrs r0, 24 + bl sub_81A88B0 + lsls r0, 24 + cmp r0, 0 + bne _081A7C4A + movs r0, 0 + b _081A7CE2 +_081A7C4A: + ldr r0, =gEnemyParty + ldr r1, =gBaseStats + mov r8, r1 + lsls r6, 2 + mov r9, r6 + ldr r2, [sp, 0x4] + add r2, r9 + mov r10, r2 + ldr r1, [r2] + lsls r6, r5, 1 + adds r4, r6, r5 + lsls r4, 2 + adds r1, r4, r1 + ldrh r2, [r1] + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + add r1, r8 + ldrb r2, [r1, 0x13] + movs r1, 0xCA + lsls r1, 1 + muls r2, r1 + lsls r1, r7, 2 + ldr r3, =gExperienceTables + adds r1, r3 + adds r2, r1 + movs r1, 0x19 + bl SetMonData + mov r1, r10 + ldr r0, [r1] + adds r4, r0 + ldrh r1, [r4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r8 + ldrb r0, [r0, 0x17] + mov r7, r9 + cmp r0, 0 + beq _081A7CA8 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 +_081A7CA8: + str r0, [sp] + ldr r0, =gEnemyParty + movs r1, 0x2E + mov r2, sp + bl SetMonData + movs r4, 0 + adds r0, r6, r5 + lsls r6, r0, 2 +_081A7CBA: + ldr r2, [sp, 0x4] + adds r0, r7, r2 + ldr r0, [r0] + adds r0, r6, r0 + lsls r1, r4, 1 + adds r0, 0x4 + adds r0, r1 + ldrh r1, [r0] + lsls r2, r4, 24 + lsrs r2, 24 + ldr r0, =gEnemyParty + bl sub_80691F4 + adds r4, 0x1 + cmp r4, 0x3 + ble _081A7CBA + ldr r0, =gEnemyParty + bl pokemon_calc_effective_stats + movs r0, 0x1 +_081A7CE2: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A7B90 + + thumb_func_start sub_81A7D00 +sub_81A7D00: @ 81A7D00 + push {lr} + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r2, =0x00000ca9 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 29 + ldr r2, =0x00000e04 + adds r1, r2 + adds r1, r0 + ldrh r1, [r1] + adds r2, r1, 0 + movs r0, 0x8C + lsls r0, 1 + cmp r1, r0 + bhi _081A7D34 + movs r1, 0 + b _081A7D4C + .pool +_081A7D34: + movs r0, 0x8C + lsls r0, 2 + cmp r1, r0 + bhi _081A7D40 + movs r1, 0x1 + b _081A7D4C +_081A7D40: + movs r0, 0xD2 + lsls r0, 2 + movs r1, 0x3 + cmp r2, r0 + bhi _081A7D4C + movs r1, 0x2 +_081A7D4C: + adds r0, r1, 0 + pop {r1} + bx r1 + thumb_func_end sub_81A7D00 + + thumb_func_start sub_81A7D54 +sub_81A7D54: @ 81A7D54 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_08612688 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_081A7D66: + movs r1, 0x8 + ldrsh r0, [r4, r1] + lsls r0, 2 + adds r0, r5 + ldr r1, [r0] + adds r0, r4, 0 + bl _call_via_r1 + lsls r0, 24 + cmp r0, 0 + bne _081A7D66 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A7D54 + + thumb_func_start sub_81A7D8C +sub_81A7D8C: @ 81A7D8C + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x14] + movs r2, 0x14 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _081A7DA4 + subs r0, r1, 0x1 + strh r0, [r4, 0x14] + lsls r0, 16 + cmp r0, 0 + bne _081A7DC8 +_081A7DA4: + ldrh r0, [r4, 0xA] + strh r0, [r4, 0x14] + ldrh r0, [r4, 0x10] + ldrh r1, [r4, 0x16] + adds r0, r1 + strh r0, [r4, 0x16] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + ble _081A7DBC + movs r0, 0x10 + strh r0, [r4, 0x16] +_081A7DBC: + movs r0, 0x1 + negs r0, r0 + ldrb r1, [r4, 0x16] + ldr r2, =0x00002d6b + bl BlendPalettes +_081A7DC8: + movs r2, 0x16 + ldrsh r0, [r4, r2] + cmp r0, 0xF + ble _081A7DDA + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + ldrh r0, [r4, 0xC] + strh r0, [r4, 0x14] +_081A7DDA: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A7D8C + + thumb_func_start sub_81A7DE8 +sub_81A7DE8: @ 81A7DE8 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x14] + movs r2, 0x14 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _081A7E00 + subs r0, r1, 0x1 + strh r0, [r4, 0x14] + lsls r0, 16 + cmp r0, 0 + bne _081A7E22 +_081A7E00: + ldrh r0, [r4, 0xC] + strh r0, [r4, 0x14] + ldrh r0, [r4, 0x16] + ldrh r1, [r4, 0x12] + subs r0, r1 + strh r0, [r4, 0x16] + lsls r0, 16 + cmp r0, 0 + bge _081A7E16 + movs r0, 0 + strh r0, [r4, 0x16] +_081A7E16: + movs r0, 0x1 + negs r0, r0 + ldrb r1, [r4, 0x16] + ldr r2, =0x00002d6b + bl BlendPalettes +_081A7E22: + movs r0, 0x16 + ldrsh r1, [r4, r0] + cmp r1, 0 + bne _081A7E56 + ldrh r0, [r4, 0xE] + subs r0, 0x1 + strh r0, [r4, 0xE] + lsls r0, 16 + cmp r0, 0 + bne _081A7E50 + ldr r0, =sub_81A7D54 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + b _081A7E56 + .pool +_081A7E50: + ldrh r0, [r4, 0xA] + strh r0, [r4, 0x14] + strh r1, [r4, 0x8] +_081A7E56: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81A7DE8 + + thumb_func_start sub_81A7E60 +sub_81A7E60: @ 81A7E60 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x4 + mov r8, r0 + adds r4, r1, 0 + adds r5, r2, 0 + adds r6, r3, 0 + ldr r3, [sp, 0x18] + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 16 + lsrs r6, 16 + lsls r3, 16 + lsrs r3, 16 + ldr r0, =sub_81A7D54 + movs r1, 0x3 + str r3, [sp] + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + mov r0, r8 + strh r0, [r1, 0xA] + strh r4, [r1, 0xC] + strh r5, [r1, 0xE] + strh r6, [r1, 0x10] + ldr r3, [sp] + strh r3, [r1, 0x12] + strh r0, [r1, 0x14] + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A7E60 + + thumb_func_start sub_81A7EC4 +sub_81A7EC4: @ 81A7EC4 + push {lr} + ldr r0, =sub_81A7D54 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _081A7EDC + movs r0, 0 + b _081A7EDE + .pool +_081A7EDC: + movs r0, 0x1 +_081A7EDE: + pop {r1} + bx r1 + thumb_func_end sub_81A7EC4 + + thumb_func_start sub_81A7EE4 +sub_81A7EE4: @ 81A7EE4 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r1 + ldrh r2, [r1, 0x8] + movs r3, 0x8 + ldrsh r0, [r1, r3] + cmp r0, 0 + bne _081A7F1C + adds r0, r2, 0x1 + strh r0, [r1, 0x8] + movs r0, 0x2 + str r0, [sp] + movs r0, 0 + movs r1, 0 + movs r2, 0x3 + movs r3, 0x2 + bl sub_81A7E60 + b _081A7F30 + .pool +_081A7F1C: + bl sub_81A7EC4 + lsls r0, 24 + cmp r0, 0 + beq _081A7F30 + bl script_env_2_enable_and_set_ctx_running + adds r0, r4, 0 + bl DestroyTask +_081A7F30: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81A7EE4 + + thumb_func_start sub_81A7F38 +sub_81A7F38: @ 81A7F38 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + cmp r0, 0 + bne _081A7F50 + b _081A807A +_081A7F50: + movs r0, 0 + mov r8, r0 +_081A7F54: + mov r0, sp + add r0, r8 + mov r1, r8 + strb r1, [r0] + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x2 + bls _081A7F54 + movs r5, 0 +_081A7F6C: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r4, r0, 24 + mov r2, sp + add r2, r8 + ldrb r3, [r2] + mov r0, sp + adds r1, r0, r4 + ldrb r0, [r1] + strb r0, [r2] + strb r3, [r1] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x9 + bls _081A7F6C + movs r1, 0 + mov r8, r1 +_081A7FB0: + movs r0, 0 + mov r10, r0 + mov r4, sp + add r4, r8 + ldrb r1, [r4] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r7, r1, r0 + adds r0, r7, 0 + movs r1, 0x39 + bl GetMonData + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r7, 0 + movs r1, 0x3A + bl GetMonData + lsls r0, 16 + lsrs r6, r0, 16 + str r4, [sp, 0x8] + cmp r5, r6 + bcc _081A8044 + adds r0, r7, 0 + movs r1, 0x37 + bl GetMonData + bl pokemon_ailments_get_primary + lsls r0, 24 + cmp r0, 0 + beq _081A7FFC + movs r0, 0x1 + mov r10, r0 + b _081A8048 + .pool +_081A7FFC: + adds r0, r7, 0 + movs r1, 0x15 + bl GetMonData + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r4, 0 + b _081A8014 +_081A800E: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081A8014: + cmp r4, 0x3 + bhi _081A8048 + adds r1, r4, 0 + adds r1, 0xD + adds r0, r7, 0 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + mov r1, r9 + adds r2, r4, 0 + bl CalcPPWithPPUps + lsls r0, 24 + lsrs r6, r0, 24 + adds r1, r4, 0 + adds r1, 0x11 + adds r0, r7, 0 + bl GetMonData + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, r6 + bcs _081A800E +_081A8044: + movs r1, 0x1 + mov r10, r1 +_081A8048: + mov r0, r10 + cmp r0, 0x1 + bne _081A806C + ldr r0, [sp, 0x8] + ldrb r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + bl sub_81A7594 + ldr r0, [sp, 0x4] + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + cmp r0, 0 + beq _081A807A +_081A806C: + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x2 + bls _081A7FB0 +_081A807A: + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A7F38 + + thumb_func_start sub_81A8090 +sub_81A8090: @ 81A8090 + push {r4,lr} + ldr r4, =gScriptResult + bl InBattlePike + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A8090 + + thumb_func_start InBattlePike +InBattlePike: @ 81A80A8 + push {lr} + movs r2, 0 + ldr r0, =gUnknown_02037318 + ldrh r1, [r0, 0x12] + ldr r3, =0xfffffea1 + adds r0, r1, r3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bls _081A80CA + movs r0, 0xB3 + lsls r0, 1 + cmp r1, r0 + beq _081A80CA + adds r0, 0x1 + cmp r1, r0 + bne _081A80CC +_081A80CA: + movs r2, 0x1 +_081A80CC: + adds r0, r2, 0 + pop {r1} + bx r1 + .pool + thumb_func_end InBattlePike + + thumb_func_start sub_81A80DC +sub_81A80DC: @ 81A80DC + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, =gScriptResult + movs r0, 0 + strh r0, [r4] + movs r0, 0x1 + bl sub_81A8590 + lsls r0, 24 + cmp r0, 0 + beq _081A8138 + movs r0, 0x1 + strh r0, [r4] + bl Random + ldr r5, =gSaveBlock2Ptr + ldr r4, [r5] + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x6 + bl __umodsi3 + movs r3, 0xE1 + lsls r3, 4 + adds r4, r3 + movs r1, 0x7 + ands r1, r0 + ldrb r2, [r4] + movs r0, 0x8 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4] + ldr r2, [r5] + adds r2, r3 + ldrb r1, [r2] + movs r0, 0x79 + negs r0, r0 + ands r0, r1 + movs r1, 0x40 + b _081A8248 + .pool +_081A8138: + bl Random + ldr r7, =gSaveBlock2Ptr + ldr r4, [r7] + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + movs r3, 0xE1 + lsls r3, 4 + adds r4, r3 + movs r1, 0x7 + ands r1, r0 + ldrb r2, [r4] + movs r0, 0x8 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4] + ldr r0, [r7] + adds r0, r3 + ldrb r1, [r0] + movs r0, 0x80 + ands r0, r1 + movs r6, 0x8 + cmp r0, 0 + beq _081A8172 + movs r6, 0x6 +_081A8172: + adds r0, r6, 0 + bl AllocZeroed + adds r5, r0, 0 + movs r2, 0 + movs r3, 0 + cmp r2, r6 + bcs _081A81BE + adds r4, r7, 0 +_081A8184: + ldr r0, [r4] + movs r1, 0xE1 + lsls r1, 4 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081A81B0 + cmp r2, 0x1 + beq _081A81B4 + cmp r2, 0x4 + beq _081A81B4 + adds r1, r3, 0 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + adds r1, r5, r1 + strb r2, [r1] + b _081A81B4 + .pool +_081A81B0: + adds r0, r5, r2 + strb r2, [r0] +_081A81B4: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, r6 + bcc _081A8184 +_081A81BE: + bl Random + ldr r7, =gSaveBlock2Ptr + ldr r4, [r7] + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl __modsi3 + adds r0, r5, r0 + ldrb r0, [r0] + movs r6, 0xE1 + lsls r6, 4 + adds r4, r6 + movs r1, 0xF + ands r1, r0 + lsls r1, 3 + ldrb r2, [r4] + movs r0, 0x79 + negs r0, r0 + mov r8, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4] + adds r0, r5, 0 + bl Free + ldr r0, [r7] + adds r0, r6 + ldrb r1, [r0] + movs r0, 0x78 + ands r0, r1 + cmp r0, 0x18 + bne _081A821C + bl sub_81A7974 + lsls r0, 24 + cmp r0, 0 + bne _081A821C + ldr r2, [r7] + adds r2, r6 + ldrb r1, [r2] + mov r0, r8 + ands r0, r1 + movs r1, 0x10 + orrs r0, r1 + strb r0, [r2] +_081A821C: + ldr r5, =gSaveBlock2Ptr + ldr r0, [r5] + movs r4, 0xE1 + lsls r4, 4 + adds r0, r4 + ldrb r1, [r0] + movs r0, 0x78 + ands r0, r1 + cmp r0, 0x38 + bne _081A824C + bl sub_81A8554 + lsls r0, 24 + cmp r0, 0 + bne _081A824C + ldr r2, [r5] + adds r2, r4 + ldrb r1, [r2] + movs r0, 0x79 + negs r0, r0 + ands r0, r1 + movs r1, 0x10 +_081A8248: + orrs r0, r1 + strb r0, [r2] +_081A824C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A80DC + + thumb_func_start sub_81A825C +sub_81A825C: @ 81A825C + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + movs r2, 0xE1 + lsls r2, 4 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 29 + lsrs r0, 29 + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_81A825C + + thumb_func_start sub_81A827C +sub_81A827C: @ 81A827C + ldr r2, =gScriptResult + ldr r1, =gUnknown_0861266C + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + movs r3, 0xE1 + lsls r3, 4 + adds r0, r3 + ldrb r0, [r0] + lsls r0, 25 + lsrs r0, 28 + adds r0, r1 + ldrb r0, [r0] + strh r0, [r2] + bx lr + .pool + thumb_func_end sub_81A827C + + thumb_func_start sub_81A82A4 +sub_81A82A4: @ 81A82A4 + push {r4-r7,lr} + lsls r0, 24 + movs r7, 0x6 + cmp r0, 0 + bne _081A82B0 + movs r7, 0x1 +_081A82B0: + ldr r4, =gSaveBlock2Ptr + ldr r1, [r4] + ldr r2, =0x00000ca9 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 29 + ldr r2, =0x00000e04 + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + movs r1, 0xE + bl __udivsi3 + lsls r0, 16 + lsrs r6, r0, 16 + adds r5, r4, 0 +_081A82D2: + lsls r0, r6, 24 + lsrs r0, 24 + adds r1, r7, 0 + bl sub_8162548 + lsls r0, 16 + lsrs r4, r0, 16 + movs r3, 0 + ldr r1, [r5] + ldr r2, =0x00000cb2 + adds r0, r1, r2 + ldrh r0, [r0] + subs r2, r0, 0x1 + cmp r3, r2 + bge _081A831A + ldr r0, =0x00000cb4 + adds r1, r0 + b _081A8314 + .pool +_081A830C: + adds r1, 0x2 + adds r3, 0x1 + cmp r3, r2 + bge _081A831A +_081A8314: + ldrh r0, [r1] + cmp r0, r4 + bne _081A830C +_081A831A: + ldr r0, [r5] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r0, [r0] + subs r0, 0x1 + cmp r3, r0 + bne _081A82D2 + ldr r5, =gUnknown_02038BCA + strh r4, [r5] + ldr r1, =gUnknown_0203BC88 + ldr r0, =gBattleFrontierTrainers + str r0, [r1] + ldrh r0, [r5] + movs r1, 0 + bl sub_8162614 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r0, =0x00000cb2 + adds r2, r1, r0 + ldrh r0, [r2] + cmp r0, 0xD + bhi _081A8356 + subs r0, 0x1 + lsls r0, 1 + ldr r2, =0x00000cb4 + adds r1, r2 + adds r1, r0 + ldrh r0, [r5] + strh r0, [r1] +_081A8356: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A82A4 + + thumb_func_start sub_81A8374 +sub_81A8374: @ 81A8374 + push {r4-r7,lr} + ldr r4, =gSaveBlock2Ptr + ldr r1, [r4] + ldr r2, =0x00000ca9 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 29 + ldr r2, =0x00000e04 + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + movs r1, 0xE + bl __udivsi3 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r1, =gUnknown_0203BC88 + ldr r0, =gBattleFrontierTrainers + str r0, [r1] + lsls r7, r5, 24 + adds r6, r4, 0 +_081A83A0: + lsls r0, r5, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_8162548 + lsls r0, 16 + lsrs r4, r0, 16 + movs r3, 0 + ldr r1, [r6] + ldr r2, =0x00000cb2 + adds r0, r1, r2 + ldrh r0, [r0] + subs r2, r0, 0x1 + cmp r3, r2 + bge _081A83EE + ldr r0, =0x00000cb4 + adds r1, r0 + b _081A83E8 + .pool +_081A83E0: + adds r1, 0x2 + adds r3, 0x1 + cmp r3, r2 + bge _081A83EE +_081A83E8: + ldrh r0, [r1] + cmp r0, r4 + bne _081A83E0 +_081A83EE: + ldr r0, [r6] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r0, [r0] + subs r0, 0x1 + cmp r3, r0 + bne _081A83A0 + ldr r5, =gUnknown_02038BCA + strh r4, [r5] + ldrh r0, [r5] + movs r1, 0 + bl sub_8162614 + ldr r3, =gSaveBlock2Ptr + ldr r1, [r3] + ldr r0, =0x00000cb2 + adds r2, r1, r0 + ldrh r0, [r2] + cmp r0, 0xE + bhi _081A8424 + subs r0, 0x1 + lsls r0, 1 + ldr r2, =0x00000cb4 + adds r1, r2 + adds r1, r0 + ldrh r0, [r5] + strh r0, [r1] +_081A8424: + adds r5, r3, 0 +_081A8426: + lsrs r0, r7, 24 + movs r1, 0x1 + bl sub_8162548 + lsls r0, 16 + lsrs r4, r0, 16 + movs r3, 0 + ldr r1, [r5] + ldr r2, =0x00000cb2 + adds r0, r1, r2 + ldrh r0, [r0] + cmp r3, r0 + bge _081A8466 + adds r2, 0x2 + adds r0, r1, r2 + ldrh r0, [r0] + cmp r0, r4 + beq _081A8466 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + subs r2, 0x2 + adds r0, r1, r2 + ldrh r2, [r0] + ldr r0, =0x00000cb4 + adds r1, r0 +_081A8458: + adds r1, 0x2 + adds r3, 0x1 + cmp r3, r2 + bge _081A8466 + ldrh r0, [r1] + cmp r0, r4 + bne _081A8458 +_081A8466: + ldr r0, [r5] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r0, [r0] + cmp r3, r0 + bne _081A8426 + ldr r5, =gUnknown_02038BCC + strh r4, [r5] + ldrh r0, [r5] + movs r1, 0x1 + bl sub_8162614 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r0, =0x00000cb2 + adds r2, r1, r0 + ldrh r0, [r2] + cmp r0, 0xD + bhi _081A849A + subs r0, 0x2 + lsls r0, 1 + ldr r2, =0x00000cb4 + adds r1, r2 + adds r1, r0 + ldrh r0, [r5] + strh r0, [r1] +_081A849A: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A8374 + + thumb_func_start sub_81A84B4 +sub_81A84B4: @ 81A84B4 + push {r4,r5,lr} + movs r2, 0 + ldr r5, =gSaveBlock2Ptr + ldr r4, =0x00000cb4 + ldr r0, =0x0000ffff + adds r3, r0, 0 +_081A84C0: + ldr r1, [r5] + lsls r0, r2, 1 + adds r1, r4 + adds r1, r0 + ldrh r0, [r1] + orrs r0, r3 + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xD + bls _081A84C0 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A84B4 + + thumb_func_start sub_81A84EC +sub_81A84EC: @ 81A84EC + push {lr} + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0 + bne _081A8524 + ldr r3, =gUnknown_02038BCA + ldrh r1, [r3] + ldr r0, =0x0000012b + cmp r1, r0 + bhi _081A8542 + ldr r2, =gUnknown_0203BC88 + movs r0, 0x34 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0xC + bl ConvertBattleFrontierTrainerSpeechToString + b _081A8542 + .pool +_081A8524: + cmp r0, 0x1 + bne _081A8542 + ldr r3, =gUnknown_02038BCC + ldrh r1, [r3] + ldr r0, =0x0000012b + cmp r1, r0 + bhi _081A8542 + ldr r2, =gUnknown_0203BC88 + movs r0, 0x34 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0xC + bl ConvertBattleFrontierTrainerSpeechToString +_081A8542: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A84EC + + thumb_func_start sub_81A8554 +sub_81A8554: @ 81A8554 + push {r4-r6,lr} + ldr r5, =gPlayerParty + movs r6, 0 + movs r4, 0 +_081A855C: + adds r0, r5, 0 + movs r1, 0x39 + bl GetMonData + cmp r0, 0 + bne _081A856E + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_081A856E: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, 0x64 + cmp r4, 0x2 + bls _081A855C + cmp r6, 0x1 + bhi _081A8588 + movs r0, 0x1 + b _081A858A + .pool +_081A8588: + movs r0, 0 +_081A858A: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81A8554 + + thumb_func_start sub_81A8590 +sub_81A8590: @ 81A8590 + push {r4-r6,lr} + lsls r0, 24 + movs r6, 0 + ldr r1, =gSaveBlock2Ptr + ldr r2, [r1] + ldr r3, =0x00000ca9 + adds r1, r2, r3 + ldrb r1, [r1] + lsls r1, 30 + lsrs r1, 29 + ldr r3, =0x00000e04 + adds r2, r3 + adds r2, r1 + lsrs r4, r0, 24 + ldrh r2, [r2] + adds r0, r4, r2 + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x5 + bl sub_81A3B30 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + blt _081A85F0 + cmp r2, 0x1 + bgt _081A85F0 + ldr r1, =gUnknown_086125DC + adds r0, r2, 0 + adds r0, 0x14 + adds r0, r1 + ldrb r0, [r0] + ldrb r1, [r1, 0x17] + subs r0, r1 + cmp r4, r0 + bne _081A8634 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + b _081A8634 + .pool +_081A85F0: + ldr r5, =gUnknown_086125DC + movs r0, 0x5 + lsls r3, r0, 2 + adds r0, r3, r5 + ldrb r1, [r0] + adds r0, r5, 0x3 + adds r0, r3, r0 + ldrb r2, [r0] + subs r1, r2 + cmp r4, r1 + bne _081A8610 + movs r6, 0x3 + b _081A8634 + .pool +_081A8610: + adds r0, r5, 0x1 + adds r0, r3, r0 + ldrb r1, [r0] + subs r0, r1, r2 + cmp r4, r0 + beq _081A8632 + cmp r4, r1 + bls _081A8634 + subs r0, r4, r1 + adds r0, r2 + adds r1, r5, 0x2 + adds r1, r3, r1 + ldrb r1, [r1] + bl __modsi3 + cmp r0, 0 + bne _081A8634 +_081A8632: + movs r6, 0x4 +_081A8634: + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81A8590 + + thumb_func_start sub_81A863C +sub_81A863C: @ 81A863C + push {r4,lr} + ldr r4, =gScriptResult + movs r0, 0 + bl sub_81A8590 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A863C + + thumb_func_start sub_81A8658 +sub_81A8658: @ 81A8658 + push {r4,lr} + ldr r3, =gUnknown_08612675 + ldr r2, =gSpecialVar_0x8007 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + movs r1, 0xE1 + lsls r1, 4 + adds r0, r1 + ldrb r1, [r0] + lsls r1, 29 + lsrs r1, 29 + lsls r0, r1, 1 + adds r0, r1 + ldrh r2, [r2] + adds r0, r2 + adds r0, r3 + ldrb r4, [r0] + adds r0, r4, 0 + bl sub_81A7F38 + ldr r0, =gScriptResult + strh r4, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A8658 + + thumb_func_start sub_81A869C +sub_81A869C: @ 81A869C + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r0, =gSpecialVar_0x8005 + ldrb r1, [r0] + movs r0, 0xE1 + lsls r0, 4 + adds r2, r0 + lsls r1, 7 + ldrb r3, [r2] + movs r0, 0x7F + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + bx lr + .pool + thumb_func_end sub_81A869C + + thumb_func_start sub_81A86C0 +sub_81A86C0: @ 81A86C0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r1, =gScriptResult + movs r0, 0x1 + strh r0, [r1] + movs r0, 0 + mov r10, r0 +_081A86D4: + movs r0, 0 + mov r9, r0 + movs r0, 0x64 + mov r1, r10 + muls r1, r0 + ldr r0, =gPlayerParty + adds r7, r1, r0 + adds r0, r7, 0 + movs r1, 0x39 + bl GetMonData + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r7, 0 + movs r1, 0x3A + bl GetMonData + lsls r0, 16 + lsrs r5, r0, 16 + cmp r4, r5 + bcc _081A8762 + adds r0, r7, 0 + movs r1, 0x37 + bl GetMonData + bl pokemon_ailments_get_primary + lsls r0, 24 + cmp r0, 0 + bne _081A8762 + adds r0, r7, 0 + movs r1, 0x15 + bl GetMonData + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r6, 0 + b _081A8732 + .pool +_081A872C: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_081A8732: + cmp r6, 0x3 + bhi _081A8766 + adds r1, r6, 0 + adds r1, 0xD + adds r0, r7, 0 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + mov r1, r8 + adds r2, r6, 0 + bl CalcPPWithPPUps + lsls r0, 24 + lsrs r5, r0, 24 + adds r1, r6, 0 + adds r1, 0x11 + adds r0, r7, 0 + bl GetMonData + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, r5 + bcs _081A872C +_081A8762: + movs r0, 0x1 + mov r9, r0 +_081A8766: + mov r0, r9 + cmp r0, 0x1 + bne _081A8778 + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] + b _081A8786 + .pool +_081A8778: + mov r0, r10 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + cmp r0, 0x2 + bls _081A86D4 +_081A8786: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81A86C0 + + thumb_func_start sub_81A8794 +sub_81A8794: @ 81A8794 + push {r4-r7,lr} + movs r5, 0 + ldr r7, =gSaveBlock1Ptr + ldr r6, =gSaveBlock2Ptr +_081A879C: + ldr r0, [r6] + lsls r4, r5, 1 + ldr r1, =0x00000caa + adds r0, r1 + adds r0, r4 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + movs r2, 0xEA + lsls r2, 1 + adds r1, r2 + ldr r0, [r7] + adds r0, r1 + movs r1, 0xC + bl GetMonData + ldr r1, [r6] + ldr r2, =0x00000e12 + adds r1, r2 + adds r1, r4 + strh r0, [r1] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _081A879C + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A8794 + + thumb_func_start sub_81A87E8 +sub_81A87E8: @ 81A87E8 + push {r4,lr} + movs r4, 0 +_081A87EC: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + lsls r3, r4, 1 + ldr r1, =0x00000caa + adds r0, r2, r1 + adds r0, r3 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gUnknown_02024488 + adds r0, r1 + ldr r1, =0x00000e12 + adds r3, r1 + adds r2, r3 + movs r1, 0xC + bl SetMonData + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _081A87EC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A87E8 + + thumb_func_start sub_81A8830 +sub_81A8830: @ 81A8830 + push {r4-r6,lr} + ldr r3, =gSaveBlock2Ptr + ldr r1, [r3] + ldr r2, =0x00000ca9 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + ldr r0, =0x00000ca8 + adds r1, r0 + movs r4, 0 + strb r4, [r1] + ldr r1, [r3] + ldr r6, =0x00000cb2 + adds r0, r1, r6 + strh r4, [r0] + adds r1, r2 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r3, [r3] + ldr r0, =0x00000cdc + adds r2, r3, r0 + ldr r1, =gUnknown_08612690 + lsls r0, r5, 2 + adds r0, r1 + ldr r1, [r2] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _081A887C + lsls r1, r5, 1 + ldr r2, =0x00000e04 + adds r0, r3, r2 + adds r0, r1 + strh r4, [r0] +_081A887C: + ldr r0, =gUnknown_02038BCA + strh r4, [r0] + ldr r1, =gBattleOutcome + movs r0, 0 + strb r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A8830 + + thumb_func_start sub_81A88B0 +sub_81A88B0: @ 81A88B0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =gPlayerParty + adds r0, r4, 0 + movs r1, 0x6 + bl GetMonData + cmp r0, 0 + bne _081A8904 + adds r0, r4, 0 + bl GetMonAbility + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x33 + beq _081A88D6 + cmp r0, 0x16 + bne _081A8904 +_081A88D6: + adds r0, r4, 0 + movs r1, 0x38 + bl GetMonData + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bls _081A8904 + subs r0, 0x5 + cmp r5, r0 + bgt _081A8904 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081A8904 + movs r0, 0 + b _081A8906 + .pool +_081A8904: + movs r0, 0x1 +_081A8906: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81A88B0 + + thumb_func_start sub_81A890C +sub_81A890C: @ 81A890C + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, =0x0000017b + cmp r2, r0 + bne _081A8920 + movs r1, 0 + b _081A892A + .pool +_081A8920: + ldr r0, =0x00000149 + movs r1, 0x2 + cmp r2, r0 + bne _081A892A + movs r1, 0x1 +_081A892A: + adds r0, r1, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A890C + + thumb_func_start sub_81A8934 +@ void sub_81A8934(u8) +sub_81A8934: @ 81A8934 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =gUnknown_0203CE50 + ldr r0, [r4] + cmp r0, 0 + bne _081A894A + movs r0, 0x44 + bl AllocZeroed + str r0, [r4] +_081A894A: + ldr r0, [r4] + adds r0, 0x41 + strb r5, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A8934 + + thumb_func_start sub_81A895C +sub_81A895C: @ 81A895C + push {r4,lr} + ldr r4, =gUnknown_0203CE50 + ldr r0, [r4] + cmp r0, 0 + beq _081A896E + bl Free + movs r0, 0 + str r0, [r4] +_081A896E: + movs r0, 0xFF + movs r1, 0 + movs r2, 0 + bl GetFieldObjectIdByLocalIdAndMap + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + adds r0, r1 + bl FieldObjectClearAnimIfSpecialAnimFinished + bl sub_80D338C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A895C + + thumb_func_start sub_81A89A0 +sub_81A89A0: @ 81A89A0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0xC7 + lsls r1, 4 + adds r1, r0 + mov r9, r1 + movs r3, 0 + mov r10, r3 + mov r8, r3 +_081A89C4: + mov r0, r8 + lsls r4, r0, 1 + adds r1, r4, r0 + lsls r1, 3 + add r1, r9 + ldrh r0, [r1, 0x4] + adds r0, 0x7 + ldrh r1, [r1, 0x6] + adds r1, 0x7 + lsls r0, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + bl MapGridGetMetatileIdAt + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, =gUnknown_0203CE50 + ldr r0, [r0] + adds r0, 0x41 + ldrb r0, [r0] + movs r2, 0xA6 + lsls r2, 2 + cmp r0, 0 + bne _081A89F8 + subs r2, 0x48 +_081A89F8: + ldr r0, =0x0000024f + cmp r1, r0 + bls _081A8AD4 + subs r1, r2 + adds r0, r1, 0 + cmp r1, 0 + bge _081A8A08 + adds r0, r1, 0x7 +_081A8A08: + asrs r2, r0, 3 + lsls r0, r2, 24 + lsrs r0, 24 + cmp r0, 0x4 + bhi _081A8AD4 + ldr r3, [sp] + cmp r0, r3 + bne _081A8AD4 + lsls r0, r2, 3 + subs r0, r1, r0 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bhi _081A8AD4 + movs r1, 0 + movs r2, 0 + cmp r5, 0x1 + beq _081A8A58 + cmp r5, 0x1 + bgt _081A8A44 + cmp r5, 0 + beq _081A8A4E + b _081A8AD4 + .pool +_081A8A44: + cmp r5, 0x2 + beq _081A8A64 + cmp r5, 0x3 + beq _081A8A70 + b _081A8AD4 +_081A8A4E: + ldr r7, =gUnknown_08612698 + movs r1, 0x1 + b _081A8A74 + .pool +_081A8A58: + ldr r7, =gUnknown_0861269C + movs r2, 0x1 + b _081A8A74 + .pool +_081A8A64: + ldr r7, =gUnknown_086126A0 + movs r1, 0xFF + b _081A8A74 + .pool +_081A8A70: + ldr r7, =gUnknown_086126A4 + movs r2, 0xFF +_081A8A74: + mov r3, r8 + adds r0, r4, r3 + lsls r0, 3 + mov r3, r9 + adds r4, r0, r3 + lsls r0, r1, 24 + asrs r0, 24 + ldrh r1, [r4, 0x4] + adds r0, r1 + strh r0, [r4, 0x4] + lsls r0, r2, 24 + asrs r0, 24 + ldrh r3, [r4, 0x6] + adds r0, r3 + strh r0, [r4, 0x6] + ldrb r0, [r4] + ldr r6, =gSaveBlock1Ptr + ldr r2, [r6] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl GetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x10 + beq _081A8ACC + mov r0, r8 + adds r1, r5, 0 + bl sub_81A8D60 + ldrb r4, [r4] + mov r10, r4 + mov r0, r10 + ldr r2, [r6] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + adds r3, r7, 0 + bl exec_movement + b _081A8AD4 + .pool +_081A8ACC: + mov r0, r8 + adds r1, r5, 0 + bl sub_81A8D94 +_081A8AD4: + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x3F + bhi _081A8AE4 + b _081A89C4 +_081A8AE4: + mov r0, r10 + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81A89A0 + + thumb_func_start sub_81A8AF8 +sub_81A8AF8: @ 81A8AF8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r1, =gUnknown_0203CE50 + ldr r2, [r1] + cmp r2, 0 + bne _081A8B0C + b _081A8D4A +_081A8B0C: + adds r0, r2, 0 + adds r0, 0x41 + ldrb r0, [r0] + movs r3, 0xA6 + lsls r3, 2 + mov r10, r3 + cmp r0, 0 + bne _081A8B22 + movs r0, 0x94 + lsls r0, 2 + mov r10, r0 +_081A8B22: + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r3, 0xC7 + lsls r3, 4 + adds r7, r0, r3 + movs r0, 0 + mov r9, r0 + adds r0, r2, 0 + adds r0, 0x40 + ldrb r0, [r0] + cmp r9, r0 + bcc _081A8B3C + b _081A8D4A +_081A8B3C: + mov r8, r1 +_081A8B3E: + mov r1, r8 + ldr r0, [r1] + mov r2, r9 + lsls r4, r2, 2 + adds r0, r4 + ldrb r0, [r0, 0x1] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, r7 + ldrh r0, [r1, 0x4] + adds r0, 0x7 + ldrh r1, [r1, 0x6] + adds r1, 0x7 + lsls r0, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + bl MapGridGetMetatileIdAt + lsls r0, 16 + lsrs r0, 16 + mov r3, r10 + subs r1, r0, r3 + adds r0, r1, 0 + cmp r1, 0 + bge _081A8B76 + adds r0, r1, 0x7 +_081A8B76: + asrs r0, 3 + lsls r0, 3 + subs r0, r1, r0 + lsls r0, 24 + lsrs r0, 24 + mov r2, r8 + ldr r1, [r2] + adds r1, r4 + ldrb r1, [r1] + subs r0, r1 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + blt _081A8B96 + cmp r1, 0x3 + bne _081A8BAC +_081A8B96: + movs r0, 0x3 + negs r0, r0 + movs r6, 0 + cmp r1, r0 + bne _081A8BB4 + b _081A8BB2 + .pool +_081A8BAC: + movs r6, 0x2 + cmp r1, 0 + ble _081A8BB4 +_081A8BB2: + movs r6, 0x1 +_081A8BB4: + ldr r5, =gUnknown_0203CE50 + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + ldrb r0, [r0] + ldr r1, =gSaveBlock1Ptr + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl GetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x10 + bne _081A8BDC + b _081A8D32 +_081A8BDC: + ldr r0, =gUnknown_02037350 + lsls r1, r2, 3 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x18] + lsls r0, 28 + lsrs r0, 28 + adds r1, r0, 0 + cmp r6, 0 + bne _081A8C9C + cmp r0, 0x2 + beq _081A8C60 + cmp r0, 0x2 + bgt _081A8C0C + cmp r0, 0x1 + beq _081A8C30 + b _081A8D32 + .pool +_081A8C0C: + cmp r0, 0x3 + beq _081A8C48 + cmp r0, 0x4 + beq _081A8C16 + b _081A8D32 +_081A8C16: + ldr r3, =gUnknown_086126AE + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + movs r1, 0x7 + b _081A8C72 + .pool +_081A8C30: + ldr r3, =gUnknown_086126A8 + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + movs r1, 0xA + b _081A8C72 + .pool +_081A8C48: + ldr r3, =gUnknown_086126AA + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + movs r1, 0x8 + b _081A8C72 + .pool +_081A8C60: + ldr r3, =gUnknown_086126AC + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + movs r1, 0x9 +_081A8C72: + strb r1, [r0, 0x9] + mov r1, r8 + ldr r0, [r1] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + ldrb r0, [r0] + ldr r1, =gSaveBlock1Ptr + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl exec_movement + b _081A8D32 + .pool +_081A8C9C: + cmp r6, 0x1 + bne _081A8D32 + cmp r0, 0x2 + beq _081A8D00 + cmp r0, 0x2 + bgt _081A8CAE + cmp r0, 0x1 + beq _081A8CD0 + b _081A8D32 +_081A8CAE: + cmp r1, 0x3 + beq _081A8CE8 + cmp r1, 0x4 + bne _081A8D32 + ldr r3, =gUnknown_086126AA + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + movs r1, 0x8 + b _081A8D12 + .pool +_081A8CD0: + ldr r3, =gUnknown_086126AC + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + movs r1, 0x9 + b _081A8D12 + .pool +_081A8CE8: + ldr r3, =gUnknown_086126AE + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + movs r1, 0x7 + b _081A8D12 + .pool +_081A8D00: + ldr r3, =gUnknown_086126A8 + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + movs r1, 0xA +_081A8D12: + strb r1, [r0, 0x9] + mov r2, r8 + ldr r0, [r2] + adds r0, r4 + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + ldrb r0, [r0] + ldr r1, =gSaveBlock1Ptr + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl exec_movement +_081A8D32: + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + mov r3, r8 + ldr r0, [r3] + adds r0, 0x40 + ldrb r0, [r0] + cmp r9, r0 + bcs _081A8D4A + b _081A8B3E +_081A8D4A: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A8AF8 + + thumb_func_start sub_81A8D60 +sub_81A8D60: @ 81A8D60 + push {r4,lr} + ldr r4, =gUnknown_0203CE50 + ldr r3, [r4] + adds r2, r3, 0 + adds r2, 0x40 + ldrb r2, [r2] + lsls r2, 2 + adds r3, r2 + strb r0, [r3, 0x1] + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0x40 + ldrb r0, [r0] + lsls r0, 2 + adds r2, r0 + strb r1, [r2] + ldr r1, [r4] + adds r1, 0x40 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A8D60 + + thumb_func_start sub_81A8D94 +sub_81A8D94: @ 81A8D94 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0xC7 + lsls r1, 4 + adds r5, r0, r1 + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 3 + adds r1, r5 + ldrh r0, [r1, 0x4] + adds r0, 0x7 + ldrh r1, [r1, 0x6] + adds r1, 0x7 + lsls r0, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + bl MapGridGetMetatileIdAt + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, =gUnknown_0203CE50 + ldr r0, [r0] + adds r0, 0x41 + ldrb r0, [r0] + movs r1, 0xA6 + lsls r1, 2 + cmp r0, 0 + bne _081A8DDA + subs r1, 0x48 +_081A8DDA: + subs r1, r2, r1 + adds r0, r1, 0 + cmp r1, 0 + bge _081A8DE4 + adds r0, r1, 0x7 +_081A8DE4: + asrs r0, 3 + lsls r0, 3 + subs r0, r1, r0 + lsls r0, 24 + lsrs r0, 24 + subs r0, r6 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + blt _081A8DFC + cmp r1, 0x3 + bne _081A8E08 +_081A8DFC: + movs r2, 0 + b _081A8E1A + .pool +_081A8E08: + cmp r1, 0 + bgt _081A8E14 + movs r0, 0x3 + negs r0, r0 + cmp r1, r0 + bne _081A8E18 +_081A8E14: + movs r2, 0x1 + b _081A8E1A +_081A8E18: + movs r2, 0x2 +_081A8E1A: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r5 + ldrb r0, [r1, 0x9] + adds r3, r0, 0 + cmp r2, 0 + bne _081A8E4C + cmp r0, 0x8 + beq _081A8E72 + cmp r0, 0x8 + bgt _081A8E38 + cmp r0, 0x7 + beq _081A8E48 + b _081A8E76 +_081A8E38: + cmp r0, 0x9 + beq _081A8E44 + cmp r0, 0xA + bne _081A8E76 + movs r0, 0x7 + b _081A8E74 +_081A8E44: + movs r0, 0x8 + b _081A8E74 +_081A8E48: + movs r0, 0x9 + b _081A8E74 +_081A8E4C: + cmp r2, 0x1 + bne _081A8E76 + cmp r0, 0x8 + beq _081A8E6A + cmp r0, 0x8 + bgt _081A8E5E + cmp r0, 0x7 + beq _081A8E72 + b _081A8E76 +_081A8E5E: + cmp r3, 0x9 + beq _081A8E6E + cmp r3, 0xA + bne _081A8E76 + movs r0, 0x8 + b _081A8E74 +_081A8E6A: + movs r0, 0x9 + b _081A8E74 +_081A8E6E: + movs r0, 0x7 + b _081A8E74 +_081A8E72: + movs r0, 0xA +_081A8E74: + strb r0, [r1, 0x9] +_081A8E76: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81A8D94 + + thumb_func_start sub_81A8E7C +sub_81A8E7C: @ 81A8E7C + push {lr} + ldr r1, =gUnknown_08613EE0 + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A8E7C + + thumb_func_start sub_81A8E9C +sub_81A8E9C: @ 81A8E9C + push {r4-r6,lr} + ldr r3, =gSaveBlock2Ptr + ldr r1, [r3] + ldr r4, =0x00000ca9 + adds r0, r1, r4 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + ldr r0, =0x00000ca8 + adds r1, r0 + movs r2, 0 + strb r2, [r1] + ldr r1, [r3] + ldr r6, =0x00000cb2 + adds r0, r1, r6 + strh r2, [r0] + adds r1, r4 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + cmp r5, 0 + beq _081A8EF0 + ldr r0, [r3] + ldr r1, =0x00000cdc + adds r0, r1 + ldr r2, [r0] + movs r0, 0x80 + lsls r0, 6 + b _081A8EFC + .pool +_081A8EF0: + ldr r0, [r3] + ldr r6, =0x00000cdc + adds r0, r6 + ldr r2, [r0] + movs r0, 0x80 + lsls r0, 5 +_081A8EFC: + ands r2, r0 + cmp r2, 0 + bne _081A8F14 + ldr r0, [r3] + lsls r1, r5, 1 + ldr r3, =0x00000e1a + adds r0, r3 + adds r0, r1 + strh r2, [r0] + adds r0, r5, 0 + bl sub_81AAA7C +_081A8F14: + bl sub_81C4EEC + ldr r0, =gUnknown_02038BCA + movs r1, 0 + strh r1, [r0] + ldr r0, =gBattleOutcome + strb r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A8E9C + + thumb_func_start sub_81A8F38 +sub_81A8F38: @ 81A8F38 + push {r4,lr} + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r2, =0x00000ca9 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r4, r0, 30 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + adds r3, r1, 0 + cmp r0, 0x6 + bls _081A8F54 + b _081A903A +_081A8F54: + lsls r0, 2 + ldr r1, =_081A8F70 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A8F70: + .4byte _081A8F8C + .4byte _081A8F9C + .4byte _081A8FB4 + .4byte _081A8FE4 + .4byte _081A8FF8 + .4byte _081A9010 + .4byte _081A9028 +_081A8F8C: + ldr r0, =gScriptResult + ldr r1, [r3] + ldr r3, =0x00000e18 + b _081A8FFE + .pool +_081A8F9C: + ldr r2, =gScriptResult + ldr r0, [r3] + lsls r1, r4, 1 + ldr r3, =0x00000e1a + adds r0, r3 + adds r0, r1 + ldrh r0, [r0] + b _081A9038 + .pool +_081A8FB4: + cmp r4, 0 + beq _081A8FCC + ldr r2, =gScriptResult + ldr r0, [r3] + ldr r1, =0x00000cdc + adds r0, r1 + b _081A9030 + .pool +_081A8FCC: + ldr r2, =gScriptResult + ldr r0, [r3] + ldr r3, =0x00000cdc + adds r0, r3 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 5 + b _081A9036 + .pool +_081A8FE4: + ldr r0, =gScriptResult + ldr r1, [r3] + ldr r2, =0x00000e1a + adds r1, r2 + b _081A9000 + .pool +_081A8FF8: + ldr r0, =gScriptResult + ldr r1, [r3] + ldr r3, =0x00000e1c +_081A8FFE: + adds r1, r3 +_081A9000: + ldrh r1, [r1] + strh r1, [r0] + b _081A903A + .pool +_081A9010: + ldr r2, =gScriptResult + ldr r0, [r3] + ldr r1, =0x00000cdc + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 5 + b _081A9036 + .pool +_081A9028: + ldr r2, =gScriptResult + ldr r0, [r3] + ldr r3, =0x00000cdc + adds r0, r3 +_081A9030: + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 6 +_081A9036: + ands r0, r1 +_081A9038: + strh r0, [r2] +_081A903A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A8F38 + + thumb_func_start sub_81A9048 +sub_81A9048: @ 81A9048 + push {lr} + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldr r1, =0x00000ca9 + adds r0, r2, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r1, r0, 30 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x1 + beq _081A9098 + cmp r0, 0x1 + bgt _081A9078 + cmp r0, 0 + beq _081A9082 + b _081A9126 + .pool +_081A9078: + cmp r0, 0x2 + beq _081A90B0 + cmp r0, 0x7 + beq _081A911C + b _081A9126 +_081A9082: + ldr r0, =gSpecialVar_0x8006 + ldrh r1, [r0] + ldr r3, =0x00000e18 + adds r0, r2, r3 + strh r1, [r0] + b _081A9126 + .pool +_081A9098: + lsls r1, 1 + ldr r3, =0x00000e1a + adds r0, r2, r3 + adds r0, r1 + ldr r1, =gSpecialVar_0x8006 + ldrh r1, [r1] + strh r1, [r0] + b _081A9126 + .pool +_081A90B0: + cmp r1, 0 + beq _081A90E4 + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + cmp r0, 0 + beq _081A90D0 + ldr r1, =0x00000cdc + adds r0, r2, r1 + ldr r1, [r0] + movs r2, 0x80 + lsls r2, 6 + b _081A90F6 + .pool +_081A90D0: + ldr r3, =0x00000cdc + adds r0, r2, r3 + ldr r1, [r0] + ldr r2, =0xffffdfff + b _081A910C + .pool +_081A90E4: + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + cmp r0, 0 + beq _081A9104 + ldr r1, =0x00000cdc + adds r0, r2, r1 + ldr r1, [r0] + movs r2, 0x80 + lsls r2, 5 +_081A90F6: + orrs r1, r2 + str r1, [r0] + b _081A9126 + .pool +_081A9104: + ldr r3, =0x00000cdc + adds r0, r2, r3 + ldr r1, [r0] + ldr r2, =0xffffefff +_081A910C: + ands r1, r2 + str r1, [r0] + b _081A9126 + .pool +_081A911C: + ldr r0, =gSpecialVar_0x8006 + ldrh r1, [r0] + ldr r3, =0x00000e2a + adds r0, r2, r3 + strb r1, [r0] +_081A9126: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9048 + + thumb_func_start sub_81A9134 +sub_81A9134: @ 81A9134 + push {r4,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =gSpecialVar_0x8005 + ldrh r1, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + strb r1, [r0] + movs r0, 0x80 + lsls r0, 7 + movs r1, 0 + bl VarSet + ldr r1, [r4] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl save_serialize_map + movs r0, 0x1 + bl TrySavingData + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9134 + + thumb_func_start sub_81A917C +sub_81A917C: @ 81A917C + push {r4,r5,lr} + ldr r4, =gSaveBlock2Ptr + ldr r1, [r4] + ldr r2, =0x00000ca9 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 29 + ldr r2, =0x00000e1a + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0x29 + bls _081A91CC + bl Random + ldr r4, [r4] + ldr r5, =gUnknown_08613F34 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x9 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 15 + adds r0, r5 + ldrh r0, [r0] + ldr r1, =0x00000e18 + adds r4, r1 + b _081A91EA + .pool +_081A91CC: + bl Random + ldr r4, [r4] + ldr r5, =gUnknown_08613F28 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x6 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 15 + adds r0, r5 + ldrh r0, [r0] + ldr r2, =0x00000e18 + adds r4, r2 +_081A91EA: + strh r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A917C + + thumb_func_start sub_81A91FC +sub_81A91FC: @ 81A91FC + push {r4,r5,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000e18 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x1 + bl AddBagItem + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bne _081A9244 + ldr r0, [r4] + ldr r1, =0x00000e18 + adds r0, r1 + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r0, [r4] + ldr r1, =0x00000e18 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + ldr r0, =gScriptResult + strh r5, [r0] + b _081A924A + .pool +_081A9244: + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] +_081A924A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A91FC + + thumb_func_start sub_81A9254 +sub_81A9254: @ 81A9254 + push {r4,r5,lr} + movs r4, 0 + ldr r5, =gSaveBlock2Ptr +_081A925A: + bl Random + ldr r1, [r5] + lsls r2, r4, 1 + ldr r3, =0x00000e22 + adds r1, r3 + adds r1, r2 + strh r0, [r1] + adds r4, 0x1 + cmp r4, 0x3 + ble _081A925A + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000e2a + adds r0, r1 + movs r1, 0 + strb r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9254 + + thumb_func_start CalculateBattlePyramidItemBallItemId +CalculateBattlePyramidItemBallItemId: @ 81A9290 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + ldr r5, =gSaveBlock2Ptr + ldr r1, [r5] + ldr r2, =0x00000ca9 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + mov r10, r0 + adds r2, 0x9 + adds r0, r1, r2 + ldrh r0, [r0] + str r0, [sp] + mov r2, r10 + lsls r0, r2, 1 + ldr r2, =0x00000e1a + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x14 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + cmp r0, 0x13 + bls _081A92DE + movs r0, 0x13 + mov r8, r0 +_081A92DE: + bl sub_81AA9E4 + lsls r0, 24 + ldr r1, =gScriptLastTalked + ldrh r4, [r1] + ldr r1, =gUnknown_08613650 + lsrs r0, 20 + adds r0, r1 + ldrb r0, [r0, 0x1] + subs r4, r0 + subs r7, r4, 0x1 + ldr r1, [r5] + lsrs r0, r7, 31 + adds r0, r7, r0 + asrs r0, 1 + lsls r0, 1 + ldr r2, =0x00000e22 + adds r1, r2 + adds r1, r0 + ldrh r6, [r1] + adds r0, r6, 0 + bl SeedRng2 + movs r5, 0 + mov r0, r8 + lsls r0, 2 + mov r9, r0 + cmp r5, r4 + bge _081A9332 +_081A9318: + bl Random2 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r6, r0, 16 + adds r5, 0x1 + adds r0, r7, 0x1 + cmp r5, r0 + blt _081A9318 +_081A9332: + ldr r0, =gUnknown_08613B3A + ldr r1, [sp] + adds r0, r1, r0 + ldrb r5, [r0] + ldr r1, =gUnknown_08613ABC + ldr r3, =gSpecialVar_0x8000 + ldr r4, =gSpecialVar_0x8001 + cmp r5, 0x3E + bhi _081A935E + lsls r2, r5, 1 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r6, r0 + blt _081A935E + adds r0, r2, r1 +_081A9350: + adds r0, 0x2 + adds r5, 0x1 + cmp r5, 0x3E + bhi _081A935E + ldrb r2, [r0] + cmp r6, r2 + bge _081A9350 +_081A935E: + mov r0, r10 + cmp r0, 0 + beq _081A9394 + ldr r2, =gUnknown_0861392C + b _081A9396 + .pool +_081A9394: + ldr r2, =gUnknown_0861379C +_081A9396: + lsls r0, r5, 1 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 1 + mov r1, r9 + add r1, r8 + lsls r1, 2 + adds r0, r1 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r3] + movs r0, 0x1 + strh r0, [r4] + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end CalculateBattlePyramidItemBallItemId + + thumb_func_start sub_81A93C8 +sub_81A93C8: @ 81A93C8 + push {r4,r5,lr} + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0xC7 + lsls r1, 4 + adds r3, r0, r1 + movs r2, 0 + ldr r4, =gScriptLastTalked + b _081A93F4 + .pool +_081A93E4: + adds r2, 0x1 + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0 + beq _081A940A +_081A93F4: + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r1, r0, r3 + ldrb r0, [r1] + ldrh r5, [r4] + cmp r0, r5 + bne _081A93E4 + ldr r0, =0x00007fff + strh r0, [r1, 0x4] + strh r0, [r1, 0x6] +_081A940A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A93C8 + + thumb_func_start sub_81A9414 +sub_81A9414: @ 81A9414 + ldr r1, =gUnknown_0203BC88 + ldr r0, =gBattleFrontierTrainers + str r0, [r1] + bx lr + .pool + thumb_func_end sub_81A9414 + + thumb_func_start sub_81A9424 +sub_81A9424: @ 81A9424 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + movs r0, 0 + mov r9, r0 + movs r7, 0 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0xC7 + lsls r1, 4 + adds r1, r0 + mov r8, r1 + ldr r2, =gUnknown_02037350 + ldr r0, =gUnknown_03005DF0 + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x8] + bl sub_81A9AA8 + lsls r0, 16 + lsrs r5, r0, 16 + movs r6, 0 + ldr r2, =gUnknown_08613C1C + ldr r0, =gUnknown_0203BC88 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r5 + adds r0, r1 + ldrb r1, [r2] + ldrb r0, [r0] + cmp r1, r0 + bne _081A9488 + ldrb r2, [r2, 0x1] + mov r9, r2 + b _081A94AE + .pool +_081A9488: + adds r6, 0x1 + cmp r6, 0x31 + bhi _081A94AE + ldr r4, =gUnknown_08613C1C + lsls r3, r6, 1 + adds r2, r3, r4 + ldr r0, =gUnknown_0203BC88 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r5 + adds r0, r1 + ldrb r1, [r2] + ldrb r0, [r0] + cmp r1, r0 + bne _081A9488 + adds r0, r4, 0x1 + adds r0, r3, r0 + ldrb r0, [r0] + mov r9, r0 +_081A94AE: + ldr r3, =gUnknown_08613ED8 + ldr r2, =gUnknown_02037350 + ldr r0, =gUnknown_03005DF0 + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x8] + subs r0, 0x1 + adds r0, r3 + ldrb r0, [r0] + str r0, [sp] + movs r6, 0 + mov r3, r9 + lsls r3, 2 + mov r9, r3 +_081A94D0: + ldr r0, [sp] + cmp r0, 0x8 + bls _081A94D8 + b _081A95E8 +_081A94D8: + lsls r0, 2 + ldr r1, =_081A94FC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081A94FC: + .4byte _081A9520 + .4byte _081A9530 + .4byte _081A9572 + .4byte _081A95B4 + .4byte _081A95BA + .4byte _081A95C0 + .4byte _081A95C6 + .4byte _081A95D2 + .4byte _081A95DE +_081A9520: + mov r0, sp + movs r1, 0x8 + movs r2, 0 + bl sub_81A9998 + lsls r0, 24 + lsrs r7, r0, 24 + b _081A95EE +_081A9530: + movs r6, 0 + ldr r2, =0x7fff0000 + mov r4, r8 + adds r4, 0x4 + mov r5, r8 + b _081A9560 + .pool +_081A9540: + ldrb r0, [r5, 0x1] + cmp r0, 0x3B + bne _081A955A + movs r1, 0 + ldrsh r0, [r4, r1] + asrs r1, r2, 16 + cmp r0, r1 + beq _081A955A + movs r3, 0x2 + ldrsh r0, [r4, r3] + cmp r0, r1 + beq _081A955A + adds r7, 0x1 +_081A955A: + adds r4, 0x18 + adds r5, 0x18 + adds r6, 0x1 +_081A9560: + str r2, [sp, 0x4] + bl sub_81AAA40 + lsls r0, 24 + lsrs r0, 24 + ldr r2, [sp, 0x4] + cmp r6, r0 + blt _081A9540 + b _081A95EE +_081A9572: + bl sub_81AA9E4 + lsls r0, 24 + ldr r1, =gUnknown_08613650 + lsrs r0, 20 + adds r0, r1 + ldrb r7, [r0, 0x1] + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000e2a + adds r0, r1 + ldrb r2, [r0] + ldr r1, =gBitTable + movs r6, 0x7 +_081A958E: + ldr r0, [r1] + ands r0, r2 + cmp r0, 0 + beq _081A9598 + subs r7, 0x1 +_081A9598: + adds r1, 0x4 + subs r6, 0x1 + cmp r6, 0 + bge _081A958E + b _081A95EE + .pool +_081A95B4: + mov r0, sp + movs r1, 0x8 + b _081A95D6 +_081A95BA: + mov r0, sp + movs r1, 0x8 + b _081A95CA +_081A95C0: + mov r0, sp + movs r1, 0x10 + b _081A95D6 +_081A95C6: + mov r0, sp + movs r1, 0x10 +_081A95CA: + movs r2, 0x1 + bl sub_81A9998 + b _081A95E8 +_081A95D2: + mov r0, sp + movs r1, 0x18 +_081A95D6: + movs r2, 0x2 + bl sub_81A9998 + b _081A95E8 +_081A95DE: + mov r0, sp + movs r1, 0x18 + movs r2, 0x1 + bl sub_81A9998 +_081A95E8: + cmp r6, 0 + bne _081A95EE + b _081A94D0 +_081A95EE: + ldr r1, =gUnknown_08613EC0 + add r1, r9 + ldr r0, [sp] + ldr r1, [r1] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + lsls r0, r7, 2 + adds r0, r1 + ldr r0, [r0] + bl box_related_two__2 + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9424 + + thumb_func_start sub_81A9618 +sub_81A9618: @ 81A9618 + push {r4,r5,lr} + ldr r5, =gSaveBlock2Ptr + ldr r1, [r5] + ldr r2, =0x00000ca9 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r2, r0, 29 + ldr r4, =0x00000e1a + adds r1, r4 + adds r1, r2 + ldrh r3, [r1] + ldr r0, =0x000003e6 + cmp r3, r0 + bhi _081A963A + adds r0, r3, 0x1 + strh r0, [r1] +_081A963A: + ldr r0, [r5] + adds r1, r0, r4 + adds r1, r2 + ldr r3, =0x00000e1e + adds r0, r3 + adds r0, r2 + ldrh r1, [r1] + ldrh r2, [r0] + cmp r1, r2 + bls _081A9650 + strh r1, [r0] +_081A9650: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9618 + + thumb_func_start sub_81A966C +sub_81A966C: @ 81A966C + push {r4,lr} + ldr r4, =gScriptResult + bl InBattlePyramid + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A966C + + thumb_func_start sub_81A9684 +sub_81A9684: @ 81A9684 + push {r4,lr} + ldr r0, =gSpecialVar_0x8006 + ldrh r0, [r0] + cmp r0, 0 + beq _081A9698 + cmp r0, 0x1 + beq _081A96B4 + b _081A9754 + .pool +_081A9698: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =gSpecialVar_0x8005 + ldrh r1, [r1] + ldr r2, =0x00000e68 + adds r0, r2 + strb r1, [r0] + b _081A9754 + .pool +_081A96B4: + ldr r4, =gScriptResult + ldrh r0, [r4] + cmp r0, 0x1 + beq _081A9710 + cmp r0, 0x1 + bgt _081A9754 + cmp r0, 0 + bne _081A9754 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081A9754 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000e68 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0x77 + bls _081A96F4 + movs r0, 0x78 + strb r0, [r1] + b _081A96FC + .pool +_081A96F4: + ldr r0, =gSpecialVar_0x8007 + ldrh r0, [r0] + bl PlaySE +_081A96FC: + ldr r1, =gScriptResult + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _081A9754 + .pool +_081A9710: + ldr r1, =gSpecialVar_0x8005 + ldrh r0, [r1] + cmp r0, 0 + beq _081A9750 + subs r0, 0x1 + strh r0, [r1] + ldr r3, =gSaveBlock2Ptr + ldr r1, [r3] + ldr r2, =0x00000e68 + adds r1, r2 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r3] + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0x78 + bls _081A973E + movs r0, 0x78 + strb r0, [r1] + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] +_081A973E: + bl door_upload_tiles + b _081A9754 + .pool +_081A9750: + movs r0, 0x2 + strh r0, [r4] +_081A9754: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81A9684 + + thumb_func_start sub_81A975C +sub_81A975C: @ 81A975C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + movs r1, 0 + mov r0, sp + strh r1, [r0] + movs r5, 0 + movs r0, 0x64 + mov r9, r0 + ldr r1, =gPlayerParty + mov r8, r1 +_081A9776: + movs r4, 0 + adds r7, r5, 0x1 + mov r6, r9 + muls r6, r5 +_081A977E: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, =0x00000caa + adds r0, r2 + adds r1, r0, r1 + ldrh r0, [r1] + cmp r0, 0 + beq _081A97A2 + subs r0, 0x1 + cmp r0, r5 + bne _081A97A2 + mov r1, r8 + adds r0, r6, r1 + movs r1, 0xC + mov r2, sp + bl SetMonData +_081A97A2: + adds r4, 0x1 + cmp r4, 0x3 + ble _081A977E + adds r5, r7, 0 + cmp r5, 0x5 + ble _081A9776 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A975C + + thumb_func_start sub_81A97C8 +sub_81A97C8: @ 81A97C8 + push {lr} + ldr r0, =sub_81A97DC + movs r1, 0 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A97C8 + + thumb_func_start sub_81A97DC +sub_81A97DC: @ 81A97DC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081A980C + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 5 + ldr r1, =gUnknown_08D856C8 + adds r0, r1 + ldr r1, =gPlttBufferUnfaded + 0xC0 + movs r2, 0x10 + bl CpuSet + adds r0, r4, 0 + bl DestroyTask +_081A980C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A97DC + + thumb_func_start sub_81A9828 +sub_81A9828: @ 81A9828 + push {lr} + bl sub_809FDD4 + pop {r0} + bx r0 + thumb_func_end sub_81A9828 + + thumb_func_start sub_81A9834 +sub_81A9834: @ 81A9834 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + movs r0, 0 + str r0, [sp] +_081A9844: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, [sp] + lsls r1, r2, 1 + ldr r5, =0x00000caa + adds r0, r5 + adds r0, r1 + ldrh r0, [r0] + subs r5, r0, 0x1 + movs r0, 0 + str r0, [sp, 0x4] + movs r2, 0x64 + adds r1, r5, 0 + muls r1, r2 + str r1, [sp, 0x8] + movs r0, 0x8E + lsls r0, 2 + adds r6, r1, r0 + movs r1, 0 + str r1, [sp, 0x10] +_081A986C: + ldr r2, =gSaveBlock1Ptr + ldr r0, [r2] + adds r0, r6 + movs r1, 0xB + movs r2, 0 + bl GetMonData + adds r4, r0, 0 + ldr r3, =gPlayerParty + ldr r1, [sp, 0x10] + adds r0, r1, r3 + movs r1, 0xB + movs r2, 0 + str r3, [sp, 0x14] + bl GetMonData + ldr r3, [sp, 0x14] + cmp r4, r0 + bne _081A993C + movs r6, 0 + adds r2, r5, 0x1 + str r2, [sp, 0xC] + movs r1, 0x64 + adds r0, r5, 0 + muls r0, r1 + movs r5, 0x8E + lsls r5, 2 + adds r5, r0 + mov r9, r5 + ldr r7, [sp, 0x4] + muls r7, r1 + mov r10, r3 +_081A98AC: + movs r5, 0 + adds r0, r6, 0x1 + mov r8, r0 + b _081A98C6 + .pool +_081A98C4: + adds r5, 0x1 +_081A98C6: + cmp r5, 0x3 + bgt _081A98EE + ldr r1, =gSaveBlock1Ptr + ldr r0, [r1] + add r0, r9 + adds r1, r5, 0 + adds r1, 0xD + movs r2, 0 + bl GetMonData + adds r4, r0, 0 + adds r1, r6, 0 + adds r1, 0xD + mov r2, r10 + adds r0, r7, r2 + movs r2, 0 + bl GetMonData + cmp r4, r0 + bne _081A98C4 +_081A98EE: + cmp r5, 0x4 + bne _081A9900 + lsls r2, r6, 24 + lsrs r2, 24 + mov r5, r10 + adds r0, r7, r5 + movs r1, 0xA6 + bl sub_80691F4 +_081A9900: + mov r6, r8 + cmp r6, 0x3 + ble _081A98AC + ldr r1, =gSaveBlock1Ptr + ldr r0, [r1] + ldr r2, [sp, 0x8] + adds r0, r2 + movs r5, 0x8E + lsls r5, 2 + adds r0, r5 + ldr r1, =gPlayerParty + ldr r2, [sp, 0x10] + adds r1, r2, r1 + movs r2, 0x64 + bl memcpy + ldr r0, =gUnknown_0203CEF8 + ldr r5, [sp, 0x4] + adds r0, r5, r0 + mov r1, sp + ldrb r1, [r1, 0xC] + strb r1, [r0] + b _081A994C + .pool +_081A993C: + ldr r2, [sp, 0x10] + adds r2, 0x64 + str r2, [sp, 0x10] + ldr r0, [sp, 0x4] + adds r0, 0x1 + str r0, [sp, 0x4] + cmp r0, 0x2 + ble _081A986C +_081A994C: + ldr r1, [sp] + adds r1, 0x1 + str r1, [sp] + cmp r1, 0x2 + bgt _081A9958 + b _081A9844 +_081A9958: + movs r2, 0 + str r2, [sp] + ldr r4, =gSaveBlock2Ptr + ldr r3, =0x00000caa + ldr r2, =gUnknown_0203CEF8 +_081A9962: + ldr r1, [r4] + ldr r5, [sp] + lsls r0, r5, 1 + adds r1, r3 + adds r1, r0 + adds r0, r5, r2 + ldrb r0, [r0] + strh r0, [r1] + adds r5, 0x1 + str r5, [sp] + cmp r5, 0x2 + ble _081A9962 + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9834 + + thumb_func_start sub_81A9998 +sub_81A9998: @ 81A9998 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r10, r0 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r7, r2, 24 + movs r4, 0 + ldr r0, =gUnknown_03005DC0 + ldr r5, [r0, 0x8] + ldr r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 1 + adds r0, 0xE + adds r5, r0 + movs r3, 0 + ldr r0, =0x000003ff + mov r8, r0 + ldr r1, =0x0000028e + mov r12, r1 + ldr r0, =gUnknown_02037350 + mov r9, r0 +_081A99CC: + movs r2, 0 +_081A99CE: + lsls r0, r2, 1 + adds r0, r5 + ldrh r1, [r0] + mov r0, r8 + ands r0, r1 + cmp r0, r12 + bne _081A9A8A + adds r2, 0x7 + ldr r0, =gUnknown_03005DF0 + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + add r0, r9 + movs r5, 0xC + ldrsh r1, [r0, r5] + subs r2, r1 + adds r1, r3, 0x7 + movs r3, 0xE + ldrsh r0, [r0, r3] + subs r3, r1, r0 + cmp r2, r6 + bge _081A9A0E + negs r0, r6 + cmp r2, r0 + ble _081A9A0E + cmp r3, r6 + bge _081A9A0E + cmp r3, r0 + ble _081A9A0E + cmp r7, 0 + bne _081A9A84 +_081A9A0E: + cmp r2, 0 + ble _081A9A34 + cmp r3, 0 + ble _081A9A34 + movs r4, 0x3 + cmp r2, r3 + blt _081A9A7C + movs r4, 0x2 + b _081A9A7C + .pool +_081A9A34: + cmp r2, 0 + bge _081A9A46 + cmp r3, 0 + bge _081A9A46 + movs r4, 0x1 + cmp r2, r3 + ble _081A9A7C + movs r4, 0 + b _081A9A7C +_081A9A46: + cmp r2, 0 + bne _081A9A54 + movs r4, 0 + cmp r3, 0 + ble _081A9A7C + movs r4, 0x3 + b _081A9A7C +_081A9A54: + cmp r3, 0 + bne _081A9A62 + movs r4, 0x1 + cmp r2, 0 + ble _081A9A7C + movs r4, 0x2 + b _081A9A7C +_081A9A62: + cmp r2, 0 + bge _081A9A72 + adds r0, r2, r3 + movs r4, 0x1 + cmp r0, 0 + ble _081A9A7C + movs r4, 0x3 + b _081A9A7C +_081A9A72: + adds r0, r2, r3 + mvns r0, r0 + asrs r4, r0, 31 + movs r0, 0x2 + ands r4, r0 +_081A9A7C: + movs r0, 0 + mov r5, r10 + str r0, [r5] + b _081A9A98 +_081A9A84: + mov r0, r10 + str r7, [r0] + b _081A9A98 +_081A9A8A: + adds r2, 0x1 + cmp r2, 0x1F + ble _081A99CE + adds r5, 0x5E + adds r3, 0x1 + cmp r3, 0x1F + ble _081A99CC +_081A9A98: + adds r0, r4, 0 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81A9998 + + thumb_func_start sub_81A9AA8 +sub_81A9AA8: @ 81A9AA8 + lsls r0, 24 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + lsrs r0, 23 + adds r1, r0 + ldr r0, =0x00000cb2 + adds r1, r0 + ldrh r0, [r1] + bx lr + .pool + thumb_func_end sub_81A9AA8 + + thumb_func_start GetBattlePyramidTrainerFlag +GetBattlePyramidTrainerFlag: @ 81A9AC4 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gSaveBlock2Ptr + ldr r2, [r1] + ldr r1, =0x00000e2a + adds r2, r1 + ldr r4, =gBitTable + ldr r3, =gUnknown_02037350 + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r0, [r1, 0x8] + subs r0, 0x1 + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + ldrb r1, [r2] + ands r0, r1 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end GetBattlePyramidTrainerFlag + + thumb_func_start sub_81A9B04 +sub_81A9B04: @ 81A9B04 + push {lr} + ldr r0, =gUnknown_02038BCA + ldrh r0, [r0] + bl sub_81A9B44 + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _081A9B2E + movs r0, 0x1 + bl sub_80B47E0 + ldr r1, =gUnknown_03005DF0 + strb r0, [r1] + ldr r0, =gUnknown_02038BCC + ldrh r0, [r0] + bl sub_81A9B44 +_081A9B2E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9B04 + + thumb_func_start sub_81A9B44 +sub_81A9B44: @ 81A9B44 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 16 + lsrs r5, r0, 16 + movs r3, 0 + ldr r0, =gUnknown_02037350 + mov r12, r0 + ldr r6, =gUnknown_03005DF0 + ldr r1, =gSaveBlock1Ptr + mov r10, r1 + ldr r7, =gSaveBlock2Ptr + mov r9, r7 + ldr r0, =0x00000cb4 + mov r8, r0 + ldr r4, =gBitTable +_081A9B68: + mov r1, r9 + ldr r2, [r1] + lsls r0, r3, 1 + mov r7, r8 + adds r1, r2, r7 + adds r1, r0 + ldrh r0, [r1] + cmp r0, r5 + bne _081A9B86 + ldr r1, =0x00000e2a + adds r0, r2, r1 + ldr r1, [r4] + ldrb r2, [r0] + orrs r1, r2 + strb r1, [r0] +_081A9B86: + adds r4, 0x4 + adds r3, 0x1 + cmp r3, 0x7 + ble _081A9B68 + ldrb r1, [r6] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + add r0, r12 + movs r3, 0x2 + strb r3, [r0, 0x6] + mov r7, r10 + ldr r2, [r7] + ldr r0, =gScriptLastTalked + ldrh r1, [r0] + subs r1, 0x1 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r2, r0 + ldr r1, =0x00000c79 + adds r2, r1 + strb r3, [r2] + ldrb r1, [r6] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + add r0, r12 + ldrh r1, [r0, 0x10] + strh r1, [r0, 0xC] + ldrb r1, [r6] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + add r0, r12 + ldrh r1, [r0, 0x12] + strh r1, [r0, 0xE] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9B44 + + thumb_func_start sub_81A9C04 +sub_81A9C04: @ 81A9C04 + push {r4-r6,lr} + sub sp, 0x14 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r2, =0x00000ca9 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + lsls r0, r5, 1 + ldr r2, =0x00000e1a + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x14 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x13 + bls _081A9C3A + movs r0, 0x13 +_081A9C3A: + cmp r5, 0 + beq _081A9C54 + ldr r1, =gBattlePyramidOpenLevelWildMonPointers + b _081A9C56 + .pool +_081A9C54: + ldr r1, =gBattlePyramidLevel50WildMonPointers +_081A9C56: + lsls r0, 2 + adds r0, r1 + ldr r6, [r0] + ldr r4, =gEnemyParty + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl GetMonData + subs r0, 0x1 + str r0, [sp, 0x10] + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 2 + adds r2, r6, r2 + adds r0, r4, 0 + movs r1, 0xB + bl SetMonData + ldr r1, [sp, 0x10] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrh r1, [r0] + mov r0, sp + bl GetSpeciesName + adds r0, r4, 0 + movs r1, 0x2 + mov r2, sp + bl SetMonData + cmp r5, 0 + beq _081A9CD4 + bl sub_8165C40 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, [sp, 0x10] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x2] + subs r5, r0 + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xB + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + subs r0, 0x5 + adds r5, r0 + b _081A9CF6 + .pool +_081A9CD4: + bl Random + ldr r2, [sp, 0x10] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r6 + ldrb r4, [r1, 0x2] + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xB + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + subs r0, 0x5 + adds r5, r4, r0 +_081A9CF6: + ldr r4, =gEnemyParty + ldr r2, =gBaseStats + ldr r1, [sp, 0x10] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrh r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x13] + movs r0, 0xCA + lsls r0, 1 + adds r2, r1, 0 + muls r2, r0 + lsls r0, r5, 2 + ldr r1, =gExperienceTables + adds r0, r1 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x19 + bl SetMonData + ldr r1, [sp, 0x10] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r1, [r0, 0x3] + cmp r1, 0 + blt _081A9D4C + cmp r1, 0x1 + bgt _081A9D4C + adds r2, r0, 0x3 + b _081A9D7C + .pool +_081A9D4C: + ldr r2, =gBaseStats + ldr r1, [sp, 0x10] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrh r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x17] + cmp r0, 0 + beq _081A9D90 + ldr r4, =gEnemyParty + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl GetMonData + movs r1, 0x1 + ands r1, r0 + str r1, [sp, 0xC] + add r2, sp, 0xC +_081A9D7C: + adds r0, r4, 0 + movs r1, 0x2E + bl SetMonData + b _081A9D9C + .pool +_081A9D90: + str r0, [sp, 0xC] + ldr r0, =gEnemyParty + add r2, sp, 0xC + movs r1, 0x2E + bl SetMonData +_081A9D9C: + movs r0, 0 + str r0, [sp, 0xC] + movs r2, 0 + lsls r4, r5, 1 +_081A9DA4: + ldr r1, [sp, 0x10] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + lsls r1, r2, 1 + adds r0, 0x4 + adds r0, r1 + ldrh r1, [r0] + lsls r2, 24 + lsrs r2, 24 + ldr r0, =gEnemyParty + bl sub_80691F4 + ldr r0, [sp, 0xC] + adds r0, 0x1 + str r0, [sp, 0xC] + adds r2, r0, 0 + cmp r2, 0x3 + ble _081A9DA4 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000e1a + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + cmp r0, 0x8B + bls _081A9E0C + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x11 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + adds r0, 0xF + str r0, [sp, 0x10] + movs r0, 0 + str r0, [sp, 0xC] +_081A9DF6: + adds r1, r0, 0 + adds r1, 0x27 + ldr r0, =gEnemyParty + add r2, sp, 0x10 + bl SetMonData + ldr r0, [sp, 0xC] + adds r0, 0x1 + str r0, [sp, 0xC] + cmp r0, 0x5 + ble _081A9DF6 +_081A9E0C: + ldr r0, =gEnemyParty + bl pokemon_calc_effective_stats + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9C04 + + thumb_func_start sub_81A9E28 +sub_81A9E28: @ 81A9E28 + push {lr} + bl sub_81AA9E4 + lsls r0, 24 + ldr r1, =gUnknown_08613650 + lsrs r0, 20 + adds r0, r1 + ldrb r0, [r0, 0x4] + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A9E28 + + thumb_func_start InBattlePyramid +InBattlePyramid: @ 81A9E40 + push {lr} + ldr r0, =gUnknown_02037318 + ldrh r1, [r0, 0x12] + ldr r0, =0x00000169 + cmp r1, r0 + bne _081A9E58 + movs r0, 0x1 + b _081A9E66 + .pool +_081A9E58: + movs r0, 0xBD + lsls r0, 1 + cmp r1, r0 + beq _081A9E64 + movs r0, 0 + b _081A9E66 +_081A9E64: + movs r0, 0x2 +_081A9E66: + pop {r1} + bx r1 + thumb_func_end InBattlePyramid + + thumb_func_start sub_81A9E6C +sub_81A9E6C: @ 81A9E6C + push {lr} + movs r2, 0 + ldr r0, =gUnknown_02037318 + ldrh r1, [r0, 0x12] + ldr r0, =0x00000169 + cmp r1, r0 + beq _081A9E80 + adds r0, 0x11 + cmp r1, r0 + bne _081A9E82 +_081A9E80: + movs r2, 0x1 +_081A9E82: + adds r0, r2, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A9E6C + + thumb_func_start sub_81A9E90 +sub_81A9E90: @ 81A9E90 + push {lr} + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _081A9EB8 + bl sub_81A9834 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000ca8 + adds r0, r1 + movs r1, 0x2 + strb r1, [r0] + ldr r0, =0x0000400e + movs r1, 0 + bl VarSet + bl copy_player_party_from_sav1 +_081A9EB8: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9E90 + + thumb_func_start sub_81A9EC8 +sub_81A9EC8: @ 81A9EC8 + push {lr} + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _081A9ED8 + bl DoSoftReset +_081A9ED8: + pop {r0} + bx r0 + thumb_func_end sub_81A9EC8 + + thumb_func_start sub_81A9EDC +sub_81A9EDC: @ 81A9EDC + push {lr} + lsls r0, 16 + lsrs r0, 16 + ldr r2, =gUnknown_0203BC88 + movs r1, 0x34 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0xC + bl ConvertBattleFrontierTrainerSpeechToString + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9EDC + + thumb_func_start sub_81A9EFC +sub_81A9EFC: @ 81A9EFC + push {lr} + lsls r0, 16 + lsrs r0, 16 + ldr r2, =gUnknown_0203BC88 + movs r1, 0x34 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0x18 + bl ConvertBattleFrontierTrainerSpeechToString + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9EFC + + thumb_func_start sub_81A9F1C +sub_81A9F1C: @ 81A9F1C + push {lr} + lsls r0, 16 + lsrs r0, 16 + ldr r2, =gUnknown_0203BC88 + movs r1, 0x34 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0x24 + bl ConvertBattleFrontierTrainerSpeechToString + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9F1C + + thumb_func_start sub_81A9F3C +sub_81A9F3C: @ 81A9F3C + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + movs r4, 0 + ldr r3, =gTrainerClassNameIndices + ldr r1, =gUnknown_0203BC88 + ldr r2, [r1] + movs r1, 0x34 + muls r0, r1 + adds r0, r2 + ldrb r0, [r0] + adds r0, r3 + ldrb r2, [r0] + ldr r1, =gUnknown_08613B44 +_081A9F58: + ldrb r0, [r1] + cmp r0, r2 + bne _081A9F70 + ldrb r0, [r1, 0x1] + b _081A9F7A + .pool +_081A9F70: + adds r1, 0x4 + adds r4, 0x1 + cmp r4, 0x35 + bls _081A9F58 + movs r0, 0 +_081A9F7A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81A9F3C + + thumb_func_start sub_81A9F80 +sub_81A9F80: @ 81A9F80 + push {lr} + ldr r0, =gUnknown_08252C88 + bl script_env_1_execute_new_script + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A9F80 + + thumb_func_start sub_81A9F90 +sub_81A9F90: @ 81A9F90 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gSaveBlock2Ptr + ldr r4, [r0] + ldr r1, =0x00000ca9 + adds r0, r4, r1 + ldrb r1, [r0] + lsls r1, 30 + lsrs r1, 29 + ldr r2, =0x00000e1a + adds r0, r4, r2 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x00000cb2 + adds r4, r1 + ldrh r1, [r4] + cmp r1, 0x7 + bne _081AA020 + adds r0, 0x1 + lsls r7, r0, 24 + lsls r1, 24 + mov r8, r1 +_081A9FCC: + lsrs r0, r7, 24 + mov r2, r8 + lsrs r1, r2, 24 + bl sub_8162548 + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0 + cmp r2, r5 + bge _081AA004 + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r4, =0x00000cb4 + adds r0, r4 + ldrh r0, [r0] + cmp r0, r3 + beq _081AA004 + adds r6, r1, 0 +_081A9FF0: + adds r2, 0x1 + cmp r2, r5 + bge _081AA004 + ldr r0, [r6] + lsls r1, r2, 1 + adds r0, r4 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r3 + bne _081A9FF0 +_081AA004: + cmp r2, r5 + bne _081A9FCC + b _081AA062 + .pool +_081AA020: + lsls r1, 24 + mov r8, r1 + lsls r7, r0, 24 +_081AA026: + lsrs r0, r7, 24 + mov r2, r8 + lsrs r1, r2, 24 + bl sub_8162548 + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0 + cmp r2, r5 + bge _081AA05E + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r4, =0x00000cb4 + adds r0, r4 + ldrh r0, [r0] + cmp r0, r3 + beq _081AA05E + adds r6, r1, 0 +_081AA04A: + adds r2, 0x1 + cmp r2, r5 + bge _081AA05E + ldr r0, [r6] + lsls r1, r2, 1 + adds r0, r4 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r3 + bne _081AA04A +_081AA05E: + cmp r2, r5 + bne _081AA026 +_081AA062: + adds r0, r3, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81A9F90 + + thumb_func_start sub_81AA078 +sub_81AA078: @ 81AA078 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + str r0, [sp, 0x4] + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x8] + movs r0, 0x10 + bl AllocZeroed + str r0, [sp, 0xC] + bl sub_81AA96C + mov r4, sp + adds r4, 0x1 + mov r0, sp + adds r1, r4, 0 + bl sub_81AA33C + movs r7, 0 +_081AA0A6: + ldr r1, [sp, 0xC] + adds r0, r1, r7 + ldrb r0, [r0] + ldr r2, =0x00000169 + adds r0, r2 + lsls r0, 2 + ldr r1, =gUnknown_08481DD4 + adds r0, r1 + ldr r6, [r0] + ldr r2, [r6, 0xC] + mov r10, r2 + ldr r0, [sp, 0x4] + ldr r1, =gUnknown_03005DC0 + str r0, [r1, 0x8] + ldr r0, [r6] + lsls r0, 2 + adds r2, r0, 0 + adds r2, 0xF + str r2, [r1] + ldr r0, [r6, 0x4] + lsls r0, 2 + adds r0, 0xE + str r0, [r1, 0x4] + ldr r0, [sp, 0x4] + mov r9, r0 + adds r1, r7, 0 + cmp r7, 0 + bge _081AA0E0 + adds r1, r7, 0x3 +_081AA0E0: + asrs r1, 2 + ldr r4, [r6, 0x4] + adds r0, r1, 0 + muls r0, r4 + adds r0, 0x7 + muls r2, r0 + lsls r1, 2 + subs r1, r7, r1 + ldr r3, [r6] + adds r0, r1, 0 + muls r0, r3 + adds r0, 0x7 + adds r2, r0 + lsls r2, 1 + add r9, r2 + movs r1, 0 + mov r8, r1 + adds r2, r7, 0x1 + str r2, [sp, 0x10] + cmp r8, r4 + bge _081AA1B6 +_081AA10A: + movs r0, 0 + mov r12, r0 + mov r1, r8 + adds r1, 0x1 + str r1, [sp, 0x14] + cmp r12, r3 + bge _081AA1A2 + ldr r2, =gSaveBlock1Ptr + str r2, [sp, 0x18] + mov r4, r9 + mov r5, r10 +_081AA120: + ldrh r1, [r5] + ldr r0, =0x000003ff + ands r0, r1 + ldr r2, =0x0000028e + cmp r0, r2 + bne _081AA194 + mov r0, sp + ldrb r0, [r0, 0x1] + cmp r7, r0 + beq _081AA194 + mov r0, sp + ldrb r0, [r0] + cmp r7, r0 + bne _081AA164 + ldr r1, [sp, 0x8] + cmp r1, 0 + bne _081AA164 + ldr r2, [sp, 0x18] + ldr r3, [r2] + adds r2, r7, 0 + cmp r7, 0 + bge _081AA14E + adds r2, r7, 0x3 +_081AA14E: + asrs r2, 2 + lsls r1, r2, 2 + subs r1, r7, r1 + ldr r0, [r6] + muls r0, r1 + add r0, r12 + strh r0, [r3] + ldr r0, [r6, 0x4] + muls r0, r2 + add r0, r8 + strh r0, [r3, 0x2] +_081AA164: + ldrh r0, [r5] + movs r1, 0xFC + lsls r1, 8 + ands r1, r0 + ldr r2, =0x0000028d + adds r0, r2, 0 + orrs r1, r0 + strh r1, [r4] + ldr r3, [r6] + b _081AA196 + .pool +_081AA194: + strh r1, [r4] +_081AA196: + adds r4, 0x2 + adds r5, 0x2 + movs r0, 0x1 + add r12, r0 + cmp r12, r3 + blt _081AA120 +_081AA1A2: + lsls r0, r3, 3 + adds r0, 0x1E + add r9, r0 + lsls r0, r3, 1 + add r10, r0 + ldr r1, [sp, 0x14] + mov r8, r1 + ldr r0, [r6, 0x4] + cmp r8, r0 + blt _081AA10A +_081AA1B6: + ldr r7, [sp, 0x10] + cmp r7, 0xF + bgt _081AA1BE + b _081AA0A6 +_081AA1BE: + bl mapheader_run_script_with_tag_x1 + ldr r0, [sp, 0xC] + bl Free + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81AA078 + + thumb_func_start sub_81AA1D8 +sub_81AA1D8: @ 81AA1D8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + movs r5, 0 + mov r6, sp + adds r6, 0x1 + add r0, sp, 0x4 + mov r8, r0 + ldr r4, =gSaveBlock2Ptr + ldr r3, =0x00000cb4 + ldr r0, =0x0000ffff + adds r2, r0, 0 +_081AA1F2: + ldr r0, [r4] + lsls r1, r5, 1 + adds r0, r3 + adds r0, r1 + ldrh r1, [r0] + orrs r1, r2 + strh r1, [r0] + adds r5, 0x1 + cmp r5, 0x7 + ble _081AA1F2 + bl sub_81AA9E4 + lsls r0, 24 + lsrs r7, r0, 24 + mov r0, sp + adds r1, r6, 0 + bl sub_81AA33C + movs r0, 0 + str r0, [sp, 0x4] + ldr r0, =gSaveBlock1Ptr + ldr r1, [r0] + movs r0, 0xC7 + lsls r0, 4 + adds r1, r0 + ldr r2, =0x05000180 + mov r0, r8 + bl CpuSet + movs r5, 0 +_081AA22E: + cmp r5, 0 + bne _081AA254 + ldr r1, =gUnknown_08613650 + lsls r0, r7, 4 + adds r0, r1 + ldrb r0, [r0, 0x3] + b _081AA25C + .pool +_081AA254: + ldr r1, =gUnknown_08613650 + lsls r0, r7, 4 + adds r0, r1 + ldrb r0, [r0, 0x2] +_081AA25C: + cmp r0, 0x4 + bhi _081AA2E4 + lsls r0, 2 + ldr r1, =_081AA274 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081AA274: + .4byte _081AA288 + .4byte _081AA292 + .4byte _081AA2A2 + .4byte _081AA2B0 + .4byte _081AA2CC +_081AA288: + lsls r0, r5, 24 + lsrs r0, 24 + bl sub_81AA398 + b _081AA2E4 +_081AA292: + lsls r0, r5, 24 + lsrs r4, r0, 24 + mov r0, sp + ldrb r1, [r0] + adds r0, r4, 0 + bl sub_81AA4D8 + b _081AA2BE +_081AA2A2: + lsls r0, r5, 24 + lsrs r4, r0, 24 + ldrb r1, [r6] + adds r0, r4, 0 + bl sub_81AA4D8 + b _081AA2BE +_081AA2B0: + lsls r0, r5, 24 + lsrs r4, r0, 24 + mov r0, sp + ldrb r1, [r0] + adds r0, r4, 0 + bl sub_81AA648 +_081AA2BE: + lsls r0, 24 + cmp r0, 0 + beq _081AA2E4 + adds r0, r4, 0 + bl sub_81AA398 + b _081AA2E4 +_081AA2CC: + lsls r0, r5, 24 + lsrs r4, r0, 24 + ldrb r1, [r6] + adds r0, r4, 0 + bl sub_81AA648 + lsls r0, 24 + cmp r0, 0 + beq _081AA2E4 + adds r0, r4, 0 + bl sub_81AA398 +_081AA2E4: + adds r5, 0x1 + cmp r5, 0x1 + ble _081AA22E + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81AA1D8 + + thumb_func_start sub_81AA2F8 +sub_81AA2F8: @ 81AA2F8 + push {r4,r5,lr} + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r5, =gUnknown_08252C4F + ldr r4, =gUnknown_08252C6A + movs r2, 0xC8 + lsls r2, 4 + adds r1, r0, r2 + movs r3, 0xC7 + lsls r3, 4 + adds r2, r0, r3 + movs r3, 0x3F +_081AA310: + ldrb r0, [r2, 0x1] + cmp r0, 0x3B + beq _081AA328 + str r5, [r1] + b _081AA32A + .pool +_081AA328: + str r4, [r1] +_081AA32A: + adds r1, 0x18 + adds r2, 0x18 + subs r3, 0x1 + cmp r3, 0 + bge _081AA310 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81AA2F8 + + thumb_func_start sub_81AA33C +sub_81AA33C: @ 81AA33C + push {r4-r7,lr} + adds r4, r0, 0 + adds r6, r1, 0 + ldr r5, =gSaveBlock2Ptr + ldr r1, [r5] + ldr r2, =0x00000e28 + adds r0, r1, r2 + ldrh r2, [r0] + movs r3, 0xF + ands r2, r3 + strb r2, [r4] + ldr r7, =0x00000e22 + adds r1, r7 + ldrh r0, [r1] + ands r0, r3 + strb r0, [r6] + cmp r2, r0 + bne _081AA386 + ldr r1, [r5] + ldr r2, =0x00000e28 + adds r0, r1, r2 + ldrh r2, [r0] + adds r3, r2, 0x1 + adds r0, r3, 0 + asrs r0, 4 + lsls r0, 4 + subs r0, r3, r0 + strb r0, [r4] + adds r0, r1, r7 + ldrh r1, [r0] + adds r2, r1, 0 + adds r2, 0xF + adds r0, r2, 0 + asrs r0, 4 + lsls r0, 4 + subs r0, r2, r0 + strb r0, [r6] +_081AA386: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AA33C + + thumb_func_start sub_81AA398 +sub_81AA398: @ 81AA398 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r5, 0 + bl sub_81AA9E4 + lsls r0, 24 + lsrs r6, r0, 24 + movs r0, 0x10 + bl AllocZeroed + str r0, [sp, 0x8] + bl sub_81AA96C + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000e26 + adds r0, r1 + ldrh r4, [r0] + movs r0, 0xF + ands r4, r0 + ldr r0, [sp] + cmp r0, 0 + bne _081AA3F0 + ldr r1, =gUnknown_08613650 + lsls r0, r6, 4 + adds r0, r1 + ldrb r0, [r0, 0x1] + mov r10, r0 + movs r1, 0 + str r1, [sp, 0x4] + b _081AA3FE + .pool +_081AA3F0: + ldr r1, =gUnknown_08613650 + lsls r0, r6, 4 + adds r0, r1 + ldrb r1, [r0] + mov r10, r1 + ldrb r0, [r0, 0x1] + str r0, [sp, 0x4] +_081AA3FE: + movs r0, 0 + mov r8, r0 + cmp r8, r10 + bge _081AA4C0 +_081AA406: + movs r1, 0x1 + add r1, r8 + mov r9, r1 + b _081AA42E + .pool +_081AA414: + lsls r2, r4, 24 + lsrs r2, 24 + ldr r3, [sp, 0x4] + add r3, r8 + lsls r3, 24 + lsrs r3, 24 + ldr r0, [sp] + ldr r1, [sp, 0x8] + bl sub_81AA760 + lsls r0, 24 + cmp r0, 0 + beq _081AA4B6 +_081AA42E: + ldr r0, =gBitTable + mov r12, r0 + ldr r6, =gSaveBlock2Ptr + ldr r7, =0x00000e28 + movs r3, 0x2 + lsls r0, r4, 2 + mov r1, r12 + adds r2, r0, r1 +_081AA43E: + movs r0, 0x1 + ands r0, r5 + cmp r0, 0 + beq _081AA464 + ldr r0, [r6] + adds r0, r7 + ldrh r1, [r0] + ldr r0, [r2] + ands r0, r1 + cmp r0, 0 + bne _081AA474 + b _081AA472 + .pool +_081AA464: + ldr r0, [r6] + adds r0, r7 + ldrh r1, [r0] + ldr r0, [r2] + ands r0, r1 + cmp r0, 0 + beq _081AA474 +_081AA472: + orrs r5, r3 +_081AA474: + adds r2, 0x4 + adds r4, 0x1 + cmp r4, 0xF + ble _081AA480 + mov r2, r12 + movs r4, 0 +_081AA480: + ldr r0, [r6] + ldr r1, =0x00000e26 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0xF + ands r1, r0 + cmp r4, r1 + bne _081AA4A6 + movs r1, 0x1 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _081AA4A4 + movs r0, 0x6 + orrs r5, r0 + b _081AA4A6 + .pool +_081AA4A4: + orrs r5, r1 +_081AA4A6: + adds r0, r5, 0 + ands r0, r3 + cmp r0, 0 + beq _081AA43E + movs r0, 0x4 + ands r0, r5 + cmp r0, 0 + beq _081AA414 +_081AA4B6: + movs r0, 0x1 + ands r5, r0 + mov r8, r9 + cmp r8, r10 + blt _081AA406 +_081AA4C0: + ldr r0, [sp, 0x8] + bl Free + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81AA398 + + thumb_func_start sub_81AA4D8 +sub_81AA4D8: @ 81AA4D8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x4] + movs r6, 0 + movs r7, 0 + movs r0, 0 + str r0, [sp, 0xC] + bl sub_81AA9E4 + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x10 + bl AllocZeroed + str r0, [sp, 0x14] + bl sub_81AA96C + ldr r1, [sp] + cmp r1, 0 + bne _081AA524 + ldr r1, =gUnknown_08613650 + lsls r0, r4, 4 + adds r0, r1 + ldrb r0, [r0, 0x1] + str r0, [sp, 0x10] + movs r0, 0 + b _081AA530 + .pool +_081AA524: + ldr r1, =gUnknown_08613650 + lsls r0, r4, 4 + adds r0, r1 + ldrb r2, [r0] + str r2, [sp, 0x10] + ldrb r0, [r0, 0x1] +_081AA530: + movs r3, 0 + str r3, [sp, 0x8] + ldr r1, [sp, 0x10] + asrs r1, 31 + str r1, [sp, 0x18] + ldr r2, [sp, 0x10] + cmp r3, r2 + bge _081AA622 + str r0, [sp, 0x1C] + adds r3, r0, 0 + lsls r3, 24 + mov r9, r3 +_081AA548: + cmp r7, 0 + bne _081AA56E + mov r0, r9 + lsrs r3, r0, 24 + ldr r0, [sp] + ldr r1, [sp, 0x14] + ldr r2, [sp, 0x4] + bl sub_81AA760 + lsls r0, 24 + cmp r0, 0 + beq _081AA568 + movs r7, 0x1 + b _081AA56E + .pool +_081AA568: + ldr r1, [sp, 0xC] + adds r1, 0x1 + str r1, [sp, 0xC] +_081AA56E: + movs r0, 0x1 + ands r0, r7 + cmp r0, 0 + beq _081AA600 + ldr r2, =gUnknown_08613F46 + mov r8, r2 + ldr r3, [sp, 0x4] + lsls r4, r3, 2 + adds r0, r6, r4 + add r0, r8 + ldrb r2, [r0] + mov r0, r9 + lsrs r3, r0, 24 + ldr r0, [sp] + ldr r1, [sp, 0x14] + bl sub_81AA760 + lsls r0, 24 + ldr r1, [sp, 0x1C] + mov r10, r1 + adds r5, r4, 0 + cmp r0, 0 + beq _081AA5E8 + ldr r4, [sp, 0xC] + adds r4, 0x1 + b _081AA5C2 + .pool +_081AA5A8: + adds r0, r6, r5 + adds r0, r2 + ldrb r2, [r0] + mov r0, r10 + lsls r3, r0, 24 + lsrs r3, 24 + ldr r0, [sp] + ldr r1, [sp, 0x14] + bl sub_81AA760 + lsls r0, 24 + cmp r0, 0 + beq _081AA5E0 +_081AA5C2: + adds r6, 0x1 + ldr r0, =gUnknown_08613F46 + adds r1, r6, r5 + adds r1, r0 + ldrb r1, [r1] + adds r2, r0, 0 + cmp r1, 0xFF + beq _081AA5D6 + cmp r6, 0x3 + ble _081AA5D8 +_081AA5D6: + movs r6, 0 +_081AA5D8: + adds r7, 0x2 + asrs r0, r7, 1 + cmp r0, 0x4 + bne _081AA5A8 +_081AA5E0: + str r4, [sp, 0xC] + b _081AA600 + .pool +_081AA5E8: + adds r6, 0x1 + adds r0, r6, r4 + add r0, r8 + ldrb r0, [r0] + cmp r0, 0xFF + beq _081AA5F8 + cmp r6, 0x3 + ble _081AA5FA +_081AA5F8: + movs r6, 0 +_081AA5FA: + ldr r1, [sp, 0xC] + adds r1, 0x1 + str r1, [sp, 0xC] +_081AA600: + asrs r0, r7, 1 + cmp r0, 0x4 + beq _081AA622 + movs r0, 0x1 + ands r7, r0 + ldr r2, [sp, 0x1C] + adds r2, 0x1 + str r2, [sp, 0x1C] + movs r3, 0x80 + lsls r3, 17 + add r9, r3 + ldr r0, [sp, 0x8] + adds r0, 0x1 + str r0, [sp, 0x8] + ldr r1, [sp, 0x10] + cmp r0, r1 + blt _081AA548 +_081AA622: + movs r1, 0 + ldr r2, [sp, 0x10] + ldr r3, [sp, 0x18] + subs r0, r2, r3 + asrs r0, 1 + ldr r2, [sp, 0xC] + cmp r0, r2 + ble _081AA634 + movs r1, 0x1 +_081AA634: + adds r0, r1, 0 + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81AA4D8 + + thumb_func_start sub_81AA648 +sub_81AA648: @ 81AA648 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + lsls r1, 24 + lsrs r6, r1, 24 + movs r4, 0 + movs r7, 0 + movs r0, 0 + mov r8, r0 + bl sub_81AA9E4 + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x10 + bl AllocZeroed + str r0, [sp, 0x8] + bl sub_81AA96C + ldr r1, [sp] + cmp r1, 0 + bne _081AA694 + ldr r1, =gUnknown_08613650 + lsls r0, r5, 4 + adds r0, r1 + ldrb r0, [r0, 0x1] + mov r10, r0 + movs r0, 0 + b _081AA6A0 + .pool +_081AA694: + ldr r1, =gUnknown_08613650 + lsls r0, r5, 4 + adds r0, r1 + ldrb r2, [r0] + mov r10, r2 + ldrb r0, [r0, 0x1] +_081AA6A0: + movs r3, 0 + str r3, [sp, 0x4] + mov r1, r10 + asrs r1, 31 + str r1, [sp, 0xC] + cmp r3, r10 + bge _081AA73E + ldr r2, =gUnknown_08613F46 + mov r9, r2 + lsls r5, r6, 2 + lsls r6, r0, 24 +_081AA6B6: + adds r0, r4, r5 + add r0, r9 + ldrb r2, [r0] + lsrs r3, r6, 24 + ldr r0, [sp] + ldr r1, [sp, 0x8] + bl sub_81AA760 + lsls r0, 24 + cmp r0, 0 + beq _081AA714 + adds r7, 0x1 + b _081AA6EE + .pool +_081AA6D8: + adds r0, r4, r5 + adds r0, r1 + ldrb r2, [r0] + lsrs r3, r6, 24 + ldr r0, [sp] + ldr r1, [sp, 0x8] + bl sub_81AA760 + lsls r0, 24 + cmp r0, 0 + beq _081AA728 +_081AA6EE: + adds r4, 0x1 + adds r0, r4, r5 + add r0, r9 + ldrb r0, [r0] + ldr r1, =gUnknown_08613F46 + cmp r0, 0xFF + beq _081AA700 + cmp r4, 0x3 + ble _081AA702 +_081AA700: + movs r4, 0 +_081AA702: + movs r3, 0x1 + add r8, r3 + mov r0, r8 + cmp r0, 0x4 + bne _081AA6D8 + b _081AA728 + .pool +_081AA714: + adds r4, 0x1 + adds r0, r4, r5 + add r0, r9 + ldrb r0, [r0] + cmp r0, 0xFF + beq _081AA724 + cmp r4, 0x3 + ble _081AA726 +_081AA724: + movs r4, 0 +_081AA726: + adds r7, 0x1 +_081AA728: + mov r1, r8 + cmp r1, 0x4 + beq _081AA73E + movs r2, 0x80 + lsls r2, 17 + adds r6, r2 + ldr r3, [sp, 0x4] + adds r3, 0x1 + str r3, [sp, 0x4] + cmp r3, r10 + blt _081AA6B6 +_081AA73E: + movs r1, 0 + mov r2, r10 + ldr r3, [sp, 0xC] + subs r0, r2, r3 + asrs r0, 1 + cmp r0, r7 + ble _081AA74E + movs r1, 0x1 +_081AA74E: + adds r0, r1, 0 + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81AA648 + + thumb_func_start sub_81AA760 +sub_81AA760: @ 81AA760 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + mov r10, r1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 24 + lsrs r7, r3, 24 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000e22 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081AA7D0 + movs r6, 0x7 +_081AA792: + movs r4, 0x7 + lsls r5, r6, 24 +_081AA796: + lsls r1, r4, 24 + lsrs r1, 24 + mov r0, r8 + str r0, [sp] + str r7, [sp, 0x4] + mov r0, r9 + lsrs r2, r5, 24 + mov r3, r10 + bl sub_81AA810 + lsls r0, 24 + cmp r0, 0 + beq _081AA7CC + subs r4, 0x1 + cmp r4, 0 + bge _081AA796 + subs r6, 0x1 + movs r1, 0x1 + negs r1, r1 + cmp r6, r1 + bgt _081AA792 + b _081AA7FC + .pool +_081AA7CC: + movs r0, 0 + b _081AA7FE +_081AA7D0: + movs r6, 0 +_081AA7D2: + movs r4, 0 + lsls r5, r6, 24 +_081AA7D6: + lsls r1, r4, 24 + lsrs r1, 24 + mov r0, r8 + str r0, [sp] + str r7, [sp, 0x4] + mov r0, r9 + lsrs r2, r5, 24 + mov r3, r10 + bl sub_81AA810 + lsls r0, 24 + cmp r0, 0 + beq _081AA7CC + adds r4, 0x1 + cmp r4, 0x7 + ble _081AA7D6 + adds r6, 0x1 + cmp r6, 0x7 + ble _081AA7D2 +_081AA7FC: + movs r0, 0x1 +_081AA7FE: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81AA760 + + thumb_func_start sub_81AA810 +sub_81AA810: @ 81AA810 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + ldr r4, [sp, 0x34] + ldr r5, [sp, 0x38] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x4] + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r4, 24 + lsrs r4, 24 + mov r10, r4 + lsls r5, 24 + lsrs r6, r5, 24 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0xC7 + lsls r1, 4 + adds r1, r0, r1 + str r1, [sp, 0x8] + add r3, r10 + ldrb r1, [r3] + adds r1, 0x2C + movs r0, 0x19 + bl get_mapheader_by_bank_and_number + adds r5, r0, 0 + movs r7, 0 + ldr r1, [r5, 0x4] + ldrb r2, [r1] + cmp r7, r2 + bge _081AA95A + movs r0, 0x3 + ands r0, r4 + lsls r0, 3 + str r0, [sp, 0xC] +_081AA868: + ldr r1, [r1, 0x4] + lsls r2, r7, 1 + adds r0, r2, r7 + lsls r0, 3 + adds r3, r0, r1 + movs r4, 0x4 + ldrsh r0, [r3, r4] + ldr r1, [r5, 0x4] + mov r12, r1 + mov r9, r2 + ldr r2, [sp, 0x4] + cmp r0, r2 + bne _081AA950 + movs r4, 0x6 + ldrsh r0, [r3, r4] + cmp r0, r8 + bne _081AA950 + ldr r0, [sp] + cmp r0, 0 + bne _081AA896 + ldrb r0, [r3, 0x1] + cmp r0, 0x3B + bne _081AA8A2 +_081AA896: + ldr r1, [sp] + cmp r1, 0x1 + bne _081AA950 + ldrb r0, [r3, 0x1] + cmp r0, 0x3B + bne _081AA950 +_081AA8A2: + movs r3, 0 + ldr r2, [r5, 0x4] + mov r12, r2 + cmp r3, r6 + bge _081AA8DC + ldr r4, [sp, 0x4] + ldr r0, [sp, 0xC] + adds r4, r0 + str r4, [sp, 0x10] + mov r1, r10 + lsrs r0, r1, 2 + lsls r0, 3 + mov r2, r8 + adds r1, r2, r0 + ldr r2, [sp, 0x8] + adds r2, 0x4 +_081AA8C2: + movs r4, 0 + ldrsh r0, [r2, r4] + ldr r4, [sp, 0x10] + cmp r0, r4 + bne _081AA8D4 + movs r4, 0x2 + ldrsh r0, [r2, r4] + cmp r0, r1 + beq _081AA8DC +_081AA8D4: + adds r2, 0x18 + adds r3, 0x1 + cmp r3, r6 + blt _081AA8C2 +_081AA8DC: + cmp r3, r6 + bne _081AA950 + lsls r0, r6, 1 + mov r8, r0 + adds r0, r6 + lsls r0, 3 + ldr r1, [sp, 0x8] + adds r5, r0, r1 + mov r3, r12 + ldr r2, [r3, 0x4] + mov r4, r9 + adds r1, r4, r7 + lsls r1, 3 + adds r0, r5, 0 + adds r1, r2 + ldm r1!, {r2-r4} + stm r0!, {r2-r4} + ldm r1!, {r2-r4} + stm r0!, {r2-r4} + ldrh r0, [r5, 0x4] + ldr r1, [sp, 0xC] + adds r0, r1 + strh r0, [r5, 0x4] + mov r2, r10 + lsrs r0, r2, 2 + lsls r0, 3 + ldrh r3, [r5, 0x6] + adds r0, r3 + strh r0, [r5, 0x6] + adds r0, r6, 0x1 + strb r0, [r5] + ldrb r0, [r5, 0x1] + cmp r0, 0x3B + beq _081AA940 + adds r0, r6, 0 + bl sub_81A9F90 + lsls r0, 16 + lsrs r7, r0, 16 + adds r4, r7, 0 + adds r0, r4, 0 + bl sub_81627A4 + strb r0, [r5, 0x1] + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =0x00000cb4 + adds r0, r1 + add r0, r8 + strh r4, [r0] +_081AA940: + movs r0, 0 + b _081AA95C + .pool +_081AA950: + adds r7, 0x1 + mov r1, r12 + ldrb r2, [r1] + cmp r7, r2 + blt _081AA868 +_081AA95A: + movs r0, 0x1 +_081AA95C: + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81AA810 + + thumb_func_start sub_81AA96C +sub_81AA96C: @ 81AA96C + push {r4-r7,lr} + adds r6, r0, 0 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000e22 + adds r1, r0, r2 + ldrh r4, [r1] + ldr r1, =0x00000e24 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 16 + orrs r4, r0 + bl sub_81AA9E4 + lsls r0, 24 + lsrs r5, r0, 24 + movs r3, 0 + ldr r2, =gUnknown_08613655 + mov r12, r2 + movs r7, 0x7 +_081AA994: + adds r2, r6, r3 + adds r0, r4, 0 + ands r0, r7 + lsls r1, r5, 4 + adds r0, r1 + add r0, r12 + ldrb r0, [r0] + strb r0, [r2] + asrs r4, 3 + cmp r3, 0x7 + bne _081AA9C0 + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r2, =0x00000e26 + adds r0, r1, r2 + ldrh r4, [r0] + ldr r0, =0x00000e28 + adds r1, r0 + ldrh r0, [r1] + lsls r0, 16 + orrs r4, r0 + asrs r4, 8 +_081AA9C0: + adds r3, 0x1 + cmp r3, 0xF + ble _081AA994 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AA96C + + thumb_func_start sub_81AA9E4 +sub_81AA9E4: @ 81AA9E4 + push {r4,lr} + ldr r0, =gSaveBlock2Ptr + ldr r4, [r0] + ldr r1, =0x00000e28 + adds r0, r4, r1 + ldrh r0, [r0] + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r3, r0, 16 + ldr r0, =0x00000cb2 + adds r4, r0 + ldrh r0, [r4] + ldr r1, =gUnknown_08613794 + adds r0, r1 + ldrb r2, [r0] + cmp r2, 0x21 + bhi _081AAA38 + ldr r1, =gUnknown_08613750 + lsls r0, r2, 1 + adds r0, r1 +_081AAA10: + ldrb r1, [r0] + cmp r3, r1 + bge _081AAA30 + ldrb r0, [r0, 0x1] + b _081AAA3A + .pool +_081AAA30: + adds r0, 0x2 + adds r2, 0x1 + cmp r2, 0x21 + bls _081AAA10 +_081AAA38: + movs r0, 0 +_081AAA3A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81AA9E4 + + thumb_func_start sub_81AAA40 +sub_81AAA40: @ 81AAA40 + push {lr} + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0xC7 + lsls r1, 4 + adds r2, r0, r1 + movs r1, 0 + movs r3, 0xC7 + lsls r3, 4 + adds r0, r3 + b _081AAA6E + .pool +_081AAA5C: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xF + bhi _081AAA74 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r2 +_081AAA6E: + ldrb r0, [r0] + cmp r0, 0 + bne _081AAA5C +_081AAA74: + adds r0, r1, 0 + pop {r1} + bx r1 + thumb_func_end sub_81AAA40 + + thumb_func_start sub_81AAA7C +sub_81AAA7C: @ 81AAA7C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + movs r3, 0 + ldr r1, =gSaveBlock2Ptr + mov r8, r1 + lsls r1, r0, 2 + adds r1, r0 + movs r0, 0 + mov r12, r0 + lsls r4, r1, 1 + ldr r7, =0x00000e2c + movs r6, 0 + ldr r5, =0x00000e54 + lsls r2, r1, 2 +_081AAA9E: + mov r1, r8 + ldr r0, [r1] + adds r1, r0, r7 + adds r1, r2 + strh r6, [r1] + adds r1, r3, r4 + adds r0, r5 + adds r0, r1 + mov r1, r12 + strb r1, [r0] + adds r2, 0x2 + adds r3, 0x1 + cmp r3, 0x9 + ble _081AAA9E + movs r0, 0x15 + movs r1, 0x1 + bl AddPyramidBagItem + movs r0, 0x22 + movs r1, 0x1 + bl AddPyramidBagItem + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AAA7C + + thumb_func_start CalculateBattlePyramidPickupItemId +CalculateBattlePyramidPickupItemId: @ 81AAAE0 + push {r4-r6,lr} + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r2, =0x00000ca9 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r6, r0, 30 + lsls r0, r6, 1 + ldr r2, =0x00000e1a + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x13 + ble _081AAB0A + movs r4, 0x13 +_081AAB0A: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r2, r0, 16 + movs r1, 0 + ldr r3, =gUnknown_08613F86 + ldrb r0, [r3] + lsls r5, r4, 2 + cmp r0, r2 + bgt _081AAB36 +_081AAB28: + adds r1, 0x1 + cmp r1, 0x9 + bhi _081AAB3A + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + ble _081AAB28 +_081AAB36: + cmp r1, 0x9 + bls _081AAB3C +_081AAB3A: + movs r1, 0x9 +_081AAB3C: + cmp r6, 0 + bne _081AAB58 + ldr r2, =gUnknown_0861379C + b _081AAB5A + .pool +_081AAB58: + ldr r2, =gUnknown_0861392C +_081AAB5A: + lsls r1, 1 + adds r0, r5, r4 + lsls r0, 2 + adds r1, r0 + adds r1, r2 + ldrh r0, [r1] + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end CalculateBattlePyramidPickupItemId + + thumb_func_start sub_81AAB70 +sub_81AAB70: @ 81AAB70 + push {r4,lr} + ldr r4, =gUnknown_0203CE58 + movs r0, 0 + strb r0, [r4, 0x5] + adds r0, r4, 0 + adds r0, 0x8 + movs r1, 0 + movs r2, 0xA + bl memset + adds r4, 0x12 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0xA + bl memset + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AAB70 + + thumb_func_start CB2_BagMenuFromStartMenu +@ void CB2_BagMenuFromStartMenu() +CB2_BagMenuFromStartMenu: @ 81AAB9C + push {lr} + ldr r2, =sub_8086194 + movs r0, 0 + movs r1, 0x5 + bl GoToBagMenu + pop {r0} + bx r0 + .pool + thumb_func_end CB2_BagMenuFromStartMenu + + thumb_func_start sub_81AABB0 +sub_81AABB0: @ 81AABB0 + push {lr} + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + bne _081AABCC + ldr r2, =sub_8059D50 + movs r0, 0x1 + movs r1, 0x5 + bl GoToBagMenu + b _081AABD4 + .pool +_081AABCC: + ldr r1, =sub_8059D50 + movs r0, 0x1 + bl sub_81C4F98 +_081AABD4: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AABB0 + + thumb_func_start CB2_ChooseBerry +CB2_ChooseBerry: @ 81AABDC + push {lr} + ldr r2, =sub_80861B0 + movs r0, 0x4 + movs r1, 0x3 + bl GoToBagMenu + pop {r0} + bx r0 + .pool + thumb_func_end CB2_ChooseBerry + + thumb_func_start sub_81AABF0 +sub_81AABF0: @ 81AABF0 + push {lr} + adds r2, r0, 0 + movs r0, 0x5 + movs r1, 0x3 + bl GoToBagMenu + pop {r0} + bx r0 + thumb_func_end sub_81AABF0 + + thumb_func_start CB2_GoToSellMenu +@ void CB2_GoToSellMenu() +CB2_GoToSellMenu: @ 81AAC00 + push {lr} + ldr r2, =CB2_ExitSellMenu + movs r0, 0x3 + movs r1, 0x5 + bl GoToBagMenu + pop {r0} + bx r0 + .pool + thumb_func_end CB2_GoToSellMenu + + thumb_func_start sub_81AAC14 +sub_81AAC14: @ 81AAC14 + push {lr} + ldr r2, =sub_816B31C + movs r0, 0x6 + movs r1, 0x5 + bl GoToBagMenu + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AAC14 + + thumb_func_start sub_81AAC28 +sub_81AAC28: @ 81AAC28 + push {lr} + ldr r2, =bag_menu_leave_maybe_3 + movs r0, 0x9 + movs r1, 0x5 + bl GoToBagMenu + ldr r0, =gSpecialVar_0x8005 + movs r1, 0 + strh r1, [r0] + ldr r0, =gScriptResult + strh r1, [r0] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AAC28 + + thumb_func_start sub_81AAC50 +sub_81AAC50: @ 81AAC50 + push {lr} + ldr r2, =bag_menu_leave_maybe_2 + movs r0, 0x7 + movs r1, 0x5 + bl GoToBagMenu + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AAC50 + + thumb_func_start sub_81AAC70 +sub_81AAC70: @ 81AAC70 + push {lr} + ldr r2, =bag_menu_leave_maybe + movs r0, 0x8 + movs r1, 0x5 + bl GoToBagMenu + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AAC70 + + thumb_func_start GoToBagMenu +@ void GoToBagMenu(u8 bagMenuType, u8 pocketId, void ( *postExitMenuMainCallback2)()) +GoToBagMenu: @ 81AAC90 + push {r4-r7,lr} + adds r4, r2, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + ldr r6, =gUnknown_0203CE54 + ldr r0, =0x00000c48 + bl AllocZeroed + str r0, [r6] + cmp r0, 0 + bne _081AACBC + adds r0, r4, 0 + bl SetMainCallback2 + b _081AAD3A + .pool +_081AACBC: + ldr r0, =gUnknown_0203CE58 + cmp r5, 0xC + beq _081AACC4 + strb r5, [r0, 0x4] +_081AACC4: + cmp r4, 0 + beq _081AACCA + str r4, [r0] +_081AACCA: + cmp r7, 0x4 + bhi _081AACD0 + strb r7, [r0, 0x5] +_081AACD0: + ldrb r0, [r0, 0x4] + subs r0, 0x4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _081AACF0 + ldr r2, [r6] + ldr r0, =0x0000081b + adds r2, r0 + ldrb r1, [r2] + movs r0, 0x10 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] +_081AACF0: + ldr r0, [r6] + movs r1, 0 + str r1, [r0] + ldr r1, =0x0000081a + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldr r0, [r6] + ldr r1, =0x0000081e + adds r0, r1 + movs r1, 0x1 + negs r1, r1 + strb r1, [r0] + ldr r0, [r6] + ldr r1, =0x0000081f + adds r0, r1 + movs r1, 0x1 + negs r1, r1 + strb r1, [r0] + ldr r0, [r6] + ldr r1, =0x00000804 + adds r0, r1 + movs r1, 0xFF + movs r2, 0xC + bl memset + ldr r0, [r6] + movs r1, 0x81 + lsls r1, 4 + adds r0, r1 + movs r1, 0xFF + movs r2, 0xA + bl memset + ldr r0, =CB2_Bag + bl SetMainCallback2 +_081AAD3A: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end GoToBagMenu + + thumb_func_start c2_bag_3 +c2_bag_3: @ 81AAD5C + push {lr} + bl RunTasks + bl AnimateSprites + bl BuildOamBuffer + bl do_scheduled_bg_tilemap_copies_to_vram + bl UpdatePaletteFade + pop {r0} + bx r0 + thumb_func_end c2_bag_3 + + thumb_func_start vblank_cb_bag_menu +vblank_cb_bag_menu: @ 81AAD78 + push {lr} + bl LoadOam + bl ProcessSpriteCopyRequests + bl TransferPlttBuffer + pop {r0} + bx r0 + thumb_func_end vblank_cb_bag_menu + + thumb_func_start CB2_Bag +CB2_Bag: @ 81AAD8C + push {lr} +_081AAD8E: + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081AADB2 + bl setup_bag_menu + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081AADB2 + bl sub_81221AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081AAD8E +_081AADB2: + pop {r0} + bx r0 + thumb_func_end CB2_Bag + + thumb_func_start setup_bag_menu +setup_bag_menu: @ 81AADB8 + push {r4,r5,lr} + sub sp, 0x4 + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0x14 + bls _081AADCE + b _081AB02C +_081AADCE: + lsls r0, 2 + ldr r1, =_081AADE0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081AADE0: + .4byte _081AAE34 + .4byte _081AAE3E + .4byte _081AAE50 + .4byte _081AAE56 + .4byte _081AAE78 + .4byte _081AAE7E + .4byte _081AAE86 + .4byte _081AAEA4 + .4byte _081AAECC + .4byte _081AAEDA + .4byte _081AAEEC + .4byte _081AAEFA + .4byte _081AAF0C + .4byte _081AAF1C + .4byte _081AAF54 + .4byte _081AAFA0 + .4byte _081AAFBC + .4byte _081AAFC2 + .4byte _081AAFD8 + .4byte _081AAFDE + .4byte _081AAFF8 +_081AAE34: + bl SetVBlankHBlankCallbacksToNull + bl clear_scheduled_bg_copies_to_vram + b _081AB012 +_081AAE3E: + bl remove_some_task + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .pool +_081AAE50: + bl FreeAllSpritePalettes + b _081AB012 +_081AAE56: + bl ResetPaletteFade + ldr r2, =gPaletteFade + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x8] + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .pool +_081AAE78: + bl ResetSpriteData + b _081AB012 +_081AAE7E: + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 + b _081AB01A +_081AAE86: + bl sub_81221AC + lsls r0, 24 + cmp r0, 0 + bne _081AAE94 + bl ResetTasks +_081AAE94: + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .pool +_081AAEA4: + bl bag_menu_init_bgs + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r1, =0x00000834 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .pool +_081AAECC: + bl load_bag_menu_graphics + lsls r0, 24 + cmp r0, 0 + bne _081AAED8 + b _081AB044 +_081AAED8: + b _081AB012 +_081AAEDA: + bl setup_bag_menu_textboxes + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .pool +_081AAEEC: + bl sub_81ABA6C + bl sub_81ABAC4 + bl sub_81ABAE0 + b _081AB012 +_081AAEFA: + bl allocate_bag_item_list_buffers + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .pool +_081AAF0C: + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + bl load_bag_item_list_buffers + b _081AB012 + .pool +_081AAF1C: + ldr r1, =gUnknown_085E91FC + ldr r4, =gUnknown_0203CE58 + ldrb r0, [r4, 0x5] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0 + bl bag_menu_print_pocket_names + movs r0, 0 + bl bag_menu_copy_pocket_name_to_window + ldrb r0, [r4, 0x5] + movs r1, 0x1 + bl bag_menu_draw_pocket_indicator_square + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .pool +_081AAF54: + ldr r4, =gUnknown_0203CE58 + ldrb r0, [r4, 0x4] + bl sub_81AB1F0 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gUnknown_03006310 + ldrb r2, [r4, 0x5] + lsls r2, 1 + adds r1, r4, 0 + adds r1, 0x12 + adds r1, r2, r1 + ldrh r1, [r1] + adds r4, 0x8 + adds r2, r4 + ldrh r2, [r2] + bl ListMenuInit + ldr r2, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r2 + lsls r0, 24 + lsrs r0, 24 + movs r2, 0 + strh r0, [r1, 0x8] + strh r2, [r1, 0xE] + strh r2, [r1, 0x18] + b _081AB012 + .pool +_081AAFA0: + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + bl AddBagVisualObject + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .pool +_081AAFBC: + bl sub_80D4FAC + b _081AB012 +_081AAFC2: + bl bag_menu_add_pocket_scroll_arrow_indicators_maybe + bl bag_menu_add_list_scroll_arrow_indicators_maybe + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .pool +_081AAFD8: + bl bag_menu_prepare_tmhm_move_window + b _081AB012 +_081AAFDE: + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl BlendPalettes + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .pool +_081AAFF8: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade + ldr r2, =gPaletteFade + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x8] +_081AB012: + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 +_081AB01A: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _081AB044 + .pool +_081AB02C: + ldr r0, =vblank_cb_bag_menu + bl SetVBlankCallback + ldr r0, =c2_bag_3 + bl SetMainCallback2 + movs r0, 0x1 + b _081AB046 + .pool +_081AB044: + movs r0, 0 +_081AB046: + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end setup_bag_menu + + thumb_func_start bag_menu_init_bgs +bag_menu_init_bgs: @ 81AB050 + push {r4,lr} + bl sub_8121DA0 + ldr r4, =gUnknown_0203CE54 + ldr r0, [r4] + adds r0, 0x4 + movs r2, 0x80 + lsls r2, 4 + movs r1, 0 + bl memset + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_08613F90 + movs r0, 0 + movs r2, 0x3 + bl InitBgsFromTemplates + ldr r1, [r4] + adds r1, 0x4 + movs r0, 0x2 + bl SetBgTilemapBuffer + bl sub_8121E10 + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_init_bgs + + thumb_func_start load_bag_menu_graphics +load_bag_menu_graphics: @ 81AB0BC + push {r4,lr} + sub sp, 0x4 + ldr r4, =gUnknown_0203CE54 + ldr r0, [r4] + ldr r1, =0x00000834 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x4 + bls _081AB0D2 + b _081AB1CC +_081AB0D2: + lsls r0, 2 + ldr r1, =_081AB0E8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081AB0E8: + .4byte _081AB0FC + .4byte _081AB118 + .4byte _081AB13C + .4byte _081AB174 + .4byte _081AB1A8 +_081AB0FC: + bl reset_temp_tile_data_buffers + ldr r1, =gUnknown_08D9A620 + movs r0, 0 + str r0, [sp] + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + b _081AB1AE + .pool +_081AB118: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081AB1E4 + ldr r0, =gUnknown_08D9A88C + ldr r4, =gUnknown_0203CE54 + ldr r1, [r4] + adds r1, 0x4 + bl LZDecompressWram + ldr r1, [r4] + b _081AB1B2 + .pool +_081AB13C: + bl IsWallysBag + lsls r0, 24 + cmp r0, 0 + bne _081AB164 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + beq _081AB164 + ldr r0, =gUnknown_08D9A5D4 + movs r1, 0 + movs r2, 0x40 + bl LoadCompressedPalette + b _081AB1AE + .pool +_081AB164: + ldr r0, =gUnknown_08D9A588 + movs r1, 0 + movs r2, 0x40 + bl LoadCompressedPalette + b _081AB1AE + .pool +_081AB174: + bl IsWallysBag + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081AB18A + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + bne _081AB19C +_081AB18A: + ldr r0, =gUnknown_0857FB34 + bl LoadCompressedObjectPic + b _081AB1AE + .pool +_081AB19C: + ldr r0, =gUnknown_0857FB3C + bl LoadCompressedObjectPic + b _081AB1AE + .pool +_081AB1A8: + ldr r0, =gUnknown_0857FB44 + bl LoadCompressedObjectPalette +_081AB1AE: + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] +_081AB1B2: + ldr r0, =0x00000834 + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _081AB1E4 + .pool +_081AB1CC: + bl sub_8122328 + ldr r0, [r4] + ldr r1, =0x00000834 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + movs r0, 0x1 + b _081AB1E6 + .pool +_081AB1E4: + movs r0, 0 +_081AB1E6: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end load_bag_menu_graphics + + thumb_func_start sub_81AB1F0 +sub_81AB1F0: @ 81AB1F0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xA + bne _081AB204 + ldr r0, =Task_WallyTutorialBagMenu + b _081AB206 + .pool +_081AB204: + ldr r0, =Task_BagMenu +_081AB206: + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81AB1F0 + + thumb_func_start allocate_bag_item_list_buffers +allocate_bag_item_list_buffers: @ 81AB218 + push {r4,lr} + ldr r4, =gUnknown_0203CE74 + movs r0, 0x82 + lsls r0, 2 + bl Alloc + str r0, [r4] + ldr r4, =gUnknown_0203CE78 + movs r0, 0xC3 + lsls r0, 3 + bl Alloc + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end allocate_bag_item_list_buffers + + thumb_func_start load_bag_item_list_buffers +@ void load_bag_item_list_buffers(int pocket_id) +load_bag_item_list_buffers: @ 81AB240 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, r7, 3 + ldr r0, =gBagPockets + adds r1, r0 + mov r8, r1 + ldr r0, =gUnknown_0203CE54 + ldr r2, [r0] + ldr r1, =0x0000081b + adds r0, r2, r1 + ldrb r1, [r0] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081AB2FC + movs r6, 0 + ldr r3, =0x00000829 + adds r0, r2, r3 + adds r0, r7 + ldrb r0, [r0] + subs r0, 0x1 + cmp r6, r0 + bge _081AB2B6 + ldr r5, =gUnknown_0203CE78 +_081AB276: + lsls r4, r6, 1 + adds r4, r6 + lsls r4, 3 + ldr r0, [r5] + adds r0, r4 + mov r1, r8 + ldr r2, [r1] + lsls r1, r6, 2 + adds r1, r2 + ldrh r1, [r1] + bl get_name + ldr r0, =gUnknown_0203CE74 + ldr r0, [r0] + lsls r1, r6, 3 + adds r1, r0 + ldr r0, [r5] + adds r0, r4 + str r0, [r1] + str r6, [r1, 0x4] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r3, =0x00000829 + adds r0, r3 + adds r0, r7 + ldrb r0, [r0] + subs r0, 0x1 + cmp r6, r0 + blt _081AB276 +_081AB2B6: + ldr r5, =gUnknown_0203CE78 + lsls r4, r6, 1 + adds r4, r6 + lsls r4, 3 + ldr r0, [r5] + adds r0, r4 + ldr r1, =gUnknown_085E8DB4 + bl StringCopy + ldr r0, =gUnknown_0203CE74 + ldr r0, [r0] + lsls r1, r6, 3 + adds r1, r0 + ldr r0, [r5] + adds r0, r4 + str r0, [r1] + movs r0, 0x2 + negs r0, r0 + str r0, [r1, 0x4] + b _081AB34A + .pool +_081AB2FC: + movs r6, 0 + ldr r4, =0x00000829 + adds r0, r2, r4 + adds r0, r7 + ldrb r0, [r0] + cmp r6, r0 + bcs _081AB34A + ldr r5, =gUnknown_0203CE78 +_081AB30C: + lsls r4, r6, 1 + adds r4, r6 + lsls r4, 3 + ldr r0, [r5] + adds r0, r4 + mov r1, r8 + ldr r2, [r1] + lsls r1, r6, 2 + adds r1, r2 + ldrh r1, [r1] + bl get_name + ldr r0, =gUnknown_0203CE74 + ldr r0, [r0] + lsls r1, r6, 3 + adds r1, r0 + ldr r0, [r5] + adds r0, r4 + str r0, [r1] + str r6, [r1, 0x4] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r3, =0x00000829 + adds r0, r3 + adds r0, r7 + ldrb r0, [r0] + cmp r6, r0 + bcc _081AB30C +_081AB34A: + ldr r2, =gUnknown_03006310 + adds r1, r2, 0 + ldr r0, =gUnknown_08613F9C + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + ldr r4, =0x00000829 + adds r0, r1, r4 + adds r0, r7 + ldrb r0, [r0] + strh r0, [r2, 0xC] + ldr r0, =gUnknown_0203CE74 + ldr r0, [r0] + str r0, [r2] + ldr r5, =0x0000082e + adds r1, r5 + adds r1, r7 + ldrb r0, [r1] + strh r0, [r2, 0xE] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end load_bag_item_list_buffers + + thumb_func_start get_name +@ void get_name(char *dest, int name_id) +get_name: @ 81AB39C + push {r4-r6,lr} + adds r6, r0, 0 + lsls r1, 16 + lsrs r5, r1, 16 + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + cmp r0, 0x2 + beq _081AB3C0 + cmp r0, 0x3 + beq _081AB420 + adds r0, r5, 0 + adds r1, r6, 0 + bl CopyItemName + b _081AB43E + .pool +_081AB3C0: + ldr r4, =gStringVar2 + adds r0, r5, 0 + bl ItemIdToBattleMoveId + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xD + muls r1, r0 + ldr r0, =gMoveNames + adds r1, r0 + adds r0, r4, 0 + bl StringCopy + movs r0, 0xA9 + lsls r0, 1 + cmp r5, r0 + bls _081AB408 + ldr r0, =gStringVar1 + ldr r2, =0xfffffeae + adds r1, r5, r2 + movs r2, 0x2 + movs r3, 0x1 + bl ConvertIntToDecimalStringN + ldr r1, =gUnknown_085E921A + b _081AB438 + .pool +_081AB408: + ldr r0, =gStringVar1 + ldr r2, =0xfffffee0 + adds r1, r5, r2 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalStringN + b _081AB436 + .pool +_081AB420: + ldr r0, =gStringVar1 + adds r1, r5, 0 + subs r1, 0x84 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalStringN + ldr r1, =gStringVar2 + adds r0, r5, 0 + bl CopyItemName +_081AB436: + ldr r1, =gUnknown_085E9210 +_081AB438: + adds r0, r6, 0 + bl StringExpandPlaceholders +_081AB43E: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end get_name + + 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 + lsrs r1, 24 + cmp r1, 0x1 + beq _081AB466 + movs r0, 0x5 + bl PlaySE + bl ShakeBagVisual +_081AB466: + ldr r4, =gUnknown_0203CE54 + ldr r1, [r4] + ldr r2, =0x0000081a + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0xFF + bne _081AB50C + adds r2, 0x1 + adds r0, r1, r2 + ldrb r1, [r0] + lsls r1, 26 + lsrs r1, 30 + movs r0, 0x1 + eors r0, r1 + bl RemoveBagItemIconObject + movs r0, 0x2 + negs r0, r0 + cmp r6, r0 + beq _081AB4C8 + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r6, 16 + lsrs r1, 16 + bl BagGetItemIdByPocketPosition + lsls r0, 16 + lsrs r0, 16 + ldr r1, [r4] + ldr r2, =0x0000081b + adds r1, r2 + ldrb r1, [r1] + lsls r1, 26 + lsrs r1, 30 + bl AddBagItemIconObject + b _081AB4DA + .pool +_081AB4C8: + ldr r0, =0x0000ffff + ldr r1, [r4] + ldr r2, =0x0000081b + adds r1, r2 + ldrb r1, [r1] + lsls r1, 26 + lsrs r1, 30 + bl AddBagItemIconObject +_081AB4DA: + ldr r5, =gUnknown_0203CE54 + ldr r2, [r5] + ldr r4, =0x0000081b + adds r2, r4 + ldrb r3, [r2] + lsls r0, r3, 26 + lsrs r0, 30 + movs r1, 0x1 + eors r1, r0 + lsls r1, 4 + movs r0, 0x31 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _081AB50C + adds r0, r6, 0 + bl bag_menu_print_description_box_text +_081AB50C: + pop {r4-r6} + pop {r0} + bx r0 + .pool + 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) +sub_81AB520: @ 81AB520 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r2, 24 + lsrs r7, r2, 24 + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + bne _081AB540 + b _081AB696 +_081AB540: + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r1, =0x0000081a + adds r0, r1 + ldrb r1, [r0] + cmp r1, 0xFF + beq _081AB570 + lsls r0, r4, 24 + lsrs r0, 24 + cmp r1, r0 + bne _081AB568 + adds r0, r7, 0 + movs r1, 0x2 + bl bag_menu_print_cursor + b _081AB570 + .pool +_081AB568: + adds r0, r7, 0 + movs r1, 0xFF + bl bag_menu_print_cursor +_081AB570: + ldr r5, =gUnknown_0203CE58 + ldrb r0, [r5, 0x5] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + lsls r4, 16 + lsrs r4, 16 + adds r1, r4, 0 + bl BagGetItemIdByPocketPosition + lsls r0, 16 + lsrs r6, r0, 16 + ldrb r0, [r5, 0x5] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + bl BagGetQuantityByPocketPosition + lsls r0, 16 + lsrs r4, r0, 16 + mov r9, r4 + ldr r1, =0xfffffead + adds r0, r6, r1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x7 + bhi _081AB5BE + ldr r1, =gUnknown_08DC6378 + subs r3, r7, 0x1 + lsls r3, 16 + lsrs r3, 16 + movs r0, 0x10 + str r0, [sp] + str r0, [sp, 0x4] + mov r0, r8 + movs r2, 0x8 + bl BlitBitmapToWindow +_081AB5BE: + ldrb r0, [r5, 0x5] + cmp r0, 0x3 + bne _081AB610 + ldr r0, =gStringVar1 + adds r1, r4, 0 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E8DA0 + adds r0, r4, 0 + bl StringExpandPlaceholders + movs r0, 0x7 + adds r1, r4, 0 + movs r2, 0x77 + bl GetStringRightAlignXOffset + lsls r3, r0, 24 + lsrs r3, 24 + str r7, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r0, 0xFF + str r0, [sp, 0xC] + str r1, [sp, 0x10] + b _081AB652 + .pool +_081AB610: + cmp r0, 0x4 + beq _081AB66C + adds r0, r6, 0 + bl itemid_is_unique + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _081AB66C + ldr r0, =gStringVar1 + mov r1, r9 + movs r2, 0x1 + movs r3, 0x2 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E8DA0 + adds r0, r4, 0 + bl StringExpandPlaceholders + movs r0, 0x7 + adds r1, r4, 0 + movs r2, 0x77 + bl GetStringRightAlignXOffset + lsls r3, r0, 24 + lsrs r3, 24 + str r7, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0xFF + str r0, [sp, 0xC] + str r5, [sp, 0x10] +_081AB652: + mov r0, r8 + movs r1, 0x7 + adds r2, r4, 0 + bl bag_menu_print + b _081AB696 + .pool +_081AB66C: + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00000496 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + beq _081AB696 + cmp r0, r6 + bne _081AB696 + ldr r1, =gUnknown_086140A4 + subs r3, r7, 0x1 + lsls r3, 16 + lsrs r3, 16 + movs r0, 0x18 + str r0, [sp] + movs r0, 0x10 + str r0, [sp, 0x4] + mov r0, r8 + movs r2, 0x60 + bl BlitBitmapToWindow +_081AB696: + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AB520 + + thumb_func_start bag_menu_print_description_box_text +@ void bag_menu_print_description_box_text(int a1) +bag_menu_print_description_box_text: @ 81AB6B0 + push {r4,lr} + sub sp, 0x14 + adds r1, r0, 0 + movs r0, 0x2 + negs r0, r0 + cmp r1, r0 + beq _081AB6E0 + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r1, 16 + bl BagGetItemIdByPocketPosition + lsls r0, 16 + lsrs r0, 16 + bl ItemId_GetDescription + adds r4, r0, 0 + b _081AB6FC + .pool +_081AB6E0: + ldr r0, =gStringVar1 + ldr r2, =gUnknown_085E9180 + ldr r1, =gUnknown_0203CE58 + ldrb r1, [r1, 0x4] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl StringCopy + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E91C0 + adds r0, r4, 0 + bl StringExpandPlaceholders +_081AB6FC: + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r0, [sp, 0x10] + movs r0, 0x1 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x3 + bl bag_menu_print + add sp, 0x14 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_print_description_box_text + + thumb_func_start bag_menu_print_cursor_ +bag_menu_print_cursor_: @ 81AB73C + push {r4,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsrs r4, 24 + bl ListMenuGetYCoordForPrintingArrowCursor + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + bl bag_menu_print_cursor + pop {r4} + pop {r0} + bx r0 + thumb_func_end bag_menu_print_cursor_ + + thumb_func_start bag_menu_print_cursor +bag_menu_print_cursor: @ 81AB75C + push {r4,r5,lr} + sub sp, 0x14 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0xFF + bne _081AB798 + movs r0, 0x1 + movs r1, 0 + bl GetMenuCursorDimensionByFont + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + movs r1, 0x1 + bl GetMenuCursorDimensionByFont + lsls r0, 24 + lsrs r0, 24 + str r4, [sp] + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + adds r3, r5, 0 + bl FillWindowPixelRect + b _081AB7AE +_081AB798: + ldr r2, =gUnknown_085E8D60 + str r5, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r1, [sp, 0x10] + movs r1, 0x1 + movs r3, 0 + bl bag_menu_print +_081AB7AE: + add sp, 0x14 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_print_cursor + + thumb_func_start bag_menu_add_pocket_scroll_arrow_indicators_maybe +bag_menu_add_pocket_scroll_arrow_indicators_maybe: @ 81AB7BC + push {r4-r6,lr} + sub sp, 0x10 + ldr r5, =gUnknown_0203CE54 + ldr r4, [r5] + ldr r1, =0x0000081e + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0xFF + bne _081AB80A + ldr r2, =gUnknown_0203CE58 + ldrb r3, [r2, 0x5] + ldr r6, =0x00000829 + adds r0, r4, r6 + adds r0, r3 + ldrb r1, [r0] + adds r6, 0x5 + adds r0, r4, r6 + adds r0, r3 + ldrb r0, [r0] + subs r1, r0 + str r1, [sp] + movs r0, 0x6E + str r0, [sp, 0x4] + str r0, [sp, 0x8] + ldrb r0, [r2, 0x5] + lsls r0, 1 + adds r2, 0x12 + adds r0, r2 + str r0, [sp, 0xC] + movs r0, 0x2 + movs r1, 0xAC + movs r2, 0xC + movs r3, 0x94 + bl AddScrollIndicatorArrowPairParametrized + ldr r1, [r5] + ldr r2, =0x0000081e + adds r1, r2 + strb r0, [r1] +_081AB80A: + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_add_pocket_scroll_arrow_indicators_maybe + + thumb_func_start sub_81AB824 +sub_81AB824: @ 81AB824 + push {r4,lr} + ldr r4, =gUnknown_0203CE54 + ldr r0, [r4] + ldr r2, =0x0000081e + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xFF + beq _081AB842 + bl RemoveScrollIndicatorArrowPair + ldr r0, [r4] + ldr r1, =0x0000081e + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] +_081AB842: + bl sub_81AB89C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AB824 + + thumb_func_start bag_menu_add_list_scroll_arrow_indicators_maybe +bag_menu_add_list_scroll_arrow_indicators_maybe: @ 81AB854 + push {r4,lr} + ldr r4, =gUnknown_0203CE54 + ldr r2, [r4] + ldr r1, =0x0000081b + adds r0, r2, r1 + ldrb r1, [r0] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x1 + beq _081AB882 + ldr r1, =0x0000081f + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0xFF + bne _081AB882 + ldr r0, =gUnknown_08614094 + ldr r1, =gUnknown_0203CE5E + bl AddScrollIndicatorArrowPair + ldr r1, [r4] + ldr r2, =0x0000081f + adds r1, r2 + strb r0, [r1] +_081AB882: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_add_list_scroll_arrow_indicators_maybe + + thumb_func_start sub_81AB89C +sub_81AB89C: @ 81AB89C + push {r4,lr} + ldr r4, =gUnknown_0203CE54 + ldr r0, [r4] + ldr r2, =0x0000081f + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xFF + beq _081AB8BA + bl RemoveScrollIndicatorArrowPair + ldr r0, [r4] + ldr r1, =0x0000081f + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] +_081AB8BA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AB89C + + thumb_func_start free_bag_item_list_buffers +free_bag_item_list_buffers: @ 81AB8C8 + push {lr} + ldr r0, =gUnknown_0203CE78 + ldr r0, [r0] + bl Free + ldr r0, =gUnknown_0203CE74 + ldr r0, [r0] + bl Free + bl FreeAllWindowBuffers + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + bl Free + pop {r0} + bx r0 + .pool + thumb_func_end free_bag_item_list_buffers + + thumb_func_start unknown_ItemMenu_Confirm +unknown_ItemMenu_Confirm: @ 81AB8F8 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =task_close_bag_menu_2 + str r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end unknown_ItemMenu_Confirm + + thumb_func_start task_close_bag_menu_2 +task_close_bag_menu_2: @ 81AB930 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r2, r0, r1 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081AB9A0 + ldrb r0, [r2] + ldr r4, =gUnknown_0203CE58 + ldrb r2, [r4, 0x5] + lsls r2, 1 + adds r1, r4, 0 + adds r1, 0x12 + adds r1, r2, r1 + adds r3, r4, 0 + adds r3, 0x8 + adds r2, r3 + bl sub_81AE6C8 + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0 + beq _081AB984 + bl SetMainCallback2 + b _081AB98A + .pool +_081AB984: + ldr r0, [r4] + bl SetMainCallback2 +_081AB98A: + bl sub_81AB824 + bl ResetSpriteData + bl FreeAllSpritePalettes + bl free_bag_item_list_buffers + adds r0, r5, 0 + bl DestroyTask +_081AB9A0: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end task_close_bag_menu_2 + + thumb_func_start sub_81AB9A8 +sub_81AB9A8: @ 81AB9A8 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, r5, 3 + ldr r0, =gBagPockets + adds r4, r1, r0 + cmp r5, 0x3 + bgt _081AB9C8 + cmp r5, 0x2 + blt _081AB9C8 + adds r0, r4, 0 + bl sub_80D6FB4 + b _081AB9CE + .pool +_081AB9C8: + adds r0, r4, 0 + bl sub_80D6F64 +_081AB9CE: + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + ldr r6, =0x00000829 + adds r1, r6 + adds r1, r5 + movs r2, 0 + strb r2, [r1] + adds r3, r0, 0 + ldrb r0, [r4, 0x4] + cmp r2, r0 + bcs _081ABA12 + ldr r0, [r4] + ldrh r0, [r0] + cmp r0, 0 + beq _081ABA12 + adds r7, r3, 0 +_081AB9EE: + ldr r0, [r7] + adds r0, r6 + adds r0, r5 + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + ldrb r1, [r4, 0x4] + cmp r2, r1 + bcs _081ABA12 + ldr r0, [r4] + lsls r1, r2, 2 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _081AB9EE +_081ABA12: + ldr r2, [r3] + ldr r1, =0x0000081b + adds r0, r2, r1 + ldrb r1, [r0] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081ABA2E + ldr r0, =0x00000829 + adds r1, r2, r0 + adds r1, r5 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_081ABA2E: + ldr r1, [r3] + ldr r2, =0x00000829 + adds r0, r1, r2 + adds r0, r5 + ldrb r2, [r0] + cmp r2, 0x8 + bls _081ABA58 + ldr r3, =0x0000082e + adds r0, r1, r3 + adds r0, r5 + movs r1, 0x8 + strb r1, [r0] + b _081ABA60 + .pool +_081ABA58: + ldr r3, =0x0000082e + adds r0, r1, r3 + adds r0, r5 + strb r2, [r0] +_081ABA60: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AB9A8 + + thumb_func_start sub_81ABA6C +sub_81ABA6C: @ 81ABA6C + push {r4,lr} + movs r4, 0 +_081ABA70: + adds r0, r4, 0 + bl sub_81AB9A8 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x4 + bls _081ABA70 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81ABA6C + + thumb_func_start sub_81ABA88 +sub_81ABA88: @ 81ABA88 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 1 + ldr r2, =gUnknown_0203CE6A + adds r4, r1, r2 + subs r2, 0xA + adds r1, r2 + ldr r2, =gUnknown_0203CE54 + ldr r3, [r2] + ldr r5, =0x0000082e + adds r2, r3, r5 + adds r2, r0 + ldrb r2, [r2] + subs r5, 0x5 + adds r3, r5 + adds r3, r0 + ldrb r3, [r3] + adds r0, r4, 0 + bl sub_812225C + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81ABA88 + + thumb_func_start sub_81ABAC4 +sub_81ABAC4: @ 81ABAC4 + push {r4,lr} + movs r4, 0 +_081ABAC8: + adds r0, r4, 0 + bl sub_81ABA88 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x4 + bls _081ABAC8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81ABAC4 + + thumb_func_start sub_81ABAE0 +sub_81ABAE0: @ 81ABAE0 + push {r4-r7,lr} + sub sp, 0x4 + movs r5, 0 + ldr r6, =gUnknown_0203CE6A + adds r7, r6, 0 + subs r7, 0xA +_081ABAEC: + lsls r1, r5, 1 + adds r0, r1, r6 + adds r1, r7 + ldr r2, =gUnknown_0203CE54 + ldr r3, [r2] + ldr r4, =0x0000082e + adds r2, r3, r4 + adds r2, r5 + ldrb r2, [r2] + subs r4, 0x5 + adds r3, r4 + adds r3, r5 + ldrb r3, [r3] + movs r4, 0x8 + str r4, [sp] + bl sub_8122298 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x4 + bls _081ABAEC + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81ABAE0 + + thumb_func_start sub_81ABB2C +sub_81ABB2C: @ 81ABB2C + lsls r0, 24 + ldr r1, =gUnknown_0203CE58 + lsrs r0, 23 + adds r2, r1, 0 + adds r2, 0x12 + adds r2, r0, r2 + adds r1, 0x8 + adds r0, r1 + ldrb r0, [r0] + ldrb r2, [r2] + adds r0, r2 + lsls r0, 24 + lsrs r0, 24 + bx lr + .pool + thumb_func_end sub_81ABB2C + + 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 + push {r5,r6} + sub sp, 0x10 + adds r5, r0, 0 + adds r6, r1, 0 + mov r8, r2 + mov r9, r3 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + movs r0, 0x4 + bl AddItemMessageWindow + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x14] + movs r1, 0x11 + bl FillWindowPixelBuffer + bl sav2_get_text_speed + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r4, 0x14] + str r6, [sp] + str r0, [sp, 0x4] + mov r0, r8 + str r0, [sp, 0x8] + mov r0, r9 + str r0, [sp, 0xC] + adds r0, r5, 0 + movs r2, 0xA + movs r3, 0xD + bl DisplayMessageAndContinueTask + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end DisplayItemMessage + + thumb_func_start bag_menu_inits_lists_menu +bag_menu_inits_lists_menu: @ 81ABBBC + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + lsls r5, r6, 2 + adds r5, r6 + lsls r5, 3 + ldr r0, =gTasks + 0x8 + adds r5, r0 + ldr r7, =gUnknown_0203CE58 + ldrb r4, [r7, 0x5] + lsls r4, 1 + movs r0, 0x12 + adds r0, r7 + mov r8, r0 + add r8, r4 + adds r0, r7, 0 + adds r0, 0x8 + adds r4, r0 + movs r0, 0x4 + bl bag_menu_RemoveBagItem_message_window + ldrb r0, [r5] + mov r1, r8 + adds r2, r4, 0 + bl sub_81AE6C8 + ldrb r0, [r7, 0x5] + bl sub_81AB9A8 + ldrb r0, [r7, 0x5] + bl sub_81ABA88 + ldrb r0, [r7, 0x5] + bl load_bag_item_list_buffers + ldr r0, =gUnknown_03006310 + mov r2, r8 + ldrh r1, [r2] + ldrh r2, [r4] + bl ListMenuInit + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5] + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + adds r0, r6, 0 + bl set_callback3_to_bag + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_inits_lists_menu + + thumb_func_start sub_81ABC3C +sub_81ABC3C: @ 81ABC3C + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl bag_menu_add_window + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_81ABC54 + pop {r0} + bx r0 + thumb_func_end sub_81ABC3C + + thumb_func_start sub_81ABC54 +sub_81ABC54: @ 81ABC54 + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 16 + lsrs r1, 16 + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + movs r3, 0x2 + cmp r0, 0x3 + bne _081ABC6C + movs r3, 0x3 +_081ABC6C: + ldr r0, =gStringVar1 + lsls r1, 16 + asrs r1, 16 + movs r2, 0x2 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E8DA0 + adds r0, r4, 0 + bl StringExpandPlaceholders + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x28 + bl GetStringCenterAlignXOffset + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x2 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl Print + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81ABC54 + + thumb_func_start sub_81ABCC0 +sub_81ABCC0: @ 81ABCC0 + push {r4-r7,lr} + sub sp, 0xC + adds r4, r0, 0 + adds r7, r2, 0 + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + movs r3, 0x2 + cmp r0, 0x3 + bne _081ABCD4 + movs r3, 0x3 +_081ABCD4: + ldr r0, =gStringVar1 + movs r2, 0x2 + bl ConvertIntToDecimalStringN + ldr r6, =gStringVar4 + ldr r1, =gUnknown_085E8DA0 + adds r0, r6, 0 + bl StringExpandPlaceholders + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r5, 0 + str r5, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x1 + adds r2, r6, 0 + movs r3, 0 + bl Print + str r5, [sp] + adds r0, r4, 0 + movs r1, 0x26 + movs r2, 0x1 + adds r3, r7, 0 + bl PrintMoneyAmount + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81ABCC0 + + thumb_func_start Task_BagMenu +Task_BagMenu: @ 81ABD28 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r0, 2 + add r0, r9 + lsls r0, 3 + str r0, [sp] + ldr r1, =gTasks + 0x8 + adds r6, r0, r1 + ldr r5, =gUnknown_0203CE58 + ldrb r0, [r5, 0x5] + lsls r0, 1 + adds r1, r5, 0 + adds r1, 0x12 + adds r7, r0, r1 + subs r1, 0xA + adds r0, r1 + mov r8, r0 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081ABD66 + b _081ABEB2 +_081ABD66: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081ABD74 + b _081ABEB2 +_081ABD74: + bl GetSwitchBagPocketDirection + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081ABDB8 + cmp r0, 0x2 + beq _081ABDC0 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x4 + ands r0, r1 + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + cmp r0, 0 + beq _081ABE10 + bl sub_81AC2C0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081ABDA4 + b _081ABEB2 +_081ABDA4: + b _081ABDCC + .pool +_081ABDB8: + movs r1, 0x1 + negs r1, r1 + mov r0, r9 + b _081ABDC4 +_081ABDC0: + mov r0, r9 + movs r1, 0x1 +_081ABDC4: + movs r2, 0 + bl SwitchBagPocket + b _081ABEB2 +_081ABDCC: + ldrb r0, [r6] + adds r1, r7, 0 + mov r2, r8 + bl get_coro_args_x18_x1A + ldrh r2, [r7] + mov r3, r8 + ldrh r0, [r3] + adds r2, r0 + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r1, =gUnknown_0203CE58 + ldr r3, =0x00000829 + adds r0, r3 + ldrb r1, [r1, 0x5] + adds r0, r1 + ldrb r0, [r0] + subs r0, 0x1 + cmp r2, r0 + beq _081ABEB2 + movs r0, 0x5 + bl PlaySE + mov r0, r9 + bl bag_menu_swap_items + b _081ABEB2 + .pool +_081ABE10: + ldrb r0, [r6] + bl ListMenuHandleInput + adds r4, r0, 0 + ldrb r0, [r6] + adds r1, r7, 0 + mov r2, r8 + bl get_coro_args_x18_x1A + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _081ABE32 + adds r0, 0x1 + cmp r4, r0 + bne _081ABE68 + b _081ABEB2 +_081ABE32: + ldrb r0, [r5, 0x4] + cmp r0, 0x5 + bne _081ABE40 + movs r0, 0x20 + bl PlaySE + b _081ABEB2 +_081ABE40: + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_0203CE7C + mov r1, r10 + strh r1, [r0] + ldr r0, =gTasks + 0x8 + subs r0, 0x8 + ldr r3, [sp] + adds r0, r3, r0 + ldr r1, =unknown_ItemMenu_Confirm + str r1, [r0] + b _081ABEB2 + .pool +_081ABE68: + movs r0, 0x5 + bl PlaySE + bl sub_81AB824 + ldrb r0, [r6] + movs r1, 0x2 + bl bag_menu_print_cursor_ + strh r4, [r6, 0x2] + ldrb r0, [r5, 0x5] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + lsls r4, 16 + lsrs r4, 16 + adds r1, r4, 0 + bl BagGetQuantityByPocketPosition + strh r0, [r6, 0x4] + ldrb r0, [r5, 0x5] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + bl BagGetItemIdByPocketPosition + ldr r1, =gUnknown_0203CE7C + strh r0, [r1] + ldr r1, =gUnknown_08614054 + ldrb r0, [r5, 0x4] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + mov r0, r9 + bl _call_via_r1 +_081ABEB2: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end Task_BagMenu + + thumb_func_start set_callback3_to_bag +set_callback3_to_bag: @ 81ABECC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl bag_menu_add_pocket_scroll_arrow_indicators_maybe + bl bag_menu_add_list_scroll_arrow_indicators_maybe + movs r0, 0x3 + bl ClearWindowTilemap + movs r0, 0x4 + bl ClearWindowTilemap + movs r0, 0x1 + bl PutWindowTilemap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =Task_BagMenu + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end set_callback3_to_bag + + thumb_func_start GetSwitchBagPocketDirection +GetSwitchBagPocketDirection: @ 81ABF10 + push {lr} + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r1, =0x0000081b + adds r0, r1 + ldrb r1, [r0] + movs r0, 0xF + ands r0, r1 + cmp r0, 0 + bne _081ABF6A + bl GetLRKeysState + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _081ABF3C + cmp r2, 0x1 + bne _081ABF54 +_081ABF3C: + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + b _081ABF6C + .pool +_081ABF54: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _081ABF60 + cmp r2, 0x2 + bne _081ABF6A +_081ABF60: + movs r0, 0x5 + bl PlaySE + movs r0, 0x2 + b _081ABF6C +_081ABF6A: + movs r0, 0 +_081ABF6C: + pop {r1} + bx r1 + thumb_func_end GetSwitchBagPocketDirection + + thumb_func_start ChangeBagPocketId +@ void ChangeBagPocketId(u8 *bagPocketId, u8 deltaBagPocketId) +ChangeBagPocketId: @ 81ABF70 + push {r4,lr} + adds r2, r0, 0 + lsls r1, 24 + lsrs r4, r1, 24 + asrs r1, 24 + cmp r1, 0x1 + bne _081ABF88 + ldrb r0, [r2] + cmp r0, 0x4 + bne _081ABF88 + movs r0, 0 + b _081ABFA0 +_081ABF88: + lsls r0, r4, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + ldrb r3, [r2] + cmp r0, r1 + bne _081ABF9E + cmp r3, 0 + bne _081ABF9E + movs r0, 0x4 + b _081ABFA0 +_081ABF9E: + adds r0, r3, r4 +_081ABFA0: + strb r0, [r2] + pop {r4} + pop {r0} + bx r0 + thumb_func_end ChangeBagPocketId + + thumb_func_start SwitchBagPocket +@ void SwitchBagPocket(u8 taskId, u16 deltaBagPocketId, u16 a3) +SwitchBagPocket: @ 81ABFA8 + push {r4-r6,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 16 + lsrs r5, r1, 16 + lsls r2, 16 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + movs r0, 0 + strh r0, [r4, 0x1A] + strh r0, [r4, 0x18] + strh r5, [r4, 0x16] + cmp r2, 0 + bne _081AC026 + movs r0, 0 + bl ClearWindowTilemap + movs r0, 0x1 + bl ClearWindowTilemap + ldrb r0, [r4] + ldr r3, =gUnknown_0203CE58 + ldrb r2, [r3, 0x5] + lsls r2, 1 + adds r1, r3, 0 + adds r1, 0x12 + adds r1, r2, r1 + adds r3, 0x8 + adds r2, r3 + bl sub_81AE6C8 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r3, =gSprites + ldr r0, =gUnknown_0203CE54 + ldr r2, [r0] + ldr r1, =0x0000081b + adds r0, r2, r1 + ldrb r1, [r0] + lsls r1, 26 + lsrs r1, 30 + movs r0, 0x1 + eors r0, r1 + adds r2, r0 + ldr r0, =0x00000806 + adds r2, r0 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + bl sub_81AB824 +_081AC026: + ldr r4, =gUnknown_0203CE58 + ldrb r1, [r4, 0x5] + add r0, sp, 0x8 + strb r1, [r0] + lsls r1, r5, 24 + asrs r1, 24 + bl ChangeBagPocketId + lsls r0, r5, 16 + asrs r1, r0, 16 + adds r5, r0, 0 + cmp r1, 0x1 + bne _081AC07C + ldr r2, =gUnknown_085E91FC + ldrb r0, [r4, 0x5] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + add r1, sp, 0x8 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl bag_menu_print_pocket_names + movs r0, 0 + bl bag_menu_copy_pocket_name_to_window + b _081AC09A + .pool +_081AC07C: + ldr r2, =gUnknown_085E91FC + add r0, sp, 0x8 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ldrb r1, [r4, 0x5] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl bag_menu_print_pocket_names + movs r0, 0x8 + bl bag_menu_copy_pocket_name_to_window +_081AC09A: + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + movs r1, 0 + bl bag_menu_draw_pocket_indicator_square + add r0, sp, 0x8 + ldrb r0, [r0] + movs r1, 0x1 + bl bag_menu_draw_pocket_indicator_square + movs r0, 0xF + str r0, [sp] + movs r0, 0x10 + str r0, [sp, 0x4] + movs r0, 0x2 + movs r1, 0xB + movs r2, 0xE + movs r3, 0x2 + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + add r0, sp, 0x8 + ldrb r0, [r0] + movs r1, 0x1 + bl SetBagVisualPocketId + movs r0, 0x1 + bl RemoveBagObject + asrs r0, r5, 16 + bl AddSwitchPocketRotatingBallObject + ldr r1, =sub_81AC10C + ldr r2, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r2 + ldr r2, [r0] + adds r0, r6, 0 + bl SetTaskFuncWithFollowupFunc + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end SwitchBagPocket + + thumb_func_start sub_81AC10C +sub_81AC10C: @ 81AC10C + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r6, r0, r1 + bl sub_81221AC + lsls r0, 24 + cmp r0, 0 + bne _081AC184 + bl IsWallysBag + lsls r0, 24 + cmp r0, 0 + bne _081AC184 + bl GetSwitchBagPocketDirection + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081AC148 + cmp r0, 0x2 + beq _081AC164 + b _081AC184 + .pool +_081AC148: + ldr r0, =gUnknown_0203CE5D + movs r1, 0x16 + ldrsb r1, [r6, r1] + bl ChangeBagPocketId + adds r0, r7, 0 + bl SwitchTaskToFollowupFunc + movs r1, 0x1 + negs r1, r1 + adds r0, r7, 0 + b _081AC178 + .pool +_081AC164: + ldr r0, =gUnknown_0203CE5D + movs r1, 0x16 + ldrsb r1, [r6, r1] + bl ChangeBagPocketId + adds r0, r7, 0 + bl SwitchTaskToFollowupFunc + adds r0, r7, 0 + movs r1, 0x1 +_081AC178: + movs r2, 0x1 + bl SwitchBagPocket + b _081AC22E + .pool +_081AC184: + movs r1, 0x1A + ldrsh r0, [r6, r1] + cmp r0, 0 + beq _081AC192 + cmp r0, 0x1 + beq _081AC1DC + b _081AC22E +_081AC192: + ldrb r0, [r6, 0x18] + bl sub_81AC23C + ldrh r0, [r6, 0x18] + adds r1, r0, 0x1 + strh r1, [r6, 0x18] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081AC1CC + movs r2, 0x16 + ldrsh r0, [r6, r2] + cmp r0, 0x1 + bne _081AC1BC + lsls r0, r1, 16 + asrs r0, 17 + lsls r0, 24 + lsrs r0, 24 + bl bag_menu_copy_pocket_name_to_window + b _081AC1CC +_081AC1BC: + lsls r1, 16 + asrs r1, 17 + movs r0, 0x8 + subs r0, r1 + lsls r0, 24 + lsrs r0, 24 + bl bag_menu_copy_pocket_name_to_window +_081AC1CC: + movs r1, 0x18 + ldrsh r0, [r6, r1] + cmp r0, 0x10 + bne _081AC22E + ldrh r0, [r6, 0x1A] + adds r0, 0x1 + strh r0, [r6, 0x1A] + b _081AC22E +_081AC1DC: + ldr r4, =gUnknown_0203CE5D + movs r1, 0x16 + ldrsb r1, [r6, r1] + adds r0, r4, 0 + bl ChangeBagPocketId + subs r5, r4, 0x5 + ldrb r0, [r5, 0x5] + bl load_bag_item_list_buffers + ldr r0, =gUnknown_03006310 + ldrb r2, [r5, 0x5] + lsls r2, 1 + adds r1, r4, 0 + adds r1, 0xD + adds r1, r2, r1 + ldrh r1, [r1] + adds r4, 0x3 + adds r2, r4 + ldrh r2, [r2] + bl ListMenuInit + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6] + movs r0, 0x1 + bl PutWindowTilemap + movs r0, 0x2 + bl PutWindowTilemap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + bl bag_menu_add_pocket_scroll_arrow_indicators_maybe + bl bag_menu_add_list_scroll_arrow_indicators_maybe + adds r0, r7, 0 + bl SwitchTaskToFollowupFunc +_081AC22E: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AC10C + + thumb_func_start sub_81AC23C +sub_81AC23C: @ 81AC23C + push {lr} + sub sp, 0x8 + adds r3, r0, 0 + lsls r3, 24 + movs r0, 0x80 + lsls r0, 18 + adds r3, r0 + lsrs r3, 24 + movs r0, 0xF + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r0, 0x2 + movs r1, 0x11 + movs r2, 0xE + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x8 + pop {r0} + bx r0 + thumb_func_end sub_81AC23C + + thumb_func_start bag_menu_draw_pocket_indicator_square +@ void bag_menu_draw_pocket_indicator_square(char x, int is_current_bag) +bag_menu_draw_pocket_indicator_square: @ 81AC26C + push {lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + cmp r1, 0 + bne _081AC298 + ldr r1, =0x00001017 + adds r2, r0, 0x5 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x1 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x2 + movs r3, 0x3 + bl FillBgTilemapBufferRect_Palette0 + b _081AC2AE + .pool +_081AC298: + ldr r1, =0x0000102b + adds r2, r0, 0x5 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x1 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x2 + movs r3, 0x3 + bl FillBgTilemapBufferRect_Palette0 +_081AC2AE: + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x8 + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_draw_pocket_indicator_square + + thumb_func_start sub_81AC2C0 +sub_81AC2C0: @ 81AC2C0 + push {lr} + ldr r1, =gUnknown_0203CE58 + ldrb r0, [r1, 0x4] + cmp r0, 0x1 + bhi _081AC2E0 + ldrb r0, [r1, 0x5] + subs r0, 0x2 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _081AC2E0 + movs r0, 0x1 + b _081AC2E2 + .pool +_081AC2E0: + movs r0, 0 +_081AC2E2: + pop {r1} + bx r1 + thumb_func_end sub_81AC2C0 + + thumb_func_start bag_menu_swap_items +bag_menu_swap_items: @ 81AC2E8 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + mov r9, r0 + adds r6, r4, r0 + ldrb r0, [r6] + movs r1, 0x10 + movs r2, 0x1 + bl sub_81AF15C + ldr r3, =gUnknown_0203CE58 + ldrb r0, [r3, 0x5] + lsls r0, 1 + adds r2, r3, 0 + adds r2, 0x12 + adds r2, r0, r2 + adds r1, r3, 0 + adds r1, 0x8 + adds r0, r1 + ldrh r1, [r0] + ldrh r2, [r2] + adds r1, r2 + strh r1, [r6, 0x2] + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r2, =0x0000081a + adds r0, r2 + movs r5, 0 + strb r1, [r0] + ldrb r0, [r3, 0x5] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r6, 0x2] + bl BagGetItemIdByPocketPosition + lsls r0, 16 + lsrs r0, 16 + ldr r1, =gStringVar1 + bl CopyItemName + ldr r0, =gStringVar4 + mov r8, r0 + ldr r1, =gUnknown_085E8DFE + bl StringExpandPlaceholders + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x1 + str r0, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + str r5, [sp, 0xC] + str r5, [sp, 0x10] + movs r1, 0x1 + mov r2, r8 + movs r3, 0x3 + bl bag_menu_print + ldrb r0, [r6, 0x2] + bl sub_80D4FEC + bl sub_81AB89C + ldrb r0, [r6] + movs r1, 0x2 + bl bag_menu_print_cursor_ + movs r2, 0x8 + negs r2, r2 + add r9, r2 + add r4, r9 + ldr r0, =sub_81AC3C0 + str r0, [r4] + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + 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 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081AC48E + ldr r0, =gMain + mov r8, r0 + ldrh r1, [r0, 0x2E] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _081AC418 + movs r0, 0x5 + bl PlaySE + ldrb r0, [r4] + ldr r3, =gUnknown_0203CE58 + ldrb r2, [r3, 0x5] + lsls r2, 1 + adds r1, r3, 0 + adds r1, 0x12 + adds r1, r2, r1 + adds r3, 0x8 + adds r2, r3 + bl get_coro_args_x18_x1A + b _081AC472 + .pool +_081AC418: + ldrb r0, [r4] + bl ListMenuHandleInput + adds r7, r0, 0 + ldrb r0, [r4] + ldr r5, =gUnknown_0203CE58 + ldrb r2, [r5, 0x5] + lsls r2, 1 + adds r1, r5, 0 + adds r1, 0x12 + adds r1, r2, r1 + adds r4, r5, 0 + adds r4, 0x8 + adds r2, r4 + bl get_coro_args_x18_x1A + movs r0, 0 + bl sub_80D4FC8 + ldrb r0, [r5, 0x5] + lsls r0, 1 + adds r0, r4 + ldrb r0, [r0] + bl sub_80D4FEC + movs r0, 0x2 + negs r0, r0 + cmp r7, r0 + beq _081AC460 + adds r0, 0x1 + cmp r7, r0 + bne _081AC482 + b _081AC48E + .pool +_081AC460: + movs r0, 0x5 + bl PlaySE + mov r0, r8 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081AC47A +_081AC472: + adds r0, r6, 0 + bl sub_81AC498 + b _081AC48E +_081AC47A: + adds r0, r6, 0 + bl sub_81AC590 + b _081AC48E +_081AC482: + movs r0, 0x5 + bl PlaySE + adds r0, r6, 0 + bl sub_81AC498 +_081AC48E: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81AC3C0 + + thumb_func_start sub_81AC498 +sub_81AC498: @ 81AC498 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + mov r10, r0 + ldr r0, =gTasks + 0x8 + add r0, r10 + mov r9, r0 + ldr r5, =gUnknown_0203CE58 + ldrb r6, [r5, 0x5] + lsls r1, r6, 1 + adds r0, r5, 0 + adds r0, 0x12 + adds r0, r1 + mov r8, r0 + ldr r2, =gUnknown_0203CE60 + adds r7, r1, r2 + ldrh r0, [r7] + mov r1, r8 + ldrh r1, [r1] + adds r0, r1 + lsls r0, 16 + lsrs r4, r0, 16 + mov r0, r9 + movs r1, 0x2 + ldrsh r2, [r0, r1] + cmp r2, r4 + beq _081AC4E2 + subs r0, r4, 0x1 + cmp r2, r0 + bne _081AC4F8 +_081AC4E2: + adds r0, r3, 0 + bl sub_81AC590 + b _081AC566 + .pool +_081AC4F8: + ldr r1, =gBagPockets + lsls r0, r6, 3 + adds r0, r1 + ldr r0, [r0] + adds r1, r2, 0 + adds r2, r4, 0 + bl sub_80D702C + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r2, =0x0000081a + adds r0, r2 + movs r1, 0xFF + strb r1, [r0] + mov r1, r9 + ldrb r0, [r1] + mov r1, r8 + adds r2, r7, 0 + bl sub_81AE6C8 + mov r2, r9 + movs r1, 0x2 + ldrsh r0, [r2, r1] + cmp r0, r4 + bge _081AC538 + ldrb r1, [r5, 0x5] + lsls r1, 1 + ldr r2, =gUnknown_0203CE60 + adds r1, r2 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] +_081AC538: + ldrb r0, [r5, 0x5] + bl load_bag_item_list_buffers + ldr r0, =gUnknown_03006310 + mov r2, r8 + ldrh r1, [r2] + ldrh r2, [r7] + bl ListMenuInit + lsls r0, 24 + lsrs r0, 24 + mov r1, r9 + strh r0, [r1] + movs r0, 0x1 + bl sub_80D4FC8 + bl bag_menu_add_list_scroll_arrow_indicators_maybe + ldr r0, =gTasks + 0x8 + subs r0, 0x8 + add r0, r10 + ldr r1, =Task_BagMenu + str r1, [r0] +_081AC566: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AC498 + + thumb_func_start sub_81AC590 +sub_81AC590: @ 81AC590 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + mov r9, r1 + ldr r0, =gTasks + 0x8 + mov r10, r0 + mov r7, r9 + add r7, r10 + ldr r4, =gUnknown_0203CE58 + ldrb r0, [r4, 0x5] + lsls r0, 1 + adds r1, r4, 0 + adds r1, 0x12 + adds r6, r0, r1 + movs r1, 0x8 + adds r1, r4 + mov r8, r1 + adds r5, r0, r1 + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r1, =0x0000081a + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldrb r0, [r7] + adds r1, r6, 0 + adds r2, r5, 0 + bl sub_81AE6C8 + movs r0, 0x2 + ldrsh r2, [r7, r0] + ldrh r0, [r6] + ldrh r1, [r5] + adds r0, r1 + cmp r2, r0 + bge _081AC5F2 + ldrb r1, [r4, 0x5] + lsls r1, 1 + add r1, r8 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] +_081AC5F2: + ldrb r0, [r4, 0x5] + bl load_bag_item_list_buffers + ldr r0, =gUnknown_03006310 + ldrh r1, [r6] + ldrh r2, [r5] + bl ListMenuInit + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7] + movs r0, 0x1 + bl sub_80D4FC8 + bl bag_menu_add_list_scroll_arrow_indicators_maybe + mov r0, r10 + subs r0, 0x8 + add r0, r9 + ldr r1, =Task_BagMenu + str r1, [r0] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AC590 + + thumb_func_start sub_81AC644 +sub_81AC644: @ 81AC644 + push {r4,r5,lr} + sub sp, 0x14 + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x4] + subs r0, 0x1 + cmp r0, 0x9 + bls _081AC654 + b _081AC82C +_081AC654: + lsls r0, 2 + ldr r1, =_081AC668 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081AC668: + .4byte _081AC690 + .4byte _081AC82C + .4byte _081AC82C + .4byte _081AC82C + .4byte _081AC6E8 + .4byte _081AC82C + .4byte _081AC76C + .4byte _081AC7CC + .4byte _081AC70C + .4byte _081AC690 +_081AC690: + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + bl ItemId_GetBattleUsage + lsls r0, 24 + cmp r0, 0 + beq _081AC6C4 + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_08614042 + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x2 + b _081ACA10 + .pool +_081AC6C4: + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_08614046 + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x1 + b _081ACA10 + .pool +_081AC6E8: + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_08614047 + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x4 + b _081ACA10 + .pool +_081AC70C: + ldr r4, =gUnknown_0203CE7C + ldrh r0, [r4] + bl itemid_is_unique + lsls r0, 24 + cmp r0, 0 + bne _081AC748 + ldrh r0, [r4] + cmp r0, 0xAF + beq _081AC748 + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_0861404B + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x2 + b _081ACA10 + .pool +_081AC748: + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_08614046 + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x1 + b _081ACA10 + .pool +_081AC76C: + ldr r4, =gUnknown_0203CE7C + ldrh r0, [r4] + bl itemid_is_unique + lsls r0, 24 + cmp r0, 0 + bne _081AC7A8 + ldrh r0, [r4] + cmp r0, 0xAF + beq _081AC7A8 + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_0861404D + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x2 + b _081ACA10 + .pool +_081AC7A8: + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_08614046 + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x1 + b _081ACA10 + .pool +_081AC7CC: + ldr r4, =gUnknown_0203CE7C + ldrh r0, [r4] + bl itemid_is_unique + lsls r0, 24 + cmp r0, 0 + bne _081AC808 + ldrh r0, [r4] + cmp r0, 0xAF + beq _081AC808 + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_0861404F + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x2 + b _081ACA10 + .pool +_081AC808: + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_08614046 + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x1 + b _081ACA10 + .pool +_081AC82C: + bl sub_81221AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081AC840 + bl InUnionRoom + cmp r0, 0x1 + bne _081AC8A4 +_081AC840: + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + cmp r0, 0x4 + beq _081AC856 + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + bl sub_8122148 + lsls r0, 24 + cmp r0, 0 + bne _081AC880 +_081AC856: + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_08614046 + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x1 + b _081ACA10 + .pool +_081AC880: + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_08614044 + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x2 + b _081ACA10 + .pool +_081AC8A4: + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + cmp r0, 0x4 + bls _081AC8AE + b _081ACA12 +_081AC8AE: + lsls r0, 2 + ldr r1, =_081AC8C0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081AC8C0: + .4byte _081AC8D4 + .4byte _081AC9B4 + .4byte _081AC9D8 + .4byte _081AC9FC + .4byte _081AC92C +_081AC8D4: + ldr r4, =gUnknown_0203CE54 + ldr r1, [r4] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r3, =0x00000824 + adds r0, r1, r3 + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x4 + strb r0, [r1] + ldr r0, [r4] + adds r0, r3 + ldr r1, =gUnknown_0861402C + movs r2, 0x4 + bl memcpy + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + bl itemid_is_mail + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081AC90A + b _081ACA12 +_081AC90A: + ldr r0, [r4] + ldr r1, =0x00000824 + adds r0, r1 + movs r1, 0x6 + strb r1, [r0] + b _081ACA12 + .pool +_081AC92C: + ldr r4, =gUnknown_0203CE54 + ldr r1, [r4] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r5, =0x00000824 + adds r0, r1, r5 + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x4 + strb r0, [r1] + ldr r0, [r4] + adds r0, r5 + ldr r1, =gUnknown_08614030 + movs r2, 0x4 + bl memcpy + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00000496 + adds r0, r1 + ldr r2, =gUnknown_0203CE7C + ldrh r0, [r0] + ldrh r1, [r2] + cmp r0, r1 + bne _081AC96C + ldr r0, [r4] + ldr r1, =0x00000825 + adds r0, r1 + movs r1, 0x8 + strb r1, [r0] +_081AC96C: + ldrh r1, [r2] + ldr r0, =0x00000103 + cmp r1, r0 + beq _081AC97A + adds r0, 0xD + cmp r1, r0 + bne _081ACA12 +_081AC97A: + movs r0, 0x6 + bl TestPlayerAvatarFlags + lsls r0, 24 + cmp r0, 0 + beq _081ACA12 + ldr r0, [r4] + adds r0, r5 + movs r1, 0x7 + strb r1, [r0] + b _081ACA12 + .pool +_081AC9B4: + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_08614034 + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x4 + b _081ACA10 + .pool +_081AC9D8: + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_08614038 + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x4 + b _081ACA10 + .pool +_081AC9FC: + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + movs r0, 0x82 + lsls r0, 4 + adds r2, r1, r0 + ldr r0, =gUnknown_0861403C + str r0, [r2] + ldr r0, =0x00000828 + adds r1, r0 + movs r0, 0x6 +_081ACA10: + strb r0, [r1] +_081ACA12: + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + cmp r0, 0x2 + bne _081ACA50 + movs r0, 0x1 + bl ClearWindowTilemap + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + bl PrintTMHMMoveData + movs r0, 0x3 + bl PutWindowTilemap + movs r0, 0x4 + bl PutWindowTilemap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + b _081ACA86 + .pool +_081ACA50: + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E8DBE + adds r0, r4, 0 + bl StringExpandPlaceholders + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r0, [sp, 0x10] + movs r0, 0x1 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x3 + bl bag_menu_print +_081ACA86: + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r1, =0x00000828 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _081ACAB0 + movs r0, 0 + b _081ACAB6 + .pool +_081ACAB0: + cmp r0, 0x2 + bne _081ACAC4 + movs r0, 0x1 +_081ACAB6: + bl bag_menu_add_window + lsls r0, 24 + lsrs r0, 24 + bl sub_81ACAF8 + b _081ACAEE +_081ACAC4: + cmp r0, 0x4 + bne _081ACADC + movs r0, 0x2 + bl bag_menu_add_window + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + movs r2, 0x2 + bl sub_81ACB54 + b _081ACAEE +_081ACADC: + movs r0, 0x3 + bl bag_menu_add_window + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + movs r2, 0x3 + bl sub_81ACB54 +_081ACAEE: + add sp, 0x14 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81AC644 + + thumb_func_start sub_81ACAF8 +sub_81ACAF8: @ 81ACAF8 + push {r4-r6,lr} + sub sp, 0x14 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + str r0, [sp] + movs r0, 0x10 + str r0, [sp, 0x4] + ldr r6, =gUnknown_0203CE54 + ldr r1, [r6] + ldr r5, =0x00000828 + adds r0, r1, r5 + ldrb r0, [r0] + str r0, [sp, 0x8] + ldr r0, =gUnknown_08613FB4 + str r0, [sp, 0xC] + movs r0, 0x82 + lsls r0, 4 + adds r1, r0 + ldr r0, [r1] + str r0, [sp, 0x10] + adds r0, r4, 0 + movs r1, 0x7 + movs r2, 0x8 + movs r3, 0x1 + bl AddItemMenuActionTextPrinters + ldr r0, [r6] + adds r0, r5 + ldrb r1, [r0] + adds r0, r4, 0 + movs r2, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81ACAF8 + + thumb_func_start sub_81ACB54 +sub_81ACB54: @ 81ACB54 + push {r4-r6,lr} + sub sp, 0x14 + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + movs r0, 0x38 + str r0, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + ldr r0, =gUnknown_08613FB4 + str r0, [sp, 0xC] + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + movs r1, 0x82 + lsls r1, 4 + adds r0, r1 + ldr r0, [r0] + str r0, [sp, 0x10] + adds r0, r4, 0 + movs r1, 0x7 + movs r2, 0x8 + movs r3, 0x1 + bl sub_8198DBC + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r1, 0x38 + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_8199944 + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81ACB54 + + thumb_func_start unknown_item_menu_type +unknown_item_menu_type: @ 81ACBB0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_81AC644 + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r1, =0x00000828 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x2 + bhi _081ACBE8 + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =Task_HandleInBattleItemMenuInput + b _081ACBF4 + .pool +_081ACBE8: + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =Task_HandleOutOfBattleItemMenuInput +_081ACBF4: + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end unknown_item_menu_type + + thumb_func_start Task_HandleInBattleItemMenuInput +Task_HandleInBattleItemMenuInput: @ 81ACC04 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081ACC6A + bl ProcessMenuInputNoWrapAround + lsls r0, 24 + asrs r4, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _081ACC6A + adds r0, 0x1 + cmp r4, r0 + bne _081ACC44 + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_08613FB4 + ldr r1, [r0, 0x24] + adds r0, r5, 0 + bl _call_via_r1 + b _081ACC6A + .pool +_081ACC44: + movs r0, 0x5 + bl PlaySE + ldr r1, =gUnknown_08613FB4 + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + movs r2, 0x82 + lsls r2, 4 + adds r0, r2 + ldr r0, [r0] + adds r0, r4 + ldrb r0, [r0] + lsls r0, 3 + adds r1, 0x4 + adds r0, r1 + ldr r1, [r0] + adds r0, r6, 0 + bl _call_via_r1 +_081ACC6A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end Task_HandleInBattleItemMenuInput + + thumb_func_start Task_HandleOutOfBattleItemMenuInput +Task_HandleOutOfBattleItemMenuInput: @ 81ACC78 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081ACC8C + b _081ACDF0 +_081ACC8C: + bl GetMenuCursorPos + lsls r0, 24 + lsrs r4, r0, 24 + ldr r5, =gMain + ldrh r1, [r5, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081ACCD4 + lsls r0, r4, 24 + asrs r0, 24 + cmp r0, 0 + bgt _081ACCAA + b _081ACDF0 +_081ACCAA: + subs r0, 0x2 + lsls r0, 24 + asrs r0, 24 + bl sub_81ACDFC + lsls r0, 24 + cmp r0, 0 + bne _081ACCBC + b _081ACDF0 +_081ACCBC: + movs r0, 0x5 + bl PlaySE + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + bl sub_8199134 + b _081ACDF0 + .pool +_081ACCD4: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081ACD1C + lsls r0, r4, 24 + asrs r1, r0, 24 + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r2, =0x00000828 + adds r0, r2 + ldrb r0, [r0] + subs r0, 0x2 + cmp r1, r0 + blt _081ACCF2 + b _081ACDF0 +_081ACCF2: + adds r0, r1, 0x2 + lsls r0, 24 + asrs r0, 24 + bl sub_81ACDFC + lsls r0, 24 + cmp r0, 0 + beq _081ACDF0 + movs r0, 0x5 + bl PlaySE + movs r0, 0 + movs r1, 0x1 + bl sub_8199134 + b _081ACDF0 + .pool +_081ACD1C: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _081ACD30 + bl GetLRKeysState + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081ACD58 +_081ACD30: + lsls r0, r4, 24 + asrs r1, r0, 24 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081ACDF0 + subs r0, r1, 0x1 + lsls r0, 24 + asrs r0, 24 + bl sub_81ACDFC + lsls r0, 24 + cmp r0, 0 + beq _081ACDF0 + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 + negs r0, r0 + b _081ACD92 +_081ACD58: + ldrh r1, [r5, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _081ACD6E + bl GetLRKeysState + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _081ACD9A +_081ACD6E: + lsls r0, r4, 24 + asrs r1, r0, 24 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081ACDF0 + adds r0, r1, 0x1 + lsls r0, 24 + asrs r0, 24 + bl sub_81ACDFC + lsls r0, 24 + cmp r0, 0 + beq _081ACDF0 + movs r0, 0x5 + bl PlaySE + movs r0, 0x1 +_081ACD92: + movs r1, 0 + bl sub_8199134 + b _081ACDF0 +_081ACD9A: + ldrh r1, [r5, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081ACDD8 + movs r0, 0x5 + bl PlaySE + ldr r2, =gUnknown_08613FB4 + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + lsls r1, r4, 24 + asrs r1, 24 + movs r3, 0x82 + lsls r3, 4 + adds r0, r3 + ldr r0, [r0] + adds r0, r1 + ldrb r0, [r0] + lsls r0, 3 + adds r2, 0x4 + adds r0, r2 + ldr r1, [r0] + adds r0, r6, 0 + bl _call_via_r1 + b _081ACDF0 + .pool +_081ACDD8: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081ACDF0 + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_08613FB4 + ldr r1, [r0, 0x24] + adds r0, r6, 0 + bl _call_via_r1 +_081ACDF0: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end Task_HandleOutOfBattleItemMenuInput + + thumb_func_start sub_81ACDFC +sub_81ACDFC: @ 81ACDFC + push {lr} + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + blt _081ACE30 + ldr r0, =gUnknown_0203CE54 + ldr r2, [r0] + ldr r3, =0x00000828 + adds r0, r2, r3 + ldrb r0, [r0] + cmp r1, r0 + bgt _081ACE30 + movs r3, 0x82 + lsls r3, 4 + adds r0, r2, r3 + ldr r0, [r0] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0xE + beq _081ACE30 + movs r0, 0x1 + b _081ACE32 + .pool +_081ACE30: + movs r0, 0 +_081ACE32: + pop {r1} + bx r1 + thumb_func_end sub_81ACDFC + + thumb_func_start bag_menu_remove_some_window +bag_menu_remove_some_window: @ 81ACE38 + push {lr} + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r1, =0x00000828 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _081ACE58 + movs r0, 0 + bl bag_menu_remove_window + b _081ACE76 + .pool +_081ACE58: + cmp r0, 0x2 + bne _081ACE64 + movs r0, 0x1 + bl bag_menu_remove_window + b _081ACE76 +_081ACE64: + cmp r0, 0x4 + bne _081ACE70 + movs r0, 0x2 + bl bag_menu_remove_window + b _081ACE76 +_081ACE70: + movs r0, 0x3 + bl bag_menu_remove_window +_081ACE76: + pop {r0} + bx r0 + thumb_func_end bag_menu_remove_some_window + + thumb_func_start ItemMenu_UseOutOfBattle +@ void ItemMenu_UseOutOfBattle(u8 taskId) +ItemMenu_UseOutOfBattle: @ 81ACE7C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r5, =gUnknown_0203CE7C + ldrh r0, [r5] + bl ItemId_GetFieldFunc + cmp r0, 0 + beq _081ACEEE + bl bag_menu_remove_some_window + bl calc_player_party_count + lsls r0, 24 + cmp r0, 0 + bne _081ACEB8 + ldrh r0, [r5] + bl ItemId_GetType + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081ACEB8 + adds r0, r4, 0 + bl bag_menu_print_there_is_no_pokemon + b _081ACEEE + .pool +_081ACEB8: + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + cmp r0, 0x3 + beq _081ACEE8 + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + bl ItemId_GetFieldFunc + adds r1, r0, 0 + adds r0, r4, 0 + bl _call_via_r1 + b _081ACEEE + .pool +_081ACEE8: + adds r0, r4, 0 + bl sub_80FDD10 +_081ACEEE: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end ItemMenu_UseOutOfBattle + + thumb_func_start ItemMenu_Toss +ItemMenu_Toss: @ 81ACEF4 + push {r4-r7,lr} + sub sp, 0x14 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r6, r0, 3 + ldr r7, =gTasks + 0x8 + adds r4, r6, r7 + bl bag_menu_remove_some_window + movs r0, 0x1 + strh r0, [r4, 0x10] + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _081ACF24 + adds r0, r5, 0 + bl BagMenuConfirmToss + b _081ACF6A + .pool +_081ACF24: + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E8EE0 + adds r0, r4, 0 + bl StringExpandPlaceholders + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r0, [sp, 0x10] + movs r0, 0x1 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x3 + bl bag_menu_print + movs r0, 0x7 + bl sub_81ABC3C + adds r0, r7, 0 + subs r0, 0x8 + adds r0, r6, r0 + ldr r1, =Task_ChooseHowManyToToss + str r1, [r0] +_081ACF6A: + add sp, 0x14 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end ItemMenu_Toss + + thumb_func_start BagMenuConfirmToss +BagMenuConfirmToss: @ 81ACF88 + push {r4,r5,lr} + sub sp, 0x14 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r0, =gStringVar2 + movs r2, 0x10 + ldrsh r1, [r4, r2] + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E8F0E + adds r0, r4, 0 + bl StringExpandPlaceholders + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r0, [sp, 0x10] + movs r0, 0x1 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x3 + bl bag_menu_print + ldr r2, =gUnknown_08614084 + adds r0, r5, 0 + movs r1, 0x5 + bl bag_menu_yes_no + add sp, 0x14 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end BagMenuConfirmToss + + thumb_func_start BagMenuCancelToss +BagMenuCancelToss: @ 81AD010 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + movs r1, 0x2 + ldrsh r0, [r4, r1] + bl bag_menu_print_description_box_text + ldrb r0, [r4] + movs r1, 0 + bl bag_menu_print_cursor_ + adds r0, r5, 0 + bl set_callback3_to_bag + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end BagMenuCancelToss + + thumb_func_start Task_ChooseHowManyToToss +Task_ChooseHowManyToToss: @ 81AD044 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + adds r0, r4, 0 + adds r0, 0x10 + ldrh r1, [r4, 0x4] + bl AdjustQuantityAccordingToDPadInput + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081AD088 + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r1, =0x00000817 + adds r0, r1 + ldrb r0, [r0] + movs r2, 0x10 + ldrsh r1, [r4, r2] + bl sub_81ABC54 + b _081AD0C6 + .pool +_081AD088: + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081AD0AC + movs r0, 0x5 + bl PlaySE + movs r0, 0x7 + bl bag_menu_remove_window + adds r0, r5, 0 + bl BagMenuConfirmToss + b _081AD0C6 + .pool +_081AD0AC: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081AD0C6 + movs r0, 0x5 + bl PlaySE + movs r0, 0x7 + bl bag_menu_remove_window + adds r0, r6, 0 + bl BagMenuCancelToss +_081AD0C6: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end Task_ChooseHowManyToToss + + thumb_func_start BagMenuActuallyToss +BagMenuActuallyToss: @ 81AD0CC + push {r4-r6,lr} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r5, =gTasks + 0x8 + adds r6, r4, r5 + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r0, =gStringVar2 + movs r2, 0x10 + ldrsh r1, [r6, r2] + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + ldr r6, =gStringVar4 + ldr r1, =gUnknown_085E8EF9 + adds r0, r6, 0 + bl StringExpandPlaceholders + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r0, [sp, 0x10] + movs r0, 0x1 + movs r1, 0x1 + adds r2, r6, 0 + movs r3, 0x3 + bl bag_menu_print + subs r5, 0x8 + adds r4, r5 + ldr r0, =Task_ActuallyToss + str r0, [r4] + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end BagMenuActuallyToss + + thumb_func_start Task_ActuallyToss +Task_ActuallyToss: @ 81AD150 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r5, r0, r1 + ldr r4, =gUnknown_0203CE58 + ldrb r0, [r4, 0x5] + lsls r0, 1 + adds r1, r4, 0 + adds r1, 0x12 + adds r1, r0 + mov r8, r1 + adds r1, r4, 0 + adds r1, 0x8 + adds r7, r0, r1 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _081AD1CE + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + ldrh r1, [r5, 0x10] + bl RemoveBagItem + ldrb r0, [r5] + mov r1, r8 + adds r2, r7, 0 + bl sub_81AE6C8 + ldrb r0, [r4, 0x5] + bl sub_81AB9A8 + ldrb r0, [r4, 0x5] + bl sub_81ABA88 + ldrb r0, [r4, 0x5] + bl load_bag_item_list_buffers + ldr r0, =gUnknown_03006310 + mov r2, r8 + ldrh r1, [r2] + ldrh r2, [r7] + bl ListMenuInit + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5] + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + adds r0, r6, 0 + bl set_callback3_to_bag +_081AD1CE: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end Task_ActuallyToss + + thumb_func_start ItemMenu_Register +ItemMenu_Register: @ 81AD1EC + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r7, r0, r1 + ldr r0, =gUnknown_0203CE58 + ldrb r1, [r0, 0x5] + lsls r1, 1 + adds r2, r0, 0 + adds r2, 0x12 + adds r6, r1, r2 + adds r0, 0x8 + adds r5, r1, r0 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r2, =0x00000496 + adds r1, r0, r2 + ldr r0, =gUnknown_0203CE7C + ldrh r2, [r0] + ldrh r0, [r1] + cmp r0, r2 + bne _081AD238 + movs r0, 0 + strh r0, [r1] + b _081AD23A + .pool +_081AD238: + strh r2, [r1] +_081AD23A: + ldrb r0, [r7] + adds r1, r6, 0 + adds r2, r5, 0 + bl sub_81AE6C8 + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + bl load_bag_item_list_buffers + ldr r0, =gUnknown_03006310 + ldrh r1, [r6] + ldrh r2, [r5] + bl ListMenuInit + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7] + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + adds r0, r4, 0 + bl ItemMenu_Cancel + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end ItemMenu_Register + + thumb_func_start ItemMenu_Give +ItemMenu_Give: @ 81AD278 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + bl bag_menu_remove_some_window + ldr r5, =gUnknown_0203CE7C + ldrh r0, [r5] + bl itemid_80BF6D8_mail_related + lsls r0, 24 + cmp r0, 0 + bne _081AD2AC + ldr r2, =gUnknown_085E8DCE + ldr r3, =sub_81AD350 + adds r0, r4, 0 + movs r1, 0x1 + bl DisplayItemMessage + b _081AD2EA + .pool +_081AD2AC: + ldrh r0, [r5] + bl itemid_is_unique + lsls r0, 24 + cmp r0, 0 + bne _081AD2E4 + bl calc_player_party_count + lsls r0, 24 + cmp r0, 0 + bne _081AD2CA + adds r0, r4, 0 + bl bag_menu_print_there_is_no_pokemon + b _081AD2EA +_081AD2CA: + ldr r0, =gUnknown_0203CE54 + ldr r1, [r0] + ldr r0, =sub_81B7F60 + str r0, [r1] + adds r0, r4, 0 + bl unknown_ItemMenu_Confirm + b _081AD2EA + .pool +_081AD2E4: + adds r0, r6, 0 + bl bag_menu_print_cant_be_held_msg +_081AD2EA: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end ItemMenu_Give + + thumb_func_start bag_menu_print_there_is_no_pokemon +bag_menu_print_there_is_no_pokemon: @ 81AD2F0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gUnknown_085E8DE9 + ldr r3, =sub_81AD350 + movs r1, 0x1 + bl DisplayItemMessage + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_print_there_is_no_pokemon + + thumb_func_start bag_menu_print_cant_be_held_msg +bag_menu_print_cant_be_held_msg: @ 81AD30C + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r5, =gStringVar4 + ldr r1, =gUnknown_085E8E11 + adds r0, r5, 0 + bl StringExpandPlaceholders + ldr r3, =sub_81AD350 + adds r0, r4, 0 + movs r1, 0x1 + adds r2, r5, 0 + bl DisplayItemMessage + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_print_cant_be_held_msg + + thumb_func_start sub_81AD350 +sub_81AD350: @ 81AD350 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081AD36E + movs r0, 0x5 + bl PlaySE + adds r0, r4, 0 + bl bag_menu_inits_lists_menu +_081AD36E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AD350 + + thumb_func_start ItemMenu_CheckTag +ItemMenu_CheckTag: @ 81AD378 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0203CE54 + ldr r2, [r1] + ldr r1, =sub_8177C14 + str r1, [r2] + bl unknown_ItemMenu_Confirm + pop {r0} + bx r0 + .pool + thumb_func_end ItemMenu_CheckTag + + thumb_func_start ItemMenu_Cancel +ItemMenu_Cancel: @ 81AD398 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + bl bag_menu_remove_some_window + movs r1, 0x2 + ldrsh r0, [r4, r1] + bl bag_menu_print_description_box_text + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + ldrb r0, [r4] + movs r1, 0 + bl bag_menu_print_cursor_ + adds r0, r5, 0 + bl set_callback3_to_bag + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ItemMenu_Cancel + + thumb_func_start ItemMenu_UseInBattle +ItemMenu_UseInBattle: @ 81AD3DC + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =gUnknown_0203CE7C + ldrh r0, [r4] + bl ItemId_GetBattleFunc + cmp r0, 0 + beq _081AD400 + bl bag_menu_remove_some_window + ldrh r0, [r4] + bl ItemId_GetBattleFunc + adds r1, r0, 0 + adds r0, r5, 0 + bl _call_via_r1 +_081AD400: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ItemMenu_UseInBattle + + thumb_func_start bag_menu_mail_related +bag_menu_mail_related: @ 81AD40C + push {lr} + movs r0, 0xC + movs r1, 0x5 + movs r2, 0 + bl GoToBagMenu + pop {r0} + bx r0 + thumb_func_end bag_menu_mail_related + + thumb_func_start item_menu_type_2 +item_menu_type_2: @ 81AD41C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =gUnknown_0203CE7C + ldrh r0, [r4] + bl itemid_80BF6D8_mail_related + lsls r0, 24 + cmp r0, 0 + bne _081AD44C + ldr r2, =gUnknown_085E8DCE + ldr r3, =sub_81AD350 + adds r0, r5, 0 + movs r1, 0x1 + bl DisplayItemMessage + b _081AD4AE + .pool +_081AD44C: + ldrh r0, [r4] + bl sub_8122148 + lsls r0, 24 + cmp r0, 0 + bne _081AD488 + ldrh r0, [r4] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E8E27 + adds r0, r4, 0 + bl StringExpandPlaceholders + ldr r3, =sub_81AD350 + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl DisplayItemMessage + b _081AD4AE + .pool +_081AD488: + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + cmp r0, 0x4 + beq _081AD4A8 + ldrh r0, [r4] + bl itemid_is_unique + lsls r0, 24 + cmp r0, 0 + bne _081AD4A8 + adds r0, r5, 0 + bl unknown_ItemMenu_Confirm + b _081AD4AE + .pool +_081AD4A8: + adds r0, r5, 0 + bl bag_menu_print_cant_be_held_msg +_081AD4AE: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end item_menu_type_2 + + thumb_func_start item_menu_type_b +item_menu_type_b: @ 81AD4B4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r5, =gUnknown_0203CE7C + ldrh r0, [r5] + bl itemid_is_mail + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081AD4E4 + ldr r2, =gUnknown_085E8DCE + ldr r3, =sub_81AD350 + adds r0, r4, 0 + movs r1, 0x1 + bl DisplayItemMessage + b _081AD51A + .pool +_081AD4E4: + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x5] + cmp r0, 0x4 + beq _081AD514 + ldrh r0, [r5] + bl itemid_is_unique + lsls r0, 24 + cmp r0, 0 + bne _081AD514 + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =unknown_ItemMenu_Confirm + str r0, [r1] + b _081AD51A + .pool +_081AD514: + adds r0, r4, 0 + bl bag_menu_print_cant_be_held_msg +_081AD51A: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end item_menu_type_b + + thumb_func_start UseRegisteredKeyItemOnField +@ bool8 UseRegisteredKeyItemOnField() +UseRegisteredKeyItemOnField: @ 81AD520 + push {r4-r7,lr} + bl InUnionRoom + cmp r0, 0x1 + beq _081AD54C + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + bne _081AD54C + bl InBattlePike + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0 + bne _081AD54C + bl in_multi_battle_room_with_var_condition + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081AD550 +_081AD54C: + movs r0, 0 + b _081AD5D2 +_081AD550: + bl HideMapNamePopUpWindow + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgY_ScreenOff + ldr r4, =gSaveBlock1Ptr + ldr r0, [r4] + ldr r5, =0x00000496 + adds r1, r0, r5 + ldrh r0, [r1] + cmp r0, 0 + beq _081AD5CA + movs r1, 0x1 + bl CheckBagHasItem + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x1 + bne _081AD5C4 + bl script_env_2_enable + bl player_bitmagic + bl sub_808B864 + bl sub_808BCF4 + ldr r2, =gUnknown_0203CE7C + ldr r0, [r4] + adds r0, r5 + ldrh r1, [r0] + strh r1, [r2] + ldrh r0, [r0] + bl ItemId_GetFieldFunc + movs r1, 0x8 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r6, [r1, 0xE] + b _081AD5D0 + .pool +_081AD5C4: + ldr r0, [r4] + adds r0, r5 + strh r7, [r0] +_081AD5CA: + ldr r0, =gUnknown_082736B3 + bl script_env_1_execute_new_script +_081AD5D0: + movs r0, 0x1 +_081AD5D2: + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end UseRegisteredKeyItemOnField + + thumb_func_start display_sell_item_ask_str +@ void display_sell_item_ask_str(int a1) +display_sell_item_ask_str: @ 81AD5DC + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r7, r5, 0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + ldr r6, =gUnknown_0203CE7C + ldrh r0, [r6] + bl itemid_get_market_price + lsls r0, 16 + cmp r0, 0 + bne _081AD634 + ldrh r0, [r6] + ldr r1, =gStringVar2 + bl CopyItemName + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E960F + adds r0, r4, 0 + bl StringExpandPlaceholders + ldr r3, =bag_menu_inits_lists_menu + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl DisplayItemMessage + b _081AD66A + .pool +_081AD634: + movs r0, 0x1 + strh r0, [r4, 0x10] + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _081AD64C + bl bag_menu_add_money_window + adds r0, r5, 0 + bl sub_81AD680 + b _081AD66A +_081AD64C: + ldrh r0, [r6] + ldr r1, =gStringVar2 + bl CopyItemName + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E962F + adds r0, r4, 0 + bl StringExpandPlaceholders + ldr r3, =sub_81AD730 + adds r0, r7, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl DisplayItemMessage +_081AD66A: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end display_sell_item_ask_str + + thumb_func_start sub_81AD680 +sub_81AD680: @ 81AD680 + push {r4-r6,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + ldr r6, =gStringVar1 + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + bl itemid_get_market_price + lsls r0, 16 + lsrs r0, 17 + movs r2, 0x10 + ldrsh r1, [r4, r2] + muls r1, r0 + adds r0, r6, 0 + movs r2, 0 + movs r3, 0x6 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9654 + adds r0, r4, 0 + bl StringExpandPlaceholders + ldr r3, =sub_81AD6E4 + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl DisplayItemMessage + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AD680 + + thumb_func_start sub_81AD6E4 +sub_81AD6E4: @ 81AD6E4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gUnknown_0861408C + movs r1, 0x6 + bl bag_menu_yes_no + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AD6E4 + + thumb_func_start sub_81AD6FC +sub_81AD6FC: @ 81AD6FC + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + bl bag_menu_remove_money_window + movs r0, 0x4 + bl bag_menu_RemoveBagItem_message_window + ldrb r0, [r4] + movs r1, 0 + bl bag_menu_print_cursor_ + adds r0, r5, 0 + bl set_callback3_to_bag + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AD6FC + + thumb_func_start sub_81AD730 +sub_81AD730: @ 81AD730 + push {r4-r6,lr} + mov r6, r8 + push {r6} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r6, =gTasks + 0x8 + adds r0, r4, r6 + mov r8, r0 + movs r0, 0x8 + bl bag_menu_add_window + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + bl itemid_get_market_price + lsls r0, 16 + lsrs r0, 17 + mov r2, r8 + movs r3, 0x10 + ldrsh r1, [r2, r3] + adds r2, r0, 0 + muls r2, r1 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_81ABCC0 + bl bag_menu_add_money_window + subs r6, 0x8 + adds r4, r6 + ldr r0, =sub_81AD794 + str r0, [r4] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AD730 + + thumb_func_start sub_81AD794 +sub_81AD794: @ 81AD794 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r6, r0, r1 + adds r0, r6, 0 + adds r0, 0x10 + ldrh r1, [r6, 0x4] + bl AdjustQuantityAccordingToDPadInput + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081AD7F4 + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r1, =0x00000818 + adds r0, r1 + ldrb r4, [r0] + movs r2, 0x10 + ldrsh r5, [r6, r2] + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + bl itemid_get_market_price + lsls r0, 16 + lsrs r0, 17 + movs r2, 0x10 + ldrsh r1, [r6, r2] + adds r2, r0, 0 + muls r2, r1 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_81ABCC0 + b _081AD844 + .pool +_081AD7F4: + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081AD818 + movs r0, 0x5 + bl PlaySE + movs r0, 0x8 + bl bag_menu_remove_window + adds r0, r4, 0 + bl sub_81AD680 + b _081AD844 + .pool +_081AD818: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081AD844 + movs r0, 0x5 + bl PlaySE + ldrb r0, [r6] + movs r1, 0 + bl bag_menu_print_cursor_ + bl bag_menu_remove_money_window + movs r0, 0x8 + bl bag_menu_remove_window + movs r0, 0x4 + bl bag_menu_RemoveBagItem_message_window + adds r0, r5, 0 + bl set_callback3_to_bag +_081AD844: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81AD794 + + thumb_func_start sub_81AD84C +sub_81AD84C: @ 81AD84C + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + ldr r6, =gUnknown_0203CE7C + ldrh r0, [r6] + ldr r1, =gStringVar2 + bl CopyItemName + ldr r0, =gStringVar1 + mov r8, r0 + ldrh r0, [r6] + bl itemid_get_market_price + lsls r0, 16 + lsrs r0, 17 + movs r2, 0x10 + ldrsh r1, [r4, r2] + muls r1, r0 + mov r0, r8 + movs r2, 0 + movs r3, 0x6 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9677 + adds r0, r4, 0 + bl StringExpandPlaceholders + ldr r3, =sub_81AD8C8 + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl DisplayItemMessage + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AD84C + + thumb_func_start sub_81AD8C8 +sub_81AD8C8: @ 81AD8C8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + lsls r6, r0, 2 + adds r6, r0 + lsls r6, 3 + ldr r0, =gTasks + 0x8 + adds r0, r6 + mov r10, r0 + ldr r7, =gUnknown_0203CE58 + ldrb r5, [r7, 0x5] + lsls r5, 1 + movs r1, 0x12 + adds r1, r7 + mov r9, r1 + add r9, r5 + adds r0, r7, 0 + adds r0, 0x8 + adds r5, r0 + movs r0, 0x5F + bl PlaySE + ldr r2, =gUnknown_0203CE7C + mov r8, r2 + ldrh r0, [r2] + mov r3, r10 + ldrh r1, [r3, 0x10] + bl RemoveBagItem + ldr r0, =gSaveBlock1Ptr + ldr r4, [r0] + movs r1, 0x92 + lsls r1, 3 + adds r4, r1 + mov r2, r8 + ldrh r0, [r2] + bl itemid_get_market_price + lsls r0, 16 + lsrs r0, 17 + mov r3, r10 + movs r2, 0x10 + ldrsh r1, [r3, r2] + muls r1, r0 + adds r0, r4, 0 + bl add_money + mov r3, r10 + ldrb r0, [r3] + mov r1, r9 + adds r2, r5, 0 + bl sub_81AE6C8 + ldrb r0, [r7, 0x5] + bl sub_81AB9A8 + ldrb r0, [r7, 0x5] + bl sub_81ABA88 + ldrb r0, [r7, 0x5] + bl load_bag_item_list_buffers + ldr r0, =gUnknown_03006310 + mov r2, r9 + ldrh r1, [r2] + ldrh r2, [r5] + bl ListMenuInit + lsls r0, 24 + lsrs r0, 24 + mov r3, r10 + strh r0, [r3] + movs r1, 0x2 + bl bag_menu_print_cursor_ + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r1, =0x00000819 + adds r0, r1 + ldrb r4, [r0] + ldr r2, =gSaveBlock1Ptr + ldr r0, [r2] + movs r3, 0x92 + lsls r3, 3 + adds r0, r3 + bl DecryptMoney + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0 + bl PrintMoneyAmountInMoneyBox + ldr r0, =gTasks + 0x8 + subs r0, 0x8 + adds r6, r0 + ldr r0, =sub_81AD9C0 + str r0, [r6] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AD8C8 + + thumb_func_start sub_81AD9C0 +sub_81AD9C0: @ 81AD9C0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _081AD9E2 + movs r0, 0x5 + bl PlaySE + bl bag_menu_remove_money_window + adds r0, r4, 0 + bl bag_menu_inits_lists_menu +_081AD9E2: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AD9C0 + + thumb_func_start display_deposit_item_ask_str +display_deposit_item_ask_str: @ 81AD9EC + push {r4-r6,lr} + sub sp, 0x14 + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r5, r0, 3 + ldr r6, =gTasks + 0x8 + adds r1, r5, r6 + movs r0, 0x1 + strh r0, [r1, 0x10] + movs r3, 0x4 + ldrsh r0, [r1, r3] + cmp r0, 0x1 + bne _081ADA18 + adds r0, r2, 0 + bl sub_81ADB14 + b _081ADA5E + .pool +_081ADA18: + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E8E42 + adds r0, r4, 0 + bl StringExpandPlaceholders + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r0, [sp, 0x10] + movs r0, 0x1 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x3 + bl bag_menu_print + movs r0, 0x7 + bl sub_81ABC3C + adds r0, r6, 0 + subs r0, 0x8 + adds r0, r5, r0 + ldr r1, =sub_81ADA7C + str r1, [r0] +_081ADA5E: + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end display_deposit_item_ask_str + + thumb_func_start sub_81ADA7C +sub_81ADA7C: @ 81ADA7C + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r5, r0, r1 + adds r0, r5, 0 + adds r0, 0x10 + ldrh r1, [r5, 0x4] + bl AdjustQuantityAccordingToDPadInput + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081ADAC0 + ldr r0, =gUnknown_0203CE54 + ldr r0, [r0] + ldr r1, =0x00000817 + adds r0, r1 + ldrb r0, [r0] + movs r2, 0x10 + ldrsh r1, [r5, r2] + bl sub_81ABC54 + b _081ADB0E + .pool +_081ADAC0: + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081ADAE4 + movs r0, 0x5 + bl PlaySE + movs r0, 0x7 + bl bag_menu_remove_window + adds r0, r4, 0 + bl sub_81ADB14 + b _081ADB0E + .pool +_081ADAE4: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081ADB0E + movs r0, 0x5 + bl PlaySE + movs r1, 0x2 + ldrsh r0, [r5, r1] + bl bag_menu_print_description_box_text + ldrb r0, [r5] + movs r1, 0 + bl bag_menu_print_cursor_ + movs r0, 0x7 + bl bag_menu_remove_window + adds r0, r6, 0 + bl set_callback3_to_bag +_081ADB0E: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81ADA7C + + thumb_func_start sub_81ADB14 +sub_81ADB14: @ 81ADB14 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r7, r1, 3 + ldr r0, =gTasks + 0x8 + mov r9, r0 + adds r2, r7, 0 + add r2, r9 + mov r8, r2 + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r4, =gUnknown_0203CE7C + ldrh r0, [r4] + bl itemid_is_unique + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + beq _081ADB6C + ldr r2, =gUnknown_085E8E8E + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r0, [sp, 0x10] + movs r0, 0x1 + b _081ADBE2 + .pool +_081ADB6C: + ldrh r0, [r4] + mov r3, r8 + ldrh r1, [r3, 0x10] + bl sub_80D6D70 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x1 + bne _081ADBD4 + ldrh r0, [r4] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r0, =gStringVar2 + mov r2, r8 + movs r3, 0x10 + ldrsh r1, [r2, r3] + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E8E5A + adds r0, r4, 0 + bl StringExpandPlaceholders + str r6, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + str r5, [sp, 0xC] + str r5, [sp, 0x10] + movs r0, 0x1 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x3 + bl bag_menu_print + mov r0, r9 + subs r0, 0x8 + adds r0, r7, r0 + ldr r1, =Task_ActuallyToss + b _081ADBF2 + .pool +_081ADBD4: + ldr r2, =gUnknown_085E8E6E + movs r0, 0x1 + str r0, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + str r5, [sp, 0xC] + str r5, [sp, 0x10] +_081ADBE2: + movs r1, 0x1 + movs r3, 0x3 + bl bag_menu_print + mov r0, r9 + subs r0, 0x8 + adds r0, r7, r0 + ldr r1, =sub_81ADC0C +_081ADBF2: + str r1, [r0] + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81ADB14 + + thumb_func_start sub_81ADC0C +sub_81ADC0C: @ 81ADC0C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r5, r0, r1 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _081ADC44 + movs r0, 0x5 + bl PlaySE + movs r1, 0x2 + ldrsh r0, [r5, r1] + bl bag_menu_print_description_box_text + ldrb r0, [r5] + movs r1, 0 + bl bag_menu_print_cursor_ + adds r0, r4, 0 + bl set_callback3_to_bag +_081ADC44: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81ADC0C + + thumb_func_start IsWallysBag +@ bool8 IsWallysBag() +IsWallysBag: @ 81ADC54 + push {lr} + ldr r0, =gUnknown_0203CE58 + ldrb r0, [r0, 0x4] + cmp r0, 0xA + beq _081ADC68 + movs r0, 0 + b _081ADC6A + .pool +_081ADC68: + movs r0, 0x1 +_081ADC6A: + pop {r1} + bx r1 + thumb_func_end IsWallysBag + + thumb_func_start PrepareBagForWallyTutorial +@ void PrepareBagForWallyTutorial() +PrepareBagForWallyTutorial: @ 81ADC70 + push {r4-r6,lr} + ldr r4, =gUnknown_0203CE80 + movs r0, 0xD0 + bl AllocZeroed + str r0, [r4] + ldr r5, =gSaveBlock1Ptr + ldr r1, [r5] + movs r2, 0xAC + lsls r2, 3 + adds r1, r2 + movs r2, 0x78 + bl memcpy + ldr r0, [r4] + ldr r1, [r5] + movs r2, 0xCA + lsls r2, 3 + adds r1, r2 + adds r0, 0x78 + movs r2, 0x40 + bl memcpy + ldr r0, [r4] + ldr r2, =gUnknown_0203CE58 + ldrb r1, [r2, 0x5] + adds r0, 0xCE + strh r1, [r0] + movs r6, 0 + adds r5, r2, 0 + adds r5, 0x8 +_081ADCAE: + ldr r2, [r4] + lsls r3, r6, 1 + adds r0, r2, 0 + adds r0, 0xB8 + adds r0, r3 + ldrh r1, [r5] + strh r1, [r0] + adds r2, 0xC2 + adds r2, r3 + ldrh r0, [r5, 0xA] + strh r0, [r2] + adds r5, 0x2 + adds r6, 0x1 + cmp r6, 0x4 + bls _081ADCAE + ldr r4, =gSaveBlock1Ptr + ldr r0, [r4] + movs r1, 0xAC + lsls r1, 3 + adds r0, r1 + movs r1, 0x1E + bl ClearItemSlots + ldr r0, [r4] + movs r2, 0xCA + lsls r2, 3 + adds r0, r2 + movs r1, 0x10 + bl ClearItemSlots + bl sub_81AAB70 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end PrepareBagForWallyTutorial + + thumb_func_start RestoreBagAfterWallyTutorial +@ void RestoreBagAfterWallyTutorial() +RestoreBagAfterWallyTutorial: @ 81ADD00 + push {r4-r6,lr} + ldr r5, =gSaveBlock1Ptr + ldr r0, [r5] + movs r1, 0xAC + lsls r1, 3 + adds r0, r1 + ldr r4, =gUnknown_0203CE80 + ldr r1, [r4] + movs r2, 0x78 + bl memcpy + ldr r0, [r5] + movs r1, 0xCA + lsls r1, 3 + adds r0, r1 + ldr r1, [r4] + adds r1, 0x78 + movs r2, 0x40 + bl memcpy + ldr r1, =gUnknown_0203CE58 + ldr r0, [r4] + adds r0, 0xCE + ldrh r0, [r0] + strb r0, [r1, 0x5] + movs r5, 0 + adds r6, r4, 0 + adds r3, r1, 0 + adds r3, 0x8 +_081ADD3A: + lsls r2, r5, 1 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0xB8 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r3] + adds r1, 0xC2 + adds r1, r2 + ldrh r0, [r1] + strh r0, [r3, 0xA] + adds r3, 0x2 + adds r5, 0x1 + cmp r5, 0x4 + bls _081ADD3A + ldr r0, [r6] + bl Free + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end RestoreBagAfterWallyTutorial + + thumb_func_start DoWallyTutorialBagMenu +@ void DoWallyTutorialBagMenu() +DoWallyTutorialBagMenu: @ 81ADD70 + push {lr} + bl PrepareBagForWallyTutorial + movs r0, 0xD + movs r1, 0x1 + bl AddBagItem + movs r0, 0x4 + movs r1, 0x1 + bl AddBagItem + ldr r2, =sub_8059D50 + movs r0, 0xA + movs r1, 0 + bl GoToBagMenu + pop {r0} + bx r0 + .pool + thumb_func_end DoWallyTutorialBagMenu + + thumb_func_start Task_WallyTutorialBagMenu +@ void Task_WallyTutorialBagMenu(u8 taskId) +Task_WallyTutorialBagMenu: @ 81ADD98 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081ADE32 + movs r0, 0x10 + ldrsh r1, [r4, r0] + cmp r1, 0xCC + beq _081ADDEC + cmp r1, 0xCC + bgt _081ADDD0 + cmp r1, 0x66 + beq _081ADDDA + b _081ADE2C + .pool +_081ADDD0: + movs r0, 0x99 + lsls r0, 1 + cmp r1, r0 + beq _081ADE0C + b _081ADE2C +_081ADDDA: + movs r0, 0x5 + bl PlaySE + adds r0, r5, 0 + movs r1, 0x1 + movs r2, 0 + bl SwitchBagPocket + b _081ADE2C +_081ADDEC: + movs r0, 0x5 + bl PlaySE + ldrb r0, [r4] + movs r1, 0x2 + bl bag_menu_print_cursor_ + ldr r1, =gUnknown_0203CE7C + movs r0, 0x4 + strh r0, [r1] + adds r0, r5, 0 + bl sub_81AC644 + b _081ADE2C + .pool +_081ADE0C: + movs r0, 0x5 + bl PlaySE + bl bag_menu_remove_some_window + ldrb r0, [r4] + movs r1, 0 + movs r2, 0 + bl sub_81AE6C8 + bl RestoreBagAfterWallyTutorial + adds r0, r5, 0 + bl unknown_ItemMenu_Confirm + b _081ADE32 +_081ADE2C: + ldrh r0, [r4, 0x10] + adds r0, 0x1 + strh r0, [r4, 0x10] +_081ADE32: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end Task_WallyTutorialBagMenu + + thumb_func_start unknown_ItemMenu_Show +unknown_ItemMenu_Show: @ 81ADE38 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =gSpecialVar_0x8005 + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + strh r0, [r1] + ldr r1, =gScriptResult + movs r0, 0x1 + strh r0, [r1] + bl bag_menu_remove_some_window + adds r0, r4, 0 + bl unknown_ItemMenu_Confirm + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end unknown_ItemMenu_Show + + thumb_func_start bag_menu_leave_maybe_3 +bag_menu_leave_maybe_3: @ 81ADE6C + push {lr} + ldr r0, =gUnknown_03005DAC + ldr r1, =sub_819FA50 + str r1, [r0] + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_leave_maybe_3 + + thumb_func_start unknown_ItemMenu_Give2 +unknown_ItemMenu_Give2: @ 81ADE8C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + movs r1, 0x1 + bl RemoveBagItem + ldr r1, =gScriptResult + movs r0, 0x1 + strh r0, [r1] + bl bag_menu_remove_some_window + adds r0, r4, 0 + bl unknown_ItemMenu_Confirm + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end unknown_ItemMenu_Give2 + + thumb_func_start bag_menu_leave_maybe_2 +bag_menu_leave_maybe_2: @ 81ADEBC + push {lr} + ldr r0, =gUnknown_03005DAC + ldr r1, =sub_818DEF4 + str r1, [r0] + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_leave_maybe_2 + + thumb_func_start unknown_ItemMenu_Confirm2 +unknown_ItemMenu_Confirm2: @ 81ADEDC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =gScriptResult + movs r0, 0x1 + strh r0, [r1] + bl bag_menu_remove_some_window + adds r0, r4, 0 + bl unknown_ItemMenu_Confirm + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end unknown_ItemMenu_Confirm2 + + thumb_func_start bag_menu_leave_maybe +bag_menu_leave_maybe: @ 81ADF00 + push {lr} + ldr r0, =gUnknown_03005DAC + ldr r1, =sub_818E564 + str r1, [r0] + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_leave_maybe + + thumb_func_start bag_menu_print_pocket_names +bag_menu_print_pocket_names: @ 81ADF20 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x1C + adds r4, r0, 0 + mov r8, r1 + movs r0, 0 + movs r1, 0 + str r0, [sp, 0x14] + str r1, [sp, 0x18] + ldr r1, =0x00ffffff + ldr r0, [sp, 0x14] + ands r0, r1 + movs r1, 0x80 + lsls r1, 21 + orrs r0, r1 + str r0, [sp, 0x14] + ldr r1, =0xffffff00 + ldr r0, [sp, 0x18] + ands r0, r1 + movs r1, 0x2 + orrs r0, r1 + str r0, [sp, 0x18] + add r0, sp, 0x14 + bl AddWindow + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r6, 0 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x40 + bl GetStringCenterAlignXOffset + lsls r3, r0, 24 + lsrs r3, 24 + movs r7, 0x1 + str r7, [sp] + movs r5, 0 + str r5, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0xFF + mov r9, r0 + str r0, [sp, 0xC] + str r7, [sp, 0x10] + adds r0, r6, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl bag_menu_print + mov r2, r8 + cmp r2, 0 + beq _081ADFBA + movs r0, 0x1 + mov r1, r8 + movs r2, 0x40 + bl GetStringCenterAlignXOffset + adds r3, r0, 0 + adds r3, 0x40 + lsls r3, 24 + lsrs r3, 24 + str r7, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + mov r0, r9 + str r0, [sp, 0xC] + str r7, [sp, 0x10] + adds r0, r6, 0 + movs r1, 0x1 + mov r2, r8 + bl bag_menu_print +_081ADFBA: + adds r0, r6, 0 + movs r1, 0x7 + bl GetWindowAttribute + ldr r1, =gUnknown_0203CE54 + ldr r1, [r1] + ldr r2, =0x00000844 + adds r1, r2 + ldr r2, =0x04000100 + bl CpuSet + adds r0, r6, 0 + bl RemoveWindow + add sp, 0x1C + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_print_pocket_names + + thumb_func_start bag_menu_copy_pocket_name_to_window +bag_menu_copy_pocket_name_to_window: @ 81ADFF8 + push {r4-r7,lr} + adds r7, r0, 0 + cmp r7, 0x8 + bls _081AE002 + movs r7, 0x8 +_081AE002: + ldr r0, =gUnknown_0203CE54 + ldr r4, [r0] + ldr r0, =0x00000844 + adds r4, r0 + movs r0, 0x2 + movs r1, 0x7 + bl GetWindowAttribute + adds r5, r0, 0 + lsls r0, r7, 5 + adds r0, r4, r0 + ldr r6, =0x04000040 + adds r1, r5, 0 + adds r2, r6, 0 + bl CpuSet + adds r0, r7, 0 + adds r0, 0x10 + lsls r0, 5 + adds r4, r0 + movs r0, 0x80 + lsls r0, 1 + adds r5, r0 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + bl CpuSet + movs r0, 0x2 + movs r1, 0x2 + bl CopyWindowToVram + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_copy_pocket_name_to_window + + thumb_func_start setup_bag_menu_textboxes +setup_bag_menu_textboxes: @ 81AE054 + push {r4,lr} + ldr r0, =gUnknown_08614174 + bl InitWindows + bl DeactivateAllTextPrinters + movs r0, 0 + movs r1, 0x1 + movs r2, 0xE0 + bl sub_809882C + movs r0, 0 + movs r1, 0xA + movs r2, 0xD0 + bl copy_textbox_border_tile_patterns_to_vram + movs r0, 0xC0 + movs r1, 0x1 + bl sub_819A2BC + ldr r0, =gUnknown_0860F074 + movs r1, 0xF0 + movs r2, 0x20 + bl LoadPalette + movs r4, 0 +_081AE088: + adds r0, r4, 0 + movs r1, 0 + bl FillWindowPixelBuffer + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _081AE088 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end setup_bag_menu_textboxes + + thumb_func_start bag_menu_print +bag_menu_print: @ 81AE0BC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + mov r9, r3 + ldr r3, [sp, 0x30] + ldr r4, [sp, 0x34] + ldr r6, [sp, 0x38] + ldr r5, [sp, 0x3C] + mov r8, r5 + ldr r5, [sp, 0x40] + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r7, r9 + lsls r7, 24 + lsrs r7, 24 + mov r9, r7 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r5, 24 + lsrs r5, 24 + str r4, [sp] + str r6, [sp, 0x4] + lsls r4, r5, 1 + adds r4, r5 + ldr r5, =gUnknown_08614164 + adds r4, r5 + str r4, [sp, 0x8] + mov r4, r8 + lsls r4, 24 + asrs r4, 24 + str r4, [sp, 0xC] + str r2, [sp, 0x10] + mov r2, r9 + bl AddTextPrinterParametrized2 + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_print + + thumb_func_start sub_81AE124 +sub_81AE124: @ 81AE124 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0203CE54 + ldr r1, [r1] + movs r2, 0x81 + lsls r2, 4 + adds r1, r2 + adds r1, r0 + ldrb r0, [r1] + bx lr + .pool + thumb_func_end sub_81AE124 + + thumb_func_start bag_menu_add_window +bag_menu_add_window: @ 81AE13C + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =gUnknown_0203CE54 + movs r3, 0x81 + lsls r3, 4 + adds r1, r2, r3 + ldr r0, [r0] + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0xFF + bne _081AE172 + lsls r0, r2, 3 + ldr r1, =gUnknown_086141AC + adds r0, r1 + bl AddWindow + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + movs r2, 0x1 + movs r3, 0xE + bl SetWindowBorderStyle + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram +_081AE172: + ldrb r0, [r4] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end bag_menu_add_window + + thumb_func_start bag_menu_remove_window +bag_menu_remove_window: @ 81AE184 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0203CE54 + movs r2, 0x81 + lsls r2, 4 + adds r0, r2 + ldr r1, [r1] + adds r4, r1, r0 + ldrb r0, [r4] + cmp r0, 0xFF + beq _081AE1B8 + movs r1, 0 + bl sub_8198070 + ldrb r0, [r4] + bl ClearWindowTilemap + ldrb r0, [r4] + bl RemoveWindow + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0xFF + strb r0, [r4] +_081AE1B8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_remove_window + + thumb_func_start AddItemMessageWindow +@ u8 AddItemMessageWindow(u8 a1) +AddItemMessageWindow: @ 81AE1C4 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =gUnknown_0203CE54 + movs r3, 0x81 + lsls r3, 4 + adds r1, r2, r3 + ldr r0, [r0] + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0xFF + bne _081AE1E8 + lsls r0, r2, 3 + ldr r1, =gUnknown_086141AC + adds r0, r1 + bl AddWindow + strb r0, [r4] +_081AE1E8: + ldrb r0, [r4] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end AddItemMessageWindow + + thumb_func_start bag_menu_RemoveBagItem_message_window +bag_menu_RemoveBagItem_message_window: @ 81AE1F8 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0203CE54 + movs r2, 0x81 + lsls r2, 4 + adds r0, r2 + ldr r1, [r1] + adds r4, r1, r0 + ldrb r0, [r4] + cmp r0, 0xFF + beq _081AE22C + movs r1, 0 + bl sub_8197DF8 + ldrb r0, [r4] + bl ClearWindowTilemap + ldrb r0, [r4] + bl RemoveWindow + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0xFF + strb r0, [r4] +_081AE22C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_RemoveBagItem_message_window + + thumb_func_start bag_menu_yes_no +bag_menu_yes_no: @ 81AE238 + push {lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 21 + ldr r3, =gUnknown_086141AC + adds r1, r3 + movs r3, 0x2 + str r3, [sp] + movs r3, 0x1 + str r3, [sp, 0x4] + movs r3, 0xE + str r3, [sp, 0x8] + str r2, [sp, 0xC] + movs r2, 0x1 + movs r3, 0 + bl CreateYesNoMenuWithCallbacks + add sp, 0x10 + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_yes_no + + thumb_func_start bag_menu_add_money_window +bag_menu_add_money_window: @ 81AE268 + push {r4,lr} + movs r0, 0x9 + bl bag_menu_add_window + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + bl DecryptMoney + adds r3, r0, 0 + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0xE + bl set_window_border_style_and_print_money_box + movs r0, 0x13 + movs r1, 0xB + bl AddMoneyLabelObject + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end bag_menu_add_money_window + + thumb_func_start bag_menu_remove_money_window +bag_menu_remove_money_window: @ 81AE2A4 + push {lr} + movs r0, 0x9 + bl bag_menu_remove_window + bl RemoveMoneyLabelObject + pop {r0} + bx r0 + thumb_func_end bag_menu_remove_money_window + + thumb_func_start bag_menu_prepare_tmhm_move_window +bag_menu_prepare_tmhm_move_window: @ 81AE2B4 + push {lr} + movs r0, 0x3 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x3 + movs r1, 0x13 + movs r2, 0 + movs r3, 0 + bl blit_move_info_icon + movs r0, 0x3 + movs r1, 0x14 + movs r2, 0 + movs r3, 0xC + bl blit_move_info_icon + movs r0, 0x3 + movs r1, 0x15 + movs r2, 0 + movs r3, 0x18 + bl blit_move_info_icon + movs r0, 0x3 + movs r1, 0x16 + movs r2, 0 + movs r3, 0x24 + bl blit_move_info_icon + movs r0, 0x3 + movs r1, 0x2 + bl CopyWindowToVram + pop {r0} + bx r0 + thumb_func_end bag_menu_prepare_tmhm_move_window + + thumb_func_start PrintTMHMMoveData +PrintTMHMMoveData: @ 81AE2FC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x4 + movs r1, 0 + bl FillWindowPixelBuffer + cmp r4, 0 + bne _081AE354 + movs r4, 0 + movs r5, 0 +_081AE31A: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 26 + lsrs r0, 24 + str r0, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0xFF + str r0, [sp, 0xC] + movs r0, 0x4 + str r0, [sp, 0x10] + movs r1, 0x1 + ldr r2, =gUnknown_085E8D45 + movs r3, 0x7 + bl bag_menu_print + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _081AE31A + movs r0, 0x4 + movs r1, 0x2 + bl CopyWindowToVram + b _081AE440 + .pool +_081AE354: + adds r0, r4, 0 + bl ItemIdToBattleMoveId + lsls r0, 16 + lsrs r7, r0, 16 + ldr r1, =gBattleMoves + lsls r0, r7, 1 + adds r0, r7 + lsls r0, 2 + adds r5, r0, r1 + ldrb r1, [r5, 0x2] + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x4 + movs r2, 0 + movs r3, 0 + bl blit_move_info_icon + ldrb r0, [r5, 0x1] + cmp r0, 0x1 + bhi _081AE38C + ldr r2, =gUnknown_085E8D45 + b _081AE39C + .pool +_081AE38C: + ldr r4, =gStringVar1 + ldrb r1, [r5, 0x1] + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + adds r2, r4, 0 +_081AE39C: + movs r0, 0xC + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0xFF + str r0, [sp, 0xC] + movs r0, 0x4 + str r0, [sp, 0x10] + movs r1, 0x1 + movs r3, 0x7 + bl bag_menu_print + ldr r2, =gBattleMoves + lsls r1, r7, 1 + adds r0, r1, r7 + lsls r0, 2 + adds r2, r0, r2 + ldrb r0, [r2, 0x3] + adds r6, r1, 0 + cmp r0, 0 + bne _081AE3D8 + ldr r2, =gUnknown_085E8D45 + b _081AE3E8 + .pool +_081AE3D8: + ldr r4, =gStringVar1 + ldrb r1, [r2, 0x3] + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + adds r2, r4, 0 +_081AE3E8: + movs r0, 0x18 + str r0, [sp] + movs r4, 0 + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0xFF + mov r8, r0 + str r0, [sp, 0xC] + movs r0, 0x4 + mov r9, r0 + str r0, [sp, 0x10] + movs r1, 0x1 + movs r3, 0x7 + bl bag_menu_print + ldr r5, =gStringVar1 + ldr r1, =gBattleMoves + adds r0, r6, r7 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x4] + adds r0, r5, 0 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + movs r0, 0x24 + str r0, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + mov r0, r8 + str r0, [sp, 0xC] + mov r0, r9 + str r0, [sp, 0x10] + movs r0, 0x4 + movs r1, 0x1 + adds r2, r5, 0 + movs r3, 0x7 + bl bag_menu_print + movs r0, 0x4 + movs r1, 0x2 + bl CopyWindowToVram +_081AE440: + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end PrintTMHMMoveData + + thumb_func_start ListMenuDummyTask +@ void ListMenuDummyTask(u8 taskId) +ListMenuDummyTask: @ 81AE458 + bx lr + thumb_func_end ListMenuDummyTask + + thumb_func_start DoMysteryGiftListMenu +@ int DoMysteryGiftListMenu(struct WindowTemplate *windowTemplate, struct ListMenuTemplate *listMenuTemplate, int a3, int a4, int a5) +DoMysteryGiftListMenu: @ 81AE45C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + mov r12, r0 + str r1, [sp] + ldr r0, [sp, 0x28] + lsls r2, 24 + lsrs r6, r2, 24 + mov r10, r6 + lsls r3, 16 + lsrs r7, r3, 16 + str r7, [sp, 0x4] + lsls r0, 16 + mov r8, r0 + lsrs r0, 16 + mov r9, r0 + ldr r5, =gUnknown_0203CE84 + ldrb r4, [r5, 0x4] + cmp r4, 0x1 + beq _081AE4F4 + cmp r4, 0x1 + ble _081AE492 + cmp r4, 0x2 + beq _081AE558 +_081AE492: + mov r0, r12 + bl AddWindow + strb r0, [r5, 0x5] + cmp r6, 0x1 + beq _081AE4B0 + cmp r6, 0x2 + bne _081AE4C0 + ldrb r0, [r5, 0x5] + mov r1, r9 + lsls r2, r1, 24 + lsrs r2, 24 + adds r1, r7, 0 + bl sub_809882C +_081AE4B0: + ldrb r0, [r5, 0x5] + mov r3, r8 + lsrs r2, r3, 20 + lsls r2, 24 + lsrs r2, 24 + ldr r1, [sp, 0x4] + bl sub_8098858 +_081AE4C0: + ldr r0, =gUnknown_03006310 + adds r2, r0, 0 + ldr r1, [sp] + ldm r1!, {r3-r5} + stm r2!, {r3-r5} + ldm r1!, {r3-r5} + stm r2!, {r3-r5} + ldr r4, =gUnknown_0203CE84 + ldrb r1, [r4, 0x5] + strb r1, [r0, 0x10] + movs r1, 0 + movs r2, 0 + bl ListMenuInit + strb r0, [r4, 0x6] + ldrb r0, [r4, 0x5] + movs r1, 0x1 + bl CopyWindowToVram + movs r0, 0x1 + strb r0, [r4, 0x4] + b _081AE570 + .pool +_081AE4F4: + ldrb r0, [r5, 0x6] + bl ListMenuHandleInput + str r0, [r5] + ldr r1, =gMain + ldrh r0, [r1, 0x2E] + ands r4, r0 + cmp r4, 0 + beq _081AE50A + movs r0, 0x2 + strb r0, [r5, 0x4] +_081AE50A: + ldrh r1, [r1, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081AE51E + movs r0, 0x2 + negs r0, r0 + str r0, [r5] + movs r0, 0x2 + strb r0, [r5, 0x4] +_081AE51E: + ldrb r0, [r5, 0x4] + cmp r0, 0x2 + bne _081AE570 + cmp r6, 0 + bne _081AE534 + ldrb r0, [r5, 0x5] + bl ClearWindowTilemap + b _081AE546 + .pool +_081AE534: + mov r4, r10 + cmp r4, 0 + blt _081AE546 + cmp r4, 0x2 + bgt _081AE546 + ldrb r0, [r5, 0x5] + movs r1, 0 + bl sub_819746C +_081AE546: + ldr r0, =gUnknown_0203CE84 + ldrb r0, [r0, 0x5] + movs r1, 0x1 + bl CopyWindowToVram + b _081AE570 + .pool +_081AE558: + ldrb r0, [r5, 0x6] + movs r1, 0 + movs r2, 0 + bl sub_81AE6C8 + ldrb r0, [r5, 0x5] + bl RemoveWindow + movs r0, 0 + strb r0, [r5, 0x4] + ldr r0, [r5] + b _081AE574 +_081AE570: + movs r0, 0x1 + negs r0, r0 +_081AE574: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end DoMysteryGiftListMenu + + thumb_func_start ListMenuInit +@ u8 ListMenuInit(struct ListMenuTemplate *listMenuTemplate, u16 scrollOffset, u16 selectedRow) +ListMenuInit: @ 81AE584 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + bl ListMenuInitInternal + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldrb r0, [r5, 0x10] + bl PutWindowTilemap + ldrb r0, [r5, 0x10] + movs r1, 0x2 + bl CopyWindowToVram + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end ListMenuInit + + thumb_func_start Unused_ListMenuInit2 +@ u8 Unused_ListMenuInit2(struct ListMenuTemplate *listMenuTemplate, int a2, u16 scrollOffset, u16 selectedRow) +Unused_ListMenuInit2: @ 81AE5B0 + push {r4-r7,lr} + sub sp, 0x8 + adds r6, r0, 0 + adds r4, r1, 0 + adds r1, r2, 0 + adds r2, r3, 0 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + bl ListMenuInitInternal + lsls r0, 24 + lsrs r7, r0, 24 + ldrb r0, [r4, 0x4] + cmp r0, 0xFF + beq _081AE5F0 + adds r5, r4, 0 +_081AE5D4: + ldrb r0, [r6, 0x10] + ldrb r1, [r5] + ldrb r2, [r5, 0x1] + ldrb r3, [r5, 0x2] + ldrb r4, [r5, 0x3] + str r4, [sp] + ldrb r4, [r5, 0x4] + str r4, [sp, 0x4] + bl PutWindowRectTilemapOverridePalette + adds r5, 0x8 + ldrb r0, [r5, 0x4] + cmp r0, 0xFF + bne _081AE5D4 +_081AE5F0: + ldrb r0, [r6, 0x10] + movs r1, 0x2 + bl CopyWindowToVram + adds r0, r7, 0 + add sp, 0x8 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end Unused_ListMenuInit2 + + thumb_func_start ListMenuHandleInput +@ int ListMenuHandleInput(u8 taskId) +ListMenuHandleInput: @ 81AE604 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r3, r1, r0 + ldr r2, =gMain + ldrh r1, [r2, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081AE638 + ldrh r0, [r3, 0x18] + ldrh r1, [r3, 0x1A] + adds r0, r1 + ldr r1, [r3] + lsls r0, 3 + adds r0, r1 + ldr r0, [r0, 0x4] + b _081AE6C2 + .pool +_081AE638: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081AE646 + movs r0, 0x2 + negs r0, r0 + b _081AE6C2 +_081AE646: + ldrh r1, [r2, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081AE65A + adds r0, r3, 0 + movs r1, 0x1 + movs r2, 0x1 + movs r3, 0 + b _081AE6BA +_081AE65A: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081AE66A + adds r0, r3, 0 + movs r1, 0x1 + movs r2, 0x1 + b _081AE6B8 +_081AE66A: + ldrb r0, [r3, 0x16] + lsrs r0, 6 + cmp r0, 0x1 + beq _081AE680 + cmp r0, 0x1 + ble _081AE67A + cmp r0, 0x2 + beq _081AE68C +_081AE67A: + movs r2, 0 + movs r0, 0 + b _081AE6A0 +_081AE680: + movs r0, 0x20 + ands r0, r1 + lsls r0, 16 + lsrs r2, r0, 16 + movs r0, 0x10 + b _081AE69A +_081AE68C: + movs r0, 0x80 + lsls r0, 2 + ands r0, r1 + lsls r0, 16 + lsrs r2, r0, 16 + movs r0, 0x80 + lsls r0, 1 +_081AE69A: + ands r0, r1 + lsls r0, 16 + lsrs r0, 16 +_081AE6A0: + cmp r2, 0 + beq _081AE6AE + ldrb r2, [r3, 0xE] + adds r0, r3, 0 + movs r1, 0x1 + movs r3, 0 + b _081AE6BA +_081AE6AE: + cmp r0, 0 + beq _081AE6BE + ldrb r2, [r3, 0xE] + adds r0, r3, 0 + movs r1, 0x1 +_081AE6B8: + movs r3, 0x1 +_081AE6BA: + bl ListMenuChangeSelection +_081AE6BE: + movs r0, 0x1 + negs r0, r0 +_081AE6C2: + pop {r1} + bx r1 + thumb_func_end ListMenuHandleInput + + thumb_func_start sub_81AE6C8 +sub_81AE6C8: @ 81AE6C8 + push {r4,lr} + adds r3, r1, 0 + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r1, r0, r1 + cmp r3, 0 + beq _081AE6E4 + ldrh r0, [r1, 0x18] + strh r0, [r3] +_081AE6E4: + cmp r2, 0 + beq _081AE6EC + ldrh r0, [r1, 0x1A] + strh r0, [r2] +_081AE6EC: + ldrb r0, [r1, 0x1E] + cmp r0, 0xFF + beq _081AE6FC + ldrb r1, [r1, 0x17] + lsrs r1, 6 + subs r1, 0x2 + bl ListMenuRemoveCursorObject +_081AE6FC: + adds r0, r4, 0 + bl DestroyTask + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AE6C8 + + thumb_func_start sub_81AE70C +sub_81AE70C: @ 81AE70C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + ldrb r0, [r4, 0x10] + ldrb r2, [r4, 0x15] + lsls r2, 28 + lsrs r1, r2, 4 + orrs r1, r2 + lsrs r1, 24 + bl FillWindowPixelBuffer + ldrh r1, [r4, 0x18] + ldrh r3, [r4, 0xE] + adds r0, r4, 0 + movs r2, 0 + bl ListMenuPrintEntries + adds r0, r4, 0 + bl ListMenuDrawCursor + ldrb r0, [r4, 0x10] + movs r1, 0x2 + bl CopyWindowToVram + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AE70C + + thumb_func_start sub_81AE750 +sub_81AE750: @ 81AE750 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + lsrs r1, 20 + ldrb r6, [r4, 0x14] + movs r5, 0xF + adds r0, r5, 0 + ands r0, r6 + orrs r0, r1 + strb r0, [r4, 0x14] + ands r2, r5 + ldrb r1, [r4, 0x15] + movs r0, 0x10 + negs r0, r0 + ands r0, r1 + orrs r0, r2 + lsrs r3, 20 + ands r0, r5 + orrs r0, r3 + strb r0, [r4, 0x15] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AE750 + + thumb_func_start sub_81AE794 +sub_81AE794: @ 81AE794 + push {r4,r5,lr} + adds r3, r1, 0 + adds r5, r2, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + ldrb r0, [r4, 0x10] + movs r1, 0x1 + adds r2, r3, 0 + bl SetWindowAttribute + ldrb r0, [r4, 0x10] + movs r1, 0x2 + adds r2, r5, 0 + bl SetWindowAttribute + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AE794 + + thumb_func_start sub_81AE7D0 +sub_81AE7D0: @ 81AE7D0 + push {r4-r7,lr} + sub sp, 0x20 + mov r12, r2 + ldr r5, [sp, 0x34] + lsls r3, 16 + lsrs r3, 16 + adds r4, r3, 0 + mov r3, sp + ldm r0!, {r2,r6,r7} + stm r3!, {r2,r6,r7} + ldm r0!, {r2,r6,r7} + stm r3!, {r2,r6,r7} + mov r0, sp + movs r3, 0 + strh r1, [r0, 0x18] + mov r1, r12 + strh r1, [r0, 0x1A] + strb r3, [r0, 0x1C] + strb r3, [r0, 0x1D] + cmp r4, 0x40 + bne _081AE804 + movs r1, 0 + movs r2, 0x1 + movs r3, 0 + bl ListMenuChangeSelection +_081AE804: + cmp r4, 0x80 + bne _081AE814 + mov r0, sp + movs r1, 0 + movs r2, 0x1 + movs r3, 0x1 + bl ListMenuChangeSelection +_081AE814: + cmp r5, 0 + beq _081AE81E + mov r0, sp + ldrh r0, [r0, 0x18] + strh r0, [r5] +_081AE81E: + ldr r2, [sp, 0x38] + cmp r2, 0 + beq _081AE82A + mov r0, sp + ldrh r0, [r0, 0x1A] + strh r0, [r2] +_081AE82A: + movs r0, 0x1 + negs r0, r0 + add sp, 0x20 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81AE7D0 + + thumb_func_start sub_81AE838 +sub_81AE838: @ 81AE838 + push {lr} + adds r2, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r1, r0 + cmp r2, 0 + beq _081AE856 + ldrh r0, [r1, 0x1A] + ldrh r1, [r1, 0x18] + adds r0, r1 + strh r0, [r2] +_081AE856: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AE838 + + thumb_func_start get_coro_args_x18_x1A +get_coro_args_x18_x1A: @ 81AE860 + push {lr} + adds r3, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r1, r0 + cmp r3, 0 + beq _081AE87A + ldrh r0, [r1, 0x18] + strh r0, [r3] +_081AE87A: + cmp r2, 0 + beq _081AE882 + ldrh r0, [r1, 0x1A] + strh r0, [r2] +_081AE882: + pop {r0} + bx r0 + .pool + thumb_func_end get_coro_args_x18_x1A + + thumb_func_start ListMenuGetYCoordForPrintingArrowCursor +@ u8 ListMenuGetYCoordForPrintingArrowCursor(u8 taskId) +ListMenuGetYCoordForPrintingArrowCursor: @ 81AE88C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + ldrb r0, [r4, 0x17] + lsls r0, 26 + lsrs r0, 26 + movs r1, 0x1 + bl GetFontAttribute + ldrb r1, [r4, 0x16] + lsls r1, 26 + lsrs r1, 29 + adds r0, r1 + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x1A] + adds r2, r1, 0 + muls r2, r0 + adds r1, r2, 0 + ldrb r0, [r4, 0x14] + lsls r0, 28 + lsrs r0, 28 + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end ListMenuGetYCoordForPrintingArrowCursor + + thumb_func_start ListMenuInitInternal +@ u8 ListMenuInitInternal(struct ListMenuTemplate *listMenuTemplate, u16 scrollOffset, u16 selectedRow) +ListMenuInitInternal: @ 81AE8D4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 16 + lsrs r6, 16 + ldr r0, =ListMenuDummyTask + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r0, 2 + add r0, r8 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r7, r0, r1 + adds r0, r7, 0 + ldm r4!, {r1-r3} + stm r0!, {r1-r3} + ldm r4!, {r1-r3} + stm r0!, {r1-r3} + movs r1, 0 + strh r5, [r7, 0x18] + strh r6, [r7, 0x1A] + strb r1, [r7, 0x1C] + strb r1, [r7, 0x1D] + movs r0, 0xFF + strb r0, [r7, 0x1E] + strb r1, [r7, 0x1F] + ldr r3, =gUnknown_03006300 + ldrb r1, [r7, 0x14] + movs r5, 0xF + lsrs r1, 4 + ldrb r4, [r3] + movs r2, 0x10 + negs r2, r2 + adds r0, r2, 0 + ands r0, r4 + orrs r0, r1 + strb r0, [r3] + ldrb r1, [r7, 0x15] + lsls r1, 28 + lsrs r1, 24 + ands r0, r5 + orrs r0, r1 + strb r0, [r3] + ldrb r0, [r7, 0x15] + lsrs r0, 4 + ands r5, r0 + ldrb r0, [r3, 0x1] + ands r2, r0 + orrs r2, r5 + strb r2, [r3, 0x1] + ldrb r1, [r7, 0x16] + lsls r1, 29 + lsrs r1, 17 + ldr r0, [r3] + ldr r2, =0xfffc0fff + ands r0, r2 + orrs r0, r1 + str r0, [r3] + ldrb r0, [r7, 0x17] + lsls r0, 26 + lsrs r0, 26 + strb r0, [r3, 0x3] + ldrh r0, [r7, 0xC] + ldrh r1, [r7, 0xE] + cmp r0, r1 + bcs _081AE96C + strh r0, [r7, 0xE] +_081AE96C: + ldrb r0, [r7, 0x10] + ldrb r2, [r7, 0x15] + lsls r2, 28 + lsrs r1, r2, 4 + orrs r1, r2 + lsrs r1, 24 + bl FillWindowPixelBuffer + ldrh r1, [r7, 0x18] + ldrh r3, [r7, 0xE] + adds r0, r7, 0 + movs r2, 0 + bl ListMenuPrintEntries + adds r0, r7, 0 + bl ListMenuDrawCursor + adds r0, r7, 0 + movs r1, 0x1 + bl ListMenuCallSelectionChangedCallback + mov r0, r8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end ListMenuInitInternal + + thumb_func_start ListMenuPrint +@ void ListMenuPrint(struct ListMenu *listMenu, u8 *str, u8 x, u8 y) +ListMenuPrint: @ 81AE9B4 + push {r4-r7,lr} + sub sp, 0x18 + adds r4, r0, 0 + adds r6, r1, 0 + lsls r2, 24 + lsrs r7, r2, 24 + lsls r3, 24 + lsrs r3, 24 + mov r12, r3 + ldr r5, =gUnknown_03006300 + ldrb r1, [r5, 0x3] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + beq _081AEA20 + add r1, sp, 0x14 + ldr r2, [r5] + lsls r0, r2, 24 + lsrs r0, 28 + movs r3, 0 + strb r0, [r1] + lsls r0, r2, 28 + lsrs r0, 28 + strb r0, [r1, 0x1] + lsls r0, r2, 20 + lsrs r0, 28 + strb r0, [r1, 0x2] + ldrb r0, [r4, 0x10] + lsls r1, r2, 1 + lsrs r1, 25 + lsls r2, 14 + lsrs r2, 26 + str r2, [sp] + str r3, [sp, 0x4] + add r2, sp, 0x14 + str r2, [sp, 0x8] + movs r2, 0x1 + negs r2, r2 + str r2, [sp, 0xC] + str r6, [sp, 0x10] + adds r2, r7, 0 + mov r3, r12 + bl AddTextPrinterParametrized2 + ldrb r1, [r5, 0x3] + movs r0, 0x7F + ands r0, r1 + strb r0, [r5, 0x3] + b _081AEA5E + .pool +_081AEA20: + add r2, sp, 0x14 + ldrb r1, [r4, 0x15] + lsls r0, r1, 28 + lsrs r0, 28 + strb r0, [r2] + ldrb r0, [r4, 0x14] + lsrs r0, 4 + strb r0, [r2, 0x1] + adds r0, r2, 0 + lsls r1, 24 + lsrs r1, 28 + strb r1, [r0, 0x2] + ldrb r0, [r4, 0x10] + ldrb r1, [r4, 0x17] + lsls r1, 26 + lsrs r1, 26 + ldrb r2, [r4, 0x16] + lsls r2, 29 + lsrs r2, 29 + str r2, [sp] + str r3, [sp, 0x4] + add r2, sp, 0x14 + str r2, [sp, 0x8] + movs r2, 0x1 + negs r2, r2 + str r2, [sp, 0xC] + str r6, [sp, 0x10] + adds r2, r7, 0 + mov r3, r12 + bl AddTextPrinterParametrized2 +_081AEA5E: + add sp, 0x18 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end ListMenuPrint + + thumb_func_start ListMenuPrintEntries +@ void ListMenuPrintEntries(struct ListMenu *listMenu, u16 startIndex, u16 yOffset, u16 count) +ListMenuPrintEntries: @ 81AEA68 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r4, r0, 0 + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + lsls r2, 16 + lsrs r2, 16 + str r2, [sp] + lsls r3, 16 + lsrs r3, 16 + mov r10, r3 + ldrb r0, [r4, 0x17] + lsls r0, 26 + lsrs r0, 26 + movs r1, 0x1 + bl GetFontAttribute + ldrb r1, [r4, 0x16] + lsls r1, 26 + lsrs r1, 29 + adds r0, r1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + movs r0, 0 + mov r8, r0 + cmp r8, r10 + bge _081AEB10 +_081AEAAA: + ldr r0, [r4] + mov r2, r9 + lsls r1, r2, 3 + adds r0, r1, r0 + ldr r2, [r0, 0x4] + movs r0, 0x3 + negs r0, r0 + adds r5, r1, 0 + cmp r2, r0 + beq _081AEAC2 + ldrb r6, [r4, 0x12] + b _081AEAC4 +_081AEAC2: + ldrb r6, [r4, 0x11] +_081AEAC4: + ldr r0, [sp] + add r0, r8 + ldr r2, [sp, 0x4] + adds r1, r0, 0 + muls r1, r2 + ldrb r0, [r4, 0x14] + lsls r0, 28 + lsrs r0, 28 + adds r0, r1 + lsls r0, 24 + lsrs r2, r0, 24 + adds r7, r2, 0 + ldr r3, [r4, 0x8] + cmp r3, 0 + beq _081AEAEE + ldrb r0, [r4, 0x10] + ldr r1, [r4] + adds r1, r5, r1 + ldr r1, [r1, 0x4] + bl _call_via_r3 +_081AEAEE: + ldr r0, [r4] + adds r0, r5, r0 + ldr r1, [r0] + adds r0, r4, 0 + adds r2, r6, 0 + adds r3, r7, 0 + bl ListMenuPrint + mov r0, r9 + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + movs r0, 0x1 + add r8, r0 + cmp r8, r10 + blt _081AEAAA +_081AEB10: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end ListMenuPrintEntries + + thumb_func_start ListMenuDrawCursor +@ void ListMenuDrawCursor(struct ListMenu *listMenu) +ListMenuDrawCursor: @ 81AEB20 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + ldrb r0, [r6, 0x17] + lsls r0, 26 + lsrs r0, 26 + movs r1, 0x1 + bl GetFontAttribute + ldrb r1, [r6, 0x16] + lsls r1, 26 + lsrs r1, 29 + adds r0, r1 + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r6, 0x13] + mov r8, r1 + ldrh r1, [r6, 0x1A] + muls r1, r0 + ldrb r0, [r6, 0x14] + lsls r0, 28 + lsrs r0, 28 + adds r0, r1 + lsls r0, 24 + lsrs r7, r0, 24 + ldrb r0, [r6, 0x17] + lsrs r0, 6 + cmp r0, 0x1 + beq _081AEC0C + cmp r0, 0x1 + bgt _081AEB66 + cmp r0, 0 + beq _081AEB70 + b _081AEC0C +_081AEB66: + cmp r0, 0x2 + beq _081AEB84 + cmp r0, 0x3 + beq _081AEBCC + b _081AEC0C +_081AEB70: + ldr r1, =gUnknown_085E8D60 + adds r0, r6, 0 + mov r2, r8 + adds r3, r7, 0 + bl ListMenuPrint + b _081AEC0C + .pool +_081AEB84: + ldrb r0, [r6, 0x1E] + cmp r0, 0xFF + bne _081AEB94 + adds r0, r6, 0 + movs r1, 0 + bl ListMenuAddCursorObject + strb r0, [r6, 0x1E] +_081AEB94: + ldrb r5, [r6, 0x1E] + ldrb r0, [r6, 0x10] + movs r1, 0x1 + bl GetWindowAttribute + adds r4, r0, 0 + lsls r4, 19 + ldr r0, =0xffff0000 + adds r4, r0 + lsrs r4, 16 + ldrb r0, [r6, 0x10] + movs r1, 0x2 + bl GetWindowAttribute + adds r2, r0, 0 + lsls r2, 3 + adds r2, r7 + subs r2, 0x1 + lsls r2, 16 + lsrs r2, 16 + adds r0, r5, 0 + adds r1, r4, 0 + movs r3, 0 + bl ListMenuUpdateCursorObject + b _081AEC0C + .pool +_081AEBCC: + ldrb r0, [r6, 0x1E] + cmp r0, 0xFF + bne _081AEBDC + adds r0, r6, 0 + movs r1, 0x1 + bl ListMenuAddCursorObject + strb r0, [r6, 0x1E] +_081AEBDC: + ldrb r5, [r6, 0x1E] + ldrb r0, [r6, 0x10] + movs r1, 0x1 + bl GetWindowAttribute + adds r4, r0, 0 + lsls r4, 3 + add r4, r8 + lsls r4, 16 + lsrs r4, 16 + ldrb r0, [r6, 0x10] + movs r1, 0x2 + bl GetWindowAttribute + adds r2, r0, 0 + lsls r2, 3 + adds r2, r7 + lsls r2, 16 + lsrs r2, 16 + adds r0, r5, 0 + adds r1, r4, 0 + movs r3, 0x1 + bl ListMenuUpdateCursorObject +_081AEC0C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end ListMenuDrawCursor + + thumb_func_start ListMenuAddCursorObject +ListMenuAddCursorObject: @ 81AEC18 + push {r4,r5,lr} + sub sp, 0xC + adds r4, r0, 0 + adds r5, r1, 0 + mov r1, sp + movs r0, 0 + strb r0, [r1] + movs r0, 0xA0 + strb r0, [r1, 0x1] + ldrb r0, [r4, 0x10] + movs r1, 0x3 + bl GetWindowAttribute + mov r1, sp + lsls r0, 3 + adds r0, 0x2 + strh r0, [r1, 0x2] + ldrb r0, [r4, 0x17] + lsls r0, 26 + lsrs r0, 26 + movs r1, 0x1 + bl GetFontAttribute + mov r1, sp + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x2 + strh r0, [r1, 0x4] + movs r0, 0x80 + lsls r0, 7 + strh r0, [r1, 0x6] + ldr r0, =0x0000ffff + strh r0, [r1, 0x8] + movs r0, 0xF + strb r0, [r1, 0xA] + mov r0, sp + adds r1, r5, 0 + bl ListMenuAddCursorObjectInternal + lsls r0, 24 + lsrs r0, 24 + add sp, 0xC + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end ListMenuAddCursorObject + + thumb_func_start ListMenuErasePrintedCursor +ListMenuErasePrintedCursor: @ 81AEC78 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r7, r0, 0 + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + ldrb r1, [r7, 0x17] + lsrs r0, r1, 6 + cmp r0, 0 + bne _081AECF4 + lsls r0, r1, 26 + lsrs r0, 26 + movs r1, 0x1 + bl GetFontAttribute + adds r4, r0, 0 + ldrb r0, [r7, 0x16] + lsls r0, 26 + lsrs r0, 29 + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + ldrb r0, [r7, 0x17] + lsls r0, 26 + lsrs r0, 26 + movs r1, 0 + bl GetMenuCursorDimensionByFont + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldrb r0, [r7, 0x17] + lsls r0, 26 + lsrs r0, 26 + movs r1, 0x1 + bl GetMenuCursorDimensionByFont + lsls r0, 24 + lsrs r0, 24 + ldrb r6, [r7, 0x10] + ldrb r2, [r7, 0x15] + lsls r2, 28 + lsrs r1, r2, 4 + orrs r1, r2 + lsrs r1, 24 + ldrb r2, [r7, 0x13] + mov r3, r8 + muls r3, r4 + adds r4, r3, 0 + ldrb r3, [r7, 0x14] + lsls r3, 28 + lsrs r3, 28 + adds r3, r4 + lsls r3, 16 + lsrs r3, 16 + str r5, [sp] + str r0, [sp, 0x4] + adds r0, r6, 0 + bl FillWindowPixelRect +_081AECF4: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end ListMenuErasePrintedCursor + + thumb_func_start ListMenuUpdateSelectedRowIndexAndScrollOffset +@ u8 ListMenuUpdateSelectedRowIndexAndScrollOffset(int, bool8 movingDown) +ListMenuUpdateSelectedRowIndexAndScrollOffset: @ 81AED00 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r1, 24 + ldrh r3, [r4, 0x1A] + ldrh r5, [r4, 0x18] + cmp r1, 0 + bne _081AED74 + ldrh r0, [r4, 0xE] + cmp r0, 0x1 + bne _081AED18 + movs r2, 0 + b _081AED2A +_081AED18: + ldrh r0, [r4, 0xE] + lsrs r2, r0, 1 + movs r1, 0x1 + ands r1, r0 + adds r2, r1 + subs r0, r2 + subs r0, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 +_081AED2A: + cmp r5, 0 + bne _081AED50 + cmp r3, 0 + beq _081AEDB6 + ldr r1, [r4] + movs r2, 0x3 + negs r2, r2 +_081AED38: + subs r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + adds r0, r5, r3 + lsls r0, 3 + adds r0, r1 + ldr r0, [r0, 0x4] + cmp r0, r2 + bne _081AEDBA + cmp r3, 0 + bne _081AED38 + b _081AEDB6 +_081AED50: + cmp r3, r2 + bls _081AED70 + ldr r1, [r4] + movs r6, 0x3 + negs r6, r6 +_081AED5A: + subs r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + adds r0, r5, r3 + lsls r0, 3 + adds r0, r1 + ldr r0, [r0, 0x4] + cmp r0, r6 + bne _081AEDBA + cmp r3, r2 + bhi _081AED5A +_081AED70: + subs r0, r5, 0x1 + b _081AEDE2 +_081AED74: + ldrh r0, [r4, 0xE] + cmp r0, 0x1 + bne _081AED7E + movs r2, 0 + b _081AED88 +_081AED7E: + ldrh r0, [r4, 0xE] + lsrs r2, r0, 1 + movs r1, 0x1 + ands r1, r0 + adds r2, r1 +_081AED88: + adds r1, r0, 0 + ldrh r0, [r4, 0xC] + subs r0, r1 + cmp r5, r0 + bne _081AEDC0 + subs r0, r1, 0x1 + cmp r3, r0 + bge _081AEDB6 + ldr r2, [r4] + movs r6, 0x3 + negs r6, r6 + adds r1, r0, 0 +_081AEDA0: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + adds r0, r5, r3 + lsls r0, 3 + adds r0, r2 + ldr r0, [r0, 0x4] + cmp r0, r6 + bne _081AEDBA + cmp r3, r1 + blt _081AEDA0 +_081AEDB6: + movs r0, 0 + b _081AEDE8 +_081AEDBA: + strh r3, [r4, 0x1A] + movs r0, 0x1 + b _081AEDE8 +_081AEDC0: + cmp r3, r2 + bcs _081AEDE0 + ldr r1, [r4] + movs r6, 0x3 + negs r6, r6 +_081AEDCA: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + adds r0, r5, r3 + lsls r0, 3 + adds r0, r1 + ldr r0, [r0, 0x4] + cmp r0, r6 + bne _081AEDBA + cmp r3, r2 + bcc _081AEDCA +_081AEDE0: + adds r0, r5, 0x1 +_081AEDE2: + strh r2, [r4, 0x1A] + strh r0, [r4, 0x18] + movs r0, 0x2 +_081AEDE8: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end ListMenuUpdateSelectedRowIndexAndScrollOffset + + thumb_func_start ListMenuScroll +@ void ListMenuScroll(struct ListMenu *listMenu, int a2, bool8 movingDown) +ListMenuScroll: @ 81AEDF0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r6, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + adds r7, r5, 0 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + ldrh r0, [r6, 0xE] + cmp r5, r0 + bcc _081AEE2A + ldrb r0, [r6, 0x10] + ldrb r2, [r6, 0x15] + lsls r2, 28 + lsrs r1, r2, 4 + orrs r1, r2 + lsrs r1, 24 + bl FillWindowPixelBuffer + ldrh r1, [r6, 0x18] + ldrh r3, [r6, 0xE] + adds r0, r6, 0 + movs r2, 0 + bl ListMenuPrintEntries + b _081AEF1A +_081AEE2A: + ldrb r0, [r6, 0x17] + lsls r0, 26 + lsrs r0, 26 + movs r1, 0x1 + bl GetFontAttribute + ldrb r1, [r6, 0x16] + lsls r1, 26 + lsrs r1, 29 + adds r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + mov r1, r8 + cmp r1, 0 + bne _081AEEBC + ldrb r0, [r6, 0x10] + adds r2, r5, 0 + muls r2, r4 + lsls r2, 24 + lsrs r2, 24 + ldrb r1, [r6, 0x15] + lsls r1, 28 + lsrs r3, r1, 4 + orrs r3, r1 + lsrs r3, 24 + movs r1, 0x1 + bl ScrollWindow + ldrh r1, [r6, 0x18] + adds r0, r6, 0 + movs r2, 0 + adds r3, r5, 0 + bl ListMenuPrintEntries + ldrh r0, [r6, 0xE] + adds r1, r0, 0 + muls r1, r4 + adds r0, r1, 0 + ldrb r4, [r6, 0x14] + lsls r4, 28 + lsrs r4, 28 + adds r4, r0 + lsls r4, 16 + lsrs r4, 16 + ldrb r0, [r6, 0x10] + movs r1, 0x3 + bl GetWindowAttribute + adds r5, r0, 0 + lsls r5, 19 + lsrs r5, 16 + ldrb r0, [r6, 0x10] + movs r1, 0x4 + bl GetWindowAttribute + lsls r0, 3 + subs r0, r4 + lsls r0, 16 + lsrs r0, 16 + ldrb r3, [r6, 0x10] + ldrb r2, [r6, 0x15] + lsls r2, 28 + lsrs r1, r2, 4 + orrs r1, r2 + lsrs r1, 24 + str r5, [sp] + str r0, [sp, 0x4] + adds r0, r3, 0 + movs r2, 0 + adds r3, r4, 0 + bl FillWindowPixelRect + b _081AEF1A +_081AEEBC: + ldrb r0, [r6, 0x10] + adds r2, r7, 0 + muls r2, r4 + lsls r2, 24 + lsrs r2, 24 + ldrb r1, [r6, 0x15] + lsls r1, 28 + lsrs r3, r1, 4 + orrs r3, r1 + lsrs r3, 24 + movs r1, 0 + bl ScrollWindow + ldrh r2, [r6, 0xE] + subs r2, r7 + ldrh r1, [r6, 0x18] + adds r1, r2 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + adds r0, r6, 0 + adds r3, r7, 0 + bl ListMenuPrintEntries + ldrb r0, [r6, 0x10] + movs r1, 0x3 + bl GetWindowAttribute + lsls r0, 19 + lsrs r0, 16 + ldrb r3, [r6, 0x10] + ldrb r2, [r6, 0x15] + lsls r2, 28 + lsrs r1, r2, 4 + orrs r1, r2 + lsrs r1, 24 + str r0, [sp] + ldrb r0, [r6, 0x14] + lsls r0, 28 + lsrs r0, 28 + str r0, [sp, 0x4] + adds r0, r3, 0 + movs r2, 0 + movs r3, 0 + bl FillWindowPixelRect +_081AEF1A: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end ListMenuScroll + + thumb_func_start ListMenuChangeSelection +@ bool8 ListMenuChangeSelection(struct ListMenu *listMenu, bool8 updateCursorAndCallCallback, u8 count, bool8 movingDown) +ListMenuChangeSelection: @ 81AEF28 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r4, r0, 0 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 24 + lsrs r3, 24 + mov r9, r3 + ldrh r0, [r4, 0x1A] + mov r10, r0 + movs r7, 0 + movs r5, 0 + movs r0, 0 + cmp r7, r8 + bcs _081AEF90 +_081AEF56: + adds r6, r0, 0x1 + b _081AEF76 +_081AEF5A: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + ldrh r0, [r4, 0x18] + ldrh r1, [r4, 0x1A] + adds r0, r1 + ldr r1, [r4] + lsls r0, 3 + adds r0, r1 + ldr r1, [r0, 0x4] + movs r0, 0x3 + negs r0, r0 + cmp r1, r0 + bne _081AEF88 +_081AEF76: + adds r0, r4, 0 + mov r1, r9 + bl ListMenuUpdateSelectedRowIndexAndScrollOffset + lsls r0, 24 + lsrs r0, 24 + orrs r5, r0 + cmp r0, 0x2 + beq _081AEF5A +_081AEF88: + lsls r0, r6, 24 + lsrs r0, 24 + cmp r0, r8 + bcc _081AEF56 +_081AEF90: + ldr r0, [sp] + cmp r0, 0 + beq _081AEFEE + cmp r5, 0x1 + beq _081AEFA6 + cmp r5, 0x1 + ble _081AEFA2 + cmp r5, 0x3 + ble _081AEFC6 +_081AEFA2: + movs r0, 0x1 + b _081AEFF0 +_081AEFA6: + adds r0, r4, 0 + mov r1, r10 + bl ListMenuErasePrintedCursor + adds r0, r4, 0 + bl ListMenuDrawCursor + adds r0, r4, 0 + movs r1, 0 + bl ListMenuCallSelectionChangedCallback + ldrb r0, [r4, 0x10] + movs r1, 0x2 + bl CopyWindowToVram + b _081AEFEE +_081AEFC6: + adds r0, r4, 0 + mov r1, r10 + bl ListMenuErasePrintedCursor + adds r0, r4, 0 + adds r1, r7, 0 + mov r2, r9 + bl ListMenuScroll + adds r0, r4, 0 + bl ListMenuDrawCursor + adds r0, r4, 0 + movs r1, 0 + bl ListMenuCallSelectionChangedCallback + ldrb r0, [r4, 0x10] + movs r1, 0x2 + bl CopyWindowToVram +_081AEFEE: + movs r0, 0 +_081AEFF0: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end ListMenuChangeSelection + + thumb_func_start ListMenuCallSelectionChangedCallback +@ void ListMenuCallSelectionChangedCallback(struct ListMenu *listMenu, u8 a2) +ListMenuCallSelectionChangedCallback: @ 81AF000 + push {r4,lr} + adds r2, r0, 0 + lsls r1, 24 + lsrs r4, r1, 24 + ldr r3, [r2, 0x4] + cmp r3, 0 + beq _081AF022 + ldrh r0, [r2, 0x18] + ldrh r1, [r2, 0x1A] + adds r0, r1 + ldr r1, [r2] + lsls r0, 3 + adds r0, r1 + ldr r0, [r0, 0x4] + adds r1, r4, 0 + bl _call_via_r3 +_081AF022: + pop {r4} + pop {r0} + bx r0 + thumb_func_end ListMenuCallSelectionChangedCallback + + thumb_func_start sub_81AF028 +sub_81AF028: @ 81AF028 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsls r2, 24 + lsrs r2, 24 + ldr r6, =gUnknown_03006300 + movs r5, 0xF + ands r0, r5 + ldrb r3, [r6] + mov r8, r3 + movs r4, 0x10 + negs r4, r4 + adds r3, r4, 0 + mov r7, r8 + ands r3, r7 + orrs r3, r0 + lsrs r1, 20 + ands r3, r5 + orrs r3, r1 + strb r3, [r6] + ands r2, r5 + ldrb r0, [r6, 0x1] + ands r4, r0 + orrs r4, r2 + strb r4, [r6, 0x1] + ldrb r0, [r6, 0x3] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r6, 0x3] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AF028 + + thumb_func_start sub_81AF078 +sub_81AF078: @ 81AF078 + push {lr} + lsls r1, 24 + cmp r1, 0 + bne _081AF086 + movs r0, 0x5 + bl PlaySE +_081AF086: + pop {r0} + bx r0 + thumb_func_end sub_81AF078 + + thumb_func_start sub_81AF08C +sub_81AF08C: @ 81AF08C + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r3, r1, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r2, r1, r0 + cmp r3, 0x10 + bhi _081AF154 + lsls r0, r3, 2 + ldr r1, =_081AF0B8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081AF0B8: + .4byte _081AF0FC + .4byte _081AF0FC + .4byte _081AF100 + .4byte _081AF104 + .4byte _081AF108 + .4byte _081AF10C + .4byte _081AF110 + .4byte _081AF114 + .4byte _081AF118 + .4byte _081AF11C + .4byte _081AF122 + .4byte _081AF12A + .4byte _081AF130 + .4byte _081AF138 + .4byte _081AF140 + .4byte _081AF146 + .4byte _081AF14E +_081AF0FC: + ldr r0, [r2, 0x4] + b _081AF158 +_081AF100: + ldrh r0, [r2, 0xC] + b _081AF158 +_081AF104: + ldrh r0, [r2, 0xE] + b _081AF158 +_081AF108: + ldrb r0, [r2, 0x10] + b _081AF158 +_081AF10C: + ldrb r0, [r2, 0x11] + b _081AF158 +_081AF110: + ldrb r0, [r2, 0x12] + b _081AF158 +_081AF114: + ldrb r0, [r2, 0x13] + b _081AF158 +_081AF118: + ldrb r0, [r2, 0x14] + b _081AF124 +_081AF11C: + ldrb r0, [r2, 0x14] + lsrs r0, 4 + b _081AF158 +_081AF122: + ldrb r0, [r2, 0x15] +_081AF124: + lsls r0, 28 + lsrs r0, 28 + b _081AF158 +_081AF12A: + ldrb r0, [r2, 0x15] + lsrs r0, 4 + b _081AF158 +_081AF130: + ldrb r0, [r2, 0x16] + lsls r0, 29 + lsrs r0, 29 + b _081AF158 +_081AF138: + ldrb r0, [r2, 0x16] + lsls r0, 26 + lsrs r0, 29 + b _081AF158 +_081AF140: + ldrb r0, [r2, 0x16] + lsrs r0, 6 + b _081AF158 +_081AF146: + ldrb r0, [r2, 0x17] + lsls r0, 26 + lsrs r0, 26 + b _081AF158 +_081AF14E: + ldrb r0, [r2, 0x17] + lsrs r0, 6 + b _081AF158 +_081AF154: + movs r0, 0x1 + negs r0, r0 +_081AF158: + pop {r1} + bx r1 + thumb_func_end sub_81AF08C + + thumb_func_start sub_81AF15C +sub_81AF15C: @ 81AF15C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r3, r1, r0 + cmp r4, 0x10 + bhi _081AF25C + lsls r0, r4, 2 + ldr r1, =_081AF188 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081AF188: + .4byte _081AF1CC + .4byte _081AF1CC + .4byte _081AF1D0 + .4byte _081AF1D4 + .4byte _081AF1D8 + .4byte _081AF1DC + .4byte _081AF1E0 + .4byte _081AF1E4 + .4byte _081AF1E8 + .4byte _081AF1F4 + .4byte _081AF202 + .4byte _081AF20E + .4byte _081AF21C + .4byte _081AF228 + .4byte _081AF236 + .4byte _081AF244 + .4byte _081AF250 +_081AF1CC: + str r2, [r3, 0x4] + b _081AF25C +_081AF1D0: + strh r2, [r3, 0xC] + b _081AF25C +_081AF1D4: + strh r2, [r3, 0xE] + b _081AF25C +_081AF1D8: + strb r2, [r3, 0x10] + b _081AF25C +_081AF1DC: + strb r2, [r3, 0x11] + b _081AF25C +_081AF1E0: + strb r2, [r3, 0x12] + b _081AF25C +_081AF1E4: + strb r2, [r3, 0x13] + b _081AF25C +_081AF1E8: + movs r0, 0xF + ands r2, r0 + ldrb r1, [r3, 0x14] + movs r0, 0x10 + negs r0, r0 + b _081AF1FA +_081AF1F4: + lsls r2, 4 + ldrb r1, [r3, 0x14] + movs r0, 0xF +_081AF1FA: + ands r0, r1 + orrs r0, r2 + strb r0, [r3, 0x14] + b _081AF25C +_081AF202: + movs r0, 0xF + ands r2, r0 + ldrb r1, [r3, 0x15] + movs r0, 0x10 + negs r0, r0 + b _081AF214 +_081AF20E: + lsls r2, 4 + ldrb r1, [r3, 0x15] + movs r0, 0xF +_081AF214: + ands r0, r1 + orrs r0, r2 + strb r0, [r3, 0x15] + b _081AF25C +_081AF21C: + movs r0, 0x7 + ands r2, r0 + ldrb r1, [r3, 0x16] + movs r0, 0x8 + negs r0, r0 + b _081AF23C +_081AF228: + movs r0, 0x7 + ands r2, r0 + lsls r2, 3 + ldrb r1, [r3, 0x16] + movs r0, 0x39 + negs r0, r0 + b _081AF23C +_081AF236: + lsls r2, 6 + ldrb r1, [r3, 0x16] + movs r0, 0x3F +_081AF23C: + ands r0, r1 + orrs r0, r2 + strb r0, [r3, 0x16] + b _081AF25C +_081AF244: + movs r0, 0x3F + ands r2, r0 + ldrb r1, [r3, 0x17] + movs r0, 0x40 + negs r0, r0 + b _081AF256 +_081AF250: + lsls r2, 6 + ldrb r1, [r3, 0x17] + movs r0, 0x3F +_081AF256: + ands r0, r1 + orrs r0, r2 + strb r0, [r3, 0x17] +_081AF25C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81AF15C + + thumb_func_start sub_81AF264 +sub_81AF264: @ 81AF264 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _081AF276 + cmp r0, 0x1 + beq _081AF28A + b _081AF2E4 +_081AF276: + ldrh r1, [r4, 0x30] + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartSpriteAnim + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _081AF2E4 +_081AF28A: + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _081AF29A + cmp r0, 0x1 + beq _081AF2C0 + ldrh r2, [r4, 0x38] + b _081AF2DE +_081AF29A: + movs r0, 0x34 + ldrsh r3, [r4, r0] + ldr r1, =gSineTable + ldrh r2, [r4, 0x38] + lsls r0, r2, 24 + lsrs r0, 23 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + muls r0, r3 + cmp r0, 0 + bge _081AF2B4 + adds r0, 0xFF +_081AF2B4: + asrs r0, 8 + strh r0, [r4, 0x24] + b _081AF2DE + .pool +_081AF2C0: + movs r0, 0x34 + ldrsh r3, [r4, r0] + ldr r1, =gSineTable + ldrh r2, [r4, 0x38] + lsls r0, r2, 24 + lsrs r0, 23 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + muls r0, r3 + cmp r0, 0 + bge _081AF2DA + adds r0, 0xFF +_081AF2DA: + asrs r0, 8 + strh r0, [r4, 0x26] +_081AF2DE: + ldrh r0, [r4, 0x36] + adds r0, r2, r0 + strh r0, [r4, 0x38] +_081AF2E4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AF264 + + thumb_func_start AddScrollIndicatorArrowObject +AddScrollIndicatorArrowObject: @ 81AF2F0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x18 + adds r6, r0, 0 + ldr r5, [sp, 0x30] + lsls r6, 24 + lsrs r6, 24 + mov r8, r6 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r5, 16 + lsrs r5, 16 + mov r12, r5 + mov r4, sp + ldr r0, =gUnknown_08614244 + ldm r0!, {r5-r7} + stm r4!, {r5-r7} + ldm r0!, {r5-r7} + stm r4!, {r5-r7} + mov r0, sp + movs r4, 0 + strh r3, [r0] + mov r3, r12 + strh r3, [r0, 0x2] + movs r3, 0 + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gSprites + lsls r3, r0, 4 + adds r3, r0 + lsls r3, 2 + adds r3, r1 + adds r5, r3, 0 + adds r5, 0x3E + ldrb r1, [r5] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r5] + strh r4, [r3, 0x2E] + ldr r1, =gUnknown_086141FC + mov r5, r8 + lsls r6, r5, 2 + adds r6, r1 + ldrb r2, [r6] + lsls r1, r2, 28 + lsrs r1, 28 + strh r1, [r3, 0x30] + lsrs r2, 4 + strh r2, [r3, 0x32] + ldrb r1, [r6, 0x1] + strh r1, [r3, 0x34] + ldrh r1, [r6, 0x2] + strh r1, [r3, 0x36] + strh r4, [r3, 0x38] + add sp, 0x18 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end AddScrollIndicatorArrowObject + + thumb_func_start AddScrollIndicatorArrowPair +AddScrollIndicatorArrowPair: @ 81AF380 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + adds r6, r0, 0 + mov r9, r1 + ldr r0, =gUnknown_086142C8 + str r0, [sp, 0x4] + ldr r5, =0xffff0000 + ldr r0, [sp, 0x8] + ands r0, r5 + movs r1, 0x80 + lsls r1, 1 + orrs r0, r1 + ldrh r1, [r6, 0xA] + lsls r1, 16 + ldr r4, =0x0000ffff + ands r0, r4 + orrs r0, r1 + str r0, [sp, 0x8] + add r0, sp, 0x4 + bl LoadCompressedObjectPic + ldrh r2, [r6, 0xC] + cmp r2, r4 + bne _081AF3DC + ldr r0, =gUnknown_086142A8 + ldrb r1, [r6, 0xE] + lsls r1, 20 + movs r2, 0x80 + lsls r2, 17 + adds r1, r2 + lsrs r1, 16 + movs r2, 0x20 + bl LoadPalette + b _081AF3EE + .pool +_081AF3DC: + ldr r0, =gUnknown_086142A8 + str r0, [sp, 0xC] + add r0, sp, 0xC + ldr r1, [r0, 0x4] + ands r1, r5 + orrs r1, r2 + str r1, [r0, 0x4] + bl LoadSpritePalette +_081AF3EE: + ldr r0, =Task_ScrollIndicatorArrowPair + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r0, 2 + add r0, r8 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r7, r0, r1 + movs r0, 0 + strb r0, [r7] + mov r0, r9 + str r0, [r7, 0x4] + ldrh r0, [r6, 0x6] + strh r0, [r7, 0x8] + ldrh r0, [r6, 0x8] + strh r0, [r7, 0xA] + ldrh r0, [r6, 0xA] + strh r0, [r7, 0xE] + ldrh r0, [r6, 0xC] + strh r0, [r7, 0x10] + ldrb r0, [r6] + ldrb r1, [r6, 0x1] + ldrb r2, [r6, 0x2] + ldrh r3, [r6, 0xA] + ldrh r4, [r6, 0xC] + str r4, [sp] + bl AddScrollIndicatorArrowObject + strb r0, [r7, 0xC] + ldrb r0, [r6, 0x3] + ldrb r1, [r6, 0x4] + ldrb r2, [r6, 0x5] + ldrh r3, [r6, 0xA] + ldrh r4, [r6, 0xC] + str r4, [sp] + bl AddScrollIndicatorArrowObject + strb r0, [r7, 0xD] + ldrh r1, [r6, 0xC] + ldr r0, =0x0000ffff + cmp r1, r0 + bne _081AF47C + ldr r5, =gSprites + ldrb r0, [r7, 0xC] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r3, [r6, 0xE] + lsls r3, 4 + ldrb r4, [r1, 0x5] + movs r2, 0xF + adds r0, r2, 0 + ands r0, r4 + orrs r0, r3 + strb r0, [r1, 0x5] + ldrb r1, [r7, 0xD] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrb r1, [r6, 0xE] + lsls r1, 4 + ldrb r3, [r0, 0x5] + ands r2, r3 + orrs r2, r1 + strb r2, [r0, 0x5] +_081AF47C: + mov r0, r8 + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end AddScrollIndicatorArrowPair + + thumb_func_start AddScrollIndicatorArrowPairParametrized +AddScrollIndicatorArrowPairParametrized: @ 81AF4A0 + push {r4,lr} + adds r4, r1, 0 + subs r0, 0x2 + cmp r0, 0x1 + bhi _081AF4C4 + ldr r0, =gUnknown_0203CE8C + movs r1, 0x2 + strb r1, [r0] + strb r4, [r0, 0x1] + strb r2, [r0, 0x2] + movs r1, 0x3 + strb r1, [r0, 0x3] + strb r4, [r0, 0x4] + strb r3, [r0, 0x5] + b _081AF4D6 + .pool +_081AF4C4: + ldr r0, =gUnknown_0203CE8C + movs r1, 0 + strb r1, [r0] + strb r2, [r0, 0x1] + strb r4, [r0, 0x2] + movs r1, 0x1 + strb r1, [r0, 0x3] + strb r3, [r0, 0x4] + strb r4, [r0, 0x5] +_081AF4D6: + adds r2, r0, 0 + movs r1, 0 + movs r0, 0 + strh r0, [r2, 0x6] + ldr r0, [sp, 0x8] + strh r0, [r2, 0x8] + ldr r0, [sp, 0xC] + strh r0, [r2, 0xA] + ldr r0, [sp, 0x10] + strh r0, [r2, 0xC] + strb r1, [r2, 0xE] + adds r0, r2, 0 + ldr r1, [sp, 0x14] + bl AddScrollIndicatorArrowPair + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end AddScrollIndicatorArrowPairParametrized + + thumb_func_start Task_ScrollIndicatorArrowPair +Task_ScrollIndicatorArrowPair: @ 81AF504 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r4, r1, r0 + ldr r0, [r4, 0x4] + ldrh r5, [r0] + ldrh r0, [r4, 0x8] + cmp r5, r0 + bne _081AF548 + ldr r0, =0x0000ffff + cmp r5, r0 + beq _081AF548 + ldr r3, =gSprites + ldrb r1, [r4, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + b _081AF55E + .pool +_081AF548: + ldr r3, =gSprites + ldrb r1, [r4, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 +_081AF55E: + strb r1, [r0] + ldrh r0, [r4, 0xA] + cmp r5, r0 + bne _081AF580 + ldrb r1, [r4, 0xD] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + b _081AF594 + .pool +_081AF580: + ldrb r1, [r4, 0xD] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 +_081AF594: + strb r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end Task_ScrollIndicatorArrowPair + + thumb_func_start Task_ScrollIndicatorArrowPairOnMainMenu +Task_ScrollIndicatorArrowPairOnMainMenu: @ 81AF59C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r4, r1, r0 + movs r1, 0x1E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _081AF5E8 + ldr r3, =gSprites + ldrb r1, [r4, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + ldrb r1, [r4, 0xD] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + b _081AF612 + .pool +_081AF5E8: + ldr r3, =gSprites + ldrb r1, [r4, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldrb r1, [r4, 0xD] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 +_081AF612: + strb r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end Task_ScrollIndicatorArrowPairOnMainMenu + + thumb_func_start RemoveScrollIndicatorArrowPair +RemoveScrollIndicatorArrowPair: @ 81AF620 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r5, r0, r1 + ldrh r0, [r5, 0xE] + ldr r4, =0x0000ffff + cmp r0, r4 + beq _081AF63E + bl FreeSpriteTilesByTag +_081AF63E: + ldrh r0, [r5, 0x10] + cmp r0, r4 + beq _081AF648 + bl FreeSpritePaletteByTag +_081AF648: + ldrb r1, [r5, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =gSprites + adds r0, r4 + bl DestroySprite + ldrb r1, [r5, 0xD] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl DestroySprite + adds r0, r6, 0 + bl DestroyTask + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end RemoveScrollIndicatorArrowPair + + thumb_func_start ListMenuAddCursorObjectInternal +ListMenuAddCursorObjectInternal: @ 81AF680 + push {lr} + cmp r1, 0 + beq _081AF68A + cmp r1, 0x1 + beq _081AF690 +_081AF68A: + bl ListMenuAddRedOutlineCursorObject + b _081AF694 +_081AF690: + bl ListMenuAddRedArrowCursorObject +_081AF694: + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end ListMenuAddCursorObjectInternal + + thumb_func_start ListMenuUpdateCursorObject +@ void ListMenuUpdateCursorObject(u8 taskId, u16 x, u16 y, u32 a4) +ListMenuUpdateCursorObject: @ 81AF69C + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + cmp r3, 0 + beq _081AF6B4 + cmp r3, 0x1 + beq _081AF6BA + b _081AF6BE +_081AF6B4: + bl ListMenuUpdateRedOutlineCursorObject + b _081AF6BE +_081AF6BA: + bl ListMenuUpdateRedArrowCursorObject +_081AF6BE: + pop {r0} + bx r0 + thumb_func_end ListMenuUpdateCursorObject + + thumb_func_start ListMenuRemoveCursorObject +ListMenuRemoveCursorObject: @ 81AF6C4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r1, 0 + beq _081AF6D4 + cmp r1, 0x1 + beq _081AF6DA + b _081AF6DE +_081AF6D4: + bl ListMenuRemoveRedOutlineCursorObject + b _081AF6DE +_081AF6DA: + bl ListMenuRemoveRedArrowCursorObject +_081AF6DE: + pop {r0} + bx r0 + thumb_func_end ListMenuRemoveCursorObject + + thumb_func_start Task_RedOutlineCursor +Task_RedOutlineCursor: @ 81AF6E4 + bx lr + thumb_func_end Task_RedOutlineCursor + + thumb_func_start ListMenuGetRedOutlineCursorSpriteCount +ListMenuGetRedOutlineCursorSpriteCount: @ 81AF6E8 + push {lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + lsrs r1, 16 + movs r3, 0x4 + cmp r0, 0x10 + bls _081AF708 + movs r2, 0x8 + subs r0, 0x8 + cmp r2, r0 + bge _081AF708 +_081AF700: + adds r3, 0x2 + adds r2, 0x8 + cmp r2, r0 + blt _081AF700 +_081AF708: + cmp r1, 0x10 + bls _081AF71C + movs r2, 0x8 + subs r1, 0x8 + cmp r2, r1 + bge _081AF71C +_081AF714: + adds r3, 0x2 + adds r2, 0x8 + cmp r2, r1 + blt _081AF714 +_081AF71C: + lsls r0, r3, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end ListMenuGetRedOutlineCursorSpriteCount + + thumb_func_start ListMenuSetUpRedOutlineCursorSpriteOamTable +ListMenuSetUpRedOutlineCursorSpriteOamTable: @ 81AF724 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r3, r2, 0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + ldr r0, =gUnknown_0861425C + ldr r0, [r0] + str r0, [r3] + movs r1, 0x88 + strb r1, [r3] + strb r1, [r3, 0x1] + ldr r0, =gUnknown_08614260 + ldr r0, [r0] + str r0, [r3, 0x4] + mov r2, r8 + adds r2, 0x80 + strb r2, [r3, 0x4] + strb r1, [r3, 0x5] + ldr r0, =gUnknown_08614274 + ldr r0, [r0] + str r0, [r3, 0x8] + strb r1, [r3, 0x8] + mov r4, r9 + adds r4, 0x80 + strb r4, [r3, 0x9] + ldr r0, =gUnknown_08614278 + ldr r0, [r0] + str r0, [r3, 0xC] + strb r2, [r3, 0xC] + strb r4, [r3, 0xD] + movs r0, 0x4 + mov r12, r0 + mov r2, r8 + cmp r2, 0x10 + bls _081AF7B8 + movs r2, 0x8 + mov r5, r8 + subs r5, 0x8 + cmp r2, r5 + bge _081AF7B8 + ldr r0, =gUnknown_08614264 + ldr r0, [r0] + str r0, [sp] + ldr r0, =gUnknown_08614270 + ldr r6, [r0] + adds r1, r3, 0 + adds r1, 0x10 + movs r7, 0x88 + mov r10, r7 +_081AF796: + ldr r0, [sp] + str r0, [r1] + adds r0, r2, 0 + subs r0, 0x78 + strb r0, [r1] + mov r7, r10 + strb r7, [r1, 0x1] + adds r1, 0x4 + str r6, [r1] + strb r0, [r1] + strb r4, [r1, 0x1] + adds r1, 0x4 + movs r0, 0x2 + add r12, r0 + adds r2, 0x8 + cmp r2, r5 + blt _081AF796 +_081AF7B8: + mov r2, r9 + cmp r2, 0x10 + bls _081AF7F6 + movs r1, 0x8 + mov r4, r9 + subs r4, 0x8 + cmp r1, r4 + bge _081AF7F6 + ldr r0, =gUnknown_08614268 + ldr r6, [r0] + ldr r0, =gUnknown_0861426C + ldr r5, [r0] + mov r7, r12 + lsls r0, r7, 2 + adds r2, r0, r3 + movs r7, 0x88 + mov r3, r8 + adds r3, 0x80 +_081AF7DC: + str r6, [r2] + strb r7, [r2] + adds r0, r1, 0 + subs r0, 0x78 + strb r0, [r2, 0x1] + adds r2, 0x4 + str r5, [r2] + strb r3, [r2] + strb r0, [r2, 0x1] + adds r2, 0x4 + adds r1, 0x8 + cmp r1, r4 + blt _081AF7DC +_081AF7F6: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end ListMenuSetUpRedOutlineCursorSpriteOamTable + + thumb_func_start ListMenuAddRedOutlineCursorObject +ListMenuAddRedOutlineCursorObject: @ 81AF828 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x28 + adds r6, r0, 0 + ldr r0, =gUnknown_08614338 + str r0, [sp, 0x18] + ldr r5, =0xffff0000 + add r0, sp, 0x18 + ldr r1, [r0, 0x4] + ands r1, r5 + movs r2, 0x80 + lsls r2, 1 + orrs r1, r2 + ldrh r2, [r6, 0x6] + lsls r2, 16 + ldr r3, =0x0000ffff + ands r1, r3 + orrs r1, r2 + str r1, [r0, 0x4] + bl LoadCompressedObjectPic + ldrh r2, [r6, 0x8] + ldr r7, =0x0000ffff + cmp r2, r7 + bne _081AF884 + ldr r0, =gUnknown_086142A8 + ldrb r1, [r6, 0xA] + lsls r1, 20 + movs r2, 0x80 + lsls r2, 17 + adds r1, r2 + lsrs r1, 16 + movs r2, 0x20 + bl LoadPalette + b _081AF896 + .pool +_081AF884: + ldr r0, =gUnknown_086142A8 + str r0, [sp, 0x20] + add r0, sp, 0x20 + ldr r1, [r0, 0x4] + ands r1, r5 + orrs r1, r2 + str r1, [r0, 0x4] + bl LoadSpritePalette +_081AF896: + ldr r0, =Task_RedOutlineCursor + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r5, r0, r1 + ldrh r0, [r6, 0x6] + movs r3, 0 + mov r8, r3 + strh r0, [r5, 0xE] + ldrh r0, [r6, 0x8] + strh r0, [r5, 0x10] + ldrh r0, [r6, 0x2] + ldrh r1, [r6, 0x4] + bl ListMenuGetRedOutlineCursorSpriteCount + strb r0, [r5] + ldrb r0, [r5] + lsls r0, 2 + bl Alloc + adds r2, r0, 0 + str r2, [r5, 0x8] + str r2, [r5, 0x4] + ldrh r0, [r6, 0x2] + ldrh r1, [r6, 0x4] + bl ListMenuSetUpRedOutlineCursorSpriteOamTable + mov r1, sp + ldr r0, =gDummySpriteTemplate + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + mov r1, sp + ldrh r0, [r6, 0x6] + strh r0, [r1] + ldrh r0, [r6, 0x8] + strh r0, [r1, 0x2] + ldrb r1, [r6] + adds r1, 0x78 + ldrb r2, [r6, 0x1] + adds r2, 0x78 + mov r0, sp + movs r3, 0 + bl CreateSprite + strb r0, [r5, 0xC] + ldrb r1, [r5, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r7, =gSprites + adds r0, r7 + adds r1, r5, 0 + bl SetSubspriteTables + ldrb r0, [r5, 0xC] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r7 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x5] + ldrb r1, [r5, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + adds r0, 0x43 + mov r1, r8 + strb r1, [r0] + ldrb r1, [r5, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + adds r0, 0x42 + ldrb r2, [r0] + movs r1, 0x40 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + ldrh r1, [r6, 0x8] + ldr r0, =0x0000ffff + cmp r1, r0 + bne _081AF96E + ldrb r0, [r5, 0xC] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r7 + ldrb r2, [r6, 0xA] + lsls r2, 4 + ldrb r3, [r1, 0x5] + movs r0, 0xF + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0x5] +_081AF96E: + adds r0, r4, 0 + add sp, 0x28 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end ListMenuAddRedOutlineCursorObject + + thumb_func_start ListMenuUpdateRedOutlineCursorObject +@ void ListMenuUpdateRedOutlineCursorObject(u8 taskId, u16 x, u16 y) +ListMenuUpdateRedOutlineCursorObject: @ 81AF994 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + lsls r3, r0, 2 + adds r3, r0 + lsls r3, 3 + ldr r0, =gTasks + 0x8 + adds r3, r0 + ldr r5, =gSprites + ldrb r4, [r3, 0xC] + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r5 + adds r1, 0x78 + strh r1, [r0, 0x20] + ldrb r1, [r3, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r2, 0x78 + strh r2, [r0, 0x22] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ListMenuUpdateRedOutlineCursorObject + + thumb_func_start ListMenuRemoveRedOutlineCursorObject +ListMenuRemoveRedOutlineCursorObject: @ 81AF9D8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + ldr r0, [r4, 0x8] + bl Free + ldrh r0, [r4, 0xE] + ldr r6, =0x0000ffff + cmp r0, r6 + beq _081AF9FC + bl FreeSpriteTilesByTag +_081AF9FC: + ldrh r0, [r4, 0x10] + cmp r0, r6 + beq _081AFA06 + bl FreeSpritePaletteByTag +_081AFA06: + ldrb r1, [r4, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + bl DestroySprite + adds r0, r5, 0 + bl DestroyTask + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end ListMenuRemoveRedOutlineCursorObject + + thumb_func_start ObjectCB_RedArrowCursor +ObjectCB_RedArrowCursor: @ 81AFA30 + push {lr} + adds r2, r0, 0 + ldr r1, =gSineTable + ldrh r3, [r2, 0x2E] + lsls r0, r3, 24 + lsrs r0, 23 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bge _081AFA48 + adds r0, 0x3F +_081AFA48: + asrs r0, 6 + strh r0, [r2, 0x24] + adds r0, r3, 0 + adds r0, 0x8 + strh r0, [r2, 0x2E] + pop {r0} + bx r0 + .pool + thumb_func_end ObjectCB_RedArrowCursor + + thumb_func_start Task_RedArrowCursor +Task_RedArrowCursor: @ 81AFA5C + bx lr + thumb_func_end Task_RedArrowCursor + + thumb_func_start ListMenuAddRedArrowCursorObject +ListMenuAddRedArrowCursorObject: @ 81AFA60 + push {r4-r7,lr} + sub sp, 0x28 + adds r5, r0, 0 + ldr r0, =gUnknown_08614378 + str r0, [sp, 0x18] + ldr r6, =0xffff0000 + add r0, sp, 0x18 + ldr r1, [r0, 0x4] + ands r1, r6 + movs r2, 0x80 + orrs r1, r2 + ldrh r2, [r5, 0x6] + lsls r2, 16 + ldr r4, =0x0000ffff + ands r1, r4 + orrs r1, r2 + str r1, [r0, 0x4] + bl LoadCompressedObjectPic + ldrh r2, [r5, 0x8] + cmp r2, r4 + bne _081AFAB4 + ldr r0, =gUnknown_086142A8 + ldrb r1, [r5, 0xA] + lsls r1, 20 + movs r2, 0x80 + lsls r2, 17 + adds r1, r2 + lsrs r1, 16 + movs r2, 0x20 + bl LoadPalette + b _081AFAC6 + .pool +_081AFAB4: + ldr r0, =gUnknown_086142A8 + str r0, [sp, 0x20] + add r0, sp, 0x20 + ldr r1, [r0, 0x4] + ands r1, r6 + orrs r1, r2 + str r1, [r0, 0x4] + bl LoadSpritePalette +_081AFAC6: + ldr r0, =Task_RedArrowCursor + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + ldrh r0, [r5, 0x6] + strh r0, [r4, 0x2] + ldrh r0, [r5, 0x8] + strh r0, [r4, 0x4] + mov r1, sp + ldr r0, =gUnknown_08614290 + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + mov r1, sp + ldrh r0, [r5, 0x6] + strh r0, [r1] + ldrh r0, [r5, 0x8] + strh r0, [r1, 0x2] + ldrb r1, [r5] + ldrb r2, [r5, 0x1] + mov r0, sp + movs r3, 0 + bl CreateSprite + strb r0, [r4] + ldr r3, =gSprites + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r2, 0x8 + strh r2, [r0, 0x24] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r2, [r0, 0x26] + ldrh r1, [r5, 0x8] + ldr r0, =0x0000ffff + cmp r1, r0 + bne _081AFB46 + ldrb r0, [r4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r2, [r5, 0xA] + lsls r2, 4 + ldrb r3, [r1, 0x5] + movs r0, 0xF + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0x5] +_081AFB46: + adds r0, r6, 0 + add sp, 0x28 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end ListMenuAddRedArrowCursorObject + + thumb_func_start ListMenuUpdateRedArrowCursorObject +@ void ListMenuUpdateRedArrowCursorObject(u8 taskId, u16 x, u16 y) +ListMenuUpdateRedArrowCursorObject: @ 81AFB68 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r3, r0, 2 + adds r3, r0 + lsls r3, 3 + ldr r0, =gTasks + 0x8 + adds r3, r0 + ldr r5, =gSprites + ldrb r4, [r3] + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r5 + strh r1, [r0, 0x20] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r2, [r0, 0x22] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ListMenuUpdateRedArrowCursorObject + + thumb_func_start ListMenuRemoveRedArrowCursorObject +ListMenuRemoveRedArrowCursorObject: @ 81AFBA0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + ldrh r0, [r4, 0x2] + ldr r6, =0x0000ffff + cmp r0, r6 + beq _081AFBBE + bl FreeSpriteTilesByTag +_081AFBBE: + ldrh r0, [r4, 0x4] + cmp r0, r6 + beq _081AFBC8 + bl FreeSpritePaletteByTag +_081AFBC8: + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + bl DestroySprite + adds r0, r5, 0 + bl DestroyTask + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end ListMenuRemoveRedArrowCursorObject + + thumb_func_start sub_81AFBF0 +sub_81AFBF0: @ 81AFBF0 + push {lr} + ldr r1, =gUnknown_0203CE9C + movs r2, 0 + adds r0, r1, 0 + adds r0, 0x1C +_081AFBFA: + str r2, [r0] + subs r0, 0x4 + cmp r0, r1 + bge _081AFBFA + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AFBF0 + + thumb_func_start sub_81AFC0C +sub_81AFC0C: @ 81AFC0C + push {lr} + adds r2, r1, 0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x7 + bhi _081AFC20 + ldr r1, =gUnknown_0203CE9C + lsls r0, 2 + adds r0, r1 + str r2, [r0] +_081AFC20: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AFC0C + + thumb_func_start sub_81AFC28 +sub_81AFC28: @ 81AFC28 + push {r4,r5,lr} + adds r2, r0, 0 + adds r4, r1, 0 + ldrb r1, [r4] + adds r0, r1, 0 + cmp r0, 0xFF + beq _081AFC68 + ldr r5, =gUnknown_0203CE9C +_081AFC38: + cmp r1, 0xF7 + beq _081AFC48 + strb r1, [r2] + adds r4, 0x1 + adds r2, 0x1 + b _081AFC60 + .pool +_081AFC48: + adds r4, 0x1 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r5 + ldr r1, [r0] + cmp r1, 0 + beq _081AFC5E + adds r0, r2, 0 + bl StringCopy + adds r2, r0, 0 +_081AFC5E: + adds r4, 0x1 +_081AFC60: + ldrb r1, [r4] + adds r0, r1, 0 + cmp r0, 0xFF + bne _081AFC38 +_081AFC68: + movs r0, 0xFF + strb r0, [r2] + adds r0, r2, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81AFC28 + + thumb_func_start sub_81AFC74 +sub_81AFC74: @ 81AFC74 + lsls r0, 24 + ldr r1, =gUnknown_0203CE9C + lsrs r0, 22 + adds r0, r1 + ldr r0, [r0] + bx lr + .pool + thumb_func_end sub_81AFC74 + + thumb_func_start sav1_are_mapnumbers_in_given_list +sav1_are_mapnumbers_in_given_list: @ 81AFC84 + push {r4,lr} + adds r2, r0, 0 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0x4 + ldrsb r1, [r0, r1] + lsls r1, 8 + ldrb r0, [r0, 0x5] + lsls r0, 24 + asrs r0, 24 + adds r0, r1 + lsls r0, 16 + lsrs r3, r0, 16 + ldrh r0, [r2] + ldr r1, =0x0000ffff + cmp r0, r1 + beq _081AFCC4 + adds r4, r1, 0 + adds r1, r2, 0 +_081AFCAA: + ldrh r0, [r1] + cmp r0, r3 + bne _081AFCBC + movs r0, 0x1 + b _081AFCC6 + .pool +_081AFCBC: + adds r1, 0x2 + ldrh r0, [r1] + cmp r0, r4 + bne _081AFCAA +_081AFCC4: + movs r0, 0 +_081AFCC6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sav1_are_mapnumbers_in_given_list + + thumb_func_start sav1_is_in_pokecenter +sav1_is_in_pokecenter: @ 81AFCCC + push {lr} + ldr r0, =gUnknown_086143BC + bl sav1_are_mapnumbers_in_given_list + pop {r1} + bx r1 + .pool + thumb_func_end sav1_is_in_pokecenter + + thumb_func_start sub_81AFCDC +sub_81AFCDC: @ 81AFCDC + push {lr} + ldr r0, =gUnknown_0861440A + bl sav1_are_mapnumbers_in_given_list + pop {r1} + bx r1 + .pool + thumb_func_end sub_81AFCDC + + thumb_func_start sub_81AFCEC +sub_81AFCEC: @ 81AFCEC + push {lr} + ldr r0, =gUnknown_0861440E + bl sav1_are_mapnumbers_in_given_list + pop {r1} + bx r1 + .pool + thumb_func_end sub_81AFCEC + + thumb_func_start sav2_set_x9_bit3_when_sav1_in_pokecenter +sav2_set_x9_bit3_when_sav1_in_pokecenter: @ 81AFCFC + push {lr} + bl sav1_is_in_pokecenter + cmp r0, 0 + bne _081AFD18 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldrb r1, [r2, 0x9] + movs r0, 0xFD + ands r0, r1 + b _081AFD22 + .pool +_081AFD18: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldrb r1, [r2, 0x9] + movs r0, 0x2 + orrs r0, r1 +_081AFD22: + strb r0, [r2, 0x9] + pop {r0} + bx r0 + .pool + thumb_func_end sav2_set_x9_bit3_when_sav1_in_pokecenter + + thumb_func_start sub_81AFD2C +sub_81AFD2C: @ 81AFD2C + push {lr} + bl sub_81AFCDC + cmp r0, 0 + bne _081AFD48 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldrb r1, [r2, 0x9] + movs r0, 0xFB + ands r0, r1 + b _081AFD52 + .pool +_081AFD48: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldrb r1, [r2, 0x9] + movs r0, 0x4 + orrs r0, r1 +_081AFD52: + strb r0, [r2, 0x9] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AFD2C + + thumb_func_start sub_81AFD5C +sub_81AFD5C: @ 81AFD5C + push {lr} + bl sub_81AFCEC + cmp r0, 0 + bne _081AFD78 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldrb r1, [r2, 0x9] + movs r0, 0xF7 + ands r0, r1 + b _081AFD82 + .pool +_081AFD78: + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldrb r1, [r2, 0x9] + movs r0, 0x8 + orrs r0, r1 +_081AFD82: + strb r0, [r2, 0x9] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81AFD5C + + thumb_func_start sav2_set_x9_depending_on_sav1_map +sav2_set_x9_depending_on_sav1_map: @ 81AFD8C + push {lr} + bl sav2_set_x9_bit3_when_sav1_in_pokecenter + bl sub_81AFD2C + bl sub_81AFD5C + pop {r0} + bx r0 + thumb_func_end sav2_set_x9_depending_on_sav1_map + + thumb_func_start sub_81AFDA0 +sub_81AFDA0: @ 81AFDA0 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + adds r2, 0xA8 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 8 + orrs r0, r1 + movs r1, 0x1 + orrs r0, r1 + movs r1, 0x2 + orrs r0, r1 + movs r1, 0x4 + orrs r0, r1 + movs r1, 0x10 + orrs r0, r1 + movs r1, 0x20 + orrs r0, r1 + movs r1, 0x8 + orrs r0, r1 + str r0, [r2] + bx lr + .pool + thumb_func_end sub_81AFDA0 + + thumb_func_start sub_81AFDD0 +sub_81AFDD0: @ 81AFDD0 + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + ldrb r1, [r2, 0x9] + movs r0, 0x80 + orrs r0, r1 + strb r0, [r2, 0x9] + bx lr + .pool + thumb_func_end sub_81AFDD0 + + thumb_func_start AllocItemIconTemporaryBuffers +@ bool8 AllocItemIconTemporaryBuffers() +AllocItemIconTemporaryBuffers: @ 81AFDE4 + push {r4,r5,lr} + ldr r5, =gUnknown_0203CEBC + movs r0, 0x90 + lsls r0, 1 + bl Alloc + str r0, [r5] + cmp r0, 0 + beq _081AFE1A + ldr r4, =gUnknown_0203CEC0 + movs r0, 0x80 + lsls r0, 2 + bl AllocZeroed + str r0, [r4] + cmp r0, 0 + beq _081AFE14 + movs r0, 0x1 + b _081AFE1C + .pool +_081AFE14: + ldr r0, [r5] + bl Free +_081AFE1A: + movs r0, 0 +_081AFE1C: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end AllocItemIconTemporaryBuffers + + thumb_func_start FreeItemIconTemporaryBuffers +@ void FreeItemIconTemporaryBuffers() +FreeItemIconTemporaryBuffers: @ 81AFE24 + push {lr} + ldr r0, =gUnknown_0203CEBC + ldr r0, [r0] + bl Free + ldr r0, =gUnknown_0203CEC0 + ldr r0, [r0] + bl Free + pop {r0} + bx r0 + .pool + thumb_func_end FreeItemIconTemporaryBuffers + + thumb_func_start CopyItemIconPicTo4x4Buffer +@ void CopyItemIconPicTo4x4Buffer(void *src, void *dest) +CopyItemIconPicTo4x4Buffer: @ 81AFE44 + push {r4-r6,lr} + adds r6, r0, 0 + adds r5, r1, 0 + movs r4, 0 +_081AFE4C: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 5 + adds r0, r6, r0 + lsls r1, r4, 7 + adds r1, r5, r1 + movs r2, 0x30 + bl CpuSet + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _081AFE4C + pop {r4-r6} + pop {r0} + bx r0 + 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 + lsls r0, 16 + lsrs r7, r0, 16 + lsls r1, 16 + lsrs r6, r1, 16 + lsls r2, 16 + lsrs r5, r2, 16 + bl AllocItemIconTemporaryBuffers + lsls r0, 24 + cmp r0, 0 + beq _081AFF28 + adds r0, r5, 0 + movs r1, 0 + bl GetItemIconPicOrPalette + ldr r4, =gUnknown_0203CEBC + ldr r1, [r4] + bl LZDecompressWram + ldr r0, [r4] + ldr r4, =gUnknown_0203CEC0 + ldr r1, [r4] + bl CopyItemIconPicTo4x4Buffer + ldr r0, [r4] + str r0, [sp] + ldr r4, =0xffff0000 + ldr r0, [sp, 0x4] + ands r0, r4 + movs r1, 0x80 + lsls r1, 2 + orrs r0, r1 + lsls r2, r7, 16 + ldr r1, =0x0000ffff + ands r0, r1 + orrs r0, r2 + str r0, [sp, 0x4] + mov r0, sp + bl LoadSpriteSheet + adds r0, r5, 0 + movs r1, 0x1 + bl GetItemIconPicOrPalette + str r0, [sp, 0x8] + add r0, sp, 0x8 + ldr r1, [r0, 0x4] + ands r1, r4 + orrs r1, r6 + str r1, [r0, 0x4] + bl LoadCompressedObjectPalette + movs r0, 0x18 + bl Alloc + adds r5, r0, 0 + ldr r0, =gUnknown_08614FF4 + adds r1, r5, 0 + movs r2, 0xC + bl CpuSet + strh r7, [r5] + strh r6, [r5, 0x2] + adds r0, r5, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl CreateSprite + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl FreeItemIconTemporaryBuffers + adds r0, r5, 0 + bl Free + adds r0, r4, 0 + b _081AFF2A + .pool +_081AFF28: + movs r0, 0x40 +_081AFF2A: + add sp, 0x10 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end AddItemIconObject + + 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} + sub sp, 0x10 + mov r8, r0 + lsls r1, 16 + lsrs r7, r1, 16 + lsls r2, 16 + lsrs r6, r2, 16 + lsls r3, 16 + lsrs r5, r3, 16 + bl AllocItemIconTemporaryBuffers + lsls r0, 24 + cmp r0, 0 + beq _081AFFEC + adds r0, r5, 0 + movs r1, 0 + bl GetItemIconPicOrPalette + ldr r4, =gUnknown_0203CEBC + ldr r1, [r4] + bl LZDecompressWram + ldr r0, [r4] + ldr r4, =gUnknown_0203CEC0 + ldr r1, [r4] + bl CopyItemIconPicTo4x4Buffer + ldr r0, [r4] + str r0, [sp] + ldr r4, =0xffff0000 + ldr r0, [sp, 0x4] + ands r0, r4 + movs r1, 0x80 + lsls r1, 2 + orrs r0, r1 + lsls r2, r7, 16 + ldr r1, =0x0000ffff + ands r0, r1 + orrs r0, r2 + str r0, [sp, 0x4] + mov r0, sp + bl LoadSpriteSheet + adds r0, r5, 0 + movs r1, 0x1 + bl GetItemIconPicOrPalette + str r0, [sp, 0x8] + add r0, sp, 0x8 + ldr r1, [r0, 0x4] + ands r1, r4 + orrs r1, r6 + str r1, [r0, 0x4] + bl LoadCompressedObjectPalette + movs r0, 0x18 + bl Alloc + adds r5, r0, 0 + mov r0, r8 + adds r1, r5, 0 + movs r2, 0xC + bl CpuSet + strh r7, [r5] + strh r6, [r5, 0x2] + adds r0, r5, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl CreateSprite + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl FreeItemIconTemporaryBuffers + adds r0, r5, 0 + bl Free + adds r0, r4, 0 + b _081AFFEE + .pool +_081AFFEC: + movs r0, 0x40 +_081AFFEE: + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end AddItemIconObjectWithCustomObjectTemplate + + thumb_func_start GetItemIconPicOrPalette +@ u32 GetItemIconPicOrPalette(u16 itemId, u8 which) +GetItemIconPicOrPalette: @ 81AFFFC + push {lr} + lsls r0, 16 + lsrs r3, r0, 16 + lsls r1, 24 + lsrs r1, 24 + ldr r0, =0x0000ffff + cmp r3, r0 + bne _081B0018 + ldr r3, =0x00000179 + b _081B0022 + .pool +_081B0018: + movs r0, 0xBC + lsls r0, 1 + cmp r3, r0 + bls _081B0022 + movs r3, 0 +_081B0022: + ldr r2, =gItemIconTable + lsls r0, r1, 2 + lsls r1, r3, 3 + adds r0, r1 + adds r0, r2 + ldr r0, [r0] + pop {r1} + bx r1 + .pool + thumb_func_end GetItemIconPicOrPalette + + thumb_func_start sub_81B0038 +sub_81B0038: @ 81B0038 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + ldr r4, [sp, 0x24] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + lsls r2, 24 + lsrs r7, r2, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp] + lsls r4, 24 + lsrs r6, r4, 24 + bl reset_brm + ldr r0, =gUnknown_0203CEC4 + mov r10, r0 + movs r0, 0x8E + lsls r0, 2 + bl Alloc + adds r5, r0, 0 + mov r1, r10 + str r5, [r1] + cmp r5, 0 + bne _081B0088 + ldr r0, [sp, 0x2C] + bl SetMainCallback2 + b _081B0194 + .pool +_081B0088: + ldr r3, =gUnknown_0203CEC8 + movs r1, 0xF + mov r4, r8 + ands r1, r4 + ldrb r2, [r3, 0x8] + movs r0, 0x10 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x8] + ldr r0, [sp, 0x2C] + str r0, [r3] + movs r4, 0 + strb r7, [r3, 0xB] + lsls r2, r6, 2 + ldrh r1, [r5, 0xA] + movs r0, 0x3 + ands r0, r1 + orrs r0, r2 + strh r0, [r5, 0xA] + ldr r0, [sp, 0x28] + str r0, [r5] + str r4, [r5, 0x4] + ldrb r1, [r5, 0x8] + movs r0, 0xF + negs r0, r0 + ands r0, r1 + strb r0, [r5, 0x8] + mov r1, r10 + ldr r2, [r1] + ldrh r0, [r2, 0x8] + movs r4, 0xFE + lsls r4, 3 + adds r1, r4, 0 + orrs r0, r1 + strh r0, [r2, 0x8] + ldr r0, [r2, 0x8] + movs r1, 0xFE + lsls r1, 10 + orrs r0, r1 + str r0, [r2, 0x8] + adds r6, r3, 0 + mov r5, r8 + cmp r5, 0x4 + bne _081B00F0 + ldrb r0, [r2, 0x8] + movs r1, 0x1 + orrs r0, r1 + b _081B00F8 + .pool +_081B00F0: + ldrb r1, [r2, 0x8] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 +_081B00F8: + strb r0, [r2, 0x8] + mov r0, r9 + cmp r0, 0xFF + beq _081B0114 + movs r0, 0x3 + mov r1, r9 + ands r0, r1 + lsls r0, 4 + ldrb r2, [r6, 0x8] + movs r1, 0x31 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r6, 0x8] +_081B0114: + movs r2, 0 + ldr r5, =gUnknown_0203CEC4 + movs r4, 0x86 + lsls r4, 2 + movs r3, 0 +_081B011E: + ldr r0, [r5] + lsls r1, r2, 1 + adds r0, r4 + adds r0, r1 + strh r3, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0xF + bls _081B011E + movs r2, 0 + ldr r4, =gUnknown_0203CEC4 + movs r3, 0xFF +_081B0138: + ldr r0, [r4] + adds r0, 0xC + adds r0, r2 + ldrb r1, [r0] + orrs r1, r3 + strb r1, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x2 + bls _081B0138 + ldr r4, [sp] + cmp r4, 0 + bne _081B015C + strb r4, [r6, 0x9] + b _081B017E + .pool +_081B015C: + adds r1, r6, 0 + movs r0, 0x9 + ldrsb r0, [r1, r0] + cmp r0, 0x5 + bgt _081B017A + adds r1, r0, 0 + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + bne _081B017E +_081B017A: + movs r0, 0 + strb r0, [r6, 0x9] +_081B017E: + ldr r2, =gTextFlags + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + bl calc_player_party_count + ldr r0, =c2_811EBD0 + bl SetMainCallback2 +_081B0194: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B0038 + + thumb_func_start sub_81B01B0 +sub_81B01B0: @ 81B01B0 + push {lr} + bl RunTasks + bl AnimateSprites + bl BuildOamBuffer + bl do_scheduled_bg_tilemap_copies_to_vram + bl UpdatePaletteFade + pop {r0} + bx r0 + thumb_func_end sub_81B01B0 + + thumb_func_start sub_81B01CC +sub_81B01CC: @ 81B01CC + push {lr} + bl LoadOam + bl ProcessSpriteCopyRequests + bl TransferPlttBuffer + pop {r0} + bx r0 + thumb_func_end sub_81B01CC + + thumb_func_start c2_811EBD0 +c2_811EBD0: @ 81B01E0 + push {lr} +_081B01E2: + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B0206 + bl sub_81B020C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B0206 + bl sub_81221AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B01E2 +_081B0206: + pop {r0} + bx r0 + thumb_func_end c2_811EBD0 + + thumb_func_start sub_81B020C +sub_81B020C: @ 81B020C + push {r4,lr} + sub sp, 0x4 + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0x16 + bls _081B0222 + b _081B0498 +_081B0222: + lsls r0, 2 + ldr r1, =_081B0234 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081B0234: + .4byte _081B0290 + .4byte _081B02AC + .4byte _081B02B2 + .4byte _081B02D4 + .4byte _081B02DA + .4byte _081B02EC + .4byte _081B02FE + .4byte _081B0310 + .4byte _081B0338 + .4byte _081B0354 + .4byte _081B0368 + .4byte _081B038C + .4byte _081B03A0 + .4byte _081B03A6 + .4byte _081B03B8 + .4byte _081B03BE + .4byte _081B03E0 + .4byte _081B0400 + .4byte _081B0414 + .4byte _081B0428 + .4byte _081B0430 + .4byte _081B044C + .4byte _081B0474 +_081B0290: + bl SetVBlankHBlankCallbacksToNull + bl sub_8121DA0 + bl clear_scheduled_bg_copies_to_vram + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .pool +_081B02AC: + bl remove_some_task + b _081B0484 +_081B02B2: + bl ResetPaletteFade + ldr r2, =gPaletteFade + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x8] + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .pool +_081B02D4: + bl ResetSpriteData + b _081B0484 +_081B02DA: + bl FreeAllSpritePalettes + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .pool +_081B02EC: + bl sub_81221AC + lsls r0, 24 + cmp r0, 0 + beq _081B02F8 + b _081B0484 +_081B02F8: + bl ResetTasks + b _081B0484 +_081B02FE: + bl sub_81B209C + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .pool +_081B0310: + bl sub_81B0550 + lsls r0, 24 + cmp r0, 0 + bne _081B0322 + bl sub_81B04BC + movs r0, 0x1 + b _081B04B2 +_081B0322: + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + movs r1, 0x86 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + b _081B0484 + .pool +_081B0338: + bl sub_81B05C8 + lsls r0, 24 + cmp r0, 0 + bne _081B0344 + b _081B04B0 +_081B0344: + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .pool +_081B0354: + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0x8] + lsls r0, 26 + lsrs r0, 30 + bl sub_81B239C + b _081B0484 + .pool +_081B0368: + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0x8] + lsls r0, 26 + lsrs r0, 30 + bl sub_81B0740 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + movs r1, 0x86 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + b _081B0484 + .pool +_081B038C: + bl sub_81B5D30 + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .pool +_081B03A0: + bl sub_81B6040 + b _081B0484 +_081B03A6: + bl sub_81B6160 + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .pool +_081B03B8: + bl sub_80D2F04 + b _081B0484 +_081B03BE: + bl party_menu_add_per_mon_objects + lsls r0, 24 + cmp r0, 0 + bne _081B03CA + b _081B04B0 +_081B03CA: + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + movs r1, 0x86 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + b _081B0484 + .pool +_081B03E0: + bl sub_81B0DA0 + lsls r0, 24 + cmp r0, 0 + beq _081B04B0 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + movs r1, 0x86 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + b _081B0484 + .pool +_081B0400: + bl sub_81B0F28 + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .pool +_081B0414: + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 31 + lsrs r0, 31 + bl sub_81B2428 + b _081B0484 + .pool +_081B0428: + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 + b _081B048C +_081B0430: + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + ldr r0, [r0] + movs r1, 0 + bl CreateTask + ldr r0, [r4] + ldrh r0, [r0, 0xA] + lsrs r0, 2 + bl display_pokemon_menu_message + b _081B0484 + .pool +_081B044C: + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl BlendPalettes + ldr r2, =gPaletteFade + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x8] + ldr r1, =gMain + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .pool +_081B0474: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl BeginNormalPaletteFade +_081B0484: + ldr r1, =gMain + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 +_081B048C: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _081B04B0 + .pool +_081B0498: + ldr r0, =sub_81B01CC + bl SetVBlankCallback + ldr r0, =sub_81B01B0 + bl SetMainCallback2 + movs r0, 0x1 + b _081B04B2 + .pool +_081B04B0: + movs r0, 0 +_081B04B2: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B020C + + thumb_func_start sub_81B04BC +sub_81B04BC: @ 81B04BC + push {lr} + sub sp, 0x4 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + ldr r0, =sub_81B04F8 + movs r1, 0 + bl CreateTask + ldr r0, =sub_81B01CC + bl SetVBlankCallback + ldr r0, =sub_81B01B0 + bl SetMainCallback2 + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B04BC + + thumb_func_start sub_81B04F8 +sub_81B04F8: @ 81B04F8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B051C + ldr r0, =gUnknown_0203CEC8 + ldr r0, [r0] + bl SetMainCallback2 + bl sub_81B06F4 + adds r0, r4, 0 + bl DestroyTask +_081B051C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B04F8 + + thumb_func_start reset_brm +reset_brm: @ 81B052C + ldr r0, =gUnknown_0203CEC4 + movs r1, 0 + str r1, [r0] + ldr r0, =gUnknown_0203CEE4 + str r1, [r0] + ldr r0, =gUnknown_0203CEDC + str r1, [r0] + ldr r0, =gUnknown_0203CEE0 + str r1, [r0] + bx lr + .pool + thumb_func_end reset_brm + + thumb_func_start sub_81B0550 +sub_81B0550: @ 81B0550 + push {r4,r5,lr} + ldr r5, =gUnknown_0203CEE4 + movs r4, 0x80 + lsls r4, 4 + adds r0, r4, 0 + bl Alloc + str r0, [r5] + cmp r0, 0 + beq _081B05C0 + movs r1, 0 + adds r2, r4, 0 + bl memset + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_086156B8 + movs r0, 0 + movs r2, 0x3 + bl InitBgsFromTemplates + ldr r1, [r5] + movs r0, 0x1 + bl SetBgTilemapBuffer + bl sub_8121E10 + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x1 + b _081B05C2 + .pool +_081B05C0: + movs r0, 0 +_081B05C2: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81B0550 + + thumb_func_start sub_81B05C8 +sub_81B05C8: @ 81B05C8 + push {r4,lr} + sub sp, 0x4 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + movs r1, 0x86 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x7 + bhi _081B06B0 + lsls r0, 2 + ldr r1, =_081B05F0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081B05F0: + .4byte _081B0610 + .4byte _081B0638 + .4byte _081B0658 + .4byte _081B0684 + .4byte _081B0688 + .4byte _081B068C + .4byte _081B0690 + .4byte _081B0694 +_081B0610: + ldr r4, =gUnknown_0203CEE0 + ldr r0, =gUnknown_08D967EC + mov r1, sp + bl malloc_and_decompress + adds r1, r0, 0 + str r1, [r4] + ldr r2, [sp] + lsls r2, 16 + lsrs r2, 16 + movs r0, 0x1 + movs r3, 0 + bl LoadBgTiles + b _081B069A + .pool +_081B0638: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _081B06B4 + ldr r0, =gUnknown_08D96BA0 + ldr r1, =gUnknown_0203CEE4 + ldr r1, [r1] + bl LZDecompressWram + b _081B069A + .pool +_081B0658: + ldr r0, =gUnknown_08D96AB4 + movs r2, 0xB0 + lsls r2, 1 + movs r1, 0 + bl LoadCompressedPalette + ldr r0, =gPlttBufferUnfaded + ldr r4, =gUnknown_0203CEC4 + ldr r1, [r4] + adds r1, 0x18 + movs r2, 0xB0 + bl CpuSet + ldr r1, [r4] + b _081B069E + .pool +_081B0684: + movs r0, 0x4 + b _081B0696 +_081B0688: + movs r0, 0x5 + b _081B0696 +_081B068C: + movs r0, 0x6 + b _081B0696 +_081B0690: + movs r0, 0x7 + b _081B0696 +_081B0694: + movs r0, 0x8 +_081B0696: + bl sub_81B06C0 +_081B069A: + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] +_081B069E: + movs r0, 0x86 + lsls r0, 2 + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _081B06B4 + .pool +_081B06B0: + movs r0, 0x1 + b _081B06B6 +_081B06B4: + movs r0, 0 +_081B06B6: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B05C8 + + thumb_func_start sub_81B06C0 +sub_81B06C0: @ 81B06C0 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 28 + ldr r5, =gPlttBufferUnfaded + 0x60 + lsrs r4, 23 + adds r1, r5, 0 + subs r1, 0x60 + adds r1, r4, r1 + adds r0, r5, 0 + movs r2, 0x10 + bl CpuSet + ldr r0, =gPlttBufferFaded + adds r4, r0 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x10 + bl CpuSet + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B06C0 + + thumb_func_start sub_81B06F4 +sub_81B06F4: @ 81B06F4 + push {lr} + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + cmp r0, 0 + beq _081B0702 + bl Free +_081B0702: + ldr r0, =gUnknown_0203CEE4 + ldr r0, [r0] + cmp r0, 0 + beq _081B070E + bl Free +_081B070E: + ldr r0, =gUnknown_0203CEE0 + ldr r0, [r0] + cmp r0, 0 + beq _081B071A + bl Free +_081B071A: + ldr r0, =gUnknown_0203CEDC + ldr r0, [r0] + cmp r0, 0 + beq _081B0726 + bl Free +_081B0726: + bl FreeAllWindowBuffers + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B06F4 + + thumb_func_start sub_81B0740 +sub_81B0740: @ 81B0740 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, =gUnknown_0203CEDC + movs r0, 0x60 + bl Alloc + str r0, [r4] + movs r5, 0 + lsls r0, r7, 1 + adds r0, r7 + lsls r0, 4 + mov r8, r0 + movs r6, 0xFF + mov r9, r4 +_081B0764: + ldr r2, [r4] + lsls r3, r5, 4 + adds r2, r3, r2 + ldr r0, =gUnknown_086156E4 + mov r12, r0 + str r0, [r2] + lsls r0, r5, 3 + ldr r1, =gUnknown_08615704 + adds r0, r1 + add r0, r8 + str r0, [r2, 0x4] + strb r5, [r2, 0x8] + ldr r1, [r4] + adds r1, r3, r1 + ldrb r0, [r1, 0x9] + orrs r0, r6 + strb r0, [r1, 0x9] + ldr r1, [r4] + adds r1, r3, r1 + ldrb r0, [r1, 0xA] + orrs r0, r6 + strb r0, [r1, 0xA] + ldr r1, [r4] + adds r1, r3, r1 + ldrb r0, [r1, 0xB] + orrs r0, r6 + strb r0, [r1, 0xB] + ldr r0, [r4] + adds r3, r0 + ldrb r0, [r3, 0xC] + orrs r0, r6 + strb r0, [r3, 0xC] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _081B0764 + mov r1, r9 + ldr r0, [r1] + mov r1, r12 + subs r1, 0x20 + str r1, [r0] + cmp r7, 0x3 + bne _081B07CC + str r1, [r0, 0x30] + b _081B07D2 + .pool +_081B07CC: + cmp r7, 0 + beq _081B07D2 + str r1, [r0, 0x10] +_081B07D2: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B0740 + + thumb_func_start sub_81B07E0 +sub_81B07E0: @ 81B07E0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gUnknown_0203CEC8 + ldrb r1, [r0, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x5 + bne _081B085C + cmp r5, 0x2 + bls _081B085C + adds r0, r5, 0 + bl sub_81B0CEC + ldr r0, =gUnknown_02022FF8 + subs r1, r5, 0x3 + lsls r1, 5 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _081B0828 + ldr r0, =gUnknown_0203CEDC + lsls r4, r5, 4 + ldr r0, [r0] + adds r0, r4 + movs r1, 0x40 + bl sub_81B2748 + b _081B0836 + .pool +_081B0828: + ldr r0, =gUnknown_0203CEDC + lsls r4, r5, 4 + ldr r0, [r0] + adds r0, r4 + movs r1, 0x8 + bl sub_81B2748 +_081B0836: + adds r5, r4, 0 + ldr r4, =gUnknown_0203CEDC + ldr r0, [r4] + adds r0, r5, r0 + ldrb r0, [r0, 0x8] + movs r1, 0x2 + bl CopyWindowToVram + ldr r0, [r4] + adds r0, r5, r0 + ldrb r0, [r0, 0x8] + bl PutWindowTilemap + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + b _081B093E + .pool +_081B085C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + bne _081B089C + ldr r4, =gUnknown_0203CEDC + ldr r0, [r4] + lsls r5, 4 + adds r0, r5, r0 + ldrb r0, [r0, 0x8] + bl sub_81B2720 + ldr r0, [r4] + adds r0, r5 + movs r1, 0x40 + bl sub_81B2748 + ldr r0, [r4] + adds r0, r5, r0 + ldrb r0, [r0, 0x8] + movs r1, 0x2 + bl CopyWindowToVram + b _081B092C + .pool +_081B089C: + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0x8] + movs r1, 0xF + ands r1, r0 + cmp r1, 0x7 + bne _081B08B4 + adds r0, r5, 0 + bl sub_81B0B60 + b _081B08F6 + .pool +_081B08B4: + cmp r1, 0x2 + bne _081B08C0 + adds r0, r5, 0 + bl sub_81B0B08 + b _081B08F6 +_081B08C0: + cmp r1, 0x4 + bne _081B08CC + adds r0, r5, 0 + bl sub_81B0A9C + b _081B08F6 +_081B08CC: + cmp r1, 0xB + bne _081B08D8 + adds r0, r5, 0 + bl sub_81B0B98 + b _081B08F6 +_081B08D8: + cmp r1, 0xC + bne _081B08E4 + adds r0, r5, 0 + bl sub_81B0BC4 + b _081B08F6 +_081B08E4: + adds r0, r5, 0 + bl sub_81B0BFC + lsls r0, 24 + cmp r0, 0 + bne _081B08F6 + adds r0, r5, 0 + bl sub_81B0948 +_081B08F6: + ldr r2, =gUnknown_0203CEC8 + ldrb r1, [r2, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x5 + bne _081B0910 + adds r0, r5, 0 + movs r1, 0 + bl sub_81B0FCC + b _081B092A + .pool +_081B0910: + movs r0, 0x9 + ldrsb r0, [r2, r0] + cmp r0, r5 + bne _081B0922 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_81B0FCC + b _081B092A +_081B0922: + adds r0, r5, 0 + movs r1, 0 + bl sub_81B0FCC +_081B092A: + lsls r5, 4 +_081B092C: + ldr r0, =gUnknown_0203CEDC + ldr r0, [r0] + adds r0, r5, r0 + ldrb r0, [r0, 0x8] + bl PutWindowTilemap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram +_081B093E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B07E0 + + thumb_func_start sub_81B0948 +sub_81B0948: @ 81B0948 + push {r4-r7,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x64 + adds r1, r4, 0 + muls r1, r0 + ldr r0, =gPlayerParty + adds r7, r1, r0 + adds r0, r7, 0 + movs r1, 0x2D + bl GetMonData + adds r2, r0, 0 + cmp r2, 0 + beq _081B09A0 + ldr r6, =gUnknown_0203CEDC + ldr r0, [r6] + lsls r5, r4, 4 + adds r0, r5, r0 + ldr r2, [r0] + ldrb r0, [r0, 0x8] + movs r1, 0 + str r1, [sp] + movs r1, 0x1 + str r1, [sp, 0x4] + ldr r4, [r2] + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl _call_via_r4 + ldr r1, [r6] + adds r1, r5 + adds r0, r7, 0 + movs r2, 0 + bl sub_81B2A70 + b _081B0A02 + .pool +_081B09A0: + ldr r5, =gUnknown_0203CEDC + ldr r0, [r5] + lsls r4, 4 + adds r0, r4, r0 + ldr r1, [r0] + ldrb r0, [r0, 0x8] + str r2, [sp] + str r2, [sp, 0x4] + ldr r6, [r1] + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl _call_via_r6 + ldr r1, [r5] + adds r1, r4 + adds r0, r7, 0 + movs r2, 0 + bl sub_81B2A70 + ldr r1, [r5] + adds r1, r4 + adds r0, r7, 0 + movs r2, 0 + bl sub_81B2AC8 + ldr r1, [r5] + adds r1, r4 + adds r0, r7, 0 + movs r2, 0 + bl sub_81B2B8C + ldr r1, [r5] + adds r1, r4 + adds r0, r7, 0 + movs r2, 0 + bl sub_81B2CD4 + ldr r1, [r5] + adds r1, r4 + adds r0, r7, 0 + movs r2, 0 + bl sub_81B2D74 + ldr r1, [r5] + adds r1, r4 + adds r0, r7, 0 + bl sub_81B2E28 +_081B0A02: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B0948 + + thumb_func_start sub_81B0A10 +sub_81B0A10: @ 81B0A10 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + movs r1, 0x64 + adds r2, r0, 0 + muls r2, r1 + ldr r1, =gPlayerParty + adds r6, r2, r1 + ldr r7, =gUnknown_0203CEDC + ldr r1, [r7] + lsls r5, r0, 4 + adds r1, r5, r1 + ldr r2, [r1] + ldrb r0, [r1, 0x8] + movs r1, 0 + str r1, [sp] + movs r1, 0x1 + str r1, [sp, 0x4] + ldr r4, [r2] + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl _call_via_r4 + ldr r1, [r7] + adds r1, r5 + adds r0, r6, 0 + movs r2, 0 + bl sub_81B2A70 + adds r0, r6, 0 + movs r1, 0x2D + bl GetMonData + cmp r0, 0 + bne _081B0A7C + ldr r1, [r7] + adds r1, r5 + adds r0, r6, 0 + movs r2, 0 + bl sub_81B2AC8 + ldr r1, [r7] + adds r1, r5 + adds r0, r6, 0 + movs r2, 0 + bl sub_81B2B8C +_081B0A7C: + ldr r1, [r7] + adds r1, r5 + mov r0, r8 + movs r2, 0 + bl sub_81B2FA8 + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B0A10 + + thumb_func_start sub_81B0A9C +sub_81B0A9C: @ 81B0A9C + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r6, =gUnknown_0203CEF8 + bl sub_81B85AC + lsls r0, 24 + cmp r0, 0 + bne _081B0AD6 + adds r0, r5, 0 + movs r1, 0x7 + bl sub_81B0A10 + b _081B0B02 + .pool +_081B0AC8: + adds r1, r4, 0x2 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl sub_81B0A10 + b _081B0B02 +_081B0AD6: + movs r4, 0 + b _081B0AEE +_081B0ADA: + adds r1, r6, r4 + ldrb r0, [r1] + cmp r0, 0 + beq _081B0AE8 + subs r0, 0x1 + cmp r0, r5 + beq _081B0AC8 +_081B0AE8: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081B0AEE: + bl sub_81B8830 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bcc _081B0ADA + adds r0, r5, 0 + movs r1, 0x1 + bl sub_81B0A10 +_081B0B02: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81B0A9C + + thumb_func_start sub_81B0B08 +sub_81B0B08: @ 81B0B08 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x64 + muls r0, r4 + ldr r1, =gPlayerParty + adds r0, r1 + bl sub_80DAE0C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bhi _081B0B5A + lsls r0, 2 + ldr r1, =_081B0B34 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081B0B34: + .4byte _081B0B48 + .4byte _081B0B52 + .4byte _081B0B52 + .4byte _081B0B48 + .4byte _081B0B48 +_081B0B48: + adds r0, r4, 0 + movs r1, 0x7 + bl sub_81B0A10 + b _081B0B5A +_081B0B52: + adds r0, r4, 0 + movs r1, 0x6 + bl sub_81B0A10 +_081B0B5A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B0B08 + + thumb_func_start sub_81B0B60 +sub_81B0B60: @ 81B0B60 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x64 + muls r0, r4 + ldr r1, =gPlayerParty + adds r0, r1 + bl sub_806E25C + lsls r0, 24 + cmp r0, 0 + bne _081B0B88 + adds r0, r4, 0 + movs r1, 0x9 + bl sub_81B0A10 + b _081B0B90 + .pool +_081B0B88: + adds r0, r4, 0 + movs r1, 0x8 + bl sub_81B0A10 +_081B0B90: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B0B60 + + thumb_func_start sub_81B0B98 +sub_81B0B98: @ 81B0B98 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_81B218C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B0BB6 + adds r0, r4, 0 + movs r1, 0x6 + bl sub_81B0A10 + b _081B0BBE +_081B0BB6: + adds r0, r4, 0 + movs r1, 0x7 + bl sub_81B0A10 +_081B0BBE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B0B98 + + thumb_func_start sub_81B0BC4 +sub_81B0BC4: @ 81B0BC4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x64 + muls r0, r4 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xC + bl GetMonData + cmp r0, 0 + beq _081B0BEC + adds r0, r4, 0 + movs r1, 0xB + bl sub_81B0A10 + b _081B0BF4 + .pool +_081B0BEC: + adds r0, r4, 0 + movs r1, 0xC + bl sub_81B0A10 +_081B0BF4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B0BC4 + + thumb_func_start sub_81B0BFC +sub_81B0BFC: @ 81B0BFC + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =gPlayerParty + adds r6, r1, r0 + ldr r0, =gUnknown_0203CE7C + ldrh r4, [r0] + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0xB] + cmp r0, 0xC + bne _081B0C40 + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] + ldr r0, =gSpecialVar_0x8005 + ldrb r2, [r0] + adds r0, r5, 0 + movs r1, 0 + bl sub_81B0C94 + b _081B0C8A + .pool +_081B0C40: + cmp r0, 0x3 + bne _081B0C56 + adds r0, r4, 0 + bl CheckIfItemIsTMHMOrEvolutionStone + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B0C5A + cmp r0, 0x2 + beq _081B0C66 +_081B0C56: + movs r0, 0 + b _081B0C8C +_081B0C5A: + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_81B0C94 + b _081B0C8A +_081B0C66: + adds r0, r6, 0 + movs r1, 0x2D + bl GetMonData + cmp r0, 0 + bne _081B0C82 + adds r0, r6, 0 + movs r1, 0x3 + adds r2, r4, 0 + bl GetEvolutionTargetSpecies + lsls r0, 16 + cmp r0, 0 + bne _081B0C56 +_081B0C82: + adds r0, r5, 0 + movs r1, 0 + bl sub_81B0A10 +_081B0C8A: + movs r0, 0x1 +_081B0C8C: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81B0BFC + + thumb_func_start sub_81B0C94 +sub_81B0C94: @ 81B0C94 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x64 + muls r0, r4 + ldr r3, =gPlayerParty + adds r0, r3 + bl sub_81B22D8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _081B0CD2 + cmp r0, 0x2 + bgt _081B0CC4 + cmp r0, 0x1 + beq _081B0CC8 + b _081B0CDC + .pool +_081B0CC4: + cmp r0, 0x3 + bne _081B0CDC +_081B0CC8: + adds r0, r4, 0 + movs r1, 0x9 + bl sub_81B0A10 + b _081B0CE4 +_081B0CD2: + adds r0, r4, 0 + movs r1, 0xA + bl sub_81B0A10 + b _081B0CE4 +_081B0CDC: + adds r0, r4, 0 + movs r1, 0x8 + bl sub_81B0A10 +_081B0CE4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B0C94 + + thumb_func_start sub_81B0CEC +sub_81B0CEC: @ 81B0CEC + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0203CEDC + lsls r2, r0, 4 + ldr r1, [r1] + adds r6, r1, r2 + subs r0, 0x3 + lsls r0, 24 + ldr r5, =gUnknown_02022FF8 + lsrs r0, 19 + mov r8, r0 + adds r7, r0, r5 + ldrh r0, [r7] + cmp r0, 0 + bne _081B0D24 + ldrb r0, [r6, 0x8] + bl sub_81B2720 + b _081B0D8E + .pool +_081B0D24: + ldr r2, [r6] + ldrb r0, [r6, 0x8] + movs r1, 0 + str r1, [sp] + str r1, [sp, 0x4] + ldr r4, [r2] + movs r2, 0 + movs r3, 0 + bl _call_via_r4 + ldr r4, =gStringVar1 + adds r5, 0x4 + add r5, r8 + adds r0, r4, 0 + adds r1, r5, 0 + bl StringCopy + adds r0, r4, 0 + bl StringGetEnd10 + adds r0, r4, 0 + bl sub_81DB52C + ldrb r0, [r6, 0x8] + ldr r3, [r6] + adds r3, 0x4 + adds r1, r4, 0 + movs r2, 0 + bl sub_81B2A3C + ldrb r0, [r7, 0xF] + adds r1, r6, 0 + bl sub_81B2B40 + ldrb r0, [r7, 0x1C] + ldrh r1, [r7] + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_81B2BF4 + ldrh r0, [r7, 0x10] + adds r1, r6, 0 + bl sub_81B2D3C + ldrh r0, [r7, 0x12] + adds r1, r6, 0 + bl sub_81B2DDC + ldrh r0, [r7, 0x10] + ldrh r1, [r7, 0x12] + adds r2, r6, 0 + bl sub_81B2E64 +_081B0D8E: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B0CEC + + thumb_func_start sub_81B0DA0 +sub_81B0DA0: @ 81B0DA0 + push {r4,r5,lr} + ldr r5, =gUnknown_0203CEC4 + ldr r0, [r5] + movs r4, 0x86 + lsls r4, 2 + adds r0, r4 + ldrb r0, [r0] + bl sub_81B07E0 + ldr r1, [r5] + adds r1, r4 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + beq _081B0DCC + movs r0, 0 + b _081B0DCE + .pool +_081B0DCC: + movs r0, 0x1 +_081B0DCE: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81B0DA0 + + thumb_func_start sub_81B0DD4 +sub_81B0DD4: @ 81B0DD4 + lsls r0, 16 + ldr r1, =gUnknown_0203CEE0 + lsrs r0, 11 + ldr r1, [r1] + adds r1, r0 + adds r0, r1, 0 + bx lr + .pool + thumb_func_end sub_81B0DD4 + + 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 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =gUnknown_0203CEC8 + ldrb r1, [r0, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x5 + bne _081B0E98 + cmp r7, 0x2 + bls _081B0E98 + subs r0, r7, 0x3 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldr r0, =gUnknown_02022FF8 + mov r9, r0 + mov r2, r10 + lsls r2, 5 + mov r8, r2 + mov r6, r8 + add r6, r9 + ldrh r0, [r6] + cmp r0, 0 + beq _081B0EDC + mov r1, r9 + adds r1, 0x18 + add r1, r8 + ldr r1, [r1] + ldr r4, =gUnknown_0203CEDC + lsls r5, r7, 4 + ldr r2, [r4] + adds r2, r5 + movs r3, 0 + str r3, [sp] + bl party_menu_link_mon_icon_anim + ldrh r0, [r6] + ldrh r1, [r6, 0x2] + ldr r2, [r4] + adds r2, r5 + bl party_menu_link_mon_held_item_object + ldrh r0, [r6] + ldr r1, [r4] + adds r1, r5 + bl party_menu_link_mon_pokeball_object + ldrh r0, [r6, 0x10] + cmp r0, 0 + bne _081B0E68 + movs r3, 0x7 + b _081B0E78 + .pool +_081B0E68: + mov r0, r9 + adds r0, 0x14 + add r0, r8 + ldr r0, [r0] + bl pokemon_ailments_get_primary + lsls r0, 24 + lsrs r3, r0, 24 +_081B0E78: + ldr r1, =gUnknown_02022FF8 + mov r2, r10 + lsls r0, r2, 5 + adds r0, r1 + ldrh r0, [r0] + ldr r1, =gUnknown_0203CEDC + ldr r2, [r1] + adds r2, r5 + adds r1, r3, 0 + bl party_menu_link_mon_status_condition_object + b _081B0EDC + .pool +_081B0E98: + movs r0, 0x64 + adds r1, r7, 0 + muls r1, r0 + ldr r0, =gPlayerParty + adds r6, r1, r0 + adds r0, r6, 0 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B0EDC + ldr r4, =gUnknown_0203CEDC + lsls r5, r7, 4 + ldr r1, [r4] + adds r1, r5 + adds r0, r6, 0 + adds r2, r7, 0 + bl party_menu_icon_anim + ldr r1, [r4] + adds r1, r5 + adds r0, r6, 0 + bl party_menu_held_item_object + ldr r1, [r4] + adds r1, r5 + adds r0, r6, 0 + bl party_menu_pokeball_object + ldr r1, [r4] + adds r1, r5 + adds r0, r6, 0 + bl party_menu_status_condition_object +_081B0EDC: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end party_menu_add_per_mon_objects_internal + + thumb_func_start party_menu_add_per_mon_objects +party_menu_add_per_mon_objects: @ 81B0EF4 + push {r4,r5,lr} + ldr r5, =gUnknown_0203CEC4 + ldr r0, [r5] + movs r4, 0x86 + lsls r4, 2 + adds r0, r4 + ldrb r0, [r0] + bl party_menu_add_per_mon_objects_internal + ldr r1, [r5] + adds r1, r4 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + beq _081B0F20 + movs r0, 0 + b _081B0F22 + .pool +_081B0F20: + movs r0, 0x1 +_081B0F22: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end party_menu_add_per_mon_objects + + thumb_func_start sub_81B0F28 +sub_81B0F28: @ 81B0F28 + push {r4,lr} + sub sp, 0xC + ldr r0, =gUnknown_0203CEC8 + ldrb r1, [r0, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x5 + bne _081B0F54 + movs r0, 0x7 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x1 + str r0, [sp, 0x8] + movs r1, 0xE + movs r2, 0x17 + movs r3, 0x11 + bl FillBgTilemapBufferRect + b _081B0FBC + .pool +_081B0F54: + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + ldrb r0, [r0, 0x8] + lsls r0, 31 + cmp r0, 0 + beq _081B0F94 + movs r0, 0xBF + movs r1, 0x88 + bl sub_81B5F74 + ldr r3, [r4] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x7F + ands r0, r1 + lsls r0, 4 + ldrh r2, [r3, 0x8] + ldr r1, =0xfffff80f + ands r1, r2 + orrs r1, r0 + strh r1, [r3, 0x8] + bl sub_81B120C + movs r0, 0xBF + movs r1, 0x98 + bl sub_81B5F74 + b _081B0F9C + .pool +_081B0F94: + movs r0, 0xC6 + movs r1, 0x94 + bl sub_81B5F34 +_081B0F9C: + ldr r3, [r4] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x7F + ands r0, r1 + lsls r0, 11 + ldr r1, [r3, 0x8] + ldr r2, =0xfffc07ff + ands r1, r2 + orrs r1, r0 + str r1, [r3, 0x8] + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0x9] + movs r1, 0x1 + bl sub_81B0FCC +_081B0FBC: + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B0F28 + + thumb_func_start sub_81B0FCC +sub_81B0FCC: @ 81B0FCC + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + cmp r7, 0x6 + beq _081B1038 + cmp r7, 0x7 + beq _081B1074 + movs r0, 0x64 + muls r0, r7 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B10E8 + ldr r6, =gUnknown_0203CEDC + lsls r5, r7, 4 + ldr r4, [r6] + adds r4, r5 + adds r0, r7, 0 + mov r1, r8 + bl sub_81B10F8 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_81B2748 + ldr r0, [r6] + adds r0, r5, r0 + ldrb r0, [r0, 0x9] + mov r1, r8 + bl sub_81B5B6C + ldr r0, [r6] + adds r5, r0 + ldrb r0, [r5, 0xB] + mov r1, r8 + bl sub_81B5F98 + b _081B10E8 + .pool +_081B1038: + mov r0, r8 + cmp r0, 0 + bne _081B1052 + movs r0, 0x2 + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r1, 0x17 + movs r2, 0x10 + movs r3, 0x7 + bl sub_8199C30 + b _081B1064 +_081B1052: + movs r0, 0x2 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x1 + movs r1, 0x17 + movs r2, 0x10 + movs r3, 0x7 + bl sub_8199C30 +_081B1064: + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldrh r0, [r0, 0x8] + lsls r0, 21 + b _081B10DA + .pool +_081B1074: + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 31 + cmp r0, 0 + bne _081B10A6 + mov r0, r8 + cmp r0, 0 + bne _081B1098 + movs r0, 0x2 + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r1, 0x17 + movs r2, 0x11 + b _081B10B8 + .pool +_081B1098: + movs r0, 0x2 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x1 + movs r1, 0x17 + movs r2, 0x11 + b _081B10B8 +_081B10A6: + mov r0, r8 + cmp r0, 0 + bne _081B10C0 + movs r0, 0x2 + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r1, 0x17 + movs r2, 0x12 +_081B10B8: + movs r3, 0x7 + bl sub_8199C30 + b _081B10D2 +_081B10C0: + movs r0, 0x2 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x1 + movs r1, 0x17 + movs r2, 0x12 + movs r3, 0x7 + bl sub_8199C30 +_081B10D2: + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldr r0, [r0, 0x8] + lsls r0, 14 +_081B10DA: + lsrs r0, 25 + mov r1, r8 + bl sub_81B5F98 + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram +_081B10E8: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B0FCC + + thumb_func_start sub_81B10F8 +sub_81B10F8: @ 81B10F8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r1, 24 + movs r4, 0 + cmp r1, 0x1 + bne _081B110A + movs r4, 0x1 +_081B110A: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x39 + bl GetMonData + cmp r0, 0 + bne _081B1120 + movs r0, 0x2 + orrs r4, r0 +_081B1120: + adds r0, r5, 0 + bl sub_81B118C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B1136 + movs r0, 0x8 + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_081B1136: + ldr r0, =gUnknown_0203CEC8 + ldrb r1, [r0, 0xB] + adds r2, r0, 0 + cmp r1, 0x9 + bne _081B1148 + movs r0, 0x10 + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_081B1148: + cmp r1, 0x8 + bne _081B1164 + movs r0, 0x9 + ldrsb r0, [r2, r0] + cmp r5, r0 + beq _081B115C + movs r0, 0xA + ldrsb r0, [r2, r0] + cmp r5, r0 + bne _081B1164 +_081B115C: + movs r0, 0x4 + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_081B1164: + ldrb r0, [r2, 0xB] + cmp r0, 0xA + bne _081B117A + movs r0, 0x9 + ldrsb r0, [r2, r0] + cmp r5, r0 + bne _081B117A + movs r0, 0x20 + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_081B117A: + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B10F8 + + thumb_func_start sub_81B118C +sub_81B118C: @ 81B118C + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =gUnknown_0203CEC8 + ldrb r1, [r0, 0x8] + movs r0, 0x30 + ands r0, r1 + cmp r0, 0x20 + bne _081B11B4 + cmp r2, 0x1 + beq _081B11AA + cmp r2, 0x4 + beq _081B11AA + cmp r2, 0x5 + bne _081B11B4 +_081B11AA: + movs r0, 0x1 + b _081B11F8 + .pool +_081B11B4: + cmp r2, 0x2 + bhi _081B11F6 + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _081B11F6 + ldr r0, =gMain + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081B11F6 + adds r0, r2, 0 + bl sub_81B8F38 + ldr r1, =gBattleStruct + ldr r1, [r1] + movs r2, 0xA8 + lsls r2, 2 + adds r1, r2 + ldrb r1, [r1] + lsls r0, 24 + lsrs r0, 24 + asrs r1, r0 + movs r0, 0x1 + ands r1, r0 + cmp r1, 0 + bne _081B11F8 +_081B11F6: + movs r0, 0 +_081B11F8: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B118C + + thumb_func_start sub_81B120C +sub_81B120C: @ 81B120C + push {r4-r6,lr} + sub sp, 0xC + ldr r1, =gUnknown_086157C4 + movs r6, 0x7 + str r6, [sp] + movs r5, 0x2 + str r5, [sp, 0x4] + movs r4, 0x11 + str r4, [sp, 0x8] + movs r0, 0x1 + movs r2, 0x17 + movs r3, 0x10 + bl CopyToBgTilemapBufferRect_ChangePalette + ldr r1, =gUnknown_086157E0 + str r6, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x1 + movs r2, 0x17 + movs r3, 0x12 + bl CopyToBgTilemapBufferRect_ChangePalette + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B120C + + thumb_func_start sub_81B1250 +sub_81B1250: @ 81B1250 + push {lr} + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x49 + ands r0, r1 + cmp r0, 0x49 + bne _081B1280 + ldr r0, =gMain + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081B1280 + movs r0, 0x1 + b _081B1282 + .pool +_081B1280: + movs r0, 0 +_081B1282: + pop {r1} + bx r1 + thumb_func_end sub_81B1250 + + thumb_func_start sub_81B1288 +sub_81B1288: @ 81B1288 + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r1, 0 + movs r0, 0x64 + bl Alloc + adds r5, r0, 0 + adds r1, r4, 0 + movs r2, 0x64 + bl memcpy + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0x64 + bl memcpy + adds r0, r6, 0 + adds r1, r5, 0 + movs r2, 0x64 + bl memcpy + adds r0, r5, 0 + bl Free + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81B1288 + + thumb_func_start sub_81B12C0 +sub_81B12C0: @ 81B12C0 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =c3_0811FAB4 + str r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B12C0 + + thumb_func_start c3_0811FAB4 +c3_0811FAB4: @ 81B12F8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B134C + ldr r4, =gUnknown_0203CEC8 + ldrb r1, [r4, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x1 + bne _081B131A + bl sub_81B9080 +_081B131A: + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldr r0, [r0, 0x4] + cmp r0, 0 + beq _081B1338 + bl SetMainCallback2 + b _081B133E + .pool +_081B1338: + ldr r0, [r4] + bl SetMainCallback2 +_081B133E: + bl ResetSpriteData + bl sub_81B06F4 + adds r0, r5, 0 + bl DestroyTask +_081B134C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end c3_0811FAB4 + + thumb_func_start brm_get_pokemon_selection +brm_get_pokemon_selection: @ 81B1354 + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0x9] + bx lr + .pool + thumb_func_end brm_get_pokemon_selection + + thumb_func_start sub_81B1360 +sub_81B1360: @ 81B1360 + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0x8] + lsls r0, 28 + lsrs r0, 28 + bx lr + .pool + thumb_func_end sub_81B1360 + + thumb_func_start sub_81B1370 +sub_81B1370: @ 81B1370 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B13E0 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B13E0 + bl sub_81B13EC + adds r4, r0, 0 + bl sub_81B1760 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + beq _081B13C0 + cmp r0, 0x2 + bgt _081B13B0 + cmp r0, 0x1 + beq _081B13B6 + b _081B13E0 + .pool +_081B13B0: + cmp r0, 0x8 + beq _081B13CA + b _081B13E0 +_081B13B6: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81B140C + b _081B13E0 +_081B13C0: + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_81B15D0 + b _081B13E0 +_081B13CA: + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 31 + cmp r0, 0 + beq _081B13E0 + movs r0, 0x5 + bl PlaySE + bl sub_81B4F88 +_081B13E0: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B1370 + + thumb_func_start sub_81B13EC +sub_81B13EC: @ 81B13EC + push {lr} + ldr r0, =gUnknown_0203CEC8 + ldrb r1, [r0, 0xB] + cmp r1, 0x8 + beq _081B13FA + cmp r1, 0xA + bne _081B1404 +_081B13FA: + adds r0, 0xA + b _081B1406 + .pool +_081B1404: + adds r0, 0x9 +_081B1406: + pop {r1} + bx r1 + thumb_func_end sub_81B13EC + + thumb_func_start sub_81B140C +sub_81B140C: @ 81B140C + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0x6 + bne _081B142C + ldr r0, =gUnknown_0203CEC8 + ldr r1, [r0, 0x4] + adds r0, r5, 0 + bl _call_via_r1 + b _081B159E + .pool +_081B142C: + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0xB] + subs r0, 0x3 + cmp r0, 0xA + bls _081B1438 + b _081B1592 +_081B1438: + lsls r0, 2 + ldr r1, =_081B144C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081B144C: + .4byte _081B149C + .4byte _081B1592 + .4byte _081B1538 + .4byte _081B1538 + .4byte _081B1510 + .4byte _081B1560 + .4byte _081B1592 + .4byte _081B1478 + .4byte _081B156E + .4byte _081B14E8 + .4byte _081B157C +_081B1478: + adds r0, r4, 0 + bl sub_81B15A4 + lsls r0, 24 + cmp r0, 0 + bne _081B1486 + b _081B159E +_081B1486: + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + adds r0, 0xD + bl sub_81B302C + adds r0, r5, 0 + bl sub_81615A8 + b _081B159E + .pool +_081B149C: + adds r0, r4, 0 + bl sub_81B15A4 + lsls r0, 24 + cmp r0, 0 + bne _081B14AA + b _081B159E +_081B14AA: + ldr r0, =gUnknown_0203CEC8 + ldrb r1, [r0, 0x8] + movs r0, 0xF + ands r0, r1 + ldr r2, =gUnknown_0203CEC4 + cmp r0, 0x1 + bne _081B14BE + ldr r1, [r2] + ldr r0, =sub_81B9140 + str r0, [r1, 0x4] +_081B14BE: + ldr r0, [r2] + adds r0, 0xD + bl sub_81B302C + ldr r0, =gUnknown_03006328 + ldr r1, =sub_81B6794 + ldr r2, [r0] + adds r0, r5, 0 + bl _call_via_r2 + b _081B159E + .pool +_081B14E8: + adds r0, r4, 0 + bl sub_81B15A4 + lsls r0, 24 + cmp r0, 0 + beq _081B159E + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + adds r0, 0xD + bl sub_81B302C + adds r0, r5, 0 + bl sub_81B7E4C + b _081B159E + .pool +_081B1510: + adds r0, r4, 0 + bl sub_81B15A4 + lsls r0, 24 + cmp r0, 0 + beq _081B159E + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + adds r0, 0xD + bl sub_81B302C + adds r0, r5, 0 + bl sub_81B8474 + b _081B159E + .pool +_081B1538: + adds r0, r4, 0 + bl sub_81B15A4 + lsls r0, 24 + cmp r0, 0 + beq _081B159E + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + adds r0, 0xD + bl sub_81B302C + adds r0, r5, 0 + bl sub_81B7FAC + b _081B159E + .pool +_081B1560: + movs r0, 0x5 + bl PlaySE + adds r0, r5, 0 + bl sub_81B3938 + b _081B159E +_081B156E: + movs r0, 0x5 + bl PlaySE + adds r0, r5, 0 + bl sub_81B12C0 + b _081B159E +_081B157C: + adds r0, r4, 0 + bl sub_81B15A4 + lsls r0, 24 + cmp r0, 0 + beq _081B159E + ldrb r1, [r4] + adds r0, r5, 0 + bl sub_81B21AC + b _081B159E +_081B1592: + movs r0, 0x5 + bl PlaySE + adds r0, r5, 0 + bl sub_81B36FC +_081B159E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81B140C + + thumb_func_start sub_81B15A4 +sub_81B15A4: @ 81B15A4 + push {lr} + ldrb r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x2D + bl GetMonData + cmp r0, 0x1 + beq _081B15C4 + movs r0, 0x1 + b _081B15CC + .pool +_081B15C4: + movs r0, 0x20 + bl PlaySE + movs r0, 0 +_081B15CC: + pop {r1} + bx r1 + thumb_func_end sub_81B15A4 + + thumb_func_start sub_81B15D0 +sub_81B15D0: @ 81B15D0 + push {r4,r5,lr} + adds r5, r1, 0 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0xB] + cmp r0, 0x8 + beq _081B1602 + cmp r0, 0x8 + bgt _081B15F0 + cmp r0, 0x1 + beq _081B15FA + b _081B161E + .pool +_081B15F0: + cmp r0, 0xA + beq _081B1602 + cmp r0, 0xD + beq _081B1610 + b _081B161E +_081B15FA: + movs r0, 0x20 + bl PlaySE + b _081B1652 +_081B1602: + movs r0, 0x5 + bl PlaySE + adds r0, r4, 0 + bl sub_81B407C + b _081B1652 +_081B1610: + movs r0, 0x5 + bl PlaySE + adds r0, r4, 0 + bl sub_81B2210 + b _081B1652 +_081B161E: + movs r0, 0x5 + bl PlaySE + adds r0, r4, 0 + bl sub_81B1660 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B1652 + bl sub_81221AC + lsls r0, 24 + cmp r0, 0 + bne _081B1642 + ldr r1, =gSpecialVar_0x8004 + movs r0, 0x7 + strh r0, [r1] +_081B1642: + ldr r0, =gUnknown_0203CEE8 + movs r1, 0 + strb r1, [r0] + movs r0, 0x7 + strb r0, [r5] + adds r0, r4, 0 + bl sub_81B12C0 +_081B1652: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B15D0 + + thumb_func_start sub_81B1660 +sub_81B1660: @ 81B1660 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0x8] + movs r1, 0xF + ands r1, r0 + cmp r1, 0x2 + bne _081B1680 + ldr r5, =gUnknown_085EA110 + b _081B168A + .pool +_081B1680: + cmp r1, 0x4 + bne _081B168A + bl sub_81B88BC + adds r5, r0, 0 +_081B168A: + cmp r5, 0 + beq _081B16CC + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + adds r0, 0xD + bl sub_81B302C + ldr r4, =gStringVar4 + adds r0, r4, 0 + adds r1, r5, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B16D4 + str r1, [r0] + movs r0, 0x1 + b _081B16CE + .pool +_081B16CC: + movs r0, 0 +_081B16CE: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81B1660 + + thumb_func_start sub_81B16D4 +sub_81B16D4: @ 81B16D4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B16F8 + bl sub_81B334C + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B1708 + str r0, [r1] +_081B16F8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B16D4 + + thumb_func_start sub_81B1708 +sub_81B1708: @ 81B1708 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B172E + cmp r1, 0 + bgt _081B1728 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B174C + b _081B1758 +_081B1728: + cmp r1, 0x1 + beq _081B1752 + b _081B1758 +_081B172E: + ldr r0, =gUnknown_0203CEE8 + strb r1, [r0] + ldr r1, =gUnknown_0203CEC8 + movs r0, 0x7 + strb r0, [r1, 0x9] + bl sub_81B8558 + adds r0, r4, 0 + bl sub_81B12C0 + b _081B1758 + .pool +_081B174C: + movs r0, 0x5 + bl PlaySE +_081B1752: + adds r0, r4, 0 + bl sub_81B1C1C +_081B1758: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B1708 + + thumb_func_start sub_81B1760 +sub_81B1760: @ 81B1760 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =gMain + ldrh r1, [r0, 0x30] + adds r3, r0, 0 + cmp r1, 0x20 + beq _081B178E + cmp r1, 0x20 + bgt _081B177C + cmp r1, 0x10 + beq _081B1792 + b _081B1796 + .pool +_081B177C: + cmp r1, 0x40 + beq _081B1786 + cmp r1, 0x80 + beq _081B178A + b _081B1796 +_081B1786: + movs r1, 0xFF + b _081B17B2 +_081B178A: + movs r1, 0x1 + b _081B17B2 +_081B178E: + movs r1, 0xFE + b _081B17B2 +_081B1792: + movs r1, 0x2 + b _081B17B2 +_081B1796: + bl sub_812210C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B17AA + cmp r0, 0x2 + beq _081B17AE + movs r1, 0 + b _081B17B0 +_081B17AA: + movs r1, 0xFF + b _081B17B0 +_081B17AE: + movs r1, 0x1 +_081B17B0: + ldr r3, =gMain +_081B17B2: + ldrh r2, [r3, 0x2E] + movs r0, 0x8 + ands r0, r2 + cmp r0, 0 + beq _081B17C4 + movs r0, 0x8 + b _081B17F0 + .pool +_081B17C4: + lsls r0, r1, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B17D6 + adds r0, r4, 0 + bl sub_81B17F8 + movs r0, 0 + b _081B17F0 +_081B17D6: + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + beq _081B17EA + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0x7 + bne _081B17EA + movs r0, 0x2 + b _081B17F0 +_081B17EA: + ldrh r1, [r3, 0x2E] + movs r0, 0x3 + ands r0, r1 +_081B17F0: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B1760 + + thumb_func_start sub_81B17F8 +sub_81B17F8: @ 81B17F8 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldrb r4, [r5] + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0x8] + lsls r0, 26 + lsrs r0, 30 + cmp r0, 0 + bne _081B1820 + lsls r1, 24 + asrs r1, 24 + adds r0, r5, 0 + bl sub_81B1854 + b _081B182A + .pool +_081B1820: + lsls r1, 24 + asrs r1, 24 + adds r0, r5, 0 + bl sub_81B195C +_081B182A: + movs r1, 0 + ldrsb r1, [r5, r1] + lsls r4, 24 + asrs r0, r4, 24 + cmp r1, r0 + beq _081B184C + movs r0, 0x5 + bl PlaySE + lsrs r0, r4, 24 + movs r1, 0 + bl sub_81B0FCC + ldrb r0, [r5] + movs r1, 0x1 + bl sub_81B0FCC +_081B184C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81B17F8 + + thumb_func_start sub_81B1854 +sub_81B1854: @ 81B1854 + push {r4,lr} + adds r4, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B187A + cmp r1, r0 + bgt _081B1870 + subs r0, 0x1 + cmp r1, r0 + beq _081B1924 + b _081B1952 +_081B1870: + cmp r1, 0x1 + beq _081B18C0 + cmp r1, 0x2 + beq _081B18F8 + b _081B1952 +_081B187A: + ldrb r0, [r4] + movs r1, 0 + ldrsb r1, [r4, r1] + cmp r1, 0 + bne _081B1888 + movs r0, 0x7 + b _081B1950 +_081B1888: + cmp r1, 0x6 + bne _081B1898 + ldr r0, =gUnknown_020244E9 + ldrb r0, [r0] + subs r0, 0x1 + b _081B1950 + .pool +_081B1898: + cmp r1, 0x7 + bne _081B18BC + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 31 + cmp r0, 0 + beq _081B18B0 + movs r0, 0x6 + b _081B1950 + .pool +_081B18B0: + ldr r0, =gUnknown_020244E9 + ldrb r0, [r0] + subs r0, 0x1 + b _081B1950 + .pool +_081B18BC: + subs r0, 0x1 + b _081B1950 +_081B18C0: + ldrb r2, [r4] + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0x7 + beq _081B194E + movs r1, 0 + ldrsb r1, [r4, r1] + ldr r0, =gUnknown_020244E9 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + bne _081B18F4 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 31 + cmp r0, 0 + beq _081B18F0 + movs r0, 0x6 + b _081B1950 + .pool +_081B18F0: + movs r0, 0x7 + b _081B1950 +_081B18F4: + adds r0, r2, 0x1 + b _081B1950 +_081B18F8: + ldr r0, =gUnknown_020244E9 + ldrb r0, [r0] + cmp r0, 0x1 + beq _081B1952 + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0 + bne _081B1952 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 28 + lsrs r0, 29 + cmp r0, 0 + bne _081B1950 + movs r0, 0x1 + b _081B1950 + .pool +_081B1924: + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0 + beq _081B1952 + cmp r0, 0x6 + beq _081B1952 + cmp r0, 0x7 + beq _081B1952 + ldr r0, =gUnknown_0203CEC4 + ldr r3, [r0] + movs r1, 0 + ldrsb r1, [r4, r1] + movs r0, 0x7 + ands r1, r0 + lsls r1, 1 + ldrb r2, [r3, 0x8] + movs r0, 0xF + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x8] +_081B194E: + movs r0, 0 +_081B1950: + strb r0, [r4] +_081B1952: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B1854 + + thumb_func_start sub_81B195C +sub_81B195C: @ 81B195C + push {r4-r6,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r2, r1, 24 + asrs r5, r1, 24 + movs r6, 0x1 + negs r6, r6 + cmp r5, r6 + beq _081B1988 + cmp r5, r6 + bgt _081B197E + movs r0, 0x2 + negs r0, r0 + cmp r5, r0 + bne _081B197C + b _081B1A9C +_081B197C: + b _081B1AF4 +_081B197E: + cmp r5, 0x1 + beq _081B19E4 + cmp r5, 0x2 + beq _081B1A24 + b _081B1AF4 +_081B1988: + ldrb r1, [r4] + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0 + bne _081B1996 + movs r0, 0x7 + b _081B1AF2 +_081B1996: + cmp r0, 0x6 + bne _081B19A8 + ldr r0, =gUnknown_020244E9 + ldrb r0, [r0] + subs r0, 0x1 + b _081B1AF2 + .pool +_081B19A8: + cmp r0, 0x7 + bne _081B19C4 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 31 + cmp r0, 0 + beq _081B19C0 + movs r0, 0x6 + b _081B1AF2 + .pool +_081B19C0: + subs r0, r1, 0x1 + strb r0, [r4] +_081B19C4: + movs r0, 0 + ldrsb r0, [r4, r0] + lsls r1, r2, 24 + asrs r1, 24 + bl sub_81B1B00 + lsls r0, 24 + lsrs r2, r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _081B19E0 + b _081B1AF4 +_081B19E0: + strb r2, [r4] + b _081B1AF4 +_081B19E4: + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0x6 + bne _081B19F0 + movs r0, 0x7 + b _081B1AF2 +_081B19F0: + cmp r0, 0x7 + bne _081B19F8 + movs r0, 0 + b _081B1AF2 +_081B19F8: + movs r0, 0 + ldrsb r0, [r4, r0] + movs r1, 0x1 + bl sub_81B1B00 + lsls r0, 24 + lsrs r2, r0, 24 + asrs r0, 24 + cmp r0, r6 + bne _081B19E0 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 31 + cmp r0, 0 + beq _081B1A20 + movs r0, 0x6 + b _081B1AF2 + .pool +_081B1A20: + movs r0, 0x7 + b _081B1AF2 +_081B1A24: + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0 + bne _081B1A5C + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 28 + lsrs r6, r0, 29 + cmp r6, 0x3 + bne _081B1A54 + ldr r0, =gUnknown_02024618 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B1AF4 + strb r6, [r4] + b _081B1AF4 + .pool +_081B1A54: + ldr r0, =gUnknown_020245B4 + b _081B1A70 + .pool +_081B1A5C: + cmp r0, 0x1 + bne _081B1AF4 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 28 + lsrs r5, r0, 29 + cmp r5, 0x5 + bne _081B1A88 + ldr r0, =gUnknown_020246E0 +_081B1A70: + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B1AF4 + strb r5, [r4] + b _081B1AF4 + .pool +_081B1A88: + ldr r0, =gUnknown_0202467C + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B1AF4 + movs r0, 0x4 + b _081B1AF2 + .pool +_081B1A9C: + ldrb r1, [r4] + subs r0, r1, 0x2 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _081B1ACC + ldr r0, =gUnknown_0203CEC4 + ldr r3, [r0] + movs r1, 0 + ldrsb r1, [r4, r1] + movs r0, 0x7 + ands r1, r0 + lsls r1, 1 + ldrb r2, [r3, 0x8] + movs r0, 0xF + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x8] + movs r0, 0 + b _081B1AF2 + .pool +_081B1ACC: + subs r0, r1, 0x4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _081B1AF4 + ldr r0, =gUnknown_0203CEC4 + ldr r3, [r0] + movs r1, 0 + ldrsb r1, [r4, r1] + movs r0, 0x7 + ands r1, r0 + lsls r1, 1 + ldrb r2, [r3, 0x8] + movs r0, 0xF + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x8] + movs r0, 0x1 +_081B1AF2: + strb r0, [r4] +_081B1AF4: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B195C + + thumb_func_start sub_81B1B00 +sub_81B1B00: @ 81B1B00 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + asrs r6, r1, 24 +_081B1B0A: + lsls r0, r5, 24 + asrs r0, 24 + adds r0, r6 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, r5, 24 + lsrs r0, r1, 24 + cmp r0, 0x5 + bhi _081B1B38 + asrs r4, r1, 24 + movs r0, 0x64 + muls r0, r4 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B1B0A + adds r0, r4, 0 + b _081B1B3C + .pool +_081B1B38: + movs r0, 0x1 + negs r0, r0 +_081B1B3C: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81B1B00 + + thumb_func_start GetMonNickname +@ u8 *GetMonNickname(struct pokemon *mon, u8 *dest) +GetMonNickname: @ 81B1B44 + push {r4,lr} + adds r4, r1, 0 + movs r1, 0x2 + adds r2, r4, 0 + bl GetMonData + adds r0, r4, 0 + bl StringGetEnd10 + pop {r4} + pop {r1} + bx r1 + thumb_func_end GetMonNickname + + thumb_func_start sub_81B1B5C +sub_81B1B5C: @ 81B1B5C + push {r4,lr} + lsls r4, r1, 24 + lsrs r4, 24 + bl sub_81B3300 + ldr r0, =sub_81B1B8C + movs r1, 0x1 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B1B5C + + thumb_func_start sub_81B1B8C +sub_81B1B8C: @ 81B1B8C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + movs r0, 0x6 + bl sub_8121F20 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + beq _081B1BC8 + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _081B1BC2 + movs r0, 0x6 + movs r1, 0 + bl sub_8198070 + movs r0, 0x6 + bl ClearWindowTilemap +_081B1BC2: + adds r0, r5, 0 + bl DestroyTask +_081B1BC8: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B1B8C + + thumb_func_start sub_81B1BD4 +sub_81B1BD4: @ 81B1BD4 + push {lr} + ldr r0, =sub_81B1B8C + bl FuncIsActiveTask + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B1BD4 + + thumb_func_start sub_81B1BE8 +sub_81B1BE8: @ 81B1BE8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B1C0E + movs r0, 0 + bl display_pokemon_menu_message + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B1370 + str r0, [r1] +_081B1C0E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B1BE8 + + thumb_func_start sub_81B1C1C +sub_81B1C1C: @ 81B1C1C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B1C74 + movs r0, 0x6 + movs r1, 0 + bl sub_8198070 + movs r0, 0x6 + bl ClearWindowTilemap + bl sub_81221AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B1C60 + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B1BE8 + b _081B1C72 + .pool +_081B1C60: + movs r0, 0 + bl display_pokemon_menu_message + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B1370 +_081B1C72: + str r0, [r1] +_081B1C74: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B1C1C + + thumb_func_start sub_81B1C84 +sub_81B1C84: @ 81B1C84 + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 24 + lsrs r5, 24 + ldr r1, =gStringVar1 + bl GetMonNickname + ldr r1, =gStringVar2 + adds r0, r4, 0 + bl CopyItemName + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E991B + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B1C84 + + thumb_func_start sub_81B1CD0 +sub_81B1CD0: @ 81B1CD0 + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 24 + lsrs r5, 24 + ldr r1, =gStringVar1 + bl GetMonNickname + ldr r1, =gStringVar2 + adds r0, r4, 0 + bl CopyItemName + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E999D + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B1CD0 + + thumb_func_start sub_81B1D1C +sub_81B1D1C: @ 81B1D1C + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 24 + lsrs r5, 24 + ldr r1, =gStringVar1 + bl GetMonNickname + ldr r1, =gStringVar2 + adds r0, r4, 0 + bl CopyItemName + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E993A + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B1D1C + + thumb_func_start sub_81B1D68 +sub_81B1D68: @ 81B1D68 + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + lsls r0, 16 + lsrs r0, 16 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 24 + lsrs r5, 24 + ldr r1, =gStringVar1 + bl CopyItemName + ldr r1, =gStringVar2 + adds r0, r4, 0 + bl CopyItemName + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E99DB + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B1D68 + + thumb_func_start sub_81B1DB8 +sub_81B1DB8: @ 81B1DB8 + push {r4-r7,lr} + sub sp, 0x4 + adds r6, r0, 0 + lsls r5, r1, 16 + lsrs r4, r5, 16 + adds r7, r4, 0 + adds r0, r4, 0 + bl itemid_is_mail + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B1DE2 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80D4420 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _081B1DF6 +_081B1DE2: + mov r0, sp + strb r7, [r0] + mov r1, sp + lsrs r0, r5, 24 + strb r0, [r1, 0x1] + adds r0, r6, 0 + movs r1, 0xC + mov r2, sp + bl SetMonData +_081B1DF6: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B1DB8 + + thumb_func_start sub_81B1E00 +sub_81B1E00: @ 81B1E00 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + mov r1, sp + strh r0, [r1] + cmp r0, 0 + bne _081B1E1C + movs r0, 0 + b _081B1E3E +_081B1E1C: + movs r1, 0x1 + bl AddBagItem + lsls r0, 24 + cmp r0, 0 + beq _081B1E3C + movs r1, 0 + mov r0, sp + strh r1, [r0] + adds r0, r4, 0 + movs r1, 0xC + mov r2, sp + bl SetMonData + movs r0, 0x2 + b _081B1E3E +_081B1E3C: + movs r0, 0x1 +_081B1E3E: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B1E00 + + thumb_func_start pokemon_item_not_removed +pokemon_item_not_removed: @ 81B1E48 + push {lr} + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9A69 + bl StringExpandPlaceholders + pop {r0} + bx r0 + .pool + thumb_func_end pokemon_item_not_removed + + thumb_func_start sub_81B1E60 +sub_81B1E60: @ 81B1E60 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r0, 2 + add r0, r8 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r7, r0, r1 + ldrh r0, [r7, 0x4] + ldrh r1, [r7] + adds r0, r1 + strh r0, [r7] + ldrh r0, [r7, 0x6] + subs r0, 0x1 + strh r0, [r7, 0x6] + movs r2, 0x8 + ldrsh r0, [r7, r2] + movs r5, 0x64 + muls r0, r5 + ldr r4, =gPlayerParty + adds r0, r4 + movs r1, 0x39 + adds r2, r7, 0 + bl SetMonData + movs r3, 0x8 + ldrsh r2, [r7, r3] + adds r0, r2, 0 + muls r0, r5 + adds r0, r4 + ldr r6, =gUnknown_0203CEDC + lsls r2, 4 + ldr r1, [r6] + adds r1, r2 + movs r2, 0x1 + bl sub_81B2CD4 + movs r0, 0x8 + ldrsh r2, [r7, r0] + adds r0, r2, 0 + muls r0, r5 + adds r0, r4 + lsls r2, 4 + ldr r1, [r6] + adds r1, r2 + bl sub_81B2E28 + movs r1, 0x6 + ldrsh r0, [r7, r1] + cmp r0, 0 + beq _081B1EDC + movs r2, 0 + ldrsh r1, [r7, r2] + cmp r1, 0 + beq _081B1EDC + movs r3, 0x2 + ldrsh r0, [r7, r3] + cmp r1, r0 + bne _081B1EFE +_081B1EDC: + movs r0, 0 + ldrsh r1, [r7, r0] + movs r2, 0xA + ldrsh r0, [r7, r2] + cmp r1, r0 + ble _081B1EF8 + ldr r0, =gStringVar2 + movs r3, 0xA + ldrsh r2, [r7, r3] + subs r1, r2 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN +_081B1EF8: + mov r0, r8 + bl SwitchTaskToFollowupFunc +_081B1EFE: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B1E60 + + thumb_func_start sub_81B1F18 +sub_81B1F18: @ 81B1F18 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r8, r0 + mov r9, r1 + adds r5, r2, 0 + mov r10, r3 + ldr r7, [sp, 0x20] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + mov r0, r9 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r5, 24 + lsrs r5, 24 + mov r0, r10 + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + movs r0, 0x64 + mov r6, r9 + muls r6, r0 + ldr r0, =gPlayerParty + adds r6, r0 + mov r0, r8 + lsls r4, r0, 2 + add r4, r8 + lsls r4, 3 + ldr r0, =gTasks + 0x8 + adds r4, r0 + adds r0, r6, 0 + movs r1, 0x39 + bl GetMonData + strh r0, [r4] + adds r0, r6, 0 + movs r1, 0x3A + bl GetMonData + strh r0, [r4, 0x2] + lsls r5, 24 + asrs r5, 24 + strh r5, [r4, 0x4] + mov r0, r10 + strh r0, [r4, 0x6] + mov r0, r9 + strh r0, [r4, 0x8] + ldrh r0, [r4] + strh r0, [r4, 0xA] + ldr r1, =sub_81B1E60 + mov r0, r8 + adds r2, r7, 0 + bl SetTaskFuncWithFollowupFunc + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B1F18 + + thumb_func_start sub_81B1FA8 +sub_81B1FA8: @ 81B1FA8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r3, r0, r1 + cmp r5, 0x5 + bhi _081B200A + lsls r0, r5, 2 + ldr r1, =_081B1FD4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081B1FD4: + .4byte _081B1FEC + .4byte _081B1FF2 + .4byte _081B1FF6 + .4byte _081B1FFA + .4byte _081B1FFE + .4byte _081B2002 +_081B1FEC: + strh r2, [r3] + strh r2, [r3, 0xA] + b _081B200A +_081B1FF2: + strh r2, [r3, 0x2] + b _081B200A +_081B1FF6: + strh r2, [r3, 0x4] + b _081B200A +_081B1FFA: + strh r2, [r3, 0x6] + b _081B200A +_081B1FFE: + strh r2, [r3, 0x8] + b _081B200A +_081B2002: + ldr r1, =sub_81B1E60 + adds r0, r4, 0 + bl SetTaskFuncWithFollowupFunc +_081B200A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B1FA8 + + thumb_func_start pokemon_ailments_get_primary +pokemon_ailments_get_primary: @ 81B2014 + push {lr} + adds r1, r0, 0 + movs r0, 0x88 + ands r0, r1 + cmp r0, 0 + beq _081B2024 + movs r0, 0x1 + b _081B2056 +_081B2024: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081B2030 + movs r0, 0x2 + b _081B2056 +_081B2030: + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + beq _081B203C + movs r0, 0x3 + b _081B2056 +_081B203C: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _081B2048 + movs r0, 0x4 + b _081B2056 +_081B2048: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _081B2054 + movs r0, 0 + b _081B2056 +_081B2054: + movs r0, 0x5 +_081B2056: + pop {r1} + bx r1 + 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 + movs r1, 0x39 + bl GetMonData + cmp r0, 0 + bne _081B206E + movs r0, 0x7 + b _081B2096 +_081B206E: + adds r0, r4, 0 + movs r1, 0x37 + bl GetMonData + bl pokemon_ailments_get_primary + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _081B2096 + adds r0, r4, 0 + movs r1, 0 + bl sub_806DD7C + lsls r0, 24 + cmp r0, 0 + bne _081B2094 + movs r0, 0 + b _081B2096 +_081B2094: + movs r0, 0x6 +_081B2096: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B205C + + thumb_func_start sub_81B209C +sub_81B209C: @ 81B209C + push {r4,r5,lr} + ldr r2, =gUnknown_0203CEC8 + ldrb r1, [r2, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0xB + bne _081B2126 + adds r5, r2, 0 + adds r5, 0xE + movs r0, 0 + strh r0, [r2, 0xE] + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0 + bne _081B20FC + movs r4, 0 + ldr r0, =gUnknown_020244E9 + ldrb r0, [r0] + cmp r4, r0 + bcs _081B2126 +_081B20C4: + movs r0, 0x64 + muls r0, r4 + ldr r1, =gPlayerParty + adds r0, r1 + bl sub_81B2134 + lsls r0, 16 + lsrs r0, 16 + lsls r0, r4 + ldrh r1, [r5] + adds r0, r1 + strh r0, [r5] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gUnknown_020244E9 + ldrb r0, [r0] + cmp r4, r0 + bcc _081B20C4 + b _081B2126 + .pool +_081B20FC: + movs r4, 0 + b _081B211E +_081B2100: + movs r0, 0x64 + muls r0, r4 + ldr r1, =gPlayerParty + adds r0, r1 + bl sub_81B2164 + lsls r0, 16 + lsrs r0, 16 + lsls r0, r4 + ldrh r1, [r5] + adds r0, r1 + strh r0, [r5] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081B211E: + ldr r0, =gUnknown_020244E9 + ldrb r0, [r0] + cmp r4, r0 + bcc _081B2100 +_081B2126: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B209C + + thumb_func_start sub_81B2134 +sub_81B2134: @ 81B2134 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2D + bl GetMonData + cmp r0, 0x1 + beq _081B215A + adds r0, r4, 0 + movs r1, 0xB + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + bl sub_802C908 + cmp r0, 0 + beq _081B215A + movs r0, 0x1 + b _081B215C +_081B215A: + movs r0, 0 +_081B215C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B2134 + + thumb_func_start sub_81B2164 +sub_81B2164: @ 81B2164 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2D + bl GetMonData + cmp r0, 0x1 + beq _081B2182 + adds r0, r4, 0 + movs r1, 0xB + bl GetMonData + cmp r0, 0x55 + bne _081B2182 + movs r0, 0x1 + b _081B2184 +_081B2182: + movs r0, 0 +_081B2184: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B2164 + + thumb_func_start sub_81B218C +sub_81B218C: @ 81B218C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0203CEC8 + movs r2, 0xE + ldrsh r1, [r1, r2] + asrs r1, r0 + movs r0, 0x1 + ands r1, r0 + cmp r1, 0 + bne _081B21A4 + movs r0, 0 +_081B21A4: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B218C + + thumb_func_start sub_81B21AC +sub_81B21AC: @ 81B21AC + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + adds r0, r5, 0 + bl sub_81B218C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B21DC + movs r0, 0x5 + bl PlaySE + ldr r0, =gSpecialVar_0x8004 + strh r5, [r0] + adds r0, r4, 0 + bl sub_81B12C0 + b _081B21FE + .pool +_081B21DC: + movs r0, 0x20 + bl PlaySE + ldr r0, =gUnknown_085EA0EE + movs r1, 0 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1C1C + str r1, [r0] +_081B21FE: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B21AC + + thumb_func_start sub_81B2210 +sub_81B2210: @ 81B2210 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_085EA110 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B2248 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B2210 + + thumb_func_start sub_81B2248 +sub_81B2248: @ 81B2248 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B226C + bl sub_81B334C + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B227C + str r0, [r1] +_081B226C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B2248 + + thumb_func_start sub_81B227C +sub_81B227C: @ 81B227C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B22A2 + cmp r1, 0 + bgt _081B229C + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B22B4 + b _081B22C8 +_081B229C: + cmp r1, 0x1 + beq _081B22BA + b _081B22C8 +_081B22A2: + ldr r1, =gSpecialVar_0x8004 + movs r0, 0x7 + strh r0, [r1] + adds r0, r4, 0 + bl sub_81B12C0 + b _081B22C8 + .pool +_081B22B4: + movs r0, 0x5 + bl PlaySE +_081B22BA: + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B1C1C + str r0, [r1] +_081B22C8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B227C + + thumb_func_start sub_81B22D8 +sub_81B22D8: @ 81B22D8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + lsls r1, 16 + lsrs r4, r1, 16 + adds r7, r4, 0 + lsls r2, 24 + lsrs r6, r2, 24 + mov r8, r6 + movs r1, 0x2D + bl GetMonData + cmp r0, 0 + beq _081B22FA + movs r0, 0x3 + b _081B2356 +_081B22FA: + movs r0, 0x90 + lsls r0, 1 + cmp r4, r0 + bls _081B231C + adds r1, r4, 0 + subs r1, 0x21 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl sub_806E00C + cmp r0, 0 + beq _081B2334 + adds r0, r7, 0 + bl ItemIdToBattleMoveId + b _081B233E +_081B231C: + adds r0, r5, 0 + movs r1, 0xB + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl sub_81B2370 + lsls r0, 24 + cmp r0, 0 + bne _081B2338 +_081B2334: + movs r0, 0x1 + b _081B2356 +_081B2338: + mov r0, r8 + bl sub_81B2360 +_081B233E: + lsls r0, 16 + lsrs r1, r0, 16 + adds r0, r5, 0 + bl pokemon_has_move + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B2354 + movs r0, 0 + b _081B2356 +_081B2354: + movs r0, 0x2 +_081B2356: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81B22D8 + + thumb_func_start sub_81B2360 +sub_81B2360: @ 81B2360 + lsls r0, 24 + ldr r1, =gUnknown_0861500C + lsrs r0, 23 + adds r0, r1 + ldrh r0, [r0] + bx lr + .pool + thumb_func_end sub_81B2360 + + thumb_func_start sub_81B2370 +sub_81B2370: @ 81B2370 + push {lr} + lsls r0, 16 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gUnknown_08615048 + lsrs r0, 14 + adds r0, r2 + movs r2, 0x1 + lsls r2, r1 + ldr r0, [r0] + ands r0, r2 + cmp r0, 0 + bne _081B2394 + movs r0, 0 + b _081B2396 + .pool +_081B2394: + movs r0, 0x1 +_081B2396: + pop {r1} + bx r1 + thumb_func_end sub_81B2370 + + thumb_func_start sub_81B239C +sub_81B239C: @ 81B239C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x1 + beq _081B23C4 + cmp r0, 0x1 + bgt _081B23B2 + cmp r0, 0 + beq _081B23B8 + b _081B23DC +_081B23B2: + cmp r1, 0x2 + beq _081B23D0 + b _081B23DC +_081B23B8: + ldr r0, =gUnknown_08615810 + bl InitWindows + b _081B23E2 + .pool +_081B23C4: + ldr r0, =gUnknown_08615850 + bl InitWindows + b _081B23E2 + .pool +_081B23D0: + ldr r0, =gUnknown_08615890 + bl InitWindows + b _081B23E2 + .pool +_081B23DC: + ldr r0, =gUnknown_086158D0 + bl InitWindows +_081B23E2: + bl DeactivateAllTextPrinters + movs r4, 0 +_081B23E8: + adds r0, r4, 0 + movs r1, 0 + bl FillWindowPixelBuffer + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _081B23E8 + movs r0, 0 + movs r1, 0x4F + movs r2, 0xD0 + bl sub_809882C + bl sub_8098C64 + movs r1, 0xE0 + movs r2, 0x20 + bl LoadPalette + ldr r0, =gUnknown_0860F074 + movs r1, 0xF0 + movs r2, 0x20 + bl LoadPalette + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B239C + + thumb_func_start sub_81B2428 +sub_81B2428: @ 81B2428 + push {r4-r6,lr} + sub sp, 0x14 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =gUnknown_0203CEC8 + ldrb r1, [r0, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x5 + bne _081B243E + b _081B2554 +_081B243E: + cmp r2, 0x1 + bne _081B24B4 + ldr r0, =gUnknown_08615918 + bl AddWindow + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r5, =gUnknown_085E8CE3 + movs r0, 0 + adds r1, r5, 0 + movs r2, 0x30 + bl GetStringCenterAlignXOffset + lsls r0, 24 + lsrs r2, r0, 24 + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + ldr r0, =gUnknown_086157FC + str r0, [sp, 0x8] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0xC] + str r5, [sp, 0x10] + adds r0, r4, 0 + movs r1, 0 + movs r3, 0x1 + bl AddTextPrinterParametrized2 + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x2 + bl CopyWindowToVram + ldr r0, =gUnknown_08615910 + bl AddWindow + lsls r0, 24 + lsrs r5, r0, 24 + movs r6, 0 + b _081B24C0 + .pool +_081B24B4: + ldr r0, =gUnknown_08615908 + bl AddWindow + lsls r0, 24 + lsrs r5, r0, 24 + movs r6, 0x3 +_081B24C0: + adds r0, r5, 0 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r0, =gUnknown_0203CEC8 + ldrb r1, [r0, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0xA + beq _081B2514 + ldr r4, =gUnknown_085E8CF0 + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x30 + bl GetStringCenterAlignXOffset + lsls r0, 24 + lsrs r2, r0, 24 + adds r2, r6 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =gUnknown_086157FC + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + adds r0, r5, 0 + movs r1, 0 + movs r3, 0x1 + bl box_print + b _081B2540 + .pool +_081B2514: + ldr r4, =gUnknown_085E8CF7 + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x30 + bl GetStringCenterAlignXOffset + lsls r0, 24 + lsrs r2, r0, 24 + adds r2, r6 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =gUnknown_086157FC + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + adds r0, r5, 0 + movs r1, 0 + movs r3, 0x1 + bl box_print +_081B2540: + adds r0, r5, 0 + bl PutWindowTilemap + adds r0, r5, 0 + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram +_081B2554: + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B2428 + + thumb_func_start sub_81B2564 +sub_81B2564: @ 81B2564 + lsls r0, 24 + ldr r1, =gUnknown_0203CEC4 + lsrs r0, 23 + adds r0, 0x18 + ldr r1, [r1] + adds r1, r0 + adds r0, r1, 0 + bx lr + .pool + thumb_func_end sub_81B2564 + + thumb_func_start sub_81B2578 +sub_81B2578: @ 81B2578 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x2C + str r1, [sp, 0xC] + ldr r1, [sp, 0x4C] + ldr r4, [sp, 0x50] + ldr r5, [sp, 0x54] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x8] + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x10] + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x14] + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x18] + lsls r4, 24 + lsrs r6, r4, 24 + lsls r5, 24 + lsrs r5, 24 + mov r10, r5 + mov r0, r10 + muls r0, r6 + lsls r0, 5 + bl AllocZeroed + mov r9, r0 + cmp r0, 0 + beq _081B2646 + movs r5, 0 + ldr r0, [sp, 0x14] + lsls r0, 19 + str r0, [sp, 0x1C] + ldr r1, [sp, 0x18] + lsls r1, 19 + str r1, [sp, 0x20] + lsls r2, r6, 19 + str r2, [sp, 0x24] + mov r0, r10 + lsls r0, 19 + str r0, [sp, 0x28] + cmp r5, r10 + bcs _081B2624 +_081B25DA: + movs r4, 0 + adds r1, r5, 0x1 + mov r8, r1 + cmp r4, r6 + bcs _081B261A + ldr r2, [sp, 0x18] + adds r0, r2, r5 + ldr r2, [sp, 0x10] + adds r1, r0, 0 + muls r1, r2 + adds r7, r1, 0 +_081B25F0: + ldr r1, [sp, 0x14] + adds r0, r1, r4 + adds r0, r7 + ldr r2, [sp, 0xC] + adds r0, r2, r0 + ldrb r0, [r0] + bl sub_81B0DD4 + adds r1, r5, 0 + muls r1, r6 + adds r1, r4 + lsls r1, 5 + add r1, r9 + movs r2, 0x10 + bl CpuSet + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r6 + bcc _081B25F0 +_081B261A: + mov r1, r8 + lsls r0, r1, 24 + lsrs r5, r0, 24 + cmp r5, r10 + bcc _081B25DA +_081B2624: + ldr r0, [sp, 0x1C] + lsrs r2, r0, 16 + ldr r1, [sp, 0x20] + lsrs r3, r1, 16 + ldr r1, [sp, 0x24] + lsrs r0, r1, 16 + str r0, [sp] + ldr r1, [sp, 0x28] + lsrs r0, r1, 16 + str r0, [sp, 0x4] + ldr r0, [sp, 0x8] + mov r1, r9 + bl BlitBitmapToWindow + mov r0, r9 + bl Free +_081B2646: + add sp, 0x2C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B2578 + + thumb_func_start sub_81B2658 +sub_81B2658: @ 81B2658 + push {r4-r6,lr} + sub sp, 0xC + ldr r4, [sp, 0x1C] + ldr r5, [sp, 0x20] + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + cmp r3, 0 + bne _081B2684 + cmp r4, 0 + bne _081B2684 + movs r3, 0xA + movs r4, 0x7 +_081B2684: + cmp r5, 0 + bne _081B26A0 + ldr r1, =gUnknown_08615988 + str r2, [sp] + str r3, [sp, 0x4] + str r4, [sp, 0x8] + movs r2, 0xA + adds r3, r6, 0 + bl sub_81B2578 + b _081B26B0 + .pool +_081B26A0: + ldr r1, =gUnknown_086159CE + str r2, [sp] + str r3, [sp, 0x4] + str r4, [sp, 0x8] + movs r2, 0xA + adds r3, r6, 0 + bl sub_81B2578 +_081B26B0: + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B2658 + + thumb_func_start sub_81B26BC +sub_81B26BC: @ 81B26BC + push {r4-r6,lr} + sub sp, 0xC + ldr r4, [sp, 0x1C] + ldr r5, [sp, 0x20] + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + cmp r3, 0 + bne _081B26E8 + cmp r4, 0 + bne _081B26E8 + movs r3, 0x12 + movs r4, 0x3 +_081B26E8: + cmp r5, 0 + bne _081B2704 + ldr r1, =gUnknown_08615A14 + str r2, [sp] + str r3, [sp, 0x4] + str r4, [sp, 0x8] + movs r2, 0x12 + adds r3, r6, 0 + bl sub_81B2578 + b _081B2714 + .pool +_081B2704: + ldr r1, =gUnknown_08615A4A + str r2, [sp] + str r3, [sp, 0x4] + str r4, [sp, 0x8] + movs r2, 0x12 + adds r3, r6, 0 + bl sub_81B2578 +_081B2714: + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B26BC + + thumb_func_start sub_81B2720 +sub_81B2720: @ 81B2720 + push {lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_08615A80 + movs r2, 0 + str r2, [sp] + movs r2, 0x12 + str r2, [sp, 0x4] + movs r2, 0x3 + str r2, [sp, 0x8] + movs r2, 0x12 + movs r3, 0 + bl sub_81B2578 + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B2720 + + thumb_func_start sub_81B2748 +sub_81B2748: @ 81B2748 + push {r4-r7,lr} + lsls r1, 24 + lsrs r4, r1, 24 + adds r5, r4, 0 + ldrb r0, [r0, 0x8] + movs r1, 0x5 + bl GetWindowAttribute + lsls r0, 28 + lsrs r6, r0, 24 + adds r7, r6, 0 + movs r0, 0x40 + ands r0, r4 + cmp r0, 0 + beq _081B277C + ldr r5, =gUnknown_08615AF1 + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615AC0 + b _081B297E + .pool +_081B277C: + movs r0, 0x20 + ands r0, r4 + cmp r0, 0 + beq _081B27D8 + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _081B2794 + ldr r5, =gUnknown_08615ADF + b _081B2942 + .pool +_081B2794: + ldr r5, =gUnknown_08615ADF + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615ABA + ldrb r1, [r4] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldr r5, =gUnknown_08615AEE + b _081B2976 + .pool +_081B27D8: + movs r0, 0x10 + ands r0, r4 + cmp r0, 0 + beq _081B2824 + ldr r5, =gUnknown_08615ADF + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615ABA + ldrb r1, [r4] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldr r5, =gUnknown_08615AEE + b _081B2976 + .pool +_081B2824: + movs r0, 0x4 + ands r0, r4 + cmp r0, 0 + beq _081B2880 + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _081B283C + ldr r5, =gUnknown_08615ADF + b _081B2942 + .pool +_081B283C: + ldr r5, =gUnknown_08615ADF + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615ABA + ldrb r1, [r4] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldr r5, =gUnknown_08615AEE + b _081B2976 + .pool +_081B2880: + movs r0, 0x2 + ands r0, r4 + cmp r0, 0 + beq _081B28DC + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _081B2898 + ldr r5, =gUnknown_08615ADC + b _081B2942 + .pool +_081B2898: + ldr r5, =gUnknown_08615AD3 + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615ABA + ldrb r1, [r4] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldr r5, =gUnknown_08615AE8 + b _081B2976 + .pool +_081B28DC: + movs r0, 0x8 + ands r0, r4 + cmp r0, 0 + beq _081B2938 + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _081B28F4 + ldr r5, =gUnknown_08615AD9 + b _081B2942 + .pool +_081B28F4: + ldr r5, =gUnknown_08615AD0 + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615ABA + ldrb r1, [r4] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldr r5, =gUnknown_08615AE5 + b _081B2976 + .pool +_081B2938: + movs r0, 0x1 + ands r5, r0 + cmp r5, 0 + beq _081B29BC + ldr r5, =gUnknown_08615AD6 +_081B2942: + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615ABA + ldrb r1, [r4] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldr r5, =gUnknown_08615AEB +_081B2976: + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615ABD +_081B297E: + ldrb r1, [r4] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + b _081B2A24 + .pool +_081B29BC: + ldr r5, =gUnknown_08615ACD + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615ABA + ldrb r1, [r4] + adds r1, r7 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r7 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r7 + movs r2, 0x2 + bl LoadPalette + ldr r5, =gUnknown_08615AE2 + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615ABD + ldrb r1, [r4] + adds r1, r7 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r7 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r7 + movs r2, 0x2 + bl LoadPalette +_081B2A24: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B2748 + + thumb_func_start sub_81B2A3C +sub_81B2A3C: @ 81B2A3C + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + lsls r2, 24 + lsrs r2, 24 + ldrb r5, [r3] + ldrb r3, [r3, 0x1] + lsls r4, r2, 1 + adds r4, r2 + ldr r2, =gUnknown_086157FC + adds r4, r2 + str r4, [sp] + movs r2, 0 + str r2, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0 + adds r2, r5, 0 + bl box_print + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B2A3C + + thumb_func_start sub_81B2A70 +sub_81B2A70: @ 81B2A70 + push {r4-r7,lr} + sub sp, 0x14 + adds r7, r0, 0 + adds r6, r1, 0 + lsls r2, 24 + lsrs r4, r2, 24 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B2AC0 + cmp r4, 0x1 + bne _081B2AAA + ldr r5, [r6] + ldrb r0, [r6, 0x8] + ldrb r1, [r5, 0x4] + lsrs r1, 3 + ldrb r2, [r5, 0x5] + lsrs r2, 3 + ldrb r3, [r5, 0x6] + lsrs r3, 3 + ldrb r4, [r5, 0x7] + lsrs r4, 3 + str r4, [sp] + movs r4, 0 + str r4, [sp, 0x4] + ldr r4, [r5] + bl _call_via_r4 +_081B2AAA: + adds r0, r7, 0 + add r1, sp, 0x8 + bl GetMonNickname + ldrb r0, [r6, 0x8] + ldr r3, [r6] + adds r3, 0x4 + add r1, sp, 0x8 + movs r2, 0 + bl sub_81B2A3C +_081B2AC0: + add sp, 0x14 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B2A70 + + thumb_func_start sub_81B2AC8 +sub_81B2AC8: @ 81B2AC8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r6, r0, 0 + adds r7, r1, 0 + lsls r2, 24 + lsrs r4, r2, 24 + mov r8, r4 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B2B34 + adds r0, r6, 0 + bl sub_81B205C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _081B2AF6 + cmp r0, 0x6 + bne _081B2B34 +_081B2AF6: + cmp r4, 0 + beq _081B2B1C + ldr r5, [r7] + ldrb r0, [r7, 0x8] + ldrb r1, [r5, 0x8] + lsrs r1, 3 + ldrb r2, [r5, 0x9] + lsrs r2, 3 + adds r2, 0x1 + ldrb r3, [r5, 0xA] + lsrs r3, 3 + ldrb r4, [r5, 0xB] + lsrs r4, 3 + str r4, [sp] + movs r4, 0 + str r4, [sp, 0x4] + ldr r4, [r5] + bl _call_via_r4 +_081B2B1C: + mov r0, r8 + cmp r0, 0x2 + beq _081B2B34 + adds r0, r6, 0 + movs r1, 0x38 + bl GetMonData + lsls r0, 24 + lsrs r0, 24 + adds r1, r7, 0 + bl sub_81B2B40 +_081B2B34: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B2AC8 + + thumb_func_start sub_81B2B40 +sub_81B2B40: @ 81B2B40 + push {r4-r6,lr} + adds r2, r0, 0 + adds r6, r1, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r5, =gStringVar2 + adds r0, r5, 0 + adds r1, r2, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar1 + ldr r1, =gUnknown_085E8D4D + adds r0, r4, 0 + bl StringCopy + adds r0, r4, 0 + adds r1, r5, 0 + bl StringAppend + ldrb r0, [r6, 0x8] + ldr r3, [r6] + adds r3, 0x8 + adds r1, r4, 0 + movs r2, 0 + bl sub_81B2A3C + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B2B40 + + thumb_func_start sub_81B2B8C +sub_81B2B8C: @ 81B2B8C + push {r4-r7,lr} + sub sp, 0x14 + adds r6, r0, 0 + adds r7, r1, 0 + lsls r2, 24 + lsrs r2, 24 + cmp r2, 0x1 + bne _081B2BBE + ldr r5, [r7] + ldrb r0, [r7, 0x8] + ldrb r1, [r5, 0xC] + lsrs r1, 3 + ldrb r2, [r5, 0xD] + lsrs r2, 3 + adds r2, 0x1 + ldrb r3, [r5, 0xE] + lsrs r3, 3 + ldrb r4, [r5, 0xF] + lsrs r4, 3 + str r4, [sp] + movs r4, 0 + str r4, [sp, 0x4] + ldr r4, [r5] + bl _call_via_r4 +_081B2BBE: + adds r0, r6, 0 + add r1, sp, 0x8 + bl GetMonNickname + adds r0, r6, 0 + bl pokemon_get_gender + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r6, 0 + movs r1, 0xB + bl GetMonData + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + add r2, sp, 0x8 + adds r3, r7, 0 + bl sub_81B2BF4 + add sp, 0x14 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B2B8C + + thumb_func_start sub_81B2BF4 +sub_81B2BF4: @ 81B2BF4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r9, r2 + adds r7, r3, 0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 16 + lsrs r4, r1, 16 + adds r5, r4, 0 + ldrb r0, [r7, 0x8] + movs r1, 0x5 + bl GetWindowAttribute + lsls r0, 28 + lsrs r6, r0, 24 + cmp r4, 0 + beq _081B2CBA + cmp r4, 0x20 + beq _081B2C24 + cmp r4, 0x1D + bne _081B2C38 +_081B2C24: + movs r0, 0xB + adds r1, r5, 0 + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + mov r0, r9 + bl StringCompare + cmp r0, 0 + beq _081B2CBA +_081B2C38: + mov r0, r8 + cmp r0, 0 + beq _081B2C48 + cmp r0, 0xFE + beq _081B2C88 + b _081B2CBA + .pool +_081B2C48: + ldr r5, =gUnknown_08615AC3 + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615AB6 + ldrb r1, [r4] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r7, 0x8] + ldr r1, =gUnknown_085E8D49 + ldr r3, [r7] + adds r3, 0xC + movs r2, 0x2 + bl sub_81B2A3C + b _081B2CBA + .pool +_081B2C88: + ldr r5, =gUnknown_08615AC5 + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615AB6 + ldrb r1, [r4] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r7, 0x8] + ldr r1, =gUnknown_085E8D4B + ldr r3, [r7] + adds r3, 0xC + movs r2, 0x2 + bl sub_81B2A3C +_081B2CBA: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B2BF4 + + thumb_func_start sub_81B2CD4 +sub_81B2CD4: @ 81B2CD4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r7, r0, 0 + adds r6, r1, 0 + lsls r2, 24 + lsrs r4, r2, 24 + mov r8, r4 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B2D2E + cmp r4, 0 + beq _081B2D16 + ldr r5, [r6] + ldrb r0, [r6, 0x8] + ldrb r1, [r5, 0x10] + lsrs r1, 3 + ldrb r2, [r5, 0x11] + lsrs r2, 3 + adds r2, 0x1 + ldrb r3, [r5, 0x12] + lsrs r3, 3 + ldrb r4, [r5, 0x13] + lsrs r4, 3 + str r4, [sp] + movs r4, 0 + str r4, [sp, 0x4] + ldr r4, [r5] + bl _call_via_r4 +_081B2D16: + mov r0, r8 + cmp r0, 0x2 + beq _081B2D2E + adds r0, r7, 0 + movs r1, 0x39 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl sub_81B2D3C +_081B2D2E: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B2CD4 + + thumb_func_start sub_81B2D3C +sub_81B2D3C: @ 81B2D3C + push {r4,r5,lr} + adds r2, r0, 0 + adds r4, r1, 0 + lsls r2, 16 + lsrs r2, 16 + ldr r5, =gStringVar1 + adds r0, r5, 0 + adds r1, r2, 0 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + movs r1, 0xBA + strb r1, [r0] + movs r1, 0xFF + strb r1, [r0, 0x1] + ldrb r0, [r4, 0x8] + ldr r3, [r4] + adds r3, 0x10 + adds r1, r5, 0 + movs r2, 0 + bl sub_81B2A3C + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B2D3C + + thumb_func_start sub_81B2D74 +sub_81B2D74: @ 81B2D74 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r7, r0, 0 + adds r6, r1, 0 + lsls r2, 24 + lsrs r4, r2, 24 + mov r8, r4 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B2DD0 + cmp r4, 0 + beq _081B2DB8 + ldr r5, [r6] + ldrb r0, [r6, 0x8] + ldrb r1, [r5, 0x14] + lsrs r1, 3 + adds r1, 0x1 + ldrb r2, [r5, 0x15] + lsrs r2, 3 + adds r2, 0x1 + ldrb r3, [r5, 0x16] + lsrs r3, 3 + ldrb r4, [r5, 0x17] + lsrs r4, 3 + str r4, [sp] + movs r4, 0 + str r4, [sp, 0x4] + ldr r4, [r5] + bl _call_via_r4 +_081B2DB8: + mov r0, r8 + cmp r0, 0x2 + beq _081B2DD0 + adds r0, r7, 0 + movs r1, 0x3A + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl sub_81B2DDC +_081B2DD0: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B2D74 + + thumb_func_start sub_81B2DDC +sub_81B2DDC: @ 81B2DDC + push {r4-r6,lr} + adds r2, r0, 0 + adds r6, r1, 0 + lsls r2, 16 + lsrs r2, 16 + ldr r5, =gStringVar2 + adds r0, r5, 0 + adds r1, r2, 0 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar1 + ldr r1, =gUnknown_085E8D3E + adds r0, r4, 0 + bl StringCopy + adds r0, r4, 0 + adds r1, r5, 0 + bl StringAppend + ldrb r0, [r6, 0x8] + ldr r3, [r6] + adds r3, 0x14 + adds r1, r4, 0 + movs r2, 0 + bl sub_81B2A3C + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B2DDC + + thumb_func_start sub_81B2E28 +sub_81B2E28: @ 81B2E28 + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B2E5C + adds r0, r5, 0 + movs r1, 0x39 + bl GetMonData + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0x3A + bl GetMonData + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + adds r2, r6, 0 + bl sub_81B2E64 +_081B2E5C: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81B2E28 + + thumb_func_start sub_81B2E64 +sub_81B2E64: @ 81B2E64 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + adds r6, r2, 0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + ldrb r0, [r6, 0x8] + movs r1, 0x5 + bl GetWindowAttribute + lsls r0, 28 + lsrs r7, r0, 24 + mov r1, r8 + lsls r0, r1, 16 + asrs r0, 16 + mov r2, r9 + lsls r1, r2, 16 + asrs r1, 16 + bl sub_8075060 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _081B2EB0 + cmp r0, 0x2 + blt _081B2EE0 + cmp r0, 0x4 + bgt _081B2EE0 + ldr r5, =gUnknown_08615AC7 + b _081B2EB2 + .pool +_081B2EB0: + ldr r5, =gUnknown_08615AC9 +_081B2EB2: + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615AB8 + ldrb r1, [r4] + adds r1, r7 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r7 + movs r2, 0x2 + bl LoadPalette + b _081B2F04 + .pool +_081B2EE0: + ldr r5, =gUnknown_08615ACB + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615AB8 + ldrb r1, [r4] + adds r1, r7 + movs r2, 0x2 + bl LoadPalette + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r7 + movs r2, 0x2 + bl LoadPalette +_081B2F04: + mov r1, r8 + lsls r0, r1, 16 + asrs r0, 16 + mov r2, r9 + lsls r1, r2, 16 + asrs r1, 16 + ldr r2, [r6] + ldrb r2, [r2, 0x1A] + bl sub_8075034 + lsls r0, 24 + lsrs r5, r0, 24 + ldrb r0, [r6, 0x8] + ldr r4, =gUnknown_08615AB8 + ldrb r1, [r4, 0x1] + ldr r3, [r6] + ldrb r2, [r3, 0x18] + ldrb r3, [r3, 0x19] + str r5, [sp] + movs r7, 0x1 + str r7, [sp, 0x4] + bl FillWindowPixelRect + ldrb r0, [r6, 0x8] + ldrb r1, [r4] + ldr r3, [r6] + ldrb r2, [r3, 0x18] + ldrb r3, [r3, 0x19] + adds r3, 0x1 + str r5, [sp] + movs r4, 0x2 + str r4, [sp, 0x4] + bl FillWindowPixelRect + ldr r1, [r6] + ldrb r0, [r1, 0x1A] + cmp r5, r0 + beq _081B2F88 + ldrb r0, [r6, 0x8] + ldrb r2, [r1, 0x18] + adds r2, r5 + ldrb r3, [r1, 0x19] + ldrb r1, [r1, 0x1A] + subs r1, r5 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + str r7, [sp, 0x4] + movs r1, 0xD + bl FillWindowPixelRect + ldrb r0, [r6, 0x8] + ldr r1, [r6] + ldrb r2, [r1, 0x18] + adds r2, r5 + ldrb r3, [r1, 0x19] + adds r3, 0x1 + ldrb r1, [r1, 0x1A] + subs r1, r5 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + str r4, [sp, 0x4] + movs r1, 0x2 + bl FillWindowPixelRect +_081B2F88: + ldrb r0, [r6, 0x8] + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B2E64 + + thumb_func_start sub_81B2FA8 +sub_81B2FA8: @ 81B2FA8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + adds r6, r1, 0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r2, 24 + lsrs r7, r2, 24 + cmp r7, 0 + beq _081B2FF2 + ldr r5, [r6] + ldrb r1, [r5, 0x1C] + movs r4, 0x7 + adds r0, r1, 0 + ands r0, r4 + ldrb r2, [r5, 0x1E] + adds r0, r2 + adds r3, r0, 0x7 + asrs r3, 3 + ldrb r2, [r5, 0x1D] + adds r0, r2, 0 + ands r0, r4 + ldrb r4, [r5, 0x1F] + adds r0, r4 + adds r4, r0, 0x7 + ldrb r0, [r6, 0x8] + lsrs r1, 3 + lsrs r2, 3 + lsrs r4, 3 + str r4, [sp] + movs r4, 0x1 + str r4, [sp, 0x4] + ldr r4, [r5] + bl _call_via_r4 +_081B2FF2: + cmp r7, 0x2 + beq _081B3018 + ldrb r0, [r6, 0x8] + ldr r1, [r6] + ldrb r2, [r1, 0x1C] + ldrb r3, [r1, 0x1D] + ldr r1, =gUnknown_086157FC + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + ldr r4, =gUnknown_08615B60 + mov r5, r8 + lsls r1, r5, 2 + adds r1, r4 + ldr r1, [r1] + str r1, [sp, 0x8] + movs r1, 0x1 + bl box_print +_081B3018: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B2FA8 + + thumb_func_start sub_81B302C +sub_81B302C: @ 81B302C + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4] + cmp r0, 0xFF + beq _081B304C + movs r1, 0 + bl sub_8198070 + ldrb r0, [r4] + bl RemoveWindow + movs r0, 0xFF + strb r0, [r4] + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram +_081B304C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B302C + + thumb_func_start display_pokemon_menu_message +display_pokemon_menu_message: @ 81B3054 + push {r4-r6,lr} + sub sp, 0xC + adds r6, r0, 0 + ldr r0, =gUnknown_0203CEC4 + ldr r4, [r0] + adds r5, r4, 0 + adds r5, 0xD + ldrb r0, [r4, 0xD] + cmp r0, 0xFF + beq _081B306E + adds r0, r5, 0 + bl sub_81B302C +_081B306E: + cmp r6, 0x7F + beq _081B313C + adds r0, r6, 0 + subs r0, 0x15 + cmp r0, 0x5 + bhi _081B30D4 + lsls r0, 2 + ldr r1, =_081B308C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081B308C: + .4byte _081B30A4 + .4byte _081B30BC + .4byte _081B30BC + .4byte _081B30AC + .4byte _081B30B4 + .4byte _081B30C4 +_081B30A4: + ldr r0, =gUnknown_08615928 + b _081B30C6 + .pool +_081B30AC: + ldr r0, =gUnknown_08615930 + b _081B30C6 + .pool +_081B30B4: + ldr r0, =gUnknown_08615938 + b _081B30C6 + .pool +_081B30BC: + ldr r0, =gUnknown_08615940 + b _081B30C6 + .pool +_081B30C4: + ldr r0, =gUnknown_08615948 +_081B30C6: + bl AddWindow + strb r0, [r5] + b _081B30DC + .pool +_081B30D4: + ldr r0, =gUnknown_08615920 + bl AddWindow + strb r0, [r4, 0xD] +_081B30DC: + cmp r6, 0 + bne _081B3104 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 31 + cmp r0, 0 + beq _081B30F8 + movs r6, 0x2 + b _081B3104 + .pool +_081B30F8: + bl sub_81B314C + lsls r0, 24 + cmp r0, 0 + bne _081B3104 + movs r6, 0x1 +_081B3104: + ldrb r0, [r5] + movs r1, 0 + movs r2, 0x4F + movs r3, 0xD + bl SetWindowBorderStyle + ldr r4, =gStringVar4 + ldr r1, =gUnknown_08615AF4 + lsls r0, r6, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r4, 0 + bl StringExpandPlaceholders + ldrb r0, [r5] + movs r1, 0x1 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0 + bl Print + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram +_081B313C: + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end display_pokemon_menu_message + + thumb_func_start sub_81B314C +sub_81B314C: @ 81B314C + push {r4-r7,lr} + ldr r7, =gPlayerParty + movs r6, 0 + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0xB] + cmp r0, 0x1 + bne _081B3168 +_081B315A: + movs r0, 0x1 + b _081B31AA + .pool +_081B3168: + movs r5, 0 +_081B316A: + movs r0, 0x64 + muls r0, r5 + adds r4, r7, r0 + adds r0, r4, 0 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B319A + adds r0, r4, 0 + movs r1, 0x39 + bl GetMonData + cmp r0, 0 + bne _081B3194 + adds r0, r4, 0 + movs r1, 0x2D + bl GetMonData + cmp r0, 0 + beq _081B319A +_081B3194: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_081B319A: + cmp r6, 0x1 + bhi _081B315A + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _081B316A + movs r0, 0 +_081B31AA: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81B314C + + thumb_func_start sub_81B31B0 +sub_81B31B0: @ 81B31B0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x1C + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + beq _081B320C + cmp r4, 0x1 + bgt _081B31CC + cmp r4, 0 + beq _081B31D2 + b _081B321C +_081B31CC: + cmp r4, 0x2 + beq _081B3214 + b _081B321C +_081B31D2: + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + ldrb r0, [r1, 0x17] + lsls r0, 1 + movs r3, 0x13 + subs r3, r0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0xA + str r0, [sp] + ldrb r0, [r1, 0x17] + lsls r0, 25 + lsrs r0, 24 + str r0, [sp, 0x4] + movs r0, 0xE + str r0, [sp, 0x8] + ldr r0, =0x000002e9 + str r0, [sp, 0xC] + add r0, sp, 0x14 + movs r1, 0x2 + movs r2, 0x13 + bl rbox_template_set + b _081B3226 + .pool +_081B320C: + ldr r0, =gUnknown_08615950 + b _081B321E + .pool +_081B3214: + ldr r0, =gUnknown_08615958 + b _081B321E + .pool +_081B321C: + ldr r0, =gUnknown_08615960 +_081B321E: + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp, 0x14] + str r1, [sp, 0x18] +_081B3226: + add r0, sp, 0x14 + bl AddWindow + ldr r6, =gUnknown_0203CEC4 + ldr r1, [r6] + strb r0, [r1, 0xC] + ldr r0, [r6] + ldrb r0, [r0, 0xC] + movs r1, 0 + movs r2, 0x4F + movs r3, 0xD + bl SetWindowBorderStyle + cmp r4, 0x3 + bne _081B3250 + ldr r0, [r6] + b _081B32E2 + .pool +_081B3250: + movs r0, 0x1 + movs r1, 0 + bl GetMenuCursorDimensionByFont + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r0, 0x1 + movs r1, 0x2 + bl GetFontAttribute + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r5, 0 + ldr r0, [r6] + ldrb r0, [r0, 0x17] + cmp r5, r0 + bcs _081B32CA + adds r7, r6, 0 + movs r6, 0 +_081B327A: + ldr r1, [r7] + adds r0, r1, 0 + adds r0, 0xF + adds r4, r0, r5 + ldrb r0, [r4] + movs r2, 0x3 + cmp r0, 0x12 + bls _081B328C + movs r2, 0x4 +_081B328C: + ldrb r0, [r1, 0xC] + lsls r3, r5, 4 + adds r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + mov r1, r8 + str r1, [sp] + str r6, [sp, 0x4] + lsls r1, r2, 1 + adds r1, r2 + ldr r2, =gUnknown_086157FC + adds r1, r2 + str r1, [sp, 0x8] + str r6, [sp, 0xC] + ldr r2, =gUnknown_08615C08 + ldrb r1, [r4] + lsls r1, 3 + adds r1, r2 + ldr r1, [r1] + str r1, [sp, 0x10] + movs r1, 0x1 + mov r2, r9 + bl AddTextPrinterParametrized2 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, [r7] + ldrb r0, [r0, 0x17] + cmp r5, r0 + bcc _081B327A +_081B32CA: + ldr r4, =gUnknown_0203CEC4 + ldr r1, [r4] + ldrb r0, [r1, 0xC] + ldrb r1, [r1, 0x17] + movs r2, 0 + movs r3, 0x1 + bl InitMenuInUpperLeftCorner + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, [r4] +_081B32E2: + ldrb r0, [r0, 0xC] + add sp, 0x1C + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B31B0 + + thumb_func_start sub_81B3300 +sub_81B3300: @ 81B3300 + push {r4,lr} + sub sp, 0x10 + adds r4, r0, 0 + movs r0, 0x6 + movs r1, 0 + movs r2, 0x4F + movs r3, 0xD + bl SetWindowBorderStyle + ldr r2, =gTextFlags + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + bl sav2_get_text_speed + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x1 + str r0, [sp, 0x8] + movs r0, 0x3 + str r0, [sp, 0xC] + movs r0, 0x6 + movs r1, 0x1 + adds r2, r4, 0 + bl AddTextPrinterParametrized + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B3300 + + thumb_func_start sub_81B334C +sub_81B334C: @ 81B334C + push {lr} + ldr r0, =gUnknown_08615968 + movs r1, 0x4F + movs r2, 0xD + movs r3, 0 + bl CreateYesNoMenu + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B334C + + thumb_func_start sub_81B3364 +sub_81B3364: @ 81B3364 + push {r4,lr} + ldr r0, =gUnknown_08615970 + bl AddWindow + ldr r4, =gUnknown_0203CEC4 + ldr r1, [r4] + strb r0, [r1, 0xC] + ldr r0, [r4] + ldrb r0, [r0, 0xC] + movs r1, 0 + movs r2, 0x4F + movs r3, 0xD + bl SetWindowBorderStyle + ldr r0, [r4] + ldrb r0, [r0, 0xC] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B3364 + + thumb_func_start sub_81B3394 +sub_81B3394: @ 81B3394 + push {r4,lr} + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + ldrb r0, [r0, 0xC] + bl ClearWindowTilemap + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B3394 + + thumb_func_start sub_81B33B4 +sub_81B33B4: @ 81B33B4 + push {r4,lr} + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + cmp r2, 0 + bne _081B33C8 + bl sub_81B3414 + b _081B3400 +_081B33C8: + ldr r4, =gUnknown_0203CEC4 + ldr r1, [r4] + ldr r0, =gUnknown_08615D70 + adds r0, r2, r0 + ldrb r0, [r0] + strb r0, [r1, 0x17] + movs r3, 0 + ldr r0, [r4] + ldrb r0, [r0, 0x17] + cmp r3, r0 + bcs _081B3400 + ldr r1, =gUnknown_08615D38 + lsls r0, r2, 2 + adds r2, r0, r1 +_081B33E4: + ldr r1, [r4] + adds r1, 0xF + adds r1, r3 + ldr r0, [r2] + adds r0, r3 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + ldr r0, [r4] + ldrb r0, [r0, 0x17] + cmp r3, r0 + bcc _081B33E4 +_081B3400: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B33B4 + + thumb_func_start sub_81B3414 +sub_81B3414: @ 81B3414 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r9, r0 + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + ldr r2, =gUnknown_0203CEC4 + ldr r1, [r2] + movs r0, 0 + strb r0, [r1, 0x17] + ldr r1, [r2] + adds r0, r1, 0 + adds r0, 0xF + adds r1, 0x17 + movs r2, 0 + bl append_byte + movs r7, 0 + ldr r0, =gUnknown_08615D7E + ldrh r0, [r0] + str r0, [sp] +_081B3446: + movs r4, 0 + adds r0, r7, 0x1 + mov r8, r0 + ldr r1, [sp] + cmp r1, 0xE + beq _081B34A0 + movs r0, 0x64 + mov r6, r10 + muls r6, r0 + ldr r5, =gUnknown_08615D7E +_081B345A: + mov r1, r9 + adds r0, r1, r6 + adds r1, r7, 0 + adds r1, 0xD + bl GetMonData + lsls r1, r4, 1 + adds r1, r5 + ldrh r1, [r1] + cmp r0, r1 + bne _081B3490 + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0xF + adds r1, 0x17 + adds r2, r4, 0 + adds r2, 0x13 + lsls r2, 24 + lsrs r2, 24 + bl append_byte + b _081B34A0 + .pool +_081B3490: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 1 + adds r0, r5 + ldrh r0, [r0] + cmp r0, 0xE + bne _081B345A +_081B34A0: + mov r1, r8 + lsls r0, r1, 24 + lsrs r7, r0, 24 + cmp r7, 0x3 + bls _081B3446 + bl InBattlePike + lsls r0, 24 + cmp r0, 0 + bne _081B3518 + mov r0, r9 + adds r0, 0x64 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B34D2 + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0xF + adds r1, 0x17 + movs r2, 0x1 + bl append_byte +_081B34D2: + movs r0, 0x64 + mov r1, r10 + muls r1, r0 + adds r0, r1, 0 + add r0, r9 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _081B3508 + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0xF + adds r1, 0x17 + movs r2, 0x6 + bl append_byte + b _081B3518 + .pool +_081B3508: + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0xF + adds r1, 0x17 + movs r2, 0x3 + bl append_byte +_081B3518: + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0xF + adds r1, 0x17 + movs r2, 0x2 + bl append_byte + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B3414 + + thumb_func_start sub_81B353C +sub_81B353C: @ 81B353C + push {r4,lr} + adds r4, r0, 0 + ldr r1, =gUnknown_0203CEC8 + ldrb r0, [r1, 0x8] + lsls r0, 28 + lsrs r0, 28 + adds r2, r1, 0 + cmp r0, 0xC + bhi _081B35FE + lsls r0, 2 + ldr r1, =_081B3560 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081B3560: + .4byte _081B3594 + .4byte _081B35B0 + .4byte _081B35FE + .4byte _081B35FE + .4byte _081B35BC + .4byte _081B35FE + .4byte _081B35DC + .4byte _081B35FE + .4byte _081B35EE + .4byte _081B35F2 + .4byte _081B35F6 + .4byte _081B35FE + .4byte _081B35FA +_081B3594: + bl in_multi_battle_room_with_var_condition + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B35AC + adds r0, r4, 0 + movs r1, 0x2D + bl GetMonData + cmp r0, 0 + beq _081B35FE +_081B35AC: + movs r1, 0x1 + b _081B3600 +_081B35B0: + adds r0, r4, 0 + bl sub_81B8A2C + lsls r0, 24 + lsrs r1, r0, 24 + b _081B3600 +_081B35BC: + movs r0, 0x9 + ldrsb r0, [r2, r0] + bl sub_81B856C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _081B35D4 + cmp r0, 0x1 + beq _081B35D8 + movs r1, 0x7 + b _081B3600 +_081B35D4: + movs r1, 0x4 + b _081B3600 +_081B35D8: + movs r1, 0x5 + b _081B3600 +_081B35DC: + adds r0, r4, 0 + movs r1, 0x2D + bl GetMonData + movs r1, 0x6 + cmp r0, 0 + beq _081B3600 + movs r1, 0x7 + b _081B3600 +_081B35EE: + movs r1, 0xA + b _081B3600 +_081B35F2: + movs r1, 0xB + b _081B3600 +_081B35F6: + movs r1, 0xC + b _081B3600 +_081B35FA: + movs r1, 0xD + b _081B3600 +_081B35FE: + movs r1, 0 +_081B3600: + adds r0, r1, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B353C + + thumb_func_start sub_81B3608 +sub_81B3608: @ 81B3608 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r4, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r4, r1] + movs r0, 0x64 + muls r0, r1 + ldr r7, =gPlayerParty + adds r5, r0, r7 + ldr r1, =gStringVar1 + adds r0, r5, 0 + bl GetMonNickname + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + adds r0, 0xD + bl sub_81B302C + ldrb r1, [r4, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0xC + beq _081B3674 + ldrb r4, [r4, 0x9] + adds r0, r5, 0 + bl sub_81B353C + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r7, 0 + adds r1, r4, 0 + bl sub_81B33B4 + movs r0, 0 + bl sub_81B31B0 + movs r0, 0x15 + bl display_pokemon_menu_message + b _081B36EA + .pool +_081B3674: + adds r0, r5, 0 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0 + bne _081B36C0 + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9980 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =gTasks + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B469C + str r1, [r0] + movs r0, 0 + b _081B36EC + .pool +_081B36C0: + ldrb r4, [r4, 0x9] + adds r0, r5, 0 + bl sub_81B353C + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r7, 0 + adds r1, r4, 0 + bl sub_81B33B4 + movs r0, 0x1 + bl sub_81B31B0 + ldr r1, =gStringVar2 + adds r0, r6, 0 + bl CopyItemName + movs r0, 0x1A + bl display_pokemon_menu_message +_081B36EA: + movs r0, 0x1 +_081B36EC: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B3608 + + thumb_func_start sub_81B36FC +sub_81B36FC: @ 81B36FC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_81B3608 + lsls r0, 24 + cmp r0, 0 + beq _081B3720 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0xFF + strh r1, [r0, 0x8] + ldr r1, =sub_81B3730 + str r1, [r0] +_081B3720: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B36FC + + thumb_func_start sub_81B3730 +sub_81B3730: @ 81B3730 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B37EE + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B37EE + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r5, r0, r1 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + ldrb r0, [r0, 0x17] + cmp r0, 0x3 + bhi _081B3774 + bl ProcessMenuInputNoWrapAround_other + b _081B3778 + .pool +_081B3774: + bl ProcessMenuInput_other +_081B3778: + lsls r0, 24 + lsrs r4, r0, 24 + bl GetMenuCursorPos + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5] + lsls r0, r4, 24 + asrs r5, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r5, r0 + beq _081B37EE + adds r0, 0x1 + cmp r5, r0 + bne _081B37CC + movs r0, 0x5 + bl PlaySE + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xE + bl sub_81B302C + ldr r2, =gUnknown_08615C08 + ldr r0, [r4] + ldrb r1, [r0, 0x17] + adds r0, r1 + ldrb r0, [r0, 0xE] + lsls r0, 3 + adds r2, 0x4 + adds r0, r2 + ldr r1, [r0] + adds r0, r6, 0 + bl _call_via_r1 + b _081B37EE + .pool +_081B37CC: + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xE + bl sub_81B302C + ldr r1, =gUnknown_08615C08 + ldr r0, [r4] + adds r0, 0xF + adds r0, r5 + ldrb r0, [r0] + lsls r0, 3 + adds r1, 0x4 + adds r0, r1 + ldr r1, [r0] + adds r0, r6, 0 + bl _call_via_r1 +_081B37EE: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B3730 + + thumb_func_start sub_81B37FC +sub_81B37FC: @ 81B37FC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + ldr r0, =sub_81B3828 + str r0, [r1, 0x4] + adds r0, r4, 0 + bl sub_81B12C0 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B37FC + + thumb_func_start sub_81B3828 +sub_81B3828: @ 81B3828 + push {r4,lr} + sub sp, 0x4 + ldr r4, =gUnknown_0203CEC8 + ldrb r1, [r4, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x1 + bne _081B3868 + bl pokemon_change_order + ldr r1, =gPlayerParty + ldrb r2, [r4, 0x9] + ldr r0, =gUnknown_020244E9 + ldrb r3, [r0] + subs r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + ldr r0, =sub_81B3894 + str r0, [sp] + movs r0, 0x1 + bl sub_81BF8EC + b _081B3880 + .pool +_081B3868: + ldr r1, =gPlayerParty + ldrb r2, [r4, 0x9] + ldr r0, =gUnknown_020244E9 + ldrb r3, [r0] + subs r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + ldr r0, =sub_81B3894 + str r0, [sp] + movs r0, 0 + bl sub_81BF8EC +_081B3880: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B3828 + + thumb_func_start sub_81B3894 +sub_81B3894: @ 81B3894 + push {lr} + sub sp, 0xC + ldr r2, =gPaletteFade + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x8] + ldr r3, =gUnknown_0203CEC8 + ldr r0, =gUnknown_0203CF20 + ldrb r0, [r0] + strb r0, [r3, 0x9] + ldrb r0, [r3, 0x8] + lsls r0, 28 + lsrs r0, 28 + ldrb r2, [r3, 0xB] + movs r1, 0x15 + str r1, [sp] + ldr r1, =sub_81B36FC + str r1, [sp, 0x4] + ldr r1, [r3] + str r1, [sp, 0x8] + movs r1, 0xFF + movs r3, 0x1 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B3894 + + thumb_func_start brm_switch +brm_switch: @ 81B38DC + push {r4-r6,lr} + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + movs r0, 0x5 + bl PlaySE + ldr r5, =gUnknown_0203CEC8 + movs r0, 0x8 + strb r0, [r5, 0xB] + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + movs r0, 0x3 + bl display_pokemon_menu_message + ldrb r0, [r5, 0x9] + movs r1, 0x1 + bl sub_81B0FCC + ldrb r0, [r5, 0x9] + strb r0, [r5, 0xA] + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1370 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end brm_switch + + thumb_func_start sub_81B3938 +sub_81B3938: @ 81B3938 + push {r4-r7,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r6, r0, r1 + ldr r3, =gUnknown_0203CEC8 + movs r1, 0xA + ldrsb r1, [r3, r1] + movs r0, 0x9 + ldrsb r0, [r3, r0] + cmp r1, r0 + bne _081B3968 + adds r0, r7, 0 + bl sub_81B407C + b _081B3ABA + .pool +_081B3968: + add r2, sp, 0x8 + movs r0, 0x9 + ldrsb r0, [r3, r0] + ldr r1, =gUnknown_0203CEDC + ldr r1, [r1] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x8] + movs r4, 0 + strb r0, [r2] + adds r0, r2, 0 + ldrb r0, [r0] + movs r1, 0x1 + bl GetWindowAttribute + strh r0, [r6] + add r0, sp, 0x8 + ldrb r0, [r0] + movs r1, 0x2 + bl GetWindowAttribute + strh r0, [r6, 0x2] + add r0, sp, 0x8 + ldrb r0, [r0] + movs r1, 0x3 + bl GetWindowAttribute + strh r0, [r6, 0x4] + add r0, sp, 0x8 + ldrb r0, [r0] + movs r1, 0x4 + bl GetWindowAttribute + strh r0, [r6, 0x6] + strh r4, [r6, 0x10] + movs r1, 0x4 + ldrsh r0, [r6, r1] + cmp r0, 0xA + bne _081B39C4 + movs r2, 0x1 + negs r2, r2 + adds r0, r2, 0 + b _081B39C6 + .pool +_081B39C4: + movs r0, 0x1 +_081B39C6: + strh r0, [r6, 0x14] + add r2, sp, 0x8 + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0xA] + lsls r0, 24 + asrs r0, 24 + ldr r1, =gUnknown_0203CEDC + ldr r1, [r1] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x8] + movs r4, 0 + strb r0, [r2, 0x1] + adds r0, r2, 0 + ldrb r0, [r0, 0x1] + movs r1, 0x1 + bl GetWindowAttribute + strh r0, [r6, 0x8] + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + movs r1, 0x2 + bl GetWindowAttribute + strh r0, [r6, 0xA] + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + movs r1, 0x3 + bl GetWindowAttribute + strh r0, [r6, 0xC] + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + movs r1, 0x4 + bl GetWindowAttribute + strh r0, [r6, 0xE] + strh r4, [r6, 0x12] + movs r1, 0xC + ldrsh r0, [r6, r1] + cmp r0, 0xA + bne _081B3A2C + movs r2, 0x1 + negs r2, r2 + adds r0, r2, 0 + b _081B3A2E + .pool +_081B3A2C: + movs r0, 0x1 +_081B3A2E: + strh r0, [r6, 0x16] + ldr r4, =gUnknown_0203CEF0 + movs r0, 0x4 + ldrsh r1, [r6, r0] + movs r2, 0x6 + ldrsh r0, [r6, r2] + lsls r0, 1 + muls r0, r1 + bl Alloc + str r0, [r4] + ldr r5, =gUnknown_0203CEF4 + movs r0, 0xC + ldrsh r1, [r6, r0] + movs r2, 0xE + ldrsh r0, [r6, r2] + lsls r0, 1 + muls r0, r1 + bl Alloc + str r0, [r5] + ldr r1, [r4] + ldrb r2, [r6] + ldrb r3, [r6, 0x2] + ldrb r0, [r6, 0x4] + str r0, [sp] + ldrb r0, [r6, 0x6] + str r0, [sp, 0x4] + movs r0, 0 + bl sub_8199CBC + ldr r1, [r5] + ldrb r2, [r6, 0x8] + ldrb r3, [r6, 0xA] + ldrb r0, [r6, 0xC] + str r0, [sp] + ldrb r0, [r6, 0xE] + str r0, [sp, 0x4] + movs r0, 0 + bl sub_8199CBC + add r0, sp, 0x8 + ldrb r0, [r0] + bl ClearWindowTilemap + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + bl ClearWindowTilemap + ldr r4, =gUnknown_0203CEC8 + movs r0, 0x9 + strb r0, [r4, 0xB] + ldrb r0, [r4, 0x9] + movs r1, 0x1 + bl sub_81B0FCC + ldrb r0, [r4, 0xA] + movs r1, 0x1 + bl sub_81B0FCC + adds r0, r7, 0 + bl sub_81B3CC0 + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B3D48 + str r1, [r0] +_081B3ABA: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B3938 + + thumb_func_start sub_81B3AD8 +sub_81B3AD8: @ 81B3AD8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r2, 0 + mov r12, r3 + ldr r7, [sp, 0x18] + lsls r0, 16 + lsrs r3, r0, 16 + adds r5, r3, 0 + lsls r1, 16 + lsrs r2, r1, 16 + mov r8, r2 + lsls r0, r3, 16 + asrs r1, r0, 16 + lsls r0, r2, 16 + asrs r0, 16 + adds r4, r1, r0 + cmp r4, 0 + blt _081B3B02 + cmp r1, 0x1F + ble _081B3B06 +_081B3B02: + movs r0, 0 + b _081B3B34 +_081B3B06: + cmp r1, 0 + bge _081B3B1A + negs r0, r1 + strb r0, [r6] + movs r0, 0 + mov r1, r12 + strb r0, [r1] + adds r0, r2, r3 + strb r0, [r7] + b _081B3B32 +_081B3B1A: + movs r0, 0 + strb r0, [r6] + mov r0, r12 + strb r5, [r0] + cmp r4, 0x1F + ble _081B3B2E + movs r0, 0x20 + subs r0, r5 + strb r0, [r7] + b _081B3B32 +_081B3B2E: + mov r1, r8 + strb r1, [r7] +_081B3B32: + movs r0, 0x1 +_081B3B34: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81B3AD8 + + thumb_func_start sub_81B3B40 +sub_81B3B40: @ 81B3B40 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x34 + str r0, [sp, 0x28] + ldr r0, [sp, 0x54] + ldr r4, [sp, 0x58] + lsls r2, 16 + lsrs r2, 16 + mov r9, r2 + lsls r3, 16 + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + lsls r4, 16 + lsrs r4, 16 + str r4, [sp, 0x30] + lsls r1, 16 + asrs r7, r1, 16 + lsrs r0, r3, 16 + str r0, [sp, 0x2C] + asrs r3, 16 + mov r8, r3 + mov r5, sp + adds r5, 0x25 + mov r6, sp + adds r6, 0x26 + str r6, [sp] + adds r0, r7, 0 + mov r1, r8 + add r2, sp, 0x24 + adds r3, r5, 0 + bl sub_81B3AD8 + lsls r0, 24 + cmp r0, 0 + beq _081B3BFA + ldrb r2, [r5] + mov r1, r9 + lsls r0, r1, 24 + lsrs r0, 24 + mov r9, r0 + ldrb r0, [r6] + str r0, [sp] + mov r1, r10 + lsls r0, r1, 24 + lsrs r4, r0, 24 + str r4, [sp, 0x4] + movs r0, 0 + movs r1, 0 + mov r3, r9 + bl FillBgTilemapBufferRect_Palette0 + ldr r1, [sp, 0x30] + lsls r0, r1, 16 + asrs r0, 16 + adds r0, r7, r0 + lsls r0, 16 + asrs r0, 16 + str r6, [sp] + mov r1, r8 + add r2, sp, 0x24 + adds r3, r5, 0 + bl sub_81B3AD8 + lsls r0, 24 + cmp r0, 0 + beq _081B3BFA + add r0, sp, 0x24 + ldrb r2, [r0] + ldr r1, [sp, 0x2C] + lsls r0, r1, 24 + lsrs r0, 24 + str r0, [sp] + str r4, [sp, 0x4] + ldrb r0, [r5] + str r0, [sp, 0x8] + mov r0, r9 + str r0, [sp, 0xC] + ldrb r0, [r6] + str r0, [sp, 0x10] + str r4, [sp, 0x14] + movs r0, 0x11 + str r0, [sp, 0x18] + movs r0, 0 + str r0, [sp, 0x1C] + str r0, [sp, 0x20] + ldr r1, [sp, 0x28] + movs r3, 0 + bl CopyRectToBgTilemapBufferRect +_081B3BFA: + add sp, 0x34 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B3B40 + + thumb_func_start sub_81B3C0C +sub_81B3C0C: @ 81B3C0C + push {r4,lr} + ldr r4, =gSprites + ldrb r2, [r0, 0xB] + lsls r3, r2, 4 + adds r3, r2 + lsls r3, 2 + adds r3, r4 + lsls r1, 16 + asrs r1, 13 + ldrh r2, [r3, 0x24] + adds r2, r1 + strh r2, [r3, 0x24] + ldrb r3, [r0, 0xA] + lsls r2, r3, 4 + adds r2, r3 + lsls r2, 2 + adds r2, r4 + ldrh r3, [r2, 0x24] + adds r3, r1 + strh r3, [r2, 0x24] + ldrb r3, [r0, 0x9] + lsls r2, r3, 4 + adds r2, r3 + lsls r2, 2 + adds r2, r4 + ldrh r3, [r2, 0x24] + adds r3, r1 + strh r3, [r2, 0x24] + ldrb r2, [r0, 0xC] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r4 + ldrh r2, [r0, 0x24] + adds r2, r1 + strh r2, [r0, 0x24] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B3C0C + + thumb_func_start sub_81B3C60 +sub_81B3C60: @ 81B3C60 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r4, r1, r0 + movs r1, 0x14 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _081B3C8E + ldr r2, =gUnknown_0203CEDC + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + lsls r1, 4 + ldr r0, [r2] + adds r0, r1 + movs r2, 0x14 + ldrsh r1, [r4, r2] + bl sub_81B3C0C +_081B3C8E: + movs r1, 0x16 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _081B3CAC + ldr r2, =gUnknown_0203CEDC + ldr r0, =gUnknown_0203CEC8 + movs r1, 0xA + ldrsb r1, [r0, r1] + lsls r1, 4 + ldr r0, [r2] + adds r0, r1 + movs r2, 0x16 + ldrsh r1, [r4, r2] + bl sub_81B3C0C +_081B3CAC: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B3C60 + + thumb_func_start sub_81B3CC0 +sub_81B3CC0: @ 81B3CC0 + push {r4-r6,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r5, r1, r0 + movs r1, 0x14 + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _081B3D00 + ldr r0, =gUnknown_0203CEF0 + ldr r0, [r0] + ldrh r1, [r5, 0x10] + ldrh r2, [r5] + adds r1, r2 + lsls r1, 16 + asrs r1, 16 + movs r3, 0x2 + ldrsh r2, [r5, r3] + movs r4, 0x4 + ldrsh r3, [r5, r4] + movs r6, 0x6 + ldrsh r4, [r5, r6] + str r4, [sp] + movs r6, 0x14 + ldrsh r4, [r5, r6] + str r4, [sp, 0x4] + bl sub_81B3B40 +_081B3D00: + movs r1, 0x16 + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _081B3D2E + ldr r0, =gUnknown_0203CEF4 + ldr r0, [r0] + ldrh r1, [r5, 0x12] + ldrh r2, [r5, 0x8] + adds r1, r2 + lsls r1, 16 + asrs r1, 16 + movs r3, 0xA + ldrsh r2, [r5, r3] + movs r4, 0xC + ldrsh r3, [r5, r4] + movs r6, 0xE + ldrsh r4, [r5, r6] + str r4, [sp] + movs r6, 0x16 + ldrsh r4, [r5, r6] + str r4, [sp, 0x4] + bl sub_81B3B40 +_081B3D2E: + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B3CC0 + + thumb_func_start sub_81B3D48 +sub_81B3D48: @ 81B3D48 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r7, r0, 3 + ldr r0, =gTasks + 0x8 + mov r8, r0 + adds r6, r7, r0 + adds r0, r4, 0 + bl sub_81B3CC0 + adds r0, r4, 0 + bl sub_81B3C60 + ldrh r1, [r6, 0x14] + ldrh r2, [r6, 0x10] + adds r1, r2 + strh r1, [r6, 0x10] + ldrh r0, [r6, 0x16] + ldrh r3, [r6, 0x12] + adds r0, r3 + strh r0, [r6, 0x12] + add r2, sp, 0x8 + ldrh r0, [r6] + adds r0, r1 + strh r0, [r2] + adds r1, r2, 0 + ldrh r0, [r6, 0x12] + ldrh r3, [r6, 0x8] + adds r2, r0, r3 + strh r2, [r1, 0x2] + adds r0, r1, 0 + ldrh r0, [r0] + cmp r0, 0x21 + bls _081B3E3A + lsls r0, r2, 16 + lsrs r0, 16 + cmp r0, 0x21 + bls _081B3E3A + movs r1, 0x14 + ldrsh r0, [r6, r1] + negs r0, r0 + strh r0, [r6, 0x14] + movs r2, 0x16 + ldrsh r0, [r6, r2] + negs r0, r0 + strh r0, [r6, 0x16] + bl swap_pokemon_and_oams + ldr r4, =gUnknown_0203CEC8 + ldrb r0, [r4, 0x9] + bl sub_81B0948 + ldrb r0, [r4, 0xA] + bl sub_81B0948 + movs r0, 0x9 + ldrsb r0, [r4, r0] + ldr r5, =gUnknown_0203CEDC + ldr r1, [r5] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x8] + bl PutWindowTilemap + movs r0, 0xA + ldrsb r0, [r4, r0] + ldr r1, [r5] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x8] + bl PutWindowTilemap + ldr r0, =gUnknown_0203CEF0 + ldr r1, [r0] + ldrb r2, [r6] + ldrb r3, [r6, 0x2] + ldrb r0, [r6, 0x4] + str r0, [sp] + ldrb r0, [r6, 0x6] + str r0, [sp, 0x4] + movs r0, 0 + bl sub_8199CBC + ldr r0, =gUnknown_0203CEF4 + ldr r1, [r0] + ldrb r2, [r6, 0x8] + ldrb r3, [r6, 0xA] + ldrb r0, [r6, 0xC] + str r0, [sp] + ldrb r0, [r6, 0xE] + str r0, [sp, 0x4] + movs r0, 0 + bl sub_8199CBC + movs r0, 0x9 + ldrsb r0, [r4, r0] + ldr r1, [r5] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x8] + bl ClearWindowTilemap + movs r0, 0xA + ldrsb r0, [r4, r0] + ldr r1, [r5] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x8] + bl ClearWindowTilemap + mov r0, r8 + subs r0, 0x8 + adds r0, r7, r0 + ldr r1, =sub_81B3E60 + str r1, [r0] +_081B3E3A: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B3D48 + + thumb_func_start sub_81B3E60 +sub_81B3E60: @ 81B3E60 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + adds r0, r6, 0 + bl sub_81B3CC0 + adds r0, r6, 0 + bl sub_81B3C60 + movs r1, 0x14 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081B3EE4 + movs r2, 0x16 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _081B3EE4 + ldr r5, =gUnknown_0203CEC8 + movs r0, 0x9 + ldrsb r0, [r5, r0] + ldr r4, =gUnknown_0203CEDC + ldr r1, [r4] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x8] + bl PutWindowTilemap + movs r0, 0xA + ldrsb r0, [r5, r0] + ldr r1, [r4] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x8] + bl PutWindowTilemap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, =gUnknown_0203CEF0 + ldr r0, [r0] + bl Free + ldr r0, =gUnknown_0203CEF4 + ldr r0, [r0] + bl Free + adds r0, r6, 0 + bl sub_81B407C + b _081B3F08 + .pool +_081B3EE4: + ldrh r1, [r4, 0x14] + ldrh r0, [r4, 0x10] + adds r1, r0 + strh r1, [r4, 0x10] + ldrh r0, [r4, 0x16] + ldrh r2, [r4, 0x12] + adds r0, r2 + strh r0, [r4, 0x12] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0 + bne _081B3EFE + strh r1, [r4, 0x14] +_081B3EFE: + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081B3F08 + strh r0, [r4, 0x16] +_081B3F08: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81B3E60 + + thumb_func_start oamt_swap_pos +oamt_swap_pos: @ 81B3F10 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + ldrb r3, [r0] + ldrb r2, [r1] + strb r2, [r0] + strb r3, [r1] + ldr r5, =gSprites + ldrb r2, [r0] + lsls r3, r2, 4 + adds r3, r2 + lsls r3, 2 + adds r3, r5 + ldrh r6, [r3, 0x20] + ldrh r2, [r3, 0x22] + mov r8, r2 + ldrh r2, [r3, 0x24] + mov r9, r2 + ldrh r2, [r3, 0x26] + mov r10, r2 + ldrb r4, [r1] + lsls r2, r4, 4 + adds r2, r4 + lsls r2, 2 + adds r2, r5 + ldrh r2, [r2, 0x20] + strh r2, [r3, 0x20] + ldrb r2, [r0] + lsls r3, r2, 4 + adds r3, r2 + lsls r3, 2 + adds r3, r5 + ldrb r4, [r1] + lsls r2, r4, 4 + adds r2, r4 + lsls r2, 2 + adds r2, r5 + ldrh r2, [r2, 0x22] + strh r2, [r3, 0x22] + ldrb r2, [r0] + lsls r3, r2, 4 + adds r3, r2 + lsls r3, 2 + adds r3, r5 + ldrb r4, [r1] + lsls r2, r4, 4 + adds r2, r4 + lsls r2, 2 + adds r2, r5 + ldrh r2, [r2, 0x24] + strh r2, [r3, 0x24] + ldrb r0, [r0] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r5 + ldrb r3, [r1] + lsls r0, r3, 4 + adds r0, r3 + lsls r0, 2 + adds r0, r5 + ldrh r0, [r0, 0x26] + strh r0, [r2, 0x26] + ldrb r2, [r1] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r5 + strh r6, [r0, 0x20] + ldrb r2, [r1] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r5 + mov r2, r8 + strh r2, [r0, 0x22] + ldrb r2, [r1] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r5 + mov r2, r9 + strh r2, [r0, 0x24] + ldrb r1, [r1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + mov r1, r10 + strh r1, [r0, 0x26] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end oamt_swap_pos + + thumb_func_start swap_pokemon_and_oams +swap_pokemon_and_oams: @ 81B3FDC + push {r4-r6,lr} + sub sp, 0x8 + ldr r1, =gUnknown_0203CEDC + ldr r2, =gUnknown_0203CEC8 + movs r3, 0x9 + ldrsb r3, [r2, r3] + lsls r0, r3, 4 + ldr r1, [r1] + adds r0, r1, r0 + str r0, [sp] + ldrb r2, [r2, 0xA] + lsls r2, 24 + asrs r2, 24 + lsls r0, r2, 4 + adds r0, r1, r0 + str r0, [sp, 0x4] + movs r1, 0x64 + adds r4, r3, 0 + muls r4, r1 + ldr r0, =gPlayerParty + adds r4, r0 + adds r5, r2, 0 + muls r5, r1 + adds r5, r0 + movs r0, 0x64 + bl Alloc + adds r6, r0, 0 + adds r1, r4, 0 + movs r2, 0x64 + bl memcpy + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x64 + bl memcpy + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0x64 + bl memcpy + adds r0, r6, 0 + bl Free + ldr r0, [sp] + adds r0, 0xB + ldr r1, [sp, 0x4] + adds r1, 0xB + bl oamt_swap_pos + ldr r0, [sp] + adds r0, 0xA + ldr r1, [sp, 0x4] + adds r1, 0xA + bl oamt_swap_pos + ldr r0, [sp] + adds r0, 0x9 + ldr r1, [sp, 0x4] + adds r1, 0x9 + bl oamt_swap_pos + ldr r0, [sp] + adds r0, 0xC + ldr r1, [sp, 0x4] + adds r1, 0xC + bl oamt_swap_pos + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end swap_pokemon_and_oams + + thumb_func_start sub_81B407C +sub_81B407C: @ 81B407C + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + adds r0, 0xD + bl sub_81B302C + ldr r4, =gUnknown_0203CEC8 + movs r0, 0 + strb r0, [r4, 0xB] + ldrb r0, [r4, 0x9] + movs r1, 0 + bl sub_81B0FCC + ldrb r0, [r4, 0xA] + strb r0, [r4, 0x9] + ldrb r0, [r4, 0xA] + movs r1, 0x1 + bl sub_81B0FCC + movs r0, 0 + bl display_pokemon_menu_message + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1370 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B407C + + thumb_func_start brm_cancel_1 +brm_cancel_1: @ 81B40D4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x5 + bl PlaySE + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + ldr r0, =gUnknown_0203CEC8 + ldrb r1, [r0, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x6 + bne _081B4110 + movs r0, 0xF + bl display_pokemon_menu_message + b _081B4116 + .pool +_081B4110: + movs r0, 0 + bl display_pokemon_menu_message +_081B4116: + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B1370 + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end brm_cancel_1 + + thumb_func_start sub_81B4134 +sub_81B4134: @ 81B4134 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + movs r0, 0x5 + bl PlaySE + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + ldr r0, =gPlayerParty + ldr r1, =gUnknown_0203CEC8 + ldrb r1, [r1, 0x9] + movs r2, 0x8 + bl sub_81B33B4 + movs r0, 0x1 + bl sub_81B31B0 + movs r0, 0x18 + bl display_pokemon_menu_message + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0xFF + strh r1, [r0, 0x8] + ldr r1, =sub_81B3730 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4134 + + thumb_func_start sub_81B4198 +sub_81B4198: @ 81B4198 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + ldr r0, =sub_81B41C4 + str r0, [r1, 0x4] + adds r0, r4, 0 + bl sub_81B12C0 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4198 + + thumb_func_start sub_81B41C4 +sub_81B41C4: @ 81B41C4 + push {lr} + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + bne _081B41E0 + ldr r2, =c2_8123744 + movs r0, 0x2 + movs r1, 0x5 + bl GoToBagMenu + b _081B41E8 + .pool +_081B41E0: + ldr r1, =c2_8123744 + movs r0, 0x2 + bl sub_81C4F98 +_081B41E8: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B41C4 + + thumb_func_start c2_8123744 +c2_8123744: @ 81B41F0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + ldr r6, =gUnknown_0203CE7C + ldrh r0, [r6] + cmp r0, 0 + bne _081B4224 + ldr r3, =gUnknown_0203CEC8 + ldrb r0, [r3, 0x8] + lsls r0, 28 + lsrs r0, 28 + ldrb r2, [r3, 0xB] + movs r1, 0x7F + str r1, [sp] + ldr r1, =sub_81B36FC + str r1, [sp, 0x4] + ldr r1, [r3] + b _081B425A + .pool +_081B4224: + ldr r4, =gUnknown_0203CEFC + ldr r5, =gUnknown_0203CEC8 + movs r0, 0x9 + ldrsb r0, [r5, r0] + movs r1, 0x64 + mov r8, r1 + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + ldr r7, =gPlayerParty + adds r0, r7 + movs r1, 0xC + bl GetMonData + strh r0, [r4] + lsls r0, 16 + cmp r0, 0 + beq _081B4278 + ldrb r0, [r5, 0x8] + lsls r0, 28 + lsrs r0, 28 + ldrb r2, [r5, 0xB] + movs r1, 0x7F + str r1, [sp] + ldr r1, =sub_81B4350 + str r1, [sp, 0x4] + ldr r1, [r5] +_081B425A: + str r1, [sp, 0x8] + movs r1, 0xFF + movs r3, 0x1 + bl sub_81B0038 + b _081B42C0 + .pool +_081B4278: + ldrh r0, [r6] + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _081B42A4 + ldrh r0, [r6] + movs r1, 0x1 + bl RemoveBagItem + movs r0, 0x9 + ldrsb r0, [r5, r0] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r7 + ldrh r1, [r6] + bl sub_81B1DB8 + bl sub_81B452C + b _081B42C0 +_081B42A4: + ldrb r0, [r5, 0x8] + lsls r0, 28 + lsrs r0, 28 + ldrb r2, [r5, 0xB] + movs r1, 0x7F + str r1, [sp] + ldr r1, =sub_81B42D0 + str r1, [sp, 0x4] + ldr r1, [r5] + str r1, [sp, 0x8] + movs r1, 0xFF + movs r3, 0x1 + bl sub_81B0038 +_081B42C0: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end c2_8123744 + + thumb_func_start sub_81B42D0 +sub_81B42D0: @ 81B42D0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B432C + ldr r0, =gUnknown_0203CE7C + ldrh r4, [r0] + ldr r0, =gUnknown_0203CEC8 + mov r8, r0 + ldrb r0, [r0, 0x9] + lsls r0, 24 + asrs r0, 24 + movs r6, 0x64 + muls r0, r6 + ldr r5, =gPlayerParty + adds r0, r5 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl sub_81B1C84 + mov r1, r8 + movs r0, 0x9 + ldrsb r0, [r1, r0] + muls r0, r6 + adds r0, r5 + adds r1, r4, 0 + bl sub_81B1DB8 + adds r0, r4, 0 + movs r1, 0x1 + bl RemoveBagItem + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B469C + str r1, [r0] +_081B432C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B42D0 + + thumb_func_start sub_81B4350 +sub_81B4350: @ 81B4350 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B4388 + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gUnknown_0203CEFC + ldrh r1, [r1] + movs r2, 0x1 + bl sub_81B1D1C + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B43A8 + str r1, [r0] +_081B4388: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4350 + + thumb_func_start sub_81B43A8 +sub_81B43A8: @ 81B43A8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B43CC + bl sub_81B334C + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B43DC + str r0, [r1] +_081B43CC: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B43A8 + + thumb_func_start sub_81B43DC +sub_81B43DC: @ 81B43DC + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B4402 + cmp r1, 0 + bgt _081B43FC + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B44D8 + b _081B44EC +_081B43FC: + cmp r1, 0x1 + beq _081B44DE + b _081B44EC +_081B4402: + ldr r5, =gUnknown_0203CE7C + ldrh r0, [r5] + movs r1, 0x1 + bl RemoveBagItem + ldr r6, =gUnknown_0203CEFC + ldrh r0, [r6] + movs r1, 0x1 + bl AddBagItem + lsls r0, 24 + cmp r0, 0 + bne _081B4458 + ldrh r0, [r5] + movs r1, 0x1 + bl AddBagItem + ldrh r0, [r6] + bl pokemon_item_not_removed + ldr r0, =gStringVar4 + movs r1, 0 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1C1C + str r1, [r0] + b _081B44EC + .pool +_081B4458: + ldrh r0, [r5] + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _081B4498 + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + ldrh r1, [r5] + bl sub_81B1DB8 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B44FC + str r1, [r0] + b _081B44EC + .pool +_081B4498: + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + ldrh r1, [r5] + bl sub_81B1DB8 + ldrh r0, [r5] + ldrh r1, [r6] + movs r2, 0x1 + bl sub_81B1D68 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B469C + str r1, [r0] + b _081B44EC + .pool +_081B44D8: + movs r0, 0x5 + bl PlaySE +_081B44DE: + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B1C1C + str r0, [r1] +_081B44EC: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B43DC + + thumb_func_start sub_81B44FC +sub_81B44FC: @ 81B44FC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B451C + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + ldr r0, =sub_81B452C + str r0, [r1, 0x4] + adds r0, r4, 0 + bl sub_81B12C0 +_081B451C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B44FC + + thumb_func_start sub_81B452C +sub_81B452C: @ 81B452C + push {lr} + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x40 + bl GetMonData + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gSaveBlock1Ptr + lsls r2, r0, 3 + adds r2, r0 + lsls r2, 2 + ldr r0, =0x00002be0 + adds r2, r0 + ldr r1, [r1] + adds r1, r2 + ldr r2, =sub_81B4578 + movs r0, 0x4 + movs r3, 0x3 + bl sub_811A20C + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B452C + + thumb_func_start sub_81B4578 +sub_81B4578: @ 81B4578 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + ldr r6, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r6, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r0, =gScriptResult + ldrh r7, [r0] + cmp r7, 0 + bne _081B45F8 + adds r0, r5, 0 + bl sub_80D4680 + ldr r4, =gUnknown_0203CEFC + adds r0, r5, 0 + movs r1, 0xC + adds r2, r4, 0 + bl SetMonData + ldrh r0, [r4] + movs r1, 0x1 + bl RemoveBagItem + mov r0, r8 + movs r1, 0x1 + bl AddBagItem + ldrb r0, [r6, 0x8] + lsls r0, 28 + lsrs r0, 28 + ldrb r2, [r6, 0xB] + str r7, [sp] + ldr r1, =sub_81B36FC + str r1, [sp, 0x4] + ldr r1, [r6] + str r1, [sp, 0x8] + movs r1, 0xFF + movs r3, 0x1 + bl sub_81B0038 + b _081B4614 + .pool +_081B45F8: + ldrb r0, [r6, 0x8] + lsls r0, 28 + lsrs r0, 28 + ldrb r2, [r6, 0xB] + movs r1, 0x7F + str r1, [sp] + ldr r1, =sub_81B4624 + str r1, [sp, 0x4] + ldr r1, [r6] + str r1, [sp, 0x8] + movs r1, 0xFF + movs r3, 0x1 + bl sub_81B0038 +_081B4614: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4578 + + thumb_func_start sub_81B4624 +sub_81B4624: @ 81B4624 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B468A + ldr r1, =gUnknown_0203CEFC + ldrh r0, [r1] + cmp r0, 0 + bne _081B4670 + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gUnknown_0203CE7C + ldrh r1, [r1] + movs r2, 0 + movs r3, 0 + bl sub_81B1C84 + b _081B467C + .pool +_081B4670: + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + ldrh r1, [r1] + movs r2, 0 + bl sub_81B1D68 +_081B467C: + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B469C + str r0, [r1] +_081B468A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4624 + + thumb_func_start sub_81B469C +sub_81B469C: @ 81B469C + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r4, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r6, r1, r0 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B471C + ldr r5, =gUnknown_0203CEDC + movs r0, 0x9 + ldrsb r0, [r4, r0] + lsls r0, 4 + ldr r1, [r5] + adds r1, r0 + adds r0, r6, 0 + bl sub_81B5C94 + ldrb r1, [r4, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0xC + bne _081B4716 + adds r0, r6, 0 + movs r1, 0xC + bl GetMonData + cmp r0, 0 + beq _081B4704 + movs r0, 0x9 + ldrsb r0, [r4, r0] + lsls r0, 4 + ldr r1, [r5] + adds r1, r0 + movs r0, 0xB + movs r2, 0x1 + bl sub_81B2FA8 + b _081B4716 + .pool +_081B4704: + movs r0, 0x9 + ldrsb r0, [r4, r0] + lsls r0, 4 + ldr r1, [r5] + adds r1, r0 + movs r0, 0xC + movs r2, 0x1 + bl sub_81B2FA8 +_081B4716: + adds r0, r7, 0 + bl sub_81B1C1C +_081B471C: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B469C + + thumb_func_start sub_81B4724 +sub_81B4724: @ 81B4724 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r6, r0, 16 + movs r0, 0x5 + bl PlaySE + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + adds r0, r5, 0 + bl sub_81B1E00 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _081B4788 + cmp r0, 0x1 + beq _081B47AC + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0x1 + bl sub_81B1CD0 + b _081B47BA + .pool +_081B4788: + ldr r1, =gStringVar1 + adds r0, r5, 0 + bl GetMonNickname + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9980 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + b _081B47B4 + .pool +_081B47AC: + adds r0, r6, 0 + bl pokemon_item_not_removed + ldr r0, =gStringVar4 +_081B47B4: + movs r1, 0x1 + bl sub_81B1B5C +_081B47BA: + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, =gTasks + lsls r1, r7, 2 + adds r1, r7 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B469C + str r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4724 + + thumb_func_start sub_81B47E0 +sub_81B47E0: @ 81B47E0 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r7, r1, r0 + adds r0, r7, 0 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r5, r0, 16 + movs r0, 0x5 + bl PlaySE + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + cmp r5, 0 + bne _081B4864 + ldr r1, =gStringVar1 + adds r0, r7, 0 + bl GetMonNickname + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9980 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B469C + b _081B488A + .pool +_081B4864: + ldr r1, =gStringVar1 + adds r0, r5, 0 + bl CopyItemName + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9E00 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B48A8 +_081B488A: + str r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B47E0 + + thumb_func_start sub_81B48A8 +sub_81B48A8: @ 81B48A8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B48CC + bl sub_81B334C + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B48DC + str r0, [r1] +_081B48CC: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B48A8 + + thumb_func_start sub_81B48DC +sub_81B48DC: @ 81B48DC + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r4, r1, r0 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B491A + cmp r1, 0 + bgt _081B4914 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B4964 + b _081B4978 + .pool +_081B4914: + cmp r1, 0x1 + beq _081B496A + b _081B4978 +_081B491A: + adds r0, r4, 0 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + ldr r1, =gStringVar1 + bl CopyItemName + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9E14 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B4988 + str r1, [r0] + b _081B4978 + .pool +_081B4964: + movs r0, 0x5 + bl PlaySE +_081B496A: + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B1C1C + str r0, [r1] +_081B4978: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B48DC + + thumb_func_start sub_81B4988 +sub_81B4988: @ 81B4988 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r6, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r6, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B49EC + movs r1, 0 + mov r0, sp + strh r1, [r0] + adds r0, r5, 0 + movs r1, 0xC + mov r2, sp + bl SetMonData + ldr r4, =gUnknown_0203CEDC + movs r0, 0x9 + ldrsb r0, [r6, r0] + lsls r0, 4 + ldr r1, [r4] + adds r1, r0 + adds r0, r5, 0 + bl sub_81B5C94 + movs r0, 0x9 + ldrsb r0, [r6, r0] + lsls r0, 4 + ldr r1, [r4] + adds r1, r0 + movs r0, 0xC + movs r2, 0x1 + bl sub_81B2FA8 + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1C1C + str r1, [r0] +_081B49EC: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4988 + + thumb_func_start sub_81B4A08 +sub_81B4A08: @ 81B4A08 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + movs r0, 0x5 + bl PlaySE + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + ldr r0, =gPlayerParty + ldr r1, =gUnknown_0203CEC8 + ldrb r1, [r1, 0x9] + movs r2, 0x9 + bl sub_81B33B4 + movs r0, 0x2 + bl sub_81B31B0 + movs r0, 0x19 + bl display_pokemon_menu_message + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0xFF + strh r1, [r0, 0x8] + ldr r1, =sub_81B3730 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4A08 + + thumb_func_start sub_81B4A6C +sub_81B4A6C: @ 81B4A6C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + ldr r0, =sub_81B4A98 + str r0, [r1, 0x4] + adds r0, r4, 0 + bl sub_81B12C0 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4A6C + + thumb_func_start sub_81B4A98 +sub_81B4A98: @ 81B4A98 + push {lr} + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x40 + bl GetMonData + ldr r2, =gSaveBlock1Ptr + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x00002be0 + adds r1, r0 + ldr r0, [r2] + adds r0, r1 + ldr r1, =sub_81B4AE0 + movs r2, 0x1 + bl sub_8121478 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4A98 + + thumb_func_start sub_81B4AE0 +sub_81B4AE0: @ 81B4AE0 + push {lr} + sub sp, 0xC + ldr r2, =gPaletteFade + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x8] + ldr r3, =gUnknown_0203CEC8 + ldrb r0, [r3, 0x8] + lsls r0, 28 + lsrs r0, 28 + ldrb r2, [r3, 0xB] + movs r1, 0x15 + str r1, [sp] + ldr r1, =sub_81B36FC + str r1, [sp, 0x4] + ldr r1, [r3] + str r1, [sp, 0x8] + movs r1, 0xFF + movs r3, 0x1 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4AE0 + + thumb_func_start brm_take_2 +brm_take_2: @ 81B4B20 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl PlaySE + ldr r5, =gUnknown_0203CEC4 + ldr r0, [r5] + adds r0, 0xD + bl sub_81B302C + ldr r0, [r5] + adds r0, 0xC + bl sub_81B302C + ldr r0, =gUnknown_085E9855 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B4B6C + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end brm_take_2 + + thumb_func_start sub_81B4B6C +sub_81B4B6C: @ 81B4B6C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B4B90 + bl sub_81B334C + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B4BA0 + str r0, [r1] +_081B4B90: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4B6C + + thumb_func_start sub_81B4BA0 +sub_81B4BA0: @ 81B4BA0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B4BC6 + cmp r1, 0 + bgt _081B4BC0 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B4C30 + b _081B4C4C +_081B4BC0: + cmp r1, 0x1 + beq _081B4C36 + b _081B4C4C +_081B4BC6: + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + bl sub_80D4700 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _081B4C0C + ldr r0, =gUnknown_085E9877 + movs r1, 0 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B469C + b _081B4C4A + .pool +_081B4C0C: + ldr r0, =gUnknown_085E9897 + movs r1, 0 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1C1C + b _081B4C4A + .pool +_081B4C30: + movs r0, 0x5 + bl PlaySE +_081B4C36: + ldr r0, =gUnknown_085E98B4 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B4C60 +_081B4C4A: + str r1, [r0] +_081B4C4C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4BA0 + + thumb_func_start sub_81B4C60 +sub_81B4C60: @ 81B4C60 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B4C84 + bl sub_81B334C + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B4C94 + str r0, [r1] +_081B4C84: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4C60 + + thumb_func_start sub_81B4C94 +sub_81B4C94: @ 81B4C94 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B4CBE + cmp r1, 0 + bgt _081B4CB8 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B4D50 + b _081B4D64 +_081B4CB8: + cmp r1, 0x1 + beq _081B4D56 + b _081B4D64 +_081B4CBE: + ldr r0, =gUnknown_0203CEC8 + mov r8, r0 + ldrb r0, [r0, 0x9] + lsls r0, 24 + asrs r0, 24 + movs r7, 0x64 + muls r0, r7 + ldr r6, =gPlayerParty + adds r0, r6 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + movs r1, 0x1 + bl AddBagItem + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B4D24 + mov r1, r8 + movs r0, 0x9 + ldrsb r0, [r1, r0] + muls r0, r7 + adds r0, r6 + bl sub_80D4680 + ldr r0, =gUnknown_085E99B8 + movs r1, 0 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B469C + str r1, [r0] + b _081B4D64 + .pool +_081B4D24: + adds r0, r4, 0 + bl pokemon_item_not_removed + ldr r0, =gStringVar4 + movs r1, 0 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1C1C + str r1, [r0] + b _081B4D64 + .pool +_081B4D50: + movs r0, 0x5 + bl PlaySE +_081B4D56: + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B1C1C + str r0, [r1] +_081B4D64: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4C94 + + thumb_func_start sub_81B4D78 +sub_81B4D78: @ 81B4D78 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r5, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r5, r1] + movs r0, 0x64 + muls r0, r1 + ldr r6, =gPlayerParty + adds r7, r0, r6 + movs r0, 0x5 + bl PlaySE + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + ldrb r4, [r5, 0x9] + adds r0, r7, 0 + bl sub_81B353C + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_81B33B4 + ldrb r1, [r5, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0xC + beq _081B4DE4 + movs r0, 0 + bl sub_81B31B0 + movs r0, 0x15 + bl display_pokemon_menu_message + b _081B4E02 + .pool +_081B4DE4: + movs r0, 0x1 + bl sub_81B31B0 + adds r0, r7, 0 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + ldr r1, =gStringVar2 + bl CopyItemName + movs r0, 0x1A + bl display_pokemon_menu_message +_081B4E02: + ldr r1, =gTasks + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0xFF + strh r1, [r0, 0x8] + ldr r1, =sub_81B3730 + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4D78 + + thumb_func_start brm_shift_sendout +brm_shift_sendout: @ 81B4E2C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x5 + bl PlaySE + ldr r5, =gUnknown_0203CEC4 + ldr r0, [r5] + adds r0, 0xC + bl sub_81B302C + bl sub_81B8A7C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B4E5C + adds r0, r4, 0 + bl sub_81B12C0 + b _081B4E7A + .pool +_081B4E5C: + ldr r0, [r5] + adds r0, 0xD + bl sub_81B302C + ldr r0, =gStringVar4 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1C1C + str r1, [r0] +_081B4E7A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end brm_shift_sendout + + thumb_func_start sub_81B4E8C +sub_81B4E8C: @ 81B4E8C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + bl sub_81B8830 + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + cmp r5, r6 + bcs _081B4F36 + ldr r2, =gUnknown_0203CEC8 + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + mov r8, r0 +_081B4EC6: + ldr r0, =gUnknown_0203CEF8 + adds r4, r5, r0 + ldrb r0, [r4] + cmp r0, 0 + bne _081B4F2C + movs r0, 0x5 + str r2, [sp] + bl PlaySE + ldr r2, [sp] + ldrb r0, [r2, 0x9] + adds r0, 0x1 + strb r0, [r4] + adds r0, r5, 0x2 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0203CEDC + ldrb r2, [r2, 0x9] + lsls r2, 24 + asrs r2, 24 + lsls r2, 4 + ldr r1, [r1] + adds r1, r2 + movs r2, 0x1 + bl sub_81B2FA8 + subs r0, r6, 0x1 + cmp r5, r0 + bne _081B4F04 + bl sub_81B4F88 +_081B4F04: + movs r0, 0 + bl display_pokemon_menu_message + ldr r0, =sub_81B1370 + mov r1, r8 + str r0, [r1] + b _081B4F68 + .pool +_081B4F2C: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, r6 + bcc _081B4EC6 +_081B4F36: + ldr r0, =gStringVar1 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0x1 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9830 + adds r0, r4, 0 + bl StringExpandPlaceholders + movs r0, 0x20 + bl PlaySE + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1C1C + str r1, [r0] +_081B4F68: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4E8C + + thumb_func_start sub_81B4F88 +sub_81B4F88: @ 81B4F88 + push {r4,lr} + ldr r4, =gUnknown_0203CEC8 + ldrb r0, [r4, 0x9] + movs r1, 0 + bl sub_81B0FCC + movs r0, 0x6 + strb r0, [r4, 0x9] + movs r1, 0x1 + bl sub_81B0FCC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4F88 + + thumb_func_start sub_81B4FA8 +sub_81B4FA8: @ 81B4FA8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r0, 0x5 + bl PlaySE + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + bl sub_81B8830 + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + cmp r4, r5 + bcs _081B502A + ldr r6, =gUnknown_0203CEF8 + subs r2, r5, 0x1 + adds r7, r6, 0 + ldr r3, =gUnknown_0203CEC8 +_081B4FE2: + adds r0, r4, r6 + ldrb r1, [r0] + movs r0, 0x9 + ldrsb r0, [r3, r0] + adds r0, 0x1 + cmp r1, r0 + bne _081B5020 + adds r0, r4, 0 + adds r4, r2, 0 + cmp r0, r4 + bge _081B500C + adds r3, r7, 0 +_081B4FFA: + adds r2, r0, r3 + adds r1, r0, 0x1 + adds r0, r1, r3 + ldrb r0, [r0] + strb r0, [r2] + lsls r1, 24 + lsrs r0, r1, 24 + cmp r0, r4 + blt _081B4FFA +_081B500C: + adds r1, r0, r6 + movs r0, 0 + strb r0, [r1] + b _081B502A + .pool +_081B5020: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcc _081B4FE2 +_081B502A: + ldr r6, =gUnknown_0203CEDC + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0x9] + lsls r0, 24 + asrs r0, 24 + lsls r0, 4 + ldr r1, [r6] + adds r1, r0 + movs r0, 0x1 + movs r2, 0x1 + bl sub_81B2FA8 + movs r4, 0 + subs r5, 0x1 + mov r0, r8 + lsls r7, r0, 2 + cmp r4, r5 + bge _081B5078 +_081B504E: + ldr r0, =gUnknown_0203CEF8 + adds r1, r4, r0 + ldrb r0, [r1] + cmp r0, 0 + beq _081B506E + adds r0, r4, 0x2 + lsls r0, 24 + lsrs r0, 24 + ldrb r2, [r1] + lsls r2, 4 + subs r2, 0x10 + ldr r1, [r6] + adds r1, r2 + movs r2, 0x1 + bl sub_81B2FA8 +_081B506E: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + blt _081B504E +_081B5078: + movs r0, 0 + bl display_pokemon_menu_message + ldr r0, =gTasks + mov r2, r8 + adds r1, r7, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B1370 + str r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B4FA8 + + thumb_func_start sub_81B50AC +sub_81B50AC: @ 81B50AC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl PlaySE + adds r0, r4, 0 + bl sub_81B12C0 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B50AC + + thumb_func_start sub_81B50C8 +sub_81B50C8: @ 81B50C8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =gUnknown_0203CEC8 + mov r9, r0 + ldrb r0, [r0, 0x9] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x64 + mov r8, r1 + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + ldr r4, =gPlayerParty + adds r0, r4 + movs r1, 0x41 + bl GetMonData + adds r6, r0, 0 + lsls r6, 16 + lsrs r6, 16 + mov r1, r9 + movs r0, 0x9 + ldrsb r0, [r1, r0] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r4 + movs r1, 0xB + bl GetMonData + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + mov r1, r9 + movs r0, 0x9 + ldrsb r0, [r1, r0] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r4 + movs r1, 0x50 + bl GetMonData + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_800F7DC + ldr r0, [r0] + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_807A8D0 + cmp r0, 0x1 + beq _081B515C + cmp r0, 0x2 + beq _081B5170 + movs r0, 0x5 + bl PlaySE + adds r0, r7, 0 + bl sub_81B12C0 + b _081B51B0 + .pool +_081B515C: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EA210 + bl StringExpandPlaceholders + b _081B5178 + .pool +_081B5170: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EA234 + bl StringExpandPlaceholders +_081B5178: + movs r0, 0x20 + bl PlaySE + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EA1CA + adds r0, r4, 0 + bl StringAppend + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1C1C + str r1, [r0] +_081B51B0: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B50C8 + + thumb_func_start brm_trade_1 +brm_trade_1: @ 81B51D4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =gUnknown_0203CEC8 + mov r8, r0 + ldrb r0, [r0, 0x9] + lsls r0, 24 + asrs r0, 24 + movs r6, 0x64 + muls r0, r6 + ldr r4, =gPlayerParty + adds r0, r4 + movs r1, 0x41 + bl GetMonData + mov r9, r0 + mov r1, r9 + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + mov r1, r8 + movs r0, 0x9 + ldrsb r0, [r1, r0] + muls r0, r6 + adds r0, r4 + movs r1, 0xB + bl GetMonData + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + mov r1, r8 + movs r0, 0x9 + ldrsb r0, [r1, r0] + muls r0, r6 + adds r0, r4 + movs r1, 0x50 + bl GetMonData + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_800F7DC + ldr r0, [r0] + ldr r1, =gUnknown_02022C38 + ldr r1, [r1] + ldr r2, =gUnknown_02022C3C + ldrh r3, [r2] + ldr r2, =gUnknown_02022C3E + ldrb r2, [r2] + str r2, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + mov r2, r9 + bl sub_807A7E0 + cmp r0, 0 + beq _081B52C8 + ldr r5, =gStringVar4 + ldr r1, =gUnknown_08615E0C + subs r0, 0x1 + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r5, 0 + bl StringExpandPlaceholders + movs r0, 0x20 + bl PlaySE + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + ldr r1, =gUnknown_085EA1CA + adds r0, r5, 0 + bl StringAppend + adds r0, r5, 0 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1C1C + str r1, [r0] + b _081B52D4 + .pool +_081B52C8: + movs r0, 0x5 + bl PlaySE + adds r0, r7, 0 + bl sub_81B12C0 +_081B52D4: + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end brm_trade_1 + + thumb_func_start sub_81B52E4 +sub_81B52E4: @ 81B52E4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + ldr r0, =gPlayerParty + ldr r1, =gUnknown_0203CEC8 + ldrb r1, [r1, 0x9] + lsls r1, 24 + asrs r1, 24 + lsls r1, 16 + lsrs r1, 16 + bl sub_807A918 + cmp r0, 0x2 + beq _081B5340 + cmp r0, 0x2 + bgt _081B5328 + cmp r0, 0x1 + beq _081B532E + b _081B5368 + .pool +_081B5328: + cmp r0, 0x3 + beq _081B5354 + b _081B5368 +_081B532E: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EA1E8 + bl StringExpandPlaceholders + b _081B53C0 + .pool +_081B5340: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EA210 + bl StringExpandPlaceholders + b _081B53C0 + .pool +_081B5354: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EA234 + bl StringExpandPlaceholders + b _081B53C0 + .pool +_081B5368: + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gStringVar1 + bl GetMonNickname + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EA1CD + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B53FC + b _081B53E4 + .pool +_081B53C0: + movs r0, 0x20 + bl PlaySE + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085EA1CA + adds r0, r4, 0 + bl StringAppend + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1C1C +_081B53E4: + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B52E4 + + thumb_func_start sub_81B53FC +sub_81B53FC: @ 81B53FC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B5420 + bl sub_81B334C + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B5430 + str r0, [r1] +_081B5420: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B53FC + + thumb_func_start sub_81B5430 +sub_81B5430: @ 81B5430 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B5456 + cmp r1, 0 + bgt _081B5450 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B545E + b _081B546A +_081B5450: + cmp r1, 0x1 + beq _081B5464 + b _081B546A +_081B5456: + adds r0, r4, 0 + bl sub_81B12C0 + b _081B546A +_081B545E: + movs r0, 0x5 + bl PlaySE +_081B5464: + adds r0, r4, 0 + bl sub_81B1C1C +_081B546A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B5430 + + thumb_func_start sub_81B5470 +sub_81B5470: @ 81B5470 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + bl GetMenuCursorPos + ldr r5, =gUnknown_0203CEC4 + ldr r1, [r5] + lsls r0, 24 + lsrs r0, 24 + adds r1, 0xF + adds r1, r0 + ldrb r0, [r1] + subs r0, 0x13 + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x5 + bl PlaySE + ldr r1, =gUnknown_08615D9C + lsls r0, r4, 3 + adds r7, r0, r1 + ldr r0, [r7] + cmp r0, 0 + bne _081B54A2 + b _081B5664 +_081B54A2: + ldr r0, [r5] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r5] + adds r0, 0xD + bl sub_81B302C + bl sub_81221AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B54C6 + bl InUnionRoom + cmp r0, 0x1 + bne _081B54E8 +_081B54C6: + adds r0, r4, 0 + subs r0, 0xB + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _081B54E4 + movs r0, 0xD + bl display_pokemon_menu_message + b _081B5656 + .pool +_081B54E4: + ldrb r0, [r7, 0x4] + b _081B5652 +_081B54E8: + cmp r4, 0x7 + bhi _081B5524 + ldr r1, =0x00000867 + adds r0, r4, r1 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B5524 + ldr r0, =gUnknown_085E97FC + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1C1C + str r1, [r0] + b _081B5664 + .pool +_081B5524: + ldr r1, =gUnknown_08615D9C + lsls r0, r4, 3 + adds r5, r0, r1 + ldr r0, [r5] + bl _call_via_r0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B553A + b _081B563C +_081B553A: + subs r0, r4, 0x5 + cmp r0, 0x7 + bhi _081B5624 + lsls r0, 2 + ldr r1, =_081B5554 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081B5554: + .4byte _081B5614 + .4byte _081B5624 + .4byte _081B5624 + .4byte _081B557C + .4byte _081B55B8 + .4byte _081B5624 + .4byte _081B5574 + .4byte _081B5574 +_081B5574: + adds r0, r6, 0 + bl sub_8161560 + b _081B5664 +_081B557C: + ldr r0, =gSaveBlock1Ptr + ldr r1, [r0] + movs r0, 0x1C + ldrsb r0, [r1, r0] + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r1, 0x1D] + lsls r1, 24 + asrs r1, 24 + lsls r1, 16 + lsrs r1, 16 + bl get_mapheader_by_bank_and_number + adds r1, r0, 0 + ldr r0, =gStringVar1 + ldrb r1, [r1, 0x14] + bl sub_81245DC + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EA196 + b _081B55E8 + .pool +_081B55B8: + ldr r0, =gSaveBlock1Ptr + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x24 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + lsls r0, 16 + lsrs r0, 16 + adds r1, 0x25 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + lsls r1, 16 + lsrs r1, 16 + bl get_mapheader_by_bank_and_number + adds r1, r0, 0 + ldr r0, =gStringVar1 + ldrb r1, [r1, 0x14] + bl sub_81245DC + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085EA16B +_081B55E8: + bl StringExpandPlaceholders + adds r0, r6, 0 + bl sub_81B5674 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + movs r1, 0x86 + lsls r1, 2 + adds r0, r1 + strh r4, [r0] + b _081B5664 + .pool +_081B5614: + ldr r1, =gUnknown_0203CEC8 + ldr r0, =sub_8124690 + b _081B5628 + .pool +_081B5624: + ldr r1, =gUnknown_0203CEC8 + ldr r0, =c2_exit_to_overworld_2_switch +_081B5628: + str r0, [r1] + adds r0, r6, 0 + bl sub_81B12C0 + b _081B5664 + .pool +_081B563C: + cmp r4, 0x1 + beq _081B564A + cmp r4, 0x4 + bne _081B5650 + bl sub_81B5864 + b _081B5656 +_081B564A: + bl sub_81B57DC + b _081B5656 +_081B5650: + ldrb r0, [r5, 0x4] +_081B5652: + bl display_pokemon_menu_message +_081B5656: + ldr r0, =gTasks + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, =task_brm_cancel_1_on_keypad_a_or_b + str r0, [r1] +_081B5664: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B5470 + + thumb_func_start sub_81B5674 +sub_81B5674: @ 81B5674 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gStringVar4 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B56A4 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B5674 + + thumb_func_start sub_81B56A4 +sub_81B56A4: @ 81B56A4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B56C8 + bl sub_81B334C + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B56D8 + str r0, [r1] +_081B56C8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B56A4 + + thumb_func_start sub_81B56D8 +sub_81B56D8: @ 81B56D8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B56FE + cmp r1, 0 + bgt _081B56F8 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B5714 + b _081B572A +_081B56F8: + cmp r1, 0x1 + beq _081B571A + b _081B572A +_081B56FE: + ldr r1, =gUnknown_0203CEC8 + ldr r0, =c2_exit_to_overworld_2_switch + str r0, [r1] + adds r0, r4, 0 + bl sub_81B12C0 + b _081B572A + .pool +_081B5714: + movs r0, 0x5 + bl PlaySE +_081B571A: + ldr r0, =gUnknown_03005DB0 + movs r1, 0 + str r1, [r0] + ldr r0, =gUnknown_0203CEEC + str r1, [r0] + adds r0, r4, 0 + bl sub_81B1C1C +_081B572A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B56D8 + + thumb_func_start hm_add_c3_launch_phase_2 +hm_add_c3_launch_phase_2: @ 81B5738 + push {lr} + bl pal_fill_black + ldr r0, =task_launch_hm_phase_2 + movs r1, 0x8 + bl CreateTask + movs r0, 0x1 + pop {r1} + bx r1 + .pool + thumb_func_end hm_add_c3_launch_phase_2 + + thumb_func_start task_launch_hm_phase_2 +task_launch_hm_phase_2: @ 81B5750 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80ABDFC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B577C + bl brm_get_selected_species + ldr r1, =gUnknown_02038C08 + lsls r0, 16 + lsrs r0, 16 + str r0, [r1] + ldr r0, =gUnknown_0203CEEC + ldr r0, [r0] + bl _call_via_r0 + adds r0, r4, 0 + bl DestroyTask +_081B577C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end task_launch_hm_phase_2 + + thumb_func_start brm_get_selected_species +brm_get_selected_species: @ 81B578C + push {lr} + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xB + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + .pool + thumb_func_end brm_get_selected_species + + thumb_func_start task_brm_cancel_1_on_keypad_a_or_b +task_brm_cancel_1_on_keypad_a_or_b: @ 81B57B4 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081B57CE + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081B57D4 +_081B57CE: + adds r0, r2, 0 + bl brm_cancel_1 +_081B57D4: + pop {r0} + bx r0 + .pool + thumb_func_end task_brm_cancel_1_on_keypad_a_or_b + + thumb_func_start sub_81B57DC +sub_81B57DC: @ 81B57DC + push {lr} + ldr r0, =0x00000888 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B57F8 + movs r0, 0xC + bl display_pokemon_menu_message + b _081B57FE + .pool +_081B57F8: + movs r0, 0xD + bl display_pokemon_menu_message +_081B57FE: + pop {r0} + bx r0 + thumb_func_end sub_81B57DC + + thumb_func_start hm_surf_run_dp02scr +hm_surf_run_dp02scr: @ 81B5804 + push {lr} + bl brm_get_pokemon_selection + ldr r1, =gUnknown_02038C08 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + movs r0, 0x9 + bl FieldEffectStart + pop {r0} + bx r0 + .pool + thumb_func_end hm_surf_run_dp02scr + + thumb_func_start sub_81B5820 +sub_81B5820: @ 81B5820 + push {lr} + bl PartyHasMonWithSurf + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B585C + bl IsPlayerFacingSurfableFishableWater + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B585C + ldr r1, =gUnknown_03005DB0 + ldr r0, =hm_add_c3_launch_phase_2 + str r0, [r1] + ldr r1, =gUnknown_0203CEEC + ldr r0, =hm_surf_run_dp02scr + str r0, [r1] + movs r0, 0x1 + b _081B585E + .pool +_081B585C: + movs r0, 0 +_081B585E: + pop {r1} + bx r1 + thumb_func_end sub_81B5820 + + thumb_func_start sub_81B5864 +sub_81B5864: @ 81B5864 + push {lr} + movs r0, 0x8 + bl TestPlayerAvatarFlags + lsls r0, 24 + cmp r0, 0 + beq _081B587A + movs r0, 0x9 + bl display_pokemon_menu_message + b _081B5880 +_081B587A: + movs r0, 0x8 + bl display_pokemon_menu_message +_081B5880: + pop {r0} + bx r0 + thumb_func_end sub_81B5864 + + thumb_func_start sub_81B5884 +sub_81B5884: @ 81B5884 + push {lr} + ldr r0, =gUnknown_02037318 + ldrb r0, [r0, 0x17] + bl is_light_level_1_2_3_or_6 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B58A0 + movs r0, 0 + b _081B58A2 + .pool +_081B58A0: + movs r0, 0x1 +_081B58A2: + pop {r1} + bx r1 + thumb_func_end sub_81B5884 + + thumb_func_start sub_81B58A8 +sub_81B58A8: @ 81B58A8 + push {lr} + sub sp, 0xC + movs r0, 0 + str r0, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + ldr r0, =sub_8086194 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B58A8 + + thumb_func_start hm2_waterfall +hm2_waterfall: @ 81B58D4 + push {lr} + bl brm_get_pokemon_selection + ldr r1, =gUnknown_02038C08 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + movs r0, 0x2B + bl FieldEffectStart + pop {r0} + bx r0 + .pool + thumb_func_end hm2_waterfall + + thumb_func_start hm_prepare_waterfall +hm_prepare_waterfall: @ 81B58F0 + push {r4,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl GetXYCoordsOneStepInFrontOfPlayer + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl MetatileBehavior_IsWaterfall + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B594C + bl IsPlayerSurfingNorth + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B594C + ldr r1, =gUnknown_03005DB0 + ldr r0, =hm_add_c3_launch_phase_2 + str r0, [r1] + ldr r1, =gUnknown_0203CEEC + ldr r0, =hm2_waterfall + str r0, [r1] + movs r0, 0x1 + b _081B594E + .pool +_081B594C: + movs r0, 0 +_081B594E: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end hm_prepare_waterfall + + thumb_func_start sub_81B5958 +sub_81B5958: @ 81B5958 + push {lr} + bl brm_get_pokemon_selection + ldr r1, =gUnknown_02038C08 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + movs r0, 0x2C + bl FieldEffectStart + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B5958 + + thumb_func_start sub_81B5974 +sub_81B5974: @ 81B5974 + push {lr} + bl sub_809D1E8 + ldr r1, =gUnknown_02038C08 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1, 0x4] + cmp r0, 0 + bne _081B5990 + movs r0, 0 + b _081B599E + .pool +_081B5990: + ldr r1, =gUnknown_03005DB0 + ldr r0, =hm_add_c3_launch_phase_2 + str r0, [r1] + ldr r1, =gUnknown_0203CEEC + ldr r0, =sub_81B5958 + str r0, [r1] + movs r0, 0x1 +_081B599E: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B5974 + + 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 + adds r7, r1, 0 + adds r4, r2, 0 + movs r6, 0x1 + bl sub_81B1250 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B59EA + ldr r0, =gMain + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081B59EA + ldr r0, =gUnknown_08616020 + adds r0, r4, r0 + ldrb r1, [r0] + eors r1, r6 + negs r0, r1 + orrs r0, r1 + lsrs r6, r0, 31 +_081B59EA: + adds r0, r5, 0 + movs r1, 0x41 + bl GetMonData + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0 + bl GetMonData + adds r1, r0, 0 + str r6, [sp] + adds r0, r4, 0 + adds r2, r7, 0 + movs r3, 0x1 + bl party_menu_link_mon_icon_anim + ldrb r0, [r7, 0x9] + adds r1, r5, 0 + bl sub_81B5B38 + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end party_menu_icon_anim + + 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 + adds r4, r2, 0 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r3, 24 + lsrs r7, r3, 24 + cmp r5, 0 + beq _081B5A7A + ldr r1, =sub_80D3014 + ldr r0, [r4, 0x4] + ldrb r2, [r0] + ldrb r3, [r0, 0x1] + movs r0, 0x4 + str r0, [sp] + str r6, [sp, 0x4] + ldr r0, [sp, 0x20] + str r0, [sp, 0x8] + adds r0, r5, 0 + bl sub_80D2CC4 + strb r0, [r4, 0x9] + ldr r2, =gSprites + ldrb r0, [r4, 0x9] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x3 + adds r2, r7, 0 + ands r2, r0 + lsls r2, 2 + ldrb r3, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0x5] +_081B5A7A: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end party_menu_link_mon_icon_anim + + thumb_func_start sub_81B5A8C +sub_81B5A8C: @ 81B5A8C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 16 + asrs r1, 16 + lsls r2, 16 + asrs r2, 16 + adds r0, r1, 0 + adds r1, r2, 0 + bl sub_8075060 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _081B5AEC + cmp r0, 0x2 + bgt _081B5AB4 + cmp r0, 0x1 + beq _081B5B04 + b _081B5B1C +_081B5AB4: + cmp r0, 0x3 + beq _081B5AD4 + cmp r0, 0x4 + bne _081B5B1C + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + movs r1, 0 + bl sub_80D32C8 + b _081B5B2C + .pool +_081B5AD4: + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + movs r1, 0x1 + bl sub_80D32C8 + b _081B5B2C + .pool +_081B5AEC: + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + movs r1, 0x2 + bl sub_80D32C8 + b _081B5B2C + .pool +_081B5B04: + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + movs r1, 0x3 + bl sub_80D32C8 + b _081B5B2C + .pool +_081B5B1C: + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + movs r1, 0x4 + bl sub_80D32C8 +_081B5B2C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B5A8C + + thumb_func_start sub_81B5B38 +sub_81B5B38: @ 81B5B38 + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + lsls r5, 24 + lsrs r5, 24 + adds r0, r6, 0 + movs r1, 0x39 + bl GetMonData + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r6, 0 + movs r1, 0x3A + bl GetMonData + adds r2, r0, 0 + lsls r2, 16 + lsrs r2, 16 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81B5A8C + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81B5B38 + + thumb_func_start sub_81B5B6C +sub_81B5B6C: @ 81B5B6C + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + ldr r5, =gSprites + lsls r0, r4, 4 + adds r0, r4 + lsls r6, r0, 2 + adds r2, r6, r5 + movs r7, 0 + movs r3, 0 + strh r3, [r2, 0x2E] + mov r12, r5 + cmp r1, 0 + bne _081B5BC4 + movs r1, 0x20 + ldrsh r0, [r2, r1] + cmp r0, 0x10 + bne _081B5BA4 + strh r3, [r2, 0x24] + ldr r0, =0x0000fffc + strh r0, [r2, 0x26] + b _081B5BAA + .pool +_081B5BA4: + ldr r0, =0x0000fffc + strh r0, [r2, 0x24] + strh r3, [r2, 0x26] +_081B5BAA: + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + mov r1, r12 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_81B5C08 + b _081B5BD0 + .pool +_081B5BC4: + strh r3, [r2, 0x24] + strh r3, [r2, 0x26] + adds r0, r5, 0 + adds r0, 0x1C + adds r0, r6, r0 + ldr r1, =sub_81B5BDC +_081B5BD0: + str r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B5B6C + + thumb_func_start sub_81B5BDC +sub_81B5BDC: @ 81B5BDC + push {r4,lr} + adds r4, r0, 0 + bl sub_80D30DC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _081B5C02 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081B5C00 + ldr r0, =0x0000fffd + strh r0, [r4, 0x26] + b _081B5C02 + .pool +_081B5C00: + strh r1, [r4, 0x26] +_081B5C02: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B5BDC + + thumb_func_start sub_81B5C08 +sub_81B5C08: @ 81B5C08 + push {lr} + bl sub_80D30DC + pop {r0} + bx r0 + thumb_func_end sub_81B5C08 + + 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 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B5C3C + ldr r0, =gUnknown_08615EC0 + ldr r2, [r4, 0x4] + ldrb r1, [r2, 0x2] + ldrb r2, [r2, 0x3] + movs r3, 0 + bl CreateSprite + strb r0, [r4, 0xA] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81B5C94 +_081B5C3C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end party_menu_held_item_object + + 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 + lsls r1, 16 + lsrs r5, r1, 16 + cmp r0, 0 + beq _081B5C84 + ldr r0, =gUnknown_08615EC0 + ldr r2, [r4, 0x4] + ldrb r1, [r2, 0x2] + ldrb r2, [r2, 0x3] + movs r3, 0 + bl CreateSprite + strb r0, [r4, 0xA] + ldr r2, =gSprites + ldrb r0, [r4, 0xA] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x5] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81B5CB0 +_081B5C84: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end party_menu_link_mon_held_item_object + + thumb_func_start sub_81B5C94 +sub_81B5C94: @ 81B5C94 + push {r4,lr} + adds r4, r1, 0 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl sub_81B5CB0 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B5C94 + + thumb_func_start sub_81B5CB0 +sub_81B5CB0: @ 81B5CB0 + push {r4,lr} + adds r4, r1, 0 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + bne _081B5CD8 + ldr r2, =gSprites + ldrb r1, [r4, 0xA] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + b _081B5D24 + .pool +_081B5CD8: + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _081B5CFC + ldrb r1, [r4, 0xA] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + movs r1, 0x1 + bl StartSpriteAnim + b _081B5D0E + .pool +_081B5CFC: + ldrb r1, [r4, 0xA] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gSprites + adds r0, r1 + movs r1, 0 + bl StartSpriteAnim +_081B5D0E: + ldr r2, =gSprites + ldrb r1, [r4, 0xA] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 +_081B5D24: + strb r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B5CB0 + + thumb_func_start sub_81B5D30 +sub_81B5D30: @ 81B5D30 + push {lr} + ldr r0, =gUnknown_08615EB0 + bl LoadSpriteSheet + ldr r0, =gUnknown_08615EB8 + bl LoadSpritePalette + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B5D30 + + thumb_func_start sub_81B5D4C +sub_81B5D4C: @ 81B5D4C + push {r4-r7,lr} + adds r6, r0, 0 + adds r7, r1, 0 + lsls r2, 24 + lsrs r2, 24 + cmp r2, 0 + beq _081B5D60 + cmp r2, 0x1 + beq _081B5DA8 + b _081B5DE4 +_081B5D60: + movs r5, 0 + ldrb r0, [r6] + cmp r5, r0 + bcs _081B5DE4 +_081B5D68: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _081B5D94 + adds r0, r7, r5 + ldrb r4, [r0] + adds r0, r1, 0 + bl itemid_is_mail + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_81B5DF0 +_081B5D94: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + ldrb r0, [r6] + cmp r5, r0 + bcc _081B5D68 + b _081B5DE4 + .pool +_081B5DA8: + movs r5, 0 + b _081B5DDE +_081B5DAC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gEnemyParty + adds r0, r1 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _081B5DD8 + adds r0, r5, r7 + ldrb r4, [r0, 0x6] + adds r0, r1, 0 + bl itemid_is_mail + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_81B5DF0 +_081B5DD8: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_081B5DDE: + ldrb r0, [r6, 0x1] + cmp r5, r0 + bcc _081B5DAC +_081B5DE4: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B5D4C + + thumb_func_start sub_81B5DF0 +sub_81B5DF0: @ 81B5DF0 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + adds r6, r0, 0 + mov r9, r1 + lsls r6, 24 + lsrs r6, 24 + mov r0, r9 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r0, =gSprites + mov r8, r0 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + add r0, r8 + adds r0, 0x43 + ldrb r3, [r0] + ldr r0, =gUnknown_08615EC0 + subs r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + movs r1, 0xFA + movs r2, 0xAA + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + mov r0, r8 + adds r5, r4, r0 + movs r0, 0x4 + strh r0, [r5, 0x24] + movs r0, 0xA + strh r0, [r5, 0x26] + movs r0, 0x1C + add r8, r0 + add r4, r8 + ldr r0, =sub_81B5E74 + str r0, [r4] + strh r6, [r5, 0x3C] + adds r0, r5, 0 + mov r1, r9 + bl StartSpriteAnim + ldr r1, [r4] + adds r0, r5, 0 + bl _call_via_r1 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B5DF0 + + thumb_func_start sub_81B5E74 +sub_81B5E74: @ 81B5E74 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x3C] + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gSprites + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, r0, r2 + adds r0, r2, 0 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + bge _081B5EA8 + adds r0, r4, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + b _081B5EC6 + .pool +_081B5EA8: + adds r3, r4, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r3] + ldrh r0, [r2, 0x24] + ldrh r1, [r2, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r2, 0x26] + ldrh r2, [r2, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] +_081B5EC6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B5E74 + + thumb_func_start party_menu_pokeball_object +party_menu_pokeball_object: @ 81B5ECC + push {r4,lr} + adds r4, r1, 0 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B5EEA + ldr r0, =gUnknown_08615F08 + ldr r2, [r4, 0x4] + ldrb r1, [r2, 0x6] + ldrb r2, [r2, 0x7] + movs r3, 0x8 + bl CreateSprite + strb r0, [r4, 0xB] +_081B5EEA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end party_menu_pokeball_object + + 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 + cmp r0, 0 + beq _081B5F24 + ldr r0, =gUnknown_08615F08 + ldr r2, [r4, 0x4] + ldrb r1, [r2, 0x6] + ldrb r2, [r2, 0x7] + movs r3, 0x8 + bl CreateSprite + strb r0, [r4, 0xB] + ldr r2, =gSprites + ldrb r0, [r4, 0xB] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x5] +_081B5F24: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end party_menu_link_mon_pokeball_object + + thumb_func_start sub_81B5F34 +sub_81B5F34: @ 81B5F34 + push {lr} + adds r3, r0, 0 + adds r2, r1, 0 + lsls r3, 24 + lsrs r3, 24 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =gUnknown_08615F08 + adds r1, r3, 0 + movs r3, 0x8 + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gSprites + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r3, [r1, 0x5] + movs r2, 0xD + negs r2, r2 + ands r2, r3 + movs r3, 0x8 + orrs r2, r3 + strb r2, [r1, 0x5] + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B5F34 + + thumb_func_start sub_81B5F74 +sub_81B5F74: @ 81B5F74 + push {lr} + adds r3, r0, 0 + adds r2, r1, 0 + lsls r3, 24 + lsrs r3, 24 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =gUnknown_08615F78 + adds r1, r3, 0 + movs r3, 0x8 + bl CreateSprite + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B5F74 + + thumb_func_start sub_81B5F98 +sub_81B5F98: @ 81B5F98 + push {lr} + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + ldr r2, =gSprites + adds r0, r2 + bl StartSpriteAnim + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B5F98 + + thumb_func_start sub_81B5FBC +sub_81B5FBC: @ 81B5FBC + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r6, r2, 24 + cmp r6, 0 + bne _081B6000 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =gSprites + mov r8, r0 + add r4, r8 + adds r0, r4, 0 + movs r1, 0x2 + bl StartSpriteAnim + lsls r5, r7, 4 + adds r5, r7 + lsls r5, 2 + add r5, r8 + adds r0, r5, 0 + movs r1, 0x4 + bl StartSpriteAnim + strh r6, [r4, 0x26] + strh r6, [r5, 0x26] + b _081B602C + .pool +_081B6000: + lsls r5, r0, 4 + adds r5, r0 + lsls r5, 2 + ldr r0, =gSprites + mov r8, r0 + add r5, r8 + adds r0, r5, 0 + movs r1, 0x3 + bl StartSpriteAnim + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + add r4, r8 + adds r0, r4, 0 + movs r1, 0x5 + bl StartSpriteAnim + ldr r0, =0x0000fffc + strh r0, [r5, 0x26] + movs r0, 0x4 + strh r0, [r4, 0x26] +_081B602C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B5FBC + + thumb_func_start sub_81B6040 +sub_81B6040: @ 81B6040 + push {lr} + ldr r0, =gUnknown_08615EF8 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_08615F70 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_08615F00 + bl LoadCompressedObjectPalette + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B6040 + + 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 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B608C + ldr r0, =gUnknown_08616008 + ldr r2, [r4, 0x4] + ldrb r1, [r2, 0x4] + ldrb r2, [r2, 0x5] + movs r3, 0 + bl CreateSprite + strb r0, [r4, 0xC] + adds r0, r5, 0 + adds r1, r4, 0 + bl party_menu_get_status_condition_and_update_object +_081B608C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end party_menu_status_condition_object + + 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 + lsls r1, 24 + lsrs r5, r1, 24 + cmp r0, 0 + beq _081B60D4 + ldr r0, =gUnknown_08616008 + ldr r2, [r4, 0x4] + ldrb r1, [r2, 0x4] + ldrb r2, [r2, 0x5] + movs r3, 0 + bl CreateSprite + strb r0, [r4, 0xC] + adds r0, r5, 0 + adds r1, r4, 0 + bl party_menu_update_status_condition_object + ldr r2, =gSprites + ldrb r0, [r4, 0xC] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x5] +_081B60D4: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end party_menu_link_mon_status_condition_object + + 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 party_menu_update_status_condition_object + pop {r4} + pop {r0} + bx r0 + thumb_func_end party_menu_get_status_condition_and_update_object + + 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 + lsrs r2, r0, 24 + cmp r2, 0 + beq _081B610C + cmp r2, 0x6 + bne _081B6128 +_081B610C: + ldr r2, =gSprites + ldrb r1, [r5, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + b _081B6152 + .pool +_081B6128: + ldrb r1, [r5, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =gSprites + adds r0, r4 + subs r1, r2, 0x1 + lsls r1, 24 + lsrs r1, 24 + bl StartSpriteAnim + ldrb r1, [r5, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 +_081B6152: + strb r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end party_menu_update_status_condition_object + + thumb_func_start sub_81B6160 +sub_81B6160: @ 81B6160 + push {lr} + ldr r0, =gUnknown_08615FF8 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_08616000 + bl LoadCompressedObjectPalette + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B6160 + + thumb_func_start sub_81B617C +sub_81B617C: @ 81B617C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + ldr r0, =c2_815ABFC + mov r8, r0 + ldr r0, =gMain + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081B61BC + movs r7, 0x1 + bl sub_81B8984 + lsls r0, 24 + lsrs r6, r0, 24 + b _081B61C0 + .pool +_081B61B0: + ldr r0, =gUnknown_0203CEC8 + strb r5, [r0, 0x9] + b _081B6204 + .pool +_081B61BC: + movs r7, 0 + movs r6, 0 +_081B61C0: + ldr r4, =gUnknown_0203CE7C + ldrh r0, [r4] + bl GetItemEffectType + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xA + bne _081B621C + ldr r1, =gUnknown_0203CEC8 + movs r0, 0 + strb r0, [r1, 0x9] + movs r5, 0 +_081B61D8: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =gPlayerParty + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B61FA + adds r0, r4, 0 + movs r1, 0x39 + bl GetMonData + cmp r0, 0 + beq _081B61B0 +_081B61FA: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _081B61D8 +_081B6204: + ldr r0, =sub_81B6280 + movs r1, 0x7F + b _081B6230 + .pool +_081B621C: + ldrh r0, [r4] + bl GetPocketByItemId + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x5 + cmp r0, 0x3 + bne _081B622E + movs r1, 0x4 +_081B622E: + ldr r0, =sub_81B1370 +_081B6230: + str r1, [sp] + str r0, [sp, 0x4] + mov r0, r8 + str r0, [sp, 0x8] + adds r0, r7, 0 + adds r1, r6, 0 + movs r2, 0x3 + movs r3, 0x1 + bl sub_81B0038 + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B617C + + thumb_func_start c2_815ABFC +c2_815ABFC: @ 81B6254 + push {lr} + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + bne _081B626C + movs r0, 0xC + movs r1, 0x5 + movs r2, 0 + bl GoToBagMenu + b _081B6276 +_081B626C: + ldr r0, =gUnknown_0203CF30 + ldr r1, [r0] + movs r0, 0x4 + bl sub_81C4F98 +_081B6276: + pop {r0} + bx r0 + .pool + thumb_func_end c2_815ABFC + + thumb_func_start sub_81B6280 +sub_81B6280: @ 81B6280 + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B62B2 + ldr r0, =gUnknown_0203CEC8 + ldrb r1, [r0, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x1 + bne _081B62A6 + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + ldr r0, =sub_81B9140 + str r0, [r1, 0x4] +_081B62A6: + ldr r0, =gUnknown_03006328 + ldr r1, =sub_81B6794 + ldr r2, [r0] + adds r0, r3, 0 + bl _call_via_r2 +_081B62B2: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B6280 + + thumb_func_start IsHPRecoveryItem +@ bool8 IsHPRecoveryItem(u16 itemId) +IsHPRecoveryItem: @ 81B62D0 + push {lr} + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xAF + bne _081B62EC + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00003214 + adds r0, r1 + b _081B62F6 + .pool +_081B62EC: + ldr r1, =gItemEffectInfoPointers + subs r0, 0xD + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] +_081B62F6: + ldrb r1, [r0, 0x4] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _081B6308 + movs r0, 0 + b _081B630A + .pool +_081B6308: + movs r0, 0x1 +_081B630A: + pop {r1} + bx r1 + thumb_func_end IsHPRecoveryItem + + thumb_func_start GetMedicineItemEffectMessage +@ void GetMedicineItemEffectMessage(u16 itemId) +GetMedicineItemEffectMessage: @ 81B6310 + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl GetItemEffectType + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x3 + cmp r0, 0x12 + bls _081B6326 + b _081B64BC +_081B6326: + lsls r0, 2 + ldr r1, =_081B6334 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081B6334: + .4byte _081B6380 + .4byte _081B6394 + .4byte _081B63A8 + .4byte _081B63BC + .4byte _081B63D0 + .4byte _081B63E4 + .4byte _081B63F8 + .4byte _081B64BC + .4byte _081B640C + .4byte _081B6430 + .4byte _081B6420 + .4byte _081B6460 + .4byte _081B6470 + .4byte _081B6450 + .4byte _081B6440 + .4byte _081B64BC + .4byte _081B6494 + .4byte _081B6494 + .4byte _081B64A8 +_081B6380: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9C3E + bl StringExpandPlaceholders + b _081B64C4 + .pool +_081B6394: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9C7C + bl StringExpandPlaceholders + b _081B64C4 + .pool +_081B63A8: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9C8A + bl StringExpandPlaceholders + b _081B64C4 + .pool +_081B63BC: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9CA2 + bl StringExpandPlaceholders + b _081B64C4 + .pool +_081B63D0: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9C5F + bl StringExpandPlaceholders + b _081B64C4 + .pool +_081B63E4: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9DBE + bl StringExpandPlaceholders + b _081B64C4 + .pool +_081B63F8: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9DE1 + bl StringExpandPlaceholders + b _081B64C4 + .pool +_081B640C: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9CE0 + bl StringExpandPlaceholders + b _081B64C4 + .pool +_081B6420: + ldr r0, =gStringVar2 + ldr r1, =gUnknown_085E96E3 + b _081B6474 + .pool +_081B6430: + ldr r0, =gStringVar2 + ldr r1, =gUnknown_085EA33C + b _081B6474 + .pool +_081B6440: + ldr r0, =gStringVar2 + ldr r1, =gUnknown_085EA343 + b _081B6474 + .pool +_081B6450: + ldr r0, =gStringVar2 + ldr r1, =gUnknown_085EA35B + b _081B6474 + .pool +_081B6460: + ldr r0, =gStringVar2 + ldr r1, =gUnknown_085E96E6 + b _081B6474 + .pool +_081B6470: + ldr r0, =gStringVar2 + ldr r1, =gUnknown_085E96EE +_081B6474: + bl StringCopy + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9D25 + bl StringExpandPlaceholders + b _081B64C4 + .pool +_081B6494: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9CF5 + bl StringExpandPlaceholders + b _081B64C4 + .pool +_081B64A8: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9CB7 + bl StringExpandPlaceholders + b _081B64C4 + .pool +_081B64BC: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E96F6 + bl StringExpandPlaceholders +_081B64C4: + pop {r0} + bx r0 + .pool + thumb_func_end GetMedicineItemEffectMessage + + thumb_func_start UsingHPEVItemOnShedinja +@ bool8 UsingHPEVItemOnShedinja(struct pokemon *mon, u16 itemId) +UsingHPEVItemOnShedinja: @ 81B64D0 + push {r4,lr} + adds r4, r0, 0 + lsls r0, r1, 16 + lsrs r0, 16 + bl GetItemEffectType + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xD + bne _081B64FC + adds r0, r4, 0 + movs r1, 0xB + bl GetMonData + ldr r1, =0x0000012f + cmp r0, r1 + bne _081B64FC + movs r0, 0 + b _081B64FE + .pool +_081B64FC: + movs r0, 0x1 +_081B64FE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end UsingHPEVItemOnShedinja + + thumb_func_start IsBlueYellowRedFlute +@ bool8 IsBlueYellowRedFlute(u16 itemId) +IsBlueYellowRedFlute: @ 81B6504 + push {lr} + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x27 + beq _081B6516 + cmp r0, 0x29 + beq _081B6516 + cmp r0, 0x28 + bne _081B651A +_081B6516: + movs r0, 0x1 + b _081B651C +_081B651A: + movs r0, 0 +_081B651C: + pop {r1} + bx r1 + thumb_func_end IsBlueYellowRedFlute + + thumb_func_start ExecuteTableBasedItemEffect__ +@ bool8 ExecuteTableBasedItemEffect__(u8 partyMonIndex, u16 itemId, u8 monMoveIndex) +ExecuteTableBasedItemEffect__: @ 81B6520 + push {r4-r6,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 16 + lsrs r5, r1, 16 + lsls r2, 24 + lsrs r6, r2, 24 + ldr r0, =gMain + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _081B6558 + movs r0, 0x64 + muls r0, r3 + ldr r1, =gPlayerParty + adds r0, r1 + adds r1, r5, 0 + adds r2, r3, 0 + b _081B6572 + .pool +_081B6558: + movs r0, 0x64 + adds r4, r3, 0 + muls r4, r0 + ldr r0, =gPlayerParty + adds r4, r0 + adds r0, r3, 0 + bl sub_81B8F38 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 +_081B6572: + adds r3, r6, 0 + bl ExecuteTableBasedItemEffect_ + lsls r0, 24 + lsrs r0, 24 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end ExecuteTableBasedItemEffect__ + + thumb_func_start ItemUseCB_Medicine +ItemUseCB_Medicine: @ 81B6588 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + str r1, [sp, 0x4] + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r0, 0 + mov r10, r0 + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + ldr r0, =gUnknown_0203CE7C + ldrh r6, [r0] + adds r0, r5, 0 + adds r1, r6, 0 + bl UsingHPEVItemOnShedinja + lsls r0, 24 + cmp r0, 0 + beq _081B6600 + adds r0, r6, 0 + bl IsHPRecoveryItem + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x1 + bne _081B65EE + adds r0, r5, 0 + movs r1, 0x39 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + adds r0, r5, 0 + movs r1, 0x3A + bl GetMonData + cmp r10, r0 + bne _081B65EE + movs r1, 0 + mov r8, r1 +_081B65EE: + ldr r4, =gUnknown_0203CEC8 + ldrb r0, [r4, 0x9] + adds r1, r6, 0 + movs r2, 0 + bl ExecuteTableBasedItemEffect__ + lsls r0, 24 + cmp r0, 0 + beq _081B6624 +_081B6600: + ldr r1, =gUnknown_0203CEE8 + movs r0, 0 + strb r0, [r1] + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_085E96F6 + b _081B66F4 + .pool +_081B6624: + ldr r1, =gUnknown_0203CEE8 + movs r0, 0x1 + strb r0, [r1] + adds r0, r6, 0 + bl IsBlueYellowRedFlute + lsls r0, 24 + cmp r0, 0 + bne _081B6650 + movs r0, 0x1 + bl PlaySE + ldrb r0, [r4, 0xB] + cmp r0, 0xE + beq _081B6656 + adds r0, r6, 0 + movs r1, 0x1 + bl RemoveBagItem + b _081B6656 + .pool +_081B6650: + movs r0, 0x75 + bl PlaySE +_081B6656: + ldr r4, =gUnknown_0203CEDC + ldr r7, =gUnknown_0203CEC8 + movs r0, 0x9 + ldrsb r0, [r7, r0] + lsls r0, 4 + ldr r1, [r4] + adds r1, r0 + adds r0, r5, 0 + bl party_menu_get_status_condition_and_update_object + ldr r2, =gSprites + movs r0, 0x9 + ldrsb r0, [r7, r0] + ldr r1, [r4] + lsls r0, 4 + adds r3, r0, r1 + ldrb r1, [r3, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + bge _081B6694 + adds r0, r5, 0 + adds r1, r3, 0 + movs r2, 0x1 + bl sub_81B2AC8 +_081B6694: + mov r2, r8 + cmp r2, 0x1 + bne _081B66E4 + mov r0, r10 + cmp r0, 0 + bne _081B66A8 + ldrb r0, [r7, 0x9] + movs r1, 0x1 + bl sub_81B0FCC +_081B66A8: + adds r0, r5, 0 + movs r1, 0x39 + bl GetMonData + adds r3, r0, 0 + mov r1, r10 + subs r3, r1 + lsls r3, 16 + asrs r3, 16 + ldrb r1, [r7, 0x9] + ldr r0, =sub_81B672C + str r0, [sp] + mov r0, r9 + movs r2, 0x1 + bl sub_81B1F18 + mov r0, r9 + movs r1, 0 + mov r2, r10 + bl sub_81B1FA8 + b _081B6710 + .pool +_081B66E4: + ldr r1, =gStringVar1 + adds r0, r5, 0 + bl GetMonNickname + adds r0, r6, 0 + bl GetMedicineItemEffectMessage + ldr r0, =gStringVar4 +_081B66F4: + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =gTasks + mov r2, r9 + lsls r0, r2, 2 + add r0, r9 + lsls r0, 3 + adds r0, r1 + ldr r1, [sp, 0x4] + str r1, [r0] +_081B6710: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end ItemUseCB_Medicine + + thumb_func_start sub_81B672C +sub_81B672C: @ 81B672C + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gStringVar1 + bl GetMonNickname + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9C17 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + bl sub_805EAE8 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B6794 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B672C + + thumb_func_start sub_81B6794 +sub_81B6794: @ 81B6794 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B67BA + ldr r0, =gUnknown_0203CEE8 + ldrb r1, [r0] + cmp r1, 0 + bne _081B67B4 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + str r1, [r0, 0x4] +_081B67B4: + adds r0, r4, 0 + bl sub_81B12C0 +_081B67BA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B6794 + + thumb_func_start sub_81B67C8 +sub_81B67C8: @ 81B67C8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + str r1, [sp] + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldr r4, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r4, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + ldr r0, =gUnknown_0203CE7C + ldrh r6, [r0] + adds r0, r6, 0 + bl GetItemEffectType + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r5, 0 + movs r1, 0x20 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x4] + adds r0, r5, 0 + adds r1, r7, 0 + bl sub_81B691C + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x8] + ldrb r0, [r4, 0x9] + adds r1, r6, 0 + movs r2, 0 + bl ExecuteTableBasedItemEffect__ + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x20 + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + adds r0, r5, 0 + adds r1, r7, 0 + bl sub_81B691C + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + cmp r4, 0 + bne _081B6850 + ldr r0, [sp, 0x4] + cmp r0, r9 + bne _081B6874 + ldr r1, [sp, 0x8] + cmp r1, r8 + bne _081B6874 +_081B6850: + ldr r1, =gUnknown_0203CEE8 + movs r0, 0 + strb r0, [r1] + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_085E96F6 + b _081B68E2 + .pool +_081B6874: + ldr r1, =gUnknown_0203CEE8 + movs r0, 0x1 + strb r0, [r1] + movs r0, 0x1 + bl PlaySE + adds r0, r6, 0 + movs r1, 0x1 + bl RemoveBagItem + ldr r1, =gStringVar1 + adds r0, r5, 0 + bl GetMonNickname + ldr r1, =gStringVar2 + adds r0, r7, 0 + bl option_menu_get_string + ldr r2, [sp, 0x4] + cmp r2, r9 + beq _081B68D8 + ldr r0, [sp, 0x8] + cmp r0, r8 + beq _081B68C4 + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9D45 + bl StringExpandPlaceholders + b _081B68E0 + .pool +_081B68C4: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9D90 + bl StringExpandPlaceholders + b _081B68E0 + .pool +_081B68D8: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9D6D + bl StringExpandPlaceholders +_081B68E0: + ldr r0, =gStringVar4 +_081B68E2: + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =gTasks + mov r2, r10 + lsls r0, r2, 2 + add r0, r10 + lsls r0, 3 + adds r0, r1 + ldr r1, [sp] + str r1, [r0] + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B67C8 + + thumb_func_start sub_81B691C +sub_81B691C: @ 81B691C + push {r4,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r1, 0 + subs r0, 0xC + cmp r0, 0x5 + bhi _081B6992 + lsls r0, 2 + ldr r1, =_081B693C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081B693C: + .4byte _081B696C + .4byte _081B6954 + .4byte _081B697E + .4byte _081B6984 + .4byte _081B6978 + .4byte _081B6972 +_081B6954: + adds r0, r4, 0 + movs r1, 0xB + bl GetMonData + ldr r1, =0x0000012f + cmp r0, r1 + beq _081B6992 + adds r0, r4, 0 + movs r1, 0x1A + b _081B6988 + .pool +_081B696C: + adds r0, r4, 0 + movs r1, 0x1B + b _081B6988 +_081B6972: + adds r0, r4, 0 + movs r1, 0x1C + b _081B6988 +_081B6978: + adds r0, r4, 0 + movs r1, 0x1D + b _081B6988 +_081B697E: + adds r0, r4, 0 + movs r1, 0x1E + b _081B6988 +_081B6984: + adds r0, r4, 0 + movs r1, 0x1F +_081B6988: + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + b _081B6994 +_081B6992: + movs r0, 0 +_081B6994: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B691C + + thumb_func_start option_menu_get_string +option_menu_get_string: @ 81B699C + push {lr} + adds r2, r1, 0 + lsls r0, 24 + lsrs r0, 24 + subs r0, 0xC + cmp r0, 0x5 + bhi _081B6A08 + lsls r0, 2 + ldr r1, =_081B69B8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081B69B8: + .4byte _081B69D8 + .4byte _081B69D0 + .4byte _081B69F0 + .4byte _081B6A00 + .4byte _081B69E8 + .4byte _081B69E0 +_081B69D0: + ldr r1, =gUnknown_085E96E3 + b _081B69F2 + .pool +_081B69D8: + ldr r1, =gUnknown_085EA33C + b _081B69F2 + .pool +_081B69E0: + ldr r1, =gUnknown_085EA343 + b _081B69F2 + .pool +_081B69E8: + ldr r1, =gUnknown_085EA35B + b _081B69F2 + .pool +_081B69F0: + ldr r1, =gUnknown_085E96E6 +_081B69F2: + adds r0, r2, 0 + bl StringCopy + b _081B6A08 + .pool +_081B6A00: + ldr r1, =gUnknown_085E96EE + adds r0, r2, 0 + bl StringCopy +_081B6A08: + pop {r0} + bx r0 + .pool + thumb_func_end option_menu_get_string + + thumb_func_start sub_81B6A10 +sub_81B6A10: @ 81B6A10 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r7, 0 + movs r0, 0x1 + mov r10, r0 + movs r0, 0x3 + bl sub_81B31B0 + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + movs r0, 0x64 + adds r1, r4, 0 + muls r1, r0 + mov r8, r1 + ldr r0, =gPlayerParty + mov r9, r0 +_081B6A40: + adds r1, r5, 0 + adds r1, 0xD + mov r0, r8 + add r0, r9 + bl GetMonData + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + movs r0, 0xD + adds r2, r4, 0 + muls r2, r0 + ldr r0, =gMoveNames + adds r2, r0 + lsls r0, r5, 4 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + adds r0, r6, 0 + mov r1, r10 + movs r3, 0x8 + bl Print + cmp r4, 0 + beq _081B6A82 + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 +_081B6A82: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _081B6A40 + adds r0, r6, 0 + adds r1, r7, 0 + movs r2, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B6A10 + + thumb_func_start ether_effect_related_3 +ether_effect_related_3: @ 81B6AB4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + bl ProcessMenuInput + lsls r0, 24 + asrs r1, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r1, r0 + beq _081B6AF0 + adds r0, 0x1 + cmp r1, r0 + bne _081B6AE0 + movs r0, 0x5 + bl PlaySE + adds r0, r4, 0 + bl sub_81B6BB4 + b _081B6AF0 +_081B6AE0: + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + adds r0, 0xD + bl sub_81B302C + adds r0, r5, 0 + bl ether_effect_related_2 +_081B6AF0: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ether_effect_related_3 + + thumb_func_start dp05_ether +dp05_ether: @ 81B6AFC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + cmp r0, 0xAF + bne _081B6B20 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00003214 + adds r0, r1 + b _081B6B2A + .pool +_081B6B20: + ldr r1, =gItemEffectInfoPointers + subs r0, 0xD + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] +_081B6B2A: + ldrb r1, [r0, 0x4] + movs r0, 0x10 + ands r0, r1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _081B6B4C + ldr r0, =gUnknown_0203CEC8 + strh r1, [r0, 0xE] + adds r0, r4, 0 + bl ether_effect_related + b _081B6B6E + .pool +_081B6B4C: + movs r0, 0x5 + bl PlaySE + movs r0, 0x16 + bl display_pokemon_menu_message + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0x9] + bl sub_81B6A10 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =ether_effect_related_3 + str r1, [r0] +_081B6B6E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp05_ether + + thumb_func_start ether_effect_related_2 +ether_effect_related_2: @ 81B6B80 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + adds r0, 0xC + bl sub_81B302C + bl GetMenuCursorPos + ldr r1, =gUnknown_0203CEC8 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1, 0xE] + adds r0, r4, 0 + bl ether_effect_related + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ether_effect_related_2 + + thumb_func_start sub_81B6BB4 +sub_81B6BB4: @ 81B6BB4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, =sub_81B1370 + str r0, [r1] + ldr r0, =gUnknown_0203CEC4 + ldr r0, [r0] + movs r1, 0 + str r1, [r0, 0x4] + adds r0, 0xC + bl sub_81B302C + movs r0, 0x5 + bl display_pokemon_menu_message + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B6BB4 + + thumb_func_start ether_effect_related +ether_effect_related: @ 81B6BEC + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + movs r4, 0 + ldr r7, =gUnknown_0203CED6 + ldr r0, =gUnknown_0203CE7C + ldrh r5, [r0] + movs r0, 0xE + negs r0, r0 + adds r0, r7 + mov r8, r0 + ldrb r0, [r0, 0x9] + ldrb r2, [r7] + adds r1, r5, 0 + bl ExecuteTableBasedItemEffect__ + lsls r0, 24 + cmp r0, 0 + beq _081B6C34 + ldr r0, =gUnknown_0203CEE8 + strb r4, [r0] + movs r0, 0x5 + bl PlaySE + ldr r0, =gUnknown_085E96F6 + b _081B6C7E + .pool +_081B6C34: + ldr r1, =gUnknown_0203CEE8 + movs r0, 0x1 + strb r0, [r1] + mov r0, r8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + adds r4, r1, 0 + muls r4, r0 + ldr r0, =gPlayerParty + adds r4, r0 + movs r0, 0x1 + bl PlaySE + adds r0, r5, 0 + movs r1, 0x1 + bl RemoveBagItem + movs r0, 0 + ldrsh r1, [r7, r0] + adds r1, 0xD + adds r0, r4, 0 + bl GetMonData + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =gStringVar1 + movs r1, 0xD + muls r1, r4 + ldr r2, =gMoveNames + adds r1, r2 + bl StringCopy + adds r0, r5, 0 + bl GetMedicineItemEffectMessage + ldr r0, =gStringVar4 +_081B6C7E: + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B6794 + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end ether_effect_related + + thumb_func_start dp05_pp_up +dp05_pp_up: @ 81B6CC0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl PlaySE + movs r0, 0x17 + bl display_pokemon_menu_message + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0x9] + bl sub_81B6A10 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =ether_effect_related_3 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp05_pp_up + + thumb_func_start ItemIdToBattleMoveId +ItemIdToBattleMoveId: @ 81B6CFC + lsls r0, 16 + ldr r1, =0xfedf0000 + adds r0, r1 + ldr r1, =gUnknown_08616040 + lsrs r0, 15 + adds r0, r1 + ldrh r0, [r0] + bx lr + .pool + thumb_func_end ItemIdToBattleMoveId + + thumb_func_start sub_81B6D14 +sub_81B6D14: @ 81B6D14 + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + movs r1, 0 + ldr r3, =gUnknown_08616040 +_081B6D1E: + adds r0, r1, 0 + adds r0, 0x32 + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + cmp r0, r2 + bne _081B6D34 + movs r0, 0x1 + b _081B6D40 + .pool +_081B6D34: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x7 + bls _081B6D1E + movs r0, 0 +_081B6D40: + pop {r1} + bx r1 + thumb_func_end sub_81B6D14 + + thumb_func_start pokemon_has_move +pokemon_has_move: @ 81B6D44 + push {r4-r6,lr} + adds r6, r0, 0 + lsls r1, 16 + lsrs r5, r1, 16 + movs r4, 0 +_081B6D4E: + adds r1, r4, 0 + adds r1, 0xD + adds r0, r6, 0 + bl GetMonData + cmp r0, r5 + bne _081B6D60 + movs r0, 0x1 + b _081B6D6C +_081B6D60: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _081B6D4E + movs r0, 0 +_081B6D6C: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end pokemon_has_move + + thumb_func_start sub_81B6D74 +sub_81B6D74: @ 81B6D74 + push {r4,lr} + adds r1, r0, 0 + ldr r4, =gStringVar4 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B6D74 + + thumb_func_start sub_81B6D98 +sub_81B6D98: @ 81B6D98 + push {r4,lr} + adds r4, r0, 0 + adds r0, r1, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_81B6D74 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B6794 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B6D98 + + thumb_func_start sub_81B6DC4 +sub_81B6DC4: @ 81B6DC4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + movs r0, 0x5 + bl PlaySE + ldr r7, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r7, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + movs r0, 0xE + adds r0, r7 + mov r8, r0 + ldr r0, =gUnknown_0203CE7C + ldrh r4, [r0] + ldr r1, =gStringVar1 + adds r0, r5, 0 + bl GetMonNickname + adds r0, r4, 0 + bl ItemIdToBattleMoveId + strh r0, [r7, 0xE] + ldr r0, =gStringVar2 + movs r1, 0xE + ldrsh r2, [r7, r1] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl StringCopy + movs r0, 0 + mov r1, r8 + strh r0, [r1, 0x2] + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_81B22D8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B6E70 + cmp r0, 0x2 + beq _081B6E78 + ldrh r1, [r7, 0xE] + adds r0, r5, 0 + bl pokemon_moveset_pad_ + lsls r0, 16 + ldr r1, =0xffff0000 + cmp r0, r1 + beq _081B6E88 + ldr r0, =gTasks + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B6EB4 + str r0, [r1] + b _081B6E9C + .pool +_081B6E70: + ldr r1, =gUnknown_085E9AB4 + b _081B6E7A + .pool +_081B6E78: + ldr r1, =gUnknown_085E9C00 +_081B6E7A: + adds r0, r6, 0 + bl sub_81B6D98 + b _081B6E9C + .pool +_081B6E88: + ldr r0, =gUnknown_085E9AE9 + bl sub_81B6D74 + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B6FF4 + str r1, [r0] +_081B6E9C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B6DC4 + + thumb_func_start sub_81B6EB4 +sub_81B6EB4: @ 81B6EB4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r2, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r2, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + adds r6, r2, 0 + adds r6, 0xE + ldr r0, =gUnknown_0203CE7C + ldrh r4, [r0] + movs r1, 0x2 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _081B6EF0 + adds r0, r5, 0 + movs r1, 0x4 + bl happiness_algorithm + movs r0, 0xA9 + lsls r0, 1 + cmp r4, r0 + bhi _081B6EF0 + adds r0, r4, 0 + movs r1, 0x1 + bl RemoveBagItem +_081B6EF0: + ldr r1, =gStringVar1 + adds r0, r5, 0 + bl GetMonNickname + ldr r0, =gStringVar2 + movs r1, 0 + ldrsh r2, [r6, r1] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl StringCopy + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9AA5 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B6F60 + str r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B6EB4 + + thumb_func_start sub_81B6F60 +sub_81B6F60: @ 81B6F60 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B6F86 + ldr r0, =0x0000016f + bl PlayFanfare + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B6F98 + str r1, [r0] +_081B6F86: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B6F60 + + thumb_func_start sub_81B6F98 +sub_81B6F98: @ 81B6F98 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + bl IsFanfareTaskInactive + lsls r0, 24 + cmp r0, 0 + beq _081B6FEA + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r2, 0x1 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _081B6FC0 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081B6FEA +_081B6FC0: + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x10 + ldrsh r0, [r0, r1] + cmp r0, 0x1 + bne _081B6FDC + adds r0, r4, 0 + bl sub_81B77AC + b _081B6FEA + .pool +_081B6FDC: + cmp r0, 0x2 + bne _081B6FE4 + ldr r0, =gScriptResult + strh r2, [r0] +_081B6FE4: + adds r0, r5, 0 + bl sub_81B12C0 +_081B6FEA: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B6F98 + + thumb_func_start sub_81B6FF4 +sub_81B6FF4: @ 81B6FF4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B7018 + bl sub_81B334C + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B7028 + str r0, [r1] +_081B7018: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B6FF4 + + thumb_func_start sub_81B7028 +sub_81B7028: @ 81B7028 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B704E + cmp r1, 0 + bgt _081B7048 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B7074 + b _081B7080 +_081B7048: + cmp r1, 0x1 + beq _081B707A + b _081B7080 +_081B704E: + ldr r0, =gUnknown_085E9B96 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B7088 + str r1, [r0] + b _081B7080 + .pool +_081B7074: + movs r0, 0x5 + bl PlaySE +_081B707A: + adds r0, r4, 0 + bl sub_81B7230 +_081B7080: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B7028 + + thumb_func_start sub_81B7088 +sub_81B7088: @ 81B7088 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B70A8 + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + ldr r0, =sub_81B70B8 + str r0, [r1, 0x4] + adds r0, r4, 0 + bl sub_81B12C0 +_081B70A8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B7088 + + thumb_func_start sub_81B70B8 +sub_81B70B8: @ 81B70B8 + push {r4,lr} + sub sp, 0x4 + ldr r0, =gPlayerParty + ldr r4, =gUnknown_0203CEC8 + ldrb r1, [r4, 0x9] + ldr r2, =gUnknown_020244E9 + ldrb r2, [r2] + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldr r3, =sub_81B70F0 + ldrh r4, [r4, 0xE] + str r4, [sp] + bl sub_81BFA38 + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B70B8 + + thumb_func_start sub_81B70F0 +sub_81B70F0: @ 81B70F0 + push {lr} + sub sp, 0xC + movs r0, 0x7F + str r0, [sp] + ldr r0, =sub_81B711C + str r0, [sp, 0x4] + ldr r0, =gUnknown_0203CEC8 + ldr r0, [r0] + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B70F0 + + thumb_func_start sub_81B711C +sub_81B711C: @ 81B711C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B714E + bl sub_81C1B94 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + beq _081B7148 + adds r0, r4, 0 + bl sub_81B7154 + b _081B714E + .pool +_081B7148: + adds r0, r5, 0 + bl sub_81B7230 +_081B714E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81B711C + + thumb_func_start sub_81B7154 +sub_81B7154: @ 81B7154 + push {r4-r6,lr} + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + adds r5, r1, 0 + muls r5, r0 + ldr r0, =gPlayerParty + adds r5, r0 + bl sub_81C1B94 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r1, 0xD + adds r0, r5, 0 + bl GetMonData + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r1, =gStringVar1 + adds r0, r5, 0 + bl GetMonNickname + ldr r0, =gStringVar2 + movs r1, 0xD + muls r1, r4 + ldr r2, =gMoveNames + adds r1, r2 + bl StringCopy + ldr r0, =gUnknown_085E9BB8 + bl sub_81B6D74 + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B71D4 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B7154 + + thumb_func_start sub_81B71D4 +sub_81B71D4: @ 81B71D4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B7220 + ldr r5, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r5, r1] + movs r0, 0x64 + adds r4, r1, 0 + muls r4, r0 + ldr r0, =gPlayerParty + adds r4, r0 + bl sub_81C1B94 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_806B9A8 + ldrh r5, [r5, 0xE] + bl sub_81C1B94 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80691F4 + adds r0, r6, 0 + bl sub_81B6EB4 +_081B7220: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B71D4 + + thumb_func_start sub_81B7230 +sub_81B7230: @ 81B7230 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gStringVar2 + ldr r1, =gUnknown_0203CEC8 + movs r3, 0xE + ldrsh r2, [r1, r3] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl StringCopy + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9B5D + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B7294 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B7230 + + thumb_func_start sub_81B7294 +sub_81B7294: @ 81B7294 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B72B8 + bl sub_81B334C + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B72C8 + str r0, [r1] +_081B72B8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B7294 + + thumb_func_start sub_81B72C8 +sub_81B72C8: @ 81B72C8 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r7, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r7, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r4, r1, r0 + bl sub_8198C58 + lsls r0, 24 + asrs r5, r0, 24 + cmp r5, 0 + beq _081B7306 + cmp r5, 0 + bgt _081B7300 + movs r0, 0x1 + negs r0, r0 + cmp r5, r0 + beq _081B738C + b _081B73C2 + .pool +_081B7300: + cmp r5, 0x1 + beq _081B7392 + b _081B73C2 +_081B7306: + ldr r1, =gStringVar1 + adds r0, r4, 0 + bl GetMonNickname + ldr r0, =gStringVar2 + movs r1, 0xE + ldrsh r2, [r7, r1] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl StringCopy + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9B76 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + movs r3, 0x10 + ldrsh r0, [r7, r3] + cmp r0, 0x1 + bne _081B7368 + ldr r0, =gTasks + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B73E4 + str r0, [r1] + b _081B73C2 + .pool +_081B7368: + cmp r0, 0x2 + bne _081B7370 + ldr r0, =gScriptResult + strh r5, [r0] +_081B7370: + ldr r0, =gTasks + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B6794 + str r0, [r1] + b _081B73C2 + .pool +_081B738C: + movs r0, 0x5 + bl PlaySE +_081B7392: + ldr r1, =gStringVar1 + adds r0, r4, 0 + bl GetMonNickname + ldr r0, =gStringVar2 + ldr r1, =gUnknown_0203CEC8 + movs r3, 0xE + ldrsh r2, [r1, r3] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl StringCopy + ldr r0, =gUnknown_085E9AE9 + bl sub_81B6D74 + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B6FF4 + str r1, [r0] +_081B73C2: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B72C8 + + thumb_func_start sub_81B73E4 +sub_81B73E4: @ 81B73E4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B73FC + adds r0, r4, 0 + bl sub_81B77AC +_081B73FC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B73E4 + + thumb_func_start dp05_rare_candy +dp05_rare_candy: @ 81B7404 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r10, r1 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =gUnknown_0203CEC8 + mov r9, r0 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + ldr r0, =gUnknown_0203CEC4 + ldr r6, [r0] + movs r1, 0x86 + lsls r1, 2 + adds r4, r6, r1 + ldr r2, =gUnknown_0203CE7C + mov r8, r2 + adds r0, r5, 0 + movs r1, 0x38 + bl GetMonData + cmp r0, 0x64 + beq _081B7478 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81B79A0 + mov r1, r9 + ldrb r0, [r1, 0x9] + mov r2, r8 + ldrh r1, [r2] + movs r2, 0 + bl ExecuteTableBasedItemEffect__ + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x89 + lsls r0, 2 + adds r1, r6, r0 + adds r0, r5, 0 + bl sub_81B79A0 + b _081B747A + .pool +_081B7478: + movs r4, 0x1 +_081B747A: + movs r0, 0x5 + bl PlaySE + cmp r4, 0 + beq _081B74B4 + ldr r1, =gUnknown_0203CEE8 + movs r0, 0 + strb r0, [r1] + ldr r0, =gUnknown_085E96F6 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + mov r1, r10 + b _081B7516 + .pool +_081B74B4: + ldr r1, =gUnknown_0203CEE8 + movs r0, 0x1 + strb r0, [r1] + movs r0, 0 + bl PlayFanfareByFanfareNum + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0x9] + adds r1, r5, 0 + bl sub_81B754C + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + movs r1, 0x1 + bl RemoveBagItem + ldr r1, =gStringVar1 + adds r0, r5, 0 + bl GetMonNickname + ldr r4, =gStringVar2 + adds r0, r5, 0 + movs r1, 0x38 + bl GetMonData + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9D0A + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B75D4 +_081B7516: + str r1, [r0] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end dp05_rare_candy + + thumb_func_start sub_81B754C +sub_81B754C: @ 81B754C + push {r4-r7,lr} + adds r5, r1, 0 + lsls r0, 24 + lsrs r0, 24 + adds r7, r0, 0 + ldr r6, =gUnknown_0203CEDC + lsls r4, r7, 4 + ldr r1, [r6] + adds r1, r4 + adds r0, r5, 0 + bl party_menu_get_status_condition_and_update_object + ldr r2, =gSprites + ldr r0, [r6] + adds r3, r4, r0 + ldrb r1, [r3, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + bge _081B7588 + adds r0, r5, 0 + adds r1, r3, 0 + movs r2, 0x1 + bl sub_81B2AC8 +_081B7588: + ldr r1, [r6] + adds r1, r4 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_81B2CD4 + ldr r1, [r6] + adds r1, r4 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_81B2D74 + ldr r1, [r6] + adds r1, r4 + adds r0, r5, 0 + bl sub_81B2E28 + ldr r0, [r6] + adds r0, r4, r0 + ldrb r0, [r0, 0x9] + adds r1, r5, 0 + bl sub_81B5B38 + adds r0, r7, 0 + movs r1, 0x1 + bl sub_81B0FCC + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B754C + + thumb_func_start sub_81B75D4 +sub_81B75D4: @ 81B75D4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0 + bl WaitFanfare + lsls r0, 24 + cmp r0, 0 + beq _081B7620 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B7620 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081B7606 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081B7620 +_081B7606: + movs r0, 0x5 + bl PlaySE + adds r0, r4, 0 + bl sub_81B767C + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B7634 + str r0, [r1] +_081B7620: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B75D4 + + thumb_func_start sub_81B7634 +sub_81B7634: @ 81B7634 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081B764E + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081B7668 +_081B764E: + movs r0, 0x5 + bl PlaySE + adds r0, r4, 0 + bl sub_81B76C8 + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B7704 + str r0, [r1] +_081B7668: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B7634 + + thumb_func_start sub_81B767C +sub_81B767C: @ 81B767C + push {r4,r5,lr} + sub sp, 0x8 + ldr r0, =gUnknown_0203CEC4 + ldr r5, [r0] + movs r0, 0x86 + lsls r0, 2 + adds r4, r5, r0 + bl sub_81B3364 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x18] + ldrh r0, [r4, 0x18] + movs r1, 0x89 + lsls r1, 2 + adds r2, r5, r1 + movs r1, 0x2 + str r1, [sp] + movs r1, 0x3 + str r1, [sp, 0x4] + adds r1, r4, 0 + movs r3, 0x1 + bl sub_81D3640 + ldrb r0, [r4, 0x18] + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B767C + + thumb_func_start sub_81B76C8 +sub_81B76C8: @ 81B76C8 + push {r4,lr} + sub sp, 0x4 + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + movs r0, 0x86 + lsls r0, 2 + adds r4, r1, r0 + ldrh r0, [r4, 0x18] + movs r2, 0x89 + lsls r2, 2 + adds r1, r2 + movs r2, 0x3 + str r2, [sp] + movs r2, 0x1 + movs r3, 0x2 + bl sub_81D3784 + ldrb r0, [r4, 0x18] + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B76C8 + + thumb_func_start sub_81B7704 +sub_81B7704: @ 81B7704 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0 + bl WaitFanfare + lsls r0, 24 + cmp r0, 0 + beq _081B77A6 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r6, 0x1 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + bne _081B772C + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081B77A6 +_081B772C: + bl sub_81B3394 + ldr r4, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r4, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x1 + bl sub_8069318 + lsls r0, 16 + lsrs r1, r0, 16 + strh r6, [r4, 0x10] + ldr r0, =0x0000fffe + cmp r1, r0 + beq _081B7788 + cmp r1, r0 + bgt _081B776C + cmp r1, 0 + beq _081B7778 + b _081B77A0 + .pool +_081B776C: + ldr r0, =0x0000ffff + cmp r1, r0 + beq _081B7780 + b _081B77A0 + .pool +_081B7778: + adds r0, r5, 0 + bl sub_81B7810 + b _081B77A6 +_081B7780: + adds r0, r5, 0 + bl sub_81B787C + b _081B77A6 +_081B7788: + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B77AC + str r0, [r1] + b _081B77A6 + .pool +_081B77A0: + adds r0, r5, 0 + bl sub_81B7910 +_081B77A6: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81B7704 + + thumb_func_start sub_81B77AC +sub_81B77AC: @ 81B77AC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0 + bl sub_8069318 + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, =0x0000fffe + cmp r1, r0 + beq _081B780A + cmp r1, r0 + bgt _081B77E8 + cmp r1, 0 + beq _081B77F4 + b _081B7804 + .pool +_081B77E8: + ldr r0, =0x0000ffff + cmp r1, r0 + beq _081B77FC + b _081B7804 + .pool +_081B77F4: + adds r0, r4, 0 + bl sub_81B7810 + b _081B780A +_081B77FC: + adds r0, r4, 0 + bl sub_81B787C + b _081B780A +_081B7804: + adds r0, r4, 0 + bl sub_81B7910 +_081B780A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81B77AC + + thumb_func_start sub_81B7810 +sub_81B7810: @ 81B7810 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r6, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r6, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r7, r1, r0 + adds r0, r7, 0 + movs r1, 0 + movs r2, 0 + bl GetEvolutionTargetSpecies + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _081B7860 + bl sub_81B06F4 + ldr r0, =gUnknown_030061E8 + ldr r1, [r6] + str r1, [r0] + ldrb r3, [r6, 0x9] + adds r0, r7, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_813DA40 + adds r0, r5, 0 + bl DestroyTask + b _081B786E + .pool +_081B7860: + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B6794 + str r0, [r1] +_081B786E: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B7810 + + thumb_func_start sub_81B787C +sub_81B787C: @ 81B787C + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gUnknown_0203CEC8 + mov r8, r0 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gStringVar1 + bl GetMonNickname + ldr r0, =gStringVar2 + ldr r6, =gUnknown_020244E2 + ldrh r2, [r6] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl StringCopy + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9AE9 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldrh r0, [r6] + mov r1, r8 + strh r0, [r1, 0xE] + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B6FF4 + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B787C + + thumb_func_start sub_81B7910 +sub_81B7910: @ 81B7910 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r6, r0, 0 + adds r5, r1, 0 + lsls r6, 24 + lsrs r6, 24 + lsls r5, 16 + lsrs r5, 16 + ldr r0, =gUnknown_0203CEC8 + mov r8, r0 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gStringVar1 + bl GetMonNickname + ldr r0, =gStringVar2 + movs r1, 0xD + muls r1, r5 + ldr r2, =gMoveNames + adds r1, r2 + bl StringCopy + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9AA5 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + mov r0, r8 + strh r5, [r0, 0xE] + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B6F60 + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B7910 + + thumb_func_start sub_81B79A0 +sub_81B79A0: @ 81B79A0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r1, 0x3A + bl GetMonData + strh r0, [r5] + adds r0, r4, 0 + movs r1, 0x3B + bl GetMonData + strh r0, [r5, 0x2] + adds r0, r4, 0 + movs r1, 0x3C + bl GetMonData + strh r0, [r5, 0x4] + adds r0, r4, 0 + movs r1, 0x3E + bl GetMonData + strh r0, [r5, 0x8] + adds r0, r4, 0 + movs r1, 0x3F + bl GetMonData + strh r0, [r5, 0xA] + adds r0, r4, 0 + movs r1, 0x3D + bl GetMonData + strh r0, [r5, 0x6] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81B79A0 + + thumb_func_start sub_81B79E8 +sub_81B79E8: @ 81B79E8 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0203CEC4 + ldr r2, [r1] + movs r3, 0x86 + lsls r3, 2 + adds r1, r2, r3 + movs r3, 0 + strh r3, [r1] + ldr r4, =0x0000021a + adds r1, r2, r4 + strh r3, [r1] + ldr r1, =gUnknown_0203CEC8 + ldrb r1, [r1, 0x9] + lsls r1, 24 + asrs r1, 24 + movs r3, 0x87 + lsls r3, 2 + adds r2, r3 + strh r1, [r2] + bl sub_81B7A28 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B79E8 + + thumb_func_start sub_81B7A28 +sub_81B7A28: @ 81B7A28 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + mov r8, r4 + ldr r6, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r6, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B7A6E + adds r0, r5, 0 + movs r1, 0x39 + bl GetMonData + lsls r0, 16 + lsrs r7, r0, 16 + ldrb r0, [r6, 0x9] + ldr r1, =gUnknown_0203CE7C + ldrh r1, [r1] + movs r2, 0 + bl ExecuteTableBasedItemEffect__ + lsls r0, 24 + cmp r0, 0 + beq _081B7A94 +_081B7A6E: + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =task_intro_gamefreak + str r0, [r1] + b _081B7B2A + .pool +_081B7A94: + movs r0, 0x1 + bl PlaySE + ldr r4, =gUnknown_0203CEDC + movs r0, 0x9 + ldrsb r0, [r6, r0] + lsls r0, 4 + ldr r1, [r4] + adds r1, r0 + adds r0, r5, 0 + bl party_menu_get_status_condition_and_update_object + ldr r2, =gSprites + movs r0, 0x9 + ldrsb r0, [r6, r0] + ldr r1, [r4] + lsls r0, 4 + adds r3, r0, r1 + ldrb r1, [r3, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + bge _081B7AD6 + adds r0, r5, 0 + adds r1, r3, 0 + movs r2, 0x1 + bl sub_81B2AC8 +_081B7AD6: + ldr r4, =gUnknown_0203CEC4 + ldr r0, [r4] + movs r1, 0x87 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + movs r1, 0 + bl sub_81B0FCC + ldrb r0, [r6, 0x9] + movs r1, 0x1 + bl sub_81B0FCC + adds r0, r5, 0 + movs r1, 0x39 + bl GetMonData + adds r3, r0, 0 + subs r3, r7 + lsls r3, 16 + asrs r3, 16 + ldrb r1, [r6, 0x9] + ldr r0, =sub_81B7C10 + str r0, [sp] + mov r0, r8 + movs r2, 0x1 + bl sub_81B1F18 + mov r0, r8 + movs r1, 0 + adds r2, r7, 0 + bl sub_81B1FA8 + ldr r0, [r4] + movs r2, 0x86 + lsls r2, 2 + adds r1, r0, r2 + movs r2, 0x1 + strh r2, [r1] + ldr r1, =0x0000021a + adds r0, r1 + strh r2, [r0] +_081B7B2A: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B7A28 + + thumb_func_start task_intro_gamefreak +task_intro_gamefreak: @ 81B7B4C + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B7C0A + ldr r5, =gUnknown_0203CEC4 + ldr r2, [r5] + movs r0, 0x86 + lsls r0, 2 + adds r1, r2, r0 + movs r3, 0 + ldrsh r0, [r1, r3] + ldr r3, =gUnknown_0203CEC8 + cmp r0, 0x1 + bne _081B7B82 + movs r0, 0 + strh r0, [r1] + movs r1, 0x9 + ldrsb r1, [r3, r1] + movs r6, 0x87 + lsls r6, 2 + adds r0, r2, r6 + strh r1, [r0] +_081B7B82: + ldrb r0, [r3, 0x9] + adds r0, 0x1 + strb r0, [r3, 0x9] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x6 + bne _081B7C04 + ldr r0, [r5] + ldr r1, =0x0000021a + adds r0, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + cmp r1, 0 + bne _081B7BC8 + ldr r0, =gUnknown_0203CEE8 + strb r1, [r0] + ldr r0, =gUnknown_085E96F6 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + b _081B7BD8 + .pool +_081B7BC8: + ldr r1, =gUnknown_0203CEE8 + movs r0, 0x1 + strb r0, [r1] + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + movs r1, 0x1 + bl RemoveBagItem +_081B7BD8: + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B6794 + str r1, [r0] + ldr r1, =gUnknown_0203CEC8 + movs r0, 0 + strb r0, [r1, 0x9] + b _081B7C0A + .pool +_081B7C04: + adds r0, r4, 0 + bl sub_81B7A28 +_081B7C0A: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end task_intro_gamefreak + + thumb_func_start sub_81B7C10 +sub_81B7C10: @ 81B7C10 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gStringVar1 + bl GetMonNickname + ldr r4, =gStringVar4 + ldr r1, =gUnknown_085E9C17 + adds r0, r4, 0 + bl StringExpandPlaceholders + adds r0, r4, 0 + movs r1, 0 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =task_intro_gamefreak + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B7C10 + + thumb_func_start sub_81B7C74 +sub_81B7C74: @ 81B7C74 + push {r4-r6,lr} + adds r6, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x5 + bl PlaySE + ldr r2, =gUnknown_030061E8 + ldr r1, =gUnknown_0203CEC8 + ldr r0, [r1] + str r0, [r2] + ldrb r0, [r1, 0x9] + ldr r4, =gUnknown_0203CE7C + ldrh r1, [r4] + movs r2, 0 + bl ExecuteTableBasedItemEffect__ + lsls r0, 24 + cmp r0, 0 + beq _081B7CD8 + ldr r1, =gUnknown_0203CEE8 + movs r0, 0 + strb r0, [r1] + ldr r0, =gUnknown_085E96F6 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + str r6, [r0] + b _081B7CE4 + .pool +_081B7CD8: + ldrh r0, [r4] + movs r1, 0x1 + bl RemoveBagItem + bl sub_81B06F4 +_081B7CE4: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81B7C74 + + thumb_func_start GetItemEffectType +@ u8 GetItemEffectType(u16 itemId) +GetItemEffectType: @ 81B7CEC + push {r4,r5,lr} + lsls r0, 16 + lsrs r1, r0, 16 + adds r2, r1, 0 + subs r2, 0xD + lsls r0, r2, 16 + lsrs r0, 16 + cmp r0, 0xA5 + bls _081B7D00 + b _081B7E40 +_081B7D00: + cmp r1, 0xAF + bne _081B7D18 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldr r1, =0x00003214 + adds r4, r0, r1 + b _081B7D20 + .pool +_081B7D18: + ldr r1, =gItemEffectInfoPointers + lsls r0, r2, 2 + adds r0, r1 + ldr r4, [r0] +_081B7D20: + ldrb r1, [r4] + movs r5, 0x3F + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + bne _081B7D42 + ldrb r0, [r4, 0x1] + cmp r0, 0 + bne _081B7D42 + ldrb r0, [r4, 0x2] + cmp r0, 0 + bne _081B7D42 + ldrb r3, [r4, 0x3] + movs r0, 0x80 + ands r0, r3 + cmp r0, 0 + beq _081B7D4C +_081B7D42: + movs r0, 0 + b _081B7E46 + .pool +_081B7D4C: + movs r2, 0x40 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _081B7D5A + movs r0, 0xA + b _081B7E46 +_081B7D5A: + adds r0, r2, 0 + ands r0, r3 + cmp r0, 0 + beq _081B7D66 + movs r0, 0x1 + b _081B7E46 +_081B7D66: + adds r2, r5, 0 + ands r2, r3 + cmp r2, 0 + bne _081B7D74 + lsrs r0, r1, 7 + cmp r0, 0 + beq _081B7DB6 +_081B7D74: + cmp r2, 0x20 + bne _081B7D7C + movs r0, 0x4 + b _081B7E46 +_081B7D7C: + cmp r2, 0x10 + bne _081B7D84 + movs r0, 0x3 + b _081B7E46 +_081B7D84: + cmp r2, 0x8 + bne _081B7D8C + movs r0, 0x5 + b _081B7E46 +_081B7D8C: + cmp r2, 0x4 + bne _081B7D94 + movs r0, 0x6 + b _081B7E46 +_081B7D94: + cmp r2, 0x2 + bne _081B7D9C + movs r0, 0x7 + b _081B7E46 +_081B7D9C: + cmp r2, 0x1 + bne _081B7DA4 + movs r0, 0x8 + b _081B7E46 +_081B7DA4: + lsrs r0, r1, 7 + cmp r0, 0 + beq _081B7DB2 + cmp r2, 0 + bne _081B7DB2 + movs r0, 0x9 + b _081B7E46 +_081B7DB2: + movs r0, 0xB + b _081B7E46 +_081B7DB6: + ldrb r1, [r4, 0x4] + movs r0, 0x44 + ands r0, r1 + adds r2, r1, 0 + cmp r0, 0 + beq _081B7DC6 + movs r0, 0x2 + b _081B7E46 +_081B7DC6: + movs r5, 0x2 + adds r0, r5, 0 + ands r0, r2 + cmp r0, 0 + beq _081B7DD4 + movs r0, 0xC + b _081B7E46 +_081B7DD4: + movs r3, 0x1 + adds r0, r3, 0 + ands r0, r2 + cmp r0, 0 + beq _081B7DE2 + movs r0, 0xD + b _081B7E46 +_081B7DE2: + ldrb r1, [r4, 0x5] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _081B7DF0 + movs r0, 0xE + b _081B7E46 +_081B7DF0: + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _081B7DFC + movs r0, 0xF + b _081B7E46 +_081B7DFC: + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _081B7E08 + movs r0, 0x10 + b _081B7E46 +_081B7E08: + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _081B7E14 + movs r0, 0x11 + b _081B7E46 +_081B7E14: + movs r0, 0x80 + ands r0, r2 + cmp r0, 0 + beq _081B7E20 + movs r0, 0x12 + b _081B7E46 +_081B7E20: + movs r0, 0x20 + ands r0, r2 + cmp r0, 0 + beq _081B7E2C + movs r0, 0x13 + b _081B7E46 +_081B7E2C: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _081B7E38 + movs r0, 0x14 + b _081B7E46 +_081B7E38: + movs r0, 0x18 + ands r0, r2 + cmp r0, 0 + bne _081B7E44 +_081B7E40: + movs r0, 0x16 + b _081B7E46 +_081B7E44: + movs r0, 0x15 +_081B7E46: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end GetItemEffectType + + thumb_func_start sub_81B7E4C +sub_81B7E4C: @ 81B7E4C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B7F1C + ldr r7, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r7, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + movs r0, 0xE + adds r0, r7 + mov r8, r0 + ldr r1, =gStringVar1 + adds r0, r5, 0 + bl GetMonNickname + ldr r4, =gSpecialVar_0x8005 + ldrb r0, [r4] + bl sub_81B2360 + strh r0, [r7, 0xE] + ldr r0, =gStringVar2 + movs r1, 0xE + ldrsh r2, [r7, r1] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl StringCopy + movs r0, 0x2 + mov r1, r8 + strh r0, [r1, 0x2] + ldrb r2, [r4] + adds r0, r5, 0 + movs r1, 0 + bl sub_81B22D8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B7EF0 + cmp r0, 0x2 + beq _081B7EF8 + ldrh r1, [r7, 0xE] + adds r0, r5, 0 + bl pokemon_moveset_pad_ + lsls r0, 16 + ldr r1, =0xffff0000 + cmp r0, r1 + beq _081B7F08 + adds r0, r6, 0 + bl sub_81B6EB4 + b _081B7F1C + .pool +_081B7EF0: + ldr r1, =gUnknown_085E9AB4 + b _081B7EFA + .pool +_081B7EF8: + ldr r1, =gUnknown_085E9C00 +_081B7EFA: + adds r0, r6, 0 + bl sub_81B6D98 + b _081B7F1C + .pool +_081B7F08: + ldr r0, =gUnknown_085E9AE9 + bl sub_81B6D74 + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B6FF4 + str r1, [r0] +_081B7F1C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B7E4C + + thumb_func_start CB2_PartyMenuFromStartMenu +CB2_PartyMenuFromStartMenu: @ 81B7F34 + push {lr} + sub sp, 0xC + movs r0, 0 + str r0, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + ldr r0, =sub_8086194 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end CB2_PartyMenuFromStartMenu + + thumb_func_start sub_81B7F60 +sub_81B7F60: @ 81B7F60 + push {lr} + sub sp, 0xC + bl InBattlePyramid + lsls r0, 24 + ldr r1, =sub_81C4F84 + cmp r0, 0 + bne _081B7F72 + ldr r1, =c2_815ABFC +_081B7F72: + movs r0, 0x6 + str r0, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + str r1, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0x5 + movs r3, 0 + bl sub_81B0038 + ldr r1, =gUnknown_0203CEC8 + ldr r0, =gUnknown_0203CE7C + ldrh r0, [r0] + strh r0, [r1, 0xC] + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B7F60 + + thumb_func_start sub_81B7FAC +sub_81B7FAC: @ 81B7FAC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + ldr r5, =gUnknown_0203CEFC + ldr r0, =gUnknown_0203CEC8 + mov r9, r0 + ldrb r0, [r0, 0x9] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x64 + mov r8, r1 + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + ldr r7, =gPlayerParty + adds r0, r7 + movs r1, 0xC + bl GetMonData + strh r0, [r5] + lsls r0, 16 + cmp r0, 0 + bne _081B7FF8 + adds r0, r4, 0 + bl sub_81B8044 + b _081B8030 + .pool +_081B7FF8: + ldrh r0, [r5] + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _081B800C + adds r0, r4, 0 + bl sub_81B83B8 + b _081B8030 +_081B800C: + mov r1, r9 + movs r0, 0x9 + ldrsb r0, [r1, r0] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r7 + ldrh r1, [r5] + movs r2, 0x1 + bl sub_81B1D1C + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B82A0 + str r1, [r0] +_081B8030: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B7FAC + + thumb_func_start sub_81B8044 +sub_81B8044: @ 81B8044 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r5, =gUnknown_0203CEC8 + ldrh r0, [r5, 0xC] + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _081B807C + ldrh r0, [r5, 0xC] + bl sub_81B83F0 + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + ldr r0, =sub_81B814C + str r0, [r1, 0x4] + adds r0, r4, 0 + bl sub_81B12C0 + b _081B8082 + .pool +_081B807C: + adds r0, r4, 0 + bl sub_81B8088 +_081B8082: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81B8044 + + thumb_func_start sub_81B8088 +sub_81B8088: @ 81B8088 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B80E4 + ldr r4, =gUnknown_0203CEC8 + ldrh r5, [r4, 0xC] + movs r0, 0x9 + ldrsb r0, [r4, r0] + movs r1, 0x64 + mov r8, r1 + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + ldr r6, =gPlayerParty + adds r0, r6 + adds r1, r5, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_81B1C84 + movs r0, 0x9 + ldrsb r0, [r4, r0] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r6 + adds r1, r5, 0 + bl sub_81B1DB8 + adds r0, r5, 0 + bl sub_81B83F0 + ldr r1, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B8104 + str r1, [r0] +_081B80E4: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8088 + + thumb_func_start sub_81B8104 +sub_81B8104: @ 81B8104 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gUnknown_0203CEC8 + ldrb r4, [r0, 0x9] + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B8138 + lsls r2, r4, 24 + asrs r2, 24 + movs r0, 0x64 + muls r0, r2 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gUnknown_0203CEDC + lsls r2, 4 + ldr r1, [r1] + adds r1, r2 + bl sub_81B5C94 + adds r0, r5, 0 + bl sub_81B12C0 +_081B8138: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8104 + + thumb_func_start sub_81B814C +sub_81B814C: @ 81B814C + push {r4-r6,lr} + ldr r4, =gUnknown_0203CEC8 + movs r0, 0x9 + ldrsb r0, [r4, r0] + movs r6, 0x64 + muls r0, r6 + ldr r5, =gPlayerParty + adds r0, r5 + ldrh r1, [r4, 0xC] + bl sub_81B1DB8 + movs r0, 0x9 + ldrsb r0, [r4, r0] + muls r0, r6 + adds r0, r5 + movs r1, 0x40 + bl GetMonData + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gSaveBlock1Ptr + lsls r2, r0, 3 + adds r2, r0 + lsls r2, 2 + ldr r0, =0x00002be0 + adds r2, r0 + ldr r1, [r1] + adds r1, r2 + ldr r2, =sub_81B81A8 + movs r0, 0x4 + movs r3, 0x3 + bl sub_811A20C + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B814C + + thumb_func_start sub_81B81A8 +sub_81B81A8: @ 81B81A8 + push {r4-r7,lr} + sub sp, 0xC + ldr r6, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r6, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r7, r0, 16 + ldr r0, =gScriptResult + ldrh r0, [r0] + cmp r0, 0 + bne _081B8208 + adds r0, r5, 0 + bl sub_80D4680 + ldr r4, =gUnknown_0203CEFC + adds r0, r5, 0 + movs r1, 0xC + adds r2, r4, 0 + bl SetMonData + ldrh r0, [r4] + movs r1, 0x1 + bl RemoveBagItem + adds r0, r7, 0 + bl sub_81B841C + ldr r0, [r6] + bl SetMainCallback2 + b _081B8224 + .pool +_081B8208: + ldrb r0, [r6, 0x8] + lsls r0, 28 + lsrs r0, 28 + ldrb r2, [r6, 0xB] + movs r1, 0x7F + str r1, [sp] + ldr r1, =sub_81B8230 + str r1, [sp, 0x4] + ldr r1, [r6] + str r1, [sp, 0x8] + movs r1, 0xFF + movs r3, 0x1 + bl sub_81B0038 +_081B8224: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B81A8 + + thumb_func_start sub_81B8230 +sub_81B8230: @ 81B8230 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B828A + ldr r1, =gUnknown_0203CEFC + ldrh r0, [r1] + cmp r0, 0 + beq _081B8264 + ldr r0, =gUnknown_0203CEC8 + ldrh r0, [r0, 0xC] + ldrh r1, [r1] + movs r2, 0 + bl sub_81B1D68 + b _081B827C + .pool +_081B8264: + ldr r2, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r2, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + ldrh r1, [r2, 0xC] + movs r2, 0 + movs r3, 0x1 + bl sub_81B1C84 +_081B827C: + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B8104 + str r0, [r1] +_081B828A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8230 + + thumb_func_start sub_81B82A0 +sub_81B82A0: @ 81B82A0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B82C4 + bl sub_81B334C + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B82D4 + str r0, [r1] +_081B82C4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B82A0 + + thumb_func_start sub_81B82D4 +sub_81B82D4: @ 81B82D4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081B82FA + cmp r1, 0 + bgt _081B82F4 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081B8394 + b _081B83A8 +_081B82F4: + cmp r1, 0x1 + beq _081B839A + b _081B83A8 +_081B82FA: + ldr r7, =gUnknown_0203CEC8 + ldrh r4, [r7, 0xC] + adds r0, r4, 0 + bl sub_81B83F0 + ldr r6, =gUnknown_0203CEFC + ldrh r0, [r6] + movs r1, 0x1 + bl AddBagItem + lsls r0, 24 + cmp r0, 0 + bne _081B8338 + adds r0, r4, 0 + bl sub_81B841C + ldrh r0, [r6] + bl pokemon_item_not_removed + ldr r0, =gStringVar4 + movs r1, 0 + bl sub_81B1B5C + b _081B8378 + .pool +_081B8338: + adds r0, r4, 0 + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _081B835C + ldr r0, =gUnknown_0203CEC4 + ldr r1, [r0] + ldr r0, =sub_81B814C + str r0, [r1, 0x4] + adds r0, r5, 0 + bl sub_81B12C0 + b _081B83A8 + .pool +_081B835C: + movs r1, 0x9 + ldrsb r1, [r7, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + adds r1, r4, 0 + bl sub_81B1DB8 + ldrh r1, [r6] + adds r0, r4, 0 + movs r2, 0x1 + bl sub_81B1D68 +_081B8378: + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B8104 + str r1, [r0] + b _081B83A8 + .pool +_081B8394: + movs r0, 0x5 + bl PlaySE +_081B839A: + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B8104 + str r0, [r1] +_081B83A8: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B82D4 + + thumb_func_start sub_81B83B8 +sub_81B83B8: @ 81B83B8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_085E98EC + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B8104 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B83B8 + + thumb_func_start sub_81B83F0 +sub_81B83F0: @ 81B83F0 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0xB] + cmp r0, 0x6 + bne _081B8410 + lsls r0, r1, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_80D6E48 + b _081B8418 + .pool +_081B8410: + adds r0, r1, 0 + movs r1, 0x1 + bl RemoveBagItem +_081B8418: + pop {r0} + bx r0 + thumb_func_end sub_81B83F0 + + thumb_func_start sub_81B841C +sub_81B841C: @ 81B841C + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0xB] + cmp r0, 0x5 + beq _081B8438 + adds r0, r1, 0 + movs r1, 0x1 + bl sub_80D6D70 + b _081B8440 + .pool +_081B8438: + adds r0, r1, 0 + movs r1, 0x1 + bl AddBagItem +_081B8440: + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_81B841C + + thumb_func_start sub_81B8448 +sub_81B8448: @ 81B8448 + push {lr} + sub sp, 0xC + movs r0, 0x6 + str r0, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + ldr r0, =sub_816BB28 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0x7 + movs r3, 0 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8448 + + thumb_func_start sub_81B8474 +sub_81B8474: @ 81B8474 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =gUnknown_0203CEC8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =gPlayerParty + adds r5, r1, r0 + ldr r1, =gUnknown_0203CEE8 + movs r0, 0 + strb r0, [r1] + ldr r2, =gSaveBlock1Ptr + ldr r0, =gUnknown_0203BCB8 + ldrh r1, [r0] + adds r1, 0x6 + ldrh r0, [r0, 0x2] + adds r1, r0 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x00002be0 + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + adds r0, r5, 0 + movs r1, 0xC + bl GetMonData + cmp r0, 0 + beq _081B84DC + ldr r0, =gUnknown_085E9A08 + movs r1, 0x1 + bl sub_81B1B5C + b _081B84F2 + .pool +_081B84DC: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80D460C + adds r0, r4, 0 + bl sub_80D439C + ldr r0, =gUnknown_085E9A40 + movs r1, 0x1 + bl sub_81B1B5C +_081B84F2: + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, =gTasks + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B8104 + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8474 + + thumb_func_start sub_81B8518 +sub_81B8518: @ 81B8518 + push {lr} + sub sp, 0xC + bl sub_81B8558 + movs r0, 0 + str r0, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + ldr r0, =gMain + ldr r0, [r0, 0x8] + str r0, [sp, 0x8] + movs r0, 0x4 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_81B0038 + ldr r1, =gUnknown_0203CEC8 + ldr r0, =sub_81B879C + str r0, [r1, 0x4] + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8518 + + thumb_func_start sub_81B8558 +sub_81B8558: @ 81B8558 + push {lr} + ldr r0, =gUnknown_0203CEF8 + movs r1, 0 + movs r2, 0x4 + bl memset + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8558 + + thumb_func_start sub_81B856C +sub_81B856C: @ 81B856C + push {r4,lr} + lsls r0, 24 + asrs r4, r0, 24 + movs r0, 0x64 + muls r0, r4 + ldr r1, =gPlayerParty + adds r0, r1 + bl sub_81B85AC + lsls r0, 24 + cmp r0, 0 + bne _081B858C + movs r0, 0x2 + b _081B85A4 + .pool +_081B858C: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r0, 24 + bl sub_81B8770 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B85A2 + movs r0, 0 + b _081B85A4 +_081B85A2: + movs r0, 0x1 +_081B85A4: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B856C + + thumb_func_start sub_81B85AC +sub_81B85AC: @ 81B85AC + push {r4-r6,lr} + adds r5, r0, 0 + movs r6, 0 + movs r1, 0x2D + bl GetMonData + cmp r0, 0 + bne _081B8608 + adds r0, r5, 0 + movs r1, 0x38 + bl GetMonData + adds r4, r0, 0 + bl sub_81B8888 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bhi _081B8608 + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + ldrh r1, [r0, 0x4] + ldr r0, =0x0000191a + cmp r1, r0 + bne _081B85EA + adds r0, r5, 0 + movs r1, 0xC + bl GetMonData + cmp r0, 0 + bne _081B8608 +_081B85EA: + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x8 + beq _081B864A + cmp r0, 0x9 + bne _081B8618 + adds r0, r5, 0 + movs r1, 0x39 + bl GetMonData + cmp r0, 0 + bne _081B864A +_081B8608: + movs r0, 0 + b _081B864C + .pool +_081B8618: + adds r0, r5, 0 + movs r1, 0xB + bl GetMonData + lsls r0, 16 + lsrs r4, r0, 16 + ldr r3, =gUnknown_08611C9A + lsls r1, r6, 1 + adds r0, r1, r3 + ldrh r0, [r0] + ldr r2, =0x0000ffff + cmp r0, r2 + beq _081B864A +_081B8632: + adds r0, r1, r3 + ldrh r0, [r0] + cmp r0, r4 + beq _081B8608 + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, r6, 1 + adds r0, r1, r3 + ldrh r0, [r0] + cmp r0, r2 + bne _081B8632 +_081B864A: + movs r0, 0x1 +_081B864C: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B85AC + + thumb_func_start sub_81B865C +sub_81B865C: @ 81B865C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + bl sub_81B885C + lsls r0, 24 + lsrs r2, r0, 24 + adds r1, r2, 0 + ldr r3, =gUnknown_0203CEF8 + adds r0, r2, r3 + subs r0, 0x1 + ldrb r0, [r0] + cmp r0, 0 + bne _081B869C + cmp r2, 0x1 + bne _081B8688 + movs r0, 0xE + b _081B8758 + .pool +_081B8688: + ldr r0, =gStringVar1 + movs r2, 0 + movs r3, 0x1 + bl ConvertIntToDecimalStringN + movs r0, 0x11 + b _081B8758 + .pool +_081B869C: + ldr r0, =0x000040cf + bl VarGet + lsls r0, 24 + movs r1, 0xF8 + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x1 + bhi _081B86C0 + b _081B8756 + .pool +_081B86B8: + movs r0, 0x12 + b _081B8758 +_081B86BC: + movs r0, 0x13 + b _081B8758 +_081B86C0: + bl sub_81B8830 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r5, 0 + b _081B8750 +_081B86CE: + ldr r3, =gUnknown_0203CEF8 + adds r4, r3, r5 + ldrb r0, [r4] + movs r1, 0x64 + muls r0, r1 + subs r0, 0x64 + ldr r3, =gPlayerParty + adds r0, r3, r0 + movs r1, 0xB + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + ldrb r0, [r4] + movs r1, 0x64 + muls r0, r1 + subs r0, 0x64 + ldr r3, =gPlayerParty + adds r0, r3, r0 + movs r1, 0xC + bl GetMonData + lsls r0, 16 + lsrs r6, r0, 16 + adds r1, r5, 0x1 + lsls r0, r1, 24 + lsrs r4, r0, 24 + mov r9, r1 + cmp r4, r8 + bcs _081B8748 + movs r7, 0x64 +_081B870E: + ldr r0, =gUnknown_0203CEF8 + adds r5, r0, r4 + ldrb r0, [r5] + muls r0, r7 + subs r0, 0x64 + ldr r1, =gPlayerParty + adds r0, r1, r0 + movs r1, 0xB + bl GetMonData + cmp r10, r0 + beq _081B86B8 + cmp r6, 0 + beq _081B873E + ldrb r0, [r5] + muls r0, r7 + subs r0, 0x64 + ldr r3, =gPlayerParty + adds r0, r3, r0 + movs r1, 0xC + bl GetMonData + cmp r6, r0 + beq _081B86BC +_081B873E: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r8 + bcc _081B870E +_081B8748: + mov r1, r9 + lsls r0, r1, 24 + lsrs r5, r0, 24 + mov r0, r8 +_081B8750: + subs r0, 0x1 + cmp r5, r0 + blt _081B86CE +_081B8756: + movs r0, 0xFF +_081B8758: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B865C + + thumb_func_start sub_81B8770 +sub_81B8770: @ 81B8770 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + movs r1, 0 + ldr r3, =gUnknown_0203CEF8 +_081B877A: + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _081B878C + movs r0, 0x1 + b _081B8798 + .pool +_081B878C: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x3 + bls _081B877A + movs r0, 0 +_081B8798: + pop {r1} + bx r1 + thumb_func_end sub_81B8770 + + thumb_func_start sub_81B879C +sub_81B879C: @ 81B879C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_81B865C + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xFF + beq _081B87D4 + movs r0, 0x20 + bl PlaySE + adds r0, r4, 0 + bl display_pokemon_menu_message + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B87E8 + str r0, [r1] + b _081B87E0 + .pool +_081B87D4: + movs r0, 0x5 + bl PlaySE + adds r0, r5, 0 + bl sub_81B12C0 +_081B87E0: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81B879C + + thumb_func_start sub_81B87E8 +sub_81B87E8: @ 81B87E8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081B8802 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081B881C +_081B8802: + movs r0, 0x5 + bl PlaySE + movs r0, 0 + bl display_pokemon_menu_message + ldr r0, =gTasks + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B1370 + str r0, [r1] +_081B881C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B87E8 + + thumb_func_start sub_81B8830 +sub_81B8830: @ 81B8830 + push {lr} + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x8 + beq _081B884C + cmp r0, 0x9 + bne _081B8850 + movs r0, 0x3 + b _081B8854 + .pool +_081B884C: + movs r0, 0x2 + b _081B8854 +_081B8850: + ldr r0, =gSpecialVar_0x8005 + ldrb r0, [r0] +_081B8854: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B8830 + + thumb_func_start sub_81B885C +sub_81B885C: @ 81B885C + push {lr} + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x8 + beq _081B8878 + cmp r0, 0x9 + bne _081B887C + movs r0, 0x1 + b _081B8880 + .pool +_081B8878: + movs r0, 0x2 + b _081B8880 +_081B887C: + ldr r0, =gSpecialVar_0x8005 + ldrb r0, [r0] +_081B8880: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B885C + + thumb_func_start sub_81B8888 +sub_81B8888: @ 81B8888 + push {lr} + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x8 + beq _081B88A4 + cmp r0, 0x9 + bne _081B88A8 +_081B889C: + movs r0, 0x64 + b _081B88B2 + .pool +_081B88A4: + movs r0, 0x1E + b _081B88B2 +_081B88A8: + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + cmp r0, 0 + bne _081B889C + movs r0, 0x32 +_081B88B2: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B8888 + + thumb_func_start sub_81B88BC +sub_81B88BC: @ 81B88BC + push {lr} + ldr r0, =0x000040cf + bl VarGet + lsls r0, 24 + lsrs r1, r0, 24 + movs r2, 0xF8 + lsls r2, 24 + adds r0, r2 + lsrs r0, 24 + cmp r0, 0x1 + bhi _081B88E0 + ldr r0, =gUnknown_085EA126 + b _081B88FA + .pool +_081B88E0: + cmp r1, 0x1 + bne _081B88F8 + ldr r0, =gSpecialVar_0x8005 + ldrh r0, [r0] + cmp r0, 0x2 + bne _081B88F8 + ldr r0, =gUnknown_085EA139 + b _081B88FA + .pool +_081B88F8: + ldr r0, =gUnknown_085EA155 +_081B88FA: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B88BC + + thumb_func_start sub_81B8904 +sub_81B8904: @ 81B8904 + push {lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + movs r2, 0 + str r2, [sp] + ldr r2, =sub_81B1370 + str r2, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8904 + + thumb_func_start sub_81B892C +sub_81B892C: @ 81B892C + push {lr} + sub sp, 0xC + movs r0, 0x4 + str r0, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0xC + movs r3, 0 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B892C + + thumb_func_start sub_81B8958 +sub_81B8958: @ 81B8958 + push {lr} + sub sp, 0xC + movs r0, 0x1 + str r0, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + str r0, [sp, 0x8] + movs r0, 0xB + movs r1, 0 + movs r2, 0xD + movs r3, 0 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8958 + + thumb_func_start sub_81B8984 +sub_81B8984: @ 81B8984 + push {lr} + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + bne _081B8994 + movs r0, 0 + b _081B89A6 +_081B8994: + bl sub_81B1250 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B89A4 + movs r0, 0x1 + b _081B89A6 +_081B89A4: + movs r0, 0x2 +_081B89A6: + pop {r1} + bx r1 + thumb_func_end sub_81B8984 + + thumb_func_start sub_81B89AC +sub_81B89AC: @ 81B89AC + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_81B8984 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0 + str r0, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + ldr r0, =sub_8059D40 + str r0, [sp, 0x8] + movs r0, 0x1 + adds r2, r4, 0 + movs r3, 0 + bl sub_81B0038 + bl nullsub_35 + bl pokemon_change_order + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B89AC + + thumb_func_start sub_81B89F0 +sub_81B89F0: @ 81B89F0 + push {lr} + sub sp, 0xC + bl sub_81B8984 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x5 + str r0, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + ldr r0, =c2_815ABFC + str r0, [sp, 0x8] + movs r0, 0x1 + movs r2, 0x3 + movs r3, 0 + bl sub_81B0038 + bl nullsub_35 + bl pokemon_change_order + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B89F0 + + thumb_func_start sub_81B8A2C +sub_81B8A2C: @ 81B8A2C + push {r4,lr} + adds r4, r0, 0 + ldr r0, =gUnknown_02024550 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B8A74 + adds r0, r4, 0 + movs r1, 0x2D + bl GetMonData + cmp r0, 0 + bne _081B8A74 + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0xB] + cmp r0, 0x1 + bne _081B8A5C + movs r0, 0x3 + b _081B8A76 + .pool +_081B8A5C: + ldr r0, =gBattleTypeFlags + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + bne _081B8A74 + movs r0, 0x2 + b _081B8A76 + .pool +_081B8A74: + movs r0, 0x7 +_081B8A76: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81B8A2C + + thumb_func_start sub_81B8A7C +sub_81B8A7C: @ 81B8A7C + push {r4-r7,lr} + mov r7, r8 + push {r7} + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_81B1250 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B8AC4 + cmp r5, 0x1 + beq _081B8AA2 + cmp r5, 0x4 + beq _081B8AA2 + cmp r5, 0x5 + bne _081B8AC4 +_081B8AA2: + ldr r4, =gStringVar1 + bl sub_806EBF8 + adds r1, r0, 0 + adds r0, r4, 0 + bl StringCopy + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E97B2 + b _081B8C42 + .pool +_081B8AC4: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =gPlayerParty + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x39 + bl GetMonData + cmp r0, 0 + bne _081B8AF8 + ldr r1, =gStringVar1 + adds r0, r4, 0 + bl GetMonNickname + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E978F + b _081B8C42 + .pool +_081B8AF8: + movs r4, 0 + b _081B8B24 +_081B8AFC: + adds r0, r4, 0 + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + bne _081B8B1E + adds r0, r5, 0 + bl sub_81B8F38 + lsls r0, 24 + ldr r2, =gBattlePartyID + lsls r1, r4, 1 + adds r1, r2 + lsrs r0, 24 + ldrh r1, [r1] + cmp r0, r1 + beq _081B8BFC +_081B8B1E: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081B8B24: + ldr r0, =gNoOfAllBanks + ldrb r0, [r0] + cmp r4, r0 + bcc _081B8AFC + movs r7, 0x64 + adds r0, r5, 0 + muls r0, r7 + ldr r1, =gPlayerParty + mov r8, r1 + adds r6, r0, r1 + adds r0, r6, 0 + movs r1, 0x2D + bl GetMonData + cmp r0, 0 + beq _081B8B60 + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E97E5 + b _081B8C42 + .pool +_081B8B60: + adds r0, r5, 0 + bl sub_81B8F38 + ldr r1, =gBattleStruct + ldr r1, [r1] + adds r1, 0x8B + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bne _081B8B94 + ldr r1, =gStringVar1 + adds r0, r6, 0 + bl GetMonNickname + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E976F + b _081B8C42 + .pool +_081B8B94: + ldr r0, =gUnknown_0203CEC8 + ldrb r0, [r0, 0xB] + cmp r0, 0x4 + bne _081B8BA8 + bl sub_806E994 + b _081B8C46 + .pool +_081B8BA8: + cmp r0, 0x2 + beq _081B8C20 + adds r0, r5, 0 + bl sub_81B8F38 + ldr r1, =gUnknown_0203CEE9 + strb r0, [r1] + ldr r1, =gUnknown_0203CEE8 + movs r0, 0x1 + strb r0, [r1] + ldr r1, =gBattlePartyID + ldr r0, =gUnknown_020244B8 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrb r0, [r0] + bl pokemon_order_func + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_81B8FB0 + adds r0, r4, 0 + muls r0, r7 + add r0, r8 + adds r1, r6, 0 + bl sub_81B1288 + movs r0, 0x1 + b _081B8C48 + .pool +_081B8BFC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gStringVar1 + bl GetMonNickname + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9754 + b _081B8C42 + .pool +_081B8C20: + ldr r0, =gUnknown_020244B8 + ldrb r0, [r0] + ldr r1, =gBattlePartyID + lsls r0, 1 + adds r0, r1 + ldrb r0, [r0] + bl pokemon_order_func + lsls r0, 24 + lsrs r0, 24 + muls r0, r7 + add r0, r8 + ldr r1, =gStringVar1 + bl GetMonNickname + ldr r0, =gStringVar4 + ldr r1, =gUnknown_085E9738 +_081B8C42: + bl StringExpandPlaceholders +_081B8C46: + movs r0, 0 +_081B8C48: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B8A7C + + thumb_func_start sub_81B8C68 +sub_81B8C68: @ 81B8C68 + push {r4,lr} + ldr r4, =gUnknown_0203CF00 + bl sub_806D7EC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_81B8C88 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8C68 + + thumb_func_start sub_81B8C88 +sub_81B8C88: @ 81B8C88 + push {r4-r6,lr} + sub sp, 0x8 + adds r6, r0, 0 + lsls r1, 24 + lsrs r4, r1, 24 + bl sub_81B1250 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B8CBE + cmp r4, 0 + beq _081B8CB0 + movs r0, 0x30 + strb r0, [r6] + movs r0, 0x45 + strb r0, [r6, 0x1] + movs r0, 0x12 + strb r0, [r6, 0x2] + b _081B8D58 +_081B8CB0: + movs r0, 0x3 + strb r0, [r6] + movs r0, 0x12 + strb r0, [r6, 0x1] + movs r0, 0x45 + strb r0, [r6, 0x2] + b _081B8D58 +_081B8CBE: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + bne _081B8CFC + movs r5, 0x1 + movs r0, 0 + bl GetBankByPlayerAI + mov r2, sp + ldr r1, =gBattlePartyID + lsls r0, 24 + lsrs r0, 23 + adds r0, r1 + ldrh r0, [r0] + strb r0, [r2] + movs r4, 0 + mov r1, sp +_081B8CE2: + ldrb r0, [r1] + cmp r4, r0 + beq _081B8CF0 + mov r2, sp + adds r0, r2, r5 + strb r4, [r0] + adds r5, 0x1 +_081B8CF0: + adds r4, 0x1 + cmp r4, 0x5 + ble _081B8CE2 + b _081B8D40 + .pool +_081B8CFC: + movs r5, 0x2 + movs r0, 0 + bl GetBankByPlayerAI + mov r1, sp + ldr r4, =gBattlePartyID + lsls r0, 24 + lsrs r0, 23 + adds r0, r4 + ldrh r0, [r0] + strb r0, [r1] + movs r0, 0x2 + bl GetBankByPlayerAI + mov r1, sp + lsls r0, 24 + lsrs r0, 23 + adds r0, r4 + ldrh r0, [r0] + strb r0, [r1, 0x1] + movs r4, 0 +_081B8D26: + ldrb r0, [r1] + cmp r4, r0 + beq _081B8D3A + ldrb r0, [r1, 0x1] + cmp r4, r0 + beq _081B8D3A + mov r2, sp + adds r0, r2, r5 + strb r4, [r0] + adds r5, 0x1 +_081B8D3A: + adds r4, 0x1 + cmp r4, 0x5 + ble _081B8D26 +_081B8D40: + movs r4, 0 + mov r3, sp +_081B8D44: + adds r0, r6, r4 + ldrb r1, [r3] + lsls r1, 4 + ldrb r2, [r3, 0x1] + orrs r1, r2 + strb r1, [r0] + adds r3, 0x2 + adds r4, 0x1 + cmp r4, 0x2 + ble _081B8D44 +_081B8D58: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8C88 + + thumb_func_start sub_81B8D64 +sub_81B8D64: @ 81B8D64 + push {lr} + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r0, =gBattleStruct + lsls r3, r2, 1 + adds r3, r2 + adds r3, 0x60 + ldr r0, [r0] + adds r0, r3 + bl sub_81B8D88 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8D64 + + thumb_func_start sub_81B8D88 +sub_81B8D88: @ 81B8D88 + push {r4-r7,lr} + sub sp, 0x8 + adds r5, r0, 0 + adds r0, r2, 0 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r0, 24 + lsrs r0, 24 + bl GetBankSide + lsls r0, 24 + cmp r0, 0 + bne _081B8DB0 + movs r0, 0 + bl GetBankByPlayerAI + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x2 + b _081B8DBC +_081B8DB0: + movs r0, 0x1 + bl GetBankByPlayerAI + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x3 +_081B8DBC: + bl GetBankByPlayerAI + lsls r0, 24 + lsrs r6, r0, 24 + bl sub_81B1250 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081B8DF0 + cmp r7, 0 + beq _081B8DE2 + movs r0, 0x30 + strb r0, [r5] + movs r0, 0x45 + strb r0, [r5, 0x1] + movs r0, 0x12 + strb r0, [r5, 0x2] + b _081B8E72 +_081B8DE2: + movs r0, 0x3 + strb r0, [r5] + movs r0, 0x12 + strb r0, [r5, 0x1] + movs r0, 0x45 + strb r0, [r5, 0x2] + b _081B8E72 +_081B8DF0: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + bne _081B8E28 + movs r3, 0x1 + mov r2, sp + ldr r1, =gBattlePartyID + lsls r0, r4, 1 + adds r0, r1 + ldrh r0, [r0] + strb r0, [r2] + movs r4, 0 + mov r1, sp +_081B8E0C: + ldrb r0, [r1] + cmp r4, r0 + beq _081B8E1A + mov r2, sp + adds r0, r2, r3 + strb r4, [r0] + adds r3, 0x1 +_081B8E1A: + adds r4, 0x1 + cmp r4, 0x5 + ble _081B8E0C + b _081B8E5A + .pool +_081B8E28: + movs r3, 0x2 + mov r1, sp + ldr r2, =gBattlePartyID + lsls r0, r4, 1 + adds r0, r2 + ldrh r0, [r0] + strb r0, [r1] + lsls r0, r6, 1 + adds r0, r2 + ldrh r0, [r0] + strb r0, [r1, 0x1] + movs r4, 0 +_081B8E40: + ldrb r0, [r1] + cmp r4, r0 + beq _081B8E54 + ldrb r0, [r1, 0x1] + cmp r4, r0 + beq _081B8E54 + mov r2, sp + adds r0, r2, r3 + strb r4, [r0] + adds r3, 0x1 +_081B8E54: + adds r4, 0x1 + cmp r4, 0x5 + ble _081B8E40 +_081B8E5A: + movs r4, 0 + mov r3, sp +_081B8E5E: + adds r0, r5, r4 + ldrb r1, [r3] + lsls r1, 4 + ldrb r2, [r3, 0x1] + orrs r1, r2 + strb r1, [r0] + adds r3, 0x2 + adds r4, 0x1 + cmp r4, 0x2 + ble _081B8E5E +_081B8E72: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8D88 + + thumb_func_start sub_81B8E80 +sub_81B8E80: @ 81B8E80 + push {r4-r7,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r6, r2, 24 + movs r7, 0 + bl sub_81B1250 + lsls r0, 24 + cmp r0, 0 + beq _081B8F2E + ldr r0, =gBattleStruct + lsls r1, r4, 1 + adds r1, r4 + adds r1, 0x60 + ldr r0, [r0] + adds r4, r0, r1 + movs r2, 0 + add r6, sp + mov r12, r6 + movs r6, 0xF + mov r3, sp +_081B8EB2: + adds r1, r4, r2 + ldrb r0, [r1] + lsrs r0, 4 + strb r0, [r3] + adds r3, 0x1 + ldrb r1, [r1] + adds r0, r6, 0 + ands r0, r1 + strb r0, [r3] + adds r3, 0x1 + adds r2, 0x1 + cmp r2, 0x2 + ble _081B8EB2 + mov r0, r12 + ldrb r3, [r0] + movs r2, 0 + mov r0, sp + ldrb r0, [r0] + cmp r0, r5 + bne _081B8EE8 + mov r0, sp + ldrb r7, [r0] + strb r3, [r0] + b _081B8EFC + .pool +_081B8EE8: + adds r2, 0x1 + cmp r2, 0x5 + bgt _081B8EFC + mov r0, sp + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, r5 + bne _081B8EE8 + adds r7, r0, 0 + strb r3, [r1] +_081B8EFC: + cmp r2, 0x6 + beq _081B8F2E + mov r0, r12 + strb r7, [r0] + mov r0, sp + ldrb r0, [r0] + lsls r0, 4 + mov r1, sp + ldrb r1, [r1, 0x1] + orrs r0, r1 + strb r0, [r4] + mov r0, sp + ldrb r0, [r0, 0x2] + lsls r0, 4 + mov r1, sp + ldrb r1, [r1, 0x3] + orrs r0, r1 + strb r0, [r4, 0x1] + mov r0, sp + ldrb r0, [r0, 0x4] + lsls r0, 4 + mov r1, sp + ldrb r1, [r1, 0x5] + orrs r0, r1 + strb r0, [r4, 0x2] +_081B8F2E: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B8E80 + + thumb_func_start sub_81B8F38 +sub_81B8F38: @ 81B8F38 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + movs r1, 0x1 + ands r1, r2 + lsrs r2, r0, 25 + cmp r1, 0 + beq _081B8F58 + ldr r0, =gUnknown_0203CF00 + adds r0, r2, r0 + ldrb r0, [r0] + movs r1, 0xF + ands r1, r0 + b _081B8F60 + .pool +_081B8F58: + ldr r0, =gUnknown_0203CF00 + adds r0, r2, r0 + ldrb r0, [r0] + lsrs r1, r0, 4 +_081B8F60: + adds r0, r1, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B8F38 + + thumb_func_start sub_81B8F6C +sub_81B8F6C: @ 81B8F6C + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + movs r1, 0x1 + ands r1, r3 + lsrs r3, r0, 25 + cmp r1, 0 + beq _081B8F94 + ldr r0, =gUnknown_0203CF00 + adds r0, r3, r0 + ldrb r2, [r0] + movs r1, 0xF0 + ands r1, r2 + orrs r1, r4 + strb r1, [r0] + b _081B8FA4 + .pool +_081B8F94: + ldr r2, =gUnknown_0203CF00 + adds r2, r3, r2 + ldrb r1, [r2] + movs r0, 0xF + ands r0, r1 + lsls r1, r4, 4 + orrs r0, r1 + strb r0, [r2] +_081B8FA4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B8F6C + + thumb_func_start sub_81B8FB0 +sub_81B8FB0: @ 81B8FB0 + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + adds r0, r5, 0 + bl sub_81B8F38 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r6, 0 + bl sub_81B8F38 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl sub_81B8F6C + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_81B8F6C + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81B8FB0 + + thumb_func_start pokemon_order_func +pokemon_order_func: @ 81B8FEC + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r3, 0 + movs r2, 0 + ldr r5, =gUnknown_0203CF00 +_081B8FF8: + adds r0, r3, r5 + ldrb r1, [r0] + lsrs r0, r1, 4 + cmp r0, r4 + beq _081B9010 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + movs r0, 0xF + ands r0, r1 + cmp r0, r4 + bne _081B9018 +_081B9010: + adds r0, r2, 0 + b _081B902A + .pool +_081B9018: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x2 + bls _081B8FF8 + movs r0, 0 +_081B902A: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end pokemon_order_func + + thumb_func_start pokemon_change_order +pokemon_change_order: @ 81B9030 + push {r4-r6,lr} + movs r4, 0x96 + lsls r4, 2 + adds r0, r4, 0 + bl Alloc + adds r5, r0, 0 + ldr r1, =gPlayerParty + adds r2, r4, 0 + bl memcpy + movs r4, 0 + movs r6, 0x64 +_081B904A: + adds r0, r4, 0 + bl pokemon_order_func + lsls r0, 24 + lsrs r0, 24 + muls r0, r6 + ldr r1, =gPlayerParty + adds r0, r1 + adds r1, r4, 0 + muls r1, r6 + adds r1, r5 + movs r2, 0x64 + bl memcpy + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _081B904A + adds r0, r5, 0 + bl Free + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end pokemon_change_order + + thumb_func_start sub_81B9080 +sub_81B9080: @ 81B9080 + push {r4-r6,lr} + movs r4, 0x96 + lsls r4, 2 + adds r0, r4, 0 + bl Alloc + adds r5, r0, 0 + ldr r1, =gPlayerParty + adds r2, r4, 0 + bl memcpy + movs r4, 0 + movs r6, 0x64 +_081B909A: + adds r0, r4, 0 + bl sub_81B8F38 + lsls r0, 24 + lsrs r0, 24 + muls r0, r6 + ldr r1, =gPlayerParty + adds r0, r1 + adds r1, r4, 0 + muls r1, r6 + adds r1, r5 + movs r2, 0x64 + bl memcpy + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _081B909A + adds r0, r5, 0 + bl Free + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9080 + + thumb_func_start sub_81B90D0 +sub_81B90D0: @ 81B90D0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r6, 0x1 + movs r7, 0x64 + ldr r0, =gPlayerParty + mov r8, r0 +_081B90DE: + adds r0, r6, 0 + bl sub_81B8F38 + lsls r0, 24 + lsrs r0, 24 + muls r0, r7 + mov r1, r8 + adds r5, r0, r1 + adds r0, r5, 0 + movs r1, 0xB + bl GetMonData + cmp r0, 0 + beq _081B912C + adds r0, r5, 0 + movs r1, 0x39 + bl GetMonData + cmp r0, 0 + beq _081B912C + movs r0, 0 + bl sub_81B8F38 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + adds r1, r6, 0 + bl sub_81B8FB0 + adds r0, r4, 0 + muls r0, r7 + add r0, r8 + adds r1, r5, 0 + bl sub_81B1288 + b _081B9136 + .pool +_081B912C: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x5 + bls _081B90DE +_081B9136: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81B90D0 + + thumb_func_start sub_81B9140 +sub_81B9140: @ 81B9140 + push {lr} + ldr r0, =sub_8059D40 + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9140 + + thumb_func_start sub_81B9150 +sub_81B9150: @ 81B9150 + push {lr} + sub sp, 0xC + movs r0, 0x7F + str r0, [sp] + ldr r0, =sub_81B917C + str r0, [sp, 0x4] + ldr r0, =gMain + ldr r0, [r0, 0x8] + str r0, [sp, 0x8] + movs r0, 0x5 + movs r1, 0x3 + movs r2, 0 + movs r3, 0 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9150 + + thumb_func_start sub_81B917C +sub_81B917C: @ 81B917C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gTasks + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + movs r1, 0x80 + lsls r1, 1 + strh r1, [r4, 0x8] + bl sub_81B9294 + movs r1, 0x80 + lsls r1, 9 + movs r0, 0x2 + movs r2, 0 + bl ChangeBgX + ldr r0, =sub_81B91B4 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B917C + + thumb_func_start sub_81B91B4 +sub_81B91B4: @ 81B91B4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r6, r5, 2 + adds r0, r6, r5 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r4, r0, r1 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B9220 + ldrh r0, [r4] + subs r0, 0x8 + strh r0, [r4] + adds r0, r5, 0 + bl sub_81B9294 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081B9220 + movs r4, 0x3 + ldr r7, =gUnknown_02022FF8 +_081B91E8: + subs r0, r4, 0x3 + lsls r0, 5 + adds r0, r7 + ldrh r0, [r0] + cmp r0, 0 + beq _081B9204 + ldr r0, =gUnknown_0203CEDC + ldr r1, [r0] + lsls r0, r4, 4 + adds r0, r1 + ldrb r0, [r0, 0x9] + movs r1, 0 + bl sub_81B5B6C +_081B9204: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _081B91E8 + movs r0, 0x78 + bl PlaySE + ldr r0, =gTasks + adds r1, r6, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B9240 + str r0, [r1] +_081B9220: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B91B4 + + thumb_func_start sub_81B9240 +sub_81B9240: @ 81B9240 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + strh r1, [r0] + lsls r1, 16 + movs r0, 0x80 + lsls r0, 17 + cmp r1, r0 + bne _081B9266 + adds r0, r2, 0 + bl sub_81B12C0 +_081B9266: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9240 + + thumb_func_start sub_81B9270 +sub_81B9270: @ 81B9270 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 16 + lsrs r3, r1, 16 + cmp r1, 0 + blt _081B928A + ldr r1, =gSprites + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + strh r3, [r0, 0x24] +_081B928A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9270 + + thumb_func_start sub_81B9294 +sub_81B9294: @ 81B9294 + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + 0x8 + adds r5, r1, r0 + movs r6, 0x3 + ldr r7, =gUnknown_0203CEDC +_081B92A8: + ldr r0, =gUnknown_02022FF8 + subs r1, r6, 0x3 + lsls r1, 5 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + beq _081B9300 + ldr r0, [r7] + lsls r4, r6, 4 + adds r0, r4, r0 + ldrb r0, [r0, 0x9] + ldrh r1, [r5] + subs r1, 0x8 + lsls r1, 16 + asrs r1, 16 + bl sub_81B9270 + ldr r0, [r7] + adds r0, r4, r0 + ldrb r0, [r0, 0xA] + ldrh r1, [r5] + subs r1, 0x8 + lsls r1, 16 + asrs r1, 16 + bl sub_81B9270 + ldr r0, [r7] + adds r0, r4, r0 + ldrb r0, [r0, 0xB] + ldrh r1, [r5] + subs r1, 0x8 + lsls r1, 16 + asrs r1, 16 + bl sub_81B9270 + ldr r0, [r7] + adds r4, r0 + ldrb r0, [r4, 0xC] + ldrh r1, [r5] + subs r1, 0x8 + lsls r1, 16 + asrs r1, 16 + bl sub_81B9270 +_081B9300: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x5 + bls _081B92A8 + movs r1, 0x80 + lsls r1, 4 + movs r0, 0x2 + movs r2, 0x1 + bl ChangeBgX + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9294 + + thumb_func_start sub_81B9328 +sub_81B9328: @ 81B9328 + push {lr} + sub sp, 0xC + movs r0, 0xF + str r0, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + ldr r0, =sub_81B9390 + str r0, [sp, 0x8] + movs r0, 0x6 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9328 + + thumb_func_start sub_81B9354 +sub_81B9354: @ 81B9354 + push {lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gUnknown_03005DB0 + ldr r1, =hm_add_c3_without_phase_2 + str r1, [r2] + movs r1, 0 + str r1, [sp] + ldr r1, =sub_81B1370 + str r1, [sp, 0x4] + ldr r1, =c2_exit_to_overworld_2_switch + str r1, [sp, 0x8] + movs r1, 0 + movs r2, 0xB + movs r3, 0 + bl sub_81B0038 + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9354 + + thumb_func_start sub_81B9390 +sub_81B9390: @ 81B9390 + push {r4,lr} + ldr r4, =gSpecialVar_0x8004 + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + cmp r0, 0x5 + bls _081B93A6 + movs r0, 0xFF + strh r0, [r4] +_081B93A6: + ldr r0, =gUnknown_03005DB0 + ldr r1, =hm_add_c3_without_phase_2 + str r1, [r0] + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9390 + + thumb_func_start hm_add_c3_without_phase_2 +hm_add_c3_without_phase_2: @ 81B93C8 + push {lr} + bl pal_fill_black + ldr r0, =task_hm_without_phase_2 + movs r1, 0xA + bl CreateTask + movs r0, 0x1 + pop {r1} + bx r1 + .pool + thumb_func_end hm_add_c3_without_phase_2 + + thumb_func_start task_hm_without_phase_2 +task_hm_without_phase_2: @ 81B93E0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80ABDFC + lsls r0, 24 + cmp r0, 0 + beq _081B93FE + adds r0, r4, 0 + bl DestroyTask + bl script_env_2_disable + bl script_env_2_enable_and_set_ctx_running +_081B93FE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end task_hm_without_phase_2 + + thumb_func_start sub_81B9404 +sub_81B9404: @ 81B9404 + push {lr} + bl script_env_2_enable + movs r0, 0x1 + movs r1, 0 + bl fade_screen + ldr r0, =sub_81B9424 + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9404 + + thumb_func_start sub_81B9424 +sub_81B9424: @ 81B9424 + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _081B945C + bl overworld_free_bg_tilemaps + str r4, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + ldr r0, =sub_81B9470 + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0 + movs r2, 0xB + movs r3, 0 + bl sub_81B0038 + adds r0, r5, 0 + bl DestroyTask +_081B945C: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9424 + + thumb_func_start sub_81B9470 +sub_81B9470: @ 81B9470 + push {lr} + bl brm_get_pokemon_selection + ldr r2, =gUnknown_02039F24 + strb r0, [r2] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bls _081B9486 + movs r0, 0xFF + strb r0, [r2] +_081B9486: + ldr r1, =gSpecialVar_0x8004 + ldrb r0, [r2] + strh r0, [r1] + ldr r1, =gUnknown_03005DB0 + ldr r0, =hm_add_c3_without_phase_2 + str r0, [r1] + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9470 + + thumb_func_start sub_81B94B0 +sub_81B94B0: @ 81B94B0 + push {lr} + bl script_env_2_enable + movs r0, 0x1 + movs r1, 0 + bl fade_screen + ldr r0, =sub_81B94D0 + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B94B0 + + thumb_func_start sub_81B94D0 +sub_81B94D0: @ 81B94D0 + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _081B9508 + bl overworld_free_bg_tilemaps + str r4, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + ldr r0, =sub_81B9390 + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0 + movs r2, 0xB + movs r3, 0 + bl sub_81B0038 + adds r0, r5, 0 + bl DestroyTask +_081B9508: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B94D0 + + thumb_func_start sub_81B951C +sub_81B951C: @ 81B951C + push {lr} + bl script_env_2_enable + movs r0, 0x1 + movs r1, 0 + bl fade_screen + ldr r0, =sub_81B953C + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B951C + + thumb_func_start sub_81B953C +sub_81B953C: @ 81B953C + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _081B9574 + bl overworld_free_bg_tilemaps + str r4, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + ldr r0, =sub_81B9588 + str r0, [sp, 0x8] + movs r0, 0x7 + movs r1, 0 + movs r2, 0xB + movs r3, 0 + bl sub_81B0038 + adds r0, r5, 0 + bl DestroyTask +_081B9574: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B953C + + thumb_func_start sub_81B9588 +sub_81B9588: @ 81B9588 + push {r4,r5,lr} + ldr r5, =gSpecialVar_0x8004 + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5] + cmp r0, 0x5 + bls _081B95A4 + movs r0, 0xFF + strh r0, [r5] + b _081B95BA + .pool +_081B95A4: + ldr r4, =gSpecialVar_0x8005 + ldrh r1, [r5] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + bl sub_806E25C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] +_081B95BA: + ldr r0, =gUnknown_03005DB0 + ldr r1, =hm_add_c3_without_phase_2 + str r1, [r0] + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9588 + + thumb_func_start sub_81B95E0 +sub_81B95E0: @ 81B95E0 + push {r4,r5,lr} + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] + movs r4, 0 + adds r5, r1, 0 + b _081B95FA + .pool +_081B95F4: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081B95FA: + cmp r4, 0x2 + bhi _081B9614 + movs r0, 0x64 + muls r0, r4 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0xC + bl GetMonData + cmp r0, 0 + beq _081B95F4 + movs r0, 0x1 + strh r0, [r5] +_081B9614: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B95E0 + + thumb_func_start sub_81B9620 +sub_81B9620: @ 81B9620 + push {lr} + bl script_env_2_enable + movs r0, 0x1 + movs r1, 0 + bl fade_screen + ldr r0, =sub_81B9640 + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9620 + + thumb_func_start sub_81B9640 +sub_81B9640: @ 81B9640 + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _081B9678 + bl overworld_free_bg_tilemaps + str r4, [sp] + ldr r0, =sub_81B1370 + str r0, [sp, 0x4] + ldr r0, =sub_81B9390 + str r0, [sp, 0x8] + movs r0, 0xC + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_81B0038 + adds r0, r5, 0 + bl DestroyTask +_081B9678: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9640 + + thumb_func_start sub_81B968C +sub_81B968C: @ 81B968C + push {lr} + sub sp, 0x4 + ldr r1, =gPlayerParty + ldr r0, =gSpecialVar_0x8004 + ldrb r2, [r0] + ldr r0, =gUnknown_020244E9 + ldrb r3, [r0] + subs r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + ldr r0, =c2_exit_to_overworld_2_switch + str r0, [sp] + movs r0, 0x3 + bl sub_81BF8EC + ldr r1, =gUnknown_03005DAC + ldr r0, =sub_80AF168 + str r0, [r1] + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B968C + + thumb_func_start sub_81B96D0 +sub_81B96D0: @ 81B96D0 + push {r4,r5,lr} + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] + movs r4, 0 + adds r5, r1, 0 +_081B96DC: + ldr r0, =gSpecialVar_0x8004 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + adds r1, r4, 0 + adds r1, 0xD + bl GetMonData + cmp r0, 0 + beq _081B96FA + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] +_081B96FA: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _081B96DC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B96D0 + + thumb_func_start sub_81B9718 +sub_81B9718: @ 81B9718 + push {r4,r5,lr} + ldr r0, =gSpecialVar_0x8004 + ldrh r1, [r0] + movs r0, 0x64 + adds r5, r1, 0 + muls r5, r0 + ldr r0, =gPlayerParty + adds r5, r0 + ldr r0, =gSpecialVar_0x8005 + ldrh r1, [r0] + adds r1, 0xD + adds r0, r5, 0 + bl GetMonData + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r1, =gStringVar1 + adds r0, r5, 0 + bl GetMonNickname + ldr r0, =gStringVar2 + movs r1, 0xD + muls r1, r4 + ldr r2, =gMoveNames + adds r1, r2 + bl StringCopy + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9718 + + thumb_func_start sub_81B9770 +sub_81B9770: @ 81B9770 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r0, =gSpecialVar_0x8004 + mov r8, r0 + ldrh r0, [r0] + movs r6, 0x64 + muls r0, r6 + ldr r5, =gPlayerParty + adds r0, r5 + ldr r4, =gSpecialVar_0x8005 + ldrb r2, [r4] + movs r1, 0 + bl sub_80691F4 + mov r1, r8 + ldrh r0, [r1] + muls r0, r6 + adds r0, r5 + ldrb r1, [r4] + bl sub_806B9A8 + ldrh r4, [r4] + cmp r4, 0x2 + bhi _081B97C4 +_081B97A2: + ldr r0, =gSpecialVar_0x8004 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + lsls r1, r4, 24 + lsrs r1, 24 + adds r4, 0x1 + lsls r2, r4, 24 + lsrs r2, 24 + bl sub_81B97DC + lsls r4, 16 + lsrs r4, 16 + cmp r4, 0x2 + bls _081B97A2 +_081B97C4: + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9770 + + thumb_func_start sub_81B97DC +sub_81B97DC: @ 81B97DC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + mov r8, r0 + adds r5, r1, 0 + adds r4, r2, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + adds r0, 0xD + str r0, [sp, 0x8] + mov r0, r8 + ldr r1, [sp, 0x8] + bl GetMonData + mov r1, sp + adds r1, 0x2 + str r1, [sp, 0x14] + strh r0, [r1] + adds r3, r4, 0 + adds r3, 0xD + str r3, [sp, 0xC] + mov r0, r8 + adds r1, r3, 0 + bl GetMonData + mov r1, sp + strh r0, [r1] + adds r7, r5, 0 + adds r7, 0x11 + str r7, [sp, 0x10] + mov r0, r8 + adds r1, r7, 0 + bl GetMonData + mov r1, sp + adds r1, 0x5 + str r1, [sp, 0x18] + strb r0, [r1] + adds r3, r4, 0 + adds r3, 0x11 + str r3, [sp, 0x1C] + mov r0, r8 + adds r1, r3, 0 + bl GetMonData + add r7, sp, 0x4 + mov r10, r7 + strb r0, [r7] + mov r0, r8 + movs r1, 0x15 + bl GetMonData + mov r6, sp + adds r6, 0x6 + strb r0, [r6] + ldr r1, =gUnknown_08329D22 + adds r0, r5, r1 + ldrb r0, [r0] + mov r9, r0 + ldrb r0, [r6] + adds r2, r0, 0 + mov r3, r9 + ands r2, r3 + lsls r5, 1 + asrs r2, r5 + lsls r2, 24 + lsrs r2, 24 + adds r1, r4, r1 + ldrb r3, [r1] + adds r1, r0, 0 + ands r1, r3 + lsls r4, 1 + asrs r1, r4 + lsls r1, 24 + lsrs r1, 24 + mov r7, r9 + bics r0, r7 + strb r0, [r6] + ldrb r0, [r6] + bics r0, r3 + strb r0, [r6] + lsls r2, r4 + lsls r1, r5 + adds r2, r1 + ldrb r0, [r6] + orrs r0, r2 + strb r0, [r6] + mov r0, r8 + ldr r1, [sp, 0x8] + mov r2, sp + bl SetMonData + mov r0, r8 + ldr r1, [sp, 0xC] + ldr r2, [sp, 0x14] + bl SetMonData + mov r0, r8 + ldr r1, [sp, 0x10] + mov r2, r10 + bl SetMonData + mov r0, r8 + ldr r1, [sp, 0x1C] + ldr r2, [sp, 0x18] + bl SetMonData + mov r0, r8 + movs r1, 0x15 + adds r2, r6, 0 + bl SetMonData + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B97DC + + thumb_func_start sub_81B98DC +sub_81B98DC: @ 81B98DC + push {lr} + ldr r0, =gSpecialVar_0x8004 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + movs r1, 0x2D + bl GetMonData + adds r1, r0, 0 + cmp r1, 0 + beq _081B990C + ldr r1, =gScriptResult + movs r0, 0x1 + strh r0, [r1] + b _081B9910 + .pool +_081B990C: + ldr r0, =gScriptResult + strh r1, [r0] +_081B9910: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B98DC + + thumb_func_start sub_81B9918 +sub_81B9918: @ 81B9918 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] + ldr r0, =gSpecialVar_0x8004 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gPlayerParty + adds r0, r1 + ldr r1, =gSpecialVar_0x8005 + ldrh r1, [r1] + adds r1, 0xD + bl GetMonData + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + cmp r0, 0x39 + bne _081B999C + movs r6, 0 + b _081B9980 + .pool +_081B9958: + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + cmp r6, r0 + beq _081B997E + movs r4, 0 + movs r0, 0x64 + adds r5, r6, 0 + muls r5, r0 + ldr r7, =gPlayerParty +_081B996A: + adds r1, r4, 0 + adds r1, 0xD + adds r0, r5, r7 + bl GetMonData + cmp r0, 0x39 + beq _081B999C + adds r4, 0x1 + cmp r4, 0x3 + bls _081B996A +_081B997E: + adds r6, 0x1 +_081B9980: + bl calc_player_party_count + lsls r0, 24 + lsrs r0, 24 + cmp r6, r0 + bcc _081B9958 + mov r0, r8 + bl sub_80D23A8 + cmp r0, 0x1 + beq _081B999C + ldr r1, =gScriptResult + movs r0, 0x1 + strh r0, [r1] +_081B999C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9918 + + thumb_func_start sub_81B99B4 +sub_81B99B4: @ 81B99B4 + push {lr} + ldr r1, =gUnknown_086160B4 + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B99B4 + + thumb_func_start sub_81B99D4 +sub_81B99D4: @ 81B99D4 + push {lr} + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + movs r2, 0 + strb r2, [r0] + ldr r1, [r1] + ldr r3, =0x00000cb2 + adds r0, r1, r3 + strh r2, [r0] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0x4 + ldrsb r1, [r0, r1] + movs r2, 0x5 + ldrsb r2, [r0, r2] + movs r3, 0x1 + negs r3, r3 + movs r0, 0 + bl saved_warp2_set + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B99D4 + + thumb_func_start sub_81B9A28 +sub_81B9A28: @ 81B9A28 + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000e6a + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_81B9A28 + + thumb_func_start sub_81B9A44 +sub_81B9A44: @ 81B9A44 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =gSpecialVar_0x8006 + ldrh r1, [r1] + ldr r2, =0x00000e6a + adds r0, r2 + strh r1, [r0] + bx lr + .pool + thumb_func_end sub_81B9A44 + + thumb_func_start sub_81B9A60 +sub_81B9A60: @ 81B9A60 + push {r4,lr} + ldr r4, =gUnknown_02038BCA + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xFF + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + lsls r1, r0, 2 + adds r1, r0 + lsrs r1, 6 + strh r1, [r4] + ldrh r0, [r4] + movs r1, 0 + bl sub_8162614 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9A60 + + thumb_func_start sub_81B9A90 +sub_81B9A90: @ 81B9A90 + push {lr} + ldr r3, =gUnknown_02038BCA + ldrh r1, [r3] + ldr r0, =0x0000012b + cmp r1, r0 + bhi _081B9AAC + ldr r2, =gUnknown_0203BC88 + movs r0, 0x34 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0xC + bl ConvertBattleFrontierTrainerSpeechToString +_081B9AAC: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9A90 + + thumb_func_start sub_81B9ABC +sub_81B9ABC: @ 81B9ABC + push {r4,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =gSpecialVar_0x8005 + ldrh r1, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + strb r1, [r0] + movs r0, 0x80 + lsls r0, 7 + movs r1, 0 + bl VarSet + ldr r1, [r4] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl sub_81A4C30 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9ABC + + thumb_func_start sub_81B9B00 +sub_81B9B00: @ 81B9B00 + push {r4,r5,lr} + ldr r0, =gSaveBlock2Ptr + ldr r4, [r0] + ldr r5, =gUnknown_086160D4 + bl Random + ldrh r0, [r5] + ldr r1, =0x00000e6a + adds r4, r1 + strh r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9B00 + + thumb_func_start sub_81B9B28 +sub_81B9B28: @ 81B9B28 + push {r4,r5,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000e6a + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x1 + bl AddBagItem + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bne _081B9B70 + ldr r0, [r4] + ldr r1, =0x00000e6a + adds r0, r1 + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r0, [r4] + ldr r1, =0x00000e6a + adds r0, r1 + movs r1, 0 + strh r1, [r0] + ldr r0, =gScriptResult + strh r5, [r0] + b _081B9B76 + .pool +_081B9B70: + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] +_081B9B76: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9B28 + + thumb_func_start sub_81B9B80 +sub_81B9B80: @ 81B9B80 + push {lr} + ldr r1, =gUnknown_086160D8 + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9B80 + + thumb_func_start sub_81B9BA0 +sub_81B9BA0: @ 81B9BA0 + push {lr} + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + movs r2, 0 + strb r2, [r0] + ldr r1, [r1] + ldr r3, =0x00000cb2 + adds r0, r1, r3 + strh r2, [r0] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0x4 + ldrsb r1, [r0, r1] + movs r2, 0x5 + ldrsb r2, [r0, r2] + movs r3, 0x1 + negs r3, r3 + movs r0, 0 + bl saved_warp2_set + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9BA0 + + thumb_func_start sub_81B9BF4 +sub_81B9BF4: @ 81B9BF4 + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000e6c + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_81B9BF4 + + thumb_func_start sub_81B9C10 +sub_81B9C10: @ 81B9C10 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =gSpecialVar_0x8006 + ldrh r1, [r1] + ldr r2, =0x00000e6c + adds r0, r2 + strh r1, [r0] + bx lr + .pool + thumb_func_end sub_81B9C10 + + thumb_func_start sub_81B9C2C +sub_81B9C2C: @ 81B9C2C + push {r4,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =gSpecialVar_0x8005 + ldrh r1, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + strb r1, [r0] + movs r0, 0x80 + lsls r0, 7 + movs r1, 0 + bl VarSet + ldr r1, [r4] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl sub_81A4C30 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9C2C + + thumb_func_start sub_81B9C70 +sub_81B9C70: @ 81B9C70 + push {r4,r5,lr} + ldr r0, =gSaveBlock2Ptr + ldr r4, [r0] + ldr r5, =gUnknown_086160F4 + bl Random + ldrh r0, [r5] + ldr r1, =0x00000e6c + adds r4, r1 + strh r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9C70 + + thumb_func_start sub_81B9C98 +sub_81B9C98: @ 81B9C98 + push {r4,r5,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000e6c + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x1 + bl AddBagItem + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bne _081B9CE0 + ldr r0, [r4] + ldr r1, =0x00000e6c + adds r0, r1 + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r0, [r4] + ldr r1, =0x00000e6c + adds r0, r1 + movs r1, 0 + strh r1, [r0] + ldr r0, =gScriptResult + strh r5, [r0] + b _081B9CE6 + .pool +_081B9CE0: + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] +_081B9CE6: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9C98 + + thumb_func_start sub_81B9CF0 +sub_81B9CF0: @ 81B9CF0 + push {lr} + ldr r0, =gStringVar1 + ldr r1, =gUnknown_02038BCA + ldrh r1, [r1] + bl sub_8162E20 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9CF0 + + thumb_func_start sub_81B9D08 +sub_81B9D08: @ 81B9D08 + push {lr} + ldr r1, =gUnknown_086160F8 + ldr r0, =gSpecialVar_0x8004 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9D08 + + thumb_func_start sub_81B9D28 +sub_81B9D28: @ 81B9D28 + push {lr} + ldr r1, =gSaveBlock2Ptr + ldr r0, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + movs r2, 0 + strb r2, [r0] + ldr r1, [r1] + ldr r3, =0x00000cb2 + adds r0, r1, r3 + strh r2, [r0] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r0, =gSaveBlock1Ptr + ldr r0, [r0] + movs r1, 0x4 + ldrsb r1, [r0, r1] + movs r2, 0x5 + ldrsb r2, [r0, r2] + movs r3, 0x1 + negs r3, r3 + movs r0, 0 + bl saved_warp2_set + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9D28 + + thumb_func_start sub_81B9D7C +sub_81B9D7C: @ 81B9D7C + ldr r1, =gScriptResult + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r2, =0x00000e6e + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_81B9D7C + + thumb_func_start sub_81B9D98 +sub_81B9D98: @ 81B9D98 + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldr r1, =gSpecialVar_0x8006 + ldrh r1, [r1] + ldr r2, =0x00000e6e + adds r0, r2 + strh r1, [r0] + bx lr + .pool + thumb_func_end sub_81B9D98 + + thumb_func_start sub_81B9DB4 +sub_81B9DB4: @ 81B9DB4 + push {r4,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =gSpecialVar_0x8005 + ldrh r1, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + strb r1, [r0] + movs r0, 0x80 + lsls r0, 7 + movs r1, 0 + bl VarSet + ldr r1, [r4] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl sub_81A4C30 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9DB4 + + thumb_func_start sub_81B9DF8 +sub_81B9DF8: @ 81B9DF8 + push {r4,r5,lr} + ldr r0, =gSaveBlock2Ptr + ldr r4, [r0] + ldr r5, =gUnknown_08616120 + bl Random + ldrh r0, [r5] + ldr r1, =0x00000e6e + adds r4, r1 + strh r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9DF8 + + thumb_func_start sub_81B9E20 +sub_81B9E20: @ 81B9E20 + push {r4,r5,lr} + ldr r4, =gSaveBlock2Ptr + ldr r0, [r4] + ldr r1, =0x00000e6e + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x1 + bl AddBagItem + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bne _081B9E68 + ldr r0, [r4] + ldr r1, =0x00000e6e + adds r0, r1 + ldrh r0, [r0] + ldr r1, =gStringVar1 + bl CopyItemName + ldr r0, [r4] + ldr r1, =0x00000e6e + adds r0, r1 + movs r1, 0 + strh r1, [r0] + ldr r0, =gScriptResult + strh r5, [r0] + b _081B9E6E + .pool +_081B9E68: + ldr r1, =gScriptResult + movs r0, 0 + strh r0, [r1] +_081B9E6E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9E20 + + thumb_func_start sub_81B9E78 +sub_81B9E78: @ 81B9E78 + push {lr} + bl zero_player_party_data + bl sub_819A4F8 + pop {r0} + bx r0 + thumb_func_end sub_81B9E78 + + thumb_func_start sub_81B9E88 +sub_81B9E88: @ 81B9E88 + push {lr} + bl sub_819DC00 + pop {r0} + bx r0 + thumb_func_end sub_81B9E88 + + thumb_func_start sub_81B9E94 +sub_81B9E94: @ 81B9E94 + push {lr} + movs r2, 0 + ldr r1, =gUnknown_02037318 + ldrb r0, [r1, 0x14] + cmp r0, 0x8 + bne _081B9EB2 + ldr r3, =0xfffffe7f + adds r0, r3, 0 + ldrh r1, [r1, 0x12] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _081B9EB2 + movs r2, 0x1 +_081B9EB2: + adds r0, r2, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81B9E94 + + thumb_func_start sub_81B9EC0 +sub_81B9EC0: @ 81B9EC0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x3C + ldr r1, =gUnknown_0203BC88 + ldr r0, =gSlateportBattleTentTrainers + str r0, [r1] + add r0, sp, 0xC + mov r9, r0 + mov r1, sp + adds r1, 0x18 + str r1, [sp, 0x2C] + ldr r5, =gUnknown_0203BC8C + ldr r4, =gSlateportBattleTentMons + movs r2, 0 + adds r3, r1, 0 + mov r1, r9 + mov r0, sp + movs r6, 0x5 + mov r8, r6 +_081B9EEC: + strh r2, [r0] + strh r2, [r1] + strh r2, [r3] + adds r3, 0x2 + adds r1, 0x2 + adds r0, 0x2 + movs r7, 0x1 + negs r7, r7 + add r8, r7 + mov r6, r8 + cmp r6, 0 + bge _081B9EEC + str r4, [r5] + movs r7, 0 + mov r10, r7 + movs r0, 0 + mov r8, r0 + ldr r1, [sp, 0x2C] + str r1, [sp, 0x30] + mov r2, sp + str r2, [sp, 0x34] + lsls r6, r0, 1 + str r6, [sp, 0x24] + add r6, r9 + str r6, [sp, 0x28] +_081B9F1E: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x46 + bl __umodsi3 + lsls r0, 16 + lsrs r5, r0, 16 + movs r2, 0 + mov r7, r8 + adds r6, r2, r7 + cmp r2, r6 + bge _081B9F7C + ldr r1, [sp, 0x28] + ldrh r0, [r1] + cmp r0, r5 + beq _081B9F7C + ldr r0, =gUnknown_0203BC8C + ldr r1, [r0] + lsls r0, r5, 4 + adds r4, r0, r1 + ldrh r7, [r4] + mov r12, r7 + lsls r3, r2, 1 + ldr r1, [sp, 0x24] + add r1, sp + str r6, [sp, 0x38] +_081B9F56: + ldrh r0, [r1] + cmp r0, r12 + bne _081B9F66 + mov r0, r10 + cmp r0, 0 + bne _081B9F7C + ldrh r7, [r4] + mov r10, r7 +_081B9F66: + adds r3, 0x2 + adds r1, 0x2 + adds r2, 0x1 + ldr r0, [sp, 0x38] + cmp r2, r0 + bge _081B9F7C + mov r7, r9 + adds r0, r7, r3 + ldrh r0, [r0] + cmp r0, r5 + bne _081B9F56 +_081B9F7C: + cmp r2, r6 + bne _081BA01C + movs r2, 0 + cmp r2, r6 + bge _081B9FD4 + ldr r0, =gBattleFrontierHeldItems + mov r12, r0 + ldr r7, =gUnknown_0203BC8C + ldr r1, [sp, 0x24] + ldr r0, [sp, 0x2C] + adds r4, r1, r0 +_081B9F92: + ldrh r3, [r4] + cmp r3, 0 + beq _081B9FCC + ldr r1, [r7] + lsls r0, r5, 4 + adds r1, r0, r1 + ldrb r0, [r1, 0xA] + lsls r0, 1 + add r0, r12 + ldrh r0, [r0] + cmp r3, r0 + bne _081B9FCC + ldrh r0, [r1] + cmp r0, r10 + bne _081B9FD4 + movs r1, 0 + mov r10, r1 + b _081B9FD4 + .pool +_081B9FCC: + adds r4, 0x2 + adds r2, 0x1 + cmp r2, r6 + blt _081B9F92 +_081B9FD4: + cmp r2, r6 + bne _081BA01C + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + mov r2, r8 + lsls r3, r2, 1 + adds r0, r3, r2 + lsls r0, 2 + adds r1, r0 + movs r6, 0xE7 + lsls r6, 4 + adds r1, r6 + strh r5, [r1] + ldr r0, =gUnknown_0203BC8C + ldr r0, [r0] + lsls r1, r5, 4 + adds r1, r0 + ldrh r0, [r1] + ldr r7, [sp, 0x34] + strh r0, [r7] + ldr r2, =gBattleFrontierHeldItems + ldrb r0, [r1, 0xA] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + ldr r1, [sp, 0x30] + strh r0, [r1] + add r3, r9 + strh r5, [r3] + adds r1, 0x2 + str r1, [sp, 0x30] + adds r2, r7, 0 + adds r2, 0x2 + str r2, [sp, 0x34] + movs r6, 0x1 + add r8, r6 +_081BA01C: + mov r7, r8 + cmp r7, 0x6 + beq _081BA024 + b _081B9F1E +_081BA024: + add sp, 0x3C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81B9EC0 + + thumb_func_start sub_81BA040 +sub_81BA040: @ 81BA040 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + movs r0, 0 + mov r10, r0 + ldr r1, =gUnknown_0203BC88 + ldr r0, =gSlateportBattleTentTrainers + str r0, [r1] + ldr r1, =gUnknown_0203BC8C + ldr r0, =gSlateportBattleTentMons + str r0, [r1] + ldr r7, =gSaveBlock2Ptr + ldr r1, =0x0000ffff + mov r8, r1 +_081BA062: + mov r2, r10 + lsls r6, r2, 1 +_081BA066: + bl Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1E + bl __umodsi3 + lsls r0, 16 + lsrs r3, r0, 16 + movs r5, 0 + ldr r1, [r7] + ldr r4, =0x00000cb2 + adds r0, r1, r4 + ldrh r0, [r0] + cmp r5, r0 + bge _081BA0AA + ldr r2, =0x00000cb4 + adds r0, r1, r2 + ldrh r0, [r0] + cmp r0, r3 + beq _081BA0AA + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + adds r0, r1, r4 + ldrh r2, [r0] + adds r4, 0x2 + adds r1, r4 +_081BA09C: + adds r1, 0x2 + adds r5, 0x1 + cmp r5, r2 + bge _081BA0AA + ldrh r0, [r1] + cmp r0, r3 + bne _081BA09C +_081BA0AA: + ldr r0, [r7] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r0, [r0] + cmp r5, r0 + bne _081BA066 + ldr r2, =gUnknown_02038BCA + strh r3, [r2] + ldrh r3, [r2] + ldr r4, =gUnknown_0203BC88 + ldr r1, [r4] + movs r0, 0x34 + muls r0, r3 + adds r0, r1 + ldr r0, [r0, 0x30] + adds r1, r6, r0 + ldrh r0, [r1] + cmp r0, r8 + beq _081BA0DE + ldr r3, =0x0000ffff +_081BA0D2: + adds r1, 0x2 + movs r6, 0x1 + add r10, r6 + ldrh r0, [r1] + cmp r0, r3 + bne _081BA0D2 +_081BA0DE: + mov r0, r10 + cmp r0, 0x8 + bgt _081BA110 + movs r1, 0 + mov r10, r1 + b _081BA062 + .pool +_081BA110: + ldr r0, =gSaveBlock2Ptr + ldr r1, [r0] + ldr r6, =0x00000cb2 + adds r3, r1, r6 + ldrh r0, [r3] + cmp r0, 0x1 + bhi _081BA12A + lsls r0, 1 + ldr r3, =0x00000cb4 + adds r1, r3 + adds r1, r0 + ldrh r0, [r2] + strh r0, [r1] +_081BA12A: + ldrh r1, [r2] + ldr r2, [r4] + movs r0, 0x34 + muls r0, r1 + adds r0, r2 + ldr r0, [r0, 0x30] + mov r9, r0 + movs r5, 0 + ldr r7, =gUnknown_03001298 + mov r8, sp +_081BA13E: + bl Random + lsls r0, 16 + lsrs r0, 16 + mov r1, r10 + bl __modsi3 + lsls r0, 1 + add r0, r9 + ldrh r0, [r0] + strh r0, [r7] + movs r2, 0 + ldrh r0, [r7] + ldr r4, =gUnknown_0203BC8C + ldr r3, [r4] + lsls r0, 4 + adds r0, r3 + ldr r1, =gSaveBlock2Ptr + ldrh r6, [r0] + ldr r1, [r1] +_081BA166: + movs r4, 0xE7 + lsls r4, 4 + adds r0, r1, r4 + ldrh r0, [r0] + lsls r0, 4 + adds r0, r3 + ldrh r0, [r0] + cmp r6, r0 + beq _081BA180 + adds r1, 0xC + adds r2, 0x1 + cmp r2, 0x5 + ble _081BA166 +_081BA180: + cmp r2, 0x6 + bne _081BA220 + movs r4, 0 + cmp r4, r5 + bge _081BA1B0 + mov r0, sp + ldrh r0, [r0] + cmp r0, r6 + beq _081BA1B0 + ldr r6, =gUnknown_03001298 + ldr r3, =gUnknown_0203BC8C + mov r2, sp +_081BA198: + adds r2, 0x2 + adds r4, 0x1 + cmp r4, r5 + bge _081BA1B0 + ldrh r0, [r6] + ldr r1, [r3] + lsls r0, 4 + adds r0, r1 + ldrh r1, [r2] + ldrh r0, [r0] + cmp r1, r0 + bne _081BA198 +_081BA1B0: + cmp r4, r5 + bne _081BA220 + movs r4, 0 + cmp r4, r5 + bge _081BA1E6 + ldr r6, =gBattleFrontierHeldItems + mov r12, r6 + add r3, sp, 0x8 +_081BA1C0: + ldrh r2, [r3] + cmp r2, 0 + beq _081BA1DE + ldr r1, =gUnknown_03001298 + ldrh r0, [r1] + ldr r6, =gUnknown_0203BC8C + ldr r1, [r6] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0xA] + lsls r0, 1 + add r0, r12 + ldrh r0, [r0] + cmp r2, r0 + beq _081BA1E6 +_081BA1DE: + adds r3, 0x2 + adds r4, 0x1 + cmp r4, r5 + blt _081BA1C0 +_081BA1E6: + cmp r4, r5 + bne _081BA220 + lsls r2, r5, 1 + ldrh r0, [r7] + ldr r1, =gUnknown_0203BC8C + ldr r4, [r1] + lsls r0, 4 + adds r0, r4 + ldrh r0, [r0] + mov r3, r8 + strh r0, [r3] + add r1, sp, 0x8 + adds r1, r2 + ldr r3, =gBattleFrontierHeldItems + ldrh r0, [r7] + lsls r0, 4 + adds r0, r4 + ldrb r0, [r0, 0xA] + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + strh r0, [r1] + ldr r0, =gUnknown_03006298 + adds r2, r0 + ldrh r0, [r7] + strh r0, [r2] + movs r4, 0x2 + add r8, r4 + adds r5, 0x1 +_081BA220: + cmp r5, 0x3 + bne _081BA13E + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81BA040 + + thumb_func_start Font6Func +@ int Font6Func(struct TextPrinter *x) +Font6Func: @ 81BA250 + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r6, 0 + adds r4, 0x14 + ldrb r0, [r6, 0x1C] + cmp r0, 0x6 + bls _081BA260 + b _081BA660 +_081BA260: + lsls r0, 2 + ldr r1, =_081BA270 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081BA270: + .4byte _081BA28C + .4byte _081BA554 + .4byte _081BA566 + .4byte _081BA590 + .4byte _081BA5C8 + .4byte _081BA63C + .4byte _081BA64E +_081BA28C: + ldr r2, =gMain + ldrh r1, [r2, 0x2C] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _081BA2A6 + ldrb r1, [r4] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _081BA2A6 + movs r0, 0 + strb r0, [r6, 0x1E] +_081BA2A6: + ldrb r1, [r6, 0x1E] + cmp r1, 0 + beq _081BA2E8 + ldrb r0, [r6, 0x1D] + cmp r0, 0 + beq _081BA2E8 + subs r0, r1, 0x1 + strb r0, [r6, 0x1E] + ldr r0, =gTextFlags + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081BA2C4 + b _081BA50E +_081BA2C4: + ldrh r1, [r2, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _081BA2D0 + b _081BA50E +_081BA2D0: + ldrb r0, [r4] + movs r1, 0x10 + orrs r0, r1 + strb r0, [r4] + movs r0, 0 + strb r0, [r6, 0x1E] + b _081BA50E + .pool +_081BA2E8: + ldr r2, =gTextFlags + ldrb r1, [r2] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _081BA2FC + movs r0, 0x3 + b _081BA2FE + .pool +_081BA2FC: + ldrb r0, [r6, 0x1D] +_081BA2FE: + strb r0, [r6, 0x1E] + ldr r0, [r6] + ldrb r3, [r0] + adds r0, 0x1 + str r0, [r6] + adds r0, r3, 0 + subs r0, 0xF8 + cmp r0, 0x7 + bls _081BA312 + b _081BA52E +_081BA312: + lsls r0, 2 + ldr r1, =_081BA320 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081BA320: + .4byte _081BA524 + .4byte _081BA512 + .4byte _081BA504 + .4byte _081BA500 + .4byte _081BA36E + .4byte _081BA368 + .4byte _081BA340 + .4byte _081BA660 +_081BA340: + ldrb r0, [r6, 0x6] + strb r0, [r6, 0x8] + ldrb r1, [r6, 0x5] + ldr r0, =gFonts + ldr r2, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r6, 0xB] + ldrb r0, [r0, 0x5] + adds r1, r0 + ldrb r0, [r6, 0x9] + adds r0, r1 + strb r0, [r6, 0x9] +_081BA35E: + movs r0, 0x2 + b _081BA662 + .pool +_081BA368: + ldr r0, [r6] + adds r0, 0x1 + b _081BA4C4 +_081BA36E: + ldr r0, [r6] + ldrb r3, [r0] + adds r0, 0x1 + str r0, [r6] + subs r0, r3, 0x1 + cmp r0, 0xF + bls _081BA37E + b _081BA52E +_081BA37E: + lsls r0, 2 + ldr r1, =_081BA38C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081BA38C: + .4byte _081BA3CC + .4byte _081BA3EE + .4byte _081BA412 + .4byte _081BA42C + .4byte _081BA478 + .4byte _081BA47E + .4byte _081BA35E + .4byte _081BA498 + .4byte _081BA4A8 + .4byte _081BA4BC + .4byte _081BA4C0 + .4byte _081BA4C8 + .4byte _081BA4D2 + .4byte _081BA4DE + .4byte _081BA4EE + .4byte _081BA4C0 +_081BA3CC: + ldr r2, [r6] + ldrb r1, [r2] + lsls r1, 4 + ldrb r3, [r6, 0xC] + movs r0, 0xF + ands r0, r3 + orrs r0, r1 + strb r0, [r6, 0xC] + adds r2, 0x1 + str r2, [r6] + lsls r0, 24 + lsrs r0, 28 + ldrb r2, [r6, 0xD] + lsls r1, r2, 28 + lsrs r1, 28 + lsrs r2, 4 + b _081BA472 +_081BA3EE: + ldr r1, [r6] + ldrb r2, [r1] + movs r0, 0xF + ands r0, r2 + ldrb r3, [r6, 0xD] + movs r2, 0x10 + negs r2, r2 + ands r2, r3 + orrs r2, r0 + strb r2, [r6, 0xD] + adds r1, 0x1 + str r1, [r6] + ldrb r0, [r6, 0xC] + lsrs r0, 4 + lsls r1, r2, 28 + lsrs r1, 28 + lsrs r2, 4 + b _081BA472 +_081BA412: + ldr r1, [r6] + ldrb r0, [r1] + lsls r0, 4 + ldrb r3, [r6, 0xD] + movs r2, 0xF + ands r2, r3 + orrs r2, r0 + strb r2, [r6, 0xD] + adds r1, 0x1 + str r1, [r6] + ldrb r0, [r6, 0xC] + lsrs r0, 4 + b _081BA46A +_081BA42C: + ldr r3, [r6] + ldrb r1, [r3] + lsls r1, 4 + ldrb r4, [r6, 0xC] + movs r2, 0xF + adds r0, r2, 0 + ands r0, r4 + orrs r0, r1 + strb r0, [r6, 0xC] + adds r5, r3, 0x1 + str r5, [r6] + ldrb r3, [r3, 0x1] + adds r1, r2, 0 + ands r1, r3 + ldrb r4, [r6, 0xD] + movs r3, 0x10 + negs r3, r3 + ands r3, r4 + orrs r3, r1 + strb r3, [r6, 0xD] + adds r4, r5, 0x1 + str r4, [r6] + ldrb r1, [r5, 0x1] + lsls r1, 4 + ands r2, r3 + orrs r2, r1 + strb r2, [r6, 0xD] + adds r4, 0x1 + str r4, [r6] + lsls r0, 24 + lsrs r0, 28 +_081BA46A: + lsls r1, r2, 28 + lsrs r1, 28 + lsls r2, 24 + lsrs r2, 28 +_081BA472: + bl GenerateFontHalfRowLookupTable + b _081BA35E +_081BA478: + ldr r0, [r6] + adds r0, 0x1 + b _081BA4C4 +_081BA47E: + ldr r0, [r6] + ldrb r0, [r0] + movs r1, 0xF + ands r1, r0 + ldrb r2, [r4] + movs r0, 0x10 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4] + ldr r0, [r6] + adds r0, 0x1 + b _081BA4C4 +_081BA498: + ldr r0, [r6] + ldrb r1, [r0] + strb r1, [r6, 0x1E] + adds r0, 0x1 + str r0, [r6] + movs r0, 0x6 + strb r0, [r6, 0x1C] + b _081BA35E +_081BA4A8: + movs r0, 0x1 + strb r0, [r6, 0x1C] + ldrb r1, [r2] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _081BA50E + movs r0, 0 + strb r0, [r4, 0x2] + b _081BA50E +_081BA4BC: + movs r0, 0x5 + b _081BA64A +_081BA4C0: + ldr r0, [r6] + adds r0, 0x2 +_081BA4C4: + str r0, [r6] + b _081BA35E +_081BA4C8: + ldr r1, [r6] + adds r0, r1, 0x1 + str r0, [r6] + ldrb r3, [r1, 0x1] + b _081BA52E +_081BA4D2: + ldr r1, [r6] + ldrb r0, [r1] + ldrb r2, [r6, 0x6] + adds r0, r2 + strb r0, [r6, 0x8] + b _081BA4E8 +_081BA4DE: + ldr r1, [r6] + ldrb r0, [r1] + ldrb r2, [r6, 0x7] + adds r0, r2 + strb r0, [r6, 0x9] +_081BA4E8: + adds r1, 0x1 + str r1, [r6] + b _081BA35E +_081BA4EE: + ldrb r0, [r6, 0x4] + ldrb r2, [r6, 0xD] + lsls r2, 28 + lsrs r1, r2, 4 + orrs r1, r2 + lsrs r1, 24 + bl FillWindowPixelBuffer + b _081BA35E +_081BA500: + movs r0, 0x2 + b _081BA506 +_081BA504: + movs r0, 0x3 +_081BA506: + strb r0, [r6, 0x1C] + adds r0, r6, 0 + bl TextPrinterInitDownArrowCounters +_081BA50E: + movs r0, 0x3 + b _081BA662 +_081BA512: + ldr r0, [r6] + ldrb r3, [r0] + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + orrs r3, r1 + adds r0, 0x1 + str r0, [r6] + b _081BA52E +_081BA524: + ldr r0, [r6] + adds r0, 0x1 + str r0, [r6] + movs r0, 0 + b _081BA662 +_081BA52E: + adds r0, r3, 0 + bl DecompressGlyphFont6 + adds r0, r6, 0 + bl CopyGlyphToWindow + ldr r0, =gUnknown_03002F90 + adds r0, 0x80 + ldrb r1, [r6, 0xA] + ldrb r0, [r0] + adds r1, r0 + ldrb r0, [r6, 0x8] + adds r0, r1 + strb r0, [r6, 0x8] + movs r0, 0 + b _081BA662 + .pool +_081BA554: + adds r0, r6, 0 + bl TextPrinterWait + lsls r0, 16 + cmp r0, 0 + beq _081BA50E + movs r0, 0 + strb r0, [r6, 0x1C] + b _081BA50E +_081BA566: + adds r0, r6, 0 + bl TextPrinterWaitWithDownArrow + lsls r0, 16 + cmp r0, 0 + beq _081BA50E + ldrb r0, [r6, 0x4] + ldrb r2, [r6, 0xD] + lsls r2, 28 + lsrs r1, r2, 4 + orrs r1, r2 + lsrs r1, 24 + bl FillWindowPixelBuffer + ldrb r0, [r6, 0x6] + movs r1, 0 + strb r0, [r6, 0x8] + ldrb r0, [r6, 0x7] + strb r0, [r6, 0x9] + strb r1, [r6, 0x1C] + b _081BA50E +_081BA590: + adds r0, r6, 0 + bl TextPrinterWaitWithDownArrow + lsls r0, 16 + cmp r0, 0 + beq _081BA50E + adds r0, r6, 0 + bl TextPrinterClearDownArrow + ldrb r1, [r6, 0x5] + ldr r0, =gFonts + ldr r2, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r6, 0xB] + ldrb r0, [r0, 0x5] + adds r1, r0 + strb r1, [r6, 0x1F] + ldrb r0, [r6, 0x6] + strb r0, [r6, 0x8] + movs r0, 0x4 + strb r0, [r6, 0x1C] + b _081BA50E + .pool +_081BA5C8: + ldrb r2, [r6, 0x1F] + cmp r2, 0 + beq _081BA638 + ldr r4, =gUnknown_08616124 + ldr r5, =gSaveBlock2Ptr + ldr r0, [r5] + ldrb r0, [r0, 0x14] + lsls r1, r0, 29 + lsrs r0, r1, 29 + adds r0, r4 + ldrb r0, [r0] + cmp r2, r0 + bcs _081BA604 + ldrb r0, [r6, 0x4] + ldrb r1, [r6, 0xD] + lsls r1, 28 + lsrs r3, r1, 4 + orrs r3, r1 + lsrs r3, 24 + movs r1, 0 + bl ScrollWindow + movs r0, 0 + strb r0, [r6, 0x1F] + b _081BA62E + .pool +_081BA604: + ldrb r0, [r6, 0x4] + lsrs r1, 29 + adds r1, r4 + ldrb r2, [r1] + ldrb r1, [r6, 0xD] + lsls r1, 28 + lsrs r3, r1, 4 + orrs r3, r1 + lsrs r3, 24 + movs r1, 0 + bl ScrollWindow + ldr r0, [r5] + ldrb r0, [r0, 0x14] + lsls r0, 29 + lsrs r0, 29 + adds r0, r4 + ldrb r1, [r6, 0x1F] + ldrb r0, [r0] + subs r1, r0 + strb r1, [r6, 0x1F] +_081BA62E: + ldrb r0, [r6, 0x4] + movs r1, 0x2 + bl CopyWindowToVram + b _081BA50E +_081BA638: + strb r2, [r6, 0x1C] + b _081BA50E +_081BA63C: + bl IsSEPlaying + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _081BA64A + b _081BA50E +_081BA64A: + strb r0, [r6, 0x1C] + b _081BA50E +_081BA64E: + ldrb r0, [r6, 0x1E] + adds r1, r0, 0 + cmp r1, 0 + beq _081BA65C + subs r0, 0x1 + strb r0, [r6, 0x1E] + b _081BA50E +_081BA65C: + strb r1, [r6, 0x1C] + b _081BA50E +_081BA660: + movs r0, 0x1 +_081BA662: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end Font6Func + + thumb_func_start DecompressGlyphFont6 +DecompressGlyphFont6: @ 81BA668 + push {r4,r5,lr} + lsls r0, 16 + lsrs r2, r0, 19 + lsls r2, 9 + movs r1, 0xE0 + lsls r1, 11 + ands r1, r0 + lsrs r1, 11 + ldr r0, =gFont6BrailleGlyphs + adds r1, r0 + adds r5, r2, r1 + ldr r4, =gUnknown_03002F90 + adds r0, r5, 0 + adds r1, r4, 0 + bl DecompressGlyphTile + adds r0, r5, 0 + adds r0, 0x10 + adds r1, r4, 0 + adds r1, 0x20 + bl DecompressGlyphTile + movs r1, 0x80 + lsls r1, 1 + adds r0, r5, r1 + adds r1, r4, 0 + adds r1, 0x40 + bl DecompressGlyphTile + movs r1, 0x88 + lsls r1, 1 + adds r0, r5, r1 + adds r1, r4, 0 + adds r1, 0x60 + bl DecompressGlyphTile + adds r0, r4, 0 + adds r0, 0x80 + movs r1, 0x10 + strb r1, [r0] + adds r0, 0x1 + strb r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end DecompressGlyphFont6 + + thumb_func_start GetGlyphWidthFont6 +GetGlyphWidthFont6: @ 81BA6CC + movs r0, 0x10 + bx lr + thumb_func_end GetGlyphWidthFont6 + + + .align 2, 0 @ Don't pad with nop. \ No newline at end of file diff --git a/data/data2b.s b/data/data2b.s index 2bbd37f1c..6517d2724 100644 --- a/data/data2b.s +++ b/data/data2b.s @@ -584,7 +584,7 @@ gUnknown_0831C6A0:: @ 831C6A0 gUnknown_0831C6B0:: @ 831C6B0 .incbin "baserom.gba", 0x31c6b0, 0x18 -gUnknown_0831C6C8:: @ 831C6C8 +gOpponentBufferCommands:: @ 831C6C8 .incbin "baserom.gba", 0x31c6c8, 0xec gUnknown_0831C7B4:: @ 831C7B4 diff --git a/data/data_860A4AC.s b/data/data_860A4AC.s index 6f4988bc2..5bb627449 100644 --- a/data/data_860A4AC.s +++ b/data/data_860A4AC.s @@ -48,10 +48,10 @@ gUnknown_0860AE7C:: @ 860AE7C gUnknown_0860AE88:: @ 860AE88 .incbin "baserom.gba", 0x60ae88, 0x8 -gUnknown_0860AE90:: @ 860AE90 +gRecordedOpponentBufferCommands:: @ 860AE90 .incbin "baserom.gba", 0x60ae90, 0xe4 -gUnknown_0860AF74:: @ 860AF74 +gRecordedPlayerBufferCommands:: @ 860AF74 .incbin "baserom.gba", 0x60af74, 0xe4 gUnknown_0860B058:: @ 860B058 diff --git a/ld_script.txt b/ld_script.txt index 10fe3192a..c3c2b0de9 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -209,6 +209,9 @@ SECTIONS { asm/rom_817C95C.o(.text); asm/front_pic_anim.o(.text); asm/rom_8184DA4.o(.text); + asm/battle_controller_recorded_opponent.o(.text); + asm/battle_controller_recorded_player.o(.text); + asm/rom_818CFC8.o(.text); src/multiboot.o(.text); asm/rom_81BAD84.o(.text); asm/battle_controller_player_partner.o(.text); diff --git a/sym_common.txt b/sym_common.txt index 7190b0104..dbf6c17a8 100644 --- a/sym_common.txt +++ b/sym_common.txt @@ -206,7 +206,7 @@ gUnknown_03005CDE: @ 3005CDE gUnknown_03005D00: @ 3005D00 .space 0x4 -gUnknown_03005D04: @ 3005D04 +gBattleMainFunc: @ 3005D04 .space 0xC gUnknown_03005D10: @ 3005D10